@chrt-inc/typescript-sdk 0.231.0 → 1.254.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 (190) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/tracking/client/Client.d.ts +12 -0
  3. package/dist/cjs/api/resources/tracking/client/Client.js +24 -4
  4. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/Client.d.ts +48 -0
  5. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/Client.js +136 -0
  6. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/index.d.ts +2 -0
  7. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/index.js +17 -0
  8. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/requests/CargoByDeviceLastSeenRequest.d.ts +14 -0
  9. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/requests/index.d.ts +1 -0
  10. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/requests/index.js +2 -0
  11. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/tracking/resources/cargoByDevice/index.js +17 -0
  13. package/dist/cjs/api/resources/tracking/resources/cargoByDriver/client/Client.d.ts +1 -20
  14. package/dist/cjs/api/resources/tracking/resources/cargoByDriver/client/Client.js +1 -67
  15. package/dist/cjs/api/resources/tracking/resources/cargoByDriver/client/requests/index.d.ts +0 -1
  16. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.d.ts +103 -0
  17. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +371 -0
  18. package/dist/cjs/api/resources/tracking/resources/devices/client/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/tracking/resources/devices/client/index.js +17 -0
  20. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesGetRequest.d.ts +12 -0
  21. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoRequest.d.ts +14 -0
  22. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoRequest.js +5 -0
  23. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesRegisterToOrgRequest.d.ts +12 -0
  24. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesRegisterToOrgRequest.js +5 -0
  25. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoRequest.d.ts +12 -0
  26. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoRequest.js +5 -0
  27. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/index.d.ts +4 -0
  28. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/index.js +2 -0
  29. package/dist/cjs/api/resources/tracking/resources/devices/index.d.ts +1 -0
  30. package/dist/cjs/api/resources/tracking/resources/devices/index.js +17 -0
  31. package/dist/cjs/api/resources/tracking/resources/driver/client/Client.d.ts +51 -0
  32. package/dist/cjs/api/resources/tracking/resources/driver/client/Client.js +134 -0
  33. package/dist/cjs/api/resources/tracking/resources/driver/client/index.d.ts +2 -0
  34. package/dist/cjs/api/resources/tracking/resources/driver/client/index.js +17 -0
  35. package/dist/cjs/api/resources/tracking/resources/{cargoByDriver/client/requests/CargoByDriverUpdateReq.d.ts → driver/client/requests/DriverUpdateReq.d.ts} +1 -1
  36. package/dist/cjs/api/resources/tracking/resources/driver/client/requests/DriverUpdateReq.js +5 -0
  37. package/dist/cjs/api/resources/tracking/resources/driver/client/requests/index.d.ts +1 -0
  38. package/dist/cjs/api/resources/tracking/resources/driver/client/requests/index.js +2 -0
  39. package/dist/cjs/api/resources/tracking/resources/driver/index.d.ts +1 -0
  40. package/dist/cjs/api/resources/tracking/resources/driver/index.js +17 -0
  41. package/dist/cjs/api/resources/tracking/resources/index.d.ts +8 -0
  42. package/dist/cjs/api/resources/tracking/resources/index.js +9 -1
  43. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.d.ts +167 -0
  44. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.js +648 -0
  45. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/index.d.ts +2 -0
  46. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/index.js +17 -0
  47. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceCreateSessionRequest1.d.ts +13 -0
  48. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceCreateSessionRequest1.js +5 -0
  49. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDataPointsFancyRequest.d.ts +13 -0
  50. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDataPointsFancyRequest.js +5 -0
  51. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDataPointsRequest.d.ts +13 -0
  52. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDataPointsRequest.js +5 -0
  53. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceEndSessionRequest.d.ts +12 -0
  54. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceEndSessionRequest.js +5 -0
  55. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceLastSeenRequest.d.ts +12 -0
  56. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceLastSeenRequest.js +5 -0
  57. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDevicePauseSessionRequest.d.ts +12 -0
  58. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDevicePauseSessionRequest.js +5 -0
  59. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceResumeSessionRequest.d.ts +12 -0
  60. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceResumeSessionRequest.js +5 -0
  61. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceStartSessionRequest.d.ts +12 -0
  62. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceStartSessionRequest.js +5 -0
  63. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceUpdateCommentsRequest1.d.ts +14 -0
  64. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceUpdateCommentsRequest1.js +5 -0
  65. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/index.d.ts +9 -0
  66. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/index.js +2 -0
  67. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/index.d.ts +1 -0
  68. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/index.js +17 -0
  69. package/dist/cjs/api/resources/tracking/resources/taskGroupByDriver/client/Client.d.ts +1 -20
  70. package/dist/cjs/api/resources/tracking/resources/taskGroupByDriver/client/Client.js +1 -67
  71. package/dist/cjs/api/resources/tracking/resources/taskGroupByDriver/client/requests/index.d.ts +0 -1
  72. package/dist/cjs/api/types/Cargo1.d.ts +1 -1
  73. package/dist/cjs/api/types/DecodedJwtWithOrgAndUserId.d.ts +1 -1
  74. package/dist/cjs/api/types/Device1.d.ts +19 -0
  75. package/dist/cjs/api/types/Device1.js +5 -0
  76. package/dist/cjs/api/types/DriverUpdateResp.d.ts +11 -0
  77. package/dist/cjs/api/types/DriverUpdateResp.js +5 -0
  78. package/dist/cjs/api/types/TrackingCargoByDeviceDataPoint1.d.ts +12 -0
  79. package/dist/cjs/api/types/TrackingCargoByDeviceDataPoint1.js +5 -0
  80. package/dist/cjs/api/types/TrackingCargoByDeviceDataPointMetadata1.d.ts +8 -0
  81. package/dist/cjs/api/types/TrackingCargoByDeviceDataPointMetadata1.js +5 -0
  82. package/dist/cjs/api/types/TrackingDeviceTypeEnum1.d.ts +9 -0
  83. package/dist/cjs/api/types/TrackingDeviceTypeEnum1.js +11 -0
  84. package/dist/cjs/api/types/TrackingSessionByDeviceDataPoint1.d.ts +12 -0
  85. package/dist/cjs/api/types/TrackingSessionByDeviceDataPoint1.js +5 -0
  86. package/dist/cjs/api/types/TrackingSessionByDeviceDataPointMetadata1.d.ts +6 -0
  87. package/dist/cjs/api/types/TrackingSessionByDeviceDataPointMetadata1.js +5 -0
  88. package/dist/cjs/api/types/index.d.ts +7 -0
  89. package/dist/cjs/api/types/index.js +7 -0
  90. package/dist/cjs/version.d.ts +1 -1
  91. package/dist/cjs/version.js +1 -1
  92. package/dist/esm/Client.mjs +2 -2
  93. package/dist/esm/api/resources/tracking/client/Client.d.mts +12 -0
  94. package/dist/esm/api/resources/tracking/client/Client.mjs +20 -0
  95. package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/Client.d.mts +48 -0
  96. package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/Client.mjs +99 -0
  97. package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/index.d.mts +2 -0
  98. package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/index.mjs +1 -0
  99. package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/requests/CargoByDeviceLastSeenRequest.d.mts +14 -0
  100. package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/requests/index.d.mts +1 -0
  101. package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/requests/index.mjs +1 -0
  102. package/dist/esm/api/resources/tracking/resources/cargoByDevice/index.d.mts +1 -0
  103. package/dist/esm/api/resources/tracking/resources/cargoByDevice/index.mjs +1 -0
  104. package/dist/esm/api/resources/tracking/resources/cargoByDriver/client/Client.d.mts +1 -20
  105. package/dist/esm/api/resources/tracking/resources/cargoByDriver/client/Client.mjs +1 -67
  106. package/dist/esm/api/resources/tracking/resources/cargoByDriver/client/requests/index.d.mts +0 -1
  107. package/dist/esm/api/resources/tracking/resources/devices/client/Client.d.mts +103 -0
  108. package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +334 -0
  109. package/dist/esm/api/resources/tracking/resources/devices/client/index.d.mts +2 -0
  110. package/dist/esm/api/resources/tracking/resources/devices/client/index.mjs +1 -0
  111. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesGetRequest.d.mts +12 -0
  112. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoRequest.d.mts +14 -0
  113. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesLinkToCargoRequest.mjs +4 -0
  114. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesRegisterToOrgRequest.d.mts +12 -0
  115. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesRegisterToOrgRequest.mjs +4 -0
  116. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoRequest.d.mts +12 -0
  117. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUnlinkFromCargoRequest.mjs +4 -0
  118. package/dist/esm/api/resources/tracking/resources/devices/client/requests/index.d.mts +4 -0
  119. package/dist/esm/api/resources/tracking/resources/devices/client/requests/index.mjs +1 -0
  120. package/dist/esm/api/resources/tracking/resources/devices/index.d.mts +1 -0
  121. package/dist/esm/api/resources/tracking/resources/devices/index.mjs +1 -0
  122. package/dist/esm/api/resources/tracking/resources/driver/client/Client.d.mts +51 -0
  123. package/dist/esm/api/resources/tracking/resources/driver/client/Client.mjs +97 -0
  124. package/dist/esm/api/resources/tracking/resources/driver/client/index.d.mts +2 -0
  125. package/dist/esm/api/resources/tracking/resources/driver/client/index.mjs +1 -0
  126. package/dist/esm/api/resources/tracking/resources/{cargoByDriver/client/requests/CargoByDriverUpdateReq.d.mts → driver/client/requests/DriverUpdateReq.d.mts} +1 -1
  127. package/dist/esm/api/resources/tracking/resources/driver/client/requests/DriverUpdateReq.mjs +4 -0
  128. package/dist/esm/api/resources/tracking/resources/driver/client/requests/index.d.mts +1 -0
  129. package/dist/esm/api/resources/tracking/resources/driver/client/requests/index.mjs +1 -0
  130. package/dist/esm/api/resources/tracking/resources/driver/index.d.mts +1 -0
  131. package/dist/esm/api/resources/tracking/resources/driver/index.mjs +1 -0
  132. package/dist/esm/api/resources/tracking/resources/index.d.mts +8 -0
  133. package/dist/esm/api/resources/tracking/resources/index.mjs +8 -0
  134. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.d.mts +167 -0
  135. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.mjs +611 -0
  136. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/index.d.mts +2 -0
  137. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/index.mjs +1 -0
  138. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceCreateSessionRequest1.d.mts +13 -0
  139. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceCreateSessionRequest1.mjs +4 -0
  140. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDataPointsFancyRequest.d.mts +13 -0
  141. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDataPointsFancyRequest.mjs +4 -0
  142. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDataPointsRequest.d.mts +13 -0
  143. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDataPointsRequest.mjs +4 -0
  144. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceEndSessionRequest.d.mts +12 -0
  145. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceEndSessionRequest.mjs +4 -0
  146. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceLastSeenRequest.d.mts +12 -0
  147. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceLastSeenRequest.mjs +4 -0
  148. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDevicePauseSessionRequest.d.mts +12 -0
  149. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDevicePauseSessionRequest.mjs +4 -0
  150. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceResumeSessionRequest.d.mts +12 -0
  151. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceResumeSessionRequest.mjs +4 -0
  152. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceStartSessionRequest.d.mts +12 -0
  153. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceStartSessionRequest.mjs +4 -0
  154. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceUpdateCommentsRequest1.d.mts +14 -0
  155. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceUpdateCommentsRequest1.mjs +4 -0
  156. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/index.d.mts +9 -0
  157. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/index.mjs +1 -0
  158. package/dist/esm/api/resources/tracking/resources/sessionByDevice/index.d.mts +1 -0
  159. package/dist/esm/api/resources/tracking/resources/sessionByDevice/index.mjs +1 -0
  160. package/dist/esm/api/resources/tracking/resources/taskGroupByDriver/client/Client.d.mts +1 -20
  161. package/dist/esm/api/resources/tracking/resources/taskGroupByDriver/client/Client.mjs +1 -67
  162. package/dist/esm/api/resources/tracking/resources/taskGroupByDriver/client/requests/index.d.mts +0 -1
  163. package/dist/esm/api/types/Cargo1.d.mts +1 -1
  164. package/dist/esm/api/types/DecodedJwtWithOrgAndUserId.d.mts +1 -1
  165. package/dist/esm/api/types/Device1.d.mts +19 -0
  166. package/dist/esm/api/types/Device1.mjs +4 -0
  167. package/dist/esm/api/types/DriverUpdateResp.d.mts +11 -0
  168. package/dist/esm/api/types/DriverUpdateResp.mjs +4 -0
  169. package/dist/esm/api/types/TrackingCargoByDeviceDataPoint1.d.mts +12 -0
  170. package/dist/esm/api/types/TrackingCargoByDeviceDataPoint1.mjs +4 -0
  171. package/dist/esm/api/types/TrackingCargoByDeviceDataPointMetadata1.d.mts +8 -0
  172. package/dist/esm/api/types/TrackingCargoByDeviceDataPointMetadata1.mjs +4 -0
  173. package/dist/esm/api/types/TrackingDeviceTypeEnum1.d.mts +9 -0
  174. package/dist/esm/api/types/TrackingDeviceTypeEnum1.mjs +8 -0
  175. package/dist/esm/api/types/TrackingSessionByDeviceDataPoint1.d.mts +12 -0
  176. package/dist/esm/api/types/TrackingSessionByDeviceDataPoint1.mjs +4 -0
  177. package/dist/esm/api/types/TrackingSessionByDeviceDataPointMetadata1.d.mts +6 -0
  178. package/dist/esm/api/types/TrackingSessionByDeviceDataPointMetadata1.mjs +4 -0
  179. package/dist/esm/api/types/index.d.mts +7 -0
  180. package/dist/esm/api/types/index.mjs +7 -0
  181. package/dist/esm/version.d.mts +1 -1
  182. package/dist/esm/version.mjs +1 -1
  183. package/package.json +1 -1
  184. package/reference.md +929 -23
  185. package/dist/cjs/api/resources/tracking/resources/taskGroupByDriver/client/requests/TaskGroupByDriverUpdateReq.d.ts +0 -19
  186. package/dist/esm/api/resources/tracking/resources/taskGroupByDriver/client/requests/TaskGroupByDriverUpdateReq.d.mts +0 -19
  187. /package/dist/cjs/api/resources/tracking/resources/{cargoByDriver/client/requests/CargoByDriverUpdateReq.js → cargoByDevice/client/requests/CargoByDeviceLastSeenRequest.js} +0 -0
  188. /package/dist/cjs/api/resources/tracking/resources/{taskGroupByDriver/client/requests/TaskGroupByDriverUpdateReq.js → devices/client/requests/DevicesGetRequest.js} +0 -0
  189. /package/dist/esm/api/resources/tracking/resources/{cargoByDriver/client/requests/CargoByDriverUpdateReq.mjs → cargoByDevice/client/requests/CargoByDeviceLastSeenRequest.mjs} +0 -0
  190. /package/dist/esm/api/resources/tracking/resources/{taskGroupByDriver/client/requests/TaskGroupByDriverUpdateReq.mjs → devices/client/requests/DevicesGetRequest.mjs} +0 -0
