@vulog/aima-vehicle 1.2.38 → 1.2.39
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 +3 -26
- package/dist/index.mjs +4 -4
- package/package.json +5 -5
- package/src/disableVehicle.ts +1 -1
- package/src/enableVehicle.ts +1 -1
- package/src/getModelVehicles.ts +2 -2
- package/tsconfig.json +1 -8
- package/vitest.config.ts +1 -8
package/dist/index.cjs
CHANGED
|
@@ -1,28 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
//#region \0rolldown/runtime.js
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
-
get: ((k) => from[k]).bind(null, key),
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
-
value: mod,
|
|
21
|
-
enumerable: true
|
|
22
|
-
}) : target, mod));
|
|
23
|
-
//#endregion
|
|
24
2
|
let zod = require("zod");
|
|
25
|
-
zod = __toESM(zod);
|
|
26
3
|
let _vulog_aima_core = require("@vulog/aima-core");
|
|
27
4
|
//#region src/getModel.ts
|
|
28
5
|
const getModelsById = async (client, id) => {
|
|
@@ -174,7 +151,7 @@ const pingVehicleById = async (client, id) => {
|
|
|
174
151
|
};
|
|
175
152
|
//#endregion
|
|
176
153
|
//#region src/enableVehicle.ts
|
|
177
|
-
const schema$1 = zod.
|
|
154
|
+
const schema$1 = zod.z.object({ subStatus: zod.z.string() });
|
|
178
155
|
const enableVehicle = async (client, vehicleId, payload) => {
|
|
179
156
|
const result = schema$1.safeParse(payload);
|
|
180
157
|
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
@@ -182,7 +159,7 @@ const enableVehicle = async (client, vehicleId, payload) => {
|
|
|
182
159
|
};
|
|
183
160
|
//#endregion
|
|
184
161
|
//#region src/disableVehicle.ts
|
|
185
|
-
const schema = zod.
|
|
162
|
+
const schema = zod.z.object({ subStatus: zod.z.string() });
|
|
186
163
|
const disableVehicle = async (client, vehicleId, payload) => {
|
|
187
164
|
const result = schema.safeParse(payload);
|
|
188
165
|
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
@@ -191,7 +168,7 @@ const disableVehicle = async (client, vehicleId, payload) => {
|
|
|
191
168
|
//#endregion
|
|
192
169
|
//#region src/getModelVehicles.ts
|
|
193
170
|
const getModelVehicles = async (client, options) => {
|
|
194
|
-
const resultOptions = (0, _vulog_aima_core.createPaginableOptionsSchema)().
|
|
171
|
+
const resultOptions = (0, _vulog_aima_core.createPaginableOptionsSchema)().safeParse(options ?? {});
|
|
195
172
|
if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
|
|
196
173
|
const finalOptions = resultOptions.data;
|
|
197
174
|
const searchParams = new URLSearchParams();
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
import { createPaginableOptionsSchema } from "@vulog/aima-core";
|
|
3
3
|
//#region src/getModel.ts
|
|
4
4
|
const getModelsById = async (client, id) => {
|
|
@@ -150,7 +150,7 @@ const pingVehicleById = async (client, id) => {
|
|
|
150
150
|
};
|
|
151
151
|
//#endregion
|
|
152
152
|
//#region src/enableVehicle.ts
|
|
153
|
-
const schema$1 = z
|
|
153
|
+
const schema$1 = z.object({ subStatus: z.string() });
|
|
154
154
|
const enableVehicle = async (client, vehicleId, payload) => {
|
|
155
155
|
const result = schema$1.safeParse(payload);
|
|
156
156
|
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
@@ -158,7 +158,7 @@ const enableVehicle = async (client, vehicleId, payload) => {
|
|
|
158
158
|
};
|
|
159
159
|
//#endregion
|
|
160
160
|
//#region src/disableVehicle.ts
|
|
161
|
-
const schema = z
|
|
161
|
+
const schema = z.object({ subStatus: z.string() });
|
|
162
162
|
const disableVehicle = async (client, vehicleId, payload) => {
|
|
163
163
|
const result = schema.safeParse(payload);
|
|
164
164
|
if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
|
|
@@ -167,7 +167,7 @@ const disableVehicle = async (client, vehicleId, payload) => {
|
|
|
167
167
|
//#endregion
|
|
168
168
|
//#region src/getModelVehicles.ts
|
|
169
169
|
const getModelVehicles = async (client, options) => {
|
|
170
|
-
const resultOptions = createPaginableOptionsSchema().
|
|
170
|
+
const resultOptions = createPaginableOptionsSchema().safeParse(options ?? {});
|
|
171
171
|
if (!resultOptions.success) throw new TypeError("Invalid options", { cause: resultOptions.error.issues });
|
|
172
172
|
const finalOptions = resultOptions.data;
|
|
173
173
|
const searchParams = new URLSearchParams();
|
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.39",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.cts",
|
|
@@ -32,11 +32,11 @@
|
|
|
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.39",
|
|
36
|
+
"@vulog/aima-core": "1.2.39"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"zod": "^3.
|
|
39
|
+
"zod": "^4.3.6"
|
|
40
40
|
},
|
|
41
41
|
"description": ""
|
|
42
|
-
}
|
|
42
|
+
}
|
package/src/disableVehicle.ts
CHANGED
package/src/enableVehicle.ts
CHANGED
package/src/getModelVehicles.ts
CHANGED
|
@@ -7,9 +7,9 @@ export const getModelVehicles = async (
|
|
|
7
7
|
client: Client,
|
|
8
8
|
options?: PaginableOptions
|
|
9
9
|
): Promise<PaginableResponse<ModelVehicle>> => {
|
|
10
|
-
const PaginableOptionsSchema = createPaginableOptionsSchema()
|
|
10
|
+
const PaginableOptionsSchema = createPaginableOptionsSchema();
|
|
11
11
|
|
|
12
|
-
const resultOptions = PaginableOptionsSchema.safeParse(options);
|
|
12
|
+
const resultOptions = PaginableOptionsSchema.safeParse(options ?? {});
|
|
13
13
|
if (!resultOptions.success) {
|
|
14
14
|
throw new TypeError('Invalid options', {
|
|
15
15
|
cause: resultOptions.error.issues,
|
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
2
3
|
"include": ["src"],
|
|
3
4
|
"exclude": ["**/*.test.ts"],
|
|
4
5
|
"compilerOptions": {
|
|
5
|
-
"module": "esnext",
|
|
6
|
-
"target": "esnext",
|
|
7
|
-
"lib": ["esnext"],
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"strict": true,
|
|
10
|
-
"moduleResolution": "node",
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
6
|
"outDir": "dist",
|
|
14
7
|
"rootDir": "src"
|
|
15
8
|
}
|