@chrt-inc/typescript-sdk 1.262.0 → 1.266.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 (71) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.d.ts +28 -2
  3. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +134 -5
  4. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesDeleteRequest.d.ts +11 -0
  5. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/{DevicesRegisterToOrgRequest.d.ts → DevicesRegisterToOrgReq1.d.ts} +4 -1
  6. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesUpdateRequest1.d.ts +16 -0
  7. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/index.d.ts +3 -1
  8. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.d.ts +31 -16
  9. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.js +92 -28
  10. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceEndSessionRequest.d.ts → SessionByDeviceDeleteRequest.d.ts} +1 -1
  11. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceResumeSessionRequest.d.ts → SessionByDevicePauseRecordingRequest.d.ts} +1 -1
  12. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceResumeRecordingRequest.d.ts +12 -0
  13. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceResumeRecordingRequest.js +5 -0
  14. package/dist/{esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceEndSessionRequest.d.mts → cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceStartRequest.d.ts} +1 -1
  15. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceStartRequest.js +5 -0
  16. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceStartSessionRequest.d.ts → SessionByDeviceTerminateRequest.d.ts} +1 -1
  17. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceTerminateRequest.js +5 -0
  18. package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/index.d.ts +5 -4
  19. package/dist/cjs/api/types/Device1.d.ts +2 -0
  20. package/dist/cjs/api/types/Session1.d.ts +2 -0
  21. package/dist/cjs/api/types/SessionByDeviceDeleteResponse1.d.ts +7 -0
  22. package/dist/cjs/api/types/SessionByDeviceDeleteResponse1.js +5 -0
  23. package/dist/cjs/api/types/TrackingDeviceTypeEnum1.d.ts +4 -4
  24. package/dist/cjs/api/types/TrackingDeviceTypeEnum1.js +3 -3
  25. package/dist/cjs/api/types/index.d.ts +1 -0
  26. package/dist/cjs/api/types/index.js +1 -0
  27. package/dist/cjs/version.d.ts +1 -1
  28. package/dist/cjs/version.js +1 -1
  29. package/dist/esm/Client.mjs +2 -2
  30. package/dist/esm/api/resources/tracking/resources/devices/client/Client.d.mts +28 -2
  31. package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +134 -5
  32. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesDeleteRequest.d.mts +11 -0
  33. package/dist/esm/api/resources/tracking/resources/devices/client/requests/{DevicesRegisterToOrgRequest.d.mts → DevicesRegisterToOrgReq1.d.mts} +4 -1
  34. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesUpdateRequest1.d.mts +16 -0
  35. package/dist/esm/api/resources/tracking/resources/devices/client/requests/index.d.mts +3 -1
  36. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.d.mts +31 -16
  37. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.mjs +92 -28
  38. package/dist/{cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDevicePauseSessionRequest.d.ts → esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDeleteRequest.d.mts} +1 -1
  39. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDevicePauseRecordingRequest.d.mts +12 -0
  40. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceResumeRecordingRequest.d.mts +12 -0
  41. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceResumeRecordingRequest.mjs +4 -0
  42. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceStartRequest.d.mts +12 -0
  43. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceStartRequest.mjs +4 -0
  44. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceTerminateRequest.d.mts +12 -0
  45. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceTerminateRequest.mjs +4 -0
  46. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/index.d.mts +5 -4
  47. package/dist/esm/api/types/Device1.d.mts +2 -0
  48. package/dist/esm/api/types/Session1.d.mts +2 -0
  49. package/dist/esm/api/types/SessionByDeviceDeleteResponse1.d.mts +7 -0
  50. package/dist/esm/api/types/SessionByDeviceDeleteResponse1.mjs +4 -0
  51. package/dist/esm/api/types/TrackingDeviceTypeEnum1.d.mts +4 -4
  52. package/dist/esm/api/types/TrackingDeviceTypeEnum1.mjs +3 -3
  53. package/dist/esm/api/types/index.d.mts +1 -0
  54. package/dist/esm/api/types/index.mjs +1 -0
  55. package/dist/esm/version.d.mts +1 -1
  56. package/dist/esm/version.mjs +1 -1
  57. package/package.json +1 -1
  58. package/reference.md +204 -13
  59. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDevicePauseSessionRequest.d.mts +0 -12
  60. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceResumeSessionRequest.d.mts +0 -12
  61. package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceStartSessionRequest.d.mts +0 -12
  62. /package/dist/cjs/api/resources/tracking/resources/devices/client/requests/{DevicesRegisterToOrgRequest.js → DevicesDeleteRequest.js} +0 -0
  63. /package/dist/cjs/api/resources/tracking/resources/{sessionByDevice/client/requests/SessionByDeviceEndSessionRequest.js → devices/client/requests/DevicesRegisterToOrgReq1.js} +0 -0
  64. /package/dist/cjs/api/resources/tracking/resources/{sessionByDevice/client/requests/SessionByDevicePauseSessionRequest.js → devices/client/requests/DevicesUpdateRequest1.js} +0 -0
  65. /package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceResumeSessionRequest.js → SessionByDeviceDeleteRequest.js} +0 -0
  66. /package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceStartSessionRequest.js → SessionByDevicePauseRecordingRequest.js} +0 -0
  67. /package/dist/esm/api/resources/tracking/resources/devices/client/requests/{DevicesRegisterToOrgRequest.mjs → DevicesDeleteRequest.mjs} +0 -0
  68. /package/dist/esm/api/resources/tracking/resources/{sessionByDevice/client/requests/SessionByDeviceEndSessionRequest.mjs → devices/client/requests/DevicesRegisterToOrgReq1.mjs} +0 -0
  69. /package/dist/esm/api/resources/tracking/resources/{sessionByDevice/client/requests/SessionByDevicePauseSessionRequest.mjs → devices/client/requests/DevicesUpdateRequest1.mjs} +0 -0
  70. /package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceResumeSessionRequest.mjs → SessionByDeviceDeleteRequest.mjs} +0 -0
  71. /package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceStartSessionRequest.mjs → SessionByDevicePauseRecordingRequest.mjs} +0 -0
