@chrt-inc/typescript-sdk 1.708.0 → 1.710.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/shipping/resources/orderDrafts/client/Client.d.ts +16 -0
- package/dist/cjs/api/resources/shipping/resources/orderDrafts/client/Client.js +68 -0
- package/dist/cjs/api/resources/shipping/resources/orderDrafts/client/requests/BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post.d.ts +13 -0
- package/dist/cjs/api/resources/shipping/resources/orderDrafts/client/requests/BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post.js +5 -0
- package/dist/cjs/api/resources/shipping/resources/orderDrafts/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/agentic/client/Client.d.ts +16 -0
- package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/agentic/client/Client.js +65 -0
- package/dist/cjs/api/types/OrderBuilderPrecheckRes.d.ts +7 -0
- package/dist/cjs/api/types/OrderBuilderPrecheckRes.js +5 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/shipping/resources/orderDrafts/client/Client.d.mts +16 -0
- package/dist/esm/api/resources/shipping/resources/orderDrafts/client/Client.mjs +68 -0
- package/dist/esm/api/resources/shipping/resources/orderDrafts/client/requests/BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post.d.mts +13 -0
- package/dist/esm/api/resources/shipping/resources/orderDrafts/client/requests/BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post.mjs +4 -0
- package/dist/esm/api/resources/shipping/resources/orderDrafts/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/agentic/client/Client.d.mts +16 -0
- package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/agentic/client/Client.mjs +65 -0
- package/dist/esm/api/types/OrderBuilderPrecheckRes.d.mts +7 -0
- package/dist/esm/api/types/OrderBuilderPrecheckRes.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +131 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -56,8 +56,8 @@ class ChrtClient {
|
|
|
56
56
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
57
57
|
"X-Fern-Language": "JavaScript",
|
|
58
58
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
59
|
-
"X-Fern-SDK-Version": "1.
|
|
60
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
59
|
+
"X-Fern-SDK-Version": "1.710.0",
|
|
60
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.710.0",
|
|
61
61
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
62
62
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
63
63
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -88,6 +88,22 @@ export declare class OrderDrafts {
|
|
|
88
88
|
*/
|
|
89
89
|
deleteV1(orderId: string, requestOptions?: OrderDrafts.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
90
90
|
private __deleteV1;
|
|
91
|
+
/**
|
|
92
|
+
* Converts an order screenshot into lightly structured text for the AI order builder. | (UploadFile) -> (str)
|
|
93
|
+
*
|
|
94
|
+
* @param {Chrt.shipping.BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post} request
|
|
95
|
+
* @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
96
|
+
*
|
|
97
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* import { createReadStream } from "fs";
|
|
101
|
+
* await client.shipping.orderDrafts.imageToTextV1({
|
|
102
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
103
|
+
* })
|
|
104
|
+
*/
|
|
105
|
+
imageToTextV1(request: Chrt.shipping.BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post, requestOptions?: OrderDrafts.RequestOptions): core.HttpResponsePromise<string>;
|
|
106
|
+
private __imageToTextV1;
|
|
91
107
|
/**
|
|
92
108
|
* Validates the draft order for staging and returns requirement results. | () -> (OrderDraftValidationResult)
|
|
93
109
|
*
|
|
@@ -269,6 +269,74 @@ class OrderDrafts {
|
|
|
269
269
|
}
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Converts an order screenshot into lightly structured text for the AI order builder. | (UploadFile) -> (str)
|
|
274
|
+
*
|
|
275
|
+
* @param {Chrt.shipping.BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post} request
|
|
276
|
+
* @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
277
|
+
*
|
|
278
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* import { createReadStream } from "fs";
|
|
282
|
+
* await client.shipping.orderDrafts.imageToTextV1({
|
|
283
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
284
|
+
* })
|
|
285
|
+
*/
|
|
286
|
+
imageToTextV1(request, requestOptions) {
|
|
287
|
+
return core.HttpResponsePromise.fromPromise(this.__imageToTextV1(request, requestOptions));
|
|
288
|
+
}
|
|
289
|
+
__imageToTextV1(request, requestOptions) {
|
|
290
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
291
|
+
var _a, _b, _c, _d;
|
|
292
|
+
const _request = yield core.newFormData();
|
|
293
|
+
yield _request.appendFile("file", request.file);
|
|
294
|
+
const _maybeEncodedRequest = yield _request.getRequest();
|
|
295
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
296
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
297
|
+
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, "shipping/order_drafts/image_to_text/v1"),
|
|
298
|
+
method: "POST",
|
|
299
|
+
headers: _headers,
|
|
300
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
301
|
+
requestType: "file",
|
|
302
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
303
|
+
body: _maybeEncodedRequest.body,
|
|
304
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
305
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
306
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
307
|
+
});
|
|
308
|
+
if (_response.ok) {
|
|
309
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
310
|
+
}
|
|
311
|
+
if (_response.error.reason === "status-code") {
|
|
312
|
+
switch (_response.error.statusCode) {
|
|
313
|
+
case 422:
|
|
314
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
315
|
+
default:
|
|
316
|
+
throw new errors.ChrtError({
|
|
317
|
+
statusCode: _response.error.statusCode,
|
|
318
|
+
body: _response.error.body,
|
|
319
|
+
rawResponse: _response.rawResponse,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
switch (_response.error.reason) {
|
|
324
|
+
case "non-json":
|
|
325
|
+
throw new errors.ChrtError({
|
|
326
|
+
statusCode: _response.error.statusCode,
|
|
327
|
+
body: _response.error.rawBody,
|
|
328
|
+
rawResponse: _response.rawResponse,
|
|
329
|
+
});
|
|
330
|
+
case "timeout":
|
|
331
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/order_drafts/image_to_text/v1.");
|
|
332
|
+
case "unknown":
|
|
333
|
+
throw new errors.ChrtError({
|
|
334
|
+
message: _response.error.errorMessage,
|
|
335
|
+
rawResponse: _response.rawResponse,
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}
|
|
272
340
|
/**
|
|
273
341
|
* Validates the draft order for staging and returns requirement results. | () -> (OrderDraftValidationResult)
|
|
274
342
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as core from "../../../../../../../core/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post {
|
|
12
|
+
file: core.file.Uploadable.FileLike;
|
|
13
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { type OrdersNewDraftReq } from "./OrdersNewDraftReq.js";
|
|
2
2
|
export { type OrdersDraftUpdateReq } from "./OrdersDraftUpdateReq.js";
|
|
3
|
+
export { type BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post } from "./BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post.js";
|
package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/agentic/client/Client.d.ts
CHANGED
|
@@ -30,6 +30,22 @@ export declare namespace Agentic {
|
|
|
30
30
|
export declare class Agentic {
|
|
31
31
|
protected readonly _options: Agentic.Options;
|
|
32
32
|
constructor(_options?: Agentic.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Predicts whether input is complete enough for the AI order builder. | (OrderBuilderReq) -> (OrderBuilderPrecheckRes)
|
|
35
|
+
*
|
|
36
|
+
* @param {Chrt.OrderBuilderReq} request
|
|
37
|
+
* @param {Agentic.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.shipping.orderDrafts.agentic.precheckV1({
|
|
43
|
+
* order_short_id: "order_short_id",
|
|
44
|
+
* text: "text"
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
47
|
+
precheckV1(request: Chrt.OrderBuilderReq, requestOptions?: Agentic.RequestOptions): core.HttpResponsePromise<Chrt.OrderBuilderPrecheckRes>;
|
|
48
|
+
private __precheckV1;
|
|
33
49
|
/**
|
|
34
50
|
* Populates an existing draft order with cargo, task groups, and tasks parsed from natural language. | (OrderBuilderReq) -> (OrderBuilderRes)
|
|
35
51
|
*
|
package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/agentic/client/Client.js
CHANGED
|
@@ -55,6 +55,71 @@ class Agentic {
|
|
|
55
55
|
constructor(_options = {}) {
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Predicts whether input is complete enough for the AI order builder. | (OrderBuilderReq) -> (OrderBuilderPrecheckRes)
|
|
60
|
+
*
|
|
61
|
+
* @param {Chrt.OrderBuilderReq} request
|
|
62
|
+
* @param {Agentic.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.shipping.orderDrafts.agentic.precheckV1({
|
|
68
|
+
* order_short_id: "order_short_id",
|
|
69
|
+
* text: "text"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
precheckV1(request, requestOptions) {
|
|
73
|
+
return core.HttpResponsePromise.fromPromise(this.__precheckV1(request, requestOptions));
|
|
74
|
+
}
|
|
75
|
+
__precheckV1(request, requestOptions) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
var _a, _b, _c, _d;
|
|
78
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
79
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
80
|
+
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, "shipping/order_drafts/agentic/precheck/v1"),
|
|
81
|
+
method: "POST",
|
|
82
|
+
headers: _headers,
|
|
83
|
+
contentType: "application/json",
|
|
84
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
85
|
+
requestType: "json",
|
|
86
|
+
body: request,
|
|
87
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
88
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
89
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
90
|
+
});
|
|
91
|
+
if (_response.ok) {
|
|
92
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
93
|
+
}
|
|
94
|
+
if (_response.error.reason === "status-code") {
|
|
95
|
+
switch (_response.error.statusCode) {
|
|
96
|
+
case 422:
|
|
97
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
98
|
+
default:
|
|
99
|
+
throw new errors.ChrtError({
|
|
100
|
+
statusCode: _response.error.statusCode,
|
|
101
|
+
body: _response.error.body,
|
|
102
|
+
rawResponse: _response.rawResponse,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
switch (_response.error.reason) {
|
|
107
|
+
case "non-json":
|
|
108
|
+
throw new errors.ChrtError({
|
|
109
|
+
statusCode: _response.error.statusCode,
|
|
110
|
+
body: _response.error.rawBody,
|
|
111
|
+
rawResponse: _response.rawResponse,
|
|
112
|
+
});
|
|
113
|
+
case "timeout":
|
|
114
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/order_drafts/agentic/precheck/v1.");
|
|
115
|
+
case "unknown":
|
|
116
|
+
throw new errors.ChrtError({
|
|
117
|
+
message: _response.error.errorMessage,
|
|
118
|
+
rawResponse: _response.rawResponse,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
58
123
|
/**
|
|
59
124
|
* Populates an existing draft order with cargo, task groups, and tasks parsed from natural language. | (OrderBuilderReq) -> (OrderBuilderRes)
|
|
60
125
|
*
|
|
@@ -214,6 +214,7 @@ export * from "./OperationsTaskListRes.js";
|
|
|
214
214
|
export * from "./OperationsTaskSortByEnum.js";
|
|
215
215
|
export * from "./Order1.js";
|
|
216
216
|
export * from "./OrderAndTaskGroupExpandedReq.js";
|
|
217
|
+
export * from "./OrderBuilderPrecheckRes.js";
|
|
217
218
|
export * from "./OrderBuilderReq.js";
|
|
218
219
|
export * from "./OrderBuilderRes.js";
|
|
219
220
|
export * from "./OrderDraftExpanded.js";
|
|
@@ -230,6 +230,7 @@ __exportStar(require("./OperationsTaskListRes.js"), exports);
|
|
|
230
230
|
__exportStar(require("./OperationsTaskSortByEnum.js"), exports);
|
|
231
231
|
__exportStar(require("./Order1.js"), exports);
|
|
232
232
|
__exportStar(require("./OrderAndTaskGroupExpandedReq.js"), exports);
|
|
233
|
+
__exportStar(require("./OrderBuilderPrecheckRes.js"), exports);
|
|
233
234
|
__exportStar(require("./OrderBuilderReq.js"), exports);
|
|
234
235
|
__exportStar(require("./OrderBuilderRes.js"), exports);
|
|
235
236
|
__exportStar(require("./OrderDraftExpanded.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.710.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -20,8 +20,8 @@ export class ChrtClient {
|
|
|
20
20
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
21
21
|
"X-Fern-Language": "JavaScript",
|
|
22
22
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
23
|
-
"X-Fern-SDK-Version": "1.
|
|
24
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
23
|
+
"X-Fern-SDK-Version": "1.710.0",
|
|
24
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.710.0",
|
|
25
25
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
26
26
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
27
27
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -88,6 +88,22 @@ export declare class OrderDrafts {
|
|
|
88
88
|
*/
|
|
89
89
|
deleteV1(orderId: string, requestOptions?: OrderDrafts.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
90
90
|
private __deleteV1;
|
|
91
|
+
/**
|
|
92
|
+
* Converts an order screenshot into lightly structured text for the AI order builder. | (UploadFile) -> (str)
|
|
93
|
+
*
|
|
94
|
+
* @param {Chrt.shipping.BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post} request
|
|
95
|
+
* @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
96
|
+
*
|
|
97
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* import { createReadStream } from "fs";
|
|
101
|
+
* await client.shipping.orderDrafts.imageToTextV1({
|
|
102
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
103
|
+
* })
|
|
104
|
+
*/
|
|
105
|
+
imageToTextV1(request: Chrt.shipping.BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post, requestOptions?: OrderDrafts.RequestOptions): core.HttpResponsePromise<string>;
|
|
106
|
+
private __imageToTextV1;
|
|
91
107
|
/**
|
|
92
108
|
* Validates the draft order for staging and returns requirement results. | () -> (OrderDraftValidationResult)
|
|
93
109
|
*
|
|
@@ -233,6 +233,74 @@ export class OrderDrafts {
|
|
|
233
233
|
}
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Converts an order screenshot into lightly structured text for the AI order builder. | (UploadFile) -> (str)
|
|
238
|
+
*
|
|
239
|
+
* @param {Chrt.shipping.BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post} request
|
|
240
|
+
* @param {OrderDrafts.RequestOptions} requestOptions - Request-specific configuration.
|
|
241
|
+
*
|
|
242
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* import { createReadStream } from "fs";
|
|
246
|
+
* await client.shipping.orderDrafts.imageToTextV1({
|
|
247
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
248
|
+
* })
|
|
249
|
+
*/
|
|
250
|
+
imageToTextV1(request, requestOptions) {
|
|
251
|
+
return core.HttpResponsePromise.fromPromise(this.__imageToTextV1(request, requestOptions));
|
|
252
|
+
}
|
|
253
|
+
__imageToTextV1(request, requestOptions) {
|
|
254
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
+
var _a, _b, _c, _d;
|
|
256
|
+
const _request = yield core.newFormData();
|
|
257
|
+
yield _request.appendFile("file", request.file);
|
|
258
|
+
const _maybeEncodedRequest = yield _request.getRequest();
|
|
259
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
260
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
261
|
+
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, "shipping/order_drafts/image_to_text/v1"),
|
|
262
|
+
method: "POST",
|
|
263
|
+
headers: _headers,
|
|
264
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
265
|
+
requestType: "file",
|
|
266
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
267
|
+
body: _maybeEncodedRequest.body,
|
|
268
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
269
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
270
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
271
|
+
});
|
|
272
|
+
if (_response.ok) {
|
|
273
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
274
|
+
}
|
|
275
|
+
if (_response.error.reason === "status-code") {
|
|
276
|
+
switch (_response.error.statusCode) {
|
|
277
|
+
case 422:
|
|
278
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
279
|
+
default:
|
|
280
|
+
throw new errors.ChrtError({
|
|
281
|
+
statusCode: _response.error.statusCode,
|
|
282
|
+
body: _response.error.body,
|
|
283
|
+
rawResponse: _response.rawResponse,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
switch (_response.error.reason) {
|
|
288
|
+
case "non-json":
|
|
289
|
+
throw new errors.ChrtError({
|
|
290
|
+
statusCode: _response.error.statusCode,
|
|
291
|
+
body: _response.error.rawBody,
|
|
292
|
+
rawResponse: _response.rawResponse,
|
|
293
|
+
});
|
|
294
|
+
case "timeout":
|
|
295
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/order_drafts/image_to_text/v1.");
|
|
296
|
+
case "unknown":
|
|
297
|
+
throw new errors.ChrtError({
|
|
298
|
+
message: _response.error.errorMessage,
|
|
299
|
+
rawResponse: _response.rawResponse,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}
|
|
236
304
|
/**
|
|
237
305
|
* Validates the draft order for staging and returns requirement results. | () -> (OrderDraftValidationResult)
|
|
238
306
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as core from "../../../../../../../core/index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post {
|
|
12
|
+
file: core.file.Uploadable.FileLike;
|
|
13
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { type OrdersNewDraftReq } from "./OrdersNewDraftReq.mjs";
|
|
2
2
|
export { type OrdersDraftUpdateReq } from "./OrdersDraftUpdateReq.mjs";
|
|
3
|
+
export { type BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post } from "./BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post.mjs";
|
package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/agentic/client/Client.d.mts
CHANGED
|
@@ -30,6 +30,22 @@ export declare namespace Agentic {
|
|
|
30
30
|
export declare class Agentic {
|
|
31
31
|
protected readonly _options: Agentic.Options;
|
|
32
32
|
constructor(_options?: Agentic.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Predicts whether input is complete enough for the AI order builder. | (OrderBuilderReq) -> (OrderBuilderPrecheckRes)
|
|
35
|
+
*
|
|
36
|
+
* @param {Chrt.OrderBuilderReq} request
|
|
37
|
+
* @param {Agentic.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.shipping.orderDrafts.agentic.precheckV1({
|
|
43
|
+
* order_short_id: "order_short_id",
|
|
44
|
+
* text: "text"
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
47
|
+
precheckV1(request: Chrt.OrderBuilderReq, requestOptions?: Agentic.RequestOptions): core.HttpResponsePromise<Chrt.OrderBuilderPrecheckRes>;
|
|
48
|
+
private __precheckV1;
|
|
33
49
|
/**
|
|
34
50
|
* Populates an existing draft order with cargo, task groups, and tasks parsed from natural language. | (OrderBuilderReq) -> (OrderBuilderRes)
|
|
35
51
|
*
|
package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/agentic/client/Client.mjs
CHANGED
|
@@ -19,6 +19,71 @@ export class Agentic {
|
|
|
19
19
|
constructor(_options = {}) {
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Predicts whether input is complete enough for the AI order builder. | (OrderBuilderReq) -> (OrderBuilderPrecheckRes)
|
|
24
|
+
*
|
|
25
|
+
* @param {Chrt.OrderBuilderReq} request
|
|
26
|
+
* @param {Agentic.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.shipping.orderDrafts.agentic.precheckV1({
|
|
32
|
+
* order_short_id: "order_short_id",
|
|
33
|
+
* text: "text"
|
|
34
|
+
* })
|
|
35
|
+
*/
|
|
36
|
+
precheckV1(request, requestOptions) {
|
|
37
|
+
return core.HttpResponsePromise.fromPromise(this.__precheckV1(request, requestOptions));
|
|
38
|
+
}
|
|
39
|
+
__precheckV1(request, requestOptions) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
var _a, _b, _c, _d;
|
|
42
|
+
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);
|
|
43
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
44
|
+
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, "shipping/order_drafts/agentic/precheck/v1"),
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers: _headers,
|
|
47
|
+
contentType: "application/json",
|
|
48
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
49
|
+
requestType: "json",
|
|
50
|
+
body: request,
|
|
51
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
52
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
53
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
54
|
+
});
|
|
55
|
+
if (_response.ok) {
|
|
56
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
57
|
+
}
|
|
58
|
+
if (_response.error.reason === "status-code") {
|
|
59
|
+
switch (_response.error.statusCode) {
|
|
60
|
+
case 422:
|
|
61
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
62
|
+
default:
|
|
63
|
+
throw new errors.ChrtError({
|
|
64
|
+
statusCode: _response.error.statusCode,
|
|
65
|
+
body: _response.error.body,
|
|
66
|
+
rawResponse: _response.rawResponse,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
switch (_response.error.reason) {
|
|
71
|
+
case "non-json":
|
|
72
|
+
throw new errors.ChrtError({
|
|
73
|
+
statusCode: _response.error.statusCode,
|
|
74
|
+
body: _response.error.rawBody,
|
|
75
|
+
rawResponse: _response.rawResponse,
|
|
76
|
+
});
|
|
77
|
+
case "timeout":
|
|
78
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/order_drafts/agentic/precheck/v1.");
|
|
79
|
+
case "unknown":
|
|
80
|
+
throw new errors.ChrtError({
|
|
81
|
+
message: _response.error.errorMessage,
|
|
82
|
+
rawResponse: _response.rawResponse,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
22
87
|
/**
|
|
23
88
|
* Populates an existing draft order with cargo, task groups, and tasks parsed from natural language. | (OrderBuilderReq) -> (OrderBuilderRes)
|
|
24
89
|
*
|
|
@@ -214,6 +214,7 @@ export * from "./OperationsTaskListRes.mjs";
|
|
|
214
214
|
export * from "./OperationsTaskSortByEnum.mjs";
|
|
215
215
|
export * from "./Order1.mjs";
|
|
216
216
|
export * from "./OrderAndTaskGroupExpandedReq.mjs";
|
|
217
|
+
export * from "./OrderBuilderPrecheckRes.mjs";
|
|
217
218
|
export * from "./OrderBuilderReq.mjs";
|
|
218
219
|
export * from "./OrderBuilderRes.mjs";
|
|
219
220
|
export * from "./OrderDraftExpanded.mjs";
|
|
@@ -214,6 +214,7 @@ export * from "./OperationsTaskListRes.mjs";
|
|
|
214
214
|
export * from "./OperationsTaskSortByEnum.mjs";
|
|
215
215
|
export * from "./Order1.mjs";
|
|
216
216
|
export * from "./OrderAndTaskGroupExpandedReq.mjs";
|
|
217
|
+
export * from "./OrderBuilderPrecheckRes.mjs";
|
|
217
218
|
export * from "./OrderBuilderReq.mjs";
|
|
218
219
|
export * from "./OrderBuilderRes.mjs";
|
|
219
220
|
export * from "./OrderDraftExpanded.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.710.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.
|
|
1
|
+
export const SDK_VERSION = "1.710.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -18091,6 +18091,71 @@ await client.shipping.orderDrafts.deleteV1("order_id");
|
|
|
18091
18091
|
</dl>
|
|
18092
18092
|
</details>
|
|
18093
18093
|
|
|
18094
|
+
<details><summary><code>client.shipping.orderDrafts.<a href="/src/api/resources/shipping/resources/orderDrafts/client/Client.ts">imageToTextV1</a>({ ...params }) -> string</code></summary>
|
|
18095
|
+
<dl>
|
|
18096
|
+
<dd>
|
|
18097
|
+
|
|
18098
|
+
#### 📝 Description
|
|
18099
|
+
|
|
18100
|
+
<dl>
|
|
18101
|
+
<dd>
|
|
18102
|
+
|
|
18103
|
+
<dl>
|
|
18104
|
+
<dd>
|
|
18105
|
+
|
|
18106
|
+
Converts an order screenshot into lightly structured text for the AI order builder. | (UploadFile) -> (str)
|
|
18107
|
+
|
|
18108
|
+
</dd>
|
|
18109
|
+
</dl>
|
|
18110
|
+
</dd>
|
|
18111
|
+
</dl>
|
|
18112
|
+
|
|
18113
|
+
#### 🔌 Usage
|
|
18114
|
+
|
|
18115
|
+
<dl>
|
|
18116
|
+
<dd>
|
|
18117
|
+
|
|
18118
|
+
<dl>
|
|
18119
|
+
<dd>
|
|
18120
|
+
|
|
18121
|
+
```typescript
|
|
18122
|
+
await client.shipping.orderDrafts.imageToTextV1({
|
|
18123
|
+
file: fs.createReadStream("/path/to/your/file"),
|
|
18124
|
+
});
|
|
18125
|
+
```
|
|
18126
|
+
|
|
18127
|
+
</dd>
|
|
18128
|
+
</dl>
|
|
18129
|
+
</dd>
|
|
18130
|
+
</dl>
|
|
18131
|
+
|
|
18132
|
+
#### ⚙️ Parameters
|
|
18133
|
+
|
|
18134
|
+
<dl>
|
|
18135
|
+
<dd>
|
|
18136
|
+
|
|
18137
|
+
<dl>
|
|
18138
|
+
<dd>
|
|
18139
|
+
|
|
18140
|
+
**request:** `Chrt.shipping.BodyPostShippingOrderDraftsImageToTextV1ShippingOrderDraftsImageToTextV1Post`
|
|
18141
|
+
|
|
18142
|
+
</dd>
|
|
18143
|
+
</dl>
|
|
18144
|
+
|
|
18145
|
+
<dl>
|
|
18146
|
+
<dd>
|
|
18147
|
+
|
|
18148
|
+
**requestOptions:** `OrderDrafts.RequestOptions`
|
|
18149
|
+
|
|
18150
|
+
</dd>
|
|
18151
|
+
</dl>
|
|
18152
|
+
</dd>
|
|
18153
|
+
</dl>
|
|
18154
|
+
|
|
18155
|
+
</dd>
|
|
18156
|
+
</dl>
|
|
18157
|
+
</details>
|
|
18158
|
+
|
|
18094
18159
|
<details><summary><code>client.shipping.orderDrafts.<a href="/src/api/resources/shipping/resources/orderDrafts/client/Client.ts">validateV1</a>(orderId) -> Chrt.OrderDraftValidationResult</code></summary>
|
|
18095
18160
|
<dl>
|
|
18096
18161
|
<dd>
|
|
@@ -21729,6 +21794,72 @@ await client.shipping.drivers.complianceDocuments.s3Object.deleteV1("driver_comp
|
|
|
21729
21794
|
|
|
21730
21795
|
## Shipping OrderDrafts Agentic
|
|
21731
21796
|
|
|
21797
|
+
<details><summary><code>client.shipping.orderDrafts.agentic.<a href="/src/api/resources/shipping/resources/orderDrafts/resources/agentic/client/Client.ts">precheckV1</a>({ ...params }) -> Chrt.OrderBuilderPrecheckRes</code></summary>
|
|
21798
|
+
<dl>
|
|
21799
|
+
<dd>
|
|
21800
|
+
|
|
21801
|
+
#### 📝 Description
|
|
21802
|
+
|
|
21803
|
+
<dl>
|
|
21804
|
+
<dd>
|
|
21805
|
+
|
|
21806
|
+
<dl>
|
|
21807
|
+
<dd>
|
|
21808
|
+
|
|
21809
|
+
Predicts whether input is complete enough for the AI order builder. | (OrderBuilderReq) -> (OrderBuilderPrecheckRes)
|
|
21810
|
+
|
|
21811
|
+
</dd>
|
|
21812
|
+
</dl>
|
|
21813
|
+
</dd>
|
|
21814
|
+
</dl>
|
|
21815
|
+
|
|
21816
|
+
#### 🔌 Usage
|
|
21817
|
+
|
|
21818
|
+
<dl>
|
|
21819
|
+
<dd>
|
|
21820
|
+
|
|
21821
|
+
<dl>
|
|
21822
|
+
<dd>
|
|
21823
|
+
|
|
21824
|
+
```typescript
|
|
21825
|
+
await client.shipping.orderDrafts.agentic.precheckV1({
|
|
21826
|
+
order_short_id: "order_short_id",
|
|
21827
|
+
text: "text",
|
|
21828
|
+
});
|
|
21829
|
+
```
|
|
21830
|
+
|
|
21831
|
+
</dd>
|
|
21832
|
+
</dl>
|
|
21833
|
+
</dd>
|
|
21834
|
+
</dl>
|
|
21835
|
+
|
|
21836
|
+
#### ⚙️ Parameters
|
|
21837
|
+
|
|
21838
|
+
<dl>
|
|
21839
|
+
<dd>
|
|
21840
|
+
|
|
21841
|
+
<dl>
|
|
21842
|
+
<dd>
|
|
21843
|
+
|
|
21844
|
+
**request:** `Chrt.OrderBuilderReq`
|
|
21845
|
+
|
|
21846
|
+
</dd>
|
|
21847
|
+
</dl>
|
|
21848
|
+
|
|
21849
|
+
<dl>
|
|
21850
|
+
<dd>
|
|
21851
|
+
|
|
21852
|
+
**requestOptions:** `Agentic.RequestOptions`
|
|
21853
|
+
|
|
21854
|
+
</dd>
|
|
21855
|
+
</dl>
|
|
21856
|
+
</dd>
|
|
21857
|
+
</dl>
|
|
21858
|
+
|
|
21859
|
+
</dd>
|
|
21860
|
+
</dl>
|
|
21861
|
+
</details>
|
|
21862
|
+
|
|
21732
21863
|
<details><summary><code>client.shipping.orderDrafts.agentic.<a href="/src/api/resources/shipping/resources/orderDrafts/resources/agentic/client/Client.ts">newV1</a>({ ...params }) -> Chrt.OrderBuilderRes</code></summary>
|
|
21733
21864
|
<dl>
|
|
21734
21865
|
<dd>
|