nextjs-cms-kit 0.5.67 → 0.5.69
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/dist/lib/db-migrate.js
CHANGED
|
@@ -74,10 +74,10 @@ export async function generateDatabaseTables() {
|
|
|
74
74
|
checkStderrForErrors: true, // Also check for errors in output even if exit code is 0
|
|
75
75
|
});
|
|
76
76
|
spinner?.stop();
|
|
77
|
-
p.log.success(chalk.green('✓ Database tables generated'));
|
|
77
|
+
p.log.success(chalk.green(' ✓ Database tables generated'));
|
|
78
78
|
}
|
|
79
79
|
catch (error) {
|
|
80
|
-
console.error(chalk.red('✗ Error generating database tables:'), error);
|
|
80
|
+
console.error(chalk.red(' ✗ Error generating database tables:'), error);
|
|
81
81
|
p.log.error(chalk.red('✗ Failed to generate database tables'));
|
|
82
82
|
process.exit(1);
|
|
83
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-master-admin.d.ts","sourceRoot":"","sources":["../../src/lib/fix-master-admin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fix-master-admin.d.ts","sourceRoot":"","sources":["../../src/lib/fix-master-admin.ts"],"names":[],"mappings":"AAEA,wBAAsB,wBAAwB,kBAoD7C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getPluginRoutes } from 'nextjs-cms/plugins/server';
|
|
1
2
|
export async function fixMasterAdminPrivileges() {
|
|
2
3
|
// Lazy import heavy dependencies to avoid eager database connection initialization
|
|
3
4
|
const { SectionFactory } = await import('nextjs-cms/core/factories');
|
|
@@ -12,8 +13,27 @@ export async function fixMasterAdminPrivileges() {
|
|
|
12
13
|
operations: 'CUD',
|
|
13
14
|
publisher: '1',
|
|
14
15
|
}));
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const pluginRoutes = await getPluginRoutes();
|
|
17
|
+
const pluginNames = new Set(pluginRoutes.map((route) => {
|
|
18
|
+
return route.pluginName;
|
|
19
|
+
}));
|
|
20
|
+
pluginNames.forEach((pluginName) => {
|
|
21
|
+
rows.push({
|
|
22
|
+
adminId: '1',
|
|
23
|
+
sectionName: pluginName,
|
|
24
|
+
operations: 'CUD',
|
|
25
|
+
publisher: '1',
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Add the admins section to the privileges
|
|
30
|
+
*/
|
|
31
|
+
rows.push({
|
|
32
|
+
adminId: '1',
|
|
33
|
+
sectionName: 'admins',
|
|
34
|
+
operations: 'CUD',
|
|
35
|
+
publisher: '1',
|
|
36
|
+
});
|
|
17
37
|
await db
|
|
18
38
|
.insert(AdminPrivilegesTable)
|
|
19
39
|
.values(rows)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextjs-cms-kit",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.69",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nextjs-cms-kit": "./dist/index.js"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"gradient-string": "^3.0.0",
|
|
34
34
|
"mysql2": "^3.12.0",
|
|
35
35
|
"ora": "9.0.0",
|
|
36
|
-
"nextjs-cms": "0.5.
|
|
36
|
+
"nextjs-cms": "0.5.69"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/bcrypt": "^6.0.0",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"tsx": "^4.20.6",
|
|
44
44
|
"typescript": "^5.9.2",
|
|
45
45
|
"@lzcms/eslint-config": "0.3.0",
|
|
46
|
-
"@lzcms/
|
|
47
|
-
"@lzcms/
|
|
46
|
+
"@lzcms/prettier-config": "0.1.0",
|
|
47
|
+
"@lzcms/tsconfig": "0.1.0"
|
|
48
48
|
},
|
|
49
49
|
"prettier": "@lzcms/prettier-config",
|
|
50
50
|
"scripts": {
|