@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
|
@@ -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 @@
|
|
|
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 "
|
|
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
|
|
11
|
+
export interface BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost {
|
|
12
12
|
image: core.file.Uploadable.FileLike;
|
|
13
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost } from "./BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.324.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.
|
|
1
|
+
export const SDK_VERSION = "1.324.0";
|