@chrt-inc/typescript-sdk 1.788.0 → 1.794.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.d.ts +20 -3
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.js +68 -2
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/requests/{LineItemGroupSharedTaskGroupMileageCreateClientReq.d.ts → SharedTaskGroupMileageCreateForProviderPayDriverClientReq.d.ts} +1 -1
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/requests/SharedTaskGroupMileageCreateForProviderPayProviderClientReq.d.ts +24 -0
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/requests/SharedTaskGroupMileageCreateForProviderPayProviderClientReq.js +5 -0
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/shipping/resources/drivers/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/shipping/resources/drivers/client/Client.js +11 -3
- package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/DriversListV1Request.d.ts +2 -0
- package/dist/cjs/api/types/Driver1.d.ts +0 -1
- package/dist/cjs/api/types/DriverListRes.d.ts +1 -1
- package/dist/cjs/api/types/DriverWithActiveTaskGroupIds1.d.ts +35 -0
- package/dist/cjs/api/types/DriverWithActiveTaskGroupIds1.js +5 -0
- package/dist/cjs/api/types/OrderDraftValidationRequirements.d.ts +1 -0
- package/dist/cjs/api/types/OrderManifestValidationRequirements.d.ts +1 -0
- package/dist/cjs/api/types/OrgMembersAndDrivers.d.ts +1 -1
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.d.mts +20 -3
- package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.mjs +68 -2
- package/dist/esm/api/resources/billing/resources/lineItemGroups/client/requests/{LineItemGroupSharedTaskGroupMileageCreateClientReq.d.mts → SharedTaskGroupMileageCreateForProviderPayDriverClientReq.d.mts} +1 -1
- package/dist/esm/api/resources/billing/resources/lineItemGroups/client/requests/SharedTaskGroupMileageCreateForProviderPayProviderClientReq.d.mts +24 -0
- package/dist/esm/api/resources/billing/resources/lineItemGroups/client/requests/SharedTaskGroupMileageCreateForProviderPayProviderClientReq.mjs +4 -0
- package/dist/esm/api/resources/billing/resources/lineItemGroups/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/shipping/resources/drivers/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/shipping/resources/drivers/client/Client.mjs +11 -3
- package/dist/esm/api/resources/shipping/resources/drivers/client/requests/DriversListV1Request.d.mts +2 -0
- package/dist/esm/api/types/Driver1.d.mts +0 -1
- package/dist/esm/api/types/DriverListRes.d.mts +1 -1
- package/dist/esm/api/types/DriverWithActiveTaskGroupIds1.d.mts +35 -0
- package/dist/esm/api/types/DriverWithActiveTaskGroupIds1.mjs +4 -0
- package/dist/esm/api/types/OrderDraftValidationRequirements.d.mts +1 -0
- package/dist/esm/api/types/OrderManifestValidationRequirements.d.mts +1 -0
- package/dist/esm/api/types/OrgMembersAndDrivers.d.mts +1 -1
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +73 -6
- /package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/requests/{LineItemGroupSharedTaskGroupMileageCreateClientReq.js → SharedTaskGroupMileageCreateForProviderPayDriverClientReq.js} +0 -0
- /package/dist/esm/api/resources/billing/resources/lineItemGroups/client/requests/{LineItemGroupSharedTaskGroupMileageCreateClientReq.mjs → SharedTaskGroupMileageCreateForProviderPayDriverClientReq.mjs} +0 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -56,8 +56,8 @@ class ChrtClient {
|
|
|
56
56
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
57
57
|
"X-Fern-Language": "JavaScript",
|
|
58
58
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
59
|
-
"X-Fern-SDK-Version": "1.
|
|
60
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
59
|
+
"X-Fern-SDK-Version": "1.794.0",
|
|
60
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.794.0",
|
|
61
61
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
62
62
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
63
63
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -269,9 +269,9 @@ export declare class LineItemGroups {
|
|
|
269
269
|
fromRateSheetCreateForProviderPayDriverV1(request: Chrt.CreateLigFromRateSheetForVectorClientReq, requestOptions?: LineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.LineItemGroup1>;
|
|
270
270
|
private __fromRateSheetCreateForProviderPayDriverV1;
|
|
271
271
|
/**
|
|
272
|
-
* Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (
|
|
272
|
+
* Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (SharedTaskGroupMileageCreateForProviderPayDriverClientReq) -> (LineItemGroup1)
|
|
273
273
|
*
|
|
274
|
-
* @param {Chrt.billing.
|
|
274
|
+
* @param {Chrt.billing.SharedTaskGroupMileageCreateForProviderPayDriverClientReq} request
|
|
275
275
|
* @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
276
276
|
*
|
|
277
277
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
@@ -284,7 +284,24 @@ export declare class LineItemGroups {
|
|
|
284
284
|
* task_ids: ["task_ids"]
|
|
285
285
|
* })
|
|
286
286
|
*/
|
|
287
|
-
sharedTaskGroupMileageCreateV1(request: Chrt.billing.
|
|
287
|
+
sharedTaskGroupMileageCreateV1(request: Chrt.billing.SharedTaskGroupMileageCreateForProviderPayDriverClientReq, requestOptions?: LineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.LineItemGroup1>;
|
|
288
288
|
private __sharedTaskGroupMileageCreateV1;
|
|
289
|
+
/**
|
|
290
|
+
* Prices a single agent's combined trip across several task groups once, on the provider_pay_provider vector — a coordinator paying the executor (commonly an off-chrt agent) that ran the route. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (SharedTaskGroupMileageCreateForProviderPayProviderClientReq) -> (LineItemGroup1)
|
|
291
|
+
*
|
|
292
|
+
* @param {Chrt.billing.SharedTaskGroupMileageCreateForProviderPayProviderClientReq} request
|
|
293
|
+
* @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
294
|
+
*
|
|
295
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* await client.billing.lineItemGroups.sharedTaskGroupMileageCreateForProviderPayProviderV1({
|
|
299
|
+
* order_group_id: "order_group_id",
|
|
300
|
+
* rate_sheet_id: "rate_sheet_id",
|
|
301
|
+
* task_ids: ["task_ids"]
|
|
302
|
+
* })
|
|
303
|
+
*/
|
|
304
|
+
sharedTaskGroupMileageCreateForProviderPayProviderV1(request: Chrt.billing.SharedTaskGroupMileageCreateForProviderPayProviderClientReq, requestOptions?: LineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.LineItemGroup1>;
|
|
305
|
+
private __sharedTaskGroupMileageCreateForProviderPayProviderV1;
|
|
289
306
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
290
307
|
}
|
|
@@ -1058,9 +1058,9 @@ class LineItemGroups {
|
|
|
1058
1058
|
});
|
|
1059
1059
|
}
|
|
1060
1060
|
/**
|
|
1061
|
-
* Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (
|
|
1061
|
+
* Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (SharedTaskGroupMileageCreateForProviderPayDriverClientReq) -> (LineItemGroup1)
|
|
1062
1062
|
*
|
|
1063
|
-
* @param {Chrt.billing.
|
|
1063
|
+
* @param {Chrt.billing.SharedTaskGroupMileageCreateForProviderPayDriverClientReq} request
|
|
1064
1064
|
* @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
1065
1065
|
*
|
|
1066
1066
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
@@ -1124,6 +1124,72 @@ class LineItemGroups {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
});
|
|
1126
1126
|
}
|
|
1127
|
+
/**
|
|
1128
|
+
* Prices a single agent's combined trip across several task groups once, on the provider_pay_provider vector — a coordinator paying the executor (commonly an off-chrt agent) that ran the route. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (SharedTaskGroupMileageCreateForProviderPayProviderClientReq) -> (LineItemGroup1)
|
|
1129
|
+
*
|
|
1130
|
+
* @param {Chrt.billing.SharedTaskGroupMileageCreateForProviderPayProviderClientReq} request
|
|
1131
|
+
* @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
1132
|
+
*
|
|
1133
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
1134
|
+
*
|
|
1135
|
+
* @example
|
|
1136
|
+
* await client.billing.lineItemGroups.sharedTaskGroupMileageCreateForProviderPayProviderV1({
|
|
1137
|
+
* order_group_id: "order_group_id",
|
|
1138
|
+
* rate_sheet_id: "rate_sheet_id",
|
|
1139
|
+
* task_ids: ["task_ids"]
|
|
1140
|
+
* })
|
|
1141
|
+
*/
|
|
1142
|
+
sharedTaskGroupMileageCreateForProviderPayProviderV1(request, requestOptions) {
|
|
1143
|
+
return core.HttpResponsePromise.fromPromise(this.__sharedTaskGroupMileageCreateForProviderPayProviderV1(request, requestOptions));
|
|
1144
|
+
}
|
|
1145
|
+
__sharedTaskGroupMileageCreateForProviderPayProviderV1(request, requestOptions) {
|
|
1146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1147
|
+
var _a, _b, _c, _d;
|
|
1148
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1149
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
1150
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "billing/line_item_groups/shared_task_group_mileage/create_for_provider_pay_provider/v1"),
|
|
1151
|
+
method: "POST",
|
|
1152
|
+
headers: _headers,
|
|
1153
|
+
contentType: "application/json",
|
|
1154
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1155
|
+
requestType: "json",
|
|
1156
|
+
body: request,
|
|
1157
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1158
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1159
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1160
|
+
});
|
|
1161
|
+
if (_response.ok) {
|
|
1162
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1163
|
+
}
|
|
1164
|
+
if (_response.error.reason === "status-code") {
|
|
1165
|
+
switch (_response.error.statusCode) {
|
|
1166
|
+
case 422:
|
|
1167
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1168
|
+
default:
|
|
1169
|
+
throw new errors.ChrtError({
|
|
1170
|
+
statusCode: _response.error.statusCode,
|
|
1171
|
+
body: _response.error.body,
|
|
1172
|
+
rawResponse: _response.rawResponse,
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
switch (_response.error.reason) {
|
|
1177
|
+
case "non-json":
|
|
1178
|
+
throw new errors.ChrtError({
|
|
1179
|
+
statusCode: _response.error.statusCode,
|
|
1180
|
+
body: _response.error.rawBody,
|
|
1181
|
+
rawResponse: _response.rawResponse,
|
|
1182
|
+
});
|
|
1183
|
+
case "timeout":
|
|
1184
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing/line_item_groups/shared_task_group_mileage/create_for_provider_pay_provider/v1.");
|
|
1185
|
+
case "unknown":
|
|
1186
|
+
throw new errors.ChrtError({
|
|
1187
|
+
message: _response.error.errorMessage,
|
|
1188
|
+
rawResponse: _response.rawResponse,
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1127
1193
|
_getAuthorizationHeader() {
|
|
1128
1194
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1129
1195
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -11,7 +11,7 @@ import * as Chrt from "../../../../../../index.js";
|
|
|
11
11
|
* task_ids: ["task_ids"]
|
|
12
12
|
* }
|
|
13
13
|
*/
|
|
14
|
-
export interface
|
|
14
|
+
export interface SharedTaskGroupMileageCreateForProviderPayDriverClientReq {
|
|
15
15
|
order_group_id: string;
|
|
16
16
|
rate_sheet_id: string;
|
|
17
17
|
payment_destination_driver_id: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../../../../../../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* order_group_id: "order_group_id",
|
|
9
|
+
* rate_sheet_id: "rate_sheet_id",
|
|
10
|
+
* task_ids: ["task_ids"]
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export interface SharedTaskGroupMileageCreateForProviderPayProviderClientReq {
|
|
14
|
+
order_group_id: string;
|
|
15
|
+
rate_sheet_id: string;
|
|
16
|
+
/** Must be a string starting with `org_` */
|
|
17
|
+
executor_org_id?: string | null;
|
|
18
|
+
off_chrt_executor_org_id?: string | null;
|
|
19
|
+
task_ids: string[];
|
|
20
|
+
start_location?: Chrt.LocationFeature | null;
|
|
21
|
+
start_location_label?: string | null;
|
|
22
|
+
end_location?: Chrt.LocationFeature | null;
|
|
23
|
+
end_location_label?: string | null;
|
|
24
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type LineItemGroupsListV1Request } from "./LineItemGroupsListV1Request.js";
|
|
2
2
|
export { type LineItemGroupAdHocCreateClientReq } from "./LineItemGroupAdHocCreateClientReq.js";
|
|
3
|
-
export { type
|
|
3
|
+
export { type SharedTaskGroupMileageCreateForProviderPayDriverClientReq } from "./SharedTaskGroupMileageCreateForProviderPayDriverClientReq.js";
|
|
4
|
+
export { type SharedTaskGroupMileageCreateForProviderPayProviderClientReq } from "./SharedTaskGroupMileageCreateForProviderPayProviderClientReq.js";
|
|
@@ -152,17 +152,17 @@ export declare class Drivers {
|
|
|
152
152
|
deleteSelfReportedHoursAndMileageV1(driverId: string, reportDate: string, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
153
153
|
private __deleteSelfReportedHoursAndMileageV1;
|
|
154
154
|
/**
|
|
155
|
-
* Retrieves driver information for the caller within their organization. | () -> (
|
|
155
|
+
* Retrieves driver information for the caller within their organization. | () -> (DriverWithActiveTaskGroupIds1)
|
|
156
156
|
*
|
|
157
157
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
158
158
|
*
|
|
159
159
|
* @example
|
|
160
160
|
* await client.shipping.drivers.getForCallerV1()
|
|
161
161
|
*/
|
|
162
|
-
getForCallerV1(requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.
|
|
162
|
+
getForCallerV1(requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.DriverWithActiveTaskGroupIds1>;
|
|
163
163
|
private __getForCallerV1;
|
|
164
164
|
/**
|
|
165
|
-
* Retrieves detailed driver information by driver ID within the organization. | () -> (
|
|
165
|
+
* Retrieves detailed driver information by driver ID within the organization. | () -> (DriverWithActiveTaskGroupIds1)
|
|
166
166
|
*
|
|
167
167
|
* @param {string} driverId
|
|
168
168
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -172,7 +172,7 @@ export declare class Drivers {
|
|
|
172
172
|
* @example
|
|
173
173
|
* await client.shipping.drivers.getByDriverIdV1("driver_id")
|
|
174
174
|
*/
|
|
175
|
-
getByDriverIdV1(driverId: string, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.
|
|
175
|
+
getByDriverIdV1(driverId: string, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.DriverWithActiveTaskGroupIds1>;
|
|
176
176
|
private __getByDriverIdV1;
|
|
177
177
|
/**
|
|
178
178
|
* Lists all organization members paired with their driver information if they are drivers. Supports search by name, filtering, sorting, and pagination. | () -> (OrgMembersAndDriversListRes)
|
|
@@ -576,7 +576,7 @@ class Drivers {
|
|
|
576
576
|
});
|
|
577
577
|
}
|
|
578
578
|
/**
|
|
579
|
-
* Retrieves driver information for the caller within their organization. | () -> (
|
|
579
|
+
* Retrieves driver information for the caller within their organization. | () -> (DriverWithActiveTaskGroupIds1)
|
|
580
580
|
*
|
|
581
581
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
582
582
|
*
|
|
@@ -627,7 +627,7 @@ class Drivers {
|
|
|
627
627
|
});
|
|
628
628
|
}
|
|
629
629
|
/**
|
|
630
|
-
* Retrieves detailed driver information by driver ID within the organization. | () -> (
|
|
630
|
+
* Retrieves detailed driver information by driver ID within the organization. | () -> (DriverWithActiveTaskGroupIds1)
|
|
631
631
|
*
|
|
632
632
|
* @param {string} driverId
|
|
633
633
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -808,7 +808,7 @@ class Drivers {
|
|
|
808
808
|
__listV1() {
|
|
809
809
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
810
810
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
811
|
-
const { sort_order: sortOrder, page, page_size: pageSize, search, filter_available_according_to_driver: filterAvailableAccordingToDriver, filter_available_according_to_operators: filterAvailableAccordingToOperators, } = request;
|
|
811
|
+
const { sort_order: sortOrder, page, page_size: pageSize, search, filter_available_according_to_driver: filterAvailableAccordingToDriver, filter_available_according_to_operators: filterAvailableAccordingToOperators, filter_status: filterStatus, } = request;
|
|
812
812
|
const _queryParams = {};
|
|
813
813
|
if (sortOrder !== undefined) {
|
|
814
814
|
_queryParams["sort_order"] = sortOrder;
|
|
@@ -829,6 +829,14 @@ class Drivers {
|
|
|
829
829
|
_queryParams["filter_available_according_to_operators"] =
|
|
830
830
|
(_d = filterAvailableAccordingToOperators === null || filterAvailableAccordingToOperators === void 0 ? void 0 : filterAvailableAccordingToOperators.toString()) !== null && _d !== void 0 ? _d : null;
|
|
831
831
|
}
|
|
832
|
+
if (filterStatus !== undefined) {
|
|
833
|
+
if (Array.isArray(filterStatus)) {
|
|
834
|
+
_queryParams["filter_status"] = filterStatus.map((item) => item);
|
|
835
|
+
}
|
|
836
|
+
else {
|
|
837
|
+
_queryParams["filter_status"] = filterStatus;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
832
840
|
let _headers = (0, headers_js_1.mergeHeaders)((_e = this._options) === null || _e === void 0 ? void 0 : _e.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
833
841
|
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
834
842
|
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.ChrtEnvironment.Local, "shipping/drivers/list/v1"),
|
package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/DriversListV1Request.d.ts
CHANGED
|
@@ -24,4 +24,6 @@ export interface DriversListV1Request {
|
|
|
24
24
|
filter_available_according_to_driver?: boolean | null;
|
|
25
25
|
/** Filter by operator-set availability */
|
|
26
26
|
filter_available_according_to_operators?: boolean | null;
|
|
27
|
+
/** Filter by driver state (UNASSIGNED / ASSIGNED / IN_PROGRESS) */
|
|
28
|
+
filter_status?: (Chrt.DriverStatusEnum | null) | (Chrt.DriverStatusEnum | null)[];
|
|
27
29
|
}
|
|
@@ -21,7 +21,6 @@ export interface Driver1 {
|
|
|
21
21
|
available_according_to_operators?: boolean;
|
|
22
22
|
waiting?: boolean;
|
|
23
23
|
auto_assign_enabled?: boolean;
|
|
24
|
-
active_task_group_ids?: string[];
|
|
25
24
|
last_seen_at_location?: Chrt.LocationFeature | null;
|
|
26
25
|
last_seen_at_timestamp?: string | null;
|
|
27
26
|
last_seen_at_location_city?: string | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Driver read DTO: persisted Driver1 plus the derived active task group IDs.
|
|
7
|
+
*
|
|
8
|
+
* The field is computed per request from shipping.task_groups so the JSON shape
|
|
9
|
+
* stays identical to when active_task_group_ids was persisted on the driver.
|
|
10
|
+
*/
|
|
11
|
+
export interface DriverWithActiveTaskGroupIds1 {
|
|
12
|
+
schema_version: number;
|
|
13
|
+
email_address_primary?: string | null;
|
|
14
|
+
email_address_secondary?: string | null;
|
|
15
|
+
phone_number_primary?: string | null;
|
|
16
|
+
phone_number_secondary?: string | null;
|
|
17
|
+
first_name?: string | null;
|
|
18
|
+
last_name?: string | null;
|
|
19
|
+
vehicle_types?: Chrt.VehicleTypeEnum[];
|
|
20
|
+
_id: string;
|
|
21
|
+
/** Must be a string starting with `org_` */
|
|
22
|
+
org_id: string;
|
|
23
|
+
/** Must be a string starting with `user_` */
|
|
24
|
+
user_id: string;
|
|
25
|
+
status?: Chrt.DriverStatusEnum;
|
|
26
|
+
available_according_to_driver?: boolean;
|
|
27
|
+
available_according_to_operators?: boolean;
|
|
28
|
+
waiting?: boolean;
|
|
29
|
+
auto_assign_enabled?: boolean;
|
|
30
|
+
last_seen_at_location?: Chrt.LocationFeature | null;
|
|
31
|
+
last_seen_at_timestamp?: string | null;
|
|
32
|
+
last_seen_at_location_city?: string | null;
|
|
33
|
+
last_seen_at_location_large_city?: string | null;
|
|
34
|
+
active_task_group_ids?: string[];
|
|
35
|
+
}
|
|
@@ -9,6 +9,7 @@ export interface OrderDraftValidationRequirements {
|
|
|
9
9
|
task_groups_have_valid_task_sequence?: boolean | null;
|
|
10
10
|
tasks_have_valid_cargo?: boolean | null;
|
|
11
11
|
cargos_have_valid_lifecycle?: boolean | null;
|
|
12
|
+
at_least_one_task_has_time_window?: boolean | null;
|
|
12
13
|
order_has_shipper?: boolean | null;
|
|
13
14
|
order_has_coordinator?: boolean | null;
|
|
14
15
|
}
|
|
@@ -8,6 +8,7 @@ export interface OrderManifestValidationRequirements {
|
|
|
8
8
|
task_groups_have_valid_task_sequence?: boolean | null;
|
|
9
9
|
tasks_have_valid_cargo?: boolean | null;
|
|
10
10
|
cargos_have_valid_lifecycle?: boolean | null;
|
|
11
|
+
at_least_one_task_has_time_window?: boolean | null;
|
|
11
12
|
order_has_shipper?: boolean | null;
|
|
12
13
|
order_has_coordinator?: boolean | null;
|
|
13
14
|
}
|
|
@@ -146,6 +146,7 @@ export * from "./DriverStatsRes.js";
|
|
|
146
146
|
export * from "./DriverStatusEnum.js";
|
|
147
147
|
export * from "./DriverUpdateAvailabilityReq.js";
|
|
148
148
|
export * from "./DriverUpdateRes.js";
|
|
149
|
+
export * from "./DriverWithActiveTaskGroupIds1.js";
|
|
149
150
|
export * from "./FirebaseCloudMessagingTokenData1.js";
|
|
150
151
|
export * from "./FlightAwareAlertFlight.js";
|
|
151
152
|
export * from "./FlightAwareAlertPayload.js";
|
|
@@ -162,6 +162,7 @@ __exportStar(require("./DriverStatsRes.js"), exports);
|
|
|
162
162
|
__exportStar(require("./DriverStatusEnum.js"), exports);
|
|
163
163
|
__exportStar(require("./DriverUpdateAvailabilityReq.js"), exports);
|
|
164
164
|
__exportStar(require("./DriverUpdateRes.js"), exports);
|
|
165
|
+
__exportStar(require("./DriverWithActiveTaskGroupIds1.js"), exports);
|
|
165
166
|
__exportStar(require("./FirebaseCloudMessagingTokenData1.js"), exports);
|
|
166
167
|
__exportStar(require("./FlightAwareAlertFlight.js"), exports);
|
|
167
168
|
__exportStar(require("./FlightAwareAlertPayload.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.794.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -20,8 +20,8 @@ export class ChrtClient {
|
|
|
20
20
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
21
21
|
"X-Fern-Language": "JavaScript",
|
|
22
22
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
23
|
-
"X-Fern-SDK-Version": "1.
|
|
24
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
23
|
+
"X-Fern-SDK-Version": "1.794.0",
|
|
24
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.794.0",
|
|
25
25
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
26
26
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
27
27
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -269,9 +269,9 @@ export declare class LineItemGroups {
|
|
|
269
269
|
fromRateSheetCreateForProviderPayDriverV1(request: Chrt.CreateLigFromRateSheetForVectorClientReq, requestOptions?: LineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.LineItemGroup1>;
|
|
270
270
|
private __fromRateSheetCreateForProviderPayDriverV1;
|
|
271
271
|
/**
|
|
272
|
-
* Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (
|
|
272
|
+
* Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (SharedTaskGroupMileageCreateForProviderPayDriverClientReq) -> (LineItemGroup1)
|
|
273
273
|
*
|
|
274
|
-
* @param {Chrt.billing.
|
|
274
|
+
* @param {Chrt.billing.SharedTaskGroupMileageCreateForProviderPayDriverClientReq} request
|
|
275
275
|
* @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
276
276
|
*
|
|
277
277
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
@@ -284,7 +284,24 @@ export declare class LineItemGroups {
|
|
|
284
284
|
* task_ids: ["task_ids"]
|
|
285
285
|
* })
|
|
286
286
|
*/
|
|
287
|
-
sharedTaskGroupMileageCreateV1(request: Chrt.billing.
|
|
287
|
+
sharedTaskGroupMileageCreateV1(request: Chrt.billing.SharedTaskGroupMileageCreateForProviderPayDriverClientReq, requestOptions?: LineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.LineItemGroup1>;
|
|
288
288
|
private __sharedTaskGroupMileageCreateV1;
|
|
289
|
+
/**
|
|
290
|
+
* Prices a single agent's combined trip across several task groups once, on the provider_pay_provider vector — a coordinator paying the executor (commonly an off-chrt agent) that ran the route. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (SharedTaskGroupMileageCreateForProviderPayProviderClientReq) -> (LineItemGroup1)
|
|
291
|
+
*
|
|
292
|
+
* @param {Chrt.billing.SharedTaskGroupMileageCreateForProviderPayProviderClientReq} request
|
|
293
|
+
* @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
294
|
+
*
|
|
295
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* await client.billing.lineItemGroups.sharedTaskGroupMileageCreateForProviderPayProviderV1({
|
|
299
|
+
* order_group_id: "order_group_id",
|
|
300
|
+
* rate_sheet_id: "rate_sheet_id",
|
|
301
|
+
* task_ids: ["task_ids"]
|
|
302
|
+
* })
|
|
303
|
+
*/
|
|
304
|
+
sharedTaskGroupMileageCreateForProviderPayProviderV1(request: Chrt.billing.SharedTaskGroupMileageCreateForProviderPayProviderClientReq, requestOptions?: LineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.LineItemGroup1>;
|
|
305
|
+
private __sharedTaskGroupMileageCreateForProviderPayProviderV1;
|
|
289
306
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
290
307
|
}
|
|
@@ -1022,9 +1022,9 @@ export class LineItemGroups {
|
|
|
1022
1022
|
});
|
|
1023
1023
|
}
|
|
1024
1024
|
/**
|
|
1025
|
-
* Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (
|
|
1025
|
+
* Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (SharedTaskGroupMileageCreateForProviderPayDriverClientReq) -> (LineItemGroup1)
|
|
1026
1026
|
*
|
|
1027
|
-
* @param {Chrt.billing.
|
|
1027
|
+
* @param {Chrt.billing.SharedTaskGroupMileageCreateForProviderPayDriverClientReq} request
|
|
1028
1028
|
* @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
1029
1029
|
*
|
|
1030
1030
|
* @throws {@link Chrt.UnprocessableEntityError}
|
|
@@ -1088,6 +1088,72 @@ export class LineItemGroups {
|
|
|
1088
1088
|
}
|
|
1089
1089
|
});
|
|
1090
1090
|
}
|
|
1091
|
+
/**
|
|
1092
|
+
* Prices a single agent's combined trip across several task groups once, on the provider_pay_provider vector — a coordinator paying the executor (commonly an off-chrt agent) that ran the route. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (SharedTaskGroupMileageCreateForProviderPayProviderClientReq) -> (LineItemGroup1)
|
|
1093
|
+
*
|
|
1094
|
+
* @param {Chrt.billing.SharedTaskGroupMileageCreateForProviderPayProviderClientReq} request
|
|
1095
|
+
* @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
1096
|
+
*
|
|
1097
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
1098
|
+
*
|
|
1099
|
+
* @example
|
|
1100
|
+
* await client.billing.lineItemGroups.sharedTaskGroupMileageCreateForProviderPayProviderV1({
|
|
1101
|
+
* order_group_id: "order_group_id",
|
|
1102
|
+
* rate_sheet_id: "rate_sheet_id",
|
|
1103
|
+
* task_ids: ["task_ids"]
|
|
1104
|
+
* })
|
|
1105
|
+
*/
|
|
1106
|
+
sharedTaskGroupMileageCreateForProviderPayProviderV1(request, requestOptions) {
|
|
1107
|
+
return core.HttpResponsePromise.fromPromise(this.__sharedTaskGroupMileageCreateForProviderPayProviderV1(request, requestOptions));
|
|
1108
|
+
}
|
|
1109
|
+
__sharedTaskGroupMileageCreateForProviderPayProviderV1(request, requestOptions) {
|
|
1110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1111
|
+
var _a, _b, _c, _d;
|
|
1112
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1113
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
1114
|
+
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "billing/line_item_groups/shared_task_group_mileage/create_for_provider_pay_provider/v1"),
|
|
1115
|
+
method: "POST",
|
|
1116
|
+
headers: _headers,
|
|
1117
|
+
contentType: "application/json",
|
|
1118
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1119
|
+
requestType: "json",
|
|
1120
|
+
body: request,
|
|
1121
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1122
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1123
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1124
|
+
});
|
|
1125
|
+
if (_response.ok) {
|
|
1126
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1127
|
+
}
|
|
1128
|
+
if (_response.error.reason === "status-code") {
|
|
1129
|
+
switch (_response.error.statusCode) {
|
|
1130
|
+
case 422:
|
|
1131
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1132
|
+
default:
|
|
1133
|
+
throw new errors.ChrtError({
|
|
1134
|
+
statusCode: _response.error.statusCode,
|
|
1135
|
+
body: _response.error.body,
|
|
1136
|
+
rawResponse: _response.rawResponse,
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
switch (_response.error.reason) {
|
|
1141
|
+
case "non-json":
|
|
1142
|
+
throw new errors.ChrtError({
|
|
1143
|
+
statusCode: _response.error.statusCode,
|
|
1144
|
+
body: _response.error.rawBody,
|
|
1145
|
+
rawResponse: _response.rawResponse,
|
|
1146
|
+
});
|
|
1147
|
+
case "timeout":
|
|
1148
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing/line_item_groups/shared_task_group_mileage/create_for_provider_pay_provider/v1.");
|
|
1149
|
+
case "unknown":
|
|
1150
|
+
throw new errors.ChrtError({
|
|
1151
|
+
message: _response.error.errorMessage,
|
|
1152
|
+
rawResponse: _response.rawResponse,
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
});
|
|
1156
|
+
}
|
|
1091
1157
|
_getAuthorizationHeader() {
|
|
1092
1158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1093
1159
|
const bearer = yield core.Supplier.get(this._options.token);
|
|
@@ -11,7 +11,7 @@ import * as Chrt from "../../../../../../index.mjs";
|
|
|
11
11
|
* task_ids: ["task_ids"]
|
|
12
12
|
* }
|
|
13
13
|
*/
|
|
14
|
-
export interface
|
|
14
|
+
export interface SharedTaskGroupMileageCreateForProviderPayDriverClientReq {
|
|
15
15
|
order_group_id: string;
|
|
16
16
|
rate_sheet_id: string;
|
|
17
17
|
payment_destination_driver_id: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../../../../../../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* order_group_id: "order_group_id",
|
|
9
|
+
* rate_sheet_id: "rate_sheet_id",
|
|
10
|
+
* task_ids: ["task_ids"]
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
13
|
+
export interface SharedTaskGroupMileageCreateForProviderPayProviderClientReq {
|
|
14
|
+
order_group_id: string;
|
|
15
|
+
rate_sheet_id: string;
|
|
16
|
+
/** Must be a string starting with `org_` */
|
|
17
|
+
executor_org_id?: string | null;
|
|
18
|
+
off_chrt_executor_org_id?: string | null;
|
|
19
|
+
task_ids: string[];
|
|
20
|
+
start_location?: Chrt.LocationFeature | null;
|
|
21
|
+
start_location_label?: string | null;
|
|
22
|
+
end_location?: Chrt.LocationFeature | null;
|
|
23
|
+
end_location_label?: string | null;
|
|
24
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type LineItemGroupsListV1Request } from "./LineItemGroupsListV1Request.mjs";
|
|
2
2
|
export { type LineItemGroupAdHocCreateClientReq } from "./LineItemGroupAdHocCreateClientReq.mjs";
|
|
3
|
-
export { type
|
|
3
|
+
export { type SharedTaskGroupMileageCreateForProviderPayDriverClientReq } from "./SharedTaskGroupMileageCreateForProviderPayDriverClientReq.mjs";
|
|
4
|
+
export { type SharedTaskGroupMileageCreateForProviderPayProviderClientReq } from "./SharedTaskGroupMileageCreateForProviderPayProviderClientReq.mjs";
|
|
@@ -152,17 +152,17 @@ export declare class Drivers {
|
|
|
152
152
|
deleteSelfReportedHoursAndMileageV1(driverId: string, reportDate: string, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
153
153
|
private __deleteSelfReportedHoursAndMileageV1;
|
|
154
154
|
/**
|
|
155
|
-
* Retrieves driver information for the caller within their organization. | () -> (
|
|
155
|
+
* Retrieves driver information for the caller within their organization. | () -> (DriverWithActiveTaskGroupIds1)
|
|
156
156
|
*
|
|
157
157
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
158
158
|
*
|
|
159
159
|
* @example
|
|
160
160
|
* await client.shipping.drivers.getForCallerV1()
|
|
161
161
|
*/
|
|
162
|
-
getForCallerV1(requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.
|
|
162
|
+
getForCallerV1(requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.DriverWithActiveTaskGroupIds1>;
|
|
163
163
|
private __getForCallerV1;
|
|
164
164
|
/**
|
|
165
|
-
* Retrieves detailed driver information by driver ID within the organization. | () -> (
|
|
165
|
+
* Retrieves detailed driver information by driver ID within the organization. | () -> (DriverWithActiveTaskGroupIds1)
|
|
166
166
|
*
|
|
167
167
|
* @param {string} driverId
|
|
168
168
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -172,7 +172,7 @@ export declare class Drivers {
|
|
|
172
172
|
* @example
|
|
173
173
|
* await client.shipping.drivers.getByDriverIdV1("driver_id")
|
|
174
174
|
*/
|
|
175
|
-
getByDriverIdV1(driverId: string, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.
|
|
175
|
+
getByDriverIdV1(driverId: string, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.DriverWithActiveTaskGroupIds1>;
|
|
176
176
|
private __getByDriverIdV1;
|
|
177
177
|
/**
|
|
178
178
|
* Lists all organization members paired with their driver information if they are drivers. Supports search by name, filtering, sorting, and pagination. | () -> (OrgMembersAndDriversListRes)
|
|
@@ -540,7 +540,7 @@ export class Drivers {
|
|
|
540
540
|
});
|
|
541
541
|
}
|
|
542
542
|
/**
|
|
543
|
-
* Retrieves driver information for the caller within their organization. | () -> (
|
|
543
|
+
* Retrieves driver information for the caller within their organization. | () -> (DriverWithActiveTaskGroupIds1)
|
|
544
544
|
*
|
|
545
545
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
546
546
|
*
|
|
@@ -591,7 +591,7 @@ export class Drivers {
|
|
|
591
591
|
});
|
|
592
592
|
}
|
|
593
593
|
/**
|
|
594
|
-
* Retrieves detailed driver information by driver ID within the organization. | () -> (
|
|
594
|
+
* Retrieves detailed driver information by driver ID within the organization. | () -> (DriverWithActiveTaskGroupIds1)
|
|
595
595
|
*
|
|
596
596
|
* @param {string} driverId
|
|
597
597
|
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -772,7 +772,7 @@ export class Drivers {
|
|
|
772
772
|
__listV1() {
|
|
773
773
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
774
774
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
775
|
-
const { sort_order: sortOrder, page, page_size: pageSize, search, filter_available_according_to_driver: filterAvailableAccordingToDriver, filter_available_according_to_operators: filterAvailableAccordingToOperators, } = request;
|
|
775
|
+
const { sort_order: sortOrder, page, page_size: pageSize, search, filter_available_according_to_driver: filterAvailableAccordingToDriver, filter_available_according_to_operators: filterAvailableAccordingToOperators, filter_status: filterStatus, } = request;
|
|
776
776
|
const _queryParams = {};
|
|
777
777
|
if (sortOrder !== undefined) {
|
|
778
778
|
_queryParams["sort_order"] = sortOrder;
|
|
@@ -793,6 +793,14 @@ export class Drivers {
|
|
|
793
793
|
_queryParams["filter_available_according_to_operators"] =
|
|
794
794
|
(_d = filterAvailableAccordingToOperators === null || filterAvailableAccordingToOperators === void 0 ? void 0 : filterAvailableAccordingToOperators.toString()) !== null && _d !== void 0 ? _d : null;
|
|
795
795
|
}
|
|
796
|
+
if (filterStatus !== undefined) {
|
|
797
|
+
if (Array.isArray(filterStatus)) {
|
|
798
|
+
_queryParams["filter_status"] = filterStatus.map((item) => item);
|
|
799
|
+
}
|
|
800
|
+
else {
|
|
801
|
+
_queryParams["filter_status"] = filterStatus;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
796
804
|
let _headers = mergeHeaders((_e = this._options) === null || _e === void 0 ? void 0 : _e.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
797
805
|
const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
|
|
798
806
|
url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.ChrtEnvironment.Local, "shipping/drivers/list/v1"),
|
package/dist/esm/api/resources/shipping/resources/drivers/client/requests/DriversListV1Request.d.mts
CHANGED
|
@@ -24,4 +24,6 @@ export interface DriversListV1Request {
|
|
|
24
24
|
filter_available_according_to_driver?: boolean | null;
|
|
25
25
|
/** Filter by operator-set availability */
|
|
26
26
|
filter_available_according_to_operators?: boolean | null;
|
|
27
|
+
/** Filter by driver state (UNASSIGNED / ASSIGNED / IN_PROGRESS) */
|
|
28
|
+
filter_status?: (Chrt.DriverStatusEnum | null) | (Chrt.DriverStatusEnum | null)[];
|
|
27
29
|
}
|
|
@@ -21,7 +21,6 @@ export interface Driver1 {
|
|
|
21
21
|
available_according_to_operators?: boolean;
|
|
22
22
|
waiting?: boolean;
|
|
23
23
|
auto_assign_enabled?: boolean;
|
|
24
|
-
active_task_group_ids?: string[];
|
|
25
24
|
last_seen_at_location?: Chrt.LocationFeature | null;
|
|
26
25
|
last_seen_at_timestamp?: string | null;
|
|
27
26
|
last_seen_at_location_city?: string | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Driver read DTO: persisted Driver1 plus the derived active task group IDs.
|
|
7
|
+
*
|
|
8
|
+
* The field is computed per request from shipping.task_groups so the JSON shape
|
|
9
|
+
* stays identical to when active_task_group_ids was persisted on the driver.
|
|
10
|
+
*/
|
|
11
|
+
export interface DriverWithActiveTaskGroupIds1 {
|
|
12
|
+
schema_version: number;
|
|
13
|
+
email_address_primary?: string | null;
|
|
14
|
+
email_address_secondary?: string | null;
|
|
15
|
+
phone_number_primary?: string | null;
|
|
16
|
+
phone_number_secondary?: string | null;
|
|
17
|
+
first_name?: string | null;
|
|
18
|
+
last_name?: string | null;
|
|
19
|
+
vehicle_types?: Chrt.VehicleTypeEnum[];
|
|
20
|
+
_id: string;
|
|
21
|
+
/** Must be a string starting with `org_` */
|
|
22
|
+
org_id: string;
|
|
23
|
+
/** Must be a string starting with `user_` */
|
|
24
|
+
user_id: string;
|
|
25
|
+
status?: Chrt.DriverStatusEnum;
|
|
26
|
+
available_according_to_driver?: boolean;
|
|
27
|
+
available_according_to_operators?: boolean;
|
|
28
|
+
waiting?: boolean;
|
|
29
|
+
auto_assign_enabled?: boolean;
|
|
30
|
+
last_seen_at_location?: Chrt.LocationFeature | null;
|
|
31
|
+
last_seen_at_timestamp?: string | null;
|
|
32
|
+
last_seen_at_location_city?: string | null;
|
|
33
|
+
last_seen_at_location_large_city?: string | null;
|
|
34
|
+
active_task_group_ids?: string[];
|
|
35
|
+
}
|
|
@@ -9,6 +9,7 @@ export interface OrderDraftValidationRequirements {
|
|
|
9
9
|
task_groups_have_valid_task_sequence?: boolean | null;
|
|
10
10
|
tasks_have_valid_cargo?: boolean | null;
|
|
11
11
|
cargos_have_valid_lifecycle?: boolean | null;
|
|
12
|
+
at_least_one_task_has_time_window?: boolean | null;
|
|
12
13
|
order_has_shipper?: boolean | null;
|
|
13
14
|
order_has_coordinator?: boolean | null;
|
|
14
15
|
}
|
|
@@ -8,6 +8,7 @@ export interface OrderManifestValidationRequirements {
|
|
|
8
8
|
task_groups_have_valid_task_sequence?: boolean | null;
|
|
9
9
|
tasks_have_valid_cargo?: boolean | null;
|
|
10
10
|
cargos_have_valid_lifecycle?: boolean | null;
|
|
11
|
+
at_least_one_task_has_time_window?: boolean | null;
|
|
11
12
|
order_has_shipper?: boolean | null;
|
|
12
13
|
order_has_coordinator?: boolean | null;
|
|
13
14
|
}
|
|
@@ -146,6 +146,7 @@ export * from "./DriverStatsRes.mjs";
|
|
|
146
146
|
export * from "./DriverStatusEnum.mjs";
|
|
147
147
|
export * from "./DriverUpdateAvailabilityReq.mjs";
|
|
148
148
|
export * from "./DriverUpdateRes.mjs";
|
|
149
|
+
export * from "./DriverWithActiveTaskGroupIds1.mjs";
|
|
149
150
|
export * from "./FirebaseCloudMessagingTokenData1.mjs";
|
|
150
151
|
export * from "./FlightAwareAlertFlight.mjs";
|
|
151
152
|
export * from "./FlightAwareAlertPayload.mjs";
|
|
@@ -146,6 +146,7 @@ export * from "./DriverStatsRes.mjs";
|
|
|
146
146
|
export * from "./DriverStatusEnum.mjs";
|
|
147
147
|
export * from "./DriverUpdateAvailabilityReq.mjs";
|
|
148
148
|
export * from "./DriverUpdateRes.mjs";
|
|
149
|
+
export * from "./DriverWithActiveTaskGroupIds1.mjs";
|
|
149
150
|
export * from "./FirebaseCloudMessagingTokenData1.mjs";
|
|
150
151
|
export * from "./FlightAwareAlertFlight.mjs";
|
|
151
152
|
export * from "./FlightAwareAlertPayload.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.794.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.
|
|
1
|
+
export const SDK_VERSION = "1.794.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -2102,7 +2102,7 @@ await client.billing.lineItemGroups.fromRateSheetCreateForProviderPayDriverV1({
|
|
|
2102
2102
|
<dl>
|
|
2103
2103
|
<dd>
|
|
2104
2104
|
|
|
2105
|
-
Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (
|
|
2105
|
+
Prices a single driver's combined trip across several task groups once. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (SharedTaskGroupMileageCreateForProviderPayDriverClientReq) -> (LineItemGroup1)
|
|
2106
2106
|
|
|
2107
2107
|
</dd>
|
|
2108
2108
|
</dl>
|
|
@@ -2139,7 +2139,74 @@ await client.billing.lineItemGroups.sharedTaskGroupMileageCreateV1({
|
|
|
2139
2139
|
<dl>
|
|
2140
2140
|
<dd>
|
|
2141
2141
|
|
|
2142
|
-
**request:** `Chrt.billing.
|
|
2142
|
+
**request:** `Chrt.billing.SharedTaskGroupMileageCreateForProviderPayDriverClientReq`
|
|
2143
|
+
|
|
2144
|
+
</dd>
|
|
2145
|
+
</dl>
|
|
2146
|
+
|
|
2147
|
+
<dl>
|
|
2148
|
+
<dd>
|
|
2149
|
+
|
|
2150
|
+
**requestOptions:** `LineItemGroups.RequestOptions`
|
|
2151
|
+
|
|
2152
|
+
</dd>
|
|
2153
|
+
</dl>
|
|
2154
|
+
</dd>
|
|
2155
|
+
</dl>
|
|
2156
|
+
|
|
2157
|
+
</dd>
|
|
2158
|
+
</dl>
|
|
2159
|
+
</details>
|
|
2160
|
+
|
|
2161
|
+
<details><summary><code>client.billing.lineItemGroups.<a href="/src/api/resources/billing/resources/lineItemGroups/client/Client.ts">sharedTaskGroupMileageCreateForProviderPayProviderV1</a>({ ...params }) -> Chrt.LineItemGroup1</code></summary>
|
|
2162
|
+
<dl>
|
|
2163
|
+
<dd>
|
|
2164
|
+
|
|
2165
|
+
#### 📝 Description
|
|
2166
|
+
|
|
2167
|
+
<dl>
|
|
2168
|
+
<dd>
|
|
2169
|
+
|
|
2170
|
+
<dl>
|
|
2171
|
+
<dd>
|
|
2172
|
+
|
|
2173
|
+
Prices a single agent's combined trip across several task groups once, on the provider_pay_provider vector — a coordinator paying the executor (commonly an off-chrt agent) that ran the route. Recomputes route mileage from the ordered task locations (plus optional start/end legs), applies the CHRT-ground rate sheet, and atomically creates an OrderGroup-anchored LineItemGroup, its mileage LineItems, and the LineItemCalculation that records how the charges were derived. The LIG is detached on create (task_group_id is None) — attach to a Statement afterwards. | authz: allowed_org_types=[provider], min_org_role=operator | (SharedTaskGroupMileageCreateForProviderPayProviderClientReq) -> (LineItemGroup1)
|
|
2174
|
+
|
|
2175
|
+
</dd>
|
|
2176
|
+
</dl>
|
|
2177
|
+
</dd>
|
|
2178
|
+
</dl>
|
|
2179
|
+
|
|
2180
|
+
#### 🔌 Usage
|
|
2181
|
+
|
|
2182
|
+
<dl>
|
|
2183
|
+
<dd>
|
|
2184
|
+
|
|
2185
|
+
<dl>
|
|
2186
|
+
<dd>
|
|
2187
|
+
|
|
2188
|
+
```typescript
|
|
2189
|
+
await client.billing.lineItemGroups.sharedTaskGroupMileageCreateForProviderPayProviderV1({
|
|
2190
|
+
order_group_id: "order_group_id",
|
|
2191
|
+
rate_sheet_id: "rate_sheet_id",
|
|
2192
|
+
task_ids: ["task_ids"],
|
|
2193
|
+
});
|
|
2194
|
+
```
|
|
2195
|
+
|
|
2196
|
+
</dd>
|
|
2197
|
+
</dl>
|
|
2198
|
+
</dd>
|
|
2199
|
+
</dl>
|
|
2200
|
+
|
|
2201
|
+
#### ⚙️ Parameters
|
|
2202
|
+
|
|
2203
|
+
<dl>
|
|
2204
|
+
<dd>
|
|
2205
|
+
|
|
2206
|
+
<dl>
|
|
2207
|
+
<dd>
|
|
2208
|
+
|
|
2209
|
+
**request:** `Chrt.billing.SharedTaskGroupMileageCreateForProviderPayProviderClientReq`
|
|
2143
2210
|
|
|
2144
2211
|
</dd>
|
|
2145
2212
|
</dl>
|
|
@@ -17861,7 +17928,7 @@ await client.shipping.drivers.deleteSelfReportedHoursAndMileageV1("driver_id", "
|
|
|
17861
17928
|
</dl>
|
|
17862
17929
|
</details>
|
|
17863
17930
|
|
|
17864
|
-
<details><summary><code>client.shipping.drivers.<a href="/src/api/resources/shipping/resources/drivers/client/Client.ts">getForCallerV1</a>() -> Chrt.
|
|
17931
|
+
<details><summary><code>client.shipping.drivers.<a href="/src/api/resources/shipping/resources/drivers/client/Client.ts">getForCallerV1</a>() -> Chrt.DriverWithActiveTaskGroupIds1</code></summary>
|
|
17865
17932
|
<dl>
|
|
17866
17933
|
<dd>
|
|
17867
17934
|
|
|
@@ -17873,7 +17940,7 @@ await client.shipping.drivers.deleteSelfReportedHoursAndMileageV1("driver_id", "
|
|
|
17873
17940
|
<dl>
|
|
17874
17941
|
<dd>
|
|
17875
17942
|
|
|
17876
|
-
Retrieves driver information for the caller within their organization. | () -> (
|
|
17943
|
+
Retrieves driver information for the caller within their organization. | () -> (DriverWithActiveTaskGroupIds1)
|
|
17877
17944
|
|
|
17878
17945
|
</dd>
|
|
17879
17946
|
</dl>
|
|
@@ -17916,7 +17983,7 @@ await client.shipping.drivers.getForCallerV1();
|
|
|
17916
17983
|
</dl>
|
|
17917
17984
|
</details>
|
|
17918
17985
|
|
|
17919
|
-
<details><summary><code>client.shipping.drivers.<a href="/src/api/resources/shipping/resources/drivers/client/Client.ts">getByDriverIdV1</a>(driverId) -> Chrt.
|
|
17986
|
+
<details><summary><code>client.shipping.drivers.<a href="/src/api/resources/shipping/resources/drivers/client/Client.ts">getByDriverIdV1</a>(driverId) -> Chrt.DriverWithActiveTaskGroupIds1</code></summary>
|
|
17920
17987
|
<dl>
|
|
17921
17988
|
<dd>
|
|
17922
17989
|
|
|
@@ -17928,7 +17995,7 @@ await client.shipping.drivers.getForCallerV1();
|
|
|
17928
17995
|
<dl>
|
|
17929
17996
|
<dd>
|
|
17930
17997
|
|
|
17931
|
-
Retrieves detailed driver information by driver ID within the organization. | () -> (
|
|
17998
|
+
Retrieves detailed driver information by driver ID within the organization. | () -> (DriverWithActiveTaskGroupIds1)
|
|
17932
17999
|
|
|
17933
18000
|
</dd>
|
|
17934
18001
|
</dl>
|
|
File without changes
|