@chrt-inc/typescript-sdk 1.303.0 → 1.304.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -604
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/connections/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/connections/client/Client.js +3 -3
- package/dist/cjs/api/resources/connections/resources/connectionToCourier/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/connections/resources/connectionToCourier/client/Client.js +1 -1
- package/dist/cjs/api/resources/connections/resources/connectionToForwarder/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/connections/resources/connectionToForwarder/client/Client.js +1 -1
- package/dist/cjs/api/resources/connections/resources/connectionToShipper/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/connections/resources/connectionToShipper/client/Client.js +1 -1
- package/dist/cjs/api/resources/dev/client/Client.d.ts +9 -9
- package/dist/cjs/api/resources/dev/client/Client.js +9 -9
- package/dist/cjs/api/resources/notifications/resources/courier/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/notifications/resources/courier/client/Client.js +2 -2
- package/dist/cjs/api/resources/notifications/resources/shipper/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/notifications/resources/shipper/client/Client.js +2 -2
- package/dist/cjs/api/resources/orderDrafts/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/orderDrafts/client/Client.js +125 -0
- package/dist/cjs/api/resources/orderDrafts/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/orders/client/Client.d.ts +0 -3
- package/dist/cjs/api/resources/orders/client/Client.js +0 -5
- package/dist/cjs/api/resources/orders/resources/index.d.ts +0 -1
- package/dist/cjs/api/resources/orders/resources/index.js +1 -2
- package/dist/cjs/api/resources/orgConnectionInfos/resources/courier/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/orgConnectionInfos/resources/courier/client/Client.js +3 -3
- package/dist/cjs/api/resources/orgConnectionInfos/resources/shipper/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/orgConnectionInfos/resources/shipper/client/Client.js +3 -3
- package/dist/cjs/api/resources/orgProfiles/client/Client.d.ts +7 -7
- package/dist/cjs/api/resources/orgProfiles/client/Client.js +7 -7
- package/dist/cjs/api/resources/orgs/client/Client.d.ts +8 -8
- package/dist/cjs/api/resources/orgs/client/Client.js +7 -7
- package/dist/cjs/api/resources/root/client/Client.d.ts +8 -8
- package/dist/cjs/api/resources/root/client/Client.js +5 -5
- package/dist/cjs/api/resources/taskArtifactNotifications/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/taskArtifactNotifications/client/Client.js +2 -2
- package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tracking/resources/cargoByDevice/client/Client.js +1 -1
- package/dist/cjs/api/resources/tracking/resources/cargoByDriver/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tracking/resources/cargoByDriver/client/Client.js +1 -1
- package/dist/cjs/api/resources/tracking/resources/devices/client/Client.d.ts +7 -7
- package/dist/cjs/api/resources/tracking/resources/devices/client/Client.js +7 -7
- package/dist/cjs/api/resources/tracking/resources/driver/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/tracking/resources/driver/client/Client.js +1 -1
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.d.ts +14 -14
- package/dist/cjs/api/resources/tracking/resources/sessionByDevice/client/Client.js +14 -14
- package/dist/cjs/api/resources/tracking/resources/taskGroupByDriver/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tracking/resources/taskGroupByDriver/client/Client.js +1 -1
- package/dist/cjs/api/resources/users/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/users/client/Client.js +1 -1
- package/dist/cjs/api/resources/utils/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/utils/client/Client.js +1 -1
- package/dist/cjs/api/types/Cargo1.d.ts +1 -1
- package/dist/cjs/api/types/CargoClientCreate1.d.ts +1 -1
- package/dist/cjs/api/types/CargoClientUpdate1.d.ts +1 -1
- package/dist/{esm/api/types/DriverUpdateResp.d.mts → cjs/api/types/DriverUpdateRes.d.ts} +1 -1
- package/dist/cjs/api/types/TaskClientUpdate1.d.ts +0 -1
- package/dist/cjs/api/types/index.d.ts +1 -1
- package/dist/cjs/api/types/index.js +1 -1
- 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/connections/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/connections/client/Client.mjs +3 -3
- package/dist/esm/api/resources/connections/resources/connectionToCourier/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/connections/resources/connectionToCourier/client/Client.mjs +1 -1
- package/dist/esm/api/resources/connections/resources/connectionToForwarder/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/connections/resources/connectionToForwarder/client/Client.mjs +1 -1
- package/dist/esm/api/resources/connections/resources/connectionToShipper/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/connections/resources/connectionToShipper/client/Client.mjs +1 -1
- package/dist/esm/api/resources/dev/client/Client.d.mts +9 -9
- package/dist/esm/api/resources/dev/client/Client.mjs +9 -9
- package/dist/esm/api/resources/notifications/resources/courier/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/notifications/resources/courier/client/Client.mjs +2 -2
- package/dist/esm/api/resources/notifications/resources/shipper/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/notifications/resources/shipper/client/Client.mjs +2 -2
- package/dist/esm/api/resources/orderDrafts/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/orderDrafts/client/Client.mjs +125 -0
- package/dist/esm/api/resources/orderDrafts/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/orders/client/Client.d.mts +0 -3
- package/dist/esm/api/resources/orders/client/Client.mjs +0 -5
- package/dist/esm/api/resources/orders/resources/index.d.mts +0 -1
- package/dist/esm/api/resources/orders/resources/index.mjs +0 -1
- package/dist/esm/api/resources/orgConnectionInfos/resources/courier/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/orgConnectionInfos/resources/courier/client/Client.mjs +3 -3
- package/dist/esm/api/resources/orgConnectionInfos/resources/shipper/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/orgConnectionInfos/resources/shipper/client/Client.mjs +3 -3
- package/dist/esm/api/resources/orgProfiles/client/Client.d.mts +7 -7
- package/dist/esm/api/resources/orgProfiles/client/Client.mjs +7 -7
- package/dist/esm/api/resources/orgs/client/Client.d.mts +8 -8
- package/dist/esm/api/resources/orgs/client/Client.mjs +7 -7
- package/dist/esm/api/resources/root/client/Client.d.mts +8 -8
- package/dist/esm/api/resources/root/client/Client.mjs +5 -5
- package/dist/esm/api/resources/taskArtifactNotifications/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/taskArtifactNotifications/client/Client.mjs +2 -2
- package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tracking/resources/cargoByDevice/client/Client.mjs +1 -1
- package/dist/esm/api/resources/tracking/resources/cargoByDriver/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tracking/resources/cargoByDriver/client/Client.mjs +1 -1
- package/dist/esm/api/resources/tracking/resources/devices/client/Client.d.mts +7 -7
- package/dist/esm/api/resources/tracking/resources/devices/client/Client.mjs +7 -7
- package/dist/esm/api/resources/tracking/resources/driver/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/tracking/resources/driver/client/Client.mjs +1 -1
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.d.mts +14 -14
- package/dist/esm/api/resources/tracking/resources/sessionByDevice/client/Client.mjs +14 -14
- package/dist/esm/api/resources/tracking/resources/taskGroupByDriver/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tracking/resources/taskGroupByDriver/client/Client.mjs +1 -1
- package/dist/esm/api/resources/users/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/users/client/Client.mjs +1 -1
- package/dist/esm/api/resources/utils/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/utils/client/Client.mjs +1 -1
- package/dist/esm/api/types/Cargo1.d.mts +1 -1
- package/dist/esm/api/types/CargoClientCreate1.d.mts +1 -1
- package/dist/esm/api/types/CargoClientUpdate1.d.mts +1 -1
- package/dist/{cjs/api/types/DriverUpdateResp.d.ts → esm/api/types/DriverUpdateRes.d.mts} +1 -1
- package/dist/esm/api/types/TaskClientUpdate1.d.mts +0 -1
- package/dist/esm/api/types/index.d.mts +1 -1
- package/dist/esm/api/types/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +212 -214
- package/dist/cjs/api/resources/orders/resources/draft/client/Client.d.ts +0 -23
- package/dist/cjs/api/resources/orders/resources/draft/client/Client.js +0 -17
- package/dist/cjs/api/resources/orders/resources/draft/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/orders/resources/draft/client/index.js +0 -2
- package/dist/cjs/api/resources/orders/resources/draft/index.d.ts +0 -2
- package/dist/cjs/api/resources/orders/resources/draft/index.js +0 -18
- package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/Client.d.ts +0 -61
- package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/Client.js +0 -193
- package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/index.js +0 -17
- package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/index.d.ts +0 -1
- package/dist/cjs/api/resources/orders/resources/draft/resources/expanded/index.js +0 -17
- package/dist/cjs/api/resources/orders/resources/draft/resources/index.d.ts +0 -2
- package/dist/cjs/api/resources/orders/resources/draft/resources/index.js +0 -41
- package/dist/esm/api/resources/orders/resources/draft/client/Client.d.mts +0 -23
- package/dist/esm/api/resources/orders/resources/draft/client/Client.mjs +0 -13
- package/dist/esm/api/resources/orders/resources/draft/client/index.d.mts +0 -1
- package/dist/esm/api/resources/orders/resources/draft/client/index.mjs +0 -1
- package/dist/esm/api/resources/orders/resources/draft/index.d.mts +0 -2
- package/dist/esm/api/resources/orders/resources/draft/index.mjs +0 -2
- package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/Client.d.mts +0 -61
- package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/Client.mjs +0 -156
- package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/index.d.mts +0 -2
- package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/index.mjs +0 -1
- package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/orders/resources/draft/resources/expanded/index.d.mts +0 -1
- package/dist/esm/api/resources/orders/resources/draft/resources/expanded/index.mjs +0 -1
- package/dist/esm/api/resources/orders/resources/draft/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/orders/resources/draft/resources/index.mjs +0 -2
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.js +0 -0
- /package/dist/cjs/api/types/{DriverUpdateResp.js → DriverUpdateRes.js} +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedListReq.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/draft/resources/expanded → orderDrafts}/client/requests/OrderDraftExpandedReq.mjs +0 -0
- /package/dist/esm/api/types/{DriverUpdateResp.mjs → DriverUpdateRes.mjs} +0 -0
|
@@ -1,23 +0,0 @@
|
|
|
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 { Expanded } from "../resources/expanded/client/Client.js";
|
|
7
|
-
export declare namespace Draft {
|
|
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
|
-
}
|
|
18
|
-
export declare class Draft {
|
|
19
|
-
protected readonly _options: Draft.Options;
|
|
20
|
-
protected _expanded: Expanded | undefined;
|
|
21
|
-
constructor(_options?: Draft.Options);
|
|
22
|
-
get expanded(): Expanded;
|
|
23
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Draft = void 0;
|
|
7
|
-
const Client_js_1 = require("../resources/expanded/client/Client.js");
|
|
8
|
-
class Draft {
|
|
9
|
-
constructor(_options = {}) {
|
|
10
|
-
this._options = _options;
|
|
11
|
-
}
|
|
12
|
-
get expanded() {
|
|
13
|
-
var _a;
|
|
14
|
-
return ((_a = this._expanded) !== null && _a !== void 0 ? _a : (this._expanded = new Client_js_1.Expanded(this._options)));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.Draft = Draft;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
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);
|
|
18
|
-
__exportStar(require("./resources/index.js"), exports);
|
|
@@ -1,61 +0,0 @@
|
|
|
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
|
-
* Fetches a single draft order with optional expanded related data. Only the creator of the draft order can access it.
|
|
35
|
-
*
|
|
36
|
-
* @param {string} orderIdOrShortId
|
|
37
|
-
* @param {Chrt.orders.draft.OrderDraftExpandedReq} request
|
|
38
|
-
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
-
*
|
|
40
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* await client.orders.draft.expanded.postExpandedV1("order_id_or_short_id")
|
|
44
|
-
*/
|
|
45
|
-
postExpandedV1(orderIdOrShortId: string, request?: Chrt.orders.draft.OrderDraftExpandedReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderDraftExpandedRes>;
|
|
46
|
-
private __postExpandedV1;
|
|
47
|
-
/**
|
|
48
|
-
* Lists all draft orders created by the authenticated user with optional expanded related data.
|
|
49
|
-
*
|
|
50
|
-
* @param {Chrt.orders.draft.OrderDraftExpandedListReq} request
|
|
51
|
-
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
|
-
*
|
|
53
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* await client.orders.draft.expanded.postExpandedListV1()
|
|
57
|
-
*/
|
|
58
|
-
postExpandedListV1(request?: Chrt.orders.draft.OrderDraftExpandedListReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderDraftExpandedListRes>;
|
|
59
|
-
private __postExpandedListV1;
|
|
60
|
-
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
61
|
-
}
|
|
@@ -1,193 +0,0 @@
|
|
|
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
|
-
* Fetches a single draft order with optional expanded related data. Only the creator of the draft order can access it.
|
|
60
|
-
*
|
|
61
|
-
* @param {string} orderIdOrShortId
|
|
62
|
-
* @param {Chrt.orders.draft.OrderDraftExpandedReq} request
|
|
63
|
-
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
-
*
|
|
65
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* await client.orders.draft.expanded.postExpandedV1("order_id_or_short_id")
|
|
69
|
-
*/
|
|
70
|
-
postExpandedV1(orderIdOrShortId, request = {}, requestOptions) {
|
|
71
|
-
return core.HttpResponsePromise.fromPromise(this.__postExpandedV1(orderIdOrShortId, request, requestOptions));
|
|
72
|
-
}
|
|
73
|
-
__postExpandedV1(orderIdOrShortId_1) {
|
|
74
|
-
return __awaiter(this, arguments, void 0, function* (orderIdOrShortId, request = {}, requestOptions) {
|
|
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/order_drafts/expanded/v1/${encodeURIComponent(orderIdOrShortId)}`),
|
|
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/order_drafts/expanded/v1/{order_id_or_short_id}.");
|
|
113
|
-
case "unknown":
|
|
114
|
-
throw new errors.ChrtError({
|
|
115
|
-
message: _response.error.errorMessage,
|
|
116
|
-
rawResponse: _response.rawResponse,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Lists all draft orders created by the authenticated user with optional expanded related data.
|
|
123
|
-
*
|
|
124
|
-
* @param {Chrt.orders.draft.OrderDraftExpandedListReq} request
|
|
125
|
-
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
126
|
-
*
|
|
127
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* await client.orders.draft.expanded.postExpandedListV1()
|
|
131
|
-
*/
|
|
132
|
-
postExpandedListV1(request = {}, requestOptions) {
|
|
133
|
-
return core.HttpResponsePromise.fromPromise(this.__postExpandedListV1(request, requestOptions));
|
|
134
|
-
}
|
|
135
|
-
__postExpandedListV1() {
|
|
136
|
-
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
137
|
-
var _a, _b, _c, _d;
|
|
138
|
-
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);
|
|
139
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
140
|
-
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/order_drafts/expanded/list/v1"),
|
|
141
|
-
method: "POST",
|
|
142
|
-
headers: _headers,
|
|
143
|
-
contentType: "application/json",
|
|
144
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
145
|
-
requestType: "json",
|
|
146
|
-
body: request,
|
|
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 POST /oort/order_drafts/expanded/list/v1.");
|
|
175
|
-
case "unknown":
|
|
176
|
-
throw new errors.ChrtError({
|
|
177
|
-
message: _response.error.errorMessage,
|
|
178
|
-
rawResponse: _response.rawResponse,
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
_getAuthorizationHeader() {
|
|
184
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
-
const bearer = yield core.Supplier.get(this._options.token);
|
|
186
|
-
if (bearer != null) {
|
|
187
|
-
return `Bearer ${bearer}`;
|
|
188
|
-
}
|
|
189
|
-
return undefined;
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
exports.Expanded = Expanded;
|
|
@@ -1,17 +0,0 @@
|
|
|
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("./requests/index.js"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.js";
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.expanded = void 0;
|
|
40
|
-
exports.expanded = __importStar(require("./expanded/index.js"));
|
|
41
|
-
__exportStar(require("./expanded/client/requests/index.js"), exports);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as environments from "../../../../../../environments.mjs";
|
|
5
|
-
import * as core from "../../../../../../core/index.mjs";
|
|
6
|
-
import { Expanded } from "../resources/expanded/client/Client.mjs";
|
|
7
|
-
export declare namespace Draft {
|
|
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
|
-
}
|
|
18
|
-
export declare class Draft {
|
|
19
|
-
protected readonly _options: Draft.Options;
|
|
20
|
-
protected _expanded: Expanded | undefined;
|
|
21
|
-
constructor(_options?: Draft.Options);
|
|
22
|
-
get expanded(): Expanded;
|
|
23
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import { Expanded } from "../resources/expanded/client/Client.mjs";
|
|
5
|
-
export class Draft {
|
|
6
|
-
constructor(_options = {}) {
|
|
7
|
-
this._options = _options;
|
|
8
|
-
}
|
|
9
|
-
get expanded() {
|
|
10
|
-
var _a;
|
|
11
|
-
return ((_a = this._expanded) !== null && _a !== void 0 ? _a : (this._expanded = new Expanded(this._options)));
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/api/resources/orders/resources/draft/resources/expanded/client/Client.d.mts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as environments from "../../../../../../../../environments.mjs";
|
|
5
|
-
import * as core from "../../../../../../../../core/index.mjs";
|
|
6
|
-
import * as Chrt from "../../../../../../../index.mjs";
|
|
7
|
-
export declare namespace 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
|
-
* Fetches a single draft order with optional expanded related data. Only the creator of the draft order can access it.
|
|
35
|
-
*
|
|
36
|
-
* @param {string} orderIdOrShortId
|
|
37
|
-
* @param {Chrt.orders.draft.OrderDraftExpandedReq} request
|
|
38
|
-
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
-
*
|
|
40
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* await client.orders.draft.expanded.postExpandedV1("order_id_or_short_id")
|
|
44
|
-
*/
|
|
45
|
-
postExpandedV1(orderIdOrShortId: string, request?: Chrt.orders.draft.OrderDraftExpandedReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderDraftExpandedRes>;
|
|
46
|
-
private __postExpandedV1;
|
|
47
|
-
/**
|
|
48
|
-
* Lists all draft orders created by the authenticated user with optional expanded related data.
|
|
49
|
-
*
|
|
50
|
-
* @param {Chrt.orders.draft.OrderDraftExpandedListReq} request
|
|
51
|
-
* @param {Expanded.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
|
-
*
|
|
53
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* await client.orders.draft.expanded.postExpandedListV1()
|
|
57
|
-
*/
|
|
58
|
-
postExpandedListV1(request?: Chrt.orders.draft.OrderDraftExpandedListReq, requestOptions?: Expanded.RequestOptions): core.HttpResponsePromise<Chrt.OrderDraftExpandedListRes>;
|
|
59
|
-
private __postExpandedListV1;
|
|
60
|
-
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
61
|
-
}
|