@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.
Files changed (205) hide show
  1. package/README.md +12 -9
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/chrtGpt/client/Client.d.ts +6 -13
  4. package/dist/cjs/api/resources/chrtGpt/client/Client.js +24 -17
  5. package/dist/cjs/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.d.ts → ChrtGptReq.d.ts} +1 -1
  6. package/dist/cjs/api/resources/chrtGpt/client/requests/index.d.ts +1 -1
  7. package/dist/cjs/api/resources/chrtGpt/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/chrtGpt/index.js +1 -0
  9. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.d.ts +65 -0
  10. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/Client.js +205 -0
  11. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/index.d.ts +2 -0
  12. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/index.js +17 -0
  13. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.d.ts +21 -0
  14. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/chrtGpt/resources/conversations/client/requests/index.js +2 -0
  16. package/dist/cjs/api/resources/chrtGpt/resources/conversations/index.d.ts +1 -0
  17. package/dist/cjs/api/resources/chrtGpt/resources/conversations/index.js +17 -0
  18. package/dist/cjs/api/resources/chrtGpt/resources/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/chrtGpt/resources/index.js +41 -0
  20. package/dist/cjs/api/resources/orgs/resources/connections/client/Client.d.ts +18 -1
  21. package/dist/cjs/api/resources/orgs/resources/connections/client/Client.js +75 -6
  22. package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ConnectionsListShippersForCoordinatorV1Request.d.ts +4 -1
  23. package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.d.ts +12 -0
  24. package/dist/cjs/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.js +5 -0
  25. package/dist/cjs/api/resources/orgs/resources/connections/client/requests/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.d.ts +3 -0
  27. package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.js +5 -0
  28. package/dist/cjs/api/resources/orgs/resources/publicData/index.d.ts +1 -0
  29. package/dist/cjs/api/resources/orgs/resources/publicData/index.js +1 -0
  30. package/dist/cjs/api/resources/orgs/resources/publicData/resources/index.d.ts +2 -0
  31. package/dist/cjs/api/resources/orgs/resources/publicData/resources/index.js +41 -0
  32. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.d.ts +86 -0
  33. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.js +319 -0
  34. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/index.d.ts +2 -0
  35. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/index.js +17 -0
  36. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.d.ts +13 -0
  37. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.js +5 -0
  38. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.js +2 -0
  40. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/orgs/resources/publicData/resources/s3Object/index.js +17 -0
  42. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.d.ts +47 -1
  43. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +195 -1
  44. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.d.ts +12 -0
  45. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.js +5 -0
  46. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.d.ts +14 -0
  47. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.js +5 -0
  48. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.d.ts +12 -0
  49. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.js +5 -0
  50. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/index.d.ts +3 -0
  51. package/dist/cjs/api/types/ChrtGptAssistantMessageItem.d.ts +8 -0
  52. package/dist/cjs/api/types/ChrtGptAssistantMessageItem.js +5 -0
  53. package/dist/cjs/api/types/ChrtGptCompletedEvent.d.ts +11 -0
  54. package/dist/cjs/api/types/ChrtGptCompletedEvent.js +5 -0
  55. package/dist/cjs/api/types/ChrtGptConversation1.d.ts +14 -0
  56. package/dist/cjs/api/types/ChrtGptConversation1.js +5 -0
  57. package/dist/cjs/api/types/ChrtGptConversationListRes.d.ts +8 -0
  58. package/dist/cjs/api/types/ChrtGptConversationListRes.js +5 -0
  59. package/dist/cjs/api/types/ChrtGptConversationRes.d.ts +9 -0
  60. package/dist/cjs/api/types/ChrtGptConversationRes.js +5 -0
  61. package/dist/cjs/api/types/ChrtGptConversationSortByEnum.d.ts +8 -0
  62. package/dist/cjs/api/types/ChrtGptConversationSortByEnum.js +10 -0
  63. package/dist/cjs/api/types/ChrtGptErrorEvent.d.ts +9 -0
  64. package/dist/cjs/api/types/ChrtGptErrorEvent.js +5 -0
  65. package/dist/cjs/api/types/ChrtGptEvent.d.ts +31 -0
  66. package/dist/cjs/api/types/ChrtGptEvent.js +5 -0
  67. package/dist/cjs/api/types/ChrtGptHistoryItem.d.ts +22 -0
  68. package/dist/cjs/api/types/ChrtGptHistoryItem.js +5 -0
  69. package/dist/{esm/api/types/ChrtGptMessageRes.d.mts → cjs/api/types/ChrtGptStartedEvent.d.ts} +4 -2
  70. package/dist/cjs/api/types/ChrtGptStartedEvent.js +5 -0
  71. package/dist/cjs/api/types/ChrtGptTextDeltaEvent.d.ts +8 -0
  72. package/dist/cjs/api/types/ChrtGptTextDeltaEvent.js +5 -0
  73. package/dist/cjs/api/types/ChrtGptTitleEvent.d.ts +11 -0
  74. package/dist/cjs/api/types/ChrtGptTitleEvent.js +5 -0
  75. package/dist/cjs/api/types/ChrtGptToolCalledEvent.d.ts +12 -0
  76. package/dist/cjs/api/types/ChrtGptToolCalledEvent.js +5 -0
  77. package/dist/cjs/api/types/ChrtGptToolOutputEvent.d.ts +9 -0
  78. package/dist/cjs/api/types/ChrtGptToolOutputEvent.js +5 -0
  79. package/dist/cjs/api/types/ChrtGptUserMessageItem.d.ts +6 -0
  80. package/dist/cjs/api/types/ChrtGptUserMessageItem.js +5 -0
  81. package/dist/cjs/api/types/ChrtGptWebSearchEvent.d.ts +18 -0
  82. package/dist/cjs/api/types/ChrtGptWebSearchEvent.js +5 -0
  83. package/dist/cjs/api/types/DeviceForCargoRes.d.ts +17 -0
  84. package/dist/cjs/api/types/DeviceForCargoRes.js +5 -0
  85. package/dist/cjs/api/types/OrgPublicData1.d.ts +1 -0
  86. package/dist/cjs/api/types/OrgPublicDataS3ObjectMetadata1.d.ts +21 -0
  87. package/dist/cjs/api/types/OrgPublicDataS3ObjectMetadata1.js +5 -0
  88. package/dist/cjs/api/types/ShipperCoordinatorConnection1.d.ts +4 -0
  89. package/dist/cjs/api/types/SpecialHandlingCodeEnum1.d.ts +63 -1
  90. package/dist/cjs/api/types/SpecialHandlingCodeEnum1.js +62 -0
  91. package/dist/cjs/api/types/index.d.ts +18 -1
  92. package/dist/cjs/api/types/index.js +18 -1
  93. package/dist/cjs/core/index.d.ts +1 -0
  94. package/dist/cjs/core/index.js +1 -0
  95. package/dist/cjs/core/stream/Stream.d.ts +46 -0
  96. package/dist/cjs/core/stream/Stream.js +169 -0
  97. package/dist/cjs/core/stream/index.d.ts +1 -0
  98. package/dist/cjs/core/stream/index.js +5 -0
  99. package/dist/cjs/version.d.ts +1 -1
  100. package/dist/cjs/version.js +1 -1
  101. package/dist/esm/Client.mjs +2 -2
  102. package/dist/esm/api/resources/chrtGpt/client/Client.d.mts +6 -13
  103. package/dist/esm/api/resources/chrtGpt/client/Client.mjs +24 -17
  104. package/dist/esm/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.d.mts → ChrtGptReq.d.mts} +1 -1
  105. package/dist/esm/api/resources/chrtGpt/client/requests/index.d.mts +1 -1
  106. package/dist/esm/api/resources/chrtGpt/index.d.mts +1 -0
  107. package/dist/esm/api/resources/chrtGpt/index.mjs +1 -0
  108. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.d.mts +65 -0
  109. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/Client.mjs +168 -0
  110. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/index.d.mts +2 -0
  111. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/index.mjs +1 -0
  112. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.d.mts +21 -0
  113. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.d.mts +1 -0
  114. package/dist/esm/api/resources/chrtGpt/resources/conversations/client/requests/index.mjs +1 -0
  115. package/dist/esm/api/resources/chrtGpt/resources/conversations/index.d.mts +1 -0
  116. package/dist/esm/api/resources/chrtGpt/resources/conversations/index.mjs +1 -0
  117. package/dist/esm/api/resources/chrtGpt/resources/index.d.mts +2 -0
  118. package/dist/esm/api/resources/chrtGpt/resources/index.mjs +2 -0
  119. package/dist/esm/api/resources/orgs/resources/connections/client/Client.d.mts +18 -1
  120. package/dist/esm/api/resources/orgs/resources/connections/client/Client.mjs +75 -6
  121. package/dist/esm/api/resources/orgs/resources/connections/client/requests/ConnectionsListShippersForCoordinatorV1Request.d.mts +4 -1
  122. package/dist/esm/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.d.mts +12 -0
  123. package/dist/esm/api/resources/orgs/resources/connections/client/requests/ShipperCoordinatorUpdateKnownShipperReq.mjs +4 -0
  124. package/dist/esm/api/resources/orgs/resources/connections/client/requests/index.d.mts +1 -0
  125. package/dist/esm/api/resources/orgs/resources/publicData/client/Client.d.mts +3 -0
  126. package/dist/esm/api/resources/orgs/resources/publicData/client/Client.mjs +5 -0
  127. package/dist/esm/api/resources/orgs/resources/publicData/index.d.mts +1 -0
  128. package/dist/esm/api/resources/orgs/resources/publicData/index.mjs +1 -0
  129. package/dist/esm/api/resources/orgs/resources/publicData/resources/index.d.mts +2 -0
  130. package/dist/esm/api/resources/orgs/resources/publicData/resources/index.mjs +2 -0
  131. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.d.mts +86 -0
  132. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/Client.mjs +282 -0
  133. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/index.d.mts +2 -0
  134. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/index.mjs +1 -0
  135. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.d.mts +13 -0
  136. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/BodyPostOrgPublicDataS3ObjectAddV1.mjs +4 -0
  137. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.d.mts +1 -0
  138. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/client/requests/index.mjs +1 -0
  139. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/index.d.mts +1 -0
  140. package/dist/esm/api/resources/orgs/resources/publicData/resources/s3Object/index.mjs +1 -0
  141. package/dist/esm/api/resources/tracking/resources/devices/client/Client.d.mts +47 -1
  142. package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +195 -1
  143. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.d.mts +12 -0
  144. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesForCargoV1Request.mjs +4 -0
  145. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.d.mts +14 -0
  146. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoV1Request.mjs +4 -0
  147. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.d.mts +12 -0
  148. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoV1Request.mjs +4 -0
  149. package/dist/esm/api/resources/tracking/resources/devices/client/requests/index.d.mts +3 -0
  150. package/dist/esm/api/types/ChrtGptAssistantMessageItem.d.mts +8 -0
  151. package/dist/esm/api/types/ChrtGptAssistantMessageItem.mjs +4 -0
  152. package/dist/esm/api/types/ChrtGptCompletedEvent.d.mts +11 -0
  153. package/dist/esm/api/types/ChrtGptCompletedEvent.mjs +4 -0
  154. package/dist/esm/api/types/ChrtGptConversation1.d.mts +14 -0
  155. package/dist/esm/api/types/ChrtGptConversation1.mjs +4 -0
  156. package/dist/esm/api/types/ChrtGptConversationListRes.d.mts +8 -0
  157. package/dist/esm/api/types/ChrtGptConversationListRes.mjs +4 -0
  158. package/dist/esm/api/types/ChrtGptConversationRes.d.mts +9 -0
  159. package/dist/esm/api/types/ChrtGptConversationRes.mjs +4 -0
  160. package/dist/esm/api/types/ChrtGptConversationSortByEnum.d.mts +8 -0
  161. package/dist/esm/api/types/ChrtGptConversationSortByEnum.mjs +7 -0
  162. package/dist/esm/api/types/ChrtGptErrorEvent.d.mts +9 -0
  163. package/dist/esm/api/types/ChrtGptErrorEvent.mjs +4 -0
  164. package/dist/esm/api/types/ChrtGptEvent.d.mts +31 -0
  165. package/dist/esm/api/types/ChrtGptEvent.mjs +4 -0
  166. package/dist/esm/api/types/ChrtGptHistoryItem.d.mts +22 -0
  167. package/dist/esm/api/types/ChrtGptHistoryItem.mjs +4 -0
  168. package/dist/{cjs/api/types/ChrtGptMessageRes.d.ts → esm/api/types/ChrtGptStartedEvent.d.mts} +4 -2
  169. package/dist/esm/api/types/ChrtGptStartedEvent.mjs +4 -0
  170. package/dist/esm/api/types/ChrtGptTextDeltaEvent.d.mts +8 -0
  171. package/dist/esm/api/types/ChrtGptTextDeltaEvent.mjs +4 -0
  172. package/dist/esm/api/types/ChrtGptTitleEvent.d.mts +11 -0
  173. package/dist/esm/api/types/ChrtGptTitleEvent.mjs +4 -0
  174. package/dist/esm/api/types/ChrtGptToolCalledEvent.d.mts +12 -0
  175. package/dist/esm/api/types/ChrtGptToolCalledEvent.mjs +4 -0
  176. package/dist/esm/api/types/ChrtGptToolOutputEvent.d.mts +9 -0
  177. package/dist/esm/api/types/ChrtGptToolOutputEvent.mjs +4 -0
  178. package/dist/esm/api/types/ChrtGptUserMessageItem.d.mts +6 -0
  179. package/dist/esm/api/types/ChrtGptUserMessageItem.mjs +4 -0
  180. package/dist/esm/api/types/ChrtGptWebSearchEvent.d.mts +18 -0
  181. package/dist/esm/api/types/ChrtGptWebSearchEvent.mjs +4 -0
  182. package/dist/esm/api/types/DeviceForCargoRes.d.mts +17 -0
  183. package/dist/esm/api/types/DeviceForCargoRes.mjs +4 -0
  184. package/dist/esm/api/types/OrgPublicData1.d.mts +1 -0
  185. package/dist/esm/api/types/OrgPublicDataS3ObjectMetadata1.d.mts +21 -0
  186. package/dist/esm/api/types/OrgPublicDataS3ObjectMetadata1.mjs +4 -0
  187. package/dist/esm/api/types/ShipperCoordinatorConnection1.d.mts +4 -0
  188. package/dist/esm/api/types/SpecialHandlingCodeEnum1.d.mts +63 -1
  189. package/dist/esm/api/types/SpecialHandlingCodeEnum1.mjs +62 -0
  190. package/dist/esm/api/types/index.d.mts +18 -1
  191. package/dist/esm/api/types/index.mjs +18 -1
  192. package/dist/esm/core/index.d.mts +1 -0
  193. package/dist/esm/core/index.mjs +1 -0
  194. package/dist/esm/core/stream/Stream.d.mts +46 -0
  195. package/dist/esm/core/stream/Stream.mjs +164 -0
  196. package/dist/esm/core/stream/index.d.mts +1 -0
  197. package/dist/esm/core/stream/index.mjs +1 -0
  198. package/dist/esm/version.d.mts +1 -1
  199. package/dist/esm/version.mjs +1 -1
  200. package/package.json +1 -1
  201. package/reference.md +843 -181
  202. /package/dist/cjs/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.js → ChrtGptReq.js} +0 -0
  203. /package/dist/cjs/api/{types/ChrtGptMessageRes.js → resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.js} +0 -0
  204. /package/dist/esm/api/resources/chrtGpt/client/requests/{ChrtGptMessageReq.mjs → ChrtGptReq.mjs} +0 -0
  205. /package/dist/esm/api/{types/ChrtGptMessageRes.mjs → resources/chrtGpt/resources/conversations/client/requests/ConversationsListV1Request.mjs} +0 -0
