@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,185 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { MoovCore } from "../core.js";
6
+ import { 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 { MoovError } from "../models/errors/mooverror.js";
21
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ /**
28
+ * Retrieve an invoice by ID.
29
+ *
30
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
31
+ * you'll need to specify the `/accounts/{accountID}/invoices.read` scope.
32
+ */
33
+ export function invoicesGetInvoice(
34
+ client: MoovCore,
35
+ request: operations.GetInvoiceRequest,
36
+ options?: RequestOptions,
37
+ ): APIPromise<
38
+ Result<
39
+ operations.GetInvoiceResponse,
40
+ | MoovError
41
+ | ResponseValidationError
42
+ | ConnectionError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | InvalidRequestError
46
+ | UnexpectedClientError
47
+ | SDKValidationError
48
+ >
49
+ > {
50
+ return new APIPromise($do(
51
+ client,
52
+ request,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ async function $do(
58
+ client: MoovCore,
59
+ request: operations.GetInvoiceRequest,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ operations.GetInvoiceResponse,
65
+ | MoovError
66
+ | ResponseValidationError
67
+ | ConnectionError
68
+ | RequestAbortedError
69
+ | RequestTimeoutError
70
+ | InvalidRequestError
71
+ | UnexpectedClientError
72
+ | SDKValidationError
73
+ >,
74
+ APICall,
75
+ ]
76
+ > {
77
+ const parsed = safeParse(
78
+ request,
79
+ (value) => operations.GetInvoiceRequest$outboundSchema.parse(value),
80
+ "Input validation failed",
81
+ );
82
+ if (!parsed.ok) {
83
+ return [parsed, { status: "invalid" }];
84
+ }
85
+ const payload = parsed.value;
86
+ const body = null;
87
+
88
+ const pathParams = {
89
+ accountID: encodeSimple("accountID", payload.accountID, {
90
+ explode: false,
91
+ charEncoding: "percent",
92
+ }),
93
+ invoiceID: encodeSimple("invoiceID", payload.invoiceID, {
94
+ explode: false,
95
+ charEncoding: "percent",
96
+ }),
97
+ };
98
+
99
+ const path = pathToFunc("/accounts/{accountID}/invoices/{invoiceID}")(
100
+ pathParams,
101
+ );
102
+
103
+ const headers = new Headers(compactMap({
104
+ Accept: "application/json",
105
+ "X-Moov-Version": encodeSimple(
106
+ "X-Moov-Version",
107
+ client._options.xMoovVersion,
108
+ { explode: false, charEncoding: "none" },
109
+ ),
110
+ }));
111
+
112
+ const securityInput = await extractSecurity(client._options.security);
113
+ const requestSecurity = resolveGlobalSecurity(securityInput);
114
+
115
+ const context = {
116
+ options: client._options,
117
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
118
+ operationID: "getInvoice",
119
+ oAuth2Scopes: null,
120
+
121
+ resolvedSecurity: requestSecurity,
122
+
123
+ securitySource: client._options.security,
124
+ retryConfig: options?.retries
125
+ || client._options.retryConfig
126
+ || { strategy: "none" },
127
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
128
+ };
129
+
130
+ const requestRes = client._createRequest(context, {
131
+ security: requestSecurity,
132
+ method: "GET",
133
+ baseURL: options?.serverURL,
134
+ path: path,
135
+ headers: headers,
136
+ body: body,
137
+ userAgent: client._options.userAgent,
138
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
139
+ }, options);
140
+ if (!requestRes.ok) {
141
+ return [requestRes, { status: "invalid" }];
142
+ }
143
+ const req = requestRes.value;
144
+
145
+ const doResult = await client._do(req, {
146
+ context,
147
+ errorCodes: ["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
148
+ retryConfig: context.retryConfig,
149
+ retryCodes: context.retryCodes,
150
+ });
151
+ if (!doResult.ok) {
152
+ return [doResult, { status: "request-error", request: req }];
153
+ }
154
+ const response = doResult.value;
155
+
156
+ const responseFields = {
157
+ HttpMeta: { Response: response, Request: req },
158
+ };
159
+
160
+ const [result] = await M.match<
161
+ operations.GetInvoiceResponse,
162
+ | MoovError
163
+ | ResponseValidationError
164
+ | ConnectionError
165
+ | RequestAbortedError
166
+ | RequestTimeoutError
167
+ | InvalidRequestError
168
+ | UnexpectedClientError
169
+ | SDKValidationError
170
+ >(
171
+ M.json(200, operations.GetInvoiceResponse$inboundSchema, {
172
+ hdrs: true,
173
+ key: "Result",
174
+ }),
175
+ M.fail([401, 403, 404, 429]),
176
+ M.fail([500, 504]),
177
+ M.fail("4XX"),
178
+ M.fail("5XX"),
179
+ )(response, req, { extraFields: responseFields });
180
+ if (!result.ok) {
181
+ return [result, { status: "complete", request: req, response }];
182
+ }
183
+
184
+ return [result, { status: "complete", request: req, response }];
185
+ }
@@ -0,0 +1,194 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { MoovCore } from "../core.js";
6
+ import { encodeFormQuery, 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
+ * List all the invoices created under a Moov account.
30
+ *
31
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
32
+ * you'll need to specify the `/accounts/{accountID}/invoices.read` scope.
33
+ */
34
+ export function invoicesListInvoices(
35
+ client: MoovCore,
36
+ request: operations.ListInvoicesRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ operations.ListInvoicesResponse,
41
+ | errors.ListInvoicesValidationError
42
+ | MoovError
43
+ | ResponseValidationError
44
+ | ConnectionError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | InvalidRequestError
48
+ | UnexpectedClientError
49
+ | SDKValidationError
50
+ >
51
+ > {
52
+ return new APIPromise($do(
53
+ client,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: MoovCore,
61
+ request: operations.ListInvoicesRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ operations.ListInvoicesResponse,
67
+ | errors.ListInvoicesValidationError
68
+ | MoovError
69
+ | ResponseValidationError
70
+ | ConnectionError
71
+ | RequestAbortedError
72
+ | RequestTimeoutError
73
+ | InvalidRequestError
74
+ | UnexpectedClientError
75
+ | SDKValidationError
76
+ >,
77
+ APICall,
78
+ ]
79
+ > {
80
+ const parsed = safeParse(
81
+ request,
82
+ (value) => operations.ListInvoicesRequest$outboundSchema.parse(value),
83
+ "Input validation failed",
84
+ );
85
+ if (!parsed.ok) {
86
+ return [parsed, { status: "invalid" }];
87
+ }
88
+ const payload = parsed.value;
89
+ const body = null;
90
+
91
+ const pathParams = {
92
+ accountID: encodeSimple("accountID", payload.accountID, {
93
+ explode: false,
94
+ charEncoding: "percent",
95
+ }),
96
+ };
97
+
98
+ const path = pathToFunc("/accounts/{accountID}/invoices")(pathParams);
99
+
100
+ const query = encodeFormQuery({
101
+ "count": payload.count,
102
+ "customerAccountID": payload.customerAccountID,
103
+ "skip": payload.skip,
104
+ "status": payload.status,
105
+ }, { explode: false });
106
+
107
+ const headers = new Headers(compactMap({
108
+ Accept: "application/json",
109
+ "X-Moov-Version": encodeSimple(
110
+ "X-Moov-Version",
111
+ client._options.xMoovVersion,
112
+ { explode: false, charEncoding: "none" },
113
+ ),
114
+ }));
115
+
116
+ const securityInput = await extractSecurity(client._options.security);
117
+ const requestSecurity = resolveGlobalSecurity(securityInput);
118
+
119
+ const context = {
120
+ options: client._options,
121
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
122
+ operationID: "listInvoices",
123
+ oAuth2Scopes: null,
124
+
125
+ resolvedSecurity: requestSecurity,
126
+
127
+ securitySource: client._options.security,
128
+ retryConfig: options?.retries
129
+ || client._options.retryConfig
130
+ || { strategy: "none" },
131
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
132
+ };
133
+
134
+ const requestRes = client._createRequest(context, {
135
+ security: requestSecurity,
136
+ method: "GET",
137
+ baseURL: options?.serverURL,
138
+ path: path,
139
+ headers: headers,
140
+ query: query,
141
+ body: body,
142
+ userAgent: client._options.userAgent,
143
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
144
+ }, options);
145
+ if (!requestRes.ok) {
146
+ return [requestRes, { status: "invalid" }];
147
+ }
148
+ const req = requestRes.value;
149
+
150
+ const doResult = await client._do(req, {
151
+ context,
152
+ errorCodes: ["401", "403", "422", "429", "4XX", "500", "504", "5XX"],
153
+ retryConfig: context.retryConfig,
154
+ retryCodes: context.retryCodes,
155
+ });
156
+ if (!doResult.ok) {
157
+ return [doResult, { status: "request-error", request: req }];
158
+ }
159
+ const response = doResult.value;
160
+
161
+ const responseFields = {
162
+ HttpMeta: { Response: response, Request: req },
163
+ };
164
+
165
+ const [result] = await M.match<
166
+ operations.ListInvoicesResponse,
167
+ | errors.ListInvoicesValidationError
168
+ | MoovError
169
+ | ResponseValidationError
170
+ | ConnectionError
171
+ | RequestAbortedError
172
+ | RequestTimeoutError
173
+ | InvalidRequestError
174
+ | UnexpectedClientError
175
+ | SDKValidationError
176
+ >(
177
+ M.json(200, operations.ListInvoicesResponse$inboundSchema, {
178
+ hdrs: true,
179
+ key: "Result",
180
+ }),
181
+ M.jsonErr(422, errors.ListInvoicesValidationError$inboundSchema, {
182
+ hdrs: true,
183
+ }),
184
+ M.fail([401, 403, 429]),
185
+ M.fail([500, 504]),
186
+ M.fail("4XX"),
187
+ M.fail("5XX"),
188
+ )(response, req, { extraFields: responseFields });
189
+ if (!result.ok) {
190
+ return [result, { status: "complete", request: req, response }];
191
+ }
192
+
193
+ return [result, { status: "complete", request: req, response }];
194
+ }
@@ -0,0 +1,208 @@
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: "PUT",
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
+ }