@static-suite/static-suite-data-server 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +4 -0
- package/.eslintrc.json +49 -0
- package/.nvmrc +1 -0
- package/.prettierrc +10 -0
- package/.vscode/launch.json +44 -0
- package/LICENSE.txt +339 -0
- package/README.md +300 -0
- package/__mocks__/clear-module.js +7 -0
- package/api-extractor.json +339 -0
- package/dist/bin/serve.d.ts +3 -0
- package/dist/bin/serve.d.ts.map +1 -0
- package/dist/bin/serve.js +105 -0
- package/dist/http/README.md +300 -0
- package/dist/http/httpServer.d.ts +4 -0
- package/dist/http/httpServer.d.ts.map +1 -0
- package/dist/http/httpServer.js +24 -0
- package/dist/http/public/assets/bulma/bulma-tooltip.min.css +2 -0
- package/dist/http/public/assets/bulma/bulma.min.css +1 -0
- package/dist/http/public/assets/clipboard/clipboard.min.js +7 -0
- package/dist/http/public/assets/simple-datatables/index.js +12 -0
- package/dist/http/public/assets/simple-datatables/style.css +173 -0
- package/dist/http/routes/cache.d.ts +4 -0
- package/dist/http/routes/cache.d.ts.map +1 -0
- package/dist/http/routes/cache.js +19 -0
- package/dist/http/routes/data.d.ts +4 -0
- package/dist/http/routes/data.d.ts.map +1 -0
- package/dist/http/routes/data.js +104 -0
- package/dist/http/routes/docs.d.ts +3 -0
- package/dist/http/routes/docs.d.ts.map +1 -0
- package/dist/http/routes/docs.js +14 -0
- package/dist/http/routes/dump.d.ts +8 -0
- package/dist/http/routes/dump.d.ts.map +1 -0
- package/dist/http/routes/dump.js +57 -0
- package/dist/http/routes/home.d.ts +3 -0
- package/dist/http/routes/home.d.ts.map +1 -0
- package/dist/http/routes/home.js +17 -0
- package/dist/http/routes/index.d.ts +3 -0
- package/dist/http/routes/index.d.ts.map +1 -0
- package/dist/http/routes/index.js +33 -0
- package/dist/http/routes/query.d.ts +5 -0
- package/dist/http/routes/query.d.ts.map +1 -0
- package/dist/http/routes/query.js +21 -0
- package/dist/http/routes/status.d.ts +9 -0
- package/dist/http/routes/status.d.ts.map +1 -0
- package/dist/http/routes/status.js +74 -0
- package/dist/http/routes/task.d.ts +5 -0
- package/dist/http/routes/task.d.ts.map +1 -0
- package/dist/http/routes/task.js +22 -0
- package/dist/http/views/cacheClear.pug +17 -0
- package/dist/http/views/cacheIndex.pug +19 -0
- package/dist/http/views/data.pug +68 -0
- package/dist/http/views/docs.pug +7 -0
- package/dist/http/views/dumpIndex.pug +14 -0
- package/dist/http/views/home.pug +15 -0
- package/dist/http/views/includes/layout.pug +23 -0
- package/dist/http/views/queryIndex.pug +17 -0
- package/dist/http/views/statusIndex.pug +14 -0
- package/dist/http/views/taskIndex.pug +17 -0
- package/dist/lib/config/config.d.ts +26 -0
- package/dist/lib/config/config.d.ts.map +1 -0
- package/dist/lib/config/config.js +122 -0
- package/dist/lib/config/config.types.d.ts +74 -0
- package/dist/lib/config/config.types.d.ts.map +1 -0
- package/dist/lib/config/config.types.js +2 -0
- package/dist/lib/config/error/InvalidRunMode.d.ts +15 -0
- package/dist/lib/config/error/InvalidRunMode.d.ts.map +1 -0
- package/dist/lib/config/error/InvalidRunMode.js +20 -0
- package/dist/lib/config/error/MissingDirectory.d.ts +24 -0
- package/dist/lib/config/error/MissingDirectory.d.ts.map +1 -0
- package/dist/lib/config/error/MissingDirectory.js +23 -0
- package/dist/lib/config/error/MissingRequiredOption.d.ts +19 -0
- package/dist/lib/config/error/MissingRequiredOption.d.ts.map +1 -0
- package/dist/lib/config/error/MissingRequiredOption.js +21 -0
- package/dist/lib/config/error/NonWritableDirectory.d.ts +24 -0
- package/dist/lib/config/error/NonWritableDirectory.d.ts.map +1 -0
- package/dist/lib/config/error/NonWritableDirectory.js +23 -0
- package/dist/lib/config/error/index.d.ts +5 -0
- package/dist/lib/config/error/index.d.ts.map +1 -0
- package/dist/lib/config/error/index.js +16 -0
- package/dist/lib/config/index.d.ts +2 -0
- package/dist/lib/config/index.d.ts.map +1 -0
- package/dist/lib/config/index.js +13 -0
- package/dist/lib/dataServer.d.ts +21 -0
- package/dist/lib/dataServer.d.ts.map +1 -0
- package/dist/lib/dataServer.js +56 -0
- package/dist/lib/dataServer.types.d.ts +84 -0
- package/dist/lib/dataServer.types.d.ts.map +1 -0
- package/dist/lib/dataServer.types.js +13 -0
- package/dist/lib/error/DomainError.d.ts +9 -0
- package/dist/lib/error/DomainError.d.ts.map +1 -0
- package/dist/lib/error/DomainError.js +20 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +15 -0
- package/dist/lib/query/index.d.ts +3 -0
- package/dist/lib/query/index.d.ts.map +1 -0
- package/dist/lib/query/index.js +14 -0
- package/dist/lib/query/query.types.d.ts +206 -0
- package/dist/lib/query/query.types.d.ts.map +1 -0
- package/dist/lib/query/query.types.js +21 -0
- package/dist/lib/query/queryManager.d.ts +10 -0
- package/dist/lib/query/queryManager.d.ts.map +1 -0
- package/dist/lib/query/queryManager.js +12 -0
- package/dist/lib/query/queryRunner copy.d.ts +3 -0
- package/dist/lib/query/queryRunner copy.d.ts.map +1 -0
- package/dist/lib/query/queryRunner copy.js +87 -0
- package/dist/lib/query/queryRunner.d.ts +3 -0
- package/dist/lib/query/queryRunner.d.ts.map +1 -0
- package/dist/lib/query/queryRunner.js +96 -0
- package/dist/lib/query/queryTagManager.d.ts +3 -0
- package/dist/lib/query/queryTagManager.d.ts.map +1 -0
- package/dist/lib/query/queryTagManager.js +47 -0
- package/dist/lib/store/dataDir/dataDir.types.d.ts +36 -0
- package/dist/lib/store/dataDir/dataDir.types.d.ts.map +1 -0
- package/dist/lib/store/dataDir/dataDir.types.js +2 -0
- package/dist/lib/store/dataDir/dataDirManager.d.ts +3 -0
- package/dist/lib/store/dataDir/dataDirManager.d.ts.map +1 -0
- package/dist/lib/store/dataDir/dataDirManager.js +97 -0
- package/dist/lib/store/dataDir/index.d.ts +2 -0
- package/dist/lib/store/dataDir/index.d.ts.map +1 -0
- package/dist/lib/store/dataDir/index.js +13 -0
- package/dist/lib/store/dependency/dependency.types.d.ts +70 -0
- package/dist/lib/store/dependency/dependency.types.d.ts.map +1 -0
- package/dist/lib/store/dependency/dependency.types.js +2 -0
- package/dist/lib/store/dependency/dependencyFileHelper.d.ts +6 -0
- package/dist/lib/store/dependency/dependencyFileHelper.d.ts.map +1 -0
- package/dist/lib/store/dependency/dependencyFileHelper.js +46 -0
- package/dist/lib/store/dependency/dependencyManager copy.d.ts +6 -0
- package/dist/lib/store/dependency/dependencyManager copy.d.ts.map +1 -0
- package/dist/lib/store/dependency/dependencyManager copy.js +91 -0
- package/dist/lib/store/dependency/dependencyManager.d.ts +6 -0
- package/dist/lib/store/dependency/dependencyManager.d.ts.map +1 -0
- package/dist/lib/store/dependency/dependencyManager.js +78 -0
- package/dist/lib/store/dependency/dependencyManager.types.d.ts +48 -0
- package/dist/lib/store/dependency/dependencyManager.types.d.ts.map +1 -0
- package/dist/lib/store/dependency/dependencyManager.types.js +2 -0
- package/dist/lib/store/dependency/dependencyTagManager.d.ts +6 -0
- package/dist/lib/store/dependency/dependencyTagManager.d.ts.map +1 -0
- package/dist/lib/store/dependency/dependencyTagManager.js +33 -0
- package/dist/lib/store/dependency/dependencyTagger.d.ts +11 -0
- package/dist/lib/store/dependency/dependencyTagger.d.ts.map +1 -0
- package/dist/lib/store/dependency/dependencyTagger.js +99 -0
- package/dist/lib/store/diff/diffManager.d.ts +3 -0
- package/dist/lib/store/diff/diffManager.d.ts.map +1 -0
- package/dist/lib/store/diff/diffManager.js +114 -0
- package/dist/lib/store/diff/diffManager.types.d.ts +50 -0
- package/dist/lib/store/diff/diffManager.types.d.ts.map +1 -0
- package/dist/lib/store/diff/diffManager.types.js +2 -0
- package/dist/lib/store/diff/index.d.ts +2 -0
- package/dist/lib/store/diff/index.d.ts.map +1 -0
- package/dist/lib/store/diff/index.js +13 -0
- package/dist/lib/store/diff/tracker.d.ts +3 -0
- package/dist/lib/store/diff/tracker.d.ts.map +1 -0
- package/dist/lib/store/diff/tracker.js +82 -0
- package/dist/lib/store/diff/tracker.types.d.ts +31 -0
- package/dist/lib/store/diff/tracker.types.d.ts.map +1 -0
- package/dist/lib/store/diff/tracker.types.js +2 -0
- package/dist/lib/store/dump/dumpManager.d.ts +3 -0
- package/dist/lib/store/dump/dumpManager.d.ts.map +1 -0
- package/dist/lib/store/dump/dumpManager.js +199 -0
- package/dist/lib/store/dump/dumpManager.types.d.ts +62 -0
- package/dist/lib/store/dump/dumpManager.types.d.ts.map +1 -0
- package/dist/lib/store/dump/dumpManager.types.js +2 -0
- package/dist/lib/store/dump/index.d.ts +2 -0
- package/dist/lib/store/dump/index.d.ts.map +1 -0
- package/dist/lib/store/dump/index.js +13 -0
- package/dist/lib/store/hook/hook.types.d.ts +205 -0
- package/dist/lib/store/hook/hook.types.d.ts.map +1 -0
- package/dist/lib/store/hook/hook.types.js +2 -0
- package/dist/lib/store/hook/hookManager.d.ts +6 -0
- package/dist/lib/store/hook/hookManager.d.ts.map +1 -0
- package/dist/lib/store/hook/hookManager.js +168 -0
- package/dist/lib/store/hook/index.d.ts +2 -0
- package/dist/lib/store/hook/index.d.ts.map +1 -0
- package/dist/lib/store/hook/index.js +13 -0
- package/dist/lib/store/include/includeIndex.d.ts +6 -0
- package/dist/lib/store/include/includeIndex.d.ts.map +1 -0
- package/dist/lib/store/include/includeIndex.js +65 -0
- package/dist/lib/store/include/includeIndex.types.d.ts +29 -0
- package/dist/lib/store/include/includeIndex.types.d.ts.map +1 -0
- package/dist/lib/store/include/includeIndex.types.js +2 -0
- package/dist/lib/store/include/includeParser.d.ts +3 -0
- package/dist/lib/store/include/includeParser.d.ts.map +1 -0
- package/dist/lib/store/include/includeParser.js +46 -0
- package/dist/lib/store/include/includeParser.types.d.ts +88 -0
- package/dist/lib/store/include/includeParser.types.d.ts.map +1 -0
- package/dist/lib/store/include/includeParser.types.js +2 -0
- package/dist/lib/store/include/index.d.ts +2 -0
- package/dist/lib/store/include/index.d.ts.map +1 -0
- package/dist/lib/store/include/index.js +13 -0
- package/dist/lib/store/include/parsers/configIncludeParser.d.ts +3 -0
- package/dist/lib/store/include/parsers/configIncludeParser.d.ts.map +1 -0
- package/dist/lib/store/include/parsers/configIncludeParser.js +8 -0
- package/dist/lib/store/include/parsers/customIncludeParser.d.ts +3 -0
- package/dist/lib/store/include/parsers/customIncludeParser.d.ts.map +1 -0
- package/dist/lib/store/include/parsers/customIncludeParser.js +8 -0
- package/dist/lib/store/include/parsers/entityIncludeParser.d.ts +3 -0
- package/dist/lib/store/include/parsers/entityIncludeParser.d.ts.map +1 -0
- package/dist/lib/store/include/parsers/entityIncludeParser.js +13 -0
- package/dist/lib/store/include/parsers/index.d.ts +6 -0
- package/dist/lib/store/include/parsers/index.d.ts.map +1 -0
- package/dist/lib/store/include/parsers/index.js +17 -0
- package/dist/lib/store/include/parsers/localeIncludeParser.d.ts +3 -0
- package/dist/lib/store/include/parsers/localeIncludeParser.d.ts.map +1 -0
- package/dist/lib/store/include/parsers/localeIncludeParser.js +8 -0
- package/dist/lib/store/include/parsers/queryIncludeParser.d.ts +11 -0
- package/dist/lib/store/include/parsers/queryIncludeParser.d.ts.map +1 -0
- package/dist/lib/store/include/parsers/queryIncludeParser.js +45 -0
- package/dist/lib/store/include/parsers/types/aliasIncludeParser.d.ts +3 -0
- package/dist/lib/store/include/parsers/types/aliasIncludeParser.d.ts.map +1 -0
- package/dist/lib/store/include/parsers/types/aliasIncludeParser.js +10 -0
- package/dist/lib/store/include/parsers/types/aliasWithoutTypeIncludeParser.d.ts +8 -0
- package/dist/lib/store/include/parsers/types/aliasWithoutTypeIncludeParser.d.ts.map +1 -0
- package/dist/lib/store/include/parsers/types/aliasWithoutTypeIncludeParser.js +18 -0
- package/dist/lib/store/index.d.ts +2 -0
- package/dist/lib/store/index.d.ts.map +1 -0
- package/dist/lib/store/index.js +13 -0
- package/dist/lib/store/store.d.ts +7 -0
- package/dist/lib/store/store.d.ts.map +1 -0
- package/dist/lib/store/store.js +89 -0
- package/dist/lib/store/store.types.d.ts +231 -0
- package/dist/lib/store/store.types.d.ts.map +1 -0
- package/dist/lib/store/store.types.js +2 -0
- package/dist/lib/store/storeManager.d.ts +3 -0
- package/dist/lib/store/storeManager.d.ts.map +1 -0
- package/dist/lib/store/storeManager.js +149 -0
- package/dist/lib/store/workDir/index.d.ts +2 -0
- package/dist/lib/store/workDir/index.d.ts.map +1 -0
- package/dist/lib/store/workDir/index.js +13 -0
- package/dist/lib/store/workDir/storage/getChangedLinesSince.d.ts +9 -0
- package/dist/lib/store/workDir/storage/getChangedLinesSince.d.ts.map +1 -0
- package/dist/lib/store/workDir/storage/getChangedLinesSince.js +47 -0
- package/dist/lib/store/workDir/storage/getDataFromLogLine.d.ts +10 -0
- package/dist/lib/store/workDir/storage/getDataFromLogLine.d.ts.map +1 -0
- package/dist/lib/store/workDir/storage/getDataFromLogLine.js +33 -0
- package/dist/lib/store/workDir/storage/getLogFile.d.ts +8 -0
- package/dist/lib/store/workDir/storage/getLogFile.d.ts.map +1 -0
- package/dist/lib/store/workDir/storage/getLogFile.js +11 -0
- package/dist/lib/store/workDir/storage/index.d.ts +4 -0
- package/dist/lib/store/workDir/storage/index.d.ts.map +1 -0
- package/dist/lib/store/workDir/storage/index.js +20 -0
- package/dist/lib/store/workDir/workDir.types.d.ts +44 -0
- package/dist/lib/store/workDir/workDir.types.d.ts.map +1 -0
- package/dist/lib/store/workDir/workDir.types.js +2 -0
- package/dist/lib/store/workDir/workDirHelper.d.ts +20 -0
- package/dist/lib/store/workDir/workDirHelper.d.ts.map +1 -0
- package/dist/lib/store/workDir/workDirHelper.js +52 -0
- package/dist/lib/task/index.d.ts +3 -0
- package/dist/lib/task/index.d.ts.map +1 -0
- package/dist/lib/task/index.js +14 -0
- package/dist/lib/task/task.types.d.ts +140 -0
- package/dist/lib/task/task.types.d.ts.map +1 -0
- package/dist/lib/task/task.types.js +11 -0
- package/dist/lib/task/taskManager.d.ts +10 -0
- package/dist/lib/task/taskManager.d.ts.map +1 -0
- package/dist/lib/task/taskManager.js +12 -0
- package/dist/lib/task/taskRunner.d.ts +3 -0
- package/dist/lib/task/taskRunner.d.ts.map +1 -0
- package/dist/lib/task/taskRunner.js +71 -0
- package/dist/lib/tsdoc-metadata.json +11 -0
- package/dist/lib/utils/array/arrayUtils.d.ts +2 -0
- package/dist/lib/utils/array/arrayUtils.d.ts.map +1 -0
- package/dist/lib/utils/array/arrayUtils.js +11 -0
- package/dist/lib/utils/cache/cacheBinManager.d.ts +37 -0
- package/dist/lib/utils/cache/cacheBinManager.d.ts.map +1 -0
- package/dist/lib/utils/cache/cacheBinManager.js +53 -0
- package/dist/lib/utils/cache/index.d.ts +2 -0
- package/dist/lib/utils/cache/index.d.ts.map +1 -0
- package/dist/lib/utils/cache/index.js +13 -0
- package/dist/lib/utils/fs/fs.types.d.ts +20 -0
- package/dist/lib/utils/fs/fs.types.d.ts.map +1 -0
- package/dist/lib/utils/fs/fs.types.js +2 -0
- package/dist/lib/utils/fs/fsUtils.d.ts +62 -0
- package/dist/lib/utils/fs/fsUtils.d.ts.map +1 -0
- package/dist/lib/utils/fs/fsUtils.js +137 -0
- package/dist/lib/utils/fs/index.d.ts +2 -0
- package/dist/lib/utils/fs/index.d.ts.map +1 -0
- package/dist/lib/utils/fs/index.js +13 -0
- package/dist/lib/utils/logger/index.d.ts +2 -0
- package/dist/lib/utils/logger/index.d.ts.map +1 -0
- package/dist/lib/utils/logger/index.js +13 -0
- package/dist/lib/utils/logger/logger.d.ts +32 -0
- package/dist/lib/utils/logger/logger.d.ts.map +1 -0
- package/dist/lib/utils/logger/logger.js +82 -0
- package/dist/lib/utils/logger/logger.types.d.ts +37 -0
- package/dist/lib/utils/logger/logger.types.d.ts.map +1 -0
- package/dist/lib/utils/logger/logger.types.js +15 -0
- package/dist/lib/utils/module/dirBasedModuleGroupManager.d.ts +30 -0
- package/dist/lib/utils/module/dirBasedModuleGroupManager.d.ts.map +1 -0
- package/dist/lib/utils/module/dirBasedModuleGroupManager.js +78 -0
- package/dist/lib/utils/module/index.d.ts +3 -0
- package/dist/lib/utils/module/index.d.ts.map +1 -0
- package/dist/lib/utils/module/index.js +14 -0
- package/dist/lib/utils/module/module.types.d.ts +53 -0
- package/dist/lib/utils/module/module.types.d.ts.map +1 -0
- package/dist/lib/utils/module/module.types.js +2 -0
- package/dist/lib/utils/module/moduleManager.d.ts +64 -0
- package/dist/lib/utils/module/moduleManager.d.ts.map +1 -0
- package/dist/lib/utils/module/moduleManager.js +139 -0
- package/dist/lib/utils/object/index.d.ts +2 -0
- package/dist/lib/utils/object/index.d.ts.map +1 -0
- package/dist/lib/utils/object/index.js +13 -0
- package/dist/lib/utils/object/object.types.d.ts +72 -0
- package/dist/lib/utils/object/object.types.d.ts.map +1 -0
- package/dist/lib/utils/object/object.types.js +2 -0
- package/dist/lib/utils/object/objectUtils.d.ts +45 -0
- package/dist/lib/utils/object/objectUtils.d.ts.map +1 -0
- package/dist/lib/utils/object/objectUtils.js +64 -0
- package/dist/lib/utils/string/index.d.ts +2 -0
- package/dist/lib/utils/string/index.d.ts.map +1 -0
- package/dist/lib/utils/string/index.js +13 -0
- package/dist/lib/utils/string/string.types.d.ts +2 -0
- package/dist/lib/utils/string/string.types.d.ts.map +1 -0
- package/dist/lib/utils/string/string.types.js +2 -0
- package/dist/lib/utils/string/stringUtils.d.ts +37 -0
- package/dist/lib/utils/string/stringUtils.d.ts.map +1 -0
- package/dist/lib/utils/string/stringUtils.js +62 -0
- package/dist/lib/watcher/index.d.ts +2 -0
- package/dist/lib/watcher/index.d.ts.map +1 -0
- package/dist/lib/watcher/index.js +13 -0
- package/dist/lib/watcher/watcher.d.ts +17 -0
- package/dist/lib/watcher/watcher.d.ts.map +1 -0
- package/dist/lib/watcher/watcher.js +65 -0
- package/dist/static-suite-data-server.d.ts +392 -0
- package/package.json +102 -0
- package/scripts/copy-http-files-to-src.js +45 -0
- package/src/__tests__/fixtures/data/en/en.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/entity.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/article/article1--card.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/article/article1--small.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/article/article1.json +40 -0
- package/src/__tests__/fixtures/data/en/entity/node/article/article2--card.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/article/article2--small.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/article/article2.json +40 -0
- package/src/__tests__/fixtures/data/en/entity/node/article/article3--card.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/article/article3--small.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/article/article3.json +7 -0
- package/src/__tests__/fixtures/data/en/entity/node/node.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/page/page1--card.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/page/page1--small.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/page/page1.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/page/page2--card.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/page/page2--small.json +3 -0
- package/src/__tests__/fixtures/data/en/entity/node/page/page2.json +3 -0
- package/src/__tests__/fixtures/data/global--block.json +3 -0
- package/src/__tests__/fixtures/data/global.json +3 -0
- package/src/__tests__/fixtures/hook/main.hook.js +15 -0
- package/src/__tests__/fixtures/hook/taxonomy/main.hook.js +15 -0
- package/src/__tests__/fixtures/hook/taxonomy/taxo.hook.js +15 -0
- package/src/__tests__/fixtures/query/error.query.js +6 -0
- package/src/__tests__/fixtures/query/noHandler.query.js +14 -0
- package/src/__tests__/fixtures/query/query1.query.js +15 -0
- package/src/__tests__/fixtures/query/query2.query.js +14 -0
- package/src/__tests__/fixtures/query/wrongNamequery.js +14 -0
- package/src/__tests__/fixtures/task/error.task.js +6 -0
- package/src/__tests__/fixtures/task/noHandler.task.js +13 -0
- package/src/__tests__/fixtures/task/task1.task.js +14 -0
- package/src/__tests__/fixtures/task/task2.task.js +13 -0
- package/src/__tests__/fixtures/task/wrongNametask.js +13 -0
- package/src/bin/serve.ts +107 -0
- package/src/http/httpServer.ts +21 -0
- package/src/http/routes/cache.ts +17 -0
- package/src/http/routes/data.ts +114 -0
- package/src/http/routes/docs.ts +9 -0
- package/src/http/routes/dump.ts +61 -0
- package/src/http/routes/home.ts +16 -0
- package/src/http/routes/index.ts +47 -0
- package/src/http/routes/query.ts +27 -0
- package/src/http/routes/status.ts +89 -0
- package/src/http/routes/task.ts +29 -0
- package/src/http/views/cacheClear.pug +17 -0
- package/src/http/views/cacheIndex.pug +19 -0
- package/src/http/views/data.pug +68 -0
- package/src/http/views/docs.pug +7 -0
- package/src/http/views/dumpIndex.pug +14 -0
- package/src/http/views/home.pug +15 -0
- package/src/http/views/includes/layout.pug +23 -0
- package/src/http/views/queryIndex.pug +17 -0
- package/src/http/views/statusIndex.pug +14 -0
- package/src/http/views/taskIndex.pug +17 -0
- package/src/lib/config/__tests__/config.test.ts +132 -0
- package/src/lib/config/config.ts +143 -0
- package/src/lib/config/config.types.ts +87 -0
- package/src/lib/config/error/InvalidRunMode.ts +17 -0
- package/src/lib/config/error/MissingDirectory.ts +30 -0
- package/src/lib/config/error/MissingRequiredOption.ts +23 -0
- package/src/lib/config/error/NonWritableDirectory.ts +30 -0
- package/src/lib/config/error/index.ts +4 -0
- package/src/lib/config/index.ts +1 -0
- package/src/lib/dataServer.ts +81 -0
- package/src/lib/dataServer.types.ts +98 -0
- package/src/lib/error/DomainError.ts +18 -0
- package/src/lib/index.ts +4 -0
- package/src/lib/query/__tests__/queryRunner.test.ts +61 -0
- package/src/lib/query/index.ts +2 -0
- package/src/lib/query/query.types.ts +231 -0
- package/src/lib/query/queryManager.ts +11 -0
- package/src/lib/query/queryRunner.ts +110 -0
- package/src/lib/query/queryTagManager.ts +53 -0
- package/src/lib/store/dataDir/__tests__/dataDirManager.test.ts +15 -0
- package/src/lib/store/dataDir/dataDir.types.ts +38 -0
- package/src/lib/store/dataDir/dataDirManager.ts +121 -0
- package/src/lib/store/dataDir/index.ts +1 -0
- package/src/lib/store/dependency/dependency.types.ts +78 -0
- package/src/lib/store/dependency/dependencyFileHelper.ts +50 -0
- package/src/lib/store/dependency/dependencyManager.ts +82 -0
- package/src/lib/store/dependency/dependencyTagger.ts +105 -0
- package/src/lib/store/diff/diffManager.ts +122 -0
- package/src/lib/store/diff/diffManager.types.ts +51 -0
- package/src/lib/store/diff/index.ts +1 -0
- package/src/lib/store/dump/dumpManager.ts +235 -0
- package/src/lib/store/dump/dumpManager.types.ts +61 -0
- package/src/lib/store/dump/index.ts +1 -0
- package/src/lib/store/hook/hook.types.ts +232 -0
- package/src/lib/store/hook/hookManager.ts +180 -0
- package/src/lib/store/hook/index.ts +1 -0
- package/src/lib/store/include/__tests__/includeParser.test.ts +80 -0
- package/src/lib/store/include/includeParser.ts +54 -0
- package/src/lib/store/include/includeParser.types.ts +99 -0
- package/src/lib/store/include/index.ts +1 -0
- package/src/lib/store/include/parsers/__tests__/entityIncludeParser.test.ts +43 -0
- package/src/lib/store/include/parsers/configIncludeParser.ts +8 -0
- package/src/lib/store/include/parsers/customIncludeParser.ts +8 -0
- package/src/lib/store/include/parsers/entityIncludeParser.ts +15 -0
- package/src/lib/store/include/parsers/index.ts +5 -0
- package/src/lib/store/include/parsers/localeIncludeParser.ts +8 -0
- package/src/lib/store/include/parsers/queryIncludeParser.ts +51 -0
- package/src/lib/store/include/parsers/types/__tests__/aliasIncludeParser.test.ts +37 -0
- package/src/lib/store/include/parsers/types/__tests__/aliasWithoutTypeIncludeParser.test.ts +43 -0
- package/src/lib/store/include/parsers/types/aliasIncludeParser.ts +13 -0
- package/src/lib/store/include/parsers/types/aliasWithoutTypeIncludeParser.ts +22 -0
- package/src/lib/store/index.ts +1 -0
- package/src/lib/store/store.ts +105 -0
- package/src/lib/store/store.types.ts +251 -0
- package/src/lib/store/storeManager.ts +187 -0
- package/src/lib/store/workDir/__tests__/workDirHelper.test.ts +25 -0
- package/src/lib/store/workDir/index.ts +1 -0
- package/src/lib/store/workDir/storage/__tests__/getChangedLinesSince.test.ts +23 -0
- package/src/lib/store/workDir/storage/__tests__/getDataFromLogLine.test.ts +21 -0
- package/src/lib/store/workDir/storage/getChangedLinesSince.ts +47 -0
- package/src/lib/store/workDir/storage/getDataFromLogLine.ts +31 -0
- package/src/lib/store/workDir/storage/getLogFile.ts +11 -0
- package/src/lib/store/workDir/storage/index.ts +8 -0
- package/src/lib/store/workDir/workDir.types.ts +48 -0
- package/src/lib/store/workDir/workDirHelper.ts +59 -0
- package/src/lib/task/__tests__/taskRunner.test.ts +47 -0
- package/src/lib/task/index.ts +2 -0
- package/src/lib/task/task.types.ts +151 -0
- package/src/lib/task/taskManager.ts +11 -0
- package/src/lib/task/taskRunner.ts +79 -0
- package/src/lib/utils/array/__tests__/arrayUtils.test.ts +16 -0
- package/src/lib/utils/array/arrayUtils.ts +7 -0
- package/src/lib/utils/cache/__tests__/cache.test.ts +24 -0
- package/src/lib/utils/cache/cacheBinManager.ts +88 -0
- package/src/lib/utils/cache/index.ts +1 -0
- package/src/lib/utils/fs/__tests__/fixtures/file.json +3 -0
- package/src/lib/utils/fs/__tests__/fixtures/file.txt +3 -0
- package/src/lib/utils/fs/__tests__/fsUtils.test.ts +93 -0
- package/src/lib/utils/fs/fs.types.ts +21 -0
- package/src/lib/utils/fs/fsUtils.ts +141 -0
- package/src/lib/utils/fs/index.ts +1 -0
- package/src/lib/utils/logger/__tests__/logger.test.ts +12 -0
- package/src/lib/utils/logger/index.ts +1 -0
- package/src/lib/utils/logger/logger.ts +87 -0
- package/src/lib/utils/logger/logger.types.ts +41 -0
- package/src/lib/utils/module/__mocks__/dummyModule.query.js +4 -0
- package/src/lib/utils/module/__mocks__/dummyModule2.query.js +4 -0
- package/src/lib/utils/module/__tests__/dirBasedModuleGroupManager.test.ts +34 -0
- package/src/lib/utils/module/__tests__/moduleHandler.test.ts +100 -0
- package/src/lib/utils/module/dirBasedModuleGroupManager.ts +78 -0
- package/src/lib/utils/module/index.ts +2 -0
- package/src/lib/utils/module/module.types.ts +57 -0
- package/src/lib/utils/module/moduleManager.ts +144 -0
- package/src/lib/utils/object/__tests__/objectUtils.test.ts +62 -0
- package/src/lib/utils/object/index.ts +1 -0
- package/src/lib/utils/object/object.types.ts +74 -0
- package/src/lib/utils/object/objectUtils.ts +71 -0
- package/src/lib/utils/string/__tests__/stringUtils.test.ts +30 -0
- package/src/lib/utils/string/index.ts +1 -0
- package/src/lib/utils/string/string.types.ts +1 -0
- package/src/lib/utils/string/stringUtils.ts +61 -0
- package/src/lib/watcher/index.ts +1 -0
- package/src/lib/watcher/watcher.ts +66 -0
- package/tsconfig.json +83 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hookManager = void 0;
|
|
4
|
+
const config_1 = require("@lib/config");
|
|
5
|
+
const store_1 = require("@lib/store");
|
|
6
|
+
const dependencyTagger_1 = require("@lib/store/dependency/dependencyTagger");
|
|
7
|
+
const module_1 = require("@lib/utils/module");
|
|
8
|
+
/**
|
|
9
|
+
* A manager for hooks stored in a user-land directory defined by configuration.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* It extends dirBasedModuleGroupManager, which manages groups of modules based
|
|
13
|
+
* on a directory: @see {@link dirBasedModuleGroupManager}
|
|
14
|
+
*/
|
|
15
|
+
const moduleManager = (0, module_1.dirBasedModuleGroupManager)('hook');
|
|
16
|
+
/**
|
|
17
|
+
* A specialized hook manager with invoke helpers for all hooks
|
|
18
|
+
*/
|
|
19
|
+
exports.hookManager = {
|
|
20
|
+
reset() {
|
|
21
|
+
moduleManager.reset();
|
|
22
|
+
},
|
|
23
|
+
invokeOnStoreLoadStart() {
|
|
24
|
+
const hookModulesInfo = moduleManager.getModuleGroupInfo();
|
|
25
|
+
hookModulesInfo.forEach(hookInfo => {
|
|
26
|
+
const hookModule = hookInfo.getModule();
|
|
27
|
+
if (hookModule.onStoreLoadStart) {
|
|
28
|
+
hookModule.onStoreLoadStart({
|
|
29
|
+
store: store_1.store,
|
|
30
|
+
dependencyTagger: dependencyTagger_1.dependencyTagger,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
invokeOnProcessFile({ relativeFilepath, fileContent }) {
|
|
36
|
+
let processedFileContent = fileContent;
|
|
37
|
+
let returnValue = null;
|
|
38
|
+
const hookModulesInfo = moduleManager.getModuleGroupInfo();
|
|
39
|
+
hookModulesInfo.forEach(hookInfo => {
|
|
40
|
+
const hookModule = hookInfo.getModule();
|
|
41
|
+
if (hookModule.onProcessFile) {
|
|
42
|
+
returnValue = hookModule.onProcessFile({
|
|
43
|
+
relativeFilepath,
|
|
44
|
+
fileContent: processedFileContent,
|
|
45
|
+
store: store_1.store,
|
|
46
|
+
dependencyTagger: dependencyTagger_1.dependencyTagger,
|
|
47
|
+
});
|
|
48
|
+
if (returnValue) {
|
|
49
|
+
processedFileContent = returnValue;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return processedFileContent;
|
|
54
|
+
},
|
|
55
|
+
invokeOnStoreItemAdd({ relativeFilepath, fileContent }) {
|
|
56
|
+
const hookModulesInfo = moduleManager.getModuleGroupInfo();
|
|
57
|
+
hookModulesInfo.forEach(hookInfo => {
|
|
58
|
+
const hookModule = hookInfo.getModule();
|
|
59
|
+
if (hookModule.onStoreItemAdd) {
|
|
60
|
+
hookModule.onStoreItemAdd({
|
|
61
|
+
relativeFilepath,
|
|
62
|
+
fileContent,
|
|
63
|
+
store: store_1.store,
|
|
64
|
+
dependencyTagger: dependencyTagger_1.dependencyTagger,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
invokeOnStoreLoadDone() {
|
|
70
|
+
const hookModulesInfo = moduleManager.getModuleGroupInfo();
|
|
71
|
+
hookModulesInfo.forEach(hookInfo => {
|
|
72
|
+
const hookModule = hookInfo.getModule();
|
|
73
|
+
if (hookModule.onStoreLoadDone) {
|
|
74
|
+
hookModule.onStoreLoadDone({
|
|
75
|
+
store: store_1.store,
|
|
76
|
+
dependencyTagger: dependencyTagger_1.dependencyTagger,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
invokeOnStoreChangeStart(changedFiles) {
|
|
82
|
+
const hookModulesInfo = moduleManager.getModuleGroupInfo();
|
|
83
|
+
hookModulesInfo.forEach(hookInfo => {
|
|
84
|
+
const hookModule = hookInfo.getModule();
|
|
85
|
+
if (hookModule.onStoreChangeStart) {
|
|
86
|
+
hookModule.onStoreChangeStart({
|
|
87
|
+
store: store_1.store,
|
|
88
|
+
dependencyTagger: dependencyTagger_1.dependencyTagger,
|
|
89
|
+
changedFiles,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
invokeOnStoreItemBeforeUpdate({ relativeFilepath, fileContent }) {
|
|
95
|
+
const hookModulesInfo = moduleManager.getModuleGroupInfo();
|
|
96
|
+
hookModulesInfo.forEach(hookInfo => {
|
|
97
|
+
const hookModule = hookInfo.getModule();
|
|
98
|
+
if (hookModule.onStoreItemBeforeUpdate) {
|
|
99
|
+
hookModule.onStoreItemBeforeUpdate({
|
|
100
|
+
store: store_1.store,
|
|
101
|
+
dependencyTagger: dependencyTagger_1.dependencyTagger,
|
|
102
|
+
relativeFilepath,
|
|
103
|
+
fileContent,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
invokeOnStoreItemAfterUpdate({ relativeFilepath, fileContent }) {
|
|
109
|
+
const hookModulesInfo = moduleManager.getModuleGroupInfo();
|
|
110
|
+
hookModulesInfo.forEach(hookInfo => {
|
|
111
|
+
const hookModule = hookInfo.getModule();
|
|
112
|
+
if (hookModule.onStoreItemAfterUpdate) {
|
|
113
|
+
hookModule.onStoreItemAfterUpdate({
|
|
114
|
+
store: store_1.store,
|
|
115
|
+
dependencyTagger: dependencyTagger_1.dependencyTagger,
|
|
116
|
+
relativeFilepath,
|
|
117
|
+
fileContent,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
invokeOnStoreItemDelete({ relativeFilepath, fileContent }) {
|
|
123
|
+
const hookModulesInfo = moduleManager.getModuleGroupInfo();
|
|
124
|
+
hookModulesInfo.forEach(hookInfo => {
|
|
125
|
+
const hookModule = hookInfo.getModule();
|
|
126
|
+
if (hookModule.onStoreItemDelete) {
|
|
127
|
+
hookModule.onStoreItemDelete({
|
|
128
|
+
store: store_1.store,
|
|
129
|
+
dependencyTagger: dependencyTagger_1.dependencyTagger,
|
|
130
|
+
relativeFilepath,
|
|
131
|
+
fileContent,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
invokeOnStoreChangeDone(changedFiles) {
|
|
137
|
+
const hookModulesInfo = moduleManager.getModuleGroupInfo();
|
|
138
|
+
hookModulesInfo.forEach(hookInfo => {
|
|
139
|
+
const hookModule = hookInfo.getModule();
|
|
140
|
+
if (hookModule.onStoreChangeDone) {
|
|
141
|
+
hookModule.onStoreChangeDone({
|
|
142
|
+
store: store_1.store,
|
|
143
|
+
dependencyTagger: dependencyTagger_1.dependencyTagger,
|
|
144
|
+
changedFiles,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
invokeOnDumpCreate(dump) {
|
|
150
|
+
let processedDump = dump;
|
|
151
|
+
let returnValue = null;
|
|
152
|
+
const hookModulesInfo = moduleManager.getModuleGroupInfo();
|
|
153
|
+
hookModulesInfo.forEach(hookInfo => {
|
|
154
|
+
const hookModule = hookInfo.getModule();
|
|
155
|
+
if (config_1.config.dumpDir && hookModule.onDumpCreate) {
|
|
156
|
+
returnValue = hookModule.onDumpCreate({
|
|
157
|
+
dumpDir: config_1.config.dumpDir,
|
|
158
|
+
store: store_1.store,
|
|
159
|
+
dump: processedDump,
|
|
160
|
+
});
|
|
161
|
+
if (returnValue) {
|
|
162
|
+
processedDump = returnValue;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
return processedDump;
|
|
167
|
+
},
|
|
168
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/hook/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./hookManager"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"includeIndex.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/include/includeIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AA0BrE;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,YAkD1B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.includeIndex = void 0;
|
|
4
|
+
const store_1 = require("@lib/store");
|
|
5
|
+
/**
|
|
6
|
+
* Helper method to get a recursive list of files containing a given file.
|
|
7
|
+
*
|
|
8
|
+
* @param relativeFilepath - Relative file path, inside dataDir, to the file to be searched for.
|
|
9
|
+
* @param parentStack - Stack of already found parents.
|
|
10
|
+
*
|
|
11
|
+
* @returns A list of files as a Set of strings
|
|
12
|
+
*/
|
|
13
|
+
const getRecursiveParents = (relativeFilepath, parentStack) => {
|
|
14
|
+
const parents = store_1.store.index.include.static.get(relativeFilepath);
|
|
15
|
+
if (parents) {
|
|
16
|
+
parents.forEach((parentRelativeFilepath) => {
|
|
17
|
+
parentStack.add(parentRelativeFilepath);
|
|
18
|
+
getRecursiveParents(parentRelativeFilepath, parentStack);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return parentStack;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Service that updates the include index that holds relationships between data.
|
|
25
|
+
*/
|
|
26
|
+
exports.includeIndex = {
|
|
27
|
+
set: (relativeFilepath, fileContents) => {
|
|
28
|
+
const staticIncludes = fileContents?.metadata?.includes?.static;
|
|
29
|
+
if (staticIncludes) {
|
|
30
|
+
Object.values(staticIncludes).forEach((includeRelativeFilepath) => {
|
|
31
|
+
const includeMap = store_1.store.index.include.static.get(includeRelativeFilepath) ||
|
|
32
|
+
store_1.store.index.include.static
|
|
33
|
+
.set(includeRelativeFilepath, new Set())
|
|
34
|
+
.get(includeRelativeFilepath);
|
|
35
|
+
includeMap?.add(relativeFilepath);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const dynamicIncludes = fileContents?.metadata?.includes?.dynamic;
|
|
39
|
+
if (dynamicIncludes) {
|
|
40
|
+
// todo
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
remove: (relativeFilepath, fileContents) => {
|
|
44
|
+
const staticIncludes = fileContents?.metadata?.includes?.static;
|
|
45
|
+
if (staticIncludes) {
|
|
46
|
+
Object.values(staticIncludes).forEach((includeRelativeFilepath) => {
|
|
47
|
+
const includeMap = store_1.store.index.include.static.get(includeRelativeFilepath) ||
|
|
48
|
+
store_1.store.index.include.static
|
|
49
|
+
.set(includeRelativeFilepath, new Set())
|
|
50
|
+
.get(includeRelativeFilepath);
|
|
51
|
+
if (includeMap) {
|
|
52
|
+
includeMap.delete(relativeFilepath);
|
|
53
|
+
if (includeMap.size === 0) {
|
|
54
|
+
store_1.store.index.include.static.delete(includeRelativeFilepath);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const dynamicIncludes = fileContents?.metadata?.includes?.dynamic;
|
|
60
|
+
if (dynamicIncludes) {
|
|
61
|
+
// todo
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
getParents: (relativeFilepath) => Array.from(getRecursiveParents(relativeFilepath, new Set())),
|
|
65
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Json } from '@lib/utils/object/object.types';
|
|
2
|
+
/**
|
|
3
|
+
* Service that updates the include index that holds relationships between data.
|
|
4
|
+
*/
|
|
5
|
+
export declare type IncludeIndex = {
|
|
6
|
+
/**
|
|
7
|
+
* Sets include information for a file.
|
|
8
|
+
*
|
|
9
|
+
* @param relativeFilepath - Relative file path, inside dataDir, to the file to be set.
|
|
10
|
+
* @param fileContents - Contents of the file to be set.
|
|
11
|
+
*/
|
|
12
|
+
set(relativeFilepath: string, fileContents: Json): void;
|
|
13
|
+
/**
|
|
14
|
+
* Removes include information for a file.
|
|
15
|
+
*
|
|
16
|
+
* @param relativeFilepath - Relative file path, inside dataDir, to the file to be removed.
|
|
17
|
+
* @param fileContents - Contents of the file to be removed.
|
|
18
|
+
*/
|
|
19
|
+
remove(relativeFilepath: string, fileContents: Json): void;
|
|
20
|
+
/**
|
|
21
|
+
* Gets a recursive list of files containing a given file.
|
|
22
|
+
*
|
|
23
|
+
* @param relativeFilepath - Relative file path, inside dataDir, to the file to be searched for.
|
|
24
|
+
*
|
|
25
|
+
* @returns A list of files as an array of strings
|
|
26
|
+
*/
|
|
27
|
+
getParents(relativeFilepath: string): string[];
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=includeIndex.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"includeIndex.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/include/includeIndex.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAEtD;;GAEG;AACH,oBAAY,YAAY,GAAG;IACzB;;;;;OAKG;IACH,GAAG,CAAC,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAExD;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAE3D;;;;;;OAMG;IACH,UAAU,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"includeParser.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/include/includeParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAWtD,eAAO,MAAM,aAAa,EAAE,aAyC3B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.includeParser = void 0;
|
|
4
|
+
const parsers_1 = require("./parsers");
|
|
5
|
+
const __1 = require("..");
|
|
6
|
+
exports.includeParser = {
|
|
7
|
+
static: (relativeFilepath, host) => {
|
|
8
|
+
const staticIncludes = host?.metadata?.includes?.static;
|
|
9
|
+
if (!staticIncludes) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
Object.keys(staticIncludes).forEach((includePath) => {
|
|
13
|
+
const mountPath = includePath.split('.');
|
|
14
|
+
const normalizedIncludePath = includePath.toLowerCase();
|
|
15
|
+
const includeKey = mountPath.pop();
|
|
16
|
+
if (includeKey) {
|
|
17
|
+
// All static includes share the same strategy, where the
|
|
18
|
+
// includePath gives access to the final target to be included.
|
|
19
|
+
const targetKey = staticIncludes[includePath];
|
|
20
|
+
const target = __1.store.data.get(targetKey);
|
|
21
|
+
if (normalizedIncludePath.endsWith('configinclude')) {
|
|
22
|
+
(0, parsers_1.configIncludeParser)({ host, target, mountPath, includeKey });
|
|
23
|
+
}
|
|
24
|
+
if (normalizedIncludePath.endsWith('entityinclude')) {
|
|
25
|
+
(0, parsers_1.entityIncludeParser)({ host, target, mountPath, includeKey });
|
|
26
|
+
}
|
|
27
|
+
if (normalizedIncludePath.endsWith('custominclude')) {
|
|
28
|
+
(0, parsers_1.customIncludeParser)({ host, target, mountPath, includeKey });
|
|
29
|
+
}
|
|
30
|
+
if (normalizedIncludePath.endsWith('localeinclude')) {
|
|
31
|
+
(0, parsers_1.localeIncludeParser)({ host, target, mountPath, includeKey });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
dynamic: (host) => {
|
|
37
|
+
const dynamicIncludes = host?.metadata?.includes?.dynamic;
|
|
38
|
+
if (!dynamicIncludes) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
Object.keys(dynamicIncludes).forEach((includePath) => {
|
|
42
|
+
// No need to check if it is a query include.
|
|
43
|
+
(0, parsers_1.queryIncludeParser)({ host, includePath });
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Json } from '@lib/utils/object/object.types';
|
|
2
|
+
/**
|
|
3
|
+
* Global parser that is able to parse static and dynamic includes.
|
|
4
|
+
*/
|
|
5
|
+
export declare type IncludeParser = {
|
|
6
|
+
/**
|
|
7
|
+
* Parse all static includes (entity, config, locale and custom).
|
|
8
|
+
*
|
|
9
|
+
* @param relativeFilepath - Relative file path, inside dataDir, to the file to be parsed.
|
|
10
|
+
* @param host - Object that will host a pointer to a target.
|
|
11
|
+
*/
|
|
12
|
+
static(relativeFilepath: string, host: Json): void;
|
|
13
|
+
/**
|
|
14
|
+
* Parse all dynamic includes (queryInclude at this moment)
|
|
15
|
+
*
|
|
16
|
+
* @param host - Object that will host a pointer to a target.
|
|
17
|
+
*/
|
|
18
|
+
dynamic(host: Json): void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Option to be passed a generic include parser (except entity and query includes).
|
|
22
|
+
*/
|
|
23
|
+
export declare type GenericIncludeParserOptions = {
|
|
24
|
+
/**
|
|
25
|
+
* Object that will host a pointer to a target.
|
|
26
|
+
*/
|
|
27
|
+
host: Json;
|
|
28
|
+
/**
|
|
29
|
+
* Target that will be referenced from a host.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* It can be any kind of data (object, string, array, int, etc), so we can not
|
|
33
|
+
* assume this is going to be an object.
|
|
34
|
+
*
|
|
35
|
+
* For example, custom includes can point to a string file, or query includes
|
|
36
|
+
* can return an error as a string.
|
|
37
|
+
*
|
|
38
|
+
* The only include that can ensure that its target is an object is entity include.
|
|
39
|
+
*/
|
|
40
|
+
target: unknown;
|
|
41
|
+
/**
|
|
42
|
+
* Array of items to the mount point inside the host object, minus the last item (e.g.- ['data', 'content']).
|
|
43
|
+
*/
|
|
44
|
+
mountPath: string[];
|
|
45
|
+
/**
|
|
46
|
+
* Last item of the mount point, that defines the key used to specify the include (e.g.- "configInclude").
|
|
47
|
+
*/
|
|
48
|
+
includeKey: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Option to be passed an entity include parser.
|
|
52
|
+
*/
|
|
53
|
+
export declare type EntityIncludeParserOptions = {
|
|
54
|
+
/**
|
|
55
|
+
* Object that will host a pointer to a target.
|
|
56
|
+
*/
|
|
57
|
+
host: Json;
|
|
58
|
+
/**
|
|
59
|
+
* Entity object that will be referenced from a host.
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* Since entity includes work only with entity data, we are
|
|
63
|
+
* sure that this is an object.
|
|
64
|
+
*/
|
|
65
|
+
target: Json;
|
|
66
|
+
/**
|
|
67
|
+
* Array of items to the mount point inside the host object, minus the last item (e.g.- ['data', 'content']).
|
|
68
|
+
*/
|
|
69
|
+
mountPath: string[];
|
|
70
|
+
/**
|
|
71
|
+
* Last item of the mount point, that defines the key used to specify the include (e.g.- "configInclude").
|
|
72
|
+
*/
|
|
73
|
+
includeKey: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Option to be passed a query include parser.
|
|
77
|
+
*/
|
|
78
|
+
export declare type QueryIncludeParserOptions = {
|
|
79
|
+
/**
|
|
80
|
+
* Object that will host a pointer to a target.
|
|
81
|
+
*/
|
|
82
|
+
host: Json;
|
|
83
|
+
/**
|
|
84
|
+
* Full string of items to the mount point inside the host object.
|
|
85
|
+
*/
|
|
86
|
+
includePath: string;
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=includeParser.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"includeParser.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/include/includeParser.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAEtD;;GAEG;AACH,oBAAY,aAAa,GAAG;IAC1B;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAEnD;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,oBAAY,2BAA2B,GAAG;IACxC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;;;;;;;;;;OAWG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,oBAAY,0BAA0B,GAAG;IACvC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;;;;;OAMG;IACH,MAAM,EAAE,IAAI,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,oBAAY,yBAAyB,GAAG;IACtC;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/include/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./includeParser"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configIncludeParser.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/include/parsers/configIncludeParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAGrE,eAAO,MAAM,mBAAmB,YACrB,2BAA2B,KACnC,IAEF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configIncludeParser = void 0;
|
|
4
|
+
const aliasIncludeParser_1 = require("./types/aliasIncludeParser");
|
|
5
|
+
const configIncludeParser = (options) => {
|
|
6
|
+
(0, aliasIncludeParser_1.aliasIncludeParser)(options);
|
|
7
|
+
};
|
|
8
|
+
exports.configIncludeParser = configIncludeParser;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customIncludeParser.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/include/parsers/customIncludeParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAGrE,eAAO,MAAM,mBAAmB,YACrB,2BAA2B,KACnC,IAEF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.customIncludeParser = void 0;
|
|
4
|
+
const aliasWithoutTypeIncludeParser_1 = require("./types/aliasWithoutTypeIncludeParser");
|
|
5
|
+
const customIncludeParser = (options) => {
|
|
6
|
+
(0, aliasWithoutTypeIncludeParser_1.aliasWithoutTypeIncludeParser)(options, 'custom');
|
|
7
|
+
};
|
|
8
|
+
exports.customIncludeParser = customIncludeParser;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityIncludeParser.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/include/parsers/entityIncludeParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEpE,eAAO,MAAM,mBAAmB,iCAI7B,0BAA0B,KAAG,IAO/B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.entityIncludeParser = void 0;
|
|
4
|
+
const object_1 = require("@lib/utils/object");
|
|
5
|
+
const entityIncludeParser = ({ host, target, mountPath, }) => {
|
|
6
|
+
// Remove a level from mountPath, to mount entity a level up.
|
|
7
|
+
const includeKey = mountPath.pop();
|
|
8
|
+
if (includeKey) {
|
|
9
|
+
const mountPoint = (0, object_1.getObjValue)(host, mountPath);
|
|
10
|
+
mountPoint[includeKey] = target?.data?.content;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
exports.entityIncludeParser = entityIncludeParser;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/include/parsers/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./configIncludeParser"), exports);
|
|
14
|
+
__exportStar(require("./customIncludeParser"), exports);
|
|
15
|
+
__exportStar(require("./entityIncludeParser"), exports);
|
|
16
|
+
__exportStar(require("./localeIncludeParser"), exports);
|
|
17
|
+
__exportStar(require("./queryIncludeParser"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localeIncludeParser.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/include/parsers/localeIncludeParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAGrE,eAAO,MAAM,mBAAmB,YACrB,2BAA2B,KACnC,IAEF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.localeIncludeParser = void 0;
|
|
4
|
+
const aliasIncludeParser_1 = require("./types/aliasIncludeParser");
|
|
5
|
+
const localeIncludeParser = (options) => {
|
|
6
|
+
(0, aliasIncludeParser_1.aliasIncludeParser)(options);
|
|
7
|
+
};
|
|
8
|
+
exports.localeIncludeParser = localeIncludeParser;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { QueryIncludeParserOptions } from '../includeParser.types';
|
|
2
|
+
/**
|
|
3
|
+
* Parses query includes.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Instead of executing a query and adding its result to a JSON file,
|
|
7
|
+
* create a Proxy so queries are only executed when they are consumed,
|
|
8
|
+
* in a Just-In-Time way.
|
|
9
|
+
*/
|
|
10
|
+
export declare const queryIncludeParser: ({ host, includePath, }: QueryIncludeParserOptions) => void;
|
|
11
|
+
//# sourceMappingURL=queryIncludeParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryIncludeParser.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/include/parsers/queryIncludeParser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGnE;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,2BAG5B,yBAAyB,KAAG,IA+B9B,CAAC"}
|