@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
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Send a test ping to a webhook to verify it is configured correctly.
|
|
29
|
+
*/
|
|
30
|
+
export function webhooksPing(
|
|
31
|
+
client: MoovCore,
|
|
32
|
+
request: operations.PingWebhookRequest,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<
|
|
35
|
+
Result<
|
|
36
|
+
operations.PingWebhookResponse,
|
|
37
|
+
| MoovError
|
|
38
|
+
| ResponseValidationError
|
|
39
|
+
| ConnectionError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| InvalidRequestError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| SDKValidationError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
return new APIPromise($do(
|
|
48
|
+
client,
|
|
49
|
+
request,
|
|
50
|
+
options,
|
|
51
|
+
));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function $do(
|
|
55
|
+
client: MoovCore,
|
|
56
|
+
request: operations.PingWebhookRequest,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<
|
|
59
|
+
[
|
|
60
|
+
Result<
|
|
61
|
+
operations.PingWebhookResponse,
|
|
62
|
+
| MoovError
|
|
63
|
+
| ResponseValidationError
|
|
64
|
+
| ConnectionError
|
|
65
|
+
| RequestAbortedError
|
|
66
|
+
| RequestTimeoutError
|
|
67
|
+
| InvalidRequestError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| SDKValidationError
|
|
70
|
+
>,
|
|
71
|
+
APICall,
|
|
72
|
+
]
|
|
73
|
+
> {
|
|
74
|
+
const parsed = safeParse(
|
|
75
|
+
request,
|
|
76
|
+
(value) => operations.PingWebhookRequest$outboundSchema.parse(value),
|
|
77
|
+
"Input validation failed",
|
|
78
|
+
);
|
|
79
|
+
if (!parsed.ok) {
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
81
|
+
}
|
|
82
|
+
const payload = parsed.value;
|
|
83
|
+
const body = null;
|
|
84
|
+
|
|
85
|
+
const pathParams = {
|
|
86
|
+
webhookID: encodeSimple("webhookID", payload.webhookID, {
|
|
87
|
+
explode: false,
|
|
88
|
+
charEncoding: "percent",
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const path = pathToFunc("/webhooks/{webhookID}/ping")(pathParams);
|
|
93
|
+
|
|
94
|
+
const headers = new Headers(compactMap({
|
|
95
|
+
Accept: "application/json",
|
|
96
|
+
"X-Moov-Version": encodeSimple(
|
|
97
|
+
"X-Moov-Version",
|
|
98
|
+
client._options.xMoovVersion,
|
|
99
|
+
{ explode: false, charEncoding: "none" },
|
|
100
|
+
),
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
104
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
105
|
+
|
|
106
|
+
const context = {
|
|
107
|
+
options: client._options,
|
|
108
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
109
|
+
operationID: "pingWebhook",
|
|
110
|
+
oAuth2Scopes: null,
|
|
111
|
+
|
|
112
|
+
resolvedSecurity: requestSecurity,
|
|
113
|
+
|
|
114
|
+
securitySource: client._options.security,
|
|
115
|
+
retryConfig: options?.retries
|
|
116
|
+
|| client._options.retryConfig
|
|
117
|
+
|| { strategy: "none" },
|
|
118
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const requestRes = client._createRequest(context, {
|
|
122
|
+
security: requestSecurity,
|
|
123
|
+
method: "POST",
|
|
124
|
+
baseURL: options?.serverURL,
|
|
125
|
+
path: path,
|
|
126
|
+
headers: headers,
|
|
127
|
+
body: body,
|
|
128
|
+
userAgent: client._options.userAgent,
|
|
129
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
130
|
+
}, options);
|
|
131
|
+
if (!requestRes.ok) {
|
|
132
|
+
return [requestRes, { status: "invalid" }];
|
|
133
|
+
}
|
|
134
|
+
const req = requestRes.value;
|
|
135
|
+
|
|
136
|
+
const doResult = await client._do(req, {
|
|
137
|
+
context,
|
|
138
|
+
errorCodes: ["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
|
139
|
+
retryConfig: context.retryConfig,
|
|
140
|
+
retryCodes: context.retryCodes,
|
|
141
|
+
});
|
|
142
|
+
if (!doResult.ok) {
|
|
143
|
+
return [doResult, { status: "request-error", request: req }];
|
|
144
|
+
}
|
|
145
|
+
const response = doResult.value;
|
|
146
|
+
|
|
147
|
+
const responseFields = {
|
|
148
|
+
HttpMeta: { Response: response, Request: req },
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const [result] = await M.match<
|
|
152
|
+
operations.PingWebhookResponse,
|
|
153
|
+
| MoovError
|
|
154
|
+
| ResponseValidationError
|
|
155
|
+
| ConnectionError
|
|
156
|
+
| RequestAbortedError
|
|
157
|
+
| RequestTimeoutError
|
|
158
|
+
| InvalidRequestError
|
|
159
|
+
| UnexpectedClientError
|
|
160
|
+
| SDKValidationError
|
|
161
|
+
>(
|
|
162
|
+
M.json(200, operations.PingWebhookResponse$inboundSchema, {
|
|
163
|
+
hdrs: true,
|
|
164
|
+
key: "Result",
|
|
165
|
+
}),
|
|
166
|
+
M.fail([401, 403, 404, 429]),
|
|
167
|
+
M.fail([500, 504]),
|
|
168
|
+
M.fail("4XX"),
|
|
169
|
+
M.fail("5XX"),
|
|
170
|
+
)(response, req, { extraFields: responseFields });
|
|
171
|
+
if (!result.ok) {
|
|
172
|
+
return [result, { status: "complete", request: req, response }];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return [result, { status: "complete", request: req, response }];
|
|
176
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Update an existing webhook.
|
|
30
|
+
*/
|
|
31
|
+
export function webhooksUpdate(
|
|
32
|
+
client: MoovCore,
|
|
33
|
+
request: operations.UpdateWebhookRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
operations.UpdateWebhookResponse,
|
|
38
|
+
| errors.GenericError
|
|
39
|
+
| errors.UpdateWebhookValidationError
|
|
40
|
+
| MoovError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: MoovCore,
|
|
59
|
+
request: operations.UpdateWebhookRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.UpdateWebhookResponse,
|
|
65
|
+
| errors.GenericError
|
|
66
|
+
| errors.UpdateWebhookValidationError
|
|
67
|
+
| MoovError
|
|
68
|
+
| ResponseValidationError
|
|
69
|
+
| ConnectionError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| InvalidRequestError
|
|
73
|
+
| UnexpectedClientError
|
|
74
|
+
| SDKValidationError
|
|
75
|
+
>,
|
|
76
|
+
APICall,
|
|
77
|
+
]
|
|
78
|
+
> {
|
|
79
|
+
const parsed = safeParse(
|
|
80
|
+
request,
|
|
81
|
+
(value) => operations.UpdateWebhookRequest$outboundSchema.parse(value),
|
|
82
|
+
"Input validation failed",
|
|
83
|
+
);
|
|
84
|
+
if (!parsed.ok) {
|
|
85
|
+
return [parsed, { status: "invalid" }];
|
|
86
|
+
}
|
|
87
|
+
const payload = parsed.value;
|
|
88
|
+
const body = encodeJSON("body", payload.UpdateWebhook, { explode: true });
|
|
89
|
+
|
|
90
|
+
const pathParams = {
|
|
91
|
+
webhookID: encodeSimple("webhookID", payload.webhookID, {
|
|
92
|
+
explode: false,
|
|
93
|
+
charEncoding: "percent",
|
|
94
|
+
}),
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const path = pathToFunc("/webhooks/{webhookID}")(pathParams);
|
|
98
|
+
|
|
99
|
+
const headers = new Headers(compactMap({
|
|
100
|
+
"Content-Type": "application/json",
|
|
101
|
+
Accept: "application/json",
|
|
102
|
+
"X-Moov-Version": encodeSimple(
|
|
103
|
+
"X-Moov-Version",
|
|
104
|
+
client._options.xMoovVersion,
|
|
105
|
+
{ explode: false, charEncoding: "none" },
|
|
106
|
+
),
|
|
107
|
+
}));
|
|
108
|
+
|
|
109
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
110
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
111
|
+
|
|
112
|
+
const context = {
|
|
113
|
+
options: client._options,
|
|
114
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
115
|
+
operationID: "updateWebhook",
|
|
116
|
+
oAuth2Scopes: null,
|
|
117
|
+
|
|
118
|
+
resolvedSecurity: requestSecurity,
|
|
119
|
+
|
|
120
|
+
securitySource: client._options.security,
|
|
121
|
+
retryConfig: options?.retries
|
|
122
|
+
|| client._options.retryConfig
|
|
123
|
+
|| { strategy: "none" },
|
|
124
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const requestRes = client._createRequest(context, {
|
|
128
|
+
security: requestSecurity,
|
|
129
|
+
method: "PUT",
|
|
130
|
+
baseURL: options?.serverURL,
|
|
131
|
+
path: path,
|
|
132
|
+
headers: headers,
|
|
133
|
+
body: body,
|
|
134
|
+
userAgent: client._options.userAgent,
|
|
135
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
136
|
+
}, options);
|
|
137
|
+
if (!requestRes.ok) {
|
|
138
|
+
return [requestRes, { status: "invalid" }];
|
|
139
|
+
}
|
|
140
|
+
const req = requestRes.value;
|
|
141
|
+
|
|
142
|
+
const doResult = await client._do(req, {
|
|
143
|
+
context,
|
|
144
|
+
errorCodes: [
|
|
145
|
+
"400",
|
|
146
|
+
"401",
|
|
147
|
+
"403",
|
|
148
|
+
"404",
|
|
149
|
+
"409",
|
|
150
|
+
"422",
|
|
151
|
+
"429",
|
|
152
|
+
"4XX",
|
|
153
|
+
"500",
|
|
154
|
+
"504",
|
|
155
|
+
"5XX",
|
|
156
|
+
],
|
|
157
|
+
retryConfig: context.retryConfig,
|
|
158
|
+
retryCodes: context.retryCodes,
|
|
159
|
+
});
|
|
160
|
+
if (!doResult.ok) {
|
|
161
|
+
return [doResult, { status: "request-error", request: req }];
|
|
162
|
+
}
|
|
163
|
+
const response = doResult.value;
|
|
164
|
+
|
|
165
|
+
const responseFields = {
|
|
166
|
+
HttpMeta: { Response: response, Request: req },
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const [result] = await M.match<
|
|
170
|
+
operations.UpdateWebhookResponse,
|
|
171
|
+
| errors.GenericError
|
|
172
|
+
| errors.UpdateWebhookValidationError
|
|
173
|
+
| MoovError
|
|
174
|
+
| ResponseValidationError
|
|
175
|
+
| ConnectionError
|
|
176
|
+
| RequestAbortedError
|
|
177
|
+
| RequestTimeoutError
|
|
178
|
+
| InvalidRequestError
|
|
179
|
+
| UnexpectedClientError
|
|
180
|
+
| SDKValidationError
|
|
181
|
+
>(
|
|
182
|
+
M.json(200, operations.UpdateWebhookResponse$inboundSchema, {
|
|
183
|
+
hdrs: true,
|
|
184
|
+
key: "Result",
|
|
185
|
+
}),
|
|
186
|
+
M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }),
|
|
187
|
+
M.jsonErr(422, errors.UpdateWebhookValidationError$inboundSchema, {
|
|
188
|
+
hdrs: true,
|
|
189
|
+
}),
|
|
190
|
+
M.fail([401, 403, 404, 429]),
|
|
191
|
+
M.fail([500, 504]),
|
|
192
|
+
M.fail("4XX"),
|
|
193
|
+
M.fail("5XX"),
|
|
194
|
+
)(response, req, { extraFields: responseFields });
|
|
195
|
+
if (!result.ok) {
|
|
196
|
+
return [result, { status: "complete", request: req, response }];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return [result, { status: "complete", request: req, response }];
|
|
200
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -73,7 +73,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
73
73
|
export const SDK_METADATA = {
|
|
74
74
|
language: "typescript",
|
|
75
75
|
openapiDocVersion: "latest",
|
|
76
|
-
sdkVersion: "0.22.
|
|
77
|
-
genVersion: "2.
|
|
78
|
-
userAgent: "speakeasy-sdk/typescript 0.22.
|
|
76
|
+
sdkVersion: "0.22.13",
|
|
77
|
+
genVersion: "2.792.0",
|
|
78
|
+
userAgent: "speakeasy-sdk/typescript 0.22.13 2.792.0 latest @moovio/sdk",
|
|
79
79
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -104,7 +104,9 @@ import { tool$industriesList } from "./tools/industriesList.js";
|
|
|
104
104
|
import { tool$institutionsSearch } from "./tools/institutionsSearch.js";
|
|
105
105
|
import { tool$institutionsSearchInstitutions } from "./tools/institutionsSearchInstitutions.js";
|
|
106
106
|
import { tool$invoicesCreateInvoice } from "./tools/invoicesCreateInvoice.js";
|
|
107
|
+
import { tool$invoicesCreateInvoicePayment } from "./tools/invoicesCreateInvoicePayment.js";
|
|
107
108
|
import { tool$invoicesGetInvoice } from "./tools/invoicesGetInvoice.js";
|
|
109
|
+
import { tool$invoicesListInvoicePayments } from "./tools/invoicesListInvoicePayments.js";
|
|
108
110
|
import { tool$invoicesListInvoices } from "./tools/invoicesListInvoices.js";
|
|
109
111
|
import { tool$invoicesUpdateInvoice } from "./tools/invoicesUpdateInvoice.js";
|
|
110
112
|
import { tool$issuingTransactionsGet } from "./tools/issuingTransactionsGet.js";
|
|
@@ -181,6 +183,14 @@ import { tool$walletsList } from "./tools/walletsList.js";
|
|
|
181
183
|
import { tool$walletsUpdate } from "./tools/walletsUpdate.js";
|
|
182
184
|
import { tool$walletTransactionsGet } from "./tools/walletTransactionsGet.js";
|
|
183
185
|
import { tool$walletTransactionsList } from "./tools/walletTransactionsList.js";
|
|
186
|
+
import { tool$webhooksCreate } from "./tools/webhooksCreate.js";
|
|
187
|
+
import { tool$webhooksDisable } from "./tools/webhooksDisable.js";
|
|
188
|
+
import { tool$webhooksGet } from "./tools/webhooksGet.js";
|
|
189
|
+
import { tool$webhooksGetSecret } from "./tools/webhooksGetSecret.js";
|
|
190
|
+
import { tool$webhooksList } from "./tools/webhooksList.js";
|
|
191
|
+
import { tool$webhooksListEventTypes } from "./tools/webhooksListEventTypes.js";
|
|
192
|
+
import { tool$webhooksPing } from "./tools/webhooksPing.js";
|
|
193
|
+
import { tool$webhooksUpdate } from "./tools/webhooksUpdate.js";
|
|
184
194
|
|
|
185
195
|
export function createMCPServer(deps: {
|
|
186
196
|
logger: ConsoleLogger;
|
|
@@ -193,7 +203,7 @@ export function createMCPServer(deps: {
|
|
|
193
203
|
}) {
|
|
194
204
|
const server = new McpServer({
|
|
195
205
|
name: "Moov",
|
|
196
|
-
version: "0.22.
|
|
206
|
+
version: "0.22.13",
|
|
197
207
|
});
|
|
198
208
|
|
|
199
209
|
const client = new MoovCore({
|
|
@@ -299,6 +309,8 @@ export function createMCPServer(deps: {
|
|
|
299
309
|
tool(tool$invoicesListInvoices);
|
|
300
310
|
tool(tool$invoicesGetInvoice);
|
|
301
311
|
tool(tool$invoicesUpdateInvoice);
|
|
312
|
+
tool(tool$invoicesCreateInvoicePayment);
|
|
313
|
+
tool(tool$invoicesListInvoicePayments);
|
|
302
314
|
tool(tool$paymentLinksCreate);
|
|
303
315
|
tool(tool$paymentLinksList);
|
|
304
316
|
tool(tool$paymentLinksGet);
|
|
@@ -365,6 +377,14 @@ export function createMCPServer(deps: {
|
|
|
365
377
|
tool(tool$endToEndEncryptionGenerateKey);
|
|
366
378
|
tool(tool$enrichedAddressGet);
|
|
367
379
|
tool(tool$enrichedProfileGet);
|
|
380
|
+
tool(tool$webhooksListEventTypes);
|
|
381
|
+
tool(tool$webhooksList);
|
|
382
|
+
tool(tool$webhooksCreate);
|
|
383
|
+
tool(tool$webhooksGet);
|
|
384
|
+
tool(tool$webhooksUpdate);
|
|
385
|
+
tool(tool$webhooksDisable);
|
|
386
|
+
tool(tool$webhooksPing);
|
|
387
|
+
tool(tool$webhooksGetSecret);
|
|
368
388
|
tool(tool$industriesList);
|
|
369
389
|
tool(tool$institutionsSearchInstitutions);
|
|
370
390
|
tool(tool$institutionsSearch);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { invoicesCreateInvoicePayment } from "../../funcs/invoicesCreateInvoicePayment.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CreateInvoicePaymentRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$invoicesCreateInvoicePayment: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "invoices-create-invoice-payment",
|
|
15
|
+
description:
|
|
16
|
+
`Creates a payment resource to represent that an invoice was paid outside of the Moov platform.
|
|
17
|
+
If a payment link was created for the invoice, the corresponding payment link is canceled, but a receipt is still sent.
|
|
18
|
+
|
|
19
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
20
|
+
you'll need to specify the \`/accounts/{accountID}/invoices.write\` scope.`,
|
|
21
|
+
args,
|
|
22
|
+
tool: async (client, args, ctx) => {
|
|
23
|
+
const [result, apiCall] = await invoicesCreateInvoicePayment(
|
|
24
|
+
client,
|
|
25
|
+
args.request,
|
|
26
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
27
|
+
).$inspect();
|
|
28
|
+
|
|
29
|
+
if (!result.ok) {
|
|
30
|
+
return {
|
|
31
|
+
content: [{ type: "text", text: result.error.message }],
|
|
32
|
+
isError: true,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const value = result.value.result;
|
|
37
|
+
|
|
38
|
+
return formatResult(value, apiCall);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { invoicesListInvoicePayments } from "../../funcs/invoicesListInvoicePayments.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListInvoicePaymentsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$invoicesListInvoicePayments: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "invoices-list-invoice-payments",
|
|
15
|
+
description: `List all the payments made towards an invoice.
|
|
16
|
+
|
|
17
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
18
|
+
you'll need to specify the \`/accounts/{accountID}/invoices.read\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await invoicesListInvoicePayments(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = result.value.result;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { webhooksCreate } from "../../funcs/webhooksCreate.js";
|
|
6
|
+
import * as components from "../../models/components/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: components.CreateWebhook$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$webhooksCreate: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "webhooks-create",
|
|
15
|
+
description: `Create a new webhook for the account.`,
|
|
16
|
+
args,
|
|
17
|
+
tool: async (client, args, ctx) => {
|
|
18
|
+
const [result, apiCall] = await webhooksCreate(
|
|
19
|
+
client,
|
|
20
|
+
args.request,
|
|
21
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
+
).$inspect();
|
|
23
|
+
|
|
24
|
+
if (!result.ok) {
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: "text", text: result.error.message }],
|
|
27
|
+
isError: true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const value = result.value.result;
|
|
32
|
+
|
|
33
|
+
return formatResult(value, apiCall);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { webhooksDisable } from "../../funcs/webhooksDisable.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.DisableWebhookRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$webhooksDisable: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "webhooks-disable",
|
|
15
|
+
description:
|
|
16
|
+
`Disable a webhook. Disabled webhooks will no longer receive events.`,
|
|
17
|
+
args,
|
|
18
|
+
tool: async (client, args, ctx) => {
|
|
19
|
+
const [result, apiCall] = await webhooksDisable(
|
|
20
|
+
client,
|
|
21
|
+
args.request,
|
|
22
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
23
|
+
).$inspect();
|
|
24
|
+
|
|
25
|
+
if (!result.ok) {
|
|
26
|
+
return {
|
|
27
|
+
content: [{ type: "text", text: result.error.message }],
|
|
28
|
+
isError: true,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return formatResult(void 0, apiCall);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { webhooksGet } from "../../funcs/webhooksGet.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetWebhookRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$webhooksGet: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "webhooks-get",
|
|
15
|
+
description: `Get details of a specific webhook.`,
|
|
16
|
+
args,
|
|
17
|
+
tool: async (client, args, ctx) => {
|
|
18
|
+
const [result, apiCall] = await webhooksGet(
|
|
19
|
+
client,
|
|
20
|
+
args.request,
|
|
21
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
+
).$inspect();
|
|
23
|
+
|
|
24
|
+
if (!result.ok) {
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: "text", text: result.error.message }],
|
|
27
|
+
isError: true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const value = result.value.result;
|
|
32
|
+
|
|
33
|
+
return formatResult(value, apiCall);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { webhooksGetSecret } from "../../funcs/webhooksGetSecret.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetWebhookSecretRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$webhooksGetSecret: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "webhooks-get-secret",
|
|
15
|
+
description: `Get the secret key for verifying webhook payloads.`,
|
|
16
|
+
args,
|
|
17
|
+
tool: async (client, args, ctx) => {
|
|
18
|
+
const [result, apiCall] = await webhooksGetSecret(
|
|
19
|
+
client,
|
|
20
|
+
args.request,
|
|
21
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
+
).$inspect();
|
|
23
|
+
|
|
24
|
+
if (!result.ok) {
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: "text", text: result.error.message }],
|
|
27
|
+
isError: true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const value = result.value.result;
|
|
32
|
+
|
|
33
|
+
return formatResult(value, apiCall);
|
|
34
|
+
},
|
|
35
|
+
};
|