@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
|
@@ -84,6 +84,7 @@ __exportStar(require("./CargoAiFwbAndFhlCity1.js"), exports);
|
|
|
84
84
|
__exportStar(require("./CargoAiFwbAndFhlCode1.js"), exports);
|
|
85
85
|
__exportStar(require("./CargoAiFwbAndFhlCountry1.js"), exports);
|
|
86
86
|
__exportStar(require("./CargoAiFwbAndFhlDimension1.js"), exports);
|
|
87
|
+
__exportStar(require("./CargoAiFwbAndFhlDimensionUomEnum1.js"), exports);
|
|
87
88
|
__exportStar(require("./CargoAiFwbAndFhlExecution1.js"), exports);
|
|
88
89
|
__exportStar(require("./CargoAiFwbAndFhlHandling1.js"), exports);
|
|
89
90
|
__exportStar(require("./CargoAiFwbAndFhlHouse1.js"), exports);
|
|
@@ -97,6 +98,7 @@ __exportStar(require("./CargoAiFwbAndFhlRequest1.js"), exports);
|
|
|
97
98
|
__exportStar(require("./CargoAiFwbAndFhlRouting1.js"), exports);
|
|
98
99
|
__exportStar(require("./CargoAiFwbAndFhlUld1.js"), exports);
|
|
99
100
|
__exportStar(require("./CargoAiFwbAndFhlWeightOrVolume1.js"), exports);
|
|
101
|
+
__exportStar(require("./CargoAiFwbAndFhlWeightOrVolumeUomEnum1.js"), exports);
|
|
100
102
|
__exportStar(require("./CargoAiTrackAndTraceAdditionalInformation.js"), exports);
|
|
101
103
|
__exportStar(require("./CargoAiTrackAndTraceAlert.js"), exports);
|
|
102
104
|
__exportStar(require("./CargoAiTrackAndTraceAlertLevelEnum.js"), exports);
|
|
@@ -312,6 +314,7 @@ __exportStar(require("./DepartmentTypeaheadFieldEnum.js"), exports);
|
|
|
312
314
|
__exportStar(require("./DepartmentTypeaheadResult.js"), exports);
|
|
313
315
|
__exportStar(require("./DepartmentTypeaheadValue.js"), exports);
|
|
314
316
|
__exportStar(require("./DeviceExpandedRes.js"), exports);
|
|
317
|
+
__exportStar(require("./DeviceForCargoRes.js"), exports);
|
|
315
318
|
__exportStar(require("./DeviceLimitedForList1.js"), exports);
|
|
316
319
|
__exportStar(require("./DeviceListRes.js"), exports);
|
|
317
320
|
__exportStar(require("./DevicePausedTimeWindow1.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.1023.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -26,8 +26,8 @@ export class ChrtClient {
|
|
|
26
26
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
27
27
|
"X-Fern-Language": "JavaScript",
|
|
28
28
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
29
|
-
"X-Fern-SDK-Version": "1.
|
|
30
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
29
|
+
"X-Fern-SDK-Version": "1.1023.0",
|
|
30
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.1023.0",
|
|
31
31
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
32
32
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
33
33
|
}, _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
|
*
|
|
@@ -31,7 +31,7 @@ export class Devices {
|
|
|
31
31
|
this._options = _options;
|
|
32
32
|
}
|
|
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.
|
|
@@ -94,6 +94,70 @@ export class Devices {
|
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* 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])
|
|
99
|
+
*
|
|
100
|
+
* @param {Chrt.tracking.DevicesForCargoV1Request} request
|
|
101
|
+
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
102
|
+
*
|
|
103
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* await client.tracking.devices.forCargoV1({
|
|
107
|
+
* cargo_id: "cargo_id"
|
|
108
|
+
* })
|
|
109
|
+
*/
|
|
110
|
+
forCargoV1(request, requestOptions) {
|
|
111
|
+
return core.HttpResponsePromise.fromPromise(this.__forCargoV1(request, requestOptions));
|
|
112
|
+
}
|
|
113
|
+
__forCargoV1(request, requestOptions) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
var _a, _b, _c, _d;
|
|
116
|
+
const { cargo_id: cargoId } = request;
|
|
117
|
+
const _queryParams = {};
|
|
118
|
+
_queryParams["cargo_id"] = cargoId;
|
|
119
|
+
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);
|
|
120
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
121
|
+
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"),
|
|
122
|
+
method: "GET",
|
|
123
|
+
headers: _headers,
|
|
124
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
125
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
126
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
127
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
128
|
+
});
|
|
129
|
+
if (_response.ok) {
|
|
130
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
131
|
+
}
|
|
132
|
+
if (_response.error.reason === "status-code") {
|
|
133
|
+
switch (_response.error.statusCode) {
|
|
134
|
+
case 422:
|
|
135
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
136
|
+
default:
|
|
137
|
+
throw new errors.ChrtError({
|
|
138
|
+
statusCode: _response.error.statusCode,
|
|
139
|
+
body: _response.error.body,
|
|
140
|
+
rawResponse: _response.rawResponse,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
switch (_response.error.reason) {
|
|
145
|
+
case "non-json":
|
|
146
|
+
throw new errors.ChrtError({
|
|
147
|
+
statusCode: _response.error.statusCode,
|
|
148
|
+
body: _response.error.rawBody,
|
|
149
|
+
rawResponse: _response.rawResponse,
|
|
150
|
+
});
|
|
151
|
+
case "timeout":
|
|
152
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/for_cargo/v1.");
|
|
153
|
+
case "unknown":
|
|
154
|
+
throw new errors.ChrtError({
|
|
155
|
+
message: _response.error.errorMessage,
|
|
156
|
+
rawResponse: _response.rawResponse,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
97
161
|
/**
|
|
98
162
|
* 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)
|
|
99
163
|
*
|
|
@@ -158,6 +222,72 @@ export class Devices {
|
|
|
158
222
|
}
|
|
159
223
|
});
|
|
160
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* 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)
|
|
227
|
+
*
|
|
228
|
+
* @param {Chrt.tracking.DevicesLinkToCargoV1Request} request
|
|
229
|
+
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
230
|
+
*
|
|
231
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* await client.tracking.devices.linkToCargoV1({
|
|
235
|
+
* device_id: "device_id",
|
|
236
|
+
* cargo_id: "cargo_id"
|
|
237
|
+
* })
|
|
238
|
+
*/
|
|
239
|
+
linkToCargoV1(request, requestOptions) {
|
|
240
|
+
return core.HttpResponsePromise.fromPromise(this.__linkToCargoV1(request, requestOptions));
|
|
241
|
+
}
|
|
242
|
+
__linkToCargoV1(request, requestOptions) {
|
|
243
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
var _a, _b, _c, _d;
|
|
245
|
+
const { device_id: deviceId, cargo_id: cargoId } = request;
|
|
246
|
+
const _queryParams = {};
|
|
247
|
+
_queryParams["device_id"] = deviceId;
|
|
248
|
+
_queryParams["cargo_id"] = cargoId;
|
|
249
|
+
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);
|
|
250
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
251
|
+
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"),
|
|
252
|
+
method: "POST",
|
|
253
|
+
headers: _headers,
|
|
254
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
255
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
256
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
257
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
258
|
+
});
|
|
259
|
+
if (_response.ok) {
|
|
260
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
261
|
+
}
|
|
262
|
+
if (_response.error.reason === "status-code") {
|
|
263
|
+
switch (_response.error.statusCode) {
|
|
264
|
+
case 422:
|
|
265
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
266
|
+
default:
|
|
267
|
+
throw new errors.ChrtError({
|
|
268
|
+
statusCode: _response.error.statusCode,
|
|
269
|
+
body: _response.error.body,
|
|
270
|
+
rawResponse: _response.rawResponse,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
switch (_response.error.reason) {
|
|
275
|
+
case "non-json":
|
|
276
|
+
throw new errors.ChrtError({
|
|
277
|
+
statusCode: _response.error.statusCode,
|
|
278
|
+
body: _response.error.rawBody,
|
|
279
|
+
rawResponse: _response.rawResponse,
|
|
280
|
+
});
|
|
281
|
+
case "timeout":
|
|
282
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/link_to_cargo/v1.");
|
|
283
|
+
case "unknown":
|
|
284
|
+
throw new errors.ChrtError({
|
|
285
|
+
message: _response.error.errorMessage,
|
|
286
|
+
rawResponse: _response.rawResponse,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
161
291
|
/**
|
|
162
292
|
* 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)
|
|
163
293
|
*
|
|
@@ -510,6 +640,70 @@ export class Devices {
|
|
|
510
640
|
}
|
|
511
641
|
});
|
|
512
642
|
}
|
|
643
|
+
/**
|
|
644
|
+
* 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)
|
|
645
|
+
*
|
|
646
|
+
* @param {Chrt.tracking.DevicesUnlinkFromCargoV1Request} request
|
|
647
|
+
* @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
|
|
648
|
+
*
|
|
649
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
650
|
+
*
|
|
651
|
+
* @example
|
|
652
|
+
* await client.tracking.devices.unlinkFromCargoV1({
|
|
653
|
+
* device_id: "device_id"
|
|
654
|
+
* })
|
|
655
|
+
*/
|
|
656
|
+
unlinkFromCargoV1(request, requestOptions) {
|
|
657
|
+
return core.HttpResponsePromise.fromPromise(this.__unlinkFromCargoV1(request, requestOptions));
|
|
658
|
+
}
|
|
659
|
+
__unlinkFromCargoV1(request, requestOptions) {
|
|
660
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
661
|
+
var _a, _b, _c, _d;
|
|
662
|
+
const { device_id: deviceId } = request;
|
|
663
|
+
const _queryParams = {};
|
|
664
|
+
_queryParams["device_id"] = deviceId;
|
|
665
|
+
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);
|
|
666
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
667
|
+
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"),
|
|
668
|
+
method: "POST",
|
|
669
|
+
headers: _headers,
|
|
670
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
671
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
672
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
673
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
674
|
+
});
|
|
675
|
+
if (_response.ok) {
|
|
676
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
677
|
+
}
|
|
678
|
+
if (_response.error.reason === "status-code") {
|
|
679
|
+
switch (_response.error.statusCode) {
|
|
680
|
+
case 422:
|
|
681
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
682
|
+
default:
|
|
683
|
+
throw new errors.ChrtError({
|
|
684
|
+
statusCode: _response.error.statusCode,
|
|
685
|
+
body: _response.error.body,
|
|
686
|
+
rawResponse: _response.rawResponse,
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
switch (_response.error.reason) {
|
|
691
|
+
case "non-json":
|
|
692
|
+
throw new errors.ChrtError({
|
|
693
|
+
statusCode: _response.error.statusCode,
|
|
694
|
+
body: _response.error.rawBody,
|
|
695
|
+
rawResponse: _response.rawResponse,
|
|
696
|
+
});
|
|
697
|
+
case "timeout":
|
|
698
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/unlink_from_cargo/v1.");
|
|
699
|
+
case "unknown":
|
|
700
|
+
throw new errors.ChrtError({
|
|
701
|
+
message: _response.error.errorMessage,
|
|
702
|
+
rawResponse: _response.rawResponse,
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
}
|
|
513
707
|
/**
|
|
514
708
|
* Unpauses a device. Closes the open pause time window. | auth: api_key | () -> (bool)
|
|
515
709
|
*
|
|
@@ -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.mjs";
|
|
2
|
+
export { type DevicesForCargoV1Request } from "./DevicesForCargoV1Request.mjs";
|
|
2
3
|
export { type DevicesGetV1Request } from "./DevicesGetV1Request.mjs";
|
|
4
|
+
export { type DevicesLinkToCargoV1Request } from "./DevicesLinkToCargoV1Request.mjs";
|
|
3
5
|
export { type DevicesListV1Request } from "./DevicesListV1Request.mjs";
|
|
4
6
|
export { type DevicesPauseV1Request } from "./DevicesPauseV1Request.mjs";
|
|
5
7
|
export { type DeviceClientCreate1 } from "./DeviceClientCreate1.mjs";
|
|
6
8
|
export { type DevicesTypeaheadV1Request } from "./DevicesTypeaheadV1Request.mjs";
|
|
9
|
+
export { type DevicesUnlinkFromCargoV1Request } from "./DevicesUnlinkFromCargoV1Request.mjs";
|
|
7
10
|
export { type DevicesUnpauseV1Request } from "./DevicesUnpauseV1Request.mjs";
|
|
8
11
|
export { type DeviceClientUpdate1 } from "./DeviceClientUpdate1.mjs";
|
|
9
12
|
export { type DevicesUpdateSharedOrgsReq1 } from "./DevicesUpdateSharedOrgsReq1.mjs";
|
|
@@ -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.mjs";
|
|
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
|
-
}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
(function (CargoAiFwbAndFhlDimension1) {
|
|
6
|
-
CargoAiFwbAndFhlDimension1.Uom = {
|
|
7
|
-
K: "K",
|
|
8
|
-
L: "L",
|
|
9
|
-
Mc: "MC",
|
|
10
|
-
Cf: "CF",
|
|
11
|
-
};
|
|
12
|
-
})(CargoAiFwbAndFhlDimension1 || (CargoAiFwbAndFhlDimension1 = {}));
|
|
4
|
+
export {};
|
|
@@ -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.mjs";
|
|
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
|
-
}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
(function (CargoAiFwbAndFhlWeightOrVolume1) {
|
|
6
|
-
CargoAiFwbAndFhlWeightOrVolume1.Uom = {
|
|
7
|
-
K: "K",
|
|
8
|
-
L: "L",
|
|
9
|
-
Mc: "MC",
|
|
10
|
-
Cf: "CF",
|
|
11
|
-
};
|
|
12
|
-
})(CargoAiFwbAndFhlWeightOrVolume1 || (CargoAiFwbAndFhlWeightOrVolume1 = {}));
|
|
4
|
+
export {};
|
|
@@ -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,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
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;
|