@vulog/aima-vehicle 1.2.30 → 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,244 +1,212 @@
1
- import { Client } from '@vulog/aima-client';
2
- import { PaginableOptions, PaginableResponse } from '@vulog/aima-core';
1
+ import { PaginableOptions, PaginableResponse } from "@vulog/aima-core";
2
+ import { Client } from "@vulog/aima-client";
3
3
 
4
+ //#region src/types.d.ts
4
5
  /**
5
6
  * Represents a vehicle model with its specifications and characteristics
6
7
  */
7
8
  type Model = {
8
- /** Unique identifier of the model */
9
- id: number;
10
- /** Name of the model (e.g., "C-Zero") */
11
- name: string;
12
- /** Type of energy used by the vehicle (e.g., "ELECTRIC") */
13
- energyType: string;
14
- /** Current status of the model (e.g., "ACTIVE") */
15
- status: string;
16
- /** Number of seats in the vehicle */
17
- nbOfSeats: number;
18
- /** Maximum range/autonomy of the vehicle in kilometers */
19
- autonomy: number;
20
- /** Date when the model was created */
21
- creationDate: string;
22
- /** Date when the model was last updated */
23
- updateDate: string;
24
- /** Description of the model (e.g., brand name) */
25
- description: string;
26
- /** ID of the fleet this model belongs to */
27
- fleetId: string;
28
- /** Type of vehicle (e.g., "CAR") */
29
- vehicleType: string;
30
- /** Type of transmission (e.g., "UNDEFINED") */
31
- transmission: string;
32
- /** Range threshold for out of service status */
33
- outOfServiceRange: string;
34
- /** Range threshold for recovery */
35
- recoveryRange: string;
36
- /** Array of incentive thresholds */
37
- incentiveThresholds: any[];
38
- /** Range threshold for vehicle redistribution */
39
- redistributeVehicleChargedEnoughRange: string;
40
- /** Indicates if the odometer readings are reliable */
41
- odometerReliable?: boolean;
42
- [key: string]: any;
9
+ /** Unique identifier of the model */id: number; /** Name of the model (e.g., "C-Zero") */
10
+ name: string; /** Type of energy used by the vehicle (e.g., "ELECTRIC") */
11
+ energyType: string; /** Current status of the model (e.g., "ACTIVE") */
12
+ status: string; /** Number of seats in the vehicle */
13
+ nbOfSeats: number; /** Maximum range/autonomy of the vehicle in kilometers */
14
+ autonomy: number; /** Date when the model was created */
15
+ creationDate: string; /** Date when the model was last updated */
16
+ updateDate: string; /** Description of the model (e.g., brand name) */
17
+ description: string; /** ID of the fleet this model belongs to */
18
+ fleetId: string; /** Type of vehicle (e.g., "CAR") */
19
+ vehicleType: string; /** Type of transmission (e.g., "UNDEFINED") */
20
+ transmission: string; /** Range threshold for out of service status */
21
+ outOfServiceRange: string; /** Range threshold for recovery */
22
+ recoveryRange: string; /** Array of incentive thresholds */
23
+ incentiveThresholds: any[]; /** Range threshold for vehicle redistribution */
24
+ redistributeVehicleChargedEnoughRange: string; /** Indicates if the odometer readings are reliable */
25
+ odometerReliable?: boolean;
26
+ [key: string]: any;
43
27
  };
44
28
  /**
45
29
  * Represents a vehicle in the system
46
30
  */
