@chrt-inc/typescript-sdk 1.689.0 → 1.692.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 (70) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/orgs/resources/complianceDocuments/client/Client.d.ts +14 -0
  3. package/dist/cjs/api/resources/orgs/resources/complianceDocuments/client/Client.js +63 -0
  4. package/dist/cjs/api/resources/orgs/resources/complianceDocuments/client/requests/OrgComplianceDocumentClientCreate1.d.ts +1 -0
  5. package/dist/cjs/api/resources/orgs/resources/complianceDocuments/client/requests/OrgComplianceDocumentClientUpdate1.d.ts +11 -0
  6. package/dist/cjs/api/resources/orgs/resources/complianceDocuments/client/requests/OrgComplianceDocumentClientUpdate1.js +5 -0
  7. package/dist/cjs/api/resources/orgs/resources/complianceDocuments/client/requests/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/Client.d.ts +14 -0
  9. package/dist/cjs/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/Client.js +63 -0
  10. package/dist/cjs/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/requests/DriverComplianceDocumentClientCreate1.d.ts +1 -0
  11. package/dist/cjs/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/requests/DriverComplianceDocumentClientUpdate1.d.ts +11 -0
  12. package/dist/cjs/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/requests/DriverComplianceDocumentClientUpdate1.js +5 -0
  13. package/dist/cjs/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/requests/index.d.ts +1 -0
  14. package/dist/cjs/api/resources/shipping/resources/tasks/client/Client.d.ts +66 -0
  15. package/dist/cjs/api/resources/shipping/resources/tasks/client/Client.js +299 -0
  16. package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.d.ts +12 -0
  17. package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.js +5 -0
  18. package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/index.d.ts +1 -0
  19. package/dist/cjs/api/types/Driver1.d.ts +1 -0
  20. package/dist/cjs/api/types/DriverComplianceDocument1.d.ts +1 -0
  21. package/dist/cjs/api/types/DriverComplianceDocumentTypeEnum1.d.ts +16 -1
  22. package/dist/cjs/api/types/DriverComplianceDocumentTypeEnum1.js +15 -0
  23. package/dist/cjs/api/types/OrgComplianceDocument1.d.ts +1 -0
  24. package/dist/cjs/api/types/OrgComplianceDocumentTypeEnum1.d.ts +11 -1
  25. package/dist/cjs/api/types/OrgComplianceDocumentTypeEnum1.js +10 -0
  26. package/dist/cjs/api/types/Task1.d.ts +7 -0
  27. package/dist/cjs/api/types/TaskClientCreate1.d.ts +1 -0
  28. package/dist/cjs/api/types/TaskGroup1.d.ts +1 -0
  29. package/dist/cjs/api/types/TaskWaitTimeGeofenceRes.d.ts +9 -0
  30. package/dist/cjs/api/types/TaskWaitTimeGeofenceRes.js +5 -0
  31. package/dist/cjs/api/types/index.d.ts +1 -0
  32. package/dist/cjs/api/types/index.js +1 -0
  33. package/dist/cjs/version.d.ts +1 -1
  34. package/dist/cjs/version.js +1 -1
  35. package/dist/esm/Client.mjs +2 -2
  36. package/dist/esm/api/resources/orgs/resources/complianceDocuments/client/Client.d.mts +14 -0
  37. package/dist/esm/api/resources/orgs/resources/complianceDocuments/client/Client.mjs +63 -0
  38. package/dist/esm/api/resources/orgs/resources/complianceDocuments/client/requests/OrgComplianceDocumentClientCreate1.d.mts +1 -0
  39. package/dist/esm/api/resources/orgs/resources/complianceDocuments/client/requests/OrgComplianceDocumentClientUpdate1.d.mts +11 -0
  40. package/dist/esm/api/resources/orgs/resources/complianceDocuments/client/requests/OrgComplianceDocumentClientUpdate1.mjs +4 -0
  41. package/dist/esm/api/resources/orgs/resources/complianceDocuments/client/requests/index.d.mts +1 -0
  42. package/dist/esm/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/Client.d.mts +14 -0
  43. package/dist/esm/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/Client.mjs +63 -0
  44. package/dist/esm/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/requests/DriverComplianceDocumentClientCreate1.d.mts +1 -0
  45. package/dist/esm/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/requests/DriverComplianceDocumentClientUpdate1.d.mts +11 -0
  46. package/dist/esm/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/requests/DriverComplianceDocumentClientUpdate1.mjs +4 -0
  47. package/dist/esm/api/resources/shipping/resources/drivers/resources/complianceDocuments/client/requests/index.d.mts +1 -0
  48. package/dist/esm/api/resources/shipping/resources/tasks/client/Client.d.mts +66 -0
  49. package/dist/esm/api/resources/shipping/resources/tasks/client/Client.mjs +299 -0
  50. package/dist/esm/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.d.mts +12 -0
  51. package/dist/esm/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.mjs +4 -0
  52. package/dist/esm/api/resources/shipping/resources/tasks/client/requests/index.d.mts +1 -0
  53. package/dist/esm/api/types/Driver1.d.mts +1 -0
  54. package/dist/esm/api/types/DriverComplianceDocument1.d.mts +1 -0
  55. package/dist/esm/api/types/DriverComplianceDocumentTypeEnum1.d.mts +16 -1
  56. package/dist/esm/api/types/DriverComplianceDocumentTypeEnum1.mjs +15 -0
  57. package/dist/esm/api/types/OrgComplianceDocument1.d.mts +1 -0
  58. package/dist/esm/api/types/OrgComplianceDocumentTypeEnum1.d.mts +11 -1
  59. package/dist/esm/api/types/OrgComplianceDocumentTypeEnum1.mjs +10 -0
  60. package/dist/esm/api/types/Task1.d.mts +7 -0
  61. package/dist/esm/api/types/TaskClientCreate1.d.mts +1 -0
  62. package/dist/esm/api/types/TaskGroup1.d.mts +1 -0
  63. package/dist/esm/api/types/TaskWaitTimeGeofenceRes.d.mts +9 -0
  64. package/dist/esm/api/types/TaskWaitTimeGeofenceRes.mjs +4 -0
  65. package/dist/esm/api/types/index.d.mts +1 -0
  66. package/dist/esm/api/types/index.mjs +1 -0
  67. package/dist/esm/version.d.mts +1 -1
  68. package/dist/esm/version.mjs +1 -1
  69. package/package.json +1 -1
  70. package/reference.md +465 -0
