@reifydb/core 0.2.0 → 0.4.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.d.ts CHANGED
@@ -1,15 +1,4 @@
1
- /**
2
- * MIT License
3
- * Copyright (c) 2025 ReifyDB
4
- * See license.md file for full license text
5
- */
6
- declare const UNDEFINED_VALUE = "\u27EAundefined\u27EB";
7
-
8
- /**
9
- * MIT License
10
- * Copyright (c) 2025 ReifyDB
11
- * See license.md file for full license text
12
- */
1
+ declare const NONE_VALUE = "\u27EAnone\u27EB";
13
2
 
14
3
  /**
15
4
  * A binary large object (BLOB) value that can hold arbitrary byte data.
@@ -90,12 +79,6 @@ declare class BlobValue implements Value {
90
79
  encode(): TypeValuePair;
91
80
  }
92
81
 
93
- /**
94
- * MIT License
95
- * Copyright (c) 2025 ReifyDB
96
- * See license.md file for full license text
97
- */
98
-
99
82
  declare class BooleanValue implements Value {
100
83
  readonly type: Type;
101
84
  readonly value?: boolean;
@@ -110,12 +93,6 @@ declare class BooleanValue implements Value {
110
93
  encode(): TypeValuePair;
111
94
  }
112
95
 
113
- /**
114
- * MIT License
115
- * Copyright (c) 2025 ReifyDB
116
- * See license.md file for full license text
117
- */
118
-
119
96
  /**
120
97
  * A date value representing a calendar date (year, month, day) without time information.
121
98
  * Always interpreted in UTC.
@@ -185,12 +162,6 @@ declare class DateValue implements Value {
185
162
  encode(): TypeValuePair;
186
163
  }
187
164
 
188
- /**
189
- * MIT License
190
- * Copyright (c) 2025 ReifyDB
191
- * See license.md file for full license text
192
- */
193
-
194
165
  /**
195
166
  * A time value representing time of day (hour, minute, second, nanosecond) without date information.
196
167
  * Internally stored as nanoseconds since midnight.
@@ -263,12 +234,6 @@ declare class TimeValue implements Value {
263
234
  encode(): TypeValuePair;
264
235
  }
265
236
 
266
- /**
267
- * MIT License
268
- * Copyright (c) 2025 ReifyDB
269
- * See license.md file for full license text
270
- */
271
-
272
237
  /**
273
238
  * A date and time value with nanosecond precision.
274
239
  * Always in UTC timezone.
@@ -364,12 +329,6 @@ declare class DateTimeValue implements Value {
364
329
  encode(): TypeValuePair;
365
330
  }
366
331
 
367
- /**
368
- * MIT License
369
- * Copyright (c) 2025 ReifyDB
370
- * See license.md file for full license text
371
- */
372
-
373
332
  declare class DecimalValue implements Value {
374
333
  readonly type: Type;
375
334
  readonly value?: string;
@@ -381,12 +340,6 @@ declare class DecimalValue implements Value {
381
340
  encode(): TypeValuePair;
382
341
  }
383
342
 
384
- /**
385
- * MIT License
386
- * Copyright (c) 2025 ReifyDB
387
- * See license.md file for full license text
388
- */
389
-
390
343
  declare class Float4Value implements Value {
391
344
  private static readonly MAX_VALUE;
392
345
  private static readonly MIN_VALUE;
@@ -404,12 +357,6 @@ declare class Float4Value implements Value {
404
357
  encode(): TypeValuePair;
405
358
  }
406
359
 
407
- /**
408
- * MIT License
409
- * Copyright (c) 2025 ReifyDB
410
- * See license.md file for full license text
411
- */
412
-
413
360
  declare class Float8Value implements Value {
414
361
  readonly type: Type;
415
362
  readonly value?: number;
@@ -424,12 +371,6 @@ declare class Float8Value implements Value {
424
371
  encode(): TypeValuePair;
425
372
  }
426
373
 
427
- /**
428
- * MIT License
429
- * Copyright (c) 2025 ReifyDB
430
- * See license.md file for full license text
431
- */
432
-
433
374
  declare class Int1Value implements Value {
434
375
  readonly type: Type;
435
376
  readonly value?: number;
@@ -446,12 +387,6 @@ declare class Int1Value implements Value {
446
387
  encode(): TypeValuePair;
447
388
  }
448
389
 
449
- /**
450
- * MIT License
451
- * Copyright (c) 2025 ReifyDB
452
- * See license.md file for full license text
453
- */
454
-
455
390
  declare class Int2Value implements Value {
456
391
  readonly type: Type;
457
392
  readonly value?: number;
@@ -468,12 +403,6 @@ declare class Int2Value implements Value {
468
403
  encode(): TypeValuePair;
469
404
  }
470
405
 
471
- /**
472
- * MIT License
473
- * Copyright (c) 2025 ReifyDB
474
- * See license.md file for full license text
475
- */
476
-
477
406
  declare class Int4Value implements Value {
478
407
  readonly type: Type;
479
408
  readonly value?: number;
@@ -490,12 +419,6 @@ declare class Int4Value implements Value {
490
419
  encode(): TypeValuePair;
491
420
  }
492
421
 
493
- /**
494
- * MIT License
495
- * Copyright (c) 2025 ReifyDB
496
- * See license.md file for full license text
497
- */
498
-
499
422
  declare class Int8Value implements Value {
500
423
  readonly type: Type;
501
424
  readonly value?: bigint;
@@ -512,12 +435,6 @@ declare class Int8Value implements Value {
512
435
  encode(): TypeValuePair;
513
436
  }
514
437
 
515
- /**
516
- * MIT License
517
- * Copyright (c) 2025 ReifyDB
518
- * See license.md file for full license text
519
- */
520
-
521
438
  declare class Int16Value implements Value {
522
439
  readonly type: Type;
523
440
  readonly value?: bigint;
@@ -534,12 +451,6 @@ declare class Int16Value implements Value {
534
451
  encode(): TypeValuePair;
535
452
  }
536
453
 
537
- /**
538
- * MIT License
539
- * Copyright (c) 2025 ReifyDB
540
- * See license.md file for full license text
541
- */
542
-
543
454
  /**
544
455
  * A duration value representing a time span or elapsed time.
545
456
  * Internally stored as months, days, and nanoseconds.
@@ -688,12 +599,6 @@ declare class DurationValue implements Value {
688
599
  encode(): TypeValuePair;
689
600
  }
690
601
 
691
- /**
692
- * MIT License
693
- * Copyright (c) 2025 ReifyDB
694
- * See license.md file for full license text
695
- */
696
-
697
602
  declare class Uint1Value implements Value {
698
603
  readonly type: Type;
699
604
  readonly value?: number;
@@ -710,12 +615,6 @@ declare class Uint1Value implements Value {
710
615
  encode(): TypeValuePair;
711
616
  }
712
617
 
713
- /**
714
- * MIT License
715
- * Copyright (c) 2025 ReifyDB
716
- * See license.md file for full license text
717
- */
718
-
719
618
  declare class Uint2Value implements Value {
720
619
  readonly type: Type;
721
620
  readonly value?: number;
@@ -732,12 +631,6 @@ declare class Uint2Value implements Value {
732
631
  encode(): TypeValuePair;
733
632
  }
734
633
 
735
- /**
736
- * MIT License
737
- * Copyright (c) 2025 ReifyDB
738
- * See license.md file for full license text
739
- */
740
-
741
634
  declare class Uint4Value implements Value {
742
635
  readonly type: Type;
743
636
  readonly value?: number;
@@ -754,12 +647,6 @@ declare class Uint4Value implements Value {
754
647
  encode(): TypeValuePair;
755
648
  }
756
649
 
757
- /**
758
- * MIT License
759
- * Copyright (c) 2025 ReifyDB
760
- * See license.md file for full license text
761
- */
762
-
763
650
  declare class Uint8Value implements Value {
764
651
  readonly type: Type;
765
652
  readonly value?: bigint;
@@ -777,12 +664,6 @@ declare class Uint8Value implements Value {
777
664
  encode(): TypeValuePair;
778
665
  }
779
666
 
780
- /**
781
- * MIT License
782
- * Copyright (c) 2025 ReifyDB
783
- * See license.md file for full license text
784
- */
785
-
786
667
  declare class Uint16Value implements Value {
787
668
  readonly type: Type;
788
669
  readonly value?: bigint;
@@ -799,60 +680,20 @@ declare class Uint16Value implements Value {
799
680
  encode(): TypeValuePair;
800
681
  }
801
682
 
802
- /**
803
- * MIT License
804
- * Copyright (c) 2025 ReifyDB
805
- * See license.md file for full license text
806
- */
807
-
808
- /**
809
- * An undefined value wrapper type
810
- */
811
- declare class UndefinedValue implements Value {
683
+ declare class NoneValue implements Value {
812
684
  readonly type: Type;
813
- constructor();
814
- /**
815
- * Create a new UndefinedValue
816
- */
817
- static new(): UndefinedValue;
818
- /**
819
- * Get default UndefinedValue
820
- */
821
- static default(): UndefinedValue;
822
- /**
823
- * Parse a string as undefined
824
- */
825
- static parse(str: string): UndefinedValue;
826
- /**
827
- * Check if this value is undefined (always true)
828
- */
829
- isUndefined(): boolean;
830
- /**
831
- * Format as string
832
- */
685
+ readonly innerType: BaseType;
686
+ constructor(innerType?: BaseType);
687
+ static parse(str: string, innerType?: BaseType): NoneValue;
688
+ isNone(): boolean;
833
689
  toString(): string;
834
690
  valueOf(): undefined;
835
- /**
836
- * Get the internal representation (always undefined)
837
- */
838
691
  get value(): undefined;
839
- /**
840
- * Compare two undefined values (always equal)
841
- */
842
692
  equals(other: Value): boolean;
843
- /**
844
- * Compare two undefined values for ordering (always equal)
845
- */
846
- compare(other: UndefinedValue): number;
693
+ compare(other: NoneValue): number;
847
694
  encode(): TypeValuePair;
848
695
  }
849
696
 
850
- /**
851
- * MIT License
852
- * Copyright (c) 2025 ReifyDB
853
- * See license.md file for full license text
854
- */
855
-
856
697
  declare class Utf8Value implements Value {
857
698
  readonly type: Type;
858
699
  readonly value?: string;
@@ -867,12 +708,6 @@ declare class Utf8Value implements Value {
867
708
  encode(): TypeValuePair;
868
709
  }
869
710
 
870
- /**
871
- * MIT License
872
- * Copyright (c) 2025 ReifyDB
873
- * See license.md file for full license text
874
- */
875
-
876
711
  /**
877
712
  * A UUID version 4 (random) value type
878
713
  */
@@ -936,12 +771,6 @@ declare class Uuid4Value implements Value {
936
771
  encode(): TypeValuePair;
937
772
  }
938
773
 
939
- /**
940
- * MIT License
941
- * Copyright (c) 2025 ReifyDB
942
- * See license.md file for full license text
943
- */
944
-
945
774
  /**
946
775
  * A UUID version 7 (timestamp-based) value type
947
776
  */
@@ -1010,12 +839,6 @@ declare class Uuid7Value implements Value {
1010
839
  encode(): TypeValuePair;
1011
840
  }
1012
841
 
1013
- /**
1014
- * MIT License
1015
- * Copyright (c) 2025 ReifyDB
1016
- * See license.md file for full license text
1017
- */
1018
-
1019
842
  /**
1020
843
  * An IdentityId value type that wraps a UUID v7
1021
844
  */
@@ -1058,13 +881,13 @@ declare class IdentityIdValue implements Value {
1058
881
  encode(): TypeValuePair;
1059
882
  }
1060
883
 
1061
- /**
1062
- * MIT License
1063
- * Copyright (c) 2025 ReifyDB
1064
- * See license.md file for full license text
1065
- */
1066
-
1067
- 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" | "IdentityId";
884
+ type BaseType = "Blob" | "Boolean" | "Decimal" | "Float4" | "Float8" | "Int1" | "Int2" | "Int4" | "Int8" | "Int16" | "Uint1" | "Uint2" | "Uint4" | "Uint8" | "Uint16" | "Utf8" | "Date" | "DateTime" | "Time" | "Duration" | "Uuid4" | "Uuid7" | "IdentityId" | "None";
885
+ interface OptionType {
886
+ Option: Type;
887
+ }
888
+ type Type = BaseType | OptionType;
889
+ declare function isOptionType(t: Type): t is OptionType;
890
+ declare function unwrapOptionType(t: Type): BaseType;
1068
891
  interface TypeValuePair {
1069
892
  type: Type;
1070
893
  value: string;
@@ -1075,35 +898,17 @@ declare abstract class Value {
1075
898
  abstract equals(other: Value): boolean;
1076
899
  }
1077
900
 
1078
- /**
1079
- * MIT License
1080
- * Copyright (c) 2025 ReifyDB
1081
- * See license.md file for full license text
1082
- */
1083
-
1084
901
  declare function decode(pair: TypeValuePair): Value;
1085
902
 
1086
- /**
1087
- * MIT License
1088
- * Copyright (c) 2025 ReifyDB
1089
- * See license.md file for full license text
1090
- */
1091
-
1092
- 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 'IdentityId' ? string : never;
1093
- 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 'IdentityId' ? IdentityIdValue : never;
1094
- 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> ? {
903
+ type PrimitiveToTS<T extends BaseType> = 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 'None' ? undefined : T extends 'IdentityId' ? string : never;
904
+ type PrimitiveToValue<T extends BaseType> = 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 'None' ? NoneValue : T extends 'IdentityId' ? IdentityIdValue : never;
905
+ type InferSchema<S> = S extends PrimitiveSchemaNode<infer T> ? T extends BaseType ? PrimitiveToTS<T> : never : S extends ValueSchemaNode<infer T> ? T extends BaseType ? PrimitiveToValue<T> : never : S extends ObjectSchemaNode<infer P> ? {
1095
906
  [K in keyof P]: InferSchema<P[K]>;
1096
907
  } : S extends ArraySchemaNode<infer T> ? InferSchema<T>[] : S extends OptionalSchemaNode<infer T> ? InferSchema<T> | undefined : never;
1097
908
  type InferSchemas<S extends readonly SchemaNode[]> = {
1098
909
  [K in keyof S]: InferSchema<S[K]>[];
1099
910
  };
1100
911
 
1101
- /**
1102
- * MIT License
1103
- * Copyright (c) 2025 ReifyDB
1104
- * See license.md file for full license text
1105
- */
1106
-
1107
912
  declare class SchemaBuilder {
1108
913
  static blob(): PrimitiveSchemaNode<'Blob'>;
1109
914
  static bool(): PrimitiveSchemaNode<'Boolean'>;
@@ -1134,7 +939,7 @@ declare class SchemaBuilder {
1134
939
  static uuid4(): PrimitiveSchemaNode<'Uuid4'>;
1135
940
  static uuid7(): PrimitiveSchemaNode<'Uuid7'>;
1136
941
  static uuid(): PrimitiveSchemaNode<'Uuid7'>;
1137
- static undefined(): PrimitiveSchemaNode<'Undefined'>;
942
+ static none(): PrimitiveSchemaNode<'None'>;
1138
943
  static identityid(): PrimitiveSchemaNode<'IdentityId'>;
1139
944
  static object<P extends Record<string, SchemaNode>>(properties: P): ObjectSchemaNode<P>;
1140
945
  static array<T extends SchemaNode>(items: T): ArraySchemaNode<T>;
@@ -1161,33 +966,16 @@ declare class SchemaBuilder {
1161
966
  static durationValue(): ValueSchemaNode<'Duration'>;
1162
967
  static uuid4Value(): ValueSchemaNode<'Uuid4'>;
1163
968
  static uuid7Value(): ValueSchemaNode<'Uuid7'>;
1164
- static undefinedValue(): ValueSchemaNode<'Undefined'>;
969
+ static noneValue(): ValueSchemaNode<'None'>;
1165
970
  static blobValue(): ValueSchemaNode<'Blob'>;
1166
971
  static identityIdValue(): ValueSchemaNode<'IdentityId'>;
1167
972
  }
1168
973
  declare const Schema: typeof SchemaBuilder;
1169
974
 
1170
- /**
1171
- * MIT License
1172
- * Copyright (c) 2025 ReifyDB
1173
- * See license.md file for full license text
1174
- */
1175
-
1176
975
  declare function parseValue(schema: SchemaNode, value: any): any;
1177
976
 
1178
- /**
1179
- * MIT License
1180
- * Copyright (c) 2025 ReifyDB
1181
- * See license.md file for full license text
1182
- */
1183
-
1184
977
  declare function validateSchema(schema: SchemaNode, value: any): boolean;
1185
978
 
1186
- /**
1187
- * MIT License
1188
- * Copyright (c) 2025 ReifyDB
1189
- * See license.md file for full license text
1190
- */
1191
979
  interface PrimitiveSchemaNode<T extends string = string> {
1192
980
  kind: 'primitive';
1193
981
  type: T;
@@ -1210,12 +998,6 @@ interface ValueSchemaNode<T extends string = string> {
1210
998
  }
1211
999
  type SchemaNode = PrimitiveSchemaNode | ObjectSchemaNode | ArraySchemaNode | OptionalSchemaNode | ValueSchemaNode;
1212
1000
 
1213
- /**
1214
- * MIT License
1215
- * Copyright (c) 2025 ReifyDB
1216
- * See license.md file for full license text
1217
- */
1218
-
1219
1001
  type Params = (TypeValuePair | null)[] | Record<string, TypeValuePair | null>;
1220
1002
  interface Frame {
1221
1003
  columns: Column[];
@@ -1278,4 +1060,4 @@ type SingleFrameResult<S extends SchemaNode> = InferSchema<S>[];
1278
1060
  */
1279
1061
  declare function asFrameResults<S extends readonly SchemaNode[]>(results: any): FrameResults<S>;
1280
1062
 
1281
- 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, 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 };
1063
+ export { type ArraySchemaNode, type BaseType, 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, NONE_VALUE, NoneValue, type ObjectSchemaNode, type OptionType, type OptionalSchemaNode, type Params, type PrimitiveSchemaNode, type PrimitiveToTS, type PrimitiveToValue, ReifyError, Schema, SchemaBuilder, type SchemaNode, type SingleFrameResult, TimeValue, type Type, type TypeValuePair, Uint16Value, Uint1Value, Uint2Value, Uint4Value, Uint8Value, Utf8Value, Uuid4Value, Uuid7Value, Value, type ValueSchemaNode, asFrameResults, decode, isOptionType, parseValue, unwrapOptionType, validateSchema };