47
31
  type Vehicle = {
48
- /** Unique identifier of the vehicle */
49
- id: string;
50
- /** Name of the vehicle */
51
- name: string;
52
- /** License plate number */
53
- plate: string;
54
- /** Vehicle Identification Number */
55
- vin: string;
56
- /** Model information of the vehicle */
57
- model: Model;
58
- /** List of options/features installed on the vehicle */
59
- options: Options[];
60
- /** Date when the vehicle was created */
61
- createDate: string;
62
- /** Date when the vehicle was last updated */
63
- updateDate: string;
64
- /** ID of the fleet this vehicle belongs to */
65
- fleetId: string;
66
- /** External system identifier */
67
- externalId: string;
68
- /** Provider used for vehicle wakeup */
69
- wakeupProvider?: string;
70
- /** Mobile Subscriber Integrated Services Digital Network Number */
71
- msisdn: string;
72
- /** Integrated Circuit Card Identifier */
73
- iccid: string;
74
- /** International Mobile Subscriber Identity */
75
- imsi?: string;
76
- /** Whether the vehicle is published in the system */
77
- published: boolean;
78
- /** Whether the vehicle has no box installed */
79
- noBox: boolean;
80
- /** Whether the vehicle is archived */
81
- archived: boolean;
82
- [key: string]: any;
32
+ /** Unique identifier of the vehicle */id: string; /** Name of the vehicle */
33
+ name: string; /** License plate number */
34
+ plate: string; /** Vehicle Identification Number */
35
+ vin: string; /** Model information of the vehicle */
36
+ model: Model; /** List of options/features installed on the vehicle */
37
+ options: Options[]; /** Date when the vehicle was created */
38
+ createDate: string; /** Date when the vehicle was last updated */
39
+ updateDate: string; /** ID of the fleet this vehicle belongs to */
40
+ fleetId: string; /** External system identifier */
41
+ externalId: string; /** Provider used for vehicle wakeup */
42
+ wakeupProvider?: string; /** Mobile Subscriber Integrated Services Digital Network Number */
43
+ msisdn: string; /** Integrated Circuit Card Identifier */
44
+ iccid: string; /** International Mobile Subscriber Identity */
45
+ imsi?: string; /** Whether the vehicle is published in the system */
46
+ published: boolean; /** Whether the vehicle has no box installed */
47
+ noBox: boolean; /** Whether the vehicle is archived */
48
+ archived: boolean;
49
+ [key: string]: any;
83
50
  };
84
51
  /**
85
52
  * Represents a vehicle option or feature
86
53
  */
87
54
  type Options = {
88
- /** Unique identifier of the option */
89
- id: number;
90
- /** ID of the fleet this option belongs to */
91
- fleetId: string;
92
- /** Name of the option */
93
- name: string;
94
- /** Type of the option (e.g., "Color", "Gearbox") */
95
- type: string;
96
- /** Description of the option */
97
- description: string;
98
- [key: string]: any;
55
+ /** Unique identifier of the option */id: number; /** ID of the fleet this option belongs to */
56
+ fleetId: string; /** Name of the option */
57
+ name: string; /** Type of the option (e.g., "Color", "Gearbox") */
58
+ type: string; /** Description of the option */
59
+ description: string;
60
+ [key: string]: any;
99
61
  };
100
62
  type Zone = {
101
- type: string;
102
- version: number;
103
- zoneId: string;
104
- sticky: boolean;
105
- labels: {
106
- labelId: string;
107
- name: string;
108
- publicName: string;
109
- }[];
63
+ type: string;
64
+ version: number;
65
+ zoneId: string;
66
+ sticky: boolean;
67
+ labels: {
68
+ labelId: string;
69
+ name: string;
70
+ publicName: string;
71
+ }[];
110
72
  };
