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