@chrt-inc/typescript-sdk 1.710.0 → 1.719.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 (80) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/operations/resources/departments/client/Client.d.ts +1 -1
  3. package/dist/cjs/api/resources/operations/resources/departments/client/Client.js +6 -6
  4. package/dist/cjs/api/resources/operations/resources/departments/client/requests/DepartmentClientCreate1.d.ts +2 -2
  5. package/dist/cjs/api/resources/operations/resources/departments/client/requests/DepartmentsListV1Request.d.ts +2 -2
  6. package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskArtifact/client/requests/OrderDraftAddTaskArtifactReq.d.ts +1 -0
  7. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/client/Client.d.ts +3 -0
  8. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/client/Client.js +5 -0
  9. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/index.d.ts +2 -0
  10. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/index.js +3 -1
  11. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.d.ts +68 -0
  12. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.js +201 -0
  13. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.d.ts +2 -0
  14. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.js +17 -0
  15. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.d.ts +15 -0
  16. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.js +5 -0
  17. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.d.ts +15 -0
  18. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.js +5 -0
  19. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.d.ts +2 -0
  20. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.js +2 -0
  21. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/index.d.ts +1 -0
  22. package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/scan/index.js +17 -0
  23. package/dist/cjs/api/types/Department1.d.ts +1 -1
  24. package/dist/cjs/api/types/DepartmentSortByEnum.d.ts +2 -2
  25. package/dist/cjs/api/types/DepartmentSortByEnum.js +1 -1
  26. package/dist/cjs/api/types/{DepartmentEnum.d.ts → DepartmentTypeEnum.d.ts} +7 -2
  27. package/dist/cjs/api/types/{DepartmentEnum.js → DepartmentTypeEnum.js} +7 -2
  28. package/dist/cjs/api/types/DeviceLimitedForList1.d.ts +2 -0
  29. package/dist/cjs/api/types/Driver1.d.ts +2 -0
  30. package/dist/cjs/api/types/ScanPayloadKindEnum.d.ts +8 -0
  31. package/dist/cjs/api/types/ScanPayloadKindEnum.js +10 -0
  32. package/dist/cjs/api/types/TaskArtifact1.d.ts +2 -0
  33. package/dist/cjs/api/types/TaskArtifactClientCreate1.d.ts +1 -0
  34. package/dist/cjs/api/types/TaskArtifactTypeEnum1.d.ts +2 -1
  35. package/dist/cjs/api/types/TaskArtifactTypeEnum1.js +1 -0
  36. package/dist/cjs/api/types/index.d.ts +2 -1
  37. package/dist/cjs/api/types/index.js +2 -1
  38. package/dist/cjs/version.d.ts +1 -1
  39. package/dist/cjs/version.js +1 -1
  40. package/dist/esm/Client.mjs +2 -2
  41. package/dist/esm/api/resources/operations/resources/departments/client/Client.d.mts +1 -1
  42. package/dist/esm/api/resources/operations/resources/departments/client/Client.mjs +6 -6
  43. package/dist/esm/api/resources/operations/resources/departments/client/requests/DepartmentClientCreate1.d.mts +2 -2
  44. package/dist/esm/api/resources/operations/resources/departments/client/requests/DepartmentsListV1Request.d.mts +2 -2
  45. package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskArtifact/client/requests/OrderDraftAddTaskArtifactReq.d.mts +1 -0
  46. package/dist/esm/api/resources/shipping/resources/taskArtifacts/client/Client.d.mts +3 -0
  47. package/dist/esm/api/resources/shipping/resources/taskArtifacts/client/Client.mjs +5 -0
  48. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/index.d.mts +2 -0
  49. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/index.mjs +2 -0
  50. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.d.mts +68 -0
  51. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/Client.mjs +164 -0
  52. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.d.mts +2 -0
  53. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/index.mjs +1 -0
  54. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.d.mts +15 -0
  55. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/AddScanPayloadReq.mjs +4 -0
  56. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.d.mts +15 -0
  57. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/ScanDeleteV1Request.mjs +4 -0
  58. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.d.mts +2 -0
  59. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/client/requests/index.mjs +1 -0
  60. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/index.d.mts +1 -0
  61. package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/scan/index.mjs +1 -0
  62. package/dist/esm/api/types/Department1.d.mts +1 -1
  63. package/dist/esm/api/types/DepartmentSortByEnum.d.mts +2 -2
  64. package/dist/esm/api/types/DepartmentSortByEnum.mjs +1 -1
  65. package/dist/esm/api/types/{DepartmentEnum.d.mts → DepartmentTypeEnum.d.mts} +7 -2
  66. package/dist/esm/api/types/{DepartmentEnum.mjs → DepartmentTypeEnum.mjs} +6 -1
  67. package/dist/esm/api/types/DeviceLimitedForList1.d.mts +2 -0
  68. package/dist/esm/api/types/Driver1.d.mts +2 -0
  69. package/dist/esm/api/types/ScanPayloadKindEnum.d.mts +8 -0
  70. package/dist/esm/api/types/ScanPayloadKindEnum.mjs +7 -0
  71. package/dist/esm/api/types/TaskArtifact1.d.mts +2 -0
  72. package/dist/esm/api/types/TaskArtifactClientCreate1.d.mts +1 -0
  73. package/dist/esm/api/types/TaskArtifactTypeEnum1.d.mts +2 -1
  74. package/dist/esm/api/types/TaskArtifactTypeEnum1.mjs +1 -0
  75. package/dist/esm/api/types/index.d.mts +2 -1
  76. package/dist/esm/api/types/index.mjs +2 -1
  77. package/dist/esm/version.d.mts +1 -1
  78. package/dist/esm/version.mjs +1 -1
  79. package/package.json +1 -1
  80. package/reference.md +151 -1
