@withonevision/omnihive-core
Advanced tools
Comparing version 4.0.0-alpha.0 to 4.0.0-dev.13
@@ -6,3 +6,3 @@ export declare class HiveWorker { | ||
version: string; | ||
classPath: string; | ||
importPath: string; | ||
default: boolean; | ||
@@ -9,0 +9,0 @@ enabled: boolean; |
@@ -10,3 +10,3 @@ "use strict"; | ||
this.version = ""; | ||
this.classPath = ""; | ||
this.importPath = ""; | ||
this.default = true; | ||
@@ -13,0 +13,0 @@ this.enabled = true; |
@@ -5,3 +5,2 @@ "use strict"; | ||
const ObjectHelper_1 = require("../helpers/ObjectHelper"); | ||
const StringHelper_1 = require("../helpers/StringHelper"); | ||
class HiveWorkerBase { | ||
@@ -16,12 +15,2 @@ constructor() { | ||
} | ||
if (objectAny[key] && | ||
typeof objectAny[key] === "string" && | ||
StringHelper_1.StringHelper.isNullOrWhiteSpace(objectAny[key])) { | ||
throw new Error(`Object key ${key} is a string but it is blank on hive worker ${this.config.name}`); | ||
} | ||
if (objectAny[key] && Array.isArray(objectAny[key])) { | ||
if (objectAny[key].length === 0) { | ||
throw new Error(`Object key ${key} is an array but it is empty on hive worker ${this.config.name}`); | ||
} | ||
} | ||
}); | ||
@@ -28,0 +17,0 @@ return objectData; |
export declare class OmniHiveConstants { | ||
static CONF_NAME: string; | ||
static CUSTOM_REST_ROOT: string; | ||
@@ -3,0 +4,0 @@ static SYSTEM_REST_ROOT: string; |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.OmniHiveConstants = OmniHiveConstants; | ||
OmniHiveConstants.CONF_NAME = "omnihive"; | ||
OmniHiveConstants.CUSTOM_REST_ROOT = "/rest/custom"; | ||
@@ -9,0 +10,0 @@ OmniHiveConstants.SYSTEM_REST_ROOT = "/rest/system"; |
export declare class RegisteredInstance { | ||
name: string; | ||
settings: string; | ||
settingsLocation: string; | ||
serverLocation: string; | ||
version: string; | ||
lastRun: boolean; | ||
} | ||
//# sourceMappingURL=RegisteredInstance.d.ts.map |
@@ -7,3 +7,6 @@ "use strict"; | ||
this.name = ""; | ||
this.settings = ""; | ||
this.settingsLocation = ""; | ||
this.serverLocation = ""; | ||
this.version = ""; | ||
this.lastRun = false; | ||
} | ||
@@ -10,0 +13,0 @@ } |
{ | ||
"name": "@withonevision/omnihive-core", | ||
"version": "4.0.0-alpha.0", | ||
"version": "4.0.0-dev.13", | ||
"description": "OmniHive Core", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -52,6 +52,6 @@ "use strict"; | ||
} | ||
if (!hiveWorker.classPath || hiveWorker.classPath === "") { | ||
throw new Error(`Hive worker type ${hiveWorker.type} with name ${hiveWorker.name} has no classPath`); | ||
if (!hiveWorker.importPath || hiveWorker.importPath === "") { | ||
throw new Error(`Hive worker type ${hiveWorker.type} with name ${hiveWorker.name} has no import path`); | ||
} | ||
const newWorker = await AwaitHelper_1.AwaitHelper.execute(Promise.resolve().then(() => __importStar(require(hiveWorker.classPath)))); | ||
const newWorker = await AwaitHelper_1.AwaitHelper.execute(Promise.resolve().then(() => __importStar(require(hiveWorker.importPath)))); | ||
const newWorkerInstance = new newWorker.default(); | ||
@@ -98,6 +98,6 @@ await AwaitHelper_1.AwaitHelper.execute(newWorkerInstance.init(hiveWorker)); | ||
this.registerWorker = async (hiveWorker) => { | ||
if (!hiveWorker.classPath || hiveWorker.classPath === "") { | ||
throw new Error(`Hive worker type ${hiveWorker.type} with name ${hiveWorker.name} has no classPath`); | ||
if (!hiveWorker.importPath || hiveWorker.importPath === "") { | ||
throw new Error(`Hive worker type ${hiveWorker.type} with name ${hiveWorker.name} has no import path`); | ||
} | ||
const newWorker = await AwaitHelper_1.AwaitHelper.execute(Promise.resolve().then(() => __importStar(require(hiveWorker.classPath)))); | ||
const newWorker = await AwaitHelper_1.AwaitHelper.execute(Promise.resolve().then(() => __importStar(require(hiveWorker.importPath)))); | ||
const newWorkerInstance = new newWorker.default(); | ||
@@ -104,0 +104,0 @@ await AwaitHelper_1.AwaitHelper.execute(newWorkerInstance.init(hiveWorker)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
807867
207
1096