@chrt-inc/typescript-sdk 1.322.0 → 1.324.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/drivers/client/Client.d.ts +18 -6
- package/dist/cjs/api/resources/drivers/client/Client.js +70 -32
- package/dist/cjs/api/resources/drivers/client/requests/DriversListOrgMembersAndDriversV1Request.d.ts +16 -0
- package/dist/cjs/api/resources/drivers/client/requests/DriversListV1Request.d.ts +16 -0
- package/dist/cjs/api/resources/drivers/client/requests/DriversListV1Request.js +5 -0
- package/dist/cjs/api/resources/drivers/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.d.ts +52 -5
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.js +200 -9
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/SetFlightNumberDraftReq.d.ts +13 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/SetFlightNumberDraftReq.js +5 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/SetTaskOrderingDraftReq.d.ts +13 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/SetTaskOrderingDraftReq.js +5 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateCourierOrgDraftReq.d.ts +13 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateCourierOrgDraftReq.js +5 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.ts +3 -1
- 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/drivers/client/Client.d.mts +18 -6
- package/dist/esm/api/resources/drivers/client/Client.mjs +70 -32
- package/dist/esm/api/resources/drivers/client/requests/DriversListOrgMembersAndDriversV1Request.d.mts +16 -0
- package/dist/esm/api/resources/drivers/client/requests/DriversListV1Request.d.mts +16 -0
- package/dist/esm/api/resources/drivers/client/requests/DriversListV1Request.mjs +4 -0
- package/dist/esm/api/resources/drivers/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.d.mts +52 -5
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.mjs +200 -9
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/SetFlightNumberDraftReq.d.mts +13 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/SetFlightNumberDraftReq.mjs +4 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/SetTaskOrderingDraftReq.d.mts +13 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/SetTaskOrderingDraftReq.mjs +4 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateCourierOrgDraftReq.d.mts +13 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateCourierOrgDraftReq.mjs +4 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.mts +3 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +243 -10
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.d.ts +0 -13
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.d.mts +0 -13
- /package/dist/cjs/api/resources/{orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.js → drivers/client/requests/DriversListOrgMembersAndDriversV1Request.js} +0 -0
- /package/dist/esm/api/resources/{orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.mjs → drivers/client/requests/DriversListOrgMembersAndDriversV1Request.mjs} +0 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -73,8 +73,8 @@ class ChrtClient {
|
|
|
73
73
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
74
74
|
"X-Fern-Language": "JavaScript",
|
|
75
75
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
76
|
-
"X-Fern-SDK-Version": "1.
|
|
77
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
76
|
+
"X-Fern-SDK-Version": "1.324.0",
|
|
77
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.324.0",
|
|
78
78
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
79
79
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
80
80
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -54,24 +54,36 @@ export declare class Drivers {
|
|
|
54
54
|
getByDriverIdV1(driverId: string, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.Driver1>;
|
|
55
55
|
private __getByDriverIdV1;
|
|
56
56
|
/**
|
|
57
|
-
* Lists all organization members paired with their driver information if they are drivers. | () -> (list[OrgMembersAndDrivers])
|
|
57
|
+
* Lists all organization members paired with their driver information if they are drivers. Filter by availability. | () -> (list[OrgMembersAndDrivers])
|
|
58
58
|
*
|
|
59
|
+
* @param {Chrt.DriversListOrgMembersAndDriversV1Request} request
|
|
59
60
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
61
|
*
|
|
62
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
63
|
+
*
|
|
61
64
|
* @example
|
|
62
|
-
* await client.drivers.listOrgMembersAndDriversV1(
|
|
65
|
+
* await client.drivers.listOrgMembersAndDriversV1({
|
|
66
|
+
* available_according_to_driver: true,
|
|
67
|
+
* available_according_to_operators: true
|
|
68
|
+
* })
|
|
63
69
|
*/
|
|
64
|
-
listOrgMembersAndDriversV1(requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.OrgMembersAndDrivers[]>;
|
|
70
|
+
listOrgMembersAndDriversV1(request?: Chrt.DriversListOrgMembersAndDriversV1Request, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.OrgMembersAndDrivers[]>;
|
|
65
71
|
private __listOrgMembersAndDriversV1;
|
|
66
72
|
/**
|
|
67
|
-
* Lists all drivers belonging to the caller's organization. | () -> (list[Driver1])
|
|
73
|
+
* Lists all drivers belonging to the caller's organization. Filter by availability. | () -> (list[Driver1])
|
|
68
74
|
*
|
|
75
|
+
* @param {Chrt.DriversListV1Request} request
|
|
69
76
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
70
77
|
*
|
|
78
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
79
|
+
*
|
|
71
80
|
* @example
|
|
72
|
-
* await client.drivers.listV1(
|
|
81
|
+
* await client.drivers.listV1({
|
|
82
|
+
* available_according_to_driver: true,
|
|
83
|
+
* available_according_to_operators: true
|
|
84
|
+
* })
|
|
73
85
|
*/
|
|
74
|
-
listV1(requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.Driver1[]>;
|
|
86
|
+
listV1(request?: Chrt.DriversListV1Request, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.Driver1[]>;
|
|
75
87
|
private __listV1;
|
|
76
88
|
/**
|
|
77
89
|
* Creates a new driver profile for the caller. Returns existing driver ID if one already exists. Courier orgs only, min role: operator. | (DriverClientCreate1) -> (PydanticObjectId)
|
|
@@ -166,25 +166,39 @@ class Drivers {
|
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
|
-
* Lists all organization members paired with their driver information if they are drivers. | () -> (list[OrgMembersAndDrivers])
|
|
169
|
+
* Lists all organization members paired with their driver information if they are drivers. Filter by availability. | () -> (list[OrgMembersAndDrivers])
|
|
170
170
|
*
|
|
171
|
+
* @param {Chrt.DriversListOrgMembersAndDriversV1Request} request
|
|
171
172
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
172
173
|
*
|
|
174
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
175
|
+
*
|
|
173
176
|
* @example
|
|
174
|
-
* await client.drivers.listOrgMembersAndDriversV1(
|
|
177
|
+
* await client.drivers.listOrgMembersAndDriversV1({
|
|
178
|
+
* available_according_to_driver: true,
|
|
179
|
+
* available_according_to_operators: true
|
|
180
|
+
* })
|
|
175
181
|
*/
|
|
176
|
-
listOrgMembersAndDriversV1(requestOptions) {
|
|
177
|
-
return core.HttpResponsePromise.fromPromise(this.__listOrgMembersAndDriversV1(requestOptions));
|
|
182
|
+
listOrgMembersAndDriversV1(request = {}, requestOptions) {
|
|
183
|
+
return core.HttpResponsePromise.fromPromise(this.__listOrgMembersAndDriversV1(request, requestOptions));
|
|
178
184
|
}
|
|
179
|
-
__listOrgMembersAndDriversV1(
|
|
180
|
-
return __awaiter(this,
|
|
181
|
-
var _a, _b, _c, _d;
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
+
__listOrgMembersAndDriversV1() {
|
|
186
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
187
|
+
var _a, _b, _c, _d, _e, _f;
|
|
188
|
+
const { available_according_to_driver: availableAccordingToDriver, available_according_to_operators: availableAccordingToOperators, } = request;
|
|
189
|
+
const _queryParams = {};
|
|
190
|
+
if (availableAccordingToDriver !== undefined) {
|
|
191
|
+
_queryParams["available_according_to_driver"] = (_a = availableAccordingToDriver === null || availableAccordingToDriver === void 0 ? void 0 : availableAccordingToDriver.toString()) !== null && _a !== void 0 ? _a : null;
|
|
192
|
+
}
|
|
193
|
+
if (availableAccordingToOperators !== undefined) {
|
|
194
|
+
_queryParams["available_according_to_operators"] = (_b = availableAccordingToOperators === null || availableAccordingToOperators === void 0 ? void 0 : availableAccordingToOperators.toString()) !== null && _b !== void 0 ? _b : null;
|
|
195
|
+
}
|
|
196
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
197
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
198
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, "oort/drivers/org_members_and_drivers/list/v1"),
|
|
185
199
|
method: "GET",
|
|
186
200
|
headers: _headers,
|
|
187
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
201
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
188
202
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
189
203
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
190
204
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -193,11 +207,16 @@ class Drivers {
|
|
|
193
207
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
194
208
|
}
|
|
195
209
|
if (_response.error.reason === "status-code") {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
210
|
+
switch (_response.error.statusCode) {
|
|
211
|
+
case 422:
|
|
212
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
213
|
+
default:
|
|
214
|
+
throw new errors.ChrtError({
|
|
215
|
+
statusCode: _response.error.statusCode,
|
|
216
|
+
body: _response.error.body,
|
|
217
|
+
rawResponse: _response.rawResponse,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
201
220
|
}
|
|
202
221
|
switch (_response.error.reason) {
|
|
203
222
|
case "non-json":
|
|
@@ -217,25 +236,39 @@ class Drivers {
|
|
|
217
236
|
});
|
|
218
237
|
}
|
|
219
238
|
/**
|
|
220
|
-
* Lists all drivers belonging to the caller's organization. | () -> (list[Driver1])
|
|
239
|
+
* Lists all drivers belonging to the caller's organization. Filter by availability. | () -> (list[Driver1])
|
|
221
240
|
*
|
|
241
|
+
* @param {Chrt.DriversListV1Request} request
|
|
222
242
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
223
243
|
*
|
|
244
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
245
|
+
*
|
|
224
246
|
* @example
|
|
225
|
-
* await client.drivers.listV1(
|
|
247
|
+
* await client.drivers.listV1({
|
|
248
|
+
* available_according_to_driver: true,
|
|
249
|
+
* available_according_to_operators: true
|
|
250
|
+
* })
|
|
226
251
|
*/
|
|
227
|
-
listV1(requestOptions) {
|
|
228
|
-
return core.HttpResponsePromise.fromPromise(this.__listV1(requestOptions));
|
|
252
|
+
listV1(request = {}, requestOptions) {
|
|
253
|
+
return core.HttpResponsePromise.fromPromise(this.__listV1(request, requestOptions));
|
|
229
254
|
}
|
|
230
|
-
__listV1(
|
|
231
|
-
return __awaiter(this,
|
|
232
|
-
var _a, _b, _c, _d;
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
|
|
255
|
+
__listV1() {
|
|
256
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
257
|
+
var _a, _b, _c, _d, _e, _f;
|
|
258
|
+
const { available_according_to_driver: availableAccordingToDriver, available_according_to_operators: availableAccordingToOperators, } = request;
|
|
259
|
+
const _queryParams = {};
|
|
260
|
+
if (availableAccordingToDriver !== undefined) {
|
|
261
|
+
_queryParams["available_according_to_driver"] = (_a = availableAccordingToDriver === null || availableAccordingToDriver === void 0 ? void 0 : availableAccordingToDriver.toString()) !== null && _a !== void 0 ? _a : null;
|
|
262
|
+
}
|
|
263
|
+
if (availableAccordingToOperators !== undefined) {
|
|
264
|
+
_queryParams["available_according_to_operators"] = (_b = availableAccordingToOperators === null || availableAccordingToOperators === void 0 ? void 0 : availableAccordingToOperators.toString()) !== null && _b !== void 0 ? _b : null;
|
|
265
|
+
}
|
|
266
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
267
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
268
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, "oort/drivers/list/v1"),
|
|
236
269
|
method: "GET",
|
|
237
270
|
headers: _headers,
|
|
238
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
271
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
239
272
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
240
273
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
241
274
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -244,11 +277,16 @@ class Drivers {
|
|
|
244
277
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
245
278
|
}
|
|
246
279
|
if (_response.error.reason === "status-code") {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
280
|
+
switch (_response.error.statusCode) {
|
|
281
|
+
case 422:
|
|
282
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
283
|
+
default:
|
|
284
|
+
throw new errors.ChrtError({
|
|
285
|
+
statusCode: _response.error.statusCode,
|
|
286
|
+
body: _response.error.body,
|
|
287
|
+
rawResponse: _response.rawResponse,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
252
290
|
}
|
|
253
291
|
switch (_response.error.reason) {
|
|
254
292
|
case "non-json":
|
package/dist/cjs/api/resources/drivers/client/requests/DriversListOrgMembersAndDriversV1Request.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* available_according_to_driver: true,
|
|
8
|
+
* available_according_to_operators: true
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface DriversListOrgMembersAndDriversV1Request {
|
|
12
|
+
/** Filter by driver's self-reported availability. */
|
|
13
|
+
available_according_to_driver?: boolean | null;
|
|
14
|
+
/** Filter by operator-set availability. */
|
|
15
|
+
available_according_to_operators?: boolean | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* available_according_to_driver: true,
|
|
8
|
+
* available_according_to_operators: true
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface DriversListV1Request {
|
|
12
|
+
/** Filter by driver's self-reported availability. */
|
|
13
|
+
available_according_to_driver?: boolean | null;
|
|
14
|
+
/** Filter by operator-set availability. */
|
|
15
|
+
available_according_to_operators?: boolean | null;
|
|
16
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { type DriversListOrgMembersAndDriversV1Request } from "./DriversListOrgMembersAndDriversV1Request.js";
|
|
2
|
+
export { type DriversListV1Request } from "./DriversListV1Request.js";
|
|
1
3
|
export { type DriverClientCreate1 } from "./DriverClientCreate1.js";
|
|
2
4
|
export { type DriverClientUpdate1 } from "./DriverClientUpdate1.js";
|
|
3
5
|
export { type DriverLastSeenReq } from "./DriverLastSeenReq.js";
|
|
@@ -47,19 +47,66 @@ export declare class TaskGroup {
|
|
|
47
47
|
addV1(request: Chrt.orderDrafts.OrderDraftAddTaskGroupReq, requestOptions?: TaskGroup.RequestOptions): core.HttpResponsePromise<string>;
|
|
48
48
|
private __addV1;
|
|
49
49
|
/**
|
|
50
|
-
* Sets
|
|
50
|
+
* Sets the flight number on a draft task group. | (SetFlightNumberDraftReq) -> (bool)
|
|
51
51
|
*
|
|
52
52
|
* @param {string} taskGroupId
|
|
53
|
-
* @param {Chrt.orderDrafts.
|
|
53
|
+
* @param {Chrt.orderDrafts.SetFlightNumberDraftReq} request
|
|
54
54
|
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
55
|
*
|
|
56
56
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
|
-
* await client.orderDrafts.taskGroup.
|
|
59
|
+
* await client.orderDrafts.taskGroup.setFlightNumberV1("task_group_id", {
|
|
60
|
+
* flight_number: "flight_number"
|
|
61
|
+
* })
|
|
62
|
+
*/
|
|
63
|
+
setFlightNumberV1(taskGroupId: string, request: Chrt.orderDrafts.SetFlightNumberDraftReq, requestOptions?: TaskGroup.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
64
|
+
private __setFlightNumberV1;
|
|
65
|
+
/**
|
|
66
|
+
* Updates the courier organization assigned to a draft task group. | (UpdateCourierOrgDraftReq) -> (bool)
|
|
67
|
+
*
|
|
68
|
+
* @param {string} taskGroupId
|
|
69
|
+
* @param {Chrt.orderDrafts.UpdateCourierOrgDraftReq} request
|
|
70
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
|
+
*
|
|
72
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* await client.orderDrafts.taskGroup.updateCourierOrgV1("task_group_id", {
|
|
76
|
+
* courier_org_id: "courier_org_id"
|
|
77
|
+
* })
|
|
78
|
+
*/
|
|
79
|
+
updateCourierOrgV1(taskGroupId: string, request: Chrt.orderDrafts.UpdateCourierOrgDraftReq, requestOptions?: TaskGroup.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
80
|
+
private __updateCourierOrgV1;
|
|
81
|
+
/**
|
|
82
|
+
* Removes the courier organization from a draft task group (sets courier_org_id to null). | () -> (bool)
|
|
83
|
+
*
|
|
84
|
+
* @param {string} taskGroupId
|
|
85
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
|
+
*
|
|
87
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* await client.orderDrafts.taskGroup.removeCourierOrgV1("task_group_id")
|
|
91
|
+
*/
|
|
92
|
+
removeCourierOrgV1(taskGroupId: string, requestOptions?: TaskGroup.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
93
|
+
private __removeCourierOrgV1;
|
|
94
|
+
/**
|
|
95
|
+
* Sets the ordering of tasks within a draft task group. Must provide all task IDs with no duplicates. | (SetTaskOrderingDraftReq) -> (bool)
|
|
96
|
+
*
|
|
97
|
+
* @param {string} taskGroupId
|
|
98
|
+
* @param {Chrt.orderDrafts.SetTaskOrderingDraftReq} request
|
|
99
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
100
|
+
*
|
|
101
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* await client.orderDrafts.taskGroup.setTaskOrderingV1("task_group_id", {
|
|
105
|
+
* task_ids: ["task_ids"]
|
|
106
|
+
* })
|
|
60
107
|
*/
|
|
61
|
-
|
|
62
|
-
private
|
|
108
|
+
setTaskOrderingV1(taskGroupId: string, request: Chrt.orderDrafts.SetTaskOrderingDraftReq, requestOptions?: TaskGroup.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
109
|
+
private __setTaskOrderingV1;
|
|
63
110
|
/**
|
|
64
111
|
* Deletes a task group and all associated entities (tasks, task artifacts, S3 metadata). The task group must belong to a DRAFT order. | () -> (bool)
|
|
65
112
|
*
|
|
@@ -121,26 +121,28 @@ class TaskGroup {
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
|
-
* Sets
|
|
124
|
+
* Sets the flight number on a draft task group. | (SetFlightNumberDraftReq) -> (bool)
|
|
125
125
|
*
|
|
126
126
|
* @param {string} taskGroupId
|
|
127
|
-
* @param {Chrt.orderDrafts.
|
|
127
|
+
* @param {Chrt.orderDrafts.SetFlightNumberDraftReq} request
|
|
128
128
|
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
129
129
|
*
|
|
130
130
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
131
131
|
*
|
|
132
132
|
* @example
|
|
133
|
-
* await client.orderDrafts.taskGroup.
|
|
133
|
+
* await client.orderDrafts.taskGroup.setFlightNumberV1("task_group_id", {
|
|
134
|
+
* flight_number: "flight_number"
|
|
135
|
+
* })
|
|
134
136
|
*/
|
|
135
|
-
|
|
136
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
137
|
+
setFlightNumberV1(taskGroupId, request, requestOptions) {
|
|
138
|
+
return core.HttpResponsePromise.fromPromise(this.__setFlightNumberV1(taskGroupId, request, requestOptions));
|
|
137
139
|
}
|
|
138
|
-
|
|
139
|
-
return __awaiter(this,
|
|
140
|
+
__setFlightNumberV1(taskGroupId, request, requestOptions) {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
142
|
var _a, _b, _c, _d;
|
|
141
143
|
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);
|
|
142
144
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
143
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/order_drafts/task_group/
|
|
145
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/order_drafts/task_group/set_flight_number/v1/${encodeURIComponent(taskGroupId)}`),
|
|
144
146
|
method: "PATCH",
|
|
145
147
|
headers: _headers,
|
|
146
148
|
contentType: "application/json",
|
|
@@ -174,7 +176,196 @@ class TaskGroup {
|
|
|
174
176
|
rawResponse: _response.rawResponse,
|
|
175
177
|
});
|
|
176
178
|
case "timeout":
|
|
177
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/task_group/
|
|
179
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/task_group/set_flight_number/v1/{task_group_id}.");
|
|
180
|
+
case "unknown":
|
|
181
|
+
throw new errors.ChrtError({
|
|
182
|
+
message: _response.error.errorMessage,
|
|
183
|
+
rawResponse: _response.rawResponse,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Updates the courier organization assigned to a draft task group. | (UpdateCourierOrgDraftReq) -> (bool)
|
|
190
|
+
*
|
|
191
|
+
* @param {string} taskGroupId
|
|
192
|
+
* @param {Chrt.orderDrafts.UpdateCourierOrgDraftReq} request
|
|
193
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
194
|
+
*
|
|
195
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* await client.orderDrafts.taskGroup.updateCourierOrgV1("task_group_id", {
|
|
199
|
+
* courier_org_id: "courier_org_id"
|
|
200
|
+
* })
|
|
201
|
+
*/
|
|
202
|
+
updateCourierOrgV1(taskGroupId, request, requestOptions) {
|
|
203
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCourierOrgV1(taskGroupId, request, requestOptions));
|
|
204
|
+
}
|
|
205
|
+
__updateCourierOrgV1(taskGroupId, request, requestOptions) {
|
|
206
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
+
var _a, _b, _c, _d;
|
|
208
|
+
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);
|
|
209
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
210
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/order_drafts/task_group/update_courier_org/v1/${encodeURIComponent(taskGroupId)}`),
|
|
211
|
+
method: "PATCH",
|
|
212
|
+
headers: _headers,
|
|
213
|
+
contentType: "application/json",
|
|
214
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
215
|
+
requestType: "json",
|
|
216
|
+
body: request,
|
|
217
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
218
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
219
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
220
|
+
});
|
|
221
|
+
if (_response.ok) {
|
|
222
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
223
|
+
}
|
|
224
|
+
if (_response.error.reason === "status-code") {
|
|
225
|
+
switch (_response.error.statusCode) {
|
|
226
|
+
case 422:
|
|
227
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
228
|
+
default:
|
|
229
|
+
throw new errors.ChrtError({
|
|
230
|
+
statusCode: _response.error.statusCode,
|
|
231
|
+
body: _response.error.body,
|
|
232
|
+
rawResponse: _response.rawResponse,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
switch (_response.error.reason) {
|
|
237
|
+
case "non-json":
|
|
238
|
+
throw new errors.ChrtError({
|
|
239
|
+
statusCode: _response.error.statusCode,
|
|
240
|
+
body: _response.error.rawBody,
|
|
241
|
+
rawResponse: _response.rawResponse,
|
|
242
|
+
});
|
|
243
|
+
case "timeout":
|
|
244
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/task_group/update_courier_org/v1/{task_group_id}.");
|
|
245
|
+
case "unknown":
|
|
246
|
+
throw new errors.ChrtError({
|
|
247
|
+
message: _response.error.errorMessage,
|
|
248
|
+
rawResponse: _response.rawResponse,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Removes the courier organization from a draft task group (sets courier_org_id to null). | () -> (bool)
|
|
255
|
+
*
|
|
256
|
+
* @param {string} taskGroupId
|
|
257
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
258
|
+
*
|
|
259
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* await client.orderDrafts.taskGroup.removeCourierOrgV1("task_group_id")
|
|
263
|
+
*/
|
|
264
|
+
removeCourierOrgV1(taskGroupId, requestOptions) {
|
|
265
|
+
return core.HttpResponsePromise.fromPromise(this.__removeCourierOrgV1(taskGroupId, requestOptions));
|
|
266
|
+
}
|
|
267
|
+
__removeCourierOrgV1(taskGroupId, requestOptions) {
|
|
268
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
269
|
+
var _a, _b, _c, _d;
|
|
270
|
+
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);
|
|
271
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
272
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/order_drafts/task_group/remove_courier_org/v1/${encodeURIComponent(taskGroupId)}`),
|
|
273
|
+
method: "PATCH",
|
|
274
|
+
headers: _headers,
|
|
275
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
276
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
277
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
278
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
279
|
+
});
|
|
280
|
+
if (_response.ok) {
|
|
281
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
282
|
+
}
|
|
283
|
+
if (_response.error.reason === "status-code") {
|
|
284
|
+
switch (_response.error.statusCode) {
|
|
285
|
+
case 422:
|
|
286
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
287
|
+
default:
|
|
288
|
+
throw new errors.ChrtError({
|
|
289
|
+
statusCode: _response.error.statusCode,
|
|
290
|
+
body: _response.error.body,
|
|
291
|
+
rawResponse: _response.rawResponse,
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
switch (_response.error.reason) {
|
|
296
|
+
case "non-json":
|
|
297
|
+
throw new errors.ChrtError({
|
|
298
|
+
statusCode: _response.error.statusCode,
|
|
299
|
+
body: _response.error.rawBody,
|
|
300
|
+
rawResponse: _response.rawResponse,
|
|
301
|
+
});
|
|
302
|
+
case "timeout":
|
|
303
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/task_group/remove_courier_org/v1/{task_group_id}.");
|
|
304
|
+
case "unknown":
|
|
305
|
+
throw new errors.ChrtError({
|
|
306
|
+
message: _response.error.errorMessage,
|
|
307
|
+
rawResponse: _response.rawResponse,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Sets the ordering of tasks within a draft task group. Must provide all task IDs with no duplicates. | (SetTaskOrderingDraftReq) -> (bool)
|
|
314
|
+
*
|
|
315
|
+
* @param {string} taskGroupId
|
|
316
|
+
* @param {Chrt.orderDrafts.SetTaskOrderingDraftReq} request
|
|
317
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
318
|
+
*
|
|
319
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* await client.orderDrafts.taskGroup.setTaskOrderingV1("task_group_id", {
|
|
323
|
+
* task_ids: ["task_ids"]
|
|
324
|
+
* })
|
|
325
|
+
*/
|
|
326
|
+
setTaskOrderingV1(taskGroupId, request, requestOptions) {
|
|
327
|
+
return core.HttpResponsePromise.fromPromise(this.__setTaskOrderingV1(taskGroupId, request, requestOptions));
|
|
328
|
+
}
|
|
329
|
+
__setTaskOrderingV1(taskGroupId, request, requestOptions) {
|
|
330
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
331
|
+
var _a, _b, _c, _d;
|
|
332
|
+
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);
|
|
333
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
334
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/order_drafts/task_group/set_task_ordering/v1/${encodeURIComponent(taskGroupId)}`),
|
|
335
|
+
method: "PUT",
|
|
336
|
+
headers: _headers,
|
|
337
|
+
contentType: "application/json",
|
|
338
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
339
|
+
requestType: "json",
|
|
340
|
+
body: request,
|
|
341
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
342
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
343
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
344
|
+
});
|
|
345
|
+
if (_response.ok) {
|
|
346
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
347
|
+
}
|
|
348
|
+
if (_response.error.reason === "status-code") {
|
|
349
|
+
switch (_response.error.statusCode) {
|
|
350
|
+
case 422:
|
|
351
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
352
|
+
default:
|
|
353
|
+
throw new errors.ChrtError({
|
|
354
|
+
statusCode: _response.error.statusCode,
|
|
355
|
+
body: _response.error.body,
|
|
356
|
+
rawResponse: _response.rawResponse,
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
switch (_response.error.reason) {
|
|
361
|
+
case "non-json":
|
|
362
|
+
throw new errors.ChrtError({
|
|
363
|
+
statusCode: _response.error.statusCode,
|
|
364
|
+
body: _response.error.rawBody,
|
|
365
|
+
rawResponse: _response.rawResponse,
|
|
366
|
+
});
|
|
367
|
+
case "timeout":
|
|
368
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /oort/order_drafts/task_group/set_task_ordering/v1/{task_group_id}.");
|
|
178
369
|
case "unknown":
|
|
179
370
|
throw new errors.ChrtError({
|
|
180
371
|
message: _response.error.errorMessage,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* flight_number: "flight_number"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface SetFlightNumberDraftReq {
|
|
11
|
+
/** Flight number to set on the task group */
|
|
12
|
+
flight_number: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* task_ids: ["task_ids"]
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface SetTaskOrderingDraftReq {
|
|
11
|
+
/** Complete list of task IDs in the desired order */
|
|
12
|
+
task_ids: string[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* courier_org_id: "courier_org_id"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface UpdateCourierOrgDraftReq {
|
|
11
|
+
/** ID of the courier organization to assign to the task group */
|
|
12
|
+
courier_org_id: string;
|
|
13
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { type OrderDraftAddTaskGroupReq } from "./OrderDraftAddTaskGroupReq.js";
|
|
2
|
-
export { type
|
|
2
|
+
export { type SetFlightNumberDraftReq } from "./SetFlightNumberDraftReq.js";
|
|
3
|
+
export { type UpdateCourierOrgDraftReq } from "./UpdateCourierOrgDraftReq.js";
|
|
4
|
+
export { type SetTaskOrderingDraftReq } from "./SetTaskOrderingDraftReq.js";
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.324.0";
|