@moovio/sdk 0.6.0 → 0.6.2
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 +38 -8
- package/bin/mcp-server.js +1122 -258
- package/bin/mcp-server.js.map +28 -11
- package/docs/sdks/receipts/README.md +189 -0
- package/docs/sdks/transfers/README.md +185 -0
- package/funcs/receiptsCreate.d.ts +18 -0
- package/funcs/receiptsCreate.d.ts.map +1 -0
- package/funcs/receiptsCreate.js +133 -0
- package/funcs/receiptsCreate.js.map +1 -0
- package/funcs/receiptsList.d.ts +16 -0
- package/funcs/receiptsList.d.ts.map +1 -0
- package/funcs/receiptsList.js +121 -0
- package/funcs/receiptsList.js.map +1 -0
- package/funcs/transfersCreateCancellation.d.ts +17 -0
- package/funcs/transfersCreateCancellation.d.ts.map +1 -0
- package/funcs/transfersCreateCancellation.js +128 -0
- package/funcs/transfersCreateCancellation.js.map +1 -0
- package/funcs/transfersGetCancellation.d.ts +16 -0
- package/funcs/transfersGetCancellation.d.ts.map +1 -0
- package/funcs/transfersGetCancellation.js +131 -0
- package/funcs/transfersGetCancellation.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 +9 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/receiptsCreate.d.ts +9 -0
- package/mcp-server/tools/receiptsCreate.d.ts.map +1 -0
- package/mcp-server/tools/receiptsCreate.js +66 -0
- package/mcp-server/tools/receiptsCreate.js.map +1 -0
- package/mcp-server/tools/receiptsList.d.ts +8 -0
- package/mcp-server/tools/receiptsList.d.ts.map +1 -0
- package/mcp-server/tools/receiptsList.js +65 -0
- package/mcp-server/tools/receiptsList.js.map +1 -0
- package/mcp-server/tools/transfersCreateCancellation.d.ts +8 -0
- package/mcp-server/tools/transfersCreateCancellation.d.ts.map +1 -0
- package/mcp-server/tools/transfersCreateCancellation.js +65 -0
- package/mcp-server/tools/transfersCreateCancellation.js.map +1 -0
- package/mcp-server/tools/transfersGetCancellation.d.ts +8 -0
- package/mcp-server/tools/transfersGetCancellation.d.ts.map +1 -0
- package/mcp-server/tools/transfersGetCancellation.js +65 -0
- package/mcp-server/tools/transfersGetCancellation.js.map +1 -0
- package/models/components/index.d.ts +4 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +4 -0
- package/models/components/index.js.map +1 -1
- package/models/components/receiptkind.d.ts +31 -0
- package/models/components/receiptkind.d.ts.map +1 -0
- package/models/components/receiptkind.js +63 -0
- package/models/components/receiptkind.js.map +1 -0
- package/models/components/receiptrequest.d.ts +76 -0
- package/models/components/receiptrequest.d.ts.map +1 -0
- package/models/components/receiptrequest.js +80 -0
- package/models/components/receiptrequest.js.map +1 -0
- package/models/components/receiptresponse.d.ts +94 -0
- package/models/components/receiptresponse.d.ts.map +1 -0
- package/models/components/receiptresponse.js +90 -0
- package/models/components/receiptresponse.js.map +1 -0
- package/models/components/sentreceipt.d.ts +42 -0
- package/models/components/sentreceipt.d.ts.map +1 -0
- package/models/components/sentreceipt.js +73 -0
- package/models/components/sentreceipt.js.map +1 -0
- package/models/components/transfer.d.ts +3 -0
- package/models/components/transfer.d.ts.map +1 -1
- package/models/components/transfer.js +3 -0
- package/models/components/transfer.js.map +1 -1
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/receiptvalidationerror.d.ts +46 -0
- package/models/errors/receiptvalidationerror.d.ts.map +1 -0
- package/models/errors/receiptvalidationerror.js +98 -0
- package/models/errors/receiptvalidationerror.js.map +1 -0
- package/models/errors/transfer.d.ts +3 -0
- package/models/errors/transfer.d.ts.map +1 -1
- package/models/errors/transfer.js +4 -0
- package/models/errors/transfer.js.map +1 -1
- package/models/operations/createcancellation.d.ts +107 -0
- package/models/operations/createcancellation.d.ts.map +1 -0
- package/models/operations/createcancellation.js +147 -0
- package/models/operations/createcancellation.js.map +1 -0
- package/models/operations/createreceipts.d.ts +74 -0
- package/models/operations/createreceipts.d.ts.map +1 -0
- package/models/operations/createreceipts.js +118 -0
- package/models/operations/createreceipts.js.map +1 -0
- package/models/operations/getcancellation.d.ts +112 -0
- package/models/operations/getcancellation.d.ts.map +1 -0
- package/models/operations/getcancellation.js +149 -0
- package/models/operations/getcancellation.js.map +1 -0
- package/models/operations/index.d.ts +4 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +4 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listreceipts.d.ts +102 -0
- package/models/operations/listreceipts.d.ts.map +1 -0
- package/models/operations/listreceipts.js +145 -0
- package/models/operations/listreceipts.js.map +1 -0
- package/package.json +1 -1
- package/sdk/receipts.d.ts +20 -0
- package/sdk/receipts.d.ts.map +1 -0
- package/sdk/receipts.js +32 -0
- package/sdk/receipts.js.map +1 -0
- 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/transfers.d.ts +14 -0
- package/sdk/transfers.d.ts.map +1 -1
- package/sdk/transfers.js +20 -0
- package/sdk/transfers.js.map +1 -1
- package/src/funcs/receiptsCreate.ts +190 -0
- package/src/funcs/receiptsList.ts +171 -0
- package/src/funcs/transfersCreateCancellation.ts +184 -0
- package/src/funcs/transfersGetCancellation.ts +183 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +9 -1
- package/src/mcp-server/tools/receiptsCreate.ts +39 -0
- package/src/mcp-server/tools/receiptsList.ts +38 -0
- package/src/mcp-server/tools/transfersCreateCancellation.ts +38 -0
- package/src/mcp-server/tools/transfersGetCancellation.ts +38 -0
- package/src/models/components/index.ts +4 -0
- package/src/models/components/receiptkind.ts +36 -0
- package/src/models/components/receiptrequest.ts +123 -0
- package/src/models/components/receiptresponse.ts +157 -0
- package/src/models/components/sentreceipt.ts +79 -0
- package/src/models/components/transfer.ts +10 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/receiptvalidationerror.ts +99 -0
- package/src/models/errors/transfer.ts +6 -0
- package/src/models/operations/createcancellation.ts +229 -0
- package/src/models/operations/createreceipts.ts +161 -0
- package/src/models/operations/getcancellation.ts +236 -0
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/listreceipts.ts +222 -0
- package/src/sdk/receipts.ts +46 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/transfers.ts +36 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transfersCreateCancellation } from "../../funcs/transfersCreateCancellation.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CreateCancellationRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$transfersCreateCancellation: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "transfers_create-cancellation",
|
|
15
|
+
description: ` Initiate a cancellation for a card, ACH, or queued transfer.
|
|
16
|
+
|
|
17
|
+
To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
|
|
18
|
+
to specify the \`/accounts/{accountID}/transfers.write\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await transfersCreateCancellation(
|
|
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,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transfersGetCancellation } from "../../funcs/transfersGetCancellation.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetCancellationRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$transfersGetCancellation: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "transfers_get-cancellation",
|
|
15
|
+
description: ` Get details of a cancellation for a transfer.
|
|
16
|
+
|
|
17
|
+
To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
|
|
18
|
+
to specify the \`/accounts/{accountID}/transfers.read\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await transfersGetCancellation(
|
|
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
|
+
};
|
|
@@ -269,6 +269,9 @@ export * from "./profile.js";
|
|
|
269
269
|
export * from "./pullfromcardpaymentmethod.js";
|
|
270
270
|
export * from "./pushtocardpaymentmethod.js";
|
|
271
271
|
export * from "./qrcode.js";
|
|
272
|
+
export * from "./receiptkind.js";
|
|
273
|
+
export * from "./receiptrequest.js";
|
|
274
|
+
export * from "./receiptresponse.js";
|
|
272
275
|
export * from "./recur.js";
|
|
273
276
|
export * from "./refundcarddetails.js";
|
|
274
277
|
export * from "./refundcardstatus.js";
|
|
@@ -296,6 +299,7 @@ export * from "./schedulepaymentmethod.js";
|
|
|
296
299
|
export * from "./scheduleresponse.js";
|
|
297
300
|
export * from "./seccode.js";
|
|
298
301
|
export * from "./security.js";
|
|
302
|
+
export * from "./sentreceipt.js";
|
|
299
303
|
export * from "./settings.js";
|
|
300
304
|
export * from "./sourcedestinationoptions.js";
|
|
301
305
|
export * from "./sweep.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";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The type of receipt being requested.
|
|
10
|
+
*/
|
|
11
|
+
export const ReceiptKind = {
|
|
12
|
+
SaleCustomerV1: "sale.customer.v1",
|
|
13
|
+
} as const;
|
|
14
|
+
/**
|
|
15
|
+
* The type of receipt being requested.
|
|
16
|
+
*/
|
|
17
|
+
export type ReceiptKind = ClosedEnum<typeof ReceiptKind>;
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const ReceiptKind$inboundSchema: z.ZodNativeEnum<typeof ReceiptKind> = z
|
|
21
|
+
.nativeEnum(ReceiptKind);
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const ReceiptKind$outboundSchema: z.ZodNativeEnum<typeof ReceiptKind> =
|
|
25
|
+
ReceiptKind$inboundSchema;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
30
|
+
*/
|
|
31
|
+
export namespace ReceiptKind$ {
|
|
32
|
+
/** @deprecated use `ReceiptKind$inboundSchema` instead. */
|
|
33
|
+
export const inboundSchema = ReceiptKind$inboundSchema;
|
|
34
|
+
/** @deprecated use `ReceiptKind$outboundSchema` instead. */
|
|
35
|
+
export const outboundSchema = ReceiptKind$outboundSchema;
|
|
36
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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
|
+
ReceiptKind,
|
|
11
|
+
ReceiptKind$inboundSchema,
|
|
12
|
+
ReceiptKind$outboundSchema,
|
|
13
|
+
} from "./receiptkind.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A receipt request for a specific transfer, schedule, or schedule occurrence.
|
|
17
|
+
*/
|
|
18
|
+
export type ReceiptRequest = {
|
|
19
|
+
/**
|
|
20
|
+
* The type of receipt being requested.
|
|
21
|
+
*/
|
|
22
|
+
kind: ReceiptKind;
|
|
23
|
+
/**
|
|
24
|
+
* The email address to send the receipt to.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* Either email or emailAccountID must be provided, but not both.
|
|
28
|
+
*/
|
|
29
|
+
email?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The accountID to send the receipt to.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Either email or emailAccountID must be provided, but not both.
|
|
35
|
+
*/
|
|
36
|
+
emailAccountID?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The ID of the transfer associated with this receipt.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Exactly one of forTransferID, forScheduleID, or forOccurrenceID must be provided.
|
|
42
|
+
*/
|
|
43
|
+
forTransferID?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* The ID of the schedule associated with this receipt.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* Exactly one of forTransferID, forScheduleID, or forOccurrenceID must be provided.
|
|
49
|
+
*/
|
|
50
|
+
forScheduleID?: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The ID of the schedule occurrence associated with this receipt.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* Exactly one of forTransferID, forScheduleID, or forOccurrenceID must be provided.
|
|
56
|
+
*/
|
|
57
|
+
forOccurrenceID?: string | undefined;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const ReceiptRequest$inboundSchema: z.ZodType<
|
|
62
|
+
ReceiptRequest,
|
|
63
|
+
z.ZodTypeDef,
|
|
64
|
+
unknown
|
|
65
|
+
> = z.object({
|
|
66
|
+
kind: ReceiptKind$inboundSchema,
|
|
67
|
+
email: z.string().optional(),
|
|
68
|
+
emailAccountID: z.string().optional(),
|
|
69
|
+
forTransferID: z.string().optional(),
|
|
70
|
+
forScheduleID: z.string().optional(),
|
|
71
|
+
forOccurrenceID: z.string().optional(),
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
/** @internal */
|
|
75
|
+
export type ReceiptRequest$Outbound = {
|
|
76
|
+
kind: string;
|
|
77
|
+
email?: string | undefined;
|
|
78
|
+
emailAccountID?: string | undefined;
|
|
79
|
+
forTransferID?: string | undefined;
|
|
80
|
+
forScheduleID?: string | undefined;
|
|
81
|
+
forOccurrenceID?: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const ReceiptRequest$outboundSchema: z.ZodType<
|
|
86
|
+
ReceiptRequest$Outbound,
|
|
87
|
+
z.ZodTypeDef,
|
|
88
|
+
ReceiptRequest
|
|
89
|
+
> = z.object({
|
|
90
|
+
kind: ReceiptKind$outboundSchema,
|
|
91
|
+
email: z.string().optional(),
|
|
92
|
+
emailAccountID: z.string().optional(),
|
|
93
|
+
forTransferID: z.string().optional(),
|
|
94
|
+
forScheduleID: z.string().optional(),
|
|
95
|
+
forOccurrenceID: z.string().optional(),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @internal
|
|
100
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
101
|
+
*/
|
|
102
|
+
export namespace ReceiptRequest$ {
|
|
103
|
+
/** @deprecated use `ReceiptRequest$inboundSchema` instead. */
|
|
104
|
+
export const inboundSchema = ReceiptRequest$inboundSchema;
|
|
105
|
+
/** @deprecated use `ReceiptRequest$outboundSchema` instead. */
|
|
106
|
+
export const outboundSchema = ReceiptRequest$outboundSchema;
|
|
107
|
+
/** @deprecated use `ReceiptRequest$Outbound` instead. */
|
|
108
|
+
export type Outbound = ReceiptRequest$Outbound;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function receiptRequestToJSON(receiptRequest: ReceiptRequest): string {
|
|
112
|
+
return JSON.stringify(ReceiptRequest$outboundSchema.parse(receiptRequest));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function receiptRequestFromJSON(
|
|
116
|
+
jsonString: string,
|
|
117
|
+
): SafeParseResult<ReceiptRequest, SDKValidationError> {
|
|
118
|
+
return safeParse(
|
|
119
|
+
jsonString,
|
|
120
|
+
(x) => ReceiptRequest$inboundSchema.parse(JSON.parse(x)),
|
|
121
|
+
`Failed to parse 'ReceiptRequest' from JSON`,
|
|
122
|
+
);
|
|
123
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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
|
+
ReceiptKind,
|
|
11
|
+
ReceiptKind$inboundSchema,
|
|
12
|
+
ReceiptKind$outboundSchema,
|
|
13
|
+
} from "./receiptkind.js";
|
|
14
|
+
import {
|
|
15
|
+
SentReceipt,
|
|
16
|
+
SentReceipt$inboundSchema,
|
|
17
|
+
SentReceipt$Outbound,
|
|
18
|
+
SentReceipt$outboundSchema,
|
|
19
|
+
} from "./sentreceipt.js";
|
|
20
|
+
|
|
21
|
+
export type ReceiptResponse = {
|
|
22
|
+
/**
|
|
23
|
+
* Unique identifier for the receipt request.
|
|
24
|
+
*/
|
|
25
|
+
receiptID: string;
|
|
26
|
+
/**
|
|
27
|
+
* AccountID for which the receipt request was created.
|
|
28
|
+
*/
|
|
29
|
+
createdBy: string;
|
|
30
|
+
/**
|
|
31
|
+
* The date and time the receipt was disabled.
|
|
32
|
+
*/
|
|
33
|
+
disabledOn?: Date | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The type of receipt.
|
|
36
|
+
*/
|
|
37
|
+
kind: ReceiptKind;
|
|
38
|
+
/**
|
|
39
|
+
* The email address the receipt is sent to.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* Either email or emailAccountID will be in the response, but not both.
|
|
43
|
+
*/
|
|
44
|
+
email?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* The accountID the receipt is sent to.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* Either email or emailAccountID will be in the response, but not both.
|
|
50
|
+
*/
|
|
51
|
+
emailAccountID?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* The ID of the transfer associated with this receipt.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Exactly one of forTransferID, forScheduleID, or forOccurrenceID must be provided.
|
|
57
|
+
*/
|
|
58
|
+
forTransferID?: string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* The ID of the schedule associated with this receipt.
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* Exactly one of forTransferID, forScheduleID, or forOccurrenceID must be provided.
|
|
64
|
+
*/
|
|
65
|
+
forScheduleID?: string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The ID of the schedule occurrence associated with this receipt.
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* Exactly one of forTransferID, forScheduleID, or forOccurrenceID must be provided.
|
|
71
|
+
*/
|
|
72
|
+
forOccurrenceID?: string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* The list of receipts that have been sent.
|
|
75
|
+
*/
|
|
76
|
+
sentFor: Array<SentReceipt>;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const ReceiptResponse$inboundSchema: z.ZodType<
|
|
81
|
+
ReceiptResponse,
|
|
82
|
+
z.ZodTypeDef,
|
|
83
|
+
unknown
|
|
84
|
+
> = z.object({
|
|
85
|
+
receiptID: z.string(),
|
|
86
|
+
createdBy: z.string(),
|
|
87
|
+
disabledOn: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
88
|
+
.optional(),
|
|
89
|
+
kind: ReceiptKind$inboundSchema,
|
|
90
|
+
email: z.string().optional(),
|
|
91
|
+
emailAccountID: z.string().optional(),
|
|
92
|
+
forTransferID: z.string().optional(),
|
|
93
|
+
forScheduleID: z.string().optional(),
|
|
94
|
+
forOccurrenceID: z.string().optional(),
|
|
95
|
+
sentFor: z.array(SentReceipt$inboundSchema),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/** @internal */
|
|
99
|
+
export type ReceiptResponse$Outbound = {
|
|
100
|
+
receiptID: string;
|
|
101
|
+
createdBy: string;
|
|
102
|
+
disabledOn?: string | undefined;
|
|
103
|
+
kind: string;
|
|
104
|
+
email?: string | undefined;
|
|
105
|
+
emailAccountID?: string | undefined;
|
|
106
|
+
forTransferID?: string | undefined;
|
|
107
|
+
forScheduleID?: string | undefined;
|
|
108
|
+
forOccurrenceID?: string | undefined;
|
|
109
|
+
sentFor: Array<SentReceipt$Outbound>;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/** @internal */
|
|
113
|
+
export const ReceiptResponse$outboundSchema: z.ZodType<
|
|
114
|
+
ReceiptResponse$Outbound,
|
|
115
|
+
z.ZodTypeDef,
|
|
116
|
+
ReceiptResponse
|
|
117
|
+
> = z.object({
|
|
118
|
+
receiptID: z.string(),
|
|
119
|
+
createdBy: z.string(),
|
|
120
|
+
disabledOn: z.date().transform(v => v.toISOString()).optional(),
|
|
121
|
+
kind: ReceiptKind$outboundSchema,
|
|
122
|
+
email: z.string().optional(),
|
|
123
|
+
emailAccountID: z.string().optional(),
|
|
124
|
+
forTransferID: z.string().optional(),
|
|
125
|
+
forScheduleID: z.string().optional(),
|
|
126
|
+
forOccurrenceID: z.string().optional(),
|
|
127
|
+
sentFor: z.array(SentReceipt$outboundSchema),
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @internal
|
|
132
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
133
|
+
*/
|
|
134
|
+
export namespace ReceiptResponse$ {
|
|
135
|
+
/** @deprecated use `ReceiptResponse$inboundSchema` instead. */
|
|
136
|
+
export const inboundSchema = ReceiptResponse$inboundSchema;
|
|
137
|
+
/** @deprecated use `ReceiptResponse$outboundSchema` instead. */
|
|
138
|
+
export const outboundSchema = ReceiptResponse$outboundSchema;
|
|
139
|
+
/** @deprecated use `ReceiptResponse$Outbound` instead. */
|
|
140
|
+
export type Outbound = ReceiptResponse$Outbound;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function receiptResponseToJSON(
|
|
144
|
+
receiptResponse: ReceiptResponse,
|
|
145
|
+
): string {
|
|
146
|
+
return JSON.stringify(ReceiptResponse$outboundSchema.parse(receiptResponse));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function receiptResponseFromJSON(
|
|
150
|
+
jsonString: string,
|
|
151
|
+
): SafeParseResult<ReceiptResponse, SDKValidationError> {
|
|
152
|
+
return safeParse(
|
|
153
|
+
jsonString,
|
|
154
|
+
(x) => ReceiptResponse$inboundSchema.parse(JSON.parse(x)),
|
|
155
|
+
`Failed to parse 'ReceiptResponse' from JSON`,
|
|
156
|
+
);
|
|
157
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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
|
+
export type SentReceipt = {
|
|
11
|
+
/**
|
|
12
|
+
* Unique identifier for the receipt.
|
|
13
|
+
*/
|
|
14
|
+
receiptID: string;
|
|
15
|
+
/**
|
|
16
|
+
* The idempotency key used when creating the receipt.
|
|
17
|
+
*/
|
|
18
|
+
idempotencyKey: string;
|
|
19
|
+
/**
|
|
20
|
+
* When the receipt was sent.
|
|
21
|
+
*/
|
|
22
|
+
sentOn: Date;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const SentReceipt$inboundSchema: z.ZodType<
|
|
27
|
+
SentReceipt,
|
|
28
|
+
z.ZodTypeDef,
|
|
29
|
+
unknown
|
|
30
|
+
> = z.object({
|
|
31
|
+
receiptID: z.string(),
|
|
32
|
+
idempotencyKey: z.string(),
|
|
33
|
+
sentOn: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export type SentReceipt$Outbound = {
|
|
38
|
+
receiptID: string;
|
|
39
|
+
idempotencyKey: string;
|
|
40
|
+
sentOn: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const SentReceipt$outboundSchema: z.ZodType<
|
|
45
|
+
SentReceipt$Outbound,
|
|
46
|
+
z.ZodTypeDef,
|
|
47
|
+
SentReceipt
|
|
48
|
+
> = z.object({
|
|
49
|
+
receiptID: z.string(),
|
|
50
|
+
idempotencyKey: z.string(),
|
|
51
|
+
sentOn: z.date().transform(v => v.toISOString()),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
57
|
+
*/
|
|
58
|
+
export namespace SentReceipt$ {
|
|
59
|
+
/** @deprecated use `SentReceipt$inboundSchema` instead. */
|
|
60
|
+
export const inboundSchema = SentReceipt$inboundSchema;
|
|
61
|
+
/** @deprecated use `SentReceipt$outboundSchema` instead. */
|
|
62
|
+
export const outboundSchema = SentReceipt$outboundSchema;
|
|
63
|
+
/** @deprecated use `SentReceipt$Outbound` instead. */
|
|
64
|
+
export type Outbound = SentReceipt$Outbound;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function sentReceiptToJSON(sentReceipt: SentReceipt): string {
|
|
68
|
+
return JSON.stringify(SentReceipt$outboundSchema.parse(sentReceipt));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function sentReceiptFromJSON(
|
|
72
|
+
jsonString: string,
|
|
73
|
+
): SafeParseResult<SentReceipt, SDKValidationError> {
|
|
74
|
+
return safeParse(
|
|
75
|
+
jsonString,
|
|
76
|
+
(x) => SentReceipt$inboundSchema.parse(JSON.parse(x)),
|
|
77
|
+
`Failed to parse 'SentReceipt' from JSON`,
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -12,6 +12,12 @@ import {
|
|
|
12
12
|
Amount$Outbound,
|
|
13
13
|
Amount$outboundSchema,
|
|
14
14
|
} from "./amount.js";
|
|
15
|
+
import {
|
|
16
|
+
Cancellation,
|
|
17
|
+
Cancellation$inboundSchema,
|
|
18
|
+
Cancellation$Outbound,
|
|
19
|
+
Cancellation$outboundSchema,
|
|
20
|
+
} from "./cancellation.js";
|
|
15
21
|
import {
|
|
16
22
|
CardAcquiringDispute,
|
|
17
23
|
CardAcquiringDispute$inboundSchema,
|
|
@@ -102,6 +108,7 @@ export type Transfer = {
|
|
|
102
108
|
*/
|
|
103
109
|
moovFeeDetails?: MoovFeeDetails | undefined;
|
|
104
110
|
groupID?: string | undefined;
|
|
111
|
+
cancellations?: Array<Cancellation> | undefined;
|
|
105
112
|
refundedAmount?: Amount | undefined;
|
|
106
113
|
refunds?: Array<CardAcquiringRefund> | undefined;
|
|
107
114
|
disputedAmount?: Amount | undefined;
|
|
@@ -133,6 +140,7 @@ export const Transfer$inboundSchema: z.ZodType<
|
|
|
133
140
|
moovFeeDecimal: z.string().optional(),
|
|
134
141
|
moovFeeDetails: MoovFeeDetails$inboundSchema.optional(),
|
|
135
142
|
groupID: z.string().optional(),
|
|
143
|
+
cancellations: z.array(Cancellation$inboundSchema).optional(),
|
|
136
144
|
refundedAmount: Amount$inboundSchema.optional(),
|
|
137
145
|
refunds: z.array(CardAcquiringRefund$inboundSchema).optional(),
|
|
138
146
|
disputedAmount: Amount$inboundSchema.optional(),
|
|
@@ -159,6 +167,7 @@ export type Transfer$Outbound = {
|
|
|
159
167
|
moovFeeDecimal?: string | undefined;
|
|
160
168
|
moovFeeDetails?: MoovFeeDetails$Outbound | undefined;
|
|
161
169
|
groupID?: string | undefined;
|
|
170
|
+
cancellations?: Array<Cancellation$Outbound> | undefined;
|
|
162
171
|
refundedAmount?: Amount$Outbound | undefined;
|
|
163
172
|
refunds?: Array<CardAcquiringRefund$Outbound> | undefined;
|
|
164
173
|
disputedAmount?: Amount$Outbound | undefined;
|
|
@@ -189,6 +198,7 @@ export const Transfer$outboundSchema: z.ZodType<
|
|
|
189
198
|
moovFeeDecimal: z.string().optional(),
|
|
190
199
|
moovFeeDetails: MoovFeeDetails$outboundSchema.optional(),
|
|
191
200
|
groupID: z.string().optional(),
|
|
201
|
+
cancellations: z.array(Cancellation$outboundSchema).optional(),
|
|
192
202
|
refundedAmount: Amount$outboundSchema.optional(),
|
|
193
203
|
refunds: z.array(CardAcquiringRefund$outboundSchema).optional(),
|
|
194
204
|
disputedAmount: Amount$outboundSchema.optional(),
|
|
@@ -22,6 +22,7 @@ export * from "./linkcarderror.js";
|
|
|
22
22
|
export * from "./microdepositvalidationerror.js";
|
|
23
23
|
export * from "./onboardinginviteerror.js";
|
|
24
24
|
export * from "./patchsweepconfigerror.js";
|
|
25
|
+
export * from "./receiptvalidationerror.js";
|
|
25
26
|
export * from "./refundvalidationerror.js";
|
|
26
27
|
export * from "./representativevalidationerror.js";
|
|
27
28
|
export * from "./requestcarderror.js";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export type ReceiptValidationErrorData = {
|
|
8
|
+
kind?: string | undefined;
|
|
9
|
+
email?: string | undefined;
|
|
10
|
+
emailAccountID?: string | undefined;
|
|
11
|
+
forTransferID?: string | undefined;
|
|
12
|
+
forScheduleID?: string | undefined;
|
|
13
|
+
forOccurrenceID?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export class ReceiptValidationError extends Error {
|
|
17
|
+
kind?: string | undefined;
|
|
18
|
+
email?: string | undefined;
|
|
19
|
+
emailAccountID?: string | undefined;
|
|
20
|
+
forTransferID?: string | undefined;
|
|
21
|
+
forScheduleID?: string | undefined;
|
|
22
|
+
forOccurrenceID?: string | undefined;
|
|
23
|
+
|
|
24
|
+
/** The original data that was passed to this error instance. */
|
|
25
|
+
data$: ReceiptValidationErrorData;
|
|
26
|
+
|
|
27
|
+
constructor(err: ReceiptValidationErrorData) {
|
|
28
|
+
const message = "message" in err && typeof err.message === "string"
|
|
29
|
+
? err.message
|
|
30
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
31
|
+
super(message);
|
|
32
|
+
this.data$ = err;
|
|
33
|
+
|
|
34
|
+
if (err.kind != null) this.kind = err.kind;
|
|
35
|
+
if (err.email != null) this.email = err.email;
|
|
36
|
+
if (err.emailAccountID != null) this.emailAccountID = err.emailAccountID;
|
|
37
|
+
if (err.forTransferID != null) this.forTransferID = err.forTransferID;
|
|
38
|
+
if (err.forScheduleID != null) this.forScheduleID = err.forScheduleID;
|
|
39
|
+
if (err.forOccurrenceID != null) this.forOccurrenceID = err.forOccurrenceID;
|
|
40
|
+
|
|
41
|
+
this.name = "ReceiptValidationError";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const ReceiptValidationError$inboundSchema: z.ZodType<
|
|
47
|
+
ReceiptValidationError,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
unknown
|
|
50
|
+
> = z.object({
|
|
51
|
+
kind: z.string().optional(),
|
|
52
|
+
email: z.string().optional(),
|
|
53
|
+
emailAccountID: z.string().optional(),
|
|
54
|
+
forTransferID: z.string().optional(),
|
|
55
|
+
forScheduleID: z.string().optional(),
|
|
56
|
+
forOccurrenceID: z.string().optional(),
|
|
57
|
+
})
|
|
58
|
+
.transform((v) => {
|
|
59
|
+
return new ReceiptValidationError(v);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
/** @internal */
|
|
63
|
+
export type ReceiptValidationError$Outbound = {
|
|
64
|
+
kind?: string | undefined;
|
|
65
|
+
email?: string | undefined;
|
|
66
|
+
emailAccountID?: string | undefined;
|
|
67
|
+
forTransferID?: string | undefined;
|
|
68
|
+
forScheduleID?: string | undefined;
|
|
69
|
+
forOccurrenceID?: string | undefined;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** @internal */
|
|
73
|
+
export const ReceiptValidationError$outboundSchema: z.ZodType<
|
|
74
|
+
ReceiptValidationError$Outbound,
|
|
75
|
+
z.ZodTypeDef,
|
|
76
|
+
ReceiptValidationError
|
|
77
|
+
> = z.instanceof(ReceiptValidationError)
|
|
78
|
+
.transform(v => v.data$)
|
|
79
|
+
.pipe(z.object({
|
|
80
|
+
kind: z.string().optional(),
|
|
81
|
+
email: z.string().optional(),
|
|
82
|
+
emailAccountID: z.string().optional(),
|
|
83
|
+
forTransferID: z.string().optional(),
|
|
84
|
+
forScheduleID: z.string().optional(),
|
|
85
|
+
forOccurrenceID: z.string().optional(),
|
|
86
|
+
}));
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
91
|
+
*/
|
|
92
|
+
export namespace ReceiptValidationError$ {
|
|
93
|
+
/** @deprecated use `ReceiptValidationError$inboundSchema` instead. */
|
|
94
|
+
export const inboundSchema = ReceiptValidationError$inboundSchema;
|
|
95
|
+
/** @deprecated use `ReceiptValidationError$outboundSchema` instead. */
|
|
96
|
+
export const outboundSchema = ReceiptValidationError$outboundSchema;
|
|
97
|
+
/** @deprecated use `ReceiptValidationError$Outbound` instead. */
|
|
98
|
+
export type Outbound = ReceiptValidationError$Outbound;
|
|
99
|
+
}
|
|
@@ -48,6 +48,7 @@ export type TransferData = {
|
|
|
48
48
|
*/
|
|
49
49
|
moovFeeDetails?: components.MoovFeeDetails | undefined;
|
|
50
50
|
groupID?: string | undefined;
|
|
51
|
+
cancellations?: Array<components.Cancellation> | undefined;
|
|
51
52
|
refundedAmount?: components.Amount | undefined;
|
|
52
53
|
refunds?: Array<components.CardAcquiringRefund> | undefined;
|
|
53
54
|
disputedAmount?: components.Amount | undefined;
|
|
@@ -100,6 +101,7 @@ export class Transfer extends Error {
|
|
|
100
101
|
*/
|
|
101
102
|
moovFeeDetails?: components.MoovFeeDetails | undefined;
|
|
102
103
|
groupID?: string | undefined;
|
|
104
|
+
cancellations?: Array<components.Cancellation> | undefined;
|
|
103
105
|
refundedAmount?: components.Amount | undefined;
|
|
104
106
|
refunds?: Array<components.CardAcquiringRefund> | undefined;
|
|
105
107
|
disputedAmount?: components.Amount | undefined;
|
|
@@ -133,6 +135,7 @@ export class Transfer extends Error {
|
|
|
133
135
|
if (err.moovFeeDecimal != null) this.moovFeeDecimal = err.moovFeeDecimal;
|
|
134
136
|
if (err.moovFeeDetails != null) this.moovFeeDetails = err.moovFeeDetails;
|
|
135
137
|
if (err.groupID != null) this.groupID = err.groupID;
|
|
138
|
+
if (err.cancellations != null) this.cancellations = err.cancellations;
|
|
136
139
|
if (err.refundedAmount != null) this.refundedAmount = err.refundedAmount;
|
|
137
140
|
if (err.refunds != null) this.refunds = err.refunds;
|
|
138
141
|
if (err.disputedAmount != null) this.disputedAmount = err.disputedAmount;
|
|
@@ -167,6 +170,7 @@ export const Transfer$inboundSchema: z.ZodType<
|
|
|
167
170
|
moovFeeDecimal: z.string().optional(),
|
|
168
171
|
moovFeeDetails: components.MoovFeeDetails$inboundSchema.optional(),
|
|
169
172
|
groupID: z.string().optional(),
|
|
173
|
+
cancellations: z.array(components.Cancellation$inboundSchema).optional(),
|
|
170
174
|
refundedAmount: components.Amount$inboundSchema.optional(),
|
|
171
175
|
refunds: z.array(components.CardAcquiringRefund$inboundSchema).optional(),
|
|
172
176
|
disputedAmount: components.Amount$inboundSchema.optional(),
|
|
@@ -196,6 +200,7 @@ export type Transfer$Outbound = {
|
|
|
196
200
|
moovFeeDecimal?: string | undefined;
|
|
197
201
|
moovFeeDetails?: components.MoovFeeDetails$Outbound | undefined;
|
|
198
202
|
groupID?: string | undefined;
|
|
203
|
+
cancellations?: Array<components.Cancellation$Outbound> | undefined;
|
|
199
204
|
refundedAmount?: components.Amount$Outbound | undefined;
|
|
200
205
|
refunds?: Array<components.CardAcquiringRefund$Outbound> | undefined;
|
|
201
206
|
disputedAmount?: components.Amount$Outbound | undefined;
|
|
@@ -228,6 +233,7 @@ export const Transfer$outboundSchema: z.ZodType<
|
|
|
228
233
|
moovFeeDecimal: z.string().optional(),
|
|
229
234
|
moovFeeDetails: components.MoovFeeDetails$outboundSchema.optional(),
|
|
230
235
|
groupID: z.string().optional(),
|
|
236
|
+
cancellations: z.array(components.Cancellation$outboundSchema).optional(),
|
|
231
237
|
refundedAmount: components.Amount$outboundSchema.optional(),
|
|
232
238
|
refunds: z.array(components.CardAcquiringRefund$outboundSchema).optional(),
|
|
233
239
|
disputedAmount: components.Amount$outboundSchema.optional(),
|