@moovio/sdk 0.22.9 → 0.22.11

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.
Files changed (95) hide show
  1. package/README.md +59 -64
  2. package/bin/mcp-server.js +549 -790
  3. package/bin/mcp-server.js.map +15 -20
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/imagesDelete.d.ts +4 -1
  6. package/funcs/imagesDelete.d.ts.map +1 -1
  7. package/funcs/imagesDelete.js +4 -1
  8. package/funcs/imagesDelete.js.map +1 -1
  9. package/jsr.json +1 -1
  10. package/lib/config.d.ts +3 -3
  11. package/lib/config.js +3 -3
  12. package/lib/config.js.map +1 -1
  13. package/mcp-server/mcp-server.js +1 -1
  14. package/mcp-server/mcp-server.js.map +1 -1
  15. package/mcp-server/server.d.ts.map +1 -1
  16. package/mcp-server/server.js +1 -3
  17. package/mcp-server/server.js.map +1 -1
  18. package/mcp-server/tools/imagesDelete.d.ts.map +1 -1
  19. package/mcp-server/tools/imagesDelete.js +4 -1
  20. package/mcp-server/tools/imagesDelete.js.map +1 -1
  21. package/models/components/imagemetadata.d.ts +2 -0
  22. package/models/components/imagemetadata.d.ts.map +1 -1
  23. package/models/components/imagemetadata.js +3 -0
  24. package/models/components/imagemetadata.js.map +1 -1
  25. package/models/components/index.d.ts +0 -1
  26. package/models/components/index.d.ts.map +1 -1
  27. package/models/components/index.js +0 -1
  28. package/models/components/index.js.map +1 -1
  29. package/models/components/transfer.d.ts +5 -0
  30. package/models/components/transfer.d.ts.map +1 -1
  31. package/models/components/transfer.js +2 -0
  32. package/models/components/transfer.js.map +1 -1
  33. package/models/components/updateinvoice.d.ts +5 -1
  34. package/models/components/updateinvoice.d.ts.map +1 -1
  35. package/models/components/updateinvoice.js.map +1 -1
  36. package/models/errors/index.d.ts +0 -1
  37. package/models/errors/index.d.ts.map +1 -1
  38. package/models/errors/index.js +0 -1
  39. package/models/errors/index.js.map +1 -1
  40. package/models/errors/transfer.d.ts +9 -0
  41. package/models/errors/transfer.d.ts.map +1 -1
  42. package/models/errors/transfer.js +4 -0
  43. package/models/errors/transfer.js.map +1 -1
  44. package/models/operations/index.d.ts +0 -1
  45. package/models/operations/index.d.ts.map +1 -1
  46. package/models/operations/index.js +0 -1
  47. package/models/operations/index.js.map +1 -1
  48. package/package.json +1 -1
  49. package/sdk/images.d.ts +4 -1
  50. package/sdk/images.d.ts.map +1 -1
  51. package/sdk/images.js +4 -1
  52. package/sdk/images.js.map +1 -1
  53. package/sdk/invoices.d.ts +0 -8
  54. package/sdk/invoices.d.ts.map +1 -1
  55. package/sdk/invoices.js +0 -11
  56. package/sdk/invoices.js.map +1 -1
  57. package/src/funcs/imagesDelete.ts +4 -1
  58. package/src/lib/config.ts +3 -3
  59. package/src/mcp-server/mcp-server.ts +1 -1
  60. package/src/mcp-server/server.ts +1 -3
  61. package/src/mcp-server/tools/imagesDelete.ts +4 -1
  62. package/src/models/components/imagemetadata.ts +5 -0
  63. package/src/models/components/index.ts +0 -1
  64. package/src/models/components/transfer.ts +7 -0
  65. package/src/models/components/updateinvoice.ts +5 -1
  66. package/src/models/errors/index.ts +0 -1
  67. package/src/models/errors/transfer.ts +12 -0
  68. package/src/models/operations/index.ts +0 -1
  69. package/src/sdk/images.ts +4 -1
  70. package/src/sdk/invoices.ts +0 -19
  71. package/funcs/invoicesMarkPaidInvoice.d.ts +0 -19
  72. package/funcs/invoicesMarkPaidInvoice.d.ts.map +0 -1
  73. package/funcs/invoicesMarkPaidInvoice.js +0 -144
  74. package/funcs/invoicesMarkPaidInvoice.js.map +0 -1
  75. package/mcp-server/tools/invoicesMarkPaidInvoice.d.ts +0 -8
  76. package/mcp-server/tools/invoicesMarkPaidInvoice.d.ts.map +0 -1
  77. package/mcp-server/tools/invoicesMarkPaidInvoice.js +0 -66
  78. package/mcp-server/tools/invoicesMarkPaidInvoice.js.map +0 -1
  79. package/models/components/markinvoicepaid.d.ts +0 -21
  80. package/models/components/markinvoicepaid.d.ts.map +0 -1
  81. package/models/components/markinvoicepaid.js +0 -63
  82. package/models/components/markinvoicepaid.js.map +0 -1
  83. package/models/errors/markinvoicepaiderror.d.ts +0 -30
  84. package/models/errors/markinvoicepaiderror.d.ts.map +0 -1
  85. package/models/errors/markinvoicepaiderror.js +0 -83
  86. package/models/errors/markinvoicepaiderror.js.map +0 -1
  87. package/models/operations/markpaidinvoice.d.ts +0 -68
  88. package/models/operations/markpaidinvoice.d.ts.map +0 -1
  89. package/models/operations/markpaidinvoice.js +0 -124
  90. package/models/operations/markpaidinvoice.js.map +0 -1
  91. package/src/funcs/invoicesMarkPaidInvoice.ts +0 -208
  92. package/src/mcp-server/tools/invoicesMarkPaidInvoice.ts +0 -39
  93. package/src/models/components/markinvoicepaid.ts +0 -58
  94. package/src/models/errors/markinvoicepaiderror.ts +0 -78
  95. package/src/models/operations/markpaidinvoice.ts +0 -191
