@chrt-inc/typescript-sdk 1.976.0 → 1.983.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/Client.d.ts +21 -2
  3. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/Client.js +75 -2
  4. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemClientUpdate1.d.ts +2 -0
  5. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsCurrencyConversionUpdateManyReq.d.ts +1 -1
  6. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/ReceivablesAcrossOrdersCurrencyConversionUpdateReq.d.ts +18 -0
  7. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/index.js +1 -0
  10. package/dist/cjs/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/client/Client.d.ts +6 -6
  11. package/dist/cjs/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/client/Client.js +27 -13
  12. package/dist/cjs/api/resources/billingNew/resources/{invoices/resources/export/client/requests/ExportListV1Request.d.ts → invoiceLineItems/resources/export/client/requests/InvoiceLineItemExportListReq.d.ts} +4 -2
  13. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/requests/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/billingNew/resources/invoices/client/Client.d.ts +0 -3
  15. package/dist/cjs/api/resources/billingNew/resources/invoices/client/Client.js +0 -5
  16. package/dist/cjs/api/resources/billingNew/resources/invoices/index.d.ts +0 -1
  17. package/dist/cjs/api/resources/billingNew/resources/invoices/index.js +0 -1
  18. package/dist/cjs/api/types/InvoiceLineItemExportListItem.d.ts +46 -0
  19. package/dist/cjs/api/types/{InvoiceExportListRes.d.ts → InvoiceLineItemExportListRes.d.ts} +2 -2
  20. package/dist/cjs/api/types/InvoiceLineItemExportListRes.js +5 -0
  21. package/dist/cjs/api/types/ReceivablesAcrossOrdersCurrencyConversionOrderRes.d.ts +18 -0
  22. package/dist/cjs/api/types/ReceivablesAcrossOrdersCurrencyConversionOrderRes.js +14 -0
  23. package/dist/cjs/api/types/index.d.ts +3 -2
  24. package/dist/cjs/api/types/index.js +3 -2
  25. package/dist/cjs/version.d.ts +1 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/esm/Client.mjs +2 -2
  28. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/Client.d.mts +21 -2
  29. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/Client.mjs +75 -2
  30. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemClientUpdate1.d.mts +2 -0
  31. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsCurrencyConversionUpdateManyReq.d.mts +1 -1
  32. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/ReceivablesAcrossOrdersCurrencyConversionUpdateReq.d.mts +18 -0
  33. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.d.mts +1 -0
  34. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/index.d.mts +1 -0
  35. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/index.mjs +1 -0
  36. package/dist/esm/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/client/Client.d.mts +6 -6
  37. package/dist/esm/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/client/Client.mjs +27 -13
  38. package/dist/esm/api/resources/billingNew/resources/{invoices/resources/export/client/requests/ExportListV1Request.d.mts → invoiceLineItems/resources/export/client/requests/InvoiceLineItemExportListReq.d.mts} +4 -2
  39. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/resources/export/client/requests/index.d.mts +1 -0
  40. package/dist/esm/api/resources/billingNew/resources/invoices/client/Client.d.mts +0 -3
  41. package/dist/esm/api/resources/billingNew/resources/invoices/client/Client.mjs +0 -5
  42. package/dist/esm/api/resources/billingNew/resources/invoices/index.d.mts +0 -1
  43. package/dist/esm/api/resources/billingNew/resources/invoices/index.mjs +0 -1
  44. package/dist/esm/api/types/InvoiceLineItemExportListItem.d.mts +46 -0
  45. package/dist/esm/api/types/{InvoiceExportListRes.d.mts → InvoiceLineItemExportListRes.d.mts} +2 -2
  46. package/dist/esm/api/types/InvoiceLineItemExportListRes.mjs +4 -0
  47. package/dist/esm/api/types/ReceivablesAcrossOrdersCurrencyConversionOrderRes.d.mts +18 -0
  48. package/dist/esm/api/types/ReceivablesAcrossOrdersCurrencyConversionOrderRes.mjs +11 -0
  49. package/dist/esm/api/types/index.d.mts +3 -2
  50. package/dist/esm/api/types/index.mjs +3 -2
  51. package/dist/esm/version.d.mts +1 -1
  52. package/dist/esm/version.mjs +1 -1
  53. package/package.json +1 -1
  54. package/reference.md +74 -15
  55. package/dist/cjs/api/resources/billingNew/resources/invoices/resources/export/client/requests/index.d.ts +0 -1
  56. package/dist/cjs/api/types/InvoiceExportListItem.d.ts +0 -46
  57. package/dist/esm/api/resources/billingNew/resources/invoices/resources/export/client/requests/index.d.mts +0 -1
  58. package/dist/esm/api/types/InvoiceExportListItem.d.mts +0 -46
  59. /package/dist/cjs/api/resources/billingNew/resources/{invoices/resources/export/client/requests/ExportListV1Request.js → invoiceLineItems/client/requests/ReceivablesAcrossOrdersCurrencyConversionUpdateReq.js} +0 -0
  60. /package/dist/cjs/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/client/index.d.ts +0 -0
  61. /package/dist/cjs/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/client/index.js +0 -0
  62. /package/dist/cjs/api/{types/InvoiceExportListItem.js → resources/billingNew/resources/invoiceLineItems/resources/export/client/requests/InvoiceLineItemExportListReq.js} +0 -0
  63. /package/dist/cjs/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/client/requests/index.js +0 -0
  64. /package/dist/cjs/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/index.d.ts +0 -0
  65. /package/dist/cjs/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/index.js +0 -0
  66. /package/dist/cjs/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/index.d.ts +0 -0
  67. /package/dist/cjs/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/index.js +0 -0
  68. /package/dist/cjs/api/types/{InvoiceExportListRes.js → InvoiceLineItemExportListItem.js} +0 -0
  69. /package/dist/esm/api/resources/billingNew/resources/{invoices/resources/export/client/requests/ExportListV1Request.mjs → invoiceLineItems/client/requests/ReceivablesAcrossOrdersCurrencyConversionUpdateReq.mjs} +0 -0
  70. /package/dist/esm/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/client/index.d.mts +0 -0
  71. /package/dist/esm/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/client/index.mjs +0 -0
  72. /package/dist/esm/api/{types/InvoiceExportListItem.mjs → resources/billingNew/resources/invoiceLineItems/resources/export/client/requests/InvoiceLineItemExportListReq.mjs} +0 -0
  73. /package/dist/esm/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/client/requests/index.mjs +0 -0
  74. /package/dist/esm/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/index.d.mts +0 -0
  75. /package/dist/esm/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/export/index.mjs +0 -0
  76. /package/dist/esm/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/index.d.mts +0 -0
  77. /package/dist/esm/api/resources/billingNew/resources/{invoices → invoiceLineItems}/resources/index.mjs +0 -0
  78. /package/dist/esm/api/types/{InvoiceExportListRes.mjs → InvoiceLineItemExportListItem.mjs} +0 -0
