@chrt-inc/typescript-sdk 1.344.1 → 2.0.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 (40) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/billing/resources/statements/client/Client.d.ts +7 -9
  3. package/dist/cjs/api/resources/billing/resources/statements/client/Client.js +10 -18
  4. package/dist/cjs/api/resources/billing/resources/statements/client/requests/StatementsListV1Request.d.ts +1 -7
  5. package/dist/cjs/api/resources/tracking/resources/sharingSettings/client/Client.d.ts +13 -13
  6. package/dist/cjs/api/resources/tracking/resources/sharingSettings/client/Client.js +48 -48
  7. package/dist/cjs/api/types/LineItemGroupStatusEnum1.d.ts +1 -2
  8. package/dist/cjs/api/types/LineItemGroupStatusEnum1.js +0 -1
  9. package/dist/cjs/api/types/Statement1.d.ts +0 -3
  10. package/dist/cjs/api/types/StatementSortByEnum.d.ts +1 -2
  11. package/dist/cjs/api/types/StatementSortByEnum.js +0 -1
  12. package/dist/cjs/api/types/StatementStatusEnum1.d.ts +1 -2
  13. package/dist/cjs/api/types/StatementStatusEnum1.js +0 -1
  14. package/dist/cjs/api/types/index.d.ts +0 -1
  15. package/dist/cjs/api/types/index.js +0 -1
  16. package/dist/cjs/version.d.ts +1 -1
  17. package/dist/cjs/version.js +1 -1
  18. package/dist/esm/Client.mjs +2 -2
  19. package/dist/esm/api/resources/billing/resources/statements/client/Client.d.mts +7 -9
  20. package/dist/esm/api/resources/billing/resources/statements/client/Client.mjs +10 -18
  21. package/dist/esm/api/resources/billing/resources/statements/client/requests/StatementsListV1Request.d.mts +1 -7
  22. package/dist/esm/api/resources/tracking/resources/sharingSettings/client/Client.d.mts +13 -13
  23. package/dist/esm/api/resources/tracking/resources/sharingSettings/client/Client.mjs +48 -48
  24. package/dist/esm/api/types/LineItemGroupStatusEnum1.d.mts +1 -2
  25. package/dist/esm/api/types/LineItemGroupStatusEnum1.mjs +0 -1
  26. package/dist/esm/api/types/Statement1.d.mts +0 -3
  27. package/dist/esm/api/types/StatementSortByEnum.d.mts +1 -2
  28. package/dist/esm/api/types/StatementSortByEnum.mjs +0 -1
  29. package/dist/esm/api/types/StatementStatusEnum1.d.mts +1 -2
  30. package/dist/esm/api/types/StatementStatusEnum1.mjs +0 -1
  31. package/dist/esm/api/types/index.d.mts +0 -1
  32. package/dist/esm/api/types/index.mjs +0 -1
  33. package/dist/esm/version.d.mts +1 -1
  34. package/dist/esm/version.mjs +1 -1
  35. package/package.json +1 -1
  36. package/reference.md +27 -29
  37. package/dist/cjs/api/types/SyncInvoiceRes.d.ts +0 -10
  38. package/dist/cjs/api/types/SyncInvoiceRes.js +0 -5
  39. package/dist/esm/api/types/SyncInvoiceRes.d.mts +0 -10
  40. package/dist/esm/api/types/SyncInvoiceRes.mjs +0 -4
@@ -67,8 +67,8 @@ class ChrtClient {
67
67
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
68
68
  "X-Fern-Language": "JavaScript",
69
69
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
70
- "X-Fern-SDK-Version": "1.344.1",
71
- "User-Agent": "@chrt-inc/typescript-sdk/1.344.1",
70
+ "X-Fern-SDK-Version": "2.0.0",
71
+ "User-Agent": "@chrt-inc/typescript-sdk/2.0.0",
72
72
  "X-Fern-Runtime": core.RUNTIME.type,
73
73
  "X-Fern-Runtime-Version": core.RUNTIME.version,
74
74
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -94,9 +94,7 @@ export declare class Statements {
94
94
  * filter_opened_at_timestamp_gte: "2024-01-15T09:30:00Z",
95
95
  * filter_opened_at_timestamp_lte: "2024-01-15T09:30:00Z",
96
96
  * filter_paid_at_timestamp_gte: "2024-01-15T09:30:00Z",
97
- * filter_paid_at_timestamp_lte: "2024-01-15T09:30:00Z",
98
- * filter_voided_at_timestamp_gte: "2024-01-15T09:30:00Z",
99
- * filter_voided_at_timestamp_lte: "2024-01-15T09:30:00Z"
97
+ * filter_paid_at_timestamp_lte: "2024-01-15T09:30:00Z"
100
98
  * })
101
99
  */
