@poap-xyz/drops
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -1,2 +0,2 @@ | ||
export declare const PAGINATED_DROPS_QUERY = "\n query PaginatedDrops(\n $limit: Int!\n $offset: Int!\n $orderBy: [drops_order_by!]\n $where: drops_bool_exp\n ) {\n drops(limit: $limit, offset: $offset, order_by: $orderBy, where: $where) {\n id\n fancy_id\n name\n description\n city\n country\n channel\n platform\n location_type\n drop_url\n image_url\n animation_url\n year\n start_date\n timezone\n private\n created_date\n attributes_aggregate {\n aggregate {\n count\n }\n }\n }\n drops_aggregate(where: $where) {\n aggregate {\n count\n }\n }\n }\n"; | ||
export declare const PAGINATED_DROPS_QUERY = "\n query PaginatedDrops(\n $limit: Int!\n $offset: Int!\n $orderBy: [drops_order_by!]\n $where: drops_bool_exp\n ) {\n drops(limit: $limit, offset: $offset, order_by: $orderBy, where: $where) {\n id\n fancy_id\n name\n description\n city\n country\n channel\n platform\n location_type\n drop_url\n image_url\n animation_url\n year\n start_date\n timezone\n private\n created_date\n }\n drops_aggregate(where: $where) {\n aggregate {\n count\n }\n }\n }\n"; | ||
export interface DropResponse { | ||
@@ -20,7 +20,2 @@ id: number; | ||
created_date: string; | ||
attributes_aggregate: { | ||
aggregate: { | ||
count: number; | ||
}; | ||
}; | ||
} | ||
@@ -27,0 +22,0 @@ export interface PaginatedDropsResponse { |
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 createMetadataFilter(withMetadata?: string): Record<string, any>; | ||
export declare function creatEqFilter(key: string, value?: string | number): Record<string, any>; | ||
export declare function createBetweenFilter(key: string, from?: string, to?: string): Record<string, any>; |
@@ -6,8 +6,5 @@ /// <reference types="node" /> | ||
order?: string; | ||
key?: string; | ||
value?: string; | ||
name?: string; | ||
nameOrder?: string; | ||
idOrder?: string; | ||
withMetadata?: string; | ||
from?: string; | ||
@@ -14,0 +11,0 @@ to?: string; |
@@ -1,2 +0,2 @@ | ||
export declare const PAGINATED_DROPS_QUERY = "\n query PaginatedDrops(\n $limit: Int!\n $offset: Int!\n $orderBy: [drops_order_by!]\n $where: drops_bool_exp\n ) {\n drops(limit: $limit, offset: $offset, order_by: $orderBy, where: $where) {\n id\n fancy_id\n name\n description\n city\n country\n channel\n platform\n location_type\n drop_url\n image_url\n animation_url\n year\n start_date\n timezone\n private\n created_date\n attributes_aggregate {\n aggregate {\n count\n }\n }\n }\n drops_aggregate(where: $where) {\n aggregate {\n count\n }\n }\n }\n"; | ||
export declare const PAGINATED_DROPS_QUERY = "\n query PaginatedDrops(\n $limit: Int!\n $offset: Int!\n $orderBy: [drops_order_by!]\n $where: drops_bool_exp\n ) {\n drops(limit: $limit, offset: $offset, order_by: $orderBy, where: $where) {\n id\n fancy_id\n name\n description\n city\n country\n channel\n platform\n location_type\n drop_url\n image_url\n animation_url\n year\n start_date\n timezone\n private\n created_date\n }\n drops_aggregate(where: $where) {\n aggregate {\n count\n }\n }\n }\n"; | ||
export interface DropResponse { | ||
@@ -20,7 +20,2 @@ id: number; | ||
created_date: string; | ||
attributes_aggregate: { | ||
aggregate: { | ||
count: number; | ||
}; | ||
}; | ||
} | ||
@@ -27,0 +22,0 @@ export interface PaginatedDropsResponse { |
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 createMetadataFilter(withMetadata?: string): Record<string, any>; | ||
export declare function creatEqFilter(key: string, value?: string | number): Record<string, any>; | ||
export declare function createBetweenFilter(key: string, from?: string, to?: string): Record<string, any>; |
@@ -6,8 +6,5 @@ /// <reference types="node" /> | ||
order?: string; | ||
key?: string; | ||
value?: string; | ||
name?: string; | ||
nameOrder?: string; | ||
idOrder?: string; | ||
withMetadata?: string; | ||
from?: string; | ||
@@ -14,0 +11,0 @@ to?: string; |
@@ -55,7 +55,2 @@ (function (global, factory) { | ||
created_date | ||
attributes_aggregate { | ||
aggregate { | ||
count | ||
} | ||
} | ||
} | ||
@@ -82,11 +77,2 @@ drops_aggregate(where: $where) { | ||
} | ||
function createMetadataFilter(withMetadata) { | ||
return withMetadata | ||
? { | ||
attributes_aggregate: { | ||
count: { predicate: { _eq: withMetadata === 'no' ? 0 : { _gt: 0 } } }, | ||
}, | ||
} | ||
: {}; | ||
} | ||
function creatEqFilter(key, value) { | ||
@@ -110,3 +96,3 @@ return value ? { [key]: { _eq: value } } : {}; | ||
async fetch(input) { | ||
const { limit, offset, order, key, value, name, nameOrder, idOrder, withMetadata, from, to, id, } = input; | ||
const { limit, offset, order, name, nameOrder, idOrder, from, to, id } = input; | ||
const variables = { | ||
@@ -123,6 +109,3 @@ limit, | ||
...createFilter('name', name), | ||
...createFilter('attributes.key', key), | ||
...createFilter('attributes.value', value), | ||
...createBetweenFilter('created_date', from, to), | ||
...createMetadataFilter(withMetadata), | ||
...creatEqFilter('id', id), | ||
@@ -129,0 +112,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
export declare const PAGINATED_DROPS_QUERY = "\n query PaginatedDrops(\n $limit: Int!\n $offset: Int!\n $orderBy: [drops_order_by!]\n $where: drops_bool_exp\n ) {\n drops(limit: $limit, offset: $offset, order_by: $orderBy, where: $where) {\n id\n fancy_id\n name\n description\n city\n country\n channel\n platform\n location_type\n drop_url\n image_url\n animation_url\n year\n start_date\n timezone\n private\n created_date\n attributes_aggregate {\n aggregate {\n count\n }\n }\n }\n drops_aggregate(where: $where) {\n aggregate {\n count\n }\n }\n }\n"; | ||
export declare const PAGINATED_DROPS_QUERY = "\n query PaginatedDrops(\n $limit: Int!\n $offset: Int!\n $orderBy: [drops_order_by!]\n $where: drops_bool_exp\n ) {\n drops(limit: $limit, offset: $offset, order_by: $orderBy, where: $where) {\n id\n fancy_id\n name\n description\n city\n country\n channel\n platform\n location_type\n drop_url\n image_url\n animation_url\n year\n start_date\n timezone\n private\n created_date\n }\n drops_aggregate(where: $where) {\n aggregate {\n count\n }\n }\n }\n"; | ||
export interface DropResponse { | ||
@@ -20,7 +20,2 @@ id: number; | ||
created_date: string; | ||
attributes_aggregate: { | ||
aggregate: { | ||
count: number; | ||
}; | ||
}; | ||
} | ||
@@ -27,0 +22,0 @@ export interface PaginatedDropsResponse { |
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 createMetadataFilter(withMetadata?: string): Record<string, any>; | ||
export declare function creatEqFilter(key: string, value?: string | number): Record<string, any>; | ||
export declare function createBetweenFilter(key: string, from?: string, to?: string): Record<string, any>; |
@@ -6,8 +6,5 @@ /// <reference types="node" /> | ||
order?: string; | ||
key?: string; | ||
value?: string; | ||
name?: string; | ||
nameOrder?: string; | ||
idOrder?: string; | ||
withMetadata?: string; | ||
from?: string; | ||
@@ -14,0 +11,0 @@ to?: string; |
{ | ||
"name": "@poap-xyz/drops", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"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
62407
800