@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
|
@@ -44,6 +44,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
|
+
var t = {};
|
|
49
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
50
|
+
t[p] = s[p];
|
|
51
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
52
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
53
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
54
|
+
t[p[i]] = s[p[i]];
|
|
55
|
+
}
|
|
56
|
+
return t;
|
|
57
|
+
};
|
|
47
58
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
59
|
exports.Devices = void 0;
|
|
49
60
|
const environments = __importStar(require("../../../../../../environments.js"));
|
|
@@ -56,15 +67,16 @@ class Devices {
|
|
|
56
67
|
this._options = _options;
|
|
57
68
|
}
|
|
58
69
|
/**
|
|
59
|
-
* Registers a tracking device to the caller's organization. If device is already registered to a different organization,
|
|
70
|
+
* Registers a tracking device to the caller's organization. If the device is already registered to a different organization, returns 409 Conflict. | (DeviceClientCreate1) -> (PydanticObjectId)
|
|
60
71
|
*
|
|
61
|
-
* @param {Chrt.tracking.
|
|
72
|
+
* @param {Chrt.tracking.DeviceClientCreate1} request
|
|
62
73
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
74
|
*
|
|
64
75
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
65
76
|
*
|
|
66
77
|
* @example
|
|
67
78
|
* await client.tracking.devices.registerToOrgV1({
|
|
79
|
+
* schema_version: 1,
|
|
68
80
|
* device_mac_address: "device_mac_address"
|
|
69
81
|
* })
|
|
70
82
|
*/
|
|
@@ -120,31 +132,36 @@ class Devices {
|
|
|
120
132
|
});
|
|
121
133
|
}
|
|
122
134
|
/**
|
|
123
|
-
* Updates a device's type, comments, and/or
|
|
135
|
+
* Updates a device's type, comments, and/or off_chrt_reference_id. Use __set_to_None flags to explicitly clear Optional fields. | (DeviceClientUpdate1) -> (bool)
|
|
124
136
|
*
|
|
125
|
-
* @param {Chrt.tracking.
|
|
137
|
+
* @param {Chrt.tracking.DeviceClientUpdate1} request
|
|
126
138
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
127
139
|
*
|
|
128
140
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
129
141
|
*
|
|
130
142
|
* @example
|
|
131
|
-
* await client.tracking.devices.updateV1(
|
|
143
|
+
* await client.tracking.devices.updateV1({
|
|
144
|
+
* device_id: "device_id"
|
|
145
|
+
* })
|
|
132
146
|
*/
|
|
133
|
-
updateV1(request
|
|
147
|
+
updateV1(request, requestOptions) {
|
|
134
148
|
return core.HttpResponsePromise.fromPromise(this.__updateV1(request, requestOptions));
|
|
135
149
|
}
|
|
136
|
-
__updateV1() {
|
|
137
|
-
return __awaiter(this,
|
|
150
|
+
__updateV1(request, requestOptions) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
138
152
|
var _a, _b, _c, _d;
|
|
153
|
+
const { device_id: deviceId } = request, _body = __rest(request, ["device_id"]);
|
|
154
|
+
const _queryParams = {};
|
|
155
|
+
_queryParams["device_id"] = deviceId;
|
|
139
156
|
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
140
157
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
141
158
|
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"),
|
|
142
159
|
method: "POST",
|
|
143
160
|
headers: _headers,
|
|
144
161
|
contentType: "application/json",
|
|
145
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
162
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
146
163
|
requestType: "json",
|
|
147
|
-
body:
|
|
164
|
+
body: _body,
|
|
148
165
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
149
166
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
150
167
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -182,102 +199,30 @@ class Devices {
|
|
|
182
199
|
});
|
|
183
200
|
}
|
|
184
201
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* @param {Chrt.tracking.DevicesDeleteV1Request} request
|
|
188
|
-
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
189
|
-
*
|
|
190
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
191
|
-
*
|
|
192
|
-
* @example
|
|
193
|
-
* await client.tracking.devices.deleteV1({
|
|
194
|
-
* device_id: "device_id",
|
|
195
|
-
* device_mac_address: "device_mac_address"
|
|
196
|
-
* })
|
|
197
|
-
*/
|
|
198
|
-
deleteV1(request = {}, requestOptions) {
|
|
199
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteV1(request, requestOptions));
|
|
200
|
-
}
|
|
201
|
-
__deleteV1() {
|
|
202
|
-
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
203
|
-
var _a, _b, _c, _d;
|
|
204
|
-
const { device_id: deviceId, device_mac_address: deviceMacAddress } = request;
|
|
205
|
-
const _queryParams = {};
|
|
206
|
-
if (deviceId !== undefined) {
|
|
207
|
-
_queryParams["device_id"] = deviceId;
|
|
208
|
-
}
|
|
209
|
-
if (deviceMacAddress !== undefined) {
|
|
210
|
-
_queryParams["device_mac_address"] = deviceMacAddress;
|
|
211
|
-
}
|
|
212
|
-
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
213
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
214
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "tracking/devices/delete/v1"),
|
|
215
|
-
method: "DELETE",
|
|
216
|
-
headers: _headers,
|
|
217
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
218
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
219
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
220
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
221
|
-
});
|
|
222
|
-
if (_response.ok) {
|
|
223
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
224
|
-
}
|
|
225
|
-
if (_response.error.reason === "status-code") {
|
|
226
|
-
switch (_response.error.statusCode) {
|
|
227
|
-
case 422:
|
|
228
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
229
|
-
default:
|
|
230
|
-
throw new errors.ChrtError({
|
|
231
|
-
statusCode: _response.error.statusCode,
|
|
232
|
-
body: _response.error.body,
|
|
233
|
-
rawResponse: _response.rawResponse,
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
switch (_response.error.reason) {
|
|
238
|
-
case "non-json":
|
|
239
|
-
throw new errors.ChrtError({
|
|
240
|
-
statusCode: _response.error.statusCode,
|
|
241
|
-
body: _response.error.rawBody,
|
|
242
|
-
rawResponse: _response.rawResponse,
|
|
243
|
-
});
|
|
244
|
-
case "timeout":
|
|
245
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /tracking/devices/delete/v1.");
|
|
246
|
-
case "unknown":
|
|
247
|
-
throw new errors.ChrtError({
|
|
248
|
-
message: _response.error.errorMessage,
|
|
249
|
-
rawResponse: _response.rawResponse,
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Links a device to cargo with bidirectional references. Device must not already be linked to a session or different cargo. | () -> (bool)
|
|
202
|
+
* Archives a device by setting archived=True. Device must not have an active session — terminate it first. | () -> (bool)
|
|
256
203
|
*
|
|
257
|
-
* @param {Chrt.tracking.
|
|
204
|
+
* @param {Chrt.tracking.DevicesArchiveV1Request} request
|
|
258
205
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
259
206
|
*
|
|
260
207
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
261
208
|
*
|
|
262
209
|
* @example
|
|
263
|
-
* await client.tracking.devices.
|
|
264
|
-
*
|
|
265
|
-
* cargo_id: "cargo_id"
|
|
210
|
+
* await client.tracking.devices.archiveV1({
|
|
211
|
+
* device_id: "device_id"
|
|
266
212
|
* })
|
|
267
213
|
*/
|
|
268
|
-
|
|
269
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
214
|
+
archiveV1(request, requestOptions) {
|
|
215
|
+
return core.HttpResponsePromise.fromPromise(this.__archiveV1(request, requestOptions));
|
|
270
216
|
}
|
|
271
|
-
|
|
217
|
+
__archiveV1(request, requestOptions) {
|
|
272
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
273
219
|
var _a, _b, _c, _d;
|
|
274
|
-
const {
|
|
220
|
+
const { device_id: deviceId } = request;
|
|
275
221
|
const _queryParams = {};
|
|
276
|
-
_queryParams["
|
|
277
|
-
_queryParams["cargo_id"] = cargoId;
|
|
222
|
+
_queryParams["device_id"] = deviceId;
|
|
278
223
|
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
279
224
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
280
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "tracking/devices/
|
|
225
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "tracking/devices/archive/v1"),
|
|
281
226
|
method: "POST",
|
|
282
227
|
headers: _headers,
|
|
283
228
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -308,7 +253,7 @@ class Devices {
|
|
|
308
253
|
rawResponse: _response.rawResponse,
|
|
309
254
|
});
|
|
310
255
|
case "timeout":
|
|
311
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/
|
|
256
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/archive/v1.");
|
|
312
257
|
case "unknown":
|
|
313
258
|
throw new errors.ChrtError({
|
|
314
259
|
message: _response.error.errorMessage,
|
|
@@ -318,33 +263,33 @@ class Devices {
|
|
|
318
263
|
});
|
|
319
264
|
}
|
|
320
265
|
/**
|
|
321
|
-
*
|
|
266
|
+
* Adds and/or removes org_ids from a device's shared_with_org_ids list. Removal overrides addition. | (DevicesUpdateSharedOrgsReq1) -> (bool)
|
|
322
267
|
*
|
|
323
|
-
* @param {Chrt.tracking.
|
|
268
|
+
* @param {Chrt.tracking.DevicesUpdateSharedOrgsReq1} request
|
|
324
269
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
325
270
|
*
|
|
326
271
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
327
272
|
*
|
|
328
273
|
* @example
|
|
329
|
-
* await client.tracking.devices.
|
|
330
|
-
*
|
|
274
|
+
* await client.tracking.devices.updateSharedOrgsV1({
|
|
275
|
+
* device_id: "device_id"
|
|
331
276
|
* })
|
|
332
277
|
*/
|
|
333
|
-
|
|
334
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
278
|
+
updateSharedOrgsV1(request, requestOptions) {
|
|
279
|
+
return core.HttpResponsePromise.fromPromise(this.__updateSharedOrgsV1(request, requestOptions));
|
|
335
280
|
}
|
|
336
|
-
|
|
281
|
+
__updateSharedOrgsV1(request, requestOptions) {
|
|
337
282
|
return __awaiter(this, void 0, void 0, function* () {
|
|
338
283
|
var _a, _b, _c, _d;
|
|
339
|
-
const { device_mac_address: deviceMacAddress } = request;
|
|
340
|
-
const _queryParams = {};
|
|
341
|
-
_queryParams["device_mac_address"] = deviceMacAddress;
|
|
342
284
|
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
343
285
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
344
|
-
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/
|
|
286
|
+
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"),
|
|
345
287
|
method: "POST",
|
|
346
288
|
headers: _headers,
|
|
347
|
-
|
|
289
|
+
contentType: "application/json",
|
|
290
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
291
|
+
requestType: "json",
|
|
292
|
+
body: request,
|
|
348
293
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
349
294
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
350
295
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -372,7 +317,7 @@ class Devices {
|
|
|
372
317
|
rawResponse: _response.rawResponse,
|
|
373
318
|
});
|
|
374
319
|
case "timeout":
|
|
375
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/
|
|
320
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/update_shared_orgs/v1.");
|
|
376
321
|
case "unknown":
|
|
377
322
|
throw new errors.ChrtError({
|
|
378
323
|
message: _response.error.errorMessage,
|
|
@@ -382,7 +327,7 @@ class Devices {
|
|
|
382
327
|
});
|
|
383
328
|
}
|
|
384
329
|
/**
|
|
385
|
-
* Retrieves a single device by its
|
|
330
|
+
* 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)
|
|
386
331
|
*
|
|
387
332
|
* @param {Chrt.tracking.DevicesGetV1Request} request
|
|
388
333
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -391,27 +336,21 @@ class Devices {
|
|
|
391
336
|
*
|
|
392
337
|
* @example
|
|
393
338
|
* await client.tracking.devices.getV1({
|
|
394
|
-
* device_mac_address: "device_mac_address",
|
|
395
339
|
* device_id: "device_id"
|
|
396
340
|
* })
|
|
397
341
|
*/
|
|
398
|
-
getV1(request
|
|
342
|
+
getV1(request, requestOptions) {
|
|
399
343
|
return core.HttpResponsePromise.fromPromise(this.__getV1(request, requestOptions));
|
|
400
344
|
}
|
|
401
|
-
__getV1() {
|
|
402
|
-
return __awaiter(this,
|
|
345
|
+
__getV1(request, requestOptions) {
|
|
346
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
403
347
|
var _a, _b, _c, _d;
|
|
404
|
-
const {
|
|
348
|
+
const { device_id: deviceId } = request;
|
|
405
349
|
const _queryParams = {};
|
|
406
|
-
|
|
407
|
-
_queryParams["device_mac_address"] = deviceMacAddress;
|
|
408
|
-
}
|
|
409
|
-
if (deviceId !== undefined) {
|
|
410
|
-
_queryParams["device_id"] = deviceId;
|
|
411
|
-
}
|
|
350
|
+
_queryParams["device_id"] = deviceId;
|
|
412
351
|
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
413
352
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
414
|
-
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"),
|
|
353
|
+
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"),
|
|
415
354
|
method: "GET",
|
|
416
355
|
headers: _headers,
|
|
417
356
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -442,7 +381,7 @@ class Devices {
|
|
|
442
381
|
rawResponse: _response.rawResponse,
|
|
443
382
|
});
|
|
444
383
|
case "timeout":
|
|
445
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/v1.");
|
|
384
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/get/v1.");
|
|
446
385
|
case "unknown":
|
|
447
386
|
throw new errors.ChrtError({
|
|
448
387
|
message: _response.error.errorMessage,
|
|
@@ -452,7 +391,7 @@ class Devices {
|
|
|
452
391
|
});
|
|
453
392
|
}
|
|
454
393
|
/**
|
|
455
|
-
* Lists devices with filtering, sorting, and pagination. | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
394
|
+
* Lists devices with filtering, sorting, and pagination. Use org_scope to restrict to owned, shared, or both (default). | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
456
395
|
*
|
|
457
396
|
* @param {Chrt.tracking.DevicesListV1Request} request
|
|
458
397
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -465,11 +404,11 @@ class Devices {
|
|
|
465
404
|
* sort_order: "asc",
|
|
466
405
|
* page: 1,
|
|
467
406
|
* page_size: 1,
|
|
468
|
-
*
|
|
469
|
-
*
|
|
407
|
+
* org_scope: "owned",
|
|
408
|
+
* filter_off_chrt_reference_id: "filter_off_chrt_reference_id",
|
|
470
409
|
* filter_type: "D15N-tag",
|
|
471
|
-
*
|
|
472
|
-
*
|
|
410
|
+
* filter_active_cargo_id: "filter_active_cargo_id",
|
|
411
|
+
* filter_active_session_id: "filter_active_session_id",
|
|
473
412
|
* filter_registered_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
474
413
|
* filter_registered_at_timestamp_lte: "2024-01-15T09:30:00Z",
|
|
475
414
|
* filter_last_seen_at_timestamp_gte: "2024-01-15T09:30:00Z",
|
|
@@ -482,7 +421,7 @@ class Devices {
|
|
|
482
421
|
__listV1() {
|
|
483
422
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
484
423
|
var _a, _b, _c, _d, _e, _f;
|
|
485
|
-
const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize,
|
|
424
|
+
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;
|
|
486
425
|
const _queryParams = {};
|
|
487
426
|
if (sortBy !== undefined) {
|
|
488
427
|
_queryParams["sort_by"] = sortBy;
|
|
@@ -496,20 +435,20 @@ class Devices {
|
|
|
496
435
|
if (pageSize !== undefined) {
|
|
497
436
|
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
498
437
|
}
|
|
499
|
-
if (
|
|
500
|
-
_queryParams["
|
|
438
|
+
if (orgScope !== undefined) {
|
|
439
|
+
_queryParams["org_scope"] = orgScope;
|
|
501
440
|
}
|
|
502
|
-
if (
|
|
503
|
-
_queryParams["
|
|
441
|
+
if (filterOffChrtReferenceId !== undefined) {
|
|
442
|
+
_queryParams["filter_off_chrt_reference_id"] = filterOffChrtReferenceId;
|
|
504
443
|
}
|
|
505
444
|
if (filterType !== undefined) {
|
|
506
445
|
_queryParams["filter_type"] = filterType;
|
|
507
446
|
}
|
|
508
|
-
if (
|
|
509
|
-
_queryParams["
|
|
447
|
+
if (filterActiveCargoId !== undefined) {
|
|
448
|
+
_queryParams["filter_active_cargo_id"] = filterActiveCargoId;
|
|
510
449
|
}
|
|
511
|
-
if (
|
|
512
|
-
_queryParams["
|
|
450
|
+
if (filterActiveSessionId !== undefined) {
|
|
451
|
+
_queryParams["filter_active_session_id"] = filterActiveSessionId;
|
|
513
452
|
}
|
|
514
453
|
if (filterRegisteredAtTimestampGte !== undefined) {
|
|
515
454
|
_queryParams["filter_registered_at_timestamp_gte"] = filterRegisteredAtTimestampGte;
|
|
@@ -566,34 +505,38 @@ class Devices {
|
|
|
566
505
|
});
|
|
567
506
|
}
|
|
568
507
|
/**
|
|
569
|
-
* Returns distinct
|
|
508
|
+
* 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])
|
|
570
509
|
*
|
|
571
|
-
* @param {Chrt.tracking.
|
|
510
|
+
* @param {Chrt.tracking.DevicesTypeaheadV1Request} request
|
|
572
511
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
573
512
|
*
|
|
574
513
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
575
514
|
*
|
|
576
515
|
* @example
|
|
577
|
-
* await client.tracking.devices.
|
|
516
|
+
* await client.tracking.devices.typeaheadV1({
|
|
578
517
|
* query: "query",
|
|
579
|
-
* limit: 1
|
|
518
|
+
* limit: 1,
|
|
519
|
+
* org_scope: "owned"
|
|
580
520
|
* })
|
|
581
521
|
*/
|
|
582
|
-
|
|
583
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
522
|
+
typeaheadV1(request, requestOptions) {
|
|
523
|
+
return core.HttpResponsePromise.fromPromise(this.__typeaheadV1(request, requestOptions));
|
|
584
524
|
}
|
|
585
|
-
|
|
525
|
+
__typeaheadV1(request, requestOptions) {
|
|
586
526
|
return __awaiter(this, void 0, void 0, function* () {
|
|
587
527
|
var _a, _b, _c, _d, _e;
|
|
588
|
-
const { query, limit } = request;
|
|
528
|
+
const { query, limit, org_scope: orgScope } = request;
|
|
589
529
|
const _queryParams = {};
|
|
590
530
|
_queryParams["query"] = query;
|
|
591
531
|
if (limit !== undefined) {
|
|
592
532
|
_queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
|
|
593
533
|
}
|
|
534
|
+
if (orgScope !== undefined) {
|
|
535
|
+
_queryParams["org_scope"] = orgScope;
|
|
536
|
+
}
|
|
594
537
|
let _headers = (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
595
538
|
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
596
|
-
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/
|
|
539
|
+
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"),
|
|
597
540
|
method: "GET",
|
|
598
541
|
headers: _headers,
|
|
599
542
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
@@ -624,7 +567,7 @@ class Devices {
|
|
|
624
567
|
rawResponse: _response.rawResponse,
|
|
625
568
|
});
|
|
626
569
|
case "timeout":
|
|
627
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/typeahead/
|
|
570
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/typeahead/v1.");
|
|
628
571
|
case "unknown":
|
|
629
572
|
throw new errors.ChrtError({
|
|
630
573
|
message: _response.error.errorMessage,
|
|
@@ -634,7 +577,7 @@ class Devices {
|
|
|
634
577
|
});
|
|
635
578
|
}
|
|
636
579
|
/**
|
|
637
|
-
*
|
|
580
|
+
* 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)
|
|
638
581
|
*
|
|
639
582
|
* @param {Chrt.tracking.DevicesSearchV1Request} request
|
|
640
583
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -645,7 +588,8 @@ class Devices {
|
|
|
645
588
|
* await client.tracking.devices.searchV1({
|
|
646
589
|
* query: "query",
|
|
647
590
|
* page: 1,
|
|
648
|
-
* page_size: 1
|
|
591
|
+
* page_size: 1,
|
|
592
|
+
* org_scope: "owned"
|
|
649
593
|
* })
|
|
650
594
|
*/
|
|
651
595
|
searchV1(request, requestOptions) {
|
|
@@ -654,7 +598,7 @@ class Devices {
|
|
|
654
598
|
__searchV1(request, requestOptions) {
|
|
655
599
|
return __awaiter(this, void 0, void 0, function* () {
|
|
656
600
|
var _a, _b, _c, _d, _e, _f;
|
|
657
|
-
const { query, page, page_size: pageSize } = request;
|
|
601
|
+
const { query, page, page_size: pageSize, org_scope: orgScope } = request;
|
|
658
602
|
const _queryParams = {};
|
|
659
603
|
_queryParams["query"] = query;
|
|
660
604
|
if (page !== undefined) {
|
|
@@ -663,6 +607,9 @@ class Devices {
|
|
|
663
607
|
if (pageSize !== undefined) {
|
|
664
608
|
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
665
609
|
}
|
|
610
|
+
if (orgScope !== undefined) {
|
|
611
|
+
_queryParams["org_scope"] = orgScope;
|
|
612
|
+
}
|
|
666
613
|
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);
|
|
667
614
|
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
668
615
|
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.js";
|
|
|
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/cjs/api/resources/tracking/resources/devices/client/requests/DeviceClientUpdate1.d.ts
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.js";
|
|
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/cjs/api/resources/tracking/resources/devices/client/requests/DevicesListV1Request.d.ts
CHANGED
|
@@ -9,11 +9,11 @@ import * as Chrt from "../../../../../../index.js";
|
|
|
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.js";
|
|
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.js";
|
|
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
|
+
}
|