@chrt-inc/typescript-sdk 1.321.0 → 1.322.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 (78) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/taskArtifacts/client/Client.d.ts +0 -3
  3. package/dist/cjs/api/resources/taskArtifacts/client/Client.js +2 -7
  4. package/dist/cjs/api/resources/taskArtifacts/resources/index.d.ts +1 -1
  5. package/dist/cjs/api/resources/taskArtifacts/resources/index.js +5 -2
  6. package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/Client.d.ts +44 -0
  7. package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/Client.js +187 -0
  8. package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/index.js +15 -0
  10. package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.d.ts +13 -0
  11. package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/requests/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/taskGroups/client/Client.d.ts +0 -33
  13. package/dist/cjs/api/resources/taskGroups/client/Client.js +4 -137
  14. package/dist/cjs/api/resources/taskGroups/client/requests/index.d.ts +0 -1
  15. package/dist/cjs/api/resources/taskGroups/resources/index.d.ts +1 -1
  16. package/dist/cjs/api/resources/taskGroups/resources/index.js +2 -2
  17. package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/Client.d.ts +44 -0
  18. package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/Client.js +187 -0
  19. package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/index.js +15 -0
  21. package/dist/cjs/api/resources/taskGroups/{client/requests/BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost.d.ts → resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.d.ts} +2 -2
  22. package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.js +5 -0
  23. package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/requests/index.d.ts +1 -0
  24. package/dist/cjs/version.d.ts +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/esm/Client.mjs +2 -2
  27. package/dist/esm/api/resources/taskArtifacts/client/Client.d.mts +0 -3
  28. package/dist/esm/api/resources/taskArtifacts/client/Client.mjs +0 -5
  29. package/dist/esm/api/resources/taskArtifacts/resources/index.d.mts +1 -1
  30. package/dist/esm/api/resources/taskArtifacts/resources/index.mjs +1 -1
  31. package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/Client.d.mts +44 -0
  32. package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/Client.mjs +187 -0
  33. package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/index.d.mts +1 -0
  34. package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/index.mjs +1 -1
  35. package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.d.mts +13 -0
  36. package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/requests/index.d.mts +1 -0
  37. package/dist/esm/api/resources/taskGroups/client/Client.d.mts +0 -33
  38. package/dist/esm/api/resources/taskGroups/client/Client.mjs +0 -133
  39. package/dist/esm/api/resources/taskGroups/client/requests/index.d.mts +0 -1
  40. package/dist/esm/api/resources/taskGroups/resources/index.d.mts +1 -1
  41. package/dist/esm/api/resources/taskGroups/resources/index.mjs +1 -1
  42. package/dist/esm/api/resources/taskGroups/resources/s3Object/client/Client.d.mts +44 -0
  43. package/dist/esm/api/resources/taskGroups/resources/s3Object/client/Client.mjs +187 -0
  44. package/dist/esm/api/resources/taskGroups/resources/s3Object/client/index.d.mts +1 -0
  45. package/dist/esm/api/resources/taskGroups/resources/s3Object/client/index.mjs +1 -1
  46. package/dist/esm/api/resources/taskGroups/{client/requests/BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost.d.mts → resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.d.mts} +2 -2
  47. package/dist/esm/api/resources/taskGroups/resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.mjs +4 -0
  48. package/dist/esm/api/resources/taskGroups/resources/s3Object/client/requests/index.d.mts +1 -0
  49. package/dist/esm/version.d.mts +1 -1
  50. package/dist/esm/version.mjs +1 -1
  51. package/package.json +1 -1
  52. package/reference.md +280 -148
  53. package/dist/cjs/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/Client.d.ts +0 -47
  54. package/dist/cjs/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/Client.js +0 -127
  55. package/dist/cjs/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/index.d.ts +0 -1
  56. package/dist/cjs/api/resources/taskArtifacts/resources/s3ObjectMetadata/index.d.ts +0 -1
  57. package/dist/cjs/api/resources/taskArtifacts/resources/s3ObjectMetadata/index.js +0 -17
  58. package/dist/cjs/api/resources/taskGroups/resources/s3ObjectMetadata/client/Client.d.ts +0 -47
  59. package/dist/cjs/api/resources/taskGroups/resources/s3ObjectMetadata/client/Client.js +0 -127
  60. package/dist/cjs/api/resources/taskGroups/resources/s3ObjectMetadata/client/index.d.ts +0 -1
  61. package/dist/cjs/api/resources/taskGroups/resources/s3ObjectMetadata/index.d.ts +0 -1
  62. package/dist/cjs/api/resources/taskGroups/resources/s3ObjectMetadata/index.js +0 -17
  63. package/dist/esm/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/Client.d.mts +0 -47
  64. package/dist/esm/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/Client.mjs +0 -90
  65. package/dist/esm/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/index.d.mts +0 -1
  66. package/dist/esm/api/resources/taskArtifacts/resources/s3ObjectMetadata/index.d.mts +0 -1
  67. package/dist/esm/api/resources/taskArtifacts/resources/s3ObjectMetadata/index.mjs +0 -1
  68. package/dist/esm/api/resources/taskGroups/resources/s3ObjectMetadata/client/Client.d.mts +0 -47
  69. package/dist/esm/api/resources/taskGroups/resources/s3ObjectMetadata/client/Client.mjs +0 -90
  70. package/dist/esm/api/resources/taskGroups/resources/s3ObjectMetadata/client/index.d.mts +0 -1
  71. package/dist/esm/api/resources/taskGroups/resources/s3ObjectMetadata/index.d.mts +0 -1
  72. package/dist/esm/api/resources/taskGroups/resources/s3ObjectMetadata/index.mjs +0 -1
  73. /package/dist/cjs/api/resources/{taskGroups/client/requests/BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost.js → taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.js} +0 -0
  74. /package/dist/cjs/api/resources/taskArtifacts/resources/{s3ObjectMetadata/client → s3Object/client/requests}/index.js +0 -0
  75. /package/dist/cjs/api/resources/taskGroups/resources/{s3ObjectMetadata/client → s3Object/client/requests}/index.js +0 -0
  76. /package/dist/esm/api/resources/{taskGroups/client/requests/BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost.mjs → taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.mjs} +0 -0
  77. /package/dist/esm/api/resources/taskArtifacts/resources/{s3ObjectMetadata/client → s3Object/client/requests}/index.mjs +0 -0
  78. /package/dist/esm/api/resources/taskGroups/resources/{s3ObjectMetadata/client → s3Object/client/requests}/index.mjs +0 -0