@@ -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.689.0",
60
- "User-Agent": "@chrt-inc/typescript-sdk/1.689.0",
59
+ "X-Fern-SDK-Version": "1.692.0",
60
+ "User-Agent": "@chrt-inc/typescript-sdk/1.692.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) });
@@ -72,5 +72,19 @@ export declare class ComplianceDocuments {
72
72
  */
73
73
  createV1(request: Chrt.orgs.OrgComplianceDocumentClientCreate1, requestOptions?: ComplianceDocuments.RequestOptions): core.HttpResponsePromise<Chrt.OrgComplianceDocument1>;
74
74
  private __createV1;
75
+ /**
76
+ * Updates an organization compliance document for the caller's provider organization. | authz: allowed_org_types=[provider], min_org_role=administrator | (OrgComplianceDocumentClientUpdate1) -> (OrgComplianceDocument1)
77
+ *
78
+ * @param {string} orgComplianceDocumentId
79
+ * @param {Chrt.orgs.OrgComplianceDocumentClientUpdate1} request
80
+ * @param {ComplianceDocuments.RequestOptions} requestOptions - Request-specific configuration.
81
+ *
82
+ * @throws {@link Chrt.UnprocessableEntityError}
83
+ *
84
+ * @example
85
+ * await client.orgs.complianceDocuments.updateV1("org_compliance_document_id")
86
+ */
87
+ updateV1(orgComplianceDocumentId: string, request?: Chrt.orgs.OrgComplianceDocumentClientUpdate1, requestOptions?: ComplianceDocuments.RequestOptions): core.HttpResponsePromise<Chrt.OrgComplianceDocument1>;
88
+ private __updateV1;
75
89
  protected _getAuthorizationHeader(): Promise<string | undefined>;
76
90
  }
@@ -235,6 +235,69 @@ class ComplianceDocuments {
235
235
  }
236
236
  });
