imean-cassandra-orm 1.2.0 → 1.2.1
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/mod.cjs +1 -33
- package/dist/mod.js +1 -33
- package/package.json +3 -4
package/dist/mod.cjs
CHANGED
|
@@ -61,39 +61,7 @@ function createZodSchemaForFields(schema, filter, makeOptional = false) {
|
|
|
61
61
|
return zod.z.object(zodSchema);
|
|
62
62
|
}
|
|
63
63
|
function createZodSchema(schema) {
|
|
64
|
-
|
|
65
|
-
for (const [key, config] of Object.entries(schema)) {
|
|
66
|
-
let zodType;
|
|
67
|
-
switch (config.type) {
|
|
68
|
-
case "text":
|
|
69
|
-
zodType = zod.z.string();
|
|
70
|
-
break;
|
|
71
|
-
case "int":
|
|
72
|
-
case "bigint":
|
|
73
|
-
case "varint":
|
|
74
|
-
zodType = zod.z.number().int();
|
|
75
|
-
break;
|
|
76
|
-
case "float":
|
|
77
|
-
case "double":
|
|
78
|
-
zodType = zod.z.number();
|
|
79
|
-
break;
|
|
80
|
-
case "boolean":
|
|
81
|
-
zodType = zod.z.boolean();
|
|
82
|
-
break;
|
|
83
|
-
case "timestamp":
|
|
84
|
-
zodType = zod.z.date();
|
|
85
|
-
break;
|
|
86
|
-
case "uuid":
|
|
87
|
-
zodType = zod.z.union([zod.z.string(), zod.z.instanceof(cassandraDriver.types.Uuid)]).transform(
|
|
88
|
-
(val) => val instanceof cassandraDriver.types.Uuid ? val.toString() : val
|
|
89
|
-
);
|
|
90
|
-
break;
|
|
91
|
-
default:
|
|
92
|
-
zodType = zod.z.any();
|
|
93
|
-
}
|
|
94
|
-
shape[key] = zodType;
|
|
95
|
-
}
|
|
96
|
-
return zod.z.object(shape);
|
|
64
|
+
return createZodSchemaForFields(schema, () => true);
|
|
97
65
|
}
|
|
98
66
|
function createPartitionKeyZodSchema(schema) {
|
|
99
67
|
return createZodSchemaForFields(
|
package/dist/mod.js
CHANGED
|
@@ -57,39 +57,7 @@ function createZodSchemaForFields(schema, filter, makeOptional = false) {
|
|
|
57
57
|
return z.object(zodSchema);
|
|
58
58
|
}
|
|
59
59
|
function createZodSchema(schema) {
|
|
60
|
-
|
|
61
|
-
for (const [key, config] of Object.entries(schema)) {
|
|
62
|
-
let zodType;
|
|
63
|
-
switch (config.type) {
|
|
64
|
-
case "text":
|
|
65
|
-
zodType = z.string();
|
|
66
|
-
break;
|
|
67
|
-
case "int":
|
|
68
|
-
case "bigint":
|
|
69
|
-
case "varint":
|
|
70
|
-
zodType = z.number().int();
|
|
71
|
-
break;
|
|
72
|
-
case "float":
|
|
73
|
-
case "double":
|
|
74
|
-
zodType = z.number();
|
|
75
|
-
break;
|
|
76
|
-
case "boolean":
|
|
77
|
-
zodType = z.boolean();
|
|
78
|
-
break;
|
|
79
|
-
case "timestamp":
|
|
80
|
-
zodType = z.date();
|
|
81
|
-
break;
|
|
82
|
-
case "uuid":
|
|
83
|
-
zodType = z.union([z.string(), z.instanceof(types.Uuid)]).transform(
|
|
84
|
-
(val) => val instanceof types.Uuid ? val.toString() : val
|
|
85
|
-
);
|
|
86
|
-
break;
|
|
87
|
-
default:
|
|
88
|
-
zodType = z.any();
|
|
89
|
-
}
|
|
90
|
-
shape[key] = zodType;
|
|
91
|
-
}
|
|
92
|
-
return z.object(shape);
|
|
60
|
+
return createZodSchemaForFields(schema, () => true);
|
|
93
61
|
}
|
|
94
62
|
function createPartitionKeyZodSchema(schema) {
|
|
95
63
|
return createZodSchemaForFields(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imean-cassandra-orm",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "cassandra orm",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cassandra",
|
|
@@ -32,10 +32,9 @@
|
|
|
32
32
|
"test": "vitest run",
|
|
33
33
|
"prepublishOnly": "npm run build && npm run test"
|
|
34
34
|
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"zod": "^3.24.3"
|
|
37
|
-
},
|
|
35
|
+
"dependencies": {},
|
|
38
36
|
"peerDependencies": {
|
|
37
|
+
"zod": "^3.x",
|
|
39
38
|
"@opentelemetry/api": "^1.x",
|
|
40
39
|
"cassandra-driver": "^4.x"
|
|
41
40
|
},
|