@chrt-inc/typescript-sdk 1.756.0 → 1.760.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/shipping/resources/drivers/client/Client.d.ts +102 -1
- package/dist/cjs/api/resources/shipping/resources/drivers/client/Client.js +439 -1
- package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/DriverSelfReportedHoursAndMileageClientCreate1.d.ts +18 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/DriverSelfReportedHoursAndMileageClientUpdate1.d.ts +13 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/DriversListSelfReportedHoursAndMileageV1Request.d.ts +21 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/DriversListSelfReportedHoursAndMileageV1Request.js +5 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/DriversOrgListSelfReportedHoursAndMileageV1Request.d.ts +25 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/DriversOrgListSelfReportedHoursAndMileageV1Request.js +5 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/index.js +1 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/types/DriversOrgListSelfReportedHoursAndMileageV1RequestSortBy.d.ts +8 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/types/DriversOrgListSelfReportedHoursAndMileageV1RequestSortBy.js +10 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/shipping/resources/drivers/types/index.js +17 -0
- package/dist/cjs/api/resources/shipping/resources/flights/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/shipping/resources/flights/client/Client.js +1 -1
- package/dist/cjs/api/resources/shipping/resources/index.d.ts +2 -1
- package/dist/cjs/api/resources/shipping/resources/index.js +3 -2
- package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/Client.js +2 -1
- package/dist/cjs/api/resources/shipping/resources/taskGroups/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/shipping/resources/taskGroups/client/Client.js +2 -1
- package/dist/cjs/api/resources/tracking/resources/driver/client/Client.d.ts +26 -0
- package/dist/cjs/api/resources/tracking/resources/driver/client/Client.js +75 -0
- package/dist/cjs/api/resources/tracking/resources/driver/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/tracking/resources/driver/client/index.js +15 -0
- package/dist/cjs/api/resources/tracking/resources/driver/client/requests/DriverByDriverDataPointClientCreate1.d.ts +26 -0
- package/dist/cjs/api/resources/tracking/resources/driver/client/requests/DriverByDriverDataPointClientCreate1.js +5 -0
- package/dist/cjs/api/resources/tracking/resources/driver/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/tracking/resources/driver/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/tracking/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/tracking/resources/index.js +1 -0
- package/dist/cjs/api/types/DriverSelfReportedHoursAndMileage1.d.ts +17 -0
- package/dist/cjs/api/types/DriverSelfReportedHoursAndMileage1.js +5 -0
- package/dist/cjs/api/types/DriverSelfReportedHoursAndMileageListRes.d.ts +8 -0
- package/dist/cjs/api/types/DriverSelfReportedHoursAndMileageListRes.js +5 -0
- package/dist/cjs/api/types/DriverStatsRes.d.ts +8 -3
- package/dist/cjs/api/types/DriverUpdateRes.d.ts +1 -0
- package/dist/cjs/api/types/FlightLeg1.d.ts +1 -1
- package/dist/cjs/api/types/FlightLegClientCreate1.d.ts +1 -1
- package/dist/cjs/api/types/{FlightTrackPosition.d.ts → FlightTrackPosition1.d.ts} +1 -4
- package/dist/cjs/api/types/FlightTrackPosition1.js +5 -0
- package/dist/cjs/api/types/FlightTrackRes.d.ts +2 -2
- package/dist/{esm/api/types/FlightTrackWaypoint.d.mts → cjs/api/types/FlightTrackWaypoint1.d.ts} +1 -4
- package/dist/cjs/api/types/FlightTrackWaypoint1.js +5 -0
- package/dist/cjs/api/types/index.d.ts +4 -2
- package/dist/cjs/api/types/index.js +4 -2
- 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/shipping/resources/drivers/client/Client.d.mts +102 -1
- package/dist/esm/api/resources/shipping/resources/drivers/client/Client.mjs +439 -1
- package/dist/esm/api/resources/shipping/resources/drivers/client/requests/DriverSelfReportedHoursAndMileageClientCreate1.d.mts +18 -0
- package/dist/esm/api/resources/shipping/resources/drivers/client/requests/DriverSelfReportedHoursAndMileageClientUpdate1.d.mts +13 -0
- package/dist/esm/api/resources/shipping/resources/drivers/client/requests/DriversListSelfReportedHoursAndMileageV1Request.d.mts +21 -0
- package/dist/esm/api/resources/shipping/resources/drivers/client/requests/DriversListSelfReportedHoursAndMileageV1Request.mjs +4 -0
- package/dist/esm/api/resources/shipping/resources/drivers/client/requests/DriversOrgListSelfReportedHoursAndMileageV1Request.d.mts +25 -0
- package/dist/esm/api/resources/shipping/resources/drivers/client/requests/DriversOrgListSelfReportedHoursAndMileageV1Request.mjs +4 -0
- package/dist/esm/api/resources/shipping/resources/drivers/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/shipping/resources/drivers/index.d.mts +1 -0
- package/dist/esm/api/resources/shipping/resources/drivers/index.mjs +1 -0
- package/dist/esm/api/resources/shipping/resources/drivers/types/DriversOrgListSelfReportedHoursAndMileageV1RequestSortBy.d.mts +8 -0
- package/dist/esm/api/resources/shipping/resources/drivers/types/DriversOrgListSelfReportedHoursAndMileageV1RequestSortBy.mjs +7 -0
- package/dist/esm/api/resources/shipping/resources/drivers/types/index.d.mts +1 -0
- package/dist/esm/api/resources/shipping/resources/drivers/types/index.mjs +1 -0
- package/dist/esm/api/resources/shipping/resources/flights/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/shipping/resources/flights/client/Client.mjs +1 -1
- package/dist/esm/api/resources/shipping/resources/index.d.mts +2 -1
- package/dist/esm/api/resources/shipping/resources/index.mjs +2 -1
- package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/shipping/resources/orderDrafts/resources/taskGroup/client/Client.mjs +2 -1
- package/dist/esm/api/resources/shipping/resources/taskGroups/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/shipping/resources/taskGroups/client/Client.mjs +2 -1
- package/dist/esm/api/resources/tracking/resources/driver/client/Client.d.mts +26 -0
- package/dist/esm/api/resources/tracking/resources/driver/client/Client.mjs +75 -0
- package/dist/esm/api/resources/tracking/resources/driver/client/index.d.mts +1 -0
- package/dist/esm/api/resources/tracking/resources/driver/client/index.mjs +1 -1
- package/dist/esm/api/resources/tracking/resources/driver/client/requests/DriverByDriverDataPointClientCreate1.d.mts +26 -0
- package/dist/esm/api/resources/tracking/resources/driver/client/requests/DriverByDriverDataPointClientCreate1.mjs +4 -0
- package/dist/esm/api/resources/tracking/resources/driver/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/tracking/resources/driver/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/tracking/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/tracking/resources/index.mjs +1 -0
- package/dist/esm/api/types/DriverSelfReportedHoursAndMileage1.d.mts +17 -0
- package/dist/esm/api/types/DriverSelfReportedHoursAndMileage1.mjs +4 -0
- package/dist/esm/api/types/DriverSelfReportedHoursAndMileageListRes.d.mts +8 -0
- package/dist/esm/api/types/DriverSelfReportedHoursAndMileageListRes.mjs +4 -0
- package/dist/esm/api/types/DriverStatsRes.d.mts +8 -3
- package/dist/esm/api/types/DriverUpdateRes.d.mts +1 -0
- package/dist/esm/api/types/FlightLeg1.d.mts +1 -1
- package/dist/esm/api/types/FlightLegClientCreate1.d.mts +1 -1
- package/dist/esm/api/types/{FlightTrackPosition.d.mts → FlightTrackPosition1.d.mts} +1 -4
- package/dist/esm/api/types/FlightTrackPosition1.mjs +4 -0
- package/dist/esm/api/types/FlightTrackRes.d.mts +2 -2
- package/dist/{cjs/api/types/FlightTrackWaypoint.d.ts → esm/api/types/FlightTrackWaypoint1.d.mts} +1 -4
- package/dist/esm/api/types/FlightTrackWaypoint1.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +4 -2
- package/dist/esm/api/types/index.mjs +4 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +518 -2
- /package/dist/cjs/api/{types/FlightTrackPosition.js → resources/shipping/resources/drivers/client/requests/DriverSelfReportedHoursAndMileageClientCreate1.js} +0 -0
- /package/dist/cjs/api/{types/FlightTrackWaypoint.js → resources/shipping/resources/drivers/client/requests/DriverSelfReportedHoursAndMileageClientUpdate1.js} +0 -0
- /package/dist/esm/api/{types/FlightTrackPosition.mjs → resources/shipping/resources/drivers/client/requests/DriverSelfReportedHoursAndMileageClientCreate1.mjs} +0 -0
- /package/dist/esm/api/{types/FlightTrackWaypoint.mjs → resources/shipping/resources/drivers/client/requests/DriverSelfReportedHoursAndMileageClientUpdate1.mjs} +0 -0
|
@@ -34,7 +34,7 @@ export declare class Drivers {
|
|
|
34
34
|
constructor(_options?: Drivers.Options);
|
|
35
35
|
get complianceDocuments(): ComplianceDocuments;
|
|
36
36
|
/**
|
|
37
|
-
* Retrieves driver stats
|
|
37
|
+
* Retrieves driver stats for a time window: overlap-corrected hours worked, total GPS mileage, and mileage restricted to worked task-group intervals. | authz: allowed_org_types=[provider], min_org_role=operator | (DriverStatsReq) -> (DriverStatsRes)
|
|
38
38
|
*
|
|
39
39
|
* @param {string} driverId
|
|
40
40
|
* @param {Chrt.shipping.DriverStatsReq} request
|
|
@@ -50,6 +50,107 @@ export declare class Drivers {
|
|
|
50
50
|
*/
|
|
51
51
|
getStatsV1(driverId: string, request: Chrt.shipping.DriverStatsReq, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.DriverStatsRes>;
|
|
52
52
|
private __getStatsV1;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves a driver's self-report for a single calendar day. Caller must be the driver themselves or an operator+ in the driver's org. | authz: allowed_org_types=[provider], min_org_role=driver | () -> (DriverSelfReportedHoursAndMileage1)
|
|
55
|
+
*
|
|
56
|
+
* @param {string} driverId
|
|
57
|
+
* @param {string} reportDate
|
|
58
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
|
+
*
|
|
60
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.shipping.drivers.getSelfReportedHoursAndMileageV1("driver_id", "report_date")
|
|
64
|
+
*/
|
|
65
|
+
getSelfReportedHoursAndMileageV1(driverId: string, reportDate: string, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.DriverSelfReportedHoursAndMileage1>;
|
|
66
|
+
private __getSelfReportedHoursAndMileageV1;
|
|
67
|
+
/**
|
|
68
|
+
* Lists a driver's self-reports across an optional date range with sorting and pagination. Caller must be the driver themselves or an operator+ in the driver's org. | authz: allowed_org_types=[provider], min_org_role=driver | () -> (DriverSelfReportedHoursAndMileageListRes)
|
|
69
|
+
*
|
|
70
|
+
* @param {string} driverId
|
|
71
|
+
* @param {Chrt.shipping.DriversListSelfReportedHoursAndMileageV1Request} request
|
|
72
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
|
+
*
|
|
74
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* await client.shipping.drivers.listSelfReportedHoursAndMileageV1("driver_id", {
|
|
78
|
+
* filter_start_date: "filter_start_date",
|
|
79
|
+
* filter_end_date: "filter_end_date",
|
|
80
|
+
* sort_order: "asc",
|
|
81
|
+
* page: 1,
|
|
82
|
+
* page_size: 1
|
|
83
|
+
* })
|
|
84
|
+
*/
|
|
85
|
+
listSelfReportedHoursAndMileageV1(driverId: string, request?: Chrt.shipping.DriversListSelfReportedHoursAndMileageV1Request, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.DriverSelfReportedHoursAndMileageListRes>;
|
|
86
|
+
private __listSelfReportedHoursAndMileageV1;
|
|
87
|
+
/**
|
|
88
|
+
* Lists all drivers' self-reports in the caller's org with date-range filtering, sorting, and pagination. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (DriverSelfReportedHoursAndMileageListRes)
|
|
89
|
+
*
|
|
90
|
+
* @param {Chrt.shipping.DriversOrgListSelfReportedHoursAndMileageV1Request} request
|
|
91
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
92
|
+
*
|
|
93
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* await client.shipping.drivers.orgListSelfReportedHoursAndMileageV1({
|
|
97
|
+
* filter_driver_id: "filter_driver_id",
|
|
98
|
+
* filter_start_date: "filter_start_date",
|
|
99
|
+
* filter_end_date: "filter_end_date",
|
|
100
|
+
* sort_by: "date",
|
|
101
|
+
* sort_order: "asc",
|
|
102
|
+
* page: 1,
|
|
103
|
+
* page_size: 1
|
|
104
|
+
* })
|
|
105
|
+
*/
|
|
106
|
+
orgListSelfReportedHoursAndMileageV1(request?: Chrt.shipping.DriversOrgListSelfReportedHoursAndMileageV1Request, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.DriverSelfReportedHoursAndMileageListRes>;
|
|
107
|
+
private __orgListSelfReportedHoursAndMileageV1;
|
|
108
|
+
/**
|
|
109
|
+
* Creates a driver's self-reported hours worked and miles driven for a single calendar day. Caller must be the driver themselves. | authz: allowed_org_types=[provider], min_org_role=driver | (DriverSelfReportedHoursAndMileageClientCreate1) -> (DriverSelfReportedHoursAndMileage1)
|
|
110
|
+
*
|
|
111
|
+
* @param {Chrt.shipping.DriverSelfReportedHoursAndMileageClientCreate1} request
|
|
112
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
113
|
+
*
|
|
114
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* await client.shipping.drivers.createSelfReportedHoursAndMileageV1({
|
|
118
|
+
* schema_version: 1,
|
|
119
|
+
* driver_id: "driver_id",
|
|
120
|
+
* date: "date"
|
|
121
|
+
* })
|
|
122
|
+
*/
|
|
123
|
+
createSelfReportedHoursAndMileageV1(request: Chrt.shipping.DriverSelfReportedHoursAndMileageClientCreate1, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.DriverSelfReportedHoursAndMileage1>;
|
|
124
|
+
private __createSelfReportedHoursAndMileageV1;
|
|
125
|
+
/**
|
|
126
|
+
* Partially updates a driver's self-reported hours worked and/or miles driven for a calendar day. Caller must be the driver themselves. | authz: allowed_org_types=[provider], min_org_role=driver | (DriverSelfReportedHoursAndMileageClientUpdate1) -> (DriverSelfReportedHoursAndMileage1)
|
|
127
|
+
*
|
|
128
|
+
* @param {string} driverId
|
|
129
|
+
* @param {string} reportDate
|
|
130
|
+
* @param {Chrt.shipping.DriverSelfReportedHoursAndMileageClientUpdate1} request
|
|
131
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
132
|
+
*
|
|
133
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* await client.shipping.drivers.updateSelfReportedHoursAndMileageV1("driver_id", "report_date")
|
|
137
|
+
*/
|
|
138
|
+
updateSelfReportedHoursAndMileageV1(driverId: string, reportDate: string, request?: Chrt.shipping.DriverSelfReportedHoursAndMileageClientUpdate1, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<Chrt.DriverSelfReportedHoursAndMileage1>;
|
|
139
|
+
private __updateSelfReportedHoursAndMileageV1;
|
|
140
|
+
/**
|
|
141
|
+
* Permanently deletes a driver's self-report for a calendar day. Caller must be the driver themselves. | authz: allowed_org_types=[provider], min_org_role=driver | () -> (bool)
|
|
142
|
+
*
|
|
143
|
+
* @param {string} driverId
|
|
144
|
+
* @param {string} reportDate
|
|
145
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
146
|
+
*
|
|
147
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* await client.shipping.drivers.deleteSelfReportedHoursAndMileageV1("driver_id", "report_date")
|
|
151
|
+
*/
|
|
152
|
+
deleteSelfReportedHoursAndMileageV1(driverId: string, reportDate: string, requestOptions?: Drivers.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
153
|
+
private __deleteSelfReportedHoursAndMileageV1;
|
|
53
154
|
/**
|
|
54
155
|
* Retrieves driver information for the caller within their organization. | () -> (Driver1)
|
|
55
156
|
*
|
|
@@ -36,7 +36,7 @@ export class Drivers {
|
|
|
36
36
|
return ((_a = this._complianceDocuments) !== null && _a !== void 0 ? _a : (this._complianceDocuments = new ComplianceDocuments(this._options)));
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* Retrieves driver stats
|
|
39
|
+
* Retrieves driver stats for a time window: overlap-corrected hours worked, total GPS mileage, and mileage restricted to worked task-group intervals. | authz: allowed_org_types=[provider], min_org_role=operator | (DriverStatsReq) -> (DriverStatsRes)
|
|
40
40
|
*
|
|
41
41
|
* @param {string} driverId
|
|
42
42
|
* @param {Chrt.shipping.DriverStatsReq} request
|
|
@@ -101,6 +101,444 @@ export class Drivers {
|
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Retrieves a driver's self-report for a single calendar day. Caller must be the driver themselves or an operator+ in the driver's org. | authz: allowed_org_types=[provider], min_org_role=driver | () -> (DriverSelfReportedHoursAndMileage1)
|
|
106
|
+
*
|
|
107
|
+
* @param {string} driverId
|
|
108
|
+
* @param {string} reportDate
|
|
109
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
110
|
+
*
|
|
111
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.shipping.drivers.getSelfReportedHoursAndMileageV1("driver_id", "report_date")
|
|
115
|
+
*/
|
|
116
|
+
getSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions) {
|
|
117
|
+
return core.HttpResponsePromise.fromPromise(this.__getSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions));
|
|
118
|
+
}
|
|
119
|
+
__getSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
var _a, _b, _c, _d;
|
|
122
|
+
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);
|
|
123
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
124
|
+
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, `shipping/drivers/self_reported_hours_and_mileage/get/v1/${encodeURIComponent(driverId)}/${encodeURIComponent(reportDate)}`),
|
|
125
|
+
method: "GET",
|
|
126
|
+
headers: _headers,
|
|
127
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
128
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
129
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
130
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
131
|
+
});
|
|
132
|
+
if (_response.ok) {
|
|
133
|
+
return {
|
|
134
|
+
data: _response.body,
|
|
135
|
+
rawResponse: _response.rawResponse,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (_response.error.reason === "status-code") {
|
|
139
|
+
switch (_response.error.statusCode) {
|
|
140
|
+
case 422:
|
|
141
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
142
|
+
default:
|
|
143
|
+
throw new errors.ChrtError({
|
|
144
|
+
statusCode: _response.error.statusCode,
|
|
145
|
+
body: _response.error.body,
|
|
146
|
+
rawResponse: _response.rawResponse,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
switch (_response.error.reason) {
|
|
151
|
+
case "non-json":
|
|
152
|
+
throw new errors.ChrtError({
|
|
153
|
+
statusCode: _response.error.statusCode,
|
|
154
|
+
body: _response.error.rawBody,
|
|
155
|
+
rawResponse: _response.rawResponse,
|
|
156
|
+
});
|
|
157
|
+
case "timeout":
|
|
158
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping/drivers/self_reported_hours_and_mileage/get/v1/{driver_id}/{report_date}.");
|
|
159
|
+
case "unknown":
|
|
160
|
+
throw new errors.ChrtError({
|
|
161
|
+
message: _response.error.errorMessage,
|
|
162
|
+
rawResponse: _response.rawResponse,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Lists a driver's self-reports across an optional date range with sorting and pagination. Caller must be the driver themselves or an operator+ in the driver's org. | authz: allowed_org_types=[provider], min_org_role=driver | () -> (DriverSelfReportedHoursAndMileageListRes)
|
|
169
|
+
*
|
|
170
|
+
* @param {string} driverId
|
|
171
|
+
* @param {Chrt.shipping.DriversListSelfReportedHoursAndMileageV1Request} request
|
|
172
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
173
|
+
*
|
|
174
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* await client.shipping.drivers.listSelfReportedHoursAndMileageV1("driver_id", {
|
|
178
|
+
* filter_start_date: "filter_start_date",
|
|
179
|
+
* filter_end_date: "filter_end_date",
|
|
180
|
+
* sort_order: "asc",
|
|
181
|
+
* page: 1,
|
|
182
|
+
* page_size: 1
|
|
183
|
+
* })
|
|
184
|
+
*/
|
|
185
|
+
listSelfReportedHoursAndMileageV1(driverId, request = {}, requestOptions) {
|
|
186
|
+
return core.HttpResponsePromise.fromPromise(this.__listSelfReportedHoursAndMileageV1(driverId, request, requestOptions));
|
|
187
|
+
}
|
|
188
|
+
__listSelfReportedHoursAndMileageV1(driverId_1) {
|
|
189
|
+
return __awaiter(this, arguments, void 0, function* (driverId, request = {}, requestOptions) {
|
|
190
|
+
var _a, _b, _c, _d, _e, _f;
|
|
191
|
+
const { filter_start_date: filterStartDate, filter_end_date: filterEndDate, sort_order: sortOrder, page, page_size: pageSize, } = request;
|
|
192
|
+
const _queryParams = {};
|
|
193
|
+
if (filterStartDate !== undefined) {
|
|
194
|
+
_queryParams["filter_start_date"] = filterStartDate;
|
|
195
|
+
}
|
|
196
|
+
if (filterEndDate !== undefined) {
|
|
197
|
+
_queryParams["filter_end_date"] = filterEndDate;
|
|
198
|
+
}
|
|
199
|
+
if (sortOrder !== undefined) {
|
|
200
|
+
_queryParams["sort_order"] = sortOrder;
|
|
201
|
+
}
|
|
202
|
+
if (page !== undefined) {
|
|
203
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
204
|
+
}
|
|
205
|
+
if (pageSize !== undefined) {
|
|
206
|
+
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
207
|
+
}
|
|
208
|
+
let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
209
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
210
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, `shipping/drivers/self_reported_hours_and_mileage/list/v1/${encodeURIComponent(driverId)}`),
|
|
211
|
+
method: "GET",
|
|
212
|
+
headers: _headers,
|
|
213
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
214
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
215
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
216
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
217
|
+
});
|
|
218
|
+
if (_response.ok) {
|
|
219
|
+
return {
|
|
220
|
+
data: _response.body,
|
|
221
|
+
rawResponse: _response.rawResponse,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
if (_response.error.reason === "status-code") {
|
|
225
|
+
switch (_response.error.statusCode) {
|
|
226
|
+
case 422:
|
|
227
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
228
|
+
default:
|
|
229
|
+
throw new errors.ChrtError({
|
|
230
|
+
statusCode: _response.error.statusCode,
|
|
231
|
+
body: _response.error.body,
|
|
232
|
+
rawResponse: _response.rawResponse,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
switch (_response.error.reason) {
|
|
237
|
+
case "non-json":
|
|
238
|
+
throw new errors.ChrtError({
|
|
239
|
+
statusCode: _response.error.statusCode,
|
|
240
|
+
body: _response.error.rawBody,
|
|
241
|
+
rawResponse: _response.rawResponse,
|
|
242
|
+
});
|
|
243
|
+
case "timeout":
|
|
244
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping/drivers/self_reported_hours_and_mileage/list/v1/{driver_id}.");
|
|
245
|
+
case "unknown":
|
|
246
|
+
throw new errors.ChrtError({
|
|
247
|
+
message: _response.error.errorMessage,
|
|
248
|
+
rawResponse: _response.rawResponse,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Lists all drivers' self-reports in the caller's org with date-range filtering, sorting, and pagination. | authz: allowed_org_types=[provider], min_org_role=operator | () -> (DriverSelfReportedHoursAndMileageListRes)
|
|
255
|
+
*
|
|
256
|
+
* @param {Chrt.shipping.DriversOrgListSelfReportedHoursAndMileageV1Request} request
|
|
257
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
258
|
+
*
|
|
259
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* await client.shipping.drivers.orgListSelfReportedHoursAndMileageV1({
|
|
263
|
+
* filter_driver_id: "filter_driver_id",
|
|
264
|
+
* filter_start_date: "filter_start_date",
|
|
265
|
+
* filter_end_date: "filter_end_date",
|
|
266
|
+
* sort_by: "date",
|
|
267
|
+
* sort_order: "asc",
|
|
268
|
+
* page: 1,
|
|
269
|
+
* page_size: 1
|
|
270
|
+
* })
|
|
271
|
+
*/
|
|
272
|
+
orgListSelfReportedHoursAndMileageV1(request = {}, requestOptions) {
|
|
273
|
+
return core.HttpResponsePromise.fromPromise(this.__orgListSelfReportedHoursAndMileageV1(request, requestOptions));
|
|
274
|
+
}
|
|
275
|
+
__orgListSelfReportedHoursAndMileageV1() {
|
|
276
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
277
|
+
var _a, _b, _c, _d, _e, _f;
|
|
278
|
+
const { filter_driver_id: filterDriverId, filter_start_date: filterStartDate, filter_end_date: filterEndDate, sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, } = request;
|
|
279
|
+
const _queryParams = {};
|
|
280
|
+
if (filterDriverId !== undefined) {
|
|
281
|
+
_queryParams["filter_driver_id"] = filterDriverId;
|
|
282
|
+
}
|
|
283
|
+
if (filterStartDate !== undefined) {
|
|
284
|
+
_queryParams["filter_start_date"] = filterStartDate;
|
|
285
|
+
}
|
|
286
|
+
if (filterEndDate !== undefined) {
|
|
287
|
+
_queryParams["filter_end_date"] = filterEndDate;
|
|
288
|
+
}
|
|
289
|
+
if (sortBy !== undefined) {
|
|
290
|
+
_queryParams["sort_by"] = sortBy;
|
|
291
|
+
}
|
|
292
|
+
if (sortOrder !== undefined) {
|
|
293
|
+
_queryParams["sort_order"] = sortOrder;
|
|
294
|
+
}
|
|
295
|
+
if (page !== undefined) {
|
|
296
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
297
|
+
}
|
|
298
|
+
if (pageSize !== undefined) {
|
|
299
|
+
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
300
|
+
}
|
|
301
|
+
let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
302
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
303
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, "shipping/drivers/self_reported_hours_and_mileage/org_list/v1"),
|
|
304
|
+
method: "GET",
|
|
305
|
+
headers: _headers,
|
|
306
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
307
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
308
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
309
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
310
|
+
});
|
|
311
|
+
if (_response.ok) {
|
|
312
|
+
return {
|
|
313
|
+
data: _response.body,
|
|
314
|
+
rawResponse: _response.rawResponse,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
if (_response.error.reason === "status-code") {
|
|
318
|
+
switch (_response.error.statusCode) {
|
|
319
|
+
case 422:
|
|
320
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
321
|
+
default:
|
|
322
|
+
throw new errors.ChrtError({
|
|
323
|
+
statusCode: _response.error.statusCode,
|
|
324
|
+
body: _response.error.body,
|
|
325
|
+
rawResponse: _response.rawResponse,
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
switch (_response.error.reason) {
|
|
330
|
+
case "non-json":
|
|
331
|
+
throw new errors.ChrtError({
|
|
332
|
+
statusCode: _response.error.statusCode,
|
|
333
|
+
body: _response.error.rawBody,
|
|
334
|
+
rawResponse: _response.rawResponse,
|
|
335
|
+
});
|
|
336
|
+
case "timeout":
|
|
337
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping/drivers/self_reported_hours_and_mileage/org_list/v1.");
|
|
338
|
+
case "unknown":
|
|
339
|
+
throw new errors.ChrtError({
|
|
340
|
+
message: _response.error.errorMessage,
|
|
341
|
+
rawResponse: _response.rawResponse,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Creates a driver's self-reported hours worked and miles driven for a single calendar day. Caller must be the driver themselves. | authz: allowed_org_types=[provider], min_org_role=driver | (DriverSelfReportedHoursAndMileageClientCreate1) -> (DriverSelfReportedHoursAndMileage1)
|
|
348
|
+
*
|
|
349
|
+
* @param {Chrt.shipping.DriverSelfReportedHoursAndMileageClientCreate1} request
|
|
350
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
351
|
+
*
|
|
352
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
353
|
+
*
|
|
354
|
+
* @example
|
|
355
|
+
* await client.shipping.drivers.createSelfReportedHoursAndMileageV1({
|
|
356
|
+
* schema_version: 1,
|
|
357
|
+
* driver_id: "driver_id",
|
|
358
|
+
* date: "date"
|
|
359
|
+
* })
|
|
360
|
+
*/
|
|
361
|
+
createSelfReportedHoursAndMileageV1(request, requestOptions) {
|
|
362
|
+
return core.HttpResponsePromise.fromPromise(this.__createSelfReportedHoursAndMileageV1(request, requestOptions));
|
|
363
|
+
}
|
|
364
|
+
__createSelfReportedHoursAndMileageV1(request, requestOptions) {
|
|
365
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
366
|
+
var _a, _b, _c, _d;
|
|
367
|
+
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);
|
|
368
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
369
|
+
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, "shipping/drivers/self_reported_hours_and_mileage/create/v1"),
|
|
370
|
+
method: "POST",
|
|
371
|
+
headers: _headers,
|
|
372
|
+
contentType: "application/json",
|
|
373
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
374
|
+
requestType: "json",
|
|
375
|
+
body: request,
|
|
376
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
377
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
378
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
379
|
+
});
|
|
380
|
+
if (_response.ok) {
|
|
381
|
+
return {
|
|
382
|
+
data: _response.body,
|
|
383
|
+
rawResponse: _response.rawResponse,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
if (_response.error.reason === "status-code") {
|
|
387
|
+
switch (_response.error.statusCode) {
|
|
388
|
+
case 422:
|
|
389
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
390
|
+
default:
|
|
391
|
+
throw new errors.ChrtError({
|
|
392
|
+
statusCode: _response.error.statusCode,
|
|
393
|
+
body: _response.error.body,
|
|
394
|
+
rawResponse: _response.rawResponse,
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
switch (_response.error.reason) {
|
|
399
|
+
case "non-json":
|
|
400
|
+
throw new errors.ChrtError({
|
|
401
|
+
statusCode: _response.error.statusCode,
|
|
402
|
+
body: _response.error.rawBody,
|
|
403
|
+
rawResponse: _response.rawResponse,
|
|
404
|
+
});
|
|
405
|
+
case "timeout":
|
|
406
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/drivers/self_reported_hours_and_mileage/create/v1.");
|
|
407
|
+
case "unknown":
|
|
408
|
+
throw new errors.ChrtError({
|
|
409
|
+
message: _response.error.errorMessage,
|
|
410
|
+
rawResponse: _response.rawResponse,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Partially updates a driver's self-reported hours worked and/or miles driven for a calendar day. Caller must be the driver themselves. | authz: allowed_org_types=[provider], min_org_role=driver | (DriverSelfReportedHoursAndMileageClientUpdate1) -> (DriverSelfReportedHoursAndMileage1)
|
|
417
|
+
*
|
|
418
|
+
* @param {string} driverId
|
|
419
|
+
* @param {string} reportDate
|
|
420
|
+
* @param {Chrt.shipping.DriverSelfReportedHoursAndMileageClientUpdate1} request
|
|
421
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
422
|
+
*
|
|
423
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* await client.shipping.drivers.updateSelfReportedHoursAndMileageV1("driver_id", "report_date")
|
|
427
|
+
*/
|
|
428
|
+
updateSelfReportedHoursAndMileageV1(driverId, reportDate, request = {}, requestOptions) {
|
|
429
|
+
return core.HttpResponsePromise.fromPromise(this.__updateSelfReportedHoursAndMileageV1(driverId, reportDate, request, requestOptions));
|
|
430
|
+
}
|
|
431
|
+
__updateSelfReportedHoursAndMileageV1(driverId_1, reportDate_1) {
|
|
432
|
+
return __awaiter(this, arguments, void 0, function* (driverId, reportDate, request = {}, requestOptions) {
|
|
433
|
+
var _a, _b, _c, _d;
|
|
434
|
+
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);
|
|
435
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
436
|
+
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, `shipping/drivers/self_reported_hours_and_mileage/update/v1/${encodeURIComponent(driverId)}/${encodeURIComponent(reportDate)}`),
|
|
437
|
+
method: "PATCH",
|
|
438
|
+
headers: _headers,
|
|
439
|
+
contentType: "application/json",
|
|
440
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
441
|
+
requestType: "json",
|
|
442
|
+
body: request,
|
|
443
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
444
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
445
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
446
|
+
});
|
|
447
|
+
if (_response.ok) {
|
|
448
|
+
return {
|
|
449
|
+
data: _response.body,
|
|
450
|
+
rawResponse: _response.rawResponse,
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
if (_response.error.reason === "status-code") {
|
|
454
|
+
switch (_response.error.statusCode) {
|
|
455
|
+
case 422:
|
|
456
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
457
|
+
default:
|
|
458
|
+
throw new errors.ChrtError({
|
|
459
|
+
statusCode: _response.error.statusCode,
|
|
460
|
+
body: _response.error.body,
|
|
461
|
+
rawResponse: _response.rawResponse,
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
switch (_response.error.reason) {
|
|
466
|
+
case "non-json":
|
|
467
|
+
throw new errors.ChrtError({
|
|
468
|
+
statusCode: _response.error.statusCode,
|
|
469
|
+
body: _response.error.rawBody,
|
|
470
|
+
rawResponse: _response.rawResponse,
|
|
471
|
+
});
|
|
472
|
+
case "timeout":
|
|
473
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /shipping/drivers/self_reported_hours_and_mileage/update/v1/{driver_id}/{report_date}.");
|
|
474
|
+
case "unknown":
|
|
475
|
+
throw new errors.ChrtError({
|
|
476
|
+
message: _response.error.errorMessage,
|
|
477
|
+
rawResponse: _response.rawResponse,
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Permanently deletes a driver's self-report for a calendar day. Caller must be the driver themselves. | authz: allowed_org_types=[provider], min_org_role=driver | () -> (bool)
|
|
484
|
+
*
|
|
485
|
+
* @param {string} driverId
|
|
486
|
+
* @param {string} reportDate
|
|
487
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
488
|
+
*
|
|
489
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
490
|
+
*
|
|
491
|
+
* @example
|
|
492
|
+
* await client.shipping.drivers.deleteSelfReportedHoursAndMileageV1("driver_id", "report_date")
|
|
493
|
+
*/
|
|
494
|
+
deleteSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions) {
|
|
495
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions));
|
|
496
|
+
}
|
|
497
|
+
__deleteSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions) {
|
|
498
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
499
|
+
var _a, _b, _c, _d;
|
|
500
|
+
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);
|
|
501
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
502
|
+
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, `shipping/drivers/self_reported_hours_and_mileage/delete/v1/${encodeURIComponent(driverId)}/${encodeURIComponent(reportDate)}`),
|
|
503
|
+
method: "POST",
|
|
504
|
+
headers: _headers,
|
|
505
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
506
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
507
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
508
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
509
|
+
});
|
|
510
|
+
if (_response.ok) {
|
|
511
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
512
|
+
}
|
|
513
|
+
if (_response.error.reason === "status-code") {
|
|
514
|
+
switch (_response.error.statusCode) {
|
|
515
|
+
case 422:
|
|
516
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
517
|
+
default:
|
|
518
|
+
throw new errors.ChrtError({
|
|
519
|
+
statusCode: _response.error.statusCode,
|
|
520
|
+
body: _response.error.body,
|
|
521
|
+
rawResponse: _response.rawResponse,
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
switch (_response.error.reason) {
|
|
526
|
+
case "non-json":
|
|
527
|
+
throw new errors.ChrtError({
|
|
528
|
+
statusCode: _response.error.statusCode,
|
|
529
|
+
body: _response.error.rawBody,
|
|
530
|
+
rawResponse: _response.rawResponse,
|
|
531
|
+
});
|
|
532
|
+
case "timeout":
|
|
533
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/drivers/self_reported_hours_and_mileage/delete/v1/{driver_id}/{report_date}.");
|
|
534
|
+
case "unknown":
|
|
535
|
+
throw new errors.ChrtError({
|
|
536
|
+
message: _response.error.errorMessage,
|
|
537
|
+
rawResponse: _response.rawResponse,
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
}
|
|
104
542
|
/**
|
|
105
543
|
* Retrieves driver information for the caller within their organization. | () -> (Driver1)
|
|
106
544
|
*
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* schema_version: 1,
|
|
8
|
+
* driver_id: "driver_id",
|
|
9
|
+
* date: "date"
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface DriverSelfReportedHoursAndMileageClientCreate1 {
|
|
13
|
+
schema_version: number;
|
|
14
|
+
driver_id: string;
|
|
15
|
+
date: string;
|
|
16
|
+
hours_worked?: number | null;
|
|
17
|
+
miles_driven?: number | null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {}
|
|
7
|
+
*/
|
|
8
|
+
export interface DriverSelfReportedHoursAndMileageClientUpdate1 {
|
|
9
|
+
hours_worked?: number | null;
|
|
10
|
+
miles_driven?: number | null;
|
|
11
|
+
hours_worked__set_to_None?: boolean;
|
|
12
|
+
miles_driven__set_to_None?: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
* filter_start_date: "filter_start_date",
|
|
9
|
+
* filter_end_date: "filter_end_date",
|
|
10
|
+
* sort_order: "asc",
|
|
11
|
+
* page: 1,
|
|
12
|
+
* page_size: 1
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
export interface DriversListSelfReportedHoursAndMileageV1Request {
|
|
16
|
+
filter_start_date?: string | null;
|
|
17
|
+
filter_end_date?: string | null;
|
|
18
|
+
sort_order?: Chrt.SortOrderEnum | null;
|
|
19
|
+
page?: number | null;
|
|
20
|
+
page_size?: number | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
* filter_driver_id: "filter_driver_id",
|
|
9
|
+
* filter_start_date: "filter_start_date",
|
|
10
|
+
* filter_end_date: "filter_end_date",
|
|
11
|
+
* sort_by: "date",
|
|
12
|
+
* sort_order: "asc",
|
|
13
|
+
* page: 1,
|
|
14
|
+
* page_size: 1
|
|
15
|
+
* }
|
|
16
|
+
*/
|
|
17
|
+
export interface DriversOrgListSelfReportedHoursAndMileageV1Request {
|
|
18
|
+
filter_driver_id?: string | null;
|
|
19
|
+
filter_start_date?: string | null;
|
|
20
|
+
filter_end_date?: string | null;
|
|
21
|
+
sort_by?: Chrt.shipping.DriversOrgListSelfReportedHoursAndMileageV1RequestSortBy | null;
|
|
22
|
+
sort_order?: Chrt.SortOrderEnum | null;
|
|
23
|
+
page?: number | null;
|
|
24
|
+
page_size?: number | null;
|
|
25
|
+
}
|