@chrt-inc/typescript-sdk 1.293.0 → 1.296.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/orders/client/requests/OrdersExpandedReq.d.ts +2 -0
- package/dist/cjs/api/resources/taskGroups/client/Client.d.ts +46 -21
- package/dist/cjs/api/resources/taskGroups/client/Client.js +162 -35
- package/dist/cjs/api/resources/taskGroups/client/requests/TaskGroupExpandedForCourierAdministratorReq.d.ts +34 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/TaskGroupExpandedForCourierDriverReq.d.ts +32 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/index.d.ts +3 -1
- package/dist/cjs/api/resources/taskGroups/resources/index.d.ts +0 -2
- package/dist/cjs/api/resources/taskGroups/resources/index.js +1 -6
- package/dist/cjs/api/types/TaskExpanded.d.ts +1 -1
- package/dist/cjs/api/types/TaskGroup1.d.ts +1 -0
- package/dist/cjs/api/types/TaskGroupExpanded.d.ts +2 -6
- package/dist/cjs/api/types/TaskGroupExpandedForCourierAdministrator.d.ts +18 -0
- package/dist/cjs/api/{resources/taskGroups/resources/togglePause/client/requests/index.js → types/TaskGroupExpandedForCourierAdministrator.js} +3 -0
- package/dist/cjs/api/types/TaskGroupExpandedForCourierDriver.d.ts +16 -0
- package/dist/cjs/api/types/TaskGroupExpandedForCourierDriver.js +5 -0
- package/dist/cjs/api/types/TaskGroupsExpandedForCourierAdministratorRes.d.ts +7 -0
- package/dist/cjs/api/types/TaskGroupsExpandedForCourierAdministratorRes.js +5 -0
- package/dist/cjs/api/types/TaskGroupsExpandedForCourierDriverRes.d.ts +7 -0
- package/dist/cjs/api/types/TaskGroupsExpandedForCourierDriverRes.js +5 -0
- package/dist/cjs/api/types/index.d.ts +5 -2
- package/dist/cjs/api/types/index.js +5 -2
- 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/orders/client/requests/OrdersExpandedReq.d.mts +2 -0
- package/dist/esm/api/resources/taskGroups/client/Client.d.mts +46 -21
- package/dist/esm/api/resources/taskGroups/client/Client.mjs +162 -35
- package/dist/esm/api/resources/taskGroups/client/requests/TaskGroupExpandedForCourierAdministratorReq.d.mts +34 -0
- package/dist/esm/api/resources/taskGroups/client/requests/TaskGroupExpandedForCourierDriverReq.d.mts +32 -0
- package/dist/esm/api/resources/taskGroups/client/requests/index.d.mts +3 -1
- package/dist/esm/api/resources/taskGroups/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/taskGroups/resources/index.mjs +0 -2
- package/dist/esm/api/types/TaskExpanded.d.mts +1 -1
- package/dist/esm/api/types/TaskGroup1.d.mts +1 -0
- package/dist/esm/api/types/TaskGroupExpanded.d.mts +2 -6
- package/dist/esm/api/types/TaskGroupExpandedForCourierAdministrator.d.mts +18 -0
- package/dist/esm/api/types/TaskGroupExpandedForCourierAdministrator.mjs +4 -0
- package/dist/esm/api/types/TaskGroupExpandedForCourierDriver.d.mts +16 -0
- package/dist/esm/api/types/TaskGroupExpandedForCourierDriver.mjs +4 -0
- package/dist/esm/api/types/TaskGroupsExpandedForCourierAdministratorRes.d.mts +7 -0
- package/dist/esm/api/types/TaskGroupsExpandedForCourierAdministratorRes.mjs +4 -0
- package/dist/esm/api/types/TaskGroupsExpandedForCourierDriverRes.d.mts +7 -0
- package/dist/esm/api/types/TaskGroupsExpandedForCourierDriverRes.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +5 -2
- package/dist/esm/api/types/index.mjs +5 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +150 -91
- package/dist/cjs/api/resources/taskGroups/client/requests/TaskGroupsExpandedReq.d.ts +0 -24
- package/dist/cjs/api/resources/taskGroups/resources/togglePause/client/Client.d.ts +0 -51
- package/dist/cjs/api/resources/taskGroups/resources/togglePause/client/Client.js +0 -134
- package/dist/cjs/api/resources/taskGroups/resources/togglePause/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/taskGroups/resources/togglePause/client/index.js +0 -17
- package/dist/cjs/api/resources/taskGroups/resources/togglePause/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/taskGroups/resources/togglePause/index.d.ts +0 -1
- package/dist/cjs/api/resources/taskGroups/resources/togglePause/index.js +0 -17
- package/dist/cjs/api/types/TaskGroupsExpandedRes.d.ts +0 -10
- package/dist/esm/api/resources/taskGroups/client/requests/TaskGroupsExpandedReq.d.mts +0 -24
- package/dist/esm/api/resources/taskGroups/resources/togglePause/client/Client.d.mts +0 -51
- package/dist/esm/api/resources/taskGroups/resources/togglePause/client/Client.mjs +0 -97
- package/dist/esm/api/resources/taskGroups/resources/togglePause/client/index.d.mts +0 -2
- package/dist/esm/api/resources/taskGroups/resources/togglePause/client/index.mjs +0 -1
- package/dist/esm/api/resources/taskGroups/resources/togglePause/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/taskGroups/resources/togglePause/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/taskGroups/resources/togglePause/index.d.mts +0 -1
- package/dist/esm/api/resources/taskGroups/resources/togglePause/index.mjs +0 -1
- package/dist/esm/api/types/TaskGroupsExpandedRes.d.mts +0 -10
- /package/dist/cjs/api/resources/taskGroups/{resources/togglePause/client → client}/requests/SetTaskGroupPauseReq.d.ts +0 -0
- /package/dist/cjs/api/resources/taskGroups/{resources/togglePause/client → client}/requests/SetTaskGroupPauseReq.js +0 -0
- /package/dist/cjs/api/resources/taskGroups/client/requests/{TaskGroupsExpandedReq.js → TaskGroupExpandedForCourierAdministratorReq.js} +0 -0
- /package/dist/cjs/api/{types/TaskGroupsExpandedRes.js → resources/taskGroups/client/requests/TaskGroupExpandedForCourierDriverReq.js} +0 -0
- /package/dist/esm/api/resources/taskGroups/{resources/togglePause/client → client}/requests/SetTaskGroupPauseReq.d.mts +0 -0
- /package/dist/esm/api/resources/taskGroups/{resources/togglePause/client → client}/requests/SetTaskGroupPauseReq.mjs +0 -0
- /package/dist/esm/api/resources/taskGroups/client/requests/{TaskGroupsExpandedReq.mjs → TaskGroupExpandedForCourierAdministratorReq.mjs} +0 -0
- /package/dist/esm/api/{types/TaskGroupsExpandedRes.mjs → resources/taskGroups/client/requests/TaskGroupExpandedForCourierDriverReq.mjs} +0 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -68,8 +68,8 @@ class ChrtClient {
|
|
|
68
68
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
69
69
|
"X-Fern-Language": "JavaScript",
|
|
70
70
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
71
|
-
"X-Fern-SDK-Version": "1.
|
|
72
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
71
|
+
"X-Fern-SDK-Version": "1.296.0",
|
|
72
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.296.0",
|
|
73
73
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
74
74
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
75
75
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -5,7 +5,6 @@ import * as environments from "../../../../environments.js";
|
|
|
5
5
|
import * as core from "../../../../core/index.js";
|
|
6
6
|
import * as Chrt from "../../../index.js";
|
|
7
7
|
import { Full } from "../resources/full/client/Client.js";
|
|
8
|
-
import { TogglePause } from "../resources/togglePause/client/Client.js";
|
|
9
8
|
export declare namespace TaskGroups {
|
|
10
9
|
interface Options {
|
|
11
10
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
@@ -32,10 +31,8 @@ export declare namespace TaskGroups {
|
|
|
32
31
|
export declare class TaskGroups {
|
|
33
32
|
protected readonly _options: TaskGroups.Options;
|
|
34
33
|
protected _full: Full | undefined;
|
|
35
|
-
protected _togglePause: TogglePause | undefined;
|
|
36
34
|
constructor(_options?: TaskGroups.Options);
|
|
37
35
|
get full(): Full;
|
|
38
|
-
get togglePause(): TogglePause;
|
|
39
36
|
/**
|
|
40
37
|
* Lists all task groups assigned to the authenticated courier organization with their associated tasks.
|
|
41
38
|
*
|
|
@@ -60,33 +57,59 @@ export declare class TaskGroups {
|
|
|
60
57
|
getByIdV1(id: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupWithTasks>;
|
|
61
58
|
private __getByIdV1;
|
|
62
59
|
/**
|
|
63
|
-
*
|
|
60
|
+
* Lists all task groups assigned to a specific driver.
|
|
64
61
|
*
|
|
65
|
-
* @param {
|
|
62
|
+
* @param {string} driverId
|
|
66
63
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
64
|
*
|
|
68
65
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
69
66
|
*
|
|
70
67
|
* @example
|
|
71
|
-
* await client.taskGroups.
|
|
72
|
-
* task_group_id: "task_group_id"
|
|
73
|
-
* })
|
|
68
|
+
* await client.taskGroups.listByDriverIdV1("driver_id")
|
|
74
69
|
*/
|
|
75
|
-
|
|
76
|
-
private
|
|
70
|
+
listByDriverIdV1(driverId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroup1[]>;
|
|
71
|
+
private __listByDriverIdV1;
|
|
77
72
|
/**
|
|
78
|
-
*
|
|
73
|
+
* Fetches task groups for the courier organization with optional filters and expanded related data.
|
|
79
74
|
*
|
|
80
|
-
* @param {
|
|
75
|
+
* @param {Chrt.TaskGroupExpandedForCourierAdministratorReq} request
|
|
81
76
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
82
77
|
*
|
|
83
78
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
84
79
|
*
|
|
85
80
|
* @example
|
|
86
|
-
* await client.taskGroups.
|
|
81
|
+
* await client.taskGroups.postExpandedCourierAdministratorV1()
|
|
87
82
|
*/
|
|
88
|
-
|
|
89
|
-
private
|
|
83
|
+
postExpandedCourierAdministratorV1(request?: Chrt.TaskGroupExpandedForCourierAdministratorReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupsExpandedForCourierAdministratorRes>;
|
|
84
|
+
private __postExpandedCourierAdministratorV1;
|
|
85
|
+
/**
|
|
86
|
+
* Fetches task groups assigned to the authenticated courier driver with optional expanded related data.
|
|
87
|
+
*
|
|
88
|
+
* @param {Chrt.TaskGroupExpandedForCourierDriverReq} request
|
|
89
|
+
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
90
|
+
*
|
|
91
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* await client.taskGroups.postExpandedCourierDriverV1()
|
|
95
|
+
*/
|
|
96
|
+
postExpandedCourierDriverV1(request?: Chrt.TaskGroupExpandedForCourierDriverReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupsExpandedForCourierDriverRes>;
|
|
97
|
+
private __postExpandedCourierDriverV1;
|
|
98
|
+
/**
|
|
99
|
+
* Updates task group driver assignments by adding or removing drivers.
|
|
100
|
+
*
|
|
101
|
+
* @param {Chrt.UpdateTaskGroupReq} request
|
|
102
|
+
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
103
|
+
*
|
|
104
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* await client.taskGroups.updateV1({
|
|
108
|
+
* task_group_id: "task_group_id"
|
|
109
|
+
* })
|
|
110
|
+
*/
|
|
111
|
+
updateV1(request: Chrt.UpdateTaskGroupReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.UpdateTaskGroupRes>;
|
|
112
|
+
private __updateV1;
|
|
90
113
|
/**
|
|
91
114
|
* Starts a task group by changing its status to in-progress and updating the order status.
|
|
92
115
|
*
|
|
@@ -101,19 +124,21 @@ export declare class TaskGroups {
|
|
|
101
124
|
startV1(id: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
102
125
|
private __startV1;
|
|
103
126
|
/**
|
|
104
|
-
*
|
|
127
|
+
* Toggles the pause status of an in-progress task group.
|
|
105
128
|
*
|
|
106
|
-
* @param {
|
|
129
|
+
* @param {string} id
|
|
130
|
+
* @param {Chrt.SetTaskGroupPauseReq} request
|
|
107
131
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
132
|
*
|
|
109
133
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
110
134
|
*
|
|
111
135
|
* @example
|
|
112
|
-
* await client.taskGroups.
|
|
113
|
-
*
|
|
136
|
+
* await client.taskGroups.togglePauseV1("id", {
|
|
137
|
+
* task_group_id: "task_group_id",
|
|
138
|
+
* paused: true
|
|
114
139
|
* })
|
|
115
140
|
*/
|
|
116
|
-
|
|
117
|
-
private
|
|
141
|
+
togglePauseV1(id: string, request: Chrt.SetTaskGroupPauseReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
142
|
+
private __togglePauseV1;
|
|
118
143
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
119
144
|
}
|
|
@@ -52,7 +52,6 @@ const Chrt = __importStar(require("../../../index.js"));
|
|
|
52
52
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
53
53
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
54
54
|
const Client_js_1 = require("../resources/full/client/Client.js");
|
|
55
|
-
const Client_js_2 = require("../resources/togglePause/client/Client.js");
|
|
56
55
|
class TaskGroups {
|
|
57
56
|
constructor(_options = {}) {
|
|
58
57
|
this._options = _options;
|
|
@@ -61,10 +60,6 @@ class TaskGroups {
|
|
|
61
60
|
var _a;
|
|
62
61
|
return ((_a = this._full) !== null && _a !== void 0 ? _a : (this._full = new Client_js_1.Full(this._options)));
|
|
63
62
|
}
|
|
64
|
-
get togglePause() {
|
|
65
|
-
var _a;
|
|
66
|
-
return ((_a = this._togglePause) !== null && _a !== void 0 ? _a : (this._togglePause = new Client_js_2.TogglePause(this._options)));
|
|
67
|
-
}
|
|
68
63
|
/**
|
|
69
64
|
* Lists all task groups assigned to the authenticated courier organization with their associated tasks.
|
|
70
65
|
*
|
|
@@ -176,27 +171,84 @@ class TaskGroups {
|
|
|
176
171
|
});
|
|
177
172
|
}
|
|
178
173
|
/**
|
|
179
|
-
*
|
|
174
|
+
* Lists all task groups assigned to a specific driver.
|
|
180
175
|
*
|
|
181
|
-
* @param {
|
|
176
|
+
* @param {string} driverId
|
|
182
177
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
183
178
|
*
|
|
184
179
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
185
180
|
*
|
|
186
181
|
* @example
|
|
187
|
-
* await client.taskGroups.
|
|
188
|
-
* task_group_id: "task_group_id"
|
|
189
|
-
* })
|
|
182
|
+
* await client.taskGroups.listByDriverIdV1("driver_id")
|
|
190
183
|
*/
|
|
191
|
-
|
|
192
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
184
|
+
listByDriverIdV1(driverId, requestOptions) {
|
|
185
|
+
return core.HttpResponsePromise.fromPromise(this.__listByDriverIdV1(driverId, requestOptions));
|
|
193
186
|
}
|
|
194
|
-
|
|
187
|
+
__listByDriverIdV1(driverId, requestOptions) {
|
|
195
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
196
189
|
var _a, _b, _c, _d;
|
|
197
190
|
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);
|
|
198
191
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
199
|
-
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,
|
|
192
|
+
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/task_groups/list/v1/${encodeURIComponent(driverId)}`),
|
|
193
|
+
method: "GET",
|
|
194
|
+
headers: _headers,
|
|
195
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
196
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
197
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
198
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
199
|
+
});
|
|
200
|
+
if (_response.ok) {
|
|
201
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
202
|
+
}
|
|
203
|
+
if (_response.error.reason === "status-code") {
|
|
204
|
+
switch (_response.error.statusCode) {
|
|
205
|
+
case 422:
|
|
206
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
207
|
+
default:
|
|
208
|
+
throw new errors.ChrtError({
|
|
209
|
+
statusCode: _response.error.statusCode,
|
|
210
|
+
body: _response.error.body,
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
switch (_response.error.reason) {
|
|
216
|
+
case "non-json":
|
|
217
|
+
throw new errors.ChrtError({
|
|
218
|
+
statusCode: _response.error.statusCode,
|
|
219
|
+
body: _response.error.rawBody,
|
|
220
|
+
rawResponse: _response.rawResponse,
|
|
221
|
+
});
|
|
222
|
+
case "timeout":
|
|
223
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/list/v1/{driver_id}.");
|
|
224
|
+
case "unknown":
|
|
225
|
+
throw new errors.ChrtError({
|
|
226
|
+
message: _response.error.errorMessage,
|
|
227
|
+
rawResponse: _response.rawResponse,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Fetches task groups for the courier organization with optional filters and expanded related data.
|
|
234
|
+
*
|
|
235
|
+
* @param {Chrt.TaskGroupExpandedForCourierAdministratorReq} request
|
|
236
|
+
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
237
|
+
*
|
|
238
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* await client.taskGroups.postExpandedCourierAdministratorV1()
|
|
242
|
+
*/
|
|
243
|
+
postExpandedCourierAdministratorV1(request = {}, requestOptions) {
|
|
244
|
+
return core.HttpResponsePromise.fromPromise(this.__postExpandedCourierAdministratorV1(request, requestOptions));
|
|
245
|
+
}
|
|
246
|
+
__postExpandedCourierAdministratorV1() {
|
|
247
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
248
|
+
var _a, _b, _c, _d;
|
|
249
|
+
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);
|
|
250
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
251
|
+
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/task_groups/expanded/courier_administrator/v1"),
|
|
200
252
|
method: "POST",
|
|
201
253
|
headers: _headers,
|
|
202
254
|
contentType: "application/json",
|
|
@@ -208,7 +260,10 @@ class TaskGroups {
|
|
|
208
260
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
209
261
|
});
|
|
210
262
|
if (_response.ok) {
|
|
211
|
-
return {
|
|
263
|
+
return {
|
|
264
|
+
data: _response.body,
|
|
265
|
+
rawResponse: _response.rawResponse,
|
|
266
|
+
};
|
|
212
267
|
}
|
|
213
268
|
if (_response.error.reason === "status-code") {
|
|
214
269
|
switch (_response.error.statusCode) {
|
|
@@ -230,7 +285,7 @@ class TaskGroups {
|
|
|
230
285
|
rawResponse: _response.rawResponse,
|
|
231
286
|
});
|
|
232
287
|
case "timeout":
|
|
233
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/
|
|
288
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/expanded/courier_administrator/v1.");
|
|
234
289
|
case "unknown":
|
|
235
290
|
throw new errors.ChrtError({
|
|
236
291
|
message: _response.error.errorMessage,
|
|
@@ -240,28 +295,98 @@ class TaskGroups {
|
|
|
240
295
|
});
|
|
241
296
|
}
|
|
242
297
|
/**
|
|
243
|
-
*
|
|
298
|
+
* Fetches task groups assigned to the authenticated courier driver with optional expanded related data.
|
|
244
299
|
*
|
|
245
|
-
* @param {
|
|
300
|
+
* @param {Chrt.TaskGroupExpandedForCourierDriverReq} request
|
|
246
301
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
247
302
|
*
|
|
248
303
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
249
304
|
*
|
|
250
305
|
* @example
|
|
251
|
-
* await client.taskGroups.
|
|
306
|
+
* await client.taskGroups.postExpandedCourierDriverV1()
|
|
252
307
|
*/
|
|
253
|
-
|
|
254
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
308
|
+
postExpandedCourierDriverV1(request = {}, requestOptions) {
|
|
309
|
+
return core.HttpResponsePromise.fromPromise(this.__postExpandedCourierDriverV1(request, requestOptions));
|
|
255
310
|
}
|
|
256
|
-
|
|
311
|
+
__postExpandedCourierDriverV1() {
|
|
312
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
313
|
+
var _a, _b, _c, _d;
|
|
314
|
+
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);
|
|
315
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
316
|
+
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/task_groups/expanded/courier_driver/v1"),
|
|
317
|
+
method: "POST",
|
|
318
|
+
headers: _headers,
|
|
319
|
+
contentType: "application/json",
|
|
320
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
321
|
+
requestType: "json",
|
|
322
|
+
body: request,
|
|
323
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
324
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
325
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
326
|
+
});
|
|
327
|
+
if (_response.ok) {
|
|
328
|
+
return {
|
|
329
|
+
data: _response.body,
|
|
330
|
+
rawResponse: _response.rawResponse,
|
|
331
|
+
};
|
|
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 POST /oort/task_groups/expanded/courier_driver/v1.");
|
|
354
|
+
case "unknown":
|
|
355
|
+
throw new errors.ChrtError({
|
|
356
|
+
message: _response.error.errorMessage,
|
|
357
|
+
rawResponse: _response.rawResponse,
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Updates task group driver assignments by adding or removing drivers.
|
|
364
|
+
*
|
|
365
|
+
* @param {Chrt.UpdateTaskGroupReq} request
|
|
366
|
+
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
367
|
+
*
|
|
368
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* await client.taskGroups.updateV1({
|
|
372
|
+
* task_group_id: "task_group_id"
|
|
373
|
+
* })
|
|
374
|
+
*/
|
|
375
|
+
updateV1(request, requestOptions) {
|
|
376
|
+
return core.HttpResponsePromise.fromPromise(this.__updateV1(request, requestOptions));
|
|
377
|
+
}
|
|
378
|
+
__updateV1(request, requestOptions) {
|
|
257
379
|
return __awaiter(this, void 0, void 0, function* () {
|
|
258
380
|
var _a, _b, _c, _d;
|
|
259
381
|
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);
|
|
260
382
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
261
|
-
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,
|
|
262
|
-
method: "
|
|
383
|
+
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/task_groups/update/v1"),
|
|
384
|
+
method: "POST",
|
|
263
385
|
headers: _headers,
|
|
386
|
+
contentType: "application/json",
|
|
264
387
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
388
|
+
requestType: "json",
|
|
389
|
+
body: request,
|
|
265
390
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
266
391
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
267
392
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -289,7 +414,7 @@ class TaskGroups {
|
|
|
289
414
|
rawResponse: _response.rawResponse,
|
|
290
415
|
});
|
|
291
416
|
case "timeout":
|
|
292
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
417
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/update/v1.");
|
|
293
418
|
case "unknown":
|
|
294
419
|
throw new errors.ChrtError({
|
|
295
420
|
message: _response.error.errorMessage,
|
|
@@ -358,28 +483,30 @@ class TaskGroups {
|
|
|
358
483
|
});
|
|
359
484
|
}
|
|
360
485
|
/**
|
|
361
|
-
*
|
|
486
|
+
* Toggles the pause status of an in-progress task group.
|
|
362
487
|
*
|
|
363
|
-
* @param {
|
|
488
|
+
* @param {string} id
|
|
489
|
+
* @param {Chrt.SetTaskGroupPauseReq} request
|
|
364
490
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
365
491
|
*
|
|
366
492
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
367
493
|
*
|
|
368
494
|
* @example
|
|
369
|
-
* await client.taskGroups.
|
|
370
|
-
*
|
|
495
|
+
* await client.taskGroups.togglePauseV1("id", {
|
|
496
|
+
* task_group_id: "task_group_id",
|
|
497
|
+
* paused: true
|
|
371
498
|
* })
|
|
372
499
|
*/
|
|
373
|
-
|
|
374
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
500
|
+
togglePauseV1(id, request, requestOptions) {
|
|
501
|
+
return core.HttpResponsePromise.fromPromise(this.__togglePauseV1(id, request, requestOptions));
|
|
375
502
|
}
|
|
376
|
-
|
|
503
|
+
__togglePauseV1(id, request, requestOptions) {
|
|
377
504
|
return __awaiter(this, void 0, void 0, function* () {
|
|
378
505
|
var _a, _b, _c, _d;
|
|
379
506
|
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);
|
|
380
507
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
381
|
-
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,
|
|
382
|
-
method: "
|
|
508
|
+
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/task_groups/toggle_pause/v1/${encodeURIComponent(id)}`),
|
|
509
|
+
method: "PUT",
|
|
383
510
|
headers: _headers,
|
|
384
511
|
contentType: "application/json",
|
|
385
512
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -412,7 +539,7 @@ class TaskGroups {
|
|
|
412
539
|
rawResponse: _response.rawResponse,
|
|
413
540
|
});
|
|
414
541
|
case "timeout":
|
|
415
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
542
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /oort/task_groups/toggle_pause/v1/{id}.");
|
|
416
543
|
case "unknown":
|
|
417
544
|
throw new errors.ChrtError({
|
|
418
545
|
message: _response.error.errorMessage,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../../../../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {}
|
|
8
|
+
*/
|
|
9
|
+
export interface TaskGroupExpandedForCourierAdministratorReq {
|
|
10
|
+
sort_created_at_desc?: boolean;
|
|
11
|
+
page?: number;
|
|
12
|
+
page_size?: number;
|
|
13
|
+
created_at_gte?: string | null;
|
|
14
|
+
created_at_lte?: string | null;
|
|
15
|
+
started_at_gte?: string | null;
|
|
16
|
+
started_at_lte?: string | null;
|
|
17
|
+
completed_at_gte?: string | null;
|
|
18
|
+
completed_at_lte?: string | null;
|
|
19
|
+
order_cancelled?: boolean | null;
|
|
20
|
+
statuses?: Chrt.TaskGroupStatusEnum1[] | null;
|
|
21
|
+
completed?: boolean | null;
|
|
22
|
+
paused?: boolean | null;
|
|
23
|
+
expand_tasks?: boolean;
|
|
24
|
+
expand_cargos?: boolean;
|
|
25
|
+
expand_milestones?: boolean;
|
|
26
|
+
expand_shipper_contact_info?: boolean;
|
|
27
|
+
expand_shipper_org_company_name?: boolean;
|
|
28
|
+
expand_shipper_org_handle?: boolean;
|
|
29
|
+
expand_task_group_mileage?: boolean;
|
|
30
|
+
expand_driver?: boolean;
|
|
31
|
+
expand_courier_pay_driver_line_item_groups?: boolean;
|
|
32
|
+
expand_courier_pay_driver_rate_sheet?: boolean;
|
|
33
|
+
expand_courier_pay_driver_payout?: boolean;
|
|
34
|
+
}
|
package/dist/cjs/api/resources/taskGroups/client/requests/TaskGroupExpandedForCourierDriverReq.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../../../../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {}
|
|
8
|
+
*/
|
|
9
|
+
export interface TaskGroupExpandedForCourierDriverReq {
|
|
10
|
+
sort_created_at_desc?: boolean;
|
|
11
|
+
page?: number;
|
|
12
|
+
page_size?: number;
|
|
13
|
+
created_at_gte?: string | null;
|
|
14
|
+
created_at_lte?: string | null;
|
|
15
|
+
started_at_gte?: string | null;
|
|
16
|
+
started_at_lte?: string | null;
|
|
17
|
+
completed_at_gte?: string | null;
|
|
18
|
+
completed_at_lte?: string | null;
|
|
19
|
+
statuses?: Chrt.TaskGroupStatusEnum1[] | null;
|
|
20
|
+
order_cancelled?: boolean | null;
|
|
21
|
+
completed?: boolean | null;
|
|
22
|
+
paused?: boolean | null;
|
|
23
|
+
expand_tasks?: boolean;
|
|
24
|
+
expand_cargos?: boolean;
|
|
25
|
+
expand_milestones?: boolean;
|
|
26
|
+
expand_shipper_contact_info?: boolean;
|
|
27
|
+
expand_shipper_org_company_name?: boolean;
|
|
28
|
+
expand_shipper_org_handle?: boolean;
|
|
29
|
+
expand_task_group_mileage?: boolean;
|
|
30
|
+
expand_driver?: boolean;
|
|
31
|
+
expand_courier_pay_driver_payout?: boolean;
|
|
32
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export { type TaskGroupExpandedForCourierAdministratorReq } from "./TaskGroupExpandedForCourierAdministratorReq.js";
|
|
2
|
+
export { type TaskGroupExpandedForCourierDriverReq } from "./TaskGroupExpandedForCourierDriverReq.js";
|
|
1
3
|
export { type UpdateTaskGroupReq } from "./UpdateTaskGroupReq.js";
|
|
2
|
-
export { type
|
|
4
|
+
export { type SetTaskGroupPauseReq } from "./SetTaskGroupPauseReq.js";
|
|
@@ -32,11 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
36
|
+
exports.full = void 0;
|
|
40
37
|
exports.full = __importStar(require("./full/index.js"));
|
|
41
|
-
exports.togglePause = __importStar(require("./togglePause/index.js"));
|
|
42
|
-
__exportStar(require("./togglePause/client/requests/index.js"), exports);
|
|
@@ -8,10 +8,6 @@ import * as Chrt from "../index.js";
|
|
|
8
8
|
export interface TaskGroupExpanded {
|
|
9
9
|
task_group: Chrt.TaskGroup1;
|
|
10
10
|
tasks_expanded?: Chrt.TaskExpanded[] | null;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
task_group_mileage?: number | null;
|
|
14
|
-
courier_pay_driver_line_item_groups?: Chrt.CourierPayDriverLineItemGroup1[] | null;
|
|
15
|
-
courier_pay_driver_rate_sheet?: Chrt.CourierPayDriverRateSheet1 | null;
|
|
16
|
-
courier_pay_driver_payout?: Chrt.CourierPayDriverPayout1 | null;
|
|
11
|
+
courier_org_company_name?: string | null;
|
|
12
|
+
courier_org_company_handle?: string | null;
|
|
17
13
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Expanded task group payload for courier administrators.
|
|
7
|
+
*/
|
|
8
|
+
export interface TaskGroupExpandedForCourierAdministrator {
|
|
9
|
+
task_group: Chrt.TaskGroup1;
|
|
10
|
+
tasks_expanded?: Chrt.TaskExpanded[] | null;
|
|
11
|
+
shipper_org_company_name?: string | null;
|
|
12
|
+
shipper_org_handle?: string | null;
|
|
13
|
+
task_group_mileage?: number | null;
|
|
14
|
+
driver?: Chrt.Driver1 | null;
|
|
15
|
+
courier_pay_driver_line_item_groups?: Chrt.CourierPayDriverLineItemGroup1[] | null;
|
|
16
|
+
courier_pay_driver_rate_sheet?: Chrt.CourierPayDriverRateSheet1 | null;
|
|
17
|
+
courier_pay_driver_payout?: Chrt.CourierPayDriverPayout1 | null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Expanded task group payload for courier drivers.
|
|
7
|
+
*/
|
|
8
|
+
export interface TaskGroupExpandedForCourierDriver {
|
|
9
|
+
task_group: Chrt.TaskGroup1;
|
|
10
|
+
tasks_expanded?: Chrt.TaskExpanded[] | null;
|
|
11
|
+
shipper_org_company_name?: string | null;
|
|
12
|
+
shipper_org_handle?: string | null;
|
|
13
|
+
task_group_mileage?: number | null;
|
|
14
|
+
driver?: Chrt.Driver1 | null;
|
|
15
|
+
courier_pay_driver_payout?: Chrt.CourierPayDriverPayout1 | null;
|
|
16
|
+
}
|