@harperfast/harper 5.0.0-beta.5 → 5.0.0-beta.7
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/bin/harper.js +1 -1
- package/bin/run.js +2 -2
- package/components/Application.ts +9 -5
- package/components/ApplicationScope.ts +3 -3
- package/components/componentLoader.ts +28 -15
- package/components/operations.js +13 -13
- package/components/operationsValidation.js +3 -3
- package/config/configUtils.js +20 -4
- package/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +3 -2
- package/dist/bin/harper.d.ts +1 -1
- package/dist/bin/harper.js +1 -1
- package/dist/bin/run.js +2 -2
- package/dist/bin/run.js.map +1 -1
- package/dist/components/Application.js +9 -4
- package/dist/components/Application.js.map +1 -1
- package/dist/components/ApplicationScope.d.ts +1 -1
- package/dist/components/ApplicationScope.js +2 -2
- package/dist/components/ApplicationScope.js.map +1 -1
- package/dist/components/componentLoader.js +30 -16
- package/dist/components/componentLoader.js.map +1 -1
- package/dist/components/operations.js +13 -13
- package/dist/components/operations.js.map +1 -1
- package/dist/components/operationsValidation.js +3 -3
- package/dist/components/operationsValidation.js.map +1 -1
- package/dist/config/configUtils.d.ts +6 -0
- package/dist/config/configUtils.js +23 -3
- package/dist/config/configUtils.js.map +1 -1
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js +3 -2
- package/dist/dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js.map +1 -1
- package/dist/resources/Resource.d.ts +2 -0
- package/dist/resources/Resource.js +11 -4
- package/dist/resources/Resource.js.map +1 -1
- package/dist/resources/RocksTransactionLogStore.d.ts +1 -0
- package/dist/resources/RocksTransactionLogStore.js +8 -1
- package/dist/resources/RocksTransactionLogStore.js.map +1 -1
- package/dist/resources/analytics/metadata.d.ts +1 -0
- package/dist/resources/analytics/metadata.js +1 -0
- package/dist/resources/analytics/metadata.js.map +1 -1
- package/dist/resources/analytics/read.js +1 -1
- package/dist/resources/analytics/read.js.map +1 -1
- package/dist/resources/analytics/write.d.ts +1 -0
- package/dist/resources/analytics/write.js +42 -0
- package/dist/resources/analytics/write.js.map +1 -1
- package/dist/resources/databases.js +19 -13
- package/dist/resources/databases.js.map +1 -1
- package/dist/security/jsLoader.js +167 -81
- package/dist/security/jsLoader.js.map +1 -1
- package/dist/server/REST.js +17 -10
- package/dist/server/REST.js.map +1 -1
- package/dist/server/http.js +2 -2
- package/dist/server/http.js.map +1 -1
- package/dist/server/itc/serverHandlers.js +1 -1
- package/dist/server/itc/serverHandlers.js.map +1 -1
- package/dist/utility/hdbTerms.d.ts +1 -0
- package/dist/utility/hdbTerms.js +1 -0
- package/dist/utility/hdbTerms.js.map +1 -1
- package/dist/utility/logging/harper_logger.d.ts +2 -1
- package/dist/utility/logging/harper_logger.js +47 -11
- package/dist/utility/logging/harper_logger.js.map +1 -1
- package/dist/utility/logging/readLog.js +2 -2
- package/dist/utility/logging/readLog.js.map +1 -1
- package/dist/utility/npmUtilities.js +2 -2
- package/dist/utility/npmUtilities.js.map +1 -1
- package/dist/validation/configValidator.js +18 -8
- package/dist/validation/configValidator.js.map +1 -1
- package/dist/validation/readLogValidator.js +2 -2
- package/dist/validation/readLogValidator.js.map +1 -1
- package/package.json +3 -3
- package/resources/Resource.ts +17 -6
- package/resources/RocksTransactionLogStore.ts +8 -1
- package/resources/analytics/metadata.ts +1 -0
- package/resources/analytics/read.ts +1 -1
- package/resources/analytics/write.ts +43 -2
- package/resources/databases.ts +24 -15
- package/security/jsLoader.ts +182 -91
- package/server/REST.ts +20 -11
- package/server/http.ts +3 -3
- package/server/itc/serverHandlers.js +1 -1
- package/static/defaultConfig.yaml +1 -1
- package/studio/web/assets/{index-ZhLX9iRh.js → index-ClD_q6ya.js} +5 -5
- package/studio/web/assets/{index-ZhLX9iRh.js.map → index-ClD_q6ya.js.map} +1 -1
- package/studio/web/assets/{index.lazy-DzgnppiN.js → index.lazy-CXzU1gVu.js} +2 -2
- package/studio/web/assets/{index.lazy-DzgnppiN.js.map → index.lazy-CXzU1gVu.js.map} +1 -1
- package/studio/web/assets/{profile-DJ9V18dX.js → profile-DCNVg5yY.js} +2 -2
- package/studio/web/assets/{profile-DJ9V18dX.js.map → profile-DCNVg5yY.js.map} +1 -1
- package/studio/web/assets/{status-DKZUoEUd.js → status-CoGlcjSB.js} +2 -2
- package/studio/web/assets/{status-DKZUoEUd.js.map → status-CoGlcjSB.js.map} +1 -1
- package/studio/web/index.html +1 -1
- package/utility/hdbTerms.ts +1 -0
- package/utility/logging/harper_logger.js +44 -11
- package/utility/logging/readLog.js +2 -2
- package/utility/npmUtilities.js +2 -2
- package/validation/configValidator.js +16 -8
- package/validation/readLogValidator.js +2 -2
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
const hdbTerms = require('../hdbTerms.ts');
|
|
4
4
|
const hdbLogger = require('./harper_logger.js');
|
|
5
|
-
const envMangr = require('../environment/environmentManager.js');
|
|
6
5
|
const validator = require('../../validation/readLogValidator.js');
|
|
7
6
|
const path = require('path');
|
|
8
7
|
const fs = require('fs-extra');
|
|
9
8
|
const { once } = require('events');
|
|
9
|
+
const { getConfigPath } = require('../../config/configUtils.js');
|
|
10
10
|
const { handleHDBError, hdbErrors } = require('../errors/hdbError.js');
|
|
11
11
|
const { PACKAGE_ROOT } = require('../../utility/packageUtils.js');
|
|
12
12
|
const { server } = require('../../server/Server.ts');
|
|
@@ -39,7 +39,7 @@ async function readLog(request) {
|
|
|
39
39
|
// start pulling logs from the other nodes now so it can be done in parallel
|
|
40
40
|
let whenReplicatedResponse = server.replication.replicateOperation(request);
|
|
41
41
|
|
|
42
|
-
const logPath =
|
|
42
|
+
const logPath = getConfigPath(hdbTerms.HDB_SETTINGS_NAMES.LOG_PATH_KEY);
|
|
43
43
|
const logName = request.log_name === undefined ? hdbTerms.LOG_NAMES.HDB : request.log_name;
|
|
44
44
|
const readLogPath =
|
|
45
45
|
logName === hdbTerms.LOG_NAMES.INSTALL
|
package/utility/npmUtilities.js
CHANGED
|
@@ -14,7 +14,7 @@ module.exports = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const { CONFIG_PARAMS } = require('./hdbTerms.ts');
|
|
17
|
-
const {
|
|
17
|
+
const { getConfigPath } = require('../config/configUtils.js');
|
|
18
18
|
const { nonInteractiveSpawn } = require('../components/Application.ts');
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -34,7 +34,7 @@ async function installModules(req) {
|
|
|
34
34
|
|
|
35
35
|
let { projects, dryRun } = req;
|
|
36
36
|
|
|
37
|
-
const componentsRootDirPath =
|
|
37
|
+
const componentsRootDirPath = getConfigPath(CONFIG_PARAMS.COMPONENTSROOT);
|
|
38
38
|
|
|
39
39
|
const responseObject = {};
|
|
40
40
|
|
|
@@ -226,9 +226,17 @@ function doesPathExist(pathToCheck) {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
function validatePath(value, helpers) {
|
|
229
|
-
Joi.assert(value, string.pattern(/^[
|
|
229
|
+
Joi.assert(value, string.pattern(/^[\\/~]$|([\\/~a-zA-Z_0-9:-]+)+$/, 'directory path'));
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
let resolvedValue;
|
|
232
|
+
if (value.startsWith('~/')) {
|
|
233
|
+
resolvedValue = path.join(os.homedir(), value.slice(1));
|
|
234
|
+
} else if (path.isAbsolute(value)) {
|
|
235
|
+
resolvedValue = value;
|
|
236
|
+
} else {
|
|
237
|
+
resolvedValue = path.join(hdbRoot, value);
|
|
238
|
+
}
|
|
239
|
+
const doesExistMsg = doesPathExist(resolvedValue);
|
|
232
240
|
if (doesExistMsg) {
|
|
233
241
|
return helpers.message(doesExistMsg);
|
|
234
242
|
}
|
|
@@ -302,17 +310,17 @@ function setDefaultRoot(parent, helpers) {
|
|
|
302
310
|
|
|
303
311
|
switch (configParam) {
|
|
304
312
|
case 'componentsRoot':
|
|
305
|
-
return
|
|
313
|
+
return DEFAULT_COMPONENTS_FOLDER;
|
|
306
314
|
case 'logging.root':
|
|
307
|
-
return
|
|
315
|
+
return DEFAULT_LOG_FOLDER;
|
|
308
316
|
case 'storage.path':
|
|
309
317
|
const legacyStoragePath = path.join(hdbRoot, hdbTerms.LEGACY_DATABASES_DIR_NAME);
|
|
310
|
-
if (fs.existsSync(legacyStoragePath)) return
|
|
311
|
-
return
|
|
318
|
+
if (fs.existsSync(legacyStoragePath)) return hdbTerms.LEGACY_DATABASES_DIR_NAME;
|
|
319
|
+
return hdbTerms.DATABASES_DIR_NAME;
|
|
312
320
|
case 'logging.rotation.path':
|
|
313
|
-
return
|
|
321
|
+
return DEFAULT_LOG_FOLDER;
|
|
314
322
|
case 'operationsApi.network.domainSocket':
|
|
315
|
-
return configParam == null ? null :
|
|
323
|
+
return configParam == null ? null : 'operations-server';
|
|
316
324
|
default:
|
|
317
325
|
throw new Error(`Error setting default root for config parameter: ${configParam}. Unrecognized config parameter`);
|
|
318
326
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const envMangr = require('../utility/environment/environmentManager.js');
|
|
4
3
|
const Joi = require('joi');
|
|
5
4
|
const validator = require('./validationWrapper.js');
|
|
6
5
|
const moment = require('moment');
|
|
7
6
|
const fs = require('fs-extra');
|
|
8
7
|
const path = require('path');
|
|
9
8
|
const _ = require('lodash');
|
|
9
|
+
const { getConfigPath } = require('../config/configUtils.js');
|
|
10
10
|
const hdbTerms = require('../utility/hdbTerms.ts');
|
|
11
11
|
const { LOG_LEVELS } = require('../utility/hdbTerms.ts');
|
|
12
12
|
|
|
@@ -49,7 +49,7 @@ function validateReadLogPath(value, helpers) {
|
|
|
49
49
|
return helpers.message(`'log_name' '${value}' is invalid.`);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const logPath =
|
|
52
|
+
const logPath = getConfigPath(hdbTerms.HDB_SETTINGS_NAMES.LOG_PATH_KEY);
|
|
53
53
|
const logName = value === undefined ? hdbTerms.LOG_NAMES.HDB : value;
|
|
54
54
|
const readLogPath =
|
|
55
55
|
logName === hdbTerms.LOG_NAMES.INSTALL
|