@moovio/sdk 0.5.4 → 0.6.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 +19 -8
- package/bin/mcp-server.js +488 -106
- package/bin/mcp-server.js.map +18 -12
- package/docs/sdks/transfers/README.md +185 -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/cli/start/command.d.ts.map +1 -1
- package/mcp-server/cli/start/command.js +9 -0
- package/mcp-server/cli/start/command.js.map +1 -1
- package/mcp-server/cli/start/impl.d.ts +1 -0
- package/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/mcp-server/cli/start/impl.js +2 -0
- package/mcp-server/cli/start/impl.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts +1 -0
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +7 -2
- package/mcp-server/server.js.map +1 -1
- 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/mcp-server/tools.d.ts +1 -1
- package/mcp-server/tools.d.ts.map +1 -1
- package/mcp-server/tools.js +4 -1
- package/mcp-server/tools.js.map +1 -1
- 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/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/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 +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/package.json +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/transfersCreateCancellation.ts +184 -0
- package/src/funcs/transfersGetCancellation.ts +183 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/cli/start/command.ts +9 -0
- package/src/mcp-server/cli/start/impl.ts +3 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +14 -2
- package/src/mcp-server/tools/transfersCreateCancellation.ts +38 -0
- package/src/mcp-server/tools/transfersGetCancellation.ts +38 -0
- package/src/mcp-server/tools.ts +5 -0
- package/src/models/components/transfer.ts +10 -0
- package/src/models/errors/transfer.ts +6 -0
- package/src/models/operations/createcancellation.ts +229 -0
- package/src/models/operations/getcancellation.ts +236 -0
- package/src/models/operations/index.ts +2 -0
- package/src/sdk/transfers.ts +36 -0
|
@@ -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(),
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as components from "../components/index.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type CreateCancellationGlobals = {
|
|
13
|
+
/**
|
|
14
|
+
* Specify an API version.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*
|
|
18
|
+
* API versioning follows the format `vYYYY.QQ.BB`, where
|
|
19
|
+
* - `YYYY` is the year
|
|
20
|
+
* - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
|
|
21
|
+
* - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter.
|
|
22
|
+
* - For example, `v2024.01.00` is the initial release of the first quarter of 2024.
|
|
23
|
+
*
|
|
24
|
+
* The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
|
|
25
|
+
*/
|
|
26
|
+
xMoovVersion?: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type CreateCancellationRequest = {
|
|
30
|
+
/**
|
|
31
|
+
* The partner's Moov account ID.
|
|
32
|
+
*/
|
|
33
|
+
accountID: string;
|
|
34
|
+
/**
|
|
35
|
+
* The transfer ID to cancel.
|
|
36
|
+
*/
|
|
37
|
+
transferID: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type CreateCancellationResponse = {
|
|
41
|
+
headers: { [k: string]: Array<string> };
|
|
42
|
+
result: components.Cancellation;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const CreateCancellationGlobals$inboundSchema: z.ZodType<
|
|
47
|
+
CreateCancellationGlobals,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
unknown
|
|
50
|
+
> = z.object({
|
|
51
|
+
"x-moov-version": z.string().default("v2024.01.00"),
|
|
52
|
+
}).transform((v) => {
|
|
53
|
+
return remap$(v, {
|
|
54
|
+
"x-moov-version": "xMoovVersion",
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export type CreateCancellationGlobals$Outbound = {
|
|
60
|
+
"x-moov-version": string;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
export const CreateCancellationGlobals$outboundSchema: z.ZodType<
|
|
65
|
+
CreateCancellationGlobals$Outbound,
|
|
66
|
+
z.ZodTypeDef,
|
|
67
|
+
CreateCancellationGlobals
|
|
68
|
+
> = z.object({
|
|
69
|
+
xMoovVersion: z.string().default("v2024.01.00"),
|
|
70
|
+
}).transform((v) => {
|
|
71
|
+
return remap$(v, {
|
|
72
|
+
xMoovVersion: "x-moov-version",
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
79
|
+
*/
|
|
80
|
+
export namespace CreateCancellationGlobals$ {
|
|
81
|
+
/** @deprecated use `CreateCancellationGlobals$inboundSchema` instead. */
|
|
82
|
+
export const inboundSchema = CreateCancellationGlobals$inboundSchema;
|
|
83
|
+
/** @deprecated use `CreateCancellationGlobals$outboundSchema` instead. */
|
|
84
|
+
export const outboundSchema = CreateCancellationGlobals$outboundSchema;
|
|
85
|
+
/** @deprecated use `CreateCancellationGlobals$Outbound` instead. */
|
|
86
|
+
export type Outbound = CreateCancellationGlobals$Outbound;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function createCancellationGlobalsToJSON(
|
|
90
|
+
createCancellationGlobals: CreateCancellationGlobals,
|
|
91
|
+
): string {
|
|
92
|
+
return JSON.stringify(
|
|
93
|
+
CreateCancellationGlobals$outboundSchema.parse(createCancellationGlobals),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function createCancellationGlobalsFromJSON(
|
|
98
|
+
jsonString: string,
|
|
99
|
+
): SafeParseResult<CreateCancellationGlobals, SDKValidationError> {
|
|
100
|
+
return safeParse(
|
|
101
|
+
jsonString,
|
|
102
|
+
(x) => CreateCancellationGlobals$inboundSchema.parse(JSON.parse(x)),
|
|
103
|
+
`Failed to parse 'CreateCancellationGlobals' from JSON`,
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** @internal */
|
|
108
|
+
export const CreateCancellationRequest$inboundSchema: z.ZodType<
|
|
109
|
+
CreateCancellationRequest,
|
|
110
|
+
z.ZodTypeDef,
|
|
111
|
+
unknown
|
|
112
|
+
> = z.object({
|
|
113
|
+
accountID: z.string(),
|
|
114
|
+
transferID: z.string(),
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
/** @internal */
|
|
118
|
+
export type CreateCancellationRequest$Outbound = {
|
|
119
|
+
accountID: string;
|
|
120
|
+
transferID: string;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/** @internal */
|
|
124
|
+
export const CreateCancellationRequest$outboundSchema: z.ZodType<
|
|
125
|
+
CreateCancellationRequest$Outbound,
|
|
126
|
+
z.ZodTypeDef,
|
|
127
|
+
CreateCancellationRequest
|
|
128
|
+
> = z.object({
|
|
129
|
+
accountID: z.string(),
|
|
130
|
+
transferID: z.string(),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
136
|
+
*/
|
|
137
|
+
export namespace CreateCancellationRequest$ {
|
|
138
|
+
/** @deprecated use `CreateCancellationRequest$inboundSchema` instead. */
|
|
139
|
+
export const inboundSchema = CreateCancellationRequest$inboundSchema;
|
|
140
|
+
/** @deprecated use `CreateCancellationRequest$outboundSchema` instead. */
|
|
141
|
+
export const outboundSchema = CreateCancellationRequest$outboundSchema;
|
|
142
|
+
/** @deprecated use `CreateCancellationRequest$Outbound` instead. */
|
|
143
|
+
export type Outbound = CreateCancellationRequest$Outbound;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function createCancellationRequestToJSON(
|
|
147
|
+
createCancellationRequest: CreateCancellationRequest,
|
|
148
|
+
): string {
|
|
149
|
+
return JSON.stringify(
|
|
150
|
+
CreateCancellationRequest$outboundSchema.parse(createCancellationRequest),
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function createCancellationRequestFromJSON(
|
|
155
|
+
jsonString: string,
|
|
156
|
+
): SafeParseResult<CreateCancellationRequest, SDKValidationError> {
|
|
157
|
+
return safeParse(
|
|
158
|
+
jsonString,
|
|
159
|
+
(x) => CreateCancellationRequest$inboundSchema.parse(JSON.parse(x)),
|
|
160
|
+
`Failed to parse 'CreateCancellationRequest' from JSON`,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** @internal */
|
|
165
|
+
export const CreateCancellationResponse$inboundSchema: z.ZodType<
|
|
166
|
+
CreateCancellationResponse,
|
|
167
|
+
z.ZodTypeDef,
|
|
168
|
+
unknown
|
|
169
|
+
> = z.object({
|
|
170
|
+
Headers: z.record(z.array(z.string())),
|
|
171
|
+
Result: components.Cancellation$inboundSchema,
|
|
172
|
+
}).transform((v) => {
|
|
173
|
+
return remap$(v, {
|
|
174
|
+
"Headers": "headers",
|
|
175
|
+
"Result": "result",
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
/** @internal */
|
|
180
|
+
export type CreateCancellationResponse$Outbound = {
|
|
181
|
+
Headers: { [k: string]: Array<string> };
|
|
182
|
+
Result: components.Cancellation$Outbound;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/** @internal */
|
|
186
|
+
export const CreateCancellationResponse$outboundSchema: z.ZodType<
|
|
187
|
+
CreateCancellationResponse$Outbound,
|
|
188
|
+
z.ZodTypeDef,
|
|
189
|
+
CreateCancellationResponse
|
|
190
|
+
> = z.object({
|
|
191
|
+
headers: z.record(z.array(z.string())),
|
|
192
|
+
result: components.Cancellation$outboundSchema,
|
|
193
|
+
}).transform((v) => {
|
|
194
|
+
return remap$(v, {
|
|
195
|
+
headers: "Headers",
|
|
196
|
+
result: "Result",
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @internal
|
|
202
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
203
|
+
*/
|
|
204
|
+
export namespace CreateCancellationResponse$ {
|
|
205
|
+
/** @deprecated use `CreateCancellationResponse$inboundSchema` instead. */
|
|
206
|
+
export const inboundSchema = CreateCancellationResponse$inboundSchema;
|
|
207
|
+
/** @deprecated use `CreateCancellationResponse$outboundSchema` instead. */
|
|
208
|
+
export const outboundSchema = CreateCancellationResponse$outboundSchema;
|
|
209
|
+
/** @deprecated use `CreateCancellationResponse$Outbound` instead. */
|
|
210
|
+
export type Outbound = CreateCancellationResponse$Outbound;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export function createCancellationResponseToJSON(
|
|
214
|
+
createCancellationResponse: CreateCancellationResponse,
|
|
215
|
+
): string {
|
|
216
|
+
return JSON.stringify(
|
|
217
|
+
CreateCancellationResponse$outboundSchema.parse(createCancellationResponse),
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export function createCancellationResponseFromJSON(
|
|
222
|
+
jsonString: string,
|
|
223
|
+
): SafeParseResult<CreateCancellationResponse, SDKValidationError> {
|
|
224
|
+
return safeParse(
|
|
225
|
+
jsonString,
|
|
226
|
+
(x) => CreateCancellationResponse$inboundSchema.parse(JSON.parse(x)),
|
|
227
|
+
`Failed to parse 'CreateCancellationResponse' from JSON`,
|
|
228
|
+
);
|
|
229
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as components from "../components/index.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type GetCancellationGlobals = {
|
|
13
|
+
/**
|
|
14
|
+
* Specify an API version.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*
|
|
18
|
+
* API versioning follows the format `vYYYY.QQ.BB`, where
|
|
19
|
+
* - `YYYY` is the year
|
|
20
|
+
* - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
|
|
21
|
+
* - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter.
|
|
22
|
+
* - For example, `v2024.01.00` is the initial release of the first quarter of 2024.
|
|
23
|
+
*
|
|
24
|
+
* The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
|
|
25
|
+
*/
|
|
26
|
+
xMoovVersion?: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type GetCancellationRequest = {
|
|
30
|
+
/**
|
|
31
|
+
* Moov account ID of the partner or transfer's source or destination.
|
|
32
|
+
*/
|
|
33
|
+
accountID: string;
|
|
34
|
+
/**
|
|
35
|
+
* Identifier for the transfer.
|
|
36
|
+
*/
|
|
37
|
+
transferID: string;
|
|
38
|
+
/**
|
|
39
|
+
* Identifier for the cancellation.
|
|
40
|
+
*/
|
|
41
|
+
cancellationID: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type GetCancellationResponse = {
|
|
45
|
+
headers: { [k: string]: Array<string> };
|
|
46
|
+
result: components.Cancellation;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const GetCancellationGlobals$inboundSchema: z.ZodType<
|
|
51
|
+
GetCancellationGlobals,
|
|
52
|
+
z.ZodTypeDef,
|
|
53
|
+
unknown
|
|
54
|
+
> = z.object({
|
|
55
|
+
"x-moov-version": z.string().default("v2024.01.00"),
|
|
56
|
+
}).transform((v) => {
|
|
57
|
+
return remap$(v, {
|
|
58
|
+
"x-moov-version": "xMoovVersion",
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
/** @internal */
|
|
63
|
+
export type GetCancellationGlobals$Outbound = {
|
|
64
|
+
"x-moov-version": string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const GetCancellationGlobals$outboundSchema: z.ZodType<
|
|
69
|
+
GetCancellationGlobals$Outbound,
|
|
70
|
+
z.ZodTypeDef,
|
|
71
|
+
GetCancellationGlobals
|
|
72
|
+
> = z.object({
|
|
73
|
+
xMoovVersion: z.string().default("v2024.01.00"),
|
|
74
|
+
}).transform((v) => {
|
|
75
|
+
return remap$(v, {
|
|
76
|
+
xMoovVersion: "x-moov-version",
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
83
|
+
*/
|
|
84
|
+
export namespace GetCancellationGlobals$ {
|
|
85
|
+
/** @deprecated use `GetCancellationGlobals$inboundSchema` instead. */
|
|
86
|
+
export const inboundSchema = GetCancellationGlobals$inboundSchema;
|
|
87
|
+
/** @deprecated use `GetCancellationGlobals$outboundSchema` instead. */
|
|
88
|
+
export const outboundSchema = GetCancellationGlobals$outboundSchema;
|
|
89
|
+
/** @deprecated use `GetCancellationGlobals$Outbound` instead. */
|
|
90
|
+
export type Outbound = GetCancellationGlobals$Outbound;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function getCancellationGlobalsToJSON(
|
|
94
|
+
getCancellationGlobals: GetCancellationGlobals,
|
|
95
|
+
): string {
|
|
96
|
+
return JSON.stringify(
|
|
97
|
+
GetCancellationGlobals$outboundSchema.parse(getCancellationGlobals),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function getCancellationGlobalsFromJSON(
|
|
102
|
+
jsonString: string,
|
|
103
|
+
): SafeParseResult<GetCancellationGlobals, SDKValidationError> {
|
|
104
|
+
return safeParse(
|
|
105
|
+
jsonString,
|
|
106
|
+
(x) => GetCancellationGlobals$inboundSchema.parse(JSON.parse(x)),
|
|
107
|
+
`Failed to parse 'GetCancellationGlobals' from JSON`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const GetCancellationRequest$inboundSchema: z.ZodType<
|
|
113
|
+
GetCancellationRequest,
|
|
114
|
+
z.ZodTypeDef,
|
|
115
|
+
unknown
|
|
116
|
+
> = z.object({
|
|
117
|
+
accountID: z.string(),
|
|
118
|
+
transferID: z.string(),
|
|
119
|
+
cancellationID: z.string(),
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
/** @internal */
|
|
123
|
+
export type GetCancellationRequest$Outbound = {
|
|
124
|
+
accountID: string;
|
|
125
|
+
transferID: string;
|
|
126
|
+
cancellationID: string;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/** @internal */
|
|
130
|
+
export const GetCancellationRequest$outboundSchema: z.ZodType<
|
|
131
|
+
GetCancellationRequest$Outbound,
|
|
132
|
+
z.ZodTypeDef,
|
|
133
|
+
GetCancellationRequest
|
|
134
|
+
> = z.object({
|
|
135
|
+
accountID: z.string(),
|
|
136
|
+
transferID: z.string(),
|
|
137
|
+
cancellationID: z.string(),
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @internal
|
|
142
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
143
|
+
*/
|
|
144
|
+
export namespace GetCancellationRequest$ {
|
|
145
|
+
/** @deprecated use `GetCancellationRequest$inboundSchema` instead. */
|
|
146
|
+
export const inboundSchema = GetCancellationRequest$inboundSchema;
|
|
147
|
+
/** @deprecated use `GetCancellationRequest$outboundSchema` instead. */
|
|
148
|
+
export const outboundSchema = GetCancellationRequest$outboundSchema;
|
|
149
|
+
/** @deprecated use `GetCancellationRequest$Outbound` instead. */
|
|
150
|
+
export type Outbound = GetCancellationRequest$Outbound;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function getCancellationRequestToJSON(
|
|
154
|
+
getCancellationRequest: GetCancellationRequest,
|
|
155
|
+
): string {
|
|
156
|
+
return JSON.stringify(
|
|
157
|
+
GetCancellationRequest$outboundSchema.parse(getCancellationRequest),
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function getCancellationRequestFromJSON(
|
|
162
|
+
jsonString: string,
|
|
163
|
+
): SafeParseResult<GetCancellationRequest, SDKValidationError> {
|
|
164
|
+
return safeParse(
|
|
165
|
+
jsonString,
|
|
166
|
+
(x) => GetCancellationRequest$inboundSchema.parse(JSON.parse(x)),
|
|
167
|
+
`Failed to parse 'GetCancellationRequest' from JSON`,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** @internal */
|
|
172
|
+
export const GetCancellationResponse$inboundSchema: z.ZodType<
|
|
173
|
+
GetCancellationResponse,
|
|
174
|
+
z.ZodTypeDef,
|
|
175
|
+
unknown
|
|
176
|
+
> = z.object({
|
|
177
|
+
Headers: z.record(z.array(z.string())),
|
|
178
|
+
Result: components.Cancellation$inboundSchema,
|
|
179
|
+
}).transform((v) => {
|
|
180
|
+
return remap$(v, {
|
|
181
|
+
"Headers": "headers",
|
|
182
|
+
"Result": "result",
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
/** @internal */
|
|
187
|
+
export type GetCancellationResponse$Outbound = {
|
|
188
|
+
Headers: { [k: string]: Array<string> };
|
|
189
|
+
Result: components.Cancellation$Outbound;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/** @internal */
|
|
193
|
+
export const GetCancellationResponse$outboundSchema: z.ZodType<
|
|
194
|
+
GetCancellationResponse$Outbound,
|
|
195
|
+
z.ZodTypeDef,
|
|
196
|
+
GetCancellationResponse
|
|
197
|
+
> = z.object({
|
|
198
|
+
headers: z.record(z.array(z.string())),
|
|
199
|
+
result: components.Cancellation$outboundSchema,
|
|
200
|
+
}).transform((v) => {
|
|
201
|
+
return remap$(v, {
|
|
202
|
+
headers: "Headers",
|
|
203
|
+
result: "Result",
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* @internal
|
|
209
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
210
|
+
*/
|
|
211
|
+
export namespace GetCancellationResponse$ {
|
|
212
|
+
/** @deprecated use `GetCancellationResponse$inboundSchema` instead. */
|
|
213
|
+
export const inboundSchema = GetCancellationResponse$inboundSchema;
|
|
214
|
+
/** @deprecated use `GetCancellationResponse$outboundSchema` instead. */
|
|
215
|
+
export const outboundSchema = GetCancellationResponse$outboundSchema;
|
|
216
|
+
/** @deprecated use `GetCancellationResponse$Outbound` instead. */
|
|
217
|
+
export type Outbound = GetCancellationResponse$Outbound;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export function getCancellationResponseToJSON(
|
|
221
|
+
getCancellationResponse: GetCancellationResponse,
|
|
222
|
+
): string {
|
|
223
|
+
return JSON.stringify(
|
|
224
|
+
GetCancellationResponse$outboundSchema.parse(getCancellationResponse),
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export function getCancellationResponseFromJSON(
|
|
229
|
+
jsonString: string,
|
|
230
|
+
): SafeParseResult<GetCancellationResponse, SDKValidationError> {
|
|
231
|
+
return safeParse(
|
|
232
|
+
jsonString,
|
|
233
|
+
(x) => GetCancellationResponse$inboundSchema.parse(JSON.parse(x)),
|
|
234
|
+
`Failed to parse 'GetCancellationResponse' from JSON`,
|
|
235
|
+
);
|
|
236
|
+
}
|
|
@@ -11,6 +11,7 @@ export * from "./createaccesstoken.js";
|
|
|
11
11
|
export * from "./createaccount.js";
|
|
12
12
|
export * from "./createapplepaysession.js";
|
|
13
13
|
export * from "./createbrand.js";
|
|
14
|
+
export * from "./createcancellation.js";
|
|
14
15
|
export * from "./createfeeplanagreements.js";
|
|
15
16
|
export * from "./createonboardinginvite.js";
|
|
16
17
|
export * from "./createpaymentlink.js";
|
|
@@ -38,6 +39,7 @@ export * from "./getavatar.js";
|
|
|
38
39
|
export * from "./getbankaccount.js";
|
|
39
40
|
export * from "./getbankaccountverification.js";
|
|
40
41
|
export * from "./getbrand.js";
|
|
42
|
+
export * from "./getcancellation.js";
|
|
41
43
|
export * from "./getcapability.js";
|
|
42
44
|
export * from "./getcard.js";
|
|
43
45
|
export * from "./getdispute.js";
|
package/src/sdk/transfers.ts
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { transfersCreate } from "../funcs/transfersCreate.js";
|
|
6
|
+
import { transfersCreateCancellation } from "../funcs/transfersCreateCancellation.js";
|
|
6
7
|
import { transfersCreateReversal } from "../funcs/transfersCreateReversal.js";
|
|
7
8
|
import { transfersGenerateOptions } from "../funcs/transfersGenerateOptions.js";
|
|
8
9
|
import { transfersGet } from "../funcs/transfersGet.js";
|
|
10
|
+
import { transfersGetCancellation } from "../funcs/transfersGetCancellation.js";
|
|
9
11
|
import { transfersGetRefund } from "../funcs/transfersGetRefund.js";
|
|
10
12
|
import { transfersInitiateRefund } from "../funcs/transfersInitiateRefund.js";
|
|
11
13
|
import { transfersList } from "../funcs/transfersList.js";
|
|
@@ -99,6 +101,40 @@ export class Transfers extends ClientSDK {
|
|
|
99
101
|
));
|
|
100
102
|
}
|
|
101
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Initiate a cancellation for a card, ACH, or queued transfer.
|
|
106
|
+
*
|
|
107
|
+
* To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
|
|
108
|
+
* to specify the `/accounts/{accountID}/transfers.write` scope.
|
|
109
|
+
*/
|
|
110
|
+
async createCancellation(
|
|
111
|
+
request: operations.CreateCancellationRequest,
|
|
112
|
+
options?: RequestOptions,
|
|
113
|
+
): Promise<operations.CreateCancellationResponse> {
|
|
114
|
+
return unwrapAsync(transfersCreateCancellation(
|
|
115
|
+
this,
|
|
116
|
+
request,
|
|
117
|
+
options,
|
|
118
|
+
));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Get details of a cancellation for a transfer.
|
|
123
|
+
*
|
|
124
|
+
* To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
|
|
125
|
+
* to specify the `/accounts/{accountID}/transfers.read` scope.
|
|
126
|
+
*/
|
|
127
|
+
async getCancellation(
|
|
128
|
+
request: operations.GetCancellationRequest,
|
|
129
|
+
options?: RequestOptions,
|
|
130
|
+
): Promise<operations.GetCancellationResponse> {
|
|
131
|
+
return unwrapAsync(transfersGetCancellation(
|
|
132
|
+
this,
|
|
133
|
+
request,
|
|
134
|
+
options,
|
|
135
|
+
));
|
|
136
|
+
}
|
|
137
|
+
|
|
102
138
|
/**
|
|
103
139
|
* Initiate a refund for a card transfer.
|
|
104
140
|
*
|