@@ -67,7 +67,7 @@ class Devices {
67
67
  this._options = _options;
68
68
  }
69
69
  /**
70
- * Archives a device by setting archived=True. Device must not have an active session — terminate it first. | auth: api_key | () -> (bool)
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,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * cargo_id: "cargo_id"
8
+ * }
9
+ */
10
+ export interface DevicesForCargoV1Request {
11
+ cargo_id: string;
12
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * device_id: "device_id"
8
+ * }
9
+ */
10
+ export interface DevicesUnlinkFromCargoV1Request {
11
+ device_id: string;
12
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ChrtGptAssistantMessageItem {
5
+ /** Matches the item_id of the text_delta events that streamed it. */
6
+ item_id: string;
7
+ text: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.js";
5
+ export interface ChrtGptConversationListRes {
6
+ items: Chrt.ChrtGptConversation1[];
7
+ total_count: number;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.js";
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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,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.ChrtGptConversationSortByEnum = void 0;
7
+ exports.ChrtGptConversationSortByEnum = {
8
+ UpdatedAt: "updated_at",
9
+ CreatedAt: "created_at",
10
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Last event of a failed stream.
6
+ */
7
+ export interface ChrtGptErrorEvent {
8
+ message: string;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.js";
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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.js";
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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export interface ChrtGptMessageRes {
4
+ /**
5
+ * First event of every stream.
6
+ */
7
+ export interface ChrtGptStartedEvent {
5
8
  conversation_id: string;
6
- response_text: string;
7
9
  }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ChrtGptTextDeltaEvent {
5
+ delta: string;
6
+ /** The assistant message this delta belongs to; a turn can have several. */
7
+ item_id: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ChrtGptUserMessageItem {
5
+ text: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.js";
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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });