@chrt-inc/typescript-sdk 1.997.0 → 1.999.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 (230) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/billingNew/client/Client.d.ts +3 -0
  3. package/dist/cjs/api/resources/billingNew/client/Client.js +5 -0
  4. package/dist/cjs/api/resources/billingNew/resources/billingPeriods/client/Client.d.ts +2 -2
  5. package/dist/cjs/api/resources/billingNew/resources/billingPeriods/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/billingNew/resources/chrtGroundProviderRates/client/requests/ChrtGroundProviderRatesClientCreate1.d.ts +0 -3
  7. package/dist/cjs/api/resources/billingNew/resources/chrtGroundProviderRates/client/requests/ChrtGroundProviderRatesClientUpdate1.d.ts +0 -6
  8. package/dist/cjs/api/resources/billingNew/resources/index.d.ts +2 -0
  9. package/dist/cjs/api/resources/billingNew/resources/index.js +3 -1
  10. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/Client.d.ts +17 -73
  11. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/Client.js +50 -193
  12. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/{resources/export/client → client}/requests/InvoiceLineItemExportListReq.d.ts +1 -0
  13. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.d.ts +1 -3
  14. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/index.d.ts +0 -1
  15. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/index.js +0 -1
  16. package/dist/cjs/api/resources/billingNew/resources/invoices/client/Client.d.ts +57 -32
  17. package/dist/cjs/api/resources/billingNew/resources/invoices/client/Client.js +169 -89
  18. package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/index.d.ts +0 -1
  19. package/dist/cjs/api/resources/billingNew/resources/orders/client/Client.d.ts +28 -3
  20. package/dist/cjs/api/resources/billingNew/resources/orders/client/Client.js +126 -5
  21. package/dist/cjs/api/resources/billingNew/resources/orders/client/requests/index.d.ts +1 -0
  22. package/dist/cjs/api/resources/billingNew/resources/orders/index.d.ts +0 -1
  23. package/dist/cjs/api/resources/billingNew/resources/orders/index.js +0 -1
  24. package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/Client.d.ts +128 -0
  25. package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/Client.js +485 -0
  26. package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationClientCreate1.d.ts +21 -0
  27. package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationClientUpdate1.d.ts +12 -0
  28. package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationResolveReq.d.ts +14 -0
  29. package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationsListV1Request.d.ts +33 -0
  30. package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/requests/index.d.ts +4 -0
  31. package/dist/cjs/api/resources/flights/client/Client.d.ts +1 -1
  32. package/dist/cjs/api/resources/flights/client/Client.js +1 -1
  33. package/dist/cjs/api/resources/shipping/resources/flights/client/Client.d.ts +1 -1
  34. package/dist/cjs/api/resources/shipping/resources/flights/client/Client.js +1 -1
  35. package/dist/cjs/api/resources/tracking/resources/sessions/client/Client.d.ts +1 -1
  36. package/dist/cjs/api/resources/tracking/resources/sessions/client/Client.js +1 -1
  37. package/dist/cjs/api/types/BillingCurrencyCodeEnum1.d.ts +1 -2
  38. package/dist/cjs/api/types/BillingCurrencyCodeEnum1.js +0 -1
  39. package/dist/cjs/api/types/BillingPeriodCloseRes.d.ts +8 -0
  40. package/dist/cjs/api/types/CalculatedInvoiceTax1.d.ts +12 -0
  41. package/dist/cjs/api/types/ChrtGroundProviderRates1.d.ts +0 -3
  42. package/dist/cjs/api/types/{CreateInvoiceLineItemsFromAwbCostsInvoiceRes1.d.ts → CreateInvoiceLineItemsFromAwbCostsGroupRes1.d.ts} +2 -2
  43. package/dist/cjs/api/types/CreateInvoiceLineItemsFromAwbCostsRes.d.ts +1 -1
  44. package/dist/cjs/api/types/FlightLeg1.d.ts +1 -0
  45. package/dist/cjs/api/types/FlightTrackPosition1.d.ts +8 -6
  46. package/dist/cjs/api/types/FlightTrackRes.d.ts +5 -15
  47. package/dist/cjs/api/{resources/billingNew/resources/invoices/client/requests → types}/InvoiceClientCreate1.d.ts +1 -9
  48. package/dist/cjs/api/types/InvoiceCreateFromOrdersReq.d.ts +22 -0
  49. package/dist/cjs/api/types/InvoiceCreateFromOrdersRes.d.ts +14 -0
  50. package/dist/cjs/api/types/InvoiceCreateReq.d.ts +20 -0
  51. package/dist/cjs/api/types/InvoiceCreateReq.js +5 -0
  52. package/dist/cjs/api/types/InvoiceLineItemExportListItem.d.ts +3 -2
  53. package/dist/cjs/api/types/InvoiceLineItemTypeEnum1.d.ts +2 -4
  54. package/dist/cjs/api/types/InvoiceLineItemTypeEnum1.js +1 -3
  55. package/dist/cjs/api/types/InvoicePreviewFromOrdersRes.d.ts +15 -0
  56. package/dist/cjs/api/types/InvoicePreviewFromOrdersRes.js +5 -0
  57. package/dist/cjs/api/types/InvoicePreviewRes.d.ts +10 -0
  58. package/dist/cjs/api/types/InvoicePreviewRes.js +5 -0
  59. package/dist/cjs/api/types/InvoiceTaxCalculation1.d.ts +12 -0
  60. package/dist/cjs/api/types/InvoiceTaxCalculation1.js +5 -0
  61. package/dist/cjs/api/types/TaxConfiguration1.d.ts +24 -0
  62. package/dist/cjs/api/types/TaxConfiguration1.js +5 -0
  63. package/dist/cjs/api/types/TaxConfigurationListRes.d.ts +8 -0
  64. package/dist/cjs/api/types/TaxConfigurationListRes.js +5 -0
  65. package/dist/cjs/api/types/TaxConfigurationSortByEnum.d.ts +8 -0
  66. package/dist/cjs/api/types/TaxConfigurationSortByEnum.js +10 -0
  67. package/dist/cjs/api/types/{TaxRate1.d.ts → TaxRule1.d.ts} +2 -3
  68. package/dist/cjs/api/types/TaxRule1.js +5 -0
  69. package/dist/cjs/api/types/index.d.ts +14 -7
  70. package/dist/cjs/api/types/index.js +14 -7
  71. package/dist/cjs/version.d.ts +1 -1
  72. package/dist/cjs/version.js +1 -1
  73. package/dist/esm/Client.mjs +2 -2
  74. package/dist/esm/api/resources/billingNew/client/Client.d.mts +3 -0
  75. package/dist/esm/api/resources/billingNew/client/Client.mjs +5 -0
  76. package/dist/esm/api/resources/billingNew/resources/billingPeriods/client/Client.d.mts +2 -2
  77. package/dist/esm/api/resources/billingNew/resources/billingPeriods/client/Client.mjs +1 -1
  78. package/dist/esm/api/resources/billingNew/resources/chrtGroundProviderRates/client/requests/ChrtGroundProviderRatesClientCreate1.d.mts +0 -3
  79. package/dist/esm/api/resources/billingNew/resources/chrtGroundProviderRates/client/requests/ChrtGroundProviderRatesClientUpdate1.d.mts +0 -6
  80. package/dist/esm/api/resources/billingNew/resources/index.d.mts +2 -0
  81. package/dist/esm/api/resources/billingNew/resources/index.mjs +2 -0
  82. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/Client.d.mts +17 -73
  83. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/Client.mjs +50 -193
  84. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/{resources/export/client → client}/requests/InvoiceLineItemExportListReq.d.mts +1 -0
  85. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.d.mts +1 -3
  86. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/index.d.mts +0 -1
  87. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/index.mjs +0 -1
  88. package/dist/esm/api/resources/billingNew/resources/invoices/client/Client.d.mts +57 -32
  89. package/dist/esm/api/resources/billingNew/resources/invoices/client/Client.mjs +169 -89
  90. package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/index.d.mts +0 -1
  91. package/dist/esm/api/resources/billingNew/resources/orders/client/Client.d.mts +28 -3
  92. package/dist/esm/api/resources/billingNew/resources/orders/client/Client.mjs +126 -5
  93. package/dist/esm/api/resources/billingNew/resources/orders/client/requests/index.d.mts +1 -0
  94. package/dist/esm/api/resources/billingNew/resources/orders/index.d.mts +0 -1
  95. package/dist/esm/api/resources/billingNew/resources/orders/index.mjs +0 -1
  96. package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/Client.d.mts +128 -0
  97. package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/Client.mjs +448 -0
  98. package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationClientCreate1.d.mts +21 -0
  99. package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationClientUpdate1.d.mts +12 -0
  100. package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationResolveReq.d.mts +14 -0
  101. package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationsListV1Request.d.mts +33 -0
  102. package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/requests/index.d.mts +4 -0
  103. package/dist/esm/api/resources/flights/client/Client.d.mts +1 -1
  104. package/dist/esm/api/resources/flights/client/Client.mjs +1 -1
  105. package/dist/esm/api/resources/shipping/resources/flights/client/Client.d.mts +1 -1
  106. package/dist/esm/api/resources/shipping/resources/flights/client/Client.mjs +1 -1
  107. package/dist/esm/api/resources/tracking/resources/sessions/client/Client.d.mts +1 -1
  108. package/dist/esm/api/resources/tracking/resources/sessions/client/Client.mjs +1 -1
  109. package/dist/esm/api/types/BillingCurrencyCodeEnum1.d.mts +1 -2
  110. package/dist/esm/api/types/BillingCurrencyCodeEnum1.mjs +0 -1
  111. package/dist/esm/api/types/BillingPeriodCloseRes.d.mts +8 -0
  112. package/dist/esm/api/types/CalculatedInvoiceTax1.d.mts +12 -0
  113. package/dist/esm/api/types/ChrtGroundProviderRates1.d.mts +0 -3
  114. package/dist/esm/api/types/{CreateInvoiceLineItemsFromAwbCostsInvoiceRes1.d.mts → CreateInvoiceLineItemsFromAwbCostsGroupRes1.d.mts} +2 -2
  115. package/dist/esm/api/types/CreateInvoiceLineItemsFromAwbCostsRes.d.mts +1 -1
  116. package/dist/esm/api/types/FlightLeg1.d.mts +1 -0
  117. package/dist/esm/api/types/FlightTrackPosition1.d.mts +8 -6
  118. package/dist/esm/api/types/FlightTrackRes.d.mts +5 -15
  119. package/dist/esm/api/{resources/billingNew/resources/invoices/client/requests → types}/InvoiceClientCreate1.d.mts +1 -9
  120. package/dist/esm/api/types/InvoiceCreateFromOrdersReq.d.mts +22 -0
  121. package/dist/esm/api/types/InvoiceCreateFromOrdersRes.d.mts +14 -0
  122. package/dist/esm/api/types/InvoiceCreateReq.d.mts +20 -0
  123. package/dist/esm/api/types/InvoiceCreateReq.mjs +4 -0
  124. package/dist/esm/api/types/InvoiceLineItemExportListItem.d.mts +3 -2
  125. package/dist/esm/api/types/InvoiceLineItemTypeEnum1.d.mts +2 -4
  126. package/dist/esm/api/types/InvoiceLineItemTypeEnum1.mjs +1 -3
  127. package/dist/esm/api/types/InvoicePreviewFromOrdersRes.d.mts +15 -0
  128. package/dist/esm/api/types/InvoicePreviewFromOrdersRes.mjs +4 -0
  129. package/dist/esm/api/types/InvoicePreviewRes.d.mts +10 -0
  130. package/dist/esm/api/types/InvoicePreviewRes.mjs +4 -0
  131. package/dist/esm/api/types/InvoiceTaxCalculation1.d.mts +12 -0
  132. package/dist/esm/api/types/InvoiceTaxCalculation1.mjs +4 -0
  133. package/dist/esm/api/types/TaxConfiguration1.d.mts +24 -0
  134. package/dist/esm/api/types/TaxConfiguration1.mjs +4 -0
  135. package/dist/esm/api/types/TaxConfigurationListRes.d.mts +8 -0
  136. package/dist/esm/api/types/TaxConfigurationListRes.mjs +4 -0
  137. package/dist/esm/api/types/TaxConfigurationSortByEnum.d.mts +8 -0
  138. package/dist/esm/api/types/TaxConfigurationSortByEnum.mjs +7 -0
  139. package/dist/esm/api/types/{TaxRate1.d.mts → TaxRule1.d.mts} +2 -3
  140. package/dist/esm/api/types/TaxRule1.mjs +4 -0
  141. package/dist/esm/api/types/index.d.mts +14 -7
  142. package/dist/esm/api/types/index.mjs +14 -7
  143. package/dist/esm/version.d.mts +1 -1
  144. package/dist/esm/version.mjs +1 -1
  145. package/package.json +1 -1
  146. package/reference.md +522 -221
  147. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.d.ts +0 -32
  148. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.d.ts +0 -46
  149. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/RecalculateOrderTaxInvoiceLineItemsReq.d.ts +0 -12
  150. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/Client.d.ts +0 -51
  151. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/Client.js +0 -153
  152. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/requests/index.d.ts +0 -1
  153. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/index.d.ts +0 -2
  154. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/index.js +0 -41
  155. package/dist/cjs/api/resources/billingNew/resources/orders/resources/index.d.ts +0 -2
  156. package/dist/cjs/api/resources/billingNew/resources/orders/resources/index.js +0 -41
  157. package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/Client.d.ts +0 -49
  158. package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/Client.js +0 -135
  159. package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/index.d.ts +0 -2
  160. package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/index.js +0 -17
  161. package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/requests/index.d.ts +0 -1
  162. package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/requests/index.js +0 -2
  163. package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/index.d.ts +0 -1
  164. package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/index.js +0 -17
  165. package/dist/cjs/api/types/CreateInvoiceLineItemsFromAmountRes.d.ts +0 -7
  166. package/dist/cjs/api/types/CreateInvoiceLineItemsFromLineItemsRes.d.ts +0 -7
  167. package/dist/cjs/api/types/FlightTrackWaypoint1.d.ts +0 -7
  168. package/dist/cjs/api/types/InvoiceLineItemAmountTransformation1.d.ts +0 -8
  169. package/dist/cjs/api/types/InvoiceLineItemAmountTransformationTypeEnum1.d.ts +0 -9
  170. package/dist/cjs/api/types/InvoiceLineItemAmountTransformationTypeEnum1.js +0 -11
  171. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.d.mts +0 -32
  172. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.d.mts +0 -46
  173. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/RecalculateOrderTaxInvoiceLineItemsReq.d.mts +0 -12
  174. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/Client.d.mts +0 -51
  175. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/Client.mjs +0 -116
  176. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/requests/index.d.mts +0 -1
  177. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/index.d.mts +0 -2
  178. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/index.mjs +0 -2
  179. package/dist/esm/api/resources/billingNew/resources/orders/resources/index.d.mts +0 -2
  180. package/dist/esm/api/resources/billingNew/resources/orders/resources/index.mjs +0 -2
  181. package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/Client.d.mts +0 -49
  182. package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/Client.mjs +0 -98
  183. package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/index.d.mts +0 -2
  184. package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/index.mjs +0 -1
  185. package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/requests/index.d.mts +0 -1
  186. package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/requests/index.mjs +0 -1
  187. package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/index.d.mts +0 -1
  188. package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/index.mjs +0 -1
  189. package/dist/esm/api/types/CreateInvoiceLineItemsFromAmountRes.d.mts +0 -7
  190. package/dist/esm/api/types/CreateInvoiceLineItemsFromLineItemsRes.d.mts +0 -7
  191. package/dist/esm/api/types/FlightTrackWaypoint1.d.mts +0 -7
  192. package/dist/esm/api/types/InvoiceLineItemAmountTransformation1.d.mts +0 -8
  193. package/dist/esm/api/types/InvoiceLineItemAmountTransformationTypeEnum1.d.mts +0 -9
  194. package/dist/esm/api/types/InvoiceLineItemAmountTransformationTypeEnum1.mjs +0 -8
  195. /package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/{resources/export/client → client}/requests/InvoiceLineItemExportListReq.js +0 -0
  196. /package/dist/cjs/api/resources/billingNew/resources/orders/{resources/rateSheetLineItems/client → client}/requests/OrderRateSheetLineItemsGenerateManyReq.d.ts +0 -0
  197. /package/dist/cjs/api/resources/billingNew/resources/orders/{resources/rateSheetLineItems/client → client}/requests/OrderRateSheetLineItemsGenerateManyReq.js +0 -0
  198. /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/index.d.ts +0 -0
  199. /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/index.js +0 -0
  200. /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.js → taxConfigurations/client/requests/TaxConfigurationClientCreate1.js} +0 -0
  201. /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.js → taxConfigurations/client/requests/TaxConfigurationClientUpdate1.js} +0 -0
  202. /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/client/requests/RecalculateOrderTaxInvoiceLineItemsReq.js → taxConfigurations/client/requests/TaxConfigurationResolveReq.js} +0 -0
  203. /package/dist/cjs/api/resources/billingNew/resources/{invoices/client/requests/InvoiceClientCreate1.js → taxConfigurations/client/requests/TaxConfigurationsListV1Request.js} +0 -0
  204. /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/requests/index.js +0 -0
  205. /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/index.d.ts +0 -0
  206. /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/index.js +0 -0
  207. /package/dist/cjs/api/types/{CreateInvoiceLineItemsFromAmountRes.js → BillingPeriodCloseRes.js} +0 -0
  208. /package/dist/cjs/api/types/{CreateInvoiceLineItemsFromAwbCostsInvoiceRes1.js → CalculatedInvoiceTax1.js} +0 -0
  209. /package/dist/cjs/api/types/{CreateInvoiceLineItemsFromLineItemsRes.js → CreateInvoiceLineItemsFromAwbCostsGroupRes1.js} +0 -0
  210. /package/dist/cjs/api/types/{FlightTrackWaypoint1.js → InvoiceClientCreate1.js} +0 -0
  211. /package/dist/cjs/api/types/{InvoiceLineItemAmountTransformation1.js → InvoiceCreateFromOrdersReq.js} +0 -0
  212. /package/dist/cjs/api/types/{TaxRate1.js → InvoiceCreateFromOrdersRes.js} +0 -0
  213. /package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/{resources/export/client → client}/requests/InvoiceLineItemExportListReq.mjs +0 -0
  214. /package/dist/esm/api/resources/billingNew/resources/orders/{resources/rateSheetLineItems/client → client}/requests/OrderRateSheetLineItemsGenerateManyReq.d.mts +0 -0
  215. /package/dist/esm/api/resources/billingNew/resources/orders/{resources/rateSheetLineItems/client → client}/requests/OrderRateSheetLineItemsGenerateManyReq.mjs +0 -0
  216. /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/index.d.mts +0 -0
  217. /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/index.mjs +0 -0
  218. /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.mjs → taxConfigurations/client/requests/TaxConfigurationClientCreate1.mjs} +0 -0
  219. /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.mjs → taxConfigurations/client/requests/TaxConfigurationClientUpdate1.mjs} +0 -0
  220. /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/client/requests/RecalculateOrderTaxInvoiceLineItemsReq.mjs → taxConfigurations/client/requests/TaxConfigurationResolveReq.mjs} +0 -0
  221. /package/dist/esm/api/resources/billingNew/resources/{invoices/client/requests/InvoiceClientCreate1.mjs → taxConfigurations/client/requests/TaxConfigurationsListV1Request.mjs} +0 -0
  222. /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/requests/index.mjs +0 -0
  223. /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/index.d.mts +0 -0
  224. /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/index.mjs +0 -0
  225. /package/dist/esm/api/types/{CreateInvoiceLineItemsFromAmountRes.mjs → BillingPeriodCloseRes.mjs} +0 -0
  226. /package/dist/esm/api/types/{CreateInvoiceLineItemsFromAwbCostsInvoiceRes1.mjs → CalculatedInvoiceTax1.mjs} +0 -0
  227. /package/dist/esm/api/types/{CreateInvoiceLineItemsFromLineItemsRes.mjs → CreateInvoiceLineItemsFromAwbCostsGroupRes1.mjs} +0 -0
  228. /package/dist/esm/api/types/{FlightTrackWaypoint1.mjs → InvoiceClientCreate1.mjs} +0 -0
  229. /package/dist/esm/api/types/{InvoiceLineItemAmountTransformation1.mjs → InvoiceCreateFromOrdersReq.mjs} +0 -0
  230. /package/dist/esm/api/types/{TaxRate1.mjs → InvoiceCreateFromOrdersRes.mjs} +0 -0
