@moovio/sdk 0.21.14 → 0.21.16

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 (335) hide show
  1. package/README.md +96 -47
  2. package/bin/mcp-server.js +2433 -819
  3. package/bin/mcp-server.js.map +63 -22
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/invoicesCreateInvoice.d.ts +18 -0
  6. package/funcs/invoicesCreateInvoice.d.ts.map +1 -0
  7. package/funcs/invoicesCreateInvoice.js +139 -0
  8. package/funcs/invoicesCreateInvoice.js.map +1 -0
  9. package/funcs/invoicesGetInvoice.d.ts +17 -0
  10. package/funcs/invoicesGetInvoice.d.ts.map +1 -0
  11. package/funcs/invoicesGetInvoice.js +129 -0
  12. package/funcs/invoicesGetInvoice.js.map +1 -0
  13. package/funcs/invoicesListInvoices.d.ts +18 -0
  14. package/funcs/invoicesListInvoices.d.ts.map +1 -0
  15. package/funcs/invoicesListInvoices.js +135 -0
  16. package/funcs/invoicesListInvoices.js.map +1 -0
  17. package/funcs/invoicesMarkPaidInvoice.d.ts +19 -0
  18. package/funcs/invoicesMarkPaidInvoice.d.ts.map +1 -0
  19. package/funcs/invoicesMarkPaidInvoice.js +144 -0
  20. package/funcs/invoicesMarkPaidInvoice.js.map +1 -0
  21. package/funcs/invoicesUpdateInvoice.d.ts +18 -0
  22. package/funcs/invoicesUpdateInvoice.d.ts.map +1 -0
  23. package/funcs/invoicesUpdateInvoice.js +143 -0
  24. package/funcs/invoicesUpdateInvoice.js.map +1 -0
  25. package/jsr.json +1 -1
  26. package/lib/config.d.ts +3 -3
  27. package/lib/config.js +3 -3
  28. package/mcp-server/mcp-server.js +1 -1
  29. package/mcp-server/server.d.ts.map +1 -1
  30. package/mcp-server/server.js +11 -1
  31. package/mcp-server/server.js.map +1 -1
  32. package/mcp-server/tools/invoicesCreateInvoice.d.ts +8 -0
  33. package/mcp-server/tools/invoicesCreateInvoice.d.ts.map +1 -0
  34. package/mcp-server/tools/invoicesCreateInvoice.js +65 -0
  35. package/mcp-server/tools/invoicesCreateInvoice.js.map +1 -0
  36. package/mcp-server/tools/invoicesGetInvoice.d.ts +8 -0
  37. package/mcp-server/tools/invoicesGetInvoice.d.ts.map +1 -0
  38. package/mcp-server/tools/invoicesGetInvoice.js +65 -0
  39. package/mcp-server/tools/invoicesGetInvoice.js.map +1 -0
  40. package/mcp-server/tools/invoicesListInvoices.d.ts +8 -0
  41. package/mcp-server/tools/invoicesListInvoices.d.ts.map +1 -0
  42. package/mcp-server/tools/invoicesListInvoices.js +65 -0
  43. package/mcp-server/tools/invoicesListInvoices.js.map +1 -0
  44. package/mcp-server/tools/invoicesMarkPaidInvoice.d.ts +8 -0
  45. package/mcp-server/tools/invoicesMarkPaidInvoice.d.ts.map +1 -0
  46. package/mcp-server/tools/invoicesMarkPaidInvoice.js +66 -0
  47. package/mcp-server/tools/invoicesMarkPaidInvoice.js.map +1 -0
  48. package/mcp-server/tools/invoicesUpdateInvoice.d.ts +8 -0
  49. package/mcp-server/tools/invoicesUpdateInvoice.d.ts.map +1 -0
  50. package/mcp-server/tools/invoicesUpdateInvoice.js +65 -0
  51. package/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -0
  52. package/models/components/amountdecimalupdate.d.ts +29 -0
  53. package/models/components/amountdecimalupdate.d.ts.map +1 -0
  54. package/models/components/{paymentlinklineitemsupdate.js → amountdecimalupdate.js} +14 -13
  55. package/models/components/amountdecimalupdate.js.map +1 -0
  56. package/models/components/createinvoice.d.ts +32 -0
  57. package/models/components/createinvoice.d.ts.map +1 -0
  58. package/models/components/createinvoice.js +72 -0
  59. package/models/components/createinvoice.js.map +1 -0
  60. package/models/components/createpaymentlink.d.ts +3 -3
  61. package/models/components/createpaymentlink.d.ts.map +1 -1
  62. package/models/components/createpaymentlink.js +3 -3
  63. package/models/components/createpaymentlink.js.map +1 -1
  64. package/models/components/createpaymentlinklineitem.d.ts +50 -0
  65. package/models/components/createpaymentlinklineitem.d.ts.map +1 -0
  66. package/models/components/createpaymentlinklineitem.js +70 -0
  67. package/models/components/createpaymentlinklineitem.js.map +1 -0
  68. package/models/components/createpaymentlinklineitemoption.d.ts +44 -0
  69. package/models/components/createpaymentlinklineitemoption.d.ts.map +1 -0
  70. package/models/components/createpaymentlinklineitemoption.js +67 -0
  71. package/models/components/createpaymentlinklineitemoption.js.map +1 -0
  72. package/models/components/createpaymentlinklineitemoptionvalidationerror.d.ts +24 -0
  73. package/models/components/createpaymentlinklineitemoptionvalidationerror.d.ts.map +1 -0
  74. package/models/components/createpaymentlinklineitemoptionvalidationerror.js +65 -0
  75. package/models/components/createpaymentlinklineitemoptionvalidationerror.js.map +1 -0
  76. package/models/components/createpaymentlinklineitems.d.ts +27 -0
  77. package/models/components/createpaymentlinklineitems.d.ts.map +1 -0
  78. package/models/components/{paymentlinklineitemsvalidationerror.js → createpaymentlinklineitems.js} +13 -13
  79. package/models/components/createpaymentlinklineitems.js.map +1 -0
  80. package/models/components/createpaymentlinklineitemsupdate.d.ts +27 -0
  81. package/models/components/createpaymentlinklineitemsupdate.d.ts.map +1 -0
  82. package/models/components/createpaymentlinklineitemsupdate.js +59 -0
  83. package/models/components/createpaymentlinklineitemsupdate.js.map +1 -0
  84. package/models/components/createpaymentlinklineitemsvalidationerror.d.ts +22 -0
  85. package/models/components/createpaymentlinklineitemsvalidationerror.d.ts.map +1 -0
  86. package/models/components/createpaymentlinklineitemsvalidationerror.js +61 -0
  87. package/models/components/createpaymentlinklineitemsvalidationerror.js.map +1 -0
  88. package/models/components/createpaymentlinklineitemvalidationerror.d.ts +31 -0
  89. package/models/components/createpaymentlinklineitemvalidationerror.d.ts.map +1 -0
  90. package/models/components/createpaymentlinklineitemvalidationerror.js +68 -0
  91. package/models/components/createpaymentlinklineitemvalidationerror.js.map +1 -0
  92. package/models/components/index.d.ts +26 -4
  93. package/models/components/index.d.ts.map +1 -1
  94. package/models/components/index.js +26 -4
  95. package/models/components/index.js.map +1 -1
  96. package/models/components/invoice.d.ts +81 -0
  97. package/models/components/invoice.d.ts.map +1 -0
  98. package/models/components/invoice.js +107 -0
  99. package/models/components/invoice.js.map +1 -0
  100. package/models/components/invoiceexternalpayment.d.ts +35 -0
  101. package/models/components/invoiceexternalpayment.d.ts.map +1 -0
  102. package/models/components/invoiceexternalpayment.js +75 -0
  103. package/models/components/invoiceexternalpayment.js.map +1 -0
  104. package/models/components/invoicelineitem.d.ts +45 -0
  105. package/models/components/invoicelineitem.d.ts.map +1 -0
  106. package/models/components/invoicelineitem.js +68 -0
  107. package/models/components/invoicelineitem.js.map +1 -0
  108. package/models/components/invoicelineitemoption.d.ts +39 -0
  109. package/models/components/invoicelineitemoption.d.ts.map +1 -0
  110. package/models/components/invoicelineitemoption.js +65 -0
  111. package/models/components/invoicelineitemoption.js.map +1 -0
  112. package/models/components/invoicelineitemoptionvalidationerror.d.ts +24 -0
  113. package/models/components/invoicelineitemoptionvalidationerror.d.ts.map +1 -0
  114. package/models/components/{paymentlinklineitemoptionvalidationerror.js → invoicelineitemoptionvalidationerror.js} +10 -10
  115. package/models/components/invoicelineitemoptionvalidationerror.js.map +1 -0
  116. package/models/components/invoicelineitems.d.ts +24 -0
  117. package/models/components/invoicelineitems.d.ts.map +1 -0
  118. package/models/components/invoicelineitems.js +59 -0
  119. package/models/components/invoicelineitems.js.map +1 -0
  120. package/models/components/invoicelineitemsupdate.d.ts +24 -0
  121. package/models/components/invoicelineitemsupdate.d.ts.map +1 -0
  122. package/models/components/invoicelineitemsupdate.js +59 -0
  123. package/models/components/invoicelineitemsupdate.js.map +1 -0
  124. package/models/components/invoicelineitemsvalidationerror.d.ts +22 -0
  125. package/models/components/invoicelineitemsvalidationerror.d.ts.map +1 -0
  126. package/models/components/invoicelineitemsvalidationerror.js +59 -0
  127. package/models/components/invoicelineitemsvalidationerror.js.map +1 -0
  128. package/models/components/invoicelineitemvalidationerror.d.ts +31 -0
  129. package/models/components/invoicelineitemvalidationerror.d.ts.map +1 -0
  130. package/models/components/{paymentlinklineitemvalidationerror.js → invoicelineitemvalidationerror.js} +13 -13
  131. package/models/components/invoicelineitemvalidationerror.js.map +1 -0
  132. package/models/components/invoicepayment.d.ts +23 -0
  133. package/models/components/invoicepayment.d.ts.map +1 -0
  134. package/models/components/invoicepayment.js +70 -0
  135. package/models/components/invoicepayment.js.map +1 -0
  136. package/models/components/invoicestatus.d.ts +16 -0
  137. package/models/components/invoicestatus.d.ts.map +1 -0
  138. package/models/components/invoicestatus.js +53 -0
  139. package/models/components/invoicestatus.js.map +1 -0
  140. package/models/components/invoicetransferpayment.d.ts +28 -0
  141. package/models/components/invoicetransferpayment.d.ts.map +1 -0
  142. package/models/components/invoicetransferpayment.js +68 -0
  143. package/models/components/invoicetransferpayment.js.map +1 -0
  144. package/models/components/markinvoicepaid.d.ts +21 -0
  145. package/models/components/markinvoicepaid.d.ts.map +1 -0
  146. package/models/components/markinvoicepaid.js +63 -0
  147. package/models/components/markinvoicepaid.js.map +1 -0
  148. package/models/components/paymentlinklineitem.d.ts +6 -0
  149. package/models/components/paymentlinklineitem.d.ts.map +1 -1
  150. package/models/components/paymentlinklineitem.js +3 -0
  151. package/models/components/paymentlinklineitem.js.map +1 -1
  152. package/models/components/paymentlinklineitemimagemetadata.d.ts +35 -0
  153. package/models/components/paymentlinklineitemimagemetadata.d.ts.map +1 -0
  154. package/models/components/paymentlinklineitemimagemetadata.js +64 -0
  155. package/models/components/paymentlinklineitemimagemetadata.js.map +1 -0
  156. package/models/components/paymentlinklineitemoption.d.ts +6 -0
  157. package/models/components/paymentlinklineitemoption.d.ts.map +1 -1
  158. package/models/components/paymentlinklineitemoption.js +3 -0
  159. package/models/components/paymentlinklineitemoption.js.map +1 -1
  160. package/models/components/updateinvoice.d.ts +36 -0
  161. package/models/components/updateinvoice.d.ts.map +1 -0
  162. package/models/components/updateinvoice.js +71 -0
  163. package/models/components/updateinvoice.js.map +1 -0
  164. package/models/components/updatepaymentlink.d.ts +3 -3
  165. package/models/components/updatepaymentlink.d.ts.map +1 -1
  166. package/models/components/updatepaymentlink.js +3 -3
  167. package/models/components/updatepaymentlink.js.map +1 -1
  168. package/models/components/webhookdata.d.ts +4 -2
  169. package/models/components/webhookdata.d.ts.map +1 -1
  170. package/models/components/webhookdata.js +6 -0
  171. package/models/components/webhookdata.js.map +1 -1
  172. package/models/components/webhookdatainvoicecreated.d.ts +19 -0
  173. package/models/components/webhookdatainvoicecreated.d.ts.map +1 -0
  174. package/models/components/webhookdatainvoicecreated.js +60 -0
  175. package/models/components/webhookdatainvoicecreated.js.map +1 -0
  176. package/models/components/webhookdatainvoiceupdated.d.ts +22 -0
  177. package/models/components/webhookdatainvoiceupdated.d.ts.map +1 -0
  178. package/models/components/webhookdatainvoiceupdated.js +63 -0
  179. package/models/components/webhookdatainvoiceupdated.js.map +1 -0
  180. package/models/components/webhookeventtype.d.ts +2 -0
  181. package/models/components/webhookeventtype.d.ts.map +1 -1
  182. package/models/components/webhookeventtype.js +2 -0
  183. package/models/components/webhookeventtype.js.map +1 -1
  184. package/models/errors/createinvoiceerror.d.ts +40 -0
  185. package/models/errors/createinvoiceerror.d.ts.map +1 -0
  186. package/models/errors/createinvoiceerror.js +100 -0
  187. package/models/errors/createinvoiceerror.js.map +1 -0
  188. package/models/errors/createpaymentlinkerror.d.ts +3 -3
  189. package/models/errors/createpaymentlinkerror.d.ts.map +1 -1
  190. package/models/errors/createpaymentlinkerror.js +3 -3
  191. package/models/errors/createpaymentlinkerror.js.map +1 -1
  192. package/models/errors/index.d.ts +4 -0
  193. package/models/errors/index.d.ts.map +1 -1
  194. package/models/errors/index.js +4 -0
  195. package/models/errors/index.js.map +1 -1
  196. package/models/errors/listinvoicesvalidationerror.d.ts +33 -0
  197. package/models/errors/listinvoicesvalidationerror.d.ts.map +1 -0
  198. package/models/errors/listinvoicesvalidationerror.js +88 -0
  199. package/models/errors/listinvoicesvalidationerror.js.map +1 -0
  200. package/models/errors/markinvoicepaiderror.d.ts +30 -0
  201. package/models/errors/markinvoicepaiderror.d.ts.map +1 -0
  202. package/models/errors/markinvoicepaiderror.js +83 -0
  203. package/models/errors/markinvoicepaiderror.js.map +1 -0
  204. package/models/errors/updateinvoiceerror.d.ts +40 -0
  205. package/models/errors/updateinvoiceerror.d.ts.map +1 -0
  206. package/models/errors/updateinvoiceerror.js +99 -0
  207. package/models/errors/updateinvoiceerror.js.map +1 -0
  208. package/models/errors/updatepaymentlinkerror.d.ts +3 -3
  209. package/models/errors/updatepaymentlinkerror.d.ts.map +1 -1
  210. package/models/errors/updatepaymentlinkerror.js +3 -3
  211. package/models/errors/updatepaymentlinkerror.js.map +1 -1
  212. package/models/operations/createinvoice.d.ts +66 -0
  213. package/models/operations/createinvoice.d.ts.map +1 -0
  214. package/models/operations/createinvoice.js +122 -0
  215. package/models/operations/createinvoice.js.map +1 -0
  216. package/models/operations/getinvoice.d.ts +66 -0
  217. package/models/operations/getinvoice.d.ts.map +1 -0
  218. package/models/operations/getinvoice.js +114 -0
  219. package/models/operations/getinvoice.js.map +1 -0
  220. package/models/operations/index.d.ts +5 -0
  221. package/models/operations/index.d.ts.map +1 -1
  222. package/models/operations/index.js +5 -0
  223. package/models/operations/index.js.map +1 -1
  224. package/models/operations/listinvoices.d.ts +72 -0
  225. package/models/operations/listinvoices.d.ts.map +1 -0
  226. package/models/operations/listinvoices.js +120 -0
  227. package/models/operations/listinvoices.js.map +1 -0
  228. package/models/operations/markpaidinvoice.d.ts +68 -0
  229. package/models/operations/markpaidinvoice.d.ts.map +1 -0
  230. package/models/operations/markpaidinvoice.js +124 -0
  231. package/models/operations/markpaidinvoice.js.map +1 -0
  232. package/models/operations/updateinvoice.d.ts +68 -0
  233. package/models/operations/updateinvoice.d.ts.map +1 -0
  234. package/models/operations/updateinvoice.js +124 -0
  235. package/models/operations/updateinvoice.js.map +1 -0
  236. package/package.json +1 -1
  237. package/sdk/invoices.d.ts +41 -0
  238. package/sdk/invoices.d.ts.map +1 -0
  239. package/sdk/invoices.js +63 -0
  240. package/sdk/invoices.js.map +1 -0
  241. package/sdk/sdk.d.ts +3 -0
  242. package/sdk/sdk.d.ts.map +1 -1
  243. package/sdk/sdk.js +4 -0
  244. package/sdk/sdk.js.map +1 -1
  245. package/src/funcs/invoicesCreateInvoice.ts +201 -0
  246. package/src/funcs/invoicesGetInvoice.ts +185 -0
  247. package/src/funcs/invoicesListInvoices.ts +194 -0
  248. package/src/funcs/invoicesMarkPaidInvoice.ts +208 -0
  249. package/src/funcs/invoicesUpdateInvoice.ts +207 -0
  250. package/src/lib/config.ts +3 -3
  251. package/src/mcp-server/mcp-server.ts +1 -1
  252. package/src/mcp-server/server.ts +11 -1
  253. package/src/mcp-server/tools/invoicesCreateInvoice.ts +38 -0
  254. package/src/mcp-server/tools/invoicesGetInvoice.ts +38 -0
  255. package/src/mcp-server/tools/invoicesListInvoices.ts +38 -0
  256. package/src/mcp-server/tools/invoicesMarkPaidInvoice.ts +39 -0
  257. package/src/mcp-server/tools/invoicesUpdateInvoice.ts +38 -0
  258. package/src/models/components/amountdecimalupdate.ts +65 -0
  259. package/src/models/components/createinvoice.ts +84 -0
  260. package/src/models/components/createpaymentlink.ts +10 -10
  261. package/src/models/components/createpaymentlinklineitem.ts +104 -0
  262. package/src/models/components/createpaymentlinklineitemoption.ts +93 -0
  263. package/src/models/components/createpaymentlinklineitemoptionvalidationerror.ts +80 -0
  264. package/src/models/components/createpaymentlinklineitems.ts +66 -0
  265. package/src/models/components/createpaymentlinklineitemsupdate.ts +68 -0
  266. package/src/models/components/createpaymentlinklineitemsvalidationerror.ts +71 -0
  267. package/src/models/components/createpaymentlinklineitemvalidationerror.ts +96 -0
  268. package/src/models/components/index.ts +26 -4
  269. package/src/models/components/invoice.ts +178 -0
  270. package/src/models/components/invoiceexternalpayment.ts +91 -0
  271. package/src/models/components/invoicelineitem.ts +95 -0
  272. package/src/models/components/invoicelineitemoption.ts +84 -0
  273. package/src/models/components/{paymentlinklineitemoptionvalidationerror.ts → invoicelineitemoptionvalidationerror.ts} +15 -21
  274. package/src/models/components/invoicelineitems.ts +63 -0
  275. package/src/models/components/invoicelineitemsupdate.ts +63 -0
  276. package/src/models/components/invoicelineitemsvalidationerror.ts +59 -0
  277. package/src/models/components/invoicelineitemvalidationerror.ts +85 -0
  278. package/src/models/components/invoicepayment.ts +77 -0
  279. package/src/models/components/invoicestatus.ts +25 -0
  280. package/src/models/components/invoicetransferpayment.ts +68 -0
  281. package/src/models/components/markinvoicepaid.ts +58 -0
  282. package/src/models/components/paymentlinklineitem.ts +13 -0
  283. package/src/models/components/paymentlinklineitemimagemetadata.ts +77 -0
  284. package/src/models/components/paymentlinklineitemoption.ts +13 -0
  285. package/src/models/components/updateinvoice.ts +94 -0
  286. package/src/models/components/updatepaymentlink.ts +10 -10
  287. package/src/models/components/webhookdata.ts +20 -0
  288. package/src/models/components/webhookdatainvoicecreated.ts +55 -0
  289. package/src/models/components/webhookdatainvoiceupdated.ts +64 -0
  290. package/src/models/components/webhookeventtype.ts +2 -0
  291. package/src/models/errors/createinvoiceerror.ts +102 -0
  292. package/src/models/errors/createpaymentlinkerror.ts +6 -6
  293. package/src/models/errors/index.ts +4 -0
  294. package/src/models/errors/listinvoicesvalidationerror.ts +86 -0
  295. package/src/models/errors/markinvoicepaiderror.ts +78 -0
  296. package/src/models/errors/updateinvoiceerror.ts +100 -0
  297. package/src/models/errors/updatepaymentlinkerror.ts +6 -6
  298. package/src/models/operations/createinvoice.ts +187 -0
  299. package/src/models/operations/getinvoice.ts +179 -0
  300. package/src/models/operations/index.ts +5 -0
  301. package/src/models/operations/listinvoices.ts +191 -0
  302. package/src/models/operations/markpaidinvoice.ts +191 -0
  303. package/src/models/operations/updateinvoice.ts +191 -0
  304. package/src/sdk/invoices.ts +100 -0
  305. package/src/sdk/sdk.ts +6 -0
  306. package/src/types/enums.ts +1 -21
  307. package/src/types/index.ts +2 -1
  308. package/src/types/unrecognized.ts +27 -0
  309. package/types/enums.d.ts +1 -8
  310. package/types/enums.d.ts.map +1 -1
  311. package/types/enums.js +3 -21
  312. package/types/enums.js.map +1 -1
  313. package/types/index.d.ts +2 -1
  314. package/types/index.d.ts.map +1 -1
  315. package/types/index.js +15 -0
  316. package/types/index.js.map +1 -1
  317. package/types/unrecognized.d.ts +10 -0
  318. package/types/unrecognized.d.ts.map +1 -0
  319. package/types/unrecognized.js +26 -0
  320. package/types/unrecognized.js.map +1 -0
  321. package/models/components/paymentlinklineitemoptionvalidationerror.d.ts +0 -24
  322. package/models/components/paymentlinklineitemoptionvalidationerror.d.ts.map +0 -1
  323. package/models/components/paymentlinklineitemoptionvalidationerror.js.map +0 -1
  324. package/models/components/paymentlinklineitemsupdate.d.ts +0 -27
  325. package/models/components/paymentlinklineitemsupdate.d.ts.map +0 -1
  326. package/models/components/paymentlinklineitemsupdate.js.map +0 -1
  327. package/models/components/paymentlinklineitemsvalidationerror.d.ts +0 -22
  328. package/models/components/paymentlinklineitemsvalidationerror.d.ts.map +0 -1
  329. package/models/components/paymentlinklineitemsvalidationerror.js.map +0 -1
  330. package/models/components/paymentlinklineitemvalidationerror.d.ts +0 -31
  331. package/models/components/paymentlinklineitemvalidationerror.d.ts.map +0 -1
  332. package/models/components/paymentlinklineitemvalidationerror.js.map +0 -1
  333. package/src/models/components/paymentlinklineitemsupdate.ts +0 -66
  334. package/src/models/components/paymentlinklineitemsvalidationerror.ts +0 -62
  335. package/src/models/components/paymentlinklineitemvalidationerror.ts +0 -88