@@ -4,6 +4,7 @@
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 { Export } from "../resources/export/client/Client.mjs";
7
8
  export declare namespace InvoiceLineItems {
8
9
  interface Options {
9
10
  environment?: core.Supplier<environments.ChrtEnvironment | string>;
@@ -29,7 +30,9 @@ export declare namespace InvoiceLineItems {
29
30
  }
30
31
  export declare class InvoiceLineItems {
31
32
  protected readonly _options: InvoiceLineItems.Options;
33
+ protected _export: Export | undefined;
32
34
  constructor(_options?: InvoiceLineItems.Options);
35
+ get export(): Export;
33
36
  /**
34
37
  * Creates account-split ad-hoc line items and attaches them to matching draft invoices. | authz: allowed_org_types=[provider], min_org_role=operator | (AdHocInvoiceLineItemsReq) -> (list[InvoiceLineItem1])
35
38
  *
@@ -285,7 +288,23 @@ export declare class InvoiceLineItems {
285
288
  recalculateTaxesV1(request: Chrt.billingNew.RecalculateOrderTaxInvoiceLineItemsReq, requestOptions?: InvoiceLineItems.RequestOptions): core.HttpResponsePromise<Chrt.InvoiceLineItem1[]>;
286
289
  private __recalculateTaxesV1;
287
290
  /**
288
- * Applies or reverts one currency conversion on line items from their original source values and moves attached items to the matching target-currency draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
291
+ * Applies one currency conversion independently to each selected order and reports each outcome. | authz: allowed_org_types=[provider], min_org_role=operator | (ReceivablesAcrossOrdersCurrencyConversionUpdateReq) -> (list[ReceivablesAcrossOrdersCurrencyConversionOrderRes])
292
+ *
293
+ * @param {Chrt.billingNew.ReceivablesAcrossOrdersCurrencyConversionUpdateReq} request
294
+ * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
295
+ *
296
+ * @throws {@link Chrt.UnprocessableEntityError}
297
+ *
298
+ * @example
299
+ * await client.billingNew.invoiceLineItems.updateCurrencyConversionForReceivablesAcrossOrdersV1({
300
+ * order_ids: ["order_ids"],
301
+ * target_currency_code: "USD"
302
+ * })
303
+ */
304
+ updateCurrencyConversionForReceivablesAcrossOrdersV1(request: Chrt.billingNew.ReceivablesAcrossOrdersCurrencyConversionUpdateReq, requestOptions?: InvoiceLineItems.RequestOptions): core.HttpResponsePromise<Chrt.ReceivablesAcrossOrdersCurrencyConversionOrderRes[]>;
305
+ private __updateCurrencyConversionForReceivablesAcrossOrdersV1;
306
+ /**
307
+ * Applies, reverts, or skips one currency conversion from original source values and moves attached items to the matching draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
289
308
  *
290
309
  * @param {Chrt.billingNew.InvoiceLineItemsCurrencyConversionUpdateManyReq} request
291
310
  * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
@@ -301,7 +320,7 @@ export declare class InvoiceLineItems {
301
320
  updateCurrencyConversionManyV1(request: Chrt.billingNew.InvoiceLineItemsCurrencyConversionUpdateManyReq, requestOptions?: InvoiceLineItems.RequestOptions): core.HttpResponsePromise<Chrt.InvoiceLineItem1[]>;
302
321
  private __updateCurrencyConversionManyV1;
303
322
  /**
304
- * Updates an owner-scoped line item's source fields, reapplies any existing currency conversion, and rebuilds its draft invoice when attached. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemClientUpdate1) -> (InvoiceLineItem1)
323
+ * Updates an owner-scoped line item's source fields, including its caller-owned shipper account when not rate-sheet-derived, and rebuilds its draft invoice when attached. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemClientUpdate1) -> (InvoiceLineItem1)
305
324
  *
306
325
  * @param {string} invoiceLineItemId
307
326
  * @param {Chrt.billingNew.InvoiceLineItemClientUpdate1} request
@@ -15,10 +15,15 @@ import * as core from "../../../../../../core/index.mjs";
15
15
  import * as Chrt from "../../../../../index.mjs";
16
16
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
17
17
  import * as errors from "../../../../../../errors/index.mjs";
18
+ import { Export } from "../resources/export/client/Client.mjs";
18
19
  export class InvoiceLineItems {
19
20
  constructor(_options = {}) {
20
21
  this._options = _options;
21
22
  }
23
+ get export() {
24
+ var _a;
25
+ return ((_a = this._export) !== null && _a !== void 0 ? _a : (this._export = new Export(this._options)));
26
+ }
22
27
  /**
23
28
  * Creates account-split ad-hoc line items and attaches them to matching draft invoices. | authz: allowed_org_types=[provider], min_org_role=operator | (AdHocInvoiceLineItemsReq) -> (list[InvoiceLineItem1])
24
29
  *
@@ -953,7 +958,75 @@ export class InvoiceLineItems {
953
958
  });
954
959
  }
955
960
  /**
956
- * Applies or reverts one currency conversion on line items from their original source values and moves attached items to the matching target-currency draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
961
+ * Applies one currency conversion independently to each selected order and reports each outcome. | authz: allowed_org_types=[provider], min_org_role=operator | (ReceivablesAcrossOrdersCurrencyConversionUpdateReq) -> (list[ReceivablesAcrossOrdersCurrencyConversionOrderRes])
962
+ *
963
+ * @param {Chrt.billingNew.ReceivablesAcrossOrdersCurrencyConversionUpdateReq} request
964
+ * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
965
+ *
966
+ * @throws {@link Chrt.UnprocessableEntityError}
967
+ *
968
+ * @example
969
+ * await client.billingNew.invoiceLineItems.updateCurrencyConversionForReceivablesAcrossOrdersV1({
970
+ * order_ids: ["order_ids"],
971
+ * target_currency_code: "USD"
972
+ * })
973
+ */
974
+ updateCurrencyConversionForReceivablesAcrossOrdersV1(request, requestOptions) {
975
+ return core.HttpResponsePromise.fromPromise(this.__updateCurrencyConversionForReceivablesAcrossOrdersV1(request, requestOptions));
976
+ }
977
+ __updateCurrencyConversionForReceivablesAcrossOrdersV1(request, requestOptions) {
978
+ return __awaiter(this, void 0, void 0, function* () {
979
+ var _a, _b, _c, _d;
980
+ 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);
981
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
982
+ 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/invoice_line_items/update_currency_conversion_for_receivables_across_orders/v1"),
983
+ method: "PATCH",
984
+ headers: _headers,
985
+ contentType: "application/json",
986
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
987
+ requestType: "json",
988
+ body: request,
989
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
990
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
991
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
992
+ });
993
+ if (_response.ok) {
994
+ return {
995
+ data: _response.body,
996
+ rawResponse: _response.rawResponse,
997
+ };
998
+ }
999
+ if (_response.error.reason === "status-code") {
1000
+ switch (_response.error.statusCode) {
1001
+ case 422:
1002
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
1003
+ default:
1004
+ throw new errors.ChrtError({
1005
+ statusCode: _response.error.statusCode,
1006
+ body: _response.error.body,
1007
+ rawResponse: _response.rawResponse,
1008
+ });
1009
+ }
1010
+ }
1011
+ switch (_response.error.reason) {
1012
+ case "non-json":
1013
+ throw new errors.ChrtError({
1014
+ statusCode: _response.error.statusCode,
1015
+ body: _response.error.rawBody,
1016
+ rawResponse: _response.rawResponse,
1017
+ });
1018
+ case "timeout":
1019
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /billing_new/invoice_line_items/update_currency_conversion_for_receivables_across_orders/v1.");
1020
+ case "unknown":
1021
+ throw new errors.ChrtError({
1022
+ message: _response.error.errorMessage,
1023
+ rawResponse: _response.rawResponse,
1024
+ });
1025
+ }
1026
+ });
1027
+ }
1028
+ /**
1029
+ * Applies, reverts, or skips one currency conversion from original source values and moves attached items to the matching draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
957
1030
  *
958
1031
  * @param {Chrt.billingNew.InvoiceLineItemsCurrencyConversionUpdateManyReq} request
959
1032
  * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
@@ -1018,7 +1091,7 @@ export class InvoiceLineItems {
1018
1091
  });
1019
1092
  }
1020
1093
  /**
1021
- * Updates an owner-scoped line item's source fields, reapplies any existing currency conversion, and rebuilds its draft invoice when attached. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemClientUpdate1) -> (InvoiceLineItem1)
1094
+ * Updates an owner-scoped line item's source fields, including its caller-owned shipper account when not rate-sheet-derived, and rebuilds its draft invoice when attached. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemClientUpdate1) -> (InvoiceLineItem1)
1022
1095
  *
1023
1096
  * @param {string} invoiceLineItemId
1024
1097
  * @param {Chrt.billingNew.InvoiceLineItemClientUpdate1} request
@@ -12,6 +12,8 @@ export interface InvoiceLineItemClientUpdate1 {
12
12
  export_ref__sage__item_id__set_to_None?: boolean;
13
13
  invoice_type?: Chrt.InvoiceTypeEnum1 | null;
14
14
  quantity?: number | null;
15
+ shipper_account_id?: string | null;
16
+ shipper_account_id__set_to_None?: boolean;
15
17
  source_currency_code?: Chrt.BillingCurrencyCodeEnum1 | null;
16
18
  source_unit_price?: number | null;
17
19
  unit?: Chrt.InvoiceLineItemUnitEnum1 | null;
@@ -10,7 +10,7 @@ import * as Chrt from "../../../../../../index.mjs";
10
10
  * }
11
11
  */
