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.
- package/FUNCTIONS.md +7 -139
- package/README.md +77 -877
- package/bin/mcp-server.js +385 -192
- package/bin/mcp-server.js.map +20 -20
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +40 -40
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/models/operations/cancelpayment.d.ts +3 -3
- package/dist/commonjs/models/operations/cancelpayment.js +1 -1
- package/dist/commonjs/models/operations/createcustomerpayment.d.ts +3 -3
- package/dist/commonjs/models/operations/createcustomerpayment.js +1 -1
- package/dist/commonjs/models/operations/createpayment.d.ts +3 -3
- package/dist/commonjs/models/operations/createpayment.js +1 -1
- package/dist/commonjs/models/operations/createwebhook.d.ts +96 -38
- package/dist/commonjs/models/operations/createwebhook.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createwebhook.js +79 -41
- package/dist/commonjs/models/operations/createwebhook.js.map +1 -1
- package/dist/commonjs/models/operations/getpayment.d.ts +3 -3
- package/dist/commonjs/models/operations/getpayment.js +1 -1
- package/dist/commonjs/models/operations/getpaymentlinkpayments.d.ts +3 -3
- package/dist/commonjs/models/operations/getpaymentlinkpayments.js +1 -1
- package/dist/commonjs/models/operations/getwebhook.d.ts +139 -21
- package/dist/commonjs/models/operations/getwebhook.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getwebhook.js +114 -20
- package/dist/commonjs/models/operations/getwebhook.js.map +1 -1
- package/dist/commonjs/models/operations/getwebhookevent.d.ts +63 -17
- package/dist/commonjs/models/operations/getwebhookevent.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getwebhookevent.js +48 -21
- package/dist/commonjs/models/operations/getwebhookevent.js.map +1 -1
- package/dist/commonjs/models/operations/listcustomerpayments.d.ts +3 -3
- package/dist/commonjs/models/operations/listcustomerpayments.js +1 -1
- package/dist/commonjs/models/operations/listpayments.d.ts +3 -3
- package/dist/commonjs/models/operations/listpayments.js +1 -1
- package/dist/commonjs/models/operations/listsettlementpayments.d.ts +3 -3
- package/dist/commonjs/models/operations/listsettlementpayments.js +1 -1
- package/dist/commonjs/models/operations/listsubscriptionpayments.d.ts +3 -3
- package/dist/commonjs/models/operations/listsubscriptionpayments.js +1 -1
- package/dist/commonjs/models/operations/listwebhooks.d.ts +160 -39
- package/dist/commonjs/models/operations/listwebhooks.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listwebhooks.js +136 -41
- package/dist/commonjs/models/operations/listwebhooks.js.map +1 -1
- package/dist/commonjs/models/operations/updatepayment.d.ts +3 -3
- package/dist/commonjs/models/operations/updatepayment.js +1 -1
- package/dist/commonjs/models/operations/updatewebhook.d.ts +162 -32
- package/dist/commonjs/models/operations/updatewebhook.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatewebhook.js +140 -33
- package/dist/commonjs/models/operations/updatewebhook.js.map +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +24 -24
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +36 -36
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +40 -40
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/models/operations/cancelpayment.d.ts +3 -3
- package/dist/esm/models/operations/cancelpayment.js +1 -1
- package/dist/esm/models/operations/createcustomerpayment.d.ts +3 -3
- package/dist/esm/models/operations/createcustomerpayment.js +1 -1
- package/dist/esm/models/operations/createpayment.d.ts +3 -3
- package/dist/esm/models/operations/createpayment.js +1 -1
- package/dist/esm/models/operations/createwebhook.d.ts +96 -38
- package/dist/esm/models/operations/createwebhook.d.ts.map +1 -1
- package/dist/esm/models/operations/createwebhook.js +78 -40
- package/dist/esm/models/operations/createwebhook.js.map +1 -1
- package/dist/esm/models/operations/getpayment.d.ts +3 -3
- package/dist/esm/models/operations/getpayment.js +1 -1
- package/dist/esm/models/operations/getpaymentlinkpayments.d.ts +3 -3
- package/dist/esm/models/operations/getpaymentlinkpayments.js +1 -1
- package/dist/esm/models/operations/getwebhook.d.ts +139 -21
- package/dist/esm/models/operations/getwebhook.d.ts.map +1 -1
- package/dist/esm/models/operations/getwebhook.js +109 -19
- package/dist/esm/models/operations/getwebhook.js.map +1 -1
- package/dist/esm/models/operations/getwebhookevent.d.ts +63 -17
- package/dist/esm/models/operations/getwebhookevent.d.ts.map +1 -1
- package/dist/esm/models/operations/getwebhookevent.js +45 -18
- package/dist/esm/models/operations/getwebhookevent.js.map +1 -1
- package/dist/esm/models/operations/listcustomerpayments.d.ts +3 -3
- package/dist/esm/models/operations/listcustomerpayments.js +1 -1
- package/dist/esm/models/operations/listpayments.d.ts +3 -3
- package/dist/esm/models/operations/listpayments.js +1 -1
- package/dist/esm/models/operations/listsettlementpayments.d.ts +3 -3
- package/dist/esm/models/operations/listsettlementpayments.js +1 -1
- package/dist/esm/models/operations/listsubscriptionpayments.d.ts +3 -3
- package/dist/esm/models/operations/listsubscriptionpayments.js +1 -1
- package/dist/esm/models/operations/listwebhooks.d.ts +160 -39
- package/dist/esm/models/operations/listwebhooks.d.ts.map +1 -1
- package/dist/esm/models/operations/listwebhooks.js +130 -40
- package/dist/esm/models/operations/listwebhooks.js.map +1 -1
- package/dist/esm/models/operations/updatepayment.d.ts +3 -3
- package/dist/esm/models/operations/updatepayment.js +1 -1
- package/dist/esm/models/operations/updatewebhook.d.ts +162 -32
- package/dist/esm/models/operations/updatewebhook.d.ts.map +1 -1
- package/dist/esm/models/operations/updatewebhook.js +135 -32
- package/dist/esm/models/operations/updatewebhook.js.map +1 -1
- package/dist/esm/sdk/sdk.d.ts +24 -24
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +36 -36
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/webhooks/README.md +4 -4
- package/examples/balancesList.example.ts +33 -0
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +40 -40
- package/src/models/operations/cancelpayment.ts +1 -1
- package/src/models/operations/createcustomerpayment.ts +1 -1
- package/src/models/operations/createpayment.ts +1 -1
- package/src/models/operations/createwebhook.ts +134 -73
- package/src/models/operations/getpayment.ts +1 -1
- package/src/models/operations/getpaymentlinkpayments.ts +1 -1
- package/src/models/operations/getwebhook.ts +228 -39
- package/src/models/operations/getwebhookevent.ts +75 -35
- package/src/models/operations/listcustomerpayments.ts +1 -1
- package/src/models/operations/listpayments.ts +1 -1
- package/src/models/operations/listsettlementpayments.ts +1 -1
- package/src/models/operations/listsubscriptionpayments.ts +1 -1
- package/src/models/operations/listwebhooks.ts +262 -73
- package/src/models/operations/updatepayment.ts +1 -1
- package/src/models/operations/updatewebhook.ts +273 -59
- package/src/sdk/sdk.ts +60 -60
- 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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
138
|
+
resource: string;
|
|
95
139
|
/**
|
|
96
140
|
* The identifier uniquely referring to this subscription.
|
|
97
141
|
*/
|
|
98
|
-
id
|
|
142
|
+
id: string;
|
|
99
143
|
/**
|
|
100
144
|
* The subscription's events destination.
|
|
101
145
|
*/
|
|
102
|
-
url
|
|
146
|
+
url: string;
|
|
103
147
|
/**
|
|
104
148
|
* The identifier uniquely referring to the profile that created the subscription.
|
|
105
149
|
*/
|
|
106
|
-
profileId
|
|
150
|
+
profileId: string | null;
|
|
107
151
|
/**
|
|
108
152
|
* The subscription's date time of creation.
|
|
109
153
|
*/
|
|
110
|
-
createdAt
|
|
154
|
+
createdAt: string;
|
|
111
155
|
/**
|
|
112
156
|
* The subscription's name.
|
|
113
157
|
*/
|
|
114
|
-
name
|
|
158
|
+
name: string;
|
|
115
159
|
/**
|
|
116
160
|
* The events types that are subscribed.
|
|
117
161
|
*/
|
|
118
|
-
eventTypes
|
|
162
|
+
eventTypes: Array<GetWebhookWebhookEventTypes>;
|
|
119
163
|
/**
|
|
120
164
|
* The subscription's current status.
|
|
121
165
|
*/
|
|
122
|
-
status
|
|
166
|
+
status: GetWebhookStatus;
|
|
167
|
+
/**
|
|
168
|
+
* Whether this entity was created in live mode or in test mode.
|
|
169
|
+
*/
|
|
170
|
+
mode: GetWebhookMode;
|
|
123
171
|
/**
|
|
124
|
-
*
|
|
172
|
+
* An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.
|
|
125
173
|
*/
|
|
126
|
-
|
|
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()
|
|
477
|
-
id: z.string()
|
|
478
|
-
url: z.string()
|
|
479
|
-
profileId: z.
|
|
480
|
-
createdAt: z.string()
|
|
481
|
-
name: z.string()
|
|
482
|
-
eventTypes: z.array(
|
|
483
|
-
status: GetWebhookStatus$inboundSchema
|
|
484
|
-
mode: GetWebhookMode$inboundSchema
|
|
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
|
|
490
|
-
id
|
|
491
|
-
url
|
|
492
|
-
profileId
|
|
493
|
-
createdAt
|
|
494
|
-
name
|
|
495
|
-
eventTypes
|
|
496
|
-
status
|
|
497
|
-
mode
|
|
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()
|
|
507
|
-
id: z.string()
|
|
508
|
-
url: z.string()
|
|
509
|
-
profileId: z.
|
|
510
|
-
createdAt: z.string()
|
|
511
|
-
name: z.string()
|
|
512
|
-
eventTypes: z.array(
|
|
513
|
-
status: GetWebhookStatus$outboundSchema
|
|
514
|
-
mode: GetWebhookMode$outboundSchema
|
|
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
|
|
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
|
|
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
|
|
1174
|
+
resource: string;
|
|
1156
1175
|
/**
|
|
1157
1176
|
* The identifier uniquely referring to this event.
|
|
1158
1177
|
*/
|
|
1159
|
-
id
|
|
1178
|
+
id: string;
|
|
1160
1179
|
/**
|
|
1161
|
-
* The event's type
|
|
1180
|
+
* The event's type
|
|
1162
1181
|
*/
|
|
1163
|
-
|
|
1182
|
+
webhookEventTypes: GetWebhookEventWebhookEventTypes;
|
|
1164
1183
|
/**
|
|
1165
1184
|
* The entity token that triggered the event
|
|
1166
1185
|
*/
|
|
1167
|
-
entityId
|
|
1186
|
+
entityId: string;
|
|
1168
1187
|
/**
|
|
1169
1188
|
* The event's date time of creation.
|
|
1170
1189
|
*/
|
|
1171
|
-
createdAt
|
|
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
|
|
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)
|
|
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
|
|
3534
|
-
documentation
|
|
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)
|
|
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()
|
|
3588
|
-
id: z.string()
|
|
3589
|
-
type:
|
|
3590
|
-
entityId: z.string()
|
|
3591
|
-
createdAt: z.string()
|
|
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)
|
|
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
|
|
3605
|
-
id
|
|
3606
|
-
type
|
|
3607
|
-
entityId
|
|
3608
|
-
createdAt
|
|
3643
|
+
resource: string;
|
|
3644
|
+
id: string;
|
|
3645
|
+
type: string;
|
|
3646
|
+
entityId: string;
|
|
3647
|
+
createdAt: string;
|
|
3609
3648
|
_embedded?: GetWebhookEventEmbedded$Outbound | null | undefined;
|
|
3610
|
-
_links
|
|
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()
|
|
3620
|
-
id: z.string()
|
|
3621
|
-
|
|
3622
|
-
entityId: z.string()
|
|
3623
|
-
createdAt: z.string()
|
|
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)
|
|
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
|
});
|