@@ -0,0 +1,334 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../../../environments.mjs";
14
+ import * as core from "../../../../../../core/index.mjs";
15
+ import * as Chrt from "../../../../../index.mjs";
16
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
17
+ import * as errors from "../../../../../../errors/index.mjs";
18
+ export class Devices {
19
+ constructor(_options = {}) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * Register a device to the caller's org.
24
+ *
25
+ * @param {Chrt.tracking.DevicesRegisterToOrgRequest} request
26
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link Chrt.UnprocessableEntityError}
29
+ *
30
+ * @example
31
+ * await client.tracking.devices.registerToOrg({
32
+ * device_mac_address: "device_mac_address"
33
+ * })
34
+ */
35
+ registerToOrg(request, requestOptions) {
36
+ return core.HttpResponsePromise.fromPromise(this.__registerToOrg(request, requestOptions));
37
+ }
38
+ __registerToOrg(request, requestOptions) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ var _a, _b, _c, _d;
41
+ const { device_mac_address: deviceMacAddress } = request;
42
+ const _queryParams = {};
43
+ _queryParams["device_mac_address"] = deviceMacAddress;
44
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
45
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "tracking/devices/register_to_org"),
46
+ method: "POST",
47
+ headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
48
+ queryParameters: _queryParams,
49
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
50
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
51
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
52
+ });
53
+ if (_response.ok) {
54
+ return { data: _response.body, rawResponse: _response.rawResponse };
55
+ }
56
+ if (_response.error.reason === "status-code") {
57
+ switch (_response.error.statusCode) {
58
+ case 422:
59
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
60
+ default:
61
+ throw new errors.ChrtError({
62
+ statusCode: _response.error.statusCode,
63
+ body: _response.error.body,
64
+ rawResponse: _response.rawResponse,
65
+ });
66
+ }
67
+ }
68
+ switch (_response.error.reason) {
69
+ case "non-json":
70
+ throw new errors.ChrtError({
71
+ statusCode: _response.error.statusCode,
72
+ body: _response.error.rawBody,
73
+ rawResponse: _response.rawResponse,
74
+ });
75
+ case "timeout":
76
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/register_to_org.");
77
+ case "unknown":
78
+ throw new errors.ChrtError({
79
+ message: _response.error.errorMessage,
80
+ rawResponse: _response.rawResponse,
81
+ });
82
+ }
83
+ });
84
+ }
85
+ /**
86
+ * Get a device by device_mac_address.
87
+ *
88
+ * @param {Chrt.tracking.DevicesGetRequest} request
89
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
90
+ *
91
+ * @throws {@link Chrt.UnprocessableEntityError}
92
+ *
93
+ * @example
94
+ * await client.tracking.devices.get({
95
+ * device_mac_address: "device_mac_address"
96
+ * })
97
+ */
98
+ get(request, requestOptions) {
99
+ return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
100
+ }
101
+ __get(request, requestOptions) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ var _a, _b, _c, _d;
104
+ const { device_mac_address: deviceMacAddress } = request;
105
+ const _queryParams = {};
106
+ _queryParams["device_mac_address"] = deviceMacAddress;
107
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
108
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "tracking/devices"),
109
+ method: "GET",
110
+ headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
111
+ queryParameters: _queryParams,
112
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
113
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
114
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
115
+ });
116
+ if (_response.ok) {
117
+ return { data: _response.body, rawResponse: _response.rawResponse };
118
+ }
119
+ if (_response.error.reason === "status-code") {
120
+ switch (_response.error.statusCode) {
121
+ case 422:
122
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
123
+ default:
124
+ throw new errors.ChrtError({
125
+ statusCode: _response.error.statusCode,
126
+ body: _response.error.body,
127
+ rawResponse: _response.rawResponse,
128
+ });
129
+ }
130
+ }
131
+ switch (_response.error.reason) {
132
+ case "non-json":
133
+ throw new errors.ChrtError({
134
+ statusCode: _response.error.statusCode,
135
+ body: _response.error.rawBody,
136
+ rawResponse: _response.rawResponse,
137
+ });
138
+ case "timeout":
139
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices.");
140
+ case "unknown":
141
+ throw new errors.ChrtError({
142
+ message: _response.error.errorMessage,
143
+ rawResponse: _response.rawResponse,
144
+ });
145
+ }
146
+ });
147
+ }
148
+ /**
149
+ * List all devices registered to the caller's org.
150
+ *
151
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
152
+ *
153
+ * @example
154
+ * await client.tracking.devices.list()
155
+ */
156
+ list(requestOptions) {
157
+ return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
158
+ }
159
+ __list(requestOptions) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ var _a, _b, _c, _d;
162
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
163
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "tracking/devices/list"),
164
+ method: "GET",
165
+ headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
166
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
167
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
168
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
169
+ });
170
+ if (_response.ok) {
171
+ return { data: _response.body, rawResponse: _response.rawResponse };
172
+ }
173
+ if (_response.error.reason === "status-code") {
174
+ throw new errors.ChrtError({
175
+ statusCode: _response.error.statusCode,
176
+ body: _response.error.body,
177
+ rawResponse: _response.rawResponse,
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/list.");
189
+ case "unknown":
190
+ throw new errors.ChrtError({
191
+ message: _response.error.errorMessage,
192
+ rawResponse: _response.rawResponse,
193
+ });
194
+ }
195
+ });
196
+ }
197
+ /**
198
+ * Link a device to a cargo (bidirectional references).
199
+ *
200
+ * @param {Chrt.tracking.DevicesLinkToCargoRequest} request
201
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
202
+ *
203
+ * @throws {@link Chrt.UnprocessableEntityError}
204
+ *
205
+ * @example
206
+ * await client.tracking.devices.linkToCargo({
207
+ * device_mac_address: "device_mac_address",
208
+ * cargo_id: "cargo_id"
209
+ * })
210
+ */
211
+ linkToCargo(request, requestOptions) {
212
+ return core.HttpResponsePromise.fromPromise(this.__linkToCargo(request, requestOptions));
213
+ }
214
+ __linkToCargo(request, requestOptions) {
215
+ return __awaiter(this, void 0, void 0, function* () {
216
+ var _a, _b, _c, _d;
217
+ const { device_mac_address: deviceMacAddress, cargo_id: cargoId } = request;
218
+ const _queryParams = {};
219
+ _queryParams["device_mac_address"] = deviceMacAddress;
220
+ _queryParams["cargo_id"] = cargoId;
221
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
222
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "tracking/devices/link_to_cargo"),
223
+ method: "POST",
224
+ headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
225
+ queryParameters: _queryParams,
226
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
227
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
228
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
229
+ });
230
+ if (_response.ok) {
231
+ return { data: _response.body, rawResponse: _response.rawResponse };
232
+ }
233
+ if (_response.error.reason === "status-code") {
234
+ switch (_response.error.statusCode) {
235
+ case 422:
236
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
237
+ default:
238
+ throw new errors.ChrtError({
239
+ statusCode: _response.error.statusCode,
240
+ body: _response.error.body,
241
+ rawResponse: _response.rawResponse,
242
+ });
243
+ }
244
+ }
245
+ switch (_response.error.reason) {
246
+ case "non-json":
247
+ throw new errors.ChrtError({
248
+ statusCode: _response.error.statusCode,
249
+ body: _response.error.rawBody,
250
+ rawResponse: _response.rawResponse,
251
+ });
252
+ case "timeout":
253
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/link_to_cargo.");
254
+ case "unknown":
255
+ throw new errors.ChrtError({
256
+ message: _response.error.errorMessage,
257
+ rawResponse: _response.rawResponse,
258
+ });
259
+ }
260
+ });
261
+ }
262
+ /**
263
+ * Unlink a device from its cargo if linked.
264
+ *
265
+ * @param {Chrt.tracking.DevicesUnlinkFromCargoRequest} request
266
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
267
+ *
268
+ * @throws {@link Chrt.UnprocessableEntityError}
269
+ *
270
+ * @example
271
+ * await client.tracking.devices.unlinkFromCargo({
272
+ * device_mac_address: "device_mac_address"
273
+ * })
274
+ */
275
+ unlinkFromCargo(request, requestOptions) {
276
+ return core.HttpResponsePromise.fromPromise(this.__unlinkFromCargo(request, requestOptions));
277
+ }
278
+ __unlinkFromCargo(request, requestOptions) {
279
+ return __awaiter(this, void 0, void 0, function* () {
280
+ var _a, _b, _c, _d;
281
+ const { device_mac_address: deviceMacAddress } = request;
282
+ const _queryParams = {};
283
+ _queryParams["device_mac_address"] = deviceMacAddress;
284
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
285
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "tracking/devices/unlink_from_cargo"),
286
+ method: "POST",
287
+ headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
288
+ queryParameters: _queryParams,
289
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
290
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
291
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
292
+ });
293
+ if (_response.ok) {
294
+ return { data: _response.body, rawResponse: _response.rawResponse };
295
+ }
296
+ if (_response.error.reason === "status-code") {
297
+ switch (_response.error.statusCode) {
298
+ case 422:
299
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
300
+ default:
301
+ throw new errors.ChrtError({
302
+ statusCode: _response.error.statusCode,
303
+ body: _response.error.body,
304
+ rawResponse: _response.rawResponse,
305
+ });
306
+ }
307
+ }
308
+ switch (_response.error.reason) {
309
+ case "non-json":
310
+ throw new errors.ChrtError({
311
+ statusCode: _response.error.statusCode,
312
+ body: _response.error.rawBody,
313
+ rawResponse: _response.rawResponse,
314
+ });
315
+ case "timeout":
316
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/unlink_from_cargo.");
317
+ case "unknown":
318
+ throw new errors.ChrtError({
319
+ message: _response.error.errorMessage,
320
+ rawResponse: _response.rawResponse,
321
+ });
322
+ }
323
+ });
324
+ }
325
+ _getAuthorizationHeader() {
326
+ return __awaiter(this, void 0, void 0, function* () {
327
+ const bearer = yield core.Supplier.get(this._options.token);
328
+ if (bearer != null) {
329
+ return `Bearer ${bearer}`;
330
+ }
331
+ return undefined;
332
+ });
333
+ }
334
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * device_mac_address: "device_mac_address"
8
+ * }
9
+ */
10
+ export interface DevicesGetRequest {
11
+ device_mac_address: string;
12
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * device_mac_address: "device_mac_address",
8
+ * cargo_id: "cargo_id"
9
+ * }
10
+ */
11
+ export interface DevicesLinkToCargoRequest {
12
+ device_mac_address: string;
13
+ cargo_id: string;
14
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * device_mac_address: "device_mac_address"
8
+ * }
9
+ */
10
+ export interface DevicesRegisterToOrgRequest {
11
+ device_mac_address: string;
12
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * device_mac_address: "device_mac_address"
8
+ * }
9
+ */
10
+ export interface DevicesUnlinkFromCargoRequest {
11
+ device_mac_address: string;
12
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,4 @@
1
+ export { type DevicesRegisterToOrgRequest } from "./DevicesRegisterToOrgRequest.mjs";
2
+ export { type DevicesGetRequest } from "./DevicesGetRequest.mjs";
3
+ export { type DevicesLinkToCargoRequest } from "./DevicesLinkToCargoRequest.mjs";
4
+ export { type DevicesUnlinkFromCargoRequest } from "./DevicesUnlinkFromCargoRequest.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1,51 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../environments.mjs";
5
+ import * as core from "../../../../../../core/index.mjs";
6
+ import * as Chrt from "../../../../../index.mjs";
7
+ export declare namespace Driver {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.ChrtEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ token?: core.Supplier<core.BearerToken | undefined>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
15
+ fetcher?: core.FetchFunction;
16
+ }
17
+ interface RequestOptions {
18
+ /** The maximum time to wait for a response in seconds. */
19
+ timeoutInSeconds?: number;
20
+ /** The number of times to retry the request. Defaults to 2. */
21
+ maxRetries?: number;
22
+ /** A hook to abort the request. */
23
+ abortSignal?: AbortSignal;
24
+ /** Additional headers to include in the request. */
25
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
26
+ }
27
+ }
28
+ export declare class Driver {
29
+ protected readonly _options: Driver.Options;
30
+ constructor(_options?: Driver.Options);
31
+ /**
32
+ * Unified endpoint for driver location updates. Automatically determines whether to update task group tracking (if IN_PROGRESS) and/or cargo tracking (if IN_TRANSIT) based on current states.
33
+ *
34
+ * @param {Chrt.tracking.DriverUpdateReq} request
35
+ * @param {Driver.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link Chrt.UnprocessableEntityError}
38
+ *
39
+ * @example
40
+ * await client.tracking.driver.update({
41
+ * task_group_id: "task_group_id",
42
+ * timestamp: "2024-01-15T09:30:00Z",
43
+ * location: {
44
+ * type: "Feature"
45
+ * }
46
+ * })
47
+ */
48
+ update(request: Chrt.tracking.DriverUpdateReq, requestOptions?: Driver.RequestOptions): core.HttpResponsePromise<Chrt.DriverUpdateResp>;
49
+ private __update;
50
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
51
+ }
@@ -0,0 +1,97 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../../../environments.mjs";
14
+ import * as core from "../../../../../../core/index.mjs";
15
+ import * as Chrt from "../../../../../index.mjs";
16
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
17
+ import * as errors from "../../../../../../errors/index.mjs";
18
+ export class Driver {
19
+ constructor(_options = {}) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * Unified endpoint for driver location updates. Automatically determines whether to update task group tracking (if IN_PROGRESS) and/or cargo tracking (if IN_TRANSIT) based on current states.
24
+ *
25
+ * @param {Chrt.tracking.DriverUpdateReq} request
26
+ * @param {Driver.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link Chrt.UnprocessableEntityError}
29
+ *
30
+ * @example
31
+ * await client.tracking.driver.update({
32
+ * task_group_id: "task_group_id",
33
+ * timestamp: "2024-01-15T09:30:00Z",
34
+ * location: {
35
+ * type: "Feature"
36
+ * }
37
+ * })
38
+ */
39
+ update(request, requestOptions) {
40
+ return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
41
+ }
42
+ __update(request, requestOptions) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ var _a, _b, _c, _d;
45
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
46
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "tracking/driver/update"),
47
+ method: "POST",
48
+ headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
49
+ contentType: "application/json",
50
+ requestType: "json",
51
+ body: request,
52
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
53
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
54
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
55
+ });
56
+ if (_response.ok) {
57
+ return { data: _response.body, rawResponse: _response.rawResponse };
58
+ }
59
+ if (_response.error.reason === "status-code") {
60
+ switch (_response.error.statusCode) {
61
+ case 422:
62
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
63
+ default:
64
+ throw new errors.ChrtError({
65
+ statusCode: _response.error.statusCode,
66
+ body: _response.error.body,
67
+ rawResponse: _response.rawResponse,
68
+ });
69
+ }
70
+ }
71
+ switch (_response.error.reason) {
72
+ case "non-json":
73
+ throw new errors.ChrtError({
74
+ statusCode: _response.error.statusCode,
75
+ body: _response.error.rawBody,
76
+ rawResponse: _response.rawResponse,
77
+ });
78
+ case "timeout":
79
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/driver/update.");
80
+ case "unknown":
81
+ throw new errors.ChrtError({
82
+ message: _response.error.errorMessage,
83
+ rawResponse: _response.rawResponse,
84
+ });
85
+ }
86
+ });
87
+ }
88
+ _getAuthorizationHeader() {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ const bearer = yield core.Supplier.get(this._options.token);
91
+ if (bearer != null) {
92
+ return `Bearer ${bearer}`;
93
+ }
94
+ return undefined;
95
+ });
96
+ }
97
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -12,7 +12,7 @@ import * as Chrt from "../../../../../../index.mjs";
12
12
  * }