102
100
  listV1(request?: Chrt.billing.StatementsListV1Request, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.StatementsListRes>;
@@ -177,7 +175,7 @@ export declare class Statements {
177
175
  openInvoiceV1(statementId: string, request?: Chrt.billing.OpenInvoiceReq, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.Statement1>;
178
176
  private __openInvoiceV1;
179
177
  /**
180
- * Syncs invoice state from Stripe to the Statement and LineItemGroups. The webhook usually keeps invoices up to date, but users can manually trigger a sync. | authz: min_org_role=operator | () -> (SyncInvoiceRes)
178
+ * Syncs invoice state from Stripe Connect to the Statement and LineItemGroups. The webhook usually keeps invoices up to date, but users can manually trigger a sync. | authz: org_type=[courier, forwarder, shipper], min_org_role=operator, authz_personas=[statement_org_operators] | () -> (Statement1)
181
179
  *
182
180
  * @param {string} statementId
183
181
  * @param {Statements.RequestOptions} requestOptions - Request-specific configuration.
@@ -187,10 +185,10 @@ export declare class Statements {
187
185
  * @example
188
186
  * await client.billing.statements.syncInvoiceV1("statement_id")
189
187
  */
190
- syncInvoiceV1(statementId: string, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.SyncInvoiceRes>;
188
+ syncInvoiceV1(statementId: string, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.Statement1>;
191
189
  private __syncInvoiceV1;
192
190
  /**
193
- * Cancels/voids a Stripe Connect invoice. Statement must be OPEN or VOID. | authz: org_type=[courier, forwarder], min_org_role=operator, authz_personas=[statement_owner_operators], statement_status=OPEN, VOID | () -> (Statement1)
191
+ * Voids a Stripe Connect invoice. Statement reverts to STAGED and LIGs revert to FINALIZED. | authz: org_type=[courier, forwarder], min_org_role=operator, authz_personas=[statement_owner_operators], statement_status=OPEN | () -> (Statement1)
194
192
  *
195
193
  * @param {string} statementId
196
194
  * @param {Statements.RequestOptions} requestOptions - Request-specific configuration.
@@ -198,9 +196,9 @@ export declare class Statements {
198
196
  * @throws {@link Chrt.UnprocessableEntityError}
199
197
  *
200
198
  * @example
201
- * await client.billing.statements.cancelInvoiceV1("statement_id")
199
+ * await client.billing.statements.voidInvoiceV1("statement_id")
202
200
  */
203
- cancelInvoiceV1(statementId: string, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.Statement1>;
204
- private __cancelInvoiceV1;
201
+ voidInvoiceV1(statementId: string, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.Statement1>;
202
+ private __voidInvoiceV1;
205
203
  protected _getAuthorizationHeader(): Promise<string | undefined>;
206
204
  }
@@ -260,9 +260,7 @@ class Statements {
260
260
  * filter_opened_at_timestamp_gte: "2024-01-15T09:30:00Z",
261
261
  * filter_opened_at_timestamp_lte: "2024-01-15T09:30:00Z",
262
262
  * filter_paid_at_timestamp_gte: "2024-01-15T09:30:00Z",
263
- * filter_paid_at_timestamp_lte: "2024-01-15T09:30:00Z",
264
- * filter_voided_at_timestamp_gte: "2024-01-15T09:30:00Z",
265
- * filter_voided_at_timestamp_lte: "2024-01-15T09:30:00Z"
263
+ * filter_paid_at_timestamp_lte: "2024-01-15T09:30:00Z"
266
264
  * })
267
265
  */
268
266
  listV1(request = {}, requestOptions) {
@@ -271,7 +269,7 @@ class Statements {
271
269
  __listV1() {
272
270
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
273
271
  var _a, _b, _c, _d, _e, _f;
274
- const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_status: filterStatus, filter_settlement_type: filterSettlementType, filter_payment_origin_org_id: filterPaymentOriginOrgId, filter_payment_destination_org_id: filterPaymentDestinationOrgId, filter_owned_by_org_id: filterOwnedByOrgId, filter_staged_at_timestamp_gte: filterStagedAtTimestampGte, filter_staged_at_timestamp_lte: filterStagedAtTimestampLte, filter_opened_at_timestamp_gte: filterOpenedAtTimestampGte, filter_opened_at_timestamp_lte: filterOpenedAtTimestampLte, filter_paid_at_timestamp_gte: filterPaidAtTimestampGte, filter_paid_at_timestamp_lte: filterPaidAtTimestampLte, filter_voided_at_timestamp_gte: filterVoidedAtTimestampGte, filter_voided_at_timestamp_lte: filterVoidedAtTimestampLte, } = request;
272
+ const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_status: filterStatus, filter_settlement_type: filterSettlementType, filter_payment_origin_org_id: filterPaymentOriginOrgId, filter_payment_destination_org_id: filterPaymentDestinationOrgId, filter_owned_by_org_id: filterOwnedByOrgId, filter_staged_at_timestamp_gte: filterStagedAtTimestampGte, filter_staged_at_timestamp_lte: filterStagedAtTimestampLte, filter_opened_at_timestamp_gte: filterOpenedAtTimestampGte, filter_opened_at_timestamp_lte: filterOpenedAtTimestampLte, filter_paid_at_timestamp_gte: filterPaidAtTimestampGte, filter_paid_at_timestamp_lte: filterPaidAtTimestampLte, } = request;
275
273
  const _queryParams = {};
276
274
  if (sortBy !== undefined) {
277
275
  _queryParams["sort_by"] = sortBy;
@@ -323,12 +321,6 @@ class Statements {
323
321
  if (filterPaidAtTimestampLte !== undefined) {
324
322
  _queryParams["filter_paid_at_timestamp_lte"] = filterPaidAtTimestampLte;
325
323
  }
326
- if (filterVoidedAtTimestampGte !== undefined) {
327
- _queryParams["filter_voided_at_timestamp_gte"] = filterVoidedAtTimestampGte;
328
- }
329
- if (filterVoidedAtTimestampLte !== undefined) {
330
- _queryParams["filter_voided_at_timestamp_lte"] = filterVoidedAtTimestampLte;
331
- }
332
324
  let _headers = (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
333
325
  const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
334
326
  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/list/v1"),
@@ -689,7 +681,7 @@ class Statements {
689
681
  });
690
682
  }
691
683
  /**
692
- * Syncs invoice state from Stripe to the Statement and LineItemGroups. The webhook usually keeps invoices up to date, but users can manually trigger a sync. | authz: min_org_role=operator | () -> (SyncInvoiceRes)
684
+ * Syncs invoice state from Stripe Connect to the Statement and LineItemGroups. The webhook usually keeps invoices up to date, but users can manually trigger a sync. | authz: org_type=[courier, forwarder, shipper], min_org_role=operator, authz_personas=[statement_org_operators] | () -> (Statement1)
693
685
  *
694
686
  * @param {string} statementId
695
687
  * @param {Statements.RequestOptions} requestOptions - Request-specific configuration.
@@ -748,7 +740,7 @@ class Statements {
748
740
  });
749
741
  }
750
742
  /**
751
- * Cancels/voids a Stripe Connect invoice. Statement must be OPEN or VOID. | authz: org_type=[courier, forwarder], min_org_role=operator, authz_personas=[statement_owner_operators], statement_status=OPEN, VOID | () -> (Statement1)
743
+ * Voids a Stripe Connect invoice. Statement reverts to STAGED and LIGs revert to FINALIZED. | authz: org_type=[courier, forwarder], min_org_role=operator, authz_personas=[statement_owner_operators], statement_status=OPEN | () -> (Statement1)
752
744
  *
753
745
  * @param {string} statementId
754
746
  * @param {Statements.RequestOptions} requestOptions - Request-specific configuration.
@@ -756,17 +748,17 @@ class Statements {
756
748
  * @throws {@link Chrt.UnprocessableEntityError}
757
749
  *
758
750
  * @example
759
- * await client.billing.statements.cancelInvoiceV1("statement_id")
751
+ * await client.billing.statements.voidInvoiceV1("statement_id")
760
752
  */
761
- cancelInvoiceV1(statementId, requestOptions) {
762
- return core.HttpResponsePromise.fromPromise(this.__cancelInvoiceV1(statementId, requestOptions));
753
+ voidInvoiceV1(statementId, requestOptions) {
754
+ return core.HttpResponsePromise.fromPromise(this.__voidInvoiceV1(statementId, requestOptions));
763
755
  }
764
- __cancelInvoiceV1(statementId, requestOptions) {
756
+ __voidInvoiceV1(statementId, requestOptions) {
765
757
  return __awaiter(this, void 0, void 0, function* () {
766
758
  var _a, _b, _c, _d;
767
759
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
768
760
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
769
- 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/cancel_invoice/v1/${encodeURIComponent(statementId)}`),
761
+ 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/void_invoice/v1/${encodeURIComponent(statementId)}`),
770
762
  method: "POST",
771
763
  headers: _headers,
772
764
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -797,7 +789,7 @@ class Statements {
797
789
  rawResponse: _response.rawResponse,
798
790
  });
799
791
  case "timeout":
800
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing/cancel_invoice/v1/{statement_id}.");
792
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing/void_invoice/v1/{statement_id}.");
801
793
  case "unknown":
802
794
  throw new errors.ChrtError({
803
795
  message: _response.error.errorMessage,
@@ -18,9 +18,7 @@ import * as Chrt from "../../../../../../index.js";
18
18
  * filter_opened_at_timestamp_gte: "2024-01-15T09:30:00Z",
19
19
  * filter_opened_at_timestamp_lte: "2024-01-15T09:30:00Z",
20
20
  * filter_paid_at_timestamp_gte: "2024-01-15T09:30:00Z",
21
- * filter_paid_at_timestamp_lte: "2024-01-15T09:30:00Z",
22
- * filter_voided_at_timestamp_gte: "2024-01-15T09:30:00Z",
23
- * filter_voided_at_timestamp_lte: "2024-01-15T09:30:00Z"
21
+ * filter_paid_at_timestamp_lte: "2024-01-15T09:30:00Z"
24
22
  * }
25
23
  */
26
24
  export interface StatementsListV1Request {
@@ -52,8 +50,4 @@ export interface StatementsListV1Request {
52
50
  filter_paid_at_timestamp_gte?: string | null;
53
51
  /** Filter by paid_at_timestamp <= value */
54
52
  filter_paid_at_timestamp_lte?: string | null;
55
- /** Filter by voided_at_timestamp >= value */
56
- filter_voided_at_timestamp_gte?: string | null;
57
- /** Filter by voided_at_timestamp <= value */
58
- filter_voided_at_timestamp_lte?: string | null;
59
53
  }
@@ -30,19 +30,6 @@ export declare namespace SharingSettings {
30
30
  export declare class SharingSettings {
31
31
  protected readonly _options: SharingSettings.Options;
32
32
  constructor(_options?: SharingSettings.Options);
33
- /**
34
- * Get all tracking datasets and their sharing settings for a given order. | authz_personas=[shipper_org_operators, forwarder_org_operators, courier_org_operators] | () -> (list[TrackingSharingSettingsRes])
35
- *
36
- * @param {string} orderIdOrShortId
37
- * @param {SharingSettings.RequestOptions} requestOptions - Request-specific configuration.
38
- *
39
- * @throws {@link Chrt.UnprocessableEntityError}
40
- *
41
- * @example
42
- * await client.tracking.sharingSettings.getSettingsV1("order_id_or_short_id")
43
- */
44
- getSettingsV1(orderIdOrShortId: string, requestOptions?: SharingSettings.RequestOptions): core.HttpResponsePromise<Chrt.TrackingSharingSettingsRes[]>;
45
- private __getSettingsV1;
46
33
  /**
47
34
  * Updates the sharing settings for a task group by driver tracking dataset. | authz_personas=[forwarder_org_operators, shipper_org_operators, courier_org_operators, courier_driver] | (TaskGroupByDriverSharingSettingsUpdateReq) -> (TaskGroupByDriverSharingSettings1)
48
35
  *
@@ -96,5 +83,18 @@ export declare class SharingSettings {
96
83
  */
97
84
  cargoByDeviceSettingsV1(request: Chrt.tracking.CargoByDeviceSharingSettingsUpdateReq, requestOptions?: SharingSettings.RequestOptions): core.HttpResponsePromise<Chrt.CargoByDeviceSharingSettings1>;
98
85
  private __cargoByDeviceSettingsV1;
86
+ /**
87
+ * Get all tracking datasets and their sharing settings for a given order. If authenticated, returns datasets the user has direct access to plus public datasets. If unauthenticated, returns only datasets with public=True. | () -> (list[TrackingSharingSettingsRes])
88
+ *
89
+ * @param {string} orderIdOrShortId
90
+ * @param {SharingSettings.RequestOptions} requestOptions - Request-specific configuration.
91
+ *
92
+ * @throws {@link Chrt.UnprocessableEntityError}
93
+ *
94
+ * @example
95
+ * await client.tracking.sharingSettings.getSettingsV1("order_id_or_short_id")
96
+ */
97
+ getSettingsV1(orderIdOrShortId: string, requestOptions?: SharingSettings.RequestOptions): core.HttpResponsePromise<Chrt.TrackingSharingSettingsRes[]>;
98
+ private __getSettingsV1;
99
99
  protected _getAuthorizationHeader(): Promise<string | undefined>;
100
100
  }
@@ -56,34 +56,44 @@ class SharingSettings {
56
56
  this._options = _options;
57
57
  }
58
58
  /**
59
- * Get all tracking datasets and their sharing settings for a given order. | authz_personas=[shipper_org_operators, forwarder_org_operators, courier_org_operators] | () -> (list[TrackingSharingSettingsRes])
59
+ * Updates the sharing settings for a task group by driver tracking dataset. | authz_personas=[forwarder_org_operators, shipper_org_operators, courier_org_operators, courier_driver] | (TaskGroupByDriverSharingSettingsUpdateReq) -> (TaskGroupByDriverSharingSettings1)
60
60
  *
61
- * @param {string} orderIdOrShortId
61
+ * @param {Chrt.tracking.TaskGroupByDriverSharingSettingsUpdateReq} request
62
62
  * @param {SharingSettings.RequestOptions} requestOptions - Request-specific configuration.
63
63
  *
64
64
  * @throws {@link Chrt.UnprocessableEntityError}
65
65
  *
66
66
  * @example
67
- * await client.tracking.sharingSettings.getSettingsV1("order_id_or_short_id")
67
+ * await client.tracking.sharingSettings.taskGroupByDriverSharingSettingsV1({
68
+ * task_group_id: "task_group_id",
69
+ * driver_id: "driver_id",
70
+ * "public": true
71
+ * })
68
72
  */
69
- getSettingsV1(orderIdOrShortId, requestOptions) {
70
- return core.HttpResponsePromise.fromPromise(this.__getSettingsV1(orderIdOrShortId, requestOptions));
73
+ taskGroupByDriverSharingSettingsV1(request, requestOptions) {
74
+ return core.HttpResponsePromise.fromPromise(this.__taskGroupByDriverSharingSettingsV1(request, requestOptions));
71
75
  }
72
- __getSettingsV1(orderIdOrShortId, requestOptions) {
76
+ __taskGroupByDriverSharingSettingsV1(request, requestOptions) {
73
77
  return __awaiter(this, void 0, void 0, function* () {
74
78
  var _a, _b, _c, _d;
75
79
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
76
80
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
77
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `tracking/sharing_settings/by_order/v1/${encodeURIComponent(orderIdOrShortId)}`),
78
- method: "GET",
81
+ 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, "tracking/sharing_settings/task_group_by_driver/v1"),
82
+ method: "POST",
79
83
  headers: _headers,
84
+ contentType: "application/json",
80
85
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
86
+ requestType: "json",
87
+ body: request,
81
88
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
82
89
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
83
90
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
84
91
  });
85
92
  if (_response.ok) {
86
- return { data: _response.body, rawResponse: _response.rawResponse };
93
+ return {
94
+ data: _response.body,
95
+ rawResponse: _response.rawResponse,
96
+ };
87
97
  }
88
98
  if (_response.error.reason === "status-code") {
89
99
  switch (_response.error.statusCode) {
@@ -105,7 +115,7 @@ class SharingSettings {
105
115
  rawResponse: _response.rawResponse,
106
116
  });
107
117
  case "timeout":
108
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/sharing_settings/by_order/v1/{order_id_or_short_id}.");
118
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/sharing_settings/task_group_by_driver/v1.");
109
119
  case "unknown":
110
120
  throw new errors.ChrtError({
111
121
  message: _response.error.errorMessage,
@@ -115,29 +125,30 @@ class SharingSettings {
115
125
  });
116
126
  }
117
127
  /**
118
- * Updates the sharing settings for a task group by driver tracking dataset. | authz_personas=[forwarder_org_operators, shipper_org_operators, courier_org_operators, courier_driver] | (TaskGroupByDriverSharingSettingsUpdateReq) -> (TaskGroupByDriverSharingSettings1)
128
+ * Updates the sharing settings for a cargo by driver tracking dataset. | authz_personas=[forwarder_org_operators, shipper_org_operators, courier_org_operators, courier_driver] | (CargoByDriverSharingSettingsUpdateReq) -> (CargoByDriverSharingSettings1)
119
129
  *
120
- * @param {Chrt.tracking.TaskGroupByDriverSharingSettingsUpdateReq} request
130
+ * @param {Chrt.tracking.CargoByDriverSharingSettingsUpdateReq} request
121
131
  * @param {SharingSettings.RequestOptions} requestOptions - Request-specific configuration.
122
132
  *
123
133
  * @throws {@link Chrt.UnprocessableEntityError}
124
134
  *
125
135
  * @example
126
- * await client.tracking.sharingSettings.taskGroupByDriverSharingSettingsV1({
136
+ * await client.tracking.sharingSettings.cargoByDriverSettingsV1({
127
137
  * task_group_id: "task_group_id",
138
+ * cargo_id: "cargo_id",
128
139
  * driver_id: "driver_id",
129
140
  * "public": true
130
141
  * })
131
142
  */
132
- taskGroupByDriverSharingSettingsV1(request, requestOptions) {
133
- return core.HttpResponsePromise.fromPromise(this.__taskGroupByDriverSharingSettingsV1(request, requestOptions));
143
+ cargoByDriverSettingsV1(request, requestOptions) {
144
+ return core.HttpResponsePromise.fromPromise(this.__cargoByDriverSettingsV1(request, requestOptions));
134
145
  }
135
- __taskGroupByDriverSharingSettingsV1(request, requestOptions) {
146
+ __cargoByDriverSettingsV1(request, requestOptions) {
136
147
  return __awaiter(this, void 0, void 0, function* () {
137
148
  var _a, _b, _c, _d;
138
149
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
139
150
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
140
- 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, "tracking/sharing_settings/task_group_by_driver/v1"),
151
+ 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, "tracking/sharing_settings/cargo_by_driver/v1"),
141
152
  method: "POST",
142
153
  headers: _headers,
143
154
  contentType: "application/json",
@@ -149,10 +160,7 @@ class SharingSettings {
149
160
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
150
161
  });
151
162
  if (_response.ok) {
152
- return {
153
- data: _response.body,
154
- rawResponse: _response.rawResponse,
155
- };
163
+ return { data: _response.body, rawResponse: _response.rawResponse };
156
164
  }
157
165
  if (_response.error.reason === "status-code") {
158
166
  switch (_response.error.statusCode) {
@@ -174,7 +182,7 @@ class SharingSettings {
174
182
  rawResponse: _response.rawResponse,
175
183
  });
176
184
  case "timeout":
177
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/sharing_settings/task_group_by_driver/v1.");
185
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/sharing_settings/cargo_by_driver/v1.");
178
186
  case "unknown":
179
187
  throw new errors.ChrtError({
180
188
  message: _response.error.errorMessage,
@@ -184,30 +192,30 @@ class SharingSettings {
184
192
  });
185
193
  }
186
194
  /**
187
- * Updates the sharing settings for a cargo by driver tracking dataset. | authz_personas=[forwarder_org_operators, shipper_org_operators, courier_org_operators, courier_driver] | (CargoByDriverSharingSettingsUpdateReq) -> (CargoByDriverSharingSettings1)
195
+ * Updates the sharing settings for a cargo by device tracking dataset. | authz_personas=[forwarder_org_operators, shipper_org_operators, order_creator_org_operators] | (CargoByDeviceSharingSettingsUpdateReq) -> (CargoByDeviceSharingSettings1)
188
196
  *
189
- * @param {Chrt.tracking.CargoByDriverSharingSettingsUpdateReq} request
197
+ * @param {Chrt.tracking.CargoByDeviceSharingSettingsUpdateReq} request
190
198
  * @param {SharingSettings.RequestOptions} requestOptions - Request-specific configuration.
191
199
  *
192
200
  * @throws {@link Chrt.UnprocessableEntityError}
193
201
  *
194
202
  * @example
195
- * await client.tracking.sharingSettings.cargoByDriverSettingsV1({
203
+ * await client.tracking.sharingSettings.cargoByDeviceSettingsV1({
196
204
  * task_group_id: "task_group_id",
197
205
  * cargo_id: "cargo_id",
198
- * driver_id: "driver_id",
206
+ * device_id: "device_id",
199
207
  * "public": true
200
208
  * })
201
209
  */
202
- cargoByDriverSettingsV1(request, requestOptions) {
203
- return core.HttpResponsePromise.fromPromise(this.__cargoByDriverSettingsV1(request, requestOptions));
210
+ cargoByDeviceSettingsV1(request, requestOptions) {
211
+ return core.HttpResponsePromise.fromPromise(this.__cargoByDeviceSettingsV1(request, requestOptions));
204
212
  }
205
- __cargoByDriverSettingsV1(request, requestOptions) {
213
+ __cargoByDeviceSettingsV1(request, requestOptions) {
206
214
  return __awaiter(this, void 0, void 0, function* () {
207
215
  var _a, _b, _c, _d;
208
216
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
209
217
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
210
- 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, "tracking/sharing_settings/cargo_by_driver/v1"),
218
+ 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, "tracking/sharing_settings/cargo_by_device/v1"),
211
219
  method: "POST",
212
220
  headers: _headers,
213
221
  contentType: "application/json",
@@ -241,7 +249,7 @@ class SharingSettings {
241
249
  rawResponse: _response.rawResponse,
242
250
  });
243
251
  case "timeout":
244
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/sharing_settings/cargo_by_driver/v1.");
252
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/sharing_settings/cargo_by_device/v1.");
245
253
  case "unknown":
246
254
  throw new errors.ChrtError({
247
255
  message: _response.error.errorMessage,
@@ -251,36 +259,28 @@ class SharingSettings {
251
259
  });
252
260
  }
253
261
  /**
254
- * Updates the sharing settings for a cargo by device tracking dataset. | authz_personas=[forwarder_org_operators, shipper_org_operators, order_creator_org_operators] | (CargoByDeviceSharingSettingsUpdateReq) -> (CargoByDeviceSharingSettings1)
262
+ * Get all tracking datasets and their sharing settings for a given order. If authenticated, returns datasets the user has direct access to plus public datasets. If unauthenticated, returns only datasets with public=True. | () -> (list[TrackingSharingSettingsRes])
255
263
  *
256
- * @param {Chrt.tracking.CargoByDeviceSharingSettingsUpdateReq} request
264
+ * @param {string} orderIdOrShortId
257
265
  * @param {SharingSettings.RequestOptions} requestOptions - Request-specific configuration.
258
266
  *
259
267
  * @throws {@link Chrt.UnprocessableEntityError}
260
268
  *
261
269
  * @example
262
- * await client.tracking.sharingSettings.cargoByDeviceSettingsV1({
263
- * task_group_id: "task_group_id",
264
- * cargo_id: "cargo_id",
265
- * device_id: "device_id",
266
- * "public": true
267
- * })
270
+ * await client.tracking.sharingSettings.getSettingsV1("order_id_or_short_id")
268
271
  */
269
- cargoByDeviceSettingsV1(request, requestOptions) {
270
- return core.HttpResponsePromise.fromPromise(this.__cargoByDeviceSettingsV1(request, requestOptions));
272
+ getSettingsV1(orderIdOrShortId, requestOptions) {
273
+ return core.HttpResponsePromise.fromPromise(this.__getSettingsV1(orderIdOrShortId, requestOptions));
271
274
  }
272
- __cargoByDeviceSettingsV1(request, requestOptions) {
275
+ __getSettingsV1(orderIdOrShortId, requestOptions) {
273
276
  return __awaiter(this, void 0, void 0, function* () {
274
277
  var _a, _b, _c, _d;
275
278
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
276
279
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
277
- 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, "tracking/sharing_settings/cargo_by_device/v1"),
278
- method: "POST",
280
+ 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, `tracking/sharing_settings/by_order/v1/${encodeURIComponent(orderIdOrShortId)}`),
281
+ method: "GET",
279
282
  headers: _headers,
280
- contentType: "application/json",
281
283
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
282
- requestType: "json",
283
- body: request,
284
284
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
285
285
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
286
286
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -308,7 +308,7 @@ class SharingSettings {
308
308
  rawResponse: _response.rawResponse,
309
309
  });
310
310
  case "timeout":
311
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/sharing_settings/cargo_by_device/v1.");
311
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/sharing_settings/by_order/v1/{order_id_or_short_id}.");
312
312
  case "unknown":
313
313
  throw new errors.ChrtError({
314
314
  message: _response.error.errorMessage,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type LineItemGroupStatusEnum1 = "staged" | "pending_rates" | "pending_calculation" | "adjustable" | "finalized" | "open" | "paid" | "uncollectible" | "void";
4
+ export type LineItemGroupStatusEnum1 = "staged" | "pending_rates" | "pending_calculation" | "adjustable" | "finalized" | "open" | "paid" | "uncollectible";
5
5
  export declare const LineItemGroupStatusEnum1: {
6
6
  readonly Staged: "staged";
7
7
  readonly PendingRates: "pending_rates";
@@ -11,5 +11,4 @@ export declare const LineItemGroupStatusEnum1: {
11
11
  readonly Open: "open";
12
12
  readonly Paid: "paid";
13
13
  readonly Uncollectible: "uncollectible";
14
- readonly Void: "void";
15
14
  };
@@ -13,5 +13,4 @@ exports.LineItemGroupStatusEnum1 = {
13
13
  Open: "open",
14
14
  Paid: "paid",
15
15
  Uncollectible: "uncollectible",
16
- Void: "void",
17
16
  };
@@ -29,14 +29,11 @@ export interface Statement1 {
29
29
  staged_at_timestamp?: string | null;
30
30
  opened_at_timestamp?: string | null;
31
31
  paid_at_timestamp?: string | null;
32
- voided_at_timestamp?: string | null;
33
32
  uncollectible_at_timestamp?: string | null;
34
33
  /** Must be a string starting with `user_` */
35
34
  marked_open_by_user_id?: string | null;
36
35
  /** Must be a string starting with `user_` */
37
36
  marked_paid_by_user_id?: string | null;
38
37
  /** Must be a string starting with `user_` */
39
- marked_voided_by_user_id?: string | null;
40
- /** Must be a string starting with `user_` */
41
38
  marked_uncollectible_by_user_id?: string | null;
42
39
  }
@@ -1,12 +1,11 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type StatementSortByEnum = "amount" | "staged_at_timestamp" | "opened_at_timestamp" | "paid_at_timestamp" | "voided_at_timestamp" | "uncollectible_at_timestamp";
4
+ export type StatementSortByEnum = "amount" | "staged_at_timestamp" | "opened_at_timestamp" | "paid_at_timestamp" | "uncollectible_at_timestamp";
5
5
  export declare const StatementSortByEnum: {
6
6
  readonly Amount: "amount";
7
7
  readonly StagedAtTimestamp: "staged_at_timestamp";
8
8
  readonly OpenedAtTimestamp: "opened_at_timestamp";
9
9
  readonly PaidAtTimestamp: "paid_at_timestamp";
10
- readonly VoidedAtTimestamp: "voided_at_timestamp";
11
10
  readonly UncollectibleAtTimestamp: "uncollectible_at_timestamp";
12
11
  };
@@ -9,6 +9,5 @@ exports.StatementSortByEnum = {
9
9
  StagedAtTimestamp: "staged_at_timestamp",
10
10
  OpenedAtTimestamp: "opened_at_timestamp",
11
11
  PaidAtTimestamp: "paid_at_timestamp",
12
- VoidedAtTimestamp: "voided_at_timestamp",
13
12
  UncollectibleAtTimestamp: "uncollectible_at_timestamp",
14
13
  };
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type StatementStatusEnum1 = "staged" | "open" | "paid" | "uncollectible" | "void";
4
+ export type StatementStatusEnum1 = "staged" | "open" | "paid" | "uncollectible";
5
5
  export declare const StatementStatusEnum1: {
6
6
  readonly Staged: "staged";
7
7
  readonly Open: "open";
8
8
  readonly Paid: "paid";
9
9
  readonly Uncollectible: "uncollectible";
10
- readonly Void: "void";
11
10
  };
@@ -9,5 +9,4 @@ exports.StatementStatusEnum1 = {
9
9
  Open: "open",
10
10
  Paid: "paid",
11
11
  Uncollectible: "uncollectible",
12
- Void: "void",
13
12
  };
@@ -106,7 +106,6 @@ export * from "./StatementStatusEnum1.js";
106
106
  export * from "./StatementsListRes.js";
107
107
  export * from "./StripeConnectAccountOnboardingLinkRes.js";
108
108
  export * from "./StripeConnectInvoiceStatusEnum.js";
109
- export * from "./SyncInvoiceRes.js";
110
109
  export * from "./Task1.js";
111
110
  export * from "./TaskArtifact1.js";
112
111
  export * from "./TaskArtifactClientCreate1.js";
@@ -122,7 +122,6 @@ __exportStar(require("./StatementStatusEnum1.js"), exports);
122
122
  __exportStar(require("./StatementsListRes.js"), exports);
123
123
  __exportStar(require("./StripeConnectAccountOnboardingLinkRes.js"), exports);
124
124
  __exportStar(require("./StripeConnectInvoiceStatusEnum.js"), exports);
125
- __exportStar(require("./SyncInvoiceRes.js"), exports);
126
125
  __exportStar(require("./Task1.js"), exports);
127
126
  __exportStar(require("./TaskArtifact1.js"), exports);
128
127
  __exportStar(require("./TaskArtifactClientCreate1.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.344.1";
1
+ export declare const SDK_VERSION = "2.0.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.344.1";
4
+ exports.SDK_VERSION = "2.0.0";
@@ -31,8 +31,8 @@ export class ChrtClient {
31
31
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
32
32
  "X-Fern-Language": "JavaScript",
33
33
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
34
- "X-Fern-SDK-Version": "1.344.1",
35
- "User-Agent": "@chrt-inc/typescript-sdk/1.344.1",
34
+ "X-Fern-SDK-Version": "2.0.0",
35
+ "User-Agent": "@chrt-inc/typescript-sdk/2.0.0",
36
36
  "X-Fern-Runtime": core.RUNTIME.type,
37
37
  "X-Fern-Runtime-Version": core.RUNTIME.version,
38
38
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -94,9 +94,7 @@ export declare class Statements {
94
94
  * filter_opened_at_timestamp_gte: "2024-01-15T09:30:00Z",
95
95
  * filter_opened_at_timestamp_lte: "2024-01-15T09:30:00Z",
96
96
  * filter_paid_at_timestamp_gte: "2024-01-15T09:30:00Z",
97
- * filter_paid_at_timestamp_lte: "2024-01-15T09:30:00Z",
98
- * filter_voided_at_timestamp_gte: "2024-01-15T09:30:00Z",
99
- * filter_voided_at_timestamp_lte: "2024-01-15T09:30:00Z"
97
+ * filter_paid_at_timestamp_lte: "2024-01-15T09:30:00Z"
100
98
  * })
101
99
  */
102
100
  listV1(request?: Chrt.billing.StatementsListV1Request, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.StatementsListRes>;
@@ -177,7 +175,7 @@ export declare class Statements {
177
175
  openInvoiceV1(statementId: string, request?: Chrt.billing.OpenInvoiceReq, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.Statement1>;
178
176
  private __openInvoiceV1;
179
177
  /**
180
- * Syncs invoice state from Stripe to the Statement and LineItemGroups. The webhook usually keeps invoices up to date, but users can manually trigger a sync. | authz: min_org_role=operator | () -> (SyncInvoiceRes)
178
+ * Syncs invoice state from Stripe Connect to the Statement and LineItemGroups. The webhook usually keeps invoices up to date, but users can manually trigger a sync. | authz: org_type=[courier, forwarder, shipper], min_org_role=operator, authz_personas=[statement_org_operators] | () -> (Statement1)
181
179
  *
182
180
  * @param {string} statementId
183
181
  * @param {Statements.RequestOptions} requestOptions - Request-specific configuration.
@@ -187,10 +185,10 @@ export declare class Statements {
187
185
  * @example
188
186
  * await client.billing.statements.syncInvoiceV1("statement_id")
189
187
  */
190
- syncInvoiceV1(statementId: string, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.SyncInvoiceRes>;
188
+ syncInvoiceV1(statementId: string, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.Statement1>;
191
189
  private __syncInvoiceV1;
192
190
  /**
193
- * Cancels/voids a Stripe Connect invoice. Statement must be OPEN or VOID. | authz: org_type=[courier, forwarder], min_org_role=operator, authz_personas=[statement_owner_operators], statement_status=OPEN, VOID | () -> (Statement1)
191
+ * Voids a Stripe Connect invoice. Statement reverts to STAGED and LIGs revert to FINALIZED. | authz: org_type=[courier, forwarder], min_org_role=operator, authz_personas=[statement_owner_operators], statement_status=OPEN | () -> (Statement1)
194
192
  *
195
193
  * @param {string} statementId
196
194
  * @param {Statements.RequestOptions} requestOptions - Request-specific configuration.
@@ -198,9 +196,9 @@ export declare class Statements {
198
196
  * @throws {@link Chrt.UnprocessableEntityError}
199
197
  *
200
198
  * @example
201
- * await client.billing.statements.cancelInvoiceV1("statement_id")
199
+ * await client.billing.statements.voidInvoiceV1("statement_id")
202
200
  */
203
- cancelInvoiceV1(statementId: string, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.Statement1>;
204
- private __cancelInvoiceV1;
201
+ voidInvoiceV1(statementId: string, requestOptions?: Statements.RequestOptions): core.HttpResponsePromise<Chrt.Statement1>;
202
+ private __voidInvoiceV1;
205
203
  protected _getAuthorizationHeader(): Promise<string | undefined>;
206
204
  }