@static-suite/static-suite-data-server 0.0.23 → 0.0.25

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.
Files changed (155) hide show
  1. package/.husky/pre-commit +0 -3
  2. package/__mocks__/clear-module.js +2 -1
  3. package/dist/bin/serve.js +0 -1
  4. package/dist/http/public/assets/bulma/bulma.min.css +3 -1
  5. package/dist/http/public/assets/simple-datatables/index.js +1 -1
  6. package/dist/http/public/assets/simple-datatables/style.css +32 -7
  7. package/dist/http/routes/cache.d.ts.map +1 -1
  8. package/dist/http/routes/cache.js +1 -1
  9. package/dist/http/routes/data.d.ts.map +1 -1
  10. package/dist/http/routes/data.js +2 -2
  11. package/dist/http/routes/dependency.d.ts.map +1 -1
  12. package/dist/http/routes/docs.d.ts.map +1 -1
  13. package/dist/http/routes/dump.d.ts.map +1 -1
  14. package/dist/http/routes/home.d.ts.map +1 -1
  15. package/dist/http/routes/index.js +6 -6
  16. package/dist/http/routes/indexUUID.d.ts.map +1 -1
  17. package/dist/http/routes/indexUUID.js +3 -3
  18. package/dist/http/routes/indexUrl.d.ts.map +1 -1
  19. package/dist/http/routes/indexUrl.js +4 -1
  20. package/dist/http/routes/query.d.ts.map +1 -1
  21. package/dist/http/routes/status.d.ts.map +1 -1
  22. package/dist/http/routes/subset.d.ts.map +1 -1
  23. package/dist/http/routes/task.d.ts.map +1 -1
  24. package/dist/http/routes/task.js +1 -1
  25. package/dist/lib/config/__tests__/config.test.d.ts +2 -0
  26. package/dist/lib/config/__tests__/config.test.d.ts.map +1 -0
  27. package/dist/lib/config/__tests__/config.test.js +123 -0
  28. package/dist/lib/config/config.d.ts.map +1 -1
  29. package/dist/lib/config/config.js +1 -0
  30. package/dist/lib/dataServer.types.js +1 -1
  31. package/dist/lib/query/__tests__/queryRunner.test.d.ts +2 -0
  32. package/dist/lib/query/__tests__/queryRunner.test.d.ts.map +1 -0
  33. package/dist/lib/query/__tests__/queryRunner.test.js +59 -0
  34. package/dist/lib/query/query.types.d.ts.map +1 -1
  35. package/dist/lib/query/query.types.js +1 -1
  36. package/dist/lib/query/queryTagManager.d.ts.map +1 -1
  37. package/dist/lib/query/queryTagManager.js +0 -1
  38. package/dist/lib/store/dataDir/__tests__/dataDirManager.test.d.ts +2 -0
  39. package/dist/lib/store/dataDir/__tests__/dataDirManager.test.d.ts.map +1 -0
  40. package/dist/lib/store/dataDir/__tests__/dataDirManager.test.js +18 -0
  41. package/dist/lib/store/dependency/dependencyManager.d.ts.map +1 -1
  42. package/dist/lib/store/dependency/dependencyTagger.d.ts.map +1 -1
  43. package/dist/lib/store/dump/dumpMetadataHelper.d.ts.map +1 -1
  44. package/dist/lib/store/dump/dumpMetadataHelper.js +1 -0
  45. package/dist/lib/store/include/__tests__/includeParser.test.d.ts +2 -0
  46. package/dist/lib/store/include/__tests__/includeParser.test.d.ts.map +1 -0
  47. package/dist/lib/store/include/__tests__/includeParser.test.js +77 -0
  48. package/dist/lib/store/include/parsers/__tests__/entityIncludeParser.test.d.ts +2 -0
  49. package/dist/lib/store/include/parsers/__tests__/entityIncludeParser.test.d.ts.map +1 -0
  50. package/dist/lib/store/include/parsers/__tests__/entityIncludeParser.test.js +43 -0
  51. package/dist/lib/store/include/parsers/configIncludeParser.d.ts.map +1 -1
  52. package/dist/lib/store/include/parsers/customIncludeParser.d.ts.map +1 -1
  53. package/dist/lib/store/include/parsers/entityIncludeParser.d.ts.map +1 -1
  54. package/dist/lib/store/include/parsers/localeIncludeParser.d.ts.map +1 -1
  55. package/dist/lib/store/include/parsers/queryIncludeParser.d.ts.map +1 -1
  56. package/dist/lib/store/include/parsers/types/__tests__/aliasIncludeParser.test.d.ts +2 -0
  57. package/dist/lib/store/include/parsers/types/__tests__/aliasIncludeParser.test.d.ts.map +1 -0
  58. package/dist/lib/store/include/parsers/types/__tests__/aliasIncludeParser.test.js +37 -0
  59. package/dist/lib/store/include/parsers/types/__tests__/aliasWithoutTypeIncludeParser.test.d.ts +2 -0
  60. package/dist/lib/store/include/parsers/types/__tests__/aliasWithoutTypeIncludeParser.test.d.ts.map +1 -0
  61. package/dist/lib/store/include/parsers/types/__tests__/aliasWithoutTypeIncludeParser.test.js +37 -0
  62. package/dist/lib/store/include/parsers/types/aliasIncludeParser.d.ts.map +1 -1
  63. package/dist/lib/store/include/parsers/types/aliasWithoutTypeIncludeParser.d.ts.map +1 -1
  64. package/dist/lib/store/workDir/__tests__/workDirHelper.test.d.ts +2 -0
  65. package/dist/lib/store/workDir/__tests__/workDirHelper.test.d.ts.map +1 -0
  66. package/dist/lib/store/workDir/__tests__/workDirHelper.test.js +38 -0
  67. package/dist/lib/store/workDir/storage/__tests__/getChangedLinesBetween.test.d.ts +2 -0
  68. package/dist/lib/store/workDir/storage/__tests__/getChangedLinesBetween.test.d.ts.map +1 -0
  69. package/dist/lib/store/workDir/storage/__tests__/getChangedLinesBetween.test.js +24 -0
  70. package/dist/lib/store/workDir/storage/__tests__/getDataFromLogLine.test.d.ts +2 -0
  71. package/dist/lib/store/workDir/storage/__tests__/getDataFromLogLine.test.d.ts.map +1 -0
  72. package/dist/lib/store/workDir/storage/__tests__/getDataFromLogLine.test.js +18 -0
  73. package/dist/lib/store/workDir/storage/getChangedLinesBetween.d.ts.map +1 -1
  74. package/dist/lib/store/workDir/storage/getDataFromLogLine.d.ts.map +1 -1
  75. package/dist/lib/task/__tests__/taskRunner.test.d.ts +2 -0
  76. package/dist/lib/task/__tests__/taskRunner.test.d.ts.map +1 -0
  77. package/dist/lib/task/__tests__/taskRunner.test.js +50 -0
  78. package/dist/lib/task/task.types.d.ts.map +1 -1
  79. package/dist/lib/utils/array/__tests__/arrayUtils.test.d.ts +2 -0
  80. package/dist/lib/utils/array/__tests__/arrayUtils.test.d.ts.map +1 -0
  81. package/dist/lib/utils/array/__tests__/arrayUtils.test.js +17 -0
  82. package/dist/lib/utils/array/arrayUtils.d.ts.map +1 -1
  83. package/dist/lib/utils/array/arrayUtils.js +0 -1
  84. package/dist/lib/utils/cache/__tests__/cache.test.d.ts +2 -0
  85. package/dist/lib/utils/cache/__tests__/cache.test.d.ts.map +1 -0
  86. package/dist/lib/utils/cache/__tests__/cache.test.js +21 -0
  87. package/dist/lib/utils/fs/__tests__/fsUtils.test.d.ts +2 -0
  88. package/dist/lib/utils/fs/__tests__/fsUtils.test.d.ts.map +1 -0
  89. package/dist/lib/utils/fs/__tests__/fsUtils.test.js +84 -0
  90. package/dist/lib/utils/fs/fsUtils.d.ts.map +1 -1
  91. package/dist/lib/utils/logger/__tests__/logger.test.d.ts +2 -0
  92. package/dist/lib/utils/logger/__tests__/logger.test.d.ts.map +1 -0
  93. package/dist/lib/utils/logger/__tests__/logger.test.js +13 -0
  94. package/dist/lib/utils/logger/logger.d.ts.map +1 -1
  95. package/dist/lib/utils/logger/logger.js +1 -3
  96. package/dist/lib/utils/logger/logger.types.js +1 -1
  97. package/dist/lib/utils/module/__tests__/dirBasedModuleGroupManager.test.d.ts +2 -0
  98. package/dist/lib/utils/module/__tests__/dirBasedModuleGroupManager.test.d.ts.map +1 -0
  99. package/dist/lib/utils/module/__tests__/dirBasedModuleGroupManager.test.js +34 -0
  100. package/dist/lib/utils/module/__tests__/moduleHandler.test.d.ts +2 -0
  101. package/dist/lib/utils/module/__tests__/moduleHandler.test.d.ts.map +1 -0
  102. package/dist/lib/utils/module/__tests__/moduleHandler.test.js +82 -0
  103. package/dist/lib/utils/module/dirBasedModuleGroupManager.d.ts +1 -1
  104. package/dist/lib/utils/module/dirBasedModuleGroupManager.d.ts.map +1 -1
  105. package/dist/lib/utils/module/moduleManager.d.ts +1 -1
  106. package/dist/lib/utils/module/moduleManager.d.ts.map +1 -1
  107. package/dist/lib/utils/module/moduleManager.js +1 -2
  108. package/dist/lib/utils/object/__tests__/objectUtils.test.d.ts +2 -0
  109. package/dist/lib/utils/object/__tests__/objectUtils.test.d.ts.map +1 -0
  110. package/dist/lib/utils/object/__tests__/objectUtils.test.js +60 -0
  111. package/dist/lib/utils/object/objectUtils.d.ts.map +1 -1
  112. package/dist/lib/utils/string/__tests__/stringUtils.test.d.ts +2 -0
  113. package/dist/lib/utils/string/__tests__/stringUtils.test.d.ts.map +1 -0
  114. package/dist/lib/utils/string/__tests__/stringUtils.test.js +51 -0
  115. package/dist/lib/utils/string/stringUtils.d.ts.map +1 -1
  116. package/eslint.config.mjs +18 -0
  117. package/package.json +34 -34
  118. package/scripts/{copy-http-files-to-src.js → copy-http-files-to-src.mjs} +10 -12
  119. package/src/__tests__/fixtures/hook/main.hook.js +4 -3
  120. package/src/__tests__/fixtures/hook/taxonomy/main.hook.js +4 -3
  121. package/src/__tests__/fixtures/hook/taxonomy/taxo.hook.js +4 -3
  122. package/src/__tests__/fixtures/query/error.query.js +1 -1
  123. package/src/__tests__/fixtures/query/noHandler.query.js +1 -0
  124. package/src/__tests__/fixtures/query/query1.query.js +1 -0
  125. package/src/__tests__/fixtures/query/query2.query.js +1 -0
  126. package/src/__tests__/fixtures/query/wrongNamequery.js +1 -0
  127. package/src/__tests__/fixtures/task/error.task.js +1 -1
  128. package/src/__tests__/fixtures/task/noHandler.task.js +1 -0
  129. package/src/__tests__/fixtures/task/task1.task.js +1 -0
  130. package/src/__tests__/fixtures/task/task2.task.js +1 -0
  131. package/src/__tests__/fixtures/task/wrongNametask.js +1 -0
  132. package/src/bin/serve.ts +0 -2
  133. package/src/http/routes/cache.ts +1 -1
  134. package/src/http/routes/data.ts +2 -3
  135. package/src/http/routes/index.ts +6 -6
  136. package/src/http/routes/indexUUID.ts +3 -3
  137. package/src/http/routes/indexUrl.ts +5 -1
  138. package/src/http/routes/task.ts +1 -1
  139. package/src/lib/config/__tests__/config.test.ts +2 -2
  140. package/src/lib/config/config.ts +1 -0
  141. package/src/lib/query/__tests__/queryRunner.test.ts +1 -0
  142. package/src/lib/query/queryTagManager.ts +0 -1
  143. package/src/lib/store/dump/dumpMetadataHelper.ts +1 -0
  144. package/src/lib/task/__tests__/taskRunner.test.ts +1 -0
  145. package/src/lib/utils/array/arrayUtils.ts +0 -1
  146. package/src/lib/utils/fs/__tests__/fsUtils.test.ts +5 -1
  147. package/src/lib/utils/logger/logger.ts +0 -1
  148. package/src/lib/utils/module/__mocks__/dummyModule.query.js +1 -0
  149. package/src/lib/utils/module/__mocks__/dummyModule2.query.js +1 -0
  150. package/src/lib/utils/module/__tests__/dirBasedModuleGroupManager.test.ts +3 -1
  151. package/src/lib/utils/module/__tests__/moduleHandler.test.ts +7 -3
  152. package/src/lib/utils/module/moduleManager.ts +1 -2
  153. package/tsconfig.json +1 -2
  154. package/.eslintignore +0 -4
  155. package/.eslintrc.json +0 -46
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aliasIncludeParser.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/store/include/parsers/types/__tests__/aliasIncludeParser.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const aliasIncludeParser_1 = require("../aliasIncludeParser");
4
+ describe('aliasIncludeParser', () => {
5
+ it('mount data on correct paths without alias and deletes original path', () => {
6
+ const fileContent = {
7
+ data: {
8
+ localeInclude: 'xxx',
9
+ },
10
+ };
11
+ (0, aliasIncludeParser_1.aliasIncludeParser)({
12
+ host: fileContent,
13
+ target: { includedData: 'yyy' },
14
+ mountPath: ['data'],
15
+ includeKey: 'localeInclude',
16
+ });
17
+ expect(fileContent.data).toStrictEqual({
18
+ locale: { includedData: 'yyy' },
19
+ });
20
+ });
21
+ it('mount data on correct paths with alias and deletes original path', () => {
22
+ const fileContent = {
23
+ data: {
24
+ myLocaleInclude: 'xxx',
25
+ },
26
+ };
27
+ (0, aliasIncludeParser_1.aliasIncludeParser)({
28
+ host: fileContent,
29
+ target: { includedData: 'yyy' },
30
+ mountPath: ['data'],
31
+ includeKey: 'myLocaleInclude',
32
+ });
33
+ expect(fileContent.data).toStrictEqual({
34
+ myLocale: { includedData: 'yyy' },
35
+ });
36
+ });
37
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=aliasWithoutTypeIncludeParser.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aliasWithoutTypeIncludeParser.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/store/include/parsers/types/__tests__/aliasWithoutTypeIncludeParser.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const aliasWithoutTypeIncludeParser_1 = require("../aliasWithoutTypeIncludeParser");
4
+ describe('aliasWithoutTypeIncludeParser', () => {
5
+ it('mount data on correct paths without alias and deletes original path', () => {
6
+ const hostObject = {
7
+ data: {
8
+ customInclude: 'xxx',
9
+ },
10
+ };
11
+ (0, aliasWithoutTypeIncludeParser_1.aliasWithoutTypeIncludeParser)({
12
+ host: hostObject,
13
+ target: { includedData: 'yyy' },
14
+ mountPath: ['data'],
15
+ includeKey: 'customInclude',
16
+ }, 'custom');
17
+ expect(hostObject.data).toStrictEqual({
18
+ custom: { includedData: 'yyy' },
19
+ });
20
+ });
21
+ it('mount data on correct paths with alias and deletes original path', () => {
22
+ const hostObject = {
23
+ data: {
24
+ myCustomInclude: 'xxx',
25
+ },
26
+ };
27
+ (0, aliasWithoutTypeIncludeParser_1.aliasWithoutTypeIncludeParser)({
28
+ host: hostObject,
29
+ target: { includedData: 'yyy' },
30
+ mountPath: ['data'],
31
+ includeKey: 'myCustomInclude',
32
+ }, 'custom');
33
+ expect(hostObject.data).toStrictEqual({
34
+ my: { includedData: 'yyy' },
35
+ });
36
+ });
37
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"aliasIncludeParser.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/store/include/parsers/types/aliasIncludeParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAGxE,eAAO,MAAM,kBAAkB,6CAK5B,2BAA2B,KAAG,IAIhC,CAAC"}
1
+ {"version":3,"file":"aliasIncludeParser.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/store/include/parsers/types/aliasIncludeParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAGxE,eAAO,MAAM,kBAAkB,GAAI,0CAKhC,2BAA2B,KAAG,IAIhC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"aliasWithoutTypeIncludeParser.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/store/include/parsers/types/aliasWithoutTypeIncludeParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,4CACC,2BAA2B,QAC9D,MAAM,KACX,IAWF,CAAC"}
1
+ {"version":3,"file":"aliasWithoutTypeIncludeParser.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/store/include/parsers/types/aliasWithoutTypeIncludeParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GACxC,yCAAyC,2BAA2B,EACpE,MAAM,MAAM,KACX,IAWF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=workDirHelper.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workDirHelper.test.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/workDir/__tests__/workDirHelper.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const config_1 = require("../../../config");
9
+ const workDirHelper_1 = require("../workDirHelper");
10
+ describe('workDirHelper test', () => {
11
+ describe('getChangedFilesSince', () => {
12
+ config_1.config.workDir = fs_1.default.realpathSync(path_1.default.resolve('src/__tests__/fixtures/work'));
13
+ it(`Gets modified and deleted files from static-suite log`, () => {
14
+ expect(workDirHelper_1.workDirHelper.getChangedFilesBetween('2021-08-16_07-11-55.666963__3503', '2021-08-17_08-50-00.235800__1900')).toEqual({
15
+ fromUniqueId: '2021-08-16_07-11-55.666963__3503',
16
+ toUniqueId: '2021-08-17_08-50-00.235800__1900',
17
+ deleted: ['es/entity/node/article/10.json'],
18
+ updated: [
19
+ 'en/entity/node/article/10.json',
20
+ 'es/config/static_export.settings.json',
21
+ 'es/entity/node/recipe/9.json',
22
+ ],
23
+ all: [
24
+ { file: 'es/entity/node/article/10.json', type: 'deleted' },
25
+ { file: 'en/entity/node/article/10.json', type: 'updated' },
26
+ {
27
+ file: 'es/config/static_export.settings.json',
28
+ type: 'updated',
29
+ },
30
+ {
31
+ file: 'es/entity/node/recipe/9.json',
32
+ type: 'updated',
33
+ },
34
+ ],
35
+ });
36
+ });
37
+ });
38
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getChangedLinesBetween.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getChangedLinesBetween.test.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/store/workDir/storage/__tests__/getChangedLinesBetween.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fs_1 = __importDefault(require("fs"));
7
+ const path_1 = __importDefault(require("path"));
8
+ const config_1 = require("../../../../config");
9
+ const getChangedLinesBetween_1 = require("../getChangedLinesBetween");
10
+ describe('workDir storage getChangedLinesBetween test', () => {
11
+ describe('getChangedLinesBetween', () => {
12
+ config_1.config.workDir = fs_1.default.realpathSync(path_1.default.resolve('src/__tests__/fixtures/work'));
13
+ it(`Gets lines of log since given date`, () => {
14
+ expect((0, getChangedLinesBetween_1.getChangedLinesBetween)('2021-08-16_07-11-55.666963__3503', '2021-08-17_08-50-00.235800__1900')).toEqual([
15
+ '2021-08-16_07-11-55.666963__3504 delete [ID: 10] Prueba y cultiva tus propias hierbas | static-local://es/entity/node/article/10.json',
16
+ '2021-08-16_07-12-45.771095__5959 write [ID: 10] Give it a go and grow your own herbs | static-local://en/entity/node/article/10.json',
17
+ '2021-08-16_07-12-46.771095__5959 delete [ID: 10] Give it a go and grow your own herbs | static-local://en/entity/node/article/10.json',
18
+ '2021-08-16_07-12-47.771095__5959 write [ID: 10] Give it a go and grow your own herbs | static-local://en/entity/node/article/10.json',
19
+ '2021-08-17_08-49-26.273927__5991 write [ID: static_export.settings] static_export.settings | static-local://es/config/static_export.settings.json',
20
+ '2021-08-17_08-50-00.235800__1900 write [ID: 9] Salsa de chile ardiente | static-local://es/entity/node/recipe/9.json',
21
+ ]);
22
+ });
23
+ });
24
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getDataFromLogLine.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDataFromLogLine.test.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/store/workDir/storage/__tests__/getDataFromLogLine.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const __1 = require("..");
4
+ describe('workDir storage getDataFromLogLine test', () => {
5
+ describe('getDataFromLogLine', () => {
6
+ it(`Gets data from line of log`, () => {
7
+ expect((0, __1.getDataFromLogLine)('2021-08-16_07-12-45.771095__5959 write [ID: 10] Give it a go and grow your own herbs | static-local://en/entity/node/article/10.json')).toStrictEqual({
8
+ file: {
9
+ id: '10',
10
+ label: 'Give it a go and grow your own herbs',
11
+ relativePath: 'en/entity/node/article/10.json',
12
+ },
13
+ operation: 'write',
14
+ uniqueId: '2021-08-16_07-12-45.771095__5959',
15
+ });
16
+ });
17
+ });
18
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"getChangedLinesBetween.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/workDir/storage/getChangedLinesBetween.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,iBACnB,MAAM,cACR,MAAM,KACjB,MAAM,EA6BR,CAAC"}
1
+ {"version":3,"file":"getChangedLinesBetween.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/workDir/storage/getChangedLinesBetween.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,GACjC,cAAc,MAAM,EACpB,YAAY,MAAM,KACjB,MAAM,EA6BR,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getDataFromLogLine.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/workDir/storage/getDataFromLogLine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,WAAW,GAAG,IAuC/D,CAAC"}
1
+ {"version":3,"file":"getDataFromLogLine.d.ts","sourceRoot":"","sources":["../../../../../src/lib/store/workDir/storage/getDataFromLogLine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,WAAW,GAAG,IAuC/D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=taskRunner.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taskRunner.test.d.ts","sourceRoot":"","sources":["../../../../src/lib/task/__tests__/taskRunner.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fs_1 = __importDefault(require("fs"));
7
+ const path_1 = __importDefault(require("path"));
8
+ const config_1 = require("../../config");
9
+ const dataServer_types_1 = require("../../dataServer.types");
10
+ const logger_1 = require("../../utils/logger");
11
+ const task_types_1 = require("../task.types");
12
+ const taskRunner_1 = require("../taskRunner");
13
+ const taskManager_1 = require("../taskManager");
14
+ beforeEach(() => {
15
+ config_1.config.taskDir = fs_1.default.realpathSync(path_1.default.resolve('src/__tests__/fixtures/task'));
16
+ config_1.config.runMode = dataServer_types_1.RunMode.PROD;
17
+ });
18
+ describe('TaskRunner test', () => {
19
+ describe('getAvailableTaskIds', () => {
20
+ it('Returns correct tasks ids from fixtures', () => {
21
+ expect(Array.from(taskManager_1.taskManager.getModuleGroupInfo().keys())).toEqual([
22
+ 'error',
23
+ 'noHandler',
24
+ 'task1',
25
+ 'task2',
26
+ ]);
27
+ });
28
+ });
29
+ describe('run', () => {
30
+ it('Returns task data', () => {
31
+ const taskResponse = taskRunner_1.taskRunner.run('task1', {
32
+ x: 'x',
33
+ y: '33',
34
+ });
35
+ const data = !(0, task_types_1.isTaskErrorResponse)(taskResponse) && taskResponse.data[0];
36
+ expect(data.id).toEqual('33');
37
+ });
38
+ it('Logs error when task fails', () => {
39
+ logger_1.logger.error = jest.fn();
40
+ try {
41
+ taskRunner_1.taskRunner.run('error', {});
42
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
43
+ }
44
+ catch (e) {
45
+ // none
46
+ }
47
+ expect(logger_1.logger.error).toHaveBeenCalled();
48
+ });
49
+ });
50
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"task.types.d.ts","sourceRoot":"","sources":["../../../src/lib/task/task.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C;;;;GAIG;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AAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=arrayUtils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrayUtils.test.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/array/__tests__/arrayUtils.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const arrayUtils_1 = require("../arrayUtils");
4
+ describe('Array utils test', () => {
5
+ describe('arrayRemoveByValue', () => {
6
+ it('removes an existing array item by value', () => {
7
+ const arr = [1, 2, 3];
8
+ (0, arrayUtils_1.arrayRemoveByValue)(arr, 2);
9
+ expect(arr).toEqual([1, 3]);
10
+ });
11
+ it('leaves untouched an array when removing a non existing array item by value', () => {
12
+ const arr = [1, 2, 3];
13
+ (0, arrayUtils_1.arrayRemoveByValue)(arr, 4);
14
+ expect(arr).toEqual([1, 2, 3]);
15
+ });
16
+ });
17
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"arrayUtils.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/array/arrayUtils.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,QAAS,GAAG,EAAE,SAAS,GAAG,KAAG,IAK3D,CAAC"}
1
+ {"version":3,"file":"arrayUtils.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/array/arrayUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,GAAI,KAAK,GAAG,EAAE,EAAE,OAAO,GAAG,KAAG,IAK3D,CAAC"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.arrayRemoveByValue = void 0;
4
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
5
4
  const arrayRemoveByValue = (arr, value) => {
6
5
  const index = arr.indexOf(value);
7
6
  if (index !== -1) {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cache.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.test.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/cache/__tests__/cache.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cacheBinManager_1 = require("../cacheBinManager");
4
+ describe('Cache test', () => {
5
+ it('newly created cache bins are empty', () => {
6
+ expect(cacheBinManager_1.cache.bin('bin1').size).toBe(0);
7
+ });
8
+ it('using several cache bins does not affect any of them', () => {
9
+ cacheBinManager_1.cache.bin('bin1').set('key1', 'value1');
10
+ cacheBinManager_1.cache.bin('bin2').set('key2', 'value2');
11
+ expect(cacheBinManager_1.cache.bin('bin1').get('key1')).toBe('value1');
12
+ expect(cacheBinManager_1.cache.bin('bin2').get('key2')).toBe('value2');
13
+ expect(cacheBinManager_1.cache.bin('bin1').size).toBe(1);
14
+ expect(cacheBinManager_1.cache.bin('bin2').size).toBe(1);
15
+ });
16
+ it('gets the keys of all cache bins', () => {
17
+ cacheBinManager_1.cache.bin('bin1');
18
+ cacheBinManager_1.cache.bin('bin2');
19
+ expect(cacheBinManager_1.cache.keys()).toEqual(['bin1', 'bin2']);
20
+ });
21
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fsUtils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fsUtils.test.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/fs/__tests__/fsUtils.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const fs_1 = __importDefault(require("fs"));
7
+ const path_1 = __importDefault(require("path"));
8
+ const logger_1 = require("../../logger");
9
+ const fsUtils_1 = require("../fsUtils");
10
+ // This test is executed from dist folder
11
+ const fixturesDir = path_1.default.join(__dirname, '../../../../../src/lib/utils/fs/__tests__/fixtures/');
12
+ const jsonFixturePath = path_1.default.join(fixturesDir, 'file.json');
13
+ const jsonRawValue = fs_1.default.readFileSync(jsonFixturePath, 'utf8');
14
+ const jsonParsedValue = JSON.parse(jsonRawValue);
15
+ beforeEach(() => {
16
+ logger_1.logger.error = jest.fn();
17
+ });
18
+ describe('File System utils test', () => {
19
+ describe('isJsonFile', () => {
20
+ it('detects a valid JSON filepath', () => {
21
+ expect((0, fsUtils_1.isJsonFile)('valid-file.json')).toBe(true);
22
+ });
23
+ it('detects an invalid JSON filepath', () => {
24
+ expect((0, fsUtils_1.isJsonFile)('invalid-file.txt')).toBe(false);
25
+ });
26
+ });
27
+ describe('readFile', () => {
28
+ it('reads an existing filepath without logging any error', () => {
29
+ expect((0, fsUtils_1.readFile)(jsonFixturePath)).toBe(jsonRawValue);
30
+ expect(logger_1.logger.error).not.toHaveBeenCalled();
31
+ });
32
+ it('logs an error when reading a non-existing filepath', () => {
33
+ expect((0, fsUtils_1.readFile)('invalid-path')).toBeNull();
34
+ expect(logger_1.logger.error).toHaveBeenCalled();
35
+ });
36
+ });
37
+ describe('getFileContent', () => {
38
+ describe('when a file exists', () => {
39
+ describe('if it is a JSON file', () => {
40
+ it('returns an object with non-null "raw" and "json" properties ', () => {
41
+ const fileContent = (0, fsUtils_1.getFileContent)(jsonFixturePath);
42
+ expect(fileContent.json).toStrictEqual(jsonParsedValue);
43
+ expect(fileContent.raw).toBe(jsonRawValue);
44
+ });
45
+ });
46
+ describe('if it is not a JSON file', () => {
47
+ it('returns an object with a non-null "raw" property and a null "json" property', () => {
48
+ const txtFixturePath = path_1.default.join(fixturesDir, 'file.txt');
49
+ const txtRawValue = fs_1.default.readFileSync(txtFixturePath, 'utf8');
50
+ const fileContent = (0, fsUtils_1.getFileContent)(txtFixturePath);
51
+ expect(fileContent.json).toBeNull();
52
+ expect(fileContent.raw).toBe(txtRawValue);
53
+ });
54
+ });
55
+ });
56
+ describe('when a file does not exist', () => {
57
+ it('returns an object with null "raw" and "json" properties', () => {
58
+ const fileContent = (0, fsUtils_1.getFileContent)('invalid-path');
59
+ expect(fileContent.json).toBeNull();
60
+ expect(fileContent.raw).toBeNull();
61
+ });
62
+ });
63
+ });
64
+ describe('findFilesInDir', () => {
65
+ it('finds a file non-recursively in a directory', () => {
66
+ const filesInDir = (0, fsUtils_1.findFilesInDir)(fixturesDir, '*.txt');
67
+ expect(filesInDir).toStrictEqual(['file.txt']);
68
+ });
69
+ it('finds several files recursively in a directory', () => {
70
+ const filesInDir = (0, fsUtils_1.findFilesInDir)(fixturesDir);
71
+ expect(filesInDir).toStrictEqual(['file.json', 'file.txt']);
72
+ });
73
+ });
74
+ describe('getModificationDate', () => {
75
+ it('returns a Date for an existing filepath without logging any error', () => {
76
+ expect((0, fsUtils_1.getModificationDate)(jsonFixturePath) instanceof Date).toBe(true);
77
+ expect(logger_1.logger.error).not.toHaveBeenCalled();
78
+ });
79
+ it('returns null and logs an error for a non-existing filepath', () => {
80
+ expect((0, fsUtils_1.getModificationDate)('invalid-path')).toBeNull();
81
+ expect(logger_1.logger.error).toHaveBeenCalled();
82
+ });
83
+ });
84
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"fsUtils.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/fs/fsUtils.ts"],"names":[],"mappings":"AAEA,OAAW,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAC;AAI3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,aAAc,MAAM,KAAG,OACd,CAAC;AAEjC;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,aAAc,MAAM,KAAG,MAAM,GAAG,IAWpD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,aAAc,MAAM,KAAG,QAUjD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO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AK,IAAI,CAAC,KACzE,IAyBF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=logger.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.test.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/logger/__tests__/logger.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const logger_1 = require("../logger");
4
+ describe('Logger utils test', () => {
5
+ describe('logger', () => {
6
+ it('is an object with at least four functions: error, warn, info and debug', () => {
7
+ expect(typeof logger_1.logger.error).toBe('function');
8
+ expect(typeof logger_1.logger.warn).toBe('function');
9
+ expect(typeof logger_1.logger.info).toBe('function');
10
+ expect(typeof logger_1.logger.debug).toBe('function');
11
+ });
12
+ });
13
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/logger/logger.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAiBnD;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,MAU3B,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,WAEnB,QAAQ,YACL,OAAO,KAChB,IAwBF,CAAC"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/logger/logger.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAiBnD;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,MAU3B,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAO,QAAwB,EAC/B,UAAU,OAAO,KAChB,IAwBF,CAAC"}
@@ -54,9 +54,7 @@ exports.logger = winston_1.default.createLogger({
54
54
  * @throws
55
55
  * An exception if a log file is defined, but its path is no writable
56
56
  */
57
- const configureLogger = (
58
- // eslint-disable-next-line default-param-last
59
- level = logger_types_1.LogLevel.WARN, logFile) => {
57
+ const configureLogger = (level = logger_types_1.LogLevel.WARN, logFile) => {
60
58
  if (level) {
61
59
  exports.logger.level = level;
62
60
  }
@@ -12,4 +12,4 @@ var LogLevel;
12
12
  LogLevel["WARN"] = "warn";
13
13
  LogLevel["INFO"] = "info";
14
14
  LogLevel["DEBUG"] = "debug";
15
- })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
15
+ })(LogLevel || (exports.LogLevel = LogLevel = {}));
@@ -0,0 +1,2 @@
1
+ export declare const exampleQueryManager: import("../module.types").ModuleGroupManager<unknown>;
2
+ //# sourceMappingURL=dirBasedModuleGroupManager.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dirBasedModuleGroupManager.test.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/module/__tests__/dirBasedModuleGroupManager.test.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB,uDAAsC,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.exampleQueryManager = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const config_1 = require("../../../config");
10
+ const __1 = require("..");
11
+ config_1.config.queryDir = fs_1.default.realpathSync(path_1.default.resolve(path_1.default.join(__dirname, '../../../../../src/lib/utils/module/__mocks__')));
12
+ exports.exampleQueryManager = (0, __1.dirBasedModuleGroupManager)('query');
13
+ describe('dirBasedModuleGroupManager test', () => {
14
+ describe('getModuleGroupInfo', () => {
15
+ it('loads a directory of modules', () => {
16
+ const moduleGroupInfo = exports.exampleQueryManager.getModuleGroupInfo();
17
+ expect(moduleGroupInfo.size).toBe(2);
18
+ expect(Array.from(moduleGroupInfo.keys())).toStrictEqual([
19
+ 'dummyModule',
20
+ 'dummyModule2',
21
+ ]);
22
+ expect(moduleGroupInfo.get('dummyModule')).not.toBe(null);
23
+ expect(moduleGroupInfo.get('dummyModule2')).not.toBe(null);
24
+ });
25
+ });
26
+ describe('reset', () => {
27
+ it('resets a directory of modules', () => {
28
+ const moduleGroupInfo = exports.exampleQueryManager.getModuleGroupInfo();
29
+ expect(moduleGroupInfo.size).toBe(2);
30
+ exports.exampleQueryManager.reset();
31
+ expect(moduleGroupInfo.size).toBe(0);
32
+ });
33
+ });
34
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=moduleHandler.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moduleHandler.test.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/module/__tests__/moduleHandler.test.ts"],"names":[],"mappings":""}