@@ -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
  };
@@ -119,9 +119,9 @@ export * from "./CreateStripeConnectAccountRes.js";
119
119
  export * from "./CredentialInfoRes.js";
120
120
  export * from "./DateTimeWindow1.js";
121
121
  export * from "./Department1.js";
122
- export * from "./DepartmentEnum.js";
123
122
  export * from "./DepartmentListRes.js";
124
123
  export * from "./DepartmentSortByEnum.js";
124
+ export * from "./DepartmentTypeEnum.js";
125
125
  export * from "./DeviceExpandedRes.js";
126
126
  export * from "./DeviceLimitedForList1.js";
127
127
  export * from "./DeviceListRes.js";
@@ -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";
@@ -135,9 +135,9 @@ __exportStar(require("./CreateStripeConnectAccountRes.js"), exports);
135
135
  __exportStar(require("./CredentialInfoRes.js"), exports);
136
136
  __exportStar(require("./DateTimeWindow1.js"), exports);
137
137
  __exportStar(require("./Department1.js"), exports);
138
- __exportStar(require("./DepartmentEnum.js"), exports);
139
138
  __exportStar(require("./DepartmentListRes.js"), exports);
140
139
  __exportStar(require("./DepartmentSortByEnum.js"), exports);
140
+ __exportStar(require("./DepartmentTypeEnum.js"), exports);
141
141
  __exportStar(require("./DeviceExpandedRes.js"), exports);
142
142
  __exportStar(require("./DeviceLimitedForList1.js"), exports);
143
143
  __exportStar(require("./DeviceListRes.js"), exports);
