@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
|
@@ -20,24 +20,24 @@ export class ShipperPayCourierPayments {
|
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Get a shipper pay courier payment by its ID
|
|
24
24
|
*
|
|
25
|
-
* @param {string}
|
|
25
|
+
* @param {string} shipperPayCourierPaymentId
|
|
26
26
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
27
|
*
|
|
28
28
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
|
-
* await client.shipperPayCourierPayments.
|
|
31
|
+
* await client.shipperPayCourierPayments.getById("shipper_pay_courier_payment_id")
|
|
32
32
|
*/
|
|
33
|
-
|
|
34
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
33
|
+
getById(shipperPayCourierPaymentId, requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__getById(shipperPayCourierPaymentId, requestOptions));
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
__getById(shipperPayCourierPaymentId, requestOptions) {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
var _a, _b, _c, _d;
|
|
39
39
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
40
|
-
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_payments/${encodeURIComponent(
|
|
40
|
+
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_payments/${encodeURIComponent(shipperPayCourierPaymentId)}`),
|
|
41
41
|
method: "GET",
|
|
42
42
|
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),
|
|
43
43
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -67,7 +67,7 @@ export class ShipperPayCourierPayments {
|
|
|
67
67
|
rawResponse: _response.rawResponse,
|
|
68
68
|
});
|
|
69
69
|
case "timeout":
|
|
70
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_payments/{
|
|
70
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_payments/{shipper_pay_courier_payment_id}.");
|
|
71
71
|
case "unknown":
|
|
72
72
|
throw new errors.ChrtError({
|
|
73
73
|
message: _response.error.errorMessage,
|
|
@@ -77,31 +77,26 @@ export class ShipperPayCourierPayments {
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
80
|
+
* Deletes a shipper-to-courier payment record. Only allowed if the payment status is PENDING.
|
|
81
81
|
*
|
|
82
|
-
* @param {
|
|
82
|
+
* @param {string} shipperPayCourierPaymentId
|
|
83
83
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
84
84
|
*
|
|
85
85
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
86
86
|
*
|
|
87
87
|
* @example
|
|
88
|
-
* await client.shipperPayCourierPayments.
|
|
89
|
-
* order_id_or_short_id: "order_id_or_short_id"
|
|
90
|
-
* })
|
|
88
|
+
* await client.shipperPayCourierPayments.delete("shipper_pay_courier_payment_id")
|
|
91
89
|
*/
|
|
92
|
-
|
|
93
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
90
|
+
delete(shipperPayCourierPaymentId, requestOptions) {
|
|
91
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(shipperPayCourierPaymentId, requestOptions));
|
|
94
92
|
}
|
|
95
|
-
|
|
93
|
+
__delete(shipperPayCourierPaymentId, requestOptions) {
|
|
96
94
|
return __awaiter(this, void 0, void 0, function* () {
|
|
97
95
|
var _a, _b, _c, _d;
|
|
98
96
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
99
|
-
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,
|
|
100
|
-
method: "
|
|
97
|
+
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_payments/${encodeURIComponent(shipperPayCourierPaymentId)}`),
|
|
98
|
+
method: "DELETE",
|
|
101
99
|
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),
|
|
102
|
-
contentType: "application/json",
|
|
103
|
-
requestType: "json",
|
|
104
|
-
body: request,
|
|
105
100
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
106
101
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
107
102
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -129,7 +124,7 @@ export class ShipperPayCourierPayments {
|
|
|
129
124
|
rawResponse: _response.rawResponse,
|
|
130
125
|
});
|
|
131
126
|
case "timeout":
|
|
132
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
127
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/shipper_pay_courier_payments/{shipper_pay_courier_payment_id}.");
|
|
133
128
|
case "unknown":
|
|
134
129
|
throw new errors.ChrtError({
|
|
135
130
|
message: _response.error.errorMessage,
|
|
@@ -139,27 +134,92 @@ export class ShipperPayCourierPayments {
|
|
|
139
134
|
});
|
|
140
135
|
}
|
|
141
136
|
/**
|
|
142
|
-
*
|
|
137
|
+
* Get a shipper pay courier payment by order ID or short ID
|
|
143
138
|
*
|
|
139
|
+
* @param {string} orderIdOrShortId
|
|
144
140
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
145
141
|
*
|
|
142
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
143
|
+
*
|
|
146
144
|
* @example
|
|
147
|
-
* await client.shipperPayCourierPayments.
|
|
145
|
+
* await client.shipperPayCourierPayments.getByOrderIdOrShortId("order_id_or_short_id")
|
|
148
146
|
*/
|
|
149
|
-
|
|
150
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
147
|
+
getByOrderIdOrShortId(orderIdOrShortId, requestOptions) {
|
|
148
|
+
return core.HttpResponsePromise.fromPromise(this.__getByOrderIdOrShortId(orderIdOrShortId, requestOptions));
|
|
151
149
|
}
|
|
152
|
-
|
|
150
|
+
__getByOrderIdOrShortId(orderIdOrShortId, requestOptions) {
|
|
153
151
|
return __awaiter(this, void 0, void 0, function* () {
|
|
154
152
|
var _a, _b, _c, _d;
|
|
155
153
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
156
|
-
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,
|
|
154
|
+
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_payments/by_order/${encodeURIComponent(orderIdOrShortId)}`),
|
|
157
155
|
method: "GET",
|
|
158
156
|
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),
|
|
159
157
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
160
158
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
161
159
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
162
160
|
});
|
|
161
|
+
if (_response.ok) {
|
|
162
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
163
|
+
}
|
|
164
|
+
if (_response.error.reason === "status-code") {
|
|
165
|
+
switch (_response.error.statusCode) {
|
|
166
|
+
case 422:
|
|
167
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
168
|
+
default:
|
|
169
|
+
throw new errors.ChrtError({
|
|
170
|
+
statusCode: _response.error.statusCode,
|
|
171
|
+
body: _response.error.body,
|
|
172
|
+
rawResponse: _response.rawResponse,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
switch (_response.error.reason) {
|
|
177
|
+
case "non-json":
|
|
178
|
+
throw new errors.ChrtError({
|
|
179
|
+
statusCode: _response.error.statusCode,
|
|
180
|
+
body: _response.error.rawBody,
|
|
181
|
+
rawResponse: _response.rawResponse,
|
|
182
|
+
});
|
|
183
|
+
case "timeout":
|
|
184
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_payments/by_order/{order_id_or_short_id}.");
|
|
185
|
+
case "unknown":
|
|
186
|
+
throw new errors.ChrtError({
|
|
187
|
+
message: _response.error.errorMessage,
|
|
188
|
+
rawResponse: _response.rawResponse,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* List shipper pay courier payments by shipper org ID with status filtering
|
|
195
|
+
*
|
|
196
|
+
* @param {Chrt.ListPaymentsByShipperReq} request
|
|
197
|
+
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
|
+
*
|
|
199
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* await client.shipperPayCourierPayments.listByShipperOrgId({
|
|
203
|
+
* statuses: ["invoice_not_yet_created"]
|
|
204
|
+
* })
|
|
205
|
+
*/
|
|
206
|
+
listByShipperOrgId(request, requestOptions) {
|
|
207
|
+
return core.HttpResponsePromise.fromPromise(this.__listByShipperOrgId(request, requestOptions));
|
|
208
|
+
}
|
|
209
|
+
__listByShipperOrgId(request, requestOptions) {
|
|
210
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
211
|
+
var _a, _b, _c, _d;
|
|
212
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
213
|
+
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_payments/list/by_shipper_org_id"),
|
|
214
|
+
method: "POST",
|
|
215
|
+
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),
|
|
216
|
+
contentType: "application/json",
|
|
217
|
+
requestType: "json",
|
|
218
|
+
body: request,
|
|
219
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
220
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
221
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
222
|
+
});
|
|
163
223
|
if (_response.ok) {
|
|
164
224
|
return {
|
|
165
225
|
data: _response.body,
|
|
@@ -167,11 +227,16 @@ export class ShipperPayCourierPayments {
|
|
|
167
227
|
};
|
|
168
228
|
}
|
|
169
229
|
if (_response.error.reason === "status-code") {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
230
|
+
switch (_response.error.statusCode) {
|
|
231
|
+
case 422:
|
|
232
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
233
|
+
default:
|
|
234
|
+
throw new errors.ChrtError({
|
|
235
|
+
statusCode: _response.error.statusCode,
|
|
236
|
+
body: _response.error.body,
|
|
237
|
+
rawResponse: _response.rawResponse,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
175
240
|
}
|
|
176
241
|
switch (_response.error.reason) {
|
|
177
242
|
case "non-json":
|
|
@@ -181,7 +246,7 @@ export class ShipperPayCourierPayments {
|
|
|
181
246
|
rawResponse: _response.rawResponse,
|
|
182
247
|
});
|
|
183
248
|
case "timeout":
|
|
184
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
249
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/list/by_shipper_org_id.");
|
|
185
250
|
case "unknown":
|
|
186
251
|
throw new errors.ChrtError({
|
|
187
252
|
message: _response.error.errorMessage,
|
|
@@ -191,26 +256,31 @@ export class ShipperPayCourierPayments {
|
|
|
191
256
|
});
|
|
192
257
|
}
|
|
193
258
|
/**
|
|
194
|
-
*
|
|
259
|
+
* List shipper pay courier payments by courier org ID with status filtering
|
|
195
260
|
*
|
|
196
|
-
* @param {Chrt.
|
|
261
|
+
* @param {Chrt.ListPaymentsByCourierReq} request
|
|
197
262
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
263
|
*
|
|
199
264
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
200
265
|
*
|
|
201
266
|
* @example
|
|
202
|
-
* await client.shipperPayCourierPayments.
|
|
267
|
+
* await client.shipperPayCourierPayments.listByCourierOrgId({
|
|
268
|
+
* statuses: ["invoice_not_yet_created"]
|
|
269
|
+
* })
|
|
203
270
|
*/
|
|
204
|
-
|
|
205
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
271
|
+
listByCourierOrgId(request, requestOptions) {
|
|
272
|
+
return core.HttpResponsePromise.fromPromise(this.__listByCourierOrgId(request, requestOptions));
|
|
206
273
|
}
|
|
207
|
-
|
|
274
|
+
__listByCourierOrgId(request, requestOptions) {
|
|
208
275
|
return __awaiter(this, void 0, void 0, function* () {
|
|
209
276
|
var _a, _b, _c, _d;
|
|
210
277
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
211
|
-
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,
|
|
212
|
-
method: "
|
|
278
|
+
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_payments/list/by_courier_org_id"),
|
|
279
|
+
method: "POST",
|
|
213
280
|
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),
|
|
281
|
+
contentType: "application/json",
|
|
282
|
+
requestType: "json",
|
|
283
|
+
body: request,
|
|
214
284
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
215
285
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
216
286
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -241,7 +311,7 @@ export class ShipperPayCourierPayments {
|
|
|
241
311
|
rawResponse: _response.rawResponse,
|
|
242
312
|
});
|
|
243
313
|
case "timeout":
|
|
244
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
314
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/list/by_courier_org_id.");
|
|
245
315
|
case "unknown":
|
|
246
316
|
throw new errors.ChrtError({
|
|
247
317
|
message: _response.error.errorMessage,
|
|
@@ -251,7 +321,7 @@ export class ShipperPayCourierPayments {
|
|
|
251
321
|
});
|
|
252
322
|
}
|
|
253
323
|
/**
|
|
254
|
-
*
|
|
324
|
+
* Create a shipper-to-courier payment record based on all task groups in an order
|
|
255
325
|
*
|
|
256
326
|
* @param {Chrt.CreateShipperPayCourierPaymentReq} request
|
|
257
327
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -259,18 +329,18 @@ export class ShipperPayCourierPayments {
|
|
|
259
329
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
260
330
|
*
|
|
261
331
|
* @example
|
|
262
|
-
* await client.shipperPayCourierPayments.
|
|
332
|
+
* await client.shipperPayCourierPayments.create({
|
|
263
333
|
* order_id_or_short_id: "order_id_or_short_id"
|
|
264
334
|
* })
|
|
265
335
|
*/
|
|
266
|
-
|
|
267
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
336
|
+
create(request, requestOptions) {
|
|
337
|
+
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
268
338
|
}
|
|
269
|
-
|
|
339
|
+
__create(request, requestOptions) {
|
|
270
340
|
return __awaiter(this, void 0, void 0, function* () {
|
|
271
341
|
var _a, _b, _c, _d;
|
|
272
342
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
273
|
-
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_payments/
|
|
343
|
+
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_payments/create"),
|
|
274
344
|
method: "POST",
|
|
275
345
|
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),
|
|
276
346
|
contentType: "application/json",
|
|
@@ -303,7 +373,7 @@ export class ShipperPayCourierPayments {
|
|
|
303
373
|
rawResponse: _response.rawResponse,
|
|
304
374
|
});
|
|
305
375
|
case "timeout":
|
|
306
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/
|
|
376
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/create.");
|
|
307
377
|
case "unknown":
|
|
308
378
|
throw new errors.ChrtError({
|
|
309
379
|
message: _response.error.errorMessage,
|
|
@@ -313,26 +383,31 @@ export class ShipperPayCourierPayments {
|
|
|
313
383
|
});
|
|
314
384
|
}
|
|
315
385
|
/**
|
|
316
|
-
*
|
|
386
|
+
* Preview a shipper-to-courier payment showing task groups, line item groups, total amount, and readiness status
|
|
317
387
|
*
|
|
318
|
-
* @param {
|
|
388
|
+
* @param {Chrt.CreateShipperPayCourierPaymentReq} request
|
|
319
389
|
* @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
|
|
320
390
|
*
|
|
321
391
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
322
392
|
*
|
|
323
393
|
* @example
|
|
324
|
-
* await client.shipperPayCourierPayments.
|
|
394
|
+
* await client.shipperPayCourierPayments.preview({
|
|
395
|
+
* order_id_or_short_id: "order_id_or_short_id"
|
|
396
|
+
* })
|
|
325
397
|
*/
|
|
326
|
-
|
|
327
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
398
|
+
preview(request, requestOptions) {
|
|
399
|
+
return core.HttpResponsePromise.fromPromise(this.__preview(request, requestOptions));
|
|
328
400
|
}
|
|
329
|
-
|
|
401
|
+
__preview(request, requestOptions) {
|
|
330
402
|
return __awaiter(this, void 0, void 0, function* () {
|
|
331
403
|
var _a, _b, _c, _d;
|
|
332
404
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
333
|
-
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,
|
|
334
|
-
method: "
|
|
405
|
+
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_payments/preview"),
|
|
406
|
+
method: "POST",
|
|
335
407
|
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),
|
|
408
|
+
contentType: "application/json",
|
|
409
|
+
requestType: "json",
|
|
410
|
+
body: request,
|
|
336
411
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
337
412
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
338
413
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -360,7 +435,7 @@ export class ShipperPayCourierPayments {
|
|
|
360
435
|
rawResponse: _response.rawResponse,
|
|
361
436
|
});
|
|
362
437
|
case "timeout":
|
|
363
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling
|
|
438
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/preview.");
|
|
364
439
|
case "unknown":
|
|
365
440
|
throw new errors.ChrtError({
|
|
366
441
|
message: _response.error.errorMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../../../../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* statuses: ["invoice_not_yet_created"]
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface ListPaymentsByCourierReq {
|
|
12
|
+
statuses: Chrt.StripeConnectInvoiceStatusEnum[];
|
|
13
|
+
/** Must be a string starting with `org_` */
|
|
14
|
+
shipper_org_id?: string | null;
|
|
15
|
+
off_chrt_shipper_org_info_id?: string | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../../../../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* statuses: ["invoice_not_yet_created"]
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface ListPaymentsByShipperReq {
|
|
12
|
+
statuses: Chrt.StripeConnectInvoiceStatusEnum[];
|
|
13
|
+
/** Must be a string starting with `org_` */
|
|
14
|
+
courier_org_id?: string | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Chrt from "../index.mjs";
|
|
5
|
-
/**
|
|
6
|
-
* Response model for getting shipper pay courier payments for a shipper organization.
|
|
7
|
-
*/
|
|
8
5
|
export interface GetShipperPayCourierPaymentsForShipperRes {
|
|
9
6
|
payments: Chrt.ShipperPayCourierPayment1[];
|
|
10
7
|
}
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Chrt from "../index.mjs";
|
|
5
|
-
/**
|
|
6
|
-
* Response model for payment preview.
|
|
7
|
-
*/
|
|
8
5
|
export interface PaymentPreviewResponse {
|
|
9
6
|
task_groups: Chrt.TaskGroup1[];
|
|
10
7
|
line_item_groups: Chrt.ShipperPayCourierLineItemGroup1[];
|
|
@@ -11,13 +11,14 @@ export interface ShipperPayCourierPayment1 {
|
|
|
11
11
|
shipper_org_id?: string | null;
|
|
12
12
|
/** Must be a string starting with `org_` */
|
|
13
13
|
courier_org_id: string;
|
|
14
|
+
stripe_connect_shipper_pay_courier_customer_id?: string | null;
|
|
15
|
+
stripe_invoice_id?: string | null;
|
|
16
|
+
stripe_invoice_url?: string | null;
|
|
14
17
|
stripe_invoice_created_timestamp?: string | null;
|
|
15
|
-
stripe_invoice_completed_timestamp?: string | null;
|
|
16
18
|
/** Must be a string starting with `user_` */
|
|
17
19
|
stripe_invoice_created_by_user_id?: string | null;
|
|
18
20
|
payment_amount: number;
|
|
19
21
|
stripe_invoice_status?: Chrt.StripeConnectInvoiceStatusEnum;
|
|
20
|
-
|
|
21
|
-
stripe_connect_shipper_pay_courier_customer_id?: string | null;
|
|
22
|
+
stripe_invoice_completed_timestamp?: string | null;
|
|
22
23
|
_id: string;
|
|
23
24
|
}
|
|
@@ -25,7 +25,6 @@ export * from "./GeometryCollectionOutputGeometriesItem.mjs";
|
|
|
25
25
|
export * from "./GetOrderFullRes.mjs";
|
|
26
26
|
export * from "./GetOrderRes.mjs";
|
|
27
27
|
export * from "./GetShipperPayCourierPaymentsForShipperRes.mjs";
|
|
28
|
-
export * from "./GetShipperPayCourierPaymentsRes.mjs";
|
|
29
28
|
export * from "./HttpValidationError.mjs";
|
|
30
29
|
export * from "./LineItem1.mjs";
|
|
31
30
|
export * from "./LineItemClientCreate1.mjs";
|
|
@@ -25,7 +25,6 @@ export * from "./GeometryCollectionOutputGeometriesItem.mjs";
|
|
|
25
25
|
export * from "./GetOrderFullRes.mjs";
|
|
26
26
|
export * from "./GetOrderRes.mjs";
|
|
27
27
|
export * from "./GetShipperPayCourierPaymentsForShipperRes.mjs";
|
|
28
|
-
export * from "./GetShipperPayCourierPaymentsRes.mjs";
|
|
29
28
|
export * from "./HttpValidationError.mjs";
|
|
30
29
|
export * from "./LineItem1.mjs";
|
|
31
30
|
export * from "./LineItemClientCreate1.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.205";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.205";
|