@merkl/api 0.20.140 → 0.20.141

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.
@@ -1167,7 +1167,6 @@ declare const eden: {
1167
1167
  };
1168
1168
  campaigns: ((params: {
1169
1169
  id: string | number;
1170
- campaignId: string | number;
1171
1170
  }) => {
1172
1171
  get: (options?: {
1173
1172
  headers?: Record<string, unknown> | undefined;
@@ -1249,18 +1248,6 @@ declare const eden: {
1249
1248
  opportunityId: string;
1250
1249
  };
1251
1250
  }>>;
1252
- } | {
1253
- "dynamic-data": {
1254
- put: (body: unknown, options: {
1255
- headers: {
1256
- authorization: string;
1257
- };
1258
- query?: Record<string, unknown> | undefined;
1259
- fetch?: RequestInit | undefined;
1260
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1261
- 200: unknown[];
1262
- }>>;
1263
- };
1264
1251
  }) & {
1265
1252
  engine: {
1266
1253
  post: (body: {
@@ -2016,6 +2003,17 @@ declare const eden: {
2016
2003
  };
2017
2004
  };
2018
2005
  };
2006
+ campaignstvls: ((params: {
2007
+ opportunityId: string | number;
2008
+ }) => {
2009
+ put: (body?: unknown, options?: {
2010
+ headers?: Record<string, unknown> | undefined;
2011
+ query?: Record<string, unknown> | undefined;
2012
+ fetch?: RequestInit | undefined;
2013
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
2014
+ 200: unknown[];
2015
+ }>>;
2016
+ }) & {};
2019
2017
  campaignscount: {
2020
2018
  "by-chains": {
2021
2019
  get: (options: {
@@ -6752,24 +6750,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6752
6750
  };
6753
6751
  };
6754
6752
  };
6755
- } & {
6756
- ":campaignId": {
6757
- "dynamic-data": {
6758
- put: {
6759
- body: unknown;
6760
- params: {
6761
- campaignId: string;
6762
- };
6763
- query: unknown;
6764
- headers: {
6765
- authorization: string;
6766
- };
6767
- response: {
6768
- 200: unknown[];
6769
- };
6770
- };
6771
- };
6772
- };
6773
6753
  } & {
6774
6754
  index: {
6775
6755
  get: {
@@ -7044,6 +7024,21 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
7044
7024
  };
7045
7025
  };
7046
7026
  };
7027
+ campaignstvls: {
7028
+ ":opportunityId": {
7029
+ put: {
7030
+ body: unknown;
7031
+ params: {
7032
+ opportunityId: string;
7033
+ };
7034
+ query: unknown;
7035
+ headers: unknown;
7036
+ response: {
7037
+ 200: unknown[];
7038
+ };
7039
+ };
7040
+ };
7041
+ };
7047
7042
  } & {
7048
7043
  campaigns: {
7049
7044
  index: {
@@ -12868,7 +12863,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12868
12863
  };
12869
12864
  campaigns: ((params: {
12870
12865
  id: string | number;
12871
- campaignId: string | number;
12872
12866
  }) => {
12873
12867
  get: (options?: {
12874
12868
  headers?: Record<string, unknown> | undefined;
@@ -12950,18 +12944,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
12950
12944
  opportunityId: string;
12951
12945
  };
12952
12946
  }>>;
12953
- } | {
12954
- "dynamic-data": {
12955
- put: (body: unknown, options: {
12956
- headers: {
12957
- authorization: string;
12958
- };
12959
- query?: Record<string, unknown> | undefined;
12960
- fetch?: RequestInit | undefined;
12961
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
12962
- 200: unknown[];
12963
- }>>;
12964
- };
12965
12947
  }) & {
12966
12948
  engine: {
12967
12949
  post: (body: {
@@ -13717,6 +13699,17 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13717
13699
  };
13718
13700
  };
13719
13701
  };
13702
+ campaignstvls: ((params: {
13703
+ opportunityId: string | number;
13704
+ }) => {
13705
+ put: (body?: unknown, options?: {
13706
+ headers?: Record<string, unknown> | undefined;
13707
+ query?: Record<string, unknown> | undefined;
13708
+ fetch?: RequestInit | undefined;
13709
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13710
+ 200: unknown[];
13711
+ }>>;
13712
+ }) & {};
13720
13713
  campaignscount: {
13721
13714
  "by-chains": {
13722
13715
  get: (options: {
@@ -1517,24 +1517,6 @@ declare const app: Elysia<"", false, {
1517
1517
  };
1518
1518
  };
1519
1519
  };
1520
- } & {
1521
- ":campaignId": {
1522
- "dynamic-data": {
1523
- put: {
1524
- body: unknown;
1525
- params: {
1526
- campaignId: string;
1527
- };
1528
- query: unknown;
1529
- headers: {
1530
- authorization: string;
1531
- };
1532
- response: {
1533
- 200: unknown[];
1534
- };
1535
- };
1536
- };
1537
- };
1538
1520
  } & {
1539
1521
  index: {
1540
1522
  get: {
@@ -1809,6 +1791,21 @@ declare const app: Elysia<"", false, {
1809
1791
  };
1810
1792
  };
1811
1793
  };
1794
+ campaignstvls: {
1795
+ ":opportunityId": {
1796
+ put: {
1797
+ body: unknown;
1798
+ params: {
1799
+ opportunityId: string;
1800
+ };
1801
+ query: unknown;
1802
+ headers: unknown;
1803
+ response: {
1804
+ 200: unknown[];
1805
+ };
1806
+ };
1807
+ };
1808
+ };
1812
1809
  } & {
1813
1810
  campaigns: {
1814
1811
  index: {
@@ -216,24 +216,6 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
216
216
  };
217
217
  };
218
218
  };
219
- } & {
220
- ":campaignId": {
221
- "dynamic-data": {
222
- put: {
223
- body: unknown;
224
- params: {
225
- campaignId: string;
226
- };
227
- query: unknown;
228
- headers: {
229
- authorization: string;
230
- };
231
- response: {
232
- 200: unknown[];
233
- };
234
- };
235
- };
236
- };
237
219
  } & {
238
220
  index: {
239
221
  get: {
@@ -508,6 +490,21 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
508
490
  };
509
491
  };
510
492
  };
493
+ campaignstvls: {
494
+ ":opportunityId": {
495
+ put: {
496
+ body: unknown;
497
+ params: {
498
+ opportunityId: string;
499
+ };
500
+ query: unknown;
501
+ headers: unknown;
502
+ response: {
503
+ 200: unknown[];
504
+ };
505
+ };
506
+ };
507
+ };
511
508
  } & {
512
509
  campaigns: {
513
510
  index: {
@@ -47,14 +47,18 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
47
47
  body: UpdateMetaDataCampaignDto,
48
48
  detail: { hide: true },
49
49
  })
50
- .put("/:campaignId/dynamic-data", async ({ params }) => {
51
- const id = (await CampaignService.findMany({ campaignId: params.campaignId, test: true }))[0].id;
52
- if (!id)
53
- throw new NotFoundError();
54
- const campaign = await CampaignService.findUniqueOrThrow(id, true);
55
- const campaignV3 = OpportunityConvertorService.convertV4CampaignToV3(Campaign[campaign.type], CampaignService.format(campaign), campaign.Opportunity.identifier);
56
- return await DynamicDataService.update(campaignV3.computeChainId, campaignV3.campaignType, [campaignV3]);
57
- }, { beforeHandle: BackOfficeGuard, headers: AuthorizationHeadersDto, detail: { hide: true } })
50
+ .put("tvls/:opportunityId", async ({ params }) => {
51
+ const campaigns = (await CampaignService.findMany({
52
+ opportunityId: params.opportunityId,
53
+ status: "LIVE",
54
+ test: true,
55
+ withOpportunity: true,
56
+ items: 10_000,
57
+ })).map(campaign => OpportunityConvertorService.convertV4CampaignToV3(Campaign[campaign.type], campaign, campaign.Opportunity.identifier));
58
+ if (!campaigns.length)
59
+ throw new NotFoundError("Opportunity not found");
60
+ return await DynamicDataService.update(campaigns[0]?.computeChainId, campaigns[0].campaignType, campaigns);
61
+ })
58
62
  // ─── Get Many Campaigns ──────────────────────────────────────────────
59
63
  .get("/", async ({ query }) => {
60
64
  if (query.items === 0)
@@ -1387,24 +1387,6 @@ export declare const v4: Elysia<"/v4", false, {
1387
1387
  };
1388
1388
  };
1389
1389
  };
1390
- } & {
1391
- ":campaignId": {
1392
- "dynamic-data": {
1393
- put: {
1394
- body: unknown;
1395
- params: {
1396
- campaignId: string;
1397
- };
1398
- query: unknown;
1399
- headers: {
1400
- authorization: string;
1401
- };
1402
- response: {
1403
- 200: unknown[];
1404
- };
1405
- };
1406
- };
1407
- };
1408
1390
  } & {
1409
1391
  index: {
1410
1392
  get: {
@@ -1679,6 +1661,21 @@ export declare const v4: Elysia<"/v4", false, {
1679
1661
  };
1680
1662
  };
1681
1663
  };
1664
+ campaignstvls: {
1665
+ ":opportunityId": {
1666
+ put: {
1667
+ body: unknown;
1668
+ params: {
1669
+ opportunityId: string;
1670
+ };
1671
+ query: unknown;
1672
+ headers: unknown;
1673
+ response: {
1674
+ 200: unknown[];
1675
+ };
1676
+ };
1677
+ };
1678
+ };
1682
1679
  } & {
1683
1680
  campaigns: {
1684
1681
  index: {