@chrt-inc/typescript-sdk 1.322.0 → 1.325.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/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -37,8 +37,8 @@ export class ChrtClient {
|
|
|
37
37
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
38
38
|
"X-Fern-Language": "JavaScript",
|
|
39
39
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
40
|
-
"X-Fern-SDK-Version": "1.
|
|
41
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
40
|
+
"X-Fern-SDK-Version": "1.325.0",
|
|
41
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.325.0",
|
|
42
42
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
43
43
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
44
44
|
}, _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)
|
|
@@ -130,25 +130,39 @@ export class Drivers {
|
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
|
-
* Lists all organization members paired with their driver information if they are drivers. | () -> (list[OrgMembersAndDrivers])
|
|
133
|
+
* Lists all organization members paired with their driver information if they are drivers. Filter by availability. | () -> (list[OrgMembersAndDrivers])
|
|
134
134
|
*
|
|
135
|
+
* @param {Chrt.DriversListOrgMembersAndDriversV1Request} request
|
|
135
136
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
136
137
|
*
|
|
138
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
139
|
+
*
|
|
137
140
|
* @example
|
|
138
|
-
* await client.drivers.listOrgMembersAndDriversV1(
|
|
141
|
+
* await client.drivers.listOrgMembersAndDriversV1({
|
|
142
|
+
* available_according_to_driver: true,
|
|
143
|
+
* available_according_to_operators: true
|
|
144
|
+
* })
|
|
139
145
|
*/
|
|
140
|
-
listOrgMembersAndDriversV1(requestOptions) {
|
|
141
|
-
return core.HttpResponsePromise.fromPromise(this.__listOrgMembersAndDriversV1(requestOptions));
|
|
146
|
+
listOrgMembersAndDriversV1(request = {}, requestOptions) {
|
|
147
|
+
return core.HttpResponsePromise.fromPromise(this.__listOrgMembersAndDriversV1(request, requestOptions));
|
|
142
148
|
}
|
|
143
|
-
__listOrgMembersAndDriversV1(
|
|
144
|
-
return __awaiter(this,
|
|
145
|
-
var _a, _b, _c, _d;
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
+
__listOrgMembersAndDriversV1() {
|
|
150
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
151
|
+
var _a, _b, _c, _d, _e, _f;
|
|
152
|
+
const { available_according_to_driver: availableAccordingToDriver, available_according_to_operators: availableAccordingToOperators, } = request;
|
|
153
|
+
const _queryParams = {};
|
|
154
|
+
if (availableAccordingToDriver !== undefined) {
|
|
155
|
+
_queryParams["available_according_to_driver"] = (_a = availableAccordingToDriver === null || availableAccordingToDriver === void 0 ? void 0 : availableAccordingToDriver.toString()) !== null && _a !== void 0 ? _a : null;
|
|
156
|
+
}
|
|
157
|
+
if (availableAccordingToOperators !== undefined) {
|
|
158
|
+
_queryParams["available_according_to_operators"] = (_b = availableAccordingToOperators === null || availableAccordingToOperators === void 0 ? void 0 : availableAccordingToOperators.toString()) !== null && _b !== void 0 ? _b : null;
|
|
159
|
+
}
|
|
160
|
+
let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
161
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
162
|
+
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"),
|
|
149
163
|
method: "GET",
|
|
150
164
|
headers: _headers,
|
|
151
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
165
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
152
166
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
153
167
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
154
168
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -157,11 +171,16 @@ export class Drivers {
|
|
|
157
171
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
158
172
|
}
|
|
159
173
|
if (_response.error.reason === "status-code") {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
switch (_response.error.statusCode) {
|
|
175
|
+
case 422:
|
|
176
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
177
|
+
default:
|
|
178
|
+
throw new errors.ChrtError({
|
|
179
|
+
statusCode: _response.error.statusCode,
|
|
180
|
+
body: _response.error.body,
|
|
181
|
+
rawResponse: _response.rawResponse,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
165
184
|
}
|
|
166
185
|
switch (_response.error.reason) {
|
|
167
186
|
case "non-json":
|
|
@@ -181,25 +200,39 @@ export class Drivers {
|
|
|
181
200
|
});
|
|
182
201
|
}
|
|
183
202
|
/**
|
|
184
|
-
* Lists all drivers belonging to the caller's organization. | () -> (list[Driver1])
|
|
203
|
+
* Lists all drivers belonging to the caller's organization. Filter by availability. | () -> (list[Driver1])
|
|
185
204
|
*
|
|
205
|
+
* @param {Chrt.DriversListV1Request} request
|
|
186
206
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
187
207
|
*
|
|
208
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
209
|
+
*
|
|
188
210
|
* @example
|
|
189
|
-
* await client.drivers.listV1(
|
|
211
|
+
* await client.drivers.listV1({
|
|
212
|
+
* available_according_to_driver: true,
|
|
213
|
+
* available_according_to_operators: true
|
|
214
|
+
* })
|
|
190
215
|
*/
|
|
191
|
-
listV1(requestOptions) {
|
|
192
|
-
return core.HttpResponsePromise.fromPromise(this.__listV1(requestOptions));
|
|
216
|
+
listV1(request = {}, requestOptions) {
|
|
217
|
+
return core.HttpResponsePromise.fromPromise(this.__listV1(request, requestOptions));
|
|
193
218
|
}
|
|
194
|
-
__listV1(
|
|
195
|
-
return __awaiter(this,
|
|
196
|
-
var _a, _b, _c, _d;
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
|
|
219
|
+
__listV1() {
|
|
220
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
221
|
+
var _a, _b, _c, _d, _e, _f;
|
|
222
|
+
const { available_according_to_driver: availableAccordingToDriver, available_according_to_operators: availableAccordingToOperators, } = request;
|
|
223
|
+
const _queryParams = {};
|
|
224
|
+
if (availableAccordingToDriver !== undefined) {
|
|
225
|
+
_queryParams["available_according_to_driver"] = (_a = availableAccordingToDriver === null || availableAccordingToDriver === void 0 ? void 0 : availableAccordingToDriver.toString()) !== null && _a !== void 0 ? _a : null;
|
|
226
|
+
}
|
|
227
|
+
if (availableAccordingToOperators !== undefined) {
|
|
228
|
+
_queryParams["available_according_to_operators"] = (_b = availableAccordingToOperators === null || availableAccordingToOperators === void 0 ? void 0 : availableAccordingToOperators.toString()) !== null && _b !== void 0 ? _b : null;
|
|
229
|
+
}
|
|
230
|
+
let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
231
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
232
|
+
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"),
|
|
200
233
|
method: "GET",
|
|
201
234
|
headers: _headers,
|
|
202
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
235
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
203
236
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
204
237
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
205
238
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -208,11 +241,16 @@ export class Drivers {
|
|
|
208
241
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
209
242
|
}
|
|
210
243
|
if (_response.error.reason === "status-code") {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
244
|
+
switch (_response.error.statusCode) {
|
|
245
|
+
case 422:
|
|
246
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
247
|
+
default:
|
|
248
|
+
throw new errors.ChrtError({
|
|
249
|
+
statusCode: _response.error.statusCode,
|
|
250
|
+
body: _response.error.body,
|
|
251
|
+
rawResponse: _response.rawResponse,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
216
254
|
}
|
|
217
255
|
switch (_response.error.reason) {
|
|
218
256
|
case "non-json":
|
|
@@ -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.mjs";
|
|
2
|
+
export { type DriversListV1Request } from "./DriversListV1Request.mjs";
|
|
1
3
|
export { type DriverClientCreate1 } from "./DriverClientCreate1.mjs";
|
|
2
4
|
export { type DriverClientUpdate1 } from "./DriverClientUpdate1.mjs";
|
|
3
5
|
export { type DriverLastSeenReq } from "./DriverLastSeenReq.mjs";
|
|
@@ -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
|
*
|
|
@@ -85,26 +85,28 @@ export class TaskGroup {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
|
-
* Sets
|
|
88
|
+
* Sets the flight number on a draft task group. | (SetFlightNumberDraftReq) -> (bool)
|
|
89
89
|
*
|
|
90
90
|
* @param {string} taskGroupId
|
|
91
|
-
* @param {Chrt.orderDrafts.
|
|
91
|
+
* @param {Chrt.orderDrafts.SetFlightNumberDraftReq} request
|
|
92
92
|
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
93
93
|
*
|
|
94
94
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
95
95
|
*
|
|
96
96
|
* @example
|
|
97
|
-
* await client.orderDrafts.taskGroup.
|
|
97
|
+
* await client.orderDrafts.taskGroup.setFlightNumberV1("task_group_id", {
|
|
98
|
+
* flight_number: "flight_number"
|
|
99
|
+
* })
|
|
98
100
|
*/
|
|
99
|
-
|
|
100
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
101
|
+
setFlightNumberV1(taskGroupId, request, requestOptions) {
|
|
102
|
+
return core.HttpResponsePromise.fromPromise(this.__setFlightNumberV1(taskGroupId, request, requestOptions));
|
|
101
103
|
}
|
|
102
|
-
|
|
103
|
-
return __awaiter(this,
|
|
104
|
+
__setFlightNumberV1(taskGroupId, request, requestOptions) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
106
|
var _a, _b, _c, _d;
|
|
105
107
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
106
108
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
107
|
-
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/
|
|
109
|
+
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)}`),
|
|
108
110
|
method: "PATCH",
|
|
109
111
|
headers: _headers,
|
|
110
112
|
contentType: "application/json",
|
|
@@ -138,7 +140,196 @@ export class TaskGroup {
|
|
|
138
140
|
rawResponse: _response.rawResponse,
|
|
139
141
|
});
|
|
140
142
|
case "timeout":
|
|
141
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/task_group/
|
|
143
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/task_group/set_flight_number/v1/{task_group_id}.");
|
|
144
|
+
case "unknown":
|
|
145
|
+
throw new errors.ChrtError({
|
|
146
|
+
message: _response.error.errorMessage,
|
|
147
|
+
rawResponse: _response.rawResponse,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Updates the courier organization assigned to a draft task group. | (UpdateCourierOrgDraftReq) -> (bool)
|
|
154
|
+
*
|
|
155
|
+
* @param {string} taskGroupId
|
|
156
|
+
* @param {Chrt.orderDrafts.UpdateCourierOrgDraftReq} request
|
|
157
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
158
|
+
*
|
|
159
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* await client.orderDrafts.taskGroup.updateCourierOrgV1("task_group_id", {
|
|
163
|
+
* courier_org_id: "courier_org_id"
|
|
164
|
+
* })
|
|
165
|
+
*/
|
|
166
|
+
updateCourierOrgV1(taskGroupId, request, requestOptions) {
|
|
167
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCourierOrgV1(taskGroupId, request, requestOptions));
|
|
168
|
+
}
|
|
169
|
+
__updateCourierOrgV1(taskGroupId, request, requestOptions) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
var _a, _b, _c, _d;
|
|
172
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
173
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
174
|
+
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)}`),
|
|
175
|
+
method: "PATCH",
|
|
176
|
+
headers: _headers,
|
|
177
|
+
contentType: "application/json",
|
|
178
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
179
|
+
requestType: "json",
|
|
180
|
+
body: request,
|
|
181
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
182
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
183
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
184
|
+
});
|
|
185
|
+
if (_response.ok) {
|
|
186
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
187
|
+
}
|
|
188
|
+
if (_response.error.reason === "status-code") {
|
|
189
|
+
switch (_response.error.statusCode) {
|
|
190
|
+
case 422:
|
|
191
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
192
|
+
default:
|
|
193
|
+
throw new errors.ChrtError({
|
|
194
|
+
statusCode: _response.error.statusCode,
|
|
195
|
+
body: _response.error.body,
|
|
196
|
+
rawResponse: _response.rawResponse,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
switch (_response.error.reason) {
|
|
201
|
+
case "non-json":
|
|
202
|
+
throw new errors.ChrtError({
|
|
203
|
+
statusCode: _response.error.statusCode,
|
|
204
|
+
body: _response.error.rawBody,
|
|
205
|
+
rawResponse: _response.rawResponse,
|
|
206
|
+
});
|
|
207
|
+
case "timeout":
|
|
208
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/task_group/update_courier_org/v1/{task_group_id}.");
|
|
209
|
+
case "unknown":
|
|
210
|
+
throw new errors.ChrtError({
|
|
211
|
+
message: _response.error.errorMessage,
|
|
212
|
+
rawResponse: _response.rawResponse,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Removes the courier organization from a draft task group (sets courier_org_id to null). | () -> (bool)
|
|
219
|
+
*
|
|
220
|
+
* @param {string} taskGroupId
|
|
221
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
222
|
+
*
|
|
223
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* await client.orderDrafts.taskGroup.removeCourierOrgV1("task_group_id")
|
|
227
|
+
*/
|
|
228
|
+
removeCourierOrgV1(taskGroupId, requestOptions) {
|
|
229
|
+
return core.HttpResponsePromise.fromPromise(this.__removeCourierOrgV1(taskGroupId, requestOptions));
|
|
230
|
+
}
|
|
231
|
+
__removeCourierOrgV1(taskGroupId, requestOptions) {
|
|
232
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
233
|
+
var _a, _b, _c, _d;
|
|
234
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
235
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
236
|
+
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)}`),
|
|
237
|
+
method: "PATCH",
|
|
238
|
+
headers: _headers,
|
|
239
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
240
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
241
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
242
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
243
|
+
});
|
|
244
|
+
if (_response.ok) {
|
|
245
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
246
|
+
}
|
|
247
|
+
if (_response.error.reason === "status-code") {
|
|
248
|
+
switch (_response.error.statusCode) {
|
|
249
|
+
case 422:
|
|
250
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
251
|
+
default:
|
|
252
|
+
throw new errors.ChrtError({
|
|
253
|
+
statusCode: _response.error.statusCode,
|
|
254
|
+
body: _response.error.body,
|
|
255
|
+
rawResponse: _response.rawResponse,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
switch (_response.error.reason) {
|
|
260
|
+
case "non-json":
|
|
261
|
+
throw new errors.ChrtError({
|
|
262
|
+
statusCode: _response.error.statusCode,
|
|
263
|
+
body: _response.error.rawBody,
|
|
264
|
+
rawResponse: _response.rawResponse,
|
|
265
|
+
});
|
|
266
|
+
case "timeout":
|
|
267
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /oort/order_drafts/task_group/remove_courier_org/v1/{task_group_id}.");
|
|
268
|
+
case "unknown":
|
|
269
|
+
throw new errors.ChrtError({
|
|
270
|
+
message: _response.error.errorMessage,
|
|
271
|
+
rawResponse: _response.rawResponse,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Sets the ordering of tasks within a draft task group. Must provide all task IDs with no duplicates. | (SetTaskOrderingDraftReq) -> (bool)
|
|
278
|
+
*
|
|
279
|
+
* @param {string} taskGroupId
|
|
280
|
+
* @param {Chrt.orderDrafts.SetTaskOrderingDraftReq} request
|
|
281
|
+
* @param {TaskGroup.RequestOptions} requestOptions - Request-specific configuration.
|
|
282
|
+
*
|
|
283
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* await client.orderDrafts.taskGroup.setTaskOrderingV1("task_group_id", {
|
|
287
|
+
* task_ids: ["task_ids"]
|
|
288
|
+
* })
|
|
289
|
+
*/
|
|
290
|
+
setTaskOrderingV1(taskGroupId, request, requestOptions) {
|
|
291
|
+
return core.HttpResponsePromise.fromPromise(this.__setTaskOrderingV1(taskGroupId, request, requestOptions));
|
|
292
|
+
}
|
|
293
|
+
__setTaskOrderingV1(taskGroupId, request, requestOptions) {
|
|
294
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
var _a, _b, _c, _d;
|
|
296
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
297
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
298
|
+
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)}`),
|
|
299
|
+
method: "PUT",
|
|
300
|
+
headers: _headers,
|
|
301
|
+
contentType: "application/json",
|
|
302
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
303
|
+
requestType: "json",
|
|
304
|
+
body: request,
|
|
305
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
306
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
307
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
308
|
+
});
|
|
309
|
+
if (_response.ok) {
|
|
310
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
311
|
+
}
|
|
312
|
+
if (_response.error.reason === "status-code") {
|
|
313
|
+
switch (_response.error.statusCode) {
|
|
314
|
+
case 422:
|
|
315
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
316
|
+
default:
|
|
317
|
+
throw new errors.ChrtError({
|
|
318
|
+
statusCode: _response.error.statusCode,
|
|
319
|
+
body: _response.error.body,
|
|
320
|
+
rawResponse: _response.rawResponse,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
switch (_response.error.reason) {
|
|
325
|
+
case "non-json":
|
|
326
|
+
throw new errors.ChrtError({
|
|
327
|
+
statusCode: _response.error.statusCode,
|
|
328
|
+
body: _response.error.rawBody,
|
|
329
|
+
rawResponse: _response.rawResponse,
|
|
330
|
+
});
|
|
331
|
+
case "timeout":
|
|
332
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /oort/order_drafts/task_group/set_task_ordering/v1/{task_group_id}.");
|
|
142
333
|
case "unknown":
|
|
143
334
|
throw new errors.ChrtError({
|
|
144
335
|
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.mjs";
|
|
2
|
-
export { type
|
|
2
|
+
export { type SetFlightNumberDraftReq } from "./SetFlightNumberDraftReq.mjs";
|
|
3
|
+
export { type UpdateCourierOrgDraftReq } from "./UpdateCourierOrgDraftReq.mjs";
|
|
4
|
+
export { type SetTaskOrderingDraftReq } from "./SetTaskOrderingDraftReq.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.325.0";
|