mollie-api-typescript 0.1.6 → 0.1.8

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 (127) hide show
  1. package/FUNCTIONS.md +7 -139
  2. package/README.md +77 -877
  3. package/bin/mcp-server.js +385 -192
  4. package/bin/mcp-server.js.map +20 -20
  5. package/dist/commonjs/lib/config.d.ts +3 -3
  6. package/dist/commonjs/lib/config.js +3 -3
  7. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  8. package/dist/commonjs/mcp-server/server.js +40 -40
  9. package/dist/commonjs/mcp-server/server.js.map +1 -1
  10. package/dist/commonjs/models/operations/cancelpayment.d.ts +3 -3
  11. package/dist/commonjs/models/operations/cancelpayment.js +1 -1
  12. package/dist/commonjs/models/operations/createcustomerpayment.d.ts +3 -3
  13. package/dist/commonjs/models/operations/createcustomerpayment.js +1 -1
  14. package/dist/commonjs/models/operations/createpayment.d.ts +3 -3
  15. package/dist/commonjs/models/operations/createpayment.js +1 -1
  16. package/dist/commonjs/models/operations/createwebhook.d.ts +96 -38
  17. package/dist/commonjs/models/operations/createwebhook.d.ts.map +1 -1
  18. package/dist/commonjs/models/operations/createwebhook.js +79 -41
  19. package/dist/commonjs/models/operations/createwebhook.js.map +1 -1
  20. package/dist/commonjs/models/operations/getpayment.d.ts +3 -3
  21. package/dist/commonjs/models/operations/getpayment.js +1 -1
  22. package/dist/commonjs/models/operations/getpaymentlinkpayments.d.ts +3 -3
  23. package/dist/commonjs/models/operations/getpaymentlinkpayments.js +1 -1
  24. package/dist/commonjs/models/operations/getwebhook.d.ts +139 -21
  25. package/dist/commonjs/models/operations/getwebhook.d.ts.map +1 -1
  26. package/dist/commonjs/models/operations/getwebhook.js +114 -20
  27. package/dist/commonjs/models/operations/getwebhook.js.map +1 -1
  28. package/dist/commonjs/models/operations/getwebhookevent.d.ts +63 -17
  29. package/dist/commonjs/models/operations/getwebhookevent.d.ts.map +1 -1
  30. package/dist/commonjs/models/operations/getwebhookevent.js +48 -21
  31. package/dist/commonjs/models/operations/getwebhookevent.js.map +1 -1
  32. package/dist/commonjs/models/operations/listcustomerpayments.d.ts +3 -3
  33. package/dist/commonjs/models/operations/listcustomerpayments.js +1 -1
  34. package/dist/commonjs/models/operations/listpayments.d.ts +3 -3
  35. package/dist/commonjs/models/operations/listpayments.js +1 -1
  36. package/dist/commonjs/models/operations/listsettlementpayments.d.ts +3 -3
  37. package/dist/commonjs/models/operations/listsettlementpayments.js +1 -1
  38. package/dist/commonjs/models/operations/listsubscriptionpayments.d.ts +3 -3
  39. package/dist/commonjs/models/operations/listsubscriptionpayments.js +1 -1
  40. package/dist/commonjs/models/operations/listwebhooks.d.ts +160 -39
  41. package/dist/commonjs/models/operations/listwebhooks.d.ts.map +1 -1
  42. package/dist/commonjs/models/operations/listwebhooks.js +136 -41
  43. package/dist/commonjs/models/operations/listwebhooks.js.map +1 -1
  44. package/dist/commonjs/models/operations/updatepayment.d.ts +3 -3
  45. package/dist/commonjs/models/operations/updatepayment.js +1 -1
  46. package/dist/commonjs/models/operations/updatewebhook.d.ts +162 -32
  47. package/dist/commonjs/models/operations/updatewebhook.d.ts.map +1 -1
  48. package/dist/commonjs/models/operations/updatewebhook.js +140 -33
  49. package/dist/commonjs/models/operations/updatewebhook.js.map +1 -1
  50. package/dist/commonjs/sdk/sdk.d.ts +24 -24
  51. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  52. package/dist/commonjs/sdk/sdk.js +36 -36
  53. package/dist/commonjs/sdk/sdk.js.map +1 -1
  54. package/dist/esm/lib/config.d.ts +3 -3
  55. package/dist/esm/lib/config.js +3 -3
  56. package/dist/esm/mcp-server/mcp-server.js +1 -1
  57. package/dist/esm/mcp-server/server.js +40 -40
  58. package/dist/esm/mcp-server/server.js.map +1 -1
  59. package/dist/esm/models/operations/cancelpayment.d.ts +3 -3
  60. package/dist/esm/models/operations/cancelpayment.js +1 -1
  61. package/dist/esm/models/operations/createcustomerpayment.d.ts +3 -3
  62. package/dist/esm/models/operations/createcustomerpayment.js +1 -1
  63. package/dist/esm/models/operations/createpayment.d.ts +3 -3
  64. package/dist/esm/models/operations/createpayment.js +1 -1
  65. package/dist/esm/models/operations/createwebhook.d.ts +96 -38
  66. package/dist/esm/models/operations/createwebhook.d.ts.map +1 -1
  67. package/dist/esm/models/operations/createwebhook.js +78 -40
  68. package/dist/esm/models/operations/createwebhook.js.map +1 -1
  69. package/dist/esm/models/operations/getpayment.d.ts +3 -3
  70. package/dist/esm/models/operations/getpayment.js +1 -1
  71. package/dist/esm/models/operations/getpaymentlinkpayments.d.ts +3 -3
  72. package/dist/esm/models/operations/getpaymentlinkpayments.js +1 -1
  73. package/dist/esm/models/operations/getwebhook.d.ts +139 -21
  74. package/dist/esm/models/operations/getwebhook.d.ts.map +1 -1
  75. package/dist/esm/models/operations/getwebhook.js +109 -19
  76. package/dist/esm/models/operations/getwebhook.js.map +1 -1
  77. package/dist/esm/models/operations/getwebhookevent.d.ts +63 -17
  78. package/dist/esm/models/operations/getwebhookevent.d.ts.map +1 -1
  79. package/dist/esm/models/operations/getwebhookevent.js +45 -18
  80. package/dist/esm/models/operations/getwebhookevent.js.map +1 -1
  81. package/dist/esm/models/operations/listcustomerpayments.d.ts +3 -3
  82. package/dist/esm/models/operations/listcustomerpayments.js +1 -1
  83. package/dist/esm/models/operations/listpayments.d.ts +3 -3
  84. package/dist/esm/models/operations/listpayments.js +1 -1
  85. package/dist/esm/models/operations/listsettlementpayments.d.ts +3 -3
  86. package/dist/esm/models/operations/listsettlementpayments.js +1 -1
  87. package/dist/esm/models/operations/listsubscriptionpayments.d.ts +3 -3
  88. package/dist/esm/models/operations/listsubscriptionpayments.js +1 -1
  89. package/dist/esm/models/operations/listwebhooks.d.ts +160 -39
  90. package/dist/esm/models/operations/listwebhooks.d.ts.map +1 -1
  91. package/dist/esm/models/operations/listwebhooks.js +130 -40
  92. package/dist/esm/models/operations/listwebhooks.js.map +1 -1
  93. package/dist/esm/models/operations/updatepayment.d.ts +3 -3
  94. package/dist/esm/models/operations/updatepayment.js +1 -1
  95. package/dist/esm/models/operations/updatewebhook.d.ts +162 -32
  96. package/dist/esm/models/operations/updatewebhook.d.ts.map +1 -1
  97. package/dist/esm/models/operations/updatewebhook.js +135 -32
  98. package/dist/esm/models/operations/updatewebhook.js.map +1 -1
  99. package/dist/esm/sdk/sdk.d.ts +24 -24
  100. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  101. package/dist/esm/sdk/sdk.js +36 -36
  102. package/dist/esm/sdk/sdk.js.map +1 -1
  103. package/docs/sdks/webhooks/README.md +4 -4
  104. package/examples/balancesList.example.ts +33 -0
  105. package/examples/package-lock.json +1 -1
  106. package/jsr.json +1 -1
  107. package/package.json +1 -1
  108. package/src/lib/config.ts +3 -3
  109. package/src/mcp-server/mcp-server.ts +1 -1
  110. package/src/mcp-server/server.ts +40 -40
  111. package/src/models/operations/cancelpayment.ts +1 -1
  112. package/src/models/operations/createcustomerpayment.ts +1 -1
  113. package/src/models/operations/createpayment.ts +1 -1
  114. package/src/models/operations/createwebhook.ts +134 -73
  115. package/src/models/operations/getpayment.ts +1 -1
  116. package/src/models/operations/getpaymentlinkpayments.ts +1 -1
  117. package/src/models/operations/getwebhook.ts +228 -39
  118. package/src/models/operations/getwebhookevent.ts +75 -35
  119. package/src/models/operations/listcustomerpayments.ts +1 -1
  120. package/src/models/operations/listpayments.ts +1 -1
  121. package/src/models/operations/listsettlementpayments.ts +1 -1
  122. package/src/models/operations/listsubscriptionpayments.ts +1 -1
  123. package/src/models/operations/listwebhooks.ts +262 -73
  124. package/src/models/operations/updatepayment.ts +1 -1
  125. package/src/models/operations/updatewebhook.ts +273 -59
  126. package/src/sdk/sdk.ts +60 -60
  127. package/examples/paymentsCreate.example.ts +0 -166
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
7
8
  import { ClosedEnum } from "../../types/enums.js";
