adminforth 1.2.38 → 1.2.39

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 CHANGED
@@ -4,8 +4,7 @@ import { currentFileDir } from './modules/utils.js';
4
4
  import path from 'path';
5
5
  import fs from 'fs';
6
6
 
7
- // @ts-ignore
8
- import sha256 from 'crypto-js/sha256';
7
+ import crypto from 'crypto';
9
8
 
10
9
 
11
10
  export default class AdminForthPlugin implements IAdminForthPlugin {
@@ -33,10 +32,10 @@ export default class AdminForthPlugin implements IAdminForthPlugin {
33
32
  }
34
33
 
35
34
  modifyResourceConfig(adminforth: IAdminForth, resourceConfig: AdminForthResource) {
36
- this.pluginInstanceId = sha256(
35
+ this.pluginInstanceId = crypto.createHash('sha256').update(
37
36
  `af_pl_${this.constructor.name}_${resourceConfig.resourceId}_${this.instanceUniqueRepresentation(this.pluginOptions)}`
38
- ).toString();
39
- console.log(`5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣ Plugin instance id: ${this.pluginInstanceId}`);
37
+ ).digest('hex')
38
+
40
39
  this.adminforth = adminforth;
41
40
  }
42
41
 
@@ -2,8 +2,7 @@ import { getComponentNameFromPath } from './modules/utils.js';
2
2
  import { currentFileDir } from './modules/utils.js';
3
3
  import path from 'path';
4
4
  import fs from 'fs';
5
- // @ts-ignore
6
- import sha256 from 'crypto-js/sha256';
5
+ import crypto from 'crypto';
7
6
  export default class AdminForthPlugin {
8
7
  constructor(pluginOptions, metaUrl) {
9
8
  this.customFolderName = 'custom';
@@ -18,8 +17,7 @@ export default class AdminForthPlugin {
18
17
  return 'non-uniquely-identified';
19
18
  }
20
19
  modifyResourceConfig(adminforth, resourceConfig) {
21
- this.pluginInstanceId = sha256(`af_pl_${this.constructor.name}_${resourceConfig.resourceId}_${this.instanceUniqueRepresentation(this.pluginOptions)}`).toString();
22
- console.log(`5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣5️⃣ Plugin instance id: ${this.pluginInstanceId}`);
20
+ this.pluginInstanceId = crypto.createHash('sha256').update(`af_pl_${this.constructor.name}_${resourceConfig.resourceId}_${this.instanceUniqueRepresentation(this.pluginOptions)}`).digest('hex');
23
21
  this.adminforth = adminforth;
24
22
  }
25
23
  componentPath(componentFile) {
@@ -11,8 +11,7 @@ import { AdminForthResourcePages, AllowedActionsEnum, } from "../types/AdminFort
11
11
  import fs from 'fs';
12
12
  import path from 'path';
13
13
  import { guessLabelFromName } from './utils.js';
14
- // @ts-ignore
15
- import sha256 from 'crypto-js/sha256';
14
+ import crypto from 'crypto';
16
15
  export default class ConfigValidator {
17
16
  constructor(adminforth, config) {
18
17
  this.adminforth = adminforth;
@@ -277,7 +276,7 @@ export default class ConfigValidator {
277
276
  }
278
277
  bulkActions.map((action) => {
279
278
  if (!action.id) {
280
- action.id = sha256(action.label).toString();
279
+ action.id = crypto.createHash('sha256').update(action.label).digest('hex');
281
280
  }
282
281
  });
283
282
  res.options.bulkActions = bulkActions;
@@ -12,8 +12,7 @@ import fs from 'fs';
12
12
  import path from 'path';
13
13
  import { guessLabelFromName } from './utils.js';
14
14
 
15
- // @ts-ignore
16
- import sha256 from 'crypto-js/sha256';
15
+ import crypto from 'crypto';
17
16
 
18
17
  export default class ConfigValidator implements IConfigValidator {
19
18
 
@@ -317,7 +316,9 @@ export default class ConfigValidator implements IConfigValidator {
317
316
 
318
317
  bulkActions.map((action) => {
319
318
  if (!action.id) {
320
- action.id = sha256(action.label).toString();
319
+ action.id = crypto.createHash('sha256').update(
320
+ action.label,
321
+ ).digest('hex');
321
322
  }
322
323
  });
323
324
  res.options.bulkActions = bulkActions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.2.38",
3
+ "version": "1.2.39",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,8 +17,6 @@
17
17
  "dependencies": {
18
18
  "@clickhouse/client": "^1.4.0",
19
19
  "better-sqlite3": "^10.0.0",
20
- "crypto": "^1.0.1",
21
- "crypto-js": "^4.2.0",
22
20
  "dayjs": "^1.11.11",
23
21
  "express": "^4.19.2",
24
22
  "filewatcher": "^3.0.1",