@@ -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.719.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.719.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.719.0",
24
+ "User-Agent": "@chrt-inc/typescript-sdk/1.719.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) });
@@ -100,7 +100,7 @@ export declare class Departments {
100
100
  * await client.operations.departments.createV1({
101
101
  * schema_version: 1,
102
102
  * name: "name",
103
- * department: "automotive"
103
+ * department_type: "automotive"
104
104
  * })
105
105
  */
106
106
  createV1(request: Chrt.operations.DepartmentClientCreate1, requestOptions?: Departments.RequestOptions): core.HttpResponsePromise<string>;
@@ -41,7 +41,7 @@ export class Departments {
41
41
  __listV1() {
42
42
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
43
43
  var _a, _b, _c, _d, _e, _f;
44
- const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_department: filterDepartment, } = request;
44
+ const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, filter_department_type: filterDepartmentType, } = request;
45
45
  const _queryParams = {};
46
46
  if (sortBy !== undefined) {
47
47
  _queryParams["sort_by"] = sortBy;
@@ -55,12 +55,12 @@ export class Departments {
55
55
  if (pageSize !== undefined) {
56
56
  _queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
57
57
  }
58
- if (filterDepartment !== undefined) {
59
- if (Array.isArray(filterDepartment)) {
60
- _queryParams["filter_department"] = filterDepartment.map((item) => item);
58
+ if (filterDepartmentType !== undefined) {
59
+ if (Array.isArray(filterDepartmentType)) {
60
+ _queryParams["filter_department_type"] = filterDepartmentType.map((item) => item);
61
61
  }
62
62
  else {
63
- _queryParams["filter_department"] = filterDepartment;
63
+ _queryParams["filter_department_type"] = filterDepartmentType;
64
64
  }
65
65
  }
66
66
  let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -298,7 +298,7 @@ export class Departments {
298
298
  * await client.operations.departments.createV1({
299
299
  * schema_version: 1,
300
300
  * name: "name",
301
- * department: "automotive"
301
+ * department_type: "automotive"
302
302
  * })
303
303
  */
304
304
  createV1(request, requestOptions) {
@@ -7,13 +7,13 @@ import * as Chrt from "../../../../../../index.mjs";
7
7
  * {
8
8
  * schema_version: 1,
9
9
  * name: "name",
10
- * department: "automotive"
10
+ * department_type: "automotive"
11
11
  * }
12
12
  */
13
13
  export interface DepartmentClientCreate1 {
14
14
  schema_version: number;
15
15
  name: string;
16
- department: Chrt.DepartmentEnum;
16
+ department_type: Chrt.DepartmentTypeEnum;
17
17
  location?: Chrt.LocationFeature | null;
18
18
  operator_user_ids?: string[];
19
19
  }
@@ -18,6 +18,6 @@ export interface DepartmentsListV1Request {
18
18
  sort_order?: Chrt.SortOrderEnum | null;
19
19
  page?: number | null;
20
20
  page_size?: number | null;
21
- /** Filter by department(s) */
22
- filter_department?: (Chrt.DepartmentEnum | null) | (Chrt.DepartmentEnum | null)[];
21
+ /** Filter by department type(s) */
22
+ filter_department_type?: (Chrt.DepartmentTypeEnum | null) | (Chrt.DepartmentTypeEnum | null)[];
23
23
  }
@@ -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";
@@ -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
+ }
@@ -0,0 +1,164 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ import * as environments from "../../../../../../../../environments.mjs";
14
+ import * as core from "../../../../../../../../core/index.mjs";
15
+ import * as Chrt from "../../../../../../../index.mjs";
16
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.mjs";
17
+ import * as errors from "../../../../../../../../errors/index.mjs";
18
+ export class Scan {
19
+ constructor(_options = {}) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * 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)
24
+ *
25
+ * @param {string} taskArtifactId
26
+ * @param {Chrt.shipping.taskArtifacts.AddScanPayloadReq} request
27
+ * @param {Scan.RequestOptions} requestOptions - Request-specific configuration.
28
+ *
29
+ * @throws {@link Chrt.UnprocessableEntityError}
30
+ *
31
+ * @example
32
+ * await client.shipping.taskArtifacts.scan.addV1("task_artifact_id", {
33
+ * kind: "expected",
34
+ * payload: "payload"
35
+ * })
36
+ */
37
+ addV1(taskArtifactId, request, requestOptions) {
38
+ return core.HttpResponsePromise.fromPromise(this.__addV1(taskArtifactId, request, requestOptions));
39
+ }
40
+ __addV1(taskArtifactId, request, requestOptions) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ var _a, _b, _c, _d;
43
+ 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);
44
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
45
+ 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)}`),
46
+ method: "POST",
47
+ headers: _headers,
48
+ contentType: "application/json",
49
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
50
+ requestType: "json",
51
+ body: request,
52
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
53
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
54
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
55
+ });
56
+ if (_response.ok) {
57
+ return { data: _response.body, rawResponse: _response.rawResponse };
58
+ }
59
+ if (_response.error.reason === "status-code") {
60
+ switch (_response.error.statusCode) {
61
+ case 422:
62
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
63
+ default:
64
+ throw new errors.ChrtError({
65
+ statusCode: _response.error.statusCode,
66
+ body: _response.error.body,
67
+ rawResponse: _response.rawResponse,
68
+ });
69
+ }
70
+ }
71
+ switch (_response.error.reason) {
72
+ case "non-json":
73
+ throw new errors.ChrtError({
74
+ statusCode: _response.error.statusCode,
75
+ body: _response.error.rawBody,
76
+ rawResponse: _response.rawResponse,
77
+ });
78
+ case "timeout":
79
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/task_artifacts/scan/add/v1/{task_artifact_id}.");
80
+ case "unknown":
81
+ throw new errors.ChrtError({
82
+ message: _response.error.errorMessage,
83
+ rawResponse: _response.rawResponse,
84
+ });
85
+ }
86
+ });
87
+ }
88
+ /**
89
+ * 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)
90
+ *
91
+ * @param {string} taskArtifactId
92
+ * @param {Chrt.shipping.taskArtifacts.ScanDeleteV1Request} request
93
+ * @param {Scan.RequestOptions} requestOptions - Request-specific configuration.
94
+ *
95
+ * @throws {@link Chrt.UnprocessableEntityError}
96
+ *
97
+ * @example
98
+ * await client.shipping.taskArtifacts.scan.deleteV1("task_artifact_id", {
99
+ * kind: "expected",
100
+ * payload: "payload"
101
+ * })
102
+ */
103
+ deleteV1(taskArtifactId, request, requestOptions) {
104
+ return core.HttpResponsePromise.fromPromise(this.__deleteV1(taskArtifactId, request, requestOptions));
105
+ }
106
+ __deleteV1(taskArtifactId, request, requestOptions) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ var _a, _b, _c, _d;
109
+ const { kind, payload } = request;
110
+ const _queryParams = {};
111
+ _queryParams["kind"] = kind;
112
+ _queryParams["payload"] = payload;
113
+ 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);
114
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
115
+ 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)}`),
116
+ method: "DELETE",
117
+ headers: _headers,
118
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
119
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
120
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
121
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
122
+ });
123
+ if (_response.ok) {
124
+ return { data: _response.body, rawResponse: _response.rawResponse };
125
+ }
126
+ if (_response.error.reason === "status-code") {
127
+ switch (_response.error.statusCode) {
128
+ case 422:
129
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
130
+ default:
131
+ throw new errors.ChrtError({
132
+ statusCode: _response.error.statusCode,
133
+ body: _response.error.body,
134
+ rawResponse: _response.rawResponse,
135
+ });
136
+ }
137
+ }
138
+ switch (_response.error.reason) {
139
+ case "non-json":
140
+ throw new errors.ChrtError({
141
+ statusCode: _response.error.statusCode,
142
+ body: _response.error.rawBody,
143
+ rawResponse: _response.rawResponse,
144
+ });
145
+ case "timeout":
146
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /shipping/task_artifacts/scan/delete/v1/{task_artifact_id}.");
147
+ case "unknown":
148
+ throw new errors.ChrtError({
149
+ message: _response.error.errorMessage,
150
+ rawResponse: _response.rawResponse,
151
+ });
152
+ }
153
+ });
154
+ }
155
+ _getAuthorizationHeader() {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ const bearer = yield core.Supplier.get(this._options.token);
158
+ if (bearer != null) {
159
+ return `Bearer ${bearer}`;
160
+ }
161
+ return undefined;
162
+ });
163
+ }
164
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../../../index.mjs";
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,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../../../index.mjs";
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,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,2 @@
1
+ export { type AddScanPayloadReq } from "./AddScanPayloadReq.mjs";
2
+ export { type ScanDeleteV1Request } from "./ScanDeleteV1Request.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -5,7 +5,7 @@ import * as Chrt from "../index.mjs";
5
5
  export interface Department1 {
6
6
  schema_version: number;
7
7
  name: string;
8
- department: Chrt.DepartmentEnum;
8
+ department_type: Chrt.DepartmentTypeEnum;
9
9
  location?: Chrt.LocationFeature | null;
10
10
  operator_user_ids?: string[];
11
11
  _id: string;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type DepartmentSortByEnum = "created_at" | "department";
4
+ export type DepartmentSortByEnum = "created_at" | "department_type";
5
5
  export declare const DepartmentSortByEnum: {
6
6
  readonly CreatedAt: "created_at";
7
- readonly Department: "department";
7
+ readonly DepartmentType: "department_type";
8
8
  };
@@ -3,5 +3,5 @@
3
3
  */
4
4
  export const DepartmentSortByEnum = {
5
5
  CreatedAt: "created_at",
6
- Department: "department",
6
+ DepartmentType: "department_type",
7
7
  };
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type DepartmentEnum = "automotive" | "semiconductor" | "pharmaceutical" | "aerospace" | "agriculture" | "retail" | "manufacturing" | "energy" | "food_and_beverage" | "chemicals" | "electronics" | "general";
5
- export declare const DepartmentEnum: {
4
+ export type DepartmentTypeEnum = "automotive" | "semiconductor" | "pharmaceutical" | "aerospace" | "agriculture" | "retail" | "manufacturing" | "energy" | "food_and_beverage" | "chemicals" | "electronics" | "healthcare" | "industrials" | "live_animals" | "life_sciences" | "radiopharma" | "general";
5
+ export declare const DepartmentTypeEnum: {
6
6
  readonly Automotive: "automotive";
7
7
  readonly Semiconductor: "semiconductor";
8
8
  readonly Pharmaceutical: "pharmaceutical";
@@ -14,5 +14,10 @@ export declare const DepartmentEnum: {
14
14
  readonly FoodAndBeverage: "food_and_beverage";
15
15
  readonly Chemicals: "chemicals";
16
16
  readonly Electronics: "electronics";
17
+ readonly Healthcare: "healthcare";
18
+ readonly Industrials: "industrials";
19
+ readonly LiveAnimals: "live_animals";
20
+ readonly LifeSciences: "life_sciences";
21
+ readonly Radiopharma: "radiopharma";
17
22
  readonly General: "general";
18
23
  };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export const DepartmentEnum = {
4
+ export const DepartmentTypeEnum = {
5
5
  Automotive: "automotive",
6
6
  Semiconductor: "semiconductor",
7
7
  Pharmaceutical: "pharmaceutical",
@@ -13,5 +13,10 @@ export const DepartmentEnum = {
13
13
  FoodAndBeverage: "food_and_beverage",
14
14
  Chemicals: "chemicals",
15
15
  Electronics: "electronics",
16
+ Healthcare: "healthcare",
17
+ Industrials: "industrials",
18
+ LiveAnimals: "live_animals",
19
+ LifeSciences: "life_sciences",
20
+ Radiopharma: "radiopharma",
16
21
  General: "general",
17
22
  };
@@ -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
  }