@chrt-inc/typescript-sdk 0.0.203 → 0.0.205
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/courierPayDriverRateSheets/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/courierPayDriverRateSheets/client/Client.js +57 -57
- 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/types/CreateShipperPayCourierPaymentReq.d.ts +0 -3
- 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/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/courierPayDriverRateSheets/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/courierPayDriverRateSheets/client/Client.mjs +57 -57
- 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/types/CreateShipperPayCourierPaymentReq.d.mts +0 -3
- 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/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 +159 -84
- 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
|
@@ -68,6 +68,63 @@ export class CourierPayDriverRateSheets {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Retrieves all rate sheets assigned to a specific driver.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} driverId
|
|
75
|
+
* @param {CourierPayDriverRateSheets.RequestOptions} requestOptions - Request-specific configuration.
|
|
76
|
+
*
|
|
77
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* await client.courierPayDriverRateSheets.listByDriverId("driver_id")
|
|
81
|
+
*/
|
|
82
|
+
listByDriverId(driverId, requestOptions) {
|
|
83
|
+
return core.HttpResponsePromise.fromPromise(this.__listByDriverId(driverId, requestOptions));
|
|
84
|
+
}
|
|
85
|
+
__listByDriverId(driverId, requestOptions) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
var _a, _b, _c, _d;
|
|
88
|
+
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, `oort/courier_pay_driver_rate_sheets/by_driver_id/${encodeURIComponent(driverId)}`),
|
|
90
|
+
method: "GET",
|
|
91
|
+
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),
|
|
92
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
93
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
94
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
95
|
+
});
|
|
96
|
+
if (_response.ok) {
|
|
97
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
98
|
+
}
|
|
99
|
+
if (_response.error.reason === "status-code") {
|
|
100
|
+
switch (_response.error.statusCode) {
|
|
101
|
+
case 422:
|
|
102
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
103
|
+
default:
|
|
104
|
+
throw new errors.ChrtError({
|
|
105
|
+
statusCode: _response.error.statusCode,
|
|
106
|
+
body: _response.error.body,
|
|
107
|
+
rawResponse: _response.rawResponse,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
switch (_response.error.reason) {
|
|
112
|
+
case "non-json":
|
|
113
|
+
throw new errors.ChrtError({
|
|
114
|
+
statusCode: _response.error.statusCode,
|
|
115
|
+
body: _response.error.rawBody,
|
|
116
|
+
rawResponse: _response.rawResponse,
|
|
117
|
+
});
|
|
118
|
+
case "timeout":
|
|
119
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/courier_pay_driver_rate_sheets/by_driver_id/{driver_id}.");
|
|
120
|
+
case "unknown":
|
|
121
|
+
throw new errors.ChrtError({
|
|
122
|
+
message: _response.error.errorMessage,
|
|
123
|
+
rawResponse: _response.rawResponse,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
71
128
|
/**
|
|
72
129
|
* Creates a new driver rate sheet for calculating courier payments.
|
|
73
130
|
*
|
|
@@ -319,63 +376,6 @@ export class CourierPayDriverRateSheets {
|
|
|
319
376
|
}
|
|
320
377
|
});
|
|
321
378
|
}
|
|
322
|
-
/**
|
|
323
|
-
* Retrieves all rate sheets assigned to a specific driver.
|
|
324
|
-
*
|
|
325
|
-
* @param {string} driverId
|
|
326
|
-
* @param {CourierPayDriverRateSheets.RequestOptions} requestOptions - Request-specific configuration.
|
|
327
|
-
*
|
|
328
|
-
* @throws {@link Chrt.UnprocessableEntityError}
|
|
329
|
-
*
|
|
330
|
-
* @example
|
|
331
|
-
* await client.courierPayDriverRateSheets.listByDriverId("driver_id")
|
|
332
|
-
*/
|
|
333
|
-
listByDriverId(driverId, requestOptions) {
|
|
334
|
-
return core.HttpResponsePromise.fromPromise(this.__listByDriverId(driverId, requestOptions));
|
|
335
|
-
}
|
|
336
|
-
__listByDriverId(driverId, requestOptions) {
|
|
337
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
338
|
-
var _a, _b, _c, _d;
|
|
339
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
340
|
-
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)}`),
|
|
341
|
-
method: "GET",
|
|
342
|
-
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),
|
|
343
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
344
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
345
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
346
|
-
});
|
|
347
|
-
if (_response.ok) {
|
|
348
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
349
|
-
}
|
|
350
|
-
if (_response.error.reason === "status-code") {
|
|
351
|
-
switch (_response.error.statusCode) {
|
|
352
|
-
case 422:
|
|
353
|
-
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
354
|
-
default:
|
|
355
|
-
throw new errors.ChrtError({
|
|
356
|
-
statusCode: _response.error.statusCode,
|
|
357
|
-
body: _response.error.body,
|
|
358
|
-
rawResponse: _response.rawResponse,
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
switch (_response.error.reason) {
|
|
363
|
-
case "non-json":
|
|
364
|
-
throw new errors.ChrtError({
|
|
365
|
-
statusCode: _response.error.statusCode,
|
|
366
|
-
body: _response.error.rawBody,
|
|
367
|
-
rawResponse: _response.rawResponse,
|
|
368
|
-
});
|
|
369
|
-
case "timeout":
|
|
370
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/courier_pay_driver_rate_sheets/list/by_driver_id/{driver_id}.");
|
|
371
|
-
case "unknown":
|
|
372
|
-
throw new errors.ChrtError({
|
|
373
|
-
message: _response.error.errorMessage,
|
|
374
|
-
rawResponse: _response.rawResponse,
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
379
|
_getAuthorizationHeader() {
|
|
380
380
|
return __awaiter(this, void 0, void 0, function* () {
|
|
381
381
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -28,6 +28,7 @@ export * from "./orgProfiles/client/requests/index.mjs";
|
|
|
28
28
|
export * from "./orders/client/requests/index.mjs";
|
|
29
29
|
export * from "./courierPayDriverRateSheets/client/requests/index.mjs";
|
|
30
30
|
export * from "./shipperPayCourierRateSheets/client/requests/index.mjs";
|
|
31
|
+
export * from "./shipperPayCourierPayments/client/requests/index.mjs";
|
|
31
32
|
export * from "./courierPayDriverPayouts/client/requests/index.mjs";
|
|
32
33
|
export * from "./taskGroups/client/requests/index.mjs";
|
|
33
34
|
export * from "./shipperContactInfo/client/requests/index.mjs";
|
|
@@ -28,6 +28,7 @@ export * from "./orgProfiles/client/requests/index.mjs";
|
|
|
28
28
|
export * from "./orders/client/requests/index.mjs";
|
|
29
29
|
export * from "./courierPayDriverRateSheets/client/requests/index.mjs";
|
|
30
30
|
export * from "./shipperPayCourierRateSheets/client/requests/index.mjs";
|
|
31
|
+
export * from "./shipperPayCourierPayments/client/requests/index.mjs";
|
|
31
32
|
export * from "./courierPayDriverPayouts/client/requests/index.mjs";
|
|
32
33
|
export * from "./taskGroups/client/requests/index.mjs";
|
|
33
34
|
export * from "./shipperContactInfo/client/requests/index.mjs";
|
|
@@ -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
|
*
|
|
@@ -30,41 +30,32 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
30
30
|
return ((_a = this._removeLineItems) !== null && _a !== void 0 ? _a : (this._removeLineItems = new RemoveLineItems(this._options)));
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Retrieves a shipper pay courier line item group by its ID.
|
|
34
34
|
*
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {string} id
|
|
36
36
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
37
|
*
|
|
38
38
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
|
-
* await client.shipperPayCourierLineItemGroups.
|
|
42
|
-
* shipper_pay_courier_rate_sheet_id: "shipper_pay_courier_rate_sheet_id",
|
|
43
|
-
* task_group_id: "task_group_id"
|
|
44
|
-
* })
|
|
41
|
+
* await client.shipperPayCourierLineItemGroups.getById("id")
|
|
45
42
|
*/
|
|
46
|
-
|
|
47
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
43
|
+
getById(id, requestOptions) {
|
|
44
|
+
return core.HttpResponsePromise.fromPromise(this.__getById(id, requestOptions));
|
|
48
45
|
}
|
|
49
|
-
|
|
46
|
+
__getById(id, requestOptions) {
|
|
50
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
48
|
var _a, _b, _c, _d;
|
|
52
49
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
53
|
-
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,
|
|
54
|
-
method: "
|
|
50
|
+
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)}`),
|
|
51
|
+
method: "GET",
|
|
55
52
|
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),
|
|
56
|
-
contentType: "application/json",
|
|
57
|
-
requestType: "json",
|
|
58
|
-
body: request,
|
|
59
53
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
60
54
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
61
55
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
62
56
|
});
|
|
63
57
|
if (_response.ok) {
|
|
64
|
-
return {
|
|
65
|
-
data: _response.body,
|
|
66
|
-
rawResponse: _response.rawResponse,
|
|
67
|
-
};
|
|
58
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
68
59
|
}
|
|
69
60
|
if (_response.error.reason === "status-code") {
|
|
70
61
|
switch (_response.error.statusCode) {
|
|
@@ -86,7 +77,7 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
86
77
|
rawResponse: _response.rawResponse,
|
|
87
78
|
});
|
|
88
79
|
case "timeout":
|
|
89
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
80
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_line_item_groups/{id}.");
|
|
90
81
|
case "unknown":
|
|
91
82
|
throw new errors.ChrtError({
|
|
92
83
|
message: _response.error.errorMessage,
|
|
@@ -96,7 +87,7 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
96
87
|
});
|
|
97
88
|
}
|
|
98
89
|
/**
|
|
99
|
-
*
|
|
90
|
+
* Deletes a shipper pay courier line item group by its ID.
|
|
100
91
|
*
|
|
101
92
|
* @param {string} id
|
|
102
93
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -104,17 +95,17 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
104
95
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
105
96
|
*
|
|
106
97
|
* @example
|
|
107
|
-
* await client.shipperPayCourierLineItemGroups.
|
|
98
|
+
* await client.shipperPayCourierLineItemGroups.deleteById("id")
|
|
108
99
|
*/
|
|
109
|
-
|
|
110
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
100
|
+
deleteById(id, requestOptions) {
|
|
101
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteById(id, requestOptions));
|
|
111
102
|
}
|
|
112
|
-
|
|
103
|
+
__deleteById(id, requestOptions) {
|
|
113
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
105
|
var _a, _b, _c, _d;
|
|
115
106
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
116
107
|
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)}`),
|
|
117
|
-
method: "
|
|
108
|
+
method: "DELETE",
|
|
118
109
|
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),
|
|
119
110
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
120
111
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -143,7 +134,7 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
143
134
|
rawResponse: _response.rawResponse,
|
|
144
135
|
});
|
|
145
136
|
case "timeout":
|
|
146
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
137
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/shipper_pay_courier_line_item_groups/{id}.");
|
|
147
138
|
case "unknown":
|
|
148
139
|
throw new errors.ChrtError({
|
|
149
140
|
message: _response.error.errorMessage,
|
|
@@ -153,25 +144,25 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
153
144
|
});
|
|
154
145
|
}
|
|
155
146
|
/**
|
|
156
|
-
*
|
|
147
|
+
* Retrieves a shipper pay courier line item group by its associated task group ID.
|
|
157
148
|
*
|
|
158
|
-
* @param {string}
|
|
149
|
+
* @param {string} taskGroupId
|
|
159
150
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
160
151
|
*
|
|
161
152
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
162
153
|
*
|
|
163
154
|
* @example
|
|
164
|
-
* await client.shipperPayCourierLineItemGroups.
|
|
155
|
+
* await client.shipperPayCourierLineItemGroups.byTaskGroupId("task_group_id")
|
|
165
156
|
*/
|
|
166
|
-
|
|
167
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
157
|
+
byTaskGroupId(taskGroupId, requestOptions) {
|
|
158
|
+
return core.HttpResponsePromise.fromPromise(this.__byTaskGroupId(taskGroupId, requestOptions));
|
|
168
159
|
}
|
|
169
|
-
|
|
160
|
+
__byTaskGroupId(taskGroupId, requestOptions) {
|
|
170
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
171
162
|
var _a, _b, _c, _d;
|
|
172
163
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
173
|
-
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(
|
|
174
|
-
method: "
|
|
164
|
+
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)}`),
|
|
165
|
+
method: "GET",
|
|
175
166
|
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),
|
|
176
167
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
177
168
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -200,7 +191,7 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
200
191
|
rawResponse: _response.rawResponse,
|
|
201
192
|
});
|
|
202
193
|
case "timeout":
|
|
203
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
194
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_line_item_groups/by_task_group/{task_group_id}.");
|
|
204
195
|
case "unknown":
|
|
205
196
|
throw new errors.ChrtError({
|
|
206
197
|
message: _response.error.errorMessage,
|
|
@@ -210,32 +201,41 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
210
201
|
});
|
|
211
202
|
}
|
|
212
203
|
/**
|
|
213
|
-
*
|
|
204
|
+
* Previews calculated line items for a shipper pay courier based on rate sheet and task group without creating the group.
|
|
214
205
|
*
|
|
215
|
-
* @param {
|
|
206
|
+
* @param {Chrt.ShipperPayCourierLineItemGroupCreateReq} request
|
|
216
207
|
* @param {ShipperPayCourierLineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
217
208
|
*
|
|
218
209
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
219
210
|
*
|
|
220
211
|
* @example
|
|
221
|
-
* await client.shipperPayCourierLineItemGroups.
|
|
212
|
+
* await client.shipperPayCourierLineItemGroups.preview({
|
|
213
|
+
* shipper_pay_courier_rate_sheet_id: "shipper_pay_courier_rate_sheet_id",
|
|
214
|
+
* task_group_id: "task_group_id"
|
|
215
|
+
* })
|
|
222
216
|
*/
|
|
223
|
-
|
|
224
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
217
|
+
preview(request, requestOptions) {
|
|
218
|
+
return core.HttpResponsePromise.fromPromise(this.__preview(request, requestOptions));
|
|
225
219
|
}
|
|
226
|
-
|
|
220
|
+
__preview(request, requestOptions) {
|
|
227
221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
228
222
|
var _a, _b, _c, _d;
|
|
229
223
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
230
|
-
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,
|
|
231
|
-
method: "
|
|
224
|
+
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"),
|
|
225
|
+
method: "POST",
|
|
232
226
|
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),
|
|
227
|
+
contentType: "application/json",
|
|
228
|
+
requestType: "json",
|
|
229
|
+
body: request,
|
|
233
230
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
234
231
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
235
232
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
236
233
|
});
|
|
237
234
|
if (_response.ok) {
|
|
238
|
-
return {
|
|
235
|
+
return {
|
|
236
|
+
data: _response.body,
|
|
237
|
+
rawResponse: _response.rawResponse,
|
|
238
|
+
};
|
|
239
239
|
}
|
|
240
240
|
if (_response.error.reason === "status-code") {
|
|
241
241
|
switch (_response.error.statusCode) {
|
|
@@ -257,7 +257,7 @@ export class ShipperPayCourierLineItemGroups {
|
|
|
257
257
|
rawResponse: _response.rawResponse,
|
|
258
258
|
});
|
|
259
259
|
case "timeout":
|
|
260
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
260
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_line_item_groups/preview.");
|
|
261
261
|
case "unknown":
|
|
262
262
|
throw new errors.ChrtError({
|
|
263
263
|
message: _response.error.errorMessage,
|
|
@@ -29,58 +29,76 @@ export declare class ShipperPayCourierPayments {
|
|
|
29
29
|
protected readonly _options: ShipperPayCourierPayments.Options;
|
|
30
30
|
constructor(_options?: ShipperPayCourierPayments.Options);
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Get a shipper pay courier payment by its ID
|
|
33
33
|
*
|
|
34
|
-
* @param {string}
|
|
34
|
+
* @param {string} shipperPayCourierPaymentId
|
|
35
35
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
36
|
*
|
|
37
37
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
|
-
* await client.shipperPayCourierPayments.
|
|
40
|
+
* await client.shipperPayCourierPayments.getById("shipper_pay_courier_payment_id")
|
|
41
41
|
*/
|
|
42
|
-
|
|
43
|
-
private
|
|
42
|
+
getById(shipperPayCourierPaymentId: string, requestOptions?: ShipperPayCourierPayments.RequestOptions): core.HttpResponsePromise<Chrt.ShipperPayCourierPayment1>;
|
|
43
|
+
private __getById;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Deletes a shipper-to-courier payment record. Only allowed if the payment status is PENDING.
|
|
46
46
|
*
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {string} shipperPayCourierPaymentId
|
|
48
48
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
49
49
|
*
|
|
50
50
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
53
|
-
* await client.shipperPayCourierPayments.
|
|
54
|
-
* order_id_or_short_id: "order_id_or_short_id"
|
|
55
|
-
* })
|
|
53
|
+
* await client.shipperPayCourierPayments.delete("shipper_pay_courier_payment_id")
|
|
56
54
|
*/
|
|
57
|
-
|
|
58
|
-
private
|
|
55
|
+
delete(shipperPayCourierPaymentId: string, requestOptions?: ShipperPayCourierPayments.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
56
|
+
private __delete;
|
|
59
57
|
/**
|
|
60
|
-
*
|
|
58
|
+
* Get a shipper pay courier payment by order ID or short ID
|
|
61
59
|
*
|
|
60
|
+
* @param {string} orderIdOrShortId
|
|
62
61
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
62
|
*
|
|
63
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
64
|
+
*
|
|
64
65
|
* @example
|
|
65
|
-
* await client.shipperPayCourierPayments.
|
|
66
|
+
* await client.shipperPayCourierPayments.getByOrderIdOrShortId("order_id_or_short_id")
|
|
66
67
|
*/
|
|
67
|
-
|
|
68
|
-
private
|
|
68
|
+
getByOrderIdOrShortId(orderIdOrShortId: string, requestOptions?: ShipperPayCourierPayments.RequestOptions): core.HttpResponsePromise<Chrt.ShipperPayCourierPayment1>;
|
|
69
|
+
private __getByOrderIdOrShortId;
|
|
69
70
|
/**
|
|
70
|
-
*
|
|
71
|
+
* List shipper pay courier payments by shipper org ID with status filtering
|
|
71
72
|
*
|
|
72
|
-
* @param {Chrt.
|
|
73
|
+
* @param {Chrt.ListPaymentsByShipperReq} request
|
|
73
74
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
75
|
*
|
|
75
76
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
76
77
|
*
|
|
77
78
|
* @example
|
|
78
|
-
* await client.shipperPayCourierPayments.
|
|
79
|
+
* await client.shipperPayCourierPayments.listByShipperOrgId({
|
|
80
|
+
* statuses: ["invoice_not_yet_created"]
|
|
81
|
+
* })
|
|
79
82
|
*/
|
|
80
|
-
|
|
81
|
-
private
|
|
83
|
+
listByShipperOrgId(request: Chrt.ListPaymentsByShipperReq, requestOptions?: ShipperPayCourierPayments.RequestOptions): core.HttpResponsePromise<Chrt.GetShipperPayCourierPaymentsForShipperRes>;
|
|
84
|
+
private __listByShipperOrgId;
|
|
82
85
|
/**
|
|
83
|
-
*
|
|
86
|
+
* List shipper pay courier payments by courier org ID with status filtering
|
|
87
|
+
*
|
|
88
|
+
* @param {Chrt.ListPaymentsByCourierReq} request
|
|
89
|
+
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
90
|
+
*
|
|
91
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* await client.shipperPayCourierPayments.listByCourierOrgId({
|
|
95
|
+
* statuses: ["invoice_not_yet_created"]
|
|
96
|
+
* })
|
|
97
|
+
*/
|
|
98
|
+
listByCourierOrgId(request: Chrt.ListPaymentsByCourierReq, requestOptions?: ShipperPayCourierPayments.RequestOptions): core.HttpResponsePromise<Chrt.GetShipperPayCourierPaymentsForShipperRes>;
|
|
99
|
+
private __listByCourierOrgId;
|
|
100
|
+
/**
|
|
101
|
+
* Create a shipper-to-courier payment record based on all task groups in an order
|
|
84
102
|
*
|
|
85
103
|
* @param {Chrt.CreateShipperPayCourierPaymentReq} request
|
|
86
104
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -88,24 +106,26 @@ export declare class ShipperPayCourierPayments {
|
|
|
88
106
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
89
107
|
*
|
|
90
108
|
* @example
|
|
91
|
-
* await client.shipperPayCourierPayments.
|
|
109
|
+
* await client.shipperPayCourierPayments.create({
|
|
92
110
|
* order_id_or_short_id: "order_id_or_short_id"
|
|
93
111
|
* })
|
|
94
112
|
*/
|
|
95
|
-
|
|
96
|
-
private
|
|
113
|
+
create(request: Chrt.CreateShipperPayCourierPaymentReq, requestOptions?: ShipperPayCourierPayments.RequestOptions): core.HttpResponsePromise<string>;
|
|
114
|
+
private __create;
|
|
97
115
|
/**
|
|
98
|
-
*
|
|
116
|
+
* Preview a shipper-to-courier payment showing task groups, line item groups, total amount, and readiness status
|
|
99
117
|
*
|
|
100
|
-
* @param {
|
|
118
|
+
* @param {Chrt.CreateShipperPayCourierPaymentReq} request
|
|
101
119
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
102
120
|
*
|
|
103
121
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
104
122
|
*
|
|
105
123
|
* @example
|
|
106
|
-
* await client.shipperPayCourierPayments.
|
|
124
|
+
* await client.shipperPayCourierPayments.preview({
|
|
125
|
+
* order_id_or_short_id: "order_id_or_short_id"
|
|
126
|
+
* })
|
|
107
127
|
*/
|
|
108
|
-
|
|
109
|
-
private
|
|
128
|
+
preview(request: Chrt.CreateShipperPayCourierPaymentReq, requestOptions?: ShipperPayCourierPayments.RequestOptions): core.HttpResponsePromise<Chrt.PaymentPreviewResponse>;
|
|
129
|
+
private __preview;
|
|
110
130
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
111
131
|
}
|