@@ -68,8 +68,8 @@ class ChrtClient {
68
68
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
69
69
  "X-Fern-Language": "JavaScript",
70
70
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
71
- "X-Fern-SDK-Version": "1.262.0",
72
- "User-Agent": "@chrt-inc/typescript-sdk/1.262.0",
71
+ "X-Fern-SDK-Version": "1.266.0",
72
+ "User-Agent": "@chrt-inc/typescript-sdk/1.266.0",
73
73
  "X-Fern-Runtime": core.RUNTIME.type,
74
74
  "X-Fern-Runtime-Version": core.RUNTIME.version,
75
75
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -33,7 +33,7 @@ export declare class Devices {
33
33
  /**
34
34
  * Register a device to the caller's org.
35
35
  *
36
- * @param {Chrt.tracking.DevicesRegisterToOrgRequest} request
36
+ * @param {Chrt.tracking.DevicesRegisterToOrgReq1} request
37
37
  * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
38
38
  *
39
39
  * @throws {@link Chrt.UnprocessableEntityError}
@@ -43,8 +43,34 @@ export declare class Devices {
43
43
  * device_mac_address: "device_mac_address"
44
44
  * })
45
45
  */
46
- registerToOrg(request: Chrt.tracking.DevicesRegisterToOrgRequest, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<string>;
46
+ registerToOrg(request: Chrt.tracking.DevicesRegisterToOrgReq1, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<string>;
47
47
  private __registerToOrg;
48
+ /**
49
+ * Update the type and/or comments for a device.
50
+ *
51
+ * @param {Chrt.tracking.DevicesUpdateRequest1} request
52
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
53
+ *
54
+ * @throws {@link Chrt.UnprocessableEntityError}
55
+ *
56
+ * @example
57
+ * await client.tracking.devices.update()
58
+ */
59
+ update(request?: Chrt.tracking.DevicesUpdateRequest1, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<boolean>;
60
+ private __update;
61
+ /**
62
+ * Delete a device by device_id or device_mac_address. Cannot delete if linked to a session or cargo.
63
+ *
64
+ * @param {Chrt.tracking.DevicesDeleteRequest} request
65
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
66
+ *
67
+ * @throws {@link Chrt.UnprocessableEntityError}
68
+ *
69
+ * @example
70
+ * await client.tracking.devices.delete()
71
+ */
72
+ delete(request?: Chrt.tracking.DevicesDeleteRequest, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<boolean>;
73
+ private __delete;
48
74
  /**
49
75
  * Get a device by device_mac_address or device_id.
50
76
  *
@@ -58,7 +58,7 @@ class Devices {
58
58
  /**
59
59
  * Register a device to the caller's org.
60
60
  *
61
- * @param {Chrt.tracking.DevicesRegisterToOrgRequest} request
61
+ * @param {Chrt.tracking.DevicesRegisterToOrgReq1} request
62
62
  * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
63
63
  *
64
64
  * @throws {@link Chrt.UnprocessableEntityError}
@@ -74,15 +74,15 @@ class Devices {
74
74
  __registerToOrg(request, requestOptions) {
75
75
  return __awaiter(this, void 0, void 0, function* () {
76
76
  var _a, _b, _c, _d;
77
- const { device_mac_address: deviceMacAddress } = request;
78
- const _queryParams = {};
79
- _queryParams["device_mac_address"] = deviceMacAddress;
80
77
  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);
81
78
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
82
79
  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/register_to_org"),
83
80
  method: "POST",
84
81
  headers: _headers,
85
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
82
+ contentType: "application/json",
83
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
84
+ requestType: "json",
85
+ body: request,
86
86
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
87
87
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
88
88
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -119,6 +119,135 @@ class Devices {
119
119
  }
120
120
  });
121
121
  }
122
+ /**
123
+ * Update the type and/or comments for a device.
124
+ *
125
+ * @param {Chrt.tracking.DevicesUpdateRequest1} request
126
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
127
+ *
128
+ * @throws {@link Chrt.UnprocessableEntityError}
129
+ *
130
+ * @example
131
+ * await client.tracking.devices.update()
132
+ */
133
+ update(request = {}, requestOptions) {
134
+ return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
135
+ }
136
+ __update() {
137
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
138
+ var _a, _b, _c, _d;
139
+ 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);
140
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
141
+ 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/update"),
142
+ method: "POST",
143
+ headers: _headers,
144
+ contentType: "application/json",
145
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
146
+ requestType: "json",
147
+ body: request,
148
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
149
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
150
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
151
+ });
152
+ if (_response.ok) {
153
+ return { data: _response.body, rawResponse: _response.rawResponse };
154
+ }
155
+ if (_response.error.reason === "status-code") {
156
+ switch (_response.error.statusCode) {
157
+ case 422:
158
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
159
+ default:
160
+ throw new errors.ChrtError({
161
+ statusCode: _response.error.statusCode,
162
+ body: _response.error.body,
163
+ rawResponse: _response.rawResponse,
164
+ });
165
+ }
166
+ }
167
+ switch (_response.error.reason) {
168
+ case "non-json":
169
+ throw new errors.ChrtError({
170
+ statusCode: _response.error.statusCode,
171
+ body: _response.error.rawBody,
172
+ rawResponse: _response.rawResponse,
173
+ });
174
+ case "timeout":
175
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/devices/update.");
176
+ case "unknown":
177
+ throw new errors.ChrtError({
178
+ message: _response.error.errorMessage,
179
+ rawResponse: _response.rawResponse,
180
+ });
181
+ }
182
+ });
183
+ }
184
+ /**
185
+ * Delete a device by device_id or device_mac_address. Cannot delete if linked to a session or cargo.
186
+ *
187
+ * @param {Chrt.tracking.DevicesDeleteRequest} request
188
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
189
+ *
190
+ * @throws {@link Chrt.UnprocessableEntityError}
191
+ *
192
+ * @example
193
+ * await client.tracking.devices.delete()
194
+ */
195
+ delete(request = {}, requestOptions) {
196
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
197
+ }
198
+ __delete() {
199
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
200
+ var _a, _b, _c, _d;
201
+ const { device_id: deviceId, device_mac_address: deviceMacAddress } = request;
202
+ const _queryParams = {};
203
+ if (deviceId !== undefined) {
204
+ _queryParams["device_id"] = deviceId;
205
+ }
206
+ if (deviceMacAddress !== undefined) {
207
+ _queryParams["device_mac_address"] = deviceMacAddress;
208
+ }
209
+ 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);
210
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
211
+ 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/delete"),
212
+ method: "DELETE",
213
+ headers: _headers,
214
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
215
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
216
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
217
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
218
+ });
219
+ if (_response.ok) {
220
+ return { data: _response.body, rawResponse: _response.rawResponse };
221
+ }
222
+ if (_response.error.reason === "status-code") {
223
+ switch (_response.error.statusCode) {
224
+ case 422:
225
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
226
+ default:
227
+ throw new errors.ChrtError({
228
+ statusCode: _response.error.statusCode,
229
+ body: _response.error.body,
230
+ rawResponse: _response.rawResponse,
231
+ });
232
+ }
233
+ }
234
+ switch (_response.error.reason) {
235
+ case "non-json":
236
+ throw new errors.ChrtError({
237
+ statusCode: _response.error.statusCode,
238
+ body: _response.error.rawBody,
239
+ rawResponse: _response.rawResponse,
240
+ });
241
+ case "timeout":
242
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /tracking/devices/delete.");
243
+ case "unknown":
244
+ throw new errors.ChrtError({
245
+ message: _response.error.errorMessage,
246
+ rawResponse: _response.rawResponse,
247
+ });
248
+ }
249
+ });
250
+ }
122
251
  /**
123
252
  * Get a device by device_mac_address or device_id.
124
253
  *
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface DevicesDeleteRequest {
9
+ device_id?: string | null;
10
+ device_mac_address?: string | null;
11
+ }
@@ -1,12 +1,15 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Chrt from "../../../../../../index.js";
4
5
  /**
5
6
  * @example
6
7
  * {
7
8
  * device_mac_address: "device_mac_address"
8
9
  * }
9
10
  */
