@tachybase/module-ui-schema 0.23.8

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.
Files changed (68) hide show
  1. package/.turbo/turbo-build.log +6 -0
  2. package/LICENSE +201 -0
  3. package/README.md +9 -0
  4. package/README.zh-CN.md +9 -0
  5. package/client.d.ts +2 -0
  6. package/client.js +1 -0
  7. package/dist/client/index.d.ts +5 -0
  8. package/dist/client/index.js +1 -0
  9. package/dist/externalVersion.js +11 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +30 -0
  12. package/dist/server/actions/ui-schema-action.d.ts +17 -0
  13. package/dist/server/actions/ui-schema-action.js +133 -0
  14. package/dist/server/collections/uiSchemaServerHooks.d.ts +3 -0
  15. package/dist/server/collections/uiSchemaServerHooks.js +49 -0
  16. package/dist/server/collections/uiSchemaTemplates.d.ts +2 -0
  17. package/dist/server/collections/uiSchemaTemplates.js +66 -0
  18. package/dist/server/collections/uiSchemaTreePath.d.ts +3 -0
  19. package/dist/server/collections/uiSchemaTreePath.js +64 -0
  20. package/dist/server/collections/uiSchemas.d.ts +3 -0
  21. package/dist/server/collections/uiSchemas.js +53 -0
  22. package/dist/server/dao/ui_schema_dao.d.ts +4 -0
  23. package/dist/server/dao/ui_schema_dao.js +31 -0
  24. package/dist/server/dao/ui_schema_node_dao.d.ts +22 -0
  25. package/dist/server/dao/ui_schema_node_dao.js +32 -0
  26. package/dist/server/helper.d.ts +0 -0
  27. package/dist/server/helper.js +0 -0
  28. package/dist/server/index.d.ts +4 -0
  29. package/dist/server/index.js +32 -0
  30. package/dist/server/migrations/20230330214649-filter-form-block.d.ts +5 -0
  31. package/dist/server/migrations/20230330214649-filter-form-block.js +48 -0
  32. package/dist/server/migrations/20230509221649-association-select.d.ts +5 -0
  33. package/dist/server/migrations/20230509221649-association-select.js +61 -0
  34. package/dist/server/migrations/20230509235247-record-picker.d.ts +8 -0
  35. package/dist/server/migrations/20230509235247-record-picker.js +111 -0
  36. package/dist/server/migrations/20230522231231-association-field.d.ts +5 -0
  37. package/dist/server/migrations/20230522231231-association-field.js +64 -0
  38. package/dist/server/migrations/20231015125000-support-filter-blocks-in-select-record-drawer.d.ts +5 -0
  39. package/dist/server/migrations/20231015125000-support-filter-blocks-in-select-record-drawer.js +45 -0
  40. package/dist/server/migrations/2024082000001-update-uiSchemas_customDesigner.d.ts +6 -0
  41. package/dist/server/migrations/2024082000001-update-uiSchemas_customDesigner.js +37 -0
  42. package/dist/server/migrations/20241120132559-modify-schema.d.ts +6 -0
  43. package/dist/server/migrations/20241120132559-modify-schema.js +119 -0
  44. package/dist/server/model.d.ts +6 -0
  45. package/dist/server/model.js +33 -0
  46. package/dist/server/repository.d.ts +85 -0
  47. package/dist/server/repository.js +969 -0
  48. package/dist/server/server-hooks/hooks/bind-menu-to-role.d.ts +5 -0
  49. package/dist/server/server-hooks/hooks/bind-menu-to-role.js +40 -0
  50. package/dist/server/server-hooks/hooks/factory.d.ts +6 -0
  51. package/dist/server/server-hooks/hooks/factory.js +33 -0
  52. package/dist/server/server-hooks/hooks/index.d.ts +6 -0
  53. package/dist/server/server-hooks/hooks/index.js +36 -0
  54. package/dist/server/server-hooks/hooks/remove-parents-if-no-children.d.ts +6 -0
  55. package/dist/server/server-hooks/hooks/remove-parents-if-no-children.js +35 -0
  56. package/dist/server/server-hooks/hooks/remove-schema.d.ts +6 -0
  57. package/dist/server/server-hooks/hooks/remove-schema.js +42 -0
  58. package/dist/server/server-hooks/index.d.ts +25 -0
  59. package/dist/server/server-hooks/index.js +165 -0
  60. package/dist/server/server-hooks/model.d.ts +3 -0
  61. package/dist/server/server-hooks/model.js +29 -0
  62. package/dist/server/server.d.ts +8 -0
  63. package/dist/server/server.js +136 -0
  64. package/dist/swagger/index.d.ts +326 -0
  65. package/dist/swagger/index.js +354 -0
  66. package/package.json +32 -0
  67. package/server.d.ts +2 -0
  68. package/server.js +1 -0
