@chrt-inc/typescript-sdk 1.710.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.
Files changed (62) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskArtifact/client/requests/OrderDraftAddTaskArtifactReq.d.ts +1 -0
  3. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/client/Client.d.ts +3 -0
  4. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/client/Client.js +5 -0
  5. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/index.d.ts +2 -0
  6. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/index.js +3 -1
  7. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.d.ts +68 -0
  8. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.js +201 -0
  9. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.d.ts +2 -0
  10. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.js +17 -0
  11. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.d.ts +15 -0
  12. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.js +5 -0
  13. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.d.ts +15 -0
  14. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.js +5 -0
  15. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.js +2 -0
  17. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/index.js +17 -0
  19. package/dist/cjs/api/types/DeviceLimitedForList1.d.ts +2 -0
  20. package/dist/cjs/api/types/Driver1.d.ts +2 -0
  21. package/dist/cjs/api/types/ScanPayloadKindEnum.d.ts +8 -0
  22. package/dist/cjs/api/types/ScanPayloadKindEnum.js +10 -0
  23. package/dist/cjs/api/types/TaskArtifact1.d.ts +2 -0
  24. package/dist/cjs/api/types/TaskArtifactClientCreate1.d.ts +1 -0
  25. package/dist/cjs/api/types/TaskArtifactTypeEnum1.d.ts +2 -1
  26. package/dist/cjs/api/types/TaskArtifactTypeEnum1.js +1 -0
  27. package/dist/cjs/api/types/index.d.ts +1 -0
  28. package/dist/cjs/api/types/index.js +1 -0
  29. package/dist/cjs/version.d.ts +1 -1
  30. package/dist/cjs/version.js +1 -1
  31. package/dist/esm/Client.mjs +2 -2
  32. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskArtifact/client/requests/OrderDraftAddTaskArtifactReq.d.mts +1 -0
  33. package/dist/esm/api/resources/shipping/resources/taskArtifacts/client/Client.d.mts +3 -0
  34. package/dist/esm/api/resources/shipping/resources/taskArtifacts/client/Client.mjs +5 -0
  35. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/index.d.mts +2 -0
  36. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/index.mjs +2 -0
  37. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.d.mts +68 -0
  38. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.mjs +164 -0
  39. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.d.mts +2 -0
  40. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.mjs +1 -0
  41. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.d.mts +15 -0
  42. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.mjs +4 -0
  43. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.d.mts +15 -0
  44. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.mjs +4 -0
  45. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.d.mts +2 -0
  46. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.mjs +1 -0
  47. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/index.d.mts +1 -0
  48. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/index.mjs +1 -0
  49. package/dist/esm/api/types/DeviceLimitedForList1.d.mts +2 -0
  50. package/dist/esm/api/types/Driver1.d.mts +2 -0
  51. package/dist/esm/api/types/ScanPayloadKindEnum.d.mts +8 -0
  52. package/dist/esm/api/types/ScanPayloadKindEnum.mjs +7 -0
  53. package/dist/esm/api/types/TaskArtifact1.d.mts +2 -0
  54. package/dist/esm/api/types/TaskArtifactClientCreate1.d.mts +1 -0
  55. package/dist/esm/api/types/TaskArtifactTypeEnum1.d.mts +2 -1
  56. package/dist/esm/api/types/TaskArtifactTypeEnum1.mjs +1 -0
  57. package/dist/esm/api/types/index.d.mts +1 -0
  58. package/dist/esm/api/types/index.mjs +1 -0
  59. package/dist/esm/version.d.mts +1 -1
  60. package/dist/esm/version.mjs +1 -1
  61. package/package.json +1 -1
  62. package/reference.md +150 -0
@@ -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.710.0",
60
- "User-Agent": "@chrt-inc/typescript-sdk/1.710.0",
59
+ "X-Fern-SDK-Version": "1.718.0",
60
+ "User-Agent": "@chrt-inc/typescript-sdk/1.718.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) });
@@ -12,5 +12,6 @@ import * as Chrt from "../../../../../../../../index.js";
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.js";
5
5
  import * as core from "../../../../../../core/index.js";
