@chrt-inc/typescript-sdk 1.293.0 → 1.299.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 (140) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/orders/client/requests/OrdersExpandedReq.d.ts +2 -0
  3. package/dist/cjs/api/resources/taskGroups/client/Client.d.ts +14 -48
  4. package/dist/cjs/api/resources/taskGroups/client/Client.js +18 -185
  5. package/dist/cjs/api/resources/taskGroups/client/requests/index.d.ts +1 -1
  6. package/dist/cjs/api/resources/taskGroups/resources/expanded/client/Client.d.ts +76 -0
  7. package/dist/cjs/api/resources/taskGroups/resources/{full → expanded}/client/Client.js +108 -26
  8. package/dist/cjs/api/resources/taskGroups/resources/expanded/client/requests/TaskGroupExpandedForShipperReq.d.ts +20 -0
  9. package/dist/cjs/api/resources/taskGroups/resources/expanded/client/requests/index.d.ts +1 -0
  10. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/Client.d.ts +90 -0
  11. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/Client.js +326 -0
  12. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/index.d.ts +2 -0
  13. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/index.js +17 -0
  14. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.d.ts +40 -0
  15. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.d.ts +40 -0
  16. package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/requests/index.d.ts +2 -0
  17. package/dist/cjs/api/resources/taskGroups/resources/index.d.ts +4 -3
  18. package/dist/cjs/api/resources/taskGroups/resources/index.js +5 -4
  19. package/dist/cjs/api/types/SortOrderEnum.d.ts +11 -0
  20. package/dist/cjs/api/types/SortOrderEnum.js +10 -0
  21. package/dist/cjs/api/types/TaskExpanded.d.ts +1 -1
  22. package/dist/cjs/api/types/TaskGroup1.d.ts +1 -0
  23. package/dist/cjs/api/types/TaskGroupExpanded.d.ts +2 -6
  24. package/dist/cjs/api/types/TaskGroupExpandedForCourierAdministrator.d.ts +18 -0
  25. package/dist/cjs/api/types/TaskGroupExpandedForCourierAdministratorReq.d.ts +19 -0
  26. package/dist/cjs/api/types/TaskGroupExpandedForCourierDriver.d.ts +18 -0
  27. package/dist/cjs/api/types/TaskGroupExpandedForCourierDriverReq.d.ts +19 -0
  28. package/dist/cjs/api/types/TaskGroupExpandedForShipper.d.ts +18 -0
  29. package/dist/cjs/api/types/TaskGroupExpandedSortFieldEnum.d.ts +12 -0
  30. package/dist/cjs/api/types/TaskGroupExpandedSortFieldEnum.js +11 -0
  31. package/dist/cjs/api/types/TaskGroupsExpandedForCourierAdministratorRes.d.ts +11 -0
  32. package/dist/cjs/api/types/TaskGroupsExpandedForCourierAdministratorRes.js +5 -0
  33. package/dist/cjs/api/types/TaskGroupsExpandedForCourierDriverRes.d.ts +11 -0
  34. package/dist/cjs/api/types/TaskGroupsExpandedForCourierDriverRes.js +5 -0
  35. package/dist/cjs/api/types/index.d.ts +10 -8
  36. package/dist/cjs/api/types/index.js +10 -8
  37. package/dist/cjs/version.d.ts +1 -1
  38. package/dist/cjs/version.js +1 -1
  39. package/dist/esm/Client.mjs +2 -2
  40. package/dist/esm/api/resources/orders/client/requests/OrdersExpandedReq.d.mts +2 -0
  41. package/dist/esm/api/resources/taskGroups/client/Client.d.mts +14 -48
  42. package/dist/esm/api/resources/taskGroups/client/Client.mjs +18 -185
  43. package/dist/esm/api/resources/taskGroups/client/requests/index.d.mts +1 -1
  44. package/dist/esm/api/resources/taskGroups/resources/expanded/client/Client.d.mts +76 -0
  45. package/dist/esm/api/resources/taskGroups/resources/{full → expanded}/client/Client.mjs +106 -24
  46. package/dist/esm/api/resources/taskGroups/resources/expanded/client/requests/TaskGroupExpandedForShipperReq.d.mts +20 -0
  47. package/dist/esm/api/resources/taskGroups/resources/expanded/client/requests/index.d.mts +1 -0
  48. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/Client.d.mts +90 -0
  49. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/Client.mjs +289 -0
  50. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/index.d.mts +2 -0
  51. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/index.mjs +1 -0
  52. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.d.mts +40 -0
  53. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.d.mts +40 -0
  54. package/dist/esm/api/resources/taskGroups/resources/expandedList/client/requests/index.d.mts +2 -0
  55. package/dist/esm/api/resources/taskGroups/resources/index.d.mts +4 -3
  56. package/dist/esm/api/resources/taskGroups/resources/index.mjs +4 -3
  57. package/dist/esm/api/types/SortOrderEnum.d.mts +11 -0
  58. package/dist/esm/api/types/SortOrderEnum.mjs +7 -0
  59. package/dist/esm/api/types/TaskExpanded.d.mts +1 -1
  60. package/dist/esm/api/types/TaskGroup1.d.mts +1 -0
  61. package/dist/esm/api/types/TaskGroupExpanded.d.mts +2 -6
  62. package/dist/esm/api/types/TaskGroupExpandedForCourierAdministrator.d.mts +18 -0
  63. package/dist/esm/api/types/TaskGroupExpandedForCourierAdministratorReq.d.mts +19 -0
  64. package/dist/esm/api/types/TaskGroupExpandedForCourierDriver.d.mts +18 -0
  65. package/dist/esm/api/types/TaskGroupExpandedForCourierDriverReq.d.mts +19 -0
  66. package/dist/esm/api/types/TaskGroupExpandedForShipper.d.mts +18 -0
  67. package/dist/esm/api/types/TaskGroupExpandedSortFieldEnum.d.mts +12 -0
  68. package/dist/esm/api/types/TaskGroupExpandedSortFieldEnum.mjs +8 -0
  69. package/dist/esm/api/types/TaskGroupsExpandedForCourierAdministratorRes.d.mts +11 -0
  70. package/dist/esm/api/types/TaskGroupsExpandedForCourierAdministratorRes.mjs +4 -0
  71. package/dist/esm/api/types/TaskGroupsExpandedForCourierDriverRes.d.mts +11 -0
  72. package/dist/esm/api/types/TaskGroupsExpandedForCourierDriverRes.mjs +4 -0
  73. package/dist/esm/api/types/index.d.mts +10 -8
  74. package/dist/esm/api/types/index.mjs +10 -8
  75. package/dist/esm/version.d.mts +1 -1
  76. package/dist/esm/version.mjs +1 -1
  77. package/package.json +1 -1
  78. package/reference.md +206 -201
  79. package/dist/cjs/api/resources/taskGroups/client/requests/TaskGroupsExpandedReq.d.ts +0 -24
  80. package/dist/cjs/api/resources/taskGroups/resources/full/client/Client.d.ts +0 -57
  81. package/dist/cjs/api/resources/taskGroups/resources/full/client/index.d.ts +0 -1
  82. package/dist/cjs/api/resources/taskGroups/resources/togglePause/client/Client.d.ts +0 -51
  83. package/dist/cjs/api/resources/taskGroups/resources/togglePause/client/Client.js +0 -134
  84. package/dist/cjs/api/resources/taskGroups/resources/togglePause/client/requests/index.d.ts +0 -1
  85. package/dist/cjs/api/types/MultipleTaskGroupsDetailsResponse.d.ts +0 -7
  86. package/dist/cjs/api/types/MultipleTaskGroupsWithTasks.d.ts +0 -7
  87. package/dist/cjs/api/types/TaskGroupDetailsResponse.d.ts +0 -8
  88. package/dist/cjs/api/types/TaskGroupWithDetails.d.ts +0 -8
  89. package/dist/cjs/api/types/TaskGroupWithTasks.d.ts +0 -8
  90. package/dist/cjs/api/types/TaskGroupsExpandedRes.d.ts +0 -10
  91. package/dist/cjs/api/types/TaskWithDetails.d.ts +0 -9
  92. package/dist/esm/api/resources/taskGroups/client/requests/TaskGroupsExpandedReq.d.mts +0 -24
  93. package/dist/esm/api/resources/taskGroups/resources/full/client/Client.d.mts +0 -57
  94. package/dist/esm/api/resources/taskGroups/resources/full/client/index.d.mts +0 -1
  95. package/dist/esm/api/resources/taskGroups/resources/togglePause/client/Client.d.mts +0 -51
  96. package/dist/esm/api/resources/taskGroups/resources/togglePause/client/Client.mjs +0 -97
  97. package/dist/esm/api/resources/taskGroups/resources/togglePause/client/requests/index.d.mts +0 -1
  98. package/dist/esm/api/types/MultipleTaskGroupsDetailsResponse.d.mts +0 -7
  99. package/dist/esm/api/types/MultipleTaskGroupsWithTasks.d.mts +0 -7
  100. package/dist/esm/api/types/TaskGroupDetailsResponse.d.mts +0 -8
  101. package/dist/esm/api/types/TaskGroupWithDetails.d.mts +0 -8
  102. package/dist/esm/api/types/TaskGroupWithTasks.d.mts +0 -8
  103. package/dist/esm/api/types/TaskGroupsExpandedRes.d.mts +0 -10
  104. package/dist/esm/api/types/TaskWithDetails.d.mts +0 -9
  105. /package/dist/cjs/api/resources/taskGroups/{resources/togglePause/client → client}/requests/SetTaskGroupPauseReq.d.ts +0 -0
  106. /package/dist/cjs/api/resources/taskGroups/{resources/togglePause/client → client}/requests/SetTaskGroupPauseReq.js +0 -0
  107. /package/dist/cjs/api/resources/taskGroups/resources/{togglePause → expanded}/client/index.d.ts +0 -0
  108. /package/dist/cjs/api/resources/taskGroups/resources/{togglePause → expanded}/client/index.js +0 -0
  109. /package/dist/cjs/api/resources/taskGroups/{client/requests/TaskGroupsExpandedReq.js → resources/expanded/client/requests/TaskGroupExpandedForShipperReq.js} +0 -0
  110. /package/dist/cjs/api/resources/taskGroups/resources/{full/client → expanded/client/requests}/index.js +0 -0
  111. /package/dist/cjs/api/resources/taskGroups/resources/{full → expanded}/index.d.ts +0 -0
  112. /package/dist/cjs/api/resources/taskGroups/resources/{full → expanded}/index.js +0 -0
  113. /package/dist/cjs/api/{types/MultipleTaskGroupsDetailsResponse.js → resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.js} +0 -0
  114. /package/dist/cjs/api/{types/MultipleTaskGroupsWithTasks.js → resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.js} +0 -0
  115. /package/dist/cjs/api/resources/taskGroups/resources/{togglePause → expandedList}/client/requests/index.js +0 -0
  116. /package/dist/cjs/api/resources/taskGroups/resources/{togglePause → expandedList}/index.d.ts +0 -0
  117. /package/dist/cjs/api/resources/taskGroups/resources/{togglePause → expandedList}/index.js +0 -0
  118. /package/dist/cjs/api/types/{TaskGroupDetailsResponse.js → TaskGroupExpandedForCourierAdministrator.js} +0 -0
  119. /package/dist/cjs/api/types/{TaskGroupWithDetails.js → TaskGroupExpandedForCourierAdministratorReq.js} +0 -0
  120. /package/dist/cjs/api/types/{TaskGroupWithTasks.js → TaskGroupExpandedForCourierDriver.js} +0 -0
  121. /package/dist/cjs/api/types/{TaskGroupsExpandedRes.js → TaskGroupExpandedForCourierDriverReq.js} +0 -0
  122. /package/dist/cjs/api/types/{TaskWithDetails.js → TaskGroupExpandedForShipper.js} +0 -0
  123. /package/dist/esm/api/resources/taskGroups/{resources/togglePause/client → client}/requests/SetTaskGroupPauseReq.d.mts +0 -0
  124. /package/dist/esm/api/resources/taskGroups/{resources/togglePause/client → client}/requests/SetTaskGroupPauseReq.mjs +0 -0
  125. /package/dist/esm/api/resources/taskGroups/resources/{togglePause → expanded}/client/index.d.mts +0 -0
  126. /package/dist/esm/api/resources/taskGroups/resources/{togglePause → expanded}/client/index.mjs +0 -0
  127. /package/dist/esm/api/resources/taskGroups/{client/requests/TaskGroupsExpandedReq.mjs → resources/expanded/client/requests/TaskGroupExpandedForShipperReq.mjs} +0 -0
  128. /package/dist/esm/api/resources/taskGroups/resources/{full/client → expanded/client/requests}/index.mjs +0 -0
  129. /package/dist/esm/api/resources/taskGroups/resources/{full → expanded}/index.d.mts +0 -0
  130. /package/dist/esm/api/resources/taskGroups/resources/{full → expanded}/index.mjs +0 -0
  131. /package/dist/esm/api/{types/MultipleTaskGroupsDetailsResponse.mjs → resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.mjs} +0 -0
  132. /package/dist/esm/api/{types/MultipleTaskGroupsWithTasks.mjs → resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.mjs} +0 -0
  133. /package/dist/esm/api/resources/taskGroups/resources/{togglePause → expandedList}/client/requests/index.mjs +0 -0
  134. /package/dist/esm/api/resources/taskGroups/resources/{togglePause → expandedList}/index.d.mts +0 -0
  135. /package/dist/esm/api/resources/taskGroups/resources/{togglePause → expandedList}/index.mjs +0 -0
  136. /package/dist/esm/api/types/{TaskGroupDetailsResponse.mjs → TaskGroupExpandedForCourierAdministrator.mjs} +0 -0
  137. /package/dist/esm/api/types/{TaskGroupWithDetails.mjs → TaskGroupExpandedForCourierAdministratorReq.mjs} +0 -0
  138. /package/dist/esm/api/types/{TaskGroupWithTasks.mjs → TaskGroupExpandedForCourierDriver.mjs} +0 -0
  139. /package/dist/esm/api/types/{TaskGroupsExpandedRes.mjs → TaskGroupExpandedForCourierDriverReq.mjs} +0 -0
  140. /package/dist/esm/api/types/{TaskWithDetails.mjs → TaskGroupExpandedForShipper.mjs} +0 -0
