@chrt-inc/typescript-sdk 1.414.0 → 1.415.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.d.ts +33 -0
  3. package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +140 -0
  4. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesSearchV1Request.d.ts +17 -0
  5. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesSearchV1Request.js +5 -0
  6. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesTypeaheadOffChrtOrderIdV1Request.d.ts +16 -0
  7. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/DevicesTypeaheadOffChrtOrderIdV1Request.js +5 -0
  8. package/dist/cjs/api/resources/tracking/resources/devices/client/requests/index.d.ts +2 -0
  9. package/dist/cjs/api/resources/tracking/resources/sessions/client/Client.d.ts +1 -1
  10. package/dist/cjs/api/resources/tracking/resources/sessions/client/Client.js +1 -1
  11. package/dist/cjs/api/types/DeviceSearchRes.d.ts +8 -0
  12. package/dist/cjs/api/types/DeviceSearchRes.js +5 -0
  13. package/dist/cjs/api/types/index.d.ts +1 -0
  14. package/dist/cjs/api/types/index.js +1 -0
  15. package/dist/cjs/version.d.ts +1 -1
  16. package/dist/cjs/version.js +1 -1
  17. package/dist/esm/Client.mjs +2 -2
  18. package/dist/esm/api/resources/tracking/resources/devices/client/Client.d.mts +33 -0
  19. package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +140 -0
  20. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesSearchV1Request.d.mts +17 -0
  21. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesSearchV1Request.mjs +4 -0
  22. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesTypeaheadOffChrtOrderIdV1Request.d.mts +16 -0
  23. package/dist/esm/api/resources/tracking/resources/devices/client/requests/DevicesTypeaheadOffChrtOrderIdV1Request.mjs +4 -0
  24. package/dist/esm/api/resources/tracking/resources/devices/client/requests/index.d.mts +2 -0
  25. package/dist/esm/api/resources/tracking/resources/sessions/client/Client.d.mts +1 -1
  26. package/dist/esm/api/resources/tracking/resources/sessions/client/Client.mjs +1 -1
  27. package/dist/esm/api/types/DeviceSearchRes.d.mts +8 -0
  28. package/dist/esm/api/types/DeviceSearchRes.mjs +4 -0
  29. package/dist/esm/api/types/index.d.mts +1 -0
  30. package/dist/esm/api/types/index.mjs +1 -0
  31. package/dist/esm/version.d.mts +1 -1
  32. package/dist/esm/version.mjs +1 -1
  33. package/package.json +1 -1
  34. package/reference.md +134 -1
@@ -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": "1.414.0",
71
- "User-Agent": "@chrt-inc/typescript-sdk/1.414.0",
70
+ "X-Fern-SDK-Version": "1.415.0",
71
+ "User-Agent": "@chrt-inc/typescript-sdk/1.415.0",
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) });
@@ -148,5 +148,38 @@ export declare class Devices {
148
148
  */
149
149
  listV1(request?: Chrt.tracking.DevicesListV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.DeviceListRes>;
150
150
  private __listV1;
151
+ /**
152
+ * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching devices. | authz: min_org_role=operator | () -> (list[str])
153
+ *
154
+ * @param {Chrt.tracking.DevicesTypeaheadOffChrtOrderIdV1Request} request
155
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
156
+ *
157
+ * @throws {@link Chrt.UnprocessableEntityError}
158
+ *
159
+ * @example
160
+ * await client.tracking.devices.typeaheadOffChrtOrderIdV1({
161
+ * query: "query",
162
+ * limit: 1
163
+ * })
164
+ */
165
+ typeaheadOffChrtOrderIdV1(request: Chrt.tracking.DevicesTypeaheadOffChrtOrderIdV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<string[]>;
166
+ private __typeaheadOffChrtOrderIdV1;
167
+ /**
168
+ * Full-text search across device device_mac_address, comments, and off_chrt_order_id using Atlas Search. | authz: min_org_role=operator | () -> (DeviceSearchRes)
169
+ *
170
+ * @param {Chrt.tracking.DevicesSearchV1Request} request
171
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
172
+ *
173
+ * @throws {@link Chrt.UnprocessableEntityError}
174
+ *
175
+ * @example
176
+ * await client.tracking.devices.searchV1({
177
+ * query: "query",
178
+ * page: 1,
179
+ * page_size: 1
180
+ * })
181
+ */
182
+ searchV1(request: Chrt.tracking.DevicesSearchV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.DeviceSearchRes>;
183
+ private __searchV1;
151
184
  protected _getAuthorizationHeader(): Promise<string | undefined>;
152
185
  }
@@ -565,6 +565,146 @@ class Devices {
565
565
  }
566
566
  });
567
567
  }