12
12
  export interface InvoiceLineItemsCurrencyConversionUpdateManyReq {
13
- /** Units of target_currency_code per one unit of the line items' original source currency -- their currency_conversion.source_currency_code if already converted, otherwise their current currency_code. Always relative to that original source, never to an intermediate converted currency, so conversions never compound. Omitted when target_currency_code is the original source currency, which reverts the conversion. */
13
+ /** Units of target_currency_code per one unit of the line items' original source currency -- their currency_conversion.source_currency_code if already converted, otherwise their current currency_code. Always relative to that original source, never to an intermediate converted currency, so conversions never compound. Omitted when target_currency_code is the original source currency, which reverts converted items and leaves unconverted items unchanged. */
14
14
  conversion_rate?: number | null;
15
15
  description?: string | null;
16
16
  invoice_line_item_ids: string[];
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../index.mjs";
5
+ /**
6
+ * @example
7
+ * {
8
+ * order_ids: ["order_ids"],
9
+ * target_currency_code: "USD"
10
+ * }
11
+ */
12
+ export interface ReceivablesAcrossOrdersCurrencyConversionUpdateReq {
13
+ /** Units of target_currency_code per one unit of the order's sole original source currency different from the target. Target-currency items are reverted or left unchanged without applying this rate. */
14
+ conversion_rate?: number | null;
15
+ description?: string | null;
16
+ order_ids: string[];
17
+ target_currency_code: Chrt.BillingCurrencyCodeEnum1;
18
+ }
@@ -5,5 +5,6 @@ export { type CreateInvoiceLineItemsFromLineItemsReq } from "./CreateInvoiceLine
5
5
  export { type InvoiceLineItemsDeleteManyReq } from "./InvoiceLineItemsDeleteManyReq.mjs";
6
6
  export { type InvoiceLineItemsListV1Request } from "./InvoiceLineItemsListV1Request.mjs";
7
7
  export { type RecalculateOrderTaxInvoiceLineItemsReq } from "./RecalculateOrderTaxInvoiceLineItemsReq.mjs";
8
+ export { type ReceivablesAcrossOrdersCurrencyConversionUpdateReq } from "./ReceivablesAcrossOrdersCurrencyConversionUpdateReq.mjs";
8
9
  export { type InvoiceLineItemsCurrencyConversionUpdateManyReq } from "./InvoiceLineItemsCurrencyConversionUpdateManyReq.mjs";
9
10
  export { type InvoiceLineItemClientUpdate1 } from "./InvoiceLineItemClientUpdate1.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./resources/index.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./resources/index.mjs";
@@ -31,21 +31,21 @@ export declare class Export {
31
31
  protected readonly _options: Export.Options;
32
32
  constructor(_options?: Export.Options);
33
33
  /**
34
- * Lists up to 1,000 shipment-level export rows for one accounts-receivable invoice owned by the caller's organization, regardless of invoice status. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (InvoiceExportListRes)
34
+ * Lists up to 1,000 accounts-receivable and accounts-payable line items for the selected Orders, with shipment context. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemExportListReq) -> (InvoiceLineItemExportListRes)
35
35
  *
36
- * @param {string} invoiceId
37
- * @param {Chrt.billingNew.invoices.ExportListV1Request} request
36
+ * @param {Chrt.billingNew.invoiceLineItems.InvoiceLineItemExportListReq} request
38
37
  * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
39
38
  *
40
39
  * @throws {@link Chrt.UnprocessableEntityError}
41
40
  *
42
41
  * @example
43
- * await client.billingNew.invoices.export.listV1("invoice_id", {
42
+ * await client.billingNew.invoiceLineItems.export.listV1({
44
43
  * page: 1,
45
- * page_size: 1
44
+ * page_size: 1,
45
+ * order_ids: ["order_ids"]
46
46
  * })
47
47
  */
48
- listV1(invoiceId: string, request?: Chrt.billingNew.invoices.ExportListV1Request, requestOptions?: Export.RequestOptions): core.HttpResponsePromise<Chrt.InvoiceExportListRes>;
48
+ listV1(request: Chrt.billingNew.invoiceLineItems.InvoiceLineItemExportListReq, requestOptions?: Export.RequestOptions): core.HttpResponsePromise<Chrt.InvoiceLineItemExportListRes>;
49
49
  private __listV1;
50
50
  protected _getAuthorizationHeader(): Promise<string | undefined>;
51
51
  }
@@ -10,6 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  step((generator = generator.apply(thisArg, _arguments || [])).next());
11
11
  });
