@chrt-inc/typescript-sdk 0.0.203 → 0.0.216
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.js +2 -2
- package/dist/cjs/api/resources/courierPayDriverRateSheets/client/Client.d.ts +14 -14
- package/dist/cjs/api/resources/courierPayDriverRateSheets/client/Client.js +58 -58
- 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 +1 -0
- package/dist/cjs/api/resources/index.js +1 -0
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/client/Client.d.ts +16 -16
- package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/client/Client.js +45 -45
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/Client.d.ts +50 -30
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/Client.js +134 -59
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/index.js +15 -0
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByCourierReq.d.ts +16 -0
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByShipperReq.d.ts +15 -0
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByShipperReq.js +5 -0
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/shipperPayCourierPayments/client/requests/index.js +2 -0
- 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/TaskGroupsExpandedReq.js +5 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/index.d.ts +1 -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/cjs/api/types/CreateShipperPayCourierPaymentReq.d.ts +0 -3
- package/dist/cjs/api/types/DecodedJwtWithOrgAndUserId.d.ts +5 -7
- package/dist/cjs/api/types/GetShipperPayCourierPaymentsForShipperRes.d.ts +0 -3
- package/dist/cjs/api/types/PaymentPreviewResponse.d.ts +0 -3
- package/dist/cjs/api/types/ShipperPayCourierPayment1.d.ts +4 -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/UserPublicData6.d.ts +0 -1
- package/dist/cjs/api/types/index.d.ts +4 -1
- package/dist/cjs/api/types/index.js +4 -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/courierPayDriverRateSheets/client/Client.d.mts +14 -14
- package/dist/esm/api/resources/courierPayDriverRateSheets/client/Client.mjs +58 -58
- 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 +1 -0
- package/dist/esm/api/resources/index.mjs +1 -0
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/client/Client.d.mts +16 -16
- package/dist/esm/api/resources/shipperPayCourierLineItemGroups/client/Client.mjs +45 -45
- package/dist/esm/api/resources/shipperPayCourierPayments/client/Client.d.mts +50 -30
- package/dist/esm/api/resources/shipperPayCourierPayments/client/Client.mjs +134 -59
- package/dist/esm/api/resources/shipperPayCourierPayments/client/index.d.mts +1 -0
- package/dist/esm/api/resources/shipperPayCourierPayments/client/index.mjs +1 -1
- package/dist/esm/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByCourierReq.d.mts +16 -0
- package/dist/esm/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByShipperReq.d.mts +15 -0
- package/dist/esm/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByShipperReq.mjs +4 -0
- package/dist/esm/api/resources/shipperPayCourierPayments/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/shipperPayCourierPayments/client/requests/index.mjs +1 -0
- 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/TaskGroupsExpandedReq.mjs +4 -0
- package/dist/esm/api/resources/taskGroups/client/requests/index.d.mts +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/esm/api/types/CreateShipperPayCourierPaymentReq.d.mts +0 -3
- package/dist/esm/api/types/DecodedJwtWithOrgAndUserId.d.mts +5 -7
- package/dist/esm/api/types/GetShipperPayCourierPaymentsForShipperRes.d.mts +0 -3
- package/dist/esm/api/types/PaymentPreviewResponse.d.mts +0 -3
- package/dist/esm/api/types/ShipperPayCourierPayment1.d.mts +4 -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/UserPublicData6.d.mts +0 -1
- package/dist/esm/api/types/index.d.mts +4 -1
- package/dist/esm/api/types/index.mjs +4 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +225 -85
- package/dist/cjs/api/types/GetShipperPayCourierPaymentsRes.d.ts +0 -10
- package/dist/esm/api/types/GetShipperPayCourierPaymentsRes.d.mts +0 -10
- /package/dist/cjs/api/{types/GetShipperPayCourierPaymentsRes.js → resources/shipperPayCourierPayments/client/requests/ListPaymentsByCourierReq.js} +0 -0
- /package/dist/esm/api/{types/GetShipperPayCourierPaymentsRes.mjs → resources/shipperPayCourierPayments/client/requests/ListPaymentsByCourierReq.mjs} +0 -0
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fchrt-inc%2Ftypescript-sdk)
|
|
4
4
|
[](https://www.npmjs.com/package/@chrt-inc/typescript-sdk)
|
|
5
5
|
|
|
6
|
-
The Chrt TypeScript library provides convenient access to the Chrt
|
|
6
|
+
The Chrt TypeScript library provides convenient access to the Chrt APIs from TypeScript.
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
package/dist/cjs/Client.js
CHANGED
|
@@ -66,8 +66,8 @@ class ChrtClient {
|
|
|
66
66
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
67
67
|
"X-Fern-Language": "JavaScript",
|
|
68
68
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
69
|
-
"X-Fern-SDK-Version": "0.0.
|
|
70
|
-
"User-Agent": "@chrt-inc/typescript-sdk/0.0.
|
|
69
|
+
"X-Fern-SDK-Version": "0.0.216",
|
|
70
|
+
"User-Agent": "@chrt-inc/typescript-sdk/0.0.216",
|
|
71
71
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
72
72
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
73
73
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -38,6 +38,19 @@ export declare class CourierPayDriverRateSheets {
|
|
|
38
38
|
*/
|
|
39
39
|
listByCourierOrgId(requestOptions?: CourierPayDriverRateSheets.RequestOptions): core.HttpResponsePromise<Chrt.CourierPayDriverRateSheet1[]>;
|
|
40
40
|
private __listByCourierOrgId;
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves all rate sheets assigned to a specific driver.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} driverId
|
|
45
|
+
* @param {CourierPayDriverRateSheets.RequestOptions} requestOptions - Request-specific configuration.
|
|
46
|
+
*
|
|
47
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* await client.courierPayDriverRateSheets.listByDriverId("driver_id")
|
|
51
|
+
*/
|
|
52
|
+
listByDriverId(driverId: string, requestOptions?: CourierPayDriverRateSheets.RequestOptions): core.HttpResponsePromise<Chrt.CourierPayDriverRateSheet1[]>;
|
|
53
|
+
private __listByDriverId;
|
|
41
54
|
/**
|
|
42
55
|
* Creates a new driver rate sheet for calculating courier payments.
|
|
43
56
|
*
|
|
@@ -55,7 +68,7 @@ export declare class CourierPayDriverRateSheets {
|
|
|
55
68
|
* additional_mileage_rate_usd_per_mile: 1.1,
|
|
56
69
|
* long_distance_surcharge_miles_before_surcharge: 1.1,
|
|
57
70
|
* long_distance_surcharge_rate_usd_per_mile: 1.1,
|
|
58
|
-
*
|
|
71
|
+
* fuel_surcharge_rate_usd_per_mile: 1.1,
|
|
59
72
|
* wait_time_before_charge_minutes: 1.1,
|
|
60
73
|
* wait_time_rate_usd_per_minute: 1.1,
|
|
61
74
|
* extra_stop_rate_usd: 1.1,
|
|
@@ -107,18 +120,5 @@ export declare class CourierPayDriverRateSheets {
|
|
|
107
120
|
*/
|
|
108
121
|
updateById(id: string, request?: Chrt.CourierPayDriverRateSheetClientUpdate1, requestOptions?: CourierPayDriverRateSheets.RequestOptions): core.HttpResponsePromise<Chrt.CourierPayDriverRateSheet1>;
|
|
109
122
|
private __updateById;
|
|
110
|
-
/**
|
|
111
|
-
* Retrieves all rate sheets assigned to a specific driver.
|
|
112
|
-
*
|
|
113
|
-
* @param {string} driverId
|
|
114
|
-
* @param {CourierPayDriverRateSheets.RequestOptions} requestOptions - Request-specific configuration.
|
|
115
|
-
*
|
|
116
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* await client.courierPayDriverRateSheets.listByDriverId("driver_id")
|
|
120
|
-
*/
|
|
121
|
-
listByDriverId(driverId: string, requestOptions?: CourierPayDriverRateSheets.RequestOptions): core.HttpResponsePromise<Chrt.CourierPayDriverRateSheet1[]>;
|
|
122
|
-
private __listByDriverId;
|
|
123
123
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
124
124
|
}
|
|
@@ -104,6 +104,63 @@ class CourierPayDriverRateSheets {
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Retrieves all rate sheets assigned to a specific driver.
|
|
109
|
+
*
|
|
110
|
+
* @param {string} driverId
|
|
111
|
+
* @param {CourierPayDriverRateSheets.RequestOptions} requestOptions - Request-specific configuration.
|
|
112
|
+
*
|
|
113
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* await client.courierPayDriverRateSheets.listByDriverId("driver_id")
|
|
117
|
+
*/
|
|
118
|
+
listByDriverId(driverId, requestOptions) {
|
|
119
|
+
return core.HttpResponsePromise.fromPromise(this.__listByDriverId(driverId, requestOptions));
|
|
120
|
+
}
|
|
121
|
+
__listByDriverId(driverId, requestOptions) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
var _a, _b, _c, _d;
|
|
124
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
125
|
+
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/courier_pay_driver_rate_sheets/by_driver_id/${encodeURIComponent(driverId)}`),
|
|
126
|
+
method: "GET",
|
|
127
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
128
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
129
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
130
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
131
|
+
});
|
|
132
|
+
if (_response.ok) {
|
|
133
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
134
|
+
}
|
|
135
|
+
if (_response.error.reason === "status-code") {
|
|
136
|
+
switch (_response.error.statusCode) {
|
|
137
|
+
case 422:
|
|
138
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
139
|
+
default:
|
|
140
|
+
throw new errors.ChrtError({
|
|
141
|
+
statusCode: _response.error.statusCode,
|
|
142
|
+
body: _response.error.body,
|
|
143
|
+
rawResponse: _response.rawResponse,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
switch (_response.error.reason) {
|
|
148
|
+
case "non-json":
|
|
149
|
+
throw new errors.ChrtError({
|
|
150
|
+
statusCode: _response.error.statusCode,
|
|
151
|
+
body: _response.error.rawBody,
|
|
152
|
+
rawResponse: _response.rawResponse,
|
|
153
|
+
});
|
|
154
|
+
case "timeout":
|
|
155
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/courier_pay_driver_rate_sheets/by_driver_id/{driver_id}.");
|
|
156
|
+
case "unknown":
|
|
157
|
+
throw new errors.ChrtError({
|
|
158
|
+
message: _response.error.errorMessage,
|
|
159
|
+
rawResponse: _response.rawResponse,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
107
164
|
/**
|
|
108
165
|
* Creates a new driver rate sheet for calculating courier payments.
|
|
109
166
|
*
|
|
@@ -121,7 +178,7 @@ class CourierPayDriverRateSheets {
|
|
|
121
178
|
* additional_mileage_rate_usd_per_mile: 1.1,
|
|
122
179
|
* long_distance_surcharge_miles_before_surcharge: 1.1,
|
|
123
180
|
* long_distance_surcharge_rate_usd_per_mile: 1.1,
|
|
124
|
-
*
|
|
181
|
+
* fuel_surcharge_rate_usd_per_mile: 1.1,
|
|
125
182
|
* wait_time_before_charge_minutes: 1.1,
|
|
126
183
|
* wait_time_rate_usd_per_minute: 1.1,
|
|
127
184
|
* extra_stop_rate_usd: 1.1,
|
|
@@ -355,63 +412,6 @@ class CourierPayDriverRateSheets {
|
|
|
355
412
|
}
|
|
356
413
|
});
|
|
357
414
|
}
|
|
358
|
-
/**
|
|
359
|
-
* Retrieves all rate sheets assigned to a specific driver.
|
|
360
|
-
*
|
|
361
|
-
* @param {string} driverId
|
|
362
|
-
* @param {CourierPayDriverRateSheets.RequestOptions} requestOptions - Request-specific configuration.
|
|
363
|
-
*
|
|
364
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
365
|
-
*
|
|
366
|
-
* @example
|
|
367
|
-
* await client.courierPayDriverRateSheets.listByDriverId("driver_id")
|
|
368
|
-
*/
|
|
369
|
-
listByDriverId(driverId, requestOptions) {
|
|
370
|
-
return core.HttpResponsePromise.fromPromise(this.__listByDriverId(driverId, requestOptions));
|
|
371
|
-
}
|
|
372
|
-
__listByDriverId(driverId, requestOptions) {
|
|
373
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
374
|
-
var _a, _b, _c, _d;
|
|
375
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
376
|
-
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/courier_pay_driver_rate_sheets/list/by_driver_id/${encodeURIComponent(driverId)}`),
|
|
377
|
-
method: "GET",
|
|
378
|
-
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
379
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
380
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
381
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
382
|
-
});
|
|
383
|
-
if (_response.ok) {
|
|
384
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
385
|
-
}
|
|
386
|
-
if (_response.error.reason === "status-code") {
|
|
387
|
-
switch (_response.error.statusCode) {
|
|
388
|
-
case 422:
|
|
389
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
390
|
-
default:
|
|
391
|
-
throw new errors.ChrtError({
|
|
392
|
-
statusCode: _response.error.statusCode,
|
|
393
|
-
body: _response.error.body,
|
|
394
|
-
rawResponse: _response.rawResponse,
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
switch (_response.error.reason) {
|
|
399
|
-
case "non-json":
|
|
400
|
-
throw new errors.ChrtError({
|
|
401
|
-
statusCode: _response.error.statusCode,
|
|
402
|
-
body: _response.error.rawBody,
|
|
403
|
-
rawResponse: _response.rawResponse,
|
|
404
|
-
});
|
|
405
|
-
case "timeout":
|
|
406
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/courier_pay_driver_rate_sheets/list/by_driver_id/{driver_id}.");
|
|
407
|
-
case "unknown":
|
|
408
|
-
throw new errors.ChrtError({
|
|
409
|
-
message: _response.error.errorMessage,
|
|
410
|
-
rawResponse: _response.rawResponse,
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
415
|
_getAuthorizationHeader() {
|
|
416
416
|
return __awaiter(this, void 0, void 0, function* () {
|
|
417
417
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -12,7 +12,7 @@ import * as Chrt from "../../../../index.js";
|
|
|
12
12
|
* additional_mileage_rate_usd_per_mile: 1.1,
|
|
13
13
|
* long_distance_surcharge_miles_before_surcharge: 1.1,
|
|
14
14
|
* long_distance_surcharge_rate_usd_per_mile: 1.1,
|
|
15
|
-
*
|
|
15
|
+
* fuel_surcharge_rate_usd_per_mile: 1.1,
|
|
16
16
|
* wait_time_before_charge_minutes: 1.1,
|
|
17
17
|
* wait_time_rate_usd_per_minute: 1.1,
|
|
18
18
|
* extra_stop_rate_usd: 1.1,
|
|
@@ -39,7 +39,7 @@ export interface CourierPayDriverRateSheetClientCreate1 {
|
|
|
39
39
|
long_distance_surcharge_miles_before_surcharge: number;
|
|
40
40
|
/** applies only to the additional miles */
|
|
41
41
|
long_distance_surcharge_rate_usd_per_mile: number;
|
|
42
|
-
|
|
42
|
+
fuel_surcharge_rate_usd_per_mile: number;
|
|
43
43
|
wait_time_before_charge_minutes: number;
|
|
44
44
|
wait_time_rate_usd_per_minute: number;
|
|
45
45
|
extra_stop_rate_usd: number;
|
|
@@ -18,7 +18,7 @@ export interface CourierPayDriverRateSheetClientUpdate1 {
|
|
|
18
18
|
additional_mileage_rate_usd_per_mile?: number | null;
|
|
19
19
|
long_distance_surcharge_miles_before_surcharge?: number | null;
|
|
20
20
|
long_distance_surcharge_rate_usd_per_mile?: number | null;
|
|
21
|
-
|
|
21
|
+
fuel_surcharge_rate_usd_per_mile?: number | null;
|
|
22
22
|
wait_time_before_charge_minutes?: number | null;
|
|
23
23
|
wait_time_rate_usd_per_minute?: number | null;
|
|
24
24
|
extra_stop_rate_usd?: number | null;
|
|
@@ -28,6 +28,7 @@ export * from "./orgProfiles/client/requests/index.js";
|
|
|
28
28
|
export * from "./orders/client/requests/index.js";
|
|
29
29
|
export * from "./courierPayDriverRateSheets/client/requests/index.js";
|
|
30
30
|
export * from "./shipperPayCourierRateSheets/client/requests/index.js";
|
|
31
|
+
export * from "./shipperPayCourierPayments/client/requests/index.js";
|
|
31
32
|
export * from "./courierPayDriverPayouts/client/requests/index.js";
|
|
32
33
|
export * from "./taskGroups/client/requests/index.js";
|
|
33
34
|
export * from "./shipperContactInfo/client/requests/index.js";
|
|
@@ -67,6 +67,7 @@ __exportStar(require("./orgProfiles/client/requests/index.js"), exports);
|
|
|
67
67
|
__exportStar(require("./orders/client/requests/index.js"), exports);
|
|
68
68
|
__exportStar(require("./courierPayDriverRateSheets/client/requests/index.js"), exports);
|
|
69
69
|
__exportStar(require("./shipperPayCourierRateSheets/client/requests/index.js"), exports);
|
|
70
|
+
__exportStar(require("./shipperPayCourierPayments/client/requests/index.js"), exports);
|
|
70
71
|
__exportStar(require("./courierPayDriverPayouts/client/requests/index.js"), exports);
|
|
71
72
|
__exportStar(require("./taskGroups/client/requests/index.js"), exports);
|
|
72
73
|
__exportStar(require("./shipperContactInfo/client/requests/index.js"), exports);
|
|
@@ -34,22 +34,6 @@ export declare class ShipperPayCourierLineItemGroups {
|
|
|
34
34
|
constructor(_options?: ShipperPayCourierLineItemGroups.Options);
|
|
35
35
|
get addLineItems(): AddLineItems;
|
|
36
36
|
get removeLineItems(): RemoveLineItems;
|
|
37
|
-
/**
|
|
38
|
-
* Previews calculated line items for a shipper pay courier based on rate sheet and task group without creating the group.
|
|
39
|
-
*
|
|
40
|
-
* @param {Chrt.ShipperPayCourierLineItemGroupCreateReq} request
|
|
41
|
-
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
|
-
*
|
|
43
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* await client.shipperPayCourierLineItemGroups.preview({
|
|
47
|
-
* shipper_pay_courier_rate_sheet_id: "shipper_pay_courier_rate_sheet_id",
|
|
48
|
-
* task_group_id: "task_group_id"
|
|
49
|
-
* })
|
|
50
|
-
*/
|
|
51
|
-
preview(request: Chrt.ShipperPayCourierLineItemGroupCreateReq, requestOptions?: ShipperPayCourierLineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.ShipperPayCourierLineItemGroupServerCreate1>;
|
|
52
|
-
private __preview;
|
|
53
37
|
/**
|
|
54
38
|
* Retrieves a shipper pay courier line item group by its ID.
|
|
55
39
|
*
|
|
@@ -89,6 +73,22 @@ export declare class ShipperPayCourierLineItemGroups {
|
|
|
89
73
|
*/
|
|
90
74
|
byTaskGroupId(taskGroupId: string, requestOptions?: ShipperPayCourierLineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.ShipperPayCourierLineItemGroup1>;
|
|
91
75
|
private __byTaskGroupId;
|
|
76
|
+
/**
|
|
77
|
+
* Previews calculated line items for a shipper pay courier based on rate sheet and task group without creating the group.
|
|
78
|
+
*
|
|
79
|
+
* @param {Chrt.ShipperPayCourierLineItemGroupCreateReq} request
|
|
80
|
+
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
81
|
+
*
|
|
82
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* await client.shipperPayCourierLineItemGroups.preview({
|
|
86
|
+
* shipper_pay_courier_rate_sheet_id: "shipper_pay_courier_rate_sheet_id",
|
|
87
|
+
* task_group_id: "task_group_id"
|
|
88
|
+
* })
|
|
89
|
+
*/
|
|
90
|
+
preview(request: Chrt.ShipperPayCourierLineItemGroupCreateReq, requestOptions?: ShipperPayCourierLineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.ShipperPayCourierLineItemGroupServerCreate1>;
|
|
91
|
+
private __preview;
|
|
92
92
|
/**
|
|
93
93
|
* Creates a shipper pay courier line item group by calculating items from rate sheet and task group.
|
|
94
94
|
*
|
|
@@ -66,41 +66,32 @@ class ShipperPayCourierLineItemGroups {
|
|
|
66
66
|
return ((_a = this._removeLineItems) !== null && _a !== void 0 ? _a : (this._removeLineItems = new Client_js_2.RemoveLineItems(this._options)));
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* Retrieves a shipper pay courier line item group by its ID.
|
|
70
70
|
*
|
|
71
|
-
* @param {
|
|
71
|
+
* @param {string} id
|
|
72
72
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
73
|
*
|
|
74
74
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
75
75
|
*
|
|
76
76
|
* @example
|
|
77
|
-
* await client.shipperPayCourierLineItemGroups.
|
|
78
|
-
* shipper_pay_courier_rate_sheet_id: "shipper_pay_courier_rate_sheet_id",
|
|
79
|
-
* task_group_id: "task_group_id"
|
|
80
|
-
* })
|
|
77
|
+
* await client.shipperPayCourierLineItemGroups.getById("id")
|
|
81
78
|
*/
|
|
82
|
-
|
|
83
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
79
|
+
getById(id, requestOptions) {
|
|
80
|
+
return core.HttpResponsePromise.fromPromise(this.__getById(id, requestOptions));
|
|
84
81
|
}
|
|
85
|
-
|
|
82
|
+
__getById(id, requestOptions) {
|
|
86
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
84
|
var _a, _b, _c, _d;
|
|
88
85
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
89
|
-
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,
|
|
90
|
-
method: "
|
|
86
|
+
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/${encodeURIComponent(id)}`),
|
|
87
|
+
method: "GET",
|
|
91
88
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
92
|
-
contentType: "application/json",
|
|
93
|
-
requestType: "json",
|
|
94
|
-
body: request,
|
|
95
89
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
96
90
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
97
91
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
98
92
|
});
|
|
99
93
|
if (_response.ok) {
|
|
100
|
-
return {
|
|
101
|
-
data: _response.body,
|
|
102
|
-
rawResponse: _response.rawResponse,
|
|
103
|
-
};
|
|
94
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
104
95
|
}
|
|
105
96
|
if (_response.error.reason === "status-code") {
|
|
106
97
|
switch (_response.error.statusCode) {
|
|
@@ -122,7 +113,7 @@ class ShipperPayCourierLineItemGroups {
|
|
|
122
113
|
rawResponse: _response.rawResponse,
|
|
123
114
|
});
|
|
124
115
|
case "timeout":
|
|
125
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
116
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_line_item_groups/{id}.");
|
|
126
117
|
case "unknown":
|
|
127
118
|
throw new errors.ChrtError({
|
|
128
119
|
message: _response.error.errorMessage,
|
|
@@ -132,7 +123,7 @@ class ShipperPayCourierLineItemGroups {
|
|
|
132
123
|
});
|
|
133
124
|
}
|
|
134
125
|
/**
|
|
135
|
-
*
|
|
126
|
+
* Deletes a shipper pay courier line item group by its ID.
|
|
136
127
|
*
|
|
137
128
|
* @param {string} id
|
|
138
129
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -140,17 +131,17 @@ class ShipperPayCourierLineItemGroups {
|
|
|
140
131
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
141
132
|
*
|
|
142
133
|
* @example
|
|
143
|
-
* await client.shipperPayCourierLineItemGroups.
|
|
134
|
+
* await client.shipperPayCourierLineItemGroups.deleteById("id")
|
|
144
135
|
*/
|
|
145
|
-
|
|
146
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
136
|
+
deleteById(id, requestOptions) {
|
|
137
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteById(id, requestOptions));
|
|
147
138
|
}
|
|
148
|
-
|
|
139
|
+
__deleteById(id, requestOptions) {
|
|
149
140
|
return __awaiter(this, void 0, void 0, function* () {
|
|
150
141
|
var _a, _b, _c, _d;
|
|
151
142
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
152
143
|
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/${encodeURIComponent(id)}`),
|
|
153
|
-
method: "
|
|
144
|
+
method: "DELETE",
|
|
154
145
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
155
146
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
156
147
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -179,7 +170,7 @@ class ShipperPayCourierLineItemGroups {
|
|
|
179
170
|
rawResponse: _response.rawResponse,
|
|
180
171
|
});
|
|
181
172
|
case "timeout":
|
|
182
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
173
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/shipper_pay_courier_line_item_groups/{id}.");
|
|
183
174
|
case "unknown":
|
|
184
175
|
throw new errors.ChrtError({
|
|
185
176
|
message: _response.error.errorMessage,
|
|
@@ -189,25 +180,25 @@ class ShipperPayCourierLineItemGroups {
|
|
|
189
180
|
});
|
|
190
181
|
}
|
|
191
182
|
/**
|
|
192
|
-
*
|
|
183
|
+
* Retrieves a shipper pay courier line item group by its associated task group ID.
|
|
193
184
|
*
|
|
194
|
-
* @param {string}
|
|
185
|
+
* @param {string} taskGroupId
|
|
195
186
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
196
187
|
*
|
|
197
188
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
198
189
|
*
|
|
199
190
|
* @example
|
|
200
|
-
* await client.shipperPayCourierLineItemGroups.
|
|
191
|
+
* await client.shipperPayCourierLineItemGroups.byTaskGroupId("task_group_id")
|
|
201
192
|
*/
|
|
202
|
-
|
|
203
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
193
|
+
byTaskGroupId(taskGroupId, requestOptions) {
|
|
194
|
+
return core.HttpResponsePromise.fromPromise(this.__byTaskGroupId(taskGroupId, requestOptions));
|
|
204
195
|
}
|
|
205
|
-
|
|
196
|
+
__byTaskGroupId(taskGroupId, requestOptions) {
|
|
206
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
207
198
|
var _a, _b, _c, _d;
|
|
208
199
|
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/shipper_pay_courier_line_item_groups/${encodeURIComponent(
|
|
210
|
-
method: "
|
|
200
|
+
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/by_task_group/${encodeURIComponent(taskGroupId)}`),
|
|
201
|
+
method: "GET",
|
|
211
202
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
212
203
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
213
204
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -236,7 +227,7 @@ class ShipperPayCourierLineItemGroups {
|
|
|
236
227
|
rawResponse: _response.rawResponse,
|
|
237
228
|
});
|
|
238
229
|
case "timeout":
|
|
239
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
230
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_line_item_groups/by_task_group/{task_group_id}.");
|
|
240
231
|
case "unknown":
|
|
241
232
|
throw new errors.ChrtError({
|
|
242
233
|
message: _response.error.errorMessage,
|
|
@@ -246,32 +237,41 @@ class ShipperPayCourierLineItemGroups {
|
|
|
246
237
|
});
|
|
247
238
|
}
|
|
248
239
|
/**
|
|
249
|
-
*
|
|
240
|
+
* Previews calculated line items for a shipper pay courier based on rate sheet and task group without creating the group.
|
|
250
241
|
*
|
|
251
|
-
* @param {
|
|
242
|
+
* @param {Chrt.ShipperPayCourierLineItemGroupCreateReq} request
|
|
252
243
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
253
244
|
*
|
|
254
245
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
255
246
|
*
|
|
256
247
|
* @example
|
|
257
|
-
* await client.shipperPayCourierLineItemGroups.
|
|
248
|
+
* await client.shipperPayCourierLineItemGroups.preview({
|
|
249
|
+
* shipper_pay_courier_rate_sheet_id: "shipper_pay_courier_rate_sheet_id",
|
|
250
|
+
* task_group_id: "task_group_id"
|
|
251
|
+
* })
|
|
258
252
|
*/
|
|
259
|
-
|
|
260
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
253
|
+
preview(request, requestOptions) {
|
|
254
|
+
return core.HttpResponsePromise.fromPromise(this.__preview(request, requestOptions));
|
|
261
255
|
}
|
|
262
|
-
|
|
256
|
+
__preview(request, requestOptions) {
|
|
263
257
|
return __awaiter(this, void 0, void 0, function* () {
|
|
264
258
|
var _a, _b, _c, _d;
|
|
265
259
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
266
|
-
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,
|
|
267
|
-
method: "
|
|
260
|
+
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/preview"),
|
|
261
|
+
method: "POST",
|
|
268
262
|
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
263
|
+
contentType: "application/json",
|
|
264
|
+
requestType: "json",
|
|
265
|
+
body: request,
|
|
269
266
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
270
267
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
271
268
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
272
269
|
});
|
|
273
270
|
if (_response.ok) {
|
|
274
|
-
return {
|
|
271
|
+
return {
|
|
272
|
+
data: _response.body,
|
|
273
|
+
rawResponse: _response.rawResponse,
|
|
274
|
+
};
|
|
275
275
|
}
|
|
276
276
|
if (_response.error.reason === "status-code") {
|
|
277
277
|
switch (_response.error.statusCode) {
|
|
@@ -293,7 +293,7 @@ class ShipperPayCourierLineItemGroups {
|
|
|
293
293
|
rawResponse: _response.rawResponse,
|
|
294
294
|
});
|
|
295
295
|
case "timeout":
|
|
296
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
296
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_line_item_groups/preview.");
|
|
297
297
|
case "unknown":
|
|
298
298
|
throw new errors.ChrtError({
|
|
299
299
|
message: _response.error.errorMessage,
|