@chrt-inc/typescript-sdk 1.441.1 → 1.448.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/README.md +11 -9
- package/dist/cjs/Client.d.ts +3 -3
- package/dist/cjs/Client.js +19 -19
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/Client.js +2 -2
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/requests/BodyLineItemGroupsS3ObjectPostAddV1BillingLineItemGroupsS3ObjectsAddV1LineItemGroupIdPost.d.ts +2 -3
- package/dist/cjs/api/resources/index.d.ts +1 -2
- package/dist/cjs/api/resources/index.js +2 -3
- package/dist/cjs/api/resources/orgs/client/Client.d.ts +6 -72
- package/dist/cjs/api/resources/orgs/client/Client.js +14 -348
- package/dist/cjs/api/resources/orgs/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/orgs/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/orgs/resources/index.js +4 -1
- package/dist/cjs/api/resources/orgs/resources/privateData/client/Client.d.ts +44 -0
- package/dist/cjs/api/resources/orgs/resources/privateData/client/Client.js +118 -0
- package/dist/cjs/api/resources/orgs/resources/privateData/index.d.ts +1 -0
- package/dist/cjs/{core/exports.js → api/resources/orgs/resources/privateData/index.js} +1 -1
- package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.d.ts +96 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/client/Client.js +361 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/client/index.d.ts +2 -0
- package/dist/cjs/{core/file → api/resources/orgs/resources/publicData/client}/index.js +1 -2
- package/dist/cjs/api/resources/orgs/resources/publicData/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/orgs/resources/publicData/index.d.ts +1 -0
- package/dist/cjs/{exports.js → api/resources/orgs/resources/publicData/index.js} +1 -1
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.js +2 -2
- package/dist/cjs/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1ShippingTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.d.ts +2 -3
- package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/s3Object/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/s3Object/client/Client.js +2 -2
- package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1ShippingTaskGroupsS3ObjectAddV1TaskGroupIdPost.d.ts +2 -3
- package/dist/cjs/api/resources/users/client/Client.d.ts +6 -77
- package/dist/cjs/api/resources/users/client/Client.js +11 -349
- package/dist/cjs/api/resources/users/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/users/client/index.js +0 -15
- package/dist/cjs/api/resources/users/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/users/resources/index.js +4 -1
- package/dist/cjs/api/resources/users/resources/privateData/client/Client.d.ts +87 -0
- package/dist/cjs/api/resources/users/resources/privateData/client/Client.js +309 -0
- package/dist/cjs/api/resources/users/resources/privateData/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/users/resources/privateData/client/index.js +17 -0
- package/dist/cjs/api/resources/users/{client → resources/privateData/client}/requests/FirebaseCloudMessagingTokenClientCreate1.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/privateData/index.d.ts +1 -0
- package/dist/cjs/api/resources/users/resources/privateData/index.js +17 -0
- package/dist/cjs/api/resources/users/resources/publicData/client/Client.d.ts +44 -0
- package/dist/cjs/api/resources/users/resources/publicData/client/Client.js +118 -0
- package/dist/cjs/api/resources/users/resources/publicData/client/index.js +2 -0
- package/dist/cjs/api/resources/users/resources/publicData/index.d.ts +1 -0
- package/dist/cjs/api/resources/users/resources/publicData/index.js +17 -0
- package/dist/cjs/api/types/TaskArtifactS3ObjectMetadata1.d.ts +1 -1
- package/dist/cjs/api/types/TaskGroupS3ObjectMetadata1.d.ts +1 -1
- package/dist/cjs/api/types/ValidationError.d.ts +2 -0
- package/dist/cjs/core/index.d.ts +0 -1
- package/dist/cjs/core/index.js +1 -2
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.js +0 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -3
- package/dist/esm/Client.mjs +7 -7
- package/dist/esm/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/Client.mjs +2 -2
- package/dist/esm/api/resources/billing/resources/lineItemGroups/resources/s3Objects/client/requests/BodyLineItemGroupsS3ObjectPostAddV1BillingLineItemGroupsS3ObjectsAddV1LineItemGroupIdPost.d.mts +2 -3
- package/dist/esm/api/resources/index.d.mts +1 -2
- package/dist/esm/api/resources/index.mjs +1 -2
- package/dist/esm/api/resources/orgs/client/Client.d.mts +6 -72
- package/dist/esm/api/resources/orgs/client/Client.mjs +10 -344
- package/dist/esm/api/resources/orgs/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/orgs/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/orgs/resources/index.mjs +3 -0
- package/dist/esm/api/resources/orgs/resources/privateData/client/Client.d.mts +44 -0
- package/dist/esm/api/resources/orgs/resources/privateData/client/Client.mjs +81 -0
- package/dist/esm/api/resources/orgs/resources/privateData/client/index.mjs +1 -0
- package/dist/esm/api/resources/orgs/resources/privateData/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/privateData/index.mjs +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/client/Client.d.mts +96 -0
- package/dist/esm/api/resources/orgs/resources/publicData/client/Client.mjs +324 -0
- package/dist/esm/api/resources/orgs/resources/publicData/client/index.d.mts +2 -0
- package/dist/esm/api/resources/orgs/resources/publicData/client/index.mjs +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/orgs/resources/publicData/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/publicData/index.mjs +1 -0
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/Client.mjs +2 -2
- package/dist/esm/api/resources/shipping/resources/taskArtifacts/resources/s3Object/client/requests/BodyPostTaskArtifactsS3ObjectAddV1ShippingTaskArtifactsS3ObjectAddV1TaskArtifactIdPost.d.mts +2 -3
- package/dist/esm/api/resources/shipping/resources/taskGroups/resources/s3Object/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/shipping/resources/taskGroups/resources/s3Object/client/Client.mjs +2 -2
- package/dist/esm/api/resources/shipping/resources/taskGroups/resources/s3Object/client/requests/BodyPostTaskGroupsS3ObjectAddV1ShippingTaskGroupsS3ObjectAddV1TaskGroupIdPost.d.mts +2 -3
- package/dist/esm/api/resources/users/client/Client.d.mts +6 -77
- package/dist/esm/api/resources/users/client/Client.mjs +10 -315
- package/dist/esm/api/resources/users/client/index.d.mts +0 -1
- package/dist/esm/api/resources/users/client/index.mjs +1 -1
- package/dist/esm/api/resources/users/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/users/resources/index.mjs +3 -0
- package/dist/esm/api/resources/users/resources/privateData/client/Client.d.mts +87 -0
- package/dist/esm/api/resources/users/resources/privateData/client/Client.mjs +272 -0
- package/dist/esm/api/resources/users/resources/privateData/client/index.d.mts +2 -0
- package/dist/esm/api/resources/users/resources/privateData/client/index.mjs +1 -0
- package/dist/esm/api/resources/users/{client → resources/privateData/client}/requests/FirebaseCloudMessagingTokenClientCreate1.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/privateData/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/users/resources/privateData/index.d.mts +1 -0
- package/dist/esm/api/resources/users/resources/privateData/index.mjs +1 -0
- package/dist/esm/api/resources/users/resources/publicData/client/Client.d.mts +44 -0
- package/dist/esm/api/resources/users/resources/publicData/client/Client.mjs +81 -0
- package/dist/esm/api/resources/users/resources/publicData/client/index.d.mts +1 -0
- package/dist/esm/api/resources/users/resources/publicData/client/index.mjs +1 -0
- package/dist/esm/api/resources/users/resources/publicData/index.d.mts +1 -0
- package/dist/esm/api/resources/users/resources/publicData/index.mjs +1 -0
- package/dist/esm/api/types/TaskArtifactS3ObjectMetadata1.d.mts +1 -1
- package/dist/esm/api/types/TaskGroupS3ObjectMetadata1.d.mts +1 -1
- package/dist/esm/api/types/ValidationError.d.mts +2 -0
- package/dist/esm/core/index.d.mts +0 -1
- package/dist/esm/core/index.mjs +0 -1
- package/dist/esm/index.d.mts +0 -1
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +1962 -1956
- package/dist/cjs/core/exports.d.ts +0 -1
- package/dist/cjs/core/file/exports.d.ts +0 -1
- package/dist/cjs/core/file/file.d.ts +0 -5
- package/dist/cjs/core/file/file.js +0 -203
- package/dist/cjs/core/file/index.d.ts +0 -2
- package/dist/cjs/core/file/types.d.ts +0 -66
- package/dist/cjs/exports.d.ts +0 -1
- package/dist/esm/core/exports.d.mts +0 -1
- package/dist/esm/core/exports.mjs +0 -1
- package/dist/esm/core/file/exports.d.mts +0 -1
- package/dist/esm/core/file/file.d.mts +0 -5
- package/dist/esm/core/file/file.mjs +0 -167
- package/dist/esm/core/file/index.d.mts +0 -2
- package/dist/esm/core/file/index.mjs +0 -2
- package/dist/esm/core/file/types.d.mts +0 -66
- package/dist/esm/exports.d.mts +0 -1
- package/dist/esm/exports.mjs +0 -1
- /package/dist/{esm/api/resources/users/client/requests/index.mjs → cjs/api/resources/orgs/resources/privateData/client/index.d.ts} +0 -0
- /package/dist/cjs/api/resources/{users/client/requests → orgs/resources/privateData/client}/index.js +0 -0
- /package/dist/cjs/api/resources/orgs/{client → resources/publicData/client}/requests/CreateOrgPublicDataReq.d.ts +0 -0
- /package/dist/cjs/api/resources/orgs/{client → resources/publicData/client}/requests/CreateOrgPublicDataReq.js +0 -0
- /package/dist/cjs/api/resources/orgs/{client → resources/publicData/client}/requests/UpdateOrgPublicDataReq.d.ts +0 -0
- /package/dist/cjs/api/resources/orgs/{client → resources/publicData/client}/requests/UpdateOrgPublicDataReq.js +0 -0
- /package/dist/cjs/{core/file/exports.js → api/resources/orgs/resources/publicData/client/requests/index.js} +0 -0
- /package/dist/cjs/api/resources/users/{client → resources/privateData/client}/requests/FirebaseCloudMessagingTokenClientCreate1.js +0 -0
- /package/dist/cjs/api/resources/users/{client → resources/privateData/client}/requests/UserPrivateDataClientCreate1.d.ts +0 -0
- /package/dist/cjs/api/resources/users/{client → resources/privateData/client}/requests/UserPrivateDataClientCreate1.js +0 -0
- /package/dist/cjs/api/resources/users/{client → resources/privateData/client}/requests/UserPrivateDataClientUpdate1.d.ts +0 -0
- /package/dist/cjs/api/resources/users/{client → resources/privateData/client}/requests/UserPrivateDataClientUpdate1.js +0 -0
- /package/dist/cjs/api/resources/users/{client → resources/privateData/client}/requests/index.d.ts +0 -0
- /package/dist/cjs/{core/file/types.js → api/resources/users/resources/privateData/client/requests/index.js} +0 -0
- /package/dist/{esm/core/file/exports.mjs → cjs/api/resources/users/resources/publicData/client/index.d.ts} +0 -0
- /package/dist/esm/{core/file/types.mjs → api/resources/orgs/resources/privateData/client/index.d.mts} +0 -0
- /package/dist/esm/api/resources/orgs/{client → resources/publicData/client}/requests/CreateOrgPublicDataReq.d.mts +0 -0
- /package/dist/esm/api/resources/orgs/{client → resources/publicData/client}/requests/CreateOrgPublicDataReq.mjs +0 -0
- /package/dist/esm/api/resources/orgs/{client → resources/publicData/client}/requests/UpdateOrgPublicDataReq.d.mts +0 -0
- /package/dist/esm/api/resources/orgs/{client → resources/publicData/client}/requests/UpdateOrgPublicDataReq.mjs +0 -0
- /package/dist/esm/api/resources/users/{client → resources/privateData/client}/requests/FirebaseCloudMessagingTokenClientCreate1.mjs +0 -0
- /package/dist/esm/api/resources/users/{client → resources/privateData/client}/requests/UserPrivateDataClientCreate1.d.mts +0 -0
- /package/dist/esm/api/resources/users/{client → resources/privateData/client}/requests/UserPrivateDataClientCreate1.mjs +0 -0
- /package/dist/esm/api/resources/users/{client → resources/privateData/client}/requests/UserPrivateDataClientUpdate1.d.mts +0 -0
- /package/dist/esm/api/resources/users/{client → resources/privateData/client}/requests/UserPrivateDataClientUpdate1.mjs +0 -0
- /package/dist/esm/api/resources/users/{client → resources/privateData/client}/requests/index.d.mts +0 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
15
|
+
import * as Chrt from "../../../../../index.mjs";
|
|
16
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
17
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
18
|
+
export class PrivateData {
|
|
19
|
+
constructor(_options = {}) {
|
|
20
|
+
this._options = _options;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves private user data for the caller. | () -> (UserPrivateData1)
|
|
24
|
+
*
|
|
25
|
+
* @param {PrivateData.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await client.users.privateData.getV1()
|
|
29
|
+
*/
|
|
30
|
+
getV1(requestOptions) {
|
|
31
|
+
return core.HttpResponsePromise.fromPromise(this.__getV1(requestOptions));
|
|
32
|
+
}
|
|
33
|
+
__getV1(requestOptions) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
var _a, _b, _c, _d;
|
|
36
|
+
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
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
38
|
+
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"),
|
|
39
|
+
method: "GET",
|
|
40
|
+
headers: _headers,
|
|
41
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
42
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
43
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
44
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
45
|
+
});
|
|
46
|
+
if (_response.ok) {
|
|
47
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
48
|
+
}
|
|
49
|
+
if (_response.error.reason === "status-code") {
|
|
50
|
+
throw new errors.ChrtError({
|
|
51
|
+
statusCode: _response.error.statusCode,
|
|
52
|
+
body: _response.error.body,
|
|
53
|
+
rawResponse: _response.rawResponse,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
switch (_response.error.reason) {
|
|
57
|
+
case "non-json":
|
|
58
|
+
throw new errors.ChrtError({
|
|
59
|
+
statusCode: _response.error.statusCode,
|
|
60
|
+
body: _response.error.rawBody,
|
|
61
|
+
rawResponse: _response.rawResponse,
|
|
62
|
+
});
|
|
63
|
+
case "timeout":
|
|
64
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /users/user_private_data/v1.");
|
|
65
|
+
case "unknown":
|
|
66
|
+
throw new errors.ChrtError({
|
|
67
|
+
message: _response.error.errorMessage,
|
|
68
|
+
rawResponse: _response.rawResponse,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Creates private user data for the caller. | (UserPrivateDataClientCreate1) -> (UserPrivateData1)
|
|
75
|
+
*
|
|
76
|
+
* @param {Chrt.users.UserPrivateDataClientCreate1} request
|
|
77
|
+
* @param {PrivateData.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
|
+
*
|
|
79
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* await client.users.privateData.createV1({
|
|
83
|
+
* schema_version: 1
|
|
84
|
+
* })
|
|
85
|
+
*/
|
|
86
|
+
createV1(request, requestOptions) {
|
|
87
|
+
return core.HttpResponsePromise.fromPromise(this.__createV1(request, requestOptions));
|
|
88
|
+
}
|
|
89
|
+
__createV1(request, requestOptions) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
var _a, _b, _c, _d;
|
|
92
|
+
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);
|
|
93
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
94
|
+
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"),
|
|
95
|
+
method: "POST",
|
|
96
|
+
headers: _headers,
|
|
97
|
+
contentType: "application/json",
|
|
98
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
99
|
+
requestType: "json",
|
|
100
|
+
body: request,
|
|
101
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
102
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
103
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
104
|
+
});
|
|
105
|
+
if (_response.ok) {
|
|
106
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
107
|
+
}
|
|
108
|
+
if (_response.error.reason === "status-code") {
|
|
109
|
+
switch (_response.error.statusCode) {
|
|
110
|
+
case 422:
|
|
111
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
112
|
+
default:
|
|
113
|
+
throw new errors.ChrtError({
|
|
114
|
+
statusCode: _response.error.statusCode,
|
|
115
|
+
body: _response.error.body,
|
|
116
|
+
rawResponse: _response.rawResponse,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
switch (_response.error.reason) {
|
|
121
|
+
case "non-json":
|
|
122
|
+
throw new errors.ChrtError({
|
|
123
|
+
statusCode: _response.error.statusCode,
|
|
124
|
+
body: _response.error.rawBody,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
126
|
+
});
|
|
127
|
+
case "timeout":
|
|
128
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /users/user_private_data/v1.");
|
|
129
|
+
case "unknown":
|
|
130
|
+
throw new errors.ChrtError({
|
|
131
|
+
message: _response.error.errorMessage,
|
|
132
|
+
rawResponse: _response.rawResponse,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Updates private user data for the caller. | (UserPrivateDataClientUpdate1) -> (UserPrivateData1)
|
|
139
|
+
*
|
|
140
|
+
* @param {Chrt.users.UserPrivateDataClientUpdate1} request
|
|
141
|
+
* @param {PrivateData.RequestOptions} requestOptions - Request-specific configuration.
|
|
142
|
+
*
|
|
143
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* await client.users.privateData.updateV1()
|
|
147
|
+
*/
|
|
148
|
+
updateV1(request = {}, requestOptions) {
|
|
149
|
+
return core.HttpResponsePromise.fromPromise(this.__updateV1(request, requestOptions));
|
|
150
|
+
}
|
|
151
|
+
__updateV1() {
|
|
152
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
153
|
+
var _a, _b, _c, _d;
|
|
154
|
+
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);
|
|
155
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
156
|
+
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"),
|
|
157
|
+
method: "PATCH",
|
|
158
|
+
headers: _headers,
|
|
159
|
+
contentType: "application/json",
|
|
160
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
161
|
+
requestType: "json",
|
|
162
|
+
body: request,
|
|
163
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
164
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
165
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
166
|
+
});
|
|
167
|
+
if (_response.ok) {
|
|
168
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
169
|
+
}
|
|
170
|
+
if (_response.error.reason === "status-code") {
|
|
171
|
+
switch (_response.error.statusCode) {
|
|
172
|
+
case 422:
|
|
173
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
174
|
+
default:
|
|
175
|
+
throw new errors.ChrtError({
|
|
176
|
+
statusCode: _response.error.statusCode,
|
|
177
|
+
body: _response.error.body,
|
|
178
|
+
rawResponse: _response.rawResponse,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
switch (_response.error.reason) {
|
|
183
|
+
case "non-json":
|
|
184
|
+
throw new errors.ChrtError({
|
|
185
|
+
statusCode: _response.error.statusCode,
|
|
186
|
+
body: _response.error.rawBody,
|
|
187
|
+
rawResponse: _response.rawResponse,
|
|
188
|
+
});
|
|
189
|
+
case "timeout":
|
|
190
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /users/user_private_data/v1.");
|
|
191
|
+
case "unknown":
|
|
192
|
+
throw new errors.ChrtError({
|
|
193
|
+
message: _response.error.errorMessage,
|
|
194
|
+
rawResponse: _response.rawResponse,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Upserts a Firebase Cloud Messaging token for the caller. Dedupes on token; if token exists, updates last_used_timestamp. | (FirebaseCloudMessagingTokenClientCreate1) -> (UserPrivateData1)
|
|
201
|
+
*
|
|
202
|
+
* @param {Chrt.users.FirebaseCloudMessagingTokenClientCreate1} request
|
|
203
|
+
* @param {PrivateData.RequestOptions} requestOptions - Request-specific configuration.
|
|
204
|
+
*
|
|
205
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* await client.users.privateData.upsertFirebaseCloudMessagingTokenV1({
|
|
209
|
+
* firebase_cloud_messaging_token: "firebase_cloud_messaging_token"
|
|
210
|
+
* })
|
|
211
|
+
*/
|
|
212
|
+
upsertFirebaseCloudMessagingTokenV1(request, requestOptions) {
|
|
213
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertFirebaseCloudMessagingTokenV1(request, requestOptions));
|
|
214
|
+
}
|
|
215
|
+
__upsertFirebaseCloudMessagingTokenV1(request, requestOptions) {
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
var _a, _b, _c, _d;
|
|
218
|
+
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);
|
|
219
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
220
|
+
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/firebase_cloud_messaging_token/v1"),
|
|
221
|
+
method: "PUT",
|
|
222
|
+
headers: _headers,
|
|
223
|
+
contentType: "application/json",
|
|
224
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
225
|
+
requestType: "json",
|
|
226
|
+
body: request,
|
|
227
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
228
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
229
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
230
|
+
});
|
|
231
|
+
if (_response.ok) {
|
|
232
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
233
|
+
}
|
|
234
|
+
if (_response.error.reason === "status-code") {
|
|
235
|
+
switch (_response.error.statusCode) {
|
|
236
|
+
case 422:
|
|
237
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
238
|
+
default:
|
|
239
|
+
throw new errors.ChrtError({
|
|
240
|
+
statusCode: _response.error.statusCode,
|
|
241
|
+
body: _response.error.body,
|
|
242
|
+
rawResponse: _response.rawResponse,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
switch (_response.error.reason) {
|
|
247
|
+
case "non-json":
|
|
248
|
+
throw new errors.ChrtError({
|
|
249
|
+
statusCode: _response.error.statusCode,
|
|
250
|
+
body: _response.error.rawBody,
|
|
251
|
+
rawResponse: _response.rawResponse,
|
|
252
|
+
});
|
|
253
|
+
case "timeout":
|
|
254
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PUT /users/user_private_data/firebase_cloud_messaging_token/v1.");
|
|
255
|
+
case "unknown":
|
|
256
|
+
throw new errors.ChrtError({
|
|
257
|
+
message: _response.error.errorMessage,
|
|
258
|
+
rawResponse: _response.rawResponse,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
_getAuthorizationHeader() {
|
|
264
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
265
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
266
|
+
if (bearer != null) {
|
|
267
|
+
return `Bearer ${bearer}`;
|
|
268
|
+
}
|
|
269
|
+
return undefined;
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
5
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
6
|
+
import * as Chrt from "../../../../../index.mjs";
|
|
7
|
+
export declare namespace PublicData {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
|
+
fetcher?: core.FetchFunction;
|
|
16
|
+
}
|
|
17
|
+
interface RequestOptions {
|
|
18
|
+
/** The maximum time to wait for a response in seconds. */
|
|
19
|
+
timeoutInSeconds?: number;
|
|
20
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
21
|
+
maxRetries?: number;
|
|
22
|
+
/** A hook to abort the request. */
|
|
23
|
+
abortSignal?: AbortSignal;
|
|
24
|
+
/** Additional query string parameters to include in the request. */
|
|
25
|
+
queryParams?: Record<string, unknown>;
|
|
26
|
+
/** Additional headers to include in the request. */
|
|
27
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export declare class PublicData {
|
|
31
|
+
protected readonly _options: PublicData.Options;
|
|
32
|
+
constructor(_options?: PublicData.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves public user data for the caller. | () -> (UserPublicData1)
|
|
35
|
+
*
|
|
36
|
+
* @param {PublicData.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.users.publicData.getV1()
|
|
40
|
+
*/
|
|
41
|
+
getV1(requestOptions?: PublicData.RequestOptions): core.HttpResponsePromise<Chrt.UserPublicData1>;
|
|
42
|
+
private __getV1;
|
|
43
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
15
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
16
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
+
export class PublicData {
|
|
18
|
+
constructor(_options = {}) {
|
|
19
|
+
this._options = _options;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves public user data for the caller. | () -> (UserPublicData1)
|
|
23
|
+
*
|
|
24
|
+
* @param {PublicData.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* await client.users.publicData.getV1()
|
|
28
|
+
*/
|
|
29
|
+
getV1(requestOptions) {
|
|
30
|
+
return core.HttpResponsePromise.fromPromise(this.__getV1(requestOptions));
|
|
31
|
+
}
|
|
32
|
+
__getV1(requestOptions) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
var _a, _b, _c, _d;
|
|
35
|
+
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);
|
|
36
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
37
|
+
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_public_data/v1"),
|
|
38
|
+
method: "GET",
|
|
39
|
+
headers: _headers,
|
|
40
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
41
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
42
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
43
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
44
|
+
});
|
|
45
|
+
if (_response.ok) {
|
|
46
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
47
|
+
}
|
|
48
|
+
if (_response.error.reason === "status-code") {
|
|
49
|
+
throw new errors.ChrtError({
|
|
50
|
+
statusCode: _response.error.statusCode,
|
|
51
|
+
body: _response.error.body,
|
|
52
|
+
rawResponse: _response.rawResponse,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
switch (_response.error.reason) {
|
|
56
|
+
case "non-json":
|
|
57
|
+
throw new errors.ChrtError({
|
|
58
|
+
statusCode: _response.error.statusCode,
|
|
59
|
+
body: _response.error.rawBody,
|
|
60
|
+
rawResponse: _response.rawResponse,
|
|
61
|
+
});
|
|
62
|
+
case "timeout":
|
|
63
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /users/user_public_data/v1.");
|
|
64
|
+
case "unknown":
|
|
65
|
+
throw new errors.ChrtError({
|
|
66
|
+
message: _response.error.errorMessage,
|
|
67
|
+
rawResponse: _response.rawResponse,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
_getAuthorizationHeader() {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
75
|
+
if (bearer != null) {
|
|
76
|
+
return `Bearer ${bearer}`;
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -10,7 +10,7 @@ export interface TaskArtifactS3ObjectMetadata1 {
|
|
|
10
10
|
uploaded_by_user_id: string;
|
|
11
11
|
/** Must be a string starting with `org_` */
|
|
12
12
|
uploaded_by_org_id: string;
|
|
13
|
-
s3_key_prefix?: "
|
|
13
|
+
s3_key_prefix?: "shipping/task_artifact_s3_object_metadata";
|
|
14
14
|
blurhash?: string | null;
|
|
15
15
|
/** MIME type of the uploaded file (e.g., 'image/jpeg', 'application/pdf') */
|
|
16
16
|
content_type?: string | null;
|
|
@@ -10,7 +10,7 @@ export interface TaskGroupS3ObjectMetadata1 {
|
|
|
10
10
|
uploaded_by_user_id: string;
|
|
11
11
|
/** Must be a string starting with `org_` */
|
|
12
12
|
uploaded_by_org_id: string;
|
|
13
|
-
s3_key_prefix?: "
|
|
13
|
+
s3_key_prefix?: "shipping/task_group_s3_object_metadata";
|
|
14
14
|
blurhash?: string | null;
|
|
15
15
|
/** MIME type of the uploaded file (e.g., 'image/jpeg', 'application/pdf') */
|
|
16
16
|
content_type?: string | null;
|
package/dist/esm/core/index.mjs
CHANGED
package/dist/esm/index.d.mts
CHANGED
package/dist/esm/index.mjs
CHANGED
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.448.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.
|
|
1
|
+
export const SDK_VERSION = "1.448.0";
|