@poap-xyz/drops
Advanced tools
Comparing version 0.1.3-beta-v2 to 0.1.3-beta-v3
@@ -1,2 +0,1 @@ | ||
import { DropImage } from '../types/dropImage'; | ||
export declare class Drop { | ||
@@ -26,3 +25,2 @@ id: number; | ||
emailReservationCount: number; | ||
dropImage?: DropImage; | ||
constructor(properties: DropProperties); | ||
@@ -81,3 +79,2 @@ getTotalMinted(): number; | ||
emailReservationCount: number; | ||
dropImage?: DropImage; | ||
} |
import { DropImageGatewayType } from '../types/dropImage'; | ||
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 expiry_date\n end_date\n stats_by_chain_aggregate {\n aggregate {\n sum {\n transfer_count\n poap_count\n }\n }\n }\n email_claims_stats {\n total\n }\n drop_image {\n id\n public_id\n mime_type\n gateways {\n id\n image_id\n type\n url\n filename\n mime_type\n }\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 expiry_date\n end_date\n stats_by_chain_aggregate {\n aggregate {\n sum {\n transfer_count\n poap_count\n }\n }\n }\n email_claims_stats {\n total\n }\n drop_image {\n gateways {\n type\n url\n }\n }\n }\n }\n"; | ||
export interface DropImageGatewayResponse { | ||
id: number; | ||
image_id: string; | ||
type: DropImageGatewayType; | ||
url: string; | ||
filename: string; | ||
mime_type: string; | ||
} | ||
export interface DropImageResponse { | ||
id: number; | ||
public_id: string; | ||
mime_type: string; | ||
gateways: Array<DropImageGatewayResponse>; | ||
@@ -16,0 +9,0 @@ } |
@@ -5,15 +5,5 @@ export declare enum DropImageGatewayType { | ||
} | ||
export interface DropImageGateway { | ||
id: number; | ||
imageId: string; | ||
url: string; | ||
filename: string; | ||
mimeType: string; | ||
} | ||
export interface DropImage { | ||
id: number; | ||
publicId: string; | ||
mimeType: string; | ||
original?: DropImageGateway; | ||
crop?: DropImageGateway; | ||
original?: string; | ||
crop?: string; | ||
} |
@@ -1,2 +0,1 @@ | ||
import { DropImage } from '../types/dropImage'; | ||
export declare class Drop { | ||
@@ -26,3 +25,2 @@ id: number; | ||
emailReservationCount: number; | ||
dropImage?: DropImage; | ||
constructor(properties: DropProperties); | ||
@@ -81,3 +79,2 @@ getTotalMinted(): number; | ||
emailReservationCount: number; | ||
dropImage?: DropImage; | ||
} |
import { DropImageGatewayType } from '../types/dropImage'; | ||
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 expiry_date\n end_date\n stats_by_chain_aggregate {\n aggregate {\n sum {\n transfer_count\n poap_count\n }\n }\n }\n email_claims_stats {\n total\n }\n drop_image {\n id\n public_id\n mime_type\n gateways {\n id\n image_id\n type\n url\n filename\n mime_type\n }\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 expiry_date\n end_date\n stats_by_chain_aggregate {\n aggregate {\n sum {\n transfer_count\n poap_count\n }\n }\n }\n email_claims_stats {\n total\n }\n drop_image {\n gateways {\n type\n url\n }\n }\n }\n }\n"; | ||
export interface DropImageGatewayResponse { | ||
id: number; | ||
image_id: string; | ||
type: DropImageGatewayType; | ||
url: string; | ||
filename: string; | ||
mime_type: string; | ||
} | ||
export interface DropImageResponse { | ||
id: number; | ||
public_id: string; | ||
mime_type: string; | ||
gateways: Array<DropImageGatewayResponse>; | ||
@@ -16,0 +9,0 @@ } |
@@ -5,15 +5,5 @@ export declare enum DropImageGatewayType { | ||
} | ||
export interface DropImageGateway { | ||
id: number; | ||
imageId: string; | ||
url: string; | ||
filename: string; | ||
mimeType: string; | ||
} | ||
export interface DropImage { | ||
id: number; | ||
publicId: string; | ||
mimeType: string; | ||
original?: DropImageGateway; | ||
crop?: DropImageGateway; | ||
original?: string; | ||
crop?: string; | ||
} |
@@ -1,2 +0,1 @@ | ||
import { DropImage } from '../types/dropImage'; | ||
export declare class Drop { | ||
@@ -26,3 +25,2 @@ id: number; | ||
emailReservationCount: number; | ||
dropImage?: DropImage; | ||
constructor(properties: DropProperties); | ||
@@ -81,3 +79,2 @@ getTotalMinted(): number; | ||
emailReservationCount: number; | ||
dropImage?: DropImage; | ||
} |
@@ -32,3 +32,2 @@ (function (global, factory) { | ||
this.endDate = properties.endDate; | ||
this.dropImage = properties.dropImage; | ||
} | ||
@@ -106,12 +105,5 @@ getTotalMinted() { | ||
drop_image { | ||
id | ||
public_id | ||
mime_type | ||
gateways { | ||
id | ||
image_id | ||
type | ||
url | ||
filename | ||
mime_type | ||
} | ||
@@ -199,3 +191,3 @@ } | ||
const drops = data.drops.map((drop) => { | ||
const { imageUrl, originalImageUrl, dropImage } = this.computeDropImages(drop); | ||
const { imageUrl, originalImageUrl } = this.computeDropImages(drop); | ||
return new Drop({ | ||
@@ -231,3 +223,2 @@ id: Number(drop.id), | ||
endDate: new Date(drop.end_date), | ||
dropImage, | ||
}); | ||
@@ -304,8 +295,6 @@ }); | ||
computeDropImages(drop) { | ||
var _a, _b; | ||
const dropImage = this.mapDropImage(drop.drop_image); | ||
return { | ||
dropImage, | ||
imageUrl: ((_a = dropImage === null || dropImage === void 0 ? void 0 : dropImage.crop) === null || _a === void 0 ? void 0 : _a.url) || drop.image_url, | ||
originalImageUrl: ((_b = dropImage === null || dropImage === void 0 ? void 0 : dropImage.original) === null || _b === void 0 ? void 0 : _b.url) || drop.image_url, | ||
imageUrl: (dropImage === null || dropImage === void 0 ? void 0 : dropImage.crop) || drop.image_url, | ||
originalImageUrl: (dropImage === null || dropImage === void 0 ? void 0 : dropImage.original) || drop.image_url, | ||
}; | ||
@@ -316,9 +305,4 @@ } | ||
return response; | ||
const images = response.gateways.reduce((acc, gateway) => ({ ...acc, [gateway.type.toLowerCase()]: gateway }), {}); | ||
return { | ||
id: response.id, | ||
publicId: response.public_id, | ||
mimeType: response.mime_type, | ||
...images, | ||
}; | ||
const images = response.gateways.reduce((acc, gateway) => ({ ...acc, [gateway.type.toLowerCase()]: gateway.url }), {}); | ||
return { ...images }; | ||
} | ||
@@ -325,0 +309,0 @@ } |
import { DropImageGatewayType } from '../types/dropImage'; | ||
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 expiry_date\n end_date\n stats_by_chain_aggregate {\n aggregate {\n sum {\n transfer_count\n poap_count\n }\n }\n }\n email_claims_stats {\n total\n }\n drop_image {\n id\n public_id\n mime_type\n gateways {\n id\n image_id\n type\n url\n filename\n mime_type\n }\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 expiry_date\n end_date\n stats_by_chain_aggregate {\n aggregate {\n sum {\n transfer_count\n poap_count\n }\n }\n }\n email_claims_stats {\n total\n }\n drop_image {\n gateways {\n type\n url\n }\n }\n }\n }\n"; | ||
export interface DropImageGatewayResponse { | ||
id: number; | ||
image_id: string; | ||
type: DropImageGatewayType; | ||
url: string; | ||
filename: string; | ||
mime_type: string; | ||
} | ||
export interface DropImageResponse { | ||
id: number; | ||
public_id: string; | ||
mime_type: string; | ||
gateways: Array<DropImageGatewayResponse>; | ||
@@ -16,0 +9,0 @@ } |
@@ -5,15 +5,5 @@ export declare enum DropImageGatewayType { | ||
} | ||
export interface DropImageGateway { | ||
id: number; | ||
imageId: string; | ||
url: string; | ||
filename: string; | ||
mimeType: string; | ||
} | ||
export interface DropImage { | ||
id: number; | ||
publicId: string; | ||
mimeType: string; | ||
original?: DropImageGateway; | ||
crop?: DropImageGateway; | ||
original?: string; | ||
crop?: string; | ||
} |
{ | ||
"name": "@poap-xyz/drops", | ||
"version": "0.1.3-beta-v2", | ||
"version": "0.1.3-beta-v3", | ||
"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
128709
1473