@@ -0,0 +1,59 @@
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
+ InvoiceLineItemValidationError,
11
+ InvoiceLineItemValidationError$inboundSchema,
12
+ InvoiceLineItemValidationError$Outbound,
13
+ InvoiceLineItemValidationError$outboundSchema,
14
+ } from "./invoicelineitemvalidationerror.js";
15
+
16
+ export type InvoiceLineItemsValidationError = {
17
+ items?: { [k: string]: InvoiceLineItemValidationError } | undefined;
18
+ };
19
+
20
+ /** @internal */
21
+ export const InvoiceLineItemsValidationError$inboundSchema: z.ZodType<
22
+ InvoiceLineItemsValidationError,
23
+ z.ZodTypeDef,
24
+ unknown
25
+ > = z.object({
26
+ items: z.record(InvoiceLineItemValidationError$inboundSchema).optional(),
27
+ });
28
+ /** @internal */
29
+ export type InvoiceLineItemsValidationError$Outbound = {
30
+ items?: { [k: string]: InvoiceLineItemValidationError$Outbound } | undefined;
31
+ };
32
+
33
+ /** @internal */
34
+ export const InvoiceLineItemsValidationError$outboundSchema: z.ZodType<
35
+ InvoiceLineItemsValidationError$Outbound,
36
+ z.ZodTypeDef,
37
+ InvoiceLineItemsValidationError
38
+ > = z.object({
39
+ items: z.record(InvoiceLineItemValidationError$outboundSchema).optional(),
40
+ });
41
+
42
+ export function invoiceLineItemsValidationErrorToJSON(
43
+ invoiceLineItemsValidationError: InvoiceLineItemsValidationError,
44
+ ): string {
45
+ return JSON.stringify(
46
+ InvoiceLineItemsValidationError$outboundSchema.parse(
47
+ invoiceLineItemsValidationError,
48
+ ),
49
+ );
50
+ }
51
+ export function invoiceLineItemsValidationErrorFromJSON(
52
+ jsonString: string,
53
+ ): SafeParseResult<InvoiceLineItemsValidationError, SDKValidationError> {
54
+ return safeParse(
55
+ jsonString,
56
+ (x) => InvoiceLineItemsValidationError$inboundSchema.parse(JSON.parse(x)),
57
+ `Failed to parse 'InvoiceLineItemsValidationError' from JSON`,
58
+ );
59
+ }
@@ -0,0 +1,85 @@
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
+ AmountDecimalValidationError,
11
+ AmountDecimalValidationError$inboundSchema,
12
+ AmountDecimalValidationError$Outbound,
13
+ AmountDecimalValidationError$outboundSchema,
14
+ } from "./amountdecimalvalidationerror.js";
15
+ import {
16
+ InvoiceLineItemOptionValidationError,
17
+ InvoiceLineItemOptionValidationError$inboundSchema,
18
+ InvoiceLineItemOptionValidationError$Outbound,
19
+ InvoiceLineItemOptionValidationError$outboundSchema,
20
+ } from "./invoicelineitemoptionvalidationerror.js";
21
+
22
+ export type InvoiceLineItemValidationError = {
23
+ productID?: string | undefined;
24
+ name?: string | undefined;
25
+ basePrice?: AmountDecimalValidationError | undefined;
26
+ options?: { [k: string]: InvoiceLineItemOptionValidationError } | undefined;
27
+ quantity?: string | undefined;
28
+ };
29
+
30
+ /** @internal */
31
+ export const InvoiceLineItemValidationError$inboundSchema: z.ZodType<
32
+ InvoiceLineItemValidationError,
33
+ z.ZodTypeDef,
34
+ unknown
35
+ > = z.object({
36
+ productID: z.string().optional(),
37
+ name: z.string().optional(),
38
+ basePrice: AmountDecimalValidationError$inboundSchema.optional(),
39
+ options: z.record(InvoiceLineItemOptionValidationError$inboundSchema)
40
+ .optional(),
41
+ quantity: z.string().optional(),
42
+ });
43
+ /** @internal */
44
+ export type InvoiceLineItemValidationError$Outbound = {
45
+ productID?: string | undefined;
46
+ name?: string | undefined;
47
+ basePrice?: AmountDecimalValidationError$Outbound | undefined;
48
+ options?:
49
+ | { [k: string]: InvoiceLineItemOptionValidationError$Outbound }
50
+ | undefined;
51
+ quantity?: string | undefined;
52
+ };
53
+
54
+ /** @internal */
55
+ export const InvoiceLineItemValidationError$outboundSchema: z.ZodType<
56
+ InvoiceLineItemValidationError$Outbound,
57
+ z.ZodTypeDef,
58
+ InvoiceLineItemValidationError
59
+ > = z.object({
60
+ productID: z.string().optional(),
61
+ name: z.string().optional(),
62
+ basePrice: AmountDecimalValidationError$outboundSchema.optional(),
63
+ options: z.record(InvoiceLineItemOptionValidationError$outboundSchema)
64
+ .optional(),
65
+ quantity: z.string().optional(),
66
+ });
67
+
68
+ export function invoiceLineItemValidationErrorToJSON(
69
+ invoiceLineItemValidationError: InvoiceLineItemValidationError,
70
+ ): string {
71
+ return JSON.stringify(
72
+ InvoiceLineItemValidationError$outboundSchema.parse(
73
+ invoiceLineItemValidationError,
74
+ ),
75
+ );
76
+ }
77
+ export function invoiceLineItemValidationErrorFromJSON(
78
+ jsonString: string,
79
+ ): SafeParseResult<InvoiceLineItemValidationError, SDKValidationError> {
80
+ return safeParse(
81
+ jsonString,
82
+ (x) => InvoiceLineItemValidationError$inboundSchema.parse(JSON.parse(x)),
83
+ `Failed to parse 'InvoiceLineItemValidationError' from JSON`,
84
+ );
85
+ }
@@ -0,0 +1,77 @@
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
+ InvoiceExternalPayment,
11
+ InvoiceExternalPayment$inboundSchema,
12
+ InvoiceExternalPayment$Outbound,
13
+ InvoiceExternalPayment$outboundSchema,
14
+ } from "./invoiceexternalpayment.js";
15
+ import {
16
+ InvoiceTransferPayment,
17
+ InvoiceTransferPayment$inboundSchema,
18
+ InvoiceTransferPayment$Outbound,
19
+ InvoiceTransferPayment$outboundSchema,
20
+ } from "./invoicetransferpayment.js";
21
+
22
+ export type InvoicePayment =
23
+ | (InvoiceExternalPayment & { paymentType: "external" })
24
+ | (InvoiceTransferPayment & { paymentType: "transfer" });
25
+
26
+ /** @internal */
27
+ export const InvoicePayment$inboundSchema: z.ZodType<
28
+ InvoicePayment,
29
+ z.ZodTypeDef,
30
+ unknown
31
+ > = z.union([
32
+ InvoiceExternalPayment$inboundSchema.and(
33
+ z.object({ paymentType: z.literal("external") }).transform((v) => ({
34
+ paymentType: v.paymentType,
35
+ })),
36
+ ),
37
+ InvoiceTransferPayment$inboundSchema.and(
38
+ z.object({ paymentType: z.literal("transfer") }).transform((v) => ({
39
+ paymentType: v.paymentType,
40
+ })),
41
+ ),
42
+ ]);
43
+ /** @internal */
44
+ export type InvoicePayment$Outbound =
45
+ | (InvoiceExternalPayment$Outbound & { paymentType: "external" })
46
+ | (InvoiceTransferPayment$Outbound & { paymentType: "transfer" });
47
+
48
+ /** @internal */
49
+ export const InvoicePayment$outboundSchema: z.ZodType<
50
+ InvoicePayment$Outbound,
51
+ z.ZodTypeDef,
52
+ InvoicePayment
53
+ > = z.union([
54
+ InvoiceExternalPayment$outboundSchema.and(
55
+ z.object({ paymentType: z.literal("external") }).transform((v) => ({
56
+ paymentType: v.paymentType,
57
+ })),
58
+ ),
59
+ InvoiceTransferPayment$outboundSchema.and(
60
+ z.object({ paymentType: z.literal("transfer") }).transform((v) => ({
61
+ paymentType: v.paymentType,
62
+ })),
63
+ ),
64
+ ]);
65
+
66
+ export function invoicePaymentToJSON(invoicePayment: InvoicePayment): string {
67
+ return JSON.stringify(InvoicePayment$outboundSchema.parse(invoicePayment));
68
+ }
69
+ export function invoicePaymentFromJSON(
70
+ jsonString: string,
71
+ ): SafeParseResult<InvoicePayment, SDKValidationError> {
72
+ return safeParse(
73
+ jsonString,
74
+ (x) => InvoicePayment$inboundSchema.parse(JSON.parse(x)),
75
+ `Failed to parse 'InvoicePayment' from JSON`,
76
+ );
77
+ }
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const InvoiceStatus = {
9
+ Draft: "draft",
10
+ Unpaid: "unpaid",
11
+ PaymentPending: "payment-pending",
12
+ Paid: "paid",
13
+ Overdue: "overdue",
14
+ Canceled: "canceled",
15
+ } as const;
16
+ export type InvoiceStatus = ClosedEnum<typeof InvoiceStatus>;
17
+
18
+ /** @internal */
19
+ export const InvoiceStatus$inboundSchema: z.ZodNativeEnum<
20
+ typeof InvoiceStatus
21
+ > = z.nativeEnum(InvoiceStatus);
22
+ /** @internal */
23
+ export const InvoiceStatus$outboundSchema: z.ZodNativeEnum<
24
+ typeof InvoiceStatus
25
+ > = InvoiceStatus$inboundSchema;
@@ -0,0 +1,68 @@
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 { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export const PaymentType = {
12
+ Transfer: "transfer",
13
+ } as const;
14
+ export type PaymentType = ClosedEnum<typeof PaymentType>;
15
+
16
+ export type InvoiceTransferPayment = {
17
+ paymentType: PaymentType;
18
+ transferID: string;
19
+ };
20
+
21
+ /** @internal */
22
+ export const PaymentType$inboundSchema: z.ZodNativeEnum<typeof PaymentType> = z
23
+ .nativeEnum(PaymentType);
24
+ /** @internal */
25
+ export const PaymentType$outboundSchema: z.ZodNativeEnum<typeof PaymentType> =
26
+ PaymentType$inboundSchema;
27
+
28
+ /** @internal */
29
+ export const InvoiceTransferPayment$inboundSchema: z.ZodType<
30
+ InvoiceTransferPayment,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.object({
34
+ paymentType: PaymentType$inboundSchema,
35
+ transferID: z.string(),
36
+ });
37
+ /** @internal */
38
+ export type InvoiceTransferPayment$Outbound = {
39
+ paymentType: string;
40
+ transferID: string;
41
+ };
42
+
43
+ /** @internal */
44
+ export const InvoiceTransferPayment$outboundSchema: z.ZodType<
45
+ InvoiceTransferPayment$Outbound,
46
+ z.ZodTypeDef,
47
+ InvoiceTransferPayment
48
+ > = z.object({
49
+ paymentType: PaymentType$outboundSchema,
50
+ transferID: z.string(),
51
+ });
52
+
53
+ export function invoiceTransferPaymentToJSON(
54
+ invoiceTransferPayment: InvoiceTransferPayment,
55
+ ): string {
56
+ return JSON.stringify(
57
+ InvoiceTransferPayment$outboundSchema.parse(invoiceTransferPayment),
58
+ );
59
+ }
60
+ export function invoiceTransferPaymentFromJSON(
61
+ jsonString: string,
62
+ ): SafeParseResult<InvoiceTransferPayment, SDKValidationError> {
63
+ return safeParse(
64
+ jsonString,
65
+ (x) => InvoiceTransferPayment$inboundSchema.parse(JSON.parse(x)),
66
+ `Failed to parse 'InvoiceTransferPayment' from JSON`,
67
+ );
68
+ }
@@ -0,0 +1,58 @@
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
+ }
@@ -12,6 +12,12 @@ import {
12
12
  AmountDecimal$Outbound,
13
13
  AmountDecimal$outboundSchema,
14
14
  } from "./amountdecimal.js";
