@chrt-inc/typescript-sdk 1.685.0 → 1.691.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 (52) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/Client.d.ts +14 -0
  3. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/Client.js +63 -0
  4. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/requests/OrderDraftAddTaskGroupReq.d.ts +1 -0
  5. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/requests/SetVehicleTypeReq.d.ts +12 -0
  6. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/requests/SetVehicleTypeReq.js +5 -0
  7. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/requests/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/shipping/resources/tasks/client/Client.d.ts +69 -2
  9. package/dist/cjs/api/resources/shipping/resources/tasks/client/Client.js +308 -5
  10. package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/AttemptTaskReq.d.ts +11 -0
  11. package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/AttemptTaskReq.js +5 -0
  12. package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.d.ts +12 -0
  13. package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.js +5 -0
  14. package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/index.d.ts +2 -0
  15. package/dist/cjs/api/types/Driver1.d.ts +1 -0
  16. package/dist/cjs/api/types/Task1.d.ts +7 -0
  17. package/dist/cjs/api/types/TaskClientCreate1.d.ts +1 -0
  18. package/dist/cjs/api/types/TaskGroup1.d.ts +2 -0
  19. package/dist/cjs/api/types/TaskGroupManifest1.d.ts +1 -0
  20. package/dist/cjs/api/types/TaskWaitTimeGeofenceRes.d.ts +9 -0
  21. package/dist/cjs/api/types/TaskWaitTimeGeofenceRes.js +5 -0
  22. package/dist/cjs/api/types/index.d.ts +1 -0
  23. package/dist/cjs/api/types/index.js +1 -0
  24. package/dist/cjs/version.d.ts +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/esm/Client.mjs +2 -2
  27. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/Client.d.mts +14 -0
  28. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/Client.mjs +63 -0
  29. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/requests/OrderDraftAddTaskGroupReq.d.mts +1 -0
  30. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/requests/SetVehicleTypeReq.d.mts +12 -0
  31. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/requests/SetVehicleTypeReq.mjs +4 -0
  32. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/requests/index.d.mts +1 -0
  33. package/dist/esm/api/resources/shipping/resources/tasks/client/Client.d.mts +69 -2
  34. package/dist/esm/api/resources/shipping/resources/tasks/client/Client.mjs +308 -5
  35. package/dist/esm/api/resources/shipping/resources/tasks/client/requests/AttemptTaskReq.d.mts +11 -0
  36. package/dist/esm/api/resources/shipping/resources/tasks/client/requests/AttemptTaskReq.mjs +4 -0
  37. package/dist/esm/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.d.mts +12 -0
  38. package/dist/esm/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.mjs +4 -0
  39. package/dist/esm/api/resources/shipping/resources/tasks/client/requests/index.d.mts +2 -0
  40. package/dist/esm/api/types/Driver1.d.mts +1 -0
  41. package/dist/esm/api/types/Task1.d.mts +7 -0
  42. package/dist/esm/api/types/TaskClientCreate1.d.mts +1 -0
  43. package/dist/esm/api/types/TaskGroup1.d.mts +2 -0
  44. package/dist/esm/api/types/TaskGroupManifest1.d.mts +1 -0
  45. package/dist/esm/api/types/TaskWaitTimeGeofenceRes.d.mts +9 -0
  46. package/dist/esm/api/types/TaskWaitTimeGeofenceRes.mjs +4 -0
  47. package/dist/esm/api/types/index.d.mts +1 -0
  48. package/dist/esm/api/types/index.mjs +1 -0
  49. package/dist/esm/version.d.mts +1 -1
  50. package/dist/esm/version.mjs +1 -1
  51. package/package.json +1 -1
  52. package/reference.md +404 -2