111
73
  type VehicleRealTime = {
112
- id: string;
113
- name: string;
114
- plate: string;
115
- vin: string;
116
- fleetid: string;
117
- currentFleetId: string;
118
- ownerFleetId: string;
119
- boxid: string;
120
- vehicle_status: number;
121
- zones: Zone[];
122
- releasable: boolean;
123
- box_status: number;
124
- autonomy: number;
125
- autonomy2: number;
126
- isCharging: boolean;
127
- battery: number;
128
- km: number;
129
- speed: number;
130
- location: {
131
- geohash: string;
132
- cap: number;
133
- latitude: number;
134
- longitude: number;
135
- gpsDate: string;
136
- lastMovingDate: string;
137
- };
138
- endTripLocation: {
139
- latitude: number;
140
- longitude: number;
141
- };
142
- endZoneIds: [];
143
- productIds: [];
144
- isDoorClosed: boolean;
145
- isDoorLocked: boolean;
146
- engineOn: boolean;
147
- immobilizerOn: boolean;
148
- secureOn: boolean;
149
- spareLockOn: boolean | null;
150
- pileLockOn: boolean | null;
151
- helmetPresent: boolean | null;
152
- helmet2Present: boolean | null;
153
- helmetBoxLockOn: boolean | null;
154
- helmet2LockOn: boolean | null;
155
- userId: string | null;
156
- user_locale: string | null;
157
- rfid: string | null;
158
- orderId: string | null;
159
- gatewayUrl: string | null;
160
- booking_status: number;
161
- booking_date: string | null;
162
- expiresOn: boolean | null;
163
- last_active_date: string;
164
- last_wakeUp_date: string;
165
- version: string;
166
- pricingId: string | null;
167
- start_date: string | null;
168
- theorStartDate: string | null;
169
- theorEndDate: string | null;
170
- startZones: Zone[];
171
- endZones: Zone[];
172
- disabled: boolean;
173
- outOfServiceReason: string;
174
- ignitionOffGeohash: string | null;
175
- geohashNeighbours: string[];
176
- cleanlinessStatus: boolean;
177
- needsRedistribution: boolean;
178
- batteryUnderThreshold: boolean;
179
- isBeingTowed: boolean;
180
- automaticallyEnableVehicleAfterRangeRecovery: boolean;
181
- key: {
182
- deviceName: string;
183
- };
184
- doNotTrack: boolean;
185
- energyLevel: number;
186
- lastOosDate: string;
187
- hasAlerts: boolean;
188
- firmwareModel: string;
189
- comeFromApp: string;
190
- doors: {
191
- frontLeftClosed: boolean;
192
- frontRightClosed: boolean;
193
- rearLeftClosed: boolean;
194
- rearRightClosed: boolean;
195
- trunkClosed: boolean;
196
- hoodClosed: boolean;
197
- };
198
- windows: {
199
- frontLeftClosed: boolean;
200
- frontRightClosed: boolean;
201
- rearLeftClosed: boolean;
202
- rearRightClosed: boolean;
203
- trunkClosed: boolean;
204
- };
205
- doorsAndWindowsClosed: boolean;
206
- vpChecksum: string;
207
- firmwareBuildDate: string;
208
- [key: string]: any;
74
+ id: string;
75
+ name: string;
76
+ plate: string;
77
+ vin: string;
78
+ fleetid: string;
79
+ currentFleetId: string;
80
+ ownerFleetId: string;
81
+ boxid: string;
82
+ vehicle_status: number;
83
+ zones: Zone[];
84
+ releasable: boolean;
85
+ box_status: number;
86
+ autonomy: number;
87
+ autonomy2: number;
88
+ isCharging: boolean;
89
+ battery: number;
90
+ km: number;
91
+ speed: number;
92
+ location: {
93
+ geohash: string;
94
+ cap: number;
95
+ latitude: number;
96
+ longitude: number;
97
+ gpsDate: string;
98
+ lastMovingDate: string;
99
+ };
100
+ endTripLocation: {
101
+ latitude: number;
102
+ longitude: number;
103
+ };
104
+ endZoneIds: [];
105
+ productIds: [];
106
+ isDoorClosed: boolean;
107
+ isDoorLocked: boolean;
108
+ engineOn: boolean;
109
+ immobilizerOn: boolean;
110
+ secureOn: boolean;
111
+ spareLockOn: boolean | null;
112
+ pileLockOn: boolean | null;
113
+ helmetPresent: boolean | null;
114
+ helmet2Present: boolean | null;
115
+ helmetBoxLockOn: boolean | null;
116
+ helmet2LockOn: boolean | null;
117
+ userId: string | null;
118
+ user_locale: string | null;
119
+ rfid: string | null;
120
+ orderId: string | null;
121
+ gatewayUrl: string | null;
122
+ booking_status: number;
123
+ booking_date: string | null;
124
+ expiresOn: boolean | null;
125
+ last_active_date: string;
126
+ last_wakeUp_date: string;
127
+ version: string;
128
+ pricingId: string | null;
129
+ start_date: string | null;
130
+ theorStartDate: string | null;
131
+ theorEndDate: string | null;
132
+ startZones: Zone[];
133
+ endZones: Zone[];
134
+ disabled: boolean;
135
+ outOfServiceReason: string;
136
+ ignitionOffGeohash: string | null;
137
+ geohashNeighbours: string[];
138
+ cleanlinessStatus: boolean;
139
+ needsRedistribution: boolean;
140
+ batteryUnderThreshold: boolean;
141
+ isBeingTowed: boolean;
142
+ automaticallyEnableVehicleAfterRangeRecovery: boolean;
143
+ key: {
144
+ deviceName: string;
145
+ };
146
+ doNotTrack: boolean;
147
+ energyLevel: number;
148
+ lastOosDate: string;
149
+ hasAlerts: boolean;
150
+ firmwareModel: string;
151
+ comeFromApp: string;
152
+ doors: {
153
+ frontLeftClosed: boolean;
154
+ frontRightClosed: boolean;
155
+ rearLeftClosed: boolean;
156
+ rearRightClosed: boolean;
157
+ trunkClosed: boolean;
158
+ hoodClosed: boolean;
159
+ };
160
+ windows: {
161
+ frontLeftClosed: boolean;
162
+ frontRightClosed: boolean;
163
+ rearLeftClosed: boolean;
164
+ rearRightClosed: boolean;
165
+ trunkClosed: boolean;
166
+ };
167
+ doorsAndWindowsClosed: boolean;
168
+ vpChecksum: string;
169
+ firmwareBuildDate: string;
170
+ [key: string]: any;
209
171
  };
