@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
package/dist/cjs/Client.js
CHANGED
|
@@ -57,8 +57,8 @@ class ChrtClient {
|
|
|
57
57
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
58
58
|
"X-Fern-Language": "JavaScript",
|
|
59
59
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
60
|
-
"X-Fern-SDK-Version": "1.
|
|
61
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
60
|
+
"X-Fern-SDK-Version": "1.888.0",
|
|
61
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.888.0",
|
|
62
62
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
63
63
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
64
64
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -31,7 +31,7 @@ export declare class Accounts {
|
|
|
31
31
|
protected readonly _options: Accounts.Options;
|
|
32
32
|
constructor(_options?: Accounts.Options);
|
|
33
33
|
/**
|
|
34
|
-
* Creates a coordinator-private account
|
|
34
|
+
* 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)
|
|
35
35
|
*
|
|
36
36
|
* @param {Chrt.orgs.AccountClientCreate1} request
|
|
37
37
|
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -47,7 +47,7 @@ export declare class Accounts {
|
|
|
47
47
|
createV1(request: Chrt.orgs.AccountClientCreate1, requestOptions?: Accounts.RequestOptions): core.HttpResponsePromise<string>;
|
|
48
48
|
private __createV1;
|
|
49
49
|
/**
|
|
50
|
-
* Lists coordinator-created shipper accounts with association filters, sorting, and pagination. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (AccountListRes)
|
|
50
|
+
* Lists coordinator-created shipper accounts with association filters, name search, sorting, and pagination. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (AccountListRes)
|
|
51
51
|
*
|
|
52
52
|
* @param {Chrt.orgs.AccountsListV1Request} request
|
|
53
53
|
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -56,6 +56,8 @@ export declare class Accounts {
|
|
|
56
56
|
*
|
|
57
57
|
* @example
|
|
58
58
|
* await client.orgs.accounts.listV1({
|
|
59
|
+
* search: "search",
|
|
60
|
+
* filter_account_id: "filter_account_id",
|
|
59
61
|
* filter_org_id: "filter_org_id",
|
|
60
62
|
* filter_off_chrt_org_data_id: "filter_off_chrt_org_data_id",
|
|
61
63
|
* sort_by: "name",
|
|
@@ -67,7 +69,23 @@ export declare class Accounts {
|
|
|
67
69
|
listV1(request?: Chrt.orgs.AccountsListV1Request, requestOptions?: Accounts.RequestOptions): core.HttpResponsePromise<Chrt.AccountListRes>;
|
|
68
70
|
private __listV1;
|
|
69
71
|
/**
|
|
70
|
-
*
|
|
72
|
+
* 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])
|
|
73
|
+
*
|
|
74
|
+
* @param {Chrt.orgs.AccountsTypeaheadV1Request} request
|
|
75
|
+
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
76
|
+
*
|
|
77
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* await client.orgs.accounts.typeaheadV1({
|
|
81
|
+
* query: "query",
|
|
82
|
+
* limit: 1
|
|
83
|
+
* })
|
|
84
|
+
*/
|
|
85
|
+
typeaheadV1(request: Chrt.orgs.AccountsTypeaheadV1Request, requestOptions?: Accounts.RequestOptions): core.HttpResponsePromise<Chrt.AccountTypeaheadResult[]>;
|
|
86
|
+
private __typeaheadV1;
|
|
87
|
+
/**
|
|
88
|
+
* 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)
|
|
71
89
|
*
|
|
72
90
|
* @param {string} accountId
|
|
73
91
|
* @param {Chrt.orgs.AccountClientUpdate1} request
|
|
@@ -56,7 +56,7 @@ class Accounts {
|
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Creates a coordinator-private account
|
|
59
|
+
* 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)
|
|
60
60
|
*
|
|
61
61
|
* @param {Chrt.orgs.AccountClientCreate1} request
|
|
62
62
|
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -121,7 +121,7 @@ class Accounts {
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
|
-
* Lists coordinator-created shipper accounts with association filters, sorting, and pagination. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (AccountListRes)
|
|
124
|
+
* Lists coordinator-created shipper accounts with association filters, name search, sorting, and pagination. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (AccountListRes)
|
|
125
125
|
*
|
|
126
126
|
* @param {Chrt.orgs.AccountsListV1Request} request
|
|
127
127
|
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -130,6 +130,8 @@ class Accounts {
|
|
|
130
130
|
*
|
|
131
131
|
* @example
|
|
132
132
|
* await client.orgs.accounts.listV1({
|
|
133
|
+
* search: "search",
|
|
134
|
+
* filter_account_id: "filter_account_id",
|
|
133
135
|
* filter_org_id: "filter_org_id",
|
|
134
136
|
* filter_off_chrt_org_data_id: "filter_off_chrt_org_data_id",
|
|
135
137
|
* sort_by: "name",
|
|
@@ -144,8 +146,14 @@ class Accounts {
|
|
|
144
146
|
__listV1() {
|
|
145
147
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
146
148
|
var _a, _b, _c, _d, _e, _f;
|
|
147
|
-
const { filter_org_id: filterOrgId, filter_off_chrt_org_data_id: filterOffChrtOrgDataId, sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, } = request;
|
|
149
|
+
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;
|
|
148
150
|
const _queryParams = {};
|
|
151
|
+
if (search !== undefined) {
|
|
152
|
+
_queryParams["search"] = search;
|
|
153
|
+
}
|
|
154
|
+
if (filterAccountId !== undefined) {
|
|
155
|
+
_queryParams["filter_account_id"] = filterAccountId;
|
|
156
|
+
}
|
|
149
157
|
if (filterOrgId !== undefined) {
|
|
150
158
|
_queryParams["filter_org_id"] = filterOrgId;
|
|
151
159
|
}
|
|
@@ -207,7 +215,75 @@ class Accounts {
|
|
|
207
215
|
});
|
|
208
216
|
}
|
|
209
217
|
/**
|
|
210
|
-
*
|
|
218
|
+
* 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])
|
|
219
|
+
*
|
|
220
|
+
* @param {Chrt.orgs.AccountsTypeaheadV1Request} request
|
|
221
|
+
* @param {Accounts.RequestOptions} requestOptions - Request-specific configuration.
|
|
222
|
+
*
|
|
223
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* await client.orgs.accounts.typeaheadV1({
|
|
227
|
+
* query: "query",
|
|
228
|
+
* limit: 1
|
|
229
|
+
* })
|
|
230
|
+
*/
|
|
231
|
+
typeaheadV1(request, requestOptions) {
|
|
232
|
+
return core.HttpResponsePromise.fromPromise(this.__typeaheadV1(request, requestOptions));
|
|
233
|
+
}
|
|
234
|
+
__typeaheadV1(request, requestOptions) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
var _a, _b, _c, _d, _e;
|
|
237
|
+
const { query, limit } = request;
|
|
238
|
+
const _queryParams = {};
|
|
239
|
+
_queryParams["query"] = query;
|
|
240
|
+
if (limit !== undefined) {
|
|
241
|
+
_queryParams["limit"] = (_a = limit === null || limit === void 0 ? void 0 : limit.toString()) !== null && _a !== void 0 ? _a : null;
|
|
242
|
+
}
|
|
243
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
244
|
+
const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
|
|
245
|
+
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"),
|
|
246
|
+
method: "GET",
|
|
247
|
+
headers: _headers,
|
|
248
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
249
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
250
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
251
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
252
|
+
});
|
|
253
|
+
if (_response.ok) {
|
|
254
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
255
|
+
}
|
|
256
|
+
if (_response.error.reason === "status-code") {
|
|
257
|
+
switch (_response.error.statusCode) {
|
|
258
|
+
case 422:
|
|
259
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
260
|
+
default:
|
|
261
|
+
throw new errors.ChrtError({
|
|
262
|
+
statusCode: _response.error.statusCode,
|
|
263
|
+
body: _response.error.body,
|
|
264
|
+
rawResponse: _response.rawResponse,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
switch (_response.error.reason) {
|
|
269
|
+
case "non-json":
|
|
270
|
+
throw new errors.ChrtError({
|
|
271
|
+
statusCode: _response.error.statusCode,
|
|
272
|
+
body: _response.error.rawBody,
|
|
273
|
+
rawResponse: _response.rawResponse,
|
|
274
|
+
});
|
|
275
|
+
case "timeout":
|
|
276
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /orgs/accounts/typeahead/v1.");
|
|
277
|
+
case "unknown":
|
|
278
|
+
throw new errors.ChrtError({
|
|
279
|
+
message: _response.error.errorMessage,
|
|
280
|
+
rawResponse: _response.rawResponse,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* 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)
|
|
211
287
|
*
|
|
212
288
|
* @param {string} accountId
|
|
213
289
|
* @param {Chrt.orgs.AccountClientUpdate1} request
|
package/dist/cjs/api/resources/orgs/resources/accounts/client/requests/AccountClientCreate1.d.ts
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.js";
|
|
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/cjs/api/resources/orgs/resources/accounts/client/requests/AccountClientUpdate1.d.ts
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.js";
|
|
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/cjs/api/resources/orgs/resources/accounts/client/requests/AccountsListV1Request.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import * as Chrt from "../../../../../../index.js";
|
|
|
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.js";
|
|
|
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.js";
|
|
2
2
|
export { type AccountsListV1Request } from "./AccountsListV1Request.js";
|
|
3
|
+
export { type AccountsTypeaheadV1Request } from "./AccountsTypeaheadV1Request.js";
|
|
3
4
|
export { type AccountClientUpdate1 } from "./AccountClientUpdate1.js";
|
|
@@ -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
|
*
|
|
@@ -55,6 +55,131 @@ class Contacts {
|
|
|
55
55
|
constructor(_options = {}) {
|
|
56
56
|
this._options = _options;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Associates an account from the contact's organization. | authz: min_org_role=operator | (ContactAccountAddReq) -> (bool)
|
|
60
|
+
*
|
|
61
|
+
* @param {string} contactId
|
|
62
|
+
* @param {Chrt.orgs.ContactAccountAddReq} request
|
|
63
|
+
* @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.orgs.contacts.accountAddV1("contact_id", {
|
|
69
|
+
* account_id: "account_id"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
accountAddV1(contactId, request, requestOptions) {
|
|
73
|
+
return core.HttpResponsePromise.fromPromise(this.__accountAddV1(contactId, request, requestOptions));
|
|
74
|
+
}
|
|
75
|
+
__accountAddV1(contactId, request, requestOptions) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
var _a, _b, _c, _d;
|
|
78
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
79
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
80
|
+
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)}`),
|
|
81
|
+
method: "POST",
|
|
82
|
+
headers: _headers,
|
|
83
|
+
contentType: "application/json",
|
|
84
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
85
|
+
requestType: "json",
|
|
86
|
+
body: request,
|
|
87
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
88
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
89
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
90
|
+
});
|
|
91
|
+
if (_response.ok) {
|
|
92
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
93
|
+
}
|
|
94
|
+
if (_response.error.reason === "status-code") {
|
|
95
|
+
switch (_response.error.statusCode) {
|
|
96
|
+
case 422:
|
|
97
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
98
|
+
default:
|
|
99
|
+
throw new errors.ChrtError({
|
|
100
|
+
statusCode: _response.error.statusCode,
|
|
101
|
+
body: _response.error.body,
|
|
102
|
+
rawResponse: _response.rawResponse,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
switch (_response.error.reason) {
|
|
107
|
+
case "non-json":
|
|
108
|
+
throw new errors.ChrtError({
|
|
109
|
+
statusCode: _response.error.statusCode,
|
|
110
|
+
body: _response.error.rawBody,
|
|
111
|
+
rawResponse: _response.rawResponse,
|
|
112
|
+
});
|
|
113
|
+
case "timeout":
|
|
114
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /orgs/contacts/accounts/add/v1/{contact_id}.");
|
|
115
|
+
case "unknown":
|
|
116
|
+
throw new errors.ChrtError({
|
|
117
|
+
message: _response.error.errorMessage,
|
|
118
|
+
rawResponse: _response.rawResponse,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Removes an account association from an organization-created contact. | authz: min_org_role=operator | () -> (bool)
|
|
125
|
+
*
|
|
126
|
+
* @param {string} contactId
|
|
127
|
+
* @param {string} accountId
|
|
128
|
+
* @param {Contacts.RequestOptions} requestOptions - Request-specific configuration.
|
|
129
|
+
*
|
|
130
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* await client.orgs.contacts.accountRemoveV1("contact_id", "account_id")
|
|
134
|
+
*/
|
|
135
|
+
accountRemoveV1(contactId, accountId, requestOptions) {
|
|
136
|
+
return core.HttpResponsePromise.fromPromise(this.__accountRemoveV1(contactId, accountId, requestOptions));
|
|
137
|
+
}
|
|
138
|
+
__accountRemoveV1(contactId, accountId, requestOptions) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
var _a, _b, _c, _d;
|
|
141
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
142
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
143
|
+
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)}`),
|
|
144
|
+
method: "DELETE",
|
|
145
|
+
headers: _headers,
|
|
146
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
147
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
148
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
149
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
150
|
+
});
|
|
151
|
+
if (_response.ok) {
|
|
152
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
153
|
+
}
|
|
154
|
+
if (_response.error.reason === "status-code") {
|
|
155
|
+
switch (_response.error.statusCode) {
|
|
156
|
+
case 422:
|
|
157
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
158
|
+
default:
|
|
159
|
+
throw new errors.ChrtError({
|
|
160
|
+
statusCode: _response.error.statusCode,
|
|
161
|
+
body: _response.error.body,
|
|
162
|
+
rawResponse: _response.rawResponse,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
switch (_response.error.reason) {
|
|
167
|
+
case "non-json":
|
|
168
|
+
throw new errors.ChrtError({
|
|
169
|
+
statusCode: _response.error.statusCode,
|
|
170
|
+
body: _response.error.rawBody,
|
|
171
|
+
rawResponse: _response.rawResponse,
|
|
172
|
+
});
|
|
173
|
+
case "timeout":
|
|
174
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /orgs/contacts/accounts/remove/v1/{contact_id}/{account_id}.");
|
|
175
|
+
case "unknown":
|
|
176
|
+
throw new errors.ChrtError({
|
|
177
|
+
message: _response.error.errorMessage,
|
|
178
|
+
rawResponse: _response.rawResponse,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
58
183
|
/**
|
|
59
184
|
* Creates an organization-created contact. | authz: min_org_role=operator | (ContactClientCreate1) -> (PydanticObjectId)
|
|
60
185
|
*
|
package/dist/cjs/api/resources/orgs/resources/contacts/client/requests/ContactClientCreate1.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import * as Chrt from "../../../../../../index.js";
|
|
|
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.js";
|
|
1
2
|
export { type ContactClientCreate1 } from "./ContactClientCreate1.js";
|
|
2
3
|
export { type ContactsListV1Request } from "./ContactsListV1Request.js";
|
|
3
4
|
export { type ContactClientUpdate1 } from "./ContactClientUpdate1.js";
|
|
@@ -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
|
*
|