@chrt-inc/typescript-sdk 1.594.0 → 1.595.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 (38) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/expanded/client/Client.d.ts +18 -1
  3. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/expanded/client/Client.js +74 -2
  4. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/expanded/client/requests/ExpandedListV1Request.d.ts +3 -0
  5. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/expanded/client/requests/ExpandedTypeaheadV1Request.d.ts +16 -0
  6. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/expanded/client/requests/ExpandedTypeaheadV1Request.js +5 -0
  7. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/expanded/client/requests/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.d.ts +2 -2
  9. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.js +1 -1
  10. package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedTypeaheadV1Request.d.ts +1 -1
  11. package/dist/cjs/api/types/OrderTypeaheadFieldEnum.d.ts +8 -0
  12. package/dist/cjs/api/types/OrderTypeaheadFieldEnum.js +10 -0
  13. package/dist/cjs/api/types/OrderTypeaheadResult.d.ts +8 -0
  14. package/dist/cjs/api/types/OrderTypeaheadResult.js +5 -0
  15. package/dist/cjs/api/types/index.d.ts +2 -0
  16. package/dist/cjs/api/types/index.js +2 -0
  17. package/dist/cjs/version.d.ts +1 -1
  18. package/dist/cjs/version.js +1 -1
  19. package/dist/esm/Client.mjs +2 -2
  20. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/expanded/client/Client.d.mts +18 -1
  21. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/expanded/client/Client.mjs +74 -2
  22. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/expanded/client/requests/ExpandedListV1Request.d.mts +3 -0
  23. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/expanded/client/requests/ExpandedTypeaheadV1Request.d.mts +16 -0
  24. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/expanded/client/requests/ExpandedTypeaheadV1Request.mjs +4 -0
  25. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/expanded/client/requests/index.d.mts +1 -0
  26. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.d.mts +2 -2
  27. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.mjs +1 -1
  28. package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedTypeaheadV1Request.d.mts +1 -1
  29. package/dist/esm/api/types/OrderTypeaheadFieldEnum.d.mts +8 -0
  30. package/dist/esm/api/types/OrderTypeaheadFieldEnum.mjs +7 -0
  31. package/dist/esm/api/types/OrderTypeaheadResult.d.mts +8 -0
  32. package/dist/esm/api/types/OrderTypeaheadResult.mjs +4 -0
  33. package/dist/esm/api/types/index.d.mts +2 -0
  34. package/dist/esm/api/types/index.mjs +2 -0
  35. package/dist/esm/version.d.mts +1 -1
  36. package/dist/esm/version.mjs +1 -1
  37. package/package.json +1 -1
  38. package/reference.md +70 -3