210
172
  type Assets = {
211
- fleet_id: string;
212
- model_id: number;
213
- assets: {
214
- aid: string;
215
- type: string;
216
- url: string | null;
217
- value: number | null;
218
- b_value: boolean | null;
219
- text: string | null;
220
- [key: string]: any;
221
- }[];
173
+ fleet_id: string;
174
+ model_id: number;
175
+ assets: {
176
+ aid: string;
177
+ type: string;
178
+ url: string | null;
179
+ value: number | null;
180
+ b_value: boolean | null;
181
+ text: string | null;
222
182
  [key: string]: any;
183
+ }[];
184
+ [key: string]: any;
223
185
  };
224
186
  type ModelVehicle = {
225
- serviceId: string;
226
- serviceVisibility: 'PUBLIC' | 'PRIVATE';
227
- modelId: number;
228
- vehicles: string[];
187
+ serviceId: string;
188
+ serviceVisibility: 'PUBLIC' | 'PRIVATE';
189
+ modelId: number;
190
+ vehicles: string[];
229
191
  };
230
-
192
+ //#endregion
193
+ //#region src/getModel.d.ts
231
194
  declare const getModelsById: (client: Client, id: number) => Promise<Model>;
232
-
195
+ //#endregion
196
+ //#region src/getModelAssets.d.ts
233
197
  declare const getModelByIdAssets: (client: Client, id: number) => Promise<Assets>;
234
-
198
+ //#endregion
199
+ //#region src/getModels.d.ts
235
200
  declare const getModels: (client: Client) => Promise<Model[]>;
236
-
201
+ //#endregion
202
+ //#region src/getVehicle.d.ts
237
203
  declare const getVehicleById: (client: Client, id: string) => Promise<Vehicle | null>;
