@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
|
@@ -91,10 +91,14 @@ export * from "./TaskClientCreate1.js";
|
|
|
91
91
|
export * from "./TaskCreateBundle.js";
|
|
92
92
|
export * from "./TaskGroup1.js";
|
|
93
93
|
export * from "./TaskGroupDetailsResponse.js";
|
|
94
|
+
export * from "./TaskGroupExpanded.js";
|
|
95
|
+
export * from "./TaskGroupExpandedForCourierAdministrator.js";
|
|
96
|
+
export * from "./TaskGroupExpandedForCourierDriver.js";
|
|
94
97
|
export * from "./TaskGroupStatusEnum1.js";
|
|
95
98
|
export * from "./TaskGroupWithDetails.js";
|
|
96
99
|
export * from "./TaskGroupWithTasks.js";
|
|
97
|
-
export * from "./
|
|
100
|
+
export * from "./TaskGroupsExpandedForCourierAdministratorRes.js";
|
|
101
|
+
export * from "./TaskGroupsExpandedForCourierDriverRes.js";
|
|
98
102
|
export * from "./TaskWithDetails.js";
|
|
99
103
|
export * from "./TemplateRes.js";
|
|
100
104
|
export * from "./TimezoneResponse.js";
|
|
@@ -115,4 +119,3 @@ export * from "./ValidationError.js";
|
|
|
115
119
|
export * from "./Vehicle1.js";
|
|
116
120
|
export * from "./VehicleTypeEnum.js";
|
|
117
121
|
export * from "./TaskExpanded.js";
|
|
118
|
-
export * from "./TaskGroupExpanded.js";
|
|
@@ -107,10 +107,14 @@ __exportStar(require("./TaskClientCreate1.js"), exports);
|
|
|
107
107
|
__exportStar(require("./TaskCreateBundle.js"), exports);
|
|
108
108
|
__exportStar(require("./TaskGroup1.js"), exports);
|
|
109
109
|
__exportStar(require("./TaskGroupDetailsResponse.js"), exports);
|
|
110
|
+
__exportStar(require("./TaskGroupExpanded.js"), exports);
|
|
111
|
+
__exportStar(require("./TaskGroupExpandedForCourierAdministrator.js"), exports);
|
|
112
|
+
__exportStar(require("./TaskGroupExpandedForCourierDriver.js"), exports);
|
|
110
113
|
__exportStar(require("./TaskGroupStatusEnum1.js"), exports);
|
|
111
114
|
__exportStar(require("./TaskGroupWithDetails.js"), exports);
|
|
112
115
|
__exportStar(require("./TaskGroupWithTasks.js"), exports);
|
|
113
|
-
__exportStar(require("./
|
|
116
|
+
__exportStar(require("./TaskGroupsExpandedForCourierAdministratorRes.js"), exports);
|
|
117
|
+
__exportStar(require("./TaskGroupsExpandedForCourierDriverRes.js"), exports);
|
|
114
118
|
__exportStar(require("./TaskWithDetails.js"), exports);
|
|
115
119
|
__exportStar(require("./TemplateRes.js"), exports);
|
|
116
120
|
__exportStar(require("./TimezoneResponse.js"), exports);
|
|
@@ -131,4 +135,3 @@ __exportStar(require("./ValidationError.js"), exports);
|
|
|
131
135
|
__exportStar(require("./Vehicle1.js"), exports);
|
|
132
136
|
__exportStar(require("./VehicleTypeEnum.js"), exports);
|
|
133
137
|
__exportStar(require("./TaskExpanded.js"), exports);
|
|
134
|
-
__exportStar(require("./TaskGroupExpanded.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.296.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -32,8 +32,8 @@ export class ChrtClient {
|
|
|
32
32
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
33
33
|
"X-Fern-Language": "JavaScript",
|
|
34
34
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
35
|
-
"X-Fern-SDK-Version": "1.
|
|
36
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
35
|
+
"X-Fern-SDK-Version": "1.296.0",
|
|
36
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.296.0",
|
|
37
37
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
38
38
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
39
39
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -5,7 +5,6 @@ import * as environments from "../../../../environments.mjs";
|
|
|
5
5
|
import * as core from "../../../../core/index.mjs";
|
|
6
6
|
import * as Chrt from "../../../index.mjs";
|
|
7
7
|
import { Full } from "../resources/full/client/Client.mjs";
|
|
8
|
-
import { TogglePause } from "../resources/togglePause/client/Client.mjs";
|
|
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
|
}
|
|
@@ -16,7 +16,6 @@ import * as Chrt from "../../../index.mjs";
|
|
|
16
16
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
17
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
18
18
|
import { Full } from "../resources/full/client/Client.mjs";
|
|
19
|
-
import { TogglePause } from "../resources/togglePause/client/Client.mjs";
|
|
20
19
|
export class TaskGroups {
|
|
21
20
|
constructor(_options = {}) {
|
|
22
21
|
this._options = _options;
|
|
@@ -25,10 +24,6 @@ export class TaskGroups {
|
|
|
25
24
|
var _a;
|
|
26
25
|
return ((_a = this._full) !== null && _a !== void 0 ? _a : (this._full = new Full(this._options)));
|
|
27
26
|
}
|
|
28
|
-
get togglePause() {
|
|
29
|
-
var _a;
|
|
30
|
-
return ((_a = this._togglePause) !== null && _a !== void 0 ? _a : (this._togglePause = new TogglePause(this._options)));
|
|
31
|
-
}
|
|
32
27
|
/**
|
|
33
28
|
* Lists all task groups assigned to the authenticated courier organization with their associated tasks.
|
|
34
29
|
*
|
|
@@ -140,27 +135,84 @@ export class TaskGroups {
|
|
|
140
135
|
});
|
|
141
136
|
}
|
|
142
137
|
/**
|
|
143
|
-
*
|
|
138
|
+
* Lists all task groups assigned to a specific driver.
|
|
144
139
|
*
|
|
145
|
-
* @param {
|
|
140
|
+
* @param {string} driverId
|
|
146
141
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
147
142
|
*
|
|
148
143
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
149
144
|
*
|
|
150
145
|
* @example
|
|
151
|
-
* await client.taskGroups.
|
|
152
|
-
* task_group_id: "task_group_id"
|
|
153
|
-
* })
|
|
146
|
+
* await client.taskGroups.listByDriverIdV1("driver_id")
|
|
154
147
|
*/
|
|
155
|
-
|
|
156
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
148
|
+
listByDriverIdV1(driverId, requestOptions) {
|
|
149
|
+
return core.HttpResponsePromise.fromPromise(this.__listByDriverIdV1(driverId, requestOptions));
|
|
157
150
|
}
|
|
158
|
-
|
|
151
|
+
__listByDriverIdV1(driverId, requestOptions) {
|
|
159
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
153
|
var _a, _b, _c, _d;
|
|
161
154
|
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);
|
|
162
155
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
163
|
-
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,
|
|
156
|
+
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)}`),
|
|
157
|
+
method: "GET",
|
|
158
|
+
headers: _headers,
|
|
159
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
160
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
161
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
162
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
163
|
+
});
|
|
164
|
+
if (_response.ok) {
|
|
165
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
166
|
+
}
|
|
167
|
+
if (_response.error.reason === "status-code") {
|
|
168
|
+
switch (_response.error.statusCode) {
|
|
169
|
+
case 422:
|
|
170
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
171
|
+
default:
|
|
172
|
+
throw new errors.ChrtError({
|
|
173
|
+
statusCode: _response.error.statusCode,
|
|
174
|
+
body: _response.error.body,
|
|
175
|
+
rawResponse: _response.rawResponse,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
switch (_response.error.reason) {
|
|
180
|
+
case "non-json":
|
|
181
|
+
throw new errors.ChrtError({
|
|
182
|
+
statusCode: _response.error.statusCode,
|
|
183
|
+
body: _response.error.rawBody,
|
|
184
|
+
rawResponse: _response.rawResponse,
|
|
185
|
+
});
|
|
186
|
+
case "timeout":
|
|
187
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/list/v1/{driver_id}.");
|
|
188
|
+
case "unknown":
|
|
189
|
+
throw new errors.ChrtError({
|
|
190
|
+
message: _response.error.errorMessage,
|
|
191
|
+
rawResponse: _response.rawResponse,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Fetches task groups for the courier organization with optional filters and expanded related data.
|
|
198
|
+
*
|
|
199
|
+
* @param {Chrt.TaskGroupExpandedForCourierAdministratorReq} request
|
|
200
|
+
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
201
|
+
*
|
|
202
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* await client.taskGroups.postExpandedCourierAdministratorV1()
|
|
206
|
+
*/
|
|
207
|
+
postExpandedCourierAdministratorV1(request = {}, requestOptions) {
|
|
208
|
+
return core.HttpResponsePromise.fromPromise(this.__postExpandedCourierAdministratorV1(request, requestOptions));
|
|
209
|
+
}
|
|
210
|
+
__postExpandedCourierAdministratorV1() {
|
|
211
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
212
|
+
var _a, _b, _c, _d;
|
|
213
|
+
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);
|
|
214
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
215
|
+
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"),
|
|
164
216
|
method: "POST",
|
|
165
217
|
headers: _headers,
|
|
166
218
|
contentType: "application/json",
|
|
@@ -172,7 +224,10 @@ export class TaskGroups {
|
|
|
172
224
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
173
225
|
});
|
|
174
226
|
if (_response.ok) {
|
|
175
|
-
return {
|
|
227
|
+
return {
|
|
228
|
+
data: _response.body,
|
|
229
|
+
rawResponse: _response.rawResponse,
|
|
230
|
+
};
|
|
176
231
|
}
|
|
177
232
|
if (_response.error.reason === "status-code") {
|
|
178
233
|
switch (_response.error.statusCode) {
|
|
@@ -194,7 +249,7 @@ export class TaskGroups {
|
|
|
194
249
|
rawResponse: _response.rawResponse,
|
|
195
250
|
});
|
|
196
251
|
case "timeout":
|
|
197
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/
|
|
252
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/expanded/courier_administrator/v1.");
|
|
198
253
|
case "unknown":
|
|
199
254
|
throw new errors.ChrtError({
|
|
200
255
|
message: _response.error.errorMessage,
|
|
@@ -204,28 +259,98 @@ export class TaskGroups {
|
|
|
204
259
|
});
|
|
205
260
|
}
|
|
206
261
|
/**
|
|
207
|
-
*
|
|
262
|
+
* Fetches task groups assigned to the authenticated courier driver with optional expanded related data.
|
|
208
263
|
*
|
|
209
|
-
* @param {
|
|
264
|
+
* @param {Chrt.TaskGroupExpandedForCourierDriverReq} request
|
|
210
265
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
211
266
|
*
|
|
212
267
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
213
268
|
*
|
|
214
269
|
* @example
|
|
215
|
-
* await client.taskGroups.
|
|
270
|
+
* await client.taskGroups.postExpandedCourierDriverV1()
|
|
216
271
|
*/
|
|
217
|
-
|
|
218
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
272
|
+
postExpandedCourierDriverV1(request = {}, requestOptions) {
|
|
273
|
+
return core.HttpResponsePromise.fromPromise(this.__postExpandedCourierDriverV1(request, requestOptions));
|
|
219
274
|
}
|
|
220
|
-
|
|
275
|
+
__postExpandedCourierDriverV1() {
|
|
276
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
277
|
+
var _a, _b, _c, _d;
|
|
278
|
+
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);
|
|
279
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
280
|
+
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"),
|
|
281
|
+
method: "POST",
|
|
282
|
+
headers: _headers,
|
|
283
|
+
contentType: "application/json",
|
|
284
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
285
|
+
requestType: "json",
|
|
286
|
+
body: request,
|
|
287
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
288
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
289
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
290
|
+
});
|
|
291
|
+
if (_response.ok) {
|
|
292
|
+
return {
|
|
293
|
+
data: _response.body,
|
|
294
|
+
rawResponse: _response.rawResponse,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
if (_response.error.reason === "status-code") {
|
|
298
|
+
switch (_response.error.statusCode) {
|
|
299
|
+
case 422:
|
|
300
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
301
|
+
default:
|
|
302
|
+
throw new errors.ChrtError({
|
|
303
|
+
statusCode: _response.error.statusCode,
|
|
304
|
+
body: _response.error.body,
|
|
305
|
+
rawResponse: _response.rawResponse,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
switch (_response.error.reason) {
|
|
310
|
+
case "non-json":
|
|
311
|
+
throw new errors.ChrtError({
|
|
312
|
+
statusCode: _response.error.statusCode,
|
|
313
|
+
body: _response.error.rawBody,
|
|
314
|
+
rawResponse: _response.rawResponse,
|
|
315
|
+
});
|
|
316
|
+
case "timeout":
|
|
317
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/expanded/courier_driver/v1.");
|
|
318
|
+
case "unknown":
|
|
319
|
+
throw new errors.ChrtError({
|
|
320
|
+
message: _response.error.errorMessage,
|
|
321
|
+
rawResponse: _response.rawResponse,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Updates task group driver assignments by adding or removing drivers.
|
|
328
|
+
*
|
|
329
|
+
* @param {Chrt.UpdateTaskGroupReq} request
|
|
330
|
+
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
331
|
+
*
|
|
332
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* await client.taskGroups.updateV1({
|
|
336
|
+
* task_group_id: "task_group_id"
|
|
337
|
+
* })
|
|
338
|
+
*/
|
|
339
|
+
updateV1(request, requestOptions) {
|
|
340
|
+
return core.HttpResponsePromise.fromPromise(this.__updateV1(request, requestOptions));
|
|
341
|
+
}
|
|
342
|
+
__updateV1(request, requestOptions) {
|
|
221
343
|
return __awaiter(this, void 0, void 0, function* () {
|
|
222
344
|
var _a, _b, _c, _d;
|
|
223
345
|
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);
|
|
224
346
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
225
|
-
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,
|
|
226
|
-
method: "
|
|
347
|
+
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"),
|
|
348
|
+
method: "POST",
|
|
227
349
|
headers: _headers,
|
|
350
|
+
contentType: "application/json",
|
|
228
351
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
352
|
+
requestType: "json",
|
|
353
|
+
body: request,
|
|
229
354
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
230
355
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
231
356
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -253,7 +378,7 @@ export class TaskGroups {
|
|
|
253
378
|
rawResponse: _response.rawResponse,
|
|
254
379
|
});
|
|
255
380
|
case "timeout":
|
|
256
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
381
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/update/v1.");
|
|
257
382
|
case "unknown":
|
|
258
383
|
throw new errors.ChrtError({
|
|
259
384
|
message: _response.error.errorMessage,
|
|
@@ -322,28 +447,30 @@ export class TaskGroups {
|
|
|
322
447
|
});
|
|
323
448
|
}
|
|
324
449
|
/**
|
|
325
|
-
*
|
|
450
|
+
* Toggles the pause status of an in-progress task group.
|
|
326
451
|
*
|
|
327
|
-
* @param {
|
|
452
|
+
* @param {string} id
|
|
453
|
+
* @param {Chrt.SetTaskGroupPauseReq} request
|
|
328
454
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
329
455
|
*
|
|
330
456
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
331
457
|
*
|
|
332
458
|
* @example
|
|
333
|
-
* await client.taskGroups.
|
|
334
|
-
*
|
|
459
|
+
* await client.taskGroups.togglePauseV1("id", {
|
|
460
|
+
* task_group_id: "task_group_id",
|
|
461
|
+
* paused: true
|
|
335
462
|
* })
|
|
336
463
|
*/
|
|
337
|
-
|
|
338
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
464
|
+
togglePauseV1(id, request, requestOptions) {
|
|
465
|
+
return core.HttpResponsePromise.fromPromise(this.__togglePauseV1(id, request, requestOptions));
|
|
339
466
|
}
|
|
340
|
-
|
|
467
|
+
__togglePauseV1(id, request, requestOptions) {
|
|
341
468
|
return __awaiter(this, void 0, void 0, function* () {
|
|
342
469
|
var _a, _b, _c, _d;
|
|
343
470
|
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);
|
|
344
471
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
345
|
-
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,
|
|
346
|
-
method: "
|
|
472
|
+
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)}`),
|
|
473
|
+
method: "PUT",
|
|
347
474
|
headers: _headers,
|
|
348
475
|
contentType: "application/json",
|
|
349
476
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -376,7 +503,7 @@ export class TaskGroups {
|
|
|
376
503
|
rawResponse: _response.rawResponse,
|
|
377
504
|
});
|
|
378
505
|
case "timeout":
|
|
379
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
506
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /oort/task_groups/toggle_pause/v1/{id}.");
|
|
380
507
|
case "unknown":
|
|
381
508
|
throw new errors.ChrtError({
|
|
382
509
|
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.mjs";
|
|
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/esm/api/resources/taskGroups/client/requests/TaskGroupExpandedForCourierDriverReq.d.mts
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.mjs";
|
|
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.mjs";
|
|
2
|
+
export { type TaskGroupExpandedForCourierDriverReq } from "./TaskGroupExpandedForCourierDriverReq.mjs";
|
|
1
3
|
export { type UpdateTaskGroupReq } from "./UpdateTaskGroupReq.mjs";
|
|
2
|
-
export { type
|
|
4
|
+
export { type SetTaskGroupPauseReq } from "./SetTaskGroupPauseReq.mjs";
|
|
@@ -8,10 +8,6 @@ import * as Chrt from "../index.mjs";
|
|
|
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.mjs";
|
|
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
|
+
}
|