@nocobase/plugin-ui-schema-storage 1.6.0-beta.9 → 1.6.0
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/externalVersion.js +7 -7
- package/dist/server/collections/uiButtonSchemasRoles.d.ts +10 -0
- package/dist/server/collections/uiButtonSchemasRoles.js +37 -0
- package/dist/server/collections/uiSchemas.js +11 -0
- package/dist/server/migrations/20250226105145-custom-request-action.d.ts +14 -0
- package/dist/server/migrations/20250226105145-custom-request-action.js +50 -0
- package/dist/server/server.js +1 -1
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.6.0
|
|
12
|
-
"@nocobase/database": "1.6.0
|
|
13
|
-
"@nocobase/cache": "1.6.0
|
|
14
|
-
"@nocobase/utils": "1.6.0
|
|
11
|
+
"@nocobase/client": "1.6.0",
|
|
12
|
+
"@nocobase/database": "1.6.0",
|
|
13
|
+
"@nocobase/cache": "1.6.0",
|
|
14
|
+
"@nocobase/utils": "1.6.0",
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
|
-
"@nocobase/server": "1.6.0
|
|
17
|
-
"@nocobase/actions": "1.6.0
|
|
18
|
-
"@nocobase/resourcer": "1.6.0
|
|
16
|
+
"@nocobase/server": "1.6.0",
|
|
17
|
+
"@nocobase/actions": "1.6.0",
|
|
18
|
+
"@nocobase/resourcer": "1.6.0",
|
|
19
19
|
"@formily/json-schema": "2.3.0"
|
|
20
20
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: import("@nocobase/database").CollectionOptions;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var uiButtonSchemasRoles_exports = {};
|
|
28
|
+
__export(uiButtonSchemasRoles_exports, {
|
|
29
|
+
default: () => uiButtonSchemasRoles_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(uiButtonSchemasRoles_exports);
|
|
32
|
+
var import_database = require("@nocobase/database");
|
|
33
|
+
var uiButtonSchemasRoles_default = (0, import_database.defineCollection)({
|
|
34
|
+
name: "uiButtonSchemasRoles",
|
|
35
|
+
dumpRules: "required",
|
|
36
|
+
migrationRules: ["overwrite", "schema-only"]
|
|
37
|
+
});
|
|
@@ -58,6 +58,17 @@ var uiSchemas_default = {
|
|
|
58
58
|
type: "json",
|
|
59
59
|
name: "schema",
|
|
60
60
|
defaultValue: {}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: "belongsToMany",
|
|
64
|
+
name: "roles",
|
|
65
|
+
onDelete: "CASCADE",
|
|
66
|
+
through: "uiButtonSchemasRoles",
|
|
67
|
+
target: "roles",
|
|
68
|
+
foreignKey: "uid",
|
|
69
|
+
otherKey: "roleName",
|
|
70
|
+
sourceKey: "x-uid",
|
|
71
|
+
targetKey: "name"
|
|
61
72
|
}
|
|
62
73
|
]
|
|
63
74
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Migration } from '@nocobase/server';
|
|
10
|
+
export default class extends Migration {
|
|
11
|
+
on: string;
|
|
12
|
+
appVersion: string;
|
|
13
|
+
up(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var custom_request_action_exports = {};
|
|
28
|
+
__export(custom_request_action_exports, {
|
|
29
|
+
default: () => custom_request_action_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(custom_request_action_exports);
|
|
32
|
+
var import_server = require("@nocobase/server");
|
|
33
|
+
class custom_request_action_default extends import_server.Migration {
|
|
34
|
+
on = "afterLoad";
|
|
35
|
+
appVersion = "<1.6.0";
|
|
36
|
+
async up() {
|
|
37
|
+
const repo1 = this.db.getRepository("customRequestsRoles");
|
|
38
|
+
const repo2 = this.db.getRepository("uiButtonSchemasRoles");
|
|
39
|
+
const customRequestsRoles = await repo1.find();
|
|
40
|
+
for (const customRequestsRole of customRequestsRoles) {
|
|
41
|
+
await repo2.firstOrCreate({
|
|
42
|
+
values: {
|
|
43
|
+
uid: customRequestsRole.customRequestKey,
|
|
44
|
+
roleName: customRequestsRole.roleName
|
|
45
|
+
},
|
|
46
|
+
filterKeys: ["uid", "roleName"]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
package/dist/server/server.js
CHANGED
|
@@ -67,7 +67,7 @@ class PluginUISchemaStorageServer extends import_server.Plugin {
|
|
|
67
67
|
});
|
|
68
68
|
this.app.acl.registerSnippet({
|
|
69
69
|
name: "ui.uiSchemas",
|
|
70
|
-
actions: ["uiSchemas:*"]
|
|
70
|
+
actions: ["uiSchemas:*", "uiSchemas.roles:list", "uiSchemas.roles:set"]
|
|
71
71
|
});
|
|
72
72
|
db.on("uiSchemas.beforeCreate", function setUid(model) {
|
|
73
73
|
if (!model.get("name")) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "UI schema 存储服务",
|
|
5
5
|
"description": "Provides centralized UI schema storage service.",
|
|
6
6
|
"description.zh-CN": "提供中心化的 UI schema 存储服务。",
|
|
7
|
-
"version": "1.6.0
|
|
7
|
+
"version": "1.6.0",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/ui-schema-storage",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@nocobase/test": "1.x",
|
|
24
24
|
"@nocobase/utils": "1.x"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "7422d72a4e515a11300860028a26030ed5732135",
|
|
27
27
|
"keywords": [
|
|
28
28
|
"System & security"
|
|
29
29
|
]
|