@@ -53,8 +53,8 @@ class ChrtClient {
53
53
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
54
54
  "X-Fern-Language": "JavaScript",
55
55
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
56
- "X-Fern-SDK-Version": "1.594.0",
57
- "User-Agent": "@chrt-inc/typescript-sdk/1.594.0",
56
+ "X-Fern-SDK-Version": "1.595.0",
57
+ "User-Agent": "@chrt-inc/typescript-sdk/1.595.0",
58
58
  "X-Fern-Runtime": core.RUNTIME.type,
59
59
  "X-Fern-Runtime-Version": core.RUNTIME.version,
60
60
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -45,7 +45,7 @@ export declare class Expanded {
45
45
  retrieveV1(orderRef: string, request: Chrt.OrderAndTaskGroupExpandedReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderDraftExpanded>;
46
46
  private __retrieveV1;
47
47
  /**
48
- * Lists expanded draft orders for the organization with filtering, sorting, and pagination. | (OrderAndTaskGroupExpandedReq) -> (OrderDraftExpandedListRes)
48
+ * Lists expanded draft orders for the organization with filtering, sorting, pagination, and optional search. | (OrderAndTaskGroupExpandedReq) -> (OrderDraftExpandedListRes)
49
49
  *
50
50
  * @param {Chrt.shipping.orderDrafts.ExpandedListV1Request} request
51
51
  * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
@@ -58,6 +58,7 @@ export declare class Expanded {
58
58
  * sort_order: "asc",
59
59
  * page: 1,
60
60
  * page_size: 1,
61
+ * search: "search",
61
62
  * filter_draft_started_at_timestamp_lte: "2024-01-15T09:30:00Z",
62
63
  * filter_draft_started_at_timestamp_gte: "2024-01-15T09:30:00Z",
63
64
  * body: {}
@@ -65,5 +66,21 @@ export declare class Expanded {
65
66
  */
66
67
  listV1(request: Chrt.shipping.orderDrafts.ExpandedListV1Request, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderDraftExpandedListRes>;
67
68
  private __listV1;
69
+ /**
70
+ * Returns distinct short_id and off_chrt_reference_id values matching the query via case-insensitive regex. Searches draft orders created by the caller's org. | authz: min_org_role=operator | () -> (list[OrderTypeaheadResult])
71
+ *
72
+ * @param {Chrt.shipping.orderDrafts.ExpandedTypeaheadV1Request} request
73
+ * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link Chrt.UnprocessableEntityError}
76
+ *
77
+ * @example
78
+ * await client.shipping.orderDrafts.expanded.typeaheadV1({
79
+ * query: "query",
80
+ * limit: 1
81
+ * })
82
+ */
83
+ typeaheadV1(request: Chrt.shipping.orderDrafts.ExpandedTypeaheadV1Request, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderTypeaheadResult[]>;
84
+ private __typeaheadV1;
68
85
  protected _getAuthorizationHeader(): Promise<string | undefined>;
69
86
  }
@@ -119,7 +119,7 @@ class Expanded {
119
119
  });
120
120
  }
121
121
  /**
122
- * Lists expanded draft orders for the organization with filtering, sorting, and pagination. | (OrderAndTaskGroupExpandedReq) -> (OrderDraftExpandedListRes)
122
+ * Lists expanded draft orders for the organization with filtering, sorting, pagination, and optional search. | (OrderAndTaskGroupExpandedReq) -> (OrderDraftExpandedListRes)
123
123
  *
124
124
  * @param {Chrt.shipping.orderDrafts.ExpandedListV1Request} request
125
125
  * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
@@ -132,6 +132,7 @@ class Expanded {
132
132
  * sort_order: "asc",
133
133
  * page: 1,
134
134
  * page_size: 1,
135
+ * search: "search",
135
136
  * filter_draft_started_at_timestamp_lte: "2024-01-15T09:30:00Z",
136
137
  * filter_draft_started_at_timestamp_gte: "2024-01-15T09:30:00Z",
137
138
  * body: {}
@@ -143,7 +144,7 @@ class Expanded {
143
144
  __listV1(request, requestOptions) {
144
145
  return __awaiter(this, void 0, void 0, function* () {
145
146
  var _a, _b, _c, _d, _e, _f;
146
- const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_draft_started_at_timestamp_lte: filterDraftStartedAtTimestampLte, filter_draft_started_at_timestamp_gte: filterDraftStartedAtTimestampGte, body: _body, } = request;
147
+ const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, search, filter_draft_started_at_timestamp_lte: filterDraftStartedAtTimestampLte, filter_draft_started_at_timestamp_gte: filterDraftStartedAtTimestampGte, body: _body, } = request;
147
148
  const _queryParams = {};
148
149
  if (sortBy !== undefined) {
149
150
  _queryParams["sort_by"] = sortBy;
@@ -157,6 +158,9 @@ class Expanded {
157
158
  if (pageSize !== undefined) {
158
159
  _queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
159
160
  }
161
+ if (search !== undefined) {
162
+ _queryParams["search"] = search;
163
+ }
160
164
  if (filterDraftStartedAtTimestampLte !== undefined) {
161
165
  _queryParams["filter_draft_started_at_timestamp_lte"] = filterDraftStartedAtTimestampLte;
162
166
  }
@@ -208,6 +212,74 @@ class Expanded {
208
212
  }
209
213
  });
210
214
  }
215
+ /**
216
+ * Returns distinct short_id and off_chrt_reference_id values matching the query via case-insensitive regex. Searches draft orders created by the caller's org. | authz: min_org_role=operator | () -> (list[OrderTypeaheadResult])
217
+ *
218
+ * @param {Chrt.shipping.orderDrafts.ExpandedTypeaheadV1Request} request
219
+ * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
220
+ *
221
+ * @throws {@link Chrt.UnprocessableEntityError}
222
+ *
223
+ * @example
224
+ * await client.shipping.orderDrafts.expanded.typeaheadV1({
225
+ * query: "query",
226
+ * limit: 1
227
+ * })
228
+ */
229
+ typeaheadV1(request, requestOptions) {
230
+ return core.HttpResponsePromise.fromPromise(this.__typeaheadV1(request, requestOptions));
231
+ }
232
+ __typeaheadV1(request, requestOptions) {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ var _a, _b, _c, _d, _e;
235
+ const { query, limit } = request;
236
+ const _queryParams = {};
237
+ _queryParams["query"] = query;
238
+ if (limit !== undefined) {
239
+ _queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
240
+ }
241
+ 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);
242
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
243
+ 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, "shipping/order_drafts/expanded/typeahead/v1"),
244
+ method: "GET",
245
+ headers: _headers,
246
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
247
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
248
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
249
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
250
+ });
251
+ if (_response.ok) {
252
+ return { data: _response.body, rawResponse: _response.rawResponse };
253
+ }
254
+ if (_response.error.reason === "status-code") {
255
+ switch (_response.error.statusCode) {
256
+ case 422:
257
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
258
+ default:
259
+ throw new errors.ChrtError({
260
+ statusCode: _response.error.statusCode,
261
+ body: _response.error.body,
262
+ rawResponse: _response.rawResponse,
263
+ });
264
+ }
265
+ }
266
+ switch (_response.error.reason) {
267
+ case "non-json":
268
+ throw new errors.ChrtError({
269
+ statusCode: _response.error.statusCode,
270
+ body: _response.error.rawBody,
271
+ rawResponse: _response.rawResponse,
272
+ });
273
+ case "timeout":
274
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping/order_drafts/expanded/typeahead/v1.");
275
+ case "unknown":
276
+ throw new errors.ChrtError({
277
+ message: _response.error.errorMessage,
278
+ rawResponse: _response.rawResponse,
279
+ });
280
+ }
281
+ });
282
+ }
211
283
  _getAuthorizationHeader() {
212
284
  return __awaiter(this, void 0, void 0, function* () {
213
285
  const bearer = yield core.Supplier.get(this._options.token);
@@ -9,6 +9,7 @@ import * as Chrt from "../../../../../../../../index.js";
9
9
  * sort_order: "asc",
10
10
  * page: 1,
11
11
  * page_size: 1,
12
+ * search: "search",
12
13
  * filter_draft_started_at_timestamp_lte: "2024-01-15T09:30:00Z",
13
14
  * filter_draft_started_at_timestamp_gte: "2024-01-15T09:30:00Z",
14
15
  * body: {}
@@ -20,6 +21,8 @@ export interface ExpandedListV1Request {
20
21
  sort_order?: Chrt.SortOrderEnum | null;
21
22
  page?: number | null;
22
23
  page_size?: number | null;
24
+ /** Full-text search query (searches order short_id and off_chrt_reference_id) */
25
+ search?: string | null;
23
26
  filter_draft_started_at_timestamp_lte?: string | null;
24
27
  filter_draft_started_at_timestamp_gte?: string | null;
25
28
  body: Chrt.OrderAndTaskGroupExpandedReq;
@@ -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 ExpandedTypeaheadV1Request {
12
+ /** Typeahead search query */
13
+ query: string;
14
+ /** Max results per field */
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 });
@@ -1 +1,2 @@
1
1
  export { type ExpandedListV1Request } from "./ExpandedListV1Request.js";
2
+ export { type ExpandedTypeaheadV1Request } from "./ExpandedTypeaheadV1Request.js";
@@ -125,7 +125,7 @@ export declare class Expanded {
125
125
  listForShipperOperatorsV1(request: Chrt.shipping.orders.ExpandedListForShipperOperatorsV1Request, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrdersExpandedListRes>;
126
126
  private __listForShipperOperatorsV1;
127
127
  /**
128
- * Returns distinct order short_id values matching the query via case-insensitive regex. Searches non-draft orders visible to the caller's org. | authz: allowed_org_types=[forwarder, shipper], min_org_role=operator | () -> (list[str])
128
+ * Returns distinct short_id and off_chrt_reference_id values matching the query via case-insensitive regex. Searches non-draft orders visible to the caller's org. | authz: allowed_org_types=[forwarder, shipper], min_org_role=operator | () -> (list[OrderTypeaheadResult])
129
129
  *
130
130
  * @param {Chrt.shipping.orders.ExpandedTypeaheadV1Request} request
131
131
  * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
@@ -138,7 +138,7 @@ export declare class Expanded {
138
138
  * limit: 1
139
139
  * })
140
140
  */
141
- typeaheadV1(request: Chrt.shipping.orders.ExpandedTypeaheadV1Request, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<string[]>;
141
+ typeaheadV1(request: Chrt.shipping.orders.ExpandedTypeaheadV1Request, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderTypeaheadResult[]>;
142
142
  private __typeaheadV1;
143
143
  protected _getAuthorizationHeader(): Promise<string | undefined>;
144
144
  }
@@ -474,7 +474,7 @@ class Expanded {
474
474
  });
475
475
  }
476
476
  /**
477
- * Returns distinct order short_id values matching the query via case-insensitive regex. Searches non-draft orders visible to the caller's org. | authz: allowed_org_types=[forwarder, shipper], min_org_role=operator | () -> (list[str])
477
+ * Returns distinct short_id and off_chrt_reference_id values matching the query via case-insensitive regex. Searches non-draft orders visible to the caller's org. | authz: allowed_org_types=[forwarder, shipper], min_org_role=operator | () -> (list[OrderTypeaheadResult])
478
478
  *
479
479
  * @param {Chrt.shipping.orders.ExpandedTypeaheadV1Request} request
480
480
  * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
@@ -11,6 +11,6 @@
11
11
  export interface ExpandedTypeaheadV1Request {
12
12
  /** Typeahead search query */
13
13
  query: string;
14
- /** Max results */
14
+ /** Max results per field */
15
15
  limit?: number | null;
16
16
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type OrderTypeaheadFieldEnum = "off_chrt_reference_id" | "short_id";
5
+ export declare const OrderTypeaheadFieldEnum: {
6
+ readonly OffChrtReferenceId: "off_chrt_reference_id";
7
+ readonly ShortId: "short_id";
8
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.OrderTypeaheadFieldEnum = void 0;
7
+ exports.OrderTypeaheadFieldEnum = {
8
+ OffChrtReferenceId: "off_chrt_reference_id",
9
+ ShortId: "short_id",
10
+ };
@@ -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 OrderTypeaheadResult {
6
+ type: Chrt.OrderTypeaheadFieldEnum;
7
+ values: string[];
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 });
@@ -149,6 +149,8 @@ export * from "./OrderDraftValidationResult.js";
149
149
  export * from "./OrderExpanded.js";
150
150
  export * from "./OrderSortByEnum.js";
151
151
  export * from "./OrderStatusEnum1.js";
152
+ export * from "./OrderTypeaheadFieldEnum.js";
153
+ export * from "./OrderTypeaheadResult.js";
152
154
  export * from "./OrdersDraftUpdateRes.js";
153
155
  export * from "./OrdersExpandedListRes.js";
154
156
  export * from "./OrdersNewDraftRes.js";
@@ -165,6 +165,8 @@ __exportStar(require("./OrderDraftValidationResult.js"), exports);
165
165
  __exportStar(require("./OrderExpanded.js"), exports);
166
166
  __exportStar(require("./OrderSortByEnum.js"), exports);
167
167
  __exportStar(require("./OrderStatusEnum1.js"), exports);
168
+ __exportStar(require("./OrderTypeaheadFieldEnum.js"), exports);
169
+ __exportStar(require("./OrderTypeaheadResult.js"), exports);
168
170
  __exportStar(require("./OrdersDraftUpdateRes.js"), exports);
169
171
  __exportStar(require("./OrdersExpandedListRes.js"), exports);
170
172
  __exportStar(require("./OrdersNewDraftRes.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.594.0";
1
+ export declare const SDK_VERSION = "1.595.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.594.0";
4
+ exports.SDK_VERSION = "1.595.0";
@@ -17,8 +17,8 @@ export class ChrtClient {
17
17
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
18
18
  "X-Fern-Language": "JavaScript",
19
19
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
20
- "X-Fern-SDK-Version": "1.594.0",
21
- "User-Agent": "@chrt-inc/typescript-sdk/1.594.0",
20
+ "X-Fern-SDK-Version": "1.595.0",
21
+ "User-Agent": "@chrt-inc/typescript-sdk/1.595.0",
22
22
  "X-Fern-Runtime": core.RUNTIME.type,
23
23
  "X-Fern-Runtime-Version": core.RUNTIME.version,
24
24
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -45,7 +45,7 @@ export declare class Expanded {
45
45
  retrieveV1(orderRef: string, request: Chrt.OrderAndTaskGroupExpandedReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderDraftExpanded>;
46
46
  private __retrieveV1;
47
47
  /**
48
- * Lists expanded draft orders for the organization with filtering, sorting, and pagination. | (OrderAndTaskGroupExpandedReq) -> (OrderDraftExpandedListRes)
48
+ * Lists expanded draft orders for the organization with filtering, sorting, pagination, and optional search. | (OrderAndTaskGroupExpandedReq) -> (OrderDraftExpandedListRes)
49
49
  *
50
50
  * @param {Chrt.shipping.orderDrafts.ExpandedListV1Request} request
51
51
  * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
@@ -58,6 +58,7 @@ export declare class Expanded {
58
58
  * sort_order: "asc",
59
59
  * page: 1,
60
60
  * page_size: 1,
61
+ * search: "search",
61
62
  * filter_draft_started_at_timestamp_lte: "2024-01-15T09:30:00Z",
62
63
  * filter_draft_started_at_timestamp_gte: "2024-01-15T09:30:00Z",
63
64
  * body: {}
@@ -65,5 +66,21 @@ export declare class Expanded {
65
66
  */
66
67
  listV1(request: Chrt.shipping.orderDrafts.ExpandedListV1Request, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderDraftExpandedListRes>;
67
68
  private __listV1;
69
+ /**
70
+ * Returns distinct short_id and off_chrt_reference_id values matching the query via case-insensitive regex. Searches draft orders created by the caller's org. | authz: min_org_role=operator | () -> (list[OrderTypeaheadResult])
71
+ *
72
+ * @param {Chrt.shipping.orderDrafts.ExpandedTypeaheadV1Request} request
73
+ * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link Chrt.UnprocessableEntityError}
76
+ *
77
+ * @example
78
+ * await client.shipping.orderDrafts.expanded.typeaheadV1({
79
+ * query: "query",
80
+ * limit: 1
81
+ * })
82
+ */
83
+ typeaheadV1(request: Chrt.shipping.orderDrafts.ExpandedTypeaheadV1Request, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderTypeaheadResult[]>;
84
+ private __typeaheadV1;
68
85
  protected _getAuthorizationHeader(): Promise<string | undefined>;
69
86
  }
@@ -83,7 +83,7 @@ export class Expanded {
83
83
  });
84
84
  }
85
85
  /**
86
- * Lists expanded draft orders for the organization with filtering, sorting, and pagination. | (OrderAndTaskGroupExpandedReq) -> (OrderDraftExpandedListRes)
86
+ * Lists expanded draft orders for the organization with filtering, sorting, pagination, and optional search. | (OrderAndTaskGroupExpandedReq) -> (OrderDraftExpandedListRes)
87
87
  *
88
88
  * @param {Chrt.shipping.orderDrafts.ExpandedListV1Request} request
89
89
  * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
@@ -96,6 +96,7 @@ export class Expanded {
96
96
  * sort_order: "asc",
97
97
  * page: 1,
98
98
  * page_size: 1,
99
+ * search: "search",
99
100
  * filter_draft_started_at_timestamp_lte: "2024-01-15T09:30:00Z",
100
101
  * filter_draft_started_at_timestamp_gte: "2024-01-15T09:30:00Z",
101
102
  * body: {}
@@ -107,7 +108,7 @@ export class Expanded {
107
108
  __listV1(request, requestOptions) {
108
109
  return __awaiter(this, void 0, void 0, function* () {
109
110
  var _a, _b, _c, _d, _e, _f;
110
- const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_draft_started_at_timestamp_lte: filterDraftStartedAtTimestampLte, filter_draft_started_at_timestamp_gte: filterDraftStartedAtTimestampGte, body: _body, } = request;
111
+ const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, search, filter_draft_started_at_timestamp_lte: filterDraftStartedAtTimestampLte, filter_draft_started_at_timestamp_gte: filterDraftStartedAtTimestampGte, body: _body, } = request;
111
112
  const _queryParams = {};
112
113
  if (sortBy !== undefined) {
113
114
  _queryParams["sort_by"] = sortBy;
@@ -121,6 +122,9 @@ export class Expanded {
121
122
  if (pageSize !== undefined) {
122
123
  _queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
123
124
  }
125
+ if (search !== undefined) {
126
+ _queryParams["search"] = search;
127
+ }
124
128
  if (filterDraftStartedAtTimestampLte !== undefined) {
125
129
  _queryParams["filter_draft_started_at_timestamp_lte"] = filterDraftStartedAtTimestampLte;
126
130
  }
@@ -172,6 +176,74 @@ export class Expanded {
172
176
  }
173
177
  });
174
178
  }
179
+ /**
180
+ * Returns distinct short_id and off_chrt_reference_id values matching the query via case-insensitive regex. Searches draft orders created by the caller's org. | authz: min_org_role=operator | () -> (list[OrderTypeaheadResult])
181
+ *
182
+ * @param {Chrt.shipping.orderDrafts.ExpandedTypeaheadV1Request} request
183
+ * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
184
+ *
185
+ * @throws {@link Chrt.UnprocessableEntityError}
186
+ *
187
+ * @example
188
+ * await client.shipping.orderDrafts.expanded.typeaheadV1({
189
+ * query: "query",
190
+ * limit: 1
191
+ * })
192
+ */
193
+ typeaheadV1(request, requestOptions) {
194
+ return core.HttpResponsePromise.fromPromise(this.__typeaheadV1(request, requestOptions));
195
+ }
196
+ __typeaheadV1(request, requestOptions) {
197
+ return __awaiter(this, void 0, void 0, function* () {
198
+ var _a, _b, _c, _d, _e;
199
+ const { query, limit } = request;
200
+ const _queryParams = {};
201
+ _queryParams["query"] = query;
202
+ if (limit !== undefined) {
203
+ _queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
204
+ }
205
+ 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);
206
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
207
+ 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, "shipping/order_drafts/expanded/typeahead/v1"),
208
+ method: "GET",
209
+ headers: _headers,
210
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
211
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
212
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
213
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
214
+ });
215
+ if (_response.ok) {
216
+ return { data: _response.body, rawResponse: _response.rawResponse };
217
+ }
218
+ if (_response.error.reason === "status-code") {
219
+ switch (_response.error.statusCode) {
220
+ case 422:
221
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
222
+ default:
223
+ throw new errors.ChrtError({
224
+ statusCode: _response.error.statusCode,
225
+ body: _response.error.body,
226
+ rawResponse: _response.rawResponse,
227
+ });
228
+ }
229
+ }
230
+ switch (_response.error.reason) {
231
+ case "non-json":
232
+ throw new errors.ChrtError({
233
+ statusCode: _response.error.statusCode,
234
+ body: _response.error.rawBody,
235
+ rawResponse: _response.rawResponse,
236
+ });
237
+ case "timeout":
238
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping/order_drafts/expanded/typeahead/v1.");
239
+ case "unknown":
240
+ throw new errors.ChrtError({
241
+ message: _response.error.errorMessage,
242
+ rawResponse: _response.rawResponse,
243
+ });
244
+ }
245
+ });
246
+ }
175
247
  _getAuthorizationHeader() {
176
248
  return __awaiter(this, void 0, void 0, function* () {
177
249
  const bearer = yield core.Supplier.get(this._options.token);
@@ -9,6 +9,7 @@ import * as Chrt from "../../../../../../../../index.mjs";
9
9
  * sort_order: "asc",
10
10
  * page: 1,
11
11
  * page_size: 1,
12
+ * search: "search",
12
13
  * filter_draft_started_at_timestamp_lte: "2024-01-15T09:30:00Z",
13
14
  * filter_draft_started_at_timestamp_gte: "2024-01-15T09:30:00Z",
14
15
  * body: {}
@@ -20,6 +21,8 @@ export interface ExpandedListV1Request {
20
21
  sort_order?: Chrt.SortOrderEnum | null;
21
22
  page?: number | null;
22
23
  page_size?: number | null;
24
+ /** Full-text search query (searches order short_id and off_chrt_reference_id) */
25
+ search?: string | null;
23
26
  filter_draft_started_at_timestamp_lte?: string | null;
24
27
  filter_draft_started_at_timestamp_gte?: string | null;
25
28
  body: Chrt.OrderAndTaskGroupExpandedReq;
@@ -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 ExpandedTypeaheadV1Request {
12
+ /** Typeahead search query */
13
+ query: string;
14
+ /** Max results per field */
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 {};
@@ -1 +1,2 @@
1
1
  export { type ExpandedListV1Request } from "./ExpandedListV1Request.mjs";
2
+ export { type ExpandedTypeaheadV1Request } from "./ExpandedTypeaheadV1Request.mjs";
@@ -125,7 +125,7 @@ export declare class Expanded {
125
125
  listForShipperOperatorsV1(request: Chrt.shipping.orders.ExpandedListForShipperOperatorsV1Request, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrdersExpandedListRes>;
126
126
  private __listForShipperOperatorsV1;
127
127
  /**
128
- * Returns distinct order short_id values matching the query via case-insensitive regex. Searches non-draft orders visible to the caller's org. | authz: allowed_org_types=[forwarder, shipper], min_org_role=operator | () -> (list[str])
128
+ * Returns distinct short_id and off_chrt_reference_id values matching the query via case-insensitive regex. Searches non-draft orders visible to the caller's org. | authz: allowed_org_types=[forwarder, shipper], min_org_role=operator | () -> (list[OrderTypeaheadResult])
129
129
  *
130
130
  * @param {Chrt.shipping.orders.ExpandedTypeaheadV1Request} request
131
131
  * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
@@ -138,7 +138,7 @@ export declare class Expanded {
138
138
  * limit: 1
139
139
  * })
140
140
  */
141
- typeaheadV1(request: Chrt.shipping.orders.ExpandedTypeaheadV1Request, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<string[]>;
141
+ typeaheadV1(request: Chrt.shipping.orders.ExpandedTypeaheadV1Request, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderTypeaheadResult[]>;
142
142
  private __typeaheadV1;
143
143
  protected _getAuthorizationHeader(): Promise<string | undefined>;
144
144
  }
@@ -438,7 +438,7 @@ export class Expanded {
438
438
  });
439
439
  }
440
440
  /**
441
- * Returns distinct order short_id values matching the query via case-insensitive regex. Searches non-draft orders visible to the caller's org. | authz: allowed_org_types=[forwarder, shipper], min_org_role=operator | () -> (list[str])
441
+ * Returns distinct short_id and off_chrt_reference_id values matching the query via case-insensitive regex. Searches non-draft orders visible to the caller's org. | authz: allowed_org_types=[forwarder, shipper], min_org_role=operator | () -> (list[OrderTypeaheadResult])
442
442
  *
443
443
  * @param {Chrt.shipping.orders.ExpandedTypeaheadV1Request} request
444
444
  * @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
@@ -11,6 +11,6 @@
11
11
  export interface ExpandedTypeaheadV1Request {
12
12
  /** Typeahead search query */
13
13
  query: string;
14
- /** Max results */
14
+ /** Max results per field */
15
15
  limit?: number | null;
16
16
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type OrderTypeaheadFieldEnum = "off_chrt_reference_id" | "short_id";
5
+ export declare const OrderTypeaheadFieldEnum: {
6
+ readonly OffChrtReferenceId: "off_chrt_reference_id";
7
+ readonly ShortId: "short_id";
8
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export const OrderTypeaheadFieldEnum = {
5
+ OffChrtReferenceId: "off_chrt_reference_id",
6
+ ShortId: "short_id",
7
+ };
@@ -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 OrderTypeaheadResult {
6
+ type: Chrt.OrderTypeaheadFieldEnum;
7
+ values: string[];
8
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -149,6 +149,8 @@ export * from "./OrderDraftValidationResult.mjs";
149
149
  export * from "./OrderExpanded.mjs";
150
150
  export * from "./OrderSortByEnum.mjs";
151
151
  export * from "./OrderStatusEnum1.mjs";
152
+ export * from "./OrderTypeaheadFieldEnum.mjs";
153
+ export * from "./OrderTypeaheadResult.mjs";
152
154
  export * from "./OrdersDraftUpdateRes.mjs";
153
155
  export * from "./OrdersExpandedListRes.mjs";
154
156
  export * from "./OrdersNewDraftRes.mjs";
@@ -149,6 +149,8 @@ export * from "./OrderDraftValidationResult.mjs";
149
149
  export * from "./OrderExpanded.mjs";
150
150
  export * from "./OrderSortByEnum.mjs";
151
151
  export * from "./OrderStatusEnum1.mjs";
152
+ export * from "./OrderTypeaheadFieldEnum.mjs";
153
+ export * from "./OrderTypeaheadResult.mjs";
152
154
  export * from "./OrdersDraftUpdateRes.mjs";
153
155
  export * from "./OrdersExpandedListRes.mjs";
154
156
  export * from "./OrdersNewDraftRes.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.594.0";
1
+ export declare const SDK_VERSION = "1.595.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.594.0";
1
+ export const SDK_VERSION = "1.595.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrt-inc/typescript-sdk",
3
- "version": "1.594.0",
3
+ "version": "1.595.0",
4
4
  "private": false,
5
5
  "repository": "github:chrt-inc/typescript-sdk",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -11277,7 +11277,7 @@ await client.shipping.orderDrafts.expanded.retrieveV1("order_ref", {});
11277
11277
  <dl>
11278
11278
  <dd>
11279
11279
 
11280
- Lists expanded draft orders for the organization with filtering, sorting, and pagination. | (OrderAndTaskGroupExpandedReq) -> (OrderDraftExpandedListRes)
11280
+ Lists expanded draft orders for the organization with filtering, sorting, pagination, and optional search. | (OrderAndTaskGroupExpandedReq) -> (OrderDraftExpandedListRes)
11281
11281
 
11282
11282
  </dd>
11283
11283
  </dl>
@@ -11298,6 +11298,7 @@ await client.shipping.orderDrafts.expanded.listV1({
11298
11298
  sort_order: "asc",
11299
11299
  page: 1,
11300
11300
  page_size: 1,
11301
+ search: "search",
11301
11302
  filter_draft_started_at_timestamp_lte: "2024-01-15T09:30:00Z",
11302
11303
  filter_draft_started_at_timestamp_gte: "2024-01-15T09:30:00Z",
11303
11304
  body: {},
@@ -11336,6 +11337,72 @@ await client.shipping.orderDrafts.expanded.listV1({
11336
11337
  </dl>
11337
11338
  </details>
11338
11339
 
11340
+ <details><summary><code>client.shipping.orderDrafts.expanded.<a href="/src/api/resources/shipping/resources/orderDrafts/resources/expanded/client/Client.ts">typeaheadV1</a>({ ...params }) -> Chrt.OrderTypeaheadResult[]</code></summary>
11341
+ <dl>
11342
+ <dd>
11343
+
11344
+ #### 📝 Description
11345
+
11346
+ <dl>
11347
+ <dd>
11348
+
11349
+ <dl>
11350
+ <dd>
11351
+
11352
+ Returns distinct short_id and off_chrt_reference_id values matching the query via case-insensitive regex. Searches draft orders created by the caller's org. | authz: min_org_role=operator | () -> (list[OrderTypeaheadResult])
11353
+
11354
+ </dd>
11355
+ </dl>
11356
+ </dd>
11357
+ </dl>
11358
+
11359
+ #### 🔌 Usage
11360
+
11361
+ <dl>
11362
+ <dd>
11363
+
11364
+ <dl>
11365
+ <dd>
11366
+
11367
+ ```typescript
11368
+ await client.shipping.orderDrafts.expanded.typeaheadV1({
11369
+ query: "query",
11370
+ limit: 1,
11371
+ });
11372
+ ```
11373
+
11374
+ </dd>
11375
+ </dl>
11376
+ </dd>
11377
+ </dl>
11378
+
11379
+ #### ⚙️ Parameters
11380
+
11381
+ <dl>
11382
+ <dd>
11383
+
11384
+ <dl>
11385
+ <dd>
11386
+
11387
+ **request:** `Chrt.shipping.orderDrafts.ExpandedTypeaheadV1Request`
11388
+
11389
+ </dd>
11390
+ </dl>
11391
+
11392
+ <dl>
11393
+ <dd>
11394
+
11395
+ **requestOptions:** `Expanded.RequestOptions`
11396
+
11397
+ </dd>
11398
+ </dl>
11399
+ </dd>
11400
+ </dl>
11401
+
11402
+ </dd>
11403
+ </dl>
11404
+ </details>
11405
+
11339
11406
  ## Shipping Orders Expanded
11340
11407
 
11341
11408
  <details><summary><code>client.shipping.orders.expanded.<a href="/src/api/resources/shipping/resources/orders/resources/expanded/client/Client.ts">forShipperOperatorsV1</a>(orderRef, { ...params }) -> Chrt.OrderExpanded</code></summary>
@@ -11646,7 +11713,7 @@ await client.shipping.orders.expanded.listForShipperOperatorsV1({
11646
11713
  </dl>
11647
11714
  </details>
11648
11715
 
11649
- <details><summary><code>client.shipping.orders.expanded.<a href="/src/api/resources/shipping/resources/orders/resources/expanded/client/Client.ts">typeaheadV1</a>({ ...params }) -> string[]</code></summary>
11716
+ <details><summary><code>client.shipping.orders.expanded.<a href="/src/api/resources/shipping/resources/orders/resources/expanded/client/Client.ts">typeaheadV1</a>({ ...params }) -> Chrt.OrderTypeaheadResult[]</code></summary>
11650
11717
  <dl>
11651
11718
  <dd>
11652
11719
 
@@ -11658,7 +11725,7 @@ await client.shipping.orders.expanded.listForShipperOperatorsV1({
11658
11725
  <dl>
11659
11726
  <dd>
11660
11727
 
11661
- Returns distinct order short_id values matching the query via case-insensitive regex. Searches non-draft orders visible to the caller's org. | authz: allowed_org_types=[forwarder, shipper], min_org_role=operator | () -> (list[str])
11728
+ Returns distinct short_id and off_chrt_reference_id values matching the query via case-insensitive regex. Searches non-draft orders visible to the caller's org. | authz: allowed_org_types=[forwarder, shipper], min_org_role=operator | () -> (list[OrderTypeaheadResult])
11662
11729
 
11663
11730
  </dd>
11664
11731
  </dl>