@chrt-inc/typescript-sdk 1.266.0 → 1.269.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/drivers/client/Client.d.ts +8 -1
- package/dist/cjs/api/resources/drivers/client/Client.js +8 -1
- package/dist/cjs/api/resources/drivers/client/requests/DriverLastSeenReq.d.ts +8 -1
- package/dist/cjs/api/resources/tracking/resources/driver/client/Client.d.ts +8 -1
- package/dist/cjs/api/resources/tracking/resources/driver/client/Client.js +8 -1
- package/dist/cjs/api/resources/tracking/resources/driver/client/requests/DriverUpdateReq.d.ts +8 -1
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.d.ts +66 -5
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.js +277 -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/SessionByDeviceLastSeenPublicRequest.d.ts +12 -0
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceMarkOutliersRequest1.d.ts +14 -0
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceMarkOutliersRequest1.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 +5 -1
- package/dist/cjs/api/types/{LocationFeatureInputGeometry.d.ts → Geometry.d.ts} +2 -2
- package/dist/cjs/api/types/Geometry.js +5 -0
- package/dist/cjs/api/types/LocationFeature.d.ts +5 -1
- package/dist/cjs/api/types/LocationProperties.d.ts +2 -0
- package/dist/cjs/api/types/OutlierLabellerEnum.d.ts +8 -0
- package/dist/cjs/api/types/OutlierLabellerEnum.js +10 -0
- package/dist/cjs/api/types/Session1.d.ts +1 -0
- package/dist/cjs/api/types/SessionByDeviceMarkOutliersResponse1.d.ts +7 -0
- package/dist/cjs/api/types/SessionByDeviceMarkOutliersResponse1.js +5 -0
- package/dist/cjs/api/types/TrackingCargoByDeviceDataPointMetadata1.d.ts +3 -0
- package/dist/cjs/api/types/TrackingCargoByDriverDataPointMetadata1.d.ts +3 -0
- package/dist/cjs/api/types/TrackingSessionByDeviceDataPointMetadata1.d.ts +3 -0
- package/dist/cjs/api/types/TrackingTaskGroupByDriverDataPointMetadata1.d.ts +3 -0
- package/dist/cjs/api/types/index.d.ts +3 -2
- package/dist/cjs/api/types/index.js +3 -2
- 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/drivers/client/Client.d.mts +8 -1
- package/dist/esm/api/resources/drivers/client/Client.mjs +8 -1
- package/dist/esm/api/resources/drivers/client/requests/DriverLastSeenReq.d.mts +8 -1
- package/dist/esm/api/resources/tracking/resources/driver/client/Client.d.mts +8 -1
- package/dist/esm/api/resources/tracking/resources/driver/client/Client.mjs +8 -1
- package/dist/esm/api/resources/tracking/resources/driver/client/requests/DriverUpdateReq.d.mts +8 -1
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.d.mts +66 -5
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.mjs +277 -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/SessionByDeviceLastSeenPublicRequest.d.mts +12 -0
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceMarkOutliersRequest1.d.mts +14 -0
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceMarkOutliersRequest1.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 +5 -1
- package/dist/esm/api/types/{LocationFeatureInputGeometry.d.mts → Geometry.d.mts} +2 -2
- package/dist/esm/api/types/Geometry.mjs +4 -0
- package/dist/esm/api/types/LocationFeature.d.mts +5 -1
- package/dist/esm/api/types/LocationProperties.d.mts +2 -0
- package/dist/esm/api/types/OutlierLabellerEnum.d.mts +8 -0
- package/dist/esm/api/types/OutlierLabellerEnum.mjs +7 -0
- package/dist/esm/api/types/Session1.d.mts +1 -0
- package/dist/esm/api/types/SessionByDeviceMarkOutliersResponse1.d.mts +7 -0
- package/dist/esm/api/types/SessionByDeviceMarkOutliersResponse1.mjs +4 -0
- package/dist/esm/api/types/TrackingCargoByDeviceDataPointMetadata1.d.mts +3 -0
- package/dist/esm/api/types/TrackingCargoByDriverDataPointMetadata1.d.mts +3 -0
- package/dist/esm/api/types/TrackingSessionByDeviceDataPointMetadata1.d.mts +3 -0
- package/dist/esm/api/types/TrackingTaskGroupByDriverDataPointMetadata1.d.mts +3 -0
- package/dist/esm/api/types/index.d.mts +3 -2
- package/dist/esm/api/types/index.mjs +3 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +283 -4
- package/dist/cjs/api/types/LocationFeatureOutputGeometry.d.ts +0 -28
- package/dist/esm/api/types/LocationFeatureOutputGeometry.d.mts +0 -28
- /package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceUpdateCommentsRequest1.js → SessionByDeviceDataPointsPublicRequest.js} +0 -0
- /package/dist/cjs/api/{types/LocationFeatureInputGeometry.js → resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceGetRequest.js} +0 -0
- /package/dist/cjs/api/{types/LocationFeatureOutputGeometry.js → resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceLastSeenPublicRequest.js} +0 -0
- /package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/requests/{SessionByDeviceUpdateCommentsRequest1.mjs → SessionByDeviceDataPointsPublicRequest.mjs} +0 -0
- /package/dist/esm/api/{types/LocationFeatureInputGeometry.mjs → resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceGetRequest.mjs} +0 -0
- /package/dist/esm/api/{types/LocationFeatureOutputGeometry.mjs → resources/tracking/resources/sessionByDevice/client/requests/SessionByDeviceLastSeenPublicRequest.mjs} +0 -0
|
@@ -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,
|
|
@@ -591,6 +655,74 @@ export class SessionByDevice {
|
|
|
591
655
|
}
|
|
592
656
|
});
|
|
593
657
|
}
|
|
658
|
+
/**
|
|
659
|
+
* Mark data points as outliers or non-outliers. Uses atomic delete + insert strategy for time-series collection updates.
|
|
660
|
+
*
|
|
661
|
+
* @param {Chrt.tracking.SessionByDeviceMarkOutliersRequest1} request
|
|
662
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
663
|
+
*
|
|
664
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
665
|
+
*
|
|
666
|
+
* @example
|
|
667
|
+
* await client.tracking.sessionByDevice.outlier({
|
|
668
|
+
* tracking_session_by_device_data_point_ids: ["tracking_session_by_device_data_point_ids"],
|
|
669
|
+
* outlier: true
|
|
670
|
+
* })
|
|
671
|
+
*/
|
|
672
|
+
outlier(request, requestOptions) {
|
|
673
|
+
return core.HttpResponsePromise.fromPromise(this.__outlier(request, requestOptions));
|
|
674
|
+
}
|
|
675
|
+
__outlier(request, requestOptions) {
|
|
676
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
677
|
+
var _a, _b, _c, _d;
|
|
678
|
+
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);
|
|
679
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
680
|
+
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/outlier"),
|
|
681
|
+
method: "POST",
|
|
682
|
+
headers: _headers,
|
|
683
|
+
contentType: "application/json",
|
|
684
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
685
|
+
requestType: "json",
|
|
686
|
+
body: request,
|
|
687
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
688
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
689
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
690
|
+
});
|
|
691
|
+
if (_response.ok) {
|
|
692
|
+
return {
|
|
693
|
+
data: _response.body,
|
|
694
|
+
rawResponse: _response.rawResponse,
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
if (_response.error.reason === "status-code") {
|
|
698
|
+
switch (_response.error.statusCode) {
|
|
699
|
+
case 422:
|
|
700
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
701
|
+
default:
|
|
702
|
+
throw new errors.ChrtError({
|
|
703
|
+
statusCode: _response.error.statusCode,
|
|
704
|
+
body: _response.error.body,
|
|
705
|
+
rawResponse: _response.rawResponse,
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
switch (_response.error.reason) {
|
|
710
|
+
case "non-json":
|
|
711
|
+
throw new errors.ChrtError({
|
|
712
|
+
statusCode: _response.error.statusCode,
|
|
713
|
+
body: _response.error.rawBody,
|
|
714
|
+
rawResponse: _response.rawResponse,
|
|
715
|
+
});
|
|
716
|
+
case "timeout":
|
|
717
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking/session_by_device/outlier.");
|
|
718
|
+
case "unknown":
|
|
719
|
+
throw new errors.ChrtError({
|
|
720
|
+
message: _response.error.errorMessage,
|
|
721
|
+
rawResponse: _response.rawResponse,
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
});
|
|
725
|
+
}
|
|
594
726
|
/**
|
|
595
727
|
* Delete a terminated session and all associated timeseries data.
|
|
596
728
|
*
|
|
@@ -655,6 +787,143 @@ export class SessionByDevice {
|
|
|
655
787
|
}
|
|
656
788
|
});
|
|
657
789
|
}
|
|
790
|
+
/**
|
|
791
|
+
* Return the most recent datapoint for a session. Session must be have public=True.
|
|
792
|
+
*
|
|
793
|
+
* @param {Chrt.tracking.SessionByDeviceLastSeenPublicRequest} request
|
|
794
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
795
|
+
*
|
|
796
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
797
|
+
*
|
|
798
|
+
* @example
|
|
799
|
+
* await client.tracking.sessionByDevice.lastSeenPublic({
|
|
800
|
+
* session_id: "session_id"
|
|
801
|
+
* })
|
|
802
|
+
*/
|
|
803
|
+
lastSeenPublic(request, requestOptions) {
|
|
804
|
+
return core.HttpResponsePromise.fromPromise(this.__lastSeenPublic(request, requestOptions));
|
|
805
|
+
}
|
|
806
|
+
__lastSeenPublic(request, requestOptions) {
|
|
807
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
808
|
+
var _a, _b, _c, _d;
|
|
809
|
+
const { session_id: sessionId } = request;
|
|
810
|
+
const _queryParams = {};
|
|
811
|
+
_queryParams["session_id"] = sessionId;
|
|
812
|
+
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);
|
|
813
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
814
|
+
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"),
|
|
815
|
+
method: "GET",
|
|
816
|
+
headers: _headers,
|
|
817
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
818
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
819
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
820
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
821
|
+
});
|
|
822
|
+
if (_response.ok) {
|
|
823
|
+
return {
|
|
824
|
+
data: _response.body,
|
|
825
|
+
rawResponse: _response.rawResponse,
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
if (_response.error.reason === "status-code") {
|
|
829
|
+
switch (_response.error.statusCode) {
|
|
830
|
+
case 422:
|
|
831
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
832
|
+
default:
|
|
833
|
+
throw new errors.ChrtError({
|
|
834
|
+
statusCode: _response.error.statusCode,
|
|
835
|
+
body: _response.error.body,
|
|
836
|
+
rawResponse: _response.rawResponse,
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
switch (_response.error.reason) {
|
|
841
|
+
case "non-json":
|
|
842
|
+
throw new errors.ChrtError({
|
|
843
|
+
statusCode: _response.error.statusCode,
|
|
844
|
+
body: _response.error.rawBody,
|
|
845
|
+
rawResponse: _response.rawResponse,
|
|
846
|
+
});
|
|
847
|
+
case "timeout":
|
|
848
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/session_by_device/last_seen_public.");
|
|
849
|
+
case "unknown":
|
|
850
|
+
throw new errors.ChrtError({
|
|
851
|
+
message: _response.error.errorMessage,
|
|
852
|
+
rawResponse: _response.rawResponse,
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Return a specified number of data points for a public session, intelligently sampled across the time range. Session must have public=True.
|
|
859
|
+
*
|
|
860
|
+
* @param {Chrt.tracking.SessionByDeviceDataPointsPublicRequest} request
|
|
861
|
+
* @param {SessionByDevice.RequestOptions} requestOptions - Request-specific configuration.
|
|
862
|
+
*
|
|
863
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
864
|
+
*
|
|
865
|
+
* @example
|
|
866
|
+
* await client.tracking.sessionByDevice.dataPointsPublic({
|
|
867
|
+
* session_id: "session_id"
|
|
868
|
+
* })
|
|
869
|
+
*/
|
|
870
|
+
dataPointsPublic(request, requestOptions) {
|
|
871
|
+
return core.HttpResponsePromise.fromPromise(this.__dataPointsPublic(request, requestOptions));
|
|
872
|
+
}
|
|
873
|
+
__dataPointsPublic(request, requestOptions) {
|
|
874
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
875
|
+
var _a, _b, _c, _d, _e;
|
|
876
|
+
const { session_id: sessionId, limit } = request;
|
|
877
|
+
const _queryParams = {};
|
|
878
|
+
_queryParams["session_id"] = sessionId;
|
|
879
|
+
if (limit !== undefined) {
|
|
880
|
+
_queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
|
|
881
|
+
}
|
|
882
|
+
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);
|
|
883
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
884
|
+
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"),
|
|
885
|
+
method: "GET",
|
|
886
|
+
headers: _headers,
|
|
887
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
888
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
889
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
890
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
891
|
+
});
|
|
892
|
+
if (_response.ok) {
|
|
893
|
+
return {
|
|
894
|
+
data: _response.body,
|
|
895
|
+
rawResponse: _response.rawResponse,
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
if (_response.error.reason === "status-code") {
|
|
899
|
+
switch (_response.error.statusCode) {
|
|
900
|
+
case 422:
|
|
901
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
902
|
+
default:
|
|
903
|
+
throw new errors.ChrtError({
|
|
904
|
+
statusCode: _response.error.statusCode,
|
|
905
|
+
body: _response.error.body,
|
|
906
|
+
rawResponse: _response.rawResponse,
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
switch (_response.error.reason) {
|
|
911
|
+
case "non-json":
|
|
912
|
+
throw new errors.ChrtError({
|
|
913
|
+
statusCode: _response.error.statusCode,
|
|
914
|
+
body: _response.error.rawBody,
|
|
915
|
+
rawResponse: _response.rawResponse,
|
|
916
|
+
});
|
|
917
|
+
case "timeout":
|
|
918
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/session_by_device/data_points/public.");
|
|
919
|
+
case "unknown":
|
|
920
|
+
throw new errors.ChrtError({
|
|
921
|
+
message: _response.error.errorMessage,
|
|
922
|
+
rawResponse: _response.rawResponse,
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
}
|
|
658
927
|
_getAuthorizationHeader() {
|
|
659
928
|
return __awaiter(this, void 0, void 0, function* () {
|
|
660
929
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* tracking_session_by_device_data_point_ids: ["tracking_session_by_device_data_point_ids"],
|
|
8
|
+
* outlier: true
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface SessionByDeviceMarkOutliersRequest1 {
|
|
12
|
+
tracking_session_by_device_data_point_ids: string[];
|
|
13
|
+
outlier: boolean;
|
|
14
|
+
}
|
|
@@ -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,13 @@
|
|
|
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";
|
|
10
|
+
export { type SessionByDeviceMarkOutliersRequest1 } from "./SessionByDeviceMarkOutliersRequest1.mjs";
|
|
9
11
|
export { type SessionByDeviceDeleteRequest } from "./SessionByDeviceDeleteRequest.mjs";
|
|
12
|
+
export { type SessionByDeviceLastSeenPublicRequest } from "./SessionByDeviceLastSeenPublicRequest.mjs";
|
|
13
|
+
export { type SessionByDeviceDataPointsPublicRequest } from "./SessionByDeviceDataPointsPublicRequest.mjs";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Chrt from "../index.mjs";
|
|
5
|
-
export type
|
|
6
|
-
export declare namespace
|
|
5
|
+
export type Geometry = Chrt.Geometry.GeometryCollection | Chrt.Geometry.LineString | Chrt.Geometry.MultiLineString | Chrt.Geometry.MultiPoint | Chrt.Geometry.MultiPolygon | Chrt.Geometry.Point | Chrt.Geometry.Polygon;
|
|
6
|
+
export declare namespace Geometry {
|
|
7
7
|
interface GeometryCollection extends Chrt.GeometryCollection {
|
|
8
8
|
type: "GeometryCollection";
|
|
9
9
|
}
|
|
@@ -4,11 +4,15 @@
|
|
|
4
4
|
import * as Chrt from "../index.mjs";
|
|
5
5
|
/**
|
|
6
6
|
* GeoJSON Feature with typed properties for locations
|
|
7
|
+
*
|
|
8
|
+
* The geometry field is strongly typed as Geometry (union of all geometry types)
|
|
9
|
+
* but remains optional to match the base Feature class specification.
|
|
10
|
+
* To ensure geometry is always present, validate it at runtime or make it required.
|
|
7
11
|
*/
|
|
8
12
|
export interface LocationFeature {
|
|
9
13
|
bbox?: unknown[];
|
|
10
14
|
type: "Feature";
|
|
11
|
-
geometry
|
|
15
|
+
geometry: Chrt.Geometry;
|
|
12
16
|
properties?: Chrt.LocationProperties | null;
|
|
13
17
|
id?: LocationFeature.Id | null;
|
|
14
18
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
4
5
|
export interface TrackingCargoByDeviceDataPointMetadata1 {
|
|
5
6
|
device_id: string;
|
|
6
7
|
cargo_id: string;
|
|
7
8
|
task_group_id: string;
|
|
9
|
+
outlier?: boolean | null;
|
|
10
|
+
outlier_labeller?: Chrt.OutlierLabellerEnum | null;
|
|
8
11
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
4
5
|
export interface TrackingCargoByDriverDataPointMetadata1 {
|
|
5
6
|
driver_id: string;
|
|
6
7
|
cargo_id: string;
|
|
7
8
|
task_group_id: string;
|
|
9
|
+
outlier?: boolean | null;
|
|
10
|
+
outlier_labeller?: Chrt.OutlierLabellerEnum | null;
|
|
8
11
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
4
5
|
export interface TrackingSessionByDeviceDataPointMetadata1 {
|
|
5
6
|
session_id: string;
|
|
7
|
+
outlier?: boolean | null;
|
|
8
|
+
outlier_labeller?: Chrt.OutlierLabellerEnum | null;
|
|
6
9
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
4
5
|
export interface TrackingTaskGroupByDriverDataPointMetadata1 {
|
|
5
6
|
driver_id: string;
|
|
6
7
|
task_group_id: string;
|
|
8
|
+
outlier?: boolean | null;
|
|
9
|
+
outlier_labeller?: Chrt.OutlierLabellerEnum | null;
|
|
7
10
|
}
|
|
@@ -34,9 +34,8 @@ export * from "./LineItem1.mjs";
|
|
|
34
34
|
export * from "./LineItemClientCreate1.mjs";
|
|
35
35
|
export * from "./LineItemEnum1.mjs";
|
|
36
36
|
export * from "./LineString.mjs";
|
|
37
|
-
export * from "./
|
|
37
|
+
export * from "./Geometry.mjs";
|
|
38
38
|
export * from "./LocationFeature.mjs";
|
|
39
|
-
export * from "./LocationFeatureOutputGeometry.mjs";
|
|
40
39
|
export * from "./LocationProperties.mjs";
|
|
41
40
|
export * from "./Milestone1.mjs";
|
|
42
41
|
export * from "./MilestoneClientCreate1.mjs";
|
|
@@ -58,6 +57,7 @@ export * from "./OrderStatusEnum1.mjs";
|
|
|
58
57
|
export * from "./OrgMemberDetails.mjs";
|
|
59
58
|
export * from "./OrgMembersAndDrivers.mjs";
|
|
60
59
|
export * from "./OrgPublicData2.mjs";
|
|
60
|
+
export * from "./OutlierLabellerEnum.mjs";
|
|
61
61
|
export * from "./PaymentPreviewResponse.mjs";
|
|
62
62
|
export * from "./PayoutStatusEnum.mjs";
|
|
63
63
|
export * from "./Point.mjs";
|
|
@@ -68,6 +68,7 @@ export * from "./PriceNameEnum.mjs";
|
|
|
68
68
|
export * from "./RouteTypeEnum1.mjs";
|
|
69
69
|
export * from "./Session1.mjs";
|
|
70
70
|
export * from "./SessionByDeviceDeleteResponse1.mjs";
|
|
71
|
+
export * from "./SessionByDeviceMarkOutliersResponse1.mjs";
|
|
71
72
|
export * from "./ShipperContactInfo1.mjs";
|
|
72
73
|
export * from "./ShipperContactInfoClientCreate1.mjs";
|
|
73
74
|
export * from "./ShipperNotificationEventEnum.mjs";
|
|
@@ -34,9 +34,8 @@ export * from "./LineItem1.mjs";
|
|
|
34
34
|
export * from "./LineItemClientCreate1.mjs";
|
|
35
35
|
export * from "./LineItemEnum1.mjs";
|
|
36
36
|
export * from "./LineString.mjs";
|
|
37
|
-
export * from "./
|
|
37
|
+
export * from "./Geometry.mjs";
|
|
38
38
|
export * from "./LocationFeature.mjs";
|
|
39
|
-
export * from "./LocationFeatureOutputGeometry.mjs";
|
|
40
39
|
export * from "./LocationProperties.mjs";
|
|
41
40
|
export * from "./Milestone1.mjs";
|
|
42
41
|
export * from "./MilestoneClientCreate1.mjs";
|
|
@@ -58,6 +57,7 @@ export * from "./OrderStatusEnum1.mjs";
|
|
|
58
57
|
export * from "./OrgMemberDetails.mjs";
|
|
59
58
|
export * from "./OrgMembersAndDrivers.mjs";
|
|
60
59
|
export * from "./OrgPublicData2.mjs";
|
|
60
|
+
export * from "./OutlierLabellerEnum.mjs";
|
|
61
61
|
export * from "./PaymentPreviewResponse.mjs";
|
|
62
62
|
export * from "./PayoutStatusEnum.mjs";
|
|
63
63
|
export * from "./Point.mjs";
|
|
@@ -68,6 +68,7 @@ export * from "./PriceNameEnum.mjs";
|
|
|
68
68
|
export * from "./RouteTypeEnum1.mjs";
|
|
69
69
|
export * from "./Session1.mjs";
|
|
70
70
|
export * from "./SessionByDeviceDeleteResponse1.mjs";
|
|
71
|
+
export * from "./SessionByDeviceMarkOutliersResponse1.mjs";
|
|
71
72
|
export * from "./ShipperContactInfo1.mjs";
|
|
72
73
|
export * from "./ShipperContactInfoClientCreate1.mjs";
|
|
73
74
|
export * from "./ShipperNotificationEventEnum.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.269.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.
|
|
1
|
+
export const SDK_VERSION = "1.269.0";
|