@moovio/sdk 0.22.11 → 0.22.13
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/README.md +91 -51
- package/bin/mcp-server.js +2557 -621
- package/bin/mcp-server.js.map +59 -16
- package/examples/package-lock.json +1 -1
- package/funcs/invoicesCreateInvoicePayment.d.ts +19 -0
- package/funcs/invoicesCreateInvoicePayment.d.ts.map +1 -0
- package/funcs/invoicesCreateInvoicePayment.js +148 -0
- package/funcs/invoicesCreateInvoicePayment.js.map +1 -0
- package/funcs/invoicesListInvoicePayments.d.ts +17 -0
- package/funcs/invoicesListInvoicePayments.d.ts.map +1 -0
- package/funcs/invoicesListInvoicePayments.js +129 -0
- package/funcs/invoicesListInvoicePayments.js.map +1 -0
- package/funcs/webhooksCreate.d.ts +16 -0
- package/funcs/webhooksCreate.d.ts.map +1 -0
- package/funcs/webhooksCreate.js +133 -0
- package/funcs/webhooksCreate.js.map +1 -0
- package/funcs/webhooksDisable.d.ts +15 -0
- package/funcs/webhooksDisable.d.ts.map +1 -0
- package/funcs/webhooksDisable.js +133 -0
- package/funcs/webhooksDisable.js.map +1 -0
- package/funcs/webhooksGet.d.ts +14 -0
- package/funcs/webhooksGet.d.ts.map +1 -0
- package/funcs/webhooksGet.js +122 -0
- package/funcs/webhooksGet.js.map +1 -0
- package/funcs/webhooksGetSecret.d.ts +14 -0
- package/funcs/webhooksGetSecret.d.ts.map +1 -0
- package/funcs/webhooksGetSecret.js +122 -0
- package/funcs/webhooksGetSecret.js.map +1 -0
- package/funcs/webhooksList.d.ts +14 -0
- package/funcs/webhooksList.d.ts.map +1 -0
- package/funcs/webhooksList.js +108 -0
- package/funcs/webhooksList.js.map +1 -0
- package/funcs/webhooksListEventTypes.d.ts +14 -0
- package/funcs/webhooksListEventTypes.d.ts.map +1 -0
- package/funcs/webhooksListEventTypes.js +108 -0
- package/funcs/webhooksListEventTypes.js.map +1 -0
- package/funcs/webhooksPing.d.ts +14 -0
- package/funcs/webhooksPing.d.ts.map +1 -0
- package/funcs/webhooksPing.js +122 -0
- package/funcs/webhooksPing.js.map +1 -0
- package/funcs/webhooksUpdate.d.ts +15 -0
- package/funcs/webhooksUpdate.d.ts.map +1 -0
- package/funcs/webhooksUpdate.js +138 -0
- package/funcs/webhooksUpdate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +21 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/invoicesCreateInvoicePayment.d.ts +8 -0
- package/mcp-server/tools/invoicesCreateInvoicePayment.d.ts.map +1 -0
- package/mcp-server/tools/invoicesCreateInvoicePayment.js +66 -0
- package/mcp-server/tools/invoicesCreateInvoicePayment.js.map +1 -0
- package/mcp-server/tools/invoicesListInvoicePayments.d.ts +8 -0
- package/mcp-server/tools/invoicesListInvoicePayments.d.ts.map +1 -0
- package/mcp-server/tools/invoicesListInvoicePayments.js +65 -0
- package/mcp-server/tools/invoicesListInvoicePayments.js.map +1 -0
- package/mcp-server/tools/webhooksCreate.d.ts +8 -0
- package/mcp-server/tools/webhooksCreate.d.ts.map +1 -0
- package/mcp-server/tools/webhooksCreate.js +62 -0
- package/mcp-server/tools/webhooksCreate.js.map +1 -0
- package/mcp-server/tools/webhooksDisable.d.ts +8 -0
- package/mcp-server/tools/webhooksDisable.d.ts.map +1 -0
- package/mcp-server/tools/webhooksDisable.js +61 -0
- package/mcp-server/tools/webhooksDisable.js.map +1 -0
- package/mcp-server/tools/webhooksGet.d.ts +8 -0
- package/mcp-server/tools/webhooksGet.d.ts.map +1 -0
- package/mcp-server/tools/webhooksGet.js +62 -0
- package/mcp-server/tools/webhooksGet.js.map +1 -0
- package/mcp-server/tools/webhooksGetSecret.d.ts +8 -0
- package/mcp-server/tools/webhooksGetSecret.d.ts.map +1 -0
- package/mcp-server/tools/webhooksGetSecret.js +62 -0
- package/mcp-server/tools/webhooksGetSecret.js.map +1 -0
- package/mcp-server/tools/webhooksList.d.ts +8 -0
- package/mcp-server/tools/webhooksList.d.ts.map +1 -0
- package/mcp-server/tools/webhooksList.js +62 -0
- package/mcp-server/tools/webhooksList.js.map +1 -0
- package/mcp-server/tools/webhooksListEventTypes.d.ts +8 -0
- package/mcp-server/tools/webhooksListEventTypes.d.ts.map +1 -0
- package/mcp-server/tools/webhooksListEventTypes.js +62 -0
- package/mcp-server/tools/webhooksListEventTypes.js.map +1 -0
- package/mcp-server/tools/webhooksPing.d.ts +8 -0
- package/mcp-server/tools/webhooksPing.d.ts.map +1 -0
- package/mcp-server/tools/webhooksPing.js +62 -0
- package/mcp-server/tools/webhooksPing.js.map +1 -0
- package/mcp-server/tools/webhooksUpdate.d.ts +8 -0
- package/mcp-server/tools/webhooksUpdate.d.ts.map +1 -0
- package/mcp-server/tools/webhooksUpdate.js +62 -0
- package/mcp-server/tools/webhooksUpdate.js.map +1 -0
- package/models/components/achtransactiondetails.d.ts +3 -0
- package/models/components/achtransactiondetails.d.ts.map +1 -1
- package/models/components/achtransactiondetails.js +3 -0
- package/models/components/achtransactiondetails.js.map +1 -1
- package/models/components/createinvoicepayment.d.ts +21 -0
- package/models/components/createinvoicepayment.d.ts.map +1 -0
- package/models/components/createinvoicepayment.js +63 -0
- package/models/components/createinvoicepayment.js.map +1 -0
- package/models/components/createtransferachaddendarecord.d.ts +23 -0
- package/models/components/createtransferachaddendarecord.d.ts.map +1 -0
- package/models/components/createtransferachaddendarecord.js +58 -0
- package/models/components/createtransferachaddendarecord.js.map +1 -0
- package/models/components/createtransferdestinationach.d.ts +3 -0
- package/models/components/createtransferdestinationach.d.ts.map +1 -1
- package/models/components/createtransferdestinationach.js +3 -0
- package/models/components/createtransferdestinationach.js.map +1 -1
- package/models/components/createtransfersourceach.d.ts +3 -0
- package/models/components/createtransfersourceach.d.ts.map +1 -1
- package/models/components/createtransfersourceach.js +3 -0
- package/models/components/createtransfersourceach.js.map +1 -1
- package/models/components/createwebhook.d.ts +40 -0
- package/models/components/createwebhook.d.ts.map +1 -0
- package/models/components/createwebhook.js +66 -0
- package/models/components/createwebhook.js.map +1 -0
- package/models/components/eventtype.d.ts +33 -0
- package/models/components/eventtype.d.ts.map +1 -0
- package/models/components/eventtype.js +62 -0
- package/models/components/eventtype.js.map +1 -0
- package/models/components/index.d.ts +10 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +10 -0
- package/models/components/index.js.map +1 -1
- package/models/components/invoiceexternalpayment.d.ts +0 -11
- package/models/components/invoiceexternalpayment.d.ts.map +1 -1
- package/models/components/invoiceexternalpayment.js +1 -10
- package/models/components/invoiceexternalpayment.js.map +1 -1
- package/models/components/invoicepayment.d.ts +4 -2
- package/models/components/invoicepayment.d.ts.map +1 -1
- package/models/components/invoicepayment.js +4 -2
- package/models/components/invoicepayment.js.map +1 -1
- package/models/components/invoicetransferpayment.d.ts +0 -11
- package/models/components/invoicetransferpayment.d.ts.map +1 -1
- package/models/components/invoicetransferpayment.js +1 -11
- package/models/components/invoicetransferpayment.js.map +1 -1
- package/models/components/pingresponse.d.ts +38 -0
- package/models/components/pingresponse.d.ts.map +1 -0
- package/models/components/pingresponse.js +63 -0
- package/models/components/pingresponse.js.map +1 -0
- package/models/components/transferachaddendarecord.d.ts +28 -0
- package/models/components/transferachaddendarecord.d.ts.map +1 -0
- package/models/components/transferachaddendarecord.js +60 -0
- package/models/components/transferachaddendarecord.js.map +1 -0
- package/models/components/updatewebhook.d.ts +40 -0
- package/models/components/updatewebhook.d.ts.map +1 -0
- package/models/components/updatewebhook.js +66 -0
- package/models/components/updatewebhook.js.map +1 -0
- package/models/components/webhook.d.ts +60 -0
- package/models/components/webhook.d.ts.map +1 -0
- package/models/components/webhook.js +74 -0
- package/models/components/webhook.js.map +1 -0
- package/models/components/webhooksecret.d.ts +23 -0
- package/models/components/webhooksecret.d.ts.map +1 -0
- package/models/components/webhooksecret.js +58 -0
- package/models/components/webhooksecret.js.map +1 -0
- package/models/components/webhookstatus.d.ts +18 -0
- package/models/components/webhookstatus.d.ts.map +1 -0
- package/models/components/webhookstatus.js +52 -0
- package/models/components/webhookstatus.js.map +1 -0
- package/models/errors/createinvoicepaymenterror.d.ts +30 -0
- package/models/errors/createinvoicepaymenterror.d.ts.map +1 -0
- package/models/errors/createinvoicepaymenterror.js +83 -0
- package/models/errors/createinvoicepaymenterror.js.map +1 -0
- package/models/errors/createwebhookvalidationerror.d.ts +57 -0
- package/models/errors/createwebhookvalidationerror.d.ts.map +1 -0
- package/models/errors/createwebhookvalidationerror.js +87 -0
- package/models/errors/createwebhookvalidationerror.js.map +1 -0
- package/models/errors/index.d.ts +3 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +3 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/updatewebhookvalidationerror.d.ts +57 -0
- package/models/errors/updatewebhookvalidationerror.d.ts.map +1 -0
- package/models/errors/updatewebhookvalidationerror.js +87 -0
- package/models/errors/updatewebhookvalidationerror.js.map +1 -0
- package/models/operations/createinvoicepayment.d.ts +68 -0
- package/models/operations/createinvoicepayment.d.ts.map +1 -0
- package/models/operations/createinvoicepayment.js +124 -0
- package/models/operations/createinvoicepayment.js.map +1 -0
- package/models/operations/createwebhook.d.ts +51 -0
- package/models/operations/createwebhook.d.ts.map +1 -0
- package/models/operations/createwebhook.js +96 -0
- package/models/operations/createwebhook.js.map +1 -0
- package/models/operations/disablewebhook.d.ts +61 -0
- package/models/operations/disablewebhook.d.ts.map +1 -0
- package/models/operations/disablewebhook.js +107 -0
- package/models/operations/disablewebhook.js.map +1 -0
- package/models/operations/getwebhook.d.ts +64 -0
- package/models/operations/getwebhook.d.ts.map +1 -0
- package/models/operations/getwebhook.js +112 -0
- package/models/operations/getwebhook.js.map +1 -0
- package/models/operations/getwebhooksecret.d.ts +64 -0
- package/models/operations/getwebhooksecret.d.ts.map +1 -0
- package/models/operations/getwebhooksecret.js +112 -0
- package/models/operations/getwebhooksecret.js.map +1 -0
- package/models/operations/index.d.ts +10 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +10 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listeventtypes.d.ts +60 -0
- package/models/operations/listeventtypes.d.ts.map +1 -0
- package/models/operations/listeventtypes.js +108 -0
- package/models/operations/listeventtypes.js.map +1 -0
- package/models/operations/listinvoicepayments.d.ts +66 -0
- package/models/operations/listinvoicepayments.d.ts.map +1 -0
- package/models/operations/listinvoicepayments.js +114 -0
- package/models/operations/listinvoicepayments.js.map +1 -0
- package/models/operations/listwebhooks.d.ts +60 -0
- package/models/operations/listwebhooks.d.ts.map +1 -0
- package/models/operations/listwebhooks.js +108 -0
- package/models/operations/listwebhooks.js.map +1 -0
- package/models/operations/pingwebhook.d.ts +64 -0
- package/models/operations/pingwebhook.d.ts.map +1 -0
- package/models/operations/pingwebhook.js +112 -0
- package/models/operations/pingwebhook.js.map +1 -0
- package/models/operations/updatewebhook.d.ts +66 -0
- package/models/operations/updatewebhook.d.ts.map +1 -0
- package/models/operations/updatewebhook.js +122 -0
- package/models/operations/updatewebhook.js.map +1 -0
- package/package.json +1 -1
- package/sdk/invoices.d.ts +15 -0
- package/sdk/invoices.d.ts.map +1 -1
- package/sdk/invoices.js +21 -0
- package/sdk/invoices.js.map +1 -1
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/webhooks.d.ts +38 -0
- package/sdk/webhooks.d.ts.map +1 -0
- package/sdk/webhooks.js +68 -0
- package/sdk/webhooks.js.map +1 -0
- package/src/funcs/invoicesCreateInvoicePayment.ts +213 -0
- package/src/funcs/invoicesListInvoicePayments.ts +186 -0
- package/src/funcs/webhooksCreate.ts +194 -0
- package/src/funcs/webhooksDisable.ts +191 -0
- package/src/funcs/webhooksGet.ts +176 -0
- package/src/funcs/webhooksGetSecret.ts +176 -0
- package/src/funcs/webhooksList.ts +156 -0
- package/src/funcs/webhooksListEventTypes.ts +156 -0
- package/src/funcs/webhooksPing.ts +176 -0
- package/src/funcs/webhooksUpdate.ts +200 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +21 -1
- package/src/mcp-server/tools/invoicesCreateInvoicePayment.ts +40 -0
- package/src/mcp-server/tools/invoicesListInvoicePayments.ts +38 -0
- package/src/mcp-server/tools/webhooksCreate.ts +35 -0
- package/src/mcp-server/tools/webhooksDisable.ts +34 -0
- package/src/mcp-server/tools/webhooksGet.ts +35 -0
- package/src/mcp-server/tools/webhooksGetSecret.ts +35 -0
- package/src/mcp-server/tools/webhooksList.ts +35 -0
- package/src/mcp-server/tools/webhooksListEventTypes.ts +35 -0
- package/src/mcp-server/tools/webhooksPing.ts +36 -0
- package/src/mcp-server/tools/webhooksUpdate.ts +35 -0
- package/src/models/components/achtransactiondetails.ts +10 -0
- package/src/models/components/createinvoicepayment.ts +60 -0
- package/src/models/components/createtransferachaddendarecord.ts +59 -0
- package/src/models/components/createtransferdestinationach.ts +10 -0
- package/src/models/components/createtransfersourceach.ts +10 -0
- package/src/models/components/createwebhook.ts +84 -0
- package/src/models/components/eventtype.ts +67 -0
- package/src/models/components/index.ts +10 -0
- package/src/models/components/invoiceexternalpayment.ts +0 -21
- package/src/models/components/invoicepayment.ts +8 -4
- package/src/models/components/invoicetransferpayment.ts +0 -17
- package/src/models/components/pingresponse.ts +73 -0
- package/src/models/components/transferachaddendarecord.ts +64 -0
- package/src/models/components/updatewebhook.ts +84 -0
- package/src/models/components/webhook.ts +115 -0
- package/src/models/components/webhooksecret.ts +53 -0
- package/src/models/components/webhookstatus.ts +27 -0
- package/src/models/errors/createinvoicepaymenterror.ts +78 -0
- package/src/models/errors/createwebhookvalidationerror.ts +108 -0
- package/src/models/errors/index.ts +3 -0
- package/src/models/errors/updatewebhookvalidationerror.ts +108 -0
- package/src/models/operations/createinvoicepayment.ts +197 -0
- package/src/models/operations/createwebhook.ts +132 -0
- package/src/models/operations/disablewebhook.ts +168 -0
- package/src/models/operations/getwebhook.ts +175 -0
- package/src/models/operations/getwebhooksecret.ts +175 -0
- package/src/models/operations/index.ts +10 -0
- package/src/models/operations/listeventtypes.ts +167 -0
- package/src/models/operations/listinvoicepayments.ts +181 -0
- package/src/models/operations/listwebhooks.ts +167 -0
- package/src/models/operations/pingwebhook.ts +175 -0
- package/src/models/operations/updatewebhook.ts +187 -0
- package/src/sdk/invoices.ts +37 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/webhooks.ts +130 -0
|
@@ -28,7 +28,8 @@ import {
|
|
|
28
28
|
* Payment made towards an invoice, will be either a transfer or an external payment.
|
|
29
29
|
*/
|
|
30
30
|
export type InvoicePayment = {
|
|
31
|
-
|
|
31
|
+
invoicePaymentID: string;
|
|
32
|
+
invoicePaymentType: InvoicePaymentType;
|
|
32
33
|
transfer?: InvoiceTransferPayment | undefined;
|
|
33
34
|
external?: InvoiceExternalPayment | undefined;
|
|
34
35
|
};
|
|
@@ -39,13 +40,15 @@ export const InvoicePayment$inboundSchema: z.ZodType<
|
|
|
39
40
|
z.ZodTypeDef,
|
|
40
41
|
unknown
|
|
41
42
|
> = z.object({
|
|
42
|
-
|
|
43
|
+
invoicePaymentID: z.string(),
|
|
44
|
+
invoicePaymentType: InvoicePaymentType$inboundSchema,
|
|
43
45
|
transfer: InvoiceTransferPayment$inboundSchema.optional(),
|
|
44
46
|
external: InvoiceExternalPayment$inboundSchema.optional(),
|
|
45
47
|
});
|
|
46
48
|
/** @internal */
|
|
47
49
|
export type InvoicePayment$Outbound = {
|
|
48
|
-
|
|
50
|
+
invoicePaymentID: string;
|
|
51
|
+
invoicePaymentType: string;
|
|
49
52
|
transfer?: InvoiceTransferPayment$Outbound | undefined;
|
|
50
53
|
external?: InvoiceExternalPayment$Outbound | undefined;
|
|
51
54
|
};
|
|
@@ -56,7 +59,8 @@ export const InvoicePayment$outboundSchema: z.ZodType<
|
|
|
56
59
|
z.ZodTypeDef,
|
|
57
60
|
InvoicePayment
|
|
58
61
|
> = z.object({
|
|
59
|
-
|
|
62
|
+
invoicePaymentID: z.string(),
|
|
63
|
+
invoicePaymentType: InvoicePaymentType$outboundSchema,
|
|
60
64
|
transfer: InvoiceTransferPayment$outboundSchema.optional(),
|
|
61
65
|
external: InvoiceExternalPayment$outboundSchema.optional(),
|
|
62
66
|
});
|
|
@@ -4,39 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
9
|
|
|
11
|
-
export const PaymentType = {
|
|
12
|
-
Transfer: "transfer",
|
|
13
|
-
} as const;
|
|
14
|
-
export type PaymentType = ClosedEnum<typeof PaymentType>;
|
|
15
|
-
|
|
16
10
|
export type InvoiceTransferPayment = {
|
|
17
|
-
paymentType: PaymentType;
|
|
18
11
|
transferID: string;
|
|
19
12
|
};
|
|
20
13
|
|
|
21
|
-
/** @internal */
|
|
22
|
-
export const PaymentType$inboundSchema: z.ZodNativeEnum<typeof PaymentType> = z
|
|
23
|
-
.nativeEnum(PaymentType);
|
|
24
|
-
/** @internal */
|
|
25
|
-
export const PaymentType$outboundSchema: z.ZodNativeEnum<typeof PaymentType> =
|
|
26
|
-
PaymentType$inboundSchema;
|
|
27
|
-
|
|
28
14
|
/** @internal */
|
|
29
15
|
export const InvoiceTransferPayment$inboundSchema: z.ZodType<
|
|
30
16
|
InvoiceTransferPayment,
|
|
31
17
|
z.ZodTypeDef,
|
|
32
18
|
unknown
|
|
33
19
|
> = z.object({
|
|
34
|
-
paymentType: PaymentType$inboundSchema,
|
|
35
20
|
transferID: z.string(),
|
|
36
21
|
});
|
|
37
22
|
/** @internal */
|
|
38
23
|
export type InvoiceTransferPayment$Outbound = {
|
|
39
|
-
paymentType: string;
|
|
40
24
|
transferID: string;
|
|
41
25
|
};
|
|
42
26
|
|
|
@@ -46,7 +30,6 @@ export const InvoiceTransferPayment$outboundSchema: z.ZodType<
|
|
|
46
30
|
z.ZodTypeDef,
|
|
47
31
|
InvoiceTransferPayment
|
|
48
32
|
> = z.object({
|
|
49
|
-
paymentType: PaymentType$outboundSchema,
|
|
50
33
|
transferID: z.string(),
|
|
51
34
|
});
|
|
52
35
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
Webhook,
|
|
11
|
+
Webhook$inboundSchema,
|
|
12
|
+
Webhook$Outbound,
|
|
13
|
+
Webhook$outboundSchema,
|
|
14
|
+
} from "./webhook.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Response from pinging a webhook.
|
|
18
|
+
*/
|
|
19
|
+
export type PingResponse = {
|
|
20
|
+
/**
|
|
21
|
+
* The webhook that was pinged.
|
|
22
|
+
*/
|
|
23
|
+
webhook: Webhook;
|
|
24
|
+
/**
|
|
25
|
+
* The request body sent to the target URL. It will contain an event type of `event.test` and an empty (null) data payload.
|
|
26
|
+
*/
|
|
27
|
+
requestBodySent: { [k: string]: any };
|
|
28
|
+
/**
|
|
29
|
+
* The response status code after sending a ping event to the URL.
|
|
30
|
+
*/
|
|
31
|
+
responseStatusCode: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const PingResponse$inboundSchema: z.ZodType<
|
|
36
|
+
PingResponse,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
unknown
|
|
39
|
+
> = z.object({
|
|
40
|
+
webhook: Webhook$inboundSchema,
|
|
41
|
+
requestBodySent: z.record(z.any()),
|
|
42
|
+
responseStatusCode: z.number().int(),
|
|
43
|
+
});
|
|
44
|
+
/** @internal */
|
|
45
|
+
export type PingResponse$Outbound = {
|
|
46
|
+
webhook: Webhook$Outbound;
|
|
47
|
+
requestBodySent: { [k: string]: any };
|
|
48
|
+
responseStatusCode: number;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const PingResponse$outboundSchema: z.ZodType<
|
|
53
|
+
PingResponse$Outbound,
|
|
54
|
+
z.ZodTypeDef,
|
|
55
|
+
PingResponse
|
|
56
|
+
> = z.object({
|
|
57
|
+
webhook: Webhook$outboundSchema,
|
|
58
|
+
requestBodySent: z.record(z.any()),
|
|
59
|
+
responseStatusCode: z.number().int(),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export function pingResponseToJSON(pingResponse: PingResponse): string {
|
|
63
|
+
return JSON.stringify(PingResponse$outboundSchema.parse(pingResponse));
|
|
64
|
+
}
|
|
65
|
+
export function pingResponseFromJSON(
|
|
66
|
+
jsonString: string,
|
|
67
|
+
): SafeParseResult<PingResponse, SDKValidationError> {
|
|
68
|
+
return safeParse(
|
|
69
|
+
jsonString,
|
|
70
|
+
(x) => PingResponse$inboundSchema.parse(JSON.parse(x)),
|
|
71
|
+
`Failed to parse 'PingResponse' from JSON`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An addenda record which was added to an ACH transfer
|
|
12
|
+
*/
|
|
13
|
+
export type TransferACHAddendaRecord = {
|
|
14
|
+
/**
|
|
15
|
+
* The ACH addenda record, which may have masked PII
|
|
16
|
+
*/
|
|
17
|
+
record: string;
|
|
18
|
+
/**
|
|
19
|
+
* Flag indicating whether or not this record has been masked
|
|
20
|
+
*/
|
|
21
|
+
isMasked: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const TransferACHAddendaRecord$inboundSchema: z.ZodType<
|
|
26
|
+
TransferACHAddendaRecord,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
record: z.string(),
|
|
31
|
+
isMasked: z.boolean(),
|
|
32
|
+
});
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type TransferACHAddendaRecord$Outbound = {
|
|
35
|
+
record: string;
|
|
36
|
+
isMasked: boolean;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const TransferACHAddendaRecord$outboundSchema: z.ZodType<
|
|
41
|
+
TransferACHAddendaRecord$Outbound,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
TransferACHAddendaRecord
|
|
44
|
+
> = z.object({
|
|
45
|
+
record: z.string(),
|
|
46
|
+
isMasked: z.boolean(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export function transferACHAddendaRecordToJSON(
|
|
50
|
+
transferACHAddendaRecord: TransferACHAddendaRecord,
|
|
51
|
+
): string {
|
|
52
|
+
return JSON.stringify(
|
|
53
|
+
TransferACHAddendaRecord$outboundSchema.parse(transferACHAddendaRecord),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
export function transferACHAddendaRecordFromJSON(
|
|
57
|
+
jsonString: string,
|
|
58
|
+
): SafeParseResult<TransferACHAddendaRecord, SDKValidationError> {
|
|
59
|
+
return safeParse(
|
|
60
|
+
jsonString,
|
|
61
|
+
(x) => TransferACHAddendaRecord$inboundSchema.parse(JSON.parse(x)),
|
|
62
|
+
`Failed to parse 'TransferACHAddendaRecord' from JSON`,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
WebhookEventType,
|
|
11
|
+
WebhookEventType$inboundSchema,
|
|
12
|
+
WebhookEventType$outboundSchema,
|
|
13
|
+
} from "./webhookeventtype.js";
|
|
14
|
+
import {
|
|
15
|
+
WebhookStatus,
|
|
16
|
+
WebhookStatus$inboundSchema,
|
|
17
|
+
WebhookStatus$outboundSchema,
|
|
18
|
+
} from "./webhookstatus.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Request body for updating an existing webhook.
|
|
22
|
+
*/
|
|
23
|
+
export type UpdateWebhook = {
|
|
24
|
+
/**
|
|
25
|
+
* The URL where webhook events will be sent.
|
|
26
|
+
*/
|
|
27
|
+
url: string;
|
|
28
|
+
/**
|
|
29
|
+
* The status of the webhook.
|
|
30
|
+
*/
|
|
31
|
+
status: WebhookStatus;
|
|
32
|
+
/**
|
|
33
|
+
* The list of event types this webhook should subscribe to.
|
|
34
|
+
*/
|
|
35
|
+
eventTypes: Array<WebhookEventType>;
|
|
36
|
+
/**
|
|
37
|
+
* A description of the webhook for reference. Can be an empty string.
|
|
38
|
+
*/
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const UpdateWebhook$inboundSchema: z.ZodType<
|
|
44
|
+
UpdateWebhook,
|
|
45
|
+
z.ZodTypeDef,
|
|
46
|
+
unknown
|
|
47
|
+
> = z.object({
|
|
48
|
+
url: z.string(),
|
|
49
|
+
status: WebhookStatus$inboundSchema,
|
|
50
|
+
eventTypes: z.array(WebhookEventType$inboundSchema),
|
|
51
|
+
description: z.string(),
|
|
52
|
+
});
|
|
53
|
+
/** @internal */
|
|
54
|
+
export type UpdateWebhook$Outbound = {
|
|
55
|
+
url: string;
|
|
56
|
+
status: string;
|
|
57
|
+
eventTypes: Array<string>;
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const UpdateWebhook$outboundSchema: z.ZodType<
|
|
63
|
+
UpdateWebhook$Outbound,
|
|
64
|
+
z.ZodTypeDef,
|
|
65
|
+
UpdateWebhook
|
|
66
|
+
> = z.object({
|
|
67
|
+
url: z.string(),
|
|
68
|
+
status: WebhookStatus$outboundSchema,
|
|
69
|
+
eventTypes: z.array(WebhookEventType$outboundSchema),
|
|
70
|
+
description: z.string(),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export function updateWebhookToJSON(updateWebhook: UpdateWebhook): string {
|
|
74
|
+
return JSON.stringify(UpdateWebhook$outboundSchema.parse(updateWebhook));
|
|
75
|
+
}
|
|
76
|
+
export function updateWebhookFromJSON(
|
|
77
|
+
jsonString: string,
|
|
78
|
+
): SafeParseResult<UpdateWebhook, SDKValidationError> {
|
|
79
|
+
return safeParse(
|
|
80
|
+
jsonString,
|
|
81
|
+
(x) => UpdateWebhook$inboundSchema.parse(JSON.parse(x)),
|
|
82
|
+
`Failed to parse 'UpdateWebhook' from JSON`,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
WebhookEventType,
|
|
11
|
+
WebhookEventType$inboundSchema,
|
|
12
|
+
WebhookEventType$outboundSchema,
|
|
13
|
+
} from "./webhookeventtype.js";
|
|
14
|
+
import {
|
|
15
|
+
WebhookStatus,
|
|
16
|
+
WebhookStatus$inboundSchema,
|
|
17
|
+
WebhookStatus$outboundSchema,
|
|
18
|
+
} from "./webhookstatus.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A configured webhook endpoint that receives event notifications.
|
|
22
|
+
*/
|
|
23
|
+
export type Webhook = {
|
|
24
|
+
/**
|
|
25
|
+
* Unique identifier for the webhook.
|
|
26
|
+
*/
|
|
27
|
+
webhookID: string;
|
|
28
|
+
/**
|
|
29
|
+
* The URL where webhook events will be sent.
|
|
30
|
+
*/
|
|
31
|
+
url: string;
|
|
32
|
+
/**
|
|
33
|
+
* The status of a webhook.
|
|
34
|
+
*/
|
|
35
|
+
status: WebhookStatus;
|
|
36
|
+
/**
|
|
37
|
+
* The list of event types this webhook is subscribed to.
|
|
38
|
+
*/
|
|
39
|
+
eventTypes: Array<WebhookEventType>;
|
|
40
|
+
/**
|
|
41
|
+
* A description of the webhook for reference.
|
|
42
|
+
*/
|
|
43
|
+
description: string;
|
|
44
|
+
/**
|
|
45
|
+
* Timestamp of when the webhook was created.
|
|
46
|
+
*/
|
|
47
|
+
createdOn: Date;
|
|
48
|
+
/**
|
|
49
|
+
* Timestamp of when the webhook was last updated.
|
|
50
|
+
*/
|
|
51
|
+
updatedOn: Date;
|
|
52
|
+
/**
|
|
53
|
+
* Timestamp of when the webhook last received an event.
|
|
54
|
+
*/
|
|
55
|
+
lastUsedOn?: Date | undefined;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const Webhook$inboundSchema: z.ZodType<Webhook, z.ZodTypeDef, unknown> =
|
|
60
|
+
z.object({
|
|
61
|
+
webhookID: z.string(),
|
|
62
|
+
url: z.string(),
|
|
63
|
+
status: WebhookStatus$inboundSchema,
|
|
64
|
+
eventTypes: z.array(WebhookEventType$inboundSchema),
|
|
65
|
+
description: z.string(),
|
|
66
|
+
createdOn: z.string().datetime({ offset: true }).transform(v =>
|
|
67
|
+
new Date(v)
|
|
68
|
+
),
|
|
69
|
+
updatedOn: z.string().datetime({ offset: true }).transform(v =>
|
|
70
|
+
new Date(v)
|
|
71
|
+
),
|
|
72
|
+
lastUsedOn: z.string().datetime({ offset: true }).transform(v =>
|
|
73
|
+
new Date(v)
|
|
74
|
+
).optional(),
|
|
75
|
+
});
|
|
76
|
+
/** @internal */
|
|
77
|
+
export type Webhook$Outbound = {
|
|
78
|
+
webhookID: string;
|
|
79
|
+
url: string;
|
|
80
|
+
status: string;
|
|
81
|
+
eventTypes: Array<string>;
|
|
82
|
+
description: string;
|
|
83
|
+
createdOn: string;
|
|
84
|
+
updatedOn: string;
|
|
85
|
+
lastUsedOn?: string | undefined;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export const Webhook$outboundSchema: z.ZodType<
|
|
90
|
+
Webhook$Outbound,
|
|
91
|
+
z.ZodTypeDef,
|
|
92
|
+
Webhook
|
|
93
|
+
> = z.object({
|
|
94
|
+
webhookID: z.string(),
|
|
95
|
+
url: z.string(),
|
|
96
|
+
status: WebhookStatus$outboundSchema,
|
|
97
|
+
eventTypes: z.array(WebhookEventType$outboundSchema),
|
|
98
|
+
description: z.string(),
|
|
99
|
+
createdOn: z.date().transform(v => v.toISOString()),
|
|
100
|
+
updatedOn: z.date().transform(v => v.toISOString()),
|
|
101
|
+
lastUsedOn: z.date().transform(v => v.toISOString()).optional(),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
export function webhookToJSON(webhook: Webhook): string {
|
|
105
|
+
return JSON.stringify(Webhook$outboundSchema.parse(webhook));
|
|
106
|
+
}
|
|
107
|
+
export function webhookFromJSON(
|
|
108
|
+
jsonString: string,
|
|
109
|
+
): SafeParseResult<Webhook, SDKValidationError> {
|
|
110
|
+
return safeParse(
|
|
111
|
+
jsonString,
|
|
112
|
+
(x) => Webhook$inboundSchema.parse(JSON.parse(x)),
|
|
113
|
+
`Failed to parse 'Webhook' from JSON`,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The secret used to verify webhook payloads.
|
|
12
|
+
*/
|
|
13
|
+
export type WebhookSecret = {
|
|
14
|
+
/**
|
|
15
|
+
* The secret key used to sign webhook payloads. Use this to verify the authenticity of incoming webhooks.
|
|
16
|
+
*/
|
|
17
|
+
secret: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const WebhookSecret$inboundSchema: z.ZodType<
|
|
22
|
+
WebhookSecret,
|
|
23
|
+
z.ZodTypeDef,
|
|
24
|
+
unknown
|
|
25
|
+
> = z.object({
|
|
26
|
+
secret: z.string(),
|
|
27
|
+
});
|
|
28
|
+
/** @internal */
|
|
29
|
+
export type WebhookSecret$Outbound = {
|
|
30
|
+
secret: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const WebhookSecret$outboundSchema: z.ZodType<
|
|
35
|
+
WebhookSecret$Outbound,
|
|
36
|
+
z.ZodTypeDef,
|
|
37
|
+
WebhookSecret
|
|
38
|
+
> = z.object({
|
|
39
|
+
secret: z.string(),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export function webhookSecretToJSON(webhookSecret: WebhookSecret): string {
|
|
43
|
+
return JSON.stringify(WebhookSecret$outboundSchema.parse(webhookSecret));
|
|
44
|
+
}
|
|
45
|
+
export function webhookSecretFromJSON(
|
|
46
|
+
jsonString: string,
|
|
47
|
+
): SafeParseResult<WebhookSecret, SDKValidationError> {
|
|
48
|
+
return safeParse(
|
|
49
|
+
jsonString,
|
|
50
|
+
(x) => WebhookSecret$inboundSchema.parse(JSON.parse(x)),
|
|
51
|
+
`Failed to parse 'WebhookSecret' from JSON`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The status of a webhook.
|
|
10
|
+
*/
|
|
11
|
+
export const WebhookStatus = {
|
|
12
|
+
Enabled: "enabled",
|
|
13
|
+
Disabled: "disabled",
|
|
14
|
+
} as const;
|
|
15
|
+
/**
|
|
16
|
+
* The status of a webhook.
|
|
17
|
+
*/
|
|
18
|
+
export type WebhookStatus = ClosedEnum<typeof WebhookStatus>;
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const WebhookStatus$inboundSchema: z.ZodNativeEnum<
|
|
22
|
+
typeof WebhookStatus
|
|
23
|
+
> = z.nativeEnum(WebhookStatus);
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const WebhookStatus$outboundSchema: z.ZodNativeEnum<
|
|
26
|
+
typeof WebhookStatus
|
|
27
|
+
> = WebhookStatus$inboundSchema;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { MoovError } from "./mooverror.js";
|
|
7
|
+
|
|
8
|
+
export type CreateInvoicePaymentErrorData = {
|
|
9
|
+
foreignID?: string | undefined;
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
paymentDate?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export class CreateInvoicePaymentError extends MoovError {
|
|
15
|
+
foreignID?: string | undefined;
|
|
16
|
+
description?: string | undefined;
|
|
17
|
+
paymentDate?: string | undefined;
|
|
18
|
+
|
|
19
|
+
/** The original data that was passed to this error instance. */
|
|
20
|
+
data$: CreateInvoicePaymentErrorData;
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
err: CreateInvoicePaymentErrorData,
|
|
24
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
25
|
+
) {
|
|
26
|
+
const message = "message" in err && typeof err.message === "string"
|
|
27
|
+
? err.message
|
|
28
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
29
|
+
super(message, httpMeta);
|
|
30
|
+
this.data$ = err;
|
|
31
|
+
if (err.foreignID != null) this.foreignID = err.foreignID;
|
|
32
|
+
if (err.description != null) this.description = err.description;
|
|
33
|
+
if (err.paymentDate != null) this.paymentDate = err.paymentDate;
|
|
34
|
+
|
|
35
|
+
this.name = "CreateInvoicePaymentError";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const CreateInvoicePaymentError$inboundSchema: z.ZodType<
|
|
41
|
+
CreateInvoicePaymentError,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
unknown
|
|
44
|
+
> = z.object({
|
|
45
|
+
foreignID: z.string().optional(),
|
|
46
|
+
description: z.string().optional(),
|
|
47
|
+
paymentDate: z.string().optional(),
|
|
48
|
+
request$: z.instanceof(Request),
|
|
49
|
+
response$: z.instanceof(Response),
|
|
50
|
+
body$: z.string(),
|
|
51
|
+
})
|
|
52
|
+
.transform((v) => {
|
|
53
|
+
return new CreateInvoicePaymentError(v, {
|
|
54
|
+
request: v.request$,
|
|
55
|
+
response: v.response$,
|
|
56
|
+
body: v.body$,
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export type CreateInvoicePaymentError$Outbound = {
|
|
62
|
+
foreignID?: string | undefined;
|
|
63
|
+
description?: string | undefined;
|
|
64
|
+
paymentDate?: string | undefined;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const CreateInvoicePaymentError$outboundSchema: z.ZodType<
|
|
69
|
+
CreateInvoicePaymentError$Outbound,
|
|
70
|
+
z.ZodTypeDef,
|
|
71
|
+
CreateInvoicePaymentError
|
|
72
|
+
> = z.instanceof(CreateInvoicePaymentError)
|
|
73
|
+
.transform(v => v.data$)
|
|
74
|
+
.pipe(z.object({
|
|
75
|
+
foreignID: z.string().optional(),
|
|
76
|
+
description: z.string().optional(),
|
|
77
|
+
paymentDate: z.string().optional(),
|
|
78
|
+
}));
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { MoovError } from "./mooverror.js";
|
|
7
|
+
|
|
8
|
+
export type CreateWebhookValidationErrorData = {
|
|
9
|
+
/**
|
|
10
|
+
* Details about the URL validation error.
|
|
11
|
+
*/
|
|
12
|
+
url?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Details about the status validation error.
|
|
15
|
+
*/
|
|
16
|
+
status?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Details about the event types validation error.
|
|
19
|
+
*/
|
|
20
|
+
eventTypes?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Details about the description validation error.
|
|
23
|
+
*/
|
|
24
|
+
description?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export class CreateWebhookValidationError extends MoovError {
|
|
28
|
+
/**
|
|
29
|
+
* Details about the URL validation error.
|
|
30
|
+
*/
|
|
31
|
+
url?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Details about the status validation error.
|
|
34
|
+
*/
|
|
35
|
+
status?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Details about the event types validation error.
|
|
38
|
+
*/
|
|
39
|
+
eventTypes?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Details about the description validation error.
|
|
42
|
+
*/
|
|
43
|
+
description?: string | undefined;
|
|
44
|
+
|
|
45
|
+
/** The original data that was passed to this error instance. */
|
|
46
|
+
data$: CreateWebhookValidationErrorData;
|
|
47
|
+
|
|
48
|
+
constructor(
|
|
49
|
+
err: CreateWebhookValidationErrorData,
|
|
50
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
51
|
+
) {
|
|
52
|
+
const message = "message" in err && typeof err.message === "string"
|
|
53
|
+
? err.message
|
|
54
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
55
|
+
super(message, httpMeta);
|
|
56
|
+
this.data$ = err;
|
|
57
|
+
if (err.url != null) this.url = err.url;
|
|
58
|
+
if (err.status != null) this.status = err.status;
|
|
59
|
+
if (err.eventTypes != null) this.eventTypes = err.eventTypes;
|
|
60
|
+
if (err.description != null) this.description = err.description;
|
|
61
|
+
|
|
62
|
+
this.name = "CreateWebhookValidationError";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const CreateWebhookValidationError$inboundSchema: z.ZodType<
|
|
68
|
+
CreateWebhookValidationError,
|
|
69
|
+
z.ZodTypeDef,
|
|
70
|
+
unknown
|
|
71
|
+
> = z.object({
|
|
72
|
+
url: z.string().optional(),
|
|
73
|
+
status: z.string().optional(),
|
|
74
|
+
eventTypes: z.string().optional(),
|
|
75
|
+
description: z.string().optional(),
|
|
76
|
+
request$: z.instanceof(Request),
|
|
77
|
+
response$: z.instanceof(Response),
|
|
78
|
+
body$: z.string(),
|
|
79
|
+
})
|
|
80
|
+
.transform((v) => {
|
|
81
|
+
return new CreateWebhookValidationError(v, {
|
|
82
|
+
request: v.request$,
|
|
83
|
+
response: v.response$,
|
|
84
|
+
body: v.body$,
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export type CreateWebhookValidationError$Outbound = {
|
|
90
|
+
url?: string | undefined;
|
|
91
|
+
status?: string | undefined;
|
|
92
|
+
eventTypes?: string | undefined;
|
|
93
|
+
description?: string | undefined;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/** @internal */
|
|
97
|
+
export const CreateWebhookValidationError$outboundSchema: z.ZodType<
|
|
98
|
+
CreateWebhookValidationError$Outbound,
|
|
99
|
+
z.ZodTypeDef,
|
|
100
|
+
CreateWebhookValidationError
|
|
101
|
+
> = z.instanceof(CreateWebhookValidationError)
|
|
102
|
+
.transform(v => v.data$)
|
|
103
|
+
.pipe(z.object({
|
|
104
|
+
url: z.string().optional(),
|
|
105
|
+
status: z.string().optional(),
|
|
106
|
+
eventTypes: z.string().optional(),
|
|
107
|
+
description: z.string().optional(),
|
|
108
|
+
}));
|