@reifydb/core 0.1.7 → 0.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 CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/constant.ts
2
- var UNDEFINED_VALUE = "\u27EAundefined\u27EB";
2
+ var NONE_VALUE = "\u27EAnone\u27EB";
3
3
 
4
4
  // src/value/blob.ts
5
5
  var BlobValue = class _BlobValue {
@@ -101,7 +101,7 @@ var BlobValue = class _BlobValue {
101
101
  */
102
102
  static parse(str) {
103
103
  const trimmed = str.trim();
104
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
104
+ if (trimmed === "" || trimmed === NONE_VALUE) {
105
105
  return new _BlobValue(void 0);
106
106
  }
107
107
  const parsed = _BlobValue.parseString(trimmed);
@@ -161,7 +161,7 @@ var BlobValue = class _BlobValue {
161
161
  */
162
162
  toString() {
163
163
  if (this.bytes === void 0) {
164
- return "undefined";
164
+ return "none";
165
165
  }
166
166
  return this.toHex();
167
167
  }
@@ -218,7 +218,7 @@ var BlobValue = class _BlobValue {
218
218
  encode() {
219
219
  return {
220
220
  type: this.type,
221
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
221
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
222
222
  };
223
223
  }
224
224
  };
@@ -238,7 +238,7 @@ var BooleanValue = class _BooleanValue {
238
238
  }
239
239
  static parse(str) {
240
240
  const trimmed = str.trim().toLowerCase();
241
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
241
+ if (trimmed === "" || trimmed === NONE_VALUE) {
242
242
  return new _BooleanValue(void 0);
243
243
  }
244
244
  if (trimmed === "true") {
@@ -253,7 +253,7 @@ var BooleanValue = class _BooleanValue {
253
253
  return this.value;
254
254
  }
255
255
  toString() {
256
- return this.value === void 0 ? "undefined" : this.value.toString();
256
+ return this.value === void 0 ? "none" : this.value.toString();
257
257
  }
258
258
  /**
259
259
  * Compare two boolean values for equality
@@ -268,7 +268,7 @@ var BooleanValue = class _BooleanValue {
268
268
  encode() {
269
269
  return {
270
270
  type: this.type,
271
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
271
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
272
272
  };
273
273
  }
274
274
  };
@@ -335,7 +335,7 @@ var DateValue = class _DateValue {
335
335
  */
336
336
  static parse(str) {
337
337
  const trimmed = str.trim();
338
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
338
+ if (trimmed === "" || trimmed === NONE_VALUE) {
339
339
  return new _DateValue(void 0);
340
340
  }
341
341
  const parsed = _DateValue.parseDate(trimmed);
@@ -414,7 +414,7 @@ var DateValue = class _DateValue {
414
414
  */
415
415
  toString() {
416
416
  if (this.months === void 0 || this.days === void 0) {
417
- return "undefined";
417
+ return "none";
418
418
  }
419
419
  const year = Math.floor(this.months / 12);
420
420
  let m = this.months % 12;
@@ -505,7 +505,7 @@ var DateValue = class _DateValue {
505
505
  encode() {
506
506
  return {
507
507
  type: this.type,
508
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
508
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
509
509
  };
510
510
  }
511
511
  };
@@ -581,7 +581,7 @@ var _TimeValue = class _TimeValue {
581
581
  */
582
582
  static parse(str) {
583
583
  const trimmed = str.trim();
584
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
584
+ if (trimmed === "" || trimmed === NONE_VALUE) {
585
585
  return new _TimeValue(void 0);
586
586
  }
587
587
  const parsed = _TimeValue.parseTime(trimmed);
@@ -638,7 +638,7 @@ var _TimeValue = class _TimeValue {
638
638
  */
639
639
  toString() {
640
640
  if (this.value === void 0) {
641
- return "undefined";
641
+ return "none";
642
642
  }
643
643
  const hour = this.hour();
644
644
  const minute = this.minute();
@@ -694,7 +694,7 @@ var _TimeValue = class _TimeValue {
694
694
  encode() {
695
695
  return {
696
696
  type: this.type,
697
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
697
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
698
698
  };
699
699
  }
700
700
  };
@@ -846,7 +846,7 @@ var DateTimeValue = class _DateTimeValue {
846
846
  */
847
847
  static parse(str) {
848
848
  const trimmed = str.trim();
849
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
849
+ if (trimmed === "" || trimmed === NONE_VALUE) {
850
850
  return new _DateTimeValue(void 0);
851
851
  }
852
852
  const parsed = _DateTimeValue.parseDateTime(trimmed);
@@ -918,7 +918,7 @@ var DateTimeValue = class _DateTimeValue {
918
918
  */
919
919
  toString() {
920
920
  if (this.months === void 0 || this.days === void 0 || this.nanos === void 0) {
921
- return "undefined";
921
+ return "none";
922
922
  }
923
923
  const year = Math.floor(this.months / 12);
924
924
  let m = this.months % 12;
@@ -1046,7 +1046,7 @@ var DateTimeValue = class _DateTimeValue {
1046
1046
  encode() {
1047
1047
  return {
1048
1048
  type: this.type,
1049
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1049
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1050
1050
  };
1051
1051
  }
1052
1052
  };
@@ -1065,7 +1065,7 @@ var DecimalValue = class _DecimalValue {
1065
1065
  }
1066
1066
  }
1067
1067
  static parse(str) {
1068
- if (str === UNDEFINED_VALUE) {
1068
+ if (str === NONE_VALUE) {
1069
1069
  return new _DecimalValue(void 0);
1070
1070
  }
1071
1071
  return new _DecimalValue(str);
@@ -1074,7 +1074,7 @@ var DecimalValue = class _DecimalValue {
1074
1074
  return this.value;
1075
1075
  }
1076
1076
  toString() {
1077
- return this.value === void 0 ? "undefined" : this.value;
1077
+ return this.value === void 0 ? "none" : this.value;
1078
1078
  }
1079
1079
  equals(other) {
1080
1080
  if (other.type !== this.type) {
@@ -1086,7 +1086,7 @@ var DecimalValue = class _DecimalValue {
1086
1086
  encode() {
1087
1087
  return {
1088
1088
  type: this.type,
1089
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1089
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1090
1090
  };
1091
1091
  }
1092
1092
  };
@@ -1120,7 +1120,7 @@ var _Float4Value = class _Float4Value {
1120
1120
  }
1121
1121
  static parse(str) {
1122
1122
  const trimmed = str.trim();
1123
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
1123
+ if (trimmed === "" || trimmed === NONE_VALUE) {
1124
1124
  return new _Float4Value(void 0);
1125
1125
  }
1126
1126
  const num = Number(trimmed);
@@ -1133,7 +1133,7 @@ var _Float4Value = class _Float4Value {
1133
1133
  return this.value;
1134
1134
  }
1135
1135
  toString() {
1136
- return this.value === void 0 ? "undefined" : this.value.toString();
1136
+ return this.value === void 0 ? "none" : this.value.toString();
1137
1137
  }
1138
1138
  /**
1139
1139
  * Compare two Float4 values for equality with limited precision
@@ -1152,7 +1152,7 @@ var _Float4Value = class _Float4Value {
1152
1152
  encode() {
1153
1153
  return {
1154
1154
  type: this.type,
1155
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1155
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1156
1156
  };
1157
1157
  }
1158
1158
  };
@@ -1176,7 +1176,7 @@ var Float8Value = class _Float8Value {
1176
1176
  }
1177
1177
  static parse(str) {
1178
1178
  const trimmed = str.trim();
1179
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
1179
+ if (trimmed === "" || trimmed === NONE_VALUE) {
1180
1180
  return new _Float8Value(void 0);
1181
1181
  }
1182
1182
  const num = Number(trimmed);
@@ -1189,7 +1189,7 @@ var Float8Value = class _Float8Value {
1189
1189
  return this.value;
1190
1190
  }
1191
1191
  toString() {
1192
- return this.value === void 0 ? "undefined" : this.value.toString();
1192
+ return this.value === void 0 ? "none" : this.value.toString();
1193
1193
  }
1194
1194
  /**
1195
1195
  * Compare two Float8 values for equality
@@ -1204,7 +1204,7 @@ var Float8Value = class _Float8Value {
1204
1204
  encode() {
1205
1205
  return {
1206
1206
  type: this.type,
1207
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1207
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1208
1208
  };
1209
1209
  }
1210
1210
  };
@@ -1225,7 +1225,7 @@ var _Int1Value = class _Int1Value {
1225
1225
  }
1226
1226
  static parse(str) {
1227
1227
  const trimmed = str.trim();
1228
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
1228
+ if (trimmed === "" || trimmed === NONE_VALUE) {
1229
1229
  return new _Int1Value(void 0);
1230
1230
  }
1231
1231
  const num = Number(trimmed);
@@ -1238,7 +1238,7 @@ var _Int1Value = class _Int1Value {
1238
1238
  return this.value;
1239
1239
  }
1240
1240
  toString() {
1241
- return this.value === void 0 ? "undefined" : this.value.toString();
1241
+ return this.value === void 0 ? "none" : this.value.toString();
1242
1242
  }
1243
1243
  /**
1244
1244
  * Compare two Int1 values for equality
@@ -1253,7 +1253,7 @@ var _Int1Value = class _Int1Value {
1253
1253
  encode() {
1254
1254
  return {
1255
1255
  type: this.type,
1256
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1256
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1257
1257
  };
1258
1258
  }
1259
1259
  };
@@ -1277,7 +1277,7 @@ var _Int2Value = class _Int2Value {
1277
1277
  }
1278
1278
  static parse(str) {
1279
1279
  const trimmed = str.trim();
1280
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
1280
+ if (trimmed === "" || trimmed === NONE_VALUE) {
1281
1281
  return new _Int2Value(void 0);
1282
1282
  }
1283
1283
  const num = Number(trimmed);
@@ -1290,7 +1290,7 @@ var _Int2Value = class _Int2Value {
1290
1290
  return this.value;
1291
1291
  }
1292
1292
  toString() {
1293
- return this.value === void 0 ? "undefined" : this.value.toString();
1293
+ return this.value === void 0 ? "none" : this.value.toString();
1294
1294
  }
1295
1295
  /**
1296
1296
  * Compare two Int2 values for equality
@@ -1305,7 +1305,7 @@ var _Int2Value = class _Int2Value {
1305
1305
  encode() {
1306
1306
  return {
1307
1307
  type: this.type,
1308
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1308
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1309
1309
  };
1310
1310
  }
1311
1311
  };
@@ -1329,7 +1329,7 @@ var _Int4Value = class _Int4Value {
1329
1329
  }
1330
1330
  static parse(str) {
1331
1331
  const trimmed = str.trim();
1332
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
1332
+ if (trimmed === "" || trimmed === NONE_VALUE) {
1333
1333
  return new _Int4Value(void 0);
1334
1334
  }
1335
1335
  const num = Number(trimmed);
@@ -1342,7 +1342,7 @@ var _Int4Value = class _Int4Value {
1342
1342
  return this.value;
1343
1343
  }
1344
1344
  toString() {
1345
- return this.value === void 0 ? "undefined" : this.value.toString();
1345
+ return this.value === void 0 ? "none" : this.value.toString();
1346
1346
  }
1347
1347
  /**
1348
1348
  * Compare two Int4 values for equality
@@ -1357,7 +1357,7 @@ var _Int4Value = class _Int4Value {
1357
1357
  encode() {
1358
1358
  return {
1359
1359
  type: this.type,
1360
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1360
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1361
1361
  };
1362
1362
  }
1363
1363
  };
@@ -1381,7 +1381,7 @@ var _Int8Value = class _Int8Value {
1381
1381
  }
1382
1382
  static parse(str) {
1383
1383
  const trimmed = str.trim();
1384
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
1384
+ if (trimmed === "" || trimmed === NONE_VALUE) {
1385
1385
  return new _Int8Value(void 0);
1386
1386
  }
1387
1387
  let value;
@@ -1399,7 +1399,7 @@ var _Int8Value = class _Int8Value {
1399
1399
  return this.value;
1400
1400
  }
1401
1401
  toString() {
1402
- return this.value === void 0 ? "undefined" : this.value.toString();
1402
+ return this.value === void 0 ? "none" : this.value.toString();
1403
1403
  }
1404
1404
  /**
1405
1405
  * Compare two Int8 values for equality
@@ -1414,7 +1414,7 @@ var _Int8Value = class _Int8Value {
1414
1414
  encode() {
1415
1415
  return {
1416
1416
  type: this.type,
1417
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1417
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1418
1418
  };
1419
1419
  }
1420
1420
  };
@@ -1449,7 +1449,7 @@ var _Int16Value = class _Int16Value {
1449
1449
  }
1450
1450
  static parse(str) {
1451
1451
  const trimmed = str.trim();
1452
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
1452
+ if (trimmed === "" || trimmed === NONE_VALUE) {
1453
1453
  return new _Int16Value(void 0);
1454
1454
  }
1455
1455
  let value;
@@ -1467,7 +1467,7 @@ var _Int16Value = class _Int16Value {
1467
1467
  return this.value;
1468
1468
  }
1469
1469
  toString() {
1470
- return this.value === void 0 ? "undefined" : this.value.toString();
1470
+ return this.value === void 0 ? "none" : this.value.toString();
1471
1471
  }
1472
1472
  /**
1473
1473
  * Compare two Int16 values for equality
@@ -1482,7 +1482,7 @@ var _Int16Value = class _Int16Value {
1482
1482
  encode() {
1483
1483
  return {
1484
1484
  type: this.type,
1485
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1485
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1486
1486
  };
1487
1487
  }
1488
1488
  };
@@ -1600,7 +1600,7 @@ var DurationValue = class _DurationValue {
1600
1600
  */
1601
1601
  static parse(str) {
1602
1602
  const trimmed = str.trim();
1603
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
1603
+ if (trimmed === "" || trimmed === NONE_VALUE) {
1604
1604
  return new _DurationValue(void 0);
1605
1605
  }
1606
1606
  const parsed = _DurationValue.parseDuration(trimmed);
@@ -1703,7 +1703,7 @@ var DurationValue = class _DurationValue {
1703
1703
  */
1704
1704
  toIsoString() {
1705
1705
  if (this.months === void 0 || this.days === void 0 || this.nanos === void 0) {
1706
- return "undefined";
1706
+ return "none";
1707
1707
  }
1708
1708
  if (this.months === 0 && this.days === 0 && this.nanos === 0n) {
1709
1709
  return "PT0S";
@@ -1755,7 +1755,7 @@ var DurationValue = class _DurationValue {
1755
1755
  */
1756
1756
  toString() {
1757
1757
  if (this.months === void 0 || this.days === void 0 || this.nanos === void 0) {
1758
- return "undefined";
1758
+ return "none";
1759
1759
  }
1760
1760
  if (this.months === 0 && this.days === 0 && this.nanos === 0n) {
1761
1761
  return "00:00:00";
@@ -1874,12 +1874,12 @@ var DurationValue = class _DurationValue {
1874
1874
  return this.months === otherDuration.months && this.days === otherDuration.days && this.nanos === otherDuration.nanos;
1875
1875
  }
1876
1876
  toJSON() {
1877
- return this.value === void 0 ? UNDEFINED_VALUE : this.toIsoString();
1877
+ return this.value === void 0 ? NONE_VALUE : this.toIsoString();
1878
1878
  }
1879
1879
  encode() {
1880
1880
  return {
1881
1881
  type: this.type,
1882
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toIsoString()
1882
+ value: this.value === void 0 ? NONE_VALUE : this.toIsoString()
1883
1883
  };
1884
1884
  }
1885
1885
  };
@@ -1900,7 +1900,7 @@ var _Uint1Value = class _Uint1Value {
1900
1900
  }
1901
1901
  static parse(str) {
1902
1902
  const trimmed = str.trim();
1903
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
1903
+ if (trimmed === "" || trimmed === NONE_VALUE) {
1904
1904
  return new _Uint1Value(void 0);
1905
1905
  }
1906
1906
  const num = Number(trimmed);
@@ -1913,7 +1913,7 @@ var _Uint1Value = class _Uint1Value {
1913
1913
  return this.value;
1914
1914
  }
1915
1915
  toString() {
1916
- return this.value === void 0 ? "undefined" : this.value.toString();
1916
+ return this.value === void 0 ? "none" : this.value.toString();
1917
1917
  }
1918
1918
  /**
1919
1919
  * Compare two Uint1 values for equality
@@ -1928,7 +1928,7 @@ var _Uint1Value = class _Uint1Value {
1928
1928
  encode() {
1929
1929
  return {
1930
1930
  type: this.type,
1931
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1931
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1932
1932
  };
1933
1933
  }
1934
1934
  };
@@ -1952,7 +1952,7 @@ var _Uint2Value = class _Uint2Value {
1952
1952
  }
1953
1953
  static parse(str) {
1954
1954
  const trimmed = str.trim();
1955
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
1955
+ if (trimmed === "" || trimmed === NONE_VALUE) {
1956
1956
  return new _Uint2Value(void 0);
1957
1957
  }
1958
1958
  const num = Number(trimmed);
@@ -1965,7 +1965,7 @@ var _Uint2Value = class _Uint2Value {
1965
1965
  return this.value;
1966
1966
  }
1967
1967
  toString() {
1968
- return this.value === void 0 ? "undefined" : this.value.toString();
1968
+ return this.value === void 0 ? "none" : this.value.toString();
1969
1969
  }
1970
1970
  /**
1971
1971
  * Compare two Uint2 values for equality
@@ -1980,7 +1980,7 @@ var _Uint2Value = class _Uint2Value {
1980
1980
  encode() {
1981
1981
  return {
1982
1982
  type: this.type,
1983
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
1983
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
1984
1984
  };
1985
1985
  }
1986
1986
  };
@@ -2004,7 +2004,7 @@ var _Uint4Value = class _Uint4Value {
2004
2004
  }
2005
2005
  static parse(str) {
2006
2006
  const trimmed = str.trim();
2007
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
2007
+ if (trimmed === "" || trimmed === NONE_VALUE) {
2008
2008
  return new _Uint4Value(void 0);
2009
2009
  }
2010
2010
  const num = Number(trimmed);
@@ -2017,7 +2017,7 @@ var _Uint4Value = class _Uint4Value {
2017
2017
  return this.value;
2018
2018
  }
2019
2019
  toString() {
2020
- return this.value === void 0 ? "undefined" : this.value.toString();
2020
+ return this.value === void 0 ? "none" : this.value.toString();
2021
2021
  }
2022
2022
  /**
2023
2023
  * Compare two Uint4 values for equality
@@ -2032,7 +2032,7 @@ var _Uint4Value = class _Uint4Value {
2032
2032
  encode() {
2033
2033
  return {
2034
2034
  type: this.type,
2035
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
2035
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
2036
2036
  };
2037
2037
  }
2038
2038
  };
@@ -2056,7 +2056,7 @@ var _Uint8Value = class _Uint8Value {
2056
2056
  }
2057
2057
  static parse(str) {
2058
2058
  const trimmed = str.trim();
2059
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
2059
+ if (trimmed === "" || trimmed === NONE_VALUE) {
2060
2060
  return new _Uint8Value(void 0);
2061
2061
  }
2062
2062
  let value;
@@ -2078,7 +2078,7 @@ var _Uint8Value = class _Uint8Value {
2078
2078
  return Number(this.value);
2079
2079
  }
2080
2080
  toString() {
2081
- return this.value === void 0 ? "undefined" : this.value.toString();
2081
+ return this.value === void 0 ? "none" : this.value.toString();
2082
2082
  }
2083
2083
  /**
2084
2084
  * Compare two Uint8 values for equality
@@ -2093,7 +2093,7 @@ var _Uint8Value = class _Uint8Value {
2093
2093
  encode() {
2094
2094
  return {
2095
2095
  type: this.type,
2096
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
2096
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
2097
2097
  };
2098
2098
  }
2099
2099
  };
@@ -2128,7 +2128,7 @@ var _Uint16Value = class _Uint16Value {
2128
2128
  }
2129
2129
  static parse(str) {
2130
2130
  const trimmed = str.trim();
2131
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
2131
+ if (trimmed === "" || trimmed === NONE_VALUE) {
2132
2132
  return new _Uint16Value(void 0);
2133
2133
  }
2134
2134
  let value;
@@ -2146,7 +2146,7 @@ var _Uint16Value = class _Uint16Value {
2146
2146
  return this.value;
2147
2147
  }
2148
2148
  toString() {
2149
- return this.value === void 0 ? "undefined" : this.value.toString();
2149
+ return this.value === void 0 ? "none" : this.value.toString();
2150
2150
  }
2151
2151
  /**
2152
2152
  * Compare two Uint16 values for equality
@@ -2161,7 +2161,7 @@ var _Uint16Value = class _Uint16Value {
2161
2161
  encode() {
2162
2162
  return {
2163
2163
  type: this.type,
2164
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
2164
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
2165
2165
  };
2166
2166
  }
2167
2167
  };
@@ -2169,130 +2169,44 @@ _Uint16Value.MIN_VALUE = BigInt(0);
2169
2169
  _Uint16Value.MAX_VALUE = BigInt("340282366920938463463374607431768211455");
2170
2170
  var Uint16Value = _Uint16Value;
2171
2171
 
2172
- // src/value/rownumber.ts
2173
- var _RowNumberValue = class _RowNumberValue {
2174
- constructor(value) {
2175
- this.type = "RowNumber";
2176
- if (value !== void 0) {
2177
- const bigintValue = typeof value === "number" ? BigInt(Math.trunc(value)) : value;
2178
- if (bigintValue < _RowNumberValue.MIN_VALUE || bigintValue > _RowNumberValue.MAX_VALUE) {
2179
- throw new Error(`RowNumber value must be between ${_RowNumberValue.MIN_VALUE} and ${_RowNumberValue.MAX_VALUE}, got ${bigintValue}`);
2180
- }
2181
- this.value = bigintValue;
2182
- } else {
2183
- this.value = void 0;
2184
- }
2185
- }
2186
- static parse(str) {
2187
- const trimmed = str.trim();
2188
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
2189
- return new _RowNumberValue(void 0);
2190
- }
2191
- let value;
2192
- try {
2193
- value = BigInt(trimmed);
2194
- } catch (e) {
2195
- throw new Error(`Cannot parse "${str}" as RowNumber`);
2196
- }
2197
- if (value < _RowNumberValue.MIN_VALUE || value > _RowNumberValue.MAX_VALUE) {
2198
- throw new Error(`RowNumber value must be between ${_RowNumberValue.MIN_VALUE} and ${_RowNumberValue.MAX_VALUE}, got ${value}`);
2199
- }
2200
- return new _RowNumberValue(value);
2201
- }
2202
- valueOf() {
2203
- return this.value;
2204
- }
2205
- toString() {
2206
- return this.value === void 0 ? "undefined" : this.value.toString();
2207
- }
2208
- /**
2209
- * Compare two RowNumber values for equality
2210
- */
2211
- equals(other) {
2212
- if (other.type !== this.type) {
2213
- return false;
2214
- }
2215
- const otherRowNumber = other;
2216
- return this.value === otherRowNumber.value;
2217
- }
2218
- encode() {
2219
- return {
2220
- type: this.type,
2221
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
2222
- };
2223
- }
2224
- };
2225
- _RowNumberValue.MIN_VALUE = BigInt(0);
2226
- _RowNumberValue.MAX_VALUE = BigInt("18446744073709551615");
2227
- var RowNumberValue = _RowNumberValue;
2228
-
2229
- // src/value/undefined.ts
2230
- var UndefinedValue = class _UndefinedValue {
2231
- constructor() {
2232
- this.type = "Undefined";
2233
- }
2234
- /**
2235
- * Create a new UndefinedValue
2236
- */
2237
- static new() {
2238
- return new _UndefinedValue();
2239
- }
2240
- /**
2241
- * Get default UndefinedValue
2242
- */
2243
- static default() {
2244
- return new _UndefinedValue();
2172
+ // src/value/none.ts
2173
+ var NoneValue = class _NoneValue {
2174
+ constructor(innerType) {
2175
+ this.type = "None";
2176
+ this.innerType = innerType ?? "None";
2245
2177
  }
2246
- /**
2247
- * Parse a string as undefined
2248
- */
2249
- static parse(str) {
2178
+ static parse(str, innerType) {
2250
2179
  const trimmed = str.trim();
2251
- if (trimmed === "" || trimmed === UNDEFINED_VALUE || trimmed === "undefined") {
2252
- return new _UndefinedValue();
2180
+ if (trimmed === "" || trimmed === NONE_VALUE || trimmed === "none") {
2181
+ return new _NoneValue(innerType);
2253
2182
  }
2254
- throw new Error(`Cannot parse "${str}" as Undefined`);
2183
+ throw new Error(`Cannot parse "${str}" as None`);
2255
2184
  }
2256
- /**
2257
- * Check if this value is undefined (always true)
2258
- */
2259
- isUndefined() {
2185
+ isNone() {
2260
2186
  return true;
2261
2187
  }
2262
- /**
2263
- * Format as string
2264
- */
2265
2188
  toString() {
2266
- return "undefined";
2189
+ return "none";
2267
2190
  }
2268
2191
  valueOf() {
2269
2192
  return void 0;
2270
2193
  }
2271
- /**
2272
- * Get the internal representation (always undefined)
2273
- */
2274
2194
  get value() {
2275
2195
  return void 0;
2276
2196
  }
2277
- /**
2278
- * Compare two undefined values (always equal)
2279
- */
2280
2197
  equals(other) {
2281
- if (other.type !== this.type) {
2198
+ if (!(other instanceof _NoneValue)) {
2282
2199
  return false;
2283
2200
  }
2284
2201
  return true;
2285
2202
  }
2286
- /**
2287
- * Compare two undefined values for ordering (always equal)
2288
- */
2289
2203
  compare(other) {
2290
2204
  return 0;
2291
2205
  }
2292
2206
  encode() {
2293
2207
  return {
2294
- type: this.type,
2295
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
2208
+ type: "None",
2209
+ value: NONE_VALUE
2296
2210
  };
2297
2211
  }
2298
2212
  };
@@ -2311,7 +2225,7 @@ var Utf8Value = class _Utf8Value {
2311
2225
  }
2312
2226
  }
2313
2227
  static parse(str) {
2314
- if (str === UNDEFINED_VALUE) {
2228
+ if (str === NONE_VALUE) {
2315
2229
  return new _Utf8Value(void 0);
2316
2230
  }
2317
2231
  return new _Utf8Value(str);
@@ -2320,7 +2234,7 @@ var Utf8Value = class _Utf8Value {
2320
2234
  return this.value;
2321
2235
  }
2322
2236
  toString() {
2323
- return this.value === void 0 ? "undefined" : this.value;
2237
+ return this.value === void 0 ? "none" : this.value;
2324
2238
  }
2325
2239
  /**
2326
2240
  * Compare two Utf8 values for equality
@@ -2335,7 +2249,7 @@ var Utf8Value = class _Utf8Value {
2335
2249
  encode() {
2336
2250
  return {
2337
2251
  type: this.type,
2338
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
2252
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
2339
2253
  };
2340
2254
  }
2341
2255
  };
@@ -2390,7 +2304,7 @@ var Uuid4Value = class _Uuid4Value {
2390
2304
  */
2391
2305
  static parse(str) {
2392
2306
  const trimmed = str.trim();
2393
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
2307
+ if (trimmed === "" || trimmed === NONE_VALUE) {
2394
2308
  return new _Uuid4Value(void 0);
2395
2309
  }
2396
2310
  if (!validate(trimmed)) {
@@ -2438,7 +2352,7 @@ var Uuid4Value = class _Uuid4Value {
2438
2352
  */
2439
2353
  toString() {
2440
2354
  if (this.uuid === void 0) {
2441
- return "undefined";
2355
+ return "none";
2442
2356
  }
2443
2357
  return this.uuid;
2444
2358
  }
@@ -2481,7 +2395,7 @@ var Uuid4Value = class _Uuid4Value {
2481
2395
  encode() {
2482
2396
  return {
2483
2397
  type: this.type,
2484
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
2398
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
2485
2399
  };
2486
2400
  }
2487
2401
  };
@@ -2536,7 +2450,7 @@ var Uuid7Value = class _Uuid7Value {
2536
2450
  */
2537
2451
  static parse(str) {
2538
2452
  const trimmed = str.trim();
2539
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
2453
+ if (trimmed === "" || trimmed === NONE_VALUE) {
2540
2454
  return new _Uuid7Value(void 0);
2541
2455
  }
2542
2456
  if (!validate2(trimmed)) {
@@ -2594,7 +2508,7 @@ var Uuid7Value = class _Uuid7Value {
2594
2508
  */
2595
2509
  toString() {
2596
2510
  if (this.uuid === void 0) {
2597
- return "undefined";
2511
+ return "none";
2598
2512
  }
2599
2513
  return this.uuid;
2600
2514
  }
@@ -2638,7 +2552,7 @@ var Uuid7Value = class _Uuid7Value {
2638
2552
  encode() {
2639
2553
  return {
2640
2554
  type: this.type,
2641
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
2555
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
2642
2556
  };
2643
2557
  }
2644
2558
  };
@@ -2681,7 +2595,7 @@ var IdentityIdValue = class _IdentityIdValue {
2681
2595
  */
2682
2596
  static parse(str) {
2683
2597
  const trimmed = str.trim();
2684
- if (trimmed === "" || trimmed === UNDEFINED_VALUE) {
2598
+ if (trimmed === "" || trimmed === NONE_VALUE) {
2685
2599
  return new _IdentityIdValue(void 0);
2686
2600
  }
2687
2601
  if (!validate3(trimmed)) {
@@ -2703,7 +2617,7 @@ var IdentityIdValue = class _IdentityIdValue {
2703
2617
  * Format as string
2704
2618
  */
2705
2619
  toString() {
2706
- return this.value === void 0 ? "undefined" : this.value;
2620
+ return this.value === void 0 ? "none" : this.value;
2707
2621
  }
2708
2622
  /**
2709
2623
  * Extract the timestamp from the UUID v7 (milliseconds since Unix epoch)
@@ -2734,17 +2648,31 @@ var IdentityIdValue = class _IdentityIdValue {
2734
2648
  encode() {
2735
2649
  return {
2736
2650
  type: this.type,
2737
- value: this.value === void 0 ? UNDEFINED_VALUE : this.toString()
2651
+ value: this.value === void 0 ? NONE_VALUE : this.toString()
2738
2652
  };
2739
2653
  }
2740
2654
  };
2741
2655
 
2742
2656
  // src/value/index.ts
2657
+ function isOptionType(t) {
2658
+ return typeof t === "object" && t !== null && "Option" in t;
2659
+ }
2660
+ function unwrapOptionType(t) {
2661
+ if (isOptionType(t)) return unwrapOptionType(t.Option);
2662
+ return t;
2663
+ }
2743
2664
  var Value = class {
2744
2665
  };
2745
2666
 
2746
2667
  // src/decoder.ts
2747
2668
  function decode(pair) {
2669
+ if (isOptionType(pair.type)) {
2670
+ const innerType = unwrapOptionType(pair.type);
2671
+ if (pair.value === NONE_VALUE || pair.value === "") {
2672
+ return new NoneValue(innerType);
2673
+ }
2674
+ return decode({ type: innerType, value: pair.value });
2675
+ }
2748
2676
  switch (pair.type) {
2749
2677
  case "Blob":
2750
2678
  return BlobValue.parse(pair.value);
@@ -2772,8 +2700,6 @@ function decode(pair) {
2772
2700
  return Int16Value.parse(pair.value);
2773
2701
  case "Duration":
2774
2702
  return DurationValue.parse(pair.value);
2775
- case "RowNumber":
2776
- return RowNumberValue.parse(pair.value);
2777
2703
  case "Time":
2778
2704
  return TimeValue.parse(pair.value);
2779
2705
  case "Uint1":
@@ -2786,8 +2712,8 @@ function decode(pair) {
2786
2712
  return Uint8Value.parse(pair.value);
2787
2713
  case "Uint16":
2788
2714
  return Uint16Value.parse(pair.value);
2789
- case "Undefined":
2790
- return UndefinedValue.parse(pair.value);
2715
+ case "None":
2716
+ return NoneValue.parse(pair.value);
2791
2717
  case "Utf8":
2792
2718
  return Utf8Value.parse(pair.value);
2793
2719
  case "Uuid4":
@@ -2890,11 +2816,8 @@ var SchemaBuilder = class {
2890
2816
  static uuid() {
2891
2817
  return { kind: "primitive", type: "Uuid7" };
2892
2818
  }
2893
- static undefined() {
2894
- return { kind: "primitive", type: "Undefined" };
2895
- }
2896
- static rownumber() {
2897
- return { kind: "primitive", type: "RowNumber" };
2819
+ static none() {
2820
+ return { kind: "primitive", type: "None" };
2898
2821
  }
2899
2822
  static identityid() {
2900
2823
  return { kind: "primitive", type: "IdentityId" };
@@ -2974,15 +2897,12 @@ var SchemaBuilder = class {
2974
2897
  static uuid7Value() {
2975
2898
  return { kind: "value", type: "Uuid7" };
2976
2899
  }
2977
- static undefinedValue() {
2978
- return { kind: "value", type: "Undefined" };
2900
+ static noneValue() {
2901
+ return { kind: "value", type: "None" };
2979
2902
  }
2980
2903
  static blobValue() {
2981
2904
  return { kind: "value", type: "Blob" };
2982
2905
  }
2983
- static rowIdValue() {
2984
- return { kind: "value", type: "RowNumber" };
2985
- }
2986
2906
  static identityIdValue() {
2987
2907
  return { kind: "value", type: "IdentityId" };
2988
2908
  }
@@ -3034,10 +2954,12 @@ function createValueInstance(type, value) {
3034
2954
  return new Uuid4Value(value);
3035
2955
  case "Uuid7":
3036
2956
  return new Uuid7Value(value);
3037
- case "Undefined":
3038
- return new UndefinedValue();
3039
- case "RowNumber":
3040
- return new RowNumberValue(value);
2957
+ case "Decimal":
2958
+ return new DecimalValue(value);
2959
+ case "IdentityId":
2960
+ return new IdentityIdValue(value);
2961
+ case "None":
2962
+ return new NoneValue();
3041
2963
  default:
3042
2964
  throw new Error(`Unknown type: ${type}`);
3043
2965
  }
@@ -3071,6 +2993,12 @@ function parseValue(schema, value) {
3071
2993
  }
3072
2994
  return parseValue(schema.schema, value);
3073
2995
  }
2996
+ if (schema.kind === "value") {
2997
+ if (value === null || value === void 0) {
2998
+ return void 0;
2999
+ }
3000
+ return createValueInstance(schema.type, value);
3001
+ }
3074
3002
  throw new Error(`Unknown schema kind: ${schema.kind}`);
3075
3003
  }
3076
3004
 
@@ -3079,7 +3007,7 @@ function validateSchema(schema, value) {
3079
3007
  if (schema.kind === "primitive") {
3080
3008
  const schemaType = schema.type;
3081
3009
  if (value === null || value === void 0) {
3082
- return schemaType === "Undefined";
3010
+ return schemaType === "None";
3083
3011
  }
3084
3012
  switch (schemaType) {
3085
3013
  case "Boolean":
@@ -3104,14 +3032,13 @@ function validateSchema(schema, value) {
3104
3032
  case "Duration":
3105
3033
  case "Uuid4":
3106
3034
  case "Uuid7":
3107
- case "RowNumber":
3108
3035
  return typeof value === "string";
3109
3036
  case "Date":
3110
3037
  case "DateTime":
3111
3038
  return value instanceof Date || typeof value === "string";
3112
3039
  case "Blob":
3113
3040
  return value instanceof Uint8Array || value instanceof ArrayBuffer;
3114
- case "Undefined":
3041
+ case "None":
3115
3042
  return value === void 0;
3116
3043
  default:
3117
3044
  return false;
@@ -3140,6 +3067,15 @@ function validateSchema(schema, value) {
3140
3067
  }
3141
3068
  return validateSchema(schema.schema, value);
3142
3069
  }
3070
+ if (schema.kind === "value") {
3071
+ if (value === null || value === void 0) {
3072
+ return schema.type === "None";
3073
+ }
3074
+ if (typeof value === "object" && value !== null && "type" in value && "encode" in value) {
3075
+ return value.type === schema.type;
3076
+ }
3077
+ return false;
3078
+ }
3143
3079
  return false;
3144
3080
  }
3145
3081
 
@@ -3189,25 +3125,26 @@ export {
3189
3125
  Int2Value,
3190
3126
  Int4Value,
3191
3127
  Int8Value,
3128
+ NONE_VALUE,
3129
+ NoneValue,
3192
3130
  ReifyError,
3193
- RowNumberValue,
3194
3131
  Schema,
3195
3132
  SchemaBuilder,
3196
3133
  TimeValue,
3197
- UNDEFINED_VALUE,
3198
3134
  Uint16Value,
3199
3135
  Uint1Value,
3200
3136
  Uint2Value,
3201
3137
  Uint4Value,
3202
3138
  Uint8Value,
3203
- UndefinedValue,
3204
3139
  Utf8Value,
3205
3140
  Uuid4Value,
3206
3141
  Uuid7Value,
3207
3142
  Value,
3208
3143
  asFrameResults,
3209
3144
  decode,
3145
+ isOptionType,
3210
3146
  parseValue,
3147
+ unwrapOptionType,
3211
3148
  validateSchema
3212
3149
  };
3213
3150
  //# sourceMappingURL=index.js.map