8
9
  import { Result as SafeParseResult } from "../../types/fp.js";
@@ -55,6 +56,25 @@ export type GetWebhookNotFoundLinks = {
55
56
  documentation: GetWebhookNotFoundDocumentation;
56
57
  };
57
58
 
59
+ /**
60
+ * The event's type
61
+ */
62
+ export const GetWebhookWebhookEventTypes = {
63
+ PaymentLinkPaid: "payment-link.paid",
64
+ BalanceTransactionCreated: "balance-transaction.created",
65
+ SalesInvoiceCreated: "sales-invoice.created",
66
+ SalesInvoiceIssued: "sales-invoice.issued",
67
+ SalesInvoiceCanceled: "sales-invoice.canceled",
68
+ SalesInvoicePaid: "sales-invoice.paid",
69
+ Wildcard: "*",
70
+ } as const;
71
+ /**
72
+ * The event's type
73
+ */
74
+ export type GetWebhookWebhookEventTypes = ClosedEnum<
75
+ typeof GetWebhookWebhookEventTypes
76
+ >;
77
+
58
78
  /**
59
79
  * The subscription's current status.
60
80
  */
@@ -70,17 +90,41 @@ export const GetWebhookStatus = {
70
90
  export type GetWebhookStatus = ClosedEnum<typeof GetWebhookStatus>;
71
91
 
72
92
  /**
73
- * The subscription's mode.
93
+ * Whether this entity was created in live mode or in test mode.
74
94
  */
75
95
  export const GetWebhookMode = {
76
96
  Live: "live",
77
97
  Test: "test",
78
98
  } as const;
79
99
  /**
80
- * The subscription's mode.
100
+ * Whether this entity was created in live mode or in test mode.
81
101
  */
82
102
  export type GetWebhookMode = ClosedEnum<typeof GetWebhookMode>;
83
103
 
104
+ /**
105
+ * In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.
106
+ */
107
+ export type GetWebhookDocumentation = {
108
+ /**
109
+ * The actual URL string.
110
+ */
111
+ href: string;
112
+ /**
113
+ * The content type of the page or endpoint the URL points to.
114
+ */
115
+ type: string;
116
+ };
117
+
118
+ /**
119
+ * An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.
120
+ */
121
+ export type GetWebhookLinks = {
122
+ /**
123
+ * In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.
124
+ */
125
+ documentation: GetWebhookDocumentation;
126
+ };
127
+
84
128
  /**
85
129
  * The webhook object.
86
130
  */
@@ -91,39 +135,43 @@ export type GetWebhookResponse = {
91
135
  * @remarks
92
136
  * Will always contain the string `webhook` for this endpoint.
93
137
  */
94
- resource?: string | undefined;
138
+ resource: string;
95
139
  /**
96
140
  * The identifier uniquely referring to this subscription.
97
141
  */
98
- id?: string | undefined;
142
+ id: string;
99
143
  /**
100
144
  * The subscription's events destination.
101
145
  */
102
- url?: string | undefined;
146
+ url: string;
103
147
  /**
104
148
  * The identifier uniquely referring to the profile that created the subscription.
105
149
  */
106
- profileId?: string | undefined;
150
+ profileId: string | null;
107
151
  /**
108
152
  * The subscription's date time of creation.
109
153
  */
110
- createdAt?: string | undefined;
154
+ createdAt: string;
111
155
  /**
112
156
  * The subscription's name.
113
157
  */
114
- name?: string | undefined;
158
+ name: string;
115
159
  /**
116
160
  * The events types that are subscribed.
117
161
  */
118
- eventTypes?: Array<string> | undefined;
162
+ eventTypes: Array<GetWebhookWebhookEventTypes>;
119
163
  /**
120
164
  * The subscription's current status.
121
165
  */
122
- status?: GetWebhookStatus | undefined;
166
+ status: GetWebhookStatus;
167
+ /**
168
+ * Whether this entity was created in live mode or in test mode.
169
+ */
170
+ mode: GetWebhookMode;
123
171
  /**
124
- * The subscription's mode.
172
+ * An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.
125
173
  */
126
- mode?: GetWebhookMode | undefined;
174
+ links: GetWebhookLinks;
127
175
  };
128
176
 
129
177
  /** @internal */
@@ -425,6 +473,27 @@ export function getWebhookNotFoundLinksFromJSON(
425
473
  );
426
474
  }
