@chrt-inc/typescript-sdk 1.891.0 → 1.892.0

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 (328) hide show
  1. package/dist/cjs/Client.d.ts +3 -0
  2. package/dist/cjs/Client.js +23 -18
  3. package/dist/cjs/api/resources/billingNew/client/Client.d.ts +29 -0
  4. package/dist/cjs/api/resources/billingNew/client/Client.js +27 -0
  5. package/dist/cjs/api/resources/billingNew/client/index.d.ts +1 -0
  6. package/dist/cjs/api/resources/billingNew/client/index.js +2 -0
  7. package/dist/cjs/api/resources/billingNew/index.d.ts +2 -0
  8. package/dist/cjs/api/resources/billingNew/index.js +18 -0
  9. package/dist/cjs/api/resources/billingNew/resources/index.d.ts +6 -0
  10. package/dist/cjs/api/resources/billingNew/resources/index.js +45 -0
  11. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/Client.d.ts +180 -0
  12. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/Client.js +639 -0
  13. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/index.d.ts +2 -0
  14. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/index.js +17 -0
  15. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/ApplyChrtGroundProviderRatesReq.d.ts +22 -0
  16. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/ApplyChrtGroundProviderRatesReq.js +5 -0
  17. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.d.ts +28 -0
  18. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.js +5 -0
  19. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.d.ts +45 -0
  20. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.js +5 -0
  21. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemClientUpdate1.d.ts +19 -0
  22. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemClientUpdate1.js +5 -0
  23. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsDeleteManyReq.d.ts +12 -0
  24. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsDeleteManyReq.js +5 -0
  25. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsListV1Request.d.ts +62 -0
  26. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsListV1Request.js +5 -0
  27. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.d.ts +6 -0
  28. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.js +2 -0
  29. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/index.d.ts +1 -0
  30. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/index.js +17 -0
  31. package/dist/cjs/api/resources/billingNew/resources/invoices/client/Client.d.ts +217 -0
  32. package/dist/cjs/api/resources/billingNew/resources/invoices/client/Client.js +880 -0
  33. package/dist/cjs/api/resources/billingNew/resources/invoices/client/index.d.ts +2 -0
  34. package/dist/cjs/api/resources/billingNew/resources/invoices/client/index.js +17 -0
  35. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoiceClientCreate1.d.ts +24 -0
  36. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoiceClientCreate1.js +5 -0
  37. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoiceClientUpdate1.d.ts +13 -0
  38. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoiceClientUpdate1.js +5 -0
  39. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoiceLineItemsAddReq.d.ts +12 -0
  40. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoiceLineItemsAddReq.js +5 -0
  41. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoiceLineItemsRemoveReq.d.ts +12 -0
  42. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoiceLineItemsRemoveReq.js +5 -0
  43. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoiceVoidReq.d.ts +10 -0
  44. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoiceVoidReq.js +5 -0
  45. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoicesListV1Request.d.ts +51 -0
  46. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/InvoicesListV1Request.js +5 -0
  47. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/index.d.ts +6 -0
  48. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/index.js +2 -0
  49. package/dist/cjs/api/resources/billingNew/resources/invoices/index.d.ts +1 -0
  50. package/dist/cjs/api/resources/billingNew/resources/invoices/index.js +17 -0
  51. package/dist/cjs/api/resources/billingNew/resources/rates/client/Client.d.ts +145 -0
  52. package/dist/cjs/api/resources/billingNew/resources/rates/client/Client.js +578 -0
  53. package/dist/cjs/api/resources/billingNew/resources/rates/client/index.d.ts +2 -0
  54. package/dist/cjs/api/resources/billingNew/resources/rates/client/index.js +17 -0
  55. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesAddCounterpartiesReq.d.ts +13 -0
  56. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesAddCounterpartiesReq.js +5 -0
  57. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesClientCreate1.d.ts +37 -0
  58. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesClientCreate1.js +5 -0
  59. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesClientUpdate1.d.ts +43 -0
  60. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesClientUpdate1.js +5 -0
  61. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesRemoveCounterpartiesReq.d.ts +13 -0
  62. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesRemoveCounterpartiesReq.js +5 -0
  63. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/RatesListV1Request.d.ts +54 -0
  64. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/RatesListV1Request.js +5 -0
  65. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/index.d.ts +5 -0
  66. package/dist/cjs/api/resources/billingNew/resources/rates/client/requests/index.js +2 -0
  67. package/dist/cjs/api/resources/billingNew/resources/rates/index.d.ts +1 -0
  68. package/dist/cjs/api/resources/billingNew/resources/rates/index.js +17 -0
  69. package/dist/cjs/api/resources/index.d.ts +1 -0
  70. package/dist/cjs/api/resources/index.js +2 -1
  71. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.d.ts +4 -0
  72. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.js +36 -20
  73. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForCoordinatorOperatorsV1Request.d.ts +3 -0
  74. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForExecutorOperatorsV1Request.d.ts +3 -0
  75. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForProviderOperatorsV1Request.d.ts +3 -0
  76. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForShipperOperatorsV1Request.d.ts +3 -0
  77. package/dist/cjs/api/types/AdditionalMileageRate1.d.ts +9 -0
  78. package/dist/cjs/api/types/AdditionalMileageRate1.js +5 -0
  79. package/dist/cjs/api/types/AfterHoursRate1.d.ts +7 -0
  80. package/dist/cjs/api/types/AfterHoursRate1.js +5 -0
  81. package/dist/cjs/api/types/ApplyChrtGroundProviderRatesRes.d.ts +7 -0
  82. package/dist/cjs/api/types/ApplyChrtGroundProviderRatesRes.js +5 -0
  83. package/dist/cjs/api/types/AttemptRate1.d.ts +7 -0
  84. package/dist/cjs/api/types/AttemptRate1.js +5 -0
  85. package/dist/cjs/api/types/BaseMileageRate1.d.ts +8 -0
  86. package/dist/cjs/api/types/BaseMileageRate1.js +5 -0
  87. package/dist/cjs/api/types/BillingCurrencyCodeEnum1.d.ts +17 -0
  88. package/dist/cjs/api/types/BillingCurrencyCodeEnum1.js +19 -0
  89. package/dist/cjs/api/types/CargoTypeEnum1.d.ts +8 -1
  90. package/dist/cjs/api/types/CargoTypeEnum1.js +7 -0
  91. package/dist/cjs/api/types/ChrtGroundProviderRates1.d.ts +35 -0
  92. package/dist/cjs/api/types/ChrtGroundProviderRates1.js +5 -0
  93. package/dist/cjs/api/types/ChrtGroundProviderRatesListRes.d.ts +8 -0
  94. package/dist/cjs/api/types/ChrtGroundProviderRatesListRes.js +5 -0
  95. package/dist/cjs/api/types/ChrtGroundProviderRatesSortByEnum.d.ts +10 -0
  96. package/dist/cjs/api/types/ChrtGroundProviderRatesSortByEnum.js +12 -0
  97. package/dist/cjs/api/types/CreateInvoiceLineItemsFromAmountRes.d.ts +7 -0
  98. package/dist/cjs/api/types/CreateInvoiceLineItemsFromAmountRes.js +5 -0
  99. package/dist/cjs/api/types/CreateInvoiceLineItemsFromLineItemsRes.d.ts +7 -0
  100. package/dist/cjs/api/types/CreateInvoiceLineItemsFromLineItemsRes.js +5 -0
  101. package/dist/cjs/api/types/DangerousGoodsRate1.d.ts +7 -0
  102. package/dist/cjs/api/types/DangerousGoodsRate1.js +5 -0
  103. package/dist/cjs/api/types/ExtraStopRate1.d.ts +7 -0
  104. package/dist/cjs/api/types/ExtraStopRate1.js +5 -0
  105. package/dist/cjs/api/types/FlatFeeRate1.d.ts +7 -0
  106. package/dist/cjs/api/types/FlatFeeRate1.js +5 -0
  107. package/dist/cjs/api/types/FuelSurchargeRate1.d.ts +7 -0
  108. package/dist/cjs/api/types/FuelSurchargeRate1.js +5 -0
  109. package/dist/cjs/api/types/HolidayRate1.d.ts +7 -0
  110. package/dist/cjs/api/types/HolidayRate1.js +5 -0
  111. package/dist/cjs/api/types/Invoice1.d.ts +57 -0
  112. package/dist/cjs/api/types/Invoice1.js +5 -0
  113. package/dist/cjs/api/types/InvoiceExpandedRes.d.ts +11 -0
  114. package/dist/cjs/api/types/InvoiceExpandedRes.js +5 -0
  115. package/dist/cjs/api/types/InvoiceLineItem1.d.ts +31 -0
  116. package/dist/cjs/api/types/InvoiceLineItem1.js +5 -0
  117. package/dist/cjs/api/types/InvoiceLineItemAmountTransformation1.d.ts +8 -0
  118. package/dist/cjs/api/types/InvoiceLineItemAmountTransformation1.js +5 -0
  119. package/dist/cjs/api/types/InvoiceLineItemAmountTransformationTypeEnum1.d.ts +9 -0
  120. package/dist/cjs/api/types/InvoiceLineItemAmountTransformationTypeEnum1.js +11 -0
  121. package/dist/cjs/api/types/InvoiceLineItemListRes.d.ts +8 -0
  122. package/dist/cjs/api/types/InvoiceLineItemListRes.js +5 -0
  123. package/dist/cjs/api/types/InvoiceLineItemSortByEnum.d.ts +14 -0
  124. package/dist/cjs/api/types/InvoiceLineItemSortByEnum.js +16 -0
  125. package/dist/cjs/api/types/InvoiceLineItemTypeEnum1.d.ts +33 -0
  126. package/dist/cjs/api/types/InvoiceLineItemTypeEnum1.js +35 -0
  127. package/dist/cjs/api/types/InvoiceLineItemUnitEnum1.d.ts +14 -0
  128. package/dist/cjs/api/types/InvoiceLineItemUnitEnum1.js +16 -0
  129. package/dist/cjs/api/types/InvoiceLineItemsByOrderExpandedRes.d.ts +10 -0
  130. package/dist/cjs/api/types/InvoiceLineItemsByOrderExpandedRes.js +5 -0
  131. package/dist/cjs/api/types/InvoiceLineItemsDeleteManyRes.d.ts +6 -0
  132. package/dist/cjs/api/types/InvoiceLineItemsDeleteManyRes.js +5 -0
  133. package/dist/cjs/api/types/InvoiceListRes.d.ts +8 -0
  134. package/dist/cjs/api/types/InvoiceListRes.js +5 -0
  135. package/dist/cjs/api/types/InvoiceMergeStatusEnum1.d.ts +12 -0
  136. package/dist/cjs/api/types/InvoiceMergeStatusEnum1.js +14 -0
  137. package/dist/cjs/api/types/InvoiceSortByEnum.d.ts +11 -0
  138. package/dist/cjs/api/types/InvoiceSortByEnum.js +13 -0
  139. package/dist/cjs/api/types/InvoiceStatusEnum1.d.ts +9 -0
  140. package/dist/cjs/api/types/InvoiceStatusEnum1.js +11 -0
  141. package/dist/cjs/api/types/InvoiceStripeStatusEnum1.d.ts +11 -0
  142. package/dist/cjs/api/types/InvoiceStripeStatusEnum1.js +13 -0
  143. package/dist/cjs/api/types/InvoiceTypeEnum1.d.ts +8 -0
  144. package/dist/cjs/api/types/InvoiceTypeEnum1.js +10 -0
  145. package/dist/cjs/api/types/LongDistanceSurchargeRate1.d.ts +8 -0
  146. package/dist/cjs/api/types/LongDistanceSurchargeRate1.js +5 -0
  147. package/dist/cjs/api/types/Order1.d.ts +1 -0
  148. package/dist/cjs/api/types/OrderLimitedForCoordinator1.d.ts +1 -0
  149. package/dist/cjs/api/types/OrderLimitedForExecutor1.d.ts +1 -0
  150. package/dist/cjs/api/types/OrderLimitedForProvider1.d.ts +1 -0
  151. package/dist/cjs/api/types/OrderLimitedForShipper1.d.ts +1 -0
  152. package/dist/cjs/api/types/OrderTemplateExpanded1.d.ts +1 -0
  153. package/dist/cjs/api/types/OrderTemplateReferencesExpanded1.d.ts +1 -0
  154. package/dist/cjs/api/types/PickAndHoldRate1.d.ts +7 -0
  155. package/dist/cjs/api/types/PickAndHoldRate1.js +5 -0
  156. package/dist/cjs/api/types/WaitTimeRate1.d.ts +8 -0
  157. package/dist/cjs/api/types/WaitTimeRate1.js +5 -0
  158. package/dist/cjs/api/types/WeekendRate1.d.ts +7 -0
  159. package/dist/cjs/api/types/WeekendRate1.js +5 -0
  160. package/dist/cjs/api/types/index.d.ts +37 -0
  161. package/dist/cjs/api/types/index.js +37 -0
  162. package/dist/cjs/version.d.ts +1 -1
  163. package/dist/cjs/version.js +1 -1
  164. package/dist/esm/Client.d.mts +3 -0
  165. package/dist/esm/Client.mjs +7 -2
  166. package/dist/esm/api/resources/billingNew/client/Client.d.mts +29 -0
  167. package/dist/esm/api/resources/billingNew/client/Client.mjs +23 -0
  168. package/dist/esm/api/resources/billingNew/client/index.d.mts +1 -0
  169. package/dist/esm/api/resources/billingNew/client/index.mjs +1 -0
  170. package/dist/esm/api/resources/billingNew/index.d.mts +2 -0
  171. package/dist/esm/api/resources/billingNew/index.mjs +2 -0
  172. package/dist/esm/api/resources/billingNew/resources/index.d.mts +6 -0
  173. package/dist/esm/api/resources/billingNew/resources/index.mjs +6 -0
  174. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/Client.d.mts +180 -0
  175. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/Client.mjs +602 -0
  176. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/index.d.mts +2 -0
  177. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/index.mjs +1 -0
  178. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/ApplyChrtGroundProviderRatesReq.d.mts +22 -0
  179. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/ApplyChrtGroundProviderRatesReq.mjs +4 -0
  180. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.d.mts +28 -0
  181. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.mjs +4 -0
  182. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.d.mts +45 -0
  183. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.mjs +4 -0
  184. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemClientUpdate1.d.mts +19 -0
  185. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemClientUpdate1.mjs +4 -0
  186. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsDeleteManyReq.d.mts +12 -0
  187. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsDeleteManyReq.mjs +4 -0
  188. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsListV1Request.d.mts +62 -0
  189. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsListV1Request.mjs +4 -0
  190. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.d.mts +6 -0
  191. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.mjs +1 -0
  192. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/index.d.mts +1 -0
  193. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/index.mjs +1 -0
  194. package/dist/esm/api/resources/billingNew/resources/invoices/client/Client.d.mts +217 -0
  195. package/dist/esm/api/resources/billingNew/resources/invoices/client/Client.mjs +843 -0
  196. package/dist/esm/api/resources/billingNew/resources/invoices/client/index.d.mts +2 -0
  197. package/dist/esm/api/resources/billingNew/resources/invoices/client/index.mjs +1 -0
  198. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoiceClientCreate1.d.mts +24 -0
  199. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoiceClientCreate1.mjs +4 -0
  200. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoiceClientUpdate1.d.mts +13 -0
  201. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoiceClientUpdate1.mjs +4 -0
  202. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoiceLineItemsAddReq.d.mts +12 -0
  203. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoiceLineItemsAddReq.mjs +4 -0
  204. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoiceLineItemsRemoveReq.d.mts +12 -0
  205. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoiceLineItemsRemoveReq.mjs +4 -0
  206. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoiceVoidReq.d.mts +10 -0
  207. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoiceVoidReq.mjs +4 -0
  208. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoicesListV1Request.d.mts +51 -0
  209. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/InvoicesListV1Request.mjs +4 -0
  210. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/index.d.mts +6 -0
  211. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/index.mjs +1 -0
  212. package/dist/esm/api/resources/billingNew/resources/invoices/index.d.mts +1 -0
  213. package/dist/esm/api/resources/billingNew/resources/invoices/index.mjs +1 -0
  214. package/dist/esm/api/resources/billingNew/resources/rates/client/Client.d.mts +145 -0
  215. package/dist/esm/api/resources/billingNew/resources/rates/client/Client.mjs +541 -0
  216. package/dist/esm/api/resources/billingNew/resources/rates/client/index.d.mts +2 -0
  217. package/dist/esm/api/resources/billingNew/resources/rates/client/index.mjs +1 -0
  218. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesAddCounterpartiesReq.d.mts +13 -0
  219. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesAddCounterpartiesReq.mjs +4 -0
  220. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesClientCreate1.d.mts +37 -0
  221. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesClientCreate1.mjs +4 -0
  222. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesClientUpdate1.d.mts +43 -0
  223. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesClientUpdate1.mjs +4 -0
  224. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesRemoveCounterpartiesReq.d.mts +13 -0
  225. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/ChrtGroundProviderRatesRemoveCounterpartiesReq.mjs +4 -0
  226. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/RatesListV1Request.d.mts +54 -0
  227. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/RatesListV1Request.mjs +4 -0
  228. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/index.d.mts +5 -0
  229. package/dist/esm/api/resources/billingNew/resources/rates/client/requests/index.mjs +1 -0
  230. package/dist/esm/api/resources/billingNew/resources/rates/index.d.mts +1 -0
  231. package/dist/esm/api/resources/billingNew/resources/rates/index.mjs +1 -0
  232. package/dist/esm/api/resources/index.d.mts +1 -0
  233. package/dist/esm/api/resources/index.mjs +1 -0
  234. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.d.mts +4 -0
  235. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.mjs +36 -20
  236. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForCoordinatorOperatorsV1Request.d.mts +3 -0
  237. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForExecutorOperatorsV1Request.d.mts +3 -0
  238. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForProviderOperatorsV1Request.d.mts +3 -0
  239. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForShipperOperatorsV1Request.d.mts +3 -0
  240. package/dist/esm/api/types/AdditionalMileageRate1.d.mts +9 -0
  241. package/dist/esm/api/types/AdditionalMileageRate1.mjs +4 -0
  242. package/dist/esm/api/types/AfterHoursRate1.d.mts +7 -0
  243. package/dist/esm/api/types/AfterHoursRate1.mjs +4 -0
  244. package/dist/esm/api/types/ApplyChrtGroundProviderRatesRes.d.mts +7 -0
  245. package/dist/esm/api/types/ApplyChrtGroundProviderRatesRes.mjs +4 -0
  246. package/dist/esm/api/types/AttemptRate1.d.mts +7 -0
  247. package/dist/esm/api/types/AttemptRate1.mjs +4 -0
  248. package/dist/esm/api/types/BaseMileageRate1.d.mts +8 -0
  249. package/dist/esm/api/types/BaseMileageRate1.mjs +4 -0
  250. package/dist/esm/api/types/BillingCurrencyCodeEnum1.d.mts +17 -0
  251. package/dist/esm/api/types/BillingCurrencyCodeEnum1.mjs +16 -0
  252. package/dist/esm/api/types/CargoTypeEnum1.d.mts +8 -1
  253. package/dist/esm/api/types/CargoTypeEnum1.mjs +7 -0
  254. package/dist/esm/api/types/ChrtGroundProviderRates1.d.mts +35 -0
  255. package/dist/esm/api/types/ChrtGroundProviderRates1.mjs +4 -0
  256. package/dist/esm/api/types/ChrtGroundProviderRatesListRes.d.mts +8 -0
  257. package/dist/esm/api/types/ChrtGroundProviderRatesListRes.mjs +4 -0
  258. package/dist/esm/api/types/ChrtGroundProviderRatesSortByEnum.d.mts +10 -0
  259. package/dist/esm/api/types/ChrtGroundProviderRatesSortByEnum.mjs +9 -0
  260. package/dist/esm/api/types/CreateInvoiceLineItemsFromAmountRes.d.mts +7 -0
  261. package/dist/esm/api/types/CreateInvoiceLineItemsFromAmountRes.mjs +4 -0
  262. package/dist/esm/api/types/CreateInvoiceLineItemsFromLineItemsRes.d.mts +7 -0
  263. package/dist/esm/api/types/CreateInvoiceLineItemsFromLineItemsRes.mjs +4 -0
  264. package/dist/esm/api/types/DangerousGoodsRate1.d.mts +7 -0
  265. package/dist/esm/api/types/DangerousGoodsRate1.mjs +4 -0
  266. package/dist/esm/api/types/ExtraStopRate1.d.mts +7 -0
  267. package/dist/esm/api/types/ExtraStopRate1.mjs +4 -0
  268. package/dist/esm/api/types/FlatFeeRate1.d.mts +7 -0
  269. package/dist/esm/api/types/FlatFeeRate1.mjs +4 -0
  270. package/dist/esm/api/types/FuelSurchargeRate1.d.mts +7 -0
  271. package/dist/esm/api/types/FuelSurchargeRate1.mjs +4 -0
  272. package/dist/esm/api/types/HolidayRate1.d.mts +7 -0
  273. package/dist/esm/api/types/HolidayRate1.mjs +4 -0
  274. package/dist/esm/api/types/Invoice1.d.mts +57 -0
  275. package/dist/esm/api/types/Invoice1.mjs +4 -0
  276. package/dist/esm/api/types/InvoiceExpandedRes.d.mts +11 -0
  277. package/dist/esm/api/types/InvoiceExpandedRes.mjs +4 -0
  278. package/dist/esm/api/types/InvoiceLineItem1.d.mts +31 -0
  279. package/dist/esm/api/types/InvoiceLineItem1.mjs +4 -0
  280. package/dist/esm/api/types/InvoiceLineItemAmountTransformation1.d.mts +8 -0
  281. package/dist/esm/api/types/InvoiceLineItemAmountTransformation1.mjs +4 -0
  282. package/dist/esm/api/types/InvoiceLineItemAmountTransformationTypeEnum1.d.mts +9 -0
  283. package/dist/esm/api/types/InvoiceLineItemAmountTransformationTypeEnum1.mjs +8 -0
  284. package/dist/esm/api/types/InvoiceLineItemListRes.d.mts +8 -0
  285. package/dist/esm/api/types/InvoiceLineItemListRes.mjs +4 -0
  286. package/dist/esm/api/types/InvoiceLineItemSortByEnum.d.mts +14 -0
  287. package/dist/esm/api/types/InvoiceLineItemSortByEnum.mjs +13 -0
  288. package/dist/esm/api/types/InvoiceLineItemTypeEnum1.d.mts +33 -0
  289. package/dist/esm/api/types/InvoiceLineItemTypeEnum1.mjs +32 -0
  290. package/dist/esm/api/types/InvoiceLineItemUnitEnum1.d.mts +14 -0
  291. package/dist/esm/api/types/InvoiceLineItemUnitEnum1.mjs +13 -0
  292. package/dist/esm/api/types/InvoiceLineItemsByOrderExpandedRes.d.mts +10 -0
  293. package/dist/esm/api/types/InvoiceLineItemsByOrderExpandedRes.mjs +4 -0
  294. package/dist/esm/api/types/InvoiceLineItemsDeleteManyRes.d.mts +6 -0
  295. package/dist/esm/api/types/InvoiceLineItemsDeleteManyRes.mjs +4 -0
  296. package/dist/esm/api/types/InvoiceListRes.d.mts +8 -0
  297. package/dist/esm/api/types/InvoiceListRes.mjs +4 -0
  298. package/dist/esm/api/types/InvoiceMergeStatusEnum1.d.mts +12 -0
  299. package/dist/esm/api/types/InvoiceMergeStatusEnum1.mjs +11 -0
  300. package/dist/esm/api/types/InvoiceSortByEnum.d.mts +11 -0
  301. package/dist/esm/api/types/InvoiceSortByEnum.mjs +10 -0
  302. package/dist/esm/api/types/InvoiceStatusEnum1.d.mts +9 -0
  303. package/dist/esm/api/types/InvoiceStatusEnum1.mjs +8 -0
  304. package/dist/esm/api/types/InvoiceStripeStatusEnum1.d.mts +11 -0
  305. package/dist/esm/api/types/InvoiceStripeStatusEnum1.mjs +10 -0
  306. package/dist/esm/api/types/InvoiceTypeEnum1.d.mts +8 -0
  307. package/dist/esm/api/types/InvoiceTypeEnum1.mjs +7 -0
  308. package/dist/esm/api/types/LongDistanceSurchargeRate1.d.mts +8 -0
  309. package/dist/esm/api/types/LongDistanceSurchargeRate1.mjs +4 -0
  310. package/dist/esm/api/types/Order1.d.mts +1 -0
  311. package/dist/esm/api/types/OrderLimitedForCoordinator1.d.mts +1 -0
  312. package/dist/esm/api/types/OrderLimitedForExecutor1.d.mts +1 -0
  313. package/dist/esm/api/types/OrderLimitedForProvider1.d.mts +1 -0
  314. package/dist/esm/api/types/OrderLimitedForShipper1.d.mts +1 -0
  315. package/dist/esm/api/types/OrderTemplateExpanded1.d.mts +1 -0
  316. package/dist/esm/api/types/OrderTemplateReferencesExpanded1.d.mts +1 -0
  317. package/dist/esm/api/types/PickAndHoldRate1.d.mts +7 -0
  318. package/dist/esm/api/types/PickAndHoldRate1.mjs +4 -0
  319. package/dist/esm/api/types/WaitTimeRate1.d.mts +8 -0
  320. package/dist/esm/api/types/WaitTimeRate1.mjs +4 -0
  321. package/dist/esm/api/types/WeekendRate1.d.mts +7 -0
  322. package/dist/esm/api/types/WeekendRate1.mjs +4 -0
  323. package/dist/esm/api/types/index.d.mts +37 -0
  324. package/dist/esm/api/types/index.mjs +37 -0
  325. package/dist/esm/version.d.mts +1 -1
  326. package/dist/esm/version.mjs +1 -1
  327. package/package.json +1 -1
  328. package/reference.md +1822 -0