13
13
  * }
14
14
  */
15
- export interface CargoByDriverUpdateReq {
15
+ export interface DriverUpdateReq {
16
16
  task_group_id: string;
17
17
  timestamp: string;
18
18
  location: Chrt.LocationFeature;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1 @@
1
+ export { type DriverUpdateReq } from "./DriverUpdateReq.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -1,4 +1,12 @@
1
+ export * as cargoByDevice from "./cargoByDevice/index.mjs";
1
2
  export * as cargoByDriver from "./cargoByDriver/index.mjs";
3
+ export * as devices from "./devices/index.mjs";
4
+ export * as driver from "./driver/index.mjs";
2
5
  export * as taskGroupByDriver from "./taskGroupByDriver/index.mjs";
6
+ export * as sessionByDevice from "./sessionByDevice/index.mjs";
7
+ export * from "./cargoByDevice/client/requests/index.mjs";
3
8
  export * from "./cargoByDriver/client/requests/index.mjs";
9
+ export * from "./devices/client/requests/index.mjs";
10
+ export * from "./driver/client/requests/index.mjs";
4
11
  export * from "./taskGroupByDriver/client/requests/index.mjs";
12
+ export * from "./sessionByDevice/client/requests/index.mjs";
@@ -1,4 +1,12 @@
1
+ export * as cargoByDevice from "./cargoByDevice/index.mjs";
1
2
  export * as cargoByDriver from "./cargoByDriver/index.mjs";
3
+ export * as devices from "./devices/index.mjs";
4
+ export * as driver from "./driver/index.mjs";
2
5
  export * as taskGroupByDriver from "./taskGroupByDriver/index.mjs";
6
+ export * as sessionByDevice from "./sessionByDevice/index.mjs";
7
+ export * from "./cargoByDevice/client/requests/index.mjs";
3
8
  export * from "./cargoByDriver/client/requests/index.mjs";
9
+ export * from "./devices/client/requests/index.mjs";
10
+ export * from "./driver/client/requests/index.mjs";
4
11
  export * from "./taskGroupByDriver/client/requests/index.mjs";
12
+ export * from "./sessionByDevice/client/requests/index.mjs";