12
12
  };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
13
24
  import * as environments from "../../../../../../../../environments.mjs";
14
25
  import * as core from "../../../../../../../../core/index.mjs";
15
26
  import * as Chrt from "../../../../../../../index.mjs";
@@ -20,27 +31,27 @@ export class Export {
20
31
  this._options = _options;
21
32
  }
22
33
  /**
23
- * Lists up to 1,000 shipment-level export rows for one accounts-receivable invoice owned by the caller's organization, regardless of invoice status. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (InvoiceExportListRes)
34
+ * Lists up to 1,000 accounts-receivable and accounts-payable line items for the selected Orders, with shipment context. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemExportListReq) -> (InvoiceLineItemExportListRes)
24
35
  *
25
- * @param {string} invoiceId
26
- * @param {Chrt.billingNew.invoices.ExportListV1Request} request
36
+ * @param {Chrt.billingNew.invoiceLineItems.InvoiceLineItemExportListReq} request
27
37
  * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
28
38
  *
29
39
  * @throws {@link Chrt.UnprocessableEntityError}
30
40
  *
31
41
  * @example
32
- * await client.billingNew.invoices.export.listV1("invoice_id", {
42
+ * await client.billingNew.invoiceLineItems.export.listV1({
33
43
  * page: 1,
34
- * page_size: 1
44
+ * page_size: 1,
45
+ * order_ids: ["order_ids"]
35
46
  * })
36
47
  */
