@chrt-inc/typescript-sdk 1.1019.0 → 1.1023.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/tracking/resources/devices/client/Client.d.ts +47 -1
- package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +195 -1
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.d.ts +12 -0
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.js +5 -0
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.d.ts +14 -0
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.js +5 -0
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.d.ts +12 -0
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.js +5 -0
- package/dist/cjs/api/resources/tracking/resources/devices/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/types/CargoAiFwbAndFhlDimension1.d.ts +2 -10
- package/dist/cjs/api/types/CargoAiFwbAndFhlDimension1.js +0 -10
- package/dist/cjs/api/types/CargoAiFwbAndFhlDimensionUomEnum1.d.ts +8 -0
- package/dist/cjs/api/types/CargoAiFwbAndFhlDimensionUomEnum1.js +10 -0
- package/dist/cjs/api/types/CargoAiFwbAndFhlWeightOrVolume1.d.ts +2 -10
- package/dist/cjs/api/types/CargoAiFwbAndFhlWeightOrVolume1.js +0 -10
- package/dist/cjs/api/types/CargoAiFwbAndFhlWeightOrVolumeUomEnum1.d.ts +10 -0
- package/dist/cjs/api/types/CargoAiFwbAndFhlWeightOrVolumeUomEnum1.js +12 -0
- package/dist/cjs/api/types/DeviceForCargoRes.d.ts +17 -0
- package/dist/cjs/api/types/DeviceForCargoRes.js +5 -0
- package/dist/cjs/api/types/ShippingTaskAddedWebhookPayload.d.ts +2 -0
- package/dist/cjs/api/types/ShippingTaskAttemptedWebhookPayload.d.ts +2 -0
- package/dist/cjs/api/types/ShippingTaskCompletedWebhookPayload.d.ts +2 -0
- package/dist/cjs/api/types/ShippingTaskDeletedWebhookPayload.d.ts +2 -0
- package/dist/cjs/api/types/ShippingTaskExecutorOrgNoteAddedWebhookPayload.d.ts +2 -0
- package/dist/cjs/api/types/ShippingTaskSkippedWebhookPayload.d.ts +2 -0
- package/dist/cjs/api/types/ShippingTaskTaskArtifactCompletedWebhookPayload.d.ts +2 -0
- package/dist/cjs/api/types/Task1.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/tracking/resources/devices/client/Client.d.mts +47 -1
- package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +195 -1
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.d.mts +12 -0
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.mjs +4 -0
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.d.mts +14 -0
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.mjs +4 -0
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.d.mts +12 -0
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.mjs +4 -0
- package/dist/esm/api/resources/tracking/resources/devices/client/requests/index.d.mts +3 -0
- package/dist/esm/api/types/CargoAiFwbAndFhlDimension1.d.mts +2 -10
- package/dist/esm/api/types/CargoAiFwbAndFhlDimension1.mjs +1 -9
- package/dist/esm/api/types/CargoAiFwbAndFhlDimensionUomEnum1.d.mts +8 -0
- package/dist/esm/api/types/CargoAiFwbAndFhlDimensionUomEnum1.mjs +7 -0
- package/dist/esm/api/types/CargoAiFwbAndFhlWeightOrVolume1.d.mts +2 -10
- package/dist/esm/api/types/CargoAiFwbAndFhlWeightOrVolume1.mjs +1 -9
- package/dist/esm/api/types/CargoAiFwbAndFhlWeightOrVolumeUomEnum1.d.mts +10 -0
- package/dist/esm/api/types/CargoAiFwbAndFhlWeightOrVolumeUomEnum1.mjs +9 -0
- package/dist/esm/api/types/DeviceForCargoRes.d.mts +17 -0
- package/dist/esm/api/types/DeviceForCargoRes.mjs +4 -0
- package/dist/esm/api/types/ShippingTaskAddedWebhookPayload.d.mts +2 -0
- package/dist/esm/api/types/ShippingTaskAttemptedWebhookPayload.d.mts +2 -0
- package/dist/esm/api/types/ShippingTaskCompletedWebhookPayload.d.mts +2 -0
- package/dist/esm/api/types/ShippingTaskDeletedWebhookPayload.d.mts +2 -0
- package/dist/esm/api/types/ShippingTaskExecutorOrgNoteAddedWebhookPayload.d.mts +2 -0
- package/dist/esm/api/types/ShippingTaskSkippedWebhookPayload.d.mts +2 -0
- package/dist/esm/api/types/ShippingTaskTaskArtifactCompletedWebhookPayload.d.mts +2 -0
- package/dist/esm/api/types/Task1.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +197 -1
package/dist/cjs/Client.js
CHANGED
|
@@ -62,8 +62,8 @@ class ChrtClient {
|
|
|
62
62
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
63
63
|
"X-Fern-Language": "JavaScript",
|
|
64
64
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
65
|
-
"X-Fern-SDK-Version": "1.
|
|
66
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
65
|
+
"X-Fern-SDK-Version": "1.1023.0",
|
|
66
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.1023.0",
|
|
67
67
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
68
68
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
69
69
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -31,7 +31,7 @@ export declare class Devices {
|
|
|
31
31
|
protected readonly _options: Devices.Options;
|
|
32
32
|
constructor(_options?: Devices.Options);
|
|
33
33
|
/**
|
|
34
|
-
* Archives a device
|
|
34
|
+
* Archives a device without an active session or cargo. Terminate or unlink tracking first. | auth: api_key | () -> (bool)
|
|
35
35
|
*
|
|
36
36
|
* @param {Chrt.tracking.DevicesArchiveV1Request} request
|
|
37
37
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -45,6 +45,21 @@ export declare class Devices {
|
|
|
45
45
|
*/
|
|
46
46
|
archiveV1(request: Chrt.tracking.DevicesArchiveV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
47
47
|
private __archiveV1;
|
|
48
|
+
/**
|
|
49
|
+
* Lists devices currently or previously linked to a cargo, ordered by MAC address. Access follows the cargo's order. | authz_personas=[coordinator_org_operators, shipper_org_operators, executor_org_operators, driver_for_executor] | () -> (list[DeviceForCargoRes])
|
|
50
|
+
*
|
|
51
|
+
* @param {Chrt.tracking.DevicesForCargoV1Request} request
|
|
52
|
+
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* await client.tracking.devices.forCargoV1({
|
|
58
|
+
* cargo_id: "cargo_id"
|
|
59
|
+
* })
|
|
60
|
+
*/
|
|
61
|
+
forCargoV1(request: Chrt.tracking.DevicesForCargoV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.DeviceForCargoRes[]>;
|
|
62
|
+
private __forCargoV1;
|
|
48
63
|
/**
|
|
49
64
|
* Retrieves a single device by its ID with expanded sessions and cargos. Access restricted to the caller's organization or shared organizations. | auth: api_key | authz: min_org_role=operator | () -> (DeviceExpandedRes)
|
|
50
65
|
*
|
|
@@ -60,6 +75,22 @@ export declare class Devices {
|
|
|
60
75
|
*/
|
|
61
76
|
getV1(request: Chrt.tracking.DevicesGetV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.DeviceExpandedRes>;
|
|
62
77
|
private __getV1;
|
|
78
|
+
/**
|
|
79
|
+
* Links an owned device to cargo and activates its tracker. Relinking the same cargo reactivates a stopped tracker. | authz: min_org_role=operator | authz_personas=[coordinator_org_operators, shipper_org_operators, executor_org_operators] | () -> (bool)
|
|
80
|
+
*
|
|
81
|
+
* @param {Chrt.tracking.DevicesLinkToCargoV1Request} request
|
|
82
|
+
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
83
|
+
*
|
|
84
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* await client.tracking.devices.linkToCargoV1({
|
|
88
|
+
* device_id: "device_id",
|
|
89
|
+
* cargo_id: "cargo_id"
|
|
90
|
+
* })
|
|
91
|
+
*/
|
|
92
|
+
linkToCargoV1(request: Chrt.tracking.DevicesLinkToCargoV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
93
|
+
private __linkToCargoV1;
|
|
63
94
|
/**
|
|
64
95
|
* Lists devices with filtering, sorting, and pagination. Use org_scope to restrict to owned, shared, or both (default). | auth: api_key | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
65
96
|
*
|
|
@@ -143,6 +174,21 @@ export declare class Devices {
|
|
|
143
174
|
*/
|
|
144
175
|
typeaheadV1(request: Chrt.tracking.DevicesTypeaheadV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.DeviceTypeaheadResult[]>;
|
|
145
176
|
private __typeaheadV1;
|
|
177
|
+
/**
|
|
178
|
+
* Unlinks an owned device from its cargo and deactivates its tracker. Returns false when the device is not linked to cargo. | authz: min_org_role=operator | () -> (bool)
|
|
179
|
+
*
|
|
180
|
+
* @param {Chrt.tracking.DevicesUnlinkFromCargoV1Request} request
|
|
181
|
+
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
182
|
+
*
|
|
183
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* await client.tracking.devices.unlinkFromCargoV1({
|
|
187
|
+
* device_id: "device_id"
|
|
188
|
+
* })
|
|
189
|
+
*/
|
|
190
|
+
unlinkFromCargoV1(request: Chrt.tracking.DevicesUnlinkFromCargoV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
191
|
+
private __unlinkFromCargoV1;
|
|
146
192
|
/**
|
|
147
193
|
* Unpauses a device. Closes the open pause time window. | auth: api_key | () -> (bool)
|
|
148
194
|
*
|
|
@@ -67,7 +67,7 @@ class Devices {
|
|
|
67
67
|
this._options = _options;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* Archives a device
|
|
70
|
+
* Archives a device without an active session or cargo. Terminate or unlink tracking first. | auth: api_key | () -> (bool)
|
|
71
71
|
*
|
|
72
72
|
* @param {Chrt.tracking.DevicesArchiveV1Request} request
|
|
73
73
|
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -130,6 +130,70 @@ class Devices {
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Lists devices currently or previously linked to a cargo, ordered by MAC address. Access follows the cargo's order. | authz_personas=[coordinator_org_operators, shipper_org_operators, executor_org_operators, driver_for_executor] | () -> (list[DeviceForCargoRes])
|
|
135
|
+
*
|
|
136
|
+
* @param {Chrt.tracking.DevicesForCargoV1Request} request
|
|
137
|
+
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
138
|
+
*
|
|
139
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* await client.tracking.devices.forCargoV1({
|
|
143
|
+
* cargo_id: "cargo_id"
|
|
144
|
+
* })
|
|
145
|
+
*/
|
|
146
|
+
forCargoV1(request, requestOptions) {
|
|
147
|
+
return core.HttpResponsePromise.fromPromise(this.__forCargoV1(request, requestOptions));
|
|
148
|
+
}
|
|
149
|
+
__forCargoV1(request, requestOptions) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
var _a, _b, _c, _d;
|
|
152
|
+
const { cargo_id: cargoId } = request;
|
|
153
|
+
const _queryParams = {};
|
|
154
|
+
_queryParams["cargo_id"] = cargoId;
|
|
155
|
+
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);
|
|
156
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
157
|
+
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/for_cargo/v1"),
|
|
158
|
+
method: "GET",
|
|
159
|
+
headers: _headers,
|
|
160
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
161
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
162
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
163
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
164
|
+
});
|
|
165
|
+
if (_response.ok) {
|
|
166
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
167
|
+
}
|
|
168
|
+
if (_response.error.reason === "status-code") {
|
|
169
|
+
switch (_response.error.statusCode) {
|
|
170
|
+
case 422:
|
|
171
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
172
|
+
default:
|
|
173
|
+
throw new errors.ChrtError({
|
|
174
|
+
statusCode: _response.error.statusCode,
|
|
175
|
+
body: _response.error.body,
|
|
176
|
+
rawResponse: _response.rawResponse,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
switch (_response.error.reason) {
|
|
181
|
+
case "non-json":
|
|
182
|
+
throw new errors.ChrtError({
|
|
183
|
+
statusCode: _response.error.statusCode,
|
|
184
|
+
body: _response.error.rawBody,
|
|
185
|
+
rawResponse: _response.rawResponse,
|
|
186
|
+
});
|
|
187
|
+
case "timeout":
|
|
188
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/for_cargo/v1.");
|
|
189
|
+
case "unknown":
|
|
190
|
+
throw new errors.ChrtError({
|
|
191
|
+
message: _response.error.errorMessage,
|
|
192
|
+
rawResponse: _response.rawResponse,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
133
197
|
/**
|
|
134
198
|
* Retrieves a single device by its ID with expanded sessions and cargos. Access restricted to the caller's organization or shared organizations. | auth: api_key | authz: min_org_role=operator | () -> (DeviceExpandedRes)
|
|
135
199
|
*
|
|
@@ -194,6 +258,72 @@ class Devices {
|
|
|
194
258
|
}
|
|
195
259
|
});
|
|
196
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Links an owned device to cargo and activates its tracker. Relinking the same cargo reactivates a stopped tracker. | authz: min_org_role=operator | authz_personas=[coordinator_org_operators, shipper_org_operators, executor_org_operators] | () -> (bool)
|
|
263
|
+
*
|
|
264
|
+
* @param {Chrt.tracking.DevicesLinkToCargoV1Request} request
|
|
265
|
+
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
266
|
+
*
|
|
267
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* await client.tracking.devices.linkToCargoV1({
|
|
271
|
+
* device_id: "device_id",
|
|
272
|
+
* cargo_id: "cargo_id"
|
|
273
|
+
* })
|
|
274
|
+
*/
|
|
275
|
+
linkToCargoV1(request, requestOptions) {
|
|
276
|
+
return core.HttpResponsePromise.fromPromise(this.__linkToCargoV1(request, requestOptions));
|
|
277
|
+
}
|
|
278
|
+
__linkToCargoV1(request, requestOptions) {
|
|
279
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
280
|
+
var _a, _b, _c, _d;
|
|
281
|
+
const { device_id: deviceId, cargo_id: cargoId } = request;
|
|
282
|
+
const _queryParams = {};
|
|
283
|
+
_queryParams["device_id"] = deviceId;
|
|
284
|
+
_queryParams["cargo_id"] = cargoId;
|
|
285
|
+
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);
|
|
286
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
287
|
+
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/link_to_cargo/v1"),
|
|
288
|
+
method: "POST",
|
|
289
|
+
headers: _headers,
|
|
290
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
291
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
292
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
293
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
294
|
+
});
|
|
295
|
+
if (_response.ok) {
|
|
296
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
297
|
+
}
|
|
298
|
+
if (_response.error.reason === "status-code") {
|
|
299
|
+
switch (_response.error.statusCode) {
|
|
300
|
+
case 422:
|
|
301
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
302
|
+
default:
|
|
303
|
+
throw new errors.ChrtError({
|
|
304
|
+
statusCode: _response.error.statusCode,
|
|
305
|
+
body: _response.error.body,
|
|
306
|
+
rawResponse: _response.rawResponse,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
switch (_response.error.reason) {
|
|
311
|
+
case "non-json":
|
|
312
|
+
throw new errors.ChrtError({
|
|
313
|
+
statusCode: _response.error.statusCode,
|
|
314
|
+
body: _response.error.rawBody,
|
|
315
|
+
rawResponse: _response.rawResponse,
|
|
316
|
+
});
|
|
317
|
+
case "timeout":
|
|
318
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/link_to_cargo/v1.");
|
|
319
|
+
case "unknown":
|
|
320
|
+
throw new errors.ChrtError({
|
|
321
|
+
message: _response.error.errorMessage,
|
|
322
|
+
rawResponse: _response.rawResponse,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
197
327
|
/**
|
|
198
328
|
* Lists devices with filtering, sorting, and pagination. Use org_scope to restrict to owned, shared, or both (default). | auth: api_key | authz: min_org_role=operator | () -> (DeviceListRes)
|
|
199
329
|
*
|
|
@@ -546,6 +676,70 @@ class Devices {
|
|
|
546
676
|
}
|
|
547
677
|
});
|
|
548
678
|
}
|
|
679
|
+
/**
|
|
680
|
+
* Unlinks an owned device from its cargo and deactivates its tracker. Returns false when the device is not linked to cargo. | authz: min_org_role=operator | () -> (bool)
|
|
681
|
+
*
|
|
682
|
+
* @param {Chrt.tracking.DevicesUnlinkFromCargoV1Request} request
|
|
683
|
+
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
684
|
+
*
|
|
685
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
686
|
+
*
|
|
687
|
+
* @example
|
|
688
|
+
* await client.tracking.devices.unlinkFromCargoV1({
|
|
689
|
+
* device_id: "device_id"
|
|
690
|
+
* })
|
|
691
|
+
*/
|
|
692
|
+
unlinkFromCargoV1(request, requestOptions) {
|
|
693
|
+
return core.HttpResponsePromise.fromPromise(this.__unlinkFromCargoV1(request, requestOptions));
|
|
694
|
+
}
|
|
695
|
+
__unlinkFromCargoV1(request, requestOptions) {
|
|
696
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
697
|
+
var _a, _b, _c, _d;
|
|
698
|
+
const { device_id: deviceId } = request;
|
|
699
|
+
const _queryParams = {};
|
|
700
|
+
_queryParams["device_id"] = deviceId;
|
|
701
|
+
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);
|
|
702
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
703
|
+
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/unlink_from_cargo/v1"),
|
|
704
|
+
method: "POST",
|
|
705
|
+
headers: _headers,
|
|
706
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
707
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
708
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
709
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
710
|
+
});
|
|
711
|
+
if (_response.ok) {
|
|
712
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
713
|
+
}
|
|
714
|
+
if (_response.error.reason === "status-code") {
|
|
715
|
+
switch (_response.error.statusCode) {
|
|
716
|
+
case 422:
|
|
717
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
718
|
+
default:
|
|
719
|
+
throw new errors.ChrtError({
|
|
720
|
+
statusCode: _response.error.statusCode,
|
|
721
|
+
body: _response.error.body,
|
|
722
|
+
rawResponse: _response.rawResponse,
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
switch (_response.error.reason) {
|
|
727
|
+
case "non-json":
|
|
728
|
+
throw new errors.ChrtError({
|
|
729
|
+
statusCode: _response.error.statusCode,
|
|
730
|
+
body: _response.error.rawBody,
|
|
731
|
+
rawResponse: _response.rawResponse,
|
|
732
|
+
});
|
|
733
|
+
case "timeout":
|
|
734
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/unlink_from_cargo/v1.");
|
|
735
|
+
case "unknown":
|
|
736
|
+
throw new errors.ChrtError({
|
|
737
|
+
message: _response.error.errorMessage,
|
|
738
|
+
rawResponse: _response.rawResponse,
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
}
|
|
549
743
|
/**
|
|
550
744
|
* Unpauses a device. Closes the open pause time window. | auth: api_key | () -> (bool)
|
|
551
745
|
*
|
|
@@ -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
|
+
* cargo_id: "cargo_id"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface DevicesLinkToCargoV1Request {
|
|
12
|
+
device_id: string;
|
|
13
|
+
cargo_id: string;
|
|
14
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export { type DevicesArchiveV1Request } from "./DevicesArchiveV1Request.js";
|
|
2
|
+
export { type DevicesForCargoV1Request } from "./DevicesForCargoV1Request.js";
|
|
2
3
|
export { type DevicesGetV1Request } from "./DevicesGetV1Request.js";
|
|
4
|
+
export { type DevicesLinkToCargoV1Request } from "./DevicesLinkToCargoV1Request.js";
|
|
3
5
|
export { type DevicesListV1Request } from "./DevicesListV1Request.js";
|
|
4
6
|
export { type DevicesPauseV1Request } from "./DevicesPauseV1Request.js";
|
|
5
7
|
export { type DeviceClientCreate1 } from "./DeviceClientCreate1.js";
|
|
6
8
|
export { type DevicesTypeaheadV1Request } from "./DevicesTypeaheadV1Request.js";
|
|
9
|
+
export { type DevicesUnlinkFromCargoV1Request } from "./DevicesUnlinkFromCargoV1Request.js";
|
|
7
10
|
export { type DevicesUnpauseV1Request } from "./DevicesUnpauseV1Request.js";
|
|
8
11
|
export { type DeviceClientUpdate1 } from "./DeviceClientUpdate1.js";
|
|
9
12
|
export { type DevicesUpdateSharedOrgsReq1 } from "./DevicesUpdateSharedOrgsReq1.js";
|
|
@@ -1,19 +1,11 @@
|
|
|
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
|
export interface CargoAiFwbAndFhlDimension1 {
|
|
5
6
|
height: number;
|
|
6
7
|
length: number;
|
|
7
8
|
pcs: number;
|
|
8
|
-
uom:
|
|
9
|
+
uom: Chrt.CargoAiFwbAndFhlDimensionUomEnum1;
|
|
9
10
|
width: number;
|
|
10
11
|
}
|
|
11
|
-
export declare namespace CargoAiFwbAndFhlDimension1 {
|
|
12
|
-
type Uom = "K" | "L" | "MC" | "CF";
|
|
13
|
-
const Uom: {
|
|
14
|
-
readonly K: "K";
|
|
15
|
-
readonly L: "L";
|
|
16
|
-
readonly Mc: "MC";
|
|
17
|
-
readonly Cf: "CF";
|
|
18
|
-
};
|
|
19
|
-
}
|
|
@@ -3,13 +3,3 @@
|
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CargoAiFwbAndFhlDimension1 = void 0;
|
|
7
|
-
var CargoAiFwbAndFhlDimension1;
|
|
8
|
-
(function (CargoAiFwbAndFhlDimension1) {
|
|
9
|
-
CargoAiFwbAndFhlDimension1.Uom = {
|
|
10
|
-
K: "K",
|
|
11
|
-
L: "L",
|
|
12
|
-
Mc: "MC",
|
|
13
|
-
Cf: "CF",
|
|
14
|
-
};
|
|
15
|
-
})(CargoAiFwbAndFhlDimension1 || (exports.CargoAiFwbAndFhlDimension1 = CargoAiFwbAndFhlDimension1 = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CargoAiFwbAndFhlDimensionUomEnum1 = void 0;
|
|
7
|
+
exports.CargoAiFwbAndFhlDimensionUomEnum1 = {
|
|
8
|
+
Cmt: "CMT",
|
|
9
|
+
Inh: "INH",
|
|
10
|
+
};
|
|
@@ -1,16 +1,8 @@
|
|
|
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
|
export interface CargoAiFwbAndFhlWeightOrVolume1 {
|
|
5
|
-
uom:
|
|
6
|
+
uom: Chrt.CargoAiFwbAndFhlWeightOrVolumeUomEnum1;
|
|
6
7
|
value: number;
|
|
7
8
|
}
|
|
8
|
-
export declare namespace CargoAiFwbAndFhlWeightOrVolume1 {
|
|
9
|
-
type Uom = "K" | "L" | "MC" | "CF";
|
|
10
|
-
const Uom: {
|
|
11
|
-
readonly K: "K";
|
|
12
|
-
readonly L: "L";
|
|
13
|
-
readonly Mc: "MC";
|
|
14
|
-
readonly Cf: "CF";
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -3,13 +3,3 @@
|
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CargoAiFwbAndFhlWeightOrVolume1 = void 0;
|
|
7
|
-
var CargoAiFwbAndFhlWeightOrVolume1;
|
|
8
|
-
(function (CargoAiFwbAndFhlWeightOrVolume1) {
|
|
9
|
-
CargoAiFwbAndFhlWeightOrVolume1.Uom = {
|
|
10
|
-
K: "K",
|
|
11
|
-
L: "L",
|
|
12
|
-
Mc: "MC",
|
|
13
|
-
Cf: "CF",
|
|
14
|
-
};
|
|
15
|
-
})(CargoAiFwbAndFhlWeightOrVolume1 || (exports.CargoAiFwbAndFhlWeightOrVolume1 = CargoAiFwbAndFhlWeightOrVolume1 = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export type CargoAiFwbAndFhlWeightOrVolumeUomEnum1 = "K" | "L" | "MC" | "CF";
|
|
5
|
+
export declare const CargoAiFwbAndFhlWeightOrVolumeUomEnum1: {
|
|
6
|
+
readonly K: "K";
|
|
7
|
+
readonly L: "L";
|
|
8
|
+
readonly Mc: "MC";
|
|
9
|
+
readonly Cf: "CF";
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CargoAiFwbAndFhlWeightOrVolumeUomEnum1 = void 0;
|
|
7
|
+
exports.CargoAiFwbAndFhlWeightOrVolumeUomEnum1 = {
|
|
8
|
+
K: "K",
|
|
9
|
+
L: "L",
|
|
10
|
+
Mc: "MC",
|
|
11
|
+
Cf: "CF",
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* A device as seen by the cargo's order parties, who may not own or share the device.
|
|
7
|
+
*
|
|
8
|
+
* NOTE - excludes device_token (the webhook secret), location, and owner-only fields.
|
|
9
|
+
*/
|
|
10
|
+
export interface DeviceForCargoRes {
|
|
11
|
+
device_id: string;
|
|
12
|
+
device_mac_address: string;
|
|
13
|
+
is_currently_linked: boolean;
|
|
14
|
+
last_seen_at_timestamp?: string | null;
|
|
15
|
+
last_seen_battery_level?: string | null;
|
|
16
|
+
type?: Chrt.TrackingDeviceTypeEnum1 | null;
|
|
17
|
+
}
|
|
@@ -16,6 +16,8 @@ export interface ShippingTaskAddedWebhookPayload {
|
|
|
16
16
|
task_group_id: string;
|
|
17
17
|
/** The task that was added */
|
|
18
18
|
task_id: string;
|
|
19
|
+
/** Human-facing short ID of the task */
|
|
20
|
+
task_short_id: string;
|
|
19
21
|
}
|
|
20
22
|
export declare namespace ShippingTaskAddedWebhookPayload {
|
|
21
23
|
type Action = Chrt.ChrtGroundProviderTaskActionEnum1 | Chrt.CargoOnFlightTaskActionEnum1 | Chrt.OnboardCourierTaskActionEnum1;
|
|
@@ -16,6 +16,8 @@ export interface ShippingTaskAttemptedWebhookPayload {
|
|
|
16
16
|
task_group_id: string;
|
|
17
17
|
/** The task that was attempted */
|
|
18
18
|
task_id: string;
|
|
19
|
+
/** Human-facing short ID of the task */
|
|
20
|
+
task_short_id: string;
|
|
19
21
|
}
|
|
20
22
|
export declare namespace ShippingTaskAttemptedWebhookPayload {
|
|
21
23
|
type Action = Chrt.ChrtGroundProviderTaskActionEnum1 | Chrt.CargoOnFlightTaskActionEnum1 | Chrt.OnboardCourierTaskActionEnum1;
|
|
@@ -18,6 +18,8 @@ export interface ShippingTaskCompletedWebhookPayload {
|
|
|
18
18
|
task_group_type: Chrt.TaskGroupTypeEnum1;
|
|
19
19
|
/** The task that was completed */
|
|
20
20
|
task_id: string;
|
|
21
|
+
/** Human-facing short ID of the task */
|
|
22
|
+
task_short_id: string;
|
|
21
23
|
}
|
|
22
24
|
export declare namespace ShippingTaskCompletedWebhookPayload {
|
|
23
25
|
type Action = Chrt.ChrtGroundProviderTaskActionEnum1 | Chrt.CargoOnFlightTaskActionEnum1 | Chrt.OnboardCourierTaskActionEnum1;
|
|
@@ -16,6 +16,8 @@ export interface ShippingTaskDeletedWebhookPayload {
|
|
|
16
16
|
task_group_id: string;
|
|
17
17
|
/** The ID of the task that was deleted */
|
|
18
18
|
task_id: string;
|
|
19
|
+
/** Human-facing short ID of the task */
|
|
20
|
+
task_short_id: string;
|
|
19
21
|
}
|
|
20
22
|
export declare namespace ShippingTaskDeletedWebhookPayload {
|
|
21
23
|
type Action = Chrt.ChrtGroundProviderTaskActionEnum1 | Chrt.CargoOnFlightTaskActionEnum1 | Chrt.OnboardCourierTaskActionEnum1;
|
|
@@ -16,6 +16,8 @@ export interface ShippingTaskSkippedWebhookPayload {
|
|
|
16
16
|
task_group_id: string;
|
|
17
17
|
/** The task that was skipped */
|
|
18
18
|
task_id: string;
|
|
19
|
+
/** Human-facing short ID of the task */
|
|
20
|
+
task_short_id: string;
|
|
19
21
|
}
|
|
20
22
|
export declare namespace ShippingTaskSkippedWebhookPayload {
|
|
21
23
|
type Action = Chrt.ChrtGroundProviderTaskActionEnum1 | Chrt.CargoOnFlightTaskActionEnum1 | Chrt.OnboardCourierTaskActionEnum1;
|
|
@@ -33,6 +33,7 @@ export interface Task1 {
|
|
|
33
33
|
provided_by?: Chrt.CustodyParty1 | null;
|
|
34
34
|
received_by?: Chrt.CustodyParty1 | null;
|
|
35
35
|
schema_version: number;
|
|
36
|
+
short_id: string;
|
|
36
37
|
skipped_at_timestamp?: string | null;
|
|
37
38
|
staged_at_timestamp?: string | null;
|
|
38
39
|
status?: Chrt.TaskStatusEnum1;
|
|
@@ -68,6 +68,7 @@ export * from "./CargoAiFwbAndFhlCity1.js";
|
|
|
68
68
|
export * from "./CargoAiFwbAndFhlCode1.js";
|
|
69
69
|
export * from "./CargoAiFwbAndFhlCountry1.js";
|
|
70
70
|
export * from "./CargoAiFwbAndFhlDimension1.js";
|
|
71
|
+
export * from "./CargoAiFwbAndFhlDimensionUomEnum1.js";
|
|
71
72
|
export * from "./CargoAiFwbAndFhlExecution1.js";
|
|
72
73
|
export * from "./CargoAiFwbAndFhlHandling1.js";
|
|
73
74
|
export * from "./CargoAiFwbAndFhlHouse1.js";
|
|
@@ -81,6 +82,7 @@ export * from "./CargoAiFwbAndFhlRequest1.js";
|
|
|
81
82
|
export * from "./CargoAiFwbAndFhlRouting1.js";
|
|
82
83
|
export * from "./CargoAiFwbAndFhlUld1.js";
|
|
83
84
|
export * from "./CargoAiFwbAndFhlWeightOrVolume1.js";
|
|
85
|
+
export * from "./CargoAiFwbAndFhlWeightOrVolumeUomEnum1.js";
|
|
84
86
|
export * from "./CargoAiTrackAndTraceAdditionalInformation.js";
|
|
85
87
|
export * from "./CargoAiTrackAndTraceAlert.js";
|
|
86
88
|
export * from "./CargoAiTrackAndTraceAlertLevelEnum.js";
|
|
@@ -296,6 +298,7 @@ export * from "./DepartmentTypeaheadFieldEnum.js";
|
|
|
296
298
|
export * from "./DepartmentTypeaheadResult.js";
|
|
297
299
|
export * from "./DepartmentTypeaheadValue.js";
|
|
298
300
|
export * from "./DeviceExpandedRes.js";
|
|
301
|
+
export * from "./DeviceForCargoRes.js";
|
|
299
302
|
export * from "./DeviceLimitedForList1.js";
|
|
300
303
|
export * from "./DeviceListRes.js";
|
|
301
304
|
export * from "./DevicePausedTimeWindow1.js";
|