@chrt-inc/typescript-sdk 0.227.0 → 0.227.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.
@@ -67,8 +67,8 @@ class ChrtClient {
67
67
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
68
68
  "X-Fern-Language": "JavaScript",
69
69
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
70
- "X-Fern-SDK-Version": "0.227.0",
71
- "User-Agent": "@chrt-inc/typescript-sdk/0.227.0",
70
+ "X-Fern-SDK-Version": "0.227.1",
71
+ "User-Agent": "@chrt-inc/typescript-sdk/0.227.1",
72
72
  "X-Fern-Runtime": core.RUNTIME.type,
73
73
  "X-Fern-Runtime-Version": core.RUNTIME.version,
74
74
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -135,6 +135,16 @@ export declare class Drivers {
135
135
  */
136
136
  lastSeen(request: Chrt.DriverLastSeenReq, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<boolean>;
137
137
  private __lastSeen;
138
+ /**
139
+ * Clears the driver's last known location and timestamp.
140
+ *
141
+ * @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
142
+ *
143
+ * @example
144
+ * await client.drivers.lastSeenClear()
145
+ */
146
+ lastSeenClear(requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<boolean>;
147
+ private __lastSeenClear;
138
148
  /**
139
149
  * Updates driver contact details and vehicle type assignments within the organization.
140
150
  *
@@ -508,6 +508,55 @@ class Drivers {
508
508
  }
509
509
  });
510
510
  }
511
+ /**
512
+ * Clears the driver's last known location and timestamp.
513
+ *
514
+ * @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
515
+ *
516
+ * @example
517
+ * await client.drivers.lastSeenClear()
518
+ */
519
+ lastSeenClear(requestOptions) {
520
+ return core.HttpResponsePromise.fromPromise(this.__lastSeenClear(requestOptions));
521
+ }
522
+ __lastSeenClear(requestOptions) {
523
+ return __awaiter(this, void 0, void 0, function* () {
524
+ var _a, _b, _c, _d;
525
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
526
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/drivers/last_seen/clear"),
527
+ method: "POST",
528
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
529
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
530
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
531
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
532
+ });
533
+ if (_response.ok) {
534
+ return { data: _response.body, rawResponse: _response.rawResponse };
535
+ }
536
+ if (_response.error.reason === "status-code") {
537
+ throw new errors.ChrtError({
538
+ statusCode: _response.error.statusCode,
539
+ body: _response.error.body,
540
+ rawResponse: _response.rawResponse,
541
+ });
542
+ }
543
+ switch (_response.error.reason) {
544
+ case "non-json":
545
+ throw new errors.ChrtError({
546
+ statusCode: _response.error.statusCode,
547
+ body: _response.error.rawBody,
548
+ rawResponse: _response.rawResponse,
549
+ });
550
+ case "timeout":
551
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/drivers/last_seen/clear.");
552
+ case "unknown":
553
+ throw new errors.ChrtError({
554
+ message: _response.error.errorMessage,
555
+ rawResponse: _response.rawResponse,
556
+ });
557
+ }
558
+ });
559
+ }
511
560
  /**
512
561
  * Updates driver contact details and vehicle type assignments within the organization.
513
562
  *
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.227.0";
1
+ export declare const SDK_VERSION = "0.227.1";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.227.0";
4
+ exports.SDK_VERSION = "0.227.1";
@@ -31,8 +31,8 @@ export class ChrtClient {
31
31
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
32
32
  "X-Fern-Language": "JavaScript",
33
33
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
34
- "X-Fern-SDK-Version": "0.227.0",
35
- "User-Agent": "@chrt-inc/typescript-sdk/0.227.0",
34
+ "X-Fern-SDK-Version": "0.227.1",
35
+ "User-Agent": "@chrt-inc/typescript-sdk/0.227.1",
36
36
  "X-Fern-Runtime": core.RUNTIME.type,
37
37
  "X-Fern-Runtime-Version": core.RUNTIME.version,
38
38
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -135,6 +135,16 @@ export declare class Drivers {
135
135
  */
136
136
  lastSeen(request: Chrt.DriverLastSeenReq, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<boolean>;
137
137
  private __lastSeen;
138
+ /**
139
+ * Clears the driver's last known location and timestamp.
140
+ *
141
+ * @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
142
+ *
143
+ * @example
144
+ * await client.drivers.lastSeenClear()
145
+ */
146
+ lastSeenClear(requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<boolean>;
147
+ private __lastSeenClear;
138
148
  /**
139
149
  * Updates driver contact details and vehicle type assignments within the organization.
140
150
  *
@@ -472,6 +472,55 @@ export class Drivers {
472
472
  }
473
473
  });
474
474
  }
475
+ /**
476
+ * Clears the driver's last known location and timestamp.
477
+ *
478
+ * @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
479
+ *
480
+ * @example
481
+ * await client.drivers.lastSeenClear()
482
+ */
483
+ lastSeenClear(requestOptions) {
484
+ return core.HttpResponsePromise.fromPromise(this.__lastSeenClear(requestOptions));
485
+ }
486
+ __lastSeenClear(requestOptions) {
487
+ return __awaiter(this, void 0, void 0, function* () {
488
+ var _a, _b, _c, _d;
489
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
490
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/drivers/last_seen/clear"),
491
+ method: "POST",
492
+ headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
493
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
494
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
495
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
496
+ });
497
+ if (_response.ok) {
498
+ return { data: _response.body, rawResponse: _response.rawResponse };
499
+ }
500
+ if (_response.error.reason === "status-code") {
501
+ throw new errors.ChrtError({
502
+ statusCode: _response.error.statusCode,
503
+ body: _response.error.body,
504
+ rawResponse: _response.rawResponse,
505
+ });
506
+ }
507
+ switch (_response.error.reason) {
508
+ case "non-json":
509
+ throw new errors.ChrtError({
510
+ statusCode: _response.error.statusCode,
511
+ body: _response.error.rawBody,
512
+ rawResponse: _response.rawResponse,
513
+ });
514
+ case "timeout":
515
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/drivers/last_seen/clear.");
516
+ case "unknown":
517
+ throw new errors.ChrtError({
518
+ message: _response.error.errorMessage,
519
+ rawResponse: _response.rawResponse,
520
+ });
521
+ }
522
+ });
523
+ }
475
524
  /**
476
525
  * Updates driver contact details and vehicle type assignments within the organization.
477
526
  *
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.227.0";
1
+ export declare const SDK_VERSION = "0.227.1";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.227.0";
1
+ export const SDK_VERSION = "0.227.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrt-inc/typescript-sdk",
3
- "version": "0.227.0",
3
+ "version": "0.227.1",
4
4
  "private": false,
5
5
  "repository": "github:chrt-inc/typescript-sdk",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -838,6 +838,61 @@ await client.drivers.lastSeen({
838
838
  </dl>
839
839
  </details>
840
840
 
841
+ <details><summary><code>client.drivers.<a href="/src/api/resources/drivers/client/Client.ts">lastSeenClear</a>() -> boolean</code></summary>
842
+ <dl>
843
+ <dd>
844
+
845
+ #### 📝 Description
846
+
847
+ <dl>
848
+ <dd>
849
+
850
+ <dl>
851
+ <dd>
852
+
853
+ Clears the driver's last known location and timestamp.
854
+
855
+ </dd>
856
+ </dl>
857
+ </dd>
858
+ </dl>
859
+
860
+ #### 🔌 Usage
861
+
862
+ <dl>
863
+ <dd>
864
+
865
+ <dl>
866
+ <dd>
867
+
868
+ ```typescript
869
+ await client.drivers.lastSeenClear();
870
+ ```
871
+
872
+ </dd>
873
+ </dl>
874
+ </dd>
875
+ </dl>
876
+
877
+ #### ⚙️ Parameters
878
+
879
+ <dl>
880
+ <dd>
881
+
882
+ <dl>
883
+ <dd>
884
+
885
+ **requestOptions:** `Drivers.RequestOptions`
886
+
887
+ </dd>
888
+ </dl>
889
+ </dd>
890
+ </dl>
891
+
892
+ </dd>
893
+ </dl>
894
+ </details>
895
+
841
896
  <details><summary><code>client.drivers.<a href="/src/api/resources/drivers/client/Client.ts">updateDriver</a>({ ...params }) -> boolean</code></summary>
842
897
  <dl>
843
898
  <dd>