@poap-xyz/drops
Advanced tools
Comparing version 0.0.14 to 0.0.15
export declare function filterUndefinedProperties<T extends Record<string, any>>(obj: T): Partial<T>; | ||
export declare function createFilter(key: string, value?: string): Record<string, any>; | ||
export declare function creatEqFilter(key: string, value?: string | number): 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>; |
@@ -11,3 +11,3 @@ /// <reference types="node" /> | ||
to?: string; | ||
id?: number; | ||
ids?: number[]; | ||
} | ||
@@ -14,0 +14,0 @@ export interface CreateDropsInput { |
export declare function filterUndefinedProperties<T extends Record<string, any>>(obj: T): Partial<T>; | ||
export declare function createFilter(key: string, value?: string): Record<string, any>; | ||
export declare function creatEqFilter(key: string, value?: string | number): 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>; |
@@ -11,3 +11,3 @@ /// <reference types="node" /> | ||
to?: string; | ||
id?: number; | ||
ids?: number[]; | ||
} | ||
@@ -14,0 +14,0 @@ export interface CreateDropsInput { |
@@ -83,4 +83,4 @@ (function (global, factory) { | ||
} | ||
function creatEqFilter(key, value) { | ||
return value ? { [key]: { _eq: value } } : {}; | ||
function createInFilter(key, values) { | ||
return values && values.length ? { [key]: { _in: values } } : {}; | ||
} | ||
@@ -102,3 +102,3 @@ function createBetweenFilter(key, from, to) { | ||
async fetch(input) { | ||
const { limit, offset, order, name, nameOrder, idOrder, from, to, id } = input; | ||
const { limit, offset, order, name, nameOrder, idOrder, from, to, ids } = input; | ||
const variables = { | ||
@@ -116,3 +116,3 @@ limit, | ||
...createBetweenFilter('created_date', from, to), | ||
...creatEqFilter('id', id), | ||
...createInFilter('id', ids), | ||
}, | ||
@@ -119,0 +119,0 @@ }; |
export declare function filterUndefinedProperties<T extends Record<string, any>>(obj: T): Partial<T>; | ||
export declare function createFilter(key: string, value?: string): Record<string, any>; | ||
export declare function creatEqFilter(key: string, value?: string | number): 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>; |
@@ -11,3 +11,3 @@ /// <reference types="node" /> | ||
to?: string; | ||
id?: number; | ||
ids?: number[]; | ||
} | ||
@@ -14,0 +14,0 @@ export interface CreateDropsInput { |
{ | ||
"name": "@poap-xyz/drops", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"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
69822
875