@chrt-inc/typescript-sdk 0.0.205 → 0.0.224
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 +1 -1
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +11 -6
- package/dist/cjs/api/resources/courierPayDriverRateSheets/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/courierPayDriverRateSheets/client/Client.js +1 -1
- package/dist/cjs/api/resources/courierPayDriverRateSheets/client/requests/CourierPayDriverRateSheetClientCreate1.d.ts +2 -2
- package/dist/cjs/api/resources/courierPayDriverRateSheets/client/requests/CourierPayDriverRateSheetClientUpdate1.d.ts +1 -1
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/offChrtShipperOrgInfo/client/Client.d.ts +13 -0
- package/dist/cjs/api/resources/offChrtShipperOrgInfo/client/Client.js +57 -0
- package/dist/cjs/api/resources/payments/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/payments/client/Client.js +2 -2
- package/dist/cjs/api/resources/payments/client/requests/{CreateCheckoutSessionReq2.d.ts → CreateCheckoutSessionReq.d.ts} +2 -2
- package/dist/cjs/api/resources/payments/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/client/Client.d.ts +8 -2
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/client/Client.js +16 -6
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/Client.d.ts +42 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/Client.js +119 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/index.js +2 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/courier/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/courier/index.js +17 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/index.js +3 -1
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/shipper/client/Client.d.ts +68 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/shipper/client/Client.js +234 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/shipper/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/shipper/client/index.js +2 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/shipper/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/resources/shipper/index.js +17 -0
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/Client.js +1 -1
- package/dist/cjs/api/resources/shipperPayCourierRateSheets/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/shipperPayCourierRateSheets/client/Client.js +1 -1
- package/dist/cjs/api/resources/shipperPayCourierRateSheets/client/requests/ShipperPayCourierRateSheetClientCreate1.d.ts +2 -2
- package/dist/cjs/api/resources/shipperPayCourierRateSheets/client/requests/ShipperPayCourierRateSheetClientUpdate1.d.ts +1 -1
- package/dist/cjs/api/resources/taskGroups/client/Client.d.ts +15 -0
- package/dist/cjs/api/resources/taskGroups/client/Client.js +62 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/TaskGroupsExpandedReq.d.ts +18 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/users/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/utils/client/Client.d.ts +48 -0
- package/dist/cjs/api/resources/utils/client/Client.js +133 -0
- package/dist/cjs/api/resources/utils/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/utils/client/index.js +17 -0
- package/dist/cjs/api/resources/utils/client/requests/UtilsGetTimezoneRequest.d.ts +20 -0
- package/dist/cjs/api/resources/utils/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/utils/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/utils/index.d.ts +1 -0
- package/dist/cjs/api/resources/utils/index.js +17 -0
- package/dist/cjs/api/types/ClerkOrgData.d.ts +11 -0
- package/dist/cjs/api/types/ClerkOrgData.js +5 -0
- package/dist/cjs/api/types/CourierPayDriverRateSheet1.d.ts +1 -1
- package/dist/{esm/api/types/CreateCheckoutSessionRes2.d.mts → cjs/api/types/CreateCheckoutSessionRes.d.ts} +1 -1
- package/dist/cjs/api/types/CreateCheckoutSessionRes.js +5 -0
- package/dist/cjs/api/types/DecodedJwtWithOrgAndUserId.d.ts +5 -7
- package/dist/cjs/api/types/PriceNameEnum.d.ts +4 -4
- package/dist/cjs/api/types/PriceNameEnum.js +3 -3
- package/dist/cjs/api/types/ShipperPayCourierRateSheet1.d.ts +1 -1
- package/dist/cjs/api/types/TaskExpanded.d.ts +13 -0
- package/dist/cjs/api/types/TaskExpanded.js +5 -0
- package/dist/cjs/api/types/TaskGroupExpanded.d.ts +11 -0
- package/dist/cjs/api/types/TaskGroupExpanded.js +5 -0
- package/dist/cjs/api/types/TaskGroupsExpandedRes.d.ts +10 -0
- package/dist/cjs/api/types/TaskGroupsExpandedRes.js +5 -0
- package/dist/cjs/api/types/TimezoneResponse.d.ts +12 -0
- package/dist/cjs/api/types/TimezoneResponse.js +5 -0
- package/dist/cjs/api/types/{UserPublicData6.d.ts → UserPublicData1.d.ts} +2 -5
- package/dist/cjs/api/types/UserPublicData1.js +5 -0
- package/dist/cjs/api/types/index.d.ts +7 -2
- package/dist/cjs/api/types/index.js +7 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +7 -2
- package/dist/esm/api/resources/courierPayDriverRateSheets/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/courierPayDriverRateSheets/client/Client.mjs +1 -1
- package/dist/esm/api/resources/courierPayDriverRateSheets/client/requests/CourierPayDriverRateSheetClientCreate1.d.mts +2 -2
- package/dist/esm/api/resources/courierPayDriverRateSheets/client/requests/CourierPayDriverRateSheetClientUpdate1.d.mts +1 -1
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/offChrtShipperOrgInfo/client/Client.d.mts +13 -0
- package/dist/esm/api/resources/offChrtShipperOrgInfo/client/Client.mjs +57 -0
- package/dist/esm/api/resources/payments/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/payments/client/Client.mjs +2 -2
- package/dist/esm/api/resources/payments/client/requests/{CreateCheckoutSessionReq2.d.mts → CreateCheckoutSessionReq.d.mts} +2 -2
- package/dist/esm/api/resources/payments/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/client/Client.d.mts +8 -2
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/client/Client.mjs +12 -2
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/Client.d.mts +42 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/Client.mjs +82 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/index.d.mts +1 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/index.mjs +1 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/courier/index.d.mts +1 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/courier/index.mjs +1 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/index.mjs +2 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/shipper/client/Client.d.mts +68 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/shipper/client/Client.mjs +197 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/shipper/client/index.d.mts +1 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/shipper/client/index.mjs +1 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/shipper/index.d.mts +1 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/shipper/index.mjs +1 -0
- package/dist/esm/api/resources/shipperPayCourierPayments/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/shipperPayCourierPayments/client/Client.mjs +1 -1
- package/dist/esm/api/resources/shipperPayCourierRateSheets/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/shipperPayCourierRateSheets/client/Client.mjs +1 -1
- package/dist/esm/api/resources/shipperPayCourierRateSheets/client/requests/ShipperPayCourierRateSheetClientCreate1.d.mts +2 -2
- package/dist/esm/api/resources/shipperPayCourierRateSheets/client/requests/ShipperPayCourierRateSheetClientUpdate1.d.mts +1 -1
- package/dist/esm/api/resources/taskGroups/client/Client.d.mts +15 -0
- package/dist/esm/api/resources/taskGroups/client/Client.mjs +62 -0
- package/dist/esm/api/resources/taskGroups/client/requests/TaskGroupsExpandedReq.d.mts +18 -0
- package/dist/esm/api/resources/taskGroups/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/users/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/utils/client/Client.d.mts +48 -0
- package/dist/esm/api/resources/utils/client/Client.mjs +96 -0
- package/dist/esm/api/resources/utils/client/index.d.mts +2 -0
- package/dist/esm/api/resources/utils/client/index.mjs +1 -0
- package/dist/esm/api/resources/utils/client/requests/UtilsGetTimezoneRequest.d.mts +20 -0
- package/dist/esm/api/resources/utils/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/utils/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/utils/index.d.mts +1 -0
- package/dist/esm/api/resources/utils/index.mjs +1 -0
- package/dist/esm/api/types/ClerkOrgData.d.mts +11 -0
- package/dist/esm/api/types/ClerkOrgData.mjs +4 -0
- package/dist/esm/api/types/CourierPayDriverRateSheet1.d.mts +1 -1
- package/dist/{cjs/api/types/CreateCheckoutSessionRes2.d.ts → esm/api/types/CreateCheckoutSessionRes.d.mts} +1 -1
- package/dist/esm/api/types/CreateCheckoutSessionRes.mjs +4 -0
- package/dist/esm/api/types/DecodedJwtWithOrgAndUserId.d.mts +5 -7
- package/dist/esm/api/types/PriceNameEnum.d.mts +4 -4
- package/dist/esm/api/types/PriceNameEnum.mjs +3 -3
- package/dist/esm/api/types/ShipperPayCourierRateSheet1.d.mts +1 -1
- package/dist/esm/api/types/TaskExpanded.d.mts +13 -0
- package/dist/esm/api/types/TaskExpanded.mjs +4 -0
- package/dist/esm/api/types/TaskGroupExpanded.d.mts +11 -0
- package/dist/esm/api/types/TaskGroupExpanded.mjs +4 -0
- package/dist/esm/api/types/TaskGroupsExpandedRes.d.mts +10 -0
- package/dist/esm/api/types/TaskGroupsExpandedRes.mjs +4 -0
- package/dist/esm/api/types/TimezoneResponse.d.mts +12 -0
- package/dist/esm/api/types/TimezoneResponse.mjs +4 -0
- package/dist/esm/api/types/{UserPublicData6.d.mts → UserPublicData1.d.mts} +2 -5
- package/dist/esm/api/types/UserPublicData1.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +7 -2
- package/dist/esm/api/types/index.mjs +7 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +445 -9
- /package/dist/cjs/api/resources/payments/client/requests/{CreateCheckoutSessionReq2.js → CreateCheckoutSessionReq.js} +0 -0
- /package/dist/cjs/api/{types/CreateCheckoutSessionRes2.js → resources/taskGroups/client/requests/TaskGroupsExpandedReq.js} +0 -0
- /package/dist/cjs/api/{types/UserPublicData6.js → resources/utils/client/requests/UtilsGetTimezoneRequest.js} +0 -0
- /package/dist/esm/api/resources/payments/client/requests/{CreateCheckoutSessionReq2.mjs → CreateCheckoutSessionReq.mjs} +0 -0
- /package/dist/esm/api/{types/CreateCheckoutSessionRes2.mjs → resources/taskGroups/client/requests/TaskGroupsExpandedReq.mjs} +0 -0
- /package/dist/esm/api/{types/UserPublicData6.mjs → resources/utils/client/requests/UtilsGetTimezoneRequest.mjs} +0 -0
|
@@ -18,6 +18,7 @@ export * as orgs from "./orgs/index.mjs";
|
|
|
18
18
|
export * as payments from "./payments/index.mjs";
|
|
19
19
|
export * as root from "./root/index.mjs";
|
|
20
20
|
export * as users from "./users/index.mjs";
|
|
21
|
+
export * as utils from "./utils/index.mjs";
|
|
21
22
|
export * as notifications from "./notifications/index.mjs";
|
|
22
23
|
export * as orgConnectionInfos from "./orgConnectionInfos/index.mjs";
|
|
23
24
|
export * from "./dev/client/requests/index.mjs";
|
|
@@ -35,3 +36,4 @@ export * from "./shipperContactInfo/client/requests/index.mjs";
|
|
|
35
36
|
export * from "./milestoneNotifications/client/requests/index.mjs";
|
|
36
37
|
export * from "./orgs/client/requests/index.mjs";
|
|
37
38
|
export * from "./payments/client/requests/index.mjs";
|
|
39
|
+
export * from "./utils/client/requests/index.mjs";
|
|
@@ -67,6 +67,19 @@ export declare class OffChrtShipperOrgInfo {
|
|
|
67
67
|
*/
|
|
68
68
|
getById(id: string, requestOptions?: OffChrtShipperOrgInfo.RequestOptions): core.HttpResponsePromise<Chrt.OffChrtShipperOrgInfo1>;
|
|
69
69
|
private __getById;
|
|
70
|
+
/**
|
|
71
|
+
* Deletes off-platform shipper connection information owned by the authenticated organization.
|
|
72
|
+
*
|
|
73
|
+
* @param {string} id
|
|
74
|
+
* @param {OffChrtShipperOrgInfo.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
|
+
*
|
|
76
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* await client.offChrtShipperOrgInfo.deleteById("id")
|
|
80
|
+
*/
|
|
81
|
+
deleteById(id: string, requestOptions?: OffChrtShipperOrgInfo.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
82
|
+
private __deleteById;
|
|
70
83
|
/**
|
|
71
84
|
* Updates existing off-platform shipper connection information owned by the authenticated organization.
|
|
72
85
|
*
|
|
@@ -188,6 +188,63 @@ export class OffChrtShipperOrgInfo {
|
|
|
188
188
|
}
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Deletes off-platform shipper connection information owned by the authenticated organization.
|
|
193
|
+
*
|
|
194
|
+
* @param {string} id
|
|
195
|
+
* @param {OffChrtShipperOrgInfo.RequestOptions} requestOptions - Request-specific configuration.
|
|
196
|
+
*
|
|
197
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* await client.offChrtShipperOrgInfo.deleteById("id")
|
|
201
|
+
*/
|
|
202
|
+
deleteById(id, requestOptions) {
|
|
203
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteById(id, requestOptions));
|
|
204
|
+
}
|
|
205
|
+
__deleteById(id, requestOptions) {
|
|
206
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
+
var _a, _b, _c, _d;
|
|
208
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
209
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, `oort/off_chrt_shipper_org_info/${encodeURIComponent(id)}`),
|
|
210
|
+
method: "DELETE",
|
|
211
|
+
headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
212
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
213
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
214
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
215
|
+
});
|
|
216
|
+
if (_response.ok) {
|
|
217
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
218
|
+
}
|
|
219
|
+
if (_response.error.reason === "status-code") {
|
|
220
|
+
switch (_response.error.statusCode) {
|
|
221
|
+
case 422:
|
|
222
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
223
|
+
default:
|
|
224
|
+
throw new errors.ChrtError({
|
|
225
|
+
statusCode: _response.error.statusCode,
|
|
226
|
+
body: _response.error.body,
|
|
227
|
+
rawResponse: _response.rawResponse,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
switch (_response.error.reason) {
|
|
232
|
+
case "non-json":
|
|
233
|
+
throw new errors.ChrtError({
|
|
234
|
+
statusCode: _response.error.statusCode,
|
|
235
|
+
body: _response.error.rawBody,
|
|
236
|
+
rawResponse: _response.rawResponse,
|
|
237
|
+
});
|
|
238
|
+
case "timeout":
|
|
239
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/off_chrt_shipper_org_info/{id}.");
|
|
240
|
+
case "unknown":
|
|
241
|
+
throw new errors.ChrtError({
|
|
242
|
+
message: _response.error.errorMessage,
|
|
243
|
+
rawResponse: _response.rawResponse,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
191
248
|
/**
|
|
192
249
|
* Updates existing off-platform shipper connection information owned by the authenticated organization.
|
|
193
250
|
*
|
|
@@ -31,17 +31,17 @@ export declare class Payments {
|
|
|
31
31
|
/**
|
|
32
32
|
* Create a checkout session for a subscription
|
|
33
33
|
*
|
|
34
|
-
* @param {Chrt.
|
|
34
|
+
* @param {Chrt.CreateCheckoutSessionReq} request
|
|
35
35
|
* @param {Payments.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
36
|
*
|
|
37
37
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
40
|
* await client.payments.createCheckoutSession({
|
|
41
|
-
* price_name: "
|
|
41
|
+
* price_name: "courier_ops_100_usd_per_month"
|
|
42
42
|
* })
|
|
43
43
|
*/
|
|
44
|
-
createCheckoutSession(request: Chrt.
|
|
44
|
+
createCheckoutSession(request: Chrt.CreateCheckoutSessionReq, requestOptions?: Payments.RequestOptions): core.HttpResponsePromise<Chrt.CreateCheckoutSessionRes>;
|
|
45
45
|
private __createCheckoutSession;
|
|
46
46
|
/**
|
|
47
47
|
* Synchronizes subscription data from Stripe to the authentication service for the current user.
|
|
@@ -22,14 +22,14 @@ export class Payments {
|
|
|
22
22
|
/**
|
|
23
23
|
* Create a checkout session for a subscription
|
|
24
24
|
*
|
|
25
|
-
* @param {Chrt.
|
|
25
|
+
* @param {Chrt.CreateCheckoutSessionReq} request
|
|
26
26
|
* @param {Payments.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
27
|
*
|
|
28
28
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* await client.payments.createCheckoutSession({
|
|
32
|
-
* price_name: "
|
|
32
|
+
* price_name: "courier_ops_100_usd_per_month"
|
|
33
33
|
* })
|
|
34
34
|
*/
|
|
35
35
|
createCheckoutSession(request, requestOptions) {
|
|
@@ -5,9 +5,9 @@ import * as Chrt from "../../../../index.mjs";
|
|
|
5
5
|
/**
|
|
6
6
|
* @example
|
|
7
7
|
* {
|
|
8
|
-
* price_name: "
|
|
8
|
+
* price_name: "courier_ops_100_usd_per_month"
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
|
-
export interface
|
|
11
|
+
export interface CreateCheckoutSessionReq {
|
|
12
12
|
price_name: Chrt.PriceNameEnum;
|
|
13
13
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type
|
|
1
|
+
export { type CreateCheckoutSessionReq } from "./CreateCheckoutSessionReq.mjs";
|
|
2
2
|
export { type GenerateInvoiceReq } from "./GenerateInvoiceReq.mjs";
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import * as environments from "../../../../environments.mjs";
|
|
5
5
|
import * as core from "../../../../core/index.mjs";
|
|
6
6
|
import * as Chrt from "../../../index.mjs";
|
|
7
|
+
import { Shipper } from "../resources/shipper/client/Client.mjs";
|
|
8
|
+
import { Courier } from "../resources/courier/client/Client.mjs";
|
|
7
9
|
import { AddLineItems } from "../resources/addLineItems/client/Client.mjs";
|
|
8
10
|
import { RemoveLineItems } from "../resources/removeLineItems/client/Client.mjs";
|
|
9
11
|
export declare namespace ShipperPayCourierLineItemGroups {
|
|
@@ -29,13 +31,17 @@ export declare namespace ShipperPayCourierLineItemGroups {
|
|
|
29
31
|
}
|
|
30
32
|
export declare class ShipperPayCourierLineItemGroups {
|
|
31
33
|
protected readonly _options: ShipperPayCourierLineItemGroups.Options;
|
|
34
|
+
protected _shipper: Shipper | undefined;
|
|
35
|
+
protected _courier: Courier | undefined;
|
|
32
36
|
protected _addLineItems: AddLineItems | undefined;
|
|
33
37
|
protected _removeLineItems: RemoveLineItems | undefined;
|
|
34
38
|
constructor(_options?: ShipperPayCourierLineItemGroups.Options);
|
|
39
|
+
get shipper(): Shipper;
|
|
40
|
+
get courier(): Courier;
|
|
35
41
|
get addLineItems(): AddLineItems;
|
|
36
42
|
get removeLineItems(): RemoveLineItems;
|
|
37
43
|
/**
|
|
38
|
-
* Retrieves a shipper pay courier line item group by its ID.
|
|
44
|
+
* Retrieves a shipper pay courier line item group by its ID for the authenticated courier organization.
|
|
39
45
|
*
|
|
40
46
|
* @param {string} id
|
|
41
47
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -61,7 +67,7 @@ export declare class ShipperPayCourierLineItemGroups {
|
|
|
61
67
|
deleteById(id: string, requestOptions?: ShipperPayCourierLineItemGroups.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
62
68
|
private __deleteById;
|
|
63
69
|
/**
|
|
64
|
-
* Retrieves a shipper pay courier line item group by its associated task group ID.
|
|
70
|
+
* Retrieves a shipper pay courier line item group by its associated task group ID for the authenticated courier organization.
|
|
65
71
|
*
|
|
66
72
|
* @param {string} taskGroupId
|
|
67
73
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -15,12 +15,22 @@ import * as core from "../../../../core/index.mjs";
|
|
|
15
15
|
import * as Chrt from "../../../index.mjs";
|
|
16
16
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
17
17
|
import * as errors from "../../../../errors/index.mjs";
|
|
18
|
+
import { Shipper } from "../resources/shipper/client/Client.mjs";
|
|
19
|
+
import { Courier } from "../resources/courier/client/Client.mjs";
|
|
18
20
|
import { AddLineItems } from "../resources/addLineItems/client/Client.mjs";
|
|
19
21
|
import { RemoveLineItems } from "../resources/removeLineItems/client/Client.mjs";
|
|
20
22
|
export class ShipperPayCourierLineItemGroups {
|
|
21
23
|
constructor(_options = {}) {
|
|
22
24
|
this._options = _options;
|
|
23
25
|
}
|
|
26
|
+
get shipper() {
|
|
27
|
+
var _a;
|
|
28
|
+
return ((_a = this._shipper) !== null && _a !== void 0 ? _a : (this._shipper = new Shipper(this._options)));
|
|
29
|
+
}
|
|
30
|
+
get courier() {
|
|
31
|
+
var _a;
|
|
32
|
+
return ((_a = this._courier) !== null && _a !== void 0 ? _a : (this._courier = new Courier(this._options)));
|
|
33
|
+
}
|
|
24
34
|
get addLineItems() {
|
|
25
35
|
var _a;
|
|
26
36
|
return ((_a = this._addLineItems) !== null && _a !== void 0 ? _a : (this._addLineItems = new AddLineItems(this._options)));
|
|
@@ -30,7 +40,7 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
30
40
|
return ((_a = this._removeLineItems) !== null && _a !== void 0 ? _a : (this._removeLineItems = new RemoveLineItems(this._options)));
|
|
31
41
|
}
|
|
32
42
|
/**
|
|
33
|
-
* Retrieves a shipper pay courier line item group by its ID.
|
|
43
|
+
* Retrieves a shipper pay courier line item group by its ID for the authenticated courier organization.
|
|
34
44
|
*
|
|
35
45
|
* @param {string} id
|
|
36
46
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -144,7 +154,7 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
144
154
|
});
|
|
145
155
|
}
|
|
146
156
|
/**
|
|
147
|
-
* Retrieves a shipper pay courier line item group by its associated task group ID.
|
|
157
|
+
* Retrieves a shipper pay courier line item group by its associated task group ID for the authenticated courier organization.
|
|
148
158
|
*
|
|
149
159
|
* @param {string} taskGroupId
|
|
150
160
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/Client.d.mts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
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 Courier {
|
|
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 | undefined> | 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 headers to include in the request. */
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export declare class Courier {
|
|
29
|
+
protected readonly _options: Courier.Options;
|
|
30
|
+
constructor(_options?: Courier.Options);
|
|
31
|
+
/**
|
|
32
|
+
* Lists all shipper pay courier line item groups for the authenticated courier organization.
|
|
33
|
+
*
|
|
34
|
+
* @param {Courier.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* await client.shipperPayCourierLineItemGroups.courier.list()
|
|
38
|
+
*/
|
|
39
|
+
list(requestOptions?: Courier.RequestOptions): core.HttpResponsePromise<Chrt.ShipperPayCourierLineItemGroup1[]>;
|
|
40
|
+
private __list;
|
|
41
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
42
|
+
}
|
package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/Client.mjs
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
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 { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
16
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
+
export class Courier {
|
|
18
|
+
constructor(_options = {}) {
|
|
19
|
+
this._options = _options;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Lists all shipper pay courier line item groups for the authenticated courier organization.
|
|
23
|
+
*
|
|
24
|
+
* @param {Courier.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* await client.shipperPayCourierLineItemGroups.courier.list()
|
|
28
|
+
*/
|
|
29
|
+
list(requestOptions) {
|
|
30
|
+
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
31
|
+
}
|
|
32
|
+
__list(requestOptions) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
var _a, _b, _c, _d;
|
|
35
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
36
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/shipper_pay_courier_line_item_groups/courier/list"),
|
|
37
|
+
method: "GET",
|
|
38
|
+
headers: mergeHeaders((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
39
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
40
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
41
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
42
|
+
});
|
|
43
|
+
if (_response.ok) {
|
|
44
|
+
return {
|
|
45
|
+
data: _response.body,
|
|
46
|
+
rawResponse: _response.rawResponse,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (_response.error.reason === "status-code") {
|
|
50
|
+
throw new errors.ChrtError({
|
|
51
|
+
statusCode: _response.error.statusCode,
|
|
52
|
+
body: _response.error.body,
|
|
53
|
+
rawResponse: _response.rawResponse,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
switch (_response.error.reason) {
|
|
57
|
+
case "non-json":
|
|
58
|
+
throw new errors.ChrtError({
|
|
59
|
+
statusCode: _response.error.statusCode,
|
|
60
|
+
body: _response.error.rawBody,
|
|
61
|
+
rawResponse: _response.rawResponse,
|
|
62
|
+
});
|
|
63
|
+
case "timeout":
|
|
64
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_line_item_groups/courier/list.");
|
|
65
|
+
case "unknown":
|
|
66
|
+
throw new errors.ChrtError({
|
|
67
|
+
message: _response.error.errorMessage,
|
|
68
|
+
rawResponse: _response.rawResponse,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
_getAuthorizationHeader() {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
76
|
+
if (bearer != null) {
|
|
77
|
+
return `Bearer ${bearer}`;
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/courier/client/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * as shipper from "./shipper/index.mjs";
|
|
2
|
+
export * as courier from "./courier/index.mjs";
|
|
1
3
|
export * as addLineItems from "./addLineItems/index.mjs";
|
|
2
4
|
export * as removeLineItems from "./removeLineItems/index.mjs";
|
|
3
5
|
export * from "./addLineItems/client/requests/index.mjs";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * as shipper from "./shipper/index.mjs";
|
|
2
|
+
export * as courier from "./courier/index.mjs";
|
|
1
3
|
export * as addLineItems from "./addLineItems/index.mjs";
|
|
2
4
|
export * as removeLineItems from "./removeLineItems/index.mjs";
|
|
3
5
|
export * from "./addLineItems/client/requests/index.mjs";
|
package/dist/esm/api/resources/shipperPayCourierLineItemGroups/resources/shipper/client/Client.d.mts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
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 Shipper {
|
|
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 | undefined> | 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 headers to include in the request. */
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export declare class Shipper {
|
|
29
|
+
protected readonly _options: Shipper.Options;
|
|
30
|
+
constructor(_options?: Shipper.Options);
|
|
31
|
+
/**
|
|
32
|
+
* Lists all shipper pay courier line item groups for the authenticated shipper organization.
|
|
33
|
+
*
|
|
34
|
+
* @param {Shipper.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* await client.shipperPayCourierLineItemGroups.shipper.list()
|
|
38
|
+
*/
|
|
39
|
+
list(requestOptions?: Shipper.RequestOptions): core.HttpResponsePromise<Chrt.ShipperPayCourierLineItemGroup1[]>;
|
|
40
|
+
private __list;
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves a shipper pay courier line item group by its ID for the authenticated shipper organization.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} id
|
|
45
|
+
* @param {Shipper.RequestOptions} requestOptions - Request-specific configuration.
|
|
46
|
+
*
|
|
47
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* await client.shipperPayCourierLineItemGroups.shipper.getById("id")
|
|
51
|
+
*/
|
|
52
|
+
getById(id: string, requestOptions?: Shipper.RequestOptions): core.HttpResponsePromise<Chrt.ShipperPayCourierLineItemGroup1>;
|
|
53
|
+
private __getById;
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves a shipper pay courier line item group by its associated task group ID for the authenticated shipper organization.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} taskGroupId
|
|
58
|
+
* @param {Shipper.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
|
+
*
|
|
60
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.shipperPayCourierLineItemGroups.shipper.byTaskGroupId("task_group_id")
|
|
64
|
+
*/
|
|
65
|
+
byTaskGroupId(taskGroupId: string, requestOptions?: Shipper.RequestOptions): core.HttpResponsePromise<Chrt.ShipperPayCourierLineItemGroup1>;
|
|
66
|
+
private __byTaskGroupId;
|
|
67
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
68
|
+
}
|