@chrt-inc/typescript-sdk 1.293.0 → 1.299.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 +14 -48
- package/dist/cjs/api/resources/taskGroups/client/Client.js +18 -185
- package/dist/cjs/api/resources/taskGroups/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/taskGroups/resources/expanded/client/Client.d.ts +76 -0
- package/dist/cjs/api/resources/taskGroups/resources/{full → expanded}/client/Client.js +108 -26
- package/dist/cjs/api/resources/taskGroups/resources/expanded/client/requests/TaskGroupExpandedForShipperReq.d.ts +20 -0
- package/dist/cjs/api/resources/taskGroups/resources/expanded/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/Client.d.ts +90 -0
- package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/Client.js +326 -0
- package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/index.js +17 -0
- package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.d.ts +40 -0
- package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.d.ts +40 -0
- package/dist/cjs/api/resources/taskGroups/resources/expandedList/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/taskGroups/resources/index.d.ts +4 -3
- package/dist/cjs/api/resources/taskGroups/resources/index.js +5 -4
- package/dist/cjs/api/types/SortOrderEnum.d.ts +11 -0
- package/dist/cjs/api/types/SortOrderEnum.js +10 -0
- 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/types/TaskGroupExpandedForCourierAdministratorReq.d.ts +19 -0
- package/dist/cjs/api/types/TaskGroupExpandedForCourierDriver.d.ts +18 -0
- package/dist/cjs/api/types/TaskGroupExpandedForCourierDriverReq.d.ts +19 -0
- package/dist/cjs/api/types/TaskGroupExpandedForShipper.d.ts +18 -0
- package/dist/cjs/api/types/TaskGroupExpandedSortFieldEnum.d.ts +12 -0
- package/dist/cjs/api/types/TaskGroupExpandedSortFieldEnum.js +11 -0
- package/dist/cjs/api/types/TaskGroupsExpandedForCourierAdministratorRes.d.ts +11 -0
- package/dist/cjs/api/types/TaskGroupsExpandedForCourierAdministratorRes.js +5 -0
- package/dist/cjs/api/types/TaskGroupsExpandedForCourierDriverRes.d.ts +11 -0
- package/dist/cjs/api/types/TaskGroupsExpandedForCourierDriverRes.js +5 -0
- package/dist/cjs/api/types/index.d.ts +10 -8
- package/dist/cjs/api/types/index.js +10 -8
- 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 +14 -48
- package/dist/esm/api/resources/taskGroups/client/Client.mjs +18 -185
- package/dist/esm/api/resources/taskGroups/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/taskGroups/resources/expanded/client/Client.d.mts +76 -0
- package/dist/esm/api/resources/taskGroups/resources/{full → expanded}/client/Client.mjs +106 -24
- package/dist/esm/api/resources/taskGroups/resources/expanded/client/requests/TaskGroupExpandedForShipperReq.d.mts +20 -0
- package/dist/esm/api/resources/taskGroups/resources/expanded/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/taskGroups/resources/expandedList/client/Client.d.mts +90 -0
- package/dist/esm/api/resources/taskGroups/resources/expandedList/client/Client.mjs +289 -0
- package/dist/esm/api/resources/taskGroups/resources/expandedList/client/index.d.mts +2 -0
- package/dist/esm/api/resources/taskGroups/resources/expandedList/client/index.mjs +1 -0
- package/dist/esm/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.d.mts +40 -0
- package/dist/esm/api/resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.d.mts +40 -0
- package/dist/esm/api/resources/taskGroups/resources/expandedList/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/taskGroups/resources/index.d.mts +4 -3
- package/dist/esm/api/resources/taskGroups/resources/index.mjs +4 -3
- package/dist/esm/api/types/SortOrderEnum.d.mts +11 -0
- package/dist/esm/api/types/SortOrderEnum.mjs +7 -0
- 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/TaskGroupExpandedForCourierAdministratorReq.d.mts +19 -0
- package/dist/esm/api/types/TaskGroupExpandedForCourierDriver.d.mts +18 -0
- package/dist/esm/api/types/TaskGroupExpandedForCourierDriverReq.d.mts +19 -0
- package/dist/esm/api/types/TaskGroupExpandedForShipper.d.mts +18 -0
- package/dist/esm/api/types/TaskGroupExpandedSortFieldEnum.d.mts +12 -0
- package/dist/esm/api/types/TaskGroupExpandedSortFieldEnum.mjs +8 -0
- package/dist/esm/api/types/TaskGroupsExpandedForCourierAdministratorRes.d.mts +11 -0
- package/dist/esm/api/types/TaskGroupsExpandedForCourierAdministratorRes.mjs +4 -0
- package/dist/esm/api/types/TaskGroupsExpandedForCourierDriverRes.d.mts +11 -0
- package/dist/esm/api/types/TaskGroupsExpandedForCourierDriverRes.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +10 -8
- package/dist/esm/api/types/index.mjs +10 -8
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +206 -201
- package/dist/cjs/api/resources/taskGroups/client/requests/TaskGroupsExpandedReq.d.ts +0 -24
- package/dist/cjs/api/resources/taskGroups/resources/full/client/Client.d.ts +0 -57
- package/dist/cjs/api/resources/taskGroups/resources/full/client/index.d.ts +0 -1
- 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/requests/index.d.ts +0 -1
- package/dist/cjs/api/types/MultipleTaskGroupsDetailsResponse.d.ts +0 -7
- package/dist/cjs/api/types/MultipleTaskGroupsWithTasks.d.ts +0 -7
- package/dist/cjs/api/types/TaskGroupDetailsResponse.d.ts +0 -8
- package/dist/cjs/api/types/TaskGroupWithDetails.d.ts +0 -8
- package/dist/cjs/api/types/TaskGroupWithTasks.d.ts +0 -8
- package/dist/cjs/api/types/TaskGroupsExpandedRes.d.ts +0 -10
- package/dist/cjs/api/types/TaskWithDetails.d.ts +0 -9
- package/dist/esm/api/resources/taskGroups/client/requests/TaskGroupsExpandedReq.d.mts +0 -24
- package/dist/esm/api/resources/taskGroups/resources/full/client/Client.d.mts +0 -57
- package/dist/esm/api/resources/taskGroups/resources/full/client/index.d.mts +0 -1
- 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/requests/index.d.mts +0 -1
- package/dist/esm/api/types/MultipleTaskGroupsDetailsResponse.d.mts +0 -7
- package/dist/esm/api/types/MultipleTaskGroupsWithTasks.d.mts +0 -7
- package/dist/esm/api/types/TaskGroupDetailsResponse.d.mts +0 -8
- package/dist/esm/api/types/TaskGroupWithDetails.d.mts +0 -8
- package/dist/esm/api/types/TaskGroupWithTasks.d.mts +0 -8
- package/dist/esm/api/types/TaskGroupsExpandedRes.d.mts +0 -10
- package/dist/esm/api/types/TaskWithDetails.d.mts +0 -9
- /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/resources/{togglePause → expanded}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/taskGroups/resources/{togglePause → expanded}/client/index.js +0 -0
- /package/dist/cjs/api/resources/taskGroups/{client/requests/TaskGroupsExpandedReq.js → resources/expanded/client/requests/TaskGroupExpandedForShipperReq.js} +0 -0
- /package/dist/cjs/api/resources/taskGroups/resources/{full/client → expanded/client/requests}/index.js +0 -0
- /package/dist/cjs/api/resources/taskGroups/resources/{full → expanded}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/taskGroups/resources/{full → expanded}/index.js +0 -0
- /package/dist/cjs/api/{types/MultipleTaskGroupsDetailsResponse.js → resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.js} +0 -0
- /package/dist/cjs/api/{types/MultipleTaskGroupsWithTasks.js → resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.js} +0 -0
- /package/dist/cjs/api/resources/taskGroups/resources/{togglePause → expandedList}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/taskGroups/resources/{togglePause → expandedList}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/taskGroups/resources/{togglePause → expandedList}/index.js +0 -0
- /package/dist/cjs/api/types/{TaskGroupDetailsResponse.js → TaskGroupExpandedForCourierAdministrator.js} +0 -0
- /package/dist/cjs/api/types/{TaskGroupWithDetails.js → TaskGroupExpandedForCourierAdministratorReq.js} +0 -0
- /package/dist/cjs/api/types/{TaskGroupWithTasks.js → TaskGroupExpandedForCourierDriver.js} +0 -0
- /package/dist/cjs/api/types/{TaskGroupsExpandedRes.js → TaskGroupExpandedForCourierDriverReq.js} +0 -0
- /package/dist/cjs/api/types/{TaskWithDetails.js → TaskGroupExpandedForShipper.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/resources/{togglePause → expanded}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/taskGroups/resources/{togglePause → expanded}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/taskGroups/{client/requests/TaskGroupsExpandedReq.mjs → resources/expanded/client/requests/TaskGroupExpandedForShipperReq.mjs} +0 -0
- /package/dist/esm/api/resources/taskGroups/resources/{full/client → expanded/client/requests}/index.mjs +0 -0
- /package/dist/esm/api/resources/taskGroups/resources/{full → expanded}/index.d.mts +0 -0
- /package/dist/esm/api/resources/taskGroups/resources/{full → expanded}/index.mjs +0 -0
- /package/dist/esm/api/{types/MultipleTaskGroupsDetailsResponse.mjs → resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierAdministratorV1Request.mjs} +0 -0
- /package/dist/esm/api/{types/MultipleTaskGroupsWithTasks.mjs → resources/taskGroups/resources/expandedList/client/requests/ExpandedListForCourierDriverV1Request.mjs} +0 -0
- /package/dist/esm/api/resources/taskGroups/resources/{togglePause → expandedList}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/taskGroups/resources/{togglePause → expandedList}/index.d.mts +0 -0
- /package/dist/esm/api/resources/taskGroups/resources/{togglePause → expandedList}/index.mjs +0 -0
- /package/dist/esm/api/types/{TaskGroupDetailsResponse.mjs → TaskGroupExpandedForCourierAdministrator.mjs} +0 -0
- /package/dist/esm/api/types/{TaskGroupWithDetails.mjs → TaskGroupExpandedForCourierAdministratorReq.mjs} +0 -0
- /package/dist/esm/api/types/{TaskGroupWithTasks.mjs → TaskGroupExpandedForCourierDriver.mjs} +0 -0
- /package/dist/esm/api/types/{TaskGroupsExpandedRes.mjs → TaskGroupExpandedForCourierDriverReq.mjs} +0 -0
- /package/dist/esm/api/types/{TaskWithDetails.mjs → TaskGroupExpandedForShipper.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.299.0",
|
|
72
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.299.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) });
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import * as environments from "../../../../environments.js";
|
|
5
5
|
import * as core from "../../../../core/index.js";
|
|
6
6
|
import * as Chrt from "../../../index.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Expanded } from "../resources/expanded/client/Client.js";
|
|
8
|
+
import { ExpandedList } from "../resources/expandedList/client/Client.js";
|
|
9
9
|
export declare namespace TaskGroups {
|
|
10
10
|
interface Options {
|
|
11
11
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
@@ -31,34 +31,11 @@ export declare namespace TaskGroups {
|
|
|
31
31
|
}
|
|
32
32
|
export declare class TaskGroups {
|
|
33
33
|
protected readonly _options: TaskGroups.Options;
|
|
34
|
-
protected
|
|
35
|
-
protected
|
|
34
|
+
protected _expanded: Expanded | undefined;
|
|
35
|
+
protected _expandedList: ExpandedList | undefined;
|
|
36
36
|
constructor(_options?: TaskGroups.Options);
|
|
37
|
-
get
|
|
38
|
-
get
|
|
39
|
-
/**
|
|
40
|
-
* Lists all task groups assigned to the authenticated courier organization with their associated tasks.
|
|
41
|
-
*
|
|
42
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* await client.taskGroups.listByCourierOrgIdV1()
|
|
46
|
-
*/
|
|
47
|
-
listByCourierOrgIdV1(requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.MultipleTaskGroupsWithTasks>;
|
|
48
|
-
private __listByCourierOrgIdV1;
|
|
49
|
-
/**
|
|
50
|
-
* Retrieves a specific task group by ID with its associated tasks.
|
|
51
|
-
*
|
|
52
|
-
* @param {string} id
|
|
53
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
|
-
*
|
|
55
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* await client.taskGroups.getByIdV1("id")
|
|
59
|
-
*/
|
|
60
|
-
getByIdV1(id: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupWithTasks>;
|
|
61
|
-
private __getByIdV1;
|
|
37
|
+
get expanded(): Expanded;
|
|
38
|
+
get expandedList(): ExpandedList;
|
|
62
39
|
/**
|
|
63
40
|
* Updates task group driver assignments by adding or removing drivers.
|
|
64
41
|
*
|
|
@@ -74,19 +51,6 @@ export declare class TaskGroups {
|
|
|
74
51
|
*/
|
|
75
52
|
updateV1(request: Chrt.UpdateTaskGroupReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.UpdateTaskGroupRes>;
|
|
76
53
|
private __updateV1;
|
|
77
|
-
/**
|
|
78
|
-
* Lists all task groups assigned to a specific driver.
|
|
79
|
-
*
|
|
80
|
-
* @param {string} driverId
|
|
81
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
82
|
-
*
|
|
83
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* await client.taskGroups.listByDriverIdV1("driver_id")
|
|
87
|
-
*/
|
|
88
|
-
listByDriverIdV1(driverId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroup1[]>;
|
|
89
|
-
private __listByDriverIdV1;
|
|
90
54
|
/**
|
|
91
55
|
* Starts a task group by changing its status to in-progress and updating the order status.
|
|
92
56
|
*
|
|
@@ -101,19 +65,21 @@ export declare class TaskGroups {
|
|
|
101
65
|
startV1(id: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
102
66
|
private __startV1;
|
|
103
67
|
/**
|
|
104
|
-
*
|
|
68
|
+
* Toggles the pause status of an in-progress task group.
|
|
105
69
|
*
|
|
106
|
-
* @param {
|
|
70
|
+
* @param {string} id
|
|
71
|
+
* @param {Chrt.SetTaskGroupPauseReq} request
|
|
107
72
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
73
|
*
|
|
109
74
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
110
75
|
*
|
|
111
76
|
* @example
|
|
112
|
-
* await client.taskGroups.
|
|
113
|
-
*
|
|
77
|
+
* await client.taskGroups.togglePauseV1("id", {
|
|
78
|
+
* task_group_id: "task_group_id",
|
|
79
|
+
* paused: true
|
|
114
80
|
* })
|
|
115
81
|
*/
|
|
116
|
-
|
|
117
|
-
private
|
|
82
|
+
togglePauseV1(id: string, request: Chrt.SetTaskGroupPauseReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
83
|
+
private __togglePauseV1;
|
|
118
84
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
119
85
|
}
|
|
@@ -51,129 +51,19 @@ const core = __importStar(require("../../../../core/index.js"));
|
|
|
51
51
|
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
|
-
const Client_js_1 = require("../resources/
|
|
55
|
-
const Client_js_2 = require("../resources/
|
|
54
|
+
const Client_js_1 = require("../resources/expanded/client/Client.js");
|
|
55
|
+
const Client_js_2 = require("../resources/expandedList/client/Client.js");
|
|
56
56
|
class TaskGroups {
|
|
57
57
|
constructor(_options = {}) {
|
|
58
58
|
this._options = _options;
|
|
59
59
|
}
|
|
60
|
-
get
|
|
60
|
+
get expanded() {
|
|
61
61
|
var _a;
|
|
62
|
-
return ((_a = this.
|
|
62
|
+
return ((_a = this._expanded) !== null && _a !== void 0 ? _a : (this._expanded = new Client_js_1.Expanded(this._options)));
|
|
63
63
|
}
|
|
64
|
-
get
|
|
64
|
+
get expandedList() {
|
|
65
65
|
var _a;
|
|
66
|
-
return ((_a = this.
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Lists all task groups assigned to the authenticated courier organization with their associated tasks.
|
|
70
|
-
*
|
|
71
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* await client.taskGroups.listByCourierOrgIdV1()
|
|
75
|
-
*/
|
|
76
|
-
listByCourierOrgIdV1(requestOptions) {
|
|
77
|
-
return core.HttpResponsePromise.fromPromise(this.__listByCourierOrgIdV1(requestOptions));
|
|
78
|
-
}
|
|
79
|
-
__listByCourierOrgIdV1(requestOptions) {
|
|
80
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
var _a, _b, _c, _d;
|
|
82
|
-
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);
|
|
83
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
84
|
-
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/by_courier_org_id/list/v1"),
|
|
85
|
-
method: "GET",
|
|
86
|
-
headers: _headers,
|
|
87
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
88
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
89
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
90
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
91
|
-
});
|
|
92
|
-
if (_response.ok) {
|
|
93
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
94
|
-
}
|
|
95
|
-
if (_response.error.reason === "status-code") {
|
|
96
|
-
throw new errors.ChrtError({
|
|
97
|
-
statusCode: _response.error.statusCode,
|
|
98
|
-
body: _response.error.body,
|
|
99
|
-
rawResponse: _response.rawResponse,
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
switch (_response.error.reason) {
|
|
103
|
-
case "non-json":
|
|
104
|
-
throw new errors.ChrtError({
|
|
105
|
-
statusCode: _response.error.statusCode,
|
|
106
|
-
body: _response.error.rawBody,
|
|
107
|
-
rawResponse: _response.rawResponse,
|
|
108
|
-
});
|
|
109
|
-
case "timeout":
|
|
110
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/by_courier_org_id/list/v1.");
|
|
111
|
-
case "unknown":
|
|
112
|
-
throw new errors.ChrtError({
|
|
113
|
-
message: _response.error.errorMessage,
|
|
114
|
-
rawResponse: _response.rawResponse,
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Retrieves a specific task group by ID with its associated tasks.
|
|
121
|
-
*
|
|
122
|
-
* @param {string} id
|
|
123
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
124
|
-
*
|
|
125
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* await client.taskGroups.getByIdV1("id")
|
|
129
|
-
*/
|
|
130
|
-
getByIdV1(id, requestOptions) {
|
|
131
|
-
return core.HttpResponsePromise.fromPromise(this.__getByIdV1(id, requestOptions));
|
|
132
|
-
}
|
|
133
|
-
__getByIdV1(id, requestOptions) {
|
|
134
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
-
var _a, _b, _c, _d;
|
|
136
|
-
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);
|
|
137
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
138
|
-
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/v1/${encodeURIComponent(id)}`),
|
|
139
|
-
method: "GET",
|
|
140
|
-
headers: _headers,
|
|
141
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
142
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
143
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
144
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
145
|
-
});
|
|
146
|
-
if (_response.ok) {
|
|
147
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
148
|
-
}
|
|
149
|
-
if (_response.error.reason === "status-code") {
|
|
150
|
-
switch (_response.error.statusCode) {
|
|
151
|
-
case 422:
|
|
152
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
153
|
-
default:
|
|
154
|
-
throw new errors.ChrtError({
|
|
155
|
-
statusCode: _response.error.statusCode,
|
|
156
|
-
body: _response.error.body,
|
|
157
|
-
rawResponse: _response.rawResponse,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
switch (_response.error.reason) {
|
|
162
|
-
case "non-json":
|
|
163
|
-
throw new errors.ChrtError({
|
|
164
|
-
statusCode: _response.error.statusCode,
|
|
165
|
-
body: _response.error.rawBody,
|
|
166
|
-
rawResponse: _response.rawResponse,
|
|
167
|
-
});
|
|
168
|
-
case "timeout":
|
|
169
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/v1/{id}.");
|
|
170
|
-
case "unknown":
|
|
171
|
-
throw new errors.ChrtError({
|
|
172
|
-
message: _response.error.errorMessage,
|
|
173
|
-
rawResponse: _response.rawResponse,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
});
|
|
66
|
+
return ((_a = this._expandedList) !== null && _a !== void 0 ? _a : (this._expandedList = new Client_js_2.ExpandedList(this._options)));
|
|
177
67
|
}
|
|
178
68
|
/**
|
|
179
69
|
* Updates task group driver assignments by adding or removing drivers.
|
|
@@ -239,65 +129,6 @@ class TaskGroups {
|
|
|
239
129
|
}
|
|
240
130
|
});
|
|
241
131
|
}
|
|
242
|
-
/**
|
|
243
|
-
* Lists all task groups assigned to a specific driver.
|
|
244
|
-
*
|
|
245
|
-
* @param {string} driverId
|
|
246
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
247
|
-
*
|
|
248
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
249
|
-
*
|
|
250
|
-
* @example
|
|
251
|
-
* await client.taskGroups.listByDriverIdV1("driver_id")
|
|
252
|
-
*/
|
|
253
|
-
listByDriverIdV1(driverId, requestOptions) {
|
|
254
|
-
return core.HttpResponsePromise.fromPromise(this.__listByDriverIdV1(driverId, requestOptions));
|
|
255
|
-
}
|
|
256
|
-
__listByDriverIdV1(driverId, requestOptions) {
|
|
257
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
-
var _a, _b, _c, _d;
|
|
259
|
-
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
|
-
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, `oort/task_groups/list/v1/${encodeURIComponent(driverId)}`),
|
|
262
|
-
method: "GET",
|
|
263
|
-
headers: _headers,
|
|
264
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
265
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
266
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
267
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
268
|
-
});
|
|
269
|
-
if (_response.ok) {
|
|
270
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
271
|
-
}
|
|
272
|
-
if (_response.error.reason === "status-code") {
|
|
273
|
-
switch (_response.error.statusCode) {
|
|
274
|
-
case 422:
|
|
275
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
276
|
-
default:
|
|
277
|
-
throw new errors.ChrtError({
|
|
278
|
-
statusCode: _response.error.statusCode,
|
|
279
|
-
body: _response.error.body,
|
|
280
|
-
rawResponse: _response.rawResponse,
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
switch (_response.error.reason) {
|
|
285
|
-
case "non-json":
|
|
286
|
-
throw new errors.ChrtError({
|
|
287
|
-
statusCode: _response.error.statusCode,
|
|
288
|
-
body: _response.error.rawBody,
|
|
289
|
-
rawResponse: _response.rawResponse,
|
|
290
|
-
});
|
|
291
|
-
case "timeout":
|
|
292
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/list/v1/{driver_id}.");
|
|
293
|
-
case "unknown":
|
|
294
|
-
throw new errors.ChrtError({
|
|
295
|
-
message: _response.error.errorMessage,
|
|
296
|
-
rawResponse: _response.rawResponse,
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
132
|
/**
|
|
302
133
|
* Starts a task group by changing its status to in-progress and updating the order status.
|
|
303
134
|
*
|
|
@@ -358,28 +189,30 @@ class TaskGroups {
|
|
|
358
189
|
});
|
|
359
190
|
}
|
|
360
191
|
/**
|
|
361
|
-
*
|
|
192
|
+
* Toggles the pause status of an in-progress task group.
|
|
362
193
|
*
|
|
363
|
-
* @param {
|
|
194
|
+
* @param {string} id
|
|
195
|
+
* @param {Chrt.SetTaskGroupPauseReq} request
|
|
364
196
|
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
365
197
|
*
|
|
366
198
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
367
199
|
*
|
|
368
200
|
* @example
|
|
369
|
-
* await client.taskGroups.
|
|
370
|
-
*
|
|
201
|
+
* await client.taskGroups.togglePauseV1("id", {
|
|
202
|
+
* task_group_id: "task_group_id",
|
|
203
|
+
* paused: true
|
|
371
204
|
* })
|
|
372
205
|
*/
|
|
373
|
-
|
|
374
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
206
|
+
togglePauseV1(id, request, requestOptions) {
|
|
207
|
+
return core.HttpResponsePromise.fromPromise(this.__togglePauseV1(id, request, requestOptions));
|
|
375
208
|
}
|
|
376
|
-
|
|
209
|
+
__togglePauseV1(id, request, requestOptions) {
|
|
377
210
|
return __awaiter(this, void 0, void 0, function* () {
|
|
378
211
|
var _a, _b, _c, _d;
|
|
379
212
|
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
213
|
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: "
|
|
214
|
+
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)}`),
|
|
215
|
+
method: "PUT",
|
|
383
216
|
headers: _headers,
|
|
384
217
|
contentType: "application/json",
|
|
385
218
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -412,7 +245,7 @@ class TaskGroups {
|
|
|
412
245
|
rawResponse: _response.rawResponse,
|
|
413
246
|
});
|
|
414
247
|
case "timeout":
|
|
415
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
248
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /oort/task_groups/toggle_pause/v1/{id}.");
|
|
416
249
|
case "unknown":
|
|
417
250
|
throw new errors.ChrtError({
|
|
418
251
|
message: _response.error.errorMessage,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { type UpdateTaskGroupReq } from "./UpdateTaskGroupReq.js";
|
|
2
|
-
export { type
|
|
2
|
+
export { type SetTaskGroupPauseReq } from "./SetTaskGroupPauseReq.js";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../../../core/index.js";
|
|
6
|
+
import * as Chrt from "../../../../../index.js";
|
|
7
|
+
export declare namespace Expanded {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
|
+
fetcher?: core.FetchFunction;
|
|
16
|
+
}
|
|
17
|
+
interface RequestOptions {
|
|
18
|
+
/** The maximum time to wait for a response in seconds. */
|
|
19
|
+
timeoutInSeconds?: number;
|
|
20
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
21
|
+
maxRetries?: number;
|
|
22
|
+
/** A hook to abort the request. */
|
|
23
|
+
abortSignal?: AbortSignal;
|
|
24
|
+
/** Additional query string parameters to include in the request. */
|
|
25
|
+
queryParams?: Record<string, unknown>;
|
|
26
|
+
/** Additional headers to include in the request. */
|
|
27
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export declare class Expanded {
|
|
31
|
+
protected readonly _options: Expanded.Options;
|
|
32
|
+
constructor(_options?: Expanded.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Fetches an expanded task group for the courier org with expanded related data.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} id
|
|
37
|
+
* @param {Chrt.TaskGroupExpandedForCourierAdministratorReq} request
|
|
38
|
+
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.taskGroups.expanded.forCourierAdministratorByIdV1("id", {})
|
|
44
|
+
*/
|
|
45
|
+
forCourierAdministratorByIdV1(id: string, request: Chrt.TaskGroupExpandedForCourierAdministratorReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpandedForCourierAdministrator>;
|
|
46
|
+
private __forCourierAdministratorByIdV1;
|
|
47
|
+
/**
|
|
48
|
+
* Fetches an expanded task group assigned to a courier driver with optional expanded related data.
|
|
49
|
+
*
|
|
50
|
+
* @param {string} id
|
|
51
|
+
* @param {Chrt.TaskGroupExpandedForCourierDriverReq} request
|
|
52
|
+
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* await client.taskGroups.expanded.forCourierDriverByIdV1("id", {})
|
|
58
|
+
*/
|
|
59
|
+
forCourierDriverByIdV1(id: string, request: Chrt.TaskGroupExpandedForCourierDriverReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpandedForCourierDriver>;
|
|
60
|
+
private __forCourierDriverByIdV1;
|
|
61
|
+
/**
|
|
62
|
+
* Fetches an expanded task group for the shipper org with expanded related data.
|
|
63
|
+
*
|
|
64
|
+
* @param {string} id
|
|
65
|
+
* @param {Chrt.taskGroups.TaskGroupExpandedForShipperReq} request
|
|
66
|
+
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
+
*
|
|
68
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* await client.taskGroups.expanded.forShipperByIdV1("id")
|
|
72
|
+
*/
|
|
73
|
+
forShipperByIdV1(id: string, request?: Chrt.taskGroups.TaskGroupExpandedForShipperReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpandedForShipper>;
|
|
74
|
+
private __forShipperByIdV1;
|
|
75
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
76
|
+
}
|