dub 0.64.2 → 0.64.3

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.
Files changed (194) hide show
  1. package/README.md +1 -1
  2. package/bin/mcp-server.js +137 -99
  3. package/bin/mcp-server.js.map +28 -28
  4. package/dist/commonjs/funcs/analyticsRetrieve.js +1 -0
  5. package/dist/commonjs/funcs/analyticsRetrieve.js.map +1 -1
  6. package/dist/commonjs/funcs/eventsList.js +1 -0
  7. package/dist/commonjs/funcs/eventsList.js.map +1 -1
  8. package/dist/commonjs/lib/config.d.ts +3 -3
  9. package/dist/commonjs/lib/config.js +3 -3
  10. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  11. package/dist/commonjs/mcp-server/server.js +1 -1
  12. package/dist/commonjs/models/components/clickevent.d.ts +33 -26
  13. package/dist/commonjs/models/components/clickevent.d.ts.map +1 -1
  14. package/dist/commonjs/models/components/clickevent.js +8 -4
  15. package/dist/commonjs/models/components/clickevent.js.map +1 -1
  16. package/dist/commonjs/models/components/leadcreatedevent.d.ts +20 -13
  17. package/dist/commonjs/models/components/leadcreatedevent.d.ts.map +1 -1
  18. package/dist/commonjs/models/components/leadcreatedevent.js +8 -4
  19. package/dist/commonjs/models/components/leadcreatedevent.js.map +1 -1
  20. package/dist/commonjs/models/components/leadevent.d.ts +35 -26
  21. package/dist/commonjs/models/components/leadevent.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/leadevent.js +10 -4
  23. package/dist/commonjs/models/components/leadevent.js.map +1 -1
  24. package/dist/commonjs/models/components/linkclickedevent.d.ts +20 -13
  25. package/dist/commonjs/models/components/linkclickedevent.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/linkclickedevent.js +8 -4
  27. package/dist/commonjs/models/components/linkclickedevent.js.map +1 -1
  28. package/dist/commonjs/models/components/linkschema.d.ts +20 -15
  29. package/dist/commonjs/models/components/linkschema.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/linkschema.js +6 -4
  31. package/dist/commonjs/models/components/linkschema.js.map +1 -1
  32. package/dist/commonjs/models/components/linkwebhookevent.d.ts +18 -13
  33. package/dist/commonjs/models/components/linkwebhookevent.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/linkwebhookevent.js +6 -4
  35. package/dist/commonjs/models/components/linkwebhookevent.js.map +1 -1
  36. package/dist/commonjs/models/components/partnerenrolledevent.d.ts +3 -3
  37. package/dist/commonjs/models/components/salecreatedevent.d.ts +20 -13
  38. package/dist/commonjs/models/components/salecreatedevent.d.ts.map +1 -1
  39. package/dist/commonjs/models/components/salecreatedevent.js +8 -4
  40. package/dist/commonjs/models/components/salecreatedevent.js.map +1 -1
  41. package/dist/commonjs/models/components/saleevent.d.ts +123 -112
  42. package/dist/commonjs/models/components/saleevent.d.ts.map +1 -1
  43. package/dist/commonjs/models/components/saleevent.js +60 -54
  44. package/dist/commonjs/models/components/saleevent.js.map +1 -1
  45. package/dist/commonjs/models/operations/bulkcreatelinks.d.ts +14 -14
  46. package/dist/commonjs/models/operations/bulkcreatelinks.d.ts.map +1 -1
  47. package/dist/commonjs/models/operations/bulkcreatelinks.js +4 -4
  48. package/dist/commonjs/models/operations/bulkcreatelinks.js.map +1 -1
  49. package/dist/commonjs/models/operations/bulkupdatelinks.d.ts +14 -14
  50. package/dist/commonjs/models/operations/bulkupdatelinks.d.ts.map +1 -1
  51. package/dist/commonjs/models/operations/bulkupdatelinks.js +4 -4
  52. package/dist/commonjs/models/operations/bulkupdatelinks.js.map +1 -1
  53. package/dist/commonjs/models/operations/createlink.d.ts +14 -14
  54. package/dist/commonjs/models/operations/createlink.d.ts.map +1 -1
  55. package/dist/commonjs/models/operations/createlink.js +4 -4
  56. package/dist/commonjs/models/operations/createlink.js.map +1 -1
  57. package/dist/commonjs/models/operations/createpartner.d.ts +3 -3
  58. package/dist/commonjs/models/operations/getlinks.d.ts +1 -1
  59. package/dist/commonjs/models/operations/getlinkscount.d.ts +1 -1
  60. package/dist/commonjs/models/operations/listevents.d.ts +18 -13
  61. package/dist/commonjs/models/operations/listevents.d.ts.map +1 -1
  62. package/dist/commonjs/models/operations/listevents.js +7 -5
  63. package/dist/commonjs/models/operations/listevents.js.map +1 -1
  64. package/dist/commonjs/models/operations/listpartners.d.ts +3 -3
  65. package/dist/commonjs/models/operations/retrieveanalytics.d.ts +18 -13
  66. package/dist/commonjs/models/operations/retrieveanalytics.d.ts.map +1 -1
  67. package/dist/commonjs/models/operations/retrieveanalytics.js +7 -5
  68. package/dist/commonjs/models/operations/retrieveanalytics.js.map +1 -1
  69. package/dist/commonjs/models/operations/retrievelinks.d.ts +3 -3
  70. package/dist/commonjs/models/operations/updatelink.d.ts +14 -14
  71. package/dist/commonjs/models/operations/updatelink.d.ts.map +1 -1
  72. package/dist/commonjs/models/operations/updatelink.js +4 -4
  73. package/dist/commonjs/models/operations/updatelink.js.map +1 -1
  74. package/dist/commonjs/models/operations/upsertlink.d.ts +14 -14
  75. package/dist/commonjs/models/operations/upsertlink.d.ts.map +1 -1
  76. package/dist/commonjs/models/operations/upsertlink.js +4 -4
  77. package/dist/commonjs/models/operations/upsertlink.js.map +1 -1
  78. package/dist/esm/funcs/analyticsRetrieve.js +1 -0
  79. package/dist/esm/funcs/analyticsRetrieve.js.map +1 -1
  80. package/dist/esm/funcs/eventsList.js +1 -0
  81. package/dist/esm/funcs/eventsList.js.map +1 -1
  82. package/dist/esm/lib/config.d.ts +3 -3
  83. package/dist/esm/lib/config.js +3 -3
  84. package/dist/esm/mcp-server/mcp-server.js +1 -1
  85. package/dist/esm/mcp-server/server.js +1 -1
  86. package/dist/esm/models/components/clickevent.d.ts +33 -26
  87. package/dist/esm/models/components/clickevent.d.ts.map +1 -1
  88. package/dist/esm/models/components/clickevent.js +8 -4
  89. package/dist/esm/models/components/clickevent.js.map +1 -1
  90. package/dist/esm/models/components/leadcreatedevent.d.ts +20 -13
  91. package/dist/esm/models/components/leadcreatedevent.d.ts.map +1 -1
  92. package/dist/esm/models/components/leadcreatedevent.js +8 -4
  93. package/dist/esm/models/components/leadcreatedevent.js.map +1 -1
  94. package/dist/esm/models/components/leadevent.d.ts +35 -26
  95. package/dist/esm/models/components/leadevent.d.ts.map +1 -1
  96. package/dist/esm/models/components/leadevent.js +10 -4
  97. package/dist/esm/models/components/leadevent.js.map +1 -1
  98. package/dist/esm/models/components/linkclickedevent.d.ts +20 -13
  99. package/dist/esm/models/components/linkclickedevent.d.ts.map +1 -1
  100. package/dist/esm/models/components/linkclickedevent.js +8 -4
  101. package/dist/esm/models/components/linkclickedevent.js.map +1 -1
  102. package/dist/esm/models/components/linkschema.d.ts +20 -15
  103. package/dist/esm/models/components/linkschema.d.ts.map +1 -1
  104. package/dist/esm/models/components/linkschema.js +6 -4
  105. package/dist/esm/models/components/linkschema.js.map +1 -1
  106. package/dist/esm/models/components/linkwebhookevent.d.ts +18 -13
  107. package/dist/esm/models/components/linkwebhookevent.d.ts.map +1 -1
  108. package/dist/esm/models/components/linkwebhookevent.js +6 -4
  109. package/dist/esm/models/components/linkwebhookevent.js.map +1 -1
  110. package/dist/esm/models/components/partnerenrolledevent.d.ts +3 -3
  111. package/dist/esm/models/components/salecreatedevent.d.ts +20 -13
  112. package/dist/esm/models/components/salecreatedevent.d.ts.map +1 -1
  113. package/dist/esm/models/components/salecreatedevent.js +8 -4
  114. package/dist/esm/models/components/salecreatedevent.js.map +1 -1
  115. package/dist/esm/models/components/saleevent.d.ts +123 -112
  116. package/dist/esm/models/components/saleevent.d.ts.map +1 -1
  117. package/dist/esm/models/components/saleevent.js +57 -51
  118. package/dist/esm/models/components/saleevent.js.map +1 -1
  119. package/dist/esm/models/operations/bulkcreatelinks.d.ts +14 -14
  120. package/dist/esm/models/operations/bulkcreatelinks.d.ts.map +1 -1
  121. package/dist/esm/models/operations/bulkcreatelinks.js +4 -4
  122. package/dist/esm/models/operations/bulkcreatelinks.js.map +1 -1
  123. package/dist/esm/models/operations/bulkupdatelinks.d.ts +14 -14
  124. package/dist/esm/models/operations/bulkupdatelinks.d.ts.map +1 -1
  125. package/dist/esm/models/operations/bulkupdatelinks.js +4 -4
  126. package/dist/esm/models/operations/bulkupdatelinks.js.map +1 -1
  127. package/dist/esm/models/operations/createlink.d.ts +14 -14
  128. package/dist/esm/models/operations/createlink.d.ts.map +1 -1
  129. package/dist/esm/models/operations/createlink.js +4 -4
  130. package/dist/esm/models/operations/createlink.js.map +1 -1
  131. package/dist/esm/models/operations/createpartner.d.ts +3 -3
  132. package/dist/esm/models/operations/getlinks.d.ts +1 -1
  133. package/dist/esm/models/operations/getlinkscount.d.ts +1 -1
  134. package/dist/esm/models/operations/listevents.d.ts +18 -13
  135. package/dist/esm/models/operations/listevents.d.ts.map +1 -1
  136. package/dist/esm/models/operations/listevents.js +7 -5
  137. package/dist/esm/models/operations/listevents.js.map +1 -1
  138. package/dist/esm/models/operations/listpartners.d.ts +3 -3
  139. package/dist/esm/models/operations/retrieveanalytics.d.ts +18 -13
  140. package/dist/esm/models/operations/retrieveanalytics.d.ts.map +1 -1
  141. package/dist/esm/models/operations/retrieveanalytics.js +7 -5
  142. package/dist/esm/models/operations/retrieveanalytics.js.map +1 -1
  143. package/dist/esm/models/operations/retrievelinks.d.ts +3 -3
  144. package/dist/esm/models/operations/updatelink.d.ts +14 -14
  145. package/dist/esm/models/operations/updatelink.d.ts.map +1 -1
  146. package/dist/esm/models/operations/updatelink.js +4 -4
  147. package/dist/esm/models/operations/updatelink.js.map +1 -1
  148. package/dist/esm/models/operations/upsertlink.d.ts +14 -14
  149. package/dist/esm/models/operations/upsertlink.d.ts.map +1 -1
  150. package/dist/esm/models/operations/upsertlink.js +4 -4
  151. package/dist/esm/models/operations/upsertlink.js.map +1 -1
  152. package/docs/sdks/analytics/README.md +1 -0
  153. package/docs/sdks/commissions/README.md +2 -0
  154. package/docs/sdks/customers/README.md +5 -0
  155. package/docs/sdks/domains/README.md +6 -0
  156. package/docs/sdks/dub/README.md +1 -1
  157. package/docs/sdks/embedtokens/README.md +1 -0
  158. package/docs/sdks/events/README.md +1 -0
  159. package/docs/sdks/folders/README.md +4 -0
  160. package/docs/sdks/links/README.md +10 -0
  161. package/docs/sdks/partners/README.md +6 -0
  162. package/docs/sdks/qrcodes/README.md +1 -0
  163. package/docs/sdks/tags/README.md +4 -0
  164. package/docs/sdks/track/README.md +2 -0
  165. package/docs/sdks/workspaces/README.md +2 -0
  166. package/examples/package-lock.json +6 -5
  167. package/jsr.json +1 -1
  168. package/package.json +6 -6
  169. package/src/funcs/analyticsRetrieve.ts +1 -0
  170. package/src/funcs/eventsList.ts +1 -0
  171. package/src/lib/config.ts +3 -3
  172. package/src/mcp-server/mcp-server.ts +1 -1
  173. package/src/mcp-server/server.ts +1 -1
  174. package/src/models/components/clickevent.ts +41 -30
  175. package/src/models/components/leadcreatedevent.ts +28 -17
  176. package/src/models/components/leadevent.ts +45 -30
  177. package/src/models/components/linkclickedevent.ts +28 -17
  178. package/src/models/components/linkschema.ts +26 -19
  179. package/src/models/components/linkwebhookevent.ts +24 -17
  180. package/src/models/components/partnerenrolledevent.ts +3 -3
  181. package/src/models/components/salecreatedevent.ts +28 -17
  182. package/src/models/components/saleevent.ts +156 -139
  183. package/src/models/operations/bulkcreatelinks.ts +18 -18
  184. package/src/models/operations/bulkupdatelinks.ts +18 -18
  185. package/src/models/operations/createlink.ts +18 -18
  186. package/src/models/operations/createpartner.ts +3 -3
  187. package/src/models/operations/getlinks.ts +1 -1
  188. package/src/models/operations/getlinkscount.ts +1 -1
  189. package/src/models/operations/listevents.ts +24 -17
  190. package/src/models/operations/listpartners.ts +3 -3
  191. package/src/models/operations/retrieveanalytics.ts +24 -17
  192. package/src/models/operations/retrievelinks.ts +3 -3
  193. package/src/models/operations/updatelink.ts +18 -18
  194. package/src/models/operations/upsertlink.ts +18 -18
