@static-suite/static-suite-data-server 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/http/routes/diff.js +2 -2
- package/dist/http/routes/home.d.ts.map +1 -1
- package/dist/http/routes/home.js +2 -0
- package/dist/http/routes/index.d.ts.map +1 -1
- package/dist/http/routes/index.js +0 -1
- package/dist/http/routes/status.d.ts +1 -2
- package/dist/http/routes/status.d.ts.map +1 -1
- package/dist/http/routes/status.js +1 -11
- package/dist/http/views/cacheIndex.pug +1 -1
- package/dist/http/views/home.pug +1 -1
- package/dist/lib/dataServer.d.ts.map +1 -1
- package/dist/lib/dataServer.js +2 -1
- package/dist/lib/store/dump/dumpManager.d.ts.map +1 -1
- package/dist/lib/store/dump/dumpManager.js +0 -1
- package/package.json +1 -1
- package/src/http/routes/diff.ts +2 -2
- package/src/http/routes/home.ts +2 -0
- package/src/http/routes/index.ts +0 -2
- package/src/http/routes/status.ts +0 -11
- package/src/http/views/cacheIndex.pug +1 -1
- package/src/http/views/home.pug +1 -1
- package/src/lib/dataServer.ts +4 -1
- package/src/lib/store/dump/dumpManager.ts +0 -2
package/dist/http/routes/diff.js
CHANGED
|
@@ -6,8 +6,8 @@ const object_1 = require("../../lib/utils/object");
|
|
|
6
6
|
const diffIndex = (req, res) => {
|
|
7
7
|
res.render('diffIndex', {
|
|
8
8
|
links: {
|
|
9
|
-
'/diff/incremental': 'Execute an incremental
|
|
10
|
-
'/diff/full': 'Execute a full
|
|
9
|
+
'/diff/incremental': 'Execute an incremental diff',
|
|
10
|
+
'/diff/full': 'Execute a full diff',
|
|
11
11
|
'/diff/reset': 'Clears intermediate changes tracked by dependency manager',
|
|
12
12
|
},
|
|
13
13
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../../src/http/routes/home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../../src/http/routes/home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG5C,eAAO,MAAM,IAAI,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAelD,CAAC"}
|
package/dist/http/routes/home.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.home = void 0;
|
|
4
|
+
const package_json_1 = require("../../../package.json");
|
|
4
5
|
const home = (req, res) => {
|
|
5
6
|
res.render('home', {
|
|
7
|
+
version: package_json_1.version,
|
|
6
8
|
links: {
|
|
7
9
|
'/data': 'Browse all data loaded into the server',
|
|
8
10
|
'/dependency': 'Dependency data',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/http/routes/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/http/routes/index.ts"],"names":[],"mappings":"AAmCA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAoCxB,eAAe,MAAM,CAAC"}
|
|
@@ -21,7 +21,6 @@ routes.get('/status/basic', status_1.statusBasic);
|
|
|
21
21
|
routes.get('/status/index/url', status_1.statusIndexUrl);
|
|
22
22
|
routes.get('/status/index/uuid', status_1.statusIndexUuid);
|
|
23
23
|
routes.get('/status/index/custom', status_1.statusIndexCustom);
|
|
24
|
-
routes.get('/status/diff', status_1.statusDiff);
|
|
25
24
|
routes.get('/status', status_1.statusIndex);
|
|
26
25
|
routes.get('/query', query_1.queryIndex);
|
|
27
26
|
routes.get('/query/*queryDefinition', query_1.runQuery);
|
|
@@ -4,6 +4,5 @@ declare const statusBasic: (req: Request, res: Response) => void;
|
|
|
4
4
|
declare const statusIndexUrl: (req: Request, res: Response) => void;
|
|
5
5
|
declare const statusIndexUuid: (req: Request, res: Response) => void;
|
|
6
6
|
declare const statusIndexCustom: (req: Request, res: Response) => void;
|
|
7
|
-
|
|
8
|
-
export { statusIndex, statusBasic, statusIndexUrl, statusIndexUuid, statusIndexCustom, statusDiff, };
|
|
7
|
+
export { statusIndex, statusBasic, statusIndexUrl, statusIndexUuid, statusIndexCustom, };
|
|
9
8
|
//# sourceMappingURL=status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/http/routes/status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/http/routes/status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQ5C,QAAA,MAAM,WAAW,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAUlD,CAAC;AAEF,QAAA,MAAM,WAAW,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAelD,CAAC;AAEF,QAAA,MAAM,cAAc,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAKrD,CAAC;AAEF,QAAA,MAAM,eAAe,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAStD,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,IAKxD,CAAC;AAEF,OAAO,EACL,WAAW,EACX,WAAW,EACX,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,CAAC"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.statusIndexCustom = exports.statusIndexUuid = exports.statusIndexUrl = exports.statusBasic = exports.statusIndex = void 0;
|
|
4
4
|
const dataDir_1 = require("../../lib/store/dataDir");
|
|
5
5
|
const query_1 = require("../../lib/query");
|
|
6
6
|
const config_1 = require("../../lib/config");
|
|
7
7
|
const cache_1 = require("../../lib/utils/cache");
|
|
8
8
|
const store_1 = require("../../lib/store");
|
|
9
|
-
const object_1 = require("../../lib/utils/object");
|
|
10
|
-
const diffManager_1 = require("../../lib/store/diff/diffManager");
|
|
11
9
|
const statusIndex = (req, res) => {
|
|
12
10
|
res.render('statusIndex', {
|
|
13
11
|
links: {
|
|
@@ -16,7 +14,6 @@ const statusIndex = (req, res) => {
|
|
|
16
14
|
'/status/index/uuid': 'List of indexed UUIDs by language',
|
|
17
15
|
'/status/index/include': 'List of indexed includes',
|
|
18
16
|
'/status/index/custom': 'List of custom indexes',
|
|
19
|
-
'/status/diff': 'Executes a diff operation',
|
|
20
17
|
},
|
|
21
18
|
});
|
|
22
19
|
};
|
|
@@ -60,10 +57,3 @@ const statusIndexCustom = (req, res) => {
|
|
|
60
57
|
res.send(response);
|
|
61
58
|
};
|
|
62
59
|
exports.statusIndexCustom = statusIndexCustom;
|
|
63
|
-
const statusDiff = (req, res) => {
|
|
64
|
-
const response = (0, object_1.jsonify)(diffManager_1.diffManager.getDiff());
|
|
65
|
-
res.status(200);
|
|
66
|
-
res.set({ 'Content-Type': 'application/json' });
|
|
67
|
-
res.send(response);
|
|
68
|
-
};
|
|
69
|
-
exports.statusDiff = statusDiff;
|
package/dist/http/views/home.pug
CHANGED
|
@@ -4,7 +4,7 @@ block vars
|
|
|
4
4
|
- var title = "Static Suite Data Server"
|
|
5
5
|
|
|
6
6
|
block content
|
|
7
|
-
h1(class="title is-1")
|
|
7
|
+
h1(class="title is-1")=`Static Suite Data Server ${version}`
|
|
8
8
|
h2(class="subtitle")="Table of Contents"
|
|
9
9
|
table(class="table is-fullwidth is-hoverable")
|
|
10
10
|
tbody
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataServer.d.ts","sourceRoot":"","sources":["../../src/lib/dataServer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataServer.d.ts","sourceRoot":"","sources":["../../src/lib/dataServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAKhE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAG5B;;;;GAIG;AACH,QAAA,MAAM,UAAU;IACd;;;;;;OAMG;oBACa,qBAAqB,KAAG,gBAAgB;CA8CzD,CAAC;AACF,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,WAAW,EACX,uBAAuB,EACvB,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,UAAU,EACV,WAAW,GACZ,CAAC"}
|
package/dist/lib/dataServer.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CacheStatus = exports.LogLevel = exports.RunMode = exports.dataServer = void 0;
|
|
4
|
+
const package_json_1 = require("../../package.json");
|
|
4
5
|
const logger_1 = require("./utils/logger");
|
|
5
6
|
const logger_types_1 = require("./utils/logger/logger.types");
|
|
6
7
|
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return logger_types_1.LogLevel; } });
|
|
@@ -56,7 +57,7 @@ const dataServer = {
|
|
|
56
57
|
}
|
|
57
58
|
dumpIndexHelper_1.dumpIndexHelper.loadDumpIndex();
|
|
58
59
|
}
|
|
59
|
-
logger_1.logger.info(`Data Server loaded in ${Date.now() - startDate}ms.`);
|
|
60
|
+
logger_1.logger.info(`Data Server ${package_json_1.version} loaded in ${Date.now() - startDate}ms.`);
|
|
60
61
|
return {
|
|
61
62
|
store: store_1.store,
|
|
62
63
|
queryRunner: query_1.queryRunner,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dumpManager.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/dump/dumpManager.ts"],"names":[],"mappings":"AASA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AAqKjD,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"dumpManager.d.ts","sourceRoot":"","sources":["../../../../src/lib/store/dump/dumpManager.ts"],"names":[],"mappings":"AASA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AAqKjD,eAAO,MAAM,WAAW,EAAE,WA6EzB,CAAC"}
|
|
@@ -157,7 +157,6 @@ exports.dumpManager = {
|
|
|
157
157
|
if (config_1.config.dumpDir) {
|
|
158
158
|
const filesDumpDir = `${config_1.config.dumpDir}/files`;
|
|
159
159
|
if (diff.updated.size || diff.deleted.size) {
|
|
160
|
-
dumpMetadataHelper_1.dumpMetadataHelper.storeDumpMetadata(dump);
|
|
161
160
|
// Store updated files.
|
|
162
161
|
storeUpdatedFiles(diff, dump, filesDumpDir);
|
|
163
162
|
// Remove deleted files.
|
package/package.json
CHANGED
package/src/http/routes/diff.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { jsonify } from '../../lib/utils/object';
|
|
|
5
5
|
const diffIndex = (req: Request, res: Response): void => {
|
|
6
6
|
res.render('diffIndex', {
|
|
7
7
|
links: {
|
|
8
|
-
'/diff/incremental': 'Execute an incremental
|
|
9
|
-
'/diff/full': 'Execute a full
|
|
8
|
+
'/diff/incremental': 'Execute an incremental diff',
|
|
9
|
+
'/diff/full': 'Execute a full diff',
|
|
10
10
|
'/diff/reset':
|
|
11
11
|
'Clears intermediate changes tracked by dependency manager',
|
|
12
12
|
},
|
package/src/http/routes/home.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
|
+
import { version } from '../../../package.json';
|
|
2
3
|
|
|
3
4
|
export const home = (req: Request, res: Response): void => {
|
|
4
5
|
res.render('home', {
|
|
6
|
+
version,
|
|
5
7
|
links: {
|
|
6
8
|
'/data': 'Browse all data loaded into the server',
|
|
7
9
|
'/dependency': 'Dependency data',
|
package/src/http/routes/index.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { queryIndex, runQuery } from './query';
|
|
|
4
4
|
import { cacheIndex, cacheClear } from './cache';
|
|
5
5
|
import {
|
|
6
6
|
statusBasic,
|
|
7
|
-
statusDiff,
|
|
8
7
|
statusIndex,
|
|
9
8
|
statusIndexCustom,
|
|
10
9
|
statusIndexUrl,
|
|
@@ -42,7 +41,6 @@ routes.get('/status/basic', statusBasic);
|
|
|
42
41
|
routes.get('/status/index/url', statusIndexUrl);
|
|
43
42
|
routes.get('/status/index/uuid', statusIndexUuid);
|
|
44
43
|
routes.get('/status/index/custom', statusIndexCustom);
|
|
45
|
-
routes.get('/status/diff', statusDiff);
|
|
46
44
|
routes.get('/status', statusIndex);
|
|
47
45
|
routes.get('/query', queryIndex);
|
|
48
46
|
routes.get('/query/*queryDefinition', runQuery);
|
|
@@ -5,8 +5,6 @@ import { queryRunner } from '../../lib/query';
|
|
|
5
5
|
import { config } from '../../lib/config';
|
|
6
6
|
import { cache } from '../../lib/utils/cache';
|
|
7
7
|
import { store } from '../../lib/store';
|
|
8
|
-
import { jsonify } from '../../lib/utils/object';
|
|
9
|
-
import { diffManager } from '../../lib/store/diff/diffManager';
|
|
10
8
|
import { ObjectType } from '../../lib/utils/object/object.types';
|
|
11
9
|
|
|
12
10
|
const statusIndex = (req: Request, res: Response): void => {
|
|
@@ -17,7 +15,6 @@ const statusIndex = (req: Request, res: Response): void => {
|
|
|
17
15
|
'/status/index/uuid': 'List of indexed UUIDs by language',
|
|
18
16
|
'/status/index/include': 'List of indexed includes',
|
|
19
17
|
'/status/index/custom': 'List of custom indexes',
|
|
20
|
-
'/status/diff': 'Executes a diff operation',
|
|
21
18
|
},
|
|
22
19
|
});
|
|
23
20
|
};
|
|
@@ -64,18 +61,10 @@ const statusIndexCustom = (req: Request, res: Response): void => {
|
|
|
64
61
|
res.send(response);
|
|
65
62
|
};
|
|
66
63
|
|
|
67
|
-
const statusDiff = (req: Request, res: Response): void => {
|
|
68
|
-
const response = jsonify(diffManager.getDiff());
|
|
69
|
-
res.status(200);
|
|
70
|
-
res.set({ 'Content-Type': 'application/json' });
|
|
71
|
-
res.send(response);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
64
|
export {
|
|
75
65
|
statusIndex,
|
|
76
66
|
statusBasic,
|
|
77
67
|
statusIndexUrl,
|
|
78
68
|
statusIndexUuid,
|
|
79
69
|
statusIndexCustom,
|
|
80
|
-
statusDiff,
|
|
81
70
|
};
|
package/src/http/views/home.pug
CHANGED
|
@@ -4,7 +4,7 @@ block vars
|
|
|
4
4
|
- var title = "Static Suite Data Server"
|
|
5
5
|
|
|
6
6
|
block content
|
|
7
|
-
h1(class="title is-1")
|
|
7
|
+
h1(class="title is-1")=`Static Suite Data Server ${version}`
|
|
8
8
|
h2(class="subtitle")="Table of Contents"
|
|
9
9
|
table(class="table is-fullwidth is-hoverable")
|
|
10
10
|
tbody
|
package/src/lib/dataServer.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { version } from '../../package.json';
|
|
1
2
|
import { configureLogger, logger } from './utils/logger';
|
|
2
3
|
import { LogLevel, LogFile } from './utils/logger/logger.types';
|
|
3
4
|
import { initWatcher } from './watcher';
|
|
@@ -72,7 +73,9 @@ const dataServer = {
|
|
|
72
73
|
dumpIndexHelper.loadDumpIndex();
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
logger.info(
|
|
76
|
+
logger.info(
|
|
77
|
+
`Data Server ${version} loaded in ${Date.now() - startDate}ms.`,
|
|
78
|
+
);
|
|
76
79
|
|
|
77
80
|
return {
|
|
78
81
|
store,
|
|
@@ -191,8 +191,6 @@ export const dumpManager: DumpManager = {
|
|
|
191
191
|
const filesDumpDir = `${config.dumpDir}/files`;
|
|
192
192
|
|
|
193
193
|
if (diff.updated.size || diff.deleted.size) {
|
|
194
|
-
dumpMetadataHelper.storeDumpMetadata(dump);
|
|
195
|
-
|
|
196
194
|
// Store updated files.
|
|
197
195
|
storeUpdatedFiles(diff, dump, filesDumpDir);
|
|
198
196
|
|