@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
|
@@ -79,9 +79,9 @@ export class Invoices {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* Creates a new draft invoice, optionally attaching selected uninvoiced charges atomically. Omitted dates derive from completed deliveries; empty drafts and charges without completed delivery dates require explicit bounds. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceCreateReq) -> (PydanticObjectId)
|
|
83
83
|
*
|
|
84
|
-
* @param {Chrt.
|
|
84
|
+
* @param {Chrt.InvoiceCreateReq} request
|
|
85
85
|
* @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
86
|
*
|
|
87
87
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
@@ -145,87 +145,36 @@ export class Invoices {
|
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
|
-
*
|
|
148
|
+
* Creates one draft from matching order charges and reports skipped items. Billing period dates do not filter charges. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceCreateFromOrdersReq) -> (InvoiceCreateFromOrdersRes)
|
|
149
149
|
*
|
|
150
|
-
* @param {
|
|
150
|
+
* @param {Chrt.InvoiceCreateFromOrdersReq} request
|
|
151
151
|
* @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
|
|
152
152
|
*
|
|
153
153
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
154
154
|
*
|
|
155
155
|
* @example
|
|
156
|
-
* await client.billingNew.invoices.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
-
var _a, _b, _c, _d;
|
|
164
|
-
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
165
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
166
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/delete/v1/${encodeURIComponent(invoiceId)}`),
|
|
167
|
-
method: "DELETE",
|
|
168
|
-
headers: _headers,
|
|
169
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
170
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
171
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
172
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
173
|
-
});
|
|
174
|
-
if (_response.ok) {
|
|
175
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
176
|
-
}
|
|
177
|
-
if (_response.error.reason === "status-code") {
|
|
178
|
-
switch (_response.error.statusCode) {
|
|
179
|
-
case 422:
|
|
180
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
181
|
-
default:
|
|
182
|
-
throw new errors.ChrtError({
|
|
183
|
-
statusCode: _response.error.statusCode,
|
|
184
|
-
body: _response.error.body,
|
|
185
|
-
rawResponse: _response.rawResponse,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
switch (_response.error.reason) {
|
|
190
|
-
case "non-json":
|
|
191
|
-
throw new errors.ChrtError({
|
|
192
|
-
statusCode: _response.error.statusCode,
|
|
193
|
-
body: _response.error.rawBody,
|
|
194
|
-
rawResponse: _response.rawResponse,
|
|
195
|
-
});
|
|
196
|
-
case "timeout":
|
|
197
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /billing_new/invoices/delete/v1/{invoice_id}.");
|
|
198
|
-
case "unknown":
|
|
199
|
-
throw new errors.ChrtError({
|
|
200
|
-
message: _response.error.errorMessage,
|
|
201
|
-
rawResponse: _response.rawResponse,
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Retrieves an owner-scoped invoice with line-item orders, counterparties, and accounts expanded. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (InvoiceExpandedRes)
|
|
208
|
-
*
|
|
209
|
-
* @param {string} invoiceId
|
|
210
|
-
* @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
|
|
211
|
-
*
|
|
212
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
213
|
-
*
|
|
214
|
-
* @example
|
|
215
|
-
* await client.billingNew.invoices.getExpandedV1("invoice_id")
|
|
156
|
+
* await client.billingNew.invoices.createFromOrdersV1({
|
|
157
|
+
* currency_code: "USD",
|
|
158
|
+
* invoice_type: "accounts_receivable",
|
|
159
|
+
* order_ids: ["order_ids"],
|
|
160
|
+
* schema_version: 1
|
|
161
|
+
* })
|
|
216
162
|
*/
|
|
217
|
-
|
|
218
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
163
|
+
createFromOrdersV1(request, requestOptions) {
|
|
164
|
+
return core.HttpResponsePromise.fromPromise(this.__createFromOrdersV1(request, requestOptions));
|
|
219
165
|
}
|
|
220
|
-
|
|
166
|
+
__createFromOrdersV1(request, requestOptions) {
|
|
221
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
222
168
|
var _a, _b, _c, _d;
|
|
223
169
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
224
170
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
225
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local,
|
|
226
|
-
method: "
|
|
171
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "billing_new/invoices/create_from_orders/v1"),
|
|
172
|
+
method: "POST",
|
|
227
173
|
headers: _headers,
|
|
174
|
+
contentType: "application/json",
|
|
228
175
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
176
|
+
requestType: "json",
|
|
177
|
+
body: request,
|
|
229
178
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
230
179
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
231
180
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -253,7 +202,7 @@ export class Invoices {
|
|
|
253
202
|
rawResponse: _response.rawResponse,
|
|
254
203
|
});
|
|
255
204
|
case "timeout":
|
|
256
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
205
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/invoices/create_from_orders/v1.");
|
|
257
206
|
case "unknown":
|
|
258
207
|
throw new errors.ChrtError({
|
|
259
208
|
message: _response.error.errorMessage,
|
|
@@ -263,27 +212,26 @@ export class Invoices {
|
|
|
263
212
|
});
|
|
264
213
|
}
|
|
265
214
|
/**
|
|
266
|
-
*
|
|
215
|
+
* Hard-deletes a draft invoice and detaches its line items. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (bool)
|
|
267
216
|
*
|
|
268
217
|
* @param {string} invoiceId
|
|
269
|
-
* @param {string} invoiceLineItemId
|
|
270
218
|
* @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
|
|
271
219
|
*
|
|
272
220
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
273
221
|
*
|
|
274
222
|
* @example
|
|
275
|
-
* await client.billingNew.invoices.
|
|
223
|
+
* await client.billingNew.invoices.deleteV1("invoice_id")
|
|
276
224
|
*/
|
|
277
|
-
|
|
278
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
225
|
+
deleteV1(invoiceId, requestOptions) {
|
|
226
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteV1(invoiceId, requestOptions));
|
|
279
227
|
}
|
|
280
|
-
|
|
228
|
+
__deleteV1(invoiceId, requestOptions) {
|
|
281
229
|
return __awaiter(this, void 0, void 0, function* () {
|
|
282
230
|
var _a, _b, _c, _d;
|
|
283
231
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
284
232
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
285
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/
|
|
286
|
-
method: "
|
|
233
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/delete/v1/${encodeURIComponent(invoiceId)}`),
|
|
234
|
+
method: "DELETE",
|
|
287
235
|
headers: _headers,
|
|
288
236
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
289
237
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -313,7 +261,7 @@ export class Invoices {
|
|
|
313
261
|
rawResponse: _response.rawResponse,
|
|
314
262
|
});
|
|
315
263
|
case "timeout":
|
|
316
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
264
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /billing_new/invoices/delete/v1/{invoice_id}.");
|
|
317
265
|
case "unknown":
|
|
318
266
|
throw new errors.ChrtError({
|
|
319
267
|
message: _response.error.errorMessage,
|
|
@@ -323,27 +271,26 @@ export class Invoices {
|
|
|
323
271
|
});
|
|
324
272
|
}
|
|
325
273
|
/**
|
|
326
|
-
*
|
|
274
|
+
* Retrieves an owner-scoped invoice with line-item orders, counterparties, and accounts expanded. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (InvoiceExpandedRes)
|
|
327
275
|
*
|
|
328
276
|
* @param {string} invoiceId
|
|
329
|
-
* @param {string} invoiceLineItemId
|
|
330
277
|
* @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
|
|
331
278
|
*
|
|
332
279
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
333
280
|
*
|
|
334
281
|
* @example
|
|
335
|
-
* await client.billingNew.invoices.
|
|
282
|
+
* await client.billingNew.invoices.getExpandedV1("invoice_id")
|
|
336
283
|
*/
|
|
337
|
-
|
|
338
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
284
|
+
getExpandedV1(invoiceId, requestOptions) {
|
|
285
|
+
return core.HttpResponsePromise.fromPromise(this.__getExpandedV1(invoiceId, requestOptions));
|
|
339
286
|
}
|
|
340
|
-
|
|
287
|
+
__getExpandedV1(invoiceId, requestOptions) {
|
|
341
288
|
return __awaiter(this, void 0, void 0, function* () {
|
|
342
289
|
var _a, _b, _c, _d;
|
|
343
290
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
344
291
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
345
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/
|
|
346
|
-
method: "
|
|
292
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `billing_new/invoices/expanded/v1/${encodeURIComponent(invoiceId)}`),
|
|
293
|
+
method: "GET",
|
|
347
294
|
headers: _headers,
|
|
348
295
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
349
296
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -373,7 +320,7 @@ export class Invoices {
|
|
|
373
320
|
rawResponse: _response.rawResponse,
|
|
374
321
|
});
|
|
375
322
|
case "timeout":
|
|
376
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
323
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing_new/invoices/expanded/v1/{invoice_id}.");
|
|
377
324
|
case "unknown":
|
|
378
325
|
throw new errors.ChrtError({
|
|
379
326
|
message: _response.error.errorMessage,
|
|
@@ -383,7 +330,7 @@ export class Invoices {
|
|
|
383
330
|
});
|
|
384
331
|
}
|
|
385
332
|
/**
|
|
386
|
-
* Attaches
|
|
333
|
+
* Attaches uninvoiced line items to a draft invoice and refreshes its totals and accounts. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsAddReq) -> (Invoice1)
|
|
387
334
|
*
|
|
388
335
|
* @param {string} invoiceId
|
|
389
336
|
* @param {Chrt.billingNew.InvoiceLineItemsAddReq} request
|
|
@@ -653,6 +600,139 @@ export class Invoices {
|
|
|
653
600
|
}
|
|
654
601
|
});
|
|
655
602
|
}
|
|
603
|
+
/**
|
|
604
|
+
* Previews exact uninvoiced charges, current resolved taxes, and explicit or derived billing dates without saving. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceCreateReq) -> (InvoicePreviewRes)
|
|
605
|
+
*
|
|
606
|
+
* @param {Chrt.InvoiceCreateReq} request
|
|
607
|
+
* @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
|
|
608
|
+
*
|
|
609
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
610
|
+
*
|
|
611
|
+
* @example
|
|
612
|
+
* await client.billingNew.invoices.previewV1({
|
|
613
|
+
* currency_code: "USD",
|
|
614
|
+
* invoice_type: "accounts_receivable",
|
|
615
|
+
* schema_version: 1
|
|
616
|
+
* })
|
|
617
|
+
*/
|
|
618
|
+
previewV1(request, requestOptions) {
|
|
619
|
+
return core.HttpResponsePromise.fromPromise(this.__previewV1(request, requestOptions));
|
|
620
|
+
}
|
|
621
|
+
__previewV1(request, requestOptions) {
|
|
622
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
623
|
+
var _a, _b, _c, _d;
|
|
624
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
625
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
626
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "billing_new/invoices/preview/v1"),
|
|
627
|
+
method: "POST",
|
|
628
|
+
headers: _headers,
|
|
629
|
+
contentType: "application/json",
|
|
630
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
631
|
+
requestType: "json",
|
|
632
|
+
body: request,
|
|
633
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
634
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
635
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
636
|
+
});
|
|
637
|
+
if (_response.ok) {
|
|
638
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
639
|
+
}
|
|
640
|
+
if (_response.error.reason === "status-code") {
|
|
641
|
+
switch (_response.error.statusCode) {
|
|
642
|
+
case 422:
|
|
643
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
644
|
+
default:
|
|
645
|
+
throw new errors.ChrtError({
|
|
646
|
+
statusCode: _response.error.statusCode,
|
|
647
|
+
body: _response.error.body,
|
|
648
|
+
rawResponse: _response.rawResponse,
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
switch (_response.error.reason) {
|
|
653
|
+
case "non-json":
|
|
654
|
+
throw new errors.ChrtError({
|
|
655
|
+
statusCode: _response.error.statusCode,
|
|
656
|
+
body: _response.error.rawBody,
|
|
657
|
+
rawResponse: _response.rawResponse,
|
|
658
|
+
});
|
|
659
|
+
case "timeout":
|
|
660
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/invoices/preview/v1.");
|
|
661
|
+
case "unknown":
|
|
662
|
+
throw new errors.ChrtError({
|
|
663
|
+
message: _response.error.errorMessage,
|
|
664
|
+
rawResponse: _response.rawResponse,
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Selects matching uninvoiced ordinary charges, reports omitted items, and previews current taxes and billing dates without saving. Period dates do not filter charges. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceCreateFromOrdersReq) -> (InvoicePreviewFromOrdersRes)
|
|
671
|
+
*
|
|
672
|
+
* @param {Chrt.InvoiceCreateFromOrdersReq} request
|
|
673
|
+
* @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
|
|
674
|
+
*
|
|
675
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
676
|
+
*
|
|
677
|
+
* @example
|
|
678
|
+
* await client.billingNew.invoices.previewFromOrdersV1({
|
|
679
|
+
* currency_code: "USD",
|
|
680
|
+
* invoice_type: "accounts_receivable",
|
|
681
|
+
* order_ids: ["order_ids"],
|
|
682
|
+
* schema_version: 1
|
|
683
|
+
* })
|
|
684
|
+
*/
|
|
685
|
+
previewFromOrdersV1(request, requestOptions) {
|
|
686
|
+
return core.HttpResponsePromise.fromPromise(this.__previewFromOrdersV1(request, requestOptions));
|
|
687
|
+
}
|
|
688
|
+
__previewFromOrdersV1(request, requestOptions) {
|
|
689
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
690
|
+
var _a, _b, _c, _d;
|
|
691
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
692
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
693
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "billing_new/invoices/preview_from_orders/v1"),
|
|
694
|
+
method: "POST",
|
|
695
|
+
headers: _headers,
|
|
696
|
+
contentType: "application/json",
|
|
697
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
698
|
+
requestType: "json",
|
|
699
|
+
body: request,
|
|
700
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
701
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
702
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
703
|
+
});
|
|
704
|
+
if (_response.ok) {
|
|
705
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
706
|
+
}
|
|
707
|
+
if (_response.error.reason === "status-code") {
|
|
708
|
+
switch (_response.error.statusCode) {
|
|
709
|
+
case 422:
|
|
710
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
711
|
+
default:
|
|
712
|
+
throw new errors.ChrtError({
|
|
713
|
+
statusCode: _response.error.statusCode,
|
|
714
|
+
body: _response.error.body,
|
|
715
|
+
rawResponse: _response.rawResponse,
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
switch (_response.error.reason) {
|
|
720
|
+
case "non-json":
|
|
721
|
+
throw new errors.ChrtError({
|
|
722
|
+
statusCode: _response.error.statusCode,
|
|
723
|
+
body: _response.error.rawBody,
|
|
724
|
+
rawResponse: _response.rawResponse,
|
|
725
|
+
});
|
|
726
|
+
case "timeout":
|
|
727
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/invoices/preview_from_orders/v1.");
|
|
728
|
+
case "unknown":
|
|
729
|
+
throw new errors.ChrtError({
|
|
730
|
+
message: _response.error.errorMessage,
|
|
731
|
+
rawResponse: _response.rawResponse,
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
}
|
|
656
736
|
/**
|
|
657
737
|
* Updates the name or description of a draft invoice owned by the caller's organization. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceClientUpdate1) -> (bool)
|
|
658
738
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { type InvoiceClientCreate1 } from "./InvoiceClientCreate1.mjs";
|
|
2
1
|
export { type InvoiceLineItemsAddReq } from "./InvoiceLineItemsAddReq.mjs";
|
|
3
2
|
export { type InvoiceLineItemsRemoveReq } from "./InvoiceLineItemsRemoveReq.mjs";
|
|
4
3
|
export { type InvoicesListV1Request } from "./InvoicesListV1Request.mjs";
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import * as environments from "../../../../../../environments.mjs";
|
|
5
5
|
import * as core from "../../../../../../core/index.mjs";
|
|
6
6
|
import * as Chrt from "../../../../../index.mjs";
|
|
7
|
-
import { RateSheetLineItems } from "../resources/rateSheetLineItems/client/Client.mjs";
|
|
8
7
|
export declare namespace Orders {
|
|
9
8
|
interface Options {
|
|
10
9
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
@@ -30,9 +29,7 @@ export declare namespace Orders {
|
|
|
30
29
|
}
|
|
31
30
|
export declare class Orders {
|
|
32
31
|
protected readonly _options: Orders.Options;
|
|
33
|
-
protected _rateSheetLineItems: RateSheetLineItems | undefined;
|
|
34
32
|
constructor(_options?: Orders.Options);
|
|
35
|
-
get rateSheetLineItems(): RateSheetLineItems;
|
|
36
33
|
/**
|
|
37
34
|
* Lists completed, unbilled AWBs with delivery account allocations. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (OrderAwbBillingListRes)
|
|
38
35
|
*
|
|
@@ -80,6 +77,8 @@ export declare class Orders {
|
|
|
80
77
|
* filter_in_progress_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
81
78
|
* filter_completed_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
82
79
|
* filter_completed_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
80
|
+
* filter_last_delivery_task_completed_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
81
|
+
* filter_last_delivery_task_completed_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
83
82
|
* filter_cancelled_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
84
83
|
* filter_cancelled_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
85
84
|
* filter_exception_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
@@ -88,5 +87,33 @@ export declare class Orders {
|
|
|
88
87
|
*/
|
|
89
88
|
listExpandedForCoordinatorOperatorsV1(request?: Chrt.billingNew.OrderBillingExpandedListReq, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Chrt.OrderBillingExpandedListRes>;
|
|
90
89
|
private __listExpandedForCoordinatorOperatorsV1;
|
|
90
|
+
/**
|
|
91
|
+
* Regenerates uninvoiced rate-sheet charges per Order, reporting skips and failures. Detach existing charges before regeneration. | authz: allowed_org_types=[provider], min_org_role=operator | authz_personas=[coordinator_org_operators] | (OrderRateSheetLineItemsGenerateManyReq) -> (OrderRateSheetLineItemsGenerateManyRes)
|
|
92
|
+
*
|
|
93
|
+
* @param {Chrt.billingNew.OrderRateSheetLineItemsGenerateManyReq} request
|
|
94
|
+
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
95
|
+
*
|
|
96
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* await client.billingNew.orders.generateRateSheetLineItemsManyV1({
|
|
100
|
+
* order_ids: ["order_ids"]
|
|
101
|
+
* })
|
|
102
|
+
*/
|
|
103
|
+
generateRateSheetLineItemsManyV1(request: Chrt.billingNew.OrderRateSheetLineItemsGenerateManyReq, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Chrt.OrderRateSheetLineItemsGenerateManyRes>;
|
|
104
|
+
private __generateRateSheetLineItemsManyV1;
|
|
105
|
+
/**
|
|
106
|
+
* Estimates current taxes for uninvoiced ordinary charges grouped by counterparty, direction, and currency. Returns an empty list when no charges qualify. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (list[InvoicePreviewRes])
|
|
107
|
+
*
|
|
108
|
+
* @param {string} orderId
|
|
109
|
+
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
110
|
+
*
|
|
111
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.billingNew.orders.taxEstimatesV1("order_id")
|
|
115
|
+
*/
|
|
116
|
+
taxEstimatesV1(orderId: string, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Chrt.InvoicePreviewRes[]>;
|
|
117
|
+
private __taxEstimatesV1;
|
|
91
118
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
92
119
|
}
|
|
@@ -26,15 +26,10 @@ import * as core from "../../../../../../core/index.mjs";
|
|
|
26
26
|
import * as Chrt from "../../../../../index.mjs";
|
|
27
27
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
28
28
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
29
|
-
import { RateSheetLineItems } from "../resources/rateSheetLineItems/client/Client.mjs";
|
|
30
29
|
export class Orders {
|
|
31
30
|
constructor(_options = {}) {
|
|
32
31
|
this._options = _options;
|
|
33
32
|
}
|
|
34
|
-
get rateSheetLineItems() {
|
|
35
|
-
var _a;
|
|
36
|
-
return ((_a = this._rateSheetLineItems) !== null && _a !== void 0 ? _a : (this._rateSheetLineItems = new RateSheetLineItems(this._options)));
|
|
37
|
-
}
|
|
38
33
|
/**
|
|
39
34
|
* Lists completed, unbilled AWBs with delivery account allocations. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (OrderAwbBillingListRes)
|
|
40
35
|
*
|
|
@@ -136,6 +131,8 @@ export class Orders {
|
|
|
136
131
|
* filter_in_progress_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
137
132
|
* filter_completed_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
138
133
|
* filter_completed_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
134
|
+
* filter_last_delivery_task_completed_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
135
|
+
* filter_last_delivery_task_completed_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
139
136
|
* filter_cancelled_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
140
137
|
* filter_cancelled_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
141
138
|
* filter_exception_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
@@ -148,7 +145,7 @@ export class Orders {
|
|
|
148
145
|
__listExpandedForCoordinatorOperatorsV1() {
|
|
149
146
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
150
147
|
var _a, _b, _c, _d, _e, _f;
|
|
151
|
-
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, search, filter_status: filterStatus, filter_awb_number: filterAwbNumber, filter_shipper_org_id: filterShipperOrgId, filter_off_chrt_shipper_org_data_id: filterOffChrtShipperOrgDataId, filter_coordinator_shipper_account_ids: filterCoordinatorShipperAccountIds, filter_executor_org_id: filterExecutorOrgId, filter_off_chrt_executor_org_data_id: filterOffChrtExecutorOrgDataId, filter_coordinator_labels: filterCoordinatorLabels, filter_draft_started_at_timestamp_gte: filterDraftStartedAtTimestampGte, filter_draft_started_at_timestamp_lte: filterDraftStartedAtTimestampLte, filter_staged_at_timestamp_gte: filterStagedAtTimestampGte, filter_staged_at_timestamp_lte: filterStagedAtTimestampLte, filter_in_progress_at_timestamp_gte: filterInProgressAtTimestampGte, filter_in_progress_at_timestamp_lte: filterInProgressAtTimestampLte, filter_completed_at_timestamp_gte: filterCompletedAtTimestampGte, filter_completed_at_timestamp_lte: filterCompletedAtTimestampLte, filter_cancelled_at_timestamp_gte: filterCancelledAtTimestampGte, filter_cancelled_at_timestamp_lte: filterCancelledAtTimestampLte, filter_exception_at_timestamp_gte: filterExceptionAtTimestampGte, filter_exception_at_timestamp_lte: filterExceptionAtTimestampLte } = request, _body = __rest(request, ["sort_by", "sort_order", "page", "page_size", "search", "filter_status", "filter_awb_number", "filter_shipper_org_id", "filter_off_chrt_shipper_org_data_id", "filter_coordinator_shipper_account_ids", "filter_executor_org_id", "filter_off_chrt_executor_org_data_id", "filter_coordinator_labels", "filter_draft_started_at_timestamp_gte", "filter_draft_started_at_timestamp_lte", "filter_staged_at_timestamp_gte", "filter_staged_at_timestamp_lte", "filter_in_progress_at_timestamp_gte", "filter_in_progress_at_timestamp_lte", "filter_completed_at_timestamp_gte", "filter_completed_at_timestamp_lte", "filter_cancelled_at_timestamp_gte", "filter_cancelled_at_timestamp_lte", "filter_exception_at_timestamp_gte", "filter_exception_at_timestamp_lte"]);
|
|
148
|
+
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, search, filter_status: filterStatus, filter_awb_number: filterAwbNumber, filter_shipper_org_id: filterShipperOrgId, filter_off_chrt_shipper_org_data_id: filterOffChrtShipperOrgDataId, filter_coordinator_shipper_account_ids: filterCoordinatorShipperAccountIds, filter_executor_org_id: filterExecutorOrgId, filter_off_chrt_executor_org_data_id: filterOffChrtExecutorOrgDataId, filter_coordinator_labels: filterCoordinatorLabels, filter_draft_started_at_timestamp_gte: filterDraftStartedAtTimestampGte, filter_draft_started_at_timestamp_lte: filterDraftStartedAtTimestampLte, filter_staged_at_timestamp_gte: filterStagedAtTimestampGte, filter_staged_at_timestamp_lte: filterStagedAtTimestampLte, filter_in_progress_at_timestamp_gte: filterInProgressAtTimestampGte, filter_in_progress_at_timestamp_lte: filterInProgressAtTimestampLte, filter_completed_at_timestamp_gte: filterCompletedAtTimestampGte, filter_completed_at_timestamp_lte: filterCompletedAtTimestampLte, filter_last_delivery_task_completed_at_timestamp_gte: filterLastDeliveryTaskCompletedAtTimestampGte, filter_last_delivery_task_completed_at_timestamp_lte: filterLastDeliveryTaskCompletedAtTimestampLte, filter_cancelled_at_timestamp_gte: filterCancelledAtTimestampGte, filter_cancelled_at_timestamp_lte: filterCancelledAtTimestampLte, filter_exception_at_timestamp_gte: filterExceptionAtTimestampGte, filter_exception_at_timestamp_lte: filterExceptionAtTimestampLte } = request, _body = __rest(request, ["sort_by", "sort_order", "page", "page_size", "search", "filter_status", "filter_awb_number", "filter_shipper_org_id", "filter_off_chrt_shipper_org_data_id", "filter_coordinator_shipper_account_ids", "filter_executor_org_id", "filter_off_chrt_executor_org_data_id", "filter_coordinator_labels", "filter_draft_started_at_timestamp_gte", "filter_draft_started_at_timestamp_lte", "filter_staged_at_timestamp_gte", "filter_staged_at_timestamp_lte", "filter_in_progress_at_timestamp_gte", "filter_in_progress_at_timestamp_lte", "filter_completed_at_timestamp_gte", "filter_completed_at_timestamp_lte", "filter_last_delivery_task_completed_at_timestamp_gte", "filter_last_delivery_task_completed_at_timestamp_lte", "filter_cancelled_at_timestamp_gte", "filter_cancelled_at_timestamp_lte", "filter_exception_at_timestamp_gte", "filter_exception_at_timestamp_lte"]);
|
|
152
149
|
const _queryParams = {};
|
|
153
150
|
if (sortBy !== undefined) {
|
|
154
151
|
_queryParams["sort_by"] = sortBy;
|
|
@@ -228,6 +225,14 @@ export class Orders {
|
|
|
228
225
|
if (filterCompletedAtTimestampLte !== undefined) {
|
|
229
226
|
_queryParams["filter_completed_at_timestamp_lte"] = filterCompletedAtTimestampLte;
|
|
230
227
|
}
|
|
228
|
+
if (filterLastDeliveryTaskCompletedAtTimestampGte !== undefined) {
|
|
229
|
+
_queryParams["filter_last_delivery_task_completed_at_timestamp_gte"] =
|
|
230
|
+
filterLastDeliveryTaskCompletedAtTimestampGte;
|
|
231
|
+
}
|
|
232
|
+
if (filterLastDeliveryTaskCompletedAtTimestampLte !== undefined) {
|
|
233
|
+
_queryParams["filter_last_delivery_task_completed_at_timestamp_lte"] =
|
|
234
|
+
filterLastDeliveryTaskCompletedAtTimestampLte;
|
|
235
|
+
}
|
|
231
236
|
if (filterCancelledAtTimestampGte !== undefined) {
|
|
232
237
|
_queryParams["filter_cancelled_at_timestamp_gte"] = filterCancelledAtTimestampGte;
|
|
233
238
|
}
|
|
@@ -285,6 +290,132 @@ export class Orders {
|
|
|
285
290
|
}
|
|
286
291
|
});
|
|
287
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* Regenerates uninvoiced rate-sheet charges per Order, reporting skips and failures. Detach existing charges before regeneration. | authz: allowed_org_types=[provider], min_org_role=operator | authz_personas=[coordinator_org_operators] | (OrderRateSheetLineItemsGenerateManyReq) -> (OrderRateSheetLineItemsGenerateManyRes)
|
|
295
|
+
*
|
|
296
|
+
* @param {Chrt.billingNew.OrderRateSheetLineItemsGenerateManyReq} request
|
|
297
|
+
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
298
|
+
*
|
|
299
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* await client.billingNew.orders.generateRateSheetLineItemsManyV1({
|
|
303
|
+
* order_ids: ["order_ids"]
|
|
304
|
+
* })
|
|
305
|
+
*/
|
|
306
|
+
generateRateSheetLineItemsManyV1(request, requestOptions) {
|
|
307
|
+
return core.HttpResponsePromise.fromPromise(this.__generateRateSheetLineItemsManyV1(request, requestOptions));
|
|
308
|
+
}
|
|
309
|
+
__generateRateSheetLineItemsManyV1(request, requestOptions) {
|
|
310
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
311
|
+
var _a, _b, _c, _d;
|
|
312
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
313
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
314
|
+
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/orders/rate_sheet_line_items/generate_many/v1"),
|
|
315
|
+
method: "POST",
|
|
316
|
+
headers: _headers,
|
|
317
|
+
contentType: "application/json",
|
|
318
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
319
|
+
requestType: "json",
|
|
320
|
+
body: request,
|
|
321
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
322
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
323
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
324
|
+
});
|
|
325
|
+
if (_response.ok) {
|
|
326
|
+
return {
|
|
327
|
+
data: _response.body,
|
|
328
|
+
rawResponse: _response.rawResponse,
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
if (_response.error.reason === "status-code") {
|
|
332
|
+
switch (_response.error.statusCode) {
|
|
333
|
+
case 422:
|
|
334
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
335
|
+
default:
|
|
336
|
+
throw new errors.ChrtError({
|
|
337
|
+
statusCode: _response.error.statusCode,
|
|
338
|
+
body: _response.error.body,
|
|
339
|
+
rawResponse: _response.rawResponse,
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
switch (_response.error.reason) {
|
|
344
|
+
case "non-json":
|
|
345
|
+
throw new errors.ChrtError({
|
|
346
|
+
statusCode: _response.error.statusCode,
|
|
347
|
+
body: _response.error.rawBody,
|
|
348
|
+
rawResponse: _response.rawResponse,
|
|
349
|
+
});
|
|
350
|
+
case "timeout":
|
|
351
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/orders/rate_sheet_line_items/generate_many/v1.");
|
|
352
|
+
case "unknown":
|
|
353
|
+
throw new errors.ChrtError({
|
|
354
|
+
message: _response.error.errorMessage,
|
|
355
|
+
rawResponse: _response.rawResponse,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Estimates current taxes for uninvoiced ordinary charges grouped by counterparty, direction, and currency. Returns an empty list when no charges qualify. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (list[InvoicePreviewRes])
|
|
362
|
+
*
|
|
363
|
+
* @param {string} orderId
|
|
364
|
+
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
365
|
+
*
|
|
366
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* await client.billingNew.orders.taxEstimatesV1("order_id")
|
|
370
|
+
*/
|
|
371
|
+
taxEstimatesV1(orderId, requestOptions) {
|
|
372
|
+
return core.HttpResponsePromise.fromPromise(this.__taxEstimatesV1(orderId, requestOptions));
|
|
373
|
+
}
|
|
374
|
+
__taxEstimatesV1(orderId, requestOptions) {
|
|
375
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
376
|
+
var _a, _b, _c, _d;
|
|
377
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
378
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
379
|
+
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/orders/tax_estimates/v1/${encodeURIComponent(orderId)}`),
|
|
380
|
+
method: "GET",
|
|
381
|
+
headers: _headers,
|
|
382
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
383
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
384
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
385
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
386
|
+
});
|
|
387
|
+
if (_response.ok) {
|
|
388
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
389
|
+
}
|
|
390
|
+
if (_response.error.reason === "status-code") {
|
|
391
|
+
switch (_response.error.statusCode) {
|
|
392
|
+
case 422:
|
|
393
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
394
|
+
default:
|
|
395
|
+
throw new errors.ChrtError({
|
|
396
|
+
statusCode: _response.error.statusCode,
|
|
397
|
+
body: _response.error.body,
|
|
398
|
+
rawResponse: _response.rawResponse,
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
switch (_response.error.reason) {
|
|
403
|
+
case "non-json":
|
|
404
|
+
throw new errors.ChrtError({
|
|
405
|
+
statusCode: _response.error.statusCode,
|
|
406
|
+
body: _response.error.rawBody,
|
|
407
|
+
rawResponse: _response.rawResponse,
|
|
408
|
+
});
|
|
409
|
+
case "timeout":
|
|
410
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing_new/orders/tax_estimates/v1/{order_id}.");
|
|
411
|
+
case "unknown":
|
|
412
|
+
throw new errors.ChrtError({
|
|
413
|
+
message: _response.error.errorMessage,
|
|
414
|
+
rawResponse: _response.rawResponse,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
}
|
|
288
419
|
_getAuthorizationHeader() {
|
|
289
420
|
return __awaiter(this, void 0, void 0, function* () {
|
|
290
421
|
const bearer = yield core.Supplier.get(this._options.token);
|