15
+ import {
16
+ PaymentLinkLineItemImageMetadata,
17
+ PaymentLinkLineItemImageMetadata$inboundSchema,
18
+ PaymentLinkLineItemImageMetadata$Outbound,
19
+ PaymentLinkLineItemImageMetadata$outboundSchema,
20
+ } from "./paymentlinklineitemimagemetadata.js";
15
21
  import {
16
22
  PaymentLinkLineItemOption,
17
23
  PaymentLinkLineItemOption$inboundSchema,
@@ -39,6 +45,10 @@ export type PaymentLinkLineItem = {
39
45
  * Optional list of modifiers applied to this item (e.g., toppings, upgrades, customizations).
40
46
  */
41
47
  options?: Array<PaymentLinkLineItemOption> | undefined;
48
+ /**
49
+ * Optional list of images associated with this line item.
50
+ */
51
+ images?: Array<PaymentLinkLineItemImageMetadata> | undefined;
42
52
  /**
43
53
  * Optional unique identifier associating the line item with a product.
44
54
  */
@@ -55,6 +65,7 @@ export const PaymentLinkLineItem$inboundSchema: z.ZodType<
55
65
  basePrice: AmountDecimal$inboundSchema,
56
66
  quantity: z.number().int(),
57
67
  options: z.array(PaymentLinkLineItemOption$inboundSchema).optional(),
68
+ images: z.array(PaymentLinkLineItemImageMetadata$inboundSchema).optional(),
58
69
  productID: z.string().optional(),
59
70
  });
