@vulog/aima-vehicle 1.2.49 → 1.2.50
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 +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +3 -3
- package/src/getVehicle.ts +1 -1
- package/src/getVehicleAssets.ts +1 -1
- package/src/linkRfidCardToVehicle.ts +1 -1
- package/src/pingVehicle.ts +1 -1
- package/src/vehicleOption.ts +1 -1
- package/src/vehicleService.ts +1 -1
- package/src/wakeUpVehicle.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20,7 +20,7 @@ const getModels = async (client) => {
|
|
|
20
20
|
};
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/getVehicle.ts
|
|
23
|
-
const schema$6 = zod.z.object({ id: zod.z.string().trim().min(1).
|
|
23
|
+
const schema$6 = zod.z.object({ id: zod.z.string().trim().min(1).guid() });
|
|
24
24
|
const getVehicleById = async (client, id) => {
|
|
25
25
|
const result = schema$6.safeParse({ id });
|
|
26
26
|
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
@@ -39,7 +39,7 @@ const getVehicleRealTimeById = async (client, id) => {
|
|
|
39
39
|
};
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/getVehicleAssets.ts
|
|
42
|
-
const schema$5 = zod.z.object({ id: zod.z.string().
|
|
42
|
+
const schema$5 = zod.z.object({ id: zod.z.string().guid() });
|
|
43
43
|
const getVehicleByIdAssets = async (client, id) => {
|
|
44
44
|
const result = schema$5.safeParse({ id });
|
|
45
45
|
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
@@ -132,7 +132,7 @@ const getVehiclesRealTime = async (client, pageSize = 500, lastUpdatedMillis) =>
|
|
|
132
132
|
};
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/pingVehicle.ts
|
|
135
|
-
const schema$4 = zod.z.object({ id: zod.z.string().trim().min(1).
|
|
135
|
+
const schema$4 = zod.z.object({ id: zod.z.string().trim().min(1).guid() });
|
|
136
136
|
/**
|
|
137
137
|
* Pings a vehicle to check if it is alive (box connected).
|
|
138
138
|
* Returns true if alive (HTTP 200), false if box not connected (code 410, codeStr 'carConnectionProblem'),
|
|
@@ -278,7 +278,7 @@ const getRfidCards = async (client, pageSize = 500) => {
|
|
|
278
278
|
//#endregion
|
|
279
279
|
//#region src/linkRfidCardToVehicle.ts
|
|
280
280
|
const schema = zod.z.object({
|
|
281
|
-
vehicleId: zod.z.string().trim().min(1).
|
|
281
|
+
vehicleId: zod.z.string().trim().min(1).guid(),
|
|
282
282
|
tag: zod.z.string().trim().min(1)
|
|
283
283
|
});
|
|
284
284
|
const linkRfidCardToVehicle = async (client, vehicleId, tag) => {
|
|
@@ -291,7 +291,7 @@ const linkRfidCardToVehicle = async (client, vehicleId, tag) => {
|
|
|
291
291
|
};
|
|
292
292
|
//#endregion
|
|
293
293
|
//#region src/vehicleService.ts
|
|
294
|
-
const uuidSchema$1 = zod.z.string().trim().min(1).
|
|
294
|
+
const uuidSchema$1 = zod.z.string().trim().min(1).guid();
|
|
295
295
|
const addServiceForVehicle = async (client, serviceId, vehicleId) => {
|
|
296
296
|
const parsedServiceId = uuidSchema$1.safeParse(serviceId);
|
|
297
297
|
const parsedVehicleId = uuidSchema$1.safeParse(vehicleId);
|
|
@@ -311,7 +311,7 @@ const getOptions = async (client) => {
|
|
|
311
311
|
};
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/vehicleOption.ts
|
|
314
|
-
const uuidSchema = zod.z.string().trim().min(1).
|
|
314
|
+
const uuidSchema = zod.z.string().trim().min(1).guid();
|
|
315
315
|
const optionIdSchema = zod.z.number().int().positive();
|
|
316
316
|
const addOptionForVehicle = async (client, vehicleId, optionId) => {
|
|
317
317
|
const parsedVehicleId = uuidSchema.safeParse(vehicleId);
|
package/dist/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ const getModels = async (client) => {
|
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/getVehicle.ts
|
|
22
|
-
const schema$6 = z.object({ id: z.string().trim().min(1).
|
|
22
|
+
const schema$6 = z.object({ id: z.string().trim().min(1).guid() });
|
|
23
23
|
const getVehicleById = async (client, id) => {
|
|
24
24
|
const result = schema$6.safeParse({ id });
|
|
25
25
|
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
@@ -38,7 +38,7 @@ const getVehicleRealTimeById = async (client, id) => {
|
|
|
38
38
|
};
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/getVehicleAssets.ts
|
|
41
|
-
const schema$5 = z.object({ id: z.string().
|
|
41
|
+
const schema$5 = z.object({ id: z.string().guid() });
|
|
42
42
|
const getVehicleByIdAssets = async (client, id) => {
|
|
43
43
|
const result = schema$5.safeParse({ id });
|
|
44
44
|
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
@@ -131,7 +131,7 @@ const getVehiclesRealTime = async (client, pageSize = 500, lastUpdatedMillis) =>
|
|
|
131
131
|
};
|
|
132
132
|
//#endregion
|
|
133
133
|
//#region src/pingVehicle.ts
|
|
134
|
-
const schema$4 = z.object({ id: z.string().trim().min(1).
|
|
134
|
+
const schema$4 = z.object({ id: z.string().trim().min(1).guid() });
|
|
135
135
|
/**
|
|
136
136
|
* Pings a vehicle to check if it is alive (box connected).
|
|
137
137
|
* Returns true if alive (HTTP 200), false if box not connected (code 410, codeStr 'carConnectionProblem'),
|
|
@@ -277,7 +277,7 @@ const getRfidCards = async (client, pageSize = 500) => {
|
|
|
277
277
|
//#endregion
|
|
278
278
|
//#region src/linkRfidCardToVehicle.ts
|
|
279
279
|
const schema = z.object({
|
|
280
|
-
vehicleId: z.string().trim().min(1).
|
|
280
|
+
vehicleId: z.string().trim().min(1).guid(),
|
|
281
281
|
tag: z.string().trim().min(1)
|
|
282
282
|
});
|
|
283
283
|
const linkRfidCardToVehicle = async (client, vehicleId, tag) => {
|
|
@@ -290,7 +290,7 @@ const linkRfidCardToVehicle = async (client, vehicleId, tag) => {
|
|
|
290
290
|
};
|
|
291
291
|
//#endregion
|
|
292
292
|
//#region src/vehicleService.ts
|
|
293
|
-
const uuidSchema$1 = z.string().trim().min(1).
|
|
293
|
+
const uuidSchema$1 = z.string().trim().min(1).guid();
|
|
294
294
|
const addServiceForVehicle = async (client, serviceId, vehicleId) => {
|
|
295
295
|
const parsedServiceId = uuidSchema$1.safeParse(serviceId);
|
|
296
296
|
const parsedVehicleId = uuidSchema$1.safeParse(vehicleId);
|
|
@@ -310,7 +310,7 @@ const getOptions = async (client) => {
|
|
|
310
310
|
};
|
|
311
311
|
//#endregion
|
|
312
312
|
//#region src/vehicleOption.ts
|
|
313
|
-
const uuidSchema = z.string().trim().min(1).
|
|
313
|
+
const uuidSchema = z.string().trim().min(1).guid();
|
|
314
314
|
const optionIdSchema = z.number().int().positive();
|
|
315
315
|
const addOptionForVehicle = async (client, vehicleId, optionId) => {
|
|
316
316
|
const parsedVehicleId = uuidSchema.safeParse(vehicleId);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulog/aima-vehicle",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.50",
|
|
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.
|
|
36
|
-
"@vulog/aima-core": "1.2.
|
|
35
|
+
"@vulog/aima-client": "1.2.50",
|
|
36
|
+
"@vulog/aima-core": "1.2.50"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"zod": "^4.3.6"
|
package/src/getVehicle.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
import { Vehicle, VehicleRealTime } from './types';
|
|
5
5
|
|
|
6
6
|
const schema = z.object({
|
|
7
|
-
id: z.string().trim().min(1).
|
|
7
|
+
id: z.string().trim().min(1).guid(),
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
export const getVehicleById = async (client: Client, id: string) => {
|
package/src/getVehicleAssets.ts
CHANGED
package/src/pingVehicle.ts
CHANGED
package/src/vehicleOption.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
|
|
4
4
|
import { Vehicle } from './types';
|
|
5
5
|
|
|
6
|
-
const uuidSchema = z.string().trim().min(1).
|
|
6
|
+
const uuidSchema = z.string().trim().min(1).guid();
|
|
7
7
|
const optionIdSchema = z.number().int().positive();
|
|
8
8
|
|
|
9
9
|
export const addOptionForVehicle = async (client: Client, vehicleId: string, optionId: number): Promise<Vehicle> => {
|
package/src/vehicleService.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Client } from '@vulog/aima-client';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
const uuidSchema = z.string().trim().min(1).
|
|
4
|
+
const uuidSchema = z.string().trim().min(1).guid();
|
|
5
5
|
|
|
6
6
|
export const addServiceForVehicle = async (client: Client, serviceId: string, vehicleId: string): Promise<void> => {
|
|
7
7
|
const parsedServiceId = uuidSchema.safeParse(serviceId);
|