@nocobase/plugin-ui-schema-storage 1.4.0-alpha.20240906133133 → 1.4.0-alpha.20240911231734
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
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.4.0-alpha.
|
|
12
|
-
"@nocobase/database": "1.4.0-alpha.
|
|
13
|
-
"@nocobase/cache": "1.4.0-alpha.
|
|
14
|
-
"@nocobase/utils": "1.4.0-alpha.
|
|
11
|
+
"@nocobase/client": "1.4.0-alpha.20240911231734",
|
|
12
|
+
"@nocobase/database": "1.4.0-alpha.20240911231734",
|
|
13
|
+
"@nocobase/cache": "1.4.0-alpha.20240911231734",
|
|
14
|
+
"@nocobase/utils": "1.4.0-alpha.20240911231734",
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
|
-
"@nocobase/server": "1.4.0-alpha.
|
|
17
|
-
"@nocobase/actions": "1.4.0-alpha.
|
|
18
|
-
"@nocobase/resourcer": "1.4.0-alpha.
|
|
16
|
+
"@nocobase/server": "1.4.0-alpha.20240911231734",
|
|
17
|
+
"@nocobase/actions": "1.4.0-alpha.20240911231734",
|
|
18
|
+
"@nocobase/resourcer": "1.4.0-alpha.20240911231734",
|
|
19
19
|
"@formily/json-schema": "2.3.0"
|
|
20
20
|
};
|
|
@@ -16,6 +16,7 @@ export declare const uiSchemaActions: {
|
|
|
16
16
|
insertNewSchema: (ctx: any, next: any) => Promise<void>;
|
|
17
17
|
remove: (ctx: any, next: any) => Promise<void>;
|
|
18
18
|
patch: (ctx: any, next: any) => Promise<void>;
|
|
19
|
+
initializeActionContext: (ctx: any, next: any) => Promise<void>;
|
|
19
20
|
batchPatch: (ctx: any, next: any) => Promise<void>;
|
|
20
21
|
clearAncestor: (ctx: any, next: any) => Promise<void>;
|
|
21
22
|
insertAdjacent: (ctx: Context, next: any) => Promise<void>;
|
|
@@ -84,6 +84,7 @@ const uiSchemaActions = {
|
|
|
84
84
|
insertNewSchema: callRepositoryMethod("insertNewSchema", "values"),
|
|
85
85
|
remove: callRepositoryMethod("remove", "resourceIndex"),
|
|
86
86
|
patch: callRepositoryMethod("patch", "values"),
|
|
87
|
+
initializeActionContext: callRepositoryMethod("initializeActionContext", "values"),
|
|
87
88
|
batchPatch: callRepositoryMethod("batchPatch", "values"),
|
|
88
89
|
clearAncestor: callRepositoryMethod("clearAncestor", "resourceIndex"),
|
|
89
90
|
insertAdjacent: insertPositionActionBuilder(),
|
|
@@ -56,6 +56,7 @@ export declare class UiSchemaRepository extends Repository {
|
|
|
56
56
|
};
|
|
57
57
|
clearAncestor(uid: string, options?: Transactionable): Promise<void>;
|
|
58
58
|
patch(newSchema: any, options?: any): Promise<void>;
|
|
59
|
+
initializeActionContext(newSchema: any, options?: any): Promise<void>;
|
|
59
60
|
batchPatch(schemas: any[], options?: any): Promise<void>;
|
|
60
61
|
removeEmptyParents(options: Transactionable & {
|
|
61
62
|
uid: string;
|
|
@@ -282,6 +282,22 @@ const _UiSchemaRepository = class _UiSchemaRepository extends import_database.Re
|
|
|
282
282
|
};
|
|
283
283
|
await traverSchemaTree(newSchema);
|
|
284
284
|
}
|
|
285
|
+
async initializeActionContext(newSchema, options = {}) {
|
|
286
|
+
if (!newSchema["x-uid"] || !newSchema["x-action-context"]) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
const { transaction: transaction2 } = options;
|
|
290
|
+
const nodeModel = await this.findOne({
|
|
291
|
+
filter: {
|
|
292
|
+
"x-uid": newSchema["x-uid"]
|
|
293
|
+
},
|
|
294
|
+
transaction: transaction2
|
|
295
|
+
});
|
|
296
|
+
if (!import_lodash.default.isEmpty(nodeModel == null ? void 0 : nodeModel.get("schema")["x-action-context"])) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
return this.patch(import_lodash.default.pick(newSchema, ["x-uid", "x-action-context"]), options);
|
|
300
|
+
}
|
|
285
301
|
async batchPatch(schemas, options) {
|
|
286
302
|
const { transaction: transaction2 } = options;
|
|
287
303
|
for (const schema of schemas) {
|
|
@@ -932,6 +948,9 @@ __decorateClass([
|
|
|
932
948
|
__decorateClass([
|
|
933
949
|
transaction()
|
|
934
950
|
], _UiSchemaRepository.prototype, "patch", 1);
|
|
951
|
+
__decorateClass([
|
|
952
|
+
transaction()
|
|
953
|
+
], _UiSchemaRepository.prototype, "initializeActionContext", 1);
|
|
935
954
|
__decorateClass([
|
|
936
955
|
transaction()
|
|
937
956
|
], _UiSchemaRepository.prototype, "batchPatch", 1);
|
package/dist/server/server.js
CHANGED
|
@@ -96,7 +96,11 @@ class PluginUISchemaStorageServer extends import_server.Plugin {
|
|
|
96
96
|
name: "uiSchemas",
|
|
97
97
|
actions: import_ui_schema_action.uiSchemaActions
|
|
98
98
|
});
|
|
99
|
-
this.app.acl.allow(
|
|
99
|
+
this.app.acl.allow(
|
|
100
|
+
"uiSchemas",
|
|
101
|
+
["getProperties", "getJsonSchema", "getParentJsonSchema", "initializeActionContext"],
|
|
102
|
+
"loggedIn"
|
|
103
|
+
);
|
|
100
104
|
this.app.acl.allow("uiSchemaTemplates", ["get", "list"], "loggedIn");
|
|
101
105
|
}
|
|
102
106
|
async load() {
|
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.4.0-alpha.
|
|
7
|
+
"version": "1.4.0-alpha.20240911231734",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/ui-schema-storage",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@nocobase/test": "1.x",
|
|
25
25
|
"@nocobase/utils": "1.x"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "93db249b4151b72c654daeaff6dd81da26544122",
|
|
28
28
|
"keywords": [
|
|
29
29
|
"System & security"
|
|
30
30
|
]
|