@chrt-inc/typescript-sdk 1.419.0 → 1.421.1
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/tracking/resources/devices/client/Client.d.ts +39 -52
- package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +94 -147
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/{DevicesRegisterToOrgReq1.d.ts → DeviceClientCreate1.d.ts} +4 -2
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DeviceClientUpdate1.d.ts +19 -0
- package/dist/{esm/api/resources/tracking/resources/sessions/client/requests/SessionsStartV1Request.d.mts → cjs/api/resources/tracking/resources/devices/client/requests/DevicesArchiveV1Request.d.ts} +3 -3
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesGetV1Request.d.ts +1 -3
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesListV1Request.d.ts +12 -12
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesSearchV1Request.d.ts +6 -2
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesTypeaheadV1Request.d.ts +20 -0
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUpdateSharedOrgsReq1.d.ts +14 -0
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/index.d.ts +5 -6
- package/dist/cjs/api/resources/tracking/resources/sessions/client/Client.d.ts +65 -52
- package/dist/cjs/api/resources/tracking/resources/sessions/client/Client.js +160 -106
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionAddFlightReq1.d.ts +16 -0
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionClientCreate1.d.ts +22 -0
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionClientUpdate1.d.ts +19 -0
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionRemoveFlightReq1.d.ts +16 -0
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionsListV1Request.d.ts +31 -19
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionsSearchV1Request.d.ts +6 -2
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/{SessionsPauseRecordingV1Request.d.ts → SessionsSyncFlightStatusV1Request.d.ts} +1 -1
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionsTypeaheadV1Request.d.ts +20 -0
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/{SessionsStartV1Request.d.ts → SessionsUpdateSharedOrgsReq1.d.ts} +3 -1
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/index.d.ts +7 -7
- package/dist/cjs/api/types/DeviceExpandedRes.d.ts +11 -0
- package/dist/cjs/api/types/{Device1.d.ts → DeviceLimitedForList1.d.ts} +16 -6
- package/dist/cjs/api/types/DeviceListRes.d.ts +1 -1
- package/dist/cjs/api/types/DeviceSearchRes.d.ts +1 -1
- package/dist/cjs/api/types/FlightStatusEnum.d.ts +14 -0
- package/dist/cjs/api/types/FlightStatusEnum.js +16 -0
- package/dist/cjs/api/types/Session1.d.ts +15 -8
- package/dist/cjs/api/types/SessionSortByEnum.d.ts +4 -3
- package/dist/cjs/api/types/SessionSortByEnum.js +3 -2
- package/dist/cjs/api/types/TrackingOrgScopeEnum.d.ts +9 -0
- package/dist/cjs/api/types/TrackingOrgScopeEnum.js +11 -0
- package/dist/cjs/api/types/TrackingTypeaheadFieldEnum.d.ts +8 -0
- package/dist/cjs/api/types/TrackingTypeaheadFieldEnum.js +10 -0
- package/dist/cjs/api/types/TrackingTypeaheadResult.d.ts +8 -0
- package/dist/cjs/api/types/index.d.ts +6 -2
- package/dist/cjs/api/types/index.js +6 -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/tracking/resources/devices/client/Client.d.mts +39 -52
- package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +94 -147
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/{DevicesRegisterToOrgReq1.d.mts → DeviceClientCreate1.d.mts} +4 -2
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DeviceClientUpdate1.d.mts +19 -0
- package/dist/esm/api/resources/tracking/resources/{sessions/client/requests/SessionsDeleteV1Request.d.mts → devices/client/requests/DevicesArchiveV1Request.d.mts} +3 -3
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesGetV1Request.d.mts +1 -3
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesListV1Request.d.mts +12 -12
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesSearchV1Request.d.mts +6 -2
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesTypeaheadV1Request.d.mts +20 -0
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUpdateSharedOrgsReq1.d.mts +14 -0
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/index.d.mts +5 -6
- package/dist/esm/api/resources/tracking/resources/sessions/client/Client.d.mts +65 -52
- package/dist/esm/api/resources/tracking/resources/sessions/client/Client.mjs +160 -106
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionAddFlightReq1.d.mts +16 -0
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionClientCreate1.d.mts +22 -0
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionClientUpdate1.d.mts +19 -0
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionRemoveFlightReq1.d.mts +16 -0
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionsListV1Request.d.mts +31 -19
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionsSearchV1Request.d.mts +6 -2
- package/dist/{cjs/api/resources/tracking/resources/sessions/client/requests/SessionsDeleteV1Request.d.ts → esm/api/resources/tracking/resources/sessions/client/requests/SessionsSyncFlightStatusV1Request.d.mts} +1 -1
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionsTypeaheadV1Request.d.mts +20 -0
- package/dist/{cjs/api/resources/tracking/resources/sessions/client/requests/SessionsResumeRecordingV1Request.d.ts → esm/api/resources/tracking/resources/sessions/client/requests/SessionsUpdateSharedOrgsReq1.d.mts} +3 -1
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/index.d.mts +7 -7
- package/dist/esm/api/types/DeviceExpandedRes.d.mts +11 -0
- package/dist/esm/api/types/{Device1.d.mts → DeviceLimitedForList1.d.mts} +16 -6
- package/dist/esm/api/types/DeviceListRes.d.mts +1 -1
- package/dist/esm/api/types/DeviceSearchRes.d.mts +1 -1
- package/dist/esm/api/types/FlightStatusEnum.d.mts +14 -0
- package/dist/esm/api/types/FlightStatusEnum.mjs +13 -0
- package/dist/esm/api/types/Session1.d.mts +15 -8
- package/dist/esm/api/types/SessionSortByEnum.d.mts +4 -3
- package/dist/esm/api/types/SessionSortByEnum.mjs +3 -2
- package/dist/esm/api/types/TrackingOrgScopeEnum.d.mts +9 -0
- package/dist/esm/api/types/TrackingOrgScopeEnum.mjs +8 -0
- package/dist/esm/api/types/TrackingTypeaheadFieldEnum.d.mts +8 -0
- package/dist/esm/api/types/TrackingTypeaheadFieldEnum.mjs +7 -0
- package/dist/esm/api/types/TrackingTypeaheadResult.d.mts +8 -0
- package/dist/esm/api/types/index.d.mts +6 -2
- package/dist/esm/api/types/index.mjs +6 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +82 -132
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesDeleteV1Request.d.ts +0 -14
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.d.ts +0 -14
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesTypeaheadOffChrtOrderIdV1Request.d.ts +0 -16
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.d.ts +0 -12
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUpdateRequest1.d.ts +0 -18
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionCreateSessionRequest1.d.ts +0 -16
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionUpdateRequest1.d.ts +0 -20
- package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/SessionsTypeaheadOffChrtOrderIdV1Request.d.ts +0 -16
- package/dist/cjs/api/types/SessionDeleteResponse1.d.ts +0 -7
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesDeleteV1Request.d.mts +0 -14
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.d.mts +0 -14
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesTypeaheadOffChrtOrderIdV1Request.d.mts +0 -16
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.d.mts +0 -12
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUpdateRequest1.d.mts +0 -18
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionCreateSessionRequest1.d.mts +0 -16
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionUpdateRequest1.d.mts +0 -20
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionsPauseRecordingV1Request.d.mts +0 -12
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionsResumeRecordingV1Request.d.mts +0 -12
- package/dist/esm/api/resources/tracking/resources/sessions/client/requests/SessionsTypeaheadOffChrtOrderIdV1Request.d.mts +0 -16
- package/dist/esm/api/types/SessionDeleteResponse1.d.mts +0 -7
- /package/dist/cjs/api/resources/tracking/resources/devices/client/requests/{DevicesDeleteV1Request.js → DeviceClientCreate1.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/devices/client/requests/{DevicesLinkToCargoV1Request.js → DeviceClientUpdate1.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/devices/client/requests/{DevicesRegisterToOrgReq1.js → DevicesArchiveV1Request.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/devices/client/requests/{DevicesTypeaheadOffChrtOrderIdV1Request.js → DevicesTypeaheadV1Request.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/devices/client/requests/{DevicesUnlinkFromCargoV1Request.js → DevicesUpdateSharedOrgsReq1.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/{devices/client/requests/DevicesUpdateRequest1.js → sessions/client/requests/SessionAddFlightReq1.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/{SessionCreateSessionRequest1.js → SessionClientCreate1.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/{SessionUpdateRequest1.js → SessionClientUpdate1.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/{SessionsDeleteV1Request.js → SessionRemoveFlightReq1.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/{SessionsPauseRecordingV1Request.js → SessionsSyncFlightStatusV1Request.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/{SessionsResumeRecordingV1Request.js → SessionsTypeaheadV1Request.js} +0 -0
- /package/dist/cjs/api/resources/tracking/resources/sessions/client/requests/{SessionsStartV1Request.js → SessionsUpdateSharedOrgsReq1.js} +0 -0
- /package/dist/cjs/api/{resources/tracking/resources/sessions/client/requests/SessionsTypeaheadOffChrtOrderIdV1Request.js → types/DeviceExpandedRes.js} +0 -0
- /package/dist/cjs/api/types/{Device1.js → DeviceLimitedForList1.js} +0 -0
- /package/dist/cjs/api/types/{SessionDeleteResponse1.js → TrackingTypeaheadResult.js} +0 -0
- /package/dist/esm/api/resources/tracking/resources/devices/client/requests/{DevicesDeleteV1Request.mjs → DeviceClientCreate1.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/devices/client/requests/{DevicesLinkToCargoV1Request.mjs → DeviceClientUpdate1.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/devices/client/requests/{DevicesRegisterToOrgReq1.mjs → DevicesArchiveV1Request.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/devices/client/requests/{DevicesTypeaheadOffChrtOrderIdV1Request.mjs → DevicesTypeaheadV1Request.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/devices/client/requests/{DevicesUnlinkFromCargoV1Request.mjs → DevicesUpdateSharedOrgsReq1.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/{devices/client/requests/DevicesUpdateRequest1.mjs → sessions/client/requests/SessionAddFlightReq1.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/sessions/client/requests/{SessionCreateSessionRequest1.mjs → SessionClientCreate1.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/sessions/client/requests/{SessionUpdateRequest1.mjs → SessionClientUpdate1.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/sessions/client/requests/{SessionsDeleteV1Request.mjs → SessionRemoveFlightReq1.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/sessions/client/requests/{SessionsPauseRecordingV1Request.mjs → SessionsSyncFlightStatusV1Request.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/sessions/client/requests/{SessionsResumeRecordingV1Request.mjs → SessionsTypeaheadV1Request.mjs} +0 -0
- /package/dist/esm/api/resources/tracking/resources/sessions/client/requests/{SessionsStartV1Request.mjs → SessionsUpdateSharedOrgsReq1.mjs} +0 -0
- /package/dist/esm/api/{resources/tracking/resources/sessions/client/requests/SessionsTypeaheadOffChrtOrderIdV1Request.mjs → types/DeviceExpandedRes.mjs} +0 -0
- /package/dist/esm/api/types/{Device1.mjs → DeviceLimitedForList1.mjs} +0 -0
- /package/dist/esm/api/types/{SessionDeleteResponse1.mjs → TrackingTypeaheadResult.mjs} +0 -0
|
@@ -10,6 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
import * as environments from "../../../../../../environments.mjs";
|
|
14
25
|
import * as core from "../../../../../../core/index.mjs";
|
|
15
26
|
import * as Chrt from "../../../../../index.mjs";
|
|
@@ -20,15 +31,16 @@ export class Devices {
|
|
|
20
31
|
this._options = _options;
|
|
21
32
|
}
|
|
22
33
|
/**
|
|
23
|
-
* Registers a tracking device to the caller's organization. If device is already registered to a different organization,
|
|
34
|
+
* Registers a tracking device to the caller's organization. If the device is already registered to a different organization, returns 409 Conflict. | (DeviceClientCreate1) -> (PydanticObjectId)
|
|
24
35
|
*
|
|
25
|
-
* @param {Chrt.tracking.
|
|
36
|
+
* @param {Chrt.tracking.DeviceClientCreate1} request
|
|
26
37
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
38
|
*
|
|
28
39
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
40
|
*
|
|
30
41
|
* @example
|
|
31
42
|
* await client.tracking.devices.registerToOrgV1({
|
|
43
|
+
* schema_version: 1,
|
|
32
44
|
* device_mac_address: "device_mac_address"
|
|
33
45
|
* })
|
|
34
46
|
*/
|
|
@@ -84,31 +96,36 @@ export class Devices {
|
|
|
84
96
|
});
|
|
85
97
|
}
|
|
86
98
|
/**
|
|
87
|
-
* Updates a device's type, comments, and/or
|
|
99
|
+
* Updates a device's type, comments, and/or off_chrt_reference_id. Use __set_to_None flags to explicitly clear Optional fields. | (DeviceClientUpdate1) -> (bool)
|
|
88
100
|
*
|
|
89
|
-
* @param {Chrt.tracking.
|
|
101
|
+
* @param {Chrt.tracking.DeviceClientUpdate1} request
|
|
90
102
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
103
|
*
|
|
92
104
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
93
105
|
*
|
|
94
106
|
* @example
|
|
95
|
-
* await client.tracking.devices.updateV1(
|
|
107
|
+
* await client.tracking.devices.updateV1({
|
|
108
|
+
* device_id: "device_id"
|
|
109
|
+
* })
|
|
96
110
|
*/
|
|
97
|
-
updateV1(request
|
|
111
|
+
updateV1(request, requestOptions) {
|
|
98
112
|
return core.HttpResponsePromise.fromPromise(this.__updateV1(request, requestOptions));
|
|
99
113
|
}
|
|
100
|
-
__updateV1() {
|
|
101
|
-
return __awaiter(this,
|
|
114
|
+
__updateV1(request, requestOptions) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
116
|
var _a, _b, _c, _d;
|
|
117
|
+
const { device_id: deviceId } = request, _body = __rest(request, ["device_id"]);
|
|
118
|
+
const _queryParams = {};
|
|
119
|
+
_queryParams["device_id"] = deviceId;
|
|
103
120
|
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);
|
|
104
121
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
105
122
|
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, "tracking/devices/update/v1"),
|
|
106
123
|
method: "POST",
|
|
107
124
|
headers: _headers,
|
|
108
125
|
contentType: "application/json",
|
|
109
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
126
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
110
127
|
requestType: "json",
|
|
111
|
-
body:
|
|
128
|
+
body: _body,
|
|
112
129
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
113
130
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
114
131
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -146,102 +163,30 @@ export class Devices {
|
|
|
146
163
|
});
|
|
147
164
|
}
|
|
148
165
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* @param {Chrt.tracking.DevicesDeleteV1Request} request
|
|
152
|
-
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
153
|
-
*
|
|
154
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
155
|
-
*
|
|
156
|
-
* @example
|
|
157
|
-
* await client.tracking.devices.deleteV1({
|
|
158
|
-
* device_id: "device_id",
|
|
159
|
-
* device_mac_address: "device_mac_address"
|
|
160
|
-
* })
|
|
161
|
-
*/
|
|
162
|
-
deleteV1(request = {}, requestOptions) {
|
|
163
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteV1(request, requestOptions));
|
|
164
|
-
}
|
|
165
|
-
__deleteV1() {
|
|
166
|
-
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
167
|
-
var _a, _b, _c, _d;
|
|
168
|
-
const { device_id: deviceId, device_mac_address: deviceMacAddress } = request;
|
|
169
|
-
const _queryParams = {};
|
|
170
|
-
if (deviceId !== undefined) {
|
|
171
|
-
_queryParams["device_id"] = deviceId;
|
|
172
|
-
}
|
|
173
|
-
if (deviceMacAddress !== undefined) {
|
|
174
|
-
_queryParams["device_mac_address"] = deviceMacAddress;
|
|
175
|
-
}
|
|
176
|
-
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);
|
|
177
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
178
|
-
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, "tracking/devices/delete/v1"),
|
|
179
|
-
method: "DELETE",
|
|
180
|
-
headers: _headers,
|
|
181
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
182
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
183
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
184
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
185
|
-
});
|
|
186
|
-
if (_response.ok) {
|
|
187
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
188
|
-
}
|
|
189
|
-
if (_response.error.reason === "status-code") {
|
|
190
|
-
switch (_response.error.statusCode) {
|
|
191
|
-
case 422:
|
|
192
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
193
|
-
default:
|
|
194
|
-
throw new errors.ChrtError({
|
|
195
|
-
statusCode: _response.error.statusCode,
|
|
196
|
-
body: _response.error.body,
|
|
197
|
-
rawResponse: _response.rawResponse,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
switch (_response.error.reason) {
|
|
202
|
-
case "non-json":
|
|
203
|
-
throw new errors.ChrtError({
|
|
204
|
-
statusCode: _response.error.statusCode,
|
|
205
|
-
body: _response.error.rawBody,
|
|
206
|
-
rawResponse: _response.rawResponse,
|
|
207
|
-
});
|
|
208
|
-
case "timeout":
|
|
209
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /tracking/devices/delete/v1.");
|
|
210
|
-
case "unknown":
|
|
211
|
-
throw new errors.ChrtError({
|
|
212
|
-
message: _response.error.errorMessage,
|
|
213
|
-
rawResponse: _response.rawResponse,
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Links a device to cargo with bidirectional references. Device must not already be linked to a session or different cargo. | () -> (bool)
|
|
166
|
+
* Archives a device by setting archived=True. Device must not have an active session — terminate it first. | () -> (bool)
|
|
220
167
|
*
|
|
221
|
-
* @param {Chrt.tracking.
|
|
168
|
+
* @param {Chrt.tracking.DevicesArchiveV1Request} request
|
|
222
169
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
223
170
|
*
|
|
224
171
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
225
172
|
*
|
|
226
173
|
* @example
|
|
227
|
-
* await client.tracking.devices.
|
|
228
|
-
*
|
|
229
|
-
* cargo_id: "cargo_id"
|
|
174
|
+
* await client.tracking.devices.archiveV1({
|
|
175
|
+
* device_id: "device_id"
|
|
230
176
|
* })
|
|
231
177
|
*/
|
|
232
|
-
|
|
233
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
178
|
+
archiveV1(request, requestOptions) {
|
|
179
|
+
return core.HttpResponsePromise.fromPromise(this.__archiveV1(request, requestOptions));
|
|
234
180
|
}
|
|
235
|
-
|
|
181
|
+
__archiveV1(request, requestOptions) {
|
|
236
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
237
183
|
var _a, _b, _c, _d;
|
|
238
|
-
const {
|
|
184
|
+
const { device_id: deviceId } = request;
|
|
239
185
|
const _queryParams = {};
|
|
240
|
-
_queryParams["
|
|
241
|
-
_queryParams["cargo_id"] = cargoId;
|
|
186
|
+
_queryParams["device_id"] = deviceId;
|
|
242
187
|
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);
|
|
243
188
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
244
|
-
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, "tracking/devices/
|
|
189
|
+
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, "tracking/devices/archive/v1"),
|
|
245
190
|
method: "POST",
|
|
246
191
|
headers: _headers,
|
|
247
192
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -272,7 +217,7 @@ export class Devices {
|
|
|
272
217
|
rawResponse: _response.rawResponse,
|
|
273
218
|
});
|
|
274
219
|
case "timeout":
|
|
275
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/
|
|
220
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/archive/v1.");
|
|
276
221
|
case "unknown":
|
|
277
222
|
throw new errors.ChrtError({
|
|
278
223
|
message: _response.error.errorMessage,
|
|
@@ -282,33 +227,33 @@ export class Devices {
|
|
|
282
227
|
});
|
|
283
228
|
}
|
|
284
229
|
/**
|
|
285
|
-
*
|
|
230
|
+
* Adds and/or removes org_ids from a device's shared_with_org_ids list. Removal overrides addition. | (DevicesUpdateSharedOrgsReq1) -> (bool)
|
|
286
231
|
*
|
|
287
|
-
* @param {Chrt.tracking.
|
|
232
|
+
* @param {Chrt.tracking.DevicesUpdateSharedOrgsReq1} request
|
|
288
233
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
289
234
|
*
|
|
290
235
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
291
236
|
*
|
|
292
237
|
* @example
|
|
293
|
-
* await client.tracking.devices.
|
|
294
|
-
*
|
|
238
|
+
* await client.tracking.devices.updateSharedOrgsV1({
|
|
239
|
+
* device_id: "device_id"
|
|
295
240
|
* })
|
|
296
241
|
*/
|
|
297
|
-
|
|
298
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
242
|
+
updateSharedOrgsV1(request, requestOptions) {
|
|
243
|
+
return core.HttpResponsePromise.fromPromise(this.__updateSharedOrgsV1(request, requestOptions));
|
|
299
244
|
}
|
|
300
|
-
|
|
245
|
+
__updateSharedOrgsV1(request, requestOptions) {
|
|
301
246
|
return __awaiter(this, void 0, void 0, function* () {
|
|
302
247
|
var _a, _b, _c, _d;
|
|
303
|
-
const { device_mac_address: deviceMacAddress } = request;
|
|
304
|
-
const _queryParams = {};
|
|
305
|
-
_queryParams["device_mac_address"] = deviceMacAddress;
|
|
306
248
|
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);
|
|
307
249
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
308
|
-
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, "tracking/devices/
|
|
250
|
+
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, "tracking/devices/update_shared_orgs/v1"),
|
|
309
251
|
method: "POST",
|
|
310
252
|
headers: _headers,
|
|
311
|
-
|
|
253
|
+
contentType: "application/json",
|
|
254
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
255
|
+
requestType: "json",
|
|
256
|
+
body: request,
|
|
312
257
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
313
258
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
314
259
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -336,7 +281,7 @@ export class Devices {
|
|
|
336
281
|
rawResponse: _response.rawResponse,
|
|
337
282
|
});
|
|
338
283
|
case "timeout":
|
|
339
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/
|
|
284
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/update_shared_orgs/v1.");
|
|
340
285
|
case "unknown":
|
|
341
286
|
throw new errors.ChrtError({
|
|
342
287
|
message: _response.error.errorMessage,
|
|
@@ -346,7 +291,7 @@ export class Devices {
|
|
|
346
291
|
});
|
|
347
292
|
}
|
|
348
293
|
/**
|
|
349
|
-
* Retrieves a single device by its
|
|
294
|
+
* Retrieves a single device by its ID with expanded sessions and cargos. Access restricted to the caller's organization or shared organizations. | authz: min_org_role=operator | () -> (DeviceExpandedRes)
|
|
350
295
|
*
|
|
351
296
|
* @param {Chrt.tracking.DevicesGetV1Request} request
|
|
352
297
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -355,27 +300,21 @@ export class Devices {
|
|
|
355
300
|
*
|
|
356
301
|
* @example
|
|
357
302
|
* await client.tracking.devices.getV1({
|
|
358
|
-
* device_mac_address: "device_mac_address",
|
|
359
303
|
* device_id: "device_id"
|
|
360
304
|
* })
|
|
361
305
|
*/
|
|
362
|
-
getV1(request
|
|
306
|
+
getV1(request, requestOptions) {
|
|
363
307
|
return core.HttpResponsePromise.fromPromise(this.__getV1(request, requestOptions));
|
|
364
308
|
}
|
|
365
|
-
__getV1() {
|
|
366
|
-
return __awaiter(this,
|
|
309
|
+
__getV1(request, requestOptions) {
|
|
310
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
367
311
|
var _a, _b, _c, _d;
|
|
368
|
-
const {
|
|
312
|
+
const { device_id: deviceId } = request;
|
|
369
313
|
const _queryParams = {};
|
|
370
|
-
|
|
371
|
-
_queryParams["device_mac_address"] = deviceMacAddress;
|
|
372
|
-
}
|
|
373
|
-
if (deviceId !== undefined) {
|
|
374
|
-
_queryParams["device_id"] = deviceId;
|
|
375
|
-
}
|
|
314
|
+
_queryParams["device_id"] = deviceId;
|
|
376
315
|
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);
|
|
377
316
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
378
|
-
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, "tracking/devices/v1"),
|
|
317
|
+
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, "tracking/devices/get/v1"),
|
|
379
318
|
method: "GET",
|
|
380
319
|
headers: _headers,
|
|
381
320
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -406,7 +345,7 @@ export class Devices {
|
|
|
406
345
|
rawResponse: _response.rawResponse,
|
|
407
346
|
});
|
|
408
347
|
case "timeout":
|
|
409
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/v1.");
|
|
348
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/get/v1.");
|
|
410
349
|
case "unknown":
|
|
411
350
|
throw new errors.ChrtError({
|
|
412
351
|
message: _response.error.errorMessage,
|
|
@@ -416,7 +355,7 @@ export class Devices {
|
|
|
416
355
|
});
|
|
417
356
|
}
|
|
418
357
|
/**
|
|
419
|
-
* Lists devices with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
358
|
+
* Lists devices with filtering, sorting, and pagination. Use org_scope to restrict to owned, shared, or both (default). | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
420
359
|
*
|
|
421
360
|
* @param {Chrt.tracking.DevicesListV1Request} request
|
|
422
361
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -429,11 +368,11 @@ export class Devices {
|
|
|
429
368
|
* sort_order: "asc",
|
|
430
369
|
* page: 1,
|
|
431
370
|
* page_size: 1,
|
|
432
|
-
*
|
|
433
|
-
*
|
|
371
|
+
* org_scope: "owned",
|
|
372
|
+
* filter_off_chrt_reference_id: "filter_off_chrt_reference_id",
|
|
434
373
|
* filter_type: "D15N-tag",
|
|
435
|
-
*
|
|
436
|
-
*
|
|
374
|
+
* filter_active_cargo_id: "filter_active_cargo_id",
|
|
375
|
+
* filter_active_session_id: "filter_active_session_id",
|
|
437
376
|
* filter_registered_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
438
377
|
* filter_registered_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
439
378
|
* filter_last_seen_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
@@ -446,7 +385,7 @@ export class Devices {
|
|
|
446
385
|
__listV1() {
|
|
447
386
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
448
387
|
var _a, _b, _c, _d, _e, _f;
|
|
449
|
-
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize,
|
|
388
|
+
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, org_scope: orgScope, filter_off_chrt_reference_id: filterOffChrtReferenceId, filter_type: filterType, filter_active_cargo_id: filterActiveCargoId, filter_active_session_id: filterActiveSessionId, 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
389
|
const _queryParams = {};
|
|
451
390
|
if (sortBy !== undefined) {
|
|
452
391
|
_queryParams["sort_by"] = sortBy;
|
|
@@ -460,20 +399,20 @@ export class Devices {
|
|
|
460
399
|
if (pageSize !== undefined) {
|
|
461
400
|
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
462
401
|
}
|
|
463
|
-
if (
|
|
464
|
-
_queryParams["
|
|
402
|
+
if (orgScope !== undefined) {
|
|
403
|
+
_queryParams["org_scope"] = orgScope;
|
|
465
404
|
}
|
|
466
|
-
if (
|
|
467
|
-
_queryParams["
|
|
405
|
+
if (filterOffChrtReferenceId !== undefined) {
|
|
406
|
+
_queryParams["filter_off_chrt_reference_id"] = filterOffChrtReferenceId;
|
|
468
407
|
}
|
|
469
408
|
if (filterType !== undefined) {
|
|
470
409
|
_queryParams["filter_type"] = filterType;
|
|
471
410
|
}
|
|
472
|
-
if (
|
|
473
|
-
_queryParams["
|
|
411
|
+
if (filterActiveCargoId !== undefined) {
|
|
412
|
+
_queryParams["filter_active_cargo_id"] = filterActiveCargoId;
|
|
474
413
|
}
|
|
475
|
-
if (
|
|
476
|
-
_queryParams["
|
|
414
|
+
if (filterActiveSessionId !== undefined) {
|
|
415
|
+
_queryParams["filter_active_session_id"] = filterActiveSessionId;
|
|
477
416
|
}
|
|
478
417
|
if (filterRegisteredAtTimestampGte !== undefined) {
|
|
479
418
|
_queryParams["filter_registered_at_timestamp_gte"] = filterRegisteredAtTimestampGte;
|
|
@@ -530,34 +469,38 @@ export class Devices {
|
|
|
530
469
|
});
|
|
531
470
|
}
|
|
532
471
|
/**
|
|
533
|
-
* Returns distinct
|
|
472
|
+
* Returns distinct device_mac_address and off_chrt_reference_id values matching the query via case-insensitive regex, searching devices. Use org_scope to restrict to owned, shared, or both (default). | authz: min_org_role=operator | () -> (list[TrackingTypeaheadResult])
|
|
534
473
|
*
|
|
535
|
-
* @param {Chrt.tracking.
|
|
474
|
+
* @param {Chrt.tracking.DevicesTypeaheadV1Request} request
|
|
536
475
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
537
476
|
*
|
|
538
477
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
539
478
|
*
|
|
540
479
|
* @example
|
|
541
|
-
* await client.tracking.devices.
|
|
480
|
+
* await client.tracking.devices.typeaheadV1({
|
|
542
481
|
* query: "query",
|
|
543
|
-
* limit: 1
|
|
482
|
+
* limit: 1,
|
|
483
|
+
* org_scope: "owned"
|
|
544
484
|
* })
|
|
545
485
|
*/
|
|
546
|
-
|
|
547
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
486
|
+
typeaheadV1(request, requestOptions) {
|
|
487
|
+
return core.HttpResponsePromise.fromPromise(this.__typeaheadV1(request, requestOptions));
|
|
548
488
|
}
|
|
549
|
-
|
|
489
|
+
__typeaheadV1(request, requestOptions) {
|
|
550
490
|
return __awaiter(this, void 0, void 0, function* () {
|
|
551
491
|
var _a, _b, _c, _d, _e;
|
|
552
|
-
const { query, limit } = request;
|
|
492
|
+
const { query, limit, org_scope: orgScope } = request;
|
|
553
493
|
const _queryParams = {};
|
|
554
494
|
_queryParams["query"] = query;
|
|
555
495
|
if (limit !== undefined) {
|
|
556
496
|
_queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
|
|
557
497
|
}
|
|
498
|
+
if (orgScope !== undefined) {
|
|
499
|
+
_queryParams["org_scope"] = orgScope;
|
|
500
|
+
}
|
|
558
501
|
let _headers = mergeHeaders((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
559
502
|
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
560
|
-
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ChrtEnvironment.Local, "tracking/devices/typeahead/
|
|
503
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ChrtEnvironment.Local, "tracking/devices/typeahead/v1"),
|
|
561
504
|
method: "GET",
|
|
562
505
|
headers: _headers,
|
|
563
506
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -588,7 +531,7 @@ export class Devices {
|
|
|
588
531
|
rawResponse: _response.rawResponse,
|
|
589
532
|
});
|
|
590
533
|
case "timeout":
|
|
591
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/typeahead/
|
|
534
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/typeahead/v1.");
|
|
592
535
|
case "unknown":
|
|
593
536
|
throw new errors.ChrtError({
|
|
594
537
|
message: _response.error.errorMessage,
|
|
@@ -598,7 +541,7 @@ export class Devices {
|
|
|
598
541
|
});
|
|
599
542
|
}
|
|
600
543
|
/**
|
|
601
|
-
*
|
|
544
|
+
* Search across device device_mac_address, comments, and off_chrt_reference_id. Handles both partial (typing) and full query submission. Use org_scope to restrict to owned, shared, or both (default). | authz: min_org_role=operator | () -> (DeviceSearchRes)
|
|
602
545
|
*
|
|
603
546
|
* @param {Chrt.tracking.DevicesSearchV1Request} request
|
|
604
547
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -609,7 +552,8 @@ export class Devices {
|
|
|
609
552
|
* await client.tracking.devices.searchV1({
|
|
610
553
|
* query: "query",
|
|
611
554
|
* page: 1,
|
|
612
|
-
* page_size: 1
|
|
555
|
+
* page_size: 1,
|
|
556
|
+
* org_scope: "owned"
|
|
613
557
|
* })
|
|
614
558
|
*/
|
|
615
559
|
searchV1(request, requestOptions) {
|
|
@@ -618,7 +562,7 @@ export class Devices {
|
|
|
618
562
|
__searchV1(request, requestOptions) {
|
|
619
563
|
return __awaiter(this, void 0, void 0, function* () {
|
|
620
564
|
var _a, _b, _c, _d, _e, _f;
|
|
621
|
-
const { query, page, page_size: pageSize } = request;
|
|
565
|
+
const { query, page, page_size: pageSize, org_scope: orgScope } = request;
|
|
622
566
|
const _queryParams = {};
|
|
623
567
|
_queryParams["query"] = query;
|
|
624
568
|
if (page !== undefined) {
|
|
@@ -627,6 +571,9 @@ export class Devices {
|
|
|
627
571
|
if (pageSize !== undefined) {
|
|
628
572
|
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
629
573
|
}
|
|
574
|
+
if (orgScope !== undefined) {
|
|
575
|
+
_queryParams["org_scope"] = orgScope;
|
|
576
|
+
}
|
|
630
577
|
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);
|
|
631
578
|
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
632
579
|
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/search/v1"),
|
|
@@ -5,12 +5,14 @@ import * as Chrt from "../../../../../../index.mjs";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
+
* schema_version: 1,
|
|
8
9
|
* device_mac_address: "device_mac_address"
|
|
9
10
|
* }
|
|
10
11
|
*/
|
|
11
|
-
export interface
|
|
12
|
+
export interface DeviceClientCreate1 {
|
|
13
|
+
schema_version: number;
|
|
12
14
|
device_mac_address: string;
|
|
13
15
|
type?: Chrt.TrackingDeviceTypeEnum1 | null;
|
|
14
16
|
comments?: string | null;
|
|
15
|
-
|
|
17
|
+
off_chrt_reference_id?: string | null;
|
|
16
18
|
}
|
package/dist/esm/api/resources/tracking/resources/devices/client/requests/DeviceClientUpdate1.d.mts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
* device_id: "device_id"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface DeviceClientUpdate1 {
|
|
12
|
+
device_id: string;
|
|
13
|
+
type?: Chrt.TrackingDeviceTypeEnum1 | null;
|
|
14
|
+
comments?: string | null;
|
|
15
|
+
off_chrt_reference_id?: string | null;
|
|
16
|
+
type__set_to_None?: boolean;
|
|
17
|
+
comments__set_to_None?: boolean;
|
|
18
|
+
off_chrt_reference_id__set_to_None?: boolean;
|
|
19
|
+
}
|
package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesListV1Request.d.mts
CHANGED
|
@@ -9,11 +9,11 @@ import * as Chrt from "../../../../../../index.mjs";
|
|
|
9
9
|
* sort_order: "asc",
|
|
10
10
|
* page: 1,
|
|
11
11
|
* page_size: 1,
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* org_scope: "owned",
|
|
13
|
+
* filter_off_chrt_reference_id: "filter_off_chrt_reference_id",
|
|
14
14
|
* filter_type: "D15N-tag",
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* filter_active_cargo_id: "filter_active_cargo_id",
|
|
16
|
+
* filter_active_session_id: "filter_active_session_id",
|
|
17
17
|
* filter_registered_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
18
18
|
* filter_registered_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
19
19
|
* filter_last_seen_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
@@ -27,16 +27,16 @@ export interface DevicesListV1Request {
|
|
|
27
27
|
sort_order?: Chrt.SortOrderEnum | null;
|
|
28
28
|
page?: number | null;
|
|
29
29
|
page_size?: number | null;
|
|
30
|
-
/** Filter by
|
|
31
|
-
|
|
32
|
-
/** Filter by
|
|
33
|
-
|
|
30
|
+
/** Filter by org ownership: owned, shared, or owned_and_shared */
|
|
31
|
+
org_scope?: Chrt.TrackingOrgScopeEnum | null;
|
|
32
|
+
/** Filter by off-CHRT reference ID (exact match) */
|
|
33
|
+
filter_off_chrt_reference_id?: string | null;
|
|
34
34
|
/** Filter by device type */
|
|
35
35
|
filter_type?: Chrt.TrackingDeviceTypeEnum1 | null;
|
|
36
|
-
/** Filter by
|
|
37
|
-
|
|
38
|
-
/** Filter by
|
|
39
|
-
|
|
36
|
+
/** Filter by active cargo ID */
|
|
37
|
+
filter_active_cargo_id?: string | null;
|
|
38
|
+
/** Filter by active session ID */
|
|
39
|
+
filter_active_session_id?: string | null;
|
|
40
40
|
/** Filter by registered_at_timestamp >= value */
|
|
41
41
|
filter_registered_at_timestamp_gte?: string | null;
|
|
42
42
|
/** Filter by registered_at_timestamp <= value */
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Chrt from "../../../../../../index.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {
|
|
7
8
|
* query: "query",
|
|
8
9
|
* page: 1,
|
|
9
|
-
* page_size: 1
|
|
10
|
+
* page_size: 1,
|
|
11
|
+
* org_scope: "owned"
|
|
10
12
|
* }
|
|
11
13
|
*/
|
|
12
14
|
export interface DevicesSearchV1Request {
|
|
13
|
-
/**
|
|
15
|
+
/** Search query */
|
|
14
16
|
query: string;
|
|
15
17
|
page?: number | null;
|
|
16
18
|
page_size?: number | null;
|
|
19
|
+
/** Filter by org ownership: owned, shared, or owned_and_shared */
|
|
20
|
+
org_scope?: Chrt.TrackingOrgScopeEnum | null;
|
|
17
21
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
* query: "query",
|
|
9
|
+
* limit: 1,
|
|
10
|
+
* org_scope: "owned"
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export interface DevicesTypeaheadV1Request {
|
|
14
|
+
/** Typeahead search query */
|
|
15
|
+
query: string;
|
|
16
|
+
/** Max results per field */
|
|
17
|
+
limit?: number | null;
|
|
18
|
+
/** Filter by org ownership: owned, shared, or owned_and_shared */
|
|
19
|
+
org_scope?: Chrt.TrackingOrgScopeEnum | null;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* device_id: "device_id"
|
|
8
|
+
* }
|
|
9
|
+
*/
|
|
10
|
+
export interface DevicesUpdateSharedOrgsReq1 {
|
|
11
|
+
device_id: string;
|
|
12
|
+
add_org_ids?: string[];
|
|
13
|
+
remove_org_ids?: string[];
|
|
14
|
+
}
|