@routier/core 0.2.0 → 0.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.
Files changed (85) hide show
  1. package/dist/assertions/index.d.ts +30 -0
  2. package/dist/assertions/index.js +88 -4
  3. package/dist/assertions/index.js.map +1 -1
  4. package/dist/capabilities/index.js +25 -16
  5. package/dist/capabilities/index.js.map +1 -1
  6. package/dist/codegen/blocks.test.d.ts +1 -0
  7. package/dist/codegen/handlers/SetHandlerBuilder.d.ts +4 -0
  8. package/dist/codegen/handlers/index.d.ts +1 -0
  9. package/dist/codegen/handlers/serialize/SerializeComputedHandler.d.ts +6 -0
  10. package/dist/codegen/handlers/set/SetComplexHandler.d.ts +6 -0
  11. package/dist/codegen/index.js +1 -0
  12. package/dist/codegen/index.js.map +1 -1
  13. package/dist/codegen/utils.test.d.ts +1 -0
  14. package/dist/collections/Changes.d.ts +2 -2
  15. package/dist/collections/IdSet.test.d.ts +1 -0
  16. package/dist/collections/TagCollection.contract.test.d.ts +1 -0
  17. package/dist/collections/TagCollection.d.ts +7 -7
  18. package/dist/collections/index.js +1 -1
  19. package/dist/collections/index.js.map +1 -1
  20. package/dist/expressions/constants.d.ts +2 -0
  21. package/dist/expressions/index.d.ts +2 -0
  22. package/dist/expressions/index.js +401 -34
  23. package/dist/expressions/index.js.map +1 -1
  24. package/dist/expressions/sql.d.ts +28 -0
  25. package/dist/expressions/sql.test.d.ts +1 -0
  26. package/dist/expressions/utils.d.ts +1 -2
  27. package/dist/index.js +1669 -610
  28. package/dist/index.js.map +1 -1
  29. package/dist/performance/index.js +18 -7
  30. package/dist/performance/index.js.map +1 -1
  31. package/dist/pipeline/index.js +18 -7
  32. package/dist/pipeline/index.js.map +1 -1
  33. package/dist/plugins/index.d.ts +0 -1
  34. package/dist/plugins/index.js +126 -694
  35. package/dist/plugins/index.js.map +1 -1
  36. package/dist/plugins/query/Query.test.d.ts +1 -0
  37. package/dist/plugins/query/QueryOptionsCollection.d.ts +1 -0
  38. package/dist/plugins/translators/SqlTranslator.test.d.ts +1 -0
  39. package/dist/plugins/translators/TranslatedArrayValue.d.ts +3 -1
  40. package/dist/plugins/translators/TranslatedGroupValue.d.ts +3 -1
  41. package/dist/plugins/translators/TranslatedSingleValue.d.ts +3 -1
  42. package/dist/plugins/translators/TranslatedValues.test.d.ts +1 -0
  43. package/dist/plugins/translators/types.d.ts +8 -1
  44. package/dist/plugins/types.d.ts +6 -10
  45. package/dist/results/Result.d.ts +2 -2
  46. package/dist/results/Result.test.d.ts +1 -0
  47. package/dist/results/index.js.map +1 -1
  48. package/dist/results/utils.test.d.ts +1 -0
  49. package/dist/schema/PropertyInfo.d.ts +5 -1
  50. package/dist/schema/SchemaDefinition.d.ts +29 -1
  51. package/dist/schema/communication/broadcast.test.d.ts +1 -0
  52. package/dist/schema/index.d.ts +2 -0
  53. package/dist/schema/index.js +1151 -132
  54. package/dist/schema/index.js.map +1 -1
  55. package/dist/schema/property/base/SchemaBase.d.ts +3 -1
  56. package/dist/schema/property/modifiers/SchemaDeserialize.d.ts +5 -1
  57. package/dist/schema/property/modifiers/SchemaForeignKey.d.ts +15 -0
  58. package/dist/schema/property/modifiers/SchemaKey.d.ts +2 -0
  59. package/dist/schema/property/modifiers/SchemaNullable.d.ts +5 -1
  60. package/dist/schema/property/modifiers/SchemaOptional.d.ts +3 -1
  61. package/dist/schema/property/modifiers/SchemaTag.d.ts +27 -0
  62. package/dist/schema/property/modifiers/SchemaTracked.d.ts +5 -1
  63. package/dist/schema/property/modifiers/index.d.ts +2 -0
  64. package/dist/schema/property/types/SchemaArray.d.ts +2 -0
  65. package/dist/schema/property/types/SchemaBoolean.d.ts +2 -0
  66. package/dist/schema/property/types/SchemaDate.d.ts +2 -0
  67. package/dist/schema/property/types/SchemaNumber.d.ts +5 -1
  68. package/dist/schema/property/types/SchemaObject.d.ts +2 -0
  69. package/dist/schema/property/types/SchemaString.d.ts +5 -1
  70. package/dist/schema/types.d.ts +37 -27
  71. package/dist/schema/utils/standardJsonSchema.d.ts +90 -0
  72. package/dist/schema/utils/standardJsonSchema.test.d.ts +1 -0
  73. package/dist/utilities/functions.d.ts +1 -1
  74. package/dist/utilities/index.js +153 -15
  75. package/dist/utilities/index.js.map +1 -1
  76. package/dist/utilities/runtime.test.d.ts +1 -0
  77. package/dist/utilities/uuid.test.d.ts +1 -0
  78. package/package.json +2 -2
  79. package/readme.md +1 -1
  80. package/dist/plugins/replication/OptimisticReplicationDbPlugin.d.ts +0 -23
  81. package/dist/plugins/replication/ReplicationDbPlugin.d.ts +0 -22
  82. package/dist/plugins/replication/index.d.ts +0 -3
  83. package/dist/plugins/replication/types.d.ts +0 -5
  84. package/dist/schema/testSchemas.test.d.ts +0 -314
  85. /package/dist/{pipeline/WorkPipeline.test.d.ts → codegen/SlotPath.test.d.ts} +0 -0
