@sylphx/lens-solid 2.2.12 → 2.3.0
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.js +19 -5
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -114,6 +114,14 @@ class DateTimeType extends FieldType {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
class TimestampType extends FieldType {
|
|
118
|
+
_type = "timestamp";
|
|
119
|
+
_tsType;
|
|
120
|
+
validate(value) {
|
|
121
|
+
return typeof value === "number" && !Number.isNaN(value) && Number.isFinite(value);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
117
125
|
class DecimalType extends FieldType {
|
|
118
126
|
_type = "decimal";
|
|
119
127
|
_tsType;
|
|
@@ -253,9 +261,9 @@ class ArrayType extends FieldType {
|
|
|
253
261
|
}
|
|
254
262
|
}
|
|
255
263
|
|
|
256
|
-
class
|
|
264
|
+
class ScalarType extends FieldType {
|
|
257
265
|
definition;
|
|
258
|
-
_type = "
|
|
266
|
+
_type = "scalar";
|
|
259
267
|
_tsType;
|
|
260
268
|
constructor(definition) {
|
|
261
269
|
super();
|
|
@@ -263,7 +271,7 @@ class CustomType extends FieldType {
|
|
|
263
271
|
}
|
|
264
272
|
serialize(value) {
|
|
265
273
|
if (this.definition.validate && !this.definition.validate(value)) {
|
|
266
|
-
throw new Error(`Validation failed for
|
|
274
|
+
throw new Error(`Validation failed for scalar type: ${this.definition.name}`);
|
|
267
275
|
}
|
|
268
276
|
return this.definition.serialize(value);
|
|
269
277
|
}
|
|
@@ -274,6 +282,8 @@ class CustomType extends FieldType {
|
|
|
274
282
|
return this.definition.validate ? this.definition.validate(value) : true;
|
|
275
283
|
}
|
|
276
284
|
}
|
|
285
|
+
var CustomType = ScalarType;
|
|
286
|
+
|
|
277
287
|
class HasOneType extends FieldType {
|
|
278
288
|
target;
|
|
279
289
|
foreignKey;
|
|
@@ -347,6 +357,7 @@ var t = {
|
|
|
347
357
|
float: () => new FloatType,
|
|
348
358
|
boolean: () => new BooleanType,
|
|
349
359
|
datetime: () => new DateTimeType,
|
|
360
|
+
timestamp: () => new TimestampType,
|
|
350
361
|
date: () => new DateType,
|
|
351
362
|
decimal: () => new DecimalType,
|
|
352
363
|
bigint: () => new BigIntType,
|
|
@@ -391,6 +402,7 @@ function createTypeBuilder() {
|
|
|
391
402
|
float: () => createContextualField(new FloatType),
|
|
392
403
|
boolean: () => createContextualField(new BooleanType),
|
|
393
404
|
datetime: () => createContextualField(new DateTimeType),
|
|
405
|
+
timestamp: () => createContextualField(new TimestampType),
|
|
394
406
|
date: () => createContextualField(new DateType),
|
|
395
407
|
decimal: () => createContextualField(new DecimalType),
|
|
396
408
|
bigint: () => createContextualField(new BigIntType),
|
|
@@ -407,6 +419,8 @@ function createTypeBuilder() {
|
|
|
407
419
|
many: (targetRef) => createContextualField(new LazyManyType(targetRef))
|
|
408
420
|
};
|
|
409
421
|
}
|
|
422
|
+
var LIST_FIELD_SYMBOL = Symbol("lens:list-field");
|
|
423
|
+
var NULLABLE_FIELD_SYMBOL = Symbol("lens:nullable-field");
|
|
410
424
|
var MODEL_SYMBOL = Symbol("lens:model");
|
|
411
425
|
var NULLABLE_SYMBOL = Symbol("lens:nullable");
|
|
412
426
|
var LIST_SYMBOL = Symbol("lens:list");
|
|
@@ -461,12 +475,12 @@ var DEFAULT_OPERATION_LOG_CONFIG = {
|
|
|
461
475
|
};
|
|
462
476
|
function murmurhash3(key, seed = 0) {
|
|
463
477
|
const remainder = key.length % 4;
|
|
464
|
-
const
|
|
478
|
+
const bytes2 = key.length - remainder;
|
|
465
479
|
let h1 = seed;
|
|
466
480
|
const c1 = 3432918353;
|
|
467
481
|
const c2 = 461845907;
|
|
468
482
|
let i = 0;
|
|
469
|
-
while (i <
|
|
483
|
+
while (i < bytes2) {
|
|
470
484
|
let k12 = key.charCodeAt(i) & 255 | (key.charCodeAt(i + 1) & 255) << 8 | (key.charCodeAt(i + 2) & 255) << 16 | (key.charCodeAt(i + 3) & 255) << 24;
|
|
471
485
|
k12 = Math.imul(k12, c1);
|
|
472
486
|
k12 = k12 << 15 | k12 >>> 17;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylphx/lens-solid",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "SolidJS bindings for Lens API framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"author": "SylphxAI",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@sylphx/lens-client": "^2.
|
|
35
|
-
"@sylphx/lens-core": "^2.
|
|
34
|
+
"@sylphx/lens-client": "^2.5.0",
|
|
35
|
+
"@sylphx/lens-core": "^2.10.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"solid-js": ">=1.8.0"
|