@vulog/aima-vehicle 1.2.33 → 1.2.34

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.
Files changed (2) hide show
  1. package/README.md +89 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -98,6 +98,95 @@ const updatedVehiclesPage = await getVehiclesRealTimePage(client, 0, 100, lastSy
98
98
 
99
99
  Note: `getVehiclesRealTimePage` is an internal function and is not exported from the package. It's used internally by `getVehiclesRealTime` to handle the pagination logic.
100
100
 
101
+ ### Create a Vehicle
102
+
103
+ Creates a new vehicle in the fleet.
104
+
105
+ ```javascript
106
+ import { createVehicle } from '@vulog/aima-vehicle';
107
+
108
+ const vehicle = await createVehicle(client, {
109
+ vin: '1HGBH41JXMN109186',
110
+ plate: 'AB-123-CD',
111
+ name: 'My Vehicle',
112
+ model: { id: 372 },
113
+ // optional fields
114
+ vuboxId: 'vubox-123',
115
+ externalId: 'ext-123',
116
+ noBox: false,
117
+ published: true,
118
+ });
119
+ ```
120
+
121
+ ### Get Options
122
+
123
+ Fetches all vehicle options available in the fleet.
124
+
125
+ ```javascript
126
+ import { getOptions } from '@vulog/aima-vehicle';
127
+
128
+ const options = await getOptions(client);
129
+ ```
130
+
131
+ ### Add / Remove Option for Vehicle
132
+
133
+ Add or remove an option to/from a vehicle.
134
+
135
+ ```javascript
136
+ import { addOptionForVehicle, removeOptionForVehicle } from '@vulog/aima-vehicle';
137
+
138
+ const vehicle = await addOptionForVehicle(client, 'vehicle-uuid', 25);
139
+ const vehicle = await removeOptionForVehicle(client, 'vehicle-uuid', 25);
140
+ ```
141
+
142
+ ### Add / Remove Service for Vehicle
143
+
144
+ Add or remove a service to/from a vehicle.
145
+
146
+ ```javascript
147
+ import { addServiceForVehicle, removeServiceForVehicle } from '@vulog/aima-vehicle';
148
+
149
+ await addServiceForVehicle(client, 'service-uuid', 'vehicle-uuid');
150
+ await removeServiceForVehicle(client, 'service-uuid', 'vehicle-uuid');
151
+ ```
152
+
153
+ ### Enable / Disable Vehicle
154
+
155
+ Enable or disable a vehicle with a sub-status.
156
+
157
+ ```javascript
158
+ import { enableVehicle, disableVehicle } from '@vulog/aima-vehicle';
159
+
160
+ await enableVehicle(client, 'vehicle-uuid', { subStatus: 'AVAILABLE' });
161
+ await disableVehicle(client, 'vehicle-uuid', { subStatus: 'MAINTENANCE' });
162
+ ```
163
+
164
+ ### Ping Vehicle
165
+
166
+ Check if a vehicle box is connected.
167
+
168
+ ```javascript
169
+ import { pingVehicleById } from '@vulog/aima-vehicle';
170
+
171
+ const isConnected = await pingVehicleById(client, 'vehicle-uuid');
172
+ // true = connected, false = connection problem
173
+ ```
174
+
175
+ ### Get Model Vehicles
176
+
177
+ Fetches paginated model vehicle listings.
178
+
179
+ ```javascript
180
+ import { getModelVehicles } from '@vulog/aima-vehicle';
181
+
182
+ const result = await getModelVehicles(client, {
183
+ page: 0,
184
+ pageSize: 50,
185
+ sort: 'modelId',
186
+ sortDirection: 'DESC',
187
+ });
188
+ ```
189
+
101
190
  ## Types
102
191
 
103
192
  ### Vehicle
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vulog/aima-vehicle",
3
3
  "type": "module",
4
- "version": "1.2.33",
4
+ "version": "1.2.34",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.cts",
@@ -32,8 +32,8 @@
32
32
  "author": "Vulog",
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@vulog/aima-client": "1.2.33",
36
- "@vulog/aima-core": "1.2.33"
35
+ "@vulog/aima-client": "1.2.34",
36
+ "@vulog/aima-core": "1.2.34"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "zod": "^3.25.76"