@@ -1,10 +1,134 @@
1
1
  var __webpack_modules__ = ({
2
+ "./src/assertions/index.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
3
+ __webpack_require__.r(__webpack_exports__);
4
+ __webpack_require__.d(__webpack_exports__, {
5
+ assertDate: () => (assertDate),
6
+ assertInstanceOf: () => (assertInstanceOf),
7
+ assertIsArray: () => (assertIsArray),
8
+ assertIsNotNull: () => (assertIsNotNull),
9
+ assertIsNumber: () => (assertIsNumber),
10
+ assertString: () => (assertString),
11
+ isComparatorExpression: () => (isComparatorExpression),
12
+ isEmptyExpression: () => (isEmptyExpression),
13
+ isExpression: () => (isExpression),
14
+ isNotParsableExpression: () => (isNotParsableExpression),
15
+ isOperatorExpression: () => (isOperatorExpression),
16
+ isPropertyExpression: () => (isPropertyExpression),
17
+ isValueExpression: () => (isValueExpression)
18
+ });
19
+ /* import */ var _expressions_constants__rspack_import_1 = __webpack_require__("./src/expressions/constants.ts");
20
+ /* import */ var _utilities__rspack_import_0 = __webpack_require__("./src/utilities/dates.ts");
21
+
22
+
23
+ function assertDate(data) {
24
+ if ((0,_utilities__rspack_import_0.isDate)(data) === false) {
25
+ throw new TypeError('Value is not a Date');
26
+ }
27
+ }
28
+ function assertIsNotNull(data, message) {
29
+ if (data == null) {
30
+ if (message == null) {
31
+ throw new TypeError('Assertion failed, data is null');
32
+ }
33
+ if (typeof message === "string") {
34
+ throw new TypeError(message);
35
+ }
36
+ throw new TypeError(message());
37
+ }
38
+ }
39
+ function assertIsArray(data, message) {
40
+ if (!Array.isArray(data)) {
41
+ throw new TypeError(message ?? 'Assertion failed, data is not of type Array');
42
+ }
43
+ }
44
+ function assertString(data, message) {
45
+ if (typeof data !== "string") {
46
+ throw new TypeError(message ?? 'Assertion failed, data is not of type String');
47
+ }
48
+ }
49
+ function assertInstanceOf(value, Instance) {
50
+ if (value instanceof Instance) {
51
+ return;
52
+ }
53
+ if (value != null && typeof value === "object" && "constructor" in value) {
54
+ throw new TypeError(`value is not instance of type. Type: ${value.constructor.name}`);
55
+ }
56
+ throw new TypeError(`value is not instance of type`);
57
+ }
58
+ function assertIsNumber(value) {
59
+ if (typeof value !== "number") {
60
+ throw new TypeError("value is not of type `number`");
61
+ }
62
+ }
63
+ function isObjectWithType(value) {
64
+ return typeof value === "object" && value !== null && "type" in value;
65
+ }
66
+ /**
67
+ * Type guard: narrows `value` to `Expression` when it is an object with a valid `type` property.
68
+ */
69
+ function isExpression(value) {
70
+ return isObjectWithType(value) && _expressions_constants__rspack_import_1.EXPRESSION_TYPES.includes(value.type);
71
+ }
72
+ /**
73
+ * Type guard: narrows `value` to `OperatorExpression` when it is an object with `type === "operator"`.
74
+ */
75
+ function isOperatorExpression(value) {
76
+ return isObjectWithType(value) && value.type === "operator";
77
+ }
78
+ /**
79
+ * Type guard: narrows `value` to `ComparatorExpression` when it is an object with `type === "comparator"`.
80
+ */
81
+ function isComparatorExpression(value) {
82
+ return isObjectWithType(value) && value.type === "comparator";
83
+ }
84
+ /**
85
+ * Type guard: narrows `value` to `PropertyExpression` when it is an object with `type === "property"`.
86
+ */
87
+ function isPropertyExpression(value) {
88
+ return isObjectWithType(value) && value.type === "property";
89
+ }
90
+ /**
91
+ * Type guard: narrows `value` to `ValueExpression` when it is an object with `type === "value"`.
92
+ */
93
+ function isValueExpression(value) {
94
+ return isObjectWithType(value) && value.type === "value";
95
+ }
96
+ /**
97
+ * Type guard: narrows `value` to `EmptyExpression` when it is an object with `type === "empty"`.
98
+ */
99
+ function isEmptyExpression(value) {
100
+ return isObjectWithType(value) && value.type === "empty";
101
+ }
102
+ /**
103
+ * Type guard: narrows `value` to `NotParsableExpression` when it is an object with `type === "not-parsable"`.
104
+ */
105
+ function isNotParsableExpression(value) {
106
+ return isObjectWithType(value) && value.type === "not-parsable";
107
+ }
108
+
109
+
110
+ },
111
+ "./src/expressions/constants.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
112
+ __webpack_require__.r(__webpack_exports__);
113
+ __webpack_require__.d(__webpack_exports__, {
114
+ EXPRESSION_TYPES: () => (EXPRESSION_TYPES)
115
+ });
116
+ const EXPRESSION_TYPES = [
117
+ "operator",
118
+ "comparator",
119
+ "property",
120
+ "value",
121
+ "empty",
122
+ "not-parsable",
123
+ ];
124
+
125
+
126
+ },
2
127
  "./src/expressions/utils.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
3
128
  __webpack_require__.r(__webpack_exports__);
4
129
  __webpack_require__.d(__webpack_exports__, {
5
130
  forEach: () => (forEach),
6
- getProperties: () => (getProperties),
7
- isPropertyExpression: () => (isPropertyExpression)
131
+ getProperties: () => (getProperties)
8
132
  });
9
133
  /**
10
134
  * Extracts all properties referenced in an expression
@@ -29,9 +153,6 @@ function getProperties(expression) {
29
153
  traverse(expression);
30
154
  return properties;
31
155
  }
32
- function isPropertyExpression(expression) {
33
- return expression.type === "property";
34
- }
35
156
  function forEach(expression, callback) {
36
157
  function traverse(expr) {
37
158
  // Call the callback for this expression
@@ -62,8 +183,10 @@ __webpack_require__.r(__webpack_exports__);
62
183
  __webpack_require__.d(__webpack_exports__, {
63
184
  QueryOptionsCollection: () => (QueryOptionsCollection)
64
185
  });
186
+ /* import */ var _assertions__rspack_import_1 = __webpack_require__("./src/assertions/index.ts");
65
187
  /* import */ var _expressions_utils__rspack_import_0 = __webpack_require__("./src/expressions/utils.ts");
66
188
 
