@xube/kit-aws-data-schema 0.0.76 → 0.0.78
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.
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetDataByDateRangeResponseSchema = exports.DeviceDataEntryResponseSchema = exports.ComponentDataEntryResponseSchema = exports.isGetDataByDateRangeRequest = exports.GetDataByDateRangeRequestSchema = void 0;
|
|
4
|
-
const kit_log_1 = require("@xube/kit-log");
|
|
5
4
|
const zod_1 = require("zod");
|
|
6
|
-
const zod_validation_error_1 = require("zod-validation-error");
|
|
7
5
|
exports.GetDataByDateRangeRequestSchema = zod_1.z.object({
|
|
8
6
|
devices: zod_1.z.array(zod_1.z.object({
|
|
9
7
|
id: zod_1.z.string(),
|
|
@@ -16,17 +14,8 @@ exports.GetDataByDateRangeRequestSchema = zod_1.z.object({
|
|
|
16
14
|
// email: z.string().email(),
|
|
17
15
|
});
|
|
18
16
|
const isGetDataByDateRangeRequest = (object) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
kit_log_1.XubeLog.getInstance().warn(`Failed to parse request: ${JSON.stringify(object)}`);
|
|
25
|
-
if (e instanceof zod_1.z.ZodError) {
|
|
26
|
-
(0, zod_validation_error_1.fromZodError)(e);
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
17
|
+
exports.GetDataByDateRangeRequestSchema.passthrough().parse(object);
|
|
18
|
+
return true;
|
|
30
19
|
};
|
|
31
20
|
exports.isGetDataByDateRangeRequest = isGetDataByDateRangeRequest;
|
|
32
21
|
exports.ComponentDataEntryResponseSchema = zod_1.z.object({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xube/kit-aws-data-schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.78",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
"homepage": "https://github.com/XubeLtd/dev-kit#readme",
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^20.4.7",
|
|
22
|
-
"@xube/kit-build": "^0.0.
|
|
22
|
+
"@xube/kit-build": "^0.0.78",
|
|
23
23
|
"ts-node": "^10.9.1",
|
|
24
24
|
"typescript": "^5.1.6"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@xube/kit-aws-schema": "^0.0.
|
|
28
|
-
"@xube/kit-constants": "^0.0.
|
|
29
|
-
"@xube/kit-generator": "^0.0.
|
|
30
|
-
"@xube/kit-log": "^0.0.
|
|
31
|
-
"@xube/kit-schema": "^0.0.
|
|
27
|
+
"@xube/kit-aws-schema": "^0.0.78",
|
|
28
|
+
"@xube/kit-constants": "^0.0.78",
|
|
29
|
+
"@xube/kit-generator": "^0.0.78",
|
|
30
|
+
"@xube/kit-log": "^0.0.78",
|
|
31
|
+
"@xube/kit-schema": "^0.0.78",
|
|
32
32
|
"zod": "^3.22.4",
|
|
33
33
|
"zod-validation-error": "^2.0.0"
|
|
34
34
|
}
|
|
@@ -21,19 +21,8 @@ export type GetDataByDateRangeRequest = z.infer<
|
|
|
21
21
|
export const isGetDataByDateRangeRequest = (
|
|
22
22
|
object: unknown
|
|
23
23
|
): object is GetDataByDateRangeRequest => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return true;
|
|
27
|
-
} catch (e) {
|
|
28
|
-
XubeLog.getInstance().warn(
|
|
29
|
-
`Failed to parse request: ${JSON.stringify(object)}`
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
if (e instanceof z.ZodError) {
|
|
33
|
-
fromZodError(e);
|
|
34
|
-
}
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
24
|
+
GetDataByDateRangeRequestSchema.passthrough().parse(object);
|
|
25
|
+
return true;
|
|
37
26
|
};
|
|
38
27
|
|
|
39
28
|
export const ComponentDataEntryResponseSchema = z.object({
|