@chrt-inc/typescript-sdk 1.409.0 → 1.411.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/orgs/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/orgs/client/Client.js +2 -2
- package/dist/cjs/api/resources/taskGroups/resources/taskGroupId/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/taskGroups/resources/taskGroupId/client/Client.js +2 -2
- package/dist/cjs/api/resources/tracking/resources/devices/client/Client.d.ts +20 -3
- package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +79 -16
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesListV1Request.d.ts +48 -0
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesListV1Request.js +5 -0
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/DeviceListRes.d.ts +8 -0
- package/dist/cjs/api/types/DeviceListRes.js +5 -0
- package/dist/cjs/api/types/DeviceSortByEnum.d.ts +9 -0
- package/dist/cjs/api/types/DeviceSortByEnum.js +11 -0
- package/dist/cjs/api/types/LineItemEnum1.d.ts +4 -1
- package/dist/cjs/api/types/LineItemEnum1.js +3 -0
- package/dist/cjs/api/types/OrgInfoResponse.d.ts +17 -0
- package/dist/cjs/api/types/OrgInfoResponse.js +5 -0
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- 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/orgs/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/orgs/client/Client.mjs +2 -2
- package/dist/esm/api/resources/taskGroups/resources/taskGroupId/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/taskGroups/resources/taskGroupId/client/Client.mjs +2 -2
- package/dist/esm/api/resources/tracking/resources/devices/client/Client.d.mts +20 -3
- package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +79 -16
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesListV1Request.d.mts +48 -0
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesListV1Request.mjs +4 -0
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/DeviceListRes.d.mts +8 -0
- package/dist/esm/api/types/DeviceListRes.mjs +4 -0
- package/dist/esm/api/types/DeviceSortByEnum.d.mts +9 -0
- package/dist/esm/api/types/DeviceSortByEnum.mjs +8 -0
- package/dist/esm/api/types/LineItemEnum1.d.mts +4 -1
- package/dist/esm/api/types/LineItemEnum1.mjs +3 -0
- package/dist/esm/api/types/OrgInfoResponse.d.mts +17 -0
- package/dist/esm/api/types/OrgInfoResponse.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +31 -9
package/dist/cjs/Client.js
CHANGED
|
@@ -67,8 +67,8 @@ class ChrtClient {
|
|
|
67
67
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
68
68
|
"X-Fern-Language": "JavaScript",
|
|
69
69
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
70
|
-
"X-Fern-SDK-Version": "1.
|
|
71
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
70
|
+
"X-Fern-SDK-Version": "1.411.0",
|
|
71
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.411.0",
|
|
72
72
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
73
73
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
74
74
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -31,14 +31,14 @@ export declare class Orgs {
|
|
|
31
31
|
protected readonly _options: Orgs.Options;
|
|
32
32
|
constructor(_options?: Orgs.Options);
|
|
33
33
|
/**
|
|
34
|
-
* Retrieves basic organization information from the authentication service. | () -> (
|
|
34
|
+
* Retrieves basic organization information from the authentication service. | () -> (OrgInfoResponse)
|
|
35
35
|
*
|
|
36
36
|
* @param {Orgs.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* await client.orgs.getInfoV1()
|
|
40
40
|
*/
|
|
41
|
-
getInfoV1(requestOptions?: Orgs.RequestOptions): core.HttpResponsePromise<
|
|
41
|
+
getInfoV1(requestOptions?: Orgs.RequestOptions): core.HttpResponsePromise<Chrt.OrgInfoResponse>;
|
|
42
42
|
private __getInfoV1;
|
|
43
43
|
/**
|
|
44
44
|
* Lists all members of the caller's organization with their roles and details. | () -> (list[OrgMemberDetails])
|
|
@@ -48,15 +48,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
48
48
|
exports.Orgs = void 0;
|
|
49
49
|
const environments = __importStar(require("../../../../environments.js"));
|
|
50
50
|
const core = __importStar(require("../../../../core/index.js"));
|
|
51
|
+
const Chrt = __importStar(require("../../../index.js"));
|
|
51
52
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
52
53
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
|
-
const Chrt = __importStar(require("../../../index.js"));
|
|
54
54
|
class Orgs {
|
|
55
55
|
constructor(_options = {}) {
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Retrieves basic organization information from the authentication service. | () -> (
|
|
59
|
+
* Retrieves basic organization information from the authentication service. | () -> (OrgInfoResponse)
|
|
60
60
|
*
|
|
61
61
|
* @param {Orgs.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
62
|
*
|
|
@@ -30,7 +30,7 @@ export declare class TaskGroupId {
|
|
|
30
30
|
protected readonly _options: TaskGroupId.Options;
|
|
31
31
|
constructor(_options?: TaskGroupId.Options);
|
|
32
32
|
/**
|
|
33
|
-
* Retrieves the task group
|
|
33
|
+
* Retrieves the task group IDs for the courier organization assigned to an order's task groups. | authz_personas=[courier_org_operators] | () -> (list[PydanticObjectId])
|
|
34
34
|
*
|
|
35
35
|
* @param {string} orderIdOrShortId
|
|
36
36
|
* @param {TaskGroupId.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -40,10 +40,10 @@ export declare class TaskGroupId {
|
|
|
40
40
|
* @example
|
|
41
41
|
* await client.taskGroups.taskGroupId.forCourierOperatorsV1("order_id_or_short_id")
|
|
42
42
|
*/
|
|
43
|
-
forCourierOperatorsV1(orderIdOrShortId: string, requestOptions?: TaskGroupId.RequestOptions): core.HttpResponsePromise<string>;
|
|
43
|
+
forCourierOperatorsV1(orderIdOrShortId: string, requestOptions?: TaskGroupId.RequestOptions): core.HttpResponsePromise<string[]>;
|
|
44
44
|
private __forCourierOperatorsV1;
|
|
45
45
|
/**
|
|
46
|
-
* Retrieves the task group
|
|
46
|
+
* Retrieves the task group IDs for the courier driver assigned to an order's task groups. | authz_personas=[courier_driver] | () -> (list[PydanticObjectId])
|
|
47
47
|
*
|
|
48
48
|
* @param {string} orderIdOrShortId
|
|
49
49
|
* @param {TaskGroupId.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -53,7 +53,7 @@ export declare class TaskGroupId {
|
|
|
53
53
|
* @example
|
|
54
54
|
* await client.taskGroups.taskGroupId.forCourierDriverV1("order_id_or_short_id")
|
|
55
55
|
*/
|
|
56
|
-
forCourierDriverV1(orderIdOrShortId: string, requestOptions?: TaskGroupId.RequestOptions): core.HttpResponsePromise<string>;
|
|
56
|
+
forCourierDriverV1(orderIdOrShortId: string, requestOptions?: TaskGroupId.RequestOptions): core.HttpResponsePromise<string[]>;
|
|
57
57
|
private __forCourierDriverV1;
|
|
58
58
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
59
59
|
}
|
|
@@ -56,7 +56,7 @@ class TaskGroupId {
|
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Retrieves the task group
|
|
59
|
+
* Retrieves the task group IDs for the courier organization assigned to an order's task groups. | authz_personas=[courier_org_operators] | () -> (list[PydanticObjectId])
|
|
60
60
|
*
|
|
61
61
|
* @param {string} orderIdOrShortId
|
|
62
62
|
* @param {TaskGroupId.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -115,7 +115,7 @@ class TaskGroupId {
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
|
-
* Retrieves the task group
|
|
118
|
+
* Retrieves the task group IDs for the courier driver assigned to an order's task groups. | authz_personas=[courier_driver] | () -> (list[PydanticObjectId])
|
|
119
119
|
*
|
|
120
120
|
* @param {string} orderIdOrShortId
|
|
121
121
|
* @param {TaskGroupId.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -122,14 +122,31 @@ export declare class Devices {
|
|
|
122
122
|
getV1(request?: Chrt.tracking.DevicesGetV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.Device1>;
|
|
123
123
|
private __getV1;
|
|
124
124
|
/**
|
|
125
|
-
*
|
|
125
|
+
* Lists devices with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
126
126
|
*
|
|
127
|
+
* @param {Chrt.tracking.DevicesListV1Request} request
|
|
127
128
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
128
129
|
*
|
|
130
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
131
|
+
*
|
|
129
132
|
* @example
|
|
130
|
-
* await client.tracking.devices.listV1(
|
|
133
|
+
* await client.tracking.devices.listV1({
|
|
134
|
+
* sort_by: "registered_at_timestamp",
|
|
135
|
+
* sort_order: "asc",
|
|
136
|
+
* page: 1,
|
|
137
|
+
* page_size: 1,
|
|
138
|
+
* filter_off_chrt_order_id: "filter_off_chrt_order_id",
|
|
139
|
+
* filter_device_mac_address: "filter_device_mac_address",
|
|
140
|
+
* filter_type: "D15N-tag",
|
|
141
|
+
* filter_cargo_id: "filter_cargo_id",
|
|
142
|
+
* filter_session_id: "filter_session_id",
|
|
143
|
+
* filter_registered_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
144
|
+
* filter_registered_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
145
|
+
* filter_last_seen_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
146
|
+
* filter_last_seen_at_timestamp_lte: "2024-01-15T09:30:00Z"
|
|
147
|
+
* })
|
|
131
148
|
*/
|
|
132
|
-
listV1(requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.
|
|
149
|
+
listV1(request?: Chrt.tracking.DevicesListV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.DeviceListRes>;
|
|
133
150
|
private __listV1;
|
|
134
151
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
135
152
|
}
|
|
@@ -452,25 +452,83 @@ class Devices {
|
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
/**
|
|
455
|
-
*
|
|
455
|
+
* Lists devices with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
456
456
|
*
|
|
457
|
+
* @param {Chrt.tracking.DevicesListV1Request} request
|
|
457
458
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
458
459
|
*
|
|
460
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
461
|
+
*
|
|
459
462
|
* @example
|
|
460
|
-
* await client.tracking.devices.listV1(
|
|
463
|
+
* await client.tracking.devices.listV1({
|
|
464
|
+
* sort_by: "registered_at_timestamp",
|
|
465
|
+
* sort_order: "asc",
|
|
466
|
+
* page: 1,
|
|
467
|
+
* page_size: 1,
|
|
468
|
+
* filter_off_chrt_order_id: "filter_off_chrt_order_id",
|
|
469
|
+
* filter_device_mac_address: "filter_device_mac_address",
|
|
470
|
+
* filter_type: "D15N-tag",
|
|
471
|
+
* filter_cargo_id: "filter_cargo_id",
|
|
472
|
+
* filter_session_id: "filter_session_id",
|
|
473
|
+
* filter_registered_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
474
|
+
* filter_registered_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
475
|
+
* filter_last_seen_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
476
|
+
* filter_last_seen_at_timestamp_lte: "2024-01-15T09:30:00Z"
|
|
477
|
+
* })
|
|
461
478
|
*/
|
|
462
|
-
listV1(requestOptions) {
|
|
463
|
-
return core.HttpResponsePromise.fromPromise(this.__listV1(requestOptions));
|
|
479
|
+
listV1(request = {}, requestOptions) {
|
|
480
|
+
return core.HttpResponsePromise.fromPromise(this.__listV1(request, requestOptions));
|
|
464
481
|
}
|
|
465
|
-
__listV1(
|
|
466
|
-
return __awaiter(this,
|
|
467
|
-
var _a, _b, _c, _d;
|
|
468
|
-
|
|
469
|
-
const
|
|
470
|
-
|
|
482
|
+
__listV1() {
|
|
483
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
484
|
+
var _a, _b, _c, _d, _e, _f;
|
|
485
|
+
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_off_chrt_order_id: filterOffChrtOrderId, filter_device_mac_address: filterDeviceMacAddress, filter_type: filterType, filter_cargo_id: filterCargoId, filter_session_id: filterSessionId, filter_registered_at_timestamp_gte: filterRegisteredAtTimestampGte, filter_registered_at_timestamp_lte: filterRegisteredAtTimestampLte, filter_last_seen_at_timestamp_gte: filterLastSeenAtTimestampGte, filter_last_seen_at_timestamp_lte: filterLastSeenAtTimestampLte, } = request;
|
|
486
|
+
const _queryParams = {};
|
|
487
|
+
if (sortBy !== undefined) {
|
|
488
|
+
_queryParams["sort_by"] = sortBy;
|
|
489
|
+
}
|
|
490
|
+
if (sortOrder !== undefined) {
|
|
491
|
+
_queryParams["sort_order"] = sortOrder;
|
|
492
|
+
}
|
|
493
|
+
if (page !== undefined) {
|
|
494
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
495
|
+
}
|
|
496
|
+
if (pageSize !== undefined) {
|
|
497
|
+
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
498
|
+
}
|
|
499
|
+
if (filterOffChrtOrderId !== undefined) {
|
|
500
|
+
_queryParams["filter_off_chrt_order_id"] = filterOffChrtOrderId;
|
|
501
|
+
}
|
|
502
|
+
if (filterDeviceMacAddress !== undefined) {
|
|
503
|
+
_queryParams["filter_device_mac_address"] = filterDeviceMacAddress;
|
|
504
|
+
}
|
|
505
|
+
if (filterType !== undefined) {
|
|
506
|
+
_queryParams["filter_type"] = filterType;
|
|
507
|
+
}
|
|
508
|
+
if (filterCargoId !== undefined) {
|
|
509
|
+
_queryParams["filter_cargo_id"] = filterCargoId;
|
|
510
|
+
}
|
|
511
|
+
if (filterSessionId !== undefined) {
|
|
512
|
+
_queryParams["filter_session_id"] = filterSessionId;
|
|
513
|
+
}
|
|
514
|
+
if (filterRegisteredAtTimestampGte !== undefined) {
|
|
515
|
+
_queryParams["filter_registered_at_timestamp_gte"] = filterRegisteredAtTimestampGte;
|
|
516
|
+
}
|
|
517
|
+
if (filterRegisteredAtTimestampLte !== undefined) {
|
|
518
|
+
_queryParams["filter_registered_at_timestamp_lte"] = filterRegisteredAtTimestampLte;
|
|
519
|
+
}
|
|
520
|
+
if (filterLastSeenAtTimestampGte !== undefined) {
|
|
521
|
+
_queryParams["filter_last_seen_at_timestamp_gte"] = filterLastSeenAtTimestampGte;
|
|
522
|
+
}
|
|
523
|
+
if (filterLastSeenAtTimestampLte !== undefined) {
|
|
524
|
+
_queryParams["filter_last_seen_at_timestamp_lte"] = filterLastSeenAtTimestampLte;
|
|
525
|
+
}
|
|
526
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
527
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
528
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, "tracking/devices/list/v1"),
|
|
471
529
|
method: "GET",
|
|
472
530
|
headers: _headers,
|
|
473
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
531
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
474
532
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
475
533
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
476
534
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -479,11 +537,16 @@ class Devices {
|
|
|
479
537
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
480
538
|
}
|
|
481
539
|
if (_response.error.reason === "status-code") {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
540
|
+
switch (_response.error.statusCode) {
|
|
541
|
+
case 422:
|
|
542
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
543
|
+
default:
|
|
544
|
+
throw new errors.ChrtError({
|
|
545
|
+
statusCode: _response.error.statusCode,
|
|
546
|
+
body: _response.error.body,
|
|
547
|
+
rawResponse: _response.rawResponse,
|
|
548
|
+
});
|
|
549
|
+
}
|
|
487
550
|
}
|
|
488
551
|
switch (_response.error.reason) {
|
|
489
552
|
case "non-json":
|
package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesListV1Request.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
* sort_by: "registered_at_timestamp",
|
|
9
|
+
* sort_order: "asc",
|
|
10
|
+
* page: 1,
|
|
11
|
+
* page_size: 1,
|
|
12
|
+
* filter_off_chrt_order_id: "filter_off_chrt_order_id",
|
|
13
|
+
* filter_device_mac_address: "filter_device_mac_address",
|
|
14
|
+
* filter_type: "D15N-tag",
|
|
15
|
+
* filter_cargo_id: "filter_cargo_id",
|
|
16
|
+
* filter_session_id: "filter_session_id",
|
|
17
|
+
* filter_registered_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
18
|
+
* filter_registered_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
19
|
+
* filter_last_seen_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
20
|
+
* filter_last_seen_at_timestamp_lte: "2024-01-15T09:30:00Z"
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
23
|
+
export interface DevicesListV1Request {
|
|
24
|
+
/** Field to sort by */
|
|
25
|
+
sort_by?: Chrt.DeviceSortByEnum | null;
|
|
26
|
+
/** Sort order (ascending or descending) */
|
|
27
|
+
sort_order?: Chrt.SortOrderEnum | null;
|
|
28
|
+
page?: number | null;
|
|
29
|
+
page_size?: number | null;
|
|
30
|
+
/** Filter by off-CHRT order ID (exact match) */
|
|
31
|
+
filter_off_chrt_order_id?: string | null;
|
|
32
|
+
/** Filter by device MAC address (exact match) */
|
|
33
|
+
filter_device_mac_address?: string | null;
|
|
34
|
+
/** Filter by device type */
|
|
35
|
+
filter_type?: Chrt.TrackingDeviceTypeEnum1 | null;
|
|
36
|
+
/** Filter by linked cargo ID */
|
|
37
|
+
filter_cargo_id?: string | null;
|
|
38
|
+
/** Filter by linked session ID */
|
|
39
|
+
filter_session_id?: string | null;
|
|
40
|
+
/** Filter by registered_at_timestamp >= value */
|
|
41
|
+
filter_registered_at_timestamp_gte?: string | null;
|
|
42
|
+
/** Filter by registered_at_timestamp <= value */
|
|
43
|
+
filter_registered_at_timestamp_lte?: string | null;
|
|
44
|
+
/** Filter by last_seen_at_timestamp >= value */
|
|
45
|
+
filter_last_seen_at_timestamp_gte?: string | null;
|
|
46
|
+
/** Filter by last_seen_at_timestamp <= value */
|
|
47
|
+
filter_last_seen_at_timestamp_lte?: string | null;
|
|
48
|
+
}
|
|
@@ -4,3 +4,4 @@ export { type DevicesDeleteV1Request } from "./DevicesDeleteV1Request.js";
|
|
|
4
4
|
export { type DevicesLinkToCargoV1Request } from "./DevicesLinkToCargoV1Request.js";
|
|
5
5
|
export { type DevicesUnlinkFromCargoV1Request } from "./DevicesUnlinkFromCargoV1Request.js";
|
|
6
6
|
export { type DevicesGetV1Request } from "./DevicesGetV1Request.js";
|
|
7
|
+
export { type DevicesListV1Request } from "./DevicesListV1Request.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export type DeviceSortByEnum = "registered_at_timestamp" | "last_seen_at_timestamp" | "first_seen_at_timestamp";
|
|
5
|
+
export declare const DeviceSortByEnum: {
|
|
6
|
+
readonly RegisteredAtTimestamp: "registered_at_timestamp";
|
|
7
|
+
readonly LastSeenAtTimestamp: "last_seen_at_timestamp";
|
|
8
|
+
readonly FirstSeenAtTimestamp: "first_seen_at_timestamp";
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DeviceSortByEnum = void 0;
|
|
7
|
+
exports.DeviceSortByEnum = {
|
|
8
|
+
RegisteredAtTimestamp: "registered_at_timestamp",
|
|
9
|
+
LastSeenAtTimestamp: "last_seen_at_timestamp",
|
|
10
|
+
FirstSeenAtTimestamp: "first_seen_at_timestamp",
|
|
11
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export type LineItemEnum1 = "base_rate" | "additional_mileage" | "long_distance_mileage" | "fuel" | "extra_stop" | "dangerous_goods" | "equipment" | "special_vehicle" | "after_hours" | "weekend" | "holiday" | "flight" | "insurance" | "off_network_carrier" | "wait_time" | "attempt" | "parking" | "tolls" | "additional_fee" | "adjustment" | "dispute" | "other";
|
|
4
|
+
export type LineItemEnum1 = "base_rate" | "additional_mileage" | "long_distance_mileage" | "fuel" | "extra_stop" | "dangerous_goods" | "equipment" | "special_vehicle" | "after_hours" | "weekend" | "holiday" | "flight" | "insurance" | "off_network_carrier" | "wait_time" | "attempt" | "parking" | "tolls" | "additional_fee" | "adjustment" | "dispute" | "other" | "tracking_device_label" | "tracking_device_tag" | "tracking_device_other";
|
|
5
5
|
export declare const LineItemEnum1: {
|
|
6
6
|
readonly BaseRate: "base_rate";
|
|
7
7
|
readonly AdditionalMileage: "additional_mileage";
|
|
@@ -25,4 +25,7 @@ export declare const LineItemEnum1: {
|
|
|
25
25
|
readonly Adjustment: "adjustment";
|
|
26
26
|
readonly Dispute: "dispute";
|
|
27
27
|
readonly Other: "other";
|
|
28
|
+
readonly TrackingDeviceLabel: "tracking_device_label";
|
|
29
|
+
readonly TrackingDeviceTag: "tracking_device_tag";
|
|
30
|
+
readonly TrackingDeviceOther: "tracking_device_other";
|
|
28
31
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface OrgInfoResponse {
|
|
5
|
+
/** Must be a string starting with `org_` */
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
slug?: string | null;
|
|
9
|
+
image_url?: string | null;
|
|
10
|
+
has_image: boolean;
|
|
11
|
+
members_count?: number | null;
|
|
12
|
+
max_allowed_memberships: number;
|
|
13
|
+
admin_delete_enabled: boolean;
|
|
14
|
+
public_metadata: Record<string, unknown>;
|
|
15
|
+
created_at: number;
|
|
16
|
+
updated_at: number;
|
|
17
|
+
}
|
|
@@ -27,6 +27,8 @@ export * from "./CreateOrgPublicDataRes.js";
|
|
|
27
27
|
export * from "./CreateStripeConnectAccountRes.js";
|
|
28
28
|
export * from "./DecodedJwtWithOrgAndUserId.js";
|
|
29
29
|
export * from "./Device1.js";
|
|
30
|
+
export * from "./DeviceListRes.js";
|
|
31
|
+
export * from "./DeviceSortByEnum.js";
|
|
30
32
|
export * from "./DirectoryEntry1.js";
|
|
31
33
|
export * from "./Driver1.js";
|
|
32
34
|
export * from "./DriverStatusEnum.js";
|
|
@@ -78,6 +80,7 @@ export * from "./OrderStatusEnum1.js";
|
|
|
78
80
|
export * from "./OrdersDraftUpdateRes.js";
|
|
79
81
|
export * from "./OrdersExpandedListRes.js";
|
|
80
82
|
export * from "./OrdersNewDraftRes.js";
|
|
83
|
+
export * from "./OrgInfoResponse.js";
|
|
81
84
|
export * from "./OrgMemberDetails.js";
|
|
82
85
|
export * from "./OrgMembersAndDrivers.js";
|
|
83
86
|
export * from "./OrgPrivateData1.js";
|
|
@@ -43,6 +43,8 @@ __exportStar(require("./CreateOrgPublicDataRes.js"), exports);
|
|
|
43
43
|
__exportStar(require("./CreateStripeConnectAccountRes.js"), exports);
|
|
44
44
|
__exportStar(require("./DecodedJwtWithOrgAndUserId.js"), exports);
|
|
45
45
|
__exportStar(require("./Device1.js"), exports);
|
|
46
|
+
__exportStar(require("./DeviceListRes.js"), exports);
|
|
47
|
+
__exportStar(require("./DeviceSortByEnum.js"), exports);
|
|
46
48
|
__exportStar(require("./DirectoryEntry1.js"), exports);
|
|
47
49
|
__exportStar(require("./Driver1.js"), exports);
|
|
48
50
|
__exportStar(require("./DriverStatusEnum.js"), exports);
|
|
@@ -94,6 +96,7 @@ __exportStar(require("./OrderStatusEnum1.js"), exports);
|
|
|
94
96
|
__exportStar(require("./OrdersDraftUpdateRes.js"), exports);
|
|
95
97
|
__exportStar(require("./OrdersExpandedListRes.js"), exports);
|
|
96
98
|
__exportStar(require("./OrdersNewDraftRes.js"), exports);
|
|
99
|
+
__exportStar(require("./OrgInfoResponse.js"), exports);
|
|
97
100
|
__exportStar(require("./OrgMemberDetails.js"), exports);
|
|
98
101
|
__exportStar(require("./OrgMembersAndDrivers.js"), exports);
|
|
99
102
|
__exportStar(require("./OrgPrivateData1.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.411.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -31,8 +31,8 @@ export class ChrtClient {
|
|
|
31
31
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
32
32
|
"X-Fern-Language": "JavaScript",
|
|
33
33
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
34
|
-
"X-Fern-SDK-Version": "1.
|
|
35
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
34
|
+
"X-Fern-SDK-Version": "1.411.0",
|
|
35
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.411.0",
|
|
36
36
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
37
37
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
38
38
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -31,14 +31,14 @@ export declare class Orgs {
|
|
|
31
31
|
protected readonly _options: Orgs.Options;
|
|
32
32
|
constructor(_options?: Orgs.Options);
|
|
33
33
|
/**
|
|
34
|
-
* Retrieves basic organization information from the authentication service. | () -> (
|
|
34
|
+
* Retrieves basic organization information from the authentication service. | () -> (OrgInfoResponse)
|
|
35
35
|
*
|
|
36
36
|
* @param {Orgs.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* await client.orgs.getInfoV1()
|
|
40
40
|
*/
|
|
41
|
-
getInfoV1(requestOptions?: Orgs.RequestOptions): core.HttpResponsePromise<
|
|
41
|
+
getInfoV1(requestOptions?: Orgs.RequestOptions): core.HttpResponsePromise<Chrt.OrgInfoResponse>;
|
|
42
42
|
private __getInfoV1;
|
|
43
43
|
/**
|
|
44
44
|
* Lists all members of the caller's organization with their roles and details. | () -> (list[OrgMemberDetails])
|
|
@@ -12,15 +12,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
};
|
|
13
13
|
import * as environments from "../../../../environments.mjs";
|
|
14
14
|
import * as core from "../../../../core/index.mjs";
|
|
15
|
+
import * as Chrt from "../../../index.mjs";
|
|
15
16
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
16
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
-
import * as Chrt from "../../../index.mjs";
|
|
18
18
|
export class Orgs {
|
|
19
19
|
constructor(_options = {}) {
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Retrieves basic organization information from the authentication service. | () -> (
|
|
23
|
+
* Retrieves basic organization information from the authentication service. | () -> (OrgInfoResponse)
|
|
24
24
|
*
|
|
25
25
|
* @param {Orgs.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
26
|
*
|
|
@@ -30,7 +30,7 @@ export declare class TaskGroupId {
|
|
|
30
30
|
protected readonly _options: TaskGroupId.Options;
|
|
31
31
|
constructor(_options?: TaskGroupId.Options);
|
|
32
32
|
/**
|
|
33
|
-
* Retrieves the task group
|
|
33
|
+
* Retrieves the task group IDs for the courier organization assigned to an order's task groups. | authz_personas=[courier_org_operators] | () -> (list[PydanticObjectId])
|
|
34
34
|
*
|
|
35
35
|
* @param {string} orderIdOrShortId
|
|
36
36
|
* @param {TaskGroupId.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -40,10 +40,10 @@ export declare class TaskGroupId {
|
|
|
40
40
|
* @example
|
|
41
41
|
* await client.taskGroups.taskGroupId.forCourierOperatorsV1("order_id_or_short_id")
|
|
42
42
|
*/
|
|
43
|
-
forCourierOperatorsV1(orderIdOrShortId: string, requestOptions?: TaskGroupId.RequestOptions): core.HttpResponsePromise<string>;
|
|
43
|
+
forCourierOperatorsV1(orderIdOrShortId: string, requestOptions?: TaskGroupId.RequestOptions): core.HttpResponsePromise<string[]>;
|
|
44
44
|
private __forCourierOperatorsV1;
|
|
45
45
|
/**
|
|
46
|
-
* Retrieves the task group
|
|
46
|
+
* Retrieves the task group IDs for the courier driver assigned to an order's task groups. | authz_personas=[courier_driver] | () -> (list[PydanticObjectId])
|
|
47
47
|
*
|
|
48
48
|
* @param {string} orderIdOrShortId
|
|
49
49
|
* @param {TaskGroupId.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -53,7 +53,7 @@ export declare class TaskGroupId {
|
|
|
53
53
|
* @example
|
|
54
54
|
* await client.taskGroups.taskGroupId.forCourierDriverV1("order_id_or_short_id")
|
|
55
55
|
*/
|
|
56
|
-
forCourierDriverV1(orderIdOrShortId: string, requestOptions?: TaskGroupId.RequestOptions): core.HttpResponsePromise<string>;
|
|
56
|
+
forCourierDriverV1(orderIdOrShortId: string, requestOptions?: TaskGroupId.RequestOptions): core.HttpResponsePromise<string[]>;
|
|
57
57
|
private __forCourierDriverV1;
|
|
58
58
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
59
59
|
}
|
|
@@ -20,7 +20,7 @@ export class TaskGroupId {
|
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Retrieves the task group
|
|
23
|
+
* Retrieves the task group IDs for the courier organization assigned to an order's task groups. | authz_personas=[courier_org_operators] | () -> (list[PydanticObjectId])
|
|
24
24
|
*
|
|
25
25
|
* @param {string} orderIdOrShortId
|
|
26
26
|
* @param {TaskGroupId.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -79,7 +79,7 @@ export class TaskGroupId {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
* Retrieves the task group
|
|
82
|
+
* Retrieves the task group IDs for the courier driver assigned to an order's task groups. | authz_personas=[courier_driver] | () -> (list[PydanticObjectId])
|
|
83
83
|
*
|
|
84
84
|
* @param {string} orderIdOrShortId
|
|
85
85
|
* @param {TaskGroupId.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -122,14 +122,31 @@ export declare class Devices {
|
|
|
122
122
|
getV1(request?: Chrt.tracking.DevicesGetV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.Device1>;
|
|
123
123
|
private __getV1;
|
|
124
124
|
/**
|
|
125
|
-
*
|
|
125
|
+
* Lists devices with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
126
126
|
*
|
|
127
|
+
* @param {Chrt.tracking.DevicesListV1Request} request
|
|
127
128
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
128
129
|
*
|
|
130
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
131
|
+
*
|
|
129
132
|
* @example
|
|
130
|
-
* await client.tracking.devices.listV1(
|
|
133
|
+
* await client.tracking.devices.listV1({
|
|
134
|
+
* sort_by: "registered_at_timestamp",
|
|
135
|
+
* sort_order: "asc",
|
|
136
|
+
* page: 1,
|
|
137
|
+
* page_size: 1,
|
|
138
|
+
* filter_off_chrt_order_id: "filter_off_chrt_order_id",
|
|
139
|
+
* filter_device_mac_address: "filter_device_mac_address",
|
|
140
|
+
* filter_type: "D15N-tag",
|
|
141
|
+
* filter_cargo_id: "filter_cargo_id",
|
|
142
|
+
* filter_session_id: "filter_session_id",
|
|
143
|
+
* filter_registered_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
144
|
+
* filter_registered_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
145
|
+
* filter_last_seen_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
146
|
+
* filter_last_seen_at_timestamp_lte: "2024-01-15T09:30:00Z"
|
|
147
|
+
* })
|
|
131
148
|
*/
|
|
132
|
-
listV1(requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.
|
|
149
|
+
listV1(request?: Chrt.tracking.DevicesListV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.DeviceListRes>;
|
|
133
150
|
private __listV1;
|
|
134
151
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
135
152
|
}
|
|
@@ -416,25 +416,83 @@ export class Devices {
|
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
/**
|
|
419
|
-
*
|
|
419
|
+
* Lists devices with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
420
420
|
*
|
|
421
|
+
* @param {Chrt.tracking.DevicesListV1Request} request
|
|
421
422
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
422
423
|
*
|
|
424
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
425
|
+
*
|
|
423
426
|
* @example
|
|
424
|
-
* await client.tracking.devices.listV1(
|
|
427
|
+
* await client.tracking.devices.listV1({
|
|
428
|
+
* sort_by: "registered_at_timestamp",
|
|
429
|
+
* sort_order: "asc",
|
|
430
|
+
* page: 1,
|
|
431
|
+
* page_size: 1,
|
|
432
|
+
* filter_off_chrt_order_id: "filter_off_chrt_order_id",
|
|
433
|
+
* filter_device_mac_address: "filter_device_mac_address",
|
|
434
|
+
* filter_type: "D15N-tag",
|
|
435
|
+
* filter_cargo_id: "filter_cargo_id",
|
|
436
|
+
* filter_session_id: "filter_session_id",
|
|
437
|
+
* filter_registered_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
438
|
+
* filter_registered_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
439
|
+
* filter_last_seen_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
440
|
+
* filter_last_seen_at_timestamp_lte: "2024-01-15T09:30:00Z"
|
|
441
|
+
* })
|
|
425
442
|
*/
|
|
426
|
-
listV1(requestOptions) {
|
|
427
|
-
return core.HttpResponsePromise.fromPromise(this.__listV1(requestOptions));
|
|
443
|
+
listV1(request = {}, requestOptions) {
|
|
444
|
+
return core.HttpResponsePromise.fromPromise(this.__listV1(request, requestOptions));
|
|
428
445
|
}
|
|
429
|
-
__listV1(
|
|
430
|
-
return __awaiter(this,
|
|
431
|
-
var _a, _b, _c, _d;
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
|
|
446
|
+
__listV1() {
|
|
447
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
448
|
+
var _a, _b, _c, _d, _e, _f;
|
|
449
|
+
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_off_chrt_order_id: filterOffChrtOrderId, filter_device_mac_address: filterDeviceMacAddress, filter_type: filterType, filter_cargo_id: filterCargoId, filter_session_id: filterSessionId, filter_registered_at_timestamp_gte: filterRegisteredAtTimestampGte, filter_registered_at_timestamp_lte: filterRegisteredAtTimestampLte, filter_last_seen_at_timestamp_gte: filterLastSeenAtTimestampGte, filter_last_seen_at_timestamp_lte: filterLastSeenAtTimestampLte, } = request;
|
|
450
|
+
const _queryParams = {};
|
|
451
|
+
if (sortBy !== undefined) {
|
|
452
|
+
_queryParams["sort_by"] = sortBy;
|
|
453
|
+
}
|
|
454
|
+
if (sortOrder !== undefined) {
|
|
455
|
+
_queryParams["sort_order"] = sortOrder;
|
|
456
|
+
}
|
|
457
|
+
if (page !== undefined) {
|
|
458
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
459
|
+
}
|
|
460
|
+
if (pageSize !== undefined) {
|
|
461
|
+
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
462
|
+
}
|
|
463
|
+
if (filterOffChrtOrderId !== undefined) {
|
|
464
|
+
_queryParams["filter_off_chrt_order_id"] = filterOffChrtOrderId;
|
|
465
|
+
}
|
|
466
|
+
if (filterDeviceMacAddress !== undefined) {
|
|
467
|
+
_queryParams["filter_device_mac_address"] = filterDeviceMacAddress;
|
|
468
|
+
}
|
|
469
|
+
if (filterType !== undefined) {
|
|
470
|
+
_queryParams["filter_type"] = filterType;
|
|
471
|
+
}
|
|
472
|
+
if (filterCargoId !== undefined) {
|
|
473
|
+
_queryParams["filter_cargo_id"] = filterCargoId;
|
|
474
|
+
}
|
|
475
|
+
if (filterSessionId !== undefined) {
|
|
476
|
+
_queryParams["filter_session_id"] = filterSessionId;
|
|
477
|
+
}
|
|
478
|
+
if (filterRegisteredAtTimestampGte !== undefined) {
|
|
479
|
+
_queryParams["filter_registered_at_timestamp_gte"] = filterRegisteredAtTimestampGte;
|
|
480
|
+
}
|
|
481
|
+
if (filterRegisteredAtTimestampLte !== undefined) {
|
|
482
|
+
_queryParams["filter_registered_at_timestamp_lte"] = filterRegisteredAtTimestampLte;
|
|
483
|
+
}
|
|
484
|
+
if (filterLastSeenAtTimestampGte !== undefined) {
|
|
485
|
+
_queryParams["filter_last_seen_at_timestamp_gte"] = filterLastSeenAtTimestampGte;
|
|
486
|
+
}
|
|
487
|
+
if (filterLastSeenAtTimestampLte !== undefined) {
|
|
488
|
+
_queryParams["filter_last_seen_at_timestamp_lte"] = filterLastSeenAtTimestampLte;
|
|
489
|
+
}
|
|
490
|
+
let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
491
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
492
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, "tracking/devices/list/v1"),
|
|
435
493
|
method: "GET",
|
|
436
494
|
headers: _headers,
|
|
437
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
495
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
438
496
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
439
497
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
440
498
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -443,11 +501,16 @@ export class Devices {
|
|
|
443
501
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
444
502
|
}
|
|
445
503
|
if (_response.error.reason === "status-code") {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
504
|
+
switch (_response.error.statusCode) {
|
|
505
|
+
case 422:
|
|
506
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
507
|
+
default:
|
|
508
|
+
throw new errors.ChrtError({
|
|
509
|
+
statusCode: _response.error.statusCode,
|
|
510
|
+
body: _response.error.body,
|
|
511
|
+
rawResponse: _response.rawResponse,
|
|
512
|
+
});
|
|
513
|
+
}
|
|
451
514
|
}
|
|
452
515
|
switch (_response.error.reason) {
|
|
453
516
|
case "non-json":
|
package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesListV1Request.d.mts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
* sort_by: "registered_at_timestamp",
|
|
9
|
+
* sort_order: "asc",
|
|
10
|
+
* page: 1,
|
|
11
|
+
* page_size: 1,
|
|
12
|
+
* filter_off_chrt_order_id: "filter_off_chrt_order_id",
|
|
13
|
+
* filter_device_mac_address: "filter_device_mac_address",
|
|
14
|
+
* filter_type: "D15N-tag",
|
|
15
|
+
* filter_cargo_id: "filter_cargo_id",
|
|
16
|
+
* filter_session_id: "filter_session_id",
|
|
17
|
+
* filter_registered_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
18
|
+
* filter_registered_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
19
|
+
* filter_last_seen_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
20
|
+
* filter_last_seen_at_timestamp_lte: "2024-01-15T09:30:00Z"
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
23
|
+
export interface DevicesListV1Request {
|
|
24
|
+
/** Field to sort by */
|
|
25
|
+
sort_by?: Chrt.DeviceSortByEnum | null;
|
|
26
|
+
/** Sort order (ascending or descending) */
|
|
27
|
+
sort_order?: Chrt.SortOrderEnum | null;
|
|
28
|
+
page?: number | null;
|
|
29
|
+
page_size?: number | null;
|
|
30
|
+
/** Filter by off-CHRT order ID (exact match) */
|
|
31
|
+
filter_off_chrt_order_id?: string | null;
|
|
32
|
+
/** Filter by device MAC address (exact match) */
|
|
33
|
+
filter_device_mac_address?: string | null;
|
|
34
|
+
/** Filter by device type */
|
|
35
|
+
filter_type?: Chrt.TrackingDeviceTypeEnum1 | null;
|
|
36
|
+
/** Filter by linked cargo ID */
|
|
37
|
+
filter_cargo_id?: string | null;
|
|
38
|
+
/** Filter by linked session ID */
|
|
39
|
+
filter_session_id?: string | null;
|
|
40
|
+
/** Filter by registered_at_timestamp >= value */
|
|
41
|
+
filter_registered_at_timestamp_gte?: string | null;
|
|
42
|
+
/** Filter by registered_at_timestamp <= value */
|
|
43
|
+
filter_registered_at_timestamp_lte?: string | null;
|
|
44
|
+
/** Filter by last_seen_at_timestamp >= value */
|
|
45
|
+
filter_last_seen_at_timestamp_gte?: string | null;
|
|
46
|
+
/** Filter by last_seen_at_timestamp <= value */
|
|
47
|
+
filter_last_seen_at_timestamp_lte?: string | null;
|
|
48
|
+
}
|
|
@@ -4,3 +4,4 @@ export { type DevicesDeleteV1Request } from "./DevicesDeleteV1Request.mjs";
|
|
|
4
4
|
export { type DevicesLinkToCargoV1Request } from "./DevicesLinkToCargoV1Request.mjs";
|
|
5
5
|
export { type DevicesUnlinkFromCargoV1Request } from "./DevicesUnlinkFromCargoV1Request.mjs";
|
|
6
6
|
export { type DevicesGetV1Request } from "./DevicesGetV1Request.mjs";
|
|
7
|
+
export { type DevicesListV1Request } from "./DevicesListV1Request.mjs";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export type DeviceSortByEnum = "registered_at_timestamp" | "last_seen_at_timestamp" | "first_seen_at_timestamp";
|
|
5
|
+
export declare const DeviceSortByEnum: {
|
|
6
|
+
readonly RegisteredAtTimestamp: "registered_at_timestamp";
|
|
7
|
+
readonly LastSeenAtTimestamp: "last_seen_at_timestamp";
|
|
8
|
+
readonly FirstSeenAtTimestamp: "first_seen_at_timestamp";
|
|
9
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export const DeviceSortByEnum = {
|
|
5
|
+
RegisteredAtTimestamp: "registered_at_timestamp",
|
|
6
|
+
LastSeenAtTimestamp: "last_seen_at_timestamp",
|
|
7
|
+
FirstSeenAtTimestamp: "first_seen_at_timestamp",
|
|
8
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export type LineItemEnum1 = "base_rate" | "additional_mileage" | "long_distance_mileage" | "fuel" | "extra_stop" | "dangerous_goods" | "equipment" | "special_vehicle" | "after_hours" | "weekend" | "holiday" | "flight" | "insurance" | "off_network_carrier" | "wait_time" | "attempt" | "parking" | "tolls" | "additional_fee" | "adjustment" | "dispute" | "other";
|
|
4
|
+
export type LineItemEnum1 = "base_rate" | "additional_mileage" | "long_distance_mileage" | "fuel" | "extra_stop" | "dangerous_goods" | "equipment" | "special_vehicle" | "after_hours" | "weekend" | "holiday" | "flight" | "insurance" | "off_network_carrier" | "wait_time" | "attempt" | "parking" | "tolls" | "additional_fee" | "adjustment" | "dispute" | "other" | "tracking_device_label" | "tracking_device_tag" | "tracking_device_other";
|
|
5
5
|
export declare const LineItemEnum1: {
|
|
6
6
|
readonly BaseRate: "base_rate";
|
|
7
7
|
readonly AdditionalMileage: "additional_mileage";
|
|
@@ -25,4 +25,7 @@ export declare const LineItemEnum1: {
|
|
|
25
25
|
readonly Adjustment: "adjustment";
|
|
26
26
|
readonly Dispute: "dispute";
|
|
27
27
|
readonly Other: "other";
|
|
28
|
+
readonly TrackingDeviceLabel: "tracking_device_label";
|
|
29
|
+
readonly TrackingDeviceTag: "tracking_device_tag";
|
|
30
|
+
readonly TrackingDeviceOther: "tracking_device_other";
|
|
28
31
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface OrgInfoResponse {
|
|
5
|
+
/** Must be a string starting with `org_` */
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
slug?: string | null;
|
|
9
|
+
image_url?: string | null;
|
|
10
|
+
has_image: boolean;
|
|
11
|
+
members_count?: number | null;
|
|
12
|
+
max_allowed_memberships: number;
|
|
13
|
+
admin_delete_enabled: boolean;
|
|
14
|
+
public_metadata: Record<string, unknown>;
|
|
15
|
+
created_at: number;
|
|
16
|
+
updated_at: number;
|
|
17
|
+
}
|
|
@@ -27,6 +27,8 @@ export * from "./CreateOrgPublicDataRes.mjs";
|
|
|
27
27
|
export * from "./CreateStripeConnectAccountRes.mjs";
|
|
28
28
|
export * from "./DecodedJwtWithOrgAndUserId.mjs";
|
|
29
29
|
export * from "./Device1.mjs";
|
|
30
|
+
export * from "./DeviceListRes.mjs";
|
|
31
|
+
export * from "./DeviceSortByEnum.mjs";
|
|
30
32
|
export * from "./DirectoryEntry1.mjs";
|
|
31
33
|
export * from "./Driver1.mjs";
|
|
32
34
|
export * from "./DriverStatusEnum.mjs";
|
|
@@ -78,6 +80,7 @@ export * from "./OrderStatusEnum1.mjs";
|
|
|
78
80
|
export * from "./OrdersDraftUpdateRes.mjs";
|
|
79
81
|
export * from "./OrdersExpandedListRes.mjs";
|
|
80
82
|
export * from "./OrdersNewDraftRes.mjs";
|
|
83
|
+
export * from "./OrgInfoResponse.mjs";
|
|
81
84
|
export * from "./OrgMemberDetails.mjs";
|
|
82
85
|
export * from "./OrgMembersAndDrivers.mjs";
|
|
83
86
|
export * from "./OrgPrivateData1.mjs";
|
|
@@ -27,6 +27,8 @@ export * from "./CreateOrgPublicDataRes.mjs";
|
|
|
27
27
|
export * from "./CreateStripeConnectAccountRes.mjs";
|
|
28
28
|
export * from "./DecodedJwtWithOrgAndUserId.mjs";
|
|
29
29
|
export * from "./Device1.mjs";
|
|
30
|
+
export * from "./DeviceListRes.mjs";
|
|
31
|
+
export * from "./DeviceSortByEnum.mjs";
|
|
30
32
|
export * from "./DirectoryEntry1.mjs";
|
|
31
33
|
export * from "./Driver1.mjs";
|
|
32
34
|
export * from "./DriverStatusEnum.mjs";
|
|
@@ -78,6 +80,7 @@ export * from "./OrderStatusEnum1.mjs";
|
|
|
78
80
|
export * from "./OrdersDraftUpdateRes.mjs";
|
|
79
81
|
export * from "./OrdersExpandedListRes.mjs";
|
|
80
82
|
export * from "./OrdersNewDraftRes.mjs";
|
|
83
|
+
export * from "./OrgInfoResponse.mjs";
|
|
81
84
|
export * from "./OrgMemberDetails.mjs";
|
|
82
85
|
export * from "./OrgMembersAndDrivers.mjs";
|
|
83
86
|
export * from "./OrgPrivateData1.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.411.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.
|
|
1
|
+
export const SDK_VERSION = "1.411.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -4173,7 +4173,7 @@ await client.directoryEntries.deleteV1("directory_entry_id");
|
|
|
4173
4173
|
|
|
4174
4174
|
## Orgs
|
|
4175
4175
|
|
|
4176
|
-
<details><summary><code>client.orgs.<a href="/src/api/resources/orgs/client/Client.ts">getInfoV1</a>() ->
|
|
4176
|
+
<details><summary><code>client.orgs.<a href="/src/api/resources/orgs/client/Client.ts">getInfoV1</a>() -> Chrt.OrgInfoResponse</code></summary>
|
|
4177
4177
|
<dl>
|
|
4178
4178
|
<dd>
|
|
4179
4179
|
|
|
@@ -4185,7 +4185,7 @@ await client.directoryEntries.deleteV1("directory_entry_id");
|
|
|
4185
4185
|
<dl>
|
|
4186
4186
|
<dd>
|
|
4187
4187
|
|
|
4188
|
-
Retrieves basic organization information from the authentication service. | () -> (
|
|
4188
|
+
Retrieves basic organization information from the authentication service. | () -> (OrgInfoResponse)
|
|
4189
4189
|
|
|
4190
4190
|
</dd>
|
|
4191
4191
|
</dl>
|
|
@@ -12201,7 +12201,7 @@ await client.taskArtifacts.s3Object.deleteV1("task_artifact_s3_object_metadata_i
|
|
|
12201
12201
|
|
|
12202
12202
|
## TaskGroups TaskGroupId
|
|
12203
12203
|
|
|
12204
|
-
<details><summary><code>client.taskGroups.taskGroupId.<a href="/src/api/resources/taskGroups/resources/taskGroupId/client/Client.ts">forCourierOperatorsV1</a>(orderIdOrShortId) -> string</code></summary>
|
|
12204
|
+
<details><summary><code>client.taskGroups.taskGroupId.<a href="/src/api/resources/taskGroups/resources/taskGroupId/client/Client.ts">forCourierOperatorsV1</a>(orderIdOrShortId) -> string[]</code></summary>
|
|
12205
12205
|
<dl>
|
|
12206
12206
|
<dd>
|
|
12207
12207
|
|
|
@@ -12213,7 +12213,7 @@ await client.taskArtifacts.s3Object.deleteV1("task_artifact_s3_object_metadata_i
|
|
|
12213
12213
|
<dl>
|
|
12214
12214
|
<dd>
|
|
12215
12215
|
|
|
12216
|
-
Retrieves the task group
|
|
12216
|
+
Retrieves the task group IDs for the courier organization assigned to an order's task groups. | authz_personas=[courier_org_operators] | () -> (list[PydanticObjectId])
|
|
12217
12217
|
|
|
12218
12218
|
</dd>
|
|
12219
12219
|
</dl>
|
|
@@ -12264,7 +12264,7 @@ await client.taskGroups.taskGroupId.forCourierOperatorsV1("order_id_or_short_id"
|
|
|
12264
12264
|
</dl>
|
|
12265
12265
|
</details>
|
|
12266
12266
|
|
|
12267
|
-
<details><summary><code>client.taskGroups.taskGroupId.<a href="/src/api/resources/taskGroups/resources/taskGroupId/client/Client.ts">forCourierDriverV1</a>(orderIdOrShortId) -> string</code></summary>
|
|
12267
|
+
<details><summary><code>client.taskGroups.taskGroupId.<a href="/src/api/resources/taskGroups/resources/taskGroupId/client/Client.ts">forCourierDriverV1</a>(orderIdOrShortId) -> string[]</code></summary>
|
|
12268
12268
|
<dl>
|
|
12269
12269
|
<dd>
|
|
12270
12270
|
|
|
@@ -12276,7 +12276,7 @@ await client.taskGroups.taskGroupId.forCourierOperatorsV1("order_id_or_short_id"
|
|
|
12276
12276
|
<dl>
|
|
12277
12277
|
<dd>
|
|
12278
12278
|
|
|
12279
|
-
Retrieves the task group
|
|
12279
|
+
Retrieves the task group IDs for the courier driver assigned to an order's task groups. | authz_personas=[courier_driver] | () -> (list[PydanticObjectId])
|
|
12280
12280
|
|
|
12281
12281
|
</dd>
|
|
12282
12282
|
</dl>
|
|
@@ -13432,7 +13432,7 @@ await client.tracking.devices.getV1({
|
|
|
13432
13432
|
</dl>
|
|
13433
13433
|
</details>
|
|
13434
13434
|
|
|
13435
|
-
<details><summary><code>client.tracking.devices.<a href="/src/api/resources/tracking/resources/devices/client/Client.ts">listV1</a>() -> Chrt.
|
|
13435
|
+
<details><summary><code>client.tracking.devices.<a href="/src/api/resources/tracking/resources/devices/client/Client.ts">listV1</a>({ ...params }) -> Chrt.DeviceListRes</code></summary>
|
|
13436
13436
|
<dl>
|
|
13437
13437
|
<dd>
|
|
13438
13438
|
|
|
@@ -13444,7 +13444,7 @@ await client.tracking.devices.getV1({
|
|
|
13444
13444
|
<dl>
|
|
13445
13445
|
<dd>
|
|
13446
13446
|
|
|
13447
|
-
|
|
13447
|
+
Lists devices with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
13448
13448
|
|
|
13449
13449
|
</dd>
|
|
13450
13450
|
</dl>
|
|
@@ -13460,7 +13460,21 @@ Returns all tracking devices registered to the caller's organization. | authz: m
|
|
|
13460
13460
|
<dd>
|
|
13461
13461
|
|
|
13462
13462
|
```typescript
|
|
13463
|
-
await client.tracking.devices.listV1(
|
|
13463
|
+
await client.tracking.devices.listV1({
|
|
13464
|
+
sort_by: "registered_at_timestamp",
|
|
13465
|
+
sort_order: "asc",
|
|
13466
|
+
page: 1,
|
|
13467
|
+
page_size: 1,
|
|
13468
|
+
filter_off_chrt_order_id: "filter_off_chrt_order_id",
|
|
13469
|
+
filter_device_mac_address: "filter_device_mac_address",
|
|
13470
|
+
filter_type: "D15N-tag",
|
|
13471
|
+
filter_cargo_id: "filter_cargo_id",
|
|
13472
|
+
filter_session_id: "filter_session_id",
|
|
13473
|
+
filter_registered_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
13474
|
+
filter_registered_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
13475
|
+
filter_last_seen_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
13476
|
+
filter_last_seen_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
13477
|
+
});
|
|
13464
13478
|
```
|
|
13465
13479
|
|
|
13466
13480
|
</dd>
|
|
@@ -13476,6 +13490,14 @@ await client.tracking.devices.listV1();
|
|
|
13476
13490
|
<dl>
|
|
13477
13491
|
<dd>
|
|
13478
13492
|
|
|
13493
|
+
**request:** `Chrt.tracking.DevicesListV1Request`
|
|
13494
|
+
|
|
13495
|
+
</dd>
|
|
13496
|
+
</dl>
|
|
13497
|
+
|
|
13498
|
+
<dl>
|
|
13499
|
+
<dd>
|
|
13500
|
+
|
|
13479
13501
|
**requestOptions:** `Devices.RequestOptions`
|
|
13480
13502
|
|
|
13481
13503
|
</dd>
|