@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
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.760.0",
|
|
60
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.760.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) });
|
|
@@ -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
|
*
|
|
@@ -72,7 +72,7 @@ class Drivers {
|
|
|
72
72
|
return ((_a = this._complianceDocuments) !== null && _a !== void 0 ? _a : (this._complianceDocuments = new Client_js_1.ComplianceDocuments(this._options)));
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
|
-
* Retrieves driver stats
|
|
75
|
+
* 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)
|
|
76
76
|
*
|
|
77
77
|
* @param {string} driverId
|
|
78
78
|
* @param {Chrt.shipping.DriverStatsReq} request
|
|
@@ -137,6 +137,444 @@ class Drivers {
|
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* 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)
|
|
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.getSelfReportedHoursAndMileageV1("driver_id", "report_date")
|
|
151
|
+
*/
|
|
152
|
+
getSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions) {
|
|
153
|
+
return core.HttpResponsePromise.fromPromise(this.__getSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions));
|
|
154
|
+
}
|
|
155
|
+
__getSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions) {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
var _a, _b, _c, _d;
|
|
158
|
+
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);
|
|
159
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
160
|
+
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)}`),
|
|
161
|
+
method: "GET",
|
|
162
|
+
headers: _headers,
|
|
163
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
164
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
165
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
166
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
167
|
+
});
|
|
168
|
+
if (_response.ok) {
|
|
169
|
+
return {
|
|
170
|
+
data: _response.body,
|
|
171
|
+
rawResponse: _response.rawResponse,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (_response.error.reason === "status-code") {
|
|
175
|
+
switch (_response.error.statusCode) {
|
|
176
|
+
case 422:
|
|
177
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
178
|
+
default:
|
|
179
|
+
throw new errors.ChrtError({
|
|
180
|
+
statusCode: _response.error.statusCode,
|
|
181
|
+
body: _response.error.body,
|
|
182
|
+
rawResponse: _response.rawResponse,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
switch (_response.error.reason) {
|
|
187
|
+
case "non-json":
|
|
188
|
+
throw new errors.ChrtError({
|
|
189
|
+
statusCode: _response.error.statusCode,
|
|
190
|
+
body: _response.error.rawBody,
|
|
191
|
+
rawResponse: _response.rawResponse,
|
|
192
|
+
});
|
|
193
|
+
case "timeout":
|
|
194
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping/drivers/self_reported_hours_and_mileage/get/v1/{driver_id}/{report_date}.");
|
|
195
|
+
case "unknown":
|
|
196
|
+
throw new errors.ChrtError({
|
|
197
|
+
message: _response.error.errorMessage,
|
|
198
|
+
rawResponse: _response.rawResponse,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* 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)
|
|
205
|
+
*
|
|
206
|
+
* @param {string} driverId
|
|
207
|
+
* @param {Chrt.shipping.DriversListSelfReportedHoursAndMileageV1Request} request
|
|
208
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
209
|
+
*
|
|
210
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* await client.shipping.drivers.listSelfReportedHoursAndMileageV1("driver_id", {
|
|
214
|
+
* filter_start_date: "filter_start_date",
|
|
215
|
+
* filter_end_date: "filter_end_date",
|
|
216
|
+
* sort_order: "asc",
|
|
217
|
+
* page: 1,
|
|
218
|
+
* page_size: 1
|
|
219
|
+
* })
|
|
220
|
+
*/
|
|
221
|
+
listSelfReportedHoursAndMileageV1(driverId, request = {}, requestOptions) {
|
|
222
|
+
return core.HttpResponsePromise.fromPromise(this.__listSelfReportedHoursAndMileageV1(driverId, request, requestOptions));
|
|
223
|
+
}
|
|
224
|
+
__listSelfReportedHoursAndMileageV1(driverId_1) {
|
|
225
|
+
return __awaiter(this, arguments, void 0, function* (driverId, request = {}, requestOptions) {
|
|
226
|
+
var _a, _b, _c, _d, _e, _f;
|
|
227
|
+
const { filter_start_date: filterStartDate, filter_end_date: filterEndDate, sort_order: sortOrder, page, page_size: pageSize, } = request;
|
|
228
|
+
const _queryParams = {};
|
|
229
|
+
if (filterStartDate !== undefined) {
|
|
230
|
+
_queryParams["filter_start_date"] = filterStartDate;
|
|
231
|
+
}
|
|
232
|
+
if (filterEndDate !== undefined) {
|
|
233
|
+
_queryParams["filter_end_date"] = filterEndDate;
|
|
234
|
+
}
|
|
235
|
+
if (sortOrder !== undefined) {
|
|
236
|
+
_queryParams["sort_order"] = sortOrder;
|
|
237
|
+
}
|
|
238
|
+
if (page !== undefined) {
|
|
239
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
240
|
+
}
|
|
241
|
+
if (pageSize !== undefined) {
|
|
242
|
+
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
243
|
+
}
|
|
244
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
245
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
246
|
+
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)}`),
|
|
247
|
+
method: "GET",
|
|
248
|
+
headers: _headers,
|
|
249
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
250
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
251
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
252
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
253
|
+
});
|
|
254
|
+
if (_response.ok) {
|
|
255
|
+
return {
|
|
256
|
+
data: _response.body,
|
|
257
|
+
rawResponse: _response.rawResponse,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
if (_response.error.reason === "status-code") {
|
|
261
|
+
switch (_response.error.statusCode) {
|
|
262
|
+
case 422:
|
|
263
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
264
|
+
default:
|
|
265
|
+
throw new errors.ChrtError({
|
|
266
|
+
statusCode: _response.error.statusCode,
|
|
267
|
+
body: _response.error.body,
|
|
268
|
+
rawResponse: _response.rawResponse,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
switch (_response.error.reason) {
|
|
273
|
+
case "non-json":
|
|
274
|
+
throw new errors.ChrtError({
|
|
275
|
+
statusCode: _response.error.statusCode,
|
|
276
|
+
body: _response.error.rawBody,
|
|
277
|
+
rawResponse: _response.rawResponse,
|
|
278
|
+
});
|
|
279
|
+
case "timeout":
|
|
280
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping/drivers/self_reported_hours_and_mileage/list/v1/{driver_id}.");
|
|
281
|
+
case "unknown":
|
|
282
|
+
throw new errors.ChrtError({
|
|
283
|
+
message: _response.error.errorMessage,
|
|
284
|
+
rawResponse: _response.rawResponse,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* 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)
|
|
291
|
+
*
|
|
292
|
+
* @param {Chrt.shipping.DriversOrgListSelfReportedHoursAndMileageV1Request} request
|
|
293
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
294
|
+
*
|
|
295
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* await client.shipping.drivers.orgListSelfReportedHoursAndMileageV1({
|
|
299
|
+
* filter_driver_id: "filter_driver_id",
|
|
300
|
+
* filter_start_date: "filter_start_date",
|
|
301
|
+
* filter_end_date: "filter_end_date",
|
|
302
|
+
* sort_by: "date",
|
|
303
|
+
* sort_order: "asc",
|
|
304
|
+
* page: 1,
|
|
305
|
+
* page_size: 1
|
|
306
|
+
* })
|
|
307
|
+
*/
|
|
308
|
+
orgListSelfReportedHoursAndMileageV1(request = {}, requestOptions) {
|
|
309
|
+
return core.HttpResponsePromise.fromPromise(this.__orgListSelfReportedHoursAndMileageV1(request, requestOptions));
|
|
310
|
+
}
|
|
311
|
+
__orgListSelfReportedHoursAndMileageV1() {
|
|
312
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
313
|
+
var _a, _b, _c, _d, _e, _f;
|
|
314
|
+
const { filter_driver_id: filterDriverId, filter_start_date: filterStartDate, filter_end_date: filterEndDate, sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize, } = request;
|
|
315
|
+
const _queryParams = {};
|
|
316
|
+
if (filterDriverId !== undefined) {
|
|
317
|
+
_queryParams["filter_driver_id"] = filterDriverId;
|
|
318
|
+
}
|
|
319
|
+
if (filterStartDate !== undefined) {
|
|
320
|
+
_queryParams["filter_start_date"] = filterStartDate;
|
|
321
|
+
}
|
|
322
|
+
if (filterEndDate !== undefined) {
|
|
323
|
+
_queryParams["filter_end_date"] = filterEndDate;
|
|
324
|
+
}
|
|
325
|
+
if (sortBy !== undefined) {
|
|
326
|
+
_queryParams["sort_by"] = sortBy;
|
|
327
|
+
}
|
|
328
|
+
if (sortOrder !== undefined) {
|
|
329
|
+
_queryParams["sort_order"] = sortOrder;
|
|
330
|
+
}
|
|
331
|
+
if (page !== undefined) {
|
|
332
|
+
_queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
|
|
333
|
+
}
|
|
334
|
+
if (pageSize !== undefined) {
|
|
335
|
+
_queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
|
|
336
|
+
}
|
|
337
|
+
let _headers = (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
338
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
339
|
+
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"),
|
|
340
|
+
method: "GET",
|
|
341
|
+
headers: _headers,
|
|
342
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
343
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
344
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
345
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
346
|
+
});
|
|
347
|
+
if (_response.ok) {
|
|
348
|
+
return {
|
|
349
|
+
data: _response.body,
|
|
350
|
+
rawResponse: _response.rawResponse,
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
if (_response.error.reason === "status-code") {
|
|
354
|
+
switch (_response.error.statusCode) {
|
|
355
|
+
case 422:
|
|
356
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
357
|
+
default:
|
|
358
|
+
throw new errors.ChrtError({
|
|
359
|
+
statusCode: _response.error.statusCode,
|
|
360
|
+
body: _response.error.body,
|
|
361
|
+
rawResponse: _response.rawResponse,
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
switch (_response.error.reason) {
|
|
366
|
+
case "non-json":
|
|
367
|
+
throw new errors.ChrtError({
|
|
368
|
+
statusCode: _response.error.statusCode,
|
|
369
|
+
body: _response.error.rawBody,
|
|
370
|
+
rawResponse: _response.rawResponse,
|
|
371
|
+
});
|
|
372
|
+
case "timeout":
|
|
373
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /shipping/drivers/self_reported_hours_and_mileage/org_list/v1.");
|
|
374
|
+
case "unknown":
|
|
375
|
+
throw new errors.ChrtError({
|
|
376
|
+
message: _response.error.errorMessage,
|
|
377
|
+
rawResponse: _response.rawResponse,
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* 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)
|
|
384
|
+
*
|
|
385
|
+
* @param {Chrt.shipping.DriverSelfReportedHoursAndMileageClientCreate1} request
|
|
386
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
387
|
+
*
|
|
388
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
389
|
+
*
|
|
390
|
+
* @example
|
|
391
|
+
* await client.shipping.drivers.createSelfReportedHoursAndMileageV1({
|
|
392
|
+
* schema_version: 1,
|
|
393
|
+
* driver_id: "driver_id",
|
|
394
|
+
* date: "date"
|
|
395
|
+
* })
|
|
396
|
+
*/
|
|
397
|
+
createSelfReportedHoursAndMileageV1(request, requestOptions) {
|
|
398
|
+
return core.HttpResponsePromise.fromPromise(this.__createSelfReportedHoursAndMileageV1(request, requestOptions));
|
|
399
|
+
}
|
|
400
|
+
__createSelfReportedHoursAndMileageV1(request, requestOptions) {
|
|
401
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
402
|
+
var _a, _b, _c, _d;
|
|
403
|
+
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);
|
|
404
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
405
|
+
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"),
|
|
406
|
+
method: "POST",
|
|
407
|
+
headers: _headers,
|
|
408
|
+
contentType: "application/json",
|
|
409
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
410
|
+
requestType: "json",
|
|
411
|
+
body: request,
|
|
412
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
413
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
414
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
415
|
+
});
|
|
416
|
+
if (_response.ok) {
|
|
417
|
+
return {
|
|
418
|
+
data: _response.body,
|
|
419
|
+
rawResponse: _response.rawResponse,
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
if (_response.error.reason === "status-code") {
|
|
423
|
+
switch (_response.error.statusCode) {
|
|
424
|
+
case 422:
|
|
425
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
426
|
+
default:
|
|
427
|
+
throw new errors.ChrtError({
|
|
428
|
+
statusCode: _response.error.statusCode,
|
|
429
|
+
body: _response.error.body,
|
|
430
|
+
rawResponse: _response.rawResponse,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
switch (_response.error.reason) {
|
|
435
|
+
case "non-json":
|
|
436
|
+
throw new errors.ChrtError({
|
|
437
|
+
statusCode: _response.error.statusCode,
|
|
438
|
+
body: _response.error.rawBody,
|
|
439
|
+
rawResponse: _response.rawResponse,
|
|
440
|
+
});
|
|
441
|
+
case "timeout":
|
|
442
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/drivers/self_reported_hours_and_mileage/create/v1.");
|
|
443
|
+
case "unknown":
|
|
444
|
+
throw new errors.ChrtError({
|
|
445
|
+
message: _response.error.errorMessage,
|
|
446
|
+
rawResponse: _response.rawResponse,
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* 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)
|
|
453
|
+
*
|
|
454
|
+
* @param {string} driverId
|
|
455
|
+
* @param {string} reportDate
|
|
456
|
+
* @param {Chrt.shipping.DriverSelfReportedHoursAndMileageClientUpdate1} request
|
|
457
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
458
|
+
*
|
|
459
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* await client.shipping.drivers.updateSelfReportedHoursAndMileageV1("driver_id", "report_date")
|
|
463
|
+
*/
|
|
464
|
+
updateSelfReportedHoursAndMileageV1(driverId, reportDate, request = {}, requestOptions) {
|
|
465
|
+
return core.HttpResponsePromise.fromPromise(this.__updateSelfReportedHoursAndMileageV1(driverId, reportDate, request, requestOptions));
|
|
466
|
+
}
|
|
467
|
+
__updateSelfReportedHoursAndMileageV1(driverId_1, reportDate_1) {
|
|
468
|
+
return __awaiter(this, arguments, void 0, function* (driverId, reportDate, request = {}, requestOptions) {
|
|
469
|
+
var _a, _b, _c, _d;
|
|
470
|
+
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);
|
|
471
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
472
|
+
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)}`),
|
|
473
|
+
method: "PATCH",
|
|
474
|
+
headers: _headers,
|
|
475
|
+
contentType: "application/json",
|
|
476
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
477
|
+
requestType: "json",
|
|
478
|
+
body: request,
|
|
479
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
480
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
481
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
482
|
+
});
|
|
483
|
+
if (_response.ok) {
|
|
484
|
+
return {
|
|
485
|
+
data: _response.body,
|
|
486
|
+
rawResponse: _response.rawResponse,
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
if (_response.error.reason === "status-code") {
|
|
490
|
+
switch (_response.error.statusCode) {
|
|
491
|
+
case 422:
|
|
492
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
493
|
+
default:
|
|
494
|
+
throw new errors.ChrtError({
|
|
495
|
+
statusCode: _response.error.statusCode,
|
|
496
|
+
body: _response.error.body,
|
|
497
|
+
rawResponse: _response.rawResponse,
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
switch (_response.error.reason) {
|
|
502
|
+
case "non-json":
|
|
503
|
+
throw new errors.ChrtError({
|
|
504
|
+
statusCode: _response.error.statusCode,
|
|
505
|
+
body: _response.error.rawBody,
|
|
506
|
+
rawResponse: _response.rawResponse,
|
|
507
|
+
});
|
|
508
|
+
case "timeout":
|
|
509
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /shipping/drivers/self_reported_hours_and_mileage/update/v1/{driver_id}/{report_date}.");
|
|
510
|
+
case "unknown":
|
|
511
|
+
throw new errors.ChrtError({
|
|
512
|
+
message: _response.error.errorMessage,
|
|
513
|
+
rawResponse: _response.rawResponse,
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* 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)
|
|
520
|
+
*
|
|
521
|
+
* @param {string} driverId
|
|
522
|
+
* @param {string} reportDate
|
|
523
|
+
* @param {Drivers.RequestOptions} requestOptions - Request-specific configuration.
|
|
524
|
+
*
|
|
525
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
* await client.shipping.drivers.deleteSelfReportedHoursAndMileageV1("driver_id", "report_date")
|
|
529
|
+
*/
|
|
530
|
+
deleteSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions) {
|
|
531
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions));
|
|
532
|
+
}
|
|
533
|
+
__deleteSelfReportedHoursAndMileageV1(driverId, reportDate, requestOptions) {
|
|
534
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
535
|
+
var _a, _b, _c, _d;
|
|
536
|
+
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);
|
|
537
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
538
|
+
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)}`),
|
|
539
|
+
method: "POST",
|
|
540
|
+
headers: _headers,
|
|
541
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
542
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
543
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
544
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
545
|
+
});
|
|
546
|
+
if (_response.ok) {
|
|
547
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
548
|
+
}
|
|
549
|
+
if (_response.error.reason === "status-code") {
|
|
550
|
+
switch (_response.error.statusCode) {
|
|
551
|
+
case 422:
|
|
552
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
553
|
+
default:
|
|
554
|
+
throw new errors.ChrtError({
|
|
555
|
+
statusCode: _response.error.statusCode,
|
|
556
|
+
body: _response.error.body,
|
|
557
|
+
rawResponse: _response.rawResponse,
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
switch (_response.error.reason) {
|
|
562
|
+
case "non-json":
|
|
563
|
+
throw new errors.ChrtError({
|
|
564
|
+
statusCode: _response.error.statusCode,
|
|
565
|
+
body: _response.error.rawBody,
|
|
566
|
+
rawResponse: _response.rawResponse,
|
|
567
|
+
});
|
|
568
|
+
case "timeout":
|
|
569
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /shipping/drivers/self_reported_hours_and_mileage/delete/v1/{driver_id}/{report_date}.");
|
|
570
|
+
case "unknown":
|
|
571
|
+
throw new errors.ChrtError({
|
|
572
|
+
message: _response.error.errorMessage,
|
|
573
|
+
rawResponse: _response.rawResponse,
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
}
|
|
140
578
|
/**
|
|
141
579
|
* Retrieves driver information for the caller within their organization. | () -> (Driver1)
|
|
142
580
|
*
|
|
@@ -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.js";
|
|
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
|
+
}
|