427
475
 
476
+ /** @internal */
477
+ export const GetWebhookWebhookEventTypes$inboundSchema: z.ZodNativeEnum<
478
+ typeof GetWebhookWebhookEventTypes
479
+ > = z.nativeEnum(GetWebhookWebhookEventTypes);
480
+
481
+ /** @internal */
482
+ export const GetWebhookWebhookEventTypes$outboundSchema: z.ZodNativeEnum<
483
+ typeof GetWebhookWebhookEventTypes
484
+ > = GetWebhookWebhookEventTypes$inboundSchema;
485
+
486
+ /**
487
+ * @internal
488
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
489
+ */
490
+ export namespace GetWebhookWebhookEventTypes$ {
491
+ /** @deprecated use `GetWebhookWebhookEventTypes$inboundSchema` instead. */
492
+ export const inboundSchema = GetWebhookWebhookEventTypes$inboundSchema;
493
+ /** @deprecated use `GetWebhookWebhookEventTypes$outboundSchema` instead. */
494
+ export const outboundSchema = GetWebhookWebhookEventTypes$outboundSchema;
495
+ }
496
+
428
497
  /** @internal */
429
498
  export const GetWebhookStatus$inboundSchema: z.ZodNativeEnum<
430
499
  typeof GetWebhookStatus