@@ -56,8 +56,8 @@ class ChrtClient {
56
56
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
57
57
  "X-Fern-Language": "JavaScript",
58
58
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
59
- "X-Fern-SDK-Version": "1.685.0",
60
- "User-Agent": "@chrt-inc/typescript-sdk/1.685.0",
59
+ "X-Fern-SDK-Version": "1.691.0",
60
+ "User-Agent": "@chrt-inc/typescript-sdk/1.691.0",
61
61
  "X-Fern-Runtime": core.RUNTIME.type,
62
62
  "X-Fern-Runtime-Version": core.RUNTIME.version,
63
63
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -60,6 +60,20 @@ export declare class TaskGroup {
60
60
  */
61
61
  setFlightInfoV1(taskGroupId: string, request: Chrt.SetFlightInfoReq, requestOptions?: TaskGroup.RequestOptions): core.HttpResponsePromise<boolean>;
62
62
  private __setFlightInfoV1;
63
+ /**
64
+ * Sets the vehicle type on a draft task group. | authz_personas=[draft_creator_org_operator] | (SetVehicleTypeReq) -> (bool)
65
+ *
66
+ * @param {string} taskGroupId
67
+ * @param {Chrt.shipping.orderDrafts.SetVehicleTypeReq} request
68
+ * @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
69
+ *
70
+ * @throws {@link Chrt.UnprocessableEntityError}
71
+ *
72
+ * @example
73
+ * await client.shipping.orderDrafts.taskGroup.setVehicleTypeV1("task_group_id")
74
+ */
75
+ setVehicleTypeV1(taskGroupId: string, request?: Chrt.shipping.orderDrafts.SetVehicleTypeReq, requestOptions?: TaskGroup.RequestOptions): core.HttpResponsePromise<boolean>;
76
+ private __setVehicleTypeV1;
63
77
  /**
64
78
  * Sets the ordering of tasks within a draft task group. Must provide all task IDs with no duplicates. | (SetTaskOrderingDraftReq) -> (bool)
65
79
  *
@@ -183,6 +183,69 @@ class TaskGroup {
183
183
  }
184
184
  });
185
185
  }
186
+ /**
187
+ * Sets the vehicle type on a draft task group. | authz_personas=[draft_creator_org_operator] | (SetVehicleTypeReq) -> (bool)
188
+ *
189
+ * @param {string} taskGroupId
190
+ * @param {Chrt.shipping.orderDrafts.SetVehicleTypeReq} request
191
+ * @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
192
+ *
193
+ * @throws {@link Chrt.UnprocessableEntityError}
194
+ *
195
+ * @example
196
+ * await client.shipping.orderDrafts.taskGroup.setVehicleTypeV1("task_group_id")
197
+ */
198
+ setVehicleTypeV1(taskGroupId, request = {}, requestOptions) {
199
+ return core.HttpResponsePromise.fromPromise(this.__setVehicleTypeV1(taskGroupId, request, requestOptions));
200
+ }
201
+ __setVehicleTypeV1(taskGroupId_1) {
202
+ return __awaiter(this, arguments, void 0, function* (taskGroupId, request = {}, requestOptions) {
203
+ var _a, _b, _c, _d;
204
+ 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);
205
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
206
+ 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/task_group/set_vehicle_type/v1/${encodeURIComponent(taskGroupId)}`),
207
+ method: "PATCH",
208
+ headers: _headers,
209
+ contentType: "application/json",
210
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
211
+ requestType: "json",
212
+ body: request,
213
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
214
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
215
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
216
+ });
217
+ if (_response.ok) {
218
+ return { data: _response.body, rawResponse: _response.rawResponse };
219
+ }
220
+ if (_response.error.reason === "status-code") {
221
+ switch (_response.error.statusCode) {
222
+ case 422:
223
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
224
+ default:
225
+ throw new errors.ChrtError({
226
+ statusCode: _response.error.statusCode,
227
+ body: _response.error.body,
228
+ rawResponse: _response.rawResponse,
229
+ });
230
+ }
231
+ }
232
+ switch (_response.error.reason) {
233
+ case "non-json":
234
+ throw new errors.ChrtError({
235
+ statusCode: _response.error.statusCode,
236
+ body: _response.error.rawBody,
237
+ rawResponse: _response.rawResponse,
238
+ });
239
+ case "timeout":
240
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /shipping/order_drafts/task_group/set_vehicle_type/v1/{task_group_id}.");
241
+ case "unknown":
242
+ throw new errors.ChrtError({
243
+ message: _response.error.errorMessage,
244
+ rawResponse: _response.rawResponse,
245
+ });
246
+ }
247
+ });
248
+ }
186
249
  /**
187
250
  * Sets the ordering of tasks within a draft task group. Must provide all task IDs with no duplicates. | (SetTaskOrderingDraftReq) -> (bool)
188
251
  *
@@ -13,4 +13,5 @@ export interface OrderDraftAddTaskGroupReq {
13
13
  task_group_type: Chrt.TaskGroupTypeEnum1;
14
14
  order_id: string;
15
15
  order_schedule_template_path?: string | null;
16
+ vehicle_type?: Chrt.VehicleTypeEnum | null;
16
17
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {}
8
+ */
9
+ export interface SetVehicleTypeReq {
10
+ vehicle_type?: Chrt.VehicleTypeEnum | null;
11
+ vehicle_type__set_to_None?: boolean;
12
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
1
  export { type OrderDraftAddTaskGroupReq } from "./OrderDraftAddTaskGroupReq.js";
2
+ export { type SetVehicleTypeReq } from "./SetVehicleTypeReq.js";
2
3
  export { type SetTaskOrderingDraftReq } from "./SetTaskOrderingDraftReq.js";
3
4
  export { type SetRateSheetsReq } from "./SetRateSheetsReq.js";
@@ -33,6 +33,72 @@ export declare class Tasks {
33
33
  protected _executorOrgNotes: ExecutorOrgNotes | undefined;
34
34
  constructor(_options?: Tasks.Options);
35
35
  get executorOrgNotes(): ExecutorOrgNotes;
36
+ /**
37
+ * Checks whether the assigned driver's available location is inside the task wait-time geofence. | authz_personas=[driver_for_executor, executor_org_operators] | () -> (TaskWaitTimeGeofenceRes)
38
+ *
39
+ * @param {string} taskId
40
+ * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
41
+ *
42
+ * @throws {@link Chrt.UnprocessableEntityError}
43
+ *
44
+ * @example
45
+ * await client.shipping.tasks.waitTimeGeofenceV1("task_id")
46
+ */
47
+ waitTimeGeofenceV1(taskId: string, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<Chrt.TaskWaitTimeGeofenceRes>;
48
+ private __waitTimeGeofenceV1;
49
+ /**
50
+ * Starts wait time for a task and records whether the assigned driver's available location is inside the geofence. | authz_personas=[driver_for_executor, executor_org_operators] | () -> (bool)
51
+ *
52
+ * @param {string} taskId
53
+ * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
54
+ *
55
+ * @throws {@link Chrt.UnprocessableEntityError}
56
+ *
57
+ * @example
58
+ * await client.shipping.tasks.waitTimeStartV1("task_id")
59
+ */
60
+ waitTimeStartV1(taskId: string, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<boolean>;
61
+ private __waitTimeStartV1;
62
+ /**
63
+ * Ends an active wait-time session for a task. | authz_personas=[driver_for_executor, executor_org_operators] | () -> (bool)
64
+ *
65
+ * @param {string} taskId
66
+ * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
67
+ *
68
+ * @throws {@link Chrt.UnprocessableEntityError}
69
+ *
70
+ * @example
71
+ * await client.shipping.tasks.waitTimeEndV1("task_id")
72
+ */
73
+ waitTimeEndV1(taskId: string, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<boolean>;
74
+ private __waitTimeEndV1;
75
+ /**
76
+ * Validates wait time for a task. | authz_personas=[executor_org_operators] | () -> (bool)
77
+ *
78
+ * @param {string} taskId
79
+ * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
80
+ *
81
+ * @throws {@link Chrt.UnprocessableEntityError}
82
+ *
83
+ * @example
84
+ * await client.shipping.tasks.waitTimeValidateV1("task_id")
85
+ */
86
+ waitTimeValidateV1(taskId: string, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<boolean>;
87
+ private __waitTimeValidateV1;
88
+ /**
89
+ * Overrides wait-time timestamps or geofence distance for a task. | authz_personas=[executor_org_operators] | (WaitTimeOverrideReq) -> (bool)
90
+ *
91
+ * @param {string} taskId
92
+ * @param {Chrt.shipping.WaitTimeOverrideReq} request
93
+ * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
94
+ *
95
+ * @throws {@link Chrt.UnprocessableEntityError}
96
+ *
97
+ * @example
98
+ * await client.shipping.tasks.waitTimeOverrideV1("task_id")
99
+ */
100
+ waitTimeOverrideV1(taskId: string, request?: Chrt.shipping.WaitTimeOverrideReq, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<boolean>;
101
+ private __waitTimeOverrideV1;
36
102
  /**
37
103
  * Adds a new task to a task group at a specific index. | authz_personas=[lig_owner_operators] | (AddTaskToGroupReq) -> (PydanticObjectId)
38
104
  *
@@ -94,9 +160,10 @@ export declare class Tasks {
94
160
  skipV1(taskId: string, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<boolean>;
95
161
  private __skipV1;
96
162
  /**
97
- * Marks a task as ATTEMPT. | authz_personas=[driver_for_executor, coordinator_org_operators, executor_org_operators] (depending on type) | () -> (bool)
163
+ * Marks a task as ATTEMPT with an optional executor organization note. | authz_personas=[driver_for_executor, coordinator_org_operators, executor_org_operators] (depending on type) | (AttemptTaskReq) -> (bool)
98
164
  *
99
165
  * @param {string} taskId
166
+ * @param {Chrt.shipping.AttemptTaskReq} request
100
167
  * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
101
168
  *
102
169
  * @throws {@link Chrt.UnprocessableEntityError}
@@ -104,7 +171,7 @@ export declare class Tasks {
104
171
  * @example
105
172
  * await client.shipping.tasks.attemptV1("task_id")
106
173
  */
107
- attemptV1(taskId: string, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<boolean>;
174
+ attemptV1(taskId: string, request?: Chrt.shipping.AttemptTaskReq, requestOptions?: Tasks.RequestOptions): core.HttpResponsePromise<boolean>;
108
175
  private __attemptV1;
109
176
  /**
110
177
  * Deletes a task. Task must be in STAGED status. | authz_personas=[lig_owner_operators] | () -> (bool)
@@ -60,6 +60,305 @@ class Tasks {
60
60
  var _a;
61
61
  return ((_a = this._executorOrgNotes) !== null && _a !== void 0 ? _a : (this._executorOrgNotes = new Client_js_1.ExecutorOrgNotes(this._options)));
62
62
  }
63
+ /**
64
+ * Checks whether the assigned driver's available location is inside the task wait-time geofence. | authz_personas=[driver_for_executor, executor_org_operators] | () -> (TaskWaitTimeGeofenceRes)
65
+ *
66
+ * @param {string} taskId
67
+ * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
68
+ *
69
+ * @throws {@link Chrt.UnprocessableEntityError}
70
+ *
71
+ * @example
72
+ * await client.shipping.tasks.waitTimeGeofenceV1("task_id")
73
+ */
74
+ waitTimeGeofenceV1(taskId, requestOptions) {
75
+ return core.HttpResponsePromise.fromPromise(this.__waitTimeGeofenceV1(taskId, requestOptions));
76
+ }
77
+ __waitTimeGeofenceV1(taskId, requestOptions) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ var _a, _b, _c, _d;
80
+ 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);
81
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
82
+ 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/tasks/wait_time/geofence/v1/${encodeURIComponent(taskId)}`),
83
+ method: "GET",
84
+ headers: _headers,
85
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
86
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
87
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
88
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
89
+ });
90
+ if (_response.ok) {
91
+ return { data: _response.body, rawResponse: _response.rawResponse };
92
+ }
93
+ if (_response.error.reason === "status-code") {
94
+ switch (_response.error.statusCode) {
95
+ case 422:
96
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
97
+ default:
98
+ throw new errors.ChrtError({
99
+ statusCode: _response.error.statusCode,
100
+ body: _response.error.body,
101
+ rawResponse: _response.rawResponse,
102
+ });
103
+ }
104
+ }
105
+ switch (_response.error.reason) {
106
+ case "non-json":
107
+ throw new errors.ChrtError({
108
+ statusCode: _response.error.statusCode,
109
+ body: _response.error.rawBody,
110
+ rawResponse: _response.rawResponse,
111
+ });
112
+ case "timeout":
113
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping/tasks/wait_time/geofence/v1/{task_id}.");
114
+ case "unknown":
115
+ throw new errors.ChrtError({
116
+ message: _response.error.errorMessage,
117
+ rawResponse: _response.rawResponse,
118
+ });
119
+ }
120
+ });
121
+ }
122
+ /**
123
+ * Starts wait time for a task and records whether the assigned driver's available location is inside the geofence. | authz_personas=[driver_for_executor, executor_org_operators] | () -> (bool)
124
+ *
125
+ * @param {string} taskId
126
+ * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
127
+ *
128
+ * @throws {@link Chrt.UnprocessableEntityError}
129
+ *
130
+ * @example
131
+ * await client.shipping.tasks.waitTimeStartV1("task_id")
132
+ */
133
+ waitTimeStartV1(taskId, requestOptions) {
134
+ return core.HttpResponsePromise.fromPromise(this.__waitTimeStartV1(taskId, requestOptions));
135
+ }
136
+ __waitTimeStartV1(taskId, requestOptions) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ var _a, _b, _c, _d;
139
+ 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);
140
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
141
+ 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/tasks/wait_time/start/v1/${encodeURIComponent(taskId)}`),
142
+ method: "PUT",
143
+ headers: _headers,
144
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
145
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
146
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
147
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
148
+ });
149
+ if (_response.ok) {
150
+ return { data: _response.body, rawResponse: _response.rawResponse };
151
+ }
152
+ if (_response.error.reason === "status-code") {
153
+ switch (_response.error.statusCode) {
154
+ case 422:
155
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
156
+ default:
157
+ throw new errors.ChrtError({
158
+ statusCode: _response.error.statusCode,
159
+ body: _response.error.body,
160
+ rawResponse: _response.rawResponse,
161
+ });
162
+ }
163
+ }
164
+ switch (_response.error.reason) {
165
+ case "non-json":
166
+ throw new errors.ChrtError({
167
+ statusCode: _response.error.statusCode,
168
+ body: _response.error.rawBody,
169
+ rawResponse: _response.rawResponse,
170
+ });
171
+ case "timeout":
172
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /shipping/tasks/wait_time/start/v1/{task_id}.");
173
+ case "unknown":
174
+ throw new errors.ChrtError({
175
+ message: _response.error.errorMessage,
176
+ rawResponse: _response.rawResponse,
177
+ });
178
+ }
179
+ });
180
+ }
181
+ /**
182
+ * Ends an active wait-time session for a task. | authz_personas=[driver_for_executor, executor_org_operators] | () -> (bool)
183
+ *
184
+ * @param {string} taskId
185
+ * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
186
+ *
187
+ * @throws {@link Chrt.UnprocessableEntityError}
188
+ *
189
+ * @example
190
+ * await client.shipping.tasks.waitTimeEndV1("task_id")
191
+ */
192
+ waitTimeEndV1(taskId, requestOptions) {
193
+ return core.HttpResponsePromise.fromPromise(this.__waitTimeEndV1(taskId, requestOptions));
194
+ }
195
+ __waitTimeEndV1(taskId, requestOptions) {
196
+ return __awaiter(this, void 0, void 0, function* () {
197
+ var _a, _b, _c, _d;
198
+ 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);
199
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
200
+ 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/tasks/wait_time/end/v1/${encodeURIComponent(taskId)}`),
201
+ method: "PUT",
202
+ headers: _headers,
203
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
204
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
205
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
206
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
207
+ });
208
+ if (_response.ok) {
209
+ return { data: _response.body, rawResponse: _response.rawResponse };
210
+ }
211
+ if (_response.error.reason === "status-code") {
212
+ switch (_response.error.statusCode) {
213
+ case 422:
214
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
215
+ default:
216
+ throw new errors.ChrtError({
217
+ statusCode: _response.error.statusCode,
218
+ body: _response.error.body,
219
+ rawResponse: _response.rawResponse,
220
+ });
221
+ }
222
+ }
223
+ switch (_response.error.reason) {
224
+ case "non-json":
225
+ throw new errors.ChrtError({
226
+ statusCode: _response.error.statusCode,
227
+ body: _response.error.rawBody,
228
+ rawResponse: _response.rawResponse,
229
+ });
230
+ case "timeout":
231
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /shipping/tasks/wait_time/end/v1/{task_id}.");
232
+ case "unknown":
233
+ throw new errors.ChrtError({
234
+ message: _response.error.errorMessage,
235
+ rawResponse: _response.rawResponse,
236
+ });
237
+ }
238
+ });
239
+ }
240
+ /**
241
+ * Validates wait time for a task. | authz_personas=[executor_org_operators] | () -> (bool)
242
+ *
243
+ * @param {string} taskId
244
+ * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
245
+ *
246
+ * @throws {@link Chrt.UnprocessableEntityError}
247
+ *
248
+ * @example
249
+ * await client.shipping.tasks.waitTimeValidateV1("task_id")
250
+ */
251
+ waitTimeValidateV1(taskId, requestOptions) {
252
+ return core.HttpResponsePromise.fromPromise(this.__waitTimeValidateV1(taskId, requestOptions));
253
+ }
254
+ __waitTimeValidateV1(taskId, requestOptions) {
255
+ return __awaiter(this, void 0, void 0, function* () {
256
+ var _a, _b, _c, _d;
257
+ 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);
258
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
259
+ 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/tasks/wait_time/validate/v1/${encodeURIComponent(taskId)}`),
260
+ method: "PUT",
261
+ headers: _headers,
262
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
263
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
264
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
265
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
266
+ });
267
+ if (_response.ok) {
268
+ return { data: _response.body, rawResponse: _response.rawResponse };
269
+ }
270
+ if (_response.error.reason === "status-code") {
271
+ switch (_response.error.statusCode) {
272
+ case 422:
273
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
274
+ default:
275
+ throw new errors.ChrtError({
276
+ statusCode: _response.error.statusCode,
277
+ body: _response.error.body,
278
+ rawResponse: _response.rawResponse,
279
+ });
280
+ }
281
+ }
282
+ switch (_response.error.reason) {
283
+ case "non-json":
284
+ throw new errors.ChrtError({
285
+ statusCode: _response.error.statusCode,
286
+ body: _response.error.rawBody,
287
+ rawResponse: _response.rawResponse,
288
+ });
289
+ case "timeout":
290
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /shipping/tasks/wait_time/validate/v1/{task_id}.");
291
+ case "unknown":
292
+ throw new errors.ChrtError({
293
+ message: _response.error.errorMessage,
294
+ rawResponse: _response.rawResponse,
295
+ });
296
+ }
297
+ });
298
+ }
299
+ /**
300
+ * Overrides wait-time timestamps or geofence distance for a task. | authz_personas=[executor_org_operators] | (WaitTimeOverrideReq) -> (bool)
301
+ *
302
+ * @param {string} taskId
303
+ * @param {Chrt.shipping.WaitTimeOverrideReq} request
304
+ * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
305
+ *
306
+ * @throws {@link Chrt.UnprocessableEntityError}
307
+ *
308
+ * @example
309
+ * await client.shipping.tasks.waitTimeOverrideV1("task_id")
310
+ */
311
+ waitTimeOverrideV1(taskId, request = {}, requestOptions) {
312
+ return core.HttpResponsePromise.fromPromise(this.__waitTimeOverrideV1(taskId, request, requestOptions));
313
+ }
314
+ __waitTimeOverrideV1(taskId_1) {
315
+ return __awaiter(this, arguments, void 0, function* (taskId, request = {}, requestOptions) {
316
+ var _a, _b, _c, _d;
317
+ 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);
318
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
319
+ 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/tasks/wait_time/override/v1/${encodeURIComponent(taskId)}`),
320
+ method: "PATCH",
321
+ headers: _headers,
322
+ contentType: "application/json",
323
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
324
+ requestType: "json",
325
+ body: request,
326
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
327
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
328
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
329
+ });
330
+ if (_response.ok) {
331
+ return { data: _response.body, rawResponse: _response.rawResponse };
332
+ }
333
+ if (_response.error.reason === "status-code") {
334
+ switch (_response.error.statusCode) {
335
+ case 422:
336
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
337
+ default:
338
+ throw new errors.ChrtError({
339
+ statusCode: _response.error.statusCode,
340
+ body: _response.error.body,
341
+ rawResponse: _response.rawResponse,
342
+ });
343
+ }
344
+ }
345
+ switch (_response.error.reason) {
346
+ case "non-json":
347
+ throw new errors.ChrtError({
348
+ statusCode: _response.error.statusCode,
349
+ body: _response.error.rawBody,
350
+ rawResponse: _response.rawResponse,
351
+ });
352
+ case "timeout":
353
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /shipping/tasks/wait_time/override/v1/{task_id}.");
354
+ case "unknown":
355
+ throw new errors.ChrtError({
356
+ message: _response.error.errorMessage,
357
+ rawResponse: _response.rawResponse,
358
+ });
359
+ }
360
+ });
361
+ }
63
362
  /**
64
363
  * Adds a new task to a task group at a specific index. | authz_personas=[lig_owner_operators] | (AddTaskToGroupReq) -> (PydanticObjectId)
65
364
  *
@@ -311,9 +610,10 @@ class Tasks {
311
610
  });
312
611
  }
313
612
  /**
314
- * Marks a task as ATTEMPT. | authz_personas=[driver_for_executor, coordinator_org_operators, executor_org_operators] (depending on type) | () -> (bool)
613
+ * Marks a task as ATTEMPT with an optional executor organization note. | authz_personas=[driver_for_executor, coordinator_org_operators, executor_org_operators] (depending on type) | (AttemptTaskReq) -> (bool)
315
614
  *
316
615
  * @param {string} taskId
616
+ * @param {Chrt.shipping.AttemptTaskReq} request
317
617
  * @param {Tasks.RequestOptions} requestOptions - Request-specific configuration.
318
618
  *
319
619
  * @throws {@link Chrt.UnprocessableEntityError}
@@ -321,18 +621,21 @@ class Tasks {
321
621
  * @example
322
622
  * await client.shipping.tasks.attemptV1("task_id")
323
623
  */