60
71
  /** @internal */
@@ -63,6 +74,7 @@ export type PaymentLinkLineItem$Outbound = {
63
74
  basePrice: AmountDecimal$Outbound;
64
75
  quantity: number;
65
76
  options?: Array<PaymentLinkLineItemOption$Outbound> | undefined;
77
+ images?: Array<PaymentLinkLineItemImageMetadata$Outbound> | undefined;
66
78
  productID?: string | undefined;
67
79
  };
68
80
 
@@ -76,6 +88,7 @@ export const PaymentLinkLineItem$outboundSchema: z.ZodType<
76
88
  basePrice: AmountDecimal$outboundSchema,
77
89
  quantity: z.number().int(),
78
90
  options: z.array(PaymentLinkLineItemOption$outboundSchema).optional(),
91
+ images: z.array(PaymentLinkLineItemImageMetadata$outboundSchema).optional(),
79
92
  productID: z.string().optional(),
80
93
  });
81
94
 
@@ -0,0 +1,77 @@
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 PaymentLinkLineItemImageMetadata = {
11
+ /**
12
+ * Unique identifier for a image resource.
13
+ */
14
+ imageID: string;
15
+ /**
16
+ * Alternative text for the image.
17
+ */
18
+ altText?: string | undefined;
19
+ /**
20
+ * The image's public URL.
21
+ */
22
+ link: string;
23
+ /**
24
+ * A unique identifier for an image, used in public image links.
25
+ */
26
+ publicID: string;
27
+ };
28
+
29
+ /** @internal */
30
+ export const PaymentLinkLineItemImageMetadata$inboundSchema: z.ZodType<
31
+ PaymentLinkLineItemImageMetadata,
32
+ z.ZodTypeDef,
33
+ unknown
34
+ > = z.object({
35
+ imageID: z.string(),
36
+ altText: z.string().optional(),
37
+ link: z.string(),
38
+ publicID: z.string(),
39
+ });
40
+ /** @internal */
41
+ export type PaymentLinkLineItemImageMetadata$Outbound = {
42
+ imageID: string;
43
+ altText?: string | undefined;
44
+ link: string;
45
+ publicID: string;
46
+ };
47
+
48
+ /** @internal */
49
+ export const PaymentLinkLineItemImageMetadata$outboundSchema: z.ZodType<
50
+ PaymentLinkLineItemImageMetadata$Outbound,
51
+ z.ZodTypeDef,
52
+ PaymentLinkLineItemImageMetadata
53
+ > = z.object({
54
+ imageID: z.string(),
55
+ altText: z.string().optional(),
56
+ link: z.string(),
57
+ publicID: z.string(),
58
+ });
59
+
60
+ export function paymentLinkLineItemImageMetadataToJSON(
61
+ paymentLinkLineItemImageMetadata: PaymentLinkLineItemImageMetadata,
62
+ ): string {
63
+ return JSON.stringify(
64
+ PaymentLinkLineItemImageMetadata$outboundSchema.parse(
65
+ paymentLinkLineItemImageMetadata,
66
+ ),
67
+ );
68
+ }
69
+ export function paymentLinkLineItemImageMetadataFromJSON(
70
+ jsonString: string,
71
+ ): SafeParseResult<PaymentLinkLineItemImageMetadata, SDKValidationError> {
72
+ return safeParse(
73
+ jsonString,
74
+ (x) => PaymentLinkLineItemImageMetadata$inboundSchema.parse(JSON.parse(x)),
75
+ `Failed to parse 'PaymentLinkLineItemImageMetadata' from JSON`,
76
+ );
77
+ }
@@ -12,6 +12,12 @@ import {
12
12
  AmountDecimal$Outbound,
13
13
  AmountDecimal$outboundSchema,
14
14
  } from "./amountdecimal.js";
