@chrt-inc/typescript-sdk 1.708.0 → 1.718.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/resources/shipping/resources/orderDrafts/resources/taskArtifact/client/requests/OrderDraftAddTaskArtifactReq.d.ts +1 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/client/Client.js +5 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/index.js +3 -1
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.d.ts +68 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.js +201 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.js +17 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.d.ts +15 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.js +5 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.d.ts +15 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.js +5 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/index.js +17 -0
- package/dist/cjs/api/types/DeviceLimitedForList1.d.ts +2 -0
- package/dist/cjs/api/types/Driver1.d.ts +2 -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/ScanPayloadKindEnum.d.ts +8 -0
- package/dist/cjs/api/types/ScanPayloadKindEnum.js +10 -0
- package/dist/cjs/api/types/TaskArtifact1.d.ts +2 -0
- package/dist/cjs/api/types/TaskArtifactClientCreate1.d.ts +1 -0
- package/dist/cjs/api/types/TaskArtifactTypeEnum1.d.ts +2 -1
- package/dist/cjs/api/types/TaskArtifactTypeEnum1.js +1 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -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/resources/shipping/resources/orderDrafts/resources/taskArtifact/client/requests/OrderDraftAddTaskArtifactReq.d.mts +1 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/client/Client.mjs +5 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/index.mjs +2 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.d.mts +68 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.mjs +164 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.d.mts +2 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.mjs +1 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.d.mts +15 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.mjs +4 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.d.mts +15 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.mjs +4 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/index.d.mts +1 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/index.mjs +1 -0
- package/dist/esm/api/types/DeviceLimitedForList1.d.mts +2 -0
- package/dist/esm/api/types/Driver1.d.mts +2 -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/ScanPayloadKindEnum.d.mts +8 -0
- package/dist/esm/api/types/ScanPayloadKindEnum.mjs +7 -0
- package/dist/esm/api/types/TaskArtifact1.d.mts +2 -0
- package/dist/esm/api/types/TaskArtifactClientCreate1.d.mts +1 -0
- package/dist/esm/api/types/TaskArtifactTypeEnum1.d.mts +2 -1
- package/dist/esm/api/types/TaskArtifactTypeEnum1.mjs +1 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +281 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -24,6 +24,8 @@ export interface DeviceLimitedForList1 {
|
|
|
24
24
|
first_seen_at_timestamp?: string | null;
|
|
25
25
|
last_seen_at_location?: Chrt.LocationFeature | null;
|
|
26
26
|
last_seen_at_timestamp?: string | null;
|
|
27
|
+
last_seen_at_location_city?: string | null;
|
|
28
|
+
last_seen_at_location_large_city?: string | null;
|
|
27
29
|
last_seen_battery_level?: string | null;
|
|
28
30
|
archived?: boolean;
|
|
29
31
|
paused?: boolean;
|
|
@@ -24,4 +24,6 @@ export interface Driver1 {
|
|
|
24
24
|
active_task_group_ids?: string[];
|
|
25
25
|
last_seen_at_location?: Chrt.LocationFeature | null;
|
|
26
26
|
last_seen_at_timestamp?: string | null;
|
|
27
|
+
last_seen_at_location_city?: string | null;
|
|
28
|
+
last_seen_at_location_large_city?: string | null;
|
|
27
29
|
}
|
|
@@ -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.ScanPayloadKindEnum = void 0;
|
|
7
|
+
exports.ScanPayloadKindEnum = {
|
|
8
|
+
Expected: "expected",
|
|
9
|
+
Observed: "observed",
|
|
10
|
+
};
|
|
@@ -5,6 +5,7 @@ import * as Chrt from "../index.js";
|
|
|
5
5
|
export interface TaskArtifact1 {
|
|
6
6
|
schema_version: number;
|
|
7
7
|
type: Chrt.TaskArtifactTypeEnum1;
|
|
8
|
+
expected_scan_payloads?: string[];
|
|
8
9
|
_id: string;
|
|
9
10
|
order_id: string;
|
|
10
11
|
order_short_id: string;
|
|
@@ -26,6 +27,7 @@ export interface TaskArtifact1 {
|
|
|
26
27
|
completed_by_org_id?: string | null;
|
|
27
28
|
/** Must be a string starting with `user_` */
|
|
28
29
|
completed_by_user_id?: string | null;
|
|
30
|
+
observed_scan_payloads?: string[];
|
|
29
31
|
status?: Chrt.TaskArtifactStatusEnum1;
|
|
30
32
|
draft_started_at_timestamp: string;
|
|
31
33
|
staged_at_timestamp?: string | null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export type TaskArtifactTypeEnum1 = "image" | "signature" | "other";
|
|
4
|
+
export type TaskArtifactTypeEnum1 = "image" | "signature" | "scan" | "other";
|
|
5
5
|
export declare const TaskArtifactTypeEnum1: {
|
|
6
6
|
readonly Image: "image";
|
|
7
7
|
readonly Signature: "signature";
|
|
8
|
+
readonly Scan: "scan";
|
|
8
9
|
readonly Other: "other";
|
|
9
10
|
};
|
|
@@ -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";
|
|
@@ -273,6 +274,7 @@ export * from "./ProviderOrgProfile1.js";
|
|
|
273
274
|
export * from "./ProviderProviderConnection1.js";
|
|
274
275
|
export * from "./RateSheetMapping1.js";
|
|
275
276
|
export * from "./RateSheetMappingListRes.js";
|
|
277
|
+
export * from "./ScanPayloadKindEnum.js";
|
|
276
278
|
export * from "./ScheduleCalendarSpec.js";
|
|
277
279
|
export * from "./ScheduleIntervalSpec.js";
|
|
278
280
|
export * from "./ScheduleRange.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);
|
|
@@ -289,6 +290,7 @@ __exportStar(require("./ProviderOrgProfile1.js"), exports);
|
|
|
289
290
|
__exportStar(require("./ProviderProviderConnection1.js"), exports);
|
|
290
291
|
__exportStar(require("./RateSheetMapping1.js"), exports);
|
|
291
292
|
__exportStar(require("./RateSheetMappingListRes.js"), exports);
|
|
293
|
+
__exportStar(require("./ScanPayloadKindEnum.js"), exports);
|
|
292
294
|
__exportStar(require("./ScheduleCalendarSpec.js"), exports);
|
|
293
295
|
__exportStar(require("./ScheduleIntervalSpec.js"), exports);
|
|
294
296
|
__exportStar(require("./ScheduleRange.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.718.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.718.0",
|
|
24
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.718.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
|
*
|
|
@@ -12,5 +12,6 @@ import * as Chrt from "../../../../../../../../index.mjs";
|
|
|
12
12
|
export interface OrderDraftAddTaskArtifactReq {
|
|
13
13
|
task_id: string;
|
|
14
14
|
task_artifact_type: Chrt.TaskArtifactTypeEnum1;
|
|
15
|
+
expected_scan_payloads?: string[];
|
|
15
16
|
order_schedule_template_path?: string | null;
|
|
16
17
|
}
|
|
@@ -5,6 +5,7 @@ import * as environments from "../../../../../../environments.mjs";
|
|
|
5
5
|
import * as core from "../../../../../../core/index.mjs";
|
|
6
6
|
import * as Chrt from "../../../../../index.mjs";
|
|
7
7
|
import { S3Object } from "../resources/s3Object/client/Client.mjs";
|
|
8
|
+
import { Scan } from "../resources/scan/client/Client.mjs";
|
|
8
9
|
export declare namespace TaskArtifacts {
|
|
9
10
|
interface Options {
|
|
10
11
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
@@ -31,8 +32,10 @@ export declare namespace TaskArtifacts {
|
|
|
31
32
|
export declare class TaskArtifacts {
|
|
32
33
|
protected readonly _options: TaskArtifacts.Options;
|
|
33
34
|
protected _s3Object: S3Object | undefined;
|
|
35
|
+
protected _scan: Scan | undefined;
|
|
34
36
|
constructor(_options?: TaskArtifacts.Options);
|
|
35
37
|
get s3Object(): S3Object;
|
|
38
|
+
get scan(): Scan;
|
|
36
39
|
/**
|
|
37
40
|
* Adds a new task artifact to a task. | authz_personas=[driver_for_executor, executor_org_operators, coordinator_org_operators] | (AddTaskArtifactReq) -> (PydanticObjectId)
|
|
38
41
|
*
|
|
@@ -16,6 +16,7 @@ import * as Chrt from "../../../../../index.mjs";
|
|
|
16
16
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
17
17
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
18
18
|
import { S3Object } from "../resources/s3Object/client/Client.mjs";
|
|
19
|
+
import { Scan } from "../resources/scan/client/Client.mjs";
|
|
19
20
|
export class TaskArtifacts {
|
|
20
21
|
constructor(_options = {}) {
|
|
21
22
|
this._options = _options;
|
|
@@ -24,6 +25,10 @@ export class TaskArtifacts {
|
|
|
24
25
|
var _a;
|
|
25
26
|
return ((_a = this._s3Object) !== null && _a !== void 0 ? _a : (this._s3Object = new S3Object(this._options)));
|
|
26
27
|
}
|
|
28
|
+
get scan() {
|
|
29
|
+
var _a;
|
|
30
|
+
return ((_a = this._scan) !== null && _a !== void 0 ? _a : (this._scan = new Scan(this._options)));
|
|
31
|
+
}
|
|
27
32
|
/**
|
|
28
33
|
* Adds a new task artifact to a task. | authz_personas=[driver_for_executor, executor_org_operators, coordinator_org_operators] | (AddTaskArtifactReq) -> (PydanticObjectId)
|
|
29
34
|
*
|
package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.d.mts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../../../environments.mjs";
|
|
5
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
6
|
+
import * as Chrt from "../../../../../../../index.mjs";
|
|
7
|
+
export declare namespace Scan {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
|
+
fetcher?: core.FetchFunction;
|
|
16
|
+
}
|
|
17
|
+
interface RequestOptions {
|
|
18
|
+
/** The maximum time to wait for a response in seconds. */
|
|
19
|
+
timeoutInSeconds?: number;
|
|
20
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
21
|
+
maxRetries?: number;
|
|
22
|
+
/** A hook to abort the request. */
|
|
23
|
+
abortSignal?: AbortSignal;
|
|
24
|
+
/** Additional query string parameters to include in the request. */
|
|
25
|
+
queryParams?: Record<string, unknown>;
|
|
26
|
+
/** Additional headers to include in the request. */
|
|
27
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export declare class Scan {
|
|
31
|
+
protected readonly _options: Scan.Options;
|
|
32
|
+
constructor(_options?: Scan.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Appends a barcode/QR scan payload to a SCAN-type task artifact's expected or observed array (deduplicated). | authz_personas=[driver_for_executor, coordinator_org_operators, executor_org_operators, shipper_org_operators] | (AddScanPayloadReq) -> (bool)
|
|
35
|
+
*
|
|
36
|
+
* @param {string} taskArtifactId
|
|
37
|
+
* @param {Chrt.shipping.taskArtifacts.AddScanPayloadReq} request
|
|
38
|
+
* @param {Scan.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.shipping.taskArtifacts.scan.addV1("task_artifact_id", {
|
|
44
|
+
* kind: "expected",
|
|
45
|
+
* payload: "payload"
|
|
46
|
+
* })
|
|
47
|
+
*/
|
|
48
|
+
addV1(taskArtifactId: string, request: Chrt.shipping.taskArtifacts.AddScanPayloadReq, requestOptions?: Scan.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
49
|
+
private __addV1;
|
|
50
|
+
/**
|
|
51
|
+
* Removes a barcode/QR scan payload (by value) from a SCAN-type task artifact's expected or observed array. | authz_personas=[driver_for_executor, coordinator_org_operators, executor_org_operators, shipper_org_operators] | () -> (bool)
|
|
52
|
+
*
|
|
53
|
+
* @param {string} taskArtifactId
|
|
54
|
+
* @param {Chrt.shipping.taskArtifacts.ScanDeleteV1Request} request
|
|
55
|
+
* @param {Scan.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
+
*
|
|
57
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await client.shipping.taskArtifacts.scan.deleteV1("task_artifact_id", {
|
|
61
|
+
* kind: "expected",
|
|
62
|
+
* payload: "payload"
|
|
63
|
+
* })
|
|
64
|
+
*/
|
|
65
|
+
deleteV1(taskArtifactId: string, request: Chrt.shipping.taskArtifacts.ScanDeleteV1Request, requestOptions?: Scan.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
66
|
+
private __deleteV1;
|
|
67
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
68
|
+
}
|