@@ -0,0 +1,128 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../environments.js";
5
+ import * as core from "../../../../../../core/index.js";
6
+ import * as Chrt from "../../../../../index.js";
7
+ export declare namespace TaxConfigurations {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.ChrtEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ token?: core.Supplier<core.BearerToken | undefined>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
+ fetcher?: core.FetchFunction;
16
+ }
17
+ interface RequestOptions {
18
+ /** The maximum time to wait for a response in seconds. */
19
+ timeoutInSeconds?: number;
20
+ /** The number of times to retry the request. Defaults to 2. */
21
+ maxRetries?: number;
22
+ /** A hook to abort the request. */
23
+ abortSignal?: AbortSignal;
24
+ /** Additional query string parameters to include in the request. */
25
+ queryParams?: Record<string, unknown>;
26
+ /** Additional headers to include in the request. */
27
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
+ }
29
+ }
30
+ export declare class TaxConfigurations {
31
+ protected readonly _options: TaxConfigurations.Options;
32
+ constructor(_options?: TaxConfigurations.Options);
33
+ /**
34
+ * Archives a tax configuration so future resolution falls back to the next applicable scope. Repeated archival is unchanged. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (TaxConfiguration1)
35
+ *
36
+ * @param {string} taxConfigurationId
37
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
38
+ *
39
+ * @throws {@link Chrt.UnprocessableEntityError}
40
+ *
41
+ * @example
42
+ * await client.billingNew.taxConfigurations.archiveV1("tax_configuration_id")
43
+ */
44
+ archiveV1(taxConfigurationId: string, requestOptions?: TaxConfigurations.RequestOptions): core.HttpResponsePromise<Chrt.TaxConfiguration1>;
45
+ private __archiveV1;
46
+ /**
47
+ * Creates a counterparty tax default or account override. Empty rules mean no tax. | authz: allowed_org_types=[provider], min_org_role=operator | (TaxConfigurationClientCreate1) -> (TaxConfiguration1)
48
+ *
49
+ * @param {Chrt.billingNew.TaxConfigurationClientCreate1} request
50
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
51
+ *
52
+ * @throws {@link Chrt.UnprocessableEntityError}
53
+ *
54
+ * @example
55
+ * await client.billingNew.taxConfigurations.createV1({
56
+ * name: "name",
57
+ * schema_version: 1
58
+ * })
59
+ */
60
+ createV1(request: Chrt.billingNew.TaxConfigurationClientCreate1, requestOptions?: TaxConfigurations.RequestOptions): core.HttpResponsePromise<Chrt.TaxConfiguration1>;
61
+ private __createV1;
62
+ /**
63
+ * Retrieves an active or archived tax configuration owned by the caller's organization. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (TaxConfiguration1)
64
+ *
65
+ * @param {string} taxConfigurationId
66
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
67
+ *
68
+ * @throws {@link Chrt.UnprocessableEntityError}
69
+ *
70
+ * @example
71
+ * await client.billingNew.taxConfigurations.getV1("tax_configuration_id")
72
+ */
73
+ getV1(taxConfigurationId: string, requestOptions?: TaxConfigurations.RequestOptions): core.HttpResponsePromise<Chrt.TaxConfiguration1>;
74
+ private __getV1;
75
+ /**
76
+ * Lists owner-scoped tax configurations with counterparty, account, archive, date, sorting, and pagination filters. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (TaxConfigurationListRes)
77
+ *
78
+ * @param {Chrt.billingNew.TaxConfigurationsListV1Request} request
79
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
80
+ *
81
+ * @throws {@link Chrt.UnprocessableEntityError}
82
+ *
83
+ * @example
84
+ * await client.billingNew.taxConfigurations.listV1({
85
+ * sort_by: "name",
86
+ * sort_order: "asc",
87
+ * page: 1,
88
+ * page_size: 1,
89
+ * filter_counterparty_org_id: "filter_counterparty_org_id",
90
+ * filter_counterparty_off_chrt_org_data_id: "filter_counterparty_off_chrt_org_data_id",
91
+ * filter_counterparty_driver_id: "filter_counterparty_driver_id",
92
+ * filter_shipper_account_id: "filter_shipper_account_id",
93
+ * filter_archived: true,
94
+ * filter_created_at_timestamp_gte: "2024-01-15T09:30:00Z",
95
+ * filter_created_at_timestamp_lte: "2024-01-15T09:30:00Z"
96
+ * })
97
+ */
98
+ listV1(request?: Chrt.billingNew.TaxConfigurationsListV1Request, requestOptions?: TaxConfigurations.RequestOptions): core.HttpResponsePromise<Chrt.TaxConfigurationListRes>;
99
+ private __listV1;
100
+ /**
101
+ * Resolves account taxes or the counterparty default; returns null when neither exists. Empty rules explicitly mean no tax. | authz: allowed_org_types=[provider], min_org_role=operator | (TaxConfigurationResolveReq) -> (TaxConfiguration1 | None)
102
+ *
103
+ * @param {Chrt.billingNew.TaxConfigurationResolveReq} request
104
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
105
+ *
106
+ * @throws {@link Chrt.UnprocessableEntityError}
107
+ *
108
+ * @example
109
+ * await client.billingNew.taxConfigurations.resolveV1()
110
+ */
111
+ resolveV1(request?: Chrt.billingNew.TaxConfigurationResolveReq, requestOptions?: TaxConfigurations.RequestOptions): core.HttpResponsePromise<(Chrt.TaxConfiguration1 | null) | undefined>;
112
+ private __resolveV1;
113
+ /**
114
+ * Updates an active tax configuration's name or rules. Empty rules explicitly mean no tax. | authz: allowed_org_types=[provider], min_org_role=operator | (TaxConfigurationClientUpdate1) -> (TaxConfiguration1)
115
+ *
116
+ * @param {string} taxConfigurationId
117
+ * @param {Chrt.billingNew.TaxConfigurationClientUpdate1} request
118
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
119
+ *
120
+ * @throws {@link Chrt.UnprocessableEntityError}
121
+ *
122
+ * @example
123
+ * await client.billingNew.taxConfigurations.updateV1("tax_configuration_id")
124
+ */
125
+ updateV1(taxConfigurationId: string, request?: Chrt.billingNew.TaxConfigurationClientUpdate1, requestOptions?: TaxConfigurations.RequestOptions): core.HttpResponsePromise<Chrt.TaxConfiguration1>;
126
+ private __updateV1;
127
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
128
+ }
@@ -0,0 +1,485 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.TaxConfigurations = void 0;
49
+ const environments = __importStar(require("../../../../../../environments.js"));
50
+ const core = __importStar(require("../../../../../../core/index.js"));
51
+ const Chrt = __importStar(require("../../../../../index.js"));
52
+ const headers_js_1 = require("../../../../../../core/headers.js");
53
+ const errors = __importStar(require("../../../../../../errors/index.js"));
54
+ class TaxConfigurations {
55
+ constructor(_options = {}) {
56
+ this._options = _options;
57
+ }
58
+ /**
59
+ * Archives a tax configuration so future resolution falls back to the next applicable scope. Repeated archival is unchanged. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (TaxConfiguration1)
60
+ *
61
+ * @param {string} taxConfigurationId
62
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link Chrt.UnprocessableEntityError}
65
+ *
66
+ * @example
67
+ * await client.billingNew.taxConfigurations.archiveV1("tax_configuration_id")
68
+ */
69
+ archiveV1(taxConfigurationId, requestOptions) {
70
+ return core.HttpResponsePromise.fromPromise(this.__archiveV1(taxConfigurationId, requestOptions));
71
+ }
72
+ __archiveV1(taxConfigurationId, requestOptions) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ var _a, _b, _c, _d;
75
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
76
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
77
+ 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/tax_configurations/archive/v1/${encodeURIComponent(taxConfigurationId)}`),
78
+ method: "POST",
79
+ headers: _headers,
80
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
81
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
82
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
83
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
84
+ });
85
+ if (_response.ok) {
86
+ return { data: _response.body, rawResponse: _response.rawResponse };
87
+ }
88
+ if (_response.error.reason === "status-code") {
89
+ switch (_response.error.statusCode) {
90
+ case 422:
91
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
92
+ default:
93
+ throw new errors.ChrtError({
94
+ statusCode: _response.error.statusCode,
95
+ body: _response.error.body,
96
+ rawResponse: _response.rawResponse,
97
+ });
98
+ }
99
+ }
100
+ switch (_response.error.reason) {
101
+ case "non-json":
102
+ throw new errors.ChrtError({
103
+ statusCode: _response.error.statusCode,
104
+ body: _response.error.rawBody,
105
+ rawResponse: _response.rawResponse,
106
+ });
107
+ case "timeout":
108
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/tax_configurations/archive/v1/{tax_configuration_id}.");
109
+ case "unknown":
110
+ throw new errors.ChrtError({
111
+ message: _response.error.errorMessage,
112
+ rawResponse: _response.rawResponse,
113
+ });
114
+ }
115
+ });
116
+ }
117
+ /**
118
+ * Creates a counterparty tax default or account override. Empty rules mean no tax. | authz: allowed_org_types=[provider], min_org_role=operator | (TaxConfigurationClientCreate1) -> (TaxConfiguration1)
119
+ *
120
+ * @param {Chrt.billingNew.TaxConfigurationClientCreate1} request
121
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
122
+ *
123
+ * @throws {@link Chrt.UnprocessableEntityError}
124
+ *
125
+ * @example
126
+ * await client.billingNew.taxConfigurations.createV1({
127
+ * name: "name",
128
+ * schema_version: 1
129
+ * })
130
+ */
131
+ createV1(request, requestOptions) {
132
+ return core.HttpResponsePromise.fromPromise(this.__createV1(request, requestOptions));
133
+ }
134
+ __createV1(request, requestOptions) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ var _a, _b, _c, _d;
137
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
138
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
139
+ 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/tax_configurations/create/v1"),
140
+ method: "POST",
141
+ headers: _headers,
142
+ contentType: "application/json",
143
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
144
+ requestType: "json",
145
+ body: request,
146
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
147
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
148
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
149
+ });
150
+ if (_response.ok) {
151
+ return { data: _response.body, rawResponse: _response.rawResponse };
152
+ }
153
+ if (_response.error.reason === "status-code") {
154
+ switch (_response.error.statusCode) {
155
+ case 422:
156
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
157
+ default:
158
+ throw new errors.ChrtError({
159
+ statusCode: _response.error.statusCode,
160
+ body: _response.error.body,
161
+ rawResponse: _response.rawResponse,
162
+ });
163
+ }
164
+ }
165
+ switch (_response.error.reason) {
166
+ case "non-json":
167
+ throw new errors.ChrtError({
168
+ statusCode: _response.error.statusCode,
169
+ body: _response.error.rawBody,
170
+ rawResponse: _response.rawResponse,
171
+ });
172
+ case "timeout":
173
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/tax_configurations/create/v1.");
174
+ case "unknown":
175
+ throw new errors.ChrtError({
176
+ message: _response.error.errorMessage,
177
+ rawResponse: _response.rawResponse,
178
+ });
179
+ }
180
+ });
181
+ }
182
+ /**
183
+ * Retrieves an active or archived tax configuration owned by the caller's organization. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (TaxConfiguration1)
184
+ *
185
+ * @param {string} taxConfigurationId
186
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
187
+ *
188
+ * @throws {@link Chrt.UnprocessableEntityError}
189
+ *
190
+ * @example
191
+ * await client.billingNew.taxConfigurations.getV1("tax_configuration_id")
192
+ */
193
+ getV1(taxConfigurationId, requestOptions) {
194
+ return core.HttpResponsePromise.fromPromise(this.__getV1(taxConfigurationId, requestOptions));
195
+ }
196
+ __getV1(taxConfigurationId, requestOptions) {
197
+ return __awaiter(this, void 0, void 0, function* () {
198
+ var _a, _b, _c, _d;
199
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
200
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
201
+ 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/tax_configurations/get/v1/${encodeURIComponent(taxConfigurationId)}`),
202
+ method: "GET",
203
+ headers: _headers,
204
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
205
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
206
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
207
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
208
+ });
209
+ if (_response.ok) {
210
+ return { data: _response.body, rawResponse: _response.rawResponse };
211
+ }
212
+ if (_response.error.reason === "status-code") {
213
+ switch (_response.error.statusCode) {
214
+ case 422:
215
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
216
+ default:
217
+ throw new errors.ChrtError({
218
+ statusCode: _response.error.statusCode,
219
+ body: _response.error.body,
220
+ rawResponse: _response.rawResponse,
221
+ });
222
+ }
223
+ }
224
+ switch (_response.error.reason) {
225
+ case "non-json":
226
+ throw new errors.ChrtError({
227
+ statusCode: _response.error.statusCode,
228
+ body: _response.error.rawBody,
229
+ rawResponse: _response.rawResponse,
230
+ });
231
+ case "timeout":
232
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing_new/tax_configurations/get/v1/{tax_configuration_id}.");
233
+ case "unknown":
234
+ throw new errors.ChrtError({
235
+ message: _response.error.errorMessage,
236
+ rawResponse: _response.rawResponse,
237
+ });
238
+ }
239
+ });
240
+ }
241
+ /**
242
+ * Lists owner-scoped tax configurations with counterparty, account, archive, date, sorting, and pagination filters. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (TaxConfigurationListRes)
243
+ *
244
+ * @param {Chrt.billingNew.TaxConfigurationsListV1Request} request
245
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
246
+ *
247
+ * @throws {@link Chrt.UnprocessableEntityError}
248
+ *
249
+ * @example
250
+ * await client.billingNew.taxConfigurations.listV1({
251
+ * sort_by: "name",
252
+ * sort_order: "asc",
253
+ * page: 1,
254
+ * page_size: 1,
255
+ * filter_counterparty_org_id: "filter_counterparty_org_id",
256
+ * filter_counterparty_off_chrt_org_data_id: "filter_counterparty_off_chrt_org_data_id",
257
+ * filter_counterparty_driver_id: "filter_counterparty_driver_id",
258
+ * filter_shipper_account_id: "filter_shipper_account_id",
259
+ * filter_archived: true,
260
+ * filter_created_at_timestamp_gte: "2024-01-15T09:30:00Z",
261
+ * filter_created_at_timestamp_lte: "2024-01-15T09:30:00Z"
262
+ * })
263
+ */
264
+ listV1(request = {}, requestOptions) {
265
+ return core.HttpResponsePromise.fromPromise(this.__listV1(request, requestOptions));
266
+ }
267
+ __listV1() {
268
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
269
+ var _a, _b, _c, _d, _e, _f, _g;
270
+ const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_counterparty_org_id: filterCounterpartyOrgId, filter_counterparty_off_chrt_org_data_id: filterCounterpartyOffChrtOrgDataId, filter_counterparty_driver_id: filterCounterpartyDriverId, filter_shipper_account_id: filterShipperAccountId, filter_archived: filterArchived, filter_created_at_timestamp_gte: filterCreatedAtTimestampGte, filter_created_at_timestamp_lte: filterCreatedAtTimestampLte, } = request;
271
+ const _queryParams = {};
272
+ if (sortBy !== undefined) {
273
+ _queryParams["sort_by"] = sortBy;
274
+ }
275
+ if (sortOrder !== undefined) {
276
+ _queryParams["sort_order"] = sortOrder;
277
+ }
278
+ if (page !== undefined) {
279
+ _queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
280
+ }
281
+ if (pageSize !== undefined) {
282
+ _queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
283
+ }
284
+ if (filterCounterpartyOrgId !== undefined) {
285
+ _queryParams["filter_counterparty_org_id"] = filterCounterpartyOrgId;
286
+ }
287
+ if (filterCounterpartyOffChrtOrgDataId !== undefined) {
288
+ _queryParams["filter_counterparty_off_chrt_org_data_id"] = filterCounterpartyOffChrtOrgDataId;
289
+ }
290
+ if (filterCounterpartyDriverId !== undefined) {
291
+ _queryParams["filter_counterparty_driver_id"] = filterCounterpartyDriverId;
292
+ }
293
+ if (filterShipperAccountId !== undefined) {
294
+ _queryParams["filter_shipper_account_id"] = filterShipperAccountId;
295
+ }
296
+ if (filterArchived !== undefined) {
297
+ _queryParams["filter_archived"] = (_c = filterArchived === null || filterArchived === void 0 ? void 0 : filterArchived.toString()) !== null && _c !== void 0 ? _c : null;
298
+ }
299
+ if (filterCreatedAtTimestampGte !== undefined) {
300
+ _queryParams["filter_created_at_timestamp_gte"] = filterCreatedAtTimestampGte;
301
+ }
302
+ if (filterCreatedAtTimestampLte !== undefined) {
303
+ _queryParams["filter_created_at_timestamp_lte"] = filterCreatedAtTimestampLte;
304
+ }
305
+ let _headers = (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
306
+ const _response = yield ((_e = this._options.fetcher) !== null && _e !== void 0 ? _e : core.fetcher)({
307
+ url: core.url.join((_g = (_f = (yield core.Supplier.get(this._options.baseUrl))) !== null && _f !== void 0 ? _f : (yield core.Supplier.get(this._options.environment))) !== null && _g !== void 0 ? _g : environments.ChrtEnvironment.Local, "billing_new/tax_configurations/list/v1"),
308
+ method: "GET",
309
+ headers: _headers,
310
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
311
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
312
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
313
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
314
+ });
315
+ if (_response.ok) {
316
+ return { data: _response.body, rawResponse: _response.rawResponse };
317
+ }
318
+ if (_response.error.reason === "status-code") {
319
+ switch (_response.error.statusCode) {
320
+ case 422:
321
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
322
+ default:
323
+ throw new errors.ChrtError({
324
+ statusCode: _response.error.statusCode,
325
+ body: _response.error.body,
326
+ rawResponse: _response.rawResponse,
327
+ });
328
+ }
329
+ }
330
+ switch (_response.error.reason) {
331
+ case "non-json":
332
+ throw new errors.ChrtError({
333
+ statusCode: _response.error.statusCode,
334
+ body: _response.error.rawBody,
335
+ rawResponse: _response.rawResponse,
336
+ });
337
+ case "timeout":
338
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing_new/tax_configurations/list/v1.");
339
+ case "unknown":
340
+ throw new errors.ChrtError({
341
+ message: _response.error.errorMessage,
342
+ rawResponse: _response.rawResponse,
343
+ });
344
+ }
345
+ });
346
+ }
347
+ /**
348
+ * Resolves account taxes or the counterparty default; returns null when neither exists. Empty rules explicitly mean no tax. | authz: allowed_org_types=[provider], min_org_role=operator | (TaxConfigurationResolveReq) -> (TaxConfiguration1 | None)
349
+ *
350
+ * @param {Chrt.billingNew.TaxConfigurationResolveReq} request
351
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
352
+ *
353
+ * @throws {@link Chrt.UnprocessableEntityError}
354
+ *
355
+ * @example
356
+ * await client.billingNew.taxConfigurations.resolveV1()
357
+ */
358
+ resolveV1(request = {}, requestOptions) {
359
+ return core.HttpResponsePromise.fromPromise(this.__resolveV1(request, requestOptions));
360
+ }
361
+ __resolveV1() {
362
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
363
+ var _a, _b, _c, _d;
364
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
365
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
366
+ 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/tax_configurations/resolve/v1"),
367
+ method: "POST",
368
+ headers: _headers,
369
+ contentType: "application/json",
370
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
371
+ requestType: "json",
372
+ body: request,
373
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
374
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
375
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
376
+ });
377
+ if (_response.ok) {
378
+ return {
379
+ data: _response.body,
380
+ rawResponse: _response.rawResponse,
381
+ };
382
+ }
383
+ if (_response.error.reason === "status-code") {
384
+ switch (_response.error.statusCode) {
385
+ case 422:
386
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
387
+ default:
388
+ throw new errors.ChrtError({
389
+ statusCode: _response.error.statusCode,
390
+ body: _response.error.body,
391
+ rawResponse: _response.rawResponse,
392
+ });
393
+ }
394
+ }
395
+ switch (_response.error.reason) {
396
+ case "non-json":
397
+ throw new errors.ChrtError({
398
+ statusCode: _response.error.statusCode,
399
+ body: _response.error.rawBody,
400
+ rawResponse: _response.rawResponse,
401
+ });
402
+ case "timeout":
403
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/tax_configurations/resolve/v1.");
404
+ case "unknown":
405
+ throw new errors.ChrtError({
406
+ message: _response.error.errorMessage,
407
+ rawResponse: _response.rawResponse,
408
+ });
409
+ }
410
+ });
411
+ }
412
+ /**
413
+ * Updates an active tax configuration's name or rules. Empty rules explicitly mean no tax. | authz: allowed_org_types=[provider], min_org_role=operator | (TaxConfigurationClientUpdate1) -> (TaxConfiguration1)
414
+ *
415
+ * @param {string} taxConfigurationId
416
+ * @param {Chrt.billingNew.TaxConfigurationClientUpdate1} request
417
+ * @param {TaxConfigurations.RequestOptions} requestOptions - Request-specific configuration.
418
+ *
419
+ * @throws {@link Chrt.UnprocessableEntityError}
420
+ *
421
+ * @example
422
+ * await client.billingNew.taxConfigurations.updateV1("tax_configuration_id")
423
+ */
424
+ updateV1(taxConfigurationId, request = {}, requestOptions) {
425
+ return core.HttpResponsePromise.fromPromise(this.__updateV1(taxConfigurationId, request, requestOptions));
426
+ }
427
+ __updateV1(taxConfigurationId_1) {
428
+ return __awaiter(this, arguments, void 0, function* (taxConfigurationId, request = {}, requestOptions) {
429
+ var _a, _b, _c, _d;
430
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
431
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
432
+ 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/tax_configurations/update/v1/${encodeURIComponent(taxConfigurationId)}`),
433
+ method: "PATCH",
434
+ headers: _headers,
435
+ contentType: "application/json",
436
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
437
+ requestType: "json",
438
+ body: request,
439
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
440
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
441
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
442
+ });
443
+ if (_response.ok) {
444
+ return { data: _response.body, rawResponse: _response.rawResponse };
445
+ }
446
+ if (_response.error.reason === "status-code") {
447
+ switch (_response.error.statusCode) {
448
+ case 422:
449
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
450
+ default:
451
+ throw new errors.ChrtError({
452
+ statusCode: _response.error.statusCode,
453
+ body: _response.error.body,
454
+ rawResponse: _response.rawResponse,
455
+ });
456
+ }
457
+ }
458
+ switch (_response.error.reason) {
459
+ case "non-json":
460
+ throw new errors.ChrtError({
461
+ statusCode: _response.error.statusCode,
462
+ body: _response.error.rawBody,
463
+ rawResponse: _response.rawResponse,
464
+ });
465
+ case "timeout":
466
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /billing_new/tax_configurations/update/v1/{tax_configuration_id}.");
467
+ case "unknown":
468
+ throw new errors.ChrtError({
469
+ message: _response.error.errorMessage,
470
+ rawResponse: _response.rawResponse,
471
+ });
472
+ }
473
+ });
474
+ }
475
+ _getAuthorizationHeader() {
476
+ return __awaiter(this, void 0, void 0, function* () {
477
+ const bearer = yield core.Supplier.get(this._options.token);
478
+ if (bearer != null) {
479
+ return `Bearer ${bearer}`;
480
+ }
481
+ return undefined;
482
+ });
483
+ }
484
+ }
485
+ exports.TaxConfigurations = TaxConfigurations;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * name: "name",
9
+ * schema_version: 1
10
+ * }
11
+ */
12
+ export interface TaxConfigurationClientCreate1 {
13
+ counterparty_driver_id?: string | null;
14
+ counterparty_off_chrt_org_data_id?: string | null;
15
+ /** Must be a string starting with `org_` */
16
+ counterparty_org_id?: string | null;
17
+ name: string;
18
+ schema_version: number;
19
+ shipper_account_id?: string | null;
20
+ tax_rules?: Chrt.TaxRule1[];
21
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {}
8
+ */
9
+ export interface TaxConfigurationClientUpdate1 {
10
+ name?: string | null;
11
+ tax_rules?: Chrt.TaxRule1[];
12
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface TaxConfigurationResolveReq {
9
+ counterparty_driver_id?: string | null;
10
+ counterparty_off_chrt_org_data_id?: string | null;
11
+ /** Must be a string starting with `org_` */
12
+ counterparty_org_id?: string | null;
13
+ shipper_account_id?: string | null;
14
+ }