15
+ import {
16
+ PaymentLinkLineItemImageMetadata,
17
+ PaymentLinkLineItemImageMetadata$inboundSchema,
18
+ PaymentLinkLineItemImageMetadata$Outbound,
19
+ PaymentLinkLineItemImageMetadata$outboundSchema,
20
+ } from "./paymentlinklineitemimagemetadata.js";
15
21
 
16
22
  /**
17
23
  * Represents a modifier or option applied to a line item.
@@ -29,6 +35,10 @@ export type PaymentLinkLineItemOption = {
29
35
  * Optional price modification applied by this option. Can be positive, negative, or zero.
30
36
  */
31
37
  priceModifier?: AmountDecimal | undefined;
38
+ /**
39
+ * Optional list of images associated with this line item option.
40
+ */
41
+ images?: Array<PaymentLinkLineItemImageMetadata> | undefined;
32
42
  /**
33
43
  * Optional group identifier to categorize related options (e.g., 'toppings').
34
44
  */
@@ -44,6 +54,7 @@ export const PaymentLinkLineItemOption$inboundSchema: z.ZodType<
44
54
  name: z.string(),
45
55
  quantity: z.number().int(),
46
56
  priceModifier: AmountDecimal$inboundSchema.optional(),
57
+ images: z.array(PaymentLinkLineItemImageMetadata$inboundSchema).optional(),
47
58
  group: z.string().optional(),
