@routier/core 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/{readme.md → README.md} +2 -2
- package/dist/assertions/index.cjs +191 -0
- package/dist/assertions/index.cjs.map +1 -0
- package/dist/assertions/index.d.ts +30 -0
- package/dist/assertions/index.js +94 -30
- package/dist/assertions/index.js.map +1 -1
- package/dist/capabilities/index.cjs +820 -0
- package/dist/capabilities/index.cjs.map +1 -0
- package/dist/capabilities/index.js +580 -545
- package/dist/capabilities/index.js.map +1 -1
- package/dist/codegen/handlers/CloneHandlerBuilder.d.ts +10 -1
- package/dist/codegen/handlers/SetHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/clone/CloneArrayHandler.d.ts +3 -0
- package/dist/codegen/handlers/clone/CloneDateHandler.d.ts +13 -0
- package/dist/codegen/handlers/clone/CloneValueHandler.d.ts +16 -0
- package/dist/codegen/handlers/compare/CompareComputedHandler.d.ts +10 -0
- package/dist/codegen/handlers/compare/CompareFunctionHandler.d.ts +10 -0
- package/dist/codegen/handlers/deserialize/DeserializeArrayHandler.d.ts +14 -0
- package/dist/codegen/handlers/enableChangeTracking/EnableChangeTrackingArrayHandler.d.ts +11 -0
- package/dist/codegen/handlers/enrichment/EnrichmentArrayHandler.d.ts +11 -0
- package/dist/codegen/handlers/freeze/FreezeArrayHandler.d.ts +6 -0
- package/dist/codegen/handlers/hash/HashArrayHandler.d.ts +10 -0
- package/dist/codegen/handlers/hash/HashFileHandler.d.ts +24 -0
- package/dist/codegen/handlers/hash/HashObjectHandler.d.ts +10 -0
- package/dist/codegen/handlers/hash/HashTransformHandler.d.ts +23 -0
- package/dist/codegen/handlers/index.d.ts +1 -0
- package/dist/codegen/handlers/merge/MergeArrayHandler.d.ts +20 -0
- package/dist/codegen/handlers/merge/MergeObjectHandler.d.ts +10 -0
- package/dist/codegen/handlers/serialize/SerializeArrayHandler.d.ts +19 -0
- package/dist/codegen/handlers/serialize/SerializeComputedHandler.d.ts +6 -0
- package/dist/codegen/handlers/set/SetComplexHandler.d.ts +6 -0
- package/dist/codegen/handlers/strip/StripComputedHandler.d.ts +10 -0
- package/dist/codegen/handlers/strip/StripFunctionHandler.d.ts +9 -0
- package/dist/codegen/handlers/types.d.ts +55 -1
- package/dist/codegen/index.cjs +618 -0
- package/dist/codegen/index.cjs.map +1 -0
- package/dist/codegen/index.js +100 -127
- package/dist/codegen/index.js.map +1 -1
- package/dist/collections/Changes.d.ts +2 -2
- package/dist/collections/MemoryDataCollection.d.ts +15 -1
- package/dist/collections/TagCollection.d.ts +7 -8
- package/dist/collections/index.cjs +702 -0
- package/dist/collections/index.cjs.map +1 -0
- package/dist/collections/index.js +282 -276
- package/dist/collections/index.js.map +1 -1
- package/dist/errors/OptimisticConcurrencyError.d.ts +18 -0
- package/dist/errors/PluginDestroyedError.d.ts +10 -0
- package/dist/errors/index.cjs +132 -0
- package/dist/errors/index.cjs.map +1 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +61 -19
- package/dist/errors/index.js.map +1 -1
- package/dist/expressions/constants.d.ts +2 -0
- package/dist/expressions/evaluate.d.ts +53 -0
- package/dist/expressions/index.cjs +2087 -0
- package/dist/expressions/index.cjs.map +1 -0
- package/dist/expressions/index.d.ts +2 -0
- package/dist/expressions/index.js +1784 -772
- package/dist/expressions/index.js.map +1 -1
- package/dist/expressions/parser.d.ts +19 -0
- package/dist/expressions/types.d.ts +87 -2
- package/dist/expressions/utils.d.ts +1 -2
- package/dist/index.cjs +13925 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +12094 -7049
- package/dist/index.js.map +1 -1
- package/dist/performance/index.cjs +217 -0
- package/dist/performance/index.cjs.map +1 -0
- package/dist/performance/index.js +126 -50
- package/dist/performance/index.js.map +1 -1
- package/dist/pipeline/index.cjs +576 -0
- package/dist/pipeline/index.cjs.map +1 -0
- package/dist/pipeline/index.js +229 -156
- package/dist/pipeline/index.js.map +1 -1
- package/dist/plugins/BatchingDbPlugin.d.ts +139 -0
- package/dist/plugins/CacheDbPlugin.d.ts +70 -0
- package/dist/plugins/ConcurrencyDbPlugin.d.ts +78 -0
- package/dist/plugins/EphemeralDataPlugin.d.ts +57 -1
- package/dist/plugins/RetryDbPlugin.d.ts +77 -0
- package/dist/plugins/index.cjs +6104 -0
- package/dist/plugins/index.cjs.map +1 -0
- package/dist/plugins/index.d.ts +5 -1
- package/dist/plugins/index.js +5572 -1491
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/query/QueryOptionsCollection.d.ts +22 -0
- package/dist/plugins/query/index.d.ts +2 -0
- package/dist/plugins/query/join.d.ts +210 -0
- package/dist/plugins/query/similarity.d.ts +38 -0
- package/dist/plugins/query/types.d.ts +64 -1
- package/dist/plugins/translators/DataTranslator.d.ts +28 -0
- package/dist/plugins/translators/JsonTranslator.d.ts +27 -0
- package/dist/plugins/translators/SqlTranslator.d.ts +45 -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/TupleTranslator.d.ts +45 -0
- package/dist/plugins/translators/index.d.ts +1 -0
- package/dist/plugins/translators/types.d.ts +8 -1
- package/dist/plugins/types.d.ts +87 -11
- package/dist/plugins/wire/handler.d.ts +122 -0
- package/dist/plugins/wire/index.d.ts +4 -0
- package/dist/plugins/wire/persist.d.ts +43 -0
- package/dist/plugins/wire/query.d.ts +49 -0
- package/dist/plugins/wire/types.d.ts +123 -0
- package/dist/results/Result.d.ts +2 -2
- package/dist/results/index.cjs +174 -0
- package/dist/results/index.cjs.map +1 -0
- package/dist/results/index.js +29 -44
- package/dist/results/index.js.map +1 -1
- package/dist/schema/PropertyInfo.d.ts +35 -2
- package/dist/schema/SchemaDefinition.d.ts +51 -1
- package/dist/schema/builder.d.ts +35 -1
- package/dist/schema/communication/broadcast.d.ts +17 -1
- package/dist/schema/index.cjs +6911 -0
- package/dist/schema/index.cjs.map +1 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/index.js +5781 -3973
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/property/base/SchemaBase.d.ts +50 -2
- 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 +15 -1
- package/dist/schema/property/modifiers/SchemaOptional.d.ts +22 -1
- package/dist/schema/property/modifiers/SchemaSearchable.d.ts +34 -0
- 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 +3 -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/SchemaFile.d.ts +60 -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 +25 -1
- package/dist/schema/property/types/SchemaVector.d.ts +61 -0
- package/dist/schema/property/types/index.d.ts +2 -0
- package/dist/schema/table/SchemaTransform.d.ts +40 -0
- package/dist/schema/table/index.d.ts +1 -0
- package/dist/schema/types.d.ts +200 -32
- package/dist/schema/utils/propertyKind.d.ts +4 -0
- package/dist/schema/utils/standardJsonSchema.d.ts +90 -0
- package/dist/types/index.cjs +23 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.js +0 -14
- package/dist/types/index.js.map +1 -1
- package/dist/utilities/functions.d.ts +1 -1
- package/dist/utilities/index.cjs +982 -0
- package/dist/utilities/index.cjs.map +1 -0
- package/dist/utilities/index.js +590 -321
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/logger.d.ts +48 -0
- package/package.json +152 -98
- package/dist/collections/Changes.test.d.ts +0 -1
- package/dist/collections/MemoryDataCollection.test.d.ts +0 -1
- package/dist/collections/TagCollection.test.d.ts +0 -1
- package/dist/expressions/parser.test.d.ts +0 -1
- package/dist/expressions/utils.test.d.ts +0 -1
- package/dist/pipeline/SyncronousQueue.test.d.ts +0 -1
- package/dist/pipeline/WorkPipeline.test.d.ts +0 -1
- package/dist/plugins/EphemeralDataPlugin.test.d.ts +0 -1
- package/dist/plugins/query/QueryOptionsCollection.test.d.ts +0 -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/plugins/translators/JsonTranslator.test.d.ts +0 -1
- package/dist/schema/PropertyInfo.test.d.ts +0 -1
- package/dist/schema/schemaGeneration.test.d.ts +0 -1
- package/dist/schema/testSchemas.test.d.ts +0 -314
- package/dist/utilities/arrays.test.d.ts +0 -1
- package/dist/utilities/dates.test.d.ts +0 -1
- package/dist/utilities/strings.test.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities/index.js","sources":["webpack://@routier/core/./src/capabilities/Capability.ts","webpack://@routier/core/./src/capabilities/PerformanceCapability.ts","webpack://@routier/core/./src/capabilities/TracingCapability.ts","webpack://@routier/core/./src/capabilities/performance/PerformanceTracker.ts","webpack://@routier/core/./src/capabilities/tracing/CallTraceManager.ts","webpack://@routier/core/./src/utilities/logger.ts","webpack://@routier/core/./src/utilities/strings.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/capabilities/index.ts"],"sourcesContent":["import { MethodInfo, MethodInfoMetadata } from \"./types\";\n\nexport abstract class Capability {\n\n protected excludedNames = new Set<string>([\n \"Array\",\n \"Set\",\n \"Map\",\n \"AbortController\",\n \"AbortSignal\",\n \"SchemaString\",\n \"SchemaNumber\",\n \"SchemaArray\",\n \"SchemaBoolean\",\n \"SchemaDate\",\n \"SchemaObject\",\n \"SchemaDefault\",\n \"SchemaDeserialize\",\n \"SchemaDistinct\",\n \"SchemaFrom\",\n \"SchemaIdentity\",\n \"SchemaIndex\",\n \"SchemaKey\",\n \"SchemaNullable\",\n \"SchemaOptional\",\n \"SchemaReadonly\",\n \"SchemaSerialize\",\n \"SchemaTracked\",\n \"SchemaComputed\",\n \"SchemaFunction\",\n \"SchemaBase\",\n \"SchemaDefinition\"\n ]);\n\n protected isValidObject(obj: unknown): obj is object {\n return typeof obj === \"object\" && obj !== null;\n }\n\n protected isCallableMethod(descriptor: PropertyDescriptor | undefined, key: string | symbol): boolean {\n return (\n descriptor?.value &&\n typeof descriptor.value === 'function' &&\n key !== 'constructor' &&\n key !== 'undefined'\n );\n }\n\n\n private canExplore(descriptor: PropertyDescriptor) {\n if (typeof descriptor.value !== \"object\") {\n return false;\n }\n\n if (descriptor.value == null) {\n return false\n }\n\n const name = this.getName(descriptor.value);\n\n if (name == null) {\n return true;\n }\n\n return this.excludedNames.has(name) === false\n }\n\n private getName(value: object) {\n if (value.constructor != null) {\n return value.constructor.name;\n }\n\n return null;\n }\n\n private getPath(info: MethodInfoMetadata, propertyName: string | symbol) {\n\n let parent = info.parent;\n const path = [info.propertyName, propertyName];\n\n while (parent != null) {\n\n path.unshift(parent.propertyName);\n parent = parent.parent;\n }\n\n return path.join(\".\");\n }\n\n protected explore(instance: unknown, onDiscover: (info: MethodInfoMetadata, methodInfo: MethodInfo) => void): void {\n if (!this.isValidObject(instance)) {\n return;\n }\n\n const explore: MethodInfoMetadata[] = [{ instance, propertyName: this.getName(instance) }];\n const visited = new Set<object>();\n\n for (let i = 0; i < explore.length; i++) {\n\n const info = explore[i];\n const item = info.instance;\n\n if (visited.has(item)) {\n continue;\n }\n\n const allKeys = [\n ...Object.getOwnPropertyNames(item),\n ...Object.getOwnPropertySymbols(item),\n ];\n\n for (const key of allKeys) {\n\n const descriptor = Object.getOwnPropertyDescriptor(item, key);\n\n const isCallable = this.isCallableMethod(descriptor, key);\n\n onDiscover(info, {\n name: key,\n isCallable\n });\n\n if (this.canExplore(descriptor) === false) {\n continue;\n }\n\n const path = this.getPath(info, key);\n explore.push({ instance: descriptor.value, parent: info, propertyName: key, path });\n }\n\n visited.add(item);\n }\n }\n\n abstract apply(instance: unknown): void;\n}","import { stringifyObject } from \"../utilities\";\nimport { Capability } from \"./Capability\";\nimport { PerformanceTracker } from \"./performance/PerformanceTracker\";\nimport { CallTraceManager } from \"./tracing/CallTraceManager\";\nimport { MethodInfoMetadata, MethodInfo } from \"./types\";\nimport { logger } from '../utilities';\n\nexport type PerformanceCapabilityOptions = {\n filter: (methodName: string | symbol, methodInfo: MethodInfo, metadata: MethodInfoMetadata) => boolean\n}\n\nexport class PerformanceCapability extends Capability {\n\n private callTraceManager: CallTraceManager;\n private performanceTracker: PerformanceTracker;\n private filter: (methodName: string | symbol, methodInfo: MethodInfo, metadata: MethodInfoMetadata) => boolean;\n private childDurations: Map<string, number[]> = new Map();\n\n constructor(options?: PerformanceCapabilityOptions) {\n super();\n this.filter = options?.filter ?? (() => true)\n this.callTraceManager = new CallTraceManager();\n this.performanceTracker = new PerformanceTracker();\n }\n\n override apply(instance: unknown): void {\n\n this.explore(instance, (meta, info) => {\n\n if (info.isCallable) {\n const originalMethod = meta.instance[info.name].bind(meta.instance);\n\n meta.instance[info.name] = (...args: any[]) => {\n\n const path = `${meta.path!}.${String(info.name)}()`;\n\n if (this.filter(path, info, meta) === false) {\n return originalMethod(...args);\n }\n\n const isNewOperation = this.callTraceManager.isNewOperation();\n let operationId: string;\n let callTrace: string[];\n let depth: number;\n\n if (isNewOperation) {\n operationId = this.callTraceManager.startNewOperation();\n this.childDurations.set(operationId, []);\n callTrace = this.callTraceManager.addMethodToTrace(path);\n depth = callTrace.length - 1;\n const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);\n\n this.performanceTracker.startMethodTiming(operationId, path);\n\n logger.log(`\\n${'═'.repeat(60)}`);\n logger.log(`▶ ORIGIN [${operationId}] ${path}`);\n if (args.length > 0) {\n logger.log(` Args:`, stringifyObject(args, 4, 0));\n }\n logger.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);\n } else {\n operationId = this.callTraceManager.getActiveOperationId();\n callTrace = this.callTraceManager.addMethodToTrace(path);\n depth = callTrace.length - 1;\n const indent = ' '.repeat(Math.min(depth, 4));\n\n // Track children for this child method too\n const childMethodKey = `${operationId}:${path}`;\n this.childDurations.set(childMethodKey, []);\n\n this.performanceTracker.startMethodTiming(operationId, path);\n\n logger.log(`${indent}└─ CHILD [${operationId}] ${path}`);\n if (args.length > 0) {\n logger.log(`${indent} Args:`, stringifyObject(args, 4, 0));\n }\n }\n\n try {\n return originalMethod(...args);\n } finally {\n const metrics = this.performanceTracker.endMethodTiming(operationId, path);\n const duration = metrics.duration ?? 0;\n const formattedDuration = this.performanceTracker.formatDuration(duration);\n\n if (isNewOperation) {\n const childDurations = this.childDurations.get(operationId) ?? [];\n const totalChildTime = childDurations.reduce((sum, d) => sum + d, 0);\n const formattedTotalChildTime = this.performanceTracker.formatDuration(totalChildTime);\n const overhead = duration - totalChildTime;\n const formattedOverhead = this.performanceTracker.formatDuration(Math.max(0, overhead));\n\n logger.log(`\\n${'═'.repeat(60)}`);\n logger.log(`◀ COMPLETE [${operationId}] ${path}`);\n logger.log(` Total Duration: ${formattedDuration}`);\n if (childDurations.length > 0) {\n logger.log(` Children Duration: ${formattedTotalChildTime} (${childDurations.length} calls)`);\n logger.log(` Overhead: ${formattedOverhead}`);\n }\n logger.log(`${'═'.repeat(60)}\\n`);\n\n this.childDurations.delete(operationId);\n this.performanceTracker.cleanupOperation(operationId);\n this.callTraceManager.endOperation();\n } else {\n const indent = ' '.repeat(Math.min(depth, 4));\n const childMethodKey = `${operationId}:${path}`;\n const childDurations = this.childDurations.get(childMethodKey) ?? [];\n const totalChildTime = childDurations.reduce((sum, d) => sum + d, 0);\n const formattedTotalChildTime = this.performanceTracker.formatDuration(totalChildTime);\n const overhead = duration - totalChildTime;\n const formattedOverhead = this.performanceTracker.formatDuration(Math.max(0, overhead));\n\n logger.log(`${indent} ✓ ${formattedDuration}`);\n if (childDurations.length > 0) {\n logger.log(`${indent} Children: ${formattedTotalChildTime} (${childDurations.length} calls), Overhead: ${formattedOverhead}`);\n }\n\n // Clean up child method tracking\n this.childDurations.delete(childMethodKey);\n\n // Find the parent method and add this duration to its children list\n // The parent is the method one level up in the call trace\n const currentTrace = this.callTraceManager.getCurrentTrace();\n if (currentTrace.length > 1) {\n // Parent is the second-to-last item in the trace (before we remove current)\n const parentPath = currentTrace[currentTrace.length - 2];\n\n // Check if parent is the root operation (trace length 2 means root + this child)\n if (currentTrace.length === 2) {\n // Direct child of root - add to root's children list\n const rootChildDurations = this.childDurations.get(operationId);\n if (rootChildDurations) {\n rootChildDurations.push(duration);\n }\n } else {\n // Nested child - add to parent method's children list\n const parentMethodKey = `${operationId}:${parentPath}`;\n const parentChildDurations = this.childDurations.get(parentMethodKey);\n if (parentChildDurations) {\n parentChildDurations.push(duration);\n }\n }\n }\n }\n\n this.callTraceManager.removeMethodFromTrace();\n }\n }\n }\n });\n }\n}","import { Capability } from \"./Capability\";\nimport { CallTraceManager } from \"./tracing/CallTraceManager\";\nimport { stringifyObject } from \"../utilities/strings\";\nimport { MethodInfo, MethodInfoMetadata } from \"./types\";\nimport { logger } from '../utilities';\n\nexport type TracingCapabilityOptions = {\n filter: (methodName: string | symbol, methodInfo: MethodInfo, metadata: MethodInfoMetadata) => boolean\n}\n\nexport class TracingCapability extends Capability {\n\n private callTraceManager: CallTraceManager;\n private filter: (methodName: string | symbol, methodInfo: MethodInfo, metadata: MethodInfoMetadata) => boolean;\n\n constructor(options?: TracingCapabilityOptions) {\n super();\n this.filter = options?.filter ?? (() => true);\n this.callTraceManager = new CallTraceManager();\n }\n\n override apply(instance: unknown): void {\n\n this.explore(instance, (meta, info) => {\n\n if (info.isCallable) {\n\n const originalMethod = meta.instance[info.name].bind(meta.instance);\n\n meta.instance[info.name] = (...args: any[]) => {\n\n const path = `${meta.path!}.${String(info.name)}()`;\n\n if (this.filter(path, info, meta) === false) {\n return originalMethod(...args);\n }\n\n const isNewOperation = this.callTraceManager.isNewOperation();\n let operationId: string;\n\n if (isNewOperation) {\n operationId = this.callTraceManager.startNewOperation();\n const callTrace = this.callTraceManager.addMethodToTrace(path);\n const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);\n\n logger.log(`\\n${'═'.repeat(60)}`);\n logger.log(`▶ ORIGIN [${operationId}] ${path}`);\n if (args.length > 0) {\n logger.log(` Args:`, stringifyObject(args, 4, 0));\n }\n logger.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);\n } else {\n operationId = this.callTraceManager.getActiveOperationId();\n const callTrace = this.callTraceManager.addMethodToTrace(path);\n\n const indent = ' '.repeat(Math.min(callTrace.length - 1, 4));\n logger.log(`${indent}└─ CHILD [${operationId}] ${path}`);\n if (args.length > 0) {\n logger.log(`${indent} Args:`, stringifyObject(args, 4, 0));\n }\n }\n\n try {\n return originalMethod(...args);\n } finally {\n this.callTraceManager.removeMethodFromTrace();\n\n if (isNewOperation) {\n this.callTraceManager.endOperation();\n }\n }\n }\n }\n\n });\n }\n}","import { PerformanceMetrics } from \"../types\";\n\nexport class PerformanceTracker {\n private methodTimings = new Map<string, { startTime: number; nextMethodStartTime?: number }>();\n private operationStartTimes = new Map<string, number>();\n\n startMethodTiming(operationId: string, methodPath: string): number {\n const startTime = performance.now();\n const key = `${operationId}:${methodPath}`;\n\n // Track operation start time for delta calculations\n if (!this.operationStartTimes.has(operationId)) {\n this.operationStartTimes.set(operationId, startTime);\n }\n\n this.methodTimings.set(key, { startTime });\n return startTime;\n }\n\n recordNextMethodStart(operationId: string, methodPath: string): void {\n const key = `${operationId}:${methodPath}`;\n const timing = this.methodTimings.get(key);\n if (timing) {\n timing.nextMethodStartTime = performance.now();\n }\n }\n\n endMethodTiming(operationId: string, methodPath: string): PerformanceMetrics {\n const endTime = performance.now();\n const key = `${operationId}:${methodPath}`;\n const timing = this.methodTimings.get(key);\n\n if (!timing) {\n return { startTime: endTime };\n }\n\n const duration = endTime - timing.startTime;\n const timeToNextCall = timing.nextMethodStartTime ?\n timing.nextMethodStartTime - timing.startTime : undefined;\n\n // Clean up\n this.methodTimings.delete(key);\n\n return {\n startTime: timing.startTime,\n endTime,\n duration,\n nextMethodStartTime: timing.nextMethodStartTime,\n timeToNextCall\n };\n }\n\n formatDuration(milliseconds: number): string {\n if (milliseconds < 1) {\n return `${(milliseconds * 1000).toFixed(1)}μs`;\n } else if (milliseconds < 1000) {\n return `${milliseconds.toFixed(2)}ms`;\n } else {\n return `${(milliseconds / 1000).toFixed(2)}s`;\n }\n }\n\n getDeltaFromOperationStart(operationId: string, currentTime: number): number {\n const operationStartTime = this.operationStartTimes.get(operationId);\n return operationStartTime ? currentTime - operationStartTime : 0;\n }\n\n cleanupOperation(operationId: string): void {\n this.operationStartTimes.delete(operationId);\n }\n}","import { uuid } from \"../../utilities\";\n\nexport class CallTraceManager {\n private activeOperationId: string | null = null;\n private activeCallStack: string[] = [];\n\n startNewOperation(): string {\n const operationId = uuid(8);\n this.activeOperationId = operationId;\n this.activeCallStack = [];\n return operationId;\n }\n\n isNewOperation(): boolean {\n return this.activeOperationId === null;\n }\n\n getActiveOperationId(): string {\n if (!this.activeOperationId) {\n throw new Error('No active operation context');\n }\n return this.activeOperationId;\n }\n\n addMethodToTrace(methodPath: string): string[] {\n if (this.isNewOperation()) {\n this.activeCallStack = [methodPath];\n } else {\n this.activeCallStack.push(methodPath);\n }\n return [...this.activeCallStack];\n }\n\n removeMethodFromTrace(): void {\n if (!this.isNewOperation()) {\n this.activeCallStack.pop();\n }\n }\n\n endOperation(): void {\n this.activeOperationId = null;\n this.activeCallStack = [];\n }\n\n formatMethodPaths(methodPaths: string[]): string[] {\n return methodPaths.map(path => path.replace(/ → /g, '.'));\n }\n\n getCurrentTrace(): string[] {\n return [...this.activeCallStack];\n }\n}","const isDevelopment = (): boolean => {\n if (typeof process === 'undefined' || process.env == null) {\n return false;\n }\n const env = process.env.NODE_ENV?.toLowerCase();\n return env === 'dev' || env === 'development' || env === 'test';\n};\n\ntype LogMethods = \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\" | \"table\";\nconst shouldLog = isDevelopment();\nconst tryLog = (type: LogMethods, ...args: unknown[]) => {\n if (shouldLog) {\n (console[type] as (...args: unknown[]) => void)(...args);\n }\n};\n\nexport const logger = {\n log: (...args: unknown[]): void => {\n tryLog(\"log\", ...args);\n },\n info: (...args: unknown[]): void => {\n tryLog(\"info\", ...args);\n },\n warn: (...args: unknown[]): void => {\n tryLog(\"warn\", ...args);\n },\n error: (...args: unknown[]): void => {\n tryLog(\"error\", ...args);\n },\n debug: (...args: unknown[]): void => {\n tryLog(\"debug\", ...args);\n },\n table: (...args: unknown[]): void => {\n tryLog(\"table\", ...args);\n },\n};\n\n","export const hash = (value: string, seed: number = 0) => {\n // From Stack Overflow\n // https://stackoverflow.com/a/52171480/3329760\n let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;\n\n for (let i = 0, ch: number; i < value.length; i++) {\n ch = value.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);\n h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);\n h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n\n return 4294967296 * (2097151 & h2) + (h1 >>> 0);\n}\n\n/**\n * Fast string hash optimized for comparisons.\n * Uses djb2 algorithm - very fast and good distribution for short to medium strings.\n * Same input always produces same output (deterministic).\n * \n * @param value - The string to hash\n * @param seed - Optional seed value (default: 5381)\n * @returns A positive 32-bit integer hash value\n * \n * @example\n * ```ts\n * fastHash(\"test\") === fastHash(\"test\") // true\n * fastHash(\"test\") !== fastHash(\"test2\") // true\n * ```\n */\nexport const fastHash = (value: string, seed: number = 5381): number => {\n let hash = seed;\n for (let i = 0; i < value.length; i++) {\n hash = ((hash << 5) + hash) + value.charCodeAt(i);\n }\n return hash >>> 0; // Convert to unsigned 32-bit integer\n}\n\n/**\n * Converts any value to a readable string representation.\n * Handles primitives, objects, arrays, classes, dates, errors, and functions.\n * Supports depth limiting to prevent infinite recursion on circular references.\n * \n * @param obj - The value to stringify\n * @param maxDepth - Maximum depth for nested objects (default: 3)\n * @param currentDepth - Current recursion depth (default: 0)\n * @returns String representation of the value\n * \n * @example\n * ```ts\n * stringifyObject({ name: \"test\", count: 5 }) // '{ name: \"test\", count: 5 }'\n * stringifyObject([1, 2, 3]) // '[1, 2, 3]'\n * stringifyObject(new Date()) // 'Date(2024-01-01T00:00:00.000Z)'\n * ```\n */\nexport function stringifyObject(obj: unknown, maxDepth: number = 3, currentDepth: number = 0): string {\n if (obj === null) return 'null';\n if (obj === undefined) return 'undefined';\n\n const type = typeof obj;\n\n switch (type) {\n case 'string':\n return `\"${obj}\"`;\n case 'number':\n case 'boolean':\n return String(obj);\n case 'function':\n return `[Function: ${getFunctionName(obj as Function)}]`;\n case 'object':\n if (currentDepth >= maxDepth) {\n return '[Max Depth Reached]';\n }\n return stringifyObjectValue(obj, maxDepth, currentDepth);\n default:\n return `[${type}]`;\n }\n}\n\nfunction getFunctionName(fn: Function): string {\n const name = fn.name;\n return name || 'anonymous';\n}\n\nfunction getObjectProperties(obj: any): Record<string, any> {\n const properties: Record<string, any> = {};\n\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n properties[key] = obj[key];\n }\n }\n\n return properties;\n}\n\nfunction stringifyObjectValue(obj: any, maxDepth: number, currentDepth: number): string {\n if (obj === null) return 'null';\n\n if (obj instanceof Date) {\n return `Date(${obj.toISOString()})`;\n }\n\n if (obj instanceof Error) {\n return `Error(${obj.message})`;\n }\n\n if (obj instanceof RegExp) {\n return obj.toString();\n }\n\n if (Array.isArray(obj)) {\n return stringifyArray(obj, maxDepth, currentDepth);\n }\n\n if (obj.constructor && obj.constructor.name !== 'Object') {\n return stringifyClassInstance(obj, maxDepth, currentDepth);\n }\n\n return stringifyPlainObject(obj, maxDepth, currentDepth);\n}\n\nfunction stringifyArray(arr: any[], maxDepth: number, currentDepth: number): string {\n if (arr.length === 0) return '[]';\n\n const items = arr.slice(0, 5).map(item =>\n stringifyObject(item, maxDepth, currentDepth + 1)\n );\n\n const suffix = arr.length > 5 ? `... (+${arr.length - 5} more)` : '';\n return `[${items.join(', ')}${suffix}]`;\n}\n\nfunction stringifyClassInstance(obj: any, maxDepth: number, currentDepth: number): string {\n const className = obj.constructor.name;\n const properties = getObjectProperties(obj);\n\n if (Object.keys(properties).length === 0) {\n return `${className} {}`;\n }\n\n const props = Object.entries(properties)\n .slice(0, 5)\n .map(([key, value]) => {\n const isPrimitive = value === null || value === undefined ||\n (typeof value !== 'object' && typeof value !== 'function');\n const depth = isPrimitive ? currentDepth : currentDepth + 1;\n return `${key}: ${stringifyObject(value, maxDepth, depth)}`;\n });\n\n const suffix = Object.keys(properties).length > 5 ?\n `... (+${Object.keys(properties).length - 5} more)` : '';\n\n return `${className} { ${props.join(', ')}${suffix} }`;\n}\n\nfunction stringifyPlainObject(obj: any, maxDepth: number, currentDepth: number): string {\n const properties = getObjectProperties(obj);\n\n if (Object.keys(properties).length === 0) {\n return '{}';\n }\n\n const props = Object.entries(properties)\n .slice(0, 5)\n .map(([key, value]) => {\n const isPrimitive = value === null || value === undefined ||\n (typeof value !== 'object' && typeof value !== 'function');\n const depth = isPrimitive ? currentDepth : currentDepth + 1;\n return `${key}: ${stringifyObject(value, maxDepth, depth)}`;\n });\n\n const suffix = Object.keys(properties).length > 5 ?\n `... (+${Object.keys(properties).length - 5} more)` : '';\n\n return `{ ${props.join(', ')}${suffix} }`;\n}","export const 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 { Capability } from './Capability';\nexport { PerformanceCapability } from './PerformanceCapability';\nexport { TracingCapability } from './TracingCapability';\nexport * from './types';"],"names":[],"mappings":";;;;;;AAEO,MAAe,UAAU;IAElB,aAAa,GAAG,IAAI,GAAG,CAAS;QACtC,OAAO;QACP,KAAK;QACL,KAAK;QACL,iBAAiB;QACjB,aAAa;QACb,cAAc;QACd,cAAc;QACd,aAAa;QACb,eAAe;QACf,YAAY;QACZ,cAAc;QACd,eAAe;QACf,mBAAmB;QACnB,gBAAgB;QAChB,YAAY;QACZ,gBAAgB;QAChB,aAAa;QACb,WAAW;QACX,gBAAgB;QAChB,gBAAgB;QAChB,gBAAgB;QAChB,iBAAiB;QACjB,eAAe;QACf,gBAAgB;QAChB,gBAAgB;QAChB,YAAY;QACZ,kBAAkB;KACrB,CAAC,CAAC;IAEO,aAAa,CAAC,GAAY;QAChC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,CAAC;IACnD,CAAC;IAES,gBAAgB,CAAC,UAA0C,EAAE,GAAoB;QACvF,OAAO,CACH,UAAU,EAAE,KAAK;YACjB,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU;YACtC,GAAG,KAAK,aAAa;YACrB,GAAG,KAAK,WAAW,CACtB,CAAC;IACN,CAAC;IAGO,UAAU,CAAC,UAA8B;QAC7C,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACvC,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,IAAI,UAAU,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;YAC3B,OAAO,KAAK;QAChB,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAE5C,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;QAChB,CAAC;QAED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3B,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;;;;;;;;;;;;;;ACN0C;AACsB;AACR;AAChC"}
|
|
1
|
+
{"version":3,"file":"capabilities/index.js","sources":["webpack://@routier/core/./src/utilities/logger.ts","webpack://@routier/core/./src/utilities/strings.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/./src/capabilities/Capability.ts","webpack://@routier/core/./src/capabilities/performance/PerformanceTracker.ts","webpack://@routier/core/./src/capabilities/tracing/CallTraceManager.ts","webpack://@routier/core/./src/capabilities/PerformanceCapability.ts","webpack://@routier/core/./src/capabilities/TracingCapability.ts","webpack://@routier/core/./src/capabilities/index.ts"],"sourcesContent":["/**\n * Levelled logging, resolved once.\n *\n * Three things about the previous implementation drove this shape:\n *\n * - **There was no way to turn logging off.** `globalThis.__ROUTIER_DEBUG__` was only ever\n * compared against `true`, so setting it to `false` did nothing — while\n * `docs/how-to/debug-logging.md` documented exactly that as the way to force logging off.\n * A documented switch that silently does nothing is worse than no switch.\n * - **`NODE_ENV === 'test'` enabled it.** Every Jest run therefore logged, because Jest always\n * sets `NODE_ENV=test`. Measured on the S7 stress scenario, which drives ~2,000 saves through\n * a plugin that logs three lines per query: 12.4s with logging, ~6s without. Test runners also\n * capture console output by snapshotting a stack trace per call, so the cost is far above what\n * writing to a terminal would suggest — and the output buries whatever the failure was.\n * - **It was all-or-nothing, and re-resolved per call.** An error could not be kept while debug\n * was dropped, and every one of the ~97 call sites re-read `globalThis` and `process.env`.\n *\n * Levels are compared numerically against a value cached at module load. Measured against a\n * no-op console at 200k calls: an enabled call costs ~70ns, a call rejected by the gate ~3ns.\n * Building the arguments the call site passes in accounts for ~0.2ns of that 3ns, which is why\n * this keeps the ordinary `logger.debug(msg, payload)` signature instead of taking a thunk —\n * a lazy API would recover 0.3% of an enabled call's cost and would have to change every call\n * site to do it.\n */\n\n/** Ordered from most severe to most verbose. `silent` discards everything. */\nexport const LOG_LEVELS = ['silent', 'error', 'warn', 'info', 'debug'] as const;\n\nexport type LogLevel = (typeof LOG_LEVELS)[number];\n\n/** Numeric rank, so a gate is one integer comparison. */\nconst RANK: Record<LogLevel, number> = {\n silent: 0,\n error: 1,\n warn: 2,\n info: 3,\n debug: 4,\n};\n\nconst isLogLevel = (value: unknown): value is LogLevel =>\n typeof value === 'string' && (LOG_LEVELS as readonly string[]).includes(value);\n\n/**\n * Resolves the configured level, in precedence order.\n *\n * Ordered most specific first: an explicit level beats a boolean flag, a boolean flag beats an\n * environment variable, and an environment variable beats an inference from `NODE_ENV`. Anything\n * unrecognised is ignored rather than treated as an error — a typo'd level should not take down\n * an application, and `silent` is the safe direction to fall back to.\n */\nconst resolveLevel = (): LogLevel => {\n if (typeof globalThis !== 'undefined') {\n const g = globalThis as { __ROUTIER_LOG_LEVEL__?: unknown; __ROUTIER_DEBUG__?: unknown };\n\n if (isLogLevel(g.__ROUTIER_LOG_LEVEL__)) {\n return g.__ROUTIER_LOG_LEVEL__;\n }\n\n // Both directions honoured. `=== false` used to fall through to the NODE_ENV checks\n // below and re-enable the logging it was asked to suppress.\n if (g.__ROUTIER_DEBUG__ === true) return 'debug';\n if (g.__ROUTIER_DEBUG__ === false) return 'silent';\n }\n\n // There is deliberately no `import.meta.env` branch, although the documentation used to\n // promise one. It could never work: this package is bundled with rspack, which replaces\n // `import.meta` with `undefined`, so the check would read the *library's* build-time\n // environment rather than the application's — and referencing `import.meta` at all is a parse\n // error under a CommonJS build target, which is how the test suite loads this file. Vite and\n // similar apps set `__ROUTIER_LOG_LEVEL__` or `__ROUTIER_DEBUG__` from their own\n // `import.meta.env`, which is what the docs now describe.\n if (typeof process !== 'undefined' && process.env != null) {\n if (isLogLevel(process.env.ROUTIER_LOG_LEVEL)) {\n return process.env.ROUTIER_LOG_LEVEL as LogLevel;\n }\n\n const debug = process.env.DEBUG;\n if (debug === 'routier' || debug === '*') return 'debug';\n\n const env = process.env.NODE_ENV?.toLowerCase();\n\n // `test` is deliberately absent. It used to be here, which meant no test suite anywhere\n // could run Routier quietly. Opt in with DEBUG=routier or ROUTIER_LOG_LEVEL when a test\n // needs the output.\n if (env === 'dev' || env === 'development') return 'debug';\n }\n\n return 'silent';\n};\n\nlet level: LogLevel = resolveLevel();\nlet rank = RANK[level];\n\n/**\n * Overrides the level for the rest of the process.\n *\n * The configuration above is read once, at import, which is what makes the gate cheap — but it\n * also means an application that decides its verbosity after startup, or a test that wants to\n * assert on output, has no way in. This is that way in.\n */\nexport const setLogLevel = (next: LogLevel): void => {\n if (isLogLevel(next) === false) {\n throw new Error(`Unknown log level \"${next}\". Expected one of: ${LOG_LEVELS.join(', ')}`);\n }\n\n level = next;\n rank = RANK[next];\n};\n\nexport const getLogLevel = (): LogLevel => level;\n\n/** Re-reads the environment. For tests that change it after this module was imported. */\nexport const resetLogLevel = (): void => {\n level = resolveLevel();\n rank = RANK[level];\n};\n\n/**\n * Whether a message at this level would be emitted.\n *\n * For the rare call site whose *arguments* are expensive to build — a serialization, a deep\n * clone, a join over a large collection. An ordinary payload object is not worth guarding; see\n * the measurement in the header.\n */\nexport const isLogLevelEnabled = (at: LogLevel): boolean => rank >= RANK[at];\n\ntype ConsoleMethod = 'log' | 'info' | 'warn' | 'error' | 'debug' | 'table';\n\nconst emit = (at: LogLevel, method: ConsoleMethod, args: unknown[]) => {\n if (rank < RANK[at]) {\n return;\n }\n\n // Resolved at call time rather than captured once: test harnesses and browser devtools both\n // replace console methods after modules have loaded, and a captured reference would keep\n // writing past the replacement.\n (console[method] as (...a: unknown[]) => void)(...args);\n};\n\nexport const logger = {\n /** General-purpose output. Carried at `info`, since `log` names a console method, not a level. */\n log: (...args: unknown[]): void => emit('info', 'log', args),\n info: (...args: unknown[]): void => emit('info', 'info', args),\n warn: (...args: unknown[]): void => emit('warn', 'warn', args),\n error: (...args: unknown[]): void => emit('error', 'error', args),\n debug: (...args: unknown[]): void => emit('debug', 'debug', args),\n /** Diagnostic tabular output; verbose by nature, so it sits at `debug`. */\n table: (...args: unknown[]): void => emit('debug', 'table', args),\n};\n","export const hash = (value: string, seed: number = 0) => {\n // From Stack Overflow\n // https://stackoverflow.com/a/52171480/3329760\n let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;\n\n for (let i = 0, ch: number; i < value.length; i++) {\n ch = value.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507);\n h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507);\n h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n\n return 4294967296 * (2097151 & h2) + (h1 >>> 0);\n}\n\n/**\n * Fast string hash optimized for comparisons.\n * Uses djb2 algorithm - very fast and good distribution for short to medium strings.\n * Same input always produces same output (deterministic).\n * \n * @param value - The string to hash\n * @param seed - Optional seed value (default: 5381)\n * @returns A positive 32-bit integer hash value\n * \n * @example\n * ```ts\n * fastHash(\"test\") === fastHash(\"test\") // true\n * fastHash(\"test\") !== fastHash(\"test2\") // true\n * ```\n */\nexport const fastHash = (value: string, seed: number = 5381): number => {\n let hash = seed;\n for (let i = 0; i < value.length; i++) {\n hash = ((hash << 5) + hash) + value.charCodeAt(i);\n }\n return hash >>> 0; // Convert to unsigned 32-bit integer\n}\n\n/**\n * Converts any value to a readable string representation.\n * Handles primitives, objects, arrays, classes, dates, errors, and functions.\n * Supports depth limiting to prevent infinite recursion on circular references.\n * \n * @param obj - The value to stringify\n * @param maxDepth - Maximum depth for nested objects (default: 3)\n * @param currentDepth - Current recursion depth (default: 0)\n * @returns String representation of the value\n * \n * @example\n * ```ts\n * stringifyObject({ name: \"test\", count: 5 }) // '{ name: \"test\", count: 5 }'\n * stringifyObject([1, 2, 3]) // '[1, 2, 3]'\n * stringifyObject(new Date()) // 'Date(2024-01-01T00:00:00.000Z)'\n * ```\n */\nexport function stringifyObject(obj: unknown, maxDepth: number = 3, currentDepth: number = 0): string {\n if (obj === null) return 'null';\n if (obj === undefined) return 'undefined';\n\n const type = typeof obj;\n\n switch (type) {\n case 'string':\n return `\"${obj}\"`;\n case 'number':\n case 'boolean':\n return String(obj);\n case 'function':\n return `[Function: ${getFunctionName(obj as Function)}]`;\n case 'object':\n if (currentDepth >= maxDepth) {\n return '[Max Depth Reached]';\n }\n return stringifyObjectValue(obj, maxDepth, currentDepth);\n default:\n return `[${type}]`;\n }\n}\n\nfunction getFunctionName(fn: Function): string {\n const name = fn.name;\n return name || 'anonymous';\n}\n\nfunction getObjectProperties(obj: any): Record<string, any> {\n const properties: Record<string, any> = {};\n\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n properties[key] = obj[key];\n }\n }\n\n return properties;\n}\n\nfunction stringifyObjectValue(obj: any, maxDepth: number, currentDepth: number): string {\n if (obj === null) return 'null';\n\n if (obj instanceof Date) {\n return `Date(${obj.toISOString()})`;\n }\n\n if (obj instanceof Error) {\n return `Error(${obj.message})`;\n }\n\n if (obj instanceof RegExp) {\n return obj.toString();\n }\n\n if (Array.isArray(obj)) {\n return stringifyArray(obj, maxDepth, currentDepth);\n }\n\n if (obj.constructor && obj.constructor.name !== 'Object') {\n return stringifyClassInstance(obj, maxDepth, currentDepth);\n }\n\n return stringifyPlainObject(obj, maxDepth, currentDepth);\n}\n\nfunction stringifyArray(arr: any[], maxDepth: number, currentDepth: number): string {\n if (arr.length === 0) return '[]';\n\n const items = arr.slice(0, 5).map(item =>\n stringifyObject(item, maxDepth, currentDepth + 1)\n );\n\n const suffix = arr.length > 5 ? `... (+${arr.length - 5} more)` : '';\n return `[${items.join(', ')}${suffix}]`;\n}\n\nfunction stringifyClassInstance(obj: any, maxDepth: number, currentDepth: number): string {\n const className = obj.constructor.name;\n const properties = getObjectProperties(obj);\n\n if (Object.keys(properties).length === 0) {\n return `${className} {}`;\n }\n\n const props = Object.entries(properties)\n .slice(0, 5)\n .map(([key, value]) => {\n const isPrimitive = value === null || value === undefined ||\n (typeof value !== 'object' && typeof value !== 'function');\n const depth = isPrimitive ? currentDepth : currentDepth + 1;\n return `${key}: ${stringifyObject(value, maxDepth, depth)}`;\n });\n\n const suffix = Object.keys(properties).length > 5 ?\n `... (+${Object.keys(properties).length - 5} more)` : '';\n\n return `${className} { ${props.join(', ')}${suffix} }`;\n}\n\nfunction stringifyPlainObject(obj: any, maxDepth: number, currentDepth: number): string {\n const properties = getObjectProperties(obj);\n\n if (Object.keys(properties).length === 0) {\n return '{}';\n }\n\n const props = Object.entries(properties)\n .slice(0, 5)\n .map(([key, value]) => {\n const isPrimitive = value === null || value === undefined ||\n (typeof value !== 'object' && typeof value !== 'function');\n const depth = isPrimitive ? currentDepth : currentDepth + 1;\n return `${key}: ${stringifyObject(value, maxDepth, depth)}`;\n });\n\n const suffix = Object.keys(properties).length > 5 ?\n `... (+${Object.keys(properties).length - 5} more)` : '';\n\n return `{ ${props.join(', ')}${suffix} }`;\n}","export const 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\nconst hasRandomUUID =\n typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function';\n\nexport const uuidv4 = (): string => {\n if (hasRandomUUID) {\n return crypto.randomUUID();\n }\n\n return uuidv4Fallback();\n};\n\nconst uuidv4Fallback = (): 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))","import { MethodInfo, MethodInfoMetadata } from \"./types\";\n\nexport abstract class Capability {\n\n protected excludedNames = new Set<string>([\n \"Array\",\n \"Set\",\n \"Map\",\n \"AbortController\",\n \"AbortSignal\",\n \"SchemaString\",\n \"SchemaNumber\",\n \"SchemaArray\",\n \"SchemaBoolean\",\n \"SchemaDate\",\n \"SchemaObject\",\n \"SchemaDefault\",\n \"SchemaDeserialize\",\n \"SchemaDistinct\",\n \"SchemaSearchable\",\n \"SchemaFrom\",\n \"SchemaIdentity\",\n \"SchemaIndex\",\n \"SchemaKey\",\n \"SchemaNullable\",\n \"SchemaOptional\",\n \"SchemaReadonly\",\n \"SchemaSerialize\",\n \"SchemaTracked\",\n \"SchemaComputed\",\n \"SchemaFunction\",\n \"SchemaBase\",\n \"SchemaDefinition\"\n ]);\n\n protected isValidObject(obj: unknown): obj is object {\n return typeof obj === \"object\" && obj !== null;\n }\n\n protected isCallableMethod(descriptor: PropertyDescriptor | undefined, key: string | symbol): boolean {\n return (\n descriptor?.value &&\n typeof descriptor.value === 'function' &&\n key !== 'constructor' &&\n key !== 'undefined'\n );\n }\n\n\n private canExplore(descriptor: PropertyDescriptor) {\n if (typeof descriptor.value !== \"object\") {\n return false;\n }\n\n if (descriptor.value == null) {\n return false\n }\n\n const name = this.getName(descriptor.value);\n\n if (name == null) {\n return true;\n }\n\n return this.excludedNames.has(name) === false\n }\n\n private getName(value: object) {\n if (value.constructor != null) {\n return value.constructor.name;\n }\n\n return null;\n }\n\n private getPath(info: MethodInfoMetadata, propertyName: string | symbol) {\n\n let parent = info.parent;\n const path = [info.propertyName, propertyName];\n\n while (parent != null) {\n\n path.unshift(parent.propertyName);\n parent = parent.parent;\n }\n\n return path.join(\".\");\n }\n\n protected explore(instance: unknown, onDiscover: (info: MethodInfoMetadata, methodInfo: MethodInfo) => void): void {\n if (!this.isValidObject(instance)) {\n return;\n }\n\n const explore: MethodInfoMetadata[] = [{ instance, propertyName: this.getName(instance) }];\n const visited = new Set<object>();\n\n for (let i = 0; i < explore.length; i++) {\n\n const info = explore[i];\n const item = info.instance;\n\n if (visited.has(item)) {\n continue;\n }\n\n const allKeys = [\n ...Object.getOwnPropertyNames(item),\n ...Object.getOwnPropertySymbols(item),\n ];\n\n for (const key of allKeys) {\n\n const descriptor = Object.getOwnPropertyDescriptor(item, key);\n\n const isCallable = this.isCallableMethod(descriptor, key);\n\n onDiscover(info, {\n name: key,\n isCallable\n });\n\n if (this.canExplore(descriptor) === false) {\n continue;\n }\n\n const path = this.getPath(info, key);\n explore.push({ instance: descriptor.value, parent: info, propertyName: key, path });\n }\n\n visited.add(item);\n }\n }\n\n abstract apply(instance: unknown): void;\n}","import { PerformanceMetrics } from \"../types\";\n\nexport class PerformanceTracker {\n private methodTimings = new Map<string, { startTime: number; nextMethodStartTime?: number }>();\n private operationStartTimes = new Map<string, number>();\n\n startMethodTiming(operationId: string, methodPath: string): number {\n const startTime = performance.now();\n const key = `${operationId}:${methodPath}`;\n\n // Track operation start time for delta calculations\n if (!this.operationStartTimes.has(operationId)) {\n this.operationStartTimes.set(operationId, startTime);\n }\n\n this.methodTimings.set(key, { startTime });\n return startTime;\n }\n\n recordNextMethodStart(operationId: string, methodPath: string): void {\n const key = `${operationId}:${methodPath}`;\n const timing = this.methodTimings.get(key);\n if (timing) {\n timing.nextMethodStartTime = performance.now();\n }\n }\n\n endMethodTiming(operationId: string, methodPath: string): PerformanceMetrics {\n const endTime = performance.now();\n const key = `${operationId}:${methodPath}`;\n const timing = this.methodTimings.get(key);\n\n if (!timing) {\n return { startTime: endTime };\n }\n\n const duration = endTime - timing.startTime;\n const timeToNextCall = timing.nextMethodStartTime ?\n timing.nextMethodStartTime - timing.startTime : undefined;\n\n // Clean up\n this.methodTimings.delete(key);\n\n return {\n startTime: timing.startTime,\n endTime,\n duration,\n nextMethodStartTime: timing.nextMethodStartTime,\n timeToNextCall\n };\n }\n\n formatDuration(milliseconds: number): string {\n if (milliseconds < 1) {\n return `${(milliseconds * 1000).toFixed(1)}μs`;\n } else if (milliseconds < 1000) {\n return `${milliseconds.toFixed(2)}ms`;\n } else {\n return `${(milliseconds / 1000).toFixed(2)}s`;\n }\n }\n\n getDeltaFromOperationStart(operationId: string, currentTime: number): number {\n const operationStartTime = this.operationStartTimes.get(operationId);\n return operationStartTime ? currentTime - operationStartTime : 0;\n }\n\n cleanupOperation(operationId: string): void {\n this.operationStartTimes.delete(operationId);\n }\n}","import { uuid } from \"../../utilities\";\n\nexport class CallTraceManager {\n private activeOperationId: string | null = null;\n private activeCallStack: string[] = [];\n\n startNewOperation(): string {\n const operationId = uuid(8);\n this.activeOperationId = operationId;\n this.activeCallStack = [];\n return operationId;\n }\n\n isNewOperation(): boolean {\n return this.activeOperationId === null;\n }\n\n getActiveOperationId(): string {\n if (!this.activeOperationId) {\n throw new Error('No active operation context');\n }\n return this.activeOperationId;\n }\n\n addMethodToTrace(methodPath: string): string[] {\n if (this.isNewOperation()) {\n this.activeCallStack = [methodPath];\n } else {\n this.activeCallStack.push(methodPath);\n }\n return [...this.activeCallStack];\n }\n\n removeMethodFromTrace(): void {\n if (!this.isNewOperation()) {\n this.activeCallStack.pop();\n }\n }\n\n endOperation(): void {\n this.activeOperationId = null;\n this.activeCallStack = [];\n }\n\n formatMethodPaths(methodPaths: string[]): string[] {\n return methodPaths.map(path => path.replace(/ → /g, '.'));\n }\n\n getCurrentTrace(): string[] {\n return [...this.activeCallStack];\n }\n}","import { stringifyObject } from \"../utilities\";\nimport { Capability } from \"./Capability\";\nimport { PerformanceTracker } from \"./performance/PerformanceTracker\";\nimport { CallTraceManager } from \"./tracing/CallTraceManager\";\nimport { MethodInfoMetadata, MethodInfo } from \"./types\";\nimport { logger } from '../utilities';\n\nexport type PerformanceCapabilityOptions = {\n filter: (methodName: string | symbol, methodInfo: MethodInfo, metadata: MethodInfoMetadata) => boolean\n}\n\nexport class PerformanceCapability extends Capability {\n\n private callTraceManager: CallTraceManager;\n private performanceTracker: PerformanceTracker;\n private filter: (methodName: string | symbol, methodInfo: MethodInfo, metadata: MethodInfoMetadata) => boolean;\n private childDurations: Map<string, number[]> = new Map();\n\n constructor(options?: PerformanceCapabilityOptions) {\n super();\n this.filter = options?.filter ?? (() => true)\n this.callTraceManager = new CallTraceManager();\n this.performanceTracker = new PerformanceTracker();\n }\n\n override apply(instance: unknown): void {\n\n this.explore(instance, (meta, info) => {\n\n if (info.isCallable) {\n const originalMethod = meta.instance[info.name].bind(meta.instance);\n\n meta.instance[info.name] = (...args: any[]) => {\n\n const path = `${meta.path!}.${String(info.name)}()`;\n\n if (this.filter(path, info, meta) === false) {\n return originalMethod(...args);\n }\n\n const isNewOperation = this.callTraceManager.isNewOperation();\n let operationId: string;\n let callTrace: string[];\n let depth: number;\n\n if (isNewOperation) {\n operationId = this.callTraceManager.startNewOperation();\n this.childDurations.set(operationId, []);\n callTrace = this.callTraceManager.addMethodToTrace(path);\n depth = callTrace.length - 1;\n const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);\n\n this.performanceTracker.startMethodTiming(operationId, path);\n\n logger.log(`\\n${'═'.repeat(60)}`);\n logger.log(`▶ ORIGIN [${operationId}] ${path}`);\n if (args.length > 0) {\n logger.log(` Args:`, stringifyObject(args, 4, 0));\n }\n logger.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);\n } else {\n operationId = this.callTraceManager.getActiveOperationId();\n callTrace = this.callTraceManager.addMethodToTrace(path);\n depth = callTrace.length - 1;\n const indent = ' '.repeat(Math.min(depth, 4));\n\n // Track children for this child method too\n const childMethodKey = `${operationId}:${path}`;\n this.childDurations.set(childMethodKey, []);\n\n this.performanceTracker.startMethodTiming(operationId, path);\n\n logger.log(`${indent}└─ CHILD [${operationId}] ${path}`);\n if (args.length > 0) {\n logger.log(`${indent} Args:`, stringifyObject(args, 4, 0));\n }\n }\n\n try {\n return originalMethod(...args);\n } finally {\n const metrics = this.performanceTracker.endMethodTiming(operationId, path);\n const duration = metrics.duration ?? 0;\n const formattedDuration = this.performanceTracker.formatDuration(duration);\n\n if (isNewOperation) {\n const childDurations = this.childDurations.get(operationId) ?? [];\n const totalChildTime = childDurations.reduce((sum, d) => sum + d, 0);\n const formattedTotalChildTime = this.performanceTracker.formatDuration(totalChildTime);\n const overhead = duration - totalChildTime;\n const formattedOverhead = this.performanceTracker.formatDuration(Math.max(0, overhead));\n\n logger.log(`\\n${'═'.repeat(60)}`);\n logger.log(`◀ COMPLETE [${operationId}] ${path}`);\n logger.log(` Total Duration: ${formattedDuration}`);\n if (childDurations.length > 0) {\n logger.log(` Children Duration: ${formattedTotalChildTime} (${childDurations.length} calls)`);\n logger.log(` Overhead: ${formattedOverhead}`);\n }\n logger.log(`${'═'.repeat(60)}\\n`);\n\n this.childDurations.delete(operationId);\n this.performanceTracker.cleanupOperation(operationId);\n this.callTraceManager.endOperation();\n } else {\n const indent = ' '.repeat(Math.min(depth, 4));\n const childMethodKey = `${operationId}:${path}`;\n const childDurations = this.childDurations.get(childMethodKey) ?? [];\n const totalChildTime = childDurations.reduce((sum, d) => sum + d, 0);\n const formattedTotalChildTime = this.performanceTracker.formatDuration(totalChildTime);\n const overhead = duration - totalChildTime;\n const formattedOverhead = this.performanceTracker.formatDuration(Math.max(0, overhead));\n\n logger.log(`${indent} ✓ ${formattedDuration}`);\n if (childDurations.length > 0) {\n logger.log(`${indent} Children: ${formattedTotalChildTime} (${childDurations.length} calls), Overhead: ${formattedOverhead}`);\n }\n\n // Clean up child method tracking\n this.childDurations.delete(childMethodKey);\n\n // Find the parent method and add this duration to its children list\n // The parent is the method one level up in the call trace\n const currentTrace = this.callTraceManager.getCurrentTrace();\n if (currentTrace.length > 1) {\n // Parent is the second-to-last item in the trace (before we remove current)\n const parentPath = currentTrace[currentTrace.length - 2];\n\n // Check if parent is the root operation (trace length 2 means root + this child)\n if (currentTrace.length === 2) {\n // Direct child of root - add to root's children list\n const rootChildDurations = this.childDurations.get(operationId);\n if (rootChildDurations) {\n rootChildDurations.push(duration);\n }\n } else {\n // Nested child - add to parent method's children list\n const parentMethodKey = `${operationId}:${parentPath}`;\n const parentChildDurations = this.childDurations.get(parentMethodKey);\n if (parentChildDurations) {\n parentChildDurations.push(duration);\n }\n }\n }\n }\n\n this.callTraceManager.removeMethodFromTrace();\n }\n }\n }\n });\n }\n}","import { Capability } from \"./Capability\";\nimport { CallTraceManager } from \"./tracing/CallTraceManager\";\nimport { stringifyObject } from \"../utilities/strings\";\nimport { MethodInfo, MethodInfoMetadata } from \"./types\";\n\nexport type TracingCapabilityOptions = {\n filter: (methodName: string | symbol, methodInfo: MethodInfo, metadata: MethodInfoMetadata) => boolean\n}\n\nexport class TracingCapability extends Capability {\n\n private callTraceManager: CallTraceManager;\n private filter: (methodName: string | symbol, methodInfo: MethodInfo, metadata: MethodInfoMetadata) => boolean;\n\n constructor(options?: TracingCapabilityOptions) {\n super();\n this.filter = options?.filter ?? (() => true);\n this.callTraceManager = new CallTraceManager();\n }\n\n override apply(instance: unknown): void {\n\n this.explore(instance, (meta, info) => {\n\n if (info.isCallable) {\n\n const originalMethod = meta.instance[info.name].bind(meta.instance);\n\n meta.instance[info.name] = (...args: any[]) => {\n\n const path = `${meta.path!}.${String(info.name)}()`;\n\n if (this.filter(path, info, meta) === false) {\n return originalMethod(...args);\n }\n\n const isNewOperation = this.callTraceManager.isNewOperation();\n let operationId: string;\n\n if (isNewOperation) {\n operationId = this.callTraceManager.startNewOperation();\n const callTrace = this.callTraceManager.addMethodToTrace(path);\n const formattedCallTrace = this.callTraceManager.formatMethodPaths(callTrace);\n\n console.log(`\\n${'═'.repeat(60)}`);\n console.log(`▶ ORIGIN [${operationId}] ${path}`);\n if (args.length > 0) {\n console.log(` Args:`, stringifyObject(args, 4, 0));\n }\n console.log(` Call Stack: ${formattedCallTrace.join(' → ')}`);\n } else {\n operationId = this.callTraceManager.getActiveOperationId();\n const callTrace = this.callTraceManager.addMethodToTrace(path);\n\n const indent = ' '.repeat(Math.min(callTrace.length - 1, 4));\n console.log(`${indent}└─ CHILD [${operationId}] ${path}`);\n if (args.length > 0) {\n console.log(`${indent} Args:`, stringifyObject(args, 4, 0));\n }\n }\n\n try {\n return originalMethod(...args);\n } finally {\n this.callTraceManager.removeMethodFromTrace();\n\n if (isNewOperation) {\n this.callTraceManager.endOperation();\n }\n }\n }\n }\n\n });\n }\n}","export { Capability } from './Capability';\nexport { PerformanceCapability } from './PerformanceCapability';\nexport { TracingCapability } from './TracingCapability';\nexport * from './types';"],"names":["LOG_LEVELS","RANK","isLogLevel","value","resolveLevel","globalThis","g","process","debug","env","level","rank","setLogLevel","next","Error","getLogLevel","resetLogLevel","isLogLevelEnabled","at","emit","method","args","console","logger","hash","seed","h1","h2","i","ch","Math","fastHash","stringifyObject","obj","maxDepth","currentDepth","undefined","type","String","getFunctionName","stringifyObjectValue","fn","name","getObjectProperties","properties","key","Date","RegExp","Array","stringifyArray","stringifyClassInstance","stringifyPlainObject","arr","items","item","suffix","className","Object","props","isPrimitive","depth","uuid","length","chars","charLength","result","HEX_CHARS","UUID_TEMPLATE","hasCrypto","crypto","hasRandomUUID","uuidv4","uuidv4Fallback","randomBytes","Uint8Array","byteIndex","c","r","Capability","Set","descriptor","info","propertyName","parent","path","instance","onDiscover","explore","visited","allKeys","isCallable","PerformanceTracker","Map","operationId","methodPath","startTime","performance","timing","endTime","duration","timeToNextCall","milliseconds","currentTime","operationStartTime","CallTraceManager","methodPaths","PerformanceCapability","options","meta","originalMethod","isNewOperation","callTrace","formattedCallTrace","indent","childMethodKey","metrics","formattedDuration","childDurations","totalChildTime","sum","d","formattedTotalChildTime","overhead","formattedOverhead","currentTrace","parentPath","rootChildDurations","parentMethodKey","parentChildDurations","TracingCapability"],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GAED,4EAA4E,GACrE,MAAMA,aAAa;IAAC;IAAU;IAAS;IAAQ;IAAQ;CAAQ,CAAU;AAIhF,uDAAuD,GACvD,MAAMC,OAAiC;IACnC,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;AACX;AAEA,MAAMC,aAAa,CAACC,QAChB,OAAOA,UAAU,YAAaH,WAAiC,QAAQ,CAACG;AAE5E;;;;;;;CAOC,GACD,MAAMC,eAAe;IACjB,IAAI,OAAOC,eAAe,aAAa;QACnC,MAAMC,IAAID;QAEV,IAAIH,WAAWI,EAAE,qBAAqB,GAAG;YACrC,OAAOA,EAAE,qBAAqB;QAClC;QAEA,oFAAoF;QACpF,4DAA4D;QAC5D,IAAIA,EAAE,iBAAiB,KAAK,MAAM,OAAO;QACzC,IAAIA,EAAE,iBAAiB,KAAK,OAAO,OAAO;IAC9C;IAEA,wFAAwF;IACxF,wFAAwF;IACxF,qFAAqF;IACrF,8FAA8F;IAC9F,6FAA6F;IAC7F,iFAAiF;IACjF,0DAA0D;IAC1D,IAAI,OAAOC,YAAY,eAAeA,QAAQ,GAAG,IAAI,MAAM;QACvD,IAAIL,WAAWK,QAAQ,GAAG,CAAC,iBAAiB,GAAG;YAC3C,OAAOA,QAAQ,GAAG,CAAC,iBAAiB;QACxC;QAEA,MAAMC,QAAQD,QAAQ,GAAG,CAAC,KAAK;QAC/B,IAAIC,UAAU,aAAaA,UAAU,KAAK,OAAO;QAEjD,MAAMC,MAAMF,YAAoB,EAAE;QAElC,wFAAwF;QACxF,wFAAwF;QACxF,oBAAoB;QACpB,IAAIE,QAAQ,SAAS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ectHandler";
|
|
2
2
|
export declare class CloneHandlerBuilder {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @param useFromPropertyName Emit the STORAGE shape rather than the in-memory shape.
|
|
5
|
+
*
|
|
6
|
+
* A record that has not been read back into memory yet still carries its `from` names, so a
|
|
7
|
+
* cloner generated from in-memory names would read `undefined` for every renamed property and
|
|
8
|
+
* silently drop it. Passing true swaps both the reads and the writes to the storage name, which
|
|
9
|
+
* gives a copier for records in that shape. Everything else about the chain is identical —
|
|
10
|
+
* the same handlers, in the same order, with the same null and Date semantics.
|
|
11
|
+
*/
|
|
12
|
+
build(useFromPropertyName?: boolean): CloneObjectHandler;
|
|
4
13
|
}
|
|
@@ -2,5 +2,8 @@ import { CodeBuilder } from '../../blocks';
|
|
|
2
2
|
import { PropertyInfoHandler } from "../types";
|
|
3
3
|
import { PropertyInfo } from "../../../schema";
|
|
4
4
|
export declare class CloneArrayHandler extends PropertyInfoHandler {
|
|
5
|
+
private readonly useFromPropertyName;
|
|
6
|
+
/** See `CloneValueHandler`. */
|
|
7
|
+
constructor(useFromPropertyName?: boolean);
|
|
5
8
|
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
6
9
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Copies Date properties by value. A reference copy would let a mutation of the
|
|
6
|
+
* clone's Date (e.g. setHours) silently change the source entity.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CloneDateHandler extends PropertyInfoHandler {
|
|
9
|
+
private readonly useFromPropertyName;
|
|
10
|
+
/** See `CloneValueHandler`. */
|
|
11
|
+
constructor(useFromPropertyName?: boolean);
|
|
12
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
13
|
+
}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { CodeBuilder } from '../../blocks';
|
|
2
2
|
import { PropertyInfoHandler } from "../types";
|
|
3
3
|
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* `!== undefined`, not `!= null`.
|
|
6
|
+
*
|
|
7
|
+
* An explicit `null` is a VALUE and has to survive the copy; an absent or `undefined` property is
|
|
8
|
+
* not there and must not be invented. The loose guard conflated the two and dropped every null,
|
|
9
|
+
* which is how a `s.string().nullable()` written as `null` came back as `undefined` from the
|
|
10
|
+
* memory family — see known-defects #66. It was invisible for a long time because the change
|
|
11
|
+
* tracker merges a read into the canonical entity the caller still holds, so the null appeared to
|
|
12
|
+
* survive right up until something read storage without one (a join).
|
|
13
|
+
*/
|
|
4
14
|
export declare class CloneValueHandler extends PropertyInfoHandler {
|
|
15
|
+
private readonly useFromPropertyName;
|
|
16
|
+
/**
|
|
17
|
+
* When true, emit reads and writes under the STORAGE name (`from`) instead of the
|
|
18
|
+
* in-memory name. See `CloneHandlerBuilder.build`.
|
|
19
|
+
*/
|
|
20
|
+
constructor(useFromPropertyName?: boolean);
|
|
5
21
|
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
6
22
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Unmapped computed properties are excluded from comparison — they derive from
|
|
6
|
+
* other properties, which are compared directly.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CompareComputedHandler extends PropertyInfoHandler {
|
|
9
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Functions are excluded from comparison — enrichment assigns a fresh closure
|
|
6
|
+
* per entity, so a reference comparison would report every pair as different.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CompareFunctionHandler extends PropertyInfoHandler {
|
|
9
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Deserializes arrays per element instead of copying the reference:
|
|
6
|
+
*
|
|
7
|
+
* - Date elements are revived from strings (same convention as DeserializeDateHandler).
|
|
8
|
+
* - Everything else is copied with a spread, so the entity shares no references with
|
|
9
|
+
* the storage record.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DeserializeArrayHandler extends PropertyInfoHandler {
|
|
12
|
+
private copyExpression;
|
|
13
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Arrays participate in change tracking: the array itself is wrapped in the tracking
|
|
6
|
+
* proxy (with the root as parent) so in-place mutations — push/splice/index writes —
|
|
7
|
+
* mark the root entity dirty instead of being silently lost on save.
|
|
8
|
+
*/
|
|
9
|
+
export declare class EnableChangeTrackingArrayHandler extends PropertyInfoHandler {
|
|
10
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Arrays participate in change tracking: the array itself is wrapped in the tracking
|
|
6
|
+
* proxy (with the root as parent) so in-place mutations — push/splice/index writes —
|
|
7
|
+
* mark the root entity dirty instead of being silently lost on save.
|
|
8
|
+
*/
|
|
9
|
+
export declare class EnrichmentArrayHandler extends PropertyInfoHandler {
|
|
10
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
export declare class FreezeArrayHandler extends PropertyInfoHandler {
|
|
5
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Hashes array contents via JSON — template interpolation of an array of
|
|
6
|
+
* objects would collapse every value to "[object Object]" and collide.
|
|
7
|
+
*/
|
|
8
|
+
export declare class HashArrayHandler extends PropertyInfoHandler {
|
|
9
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* A file takes no part in the hash that correlates an addition with what came back.
|
|
6
|
+
*
|
|
7
|
+
* The hash exists to match a submitted entity against the row the database echoed, which is
|
|
8
|
+
* why identity values are already excluded: the database assigns them, so they differ on the
|
|
9
|
+
* two sides by design.
|
|
10
|
+
*
|
|
11
|
+
* A file is the same situation one step out. What is submitted is content; what is stored, and
|
|
12
|
+
* echoed, is a reference. Hashing the VALUE produced two different hashes for the same
|
|
13
|
+
* addition and the change tracker reported "Cannot find internal addition" on every save with
|
|
14
|
+
* a file.
|
|
15
|
+
*
|
|
16
|
+
* It contributes a constant rather than nothing at all. The `result` string is created by
|
|
17
|
+
* whichever handler runs first, so a schema whose only non-identity properties are files —
|
|
18
|
+
* an assets row holding an original and a thumbnail, say — would emit no declaration and then
|
|
19
|
+
* return it: `ReferenceError: result is not defined` at the first add. A constant keeps the
|
|
20
|
+
* hash stable across the content-to-reference swap while still declaring the variable.
|
|
21
|
+
*/
|
|
22
|
+
export declare class HashFileHandler extends PropertyInfoHandler {
|
|
23
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Object containers are not hashed directly — their child properties hash
|
|
6
|
+
* individually, which keeps the hash stable across key insertion order.
|
|
7
|
+
*/
|
|
8
|
+
export declare class HashObjectHandler extends PropertyInfoHandler {
|
|
9
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* A transformed property takes no part in the hash that correlates an addition with its echo.
|
|
6
|
+
*
|
|
7
|
+
* The hash matches a submitted entity against the row the database echoed, which is why
|
|
8
|
+
* identity values are already excluded: the database assigns them, so the two sides differ by
|
|
9
|
+
* design.
|
|
10
|
+
*
|
|
11
|
+
* A transform is the same situation. What is submitted is the application value and what is
|
|
12
|
+
* stored is the transformed one, and a ONE-WAY transform — no `from` — never converts back, so
|
|
13
|
+
* the echo legitimately differs and every save reported "Cannot find internal addition". A
|
|
14
|
+
* two-way transform happens to restore the value before the comparison, but relying on that
|
|
15
|
+
* would make correlation depend on whether a caller supplied `from`.
|
|
16
|
+
*
|
|
17
|
+
* It contributes the property NAME rather than nothing, so a schema whose only non-identity
|
|
18
|
+
* properties are transformed still declares the `result` string the generated function
|
|
19
|
+
* returns.
|
|
20
|
+
*/
|
|
21
|
+
export declare class HashTransformHandler extends PropertyInfoHandler {
|
|
22
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
23
|
+
}
|
|
@@ -12,3 +12,4 @@ export { PrepareHandlerBuilder } from './PrepareHandlerBuilder';
|
|
|
12
12
|
export { SerializeHandlerBuilder } from './SerializeHandlerBuilder';
|
|
13
13
|
export { StripHandlerBuilder } from './StripHandlerBuilder';
|
|
14
14
|
export { CompareIdsHandlerBuilder } from './CompareIdsHandlerBuilder';
|
|
15
|
+
export { SetHandlerBuilder } from './SetHandlerBuilder';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Merges an array by copying elements INTO the destination's existing array instead of
|
|
6
|
+
* replacing the reference.
|
|
7
|
+
*
|
|
8
|
+
* The reference matters: a change-tracked entity holds its array wrapped in a tracking
|
|
9
|
+
* proxy, and merge runs paused — a plain `destination.values = source.values` discards
|
|
10
|
+
* that proxy silently, so every in-place mutation made after the entity's first save
|
|
11
|
+
* (afterPersist merges the plugin's echo into the canonical) was no longer tracked and
|
|
12
|
+
* vanished on the next save (defect #12). Copying in place keeps the caller's array
|
|
13
|
+
* reference stable and the proxy installed, and shares no reference with the source.
|
|
14
|
+
*
|
|
15
|
+
* When the destination has no array yet there is nothing to preserve, so the source
|
|
16
|
+
* reference is adopted as-is — same as the primitive copy this replaces.
|
|
17
|
+
*/
|
|
18
|
+
export declare class MergeArrayHandler extends PropertyInfoHandler {
|
|
19
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Object containers are not merged directly — their child properties merge
|
|
6
|
+
* individually and materialize the destination ancestors they need.
|
|
7
|
+
*/
|
|
8
|
+
export declare class MergeObjectHandler extends PropertyInfoHandler {
|
|
9
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Serializes arrays per element instead of copying the reference:
|
|
6
|
+
*
|
|
7
|
+
* - Date elements become ISO strings (same convention as SerializeDateHandler).
|
|
8
|
+
* - Object elements are deep-copied so the storage payload shares no references
|
|
9
|
+
* with the entity.
|
|
10
|
+
* - Primitive elements are copied with a spread.
|
|
11
|
+
*
|
|
12
|
+
* Producing a NEW array also matters for change tracking: tracked entities hold
|
|
13
|
+
* arrays wrapped in a Proxy, which cannot pass a structured-clone boundary
|
|
14
|
+
* (BroadcastChannel.postMessage) — the serialized payload must be plain data.
|
|
15
|
+
*/
|
|
16
|
+
export declare class SerializeArrayHandler extends PropertyInfoHandler {
|
|
17
|
+
private copyExpression;
|
|
18
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
export declare class SerializeComputedHandler extends PropertyInfoHandler {
|
|
5
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema/PropertyInfo";
|
|
4
|
+
export declare class SetComplexHandler extends PropertyInfoHandler {
|
|
5
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Unmapped computed properties never persist — strip removes them along with
|
|
6
|
+
* keys and identities.
|
|
7
|
+
*/
|
|
8
|
+
export declare class StripComputedHandler extends PropertyInfoHandler {
|
|
9
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../blocks';
|
|
2
|
+
import { PropertyInfoHandler } from "../types";
|
|
3
|
+
import { PropertyInfo } from "../../../schema";
|
|
4
|
+
/**
|
|
5
|
+
* Functions never persist — strip removes them along with keys and identities.
|
|
6
|
+
*/
|
|
7
|
+
export declare class StripFunctionHandler extends PropertyInfoHandler {
|
|
8
|
+
handle(property: PropertyInfo<any>, builder: CodeBuilder): CodeBuilder | null;
|
|
9
|
+
}
|