@routier/core 0.0.1-alpha.2 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assertions/index.d.ts +1 -1
- package/dist/assertions/index.js +7 -1
- package/dist/assertions/index.js.map +1 -1
- package/dist/codegen/handlers/SerializeHandlerBuilder.d.ts +2 -2
- package/dist/codegen/handlers/clone/CloneArrayHandler.d.ts +6 -0
- package/dist/codegen/handlers/deserialize/DeserializeDeserializerHandler.d.ts +6 -0
- package/dist/codegen/handlers/serialize/SerializeSerializerHandler.d.ts +6 -0
- package/dist/collections/ReadonlySchemaCollection.d.ts +17 -0
- package/dist/collections/SchemaCollection.d.ts +5 -3
- package/dist/collections/index.d.ts +1 -0
- package/dist/collections/index.js +67 -9
- package/dist/collections/index.js.map +1 -1
- package/dist/expressions/index.js +67 -23
- package/dist/expressions/index.js.map +1 -1
- package/dist/expressions/parser.d.ts +1 -1
- package/dist/index.js +598 -223
- package/dist/index.js.map +1 -1
- package/dist/plugins/index.js +58 -9
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/translators/SqlTranslator.d.ts +2 -1
- package/dist/plugins/types.d.ts +2 -0
- package/dist/schema/communication/broadcast.d.ts +11 -0
- package/dist/schema/index.js +420 -182
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/property/modifiers/SchemaSerialize.d.ts +1 -1
- package/dist/schema/testSchemas.test.d.ts +269 -0
- package/dist/schema/types.d.ts +7 -4
- package/dist/utilities/dbPluginEventUtils.d.ts +1 -1
- package/dist/utilities/functions.d.ts +1 -0
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/index.js +18 -1
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/types.d.ts +3 -0
- package/package.json +3 -4
- package/readme.md +0 -6
- /package/dist/{pipeline/TrampolinePipeline.test.d.ts → schema/schemaGeneration.test.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function assertDate(data: unknown): asserts data is Date;
|
|
2
|
-
export declare function assertIsNotNull<T>(data: T | null | undefined, message?: string): asserts data is NonNullable<T>;
|
|
2
|
+
export declare function assertIsNotNull<T>(data: T | null | undefined, message?: string | (() => string)): asserts data is NonNullable<T>;
|
|
3
3
|
export declare function assertIsArray<T>(data: unknown, message?: string): asserts data is T[];
|
|
4
4
|
export declare function assertString(data: unknown, message?: string): asserts data is string;
|
|
5
5
|
export declare function assertInstanceOf<T extends new (...args: any[]) => any>(value: unknown, Instance: T): asserts value is T;
|
package/dist/assertions/index.js
CHANGED
|
@@ -96,7 +96,13 @@ function assertDate(data) {
|
|
|
96
96
|
}
|
|
97
97
|
function assertIsNotNull(data, message) {
|
|
98
98
|
if (data == null) {
|
|
99
|
-
|
|
99
|
+
if (message == null) {
|
|
100
|
+
throw new TypeError('Assertion failed, data is null');
|
|
101
|
+
}
|
|
102
|
+
if (typeof message === "string") {
|
|
103
|
+
throw new TypeError(message);
|
|
104
|
+
}
|
|
105
|
+
throw new TypeError(message());
|
|
100
106
|
}
|
|
101
107
|
}
|
|
102
108
|
function assertIsArray(data, message) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertions/index.js","sources":["webpack://@routier/core/./src/utilities/dates.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/assertions/index.ts"],"sourcesContent":["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}","__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};","import { 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): asserts data is NonNullable<T> {\n if (data == null) {\n throw new TypeError(
|
|
1
|
+
{"version":3,"file":"assertions/index.js","sources":["webpack://@routier/core/./src/utilities/dates.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/assertions/index.ts"],"sourcesContent":["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}","__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};","import { 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}"],"names":[],"mappings":";;;;;;;;;;AAAO,MAAM,MAAM,GAAG,CAAC,IAAa,EAAgB,EAAE;IAClD,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,YAAY,IAAI,CAAC;AAChC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVD;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA;AACA;;;;ACNA;;;;ACAA;AACA;AACA;AACA,uDAAuD,iBAAiB;AACxE;AACA,gDAAgD,aAAa;AAC7D;;;;;;;;;;;;;;;;;;;ACNsC;AAE/B,SAAS,UAAU,CAAC,IAAa;IACpC,IAAI,kDAAM,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,KAAK,EAAE,CAAC;QACvE,MAAM,IAAI,SAAS,CAAC,yCAAyC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED,MAAM,IAAI,SAAS,CAAC,+BAA+B,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SerializeSerializerHandler } from "./serialize/SerializeSerializerHandler";
|
|
2
2
|
export declare class SerializeHandlerBuilder {
|
|
3
|
-
build():
|
|
3
|
+
build(): SerializeSerializerHandler;
|
|
4
4
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
export declare class CloneArrayHandler extends PropertyInfoHandler {
|
|
5
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
export declare class DeserializeDeserializerHandler extends PropertyInfoHandler {
|
|
5
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
export declare class SerializeSerializerHandler extends PropertyInfoHandler {
|
|
5
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CompiledSchema, SchemaId } from "../schema";
|
|
2
|
+
/**
|
|
3
|
+
* Collection of schemas with generic typing for type-safe schema retrieval
|
|
4
|
+
*/
|
|
5
|
+
export declare class ReadonlySchemaCollection {
|
|
6
|
+
protected data: Map<SchemaId, CompiledSchema<Record<string, unknown>>>;
|
|
7
|
+
constructor(data?: [SchemaId, CompiledSchema<Record<string, unknown>>][]);
|
|
8
|
+
get<T>(schemaId: SchemaId): CompiledSchema<T> | undefined;
|
|
9
|
+
has(schemaId: SchemaId): boolean;
|
|
10
|
+
get size(): number;
|
|
11
|
+
keys(): IterableIterator<SchemaId>;
|
|
12
|
+
values(): IterableIterator<CompiledSchema<Record<string, unknown>>>;
|
|
13
|
+
entries(): IterableIterator<[SchemaId, CompiledSchema<Record<string, unknown>>]>;
|
|
14
|
+
forEach(callbackfn: (value: CompiledSchema<Record<string, unknown>>, key: SchemaId, map: Map<SchemaId, CompiledSchema<Record<string, unknown>>>) => void, thisArg?: any): void;
|
|
15
|
+
[Symbol.iterator](): IterableIterator<[SchemaId, CompiledSchema<Record<string, unknown>>]>;
|
|
16
|
+
getByName<T>(collectionName: string): CompiledSchema<T> | undefined;
|
|
17
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { CompiledSchema, SchemaId } from "../schema";
|
|
2
|
+
import { ReadonlySchemaCollection } from "./ReadonlySchemaCollection";
|
|
2
3
|
/**
|
|
3
4
|
* Collection of schemas with generic typing for type-safe schema retrieval
|
|
4
5
|
*/
|
|
5
|
-
export declare class SchemaCollection extends
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
export declare class SchemaCollection extends ReadonlySchemaCollection {
|
|
7
|
+
set<T>(schemaId: SchemaId, schema: CompiledSchema<T>): this;
|
|
8
|
+
delete(schemaId: SchemaId): boolean;
|
|
9
|
+
clear(): void;
|
|
8
10
|
}
|
|
@@ -297,24 +297,49 @@ class MemoryDataCollection {
|
|
|
297
297
|
|
|
298
298
|
|
|
299
299
|
}),
|
|
300
|
-
"./src/collections/
|
|
301
|
-
|
|
302
|
-
!*** ./src/collections/
|
|
303
|
-
|
|
300
|
+
"./src/collections/ReadonlySchemaCollection.ts":
|
|
301
|
+
/*!*****************************************************!*\
|
|
302
|
+
!*** ./src/collections/ReadonlySchemaCollection.ts ***!
|
|
303
|
+
\*****************************************************/
|
|
304
304
|
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
305
305
|
__webpack_require__.r(__webpack_exports__);
|
|
306
306
|
__webpack_require__.d(__webpack_exports__, {
|
|
307
|
-
|
|
307
|
+
ReadonlySchemaCollection: () => (ReadonlySchemaCollection)
|
|
308
308
|
});
|
|
309
309
|
/**
|
|
310
310
|
* Collection of schemas with generic typing for type-safe schema retrieval
|
|
311
311
|
*/
|
|
312
|
-
class
|
|
312
|
+
class ReadonlySchemaCollection {
|
|
313
|
+
data;
|
|
314
|
+
constructor(data) {
|
|
315
|
+
this.data = new Map(data);
|
|
316
|
+
}
|
|
313
317
|
get(schemaId) {
|
|
314
|
-
return
|
|
318
|
+
return this.data.get(schemaId);
|
|
319
|
+
}
|
|
320
|
+
has(schemaId) {
|
|
321
|
+
return this.data.has(schemaId);
|
|
322
|
+
}
|
|
323
|
+
get size() {
|
|
324
|
+
return this.data.size;
|
|
325
|
+
}
|
|
326
|
+
keys() {
|
|
327
|
+
return this.data.keys();
|
|
328
|
+
}
|
|
329
|
+
values() {
|
|
330
|
+
return this.data.values();
|
|
331
|
+
}
|
|
332
|
+
entries() {
|
|
333
|
+
return this.data.entries();
|
|
334
|
+
}
|
|
335
|
+
forEach(callbackfn, thisArg) {
|
|
336
|
+
this.data.forEach(callbackfn, thisArg);
|
|
337
|
+
}
|
|
338
|
+
[Symbol.iterator]() {
|
|
339
|
+
return this.data[Symbol.iterator]();
|
|
315
340
|
}
|
|
316
341
|
getByName(collectionName) {
|
|
317
|
-
const found = [...this].find(x => x[1].collectionName === collectionName);
|
|
342
|
+
const found = [...this.data].find(x => x[1].collectionName === collectionName);
|
|
318
343
|
if (found != null) {
|
|
319
344
|
return found[1];
|
|
320
345
|
}
|
|
@@ -323,6 +348,35 @@ class SchemaCollection extends Map {
|
|
|
323
348
|
}
|
|
324
349
|
|
|
325
350
|
|
|
351
|
+
}),
|
|
352
|
+
"./src/collections/SchemaCollection.ts":
|
|
353
|
+
/*!*********************************************!*\
|
|
354
|
+
!*** ./src/collections/SchemaCollection.ts ***!
|
|
355
|
+
\*********************************************/
|
|
356
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
357
|
+
__webpack_require__.r(__webpack_exports__);
|
|
358
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
359
|
+
SchemaCollection: () => (SchemaCollection)
|
|
360
|
+
});
|
|
361
|
+
/* ESM import */var _ReadonlySchemaCollection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ReadonlySchemaCollection */ "./src/collections/ReadonlySchemaCollection.ts");
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Collection of schemas with generic typing for type-safe schema retrieval
|
|
365
|
+
*/
|
|
366
|
+
class SchemaCollection extends _ReadonlySchemaCollection__WEBPACK_IMPORTED_MODULE_0__.ReadonlySchemaCollection {
|
|
367
|
+
set(schemaId, schema) {
|
|
368
|
+
this.data.set(schemaId, schema);
|
|
369
|
+
return this;
|
|
370
|
+
}
|
|
371
|
+
delete(schemaId) {
|
|
372
|
+
return this.data.delete(schemaId);
|
|
373
|
+
}
|
|
374
|
+
clear() {
|
|
375
|
+
this.data.clear();
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
|
|
326
380
|
}),
|
|
327
381
|
"./src/collections/TagCollection.ts":
|
|
328
382
|
/*!******************************************!*\
|
|
@@ -628,6 +682,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
628
682
|
BulkPersistResult: () => (/* reexport safe */ _Changes__WEBPACK_IMPORTED_MODULE_0__.BulkPersistResult),
|
|
629
683
|
IdSet: () => (/* reexport safe */ _IdSet__WEBPACK_IMPORTED_MODULE_2__.IdSet),
|
|
630
684
|
MemoryDataCollection: () => (/* reexport safe */ _MemoryDataCollection__WEBPACK_IMPORTED_MODULE_3__.MemoryDataCollection),
|
|
685
|
+
ReadonlySchemaCollection: () => (/* reexport safe */ _ReadonlySchemaCollection__WEBPACK_IMPORTED_MODULE_5__.ReadonlySchemaCollection),
|
|
631
686
|
SchemaCollection: () => (/* reexport safe */ _SchemaCollection__WEBPACK_IMPORTED_MODULE_4__.SchemaCollection),
|
|
632
687
|
SchemaPersistChanges: () => (/* reexport safe */ _Changes__WEBPACK_IMPORTED_MODULE_0__.SchemaPersistChanges),
|
|
633
688
|
SchemaPersistResult: () => (/* reexport safe */ _Changes__WEBPACK_IMPORTED_MODULE_0__.SchemaPersistResult),
|
|
@@ -638,6 +693,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
638
693
|
/* ESM import */var _IdSet__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IdSet */ "./src/collections/IdSet.ts");
|
|
639
694
|
/* ESM import */var _MemoryDataCollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MemoryDataCollection */ "./src/collections/MemoryDataCollection.ts");
|
|
640
695
|
/* ESM import */var _SchemaCollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SchemaCollection */ "./src/collections/SchemaCollection.ts");
|
|
696
|
+
/* ESM import */var _ReadonlySchemaCollection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ReadonlySchemaCollection */ "./src/collections/ReadonlySchemaCollection.ts");
|
|
697
|
+
|
|
641
698
|
|
|
642
699
|
|
|
643
700
|
|
|
@@ -650,10 +707,11 @@ var __webpack_exports__BulkPersistChanges = __webpack_exports__.BulkPersistChang
|
|
|
650
707
|
var __webpack_exports__BulkPersistResult = __webpack_exports__.BulkPersistResult;
|
|
651
708
|
var __webpack_exports__IdSet = __webpack_exports__.IdSet;
|
|
652
709
|
var __webpack_exports__MemoryDataCollection = __webpack_exports__.MemoryDataCollection;
|
|
710
|
+
var __webpack_exports__ReadonlySchemaCollection = __webpack_exports__.ReadonlySchemaCollection;
|
|
653
711
|
var __webpack_exports__SchemaCollection = __webpack_exports__.SchemaCollection;
|
|
654
712
|
var __webpack_exports__SchemaPersistChanges = __webpack_exports__.SchemaPersistChanges;
|
|
655
713
|
var __webpack_exports__SchemaPersistResult = __webpack_exports__.SchemaPersistResult;
|
|
656
714
|
var __webpack_exports__TagCollection = __webpack_exports__.TagCollection;
|
|
657
|
-
export { __webpack_exports__BulkPersistChanges as BulkPersistChanges, __webpack_exports__BulkPersistResult as BulkPersistResult, __webpack_exports__IdSet as IdSet, __webpack_exports__MemoryDataCollection as MemoryDataCollection, __webpack_exports__SchemaCollection as SchemaCollection, __webpack_exports__SchemaPersistChanges as SchemaPersistChanges, __webpack_exports__SchemaPersistResult as SchemaPersistResult, __webpack_exports__TagCollection as TagCollection };
|
|
715
|
+
export { __webpack_exports__BulkPersistChanges as BulkPersistChanges, __webpack_exports__BulkPersistResult as BulkPersistResult, __webpack_exports__IdSet as IdSet, __webpack_exports__MemoryDataCollection as MemoryDataCollection, __webpack_exports__ReadonlySchemaCollection as ReadonlySchemaCollection, __webpack_exports__SchemaCollection as SchemaCollection, __webpack_exports__SchemaPersistChanges as SchemaPersistChanges, __webpack_exports__SchemaPersistResult as SchemaPersistResult, __webpack_exports__TagCollection as TagCollection };
|
|
658
716
|
|
|
659
717
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections/index.js","sources":["webpack://@routier/core/./src/collections/Changes.ts","webpack://@routier/core/./src/collections/IdSet.ts","webpack://@routier/core/./src/collections/MemoryDataCollection.ts","webpack://@routier/core/./src/collections/SchemaCollection.ts","webpack://@routier/core/./src/collections/TagCollection.ts","webpack://@routier/core/./src/results/Result.ts","webpack://@routier/core/./src/schema/types.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/collections/index.ts"],"sourcesContent":["import { EntityUpdateInfo } from \"../plugins/types\";\nimport { InferCreateType, InferType, SchemaId } from \"../schema\";\nimport { TagCollection } from \"./TagCollection\";\nexport class BulkPersistResult extends Map<SchemaId, SchemaPersistResult> {\n\n resolve(schemaId: SchemaId): SchemaPersistResult {\n if (this.has(schemaId)) {\n return this.get(schemaId);\n }\n\n this.set(schemaId, new SchemaPersistResult());\n\n return this.get(schemaId);\n }\n\n override get<T extends {} = Record<string, unknown>>(schemaId: SchemaId) {\n return super.get(schemaId) as SchemaPersistResult<T>\n }\n\n get aggregate() {\n return {\n size: this.aggregateSize,\n adds: this.aggregateAddsSize,\n updates: this.aggregateUpdatesSize,\n removes: this.aggregateRemovesSize\n }\n }\n\n private get aggregateSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.total;\n }\n\n return count;\n }\n\n private get aggregateAddsSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.adds.length;\n }\n\n return count;\n }\n\n private get aggregateUpdatesSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.updates.length;\n }\n\n return count;\n }\n\n private get aggregateRemovesSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.removes.length;\n }\n\n return count;\n }\n}\n\nexport class BulkPersistChanges extends Map<SchemaId, SchemaPersistChanges> {\n\n resolve(schemaId: SchemaId): SchemaPersistChanges {\n if (this.has(schemaId)) {\n return this.get(schemaId);\n }\n\n this.set(schemaId, new SchemaPersistChanges());\n\n return this.get(schemaId);\n }\n\n override get<T extends {} = Record<string, unknown>>(schemaId: SchemaId) {\n return super.get(schemaId) as SchemaPersistChanges<T>\n }\n\n get aggregate() {\n return {\n size: this.aggregateSize,\n adds: this.aggregateAddsSize,\n updates: this.aggregateUpdatesSize,\n removes: this.aggregateRemovesSize\n }\n }\n\n private get aggregateSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.total;\n }\n\n return count;\n }\n\n private get aggregateAddsSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.adds.length;\n }\n\n return count;\n }\n\n private get aggregateUpdatesSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.updates.length;\n }\n\n return count;\n }\n\n private get aggregateRemovesSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.removes.length;\n }\n\n return count;\n }\n\n /**\n * Ensures the result has the same result sets as the change sets\n * @returns \n */\n toResult() {\n const result = new BulkPersistResult();\n\n for (const [schemaId] of this) {\n result.set(schemaId, new SchemaPersistResult());\n }\n\n return result;\n }\n}\n\nexport class SchemaPersistChanges<T extends {} = Record<string, unknown>> {\n adds: InferCreateType<T>[] = [];\n updates: EntityUpdateInfo<T>[] = [];\n removes: InferType<T>[] = [];\n tags: TagCollection = new TagCollection();\n\n get hasItems() {\n return this.total > 0;\n }\n\n get total() {\n return this.adds.length + this.updates.length + this.removes.length;\n }\n}\n\nexport class SchemaPersistResult<T extends {} = Record<string, unknown>> {\n adds: InferType<T>[] = [];\n updates: InferType<T>[] = [];\n removes: InferType<T>[] = [];\n\n get hasItems() {\n return this.total > 0;\n }\n\n get total() {\n return this.adds.length + this.updates.length + this.removes.length;\n }\n}","import { IdType } from \"../schema\";\n\nexport class IdSet {\n\n readonly ids: readonly IdType[];\n\n constructor(...ids: IdType[]) {\n this.ids = Object.freeze(ids);\n }\n\n equals(other: IdSet): boolean {\n\n if (this.ids.length === 1) {\n return this.ids[0] === other.ids[0];\n }\n\n return this.toString() === other.toString();\n }\n\n toString(): string {\n\n if (this.ids.length === 1) {\n return String(this.ids[0]);\n }\n\n return this.ids.toString();\n }\n}","import { CompiledSchema, IdType, InferType, PropertyInfo, SchemaTypes } from \"../schema\";\nimport { CallbackResult, Result } from \"../results\";\nimport { uuidv4 } from \"../utilities\";\nimport { IdSet } from \"./IdSet\";\n\nexport class MemoryDataCollection {\n\n protected readonly nextNumericalIds: Map<string, number>;\n protected readonly data: Map<string, Record<string, unknown>>;\n protected readonly schema: CompiledSchema<any>;\n protected readonly idProperties: PropertyInfo<any>[];\n\n get size() {\n return this.data.size;\n }\n\n get records() {\n return [...this.data.values()];\n }\n\n constructor(schema: CompiledSchema<any>) {\n this.data = new Map<string, Record<string, unknown>>();\n this.nextNumericalIds = new Map<string, number>();\n this.schema = schema;\n this.idProperties = schema.idProperties;\n }\n\n private _getNextId(property: PropertyInfo<any>) {\n\n let nextId = 1;\n\n if (this.nextNumericalIds.has(property.id) === true) {\n nextId = this.nextNumericalIds.get(property.id) + 1;\n }\n\n this.nextNumericalIds.set(property.id, nextId);\n\n return nextId;\n }\n\n private getAndSetId(item: Record<string, unknown>, property: PropertyInfo<any>): IdType {\n if (item[property.name] != null) {\n return item[property.name] as IdType;\n }\n\n if (property.type === SchemaTypes.String) {\n const uuid = uuidv4()\n item[property.name] = uuid;\n return uuid;\n }\n\n if (property.type === SchemaTypes.Number) {\n const id = this._getNextId(property);\n item[property.name] = id;\n return id;\n }\n\n throw new Error(`Id Property '${property.name}' must be string or number, found '${property.type}'`)\n }\n\n seed(items: Record<string, unknown>[]) {\n for (let i = 0, length = items.length; i < length; i++) {\n const id = this.resolveIdSet(items[i] as InferType<unknown>);\n this.data.set(id.toString(), items[i]);\n }\n }\n\n private resolveCurrentIdSet(item: Record<string, unknown>): IdSet {\n const idProperties = this.schema.idProperties;\n const ids: IdType[] = [];\n // ensure keys\n for (let j = 0, l = idProperties.length; j < l; j++) {\n const property = idProperties[j];\n const value = property.getValue(item);\n\n if (value == null) {\n throw new Error(`Key cannot be null. Key: ${property.name}`);\n }\n\n ids.push(value);\n }\n\n return new IdSet(...ids);\n }\n\n private resolveIdSet(item: Record<string, unknown>): IdSet {\n\n if (this.schema.hasIdentityKeys) {\n const ids: IdType[] = [];\n const idProperties = this.schema.idProperties;\n\n if (idProperties.length === 1) {\n ids.push(this.getAndSetId(item, idProperties[0]));\n } else {\n for (let j = 0, l = idProperties.length; j < l; j++) {\n ids.push(this.getAndSetId(item, idProperties[j]));\n }\n }\n\n return new IdSet(...ids);\n }\n\n return this.resolveCurrentIdSet(item);\n }\n\n add(item: Record<string, unknown>) {\n const id = this.resolveIdSet(item);\n this.data.set(id.toString(), item);\n }\n\n remove(item: Record<string, unknown>) {\n const id = this.resolveCurrentIdSet(item);\n this.data.delete(id.toString());\n }\n\n update(item: Record<string, unknown>) {\n const id = this.resolveCurrentIdSet(item);\n this.data.set(id.toString(), item);\n }\n\n destroy(done: CallbackResult<never>) {\n this.nextNumericalIds.clear();\n this.data.clear();\n done(Result.success());\n }\n\n load(done: CallbackResult<never>) {\n done(Result.success())\n }\n\n save(done: CallbackResult<never>) {\n done(Result.success())\n }\n}","import { CompiledSchema, SchemaId } from \"../schema\";\n\n/**\n * Collection of schemas with generic typing for type-safe schema retrieval\n */\nexport class SchemaCollection extends Map<SchemaId, CompiledSchema<Record<string, unknown>>> {\n\n override get<T>(schemaId: SchemaId) {\n return super.get(schemaId) as CompiledSchema<T>;\n }\n\n getByName<T>(collectionName: string): CompiledSchema<T> | undefined {\n const found = [...this].find(x => x[1].collectionName === collectionName);\n\n if (found != null) {\n return found[1] as CompiledSchema<T>;\n }\n\n return undefined;\n }\n\n}","export class TagCollection implements Disposable {\n\n private data: Map<Object, unknown> = new Map<Object, unknown>();\n private _size: number = 0;\n\n get size() {\n return this._size;\n }\n\n get(key: Object) {\n return this.data.get(key);\n }\n\n has(key: Object) {\n return this.data.has(key);\n }\n\n set(key: Object, tag: unknown) {\n this._size++;\n return this.data.set(key, tag);\n }\n\n delete(key: Object) {\n const result = this.data.delete(key);\n\n if (result) {\n this._size--;\n }\n\n return result;\n }\n\n setMany(keys: Object[], tag: unknown) {\n this._size += keys.length;\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n this.set(key, tag);\n }\n }\n\n combine(tags: TagCollection) {\n for (const [key, value] of tags) {\n this.data.set(key, value);\n }\n }\n\n values() {\n return this.data.values();\n }\n\n keys() {\n return this.data.keys();\n }\n\n [Symbol.dispose]() {\n this.data = null as any;\n }\n\n [Symbol.iterator]() {\n return this.data[Symbol.iterator]();\n }\n}","import { PartialResultType, PluginEventPartialResultType, PluginEventResultType, ResultType } from \"./types\";\n\nabstract class BaseResult {\n static ERROR = \"error\" as const;\n static SUCCESS = \"success\" as const;\n static PARTIAL = \"partial\" as const;\n\n static resolve<T>(result: ResultType<T> | PartialResultType<T>, resolve: (data: T) => void, reject: (error?: any) => void) {\n if (result.ok === BaseResult.SUCCESS) {\n resolve(result.data);\n return;\n }\n\n if (result.ok === BaseResult.PARTIAL) {\n reject({\n partial: result.data,\n error: result.error\n });\n return;\n }\n\n reject(result.error);\n }\n\n static assertSuccess<T>(result: any): asserts result is { ok: \"success\"; data: T } {\n if (result.ok !== BaseResult.SUCCESS) {\n throw new Error(`Expected success result, but got ${result.ok}: ${result.error}`);\n }\n }\n}\n\nexport class Result extends BaseResult {\n static success<T>(data: T): ResultType<T>;\n static success<T>(): ResultType<never>;\n static success<T>(data?: T): ResultType<T> {\n return {\n ok: Result.SUCCESS,\n data\n }\n }\n\n static error<T>(error: any): ResultType<T> {\n return {\n ok: Result.ERROR,\n error\n }\n }\n\n static partial<T>(data: T, error: any): PartialResultType<T> {\n return {\n ok: Result.PARTIAL,\n data,\n error\n }\n }\n}\n\nexport class PluginEventResult extends BaseResult {\n static success<T>(id: string, data: T): PluginEventResultType<T>;\n static success<T>(id: string): PluginEventResultType<never>;\n static success<T>(id: string, data?: T): PluginEventResultType<T> {\n return {\n id,\n ok: Result.SUCCESS,\n data\n }\n }\n\n static error<T>(id: string, error: any): PluginEventResultType<T> {\n return {\n id,\n ok: Result.ERROR,\n error\n }\n }\n\n static partial<T>(id: string, data: T, error: any): PluginEventPartialResultType<T> {\n return {\n id,\n ok: Result.PARTIAL,\n data,\n error\n }\n }\n\n static assertSuccess<T>(result: PluginEventResultType<T>): asserts result is { ok: \"success\"; data: T; id: string } {\n if (result.ok !== Result.SUCCESS) {\n throw new Error(`Expected success result, but got ${result.ok}: ${result.error}`);\n }\n }\n}\n","import { SchemaDefinition } from \"./SchemaDefinition\";\nimport { SchemaBase } from \"./property/base/SchemaBase\";\nimport { SchemaArray } from \"./property/types/SchemaArray\";\nimport { SchemaObject } from \"./property/types/SchemaObject\";\nimport { PropertyInfo } from \"./PropertyInfo\";\nimport { DeepPartial } from \"../types\";\nimport { SchemaFunction } from \"./table\";\n\nexport type DefaultValue<T, I = never> = T | ((injected: I) => T);\nexport type FunctionBody<TEntity, TResult> = (entity: TEntity, collectionName: string) => TResult;\nexport type IdType = string | number;\n\nexport enum SchemaTypes {\n Array = \"Array\",\n Boolean = \"Boolean\",\n Date = \"Date\",\n Number = \"Number\",\n Object = \"Object\",\n String = \"String\",\n Definition = \"Definition\",\n Function = \"Function\",\n Computed = \"Computed\"\n}\n\nexport type ArrayShape = string | number | Date | {};\n\nexport type ExpandedProperty = ExpandedChildProperty & {\n assignmentPath: string;\n selectorPath: string;\n properties: Map<string, ExpandedChildProperty>;\n childDegree: number;\n};\n\nexport type ExpandedChildProperty = {\n propertyName: string;\n type: SchemaTypes;\n isNullableOrOptional: boolean;\n isReadonly: boolean;\n isIdentity: boolean;\n isUnmapped: boolean;\n}\n\nexport enum HashType {\n Ids = \"Ids\",\n Object = \"Object\"\n}\n\nexport type HashFunction<TEntity extends {}> = {\n (entity: InferCreateType<TEntity>, type: HashType.Object): string;\n (entity: InferType<TEntity>, type: HashType.Ids): string;\n}\n\nexport type GetHashTypeFunction<TEntity extends {}> = {\n (entity: InferCreateType<TEntity>): HashType.Object;\n (entity: InferType<TEntity>): HashType.Ids;\n}\n\nexport type ChangeTrackingType = \"proxy\" | \"diff\" | \"immutable\";\n\nexport type IndexType = \"single\" | \"compound\" | \"unique\" | \"primary-key\"\nexport type Index = {\n properties: PropertyInfo<any>[],\n type: IndexType;\n name: string;\n}\n\n/**\n * Represents changes to subscriptions, categorizing them by modifications to\n * entities (additions, updates, removals) or query-driven removals.\n * @template T - The type of the entities in the subscription.\n */\nexport type SubscriptionChanges<T extends {}> = {\n /**\n * Entities that have been added to the subscription.\n */\n adds: InferType<T>[];\n /**\n * Entities that have been updated within the subscription.\n */\n updates: InferType<T>[];\n /**\n * Entities that have been removed from the subscription.\n */\n removals: InferType<T>[];\n /**\n * Entities that have been added/updated/removed from the subscription and it is unknown \n * if the entities have been added/updated/removed.\n */\n unknown: InferType<T>[];\n}\n\nexport interface ICollectionSubscription<T extends {}> extends Disposable {\n send(changes: SubscriptionChanges<T>): void;\n onMessage(callback: (changes: SubscriptionChanges<T>) => void): void;\n}\n\ntype Enrich<TEntity extends {}> = {\n (entity: InferType<TEntity>, changeTrackingType: ChangeTrackingType): InferType<TEntity>;\n (entity: InferCreateType<TEntity>, changeTrackingType: ChangeTrackingType): InferCreateType<TEntity>;\n}\n\n/**\n * Represents a fully compiled schema with all utilities and metadata for an entity type.\n */\nexport type CompiledSchema<TEntity extends {}> = {\n\n deserializePartial: (item: Record<string, unknown>, properties: PropertyInfo<TEntity>[]) => DeepPartial<InferType<TEntity>>;\n\n createSubscription: (abortSignal?: AbortSignal) => ICollectionSubscription<TEntity>;\n /** Returns the property info for a given id (full path) */\n getProperty: (id: string) => PropertyInfo<TEntity>;\n /** Returns the ID of the given entity. */\n getId: (entity: InferType<TEntity>) => IdType;\n /** Returns a deep clone of the given entity. */\n clone: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** Removes unmapped or extraneous properties from the entity. */\n strip: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** Prepares a new entity for creation, applying defaults and transformations. */\n prepare: (entity: InferCreateType<TEntity>) => InferCreateType<TEntity>;\n /** Merges the source entity into the destination entity. */\n merge: (destination: InferType<TEntity> | InferCreateType<TEntity>, source: InferType<TEntity>) => InferType<TEntity>;\n /** Indicates if the schema has identity properties. */\n hasIdentities: boolean;\n /** List of properties that are identity keys. */\n idProperties: PropertyInfo<TEntity>[];\n /** All property metadata for the schema. */\n properties: PropertyInfo<TEntity>[],\n /** The hash type used for this schema. */\n hashType: HashType;\n /** Computes a hash for the given entity. */\n hash: HashFunction<TEntity>;\n /** Returns the hash type for the given entity. */\n getHashType: GetHashTypeFunction<TEntity>;\n /** Compares two entities for equality. */\n compare: (a: InferType<TEntity>, fromDb: InferType<TEntity>) => boolean;\n /** Deserializes an entity from storage format. */\n deserialize: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** Serializes an entity to storage format. */\n serialize: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** Unique id for the schema. */\n id: SchemaId,\n /** The name of the collection for this schema. */\n collectionName: string;\n /** Returns all IDs for the given entity (usually a single-element tuple). */\n getIds: (entity: InferType<TEntity>) => [IdType];\n /** Enriches the entity with change tracking or other metadata. */\n enrich: Enrich<TEntity>;\n /** Indicates if the schema has identity keys. */\n hasIdentityKeys: boolean;\n /** Returns a deeply frozen (immutable) version of the entity. */\n freeze: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** Enables change tracking on the entity. */\n enableChangeTracking: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** The schema definition object. */\n definition: SchemaDefinition<TEntity>;\n /** Returns all indexes defined for this schema. */\n getIndexes: () => Index[];\n}\n\nexport type PropertySerializer<T extends any> = (value: T) => string | number;\nexport type PropertyDeserializer<T extends any> = (value: string | number) => T;\n\nexport type SchemaId = number\n\nexport type SchemaModifiers = \"default\" | \"deserialize\" |\n \"identity\" | \"key\" |\n \"nullable\" | \"optional\" |\n \"readonly\" | \"serialize\" |\n \"unmapped\" | \"computed\" |\n \"distinct\";\n//SchemaFunction\ntype InferPrimitive<T> =\n T extends SchemaArray<infer Y, infer __> ? InferPrimitive<Y>[]\n : T extends SchemaObject<infer Obj, infer _> ?\n { [K in keyof Obj]: InferPrimitive<Obj[K]> } : // Process nested objects\n T extends SchemaFunction<infer F, infer __> ? F : T extends SchemaBase<infer X, infer _> ?\n X : // Extract the primitive type\n never;\n\nexport type InferType<T> = T extends CompiledSchema<infer R> ? InferCompiledSchema<R> : T extends {} ? InferCompiledSchema<T> : T;\nexport type InferCreateType<T> = T extends CompiledSchema<infer R> ? InferCompiledCreateSchema<R> : T extends {} ? InferCompiledCreateSchema<T> : unknown;\nexport type InferMappedType<T> = T extends SchemaBase<infer K, infer __> ? InferType<K> : InferCompiledSchema<T>;\n\ntype HasModifier<T, K extends keyof T, M extends SchemaModifiers> =\n T[K] extends SchemaBase<any, infer Mods> ?\n M extends Mods ? true : false :\n false;\n\ntype IsPlainProperty<T, K extends keyof T> =\n [\n HasModifier<T, K, \"readonly\">,\n HasModifier<T, K, \"optional\">,\n HasModifier<T, K, \"nullable\">\n ] extends [\n false,\n false,\n false\n ] ? true : false;\n\ntype IsPlainCreateProperty<T, K extends keyof T> =\n [\n HasModifier<T, K, \"identity\">,\n HasModifier<T, K, \"default\">,\n HasModifier<T, K, \"computed\">,\n HasModifier<T, K, \"unmapped\">,\n HasModifier<T, K, \"optional\">,\n HasModifier<T, K, \"nullable\">\n ] extends [\n false,\n false,\n false,\n false,\n false,\n false\n ] ? true : false;\n\ntype InferCompiledSchema<T> = CoalesceEmpty<{\n [K in keyof T as IsPlainProperty<T, K> extends true ? K : never]: InferPrimitive<T[K]>\n}, {\n readonly [K in keyof T as HasModifier<T, K, \"readonly\"> extends true ? K : never]: InferPrimitive<T[K]>\n }, {\n [K in keyof T as HasModifier<T, K, \"optional\"> extends true ? K : never]?: InferPrimitive<T[K]>\n }, {\n [K in keyof T as HasModifier<T, K, \"nullable\"> extends true ? K : never]: null | InferPrimitive<T[K]>\n }>;\n\ntype InferCompiledCreateSchema<T> = CoalesceEmpty<{\n [K in keyof T as IsPlainCreateProperty<T, K> extends true ? K : never]: InferPrimitive<T[K]>\n}, {\n [K in keyof T as HasModifier<T, K, \"optional\"> extends true ? K : never]?: InferPrimitive<T[K]>\n }, {\n [K in keyof T as HasModifier<T, K, \"default\"> extends true ? K : never]?: InferPrimitive<T[K]>\n }, {\n [K in keyof T as HasModifier<T, K, \"nullable\"> extends true ? K : never]: null | InferPrimitive<T[K]>\n }>;\n\ntype IsEmptyObject<T> = keyof T extends never ? true : false;\ntype CoalesceEmpty<T1 extends {}, T2 extends {}, T3 extends {}, T4 extends {}> = (IsEmptyObject<T1> extends true ? {} : T1) & (IsEmptyObject<T2> extends true ? {} : T2) & (IsEmptyObject<T3> extends true ? {} : T3) & (IsEmptyObject<T4> extends true ? {} : T4);\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 './Changes';\nexport * from './TagCollection';\nexport * from './IdSet';\nexport * from './MemoryDataCollection';\nexport * from './SchemaCollection';"],"names":[],"mappings":";;;;;;;;;;;;;;AAEgD;AACzC,MAAM,iBAAkB,SAAQ,GAAkC;IAErE,OAAO,CAAC,QAAkB;QACtB,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC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AG,EAAE,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;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;;;;ACNA;;;;ACAA;AACA;AACA;AACA,uDAAuD,iBAAiB;AACxE;AACA,gDAAgD,aAAa;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;ACN0B;AACM;AACR;AACe;AACJ"}
|
|
1
|
+
{"version":3,"file":"collections/index.js","sources":["webpack://@routier/core/./src/collections/Changes.ts","webpack://@routier/core/./src/collections/IdSet.ts","webpack://@routier/core/./src/collections/MemoryDataCollection.ts","webpack://@routier/core/./src/collections/ReadonlySchemaCollection.ts","webpack://@routier/core/./src/collections/SchemaCollection.ts","webpack://@routier/core/./src/collections/TagCollection.ts","webpack://@routier/core/./src/results/Result.ts","webpack://@routier/core/./src/schema/types.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/collections/index.ts"],"sourcesContent":["import { EntityUpdateInfo } from \"../plugins/types\";\nimport { InferCreateType, InferType, SchemaId } from \"../schema\";\nimport { TagCollection } from \"./TagCollection\";\nexport class BulkPersistResult extends Map<SchemaId, SchemaPersistResult> {\n\n resolve(schemaId: SchemaId): SchemaPersistResult {\n if (this.has(schemaId)) {\n return this.get(schemaId);\n }\n\n this.set(schemaId, new SchemaPersistResult());\n\n return this.get(schemaId);\n }\n\n override get<T extends {} = Record<string, unknown>>(schemaId: SchemaId) {\n return super.get(schemaId) as SchemaPersistResult<T>\n }\n\n get aggregate() {\n return {\n size: this.aggregateSize,\n adds: this.aggregateAddsSize,\n updates: this.aggregateUpdatesSize,\n removes: this.aggregateRemovesSize\n }\n }\n\n private get aggregateSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.total;\n }\n\n return count;\n }\n\n private get aggregateAddsSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.adds.length;\n }\n\n return count;\n }\n\n private get aggregateUpdatesSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.updates.length;\n }\n\n return count;\n }\n\n private get aggregateRemovesSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.removes.length;\n }\n\n return count;\n }\n}\n\nexport class BulkPersistChanges extends Map<SchemaId, SchemaPersistChanges> {\n\n resolve(schemaId: SchemaId): SchemaPersistChanges {\n if (this.has(schemaId)) {\n return this.get(schemaId);\n }\n\n this.set(schemaId, new SchemaPersistChanges());\n\n return this.get(schemaId);\n }\n\n override get<T extends {} = Record<string, unknown>>(schemaId: SchemaId) {\n return super.get(schemaId) as SchemaPersistChanges<T>\n }\n\n get aggregate() {\n return {\n size: this.aggregateSize,\n adds: this.aggregateAddsSize,\n updates: this.aggregateUpdatesSize,\n removes: this.aggregateRemovesSize\n }\n }\n\n private get aggregateSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.total;\n }\n\n return count;\n }\n\n private get aggregateAddsSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.adds.length;\n }\n\n return count;\n }\n\n private get aggregateUpdatesSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.updates.length;\n }\n\n return count;\n }\n\n private get aggregateRemovesSize() {\n let count = 0;\n\n for (const [, result] of this) {\n count += result.removes.length;\n }\n\n return count;\n }\n\n /**\n * Ensures the result has the same result sets as the change sets\n * @returns \n */\n toResult() {\n const result = new BulkPersistResult();\n\n for (const [schemaId] of this) {\n result.set(schemaId, new SchemaPersistResult());\n }\n\n return result;\n }\n}\n\nexport class SchemaPersistChanges<T extends {} = Record<string, unknown>> {\n adds: InferCreateType<T>[] = [];\n updates: EntityUpdateInfo<T>[] = [];\n removes: InferType<T>[] = [];\n tags: TagCollection = new TagCollection();\n\n get hasItems() {\n return this.total > 0;\n }\n\n get total() {\n return this.adds.length + this.updates.length + this.removes.length;\n }\n}\n\nexport class SchemaPersistResult<T extends {} = Record<string, unknown>> {\n adds: InferType<T>[] = [];\n updates: InferType<T>[] = [];\n removes: InferType<T>[] = [];\n\n get hasItems() {\n return this.total > 0;\n }\n\n get total() {\n return this.adds.length + this.updates.length + this.removes.length;\n }\n}","import { IdType } from \"../schema\";\n\nexport class IdSet {\n\n readonly ids: readonly IdType[];\n\n constructor(...ids: IdType[]) {\n this.ids = Object.freeze(ids);\n }\n\n equals(other: IdSet): boolean {\n\n if (this.ids.length === 1) {\n return this.ids[0] === other.ids[0];\n }\n\n return this.toString() === other.toString();\n }\n\n toString(): string {\n\n if (this.ids.length === 1) {\n return String(this.ids[0]);\n }\n\n return this.ids.toString();\n }\n}","import { CompiledSchema, IdType, InferType, PropertyInfo, SchemaTypes } from \"../schema\";\nimport { CallbackResult, Result } from \"../results\";\nimport { uuidv4 } from \"../utilities\";\nimport { IdSet } from \"./IdSet\";\n\nexport class MemoryDataCollection {\n\n protected readonly nextNumericalIds: Map<string, number>;\n protected readonly data: Map<string, Record<string, unknown>>;\n protected readonly schema: CompiledSchema<any>;\n protected readonly idProperties: PropertyInfo<any>[];\n\n get size() {\n return this.data.size;\n }\n\n get records() {\n return [...this.data.values()];\n }\n\n constructor(schema: CompiledSchema<any>) {\n this.data = new Map<string, Record<string, unknown>>();\n this.nextNumericalIds = new Map<string, number>();\n this.schema = schema;\n this.idProperties = schema.idProperties;\n }\n\n private _getNextId(property: PropertyInfo<any>) {\n\n let nextId = 1;\n\n if (this.nextNumericalIds.has(property.id) === true) {\n nextId = this.nextNumericalIds.get(property.id) + 1;\n }\n\n this.nextNumericalIds.set(property.id, nextId);\n\n return nextId;\n }\n\n private getAndSetId(item: Record<string, unknown>, property: PropertyInfo<any>): IdType {\n if (item[property.name] != null) {\n return item[property.name] as IdType;\n }\n\n if (property.type === SchemaTypes.String) {\n const uuid = uuidv4()\n item[property.name] = uuid;\n return uuid;\n }\n\n if (property.type === SchemaTypes.Number) {\n const id = this._getNextId(property);\n item[property.name] = id;\n return id;\n }\n\n throw new Error(`Id Property '${property.name}' must be string or number, found '${property.type}'`)\n }\n\n seed(items: Record<string, unknown>[]) {\n for (let i = 0, length = items.length; i < length; i++) {\n const id = this.resolveIdSet(items[i] as InferType<unknown>);\n this.data.set(id.toString(), items[i]);\n }\n }\n\n private resolveCurrentIdSet(item: Record<string, unknown>): IdSet {\n const idProperties = this.schema.idProperties;\n const ids: IdType[] = [];\n // ensure keys\n for (let j = 0, l = idProperties.length; j < l; j++) {\n const property = idProperties[j];\n const value = property.getValue(item);\n\n if (value == null) {\n throw new Error(`Key cannot be null. Key: ${property.name}`);\n }\n\n ids.push(value);\n }\n\n return new IdSet(...ids);\n }\n\n private resolveIdSet(item: Record<string, unknown>): IdSet {\n\n if (this.schema.hasIdentityKeys) {\n const ids: IdType[] = [];\n const idProperties = this.schema.idProperties;\n\n if (idProperties.length === 1) {\n ids.push(this.getAndSetId(item, idProperties[0]));\n } else {\n for (let j = 0, l = idProperties.length; j < l; j++) {\n ids.push(this.getAndSetId(item, idProperties[j]));\n }\n }\n\n return new IdSet(...ids);\n }\n\n return this.resolveCurrentIdSet(item);\n }\n\n add(item: Record<string, unknown>) {\n const id = this.resolveIdSet(item);\n this.data.set(id.toString(), item);\n }\n\n remove(item: Record<string, unknown>) {\n const id = this.resolveCurrentIdSet(item);\n this.data.delete(id.toString());\n }\n\n update(item: Record<string, unknown>) {\n const id = this.resolveCurrentIdSet(item);\n this.data.set(id.toString(), item);\n }\n\n destroy(done: CallbackResult<never>) {\n this.nextNumericalIds.clear();\n this.data.clear();\n done(Result.success());\n }\n\n load(done: CallbackResult<never>) {\n done(Result.success())\n }\n\n save(done: CallbackResult<never>) {\n done(Result.success())\n }\n}","import { CompiledSchema, SchemaId } from \"../schema\";\n\n/**\n * Collection of schemas with generic typing for type-safe schema retrieval\n */\nexport class ReadonlySchemaCollection {\n\n protected data: Map<SchemaId, CompiledSchema<Record<string, unknown>>>;\n\n constructor(data?: [SchemaId, CompiledSchema<Record<string, unknown>>][]) {\n this.data = new Map<SchemaId, CompiledSchema<Record<string, unknown>>>(data);\n }\n\n get<T>(schemaId: SchemaId): CompiledSchema<T> | undefined {\n return this.data.get(schemaId) as CompiledSchema<T> | undefined;\n }\n\n has(schemaId: SchemaId): boolean {\n return this.data.has(schemaId);\n }\n\n get size(): number {\n return this.data.size;\n }\n\n keys(): IterableIterator<SchemaId> {\n return this.data.keys();\n }\n\n values(): IterableIterator<CompiledSchema<Record<string, unknown>>> {\n return this.data.values();\n }\n\n entries(): IterableIterator<[SchemaId, CompiledSchema<Record<string, unknown>>]> {\n return this.data.entries();\n }\n\n forEach(callbackfn: (value: CompiledSchema<Record<string, unknown>>, key: SchemaId, map: Map<SchemaId, CompiledSchema<Record<string, unknown>>>) => void, thisArg?: any): void {\n this.data.forEach(callbackfn, thisArg);\n }\n\n [Symbol.iterator](): IterableIterator<[SchemaId, CompiledSchema<Record<string, unknown>>]> {\n return this.data[Symbol.iterator]();\n }\n\n getByName<T>(collectionName: string): CompiledSchema<T> | undefined {\n const found = [...this.data].find(x => x[1].collectionName === collectionName);\n\n if (found != null) {\n return found[1] as CompiledSchema<T>;\n }\n\n return undefined;\n }\n}","import { CompiledSchema, SchemaId } from \"../schema\";\nimport { ReadonlySchemaCollection } from \"./ReadonlySchemaCollection\";\n\n/**\n * Collection of schemas with generic typing for type-safe schema retrieval\n */\nexport class SchemaCollection extends ReadonlySchemaCollection {\n\n set<T>(schemaId: SchemaId, schema: CompiledSchema<T>): this {\n this.data.set(schemaId, schema as CompiledSchema<Record<string, unknown>>);\n return this;\n }\n\n delete(schemaId: SchemaId): boolean {\n return this.data.delete(schemaId);\n }\n\n clear(): void {\n this.data.clear();\n }\n}","export class TagCollection implements Disposable {\n\n private data: Map<Object, unknown> = new Map<Object, unknown>();\n private _size: number = 0;\n\n get size() {\n return this._size;\n }\n\n get(key: Object) {\n return this.data.get(key);\n }\n\n has(key: Object) {\n return this.data.has(key);\n }\n\n set(key: Object, tag: unknown) {\n this._size++;\n return this.data.set(key, tag);\n }\n\n delete(key: Object) {\n const result = this.data.delete(key);\n\n if (result) {\n this._size--;\n }\n\n return result;\n }\n\n setMany(keys: Object[], tag: unknown) {\n this._size += keys.length;\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n this.set(key, tag);\n }\n }\n\n combine(tags: TagCollection) {\n for (const [key, value] of tags) {\n this.data.set(key, value);\n }\n }\n\n values() {\n return this.data.values();\n }\n\n keys() {\n return this.data.keys();\n }\n\n [Symbol.dispose]() {\n this.data = null as any;\n }\n\n [Symbol.iterator]() {\n return this.data[Symbol.iterator]();\n }\n}","import { PartialResultType, PluginEventPartialResultType, PluginEventResultType, ResultType } from \"./types\";\n\nabstract class BaseResult {\n static ERROR = \"error\" as const;\n static SUCCESS = \"success\" as const;\n static PARTIAL = \"partial\" as const;\n\n static resolve<T>(result: ResultType<T> | PartialResultType<T>, resolve: (data: T) => void, reject: (error?: any) => void) {\n if (result.ok === BaseResult.SUCCESS) {\n resolve(result.data);\n return;\n }\n\n if (result.ok === BaseResult.PARTIAL) {\n reject({\n partial: result.data,\n error: result.error\n });\n return;\n }\n\n reject(result.error);\n }\n\n static assertSuccess<T>(result: any): asserts result is { ok: \"success\"; data: T } {\n if (result.ok !== BaseResult.SUCCESS) {\n throw new Error(`Expected success result, but got ${result.ok}: ${result.error}`);\n }\n }\n}\n\nexport class Result extends BaseResult {\n static success<T>(data: T): ResultType<T>;\n static success<T>(): ResultType<never>;\n static success<T>(data?: T): ResultType<T> {\n return {\n ok: Result.SUCCESS,\n data\n }\n }\n\n static error<T>(error: any): ResultType<T> {\n return {\n ok: Result.ERROR,\n error\n }\n }\n\n static partial<T>(data: T, error: any): PartialResultType<T> {\n return {\n ok: Result.PARTIAL,\n data,\n error\n }\n }\n}\n\nexport class PluginEventResult extends BaseResult {\n static success<T>(id: string, data: T): PluginEventResultType<T>;\n static success<T>(id: string): PluginEventResultType<never>;\n static success<T>(id: string, data?: T): PluginEventResultType<T> {\n return {\n id,\n ok: Result.SUCCESS,\n data\n }\n }\n\n static error<T>(id: string, error: any): PluginEventResultType<T> {\n return {\n id,\n ok: Result.ERROR,\n error\n }\n }\n\n static partial<T>(id: string, data: T, error: any): PluginEventPartialResultType<T> {\n return {\n id,\n ok: Result.PARTIAL,\n data,\n error\n }\n }\n\n static assertSuccess<T>(result: PluginEventResultType<T>): asserts result is { ok: \"success\"; data: T; id: string } {\n if (result.ok !== Result.SUCCESS) {\n throw new Error(`Expected success result, but got ${result.ok}: ${result.error}`);\n }\n }\n}\n","import { SchemaDefinition } from \"./SchemaDefinition\";\nimport { SchemaBase } from \"./property/base/SchemaBase\";\nimport { SchemaArray } from \"./property/types/SchemaArray\";\nimport { SchemaObject } from \"./property/types/SchemaObject\";\nimport { PropertyInfo } from \"./PropertyInfo\";\nimport { DeepPartial } from \"../types\";\nimport { SchemaFunction } from \"./table\";\nimport { SchemaString } from \"./property/types\";\nimport { SchemaOptional } from \"./property/modifiers\";\n\nexport type DefaultValue<T, I = never> = T | ((injected: I) => T);\nexport type FunctionBody<TEntity, TResult> = (entity: TEntity, collectionName: string) => TResult;\nexport type IdType = string | number;\n\nexport enum SchemaTypes {\n Array = \"Array\",\n Boolean = \"Boolean\",\n Date = \"Date\",\n Number = \"Number\",\n Object = \"Object\",\n String = \"String\",\n Definition = \"Definition\",\n Function = \"Function\",\n Computed = \"Computed\"\n}\n\nexport type ArrayShape = string | number | Date | {};\n\nexport type ExpandedProperty = ExpandedChildProperty & {\n assignmentPath: string;\n selectorPath: string;\n properties: Map<string, ExpandedChildProperty>;\n childDegree: number;\n};\n\nexport type ExpandedChildProperty = {\n propertyName: string;\n type: SchemaTypes;\n isNullableOrOptional: boolean;\n isReadonly: boolean;\n isIdentity: boolean;\n isUnmapped: boolean;\n}\n\nexport enum HashType {\n Ids = \"Ids\",\n Object = \"Object\"\n}\n\nexport type HashFunction<TEntity extends {}> = {\n (entity: InferCreateType<TEntity>, type: HashType.Object): string;\n (entity: InferType<TEntity>, type: HashType.Ids): string;\n}\n\nexport type GetHashTypeFunction<TEntity extends {}> = {\n (entity: InferCreateType<TEntity>): HashType.Object;\n (entity: InferType<TEntity>): HashType.Ids;\n}\n\nexport type ChangeTrackingType = \"proxy\" | \"diff\" | \"immutable\";\n\nexport type IndexType = \"single\" | \"compound\" | \"unique\" | \"primary-key\"\nexport type Index = {\n properties: PropertyInfo<any>[],\n type: IndexType;\n name: string;\n}\n\n/**\n * Represents changes to subscriptions, categorizing them by modifications to\n * entities (additions, updates, removals) or query-driven removals.\n * @template T - The type of the entities in the subscription.\n */\nexport type SubscriptionChanges<T extends {}> = {\n /**\n * Entities that have been added to the subscription.\n */\n adds: InferType<T>[];\n /**\n * Entities that have been updated within the subscription.\n */\n updates: InferType<T>[];\n /**\n * Entities that have been removed from the subscription.\n */\n removals: InferType<T>[];\n /**\n * Entities that have been added/updated/removed from the subscription and it is unknown \n * if the entities have been added/updated/removed.\n */\n unknown: InferType<T>[];\n}\n\nexport interface ISchemaSubscription<T extends {}> extends Disposable {\n send(changes: SubscriptionChanges<T>): void;\n onMessage(callback: (changes: SubscriptionChanges<T>) => void): void;\n}\n\ntype Enrich<TEntity extends {}> = {\n (entity: InferType<TEntity>, changeTrackingType: ChangeTrackingType): InferType<TEntity>;\n (entity: InferCreateType<TEntity>, changeTrackingType: ChangeTrackingType): InferCreateType<TEntity>;\n}\n\n/**\n * Represents a fully compiled schema with all utilities and metadata for an entity type.\n */\nexport type CompiledSchema<TEntity extends {}> = {\n\n deserializePartial: (item: Record<string, unknown>, properties: PropertyInfo<TEntity>[]) => DeepPartial<InferType<TEntity>>;\n\n createSubscription: (abortSignal?: AbortSignal) => ISchemaSubscription<TEntity>;\n /** Returns the property info for a given id (full path) */\n getProperty: (id: string) => PropertyInfo<TEntity>;\n /** Returns the ID of the given entity. */\n getId: (entity: InferType<TEntity>) => IdType;\n /** Returns a deep clone of the given entity. */\n clone: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** Removes unmapped or extraneous properties from the entity. */\n strip: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** Prepares a new entity for creation, applying defaults and transformations. */\n prepare: (entity: InferCreateType<TEntity>) => InferCreateType<TEntity>;\n /** Merges the source entity into the destination entity. */\n merge: (destination: InferType<TEntity> | InferCreateType<TEntity>, source: InferType<TEntity>) => InferType<TEntity>;\n /** Indicates if the schema has identity properties. */\n hasIdentities: boolean;\n /** List of properties that are identity keys. */\n idProperties: PropertyInfo<TEntity>[];\n /** All property metadata for the schema. */\n properties: PropertyInfo<TEntity>[],\n /** The hash type used for this schema. */\n hashType: HashType;\n /** Computes a hash for the given entity. */\n hash: HashFunction<TEntity>;\n /** Returns the hash type for the given entity. */\n getHashType: GetHashTypeFunction<TEntity>;\n /** Compares two entities for equality. */\n compare: (a: InferType<TEntity>, fromDb: InferType<TEntity>) => boolean;\n /** Deserializes an entity from storage format. */\n deserialize: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** Serializes an entity to storage format. */\n serialize: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** Unique id for the schema. */\n id: SchemaId,\n /** The name of the collection for this schema. */\n collectionName: string;\n /** Returns all IDs for the given entity (usually a single-element tuple). */\n getIds: (entity: InferType<TEntity>) => [IdType];\n /** Enriches the entity with change tracking or other metadata. */\n enrich: Enrich<TEntity>;\n /** Indicates if the schema has identity keys. */\n hasIdentityKeys: boolean;\n /** Returns a deeply frozen (immutable) version of the entity. */\n freeze: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** Enables change tracking on the entity. */\n enableChangeTracking: (entity: InferType<TEntity>) => InferType<TEntity>;\n /** The schema definition object. */\n definition: SchemaDefinition<TEntity>;\n /** Returns all indexes defined for this schema. */\n getIndexes: () => Index[];\n}\n\nexport type PropertySerializer<T extends any> = (value: T) => string | number;\nexport type PropertyDeserializer<T extends any> = (value: string | number) => T;\n\nexport type SchemaId = number\n\nexport type SchemaModifiers = \"default\" | \"deserialize\" |\n \"identity\" | \"key\" |\n \"nullable\" | \"optional\" |\n \"readonly\" | \"serialize\" |\n \"unmapped\" | \"computed\" |\n \"distinct\";\n\ntype InferPrimitive<T> =\n T extends SchemaOptional<infer C, infer __> ? C extends (string | number | Date) ? C : { [K in keyof C]: InferPrimitive<C[K]> } :\n T extends SchemaArray<infer Y, infer __> ? InferPrimitive<Y>[]\n : T extends SchemaObject<infer Obj, infer _> ?\n { [K in keyof Obj]: InferPrimitive<Obj[K]> } : // Process nested objects\n T extends SchemaFunction<infer F, infer __> ? F : T extends SchemaBase<infer X, infer _> ?\n X extends Array<infer A> ? InferPrimitive<A>[] : X : // Extract the primitive type\n never;\n\nexport type InferType<T> = T extends CompiledSchema<infer R> ? InferCompiledSchema<R> : T extends {} ? InferCompiledSchema<T> : T;\nexport type InferCreateType<T> = T extends CompiledSchema<infer R> ? InferCompiledCreateSchema<R> : T extends {} ? InferCompiledCreateSchema<T> : unknown;\nexport type InferMappedType<T> = T extends SchemaBase<infer K, infer __> ? InferType<K> : InferCompiledSchema<T>;\n\ntype HasModifier<T, K extends keyof T, M extends SchemaModifiers> =\n T[K] extends SchemaBase<any, infer Mods> ?\n M extends Mods ? true : false :\n false;\n\ntype IsPlainProperty<T, K extends keyof T> =\n [\n HasModifier<T, K, \"readonly\">,\n HasModifier<T, K, \"optional\">,\n HasModifier<T, K, \"nullable\">\n ] extends [\n false,\n false,\n false\n ] ? true : false;\n\ntype IsPlainCreateProperty<T, K extends keyof T> =\n [\n HasModifier<T, K, \"identity\">,\n HasModifier<T, K, \"default\">,\n HasModifier<T, K, \"computed\">,\n HasModifier<T, K, \"unmapped\">,\n HasModifier<T, K, \"optional\">,\n HasModifier<T, K, \"nullable\">\n ] extends [\n false,\n false,\n false,\n false,\n false,\n false\n ] ? true : false;\n\ntype InferCompiledSchema<T> = CoalesceEmpty<{\n [K in keyof T as IsPlainProperty<T, K> extends true ? K : never]: InferPrimitive<T[K]>\n}, {\n readonly [K in keyof T as HasModifier<T, K, \"readonly\"> extends true ? K : never]: InferPrimitive<T[K]>\n }, {\n [K in keyof T as HasModifier<T, K, \"optional\"> extends true ? K : never]?: InferPrimitive<T[K]>\n }, {\n [K in keyof T as HasModifier<T, K, \"nullable\"> extends true ? K : never]: null | InferPrimitive<T[K]>\n }>;\n\ntype InferCompiledCreateSchema<T> = CoalesceEmpty<{\n [K in keyof T as IsPlainCreateProperty<T, K> extends true ? K : never]: InferPrimitive<T[K]>\n}, {\n [K in keyof T as HasModifier<T, K, \"optional\"> extends true ? K : never]?: InferPrimitive<T[K]>\n }, {\n [K in keyof T as HasModifier<T, K, \"default\"> extends true ? K : never]?: InferPrimitive<T[K]>\n }, {\n [K in keyof T as HasModifier<T, K, \"nullable\"> extends true ? K : never]: null | InferPrimitive<T[K]>\n }>;\n\ntype IsEmptyObject<T> = keyof T extends never ? true : false;\ntype CoalesceEmpty<T1 extends {}, T2 extends {}, T3 extends {}, T4 extends {}> = (IsEmptyObject<T1> extends true ? {} : T1) & (IsEmptyObject<T2> extends true ? {} : T2) & (IsEmptyObject<T3> extends true ? {} : T3) & (IsEmptyObject<T4> extends true ? {} : T4);\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 './Changes';\nexport * from './TagCollection';\nexport * from './IdSet';\nexport * from './MemoryDataCollection';\nexport * from './SchemaCollection';\nexport * from './ReadonlySchemaCollection';"],"names":[],"mappings":";;;;;;;;;;;;;;AAEgD;AACzC,MAAM,iBAAkB,SAAQ,GAAkC;IAErE,OAAO,CAA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