237
237
  }
238
+ /**
239
+ * Updates an organization compliance document for the caller's provider organization. | authz: allowed_org_types=[provider], min_org_role=administrator | (OrgComplianceDocumentClientUpdate1) -> (OrgComplianceDocument1)
240
+ *
241
+ * @param {string} orgComplianceDocumentId
242
+ * @param {Chrt.orgs.OrgComplianceDocumentClientUpdate1} request
243
+ * @param {ComplianceDocuments.RequestOptions} requestOptions - Request-specific configuration.
244
+ *
245
+ * @throws {@link Chrt.UnprocessableEntityError}
246
+ *
247
+ * @example
248
+ * await client.orgs.complianceDocuments.updateV1("org_compliance_document_id")
249
+ */
250
+ updateV1(orgComplianceDocumentId, request = {}, requestOptions) {
251
+ return core.HttpResponsePromise.fromPromise(this.__updateV1(orgComplianceDocumentId, request, requestOptions));
252
+ }
253
+ __updateV1(orgComplianceDocumentId_1) {
254
+ return __awaiter(this, arguments, void 0, function* (orgComplianceDocumentId, request = {}, requestOptions) {
255
+ var _a, _b, _c, _d;
256
+ 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);
257
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
258
+ 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, `orgs/compliance_documents/update/v1/${encodeURIComponent(orgComplianceDocumentId)}`),
259
+ method: "PATCH",
260
+ headers: _headers,
261
+ contentType: "application/json",
262
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
263
+ requestType: "json",
264
+ body: request,
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 PATCH /orgs/compliance_documents/update/v1/{org_compliance_document_id}.");
293
+ case "unknown":
294
+ throw new errors.ChrtError({
295
+ message: _response.error.errorMessage,
296
+ rawResponse: _response.rawResponse,
297
+ });
298
+ }
299
+ });
300
+ }
238
301
  _getAuthorizationHeader() {
239
302
  return __awaiter(this, void 0, void 0, function* () {
240
303
  const bearer = yield core.Supplier.get(this._options.token);
@@ -12,6 +12,7 @@ import * as Chrt from "../../../../../../index.js";
12
12
  export interface OrgComplianceDocumentClientCreate1 {
13
13
  schema_version: number;
14
14
  document_type: Chrt.OrgComplianceDocumentTypeEnum1;
15
+ description?: string | null;
15
16
  valid_from?: string | null;
16
17
  valid_until?: string | null;
17
18
  }
@@ -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 OrgComplianceDocumentClientUpdate1 {
9
+ description?: string | null;
10
+ description__set_to_None?: boolean;
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 });
@@ -1 +1,2 @@
1
1
  export { type OrgComplianceDocumentClientCreate1 } from "./OrgComplianceDocumentClientCreate1.js";
2
+ export { type OrgComplianceDocumentClientUpdate1 } from "./OrgComplianceDocumentClientUpdate1.js";
@@ -76,5 +76,19 @@ export declare class ComplianceDocuments {
76
76
  */
77
77
  createV1(driverId: string, request: Chrt.shipping.drivers.DriverComplianceDocumentClientCreate1, requestOptions?: ComplianceDocuments.RequestOptions): core.HttpResponsePromise<Chrt.DriverComplianceDocument1>;
78
78
  private __createV1;
79
+ /**
80
+ * Updates a driver compliance document in the caller's provider organization. | authz: allowed_org_types=[provider], min_org_role=administrator | (DriverComplianceDocumentClientUpdate1) -> (DriverComplianceDocument1)
81
+ *
82
+ * @param {string} driverComplianceDocumentId
83
+ * @param {Chrt.shipping.drivers.DriverComplianceDocumentClientUpdate1} request
84
+ * @param {ComplianceDocuments.RequestOptions} requestOptions - Request-specific configuration.
85
+ *
86
+ * @throws {@link Chrt.UnprocessableEntityError}
87
+ *
88
+ * @example
89
+ * await client.shipping.drivers.complianceDocuments.updateV1("driver_compliance_document_id")
90
+ */
91
+ updateV1(driverComplianceDocumentId: string, request?: Chrt.shipping.drivers.DriverComplianceDocumentClientUpdate1, requestOptions?: ComplianceDocuments.RequestOptions): core.HttpResponsePromise<Chrt.DriverComplianceDocument1>;
92
+ private __updateV1;
79
93
  protected _getAuthorizationHeader(): Promise<string | undefined>;
80
94
  }
@@ -244,6 +244,69 @@ class ComplianceDocuments {
244
244
  }
245
245
  });
