@adaas/a-frame 0.0.23 → 0.1.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/browser/channel.mjs +1 -1
- package/dist/browser/chunk-GOADBDTE.mjs +2 -0
- package/dist/browser/chunk-GOADBDTE.mjs.map +1 -0
- package/dist/browser/chunk-YQJFTBGV.mjs +3 -0
- package/dist/browser/chunk-YQJFTBGV.mjs.map +1 -0
- package/dist/browser/core.d.mts +1 -1
- package/dist/browser/core.mjs +1 -1
- package/dist/browser/core.mjs.map +1 -1
- package/dist/browser/env.mjs +1 -1
- package/dist/browser/storage.mjs +1 -1
- package/dist/node/bundle.cjs +2 -2
- package/dist/node/bundle.mjs +1 -1
- package/dist/node/channel.cjs +14 -14
- package/dist/node/channel.mjs +3 -3
- package/dist/node/chunk-5BKCX2RO.mjs +33 -0
- package/dist/node/chunk-5BKCX2RO.mjs.map +1 -0
- package/dist/node/chunk-6KAGWGTE.mjs +529 -0
- package/dist/node/chunk-6KAGWGTE.mjs.map +1 -0
- package/dist/node/chunk-F46TSY2K.cjs +541 -0
- package/dist/node/chunk-F46TSY2K.cjs.map +1 -0
- package/dist/node/chunk-GRR6NNWY.cjs +688 -0
- package/dist/node/chunk-GRR6NNWY.cjs.map +1 -0
- package/dist/node/chunk-OYC6L5NX.mjs +6 -0
- package/dist/node/chunk-OYC6L5NX.mjs.map +1 -0
- package/dist/node/chunk-R2H234YO.cjs +8 -0
- package/dist/node/chunk-R2H234YO.cjs.map +1 -0
- package/dist/node/chunk-SDKIJDMH.mjs +655 -0
- package/dist/node/chunk-SDKIJDMH.mjs.map +1 -0
- package/dist/node/chunk-XFUF7SDO.cjs +35 -0
- package/dist/node/chunk-XFUF7SDO.cjs.map +1 -0
- package/dist/node/core.cjs +21 -23
- package/dist/node/core.cjs.map +1 -1
- package/dist/node/core.d.mts +1 -1
- package/dist/node/core.d.ts +1 -1
- package/dist/node/core.mjs +18 -20
- package/dist/node/core.mjs.map +1 -1
- package/dist/node/env.cjs +3 -3
- package/dist/node/env.mjs +2 -2
- package/dist/node/storage.cjs +8 -8
- package/dist/node/storage.mjs +3 -3
- package/package.json +2 -2
- package/src/lib/A-Frame/A-Frame.component.env-browser.ts +5 -3
- package/src/lib/A-Frame/A-Frame.component.env-node.ts +13 -14
- package/tests/A-Frame.test.ts +2 -0
package/dist/node/core.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/A-Frame/A-Frame.types.ts","../../src/lib/A-Frame/A-Frame.guard.ts","../../src/lib/A-Frame/A-Frame.error.ts","../../src/lib/A-Frame/decorators/A-FrameDefine.decorator.ts","../../src/lib/A-Frame/decorators/A-FrameNamespace.decorator.ts","../../src/lib/A-Frame/A-Frame.component.ts","../../src/lib/A-Frame/A-Frame.component.env-node.ts"],"names":["A_FrameTargetType","A_TypeGuards","targetClass","source","A_CommonHelper","A_Scope"],"mappings":";;;;;;;;;;;;;;;;;;AAoEO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACH,EAAAA,mBAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,mBAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,mBAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,mBAAA,UAAA,CAAA,GAAW,UAAA;AACX,EAAAA,mBAAA,QAAA,CAAA,GAAS,QAAA;AALD,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA;AC9DL,IAAM,mBAAN,MAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1B,OAAO,gBAAgB,MAAA,EAA+C;AAClE,IAAA,OAAO,YAAA,CAAa,mBAAA,CAAoB,MAAM,CAAA,IACvC,YAAA,CAAa,sBAAA,CAAuB,MAAM,CAAA,IAC1C,YAAA,CAAa,sBAAA,CAAuB,MAAM,CAAA,IAC1C,aAAa,qBAAA,CAAsB,MAAM,CAA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CAAA,CAAA;AAxBH,IAAM,OAAA,GAAN","file":"core.mjs","sourcesContent":["import { A_Component, A_Container, A_Entity, A_Fragment, A_TYPES__Component_Constructor, A_TYPES__Container_Constructor, A_TYPES__Entity_Constructor, A_TYPES__Fragment_Constructor, A_TYPES__Required } from \"@adaas/a-concept\"\nimport { A_FrameNamespace } from \"../A-FrameNamespace\"\n\n\nexport type A_FrameOptions = {\n namespace?: string\n description?: string\n}\n\n\nexport type A_FrameDefineOptions<T extends Record<string, any> = Record<string, any>> = {\n /**\n * The description of the Method or Class to be indexed. Uses for the better explanation and retrieval strategy \n */\n description?: string,\n /**\n * Define Namespace to separate and group together related components, entities and containers.\n * \n * [!] Namespace is a hard separation between groups.\n */\n namespace?: string | A_FrameNamespace\n /***\n * Optional parameters that can be used to store any additional information about the component, entity or container.\n * This information can be used for the better retrieval strategy or for the better explanation of the component, entity or container.\n */\n metadata?: T,\n /**\n * Can add a custom way of explaining the component, entity or container, so it can be used in the better retrieval strategy.\n */\n examples?: string[]\n}\n\n\nexport type A_FrameMetaTarget = A_TYPES__Container_Constructor\n | A_TYPES__Entity_Constructor\n | A_TYPES__Component_Constructor\n | A_TYPES__Fragment_Constructor\n\n\n// ===========================================================================\n// --------------------------- Decorator Types -------------------------------\n// ===========================================================================\n// ---------------------------------------------------------------------------\n// -------------------- A-Frame Index Decorator Types-------------------------\n// ---------------------------------------------------------------------------\n/**\n * Indicates a type of Feature Define decorator\n */\nexport type A_FrameDecoratorDescriptor =\n TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n\n\n/**\n * Describes a target where Feature Define decorator can be applied\n * \n * [!] The feature can be defined on Container, Entity, Component or Command\n */\nexport type A_FrameDecoratorTarget = A_FrameMetaTarget\n | A_Component\n | A_Container\n | A_Entity\n | A_Fragment\n/**\n * Targets types that can be indexed\n */\nexport enum A_FrameTargetType {\n COMPONENT = 'component',\n ENTITY = 'entity',\n CONTAINER = 'container',\n FRAGMENT = 'fragment',\n METHOD = 'method'\n}\n\n/**\n * A type of Meta information stored by Index decorator\n * This information is used by A-Context to build a proper index structure\n */\nexport type A_FrameDecoratorMeta = {\n /**\n * Component name\n */\n name: string,\n /**\n * Component description\n */\n description?: string,\n /**\n * Type of the component\n */\n type: A_FrameTargetType,\n /**\n * Namespace for the component\n */\n namespace?: string | A_FrameNamespace\n /**\n * Constructor reference\n */\n constructor: A_FrameDecoratorTarget\n}\n\n\n// ---------------------------------------------------------------------------\n// -------------------- A-Frame Index Decorator Types-------------------------\n// ---------------------------------------------------------------------------\n/**\n * Indicates a type of Feature Define decorator\n */\nexport type A_FrameNamespaceDecoratorDescriptor =\n TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n\n\n/**\n * Describes a target where Feature Define decorator can be applied\n * \n * [!] The feature can be defined on Container, Entity, Component or Command\n */\nexport type A_FrameNamespaceDecoratorTarget = A_Container\n | A_Entity\n | A_Component\n | A_Fragment\n | A_TYPES__Fragment_Constructor\n | A_TYPES__Component_Constructor\n | A_TYPES__Container_Constructor\n | A_TYPES__Entity_Constructor\n\n\n\n\n// ---------------------------------------------------------------------------\n// ------------- A-Frame Index Configurations Meta Types----------------------\n// ---------------------------------------------------------------------------\n\n\nexport type A_FrameIndexMetaType = {\n namespaces: string,\n descriptions: string,\n type: string,\n name: string,\n methods: Map<string, A_FrameIndexMetaMethodMeta>\n}\n\n\nexport type A_FrameIndexMetaMethodMeta = {\n name: string,\n description?: string,\n methodName: string\n}\n\n\n\n\nexport type A_FrameNamespaceOptions = {\n /**\n * Must have UNIQUE name of the Namespace. This is used for the indexing and retrieval strategy. It should be descriptive and concise.\n */\n name: string,\n /**\n * The description of the Namespace to be indexed. Uses for the better explanation and retrieval strategy\n */\n description?: string,\n}","import { A_CommonHelper, A_TypeGuards } from \"@adaas/a-concept\";\nimport { A_FrameDecoratorTarget, A_FrameMetaTarget } from \"./A-Frame.types\";\nimport { A_FrameIndexTarget } from \"../A-FrameIndex/A-FrameIndex.types\";\n\n\n\nexport class A_FrameTypeGuard {\n /**\n * Determines if the target is an allowed type for indexing\n * \n * @param target \n * @returns \n */\n static isAllowedTarget(target: any): target is A_FrameDecoratorTarget {\n return A_TypeGuards.isEntityConstructor(target)\n || A_TypeGuards.isComponentConstructor(target)\n || A_TypeGuards.isContainerConstructor(target)\n || A_TypeGuards.isFragmentConstructor(target)\n || A_TypeGuards.isComponentInstance(target)\n || A_TypeGuards.isContainerInstance(target)\n || A_TypeGuards.isEntityInstance(target)\n || A_TypeGuards.isFragmentInstance(target);\n }\n\n\n\n static getTargetName(target: A_FrameDecoratorTarget): string {\n return A_CommonHelper.getComponentName(target);\n }\n\n\n static getTargetConstructor(target: A_FrameDecoratorTarget): A_FrameIndexTarget {\n return typeof target === 'function' ? target : target.constructor as A_FrameIndexTarget;\n }\n\n\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\nexport class A_FrameError extends A_Error {\n\n static readonly InvalidTarget = 'A-Frame Index Invalid Target Error';\n\n static readonly InvalidConfiguration = 'A-Frame Index Invalid Configuration Error';\n\n static readonly IndexDefinitionError = 'A-Frame Index Definition Error';\n static readonly IndexMetadataError = 'A-Frame Index Metadata Error';\n static readonly IndexRegistryError = 'A-Frame Index Registry Error';\n static readonly IndexComponentNotFoundError = 'A-Frame Index Component Not Found Error';\n}","import { A_CommonHelper, A_Context, A_Meta, A_TypeGuards } from \"@adaas/a-concept\";\nimport { A_FrameDecoratorTarget, A_FrameTargetType, A_FrameDecoratorDescriptor, A_FrameMetaTarget, A_FrameDefineOptions } from \"../A-Frame.types\";\nimport { A_FrameTypeGuard } from \"../A-Frame.guard\";\nimport { A_FrameError } from \"../A-Frame.error\";\nimport { A_FrameIndex } from \"@adaas/a-frame/index\";\nimport { A_FrameDefinition } from \"@adaas/a-frame/definition\";\nimport { A_FrameNamespace } from \"@adaas/a-frame/namespace\";\n\nexport function A_FrameDefineDecorator(\n config: A_FrameDefineOptions\n) {\n return function (\n target: A_FrameDecoratorTarget,\n propertyKey?: string | symbol,\n descriptor?: A_FrameDecoratorDescriptor\n ): any {\n let componentType: A_FrameTargetType;\n\n switch (true) {\n case !!propertyKey && !!descriptor:\n componentType = A_FrameTargetType.METHOD;\n break;\n case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n componentType = A_FrameTargetType.COMPONENT;\n break;\n case A_TypeGuards.isContainerConstructor(target) || A_TypeGuards.isContainerInstance(target):\n componentType = A_FrameTargetType.CONTAINER;\n break;\n case A_TypeGuards.isEntityConstructor(target) || A_TypeGuards.isEntityInstance(target):\n componentType = A_FrameTargetType.ENTITY;\n break;\n case A_TypeGuards.isFragmentConstructor(target) || A_TypeGuards.isFragmentInstance(target):\n componentType = A_FrameTargetType.FRAGMENT;\n break;\n default:\n throw new A_FrameError(\n A_FrameError.InvalidTarget,\n `@A_Frame.Define decorator cannot be applied to the target.`\n );\n }\n const namespace = config.namespace\n ? config.namespace instanceof A_FrameNamespace\n ? config.namespace\n : A_FrameIndex.getNamespace(config.namespace) || new A_FrameNamespace({\n name: config.namespace,\n })\n : A_FrameIndex.getDefaultNamespace();\n\n\n // Handle method decorator case\n if (!!propertyKey && !!descriptor) {\n // For methods, target is the class prototype\n const targetClass = target.constructor as A_FrameMetaTarget;\n const methodName = String(propertyKey);\n\n const source = (descriptor.value as Function).toString();\n\n // Add to methods array\n A_FrameIndex.addDefinition(new A_FrameDefinition({\n name: methodName,\n dependency: targetClass.name,\n description: config.description,\n source: source,\n metadata: config.metadata,\n type: A_FrameTargetType.METHOD,\n namespace: namespace\n }));\n\n return descriptor;\n }\n\n // Handle class decorator case\n if (!A_FrameTypeGuard.isAllowedTarget(target)) {\n throw new A_FrameError(\n A_FrameError.InvalidTarget,\n `@A_Frame.${componentType} decorator can only be applied to allowed targets.`\n );\n }\n\n // for error messages\n const componentName = A_CommonHelper.getComponentName(target);\n\n const targetClass = A_FrameTypeGuard.getTargetConstructor(target);\n\n // Check for pending namespace and description from other decorators\n const source = target.toString();\n\n A_FrameIndex.addDefinition(new A_FrameDefinition({\n name: componentName,\n description: config.description,\n dependency: targetClass.name,\n source: source,\n metadata: config.metadata,\n type: componentType,\n namespace: namespace\n }));\n\n return target;\n\n };\n}\n\n\n\n","import { A_CommonHelper, A_Context, A_Meta, A_TypeGuards } from \"@adaas/a-concept\";\nimport { A_FrameDecoratorTarget, A_FrameTargetType, A_FrameDecoratorDescriptor, A_FrameMetaTarget, A_FrameNamespaceOptions } from \"../A-Frame.types\";\nimport { A_FrameError } from \"../A-Frame.error\";\nimport { A_FrameIndex } from \"@adaas/a-frame/index\";\nimport { A_FrameNamespace } from \"@adaas/a-frame/namespace\";\n\nexport function A_FrameNamespaceDecorator(\n config: Partial<A_FrameNamespaceOptions> = {}\n) {\n return function (\n target: A_FrameDecoratorTarget,\n propertyKey?: string | symbol,\n descriptor?: A_FrameDecoratorDescriptor\n ): any {\n\n if (!config.name)\n throw new A_FrameError(\n A_FrameError.InvalidConfiguration,\n `@A_Frame.Namespace decorator requires a name in the configuration.`\n );\n\n const namespace = new A_FrameNamespace({\n name: config.name,\n description: config.description,\n });\n\n\n A_FrameIndex.addNamespace(namespace);\n };\n}\n\n\n\n","import { A_Component, A_Scope, A_TYPES__A_DependencyInjectable, A_TYPES__Component_Constructor, A_TYPES__Ctor, A_TYPES__Fragment_Constructor } from \"@adaas/a-concept\";\nimport { A_FrameDefineOptions, A_FrameNamespaceOptions } from \"./A-Frame.types\";\nimport { A_FrameDefineDecorator } from \"./decorators/A-FrameDefine.decorator\";\nimport { A_FrameNamespaceDecorator } from \"./decorators/A-FrameNamespace.decorator\";\n\n\n\nexport class A_FrameBase extends A_Component {\n /**\n * Primary Decorator to define and index components, containers, entities, fragments and methods in the A-Frame Index structure\n * \n * Those components will participate in AI indexing and retrieval strategy, so they can be used in the better way to build new features and components.\n * \n * @param options \n * @returns \n */\n static Define(options: A_FrameDefineOptions) {\n return A_FrameDefineDecorator(options) as ClassDecorator & MethodDecorator;\n\n }\n /**\n * Allows to define a namespace for grouping related components, containers, entities, fragments and methods together in the A-Frame Index structure. This is useful for better organization and retrieval strategy.\n * \n * @param options \n * @returns \n */\n static NameSpace(options: A_FrameNamespaceOptions) {\n return A_FrameNamespaceDecorator(options) as ClassDecorator & MethodDecorator;\n }\n\n\n\n /**\n * Default per-instance dependencies registered on first build. The blob\n * store is intentionally omitted here — the user is expected to seed and\n * register `A_FrameBrowserStorageBlobs` themselves (typically via\n * `A_FrameBrowserStorageBlobs.fromBundle(bundle)` before `concept.load()`).\n * If they don't, `A_FrameBrowserStorageProvider.onLoad()` falls back to the\n * empty singleton.\n */\n get package(): Array<{ ctor: A_TYPES__Component_Constructor<any> | A_TYPES__Fragment_Constructor<any>; instance: any }> {\n return [\n // { ctor: A_FrameContext, instance: new A_FrameContext() },\n // { ctor: A_FrameEnv, instance: new A_FrameEnv() },\n // { ctor: A_FrameStorageCodec, instance: new A_FrameStorageCodec() },\n // { ctor: A_FrameBrowserStorageProvider, instance: A_FrameBrowserStorageProvider },\n // { ctor: A_FrameLogger, instance: new A_FrameLogger() },\n ];\n }\n\n\n protected packDependency<T extends A_TYPES__A_DependencyInjectable>(\n scope: A_Scope,\n target: A_TYPES__Ctor<T> | T,\n def: A_TYPES__Ctor<T> | T,\n ) {\n const existing = scope.resolve(target as any);\n if (!existing) scope.register(def);\n }\n\n\n}","import { A_Concept, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_FrameBase } from \"./A-Frame.component\";\nimport { A_FrameIndex } from \"../A-FrameIndex\";\nimport { A_FrameStorage } from \"../A-FrameStorage/A-FrameStorage.component\";\nimport { A_FrameChannel } from \"../A-FrameChannel/A-FrameChannel.component\";\nimport { A_FrameContext } from \"./A-Frame.context\";\nimport { A_FrameNodeChannel } from \"../A-FrameChannel/A-FrameChannel.component.env-node\";\nimport { A_FrameNodeStorage } from \"../A-FrameStorage/node/A-FrameNodeStorage.component\";\nimport { A_FrameEnv } from \"../A-FrameEnv/A-FrameEnv.fragment.env-node\";\nimport { A_FrameStorageCodec } from \"../A-FrameStorage/A-FrameStorage.codec\";\nimport { A_FrameCrypto } from \"../A-FrameCrypto/A-FrameCrypto.component.env-node\";\nimport { A_FrameLogger } from \"../A-FrameLogger/A-FrameLogger.component.env-node\";\n\n\n\nexport class A_Frame extends A_FrameBase {\n\n @A_Concept.Load()\n async injectDependencies(\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n console.log(\"A_Frame injecting dependencies...\");\n\n const index = new A_FrameIndex();\n index.inherit(scope);\n\n scope.register(index);\n scope.register(new A_FrameEnv());\n scope.register(new A_FrameStorageCodec());\n scope.register(A_FrameNodeStorage)\n scope.register(A_FrameNodeChannel);\n scope.register(A_FrameCrypto)\n scope.register(new A_FrameLogger());\n scope.register(A_Frame);\n scope.register(new A_FrameContext());\n }\n\n\n @A_Concept.Load()\n async load(\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_FrameIndex) index: A_FrameIndex,\n @A_Inject(A_FrameStorage) storage: A_FrameStorage,\n @A_Inject(A_FrameContext) context: A_FrameContext,\n @A_Inject(A_FrameChannel) channel: A_FrameChannel,\n @A_Inject(A_FrameEnv) env: A_FrameEnv,\n ) {\n // 1. Authenticate — required before any storage or embedding operations\n const credentials = await channel.getCredentials();\n context.setCredentials(credentials);\n\n const definedNameSpaces = index.listNamespaces();\n const definedDefinitions = index.listDefinitions();\n\n // 2. Hydrate all from storage in parallel.\n // Storage load only calls fromJSON when hash AND aFrameServerVersion match,\n // so items with a stale/missing cache remain un-embedded (isEmbed === false).\n await Promise.all([\n ...definedNameSpaces.map(ns => ns.load()),\n ...definedDefinitions.map(def => def.load()),\n ]);\n\n // 3. Skip embedding API calls entirely when sync is disabled\n if (!env.A_FRAME_SYNC) return;\n\n // 4. Re-embed and persist items whose cache is missing or stale\n const namespacesNeedEmbed = definedNameSpaces.filter(ns => !ns.isEmbed\n || (ns.aFrameServerVersion !== context.serverVersion)\n || (ns.aFrameVersion !== env.A_FRAME_VERSION) // re-embed if the client version has changed since last embed, as it may affect embedding results\n );\n const definitionsNeedEmbed = definedDefinitions.filter(def => !def.isEmbed\n || (def.aFrameServerVersion !== context.serverVersion)\n || (def.aFrameVersion !== env.A_FRAME_VERSION) // re-embed if the client version has changed since last embed, as it may affect embedding results\n );\n\n for (const batch of this.chunkArray(namespacesNeedEmbed, 10)) {\n // Embed in parallel — each namespace hits its own API call independently\n await Promise.all(batch.map(ns => ns.embed()));\n // Save sequentially — all namespaces write to the same __namespaces.aframe file;\n // parallel writes would race and the last writer would overwrite the others\n for (const ns of batch) {\n await ns.save();\n }\n }\n\n for (const batch of this.chunkArray(definitionsNeedEmbed, 10)) {\n // Embed in parallel — each definition hits its own API call independently\n await Promise.all(batch.map(def => def.embed()));\n // Save sequentially within a namespace — definitions in the same namespace share\n // one file; parallel writes would race and overwrite each other's records\n for (const def of batch) {\n await def.save();\n }\n }\n }\n\n\n chunkArray<T>(array: T[], size: number): T[][] {\n const result: T[][] = [];\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/A-Frame/A-Frame.types.ts","../../src/lib/A-Frame/A-Frame.guard.ts","../../src/lib/A-Frame/A-Frame.error.ts","../../src/lib/A-Frame/decorators/A-FrameDefine.decorator.ts","../../src/lib/A-Frame/decorators/A-FrameNamespace.decorator.ts","../../src/lib/A-Frame/A-Frame.component.ts","../../src/lib/A-Frame/A-Frame.component.env-node.ts"],"names":["A_FrameTargetType","A_TypeGuards","targetClass","source","A_CommonHelper","A_Context","A_Scope"],"mappings":";;;;;;;;;;;;;;;;;;AAoEO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACH,EAAA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AAM,MAAA,EAAQ,KAAK,IAAA,EAAM;AACzC,MAAA,MAAA,CAAO,KAAK,KAAA,CAAM,KAAA,CAAM,CAAA,EAAG,CAAA,GAAI,IAAI,CAAC,CAAA;AAAA,IACxC;AACA,IAAA,OAAO,MAAA;AAAA,EACX;AAEJ,CAAA;AAtFU,eAAA,CAAA;AAAA,EADL,UAAU,IAAA;AAAK,CAAA,EAFP,QAAA,CAGH,SAAA,EAAA,oBAAA,EAAA,CAAA,CAAA;AAoBA,eAAA,CAAA;AAAA,EADL,UAAU,IAAA,EAAK;AAAA,EAEX,4BAASC,OAAO,CAAA,CAAA;AAAA,EAChB,4BAAS,YAAY,CAAA,CAAA;AAAA,EACrB,4BAAS,cAAc,CAAA,CAAA;AAAA,EACvB,4BAAS,cAAc,CAAA,CAAA;AAAA,EACvB,4BAAS,cAAc,CAAA,CAAA;AAAA,EACvB,4BAAS,UAAU,CAAA;AAAA,CAAA,EA7Bf,QAAA,CAuBH,SAAA,EAAA,MAAA,EAAA,CAAA,CAAA;AAvBH,IAAM,OAAA,GAAN","file":"core.mjs","sourcesContent":["import { A_Component, A_Container, A_Entity, A_Fragment, A_TYPES__Component_Constructor, A_TYPES__Container_Constructor, A_TYPES__Entity_Constructor, A_TYPES__Fragment_Constructor, A_TYPES__Required } from \"@adaas/a-concept\"\nimport { A_FrameNamespace } from \"../A-FrameNamespace\"\n\n\nexport type A_FrameOptions = {\n namespace?: string\n description?: string\n}\n\n\nexport type A_FrameDefineOptions<T extends Record<string, any> = Record<string, any>> = {\n /**\n * The description of the Method or Class to be indexed. Uses for the better explanation and retrieval strategy \n */\n description?: string,\n /**\n * Define Namespace to separate and group together related components, entities and containers.\n * \n * [!] Namespace is a hard separation between groups.\n */\n namespace?: string | A_FrameNamespace\n /***\n * Optional parameters that can be used to store any additional information about the component, entity or container.\n * This information can be used for the better retrieval strategy or for the better explanation of the component, entity or container.\n */\n metadata?: T,\n /**\n * Can add a custom way of explaining the component, entity or container, so it can be used in the better retrieval strategy.\n */\n examples?: string[]\n}\n\n\nexport type A_FrameMetaTarget = A_TYPES__Container_Constructor\n | A_TYPES__Entity_Constructor\n | A_TYPES__Component_Constructor\n | A_TYPES__Fragment_Constructor\n\n\n// ===========================================================================\n// --------------------------- Decorator Types -------------------------------\n// ===========================================================================\n// ---------------------------------------------------------------------------\n// -------------------- A-Frame Index Decorator Types-------------------------\n// ---------------------------------------------------------------------------\n/**\n * Indicates a type of Feature Define decorator\n */\nexport type A_FrameDecoratorDescriptor =\n TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n\n\n/**\n * Describes a target where Feature Define decorator can be applied\n * \n * [!] The feature can be defined on Container, Entity, Component or Command\n */\nexport type A_FrameDecoratorTarget = A_FrameMetaTarget\n | A_Component\n | A_Container\n | A_Entity\n | A_Fragment\n/**\n * Targets types that can be indexed\n */\nexport enum A_FrameTargetType {\n COMPONENT = 'component',\n ENTITY = 'entity',\n CONTAINER = 'container',\n FRAGMENT = 'fragment',\n METHOD = 'method'\n}\n\n/**\n * A type of Meta information stored by Index decorator\n * This information is used by A-Context to build a proper index structure\n */\nexport type A_FrameDecoratorMeta = {\n /**\n * Component name\n */\n name: string,\n /**\n * Component description\n */\n description?: string,\n /**\n * Type of the component\n */\n type: A_FrameTargetType,\n /**\n * Namespace for the component\n */\n namespace?: string | A_FrameNamespace\n /**\n * Constructor reference\n */\n constructor: A_FrameDecoratorTarget\n}\n\n\n// ---------------------------------------------------------------------------\n// -------------------- A-Frame Index Decorator Types-------------------------\n// ---------------------------------------------------------------------------\n/**\n * Indicates a type of Feature Define decorator\n */\nexport type A_FrameNamespaceDecoratorDescriptor =\n TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n\n\n/**\n * Describes a target where Feature Define decorator can be applied\n * \n * [!] The feature can be defined on Container, Entity, Component or Command\n */\nexport type A_FrameNamespaceDecoratorTarget = A_Container\n | A_Entity\n | A_Component\n | A_Fragment\n | A_TYPES__Fragment_Constructor\n | A_TYPES__Component_Constructor\n | A_TYPES__Container_Constructor\n | A_TYPES__Entity_Constructor\n\n\n\n\n// ---------------------------------------------------------------------------\n// ------------- A-Frame Index Configurations Meta Types----------------------\n// ---------------------------------------------------------------------------\n\n\nexport type A_FrameIndexMetaType = {\n namespaces: string,\n descriptions: string,\n type: string,\n name: string,\n methods: Map<string, A_FrameIndexMetaMethodMeta>\n}\n\n\nexport type A_FrameIndexMetaMethodMeta = {\n name: string,\n description?: string,\n methodName: string\n}\n\n\n\n\nexport type A_FrameNamespaceOptions = {\n /**\n * Must have UNIQUE name of the Namespace. This is used for the indexing and retrieval strategy. It should be descriptive and concise.\n */\n name: string,\n /**\n * The description of the Namespace to be indexed. Uses for the better explanation and retrieval strategy\n */\n description?: string,\n}","import { A_CommonHelper, A_TypeGuards } from \"@adaas/a-concept\";\nimport { A_FrameDecoratorTarget, A_FrameMetaTarget } from \"./A-Frame.types\";\nimport { A_FrameIndexTarget } from \"../A-FrameIndex/A-FrameIndex.types\";\n\n\n\nexport class A_FrameTypeGuard {\n /**\n * Determines if the target is an allowed type for indexing\n * \n * @param target \n * @returns \n */\n static isAllowedTarget(target: any): target is A_FrameDecoratorTarget {\n return A_TypeGuards.isEntityConstructor(target)\n || A_TypeGuards.isComponentConstructor(target)\n || A_TypeGuards.isContainerConstructor(target)\n || A_TypeGuards.isFragmentConstructor(target)\n || A_TypeGuards.isComponentInstance(target)\n || A_TypeGuards.isContainerInstance(target)\n || A_TypeGuards.isEntityInstance(target)\n || A_TypeGuards.isFragmentInstance(target);\n }\n\n\n\n static getTargetName(target: A_FrameDecoratorTarget): string {\n return A_CommonHelper.getComponentName(target);\n }\n\n\n static getTargetConstructor(target: A_FrameDecoratorTarget): A_FrameIndexTarget {\n return typeof target === 'function' ? target : target.constructor as A_FrameIndexTarget;\n }\n\n\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\nexport class A_FrameError extends A_Error {\n\n static readonly InvalidTarget = 'A-Frame Index Invalid Target Error';\n\n static readonly InvalidConfiguration = 'A-Frame Index Invalid Configuration Error';\n\n static readonly IndexDefinitionError = 'A-Frame Index Definition Error';\n static readonly IndexMetadataError = 'A-Frame Index Metadata Error';\n static readonly IndexRegistryError = 'A-Frame Index Registry Error';\n static readonly IndexComponentNotFoundError = 'A-Frame Index Component Not Found Error';\n}","import { A_CommonHelper, A_Context, A_Meta, A_TypeGuards } from \"@adaas/a-concept\";\nimport { A_FrameDecoratorTarget, A_FrameTargetType, A_FrameDecoratorDescriptor, A_FrameMetaTarget, A_FrameDefineOptions } from \"../A-Frame.types\";\nimport { A_FrameTypeGuard } from \"../A-Frame.guard\";\nimport { A_FrameError } from \"../A-Frame.error\";\nimport { A_FrameIndex } from \"@adaas/a-frame/index\";\nimport { A_FrameDefinition } from \"@adaas/a-frame/definition\";\nimport { A_FrameNamespace } from \"@adaas/a-frame/namespace\";\n\nexport function A_FrameDefineDecorator(\n config: A_FrameDefineOptions\n) {\n return function (\n target: A_FrameDecoratorTarget,\n propertyKey?: string | symbol,\n descriptor?: A_FrameDecoratorDescriptor\n ): any {\n let componentType: A_FrameTargetType;\n\n switch (true) {\n case !!propertyKey && !!descriptor:\n componentType = A_FrameTargetType.METHOD;\n break;\n case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n componentType = A_FrameTargetType.COMPONENT;\n break;\n case A_TypeGuards.isContainerConstructor(target) || A_TypeGuards.isContainerInstance(target):\n componentType = A_FrameTargetType.CONTAINER;\n break;\n case A_TypeGuards.isEntityConstructor(target) || A_TypeGuards.isEntityInstance(target):\n componentType = A_FrameTargetType.ENTITY;\n break;\n case A_TypeGuards.isFragmentConstructor(target) || A_TypeGuards.isFragmentInstance(target):\n componentType = A_FrameTargetType.FRAGMENT;\n break;\n default:\n throw new A_FrameError(\n A_FrameError.InvalidTarget,\n `@A_Frame.Define decorator cannot be applied to the target.`\n );\n }\n const namespace = config.namespace\n ? config.namespace instanceof A_FrameNamespace\n ? config.namespace\n : A_FrameIndex.getNamespace(config.namespace) || new A_FrameNamespace({\n name: config.namespace,\n })\n : A_FrameIndex.getDefaultNamespace();\n\n\n // Handle method decorator case\n if (!!propertyKey && !!descriptor) {\n // For methods, target is the class prototype\n const targetClass = target.constructor as A_FrameMetaTarget;\n const methodName = String(propertyKey);\n\n const source = (descriptor.value as Function).toString();\n\n // Add to methods array\n A_FrameIndex.addDefinition(new A_FrameDefinition({\n name: methodName,\n dependency: targetClass.name,\n description: config.description,\n source: source,\n metadata: config.metadata,\n type: A_FrameTargetType.METHOD,\n namespace: namespace\n }));\n\n return descriptor;\n }\n\n // Handle class decorator case\n if (!A_FrameTypeGuard.isAllowedTarget(target)) {\n throw new A_FrameError(\n A_FrameError.InvalidTarget,\n `@A_Frame.${componentType} decorator can only be applied to allowed targets.`\n );\n }\n\n // for error messages\n const componentName = A_CommonHelper.getComponentName(target);\n\n const targetClass = A_FrameTypeGuard.getTargetConstructor(target);\n\n // Check for pending namespace and description from other decorators\n const source = target.toString();\n\n A_FrameIndex.addDefinition(new A_FrameDefinition({\n name: componentName,\n description: config.description,\n dependency: targetClass.name,\n source: source,\n metadata: config.metadata,\n type: componentType,\n namespace: namespace\n }));\n\n return target;\n\n };\n}\n\n\n\n","import { A_CommonHelper, A_Context, A_Meta, A_TypeGuards } from \"@adaas/a-concept\";\nimport { A_FrameDecoratorTarget, A_FrameTargetType, A_FrameDecoratorDescriptor, A_FrameMetaTarget, A_FrameNamespaceOptions } from \"../A-Frame.types\";\nimport { A_FrameError } from \"../A-Frame.error\";\nimport { A_FrameIndex } from \"@adaas/a-frame/index\";\nimport { A_FrameNamespace } from \"@adaas/a-frame/namespace\";\n\nexport function A_FrameNamespaceDecorator(\n config: Partial<A_FrameNamespaceOptions> = {}\n) {\n return function (\n target: A_FrameDecoratorTarget,\n propertyKey?: string | symbol,\n descriptor?: A_FrameDecoratorDescriptor\n ): any {\n\n if (!config.name)\n throw new A_FrameError(\n A_FrameError.InvalidConfiguration,\n `@A_Frame.Namespace decorator requires a name in the configuration.`\n );\n\n const namespace = new A_FrameNamespace({\n name: config.name,\n description: config.description,\n });\n\n\n A_FrameIndex.addNamespace(namespace);\n };\n}\n\n\n\n","import { A_Component, A_Scope, A_TYPES__A_DependencyInjectable, A_TYPES__Component_Constructor, A_TYPES__Ctor, A_TYPES__Fragment_Constructor } from \"@adaas/a-concept\";\nimport { A_FrameDefineOptions, A_FrameNamespaceOptions } from \"./A-Frame.types\";\nimport { A_FrameDefineDecorator } from \"./decorators/A-FrameDefine.decorator\";\nimport { A_FrameNamespaceDecorator } from \"./decorators/A-FrameNamespace.decorator\";\n\n\n\nexport class A_FrameBase extends A_Component {\n /**\n * Primary Decorator to define and index components, containers, entities, fragments and methods in the A-Frame Index structure\n * \n * Those components will participate in AI indexing and retrieval strategy, so they can be used in the better way to build new features and components.\n * \n * @param options \n * @returns \n */\n static Define(options: A_FrameDefineOptions) {\n return A_FrameDefineDecorator(options) as ClassDecorator & MethodDecorator;\n\n }\n /**\n * Allows to define a namespace for grouping related components, containers, entities, fragments and methods together in the A-Frame Index structure. This is useful for better organization and retrieval strategy.\n * \n * @param options \n * @returns \n */\n static NameSpace(options: A_FrameNamespaceOptions) {\n return A_FrameNamespaceDecorator(options) as ClassDecorator & MethodDecorator;\n }\n\n\n\n /**\n * Default per-instance dependencies registered on first build. The blob\n * store is intentionally omitted here — the user is expected to seed and\n * register `A_FrameBrowserStorageBlobs` themselves (typically via\n * `A_FrameBrowserStorageBlobs.fromBundle(bundle)` before `concept.load()`).\n * If they don't, `A_FrameBrowserStorageProvider.onLoad()` falls back to the\n * empty singleton.\n */\n get package(): Array<{ ctor: A_TYPES__Component_Constructor<any> | A_TYPES__Fragment_Constructor<any>; instance: any }> {\n return [\n // { ctor: A_FrameContext, instance: new A_FrameContext() },\n // { ctor: A_FrameEnv, instance: new A_FrameEnv() },\n // { ctor: A_FrameStorageCodec, instance: new A_FrameStorageCodec() },\n // { ctor: A_FrameBrowserStorageProvider, instance: A_FrameBrowserStorageProvider },\n // { ctor: A_FrameLogger, instance: new A_FrameLogger() },\n ];\n }\n\n\n protected packDependency<T extends A_TYPES__A_DependencyInjectable>(\n scope: A_Scope,\n target: A_TYPES__Ctor<T> | T,\n def: A_TYPES__Ctor<T> | T,\n ) {\n const existing = scope.resolve(target as any);\n if (!existing) scope.register(def);\n }\n\n\n}","import { A_Concept, A_Context, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_FrameBase } from \"./A-Frame.component\";\nimport { A_FrameIndex } from \"../A-FrameIndex\";\nimport { A_FrameStorage } from \"../A-FrameStorage/A-FrameStorage.component\";\nimport { A_FrameChannel } from \"../A-FrameChannel/A-FrameChannel.component\";\nimport { A_FrameContext } from \"./A-Frame.context\";\nimport { A_FrameNodeChannel } from \"../A-FrameChannel/A-FrameChannel.component.env-node\";\nimport { A_FrameNodeStorage } from \"../A-FrameStorage/node/A-FrameNodeStorage.component\";\nimport { A_FrameEnv } from \"../A-FrameEnv/A-FrameEnv.fragment.env-node\";\nimport { A_FrameStorageCodec } from \"../A-FrameStorage/A-FrameStorage.codec\";\nimport { A_FrameCrypto } from \"../A-FrameCrypto/A-FrameCrypto.component.env-node\";\nimport { A_FrameLogger } from \"../A-FrameLogger/A-FrameLogger.component.env-node\";\n\n\n\nexport class A_Frame extends A_FrameBase {\n\n @A_Concept.Load()\n async injectDependencies(\n ) {\n\n const index = new A_FrameIndex();\n index.inherit(A_Context.root);\n\n\n A_Context.root.register(index);\n A_Context.root.register(new A_FrameEnv());\n A_Context.root.register(new A_FrameStorageCodec());\n A_Context.root.register(A_FrameNodeStorage)\n A_Context.root.register(A_FrameNodeChannel);\n A_Context.root.register(A_FrameCrypto)\n A_Context.root.register(new A_FrameLogger());\n A_Context.root.register(A_Frame);\n A_Context.root.register(new A_FrameContext());\n }\n\n\n @A_Concept.Load()\n async load(\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_FrameIndex) index: A_FrameIndex,\n @A_Inject(A_FrameStorage) storage: A_FrameStorage,\n @A_Inject(A_FrameContext) context: A_FrameContext,\n @A_Inject(A_FrameChannel) channel: A_FrameChannel,\n @A_Inject(A_FrameEnv) env: A_FrameEnv,\n ) {\n // 1. Authenticate — required before any storage or embedding operations\n const credentials = await channel.getCredentials();\n context.setCredentials(credentials);\n\n const definedNameSpaces = index.listNamespaces();\n const definedDefinitions = index.listDefinitions();\n\n // 2. Hydrate all from storage in parallel.\n // Storage load only calls fromJSON when hash AND aFrameServerVersion match,\n // so items with a stale/missing cache remain un-embedded (isEmbed === false).\n await Promise.all([\n ...definedNameSpaces.map(ns => ns.load()),\n ...definedDefinitions.map(def => def.load()),\n ]);\n\n // 3. Skip embedding API calls entirely when sync is disabled\n if (!env.A_FRAME_SYNC) return;\n\n // 4. Re-embed and persist items whose cache is missing or stale\n const namespacesNeedEmbed = definedNameSpaces.filter(ns => !ns.isEmbed\n || (ns.aFrameServerVersion !== context.serverVersion)\n || (ns.aFrameVersion !== env.A_FRAME_VERSION) // re-embed if the client version has changed since last embed, as it may affect embedding results\n );\n const definitionsNeedEmbed = definedDefinitions.filter(def => !def.isEmbed\n || (def.aFrameServerVersion !== context.serverVersion)\n || (def.aFrameVersion !== env.A_FRAME_VERSION) // re-embed if the client version has changed since last embed, as it may affect embedding results\n );\n\n for (const batch of this.chunkArray(namespacesNeedEmbed, 10)) {\n // Embed in parallel — each namespace hits its own API call independently\n await Promise.all(batch.map(ns => ns.embed()));\n // Save sequentially — all namespaces write to the same __namespaces.aframe file;\n // parallel writes would race and the last writer would overwrite the others\n for (const ns of batch) {\n await ns.save();\n }\n }\n\n for (const batch of this.chunkArray(definitionsNeedEmbed, 10)) {\n // Embed in parallel — each definition hits its own API call independently\n await Promise.all(batch.map(def => def.embed()));\n // Save sequentially within a namespace — definitions in the same namespace share\n // one file; parallel writes would race and overwrite each other's records\n for (const def of batch) {\n await def.save();\n }\n }\n }\n\n\n chunkArray<T>(array: T[], size: number): T[][] {\n const result: T[][] = [];\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n }\n\n}\n"]}
|
package/dist/node/env.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkXFUF7SDO_cjs = require('./chunk-XFUF7SDO.cjs');
|
|
4
|
+
require('./chunk-R2H234YO.cjs');
|
|
5
5
|
require('./chunk-QFHZIG7Y.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "A_FrameEnv", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkXFUF7SDO_cjs.A_FrameEnv; }
|
|
12
12
|
});
|
|
13
13
|
//# sourceMappingURL=env.cjs.map
|
|
14
14
|
//# sourceMappingURL=env.cjs.map
|
package/dist/node/env.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A_FrameEnv } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { A_FrameEnv } from './chunk-5BKCX2RO.mjs';
|
|
2
|
+
import './chunk-OYC6L5NX.mjs';
|
|
3
3
|
import './chunk-OI76LHVT.mjs';
|
|
4
4
|
//# sourceMappingURL=env.mjs.map
|
|
5
5
|
//# sourceMappingURL=env.mjs.map
|
package/dist/node/storage.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkF46TSY2K_cjs = require('./chunk-F46TSY2K.cjs');
|
|
4
4
|
var chunkQFUZVN4Y_cjs = require('./chunk-QFUZVN4Y.cjs');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-XFUF7SDO.cjs');
|
|
6
6
|
require('./chunk-KK64VLZN.cjs');
|
|
7
7
|
require('./chunk-KLG6HKFU.cjs');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-R2H234YO.cjs');
|
|
9
9
|
require('./chunk-YVX4W6SI.cjs');
|
|
10
10
|
require('./chunk-GBTFMT3K.cjs');
|
|
11
11
|
require('./chunk-ZM2RLVVH.cjs');
|
|
@@ -16,23 +16,23 @@ require('./chunk-QFHZIG7Y.cjs');
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, "A_FrameNodeStorage", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkF46TSY2K_cjs.A_FrameNodeStorage; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "A_FrameStorage", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkF46TSY2K_cjs.A_FrameStorage; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "A_FrameStorageError", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkF46TSY2K_cjs.A_FrameStorageError; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "A_FrameStorageFeatures", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkF46TSY2K_cjs.A_FrameStorageFeatures; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "A_FrameStorageOperation", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkF46TSY2K_cjs.A_FrameStorageOperation; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "A_FrameStorageCodec", {
|
|
38
38
|
enumerable: true,
|
package/dist/node/storage.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { A_FrameNodeStorage, A_FrameStorage, A_FrameStorageError, A_FrameStorageFeatures, A_FrameStorageOperation } from './chunk-
|
|
1
|
+
export { A_FrameNodeStorage, A_FrameStorage, A_FrameStorageError, A_FrameStorageFeatures, A_FrameStorageOperation } from './chunk-6KAGWGTE.mjs';
|
|
2
2
|
export { A_FrameStorageCodec } from './chunk-3ONWH75E.mjs';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-5BKCX2RO.mjs';
|
|
4
4
|
import './chunk-K4MZY4ME.mjs';
|
|
5
5
|
import './chunk-APRYHBEF.mjs';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-OYC6L5NX.mjs';
|
|
7
7
|
import './chunk-UPA7VN4R.mjs';
|
|
8
8
|
import './chunk-B7BXP7K4.mjs';
|
|
9
9
|
import './chunk-442DXGOD.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaas/a-frame",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A-frame is index build engine for A-Concept ecosystem. It provides a way to build index structures for A-Concept basics",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"build": "tsup --config tsup.config.ts"
|
|
182
182
|
},
|
|
183
183
|
"dependencies": {
|
|
184
|
-
"@adaas/a-concept": "^0.3.
|
|
184
|
+
"@adaas/a-concept": "^0.3.15"
|
|
185
185
|
},
|
|
186
186
|
"devDependencies": {
|
|
187
187
|
"@types/chai": "^4.3.14",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A_Concept, A_Fragment, A_Inject, A_Scope, A_TYPES__A_DependencyInjectable, A_TYPES__Component_Constructor, A_TYPES__Ctor, A_TYPES__Fragment_Constructor } from "@adaas/a-concept";
|
|
1
|
+
import { A_Concept, A_Context, A_Fragment, A_Inject, A_Scope, A_TYPES__A_DependencyInjectable, A_TYPES__Component_Constructor, A_TYPES__Ctor, A_TYPES__Fragment_Constructor } from "@adaas/a-concept";
|
|
2
2
|
import { A_FrameBase } from "./A-Frame.component";
|
|
3
3
|
import { A_FrameBrowserStorageProvider } from "../A-FrameStorage/browser/A-FrameBrowserStorage.component";
|
|
4
4
|
import { A_FrameBrowserStorageBlobs } from "../A-FrameStorage/browser/A-FrameBrowserStorageBlobs.context";
|
|
@@ -33,9 +33,11 @@ export class A_Frame extends A_FrameBase {
|
|
|
33
33
|
|
|
34
34
|
@A_Concept.Load()
|
|
35
35
|
async injectDependencies(
|
|
36
|
-
@A_Inject(A_Scope) scope: A_Scope,
|
|
37
36
|
) {
|
|
38
|
-
|
|
37
|
+
const scope = A_Context.root
|
|
38
|
+
|
|
39
|
+
// Register
|
|
40
|
+
// every package dep that isn't already in scope.
|
|
39
41
|
this.package.forEach(({ ctor, instance }) => this.packDependency(scope, ctor, instance));
|
|
40
42
|
|
|
41
43
|
// A_FrameIndex needs to inherit the scope so its registry is visible
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A_Concept, A_Inject, A_Scope } from "@adaas/a-concept";
|
|
1
|
+
import { A_Concept, A_Context, A_Inject, A_Scope } from "@adaas/a-concept";
|
|
2
2
|
import { A_FrameBase } from "./A-Frame.component";
|
|
3
3
|
import { A_FrameIndex } from "../A-FrameIndex";
|
|
4
4
|
import { A_FrameStorage } from "../A-FrameStorage/A-FrameStorage.component";
|
|
@@ -17,22 +17,21 @@ export class A_Frame extends A_FrameBase {
|
|
|
17
17
|
|
|
18
18
|
@A_Concept.Load()
|
|
19
19
|
async injectDependencies(
|
|
20
|
-
@A_Inject(A_Scope) scope: A_Scope,
|
|
21
20
|
) {
|
|
22
|
-
console.log("A_Frame injecting dependencies...");
|
|
23
21
|
|
|
24
22
|
const index = new A_FrameIndex();
|
|
25
|
-
index.inherit(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
index.inherit(A_Context.root);
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
A_Context.root.register(index);
|
|
27
|
+
A_Context.root.register(new A_FrameEnv());
|
|
28
|
+
A_Context.root.register(new A_FrameStorageCodec());
|
|
29
|
+
A_Context.root.register(A_FrameNodeStorage)
|
|
30
|
+
A_Context.root.register(A_FrameNodeChannel);
|
|
31
|
+
A_Context.root.register(A_FrameCrypto)
|
|
32
|
+
A_Context.root.register(new A_FrameLogger());
|
|
33
|
+
A_Context.root.register(A_Frame);
|
|
34
|
+
A_Context.root.register(new A_FrameContext());
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
|
package/tests/A-Frame.test.ts
CHANGED
|
@@ -71,6 +71,8 @@ describe('A-Frame Tests', () => {
|
|
|
71
71
|
const index = concept.scope.resolve(A_FrameIndex)!;
|
|
72
72
|
const channel = concept.scope.resolve(A_FrameChannel)!;
|
|
73
73
|
|
|
74
|
+
console.log(';concept.scope: ', concept.scope.name)
|
|
75
|
+
|
|
74
76
|
const query = "I need to apply some business rules and validate data before saving";
|
|
75
77
|
|
|
76
78
|
const result = await channel.embed(query);
|