189
+
67
190
  class QueryOptionsCollection {
68
191
  options = new Map();
69
192
  nextExecutionTarget = "database";
@@ -100,7 +223,7 @@ class QueryOptionsCollection {
100
223
  }
101
224
  else {
102
225
  (0,_expressions_utils__rspack_import_0.forEach)(filterValue.expression, (expression) => {
103
- if ((0,_expressions_utils__rspack_import_0.isPropertyExpression)(expression) && expression.property.isUnmapped) {
226
+ if ((0,_assertions__rspack_import_1.isPropertyExpression)(expression) && expression.property.isUnmapped) {
104
227
  // Cut over to memory execution, unmapped properties are not in the database and
105
228
  // cannot be queried
106
229
  this.nextExecutionTarget = "memory";
@@ -140,6 +263,10 @@ class QueryOptionsCollection {
140
263
  database: databaseQueryOptionsCollection
141
264
  };
142
265
  }
266
+ hasTransformations() {
267
+ const transformationOptions = ["map", "group", "min", "max", "count", "sum"];
268
+ return transformationOptions.some((name) => this.options.has(name));
269
+ }
143
270
  has(name) {
144
271
  return this.options.has(name);
145
272
  }
@@ -252,7 +379,7 @@ __webpack_require__.r(__webpack_exports__);
252
379
  __webpack_require__.d(__webpack_exports__, {
253
380
  noop: () => (noop)
254
381
  });
255
- const noop = (...args) => { };
382
+ const noop = (..._args) => { };
256
383
 
257
384
 
258
385
  },
@@ -261,16 +388,27 @@ __webpack_require__.r(__webpack_exports__);
261
388
  __webpack_require__.d(__webpack_exports__, {
262
389
  logger: () => (logger)
263
390
  });
264
- const isDevelopment = () => {
265
- if (typeof process === 'undefined' || process.env == null) {
266
- return false;
267
- }
268
- const env = "development"?.toLowerCase();
269
- return env === 'dev' || env === 'development' || env === 'test';
391
+ /**
392
+ * Enable logging by setting `globalThis.__ROUTIER_DEBUG__ = true` before any routier code runs.
393
+ */
394
+ const shouldLog = () => {
395
+ if (typeof globalThis !== 'undefined') {
396
+ const g = globalThis;
397
+ if (g.__ROUTIER_DEBUG__ === true)
398
+ return true;
399
+ }
400
+ if (typeof process !== 'undefined' && process.env != null) {
401
+ const debug = process.env.DEBUG;
402
+ if (debug === 'routier' || debug === '*')
403
+ return true;
404
+ const env = "development"?.toLowerCase();
405
+ if (env === 'dev' || env === 'development' || env === 'test')
406
+ return true;
407
+ }
408
+ return false;
270
409
  };
271
- const shouldLog = isDevelopment();
272
410
  const tryLog = (type, ...args) => {
273
- if (shouldLog) {
411
+ if (shouldLog()) {
274
412
  console[type](...args);
275
413
  }
276
414
  };
@@ -1 +1 @@
1
- {"version":3,"file":"utilities/index.js","sources":["webpack://@routier/core/./src/expressions/utils.ts","webpack://@routier/core/./src/plugins/query/QueryOptionsCollection.ts","webpack://@routier/core/./src/utilities/arrays.ts","webpack://@routier/core/./src/utilities/dates.ts","webpack://@routier/core/./src/utilities/dbPluginEventUtils.ts","webpack://@routier/core/./src/utilities/functions.ts","webpack://@routier/core/./src/utilities/logger.ts","webpack://@routier/core/./src/utilities/objects.ts","webpack://@routier/core/./src/utilities/queryOptionsCollection.ts","webpack://@routier/core/./src/utilities/replication.ts","webpack://@routier/core/./src/utilities/runtime.ts","webpack://@routier/core/./src/utilities/strings.ts","webpack://@routier/core/./src/utilities/unsafeCast.ts","webpack://@routier/core/./src/utilities/uuid.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/webpack/runtime/make_namespace_object","webpack://@routier/core/./src/utilities/index.ts"],"sourcesContent":["import { PropertyInfo } from \"../schema\";\nimport { Expression, PropertyExpression } from \"./types\";\n\n/**\n * Extracts all properties referenced in an expression\n * @param expression The expression to analyze\n * @returns Array of PropertyInfo objects referenced in the expression\n */\nexport function getProperties(expression: Expression): PropertyInfo<any>[] {\n const properties: PropertyInfo<any>[] = [];\n\n function traverse(expr: Expression) {\n // If this is a property expression, add it to our collection\n if (expr.type === \"property\") {\n properties.push((expr as PropertyExpression).property);\n }\n\n // Traverse left and right expressions if they exist\n if (expr.left) {\n traverse(expr.left);\n }\n if (expr.right) {\n traverse(expr.right);\n }\n }\n\n traverse(expression);\n return properties;\n}\n\nexport function isPropertyExpression(expression: Expression): expression is PropertyExpression {\n return expression.type === \"property\";\n}\n\nexport function forEach(expression: Expression, callback: (expression: Expression) => boolean) {\n function traverse(expr: Expression): boolean {\n // Call the callback for this expression\n // If callback returns false, stop traversing\n if (!callback(expr)) {\n return false;\n }\n\n // Traverse left and right expressions if they exist\n if (expr.left) {\n if (!traverse(expr.left)) {\n return false;\n }\n }\n if (expr.right) {\n if (!traverse(expr.right)) {\n return false;\n }\n }\n\n return true;\n }\n\n traverse(expression);\n}","import { forEach, isPropertyExpression } from \"../../expressions/utils\";\nimport { QueryOption, QueryOptionName, QueryOptionExecutionTarget, QueryOptionValueMap } from \"./types\";\n\nexport type QueryCollectionItem<T, K extends QueryOptionName> = { index: number, option: QueryOption<T, K> };\n\nexport class QueryOptionsCollection<T> {\n\n private options: Map<QueryOptionName, QueryCollectionItem<any, any>[]> = new Map<QueryOptionName, QueryCollectionItem<any, any>[]>();\n private nextExecutionTarget: QueryOptionExecutionTarget = \"database\";\n private nextIndex: number = 0;\n private enumeratedItems: QueryCollectionItem<any, any>[] = [];\n\n get items() {\n return this.options;\n }\n\n get isEmpty() {\n return this.items.size === 0;\n }\n\n static EMPTY<R>() {\n return new QueryOptionsCollection<R>();\n }\n\n static isEmpty<T>(options: QueryOptionsCollection<T>) {\n return options.isEmpty;\n }\n\n add<K extends QueryOptionName>(name: K, value: QueryOption<T, K>[\"value\"]) {\n\n if (name === \"map\") {\n const mapValue = value as QueryOptionValueMap<T>[\"map\"];\n\n // Evaluate the map value to see if we are renaming properties, \n // if we are we need to perform everything after in memory\n if (mapValue.fields.some(x => x.isRename === true) || mapValue.fields.some(x => x.property?.isUnmapped === true)) {\n // Cut over to memory execution since we are renaming a property with .map\n // We do not want to figure out how the new name flows through the entire query\n this.nextExecutionTarget = \"memory\";\n }\n }\n\n if (name === \"filter\") {\n // Need to check for unmapped properties\n const filterValue = value as QueryOptionValueMap<T>[\"filter\"];\n\n if (filterValue.expression.type === \"not-parsable\") {\n this.nextExecutionTarget = \"memory\";\n } else {\n forEach(filterValue.expression, (expression) => {\n\n if (isPropertyExpression(expression) && expression.property.isUnmapped) {\n // Cut over to memory execution, unmapped properties are not in the database and\n // cannot be queried\n this.nextExecutionTarget = \"memory\";\n return false;\n }\n\n return true;\n });\n }\n }\n\n const item: QueryCollectionItem<T, K> = {\n index: this.nextIndex,\n option: {\n name,\n target: this.nextExecutionTarget,\n value\n }\n }\n\n this.nextIndex++;\n\n const found = this.options.get(name);\n\n this.options.set(name, [...found ?? [], item]);\n }\n\n split(): { memory: QueryOptionsCollection<T>, database: QueryOptionsCollection<T> } {\n this.resolveEnumeration();\n\n const sortedItems = this.enumeratedItems.toSorted((a, b) => a.index - b.index);\n const memoryQueryOptionsCollection = new QueryOptionsCollection<T>();\n const databaseQueryOptionsCollection = new QueryOptionsCollection<T>();\n\n for (let i = 0, length = sortedItems.length; i < length; i++) {\n const sortedItem = sortedItems[i];\n\n if (sortedItem.option.target === \"database\") {\n databaseQueryOptionsCollection.add(sortedItem.option.name, sortedItem.option.value);\n continue;\n }\n\n memoryQueryOptionsCollection.add(sortedItem.option.name, sortedItem.option.value);\n }\n\n return {\n memory: memoryQueryOptionsCollection,\n database: databaseQueryOptionsCollection\n }\n }\n\n has<K extends QueryOptionName>(name: K): boolean {\n return this.options.has(name);\n }\n\n get<K extends QueryOptionName>(name: K): QueryCollectionItem<T, K>[] {\n return this.options.get(name) ?? [] as QueryCollectionItem<T, K>[];\n }\n\n getLast<K extends QueryOptionName>(name: K): QueryOption<T, K> | null {\n this.resolveEnumeration();\n\n for (let i = this.enumeratedItems.length - 1; i >= 0; i--) {\n const item = this.enumeratedItems[i];\n\n if (item.option.name === name) {\n return item.option;\n }\n }\n\n return null\n }\n\n getValues<K extends QueryOptionName>(name: K): QueryCollectionItem<T, K>[\"option\"][\"value\"][] | undefined {\n\n const found = this.options.get(name);\n\n if (found == null) {\n return [];\n }\n\n return found.map(w => w.option.value) as QueryCollectionItem<T, K>[\"option\"][\"value\"][];\n }\n\n private getEnumeration() {\n return [...this.options.values()].flat().toSorted((a, b) => a.index - b.index);\n }\n\n private resolveEnumeration() {\n if (this.enumeratedItems.length != this.nextIndex) {\n this.enumeratedItems = this.getEnumeration();\n }\n }\n\n forEach(iterator: (item: QueryCollectionItem<T, any>[\"option\"]) => void) {\n this.resolveEnumeration();\n\n for (let i = 0, length = this.enumeratedItems.length; i < length; i++) {\n iterator(this.enumeratedItems[i].option);\n }\n }\n}","export const toMap = <T extends {}>(data: T[], keySelector: (item: T) => T[keyof T] | string) => {\n\n const result = new Map<T[keyof T] | string, T>();\n\n for (let i = 0; i < data.length; i++) {\n const item = data[i];\n const key = keySelector(item);\n result.set(key, item);\n }\n\n return result;\n}\n","export const isDate = (data: unknown): data is Date => {\n if (data == null) {\n return false;\n }\n\n if (typeof data !== \"object\") {\n return false;\n }\n\n return data instanceof Date;\n}","import { InferCreateType, InferType, SchemaId } from \"../schema\";\nimport { DbPluginBulkPersistEvent, EntityUpdateInfo } from \"../plugins\";\n\ntype DbEvent = {\n type: \"add\",\n data: InferCreateType<unknown>;\n} | {\n type: \"update\",\n data: EntityUpdateInfo<unknown>;\n} | {\n type: \"remove\",\n data: InferType<unknown>;\n}\n\nexport const toEventArray = (event: DbPluginBulkPersistEvent): [SchemaId, DbEvent][] => {\n\n const result: [SchemaId, DbEvent][] = [];\n for (const [schemaId, changes] of event.operation) {\n\n if (changes.hasItems === false) {\n continue;\n }\n\n if (changes.adds.length > 0) {\n result.push(...changes.adds.map(add => {\n return [schemaId as SchemaId, { data: { ...add }, type: \"add\" }] as [SchemaId, DbEvent];\n }));\n }\n\n if (changes.updates.length > 0) {\n result.push(...changes.updates.map(update => {\n return [schemaId as SchemaId, { data: { ...update }, type: \"update\" }] as [SchemaId, DbEvent];\n }));\n }\n\n if (changes.removes.length > 0) {\n result.push(...changes.removes.map(remove => {\n return [schemaId as SchemaId, { data: { ...remove }, type: \"remove\" }] as [SchemaId, DbEvent];\n }));\n }\n }\n\n return result\n}","export const noop = (...args: any[]) => { };","const isDevelopment = (): boolean => {\n if (typeof process === 'undefined' || process.env == null) {\n return false;\n }\n const env = process.env.NODE_ENV?.toLowerCase();\n return env === 'dev' || env === 'development' || env === 'test';\n};\n\ntype LogMethods = \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\" | \"table\";\nconst shouldLog = isDevelopment();\nconst tryLog = (type: LogMethods, ...args: unknown[]) => {\n if (shouldLog) {\n (console[type] as (...args: unknown[]) => void)(...args);\n }\n};\n\nexport const logger = {\n log: (...args: unknown[]): void => {\n tryLog(\"log\", ...args);\n },\n info: (...args: unknown[]): void => {\n tryLog(\"info\", ...args);\n },\n warn: (...args: unknown[]): void => {\n tryLog(\"warn\", ...args);\n },\n error: (...args: unknown[]): void => {\n tryLog(\"error\", ...args);\n },\n debug: (...args: unknown[]): void => {\n tryLog(\"debug\", ...args);\n },\n table: (...args: unknown[]): void => {\n tryLog(\"table\", ...args);\n },\n};\n\n","export const cast = <TIn, TOut>(item: TIn) => {\n return item as unknown as TOut;\n}\n\nexport function clone<T extends {}>(data: T): T {\n return JSON.parse(JSON.stringify(data)) as T;\n}","import { QueryOptionsCollection } from \"../plugins/query\";\n\nexport const combineQueryOptionsCollections = <T>(...collections: QueryOptionsCollection<T>[]) => {\n const result = new QueryOptionsCollection<T>();\n\n for (let i = 0, length = collections.length; i < length; i++) {\n const collection = collections[i];\n\n // Add scoped items first\n collection.forEach(item => {\n result.add(item.name, item.value);\n });\n }\n\n return result;\n}","import { BulkPersistResult, BulkPersistChanges } from \"../collections\";\nimport { DbPluginBulkPersistEvent } from \"../plugins\";\n\nexport const resolveBulkPersistChanges = (event: DbPluginBulkPersistEvent, result: BulkPersistResult, bulkPersistChanges: BulkPersistChanges) => {\n // make sure we swap the adds here, that way we can make sure other persist events\n // don't take their additions and try to change subsequent calls\n for (const [schemaId, changes] of event.operation) {\n\n const schemmaBulkPersistResult = result.get(schemaId);\n const schemaBulkPersistChanges = bulkPersistChanges.resolve(schemaId);\n\n // Set the original removes\n schemaBulkPersistChanges.removes = changes.removes;\n\n // Set the original updates\n schemaBulkPersistChanges.updates = changes.updates;\n\n // Take the adds from the result and set them to be persisted\n // in the replicated plugins because the id's are set in the \n // memory data store\n schemaBulkPersistChanges.adds = schemmaBulkPersistResult.adds;\n }\n}","export const isNodeRuntime = () => typeof process !== 'undefined' &&\n process.versions != null &&\n process.versions.node != null;","export const hash = (value: string, seed: number = 0) => {\n // From Stack Overflow\n // https://stackoverflow.com/a/52171480/3329760\n let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;\n\n for (let i = 0, ch: number; i < value.length; i++) {\n ch = value.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);\n h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);\n h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n\n return 4294967296 * (2097151 & h2) + (h1 >>> 0);\n}\n\n/**\n * Fast string hash optimized for comparisons.\n * Uses djb2 algorithm - very fast and good distribution for short to medium strings.\n * Same input always produces same output (deterministic).\n * \n * @param value - The string to hash\n * @param seed - Optional seed value (default: 5381)\n * @returns A positive 32-bit integer hash value\n * \n * @example\n * ```ts\n * fastHash(\"test\") === fastHash(\"test\") // true\n * fastHash(\"test\") !== fastHash(\"test2\") // true\n * ```\n */\nexport const fastHash = (value: string, seed: number = 5381): number => {\n let hash = seed;\n for (let i = 0; i < value.length; i++) {\n hash = ((hash << 5) + hash) + value.charCodeAt(i);\n }\n return hash >>> 0; // Convert to unsigned 32-bit integer\n}\n\n/**\n * Converts any value to a readable string representation.\n * Handles primitives, objects, arrays, classes, dates, errors, and functions.\n * Supports depth limiting to prevent infinite recursion on circular references.\n * \n * @param obj - The value to stringify\n * @param maxDepth - Maximum depth for nested objects (default: 3)\n * @param currentDepth - Current recursion depth (default: 0)\n * @returns String representation of the value\n * \n * @example\n * ```ts\n * stringifyObject({ name: \"test\", count: 5 }) // '{ name: \"test\", count: 5 }'\n * stringifyObject([1, 2, 3]) // '[1, 2, 3]'\n * stringifyObject(new Date()) // 'Date(2024-01-01T00:00:00.000Z)'\n * ```\n */\nexport function stringifyObject(obj: unknown, maxDepth: number = 3, currentDepth: number = 0): string {\n if (obj === null) return 'null';\n if (obj === undefined) return 'undefined';\n\n const type = typeof obj;\n\n switch (type) {\n case 'string':\n return `\"${obj}\"`;\n case 'number':\n case 'boolean':\n return String(obj);\n case 'function':\n return `[Function: ${getFunctionName(obj as Function)}]`;\n case 'object':\n if (currentDepth >= maxDepth) {\n return '[Max Depth Reached]';\n }\n return stringifyObjectValue(obj, maxDepth, currentDepth);\n default:\n return `[${type}]`;\n }\n}\n\nfunction getFunctionName(fn: Function): string {\n const name = fn.name;\n return name || 'anonymous';\n}\n\nfunction getObjectProperties(obj: any): Record<string, any> {\n const properties: Record<string, any> = {};\n\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n properties[key] = obj[key];\n }\n }\n\n return properties;\n}\n\nfunction stringifyObjectValue(obj: any, maxDepth: number, currentDepth: number): string {\n if (obj === null) return 'null';\n\n if (obj instanceof Date) {\n return `Date(${obj.toISOString()})`;\n }\n\n if (obj instanceof Error) {\n return `Error(${obj.message})`;\n }\n\n if (obj instanceof RegExp) {\n return obj.toString();\n }\n\n if (Array.isArray(obj)) {\n return stringifyArray(obj, maxDepth, currentDepth);\n }\n\n if (obj.constructor && obj.constructor.name !== 'Object') {\n return stringifyClassInstance(obj, maxDepth, currentDepth);\n }\n\n return stringifyPlainObject(obj, maxDepth, currentDepth);\n}\n\nfunction stringifyArray(arr: any[], maxDepth: number, currentDepth: number): string {\n if (arr.length === 0) return '[]';\n\n const items = arr.slice(0, 5).map(item =>\n stringifyObject(item, maxDepth, currentDepth + 1)\n );\n\n const suffix = arr.length > 5 ? `... (+${arr.length - 5} more)` : '';\n return `[${items.join(', ')}${suffix}]`;\n}\n\nfunction stringifyClassInstance(obj: any, maxDepth: number, currentDepth: number): string {\n const className = obj.constructor.name;\n const properties = getObjectProperties(obj);\n\n if (Object.keys(properties).length === 0) {\n return `${className} {}`;\n }\n\n const props = Object.entries(properties)\n .slice(0, 5)\n .map(([key, value]) => {\n const isPrimitive = value === null || value === undefined ||\n (typeof value !== 'object' && typeof value !== 'function');\n const depth = isPrimitive ? currentDepth : currentDepth + 1;\n return `${key}: ${stringifyObject(value, maxDepth, depth)}`;\n });\n\n const suffix = Object.keys(properties).length > 5 ?\n `... (+${Object.keys(properties).length - 5} more)` : '';\n\n return `${className} { ${props.join(', ')}${suffix} }`;\n}\n\nfunction stringifyPlainObject(obj: any, maxDepth: number, currentDepth: number): string {\n const properties = getObjectProperties(obj);\n\n if (Object.keys(properties).length === 0) {\n return '{}';\n }\n\n const props = Object.entries(properties)\n .slice(0, 5)\n .map(([key, value]) => {\n const isPrimitive = value === null || value === undefined ||\n (typeof value !== 'object' && typeof value !== 'function');\n const depth = isPrimitive ? currentDepth : currentDepth + 1;\n return `${key}: ${stringifyObject(value, maxDepth, depth)}`;\n });\n\n const suffix = Object.keys(properties).length > 5 ?\n `... (+${Object.keys(properties).length - 5} more)` : '';\n\n return `{ ${props.join(', ')}${suffix} }`;\n}","export const unsafeCast = <T>(value: unknown): T => {\n return value as T\n}","export const uuid = (length: number = 16): string => {\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const charLength = chars.length;\n let result = '';\n\n for (let i = 0; i < length; i++) {\n result += chars[Math.random() * charLength | 0];\n }\n return result;\n}\n\nconst HEX_CHARS = '0123456789abcdef';\nconst UUID_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n\nconst hasCrypto =\n typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function';\n\nexport const uuidv4 = (): string => {\n let randomBytes: Uint8Array | null = null;\n if (hasCrypto) {\n randomBytes = crypto.getRandomValues(new Uint8Array(16));\n }\n\n let byteIndex = 0;\n let uuid = '';\n\n for (let i = 0; i < UUID_TEMPLATE.length; i++) {\n const c = UUID_TEMPLATE[i];\n if (c === '-') {\n uuid += '-';\n continue;\n }\n\n let r: number;\n if (hasCrypto && randomBytes) {\n // Each byte gives two hex digits (nibbles)\n r =\n (i % 2 === 0\n ? randomBytes[byteIndex] >> 4\n : randomBytes[byteIndex++] & 0x0f);\n } else {\n r = Math.floor(Math.random() * 16);\n }\n\n if (c === 'x') {\n uuid += HEX_CHARS[r];\n } else if (c === 'y') {\n // Variant bits: 8, 9, A, or B\n uuid += HEX_CHARS[(r & 0x3) | 0x8];\n } else if (c === '4') {\n uuid += '4';\n }\n }\n\n return uuid;\n};\n","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './arrays';\nexport * from './strings';\nexport * from './dates';\nexport * from './objects';\nexport * from './runtime';\nexport * from './uuid';\nexport * from './replication';\nexport * from './types';\nexport * from './queryOptionsCollection';\nexport * from './dbPluginEventUtils';\nexport * from './functions';\nexport * from './unsafeCast';\nexport * from './logger';"],"names":[],"mappings":";;;;;;;;AAGA;;;;GAIG;AACI,SAAS,aAAa,CAAC,UAAsB;IAChD,MAAM,UAAU,GAAw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AC;YACZ,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;aAAM,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YACnB,8BAA8B;YAC9B,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QACvC,CAAC;aAAM,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YACnB,IAAI,IAAI,GAAG,CAAC;QAChB,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvDF;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA,E;;;;ACNA,wF;;;;ACAA;AACA;AACA;AACA,uDAAuD,iBAAiB;AACxE;AACA,gDAAgD,aAAa;AAC7D,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNyB;AACC;AACF;AACE;AACA;AACH;AACO;AACN;AACiB;AACJ;AACT;AACC;AACJ"}
1
+ {"version":3,"file":"utilities/index.js","sources":["webpack://@routier/core/./src/assertions/index.ts","webpack://@routier/core/./src/expressions/constants.ts","webpack://@routier/core/./src/expressions/utils.ts","webpack://@routier/core/./src/plugins/query/QueryOptionsCollection.ts","webpack://@routier/core/./src/utilities/arrays.ts","webpack://@routier/core/./src/utilities/dates.ts","webpack://@routier/core/./src/utilities/dbPluginEventUtils.ts","webpack://@routier/core/./src/utilities/functions.ts","webpack://@routier/core/./src/utilities/logger.ts","webpack://@routier/core/./src/utilities/objects.ts","webpack://@routier/core/./src/utilities/queryOptionsCollection.ts","webpack://@routier/core/./src/utilities/replication.ts","webpack://@routier/core/./src/utilities/runtime.ts","webpack://@routier/core/./src/utilities/strings.ts","webpack://@routier/core/./src/utilities/unsafeCast.ts","webpack://@routier/core/./src/utilities/uuid.ts","webpack://@routier/core/webpack/runtime/define_property_getters","webpack://@routier/core/webpack/runtime/has_own_property","webpack://@routier/core/webpack/runtime/make_namespace_object","webpack://@routier/core/./src/utilities/index.ts"],"sourcesContent":["import { EXPRESSION_TYPES } from \"../expressions/constants\";\nimport { ComparatorExpression, EmptyExpression, Expression, ExpressionType, NotParsableExpression, OperatorExpression, PropertyExpression, ValueExpression } from \"../expressions/types\";\nimport { isDate } from \"../utilities\";\n\nexport function assertDate(data: unknown): asserts data is Date {\n if (isDate(data) === false) {\n throw new TypeError('Value is not a Date');\n }\n}\n\nexport function assertIsNotNull<T>(data: T | null | undefined, message?: string | (() => string)): asserts data is NonNullable<T> {\n if (data == null) {\n if (message == null) {\n throw new TypeError('Assertion failed, data is null');\n }\n\n if (typeof message === \"string\") {\n throw new TypeError(message);\n }\n\n throw new TypeError(message());\n }\n}\n\nexport function assertIsArray<T>(data: unknown, message?: string): asserts data is T[] {\n if (!Array.isArray(data)) {\n throw new TypeError(message ?? 'Assertion failed, data is not of type Array');\n }\n}\n\nexport function assertString(data: unknown, message?: string): asserts data is string {\n if (typeof data !== \"string\") {\n throw new TypeError(message ?? 'Assertion failed, data is not of type String');\n }\n}\n\nexport function assertInstanceOf<T extends new (...args: any[]) => any>(value: unknown, Instance: T): asserts value is T {\n if (value instanceof Instance) {\n return;\n }\n\n if (value != null && typeof value === \"object\" && \"constructor\" in value) {\n throw new TypeError(`value is not instance of type. Type: ${value.constructor.name}`);\n }\n\n throw new TypeError(`value is not instance of type`);\n}\n\nexport function assertIsNumber(value: unknown): asserts value is number {\n if (typeof value !== \"number\") {\n throw new TypeError(\"value is not of type `number`\");\n }\n}\n\n\nfunction isObjectWithType(value: unknown): value is Record<\"type\", unknown> {\n return typeof value === \"object\" && value !== null && \"type\" in value;\n}\n\n/**\n * Type guard: narrows `value` to `Expression` when it is an object with a valid `type` property.\n */\nexport function isExpression(value: unknown): value is Expression {\n return isObjectWithType(value) && EXPRESSION_TYPES.includes(value.type as ExpressionType);\n}\n\n/**\n * Type guard: narrows `value` to `OperatorExpression` when it is an object with `type === \"operator\"`.\n */\nexport function isOperatorExpression(value: unknown): value is OperatorExpression {\n return isObjectWithType(value) && value.type === \"operator\";\n}\n\n/**\n * Type guard: narrows `value` to `ComparatorExpression` when it is an object with `type === \"comparator\"`.\n */\nexport function isComparatorExpression(value: unknown): value is ComparatorExpression {\n return isObjectWithType(value) && value.type === \"comparator\";\n}\n\n/**\n * Type guard: narrows `value` to `PropertyExpression` when it is an object with `type === \"property\"`.\n */\nexport function isPropertyExpression(value: unknown): value is PropertyExpression {\n return isObjectWithType(value) && value.type === \"property\";\n}\n\n/**\n * Type guard: narrows `value` to `ValueExpression` when it is an object with `type === \"value\"`.\n */\nexport function isValueExpression(value: unknown): value is ValueExpression {\n return isObjectWithType(value) && value.type === \"value\";\n}\n\n/**\n * Type guard: narrows `value` to `EmptyExpression` when it is an object with `type === \"empty\"`.\n */\nexport function isEmptyExpression(value: unknown): value is EmptyExpression {\n return isObjectWithType(value) && value.type === \"empty\";\n}\n\n/**\n * Type guard: narrows `value` to `NotParsableExpression` when it is an object with `type === \"not-parsable\"`.\n */\nexport function isNotParsableExpression(value: unknown): value is NotParsableExpression {\n return isObjectWithType(value) && value.type === \"not-parsable\";\n}","import { ExpressionType } from \"./types\";\n\nexport const EXPRESSION_TYPES: ExpressionType[] = [\n \"operator\",\n \"comparator\",\n \"property\",\n \"value\",\n \"empty\",\n \"not-parsable\",\n];\n","import { PropertyInfo } from \"../schema\";\nimport { Expression, PropertyExpression } from \"./types\";\n\n/**\n * Extracts all properties referenced in an expression\n * @param expression The expression to analyze\n * @returns Array of PropertyInfo objects referenced in the expression\n */\nexport function getProperties(expression: Expression): PropertyInfo<any>[] {\n const properties: PropertyInfo<any>[] = [];\n\n function traverse(expr: Expression) {\n // If this is a property expression, add it to our collection\n if (expr.type === \"property\") {\n properties.push((expr as PropertyExpression).property);\n }\n\n // Traverse left and right expressions if they exist\n if (expr.left) {\n traverse(expr.left);\n }\n if (expr.right) {\n traverse(expr.right);\n }\n }\n\n traverse(expression);\n return properties;\n}\n\nexport function forEach(expression: Expression, callback: (expression: Expression) => boolean) {\n function traverse(expr: Expression): boolean {\n // Call the callback for this expression\n // If callback returns false, stop traversing\n if (!callback(expr)) {\n return false;\n }\n\n // Traverse left and right expressions if they exist\n if (expr.left) {\n if (!traverse(expr.left)) {\n return false;\n }\n }\n if (expr.right) {\n if (!traverse(expr.right)) {\n return false;\n }\n }\n\n return true;\n }\n\n traverse(expression);\n}","import { isPropertyExpression } from \"../../assertions\";\nimport { forEach } from \"../../expressions/utils\";\nimport { QueryOption, QueryOptionName, QueryOptionExecutionTarget, QueryOptionValueMap } from \"./types\";\n\nexport type QueryCollectionItem<T, K extends QueryOptionName> = { index: number, option: QueryOption<T, K> };\n\nexport class QueryOptionsCollection<T> {\n\n private options: Map<QueryOptionName, QueryCollectionItem<any, any>[]> = new Map<QueryOptionName, QueryCollectionItem<any, any>[]>();\n private nextExecutionTarget: QueryOptionExecutionTarget = \"database\";\n private nextIndex: number = 0;\n private enumeratedItems: QueryCollectionItem<any, any>[] = [];\n\n get items() {\n return this.options;\n }\n\n get isEmpty() {\n return this.items.size === 0;\n }\n\n static EMPTY<R>() {\n return new QueryOptionsCollection<R>();\n }\n\n static isEmpty<T>(options: QueryOptionsCollection<T>) {\n return options.isEmpty;\n }\n\n add<K extends QueryOptionName>(name: K, value: QueryOption<T, K>[\"value\"]) {\n\n if (name === \"map\") {\n const mapValue = value as QueryOptionValueMap<T>[\"map\"];\n\n // Evaluate the map value to see if we are renaming properties, \n // if we are we need to perform everything after in memory\n if (mapValue.fields.some(x => x.isRename === true) || mapValue.fields.some(x => x.property?.isUnmapped === true)) {\n // Cut over to memory execution since we are renaming a property with .map\n // We do not want to figure out how the new name flows through the entire query\n this.nextExecutionTarget = \"memory\";\n }\n }\n\n if (name === \"filter\") {\n // Need to check for unmapped properties\n const filterValue = value as QueryOptionValueMap<T>[\"filter\"];\n\n if (filterValue.expression.type === \"not-parsable\") {\n this.nextExecutionTarget = \"memory\";\n } else {\n forEach(filterValue.expression, (expression) => {\n\n if (isPropertyExpression(expression) && expression.property.isUnmapped) {\n // Cut over to memory execution, unmapped properties are not in the database and\n // cannot be queried\n this.nextExecutionTarget = \"memory\";\n return false;\n }\n\n return true;\n });\n }\n }\n\n const item: QueryCollectionItem<T, K> = {\n index: this.nextIndex,\n option: {\n name,\n target: this.nextExecutionTarget,\n value\n }\n }\n\n this.nextIndex++;\n\n const found = this.options.get(name);\n\n this.options.set(name, [...found ?? [], item]);\n }\n\n split(): { memory: QueryOptionsCollection<T>, database: QueryOptionsCollection<T> } {\n this.resolveEnumeration();\n\n const sortedItems = this.enumeratedItems.toSorted((a, b) => a.index - b.index);\n const memoryQueryOptionsCollection = new QueryOptionsCollection<T>();\n const databaseQueryOptionsCollection = new QueryOptionsCollection<T>();\n\n for (let i = 0, length = sortedItems.length; i < length; i++) {\n const sortedItem = sortedItems[i];\n\n if (sortedItem.option.target === \"database\") {\n databaseQueryOptionsCollection.add(sortedItem.option.name, sortedItem.option.value);\n continue;\n }\n\n memoryQueryOptionsCollection.add(sortedItem.option.name, sortedItem.option.value);\n }\n\n return {\n memory: memoryQueryOptionsCollection,\n database: databaseQueryOptionsCollection\n }\n }\n\n hasTransformations(): boolean {\n const transformationOptions: QueryOptionName[] = [\"map\", \"group\", \"min\", \"max\", \"count\", \"sum\"];\n return transformationOptions.some((name) => this.options.has(name));\n }\n\n has<K extends QueryOptionName>(name: K): boolean {\n return this.options.has(name);\n }\n\n get<K extends QueryOptionName>(name: K): QueryCollectionItem<T, K>[] {\n return this.options.get(name) ?? [] as QueryCollectionItem<T, K>[];\n }\n\n getLast<K extends QueryOptionName>(name: K): QueryOption<T, K> | null {\n this.resolveEnumeration();\n\n for (let i = this.enumeratedItems.length - 1; i >= 0; i--) {\n const item = this.enumeratedItems[i];\n\n if (item.option.name === name) {\n return item.option;\n }\n }\n\n return null\n }\n\n getValues<K extends QueryOptionName>(name: K): QueryCollectionItem<T, K>[\"option\"][\"value\"][] | undefined {\n\n const found = this.options.get(name);\n\n if (found == null) {\n return [];\n }\n\n return found.map(w => w.option.value) as QueryCollectionItem<T, K>[\"option\"][\"value\"][];\n }\n\n private getEnumeration() {\n return [...this.options.values()].flat().toSorted((a, b) => a.index - b.index);\n }\n\n private resolveEnumeration() {\n if (this.enumeratedItems.length != this.nextIndex) {\n this.enumeratedItems = this.getEnumeration();\n }\n }\n\n forEach(iterator: (item: QueryCollectionItem<T, any>[\"option\"]) => void) {\n this.resolveEnumeration();\n\n for (let i = 0, length = this.enumeratedItems.length; i < length; i++) {\n iterator(this.enumeratedItems[i].option);\n }\n }\n}","export const toMap = <T extends {}>(data: T[], keySelector: (item: T) => T[keyof T] | string) => {\n\n const result = new Map<T[keyof T] | string, T>();\n\n for (let i = 0; i < data.length; i++) {\n const item = data[i];\n const key = keySelector(item);\n result.set(key, item);\n }\n\n return result;\n}\n","export const isDate = (data: unknown): data is Date => {\n if (data == null) {\n return false;\n }\n\n if (typeof data !== \"object\") {\n return false;\n }\n\n return data instanceof Date;\n}","import { InferCreateType, InferType, SchemaId } from \"../schema\";\nimport { DbPluginBulkPersistEvent, EntityUpdateInfo } from \"../plugins\";\n\ntype DbEvent = {\n type: \"add\",\n data: InferCreateType<unknown>;\n} | {\n type: \"update\",\n data: EntityUpdateInfo<unknown>;\n} | {\n type: \"remove\",\n data: InferType<unknown>;\n}\n\nexport const toEventArray = (event: DbPluginBulkPersistEvent): [SchemaId, DbEvent][] => {\n\n const result: [SchemaId, DbEvent][] = [];\n for (const [schemaId, changes] of event.operation) {\n\n if (changes.hasItems === false) {\n continue;\n }\n\n if (changes.adds.length > 0) {\n result.push(...changes.adds.map(add => {\n return [schemaId as SchemaId, { data: { ...add }, type: \"add\" }] as [SchemaId, DbEvent];\n }));\n }\n\n if (changes.updates.length > 0) {\n result.push(...changes.updates.map(update => {\n return [schemaId as SchemaId, { data: { ...update }, type: \"update\" }] as [SchemaId, DbEvent];\n }));\n }\n\n if (changes.removes.length > 0) {\n result.push(...changes.removes.map(remove => {\n return [schemaId as SchemaId, { data: { ...remove }, type: \"remove\" }] as [SchemaId, DbEvent];\n }));\n }\n }\n\n return result\n}","export const noop = (..._args: any[]) => { };","/**\n * Enable logging by setting `globalThis.__ROUTIER_DEBUG__ = true` before any routier code runs.\n */\nconst shouldLog = (): boolean => {\n if (typeof globalThis !== 'undefined') {\n const g = globalThis as { __ROUTIER_DEBUG__?: boolean };\n if (g.__ROUTIER_DEBUG__ === true) return true;\n }\n\n if (typeof process !== 'undefined' && process.env != null) {\n const debug = process.env.DEBUG;\n if (debug === 'routier' || debug === '*') return true;\n const env = process.env.NODE_ENV?.toLowerCase();\n if (env === 'dev' || env === 'development' || env === 'test') return true;\n }\n\n return false;\n};\n\ntype LogMethods = \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\" | \"table\";\nconst tryLog = (type: LogMethods, ...args: unknown[]) => {\n if (shouldLog()) {\n (console[type] as (...args: unknown[]) => void)(...args);\n }\n};\n\nexport const logger = {\n log: (...args: unknown[]): void => {\n tryLog(\"log\", ...args);\n },\n info: (...args: unknown[]): void => {\n tryLog(\"info\", ...args);\n },\n warn: (...args: unknown[]): void => {\n tryLog(\"warn\", ...args);\n },\n error: (...args: unknown[]): void => {\n tryLog(\"error\", ...args);\n },\n debug: (...args: unknown[]): void => {\n tryLog(\"debug\", ...args);\n },\n table: (...args: unknown[]): void => {\n tryLog(\"table\", ...args);\n },\n};\n\n","export const cast = <TIn, TOut>(item: TIn) => {\n return item as unknown as TOut;\n}\n\nexport function clone<T extends {}>(data: T): T {\n return JSON.parse(JSON.stringify(data)) as T;\n}","import { QueryOptionsCollection } from \"../plugins/query\";\n\nexport const combineQueryOptionsCollections = <T>(...collections: QueryOptionsCollection<T>[]) => {\n const result = new QueryOptionsCollection<T>();\n\n for (let i = 0, length = collections.length; i < length; i++) {\n const collection = collections[i];\n\n // Add scoped items first\n collection.forEach(item => {\n result.add(item.name, item.value);\n });\n }\n\n return result;\n}","import { BulkPersistResult, BulkPersistChanges } from \"../collections\";\nimport { DbPluginBulkPersistEvent } from \"../plugins\";\n\nexport const resolveBulkPersistChanges = (event: DbPluginBulkPersistEvent, result: BulkPersistResult, bulkPersistChanges: BulkPersistChanges) => {\n // make sure we swap the adds here, that way we can make sure other persist events\n // don't take their additions and try to change subsequent calls\n for (const [schemaId, changes] of event.operation) {\n\n const schemmaBulkPersistResult = result.get(schemaId);\n const schemaBulkPersistChanges = bulkPersistChanges.resolve(schemaId);\n\n // Set the original removes\n schemaBulkPersistChanges.removes = changes.removes;\n\n // Set the original updates\n schemaBulkPersistChanges.updates = changes.updates;\n\n // Take the adds from the result and set them to be persisted\n // in the replicated plugins because the id's are set in the \n // memory data store\n schemaBulkPersistChanges.adds = schemmaBulkPersistResult.adds;\n }\n}","export const isNodeRuntime = () => typeof process !== 'undefined' &&\n process.versions != null &&\n process.versions.node != null;","export const hash = (value: string, seed: number = 0) => {\n // From Stack Overflow\n // https://stackoverflow.com/a/52171480/3329760\n let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;\n\n for (let i = 0, ch: number; i < value.length; i++) {\n ch = value.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);\n h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);\n h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n\n return 4294967296 * (2097151 & h2) + (h1 >>> 0);\n}\n\n/**\n * Fast string hash optimized for comparisons.\n * Uses djb2 algorithm - very fast and good distribution for short to medium strings.\n * Same input always produces same output (deterministic).\n * \n * @param value - The string to hash\n * @param seed - Optional seed value (default: 5381)\n * @returns A positive 32-bit integer hash value\n * \n * @example\n * ```ts\n * fastHash(\"test\") === fastHash(\"test\") // true\n * fastHash(\"test\") !== fastHash(\"test2\") // true\n * ```\n */\nexport const fastHash = (value: string, seed: number = 5381): number => {\n let hash = seed;\n for (let i = 0; i < value.length; i++) {\n hash = ((hash << 5) + hash) + value.charCodeAt(i);\n }\n return hash >>> 0; // Convert to unsigned 32-bit integer\n}\n\n/**\n * Converts any value to a readable string representation.\n * Handles primitives, objects, arrays, classes, dates, errors, and functions.\n * Supports depth limiting to prevent infinite recursion on circular references.\n * \n * @param obj - The value to stringify\n * @param maxDepth - Maximum depth for nested objects (default: 3)\n * @param currentDepth - Current recursion depth (default: 0)\n * @returns String representation of the value\n * \n * @example\n * ```ts\n * stringifyObject({ name: \"test\", count: 5 }) // '{ name: \"test\", count: 5 }'\n * stringifyObject([1, 2, 3]) // '[1, 2, 3]'\n * stringifyObject(new Date()) // 'Date(2024-01-01T00:00:00.000Z)'\n * ```\n */\nexport function stringifyObject(obj: unknown, maxDepth: number = 3, currentDepth: number = 0): string {\n if (obj === null) return 'null';\n if (obj === undefined) return 'undefined';\n\n const type = typeof obj;\n\n switch (type) {\n case 'string':\n return `\"${obj}\"`;\n case 'number':\n case 'boolean':\n return String(obj);\n case 'function':\n return `[Function: ${getFunctionName(obj as Function)}]`;\n case 'object':\n if (currentDepth >= maxDepth) {\n return '[Max Depth Reached]';\n }\n return stringifyObjectValue(obj, maxDepth, currentDepth);\n default:\n return `[${type}]`;\n }\n}\n\nfunction getFunctionName(fn: Function): string {\n const name = fn.name;\n return name || 'anonymous';\n}\n\nfunction getObjectProperties(obj: any): Record<string, any> {\n const properties: Record<string, any> = {};\n\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n properties[key] = obj[key];\n }\n }\n\n return properties;\n}\n\nfunction stringifyObjectValue(obj: any, maxDepth: number, currentDepth: number): string {\n if (obj === null) return 'null';\n\n if (obj instanceof Date) {\n return `Date(${obj.toISOString()})`;\n }\n\n if (obj instanceof Error) {\n return `Error(${obj.message})`;\n }\n\n if (obj instanceof RegExp) {\n return obj.toString();\n }\n\n if (Array.isArray(obj)) {\n return stringifyArray(obj, maxDepth, currentDepth);\n }\n\n if (obj.constructor && obj.constructor.name !== 'Object') {\n return stringifyClassInstance(obj, maxDepth, currentDepth);\n }\n\n return stringifyPlainObject(obj, maxDepth, currentDepth);\n}\n\nfunction stringifyArray(arr: any[], maxDepth: number, currentDepth: number): string {\n if (arr.length === 0) return '[]';\n\n const items = arr.slice(0, 5).map(item =>\n stringifyObject(item, maxDepth, currentDepth + 1)\n );\n\n const suffix = arr.length > 5 ? `... (+${arr.length - 5} more)` : '';\n return `[${items.join(', ')}${suffix}]`;\n}\n\nfunction stringifyClassInstance(obj: any, maxDepth: number, currentDepth: number): string {\n const className = obj.constructor.name;\n const properties = getObjectProperties(obj);\n\n if (Object.keys(properties).length === 0) {\n return `${className} {}`;\n }\n\n const props = Object.entries(properties)\n .slice(0, 5)\n .map(([key, value]) => {\n const isPrimitive = value === null || value === undefined ||\n (typeof value !== 'object' && typeof value !== 'function');\n const depth = isPrimitive ? currentDepth : currentDepth + 1;\n return `${key}: ${stringifyObject(value, maxDepth, depth)}`;\n });\n\n const suffix = Object.keys(properties).length > 5 ?\n `... (+${Object.keys(properties).length - 5} more)` : '';\n\n return `${className} { ${props.join(', ')}${suffix} }`;\n}\n\nfunction stringifyPlainObject(obj: any, maxDepth: number, currentDepth: number): string {\n const properties = getObjectProperties(obj);\n\n if (Object.keys(properties).length === 0) {\n return '{}';\n }\n\n const props = Object.entries(properties)\n .slice(0, 5)\n .map(([key, value]) => {\n const isPrimitive = value === null || value === undefined ||\n (typeof value !== 'object' && typeof value !== 'function');\n const depth = isPrimitive ? currentDepth : currentDepth + 1;\n return `${key}: ${stringifyObject(value, maxDepth, depth)}`;\n });\n\n const suffix = Object.keys(properties).length > 5 ?\n `... (+${Object.keys(properties).length - 5} more)` : '';\n\n return `{ ${props.join(', ')}${suffix} }`;\n}","export const unsafeCast = <T>(value: unknown): T => {\n return value as T\n}","export const uuid = (length: number = 16): string => {\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const charLength = chars.length;\n let result = '';\n\n for (let i = 0; i < length; i++) {\n result += chars[Math.random() * charLength | 0];\n }\n return result;\n}\n\nconst HEX_CHARS = '0123456789abcdef';\nconst UUID_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n\nconst hasCrypto =\n typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function';\n\nexport const uuidv4 = (): string => {\n let randomBytes: Uint8Array | null = null;\n if (hasCrypto) {\n randomBytes = crypto.getRandomValues(new Uint8Array(16));\n }\n\n let byteIndex = 0;\n let uuid = '';\n\n for (let i = 0; i < UUID_TEMPLATE.length; i++) {\n const c = UUID_TEMPLATE[i];\n if (c === '-') {\n uuid += '-';\n continue;\n }\n\n let r: number;\n if (hasCrypto && randomBytes) {\n // Each byte gives two hex digits (nibbles)\n r =\n (i % 2 === 0\n ? randomBytes[byteIndex] >> 4\n : randomBytes[byteIndex++] & 0x0f);\n } else {\n r = Math.floor(Math.random() * 16);\n }\n\n if (c === 'x') {\n uuid += HEX_CHARS[r];\n } else if (c === 'y') {\n // Variant bits: 8, 9, A, or B\n uuid += HEX_CHARS[(r & 0x3) | 0x8];\n } else if (c === '4') {\n uuid += '4';\n }\n }\n\n return uuid;\n};\n","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from './arrays';\nexport * from './strings';\nexport * from './dates';\nexport * from './objects';\nexport * from './runtime';\nexport * from './uuid';\nexport * from './replication';\nexport * from './types';\nexport * from './queryOptionsCollection';\nexport * from './dbPluginEventUtils';\nexport * from './functions';\nexport * from './unsafeCast';\nexport * from './logger';"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAA4D;AAEtB;AAE/B,SAAS,UAAU,CAAC,IAAa;IACpC,IAAI,sCAAM,CAAC,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAC/C,CAAC;AACL,CAAC;AAEM,SAAS,eAAe,CAAI,IAA0B,EAAE,OAAiC;IAC5F,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACf,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YAClB,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IACnC,CAAC;AACL,CAAC;AAEM,SAAS,aAAa,CAAI,IAAa,EAAE,OAAgB;IAC5D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,SAAS,CAAC,OAAO,IAAI,6CAA6C,CAAC,CAAC;IAClF,CAAC;AACL,CAAC;AAEM,SAAS,YAAY,CAAC,IAAa,EAAE,OAAgB;IACxD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,MAAM,IAAI,SAAS,CAAC,OAAO,IAAI,8CAA8C,CAAC,CAAC;IACnF,CAAC;AACL,CAAC;AAEM,SAAS,gBAAgB,CAAwC,KAAc,EAAE,QAAW;IAC/F,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;QAC5B,OAAO;IACX,CAAC;IAED,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,aAAa,IAAI,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvDF;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA,E;;;;ACNA,wF;;;;ACAA;AACA;AACA;AACA,uDAAuD,iBAAiB;AACxE;AACA,gDAAgD,aAAa;AAC7D,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNyB;AACC;AACF;AACE;AACA;AACH;AACO;AACN;AACiB;AACJ;AACT;AACC;AACJ"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routier/core",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "source": "./src/index.ts",
@@ -73,7 +73,7 @@
73
73
  "build": "npm run build:bundle && npm run build:types",
74
74
  "tsc": "tsc",
75
75
  "test": "jest",
76
- "lint": "eslint . --ext ts --report-unused-disable-directives --max-warnings 0"
76
+ "lint": "oxlint . --ignore-pattern \"**/__tests__/**\" --ignore-pattern \"**/*.test.*\" --ignore-pattern \"**/*.spec.*\" --ignore-pattern \"**/*.mjs\""
77
77
  },
78
78
  "sideEffects": false,
79
79
  "author": "James DeMeuse <james.demeuse@gmail.com>",
package/readme.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <img src="docs/assets/routier.svg" alt="Routier" width="140" height="140" />
5
5
  </p>
6
6
 
7
- > **⚠️ Beta Release** - This project is currently in beta. APIs may change between versions. Use with caution in production.
7
+ > **⚠️ Release Candidate** - This project is currently a release candidate. APIs may change between versions. Use with caution in production.
8
8
 
9
9
  A reactive data toolkit for building fast, local-first apps. Define schemas, create collections, use live queries, and make optimistic mutations with a plugin model for any storage.
10
10
 
@@ -1,23 +0,0 @@
1
- import { PluginEventCallbackPartialResult, PluginEventCallbackResult } from '../../results';
2
- import { DbPluginBulkPersistEvent, DbPluginEvent, DbPluginQueryEvent, IDbPlugin, OptimisticReplicationPluginOptions } from '../types';
3
- import { BulkPersistResult } from '../../collections';
4
- import { ITranslatedValue } from '../translators';
5
- export declare class OptimisticReplicationDbPlugin implements IDbPlugin {
6
- protected plugins: OptimisticReplicationPluginOptions;
7
- private collectionHydrationStatuses;
8
- /**
9
- * Creates a new OptimisticDbPluginReplicator that coordinates operations between a source database and its replicas.
10
- *
11
- * @param plugins Configuration object containing the source, read, and replica database plugins
12
- * @param plugins.source The primary database plugin that will receive all operations first
13
- * @param plugins.read The read-optimized plugin (typically a memory plugin) used for fast queries
14
- * @param plugins.replicas Additional database plugins that will replicate operations from the source
15
- */
16
- constructor(plugins: OptimisticReplicationPluginOptions);
17
- /**
18
- * Will query the read plugin if there is one, otherwise the source plugin will be queried
19
- */
20
- query<TEntity extends {}, TShape extends any = TEntity>(event: DbPluginQueryEvent<TEntity, TShape>, done: PluginEventCallbackResult<ITranslatedValue<TShape>>): void;
21
- destroy(event: DbPluginEvent, done: PluginEventCallbackResult<never>): void;
22
- bulkPersist(event: DbPluginBulkPersistEvent, done: PluginEventCallbackPartialResult<BulkPersistResult>): void;
23
- }
@@ -1,22 +0,0 @@
1
- import { PluginEventCallbackPartialResult, PluginEventCallbackResult } from '../../results';
2
- import { DbPluginBulkPersistEvent, DbPluginEvent, DbPluginQueryEvent, IDbPlugin, ReplicationPluginOptions } from '../types';
3
- import { BulkPersistResult } from '../../collections';
4
- import { ITranslatedValue } from '../translators';
5
- export declare class ReplicationDbPlugin implements IDbPlugin {
6
- plugins: ReplicationPluginOptions;
7
- /**
8
- * Creates a new DbPluginReplicator that coordinates operations between a source database and its replicas.
9
- *
10
- * @param plugins Configuration object containing the source, read (optional), and replica database plugins
11
- * @param plugins.source The primary database plugin that will receive all operations first
12
- * @param plugins.read Optional read-optimized plugin (typically a memory plugin) used for fast queries
13
- * @param plugins.replicas Additional database plugins that will replicate operations from the source
14
- */
15
- constructor(plugins: ReplicationPluginOptions);
16
- /**
17
- * Will query the read plugin if there is one, otherwise the source plugin will be queried
18
- */
19
- query<TEntity extends {}, TShape extends any = TEntity>(event: DbPluginQueryEvent<TEntity, TShape>, done: PluginEventCallbackResult<ITranslatedValue<TShape>>): void;
20
- destroy(event: DbPluginEvent, done: PluginEventCallbackResult<never>): void;
21
- bulkPersist(event: DbPluginBulkPersistEvent, done: PluginEventCallbackPartialResult<BulkPersistResult>): void;
22
- }
@@ -1,3 +0,0 @@
1
- export * from './ReplicationDbPlugin';
2
- export * from './OptimisticReplicationDbPlugin';
3
- export * from './types';
@@ -1,5 +0,0 @@
1
- import { IDbPlugin, ReplicationPluginOptions, OptimisticReplicationPluginOptions } from '../types';
2
- export type IDbPluginReplicator = IDbPlugin & {
3
- plugins: ReplicationPluginOptions | OptimisticReplicationPluginOptions;
4
- };
5
- export type HydrationStatus = "pending" | "fulfilled" | "rejected";