@@ -1 +1,2 @@
1
1
  export {};
2
+ export * from "./requests/index.mjs";
@@ -1 +1 @@
1
- export {};
1
+ export * from "./requests/index.mjs";
@@ -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
+ * image: fs.createReadStream("/path/to/your/file")
9
+ * }
10
+ */
11
+ export interface BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost {
12
+ image: core.file.Uploadable.FileLike;
13
+ }
@@ -0,0 +1 @@
1
+ export { type BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost } from "./BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.mjs";
@@ -5,7 +5,6 @@ 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 { TaskGroupId } from "../resources/taskGroupId/client/Client.mjs";
8
- import { S3ObjectMetadata } from "../resources/s3ObjectMetadata/client/Client.mjs";
9
8
  import { S3Object } from "../resources/s3Object/client/Client.mjs";
10
9
  import { Expanded } from "../resources/expanded/client/Client.mjs";
11
10
  export declare namespace TaskGroups {
@@ -34,12 +33,10 @@ export declare namespace TaskGroups {
34
33
  export declare class TaskGroups {
35
34
  protected readonly _options: TaskGroups.Options;
36
35
  protected _taskGroupId: TaskGroupId | undefined;
37
- protected _s3ObjectMetadata: S3ObjectMetadata | undefined;
38
36
  protected _s3Object: S3Object | undefined;
39
37
  protected _expanded: Expanded | undefined;
40
38
  constructor(_options?: TaskGroups.Options);
41
39
  get taskGroupId(): TaskGroupId;
42
- get s3ObjectMetadata(): S3ObjectMetadata;
43
40
  get s3Object(): S3Object;
44
41
  get expanded(): Expanded;
45
42
  /**
@@ -148,35 +145,5 @@ export declare class TaskGroups {
148
145
  */
149
146
  addMessageV1(taskGroupId: string, request: Chrt.AddMessageReq, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
150
147
  private __addMessageV1;
151
- /**
152
- * Uploads an image file to a task group with automatic blurhash generation. | authz_personas=[courier_driver, courier_org_operators, forwarder_org_operators, shipper_org_operators] | (UploadFile) -> (bool)
153
- *
154
- * @param {string} taskGroupId
155
- * @param {Chrt.BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost} request
156
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
157
- *
158
- * @throws {@link Chrt.UnprocessableEntityError}
159
- *
160
- * @example
161
- * import { createReadStream } from "fs";
162
- * await client.taskGroups.addS3ObjectV1("task_group_id", {
163
- * image: fs.createReadStream("/path/to/your/file")
164
- * })
165
- */
166
- addS3ObjectV1(taskGroupId: string, request: Chrt.BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
167
- private __addS3ObjectV1;
168
- /**
169
- * Deletes an S3 object metadata and the associated S3 object from a task group. Only the uploader or an operator from the uploading org can delete. | () -> (bool)
170
- *
171
- * @param {string} taskGroupS3ObjectMetadataId
172
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
173
- *
174
- * @throws {@link Chrt.UnprocessableEntityError}
175
- *
176
- * @example
177
- * await client.taskGroups.deleteS3ObjectV1("task_group_s3_object_metadata_id")
178
- */
179
- deleteS3ObjectV1(taskGroupS3ObjectMetadataId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<boolean>;
180
- private __deleteS3ObjectV1;
181
148
  protected _getAuthorizationHeader(): Promise<string | undefined>;
182
149
  }
@@ -16,7 +16,6 @@ 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 { TaskGroupId } from "../resources/taskGroupId/client/Client.mjs";
19
- import { S3ObjectMetadata } from "../resources/s3ObjectMetadata/client/Client.mjs";
20
19
  import { S3Object } from "../resources/s3Object/client/Client.mjs";
21
20
  import { Expanded } from "../resources/expanded/client/Client.mjs";
22
21
  export class TaskGroups {
@@ -27,10 +26,6 @@ export class TaskGroups {
27
26
  var _a;
28
27
  return ((_a = this._taskGroupId) !== null && _a !== void 0 ? _a : (this._taskGroupId = new TaskGroupId(this._options)));
29
28
  }
30
- get s3ObjectMetadata() {
31
- var _a;
32
- return ((_a = this._s3ObjectMetadata) !== null && _a !== void 0 ? _a : (this._s3ObjectMetadata = new S3ObjectMetadata(this._options)));
33
- }
34
29
  get s3Object() {
35
30
  var _a;
36
31
  return ((_a = this._s3Object) !== null && _a !== void 0 ? _a : (this._s3Object = new S3Object(this._options)));
@@ -482,134 +477,6 @@ export class TaskGroups {
482
477
  }
483
478
  });
484
479
  }
485
- /**
486
- * Uploads an image file to a task group with automatic blurhash generation. | authz_personas=[courier_driver, courier_org_operators, forwarder_org_operators, shipper_org_operators] | (UploadFile) -> (bool)
487
- *
488
- * @param {string} taskGroupId
489
- * @param {Chrt.BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost} request
490
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
491
- *
492
- * @throws {@link Chrt.UnprocessableEntityError}
493
- *
494
- * @example
495
- * import { createReadStream } from "fs";
496
- * await client.taskGroups.addS3ObjectV1("task_group_id", {
497
- * image: fs.createReadStream("/path/to/your/file")
498
- * })
499
- */
500
- addS3ObjectV1(taskGroupId, request, requestOptions) {
501
- return core.HttpResponsePromise.fromPromise(this.__addS3ObjectV1(taskGroupId, request, requestOptions));
502
- }
503
- __addS3ObjectV1(taskGroupId, request, requestOptions) {
504
- return __awaiter(this, void 0, void 0, function* () {
505
- var _a, _b, _c, _d;
506
- const _request = yield core.newFormData();
507
- yield _request.appendFile("image", request.image);
508
- const _maybeEncodedRequest = yield _request.getRequest();
509
- 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);
510
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
511
- 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, `oort/task_groups/add_s3_object/v1/${encodeURIComponent(taskGroupId)}`),
512
- method: "POST",
513
- headers: _headers,
514
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
515
- requestType: "file",
516
- duplex: _maybeEncodedRequest.duplex,
517
- body: _maybeEncodedRequest.body,
518
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
519
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
520
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
521
- });
522
- if (_response.ok) {
523
- return { data: _response.body, rawResponse: _response.rawResponse };
524
- }
525
- if (_response.error.reason === "status-code") {
526
- switch (_response.error.statusCode) {
527
- case 422:
528
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
529
- default:
530
- throw new errors.ChrtError({
531
- statusCode: _response.error.statusCode,
532
- body: _response.error.body,
533
- rawResponse: _response.rawResponse,
534
- });
535
- }
536
- }
537
- switch (_response.error.reason) {
538
- case "non-json":
539
- throw new errors.ChrtError({
540
- statusCode: _response.error.statusCode,
541
- body: _response.error.rawBody,
542
- rawResponse: _response.rawResponse,
543
- });
544
- case "timeout":
545
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/add_s3_object/v1/{task_group_id}.");
546
- case "unknown":
547
- throw new errors.ChrtError({
548
- message: _response.error.errorMessage,
549
- rawResponse: _response.rawResponse,
550
- });
551
- }
552
- });
553
- }
554
- /**
555
- * Deletes an S3 object metadata and the associated S3 object from a task group. Only the uploader or an operator from the uploading org can delete. | () -> (bool)
556
- *
557
- * @param {string} taskGroupS3ObjectMetadataId
558
- * @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
559
- *
560
- * @throws {@link Chrt.UnprocessableEntityError}
561
- *
562
- * @example
563
- * await client.taskGroups.deleteS3ObjectV1("task_group_s3_object_metadata_id")
564
- */
565
- deleteS3ObjectV1(taskGroupS3ObjectMetadataId, requestOptions) {
566
- return core.HttpResponsePromise.fromPromise(this.__deleteS3ObjectV1(taskGroupS3ObjectMetadataId, requestOptions));
567
- }
568
- __deleteS3ObjectV1(taskGroupS3ObjectMetadataId, requestOptions) {
569
- return __awaiter(this, void 0, void 0, function* () {
570
- var _a, _b, _c, _d;
571
- 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);
572
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
573
- 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, `oort/task_groups/delete_s3_object/v1/${encodeURIComponent(taskGroupS3ObjectMetadataId)}`),
574
- method: "DELETE",
575
- headers: _headers,
576
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
577
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
578
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
579
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
580
- });
581
- if (_response.ok) {
582
- return { data: _response.body, rawResponse: _response.rawResponse };
583
- }
584
- if (_response.error.reason === "status-code") {
585
- switch (_response.error.statusCode) {
586
- case 422:
587
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
588
- default:
589
- throw new errors.ChrtError({
590
- statusCode: _response.error.statusCode,
591
- body: _response.error.body,
592
- rawResponse: _response.rawResponse,
593
- });
594
- }
595
- }
596
- switch (_response.error.reason) {
597
- case "non-json":
598
- throw new errors.ChrtError({
599
- statusCode: _response.error.statusCode,
600
- body: _response.error.rawBody,
601
- rawResponse: _response.rawResponse,
602
- });
603
- case "timeout":
604
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/task_groups/delete_s3_object/v1/{task_group_s3_object_metadata_id}.");
605
- case "unknown":
606
- throw new errors.ChrtError({
607
- message: _response.error.errorMessage,
608
- rawResponse: _response.rawResponse,
609
- });
610
- }
611
- });
612
- }
613
480
  _getAuthorizationHeader() {
614
481
  return __awaiter(this, void 0, void 0, function* () {
615
482
  const bearer = yield core.Supplier.get(this._options.token);
@@ -3,4 +3,3 @@ export { type SetFlightNumberReq } from "./SetFlightNumberReq.mjs";
3
3
  export { type UpdateDriverReq } from "./UpdateDriverReq.mjs";
4
4
  export { type UpdateCourierOrgReq } from "./UpdateCourierOrgReq.mjs";
5
5
  export { type AddMessageReq } from "./AddMessageReq.mjs";
6
- export { type BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost } from "./BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost.mjs";
@@ -1,6 +1,6 @@
1
1
  export * as expanded from "./expanded/index.mjs";
2
2
  export * from "./expanded/types/index.mjs";
3
3
  export * as taskGroupId from "./taskGroupId/index.mjs";
4
- export * as s3ObjectMetadata from "./s3ObjectMetadata/index.mjs";
5
4
  export * as s3Object from "./s3Object/index.mjs";
5
+ export * from "./s3Object/client/requests/index.mjs";
6
6
  export * from "./expanded/client/requests/index.mjs";
@@ -1,6 +1,6 @@
1
1
  export * as expanded from "./expanded/index.mjs";
2
2
  export * from "./expanded/types/index.mjs";
3
3
  export * as taskGroupId from "./taskGroupId/index.mjs";
4
- export * as s3ObjectMetadata from "./s3ObjectMetadata/index.mjs";
5
4
  export * as s3Object from "./s3Object/index.mjs";
5
+ export * from "./s3Object/client/requests/index.mjs";
6
6
  export * from "./expanded/client/requests/index.mjs";
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as environments from "../../../../../../environments.mjs";
5
5
  import * as core from "../../../../../../core/index.mjs";
6
+ import * as Chrt from "../../../../../index.mjs";
6
7
  export declare namespace S3Object {
7
8
  interface Options {
8
9
  environment?: core.Supplier<environments.ChrtEnvironment | string>;
@@ -29,6 +30,19 @@ export declare namespace S3Object {
29
30
  export declare class S3Object {
30
31
  protected readonly _options: S3Object.Options;
31
32
  constructor(_options?: S3Object.Options);
33
+ /**
34
+ * Retrieves the metadata for a task group S3 object, including blurhash for placeholder loading. | authz_personas=[courier_driver, courier_org_operators, shipper_org_operators, forwarder_org_operators] | () -> (TaskGroupS3ObjectMetadata1)
35
+ *
36
+ * @param {string} taskGroupS3ObjectMetadataId
37
+ * @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
38
+ *
39
+ * @throws {@link Chrt.UnprocessableEntityError}
40
+ *
41
+ * @example
42
+ * await client.taskGroups.s3Object.getS3ObjectMetadataV1("task_group_s3_object_metadata_id")
43
+ */
44
+ getS3ObjectMetadataV1(taskGroupS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupS3ObjectMetadata1>;
45
+ private __getS3ObjectMetadataV1;
32
46
  /**
33
47
  * Streams a task group S3 object file from storage. | authz_personas=[courier_driver, courier_org_operators, shipper_org_operators, forwarder_org_operators] | () -> (StreamingResponse)
34
48
  *
@@ -42,5 +56,35 @@ export declare class S3Object {
42
56
  */
43
57
  getV1(taskGroupS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<unknown>;
44
58
  private __getV1;
59
+ /**
60
+ * Uploads an image file to a task group with automatic blurhash generation. | authz_personas=[courier_driver, courier_org_operators, forwarder_org_operators, shipper_org_operators] | (UploadFile) -> (bool)
61
+ *
62
+ * @param {string} taskGroupId
63
+ * @param {Chrt.taskGroups.BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost} request
64
+ * @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link Chrt.UnprocessableEntityError}
67
+ *
68
+ * @example
69
+ * import { createReadStream } from "fs";
70
+ * await client.taskGroups.s3Object.addV1("task_group_id", {
71
+ * image: fs.createReadStream("/path/to/your/file")
72
+ * })
73
+ */
74
+ addV1(taskGroupId: string, request: Chrt.taskGroups.BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<boolean>;
75
+ private __addV1;
76
+ /**
77
+ * Deletes an S3 object metadata and the associated S3 object from a task group. Only the uploader or an operator from the uploading org can delete. | () -> (bool)
78
+ *
79
+ * @param {string} taskGroupS3ObjectMetadataId
80
+ * @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
81
+ *
82
+ * @throws {@link Chrt.UnprocessableEntityError}
83
+ *
84
+ * @example
85
+ * await client.taskGroups.s3Object.deleteV1("task_group_s3_object_metadata_id")
86
+ */
87
+ deleteV1(taskGroupS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<boolean>;
88
+ private __deleteV1;
45
89
  protected _getAuthorizationHeader(): Promise<string | undefined>;
46
90
  }
@@ -19,6 +19,65 @@ export class S3Object {
19
19
  constructor(_options = {}) {
20
20
  this._options = _options;
21
21
  }
22
+ /**
23
+ * Retrieves the metadata for a task group S3 object, including blurhash for placeholder loading. | authz_personas=[courier_driver, courier_org_operators, shipper_org_operators, forwarder_org_operators] | () -> (TaskGroupS3ObjectMetadata1)
24
+ *
25
+ * @param {string} taskGroupS3ObjectMetadataId
26
+ * @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link Chrt.UnprocessableEntityError}
29
+ *
30
+ * @example
31
+ * await client.taskGroups.s3Object.getS3ObjectMetadataV1("task_group_s3_object_metadata_id")
32
+ */
33
+ getS3ObjectMetadataV1(taskGroupS3ObjectMetadataId, requestOptions) {
34
+ return core.HttpResponsePromise.fromPromise(this.__getS3ObjectMetadataV1(taskGroupS3ObjectMetadataId, requestOptions));
35
+ }
36
+ __getS3ObjectMetadataV1(taskGroupS3ObjectMetadataId, requestOptions) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ var _a, _b, _c, _d;
39
+ 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);
40
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
41
+ 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, `oort/task_groups/s3_object/s3_object_metadata/v1/${encodeURIComponent(taskGroupS3ObjectMetadataId)}`),
42
+ method: "GET",
43
+ headers: _headers,
44
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
45
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
46
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
47
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
48
+ });
49
+ if (_response.ok) {
50
+ return { data: _response.body, rawResponse: _response.rawResponse };
51
+ }
52
+ if (_response.error.reason === "status-code") {
53
+ switch (_response.error.statusCode) {
54
+ case 422:
55
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
56
+ default:
57
+ throw new errors.ChrtError({
58
+ statusCode: _response.error.statusCode,
59
+ body: _response.error.body,
60
+ rawResponse: _response.rawResponse,
61
+ });
62
+ }
63
+ }
64
+ switch (_response.error.reason) {
65
+ case "non-json":
66
+ throw new errors.ChrtError({
67
+ statusCode: _response.error.statusCode,
68
+ body: _response.error.rawBody,
69
+ rawResponse: _response.rawResponse,
70
+ });
71
+ case "timeout":
72
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_groups/s3_object/s3_object_metadata/v1/{task_group_s3_object_metadata_id}.");
73
+ case "unknown":
74
+ throw new errors.ChrtError({
75
+ message: _response.error.errorMessage,
76
+ rawResponse: _response.rawResponse,
77
+ });
78
+ }
79
+ });
80
+ }
22
81
  /**
23
82
  * Streams a task group S3 object file from storage. | authz_personas=[courier_driver, courier_org_operators, shipper_org_operators, forwarder_org_operators] | () -> (StreamingResponse)
24
83
  *
@@ -78,6 +137,134 @@ export class S3Object {
78
137
  }
79
138
  });
80
139
  }
140
+ /**
141
+ * Uploads an image file to a task group with automatic blurhash generation. | authz_personas=[courier_driver, courier_org_operators, forwarder_org_operators, shipper_org_operators] | (UploadFile) -> (bool)
142
+ *
143
+ * @param {string} taskGroupId
144
+ * @param {Chrt.taskGroups.BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost} request
145
+ * @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
146
+ *
147
+ * @throws {@link Chrt.UnprocessableEntityError}
148
+ *
149
+ * @example
150
+ * import { createReadStream } from "fs";
151
+ * await client.taskGroups.s3Object.addV1("task_group_id", {
152
+ * image: fs.createReadStream("/path/to/your/file")
153
+ * })
154
+ */
155
+ addV1(taskGroupId, request, requestOptions) {
156
+ return core.HttpResponsePromise.fromPromise(this.__addV1(taskGroupId, request, requestOptions));
157
+ }
158
+ __addV1(taskGroupId, request, requestOptions) {
159
+ return __awaiter(this, void 0, void 0, function* () {
160
+ var _a, _b, _c, _d;
161
+ const _request = yield core.newFormData();
162
+ yield _request.appendFile("image", request.image);
163
+ const _maybeEncodedRequest = yield _request.getRequest();
164
+ 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);
165
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
166
+ 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, `oort/task_groups/s3_object/add/v1/${encodeURIComponent(taskGroupId)}`),
167
+ method: "POST",
168
+ headers: _headers,
169
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
170
+ requestType: "file",
171
+ duplex: _maybeEncodedRequest.duplex,
172
+ body: _maybeEncodedRequest.body,
173
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
174
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
175
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
176
+ });
177
+ if (_response.ok) {
178
+ return { data: _response.body, rawResponse: _response.rawResponse };
179
+ }
180
+ if (_response.error.reason === "status-code") {
181
+ switch (_response.error.statusCode) {
182
+ case 422:
183
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
184
+ default:
185
+ throw new errors.ChrtError({
186
+ statusCode: _response.error.statusCode,
187
+ body: _response.error.body,
188
+ rawResponse: _response.rawResponse,
189
+ });
190
+ }
191
+ }
192
+ switch (_response.error.reason) {
193
+ case "non-json":
194
+ throw new errors.ChrtError({
195
+ statusCode: _response.error.statusCode,
196
+ body: _response.error.rawBody,
197
+ rawResponse: _response.rawResponse,
198
+ });
199
+ case "timeout":
200
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/s3_object/add/v1/{task_group_id}.");
201
+ case "unknown":
202
+ throw new errors.ChrtError({
203
+ message: _response.error.errorMessage,
204
+ rawResponse: _response.rawResponse,
205
+ });
206
+ }
207
+ });
208
+ }
209
+ /**
210
+ * Deletes an S3 object metadata and the associated S3 object from a task group. Only the uploader or an operator from the uploading org can delete. | () -> (bool)
211
+ *
212
+ * @param {string} taskGroupS3ObjectMetadataId
213
+ * @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
214
+ *
215
+ * @throws {@link Chrt.UnprocessableEntityError}
216
+ *
217
+ * @example
218
+ * await client.taskGroups.s3Object.deleteV1("task_group_s3_object_metadata_id")
219
+ */
220
+ deleteV1(taskGroupS3ObjectMetadataId, requestOptions) {
221
+ return core.HttpResponsePromise.fromPromise(this.__deleteV1(taskGroupS3ObjectMetadataId, requestOptions));
222
+ }
223
+ __deleteV1(taskGroupS3ObjectMetadataId, requestOptions) {
224
+ return __awaiter(this, void 0, void 0, function* () {
225
+ var _a, _b, _c, _d;
226
+ 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);
227
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
228
+ 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, `oort/task_groups/s3_object/delete/v1/${encodeURIComponent(taskGroupS3ObjectMetadataId)}`),
229
+ method: "DELETE",
230
+ headers: _headers,
231
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
232
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
233
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
234
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
235
+ });
236
+ if (_response.ok) {
237
+ return { data: _response.body, rawResponse: _response.rawResponse };
238
+ }
239
+ if (_response.error.reason === "status-code") {
240
+ switch (_response.error.statusCode) {
241
+ case 422:
242
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
243
+ default:
244
+ throw new errors.ChrtError({
245
+ statusCode: _response.error.statusCode,
246
+ body: _response.error.body,
247
+ rawResponse: _response.rawResponse,
248
+ });
249
+ }
250
+ }
251
+ switch (_response.error.reason) {
252
+ case "non-json":
253
+ throw new errors.ChrtError({
254
+ statusCode: _response.error.statusCode,
255
+ body: _response.error.rawBody,
256
+ rawResponse: _response.rawResponse,
257
+ });
258
+ case "timeout":
259
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/task_groups/s3_object/delete/v1/{task_group_s3_object_metadata_id}.");
260
+ case "unknown":
261
+ throw new errors.ChrtError({
262
+ message: _response.error.errorMessage,
263
+ rawResponse: _response.rawResponse,
264
+ });
265
+ }
266
+ });
267
+ }
81
268
  _getAuthorizationHeader() {
82
269
  return __awaiter(this, void 0, void 0, function* () {
83
270
  const bearer = yield core.Supplier.get(this._options.token);
@@ -1 +1,2 @@
1
1
  export {};
2
+ export * from "./requests/index.mjs";
@@ -1 +1 @@
1
- export {};
1
+ export * from "./requests/index.mjs";
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as core from "../../../../../core/index.mjs";
4
+ import * as core from "../../../../../../../core/index.mjs";
5
5
  /**
6
6
  * @example
7
7
  * {
8
8
  * image: fs.createReadStream("/path/to/your/file")
9
9
  * }
10
10
  */
11
- export interface BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost {
11
+ export interface BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost {
12
12
  image: core.file.Uploadable.FileLike;
13
13
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1 @@
1
+ export { type BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost } from "./BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.321.0";
1
+ export declare const SDK_VERSION = "1.322.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.321.0";
1
+ export const SDK_VERSION = "1.322.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrt-inc/typescript-sdk",
3
- "version": "1.321.0",
3
+ "version": "1.322.0",
4
4
  "private": false,
5
5
  "repository": "github:chrt-inc/typescript-sdk",
6
6
  "type": "commonjs",