37
- listV1(invoiceId, request = {}, requestOptions) {
38
- return core.HttpResponsePromise.fromPromise(this.__listV1(invoiceId, request, requestOptions));
48
+ listV1(request, requestOptions) {
49
+ return core.HttpResponsePromise.fromPromise(this.__listV1(request, requestOptions));
39
50
  }
40
- __listV1(invoiceId_1) {
41
- return __awaiter(this, arguments, void 0, function* (invoiceId, request = {}, requestOptions) {
51
+ __listV1(request, requestOptions) {
52
+ return __awaiter(this, void 0, void 0, function* () {
42
53
  var _a, _b, _c, _d, _e, _f;
43
- const { page, page_size: pageSize } = request;
54
+ const { page, page_size: pageSize } = request, _body = __rest(request, ["page", "page_size"]);
44
55
  const _queryParams = {};
45
56
  if (page !== undefined) {
46
57
  _queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
@@ -50,10 +61,13 @@ export class Export {
50
61
  }
51
62
  let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
52
63
  const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
53
- url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, `billing_new/invoices/export/list/v1/${encodeURIComponent(invoiceId)}`),
54
- method: "GET",
64
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, "billing_new/invoice_line_items/export/list/v1"),
65
+ method: "POST",
55
66
  headers: _headers,
67
+ contentType: "application/json",
56
68
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
69
+ requestType: "json",
70
+ body: _body,
57
71
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
58
72
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
59
73
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -81,7 +95,7 @@ export class Export {
81
95
  rawResponse: _response.rawResponse,
82
96
  });
83
97
  case "timeout":
84
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing_new/invoices/export/list/v1/{invoice_id}.");
98
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing_new/invoice_line_items/export/list/v1.");
85
99
  case "unknown":
86
100
  throw new errors.ChrtError({
87
101
  message: _response.error.errorMessage,
@@ -5,10 +5,12 @@
5
5
  * @example
6
6
  * {
7
7
  * page: 1,
8
- * page_size: 1
8
+ * page_size: 1,
9
+ * order_ids: ["order_ids"]
9
10
  * }
10
11
  */
11
- export interface ExportListV1Request {
12
+ export interface InvoiceLineItemExportListReq {
12
13
  page?: number | null;
13
14
  page_size?: number | null;
15
+ order_ids: string[];
14
16
  }
@@ -0,0 +1 @@
1
+ export { type InvoiceLineItemExportListReq } from "./InvoiceLineItemExportListReq.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 { Export } from "../resources/export/client/Client.mjs";
8
7
  export declare namespace Invoices {
9
8
  interface Options {
10
9
  environment?: core.Supplier<environments.ChrtEnvironment | string>;
@@ -30,9 +29,7 @@ export declare namespace Invoices {
30
29
  }
31
30
  export declare class Invoices {
32
31
  protected readonly _options: Invoices.Options;
33
- protected _export: Export | undefined;
34
32
  constructor(_options?: Invoices.Options);
35
- get export(): Export;
36
33
  /**
37
34
  * Approves a draft invoice owned by the caller's organization. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (Invoice1)
38
35
  *
@@ -15,15 +15,10 @@ import * as core from "../../../../../../core/index.mjs";
15
15
  import * as Chrt from "../../../../../index.mjs";
16
16
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
17
17
  import * as errors from "../../../../../../errors/index.mjs";
18
- import { Export } from "../resources/export/client/Client.mjs";
19
18
  export class Invoices {
20
19
  constructor(_options = {}) {
21
20
  this._options = _options;
22
21
  }
23
- get export() {
24
- var _a;
25
- return ((_a = this._export) !== null && _a !== void 0 ? _a : (this._export = new Export(this._options)));
26
- }
27
22
  /**
28
23
  * Approves a draft invoice owned by the caller's organization. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (Invoice1)
29
24
  *
@@ -1,2 +1 @@
1
1
  export * from "./client/index.mjs";
2
- export * from "./resources/index.mjs";
@@ -1,2 +1 @@
1
1
  export * from "./client/index.mjs";
2
- export * from "./resources/index.mjs";
@@ -0,0 +1,46 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.mjs";
5
+ export interface InvoiceLineItemExportListItem {
6
+ account_name?: string | null;
7
+ airlines?: string[];
8
+ awb_numbers?: string[];
9
+ billing_period_end_at_timestamp?: string | null;
10
+ billing_period_start_at_timestamp?: string | null;
11
+ cargo_descriptions?: string[];
12
+ cargo_quantity?: number | null;
13
+ cargo_types?: string[];
14
+ counterparty_name?: string | null;
15
+ currency_code: Chrt.BillingCurrencyCodeEnum1;
16
+ delivery_address?: string | null;
17
+ delivery_location_name?: string | null;
18
+ delivery_status?: string | null;
19
+ delivery_stop_number?: number | null;
20
+ delivery_stops_on_order?: number | null;
21
+ destination_iata?: string | null;
22
+ flight_numbers?: string[];
23
+ invoice_approval_timestamp?: string | null;
24
+ invoice_line_item_id: string;
25
+ invoice_line_item_status: Chrt.InvoiceLineItemStatusEnum1;
26
+ invoice_number?: string | null;
27
+ invoice_status?: Chrt.InvoiceStatusEnum1 | null;
28
+ invoice_type: Chrt.InvoiceTypeEnum1;
29
+ /** IATA Air Waybill number: 3-digit airline prefix + 8-digit serial, e.g. '020-12345678'. */
30
+ line_item_awb_number?: string | null;
31
+ line_item_description: string;
32
+ line_item_quantity: number;
33
+ line_item_total_amount: number;
34
+ line_item_type: Chrt.InvoiceLineItemTypeEnum1;
35
+ line_item_unit?: Chrt.InvoiceLineItemUnitEnum1 | null;
36
+ line_item_unit_price: number;
37
+ mileage_estimated?: number | null;
38
+ off_chrt_reference_id?: string | null;
39
+ order_placer_comments?: string | null;
40
+ order_short_id?: string | null;
41
+ origin_iata?: string | null;
42
+ pod_at_timestamp?: string | null;
43
+ pod_name?: string | null;
44
+ tax_percentage?: number | null;
45
+ weight_pounds?: number | null;
46
+ }
@@ -2,7 +2,7 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Chrt from "../index.mjs";
5
- export interface InvoiceExportListRes {
6
- items: Chrt.InvoiceExportListItem[];
5
+ export interface InvoiceLineItemExportListRes {
6
+ items: Chrt.InvoiceLineItemExportListItem[];
7
7
  total_count: number;
8
8
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.mjs";
5
+ export interface ReceivablesAcrossOrdersCurrencyConversionOrderRes {
6
+ converted_invoice_line_items?: Chrt.InvoiceLineItem1[];
7
+ failure_reason?: string | null;
8
+ order_id: string;
9
+ status: ReceivablesAcrossOrdersCurrencyConversionOrderRes.Status;
10
+ }
11
+ export declare namespace ReceivablesAcrossOrdersCurrencyConversionOrderRes {
12
+ type Status = "succeeded" | "failed" | "no_receivables";
13
+ const Status: {
14
+ readonly Succeeded: "succeeded";
15
+ readonly Failed: "failed";
16
+ readonly NoReceivables: "no_receivables";
17
+ };
18
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export var ReceivablesAcrossOrdersCurrencyConversionOrderRes;
5
+ (function (ReceivablesAcrossOrdersCurrencyConversionOrderRes) {
6
+ ReceivablesAcrossOrdersCurrencyConversionOrderRes.Status = {
7
+ Succeeded: "succeeded",
8
+ Failed: "failed",
9
+ NoReceivables: "no_receivables",
10
+ };
11
+ })(ReceivablesAcrossOrdersCurrencyConversionOrderRes || (ReceivablesAcrossOrdersCurrencyConversionOrderRes = {}));
@@ -256,8 +256,6 @@ export * from "./InternalDelegationJwtRes.mjs";
256
256
  export * from "./Invoice1.mjs";
257
257
  export * from "./InvoiceExpandedListItem.mjs";
258
258
  export * from "./InvoiceExpandedRes.mjs";
259
- export * from "./InvoiceExportListItem.mjs";
260
- export * from "./InvoiceExportListRes.mjs";
261
259
  export * from "./InvoiceLineItem1.mjs";
262
260
  export * from "./InvoiceLineItemAmountTransformation1.mjs";
263
261
  export * from "./InvoiceLineItemAmountTransformationTypeEnum1.mjs";
@@ -265,6 +263,8 @@ export * from "./InvoiceLineItemClientCreate1.mjs";
265
263
  export * from "./InvoiceLineItemCurrencyConversion1.mjs";
266
264
  export * from "./InvoiceLineItemExpandedListItem.mjs";
267
265
  export * from "./InvoiceLineItemExpandedRes.mjs";
266
+ export * from "./InvoiceLineItemExportListItem.mjs";
267
+ export * from "./InvoiceLineItemExportListRes.mjs";
268
268
  export * from "./InvoiceLineItemListRes.mjs";
269
269
  export * from "./InvoiceLineItemServerCreate1.mjs";
270
270
  export * from "./InvoiceLineItemSortByEnum.mjs";
@@ -443,6 +443,7 @@ export * from "./Position2D.mjs";
443
443
  export * from "./Position3D.mjs";
444
444
  export * from "./ProFormaLineItem1.mjs";
445
445
  export * from "./ProFormaLineItemProvenanceEnum1.mjs";
446
+ export * from "./ReceivablesAcrossOrdersCurrencyConversionOrderRes.mjs";
446
447
  export * from "./ReelablesAsset1.mjs";
447
448
  export * from "./ReelablesAssetListRes.mjs";
448
449
  export * from "./ReelablesAssetPausedTimeWindow1.mjs";
@@ -256,8 +256,6 @@ export * from "./InternalDelegationJwtRes.mjs";
256
256
  export * from "./Invoice1.mjs";
257
257
  export * from "./InvoiceExpandedListItem.mjs";
258
258
  export * from "./InvoiceExpandedRes.mjs";
259
- export * from "./InvoiceExportListItem.mjs";
260
- export * from "./InvoiceExportListRes.mjs";
261
259
  export * from "./InvoiceLineItem1.mjs";
262
260
  export * from "./InvoiceLineItemAmountTransformation1.mjs";
263
261
  export * from "./InvoiceLineItemAmountTransformationTypeEnum1.mjs";
@@ -265,6 +263,8 @@ export * from "./InvoiceLineItemClientCreate1.mjs";
265
263
  export * from "./InvoiceLineItemCurrencyConversion1.mjs";
266
264
  export * from "./InvoiceLineItemExpandedListItem.mjs";
267
265
  export * from "./InvoiceLineItemExpandedRes.mjs";
266
+ export * from "./InvoiceLineItemExportListItem.mjs";
267
+ export * from "./InvoiceLineItemExportListRes.mjs";
268
268
  export * from "./InvoiceLineItemListRes.mjs";
269
269
  export * from "./InvoiceLineItemServerCreate1.mjs";
270
270
  export * from "./InvoiceLineItemSortByEnum.mjs";
@@ -443,6 +443,7 @@ export * from "./Position2D.mjs";
443
443
  export * from "./Position3D.mjs";
444
444
  export * from "./ProFormaLineItem1.mjs";
445
445
  export * from "./ProFormaLineItemProvenanceEnum1.mjs";
446
+ export * from "./ReceivablesAcrossOrdersCurrencyConversionOrderRes.mjs";
446
447
  export * from "./ReelablesAsset1.mjs";
447
448
  export * from "./ReelablesAssetListRes.mjs";
448
449
  export * from "./ReelablesAssetPausedTimeWindow1.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.976.0";
1
+ export declare const SDK_VERSION = "1.983.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.976.0";
1
+ export const SDK_VERSION = "1.983.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrt-inc/typescript-sdk",
3
- "version": "1.976.0",
3
+ "version": "1.983.0",
4
4
  "private": false,
5
5
  "repository": "github:chrt-inc/typescript-sdk",
6
6
  "type": "commonjs",