@chrt-inc/typescript-sdk 1.266.0 → 1.268.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.d.ts +50 -5
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.js +209 -8
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDataPointsPublicRequest.d.ts +13 -0
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceGetRequest.d.ts +12 -0
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceGetRequest.js +5 -0
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceLastSeenPublicRequest.d.ts +12 -0
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceLastSeenPublicRequest.js +5 -0
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceUpdateCommentsRequest1.d.ts → SessionByDeviceUpdateRequest1.d.ts} +2 -1
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceUpdateRequest1.js +5 -0
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/index.d.ts +4 -1
- package/dist/cjs/api/types/Session1.d.ts +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.d.mts +50 -5
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.mjs +209 -8
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceDataPointsPublicRequest.d.mts +13 -0
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceGetRequest.d.mts +12 -0
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceGetRequest.mjs +4 -0
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceLastSeenPublicRequest.d.mts +12 -0
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceLastSeenPublicRequest.mjs +4 -0
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceUpdateCommentsRequest1.d.mts → SessionByDeviceUpdateRequest1.d.mts} +2 -1
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceUpdateRequest1.mjs +4 -0
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/index.d.mts +4 -1
- package/dist/esm/api/types/Session1.d.mts +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +199 -4
- /package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceUpdateCommentsRequest1.js → SessionByDeviceDataPointsPublicRequest.js} +0 -0
- /package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceUpdateCommentsRequest1.mjs → SessionByDeviceDataPointsPublicRequest.mjs} +0 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -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.
|
|
72
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
71
|
+
"X-Fern-SDK-Version": "1.268.1",
|
|
72
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.268.1",
|
|
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) });
|
|
@@ -40,6 +40,21 @@ export declare class SessionByDevice {
|
|
|
40
40
|
*/
|
|
41
41
|
list(requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<Chrt.Session1[]>;
|
|
42
42
|
private __list;
|
|
43
|
+
/**
|
|
44
|
+
* Get a single session document by session_id.
|
|
45
|
+
*
|
|
46
|
+
* @param {Chrt.tracking.SessionByDeviceGetRequest} request
|
|
47
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
|
+
*
|
|
49
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await client.tracking.sessionByDevice.get({
|
|
53
|
+
* session_id: "session_id"
|
|
54
|
+
* })
|
|
55
|
+
*/
|
|
56
|
+
get(request: Chrt.tracking.SessionByDeviceGetRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<Chrt.Session1>;
|
|
57
|
+
private __get;
|
|
43
58
|
/**
|
|
44
59
|
* Return the most recent datapoint for a session.
|
|
45
60
|
*
|
|
@@ -86,20 +101,20 @@ export declare class SessionByDevice {
|
|
|
86
101
|
createSession(request: Chrt.tracking.SessionByDeviceCreateSessionRequest1, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<string>;
|
|
87
102
|
private __createSession;
|
|
88
103
|
/**
|
|
89
|
-
*
|
|
104
|
+
* Update a session's comments and/or public visibility status.
|
|
90
105
|
*
|
|
91
|
-
* @param {Chrt.tracking.
|
|
106
|
+
* @param {Chrt.tracking.SessionByDeviceUpdateRequest1} request
|
|
92
107
|
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
93
108
|
*
|
|
94
109
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
95
110
|
*
|
|
96
111
|
* @example
|
|
97
|
-
* await client.tracking.sessionByDevice.
|
|
112
|
+
* await client.tracking.sessionByDevice.update({
|
|
98
113
|
* session_id: "session_id"
|
|
99
114
|
* })
|
|
100
115
|
*/
|
|
101
|
-
|
|
102
|
-
private
|
|
116
|
+
update(request: Chrt.tracking.SessionByDeviceUpdateRequest1, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
117
|
+
private __update;
|
|
103
118
|
/**
|
|
104
119
|
* Start a session (set recording=true).
|
|
105
120
|
*
|
|
@@ -175,5 +190,35 @@ export declare class SessionByDevice {
|
|
|
175
190
|
*/
|
|
176
191
|
delete(request: Chrt.tracking.SessionByDeviceDeleteRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<Chrt.SessionByDeviceDeleteResponse1>;
|
|
177
192
|
private __delete;
|
|
193
|
+
/**
|
|
194
|
+
* Return the most recent datapoint for a session. Session must be have public=True.
|
|
195
|
+
*
|
|
196
|
+
* @param {Chrt.tracking.SessionByDeviceLastSeenPublicRequest} request
|
|
197
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
|
+
*
|
|
199
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* await client.tracking.sessionByDevice.lastSeenPublic({
|
|
203
|
+
* session_id: "session_id"
|
|
204
|
+
* })
|
|
205
|
+
*/
|
|
206
|
+
lastSeenPublic(request: Chrt.tracking.SessionByDeviceLastSeenPublicRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<(Chrt.TrackingSessionByDeviceDataPoint1 | null) | undefined>;
|
|
207
|
+
private __lastSeenPublic;
|
|
208
|
+
/**
|
|
209
|
+
* Return a specified number of data points for a public session, intelligently sampled across the time range. Session must have public=True.
|
|
210
|
+
*
|
|
211
|
+
* @param {Chrt.tracking.SessionByDeviceDataPointsPublicRequest} request
|
|
212
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
213
|
+
*
|
|
214
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* await client.tracking.sessionByDevice.dataPointsPublic({
|
|
218
|
+
* session_id: "session_id"
|
|
219
|
+
* })
|
|
220
|
+
*/
|
|
221
|
+
dataPointsPublic(request: Chrt.tracking.SessionByDeviceDataPointsPublicRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<Chrt.TrackingSessionByDeviceDataPoint1[]>;
|
|
222
|
+
private __dataPointsPublic;
|
|
178
223
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
179
224
|
}
|
|
@@ -106,6 +106,70 @@ class SessionByDevice {
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Get a single session document by session_id.
|
|
111
|
+
*
|
|
112
|
+
* @param {Chrt.tracking.SessionByDeviceGetRequest} request
|
|
113
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
114
|
+
*
|
|
115
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* await client.tracking.sessionByDevice.get({
|
|
119
|
+
* session_id: "session_id"
|
|
120
|
+
* })
|
|
121
|
+
*/
|
|
122
|
+
get(request, requestOptions) {
|
|
123
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
124
|
+
}
|
|
125
|
+
__get(request, requestOptions) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
var _a, _b, _c, _d;
|
|
128
|
+
const { session_id: sessionId } = request;
|
|
129
|
+
const _queryParams = {};
|
|
130
|
+
_queryParams["session_id"] = sessionId;
|
|
131
|
+
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);
|
|
132
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
133
|
+
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/get"),
|
|
134
|
+
method: "GET",
|
|
135
|
+
headers: _headers,
|
|
136
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
137
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
138
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
139
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
140
|
+
});
|
|
141
|
+
if (_response.ok) {
|
|
142
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
143
|
+
}
|
|
144
|
+
if (_response.error.reason === "status-code") {
|
|
145
|
+
switch (_response.error.statusCode) {
|
|
146
|
+
case 422:
|
|
147
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
148
|
+
default:
|
|
149
|
+
throw new errors.ChrtError({
|
|
150
|
+
statusCode: _response.error.statusCode,
|
|
151
|
+
body: _response.error.body,
|
|
152
|
+
rawResponse: _response.rawResponse,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
switch (_response.error.reason) {
|
|
157
|
+
case "non-json":
|
|
158
|
+
throw new errors.ChrtError({
|
|
159
|
+
statusCode: _response.error.statusCode,
|
|
160
|
+
body: _response.error.rawBody,
|
|
161
|
+
rawResponse: _response.rawResponse,
|
|
162
|
+
});
|
|
163
|
+
case "timeout":
|
|
164
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/session_by_device/get.");
|
|
165
|
+
case "unknown":
|
|
166
|
+
throw new errors.ChrtError({
|
|
167
|
+
message: _response.error.errorMessage,
|
|
168
|
+
rawResponse: _response.rawResponse,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
109
173
|
/**
|
|
110
174
|
* Return the most recent datapoint for a session.
|
|
111
175
|
*
|
|
@@ -308,27 +372,27 @@ class SessionByDevice {
|
|
|
308
372
|
});
|
|
309
373
|
}
|
|
310
374
|
/**
|
|
311
|
-
*
|
|
375
|
+
* Update a session's comments and/or public visibility status.
|
|
312
376
|
*
|
|
313
|
-
* @param {Chrt.tracking.
|
|
377
|
+
* @param {Chrt.tracking.SessionByDeviceUpdateRequest1} request
|
|
314
378
|
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
315
379
|
*
|
|
316
380
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
317
381
|
*
|
|
318
382
|
* @example
|
|
319
|
-
* await client.tracking.sessionByDevice.
|
|
383
|
+
* await client.tracking.sessionByDevice.update({
|
|
320
384
|
* session_id: "session_id"
|
|
321
385
|
* })
|
|
322
386
|
*/
|
|
323
|
-
|
|
324
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
387
|
+
update(request, requestOptions) {
|
|
388
|
+
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
|
|
325
389
|
}
|
|
326
|
-
|
|
390
|
+
__update(request, requestOptions) {
|
|
327
391
|
return __awaiter(this, void 0, void 0, function* () {
|
|
328
392
|
var _a, _b, _c, _d;
|
|
329
393
|
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);
|
|
330
394
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
331
|
-
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/
|
|
395
|
+
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/update"),
|
|
332
396
|
method: "POST",
|
|
333
397
|
headers: _headers,
|
|
334
398
|
contentType: "application/json",
|
|
@@ -362,7 +426,7 @@ class SessionByDevice {
|
|
|
362
426
|
rawResponse: _response.rawResponse,
|
|
363
427
|
});
|
|
364
428
|
case "timeout":
|
|
365
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/
|
|
429
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/update.");
|
|
366
430
|
case "unknown":
|
|
367
431
|
throw new errors.ChrtError({
|
|
368
432
|
message: _response.error.errorMessage,
|
|
@@ -691,6 +755,143 @@ class SessionByDevice {
|
|
|
691
755
|
}
|
|
692
756
|
});
|
|
693
757
|
}
|
|
758
|
+
/**
|
|
759
|
+
* Return the most recent datapoint for a session. Session must be have public=True.
|
|
760
|
+
*
|
|
761
|
+
* @param {Chrt.tracking.SessionByDeviceLastSeenPublicRequest} request
|
|
762
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
763
|
+
*
|
|
764
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
765
|
+
*
|
|
766
|
+
* @example
|
|
767
|
+
* await client.tracking.sessionByDevice.lastSeenPublic({
|
|
768
|
+
* session_id: "session_id"
|
|
769
|
+
* })
|
|
770
|
+
*/
|
|
771
|
+
lastSeenPublic(request, requestOptions) {
|
|
772
|
+
return core.HttpResponsePromise.fromPromise(this.__lastSeenPublic(request, requestOptions));
|
|
773
|
+
}
|
|
774
|
+
__lastSeenPublic(request, requestOptions) {
|
|
775
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
776
|
+
var _a, _b, _c, _d;
|
|
777
|
+
const { session_id: sessionId } = request;
|
|
778
|
+
const _queryParams = {};
|
|
779
|
+
_queryParams["session_id"] = sessionId;
|
|
780
|
+
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);
|
|
781
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
782
|
+
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/last_seen_public"),
|
|
783
|
+
method: "GET",
|
|
784
|
+
headers: _headers,
|
|
785
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
786
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
787
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
788
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
789
|
+
});
|
|
790
|
+
if (_response.ok) {
|
|
791
|
+
return {
|
|
792
|
+
data: _response.body,
|
|
793
|
+
rawResponse: _response.rawResponse,
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
if (_response.error.reason === "status-code") {
|
|
797
|
+
switch (_response.error.statusCode) {
|
|
798
|
+
case 422:
|
|
799
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
800
|
+
default:
|
|
801
|
+
throw new errors.ChrtError({
|
|
802
|
+
statusCode: _response.error.statusCode,
|
|
803
|
+
body: _response.error.body,
|
|
804
|
+
rawResponse: _response.rawResponse,
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
switch (_response.error.reason) {
|
|
809
|
+
case "non-json":
|
|
810
|
+
throw new errors.ChrtError({
|
|
811
|
+
statusCode: _response.error.statusCode,
|
|
812
|
+
body: _response.error.rawBody,
|
|
813
|
+
rawResponse: _response.rawResponse,
|
|
814
|
+
});
|
|
815
|
+
case "timeout":
|
|
816
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/session_by_device/last_seen_public.");
|
|
817
|
+
case "unknown":
|
|
818
|
+
throw new errors.ChrtError({
|
|
819
|
+
message: _response.error.errorMessage,
|
|
820
|
+
rawResponse: _response.rawResponse,
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Return a specified number of data points for a public session, intelligently sampled across the time range. Session must have public=True.
|
|
827
|
+
*
|
|
828
|
+
* @param {Chrt.tracking.SessionByDeviceDataPointsPublicRequest} request
|
|
829
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
830
|
+
*
|
|
831
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
832
|
+
*
|
|
833
|
+
* @example
|
|
834
|
+
* await client.tracking.sessionByDevice.dataPointsPublic({
|
|
835
|
+
* session_id: "session_id"
|
|
836
|
+
* })
|
|
837
|
+
*/
|
|
838
|
+
dataPointsPublic(request, requestOptions) {
|
|
839
|
+
return core.HttpResponsePromise.fromPromise(this.__dataPointsPublic(request, requestOptions));
|
|
840
|
+
}
|
|
841
|
+
__dataPointsPublic(request, requestOptions) {
|
|
842
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
843
|
+
var _a, _b, _c, _d, _e;
|
|
844
|
+
const { session_id: sessionId, limit } = request;
|
|
845
|
+
const _queryParams = {};
|
|
846
|
+
_queryParams["session_id"] = sessionId;
|
|
847
|
+
if (limit !== undefined) {
|
|
848
|
+
_queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
|
|
849
|
+
}
|
|
850
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
851
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
852
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ChrtEnvironment.Local, "tracking/session_by_device/data_points/public"),
|
|
853
|
+
method: "GET",
|
|
854
|
+
headers: _headers,
|
|
855
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
856
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
857
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
858
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
859
|
+
});
|
|
860
|
+
if (_response.ok) {
|
|
861
|
+
return {
|
|
862
|
+
data: _response.body,
|
|
863
|
+
rawResponse: _response.rawResponse,
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
if (_response.error.reason === "status-code") {
|
|
867
|
+
switch (_response.error.statusCode) {
|
|
868
|
+
case 422:
|
|
869
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
870
|
+
default:
|
|
871
|
+
throw new errors.ChrtError({
|
|
872
|
+
statusCode: _response.error.statusCode,
|
|
873
|
+
body: _response.error.body,
|
|
874
|
+
rawResponse: _response.rawResponse,
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
switch (_response.error.reason) {
|
|
879
|
+
case "non-json":
|
|
880
|
+
throw new errors.ChrtError({
|
|
881
|
+
statusCode: _response.error.statusCode,
|
|
882
|
+
body: _response.error.rawBody,
|
|
883
|
+
rawResponse: _response.rawResponse,
|
|
884
|
+
});
|
|
885
|
+
case "timeout":
|
|
886
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/session_by_device/data_points/public.");
|
|
887
|
+
case "unknown":
|
|
888
|
+
throw new errors.ChrtError({
|
|
889
|
+
message: _response.error.errorMessage,
|
|
890
|
+
rawResponse: _response.rawResponse,
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
}
|
|
694
895
|
_getAuthorizationHeader() {
|
|
695
896
|
return __awaiter(this, void 0, void 0, function* () {
|
|
696
897
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
* session_id: "session_id"
|
|
8
8
|
* }
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface SessionByDeviceUpdateRequest1 {
|
|
11
11
|
session_id: string;
|
|
12
12
|
comments?: string | null;
|
|
13
13
|
delete_comments?: boolean;
|
|
14
|
+
public?: boolean | null;
|
|
14
15
|
}
|
package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
export { type SessionByDeviceGetRequest } from "./SessionByDeviceGetRequest.js";
|
|
1
2
|
export { type SessionByDeviceLastSeenRequest } from "./SessionByDeviceLastSeenRequest.js";
|
|
2
3
|
export { type SessionByDeviceDataPointsRequest } from "./SessionByDeviceDataPointsRequest.js";
|
|
3
4
|
export { type SessionByDeviceCreateSessionRequest1 } from "./SessionByDeviceCreateSessionRequest1.js";
|
|
4
|
-
export { type
|
|
5
|
+
export { type SessionByDeviceUpdateRequest1 } from "./SessionByDeviceUpdateRequest1.js";
|
|
5
6
|
export { type SessionByDeviceStartRequest } from "./SessionByDeviceStartRequest.js";
|
|
6
7
|
export { type SessionByDevicePauseRecordingRequest } from "./SessionByDevicePauseRecordingRequest.js";
|
|
7
8
|
export { type SessionByDeviceResumeRecordingRequest } from "./SessionByDeviceResumeRecordingRequest.js";
|
|
8
9
|
export { type SessionByDeviceTerminateRequest } from "./SessionByDeviceTerminateRequest.js";
|
|
9
10
|
export { type SessionByDeviceDeleteRequest } from "./SessionByDeviceDeleteRequest.js";
|
|
11
|
+
export { type SessionByDeviceLastSeenPublicRequest } from "./SessionByDeviceLastSeenPublicRequest.js";
|
|
12
|
+
export { type SessionByDeviceDataPointsPublicRequest } from "./SessionByDeviceDataPointsPublicRequest.js";
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.268.1";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -32,8 +32,8 @@ export class ChrtClient {
|
|
|
32
32
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
33
33
|
"X-Fern-Language": "JavaScript",
|
|
34
34
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
35
|
-
"X-Fern-SDK-Version": "1.
|
|
36
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
35
|
+
"X-Fern-SDK-Version": "1.268.1",
|
|
36
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.268.1",
|
|
37
37
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
38
38
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
39
39
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -40,6 +40,21 @@ export declare class SessionByDevice {
|
|
|
40
40
|
*/
|
|
41
41
|
list(requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<Chrt.Session1[]>;
|
|
42
42
|
private __list;
|
|
43
|
+
/**
|
|
44
|
+
* Get a single session document by session_id.
|
|
45
|
+
*
|
|
46
|
+
* @param {Chrt.tracking.SessionByDeviceGetRequest} request
|
|
47
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
|
+
*
|
|
49
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await client.tracking.sessionByDevice.get({
|
|
53
|
+
* session_id: "session_id"
|
|
54
|
+
* })
|
|
55
|
+
*/
|
|
56
|
+
get(request: Chrt.tracking.SessionByDeviceGetRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<Chrt.Session1>;
|
|
57
|
+
private __get;
|
|
43
58
|
/**
|
|
44
59
|
* Return the most recent datapoint for a session.
|
|
45
60
|
*
|
|
@@ -86,20 +101,20 @@ export declare class SessionByDevice {
|
|
|
86
101
|
createSession(request: Chrt.tracking.SessionByDeviceCreateSessionRequest1, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<string>;
|
|
87
102
|
private __createSession;
|
|
88
103
|
/**
|
|
89
|
-
*
|
|
104
|
+
* Update a session's comments and/or public visibility status.
|
|
90
105
|
*
|
|
91
|
-
* @param {Chrt.tracking.
|
|
106
|
+
* @param {Chrt.tracking.SessionByDeviceUpdateRequest1} request
|
|
92
107
|
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
93
108
|
*
|
|
94
109
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
95
110
|
*
|
|
96
111
|
* @example
|
|
97
|
-
* await client.tracking.sessionByDevice.
|
|
112
|
+
* await client.tracking.sessionByDevice.update({
|
|
98
113
|
* session_id: "session_id"
|
|
99
114
|
* })
|
|
100
115
|
*/
|
|
101
|
-
|
|
102
|
-
private
|
|
116
|
+
update(request: Chrt.tracking.SessionByDeviceUpdateRequest1, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
117
|
+
private __update;
|
|
103
118
|
/**
|
|
104
119
|
* Start a session (set recording=true).
|
|
105
120
|
*
|
|
@@ -175,5 +190,35 @@ export declare class SessionByDevice {
|
|
|
175
190
|
*/
|
|
176
191
|
delete(request: Chrt.tracking.SessionByDeviceDeleteRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<Chrt.SessionByDeviceDeleteResponse1>;
|
|
177
192
|
private __delete;
|
|
193
|
+
/**
|
|
194
|
+
* Return the most recent datapoint for a session. Session must be have public=True.
|
|
195
|
+
*
|
|
196
|
+
* @param {Chrt.tracking.SessionByDeviceLastSeenPublicRequest} request
|
|
197
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
|
+
*
|
|
199
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* await client.tracking.sessionByDevice.lastSeenPublic({
|
|
203
|
+
* session_id: "session_id"
|
|
204
|
+
* })
|
|
205
|
+
*/
|
|
206
|
+
lastSeenPublic(request: Chrt.tracking.SessionByDeviceLastSeenPublicRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<(Chrt.TrackingSessionByDeviceDataPoint1 | null) | undefined>;
|
|
207
|
+
private __lastSeenPublic;
|
|
208
|
+
/**
|
|
209
|
+
* Return a specified number of data points for a public session, intelligently sampled across the time range. Session must have public=True.
|
|
210
|
+
*
|
|
211
|
+
* @param {Chrt.tracking.SessionByDeviceDataPointsPublicRequest} request
|
|
212
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
213
|
+
*
|
|
214
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* await client.tracking.sessionByDevice.dataPointsPublic({
|
|
218
|
+
* session_id: "session_id"
|
|
219
|
+
* })
|
|
220
|
+
*/
|
|
221
|
+
dataPointsPublic(request: Chrt.tracking.SessionByDeviceDataPointsPublicRequest, requestOptions?: SessionByDevice.RequestOptions): core.HttpResponsePromise<Chrt.TrackingSessionByDeviceDataPoint1[]>;
|
|
222
|
+
private __dataPointsPublic;
|
|
178
223
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
179
224
|
}
|
|
@@ -70,6 +70,70 @@ export class SessionByDevice {
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Get a single session document by session_id.
|
|
75
|
+
*
|
|
76
|
+
* @param {Chrt.tracking.SessionByDeviceGetRequest} request
|
|
77
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
|
+
*
|
|
79
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* await client.tracking.sessionByDevice.get({
|
|
83
|
+
* session_id: "session_id"
|
|
84
|
+
* })
|
|
85
|
+
*/
|
|
86
|
+
get(request, requestOptions) {
|
|
87
|
+
return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions));
|
|
88
|
+
}
|
|
89
|
+
__get(request, requestOptions) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
var _a, _b, _c, _d;
|
|
92
|
+
const { session_id: sessionId } = request;
|
|
93
|
+
const _queryParams = {};
|
|
94
|
+
_queryParams["session_id"] = sessionId;
|
|
95
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
96
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
97
|
+
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/get"),
|
|
98
|
+
method: "GET",
|
|
99
|
+
headers: _headers,
|
|
100
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
101
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
102
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
103
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
104
|
+
});
|
|
105
|
+
if (_response.ok) {
|
|
106
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
107
|
+
}
|
|
108
|
+
if (_response.error.reason === "status-code") {
|
|
109
|
+
switch (_response.error.statusCode) {
|
|
110
|
+
case 422:
|
|
111
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
112
|
+
default:
|
|
113
|
+
throw new errors.ChrtError({
|
|
114
|
+
statusCode: _response.error.statusCode,
|
|
115
|
+
body: _response.error.body,
|
|
116
|
+
rawResponse: _response.rawResponse,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
switch (_response.error.reason) {
|
|
121
|
+
case "non-json":
|
|
122
|
+
throw new errors.ChrtError({
|
|
123
|
+
statusCode: _response.error.statusCode,
|
|
124
|
+
body: _response.error.rawBody,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
126
|
+
});
|
|
127
|
+
case "timeout":
|
|
128
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/session_by_device/get.");
|
|
129
|
+
case "unknown":
|
|
130
|
+
throw new errors.ChrtError({
|
|
131
|
+
message: _response.error.errorMessage,
|
|
132
|
+
rawResponse: _response.rawResponse,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
73
137
|
/**
|
|
74
138
|
* Return the most recent datapoint for a session.
|
|
75
139
|
*
|
|
@@ -272,27 +336,27 @@ export class SessionByDevice {
|
|
|
272
336
|
});
|
|
273
337
|
}
|
|
274
338
|
/**
|
|
275
|
-
*
|
|
339
|
+
* Update a session's comments and/or public visibility status.
|
|
276
340
|
*
|
|
277
|
-
* @param {Chrt.tracking.
|
|
341
|
+
* @param {Chrt.tracking.SessionByDeviceUpdateRequest1} request
|
|
278
342
|
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
279
343
|
*
|
|
280
344
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
281
345
|
*
|
|
282
346
|
* @example
|
|
283
|
-
* await client.tracking.sessionByDevice.
|
|
347
|
+
* await client.tracking.sessionByDevice.update({
|
|
284
348
|
* session_id: "session_id"
|
|
285
349
|
* })
|
|
286
350
|
*/
|
|
287
|
-
|
|
288
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
351
|
+
update(request, requestOptions) {
|
|
352
|
+
return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions));
|
|
289
353
|
}
|
|
290
|
-
|
|
354
|
+
__update(request, requestOptions) {
|
|
291
355
|
return __awaiter(this, void 0, void 0, function* () {
|
|
292
356
|
var _a, _b, _c, _d;
|
|
293
357
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
294
358
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
295
|
-
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/
|
|
359
|
+
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/update"),
|
|
296
360
|
method: "POST",
|
|
297
361
|
headers: _headers,
|
|
298
362
|
contentType: "application/json",
|
|
@@ -326,7 +390,7 @@ export class SessionByDevice {
|
|
|
326
390
|
rawResponse: _response.rawResponse,
|
|
327
391
|
});
|
|
328
392
|
case "timeout":
|
|
329
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/
|
|
393
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/update.");
|
|
330
394
|
case "unknown":
|
|
331
395
|
throw new errors.ChrtError({
|
|
332
396
|
message: _response.error.errorMessage,
|
|
@@ -655,6 +719,143 @@ export class SessionByDevice {
|
|
|
655
719
|
}
|
|
656
720
|
});
|
|
657
721
|
}
|
|
722
|
+
/**
|
|
723
|
+
* Return the most recent datapoint for a session. Session must be have public=True.
|
|
724
|
+
*
|
|
725
|
+
* @param {Chrt.tracking.SessionByDeviceLastSeenPublicRequest} request
|
|
726
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
727
|
+
*
|
|
728
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
729
|
+
*
|
|
730
|
+
* @example
|
|
731
|
+
* await client.tracking.sessionByDevice.lastSeenPublic({
|
|
732
|
+
* session_id: "session_id"
|
|
733
|
+
* })
|
|
734
|
+
*/
|
|
735
|
+
lastSeenPublic(request, requestOptions) {
|
|
736
|
+
return core.HttpResponsePromise.fromPromise(this.__lastSeenPublic(request, requestOptions));
|
|
737
|
+
}
|
|
738
|
+
__lastSeenPublic(request, requestOptions) {
|
|
739
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
740
|
+
var _a, _b, _c, _d;
|
|
741
|
+
const { session_id: sessionId } = request;
|
|
742
|
+
const _queryParams = {};
|
|
743
|
+
_queryParams["session_id"] = sessionId;
|
|
744
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
745
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
746
|
+
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/last_seen_public"),
|
|
747
|
+
method: "GET",
|
|
748
|
+
headers: _headers,
|
|
749
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
750
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
751
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
752
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
753
|
+
});
|
|
754
|
+
if (_response.ok) {
|
|
755
|
+
return {
|
|
756
|
+
data: _response.body,
|
|
757
|
+
rawResponse: _response.rawResponse,
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
if (_response.error.reason === "status-code") {
|
|
761
|
+
switch (_response.error.statusCode) {
|
|
762
|
+
case 422:
|
|
763
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
764
|
+
default:
|
|
765
|
+
throw new errors.ChrtError({
|
|
766
|
+
statusCode: _response.error.statusCode,
|
|
767
|
+
body: _response.error.body,
|
|
768
|
+
rawResponse: _response.rawResponse,
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
switch (_response.error.reason) {
|
|
773
|
+
case "non-json":
|
|
774
|
+
throw new errors.ChrtError({
|
|
775
|
+
statusCode: _response.error.statusCode,
|
|
776
|
+
body: _response.error.rawBody,
|
|
777
|
+
rawResponse: _response.rawResponse,
|
|
778
|
+
});
|
|
779
|
+
case "timeout":
|
|
780
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/session_by_device/last_seen_public.");
|
|
781
|
+
case "unknown":
|
|
782
|
+
throw new errors.ChrtError({
|
|
783
|
+
message: _response.error.errorMessage,
|
|
784
|
+
rawResponse: _response.rawResponse,
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Return a specified number of data points for a public session, intelligently sampled across the time range. Session must have public=True.
|
|
791
|
+
*
|
|
792
|
+
* @param {Chrt.tracking.SessionByDeviceDataPointsPublicRequest} request
|
|
793
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
794
|
+
*
|
|
795
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
796
|
+
*
|
|
797
|
+
* @example
|
|
798
|
+
* await client.tracking.sessionByDevice.dataPointsPublic({
|
|
799
|
+
* session_id: "session_id"
|
|
800
|
+
* })
|
|
801
|
+
*/
|
|
802
|
+
dataPointsPublic(request, requestOptions) {
|
|
803
|
+
return core.HttpResponsePromise.fromPromise(this.__dataPointsPublic(request, requestOptions));
|
|
804
|
+
}
|
|
805
|
+
__dataPointsPublic(request, requestOptions) {
|
|
806
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
807
|
+
var _a, _b, _c, _d, _e;
|
|
808
|
+
const { session_id: sessionId, limit } = request;
|
|
809
|
+
const _queryParams = {};
|
|
810
|
+
_queryParams["session_id"] = sessionId;
|
|
811
|
+
if (limit !== undefined) {
|
|
812
|
+
_queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
|
|
813
|
+
}
|
|
814
|
+
let _headers = mergeHeaders((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
815
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
816
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ChrtEnvironment.Local, "tracking/session_by_device/data_points/public"),
|
|
817
|
+
method: "GET",
|
|
818
|
+
headers: _headers,
|
|
819
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
820
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
821
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
822
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
823
|
+
});
|
|
824
|
+
if (_response.ok) {
|
|
825
|
+
return {
|
|
826
|
+
data: _response.body,
|
|
827
|
+
rawResponse: _response.rawResponse,
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
if (_response.error.reason === "status-code") {
|
|
831
|
+
switch (_response.error.statusCode) {
|
|
832
|
+
case 422:
|
|
833
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
834
|
+
default:
|
|
835
|
+
throw new errors.ChrtError({
|
|
836
|
+
statusCode: _response.error.statusCode,
|
|
837
|
+
body: _response.error.body,
|
|
838
|
+
rawResponse: _response.rawResponse,
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
switch (_response.error.reason) {
|
|
843
|
+
case "non-json":
|
|
844
|
+
throw new errors.ChrtError({
|
|
845
|
+
statusCode: _response.error.statusCode,
|
|
846
|
+
body: _response.error.rawBody,
|
|
847
|
+
rawResponse: _response.rawResponse,
|
|
848
|
+
});
|
|
849
|
+
case "timeout":
|
|
850
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/session_by_device/data_points/public.");
|
|
851
|
+
case "unknown":
|
|
852
|
+
throw new errors.ChrtError({
|
|
853
|
+
message: _response.error.errorMessage,
|
|
854
|
+
rawResponse: _response.rawResponse,
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
}
|
|
658
859
|
_getAuthorizationHeader() {
|
|
659
860
|
return __awaiter(this, void 0, void 0, function* () {
|
|
660
861
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
* session_id: "session_id"
|
|
8
8
|
* }
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface SessionByDeviceUpdateRequest1 {
|
|
11
11
|
session_id: string;
|
|
12
12
|
comments?: string | null;
|
|
13
13
|
delete_comments?: boolean;
|
|
14
|
+
public?: boolean | null;
|
|
14
15
|
}
|
package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/index.d.mts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
export { type SessionByDeviceGetRequest } from "./SessionByDeviceGetRequest.mjs";
|
|
1
2
|
export { type SessionByDeviceLastSeenRequest } from "./SessionByDeviceLastSeenRequest.mjs";
|
|
2
3
|
export { type SessionByDeviceDataPointsRequest } from "./SessionByDeviceDataPointsRequest.mjs";
|
|
3
4
|
export { type SessionByDeviceCreateSessionRequest1 } from "./SessionByDeviceCreateSessionRequest1.mjs";
|
|
4
|
-
export { type
|
|
5
|
+
export { type SessionByDeviceUpdateRequest1 } from "./SessionByDeviceUpdateRequest1.mjs";
|
|
5
6
|
export { type SessionByDeviceStartRequest } from "./SessionByDeviceStartRequest.mjs";
|
|
6
7
|
export { type SessionByDevicePauseRecordingRequest } from "./SessionByDevicePauseRecordingRequest.mjs";
|
|
7
8
|
export { type SessionByDeviceResumeRecordingRequest } from "./SessionByDeviceResumeRecordingRequest.mjs";
|
|
8
9
|
export { type SessionByDeviceTerminateRequest } from "./SessionByDeviceTerminateRequest.mjs";
|
|
9
10
|
export { type SessionByDeviceDeleteRequest } from "./SessionByDeviceDeleteRequest.mjs";
|
|
11
|
+
export { type SessionByDeviceLastSeenPublicRequest } from "./SessionByDeviceLastSeenPublicRequest.mjs";
|
|
12
|
+
export { type SessionByDeviceDataPointsPublicRequest } from "./SessionByDeviceDataPointsPublicRequest.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.268.1";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.
|
|
1
|
+
export const SDK_VERSION = "1.268.1";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -9014,6 +9014,71 @@ await client.tracking.sessionByDevice.list();
|
|
|
9014
9014
|
</dl>
|
|
9015
9015
|
</details>
|
|
9016
9016
|
|
|
9017
|
+
<details><summary><code>client.tracking.sessionByDevice.<a href="/src/api/resources/tracking/resources/sessionByDevice/client/Client.ts">get</a>({ ...params }) -> Chrt.Session1</code></summary>
|
|
9018
|
+
<dl>
|
|
9019
|
+
<dd>
|
|
9020
|
+
|
|
9021
|
+
#### 📝 Description
|
|
9022
|
+
|
|
9023
|
+
<dl>
|
|
9024
|
+
<dd>
|
|
9025
|
+
|
|
9026
|
+
<dl>
|
|
9027
|
+
<dd>
|
|
9028
|
+
|
|
9029
|
+
Get a single session document by session_id.
|
|
9030
|
+
|
|
9031
|
+
</dd>
|
|
9032
|
+
</dl>
|
|
9033
|
+
</dd>
|
|
9034
|
+
</dl>
|
|
9035
|
+
|
|
9036
|
+
#### 🔌 Usage
|
|
9037
|
+
|
|
9038
|
+
<dl>
|
|
9039
|
+
<dd>
|
|
9040
|
+
|
|
9041
|
+
<dl>
|
|
9042
|
+
<dd>
|
|
9043
|
+
|
|
9044
|
+
```typescript
|
|
9045
|
+
await client.tracking.sessionByDevice.get({
|
|
9046
|
+
session_id: "session_id",
|
|
9047
|
+
});
|
|
9048
|
+
```
|
|
9049
|
+
|
|
9050
|
+
</dd>
|
|
9051
|
+
</dl>
|
|
9052
|
+
</dd>
|
|
9053
|
+
</dl>
|
|
9054
|
+
|
|
9055
|
+
#### ⚙️ Parameters
|
|
9056
|
+
|
|
9057
|
+
<dl>
|
|
9058
|
+
<dd>
|
|
9059
|
+
|
|
9060
|
+
<dl>
|
|
9061
|
+
<dd>
|
|
9062
|
+
|
|
9063
|
+
**request:** `Chrt.tracking.SessionByDeviceGetRequest`
|
|
9064
|
+
|
|
9065
|
+
</dd>
|
|
9066
|
+
</dl>
|
|
9067
|
+
|
|
9068
|
+
<dl>
|
|
9069
|
+
<dd>
|
|
9070
|
+
|
|
9071
|
+
**requestOptions:** `SessionByDevice.RequestOptions`
|
|
9072
|
+
|
|
9073
|
+
</dd>
|
|
9074
|
+
</dl>
|
|
9075
|
+
</dd>
|
|
9076
|
+
</dl>
|
|
9077
|
+
|
|
9078
|
+
</dd>
|
|
9079
|
+
</dl>
|
|
9080
|
+
</details>
|
|
9081
|
+
|
|
9017
9082
|
<details><summary><code>client.tracking.sessionByDevice.<a href="/src/api/resources/tracking/resources/sessionByDevice/client/Client.ts">lastSeen</a>({ ...params }) -> (Chrt.TrackingSessionByDeviceDataPoint1 | null) | undefined</code></summary>
|
|
9018
9083
|
<dl>
|
|
9019
9084
|
<dd>
|
|
@@ -9209,7 +9274,7 @@ await client.tracking.sessionByDevice.createSession({
|
|
|
9209
9274
|
</dl>
|
|
9210
9275
|
</details>
|
|
9211
9276
|
|
|
9212
|
-
<details><summary><code>client.tracking.sessionByDevice.<a href="/src/api/resources/tracking/resources/sessionByDevice/client/Client.ts">
|
|
9277
|
+
<details><summary><code>client.tracking.sessionByDevice.<a href="/src/api/resources/tracking/resources/sessionByDevice/client/Client.ts">update</a>({ ...params }) -> boolean</code></summary>
|
|
9213
9278
|
<dl>
|
|
9214
9279
|
<dd>
|
|
9215
9280
|
|
|
@@ -9221,7 +9286,7 @@ await client.tracking.sessionByDevice.createSession({
|
|
|
9221
9286
|
<dl>
|
|
9222
9287
|
<dd>
|
|
9223
9288
|
|
|
9224
|
-
|
|
9289
|
+
Update a session's comments and/or public visibility status.
|
|
9225
9290
|
|
|
9226
9291
|
</dd>
|
|
9227
9292
|
</dl>
|
|
@@ -9237,7 +9302,7 @@ Overwrite or delete the comments for a session.
|
|
|
9237
9302
|
<dd>
|
|
9238
9303
|
|
|
9239
9304
|
```typescript
|
|
9240
|
-
await client.tracking.sessionByDevice.
|
|
9305
|
+
await client.tracking.sessionByDevice.update({
|
|
9241
9306
|
session_id: "session_id",
|
|
9242
9307
|
});
|
|
9243
9308
|
```
|
|
@@ -9255,7 +9320,7 @@ await client.tracking.sessionByDevice.updateComments({
|
|
|
9255
9320
|
<dl>
|
|
9256
9321
|
<dd>
|
|
9257
9322
|
|
|
9258
|
-
**request:** `Chrt.tracking.
|
|
9323
|
+
**request:** `Chrt.tracking.SessionByDeviceUpdateRequest1`
|
|
9259
9324
|
|
|
9260
9325
|
</dd>
|
|
9261
9326
|
</dl>
|
|
@@ -9599,6 +9664,136 @@ await client.tracking.sessionByDevice.delete({
|
|
|
9599
9664
|
</dl>
|
|
9600
9665
|
</details>
|
|
9601
9666
|
|
|
9667
|
+
<details><summary><code>client.tracking.sessionByDevice.<a href="/src/api/resources/tracking/resources/sessionByDevice/client/Client.ts">lastSeenPublic</a>({ ...params }) -> (Chrt.TrackingSessionByDeviceDataPoint1 | null) | undefined</code></summary>
|
|
9668
|
+
<dl>
|
|
9669
|
+
<dd>
|
|
9670
|
+
|
|
9671
|
+
#### 📝 Description
|
|
9672
|
+
|
|
9673
|
+
<dl>
|
|
9674
|
+
<dd>
|
|
9675
|
+
|
|
9676
|
+
<dl>
|
|
9677
|
+
<dd>
|
|
9678
|
+
|
|
9679
|
+
Return the most recent datapoint for a session. Session must be have public=True.
|
|
9680
|
+
|
|
9681
|
+
</dd>
|
|
9682
|
+
</dl>
|
|
9683
|
+
</dd>
|
|
9684
|
+
</dl>
|
|
9685
|
+
|
|
9686
|
+
#### 🔌 Usage
|
|
9687
|
+
|
|
9688
|
+
<dl>
|
|
9689
|
+
<dd>
|
|
9690
|
+
|
|
9691
|
+
<dl>
|
|
9692
|
+
<dd>
|
|
9693
|
+
|
|
9694
|
+
```typescript
|
|
9695
|
+
await client.tracking.sessionByDevice.lastSeenPublic({
|
|
9696
|
+
session_id: "session_id",
|
|
9697
|
+
});
|
|
9698
|
+
```
|
|
9699
|
+
|
|
9700
|
+
</dd>
|
|
9701
|
+
</dl>
|
|
9702
|
+
</dd>
|
|
9703
|
+
</dl>
|
|
9704
|
+
|
|
9705
|
+
#### ⚙️ Parameters
|
|
9706
|
+
|
|
9707
|
+
<dl>
|
|
9708
|
+
<dd>
|
|
9709
|
+
|
|
9710
|
+
<dl>
|
|
9711
|
+
<dd>
|
|
9712
|
+
|
|
9713
|
+
**request:** `Chrt.tracking.SessionByDeviceLastSeenPublicRequest`
|
|
9714
|
+
|
|
9715
|
+
</dd>
|
|
9716
|
+
</dl>
|
|
9717
|
+
|
|
9718
|
+
<dl>
|
|
9719
|
+
<dd>
|
|
9720
|
+
|
|
9721
|
+
**requestOptions:** `SessionByDevice.RequestOptions`
|
|
9722
|
+
|
|
9723
|
+
</dd>
|
|
9724
|
+
</dl>
|
|
9725
|
+
</dd>
|
|
9726
|
+
</dl>
|
|
9727
|
+
|
|
9728
|
+
</dd>
|
|
9729
|
+
</dl>
|
|
9730
|
+
</details>
|
|
9731
|
+
|
|
9732
|
+
<details><summary><code>client.tracking.sessionByDevice.<a href="/src/api/resources/tracking/resources/sessionByDevice/client/Client.ts">dataPointsPublic</a>({ ...params }) -> Chrt.TrackingSessionByDeviceDataPoint1[]</code></summary>
|
|
9733
|
+
<dl>
|
|
9734
|
+
<dd>
|
|
9735
|
+
|
|
9736
|
+
#### 📝 Description
|
|
9737
|
+
|
|
9738
|
+
<dl>
|
|
9739
|
+
<dd>
|
|
9740
|
+
|
|
9741
|
+
<dl>
|
|
9742
|
+
<dd>
|
|
9743
|
+
|
|
9744
|
+
Return a specified number of data points for a public session, intelligently sampled across the time range. Session must have public=True.
|
|
9745
|
+
|
|
9746
|
+
</dd>
|
|
9747
|
+
</dl>
|
|
9748
|
+
</dd>
|
|
9749
|
+
</dl>
|
|
9750
|
+
|
|
9751
|
+
#### 🔌 Usage
|
|
9752
|
+
|
|
9753
|
+
<dl>
|
|
9754
|
+
<dd>
|
|
9755
|
+
|
|
9756
|
+
<dl>
|
|
9757
|
+
<dd>
|
|
9758
|
+
|
|
9759
|
+
```typescript
|
|
9760
|
+
await client.tracking.sessionByDevice.dataPointsPublic({
|
|
9761
|
+
session_id: "session_id",
|
|
9762
|
+
});
|
|
9763
|
+
```
|
|
9764
|
+
|
|
9765
|
+
</dd>
|
|
9766
|
+
</dl>
|
|
9767
|
+
</dd>
|
|
9768
|
+
</dl>
|
|
9769
|
+
|
|
9770
|
+
#### ⚙️ Parameters
|
|
9771
|
+
|
|
9772
|
+
<dl>
|
|
9773
|
+
<dd>
|
|
9774
|
+
|
|
9775
|
+
<dl>
|
|
9776
|
+
<dd>
|
|
9777
|
+
|
|
9778
|
+
**request:** `Chrt.tracking.SessionByDeviceDataPointsPublicRequest`
|
|
9779
|
+
|
|
9780
|
+
</dd>
|
|
9781
|
+
</dl>
|
|
9782
|
+
|
|
9783
|
+
<dl>
|
|
9784
|
+
<dd>
|
|
9785
|
+
|
|
9786
|
+
**requestOptions:** `SessionByDevice.RequestOptions`
|
|
9787
|
+
|
|
9788
|
+
</dd>
|
|
9789
|
+
</dl>
|
|
9790
|
+
</dd>
|
|
9791
|
+
</dl>
|
|
9792
|
+
|
|
9793
|
+
</dd>
|
|
9794
|
+
</dl>
|
|
9795
|
+
</details>
|
|
9796
|
+
|
|
9602
9797
|
## Tracking TaskGroupByDriver
|
|
9603
9798
|
|
|
9604
9799
|
<details><summary><code>client.tracking.taskGroupByDriver.<a href="/src/api/resources/tracking/resources/taskGroupByDriver/client/Client.ts">lastSeen</a>({ ...params }) -> (Chrt.TrackingTaskGroupByDriverDataPoint1 | null) | undefined</code></summary>
|
|
File without changes
|