@@ -0,0 +1,843 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../../../environments.mjs";
14
+ import * as core from "../../../../../../core/index.mjs";
15
+ import * as Chrt from "../../../../../index.mjs";
16
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
17
+ import * as errors from "../../../../../../errors/index.mjs";
18
+ export class Invoices {
19
+ constructor(_options = {}) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * Approves a draft invoice owned by the caller's organization. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (Invoice1)
24
+ *
25
+ * @param {string} invoiceId
26
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link Chrt.UnprocessableEntityError}
29
+ *
30
+ * @example
31
+ * await client.billingNew.invoices.approveV1("invoice_id")
32
+ */
33
+ approveV1(invoiceId, requestOptions) {
34
+ return core.HttpResponsePromise.fromPromise(this.__approveV1(invoiceId, requestOptions));
35
+ }
36
+ __approveV1(invoiceId, requestOptions) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ var _a, _b, _c, _d;
39
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
40
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
41
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/approve/v1/${encodeURIComponent(invoiceId)}`),
42
+ method: "PATCH",
43
+ headers: _headers,
44
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
45
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
46
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
47
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
48
+ });
49
+ if (_response.ok) {
50
+ return { data: _response.body, rawResponse: _response.rawResponse };
51
+ }
52
+ if (_response.error.reason === "status-code") {
53
+ switch (_response.error.statusCode) {
54
+ case 422:
55
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
56
+ default:
57
+ throw new errors.ChrtError({
58
+ statusCode: _response.error.statusCode,
59
+ body: _response.error.body,
60
+ rawResponse: _response.rawResponse,
61
+ });
62
+ }
63
+ }
64
+ switch (_response.error.reason) {
65
+ case "non-json":
66
+ throw new errors.ChrtError({
67
+ statusCode: _response.error.statusCode,
68
+ body: _response.error.rawBody,
69
+ rawResponse: _response.rawResponse,
70
+ });
71
+ case "timeout":
72
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /billing_new/invoices/approve/v1/{invoice_id}.");
73
+ case "unknown":
74
+ throw new errors.ChrtError({
75
+ message: _response.error.errorMessage,
76
+ rawResponse: _response.rawResponse,
77
+ });
78
+ }
79
+ });
80
+ }
81
+ /**
82
+ * Creates a draft invoice owned by the caller's organization. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceClientCreate1) -> (PydanticObjectId)
83
+ *
84
+ * @param {Chrt.billingNew.InvoiceClientCreate1} request
85
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
86
+ *
87
+ * @throws {@link Chrt.UnprocessableEntityError}
88
+ *
89
+ * @example
90
+ * await client.billingNew.invoices.createV1({
91
+ * currency_code: "USD",
92
+ * invoice_type: "accounts_receivable",
93
+ * schema_version: 1
94
+ * })
95
+ */
96
+ createV1(request, requestOptions) {
97
+ return core.HttpResponsePromise.fromPromise(this.__createV1(request, requestOptions));
98
+ }
99
+ __createV1(request, requestOptions) {
100
+ return __awaiter(this, void 0, void 0, function* () {
101
+ var _a, _b, _c, _d;
102
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
103
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
104
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "billing_new/invoices/create/v1"),
105
+ method: "POST",
106
+ headers: _headers,
107
+ contentType: "application/json",
108
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
109
+ requestType: "json",
110
+ body: request,
111
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
112
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
113
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
114
+ });
115
+ if (_response.ok) {
116
+ return { data: _response.body, rawResponse: _response.rawResponse };
117
+ }
118
+ if (_response.error.reason === "status-code") {
119
+ switch (_response.error.statusCode) {
120
+ case 422:
121
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
122
+ default:
123
+ throw new errors.ChrtError({
124
+ statusCode: _response.error.statusCode,
125
+ body: _response.error.body,
126
+ rawResponse: _response.rawResponse,
127
+ });
128
+ }
129
+ }
130
+ switch (_response.error.reason) {
131
+ case "non-json":
132
+ throw new errors.ChrtError({
133
+ statusCode: _response.error.statusCode,
134
+ body: _response.error.rawBody,
135
+ rawResponse: _response.rawResponse,
136
+ });
137
+ case "timeout":
138
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/invoices/create/v1.");
139
+ case "unknown":
140
+ throw new errors.ChrtError({
141
+ message: _response.error.errorMessage,
142
+ rawResponse: _response.rawResponse,
143
+ });
144
+ }
145
+ });
146
+ }
147
+ /**
148
+ * Hard-deletes a draft invoice and detaches its line items. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (bool)
149
+ *
150
+ * @param {string} invoiceId
151
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
152
+ *
153
+ * @throws {@link Chrt.UnprocessableEntityError}
154
+ *
155
+ * @example
156
+ * await client.billingNew.invoices.deleteV1("invoice_id")
157
+ */
158
+ deleteV1(invoiceId, requestOptions) {
159
+ return core.HttpResponsePromise.fromPromise(this.__deleteV1(invoiceId, requestOptions));
160
+ }
161
+ __deleteV1(invoiceId, requestOptions) {
162
+ return __awaiter(this, void 0, void 0, function* () {
163
+ var _a, _b, _c, _d;
164
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
165
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
166
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/delete/v1/${encodeURIComponent(invoiceId)}`),
167
+ method: "DELETE",
168
+ headers: _headers,
169
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
170
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
171
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
172
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
173
+ });
174
+ if (_response.ok) {
175
+ return { data: _response.body, rawResponse: _response.rawResponse };
176
+ }
177
+ if (_response.error.reason === "status-code") {
178
+ switch (_response.error.statusCode) {
179
+ case 422:
180
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
181
+ default:
182
+ throw new errors.ChrtError({
183
+ statusCode: _response.error.statusCode,
184
+ body: _response.error.body,
185
+ rawResponse: _response.rawResponse,
186
+ });
187
+ }
188
+ }
189
+ switch (_response.error.reason) {
190
+ case "non-json":
191
+ throw new errors.ChrtError({
192
+ statusCode: _response.error.statusCode,
193
+ body: _response.error.rawBody,
194
+ rawResponse: _response.rawResponse,
195
+ });
196
+ case "timeout":
197
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /billing_new/invoices/delete/v1/{invoice_id}.");
198
+ case "unknown":
199
+ throw new errors.ChrtError({
200
+ message: _response.error.errorMessage,
201
+ rawResponse: _response.rawResponse,
202
+ });
203
+ }
204
+ });
205
+ }
206
+ /**
207
+ * Retrieves an owner-scoped invoice with its line items, counterparty organization data, and accounts expanded. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (InvoiceExpandedRes)
208
+ *
209
+ * @param {string} invoiceId
210
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
211
+ *
212
+ * @throws {@link Chrt.UnprocessableEntityError}
213
+ *
214
+ * @example
215
+ * await client.billingNew.invoices.getExpandedV1("invoice_id")
216
+ */
217
+ getExpandedV1(invoiceId, requestOptions) {
218
+ return core.HttpResponsePromise.fromPromise(this.__getExpandedV1(invoiceId, requestOptions));
219
+ }
220
+ __getExpandedV1(invoiceId, requestOptions) {
221
+ return __awaiter(this, void 0, void 0, function* () {
222
+ var _a, _b, _c, _d;
223
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
224
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
225
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/expanded/v1/${encodeURIComponent(invoiceId)}`),
226
+ method: "GET",
227
+ headers: _headers,
228
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
229
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
230
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
231
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
232
+ });
233
+ if (_response.ok) {
234
+ return { data: _response.body, rawResponse: _response.rawResponse };
235
+ }
236
+ if (_response.error.reason === "status-code") {
237
+ switch (_response.error.statusCode) {
238
+ case 422:
239
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
240
+ default:
241
+ throw new errors.ChrtError({
242
+ statusCode: _response.error.statusCode,
243
+ body: _response.error.body,
244
+ rawResponse: _response.rawResponse,
245
+ });
246
+ }
247
+ }
248
+ switch (_response.error.reason) {
249
+ case "non-json":
250
+ throw new errors.ChrtError({
251
+ statusCode: _response.error.statusCode,
252
+ body: _response.error.rawBody,
253
+ rawResponse: _response.rawResponse,
254
+ });
255
+ case "timeout":
256
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing_new/invoices/expanded/v1/{invoice_id}.");
257
+ case "unknown":
258
+ throw new errors.ChrtError({
259
+ message: _response.error.errorMessage,
260
+ rawResponse: _response.rawResponse,
261
+ });
262
+ }
263
+ });
264
+ }
265
+ /**
266
+ * Attaches one line item to a draft invoice, moving it from another draft invoice when needed, and synchronizes both invoices. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (Invoice1)
267
+ *
268
+ * @param {string} invoiceId
269
+ * @param {string} invoiceLineItemId
270
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
271
+ *
272
+ * @throws {@link Chrt.UnprocessableEntityError}
273
+ *
274
+ * @example
275
+ * await client.billingNew.invoices.addLineItemV1("invoice_id", "invoice_line_item_id")
276
+ */
277
+ addLineItemV1(invoiceId, invoiceLineItemId, requestOptions) {
278
+ return core.HttpResponsePromise.fromPromise(this.__addLineItemV1(invoiceId, invoiceLineItemId, requestOptions));
279
+ }
280
+ __addLineItemV1(invoiceId, invoiceLineItemId, requestOptions) {
281
+ return __awaiter(this, void 0, void 0, function* () {
282
+ var _a, _b, _c, _d;
283
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
284
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
285
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/line_item/add/v1/${encodeURIComponent(invoiceId)}/${encodeURIComponent(invoiceLineItemId)}`),
286
+ method: "POST",
287
+ headers: _headers,
288
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
289
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
290
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
291
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
292
+ });
293
+ if (_response.ok) {
294
+ return { data: _response.body, rawResponse: _response.rawResponse };
295
+ }
296
+ if (_response.error.reason === "status-code") {
297
+ switch (_response.error.statusCode) {
298
+ case 422:
299
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
300
+ default:
301
+ throw new errors.ChrtError({
302
+ statusCode: _response.error.statusCode,
303
+ body: _response.error.body,
304
+ rawResponse: _response.rawResponse,
305
+ });
306
+ }
307
+ }
308
+ switch (_response.error.reason) {
309
+ case "non-json":
310
+ throw new errors.ChrtError({
311
+ statusCode: _response.error.statusCode,
312
+ body: _response.error.rawBody,
313
+ rawResponse: _response.rawResponse,
314
+ });
315
+ case "timeout":
316
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/invoices/line_item/add/v1/{invoice_id}/{invoice_line_item_id}.");
317
+ case "unknown":
318
+ throw new errors.ChrtError({
319
+ message: _response.error.errorMessage,
320
+ rawResponse: _response.rawResponse,
321
+ });
322
+ }
323
+ });
324
+ }
325
+ /**
326
+ * Detaches one line item from a draft invoice and synchronizes the invoice total and accounts. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (Invoice1)
327
+ *
328
+ * @param {string} invoiceId
329
+ * @param {string} invoiceLineItemId
330
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
331
+ *
332
+ * @throws {@link Chrt.UnprocessableEntityError}
333
+ *
334
+ * @example
335
+ * await client.billingNew.invoices.removeLineItemV1("invoice_id", "invoice_line_item_id")
336
+ */
337
+ removeLineItemV1(invoiceId, invoiceLineItemId, requestOptions) {
338
+ return core.HttpResponsePromise.fromPromise(this.__removeLineItemV1(invoiceId, invoiceLineItemId, requestOptions));
339
+ }
340
+ __removeLineItemV1(invoiceId, invoiceLineItemId, requestOptions) {
341
+ return __awaiter(this, void 0, void 0, function* () {
342
+ var _a, _b, _c, _d;
343
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
344
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
345
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/line_item/remove/v1/${encodeURIComponent(invoiceId)}/${encodeURIComponent(invoiceLineItemId)}`),
346
+ method: "DELETE",
347
+ headers: _headers,
348
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
349
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
350
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
351
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
352
+ });
353
+ if (_response.ok) {
354
+ return { data: _response.body, rawResponse: _response.rawResponse };
355
+ }
356
+ if (_response.error.reason === "status-code") {
357
+ switch (_response.error.statusCode) {
358
+ case 422:
359
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
360
+ default:
361
+ throw new errors.ChrtError({
362
+ statusCode: _response.error.statusCode,
363
+ body: _response.error.body,
364
+ rawResponse: _response.rawResponse,
365
+ });
366
+ }
367
+ }
368
+ switch (_response.error.reason) {
369
+ case "non-json":
370
+ throw new errors.ChrtError({
371
+ statusCode: _response.error.statusCode,
372
+ body: _response.error.rawBody,
373
+ rawResponse: _response.rawResponse,
374
+ });
375
+ case "timeout":
376
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /billing_new/invoices/line_item/remove/v1/{invoice_id}/{invoice_line_item_id}.");
377
+ case "unknown":
378
+ throw new errors.ChrtError({
379
+ message: _response.error.errorMessage,
380
+ rawResponse: _response.rawResponse,
381
+ });
382
+ }
383
+ });
384
+ }
385
+ /**
386
+ * Attaches existing line items to a draft invoice, moving them from any other draft invoices, and synchronizes all affected invoice totals and accounts. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsAddReq) -> (Invoice1)
387
+ *
388
+ * @param {string} invoiceId
389
+ * @param {Chrt.billingNew.InvoiceLineItemsAddReq} request
390
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
391
+ *
392
+ * @throws {@link Chrt.UnprocessableEntityError}
393
+ *
394
+ * @example
395
+ * await client.billingNew.invoices.addLineItemsV1("invoice_id", {
396
+ * invoice_line_item_ids: ["invoice_line_item_ids"]
397
+ * })
398
+ */
399
+ addLineItemsV1(invoiceId, request, requestOptions) {
400
+ return core.HttpResponsePromise.fromPromise(this.__addLineItemsV1(invoiceId, request, requestOptions));
401
+ }
402
+ __addLineItemsV1(invoiceId, request, requestOptions) {
403
+ return __awaiter(this, void 0, void 0, function* () {
404
+ var _a, _b, _c, _d;
405
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
406
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
407
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/line_items/add/v1/${encodeURIComponent(invoiceId)}`),
408
+ method: "POST",
409
+ headers: _headers,
410
+ contentType: "application/json",
411
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
412
+ requestType: "json",
413
+ body: request,
414
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
415
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
416
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
417
+ });
418
+ if (_response.ok) {
419
+ return { data: _response.body, rawResponse: _response.rawResponse };
420
+ }
421
+ if (_response.error.reason === "status-code") {
422
+ switch (_response.error.statusCode) {
423
+ case 422:
424
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
425
+ default:
426
+ throw new errors.ChrtError({
427
+ statusCode: _response.error.statusCode,
428
+ body: _response.error.body,
429
+ rawResponse: _response.rawResponse,
430
+ });
431
+ }
432
+ }
433
+ switch (_response.error.reason) {
434
+ case "non-json":
435
+ throw new errors.ChrtError({
436
+ statusCode: _response.error.statusCode,
437
+ body: _response.error.rawBody,
438
+ rawResponse: _response.rawResponse,
439
+ });
440
+ case "timeout":
441
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/invoices/line_items/add/v1/{invoice_id}.");
442
+ case "unknown":
443
+ throw new errors.ChrtError({
444
+ message: _response.error.errorMessage,
445
+ rawResponse: _response.rawResponse,
446
+ });
447
+ }
448
+ });
449
+ }
450
+ /**
451
+ * Detaches existing line items from a draft invoice and synchronizes derived invoice fields. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsRemoveReq) -> (Invoice1)
452
+ *
453
+ * @param {string} invoiceId
454
+ * @param {Chrt.billingNew.InvoiceLineItemsRemoveReq} request
455
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
456
+ *
457
+ * @throws {@link Chrt.UnprocessableEntityError}
458
+ *
459
+ * @example
460
+ * await client.billingNew.invoices.removeLineItemsV1("invoice_id", {
461
+ * invoice_line_item_ids: ["invoice_line_item_ids"]
462
+ * })
463
+ */
464
+ removeLineItemsV1(invoiceId, request, requestOptions) {
465
+ return core.HttpResponsePromise.fromPromise(this.__removeLineItemsV1(invoiceId, request, requestOptions));
466
+ }
467
+ __removeLineItemsV1(invoiceId, request, requestOptions) {
468
+ return __awaiter(this, void 0, void 0, function* () {
469
+ var _a, _b, _c, _d;
470
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
471
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
472
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/line_items/remove/v1/${encodeURIComponent(invoiceId)}`),
473
+ method: "POST",
474
+ headers: _headers,
475
+ contentType: "application/json",
476
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
477
+ requestType: "json",
478
+ body: request,
479
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
480
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
481
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
482
+ });
483
+ if (_response.ok) {
484
+ return { data: _response.body, rawResponse: _response.rawResponse };
485
+ }
486
+ if (_response.error.reason === "status-code") {
487
+ switch (_response.error.statusCode) {
488
+ case 422:
489
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
490
+ default:
491
+ throw new errors.ChrtError({
492
+ statusCode: _response.error.statusCode,
493
+ body: _response.error.body,
494
+ rawResponse: _response.rawResponse,
495
+ });
496
+ }
497
+ }
498
+ switch (_response.error.reason) {
499
+ case "non-json":
500
+ throw new errors.ChrtError({
501
+ statusCode: _response.error.statusCode,
502
+ body: _response.error.rawBody,
503
+ rawResponse: _response.rawResponse,
504
+ });
505
+ case "timeout":
506
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/invoices/line_items/remove/v1/{invoice_id}.");
507
+ case "unknown":
508
+ throw new errors.ChrtError({
509
+ message: _response.error.errorMessage,
510
+ rawResponse: _response.rawResponse,
511
+ });
512
+ }
513
+ });
514
+ }
515
+ /**
516
+ * Lists owner-scoped invoices with search, filtering, sorting, and pagination. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (InvoiceListRes)
517
+ *
518
+ * @param {Chrt.billingNew.InvoicesListV1Request} request
519
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
520
+ *
521
+ * @throws {@link Chrt.UnprocessableEntityError}
522
+ *
523
+ * @example
524
+ * await client.billingNew.invoices.listV1({
525
+ * search: "search",
526
+ * sort_by: "created_at_timestamp",
527
+ * sort_order: "asc",
528
+ * page: 1,
529
+ * page_size: 1,
530
+ * filter_counterparty_org_id: "filter_counterparty_org_id",
531
+ * filter_counterparty_off_chrt_org_data_id: "filter_counterparty_off_chrt_org_data_id",
532
+ * filter_counterparty_account_id: "filter_counterparty_account_id",
533
+ * filter_created_at_timestamp_gte: "2024-01-15T09:30:00Z",
534
+ * filter_created_at_timestamp_lte: "2024-01-15T09:30:00Z",
535
+ * filter_last_edited_at_timestamp_gte: "2024-01-15T09:30:00Z",
536
+ * filter_last_edited_at_timestamp_lte: "2024-01-15T09:30:00Z"
537
+ * })
538
+ */
539
+ listV1(request = {}, requestOptions) {
540
+ return core.HttpResponsePromise.fromPromise(this.__listV1(request, requestOptions));
541
+ }
542
+ __listV1() {
543
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
544
+ var _a, _b, _c, _d, _e, _f;
545
+ const { search, sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_statuses: filterStatuses, filter_invoice_types: filterInvoiceTypes, filter_currency_codes: filterCurrencyCodes, filter_counterparty_org_id: filterCounterpartyOrgId, filter_counterparty_off_chrt_org_data_id: filterCounterpartyOffChrtOrgDataId, filter_counterparty_account_id: filterCounterpartyAccountId, filter_created_at_timestamp_gte: filterCreatedAtTimestampGte, filter_created_at_timestamp_lte: filterCreatedAtTimestampLte, filter_last_edited_at_timestamp_gte: filterLastEditedAtTimestampGte, filter_last_edited_at_timestamp_lte: filterLastEditedAtTimestampLte, } = request;
546
+ const _queryParams = {};
547
+ if (search !== undefined) {
548
+ _queryParams["search"] = search;
549
+ }
550
+ if (sortBy !== undefined) {
551
+ _queryParams["sort_by"] = sortBy;
552
+ }
553
+ if (sortOrder !== undefined) {
554
+ _queryParams["sort_order"] = sortOrder;
555
+ }
556
+ if (page !== undefined) {
557
+ _queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
558
+ }
559
+ if (pageSize !== undefined) {
560
+ _queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
561
+ }
562
+ if (filterStatuses !== undefined) {
563
+ if (Array.isArray(filterStatuses)) {
564
+ _queryParams["filter_statuses"] = filterStatuses.map((item) => item);
565
+ }
566
+ else {
567
+ _queryParams["filter_statuses"] = filterStatuses;
568
+ }
569
+ }
570
+ if (filterInvoiceTypes !== undefined) {
571
+ if (Array.isArray(filterInvoiceTypes)) {
572
+ _queryParams["filter_invoice_types"] = filterInvoiceTypes.map((item) => item);
573
+ }
574
+ else {
575
+ _queryParams["filter_invoice_types"] = filterInvoiceTypes;
576
+ }
577
+ }
578
+ if (filterCurrencyCodes !== undefined) {
579
+ if (Array.isArray(filterCurrencyCodes)) {
580
+ _queryParams["filter_currency_codes"] = filterCurrencyCodes.map((item) => item);
581
+ }
582
+ else {
583
+ _queryParams["filter_currency_codes"] = filterCurrencyCodes;
584
+ }
585
+ }
586
+ if (filterCounterpartyOrgId !== undefined) {
587
+ _queryParams["filter_counterparty_org_id"] = filterCounterpartyOrgId;
588
+ }
589
+ if (filterCounterpartyOffChrtOrgDataId !== undefined) {
590
+ _queryParams["filter_counterparty_off_chrt_org_data_id"] = filterCounterpartyOffChrtOrgDataId;
591
+ }
592
+ if (filterCounterpartyAccountId !== undefined) {
593
+ _queryParams["filter_counterparty_account_id"] = filterCounterpartyAccountId;
594
+ }
595
+ if (filterCreatedAtTimestampGte !== undefined) {
596
+ _queryParams["filter_created_at_timestamp_gte"] = filterCreatedAtTimestampGte;
597
+ }
598
+ if (filterCreatedAtTimestampLte !== undefined) {
599
+ _queryParams["filter_created_at_timestamp_lte"] = filterCreatedAtTimestampLte;
600
+ }
601
+ if (filterLastEditedAtTimestampGte !== undefined) {
602
+ _queryParams["filter_last_edited_at_timestamp_gte"] = filterLastEditedAtTimestampGte;
603
+ }
604
+ if (filterLastEditedAtTimestampLte !== undefined) {
605
+ _queryParams["filter_last_edited_at_timestamp_lte"] = filterLastEditedAtTimestampLte;
606
+ }
607
+ let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
608
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
609
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, "billing_new/invoices/list/v1"),
610
+ method: "GET",
611
+ headers: _headers,
612
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
613
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
614
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
615
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
616
+ });
617
+ if (_response.ok) {
618
+ return { data: _response.body, rawResponse: _response.rawResponse };
619
+ }
620
+ if (_response.error.reason === "status-code") {
621
+ switch (_response.error.statusCode) {
622
+ case 422:
623
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
624
+ default:
625
+ throw new errors.ChrtError({
626
+ statusCode: _response.error.statusCode,
627
+ body: _response.error.body,
628
+ rawResponse: _response.rawResponse,
629
+ });
630
+ }
631
+ }
632
+ switch (_response.error.reason) {
633
+ case "non-json":
634
+ throw new errors.ChrtError({
635
+ statusCode: _response.error.statusCode,
636
+ body: _response.error.rawBody,
637
+ rawResponse: _response.rawResponse,
638
+ });
639
+ case "timeout":
640
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing_new/invoices/list/v1.");
641
+ case "unknown":
642
+ throw new errors.ChrtError({
643
+ message: _response.error.errorMessage,
644
+ rawResponse: _response.rawResponse,
645
+ });
646
+ }
647
+ });
648
+ }
649
+ /**
650
+ * Updates the name or description of a draft invoice owned by the caller's organization. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceClientUpdate1) -> (bool)
651
+ *
652
+ * @param {string} invoiceId
653
+ * @param {Chrt.billingNew.InvoiceClientUpdate1} request
654
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
655
+ *
656
+ * @throws {@link Chrt.UnprocessableEntityError}
657
+ *
658
+ * @example
659
+ * await client.billingNew.invoices.updateV1("invoice_id")
660
+ */
661
+ updateV1(invoiceId, request = {}, requestOptions) {
662
+ return core.HttpResponsePromise.fromPromise(this.__updateV1(invoiceId, request, requestOptions));
663
+ }
664
+ __updateV1(invoiceId_1) {
665
+ return __awaiter(this, arguments, void 0, function* (invoiceId, request = {}, requestOptions) {
666
+ var _a, _b, _c, _d;
667
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
668
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
669
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/update/v1/${encodeURIComponent(invoiceId)}`),
670
+ method: "PATCH",
671
+ headers: _headers,
672
+ contentType: "application/json",
673
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
674
+ requestType: "json",
675
+ body: request,
676
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
677
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
678
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
679
+ });
680
+ if (_response.ok) {
681
+ return { data: _response.body, rawResponse: _response.rawResponse };
682
+ }
683
+ if (_response.error.reason === "status-code") {
684
+ switch (_response.error.statusCode) {
685
+ case 422:
686
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
687
+ default:
688
+ throw new errors.ChrtError({
689
+ statusCode: _response.error.statusCode,
690
+ body: _response.error.body,
691
+ rawResponse: _response.rawResponse,
692
+ });
693
+ }
694
+ }
695
+ switch (_response.error.reason) {
696
+ case "non-json":
697
+ throw new errors.ChrtError({
698
+ statusCode: _response.error.statusCode,
699
+ body: _response.error.rawBody,
700
+ rawResponse: _response.rawResponse,
701
+ });
702
+ case "timeout":
703
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /billing_new/invoices/update/v1/{invoice_id}.");
704
+ case "unknown":
705
+ throw new errors.ChrtError({
706
+ message: _response.error.errorMessage,
707
+ rawResponse: _response.rawResponse,
708
+ });
709
+ }
710
+ });
711
+ }
712
+ /**
713
+ * Retrieves an invoice owned by the caller's organization. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (Invoice1)
714
+ *
715
+ * @param {string} invoiceId
716
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
717
+ *
718
+ * @throws {@link Chrt.UnprocessableEntityError}
719
+ *
720
+ * @example
721
+ * await client.billingNew.invoices.getV1("invoice_id")
722
+ */
723
+ getV1(invoiceId, requestOptions) {
724
+ return core.HttpResponsePromise.fromPromise(this.__getV1(invoiceId, requestOptions));
725
+ }
726
+ __getV1(invoiceId, requestOptions) {
727
+ return __awaiter(this, void 0, void 0, function* () {
728
+ var _a, _b, _c, _d;
729
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
730
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
731
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/v1/${encodeURIComponent(invoiceId)}`),
732
+ method: "GET",
733
+ headers: _headers,
734
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
735
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
736
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
737
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
738
+ });
739
+ if (_response.ok) {
740
+ return { data: _response.body, rawResponse: _response.rawResponse };
741
+ }
742
+ if (_response.error.reason === "status-code") {
743
+ switch (_response.error.statusCode) {
744
+ case 422:
745
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
746
+ default:
747
+ throw new errors.ChrtError({
748
+ statusCode: _response.error.statusCode,
749
+ body: _response.error.body,
750
+ rawResponse: _response.rawResponse,
751
+ });
752
+ }
753
+ }
754
+ switch (_response.error.reason) {
755
+ case "non-json":
756
+ throw new errors.ChrtError({
757
+ statusCode: _response.error.statusCode,
758
+ body: _response.error.rawBody,
759
+ rawResponse: _response.rawResponse,
760
+ });
761
+ case "timeout":
762
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing_new/invoices/v1/{invoice_id}.");
763
+ case "unknown":
764
+ throw new errors.ChrtError({
765
+ message: _response.error.errorMessage,
766
+ rawResponse: _response.rawResponse,
767
+ });
768
+ }
769
+ });
770
+ }
771
+ /**
772
+ * Voids a draft or approved invoice owned by the caller's organization. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceVoidReq) -> (Invoice1)
773
+ *
774
+ * @param {string} invoiceId
775
+ * @param {Chrt.billingNew.InvoiceVoidReq} request
776
+ * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
777
+ *
778
+ * @throws {@link Chrt.UnprocessableEntityError}
779
+ *
780
+ * @example
781
+ * await client.billingNew.invoices.voidV1("invoice_id")
782
+ */
783
+ voidV1(invoiceId, request = {}, requestOptions) {
784
+ return core.HttpResponsePromise.fromPromise(this.__voidV1(invoiceId, request, requestOptions));
785
+ }
786
+ __voidV1(invoiceId_1) {
787
+ return __awaiter(this, arguments, void 0, function* (invoiceId, request = {}, requestOptions) {
788
+ var _a, _b, _c, _d;
789
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
790
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
791
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/void/v1/${encodeURIComponent(invoiceId)}`),
792
+ method: "PATCH",
793
+ headers: _headers,
794
+ contentType: "application/json",
795
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
796
+ requestType: "json",
797
+ body: request,
798
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
799
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
800
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
801
+ });
802
+ if (_response.ok) {
803
+ return { data: _response.body, rawResponse: _response.rawResponse };
804
+ }
805
+ if (_response.error.reason === "status-code") {
806
+ switch (_response.error.statusCode) {
807
+ case 422:
808
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
809
+ default:
810
+ throw new errors.ChrtError({
811
+ statusCode: _response.error.statusCode,
812
+ body: _response.error.body,
813
+ rawResponse: _response.rawResponse,
814
+ });
815
+ }
816
+ }
817
+ switch (_response.error.reason) {
818
+ case "non-json":
819
+ throw new errors.ChrtError({
820
+ statusCode: _response.error.statusCode,
821
+ body: _response.error.rawBody,
822
+ rawResponse: _response.rawResponse,
823
+ });
824
+ case "timeout":
825
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /billing_new/invoices/void/v1/{invoice_id}.");
826
+ case "unknown":
827
+ throw new errors.ChrtError({
828
+ message: _response.error.errorMessage,
829
+ rawResponse: _response.rawResponse,
830
+ });
831
+ }
832
+ });
833
+ }
834
+ _getAuthorizationHeader() {
835
+ return __awaiter(this, void 0, void 0, function* () {
836
+ const bearer = yield core.Supplier.get(this._options.token);
837
+ if (bearer != null) {
838
+ return `Bearer ${bearer}`;
839
+ }
840
+ return undefined;
841
+ });
842
+ }
843
+ }