@@ -467,34 +536,149 @@ export namespace GetWebhookMode$ {
467
536
  export const outboundSchema = GetWebhookMode$outboundSchema;
468
537
  }
469
538
 
539
+ /** @internal */
540
+ export const GetWebhookDocumentation$inboundSchema: z.ZodType<
541
+ GetWebhookDocumentation,
542
+ z.ZodTypeDef,
543
+ unknown
544
+ > = z.object({
545
+ href: z.string(),
546
+ type: z.string(),
547
+ });
548
+
549
+ /** @internal */
550
+ export type GetWebhookDocumentation$Outbound = {
551
+ href: string;
552
+ type: string;
553
+ };
554
+
555
+ /** @internal */
556
+ export const GetWebhookDocumentation$outboundSchema: z.ZodType<
557
+ GetWebhookDocumentation$Outbound,
558
+ z.ZodTypeDef,
559
+ GetWebhookDocumentation
560
+ > = z.object({
561
+ href: z.string(),
562
+ type: z.string(),
563
+ });
564
+
565
+ /**
566
+ * @internal
567
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
568
+ */
569
+ export namespace GetWebhookDocumentation$ {
570
+ /** @deprecated use `GetWebhookDocumentation$inboundSchema` instead. */
571
+ export const inboundSchema = GetWebhookDocumentation$inboundSchema;
572
+ /** @deprecated use `GetWebhookDocumentation$outboundSchema` instead. */
573
+ export const outboundSchema = GetWebhookDocumentation$outboundSchema;
574
+ /** @deprecated use `GetWebhookDocumentation$Outbound` instead. */
575
+ export type Outbound = GetWebhookDocumentation$Outbound;
576
+ }
577
+
578
+ export function getWebhookDocumentationToJSON(
579
+ getWebhookDocumentation: GetWebhookDocumentation,
580
+ ): string {
581
+ return JSON.stringify(
582
+ GetWebhookDocumentation$outboundSchema.parse(getWebhookDocumentation),
583
+ );
584
+ }
585
+
586
+ export function getWebhookDocumentationFromJSON(
587
+ jsonString: string,
588
+ ): SafeParseResult<GetWebhookDocumentation, SDKValidationError> {
589
+ return safeParse(
590
+ jsonString,
591
+ (x) => GetWebhookDocumentation$inboundSchema.parse(JSON.parse(x)),
592
+ `Failed to parse 'GetWebhookDocumentation' from JSON`,
593
+ );
594
+ }
595
+
596
+ /** @internal */
597
+ export const GetWebhookLinks$inboundSchema: z.ZodType<
598
+ GetWebhookLinks,
599
+ z.ZodTypeDef,
600
+ unknown
601
+ > = z.object({
602
+ documentation: z.lazy(() => GetWebhookDocumentation$inboundSchema),
603
+ });
604
+
605
+ /** @internal */
606
+ export type GetWebhookLinks$Outbound = {
607
+ documentation: GetWebhookDocumentation$Outbound;
608
+ };
609
+
610
+ /** @internal */
611
+ export const GetWebhookLinks$outboundSchema: z.ZodType<
612
+ GetWebhookLinks$Outbound,
613
+ z.ZodTypeDef,
614
+ GetWebhookLinks
615
+ > = z.object({
616
+ documentation: z.lazy(() => GetWebhookDocumentation$outboundSchema),
617
+ });
618
+
619
+ /**
620
+ * @internal
621
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
622
+ */
623
+ export namespace GetWebhookLinks$ {
624
+ /** @deprecated use `GetWebhookLinks$inboundSchema` instead. */
625
+ export const inboundSchema = GetWebhookLinks$inboundSchema;
626
+ /** @deprecated use `GetWebhookLinks$outboundSchema` instead. */
627
+ export const outboundSchema = GetWebhookLinks$outboundSchema;
628
+ /** @deprecated use `GetWebhookLinks$Outbound` instead. */
629
+ export type Outbound = GetWebhookLinks$Outbound;
630
+ }
631
+
632
+ export function getWebhookLinksToJSON(
633
+ getWebhookLinks: GetWebhookLinks,
634
+ ): string {
635
+ return JSON.stringify(GetWebhookLinks$outboundSchema.parse(getWebhookLinks));
636
+ }
637
+
638
+ export function getWebhookLinksFromJSON(
639
+ jsonString: string,
640
+ ): SafeParseResult<GetWebhookLinks, SDKValidationError> {
641
+ return safeParse(
642
+ jsonString,
643
+ (x) => GetWebhookLinks$inboundSchema.parse(JSON.parse(x)),
644
+ `Failed to parse 'GetWebhookLinks' from JSON`,
645
+ );
646
+ }
647
+
470
648
  /** @internal */
