@chrt-inc/typescript-sdk 1.885.0 → 1.888.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/orgs/resources/accounts/client/Client.d.ts +21 -3
- package/dist/cjs/api/resources/orgs/resources/accounts/client/Client.js +80 -4
- package/dist/cjs/api/resources/orgs/resources/accounts/client/requests/AccountClientCreate1.d.ts +2 -0
- package/dist/cjs/api/resources/orgs/resources/accounts/client/requests/AccountClientUpdate1.d.ts +3 -0
- package/dist/cjs/api/resources/orgs/resources/accounts/client/requests/AccountsListV1Request.d.ts +6 -0
- package/dist/cjs/api/resources/orgs/resources/accounts/client/requests/AccountsTypeaheadV1Request.d.ts +16 -0
- package/dist/cjs/api/resources/orgs/resources/accounts/client/requests/AccountsTypeaheadV1Request.js +5 -0
- package/dist/cjs/api/resources/orgs/resources/accounts/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/orgs/resources/contacts/client/Client.d.ts +30 -0
- package/dist/cjs/api/resources/orgs/resources/contacts/client/Client.js +125 -0
- package/dist/cjs/api/resources/orgs/resources/contacts/client/requests/ContactAccountAddReq.d.ts +12 -0
- package/dist/cjs/api/resources/orgs/resources/contacts/client/requests/ContactAccountAddReq.js +5 -0
- package/dist/cjs/api/resources/orgs/resources/contacts/client/requests/ContactClientCreate1.d.ts +1 -1
- package/dist/cjs/api/resources/orgs/resources/contacts/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/Client.d.ts +53 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/Client.js +200 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/index.js +15 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/requests/CargoAddToOrderReq.d.ts +18 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/requests/CargoAddToOrderReq.js +5 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/requests/CargoAssociateWithTaskReq.d.ts +16 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/requests/CargoAssociateWithTaskReq.js +5 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/requests/CargoUnassociateWithTaskReq.d.ts +16 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/requests/CargoUnassociateWithTaskReq.js +5 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/shipping/resources/cargos/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/shipping/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipping/resources/index.js +1 -0
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.js +18 -2
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForCoordinatorOperatorsV1Request.d.ts +2 -0
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForProviderOperatorsV1Request.d.ts +2 -0
- package/dist/cjs/api/types/Account1.d.ts +2 -0
- package/dist/cjs/api/types/AccountTypeaheadFieldEnum.d.ts +4 -0
- package/dist/cjs/api/types/AccountTypeaheadFieldEnum.js +5 -0
- package/dist/cjs/api/types/AccountTypeaheadResult.d.ts +8 -0
- package/dist/cjs/api/types/AccountTypeaheadResult.js +5 -0
- package/dist/cjs/api/types/AccountTypeaheadValue.d.ts +7 -0
- package/dist/cjs/api/types/AccountTypeaheadValue.js +5 -0
- package/dist/cjs/api/types/Contact1.d.ts +1 -1
- package/dist/cjs/api/types/NotificationEventsForAdHocEnum.d.ts +1 -1
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -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/orgs/resources/accounts/client/Client.d.mts +21 -3
- package/dist/esm/api/resources/orgs/resources/accounts/client/Client.mjs +80 -4
- package/dist/esm/api/resources/orgs/resources/accounts/client/requests/AccountClientCreate1.d.mts +2 -0
- package/dist/esm/api/resources/orgs/resources/accounts/client/requests/AccountClientUpdate1.d.mts +3 -0
- package/dist/esm/api/resources/orgs/resources/accounts/client/requests/AccountsListV1Request.d.mts +6 -0
- package/dist/esm/api/resources/orgs/resources/accounts/client/requests/AccountsTypeaheadV1Request.d.mts +16 -0
- package/dist/esm/api/resources/orgs/resources/accounts/client/requests/AccountsTypeaheadV1Request.mjs +4 -0
- package/dist/esm/api/resources/orgs/resources/accounts/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/orgs/resources/contacts/client/Client.d.mts +30 -0
- package/dist/esm/api/resources/orgs/resources/contacts/client/Client.mjs +125 -0
- package/dist/esm/api/resources/orgs/resources/contacts/client/requests/ContactAccountAddReq.d.mts +12 -0
- package/dist/esm/api/resources/orgs/resources/contacts/client/requests/ContactAccountAddReq.mjs +4 -0
- package/dist/esm/api/resources/orgs/resources/contacts/client/requests/ContactClientCreate1.d.mts +1 -1
- package/dist/esm/api/resources/orgs/resources/contacts/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/Client.d.mts +53 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/Client.mjs +200 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/index.d.mts +1 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/index.mjs +1 -1
- package/dist/esm/api/resources/shipping/resources/cargos/client/requests/CargoAddToOrderReq.d.mts +18 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/requests/CargoAddToOrderReq.mjs +4 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/requests/CargoAssociateWithTaskReq.d.mts +16 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/requests/CargoAssociateWithTaskReq.mjs +4 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/requests/CargoUnassociateWithTaskReq.d.mts +16 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/requests/CargoUnassociateWithTaskReq.mjs +4 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/shipping/resources/cargos/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/shipping/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/shipping/resources/index.mjs +1 -0
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.mjs +18 -2
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForCoordinatorOperatorsV1Request.d.mts +2 -0
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForProviderOperatorsV1Request.d.mts +2 -0
- package/dist/esm/api/types/Account1.d.mts +2 -0
- package/dist/esm/api/types/AccountTypeaheadFieldEnum.d.mts +4 -0
- package/dist/esm/api/types/AccountTypeaheadFieldEnum.mjs +4 -0
- package/dist/esm/api/types/AccountTypeaheadResult.d.mts +8 -0
- package/dist/esm/api/types/AccountTypeaheadResult.mjs +4 -0
- package/dist/esm/api/types/AccountTypeaheadValue.d.mts +7 -0
- package/dist/esm/api/types/AccountTypeaheadValue.mjs +4 -0
- package/dist/esm/api/types/Contact1.d.mts +1 -1
- package/dist/esm/api/types/NotificationEventsForAdHocEnum.d.mts +1 -1
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +418 -3
|
@@ -20,7 +20,7 @@ export class Accounts {
|
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Creates a coordinator-private account
|
|
23
|
+
* Creates a coordinator-private account with a name unique to its associated shipper. Optional location may be set at creation. | authz: allowed_org_types=[provider], min_org_role=operator | (AccountClientCreate1) -> (PydanticObjectId)
|
|
24
24
|
*
|
|
25
25
|
* @param {Chrt.orgs.AccountClientCreate1} request
|
|
26
26
|
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -85,7 +85,7 @@ export class Accounts {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
|
-
* Lists coordinator-created shipper accounts with association filters, sorting, and pagination. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (AccountListRes)
|
|
88
|
+
* Lists coordinator-created shipper accounts with association filters, name search, sorting, and pagination. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (AccountListRes)
|
|
89
89
|
*
|
|
90
90
|
* @param {Chrt.orgs.AccountsListV1Request} request
|
|
91
91
|
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -94,6 +94,8 @@ export class Accounts {
|
|
|
94
94
|
*
|
|
95
95
|
* @example
|
|
96
96
|
* await client.orgs.accounts.listV1({
|
|
97
|
+
* search: "search",
|
|
98
|
+
* filter_account_id: "filter_account_id",
|
|
97
99
|
* filter_org_id: "filter_org_id",
|
|
98
100
|
* filter_off_chrt_org_data_id: "filter_off_chrt_org_data_id",
|
|
99
101
|
* sort_by: "name",
|
|
@@ -108,8 +110,14 @@ export class Accounts {
|
|
|
108
110
|
__listV1() {
|
|
109
111
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
110
112
|
var _a, _b, _c, _d, _e, _f;
|
|
111
|
-
const { filter_org_id: filterOrgId, filter_off_chrt_org_data_id: filterOffChrtOrgDataId, sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, } = request;
|
|
113
|
+
const { search, filter_account_id: filterAccountId, filter_org_id: filterOrgId, filter_off_chrt_org_data_id: filterOffChrtOrgDataId, sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, } = request;
|
|
112
114
|
const _queryParams = {};
|
|
115
|
+
if (search !== undefined) {
|
|
116
|
+
_queryParams["search"] = search;
|
|
117
|
+
}
|
|
118
|
+
if (filterAccountId !== undefined) {
|
|
119
|
+
_queryParams["filter_account_id"] = filterAccountId;
|
|
120
|
+
}
|
|
113
121
|
if (filterOrgId !== undefined) {
|
|
114
122
|
_queryParams["filter_org_id"] = filterOrgId;
|
|
115
123
|
}
|
|
@@ -171,7 +179,75 @@ export class Accounts {
|
|
|
171
179
|
});
|
|
172
180
|
}
|
|
173
181
|
/**
|
|
174
|
-
*
|
|
182
|
+
* Returns distinct coordinator-created shipper account names matching the query, with matching account IDs. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (list[AccountTypeaheadResult])
|
|
183
|
+
*
|
|
184
|
+
* @param {Chrt.orgs.AccountsTypeaheadV1Request} request
|
|
185
|
+
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
186
|
+
*
|
|
187
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* await client.orgs.accounts.typeaheadV1({
|
|
191
|
+
* query: "query",
|
|
192
|
+
* limit: 1
|
|
193
|
+
* })
|
|
194
|
+
*/
|
|
195
|
+
typeaheadV1(request, requestOptions) {
|
|
196
|
+
return core.HttpResponsePromise.fromPromise(this.__typeaheadV1(request, requestOptions));
|
|
197
|
+
}
|
|
198
|
+
__typeaheadV1(request, requestOptions) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
var _a, _b, _c, _d, _e;
|
|
201
|
+
const { query, limit } = request;
|
|
202
|
+
const _queryParams = {};
|
|
203
|
+
_queryParams["query"] = query;
|
|
204
|
+
if (limit !== undefined) {
|
|
205
|
+
_queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
|
|
206
|
+
}
|
|
207
|
+
let _headers = mergeHeaders((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
208
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
209
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ChrtEnvironment.Local, "orgs/accounts/typeahead/v1"),
|
|
210
|
+
method: "GET",
|
|
211
|
+
headers: _headers,
|
|
212
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
213
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
214
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
215
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
216
|
+
});
|
|
217
|
+
if (_response.ok) {
|
|
218
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
219
|
+
}
|
|
220
|
+
if (_response.error.reason === "status-code") {
|
|
221
|
+
switch (_response.error.statusCode) {
|
|
222
|
+
case 422:
|
|
223
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
224
|
+
default:
|
|
225
|
+
throw new errors.ChrtError({
|
|
226
|
+
statusCode: _response.error.statusCode,
|
|
227
|
+
body: _response.error.body,
|
|
228
|
+
rawResponse: _response.rawResponse,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
switch (_response.error.reason) {
|
|
233
|
+
case "non-json":
|
|
234
|
+
throw new errors.ChrtError({
|
|
235
|
+
statusCode: _response.error.statusCode,
|
|
236
|
+
body: _response.error.rawBody,
|
|
237
|
+
rawResponse: _response.rawResponse,
|
|
238
|
+
});
|
|
239
|
+
case "timeout":
|
|
240
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /orgs/accounts/typeahead/v1.");
|
|
241
|
+
case "unknown":
|
|
242
|
+
throw new errors.ChrtError({
|
|
243
|
+
message: _response.error.errorMessage,
|
|
244
|
+
rawResponse: _response.rawResponse,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Updates a coordinator-created shipper account name and optional location while preserving per-shipper name uniqueness. | authz: allowed_org_types=[provider], min_org_role=operator | (AccountClientUpdate1) -> (bool)
|
|
175
251
|
*
|
|
176
252
|
* @param {string} accountId
|
|
177
253
|
* @param {Chrt.orgs.AccountClientUpdate1} request
|
package/dist/esm/api/resources/orgs/resources/accounts/client/requests/AccountClientCreate1.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Chrt from "../../../../../../index.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
* }
|
|
10
11
|
*/
|
|
11
12
|
export interface AccountClientCreate1 {
|
|
13
|
+
location?: Chrt.LocationFeature | null;
|
|
12
14
|
name: string;
|
|
13
15
|
off_chrt_org_data_id?: string | null;
|
|
14
16
|
/** Must be a string starting with `org_` */
|
package/dist/esm/api/resources/orgs/resources/accounts/client/requests/AccountClientUpdate1.d.mts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Chrt from "../../../../../../index.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {}
|
|
7
8
|
*/
|
|
8
9
|
export interface AccountClientUpdate1 {
|
|
10
|
+
location?: Chrt.LocationFeature | null;
|
|
11
|
+
location__set_to_None?: boolean;
|
|
9
12
|
name?: string | null;
|
|
10
13
|
}
|
package/dist/esm/api/resources/orgs/resources/accounts/client/requests/AccountsListV1Request.d.mts
CHANGED
|
@@ -5,6 +5,8 @@ import * as Chrt from "../../../../../../index.mjs";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
+
* search: "search",
|
|
9
|
+
* filter_account_id: "filter_account_id",
|
|
8
10
|
* filter_org_id: "filter_org_id",
|
|
9
11
|
* filter_off_chrt_org_data_id: "filter_off_chrt_org_data_id",
|
|
10
12
|
* sort_by: "name",
|
|
@@ -14,6 +16,10 @@ import * as Chrt from "../../../../../../index.mjs";
|
|
|
14
16
|
* }
|
|
15
17
|
*/
|
|
16
18
|
export interface AccountsListV1Request {
|
|
19
|
+
/** Full-text account name search query */
|
|
20
|
+
search?: string | null;
|
|
21
|
+
/** Filter by account ID */
|
|
22
|
+
filter_account_id?: string | null;
|
|
17
23
|
/** Filter by associated on-CHRT shipper organization */
|
|
18
24
|
filter_org_id?: string | null;
|
|
19
25
|
/** Filter by associated off-CHRT shipper organization data */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* query: "query",
|
|
8
|
+
* limit: 1
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface AccountsTypeaheadV1Request {
|
|
12
|
+
/** Typeahead search query */
|
|
13
|
+
query: string;
|
|
14
|
+
/** Max results per field */
|
|
15
|
+
limit?: number | null;
|
|
16
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type AccountClientCreate1 } from "./AccountClientCreate1.mjs";
|
|
2
2
|
export { type AccountsListV1Request } from "./AccountsListV1Request.mjs";
|
|
3
|
+
export { type AccountsTypeaheadV1Request } from "./AccountsTypeaheadV1Request.mjs";
|
|
3
4
|
export { type AccountClientUpdate1 } from "./AccountClientUpdate1.mjs";
|
|
@@ -30,6 +30,36 @@ export declare namespace Contacts {
|
|
|
30
30
|
export declare class Contacts {
|
|
31
31
|
protected readonly _options: Contacts.Options;
|
|
32
32
|
constructor(_options?: Contacts.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Associates an account from the contact's organization. | authz: min_org_role=operator | (ContactAccountAddReq) -> (bool)
|
|
35
|
+
*
|
|
36
|
+
* @param {string} contactId
|
|
37
|
+
* @param {Chrt.orgs.ContactAccountAddReq} request
|
|
38
|
+
* @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.orgs.contacts.accountAddV1("contact_id", {
|
|
44
|
+
* account_id: "account_id"
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
47
|
+
accountAddV1(contactId: string, request: Chrt.orgs.ContactAccountAddReq, requestOptions?: Contacts.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
48
|
+
private __accountAddV1;
|
|
49
|
+
/**
|
|
50
|
+
* Removes an account association from an organization-created contact. | authz: min_org_role=operator | () -> (bool)
|
|
51
|
+
*
|
|
52
|
+
* @param {string} contactId
|
|
53
|
+
* @param {string} accountId
|
|
54
|
+
* @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
|
|
55
|
+
*
|
|
56
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* await client.orgs.contacts.accountRemoveV1("contact_id", "account_id")
|
|
60
|
+
*/
|
|
61
|
+
accountRemoveV1(contactId: string, accountId: string, requestOptions?: Contacts.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
62
|
+
private __accountRemoveV1;
|
|
33
63
|
/**
|
|
34
64
|
* Creates an organization-created contact. | authz: min_org_role=operator | (ContactClientCreate1) -> (PydanticObjectId)
|
|
35
65
|
*
|
|
@@ -19,6 +19,131 @@ export class Contacts {
|
|
|
19
19
|
constructor(_options = {}) {
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Associates an account from the contact's organization. | authz: min_org_role=operator | (ContactAccountAddReq) -> (bool)
|
|
24
|
+
*
|
|
25
|
+
* @param {string} contactId
|
|
26
|
+
* @param {Chrt.orgs.ContactAccountAddReq} request
|
|
27
|
+
* @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
+
*
|
|
29
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* await client.orgs.contacts.accountAddV1("contact_id", {
|
|
33
|
+
* account_id: "account_id"
|
|
34
|
+
* })
|
|
35
|
+
*/
|
|
36
|
+
accountAddV1(contactId, request, requestOptions) {
|
|
37
|
+
return core.HttpResponsePromise.fromPromise(this.__accountAddV1(contactId, request, requestOptions));
|
|
38
|
+
}
|
|
39
|
+
__accountAddV1(contactId, request, requestOptions) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
var _a, _b, _c, _d;
|
|
42
|
+
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);
|
|
43
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
44
|
+
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, `orgs/contacts/accounts/add/v1/${encodeURIComponent(contactId)}`),
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers: _headers,
|
|
47
|
+
contentType: "application/json",
|
|
48
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
49
|
+
requestType: "json",
|
|
50
|
+
body: request,
|
|
51
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
52
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
53
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
54
|
+
});
|
|
55
|
+
if (_response.ok) {
|
|
56
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
57
|
+
}
|
|
58
|
+
if (_response.error.reason === "status-code") {
|
|
59
|
+
switch (_response.error.statusCode) {
|
|
60
|
+
case 422:
|
|
61
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
62
|
+
default:
|
|
63
|
+
throw new errors.ChrtError({
|
|
64
|
+
statusCode: _response.error.statusCode,
|
|
65
|
+
body: _response.error.body,
|
|
66
|
+
rawResponse: _response.rawResponse,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
switch (_response.error.reason) {
|
|
71
|
+
case "non-json":
|
|
72
|
+
throw new errors.ChrtError({
|
|
73
|
+
statusCode: _response.error.statusCode,
|
|
74
|
+
body: _response.error.rawBody,
|
|
75
|
+
rawResponse: _response.rawResponse,
|
|
76
|
+
});
|
|
77
|
+
case "timeout":
|
|
78
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /orgs/contacts/accounts/add/v1/{contact_id}.");
|
|
79
|
+
case "unknown":
|
|
80
|
+
throw new errors.ChrtError({
|
|
81
|
+
message: _response.error.errorMessage,
|
|
82
|
+
rawResponse: _response.rawResponse,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Removes an account association from an organization-created contact. | authz: min_org_role=operator | () -> (bool)
|
|
89
|
+
*
|
|
90
|
+
* @param {string} contactId
|
|
91
|
+
* @param {string} accountId
|
|
92
|
+
* @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
|
|
93
|
+
*
|
|
94
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* await client.orgs.contacts.accountRemoveV1("contact_id", "account_id")
|
|
98
|
+
*/
|
|
99
|
+
accountRemoveV1(contactId, accountId, requestOptions) {
|
|
100
|
+
return core.HttpResponsePromise.fromPromise(this.__accountRemoveV1(contactId, accountId, requestOptions));
|
|
101
|
+
}
|
|
102
|
+
__accountRemoveV1(contactId, accountId, requestOptions) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
var _a, _b, _c, _d;
|
|
105
|
+
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);
|
|
106
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
107
|
+
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, `orgs/contacts/accounts/remove/v1/${encodeURIComponent(contactId)}/${encodeURIComponent(accountId)}`),
|
|
108
|
+
method: "DELETE",
|
|
109
|
+
headers: _headers,
|
|
110
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
111
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
112
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
113
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
114
|
+
});
|
|
115
|
+
if (_response.ok) {
|
|
116
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
117
|
+
}
|
|
118
|
+
if (_response.error.reason === "status-code") {
|
|
119
|
+
switch (_response.error.statusCode) {
|
|
120
|
+
case 422:
|
|
121
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
122
|
+
default:
|
|
123
|
+
throw new errors.ChrtError({
|
|
124
|
+
statusCode: _response.error.statusCode,
|
|
125
|
+
body: _response.error.body,
|
|
126
|
+
rawResponse: _response.rawResponse,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
switch (_response.error.reason) {
|
|
131
|
+
case "non-json":
|
|
132
|
+
throw new errors.ChrtError({
|
|
133
|
+
statusCode: _response.error.statusCode,
|
|
134
|
+
body: _response.error.rawBody,
|
|
135
|
+
rawResponse: _response.rawResponse,
|
|
136
|
+
});
|
|
137
|
+
case "timeout":
|
|
138
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /orgs/contacts/accounts/remove/v1/{contact_id}/{account_id}.");
|
|
139
|
+
case "unknown":
|
|
140
|
+
throw new errors.ChrtError({
|
|
141
|
+
message: _response.error.errorMessage,
|
|
142
|
+
rawResponse: _response.rawResponse,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
22
147
|
/**
|
|
23
148
|
* Creates an organization-created contact. | authz: min_org_role=operator | (ContactClientCreate1) -> (PydanticObjectId)
|
|
24
149
|
*
|
package/dist/esm/api/resources/orgs/resources/contacts/client/requests/ContactClientCreate1.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ import * as Chrt from "../../../../../../index.mjs";
|
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface ContactClientCreate1 {
|
|
13
|
-
|
|
13
|
+
account_ids?: string[];
|
|
14
14
|
email_address?: string | null;
|
|
15
15
|
job_title?: string | null;
|
|
16
16
|
location?: Chrt.LocationFeature | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { type ContactAccountAddReq } from "./ContactAccountAddReq.mjs";
|
|
1
2
|
export { type ContactClientCreate1 } from "./ContactClientCreate1.mjs";
|
|
2
3
|
export { type ContactsListV1Request } from "./ContactsListV1Request.mjs";
|
|
3
4
|
export { type ContactClientUpdate1 } from "./ContactClientUpdate1.mjs";
|
|
@@ -30,6 +30,59 @@ export declare namespace Cargos {
|
|
|
30
30
|
export declare class Cargos {
|
|
31
31
|
protected readonly _options: Cargos.Options;
|
|
32
32
|
constructor(_options?: Cargos.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Adds cargo to a non-DRAFT order. Cargo added to a terminal order starts terminal; otherwise it starts STAGED. | authz_personas=[coordinator_org_operators] | (CargoAddToOrderReq) -> (PydanticObjectId)
|
|
35
|
+
*
|
|
36
|
+
* @param {Chrt.shipping.CargoAddToOrderReq} request
|
|
37
|
+
* @param {Cargos.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.shipping.cargos.addV1({
|
|
43
|
+
* cargo: {
|
|
44
|
+
* cargo_type: "spare_parts",
|
|
45
|
+
* schema_version: 1
|
|
46
|
+
* },
|
|
47
|
+
* order_id: "order_id"
|
|
48
|
+
* })
|
|
49
|
+
*/
|
|
50
|
+
addV1(request: Chrt.shipping.CargoAddToOrderReq, requestOptions?: Cargos.RequestOptions): core.HttpResponsePromise<string>;
|
|
51
|
+
private __addV1;
|
|
52
|
+
/**
|
|
53
|
+
* Associates cargo with a task on a non-DRAFT order, then derives cargo status from all associated tasks in the order's task sequence. | authz_personas=[coordinator_org_operators] | (CargoAssociateWithTaskReq) -> (bool)
|
|
54
|
+
*
|
|
55
|
+
* @param {Chrt.shipping.CargoAssociateWithTaskReq} request
|
|
56
|
+
* @param {Cargos.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* await client.shipping.cargos.associateWithTaskV1({
|
|
62
|
+
* cargo_id: "cargo_id",
|
|
63
|
+
* order_id: "order_id",
|
|
64
|
+
* task_id: "task_id"
|
|
65
|
+
* })
|
|
66
|
+
*/
|
|
67
|
+
associateWithTaskV1(request: Chrt.shipping.CargoAssociateWithTaskReq, requestOptions?: Cargos.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
68
|
+
private __associateWithTaskV1;
|
|
69
|
+
/**
|
|
70
|
+
* Removes a cargo association from a task on a non-DRAFT order, then derives cargo status from the remaining associated tasks in the order's task sequence. | authz_personas=[coordinator_org_operators] | (CargoUnassociateWithTaskReq) -> (bool)
|
|
71
|
+
*
|
|
72
|
+
* @param {Chrt.shipping.CargoUnassociateWithTaskReq} request
|
|
73
|
+
* @param {Cargos.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
|
+
*
|
|
75
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* await client.shipping.cargos.unassociateWithTaskV1({
|
|
79
|
+
* cargo_id: "cargo_id",
|
|
80
|
+
* order_id: "order_id",
|
|
81
|
+
* task_id: "task_id"
|
|
82
|
+
* })
|
|
83
|
+
*/
|
|
84
|
+
unassociateWithTaskV1(request: Chrt.shipping.CargoUnassociateWithTaskReq, requestOptions?: Cargos.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
85
|
+
private __unassociateWithTaskV1;
|
|
33
86
|
/**
|
|
34
87
|
* Updates cargo details and synchronizes its parent order's AWB list. Cargo must be in STAGED, IN_TRANSIT, DELIVERED, SKIPPED, or EXCEPTION status. | authz_personas=[lig_owner_operators] | (CargoClientUpdate1) -> (PydanticObjectId)
|
|
35
88
|
*
|