@poap-xyz/drops
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -5,3 +5,4 @@ export declare function filterUndefinedProperties<T extends Record<string, any>>(obj: T): Partial<T>; | ||
export declare function creatEqFilter(key: string, value?: string | number): Record<string, any>; | ||
export declare function creatPrivateFilter(key: string, value?: boolean): Record<string, any>; | ||
export declare function createInFilter(key: string, values?: Array<string | number>): Record<string, any>; | ||
export declare function createBetweenFilter(key: string, from?: string, to?: string): Record<string, any>; |
@@ -17,2 +17,3 @@ /// <reference types="node" /> | ||
ids?: number[]; | ||
is_private?: boolean; | ||
} | ||
@@ -19,0 +20,0 @@ export interface CreateDropsInput { |
@@ -5,3 +5,4 @@ export declare function filterUndefinedProperties<T extends Record<string, any>>(obj: T): Partial<T>; | ||
export declare function creatEqFilter(key: string, value?: string | number): Record<string, any>; | ||
export declare function creatPrivateFilter(key: string, value?: boolean): Record<string, any>; | ||
export declare function createInFilter(key: string, values?: Array<string | number>): Record<string, any>; | ||
export declare function createBetweenFilter(key: string, from?: string, to?: string): Record<string, any>; |
@@ -17,2 +17,3 @@ /// <reference types="node" /> | ||
ids?: number[]; | ||
is_private?: boolean; | ||
} | ||
@@ -19,0 +20,0 @@ export interface CreateDropsInput { |
@@ -111,2 +111,7 @@ (function (global, factory) { | ||
} | ||
function creatPrivateFilter(key, value) { | ||
return typeof value === 'boolean' | ||
? { [key]: { _eq: value ? 'true' : 'false' } } | ||
: {}; | ||
} | ||
function createInFilter(key, values) { | ||
@@ -130,3 +135,3 @@ return values && values.length ? { [key]: { _in: values } } : {}; | ||
async fetch(input) { | ||
const { limit, offset, name, sort_field, sort_dir, from, to, ids } = input; | ||
const { limit, offset, name, sort_field, sort_dir, from, to, ids, is_private, } = input; | ||
const variables = { | ||
@@ -137,3 +142,3 @@ limit, | ||
where: { | ||
private: { _eq: 'false' }, | ||
...creatPrivateFilter('private', is_private), | ||
...createFilter('name', name), | ||
@@ -140,0 +145,0 @@ ...createBetweenFilter('created_date', from, to), |
@@ -5,3 +5,4 @@ export declare function filterUndefinedProperties<T extends Record<string, any>>(obj: T): Partial<T>; | ||
export declare function creatEqFilter(key: string, value?: string | number): Record<string, any>; | ||
export declare function creatPrivateFilter(key: string, value?: boolean): Record<string, any>; | ||
export declare function createInFilter(key: string, values?: Array<string | number>): Record<string, any>; | ||
export declare function createBetweenFilter(key: string, from?: string, to?: string): Record<string, any>; |
@@ -17,2 +17,3 @@ /// <reference types="node" /> | ||
ids?: number[]; | ||
is_private?: boolean; | ||
} | ||
@@ -19,0 +20,0 @@ export interface CreateDropsInput { |
{ | ||
"name": "@poap-xyz/drops", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "Drops module for the poap.js library", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
92293
1073