mollie-api-typescript 0.1.7 → 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 +375 -182
- package/bin/mcp-server.js.map +10 -10
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- 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/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/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/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/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/lib/config.js.map +1 -1
- 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/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/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/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/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/createwebhook.ts +134 -73
- package/src/models/operations/getwebhook.ts +228 -39
- package/src/models/operations/getwebhookevent.ts +75 -35
- package/src/models/operations/listwebhooks.ts +262 -73
- package/src/models/operations/updatewebhook.ts +273 -59
- package/src/sdk/sdk.ts +60 -60
- package/examples/paymentsCreate.example.ts +0 -166
|
@@ -28,20 +28,23 @@ export const ListWebhooksSort = {
|
|
|
28
28
|
export type ListWebhooksSort = ClosedEnum<typeof ListWebhooksSort>;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* The event's type
|
|
32
32
|
*/
|
|
33
|
-
export const
|
|
33
|
+
export const EventTypesWebhookEventTypes = {
|
|
34
34
|
PaymentLinkPaid: "payment-link.paid",
|
|
35
35
|
BalanceTransactionCreated: "balance-transaction.created",
|
|
36
36
|
SalesInvoiceCreated: "sales-invoice.created",
|
|
37
37
|
SalesInvoiceIssued: "sales-invoice.issued",
|
|
38
38
|
SalesInvoiceCanceled: "sales-invoice.canceled",
|
|
39
39
|
SalesInvoicePaid: "sales-invoice.paid",
|
|
40
|
+
Wildcard: "*",
|
|
40
41
|
} as const;
|
|
41
42
|
/**
|
|
42
|
-
*
|
|
43
|
+
* The event's type
|
|
43
44
|
*/
|
|
44
|
-
export type
|
|
45
|
+
export type EventTypesWebhookEventTypes = ClosedEnum<
|
|
46
|
+
typeof EventTypesWebhookEventTypes
|
|
47
|
+
>;
|
|
45
48
|
|
|
46
49
|
export type ListWebhooksRequest = {
|
|
47
50
|
/**
|
|
@@ -65,7 +68,7 @@ export type ListWebhooksRequest = {
|
|
|
65
68
|
/**
|
|
66
69
|
* Used to filter out only the webhooks that are subscribed to certain types of events.
|
|
67
70
|
*/
|
|
68
|
-
eventTypes?:
|
|
71
|
+
eventTypes?: EventTypesWebhookEventTypes | undefined;
|
|
69
72
|
/**
|
|
70
73
|
* Most API credentials are specifically created for either live mode or test mode. In those cases the `testmode` query
|
|
71
74
|
*
|
|
@@ -93,6 +96,25 @@ export type ListWebhooksBadRequestLinks = {
|
|
|
93
96
|
documentation: ListWebhooksBadRequestDocumentation;
|
|
94
97
|
};
|
|
95
98
|
|
|
99
|
+
/**
|
|
100
|
+
* The event's type
|
|
101
|
+
*/
|
|
102
|
+
export const WebhookWebhookEventTypes = {
|
|
103
|
+
PaymentLinkPaid: "payment-link.paid",
|
|
104
|
+
BalanceTransactionCreated: "balance-transaction.created",
|
|
105
|
+
SalesInvoiceCreated: "sales-invoice.created",
|
|
106
|
+
SalesInvoiceIssued: "sales-invoice.issued",
|
|
107
|
+
SalesInvoiceCanceled: "sales-invoice.canceled",
|
|
108
|
+
SalesInvoicePaid: "sales-invoice.paid",
|
|
109
|
+
Wildcard: "*",
|
|
110
|
+
} as const;
|
|
111
|
+
/**
|
|
112
|
+
* The event's type
|
|
113
|
+
*/
|
|
114
|
+
export type WebhookWebhookEventTypes = ClosedEnum<
|
|
115
|
+
typeof WebhookWebhookEventTypes
|
|
116
|
+
>;
|
|
117
|
+
|
|
96
118
|
/**
|
|
97
119
|
* The subscription's current status.
|
|
98
120
|
*/
|
|
@@ -108,17 +130,41 @@ export const ListWebhooksStatus = {
|
|
|
108
130
|
export type ListWebhooksStatus = ClosedEnum<typeof ListWebhooksStatus>;
|
|
109
131
|
|
|
110
132
|
/**
|
|
111
|
-
*
|
|
133
|
+
* Whether this entity was created in live mode or in test mode.
|
|
112
134
|
*/
|
|
113
135
|
export const ListWebhooksMode = {
|
|
114
136
|
Live: "live",
|
|
115
137
|
Test: "test",
|
|
116
138
|
} as const;
|
|
117
139
|
/**
|
|
118
|
-
*
|
|
140
|
+
* Whether this entity was created in live mode or in test mode.
|
|
119
141
|
*/
|
|
120
142
|
export type ListWebhooksMode = ClosedEnum<typeof ListWebhooksMode>;
|
|
121
143
|
|
|
144
|
+
/**
|
|
145
|
+
* In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.
|
|
146
|
+
*/
|
|
147
|
+
export type WebhookDocumentation = {
|
|
148
|
+
/**
|
|
149
|
+
* The actual URL string.
|
|
150
|
+
*/
|
|
151
|
+
href: string;
|
|
152
|
+
/**
|
|
153
|
+
* The content type of the page or endpoint the URL points to.
|
|
154
|
+
*/
|
|
155
|
+
type: string;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.
|
|
160
|
+
*/
|
|
161
|
+
export type WebhookLinks = {
|
|
162
|
+
/**
|
|
163
|
+
* In v2 endpoints, URLs are commonly represented as objects with an `href` and `type` field.
|
|
164
|
+
*/
|
|
165
|
+
documentation: WebhookDocumentation;
|
|
166
|
+
};
|
|
167
|
+
|
|
122
168
|
export type Webhook = {
|
|
123
169
|
/**
|
|
124
170
|
* Indicates the response contains a webhook subscription object.
|
|
@@ -126,46 +172,50 @@ export type Webhook = {
|
|
|
126
172
|
* @remarks
|
|
127
173
|
* Will always contain the string `webhook` for this endpoint.
|
|
128
174
|
*/
|
|
129
|
-
resource
|
|
175
|
+
resource: string;
|
|
130
176
|
/**
|
|
131
177
|
* The identifier uniquely referring to this subscription.
|
|
132
178
|
*/
|
|
133
|
-
id
|
|
179
|
+
id: string;
|
|
134
180
|
/**
|
|
135
181
|
* The subscription's events destination.
|
|
136
182
|
*/
|
|
137
|
-
url
|
|
183
|
+
url: string;
|
|
138
184
|
/**
|
|
139
185
|
* The identifier uniquely referring to the profile that created the subscription.
|
|
140
186
|
*/
|
|
141
|
-
profileId
|
|
187
|
+
profileId: string | null;
|
|
142
188
|
/**
|
|
143
189
|
* The subscription's date time of creation.
|
|
144
190
|
*/
|
|
145
|
-
createdAt
|
|
191
|
+
createdAt: string;
|
|
146
192
|
/**
|
|
147
193
|
* The subscription's name.
|
|
148
194
|
*/
|
|
149
|
-
name
|
|
195
|
+
name: string;
|
|
150
196
|
/**
|
|
151
197
|
* The events types that are subscribed.
|
|
152
198
|
*/
|
|
153
|
-
eventTypes
|
|
199
|
+
eventTypes: Array<WebhookWebhookEventTypes>;
|
|
154
200
|
/**
|
|
155
201
|
* The subscription's current status.
|
|
156
202
|
*/
|
|
157
|
-
status
|
|
203
|
+
status: ListWebhooksStatus;
|
|
158
204
|
/**
|
|
159
|
-
*
|
|
205
|
+
* Whether this entity was created in live mode or in test mode.
|
|
160
206
|
*/
|
|
161
|
-
mode
|
|
207
|
+
mode: ListWebhooksMode;
|
|
208
|
+
/**
|
|
209
|
+
* An object with several relevant URLs. Every URL object will contain an `href` and a `type` field.
|
|
210
|
+
*/
|
|
211
|
+
links: WebhookLinks;
|
|
162
212
|
};
|
|
163
213
|
|
|
164
214
|
export type ListWebhooksEmbedded = {
|
|
165
215
|
/**
|
|
166
216
|
* A list of webhooks.
|
|
167
217
|
*/
|
|
168
|
-
webhooks
|
|
218
|
+
webhooks: Array<Webhook>;
|
|
169
219
|
};
|
|
170
220
|
|
|
171
221
|
/**
|
|
@@ -262,12 +312,12 @@ export type ListWebhooksResponse = {
|
|
|
262
312
|
* The maximum number of items per result set is controlled by the `limit` property provided in the request. The default
|
|
263
313
|
* limit is 50 items.
|
|
264
314
|
*/
|
|
265
|
-
count
|
|
266
|
-
embedded
|
|
315
|
+
count: number;
|
|
316
|
+
embedded: ListWebhooksEmbedded;
|
|
267
317
|
/**
|
|
268
318
|
* Links to help navigate through the lists of items. Every URL object will contain an `href` and a `type` field.
|
|
269
319
|
*/
|
|
270
|
-
links
|
|
320
|
+
links: ListWebhooksLinks;
|
|
271
321
|
};
|
|
272
322
|
|
|
273
323
|
/** @internal */
|
|
@@ -292,24 +342,24 @@ export namespace ListWebhooksSort$ {
|
|
|
292
342
|
}
|
|
293
343
|
|
|
294
344
|
/** @internal */
|
|
295
|
-
export const
|
|
296
|
-
typeof
|
|
297
|
-
> = z.nativeEnum(
|
|
345
|
+
export const EventTypesWebhookEventTypes$inboundSchema: z.ZodNativeEnum<
|
|
346
|
+
typeof EventTypesWebhookEventTypes
|
|
347
|
+
> = z.nativeEnum(EventTypesWebhookEventTypes);
|
|
298
348
|
|
|
299
349
|
/** @internal */
|
|
300
|
-
export const
|
|
301
|
-
typeof
|
|
302
|
-
> =
|
|
350
|
+
export const EventTypesWebhookEventTypes$outboundSchema: z.ZodNativeEnum<
|
|
351
|
+
typeof EventTypesWebhookEventTypes
|
|
352
|
+
> = EventTypesWebhookEventTypes$inboundSchema;
|
|
303
353
|
|
|
304
354
|
/**
|
|
305
355
|
* @internal
|
|
306
356
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
307
357
|
*/
|
|
308
|
-
export namespace
|
|
309
|
-
/** @deprecated use `
|
|
310
|
-
export const inboundSchema =
|
|
311
|
-
/** @deprecated use `
|
|
312
|
-
export const outboundSchema =
|
|
358
|
+
export namespace EventTypesWebhookEventTypes$ {
|
|
359
|
+
/** @deprecated use `EventTypesWebhookEventTypes$inboundSchema` instead. */
|
|
360
|
+
export const inboundSchema = EventTypesWebhookEventTypes$inboundSchema;
|
|
361
|
+
/** @deprecated use `EventTypesWebhookEventTypes$outboundSchema` instead. */
|
|
362
|
+
export const outboundSchema = EventTypesWebhookEventTypes$outboundSchema;
|
|
313
363
|
}
|
|
314
364
|
|
|
315
365
|
/** @internal */
|
|
@@ -321,7 +371,7 @@ export const ListWebhooksRequest$inboundSchema: z.ZodType<
|
|
|
321
371
|
from: z.string().optional(),
|
|
322
372
|
limit: z.nullable(z.number().int()).optional(),
|
|
323
373
|
sort: z.nullable(ListWebhooksSort$inboundSchema).optional(),
|
|
324
|
-
eventTypes:
|
|
374
|
+
eventTypes: EventTypesWebhookEventTypes$inboundSchema.optional(),
|
|
325
375
|
testmode: z.nullable(z.boolean()).optional(),
|
|
326
376
|
});
|
|
327
377
|
|
|
@@ -343,7 +393,7 @@ export const ListWebhooksRequest$outboundSchema: z.ZodType<
|
|
|
343
393
|
from: z.string().optional(),
|
|
344
394
|
limit: z.nullable(z.number().int()).optional(),
|
|
345
395
|
sort: z.nullable(ListWebhooksSort$outboundSchema).optional(),
|
|
346
|
-
eventTypes:
|
|
396
|
+
eventTypes: EventTypesWebhookEventTypes$outboundSchema.optional(),
|
|
347
397
|
testmode: z.nullable(z.boolean()).optional(),
|
|
348
398
|
});
|
|
349
399
|
|
|
@@ -500,6 +550,27 @@ export function listWebhooksBadRequestLinksFromJSON(
|
|
|
500
550
|
);
|
|
501
551
|
}
|
|
502
552
|
|
|
553
|
+
/** @internal */
|
|
554
|
+
export const WebhookWebhookEventTypes$inboundSchema: z.ZodNativeEnum<
|
|
555
|
+
typeof WebhookWebhookEventTypes
|
|
556
|
+
> = z.nativeEnum(WebhookWebhookEventTypes);
|
|
557
|
+
|
|
558
|
+
/** @internal */
|
|
559
|
+
export const WebhookWebhookEventTypes$outboundSchema: z.ZodNativeEnum<
|
|
560
|
+
typeof WebhookWebhookEventTypes
|
|
561
|
+
> = WebhookWebhookEventTypes$inboundSchema;
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* @internal
|
|
565
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
566
|
+
*/
|
|
567
|
+
export namespace WebhookWebhookEventTypes$ {
|
|
568
|
+
/** @deprecated use `WebhookWebhookEventTypes$inboundSchema` instead. */
|
|
569
|
+
export const inboundSchema = WebhookWebhookEventTypes$inboundSchema;
|
|
570
|
+
/** @deprecated use `WebhookWebhookEventTypes$outboundSchema` instead. */
|
|
571
|
+
export const outboundSchema = WebhookWebhookEventTypes$outboundSchema;
|
|
572
|
+
}
|
|
573
|
+
|
|
503
574
|
/** @internal */
|
|
504
575
|
export const ListWebhooksStatus$inboundSchema: z.ZodNativeEnum<
|
|
505
576
|
typeof ListWebhooksStatus
|
|
@@ -542,31 +613,144 @@ export namespace ListWebhooksMode$ {
|
|
|
542
613
|
export const outboundSchema = ListWebhooksMode$outboundSchema;
|
|
543
614
|
}
|
|
544
615
|
|
|
616
|
+
/** @internal */
|
|
617
|
+
export const WebhookDocumentation$inboundSchema: z.ZodType<
|
|
618
|
+
WebhookDocumentation,
|
|
619
|
+
z.ZodTypeDef,
|
|
620
|
+
unknown
|
|
621
|
+
> = z.object({
|
|
622
|
+
href: z.string(),
|
|
623
|
+
type: z.string(),
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
/** @internal */
|
|
627
|
+
export type WebhookDocumentation$Outbound = {
|
|
628
|
+
href: string;
|
|
629
|
+
type: string;
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
/** @internal */
|
|
633
|
+
export const WebhookDocumentation$outboundSchema: z.ZodType<
|
|
634
|
+
WebhookDocumentation$Outbound,
|
|
635
|
+
z.ZodTypeDef,
|
|
636
|
+
WebhookDocumentation
|
|
637
|
+
> = z.object({
|
|
638
|
+
href: z.string(),
|
|
639
|
+
type: z.string(),
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* @internal
|
|
644
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
645
|
+
*/
|
|
646
|
+
export namespace WebhookDocumentation$ {
|
|
647
|
+
/** @deprecated use `WebhookDocumentation$inboundSchema` instead. */
|
|
648
|
+
export const inboundSchema = WebhookDocumentation$inboundSchema;
|
|
649
|
+
/** @deprecated use `WebhookDocumentation$outboundSchema` instead. */
|
|
650
|
+
export const outboundSchema = WebhookDocumentation$outboundSchema;
|
|
651
|
+
/** @deprecated use `WebhookDocumentation$Outbound` instead. */
|
|
652
|
+
export type Outbound = WebhookDocumentation$Outbound;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
export function webhookDocumentationToJSON(
|
|
656
|
+
webhookDocumentation: WebhookDocumentation,
|
|
657
|
+
): string {
|
|
658
|
+
return JSON.stringify(
|
|
659
|
+
WebhookDocumentation$outboundSchema.parse(webhookDocumentation),
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
export function webhookDocumentationFromJSON(
|
|
664
|
+
jsonString: string,
|
|
665
|
+
): SafeParseResult<WebhookDocumentation, SDKValidationError> {
|
|
666
|
+
return safeParse(
|
|
667
|
+
jsonString,
|
|
668
|
+
(x) => WebhookDocumentation$inboundSchema.parse(JSON.parse(x)),
|
|
669
|
+
`Failed to parse 'WebhookDocumentation' from JSON`,
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/** @internal */
|
|
674
|
+
export const WebhookLinks$inboundSchema: z.ZodType<
|
|
675
|
+
WebhookLinks,
|
|
676
|
+
z.ZodTypeDef,
|
|
677
|
+
unknown
|
|
678
|
+
> = z.object({
|
|
679
|
+
documentation: z.lazy(() => WebhookDocumentation$inboundSchema),
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
/** @internal */
|
|
683
|
+
export type WebhookLinks$Outbound = {
|
|
684
|
+
documentation: WebhookDocumentation$Outbound;
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
/** @internal */
|
|
688
|
+
export const WebhookLinks$outboundSchema: z.ZodType<
|
|
689
|
+
WebhookLinks$Outbound,
|
|
690
|
+
z.ZodTypeDef,
|
|
691
|
+
WebhookLinks
|
|
692
|
+
> = z.object({
|
|
693
|
+
documentation: z.lazy(() => WebhookDocumentation$outboundSchema),
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* @internal
|
|
698
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
699
|
+
*/
|
|
700
|
+
export namespace WebhookLinks$ {
|
|
701
|
+
/** @deprecated use `WebhookLinks$inboundSchema` instead. */
|
|
702
|
+
export const inboundSchema = WebhookLinks$inboundSchema;
|
|
703
|
+
/** @deprecated use `WebhookLinks$outboundSchema` instead. */
|
|
704
|
+
export const outboundSchema = WebhookLinks$outboundSchema;
|
|
705
|
+
/** @deprecated use `WebhookLinks$Outbound` instead. */
|
|
706
|
+
export type Outbound = WebhookLinks$Outbound;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
export function webhookLinksToJSON(webhookLinks: WebhookLinks): string {
|
|
710
|
+
return JSON.stringify(WebhookLinks$outboundSchema.parse(webhookLinks));
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
export function webhookLinksFromJSON(
|
|
714
|
+
jsonString: string,
|
|
715
|
+
): SafeParseResult<WebhookLinks, SDKValidationError> {
|
|
716
|
+
return safeParse(
|
|
717
|
+
jsonString,
|
|
718
|
+
(x) => WebhookLinks$inboundSchema.parse(JSON.parse(x)),
|
|
719
|
+
`Failed to parse 'WebhookLinks' from JSON`,
|
|
720
|
+
);
|
|
721
|
+
}
|
|
722
|
+
|
|
545
723
|
/** @internal */
|
|
546
724
|
export const Webhook$inboundSchema: z.ZodType<Webhook, z.ZodTypeDef, unknown> =
|
|
547
725
|
z.object({
|
|
548
|
-
resource: z.string()
|
|
549
|
-
id: z.string()
|
|
550
|
-
url: z.string()
|
|
551
|
-
profileId: z.
|
|
552
|
-
createdAt: z.string()
|
|
553
|
-
name: z.string()
|
|
554
|
-
eventTypes: z.array(
|
|
555
|
-
status: ListWebhooksStatus$inboundSchema
|
|
556
|
-
mode: ListWebhooksMode$inboundSchema
|
|
726
|
+
resource: z.string(),
|
|
727
|
+
id: z.string(),
|
|
728
|
+
url: z.string(),
|
|
729
|
+
profileId: z.nullable(z.string()),
|
|
730
|
+
createdAt: z.string(),
|
|
731
|
+
name: z.string(),
|
|
732
|
+
eventTypes: z.array(WebhookWebhookEventTypes$inboundSchema),
|
|
733
|
+
status: ListWebhooksStatus$inboundSchema,
|
|
734
|
+
mode: ListWebhooksMode$inboundSchema,
|
|
735
|
+
_links: z.lazy(() => WebhookLinks$inboundSchema),
|
|
736
|
+
}).transform((v) => {
|
|
737
|
+
return remap$(v, {
|
|
738
|
+
"_links": "links",
|
|
739
|
+
});
|
|
557
740
|
});
|
|
558
741
|
|
|
559
742
|
/** @internal */
|
|
560
743
|
export type Webhook$Outbound = {
|
|
561
|
-
resource
|
|
562
|
-
id
|
|
563
|
-
url
|
|
564
|
-
profileId
|
|
565
|
-
createdAt
|
|
566
|
-
name
|
|
567
|
-
eventTypes
|
|
568
|
-
status
|
|
569
|
-
mode
|
|
744
|
+
resource: string;
|
|
745
|
+
id: string;
|
|
746
|
+
url: string;
|
|
747
|
+
profileId: string | null;
|
|
748
|
+
createdAt: string;
|
|
749
|
+
name: string;
|
|
750
|
+
eventTypes: Array<string>;
|
|
751
|
+
status: string;
|
|
752
|
+
mode: string;
|
|
753
|
+
_links: WebhookLinks$Outbound;
|
|
570
754
|
};
|
|
571
755
|
|
|
572
756
|
/** @internal */
|
|
@@ -575,15 +759,20 @@ export const Webhook$outboundSchema: z.ZodType<
|
|
|
575
759
|
z.ZodTypeDef,
|
|
576
760
|
Webhook
|
|
577
761
|
> = z.object({
|
|
578
|
-
resource: z.string()
|
|
579
|
-
id: z.string()
|
|
580
|
-
url: z.string()
|
|
581
|
-
profileId: z.
|
|
582
|
-
createdAt: z.string()
|
|
583
|
-
name: z.string()
|
|
584
|
-
eventTypes: z.array(
|
|
585
|
-
status: ListWebhooksStatus$outboundSchema
|
|
586
|
-
mode: ListWebhooksMode$outboundSchema
|
|
762
|
+
resource: z.string(),
|
|
763
|
+
id: z.string(),
|
|
764
|
+
url: z.string(),
|
|
765
|
+
profileId: z.nullable(z.string()),
|
|
766
|
+
createdAt: z.string(),
|
|
767
|
+
name: z.string(),
|
|
768
|
+
eventTypes: z.array(WebhookWebhookEventTypes$outboundSchema),
|
|
769
|
+
status: ListWebhooksStatus$outboundSchema,
|
|
770
|
+
mode: ListWebhooksMode$outboundSchema,
|
|
771
|
+
links: z.lazy(() => WebhookLinks$outboundSchema),
|
|
772
|
+
}).transform((v) => {
|
|
773
|
+
return remap$(v, {
|
|
774
|
+
links: "_links",
|
|
775
|
+
});
|
|
587
776
|
});
|
|
588
777
|
|
|
589
778
|
/**
|
|
@@ -619,12 +808,12 @@ export const ListWebhooksEmbedded$inboundSchema: z.ZodType<
|
|
|
619
808
|
z.ZodTypeDef,
|
|
620
809
|
unknown
|
|
621
810
|
> = z.object({
|
|
622
|
-
webhooks: z.array(z.lazy(() => Webhook$inboundSchema))
|
|
811
|
+
webhooks: z.array(z.lazy(() => Webhook$inboundSchema)),
|
|
623
812
|
});
|
|
624
813
|
|
|
625
814
|
/** @internal */
|
|
626
815
|
export type ListWebhooksEmbedded$Outbound = {
|
|
627
|
-
webhooks
|
|
816
|
+
webhooks: Array<Webhook$Outbound>;
|
|
628
817
|
};
|
|
629
818
|
|
|
630
819
|
/** @internal */
|
|
@@ -633,7 +822,7 @@ export const ListWebhooksEmbedded$outboundSchema: z.ZodType<
|
|
|
633
822
|
z.ZodTypeDef,
|
|
634
823
|
ListWebhooksEmbedded
|
|
635
824
|
> = z.object({
|
|
636
|
-
webhooks: z.array(z.lazy(() => Webhook$outboundSchema))
|
|
825
|
+
webhooks: z.array(z.lazy(() => Webhook$outboundSchema)),
|
|
637
826
|
});
|
|
638
827
|
|
|
639
828
|
/**
|
|
@@ -964,9 +1153,9 @@ export const ListWebhooksResponse$inboundSchema: z.ZodType<
|
|
|
964
1153
|
z.ZodTypeDef,
|
|
965
1154
|
unknown
|
|
966
1155
|
> = z.object({
|
|
967
|
-
count: z.number().int()
|
|
968
|
-
_embedded: z.lazy(() => ListWebhooksEmbedded$inboundSchema)
|
|
969
|
-
_links: z.lazy(() => ListWebhooksLinks$inboundSchema)
|
|
1156
|
+
count: z.number().int(),
|
|
1157
|
+
_embedded: z.lazy(() => ListWebhooksEmbedded$inboundSchema),
|
|
1158
|
+
_links: z.lazy(() => ListWebhooksLinks$inboundSchema),
|
|
970
1159
|
}).transform((v) => {
|
|
971
1160
|
return remap$(v, {
|
|
972
1161
|
"_embedded": "embedded",
|
|
@@ -976,9 +1165,9 @@ export const ListWebhooksResponse$inboundSchema: z.ZodType<
|
|
|
976
1165
|
|
|
977
1166
|
/** @internal */
|
|
978
1167
|
export type ListWebhooksResponse$Outbound = {
|
|
979
|
-
count
|
|
980
|
-
_embedded
|
|
981
|
-
_links
|
|
1168
|
+
count: number;
|
|
1169
|
+
_embedded: ListWebhooksEmbedded$Outbound;
|
|
1170
|
+
_links: ListWebhooksLinks$Outbound;
|
|
982
1171
|
};
|
|
983
1172
|
|
|
984
1173
|
/** @internal */
|
|
@@ -987,9 +1176,9 @@ export const ListWebhooksResponse$outboundSchema: z.ZodType<
|
|
|
987
1176
|
z.ZodTypeDef,
|
|
988
1177
|
ListWebhooksResponse
|
|
989
1178
|
> = z.object({
|
|
990
|
-
count: z.number().int()
|
|
991
|
-
embedded: z.lazy(() => ListWebhooksEmbedded$outboundSchema)
|
|
992
|
-
links: z.lazy(() => ListWebhooksLinks$outboundSchema)
|
|
1179
|
+
count: z.number().int(),
|
|
1180
|
+
embedded: z.lazy(() => ListWebhooksEmbedded$outboundSchema),
|
|
1181
|
+
links: z.lazy(() => ListWebhooksLinks$outboundSchema),
|
|
993
1182
|
}).transform((v) => {
|
|
994
1183
|
return remap$(v, {
|
|
995
1184
|
embedded: "_embedded",
|