@chrt-inc/typescript-sdk 1.689.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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/shipping/resources/tasks/client/Client.d.ts +66 -0
- package/dist/cjs/api/resources/shipping/resources/tasks/client/Client.js +299 -0
- package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.d.ts +12 -0
- package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.js +5 -0
- package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/Driver1.d.ts +1 -0
- package/dist/cjs/api/types/Task1.d.ts +7 -0
- package/dist/cjs/api/types/TaskClientCreate1.d.ts +1 -0
- package/dist/cjs/api/types/TaskGroup1.d.ts +1 -0
- package/dist/cjs/api/types/TaskWaitTimeGeofenceRes.d.ts +9 -0
- package/dist/cjs/api/types/TaskWaitTimeGeofenceRes.js +5 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/shipping/resources/tasks/client/Client.d.mts +66 -0
- package/dist/esm/api/resources/shipping/resources/tasks/client/Client.mjs +299 -0
- package/dist/esm/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.d.mts +12 -0
- package/dist/esm/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.mjs +4 -0
- package/dist/esm/api/resources/shipping/resources/tasks/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/Driver1.d.mts +1 -0
- package/dist/esm/api/types/Task1.d.mts +7 -0
- package/dist/esm/api/types/TaskClientCreate1.d.mts +1 -0
- package/dist/esm/api/types/TaskGroup1.d.mts +1 -0
- package/dist/esm/api/types/TaskWaitTimeGeofenceRes.d.mts +9 -0
- package/dist/esm/api/types/TaskWaitTimeGeofenceRes.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +323 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -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.
|
|
60
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
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) });
|
|
@@ -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
|
*
|
package/dist/cjs/api/resources/shipping/resources/tasks/client/requests/WaitTimeOverrideReq.d.ts
ADDED
|
@@ -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
|
+
}
|
|
@@ -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 {
|
|
@@ -5,6 +5,7 @@ import * as Chrt from "../index.js";
|
|
|
5
5
|
export interface TaskClientCreate1 {
|
|
6
6
|
schema_version: number;
|
|
7
7
|
location?: Chrt.LocationFeature | null;
|
|
8
|
+
geofence_distance_miles?: number;
|
|
8
9
|
action?: TaskClientCreate1.Action | null;
|
|
9
10
|
datetime_windows?: Chrt.DateTimeWindow1[];
|
|
10
11
|
order_placer_comments?: string | null;
|
|
@@ -39,6 +39,7 @@ export interface TaskGroup1 {
|
|
|
39
39
|
vehicle_type?: Chrt.VehicleTypeEnum | null;
|
|
40
40
|
mileage_estimated?: number | null;
|
|
41
41
|
mileage_observed?: number | null;
|
|
42
|
+
wait_time_total_minutes?: number | null;
|
|
42
43
|
mileage_asserted?: boolean;
|
|
43
44
|
flight_number?: string | null;
|
|
44
45
|
fa_flight_ids?: string[];
|
|
@@ -332,6 +332,7 @@ export * from "./TaskGroupTypeaheadFieldEnum.js";
|
|
|
332
332
|
export * from "./TaskGroupTypeaheadResult.js";
|
|
333
333
|
export * from "./TaskManifest1.js";
|
|
334
334
|
export * from "./TaskStatusEnum1.js";
|
|
335
|
+
export * from "./TaskWaitTimeGeofenceRes.js";
|
|
335
336
|
export * from "./TemplateRes.js";
|
|
336
337
|
export * from "./TimeBucket.js";
|
|
337
338
|
export * from "./TimeGranularity.js";
|
|
@@ -348,6 +348,7 @@ __exportStar(require("./TaskGroupTypeaheadFieldEnum.js"), exports);
|
|
|
348
348
|
__exportStar(require("./TaskGroupTypeaheadResult.js"), exports);
|
|
349
349
|
__exportStar(require("./TaskManifest1.js"), exports);
|
|
350
350
|
__exportStar(require("./TaskStatusEnum1.js"), exports);
|
|
351
|
+
__exportStar(require("./TaskWaitTimeGeofenceRes.js"), exports);
|
|
351
352
|
__exportStar(require("./TemplateRes.js"), exports);
|
|
352
353
|
__exportStar(require("./TimeBucket.js"), exports);
|
|
353
354
|
__exportStar(require("./TimeGranularity.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.691.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -20,8 +20,8 @@ export class ChrtClient {
|
|
|
20
20
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
21
21
|
"X-Fern-Language": "JavaScript",
|
|
22
22
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
23
|
-
"X-Fern-SDK-Version": "1.
|
|
24
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
23
|
+
"X-Fern-SDK-Version": "1.691.0",
|
|
24
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.691.0",
|
|
25
25
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
26
26
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
27
27
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -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
|
*
|