6
6
  import * as Chrt from "../../../../../index.js";
7
7
  import { S3Object } from "../resources/s3Object/client/Client.js";
8
+ import { Scan } from "../resources/scan/client/Client.js";
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
  *
@@ -52,6 +52,7 @@ const Chrt = __importStar(require("../../../../../index.js"));
52
52
  const headers_js_1 = require("../../../../../../core/headers.js");
53
53
  const errors = __importStar(require("../../../../../../errors/index.js"));
54
54
  const Client_js_1 = require("../resources/s3Object/client/Client.js");
55
+ const Client_js_2 = require("../resources/scan/client/Client.js");
55
56
  class TaskArtifacts {
56
57
  constructor(_options = {}) {
57
58
  this._options = _options;
@@ -60,6 +61,10 @@ class TaskArtifacts {
60
61
  var _a;
61
62
  return ((_a = this._s3Object) !== null && _a !== void 0 ? _a : (this._s3Object = new Client_js_1.S3Object(this._options)));
62
63
  }
64
+ get scan() {
65
+ var _a;
66
+ return ((_a = this._scan) !== null && _a !== void 0 ? _a : (this._scan = new Client_js_2.Scan(this._options)));
67
+ }
63
68
  /**
64
69
  * Adds a new task artifact to a task. | authz_personas=[driver_for_executor, executor_org_operators, coordinator_org_operators] | (AddTaskArtifactReq) -> (PydanticObjectId)
65
70
  *
@@ -1,2 +1,4 @@
1
1
  export * as s3Object from "./s3Object/index.js";
2
+ export * as scan from "./scan/index.js";
2
3
  export * from "./s3Object/client/requests/index.js";
4
+ export * from "./scan/client/requests/index.js";
@@ -36,6 +36,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.s3Object = void 0;
39
+ exports.scan = exports.s3Object = void 0;
40
40
  exports.s3Object = __importStar(require("./s3Object/index.js"));
41
+ exports.scan = __importStar(require("./scan/index.js"));
41
42
  __exportStar(require("./s3Object/client/requests/index.js"), exports);
43
+ __exportStar(require("./scan/client/requests/index.js"), exports);
@@ -0,0 +1,68 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../../../environments.js";
5
+ import * as core from "../../../../../../../../core/index.js";
6
+ import * as Chrt from "../../../../../../../index.js";
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
+ }
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.Scan = void 0;
49
+ const environments = __importStar(require("../../../../../../../../environments.js"));
50
+ const core = __importStar(require("../../../../../../../../core/index.js"));
51
+ const Chrt = __importStar(require("../../../../../../../index.js"));
52
+ const headers_js_1 = require("../../../../../../../../core/headers.js");
53
+ const errors = __importStar(require("../../../../../../../../errors/index.js"));
54
+ class Scan {
55
+ constructor(_options = {}) {
56
+ this._options = _options;
57
+ }
58
+ /**
59
+ * 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)
60
+ *
61
+ * @param {string} taskArtifactId
62
+ * @param {Chrt.shipping.taskArtifacts.AddScanPayloadReq} request
63
+ * @param {Scan.RequestOptions} requestOptions - Request-specific configuration.
64
+ *
65
+ * @throws {@link Chrt.UnprocessableEntityError}
66
+ *
67
+ * @example
68
+ * await client.shipping.taskArtifacts.scan.addV1("task_artifact_id", {
69
+ * kind: "expected",
70
+ * payload: "payload"
71
+ * })
72
+ */
73
+ addV1(taskArtifactId, request, requestOptions) {
74
+ return core.HttpResponsePromise.fromPromise(this.__addV1(taskArtifactId, request, requestOptions));
75
+ }
76
+ __addV1(taskArtifactId, request, requestOptions) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ var _a, _b, _c, _d;
79
+ 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);
80
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
81
+ 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/task_artifacts/scan/add/v1/${encodeURIComponent(taskArtifactId)}`),
82
+ method: "POST",
83
+ headers: _headers,
84
+ contentType: "application/json",
85
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
86
+ requestType: "json",
87
+ body: request,
88
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
89
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
90
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
91
+ });
92
+ if (_response.ok) {
93
+ return { data: _response.body, rawResponse: _response.rawResponse };
94
+ }
95
+ if (_response.error.reason === "status-code") {
96
+ switch (_response.error.statusCode) {
97
+ case 422:
98
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
99
+ default:
100
+ throw new errors.ChrtError({
101
+ statusCode: _response.error.statusCode,
102
+ body: _response.error.body,
103
+ rawResponse: _response.rawResponse,
104
+ });
105
+ }
106
+ }
107
+ switch (_response.error.reason) {
108
+ case "non-json":
109
+ throw new errors.ChrtError({
110
+ statusCode: _response.error.statusCode,
111
+ body: _response.error.rawBody,
112
+ rawResponse: _response.rawResponse,
113
+ });
114
+ case "timeout":
115
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/task_artifacts/scan/add/v1/{task_artifact_id}.");
116
+ case "unknown":
117
+ throw new errors.ChrtError({
118
+ message: _response.error.errorMessage,
119
+ rawResponse: _response.rawResponse,
120
+ });
121
+ }
122
+ });
123
+ }
124
+ /**
125
+ * 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)
126
+ *
127
+ * @param {string} taskArtifactId
128
+ * @param {Chrt.shipping.taskArtifacts.ScanDeleteV1Request} request
129
+ * @param {Scan.RequestOptions} requestOptions - Request-specific configuration.
130
+ *
131
+ * @throws {@link Chrt.UnprocessableEntityError}
132
+ *
133
+ * @example
134
+ * await client.shipping.taskArtifacts.scan.deleteV1("task_artifact_id", {
135
+ * kind: "expected",
136
+ * payload: "payload"
137
+ * })
138
+ */
139
+ deleteV1(taskArtifactId, request, requestOptions) {
140
+ return core.HttpResponsePromise.fromPromise(this.__deleteV1(taskArtifactId, request, requestOptions));
141
+ }
142
+ __deleteV1(taskArtifactId, request, requestOptions) {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ var _a, _b, _c, _d;
145
+ const { kind, payload } = request;
146
+ const _queryParams = {};
147
+ _queryParams["kind"] = kind;
148
+ _queryParams["payload"] = payload;
149
+ 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);
150
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
151
+ 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/task_artifacts/scan/delete/v1/${encodeURIComponent(taskArtifactId)}`),
152
+ method: "DELETE",
153
+ headers: _headers,
154
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
155
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
156
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
157
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
158
+ });
159
+ if (_response.ok) {
160
+ return { data: _response.body, rawResponse: _response.rawResponse };
161
+ }
162
+ if (_response.error.reason === "status-code") {
163
+ switch (_response.error.statusCode) {
164
+ case 422:
165
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
166
+ default:
167
+ throw new errors.ChrtError({
168
+ statusCode: _response.error.statusCode,
169
+ body: _response.error.body,
170
+ rawResponse: _response.rawResponse,
171
+ });
172
+ }
173
+ }
174
+ switch (_response.error.reason) {
175
+ case "non-json":
176
+ throw new errors.ChrtError({
177
+ statusCode: _response.error.statusCode,
178
+ body: _response.error.rawBody,
179
+ rawResponse: _response.rawResponse,
180
+ });
181
+ case "timeout":
182
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /shipping/task_artifacts/scan/delete/v1/{task_artifact_id}.");
183
+ case "unknown":
184
+ throw new errors.ChrtError({
185
+ message: _response.error.errorMessage,
186
+ rawResponse: _response.rawResponse,
187
+ });
188
+ }
189
+ });
190
+ }
191
+ _getAuthorizationHeader() {
192
+ return __awaiter(this, void 0, void 0, function* () {
193
+ const bearer = yield core.Supplier.get(this._options.token);
194
+ if (bearer != null) {
195
+ return `Bearer ${bearer}`;
196
+ }
197
+ return undefined;
198
+ });
199
+ }
200
+ }
201
+ exports.Scan = Scan;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/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("./requests/index.js"), exports);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * kind: "expected",
9
+ * payload: "payload"
10
+ * }
11
+ */
12
+ export interface AddScanPayloadReq {
13
+ kind: Chrt.ScanPayloadKindEnum;
14
+ payload: string;
15
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * kind: "expected",
9
+ * payload: "payload"
10
+ * }
11
+ */
12
+ export interface ScanDeleteV1Request {
13
+ kind: Chrt.ScanPayloadKindEnum;
14
+ payload: string;
15
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { type AddScanPayloadReq } from "./AddScanPayloadReq.js";
2
+ export { type ScanDeleteV1Request } from "./ScanDeleteV1Request.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type ScanPayloadKindEnum = "expected" | "observed";
5
+ export declare const ScanPayloadKindEnum: {
6
+ readonly Expected: "expected";
7
+ readonly Observed: "observed";
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.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;
@@ -5,4 +5,5 @@ import * as Chrt from "../index.js";
5
5
  export interface TaskArtifactClientCreate1 {
6
6
  schema_version: number;
7
7
  type: Chrt.TaskArtifactTypeEnum1;
8
+ expected_scan_payloads?: string[];
8
9
  }
@@ -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
  };
@@ -7,5 +7,6 @@ exports.TaskArtifactTypeEnum1 = void 0;
7
7
  exports.TaskArtifactTypeEnum1 = {
8
8
  Image: "image",
9
9
  Signature: "signature",
10
+ Scan: "scan",
10
11
  Other: "other",
11
12
  };
@@ -274,6 +274,7 @@ export * from "./ProviderOrgProfile1.js";
274
274
  export * from "./ProviderProviderConnection1.js";
275
275
  export * from "./RateSheetMapping1.js";
276
276
  export * from "./RateSheetMappingListRes.js";
277
+ export * from "./ScanPayloadKindEnum.js";
277
278
  export * from "./ScheduleCalendarSpec.js";
278
279
  export * from "./ScheduleIntervalSpec.js";
279
280
  export * from "./ScheduleRange.js";
@@ -290,6 +290,7 @@ __exportStar(require("./ProviderOrgProfile1.js"), exports);
290
290
  __exportStar(require("./ProviderProviderConnection1.js"), exports);
291
291
  __exportStar(require("./RateSheetMapping1.js"), exports);
292
292
  __exportStar(require("./RateSheetMappingListRes.js"), exports);
293
+ __exportStar(require("./ScanPayloadKindEnum.js"), exports);
293
294
  __exportStar(require("./ScheduleCalendarSpec.js"), exports);
294
295
  __exportStar(require("./ScheduleIntervalSpec.js"), exports);
295
296
  __exportStar(require("./ScheduleRange.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.710.0";
1
+ export declare const SDK_VERSION = "1.718.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.710.0";
4
+ exports.SDK_VERSION = "1.718.0";
@@ -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.710.0",
24
- "User-Agent": "@chrt-inc/typescript-sdk/1.710.0",
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) });
@@ -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
  *
@@ -1,2 +1,4 @@
1
1
  export * as s3Object from "./s3Object/index.mjs";
2
+ export * as scan from "./scan/index.mjs";
2
3
  export * from "./s3Object/client/requests/index.mjs";
4
+ export * from "./scan/client/requests/index.mjs";
@@ -1,2 +1,4 @@
1
1
  export * as s3Object from "./s3Object/index.mjs";
2
+ export * as scan from "./scan/index.mjs";
2
3
  export * from "./s3Object/client/requests/index.mjs";
4
+ export * from "./scan/client/requests/index.mjs";