@adaas/a-frame 0.0.21 → 0.0.23
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/.conf/tsconfig.browser.json +13 -0
- package/.conf/tsconfig.node.json +14 -0
- package/.env.example +12 -0
- package/dist/browser/A-FrameBrowserStorageBlobs.context-OEQr85oq.d.mts +40 -0
- package/dist/browser/A-FrameBundle.types-DaaUvViw.d.mts +33 -0
- package/dist/browser/A-FrameChannel.types-DWOEUs28.d.mts +142 -0
- package/dist/browser/A-FrameDefinition.entity-DWGN_Ujr.d.mts +329 -0
- package/dist/browser/A-FrameDynamicStructure.entity-DaBgSRCR.d.mts +188 -0
- package/dist/browser/A-FrameLogger.component.env-browser-BIPAP4oQ.d.mts +112 -0
- package/dist/browser/A-FrameNamespace.entity-rCm1AavP.d.mts +125 -0
- package/dist/browser/bundle.d.mts +8 -0
- package/dist/browser/bundle.mjs +2 -0
- package/dist/browser/bundle.mjs.map +1 -0
- package/dist/browser/channel.d.mts +165 -0
- package/dist/browser/channel.mjs +3 -0
- package/dist/browser/channel.mjs.map +1 -0
- package/dist/browser/chunk-5TTVFB3G.mjs +2 -0
- package/dist/browser/chunk-5TTVFB3G.mjs.map +1 -0
- package/dist/browser/chunk-AYN7KUQT.mjs +3 -0
- package/dist/browser/chunk-AYN7KUQT.mjs.map +1 -0
- package/dist/browser/chunk-DMGQW3AO.mjs +2 -0
- package/dist/browser/chunk-DMGQW3AO.mjs.map +1 -0
- package/dist/browser/chunk-G66IL2DR.mjs +2 -0
- package/dist/browser/chunk-G66IL2DR.mjs.map +1 -0
- package/dist/browser/chunk-H6OZP4ZV.mjs +2 -0
- package/dist/browser/chunk-H6OZP4ZV.mjs.map +1 -0
- package/dist/browser/chunk-INS7RO3B.mjs +2 -0
- package/dist/browser/chunk-INS7RO3B.mjs.map +1 -0
- package/dist/browser/chunk-K4MZY4ME.mjs +2 -0
- package/dist/browser/chunk-K4MZY4ME.mjs.map +1 -0
- package/dist/browser/chunk-OFKV5GNB.mjs +3 -0
- package/dist/browser/chunk-OFKV5GNB.mjs.map +1 -0
- package/dist/browser/chunk-QATIN7CO.mjs +3 -0
- package/dist/browser/chunk-QATIN7CO.mjs.map +1 -0
- package/dist/browser/chunk-QBBQ37P3.mjs +2 -0
- package/dist/browser/chunk-QBBQ37P3.mjs.map +1 -0
- package/dist/browser/chunk-VDVJWU5T.mjs +2 -0
- package/dist/browser/chunk-VDVJWU5T.mjs.map +1 -0
- package/dist/browser/chunk-X3C4I6YJ.mjs +2 -0
- package/dist/browser/chunk-X3C4I6YJ.mjs.map +1 -0
- package/dist/browser/chunk-ZVCTU2DN.mjs +3 -0
- package/dist/browser/chunk-ZVCTU2DN.mjs.map +1 -0
- package/dist/browser/core.d.mts +97 -0
- package/dist/browser/core.mjs +2 -0
- package/dist/browser/core.mjs.map +1 -0
- package/dist/browser/crypto.d.mts +35 -0
- package/dist/browser/crypto.mjs +2 -0
- package/dist/browser/crypto.mjs.map +1 -0
- package/dist/browser/definition.d.mts +13 -0
- package/dist/browser/definition.mjs +2 -0
- package/dist/browser/definition.mjs.map +1 -0
- package/dist/browser/dynamic-feature.d.mts +10 -0
- package/dist/browser/dynamic-feature.mjs +2 -0
- package/dist/browser/dynamic-feature.mjs.map +1 -0
- package/dist/browser/dynamic-structure.d.mts +12 -0
- package/dist/browser/dynamic-structure.mjs +2 -0
- package/dist/browser/dynamic-structure.mjs.map +1 -0
- package/dist/browser/env.d.mts +2 -0
- package/dist/browser/env.mjs +2 -0
- package/dist/browser/env.mjs.map +1 -0
- package/dist/browser/frame-index.d.mts +95 -0
- package/dist/browser/frame-index.mjs +2 -0
- package/dist/browser/frame-index.mjs.map +1 -0
- package/dist/browser/index.browser-CZlhzfSP.d.mts +22 -0
- package/dist/browser/index.d.mts +1 -144
- package/dist/browser/index.mjs +1 -1
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/logger.d.mts +41 -0
- package/dist/browser/logger.mjs +2 -0
- package/dist/browser/logger.mjs.map +1 -0
- package/dist/browser/namespace.d.mts +13 -0
- package/dist/browser/namespace.mjs +2 -0
- package/dist/browser/namespace.mjs.map +1 -0
- package/dist/browser/storage.d.mts +194 -0
- package/dist/browser/storage.mjs +2 -0
- package/dist/browser/storage.mjs.map +1 -0
- package/dist/browser/vector.d.mts +15 -0
- package/dist/browser/vector.mjs +2 -0
- package/dist/browser/vector.mjs.map +1 -0
- package/dist/index.cjs +0 -0
- package/dist/node/A-FrameChannel.component-BfBcs734.d.ts +62 -0
- package/dist/node/A-FrameChannel.component-NNKcFViw.d.mts +62 -0
- package/dist/node/A-FrameChannel.types-DQF-IiRq.d.mts +146 -0
- package/dist/node/A-FrameChannel.types-DQF-IiRq.d.ts +146 -0
- package/dist/node/A-FrameDefinition.entity-CAUOdEvU.d.ts +329 -0
- package/dist/node/A-FrameDefinition.entity-DWGN_Ujr.d.mts +329 -0
- package/dist/node/A-FrameDynamicStructure.entity-DaBgSRCR.d.mts +188 -0
- package/dist/node/A-FrameDynamicStructure.entity-DaBgSRCR.d.ts +188 -0
- package/dist/node/A-FrameNamespace.entity-D3fZBGDx.d.ts +125 -0
- package/dist/node/A-FrameNamespace.entity-rCm1AavP.d.mts +125 -0
- package/dist/node/A-FrameStorage.component-BYjHfHJJ.d.mts +107 -0
- package/dist/node/A-FrameStorage.component-CT01fs-t.d.ts +107 -0
- package/dist/node/bundle.cjs +101 -0
- package/dist/node/bundle.cjs.map +1 -0
- package/dist/node/bundle.d.mts +69 -0
- package/dist/node/bundle.d.ts +69 -0
- package/dist/node/bundle.mjs +76 -0
- package/dist/node/bundle.mjs.map +1 -0
- package/dist/node/channel.cjs +60 -0
- package/dist/node/channel.cjs.map +1 -0
- package/dist/node/channel.d.mts +61 -0
- package/dist/node/channel.d.ts +61 -0
- package/dist/node/channel.mjs +11 -0
- package/dist/node/channel.mjs.map +1 -0
- package/dist/node/chunk-3LOMGNWA.cjs +8 -0
- package/dist/node/chunk-3LOMGNWA.cjs.map +1 -0
- package/dist/node/chunk-3ONWH75E.mjs +257 -0
- package/dist/node/chunk-3ONWH75E.mjs.map +1 -0
- package/dist/node/chunk-3TD2PEDZ.mjs +53 -0
- package/dist/node/chunk-3TD2PEDZ.mjs.map +1 -0
- package/dist/node/chunk-442DXGOD.mjs +16 -0
- package/dist/node/chunk-442DXGOD.mjs.map +1 -0
- package/dist/node/chunk-6EFXNUL4.mjs +6 -0
- package/dist/node/chunk-6EFXNUL4.mjs.map +1 -0
- package/dist/node/chunk-7A6XGT5J.cjs +541 -0
- package/dist/node/chunk-7A6XGT5J.cjs.map +1 -0
- package/dist/node/chunk-AOQRXZPC.mjs +207 -0
- package/dist/node/chunk-AOQRXZPC.mjs.map +1 -0
- package/dist/node/chunk-APRYHBEF.mjs +171 -0
- package/dist/node/chunk-APRYHBEF.mjs.map +1 -0
- package/dist/node/chunk-B7BXP7K4.mjs +253 -0
- package/dist/node/chunk-B7BXP7K4.mjs.map +1 -0
- package/dist/node/chunk-B7ZDJXD3.cjs +35 -0
- package/dist/node/chunk-B7ZDJXD3.cjs.map +1 -0
- package/dist/node/chunk-CP6JHUU6.cjs +541 -0
- package/dist/node/chunk-CP6JHUU6.cjs.map +1 -0
- package/dist/node/chunk-DDCEMKBP.mjs +655 -0
- package/dist/node/chunk-DDCEMKBP.mjs.map +1 -0
- package/dist/node/chunk-DMY44VUG.mjs +655 -0
- package/dist/node/chunk-DMY44VUG.mjs.map +1 -0
- package/dist/node/chunk-F4UCOZW5.mjs +33 -0
- package/dist/node/chunk-F4UCOZW5.mjs.map +1 -0
- package/dist/node/chunk-GBTFMT3K.cjs +256 -0
- package/dist/node/chunk-GBTFMT3K.cjs.map +1 -0
- package/dist/node/chunk-GNVXVK2B.cjs +8 -0
- package/dist/node/chunk-GNVXVK2B.cjs.map +1 -0
- package/dist/node/chunk-IIVYTS5M.mjs +239 -0
- package/dist/node/chunk-IIVYTS5M.mjs.map +1 -0
- package/dist/node/chunk-JQBYDEMW.mjs +33 -0
- package/dist/node/chunk-JQBYDEMW.mjs.map +1 -0
- package/dist/node/chunk-K4MZY4ME.mjs +3 -0
- package/dist/node/chunk-K4MZY4ME.mjs.map +1 -0
- package/dist/node/chunk-KK64VLZN.cjs +4 -0
- package/dist/node/chunk-KK64VLZN.cjs.map +1 -0
- package/dist/node/chunk-KLG6HKFU.cjs +175 -0
- package/dist/node/chunk-KLG6HKFU.cjs.map +1 -0
- package/dist/node/chunk-LJIZ47HO.cjs +688 -0
- package/dist/node/chunk-LJIZ47HO.cjs.map +1 -0
- package/dist/node/chunk-NIXKAQVP.cjs +35 -0
- package/dist/node/chunk-NIXKAQVP.cjs.map +1 -0
- package/dist/node/chunk-OI76LHVT.mjs +21 -0
- package/dist/node/chunk-OI76LHVT.mjs.map +1 -0
- package/dist/node/chunk-OJGCQNAH.mjs +529 -0
- package/dist/node/chunk-OJGCQNAH.mjs.map +1 -0
- package/dist/node/chunk-QFHZIG7Y.cjs +25 -0
- package/dist/node/chunk-QFHZIG7Y.cjs.map +1 -0
- package/dist/node/chunk-QFUZVN4Y.cjs +259 -0
- package/dist/node/chunk-QFUZVN4Y.cjs.map +1 -0
- package/dist/node/chunk-RRLTGGM7.cjs +209 -0
- package/dist/node/chunk-RRLTGGM7.cjs.map +1 -0
- package/dist/node/chunk-TO4BPKCY.mjs +6 -0
- package/dist/node/chunk-TO4BPKCY.mjs.map +1 -0
- package/dist/node/chunk-UKKCN7CQ.cjs +688 -0
- package/dist/node/chunk-UKKCN7CQ.cjs.map +1 -0
- package/dist/node/chunk-UPA7VN4R.mjs +153 -0
- package/dist/node/chunk-UPA7VN4R.mjs.map +1 -0
- package/dist/node/chunk-UTJ7CVVB.cjs +248 -0
- package/dist/node/chunk-UTJ7CVVB.cjs.map +1 -0
- package/dist/node/chunk-YVX4W6SI.cjs +155 -0
- package/dist/node/chunk-YVX4W6SI.cjs.map +1 -0
- package/dist/node/chunk-YWWGJ6EJ.cjs +55 -0
- package/dist/node/chunk-YWWGJ6EJ.cjs.map +1 -0
- package/dist/node/chunk-Z4HUCRK2.mjs +529 -0
- package/dist/node/chunk-Z4HUCRK2.mjs.map +1 -0
- package/dist/node/chunk-ZM2RLVVH.cjs +18 -0
- package/dist/node/chunk-ZM2RLVVH.cjs.map +1 -0
- package/dist/node/core.cjs +261 -0
- package/dist/node/core.cjs.map +1 -0
- package/dist/node/core.d.mts +76 -0
- package/dist/node/core.d.ts +76 -0
- package/dist/node/core.mjs +250 -0
- package/dist/node/core.mjs.map +1 -0
- package/dist/node/crypto.cjs +13 -0
- package/dist/node/crypto.cjs.map +1 -0
- package/dist/node/crypto.d.mts +44 -0
- package/dist/node/crypto.d.ts +44 -0
- package/dist/node/crypto.mjs +4 -0
- package/dist/node/crypto.mjs.map +1 -0
- package/dist/node/definition.cjs +19 -0
- package/dist/node/definition.cjs.map +1 -0
- package/dist/node/definition.d.mts +13 -0
- package/dist/node/definition.d.ts +13 -0
- package/dist/node/definition.mjs +6 -0
- package/dist/node/definition.mjs.map +1 -0
- package/dist/node/dynamic-feature.cjs +14 -0
- package/dist/node/dynamic-feature.cjs.map +1 -0
- package/dist/node/dynamic-feature.d.mts +10 -0
- package/dist/node/dynamic-feature.d.ts +10 -0
- package/dist/node/dynamic-feature.mjs +12 -0
- package/dist/node/dynamic-feature.mjs.map +1 -0
- package/dist/node/dynamic-structure.cjs +143 -0
- package/dist/node/dynamic-structure.cjs.map +1 -0
- package/dist/node/dynamic-structure.d.mts +12 -0
- package/dist/node/dynamic-structure.d.ts +12 -0
- package/dist/node/dynamic-structure.mjs +138 -0
- package/dist/node/dynamic-structure.mjs.map +1 -0
- package/dist/node/env.cjs +14 -0
- package/dist/node/env.cjs.map +1 -0
- package/dist/node/env.d.mts +22 -0
- package/dist/node/env.d.ts +22 -0
- package/dist/node/env.mjs +5 -0
- package/dist/node/env.mjs.map +1 -0
- package/dist/node/frame-index.cjs +16 -0
- package/dist/node/frame-index.cjs.map +1 -0
- package/dist/node/frame-index.d.mts +95 -0
- package/dist/node/frame-index.d.ts +95 -0
- package/dist/node/frame-index.mjs +7 -0
- package/dist/node/frame-index.mjs.map +1 -0
- package/dist/node/index.cjs +0 -288
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.mts +1 -144
- package/dist/node/index.d.ts +1 -144
- package/dist/node/index.mjs +0 -284
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/logger.cjs +41 -0
- package/dist/node/logger.cjs.map +1 -0
- package/dist/node/logger.d.mts +150 -0
- package/dist/node/logger.d.ts +150 -0
- package/dist/node/logger.mjs +4 -0
- package/dist/node/logger.mjs.map +1 -0
- package/dist/node/namespace.cjs +24 -0
- package/dist/node/namespace.cjs.map +1 -0
- package/dist/node/namespace.d.mts +13 -0
- package/dist/node/namespace.d.ts +13 -0
- package/dist/node/namespace.mjs +7 -0
- package/dist/node/namespace.mjs.map +1 -0
- package/dist/node/storage.cjs +42 -0
- package/dist/node/storage.cjs.map +1 -0
- package/dist/node/storage.d.mts +110 -0
- package/dist/node/storage.d.ts +110 -0
- package/dist/node/storage.mjs +13 -0
- package/dist/node/storage.mjs.map +1 -0
- package/dist/node/vector.cjs +13 -0
- package/dist/node/vector.cjs.map +1 -0
- package/dist/node/vector.d.mts +15 -0
- package/dist/node/vector.d.ts +15 -0
- package/dist/node/vector.mjs +4 -0
- package/dist/node/vector.mjs.map +1 -0
- package/jest.config.browser.ts +41 -0
- package/jest.config.ts +18 -8
- package/package.json +125 -13
- package/{index.ts → src/concept.ts} +5 -2
- package/src/helpers/Hash.helper.ts +14 -0
- package/src/index.ts +0 -24
- package/src/lib/A-Frame/A-Frame.component.env-browser.ts +124 -0
- package/src/lib/A-Frame/A-Frame.component.env-node.ts +106 -0
- package/src/lib/A-Frame/A-Frame.component.ts +62 -0
- package/src/lib/A-Frame/A-Frame.context.ts +40 -0
- package/src/lib/{components/Index.component.ts/Index.error.ts → A-Frame/A-Frame.error.ts} +1 -1
- package/src/lib/{components/Index.component.ts/Index.guard.ts → A-Frame/A-Frame.guard.ts} +9 -6
- package/src/lib/A-Frame/A-Frame.meta.ts +27 -0
- package/src/lib/{components/Index.component.ts/Index.types.ts → A-Frame/A-Frame.types.ts} +52 -17
- package/src/lib/A-Frame/decorators/A-FrameDefine.decorator.ts +104 -0
- package/src/lib/A-Frame/decorators/A-FrameNamespace.decorator.ts +33 -0
- package/src/lib/A-Frame/index.browser.ts +10 -0
- package/src/lib/A-Frame/index.ts +10 -0
- package/src/lib/A-FrameBundle/A-FrameBundle.builder.env-node.ts +95 -0
- package/src/lib/A-FrameBundle/A-FrameBundle.constants.ts +5 -0
- package/src/lib/A-FrameBundle/A-FrameBundle.types.ts +31 -0
- package/src/lib/A-FrameBundle/index.browser.ts +6 -0
- package/src/lib/A-FrameBundle/index.ts +7 -0
- package/src/lib/A-FrameCLI/A-FrameCLI.container.ts +333 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.component.env-browser.ts +63 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.component.env-node.ts +586 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.component.ts +273 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.constants.ts +39 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.error.ts +10 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.types.ts +143 -0
- package/src/lib/A-FrameChannel/A-FrameChannelEvent.context.ts +28 -0
- package/src/lib/A-FrameChannel/A-FrameChannelRequest.context.ts +36 -0
- package/src/lib/A-FrameChannel/A-FrameChannelSocket.entity.ts +189 -0
- package/src/lib/A-FrameChannel/A-FrameChannelStream.entity.ts +144 -0
- package/src/lib/A-FrameChannel/index.browser.ts +3 -0
- package/src/lib/A-FrameChannel/index.ts +10 -0
- package/src/lib/A-FrameCrypto/A-FrameCrypto.component.env-browser.ts +123 -0
- package/src/lib/A-FrameCrypto/A-FrameCrypto.component.env-node.ts +204 -0
- package/src/lib/A-FrameCrypto/index.browser.ts +1 -0
- package/src/lib/A-FrameCrypto/index.ts +1 -0
- package/src/lib/A-FrameDefinition/A-FrameDefinition.constants.ts +8 -0
- package/src/lib/A-FrameDefinition/A-FrameDefinition.entity.ts +290 -0
- package/src/lib/A-FrameDefinition/A-FrameDefinition.types.ts +109 -0
- package/src/lib/A-FrameDefinition/index.ts +3 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeature.entity.ts +13 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeature.types.ts +10 -0
- package/src/lib/A-FrameDynamicFeature/index.ts +2 -0
- package/src/lib/A-FrameDynamicPatch/A-FrameDynamicPatch.entity.ts +38 -0
- package/src/lib/A-FrameDynamicPatch/A-FrameDynamicPatch.types.ts +20 -0
- package/src/lib/A-FrameDynamicSession/A-FrameDynamicSession.constants.ts +9 -0
- package/src/lib/A-FrameDynamicSession/A-FrameDynamicSession.entity.ts +91 -0
- package/src/lib/A-FrameDynamicSession/A-FrameDynamicSession.types.ts +18 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.constants.ts +13 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.entity.ts +187 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.error.ts +13 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.types.ts +128 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructureOperation.context.ts +32 -0
- package/src/lib/A-FrameDynamicStructure/index.ts +5 -0
- package/src/lib/A-FrameEnv/A-FrameEnv.fragment.env-browser.ts +31 -0
- package/src/lib/A-FrameEnv/A-FrameEnv.fragment.env-node.ts +39 -0
- package/src/lib/A-FrameEnv/A-FrameEnv.types.ts +7 -0
- package/src/lib/A-FrameEnv/index.browser.ts +1 -0
- package/src/lib/A-FrameEnv/index.ts +1 -0
- package/src/lib/A-FrameIndex/A-FrameIndex.context.ts +321 -0
- package/src/lib/A-FrameIndex/A-FrameIndex.types.ts +63 -0
- package/src/lib/A-FrameIndex/index.browser.ts +3 -0
- package/src/lib/A-FrameIndex/index.ts +3 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.component.env-browser.ts +99 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.component.env-node.ts +129 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.component.ts +123 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.constants.ts +66 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.types.ts +67 -0
- package/src/lib/A-FrameLogger/index.browser.ts +4 -0
- package/src/lib/A-FrameLogger/index.ts +4 -0
- package/src/lib/A-FrameNamespace/A-FrameNamespace.constants.ts +12 -0
- package/src/lib/A-FrameNamespace/A-FrameNamespace.entity.ts +211 -0
- package/src/lib/A-FrameNamespace/A-FrameNamespace.types.ts +72 -0
- package/src/lib/A-FrameNamespace/index.ts +3 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.codec.ts +338 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.component.ts +191 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.constants.ts +11 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.error.ts +13 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.types.ts +98 -0
- package/src/lib/A-FrameStorage/A-FrameStorageOperation.context.ts +59 -0
- package/src/lib/A-FrameStorage/browser/A-FrameBrowserStorage.component.ts +312 -0
- package/src/lib/A-FrameStorage/browser/A-FrameBrowserStorageBlobs.context.ts +77 -0
- package/src/lib/A-FrameStorage/index.browser.ts +11 -0
- package/src/lib/A-FrameStorage/index.ts +10 -0
- package/src/lib/A-FrameStorage/node/A-FrameNodeStorage.component.ts +464 -0
- package/src/lib/A-FrameStorage/server/A-FrameServerStorage.component.ts +177 -0
- package/src/lib/{entities/A_FrameVector/A_FrameVector.entity.ts → A-FrameVector/A-FrameVector.entity.ts} +10 -0
- package/src/lib/A-FrameVector/index.ts +3 -0
- package/tests/A-Frame.browser.test.ts +94 -0
- package/tests/A-Frame.test.ts +73 -68
- package/tests/jest.browser-environment.js +30 -0
- package/tests/jest.polyfills.browser.ts +13 -0
- package/tests/jest.setup.browser.ts +33 -0
- package/tsconfig.browser.json +54 -0
- package/tsconfig.json +16 -0
- package/tsup.config.ts +32 -2
- package/src/lib/components/Builder.component.ts/Builder.component.ts +0 -0
- package/src/lib/components/Index.component.ts/Index.component.ts +0 -79
- package/src/lib/components/Index.component.ts/Index.constants.ts +0 -0
- package/src/lib/components/Index.component.ts/Index.meta.ts +0 -28
- package/src/lib/components/Index.component.ts/IndexConfigurations.meta.ts +0 -78
- package/src/lib/components/Index.component.ts/decorators/IndexComponent.decorator.ts +0 -97
- package/src/lib/components/Index.component.ts/decorators/IndexDescribe.decorator.ts +0 -59
- package/src/lib/components/Index.component.ts/decorators/IndexNamespace.decorator.ts +0 -57
- package/src/lib/components/Search/A_FrameSearch.component.ts +0 -66
- package/src/lib/containers/CLI.container.ts +0 -27
- package/src/lib/entities/Namespace/Namespace.entity.ts +0 -8
package/jest.config.ts
CHANGED
|
@@ -5,18 +5,28 @@ const config: Config.InitialOptions = {
|
|
|
5
5
|
verbose: true,
|
|
6
6
|
setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.ts'],
|
|
7
7
|
roots: ['<rootDir>/tests'],
|
|
8
|
+
testPathIgnorePatterns: ['/node_modules/', '\\.browser\\.test\\.ts$'],
|
|
8
9
|
transform: {
|
|
9
10
|
'^.+\\.tsx?$': 'ts-jest'
|
|
10
11
|
},
|
|
11
12
|
moduleNameMapper: {
|
|
12
|
-
"@adaas/a-frame/constants/(.*)":
|
|
13
|
-
"@adaas/a-frame/
|
|
14
|
-
"@adaas/a-frame/
|
|
15
|
-
"@adaas/a-frame/
|
|
16
|
-
"@adaas/a-frame/
|
|
17
|
-
"@adaas/a-frame/
|
|
18
|
-
"@adaas/a-frame/
|
|
13
|
+
"@adaas/a-frame/constants/(.*)": "<rootDir>/src/constants/$1",
|
|
14
|
+
"@adaas/a-frame/utils/(.*)": "<rootDir>/src/utils/$1",
|
|
15
|
+
"@adaas/a-frame/helpers/(.*)": "<rootDir>/src/helpers/$1",
|
|
16
|
+
"@adaas/a-frame/types": "<rootDir>/src/types",
|
|
17
|
+
"@adaas/a-frame/core": "<rootDir>/src/lib/A-Frame/index.ts",
|
|
18
|
+
"@adaas/a-frame/bundle": "<rootDir>/src/lib/A-FrameBundle/index.ts",
|
|
19
|
+
"@adaas/a-frame/channel": "<rootDir>/src/lib/A-FrameChannel/index.ts",
|
|
20
|
+
"@adaas/a-frame/crypto": "<rootDir>/src/lib/A-FrameCrypto/index.ts",
|
|
21
|
+
"@adaas/a-frame/definition": "<rootDir>/src/lib/A-FrameDefinition/index.ts",
|
|
22
|
+
"@adaas/a-frame/dynamic-feature": "<rootDir>/src/lib/A-FrameDynamicFeature/index.ts",
|
|
23
|
+
"@adaas/a-frame/dynamic-structure": "<rootDir>/src/lib/A-FrameDynamicStructure/index.ts",
|
|
24
|
+
"@adaas/a-frame/env": "<rootDir>/src/lib/A-FrameEnv/index.ts",
|
|
25
|
+
"@adaas/a-frame/index": "<rootDir>/src/lib/A-FrameIndex/index.ts",
|
|
26
|
+
"@adaas/a-frame/logger": "<rootDir>/src/lib/A-FrameLogger/index.ts",
|
|
27
|
+
"@adaas/a-frame/namespace": "<rootDir>/src/lib/A-FrameNamespace/index.ts",
|
|
28
|
+
"@adaas/a-frame/storage": "<rootDir>/src/lib/A-FrameStorage/index.ts",
|
|
29
|
+
"@adaas/a-frame/vector": "<rootDir>/src/lib/A-FrameVector/index.ts",
|
|
19
30
|
}
|
|
20
|
-
|
|
21
31
|
};
|
|
22
32
|
export default config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaas/a-frame",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
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": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"url": "git+https://github.com/ADAAS-org/adaas-a-frame.git"
|
|
17
17
|
},
|
|
18
18
|
"bin": {
|
|
19
|
-
"a-frame": "./dist/index.
|
|
19
|
+
"a-frame": "./dist/index.cjs"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
@@ -24,16 +24,126 @@
|
|
|
24
24
|
"types": "./dist/browser/index.d.mts",
|
|
25
25
|
"import": "./dist/browser/index.mjs"
|
|
26
26
|
},
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
"types": "./dist/node/index.d.ts",
|
|
28
|
+
"import": "./dist/node/index.mjs",
|
|
29
|
+
"require": "./dist/node/index.cjs"
|
|
30
|
+
},
|
|
31
|
+
"./core": {
|
|
32
|
+
"browser": {
|
|
33
|
+
"types": "./dist/browser/core.d.mts",
|
|
34
|
+
"import": "./dist/browser/core.mjs"
|
|
35
|
+
},
|
|
36
|
+
"types": "./dist/node/core.d.ts",
|
|
37
|
+
"import": "./dist/node/core.mjs",
|
|
38
|
+
"require": "./dist/node/core.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./bundle": {
|
|
41
|
+
"browser": {
|
|
42
|
+
"types": "./dist/browser/bundle.d.mts",
|
|
43
|
+
"import": "./dist/browser/bundle.mjs"
|
|
44
|
+
},
|
|
45
|
+
"types": "./dist/node/bundle.d.ts",
|
|
46
|
+
"import": "./dist/node/bundle.mjs",
|
|
47
|
+
"require": "./dist/node/bundle.cjs"
|
|
48
|
+
},
|
|
49
|
+
"./channel": {
|
|
50
|
+
"browser": {
|
|
51
|
+
"types": "./dist/browser/channel.d.mts",
|
|
52
|
+
"import": "./dist/browser/channel.mjs"
|
|
53
|
+
},
|
|
54
|
+
"types": "./dist/node/channel.d.ts",
|
|
55
|
+
"import": "./dist/node/channel.mjs",
|
|
56
|
+
"require": "./dist/node/channel.cjs"
|
|
57
|
+
},
|
|
58
|
+
"./crypto": {
|
|
59
|
+
"browser": {
|
|
60
|
+
"types": "./dist/browser/crypto.d.mts",
|
|
61
|
+
"import": "./dist/browser/crypto.mjs"
|
|
62
|
+
},
|
|
63
|
+
"types": "./dist/node/crypto.d.ts",
|
|
64
|
+
"import": "./dist/node/crypto.mjs",
|
|
65
|
+
"require": "./dist/node/crypto.cjs"
|
|
66
|
+
},
|
|
67
|
+
"./definition": {
|
|
68
|
+
"browser": {
|
|
69
|
+
"types": "./dist/browser/definition.d.mts",
|
|
70
|
+
"import": "./dist/browser/definition.mjs"
|
|
71
|
+
},
|
|
72
|
+
"types": "./dist/node/definition.d.ts",
|
|
73
|
+
"import": "./dist/node/definition.mjs",
|
|
74
|
+
"require": "./dist/node/definition.cjs"
|
|
75
|
+
},
|
|
76
|
+
"./dynamic-feature": {
|
|
77
|
+
"browser": {
|
|
78
|
+
"types": "./dist/browser/dynamic-feature.d.mts",
|
|
79
|
+
"import": "./dist/browser/dynamic-feature.mjs"
|
|
80
|
+
},
|
|
81
|
+
"types": "./dist/node/dynamic-feature.d.ts",
|
|
82
|
+
"import": "./dist/node/dynamic-feature.mjs",
|
|
83
|
+
"require": "./dist/node/dynamic-feature.cjs"
|
|
84
|
+
},
|
|
85
|
+
"./dynamic-structure": {
|
|
86
|
+
"browser": {
|
|
87
|
+
"types": "./dist/browser/dynamic-structure.d.mts",
|
|
88
|
+
"import": "./dist/browser/dynamic-structure.mjs"
|
|
89
|
+
},
|
|
90
|
+
"types": "./dist/node/dynamic-structure.d.ts",
|
|
91
|
+
"import": "./dist/node/dynamic-structure.mjs",
|
|
92
|
+
"require": "./dist/node/dynamic-structure.cjs"
|
|
93
|
+
},
|
|
94
|
+
"./env": {
|
|
95
|
+
"browser": {
|
|
96
|
+
"types": "./dist/browser/env.d.mts",
|
|
97
|
+
"import": "./dist/browser/env.mjs"
|
|
98
|
+
},
|
|
99
|
+
"types": "./dist/node/env.d.ts",
|
|
100
|
+
"import": "./dist/node/env.mjs",
|
|
101
|
+
"require": "./dist/node/env.cjs"
|
|
102
|
+
},
|
|
103
|
+
"./index": {
|
|
104
|
+
"browser": {
|
|
105
|
+
"types": "./dist/browser/frame-index.d.mts",
|
|
106
|
+
"import": "./dist/browser/frame-index.mjs"
|
|
107
|
+
},
|
|
108
|
+
"types": "./dist/node/frame-index.d.ts",
|
|
109
|
+
"import": "./dist/node/frame-index.mjs",
|
|
110
|
+
"require": "./dist/node/frame-index.cjs"
|
|
111
|
+
},
|
|
112
|
+
"./logger": {
|
|
113
|
+
"browser": {
|
|
114
|
+
"types": "./dist/browser/logger.d.mts",
|
|
115
|
+
"import": "./dist/browser/logger.mjs"
|
|
116
|
+
},
|
|
117
|
+
"types": "./dist/node/logger.d.ts",
|
|
118
|
+
"import": "./dist/node/logger.mjs",
|
|
119
|
+
"require": "./dist/node/logger.cjs"
|
|
120
|
+
},
|
|
121
|
+
"./namespace": {
|
|
122
|
+
"browser": {
|
|
123
|
+
"types": "./dist/browser/namespace.d.mts",
|
|
124
|
+
"import": "./dist/browser/namespace.mjs"
|
|
125
|
+
},
|
|
126
|
+
"types": "./dist/node/namespace.d.ts",
|
|
127
|
+
"import": "./dist/node/namespace.mjs",
|
|
128
|
+
"require": "./dist/node/namespace.cjs"
|
|
129
|
+
},
|
|
130
|
+
"./storage": {
|
|
131
|
+
"browser": {
|
|
132
|
+
"types": "./dist/browser/storage.d.mts",
|
|
133
|
+
"import": "./dist/browser/storage.mjs"
|
|
134
|
+
},
|
|
135
|
+
"types": "./dist/node/storage.d.ts",
|
|
136
|
+
"import": "./dist/node/storage.mjs",
|
|
137
|
+
"require": "./dist/node/storage.cjs"
|
|
138
|
+
},
|
|
139
|
+
"./vector": {
|
|
140
|
+
"browser": {
|
|
141
|
+
"types": "./dist/browser/vector.d.mts",
|
|
142
|
+
"import": "./dist/browser/vector.mjs"
|
|
31
143
|
},
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"require": "./dist/node/index.cjs"
|
|
36
|
-
}
|
|
144
|
+
"types": "./dist/node/vector.d.ts",
|
|
145
|
+
"import": "./dist/node/vector.mjs",
|
|
146
|
+
"require": "./dist/node/vector.cjs"
|
|
37
147
|
}
|
|
38
148
|
},
|
|
39
149
|
"keywords": [
|
|
@@ -61,6 +171,7 @@
|
|
|
61
171
|
},
|
|
62
172
|
"scripts": {
|
|
63
173
|
"test": "jest --detectOpenHandles",
|
|
174
|
+
"test:browser": "jest --config jest.config.browser.ts --detectOpenHandles",
|
|
64
175
|
"start": "nodemon ./tests/example-usage.ts",
|
|
65
176
|
"start:test": "node -r tsconfig-paths/register -r ts-node/register ./index.ts",
|
|
66
177
|
"release": "npm run test && npm run build && git add . && git commit -m \"new version created :: $(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g')\" && npm version patch && npm publish --access public",
|
|
@@ -70,7 +181,7 @@
|
|
|
70
181
|
"build": "tsup --config tsup.config.ts"
|
|
71
182
|
},
|
|
72
183
|
"dependencies": {
|
|
73
|
-
"@adaas/a-concept": "^0.3.
|
|
184
|
+
"@adaas/a-concept": "^0.3.14"
|
|
74
185
|
},
|
|
75
186
|
"devDependencies": {
|
|
76
187
|
"@types/chai": "^4.3.14",
|
|
@@ -78,8 +189,9 @@
|
|
|
78
189
|
"@types/mocha": "^10.0.6",
|
|
79
190
|
"@types/node": "^24.9.1",
|
|
80
191
|
"chai": "^5.1.0",
|
|
81
|
-
"dotenv": "^16.
|
|
192
|
+
"dotenv": "^16.6.1",
|
|
82
193
|
"jest": "^29.7.0",
|
|
194
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
83
195
|
"mocha": "^10.4.0",
|
|
84
196
|
"nodemon": "^3.1.4",
|
|
85
197
|
"ts-jest": "^29.1.2",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { A_Concept } from '@adaas/a-concept';
|
|
2
|
-
import {
|
|
2
|
+
import { A_FrameCLIContainer } from './lib/A-FrameCLI/A-FrameCLI.container';
|
|
3
|
+
import { A_Frame } from './lib/A-Frame/A-Frame.component.env-node';
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
|
|
@@ -7,7 +8,9 @@ import { A_Frame_CLIContainer } from 'src';
|
|
|
7
8
|
const concept = new A_Concept({
|
|
8
9
|
name: 'A-Frame CLI',
|
|
9
10
|
containers: [
|
|
10
|
-
new
|
|
11
|
+
new A_FrameCLIContainer({
|
|
12
|
+
components: [A_Frame]
|
|
13
|
+
})
|
|
11
14
|
]
|
|
12
15
|
});
|
|
13
16
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export class A_FrameHashHelper {
|
|
4
|
+
|
|
5
|
+
// ─── Hash (FNV-1a 32-bit, no external deps) ──────────────────────────────────
|
|
6
|
+
static fnv1a(str: string): string {
|
|
7
|
+
let hash = 2_166_136_261; // offset basis
|
|
8
|
+
for (let i = 0; i < str.length; i++) {
|
|
9
|
+
hash ^= str.charCodeAt(i);
|
|
10
|
+
hash = (hash * 16_777_619) >>> 0; // keep 32-bit unsigned
|
|
11
|
+
}
|
|
12
|
+
return hash.toString(16).padStart(8, "0");
|
|
13
|
+
}
|
|
14
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// A-Frame CLI Exports
|
|
3
|
-
// ============================================================================
|
|
4
|
-
export { A_Frame_CLIContainer } from './lib/containers/CLI.container';
|
|
5
|
-
|
|
6
|
-
// ============================================================================
|
|
7
|
-
// A-Frame Index Exports
|
|
8
|
-
// ============================================================================
|
|
9
|
-
export { A_Frame_Index as A_Frame } from './lib/components/Index.component.ts/Index.component';
|
|
10
|
-
export { A_Frame_IndexMeta } from './lib/components/Index.component.ts/Index.meta';
|
|
11
|
-
export { A_Frame_IndexError } from './lib/components/Index.component.ts/Index.error';
|
|
12
|
-
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// A-Frame Types Exports
|
|
15
|
-
// ============================================================================
|
|
16
|
-
export type {
|
|
17
|
-
A_Frame_IndexOptions,
|
|
18
|
-
A_Frame_IndexDecoratorTarget,
|
|
19
|
-
A_Frame_IndexDecoratorMeta,
|
|
20
|
-
A_Frame_IndexNamespaceDecoratorTarget
|
|
21
|
-
} from './lib/components/Index.component.ts/Index.types';
|
|
22
|
-
|
|
23
|
-
// Export the enum as both type and value
|
|
24
|
-
export { A_Frame_IndexTargetType } from './lib/components/Index.component.ts/Index.types';
|
|
@@ -0,0 +1,124 @@
|
|
|
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";
|
|
2
|
+
import { A_FrameBase } from "./A-Frame.component";
|
|
3
|
+
import { A_FrameBrowserStorageProvider } from "../A-FrameStorage/browser/A-FrameBrowserStorage.component";
|
|
4
|
+
import { A_FrameBrowserStorageBlobs } from "../A-FrameStorage/browser/A-FrameBrowserStorageBlobs.context";
|
|
5
|
+
import { A_FrameStorageCodec } from "../A-FrameStorage/A-FrameStorage.codec";
|
|
6
|
+
import { A_FrameIndex } from "../A-FrameIndex";
|
|
7
|
+
import { A_FrameContext } from "./A-Frame.context";
|
|
8
|
+
import { A_FrameLogger } from "../A-FrameLogger/A-FrameLogger.component.env-browser";
|
|
9
|
+
import { A_FrameEnv } from "../A-FrameEnv/A-FrameEnv.fragment.env-browser";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export class A_Frame extends A_FrameBase {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Default per-instance dependencies registered on first build. The blob
|
|
17
|
+
* store is intentionally omitted here — the user is expected to seed and
|
|
18
|
+
* register `A_FrameBrowserStorageBlobs` themselves (typically via
|
|
19
|
+
* `A_FrameBrowserStorageBlobs.fromBundle(bundle)` before `concept.load()`).
|
|
20
|
+
* If they don't, `A_FrameBrowserStorageProvider.onLoad()` falls back to the
|
|
21
|
+
* empty singleton.
|
|
22
|
+
*/
|
|
23
|
+
get package(): Array<{ ctor: A_TYPES__Component_Constructor<any> | A_TYPES__Fragment_Constructor<any>; instance: any }> {
|
|
24
|
+
return [
|
|
25
|
+
{ ctor: A_FrameContext, instance: new A_FrameContext() },
|
|
26
|
+
{ ctor: A_FrameEnv, instance: new A_FrameEnv() },
|
|
27
|
+
{ ctor: A_FrameStorageCodec, instance: new A_FrameStorageCodec() },
|
|
28
|
+
{ ctor: A_FrameBrowserStorageProvider, instance: A_FrameBrowserStorageProvider },
|
|
29
|
+
{ ctor: A_FrameLogger, instance: new A_FrameLogger() },
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@A_Concept.Load()
|
|
35
|
+
async injectDependencies(
|
|
36
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
37
|
+
) {
|
|
38
|
+
// Register every package dep that isn't already in scope.
|
|
39
|
+
this.package.forEach(({ ctor, instance }) => this.packDependency(scope, ctor, instance));
|
|
40
|
+
|
|
41
|
+
// A_FrameIndex needs to inherit the scope so its registry is visible
|
|
42
|
+
// to all later resolutions (entities query it during load).
|
|
43
|
+
if (!scope.resolve(A_FrameIndex)) {
|
|
44
|
+
const index = new A_FrameIndex();
|
|
45
|
+
index.inherit(scope);
|
|
46
|
+
scope.register(index);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Hydrate all known namespaces and definitions from the in-memory bundle
|
|
53
|
+
* blobs. Read-only — never calls embed (no network in the browser).
|
|
54
|
+
*
|
|
55
|
+
* The caller is responsible for:
|
|
56
|
+
* 1. Seeding `A_FrameBrowserStorageBlobs` from a prebuilt `A_FrameBundle`.
|
|
57
|
+
* 2. Setting `A_FrameContext.encryptionKey` and `serverVersion` so blobs
|
|
58
|
+
* can be decrypted and validated.
|
|
59
|
+
*/
|
|
60
|
+
@A_Concept.Load()
|
|
61
|
+
async load(
|
|
62
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
63
|
+
@A_Inject(A_FrameIndex) index: A_FrameIndex,
|
|
64
|
+
@A_Inject(A_FrameContext) context: A_FrameContext,
|
|
65
|
+
@A_Inject(A_FrameLogger) logger: A_FrameLogger,
|
|
66
|
+
@A_Inject(A_FrameBrowserStorageBlobs) blobs: A_FrameBrowserStorageBlobs,
|
|
67
|
+
) {
|
|
68
|
+
if (!context.encryptionKey) {
|
|
69
|
+
logger.warn(
|
|
70
|
+
'A_Frame (browser): no encryption key on context — blobs cannot be decrypted. ' +
|
|
71
|
+
'Call A_FrameContext.setCredentials({...}) before concept.load().'
|
|
72
|
+
);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Surface a soft mismatch warning when the bundle was built against a
|
|
77
|
+
// different server version than the one the user has authenticated with.
|
|
78
|
+
if (blobs.bundleMeta && context.serverVersion && blobs.bundleMeta.serverVersion !== context.serverVersion) {
|
|
79
|
+
logger.warn(
|
|
80
|
+
`A_Frame bundle was built against server v${blobs.bundleMeta.serverVersion} ` +
|
|
81
|
+
`but the current credentials report v${context.serverVersion}. ` +
|
|
82
|
+
`Hydration may skip records — rebuild the bundle.`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const namespaces = index.listNamespaces();
|
|
87
|
+
const definitions = index.listDefinitions();
|
|
88
|
+
|
|
89
|
+
await Promise.all([
|
|
90
|
+
...namespaces.map(ns => Promise.resolve(ns.load()).catch(() => { })),
|
|
91
|
+
...definitions.map(def => Promise.resolve(def.load()).catch(() => { })),
|
|
92
|
+
]);
|
|
93
|
+
|
|
94
|
+
const unloaded =
|
|
95
|
+
namespaces.filter(ns => !ns.isEmbed).length +
|
|
96
|
+
definitions.filter(def => !def.isEmbed).length;
|
|
97
|
+
if (unloaded > 0) {
|
|
98
|
+
logger.warn(
|
|
99
|
+
`${unloaded} A-Frame entit${unloaded === 1 ? 'y' : 'ies'} could not be hydrated from the bundle. ` +
|
|
100
|
+
`Rebuild the bundle on the Node side to include them.`
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@A_Concept.Build()
|
|
107
|
+
async build(
|
|
108
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
109
|
+
) {
|
|
110
|
+
// Build phase is now redundant for registration (handled in @Load above)
|
|
111
|
+
// but kept as a hook for downstream extensions.
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
@A_Concept.Start()
|
|
116
|
+
async start(
|
|
117
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
118
|
+
) {
|
|
119
|
+
// Start logic here
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { A_Concept, A_Inject, A_Scope } from "@adaas/a-concept";
|
|
2
|
+
import { A_FrameBase } from "./A-Frame.component";
|
|
3
|
+
import { A_FrameIndex } from "../A-FrameIndex";
|
|
4
|
+
import { A_FrameStorage } from "../A-FrameStorage/A-FrameStorage.component";
|
|
5
|
+
import { A_FrameChannel } from "../A-FrameChannel/A-FrameChannel.component";
|
|
6
|
+
import { A_FrameContext } from "./A-Frame.context";
|
|
7
|
+
import { A_FrameNodeChannel } from "../A-FrameChannel/A-FrameChannel.component.env-node";
|
|
8
|
+
import { A_FrameNodeStorage } from "../A-FrameStorage/node/A-FrameNodeStorage.component";
|
|
9
|
+
import { A_FrameEnv } from "../A-FrameEnv/A-FrameEnv.fragment.env-node";
|
|
10
|
+
import { A_FrameStorageCodec } from "../A-FrameStorage/A-FrameStorage.codec";
|
|
11
|
+
import { A_FrameCrypto } from "../A-FrameCrypto/A-FrameCrypto.component.env-node";
|
|
12
|
+
import { A_FrameLogger } from "../A-FrameLogger/A-FrameLogger.component.env-node";
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export class A_Frame extends A_FrameBase {
|
|
17
|
+
|
|
18
|
+
@A_Concept.Load()
|
|
19
|
+
async injectDependencies(
|
|
20
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
21
|
+
) {
|
|
22
|
+
console.log("A_Frame injecting dependencies...");
|
|
23
|
+
|
|
24
|
+
const index = new A_FrameIndex();
|
|
25
|
+
index.inherit(scope);
|
|
26
|
+
|
|
27
|
+
scope.register(index);
|
|
28
|
+
scope.register(new A_FrameEnv());
|
|
29
|
+
scope.register(new A_FrameStorageCodec());
|
|
30
|
+
scope.register(A_FrameNodeStorage)
|
|
31
|
+
scope.register(A_FrameNodeChannel);
|
|
32
|
+
scope.register(A_FrameCrypto)
|
|
33
|
+
scope.register(new A_FrameLogger());
|
|
34
|
+
scope.register(A_Frame);
|
|
35
|
+
scope.register(new A_FrameContext());
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@A_Concept.Load()
|
|
40
|
+
async load(
|
|
41
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
42
|
+
@A_Inject(A_FrameIndex) index: A_FrameIndex,
|
|
43
|
+
@A_Inject(A_FrameStorage) storage: A_FrameStorage,
|
|
44
|
+
@A_Inject(A_FrameContext) context: A_FrameContext,
|
|
45
|
+
@A_Inject(A_FrameChannel) channel: A_FrameChannel,
|
|
46
|
+
@A_Inject(A_FrameEnv) env: A_FrameEnv,
|
|
47
|
+
) {
|
|
48
|
+
// 1. Authenticate — required before any storage or embedding operations
|
|
49
|
+
const credentials = await channel.getCredentials();
|
|
50
|
+
context.setCredentials(credentials);
|
|
51
|
+
|
|
52
|
+
const definedNameSpaces = index.listNamespaces();
|
|
53
|
+
const definedDefinitions = index.listDefinitions();
|
|
54
|
+
|
|
55
|
+
// 2. Hydrate all from storage in parallel.
|
|
56
|
+
// Storage load only calls fromJSON when hash AND aFrameServerVersion match,
|
|
57
|
+
// so items with a stale/missing cache remain un-embedded (isEmbed === false).
|
|
58
|
+
await Promise.all([
|
|
59
|
+
...definedNameSpaces.map(ns => ns.load()),
|
|
60
|
+
...definedDefinitions.map(def => def.load()),
|
|
61
|
+
]);
|
|
62
|
+
|
|
63
|
+
// 3. Skip embedding API calls entirely when sync is disabled
|
|
64
|
+
if (!env.A_FRAME_SYNC) return;
|
|
65
|
+
|
|
66
|
+
// 4. Re-embed and persist items whose cache is missing or stale
|
|
67
|
+
const namespacesNeedEmbed = definedNameSpaces.filter(ns => !ns.isEmbed
|
|
68
|
+
|| (ns.aFrameServerVersion !== context.serverVersion)
|
|
69
|
+
|| (ns.aFrameVersion !== env.A_FRAME_VERSION) // re-embed if the client version has changed since last embed, as it may affect embedding results
|
|
70
|
+
);
|
|
71
|
+
const definitionsNeedEmbed = definedDefinitions.filter(def => !def.isEmbed
|
|
72
|
+
|| (def.aFrameServerVersion !== context.serverVersion)
|
|
73
|
+
|| (def.aFrameVersion !== env.A_FRAME_VERSION) // re-embed if the client version has changed since last embed, as it may affect embedding results
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
for (const batch of this.chunkArray(namespacesNeedEmbed, 10)) {
|
|
77
|
+
// Embed in parallel — each namespace hits its own API call independently
|
|
78
|
+
await Promise.all(batch.map(ns => ns.embed()));
|
|
79
|
+
// Save sequentially — all namespaces write to the same __namespaces.aframe file;
|
|
80
|
+
// parallel writes would race and the last writer would overwrite the others
|
|
81
|
+
for (const ns of batch) {
|
|
82
|
+
await ns.save();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
for (const batch of this.chunkArray(definitionsNeedEmbed, 10)) {
|
|
87
|
+
// Embed in parallel — each definition hits its own API call independently
|
|
88
|
+
await Promise.all(batch.map(def => def.embed()));
|
|
89
|
+
// Save sequentially within a namespace — definitions in the same namespace share
|
|
90
|
+
// one file; parallel writes would race and overwrite each other's records
|
|
91
|
+
for (const def of batch) {
|
|
92
|
+
await def.save();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
chunkArray<T>(array: T[], size: number): T[][] {
|
|
99
|
+
const result: T[][] = [];
|
|
100
|
+
for (let i = 0; i < array.length; i += size) {
|
|
101
|
+
result.push(array.slice(i, i + size));
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { A_Component, A_Scope, A_TYPES__A_DependencyInjectable, A_TYPES__Component_Constructor, A_TYPES__Ctor, A_TYPES__Fragment_Constructor } from "@adaas/a-concept";
|
|
2
|
+
import { A_FrameDefineOptions, A_FrameNamespaceOptions } from "./A-Frame.types";
|
|
3
|
+
import { A_FrameDefineDecorator } from "./decorators/A-FrameDefine.decorator";
|
|
4
|
+
import { A_FrameNamespaceDecorator } from "./decorators/A-FrameNamespace.decorator";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export class A_FrameBase extends A_Component {
|
|
9
|
+
/**
|
|
10
|
+
* Primary Decorator to define and index components, containers, entities, fragments and methods in the A-Frame Index structure
|
|
11
|
+
*
|
|
12
|
+
* 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.
|
|
13
|
+
*
|
|
14
|
+
* @param options
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
static Define(options: A_FrameDefineOptions) {
|
|
18
|
+
return A_FrameDefineDecorator(options) as ClassDecorator & MethodDecorator;
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 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.
|
|
23
|
+
*
|
|
24
|
+
* @param options
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
static NameSpace(options: A_FrameNamespaceOptions) {
|
|
28
|
+
return A_FrameNamespaceDecorator(options) as ClassDecorator & MethodDecorator;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Default per-instance dependencies registered on first build. The blob
|
|
35
|
+
* store is intentionally omitted here — the user is expected to seed and
|
|
36
|
+
* register `A_FrameBrowserStorageBlobs` themselves (typically via
|
|
37
|
+
* `A_FrameBrowserStorageBlobs.fromBundle(bundle)` before `concept.load()`).
|
|
38
|
+
* If they don't, `A_FrameBrowserStorageProvider.onLoad()` falls back to the
|
|
39
|
+
* empty singleton.
|
|
40
|
+
*/
|
|
41
|
+
get package(): Array<{ ctor: A_TYPES__Component_Constructor<any> | A_TYPES__Fragment_Constructor<any>; instance: any }> {
|
|
42
|
+
return [
|
|
43
|
+
// { ctor: A_FrameContext, instance: new A_FrameContext() },
|
|
44
|
+
// { ctor: A_FrameEnv, instance: new A_FrameEnv() },
|
|
45
|
+
// { ctor: A_FrameStorageCodec, instance: new A_FrameStorageCodec() },
|
|
46
|
+
// { ctor: A_FrameBrowserStorageProvider, instance: A_FrameBrowserStorageProvider },
|
|
47
|
+
// { ctor: A_FrameLogger, instance: new A_FrameLogger() },
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
protected packDependency<T extends A_TYPES__A_DependencyInjectable>(
|
|
53
|
+
scope: A_Scope,
|
|
54
|
+
target: A_TYPES__Ctor<T> | T,
|
|
55
|
+
def: A_TYPES__Ctor<T> | T,
|
|
56
|
+
) {
|
|
57
|
+
const existing = scope.resolve(target as any);
|
|
58
|
+
if (!existing) scope.register(def);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { A_Fragment } from "@adaas/a-concept"
|
|
2
|
+
import { A_FrameChannelRequest } from "../A-FrameChannel/A-FrameChannelRequest.context";
|
|
3
|
+
import { A_Frame_CredentialResponse } from "../A-FrameChannel/A-FrameChannel.types";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class A_FrameContext extends A_Fragment {
|
|
7
|
+
|
|
8
|
+
private credentials?: A_Frame_CredentialResponse;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
constructor() {
|
|
12
|
+
super({ name: 'a-frame-context' });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
get encryptionKey(): string | undefined {
|
|
17
|
+
return this.credentials?.encryption_key;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
get serverVersion(): string | undefined {
|
|
22
|
+
return this.credentials?.server_version;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
isAuthenticated(): boolean {
|
|
27
|
+
return !!this.credentials;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
setCredentials(credentials: A_FrameChannelRequest<A_Frame_CredentialResponse>) {
|
|
32
|
+
if (credentials.error) {
|
|
33
|
+
this.credentials = undefined;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
this.credentials = credentials.response || undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { A_CommonHelper, A_TypeGuards } from "@adaas/a-concept";
|
|
2
|
-
import {
|
|
2
|
+
import { A_FrameDecoratorTarget, A_FrameMetaTarget } from "./A-Frame.types";
|
|
3
|
+
import { A_FrameIndexTarget } from "../A-FrameIndex/A-FrameIndex.types";
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
export class
|
|
7
|
+
export class A_FrameTypeGuard {
|
|
7
8
|
/**
|
|
8
9
|
* Determines if the target is an allowed type for indexing
|
|
9
10
|
*
|
|
10
11
|
* @param target
|
|
11
12
|
* @returns
|
|
12
13
|
*/
|
|
13
|
-
static isAllowedTarget(target: any): target is
|
|
14
|
+
static isAllowedTarget(target: any): target is A_FrameDecoratorTarget {
|
|
14
15
|
return A_TypeGuards.isEntityConstructor(target)
|
|
15
16
|
|| A_TypeGuards.isComponentConstructor(target)
|
|
16
17
|
|| A_TypeGuards.isContainerConstructor(target)
|
|
@@ -23,12 +24,14 @@ export class A_Frame_IndexTypeGuard {
|
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
|
|
26
|
-
static getTargetName(target:
|
|
27
|
+
static getTargetName(target: A_FrameDecoratorTarget): string {
|
|
27
28
|
return A_CommonHelper.getComponentName(target);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
|
|
31
|
-
static getTargetConstructor(target:
|
|
32
|
-
return typeof target === 'function' ? target : target.constructor as
|
|
32
|
+
static getTargetConstructor(target: A_FrameDecoratorTarget): A_FrameIndexTarget {
|
|
33
|
+
return typeof target === 'function' ? target : target.constructor as A_FrameIndexTarget;
|
|
33
34
|
}
|
|
35
|
+
|
|
36
|
+
|
|
34
37
|
}
|