@chrt-inc/typescript-sdk 1.1020.0 → 1.1024.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/README.md +12 -9
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/chrtGpt/client/Client.d.ts +6 -13
- package/dist/cjs/api/resources/chrtGpt/client/Client.js +24 -17
- package/dist/cjs/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.d.ts → ChrtGptReq.d.ts} +1 -1
- package/dist/cjs/api/resources/chrtGpt/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/chrtGpt/index.d.ts +1 -0
- package/dist/cjs/api/resources/chrtGpt/index.js +1 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.d.ts +65 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.js +205 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/index.js +17 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.d.ts +21 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/index.d.ts +1 -0
- package/dist/cjs/api/resources/chrtGpt/resources/conversations/index.js +17 -0
- package/dist/cjs/api/resources/chrtGpt/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/chrtGpt/resources/index.js +41 -0
- package/dist/cjs/api/resources/orgs/resources/connections/client/Client.d.ts +18 -1
- package/dist/cjs/api/resources/orgs/resources/connections/client/Client.js +75 -6
- package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ConnectionsListShippersForCoordinatorV1Request.d.ts +4 -1
- package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.d.ts +12 -0
- package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.js +5 -0
- package/dist/cjs/api/resources/orgs/resources/connections/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.js +5 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/index.d.ts +1 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/index.js +1 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/index.js +41 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.d.ts +86 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.js +319 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/index.js +17 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.d.ts +13 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.js +5 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/index.d.ts +1 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/index.js +17 -0
- 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/ChrtGptAssistantMessageItem.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptAssistantMessageItem.js +5 -0
- package/dist/cjs/api/types/ChrtGptCompletedEvent.d.ts +11 -0
- package/dist/cjs/api/types/ChrtGptCompletedEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversation1.d.ts +14 -0
- package/dist/cjs/api/types/ChrtGptConversation1.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversationListRes.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptConversationListRes.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversationRes.d.ts +9 -0
- package/dist/cjs/api/types/ChrtGptConversationRes.js +5 -0
- package/dist/cjs/api/types/ChrtGptConversationSortByEnum.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptConversationSortByEnum.js +10 -0
- package/dist/cjs/api/types/ChrtGptErrorEvent.d.ts +9 -0
- package/dist/cjs/api/types/ChrtGptErrorEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptEvent.d.ts +31 -0
- package/dist/cjs/api/types/ChrtGptEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptHistoryItem.d.ts +22 -0
- package/dist/cjs/api/types/ChrtGptHistoryItem.js +5 -0
- package/dist/{esm/api/types/ChrtGptMessageRes.d.mts → cjs/api/types/ChrtGptStartedEvent.d.ts} +4 -2
- package/dist/cjs/api/types/ChrtGptStartedEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptTextDeltaEvent.d.ts +8 -0
- package/dist/cjs/api/types/ChrtGptTextDeltaEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptTitleEvent.d.ts +11 -0
- package/dist/cjs/api/types/ChrtGptTitleEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptToolCalledEvent.d.ts +12 -0
- package/dist/cjs/api/types/ChrtGptToolCalledEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptToolOutputEvent.d.ts +9 -0
- package/dist/cjs/api/types/ChrtGptToolOutputEvent.js +5 -0
- package/dist/cjs/api/types/ChrtGptUserMessageItem.d.ts +6 -0
- package/dist/cjs/api/types/ChrtGptUserMessageItem.js +5 -0
- package/dist/cjs/api/types/ChrtGptWebSearchEvent.d.ts +18 -0
- package/dist/cjs/api/types/ChrtGptWebSearchEvent.js +5 -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/OrgPublicData1.d.ts +1 -0
- package/dist/cjs/api/types/OrgPublicDataS3ObjectMetadata1.d.ts +21 -0
- package/dist/cjs/api/types/OrgPublicDataS3ObjectMetadata1.js +5 -0
- package/dist/cjs/api/types/ShipperCoordinatorConnection1.d.ts +4 -0
- package/dist/cjs/api/types/SpecialHandlingCodeEnum1.d.ts +63 -1
- package/dist/cjs/api/types/SpecialHandlingCodeEnum1.js +62 -0
- package/dist/cjs/api/types/index.d.ts +18 -1
- package/dist/cjs/api/types/index.js +18 -1
- package/dist/cjs/core/index.d.ts +1 -0
- package/dist/cjs/core/index.js +1 -0
- package/dist/cjs/core/stream/Stream.d.ts +46 -0
- package/dist/cjs/core/stream/Stream.js +169 -0
- package/dist/cjs/core/stream/index.d.ts +1 -0
- package/dist/cjs/core/stream/index.js +5 -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/chrtGpt/client/Client.d.mts +6 -13
- package/dist/esm/api/resources/chrtGpt/client/Client.mjs +24 -17
- package/dist/esm/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.d.mts → ChrtGptReq.d.mts} +1 -1
- package/dist/esm/api/resources/chrtGpt/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/chrtGpt/index.d.mts +1 -0
- package/dist/esm/api/resources/chrtGpt/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.d.mts +65 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.mjs +168 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/index.d.mts +2 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.d.mts +21 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/index.d.mts +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/conversations/index.mjs +1 -0
- package/dist/esm/api/resources/chrtGpt/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/chrtGpt/resources/index.mjs +2 -0
- package/dist/esm/api/resources/orgs/resources/connections/client/Client.d.mts +18 -1
- package/dist/esm/api/resources/orgs/resources/connections/client/Client.mjs +75 -6
- package/dist/esm/api/resources/orgs/resources/connections/client/requests/ConnectionsListShippersForCoordinatorV1Request.d.mts +4 -1
- package/dist/esm/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.d.mts +12 -0
- package/dist/esm/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.mjs +4 -0
- package/dist/esm/api/resources/orgs/resources/connections/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/orgs/resources/publicData/client/Client.mjs +5 -0
- package/dist/esm/api/resources/orgs/resources/publicData/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/index.mjs +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/index.mjs +2 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.d.mts +86 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.mjs +282 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/index.d.mts +2 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/index.mjs +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.d.mts +13 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.mjs +4 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/index.mjs +1 -0
- 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/ChrtGptAssistantMessageItem.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptAssistantMessageItem.mjs +4 -0
- package/dist/esm/api/types/ChrtGptCompletedEvent.d.mts +11 -0
- package/dist/esm/api/types/ChrtGptCompletedEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversation1.d.mts +14 -0
- package/dist/esm/api/types/ChrtGptConversation1.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversationListRes.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptConversationListRes.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversationRes.d.mts +9 -0
- package/dist/esm/api/types/ChrtGptConversationRes.mjs +4 -0
- package/dist/esm/api/types/ChrtGptConversationSortByEnum.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptConversationSortByEnum.mjs +7 -0
- package/dist/esm/api/types/ChrtGptErrorEvent.d.mts +9 -0
- package/dist/esm/api/types/ChrtGptErrorEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptEvent.d.mts +31 -0
- package/dist/esm/api/types/ChrtGptEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptHistoryItem.d.mts +22 -0
- package/dist/esm/api/types/ChrtGptHistoryItem.mjs +4 -0
- package/dist/{cjs/api/types/ChrtGptMessageRes.d.ts → esm/api/types/ChrtGptStartedEvent.d.mts} +4 -2
- package/dist/esm/api/types/ChrtGptStartedEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptTextDeltaEvent.d.mts +8 -0
- package/dist/esm/api/types/ChrtGptTextDeltaEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptTitleEvent.d.mts +11 -0
- package/dist/esm/api/types/ChrtGptTitleEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptToolCalledEvent.d.mts +12 -0
- package/dist/esm/api/types/ChrtGptToolCalledEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptToolOutputEvent.d.mts +9 -0
- package/dist/esm/api/types/ChrtGptToolOutputEvent.mjs +4 -0
- package/dist/esm/api/types/ChrtGptUserMessageItem.d.mts +6 -0
- package/dist/esm/api/types/ChrtGptUserMessageItem.mjs +4 -0
- package/dist/esm/api/types/ChrtGptWebSearchEvent.d.mts +18 -0
- package/dist/esm/api/types/ChrtGptWebSearchEvent.mjs +4 -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/OrgPublicData1.d.mts +1 -0
- package/dist/esm/api/types/OrgPublicDataS3ObjectMetadata1.d.mts +21 -0
- package/dist/esm/api/types/OrgPublicDataS3ObjectMetadata1.mjs +4 -0
- package/dist/esm/api/types/ShipperCoordinatorConnection1.d.mts +4 -0
- package/dist/esm/api/types/SpecialHandlingCodeEnum1.d.mts +63 -1
- package/dist/esm/api/types/SpecialHandlingCodeEnum1.mjs +62 -0
- package/dist/esm/api/types/index.d.mts +18 -1
- package/dist/esm/api/types/index.mjs +18 -1
- package/dist/esm/core/index.d.mts +1 -0
- package/dist/esm/core/index.mjs +1 -0
- package/dist/esm/core/stream/Stream.d.mts +46 -0
- package/dist/esm/core/stream/Stream.mjs +164 -0
- package/dist/esm/core/stream/index.d.mts +1 -0
- package/dist/esm/core/stream/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +843 -181
- /package/dist/cjs/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.js → ChrtGptReq.js} +0 -0
- /package/dist/cjs/api/{types/ChrtGptMessageRes.js → resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.js} +0 -0
- /package/dist/esm/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.mjs → ChrtGptReq.mjs} +0 -0
- /package/dist/esm/api/{types/ChrtGptMessageRes.mjs → resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.mjs} +0 -0
|
@@ -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";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Last event of a successful stream.
|
|
6
|
+
*/
|
|
7
|
+
export interface ChrtGptCompletedEvent {
|
|
8
|
+
conversation_id: string;
|
|
9
|
+
/** The turn's final message. Earlier messages in the turn only arrive as text deltas. */
|
|
10
|
+
response_text: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface ChrtGptConversation1 {
|
|
5
|
+
_id: string;
|
|
6
|
+
created_at: string;
|
|
7
|
+
/** Must be a string starting with `org_` */
|
|
8
|
+
org_id: string;
|
|
9
|
+
schema_version: number;
|
|
10
|
+
title: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
/** Must be a string starting with `user_` */
|
|
13
|
+
user_id: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
5
|
+
export interface ChrtGptConversationRes {
|
|
6
|
+
conversation: Chrt.ChrtGptConversation1;
|
|
7
|
+
/** The conversation's history, oldest first. Reasoning is omitted. */
|
|
8
|
+
items: Chrt.ChrtGptHistoryItem[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export type ChrtGptConversationSortByEnum = "updated_at" | "created_at";
|
|
5
|
+
export declare const ChrtGptConversationSortByEnum: {
|
|
6
|
+
readonly UpdatedAt: "updated_at";
|
|
7
|
+
readonly CreatedAt: "created_at";
|
|
8
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
5
|
+
export type ChrtGptEvent = Chrt.ChrtGptEvent.Completed | Chrt.ChrtGptEvent.Error_ | Chrt.ChrtGptEvent.Started | Chrt.ChrtGptEvent.TextDelta | Chrt.ChrtGptEvent.Title | Chrt.ChrtGptEvent.ToolCalled | Chrt.ChrtGptEvent.ToolOutput | Chrt.ChrtGptEvent.WebSearch;
|
|
6
|
+
export declare namespace ChrtGptEvent {
|
|
7
|
+
interface Completed extends Chrt.ChrtGptCompletedEvent {
|
|
8
|
+
type: "completed";
|
|
9
|
+
}
|
|
10
|
+
interface Error_ extends Chrt.ChrtGptErrorEvent {
|
|
11
|
+
type: "error";
|
|
12
|
+
}
|
|
13
|
+
interface Started extends Chrt.ChrtGptStartedEvent {
|
|
14
|
+
type: "started";
|
|
15
|
+
}
|
|
16
|
+
interface TextDelta extends Chrt.ChrtGptTextDeltaEvent {
|
|
17
|
+
type: "text_delta";
|
|
18
|
+
}
|
|
19
|
+
interface Title extends Chrt.ChrtGptTitleEvent {
|
|
20
|
+
type: "title";
|
|
21
|
+
}
|
|
22
|
+
interface ToolCalled extends Chrt.ChrtGptToolCalledEvent {
|
|
23
|
+
type: "tool_called";
|
|
24
|
+
}
|
|
25
|
+
interface ToolOutput extends Chrt.ChrtGptToolOutputEvent {
|
|
26
|
+
type: "tool_output";
|
|
27
|
+
}
|
|
28
|
+
interface WebSearch extends Chrt.ChrtGptWebSearchEvent {
|
|
29
|
+
type: "web_search";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
5
|
+
export type ChrtGptHistoryItem = Chrt.ChrtGptHistoryItem.AssistantMessage | Chrt.ChrtGptHistoryItem.ToolCalled | Chrt.ChrtGptHistoryItem.ToolOutput | Chrt.ChrtGptHistoryItem.UserMessage | Chrt.ChrtGptHistoryItem.WebSearch;
|
|
6
|
+
export declare namespace ChrtGptHistoryItem {
|
|
7
|
+
interface AssistantMessage extends Chrt.ChrtGptAssistantMessageItem {
|
|
8
|
+
type: "assistant_message";
|
|
9
|
+
}
|
|
10
|
+
interface ToolCalled extends Chrt.ChrtGptToolCalledEvent {
|
|
11
|
+
type: "tool_called";
|
|
12
|
+
}
|
|
13
|
+
interface ToolOutput extends Chrt.ChrtGptToolOutputEvent {
|
|
14
|
+
type: "tool_output";
|
|
15
|
+
}
|
|
16
|
+
interface UserMessage extends Chrt.ChrtGptUserMessageItem {
|
|
17
|
+
type: "user_message";
|
|
18
|
+
}
|
|
19
|
+
interface WebSearch extends Chrt.ChrtGptWebSearchEvent {
|
|
20
|
+
type: "web_search";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Sent once, on a new conversation's first turn, right before completed or error.
|
|
6
|
+
*/
|
|
7
|
+
export interface ChrtGptTitleEvent {
|
|
8
|
+
conversation_id: string;
|
|
9
|
+
/** The conversation's saved title. */
|
|
10
|
+
title: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* ChrtGPT called a chrt-mcp tool; its tool_output event follows.
|
|
6
|
+
*/
|
|
7
|
+
export interface ChrtGptToolCalledEvent {
|
|
8
|
+
/** JSON-encoded tool arguments. */
|
|
9
|
+
arguments: string;
|
|
10
|
+
call_id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface ChrtGptToolOutputEvent {
|
|
5
|
+
/** The call_id of the tool_called event. */
|
|
6
|
+
call_id: string;
|
|
7
|
+
/** Text of the tool result: the tool's JSON output or an error message. */
|
|
8
|
+
output: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* OpenAI ran a web search for ChrtGPT; it has no tool_output event.
|
|
7
|
+
*/
|
|
8
|
+
export interface ChrtGptWebSearchEvent {
|
|
9
|
+
action: ChrtGptWebSearchEvent.Action;
|
|
10
|
+
item_id: string;
|
|
11
|
+
/** What was searched for, on the web or within a page. OpenAI omits it on some searches. */
|
|
12
|
+
queries: string[];
|
|
13
|
+
/** The page opened or searched within. */
|
|
14
|
+
url?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare namespace ChrtGptWebSearchEvent {
|
|
17
|
+
type Action = Chrt.ChrtGroundProviderTaskActionEnum1 | Chrt.CargoOnFlightTaskActionEnum1 | Chrt.OnboardCourierTaskActionEnum1;
|
|
18
|
+
}
|
|
@@ -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
|
+
}
|