@chrt-inc/typescript-sdk 1.321.0 → 1.324.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/drivers/client/Client.d.ts +18 -6
- package/dist/cjs/api/resources/drivers/client/Client.js +70 -32
- package/dist/cjs/api/resources/drivers/client/requests/DriversListOrgMembersAndDriversV1Request.d.ts +16 -0
- package/dist/cjs/api/resources/drivers/client/requests/DriversListV1Request.d.ts +16 -0
- package/dist/cjs/api/resources/drivers/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.d.ts +52 -5
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/Client.js +200 -9
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/SetFlightNumberDraftReq.d.ts +13 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/SetFlightNumberDraftReq.js +5 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/SetTaskOrderingDraftReq.d.ts +13 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/SetTaskOrderingDraftReq.js +5 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateCourierOrgDraftReq.d.ts +13 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateCourierOrgDraftReq.js +5 -0
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.ts +3 -1
- package/dist/cjs/api/resources/taskArtifacts/client/Client.d.ts +0 -3
- package/dist/cjs/api/resources/taskArtifacts/client/Client.js +2 -7
- package/dist/cjs/api/resources/taskArtifacts/resources/index.d.ts +1 -1
- package/dist/cjs/api/resources/taskArtifacts/resources/index.js +5 -2
- package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/Client.d.ts +44 -0
- package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/Client.js +187 -0
- package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/index.js +15 -0
- package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.d.ts +13 -0
- package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.js +5 -0
- package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/taskGroups/client/Client.d.ts +0 -33
- package/dist/cjs/api/resources/taskGroups/client/Client.js +4 -137
- package/dist/cjs/api/resources/taskGroups/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/taskGroups/resources/index.d.ts +1 -1
- package/dist/cjs/api/resources/taskGroups/resources/index.js +2 -2
- package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/Client.d.ts +44 -0
- package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/Client.js +187 -0
- package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/index.js +15 -0
- package/dist/cjs/api/resources/taskGroups/{client/requests/BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost.d.ts → resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.d.ts} +2 -2
- package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.js +5 -0
- package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/requests/index.d.ts +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/drivers/client/Client.d.mts +18 -6
- package/dist/esm/api/resources/drivers/client/Client.mjs +70 -32
- package/dist/esm/api/resources/drivers/client/requests/DriversListOrgMembersAndDriversV1Request.d.mts +16 -0
- package/dist/esm/api/resources/drivers/client/requests/DriversListV1Request.d.mts +16 -0
- package/dist/esm/api/resources/drivers/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.d.mts +52 -5
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/Client.mjs +200 -9
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/SetFlightNumberDraftReq.d.mts +13 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/SetFlightNumberDraftReq.mjs +4 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/SetTaskOrderingDraftReq.d.mts +13 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/SetTaskOrderingDraftReq.mjs +4 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateCourierOrgDraftReq.d.mts +13 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateCourierOrgDraftReq.mjs +4 -0
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/index.d.mts +3 -1
- package/dist/esm/api/resources/taskArtifacts/client/Client.d.mts +0 -3
- package/dist/esm/api/resources/taskArtifacts/client/Client.mjs +0 -5
- package/dist/esm/api/resources/taskArtifacts/resources/index.d.mts +1 -1
- package/dist/esm/api/resources/taskArtifacts/resources/index.mjs +1 -1
- package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/Client.d.mts +44 -0
- package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/Client.mjs +187 -0
- package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/index.d.mts +1 -0
- package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/index.mjs +1 -1
- package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.d.mts +13 -0
- package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.mjs +4 -0
- package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/taskGroups/client/Client.d.mts +0 -33
- package/dist/esm/api/resources/taskGroups/client/Client.mjs +0 -133
- package/dist/esm/api/resources/taskGroups/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/taskGroups/resources/index.d.mts +1 -1
- package/dist/esm/api/resources/taskGroups/resources/index.mjs +1 -1
- package/dist/esm/api/resources/taskGroups/resources/s3Object/client/Client.d.mts +44 -0
- package/dist/esm/api/resources/taskGroups/resources/s3Object/client/Client.mjs +187 -0
- package/dist/esm/api/resources/taskGroups/resources/s3Object/client/index.d.mts +1 -0
- package/dist/esm/api/resources/taskGroups/resources/s3Object/client/index.mjs +1 -1
- package/dist/esm/api/resources/taskGroups/{client/requests/BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost.d.mts → resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.d.mts} +2 -2
- package/dist/esm/api/resources/taskGroups/resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.mjs +4 -0
- package/dist/esm/api/resources/taskGroups/resources/s3Object/client/requests/index.d.mts +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +578 -213
- package/dist/cjs/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.d.ts +0 -13
- package/dist/cjs/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/Client.d.ts +0 -47
- package/dist/cjs/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/Client.js +0 -127
- package/dist/cjs/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/taskArtifacts/resources/s3ObjectMetadata/index.d.ts +0 -1
- package/dist/cjs/api/resources/taskArtifacts/resources/s3ObjectMetadata/index.js +0 -17
- package/dist/cjs/api/resources/taskGroups/resources/s3ObjectMetadata/client/Client.d.ts +0 -47
- package/dist/cjs/api/resources/taskGroups/resources/s3ObjectMetadata/client/Client.js +0 -127
- package/dist/cjs/api/resources/taskGroups/resources/s3ObjectMetadata/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/taskGroups/resources/s3ObjectMetadata/index.d.ts +0 -1
- package/dist/cjs/api/resources/taskGroups/resources/s3ObjectMetadata/index.js +0 -17
- package/dist/esm/api/resources/orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.d.mts +0 -13
- package/dist/esm/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/Client.d.mts +0 -47
- package/dist/esm/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/Client.mjs +0 -90
- package/dist/esm/api/resources/taskArtifacts/resources/s3ObjectMetadata/client/index.d.mts +0 -1
- package/dist/esm/api/resources/taskArtifacts/resources/s3ObjectMetadata/index.d.mts +0 -1
- package/dist/esm/api/resources/taskArtifacts/resources/s3ObjectMetadata/index.mjs +0 -1
- package/dist/esm/api/resources/taskGroups/resources/s3ObjectMetadata/client/Client.d.mts +0 -47
- package/dist/esm/api/resources/taskGroups/resources/s3ObjectMetadata/client/Client.mjs +0 -90
- package/dist/esm/api/resources/taskGroups/resources/s3ObjectMetadata/client/index.d.mts +0 -1
- package/dist/esm/api/resources/taskGroups/resources/s3ObjectMetadata/index.d.mts +0 -1
- package/dist/esm/api/resources/taskGroups/resources/s3ObjectMetadata/index.mjs +0 -1
- /package/dist/cjs/api/resources/{orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.js → drivers/client/requests/DriversListOrgMembersAndDriversV1Request.js} +0 -0
- /package/dist/cjs/api/resources/{taskGroups/client/requests/BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost.js → drivers/client/requests/DriversListV1Request.js} +0 -0
- /package/dist/cjs/api/resources/taskArtifacts/resources/{s3ObjectMetadata/client → s3Object/client/requests}/index.js +0 -0
- /package/dist/cjs/api/resources/taskGroups/resources/{s3ObjectMetadata/client → s3Object/client/requests}/index.js +0 -0
- /package/dist/esm/api/resources/{orderDrafts/resources/taskGroup/client/requests/UpdateTaskGroupDraftReq.mjs → drivers/client/requests/DriversListOrgMembersAndDriversV1Request.mjs} +0 -0
- /package/dist/esm/api/resources/{taskGroups/client/requests/BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost.mjs → drivers/client/requests/DriversListV1Request.mjs} +0 -0
- /package/dist/esm/api/resources/taskArtifacts/resources/{s3ObjectMetadata/client → s3Object/client/requests}/index.mjs +0 -0
- /package/dist/esm/api/resources/taskGroups/resources/{s3ObjectMetadata/client → s3Object/client/requests}/index.mjs +0 -0
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import * as environments from "../../../../environments.js";
|
|
5
5
|
import * as core from "../../../../core/index.js";
|
|
6
6
|
import * as Chrt from "../../../index.js";
|
|
7
|
-
import { S3ObjectMetadata } from "../resources/s3ObjectMetadata/client/Client.js";
|
|
8
7
|
import { S3Object } from "../resources/s3Object/client/Client.js";
|
|
9
8
|
export declare namespace TaskArtifacts {
|
|
10
9
|
interface Options {
|
|
@@ -31,10 +30,8 @@ export declare namespace TaskArtifacts {
|
|
|
31
30
|
}
|
|
32
31
|
export declare class TaskArtifacts {
|
|
33
32
|
protected readonly _options: TaskArtifacts.Options;
|
|
34
|
-
protected _s3ObjectMetadata: S3ObjectMetadata | undefined;
|
|
35
33
|
protected _s3Object: S3Object | undefined;
|
|
36
34
|
constructor(_options?: TaskArtifacts.Options);
|
|
37
|
-
get s3ObjectMetadata(): S3ObjectMetadata;
|
|
38
35
|
get s3Object(): S3Object;
|
|
39
36
|
/**
|
|
40
37
|
* Adds a new task artifact to a task. | authz_personas=[courier_driver, courier_org_operators, forwarder_org_operators] | (AddTaskArtifactReq) -> (PydanticObjectId)
|
|
@@ -51,19 +51,14 @@ const core = __importStar(require("../../../../core/index.js"));
|
|
|
51
51
|
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
|
-
const Client_js_1 = require("../resources/
|
|
55
|
-
const Client_js_2 = require("../resources/s3Object/client/Client.js");
|
|
54
|
+
const Client_js_1 = require("../resources/s3Object/client/Client.js");
|
|
56
55
|
class TaskArtifacts {
|
|
57
56
|
constructor(_options = {}) {
|
|
58
57
|
this._options = _options;
|
|
59
58
|
}
|
|
60
|
-
get s3ObjectMetadata() {
|
|
61
|
-
var _a;
|
|
62
|
-
return ((_a = this._s3ObjectMetadata) !== null && _a !== void 0 ? _a : (this._s3ObjectMetadata = new Client_js_1.S3ObjectMetadata(this._options)));
|
|
63
|
-
}
|
|
64
59
|
get s3Object() {
|
|
65
60
|
var _a;
|
|
66
|
-
return ((_a = this._s3Object) !== null && _a !== void 0 ? _a : (this._s3Object = new
|
|
61
|
+
return ((_a = this._s3Object) !== null && _a !== void 0 ? _a : (this._s3Object = new Client_js_1.S3Object(this._options)));
|
|
67
62
|
}
|
|
68
63
|
/**
|
|
69
64
|
* Adds a new task artifact to a task. | authz_personas=[courier_driver, courier_org_operators, forwarder_org_operators] | (AddTaskArtifactReq) -> (PydanticObjectId)
|
|
@@ -32,7 +32,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
35
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.s3Object =
|
|
37
|
-
exports.s3ObjectMetadata = __importStar(require("./s3ObjectMetadata/index.js"));
|
|
39
|
+
exports.s3Object = void 0;
|
|
38
40
|
exports.s3Object = __importStar(require("./s3Object/index.js"));
|
|
41
|
+
__exportStar(require("./s3Object/client/requests/index.js"), exports);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "../../../../../../environments.js";
|
|
5
5
|
import * as core from "../../../../../../core/index.js";
|
|
6
|
+
import * as Chrt from "../../../../../index.js";
|
|
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 artifact S3 object, including blurhash for placeholder loading. | authz_personas=[courier_driver, courier_org_operators, shipper_org_operators, forwarder_org_operators] | () -> (TaskArtifactS3ObjectMetadata1)
|
|
35
|
+
*
|
|
36
|
+
* @param {string} taskArtifactS3ObjectMetadataId
|
|
37
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.taskArtifacts.s3Object.getS3ObjectMetadataV1("task_artifact_s3_object_metadata_id")
|
|
43
|
+
*/
|
|
44
|
+
getS3ObjectMetadataV1(taskArtifactS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<Chrt.TaskArtifactS3ObjectMetadata1>;
|
|
45
|
+
private __getS3ObjectMetadataV1;
|
|
32
46
|
/**
|
|
33
47
|
* Streams a task artifact 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(taskArtifactS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
44
58
|
private __getV1;
|
|
59
|
+
/**
|
|
60
|
+
* Uploads an image file to a task artifact with automatic blurhash generation. | authz_personas=[courier_driver, forwarder_org_operators, courier_org_operators, shipper_org_operators] | (UploadFile) -> (bool)
|
|
61
|
+
*
|
|
62
|
+
* @param {string} taskArtifactId
|
|
63
|
+
* @param {Chrt.taskArtifacts.BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost} 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.taskArtifacts.s3Object.addV1("task_artifact_id", {
|
|
71
|
+
* image: fs.createReadStream("/path/to/your/file")
|
|
72
|
+
* })
|
|
73
|
+
*/
|
|
74
|
+
addV1(taskArtifactId: string, request: Chrt.taskArtifacts.BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
75
|
+
private __addV1;
|
|
76
|
+
/**
|
|
77
|
+
* Deletes an S3 object metadata and the associated S3 object from a task artifact. Only the uploader or an operator from the uploading org can delete. | () -> (bool)
|
|
78
|
+
*
|
|
79
|
+
* @param {string} taskArtifactS3ObjectMetadataId
|
|
80
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
81
|
+
*
|
|
82
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* await client.taskArtifacts.s3Object.deleteV1("task_artifact_s3_object_metadata_id")
|
|
86
|
+
*/
|
|
87
|
+
deleteV1(taskArtifactS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
88
|
+
private __deleteV1;
|
|
45
89
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
46
90
|
}
|
|
@@ -55,6 +55,65 @@ class S3Object {
|
|
|
55
55
|
constructor(_options = {}) {
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves the metadata for a task artifact S3 object, including blurhash for placeholder loading. | authz_personas=[courier_driver, courier_org_operators, shipper_org_operators, forwarder_org_operators] | () -> (TaskArtifactS3ObjectMetadata1)
|
|
60
|
+
*
|
|
61
|
+
* @param {string} taskArtifactS3ObjectMetadataId
|
|
62
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.taskArtifacts.s3Object.getS3ObjectMetadataV1("task_artifact_s3_object_metadata_id")
|
|
68
|
+
*/
|
|
69
|
+
getS3ObjectMetadataV1(taskArtifactS3ObjectMetadataId, requestOptions) {
|
|
70
|
+
return core.HttpResponsePromise.fromPromise(this.__getS3ObjectMetadataV1(taskArtifactS3ObjectMetadataId, requestOptions));
|
|
71
|
+
}
|
|
72
|
+
__getS3ObjectMetadataV1(taskArtifactS3ObjectMetadataId, requestOptions) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
var _a, _b, _c, _d;
|
|
75
|
+
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);
|
|
76
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
77
|
+
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_artifacts/s3_object/s3_object_metadata/v1/${encodeURIComponent(taskArtifactS3ObjectMetadataId)}`),
|
|
78
|
+
method: "GET",
|
|
79
|
+
headers: _headers,
|
|
80
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
81
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
82
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
83
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
84
|
+
});
|
|
85
|
+
if (_response.ok) {
|
|
86
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
87
|
+
}
|
|
88
|
+
if (_response.error.reason === "status-code") {
|
|
89
|
+
switch (_response.error.statusCode) {
|
|
90
|
+
case 422:
|
|
91
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
92
|
+
default:
|
|
93
|
+
throw new errors.ChrtError({
|
|
94
|
+
statusCode: _response.error.statusCode,
|
|
95
|
+
body: _response.error.body,
|
|
96
|
+
rawResponse: _response.rawResponse,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
switch (_response.error.reason) {
|
|
101
|
+
case "non-json":
|
|
102
|
+
throw new errors.ChrtError({
|
|
103
|
+
statusCode: _response.error.statusCode,
|
|
104
|
+
body: _response.error.rawBody,
|
|
105
|
+
rawResponse: _response.rawResponse,
|
|
106
|
+
});
|
|
107
|
+
case "timeout":
|
|
108
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_artifacts/s3_object/s3_object_metadata/v1/{task_artifact_s3_object_metadata_id}.");
|
|
109
|
+
case "unknown":
|
|
110
|
+
throw new errors.ChrtError({
|
|
111
|
+
message: _response.error.errorMessage,
|
|
112
|
+
rawResponse: _response.rawResponse,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
58
117
|
/**
|
|
59
118
|
* Streams a task artifact S3 object file from storage. | authz_personas=[courier_driver, courier_org_operators, shipper_org_operators, forwarder_org_operators] | () -> (StreamingResponse)
|
|
60
119
|
*
|
|
@@ -114,6 +173,134 @@ class S3Object {
|
|
|
114
173
|
}
|
|
115
174
|
});
|
|
116
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Uploads an image file to a task artifact with automatic blurhash generation. | authz_personas=[courier_driver, forwarder_org_operators, courier_org_operators, shipper_org_operators] | (UploadFile) -> (bool)
|
|
178
|
+
*
|
|
179
|
+
* @param {string} taskArtifactId
|
|
180
|
+
* @param {Chrt.taskArtifacts.BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost} request
|
|
181
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
182
|
+
*
|
|
183
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* import { createReadStream } from "fs";
|
|
187
|
+
* await client.taskArtifacts.s3Object.addV1("task_artifact_id", {
|
|
188
|
+
* image: fs.createReadStream("/path/to/your/file")
|
|
189
|
+
* })
|
|
190
|
+
*/
|
|
191
|
+
addV1(taskArtifactId, request, requestOptions) {
|
|
192
|
+
return core.HttpResponsePromise.fromPromise(this.__addV1(taskArtifactId, request, requestOptions));
|
|
193
|
+
}
|
|
194
|
+
__addV1(taskArtifactId, request, requestOptions) {
|
|
195
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
+
var _a, _b, _c, _d;
|
|
197
|
+
const _request = yield core.newFormData();
|
|
198
|
+
yield _request.appendFile("image", request.image);
|
|
199
|
+
const _maybeEncodedRequest = yield _request.getRequest();
|
|
200
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
201
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
202
|
+
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_artifacts/s3_object/add/v1/${encodeURIComponent(taskArtifactId)}`),
|
|
203
|
+
method: "POST",
|
|
204
|
+
headers: _headers,
|
|
205
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
206
|
+
requestType: "file",
|
|
207
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
208
|
+
body: _maybeEncodedRequest.body,
|
|
209
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
210
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
211
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
212
|
+
});
|
|
213
|
+
if (_response.ok) {
|
|
214
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
215
|
+
}
|
|
216
|
+
if (_response.error.reason === "status-code") {
|
|
217
|
+
switch (_response.error.statusCode) {
|
|
218
|
+
case 422:
|
|
219
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
220
|
+
default:
|
|
221
|
+
throw new errors.ChrtError({
|
|
222
|
+
statusCode: _response.error.statusCode,
|
|
223
|
+
body: _response.error.body,
|
|
224
|
+
rawResponse: _response.rawResponse,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
switch (_response.error.reason) {
|
|
229
|
+
case "non-json":
|
|
230
|
+
throw new errors.ChrtError({
|
|
231
|
+
statusCode: _response.error.statusCode,
|
|
232
|
+
body: _response.error.rawBody,
|
|
233
|
+
rawResponse: _response.rawResponse,
|
|
234
|
+
});
|
|
235
|
+
case "timeout":
|
|
236
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_artifacts/s3_object/add/v1/{task_artifact_id}.");
|
|
237
|
+
case "unknown":
|
|
238
|
+
throw new errors.ChrtError({
|
|
239
|
+
message: _response.error.errorMessage,
|
|
240
|
+
rawResponse: _response.rawResponse,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Deletes an S3 object metadata and the associated S3 object from a task artifact. Only the uploader or an operator from the uploading org can delete. | () -> (bool)
|
|
247
|
+
*
|
|
248
|
+
* @param {string} taskArtifactS3ObjectMetadataId
|
|
249
|
+
* @param {S3Object.RequestOptions} requestOptions - Request-specific configuration.
|
|
250
|
+
*
|
|
251
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* await client.taskArtifacts.s3Object.deleteV1("task_artifact_s3_object_metadata_id")
|
|
255
|
+
*/
|
|
256
|
+
deleteV1(taskArtifactS3ObjectMetadataId, requestOptions) {
|
|
257
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteV1(taskArtifactS3ObjectMetadataId, requestOptions));
|
|
258
|
+
}
|
|
259
|
+
__deleteV1(taskArtifactS3ObjectMetadataId, requestOptions) {
|
|
260
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
+
var _a, _b, _c, _d;
|
|
262
|
+
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);
|
|
263
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
264
|
+
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_artifacts/s3_object/delete/v1/${encodeURIComponent(taskArtifactS3ObjectMetadataId)}`),
|
|
265
|
+
method: "DELETE",
|
|
266
|
+
headers: _headers,
|
|
267
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
268
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
269
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
270
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
271
|
+
});
|
|
272
|
+
if (_response.ok) {
|
|
273
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
274
|
+
}
|
|
275
|
+
if (_response.error.reason === "status-code") {
|
|
276
|
+
switch (_response.error.statusCode) {
|
|
277
|
+
case 422:
|
|
278
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
279
|
+
default:
|
|
280
|
+
throw new errors.ChrtError({
|
|
281
|
+
statusCode: _response.error.statusCode,
|
|
282
|
+
body: _response.error.body,
|
|
283
|
+
rawResponse: _response.rawResponse,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
switch (_response.error.reason) {
|
|
288
|
+
case "non-json":
|
|
289
|
+
throw new errors.ChrtError({
|
|
290
|
+
statusCode: _response.error.statusCode,
|
|
291
|
+
body: _response.error.rawBody,
|
|
292
|
+
rawResponse: _response.rawResponse,
|
|
293
|
+
});
|
|
294
|
+
case "timeout":
|
|
295
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/task_artifacts/s3_object/delete/v1/{task_artifact_s3_object_metadata_id}.");
|
|
296
|
+
case "unknown":
|
|
297
|
+
throw new errors.ChrtError({
|
|
298
|
+
message: _response.error.errorMessage,
|
|
299
|
+
rawResponse: _response.rawResponse,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}
|
|
117
304
|
_getAuthorizationHeader() {
|
|
118
305
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
306
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -1,2 +1,17 @@
|
|
|
1
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
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as core from "../../../../../../../core/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* 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.js";
|
|
@@ -5,7 +5,6 @@ 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 { TaskGroupId } from "../resources/taskGroupId/client/Client.js";
|
|
8
|
-
import { S3ObjectMetadata } from "../resources/s3ObjectMetadata/client/Client.js";
|
|
9
8
|
import { S3Object } from "../resources/s3Object/client/Client.js";
|
|
10
9
|
import { Expanded } from "../resources/expanded/client/Client.js";
|
|
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
|
}
|
|
@@ -52,9 +52,8 @@ 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/taskGroupId/client/Client.js");
|
|
55
|
-
const Client_js_2 = require("../resources/
|
|
56
|
-
const Client_js_3 = require("../resources/
|
|
57
|
-
const Client_js_4 = require("../resources/expanded/client/Client.js");
|
|
55
|
+
const Client_js_2 = require("../resources/s3Object/client/Client.js");
|
|
56
|
+
const Client_js_3 = require("../resources/expanded/client/Client.js");
|
|
58
57
|
class TaskGroups {
|
|
59
58
|
constructor(_options = {}) {
|
|
60
59
|
this._options = _options;
|
|
@@ -63,17 +62,13 @@ class TaskGroups {
|
|
|
63
62
|
var _a;
|
|
64
63
|
return ((_a = this._taskGroupId) !== null && _a !== void 0 ? _a : (this._taskGroupId = new Client_js_1.TaskGroupId(this._options)));
|
|
65
64
|
}
|
|
66
|
-
get s3ObjectMetadata() {
|
|
67
|
-
var _a;
|
|
68
|
-
return ((_a = this._s3ObjectMetadata) !== null && _a !== void 0 ? _a : (this._s3ObjectMetadata = new Client_js_2.S3ObjectMetadata(this._options)));
|
|
69
|
-
}
|
|
70
65
|
get s3Object() {
|
|
71
66
|
var _a;
|
|
72
|
-
return ((_a = this._s3Object) !== null && _a !== void 0 ? _a : (this._s3Object = new
|
|
67
|
+
return ((_a = this._s3Object) !== null && _a !== void 0 ? _a : (this._s3Object = new Client_js_2.S3Object(this._options)));
|
|
73
68
|
}
|
|
74
69
|
get expanded() {
|
|
75
70
|
var _a;
|
|
76
|
-
return ((_a = this._expanded) !== null && _a !== void 0 ? _a : (this._expanded = new
|
|
71
|
+
return ((_a = this._expanded) !== null && _a !== void 0 ? _a : (this._expanded = new Client_js_3.Expanded(this._options)));
|
|
77
72
|
}
|
|
78
73
|
/**
|
|
79
74
|
* Starts a task group by transitioning it from STAGED to IN_PROGRESS and syncing related order state. | authz_personas=[courier_driver, lig_org_operators] | () -> (bool)
|
|
@@ -518,134 +513,6 @@ class TaskGroups {
|
|
|
518
513
|
}
|
|
519
514
|
});
|
|
520
515
|
}
|
|
521
|
-
/**
|
|
522
|
-
* 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)
|
|
523
|
-
*
|
|
524
|
-
* @param {string} taskGroupId
|
|
525
|
-
* @param {Chrt.BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost} request
|
|
526
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
527
|
-
*
|
|
528
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
529
|
-
*
|
|
530
|
-
* @example
|
|
531
|
-
* import { createReadStream } from "fs";
|
|
532
|
-
* await client.taskGroups.addS3ObjectV1("task_group_id", {
|
|
533
|
-
* image: fs.createReadStream("/path/to/your/file")
|
|
534
|
-
* })
|
|
535
|
-
*/
|
|
536
|
-
addS3ObjectV1(taskGroupId, request, requestOptions) {
|
|
537
|
-
return core.HttpResponsePromise.fromPromise(this.__addS3ObjectV1(taskGroupId, request, requestOptions));
|
|
538
|
-
}
|
|
539
|
-
__addS3ObjectV1(taskGroupId, request, requestOptions) {
|
|
540
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
541
|
-
var _a, _b, _c, _d;
|
|
542
|
-
const _request = yield core.newFormData();
|
|
543
|
-
yield _request.appendFile("image", request.image);
|
|
544
|
-
const _maybeEncodedRequest = yield _request.getRequest();
|
|
545
|
-
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
546
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
547
|
-
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)}`),
|
|
548
|
-
method: "POST",
|
|
549
|
-
headers: _headers,
|
|
550
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
551
|
-
requestType: "file",
|
|
552
|
-
duplex: _maybeEncodedRequest.duplex,
|
|
553
|
-
body: _maybeEncodedRequest.body,
|
|
554
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
555
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
556
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
557
|
-
});
|
|
558
|
-
if (_response.ok) {
|
|
559
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
560
|
-
}
|
|
561
|
-
if (_response.error.reason === "status-code") {
|
|
562
|
-
switch (_response.error.statusCode) {
|
|
563
|
-
case 422:
|
|
564
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
565
|
-
default:
|
|
566
|
-
throw new errors.ChrtError({
|
|
567
|
-
statusCode: _response.error.statusCode,
|
|
568
|
-
body: _response.error.body,
|
|
569
|
-
rawResponse: _response.rawResponse,
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
switch (_response.error.reason) {
|
|
574
|
-
case "non-json":
|
|
575
|
-
throw new errors.ChrtError({
|
|
576
|
-
statusCode: _response.error.statusCode,
|
|
577
|
-
body: _response.error.rawBody,
|
|
578
|
-
rawResponse: _response.rawResponse,
|
|
579
|
-
});
|
|
580
|
-
case "timeout":
|
|
581
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_groups/add_s3_object/v1/{task_group_id}.");
|
|
582
|
-
case "unknown":
|
|
583
|
-
throw new errors.ChrtError({
|
|
584
|
-
message: _response.error.errorMessage,
|
|
585
|
-
rawResponse: _response.rawResponse,
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
});
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
* 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)
|
|
592
|
-
*
|
|
593
|
-
* @param {string} taskGroupS3ObjectMetadataId
|
|
594
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
595
|
-
*
|
|
596
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
597
|
-
*
|
|
598
|
-
* @example
|
|
599
|
-
* await client.taskGroups.deleteS3ObjectV1("task_group_s3_object_metadata_id")
|
|
600
|
-
*/
|
|
601
|
-
deleteS3ObjectV1(taskGroupS3ObjectMetadataId, requestOptions) {
|
|
602
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteS3ObjectV1(taskGroupS3ObjectMetadataId, requestOptions));
|
|
603
|
-
}
|
|
604
|
-
__deleteS3ObjectV1(taskGroupS3ObjectMetadataId, requestOptions) {
|
|
605
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
606
|
-
var _a, _b, _c, _d;
|
|
607
|
-
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);
|
|
608
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
609
|
-
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)}`),
|
|
610
|
-
method: "DELETE",
|
|
611
|
-
headers: _headers,
|
|
612
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
613
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
614
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
615
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
616
|
-
});
|
|
617
|
-
if (_response.ok) {
|
|
618
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
619
|
-
}
|
|
620
|
-
if (_response.error.reason === "status-code") {
|
|
621
|
-
switch (_response.error.statusCode) {
|
|
622
|
-
case 422:
|
|
623
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
624
|
-
default:
|
|
625
|
-
throw new errors.ChrtError({
|
|
626
|
-
statusCode: _response.error.statusCode,
|
|
627
|
-
body: _response.error.body,
|
|
628
|
-
rawResponse: _response.rawResponse,
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
switch (_response.error.reason) {
|
|
633
|
-
case "non-json":
|
|
634
|
-
throw new errors.ChrtError({
|
|
635
|
-
statusCode: _response.error.statusCode,
|
|
636
|
-
body: _response.error.rawBody,
|
|
637
|
-
rawResponse: _response.rawResponse,
|
|
638
|
-
});
|
|
639
|
-
case "timeout":
|
|
640
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/task_groups/delete_s3_object/v1/{task_group_s3_object_metadata_id}.");
|
|
641
|
-
case "unknown":
|
|
642
|
-
throw new errors.ChrtError({
|
|
643
|
-
message: _response.error.errorMessage,
|
|
644
|
-
rawResponse: _response.rawResponse,
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
});
|
|
648
|
-
}
|
|
649
516
|
_getAuthorizationHeader() {
|
|
650
517
|
return __awaiter(this, void 0, void 0, function* () {
|
|
651
518
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -3,4 +3,3 @@ export { type SetFlightNumberReq } from "./SetFlightNumberReq.js";
|
|
|
3
3
|
export { type UpdateDriverReq } from "./UpdateDriverReq.js";
|
|
4
4
|
export { type UpdateCourierOrgReq } from "./UpdateCourierOrgReq.js";
|
|
5
5
|
export { type AddMessageReq } from "./AddMessageReq.js";
|
|
6
|
-
export { type BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost } from "./BodyPostAddS3ObjectV1OortTaskGroupsAddS3ObjectV1TaskGroupIdPost.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as expanded from "./expanded/index.js";
|
|
2
2
|
export * from "./expanded/types/index.js";
|
|
3
3
|
export * as taskGroupId from "./taskGroupId/index.js";
|
|
4
|
-
export * as s3ObjectMetadata from "./s3ObjectMetadata/index.js";
|
|
5
4
|
export * as s3Object from "./s3Object/index.js";
|
|
5
|
+
export * from "./s3Object/client/requests/index.js";
|
|
6
6
|
export * from "./expanded/client/requests/index.js";
|
|
@@ -36,10 +36,10 @@ 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 = exports.
|
|
39
|
+
exports.s3Object = exports.taskGroupId = exports.expanded = void 0;
|
|
40
40
|
exports.expanded = __importStar(require("./expanded/index.js"));
|
|
41
41
|
__exportStar(require("./expanded/types/index.js"), exports);
|
|
42
42
|
exports.taskGroupId = __importStar(require("./taskGroupId/index.js"));
|
|
43
|
-
exports.s3ObjectMetadata = __importStar(require("./s3ObjectMetadata/index.js"));
|
|
44
43
|
exports.s3Object = __importStar(require("./s3Object/index.js"));
|
|
44
|
+
__exportStar(require("./s3Object/client/requests/index.js"), exports);
|
|
45
45
|
__exportStar(require("./expanded/client/requests/index.js"), exports);
|