@chrt-inc/typescript-sdk 1.313.0 → 1.314.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/orders/client/Client.d.ts +3 -26
- package/dist/cjs/api/resources/orders/client/Client.js +4 -117
- package/dist/cjs/api/resources/orders/index.d.ts +1 -0
- package/dist/cjs/api/resources/orders/index.js +1 -0
- package/dist/cjs/api/resources/orders/resources/expanded/client/Client.d.ts +62 -0
- package/dist/cjs/api/resources/orders/resources/expanded/client/Client.js +194 -0
- package/dist/cjs/api/resources/orders/resources/expanded/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/orders/resources/expanded/client/index.js +2 -0
- package/dist/cjs/api/resources/orders/resources/expanded/index.d.ts +1 -0
- package/dist/cjs/api/resources/orders/resources/expanded/index.js +17 -0
- package/dist/cjs/api/resources/orders/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/orders/resources/index.js +37 -0
- package/dist/cjs/api/resources/taskGroups/client/Client.d.ts +3 -78
- package/dist/cjs/api/resources/taskGroups/client/Client.js +4 -353
- package/dist/cjs/api/resources/taskGroups/index.d.ts +1 -0
- package/dist/cjs/api/resources/taskGroups/index.js +1 -0
- package/dist/cjs/api/resources/taskGroups/resources/expanded/client/Client.d.ts +90 -0
- package/dist/cjs/api/resources/taskGroups/resources/expanded/client/Client.js +320 -0
- package/dist/cjs/api/resources/taskGroups/resources/expanded/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/taskGroups/resources/expanded/client/index.js +2 -0
- package/dist/cjs/api/resources/taskGroups/resources/expanded/index.d.ts +1 -0
- package/dist/cjs/api/resources/taskGroups/resources/expanded/index.js +17 -0
- package/dist/cjs/api/resources/taskGroups/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/taskGroups/resources/index.js +37 -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/orders/client/Client.d.mts +3 -26
- package/dist/esm/api/resources/orders/client/Client.mjs +4 -117
- package/dist/esm/api/resources/orders/index.d.mts +1 -0
- package/dist/esm/api/resources/orders/index.mjs +1 -0
- package/dist/esm/api/resources/orders/resources/expanded/client/Client.d.mts +62 -0
- package/dist/esm/api/resources/orders/resources/expanded/client/Client.mjs +157 -0
- package/dist/esm/api/resources/orders/resources/expanded/client/index.d.mts +1 -0
- package/dist/esm/api/resources/orders/resources/expanded/client/index.mjs +1 -0
- package/dist/esm/api/resources/orders/resources/expanded/index.d.mts +1 -0
- package/dist/esm/api/resources/orders/resources/expanded/index.mjs +1 -0
- package/dist/esm/api/resources/orders/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/orders/resources/index.mjs +1 -0
- package/dist/esm/api/resources/taskGroups/client/Client.d.mts +3 -78
- package/dist/esm/api/resources/taskGroups/client/Client.mjs +4 -353
- package/dist/esm/api/resources/taskGroups/index.d.mts +1 -0
- package/dist/esm/api/resources/taskGroups/index.mjs +1 -0
- package/dist/esm/api/resources/taskGroups/resources/expanded/client/Client.d.mts +90 -0
- package/dist/esm/api/resources/taskGroups/resources/expanded/client/Client.mjs +283 -0
- package/dist/esm/api/resources/taskGroups/resources/expanded/client/index.d.mts +1 -0
- package/dist/esm/api/resources/taskGroups/resources/expanded/client/index.mjs +1 -0
- package/dist/esm/api/resources/taskGroups/resources/expanded/index.d.mts +1 -0
- package/dist/esm/api/resources/taskGroups/resources/expanded/index.mjs +1 -0
- package/dist/esm/api/resources/taskGroups/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/taskGroups/resources/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +715 -789
package/dist/cjs/Client.js
CHANGED
|
@@ -71,8 +71,8 @@ class ChrtClient {
|
|
|
71
71
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
72
72
|
"X-Fern-Language": "JavaScript",
|
|
73
73
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
74
|
-
"X-Fern-SDK-Version": "1.
|
|
75
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
74
|
+
"X-Fern-SDK-Version": "1.314.0",
|
|
75
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.314.0",
|
|
76
76
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
77
77
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
78
78
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as environments from "../../../../environments.js";
|
|
5
5
|
import * as core from "../../../../core/index.js";
|
|
6
6
|
import * as Chrt from "../../../index.js";
|
|
7
|
+
import { Expanded } from "../resources/expanded/client/Client.js";
|
|
7
8
|
export declare namespace Orders {
|
|
8
9
|
interface Options {
|
|
9
10
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
@@ -29,33 +30,9 @@ export declare namespace Orders {
|
|
|
29
30
|
}
|
|
30
31
|
export declare class Orders {
|
|
31
32
|
protected readonly _options: Orders.Options;
|
|
33
|
+
protected _expanded: Expanded | undefined;
|
|
32
34
|
constructor(_options?: Orders.Options);
|
|
33
|
-
|
|
34
|
-
* Retrieves an expanded order with optional related data for shipper operators. | authz_personas=[shipper_org_operators] | (OrderAndTaskGroupExpandedReq) -> (OrderExpanded)
|
|
35
|
-
*
|
|
36
|
-
* @param {string} orderId
|
|
37
|
-
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
-
*
|
|
39
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* await client.orders.getExpandedForShipperOperatorsV1("order_id")
|
|
43
|
-
*/
|
|
44
|
-
getExpandedForShipperOperatorsV1(orderId: string, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Chrt.OrderExpanded>;
|
|
45
|
-
private __getExpandedForShipperOperatorsV1;
|
|
46
|
-
/**
|
|
47
|
-
* Retrieves an expanded order with optional related data for forwarder operators. | authz_personas=[forwarder_org_operators] | (OrderAndTaskGroupExpandedReq) -> (OrderExpanded)
|
|
48
|
-
*
|
|
49
|
-
* @param {string} orderId
|
|
50
|
-
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
51
|
-
*
|
|
52
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* await client.orders.getExpandedForForwarderOperatorsV1("order_id")
|
|
56
|
-
*/
|
|
57
|
-
getExpandedForForwarderOperatorsV1(orderId: string, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Chrt.OrderExpanded>;
|
|
58
|
-
private __getExpandedForForwarderOperatorsV1;
|
|
35
|
+
get expanded(): Expanded;
|
|
59
36
|
/**
|
|
60
37
|
* Retrieves a list of expanded orders with optional filters and related data for shipper operators. | authz_personas=[shipper_org_operators] | (OrdersExpandedListForShipperReq) -> (OrdersExpandedListRes)
|
|
61
38
|
*
|
|
@@ -51,127 +51,14 @@ const core = __importStar(require("../../../../core/index.js"));
|
|
|
51
51
|
const Chrt = __importStar(require("../../../index.js"));
|
|
52
52
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
53
53
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
54
|
+
const Client_js_1 = require("../resources/expanded/client/Client.js");
|
|
54
55
|
class Orders {
|
|
55
56
|
constructor(_options = {}) {
|
|
56
57
|
this._options = _options;
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
* @param {string} orderId
|
|
62
|
-
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
-
*
|
|
64
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* await client.orders.getExpandedForShipperOperatorsV1("order_id")
|
|
68
|
-
*/
|
|
69
|
-
getExpandedForShipperOperatorsV1(orderId, requestOptions) {
|
|
70
|
-
return core.HttpResponsePromise.fromPromise(this.__getExpandedForShipperOperatorsV1(orderId, requestOptions));
|
|
71
|
-
}
|
|
72
|
-
__getExpandedForShipperOperatorsV1(orderId, requestOptions) {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
var _a, _b, _c, _d;
|
|
75
|
-
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);
|
|
76
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
77
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/orders/orders/expanded/for_shipper_operators/v1/${encodeURIComponent(orderId)}`),
|
|
78
|
-
method: "GET",
|
|
79
|
-
headers: _headers,
|
|
80
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
81
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
82
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
83
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
84
|
-
});
|
|
85
|
-
if (_response.ok) {
|
|
86
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
87
|
-
}
|
|
88
|
-
if (_response.error.reason === "status-code") {
|
|
89
|
-
switch (_response.error.statusCode) {
|
|
90
|
-
case 422:
|
|
91
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
92
|
-
default:
|
|
93
|
-
throw new errors.ChrtError({
|
|
94
|
-
statusCode: _response.error.statusCode,
|
|
95
|
-
body: _response.error.body,
|
|
96
|
-
rawResponse: _response.rawResponse,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
switch (_response.error.reason) {
|
|
101
|
-
case "non-json":
|
|
102
|
-
throw new errors.ChrtError({
|
|
103
|
-
statusCode: _response.error.statusCode,
|
|
104
|
-
body: _response.error.rawBody,
|
|
105
|
-
rawResponse: _response.rawResponse,
|
|
106
|
-
});
|
|
107
|
-
case "timeout":
|
|
108
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/orders/orders/expanded/for_shipper_operators/v1/{order_id}.");
|
|
109
|
-
case "unknown":
|
|
110
|
-
throw new errors.ChrtError({
|
|
111
|
-
message: _response.error.errorMessage,
|
|
112
|
-
rawResponse: _response.rawResponse,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Retrieves an expanded order with optional related data for forwarder operators. | authz_personas=[forwarder_org_operators] | (OrderAndTaskGroupExpandedReq) -> (OrderExpanded)
|
|
119
|
-
*
|
|
120
|
-
* @param {string} orderId
|
|
121
|
-
* @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
|
|
122
|
-
*
|
|
123
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* await client.orders.getExpandedForForwarderOperatorsV1("order_id")
|
|
127
|
-
*/
|
|
128
|
-
getExpandedForForwarderOperatorsV1(orderId, requestOptions) {
|
|
129
|
-
return core.HttpResponsePromise.fromPromise(this.__getExpandedForForwarderOperatorsV1(orderId, requestOptions));
|
|
130
|
-
}
|
|
131
|
-
__getExpandedForForwarderOperatorsV1(orderId, requestOptions) {
|
|
132
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
-
var _a, _b, _c, _d;
|
|
134
|
-
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);
|
|
135
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
136
|
-
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/orders/orders/expanded/for_forwarder_operators/v1/${encodeURIComponent(orderId)}`),
|
|
137
|
-
method: "GET",
|
|
138
|
-
headers: _headers,
|
|
139
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
140
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
141
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
142
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
143
|
-
});
|
|
144
|
-
if (_response.ok) {
|
|
145
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
146
|
-
}
|
|
147
|
-
if (_response.error.reason === "status-code") {
|
|
148
|
-
switch (_response.error.statusCode) {
|
|
149
|
-
case 422:
|
|
150
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
151
|
-
default:
|
|
152
|
-
throw new errors.ChrtError({
|
|
153
|
-
statusCode: _response.error.statusCode,
|
|
154
|
-
body: _response.error.body,
|
|
155
|
-
rawResponse: _response.rawResponse,
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
switch (_response.error.reason) {
|
|
160
|
-
case "non-json":
|
|
161
|
-
throw new errors.ChrtError({
|
|
162
|
-
statusCode: _response.error.statusCode,
|
|
163
|
-
body: _response.error.rawBody,
|
|
164
|
-
rawResponse: _response.rawResponse,
|
|
165
|
-
});
|
|
166
|
-
case "timeout":
|
|
167
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/orders/orders/expanded/for_forwarder_operators/v1/{order_id}.");
|
|
168
|
-
case "unknown":
|
|
169
|
-
throw new errors.ChrtError({
|
|
170
|
-
message: _response.error.errorMessage,
|
|
171
|
-
rawResponse: _response.rawResponse,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
});
|
|
59
|
+
get expanded() {
|
|
60
|
+
var _a;
|
|
61
|
+
return ((_a = this._expanded) !== null && _a !== void 0 ? _a : (this._expanded = new Client_js_1.Expanded(this._options)));
|
|
175
62
|
}
|
|
176
63
|
/**
|
|
177
64
|
* Retrieves a list of expanded orders with optional filters and related data for shipper operators. | authz_personas=[shipper_org_operators] | (OrdersExpandedListForShipperReq) -> (OrdersExpandedListRes)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../../../core/index.js";
|
|
6
|
+
import * as Chrt from "../../../../../index.js";
|
|
7
|
+
export declare namespace Expanded {
|
|
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 Expanded {
|
|
31
|
+
protected readonly _options: Expanded.Options;
|
|
32
|
+
constructor(_options?: Expanded.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves an expanded order with optional related data for shipper operators. | authz_personas=[shipper_org_operators] | (OrderAndTaskGroupExpandedReq) -> (OrderExpanded)
|
|
35
|
+
*
|
|
36
|
+
* @param {string} orderId
|
|
37
|
+
* @param {Chrt.OrderAndTaskGroupExpandedReq} request
|
|
38
|
+
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.orders.expanded.forShipperOperatorsV1("order_id", {})
|
|
44
|
+
*/
|
|
45
|
+
forShipperOperatorsV1(orderId: string, request: Chrt.OrderAndTaskGroupExpandedReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderExpanded>;
|
|
46
|
+
private __forShipperOperatorsV1;
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves an expanded order with optional related data for forwarder operators. | authz_personas=[forwarder_org_operators] | (OrderAndTaskGroupExpandedReq) -> (OrderExpanded)
|
|
49
|
+
*
|
|
50
|
+
* @param {string} orderId
|
|
51
|
+
* @param {Chrt.OrderAndTaskGroupExpandedReq} request
|
|
52
|
+
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
53
|
+
*
|
|
54
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* await client.orders.expanded.forForwarderOperatorsV1("order_id", {})
|
|
58
|
+
*/
|
|
59
|
+
forForwarderOperatorsV1(orderId: string, request: Chrt.OrderAndTaskGroupExpandedReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderExpanded>;
|
|
60
|
+
private __forForwarderOperatorsV1;
|
|
61
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
62
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.Expanded = void 0;
|
|
49
|
+
const environments = __importStar(require("../../../../../../environments.js"));
|
|
50
|
+
const core = __importStar(require("../../../../../../core/index.js"));
|
|
51
|
+
const Chrt = __importStar(require("../../../../../index.js"));
|
|
52
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
53
|
+
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
54
|
+
class Expanded {
|
|
55
|
+
constructor(_options = {}) {
|
|
56
|
+
this._options = _options;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves an expanded order with optional related data for shipper operators. | authz_personas=[shipper_org_operators] | (OrderAndTaskGroupExpandedReq) -> (OrderExpanded)
|
|
60
|
+
*
|
|
61
|
+
* @param {string} orderId
|
|
62
|
+
* @param {Chrt.OrderAndTaskGroupExpandedReq} request
|
|
63
|
+
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.orders.expanded.forShipperOperatorsV1("order_id", {})
|
|
69
|
+
*/
|
|
70
|
+
forShipperOperatorsV1(orderId, request, requestOptions) {
|
|
71
|
+
return core.HttpResponsePromise.fromPromise(this.__forShipperOperatorsV1(orderId, request, requestOptions));
|
|
72
|
+
}
|
|
73
|
+
__forShipperOperatorsV1(orderId, request, requestOptions) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
var _a, _b, _c, _d;
|
|
76
|
+
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);
|
|
77
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
78
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/orders/expanded/for_shipper_operators/v1/${encodeURIComponent(orderId)}`),
|
|
79
|
+
method: "POST",
|
|
80
|
+
headers: _headers,
|
|
81
|
+
contentType: "application/json",
|
|
82
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
83
|
+
requestType: "json",
|
|
84
|
+
body: request,
|
|
85
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
86
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
87
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
88
|
+
});
|
|
89
|
+
if (_response.ok) {
|
|
90
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
91
|
+
}
|
|
92
|
+
if (_response.error.reason === "status-code") {
|
|
93
|
+
switch (_response.error.statusCode) {
|
|
94
|
+
case 422:
|
|
95
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
96
|
+
default:
|
|
97
|
+
throw new errors.ChrtError({
|
|
98
|
+
statusCode: _response.error.statusCode,
|
|
99
|
+
body: _response.error.body,
|
|
100
|
+
rawResponse: _response.rawResponse,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
switch (_response.error.reason) {
|
|
105
|
+
case "non-json":
|
|
106
|
+
throw new errors.ChrtError({
|
|
107
|
+
statusCode: _response.error.statusCode,
|
|
108
|
+
body: _response.error.rawBody,
|
|
109
|
+
rawResponse: _response.rawResponse,
|
|
110
|
+
});
|
|
111
|
+
case "timeout":
|
|
112
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/orders/expanded/for_shipper_operators/v1/{order_id}.");
|
|
113
|
+
case "unknown":
|
|
114
|
+
throw new errors.ChrtError({
|
|
115
|
+
message: _response.error.errorMessage,
|
|
116
|
+
rawResponse: _response.rawResponse,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Retrieves an expanded order with optional related data for forwarder operators. | authz_personas=[forwarder_org_operators] | (OrderAndTaskGroupExpandedReq) -> (OrderExpanded)
|
|
123
|
+
*
|
|
124
|
+
* @param {string} orderId
|
|
125
|
+
* @param {Chrt.OrderAndTaskGroupExpandedReq} request
|
|
126
|
+
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
127
|
+
*
|
|
128
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* await client.orders.expanded.forForwarderOperatorsV1("order_id", {})
|
|
132
|
+
*/
|
|
133
|
+
forForwarderOperatorsV1(orderId, request, requestOptions) {
|
|
134
|
+
return core.HttpResponsePromise.fromPromise(this.__forForwarderOperatorsV1(orderId, request, requestOptions));
|
|
135
|
+
}
|
|
136
|
+
__forForwarderOperatorsV1(orderId, request, requestOptions) {
|
|
137
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
var _a, _b, _c, _d;
|
|
139
|
+
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);
|
|
140
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
141
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `oort/orders/expanded/for_forwarder_operators/v1/${encodeURIComponent(orderId)}`),
|
|
142
|
+
method: "POST",
|
|
143
|
+
headers: _headers,
|
|
144
|
+
contentType: "application/json",
|
|
145
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
146
|
+
requestType: "json",
|
|
147
|
+
body: request,
|
|
148
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
149
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
150
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
151
|
+
});
|
|
152
|
+
if (_response.ok) {
|
|
153
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
154
|
+
}
|
|
155
|
+
if (_response.error.reason === "status-code") {
|
|
156
|
+
switch (_response.error.statusCode) {
|
|
157
|
+
case 422:
|
|
158
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
159
|
+
default:
|
|
160
|
+
throw new errors.ChrtError({
|
|
161
|
+
statusCode: _response.error.statusCode,
|
|
162
|
+
body: _response.error.body,
|
|
163
|
+
rawResponse: _response.rawResponse,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
switch (_response.error.reason) {
|
|
168
|
+
case "non-json":
|
|
169
|
+
throw new errors.ChrtError({
|
|
170
|
+
statusCode: _response.error.statusCode,
|
|
171
|
+
body: _response.error.rawBody,
|
|
172
|
+
rawResponse: _response.rawResponse,
|
|
173
|
+
});
|
|
174
|
+
case "timeout":
|
|
175
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/orders/expanded/for_forwarder_operators/v1/{order_id}.");
|
|
176
|
+
case "unknown":
|
|
177
|
+
throw new errors.ChrtError({
|
|
178
|
+
message: _response.error.errorMessage,
|
|
179
|
+
rawResponse: _response.rawResponse,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
_getAuthorizationHeader() {
|
|
185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
187
|
+
if (bearer != null) {
|
|
188
|
+
return `Bearer ${bearer}`;
|
|
189
|
+
}
|
|
190
|
+
return undefined;
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
exports.Expanded = Expanded;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as expanded from "./expanded/index.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.expanded = void 0;
|
|
37
|
+
exports.expanded = __importStar(require("./expanded/index.js"));
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as environments from "../../../../environments.js";
|
|
5
5
|
import * as core from "../../../../core/index.js";
|
|
6
6
|
import * as Chrt from "../../../index.js";
|
|
7
|
+
import { Expanded } from "../resources/expanded/client/Client.js";
|
|
7
8
|
export declare namespace TaskGroups {
|
|
8
9
|
interface Options {
|
|
9
10
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
@@ -29,85 +30,9 @@ export declare namespace TaskGroups {
|
|
|
29
30
|
}
|
|
30
31
|
export declare class TaskGroups {
|
|
31
32
|
protected readonly _options: TaskGroups.Options;
|
|
33
|
+
protected _expanded: Expanded | undefined;
|
|
32
34
|
constructor(_options?: TaskGroups.Options);
|
|
33
|
-
|
|
34
|
-
* Retrieves an expanded task group with optional related data for courier operators. | authz_personas=[courier_org_operators] | (OrderAndTaskGroupExpandedReq) -> (TaskGroupExpanded)
|
|
35
|
-
*
|
|
36
|
-
* @param {string} taskGroupId
|
|
37
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
-
*
|
|
39
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* await client.taskGroups.getExpandedForCourierOperatorsV1("task_group_id")
|
|
43
|
-
*/
|
|
44
|
-
getExpandedForCourierOperatorsV1(taskGroupId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpanded>;
|
|
45
|
-
private __getExpandedForCourierOperatorsV1;
|
|
46
|
-
/**
|
|
47
|
-
* Retrieves expanded task groups by order ID or short ID for courier operators. | authz_personas=[courier_org_operators] | (OrderAndTaskGroupExpandedReq) -> (list[TaskGroupExpanded])
|
|
48
|
-
*
|
|
49
|
-
* @param {string} orderIdOrShortId
|
|
50
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
51
|
-
*
|
|
52
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* await client.taskGroups.getExpandedForCourierOperatorsByOrderV1("order_id_or_short_id")
|
|
56
|
-
*/
|
|
57
|
-
getExpandedForCourierOperatorsByOrderV1(orderIdOrShortId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpanded[]>;
|
|
58
|
-
private __getExpandedForCourierOperatorsByOrderV1;
|
|
59
|
-
/**
|
|
60
|
-
* Retrieves an expanded task group with optional related data for courier drivers. | authz_personas=[courier_driver] | (OrderAndTaskGroupExpandedReq) -> (TaskGroupExpanded)
|
|
61
|
-
*
|
|
62
|
-
* @param {string} taskGroupId
|
|
63
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
-
*
|
|
65
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* await client.taskGroups.getExpandedForCourierDriverV1("task_group_id")
|
|
69
|
-
*/
|
|
70
|
-
getExpandedForCourierDriverV1(taskGroupId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpanded>;
|
|
71
|
-
private __getExpandedForCourierDriverV1;
|
|
72
|
-
/**
|
|
73
|
-
* Retrieves expanded task groups by order ID or short ID for courier drivers. | authz_personas=[courier_driver] | (OrderAndTaskGroupExpandedReq) -> (list[TaskGroupExpanded])
|
|
74
|
-
*
|
|
75
|
-
* @param {string} orderIdOrShortId
|
|
76
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
|
-
*
|
|
78
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* await client.taskGroups.getExpandedForCourierDriverByOrderV1("order_id_or_short_id")
|
|
82
|
-
*/
|
|
83
|
-
getExpandedForCourierDriverByOrderV1(orderIdOrShortId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpanded[]>;
|
|
84
|
-
private __getExpandedForCourierDriverByOrderV1;
|
|
85
|
-
/**
|
|
86
|
-
* Retrieves an expanded task group with optional related data for shipper operators. | authz_personas=[shipper_org_operators] | (OrderAndTaskGroupExpandedReq) -> (TaskGroupExpanded)
|
|
87
|
-
*
|
|
88
|
-
* @param {string} taskGroupId
|
|
89
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
90
|
-
*
|
|
91
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* await client.taskGroups.getExpandedForShipperOperatorsV1("task_group_id")
|
|
95
|
-
*/
|
|
96
|
-
getExpandedForShipperOperatorsV1(taskGroupId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpanded>;
|
|
97
|
-
private __getExpandedForShipperOperatorsV1;
|
|
98
|
-
/**
|
|
99
|
-
* Retrieves an expanded task group with optional related data for forwarder operators. | authz_personas=[forwarder_org_operators] | (OrderAndTaskGroupExpandedReq) -> (TaskGroupExpanded)
|
|
100
|
-
*
|
|
101
|
-
* @param {string} taskGroupId
|
|
102
|
-
* @param {TaskGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
103
|
-
*
|
|
104
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* await client.taskGroups.getExpandedForForwarderOperatorsV1("task_group_id")
|
|
108
|
-
*/
|
|
109
|
-
getExpandedForForwarderOperatorsV1(taskGroupId: string, requestOptions?: TaskGroups.RequestOptions): core.HttpResponsePromise<Chrt.TaskGroupExpanded>;
|
|
110
|
-
private __getExpandedForForwarderOperatorsV1;
|
|
35
|
+
get expanded(): Expanded;
|
|
111
36
|
/**
|
|
112
37
|
* Retrieves a list of expanded task groups with optional filters and related data for courier operators. | authz_personas=[courier_org_operators] | (TaskGroupExpandedListReq) -> (TaskGroupExpandedListRes)
|
|
113
38
|
*
|