@chrt-inc/typescript-sdk 1.998.0 → 1.1000.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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/billingNew/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/billingNew/client/Client.js +5 -0
- package/dist/cjs/api/resources/billingNew/resources/billingPeriods/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/billingNew/resources/billingPeriods/client/Client.js +1 -1
- package/dist/cjs/api/resources/billingNew/resources/chrtGroundProviderRates/client/requests/ChrtGroundProviderRatesClientCreate1.d.ts +0 -3
- package/dist/cjs/api/resources/billingNew/resources/chrtGroundProviderRates/client/requests/ChrtGroundProviderRatesClientUpdate1.d.ts +0 -6
- package/dist/cjs/api/resources/billingNew/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/billingNew/resources/index.js +3 -1
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/Client.d.ts +17 -73
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/Client.js +50 -193
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/{resources/export/client → client}/requests/InvoiceLineItemExportListReq.d.ts +1 -0
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.d.ts +1 -3
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/index.d.ts +0 -1
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/index.js +0 -1
- package/dist/cjs/api/resources/billingNew/resources/invoices/client/Client.d.ts +57 -32
- package/dist/cjs/api/resources/billingNew/resources/invoices/client/Client.js +169 -89
- package/dist/cjs/api/resources/billingNew/resources/invoices/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/billingNew/resources/orders/client/Client.d.ts +30 -3
- package/dist/cjs/api/resources/billingNew/resources/orders/client/Client.js +137 -6
- package/dist/cjs/api/resources/billingNew/resources/orders/client/requests/OrderBillingExpandedListReq.d.ts +7 -1
- package/dist/cjs/api/resources/billingNew/resources/orders/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/billingNew/resources/orders/index.d.ts +0 -1
- package/dist/cjs/api/resources/billingNew/resources/orders/index.js +0 -1
- package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/Client.d.ts +128 -0
- package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/Client.js +485 -0
- package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationClientCreate1.d.ts +21 -0
- package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationClientUpdate1.d.ts +12 -0
- package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationResolveReq.d.ts +14 -0
- package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationsListV1Request.d.ts +33 -0
- package/dist/cjs/api/resources/billingNew/resources/taxConfigurations/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/flights/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/flights/client/Client.js +1 -1
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.d.ts +4 -0
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.js +22 -2
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForProviderOperatorsV1Request.d.ts +6 -0
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForShipperOperatorsV1Request.d.ts +6 -0
- package/dist/cjs/api/types/BillingCurrencyCodeEnum1.d.ts +1 -2
- package/dist/cjs/api/types/BillingCurrencyCodeEnum1.js +0 -1
- package/dist/cjs/api/types/BillingPeriodCloseRes.d.ts +8 -0
- package/dist/cjs/api/types/CalculatedInvoiceTax1.d.ts +12 -0
- package/dist/cjs/api/types/ChrtGroundProviderRates1.d.ts +0 -3
- package/dist/cjs/api/types/{CreateInvoiceLineItemsFromAwbCostsInvoiceRes1.d.ts → CreateInvoiceLineItemsFromAwbCostsGroupRes1.d.ts} +2 -2
- package/dist/cjs/api/types/CreateInvoiceLineItemsFromAwbCostsRes.d.ts +1 -1
- package/dist/cjs/api/{resources/billingNew/resources/invoices/client/requests → types}/InvoiceClientCreate1.d.ts +1 -9
- package/dist/cjs/api/types/InvoiceCreateFromOrdersReq.d.ts +22 -0
- package/dist/cjs/api/types/InvoiceCreateFromOrdersRes.d.ts +14 -0
- package/dist/cjs/api/types/InvoiceCreateFromOrdersRes.js +5 -0
- package/dist/cjs/api/types/InvoiceCreateReq.d.ts +20 -0
- package/dist/cjs/api/types/InvoiceCreateReq.js +5 -0
- package/dist/cjs/api/types/InvoiceLineItem1.d.ts +1 -0
- package/dist/cjs/api/types/InvoiceLineItemExportListItem.d.ts +4 -2
- package/dist/cjs/api/types/InvoiceLineItemTypeEnum1.d.ts +2 -4
- package/dist/cjs/api/types/InvoiceLineItemTypeEnum1.js +1 -3
- package/dist/cjs/api/types/InvoicePreviewFromOrdersRes.d.ts +15 -0
- package/dist/cjs/api/types/InvoicePreviewFromOrdersRes.js +5 -0
- package/dist/cjs/api/types/InvoicePreviewRes.d.ts +10 -0
- package/dist/cjs/api/types/InvoicePreviewRes.js +5 -0
- package/dist/cjs/api/types/InvoiceTaxCalculation1.d.ts +12 -0
- package/dist/cjs/api/types/InvoiceTaxCalculation1.js +5 -0
- package/dist/cjs/api/types/Order1.d.ts +1 -0
- package/dist/cjs/api/types/OrderBillingExpandedListItem1.d.ts +7 -0
- package/dist/cjs/api/types/OrderBillingSortByEnum.d.ts +2 -1
- package/dist/cjs/api/types/OrderBillingSortByEnum.js +1 -0
- package/dist/cjs/api/types/OrderLimitedForProvider1.d.ts +1 -0
- package/dist/cjs/api/types/OrderLimitedForShipper1.d.ts +1 -0
- package/dist/cjs/api/types/OrderSortByEnum.d.ts +2 -1
- package/dist/cjs/api/types/OrderSortByEnum.js +1 -0
- package/dist/cjs/api/types/TaxConfiguration1.d.ts +24 -0
- package/dist/cjs/api/types/TaxConfiguration1.js +5 -0
- package/dist/cjs/api/types/TaxConfigurationListRes.d.ts +8 -0
- package/dist/cjs/api/types/TaxConfigurationListRes.js +5 -0
- package/dist/cjs/api/types/TaxConfigurationSortByEnum.d.ts +8 -0
- package/dist/cjs/api/types/TaxConfigurationSortByEnum.js +10 -0
- package/dist/cjs/api/types/{TaxRate1.d.ts → TaxRule1.d.ts} +2 -3
- package/dist/cjs/api/types/TaxRule1.js +5 -0
- package/dist/cjs/api/types/index.d.ts +14 -6
- package/dist/cjs/api/types/index.js +14 -6
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/billingNew/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/billingNew/client/Client.mjs +5 -0
- package/dist/esm/api/resources/billingNew/resources/billingPeriods/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/billingNew/resources/billingPeriods/client/Client.mjs +1 -1
- package/dist/esm/api/resources/billingNew/resources/chrtGroundProviderRates/client/requests/ChrtGroundProviderRatesClientCreate1.d.mts +0 -3
- package/dist/esm/api/resources/billingNew/resources/chrtGroundProviderRates/client/requests/ChrtGroundProviderRatesClientUpdate1.d.mts +0 -6
- package/dist/esm/api/resources/billingNew/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/billingNew/resources/index.mjs +2 -0
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/Client.d.mts +17 -73
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/Client.mjs +50 -193
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/{resources/export/client → client}/requests/InvoiceLineItemExportListReq.d.mts +1 -0
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.d.mts +1 -3
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/index.d.mts +0 -1
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/index.mjs +0 -1
- package/dist/esm/api/resources/billingNew/resources/invoices/client/Client.d.mts +57 -32
- package/dist/esm/api/resources/billingNew/resources/invoices/client/Client.mjs +169 -89
- package/dist/esm/api/resources/billingNew/resources/invoices/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/billingNew/resources/orders/client/Client.d.mts +30 -3
- package/dist/esm/api/resources/billingNew/resources/orders/client/Client.mjs +137 -6
- package/dist/esm/api/resources/billingNew/resources/orders/client/requests/OrderBillingExpandedListReq.d.mts +7 -1
- package/dist/esm/api/resources/billingNew/resources/orders/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/billingNew/resources/orders/index.d.mts +0 -1
- package/dist/esm/api/resources/billingNew/resources/orders/index.mjs +0 -1
- package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/Client.d.mts +128 -0
- package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/Client.mjs +448 -0
- package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationClientCreate1.d.mts +21 -0
- package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationClientUpdate1.d.mts +12 -0
- package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationResolveReq.d.mts +14 -0
- package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/requests/TaxConfigurationsListV1Request.d.mts +33 -0
- package/dist/esm/api/resources/billingNew/resources/taxConfigurations/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/flights/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/flights/client/Client.mjs +1 -1
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.d.mts +4 -0
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.mjs +22 -2
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForProviderOperatorsV1Request.d.mts +6 -0
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForShipperOperatorsV1Request.d.mts +6 -0
- package/dist/esm/api/types/BillingCurrencyCodeEnum1.d.mts +1 -2
- package/dist/esm/api/types/BillingCurrencyCodeEnum1.mjs +0 -1
- package/dist/esm/api/types/BillingPeriodCloseRes.d.mts +8 -0
- package/dist/esm/api/types/CalculatedInvoiceTax1.d.mts +12 -0
- package/dist/esm/api/types/ChrtGroundProviderRates1.d.mts +0 -3
- package/dist/esm/api/types/{CreateInvoiceLineItemsFromAwbCostsInvoiceRes1.d.mts → CreateInvoiceLineItemsFromAwbCostsGroupRes1.d.mts} +2 -2
- package/dist/esm/api/types/CreateInvoiceLineItemsFromAwbCostsRes.d.mts +1 -1
- package/dist/esm/api/{resources/billingNew/resources/invoices/client/requests → types}/InvoiceClientCreate1.d.mts +1 -9
- package/dist/esm/api/types/InvoiceCreateFromOrdersReq.d.mts +22 -0
- package/dist/esm/api/types/InvoiceCreateFromOrdersRes.d.mts +14 -0
- package/dist/esm/api/types/InvoiceCreateFromOrdersRes.mjs +4 -0
- package/dist/esm/api/types/InvoiceCreateReq.d.mts +20 -0
- package/dist/esm/api/types/InvoiceCreateReq.mjs +4 -0
- package/dist/esm/api/types/InvoiceLineItem1.d.mts +1 -0
- package/dist/esm/api/types/InvoiceLineItemExportListItem.d.mts +4 -2
- package/dist/esm/api/types/InvoiceLineItemTypeEnum1.d.mts +2 -4
- package/dist/esm/api/types/InvoiceLineItemTypeEnum1.mjs +1 -3
- package/dist/esm/api/types/InvoicePreviewFromOrdersRes.d.mts +15 -0
- package/dist/esm/api/types/InvoicePreviewFromOrdersRes.mjs +4 -0
- package/dist/esm/api/types/InvoicePreviewRes.d.mts +10 -0
- package/dist/esm/api/types/InvoicePreviewRes.mjs +4 -0
- package/dist/esm/api/types/InvoiceTaxCalculation1.d.mts +12 -0
- package/dist/esm/api/types/InvoiceTaxCalculation1.mjs +4 -0
- package/dist/esm/api/types/Order1.d.mts +1 -0
- package/dist/esm/api/types/OrderBillingExpandedListItem1.d.mts +7 -0
- package/dist/esm/api/types/OrderBillingSortByEnum.d.mts +2 -1
- package/dist/esm/api/types/OrderBillingSortByEnum.mjs +1 -0
- package/dist/esm/api/types/OrderLimitedForProvider1.d.mts +1 -0
- package/dist/esm/api/types/OrderLimitedForShipper1.d.mts +1 -0
- package/dist/esm/api/types/OrderSortByEnum.d.mts +2 -1
- package/dist/esm/api/types/OrderSortByEnum.mjs +1 -0
- package/dist/esm/api/types/TaxConfiguration1.d.mts +24 -0
- package/dist/esm/api/types/TaxConfiguration1.mjs +4 -0
- package/dist/esm/api/types/TaxConfigurationListRes.d.mts +8 -0
- package/dist/esm/api/types/TaxConfigurationListRes.mjs +4 -0
- package/dist/esm/api/types/TaxConfigurationSortByEnum.d.mts +8 -0
- package/dist/esm/api/types/TaxConfigurationSortByEnum.mjs +7 -0
- package/dist/esm/api/types/{TaxRate1.d.mts → TaxRule1.d.mts} +2 -3
- package/dist/esm/api/types/TaxRule1.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +14 -6
- package/dist/esm/api/types/index.mjs +14 -6
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +526 -219
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.d.ts +0 -32
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.d.ts +0 -46
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/RecalculateOrderTaxInvoiceLineItemsReq.d.ts +0 -12
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/Client.d.ts +0 -51
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/Client.js +0 -153
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/index.d.ts +0 -2
- package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/index.js +0 -41
- package/dist/cjs/api/resources/billingNew/resources/orders/resources/index.d.ts +0 -2
- package/dist/cjs/api/resources/billingNew/resources/orders/resources/index.js +0 -41
- package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/Client.d.ts +0 -49
- package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/Client.js +0 -135
- package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/index.js +0 -17
- package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/index.d.ts +0 -1
- package/dist/cjs/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/index.js +0 -17
- package/dist/cjs/api/types/CreateInvoiceLineItemsFromAmountRes.d.ts +0 -7
- package/dist/cjs/api/types/CreateInvoiceLineItemsFromLineItemsRes.d.ts +0 -7
- package/dist/cjs/api/types/InvoiceLineItemAmountTransformation1.d.ts +0 -8
- package/dist/cjs/api/types/InvoiceLineItemAmountTransformationTypeEnum1.d.ts +0 -9
- package/dist/cjs/api/types/InvoiceLineItemAmountTransformationTypeEnum1.js +0 -11
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.d.mts +0 -32
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.d.mts +0 -46
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/RecalculateOrderTaxInvoiceLineItemsReq.d.mts +0 -12
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/Client.d.mts +0 -51
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/Client.mjs +0 -116
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/index.mjs +0 -2
- package/dist/esm/api/resources/billingNew/resources/orders/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/billingNew/resources/orders/resources/index.mjs +0 -2
- package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/Client.d.mts +0 -49
- package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/Client.mjs +0 -98
- package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/index.d.mts +0 -2
- package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/index.mjs +0 -1
- package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/index.d.mts +0 -1
- package/dist/esm/api/resources/billingNew/resources/orders/resources/rateSheetLineItems/index.mjs +0 -1
- package/dist/esm/api/types/CreateInvoiceLineItemsFromAmountRes.d.mts +0 -7
- package/dist/esm/api/types/CreateInvoiceLineItemsFromLineItemsRes.d.mts +0 -7
- package/dist/esm/api/types/InvoiceLineItemAmountTransformation1.d.mts +0 -8
- package/dist/esm/api/types/InvoiceLineItemAmountTransformationTypeEnum1.d.mts +0 -9
- package/dist/esm/api/types/InvoiceLineItemAmountTransformationTypeEnum1.mjs +0 -8
- /package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/{resources/export/client → client}/requests/InvoiceLineItemExportListReq.js +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/orders/{resources/rateSheetLineItems/client → client}/requests/OrderRateSheetLineItemsGenerateManyReq.d.ts +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/orders/{resources/rateSheetLineItems/client → client}/requests/OrderRateSheetLineItemsGenerateManyReq.js +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/index.js +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.js → taxConfigurations/client/requests/TaxConfigurationClientCreate1.js} +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.js → taxConfigurations/client/requests/TaxConfigurationClientUpdate1.js} +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/client/requests/RecalculateOrderTaxInvoiceLineItemsReq.js → taxConfigurations/client/requests/TaxConfigurationResolveReq.js} +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/{invoices/client/requests/InvoiceClientCreate1.js → taxConfigurations/client/requests/TaxConfigurationsListV1Request.js} +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/index.js +0 -0
- /package/dist/cjs/api/types/{CreateInvoiceLineItemsFromAmountRes.js → BillingPeriodCloseRes.js} +0 -0
- /package/dist/cjs/api/types/{CreateInvoiceLineItemsFromAwbCostsInvoiceRes1.js → CalculatedInvoiceTax1.js} +0 -0
- /package/dist/cjs/api/types/{CreateInvoiceLineItemsFromLineItemsRes.js → CreateInvoiceLineItemsFromAwbCostsGroupRes1.js} +0 -0
- /package/dist/cjs/api/types/{InvoiceLineItemAmountTransformation1.js → InvoiceClientCreate1.js} +0 -0
- /package/dist/cjs/api/types/{TaxRate1.js → InvoiceCreateFromOrdersReq.js} +0 -0
- /package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/{resources/export/client → client}/requests/InvoiceLineItemExportListReq.mjs +0 -0
- /package/dist/esm/api/resources/billingNew/resources/orders/{resources/rateSheetLineItems/client → client}/requests/OrderRateSheetLineItemsGenerateManyReq.d.mts +0 -0
- /package/dist/esm/api/resources/billingNew/resources/orders/{resources/rateSheetLineItems/client → client}/requests/OrderRateSheetLineItemsGenerateManyReq.mjs +0 -0
- /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/client/requests/CreateInvoiceLineItemsFromAmountReq.mjs → taxConfigurations/client/requests/TaxConfigurationClientCreate1.mjs} +0 -0
- /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/client/requests/CreateInvoiceLineItemsFromLineItemsReq.mjs → taxConfigurations/client/requests/TaxConfigurationClientUpdate1.mjs} +0 -0
- /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/client/requests/RecalculateOrderTaxInvoiceLineItemsReq.mjs → taxConfigurations/client/requests/TaxConfigurationResolveReq.mjs} +0 -0
- /package/dist/esm/api/resources/billingNew/resources/{invoices/client/requests/InvoiceClientCreate1.mjs → taxConfigurations/client/requests/TaxConfigurationsListV1Request.mjs} +0 -0
- /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/index.d.mts +0 -0
- /package/dist/esm/api/resources/billingNew/resources/{invoiceLineItems/resources/export → taxConfigurations}/index.mjs +0 -0
- /package/dist/esm/api/types/{CreateInvoiceLineItemsFromAmountRes.mjs → BillingPeriodCloseRes.mjs} +0 -0
- /package/dist/esm/api/types/{CreateInvoiceLineItemsFromAwbCostsInvoiceRes1.mjs → CalculatedInvoiceTax1.mjs} +0 -0
- /package/dist/esm/api/types/{CreateInvoiceLineItemsFromLineItemsRes.mjs → CreateInvoiceLineItemsFromAwbCostsGroupRes1.mjs} +0 -0
- /package/dist/esm/api/types/{InvoiceLineItemAmountTransformation1.mjs → InvoiceClientCreate1.mjs} +0 -0
- /package/dist/esm/api/types/{TaxRate1.mjs → InvoiceCreateFromOrdersReq.mjs} +0 -0
|
@@ -26,6 +26,8 @@ import * as Chrt from "../../../../../../index.js";
|
|
|
26
26
|
* filter_in_progress_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
27
27
|
* filter_completed_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
28
28
|
* filter_completed_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
29
|
+
* filter_last_delivery_task_completed_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
30
|
+
* filter_last_delivery_task_completed_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
29
31
|
* filter_cancelled_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
30
32
|
* filter_cancelled_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
31
33
|
* filter_exception_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
@@ -33,7 +35,7 @@ import * as Chrt from "../../../../../../index.js";
|
|
|
33
35
|
* }
|
|
34
36
|
*/
|
|
35
37
|
export interface OrderBillingExpandedListReq {
|
|
36
|
-
/** Order lifecycle timestamp used for sorting. */
|
|
38
|
+
/** Order lifecycle or last delivery completion timestamp used for sorting. */
|
|
37
39
|
sort_by?: Chrt.OrderBillingSortByEnum | null;
|
|
38
40
|
/** Sort order (asc or desc). */
|
|
39
41
|
sort_order?: Chrt.SortOrderEnum | null;
|
|
@@ -65,6 +67,10 @@ export interface OrderBillingExpandedListReq {
|
|
|
65
67
|
filter_in_progress_at_timestamp_lte?: string | null;
|
|
66
68
|
filter_completed_at_timestamp_gte?: string | null;
|
|
67
69
|
filter_completed_at_timestamp_lte?: string | null;
|
|
70
|
+
/** Filter by last delivery completion time, inclusive. */
|
|
71
|
+
filter_last_delivery_task_completed_at_timestamp_gte?: string | null;
|
|
72
|
+
/** Filter by last delivery completion time, inclusive. */
|
|
73
|
+
filter_last_delivery_task_completed_at_timestamp_lte?: string | null;
|
|
68
74
|
filter_cancelled_at_timestamp_gte?: string | null;
|
|
69
75
|
filter_cancelled_at_timestamp_lte?: string | null;
|
|
70
76
|
filter_exception_at_timestamp_gte?: string | null;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { type OrdersListAwbBillingForCoordinatorOperatorsV1Request } from "./OrdersListAwbBillingForCoordinatorOperatorsV1Request.js";
|
|
2
2
|
export { type OrderBillingExpandedListReq } from "./OrderBillingExpandedListReq.js";
|
|
3
|
+
export { type OrderRateSheetLineItemsGenerateManyReq } from "./OrderRateSheetLineItemsGenerateManyReq.js";
|
|
@@ -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;
|