@@ -1,124 +0,0 @@
1
- "use strict";
2
- /*
3
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.MarkPaidInvoiceResponse$outboundSchema = exports.MarkPaidInvoiceResponse$inboundSchema = exports.MarkPaidInvoiceRequest$outboundSchema = exports.MarkPaidInvoiceRequest$inboundSchema = exports.MarkPaidInvoiceGlobals$outboundSchema = exports.MarkPaidInvoiceGlobals$inboundSchema = void 0;
40
- exports.markPaidInvoiceGlobalsToJSON = markPaidInvoiceGlobalsToJSON;
41
- exports.markPaidInvoiceGlobalsFromJSON = markPaidInvoiceGlobalsFromJSON;
42
- exports.markPaidInvoiceRequestToJSON = markPaidInvoiceRequestToJSON;
43
- exports.markPaidInvoiceRequestFromJSON = markPaidInvoiceRequestFromJSON;
44
- exports.markPaidInvoiceResponseToJSON = markPaidInvoiceResponseToJSON;
45
- exports.markPaidInvoiceResponseFromJSON = markPaidInvoiceResponseFromJSON;
46
- const z = __importStar(require("zod/v3"));
47
- const primitives_js_1 = require("../../lib/primitives.js");
48
- const schemas_js_1 = require("../../lib/schemas.js");
49
- const components = __importStar(require("../components/index.js"));
50
- /** @internal */
51
- exports.MarkPaidInvoiceGlobals$inboundSchema = z.object({
52
- "X-Moov-Version": z.string().optional(),
53
- }).transform((v) => {
54
- return (0, primitives_js_1.remap)(v, {
55
- "X-Moov-Version": "xMoovVersion",
56
- });
57
- });
58
- /** @internal */
59
- exports.MarkPaidInvoiceGlobals$outboundSchema = z.object({
60
- xMoovVersion: z.string().optional(),
61
- }).transform((v) => {
62
- return (0, primitives_js_1.remap)(v, {
63
- xMoovVersion: "X-Moov-Version",
64
- });
65
- });
66
- function markPaidInvoiceGlobalsToJSON(markPaidInvoiceGlobals) {
67
- return JSON.stringify(exports.MarkPaidInvoiceGlobals$outboundSchema.parse(markPaidInvoiceGlobals));
68
- }
69
- function markPaidInvoiceGlobalsFromJSON(jsonString) {
70
- return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MarkPaidInvoiceGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MarkPaidInvoiceGlobals' from JSON`);
71
- }
72
- /** @internal */
73
- exports.MarkPaidInvoiceRequest$inboundSchema = z.object({
74
- accountID: z.string(),
75
- invoiceID: z.string(),
76
- MarkInvoicePaid: components.MarkInvoicePaid$inboundSchema,
77
- }).transform((v) => {
78
- return (0, primitives_js_1.remap)(v, {
79
- "MarkInvoicePaid": "markInvoicePaid",
80
- });
81
- });
82
- /** @internal */
83
- exports.MarkPaidInvoiceRequest$outboundSchema = z.object({
84
- accountID: z.string(),
85
- invoiceID: z.string(),
86
- markInvoicePaid: components.MarkInvoicePaid$outboundSchema,
87
- }).transform((v) => {
88
- return (0, primitives_js_1.remap)(v, {
89
- markInvoicePaid: "MarkInvoicePaid",
90
- });
91
- });
92
- function markPaidInvoiceRequestToJSON(markPaidInvoiceRequest) {
93
- return JSON.stringify(exports.MarkPaidInvoiceRequest$outboundSchema.parse(markPaidInvoiceRequest));
94
- }
95
- function markPaidInvoiceRequestFromJSON(jsonString) {
96
- return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MarkPaidInvoiceRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MarkPaidInvoiceRequest' from JSON`);
97
- }
98
- /** @internal */
99
- exports.MarkPaidInvoiceResponse$inboundSchema = z.object({
100
- Headers: z.record(z.array(z.string())).default({}),
101
- Result: components.Invoice$inboundSchema,
102
- }).transform((v) => {
103
- return (0, primitives_js_1.remap)(v, {
104
- "Headers": "headers",
105
- "Result": "result",
106
- });
107
- });
108
- /** @internal */
109
- exports.MarkPaidInvoiceResponse$outboundSchema = z.object({
110
- headers: z.record(z.array(z.string())),
111
- result: components.Invoice$outboundSchema,
112
- }).transform((v) => {
113
- return (0, primitives_js_1.remap)(v, {
114
- headers: "Headers",
115
- result: "Result",
116
- });
117
- });
118
- function markPaidInvoiceResponseToJSON(markPaidInvoiceResponse) {
119
- return JSON.stringify(exports.MarkPaidInvoiceResponse$outboundSchema.parse(markPaidInvoiceResponse));
120
- }
121
- function markPaidInvoiceResponseFromJSON(jsonString) {
122
- return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.MarkPaidInvoiceResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MarkPaidInvoiceResponse' from JSON`);
123
- }
124
- //# sourceMappingURL=markpaidinvoice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markpaidinvoice.js","sourceRoot":"","sources":["../../src/models/operations/markpaidinvoice.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEH,oEAMC;AACD,wEAQC;AAsCD,oEAMC;AACD,wEAQC;AAqCD,sEAMC;AACD,0EAQC;AA1LD,0CAA4B;AAC5B,2DAA0D;AAC1D,qDAAiD;AAEjD,mEAAqD;AAgCrD,gBAAgB;AACH,QAAA,oCAAoC,GAI7C,CAAC,CAAC,MAAM,CAAC;IACX,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,gBAAgB,EAAE,cAAc;KACjC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAMH,gBAAgB;AACH,QAAA,qCAAqC,GAI9C,CAAC,CAAC,MAAM,CAAC;IACX,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,YAAY,EAAE,gBAAgB;KAC/B,CAAC,CAAC;AACL,CAAC,CA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,EAAE,CAAC,6CAAqC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACjE,qDAAqD,CACtD,CAAC;AACJ,CAAC"}
@@ -1,208 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { MoovCore } from "../core.js";
6
- import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
- import * as M from "../lib/matchers.js";
8
- import { compactMap } from "../lib/primitives.js";
9
- import { safeParse } from "../lib/schemas.js";
10
- import { RequestOptions } from "../lib/sdks.js";
11
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
- import { pathToFunc } from "../lib/url.js";
13
- import {
14
- ConnectionError,
15
- InvalidRequestError,
16
- RequestAbortedError,
17
- RequestTimeoutError,
18
- UnexpectedClientError,
19
- } from "../models/errors/httpclienterrors.js";
20
- import * as errors from "../models/errors/index.js";
21
- import { MoovError } from "../models/errors/mooverror.js";
22
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
- import * as operations from "../models/operations/index.js";
25
- import { APICall, APIPromise } from "../types/async.js";
26
- import { Result } from "../types/fp.js";
27
-
28
- /**
29
- * Marks an invoice as paid outside of the Moov platform.
30
- * If a payment link was created, the corresponding payment link is canceled, but a receipt is still sent.
31
- *
32
- * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
33
- * you'll need to specify the `/accounts/{accountID}/invoices.write` scope.
34
- */
35
- export function invoicesMarkPaidInvoice(
36
- client: MoovCore,
37
- request: operations.MarkPaidInvoiceRequest,
38
- options?: RequestOptions,
39
- ): APIPromise<
40
- Result<
41
- operations.MarkPaidInvoiceResponse,
42
- | errors.GenericError
43
- | errors.MarkInvoicePaidError
44
- | MoovError
45
- | ResponseValidationError
46
- | ConnectionError
47
- | RequestAbortedError
48
- | RequestTimeoutError
49
- | InvalidRequestError
50
- | UnexpectedClientError
51
- | SDKValidationError
52
- >
53
- > {
54
- return new APIPromise($do(
55
- client,
56
- request,
57
- options,
58
- ));
59
- }
60
-
61
- async function $do(
62
- client: MoovCore,
63
- request: operations.MarkPaidInvoiceRequest,
64
- options?: RequestOptions,
65
- ): Promise<
66
- [
67
- Result<
68
- operations.MarkPaidInvoiceResponse,
69
- | errors.GenericError
70
- | errors.MarkInvoicePaidError
71
- | MoovError
72
- | ResponseValidationError
73
- | ConnectionError
74
- | RequestAbortedError
75
- | RequestTimeoutError
76
- | InvalidRequestError
77
- | UnexpectedClientError
78
- | SDKValidationError
79
- >,
80
- APICall,
81
- ]
82
- > {
83
- const parsed = safeParse(
84
- request,
85
- (value) => operations.MarkPaidInvoiceRequest$outboundSchema.parse(value),
86
- "Input validation failed",
87
- );
88
- if (!parsed.ok) {
89
- return [parsed, { status: "invalid" }];
90
- }
91
- const payload = parsed.value;
92
- const body = encodeJSON("body", payload.MarkInvoicePaid, { explode: true });
93
-
94
- const pathParams = {
95
- accountID: encodeSimple("accountID", payload.accountID, {
96
- explode: false,
97
- charEncoding: "percent",
98
- }),
99
- invoiceID: encodeSimple("invoiceID", payload.invoiceID, {
100
- explode: false,
101
- charEncoding: "percent",
102
- }),
103
- };
104
-
105
- const path = pathToFunc(
106
- "/accounts/{accountID}/invoices/{invoiceID}/mark-paid",
107
- )(pathParams);
108
-
109
- const headers = new Headers(compactMap({
110
- "Content-Type": "application/json",
111
- Accept: "application/json",
112
- "X-Moov-Version": encodeSimple(
113
- "X-Moov-Version",
114
- client._options.xMoovVersion,
115
- { explode: false, charEncoding: "none" },
116
- ),
117
- }));
118
-
119
- const securityInput = await extractSecurity(client._options.security);
120
- const requestSecurity = resolveGlobalSecurity(securityInput);
121
-
122
- const context = {
123
- options: client._options,
124
- baseURL: options?.serverURL ?? client._baseURL ?? "",
125
- operationID: "markPaidInvoice",
126
- oAuth2Scopes: null,
127
-
128
- resolvedSecurity: requestSecurity,
129
-
130
- securitySource: client._options.security,
131
- retryConfig: options?.retries
132
- || client._options.retryConfig
133
- || { strategy: "none" },
134
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
135
- };
136
-
137
- const requestRes = client._createRequest(context, {
138
- security: requestSecurity,
139
- method: "POST",
140
- baseURL: options?.serverURL,
141
- path: path,
142
- headers: headers,
143
- body: body,
144
- userAgent: client._options.userAgent,
145
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
146
- }, options);
147
- if (!requestRes.ok) {
148
- return [requestRes, { status: "invalid" }];
149
- }
150
- const req = requestRes.value;
151
-
152
- const doResult = await client._do(req, {
153
- context,
154
- errorCodes: [
155
- "400",
156
- "401",
157
- "403",
158
- "404",
159
- "409",
160
- "422",
161
- "429",
162
- "4XX",
163
- "500",
164
- "504",
165
- "5XX",
166
- ],
167
- retryConfig: context.retryConfig,
168
- retryCodes: context.retryCodes,
169
- });
170
- if (!doResult.ok) {
171
- return [doResult, { status: "request-error", request: req }];
172
- }
173
- const response = doResult.value;
174
-
175
- const responseFields = {
176
- HttpMeta: { Response: response, Request: req },
177
- };
178
-
179
- const [result] = await M.match<
180
- operations.MarkPaidInvoiceResponse,
181
- | errors.GenericError
182
- | errors.MarkInvoicePaidError
183
- | MoovError
184
- | ResponseValidationError
185
- | ConnectionError
186
- | RequestAbortedError
187
- | RequestTimeoutError
188
- | InvalidRequestError
189
- | UnexpectedClientError
190
- | SDKValidationError
191
- >(
192
- M.json(200, operations.MarkPaidInvoiceResponse$inboundSchema, {
193
- hdrs: true,
194
- key: "Result",
195
- }),
196
- M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }),
197
- M.jsonErr(422, errors.MarkInvoicePaidError$inboundSchema, { hdrs: true }),
198
- M.fail([401, 403, 404, 429]),
199
- M.fail([500, 504]),
200
- M.fail("4XX"),
201
- M.fail("5XX"),
202
- )(response, req, { extraFields: responseFields });
203
- if (!result.ok) {
204
- return [result, { status: "complete", request: req, response }];
205
- }
206
-
207
- return [result, { status: "complete", request: req, response }];
208
- }
@@ -1,39 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { invoicesMarkPaidInvoice } from "../../funcs/invoicesMarkPaidInvoice.js";
6
- import * as operations from "../../models/operations/index.js";
7
- import { formatResult, ToolDefinition } from "../tools.js";
8
-
9
- const args = {
10
- request: operations.MarkPaidInvoiceRequest$inboundSchema,
11
- };
12
-
13
- export const tool$invoicesMarkPaidInvoice: ToolDefinition<typeof args> = {
14
- name: "invoices-mark-paid-invoice",
15
- description: `Marks an invoice as paid outside of the Moov platform.
16
- If a payment link was created, the corresponding payment link is canceled, but a receipt is still sent.
17
-
18
- To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
19
- you'll need to specify the \`/accounts/{accountID}/invoices.write\` scope.`,
20
- args,
21
- tool: async (client, args, ctx) => {
22
- const [result, apiCall] = await invoicesMarkPaidInvoice(
23
- client,
24
- args.request,
25
- { fetchOptions: { signal: ctx.signal } },
26
- ).$inspect();
27
-
28
- if (!result.ok) {
29
- return {
30
- content: [{ type: "text", text: result.error.message }],
31
- isError: true,
32
- };
33
- }
34
-
35
- const value = result.value.result;
36
-
37
- return formatResult(value, apiCall);
38
- },
39
- };
@@ -1,58 +0,0 @@
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
- export type MarkInvoicePaid = {
11
- foreignID?: string | undefined;
12
- description?: string | undefined;
13
- paymentDate?: Date | undefined;
14
- };
15
-
16
- /** @internal */
17
- export const MarkInvoicePaid$inboundSchema: z.ZodType<
18
- MarkInvoicePaid,
19
- z.ZodTypeDef,
20
- unknown
21
- > = z.object({
22
- foreignID: z.string().optional(),
23
- description: z.string().optional(),
24
- paymentDate: z.string().datetime({ offset: true }).transform(v => new Date(v))
25
- .optional(),
26
- });
27
- /** @internal */
28
- export type MarkInvoicePaid$Outbound = {
29
- foreignID?: string | undefined;
30
- description?: string | undefined;
31
- paymentDate?: string | undefined;
32
- };
33
-
34
- /** @internal */
35
- export const MarkInvoicePaid$outboundSchema: z.ZodType<
36
- MarkInvoicePaid$Outbound,
37
- z.ZodTypeDef,
38
- MarkInvoicePaid
39
- > = z.object({
40
- foreignID: z.string().optional(),
41
- description: z.string().optional(),
42
- paymentDate: z.date().transform(v => v.toISOString()).optional(),
43
- });
44
-
45
- export function markInvoicePaidToJSON(
46
- markInvoicePaid: MarkInvoicePaid,
47
- ): string {
48
- return JSON.stringify(MarkInvoicePaid$outboundSchema.parse(markInvoicePaid));
49
- }
50
- export function markInvoicePaidFromJSON(
51
- jsonString: string,
52
- ): SafeParseResult<MarkInvoicePaid, SDKValidationError> {
53
- return safeParse(
54
- jsonString,
55
- (x) => MarkInvoicePaid$inboundSchema.parse(JSON.parse(x)),
56
- `Failed to parse 'MarkInvoicePaid' from JSON`,
57
- );
58
- }
@@ -1,78 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { MoovError } from "./mooverror.js";
7
-
8
- export type MarkInvoicePaidErrorData = {
9
- foreignID?: string | undefined;
10
- description?: string | undefined;
11
- paymentDate?: string | undefined;
12
- };
13
-
14
- export class MarkInvoicePaidError extends MoovError {
15
- foreignID?: string | undefined;
16
- description?: string | undefined;
17
- paymentDate?: string | undefined;
18
-
19
- /** The original data that was passed to this error instance. */
20
- data$: MarkInvoicePaidErrorData;
21
-
22
- constructor(
23
- err: MarkInvoicePaidErrorData,
24
- httpMeta: { response: Response; request: Request; body: string },
25
- ) {
26
- const message = "message" in err && typeof err.message === "string"
27
- ? err.message
28
- : `API error occurred: ${JSON.stringify(err)}`;
29
- super(message, httpMeta);
30
- this.data$ = err;
31
- if (err.foreignID != null) this.foreignID = err.foreignID;
32
- if (err.description != null) this.description = err.description;
33
- if (err.paymentDate != null) this.paymentDate = err.paymentDate;
34
-
35
- this.name = "MarkInvoicePaidError";
36
- }
37
- }
38
-
39
- /** @internal */
40
- export const MarkInvoicePaidError$inboundSchema: z.ZodType<
41
- MarkInvoicePaidError,
42
- z.ZodTypeDef,
43
- unknown
44
- > = z.object({
45
- foreignID: z.string().optional(),
46
- description: z.string().optional(),
47
- paymentDate: z.string().optional(),
48
- request$: z.instanceof(Request),
49
- response$: z.instanceof(Response),
50
- body$: z.string(),
51
- })
52
- .transform((v) => {
53
- return new MarkInvoicePaidError(v, {
54
- request: v.request$,
55
- response: v.response$,
56
- body: v.body$,
57
- });
58
- });
59
-
60
- /** @internal */
61
- export type MarkInvoicePaidError$Outbound = {
62
- foreignID?: string | undefined;
63
- description?: string | undefined;
64
- paymentDate?: string | undefined;
65
- };
66
-
67
- /** @internal */
68
- export const MarkInvoicePaidError$outboundSchema: z.ZodType<
69
- MarkInvoicePaidError$Outbound,
70
- z.ZodTypeDef,
71
- MarkInvoicePaidError
72
- > = z.instanceof(MarkInvoicePaidError)
73
- .transform(v => v.data$)
74
- .pipe(z.object({
75
- foreignID: z.string().optional(),
76
- description: z.string().optional(),
77
- paymentDate: z.string().optional(),
78
- }));