@nocobase/plugin-ui-schema-storage 0.7.0-alpha.9 → 0.7.1-alpha.6
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/lib/actions/ui-schema-action.js +153 -93
- package/lib/collections/uiSchemaServerHooks.js +33 -27
- package/lib/collections/uiSchemaTemplates.js +50 -39
- package/lib/collections/uiSchemaTreePath.js +37 -42
- package/lib/collections/uiSchemas.js +31 -32
- package/lib/dao/ui_schema_dao.js +11 -6
- package/lib/dao/ui_schema_node_dao.js +12 -6
- package/lib/helper.d.ts +1 -0
- package/lib/helper.js +1 -1
- package/lib/index.js +43 -20
- package/lib/model.js +23 -9
- package/lib/repository.d.ts +11 -11
- package/lib/repository.js +1085 -786
- package/lib/server-hooks/hooks/bind-menu-to-role.js +50 -27
- package/lib/server-hooks/hooks/factory.js +12 -10
- package/lib/server-hooks/hooks/index.js +15 -13
- package/lib/server-hooks/hooks/remove-parents-if-no-children.js +31 -23
- package/lib/server-hooks/hooks/remove-schema.js +38 -31
- package/lib/server-hooks/index.js +225 -130
- package/lib/server-hooks/model.js +17 -5
- package/lib/server.js +156 -79
- package/package.json +4 -9
- package/esm/actions/ui-schema-action.d.ts +0 -16
- package/esm/actions/ui-schema-action.js +0 -100
- package/esm/actions/ui-schema-action.js.map +0 -1
- package/esm/collections/uiSchemaServerHooks.d.ts +0 -3
- package/esm/collections/uiSchemaServerHooks.js +0 -27
- package/esm/collections/uiSchemaServerHooks.js.map +0 -1
- package/esm/collections/uiSchemaTemplates.d.ts +0 -2
- package/esm/collections/uiSchemaTemplates.js +0 -39
- package/esm/collections/uiSchemaTemplates.js.map +0 -1
- package/esm/collections/uiSchemaTreePath.d.ts +0 -3
- package/esm/collections/uiSchemaTreePath.js +0 -42
- package/esm/collections/uiSchemaTreePath.js.map +0 -1
- package/esm/collections/uiSchemas.d.ts +0 -3
- package/esm/collections/uiSchemas.js +0 -32
- package/esm/collections/uiSchemas.js.map +0 -1
- package/esm/dao/ui_schema_dao.d.ts +0 -4
- package/esm/dao/ui_schema_dao.js +0 -6
- package/esm/dao/ui_schema_dao.js.map +0 -1
- package/esm/dao/ui_schema_node_dao.d.ts +0 -22
- package/esm/dao/ui_schema_node_dao.js +0 -6
- package/esm/dao/ui_schema_node_dao.js.map +0 -1
- package/esm/helper.d.ts +0 -0
- package/esm/helper.js +0 -1
- package/esm/helper.js.map +0 -1
- package/esm/index.d.ts +0 -3
- package/esm/index.js +0 -4
- package/esm/index.js.map +0 -1
- package/esm/model.d.ts +0 -6
- package/esm/model.js +0 -9
- package/esm/model.js.map +0 -1
- package/esm/repository.d.ts +0 -72
- package/esm/repository.js +0 -858
- package/esm/repository.js.map +0 -1
- package/esm/server-hooks/hooks/bind-menu-to-role.d.ts +0 -5
- package/esm/server-hooks/hooks/bind-menu-to-role.js +0 -26
- package/esm/server-hooks/hooks/bind-menu-to-role.js.map +0 -1
- package/esm/server-hooks/hooks/factory.d.ts +0 -6
- package/esm/server-hooks/hooks/factory.js +0 -8
- package/esm/server-hooks/hooks/factory.js.map +0 -1
- package/esm/server-hooks/hooks/index.d.ts +0 -6
- package/esm/server-hooks/hooks/index.js +0 -12
- package/esm/server-hooks/hooks/index.js.map +0 -1
- package/esm/server-hooks/hooks/remove-parents-if-no-children.d.ts +0 -6
- package/esm/server-hooks/hooks/remove-parents-if-no-children.js +0 -21
- package/esm/server-hooks/hooks/remove-parents-if-no-children.js.map +0 -1
- package/esm/server-hooks/hooks/remove-schema.d.ts +0 -6
- package/esm/server-hooks/hooks/remove-schema.js +0 -29
- package/esm/server-hooks/hooks/remove-schema.js.map +0 -1
- package/esm/server-hooks/index.d.ts +0 -23
- package/esm/server-hooks/index.js +0 -133
- package/esm/server-hooks/index.js.map +0 -1
- package/esm/server-hooks/model.d.ts +0 -3
- package/esm/server-hooks/model.js +0 -4
- package/esm/server-hooks/model.js.map +0 -1
- package/esm/server.d.ts +0 -10
- package/esm/server.js +0 -78
- package/esm/server.js.map +0 -1
- package/lib/actions/ui-schema-action.js.map +0 -1
- package/lib/collections/uiSchemaServerHooks.js.map +0 -1
- package/lib/collections/uiSchemaTemplates.js.map +0 -1
- package/lib/collections/uiSchemaTreePath.js.map +0 -1
- package/lib/collections/uiSchemas.js.map +0 -1
- package/lib/dao/ui_schema_dao.js.map +0 -1
- package/lib/dao/ui_schema_node_dao.js.map +0 -1
- package/lib/helper.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/model.js.map +0 -1
- package/lib/repository.js.map +0 -1
- package/lib/server-hooks/hooks/bind-menu-to-role.js.map +0 -1
- package/lib/server-hooks/hooks/factory.js.map +0 -1
- package/lib/server-hooks/hooks/index.js.map +0 -1
- package/lib/server-hooks/hooks/remove-parents-if-no-children.js.map +0 -1
- package/lib/server-hooks/hooks/remove-schema.js.map +0 -1
- package/lib/server-hooks/index.js.map +0 -1
- package/lib/server-hooks/model.js.map +0 -1
- package/lib/server.js.map +0 -1
- package/tsconfig.build.json +0 -9
|
@@ -1,106 +1,166 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
15
6
|
exports.uiSchemaActions = void 0;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
|
|
8
|
+
function _lodash() {
|
|
9
|
+
const data = _interopRequireDefault(require("lodash"));
|
|
10
|
+
|
|
11
|
+
_lodash = function _lodash() {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
|
|
24
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
+
|
|
26
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
27
|
+
|
|
28
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
29
|
+
|
|
30
|
+
const getRepositoryFromCtx = ctx => {
|
|
31
|
+
return ctx.db.getCollection('uiSchemas').repository;
|
|
19
32
|
};
|
|
33
|
+
|
|
20
34
|
const callRepositoryMethod = (method, paramsKey, optionsBuilder) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
return /*#__PURE__*/function () {
|
|
36
|
+
var _ref = _asyncToGenerator(function* (ctx, next) {
|
|
37
|
+
const params = _lodash().default.get(ctx.action.params, paramsKey);
|
|
38
|
+
|
|
39
|
+
const options = optionsBuilder ? optionsBuilder(ctx.action.params) : {};
|
|
40
|
+
const repository = getRepositoryFromCtx(ctx);
|
|
41
|
+
const returnValue = yield repository[method](params, options);
|
|
42
|
+
ctx.body = returnValue || {
|
|
43
|
+
result: 'ok'
|
|
44
|
+
};
|
|
45
|
+
yield next();
|
|
30
46
|
});
|
|
47
|
+
|
|
48
|
+
return function (_x, _x2) {
|
|
49
|
+
return _ref.apply(this, arguments);
|
|
50
|
+
};
|
|
51
|
+
}();
|
|
31
52
|
};
|
|
53
|
+
|
|
32
54
|
function parseInsertAdjacentValues(values) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
55
|
+
if (_lodash().default.has(values, 'schema')) {
|
|
56
|
+
return values;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
schema: values,
|
|
61
|
+
wrap: null
|
|
62
|
+
};
|
|
37
63
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
|
|
65
|
+
const uiSchemaActions = {
|
|
66
|
+
getJsonSchema: callRepositoryMethod('getJsonSchema', 'resourceIndex', params => {
|
|
67
|
+
return {
|
|
68
|
+
includeAsyncNode: params === null || params === void 0 ? void 0 : params.includeAsyncNode
|
|
69
|
+
};
|
|
70
|
+
}),
|
|
71
|
+
getProperties: callRepositoryMethod('getProperties', 'resourceIndex'),
|
|
72
|
+
insert: callRepositoryMethod('insert', 'values'),
|
|
73
|
+
insertNewSchema: callRepositoryMethod('insertNewSchema', 'values'),
|
|
74
|
+
remove: callRepositoryMethod('remove', 'resourceIndex'),
|
|
75
|
+
patch: callRepositoryMethod('patch', 'values'),
|
|
76
|
+
clearAncestor: callRepositoryMethod('clearAncestor', 'resourceIndex'),
|
|
77
|
+
|
|
78
|
+
insertAdjacent(ctx, next) {
|
|
79
|
+
return _asyncToGenerator(function* () {
|
|
80
|
+
const _ctx$action$params = ctx.action.params,
|
|
81
|
+
resourceIndex = _ctx$action$params.resourceIndex,
|
|
82
|
+
position = _ctx$action$params.position,
|
|
83
|
+
values = _ctx$action$params.values,
|
|
84
|
+
removeParentsIfNoChildren = _ctx$action$params.removeParentsIfNoChildren,
|
|
85
|
+
breakRemoveOn = _ctx$action$params.breakRemoveOn;
|
|
86
|
+
const repository = getRepositoryFromCtx(ctx);
|
|
87
|
+
|
|
88
|
+
const _parseInsertAdjacentV = parseInsertAdjacentValues(values),
|
|
89
|
+
schema = _parseInsertAdjacentV.schema,
|
|
90
|
+
wrap = _parseInsertAdjacentV.wrap;
|
|
91
|
+
|
|
92
|
+
ctx.body = yield repository.insertAdjacent(position, resourceIndex, schema, {
|
|
93
|
+
removeParentsIfNoChildren,
|
|
94
|
+
breakRemoveOn,
|
|
95
|
+
wrap
|
|
96
|
+
});
|
|
97
|
+
yield next();
|
|
98
|
+
})();
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
insertBeforeBegin: insertPositionActionBuilder('beforeBegin'),
|
|
102
|
+
insertAfterBegin: insertPositionActionBuilder('afterBegin'),
|
|
103
|
+
insertBeforeEnd: insertPositionActionBuilder('beforeEnd'),
|
|
104
|
+
insertAfterEnd: insertPositionActionBuilder('afterEnd'),
|
|
105
|
+
|
|
106
|
+
saveAsTemplate(ctx, next) {
|
|
107
|
+
return _asyncToGenerator(function* () {
|
|
108
|
+
const _ctx$action$params2 = ctx.action.params,
|
|
109
|
+
filterByTk = _ctx$action$params2.filterByTk,
|
|
110
|
+
values = _ctx$action$params2.values;
|
|
111
|
+
const db = ctx.db;
|
|
112
|
+
const transaction = yield db.sequelize.transaction();
|
|
113
|
+
|
|
114
|
+
try {
|
|
115
|
+
yield db.getRepository('uiSchemaTemplates').create({
|
|
116
|
+
values: _objectSpread(_objectSpread({}, values), {}, {
|
|
117
|
+
uid: filterByTk
|
|
118
|
+
}),
|
|
119
|
+
transaction
|
|
61
120
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
insertAfterBegin: insertPositionActionBuilder('afterBegin'),
|
|
65
|
-
insertBeforeEnd: insertPositionActionBuilder('beforeEnd'),
|
|
66
|
-
insertAfterEnd: insertPositionActionBuilder('afterEnd'),
|
|
67
|
-
saveAsTemplate(ctx, next) {
|
|
68
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
const { filterByTk, values } = ctx.action.params;
|
|
70
|
-
const db = ctx.db;
|
|
71
|
-
const transaction = yield db.sequelize.transaction();
|
|
72
|
-
try {
|
|
73
|
-
yield db.getRepository('uiSchemaTemplates').create({
|
|
74
|
-
values: Object.assign(Object.assign({}, values), { uid: filterByTk }),
|
|
75
|
-
transaction,
|
|
76
|
-
});
|
|
77
|
-
yield db.getRepository('uiSchemas').clearAncestor(filterByTk, { transaction });
|
|
78
|
-
ctx.body = {
|
|
79
|
-
result: 'ok',
|
|
80
|
-
};
|
|
81
|
-
yield transaction.commit();
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
yield transaction.rollback();
|
|
85
|
-
throw error;
|
|
86
|
-
}
|
|
87
|
-
yield next();
|
|
121
|
+
yield db.getRepository('uiSchemas').clearAncestor(filterByTk, {
|
|
122
|
+
transaction
|
|
88
123
|
});
|
|
89
|
-
|
|
124
|
+
ctx.body = {
|
|
125
|
+
result: 'ok'
|
|
126
|
+
};
|
|
127
|
+
yield transaction.commit();
|
|
128
|
+
} catch (error) {
|
|
129
|
+
yield transaction.rollback();
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
yield next();
|
|
134
|
+
})();
|
|
135
|
+
}
|
|
136
|
+
|
|
90
137
|
};
|
|
138
|
+
exports.uiSchemaActions = uiSchemaActions;
|
|
139
|
+
|
|
91
140
|
function insertPositionActionBuilder(position) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
141
|
+
return /*#__PURE__*/function () {
|
|
142
|
+
var _ref2 = _asyncToGenerator(function* (ctx, next) {
|
|
143
|
+
const _ctx$action$params3 = ctx.action.params,
|
|
144
|
+
resourceIndex = _ctx$action$params3.resourceIndex,
|
|
145
|
+
values = _ctx$action$params3.values,
|
|
146
|
+
removeParentsIfNoChildren = _ctx$action$params3.removeParentsIfNoChildren,
|
|
147
|
+
breakRemoveOn = _ctx$action$params3.breakRemoveOn;
|
|
148
|
+
const repository = getRepositoryFromCtx(ctx);
|
|
149
|
+
|
|
150
|
+
const _parseInsertAdjacentV2 = parseInsertAdjacentValues(values),
|
|
151
|
+
schema = _parseInsertAdjacentV2.schema,
|
|
152
|
+
wrap = _parseInsertAdjacentV2.wrap;
|
|
153
|
+
|
|
154
|
+
ctx.body = yield repository.insertAdjacent(position, resourceIndex, schema, {
|
|
155
|
+
removeParentsIfNoChildren,
|
|
156
|
+
breakRemoveOn,
|
|
157
|
+
wrap
|
|
158
|
+
});
|
|
159
|
+
yield next();
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
return function (_x3, _x4) {
|
|
163
|
+
return _ref2.apply(this, arguments);
|
|
104
164
|
};
|
|
105
|
-
}
|
|
106
|
-
|
|
165
|
+
}();
|
|
166
|
+
}
|
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
name: 'uiSchemaServerHooks',
|
|
9
|
+
model: 'ServerHookModel',
|
|
10
|
+
// autoGenId: false,
|
|
11
|
+
timestamps: false,
|
|
12
|
+
fields: [{
|
|
13
|
+
type: 'belongsTo',
|
|
14
|
+
name: 'uiSchema',
|
|
15
|
+
target: 'uiSchemas',
|
|
16
|
+
foreignKey: 'uid',
|
|
17
|
+
onDelete: 'CASCADE'
|
|
18
|
+
}, {
|
|
19
|
+
type: 'string',
|
|
20
|
+
name: 'type'
|
|
21
|
+
}, {
|
|
22
|
+
type: 'string',
|
|
23
|
+
name: 'collection'
|
|
24
|
+
}, {
|
|
25
|
+
type: 'string',
|
|
26
|
+
name: 'field'
|
|
27
|
+
}, {
|
|
28
|
+
type: 'string',
|
|
29
|
+
name: 'method'
|
|
30
|
+
}, {
|
|
31
|
+
type: 'json',
|
|
32
|
+
name: 'params'
|
|
33
|
+
}]
|
|
28
34
|
};
|
|
29
|
-
|
|
35
|
+
exports.default = _default;
|
|
@@ -1,41 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
name: 'uiSchemaTemplates',
|
|
6
|
-
autoGenId: false,
|
|
7
|
-
fields: [
|
|
8
|
-
{
|
|
9
|
-
type: 'uid',
|
|
10
|
-
name: 'key',
|
|
11
|
-
primaryKey: true,
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
type: 'string',
|
|
15
|
-
name: 'name',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
type: 'string',
|
|
19
|
-
name: 'componentName',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
type: 'string',
|
|
23
|
-
name: 'associationName',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'belongsTo',
|
|
27
|
-
name: 'uiSchema',
|
|
28
|
-
target: 'uiSchemas',
|
|
29
|
-
foreignKey: 'uid',
|
|
30
|
-
onDelete: 'CASCADE',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
type: 'belongsTo',
|
|
34
|
-
name: 'collection',
|
|
35
|
-
target: 'collections',
|
|
36
|
-
foreignKey: 'collectionName',
|
|
37
|
-
targetKey: 'name',
|
|
38
|
-
},
|
|
39
|
-
],
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
40
5
|
});
|
|
41
|
-
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
function _database() {
|
|
9
|
+
const data = require("@nocobase/database");
|
|
10
|
+
|
|
11
|
+
_database = function _database() {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
var _default = (0, _database().defineCollection)({
|
|
19
|
+
name: 'uiSchemaTemplates',
|
|
20
|
+
autoGenId: false,
|
|
21
|
+
fields: [{
|
|
22
|
+
type: 'uid',
|
|
23
|
+
name: 'key',
|
|
24
|
+
primaryKey: true
|
|
25
|
+
}, {
|
|
26
|
+
type: 'string',
|
|
27
|
+
name: 'name'
|
|
28
|
+
}, {
|
|
29
|
+
type: 'string',
|
|
30
|
+
name: 'componentName'
|
|
31
|
+
}, {
|
|
32
|
+
type: 'string',
|
|
33
|
+
name: 'associationName'
|
|
34
|
+
}, {
|
|
35
|
+
type: 'string',
|
|
36
|
+
name: 'resourceName'
|
|
37
|
+
}, {
|
|
38
|
+
type: 'belongsTo',
|
|
39
|
+
name: 'uiSchema',
|
|
40
|
+
target: 'uiSchemas',
|
|
41
|
+
foreignKey: 'uid',
|
|
42
|
+
onDelete: 'CASCADE'
|
|
43
|
+
}, {
|
|
44
|
+
type: 'belongsTo',
|
|
45
|
+
name: 'collection',
|
|
46
|
+
target: 'collections',
|
|
47
|
+
foreignKey: 'collectionName',
|
|
48
|
+
targetKey: 'name'
|
|
49
|
+
}]
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
exports.default = _default;
|
|
@@ -1,44 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
fields: [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
type: 'integer',
|
|
39
|
-
name: 'sort',
|
|
40
|
-
comment: 'sort of node in adjacency',
|
|
41
|
-
},
|
|
42
|
-
],
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
name: 'uiSchemaTreePath',
|
|
9
|
+
autoGenId: false,
|
|
10
|
+
timestamps: false,
|
|
11
|
+
indexes: [{
|
|
12
|
+
fields: ['descendant']
|
|
13
|
+
}],
|
|
14
|
+
fields: [{
|
|
15
|
+
type: 'string',
|
|
16
|
+
name: 'ancestor',
|
|
17
|
+
primaryKey: true
|
|
18
|
+
}, {
|
|
19
|
+
type: 'string',
|
|
20
|
+
name: 'descendant',
|
|
21
|
+
primaryKey: true,
|
|
22
|
+
index: true
|
|
23
|
+
}, {
|
|
24
|
+
type: 'integer',
|
|
25
|
+
name: 'depth'
|
|
26
|
+
}, {
|
|
27
|
+
type: 'boolean',
|
|
28
|
+
name: 'async'
|
|
29
|
+
}, {
|
|
30
|
+
type: 'string',
|
|
31
|
+
name: 'type',
|
|
32
|
+
comment: 'type of node'
|
|
33
|
+
}, {
|
|
34
|
+
type: 'integer',
|
|
35
|
+
name: 'sort',
|
|
36
|
+
comment: 'sort of node in adjacency'
|
|
37
|
+
}]
|
|
43
38
|
};
|
|
44
|
-
|
|
39
|
+
exports.default = _default;
|
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
],
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
name: 'uiSchemas',
|
|
9
|
+
title: '字段配置',
|
|
10
|
+
autoGenId: false,
|
|
11
|
+
timestamps: false,
|
|
12
|
+
repository: 'UiSchemaRepository',
|
|
13
|
+
model: 'UiSchemaModel',
|
|
14
|
+
magicAttribute: 'schema',
|
|
15
|
+
fields: [{
|
|
16
|
+
type: 'uid',
|
|
17
|
+
name: 'x-uid',
|
|
18
|
+
primaryKey: true
|
|
19
|
+
}, {
|
|
20
|
+
type: 'string',
|
|
21
|
+
name: 'name'
|
|
22
|
+
}, {
|
|
23
|
+
type: 'hasMany',
|
|
24
|
+
name: 'serverHooks',
|
|
25
|
+
target: 'uiSchemaServerHooks',
|
|
26
|
+
foreignKey: 'uid'
|
|
27
|
+
}, {
|
|
28
|
+
type: 'json',
|
|
29
|
+
name: 'schema',
|
|
30
|
+
defaultValue: {}
|
|
31
|
+
}]
|
|
33
32
|
};
|
|
34
|
-
|
|
33
|
+
exports.default = _default;
|
package/lib/dao/ui_schema_dao.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.UiSchemaDAO = void 0;
|
|
7
|
+
|
|
4
8
|
class UiSchemaDAO {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
constructor(schema) {
|
|
10
|
+
this.nodeKeys = ['properties', 'patternProperties', 'additionalProperties'];
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
}
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
|
|
15
|
+
exports.UiSchemaDAO = UiSchemaDAO;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.UiSchemaNodeDAO = void 0;
|
|
7
|
+
|
|
4
8
|
class UiSchemaNodeDAO {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
constructor(schemaNode) {
|
|
10
|
+
this.schemaNode = void 0;
|
|
11
|
+
this.schemaNode = schemaNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
}
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
|
|
16
|
+
exports.UiSchemaNodeDAO = UiSchemaNodeDAO;
|
package/lib/helper.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/lib/helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|