@chrt-inc/typescript-sdk 1.384.0 → 1.391.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.d.ts +3 -0
- package/dist/cjs/Client.js +15 -10
- package/dist/cjs/api/resources/analytics/client/Client.d.ts +23 -0
- package/dist/cjs/api/resources/analytics/client/Client.js +17 -0
- package/dist/cjs/api/resources/analytics/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/analytics/client/index.js +2 -0
- package/dist/cjs/api/resources/analytics/index.d.ts +2 -0
- package/dist/cjs/api/resources/analytics/index.js +18 -0
- package/dist/cjs/api/resources/analytics/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/analytics/resources/index.js +41 -0
- package/dist/cjs/api/resources/analytics/resources/shipping/client/Client.d.ts +50 -0
- package/dist/cjs/api/resources/analytics/resources/shipping/client/Client.js +133 -0
- package/dist/cjs/api/resources/analytics/resources/shipping/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/analytics/resources/shipping/client/index.js +17 -0
- package/dist/cjs/api/resources/analytics/resources/shipping/client/requests/AnalyticsTimePeriodRequest.d.ts +18 -0
- package/dist/cjs/api/resources/analytics/resources/shipping/client/requests/AnalyticsTimePeriodRequest.js +5 -0
- package/dist/cjs/api/resources/analytics/resources/shipping/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/analytics/resources/shipping/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/analytics/resources/shipping/index.d.ts +1 -0
- package/dist/cjs/api/resources/analytics/resources/shipping/index.js +17 -0
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/Client.js +3 -3
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/requests/BodyLineItemGroupsS3ObjectPostAddV1BillingLineItemGroupsS3ObjectsAddV1LineItemGroupIdPost.d.ts +2 -2
- package/dist/cjs/api/resources/dev/client/Client.d.ts +7 -14
- package/dist/cjs/api/resources/dev/client/Client.js +25 -65
- package/dist/cjs/api/resources/dev/client/requests/AgentReq.d.ts +10 -0
- package/dist/cjs/api/resources/dev/client/requests/AgentReq.js +5 -0
- package/dist/cjs/api/resources/dev/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/Client.js +3 -3
- package/dist/cjs/api/resources/taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.d.ts +2 -2
- package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/Client.js +3 -3
- package/dist/cjs/api/resources/taskGroups/resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.d.ts +2 -2
- package/dist/cjs/api/resources/users/client/Client.d.ts +38 -0
- package/dist/cjs/api/resources/users/client/Client.js +178 -0
- package/dist/cjs/api/resources/users/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/users/client/index.js +15 -0
- package/dist/cjs/api/resources/users/client/requests/UserPrivateDataClientCreate1.d.ts +14 -0
- package/dist/cjs/api/resources/users/client/requests/UserPrivateDataClientCreate1.js +5 -0
- package/dist/cjs/api/resources/users/client/requests/UserPrivateDataClientUpdate1.d.ts +11 -0
- package/dist/cjs/api/resources/users/client/requests/UserPrivateDataClientUpdate1.js +5 -0
- package/dist/cjs/api/resources/users/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/users/client/requests/index.js +2 -0
- package/dist/cjs/api/types/AgentRes.d.ts +8 -0
- package/dist/cjs/api/types/AgentRes.js +5 -0
- package/dist/cjs/api/types/AnalyticsTimeBucketResponse.d.ts +8 -0
- package/dist/cjs/api/types/AnalyticsTimeBucketResponse.js +5 -0
- package/dist/cjs/api/types/LineItemGroupS3ObjectMetadata1.d.ts +4 -0
- package/dist/cjs/api/types/OrderAndTaskGroupExpandedReq.d.ts +1 -0
- package/dist/cjs/api/types/OrderDraftExpanded.d.ts +1 -0
- package/dist/cjs/api/types/OrderExpanded.d.ts +1 -0
- package/dist/cjs/api/types/StartOfWeek.d.ts +13 -0
- package/dist/cjs/api/types/StartOfWeek.js +15 -0
- package/dist/cjs/api/types/TaskArtifactS3ObjectMetadata1.d.ts +4 -0
- package/dist/cjs/api/types/TaskGroupS3ObjectMetadata1.d.ts +4 -0
- package/dist/cjs/api/types/TimeBucket.d.ts +7 -0
- package/dist/cjs/api/types/TimeBucket.js +5 -0
- package/dist/cjs/api/types/TimeGranularity.d.ts +11 -0
- package/dist/cjs/api/types/TimeGranularity.js +13 -0
- package/dist/cjs/api/types/TimezoneEnum.d.ts +23 -0
- package/dist/cjs/api/types/TimezoneEnum.js +25 -0
- package/dist/cjs/api/types/UserPrivateData1.d.ts +12 -0
- package/dist/cjs/api/types/UserPrivateData1.js +5 -0
- package/dist/cjs/api/types/index.d.ts +7 -0
- package/dist/cjs/api/types/index.js +7 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +7 -2
- package/dist/esm/api/resources/analytics/client/Client.d.mts +23 -0
- package/dist/esm/api/resources/analytics/client/Client.mjs +13 -0
- package/dist/esm/api/resources/analytics/client/index.d.mts +1 -0
- package/dist/esm/api/resources/analytics/client/index.mjs +1 -0
- package/dist/esm/api/resources/analytics/index.d.mts +2 -0
- package/dist/esm/api/resources/analytics/index.mjs +2 -0
- package/dist/esm/api/resources/analytics/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/analytics/resources/index.mjs +2 -0
- package/dist/esm/api/resources/analytics/resources/shipping/client/Client.d.mts +50 -0
- package/dist/esm/api/resources/analytics/resources/shipping/client/Client.mjs +96 -0
- package/dist/esm/api/resources/analytics/resources/shipping/client/index.d.mts +2 -0
- package/dist/esm/api/resources/analytics/resources/shipping/client/index.mjs +1 -0
- package/dist/esm/api/resources/analytics/resources/shipping/client/requests/AnalyticsTimePeriodRequest.d.mts +18 -0
- package/dist/esm/api/resources/analytics/resources/shipping/client/requests/AnalyticsTimePeriodRequest.mjs +4 -0
- package/dist/esm/api/resources/analytics/resources/shipping/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/analytics/resources/shipping/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/analytics/resources/shipping/index.d.mts +1 -0
- package/dist/esm/api/resources/analytics/resources/shipping/index.mjs +1 -0
- package/dist/esm/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/Client.mjs +3 -3
- package/dist/esm/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/requests/BodyLineItemGroupsS3ObjectPostAddV1BillingLineItemGroupsS3ObjectsAddV1LineItemGroupIdPost.d.mts +2 -2
- package/dist/esm/api/resources/dev/client/Client.d.mts +7 -14
- package/dist/esm/api/resources/dev/client/Client.mjs +25 -65
- package/dist/esm/api/resources/dev/client/requests/AgentReq.d.mts +10 -0
- package/dist/esm/api/resources/dev/client/requests/AgentReq.mjs +4 -0
- package/dist/esm/api/resources/dev/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/Client.mjs +3 -3
- package/dist/esm/api/resources/taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.d.mts +2 -2
- package/dist/esm/api/resources/taskGroups/resources/s3Object/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/taskGroups/resources/s3Object/client/Client.mjs +3 -3
- package/dist/esm/api/resources/taskGroups/resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost.d.mts +2 -2
- package/dist/esm/api/resources/users/client/Client.d.mts +38 -0
- package/dist/esm/api/resources/users/client/Client.mjs +178 -0
- package/dist/esm/api/resources/users/client/index.d.mts +1 -0
- package/dist/esm/api/resources/users/client/index.mjs +1 -1
- package/dist/esm/api/resources/users/client/requests/UserPrivateDataClientCreate1.d.mts +14 -0
- package/dist/esm/api/resources/users/client/requests/UserPrivateDataClientCreate1.mjs +4 -0
- package/dist/esm/api/resources/users/client/requests/UserPrivateDataClientUpdate1.d.mts +11 -0
- package/dist/esm/api/resources/users/client/requests/UserPrivateDataClientUpdate1.mjs +4 -0
- package/dist/esm/api/resources/users/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/users/client/requests/index.mjs +1 -0
- package/dist/esm/api/types/AgentRes.d.mts +8 -0
- package/dist/esm/api/types/AgentRes.mjs +4 -0
- package/dist/esm/api/types/AnalyticsTimeBucketResponse.d.mts +8 -0
- package/dist/esm/api/types/AnalyticsTimeBucketResponse.mjs +4 -0
- package/dist/esm/api/types/LineItemGroupS3ObjectMetadata1.d.mts +4 -0
- package/dist/esm/api/types/OrderAndTaskGroupExpandedReq.d.mts +1 -0
- package/dist/esm/api/types/OrderDraftExpanded.d.mts +1 -0
- package/dist/esm/api/types/OrderExpanded.d.mts +1 -0
- package/dist/esm/api/types/StartOfWeek.d.mts +13 -0
- package/dist/esm/api/types/StartOfWeek.mjs +12 -0
- package/dist/esm/api/types/TaskArtifactS3ObjectMetadata1.d.mts +4 -0
- package/dist/esm/api/types/TaskGroupS3ObjectMetadata1.d.mts +4 -0
- package/dist/esm/api/types/TimeBucket.d.mts +7 -0
- package/dist/esm/api/types/TimeBucket.mjs +4 -0
- package/dist/esm/api/types/TimeGranularity.d.mts +11 -0
- package/dist/esm/api/types/TimeGranularity.mjs +10 -0
- package/dist/esm/api/types/TimezoneEnum.d.mts +23 -0
- package/dist/esm/api/types/TimezoneEnum.mjs +22 -0
- package/dist/esm/api/types/UserPrivateData1.d.mts +12 -0
- package/dist/esm/api/types/UserPrivateData1.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +7 -0
- package/dist/esm/api/types/index.mjs +7 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +268 -64
|
@@ -132,7 +132,7 @@ export class S3Objects {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
* Uploads
|
|
135
|
+
* Uploads a file (image, PDF, etc.) to a line item group. Automatic blurhash generation for images. | authz_personas=[lig_org_operators, lig_driver] | (UploadFile) -> (bool)
|
|
136
136
|
*
|
|
137
137
|
* @param {string} lineItemGroupId
|
|
138
138
|
* @param {Chrt.billing.lineItemGroups.BodyLineItemGroupsS3ObjectPostAddV1BillingLineItemGroupsS3ObjectsAddV1LineItemGroupIdPost} request
|
|
@@ -143,7 +143,7 @@ export class S3Objects {
|
|
|
143
143
|
* @example
|
|
144
144
|
* import { createReadStream } from "fs";
|
|
145
145
|
* await client.billing.lineItemGroups.s3Objects.addV1("line_item_group_id", {
|
|
146
|
-
*
|
|
146
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
147
147
|
* })
|
|
148
148
|
*/
|
|
149
149
|
addV1(lineItemGroupId, request, requestOptions) {
|
|
@@ -153,7 +153,7 @@ export class S3Objects {
|
|
|
153
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
154
154
|
var _a, _b, _c, _d;
|
|
155
155
|
const _request = yield core.newFormData();
|
|
156
|
-
yield _request.appendFile("
|
|
156
|
+
yield _request.appendFile("file", request.file);
|
|
157
157
|
const _maybeEncodedRequest = yield _request.getRequest();
|
|
158
158
|
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);
|
|
159
159
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -5,9 +5,9 @@ import * as core from "../../../../../../../../../core/index.mjs";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
*
|
|
8
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface BodyLineItemGroupsS3ObjectPostAddV1BillingLineItemGroupsS3ObjectsAddV1LineItemGroupIdPost {
|
|
12
|
-
|
|
12
|
+
file: core.file.Uploadable.FileLike;
|
|
13
13
|
}
|
|
@@ -31,15 +31,18 @@ export declare class Dev {
|
|
|
31
31
|
protected readonly _options: Dev.Options;
|
|
32
32
|
constructor(_options?: Dev.Options);
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Runs a customer service agent that responds with logistics fun facts (real order data not yet available). | (AgentReq) -> (AgentRes)
|
|
35
35
|
*
|
|
36
|
+
* @param {Chrt.AgentReq} request
|
|
36
37
|
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
38
|
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
38
41
|
* @example
|
|
39
|
-
* await client.dev.
|
|
42
|
+
* await client.dev.postAgentV1()
|
|
40
43
|
*/
|
|
41
|
-
|
|
42
|
-
private
|
|
44
|
+
postAgentV1(request?: Chrt.AgentReq, requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Chrt.AgentRes>;
|
|
45
|
+
private __postAgentV1;
|
|
43
46
|
/**
|
|
44
47
|
* (DEPRECATED) Extracts and returns the user ID from the authenticated request's JWT token. | () -> (str)
|
|
45
48
|
*
|
|
@@ -80,16 +83,6 @@ export declare class Dev {
|
|
|
80
83
|
*/
|
|
81
84
|
getEmailV1(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
|
|
82
85
|
private __getEmailV1;
|
|
83
|
-
/**
|
|
84
|
-
* Experimental endpoint for running durable execution workflows. Returns the caller's ID for testing purposes. | () -> (dict[str, Any])
|
|
85
|
-
*
|
|
86
|
-
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* await client.dev.getDurableV1()
|
|
90
|
-
*/
|
|
91
|
-
getDurableV1(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Record<string, unknown>>;
|
|
92
|
-
private __getDurableV1;
|
|
93
86
|
/**
|
|
94
87
|
* Development template endpoint that returns the caller's ID for testing. | () -> (str)
|
|
95
88
|
*
|
|
@@ -12,33 +12,39 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
};
|
|
13
13
|
import * as environments from "../../../../environments.mjs";
|
|
14
14
|
import * as core from "../../../../core/index.mjs";
|
|
15
|
+
import * as Chrt from "../../../index.mjs";
|
|
15
16
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
16
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
-
import * as Chrt from "../../../index.mjs";
|
|
18
18
|
export class Dev {
|
|
19
19
|
constructor(_options = {}) {
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Runs a customer service agent that responds with logistics fun facts (real order data not yet available). | (AgentReq) -> (AgentRes)
|
|
24
24
|
*
|
|
25
|
+
* @param {Chrt.AgentReq} request
|
|
25
26
|
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
27
|
*
|
|
28
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
|
+
*
|
|
27
30
|
* @example
|
|
28
|
-
* await client.dev.
|
|
31
|
+
* await client.dev.postAgentV1()
|
|
29
32
|
*/
|
|
30
|
-
|
|
31
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
33
|
+
postAgentV1(request = {}, requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__postAgentV1(request, requestOptions));
|
|
32
35
|
}
|
|
33
|
-
|
|
34
|
-
return __awaiter(this,
|
|
36
|
+
__postAgentV1() {
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
35
38
|
var _a, _b, _c, _d;
|
|
36
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);
|
|
37
40
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
38
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, "dev/agent/v1"),
|
|
39
|
-
method: "
|
|
42
|
+
method: "POST",
|
|
40
43
|
headers: _headers,
|
|
44
|
+
contentType: "application/json",
|
|
41
45
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
46
|
+
requestType: "json",
|
|
47
|
+
body: request,
|
|
42
48
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
43
49
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
44
50
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -47,11 +53,16 @@ export class Dev {
|
|
|
47
53
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
48
54
|
}
|
|
49
55
|
if (_response.error.reason === "status-code") {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
switch (_response.error.statusCode) {
|
|
57
|
+
case 422:
|
|
58
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
59
|
+
default:
|
|
60
|
+
throw new errors.ChrtError({
|
|
61
|
+
statusCode: _response.error.statusCode,
|
|
62
|
+
body: _response.error.body,
|
|
63
|
+
rawResponse: _response.rawResponse,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
55
66
|
}
|
|
56
67
|
switch (_response.error.reason) {
|
|
57
68
|
case "non-json":
|
|
@@ -61,7 +72,7 @@ export class Dev {
|
|
|
61
72
|
rawResponse: _response.rawResponse,
|
|
62
73
|
});
|
|
63
74
|
case "timeout":
|
|
64
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
75
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /dev/agent/v1.");
|
|
65
76
|
case "unknown":
|
|
66
77
|
throw new errors.ChrtError({
|
|
67
78
|
message: _response.error.errorMessage,
|
|
@@ -274,57 +285,6 @@ export class Dev {
|
|
|
274
285
|
}
|
|
275
286
|
});
|
|
276
287
|
}
|
|
277
|
-
/**
|
|
278
|
-
* Experimental endpoint for running durable execution workflows. Returns the caller's ID for testing purposes. | () -> (dict[str, Any])
|
|
279
|
-
*
|
|
280
|
-
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
281
|
-
*
|
|
282
|
-
* @example
|
|
283
|
-
* await client.dev.getDurableV1()
|
|
284
|
-
*/
|
|
285
|
-
getDurableV1(requestOptions) {
|
|
286
|
-
return core.HttpResponsePromise.fromPromise(this.__getDurableV1(requestOptions));
|
|
287
|
-
}
|
|
288
|
-
__getDurableV1(requestOptions) {
|
|
289
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
290
|
-
var _a, _b, _c, _d;
|
|
291
|
-
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);
|
|
292
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
293
|
-
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, "dev/durable/v1"),
|
|
294
|
-
method: "GET",
|
|
295
|
-
headers: _headers,
|
|
296
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
297
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
298
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
299
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
300
|
-
});
|
|
301
|
-
if (_response.ok) {
|
|
302
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
303
|
-
}
|
|
304
|
-
if (_response.error.reason === "status-code") {
|
|
305
|
-
throw new errors.ChrtError({
|
|
306
|
-
statusCode: _response.error.statusCode,
|
|
307
|
-
body: _response.error.body,
|
|
308
|
-
rawResponse: _response.rawResponse,
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
switch (_response.error.reason) {
|
|
312
|
-
case "non-json":
|
|
313
|
-
throw new errors.ChrtError({
|
|
314
|
-
statusCode: _response.error.statusCode,
|
|
315
|
-
body: _response.error.rawBody,
|
|
316
|
-
rawResponse: _response.rawResponse,
|
|
317
|
-
});
|
|
318
|
-
case "timeout":
|
|
319
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/durable/v1.");
|
|
320
|
-
case "unknown":
|
|
321
|
-
throw new errors.ChrtError({
|
|
322
|
-
message: _response.error.errorMessage,
|
|
323
|
-
rawResponse: _response.rawResponse,
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
288
|
/**
|
|
329
289
|
* Development template endpoint that returns the caller's ID for testing. | () -> (str)
|
|
330
290
|
*
|
|
@@ -18,6 +18,7 @@ export * as orgs from "./orgs/index.mjs";
|
|
|
18
18
|
export * as root from "./root/index.mjs";
|
|
19
19
|
export * as users from "./users/index.mjs";
|
|
20
20
|
export * as utils from "./utils/index.mjs";
|
|
21
|
+
export * as analytics from "./analytics/index.mjs";
|
|
21
22
|
export * as notifications from "./notifications/index.mjs";
|
|
22
23
|
export * as orgInfoForConnections from "./orgInfoForConnections/index.mjs";
|
|
23
24
|
export * as tracking from "./tracking/index.mjs";
|
|
@@ -32,4 +33,5 @@ export * from "./taskGroups/client/requests/index.mjs";
|
|
|
32
33
|
export * from "./tasks/client/requests/index.mjs";
|
|
33
34
|
export * from "./directoryEntries/client/requests/index.mjs";
|
|
34
35
|
export * from "./orgs/client/requests/index.mjs";
|
|
36
|
+
export * from "./users/client/requests/index.mjs";
|
|
35
37
|
export * from "./utils/client/requests/index.mjs";
|
|
@@ -18,6 +18,7 @@ export * as orgs from "./orgs/index.mjs";
|
|
|
18
18
|
export * as root from "./root/index.mjs";
|
|
19
19
|
export * as users from "./users/index.mjs";
|
|
20
20
|
export * as utils from "./utils/index.mjs";
|
|
21
|
+
export * as analytics from "./analytics/index.mjs";
|
|
21
22
|
export * as notifications from "./notifications/index.mjs";
|
|
22
23
|
export * as orgInfoForConnections from "./orgInfoForConnections/index.mjs";
|
|
23
24
|
export * as tracking from "./tracking/index.mjs";
|
|
@@ -32,4 +33,5 @@ export * from "./taskGroups/client/requests/index.mjs";
|
|
|
32
33
|
export * from "./tasks/client/requests/index.mjs";
|
|
33
34
|
export * from "./directoryEntries/client/requests/index.mjs";
|
|
34
35
|
export * from "./orgs/client/requests/index.mjs";
|
|
36
|
+
export * from "./users/client/requests/index.mjs";
|
|
35
37
|
export * from "./utils/client/requests/index.mjs";
|
|
@@ -50,7 +50,7 @@ export declare class S3Object {
|
|
|
50
50
|
getV1(taskArtifactS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
51
51
|
private __getV1;
|
|
52
52
|
/**
|
|
53
|
-
* Uploads
|
|
53
|
+
* Uploads a file (image, PDF, etc.) to a task artifact. Automatic blurhash generation for images. | authz_personas=[courier_driver, forwarder_org_operators, courier_org_operators, shipper_org_operators] | (UploadFile) -> (bool)
|
|
54
54
|
*
|
|
55
55
|
* @param {string} taskArtifactId
|
|
56
56
|
* @param {Chrt.taskArtifacts.BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost} request
|
|
@@ -61,7 +61,7 @@ export declare class S3Object {
|
|
|
61
61
|
* @example
|
|
62
62
|
* import { createReadStream } from "fs";
|
|
63
63
|
* await client.taskArtifacts.s3Object.addV1("task_artifact_id", {
|
|
64
|
-
*
|
|
64
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
65
65
|
* })
|
|
66
66
|
*/
|
|
67
67
|
addV1(taskArtifactId: string, request: Chrt.taskArtifacts.BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
@@ -132,7 +132,7 @@ export class S3Object {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
* Uploads
|
|
135
|
+
* Uploads a file (image, PDF, etc.) to a task artifact. Automatic blurhash generation for images. | authz_personas=[courier_driver, forwarder_org_operators, courier_org_operators, shipper_org_operators] | (UploadFile) -> (bool)
|
|
136
136
|
*
|
|
137
137
|
* @param {string} taskArtifactId
|
|
138
138
|
* @param {Chrt.taskArtifacts.BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost} request
|
|
@@ -143,7 +143,7 @@ export class S3Object {
|
|
|
143
143
|
* @example
|
|
144
144
|
* import { createReadStream } from "fs";
|
|
145
145
|
* await client.taskArtifacts.s3Object.addV1("task_artifact_id", {
|
|
146
|
-
*
|
|
146
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
147
147
|
* })
|
|
148
148
|
*/
|
|
149
149
|
addV1(taskArtifactId, request, requestOptions) {
|
|
@@ -153,7 +153,7 @@ export class S3Object {
|
|
|
153
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
154
154
|
var _a, _b, _c, _d;
|
|
155
155
|
const _request = yield core.newFormData();
|
|
156
|
-
yield _request.appendFile("
|
|
156
|
+
yield _request.appendFile("file", request.file);
|
|
157
157
|
const _maybeEncodedRequest = yield _request.getRequest();
|
|
158
158
|
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);
|
|
159
159
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -5,9 +5,9 @@ import * as core from "../../../../../../../core/index.mjs";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
*
|
|
8
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface BodyPostTaskArtifactsS3ObjectAddV1OortTaskArtifactsS3ObjectAddV1TaskArtifactIdPost {
|
|
12
|
-
|
|
12
|
+
file: core.file.Uploadable.FileLike;
|
|
13
13
|
}
|
|
@@ -50,7 +50,7 @@ export declare class S3Object {
|
|
|
50
50
|
getV1(taskGroupS3ObjectMetadataId: string, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
51
51
|
private __getV1;
|
|
52
52
|
/**
|
|
53
|
-
* Uploads
|
|
53
|
+
* Uploads a file (image, PDF, etc.) to a task group. Automatic blurhash generation for images. | authz_personas=[courier_driver, courier_org_operators, forwarder_org_operators, shipper_org_operators] | (UploadFile) -> (bool)
|
|
54
54
|
*
|
|
55
55
|
* @param {string} taskGroupId
|
|
56
56
|
* @param {Chrt.taskGroups.BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost} request
|
|
@@ -61,7 +61,7 @@ export declare class S3Object {
|
|
|
61
61
|
* @example
|
|
62
62
|
* import { createReadStream } from "fs";
|
|
63
63
|
* await client.taskGroups.s3Object.addV1("task_group_id", {
|
|
64
|
-
*
|
|
64
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
65
65
|
* })
|
|
66
66
|
*/
|
|
67
67
|
addV1(taskGroupId: string, request: Chrt.taskGroups.BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost, requestOptions?: S3Object.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
@@ -132,7 +132,7 @@ export class S3Object {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
* Uploads
|
|
135
|
+
* Uploads a file (image, PDF, etc.) to a task group. Automatic blurhash generation for images. | authz_personas=[courier_driver, courier_org_operators, forwarder_org_operators, shipper_org_operators] | (UploadFile) -> (bool)
|
|
136
136
|
*
|
|
137
137
|
* @param {string} taskGroupId
|
|
138
138
|
* @param {Chrt.taskGroups.BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost} request
|
|
@@ -143,7 +143,7 @@ export class S3Object {
|
|
|
143
143
|
* @example
|
|
144
144
|
* import { createReadStream } from "fs";
|
|
145
145
|
* await client.taskGroups.s3Object.addV1("task_group_id", {
|
|
146
|
-
*
|
|
146
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
147
147
|
* })
|
|
148
148
|
*/
|
|
149
149
|
addV1(taskGroupId, request, requestOptions) {
|
|
@@ -153,7 +153,7 @@ export class S3Object {
|
|
|
153
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
154
154
|
var _a, _b, _c, _d;
|
|
155
155
|
const _request = yield core.newFormData();
|
|
156
|
-
yield _request.appendFile("
|
|
156
|
+
yield _request.appendFile("file", request.file);
|
|
157
157
|
const _maybeEncodedRequest = yield _request.getRequest();
|
|
158
158
|
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);
|
|
159
159
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
@@ -5,9 +5,9 @@ import * as core from "../../../../../../../core/index.mjs";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
*
|
|
8
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface BodyPostTaskGroupsS3ObjectAddV1OortTaskGroupsS3ObjectAddV1TaskGroupIdPost {
|
|
12
|
-
|
|
12
|
+
file: core.file.Uploadable.FileLike;
|
|
13
13
|
}
|
|
@@ -40,5 +40,43 @@ export declare class Users {
|
|
|
40
40
|
*/
|
|
41
41
|
getUserPublicDataV1(requestOptions?: Users.RequestOptions): core.HttpResponsePromise<Chrt.UserPublicData1>;
|
|
42
42
|
private __getUserPublicDataV1;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves private user data for the caller. | () -> (UserPrivateData1)
|
|
45
|
+
*
|
|
46
|
+
* @param {Users.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* await client.users.getUserPrivateDataV1()
|
|
50
|
+
*/
|
|
51
|
+
getUserPrivateDataV1(requestOptions?: Users.RequestOptions): core.HttpResponsePromise<Chrt.UserPrivateData1>;
|
|
52
|
+
private __getUserPrivateDataV1;
|
|
53
|
+
/**
|
|
54
|
+
* Creates private user data for the caller. | (UserPrivateDataClientCreate1) -> (UserPrivateData1)
|
|
55
|
+
*
|
|
56
|
+
* @param {Chrt.UserPrivateDataClientCreate1} request
|
|
57
|
+
* @param {Users.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
|
+
*
|
|
59
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* await client.users.createUserPrivateDataV1({
|
|
63
|
+
* schema_version: 1
|
|
64
|
+
* })
|
|
65
|
+
*/
|
|
66
|
+
createUserPrivateDataV1(request: Chrt.UserPrivateDataClientCreate1, requestOptions?: Users.RequestOptions): core.HttpResponsePromise<Chrt.UserPrivateData1>;
|
|
67
|
+
private __createUserPrivateDataV1;
|
|
68
|
+
/**
|
|
69
|
+
* Updates private user data for the caller. | (UserPrivateDataClientUpdate1) -> (UserPrivateData1)
|
|
70
|
+
*
|
|
71
|
+
* @param {Chrt.UserPrivateDataClientUpdate1} request
|
|
72
|
+
* @param {Users.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
|
+
*
|
|
74
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* await client.users.updateUserPrivateDataV1()
|
|
78
|
+
*/
|
|
79
|
+
updateUserPrivateDataV1(request?: Chrt.UserPrivateDataClientUpdate1, requestOptions?: Users.RequestOptions): core.HttpResponsePromise<Chrt.UserPrivateData1>;
|
|
80
|
+
private __updateUserPrivateDataV1;
|
|
43
81
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
44
82
|
}
|
|
@@ -12,6 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
};
|
|
13
13
|
import * as environments from "../../../../environments.mjs";
|
|
14
14
|
import * as core from "../../../../core/index.mjs";
|
|
15
|
+
import * as Chrt from "../../../index.mjs";
|
|
15
16
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
16
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
18
|
export class Users {
|
|
@@ -69,6 +70,183 @@ export class Users {
|
|
|
69
70
|
}
|
|
70
71
|
});
|
|
71
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Retrieves private user data for the caller. | () -> (UserPrivateData1)
|
|
75
|
+
*
|
|
76
|
+
* @param {Users.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* await client.users.getUserPrivateDataV1()
|
|
80
|
+
*/
|
|
81
|
+
getUserPrivateDataV1(requestOptions) {
|
|
82
|
+
return core.HttpResponsePromise.fromPromise(this.__getUserPrivateDataV1(requestOptions));
|
|
83
|
+
}
|
|
84
|
+
__getUserPrivateDataV1(requestOptions) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
var _a, _b, _c, _d;
|
|
87
|
+
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);
|
|
88
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
89
|
+
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, "users/user_private_data/v1"),
|
|
90
|
+
method: "GET",
|
|
91
|
+
headers: _headers,
|
|
92
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
93
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
94
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
95
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
96
|
+
});
|
|
97
|
+
if (_response.ok) {
|
|
98
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
99
|
+
}
|
|
100
|
+
if (_response.error.reason === "status-code") {
|
|
101
|
+
throw new errors.ChrtError({
|
|
102
|
+
statusCode: _response.error.statusCode,
|
|
103
|
+
body: _response.error.body,
|
|
104
|
+
rawResponse: _response.rawResponse,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
switch (_response.error.reason) {
|
|
108
|
+
case "non-json":
|
|
109
|
+
throw new errors.ChrtError({
|
|
110
|
+
statusCode: _response.error.statusCode,
|
|
111
|
+
body: _response.error.rawBody,
|
|
112
|
+
rawResponse: _response.rawResponse,
|
|
113
|
+
});
|
|
114
|
+
case "timeout":
|
|
115
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /users/user_private_data/v1.");
|
|
116
|
+
case "unknown":
|
|
117
|
+
throw new errors.ChrtError({
|
|
118
|
+
message: _response.error.errorMessage,
|
|
119
|
+
rawResponse: _response.rawResponse,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Creates private user data for the caller. | (UserPrivateDataClientCreate1) -> (UserPrivateData1)
|
|
126
|
+
*
|
|
127
|
+
* @param {Chrt.UserPrivateDataClientCreate1} request
|
|
128
|
+
* @param {Users.RequestOptions} requestOptions - Request-specific configuration.
|
|
129
|
+
*
|
|
130
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* await client.users.createUserPrivateDataV1({
|
|
134
|
+
* schema_version: 1
|
|
135
|
+
* })
|
|
136
|
+
*/
|
|
137
|
+
createUserPrivateDataV1(request, requestOptions) {
|
|
138
|
+
return core.HttpResponsePromise.fromPromise(this.__createUserPrivateDataV1(request, requestOptions));
|
|
139
|
+
}
|
|
140
|
+
__createUserPrivateDataV1(request, requestOptions) {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
var _a, _b, _c, _d;
|
|
143
|
+
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);
|
|
144
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
145
|
+
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, "users/user_private_data/v1"),
|
|
146
|
+
method: "POST",
|
|
147
|
+
headers: _headers,
|
|
148
|
+
contentType: "application/json",
|
|
149
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
150
|
+
requestType: "json",
|
|
151
|
+
body: request,
|
|
152
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
153
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
154
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
155
|
+
});
|
|
156
|
+
if (_response.ok) {
|
|
157
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
158
|
+
}
|
|
159
|
+
if (_response.error.reason === "status-code") {
|
|
160
|
+
switch (_response.error.statusCode) {
|
|
161
|
+
case 422:
|
|
162
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
163
|
+
default:
|
|
164
|
+
throw new errors.ChrtError({
|
|
165
|
+
statusCode: _response.error.statusCode,
|
|
166
|
+
body: _response.error.body,
|
|
167
|
+
rawResponse: _response.rawResponse,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
switch (_response.error.reason) {
|
|
172
|
+
case "non-json":
|
|
173
|
+
throw new errors.ChrtError({
|
|
174
|
+
statusCode: _response.error.statusCode,
|
|
175
|
+
body: _response.error.rawBody,
|
|
176
|
+
rawResponse: _response.rawResponse,
|
|
177
|
+
});
|
|
178
|
+
case "timeout":
|
|
179
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /users/user_private_data/v1.");
|
|
180
|
+
case "unknown":
|
|
181
|
+
throw new errors.ChrtError({
|
|
182
|
+
message: _response.error.errorMessage,
|
|
183
|
+
rawResponse: _response.rawResponse,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Updates private user data for the caller. | (UserPrivateDataClientUpdate1) -> (UserPrivateData1)
|
|
190
|
+
*
|
|
191
|
+
* @param {Chrt.UserPrivateDataClientUpdate1} request
|
|
192
|
+
* @param {Users.RequestOptions} requestOptions - Request-specific configuration.
|
|
193
|
+
*
|
|
194
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* await client.users.updateUserPrivateDataV1()
|
|
198
|
+
*/
|
|
199
|
+
updateUserPrivateDataV1(request = {}, requestOptions) {
|
|
200
|
+
return core.HttpResponsePromise.fromPromise(this.__updateUserPrivateDataV1(request, requestOptions));
|
|
201
|
+
}
|
|
202
|
+
__updateUserPrivateDataV1() {
|
|
203
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
204
|
+
var _a, _b, _c, _d;
|
|
205
|
+
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);
|
|
206
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
207
|
+
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, "users/user_private_data/v1"),
|
|
208
|
+
method: "PATCH",
|
|
209
|
+
headers: _headers,
|
|
210
|
+
contentType: "application/json",
|
|
211
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
212
|
+
requestType: "json",
|
|
213
|
+
body: request,
|
|
214
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
215
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
216
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
217
|
+
});
|
|
218
|
+
if (_response.ok) {
|
|
219
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
220
|
+
}
|
|
221
|
+
if (_response.error.reason === "status-code") {
|
|
222
|
+
switch (_response.error.statusCode) {
|
|
223
|
+
case 422:
|
|
224
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
225
|
+
default:
|
|
226
|
+
throw new errors.ChrtError({
|
|
227
|
+
statusCode: _response.error.statusCode,
|
|
228
|
+
body: _response.error.body,
|
|
229
|
+
rawResponse: _response.rawResponse,
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
switch (_response.error.reason) {
|
|
234
|
+
case "non-json":
|
|
235
|
+
throw new errors.ChrtError({
|
|
236
|
+
statusCode: _response.error.statusCode,
|
|
237
|
+
body: _response.error.rawBody,
|
|
238
|
+
rawResponse: _response.rawResponse,
|
|
239
|
+
});
|
|
240
|
+
case "timeout":
|
|
241
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /users/user_private_data/v1.");
|
|
242
|
+
case "unknown":
|
|
243
|
+
throw new errors.ChrtError({
|
|
244
|
+
message: _response.error.errorMessage,
|
|
245
|
+
rawResponse: _response.rawResponse,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
72
250
|
_getAuthorizationHeader() {
|
|
73
251
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
252
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./requests/index.mjs";
|