238
204
  declare const getVehicleRealTimeById: (client: Client, id: string) => Promise<VehicleRealTime | null>;
239
-
205
+ //#endregion
206
+ //#region src/getVehicleAssets.d.ts
240
207
  declare const getVehicleByIdAssets: (client: Client, id: string) => Promise<Assets>;
241
-
208
+ //#endregion
209
+ //#region src/getVehicles.d.ts
242
210
  /**
243
211
  * Fetches all vehicles from the API using pagination
244
212
  * @param client - The AIMA client instance
@@ -257,24 +225,49 @@ declare const getVehicles: (client: Client, pageSize?: number) => Promise<Vehicl
257
225
  * @throws Error if lastUpdatedMillis is in the future
258
226
  */
259
227
  declare const getVehiclesRealTime: (client: Client, pageSize?: number, lastUpdatedMillis?: number) => Promise<VehicleRealTime[]>;
260
-
228
+ //#endregion
229
+ //#region src/pingVehicle.d.ts
261
230
  /**
262
231
  * Pings a vehicle to check if it is alive (box connected).
263
232
  * Returns true if alive (HTTP 200), false if box not connected (code 410, codeStr 'carConnectionProblem'),
264
233
  * throws for other errors or invalid id.
265
234
  */
266
235
  declare const pingVehicleById: (client: Client, id: string) => Promise<boolean>;
267
-
236
+ //#endregion
237
+ //#region src/enableVehicle.d.ts
268
238
  type EnableVehicleBody = {
269
- subStatus: string;
239
+ subStatus: string;
270
240
  };
271
241
  declare const enableVehicle: (client: Client, vehicleId: string, payload: EnableVehicleBody) => Promise<void>;
272
-
242
+ //#endregion
243
+ //#region src/disableVehicle.d.ts
273
244
  type DisableVehicleBody = {
274
- subStatus: string;
245
+ subStatus: string;
275
246
  };
276
247
  declare const disableVehicle: (client: Client, vehicleId: string, payload: DisableVehicleBody) => Promise<void>;
277
-
248
+ //#endregion
249
+ //#region src/getModelVehicles.d.ts
278
250
  declare const getModelVehicles: (client: Client, options?: PaginableOptions) => Promise<PaginableResponse<ModelVehicle>>;
279
-
280
- export { type Assets, type DisableVehicleBody, type EnableVehicleBody, type Model, type ModelVehicle, type Options, type Vehicle, type VehicleRealTime, type Zone, disableVehicle, enableVehicle, getModelByIdAssets, getModelVehicles, getModels, getModelsById, getVehicleById, getVehicleByIdAssets, getVehicleRealTimeById, getVehicles, getVehiclesRealTime, pingVehicleById };
251
+ //#endregion
252
+ //#region src/createVehicle.d.ts
253
+ type CreateVehicleBody = {
254
+ vin: string;
255
+ plate: string;
256
+ name: string;
257
+ model: {
258
+ id: number;
259
+ };
260
+ vuboxId?: string;
261
+ externalId?: string;
262
+ wakeupProvider?: string;
263
+ noBox?: boolean;
264
+ published?: boolean;
265
+ archived?: boolean;
266
+ msisdn?: string;
267
+ iccid?: string;
268
+ imsi?: string;
269
+ residualValue?: number;
270
+ };
271
+ declare const createVehicle: (client: Client, body: CreateVehicleBody) => Promise<Vehicle>;
272
+ //#endregion
273
+ export { Assets, CreateVehicleBody, DisableVehicleBody, EnableVehicleBody, Model, ModelVehicle, Options, Vehicle, VehicleRealTime, Zone, createVehicle, disableVehicle, enableVehicle, getModelByIdAssets, getModelVehicles, getModels, getModelsById, getVehicleById, getVehicleByIdAssets, getVehicleRealTimeById, getVehicles, getVehiclesRealTime, pingVehicleById };