@hyperledger/cactus-core
Advanced tools
Comparing version 0.7.0 to 0.7.1-fix-1226.7df02452.10
@@ -38,2 +38,18 @@ "use strict"; | ||
/** | ||
* Same as `findOneById()` but throws instead of returning an `EMPTY` `Optional` | ||
* when the plugin does not exist in the registry. | ||
* | ||
* @param instanceId The `instanceId` of the plugin that you are looking to obtain an instance of from the registry. | ||
* @throws If there is no plugin in the registry by the `instanceId` specificed. | ||
*/ | ||
getOneById(instanceId) { | ||
cactus_common_1.Checks.nonBlankString(instanceId, "instanceId"); | ||
return this.findOneById(instanceId).orElseThrow(() => new Error(`Plugin ${instanceId} not present in registry`)); | ||
} | ||
findOneById(instanceId) { | ||
cactus_common_1.Checks.nonBlankString(instanceId, "instanceId"); | ||
const plugin = this.getPlugins().find((p) => p.getInstanceId() === instanceId); | ||
return typescript_optional_1.Optional.ofNullable(plugin); | ||
} | ||
/** | ||
* The main difference between this method and `findOneByPackageName` is that this throws an Error if there was nothing to | ||
@@ -46,3 +62,3 @@ * return. It is recommended to use this method over `findOneByPackageName` if you have a hard dependency on a certain | ||
*/ | ||
getOneById(packageName) { | ||
getOneByPackageName(packageName) { | ||
return this.findOneByPackageName(packageName).orElseThrow(() => new Error(`Plugin ${packageName} not present in registry`)); | ||
@@ -99,2 +115,2 @@ } | ||
PluginRegistry.CLASS_NAME = "PluginRegistry"; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2luLXJlZ2lzdHJ5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21haW4vdHlwZXNjcmlwdC9wbHVnaW4tcmVnaXN0cnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNkRBQStDO0FBQy9DLDhEQUlvQztBQUNwQyxrRUFLc0M7QUFXdEM7Ozs7Ozs7R0FPRztBQUNILE1BQWEsY0FBYztJQVN6QixZQUE0QixVQUFrQyxFQUFFO1F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QUFDOztBQS9ISCx3Q0FnSUM7QUEvSHdCLHlCQUFVLEdBQUcsZ0JBQWdCLENBQUMifQ== |
@@ -10,39 +10,39 @@ "use strict"; | ||
tape_1.default("PluginRegistry", (tMain) => { | ||
tape_1.default("findOneByKeychainId() finds plugin by keychain ID", (t) => { | ||
const keychainId = uuid_1.v4(); | ||
const instanceId = uuid_1.v4(); | ||
const mockKeychainPlugin = { | ||
getInstanceId: () => instanceId, | ||
getKeychainId: () => keychainId, | ||
delete: async () => { | ||
throw new Error("This is a mock. Not implemented."); | ||
const keychainId = uuid_1.v4(); | ||
const instanceId = uuid_1.v4(); | ||
const mockKeychainPlugin = { | ||
getInstanceId: () => instanceId, | ||
getKeychainId: () => keychainId, | ||
delete: async () => { | ||
throw new Error("This is a mock. Not implemented."); | ||
}, | ||
has: async () => { | ||
throw new Error("This is a mock. Not implemented."); | ||
}, | ||
get: async () => { | ||
throw new Error("This is a mock. Not implemented."); | ||
}, | ||
set: async () => { | ||
throw new Error("This is a mock. Not implemented."); | ||
}, | ||
getPackageName: () => "@hyperledger/cactus-plugin-keychain-mock", | ||
onPluginInit: async () => { | ||
throw new Error("not sure how this works"); | ||
}, | ||
}; | ||
const pluginRegistry = new public_api_1.PluginRegistry({ | ||
plugins: [ | ||
mockKeychainPlugin, | ||
{ | ||
getInstanceId: () => "some-mock-plugin-instance-id-1", | ||
}, | ||
has: async () => { | ||
throw new Error("This is a mock. Not implemented."); | ||
{ | ||
getInstanceId: () => "some-mock-plugin-instance-id-2", | ||
}, | ||
get: async () => { | ||
throw new Error("This is a mock. Not implemented."); | ||
{ | ||
getInstanceId: () => "some-mock-plugin-instance-id-3", | ||
}, | ||
set: async () => { | ||
throw new Error("This is a mock. Not implemented."); | ||
}, | ||
getPackageName: () => "@hyperledger/cactus-plugin-keychain-mock", | ||
onPluginInit: async () => { | ||
throw new Error("not sure how this works"); | ||
}, | ||
}; | ||
const pluginRegistry = new public_api_1.PluginRegistry({ | ||
plugins: [ | ||
mockKeychainPlugin, | ||
{ | ||
getInstanceId: () => "some-mock-plugin-instance-id-1", | ||
}, | ||
{ | ||
getInstanceId: () => "some-mock-plugin-instance-id-2", | ||
}, | ||
{ | ||
getInstanceId: () => "some-mock-plugin-instance-id-3", | ||
}, | ||
], | ||
}); | ||
], | ||
}); | ||
tape_1.default("findOneByKeychainId() finds plugin by keychain ID", (t) => { | ||
t.doesNotThrow(() => pluginRegistry.findOneByKeychainId(keychainId)); | ||
@@ -55,4 +55,20 @@ const keychainPlugin = pluginRegistry.findOneByKeychainId(keychainId); | ||
}); | ||
tape_1.default("findOneById() finds plugin by its instanceID", (t) => { | ||
t.doesNotThrow(() => pluginRegistry.findOneById(instanceId)); | ||
const keychainPlugin = pluginRegistry.findOneById(instanceId).get(); | ||
t.equal(keychainPlugin, mockKeychainPlugin, "Finds same object by ID OK"); | ||
t.throws(() => pluginRegistry.findOneById(""), /instanceId.*Need non-blank/, "Check for instance ID blankness OK"); | ||
t.true(pluginRegistry.findOneById("x").isEmpty(), "return empty optional for non-existent instance ID OK"); | ||
t.end(); | ||
}); | ||
tape_1.default("getOneById() finds plugin by its instanceID", (t) => { | ||
t.doesNotThrow(() => pluginRegistry.getOneById(instanceId)); | ||
const keychainPlugin = pluginRegistry.getOneById(instanceId); | ||
t.equal(keychainPlugin, mockKeychainPlugin, "Finds same object by ID OK"); | ||
t.throws(() => pluginRegistry.getOneById(""), /instanceId.*Need non-blank/, "Check for instance ID blankness OK"); | ||
t.throws(() => pluginRegistry.getOneById("x"), /not/, "Plugin x not present in registry"); | ||
t.end(); | ||
}); | ||
tMain.end(); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2luLXJlZ2lzdHJ5LnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvdGVzdC90eXBlc2NyaXB0L3VuaXQvcGx1Z2luLXJlZ2lzdHJ5LnRlc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UsQ0FBQyxDQUFDLENBQUM7UUFDNUQsTUFBTSxjQUFjLEdBQUcsY0FBYyxDQUFDLFVBQVUsQ0FBQyxVQUFVLENBQUMsQ0FBQztRQUM3RCxDQUFDLENBQUMsS0FBSyxDQUFDLGNBQWMsRUFBRSxrQkFBa0IsRUFBRSw0QkFBNEIsQ0FBQyxDQUFDO1FBRTFFLENBQUMsQ0FBQyxNQUFNLENBQ04sR0FBRyxFQUFFLENBQUMsY0FBYyxDQUFDLFVBQVUsQ0FBQyxFQUFFLENBQUMsRUFDbkMsNEJBQTRCLEVBQzVCLG9DQUFvQyxDQUNyQyxDQUFDO1FBRUYsQ0FBQyxDQUFDLE1BQU0sQ0FDTixHQUFHLEVBQUUsQ0FBQyxjQUFjLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxFQUNwQyxLQUFLLEVBQ0wsa0NBQWtDLENBQ25DLENBQUM7UUFFRixDQUFDLENBQUMsR0FBRyxFQUFFLENBQUM7SUFDVixDQUFDLENBQUMsQ0FBQztJQUVILEtBQUssQ0FBQyxHQUFHLEVBQUUsQ0FBQztBQUNkLENBQUMsQ0FBQyxDQUFDIn0= |
{ | ||
"name": "@hyperledger/cactus-core", | ||
"version": "0.7.0", | ||
"version": "0.7.1-fix-1226.7df02452.10+7df02452", | ||
"description": "Contains lower level abstractions/implementation that is to be shared by multiple other, higher level packages of the project.", | ||
@@ -10,3 +10,3 @@ "main": "dist/lib/main/typescript/index.js", | ||
"module": "dist/lib/main/typescript/index.js", | ||
"types": "dist/types/main/typescript/index.d.ts", | ||
"types": "dist/lib/main/typescript/index.d.ts", | ||
"files": [ | ||
@@ -67,4 +67,4 @@ "dist/*" | ||
"dependencies": { | ||
"@hyperledger/cactus-common": "0.7.0", | ||
"@hyperledger/cactus-core-api": "0.7.0", | ||
"@hyperledger/cactus-common": "^0.7.1-fix-1226.7df02452.10+7df02452", | ||
"@hyperledger/cactus-core-api": "^0.7.1-fix-1226.7df02452.10+7df02452", | ||
"express": "4.17.1", | ||
@@ -78,3 +78,3 @@ "express-jwt-authz": "2.4.1", | ||
}, | ||
"gitHead": "91bb1f85e1fe45e182114dc05a0f2c4cbe0caeb3" | ||
"gitHead": "7df02452acd940752bc8805779df0f007ee42b66" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances 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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 10 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
210
0
100
1
0
2
56748
25
523
+ Added@hyperledger/cactus-common@0.7.1-main.57afe153.9(transitive)
+ Added@hyperledger/cactus-core-api@0.7.1-main.57afe153.9(transitive)
+ Addedelliptic@6.6.1(transitive)
+ Addednode-gyp-build@4.8.3(transitive)
- Removed@hyperledger/cactus-common@0.7.0(transitive)
- Removed@hyperledger/cactus-core-api@0.7.0(transitive)
- Removedelliptic@6.6.0(transitive)
- Removednode-gyp-build@4.8.2(transitive)
Updated@hyperledger/cactus-common@^0.7.1-fix-1226.7df02452.10+7df02452
Updated@hyperledger/cactus-core-api@^0.7.1-fix-1226.7df02452.10+7df02452