246
246
  }
247
+ /**
248
+ * Updates a driver compliance document in the caller's provider organization. | authz: allowed_org_types=[provider], min_org_role=administrator | (DriverComplianceDocumentClientUpdate1) -> (DriverComplianceDocument1)
249
+ *
250
+ * @param {string} driverComplianceDocumentId
251
+ * @param {Chrt.shipping.drivers.DriverComplianceDocumentClientUpdate1} request
252
+ * @param {ComplianceDocuments.RequestOptions} requestOptions - Request-specific configuration.
253
+ *
254
+ * @throws {@link Chrt.UnprocessableEntityError}
255
+ *
256
+ * @example
257
+ * await client.shipping.drivers.complianceDocuments.updateV1("driver_compliance_document_id")
258
+ */
259
+ updateV1(driverComplianceDocumentId, request = {}, requestOptions) {
260
+ return core.HttpResponsePromise.fromPromise(this.__updateV1(driverComplianceDocumentId, request, requestOptions));
261
+ }
262
+ __updateV1(driverComplianceDocumentId_1) {
263
+ return __awaiter(this, arguments, void 0, function* (driverComplianceDocumentId, request = {}, requestOptions) {
264
+ var _a, _b, _c, _d;
265
+ 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);
266
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
267
+ 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/drivers/compliance_documents/update/v1/${encodeURIComponent(driverComplianceDocumentId)}`),
268
+ method: "PATCH",
269
+ headers: _headers,
270
+ contentType: "application/json",
271
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
272
+ requestType: "json",
273
+ body: request,
274
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
275
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
276
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
277
+ });
278
+ if (_response.ok) {
279
+ return { data: _response.body, rawResponse: _response.rawResponse };
280
+ }
281
+ if (_response.error.reason === "status-code") {
282
+ switch (_response.error.statusCode) {
283
+ case 422:
284
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
285
+ default:
286
+ throw new errors.ChrtError({
287
+ statusCode: _response.error.statusCode,
288
+ body: _response.error.body,
289
+ rawResponse: _response.rawResponse,
290
+ });
291
+ }
292
+ }
293
+ switch (_response.error.reason) {
294
+ case "non-json":
295
+ throw new errors.ChrtError({
296
+ statusCode: _response.error.statusCode,
297
+ body: _response.error.rawBody,
298
+ rawResponse: _response.rawResponse,
299
+ });
300
+ case "timeout":
301
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /shipping/drivers/compliance_documents/update/v1/{driver_compliance_document_id}.");
302
+ case "unknown":
303
+ throw new errors.ChrtError({
304
+ message: _response.error.errorMessage,
305
+ rawResponse: _response.rawResponse,
306
+ });
307
+ }
308
+ });
309
+ }
247
310
  _getAuthorizationHeader() {
248
311
  return __awaiter(this, void 0, void 0, function* () {
249
312
  const bearer = yield core.Supplier.get(this._options.token);
@@ -12,6 +12,7 @@ import * as Chrt from "../../../../../../../../index.js";
12
12
  export interface DriverComplianceDocumentClientCreate1 {
13
13
  schema_version: number;
14
14
  document_type: Chrt.DriverComplianceDocumentTypeEnum1;
15
+ description?: string | null;
15
16
  valid_from?: string | null;
16
17
  valid_until?: string | null;
17
18
  }
@@ -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 DriverComplianceDocumentClientUpdate1 {
9
+ description?: string | null;
10
+ description__set_to_None?: boolean;
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 });
@@ -1 +1,2 @@
1
1
  export { type DriverComplianceDocumentClientCreate1 } from "./DriverComplianceDocumentClientCreate1.js";
2
+ export { type DriverComplianceDocumentClientUpdate1 } from "./DriverComplianceDocumentClientUpdate1.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
  *
@@ -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
  *
@@ -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
+ }