@chrt-inc/typescript-sdk 1.616.0 → 1.625.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/billing/resources/lineItemGroups/client/Client.d.ts +0 -1
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.js +0 -1
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/requests/LineItemGroupsListForCourierOrgV1Request.d.ts +0 -1
- package/dist/cjs/api/resources/billing/resources/statements/client/Client.d.ts +0 -2
- package/dist/cjs/api/resources/billing/resources/statements/client/Client.js +0 -2
- package/dist/cjs/api/resources/billing/resources/statements/client/requests/StatementsExpandedListV1Request.d.ts +0 -1
- package/dist/cjs/api/resources/billing/resources/statements/client/requests/StatementsListV1Request.d.ts +0 -1
- package/dist/cjs/api/resources/orgs/client/Client.d.ts +0 -1
- package/dist/cjs/api/resources/orgs/client/Client.js +0 -1
- package/dist/cjs/api/resources/orgs/client/requests/OrgsListMembersV1Request.d.ts +0 -1
- package/dist/cjs/api/resources/shipping/client/Client.d.ts +0 -3
- package/dist/cjs/api/resources/shipping/client/Client.js +16 -21
- package/dist/cjs/api/resources/shipping/resources/drivers/client/Client.d.ts +0 -1
- package/dist/cjs/api/resources/shipping/resources/drivers/client/Client.js +0 -1
- package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/DriversListOrgMembersAndDriversV1Request.d.ts +0 -1
- package/dist/cjs/api/resources/shipping/resources/index.d.ts +0 -2
- package/dist/cjs/api/resources/shipping/resources/index.js +1 -3
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.d.ts +0 -2
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/Client.js +0 -2
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForForwarderOperatorsV1Request.d.ts +0 -1
- package/dist/cjs/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForShipperOperatorsV1Request.d.ts +0 -1
- package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/expanded/client/Client.d.ts +0 -2
- package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/expanded/client/Client.js +0 -2
- package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/expanded/client/requests/ExpandedListForCourierDriverV1Request.d.ts +0 -1
- package/dist/cjs/api/resources/shipping/resources/taskGroups/resources/expanded/client/requests/ExpandedListForCourierOperatorsV1Request.d.ts +0 -1
- package/dist/cjs/api/types/index.d.ts +0 -1
- package/dist/cjs/api/types/index.js +0 -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/billing/resources/lineItemGroups/client/Client.d.mts +0 -1
- package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.mjs +0 -1
- package/dist/esm/api/resources/billing/resources/lineItemGroups/client/requests/LineItemGroupsListForCourierOrgV1Request.d.mts +0 -1
- package/dist/esm/api/resources/billing/resources/statements/client/Client.d.mts +0 -2
- package/dist/esm/api/resources/billing/resources/statements/client/Client.mjs +0 -2
- package/dist/esm/api/resources/billing/resources/statements/client/requests/StatementsExpandedListV1Request.d.mts +0 -1
- package/dist/esm/api/resources/billing/resources/statements/client/requests/StatementsListV1Request.d.mts +0 -1
- package/dist/esm/api/resources/orgs/client/Client.d.mts +0 -1
- package/dist/esm/api/resources/orgs/client/Client.mjs +0 -1
- package/dist/esm/api/resources/orgs/client/requests/OrgsListMembersV1Request.d.mts +0 -1
- package/dist/esm/api/resources/shipping/client/Client.d.mts +0 -3
- package/dist/esm/api/resources/shipping/client/Client.mjs +0 -5
- package/dist/esm/api/resources/shipping/resources/drivers/client/Client.d.mts +0 -1
- package/dist/esm/api/resources/shipping/resources/drivers/client/Client.mjs +0 -1
- package/dist/esm/api/resources/shipping/resources/drivers/client/requests/DriversListOrgMembersAndDriversV1Request.d.mts +0 -1
- package/dist/esm/api/resources/shipping/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/shipping/resources/index.mjs +0 -2
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.d.mts +0 -2
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/Client.mjs +0 -2
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForForwarderOperatorsV1Request.d.mts +0 -1
- package/dist/esm/api/resources/shipping/resources/orders/resources/expanded/client/requests/ExpandedListForShipperOperatorsV1Request.d.mts +0 -1
- package/dist/esm/api/resources/shipping/resources/taskGroups/resources/expanded/client/Client.d.mts +0 -2
- package/dist/esm/api/resources/shipping/resources/taskGroups/resources/expanded/client/Client.mjs +0 -2
- package/dist/esm/api/resources/shipping/resources/taskGroups/resources/expanded/client/requests/ExpandedListForCourierDriverV1Request.d.mts +0 -1
- package/dist/esm/api/resources/shipping/resources/taskGroups/resources/expanded/client/requests/ExpandedListForCourierOperatorsV1Request.d.mts +0 -1
- package/dist/esm/api/types/index.d.mts +0 -1
- package/dist/esm/api/types/index.mjs +0 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +0 -77
- package/dist/cjs/api/resources/shipping/resources/docs/client/Client.d.ts +0 -40
- package/dist/cjs/api/resources/shipping/resources/docs/client/Client.js +0 -124
- package/dist/cjs/api/resources/shipping/resources/docs/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/shipping/resources/docs/client/index.js +0 -17
- package/dist/cjs/api/resources/shipping/resources/docs/client/requests/GenerateShippingDocReq.d.ts +0 -15
- package/dist/cjs/api/resources/shipping/resources/docs/client/requests/GenerateShippingDocReq.js +0 -5
- package/dist/cjs/api/resources/shipping/resources/docs/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/shipping/resources/docs/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/shipping/resources/docs/index.d.ts +0 -1
- package/dist/cjs/api/resources/shipping/resources/docs/index.js +0 -17
- package/dist/cjs/api/types/ShippingDocTemplateEnum.d.ts +0 -8
- package/dist/cjs/api/types/ShippingDocTemplateEnum.js +0 -10
- package/dist/esm/api/resources/shipping/resources/docs/client/Client.d.mts +0 -40
- package/dist/esm/api/resources/shipping/resources/docs/client/Client.mjs +0 -87
- package/dist/esm/api/resources/shipping/resources/docs/client/index.d.mts +0 -2
- package/dist/esm/api/resources/shipping/resources/docs/client/index.mjs +0 -1
- package/dist/esm/api/resources/shipping/resources/docs/client/requests/GenerateShippingDocReq.d.mts +0 -15
- package/dist/esm/api/resources/shipping/resources/docs/client/requests/GenerateShippingDocReq.mjs +0 -4
- package/dist/esm/api/resources/shipping/resources/docs/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/shipping/resources/docs/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/shipping/resources/docs/index.d.mts +0 -1
- package/dist/esm/api/resources/shipping/resources/docs/index.mjs +0 -1
- package/dist/esm/api/types/ShippingDocTemplateEnum.d.mts +0 -8
- package/dist/esm/api/types/ShippingDocTemplateEnum.mjs +0 -7
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
import * as environments from "../../../../../../environments.mjs";
|
|
14
|
-
import * as core from "../../../../../../core/index.mjs";
|
|
15
|
-
import * as Chrt from "../../../../../index.mjs";
|
|
16
|
-
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
17
|
-
import * as errors from "../../../../../../errors/index.mjs";
|
|
18
|
-
export class Docs {
|
|
19
|
-
constructor(_options = {}) {
|
|
20
|
-
this._options = _options;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Generates a shipping document (BOL or POD) as a PDF for the given order. | authz_personas=[order_creator_org_operators] | (GenerateShippingDocReq) -> (PDF binary)
|
|
24
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
25
|
-
*/
|
|
26
|
-
postGenerateV1(request, requestOptions) {
|
|
27
|
-
return core.HttpResponsePromise.fromPromise(this.__postGenerateV1(request, requestOptions));
|
|
28
|
-
}
|
|
29
|
-
__postGenerateV1(request, requestOptions) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
var _a, _b, _c, _d;
|
|
32
|
-
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
33
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
34
|
-
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, "shipping/docs/v1"),
|
|
35
|
-
method: "POST",
|
|
36
|
-
headers: _headers,
|
|
37
|
-
contentType: "application/json",
|
|
38
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
39
|
-
requestType: "json",
|
|
40
|
-
body: request,
|
|
41
|
-
responseType: "binary-response",
|
|
42
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
43
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
44
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
45
|
-
});
|
|
46
|
-
if (_response.ok) {
|
|
47
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
48
|
-
}
|
|
49
|
-
if (_response.error.reason === "status-code") {
|
|
50
|
-
switch (_response.error.statusCode) {
|
|
51
|
-
case 422:
|
|
52
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
53
|
-
default:
|
|
54
|
-
throw new errors.ChrtError({
|
|
55
|
-
statusCode: _response.error.statusCode,
|
|
56
|
-
body: _response.error.body,
|
|
57
|
-
rawResponse: _response.rawResponse,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
switch (_response.error.reason) {
|
|
62
|
-
case "non-json":
|
|
63
|
-
throw new errors.ChrtError({
|
|
64
|
-
statusCode: _response.error.statusCode,
|
|
65
|
-
body: _response.error.rawBody,
|
|
66
|
-
rawResponse: _response.rawResponse,
|
|
67
|
-
});
|
|
68
|
-
case "timeout":
|
|
69
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/docs/v1.");
|
|
70
|
-
case "unknown":
|
|
71
|
-
throw new errors.ChrtError({
|
|
72
|
-
message: _response.error.errorMessage,
|
|
73
|
-
rawResponse: _response.rawResponse,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
_getAuthorizationHeader() {
|
|
79
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
const bearer = yield core.Supplier.get(this._options.token);
|
|
81
|
-
if (bearer != null) {
|
|
82
|
-
return `Bearer ${bearer}`;
|
|
83
|
-
}
|
|
84
|
-
return undefined;
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./requests/index.mjs";
|
package/dist/esm/api/resources/shipping/resources/docs/client/requests/GenerateShippingDocReq.d.mts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as Chrt from "../../../../../../index.mjs";
|
|
5
|
-
/**
|
|
6
|
-
* @example
|
|
7
|
-
* {
|
|
8
|
-
* order_ref: "order_ref",
|
|
9
|
-
* template: "pod"
|
|
10
|
-
* }
|
|
11
|
-
*/
|
|
12
|
-
export interface GenerateShippingDocReq {
|
|
13
|
-
order_ref: string;
|
|
14
|
-
template: Chrt.ShippingDocTemplateEnum;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type GenerateShippingDocReq } from "./GenerateShippingDocReq.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.mjs";
|