@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.
- package/dist/assertions/index.d.ts +30 -0
- package/dist/assertions/index.js +88 -4
- package/dist/assertions/index.js.map +1 -1
- package/dist/capabilities/index.js +25 -16
- package/dist/capabilities/index.js.map +1 -1
- package/dist/codegen/blocks.test.d.ts +1 -0
- package/dist/codegen/handlers/SetHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/index.d.ts +1 -0
- package/dist/codegen/handlers/serialize/SerializeComputedHandler.d.ts +6 -0
- package/dist/codegen/handlers/set/SetComplexHandler.d.ts +6 -0
- package/dist/codegen/index.js +1 -0
- package/dist/codegen/index.js.map +1 -1
- package/dist/codegen/utils.test.d.ts +1 -0
- package/dist/collections/Changes.d.ts +2 -2
- package/dist/collections/IdSet.test.d.ts +1 -0
- package/dist/collections/TagCollection.contract.test.d.ts +1 -0
- package/dist/collections/TagCollection.d.ts +7 -7
- package/dist/collections/index.js +1 -1
- package/dist/collections/index.js.map +1 -1
- package/dist/expressions/constants.d.ts +2 -0
- package/dist/expressions/index.d.ts +2 -0
- package/dist/expressions/index.js +401 -34
- package/dist/expressions/index.js.map +1 -1
- package/dist/expressions/sql.d.ts +28 -0
- package/dist/expressions/sql.test.d.ts +1 -0
- package/dist/expressions/utils.d.ts +1 -2
- package/dist/index.js +1669 -610
- package/dist/index.js.map +1 -1
- package/dist/performance/index.js +18 -7
- package/dist/performance/index.js.map +1 -1
- package/dist/pipeline/index.js +18 -7
- package/dist/pipeline/index.js.map +1 -1
- package/dist/plugins/index.d.ts +0 -1
- package/dist/plugins/index.js +126 -694
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/query/Query.test.d.ts +1 -0
- package/dist/plugins/query/QueryOptionsCollection.d.ts +1 -0
- package/dist/plugins/translators/SqlTranslator.test.d.ts +1 -0
- package/dist/plugins/translators/TranslatedArrayValue.d.ts +3 -1
- package/dist/plugins/translators/TranslatedGroupValue.d.ts +3 -1
- package/dist/plugins/translators/TranslatedSingleValue.d.ts +3 -1
- package/dist/plugins/translators/TranslatedValues.test.d.ts +1 -0
- package/dist/plugins/translators/types.d.ts +8 -1
- package/dist/plugins/types.d.ts +6 -10
- package/dist/results/Result.d.ts +2 -2
- package/dist/results/Result.test.d.ts +1 -0
- package/dist/results/index.js.map +1 -1
- package/dist/results/utils.test.d.ts +1 -0
- package/dist/schema/PropertyInfo.d.ts +5 -1
- package/dist/schema/SchemaDefinition.d.ts +29 -1
- package/dist/schema/communication/broadcast.test.d.ts +1 -0
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.js +1151 -132
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/property/base/SchemaBase.d.ts +3 -1
- package/dist/schema/property/modifiers/SchemaDeserialize.d.ts +5 -1
- package/dist/schema/property/modifiers/SchemaForeignKey.d.ts +15 -0
- package/dist/schema/property/modifiers/SchemaKey.d.ts +2 -0
- package/dist/schema/property/modifiers/SchemaNullable.d.ts +5 -1
- package/dist/schema/property/modifiers/SchemaOptional.d.ts +3 -1
- package/dist/schema/property/modifiers/SchemaTag.d.ts +27 -0
- package/dist/schema/property/modifiers/SchemaTracked.d.ts +5 -1
- package/dist/schema/property/modifiers/index.d.ts +2 -0
- package/dist/schema/property/types/SchemaArray.d.ts +2 -0
- package/dist/schema/property/types/SchemaBoolean.d.ts +2 -0
- package/dist/schema/property/types/SchemaDate.d.ts +2 -0
- package/dist/schema/property/types/SchemaNumber.d.ts +5 -1
- package/dist/schema/property/types/SchemaObject.d.ts +2 -0
- package/dist/schema/property/types/SchemaString.d.ts +5 -1
- package/dist/schema/types.d.ts +37 -27
- package/dist/schema/utils/standardJsonSchema.d.ts +90 -0
- package/dist/schema/utils/standardJsonSchema.test.d.ts +1 -0
- package/dist/utilities/functions.d.ts +1 -1
- package/dist/utilities/index.js +153 -15
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/runtime.test.d.ts +1 -0
- package/dist/utilities/uuid.test.d.ts +1 -0
- package/package.json +2 -2
- package/readme.md +1 -1
- package/dist/plugins/replication/OptimisticReplicationDbPlugin.d.ts +0 -23
- package/dist/plugins/replication/ReplicationDbPlugin.d.ts +0 -22
- package/dist/plugins/replication/index.d.ts +0 -3
- package/dist/plugins/replication/types.d.ts +0 -5
- package/dist/schema/testSchemas.test.d.ts +0 -314
- /package/dist/{pipeline/WorkPipeline.test.d.ts → codegen/SlotPath.test.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen/index.js","sources":["webpack://@routier/core/./src/codegen/blocks.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/codegen/index.ts"],"sourcesContent":["import { uuid } from \"../utilities\";\nimport { CreateBlockOptions } from \"./types\";\n\ntype Line = string | Block;\n\ntype Param = { name: string, value: any };\ntype GenericParam = { name: string, callName: string };\n\n\nexport abstract class Block {\n readonly name: string;\n protected _lines: Line[] = [];\n protected _indent: string = \"\";\n protected _parent?: Block;\n\n constructor(name?: string, parentIndent: string = \"\", parent?: Block) {\n this.name = name != null ? name : uuid();\n this._indent = parentIndent;\n this._parent = parent;\n }\n\n indexOf(name: string) {\n return this._lines.findIndex(w => typeof w !== \"string\" && w.name === name);\n }\n\n getLines() {\n return this._lines;\n }\n\n getParent() {\n return this._parent;\n }\n\n getIndent() {\n return this._indent;\n }\n\n setLines(lines: Line[]) {\n this._lines = lines;\n }\n\n setParent(block: Block) {\n this._parent = block;\n }\n\n setIndent(indent: string) {\n this._indent = indent;\n }\n\n getOrDefault<T extends Block>(name: string): T | undefined {\n\n if (name.includes('.') === false) {\n return this._lines.find(w => typeof w !== \"string\" && w.name === name) as T | undefined;\n }\n\n const split = name.match(/(\\[[^\\]]+\\]|[^.]+)/g);\n let result: Block = this;\n\n for (const item of split) {\n const found = result._lines.find(w => typeof w !== \"string\" && w.name === item) as Block;\n\n if (found == null) {\n\n if (\"getValue\" in result && result.getValue instanceof Block && result.getValue.name === item) {\n result = result.getValue;\n continue;\n }\n\n return undefined;\n }\n\n result = found;\n }\n\n return result as T;\n }\n\n get<T extends Block>(name: string): T {\n const found = this.getOrDefault(name);\n\n if (found == null) {\n throw new Error(`Error finding code block for given path. Path: ${name}`)\n }\n\n return found as T;\n }\n\n has(name: string) {\n return this._lines.some(w => typeof w !== \"string\" && w.name === name);\n }\n\n remove(name: string) {\n this._lines = this._lines.filter(x => typeof x === \"object\" && typeof x.name === \"string\" && x.name !== name);\n }\n\n replace(name: string, line: Block) {\n\n const foundIndex = this._lines.findIndex(x => typeof x !== \"string\" && x.name === name);\n\n if (foundIndex === -1) {\n throw new Error(`Cannot find line by name. Name: ${name}`)\n }\n\n const found = this._lines[foundIndex];\n\n if (typeof found === \"string\") {\n // Replace the line\n this._lines.splice(foundIndex, 1, line);\n return;\n }\n\n line.setLines(found.getLines());\n line.setIndent(found.getIndent());\n line.setParent(found.getParent());\n\n // Replace the line\n this._lines.splice(foundIndex, 1, line);\n\n return;\n }\n\n protected push(line: Line) {\n this._lines.push(line);\n }\n\n protected unshift(line: Line) {\n this._lines.unshift(line);\n }\n\n protected indent(text: string): string {\n return this._indent + text;\n }\n\n\n abstract toString(): string;\n}\n\nexport abstract class ContainerBlock extends Block {\n if(condition: string, options?: CreateBlockOptions): IfBuilder {\n const builder = new IfBuilder(condition, options?.name, this._indent + \" \", this);\n if (options?.unshift === true) {\n this.unshift(builder);\n } else {\n this.push(builder);\n }\n\n return builder;\n }\n\n raw(raw: string, options?: CreateBlockOptions): RawBuilder {\n const builder = new RawBuilder(raw, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n function(name?: string, options?: CreateBlockOptions): FunctionBuilder {\n const builder = new FunctionBuilder(name, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n factory(name?: string, options?: CreateBlockOptions): FunctionFactoryBuilder {\n const builder = new FunctionFactoryBuilder(name, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n variable(declaration: string, options?: CreateBlockOptions): VariableBuilder {\n const builder = new VariableBuilder(declaration, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n assign(variableName: string, options?: CreateBlockOptions): AssignmentBuilder {\n const builder = new AssignmentBuilder(variableName, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n object(options?: CreateBlockOptions): ObjectBuilder {\n const builder = new ObjectBuilder(options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n slot(name: string) {\n const builder = new SlotBlock(name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n array(accessor: string, options?: CreateBlockOptions) {\n const builder = new ArrayBuilder(accessor, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n}\n\nexport type StringType = \"template\" | \"default\";\n\nexport class StringBuilder extends Block {\n\n private _type: StringType;\n\n constructor(type: StringType, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._type = type;\n }\n\n append(value: string) {\n this._lines.push(value);\n return this;\n }\n\n toString() {\n if (this._type === \"template\") {\n return \"`\" + this._lines.join(\"\") + \"`\";\n }\n\n return `\"${this._lines.join(\"\")}\"`;\n }\n}\n\nexport class SlotBlock extends ContainerBlock {\n\n constructor(name: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n }\n\n insert(line: string | Block) {\n this.push(line);\n }\n\n toString(): string {\n return this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(line)\n : line.toString()\n ).join('\\n\\n');\n }\n}\n\nexport class AssignmentBuilder extends ContainerBlock {\n protected _variableName: string;\n protected _value?: string | Block;\n protected _functionName?: string;\n\n get getValue() {\n return this._value;\n }\n\n constructor(variableName: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._variableName = variableName;\n }\n\n value(value: string): this {\n this._value = value;\n return this;\n }\n\n and(and: string, options?: CreateBlockOptions): this {\n this._value = new AndBuilder(and, options?.name, this._indent, this);\n return this;\n }\n\n object(options?: CreateBlockOptions): ObjectBuilder {\n const objectBuilder = new ObjectBuilder(options?.name, this._indent, this);\n\n this._value = objectBuilder;\n\n return objectBuilder;\n }\n\n call(functionName: string, options?: CreateBlockOptions): ObjectBuilder {\n this._functionName = functionName;\n const objectBuilder = new ObjectBuilder(options?.name, this._indent, this);\n\n this._value = objectBuilder;\n\n return objectBuilder;\n }\n\n string(type: StringType, options?: CreateBlockOptions) {\n const stringBuilder = new StringBuilder(type, options?.name, this._indent, this);\n\n this._value = stringBuilder;\n\n return stringBuilder;\n }\n\n toString(): string {\n\n if (this._value == null) {\n throw new Error(\"Value cannot be null for AssignmentBuilder Builder\")\n }\n\n if (this._functionName != null) {\n return this.indent(`${this._variableName} = ${this._functionName}(${this._value.toString()});`);\n }\n\n return this.indent(`${this._variableName} = ${this._value.toString()};`);\n }\n}\n\nexport class AndBuilder extends ContainerBlock {\n\n constructor(and: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._lines.push(and);\n }\n\n and(and: string) {\n this._lines.push(and);\n }\n\n toString() {\n return this._lines.join(\" && \")\n }\n}\n\nexport class VariableBuilder extends Block {\n protected _declaration: string;\n protected _value?: string | Block;\n\n get getValue() {\n return this._value;\n }\n\n constructor(declaration: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._declaration = declaration;\n }\n\n value(value: string): this {\n this._value = value;\n return this;\n }\n\n object(options?: CreateBlockOptions): ObjectBuilder {\n const objectBuilder = new ObjectBuilder(options?.name, this._indent, this);\n\n this._value = objectBuilder;\n\n return objectBuilder;\n }\n\n array(accessor: string, options?: CreateBlockOptions): ArrayBuilder {\n const arrayBuilder = new ArrayBuilder(accessor, options?.name, this._indent, this);\n\n this._value = arrayBuilder;\n\n return arrayBuilder;\n }\n\n toString(): string {\n\n if (this._value == null) {\n throw new Error(\"Value cannot be null for Variable Builder\")\n }\n\n return this.indent(`const ${this._declaration} = ${this._value.toString()};`);\n }\n}\n\nexport class RawBuilder extends ContainerBlock {\n private _raw: string;\n\n constructor(raw: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._raw = raw;\n }\n\n toString(): string {\n return `${this._raw}\\n`;\n }\n}\n\nexport class ObjectBuilder extends Block {\n\n property(line: string) {\n // Add comma to previous line if it exists and isn't a brace\n if (this._lines.length > 0) {\n const lastLine = this._lines[this._lines.length - 1];\n if (typeof lastLine === 'string' && !lastLine.endsWith(\"{\")) {\n this._lines[this._lines.length - 1] = lastLine + \",\";\n }\n }\n this.push(line);\n return this;\n }\n\n nested(propertyName: string, name?: string) {\n const builder = new ObjectBuilder(name, this._indent + \" \", this);\n // Add comma to previous line if it exists and isn't a brace\n if (this._lines.length > 0) {\n const lastLine = this._lines[this._lines.length - 1];\n if (typeof lastLine === 'string' && !lastLine.endsWith(\"{\")) {\n this._lines[this._lines.length - 1] = lastLine + \",\";\n }\n }\n // Add the property name and opening brace\n this.push(`${propertyName}: {`);\n // Add the nested builder\n this.push(builder);\n // Add the closing brace\n this.push(\"}\");\n return builder;\n }\n\n toString(): string {\n // Check if this is a nested object's content\n const isNestedContent = this._parent instanceof ObjectBuilder;\n\n if (isNestedContent) {\n // For nested object contents, just return the lines\n return this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(\" \" + line)\n : line.toString()\n ).join('\\n');\n }\n\n // For root objects, include the braces\n const lines = [\n \"{\",\n ...this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(\" \" + line)\n : line.toString()\n ),\n this.indent(\"}\")\n ];\n\n return lines.join('\\n');\n }\n}\n\nexport class FunctionFactoryBuilder extends ContainerBlock {\n private _functionName?: string;\n private _params: Param[] = [];\n private _return: boolean = false;\n\n constructor(functionName?: string, sectionName?: string, parentIndent: string = \"\", parent?: Block) {\n super(sectionName, parentIndent, parent);\n this._functionName = functionName;\n }\n\n getParameters() {\n return [...this._params];\n }\n\n createParameter(value: any): Param {\n const name = `injection${this._params.length}`;\n return {\n name,\n value\n }\n }\n\n parameters(...params: Param[]): this {\n this._params.push(...params);\n return this;\n }\n\n return() {\n this._return = true;\n return this;\n }\n\n appendBody(line: string): this {\n this.push(line);\n return this;\n }\n\n invoke() {\n const body = this.toString();\n const parameterNames = this._getParameterNames();\n const parameterValues = this._getParameterValues();\n\n return Function(...parameterNames, body)(...parameterValues)\n }\n\n private _getParameterNames() {\n return this._params.map(w => w.name).join(\", \")\n }\n\n private _getParameterValues() {\n return this._params.map(w => w.value);\n }\n\n toString(): string {\n const r = this._return === true ? \"return \" : \"\";\n const signature = this._functionName\n ? `${r}function ${this._functionName}(${this._getParameterNames()})`\n : `${r}function(${this._getParameterNames()})`;\n\n const lines = [\n this.indent(signature + \" {\"),\n ...this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(\" \" + line)\n : line.toString()\n ),\n this.indent(\"}\")\n ];\n\n return lines.join('\\n');\n }\n}\n\nexport class FunctionBuilder extends ContainerBlock {\n private _functionName?: string;\n private _params: (string | GenericParam)[] = [];\n private _return: boolean = false;\n\n constructor(functionName?: string, sectionName?: string, parentIndent: string = \"\", parent?: Block) {\n super(sectionName, parentIndent, parent);\n this._functionName = functionName;\n }\n\n parameters(...params: (string | GenericParam)[]): this {\n this._params.push(...params);\n return this;\n }\n\n return() {\n this._return = true;\n return this;\n }\n\n appendBody(line: string): this {\n this.push(line);\n return this;\n }\n\n private _getParameterKeys() {\n return this._params.map(w => typeof w === \"object\" ? w.name : w).join(\", \")\n }\n\n toCallable() {\n return `${this._functionName}(${this._params.map(w => typeof w === \"object\" ? w.callName : w).join(\", \")})`\n }\n\n toString(): string {\n const r = this._return === true ? \"return \" : \"\";\n const signature = this._functionName\n ? `${r}function ${this._functionName}(${this._getParameterKeys()})`\n : `${r}function(${this._getParameterKeys()})`;\n\n const lines = [\n this.indent(signature + \" {\"),\n ...this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(\" \" + line)\n : line.toString()\n ),\n this.indent(\"}\")\n ];\n\n return lines.join('\\n');\n }\n}\n\nexport class ArrayBuilder extends Block {\n constructor(accessor: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._lines.push(accessor);\n }\n\n append(accessor: string) {\n this._lines.push(accessor);\n return this;\n }\n\n toString() {\n return `[${this._lines.join(\",\")}]`\n }\n}\n\nexport class IfBuilder extends ContainerBlock {\n private _condition: string;\n\n constructor(condition: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._condition = condition;\n }\n\n appendBody(line: string): this {\n this.push(line);\n return this;\n }\n\n unshiftBody(line: string): this {\n this.unshift(line);\n return this;\n }\n\n private stringifyLine(line: Line) {\n if (typeof line === 'string') {\n return this.indent(\" \" + line);\n }\n\n if (Array.isArray(line)) {\n return line.join(\"\\r\\n\")\n }\n\n return line.toString();\n }\n\n toString(): string {\n // need to join with \\r\\n because we are not an object\n const lines = [\n this.indent(`if (${this._condition}) {`),\n this._lines.map(x => this.stringifyLine(x)).join(\"\\r\\n\"),\n this.indent(\"}\")\n ]\n\n return lines.join(\"\\n\\n\");\n }\n}\n\nexport class CodeBuilder extends ContainerBlock {\n\n toString(): string {\n return this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(line)\n : line.toString()\n ).join('\\n\\n');\n }\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 './blocks';\nexport * from './types';"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAoC;AAS7B,MAAe,KAAK;IACd,IAAI,CAAS;IACZ,MAAM,GAAW,EAAE,CAAC;IACpB,OAAO,GAAW,EAAE,CAAC;IACrB,OAAO,CAAS;IAE1B,YAAY,IAAa,EAAE,eAAuB,EAAE,EAAE,MAAc;QAChE,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oCAAI,EAAE,CAAC;QACzC,I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C;QAC3B,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YACZ,IAAI,IAAI,GAAG,CAAC;YACZ,SAAS;QACb,CAAC;QAED,IAAI,CAAS,CAAC;QACd,IAAI,SAAS,IAAI,WAAW,EAAE,CAAC;YAC3B,2CAA2C;YAC3C,CAAC;gBACG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;oBACR,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC;oBAC7B,CAAC,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACJ,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,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,E;;;;ACNA,wF;;;;ACAA;AACA;AACA;AACA,uDAAuD,iBAAiB;AACxE;AACA,gDAAgD,aAAa;AAC7D,E;;;;;;;;;;;;;;;;;;;;;;;ACNyB;AACD"}
|
|
1
|
+
{"version":3,"file":"codegen/index.js","sources":["webpack://@routier/core/./src/codegen/blocks.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/codegen/index.ts"],"sourcesContent":["import { uuid } from \"../utilities\";\nimport { CreateBlockOptions } from \"./types\";\n\ntype Line = string | Block;\n\ntype Param = { name: string, value: any };\ntype GenericParam = { name: string, callName: string };\n\n\nexport abstract class Block {\n readonly name: string;\n protected _lines: Line[] = [];\n protected _indent: string = \"\";\n protected _parent?: Block;\n\n constructor(name?: string, parentIndent: string = \"\", parent?: Block) {\n this.name = name != null ? name : uuid();\n this._indent = parentIndent;\n this._parent = parent;\n }\n\n indexOf(name: string) {\n return this._lines.findIndex(w => typeof w !== \"string\" && w.name === name);\n }\n\n getLines() {\n return this._lines;\n }\n\n getParent() {\n return this._parent;\n }\n\n getIndent() {\n return this._indent;\n }\n\n setLines(lines: Line[]) {\n this._lines = lines;\n }\n\n setParent(block: Block) {\n this._parent = block;\n }\n\n setIndent(indent: string) {\n this._indent = indent;\n }\n\n getOrDefault<T extends Block>(name: string): T | undefined {\n\n if (name.includes('.') === false) {\n return this._lines.find(w => typeof w !== \"string\" && w.name === name) as T | undefined;\n }\n\n const split = name.match(/(\\[[^\\]]+\\]|[^.]+)/g);\n // oxlint-disable-next-line no-this-alias\n let result: Block = this;\n\n for (const item of split) {\n const found = result._lines.find(w => typeof w !== \"string\" && w.name === item) as Block;\n\n if (found == null) {\n\n if (\"getValue\" in result && result.getValue instanceof Block && result.getValue.name === item) {\n result = result.getValue;\n continue;\n }\n\n return undefined;\n }\n\n result = found;\n }\n\n return result as T;\n }\n\n get<T extends Block>(name: string): T {\n const found = this.getOrDefault(name);\n\n if (found == null) {\n throw new Error(`Error finding code block for given path. Path: ${name}`)\n }\n\n return found as T;\n }\n\n has(name: string) {\n return this._lines.some(w => typeof w !== \"string\" && w.name === name);\n }\n\n remove(name: string) {\n this._lines = this._lines.filter(x => typeof x === \"object\" && typeof x.name === \"string\" && x.name !== name);\n }\n\n replace(name: string, line: Block) {\n\n const foundIndex = this._lines.findIndex(x => typeof x !== \"string\" && x.name === name);\n\n if (foundIndex === -1) {\n throw new Error(`Cannot find line by name. Name: ${name}`)\n }\n\n const found = this._lines[foundIndex];\n\n if (typeof found === \"string\") {\n // Replace the line\n this._lines.splice(foundIndex, 1, line);\n return;\n }\n\n line.setLines(found.getLines());\n line.setIndent(found.getIndent());\n line.setParent(found.getParent());\n\n // Replace the line\n this._lines.splice(foundIndex, 1, line);\n\n return;\n }\n\n protected push(line: Line) {\n this._lines.push(line);\n }\n\n protected unshift(line: Line) {\n this._lines.unshift(line);\n }\n\n protected indent(text: string): string {\n return this._indent + text;\n }\n\n\n abstract toString(): string;\n}\n\nexport abstract class ContainerBlock extends Block {\n if(condition: string, options?: CreateBlockOptions): IfBuilder {\n const builder = new IfBuilder(condition, options?.name, this._indent + \" \", this);\n if (options?.unshift === true) {\n this.unshift(builder);\n } else {\n this.push(builder);\n }\n\n return builder;\n }\n\n raw(raw: string, options?: CreateBlockOptions): RawBuilder {\n const builder = new RawBuilder(raw, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n function(name?: string, options?: CreateBlockOptions): FunctionBuilder {\n const builder = new FunctionBuilder(name, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n factory(name?: string, options?: CreateBlockOptions): FunctionFactoryBuilder {\n const builder = new FunctionFactoryBuilder(name, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n variable(declaration: string, options?: CreateBlockOptions): VariableBuilder {\n const builder = new VariableBuilder(declaration, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n assign(variableName: string, options?: CreateBlockOptions): AssignmentBuilder {\n const builder = new AssignmentBuilder(variableName, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n object(options?: CreateBlockOptions): ObjectBuilder {\n const builder = new ObjectBuilder(options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n slot(name: string) {\n const builder = new SlotBlock(name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n\n array(accessor: string, options?: CreateBlockOptions) {\n const builder = new ArrayBuilder(accessor, options?.name, this._indent + \" \", this);\n this.push(builder);\n return builder;\n }\n}\n\nexport type StringType = \"template\" | \"default\";\n\nexport class StringBuilder extends Block {\n\n private _type: StringType;\n\n constructor(type: StringType, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._type = type;\n }\n\n append(value: string) {\n this._lines.push(value);\n return this;\n }\n\n toString() {\n if (this._type === \"template\") {\n return \"`\" + this._lines.join(\"\") + \"`\";\n }\n\n return `\"${this._lines.join(\"\")}\"`;\n }\n}\n\nexport class SlotBlock extends ContainerBlock {\n\n constructor(name: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n }\n\n insert(line: string | Block) {\n this.push(line);\n }\n\n toString(): string {\n return this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(line)\n : line.toString()\n ).join('\\n\\n');\n }\n}\n\nexport class AssignmentBuilder extends ContainerBlock {\n protected _variableName: string;\n protected _value?: string | Block;\n protected _functionName?: string;\n\n get getValue() {\n return this._value;\n }\n\n constructor(variableName: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._variableName = variableName;\n }\n\n value(value: string): this {\n this._value = value;\n return this;\n }\n\n and(and: string, options?: CreateBlockOptions): this {\n this._value = new AndBuilder(and, options?.name, this._indent, this);\n return this;\n }\n\n object(options?: CreateBlockOptions): ObjectBuilder {\n const objectBuilder = new ObjectBuilder(options?.name, this._indent, this);\n\n this._value = objectBuilder;\n\n return objectBuilder;\n }\n\n call(functionName: string, options?: CreateBlockOptions): ObjectBuilder {\n this._functionName = functionName;\n const objectBuilder = new ObjectBuilder(options?.name, this._indent, this);\n\n this._value = objectBuilder;\n\n return objectBuilder;\n }\n\n string(type: StringType, options?: CreateBlockOptions) {\n const stringBuilder = new StringBuilder(type, options?.name, this._indent, this);\n\n this._value = stringBuilder;\n\n return stringBuilder;\n }\n\n toString(): string {\n\n if (this._value == null) {\n throw new Error(\"Value cannot be null for AssignmentBuilder Builder\")\n }\n\n if (this._functionName != null) {\n return this.indent(`${this._variableName} = ${this._functionName}(${this._value.toString()});`);\n }\n\n return this.indent(`${this._variableName} = ${this._value.toString()};`);\n }\n}\n\nexport class AndBuilder extends ContainerBlock {\n\n constructor(and: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._lines.push(and);\n }\n\n and(and: string) {\n this._lines.push(and);\n }\n\n toString() {\n return this._lines.join(\" && \")\n }\n}\n\nexport class VariableBuilder extends Block {\n protected _declaration: string;\n protected _value?: string | Block;\n\n get getValue() {\n return this._value;\n }\n\n constructor(declaration: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._declaration = declaration;\n }\n\n value(value: string): this {\n this._value = value;\n return this;\n }\n\n object(options?: CreateBlockOptions): ObjectBuilder {\n const objectBuilder = new ObjectBuilder(options?.name, this._indent, this);\n\n this._value = objectBuilder;\n\n return objectBuilder;\n }\n\n array(accessor: string, options?: CreateBlockOptions): ArrayBuilder {\n const arrayBuilder = new ArrayBuilder(accessor, options?.name, this._indent, this);\n\n this._value = arrayBuilder;\n\n return arrayBuilder;\n }\n\n toString(): string {\n\n if (this._value == null) {\n throw new Error(\"Value cannot be null for Variable Builder\")\n }\n\n return this.indent(`const ${this._declaration} = ${this._value.toString()};`);\n }\n}\n\nexport class RawBuilder extends ContainerBlock {\n private _raw: string;\n\n constructor(raw: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._raw = raw;\n }\n\n toString(): string {\n return `${this._raw}\\n`;\n }\n}\n\nexport class ObjectBuilder extends Block {\n\n property(line: string) {\n // Add comma to previous line if it exists and isn't a brace\n if (this._lines.length > 0) {\n const lastLine = this._lines[this._lines.length - 1];\n if (typeof lastLine === 'string' && !lastLine.endsWith(\"{\")) {\n this._lines[this._lines.length - 1] = lastLine + \",\";\n }\n }\n this.push(line);\n return this;\n }\n\n nested(propertyName: string, name?: string) {\n const builder = new ObjectBuilder(name, this._indent + \" \", this);\n // Add comma to previous line if it exists and isn't a brace\n if (this._lines.length > 0) {\n const lastLine = this._lines[this._lines.length - 1];\n if (typeof lastLine === 'string' && !lastLine.endsWith(\"{\")) {\n this._lines[this._lines.length - 1] = lastLine + \",\";\n }\n }\n // Add the property name and opening brace\n this.push(`${propertyName}: {`);\n // Add the nested builder\n this.push(builder);\n // Add the closing brace\n this.push(\"}\");\n return builder;\n }\n\n toString(): string {\n // Check if this is a nested object's content\n const isNestedContent = this._parent instanceof ObjectBuilder;\n\n if (isNestedContent) {\n // For nested object contents, just return the lines\n return this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(\" \" + line)\n : line.toString()\n ).join('\\n');\n }\n\n // For root objects, include the braces\n const lines = [\n \"{\",\n ...this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(\" \" + line)\n : line.toString()\n ),\n this.indent(\"}\")\n ];\n\n return lines.join('\\n');\n }\n}\n\nexport class FunctionFactoryBuilder extends ContainerBlock {\n private _functionName?: string;\n private _params: Param[] = [];\n private _return: boolean = false;\n\n constructor(functionName?: string, sectionName?: string, parentIndent: string = \"\", parent?: Block) {\n super(sectionName, parentIndent, parent);\n this._functionName = functionName;\n }\n\n getParameters() {\n return [...this._params];\n }\n\n createParameter(value: any): Param {\n const name = `injection${this._params.length}`;\n return {\n name,\n value\n }\n }\n\n parameters(...params: Param[]): this {\n this._params.push(...params);\n return this;\n }\n\n return() {\n this._return = true;\n return this;\n }\n\n appendBody(line: string): this {\n this.push(line);\n return this;\n }\n\n invoke() {\n const body = this.toString();\n const parameterNames = this._getParameterNames();\n const parameterValues = this._getParameterValues();\n\n return Function(...parameterNames, body)(...parameterValues)\n }\n\n private _getParameterNames() {\n return this._params.map(w => w.name).join(\", \")\n }\n\n private _getParameterValues() {\n return this._params.map(w => w.value);\n }\n\n toString(): string {\n const r = this._return === true ? \"return \" : \"\";\n const signature = this._functionName\n ? `${r}function ${this._functionName}(${this._getParameterNames()})`\n : `${r}function(${this._getParameterNames()})`;\n\n const lines = [\n this.indent(signature + \" {\"),\n ...this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(\" \" + line)\n : line.toString()\n ),\n this.indent(\"}\")\n ];\n\n return lines.join('\\n');\n }\n}\n\nexport class FunctionBuilder extends ContainerBlock {\n private _functionName?: string;\n private _params: (string | GenericParam)[] = [];\n private _return: boolean = false;\n\n constructor(functionName?: string, sectionName?: string, parentIndent: string = \"\", parent?: Block) {\n super(sectionName, parentIndent, parent);\n this._functionName = functionName;\n }\n\n parameters(...params: (string | GenericParam)[]): this {\n this._params.push(...params);\n return this;\n }\n\n return() {\n this._return = true;\n return this;\n }\n\n appendBody(line: string): this {\n this.push(line);\n return this;\n }\n\n private _getParameterKeys() {\n return this._params.map(w => typeof w === \"object\" ? w.name : w).join(\", \")\n }\n\n toCallable() {\n return `${this._functionName}(${this._params.map(w => typeof w === \"object\" ? w.callName : w).join(\", \")})`\n }\n\n toString(): string {\n const r = this._return === true ? \"return \" : \"\";\n const signature = this._functionName\n ? `${r}function ${this._functionName}(${this._getParameterKeys()})`\n : `${r}function(${this._getParameterKeys()})`;\n\n const lines = [\n this.indent(signature + \" {\"),\n ...this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(\" \" + line)\n : line.toString()\n ),\n this.indent(\"}\")\n ];\n\n return lines.join('\\n');\n }\n}\n\nexport class ArrayBuilder extends Block {\n constructor(accessor: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._lines.push(accessor);\n }\n\n append(accessor: string) {\n this._lines.push(accessor);\n return this;\n }\n\n toString() {\n return `[${this._lines.join(\",\")}]`\n }\n}\n\nexport class IfBuilder extends ContainerBlock {\n private _condition: string;\n\n constructor(condition: string, name?: string, parentIndent: string = \"\", parent?: Block) {\n super(name, parentIndent, parent);\n this._condition = condition;\n }\n\n appendBody(line: string): this {\n this.push(line);\n return this;\n }\n\n unshiftBody(line: string): this {\n this.unshift(line);\n return this;\n }\n\n private stringifyLine(line: Line) {\n if (typeof line === 'string') {\n return this.indent(\" \" + line);\n }\n\n if (Array.isArray(line)) {\n return line.join(\"\\r\\n\")\n }\n\n return line.toString();\n }\n\n toString(): string {\n // need to join with \\r\\n because we are not an object\n const lines = [\n this.indent(`if (${this._condition}) {`),\n this._lines.map(x => this.stringifyLine(x)).join(\"\\r\\n\"),\n this.indent(\"}\")\n ]\n\n return lines.join(\"\\n\\n\");\n }\n}\n\nexport class CodeBuilder extends ContainerBlock {\n\n toString(): string {\n return this._lines.map(line =>\n typeof line === 'string'\n ? this.indent(line)\n : line.toString()\n ).join('\\n\\n');\n }\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 './blocks';\nexport * from './types';"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAoC;AAS7B,MAAe,KAAK;IACd,IAAI,CAAS;IACZ,MAAM,GAAW,EAAE,CAAC;IACpB,OAAO,GAAW,EAAE,CAAC;IACrB,OAAO,CAAS;IAE1B,YAAY,IAAa,EAAE,eAAuB,EAAE,EAAE,MAAc;QAChE,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oCAAI,EAAE,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,OAAO,CAAC,IAAY;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAChF,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,SAAS;QACL,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,SAAS;QACL,OAAO,IAAI,CAAC,OAAO,C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,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,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,E;;;;ACNA,wF;;;;ACAA;AACA;AACA;AACA,uDAAuD,iBAAiB;AACxE;AACA,gDAAgD,aAAa;AAC7D,E;;;;;;;;;;;;;;;;;;;;;;;ACNyB;AACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { EntityUpdateInfo } from "../plugins/types";
|
|
|
2
2
|
import { InferCreateType, InferType, SchemaId } from "../schema";
|
|
3
3
|
import { TagCollection } from "./TagCollection";
|
|
4
4
|
export declare class BulkPersistResult extends Map<SchemaId, SchemaPersistResult> {
|
|
5
|
-
resolve(schemaId: SchemaId): SchemaPersistResult
|
|
5
|
+
resolve<T extends {} = Record<string, unknown>>(schemaId: SchemaId): SchemaPersistResult<T>;
|
|
6
6
|
get<T extends {} = Record<string, unknown>>(schemaId: SchemaId): SchemaPersistResult<T>;
|
|
7
7
|
get aggregate(): {
|
|
8
8
|
size: number;
|
|
@@ -16,7 +16,7 @@ export declare class BulkPersistResult extends Map<SchemaId, SchemaPersistResult
|
|
|
16
16
|
private get aggregateRemovesSize();
|
|
17
17
|
}
|
|
18
18
|
export declare class BulkPersistChanges extends Map<SchemaId, SchemaPersistChanges> {
|
|
19
|
-
resolve(schemaId: SchemaId): SchemaPersistChanges
|
|
19
|
+
resolve<T extends {} = Record<string, unknown>>(schemaId: SchemaId): SchemaPersistChanges<T>;
|
|
20
20
|
get<T extends {} = Record<string, unknown>>(schemaId: SchemaId): SchemaPersistChanges<T>;
|
|
21
21
|
get aggregate(): {
|
|
22
22
|
size: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,14 +2,14 @@ export declare class TagCollection implements Disposable {
|
|
|
2
2
|
private data;
|
|
3
3
|
private _size;
|
|
4
4
|
get size(): number;
|
|
5
|
-
get(key:
|
|
6
|
-
has(key:
|
|
7
|
-
set(key:
|
|
8
|
-
delete(key:
|
|
9
|
-
setMany(keys:
|
|
5
|
+
get(key: object): unknown;
|
|
6
|
+
has(key: object): boolean;
|
|
7
|
+
set(key: object, tag: unknown): Map<object, unknown>;
|
|
8
|
+
delete(key: object): boolean;
|
|
9
|
+
setMany(keys: object[], tag: unknown): void;
|
|
10
10
|
combine(tags: TagCollection): void;
|
|
11
11
|
values(): MapIterator<unknown>;
|
|
12
|
-
keys(): MapIterator<
|
|
12
|
+
keys(): MapIterator<object>;
|
|
13
13
|
[Symbol.dispose](): void;
|
|
14
|
-
[Symbol.iterator](): MapIterator<[
|
|
14
|
+
[Symbol.iterator](): MapIterator<[object, unknown]>;
|
|
15
15
|
}
|
|
@@ -255,7 +255,7 @@ class MemoryDataCollection {
|
|
|
255
255
|
resolveIdSet(item) {
|
|
256
256
|
if (this.schema.hasIdentityKeys) {
|
|
257
257
|
const idProperties = this.schema.idProperties;
|
|
258
|
-
const ids =
|
|
258
|
+
const ids = Array.from({ length: idProperties.length });
|
|
259
259
|
// Need to make sure we allow for seeding the collection when we call add vs seed
|
|
260
260
|
// There will be an existing id, but the id type could still be identity
|
|
261
261
|
if (idProperties.length === 1) {
|
|
@@ -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/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 resolveId(property: PropertyInfo<any>, value: unknown) {\n if (typeof value !== \"number\") {\n return;\n }\n\n const currentIdForProperty = this.nextNumericalIds.get(property.id);\n\n if (value <= currentIdForProperty) {\n return;\n }\n\n this.nextNumericalIds.set(property.id, value);\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 idProperties = this.schema.idProperties;\n const ids: IdType[] = new Array<IdType>(idProperties.length);\n\n // Need to make sure we allow for seeding the collection when we call add vs seed\n // There will be an existing id, but the id type could still be identity\n if (idProperties.length === 1) {\n const value = this.getAndSetId(item, idProperties[0]);\n this.resolveId(idProperties[0], value);\n ids[0] = value;\n } else {\n for (let j = 0, l = idProperties.length; j < l; j++) {\n const value = this.getAndSetId(item, idProperties[j]);\n this.resolveId(idProperties[j], value);\n ids[j] = value;\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.clear();\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 { SchemaOptional } from \"./property/modifiers\";\nimport { Branded } from \"../utilities/types\";\n\nexport type DefaultValue<T, I = never> = T | ((injected: I) => T);\nexport type FunctionBody<TEntity, TResult> = (entity: TEntity, collectionName: CollectionName) => 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}\nexport type Prepare<TEntity extends {}> = {\n (entity: InferCreateType<TEntity>): InferCreateType<TEntity>;\n (entity: InferType<TEntity>): InferType<TEntity>;\n}\nexport type Preprocess<TEntity extends {}> = {\n (entity: InferCreateType<TEntity>): InferType<TEntity>;\n (entity: InferType<TEntity>): InferType<TEntity>;\n}\n\nexport type CompiledSchemaCore<TEntity extends {}> = Omit<CompiledSchema<TEntity>, \"createSubscription\">;\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: Prepare<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\n /** Combines serializing and preparing an entity for saving. */\n preprocess: Preprocess<TEntity>;\n /** Combines deserializing and enriching an entity for selection. */\n postprocess: Enrich<TEntity>;\n\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: CollectionName;\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 /** Compares two entities for Id equality. */\n compareIds: (a: InferType<TEntity>, b: InferType<TEntity>) => boolean;\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 = Branded<number, \"SchemaId\">;\nexport type CollectionName = Branded<string, \"CollectionName\">;\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 './M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ChB,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;;;;;;;;;;;;;;;;;;;;;;;ACN0B;AACM;AACR;AACe;AACJ;AACQ"}
|
|
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<T extends {} = Record<string, unknown>>(schemaId: SchemaId): SchemaPersistResult<T> {\n if (this.has(schemaId)) {\n return this.get(schemaId);\n }\n\n this.set(schemaId, new SchemaPersistResult<T>());\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<T extends {} = Record<string, unknown>>(schemaId: SchemaId): SchemaPersistChanges<T> {\n if (this.has(schemaId)) {\n return this.get(schemaId);\n }\n\n this.set(schemaId, new SchemaPersistChanges<T>());\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 resolveId(property: PropertyInfo<any>, value: unknown) {\n if (typeof value !== \"number\") {\n return;\n }\n\n const currentIdForProperty = this.nextNumericalIds.get(property.id);\n\n if (value <= currentIdForProperty) {\n return;\n }\n\n this.nextNumericalIds.set(property.id, value);\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 idProperties = this.schema.idProperties;\n const ids: IdType[] = Array.from({ length: idProperties.length });\n\n // Need to make sure we allow for seeding the collection when we call add vs seed\n // There will be an existing id, but the id type could still be identity\n if (idProperties.length === 1) {\n const value = this.getAndSetId(item, idProperties[0]);\n this.resolveId(idProperties[0], value);\n ids[0] = value;\n } else {\n for (let j = 0, l = idProperties.length; j < l; j++) {\n const value = this.getAndSetId(item, idProperties[j]);\n this.resolveId(idProperties[j], value);\n ids[j] = value;\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.clear();\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(): 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(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 type { SchemaDefinition } from \"./SchemaDefinition\";\nimport type { SchemaBase } from \"./property/base/SchemaBase\";\nimport type { SchemaArray } from \"./property/types/SchemaArray\";\nimport type { SchemaObject } from \"./property/types/SchemaObject\";\nimport type { PropertyInfo } from \"./PropertyInfo\";\nimport type { DeepPartial } from \"../types\";\nimport type { SchemaFunction } from \"./table\";\nimport type { SchemaOptional } from \"./property/modifiers\";\nimport type { Branded } from \"../utilities/types\";\n\nexport type DefaultValue<T, I = never> = T | ((injected: I) => T);\nexport type FunctionBody<TEntity, TResult> = (entity: TEntity, collectionName: CollectionName) => TResult;\nexport type IdType = string | number;\nexport type ForeignKey<T extends {}> = { \n schema: CompiledSchema<T>, \n property: PropertyInfo<T> \n};\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\nexport type Enrich<TEntity extends {}> = {\n (entity: InferType<TEntity>, changeTrackingType: ChangeTrackingType): InferType<TEntity>;\n (entity: InferCreateType<TEntity>, changeTrackingType: ChangeTrackingType): InferCreateType<TEntity>;\n}\nexport type Prepare<TEntity extends {}> = {\n (entity: InferCreateType<TEntity>): InferCreateType<TEntity>;\n (entity: InferType<TEntity>): InferType<TEntity>;\n}\nexport type Preprocess<TEntity extends {}> = {\n (entity: InferCreateType<TEntity>): InferType<TEntity>;\n (entity: InferType<TEntity>): InferType<TEntity>;\n}\n\nexport type SetProperties<TEntity extends {}> = (destination: InferType<TEntity> | InferCreateType<TEntity>, source: InferType<TEntity> | InferCreateType<TEntity>) => void;\n\nexport type CompiledSchemaCore<TEntity extends {}> = Omit<CompiledSchema<TEntity>, \"createSubscription\">;\n\nexport type CompiledSchemaWithMetadata<TEntity extends {}, TMetadata> = {\n readonly metadata: TMetadata;\n} & CompiledSchema<TEntity>;\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: Prepare<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 /** Sets 1 or many properties from the source object onto the destination object with change tracking. */\n set: SetProperties<TEntity>;\n /** Combines serializing and preparing an entity for saving. */\n preprocess: Preprocess<TEntity>;\n /** Combines deserializing and enriching an entity for selection. */\n postprocess: Enrich<TEntity>;\n\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: CollectionName;\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 /** Compares two entities for Id equality. */\n compareIds: (a: InferType<TEntity>, b: InferType<TEntity>) => boolean;\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 = Branded<number, \"SchemaId\">;\nexport type CollectionName = Branded<string, \"CollectionName\">;\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>;\nexport type InferRoot<T> = T extends CompiledSchema<infer R> ? R : never;\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 IsCreateExcluded<T, K extends keyof T> =\n [\n HasModifier<T, K, \"identity\">,\n HasModifier<T, K, \"computed\">,\n HasModifier<T, K, \"unmapped\">\n ] extends [\n false,\n false,\n false\n ] ? false : true;\n\ntype IsCreateOptional<T, K extends keyof T> =\n [\n HasModifier<T, K, \"optional\">,\n HasModifier<T, K, \"default\">\n ] extends [\n false,\n false\n ] ? false : true;\n\ntype IsCreateNullable<T, K extends keyof T> =\n HasModifier<T, K, \"nullable\"> extends true ? true : false;\n\ntype InferCreateProperty<T, K extends keyof T> =\n IsCreateNullable<T, K> extends true ? null | InferPrimitive<T[K]> : InferPrimitive<T[K]>;\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> = {\n [K in keyof T as IsCreateExcluded<T, K> extends true ? never\n : IsCreateOptional<T, K> extends true ? K : never]?: InferCreateProperty<T, K>\n} & {\n [K in keyof T as IsCreateExcluded<T, K> extends true ? never\n : IsCreateOptional<T, K> extends true ? never : K]: InferCreateProperty<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,CAAyC,QAAkB;QAC9D,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,mBAAmB,EAAK,CAAC,CAAC;QAEjD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAEQ,GAAG,CAAyC,QAAkB;QACnE,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CA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