568
+ /**
569
+ * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching devices. | authz: min_org_role=operator | () -> (list[str])
570
+ *
571
+ * @param {Chrt.tracking.DevicesTypeaheadOffChrtOrderIdV1Request} request
572
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
573
+ *
574
+ * @throws {@link Chrt.UnprocessableEntityError}
575
+ *
576
+ * @example
577
+ * await client.tracking.devices.typeaheadOffChrtOrderIdV1({
578
+ * query: "query",
579
+ * limit: 1
580
+ * })
581
+ */
582
+ typeaheadOffChrtOrderIdV1(request, requestOptions) {
583
+ return core.HttpResponsePromise.fromPromise(this.__typeaheadOffChrtOrderIdV1(request, requestOptions));
584
+ }
585
+ __typeaheadOffChrtOrderIdV1(request, requestOptions) {
586
+ return __awaiter(this, void 0, void 0, function* () {
587
+ var _a, _b, _c, _d, _e;
588
+ const { query, limit } = request;
589
+ const _queryParams = {};
590
+ _queryParams["query"] = query;
591
+ if (limit !== undefined) {
592
+ _queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
593
+ }
594
+ 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);
595
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
596
+ 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/devices/typeahead/off_chrt_order_id/v1"),
597
+ method: "GET",
598
+ headers: _headers,
599
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
600
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
601
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
602
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
603
+ });
604
+ if (_response.ok) {
605
+ return { data: _response.body, rawResponse: _response.rawResponse };
606
+ }
607
+ if (_response.error.reason === "status-code") {
608
+ switch (_response.error.statusCode) {
609
+ case 422:
610
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
611
+ default:
612
+ throw new errors.ChrtError({
613
+ statusCode: _response.error.statusCode,
614
+ body: _response.error.body,
615
+ rawResponse: _response.rawResponse,
616
+ });
617
+ }
618
+ }
619
+ switch (_response.error.reason) {
620
+ case "non-json":
621
+ throw new errors.ChrtError({
622
+ statusCode: _response.error.statusCode,
623
+ body: _response.error.rawBody,
624
+ rawResponse: _response.rawResponse,
625
+ });
626
+ case "timeout":
627
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/typeahead/off_chrt_order_id/v1.");
628
+ case "unknown":
629
+ throw new errors.ChrtError({
630
+ message: _response.error.errorMessage,
631
+ rawResponse: _response.rawResponse,
632
+ });
633
+ }
634
+ });
635
+ }
636
+ /**
637
+ * Full-text search across device device_mac_address, comments, and off_chrt_order_id using Atlas Search. | authz: min_org_role=operator | () -> (DeviceSearchRes)
638
+ *
639
+ * @param {Chrt.tracking.DevicesSearchV1Request} request
640
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
641
+ *
642
+ * @throws {@link Chrt.UnprocessableEntityError}
643
+ *
644
+ * @example
645
+ * await client.tracking.devices.searchV1({
646
+ * query: "query",
647
+ * page: 1,
648
+ * page_size: 1
649
+ * })
650
+ */
651
+ searchV1(request, requestOptions) {
652
+ return core.HttpResponsePromise.fromPromise(this.__searchV1(request, requestOptions));
653
+ }
654
+ __searchV1(request, requestOptions) {
655
+ return __awaiter(this, void 0, void 0, function* () {
656
+ var _a, _b, _c, _d, _e, _f;
657
+ const { query, page, page_size: pageSize } = request;
658
+ const _queryParams = {};
659
+ _queryParams["query"] = query;
660
+ if (page !== undefined) {
661
+ _queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
662
+ }
663
+ if (pageSize !== undefined) {
664
+ _queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
665
+ }
666
+ let _headers = (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
667
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
668
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, "tracking/devices/search/v1"),
669
+ method: "GET",
670
+ headers: _headers,
671
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
672
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
673
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
674
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
675
+ });
676
+ if (_response.ok) {
677
+ return { data: _response.body, rawResponse: _response.rawResponse };
678
+ }
679
+ if (_response.error.reason === "status-code") {
680
+ switch (_response.error.statusCode) {
681
+ case 422:
682
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
683
+ default:
684
+ throw new errors.ChrtError({
685
+ statusCode: _response.error.statusCode,
686
+ body: _response.error.body,
687
+ rawResponse: _response.rawResponse,
688
+ });
689
+ }
690
+ }
691
+ switch (_response.error.reason) {
692
+ case "non-json":
693
+ throw new errors.ChrtError({
694
+ statusCode: _response.error.statusCode,
695
+ body: _response.error.rawBody,
696
+ rawResponse: _response.rawResponse,
697
+ });
698
+ case "timeout":
699
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/search/v1.");
700
+ case "unknown":
701
+ throw new errors.ChrtError({
702
+ message: _response.error.errorMessage,
703
+ rawResponse: _response.rawResponse,
704
+ });
705
+ }
706
+ });
707
+ }
568
708
  _getAuthorizationHeader() {
569
709
  return __awaiter(this, void 0, void 0, function* () {
570
710
  const bearer = yield core.Supplier.get(this._options.token);
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * query: "query",
8
+ * page: 1,
9
+ * page_size: 1
10
+ * }
11
+ */
12
+ export interface DevicesSearchV1Request {
13
+ /** Full-text search query */
14
+ query: string;
15
+ page?: number | null;
16
+ page_size?: number | null;
17
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * query: "query",
8
+ * limit: 1
9
+ * }
10
+ */
11
+ export interface DevicesTypeaheadOffChrtOrderIdV1Request {
12
+ /** Typeahead search query */
13
+ query: string;
14
+ /** Max results */
15
+ limit?: number | null;
16
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,3 +5,5 @@ export { type DevicesLinkToCargoV1Request } from "./DevicesLinkToCargoV1Request.
5
5
  export { type DevicesUnlinkFromCargoV1Request } from "./DevicesUnlinkFromCargoV1Request.js";
6
6
  export { type DevicesGetV1Request } from "./DevicesGetV1Request.js";
7
7
  export { type DevicesListV1Request } from "./DevicesListV1Request.js";
8
+ export { type DevicesTypeaheadOffChrtOrderIdV1Request } from "./DevicesTypeaheadOffChrtOrderIdV1Request.js";
9
+ export { type DevicesSearchV1Request } from "./DevicesSearchV1Request.js";
@@ -74,7 +74,7 @@ export declare class Sessions {
74
74
  getV1(request: Chrt.tracking.SessionsGetV1Request, requestOptions?: Sessions.RequestOptions): core.HttpResponsePromise<Chrt.Session1>;
75
75
  private __getV1;
76
76
  /**
77
- * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching across both sessions and devices. | authz: min_org_role=operator | () -> (list[str])
77
+ * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching sessions. | authz: min_org_role=operator | () -> (list[str])
78
78
  *
79
79
  * @param {Chrt.tracking.SessionsTypeaheadOffChrtOrderIdV1Request} request
80
80
  * @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
@@ -238,7 +238,7 @@ class Sessions {
238
238
  });
239
239
  }
240
240
  /**
241
- * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching across both sessions and devices. | authz: min_org_role=operator | () -> (list[str])
241
+ * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching sessions. | authz: min_org_role=operator | () -> (list[str])
242
242
  *
243
243
  * @param {Chrt.tracking.SessionsTypeaheadOffChrtOrderIdV1Request} request
244
244
  * @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.js";
5
+ export interface DeviceSearchRes {
6
+ devices: Chrt.Device1[];
7
+ total_count: number;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -28,6 +28,7 @@ export * from "./CreateStripeConnectAccountRes.js";
28
28
  export * from "./DecodedJwtWithOrgAndUserId.js";
29
29
  export * from "./Device1.js";
30
30
  export * from "./DeviceListRes.js";
31
+ export * from "./DeviceSearchRes.js";
31
32
  export * from "./DeviceSortByEnum.js";
32
33
  export * from "./DirectoryEntry1.js";
33
34
  export * from "./Driver1.js";
@@ -44,6 +44,7 @@ __exportStar(require("./CreateStripeConnectAccountRes.js"), exports);
44
44
  __exportStar(require("./DecodedJwtWithOrgAndUserId.js"), exports);
45
45
  __exportStar(require("./Device1.js"), exports);
46
46
  __exportStar(require("./DeviceListRes.js"), exports);
47
+ __exportStar(require("./DeviceSearchRes.js"), exports);
47
48
  __exportStar(require("./DeviceSortByEnum.js"), exports);
48
49
  __exportStar(require("./DirectoryEntry1.js"), exports);
49
50
  __exportStar(require("./Driver1.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.414.0";
1
+ export declare const SDK_VERSION = "1.415.0";
@@ -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 = "1.414.0";
4
+ exports.SDK_VERSION = "1.415.0";
@@ -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": "1.414.0",
35
- "User-Agent": "@chrt-inc/typescript-sdk/1.414.0",
34
+ "X-Fern-SDK-Version": "1.415.0",
35
+ "User-Agent": "@chrt-inc/typescript-sdk/1.415.0",
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) });
@@ -148,5 +148,38 @@ export declare class Devices {
148
148
  */
149
149
  listV1(request?: Chrt.tracking.DevicesListV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.DeviceListRes>;
150
150
  private __listV1;
151
+ /**
152
+ * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching devices. | authz: min_org_role=operator | () -> (list[str])
153
+ *
154
+ * @param {Chrt.tracking.DevicesTypeaheadOffChrtOrderIdV1Request} request
155
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
156
+ *
157
+ * @throws {@link Chrt.UnprocessableEntityError}
158
+ *
159
+ * @example
160
+ * await client.tracking.devices.typeaheadOffChrtOrderIdV1({
161
+ * query: "query",
162
+ * limit: 1
163
+ * })
164
+ */
165
+ typeaheadOffChrtOrderIdV1(request: Chrt.tracking.DevicesTypeaheadOffChrtOrderIdV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<string[]>;
166
+ private __typeaheadOffChrtOrderIdV1;
167
+ /**
168
+ * Full-text search across device device_mac_address, comments, and off_chrt_order_id using Atlas Search. | authz: min_org_role=operator | () -> (DeviceSearchRes)
169
+ *
170
+ * @param {Chrt.tracking.DevicesSearchV1Request} request
171
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
172
+ *
173
+ * @throws {@link Chrt.UnprocessableEntityError}
174
+ *
175
+ * @example
176
+ * await client.tracking.devices.searchV1({
177
+ * query: "query",
178
+ * page: 1,
179
+ * page_size: 1
180
+ * })
181
+ */
182
+ searchV1(request: Chrt.tracking.DevicesSearchV1Request, requestOptions?: Devices.RequestOptions): core.HttpResponsePromise<Chrt.DeviceSearchRes>;
183
+ private __searchV1;
151
184
  protected _getAuthorizationHeader(): Promise<string | undefined>;
152
185
  }
@@ -529,6 +529,146 @@ export class Devices {
529
529
  }
530
530
  });
531
531
  }
532
+ /**
533
+ * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching devices. | authz: min_org_role=operator | () -> (list[str])
534
+ *
535
+ * @param {Chrt.tracking.DevicesTypeaheadOffChrtOrderIdV1Request} request
536
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
537
+ *
538
+ * @throws {@link Chrt.UnprocessableEntityError}
539
+ *
540
+ * @example
541
+ * await client.tracking.devices.typeaheadOffChrtOrderIdV1({
542
+ * query: "query",
543
+ * limit: 1
544
+ * })
545
+ */
546
+ typeaheadOffChrtOrderIdV1(request, requestOptions) {
547
+ return core.HttpResponsePromise.fromPromise(this.__typeaheadOffChrtOrderIdV1(request, requestOptions));
548
+ }
549
+ __typeaheadOffChrtOrderIdV1(request, requestOptions) {
550
+ return __awaiter(this, void 0, void 0, function* () {
551
+ var _a, _b, _c, _d, _e;
552
+ const { query, limit } = request;
553
+ const _queryParams = {};
554
+ _queryParams["query"] = query;
555
+ if (limit !== undefined) {
556
+ _queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
557
+ }
558
+ 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);
559
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
560
+ 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/devices/typeahead/off_chrt_order_id/v1"),
561
+ method: "GET",
562
+ headers: _headers,
563
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
564
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
565
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
566
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
567
+ });
568
+ if (_response.ok) {
569
+ return { data: _response.body, rawResponse: _response.rawResponse };
570
+ }
571
+ if (_response.error.reason === "status-code") {
572
+ switch (_response.error.statusCode) {
573
+ case 422:
574
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
575
+ default:
576
+ throw new errors.ChrtError({
577
+ statusCode: _response.error.statusCode,
578
+ body: _response.error.body,
579
+ rawResponse: _response.rawResponse,
580
+ });
581
+ }
582
+ }
583
+ switch (_response.error.reason) {
584
+ case "non-json":
585
+ throw new errors.ChrtError({
586
+ statusCode: _response.error.statusCode,
587
+ body: _response.error.rawBody,
588
+ rawResponse: _response.rawResponse,
589
+ });
590
+ case "timeout":
591
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/typeahead/off_chrt_order_id/v1.");
592
+ case "unknown":
593
+ throw new errors.ChrtError({
594
+ message: _response.error.errorMessage,
595
+ rawResponse: _response.rawResponse,
596
+ });
597
+ }
598
+ });
599
+ }
600
+ /**
601
+ * Full-text search across device device_mac_address, comments, and off_chrt_order_id using Atlas Search. | authz: min_org_role=operator | () -> (DeviceSearchRes)
602
+ *
603
+ * @param {Chrt.tracking.DevicesSearchV1Request} request
604
+ * @param {Devices.RequestOptions} requestOptions - Request-specific configuration.
605
+ *
606
+ * @throws {@link Chrt.UnprocessableEntityError}
607
+ *
608
+ * @example
609
+ * await client.tracking.devices.searchV1({
610
+ * query: "query",
611
+ * page: 1,
612
+ * page_size: 1
613
+ * })
614
+ */
615
+ searchV1(request, requestOptions) {
616
+ return core.HttpResponsePromise.fromPromise(this.__searchV1(request, requestOptions));
617
+ }
618
+ __searchV1(request, requestOptions) {
619
+ return __awaiter(this, void 0, void 0, function* () {
620
+ var _a, _b, _c, _d, _e, _f;
621
+ const { query, page, page_size: pageSize } = request;
622
+ const _queryParams = {};
623
+ _queryParams["query"] = query;
624
+ if (page !== undefined) {
625
+ _queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
626
+ }
627
+ if (pageSize !== undefined) {
628
+ _queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
629
+ }
630
+ let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
631
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
632
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, "tracking/devices/search/v1"),
633
+ method: "GET",
634
+ headers: _headers,
635
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
636
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
637
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
638
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
639
+ });
640
+ if (_response.ok) {
641
+ return { data: _response.body, rawResponse: _response.rawResponse };
642
+ }
643
+ if (_response.error.reason === "status-code") {
644
+ switch (_response.error.statusCode) {
645
+ case 422:
646
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
647
+ default:
648
+ throw new errors.ChrtError({
649
+ statusCode: _response.error.statusCode,
650
+ body: _response.error.body,
651
+ rawResponse: _response.rawResponse,
652
+ });
653
+ }
654
+ }
655
+ switch (_response.error.reason) {
656
+ case "non-json":
657
+ throw new errors.ChrtError({
658
+ statusCode: _response.error.statusCode,
659
+ body: _response.error.rawBody,
660
+ rawResponse: _response.rawResponse,
661
+ });
662
+ case "timeout":
663
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking/devices/search/v1.");
664
+ case "unknown":
665
+ throw new errors.ChrtError({
666
+ message: _response.error.errorMessage,
667
+ rawResponse: _response.rawResponse,
668
+ });
669
+ }
670
+ });
671
+ }
532
672
  _getAuthorizationHeader() {
533
673
  return __awaiter(this, void 0, void 0, function* () {
534
674
  const bearer = yield core.Supplier.get(this._options.token);
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * query: "query",
8
+ * page: 1,
9
+ * page_size: 1
10
+ * }
11
+ */
12
+ export interface DevicesSearchV1Request {
13
+ /** Full-text search query */
14
+ query: string;
15
+ page?: number | null;
16
+ page_size?: number | null;
17
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * query: "query",
8
+ * limit: 1
9
+ * }
10
+ */
11
+ export interface DevicesTypeaheadOffChrtOrderIdV1Request {
12
+ /** Typeahead search query */
13
+ query: string;
14
+ /** Max results */
15
+ limit?: number | null;
16
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -5,3 +5,5 @@ export { type DevicesLinkToCargoV1Request } from "./DevicesLinkToCargoV1Request.
5
5
  export { type DevicesUnlinkFromCargoV1Request } from "./DevicesUnlinkFromCargoV1Request.mjs";
6
6
  export { type DevicesGetV1Request } from "./DevicesGetV1Request.mjs";
7
7
  export { type DevicesListV1Request } from "./DevicesListV1Request.mjs";
8
+ export { type DevicesTypeaheadOffChrtOrderIdV1Request } from "./DevicesTypeaheadOffChrtOrderIdV1Request.mjs";
9
+ export { type DevicesSearchV1Request } from "./DevicesSearchV1Request.mjs";
@@ -74,7 +74,7 @@ export declare class Sessions {
74
74
  getV1(request: Chrt.tracking.SessionsGetV1Request, requestOptions?: Sessions.RequestOptions): core.HttpResponsePromise<Chrt.Session1>;
75
75
  private __getV1;
76
76
  /**
77
- * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching across both sessions and devices. | authz: min_org_role=operator | () -> (list[str])
77
+ * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching sessions. | authz: min_org_role=operator | () -> (list[str])
78
78
  *
79
79
  * @param {Chrt.tracking.SessionsTypeaheadOffChrtOrderIdV1Request} request
80
80
  * @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
@@ -202,7 +202,7 @@ export class Sessions {
202
202
  });
203
203
  }
204
204
  /**
205
- * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching across both sessions and devices. | authz: min_org_role=operator | () -> (list[str])
205
+ * Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching sessions. | authz: min_org_role=operator | () -> (list[str])
206
206
  *
207
207
  * @param {Chrt.tracking.SessionsTypeaheadOffChrtOrderIdV1Request} request
208
208
  * @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.mjs";
5
+ export interface DeviceSearchRes {
6
+ devices: Chrt.Device1[];
7
+ total_count: number;
8
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -28,6 +28,7 @@ export * from "./CreateStripeConnectAccountRes.mjs";
28
28
  export * from "./DecodedJwtWithOrgAndUserId.mjs";
29
29
  export * from "./Device1.mjs";
30
30
  export * from "./DeviceListRes.mjs";
31
+ export * from "./DeviceSearchRes.mjs";
31
32
  export * from "./DeviceSortByEnum.mjs";
32
33
  export * from "./DirectoryEntry1.mjs";
33
34
  export * from "./Driver1.mjs";
@@ -28,6 +28,7 @@ export * from "./CreateStripeConnectAccountRes.mjs";
28
28
  export * from "./DecodedJwtWithOrgAndUserId.mjs";
29
29
  export * from "./Device1.mjs";
30
30
  export * from "./DeviceListRes.mjs";
31
+ export * from "./DeviceSearchRes.mjs";
31
32
  export * from "./DeviceSortByEnum.mjs";
32
33
  export * from "./DirectoryEntry1.mjs";
33
34
  export * from "./Driver1.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.414.0";
1
+ export declare const SDK_VERSION = "1.415.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.414.0";
1
+ export const SDK_VERSION = "1.415.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrt-inc/typescript-sdk",
3
- "version": "1.414.0",
3
+ "version": "1.415.0",
4
4
  "private": false,
5
5
  "repository": "github:chrt-inc/typescript-sdk",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -13509,6 +13509,139 @@ await client.tracking.devices.listV1({
13509
13509
  </dl>
13510
13510
  </details>
13511
13511
 
13512
+ <details><summary><code>client.tracking.devices.<a href="/src/api/resources/tracking/resources/devices/client/Client.ts">typeaheadOffChrtOrderIdV1</a>({ ...params }) -> string[]</code></summary>
13513
+ <dl>
13514
+ <dd>
13515
+
13516
+ #### 📝 Description
13517
+
13518
+ <dl>
13519
+ <dd>
13520
+
13521
+ <dl>
13522
+ <dd>
13523
+
13524
+ Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching devices. | authz: min_org_role=operator | () -> (list[str])
13525
+
13526
+ </dd>
13527
+ </dl>
13528
+ </dd>
13529
+ </dl>
13530
+
13531
+ #### 🔌 Usage
13532
+
13533
+ <dl>
13534
+ <dd>
13535
+
13536
+ <dl>
13537
+ <dd>
13538
+
13539
+ ```typescript
13540
+ await client.tracking.devices.typeaheadOffChrtOrderIdV1({
13541
+ query: "query",
13542
+ limit: 1,
13543
+ });
13544
+ ```
13545
+
13546
+ </dd>
13547
+ </dl>
13548
+ </dd>
13549
+ </dl>
13550
+
13551
+ #### ⚙️ Parameters
13552
+
13553
+ <dl>
13554
+ <dd>
13555
+
13556
+ <dl>
13557
+ <dd>
13558
+
13559
+ **request:** `Chrt.tracking.DevicesTypeaheadOffChrtOrderIdV1Request`
13560
+
13561
+ </dd>
13562
+ </dl>
13563
+
13564
+ <dl>
13565
+ <dd>
13566
+
13567
+ **requestOptions:** `Devices.RequestOptions`
13568
+
13569
+ </dd>
13570
+ </dl>
13571
+ </dd>
13572
+ </dl>
13573
+
13574
+ </dd>
13575
+ </dl>
13576
+ </details>
13577
+
13578
+ <details><summary><code>client.tracking.devices.<a href="/src/api/resources/tracking/resources/devices/client/Client.ts">searchV1</a>({ ...params }) -> Chrt.DeviceSearchRes</code></summary>
13579
+ <dl>
13580
+ <dd>
13581
+
13582
+ #### 📝 Description
13583
+
13584
+ <dl>
13585
+ <dd>
13586
+
13587
+ <dl>
13588
+ <dd>
13589
+
13590
+ Full-text search across device device_mac_address, comments, and off_chrt_order_id using Atlas Search. | authz: min_org_role=operator | () -> (DeviceSearchRes)
13591
+
13592
+ </dd>
13593
+ </dl>
13594
+ </dd>
13595
+ </dl>
13596
+
13597
+ #### 🔌 Usage
13598
+
13599
+ <dl>
13600
+ <dd>
13601
+
13602
+ <dl>
13603
+ <dd>
13604
+
13605
+ ```typescript
13606
+ await client.tracking.devices.searchV1({
13607
+ query: "query",
13608
+ page: 1,
13609
+ page_size: 1,
13610
+ });
13611
+ ```
13612
+
13613
+ </dd>
13614
+ </dl>
13615
+ </dd>
13616
+ </dl>
13617
+
13618
+ #### ⚙️ Parameters
13619
+
13620
+ <dl>
13621
+ <dd>
13622
+
13623
+ <dl>
13624
+ <dd>
13625
+
13626
+ **request:** `Chrt.tracking.DevicesSearchV1Request`
13627
+
13628
+ </dd>
13629
+ </dl>
13630
+
13631
+ <dl>
13632
+ <dd>
13633
+
13634
+ **requestOptions:** `Devices.RequestOptions`
13635
+
13636
+ </dd>
13637
+ </dl>
13638
+ </dd>
13639
+ </dl>
13640
+
13641
+ </dd>
13642
+ </dl>
13643
+ </details>
13644
+
13512
13645
  ## Tracking Driver
13513
13646
 
13514
13647
  <details><summary><code>client.tracking.driver.<a href="/src/api/resources/tracking/resources/driver/client/Client.ts">updateV1</a>({ ...params }) -> Chrt.DriverUpdateRes</code></summary>
@@ -13742,7 +13875,7 @@ await client.tracking.sessions.getV1({
13742
13875
  <dl>
13743
13876
  <dd>
13744
13877
 
13745
- Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching across both sessions and devices. | authz: min_org_role=operator | () -> (list[str])
13878
+ Returns distinct off_chrt_order_id values matching the query via case-insensitive regex, searching sessions. | authz: min_org_role=operator | () -> (list[str])
13746
13879
 
13747
13880
  </dd>
13748
13881
  </dl>