471
649
  export const GetWebhookResponse$inboundSchema: z.ZodType<
472
650
  GetWebhookResponse,
473
651
  z.ZodTypeDef,
474
652
  unknown
475
653
  > = z.object({
476
- resource: z.string().optional(),
477
- id: z.string().optional(),
478
- url: z.string().optional(),
479
- profileId: z.string().optional(),
480
- createdAt: z.string().optional(),
481
- name: z.string().optional(),
482
- eventTypes: z.array(z.string()).optional(),
483
- status: GetWebhookStatus$inboundSchema.optional(),
484
- mode: GetWebhookMode$inboundSchema.optional(),
654
+ resource: z.string(),
655
+ id: z.string(),
656
+ url: z.string(),
657
+ profileId: z.nullable(z.string()),
658
+ createdAt: z.string(),
659
+ name: z.string(),
660
+ eventTypes: z.array(GetWebhookWebhookEventTypes$inboundSchema),
661
+ status: GetWebhookStatus$inboundSchema,
662
+ mode: GetWebhookMode$inboundSchema,
663
+ _links: z.lazy(() => GetWebhookLinks$inboundSchema),
664
+ }).transform((v) => {
665
+ return remap$(v, {
666
+ "_links": "links",
667
+ });
485
668
  });
486
669
 
487
670
  /** @internal */
488
671
  export type GetWebhookResponse$Outbound = {
489
- resource?: string | undefined;
490
- id?: string | undefined;
491
- url?: string | undefined;
492
- profileId?: string | undefined;
493
- createdAt?: string | undefined;
494
- name?: string | undefined;
495
- eventTypes?: Array<string> | undefined;
496
- status?: string | undefined;
497
- mode?: string | undefined;
672
+ resource: string;
673
+ id: string;
674
+ url: string;
675
+ profileId: string | null;
676
+ createdAt: string;
677
+ name: string;
678
+ eventTypes: Array<string>;
679
+ status: string;
680
+ mode: string;
681
+ _links: GetWebhookLinks$Outbound;
498
682
  };
