@merkl/api 0.19.11 → 0.19.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/database/api/seeder/resources/protocol.d.ts +3 -10
- package/dist/database/api/seeder/resources/protocol.js +3 -10
- package/dist/src/eden/index.d.ts +460 -456
- package/dist/src/index.d.ts +168 -160
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +199 -158
- package/dist/src/modules/v4/campaign/campaign.controller.js +28 -32
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +3 -1
- package/dist/src/modules/v4/campaign/campaign.model.js +2 -1
- package/dist/src/modules/v4/campaign/campaign.repository.js +1 -1
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +5 -10
- package/dist/src/modules/v4/campaign/campaign.service.js +3 -2
- package/dist/src/modules/v4/enso/enso.model.d.ts +2 -2
- package/dist/src/modules/v4/enso/enso.model.js +2 -2
- package/dist/src/modules/v4/kyberzap/kyberzap.model.d.ts +4 -4
- package/dist/src/modules/v4/kyberzap/kyberzap.model.js +4 -4
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +4 -3
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -1
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +5 -6
- package/dist/src/modules/v4/opportunity/opportunity.service.js +6 -9
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
- package/dist/src/modules/v4/protocol/protocol.model.js +5 -8
- package/dist/src/modules/v4/protocol/protocol.service.js +0 -17
- package/dist/src/modules/v4/router.d.ts +168 -160
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -164,34 +164,13 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
164
164
|
};
|
165
165
|
};
|
166
166
|
} & {
|
167
|
-
|
167
|
+
":id": {
|
168
168
|
get: {
|
169
169
|
body: unknown;
|
170
|
-
params: {
|
171
|
-
|
172
|
-
type?: string | undefined;
|
173
|
-
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
174
|
-
items?: number | undefined;
|
175
|
-
subType?: number | undefined;
|
176
|
-
page?: number | undefined;
|
177
|
-
types?: string[] | undefined;
|
178
|
-
campaignId?: string | undefined;
|
179
|
-
opportunityId?: string | undefined;
|
180
|
-
startTimestamp?: string | undefined;
|
181
|
-
endTimestamp?: string | undefined;
|
182
|
-
creatorAddress?: string | undefined;
|
183
|
-
chainId?: number | undefined;
|
184
|
-
creatorId?: string | undefined;
|
185
|
-
mainParameter?: string | undefined;
|
186
|
-
point?: boolean | undefined;
|
187
|
-
tokenAddress?: string | undefined;
|
188
|
-
test?: boolean | undefined;
|
189
|
-
createdAfter?: number | undefined;
|
190
|
-
creatorTag?: string | undefined;
|
191
|
-
distributionChainIds?: number[] | undefined;
|
192
|
-
tokenSymbol?: string | undefined;
|
193
|
-
withOpportunity?: boolean | undefined;
|
170
|
+
params: {
|
171
|
+
id: string;
|
194
172
|
};
|
173
|
+
query: unknown;
|
195
174
|
headers: unknown;
|
196
175
|
response: {
|
197
176
|
200: {
|
@@ -237,6 +216,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
237
216
|
address: string;
|
238
217
|
creatorId: string | null;
|
239
218
|
};
|
219
|
+
createdAt: string;
|
240
220
|
Opportunity: {
|
241
221
|
id: string;
|
242
222
|
name: string;
|
@@ -261,20 +241,119 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
261
241
|
rewardTokenId: string;
|
262
242
|
amount: string;
|
263
243
|
opportunityId: string;
|
264
|
-
|
265
|
-
createdAt: Date;
|
266
|
-
}[];
|
244
|
+
};
|
267
245
|
};
|
268
246
|
};
|
269
247
|
};
|
270
248
|
} & {
|
271
|
-
"
|
249
|
+
"campaigns-to-process": {
|
250
|
+
index: {
|
251
|
+
get: {
|
252
|
+
body: unknown;
|
253
|
+
params: {};
|
254
|
+
query: {
|
255
|
+
chainId: number;
|
256
|
+
};
|
257
|
+
headers: unknown;
|
258
|
+
response: {
|
259
|
+
200: {
|
260
|
+
campaignId: string;
|
261
|
+
endTimestamp: bigint;
|
262
|
+
CampaignStatus: {
|
263
|
+
status: import("@db/api").$Enums.RunStatus;
|
264
|
+
computedUntil: bigint;
|
265
|
+
processingStarted: bigint;
|
266
|
+
}[];
|
267
|
+
}[];
|
268
|
+
};
|
269
|
+
};
|
270
|
+
};
|
271
|
+
};
|
272
|
+
} & {
|
273
|
+
"campaigns-to-process": {
|
274
|
+
count: {
|
275
|
+
get: {
|
276
|
+
body: unknown;
|
277
|
+
params: {};
|
278
|
+
query: {
|
279
|
+
chainId: number;
|
280
|
+
};
|
281
|
+
headers: unknown;
|
282
|
+
response: {
|
283
|
+
200: number;
|
284
|
+
};
|
285
|
+
};
|
286
|
+
};
|
287
|
+
};
|
288
|
+
} & {
|
289
|
+
"campaigns-to-process": {
|
290
|
+
next: {
|
291
|
+
get: {
|
292
|
+
body: unknown;
|
293
|
+
params: {};
|
294
|
+
query: {
|
295
|
+
chainId: number;
|
296
|
+
};
|
297
|
+
headers: unknown;
|
298
|
+
response: {
|
299
|
+
200: {
|
300
|
+
campaignId: string;
|
301
|
+
};
|
302
|
+
};
|
303
|
+
};
|
304
|
+
};
|
305
|
+
};
|
306
|
+
} & {
|
307
|
+
"campaigns-to-process": {
|
308
|
+
engine: {
|
309
|
+
post: {
|
310
|
+
body: unknown;
|
311
|
+
params: {};
|
312
|
+
query: {
|
313
|
+
chainId: number;
|
314
|
+
};
|
315
|
+
headers: {
|
316
|
+
authorization: string;
|
317
|
+
};
|
318
|
+
response: {
|
319
|
+
200: {
|
320
|
+
campaignId: string;
|
321
|
+
};
|
322
|
+
};
|
323
|
+
};
|
324
|
+
};
|
325
|
+
};
|
326
|
+
};
|
327
|
+
} & {
|
328
|
+
campaigns: {
|
329
|
+
index: {
|
272
330
|
get: {
|
273
331
|
body: unknown;
|
274
|
-
params: {
|
275
|
-
|
332
|
+
params: {};
|
333
|
+
query: {
|
334
|
+
type?: string | undefined;
|
335
|
+
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
336
|
+
items?: number | undefined;
|
337
|
+
subType?: number | undefined;
|
338
|
+
page?: number | undefined;
|
339
|
+
types?: string[] | undefined;
|
340
|
+
campaignId?: string | undefined;
|
341
|
+
opportunityId?: string | undefined;
|
342
|
+
startTimestamp?: string | undefined;
|
343
|
+
endTimestamp?: string | undefined;
|
344
|
+
creatorAddress?: string | undefined;
|
345
|
+
chainId?: number | undefined;
|
346
|
+
creatorId?: string | undefined;
|
347
|
+
mainParameter?: string | undefined;
|
348
|
+
point?: boolean | undefined;
|
349
|
+
tokenAddress?: string | undefined;
|
350
|
+
test?: boolean | undefined;
|
351
|
+
creatorTag?: string | undefined;
|
352
|
+
distributionChainIds?: number[] | undefined;
|
353
|
+
tokenSymbol?: string | undefined;
|
354
|
+
withOpportunity?: boolean | undefined;
|
355
|
+
createdAfter?: Date | null | undefined;
|
276
356
|
};
|
277
|
-
query: unknown;
|
278
357
|
headers: unknown;
|
279
358
|
response: {
|
280
359
|
200: {
|
@@ -320,6 +399,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
320
399
|
address: string;
|
321
400
|
creatorId: string | null;
|
322
401
|
};
|
402
|
+
createdAt: string;
|
323
403
|
Opportunity: {
|
324
404
|
id: string;
|
325
405
|
name: string;
|
@@ -344,13 +424,13 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
344
424
|
rewardTokenId: string;
|
345
425
|
amount: string;
|
346
426
|
opportunityId: string;
|
347
|
-
|
348
|
-
createdAt: Date;
|
349
|
-
};
|
427
|
+
}[];
|
350
428
|
};
|
351
429
|
};
|
352
430
|
};
|
353
|
-
}
|
431
|
+
};
|
432
|
+
} & {
|
433
|
+
campaigns: {
|
354
434
|
count: {
|
355
435
|
get: {
|
356
436
|
body: unknown;
|
@@ -373,11 +453,11 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
373
453
|
point?: boolean | undefined;
|
374
454
|
tokenAddress?: string | undefined;
|
375
455
|
test?: boolean | undefined;
|
376
|
-
createdAfter?: number | undefined;
|
377
456
|
creatorTag?: string | undefined;
|
378
457
|
distributionChainIds?: number[] | undefined;
|
379
458
|
tokenSymbol?: string | undefined;
|
380
459
|
withOpportunity?: boolean | undefined;
|
460
|
+
createdAfter?: Date | null | undefined;
|
381
461
|
};
|
382
462
|
headers: unknown;
|
383
463
|
response: {
|
@@ -385,7 +465,48 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
385
465
|
};
|
386
466
|
};
|
387
467
|
};
|
388
|
-
}
|
468
|
+
};
|
469
|
+
} & {
|
470
|
+
campaignscount: {
|
471
|
+
"by-chains": {
|
472
|
+
get: {
|
473
|
+
body: unknown;
|
474
|
+
params: {};
|
475
|
+
query: {
|
476
|
+
type?: string | undefined;
|
477
|
+
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
478
|
+
items?: number | undefined;
|
479
|
+
subType?: number | undefined;
|
480
|
+
page?: number | undefined;
|
481
|
+
types?: string[] | undefined;
|
482
|
+
campaignId?: string | undefined;
|
483
|
+
opportunityId?: string | undefined;
|
484
|
+
startTimestamp?: string | undefined;
|
485
|
+
endTimestamp?: string | undefined;
|
486
|
+
creatorAddress?: string | undefined;
|
487
|
+
chainId?: number | undefined;
|
488
|
+
creatorId?: string | undefined;
|
489
|
+
mainParameter?: string | undefined;
|
490
|
+
point?: boolean | undefined;
|
491
|
+
tokenAddress?: string | undefined;
|
492
|
+
test?: boolean | undefined;
|
493
|
+
creatorTag?: string | undefined;
|
494
|
+
distributionChainIds?: number[] | undefined;
|
495
|
+
tokenSymbol?: string | undefined;
|
496
|
+
withOpportunity?: boolean | undefined;
|
497
|
+
createdAfter?: Date | null | undefined;
|
498
|
+
};
|
499
|
+
headers: unknown;
|
500
|
+
response: {
|
501
|
+
200: {
|
502
|
+
[x: string]: number;
|
503
|
+
};
|
504
|
+
};
|
505
|
+
};
|
506
|
+
};
|
507
|
+
};
|
508
|
+
} & {
|
509
|
+
campaigns: {
|
389
510
|
count: {
|
390
511
|
"by-type": {
|
391
512
|
get: {
|
@@ -409,11 +530,11 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
409
530
|
point?: boolean | undefined;
|
410
531
|
tokenAddress?: string | undefined;
|
411
532
|
test?: boolean | undefined;
|
412
|
-
createdAfter?: number | undefined;
|
413
533
|
creatorTag?: string | undefined;
|
414
534
|
distributionChainIds?: number[] | undefined;
|
415
535
|
tokenSymbol?: string | undefined;
|
416
536
|
withOpportunity?: boolean | undefined;
|
537
|
+
createdAfter?: Date | null | undefined;
|
417
538
|
};
|
418
539
|
headers: unknown;
|
419
540
|
response: {
|
@@ -424,7 +545,9 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
424
545
|
};
|
425
546
|
};
|
426
547
|
};
|
427
|
-
}
|
548
|
+
};
|
549
|
+
} & {
|
550
|
+
campaigns: {
|
428
551
|
count: {
|
429
552
|
"by-protocol": {
|
430
553
|
get: {
|
@@ -448,11 +571,11 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
448
571
|
point?: boolean | undefined;
|
449
572
|
tokenAddress?: string | undefined;
|
450
573
|
test?: boolean | undefined;
|
451
|
-
createdAfter?: number | undefined;
|
452
574
|
creatorTag?: string | undefined;
|
453
575
|
distributionChainIds?: number[] | undefined;
|
454
576
|
tokenSymbol?: string | undefined;
|
455
577
|
withOpportunity?: boolean | undefined;
|
578
|
+
createdAfter?: Date | null | undefined;
|
456
579
|
};
|
457
580
|
headers: unknown;
|
458
581
|
response: {
|
@@ -463,122 +586,6 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
463
586
|
};
|
464
587
|
};
|
465
588
|
};
|
466
|
-
} & {
|
467
|
-
"campaigns-to-process": {
|
468
|
-
index: {
|
469
|
-
get: {
|
470
|
-
body: unknown;
|
471
|
-
params: {};
|
472
|
-
query: {
|
473
|
-
chainId: number;
|
474
|
-
};
|
475
|
-
headers: unknown;
|
476
|
-
response: {
|
477
|
-
200: {
|
478
|
-
campaignId: string;
|
479
|
-
endTimestamp: bigint;
|
480
|
-
CampaignStatus: {
|
481
|
-
status: import("@db/api").$Enums.RunStatus;
|
482
|
-
computedUntil: bigint;
|
483
|
-
processingStarted: bigint;
|
484
|
-
}[];
|
485
|
-
}[];
|
486
|
-
};
|
487
|
-
};
|
488
|
-
};
|
489
|
-
};
|
490
|
-
} & {
|
491
|
-
"campaigns-to-process": {
|
492
|
-
count: {
|
493
|
-
get: {
|
494
|
-
body: unknown;
|
495
|
-
params: {};
|
496
|
-
query: {
|
497
|
-
chainId: number;
|
498
|
-
};
|
499
|
-
headers: unknown;
|
500
|
-
response: {
|
501
|
-
200: number;
|
502
|
-
};
|
503
|
-
};
|
504
|
-
};
|
505
|
-
};
|
506
|
-
} & {
|
507
|
-
"campaigns-to-process": {
|
508
|
-
next: {
|
509
|
-
get: {
|
510
|
-
body: unknown;
|
511
|
-
params: {};
|
512
|
-
query: {
|
513
|
-
chainId: number;
|
514
|
-
};
|
515
|
-
headers: unknown;
|
516
|
-
response: {
|
517
|
-
200: {
|
518
|
-
campaignId: string;
|
519
|
-
};
|
520
|
-
};
|
521
|
-
};
|
522
|
-
};
|
523
|
-
};
|
524
|
-
} & {
|
525
|
-
"campaigns-to-process": {
|
526
|
-
engine: {
|
527
|
-
post: {
|
528
|
-
body: unknown;
|
529
|
-
params: {};
|
530
|
-
query: {
|
531
|
-
chainId: number;
|
532
|
-
};
|
533
|
-
headers: {
|
534
|
-
authorization: string;
|
535
|
-
};
|
536
|
-
response: {
|
537
|
-
200: {
|
538
|
-
campaignId: string;
|
539
|
-
};
|
540
|
-
};
|
541
|
-
};
|
542
|
-
};
|
543
|
-
};
|
544
|
-
};
|
545
|
-
campaignscount: {
|
546
|
-
"by-chains": {
|
547
|
-
get: {
|
548
|
-
body: unknown;
|
549
|
-
params: {};
|
550
|
-
query: {
|
551
|
-
type?: string | undefined;
|
552
|
-
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
553
|
-
items?: number | undefined;
|
554
|
-
subType?: number | undefined;
|
555
|
-
page?: number | undefined;
|
556
|
-
types?: string[] | undefined;
|
557
|
-
campaignId?: string | undefined;
|
558
|
-
opportunityId?: string | undefined;
|
559
|
-
startTimestamp?: string | undefined;
|
560
|
-
endTimestamp?: string | undefined;
|
561
|
-
creatorAddress?: string | undefined;
|
562
|
-
chainId?: number | undefined;
|
563
|
-
creatorId?: string | undefined;
|
564
|
-
mainParameter?: string | undefined;
|
565
|
-
point?: boolean | undefined;
|
566
|
-
tokenAddress?: string | undefined;
|
567
|
-
test?: boolean | undefined;
|
568
|
-
createdAfter?: number | undefined;
|
569
|
-
creatorTag?: string | undefined;
|
570
|
-
distributionChainIds?: number[] | undefined;
|
571
|
-
tokenSymbol?: string | undefined;
|
572
|
-
withOpportunity?: boolean | undefined;
|
573
|
-
};
|
574
|
-
headers: unknown;
|
575
|
-
response: {
|
576
|
-
200: {
|
577
|
-
[x: string]: number;
|
578
|
-
};
|
579
|
-
};
|
580
|
-
};
|
581
|
-
};
|
582
589
|
};
|
583
590
|
}, {
|
584
591
|
derive: {};
|
@@ -587,5 +594,39 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
587
594
|
}, {
|
588
595
|
derive: {};
|
589
596
|
resolve: {};
|
590
|
-
schema: {
|
597
|
+
schema: {
|
598
|
+
body: unknown;
|
599
|
+
headers: unknown;
|
600
|
+
query: {
|
601
|
+
type?: string | undefined;
|
602
|
+
status?: "NONE" | "PAST" | "LIVE" | "SOON" | undefined;
|
603
|
+
items?: number | undefined;
|
604
|
+
subType?: number | undefined;
|
605
|
+
page?: number | undefined;
|
606
|
+
types?: string[] | undefined;
|
607
|
+
campaignId?: string | undefined;
|
608
|
+
opportunityId?: string | undefined;
|
609
|
+
startTimestamp?: string | undefined;
|
610
|
+
endTimestamp?: string | undefined;
|
611
|
+
creatorAddress?: string | undefined;
|
612
|
+
chainId?: number | undefined;
|
613
|
+
creatorId?: string | undefined;
|
614
|
+
mainParameter?: string | undefined;
|
615
|
+
point?: boolean | undefined;
|
616
|
+
tokenAddress?: string | undefined;
|
617
|
+
test?: boolean | undefined;
|
618
|
+
creatorTag?: string | undefined;
|
619
|
+
distributionChainIds?: number[] | undefined;
|
620
|
+
tokenSymbol?: string | undefined;
|
621
|
+
withOpportunity?: boolean | undefined;
|
622
|
+
createdAfter?: Date | null | undefined;
|
623
|
+
};
|
624
|
+
params: unknown;
|
625
|
+
cookie: unknown;
|
626
|
+
response: {
|
627
|
+
200: {
|
628
|
+
[x: string]: number;
|
629
|
+
};
|
630
|
+
};
|
631
|
+
};
|
591
632
|
}>;
|
@@ -66,19 +66,6 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
|
|
66
66
|
};
|
67
67
|
return await DynamicDataService.updateForCampaigns([campaignV3]);
|
68
68
|
}, { beforeHandle: BackOfficeGuard, headers: AuthorizationHeadersDto, detail: { hide: true } })
|
69
|
-
// ─── Get Many Campaigns ──────────────────────────────────────────────
|
70
|
-
.get("/", async ({ query }) => {
|
71
|
-
if (query.items === 0)
|
72
|
-
throw new HttpError("Bad Request: Cannot retrieve 0 items", 400);
|
73
|
-
return await CampaignService.findMany(query);
|
74
|
-
}, {
|
75
|
-
query: GetCampaignQueryDto,
|
76
|
-
response: t.Array(CampaignResourceDto),
|
77
|
-
detail: {
|
78
|
-
description: `**Retrieve Multiple Campaigns**
|
79
|
-
<p>This endpoint enables you to search for campaigns by providing specific criteria through query parameters.</p>`,
|
80
|
-
},
|
81
|
-
})
|
82
69
|
// ─── Get One Campaign ────────────────────────────────────────────────
|
83
70
|
.get("/:id", async ({ params }) => {
|
84
71
|
try {
|
@@ -87,8 +74,8 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
|
|
87
74
|
const [distributionChain, campaignId] = params.id.split("-");
|
88
75
|
return CampaignService.format(await CampaignService.findUniqueOrThrow({ distributionChain: +distributionChain, campaignId }));
|
89
76
|
}
|
90
|
-
catch (
|
91
|
-
console.log(
|
77
|
+
catch (err) {
|
78
|
+
console.log(err);
|
92
79
|
throw new NotFoundError("Campaign not found.");
|
93
80
|
}
|
94
81
|
}, {
|
@@ -98,22 +85,6 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
|
|
98
85
|
description: `**Retrieve A Campaign**
|
99
86
|
<p>This endpoint enables you to retrieve a campaign by providing its unique identifier.</p>`,
|
100
87
|
},
|
101
|
-
})
|
102
|
-
// ─── Get Total Campaigns Count ───────────────────────────────────────
|
103
|
-
.get("/count", async ({ query }) => await CampaignService.countMany(query), {
|
104
|
-
query: GetCampaignQueryDto,
|
105
|
-
response: t.Number(),
|
106
|
-
detail: {
|
107
|
-
description: `**Count Campaigns**
|
108
|
-
<p>This endpoint enables you to count campaigns corresponding to filters specified in the query params.</p>`,
|
109
|
-
},
|
110
|
-
})
|
111
|
-
.get("count/by-chains", async ({ query }) => await CampaignService.countByChains(query), {
|
112
|
-
query: GetCampaignQueryDto,
|
113
|
-
})
|
114
|
-
.get("/count/by-type", async ({ query }) => await CampaignService.countByType(query), { query: GetCampaignQueryDto })
|
115
|
-
.get("/count/by-protocol", async ({ query }) => await CampaignService.countByProtocol(query), {
|
116
|
-
query: GetCampaignQueryDto,
|
117
88
|
})
|
118
89
|
.group("/campaigns-to-process", app => {
|
119
90
|
return (app
|
@@ -150,4 +121,29 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
|
|
150
121
|
headers: AuthorizationHeadersDto,
|
151
122
|
detail: { hide: true },
|
152
123
|
}));
|
153
|
-
})
|
124
|
+
})
|
125
|
+
// ─── Get Many Campaigns ──────────────────────────────────────────────
|
126
|
+
.guard({ query: GetCampaignQueryDto })
|
127
|
+
.get("/", async ({ query }) => {
|
128
|
+
if (query.items === 0)
|
129
|
+
throw new HttpError("Bad Request: Cannot retrieve 0 items", 400);
|
130
|
+
return await CampaignService.findMany(query);
|
131
|
+
}, {
|
132
|
+
response: t.Array(CampaignResourceDto),
|
133
|
+
detail: {
|
134
|
+
description: `**Retrieve Multiple Campaigns**
|
135
|
+
<p>This endpoint enables you to search for campaigns by providing specific criteria through query parameters.</p>`,
|
136
|
+
},
|
137
|
+
})
|
138
|
+
// ─── Get Total Campaigns Count ───────────────────────────────────────
|
139
|
+
.get("/count", async ({ query }) => await CampaignService.countMany(query), {
|
140
|
+
response: t.Number(),
|
141
|
+
detail: {
|
142
|
+
description: `**Count Campaigns**
|
143
|
+
<p>This endpoint enables you to count campaigns corresponding to filters specified in the query params.</p>`,
|
144
|
+
},
|
145
|
+
})
|
146
|
+
.guard({ response: t.Record(t.String(), t.Number()) })
|
147
|
+
.get("count/by-chains", async ({ query }) => await CampaignService.countByChains(query))
|
148
|
+
.get("/count/by-type", async ({ query }) => await CampaignService.countByType(query))
|
149
|
+
.get("/count/by-protocol", async ({ query }) => await CampaignService.countByProtocol(query));
|
@@ -20,6 +20,7 @@ export type Campaign = Resource<"Campaign", "opportunityId" | "rewardTokenId", {
|
|
20
20
|
};
|
21
21
|
endTimestamp: number;
|
22
22
|
startTimestamp: number;
|
23
|
+
createdAt: string;
|
23
24
|
}>;
|
24
25
|
export type CampaignWithParams<C extends CampaignEnum = CampaignEnum> = Campaign["model"] & {
|
25
26
|
params: CampaignParameters<C>["campaignParameters"];
|
@@ -77,6 +78,7 @@ export declare const CampaignResourceDto: import("@sinclair/typebox").TObject<{
|
|
77
78
|
error: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
78
79
|
details: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
|
79
80
|
}>>;
|
81
|
+
createdAt: import("@sinclair/typebox").TString;
|
80
82
|
}>;
|
81
83
|
export declare const CreateCampaignDto: import("@sinclair/typebox").TObject<{
|
82
84
|
computeChainId: import("@sinclair/typebox").TNumber;
|
@@ -118,7 +120,6 @@ export declare const UpdateMetaDataCampaignDto: import("@sinclair/typebox").TObj
|
|
118
120
|
url: import("@sinclair/typebox").TString;
|
119
121
|
}>;
|
120
122
|
export declare const GetCampaignQueryDto: import("@sinclair/typebox").TObject<{
|
121
|
-
createdAfter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
122
123
|
creatorTag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
123
124
|
creatorAddress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
124
125
|
creatorId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
@@ -143,6 +144,7 @@ export declare const GetCampaignQueryDto: import("@sinclair/typebox").TObject<{
|
|
143
144
|
startTimestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
144
145
|
endTimestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
145
146
|
withOpportunity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
147
|
+
createdAfter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TDate, import("@sinclair/typebox").TNull]>>;
|
146
148
|
page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
147
149
|
items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
148
150
|
}>;
|
@@ -31,6 +31,7 @@ export const CampaignResourceDto = t.Object({
|
|
31
31
|
rewardToken: TokenResourceDto,
|
32
32
|
distributionChain: t.Optional(ChainResourceDto),
|
33
33
|
campaignStatus: t.Optional(CampaignStatusResourceDto),
|
34
|
+
createdAt: t.String({ format: "date" }),
|
34
35
|
});
|
35
36
|
export const CreateCampaignDto = t.Object({
|
36
37
|
computeChainId: t.Number(),
|
@@ -69,7 +70,6 @@ export const UpdateMetaDataCampaignDto = t.Object({
|
|
69
70
|
url: t.String(),
|
70
71
|
});
|
71
72
|
export const GetCampaignQueryDto = t.Object({
|
72
|
-
createdAfter: t.Optional(t.Numeric({ description: "Return campaigns created after the given date - in unix timestamp" })),
|
73
73
|
creatorTag: t.Optional(t.String({ description: "Filter campaigns created by a user who has a specific tag" })),
|
74
74
|
creatorAddress: t.Optional(t.String()),
|
75
75
|
creatorId: t.Optional(t.String({ description: "Filter campaigns created by a user who is registered as a merkl creator" })),
|
@@ -107,6 +107,7 @@ export const GetCampaignQueryDto = t.Object({
|
|
107
107
|
withOpportunity: t.Optional(t.Boolean({
|
108
108
|
description: "Include opportunity data. Will slow down the request. Default: false",
|
109
109
|
})),
|
110
|
+
createdAfter: t.Optional(t.Union([t.Date({ description: "Return campaigns created after the given date. Format: YYYY-MM-DD" }), t.Null()])),
|
110
111
|
page: t.Optional(t.Numeric({ description: "0-indexed page number", default: 0 })),
|
111
112
|
items: t.Optional(t.Numeric({ description: "Number of items returned by page", default: 20 })), // items per page
|
112
113
|
});
|