@moovio/sdk 26.2.0 → 26.2.1
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 +72 -56
- package/bin/mcp-server.js +541 -229
- package/bin/mcp-server.js.map +29 -21
- package/funcs/cardIssuingUpdate.d.ts +1 -1
- package/funcs/cardIssuingUpdate.d.ts.map +1 -1
- package/funcs/cardIssuingUpdate.js +2 -1
- package/funcs/cardIssuingUpdate.js.map +1 -1
- package/funcs/disputesUploadEvidenceFile.js +4 -1
- package/funcs/disputesUploadEvidenceFile.js.map +1 -1
- package/funcs/filesUpload.js +4 -1
- package/funcs/filesUpload.js.map +1 -1
- package/funcs/imagesUpdate.d.ts.map +1 -1
- package/funcs/imagesUpdate.js +4 -1
- package/funcs/imagesUpdate.js.map +1 -1
- package/funcs/imagesUpload.d.ts.map +1 -1
- package/funcs/imagesUpload.js +4 -1
- package/funcs/imagesUpload.js.map +1 -1
- package/funcs/transfersBatchGetTransfers.d.ts +21 -0
- package/funcs/transfersBatchGetTransfers.d.ts.map +1 -0
- package/funcs/transfersBatchGetTransfers.js +131 -0
- package/funcs/transfersBatchGetTransfers.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/encodings.d.ts +1 -0
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +27 -5
- package/lib/encodings.js.map +1 -1
- package/lib/security.d.ts +1 -1
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +18 -7
- package/lib/security.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +3 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/applePayLinkToken.js +3 -3
- package/mcp-server/tools/cardIssuingUpdate.d.ts.map +1 -1
- package/mcp-server/tools/cardIssuingUpdate.js +2 -1
- package/mcp-server/tools/cardIssuingUpdate.js.map +1 -1
- package/mcp-server/tools/transfersBatchGetTransfers.d.ts +8 -0
- package/mcp-server/tools/transfersBatchGetTransfers.d.ts.map +1 -0
- package/mcp-server/tools/transfersBatchGetTransfers.js +69 -0
- package/mcp-server/tools/transfersBatchGetTransfers.js.map +1 -0
- package/models/components/batchgettransfersrequest.d.ts +20 -0
- package/models/components/batchgettransfersrequest.d.ts.map +1 -0
- package/models/components/batchgettransfersrequest.js +58 -0
- package/models/components/batchgettransfersrequest.js.map +1 -0
- package/models/components/index.d.ts +5 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -0
- package/models/components/index.js.map +1 -1
- package/models/components/instantbankfailurecode.d.ts +27 -0
- package/models/components/instantbankfailurecode.d.ts.map +1 -0
- package/models/components/instantbankfailurecode.js +61 -0
- package/models/components/instantbankfailurecode.js.map +1 -0
- package/models/components/instantbanknetwork.d.ts +18 -0
- package/models/components/instantbanknetwork.d.ts.map +1 -0
- package/models/components/instantbanknetwork.js +52 -0
- package/models/components/instantbanknetwork.js.map +1 -0
- package/models/components/instantbanktransactiondetails.d.ts +51 -0
- package/models/components/instantbanktransactiondetails.d.ts.map +1 -0
- package/models/components/instantbanktransactiondetails.js +80 -0
- package/models/components/instantbanktransactiondetails.js.map +1 -0
- package/models/components/instantbanktransactionstatus.d.ts +20 -0
- package/models/components/instantbanktransactionstatus.d.ts.map +1 -0
- package/models/components/instantbanktransactionstatus.js +54 -0
- package/models/components/instantbanktransactionstatus.js.map +1 -0
- package/models/components/transferdestination.d.ts +6 -0
- package/models/components/transferdestination.d.ts.map +1 -1
- package/models/components/transferdestination.js +3 -0
- package/models/components/transferdestination.js.map +1 -1
- package/models/components/webhookbillingstatementcreated.d.ts +2 -0
- package/models/components/webhookbillingstatementcreated.d.ts.map +1 -1
- package/models/components/webhookbillingstatementcreated.js +2 -0
- package/models/components/webhookbillingstatementcreated.js.map +1 -1
- package/models/components/webhookdata.d.ts +2 -2
- package/models/components/webhookdata.d.ts.map +1 -1
- package/models/components/webhookdata.js +2 -2
- package/models/components/webhookdata.js.map +1 -1
- package/models/operations/batchgettransfers.d.ts +43 -0
- package/models/operations/batchgettransfers.d.ts.map +1 -0
- package/models/operations/batchgettransfers.js +98 -0
- package/models/operations/batchgettransfers.js.map +1 -0
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/updateissuedcard.d.ts +2 -0
- package/models/operations/updateissuedcard.d.ts.map +1 -1
- package/models/operations/updateissuedcard.js +4 -0
- package/models/operations/updateissuedcard.js.map +1 -1
- package/package.json +1 -1
- package/sdk/cardissuing.d.ts +1 -1
- package/sdk/cardissuing.d.ts.map +1 -1
- package/sdk/transfers.d.ts +11 -0
- package/sdk/transfers.d.ts.map +1 -1
- package/sdk/transfers.js +14 -0
- package/sdk/transfers.js.map +1 -1
- package/src/funcs/cardIssuingUpdate.ts +5 -4
- package/src/funcs/disputesUploadEvidenceFile.ts +5 -2
- package/src/funcs/filesUpload.ts +5 -2
- package/src/funcs/imagesUpdate.ts +10 -2
- package/src/funcs/imagesUpload.ts +10 -2
- package/src/funcs/transfersBatchGetTransfers.ts +180 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +32 -4
- package/src/lib/security.ts +14 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/applePayLinkToken.ts +3 -3
- package/src/mcp-server/tools/cardIssuingUpdate.ts +3 -1
- package/src/mcp-server/tools/transfersBatchGetTransfers.ts +43 -0
- package/src/models/components/batchgettransfersrequest.ts +54 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/components/instantbankfailurecode.ts +36 -0
- package/src/models/components/instantbanknetwork.ts +27 -0
- package/src/models/components/instantbanktransactiondetails.ts +120 -0
- package/src/models/components/instantbanktransactionstatus.ts +31 -0
- package/src/models/components/transferdestination.ts +13 -0
- package/src/models/components/webhookbillingstatementcreated.ts +4 -0
- package/src/models/components/webhookdata.ts +6 -6
- package/src/models/operations/batchgettransfers.ts +122 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/updateissuedcard.ts +6 -0
- package/src/sdk/cardissuing.ts +1 -1
- package/src/sdk/transfers.ts +22 -0
package/src/lib/encodings.ts
CHANGED
|
@@ -479,6 +479,23 @@ export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited);
|
|
|
479
479
|
export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited);
|
|
480
480
|
export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
|
|
481
481
|
|
|
482
|
+
function isBlobLike(val: unknown): val is Blob {
|
|
483
|
+
if (val instanceof Blob) {
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const tag = val[Symbol.toStringTag];
|
|
492
|
+
if (tag !== "Blob" && tag !== "File") {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
return "stream" in val && typeof val.stream === "function";
|
|
497
|
+
}
|
|
498
|
+
|
|
482
499
|
export function appendForm(
|
|
483
500
|
fd: FormData,
|
|
484
501
|
key: string,
|
|
@@ -487,11 +504,22 @@ export function appendForm(
|
|
|
487
504
|
): void {
|
|
488
505
|
if (value == null) {
|
|
489
506
|
return;
|
|
490
|
-
} else if (value
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
507
|
+
} else if (isBlobLike(value)) {
|
|
508
|
+
if (fileName) {
|
|
509
|
+
fd.append(key, value as Blob, fileName);
|
|
510
|
+
} else {
|
|
511
|
+
fd.append(key, value as Blob);
|
|
512
|
+
}
|
|
494
513
|
} else {
|
|
495
514
|
fd.append(key, String(value));
|
|
496
515
|
}
|
|
497
516
|
}
|
|
517
|
+
|
|
518
|
+
export async function normalizeBlob(
|
|
519
|
+
value: Pick<Blob, "arrayBuffer" | "type">,
|
|
520
|
+
): Promise<Blob> {
|
|
521
|
+
if (value instanceof Blob) {
|
|
522
|
+
return value;
|
|
523
|
+
}
|
|
524
|
+
return new Blob([await value.arrayBuffer()], { type: value.type });
|
|
525
|
+
}
|
package/src/lib/security.ts
CHANGED
|
@@ -239,15 +239,27 @@ function applyBearer(
|
|
|
239
239
|
|
|
240
240
|
export function resolveGlobalSecurity(
|
|
241
241
|
security: Partial<components.Security> | null | undefined,
|
|
242
|
+
allowedFields?: number[],
|
|
242
243
|
): SecurityState | null {
|
|
243
|
-
|
|
244
|
+
let inputs: SecurityInput[][] = [
|
|
244
245
|
[
|
|
245
246
|
{
|
|
246
247
|
type: "http:basic",
|
|
247
248
|
value: { username: security?.username, password: security?.password },
|
|
248
249
|
},
|
|
249
250
|
],
|
|
250
|
-
|
|
251
|
+
];
|
|
252
|
+
|
|
253
|
+
if (allowedFields) {
|
|
254
|
+
inputs = allowedFields.map((i) => {
|
|
255
|
+
if (i < 0 || i >= inputs.length) {
|
|
256
|
+
throw new RangeError(`invalid allowedFields index ${i}`);
|
|
257
|
+
}
|
|
258
|
+
return inputs[i]!;
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return resolveSecurity(...inputs);
|
|
251
263
|
}
|
|
252
264
|
|
|
253
265
|
export async function extractSecurity<
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -156,6 +156,7 @@ import { tool$terminalApplicationsCreateVersion } from "./tools/terminalApplicat
|
|
|
156
156
|
import { tool$terminalApplicationsDelete } from "./tools/terminalApplicationsDelete.js";
|
|
157
157
|
import { tool$terminalApplicationsGet } from "./tools/terminalApplicationsGet.js";
|
|
158
158
|
import { tool$terminalApplicationsList } from "./tools/terminalApplicationsList.js";
|
|
159
|
+
import { tool$transfersBatchGetTransfers } from "./tools/transfersBatchGetTransfers.js";
|
|
159
160
|
import { tool$transfersCreate } from "./tools/transfersCreate.js";
|
|
160
161
|
import { tool$transfersCreateCancellation } from "./tools/transfersCreateCancellation.js";
|
|
161
162
|
import { tool$transfersCreateReversal } from "./tools/transfersCreateReversal.js";
|
|
@@ -195,7 +196,7 @@ export function createMCPServer(deps: {
|
|
|
195
196
|
}) {
|
|
196
197
|
const server = new McpServer({
|
|
197
198
|
name: "Moov",
|
|
198
|
-
version: "26.2.
|
|
199
|
+
version: "26.2.1",
|
|
199
200
|
});
|
|
200
201
|
|
|
201
202
|
const client = new MoovCore({
|
|
@@ -339,6 +340,7 @@ export function createMCPServer(deps: {
|
|
|
339
340
|
tool(tool$transfersGenerateOptions);
|
|
340
341
|
tool(tool$transfersCreate);
|
|
341
342
|
tool(tool$transfersList);
|
|
343
|
+
tool(tool$transfersBatchGetTransfers);
|
|
342
344
|
tool(tool$transfersGet);
|
|
343
345
|
tool(tool$transfersUpdate);
|
|
344
346
|
tool(tool$transfersCreateCancellation);
|
|
@@ -12,12 +12,12 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$applePayLinkToken: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "apple-pay-link-token",
|
|
15
|
-
description: `Connect an Apple Pay token to the specified account.
|
|
15
|
+
description: `Connect an Apple Pay token to the specified account.
|
|
16
16
|
|
|
17
|
-
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
|
17
|
+
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
|
18
18
|
The \`token\` data is defined by Apple Pay and should be passed through from Apple Pay's response unmodified.
|
|
19
19
|
|
|
20
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
20
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
21
21
|
you'll need to specify the \`/accounts/{accountID}/cards.write\` scope.`,
|
|
22
22
|
args,
|
|
23
23
|
tool: async (client, args, ctx) => {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transfersBatchGetTransfers } from "../../funcs/transfersBatchGetTransfers.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.BatchGetTransfersRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$transfersBatchGetTransfers: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "transfers-batch-get-transfers",
|
|
15
|
+
description:
|
|
16
|
+
`Retrieve transfer details for multiple transfers in one request. The response is a map from each
|
|
17
|
+
requested transfer ID to its full transfer details when available; IDs that are not found or not
|
|
18
|
+
accessible under this account are omitted from the map.
|
|
19
|
+
|
|
20
|
+
Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
|
21
|
+
|
|
22
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
23
|
+
you'll need to specify the \`/accounts/{accountID}/transfers.read\` scope.`,
|
|
24
|
+
args,
|
|
25
|
+
tool: async (client, args, ctx) => {
|
|
26
|
+
const [result, apiCall] = await transfersBatchGetTransfers(
|
|
27
|
+
client,
|
|
28
|
+
args.request,
|
|
29
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
30
|
+
).$inspect();
|
|
31
|
+
|
|
32
|
+
if (!result.ok) {
|
|
33
|
+
return {
|
|
34
|
+
content: [{ type: "text", text: result.error.message }],
|
|
35
|
+
isError: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const value = result.value.result;
|
|
40
|
+
|
|
41
|
+
return formatResult(value, apiCall);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
* Array of transfer IDs to fetch.
|
|
12
|
+
*/
|
|
13
|
+
export type BatchGetTransfersRequest = {
|
|
14
|
+
transferIDs: Array<string>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const BatchGetTransfersRequest$inboundSchema: z.ZodType<
|
|
19
|
+
BatchGetTransfersRequest,
|
|
20
|
+
z.ZodTypeDef,
|
|
21
|
+
unknown
|
|
22
|
+
> = z.object({
|
|
23
|
+
transferIDs: z.array(z.string()),
|
|
24
|
+
});
|
|
25
|
+
/** @internal */
|
|
26
|
+
export type BatchGetTransfersRequest$Outbound = {
|
|
27
|
+
transferIDs: Array<string>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const BatchGetTransfersRequest$outboundSchema: z.ZodType<
|
|
32
|
+
BatchGetTransfersRequest$Outbound,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
BatchGetTransfersRequest
|
|
35
|
+
> = z.object({
|
|
36
|
+
transferIDs: z.array(z.string()),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export function batchGetTransfersRequestToJSON(
|
|
40
|
+
batchGetTransfersRequest: BatchGetTransfersRequest,
|
|
41
|
+
): string {
|
|
42
|
+
return JSON.stringify(
|
|
43
|
+
BatchGetTransfersRequest$outboundSchema.parse(batchGetTransfersRequest),
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
export function batchGetTransfersRequestFromJSON(
|
|
47
|
+
jsonString: string,
|
|
48
|
+
): SafeParseResult<BatchGetTransfersRequest, SDKValidationError> {
|
|
49
|
+
return safeParse(
|
|
50
|
+
jsonString,
|
|
51
|
+
(x) => BatchGetTransfersRequest$inboundSchema.parse(JSON.parse(x)),
|
|
52
|
+
`Failed to parse 'BatchGetTransfersRequest' from JSON`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -68,6 +68,7 @@ export * from "./bankaccountverificationmethod.js";
|
|
|
68
68
|
export * from "./bankaccountverificationstatus.js";
|
|
69
69
|
export * from "./bankaccountwaitfor.js";
|
|
70
70
|
export * from "./basicpaymentmethod.js";
|
|
71
|
+
export * from "./batchgettransfersrequest.js";
|
|
71
72
|
export * from "./billablefee.js";
|
|
72
73
|
export * from "./billingcountandamount.js";
|
|
73
74
|
export * from "./billinginterchangeprogramfee.js";
|
|
@@ -259,6 +260,10 @@ export * from "./industrycodes.js";
|
|
|
259
260
|
export * from "./industrytaxonomy.js";
|
|
260
261
|
export * from "./instantbankcreditpaymentmethod.js";
|
|
261
262
|
export * from "./instantbankcredittransferpaymentmethod.js";
|
|
263
|
+
export * from "./instantbankfailurecode.js";
|
|
264
|
+
export * from "./instantbanknetwork.js";
|
|
265
|
+
export * from "./instantbanktransactiondetails.js";
|
|
266
|
+
export * from "./instantbanktransactionstatus.js";
|
|
262
267
|
export * from "./instantpaymentfees.js";
|
|
263
268
|
export * from "./institutionssearchresponse.js";
|
|
264
269
|
export * from "./invoicestatus.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
* Status codes for instant-bank failures.
|
|
10
|
+
*/
|
|
11
|
+
export const InstantBankFailureCode = {
|
|
12
|
+
ProcessingError: "processing-error",
|
|
13
|
+
InvalidAccount: "invalid-account",
|
|
14
|
+
AccountClosed: "account-closed",
|
|
15
|
+
AccountBlocked: "account-blocked",
|
|
16
|
+
InvalidField: "invalid-field",
|
|
17
|
+
TransactionNotSupported: "transaction-not-supported",
|
|
18
|
+
LimitExceeded: "limit-exceeded",
|
|
19
|
+
InvalidAmount: "invalid-amount",
|
|
20
|
+
CustomerDeceased: "customer-deceased",
|
|
21
|
+
ParticipantNotAvailable: "participant-not-available",
|
|
22
|
+
Other: "other",
|
|
23
|
+
} as const;
|
|
24
|
+
/**
|
|
25
|
+
* Status codes for instant-bank failures.
|
|
26
|
+
*/
|
|
27
|
+
export type InstantBankFailureCode = ClosedEnum<typeof InstantBankFailureCode>;
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const InstantBankFailureCode$inboundSchema: z.ZodNativeEnum<
|
|
31
|
+
typeof InstantBankFailureCode
|
|
32
|
+
> = z.nativeEnum(InstantBankFailureCode);
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const InstantBankFailureCode$outboundSchema: z.ZodNativeEnum<
|
|
35
|
+
typeof InstantBankFailureCode
|
|
36
|
+
> = InstantBankFailureCode$inboundSchema;
|
|
@@ -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 network that the transaction was processed on.
|
|
10
|
+
*/
|
|
11
|
+
export const InstantBankNetwork = {
|
|
12
|
+
Fednow: "fednow",
|
|
13
|
+
Rtp: "rtp",
|
|
14
|
+
} as const;
|
|
15
|
+
/**
|
|
16
|
+
* The network that the transaction was processed on.
|
|
17
|
+
*/
|
|
18
|
+
export type InstantBankNetwork = ClosedEnum<typeof InstantBankNetwork>;
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const InstantBankNetwork$inboundSchema: z.ZodNativeEnum<
|
|
22
|
+
typeof InstantBankNetwork
|
|
23
|
+
> = z.nativeEnum(InstantBankNetwork);
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const InstantBankNetwork$outboundSchema: z.ZodNativeEnum<
|
|
26
|
+
typeof InstantBankNetwork
|
|
27
|
+
> = InstantBankNetwork$inboundSchema;
|
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
InstantBankFailureCode,
|
|
11
|
+
InstantBankFailureCode$inboundSchema,
|
|
12
|
+
InstantBankFailureCode$outboundSchema,
|
|
13
|
+
} from "./instantbankfailurecode.js";
|
|
14
|
+
import {
|
|
15
|
+
InstantBankNetwork,
|
|
16
|
+
InstantBankNetwork$inboundSchema,
|
|
17
|
+
InstantBankNetwork$outboundSchema,
|
|
18
|
+
} from "./instantbanknetwork.js";
|
|
19
|
+
import {
|
|
20
|
+
InstantBankTransactionStatus,
|
|
21
|
+
InstantBankTransactionStatus$inboundSchema,
|
|
22
|
+
InstantBankTransactionStatus$outboundSchema,
|
|
23
|
+
} from "./instantbanktransactionstatus.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Instant-bank specific details about the transaction.
|
|
27
|
+
*/
|
|
28
|
+
export type InstantBankTransactionDetails = {
|
|
29
|
+
/**
|
|
30
|
+
* The network that the transaction was processed on.
|
|
31
|
+
*/
|
|
32
|
+
network: InstantBankNetwork;
|
|
33
|
+
/**
|
|
34
|
+
* Status of a transaction within the instant-bank lifecycle.
|
|
35
|
+
*/
|
|
36
|
+
status: InstantBankTransactionStatus;
|
|
37
|
+
/**
|
|
38
|
+
* Response code returned by network on failure.
|
|
39
|
+
*/
|
|
40
|
+
networkResponseCode?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Status codes for instant-bank failures.
|
|
43
|
+
*/
|
|
44
|
+
failureCode?: InstantBankFailureCode | undefined;
|
|
45
|
+
endToEndID?: string | undefined;
|
|
46
|
+
initiatedOn?: Date | undefined;
|
|
47
|
+
completedOn?: Date | undefined;
|
|
48
|
+
failedOn?: Date | undefined;
|
|
49
|
+
acceptedWithoutPostingOn?: Date | undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const InstantBankTransactionDetails$inboundSchema: z.ZodType<
|
|
54
|
+
InstantBankTransactionDetails,
|
|
55
|
+
z.ZodTypeDef,
|
|
56
|
+
unknown
|
|
57
|
+
> = z.object({
|
|
58
|
+
network: InstantBankNetwork$inboundSchema,
|
|
59
|
+
status: InstantBankTransactionStatus$inboundSchema,
|
|
60
|
+
networkResponseCode: z.string().optional(),
|
|
61
|
+
failureCode: InstantBankFailureCode$inboundSchema.optional(),
|
|
62
|
+
endToEndID: z.string().optional(),
|
|
63
|
+
initiatedOn: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
64
|
+
.optional(),
|
|
65
|
+
completedOn: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
66
|
+
.optional(),
|
|
67
|
+
failedOn: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
68
|
+
.optional(),
|
|
69
|
+
acceptedWithoutPostingOn: z.string().datetime({ offset: true }).transform(v =>
|
|
70
|
+
new Date(v)
|
|
71
|
+
).optional(),
|
|
72
|
+
});
|
|
73
|
+
/** @internal */
|
|
74
|
+
export type InstantBankTransactionDetails$Outbound = {
|
|
75
|
+
network: string;
|
|
76
|
+
status: string;
|
|
77
|
+
networkResponseCode?: string | undefined;
|
|
78
|
+
failureCode?: string | undefined;
|
|
79
|
+
endToEndID?: string | undefined;
|
|
80
|
+
initiatedOn?: string | undefined;
|
|
81
|
+
completedOn?: string | undefined;
|
|
82
|
+
failedOn?: string | undefined;
|
|
83
|
+
acceptedWithoutPostingOn?: string | undefined;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const InstantBankTransactionDetails$outboundSchema: z.ZodType<
|
|
88
|
+
InstantBankTransactionDetails$Outbound,
|
|
89
|
+
z.ZodTypeDef,
|
|
90
|
+
InstantBankTransactionDetails
|
|
91
|
+
> = z.object({
|
|
92
|
+
network: InstantBankNetwork$outboundSchema,
|
|
93
|
+
status: InstantBankTransactionStatus$outboundSchema,
|
|
94
|
+
networkResponseCode: z.string().optional(),
|
|
95
|
+
failureCode: InstantBankFailureCode$outboundSchema.optional(),
|
|
96
|
+
endToEndID: z.string().optional(),
|
|
97
|
+
initiatedOn: z.date().transform(v => v.toISOString()).optional(),
|
|
98
|
+
completedOn: z.date().transform(v => v.toISOString()).optional(),
|
|
99
|
+
failedOn: z.date().transform(v => v.toISOString()).optional(),
|
|
100
|
+
acceptedWithoutPostingOn: z.date().transform(v => v.toISOString()).optional(),
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export function instantBankTransactionDetailsToJSON(
|
|
104
|
+
instantBankTransactionDetails: InstantBankTransactionDetails,
|
|
105
|
+
): string {
|
|
106
|
+
return JSON.stringify(
|
|
107
|
+
InstantBankTransactionDetails$outboundSchema.parse(
|
|
108
|
+
instantBankTransactionDetails,
|
|
109
|
+
),
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
export function instantBankTransactionDetailsFromJSON(
|
|
113
|
+
jsonString: string,
|
|
114
|
+
): SafeParseResult<InstantBankTransactionDetails, SDKValidationError> {
|
|
115
|
+
return safeParse(
|
|
116
|
+
jsonString,
|
|
117
|
+
(x) => InstantBankTransactionDetails$inboundSchema.parse(JSON.parse(x)),
|
|
118
|
+
`Failed to parse 'InstantBankTransactionDetails' from JSON`,
|
|
119
|
+
);
|
|
120
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
* Status of a transaction within the instant-bank lifecycle.
|
|
10
|
+
*/
|
|
11
|
+
export const InstantBankTransactionStatus = {
|
|
12
|
+
Initiated: "initiated",
|
|
13
|
+
Completed: "completed",
|
|
14
|
+
Failed: "failed",
|
|
15
|
+
AcceptedWithoutPosting: "accepted-without-posting",
|
|
16
|
+
} as const;
|
|
17
|
+
/**
|
|
18
|
+
* Status of a transaction within the instant-bank lifecycle.
|
|
19
|
+
*/
|
|
20
|
+
export type InstantBankTransactionStatus = ClosedEnum<
|
|
21
|
+
typeof InstantBankTransactionStatus
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const InstantBankTransactionStatus$inboundSchema: z.ZodNativeEnum<
|
|
26
|
+
typeof InstantBankTransactionStatus
|
|
27
|
+
> = z.nativeEnum(InstantBankTransactionStatus);
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const InstantBankTransactionStatus$outboundSchema: z.ZodNativeEnum<
|
|
30
|
+
typeof InstantBankTransactionStatus
|
|
31
|
+
> = InstantBankTransactionStatus$inboundSchema;
|
|
@@ -24,6 +24,12 @@ import {
|
|
|
24
24
|
CardTransactionDetails$Outbound,
|
|
25
25
|
CardTransactionDetails$outboundSchema,
|
|
26
26
|
} from "./cardtransactiondetails.js";
|
|
27
|
+
import {
|
|
28
|
+
InstantBankTransactionDetails,
|
|
29
|
+
InstantBankTransactionDetails$inboundSchema,
|
|
30
|
+
InstantBankTransactionDetails$Outbound,
|
|
31
|
+
InstantBankTransactionDetails$outboundSchema,
|
|
32
|
+
} from "./instantbanktransactiondetails.js";
|
|
27
33
|
import {
|
|
28
34
|
RTPFailureCode,
|
|
29
35
|
RTPFailureCode$inboundSchema,
|
|
@@ -120,6 +126,10 @@ export type TransferDestination = {
|
|
|
120
126
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
121
127
|
*/
|
|
122
128
|
rtpDetails?: RtpDetails | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Instant-bank specific details about the transaction.
|
|
131
|
+
*/
|
|
132
|
+
instantBankDetails?: InstantBankTransactionDetails | undefined;
|
|
123
133
|
};
|
|
124
134
|
|
|
125
135
|
/** @internal */
|
|
@@ -196,6 +206,7 @@ export const TransferDestination$inboundSchema: z.ZodType<
|
|
|
196
206
|
applePay: ApplePayResponse$inboundSchema.optional(),
|
|
197
207
|
cardDetails: CardTransactionDetails$inboundSchema.optional(),
|
|
198
208
|
rtpDetails: z.lazy(() => RtpDetails$inboundSchema).optional(),
|
|
209
|
+
instantBankDetails: InstantBankTransactionDetails$inboundSchema.optional(),
|
|
199
210
|
});
|
|
200
211
|
/** @internal */
|
|
201
212
|
export type TransferDestination$Outbound = {
|
|
@@ -209,6 +220,7 @@ export type TransferDestination$Outbound = {
|
|
|
209
220
|
applePay?: ApplePayResponse$Outbound | undefined;
|
|
210
221
|
cardDetails?: CardTransactionDetails$Outbound | undefined;
|
|
211
222
|
rtpDetails?: RtpDetails$Outbound | undefined;
|
|
223
|
+
instantBankDetails?: InstantBankTransactionDetails$Outbound | undefined;
|
|
212
224
|
};
|
|
213
225
|
|
|
214
226
|
/** @internal */
|
|
@@ -227,6 +239,7 @@ export const TransferDestination$outboundSchema: z.ZodType<
|
|
|
227
239
|
applePay: ApplePayResponse$outboundSchema.optional(),
|
|
228
240
|
cardDetails: CardTransactionDetails$outboundSchema.optional(),
|
|
229
241
|
rtpDetails: z.lazy(() => RtpDetails$outboundSchema).optional(),
|
|
242
|
+
instantBankDetails: InstantBankTransactionDetails$outboundSchema.optional(),
|
|
230
243
|
});
|
|
231
244
|
|
|
232
245
|
export function transferDestinationToJSON(
|
|
@@ -8,6 +8,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
9
|
|
|
10
10
|
export type WebhookBillingStatementCreated = {
|
|
11
|
+
accountID: string;
|
|
11
12
|
statementID: string;
|
|
12
13
|
};
|
|
13
14
|
|
|
@@ -17,10 +18,12 @@ export const WebhookBillingStatementCreated$inboundSchema: z.ZodType<
|
|
|
17
18
|
z.ZodTypeDef,
|
|
18
19
|
unknown
|
|
19
20
|
> = z.object({
|
|
21
|
+
accountID: z.string(),
|
|
20
22
|
statementID: z.string(),
|
|
21
23
|
});
|
|
22
24
|
/** @internal */
|
|
23
25
|
export type WebhookBillingStatementCreated$Outbound = {
|
|
26
|
+
accountID: string;
|
|
24
27
|
statementID: string;
|
|
25
28
|
};
|
|
26
29
|
|
|
@@ -30,6 +33,7 @@ export const WebhookBillingStatementCreated$outboundSchema: z.ZodType<
|
|
|
30
33
|
z.ZodTypeDef,
|
|
31
34
|
WebhookBillingStatementCreated
|
|
32
35
|
> = z.object({
|
|
36
|
+
accountID: z.string(),
|
|
33
37
|
statementID: z.string(),
|
|
34
38
|
});
|
|
35
39
|
|
|
@@ -265,11 +265,11 @@ export type WebhookData =
|
|
|
265
265
|
| WebhookDataTicketCreated
|
|
266
266
|
| WebhookDataTicketMessageAdded
|
|
267
267
|
| WebhookDataWalletCreated
|
|
268
|
+
| WebhookBillingStatementCreated
|
|
268
269
|
| WebhookDataAccountCreated
|
|
269
270
|
| WebhookDataAccountUpdated
|
|
270
271
|
| WebhookDataAccountDisconnected
|
|
271
|
-
| WebhookDataNetworkIDUpdated
|
|
272
|
-
| WebhookBillingStatementCreated;
|
|
272
|
+
| WebhookDataNetworkIDUpdated;
|
|
273
273
|
|
|
274
274
|
/** @internal */
|
|
275
275
|
export const WebhookData$inboundSchema: z.ZodType<
|
|
@@ -309,11 +309,11 @@ export const WebhookData$inboundSchema: z.ZodType<
|
|
|
309
309
|
WebhookDataTicketCreated$inboundSchema,
|
|
310
310
|
WebhookDataTicketMessageAdded$inboundSchema,
|
|
311
311
|
WebhookDataWalletCreated$inboundSchema,
|
|
312
|
+
WebhookBillingStatementCreated$inboundSchema,
|
|
312
313
|
WebhookDataAccountCreated$inboundSchema,
|
|
313
314
|
WebhookDataAccountUpdated$inboundSchema,
|
|
314
315
|
WebhookDataAccountDisconnected$inboundSchema,
|
|
315
316
|
WebhookDataNetworkIDUpdated$inboundSchema,
|
|
316
|
-
WebhookBillingStatementCreated$inboundSchema,
|
|
317
317
|
]);
|
|
318
318
|
/** @internal */
|
|
319
319
|
export type WebhookData$Outbound =
|
|
@@ -349,11 +349,11 @@ export type WebhookData$Outbound =
|
|
|
349
349
|
| WebhookDataTicketCreated$Outbound
|
|
350
350
|
| WebhookDataTicketMessageAdded$Outbound
|
|
351
351
|
| WebhookDataWalletCreated$Outbound
|
|
352
|
+
| WebhookBillingStatementCreated$Outbound
|
|
352
353
|
| WebhookDataAccountCreated$Outbound
|
|
353
354
|
| WebhookDataAccountUpdated$Outbound
|
|
354
355
|
| WebhookDataAccountDisconnected$Outbound
|
|
355
|
-
| WebhookDataNetworkIDUpdated$Outbound
|
|
356
|
-
| WebhookBillingStatementCreated$Outbound;
|
|
356
|
+
| WebhookDataNetworkIDUpdated$Outbound;
|
|
357
357
|
|
|
358
358
|
/** @internal */
|
|
359
359
|
export const WebhookData$outboundSchema: z.ZodType<
|
|
@@ -393,11 +393,11 @@ export const WebhookData$outboundSchema: z.ZodType<
|
|
|
393
393
|
WebhookDataTicketCreated$outboundSchema,
|
|
394
394
|
WebhookDataTicketMessageAdded$outboundSchema,
|
|
395
395
|
WebhookDataWalletCreated$outboundSchema,
|
|
396
|
+
WebhookBillingStatementCreated$outboundSchema,
|
|
396
397
|
WebhookDataAccountCreated$outboundSchema,
|
|
397
398
|
WebhookDataAccountUpdated$outboundSchema,
|
|
398
399
|
WebhookDataAccountDisconnected$outboundSchema,
|
|
399
400
|
WebhookDataNetworkIDUpdated$outboundSchema,
|
|
400
|
-
WebhookBillingStatementCreated$outboundSchema,
|
|
401
401
|
]);
|
|
402
402
|
|
|
403
403
|
export function webhookDataToJSON(webhookData: WebhookData): string {
|