499
683
 
500
684
  /** @internal */
@@ -503,15 +687,20 @@ export const GetWebhookResponse$outboundSchema: z.ZodType<
503
687
  z.ZodTypeDef,
504
688
  GetWebhookResponse
505
689
  > = z.object({
506
- resource: z.string().optional(),
507
- id: z.string().optional(),
508
- url: z.string().optional(),
509
- profileId: z.string().optional(),
510
- createdAt: z.string().optional(),
511
- name: z.string().optional(),
512
- eventTypes: z.array(z.string()).optional(),
513
- status: GetWebhookStatus$outboundSchema.optional(),
514
- mode: GetWebhookMode$outboundSchema.optional(),
690
+ resource: z.string(),
691
+ id: z.string(),
692
+ url: z.string(),
693
+ profileId: z.nullable(z.string()),
694
+ createdAt: z.string(),
695
+ name: z.string(),
696
+ eventTypes: z.array(GetWebhookWebhookEventTypes$outboundSchema),
697
+ status: GetWebhookStatus$outboundSchema,
698
+ mode: GetWebhookMode$outboundSchema,
699
+ links: z.lazy(() => GetWebhookLinks$outboundSchema),
700
+ }).transform((v) => {
701
+ return remap$(v, {
702
+ links: "_links",
703
+ });
515
704
  });
516
705
 
517
706
  /**
@@ -41,6 +41,25 @@ export type GetWebhookEventNotFoundLinks = {
41
41
  documentation: GetWebhookEventNotFoundDocumentation;
42
42
  };
43
43
 
44
+ /**
45
+ * The event's type
46
+ */
47
+ export const GetWebhookEventWebhookEventTypes = {
48
+ PaymentLinkPaid: "payment-link.paid",
49
+ BalanceTransactionCreated: "balance-transaction.created",
50
+ SalesInvoiceCreated: "sales-invoice.created",
51
+ SalesInvoiceIssued: "sales-invoice.issued",
52
+ SalesInvoiceCanceled: "sales-invoice.canceled",
53
+ SalesInvoicePaid: "sales-invoice.paid",
54
+ Wildcard: "*",
55
+ } as const;
56
+ /**
57
+ * The event's type
58
+ */
59
+ export type GetWebhookEventWebhookEventTypes = ClosedEnum<
60
+ typeof GetWebhookEventWebhookEventTypes
61
+ >;
62
+
44
63
  /**
45
64
  * Whether this entity was created in live mode or in test mode.
46
65
  */