@@ -20,6 +20,37 @@ export const SaleEventEvent = {
20
20
  } as const;
21
21
  export type SaleEventEvent = ClosedEnum<typeof SaleEventEvent>;
22
22
 
23
+ /**
24
+ * The payment processor via which the sale was made.
25
+ */
26
+ export const PaymentProcessor = {
27
+ Stripe: "stripe",
28
+ Shopify: "shopify",
29
+ Polar: "polar",
30
+ Paddle: "paddle",
31
+ Revenuecat: "revenuecat",
32
+ Custom: "custom",
33
+ } as const;
34
+ /**
35
+ * The payment processor via which the sale was made.
36
+ */
37
+ export type PaymentProcessor = ClosedEnum<typeof PaymentProcessor>;
38
+
39
+ export type Sale = {
40
+ /**
41
+ * The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn more: https://d.to/currency
42
+ */
43
+ amount: number;
44
+ /**
45
+ * The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID.
46
+ */
47
+ invoiceId?: string | null | undefined;
48
+ /**
49
+ * The payment processor via which the sale was made.
50
+ */
51
+ paymentProcessor: PaymentProcessor;
52
+ };
53
+
23
54
  /**
24
55
  * Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo
25
56
  */
@@ -351,12 +382,6 @@ export type SaleEventLink = {
351
382
  */
352
383
  geo: SaleEventGeo | null;
353
384
  publicStats: boolean;
354
- /**
355
- * The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead.
356
- *
357
- * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
358
- */
359
- tagId: string | null;
360
385
  /**
361
386
  * The tags assigned to the short link.
362
387
  */
@@ -416,23 +441,33 @@ export type SaleEventLink = {
416
441
  * The number of clicks on the short link.
417
442
  */
418
443
  clicks?: number | undefined;
419
- lastClicked: string;
420
444
  /**
421
- * The number of leads the short links has generated.
445
+ * The number of leads the short link has generated.
422
446
  */
423
447
  leads?: number | undefined;
424
448
  /**
425
- * The number of sales the short links has generated.
449
+ * The number of leads that converted to paying customers.
450
+ */
451
+ conversions?: number | undefined;
452
+ /**
453
+ * The total number of sales (includes recurring sales) generated by the short link.
426
454
  */
427
455
  sales?: number | undefined;
428
456
  /**
429
- * The total dollar amount of sales the short links has generated (in cents).
457
+ * The total dollar value of sales (in cents) generated by the short link.
430
458
  */
431
459
  saleAmount?: number | undefined;
460
+ lastClicked: string;
432
461
  createdAt: string;
433
462
  updatedAt: string;
434
463
  /**
435
- * The project ID of the short link. This field is deprecated – use `workspaceId` instead.
464
+ * Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.
465
+ *
466
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
467
+ */
468
+ tagId: string | null;
469
+ /**
470
+ * Deprecated: Use `workspaceId` instead. The project ID of the short link.
436
471
  *
437
472
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
438
473
  */
@@ -450,6 +485,7 @@ export type SaleEventClick = {
450
485
  device: string;
451
486
  browser: string;
452
487
  os: string;
488
+ trigger?: string | null | undefined;
453
489
  referer: string;
454
490
  refererUrl: string;
455
491
  qr: boolean;
@@ -495,136 +531,108 @@ export type SaleEventCustomer = {
495
531
  createdAt: string;
496
532
  };
497
533
 
498
- /**
499
- * The payment processor via which the sale was made.
500
- */
501
- export const PaymentProcessor = {
502
- Stripe: "stripe",
503
- Shopify: "shopify",
504
- Polar: "polar",
505
- Paddle: "paddle",
506
- Revenuecat: "revenuecat",
507
- Custom: "custom",
508
- } as const;
509
- /**
510
- * The payment processor via which the sale was made.
511
- */
512
- export type PaymentProcessor = ClosedEnum<typeof PaymentProcessor>;
513
-
514
- export type Sale = {
515
- /**
516
- * The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn more: https://d.to/currency
517
- */
518
- amount: number;
519
- /**
520
- * The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID.
521
- */
522
- invoiceId?: string | null | undefined;
523
- /**
524
- * The payment processor via which the sale was made.
525
- */
526
- paymentProcessor: PaymentProcessor;
527
- };
528
-
529
534
  export type SaleEvent = {
530
535
  event: SaleEventEvent;
531
536
  timestamp: string;
532
537
  eventId: string;
533
538
  eventName: string;
539
+ sale: Sale;
540
+ metadata?: any | null | undefined;
534
541
  link: SaleEventLink;
535
542
  click: SaleEventClick;
536
543
  customer: SaleEventCustomer;
537
- sale: Sale;
538
544
  /**
539
- * Deprecated. Use `sale.amount` instead.
545
+ * Deprecated: Use `sale.amount` instead.
540
546
  *
541
547
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
542
548
  */
543
549
  saleAmount: number;
544
550
  /**
545
- * Deprecated. Use `sale.invoiceId` instead.
551
+ * Deprecated: Use `sale.invoiceId` instead.
546
552
  *
547
553
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
548
554
  */
549
555
  invoiceId: string;
550
556
  /**
551
- * Deprecated. Use `sale.paymentProcessor` instead.
557
+ * Deprecated: Use `sale.paymentProcessor` instead.
558
+ *
559
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
552
560
  */
553
561
  paymentProcessor: string;
554
562
  /**
555
- * Deprecated. Use `click.id` instead.
563
+ * Deprecated: Use `click.id` instead.
556
564
  *
557
565
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
558
566
  */
559
567
  clickId: string;
560
568
  /**
561
- * Deprecated. Use `link.id` instead.
569
+ * Deprecated: Use `link.id` instead.
562
570
  *
563
571
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
564
572
  */
565
573
  linkId: string;
566
574
  /**
567
- * Deprecated. Use `link.domain` instead.
575
+ * Deprecated: Use `link.domain` instead.
568
576
  *
569
577
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
570
578
  */
571
579
  domain: string;
572
580
  /**
573
- * Deprecated. Use `link.key` instead.
581
+ * Deprecated: Use `link.key` instead.
574
582
  *
575
583
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
576
584
  */
577
585
  key: string;
578
586
  /**
579
- * Deprecated. Use `click.url` instead.
587
+ * Deprecated: Use `click.url` instead.
580
588
  *
581
589
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
582
590
  */
583
591
  url: string;
584
592
  /**
585
- * Deprecated. Use `click.continent` instead.
593
+ * Deprecated: Use `click.continent` instead.
586
594
  *
587
595
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
588
596
  */
589
597
  continent: string;
590
598
  /**
591
- * Deprecated. Use `click.country` instead.
599
+ * Deprecated: Use `click.country` instead.
592
600
  *
593
601
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
594
602
  */
595
603
  country: string;
596
604
  /**
597
- * Deprecated. Use `click.city` instead.
605
+ * Deprecated: Use `click.city` instead.
598
606
  *
599
607
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
600
608
  */
601
609
  city: string;
602
610
  /**
603
- * Deprecated. Use `click.device` instead.
611
+ * Deprecated: Use `click.device` instead.
604
612
  *
605
613
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
606
614
  */
607
615
  device: string;
608
616
  /**
609
- * Deprecated. Use `click.browser` instead.
617
+ * Deprecated: Use `click.browser` instead.
610
618
  *
611
619
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
612
620
  */
613
621
  browser: string;
614
622
  /**
615
- * Deprecated. Use `click.os` instead.
623
+ * Deprecated: Use `click.os` instead.
616
624
  *
617
625
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
618
626
  */
619
627
  os: string;
620
628
  /**
621
- * Deprecated. Use `click.qr` instead.
629
+ * Deprecated: Use `click.qr` instead.
622
630
  *
623
631
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
624
632
  */
625
633
  qr: number;
626
634
  /**
627
- * Deprecated. Use `click.ip` instead.
635
+ * Deprecated: Use `click.ip` instead.
628
636
  *
629
637
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
630
638
  */
@@ -652,6 +660,77 @@ export namespace SaleEventEvent$ {
652
660
  export const outboundSchema = SaleEventEvent$outboundSchema;
653
661
  }
654
662
 
663
+ /** @internal */
664
+ export const PaymentProcessor$inboundSchema: z.ZodNativeEnum<
665
+ typeof PaymentProcessor
666
+ > = z.nativeEnum(PaymentProcessor);
667
+
668
+ /** @internal */
669
+ export const PaymentProcessor$outboundSchema: z.ZodNativeEnum<
670
+ typeof PaymentProcessor
671
+ > = PaymentProcessor$inboundSchema;
672
+
673
+ /**
674
+ * @internal
675
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
676
+ */
677
+ export namespace PaymentProcessor$ {
678
+ /** @deprecated use `PaymentProcessor$inboundSchema` instead. */
679
+ export const inboundSchema = PaymentProcessor$inboundSchema;
680
+ /** @deprecated use `PaymentProcessor$outboundSchema` instead. */
681
+ export const outboundSchema = PaymentProcessor$outboundSchema;
682
+ }
683
+
684
+ /** @internal */
685
+ export const Sale$inboundSchema: z.ZodType<Sale, z.ZodTypeDef, unknown> = z
686
+ .object({
687
+ amount: z.number().int(),
688
+ invoiceId: z.nullable(z.string()).default(null),
689
+ paymentProcessor: PaymentProcessor$inboundSchema,
690
+ });
691
+
692
+ /** @internal */
693
+ export type Sale$Outbound = {
694
+ amount: number;
695
+ invoiceId: string | null;
696
+ paymentProcessor: string;
697
+ };
698
+
699
+ /** @internal */
700
+ export const Sale$outboundSchema: z.ZodType<Sale$Outbound, z.ZodTypeDef, Sale> =
701
+ z.object({
702
+ amount: z.number().int(),
703
+ invoiceId: z.nullable(z.string()).default(null),
704
+ paymentProcessor: PaymentProcessor$outboundSchema,
705
+ });
706
+
707
+ /**
708
+ * @internal
709
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
710
+ */
711
+ export namespace Sale$ {
712
+ /** @deprecated use `Sale$inboundSchema` instead. */
713
+ export const inboundSchema = Sale$inboundSchema;
714
+ /** @deprecated use `Sale$outboundSchema` instead. */
715
+ export const outboundSchema = Sale$outboundSchema;
716
+ /** @deprecated use `Sale$Outbound` instead. */
717
+ export type Outbound = Sale$Outbound;
718
+ }
719
+
720
+ export function saleToJSON(sale: Sale): string {
721
+ return JSON.stringify(Sale$outboundSchema.parse(sale));
722
+ }
723
+
724
+ export function saleFromJSON(
725
+ jsonString: string,
726
+ ): SafeParseResult<Sale, SDKValidationError> {
727
+ return safeParse(
728
+ jsonString,
729
+ (x) => Sale$inboundSchema.parse(JSON.parse(x)),
730
+ `Failed to parse 'Sale' from JSON`,
731
+ );
732
+ }
733
+
655
734
  /** @internal */
656
735
  export const SaleEventGeo$inboundSchema: z.ZodType<
657
736
  SaleEventGeo,
@@ -2042,7 +2121,6 @@ export const SaleEventLink$inboundSchema: z.ZodType<
2042
2121
  android: z.nullable(z.string()),
2043
2122
  geo: z.nullable(z.lazy(() => SaleEventGeo$inboundSchema)),
2044
2123
  publicStats: z.boolean(),
2045
- tagId: z.nullable(z.string()),
2046
2124
  tags: z.nullable(z.array(TagSchema$inboundSchema)),
2047
2125
  folderId: z.nullable(z.string()),
2048
2126
  webhookIds: z.array(z.string()),
@@ -2062,12 +2140,14 @@ export const SaleEventLink$inboundSchema: z.ZodType<
2062
2140
  userId: z.nullable(z.string()),
2063
2141
  workspaceId: z.string(),
2064
2142
  clicks: z.number().default(0),
2065
- lastClicked: z.string(),
2066
2143
  leads: z.number().default(0),
2144
+ conversions: z.number().default(0),
2067
2145
  sales: z.number().default(0),
2068
2146
  saleAmount: z.number().default(0),
2147
+ lastClicked: z.string(),
2069
2148
  createdAt: z.string(),
2070
2149
  updatedAt: z.string(),
2150
+ tagId: z.nullable(z.string()),
2071
2151
  projectId: z.string(),
2072
2152
  }).transform((v) => {
2073
2153
  return remap$(v, {
@@ -2105,7 +2185,6 @@ export type SaleEventLink$Outbound = {
2105
2185
  android: string | null;
2106
2186
  geo: SaleEventGeo$Outbound | null;
2107
2187
  publicStats: boolean;
2108
- tagId: string | null;
2109
2188
  tags: Array<TagSchema$Outbound> | null;
2110
2189
  folderId: string | null;
2111
2190
  webhookIds: Array<string>;
@@ -2123,12 +2202,14 @@ export type SaleEventLink$Outbound = {
2123
2202
  userId: string | null;
2124
2203
  workspaceId: string;
2125
2204
  clicks: number;
2126
- lastClicked: string;
2127
2205
  leads: number;
2206
+ conversions: number;
2128
2207
  sales: number;
2129
2208
  saleAmount: number;
2209
+ lastClicked: string;
2130
2210
  createdAt: string;
2131
2211
  updatedAt: string;
2212
+ tagId: string | null;
2132
2213
  projectId: string;
2133
2214
  };
2134
2215
 
@@ -2162,7 +2243,6 @@ export const SaleEventLink$outboundSchema: z.ZodType<
2162
2243
  android: z.nullable(z.string()),
2163
2244
  geo: z.nullable(z.lazy(() => SaleEventGeo$outboundSchema)),
2164
2245
  publicStats: z.boolean(),
2165
- tagId: z.nullable(z.string()),
2166
2246
  tags: z.nullable(z.array(TagSchema$outboundSchema)),
2167
2247
  folderId: z.nullable(z.string()),
2168
2248
  webhookIds: z.array(z.string()),
@@ -2182,12 +2262,14 @@ export const SaleEventLink$outboundSchema: z.ZodType<
2182
2262
  userId: z.nullable(z.string()),
2183
2263
  workspaceId: z.string(),
2184
2264
  clicks: z.number().default(0),
2185
- lastClicked: z.string(),
2186
2265
  leads: z.number().default(0),
2266
+ conversions: z.number().default(0),
2187
2267
  sales: z.number().default(0),
2188
2268
  saleAmount: z.number().default(0),
2269
+ lastClicked: z.string(),
2189
2270
  createdAt: z.string(),
2190
2271
  updatedAt: z.string(),
2272
+ tagId: z.nullable(z.string()),
2191
2273
  projectId: z.string(),
2192
2274
  }).transform((v) => {
2193
2275
  return remap$(v, {
@@ -2242,6 +2324,7 @@ export const SaleEventClick$inboundSchema: z.ZodType<
2242
2324
  device: z.string(),
2243
2325
  browser: z.string(),
2244
2326
  os: z.string(),
2327
+ trigger: z.nullable(z.string()).optional(),
2245
2328
  referer: z.string(),
2246
2329
  refererUrl: z.string(),
2247
2330
  qr: z.boolean(),
@@ -2260,6 +2343,7 @@ export type SaleEventClick$Outbound = {
2260
2343
  device: string;
2261
2344
  browser: string;
2262
2345
  os: string;
2346
+ trigger?: string | null | undefined;
2263
2347
  referer: string;
2264
2348
  refererUrl: string;
2265
2349
  qr: boolean;
@@ -2282,6 +2366,7 @@ export const SaleEventClick$outboundSchema: z.ZodType<
2282
2366
  device: z.string(),
2283
2367
  browser: z.string(),
2284
2368
  os: z.string(),
2369
+ trigger: z.nullable(z.string()).optional(),
2285
2370
  referer: z.string(),
2286
2371
  refererUrl: z.string(),
2287
2372
  qr: z.boolean(),
@@ -2393,77 +2478,6 @@ export function saleEventCustomerFromJSON(
2393
2478
  );
2394
2479
  }
2395
2480
 
2396
- /** @internal */
2397
- export const PaymentProcessor$inboundSchema: z.ZodNativeEnum<
2398
- typeof PaymentProcessor
2399
- > = z.nativeEnum(PaymentProcessor);
2400
-
2401
- /** @internal */
2402
- export const PaymentProcessor$outboundSchema: z.ZodNativeEnum<
2403
- typeof PaymentProcessor
2404
- > = PaymentProcessor$inboundSchema;
2405
-
2406
- /**
2407
- * @internal
2408
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2409
- */
2410
- export namespace PaymentProcessor$ {
2411
- /** @deprecated use `PaymentProcessor$inboundSchema` instead. */
2412
- export const inboundSchema = PaymentProcessor$inboundSchema;
2413
- /** @deprecated use `PaymentProcessor$outboundSchema` instead. */
2414
- export const outboundSchema = PaymentProcessor$outboundSchema;
2415
- }
2416
-
2417
- /** @internal */
2418
- export const Sale$inboundSchema: z.ZodType<Sale, z.ZodTypeDef, unknown> = z
2419
- .object({
2420
- amount: z.number().int(),
2421
- invoiceId: z.nullable(z.string()).default(null),
2422
- paymentProcessor: PaymentProcessor$inboundSchema,
2423
- });
2424
-
2425
- /** @internal */
2426
- export type Sale$Outbound = {
2427
- amount: number;
2428
- invoiceId: string | null;
2429
- paymentProcessor: string;
2430
- };
2431
-
2432
- /** @internal */
2433
- export const Sale$outboundSchema: z.ZodType<Sale$Outbound, z.ZodTypeDef, Sale> =
2434
- z.object({
2435
- amount: z.number().int(),
2436
- invoiceId: z.nullable(z.string()).default(null),
2437
- paymentProcessor: PaymentProcessor$outboundSchema,
2438
- });
2439
-
2440
- /**
2441
- * @internal
2442
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2443
- */
2444
- export namespace Sale$ {
2445
- /** @deprecated use `Sale$inboundSchema` instead. */
2446
- export const inboundSchema = Sale$inboundSchema;
2447
- /** @deprecated use `Sale$outboundSchema` instead. */
2448
- export const outboundSchema = Sale$outboundSchema;
2449
- /** @deprecated use `Sale$Outbound` instead. */
2450
- export type Outbound = Sale$Outbound;
2451
- }
2452
-
2453
- export function saleToJSON(sale: Sale): string {
2454
- return JSON.stringify(Sale$outboundSchema.parse(sale));
2455
- }
2456
-
2457
- export function saleFromJSON(
2458
- jsonString: string,
2459
- ): SafeParseResult<Sale, SDKValidationError> {
2460
- return safeParse(
2461
- jsonString,
2462
- (x) => Sale$inboundSchema.parse(JSON.parse(x)),
2463
- `Failed to parse 'Sale' from JSON`,
2464
- );
2465
- }
2466
-
2467
2481
  /** @internal */
2468
2482
  export const SaleEvent$inboundSchema: z.ZodType<
2469
2483
  SaleEvent,
@@ -2474,10 +2488,11 @@ export const SaleEvent$inboundSchema: z.ZodType<
2474
2488
  timestamp: z.string(),
2475
2489
  eventId: z.string(),
2476
2490
  eventName: z.string(),
2491
+ sale: z.lazy(() => Sale$inboundSchema),
2492
+ metadata: z.nullable(z.any()).optional(),
2477
2493
  link: z.lazy(() => SaleEventLink$inboundSchema),
2478
2494
  click: z.lazy(() => SaleEventClick$inboundSchema),
2479
2495
  customer: z.lazy(() => SaleEventCustomer$inboundSchema),
2480
- sale: z.lazy(() => Sale$inboundSchema),
2481
2496
  saleAmount: z.number(),
2482
2497
  invoice_id: z.string(),
2483
2498
  payment_processor: z.string(),
@@ -2509,10 +2524,11 @@ export type SaleEvent$Outbound = {
2509
2524
  timestamp: string;
2510
2525
  eventId: string;
2511
2526
  eventName: string;
2527
+ sale: Sale$Outbound;
2528
+ metadata?: any | null | undefined;
2512
2529
  link: SaleEventLink$Outbound;
2513
2530
  click: SaleEventClick$Outbound;
2514
2531
  customer: SaleEventCustomer$Outbound;
2515
- sale: Sale$Outbound;
2516
2532
  saleAmount: number;
2517
2533
  invoice_id: string;
2518
2534
  payment_processor: string;
@@ -2541,10 +2557,11 @@ export const SaleEvent$outboundSchema: z.ZodType<
2541
2557
  timestamp: z.string(),
2542
2558
  eventId: z.string(),
2543
2559
  eventName: z.string(),
2560
+ sale: z.lazy(() => Sale$outboundSchema),
2561
+ metadata: z.nullable(z.any()).optional(),
2544
2562
  link: z.lazy(() => SaleEventLink$outboundSchema),
2545
2563
  click: z.lazy(() => SaleEventClick$outboundSchema),
2546
2564
  customer: z.lazy(() => SaleEventCustomer$outboundSchema),
2547
- sale: z.lazy(() => Sale$outboundSchema),
2548
2565
  saleAmount: z.number(),
2549
2566
  invoiceId: z.string(),
2550
2567
  paymentProcessor: z.string(),
@@ -69,18 +69,6 @@ export type RequestBody = {
69
69
  * Whether the short link is archived. Defaults to `false` if not provided.
70
70
  */
71
71
  archived?: boolean | undefined;
72
- /**
73
- * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.
74
- *
75
- * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
76
- */
77
- publicStats?: boolean | undefined;
78
- /**
79
- * The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead.
80
- *
81
- * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
82
- */
83
- tagId?: string | null | undefined;
84
72
  /**
85
73
  * The unique IDs of the tags assigned to the short link.
86
74
  */
@@ -189,6 +177,18 @@ export type RequestBody = {
189
177
  * The date and time when the tests were or will be completed.
190
178
  */
191
179
  testCompletedAt?: string | null | undefined;
180
+ /**
181
+ * Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.
182
+ *
183
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
184
+ */
185
+ publicStats?: boolean | undefined;
186
+ /**
187
+ * Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.
188
+ *
189
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
190
+ */
191
+ tagId?: string | null | undefined;
192
192
  };
193
193
 
194
194
  export type ResponseBody = components.LinkSchema | components.LinkErrorSchema;
@@ -365,8 +365,6 @@ export const RequestBody$inboundSchema: z.ZodType<
365
365
  prefix: z.string().optional(),
366
366
  trackConversion: z.boolean().optional(),
367
367
  archived: z.boolean().optional(),
368
- publicStats: z.boolean().optional(),
369
- tagId: z.nullable(z.string()).optional(),
370
368
  tagIds: z.union([z.string(), z.array(z.string())]).optional(),
371
369
  tagNames: z.union([z.string(), z.array(z.string())]).optional(),
372
370
  folderId: z.nullable(z.string()).optional(),
@@ -396,6 +394,8 @@ export const RequestBody$inboundSchema: z.ZodType<
396
394
  ).optional(),
397
395
  testStartedAt: z.nullable(z.string()).optional(),
398
396
  testCompletedAt: z.nullable(z.string()).optional(),
397
+ publicStats: z.boolean().optional(),
398
+ tagId: z.nullable(z.string()).optional(),
399
399
  }).transform((v) => {
400
400
  return remap$(v, {
401
401
  "utm_source": "utmSource",
@@ -419,8 +419,6 @@ export type RequestBody$Outbound = {
419
419
  prefix?: string | undefined;
420
420
  trackConversion?: boolean | undefined;
421
421
  archived?: boolean | undefined;
422
- publicStats?: boolean | undefined;
423
- tagId?: string | null | undefined;
424
422
  tagIds?: string | Array<string> | undefined;
425
423
  tagNames?: string | Array<string> | undefined;
426
424
  folderId?: string | null | undefined;
@@ -448,6 +446,8 @@ export type RequestBody$Outbound = {
448
446
  testVariants?: Array<BulkCreateLinksTestVariants$Outbound> | null | undefined;
449
447
  testStartedAt?: string | null | undefined;
450
448
  testCompletedAt?: string | null | undefined;
449
+ publicStats?: boolean | undefined;
450
+ tagId?: string | null | undefined;
451
451
  };
452
452
 
453
453
  /** @internal */
@@ -467,8 +467,6 @@ export const RequestBody$outboundSchema: z.ZodType<
467
467
  prefix: z.string().optional(),
468
468
  trackConversion: z.boolean().optional(),
469
469
  archived: z.boolean().optional(),
470
- publicStats: z.boolean().optional(),
471
- tagId: z.nullable(z.string()).optional(),
472
470
  tagIds: z.union([z.string(), z.array(z.string())]).optional(),
473
471
  tagNames: z.union([z.string(), z.array(z.string())]).optional(),
474
472
  folderId: z.nullable(z.string()).optional(),
@@ -498,6 +496,8 @@ export const RequestBody$outboundSchema: z.ZodType<
498
496
  ).optional(),
499
497
  testStartedAt: z.nullable(z.string()).optional(),
500
498
  testCompletedAt: z.nullable(z.string()).optional(),
499
+ publicStats: z.boolean().optional(),
500
+ tagId: z.nullable(z.string()).optional(),
501
501
  }).transform((v) => {
502
502
  return remap$(v, {
503
503
  utmSource: "utm_source",