10
- export interface DevicesRegisterToOrgRequest {
11
+ export interface DevicesRegisterToOrgReq1 {
11
12
  device_mac_address: string;
13
+ type?: Chrt.TrackingDeviceTypeEnum1 | null;
14
+ comments?: string | null;
12
15
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {}
8
+ */
9
+ export interface DevicesUpdateRequest1 {
10
+ device_id?: string | null;
11
+ device_mac_address?: string | null;
12
+ type?: Chrt.TrackingDeviceTypeEnum1 | null;
13
+ comments?: string | null;
14
+ delete_type?: boolean;
15
+ delete_comments?: boolean;
16
+ }
@@ -1,4 +1,6 @@
1
- export { type DevicesRegisterToOrgRequest } from "./DevicesRegisterToOrgRequest.js";
1
+ export { type DevicesRegisterToOrgReq1 } from "./DevicesRegisterToOrgReq1.js";
2
+ export { type DevicesUpdateRequest1 } from "./DevicesUpdateRequest1.js";
3
+ export { type DevicesDeleteRequest } from "./DevicesDeleteRequest.js";
2
4
  export { type DevicesGetRequest } from "./DevicesGetRequest.js";
3
5
  export { type DevicesLinkToCargoRequest } from "./DevicesLinkToCargoRequest.js";
4
6
  export { type DevicesUnlinkFromCargoRequest } from "./DevicesUnlinkFromCargoRequest.js";
@@ -103,62 +103,77 @@ export declare class SessionByDevice {
103
103
  /**
104
104
  * Start a session (set recording=true).
105
105
  *
106
- * @param {Chrt.tracking.SessionByDeviceStartSessionRequest} request
106
+ * @param {Chrt.tracking.SessionByDeviceStartRequest} request
107
107
  * @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
108
108
  *
109
109
  * @throws {@link Chrt.UnprocessableEntityError}
110
110
  *
111
111
  * @example
112
- * await client.tracking.sessionByDevice.startSession({
112
+ * await client.tracking.sessionByDevice.start({
113
113
  * session_id: "session_id"
114
114
  * })
115
115
  */
116
- startSession(request: Chrt.tracking.SessionByDeviceStartSessionRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<boolean>;
117
- private __startSession;
116
+ start(request: Chrt.tracking.SessionByDeviceStartRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<boolean>;
117
+ private __start;
118
118
  /**
119
119
  * Pause a session (set recording=false).
120
120
  *
121
- * @param {Chrt.tracking.SessionByDevicePauseSessionRequest} request
121
+ * @param {Chrt.tracking.SessionByDevicePauseRecordingRequest} request
122
122
  * @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
123
123
  *
124
124
  * @throws {@link Chrt.UnprocessableEntityError}
125
125
  *
126
126
  * @example
127
- * await client.tracking.sessionByDevice.pauseSession({
127
+ * await client.tracking.sessionByDevice.pauseRecording({
128
128
  * session_id: "session_id"
129
129
  * })
130
130
  */
131
- pauseSession(request: Chrt.tracking.SessionByDevicePauseSessionRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<boolean>;
132
- private __pauseSession;
131
+ pauseRecording(request: Chrt.tracking.SessionByDevicePauseRecordingRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<boolean>;
132
+ private __pauseRecording;
133
133
  /**
134
134
  * Resume a session (set recording=true).
135
135
  *
136
- * @param {Chrt.tracking.SessionByDeviceResumeSessionRequest} request
136
+ * @param {Chrt.tracking.SessionByDeviceResumeRecordingRequest} request
137
137
  * @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
138
138
  *
139
139
  * @throws {@link Chrt.UnprocessableEntityError}
140
140
  *
141
141
  * @example
142
- * await client.tracking.sessionByDevice.resumeSession({
142
+ * await client.tracking.sessionByDevice.resumeRecording({
143
143
  * session_id: "session_id"
144
144
  * })
145
145
  */
146
- resumeSession(request: Chrt.tracking.SessionByDeviceResumeSessionRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<boolean>;
147
- private __resumeSession;
146
+ resumeRecording(request: Chrt.tracking.SessionByDeviceResumeRecordingRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<boolean>;
147
+ private __resumeRecording;
148
148
  /**
149
149
  * End a session (set recording=false).
150
150
  *
151
- * @param {Chrt.tracking.SessionByDeviceEndSessionRequest} request
151
+ * @param {Chrt.tracking.SessionByDeviceTerminateRequest} request
152
152
  * @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
153
153
  *
154
154
  * @throws {@link Chrt.UnprocessableEntityError}
155
155
  *
156
156
  * @example
157
- * await client.tracking.sessionByDevice.endSession({
157
+ * await client.tracking.sessionByDevice.terminate({
158
158
  * session_id: "session_id"
159
159
  * })
160
160
  */
161
- endSession(request: Chrt.tracking.SessionByDeviceEndSessionRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<boolean>;
162
- private __endSession;
161
+ terminate(request: Chrt.tracking.SessionByDeviceTerminateRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<boolean>;
162
+ private __terminate;
163
+ /**
164
+ * Delete a terminated session and all associated timeseries data.
165
+ *
166
+ * @param {Chrt.tracking.SessionByDeviceDeleteRequest} request
167
+ * @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
168
+ *
169
+ * @throws {@link Chrt.UnprocessableEntityError}
170
+ *
171
+ * @example
172
+ * await client.tracking.sessionByDevice.delete({
173
+ * session_id: "session_id"
174
+ * })
175
+ */
176
+ delete(request: Chrt.tracking.SessionByDeviceDeleteRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<Chrt.SessionByDeviceDeleteResponse1>;
177
+ private __delete;
163
178
  protected _getAuthorizationHeader(): Promise<string | undefined>;
164
179
  }
@@ -374,20 +374,20 @@ class SessionByDevice {
374
374
  /**
375
375
  * Start a session (set recording=true).
376
376
  *
377
- * @param {Chrt.tracking.SessionByDeviceStartSessionRequest} request
377
+ * @param {Chrt.tracking.SessionByDeviceStartRequest} request
378
378
  * @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
379
379
  *
380
380
  * @throws {@link Chrt.UnprocessableEntityError}
381
381
  *
382
382
  * @example
383
- * await client.tracking.sessionByDevice.startSession({
383
+ * await client.tracking.sessionByDevice.start({
384
384
  * session_id: "session_id"
385
385
  * })
386
386
  */
387
- startSession(request, requestOptions) {
388
- return core.HttpResponsePromise.fromPromise(this.__startSession(request, requestOptions));
387
+ start(request, requestOptions) {
388
+ return core.HttpResponsePromise.fromPromise(this.__start(request, requestOptions));
389
389
  }
390
- __startSession(request, requestOptions) {
390
+ __start(request, requestOptions) {
391
391
  return __awaiter(this, void 0, void 0, function* () {
392
392
  var _a, _b, _c, _d;
393
393
  const { session_id: sessionId } = request;
@@ -395,7 +395,7 @@ class SessionByDevice {
395
395
  _queryParams["session_id"] = sessionId;
396
396
  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);
397
397
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
398
- 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/session_by_device/start_session"),
398
+ 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/session_by_device/start"),
399
399
  method: "POST",
400
400
  headers: _headers,
401
401
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -426,7 +426,7 @@ class SessionByDevice {
426
426
  rawResponse: _response.rawResponse,
427
427
  });
428
428
  case "timeout":
429
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/start_session.");
429
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/start.");
430
430
  case "unknown":
431
431
  throw new errors.ChrtError({
432
432
  message: _response.error.errorMessage,
@@ -438,20 +438,20 @@ class SessionByDevice {
438
438
  /**
439
439
  * Pause a session (set recording=false).
440
440
  *
441
- * @param {Chrt.tracking.SessionByDevicePauseSessionRequest} request
441
+ * @param {Chrt.tracking.SessionByDevicePauseRecordingRequest} request
442
442
  * @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
443
443
  *
444
444
  * @throws {@link Chrt.UnprocessableEntityError}
445
445
  *
446
446
  * @example
447
- * await client.tracking.sessionByDevice.pauseSession({
447
+ * await client.tracking.sessionByDevice.pauseRecording({
448
448
  * session_id: "session_id"
449
449
  * })
450
450
  */
451
- pauseSession(request, requestOptions) {
452
- return core.HttpResponsePromise.fromPromise(this.__pauseSession(request, requestOptions));
451
+ pauseRecording(request, requestOptions) {
452
+ return core.HttpResponsePromise.fromPromise(this.__pauseRecording(request, requestOptions));
453
453
  }
454
- __pauseSession(request, requestOptions) {
454
+ __pauseRecording(request, requestOptions) {
455
455
  return __awaiter(this, void 0, void 0, function* () {
456
456
  var _a, _b, _c, _d;
457
457
  const { session_id: sessionId } = request;
@@ -459,7 +459,7 @@ class SessionByDevice {
459
459
  _queryParams["session_id"] = sessionId;
460
460
  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);
461
461
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
462
- 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/session_by_device/pause_session"),
462
+ 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/session_by_device/pause_recording"),
463
463
  method: "POST",
464
464
  headers: _headers,
465
465
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -490,7 +490,7 @@ class SessionByDevice {
490
490
  rawResponse: _response.rawResponse,
491
491
  });
492
492
  case "timeout":
493
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/pause_session.");
493
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/pause_recording.");
494
494
  case "unknown":
495
495
  throw new errors.ChrtError({
496
496
  message: _response.error.errorMessage,
@@ -502,20 +502,20 @@ class SessionByDevice {
502
502
  /**
503
503
  * Resume a session (set recording=true).
504
504
  *
505
- * @param {Chrt.tracking.SessionByDeviceResumeSessionRequest} request
505
+ * @param {Chrt.tracking.SessionByDeviceResumeRecordingRequest} request
506
506
  * @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
507
507
  *
508
508
  * @throws {@link Chrt.UnprocessableEntityError}
509
509
  *
510
510
  * @example
511
- * await client.tracking.sessionByDevice.resumeSession({
511
+ * await client.tracking.sessionByDevice.resumeRecording({
512
512
  * session_id: "session_id"
513
513
  * })
514
514
  */
515
- resumeSession(request, requestOptions) {
516
- return core.HttpResponsePromise.fromPromise(this.__resumeSession(request, requestOptions));
515
+ resumeRecording(request, requestOptions) {
516
+ return core.HttpResponsePromise.fromPromise(this.__resumeRecording(request, requestOptions));
517
517
  }
518
- __resumeSession(request, requestOptions) {
518
+ __resumeRecording(request, requestOptions) {
519
519
  return __awaiter(this, void 0, void 0, function* () {
520
520
  var _a, _b, _c, _d;
521
521
  const { session_id: sessionId } = request;
@@ -523,7 +523,7 @@ class SessionByDevice {
523
523
  _queryParams["session_id"] = sessionId;
524
524
  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);
525
525
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
526
- 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/session_by_device/resume_session"),
526
+ 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/session_by_device/resume_recording"),
527
527
  method: "POST",
528
528
  headers: _headers,
529
529
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -554,7 +554,7 @@ class SessionByDevice {
554
554
  rawResponse: _response.rawResponse,
555
555
  });
556
556
  case "timeout":
557
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/resume_session.");
557
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/resume_recording.");
558
558
  case "unknown":
559
559
  throw new errors.ChrtError({
560
560
  message: _response.error.errorMessage,
@@ -566,20 +566,20 @@ class SessionByDevice {
566
566
  /**
567
567
  * End a session (set recording=false).
568
568
  *
569
- * @param {Chrt.tracking.SessionByDeviceEndSessionRequest} request
569
+ * @param {Chrt.tracking.SessionByDeviceTerminateRequest} request
570
570
  * @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
571
571
  *
572
572
  * @throws {@link Chrt.UnprocessableEntityError}
573
573
  *
574
574
  * @example
575
- * await client.tracking.sessionByDevice.endSession({
575
+ * await client.tracking.sessionByDevice.terminate({
576
576
  * session_id: "session_id"
577
577
  * })
578
578
  */
579
- endSession(request, requestOptions) {
580
- return core.HttpResponsePromise.fromPromise(this.__endSession(request, requestOptions));
579
+ terminate(request, requestOptions) {
580
+ return core.HttpResponsePromise.fromPromise(this.__terminate(request, requestOptions));
581
581
  }
582
- __endSession(request, requestOptions) {
582
+ __terminate(request, requestOptions) {
583
583
  return __awaiter(this, void 0, void 0, function* () {
584
584
  var _a, _b, _c, _d;
585
585
  const { session_id: sessionId } = request;
@@ -587,7 +587,7 @@ class SessionByDevice {
587
587
  _queryParams["session_id"] = sessionId;
588
588
  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);
589
589
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
590
- 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/session_by_device/end_session"),
590
+ 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/session_by_device/terminate"),
591
591
  method: "POST",
592
592
  headers: _headers,
593
593
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -618,7 +618,71 @@ class SessionByDevice {
618
618
  rawResponse: _response.rawResponse,
619
619
  });
620
620
  case "timeout":
621
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/end_session.");
621
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/terminate.");
622
+ case "unknown":
623
+ throw new errors.ChrtError({
624
+ message: _response.error.errorMessage,
625
+ rawResponse: _response.rawResponse,
626
+ });
627
+ }
628
+ });
629
+ }
630
+ /**
631
+ * Delete a terminated session and all associated timeseries data.
632
+ *
633
+ * @param {Chrt.tracking.SessionByDeviceDeleteRequest} request
634
+ * @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
635
+ *
636
+ * @throws {@link Chrt.UnprocessableEntityError}
637
+ *
638
+ * @example
639
+ * await client.tracking.sessionByDevice.delete({
640
+ * session_id: "session_id"
641
+ * })
642
+ */
643
+ delete(request, requestOptions) {
644
+ return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions));
645
+ }
646
+ __delete(request, requestOptions) {
647
+ return __awaiter(this, void 0, void 0, function* () {
648
+ var _a, _b, _c, _d;
649
+ const { session_id: sessionId } = request;
650
+ const _queryParams = {};
651
+ _queryParams["session_id"] = sessionId;
652
+ 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);
653
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
654
+ 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/session_by_device/delete"),
655
+ method: "DELETE",
656
+ headers: _headers,
657
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
658
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
659
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
660
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
661
+ });
662
+ if (_response.ok) {
663
+ return { data: _response.body, rawResponse: _response.rawResponse };
664
+ }
665
+ if (_response.error.reason === "status-code") {
666
+ switch (_response.error.statusCode) {
667
+ case 422:
668
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
669
+ default:
670
+ throw new errors.ChrtError({
671
+ statusCode: _response.error.statusCode,
672
+ body: _response.error.body,
673
+ rawResponse: _response.rawResponse,
674
+ });
675
+ }
676
+ }
677
+ switch (_response.error.reason) {
678
+ case "non-json":
679
+ throw new errors.ChrtError({
680
+ statusCode: _response.error.statusCode,
681
+ body: _response.error.rawBody,
682
+ rawResponse: _response.rawResponse,
683
+ });
684
+ case "timeout":
685
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /tracking/session_by_device/delete.");
622
686
  case "unknown":
623
687
  throw new errors.ChrtError({
624
688
  message: _response.error.errorMessage,
@@ -7,6 +7,6 @@
7
7
  * session_id: "session_id"
8
8
  * }
9
9
  */
10
- export interface SessionByDeviceEndSessionRequest {
10
+ export interface SessionByDeviceDeleteRequest {
11
11
  session_id: string;
12
12
  }
@@ -7,6 +7,6 @@
7
7
  * session_id: "session_id"
8
8
  * }
9
9
  */
10
- export interface SessionByDeviceResumeSessionRequest {
10
+ export interface SessionByDevicePauseRecordingRequest {
11
11
  session_id: string;
12
12
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * session_id: "session_id"
8
+ * }
9
+ */
10
+ export interface SessionByDeviceResumeRecordingRequest {
11
+ session_id: string;
12
+ }