adminforth 1.2.70 → 1.2.71
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/basePlugin.ts +9 -4
- package/dist/basePlugin.js +7 -4
- package/package.json +1 -1
- package/types/AdminForthConfig.ts +1 -1
package/basePlugin.ts
CHANGED
|
@@ -27,12 +27,17 @@ export default class AdminForthPlugin implements IAdminForthPlugin {
|
|
|
27
27
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
instanceUniqueRepresentation(pluginOptions: any) : string {
|
|
31
|
-
|
|
32
|
-
}
|
|
30
|
+
// instanceUniqueRepresentation(pluginOptions: any) : string {
|
|
31
|
+
// return 'non-uniquely-identified';
|
|
32
|
+
// }
|
|
33
33
|
|
|
34
34
|
modifyResourceConfig(adminforth: IAdminForth, resourceConfig: AdminForthResource) {
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
// check if instanceUniqueRepresentation is implmented (by child class)
|
|
37
|
+
//@ts-ignore
|
|
38
|
+
const uniqueness = this['instanceUniqueRepresentation'] ? this.instanceUniqueRepresentation(this.pluginOptions) : 'non-uniquely-identified';
|
|
39
|
+
|
|
40
|
+
const seed = `af_pl_${this.constructor.name}_${resourceConfig.resourceId}_${uniqueness}`;
|
|
36
41
|
this.pluginInstanceId = crypto.createHash('sha256').update(
|
|
37
42
|
seed
|
|
38
43
|
).digest('hex')
|
package/dist/basePlugin.js
CHANGED
|
@@ -13,11 +13,14 @@ export default class AdminForthPlugin {
|
|
|
13
13
|
}
|
|
14
14
|
setupEndpoints(server) {
|
|
15
15
|
}
|
|
16
|
-
instanceUniqueRepresentation(pluginOptions) {
|
|
17
|
-
|
|
18
|
-
}
|
|
16
|
+
// instanceUniqueRepresentation(pluginOptions: any) : string {
|
|
17
|
+
// return 'non-uniquely-identified';
|
|
18
|
+
// }
|
|
19
19
|
modifyResourceConfig(adminforth, resourceConfig) {
|
|
20
|
-
|
|
20
|
+
// check if instanceUniqueRepresentation is implmented (by child class)
|
|
21
|
+
//@ts-ignore
|
|
22
|
+
const uniqueness = this['instanceUniqueRepresentation'] ? this.instanceUniqueRepresentation(this.pluginOptions) : 'non-uniquely-identified';
|
|
23
|
+
const seed = `af_pl_${this.constructor.name}_${resourceConfig.resourceId}_${uniqueness}`;
|
|
21
24
|
this.pluginInstanceId = crypto.createHash('sha256').update(seed).digest('hex');
|
|
22
25
|
process.env.HEAVY_DEBUG && console.log(`🪲 AdminForthPlugin.modifyResourceConfig`, seed, 'id', this.pluginInstanceId);
|
|
23
26
|
this.adminforth = adminforth;
|
package/package.json
CHANGED
|
@@ -298,7 +298,7 @@ export interface IAdminForthPlugin {
|
|
|
298
298
|
* If plugin should support only one installation per resource, option can return 'single'
|
|
299
299
|
* @param pluginOptions - options of plugin
|
|
300
300
|
*/
|
|
301
|
-
instanceUniqueRepresentation(pluginOptions: any) : string;
|
|
301
|
+
instanceUniqueRepresentation?(pluginOptions: any) : string;
|
|
302
302
|
|
|
303
303
|
|
|
304
304
|
/**
|