@chrt-inc/typescript-sdk 1.726.0 → 1.732.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 (90) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/operations/resources/departmentRoutingRules/client/Client.d.ts +8 -8
  3. package/dist/cjs/api/resources/operations/resources/departmentRoutingRules/client/Client.js +22 -14
  4. package/dist/cjs/api/resources/operations/resources/departmentRoutingRules/client/requests/DepartmentRoutingRuleClientCreate1.d.ts +3 -5
  5. package/dist/cjs/api/resources/operations/resources/departmentRoutingRules/client/requests/DepartmentRoutingRulesDeleteV1Request.d.ts +14 -0
  6. package/dist/cjs/api/resources/operations/resources/departmentRoutingRules/client/requests/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/Client.d.ts +12 -12
  8. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/Client.js +21 -21
  9. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/requests/{OperationsTaskListEntriesRemove1.d.ts → OperationsTaskListReorderEntries1.d.ts} +1 -1
  10. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/requests/{OperationsTaskListEntriesAdd1.d.ts → OperationsTaskListSetEntries1.d.ts} +1 -1
  11. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/requests/OperationsTaskListSetEntries1.js +5 -0
  12. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/requests/OperationsTaskListsApplyToCaseV1Request.d.ts +3 -3
  13. package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/requests/index.d.ts +2 -2
  14. package/dist/cjs/api/resources/shipping/resources/orderDrafts/client/Client.d.ts +16 -0
  15. package/dist/cjs/api/resources/shipping/resources/orderDrafts/client/Client.js +65 -0
  16. package/dist/cjs/api/resources/shipping/resources/orderDrafts/client/requests/SetTaskGroupOrderingDraftReq.d.ts +13 -0
  17. package/dist/cjs/api/resources/shipping/resources/orderDrafts/client/requests/SetTaskGroupOrderingDraftReq.js +5 -0
  18. package/dist/cjs/api/resources/shipping/resources/orderDrafts/client/requests/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/cargo/client/Client.d.ts +17 -0
  20. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/cargo/client/Client.js +66 -0
  21. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/cargo/client/requests/OrderDraftUnassociateCargoWithTaskReq.d.ts +16 -0
  22. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/cargo/client/requests/OrderDraftUnassociateCargoWithTaskReq.js +5 -0
  23. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/cargo/client/requests/index.d.ts +1 -0
  24. package/dist/cjs/api/resources/shipping/resources/taskGroups/client/Client.d.ts +1 -1
  25. package/dist/cjs/api/resources/shipping/resources/taskGroups/client/Client.js +1 -1
  26. package/dist/cjs/api/types/DeadlineAnchorEnum.d.ts +13 -0
  27. package/dist/cjs/api/types/DeadlineAnchorEnum.js +10 -0
  28. package/dist/cjs/api/types/DepartmentRoutingRule1.d.ts +3 -3
  29. package/dist/cjs/api/types/OperationsTaskListEntry1.d.ts +9 -7
  30. package/dist/cjs/api/types/OperationsTaskTypeEnum.d.ts +16 -8
  31. package/dist/cjs/api/types/OperationsTaskTypeEnum.js +6 -7
  32. package/dist/cjs/api/types/OrderDraftValidationResult.d.ts +1 -0
  33. package/dist/cjs/api/types/ValidationIssue.d.ts +8 -0
  34. package/dist/cjs/api/types/ValidationIssue.js +5 -0
  35. package/dist/cjs/api/types/ValidationIssueScope.d.ts +8 -0
  36. package/dist/cjs/api/types/ValidationIssueScope.js +5 -0
  37. package/dist/cjs/api/types/index.d.ts +3 -1
  38. package/dist/cjs/api/types/index.js +3 -1
  39. package/dist/cjs/version.d.ts +1 -1
  40. package/dist/cjs/version.js +1 -1
  41. package/dist/esm/Client.mjs +2 -2
  42. package/dist/esm/api/resources/operations/resources/departmentRoutingRules/client/Client.d.mts +8 -8
  43. package/dist/esm/api/resources/operations/resources/departmentRoutingRules/client/Client.mjs +22 -14
  44. package/dist/esm/api/resources/operations/resources/departmentRoutingRules/client/requests/DepartmentRoutingRuleClientCreate1.d.mts +3 -5
  45. package/dist/esm/api/resources/operations/resources/departmentRoutingRules/client/requests/DepartmentRoutingRulesDeleteV1Request.d.mts +14 -0
  46. package/dist/esm/api/resources/operations/resources/departmentRoutingRules/client/requests/index.d.mts +1 -0
  47. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/Client.d.mts +12 -12
  48. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/Client.mjs +21 -21
  49. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/requests/{OperationsTaskListEntriesRemove1.d.mts → OperationsTaskListReorderEntries1.d.mts} +1 -1
  50. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/requests/{OperationsTaskListEntriesAdd1.d.mts → OperationsTaskListSetEntries1.d.mts} +1 -1
  51. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/requests/OperationsTaskListSetEntries1.mjs +4 -0
  52. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/requests/OperationsTaskListsApplyToCaseV1Request.d.mts +3 -3
  53. package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/requests/index.d.mts +2 -2
  54. package/dist/esm/api/resources/shipping/resources/orderDrafts/client/Client.d.mts +16 -0
  55. package/dist/esm/api/resources/shipping/resources/orderDrafts/client/Client.mjs +65 -0
  56. package/dist/esm/api/resources/shipping/resources/orderDrafts/client/requests/SetTaskGroupOrderingDraftReq.d.mts +13 -0
  57. package/dist/esm/api/resources/shipping/resources/orderDrafts/client/requests/SetTaskGroupOrderingDraftReq.mjs +4 -0
  58. package/dist/esm/api/resources/shipping/resources/orderDrafts/client/requests/index.d.mts +1 -0
  59. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/cargo/client/Client.d.mts +17 -0
  60. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/cargo/client/Client.mjs +66 -0
  61. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/cargo/client/requests/OrderDraftUnassociateCargoWithTaskReq.d.mts +16 -0
  62. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/cargo/client/requests/OrderDraftUnassociateCargoWithTaskReq.mjs +4 -0
  63. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/cargo/client/requests/index.d.mts +1 -0
  64. package/dist/esm/api/resources/shipping/resources/taskGroups/client/Client.d.mts +1 -1
  65. package/dist/esm/api/resources/shipping/resources/taskGroups/client/Client.mjs +1 -1
  66. package/dist/esm/api/types/DeadlineAnchorEnum.d.mts +13 -0
  67. package/dist/esm/api/types/DeadlineAnchorEnum.mjs +7 -0
  68. package/dist/esm/api/types/DepartmentRoutingRule1.d.mts +3 -3
  69. package/dist/esm/api/types/OperationsTaskListEntry1.d.mts +9 -7
  70. package/dist/esm/api/types/OperationsTaskTypeEnum.d.mts +16 -8
  71. package/dist/esm/api/types/OperationsTaskTypeEnum.mjs +6 -7
  72. package/dist/esm/api/types/OrderDraftValidationResult.d.mts +1 -0
  73. package/dist/esm/api/types/ValidationIssue.d.mts +8 -0
  74. package/dist/esm/api/types/ValidationIssue.mjs +4 -0
  75. package/dist/esm/api/types/ValidationIssueScope.d.mts +8 -0
  76. package/dist/esm/api/types/ValidationIssueScope.mjs +4 -0
  77. package/dist/esm/api/types/index.d.mts +3 -1
  78. package/dist/esm/api/types/index.mjs +3 -1
  79. package/dist/esm/version.d.mts +1 -1
  80. package/dist/esm/version.mjs +1 -1
  81. package/package.json +1 -1
  82. package/reference.md +159 -26
  83. package/dist/cjs/api/types/RoutingCounterpartyTypeEnum.d.ts +0 -8
  84. package/dist/cjs/api/types/RoutingCounterpartyTypeEnum.js +0 -10
  85. package/dist/esm/api/types/RoutingCounterpartyTypeEnum.d.mts +0 -8
  86. package/dist/esm/api/types/RoutingCounterpartyTypeEnum.mjs +0 -7
  87. /package/dist/cjs/api/resources/operations/resources/{operationsTaskLists/client/requests/OperationsTaskListEntriesAdd1.js → departmentRoutingRules/client/requests/DepartmentRoutingRulesDeleteV1Request.js} +0 -0
  88. /package/dist/cjs/api/resources/operations/resources/operationsTaskLists/client/requests/{OperationsTaskListEntriesRemove1.js → OperationsTaskListReorderEntries1.js} +0 -0
  89. /package/dist/esm/api/resources/operations/resources/{operationsTaskLists/client/requests/OperationsTaskListEntriesAdd1.mjs → departmentRoutingRules/client/requests/DepartmentRoutingRulesDeleteV1Request.mjs} +0 -0
  90. /package/dist/esm/api/resources/operations/resources/operationsTaskLists/client/requests/{OperationsTaskListEntriesRemove1.mjs → OperationsTaskListReorderEntries1.mjs} +0 -0