324
- attemptV1(taskId, requestOptions) {
325
- return core.HttpResponsePromise.fromPromise(this.__attemptV1(taskId, requestOptions));
624
+ attemptV1(taskId, request = {}, requestOptions) {
625
+ return core.HttpResponsePromise.fromPromise(this.__attemptV1(taskId, request, requestOptions));
326
626
  }
327
- __attemptV1(taskId, requestOptions) {
328
- return __awaiter(this, void 0, void 0, function* () {
627
+ __attemptV1(taskId_1) {
628
+ return __awaiter(this, arguments, void 0, function* (taskId, request = {}, requestOptions) {
329
629
  var _a, _b, _c, _d;
330
630
  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);
331
631
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
332
632
  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/tasks/attempt/v1/${encodeURIComponent(taskId)}`),
333
633
  method: "PUT",
334
634
  headers: _headers,
635
+ contentType: "application/json",
335
636
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
637
+ requestType: "json",
638
+ body: request,
336
639
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
337
640
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
338
641
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface AttemptTaskReq {
9
+ /** Optional executor organization note for the task attempt. */
10
+ executor_org_note?: string | null;
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface WaitTimeOverrideReq {
9
+ geofence_distance_miles?: number | null;
10
+ wait_time_start_timestamp?: string | null;
11
+ wait_time_end_timestamp?: string | null;
12
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,3 @@
1
+ export { type WaitTimeOverrideReq } from "./WaitTimeOverrideReq.js";
1
2
  export { type AddTaskToGroupReq } from "./AddTaskToGroupReq.js";
3
+ export { type AttemptTaskReq } from "./AttemptTaskReq.js";
@@ -19,6 +19,7 @@ export interface Driver1 {
19
19
  status?: Chrt.DriverStatusEnum;
20
20
  available_according_to_driver?: boolean;
21
21
  available_according_to_operators?: boolean;
22
+ waiting?: boolean;
22
23
  auto_assign_enabled?: boolean;
23
24
  active_task_group_ids?: string[];
24
25
  last_seen_at_location?: Chrt.LocationFeature | null;
@@ -5,6 +5,7 @@ import * as Chrt from "../index.js";
5
5
  export interface Task1 {
6
6
  schema_version: number;
7
7
  location?: Chrt.LocationFeature | null;
8
+ geofence_distance_miles?: number;
8
9
  action?: Task1.Action | null;
9
10
  datetime_windows?: Chrt.DateTimeWindow1[];
10
11
  order_placer_comments?: string | null;
@@ -34,6 +35,12 @@ export interface Task1 {
34
35
  skipped_at_timestamp?: string | null;
35
36
  attempted_at_timestamp?: string | null;
36
37
  exception_at_timestamp?: string | null;
38
+ wait_time_start_timestamp?: string | null;
39
+ wait_time_end_timestamp?: string | null;
40
+ wait_time_started_in_geofence?: boolean | null;
41
+ wait_time_validated?: boolean | null;
42
+ /** Must be a string starting with `user_` */
43
+ wait_time_validated_by_user_id?: string | null;
37
44
  order_cancelled?: boolean;
38
45
  }
39
46
  export declare namespace Task1 {