@@ -0,0 +1,326 @@
1
+ declare const _default: {
2
+ openapi: string;
3
+ info: {
4
+ title: string;
5
+ };
6
+ tags: any[];
7
+ paths: {
8
+ '/uiSchemas:getJsonSchema/{uid}': {
9
+ get: {
10
+ tags: string[];
11
+ description: string;
12
+ parameters: {
13
+ $ref: string;
14
+ }[];
15
+ responses: {
16
+ '200': {
17
+ description: string;
18
+ content: {
19
+ 'application/json': {
20
+ schema: {
21
+ $ref: string;
22
+ };
23
+ };
24
+ };
25
+ };
26
+ };
27
+ };
28
+ };
29
+ '/uiSchemas:getProperties/{uid}': {
30
+ get: {
31
+ tags: string[];
32
+ description: string;
33
+ parameters: {
34
+ $ref: string;
35
+ }[];
36
+ responses: {
37
+ '200': {
38
+ description: string;
39
+ content: {
40
+ 'application/json': {
41
+ schema: {
42
+ type: string;
43
+ properties: {
44
+ type: {
45
+ type: string;
46
+ };
47
+ properties: {
48
+ type: string;
49
+ additionalProperties: {
50
+ $ref: string;
51
+ };
52
+ };
53
+ };
54
+ };
55
+ };
56
+ };
57
+ };
58
+ };
59
+ };
60
+ };
61
+ '/uiSchemas:insert': {
62
+ post: {
63
+ tags: string[];
64
+ description: string;
65
+ requestBody: {
66
+ required: boolean;
67
+ content: {
68
+ 'application/json': {
69
+ schema: {
70
+ $ref: string;
71
+ };
72
+ };
73
+ };
74
+ };
75
+ responses: {
76
+ '200': {
77
+ description: string;
78
+ content: {
79
+ 'application/json': {
80
+ schema: {
81
+ $ref: string;
82
+ };
83
+ };
84
+ };
85
+ };
86
+ };
87
+ };
88
+ };
89
+ '/uiSchemas:remove/{uid}': {
90
+ post: {
91
+ tags: string[];
92
+ description: string;
93
+ parameters: {
94
+ $ref: string;
95
+ }[];
96
+ responses: {
97
+ '200': {
98
+ description: string;
99
+ };
100
+ };
101
+ };
102
+ };
103
+ '/uiSchemas:patch': {
104
+ post: {
105
+ tags: string[];
106
+ description: string;
107
+ requestBody: {
108
+ required: boolean;
109
+ content: {
110
+ 'application/json': {
111
+ schema: {
112
+ $ref: string;
113
+ };
114
+ };
115
+ };
116
+ };
117
+ responses: {
118
+ '200': {
119
+ description: string;
120
+ content: {
121
+ 'application/json': {
122
+ schema: {
123
+ $ref: string;
124
+ };
125
+ };
126
+ };
127
+ };
128
+ };
129
+ };
130
+ };
131
+ '/uiSchemas:batchPatch': {
132
+ post: {
133
+ tags: string[];
134
+ description: string;
135
+ requestBody: {
136
+ required: boolean;
137
+ content: {
138
+ 'application/json': {
139
+ schema: {
140
+ type: string;
141
+ items: {
142
+ $ref: string;
143
+ };
144
+ };
145
+ };
146
+ };
147
+ };
148
+ responses: {
149
+ '200': {
150
+ description: string;
151
+ };
152
+ };
153
+ };
154
+ };
155
+ '/uiSchemas:clearAncestor/{uid}': {
156
+ post: {
157
+ tags: string[];
158
+ description: string;
159
+ parameters: {
160
+ $ref: string;
161
+ }[];
162
+ responses: {
163
+ '200': {
164
+ description: string;
165
+ };
166
+ };
167
+ };
168
+ };
169
+ '/uiSchemas:insertAdjacent/{uid}': {
170
+ post: {
171
+ tags: string[];
172
+ description: string;
173
+ parameters: ({
174
+ $ref: string;
175
+ name?: undefined;
176
+ in?: undefined;
177
+ required?: undefined;
178
+ description?: undefined;
179
+ schema?: undefined;
180
+ } | {
181
+ name: string;
182
+ in: string;
183
+ required: boolean;
184
+ description: string;
185
+ schema: {
186
+ type: string;
187
+ enum: string[];
188
+ };
189
+ $ref?: undefined;
190
+ })[];
191
+ requestBody: {
192
+ required: boolean;
193
+ content: {
194
+ 'application/json': {
195
+ schema: {
196
+ type: string;
197
+ properties: {
198
+ schema: {
199
+ $ref: string;
200
+ };
201
+ wrap: {
202
+ $ref: string;
203
+ };
204
+ };
205
+ };
206
+ };
207
+ };
208
+ };
209
+ responses: {
210
+ '200': {
211
+ description: string;
212
+ };
213
+ };
214
+ };
215
+ };
216
+ '/uiSchemas:saveAsTemplate': {
217
+ post: {
218
+ tags: string[];
219
+ description: string;
220
+ parameters: {
221
+ name: string;
222
+ in: string;
223
+ required: boolean;
224
+ description: string;
225
+ schema: {
226
+ type: string;
227
+ };
228
+ }[];
229
+ requestBody: {
230
+ required: boolean;
231
+ content: {
232
+ 'application/json': {
233
+ schema: {
234
+ type: string;
235
+ properties: {
236
+ key: {
237
+ type: string;
238
+ };
239
+ collectionName: {
240
+ type: string;
241
+ };
242
+ componentName: {
243
+ type: string;
244
+ };
245
+ name: {
246
+ type: string;
247
+ description: string;
248
+ };
249
+ resourceName: {
250
+ type: string;
251
+ description: string;
252
+ };
253
+ uid: {
254
+ type: string;
255
+ description: string;
256
+ };
257
+ };
258
+ };
259
+ };
260
+ };
261
+ };
262
+ responses: {
263
+ '200': {
264
+ description: string;
265
+ };
266
+ };
267
+ };
268
+ };
269
+ };
270
+ components: {
271
+ parameters: {
272
+ uid: {
273
+ name: string;
274
+ in: string;
275
+ required: boolean;
276
+ description: string;
277
+ schema: {
278
+ type: string;
279
+ };
280
+ };
281
+ };
282
+ schemas: {
283
+ uiSchema: {
284
+ type: string;
285
+ properties: {
286
+ type: {
287
+ type: string;
288
+ example: string;
289
+ };
290
+ title: {
291
+ type: string;
292
+ example: string;
293
+ description: string;
294
+ };
295
+ 'x-uid': {
296
+ type: string;
297
+ example: string;
298
+ description: string;
299
+ };
300
+ 'x-index': {
301
+ type: string;
302
+ exmaple: number;
303
+ description: string;
304
+ };
305
+ 'x-async': {
306
+ type: string;
307
+ example: boolean;
308
+ description: string;
309
+ };
310
+ name: {
311
+ type: string;
312
+ name: string;
313
+ description: string;
314
+ };
315
+ properties: {
316
+ type: string;
317
+ additionalProperties: {
318
+ $ref: string;
319
+ };
320
+ };
321
+ };
322
+ };
323
+ };
324
+ };
325
+ };
326
+ export default _default;
@@ -0,0 +1,354 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var swagger_exports = {};
19
+ __export(swagger_exports, {
20
+ default: () => swagger_default
21
+ });
22
+ module.exports = __toCommonJS(swagger_exports);
23
+ var swagger_default = {
24
+ openapi: "3.0.2",
25
+ info: {
26
+ title: "TachyBase API - UI schema storage plugin"
27
+ },
28
+ tags: [],
29
+ paths: {
30
+ "/uiSchemas:getJsonSchema/{uid}": {
31
+ get: {
32
+ tags: ["uiSchemas"],
33
+ description: "",
34
+ parameters: [
35
+ {
36
+ $ref: "#/components/parameters/uid"
37
+ }
38
+ ],
39
+ responses: {
40
+ "200": {
41
+ description: "OK",
42
+ content: {
43
+ "application/json": {
44
+ schema: {
45
+ $ref: "#/components/schemas/uiSchema"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ },
53
+ "/uiSchemas:getProperties/{uid}": {
54
+ get: {
55
+ tags: ["uiSchemas"],
56
+ description: "\u83B7\u53D6ui schema\u7684properties\u5C5E\u6027",
57
+ parameters: [
58
+ {
59
+ $ref: "#/components/parameters/uid"
60
+ }
61
+ ],
62
+ responses: {
63
+ "200": {
64
+ description: "OK",
65
+ content: {
66
+ "application/json": {
67
+ schema: {
68
+ type: "object",
69
+ properties: {
70
+ type: {
71
+ type: "string"
72
+ },
73
+ properties: {
74
+ type: "object",
75
+ additionalProperties: {
76
+ $ref: "#/components/schemas/uiSchema"
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ },
87
+ "/uiSchemas:insert": {
88
+ post: {
89
+ tags: ["uiSchemas"],
90
+ description: "insert ui schema as root node",
91
+ requestBody: {
92
+ required: true,
93
+ content: {
94
+ "application/json": {
95
+ schema: {
96
+ $ref: "#/components/schemas/uiSchema"
97
+ }
98
+ }
99
+ }
100
+ },
101
+ responses: {
102
+ "200": {
103
+ description: "OK",
104
+ content: {
105
+ "application/json": {
106
+ schema: {
107
+ $ref: "#/components/schemas/uiSchema"
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ },
115
+ "/uiSchemas:remove/{uid}": {
116
+ post: {
117
+ tags: ["uiSchemas"],
118
+ description: "remove an ui schema node by uid",
119
+ parameters: [
120
+ {
121
+ $ref: "#/components/parameters/uid"
122
+ }
123
+ ],
124
+ responses: {
125
+ "200": {
126
+ description: "OK"
127
+ }
128
+ }
129
+ }
130
+ },
131
+ "/uiSchemas:patch": {
132
+ post: {
133
+ tags: ["uiSchemas"],
134
+ description: "update an ui schema node by an new ui schema",
135
+ requestBody: {
136
+ required: true,
137
+ content: {
138
+ "application/json": {
139
+ schema: {
140
+ $ref: "#/components/schemas/uiSchema"
141
+ }
142
+ }
143
+ }
144
+ },
145
+ responses: {
146
+ "200": {
147
+ description: "OK",
148
+ content: {
149
+ "application/json": {
150
+ schema: {
151
+ $ref: "#/components/schemas/uiSchema"
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ },
159
+ "/uiSchemas:batchPatch": {
160
+ post: {
161
+ tags: ["uiSchemas"],
162
+ description: "batch update ui schema nodes by an new ui schema item",
163
+ requestBody: {
164
+ required: true,
165
+ content: {
166
+ "application/json": {
167
+ schema: {
168
+ type: "array",
169
+ items: {
170
+ $ref: "#/components/schemas/uiSchema"
171
+ }
172
+ }
173
+ }
174
+ }
175
+ },
176
+ responses: {
177
+ "200": {
178
+ description: "OK"
179
+ }
180
+ }
181
+ }
182
+ },
183
+ "/uiSchemas:clearAncestor/{uid}": {
184
+ post: {
185
+ tags: ["uiSchemas"],
186
+ description: "Removes all ancestors of a given node",
187
+ parameters: [
188
+ {
189
+ $ref: "#/components/parameters/uid"
190
+ }
191
+ ],
192
+ responses: {
193
+ "200": {
194
+ description: "OK"
195
+ }
196
+ }
197
+ }
198
+ },
199
+ "/uiSchemas:insertAdjacent/{uid}": {
200
+ post: {
201
+ tags: ["uiSchemas"],
202
+ description: "insert a node adjacent to another node",
203
+ parameters: [
204
+ {
205
+ $ref: "#/components/parameters/uid"
206
+ },
207
+ {
208
+ name: "position",
209
+ in: "query",
210
+ required: true,
211
+ description: "position",
212
+ schema: {
213
+ type: "string",
214
+ enum: ["beforeBegin", "afterBegin", "beforeEnd", "afterEnd"]
215
+ }
216
+ }
217
+ ],
218
+ requestBody: {
219
+ required: true,
220
+ content: {
221
+ "application/json": {
222
+ schema: {
223
+ type: "object",
224
+ properties: {
225
+ schema: {
226
+ $ref: "#/components/schemas/uiSchema"
227
+ },
228
+ wrap: {
229
+ $ref: "#/components/schemas/uiSchema"
230
+ }
231
+ }
232
+ }
233
+ }
234
+ }
235
+ },
236
+ responses: {
237
+ "200": {
238
+ description: "OK"
239
+ }
240
+ }
241
+ }
242
+ },
243
+ "/uiSchemas:saveAsTemplate": {
244
+ post: {
245
+ tags: ["uiSchemas"],
246
+ description: "save an ui schema as template",
247
+ parameters: [
248
+ {
249
+ name: "filterByTk",
250
+ in: "query",
251
+ required: true,
252
+ description: "filterByTk",
253
+ schema: {
254
+ type: "string"
255
+ }
256
+ }
257
+ ],
258
+ requestBody: {
259
+ required: true,
260
+ content: {
261
+ "application/json": {
262
+ schema: {
263
+ type: "object",
264
+ properties: {
265
+ key: {
266
+ type: "string"
267
+ },
268
+ collectionName: {
269
+ type: "string"
270
+ },
271
+ componentName: {
272
+ type: "string"
273
+ },
274
+ name: {
275
+ type: "string",
276
+ description: "template's name"
277
+ },
278
+ resourceName: {
279
+ type: "string",
280
+ description: "template's resourceName"
281
+ },
282
+ uid: {
283
+ type: "string",
284
+ description: "ui schema id"
285
+ }
286
+ }
287
+ }
288
+ }
289
+ }
290
+ },
291
+ responses: {
292
+ "200": {
293
+ description: "OK"
294
+ }
295
+ }
296
+ }
297
+ }
298
+ },
299
+ components: {
300
+ parameters: {
301
+ uid: {
302
+ name: "uid",
303
+ in: "path",
304
+ required: true,
305
+ description: "x-uid",
306
+ schema: {
307
+ type: "string"
308
+ }
309
+ }
310
+ },
311
+ schemas: {
312
+ uiSchema: {
313
+ type: "object",
314
+ properties: {
315
+ type: {
316
+ type: "string",
317
+ example: "void"
318
+ },
319
+ title: {
320
+ type: "string",
321
+ example: '{{ t("Actions") }}',
322
+ description: "ui schema's title"
323
+ },
324
+ "x-uid": {
325
+ type: "string",
326
+ example: "ygdvvfnw3h8",
327
+ description: "unique id of ui schema node"
328
+ },
329
+ "x-index": {
330
+ type: "integer",
331
+ exmaple: 1,
332
+ description: "ui schema's order index"
333
+ },
334
+ "x-async": {
335
+ type: "boolean",
336
+ example: false,
337
+ description: "async or not"
338
+ },
339
+ name: {
340
+ type: "string",
341
+ name: "2qakvs173rs",
342
+ description: "ui schema's name"
343
+ },
344
+ properties: {
345
+ type: "object",
346
+ additionalProperties: {
347
+ $ref: "#/components/schemas/uiSchema"
348
+ }
349
+ }
350
+ }
351
+ }
352
+ }
353
+ }
354
+ };
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@tachybase/module-ui-schema",
3
+ "displayName": "UI schema storage",
4
+ "version": "0.23.8",
5
+ "description": "Provides centralized UI schema storage service.",
6
+ "keywords": [
7
+ "System & security"
8
+ ],
9
+ "license": "Apache-2.0",
10
+ "main": "./dist/server/index.js",
11
+ "devDependencies": {
12
+ "lodash": "4.17.21",
13
+ "sequelize": "6.37.5"
14
+ },
15
+ "peerDependencies": {
16
+ "@tachybase/actions": "0.23.8",
17
+ "@tachybase/database": "0.23.8",
18
+ "@tachybase/client": "0.23.8",
19
+ "@tachybase/cache": "0.23.8",
20
+ "@tachybase/server": "0.23.8",
21
+ "@tachybase/test": "0.23.8",
22
+ "@tachybase/resourcer": "0.23.8",
23
+ "@tachybase/utils": "0.23.8",
24
+ "@tachybase/module-user": "0.23.8",
25
+ "@tachybase/module-error-handler": "0.23.8"
26
+ },
27
+ "description.zh-CN": "提供中心化的 UI schema 存储服务。",
28
+ "displayName.zh-CN": "UI schema 存储服务",
29
+ "scripts": {
30
+ "build": "tachybase-build --no-dts @tachybase/module-ui-schema"
31
+ }
32
+ }
package/server.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/server';
2
+ export { default } from './dist/server';