@@ -289,26 +289,26 @@ export class OperationsTaskLists {
289
289
  });
290
290
  }
291
291
  /**
292
- * Appends entries to an OperationsTaskList's `entries` array. | authz: min_org_role=operator | (OperationsTaskListEntriesAdd1) -> (bool)
292
+ * Replaces an OperationsTaskList's `entries` array wholesale — covering add, remove, reorder, and edit in one operation. Order is load-bearing for from_previous_task-anchored deadlines. | authz: min_org_role=operator | (OperationsTaskListSetEntries1) -> (bool)
293
293
  *
294
294
  * @param {string} taskListId
295
- * @param {Chrt.operations.OperationsTaskListEntriesAdd1} request
295
+ * @param {Chrt.operations.OperationsTaskListSetEntries1} request
296
296
  * @param {OperationsTaskLists.RequestOptions} requestOptions - Request-specific configuration.
297
297
  *
298
298
  * @throws {@link Chrt.UnprocessableEntityError}
299
299
  *
300
300
  * @example
301
- * await client.operations.operationsTaskLists.addEntriesV1("task_list_id")
301
+ * await client.operations.operationsTaskLists.setEntriesV1("task_list_id")
302
302
  */
303
- addEntriesV1(taskListId, request = {}, requestOptions) {
304
- return core.HttpResponsePromise.fromPromise(this.__addEntriesV1(taskListId, request, requestOptions));
303
+ setEntriesV1(taskListId, request = {}, requestOptions) {
304
+ return core.HttpResponsePromise.fromPromise(this.__setEntriesV1(taskListId, request, requestOptions));
305
305
  }
306
- __addEntriesV1(taskListId_1) {
306
+ __setEntriesV1(taskListId_1) {
307
307
  return __awaiter(this, arguments, void 0, function* (taskListId, request = {}, requestOptions) {
308
308
  var _a, _b, _c, _d;
309
309
  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);
310
310
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
311
- 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, `operations/operations_task_lists/entries/add/v1/${encodeURIComponent(taskListId)}`),
311
+ 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, `operations/operations_task_lists/entries/set/v1/${encodeURIComponent(taskListId)}`),
312
312
  method: "POST",
313
313
  headers: _headers,
314
314
  contentType: "application/json",
@@ -342,7 +342,7 @@ export class OperationsTaskLists {
342
342
  rawResponse: _response.rawResponse,
343
343
  });
344
344
  case "timeout":
345
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/operations_task_lists/entries/add/v1/{task_list_id}.");
345
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/operations_task_lists/entries/set/v1/{task_list_id}.");
346
346
  case "unknown":
347
347
  throw new errors.ChrtError({
348
348
  message: _response.error.errorMessage,
@@ -352,26 +352,26 @@ export class OperationsTaskLists {
352
352
  });
353
353
  }
354
354
  /**
355
- * Removes entries from an OperationsTaskList by entry id. | authz: min_org_role=operator | (OperationsTaskListEntriesRemove1) -> (bool)
355
+ * Reorders an OperationsTaskList's existing entries. `entry_ids` must be an exact permutation of the list's current entry ids (every id present, no extras, no duplicates), so a reorder can never drop, add, or mutate an entry. | authz: min_org_role=operator | (OperationsTaskListReorderEntries1) -> (bool)
356
356
  *
357
357
  * @param {string} taskListId
358
- * @param {Chrt.operations.OperationsTaskListEntriesRemove1} request
358
+ * @param {Chrt.operations.OperationsTaskListReorderEntries1} request
359
359
  * @param {OperationsTaskLists.RequestOptions} requestOptions - Request-specific configuration.
360
360
  *
361
361
  * @throws {@link Chrt.UnprocessableEntityError}
362
362
  *
363
363
  * @example
364
- * await client.operations.operationsTaskLists.removeEntriesV1("task_list_id")
364
+ * await client.operations.operationsTaskLists.reorderEntriesV1("task_list_id")
365
365
  */
366
- removeEntriesV1(taskListId, request = {}, requestOptions) {
367
- return core.HttpResponsePromise.fromPromise(this.__removeEntriesV1(taskListId, request, requestOptions));
366
+ reorderEntriesV1(taskListId, request = {}, requestOptions) {
367
+ return core.HttpResponsePromise.fromPromise(this.__reorderEntriesV1(taskListId, request, requestOptions));
368
368
  }
369
- __removeEntriesV1(taskListId_1) {
369
+ __reorderEntriesV1(taskListId_1) {
370
370
  return __awaiter(this, arguments, void 0, function* (taskListId, request = {}, requestOptions) {
371
371
  var _a, _b, _c, _d;
372
372
  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);
373
373
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
374
- 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, `operations/operations_task_lists/entries/remove/v1/${encodeURIComponent(taskListId)}`),
374
+ 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, `operations/operations_task_lists/entries/reorder/v1/${encodeURIComponent(taskListId)}`),
375
375
  method: "POST",
376
376
  headers: _headers,
377
377
  contentType: "application/json",
@@ -405,7 +405,7 @@ export class OperationsTaskLists {
405
405
  rawResponse: _response.rawResponse,
406
406
  });
407
407
  case "timeout":
408
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/operations_task_lists/entries/remove/v1/{task_list_id}.");
408
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /operations/operations_task_lists/entries/reorder/v1/{task_list_id}.");
409
409
  case "unknown":
410
410
  throw new errors.ChrtError({
411
411
  message: _response.error.errorMessage,
@@ -533,7 +533,7 @@ export class OperationsTaskLists {
533
533
  });
534
534
  }
535
535
  /**
536
- * Materializes each entry of an OperationsTaskList into an OperationsTask on the Case (status=not_started, source_task_list_id set). Deadlines: overall_deadline_timestamp wins, else the entry's deadline_offset_seconds, else a positional 20-min stagger. No dedup — applying twice creates duplicate tasks. | authz: min_org_role=operator | () -> (list[PydanticObjectId])
536
+ * Materializes each entry of an OperationsTaskList into an OperationsTask on the Case (status=not_started, source_task_list_id set). Deadlines resolve per-entry from its anchor+offset; initial_deadline_timestamp, if set, pins the first entry and the chain follows. No dedup — applying twice creates duplicate tasks. | authz: min_org_role=operator | () -> (list[PydanticObjectId])
537
537
  *
538
538
  * @param {string} taskListId
539
539
  * @param {string} caseId
@@ -544,7 +544,7 @@ export class OperationsTaskLists {
544
544
  *
545
545
  * @example
546
546
  * await client.operations.operationsTaskLists.applyToCaseV1("task_list_id", "case_id", {
547
- * overall_deadline_timestamp: "2024-01-15T09:30:00Z"
547
+ * initial_deadline_timestamp: "2024-01-15T09:30:00Z"
548
548
  * })
549
549
  */
550
550
  applyToCaseV1(taskListId, caseId, request = {}, requestOptions) {
@@ -553,10 +553,10 @@ export class OperationsTaskLists {
553
553
  __applyToCaseV1(taskListId_1, caseId_1) {
554
554
  return __awaiter(this, arguments, void 0, function* (taskListId, caseId, request = {}, requestOptions) {
555
555
  var _a, _b, _c, _d;
556
- const { overall_deadline_timestamp: overallDeadlineTimestamp } = request;
556
+ const { initial_deadline_timestamp: initialDeadlineTimestamp } = request;
557
557
  const _queryParams = {};
558
- if (overallDeadlineTimestamp !== undefined) {
559
- _queryParams["overall_deadline_timestamp"] = overallDeadlineTimestamp;
558
+ if (initialDeadlineTimestamp !== undefined) {
559
+ _queryParams["initial_deadline_timestamp"] = initialDeadlineTimestamp;
560
560
  }
561
561
  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);
562
562
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
@@ -5,6 +5,6 @@
5
5
  * @example
6
6
  * {}
7
7
  */
8
- export interface OperationsTaskListEntriesRemove1 {
8
+ export interface OperationsTaskListReorderEntries1 {
9
9
  entry_ids?: string[];
10
10
  }
@@ -6,6 +6,6 @@ import * as Chrt from "../../../../../../index.mjs";
6
6
  * @example
7
7
  * {}
8
8
  */
9
- export interface OperationsTaskListEntriesAdd1 {
9
+ export interface OperationsTaskListSetEntries1 {
10
10
  entries?: Chrt.OperationsTaskListEntry1[];
11
11
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -4,10 +4,10 @@
4
4
  /**
5
5
  * @example
6
6
  * {
7
- * overall_deadline_timestamp: "2024-01-15T09:30:00Z"
7
+ * initial_deadline_timestamp: "2024-01-15T09:30:00Z"
8
8
  * }
9
9
  */
10
10
  export interface OperationsTaskListsApplyToCaseV1Request {
11
- /** If set, overrides every materialized task's deadline with this timestamp. */
12
- overall_deadline_timestamp?: string | null;
11
+ /** If set, pins the first entry's deadline; later FROM_PREVIOUS_TASK entries cascade from it. */
12
+ initial_deadline_timestamp?: string | null;
13
13
  }
@@ -1,6 +1,6 @@
1
1
  export { type OperationsTaskListsListV1Request } from "./OperationsTaskListsListV1Request.mjs";
2
2
  export { type OperationsTaskListClientUpdate1 } from "./OperationsTaskListClientUpdate1.mjs";
3
3
  export { type OperationsTaskListClientCreate1 } from "./OperationsTaskListClientCreate1.mjs";
4
- export { type OperationsTaskListEntriesAdd1 } from "./OperationsTaskListEntriesAdd1.mjs";
5
- export { type OperationsTaskListEntriesRemove1 } from "./OperationsTaskListEntriesRemove1.mjs";
4
+ export { type OperationsTaskListSetEntries1 } from "./OperationsTaskListSetEntries1.mjs";
5
+ export { type OperationsTaskListReorderEntries1 } from "./OperationsTaskListReorderEntries1.mjs";
6
6
  export { type OperationsTaskListsApplyToCaseV1Request } from "./OperationsTaskListsApplyToCaseV1Request.mjs";
@@ -75,6 +75,22 @@ export declare class OrderDrafts {
75
75
  */
76
76
  updateV1(orderId: string, request?: Chrt.shipping.OrdersDraftUpdateReq, requestOptions?: OrderDrafts.RequestOptions): core.HttpResponsePromise<Chrt.OrdersDraftUpdateRes>;
77
77
  private __updateV1;
78
+ /**
79
+ * Sets the ordering of task groups within a draft order. Must provide all task group IDs with no duplicates. | (SetTaskGroupOrderingDraftReq) -> (bool)
80
+ *
81
+ * @param {string} orderId
82
+ * @param {Chrt.shipping.SetTaskGroupOrderingDraftReq} request
83
+ * @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
84
+ *
85
+ * @throws {@link Chrt.UnprocessableEntityError}
86
+ *
87
+ * @example
88
+ * await client.shipping.orderDrafts.setTaskGroupOrderingV1("order_id", {
89
+ * task_group_ids: ["task_group_ids"]
90
+ * })
91
+ */
92
+ setTaskGroupOrderingV1(orderId: string, request: Chrt.shipping.SetTaskGroupOrderingDraftReq, requestOptions?: OrderDrafts.RequestOptions): core.HttpResponsePromise<boolean>;
93
+ private __setTaskGroupOrderingV1;
78
94
  /**
79
95
  * Deletes a draft order and all associated entities. | () -> (bool)
80
96
  *
@@ -174,6 +174,71 @@ export class OrderDrafts {
174
174
  }
175
175
  });
176
176
  }
177
+ /**
178
+ * Sets the ordering of task groups within a draft order. Must provide all task group IDs with no duplicates. | (SetTaskGroupOrderingDraftReq) -> (bool)
179
+ *
180
+ * @param {string} orderId
181
+ * @param {Chrt.shipping.SetTaskGroupOrderingDraftReq} request
182
+ * @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
183
+ *
184
+ * @throws {@link Chrt.UnprocessableEntityError}
185
+ *
186
+ * @example
187
+ * await client.shipping.orderDrafts.setTaskGroupOrderingV1("order_id", {
188
+ * task_group_ids: ["task_group_ids"]
189
+ * })
190
+ */
191
+ setTaskGroupOrderingV1(orderId, request, requestOptions) {
192
+ return core.HttpResponsePromise.fromPromise(this.__setTaskGroupOrderingV1(orderId, request, requestOptions));
193
+ }
194
+ __setTaskGroupOrderingV1(orderId, request, requestOptions) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ var _a, _b, _c, _d;
197
+ 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);
198
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
199
+ 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, `shipping/order_drafts/set_task_group_ordering/v1/${encodeURIComponent(orderId)}`),
200
+ method: "PUT",
201
+ headers: _headers,
202
+ contentType: "application/json",
203
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
204
+ requestType: "json",
205
+ body: request,
206
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
207
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
208
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
209
+ });
210
+ if (_response.ok) {
211
+ return { data: _response.body, rawResponse: _response.rawResponse };
212
+ }
213
+ if (_response.error.reason === "status-code") {
214
+ switch (_response.error.statusCode) {
215
+ case 422:
216
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
217
+ default:
218
+ throw new errors.ChrtError({
219
+ statusCode: _response.error.statusCode,
220
+ body: _response.error.body,
221
+ rawResponse: _response.rawResponse,
222
+ });
223
+ }
224
+ }
225
+ switch (_response.error.reason) {
226
+ case "non-json":
227
+ throw new errors.ChrtError({
228
+ statusCode: _response.error.statusCode,
229
+ body: _response.error.rawBody,
230
+ rawResponse: _response.rawResponse,
231
+ });
232
+ case "timeout":
233
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /shipping/order_drafts/set_task_group_ordering/v1/{order_id}.");
234
+ case "unknown":
235
+ throw new errors.ChrtError({
236
+ message: _response.error.errorMessage,
237
+ rawResponse: _response.rawResponse,
238
+ });
239
+ }
240
+ });
241
+ }
177
242
  /**
178
243
  * Deletes a draft order and all associated entities. | () -> (bool)
179
244
  *
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * task_group_ids: ["task_group_ids"]
8
+ * }
9
+ */
10
+ export interface SetTaskGroupOrderingDraftReq {
11
+ /** Complete list of task group IDs in the desired order */
12
+ task_group_ids: string[];
13
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -1,4 +1,5 @@
1
1
  export { type OrdersNewDraftReq } from "./OrdersNewDraftReq.mjs";
2
2
  export { type OrdersDraftUpdateReq } from "./OrdersDraftUpdateReq.mjs";
3
+ export { type SetTaskGroupOrderingDraftReq } from "./SetTaskGroupOrderingDraftReq.mjs";
3
4
  export { type OrdersDraftDeleteManyReq } from "./OrdersDraftDeleteManyReq.mjs";
4
5
  export { type BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post } from "./BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post.mjs";
@@ -66,6 +66,23 @@ export declare class Cargo {
66
66
  */
67
67
  associateWithTaskV1(request: Chrt.shipping.orderDrafts.OrderDraftAssociateCargoWithTaskReq, requestOptions?: Cargo.RequestOptions): core.HttpResponsePromise<boolean>;
68
68
  private __associateWithTaskV1;
69
+ /**
70
+ * Removes an existing cargo association from a task in a draft order (e.g. when the wrong cargo was selected). | (OrderDraftUnassociateCargoWithTaskReq) -> (bool)
71
+ *
72
+ * @param {Chrt.shipping.orderDrafts.OrderDraftUnassociateCargoWithTaskReq} request
73
+ * @param {Cargo.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link Chrt.UnprocessableEntityError}
76
+ *
77
+ * @example
78
+ * await client.shipping.orderDrafts.cargo.unassociateWithTaskV1({
79
+ * order_id: "order_id",
80
+ * task_id: "task_id",
81
+ * cargo_id: "cargo_id"
82
+ * })
83
+ */
84
+ unassociateWithTaskV1(request: Chrt.shipping.orderDrafts.OrderDraftUnassociateCargoWithTaskReq, requestOptions?: Cargo.RequestOptions): core.HttpResponsePromise<boolean>;
85
+ private __unassociateWithTaskV1;
69
86
  /**
70
87
  * Updates a cargo item in an existing draft order. Validates order is in DRAFT status and owned by caller. | (OrderDraftUpdateCargoReq) -> (PydanticObjectId)
71
88
  *
@@ -153,6 +153,72 @@ export class Cargo {
153
153
  }
154
154
  });
155
155
  }
156
+ /**
157
+ * Removes an existing cargo association from a task in a draft order (e.g. when the wrong cargo was selected). | (OrderDraftUnassociateCargoWithTaskReq) -> (bool)
158
+ *
159
+ * @param {Chrt.shipping.orderDrafts.OrderDraftUnassociateCargoWithTaskReq} request
160
+ * @param {Cargo.RequestOptions} requestOptions - Request-specific configuration.
161
+ *
162
+ * @throws {@link Chrt.UnprocessableEntityError}
163
+ *
164
+ * @example
165
+ * await client.shipping.orderDrafts.cargo.unassociateWithTaskV1({
166
+ * order_id: "order_id",
167
+ * task_id: "task_id",
168
+ * cargo_id: "cargo_id"
169
+ * })
170
+ */
171
+ unassociateWithTaskV1(request, requestOptions) {
172
+ return core.HttpResponsePromise.fromPromise(this.__unassociateWithTaskV1(request, requestOptions));
173
+ }
174
+ __unassociateWithTaskV1(request, requestOptions) {
175
+ return __awaiter(this, void 0, void 0, function* () {
176
+ var _a, _b, _c, _d;
177
+ 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);
178
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
179
+ 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, "shipping/order_drafts/cargo/unassociate_with_task/v1"),
180
+ method: "POST",
181
+ headers: _headers,
182
+ contentType: "application/json",
183
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
184
+ requestType: "json",
185
+ body: request,
186
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
187
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
188
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
189
+ });
190
+ if (_response.ok) {
191
+ return { data: _response.body, rawResponse: _response.rawResponse };
192
+ }
193
+ if (_response.error.reason === "status-code") {
194
+ switch (_response.error.statusCode) {
195
+ case 422:
196
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
197
+ default:
198
+ throw new errors.ChrtError({
199
+ statusCode: _response.error.statusCode,
200
+ body: _response.error.body,
201
+ rawResponse: _response.rawResponse,
202
+ });
203
+ }
204
+ }
205
+ switch (_response.error.reason) {
206
+ case "non-json":
207
+ throw new errors.ChrtError({
208
+ statusCode: _response.error.statusCode,
209
+ body: _response.error.rawBody,
210
+ rawResponse: _response.rawResponse,
211
+ });
212
+ case "timeout":
213
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/order_drafts/cargo/unassociate_with_task/v1.");
214
+ case "unknown":
215
+ throw new errors.ChrtError({
216
+ message: _response.error.errorMessage,
217
+ rawResponse: _response.rawResponse,
218
+ });
219
+ }
220
+ });
221
+ }
156
222
  /**
157
223
  * Updates a cargo item in an existing draft order. Validates order is in DRAFT status and owned by caller. | (OrderDraftUpdateCargoReq) -> (PydanticObjectId)
158
224
  *
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * order_id: "order_id",
8
+ * task_id: "task_id",
9
+ * cargo_id: "cargo_id"
10
+ * }
11
+ */
12
+ export interface OrderDraftUnassociateCargoWithTaskReq {
13
+ order_id: string;
14
+ task_id: string;
15
+ cargo_id: string;
16
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -1,3 +1,4 @@
1
1
  export { type OrderDraftAddCargoReq } from "./OrderDraftAddCargoReq.mjs";
2
2
  export { type OrderDraftAssociateCargoWithTaskReq } from "./OrderDraftAssociateCargoWithTaskReq.mjs";
3
+ export { type OrderDraftUnassociateCargoWithTaskReq } from "./OrderDraftUnassociateCargoWithTaskReq.mjs";
3
4
  export { type OrderDraftUpdateCargoReq } from "./OrderDraftUpdateCargoReq.mjs";
@@ -112,7 +112,7 @@ export declare class TaskGroups {
112
112
  addExecutorV1(taskGroupId: string, request?: Chrt.shipping.AddExecutorReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
113
113
  private __addExecutorV1;
114
114
  /**
115
- * Clears the executor on a task group along with the assigned driver and all PPP/PPD billing attachments, returning the TG to executor-less state. Coordinator-only. PPP/PPD LineItemGroup1 and BillingLedgerPeriod1 documents stay alive (orphaned-but-alive); the (ex-)executor disposes of them via their own routes. SPP is unaffected. | authz_personas=[coordinator_org_operators] | () -> (bool)
115
+ * Clears the executor and assigned driver on a task group. Refuses while PPP or PPD billing is attached; detach billing explicitly first. | authz_personas=[coordinator_org_operators] | () -> (bool)
116
116
  *
117
117
  * @param {string} taskGroupId
118
118
  * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
@@ -346,7 +346,7 @@ export class TaskGroups {
346
346
  });
347
347
  }
348
348
  /**
349
- * Clears the executor on a task group along with the assigned driver and all PPP/PPD billing attachments, returning the TG to executor-less state. Coordinator-only. PPP/PPD LineItemGroup1 and BillingLedgerPeriod1 documents stay alive (orphaned-but-alive); the (ex-)executor disposes of them via their own routes. SPP is unaffected. | authz_personas=[coordinator_org_operators] | () -> (bool)
349
+ * Clears the executor and assigned driver on a task group. Refuses while PPP or PPD billing is attached; detach billing explicitly first. | authz_personas=[coordinator_org_operators] | () -> (bool)
350
350
  *
351
351
  * @param {string} taskGroupId
352
352
  * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * What an entry's `deadline_offset_seconds` is measured from.
6
+ *
7
+ * Resolved in a single forward pass at apply time (see module docstring).
8
+ */
9
+ export type DeadlineAnchorEnum = "from_first_task" | "from_previous_task";
10
+ export declare const DeadlineAnchorEnum: {
11
+ readonly FromFirstTask: "from_first_task";
12
+ readonly FromPreviousTask: "from_previous_task";
13
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export const DeadlineAnchorEnum = {
5
+ FromFirstTask: "from_first_task",
6
+ FromPreviousTask: "from_previous_task",
7
+ };
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as Chrt from "../index.mjs";
5
4
  export interface DepartmentRoutingRule1 {
6
5
  schema_version: number;
7
- counterparty_type: Chrt.RoutingCounterpartyTypeEnum;
8
- counterparty_id: string;
6
+ /** Must be a string starting with `org_` */
7
+ shipper_org_id?: string | null;
8
+ off_chrt_shipper_org_id?: string | null;
9
9
  department_id: string;
10
10
  _id: string;
11
11
  /** Must be a string starting with `org_` */
@@ -7,17 +7,19 @@ import * as Chrt from "../index.mjs";
7
7
  *
8
8
  * Materialized into an `OperationsTask` on apply.
9
9
  *
10
- * `deadline_offset_seconds` is an OPTIONAL absolute offset from apply time, in
11
- * seconds. When set, the materialized task's deadline is
12
- * `apply_time + deadline_offset_seconds`. When left `None` (the default), the
13
- * entry is staggered by its position in the list at a default 20-min cadence:
14
- * the Nth entry (1-based) is due at `apply_time + N * 20min`. An apply-time
15
- * `overall_deadline_timestamp` overrides both.
10
+ * The deadline is computed from (`deadline_anchor`, `deadline_offset_seconds`):
11
+ * `FROM_FIRST_TASK` => the first entry's resolved deadline + offset;
12
+ * `FROM_PREVIOUS_TASK` => the previous entry's resolved deadline + offset (the
13
+ * first entry's "previous" is `apply_time`). The first entry itself anchors to
14
+ * `apply_time` (or the apply-time `initial_deadline_timestamp` pin). Defaults to
15
+ * `FROM_PREVIOUS_TASK` + 1200s, which reproduces the 20-min positional stagger.
16
+ * `deadline_offset_seconds` may be negative.
16
17
  */
17
18
  export interface OperationsTaskListEntry1 {
18
19
  id?: string;
19
20
  task_type: Chrt.OperationsTaskTypeEnum;
20
21
  title: string;
21
22
  description: string;
22
- deadline_offset_seconds?: number | null;
23
+ deadline_anchor?: Chrt.DeadlineAnchorEnum;
24
+ deadline_offset_seconds?: number;
23
25
  }
@@ -5,18 +5,26 @@
5
5
  * Coarse functional buckets a dispatcher batch-processes (powers the
6
6
  * per-type functional-queue index). Granular SOP specifics live in the Task's
7
7
  * `title`/`description` + `tags`, not here.
8
+ *
9
+ * Ordered roughly along the shipment lifecycle (review -> research -> book ->
10
+ * track/verify -> contact -> billing). The buckets are the distinct *modes of
11
+ * work* an operator sits down and batches; the exact SOP step (e.g. "Send
12
+ * Shipping Label", "CBC Call", "Get Pack Time") is captured in the title.
13
+ *
14
+ * Contact is split by *who* (customer, agent, airline, other), not by
15
+ * *channel* (call vs. email) — the recipient is what a dispatcher batches
16
+ * around, and the channel is a title/tag detail.
8
17
  */
9
- export type OperationsTaskTypeEnum = "review_order_details" | "book_cargo" | "dispatch_driver" | "verify_driver_readiness" | "share_instructions" | "monitor_transit" | "monitor_sla" | "call_driver" | "verify_task_artifacts" | "finalize_billing" | "custom" | "other";
18
+ export type OperationsTaskTypeEnum = "review_order_details" | "precheck" | "book_cargo" | "track_and_verify" | "contact_customer" | "contact_agent" | "contact_airline" | "contact_other" | "finalize_billing" | "custom" | "other";
10
19
  export declare const OperationsTaskTypeEnum: {
11
20
  readonly ReviewOrderDetails: "review_order_details";
21
+ readonly Precheck: "precheck";
12
22
  readonly BookCargo: "book_cargo";
13
- readonly DispatchDriver: "dispatch_driver";
14
- readonly VerifyDriverReadiness: "verify_driver_readiness";
15
- readonly ShareInstructions: "share_instructions";
16
- readonly MonitorTransit: "monitor_transit";
17
- readonly MonitorSla: "monitor_sla";
18
- readonly CallDriver: "call_driver";
19
- readonly VerifyTaskArtifacts: "verify_task_artifacts";
23
+ readonly TrackAndVerify: "track_and_verify";
24
+ readonly ContactCustomer: "contact_customer";
25
+ readonly ContactAgent: "contact_agent";
26
+ readonly ContactAirline: "contact_airline";
27
+ readonly ContactOther: "contact_other";
20
28
  readonly FinalizeBilling: "finalize_billing";
21
29
  readonly Custom: "custom";
22
30
  readonly Other: "other";
@@ -3,14 +3,13 @@
3
3
  */
4
4
  export const OperationsTaskTypeEnum = {
5
5
  ReviewOrderDetails: "review_order_details",
6
+ Precheck: "precheck",
6
7
  BookCargo: "book_cargo",
7
- DispatchDriver: "dispatch_driver",
8
- VerifyDriverReadiness: "verify_driver_readiness",
9
- ShareInstructions: "share_instructions",
10
- MonitorTransit: "monitor_transit",
11
- MonitorSla: "monitor_sla",
12
- CallDriver: "call_driver",
13
- VerifyTaskArtifacts: "verify_task_artifacts",
8
+ TrackAndVerify: "track_and_verify",
9
+ ContactCustomer: "contact_customer",
10
+ ContactAgent: "contact_agent",
11
+ ContactAirline: "contact_airline",
12
+ ContactOther: "contact_other",
14
13
  FinalizeBilling: "finalize_billing",
15
14
  Custom: "custom",
16
15
  Other: "other",
@@ -5,4 +5,5 @@ import * as Chrt from "../index.mjs";
5
5
  export interface OrderDraftValidationResult {
6
6
  is_valid: boolean;
7
7
  requirements: Chrt.OrderDraftValidationRequirements;
8
+ issues?: Chrt.ValidationIssue[];
8
9
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.mjs";
5
+ export interface ValidationIssue {
6
+ requirement_key: string;
7
+ scope?: Chrt.ValidationIssueScope | null;
8
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ValidationIssueScope {
5
+ task_group_id?: string | null;
6
+ task_id?: string | null;
7
+ cargo_id?: string | null;
8
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};