@@ -1134,11 +1153,11 @@ export type GetWebhookEventLinks = {
1134
1153
  /**
1135
1154
  * In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.
1136
1155
  */
1137
- self?: GetWebhookEventSelf | undefined;
1156
+ self: GetWebhookEventSelf;
1138
1157
  /**
1139
1158
  * In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.
1140
1159
  */
1141
- documentation?: GetWebhookEventDocumentation | undefined;
1160
+ documentation: GetWebhookEventDocumentation;
1142
1161
  /**
1143
1162
  * The API resource URL of the entity that this event belongs to.
1144
1163
  */
@@ -1152,23 +1171,23 @@ export type GetWebhookEventResponse = {
1152
1171
  /**
1153
1172
  * Indicates the response contains a webhook event object. Will always contain the string `event` for this endpoint.
1154
1173
  */
1155
- resource?: string | undefined;
1174
+ resource: string;
1156
1175
  /**
1157
1176
  * The identifier uniquely referring to this event.
1158
1177
  */
1159
- id?: string | undefined;
1178
+ id: string;
1160
1179
  /**
1161
- * The event's type.
1180
+ * The event's type
1162
1181
  */
1163
- type?: string | undefined;
1182
+ webhookEventTypes: GetWebhookEventWebhookEventTypes;
1164
1183
  /**
1165
1184
  * The entity token that triggered the event
1166
1185
  */
1167
- entityId?: string | undefined;
1186
+ entityId: string;
1168
1187
  /**
1169
1188
  * The event's date time of creation.
1170
1189
  */
1171
- createdAt?: string | undefined;
1190
+ createdAt: string;
1172
1191
  /**
1173
1192
  * Full payload of the event.
1174
1193
  */
@@ -1176,7 +1195,7 @@ export type GetWebhookEventResponse = {
1176
1195
  /**
1177
1196
  * An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.
1178
1197
  */
1179
- links?: GetWebhookEventLinks | undefined;
1198
+ links: GetWebhookEventLinks;
1180
1199
  };
1181
1200
 
1182
1201
  /** @internal */
@@ -1358,6 +1377,27 @@ export function getWebhookEventNotFoundLinksFromJSON(
1358
1377
  );
1359
1378
  }
1360
1379
 
1380
+ /** @internal */
1381
+ export const GetWebhookEventWebhookEventTypes$inboundSchema: z.ZodNativeEnum<
1382
+ typeof GetWebhookEventWebhookEventTypes
1383
+ > = z.nativeEnum(GetWebhookEventWebhookEventTypes);
1384
+
1385
+ /** @internal */
1386
+ export const GetWebhookEventWebhookEventTypes$outboundSchema: z.ZodNativeEnum<
1387
+ typeof GetWebhookEventWebhookEventTypes
1388
+ > = GetWebhookEventWebhookEventTypes$inboundSchema;
1389
+
1390
+ /**
1391
+ * @internal
1392
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1393
+ */
1394
+ export namespace GetWebhookEventWebhookEventTypes$ {
1395
+ /** @deprecated use `GetWebhookEventWebhookEventTypes$inboundSchema` instead. */
1396
+ export const inboundSchema = GetWebhookEventWebhookEventTypes$inboundSchema;
1397
+ /** @deprecated use `GetWebhookEventWebhookEventTypes$outboundSchema` instead. */
1398
+ export const outboundSchema = GetWebhookEventWebhookEventTypes$outboundSchema;
1399
+ }
1400
+
1361
1401
  /** @internal */
1362
1402
  export const GetWebhookEventMode2$inboundSchema: z.ZodNativeEnum<
1363
1403
  typeof GetWebhookEventMode2
@@ -3522,16 +3562,15 @@ export const GetWebhookEventLinks$inboundSchema: z.ZodType<
3522
3562
  z.ZodTypeDef,
3523
3563
  unknown
3524
3564
  > = z.object({
3525
- self: z.lazy(() => GetWebhookEventSelf$inboundSchema).optional(),
3526
- documentation: z.lazy(() => GetWebhookEventDocumentation$inboundSchema)
3527
- .optional(),
3565
+ self: z.lazy(() => GetWebhookEventSelf$inboundSchema),
3566
+ documentation: z.lazy(() => GetWebhookEventDocumentation$inboundSchema),
3528
3567
  entity: z.lazy(() => LinksEntity$inboundSchema).optional(),
3529
3568
  });
3530
3569
 
3531
3570
  /** @internal */
3532
3571
  export type GetWebhookEventLinks$Outbound = {
3533
- self?: GetWebhookEventSelf$Outbound | undefined;
3534
- documentation?: GetWebhookEventDocumentation$Outbound | undefined;
3572
+ self: GetWebhookEventSelf$Outbound;
3573
+ documentation: GetWebhookEventDocumentation$Outbound;
3535
3574
  entity?: LinksEntity$Outbound | undefined;
3536
3575
  };
3537
3576
 
@@ -3541,9 +3580,8 @@ export const GetWebhookEventLinks$outboundSchema: z.ZodType<
3541
3580
  z.ZodTypeDef,
3542
3581
  GetWebhookEventLinks
3543
3582
  > = z.object({
3544
- self: z.lazy(() => GetWebhookEventSelf$outboundSchema).optional(),
3545
- documentation: z.lazy(() => GetWebhookEventDocumentation$outboundSchema)
3546
- .optional(),
3583
+ self: z.lazy(() => GetWebhookEventSelf$outboundSchema),
3584
+ documentation: z.lazy(() => GetWebhookEventDocumentation$outboundSchema),
3547
3585
  entity: z.lazy(() => LinksEntity$outboundSchema).optional(),
3548
3586
  });
3549
3587
 
@@ -3584,16 +3622,17 @@ export const GetWebhookEventResponse$inboundSchema: z.ZodType<
3584
3622
  z.ZodTypeDef,
3585
3623
  unknown
3586
3624
  > = z.object({
3587
- resource: z.string().optional(),
3588
- id: z.string().optional(),
3589
- type: z.string().optional(),
3590
- entityId: z.string().optional(),
3591
- createdAt: z.string().optional(),
3625
+ resource: z.string(),
3626
+ id: z.string(),
3627
+ type: GetWebhookEventWebhookEventTypes$inboundSchema,
3628
+ entityId: z.string(),
3629
+ createdAt: z.string(),
3592
3630
  _embedded: z.nullable(z.lazy(() => GetWebhookEventEmbedded$inboundSchema))
3593
3631
  .optional(),
3594
- _links: z.lazy(() => GetWebhookEventLinks$inboundSchema).optional(),
3632
+ _links: z.lazy(() => GetWebhookEventLinks$inboundSchema),
3595
3633
  }).transform((v) => {
3596
3634
  return remap$(v, {
3635
+ "type": "webhookEventTypes",
3597
3636
  "_embedded": "embedded",
3598
3637
  "_links": "links",
3599
3638
  });
@@ -3601,13 +3640,13 @@ export const GetWebhookEventResponse$inboundSchema: z.ZodType<
3601
3640
 
3602
3641
  /** @internal */
3603
3642
  export type GetWebhookEventResponse$Outbound = {
3604
- resource?: string | undefined;
3605
- id?: string | undefined;
3606
- type?: string | undefined;
3607
- entityId?: string | undefined;
3608
- createdAt?: string | undefined;
3643
+ resource: string;
3644
+ id: string;
3645
+ type: string;
3646
+ entityId: string;
3647
+ createdAt: string;
3609
3648
  _embedded?: GetWebhookEventEmbedded$Outbound | null | undefined;
3610
- _links?: GetWebhookEventLinks$Outbound | undefined;
3649
+ _links: GetWebhookEventLinks$Outbound;
3611
3650
  };
3612
3651
 
3613
3652
  /** @internal */
@@ -3616,16 +3655,17 @@ export const GetWebhookEventResponse$outboundSchema: z.ZodType<
3616
3655
  z.ZodTypeDef,
3617
3656
  GetWebhookEventResponse
3618
3657
  > = z.object({
3619
- resource: z.string().optional(),
3620
- id: z.string().optional(),
3621
- type: z.string().optional(),
3622
- entityId: z.string().optional(),
3623
- createdAt: z.string().optional(),
3658
+ resource: z.string(),
3659
+ id: z.string(),
3660
+ webhookEventTypes: GetWebhookEventWebhookEventTypes$outboundSchema,
3661
+ entityId: z.string(),
3662
+ createdAt: z.string(),
3624
3663
  embedded: z.nullable(z.lazy(() => GetWebhookEventEmbedded$outboundSchema))
3625
3664
  .optional(),
3626
- links: z.lazy(() => GetWebhookEventLinks$outboundSchema).optional(),
3665
+ links: z.lazy(() => GetWebhookEventLinks$outboundSchema),
3627
3666
  }).transform((v) => {
3628
3667
  return remap$(v, {
3668
+ webhookEventTypes: "type",
3629
3669
  embedded: "_embedded",
3630
3670
  links: "_links",
3631
3671
  });
@@ -1305,7 +1305,7 @@ export const ListCustomerPaymentsFeeRegion = {
1305
1305
  Maestro: "maestro",
1306
1306
  Other: "other",
1307
1307
  Inter: "inter",
1308
- IntraEea: "intra-eea",
1308
+ IntraEea: "intra_eea",
1309
1309
  } as const;
1310
1310
  /**
1311
1311
  * The applicable card fee region.
@@ -1283,7 +1283,7 @@ export const ListPaymentsFeeRegion = {
1283
1283
  Maestro: "maestro",
1284
1284
  Other: "other",
1285
1285
  Inter: "inter",
1286
- IntraEea: "intra-eea",
1286
+ IntraEea: "intra_eea",
1287
1287
  } as const;
1288
1288
  /**
1289
1289
  * The applicable card fee region.
@@ -1305,7 +1305,7 @@ export const ListSettlementPaymentsFeeRegion = {
1305
1305
  Maestro: "maestro",
1306
1306
  Other: "other",
1307
1307
  Inter: "inter",
1308
- IntraEea: "intra-eea",
1308
+ IntraEea: "intra_eea",
1309
1309
  } as const;
1310
1310
  /**
1311
1311
  * The applicable card fee region.
@@ -1309,7 +1309,7 @@ export const ListSubscriptionPaymentsFeeRegion = {
1309
1309
  Maestro: "maestro",
1310
1310
  Other: "other",
1311
1311
  Inter: "inter",
1312
- IntraEea: "intra-eea",
1312
+ IntraEea: "intra_eea",
1313
1313
  } as const;
1314
1314
  /**
1315
1315
  * The applicable card fee region.