@vulog/aima-trip 1.2.29 → 1.2.31
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/index.cjs +142 -0
- package/dist/index.d.cts +248 -0
- package/dist/index.d.mts +215 -208
- package/dist/index.mjs +99 -171
- package/package.json +20 -7
- package/{tsup.config.ts → tsdown.config.ts} +1 -1
- package/dist/index.d.ts +0 -241
- package/dist/index.js +0 -227
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,241 +1,248 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import z$1 from "zod";
|
|
2
|
+
import { PaginableOptions, PaginableResponse } from "@vulog/aima-core";
|
|
3
|
+
import { Client } from "@vulog/aima-client";
|
|
4
|
+
import { UUID } from "crypto";
|
|
5
5
|
|
|
6
|
+
//#region src/addRemoveTripRelatedProduct.d.ts
|
|
6
7
|
declare const addTripRelatedProduct: (client: Client, vehicleId: string, productId: string) => Promise<void>;
|
|
7
8
|
declare const removeTripRelatedProduct: (client: Client, vehicleId: string, productId: string) => Promise<void>;
|
|
8
|
-
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/types.d.ts
|
|
9
11
|
type Zone = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
type: 'allowed' | 'forbidden';
|
|
13
|
+
version: number;
|
|
14
|
+
zoneId: string;
|
|
15
|
+
sticky: boolean;
|
|
16
|
+
labels: string[];
|
|
15
17
|
};
|
|
16
18
|
type FleetManagerBook = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
plate: string;
|
|
22
|
+
vin: string;
|
|
23
|
+
fleetid: string;
|
|
24
|
+
boxid: string;
|
|
25
|
+
vehicle_status: number;
|
|
26
|
+
zones: Zone[];
|
|
27
|
+
releasable: boolean;
|
|
28
|
+
box_status: number;
|
|
29
|
+
autonomy: number;
|
|
30
|
+
autonomy2: number;
|
|
31
|
+
isCharging: boolean;
|
|
32
|
+
battery: number;
|
|
33
|
+
km: number;
|
|
34
|
+
speed: number;
|
|
35
|
+
location: {
|
|
36
|
+
geohash: string;
|
|
37
|
+
cap: number;
|
|
38
|
+
latitude: number;
|
|
39
|
+
longitude: number;
|
|
40
|
+
gpsDate: string;
|
|
41
|
+
lastMovingDate: string;
|
|
42
|
+
};
|
|
43
|
+
endZoneIds: string[];
|
|
44
|
+
productIds: string[];
|
|
45
|
+
isDoorClosed: boolean | null;
|
|
46
|
+
isDoorLocked: boolean | null;
|
|
47
|
+
engineOn: boolean | null;
|
|
48
|
+
immobilizerOn: boolean | null;
|
|
49
|
+
secureOn: boolean | null;
|
|
50
|
+
spareLockOn: boolean | null;
|
|
51
|
+
pileLockOn: boolean | null;
|
|
52
|
+
helmetPresent: boolean | null;
|
|
53
|
+
helmet2Present: boolean | null;
|
|
54
|
+
helmetBoxLockOn: boolean | null;
|
|
55
|
+
helmet2LockOn: boolean | null;
|
|
56
|
+
userId: string;
|
|
57
|
+
user_locale: string;
|
|
58
|
+
rfid: string;
|
|
59
|
+
orderId: string;
|
|
60
|
+
gatewayUrl: string | null;
|
|
61
|
+
booking_status: number;
|
|
62
|
+
booking_date: string;
|
|
63
|
+
expiresOn: string;
|
|
64
|
+
last_active_date: string;
|
|
65
|
+
last_wakeUp_date: string | null;
|
|
66
|
+
version: string;
|
|
67
|
+
pricingId: string;
|
|
68
|
+
start_date: string;
|
|
69
|
+
theorStartDate: string | null;
|
|
70
|
+
theorEndDate: string | null;
|
|
71
|
+
startZones: Zone[];
|
|
72
|
+
endZones: Zone[];
|
|
73
|
+
disabled: boolean;
|
|
74
|
+
outOfServiceReason: string | null;
|
|
75
|
+
ignitionOffGeohash: string;
|
|
76
|
+
geohashNeighbours: string[];
|
|
77
|
+
cleanlinessStatus: boolean;
|
|
78
|
+
needsRedistribution: boolean;
|
|
79
|
+
batteryUnderThreshold: boolean;
|
|
80
|
+
isBeingTowed: boolean;
|
|
81
|
+
automaticallyEnableVehicleAfterRangeRecovery: boolean;
|
|
82
|
+
key?: {
|
|
83
|
+
sessionKey?: string | null;
|
|
84
|
+
token?: string | null;
|
|
85
|
+
deviceName?: string | null;
|
|
86
|
+
expirationDate?: string | null;
|
|
87
|
+
};
|
|
88
|
+
startTripLocation?: {
|
|
89
|
+
latitude?: number;
|
|
90
|
+
longitude?: number;
|
|
91
|
+
};
|
|
92
|
+
doNotTrack: boolean;
|
|
93
|
+
start_mileage: number;
|
|
94
|
+
profileType: 'Single' | 'Business';
|
|
95
|
+
lastOosDate?: string | null;
|
|
96
|
+
entityId: string;
|
|
97
|
+
hasAlerts: boolean;
|
|
98
|
+
firmwareModel: string;
|
|
99
|
+
comeFromApp: string;
|
|
100
|
+
vpChecksum: string;
|
|
101
|
+
serviceType: string;
|
|
102
|
+
preAuthEnabled: boolean;
|
|
103
|
+
username: string;
|
|
104
|
+
preauth_status: string;
|
|
105
|
+
profileId: string;
|
|
106
|
+
energyLevel: number;
|
|
107
|
+
energyLevelStart: number;
|
|
108
|
+
serviceId: string;
|
|
109
|
+
doors?: {
|
|
110
|
+
frontLeftClosed?: boolean | null;
|
|
111
|
+
frontRightClosed?: boolean | null;
|
|
112
|
+
rearLeftClosed?: boolean | null;
|
|
113
|
+
rearRightClosed?: boolean | null;
|
|
114
|
+
trunkClosed?: boolean | null;
|
|
115
|
+
};
|
|
116
|
+
doorsAndWindowsClosed: boolean;
|
|
117
|
+
handDelivered: boolean;
|
|
118
|
+
deviceIds: string[];
|
|
119
|
+
start_pause_date?: string;
|
|
120
|
+
billingGroupId?: string;
|
|
119
121
|
};
|
|
120
122
|
type EndTripInfo = {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
vehicleId: string;
|
|
124
|
+
userId: string;
|
|
125
|
+
orderId: string;
|
|
124
126
|
};
|
|
125
127
|
type TripZone = {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
zoneId: string;
|
|
129
|
+
version: number;
|
|
130
|
+
type: string;
|
|
131
|
+
sticky: boolean;
|
|
130
132
|
};
|
|
131
133
|
type TripLocation = {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
latitude: number;
|
|
135
|
+
longitude: number;
|
|
134
136
|
};
|
|
135
137
|
type TripEvent = {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
eventType: string;
|
|
139
|
+
timestamp: string;
|
|
140
|
+
parameters: string | null;
|
|
139
141
|
};
|
|
140
142
|
type TripOverriddenInfo = {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
duration: {
|
|
144
|
+
adjustedBookDuration: number;
|
|
145
|
+
adjustedPauseDuration: number;
|
|
146
|
+
adjustedDrivingDuration: number;
|
|
147
|
+
};
|
|
146
148
|
};
|
|
147
149
|
type TripAdditionalInfo = {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
150
|
+
firstDriveDelayMinutes: number;
|
|
151
|
+
bookDuration: number;
|
|
152
|
+
startZones: TripZone[];
|
|
153
|
+
endZones: TripZone[];
|
|
154
|
+
isAutolock: boolean;
|
|
155
|
+
isCancel: boolean;
|
|
156
|
+
isReleaseOnServer: boolean;
|
|
157
|
+
isBilled: boolean;
|
|
158
|
+
suspicious: boolean;
|
|
159
|
+
startLocation: TripLocation;
|
|
160
|
+
endLocation: TripLocation;
|
|
161
|
+
overriddenTripInfo: TripOverriddenInfo;
|
|
162
|
+
bypassBookingRequestCompleted: boolean;
|
|
163
|
+
ignoreOdometer: boolean;
|
|
164
|
+
startTripEventDate: string;
|
|
163
165
|
};
|
|
164
166
|
type Trip = {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
167
|
+
id: string;
|
|
168
|
+
tripId: string;
|
|
169
|
+
fleetId: string;
|
|
170
|
+
userId: string;
|
|
171
|
+
profileId: string;
|
|
172
|
+
profileType: string;
|
|
173
|
+
vehicleId: string;
|
|
174
|
+
length: number;
|
|
175
|
+
duration: number;
|
|
176
|
+
pauseDuration: number;
|
|
177
|
+
tripDuration: number;
|
|
178
|
+
bookingDuration: number;
|
|
179
|
+
drivingDuration: number;
|
|
180
|
+
date: string;
|
|
181
|
+
endDate: string;
|
|
182
|
+
additionalInfo: TripAdditionalInfo;
|
|
183
|
+
pricingId: string;
|
|
184
|
+
productIds: string[];
|
|
185
|
+
serviceId: string;
|
|
186
|
+
serviceType: string;
|
|
187
|
+
theorStartDate: string;
|
|
188
|
+
theorEndDate: string;
|
|
189
|
+
ticketInfo: any;
|
|
190
|
+
tripEvents: TripEvent[];
|
|
191
|
+
lastUpdateDate: string;
|
|
190
192
|
};
|
|
191
|
-
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/endTrip.d.ts
|
|
192
195
|
declare const endTrip: (client: Client, info: EndTripInfo) => Promise<void>;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/getVehiclesBooked.d.ts
|
|
198
|
+
declare const optionsSchema: z$1.ZodObject<{
|
|
199
|
+
minDuration: z$1.ZodOptional<z$1.ZodNumber>;
|
|
200
|
+
boxStatus: z$1.ZodOptional<z$1.ZodArray<z$1.ZodNumber, "many">>;
|
|
201
|
+
}, "strip", z$1.ZodTypeAny, {
|
|
202
|
+
minDuration?: number | undefined;
|
|
203
|
+
boxStatus?: number[] | undefined;
|
|
200
204
|
}, {
|
|
201
|
-
|
|
202
|
-
|
|
205
|
+
minDuration?: number | undefined;
|
|
206
|
+
boxStatus?: number[] | undefined;
|
|
203
207
|
}>;
|
|
204
|
-
declare const getVehiclesBooked: (client: Client, options?: z.infer<typeof optionsSchema>) => Promise<FleetManagerBook[]>;
|
|
208
|
+
declare const getVehiclesBooked: (client: Client, options?: z$1.infer<typeof optionsSchema>) => Promise<FleetManagerBook[]>;
|
|
205
209
|
declare const getVehiclesBookedByUserId: (client: Client, userId: string) => Promise<FleetManagerBook[]>;
|
|
206
210
|
declare const getVehicleBookedByTripId: (client: Client, tripId: string) => Promise<FleetManagerBook | null>;
|
|
207
|
-
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/getTripById.d.ts
|
|
208
213
|
declare const getTripById: (client: Client, tripId: string) => Promise<Trip | Record<string, never>>;
|
|
209
|
-
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/getOngoingTripPaymentsByTripIds.d.ts
|
|
210
216
|
type PaymentReceipt = {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
217
|
+
id: string;
|
|
218
|
+
pspName: string;
|
|
219
|
+
pspReference: string;
|
|
220
|
+
pspPublishableKey: string;
|
|
221
|
+
amount: number;
|
|
222
|
+
currency: string;
|
|
223
|
+
date: string;
|
|
224
|
+
status: 'PAID' | 'REFUNDED';
|
|
225
|
+
paymentMethodType: string;
|
|
226
|
+
paymentMethodPspReference: string;
|
|
227
|
+
paymentIntentPspReference: string;
|
|
228
|
+
number: number;
|
|
229
|
+
code: string;
|
|
230
|
+
declineCode: string;
|
|
231
|
+
pspClientSecret: string;
|
|
232
|
+
reason: string;
|
|
233
|
+
note: string;
|
|
228
234
|
};
|
|
229
235
|
type Payment = {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
+
paymentReceipts?: PaymentReceipt[];
|
|
237
|
+
id: string;
|
|
238
|
+
fleetId: string;
|
|
239
|
+
profileId: UUID;
|
|
240
|
+
vehicleId: UUID;
|
|
241
|
+
serviceId: UUID;
|
|
236
242
|
};
|
|
237
243
|
declare const getOngoingTripPaymentsByTripIds: (client: Client, tripIds: string[]) => Promise<Payment[]>;
|
|
238
|
-
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/getTrips.d.ts
|
|
239
246
|
declare const getTripsByUserId: (client: Client, userId: string, options?: PaginableOptions<void, "date">) => Promise<PaginableResponse<Trip>>;
|
|
240
|
-
|
|
241
|
-
export {
|
|
247
|
+
//#endregion
|
|
248
|
+
export { EndTripInfo, FleetManagerBook, Payment, PaymentReceipt, Trip, TripAdditionalInfo, TripEvent, TripLocation, TripOverriddenInfo, TripZone, Zone, addTripRelatedProduct, endTrip, getOngoingTripPaymentsByTripIds, getTripById, getTripsByUserId, getVehicleBookedByTripId, getVehiclesBooked, getVehiclesBookedByUserId, removeTripRelatedProduct };
|