@reifydb/core 0.0.1 → 0.1.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/constant.d.ts +7 -0
- package/dist/constant.d.ts.map +1 -0
- package/dist/constant.js +7 -0
- package/dist/constant.js.map +1 -0
- package/dist/decoder.d.ts +8 -0
- package/dist/decoder.d.ts.map +1 -0
- package/dist/decoder.js +59 -0
- package/dist/decoder.js.map +1 -0
- package/dist/index.d.ts +81 -56
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +190 -84
- package/dist/index.js.map +1 -1
- package/dist/schema/builder.d.ts +45 -0
- package/dist/schema/builder.d.ts.map +1 -0
- package/dist/schema/builder.js +114 -0
- package/dist/schema/builder.js.map +1 -0
- package/dist/schema/index.d.ts +11 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +12 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/inference.d.ts +16 -0
- package/dist/schema/inference.d.ts.map +1 -0
- package/dist/schema/inference.js +7 -0
- package/dist/schema/inference.js.map +1 -0
- package/dist/schema/parser.d.ts +8 -0
- package/dist/schema/parser.d.ts.map +1 -0
- package/dist/schema/parser.js +96 -0
- package/dist/schema/parser.js.map +1 -0
- package/dist/schema/simple-test.d.ts +7 -0
- package/dist/schema/simple-test.d.ts.map +1 -0
- package/dist/schema/simple-test.js +26 -0
- package/dist/schema/simple-test.js.map +1 -0
- package/dist/schema/test-refactor.d.ts +7 -0
- package/dist/schema/test-refactor.d.ts.map +1 -0
- package/dist/schema/test-refactor.js +97 -0
- package/dist/schema/test-refactor.js.map +1 -0
- package/dist/schema/types.d.ts +27 -0
- package/dist/schema/types.d.ts.map +1 -0
- package/dist/schema/types.js +7 -0
- package/dist/schema/types.js.map +1 -0
- package/dist/schema/validator.d.ts +8 -0
- package/dist/schema/validator.d.ts.map +1 -0
- package/dist/schema/validator.js +79 -0
- package/dist/schema/validator.js.map +1 -0
- package/dist/value/blob.d.ts +85 -0
- package/dist/value/blob.d.ts.map +1 -0
- package/dist/value/blob.js +255 -0
- package/dist/value/blob.js.map +1 -0
- package/dist/value/bool.d.ts +16 -0
- package/dist/value/bool.d.ts.map +1 -0
- package/dist/value/bool.js +46 -0
- package/dist/value/bool.js.map +1 -0
- package/dist/value/date.d.ts +71 -0
- package/dist/value/date.d.ts.map +1 -0
- package/dist/value/date.js +261 -0
- package/dist/value/date.js.map +1 -0
- package/dist/value/datetime.d.ts +99 -0
- package/dist/value/datetime.d.ts.map +1 -0
- package/dist/value/datetime.js +401 -0
- package/dist/value/datetime.js.map +1 -0
- package/dist/value/float4.d.ts +19 -0
- package/dist/value/float4.d.ts.map +1 -0
- package/dist/value/float4.js +68 -0
- package/dist/value/float4.js.map +1 -0
- package/dist/value/float8.d.ts +16 -0
- package/dist/value/float8.d.ts.map +1 -0
- package/dist/value/float8.js +44 -0
- package/dist/value/float8.js.map +1 -0
- package/dist/value/index.d.ts +38 -0
- package/dist/value/index.d.ts.map +1 -0
- package/dist/value/index.js +31 -0
- package/dist/value/index.js.map +1 -0
- package/dist/value/int1.d.ts +18 -0
- package/dist/value/int1.d.ts.map +1 -0
- package/dist/value/int1.js +46 -0
- package/dist/value/int1.js.map +1 -0
- package/dist/value/int16.d.ts +18 -0
- package/dist/value/int16.d.ts.map +1 -0
- package/dist/value/int16.js +67 -0
- package/dist/value/int16.js.map +1 -0
- package/dist/value/int2.d.ts +18 -0
- package/dist/value/int2.d.ts.map +1 -0
- package/dist/value/int2.js +46 -0
- package/dist/value/int2.js.map +1 -0
- package/dist/value/int4.d.ts +18 -0
- package/dist/value/int4.d.ts.map +1 -0
- package/dist/value/int4.js +46 -0
- package/dist/value/int4.js.map +1 -0
- package/dist/value/int8.d.ts +18 -0
- package/dist/value/int8.d.ts.map +1 -0
- package/dist/value/int8.js +53 -0
- package/dist/value/int8.js.map +1 -0
- package/dist/value/interval.d.ts +144 -0
- package/dist/value/interval.d.ts.map +1 -0
- package/dist/value/interval.js +357 -0
- package/dist/value/interval.js.map +1 -0
- package/dist/value/rowid.d.ts +18 -0
- package/dist/value/rowid.d.ts.map +1 -0
- package/dist/value/rowid.js +53 -0
- package/dist/value/rowid.js.map +1 -0
- package/dist/value/time.d.ts +74 -0
- package/dist/value/time.d.ts.map +1 -0
- package/dist/value/time.js +214 -0
- package/dist/value/time.js.map +1 -0
- package/dist/value/uint1.d.ts +18 -0
- package/dist/value/uint1.d.ts.map +1 -0
- package/dist/value/uint1.js +46 -0
- package/dist/value/uint1.js.map +1 -0
- package/dist/value/uint16.d.ts +18 -0
- package/dist/value/uint16.d.ts.map +1 -0
- package/dist/value/uint16.js +67 -0
- package/dist/value/uint16.js.map +1 -0
- package/dist/value/uint2.d.ts +18 -0
- package/dist/value/uint2.d.ts.map +1 -0
- package/dist/value/uint2.js +46 -0
- package/dist/value/uint2.js.map +1 -0
- package/dist/value/uint4.d.ts +18 -0
- package/dist/value/uint4.d.ts.map +1 -0
- package/dist/value/uint4.js +46 -0
- package/dist/value/uint4.js.map +1 -0
- package/dist/value/uint8.d.ts +19 -0
- package/dist/value/uint8.d.ts.map +1 -0
- package/dist/value/uint8.js +58 -0
- package/dist/value/uint8.js.map +1 -0
- package/dist/value/undefined.d.ts +48 -0
- package/dist/value/undefined.d.ts.map +1 -0
- package/dist/value/undefined.js +77 -0
- package/dist/value/undefined.js.map +1 -0
- package/dist/value/utf8.d.ts +16 -0
- package/dist/value/utf8.d.ts.map +1 -0
- package/dist/value/utf8.js +39 -0
- package/dist/value/utf8.js.map +1 -0
- package/dist/value/uuid4.d.ts +69 -0
- package/dist/value/uuid4.d.ts.map +1 -0
- package/dist/value/uuid4.js +162 -0
- package/dist/value/uuid4.js.map +1 -0
- package/dist/value/uuid7.d.ts +74 -0
- package/dist/value/uuid7.d.ts.map +1 -0
- package/dist/value/uuid7.js +175 -0
- package/dist/value/uuid7.js.map +1 -0
- package/package.json +12 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,eAAe,0BAAgB,CAAC"}
|
package/dist/constant.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../src/constant.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../src/decoder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAKH,KAAK,EAAE,aAAa,EACvB,MAAM,SAAS,CAAC;AAGjB,wBAAgB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,KAAK,CAmDjD"}
|
package/dist/decoder.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
* Copyright (c) 2025 ReifyDB
|
|
4
|
+
* See license.md file for full license text
|
|
5
|
+
*/
|
|
6
|
+
import { BlobValue, BoolValue, DateValue, DateTimeValue, Float4Value, Float8Value, Int1Value, Int2Value, Int4Value, Int8Value, Int16Value, IntervalValue, RowIdValue, TimeValue, Uint1Value, Uint2Value, Uint4Value, Uint8Value, Uint16Value, UndefinedValue, Utf8Value, Uuid4Value, Uuid7Value } from './value';
|
|
7
|
+
export function decode(pair) {
|
|
8
|
+
switch (pair.type) {
|
|
9
|
+
case "Blob":
|
|
10
|
+
return BlobValue.parse(pair.value);
|
|
11
|
+
case "Bool":
|
|
12
|
+
return BoolValue.parse(pair.value);
|
|
13
|
+
case "Date":
|
|
14
|
+
return DateValue.parse(pair.value);
|
|
15
|
+
case "DateTime":
|
|
16
|
+
return DateTimeValue.parse(pair.value);
|
|
17
|
+
case "Float4":
|
|
18
|
+
return Float4Value.parse(pair.value);
|
|
19
|
+
case "Float8":
|
|
20
|
+
return Float8Value.parse(pair.value);
|
|
21
|
+
case "Int1":
|
|
22
|
+
return Int1Value.parse(pair.value);
|
|
23
|
+
case "Int2":
|
|
24
|
+
return Int2Value.parse(pair.value);
|
|
25
|
+
case "Int4":
|
|
26
|
+
return Int4Value.parse(pair.value);
|
|
27
|
+
case "Int8":
|
|
28
|
+
return Int8Value.parse(pair.value);
|
|
29
|
+
case "Int16":
|
|
30
|
+
return Int16Value.parse(pair.value);
|
|
31
|
+
case "Interval":
|
|
32
|
+
return IntervalValue.parse(pair.value);
|
|
33
|
+
case "RowId":
|
|
34
|
+
return RowIdValue.parse(pair.value);
|
|
35
|
+
case "Time":
|
|
36
|
+
return TimeValue.parse(pair.value);
|
|
37
|
+
case "Uint1":
|
|
38
|
+
return Uint1Value.parse(pair.value);
|
|
39
|
+
case "Uint2":
|
|
40
|
+
return Uint2Value.parse(pair.value);
|
|
41
|
+
case "Uint4":
|
|
42
|
+
return Uint4Value.parse(pair.value);
|
|
43
|
+
case "Uint8":
|
|
44
|
+
return Uint8Value.parse(pair.value);
|
|
45
|
+
case "Uint16":
|
|
46
|
+
return Uint16Value.parse(pair.value);
|
|
47
|
+
case "Undefined":
|
|
48
|
+
return UndefinedValue.parse(pair.value);
|
|
49
|
+
case "Utf8":
|
|
50
|
+
return Utf8Value.parse(pair.value);
|
|
51
|
+
case "Uuid4":
|
|
52
|
+
return Uuid4Value.parse(pair.value);
|
|
53
|
+
case "Uuid7":
|
|
54
|
+
return Uuid7Value.parse(pair.value);
|
|
55
|
+
default:
|
|
56
|
+
throw new Error(`Unsupported type: ${pair.type}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=decoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoder.js","sourceRoot":"","sources":["../src/decoder.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -96,11 +96,11 @@ declare class BlobValue implements Value {
|
|
|
96
96
|
* See license.md file for full license text
|
|
97
97
|
*/
|
|
98
98
|
|
|
99
|
-
declare class
|
|
99
|
+
declare class BooleanValue implements Value {
|
|
100
100
|
readonly type: Type;
|
|
101
101
|
readonly value?: boolean;
|
|
102
102
|
constructor(value?: boolean);
|
|
103
|
-
static parse(str: string):
|
|
103
|
+
static parse(str: string): BooleanValue;
|
|
104
104
|
valueOf(): boolean | undefined;
|
|
105
105
|
toString(): string;
|
|
106
106
|
/**
|
|
@@ -364,6 +364,23 @@ declare class DateTimeValue implements Value {
|
|
|
364
364
|
encode(): TypeValuePair;
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
+
/**
|
|
368
|
+
* MIT License
|
|
369
|
+
* Copyright (c) 2025 ReifyDB
|
|
370
|
+
* See license.md file for full license text
|
|
371
|
+
*/
|
|
372
|
+
|
|
373
|
+
declare class DecimalValue implements Value {
|
|
374
|
+
readonly type: Type;
|
|
375
|
+
readonly value?: string;
|
|
376
|
+
constructor(value?: string);
|
|
377
|
+
static parse(str: string): DecimalValue;
|
|
378
|
+
valueOf(): string | undefined;
|
|
379
|
+
toString(): string;
|
|
380
|
+
equals(other: Value): boolean;
|
|
381
|
+
encode(): TypeValuePair;
|
|
382
|
+
}
|
|
383
|
+
|
|
367
384
|
/**
|
|
368
385
|
* MIT License
|
|
369
386
|
* Copyright (c) 2025 ReifyDB
|
|
@@ -524,10 +541,10 @@ declare class Int16Value implements Value {
|
|
|
524
541
|
*/
|
|
525
542
|
|
|
526
543
|
/**
|
|
527
|
-
*
|
|
544
|
+
* A duration value representing a time span or elapsed time.
|
|
528
545
|
* Internally stored as months, days, and nanoseconds.
|
|
529
546
|
*/
|
|
530
|
-
declare class
|
|
547
|
+
declare class DurationValue implements Value {
|
|
531
548
|
readonly type: Type;
|
|
532
549
|
private readonly months?;
|
|
533
550
|
private readonly days?;
|
|
@@ -538,61 +555,61 @@ declare class IntervalValue implements Value {
|
|
|
538
555
|
nanos: bigint;
|
|
539
556
|
} | string);
|
|
540
557
|
/**
|
|
541
|
-
* Create a new
|
|
558
|
+
* Create a new duration from months, days, and nanoseconds
|
|
542
559
|
*/
|
|
543
|
-
static new(months: number, days: number, nanos: bigint):
|
|
560
|
+
static new(months: number, days: number, nanos: bigint): DurationValue;
|
|
544
561
|
/**
|
|
545
|
-
* Create
|
|
562
|
+
* Create a duration from seconds
|
|
546
563
|
*/
|
|
547
|
-
static fromSeconds(seconds: number):
|
|
564
|
+
static fromSeconds(seconds: number): DurationValue;
|
|
548
565
|
/**
|
|
549
|
-
* Create
|
|
566
|
+
* Create a duration from milliseconds
|
|
550
567
|
*/
|
|
551
|
-
static fromMilliseconds(milliseconds: number):
|
|
568
|
+
static fromMilliseconds(milliseconds: number): DurationValue;
|
|
552
569
|
/**
|
|
553
|
-
* Create
|
|
570
|
+
* Create a duration from microseconds
|
|
554
571
|
*/
|
|
555
|
-
static fromMicroseconds(microseconds: number):
|
|
572
|
+
static fromMicroseconds(microseconds: number): DurationValue;
|
|
556
573
|
/**
|
|
557
|
-
* Create
|
|
574
|
+
* Create a duration from nanoseconds
|
|
558
575
|
*/
|
|
559
|
-
static fromNanoseconds(nanoseconds: bigint):
|
|
576
|
+
static fromNanoseconds(nanoseconds: bigint): DurationValue;
|
|
560
577
|
/**
|
|
561
|
-
* Create
|
|
578
|
+
* Create a duration from minutes
|
|
562
579
|
*/
|
|
563
|
-
static fromMinutes(minutes: number):
|
|
580
|
+
static fromMinutes(minutes: number): DurationValue;
|
|
564
581
|
/**
|
|
565
|
-
* Create
|
|
582
|
+
* Create a duration from hours
|
|
566
583
|
*/
|
|
567
|
-
static fromHours(hours: number):
|
|
584
|
+
static fromHours(hours: number): DurationValue;
|
|
568
585
|
/**
|
|
569
|
-
* Create
|
|
586
|
+
* Create a duration from days
|
|
570
587
|
*/
|
|
571
|
-
static fromDays(days: number):
|
|
588
|
+
static fromDays(days: number): DurationValue;
|
|
572
589
|
/**
|
|
573
|
-
* Create
|
|
590
|
+
* Create a duration from weeks
|
|
574
591
|
*/
|
|
575
|
-
static fromWeeks(weeks: number):
|
|
592
|
+
static fromWeeks(weeks: number): DurationValue;
|
|
576
593
|
/**
|
|
577
|
-
* Create
|
|
594
|
+
* Create a duration from months
|
|
578
595
|
*/
|
|
579
|
-
static fromMonths(months: number):
|
|
596
|
+
static fromMonths(months: number): DurationValue;
|
|
580
597
|
/**
|
|
581
|
-
* Create
|
|
598
|
+
* Create a duration from years
|
|
582
599
|
*/
|
|
583
|
-
static fromYears(years: number):
|
|
600
|
+
static fromYears(years: number): DurationValue;
|
|
584
601
|
/**
|
|
585
|
-
* Create a zero
|
|
602
|
+
* Create a zero duration
|
|
586
603
|
*/
|
|
587
|
-
static zero():
|
|
604
|
+
static zero(): DurationValue;
|
|
588
605
|
/**
|
|
589
|
-
* Get default
|
|
606
|
+
* Get default duration (zero)
|
|
590
607
|
*/
|
|
591
|
-
static default():
|
|
608
|
+
static default(): DurationValue;
|
|
592
609
|
/**
|
|
593
|
-
* Parse
|
|
610
|
+
* Parse a duration string in ISO 8601 duration format
|
|
594
611
|
*/
|
|
595
|
-
static parse(str: string):
|
|
612
|
+
static parse(str: string): DurationValue;
|
|
596
613
|
/**
|
|
597
614
|
* Get total seconds (truncated)
|
|
598
615
|
*/
|
|
@@ -622,24 +639,29 @@ declare class IntervalValue implements Value {
|
|
|
622
639
|
*/
|
|
623
640
|
getNanos(): bigint | undefined;
|
|
624
641
|
/**
|
|
625
|
-
* Check if
|
|
642
|
+
* Check if duration is positive (any component > 0)
|
|
626
643
|
*/
|
|
627
644
|
isPositive(): boolean;
|
|
628
645
|
/**
|
|
629
|
-
* Check if
|
|
646
|
+
* Check if duration is negative (any component < 0)
|
|
630
647
|
*/
|
|
631
648
|
isNegative(): boolean;
|
|
632
649
|
/**
|
|
633
|
-
* Get absolute value of
|
|
650
|
+
* Get absolute value of duration
|
|
634
651
|
*/
|
|
635
|
-
abs():
|
|
652
|
+
abs(): DurationValue;
|
|
636
653
|
/**
|
|
637
|
-
* Negate the
|
|
654
|
+
* Negate the duration
|
|
638
655
|
*/
|
|
639
|
-
negate():
|
|
656
|
+
negate(): DurationValue;
|
|
640
657
|
/**
|
|
641
658
|
* Format as ISO 8601 duration string
|
|
642
659
|
*/
|
|
660
|
+
toIsoString(): string;
|
|
661
|
+
/**
|
|
662
|
+
* Format as human-readable duration string
|
|
663
|
+
* Examples: "1 year 2 mons 3 days 04:05:06.789", "3 days", "00:00:01.5"
|
|
664
|
+
*/
|
|
643
665
|
toString(): string;
|
|
644
666
|
valueOf(): {
|
|
645
667
|
months: number;
|
|
@@ -659,9 +681,10 @@ declare class IntervalValue implements Value {
|
|
|
659
681
|
*/
|
|
660
682
|
private static parseDuration;
|
|
661
683
|
/**
|
|
662
|
-
* Compare two
|
|
684
|
+
* Compare two durations for equality
|
|
663
685
|
*/
|
|
664
686
|
equals(other: Value): boolean;
|
|
687
|
+
toJSON(): string;
|
|
665
688
|
encode(): TypeValuePair;
|
|
666
689
|
}
|
|
667
690
|
|
|
@@ -1063,7 +1086,7 @@ declare class IdentityIdValue implements Value {
|
|
|
1063
1086
|
* See license.md file for full license text
|
|
1064
1087
|
*/
|
|
1065
1088
|
|
|
1066
|
-
type Type = "Blob" | "
|
|
1089
|
+
type Type = "Blob" | "Boolean" | "Decimal" | "Float4" | "Float8" | "Int1" | "Int2" | "Int4" | "Int8" | "Int16" | "Uint1" | "Uint2" | "Uint4" | "Uint8" | "Uint16" | "Utf8" | "Date" | "DateTime" | "Time" | "Duration" | "Uuid4" | "Uuid7" | "Undefined" | "RowNumber" | "IdentityId";
|
|
1067
1090
|
interface TypeValuePair {
|
|
1068
1091
|
type: Type;
|
|
1069
1092
|
value: string;
|
|
@@ -1088,8 +1111,8 @@ declare function decode(pair: TypeValuePair): Value;
|
|
|
1088
1111
|
* See license.md file for full license text
|
|
1089
1112
|
*/
|
|
1090
1113
|
|
|
1091
|
-
type PrimitiveToTS<T extends Type> = T extends 'Blob' ? Uint8Array : T extends '
|
|
1092
|
-
type PrimitiveToValue<T extends Type> = T extends 'Blob' ? BlobValue : T extends '
|
|
1114
|
+
type PrimitiveToTS<T extends Type> = T extends 'Blob' ? Uint8Array : T extends 'Boolean' ? boolean : T extends 'Decimal' ? string : T extends 'Float4' ? number : T extends 'Float8' ? number : T extends 'Int1' ? number : T extends 'Int2' ? number : T extends 'Int4' ? number : T extends 'Int8' ? bigint : T extends 'Int16' ? bigint : T extends 'Uint1' ? number : T extends 'Uint2' ? number : T extends 'Uint4' ? number : T extends 'Uint8' ? bigint : T extends 'Uint16' ? bigint : T extends 'Utf8' ? string : T extends 'Date' ? Date : T extends 'DateTime' ? Date : T extends 'Time' ? string : T extends 'Duration' ? string : T extends 'Uuid4' ? string : T extends 'Uuid7' ? string : T extends 'Undefined' ? undefined : T extends 'RowNumber' ? bigint : T extends 'IdentityId' ? string : never;
|
|
1115
|
+
type PrimitiveToValue<T extends Type> = T extends 'Blob' ? BlobValue : T extends 'Boolean' ? BooleanValue : T extends 'Decimal' ? DecimalValue : T extends 'Float4' ? Float4Value : T extends 'Float8' ? Float8Value : T extends 'Int1' ? Int1Value : T extends 'Int2' ? Int2Value : T extends 'Int4' ? Int4Value : T extends 'Int8' ? Int8Value : T extends 'Int16' ? Int16Value : T extends 'Uint1' ? Uint1Value : T extends 'Uint2' ? Uint2Value : T extends 'Uint4' ? Uint4Value : T extends 'Uint8' ? Uint8Value : T extends 'Uint16' ? Uint16Value : T extends 'Utf8' ? Utf8Value : T extends 'Date' ? DateValue : T extends 'DateTime' ? DateTimeValue : T extends 'Time' ? TimeValue : T extends 'Duration' ? DurationValue : T extends 'Uuid4' ? Uuid4Value : T extends 'Uuid7' ? Uuid7Value : T extends 'Undefined' ? UndefinedValue : T extends 'RowNumber' ? RowNumberValue : T extends 'IdentityId' ? IdentityIdValue : never;
|
|
1093
1116
|
type InferSchema<S> = S extends PrimitiveSchemaNode<infer T> ? T extends Type ? PrimitiveToTS<T> : never : S extends ValueSchemaNode<infer T> ? T extends Type ? PrimitiveToValue<T> : never : S extends ObjectSchemaNode<infer P> ? {
|
|
1094
1117
|
[K in keyof P]: InferSchema<P[K]>;
|
|
1095
1118
|
} : S extends ArraySchemaNode<infer T> ? InferSchema<T>[] : S extends OptionalSchemaNode<infer T> ? InferSchema<T> | undefined : never;
|
|
@@ -1105,8 +1128,9 @@ type InferSchemas<S extends readonly SchemaNode[]> = {
|
|
|
1105
1128
|
|
|
1106
1129
|
declare class SchemaBuilder {
|
|
1107
1130
|
static blob(): PrimitiveSchemaNode<'Blob'>;
|
|
1108
|
-
static bool(): PrimitiveSchemaNode<'
|
|
1109
|
-
static boolean(): PrimitiveSchemaNode<'
|
|
1131
|
+
static bool(): PrimitiveSchemaNode<'Boolean'>;
|
|
1132
|
+
static boolean(): PrimitiveSchemaNode<'Boolean'>;
|
|
1133
|
+
static decimal(): PrimitiveSchemaNode<'Decimal'>;
|
|
1110
1134
|
static float4(): PrimitiveSchemaNode<'Float4'>;
|
|
1111
1135
|
static float8(): PrimitiveSchemaNode<'Float8'>;
|
|
1112
1136
|
static float(): PrimitiveSchemaNode<'Float8'>;
|
|
@@ -1128,7 +1152,7 @@ declare class SchemaBuilder {
|
|
|
1128
1152
|
static date(): PrimitiveSchemaNode<'Date'>;
|
|
1129
1153
|
static datetime(): PrimitiveSchemaNode<'DateTime'>;
|
|
1130
1154
|
static time(): PrimitiveSchemaNode<'Time'>;
|
|
1131
|
-
static
|
|
1155
|
+
static duration(): PrimitiveSchemaNode<'Duration'>;
|
|
1132
1156
|
static uuid4(): PrimitiveSchemaNode<'Uuid4'>;
|
|
1133
1157
|
static uuid7(): PrimitiveSchemaNode<'Uuid7'>;
|
|
1134
1158
|
static uuid(): PrimitiveSchemaNode<'Uuid7'>;
|
|
@@ -1139,7 +1163,8 @@ declare class SchemaBuilder {
|
|
|
1139
1163
|
static array<T extends SchemaNode>(items: T): ArraySchemaNode<T>;
|
|
1140
1164
|
static optional<T extends SchemaNode>(schema: T): OptionalSchemaNode<T>;
|
|
1141
1165
|
static number(): PrimitiveSchemaNode<'Float8'>;
|
|
1142
|
-
static
|
|
1166
|
+
static booleanValue(): ValueSchemaNode<'Boolean'>;
|
|
1167
|
+
static decimalValue(): ValueSchemaNode<'Decimal'>;
|
|
1143
1168
|
static int1Value(): ValueSchemaNode<'Int1'>;
|
|
1144
1169
|
static int2Value(): ValueSchemaNode<'Int2'>;
|
|
1145
1170
|
static int4Value(): ValueSchemaNode<'Int4'>;
|
|
@@ -1156,7 +1181,7 @@ declare class SchemaBuilder {
|
|
|
1156
1181
|
static dateValue(): ValueSchemaNode<'Date'>;
|
|
1157
1182
|
static dateTimeValue(): ValueSchemaNode<'DateTime'>;
|
|
1158
1183
|
static timeValue(): ValueSchemaNode<'Time'>;
|
|
1159
|
-
static
|
|
1184
|
+
static durationValue(): ValueSchemaNode<'Duration'>;
|
|
1160
1185
|
static uuid4Value(): ValueSchemaNode<'Uuid4'>;
|
|
1161
1186
|
static uuid7Value(): ValueSchemaNode<'Uuid7'>;
|
|
1162
1187
|
static undefinedValue(): ValueSchemaNode<'Undefined'>;
|
|
@@ -1221,19 +1246,19 @@ interface Frame {
|
|
|
1221
1246
|
}
|
|
1222
1247
|
interface DiagnosticColumn {
|
|
1223
1248
|
name: string;
|
|
1224
|
-
|
|
1249
|
+
type: Type;
|
|
1225
1250
|
}
|
|
1226
|
-
interface
|
|
1227
|
-
|
|
1228
|
-
line
|
|
1229
|
-
|
|
1251
|
+
interface Fragment {
|
|
1252
|
+
text: string;
|
|
1253
|
+
line?: number;
|
|
1254
|
+
column?: number;
|
|
1230
1255
|
}
|
|
1231
1256
|
interface Diagnostic {
|
|
1232
1257
|
code: string;
|
|
1233
1258
|
statement?: string;
|
|
1234
1259
|
message: string;
|
|
1235
1260
|
column?: DiagnosticColumn;
|
|
1236
|
-
|
|
1261
|
+
fragment?: Fragment;
|
|
1237
1262
|
label?: string;
|
|
1238
1263
|
help?: string;
|
|
1239
1264
|
notes: Array<string>;
|
|
@@ -1241,7 +1266,7 @@ interface Diagnostic {
|
|
|
1241
1266
|
}
|
|
1242
1267
|
interface Column {
|
|
1243
1268
|
name: string;
|
|
1244
|
-
|
|
1269
|
+
type: Type;
|
|
1245
1270
|
data: string[];
|
|
1246
1271
|
}
|
|
1247
1272
|
interface ErrorResponse {
|
|
@@ -1255,7 +1280,7 @@ declare class ReifyError extends Error {
|
|
|
1255
1280
|
readonly code: string;
|
|
1256
1281
|
readonly statement?: string;
|
|
1257
1282
|
readonly column?: DiagnosticColumn;
|
|
1258
|
-
readonly
|
|
1283
|
+
readonly fragment?: Fragment;
|
|
1259
1284
|
readonly label?: string;
|
|
1260
1285
|
readonly help?: string;
|
|
1261
1286
|
readonly notes: string[];
|
|
@@ -1277,4 +1302,4 @@ type SingleFrameResult<S extends SchemaNode> = InferSchema<S>[];
|
|
|
1277
1302
|
*/
|
|
1278
1303
|
declare function asFrameResults<S extends readonly SchemaNode[]>(results: any): FrameResults<S>;
|
|
1279
1304
|
|
|
1280
|
-
export { type ArraySchemaNode, BlobValue,
|
|
1305
|
+
export { type ArraySchemaNode, BlobValue, BooleanValue, type Column, DateTimeValue, DateValue, DecimalValue, type Diagnostic, type DiagnosticColumn, DurationValue, type ErrorResponse, Float4Value, Float8Value, type Fragment, type Frame, type FrameResults, IdentityIdValue, type InferSchema, type InferSchemas, Int16Value, Int1Value, Int2Value, Int4Value, Int8Value, type ObjectSchemaNode, type OptionalSchemaNode, type Params, type PrimitiveSchemaNode, type PrimitiveToTS, type PrimitiveToValue, ReifyError, RowNumberValue, Schema, SchemaBuilder, type SchemaNode, type SingleFrameResult, TimeValue, type Type, type TypeValuePair, UNDEFINED_VALUE, Uint16Value, Uint1Value, Uint2Value, Uint4Value, Uint8Value, UndefinedValue, Utf8Value, Uuid4Value, Uuid7Value, Value, type ValueSchemaNode, asFrameResults, decode, parseValue, validateSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAC"}
|