@moovio/sdk 0.21.13 → 0.21.15

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 (275) hide show
  1. package/README.md +106 -49
  2. package/bin/mcp-server.js +2707 -977
  3. package/bin/mcp-server.js.map +56 -15
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/feePlansListFeeRevenue.d.ts +17 -0
  6. package/funcs/feePlansListFeeRevenue.d.ts.map +1 -0
  7. package/funcs/feePlansListFeeRevenue.js +132 -0
  8. package/funcs/feePlansListFeeRevenue.js.map +1 -0
  9. package/funcs/feePlansRetrieveFees.d.ts +1 -1
  10. package/funcs/feePlansRetrieveFees.js +1 -1
  11. package/funcs/invoicesCreateInvoice.d.ts +18 -0
  12. package/funcs/invoicesCreateInvoice.d.ts.map +1 -0
  13. package/funcs/invoicesCreateInvoice.js +139 -0
  14. package/funcs/invoicesCreateInvoice.js.map +1 -0
  15. package/funcs/invoicesGetInvoice.d.ts +17 -0
  16. package/funcs/invoicesGetInvoice.d.ts.map +1 -0
  17. package/funcs/invoicesGetInvoice.js +129 -0
  18. package/funcs/invoicesGetInvoice.js.map +1 -0
  19. package/funcs/invoicesListInvoices.d.ts +18 -0
  20. package/funcs/invoicesListInvoices.d.ts.map +1 -0
  21. package/funcs/invoicesListInvoices.js +135 -0
  22. package/funcs/invoicesListInvoices.js.map +1 -0
  23. package/funcs/invoicesMarkPaidInvoice.d.ts +19 -0
  24. package/funcs/invoicesMarkPaidInvoice.d.ts.map +1 -0
  25. package/funcs/invoicesMarkPaidInvoice.js +144 -0
  26. package/funcs/invoicesMarkPaidInvoice.js.map +1 -0
  27. package/funcs/invoicesUpdateInvoice.d.ts +18 -0
  28. package/funcs/invoicesUpdateInvoice.d.ts.map +1 -0
  29. package/funcs/invoicesUpdateInvoice.js +143 -0
  30. package/funcs/invoicesUpdateInvoice.js.map +1 -0
  31. package/jsr.json +1 -1
  32. package/lib/config.d.ts +2 -2
  33. package/lib/config.js +2 -2
  34. package/mcp-server/mcp-server.js +1 -1
  35. package/mcp-server/server.d.ts.map +1 -1
  36. package/mcp-server/server.js +13 -1
  37. package/mcp-server/server.js.map +1 -1
  38. package/mcp-server/tools/feePlansListFeeRevenue.d.ts +8 -0
  39. package/mcp-server/tools/feePlansListFeeRevenue.d.ts.map +1 -0
  40. package/mcp-server/tools/feePlansListFeeRevenue.js +65 -0
  41. package/mcp-server/tools/feePlansListFeeRevenue.js.map +1 -0
  42. package/mcp-server/tools/feePlansRetrieveFees.js +1 -1
  43. package/mcp-server/tools/invoicesCreateInvoice.d.ts +8 -0
  44. package/mcp-server/tools/invoicesCreateInvoice.d.ts.map +1 -0
  45. package/mcp-server/tools/invoicesCreateInvoice.js +65 -0
  46. package/mcp-server/tools/invoicesCreateInvoice.js.map +1 -0
  47. package/mcp-server/tools/invoicesGetInvoice.d.ts +8 -0
  48. package/mcp-server/tools/invoicesGetInvoice.d.ts.map +1 -0
  49. package/mcp-server/tools/invoicesGetInvoice.js +65 -0
  50. package/mcp-server/tools/invoicesGetInvoice.js.map +1 -0
  51. package/mcp-server/tools/invoicesListInvoices.d.ts +8 -0
  52. package/mcp-server/tools/invoicesListInvoices.d.ts.map +1 -0
  53. package/mcp-server/tools/invoicesListInvoices.js +65 -0
  54. package/mcp-server/tools/invoicesListInvoices.js.map +1 -0
  55. package/mcp-server/tools/invoicesMarkPaidInvoice.d.ts +8 -0
  56. package/mcp-server/tools/invoicesMarkPaidInvoice.d.ts.map +1 -0
  57. package/mcp-server/tools/invoicesMarkPaidInvoice.js +66 -0
  58. package/mcp-server/tools/invoicesMarkPaidInvoice.js.map +1 -0
  59. package/mcp-server/tools/invoicesUpdateInvoice.d.ts +8 -0
  60. package/mcp-server/tools/invoicesUpdateInvoice.d.ts.map +1 -0
  61. package/mcp-server/tools/invoicesUpdateInvoice.js +65 -0
  62. package/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -0
  63. package/models/components/amountdecimalupdate.d.ts +29 -0
  64. package/models/components/amountdecimalupdate.d.ts.map +1 -0
  65. package/models/components/amountdecimalupdate.js +60 -0
  66. package/models/components/amountdecimalupdate.js.map +1 -0
  67. package/models/components/createinvoice.d.ts +32 -0
  68. package/models/components/createinvoice.d.ts.map +1 -0
  69. package/models/components/createinvoice.js +72 -0
  70. package/models/components/createinvoice.js.map +1 -0
  71. package/models/components/index.d.ts +19 -0
  72. package/models/components/index.d.ts.map +1 -1
  73. package/models/components/index.js +19 -0
  74. package/models/components/index.js.map +1 -1
  75. package/models/components/instantbankcreditpaymentmethod.d.ts +40 -0
  76. package/models/components/instantbankcreditpaymentmethod.d.ts.map +1 -0
  77. package/models/components/instantbankcreditpaymentmethod.js +71 -0
  78. package/models/components/instantbankcreditpaymentmethod.js.map +1 -0
  79. package/models/components/invoice.d.ts +81 -0
  80. package/models/components/invoice.d.ts.map +1 -0
  81. package/models/components/invoice.js +107 -0
  82. package/models/components/invoice.js.map +1 -0
  83. package/models/components/invoiceexternalpayment.d.ts +35 -0
  84. package/models/components/invoiceexternalpayment.d.ts.map +1 -0
  85. package/models/components/invoiceexternalpayment.js +75 -0
  86. package/models/components/invoiceexternalpayment.js.map +1 -0
  87. package/models/components/invoicelineitem.d.ts +45 -0
  88. package/models/components/invoicelineitem.d.ts.map +1 -0
  89. package/models/components/invoicelineitem.js +68 -0
  90. package/models/components/invoicelineitem.js.map +1 -0
  91. package/models/components/invoicelineitemoption.d.ts +39 -0
  92. package/models/components/invoicelineitemoption.d.ts.map +1 -0
  93. package/models/components/invoicelineitemoption.js +65 -0
  94. package/models/components/invoicelineitemoption.js.map +1 -0
  95. package/models/components/invoicelineitemoptionvalidationerror.d.ts +24 -0
  96. package/models/components/invoicelineitemoptionvalidationerror.d.ts.map +1 -0
  97. package/models/components/invoicelineitemoptionvalidationerror.js +65 -0
  98. package/models/components/invoicelineitemoptionvalidationerror.js.map +1 -0
  99. package/models/components/invoicelineitems.d.ts +24 -0
  100. package/models/components/invoicelineitems.d.ts.map +1 -0
  101. package/models/components/invoicelineitems.js +59 -0
  102. package/models/components/invoicelineitems.js.map +1 -0
  103. package/models/components/invoicelineitemsupdate.d.ts +24 -0
  104. package/models/components/invoicelineitemsupdate.d.ts.map +1 -0
  105. package/models/components/invoicelineitemsupdate.js +59 -0
  106. package/models/components/invoicelineitemsupdate.js.map +1 -0
  107. package/models/components/invoicelineitemsvalidationerror.d.ts +22 -0
  108. package/models/components/invoicelineitemsvalidationerror.d.ts.map +1 -0
  109. package/models/components/invoicelineitemsvalidationerror.js +59 -0
  110. package/models/components/invoicelineitemsvalidationerror.js.map +1 -0
  111. package/models/components/invoicelineitemvalidationerror.d.ts +31 -0
  112. package/models/components/invoicelineitemvalidationerror.d.ts.map +1 -0
  113. package/models/components/invoicelineitemvalidationerror.js +70 -0
  114. package/models/components/invoicelineitemvalidationerror.js.map +1 -0
  115. package/models/components/invoicepayment.d.ts +23 -0
  116. package/models/components/invoicepayment.d.ts.map +1 -0
  117. package/models/components/invoicepayment.js +70 -0
  118. package/models/components/invoicepayment.js.map +1 -0
  119. package/models/components/invoicestatus.d.ts +16 -0
  120. package/models/components/invoicestatus.d.ts.map +1 -0
  121. package/models/components/invoicestatus.js +53 -0
  122. package/models/components/invoicestatus.js.map +1 -0
  123. package/models/components/invoicetransferpayment.d.ts +28 -0
  124. package/models/components/invoicetransferpayment.d.ts.map +1 -0
  125. package/models/components/invoicetransferpayment.js +68 -0
  126. package/models/components/invoicetransferpayment.js.map +1 -0
  127. package/models/components/markinvoicepaid.d.ts +21 -0
  128. package/models/components/markinvoicepaid.d.ts.map +1 -0
  129. package/models/components/markinvoicepaid.js +63 -0
  130. package/models/components/markinvoicepaid.js.map +1 -0
  131. package/models/components/paymentmethod.d.ts +5 -0
  132. package/models/components/paymentmethod.d.ts.map +1 -1
  133. package/models/components/paymentmethod.js +3 -0
  134. package/models/components/paymentmethod.js.map +1 -1
  135. package/models/components/paymentmethodtype.d.ts +1 -0
  136. package/models/components/paymentmethodtype.d.ts.map +1 -1
  137. package/models/components/paymentmethodtype.js +1 -0
  138. package/models/components/paymentmethodtype.js.map +1 -1
  139. package/models/components/updateinvoice.d.ts +36 -0
  140. package/models/components/updateinvoice.d.ts.map +1 -0
  141. package/models/components/updateinvoice.js +71 -0
  142. package/models/components/updateinvoice.js.map +1 -0
  143. package/models/components/webhookdata.d.ts +4 -2
  144. package/models/components/webhookdata.d.ts.map +1 -1
  145. package/models/components/webhookdata.js +6 -0
  146. package/models/components/webhookdata.js.map +1 -1
  147. package/models/components/webhookdatainvoicecreated.d.ts +19 -0
  148. package/models/components/webhookdatainvoicecreated.d.ts.map +1 -0
  149. package/models/components/webhookdatainvoicecreated.js +60 -0
  150. package/models/components/webhookdatainvoicecreated.js.map +1 -0
  151. package/models/components/webhookdatainvoiceupdated.d.ts +22 -0
  152. package/models/components/webhookdatainvoiceupdated.d.ts.map +1 -0
  153. package/models/components/webhookdatainvoiceupdated.js +63 -0
  154. package/models/components/webhookdatainvoiceupdated.js.map +1 -0
  155. package/models/components/webhookeventtype.d.ts +2 -0
  156. package/models/components/webhookeventtype.d.ts.map +1 -1
  157. package/models/components/webhookeventtype.js +2 -0
  158. package/models/components/webhookeventtype.js.map +1 -1
  159. package/models/errors/createinvoiceerror.d.ts +40 -0
  160. package/models/errors/createinvoiceerror.d.ts.map +1 -0
  161. package/models/errors/createinvoiceerror.js +100 -0
  162. package/models/errors/createinvoiceerror.js.map +1 -0
  163. package/models/errors/index.d.ts +4 -0
  164. package/models/errors/index.d.ts.map +1 -1
  165. package/models/errors/index.js +4 -0
  166. package/models/errors/index.js.map +1 -1
  167. package/models/errors/listinvoicesvalidationerror.d.ts +33 -0
  168. package/models/errors/listinvoicesvalidationerror.d.ts.map +1 -0
  169. package/models/errors/listinvoicesvalidationerror.js +88 -0
  170. package/models/errors/listinvoicesvalidationerror.js.map +1 -0
  171. package/models/errors/markinvoicepaiderror.d.ts +30 -0
  172. package/models/errors/markinvoicepaiderror.d.ts.map +1 -0
  173. package/models/errors/markinvoicepaiderror.js +83 -0
  174. package/models/errors/markinvoicepaiderror.js.map +1 -0
  175. package/models/errors/updateinvoiceerror.d.ts +40 -0
  176. package/models/errors/updateinvoiceerror.d.ts.map +1 -0
  177. package/models/errors/updateinvoiceerror.js +99 -0
  178. package/models/errors/updateinvoiceerror.js.map +1 -0
  179. package/models/operations/createinvoice.d.ts +66 -0
  180. package/models/operations/createinvoice.d.ts.map +1 -0
  181. package/models/operations/createinvoice.js +122 -0
  182. package/models/operations/createinvoice.js.map +1 -0
  183. package/models/operations/getinvoice.d.ts +66 -0
  184. package/models/operations/getinvoice.d.ts.map +1 -0
  185. package/models/operations/getinvoice.js +114 -0
  186. package/models/operations/getinvoice.js.map +1 -0
  187. package/models/operations/index.d.ts +6 -0
  188. package/models/operations/index.d.ts.map +1 -1
  189. package/models/operations/index.js +6 -0
  190. package/models/operations/index.js.map +1 -1
  191. package/models/operations/listfeerevenue.d.ts +81 -0
  192. package/models/operations/listfeerevenue.d.ts.map +1 -0
  193. package/models/operations/listfeerevenue.js +120 -0
  194. package/models/operations/listfeerevenue.js.map +1 -0
  195. package/models/operations/listinvoices.d.ts +72 -0
  196. package/models/operations/listinvoices.d.ts.map +1 -0
  197. package/models/operations/listinvoices.js +120 -0
  198. package/models/operations/listinvoices.js.map +1 -0
  199. package/models/operations/markpaidinvoice.d.ts +68 -0
  200. package/models/operations/markpaidinvoice.d.ts.map +1 -0
  201. package/models/operations/markpaidinvoice.js +124 -0
  202. package/models/operations/markpaidinvoice.js.map +1 -0
  203. package/models/operations/updateinvoice.d.ts +68 -0
  204. package/models/operations/updateinvoice.d.ts.map +1 -0
  205. package/models/operations/updateinvoice.js +124 -0
  206. package/models/operations/updateinvoice.js.map +1 -0
  207. package/package.json +1 -1
  208. package/sdk/feeplans.d.ts +8 -1
  209. package/sdk/feeplans.d.ts.map +1 -1
  210. package/sdk/feeplans.js +11 -1
  211. package/sdk/feeplans.js.map +1 -1
  212. package/sdk/invoices.d.ts +41 -0
  213. package/sdk/invoices.d.ts.map +1 -0
  214. package/sdk/invoices.js +63 -0
  215. package/sdk/invoices.js.map +1 -0
  216. package/sdk/sdk.d.ts +3 -0
  217. package/sdk/sdk.d.ts.map +1 -1
  218. package/sdk/sdk.js +4 -0
  219. package/sdk/sdk.js.map +1 -1
  220. package/src/funcs/feePlansListFeeRevenue.ts +187 -0
  221. package/src/funcs/feePlansRetrieveFees.ts +1 -1
  222. package/src/funcs/invoicesCreateInvoice.ts +201 -0
  223. package/src/funcs/invoicesGetInvoice.ts +185 -0
  224. package/src/funcs/invoicesListInvoices.ts +194 -0
  225. package/src/funcs/invoicesMarkPaidInvoice.ts +208 -0
  226. package/src/funcs/invoicesUpdateInvoice.ts +207 -0
  227. package/src/lib/config.ts +2 -2
  228. package/src/mcp-server/mcp-server.ts +1 -1
  229. package/src/mcp-server/server.ts +13 -1
  230. package/src/mcp-server/tools/feePlansListFeeRevenue.ts +39 -0
  231. package/src/mcp-server/tools/feePlansRetrieveFees.ts +1 -1
  232. package/src/mcp-server/tools/invoicesCreateInvoice.ts +38 -0
  233. package/src/mcp-server/tools/invoicesGetInvoice.ts +38 -0
  234. package/src/mcp-server/tools/invoicesListInvoices.ts +38 -0
  235. package/src/mcp-server/tools/invoicesMarkPaidInvoice.ts +39 -0
  236. package/src/mcp-server/tools/invoicesUpdateInvoice.ts +38 -0
  237. package/src/models/components/amountdecimalupdate.ts +65 -0
  238. package/src/models/components/createinvoice.ts +84 -0
  239. package/src/models/components/index.ts +19 -0
  240. package/src/models/components/instantbankcreditpaymentmethod.ts +95 -0
  241. package/src/models/components/invoice.ts +178 -0
  242. package/src/models/components/invoiceexternalpayment.ts +91 -0
  243. package/src/models/components/invoicelineitem.ts +95 -0
  244. package/src/models/components/invoicelineitemoption.ts +84 -0
  245. package/src/models/components/invoicelineitemoptionvalidationerror.ts +72 -0
  246. package/src/models/components/invoicelineitems.ts +63 -0
  247. package/src/models/components/invoicelineitemsupdate.ts +63 -0
  248. package/src/models/components/invoicelineitemsvalidationerror.ts +59 -0
  249. package/src/models/components/invoicelineitemvalidationerror.ts +85 -0
  250. package/src/models/components/invoicepayment.ts +77 -0
  251. package/src/models/components/invoicestatus.ts +25 -0
  252. package/src/models/components/invoicetransferpayment.ts +68 -0
  253. package/src/models/components/markinvoicepaid.ts +58 -0
  254. package/src/models/components/paymentmethod.ts +22 -0
  255. package/src/models/components/paymentmethodtype.ts +1 -0
  256. package/src/models/components/updateinvoice.ts +94 -0
  257. package/src/models/components/webhookdata.ts +20 -0
  258. package/src/models/components/webhookdatainvoicecreated.ts +55 -0
  259. package/src/models/components/webhookdatainvoiceupdated.ts +64 -0
  260. package/src/models/components/webhookeventtype.ts +2 -0
  261. package/src/models/errors/createinvoiceerror.ts +102 -0
  262. package/src/models/errors/index.ts +4 -0
  263. package/src/models/errors/listinvoicesvalidationerror.ts +86 -0
  264. package/src/models/errors/markinvoicepaiderror.ts +78 -0
  265. package/src/models/errors/updateinvoiceerror.ts +100 -0
  266. package/src/models/operations/createinvoice.ts +187 -0
  267. package/src/models/operations/getinvoice.ts +179 -0
  268. package/src/models/operations/index.ts +6 -0
  269. package/src/models/operations/listfeerevenue.ts +200 -0
  270. package/src/models/operations/listinvoices.ts +191 -0
  271. package/src/models/operations/markpaidinvoice.ts +191 -0
  272. package/src/models/operations/updateinvoice.ts +191 -0
  273. package/src/sdk/feeplans.ts +19 -1
  274. package/src/sdk/invoices.ts +100 -0
  275. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,64 @@
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
+ InvoiceStatus,
11
+ InvoiceStatus$inboundSchema,
12
+ InvoiceStatus$outboundSchema,
13
+ } from "./invoicestatus.js";
14
+
15
+ export type WebhookDataInvoiceUpdated = {
16
+ accountID: string;
17
+ invoiceID: string;
18
+ status: InvoiceStatus;
19
+ };
20
+
21
+ /** @internal */
22
+ export const WebhookDataInvoiceUpdated$inboundSchema: z.ZodType<
23
+ WebhookDataInvoiceUpdated,
24
+ z.ZodTypeDef,
25
+ unknown
26
+ > = z.object({
27
+ accountID: z.string(),
28
+ invoiceID: z.string(),
29
+ status: InvoiceStatus$inboundSchema,
30
+ });
31
+ /** @internal */
32
+ export type WebhookDataInvoiceUpdated$Outbound = {
33
+ accountID: string;
34
+ invoiceID: string;
35
+ status: string;
36
+ };
37
+
38
+ /** @internal */
39
+ export const WebhookDataInvoiceUpdated$outboundSchema: z.ZodType<
40
+ WebhookDataInvoiceUpdated$Outbound,
41
+ z.ZodTypeDef,
42
+ WebhookDataInvoiceUpdated
43
+ > = z.object({
44
+ accountID: z.string(),
45
+ invoiceID: z.string(),
46
+ status: InvoiceStatus$outboundSchema,
47
+ });
48
+
49
+ export function webhookDataInvoiceUpdatedToJSON(
50
+ webhookDataInvoiceUpdated: WebhookDataInvoiceUpdated,
51
+ ): string {
52
+ return JSON.stringify(
53
+ WebhookDataInvoiceUpdated$outboundSchema.parse(webhookDataInvoiceUpdated),
54
+ );
55
+ }
56
+ export function webhookDataInvoiceUpdatedFromJSON(
57
+ jsonString: string,
58
+ ): SafeParseResult<WebhookDataInvoiceUpdated, SDKValidationError> {
59
+ return safeParse(
60
+ jsonString,
61
+ (x) => WebhookDataInvoiceUpdated$inboundSchema.parse(JSON.parse(x)),
62
+ `Failed to parse 'WebhookDataInvoiceUpdated' from JSON`,
63
+ );
64
+ }
@@ -24,6 +24,8 @@ export const WebhookEventType = {
24
24
  CapabilityUpdated: "capability.updated",
25
25
  DisputeCreated: "dispute.created",
26
26
  DisputeUpdated: "dispute.updated",
27
+ InvoiceCreated: "invoice.created",
28
+ InvoiceUpdated: "invoice.updated",
27
29
  NetworkIDUpdated: "networkID.updated",
28
30
  PaymentMethodEnabled: "paymentMethod.enabled",
29
31
  PaymentMethodDisabled: "paymentMethod.disabled",
@@ -0,0 +1,102 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import * as components from "../components/index.js";
7
+ import { MoovError } from "./mooverror.js";
8
+
9
+ export type CreateInvoiceErrorData = {
10
+ customerAccountID?: string | undefined;
11
+ description?: string | undefined;
12
+ lineItems?: components.InvoiceLineItemsValidationError | undefined;
13
+ invoiceDate?: string | undefined;
14
+ dueDate?: string | undefined;
15
+ taxAmount?: components.AmountDecimalValidationError | undefined;
16
+ };
17
+
18
+ export class CreateInvoiceError extends MoovError {
19
+ customerAccountID?: string | undefined;
20
+ description?: string | undefined;
21
+ lineItems?: components.InvoiceLineItemsValidationError | undefined;
22
+ invoiceDate?: string | undefined;
23
+ dueDate?: string | undefined;
24
+ taxAmount?: components.AmountDecimalValidationError | undefined;
25
+
26
+ /** The original data that was passed to this error instance. */
27
+ data$: CreateInvoiceErrorData;
28
+
29
+ constructor(
30
+ err: CreateInvoiceErrorData,
31
+ httpMeta: { response: Response; request: Request; body: string },
32
+ ) {
33
+ const message = "message" in err && typeof err.message === "string"
34
+ ? err.message
35
+ : `API error occurred: ${JSON.stringify(err)}`;
36
+ super(message, httpMeta);
37
+ this.data$ = err;
38
+ if (err.customerAccountID != null) {
39
+ this.customerAccountID = err.customerAccountID;
40
+ }
41
+ if (err.description != null) this.description = err.description;
42
+ if (err.lineItems != null) this.lineItems = err.lineItems;
43
+ if (err.invoiceDate != null) this.invoiceDate = err.invoiceDate;
44
+ if (err.dueDate != null) this.dueDate = err.dueDate;
45
+ if (err.taxAmount != null) this.taxAmount = err.taxAmount;
46
+
47
+ this.name = "CreateInvoiceError";
48
+ }
49
+ }
50
+
51
+ /** @internal */
52
+ export const CreateInvoiceError$inboundSchema: z.ZodType<
53
+ CreateInvoiceError,
54
+ z.ZodTypeDef,
55
+ unknown
56
+ > = z.object({
57
+ customerAccountID: z.string().optional(),
58
+ description: z.string().optional(),
59
+ lineItems: components.InvoiceLineItemsValidationError$inboundSchema
60
+ .optional(),
61
+ invoiceDate: z.string().optional(),
62
+ dueDate: z.string().optional(),
63
+ taxAmount: components.AmountDecimalValidationError$inboundSchema.optional(),
64
+ request$: z.instanceof(Request),
65
+ response$: z.instanceof(Response),
66
+ body$: z.string(),
67
+ })
68
+ .transform((v) => {
69
+ return new CreateInvoiceError(v, {
70
+ request: v.request$,
71
+ response: v.response$,
72
+ body: v.body$,
73
+ });
74
+ });
75
+
76
+ /** @internal */
77
+ export type CreateInvoiceError$Outbound = {
78
+ customerAccountID?: string | undefined;
79
+ description?: string | undefined;
80
+ lineItems?: components.InvoiceLineItemsValidationError$Outbound | undefined;
81
+ invoiceDate?: string | undefined;
82
+ dueDate?: string | undefined;
83
+ taxAmount?: components.AmountDecimalValidationError$Outbound | undefined;
84
+ };
85
+
86
+ /** @internal */
87
+ export const CreateInvoiceError$outboundSchema: z.ZodType<
88
+ CreateInvoiceError$Outbound,
89
+ z.ZodTypeDef,
90
+ CreateInvoiceError
91
+ > = z.instanceof(CreateInvoiceError)
92
+ .transform(v => v.data$)
93
+ .pipe(z.object({
94
+ customerAccountID: z.string().optional(),
95
+ description: z.string().optional(),
96
+ lineItems: components.InvoiceLineItemsValidationError$outboundSchema
97
+ .optional(),
98
+ invoiceDate: z.string().optional(),
99
+ dueDate: z.string().optional(),
100
+ taxAmount: components.AmountDecimalValidationError$outboundSchema
101
+ .optional(),
102
+ }));
@@ -11,6 +11,7 @@ export * from "./bankaccountvalidationerror.js";
11
11
  export * from "./brandvalidationerror.js";
12
12
  export * from "./cardacquiringrefund.js";
13
13
  export * from "./createaccounterror.js";
14
+ export * from "./createinvoiceerror.js";
14
15
  export * from "./createpaymentlinkerror.js";
15
16
  export * from "./createsweepconfigerror.js";
16
17
  export * from "./createticketerror.js";
@@ -24,9 +25,11 @@ export * from "./imagemetadatavalidationerror.js";
24
25
  export * from "./imagerequestvalidationerror.js";
25
26
  export * from "./linkapplepayerror.js";
26
27
  export * from "./linkcarderror.js";
28
+ export * from "./listinvoicesvalidationerror.js";
27
29
  export * from "./listtransfersvalidationerror.js";
28
30
  export * from "./listwalletsvalidationerror.js";
29
31
  export * from "./listwallettransactionsvalidationerror.js";
32
+ export * from "./markinvoicepaiderror.js";
30
33
  export * from "./microdepositvalidationerror.js";
31
34
  export * from "./mooverror.js";
32
35
  export * from "./onboardinginviteerror.js";
@@ -48,6 +51,7 @@ export * from "./transfer.js";
48
51
  export * from "./transferoptionsvalidationerror.js";
49
52
  export * from "./transfervalidationerror.js";
50
53
  export * from "./updatecarderror.js";
54
+ export * from "./updateinvoiceerror.js";
51
55
  export * from "./updateissuedcarderror.js";
52
56
  export * from "./updatepaymentlinkerror.js";
53
57
  export * from "./updateticketerror.js";
@@ -0,0 +1,86 @@
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 ListInvoicesValidationErrorData = {
9
+ status?: string | undefined;
10
+ customerAccountID?: string | undefined;
11
+ skip?: string | undefined;
12
+ count?: string | undefined;
13
+ };
14
+
15
+ export class ListInvoicesValidationError extends MoovError {
16
+ status?: string | undefined;
17
+ customerAccountID?: string | undefined;
18
+ skip?: string | undefined;
19
+ count?: string | undefined;
20
+
21
+ /** The original data that was passed to this error instance. */
22
+ data$: ListInvoicesValidationErrorData;
23
+
24
+ constructor(
25
+ err: ListInvoicesValidationErrorData,
26
+ httpMeta: { response: Response; request: Request; body: string },
27
+ ) {
28
+ const message = "message" in err && typeof err.message === "string"
29
+ ? err.message
30
+ : `API error occurred: ${JSON.stringify(err)}`;
31
+ super(message, httpMeta);
32
+ this.data$ = err;
33
+ if (err.status != null) this.status = err.status;
34
+ if (err.customerAccountID != null) {
35
+ this.customerAccountID = err.customerAccountID;
36
+ }
37
+ if (err.skip != null) this.skip = err.skip;
38
+ if (err.count != null) this.count = err.count;
39
+
40
+ this.name = "ListInvoicesValidationError";
41
+ }
42
+ }
43
+
44
+ /** @internal */
45
+ export const ListInvoicesValidationError$inboundSchema: z.ZodType<
46
+ ListInvoicesValidationError,
47
+ z.ZodTypeDef,
48
+ unknown
49
+ > = z.object({
50
+ status: z.string().optional(),
51
+ customerAccountID: z.string().optional(),
52
+ skip: z.string().optional(),
53
+ count: z.string().optional(),
54
+ request$: z.instanceof(Request),
55
+ response$: z.instanceof(Response),
56
+ body$: z.string(),
57
+ })
58
+ .transform((v) => {
59
+ return new ListInvoicesValidationError(v, {
60
+ request: v.request$,
61
+ response: v.response$,
62
+ body: v.body$,
63
+ });
64
+ });
65
+
66
+ /** @internal */
67
+ export type ListInvoicesValidationError$Outbound = {
68
+ status?: string | undefined;
69
+ customerAccountID?: string | undefined;
70
+ skip?: string | undefined;
71
+ count?: string | undefined;
72
+ };
73
+
74
+ /** @internal */
75
+ export const ListInvoicesValidationError$outboundSchema: z.ZodType<
76
+ ListInvoicesValidationError$Outbound,
77
+ z.ZodTypeDef,
78
+ ListInvoicesValidationError
79
+ > = z.instanceof(ListInvoicesValidationError)
80
+ .transform(v => v.data$)
81
+ .pipe(z.object({
82
+ status: z.string().optional(),
83
+ customerAccountID: z.string().optional(),
84
+ skip: z.string().optional(),
85
+ count: z.string().optional(),
86
+ }));
@@ -0,0 +1,78 @@
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
+ }));
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import * as components from "../components/index.js";
7
+ import { MoovError } from "./mooverror.js";
8
+
9
+ export type UpdateInvoiceErrorData = {
10
+ description?: string | undefined;
11
+ lineItems?: components.InvoiceLineItemsValidationError | undefined;
12
+ invoiceDate?: string | undefined;
13
+ dueDate?: string | undefined;
14
+ status?: string | undefined;
15
+ taxAmount?: components.AmountDecimalValidationError | undefined;
16
+ };
17
+
18
+ export class UpdateInvoiceError extends MoovError {
19
+ description?: string | undefined;
20
+ lineItems?: components.InvoiceLineItemsValidationError | undefined;
21
+ invoiceDate?: string | undefined;
22
+ dueDate?: string | undefined;
23
+ status?: string | undefined;
24
+ taxAmount?: components.AmountDecimalValidationError | undefined;
25
+
26
+ /** The original data that was passed to this error instance. */
27
+ data$: UpdateInvoiceErrorData;
28
+
29
+ constructor(
30
+ err: UpdateInvoiceErrorData,
31
+ httpMeta: { response: Response; request: Request; body: string },
32
+ ) {
33
+ const message = "message" in err && typeof err.message === "string"
34
+ ? err.message
35
+ : `API error occurred: ${JSON.stringify(err)}`;
36
+ super(message, httpMeta);
37
+ this.data$ = err;
38
+ if (err.description != null) this.description = err.description;
39
+ if (err.lineItems != null) this.lineItems = err.lineItems;
40
+ if (err.invoiceDate != null) this.invoiceDate = err.invoiceDate;
41
+ if (err.dueDate != null) this.dueDate = err.dueDate;
42
+ if (err.status != null) this.status = err.status;
43
+ if (err.taxAmount != null) this.taxAmount = err.taxAmount;
44
+
45
+ this.name = "UpdateInvoiceError";
46
+ }
47
+ }
48
+
49
+ /** @internal */
50
+ export const UpdateInvoiceError$inboundSchema: z.ZodType<
51
+ UpdateInvoiceError,
52
+ z.ZodTypeDef,
53
+ unknown
54
+ > = z.object({
55
+ description: z.string().optional(),
56
+ lineItems: components.InvoiceLineItemsValidationError$inboundSchema
57
+ .optional(),
58
+ invoiceDate: z.string().optional(),
59
+ dueDate: z.string().optional(),
60
+ status: z.string().optional(),
61
+ taxAmount: components.AmountDecimalValidationError$inboundSchema.optional(),
62
+ request$: z.instanceof(Request),
63
+ response$: z.instanceof(Response),
64
+ body$: z.string(),
65
+ })
66
+ .transform((v) => {
67
+ return new UpdateInvoiceError(v, {
68
+ request: v.request$,
69
+ response: v.response$,
70
+ body: v.body$,
71
+ });
72
+ });
73
+
74
+ /** @internal */
75
+ export type UpdateInvoiceError$Outbound = {
76
+ description?: string | undefined;
77
+ lineItems?: components.InvoiceLineItemsValidationError$Outbound | undefined;
78
+ invoiceDate?: string | undefined;
79
+ dueDate?: string | undefined;
80
+ status?: string | undefined;
81
+ taxAmount?: components.AmountDecimalValidationError$Outbound | undefined;
82
+ };
83
+
84
+ /** @internal */
85
+ export const UpdateInvoiceError$outboundSchema: z.ZodType<
86
+ UpdateInvoiceError$Outbound,
87
+ z.ZodTypeDef,
88
+ UpdateInvoiceError
89
+ > = z.instanceof(UpdateInvoiceError)
90
+ .transform(v => v.data$)
91
+ .pipe(z.object({
92
+ description: z.string().optional(),
93
+ lineItems: components.InvoiceLineItemsValidationError$outboundSchema
94
+ .optional(),
95
+ invoiceDate: z.string().optional(),
96
+ dueDate: z.string().optional(),
97
+ status: z.string().optional(),
98
+ taxAmount: components.AmountDecimalValidationError$outboundSchema
99
+ .optional(),
100
+ }));
@@ -0,0 +1,187 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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 CreateInvoiceGlobals = {
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
+ * When no version is specified, the API defaults to `v2024.01.00`.
26
+ */
27
+ xMoovVersion?: string | undefined;
28
+ };
29
+
30
+ export type CreateInvoiceRequest = {
31
+ accountID: string;
32
+ createInvoice: components.CreateInvoice;
33
+ };
34
+
35
+ export type CreateInvoiceResponse = {
36
+ headers: { [k: string]: Array<string> };
37
+ result: components.Invoice;
38
+ };
39
+
40
+ /** @internal */
41
+ export const CreateInvoiceGlobals$inboundSchema: z.ZodType<
42
+ CreateInvoiceGlobals,
43
+ z.ZodTypeDef,
44
+ unknown
45
+ > = z.object({
46
+ "X-Moov-Version": z.string().optional(),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ "X-Moov-Version": "xMoovVersion",
50
+ });
51
+ });
52
+ /** @internal */
53
+ export type CreateInvoiceGlobals$Outbound = {
54
+ "X-Moov-Version"?: string | undefined;
55
+ };
56
+
57
+ /** @internal */
58
+ export const CreateInvoiceGlobals$outboundSchema: z.ZodType<
59
+ CreateInvoiceGlobals$Outbound,
60
+ z.ZodTypeDef,
61
+ CreateInvoiceGlobals
62
+ > = z.object({
63
+ xMoovVersion: z.string().optional(),
64
+ }).transform((v) => {
65
+ return remap$(v, {
66
+ xMoovVersion: "X-Moov-Version",
67
+ });
68
+ });
69
+
70
+ export function createInvoiceGlobalsToJSON(
71
+ createInvoiceGlobals: CreateInvoiceGlobals,
72
+ ): string {
73
+ return JSON.stringify(
74
+ CreateInvoiceGlobals$outboundSchema.parse(createInvoiceGlobals),
75
+ );
76
+ }
77
+ export function createInvoiceGlobalsFromJSON(
78
+ jsonString: string,
79
+ ): SafeParseResult<CreateInvoiceGlobals, SDKValidationError> {
80
+ return safeParse(
81
+ jsonString,
82
+ (x) => CreateInvoiceGlobals$inboundSchema.parse(JSON.parse(x)),
83
+ `Failed to parse 'CreateInvoiceGlobals' from JSON`,
84
+ );
85
+ }
86
+
87
+ /** @internal */
88
+ export const CreateInvoiceRequest$inboundSchema: z.ZodType<
89
+ CreateInvoiceRequest,
90
+ z.ZodTypeDef,
91
+ unknown
92
+ > = z.object({
93
+ accountID: z.string(),
94
+ CreateInvoice: components.CreateInvoice$inboundSchema,
95
+ }).transform((v) => {
96
+ return remap$(v, {
97
+ "CreateInvoice": "createInvoice",
98
+ });
99
+ });
100
+ /** @internal */
101
+ export type CreateInvoiceRequest$Outbound = {
102
+ accountID: string;
103
+ CreateInvoice: components.CreateInvoice$Outbound;
104
+ };
105
+
106
+ /** @internal */
107
+ export const CreateInvoiceRequest$outboundSchema: z.ZodType<
108
+ CreateInvoiceRequest$Outbound,
109
+ z.ZodTypeDef,
110
+ CreateInvoiceRequest
111
+ > = z.object({
112
+ accountID: z.string(),
113
+ createInvoice: components.CreateInvoice$outboundSchema,
114
+ }).transform((v) => {
115
+ return remap$(v, {
116
+ createInvoice: "CreateInvoice",
117
+ });
118
+ });
119
+
120
+ export function createInvoiceRequestToJSON(
121
+ createInvoiceRequest: CreateInvoiceRequest,
122
+ ): string {
123
+ return JSON.stringify(
124
+ CreateInvoiceRequest$outboundSchema.parse(createInvoiceRequest),
125
+ );
126
+ }
127
+ export function createInvoiceRequestFromJSON(
128
+ jsonString: string,
129
+ ): SafeParseResult<CreateInvoiceRequest, SDKValidationError> {
130
+ return safeParse(
131
+ jsonString,
132
+ (x) => CreateInvoiceRequest$inboundSchema.parse(JSON.parse(x)),
133
+ `Failed to parse 'CreateInvoiceRequest' from JSON`,
134
+ );
135
+ }
136
+
137
+ /** @internal */
138
+ export const CreateInvoiceResponse$inboundSchema: z.ZodType<
139
+ CreateInvoiceResponse,
140
+ z.ZodTypeDef,
141
+ unknown
142
+ > = z.object({
143
+ Headers: z.record(z.array(z.string())).default({}),
144
+ Result: components.Invoice$inboundSchema,
145
+ }).transform((v) => {
146
+ return remap$(v, {
147
+ "Headers": "headers",
148
+ "Result": "result",
149
+ });
150
+ });
151
+ /** @internal */
152
+ export type CreateInvoiceResponse$Outbound = {
153
+ Headers: { [k: string]: Array<string> };
154
+ Result: components.Invoice$Outbound;
155
+ };
156
+
157
+ /** @internal */
158
+ export const CreateInvoiceResponse$outboundSchema: z.ZodType<
159
+ CreateInvoiceResponse$Outbound,
160
+ z.ZodTypeDef,
161
+ CreateInvoiceResponse
162
+ > = z.object({
163
+ headers: z.record(z.array(z.string())),
164
+ result: components.Invoice$outboundSchema,
165
+ }).transform((v) => {
166
+ return remap$(v, {
167
+ headers: "Headers",
168
+ result: "Result",
169
+ });
170
+ });
171
+
172
+ export function createInvoiceResponseToJSON(
173
+ createInvoiceResponse: CreateInvoiceResponse,
174
+ ): string {
175
+ return JSON.stringify(
176
+ CreateInvoiceResponse$outboundSchema.parse(createInvoiceResponse),
177
+ );
178
+ }
179
+ export function createInvoiceResponseFromJSON(
180
+ jsonString: string,
181
+ ): SafeParseResult<CreateInvoiceResponse, SDKValidationError> {
182
+ return safeParse(
183
+ jsonString,
184
+ (x) => CreateInvoiceResponse$inboundSchema.parse(JSON.parse(x)),
185
+ `Failed to parse 'CreateInvoiceResponse' from JSON`,
186
+ );
187
+ }