@nocobase/plugin-ui-schema-storage 1.2.12-alpha → 1.3.0-alpha.20240710084543
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/package.json +2 -2
- package/dist/client/index.d.ts +0 -13
- package/dist/client/index.js +0 -10
- package/dist/externalVersion.js +0 -20
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -39
- package/dist/server/actions/ui-schema-action.d.ts +0 -27
- package/dist/server/actions/ui-schema-action.js +0 -140
- package/dist/server/collections/uiSchemaServerHooks.d.ts +0 -11
- package/dist/server/collections/uiSchemaServerHooks.js +0 -58
- package/dist/server/collections/uiSchemaTemplates.d.ts +0 -10
- package/dist/server/collections/uiSchemaTemplates.js +0 -75
- package/dist/server/collections/uiSchemaTreePath.d.ts +0 -11
- package/dist/server/collections/uiSchemaTreePath.js +0 -73
- package/dist/server/collections/uiSchemas.d.ts +0 -11
- package/dist/server/collections/uiSchemas.js +0 -62
- package/dist/server/dao/ui_schema_node_dao.d.ts +0 -26
- package/dist/server/dao/ui_schema_node_dao.js +0 -24
- package/dist/server/helper.d.ts +0 -8
- package/dist/server/helper.js +0 -9
- package/dist/server/index.d.ts +0 -12
- package/dist/server/index.js +0 -41
- package/dist/server/migrations/20230330214649-filter-form-block.d.ts +0 -13
- package/dist/server/migrations/20230330214649-filter-form-block.js +0 -58
- package/dist/server/migrations/20230509221649-association-select.d.ts +0 -13
- package/dist/server/migrations/20230509221649-association-select.js +0 -71
- package/dist/server/migrations/20230509235247-record-picker.d.ts +0 -16
- package/dist/server/migrations/20230509235247-record-picker.js +0 -121
- package/dist/server/migrations/20230510235247-form-field.d.ts +0 -13
- package/dist/server/migrations/20230510235247-form-field.js +0 -100
- package/dist/server/migrations/20230522231231-association-field.d.ts +0 -13
- package/dist/server/migrations/20230522231231-association-field.js +0 -74
- package/dist/server/migrations/20231015125000-support-filter-blocks-in-select-record-drawer.d.ts +0 -13
- package/dist/server/migrations/20231015125000-support-filter-blocks-in-select-record-drawer.js +0 -55
- package/dist/server/model.d.ts +0 -14
- package/dist/server/model.js +0 -42
- package/dist/server/repository.d.ts +0 -101
- package/dist/server/repository.js +0 -980
- package/dist/server/server-hooks/hooks/bind-menu-to-role.d.ts +0 -13
- package/dist/server/server-hooks/hooks/bind-menu-to-role.js +0 -49
- package/dist/server/server-hooks/hooks/factory.d.ts +0 -14
- package/dist/server/server-hooks/hooks/factory.js +0 -42
- package/dist/server/server-hooks/hooks/index.d.ts +0 -14
- package/dist/server/server-hooks/hooks/index.js +0 -45
- package/dist/server/server-hooks/hooks/remove-parents-if-no-children.d.ts +0 -14
- package/dist/server/server-hooks/hooks/remove-parents-if-no-children.js +0 -44
- package/dist/server/server-hooks/hooks/remove-schema.d.ts +0 -14
- package/dist/server/server-hooks/hooks/remove-schema.js +0 -51
- package/dist/server/server-hooks/index.d.ts +0 -33
- package/dist/server/server-hooks/index.js +0 -174
- package/dist/server/server-hooks/model.d.ts +0 -11
- package/dist/server/server-hooks/model.js +0 -38
- package/dist/server/server.d.ts +0 -17
- package/dist/server/server.js +0 -117
- package/dist/swagger/index.d.ts +0 -334
- package/dist/swagger/index.js +0 -363
package/dist/server/server.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
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 __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var server_exports = {};
|
|
38
|
-
__export(server_exports, {
|
|
39
|
-
PluginUISchemaStorageServer: () => PluginUISchemaStorageServer,
|
|
40
|
-
default: () => server_default
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(server_exports);
|
|
43
|
-
var import_database = require("@nocobase/database");
|
|
44
|
-
var import_server = require("@nocobase/server");
|
|
45
|
-
var import_utils = require("@nocobase/utils");
|
|
46
|
-
var import_path = __toESM(require("path"));
|
|
47
|
-
var import_ui_schema_action = require("./actions/ui-schema-action");
|
|
48
|
-
var import_model = require("./model");
|
|
49
|
-
var import_repository = __toESM(require("./repository"));
|
|
50
|
-
var import_server_hooks = require("./server-hooks");
|
|
51
|
-
var import_model2 = require("./server-hooks/model");
|
|
52
|
-
class PluginUISchemaStorageServer extends import_server.Plugin {
|
|
53
|
-
serverHooks;
|
|
54
|
-
registerRepository() {
|
|
55
|
-
this.app.db.registerRepositories({
|
|
56
|
-
UiSchemaRepository: import_repository.default
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
async beforeLoad() {
|
|
60
|
-
const db = this.app.db;
|
|
61
|
-
this.serverHooks = new import_server_hooks.ServerHooks(db);
|
|
62
|
-
this.app.db.registerModels({ MagicAttributeModel: import_database.MagicAttributeModel, UiSchemaModel: import_model.UiSchemaModel, ServerHookModel: import_model2.ServerHookModel });
|
|
63
|
-
this.registerRepository();
|
|
64
|
-
this.app.acl.registerSnippet({
|
|
65
|
-
name: `pm.${this.name}.block-templates`,
|
|
66
|
-
actions: ["uiSchemaTemplates:*"]
|
|
67
|
-
});
|
|
68
|
-
this.app.acl.registerSnippet({
|
|
69
|
-
name: "ui.uiSchemas",
|
|
70
|
-
actions: ["uiSchemas:*"]
|
|
71
|
-
});
|
|
72
|
-
db.on("uiSchemas.beforeCreate", function setUid(model) {
|
|
73
|
-
if (!model.get("name")) {
|
|
74
|
-
model.set("name", (0, import_utils.uid)());
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
db.on("uiSchemas.afterCreate", async function insertSchema(model, options) {
|
|
78
|
-
const { transaction } = options;
|
|
79
|
-
const uiSchemaRepository = db.getCollection("uiSchemas").repository;
|
|
80
|
-
const context = options.context;
|
|
81
|
-
if (context == null ? void 0 : context.disableInsertHook) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
await uiSchemaRepository.insert(model.toJSON(), {
|
|
85
|
-
transaction
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
db.on("uiSchemas.afterUpdate", async function patchSchema(model, options) {
|
|
89
|
-
const { transaction } = options;
|
|
90
|
-
const uiSchemaRepository = db.getCollection("uiSchemas").repository;
|
|
91
|
-
await uiSchemaRepository.patch(model.toJSON(), {
|
|
92
|
-
transaction
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
this.app.resourcer.define({
|
|
96
|
-
name: "uiSchemas",
|
|
97
|
-
actions: import_ui_schema_action.uiSchemaActions
|
|
98
|
-
});
|
|
99
|
-
this.app.acl.allow("uiSchemas", ["getProperties", "getJsonSchema", "getParentJsonSchema"], "loggedIn");
|
|
100
|
-
this.app.acl.allow("uiSchemaTemplates", ["get", "list"], "loggedIn");
|
|
101
|
-
}
|
|
102
|
-
async load() {
|
|
103
|
-
this.db.addMigrations({
|
|
104
|
-
namespace: "ui-schema-storage",
|
|
105
|
-
directory: import_path.default.resolve(__dirname, "./migrations"),
|
|
106
|
-
context: {
|
|
107
|
-
plugin: this
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
await this.importCollections((0, import_path.resolve)(__dirname, "collections"));
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
var server_default = PluginUISchemaStorageServer;
|
|
114
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
115
|
-
0 && (module.exports = {
|
|
116
|
-
PluginUISchemaStorageServer
|
|
117
|
-
});
|
package/dist/swagger/index.d.ts
DELETED
|
@@ -1,334 +0,0 @@
|
|
|
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: {
|
|
10
|
-
openapi: string;
|
|
11
|
-
info: {
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
14
|
-
tags: any[];
|
|
15
|
-
paths: {
|
|
16
|
-
'/uiSchemas:getJsonSchema/{uid}': {
|
|
17
|
-
get: {
|
|
18
|
-
tags: string[];
|
|
19
|
-
description: string;
|
|
20
|
-
parameters: {
|
|
21
|
-
$ref: string;
|
|
22
|
-
}[];
|
|
23
|
-
responses: {
|
|
24
|
-
'200': {
|
|
25
|
-
description: string;
|
|
26
|
-
content: {
|
|
27
|
-
'application/json': {
|
|
28
|
-
schema: {
|
|
29
|
-
$ref: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
'/uiSchemas:getProperties/{uid}': {
|
|
38
|
-
get: {
|
|
39
|
-
tags: string[];
|
|
40
|
-
description: string;
|
|
41
|
-
parameters: {
|
|
42
|
-
$ref: string;
|
|
43
|
-
}[];
|
|
44
|
-
responses: {
|
|
45
|
-
'200': {
|
|
46
|
-
description: string;
|
|
47
|
-
content: {
|
|
48
|
-
'application/json': {
|
|
49
|
-
schema: {
|
|
50
|
-
type: string;
|
|
51
|
-
properties: {
|
|
52
|
-
type: {
|
|
53
|
-
type: string;
|
|
54
|
-
};
|
|
55
|
-
properties: {
|
|
56
|
-
type: string;
|
|
57
|
-
additionalProperties: {
|
|
58
|
-
$ref: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
'/uiSchemas:insert': {
|
|
70
|
-
post: {
|
|
71
|
-
tags: string[];
|
|
72
|
-
description: string;
|
|
73
|
-
requestBody: {
|
|
74
|
-
required: boolean;
|
|
75
|
-
content: {
|
|
76
|
-
'application/json': {
|
|
77
|
-
schema: {
|
|
78
|
-
$ref: string;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
responses: {
|
|
84
|
-
'200': {
|
|
85
|
-
description: string;
|
|
86
|
-
content: {
|
|
87
|
-
'application/json': {
|
|
88
|
-
schema: {
|
|
89
|
-
$ref: string;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
'/uiSchemas:remove/{uid}': {
|
|
98
|
-
post: {
|
|
99
|
-
tags: string[];
|
|
100
|
-
description: string;
|
|
101
|
-
parameters: {
|
|
102
|
-
$ref: string;
|
|
103
|
-
}[];
|
|
104
|
-
responses: {
|
|
105
|
-
'200': {
|
|
106
|
-
description: string;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
'/uiSchemas:patch': {
|
|
112
|
-
post: {
|
|
113
|
-
tags: string[];
|
|
114
|
-
description: string;
|
|
115
|
-
requestBody: {
|
|
116
|
-
required: boolean;
|
|
117
|
-
content: {
|
|
118
|
-
'application/json': {
|
|
119
|
-
schema: {
|
|
120
|
-
$ref: string;
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
responses: {
|
|
126
|
-
'200': {
|
|
127
|
-
description: string;
|
|
128
|
-
content: {
|
|
129
|
-
'application/json': {
|
|
130
|
-
schema: {
|
|
131
|
-
$ref: string;
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
'/uiSchemas:batchPatch': {
|
|
140
|
-
post: {
|
|
141
|
-
tags: string[];
|
|
142
|
-
description: string;
|
|
143
|
-
requestBody: {
|
|
144
|
-
required: boolean;
|
|
145
|
-
content: {
|
|
146
|
-
'application/json': {
|
|
147
|
-
schema: {
|
|
148
|
-
type: string;
|
|
149
|
-
items: {
|
|
150
|
-
$ref: string;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
responses: {
|
|
157
|
-
'200': {
|
|
158
|
-
description: string;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
'/uiSchemas:clearAncestor/{uid}': {
|
|
164
|
-
post: {
|
|
165
|
-
tags: string[];
|
|
166
|
-
description: string;
|
|
167
|
-
parameters: {
|
|
168
|
-
$ref: string;
|
|
169
|
-
}[];
|
|
170
|
-
responses: {
|
|
171
|
-
'200': {
|
|
172
|
-
description: string;
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
'/uiSchemas:insertAdjacent/{uid}': {
|
|
178
|
-
post: {
|
|
179
|
-
tags: string[];
|
|
180
|
-
description: string;
|
|
181
|
-
parameters: ({
|
|
182
|
-
$ref: string;
|
|
183
|
-
name?: undefined;
|
|
184
|
-
in?: undefined;
|
|
185
|
-
required?: undefined;
|
|
186
|
-
description?: undefined;
|
|
187
|
-
schema?: undefined;
|
|
188
|
-
} | {
|
|
189
|
-
name: string;
|
|
190
|
-
in: string;
|
|
191
|
-
required: boolean;
|
|
192
|
-
description: string;
|
|
193
|
-
schema: {
|
|
194
|
-
type: string;
|
|
195
|
-
enum: string[];
|
|
196
|
-
};
|
|
197
|
-
$ref?: undefined;
|
|
198
|
-
})[];
|
|
199
|
-
requestBody: {
|
|
200
|
-
required: boolean;
|
|
201
|
-
content: {
|
|
202
|
-
'application/json': {
|
|
203
|
-
schema: {
|
|
204
|
-
type: string;
|
|
205
|
-
properties: {
|
|
206
|
-
schema: {
|
|
207
|
-
$ref: string;
|
|
208
|
-
};
|
|
209
|
-
wrap: {
|
|
210
|
-
$ref: string;
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
|
-
responses: {
|
|
218
|
-
'200': {
|
|
219
|
-
description: string;
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
};
|
|
224
|
-
'/uiSchemas:saveAsTemplate': {
|
|
225
|
-
post: {
|
|
226
|
-
tags: string[];
|
|
227
|
-
description: string;
|
|
228
|
-
parameters: {
|
|
229
|
-
name: string;
|
|
230
|
-
in: string;
|
|
231
|
-
required: boolean;
|
|
232
|
-
description: string;
|
|
233
|
-
schema: {
|
|
234
|
-
type: string;
|
|
235
|
-
};
|
|
236
|
-
}[];
|
|
237
|
-
requestBody: {
|
|
238
|
-
required: boolean;
|
|
239
|
-
content: {
|
|
240
|
-
'application/json': {
|
|
241
|
-
schema: {
|
|
242
|
-
type: string;
|
|
243
|
-
properties: {
|
|
244
|
-
key: {
|
|
245
|
-
type: string;
|
|
246
|
-
};
|
|
247
|
-
collectionName: {
|
|
248
|
-
type: string;
|
|
249
|
-
};
|
|
250
|
-
componentName: {
|
|
251
|
-
type: string;
|
|
252
|
-
};
|
|
253
|
-
name: {
|
|
254
|
-
type: string;
|
|
255
|
-
description: string;
|
|
256
|
-
};
|
|
257
|
-
resourceName: {
|
|
258
|
-
type: string;
|
|
259
|
-
description: string;
|
|
260
|
-
};
|
|
261
|
-
uid: {
|
|
262
|
-
type: string;
|
|
263
|
-
description: string;
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
};
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
responses: {
|
|
271
|
-
'200': {
|
|
272
|
-
description: string;
|
|
273
|
-
};
|
|
274
|
-
};
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
};
|
|
278
|
-
components: {
|
|
279
|
-
parameters: {
|
|
280
|
-
uid: {
|
|
281
|
-
name: string;
|
|
282
|
-
in: string;
|
|
283
|
-
required: boolean;
|
|
284
|
-
description: string;
|
|
285
|
-
schema: {
|
|
286
|
-
type: string;
|
|
287
|
-
};
|
|
288
|
-
};
|
|
289
|
-
};
|
|
290
|
-
schemas: {
|
|
291
|
-
uiSchema: {
|
|
292
|
-
type: string;
|
|
293
|
-
properties: {
|
|
294
|
-
type: {
|
|
295
|
-
type: string;
|
|
296
|
-
example: string;
|
|
297
|
-
};
|
|
298
|
-
title: {
|
|
299
|
-
type: string;
|
|
300
|
-
example: string;
|
|
301
|
-
description: string;
|
|
302
|
-
};
|
|
303
|
-
'x-uid': {
|
|
304
|
-
type: string;
|
|
305
|
-
example: string;
|
|
306
|
-
description: string;
|
|
307
|
-
};
|
|
308
|
-
'x-index': {
|
|
309
|
-
type: string;
|
|
310
|
-
exmaple: number;
|
|
311
|
-
description: string;
|
|
312
|
-
};
|
|
313
|
-
'x-async': {
|
|
314
|
-
type: string;
|
|
315
|
-
example: boolean;
|
|
316
|
-
description: string;
|
|
317
|
-
};
|
|
318
|
-
name: {
|
|
319
|
-
type: string;
|
|
320
|
-
name: string;
|
|
321
|
-
description: string;
|
|
322
|
-
};
|
|
323
|
-
properties: {
|
|
324
|
-
type: string;
|
|
325
|
-
additionalProperties: {
|
|
326
|
-
$ref: string;
|
|
327
|
-
};
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
};
|
|
332
|
-
};
|
|
333
|
-
};
|
|
334
|
-
export default _default;
|