@@ -68,8 +68,8 @@ class ChrtClient {
68
68
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
69
69
  "X-Fern-Language": "JavaScript",
70
70
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
71
- "X-Fern-SDK-Version": "1.293.0",
72
- "User-Agent": "@chrt-inc/typescript-sdk/1.293.0",
71
+ "X-Fern-SDK-Version": "1.299.0",
72
+ "User-Agent": "@chrt-inc/typescript-sdk/1.299.0",
73
73
  "X-Fern-Runtime": core.RUNTIME.type,
74
74
  "X-Fern-Runtime-Version": core.RUNTIME.version,
75
75
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -14,4 +14,6 @@ export interface OrdersExpandedReq {
14
14
  expand_milestones?: boolean;
15
15
  expand_cargos?: boolean;
16
16
  expand_shipper_contact_infos?: boolean;
17
+ expand_courier_org_company_name?: boolean;
18
+ expand_courier_org_company_handle?: boolean;
17
19
  }
@@ -4,8 +4,8 @@
4
4
  import * as environments from "../../../../environments.js";
5
5
  import * as core from "../../../../core/index.js";
6
6
  import * as Chrt from "../../../index.js";
7
- import { Full } from "../resources/full/client/Client.js";
8
- import { TogglePause } from "../resources/togglePause/client/Client.js";
7
+ import { Expanded } from "../resources/expanded/client/Client.js";
8
+ import { ExpandedList } from "../resources/expandedList/client/Client.js";
9
9
  export declare namespace TaskGroups {
10
10
  interface Options {
11
11
  environment?: core.Supplier<environments.ChrtEnvironment | string>;
@@ -31,34 +31,11 @@ export declare namespace TaskGroups {
31
31
  }
32
32
  export declare class TaskGroups {
33
33
  protected readonly _options: TaskGroups.Options;
34
- protected _full: Full | undefined;
35
- protected _togglePause: TogglePause | undefined;
34
+ protected _expanded: Expanded | undefined;
35
+ protected _expandedList: ExpandedList | undefined;
36
36
  constructor(_options?: TaskGroups.Options);
37
- get full(): Full;
38
- get togglePause(): TogglePause;
39
- /**
40
- * Lists all task groups assigned to the authenticated courier organization with their associated tasks.
41
- *
42
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
43
- *
44
- * @example
45
- * await client.taskGroups.listByCourierOrgIdV1()
46
- */
47
- listByCourierOrgIdV1(requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.MultipleTaskGroupsWithTasks>;
48
- private __listByCourierOrgIdV1;
49
- /**
50
- * Retrieves a specific task group by ID with its associated tasks.
51
- *
52
- * @param {string} id
53
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
54
- *
55
- * @throws {@link Chrt.UnprocessableEntityError}
56
- *
57
- * @example
58
- * await client.taskGroups.getByIdV1("id")
59
- */
60
- getByIdV1(id: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupWithTasks>;
61
- private __getByIdV1;
37
+ get expanded(): Expanded;
38
+ get expandedList(): ExpandedList;
62
39
  /**
63
40
  * Updates task group driver assignments by adding or removing drivers.
64
41
  *
@@ -74,19 +51,6 @@ export declare class TaskGroups {
74
51
  */
75
52
  updateV1(request: Chrt.UpdateTaskGroupReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.UpdateTaskGroupRes>;
76
53
  private __updateV1;
77
- /**
78
- * Lists all task groups assigned to a specific driver.
79
- *
80
- * @param {string} driverId
81
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
82
- *
83
- * @throws {@link Chrt.UnprocessableEntityError}
84
- *
85
- * @example
86
- * await client.taskGroups.listByDriverIdV1("driver_id")
87
- */
88
- listByDriverIdV1(driverId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroup1[]>;
89
- private __listByDriverIdV1;
90
54
  /**
91
55
  * Starts a task group by changing its status to in-progress and updating the order status.
92
56
  *
@@ -101,19 +65,21 @@ export declare class TaskGroups {
101
65
  startV1(id: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
102
66
  private __startV1;
103
67
  /**
104
- * Fetches task groups by driver with optional expanded data for tasks, milestones, cargo, and payment information.
68
+ * Toggles the pause status of an in-progress task group.
105
69
  *
106
- * @param {Chrt.TaskGroupsExpandedReq} request
70
+ * @param {string} id
71
+ * @param {Chrt.SetTaskGroupPauseReq} request
107
72
  * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
108
73
  *
109
74
  * @throws {@link Chrt.UnprocessableEntityError}
110
75
  *
111
76
  * @example
112
- * await client.taskGroups.postByDriverExpandedV1({
113
- * task_group_statuses: ["not_started"]
77
+ * await client.taskGroups.togglePauseV1("id", {
78
+ * task_group_id: "task_group_id",
79
+ * paused: true
114
80
  * })
115
81
  */
116
- postByDriverExpandedV1(request: Chrt.TaskGroupsExpandedReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupsExpandedRes>;
117
- private __postByDriverExpandedV1;
82
+ togglePauseV1(id: string, request: Chrt.SetTaskGroupPauseReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
83
+ private __togglePauseV1;
118
84
  protected _getAuthorizationHeader(): Promise<string | undefined>;
119
85
  }
@@ -51,129 +51,19 @@ const core = __importStar(require("../../../../core/index.js"));
51
51
  const Chrt = __importStar(require("../../../index.js"));
52
52
  const headers_js_1 = require("../../../../core/headers.js");
53
53
  const errors = __importStar(require("../../../../errors/index.js"));
54
- const Client_js_1 = require("../resources/full/client/Client.js");
55
- const Client_js_2 = require("../resources/togglePause/client/Client.js");
54
+ const Client_js_1 = require("../resources/expanded/client/Client.js");
55
+ const Client_js_2 = require("../resources/expandedList/client/Client.js");
56
56
  class TaskGroups {
57
57
  constructor(_options = {}) {
58
58
  this._options = _options;
59
59
  }
60
- get full() {
60
+ get expanded() {
61
61
  var _a;
62
- return ((_a = this._full) !== null && _a !== void 0 ? _a : (this._full = new Client_js_1.Full(this._options)));
62
+ return ((_a = this._expanded) !== null && _a !== void 0 ? _a : (this._expanded = new Client_js_1.Expanded(this._options)));
63
63
  }
64
- get togglePause() {
64
+ get expandedList() {
65
65
  var _a;
66
- return ((_a = this._togglePause) !== null && _a !== void 0 ? _a : (this._togglePause = new Client_js_2.TogglePause(this._options)));
67
- }
68
- /**
69
- * Lists all task groups assigned to the authenticated courier organization with their associated tasks.
70
- *
71
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
72
- *
73
- * @example
74
- * await client.taskGroups.listByCourierOrgIdV1()
75
- */
76
- listByCourierOrgIdV1(requestOptions) {
77
- return core.HttpResponsePromise.fromPromise(this.__listByCourierOrgIdV1(requestOptions));
78
- }
79
- __listByCourierOrgIdV1(requestOptions) {
80
- return __awaiter(this, void 0, void 0, function* () {
81
- var _a, _b, _c, _d;
82
- 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);
83
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
84
- 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, "oort/task_groups/by_courier_org_id/list/v1"),
85
- method: "GET",
86
- headers: _headers,
87
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
88
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
89
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
90
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
91
- });
92
- if (_response.ok) {
93
- return { data: _response.body, rawResponse: _response.rawResponse };
94
- }
95
- if (_response.error.reason === "status-code") {
96
- throw new errors.ChrtError({
97
- statusCode: _response.error.statusCode,
98
- body: _response.error.body,
99
- rawResponse: _response.rawResponse,
100
- });
101
- }
102
- switch (_response.error.reason) {
103
- case "non-json":
104
- throw new errors.ChrtError({
105
- statusCode: _response.error.statusCode,
106
- body: _response.error.rawBody,
107
- rawResponse: _response.rawResponse,
108
- });
109
- case "timeout":
110
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/by_courier_org_id/list/v1.");
111
- case "unknown":
112
- throw new errors.ChrtError({
113
- message: _response.error.errorMessage,
114
- rawResponse: _response.rawResponse,
115
- });
116
- }
117
- });
118
- }
119
- /**
120
- * Retrieves a specific task group by ID with its associated tasks.
121
- *
122
- * @param {string} id
123
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
124
- *
125
- * @throws {@link Chrt.UnprocessableEntityError}
126
- *
127
- * @example
128
- * await client.taskGroups.getByIdV1("id")
129
- */
130
- getByIdV1(id, requestOptions) {
131
- return core.HttpResponsePromise.fromPromise(this.__getByIdV1(id, requestOptions));
132
- }
133
- __getByIdV1(id, requestOptions) {
134
- return __awaiter(this, void 0, void 0, function* () {
135
- var _a, _b, _c, _d;
136
- 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);
137
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
138
- 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, `oort/task_groups/v1/${encodeURIComponent(id)}`),
139
- method: "GET",
140
- headers: _headers,
141
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
142
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
143
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
144
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
145
- });
146
- if (_response.ok) {
147
- return { data: _response.body, rawResponse: _response.rawResponse };
148
- }
149
- if (_response.error.reason === "status-code") {
150
- switch (_response.error.statusCode) {
151
- case 422:
152
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
153
- default:
154
- throw new errors.ChrtError({
155
- statusCode: _response.error.statusCode,
156
- body: _response.error.body,
157
- rawResponse: _response.rawResponse,
158
- });
159
- }
160
- }
161
- switch (_response.error.reason) {
162
- case "non-json":
163
- throw new errors.ChrtError({
164
- statusCode: _response.error.statusCode,
165
- body: _response.error.rawBody,
166
- rawResponse: _response.rawResponse,
167
- });
168
- case "timeout":
169
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/v1/{id}.");
170
- case "unknown":
171
- throw new errors.ChrtError({
172
- message: _response.error.errorMessage,
173
- rawResponse: _response.rawResponse,
174
- });
175
- }
176
- });
66
+ return ((_a = this._expandedList) !== null && _a !== void 0 ? _a : (this._expandedList = new Client_js_2.ExpandedList(this._options)));
177
67
  }
178
68
  /**
179
69
  * Updates task group driver assignments by adding or removing drivers.
@@ -239,65 +129,6 @@ class TaskGroups {
239
129
  }
240
130
  });
241
131
  }
242
- /**
243
- * Lists all task groups assigned to a specific driver.
244
- *
245
- * @param {string} driverId
246
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
247
- *
248
- * @throws {@link Chrt.UnprocessableEntityError}
249
- *
250
- * @example
251
- * await client.taskGroups.listByDriverIdV1("driver_id")
252
- */
253
- listByDriverIdV1(driverId, requestOptions) {
254
- return core.HttpResponsePromise.fromPromise(this.__listByDriverIdV1(driverId, requestOptions));
255
- }
256
- __listByDriverIdV1(driverId, requestOptions) {
257
- return __awaiter(this, void 0, void 0, function* () {
258
- var _a, _b, _c, _d;
259
- 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);
260
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
261
- 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, `oort/task_groups/list/v1/${encodeURIComponent(driverId)}`),
262
- method: "GET",
263
- headers: _headers,
264
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
265
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
266
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
267
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
268
- });
269
- if (_response.ok) {
270
- return { data: _response.body, rawResponse: _response.rawResponse };
271
- }
272
- if (_response.error.reason === "status-code") {
273
- switch (_response.error.statusCode) {
274
- case 422:
275
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
276
- default:
277
- throw new errors.ChrtError({
278
- statusCode: _response.error.statusCode,
279
- body: _response.error.body,
280
- rawResponse: _response.rawResponse,
281
- });
282
- }
283
- }
284
- switch (_response.error.reason) {
285
- case "non-json":
286
- throw new errors.ChrtError({
287
- statusCode: _response.error.statusCode,
288
- body: _response.error.rawBody,
289
- rawResponse: _response.rawResponse,
290
- });
291
- case "timeout":
292
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/list/v1/{driver_id}.");
293
- case "unknown":
294
- throw new errors.ChrtError({
295
- message: _response.error.errorMessage,
296
- rawResponse: _response.rawResponse,
297
- });
298
- }
299
- });
300
- }
301
132
  /**
302
133
  * Starts a task group by changing its status to in-progress and updating the order status.
303
134
  *
@@ -358,28 +189,30 @@ class TaskGroups {
358
189
  });
359
190
  }
360
191
  /**
361
- * Fetches task groups by driver with optional expanded data for tasks, milestones, cargo, and payment information.
192
+ * Toggles the pause status of an in-progress task group.
362
193
  *
363
- * @param {Chrt.TaskGroupsExpandedReq} request
194
+ * @param {string} id
195
+ * @param {Chrt.SetTaskGroupPauseReq} request
364
196
  * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
365
197
  *
366
198
  * @throws {@link Chrt.UnprocessableEntityError}
367
199
  *
368
200
  * @example
369
- * await client.taskGroups.postByDriverExpandedV1({
370
- * task_group_statuses: ["not_started"]
201
+ * await client.taskGroups.togglePauseV1("id", {
202
+ * task_group_id: "task_group_id",
203
+ * paused: true
371
204
  * })
372
205
  */