48
59
  });
49
60
  /** @internal */
@@ -51,6 +62,7 @@ export type PaymentLinkLineItemOption$Outbound = {
51
62
  name: string;
52
63
  quantity: number;
53
64
  priceModifier?: AmountDecimal$Outbound | undefined;
65
+ images?: Array<PaymentLinkLineItemImageMetadata$Outbound> | undefined;
54
66
  group?: string | undefined;
55
67
  };
56
68
 
@@ -63,6 +75,7 @@ export const PaymentLinkLineItemOption$outboundSchema: z.ZodType<
63
75
  name: z.string(),
64
76
  quantity: z.number().int(),
65
77
  priceModifier: AmountDecimal$outboundSchema.optional(),
78
+ images: z.array(PaymentLinkLineItemImageMetadata$outboundSchema).optional(),
66
79
  group: z.string().optional(),
67
80
  });
68
81
 
@@ -0,0 +1,94 @@
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
+ AmountDecimalUpdate,
11
+ AmountDecimalUpdate$inboundSchema,
12
+ AmountDecimalUpdate$Outbound,
13
+ AmountDecimalUpdate$outboundSchema,
14
+ } from "./amountdecimalupdate.js";
15
+ import {
16
+ InvoiceLineItemsUpdate,
17
+ InvoiceLineItemsUpdate$inboundSchema,
18
+ InvoiceLineItemsUpdate$Outbound,
19
+ InvoiceLineItemsUpdate$outboundSchema,
20
+ } from "./invoicelineitemsupdate.js";
21
+ import {
22
+ InvoiceStatus,
23
+ InvoiceStatus$inboundSchema,
24
+ InvoiceStatus$outboundSchema,
25
+ } from "./invoicestatus.js";
26
+
27
+ export type UpdateInvoice = {
28
+ description?: string | undefined;
29
+ /**
30
+ * A collection of line items for an invoice.
31
+ */
32
+ lineItems?: InvoiceLineItemsUpdate | undefined;
33
+ invoiceDate?: Date | null | undefined;
34
+ dueDate?: Date | null | undefined;
35
+ /**
36
+ * Status can only be updated to `canceled` when the status is either `draft`, `unpaid`, or `overdue`.
37
+ */
38
+ status?: InvoiceStatus | undefined;
39
+ taxAmount?: AmountDecimalUpdate | undefined;
40
+ };
41
+
42
+ /** @internal */
43
+ export const UpdateInvoice$inboundSchema: z.ZodType<
44
+ UpdateInvoice,
45
+ z.ZodTypeDef,
46
+ unknown
47
+ > = z.object({
48
+ description: z.string().optional(),
49
+ lineItems: InvoiceLineItemsUpdate$inboundSchema.optional(),
50
+ invoiceDate: z.nullable(
51
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
52
+ ).optional(),
53
+ dueDate: z.nullable(
54
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
55
+ ).optional(),
56
+ status: InvoiceStatus$inboundSchema.optional(),
57
+ taxAmount: AmountDecimalUpdate$inboundSchema.optional(),
58
+ });
59
+ /** @internal */
60
+ export type UpdateInvoice$Outbound = {
61
+ description?: string | undefined;
62
+ lineItems?: InvoiceLineItemsUpdate$Outbound | undefined;
63
+ invoiceDate?: string | null | undefined;
64
+ dueDate?: string | null | undefined;
65
+ status?: string | undefined;
66
+ taxAmount?: AmountDecimalUpdate$Outbound | undefined;
67
+ };
68
+
69
+ /** @internal */
70
+ export const UpdateInvoice$outboundSchema: z.ZodType<
71
+ UpdateInvoice$Outbound,
72
+ z.ZodTypeDef,
73
+ UpdateInvoice
74
+ > = z.object({
75
+ description: z.string().optional(),
76
+ lineItems: InvoiceLineItemsUpdate$outboundSchema.optional(),
77
+ invoiceDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
78
+ dueDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
79
+ status: InvoiceStatus$outboundSchema.optional(),
80
+ taxAmount: AmountDecimalUpdate$outboundSchema.optional(),
81
+ });
82
+
83
+ export function updateInvoiceToJSON(updateInvoice: UpdateInvoice): string {
84
+ return JSON.stringify(UpdateInvoice$outboundSchema.parse(updateInvoice));
85
+ }
86
+ export function updateInvoiceFromJSON(
87
+ jsonString: string,
88
+ ): SafeParseResult<UpdateInvoice, SDKValidationError> {
89
+ return safeParse(
90
+ jsonString,
91
+ (x) => UpdateInvoice$inboundSchema.parse(JSON.parse(x)),
92
+ `Failed to parse 'UpdateInvoice' from JSON`,
93
+ );
94
+ }