373
- postByDriverExpandedV1(request, requestOptions) {
374
- return core.HttpResponsePromise.fromPromise(this.__postByDriverExpandedV1(request, requestOptions));
206
+ togglePauseV1(id, request, requestOptions) {
207
+ return core.HttpResponsePromise.fromPromise(this.__togglePauseV1(id, request, requestOptions));
375
208
  }
376
- __postByDriverExpandedV1(request, requestOptions) {
209
+ __togglePauseV1(id, request, requestOptions) {
377
210
  return __awaiter(this, void 0, void 0, function* () {
378
211
  var _a, _b, _c, _d;
379
212
  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);
380
213
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
381
- 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, "oort/task_groups/by_driver/expanded/v1"),
382
- method: "POST",
214
+ 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, `oort/task_groups/toggle_pause/v1/${encodeURIComponent(id)}`),
215
+ method: "PUT",
383
216
  headers: _headers,
384
217
  contentType: "application/json",
385
218
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -412,7 +245,7 @@ class TaskGroups {
412
245
  rawResponse: _response.rawResponse,
413
246
  });
414
247
  case "timeout":
415
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/by_driver/expanded/v1.");
248
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /oort/task_groups/toggle_pause/v1/{id}.");
416
249
  case "unknown":
417
250
  throw new errors.ChrtError({
418
251
  message: _response.error.errorMessage,
@@ -1,2 +1,2 @@
1
1
  export { type UpdateTaskGroupReq } from "./UpdateTaskGroupReq.js";
2
- export { type TaskGroupsExpandedReq } from "./TaskGroupsExpandedReq.js";
2
+ export { type SetTaskGroupPauseReq } from "./SetTaskGroupPauseReq.js";
@@ -0,0 +1,76 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../environments.js";
5
+ import * as core from "../../../../../../core/index.js";
6
+ import * as Chrt from "../../../../../index.js";
7
+ export declare namespace Expanded {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.ChrtEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ token?: core.Supplier<core.BearerToken | undefined>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
+ fetcher?: core.FetchFunction;
16
+ }
17
+ interface RequestOptions {
18
+ /** The maximum time to wait for a response in seconds. */
19
+ timeoutInSeconds?: number;
20
+ /** The number of times to retry the request. Defaults to 2. */
21
+ maxRetries?: number;
22
+ /** A hook to abort the request. */
23
+ abortSignal?: AbortSignal;
24
+ /** Additional query string parameters to include in the request. */
25
+ queryParams?: Record<string, unknown>;
26
+ /** Additional headers to include in the request. */
27
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
+ }
29
+ }
30
+ export declare class Expanded {
31
+ protected readonly _options: Expanded.Options;
32
+ constructor(_options?: Expanded.Options);
33
+ /**
34
+ * Fetches an expanded task group for the courier org with expanded related data.
35
+ *
36
+ * @param {string} id
37
+ * @param {Chrt.TaskGroupExpandedForCourierAdministratorReq} request
38
+ * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link Chrt.UnprocessableEntityError}
41
+ *
42
+ * @example
43
+ * await client.taskGroups.expanded.forCourierAdministratorByIdV1("id", {})
44
+ */
45
+ forCourierAdministratorByIdV1(id: string, request: Chrt.TaskGroupExpandedForCourierAdministratorReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpandedForCourierAdministrator>;
46
+ private __forCourierAdministratorByIdV1;
47
+ /**
48
+ * Fetches an expanded task group assigned to a courier driver with optional expanded related data.
49
+ *
50
+ * @param {string} id
51
+ * @param {Chrt.TaskGroupExpandedForCourierDriverReq} request
52
+ * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
53
+ *
54
+ * @throws {@link Chrt.UnprocessableEntityError}
55
+ *
56
+ * @example
57
+ * await client.taskGroups.expanded.forCourierDriverByIdV1("id", {})
58
+ */
59
+ forCourierDriverByIdV1(id: string, request: Chrt.TaskGroupExpandedForCourierDriverReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpandedForCourierDriver>;
60
+ private __forCourierDriverByIdV1;
61
+ /**
62
+ * Fetches an expanded task group for the shipper org with expanded related data.
63
+ *
64
+ * @param {string} id
65
+ * @param {Chrt.taskGroups.TaskGroupExpandedForShipperReq} request
66
+ * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
67
+ *
68
+ * @throws {@link Chrt.UnprocessableEntityError}
69
+ *
70
+ * @example
71
+ * await client.taskGroups.expanded.forShipperByIdV1("id")
72
+ */
73
+ forShipperByIdV1(id: string, request?: Chrt.taskGroups.TaskGroupExpandedForShipperReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpandedForShipper>;
74
+ private __forShipperByIdV1;
75
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
76
+ }