@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/helper.js
DELETED
|
@@ -1,9 +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
|
-
|
package/dist/server/index.d.ts
DELETED
|
@@ -1,12 +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
|
-
import { PluginUISchemaStorageServer } from './server';
|
|
10
|
-
export * from './repository';
|
|
11
|
-
export * from './server';
|
|
12
|
-
export default PluginUISchemaStorageServer;
|
package/dist/server/index.js
DELETED
|
@@ -1,41 +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 __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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var server_exports = {};
|
|
29
|
-
__export(server_exports, {
|
|
30
|
-
default: () => server_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(server_exports);
|
|
33
|
-
var import_server = require("./server");
|
|
34
|
-
__reExport(server_exports, require("./repository"), module.exports);
|
|
35
|
-
__reExport(server_exports, require("./server"), module.exports);
|
|
36
|
-
var server_default = import_server.PluginUISchemaStorageServer;
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
...require("./repository"),
|
|
40
|
-
...require("./server")
|
|
41
|
-
});
|
|
@@ -1,13 +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
|
-
import { Migration } from '@nocobase/server';
|
|
10
|
-
export default class extends Migration {
|
|
11
|
-
appVersion: string;
|
|
12
|
-
up(): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,58 +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 __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 filter_form_block_exports = {};
|
|
28
|
-
__export(filter_form_block_exports, {
|
|
29
|
-
default: () => filter_form_block_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(filter_form_block_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
class filter_form_block_default extends import_server.Migration {
|
|
35
|
-
appVersion = "<0.9.1-alpha.3";
|
|
36
|
-
async up() {
|
|
37
|
-
const result = await this.app.version.satisfies("<0.9.1-alpha.3");
|
|
38
|
-
if (!result) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const r = this.db.getRepository("uiSchemas");
|
|
42
|
-
const items = await r.find({
|
|
43
|
-
filter: {
|
|
44
|
-
"schema.x-designer": "FormV2.FilterDesigner"
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
await this.db.sequelize.transaction(async (transaction) => {
|
|
48
|
-
for (const item of items) {
|
|
49
|
-
const schema = item.schema;
|
|
50
|
-
const decorator = schema["x-decorator"];
|
|
51
|
-
schema["x-decorator"] = "FilterFormBlockProvider";
|
|
52
|
-
item.set("schema", schema);
|
|
53
|
-
console.log(item["x-uid"], decorator, schema["x-decorator"]);
|
|
54
|
-
await item.save({ transaction });
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,13 +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
|
-
import { Migration } from '@nocobase/server';
|
|
10
|
-
export default class extends Migration {
|
|
11
|
-
appVersion: string;
|
|
12
|
-
up(): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,71 +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 __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 association_select_exports = {};
|
|
28
|
-
__export(association_select_exports, {
|
|
29
|
-
default: () => association_select_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(association_select_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
class association_select_default extends import_server.Migration {
|
|
35
|
-
appVersion = "<0.9.3-alpha.1";
|
|
36
|
-
async up() {
|
|
37
|
-
const result = await this.app.version.satisfies("<0.9.2-alpha.5");
|
|
38
|
-
if (!result) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const r = this.db.getRepository("uiSchemas");
|
|
42
|
-
const items = await r.find({
|
|
43
|
-
filter: {
|
|
44
|
-
"schema.x-designer": "AssociationSelect.Designer"
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
await this.db.sequelize.transaction(async (transaction) => {
|
|
48
|
-
for (const item of items) {
|
|
49
|
-
const schema = item.schema;
|
|
50
|
-
if (!schema["x-collection-field"]) {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
const field = this.db.getFieldByPath(schema["x-collection-field"]);
|
|
54
|
-
if (!field) {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
if (["hasOne", "belongsTo"].includes(field.type)) {
|
|
58
|
-
schema["type"] = "object";
|
|
59
|
-
} else if (["hasMany", "belongsToMany"].includes(field.type)) {
|
|
60
|
-
schema["type"] = "array";
|
|
61
|
-
} else {
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
schema["x-designer"] = "FormItem.Designer";
|
|
65
|
-
schema["x-component"] = "CollectionField";
|
|
66
|
-
item.set("schema", schema);
|
|
67
|
-
await item.save({ transaction });
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,16 +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
|
-
import { Migration } from '@nocobase/server';
|
|
10
|
-
export default class extends Migration {
|
|
11
|
-
appVersion: string;
|
|
12
|
-
up(): Promise<void>;
|
|
13
|
-
migrateFields(): Promise<void>;
|
|
14
|
-
migrateViewer(): Promise<void>;
|
|
15
|
-
migrateSelector(): Promise<void>;
|
|
16
|
-
}
|
|
@@ -1,121 +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 __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 record_picker_exports = {};
|
|
28
|
-
__export(record_picker_exports, {
|
|
29
|
-
default: () => record_picker_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(record_picker_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
class record_picker_default extends import_server.Migration {
|
|
35
|
-
appVersion = "<0.9.3-alpha.1";
|
|
36
|
-
async up() {
|
|
37
|
-
const result = await this.app.version.satisfies("<0.9.2-alpha.5");
|
|
38
|
-
if (!result) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
await this.migrateFields();
|
|
42
|
-
await this.migrateSelector();
|
|
43
|
-
await this.migrateViewer();
|
|
44
|
-
}
|
|
45
|
-
async migrateFields() {
|
|
46
|
-
const r = this.db.getRepository("uiSchemas");
|
|
47
|
-
const items = await r.find({
|
|
48
|
-
filter: {
|
|
49
|
-
"schema.x-component": "CollectionField"
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
console.log(items == null ? void 0 : items.length);
|
|
53
|
-
await this.db.sequelize.transaction(async (transaction) => {
|
|
54
|
-
var _a, _b, _c, _d;
|
|
55
|
-
for (const item of items) {
|
|
56
|
-
const schema = item.schema;
|
|
57
|
-
if (!schema["x-collection-field"]) {
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
const field = this.db.getFieldByPath(schema["x-collection-field"]);
|
|
61
|
-
if (!field) {
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
const component = (_a = field.get("uiSchema")) == null ? void 0 : _a["x-component"];
|
|
65
|
-
if (!["AssociationField", "RecordPicker"].includes(component)) {
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
console.log(field.options.interface, component, schema["x-collection-field"]);
|
|
69
|
-
if (["createdBy", "updatedBy"].includes((_b = field == null ? void 0 : field.options) == null ? void 0 : _b.interface)) {
|
|
70
|
-
} else if (["hasOne", "belongsTo"].includes(field.type)) {
|
|
71
|
-
schema["type"] = "object";
|
|
72
|
-
} else if (["hasMany", "belongsToMany"].includes(field.type)) {
|
|
73
|
-
schema["type"] = "array";
|
|
74
|
-
} else {
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
if (((_c = schema["x-component-props"]) == null ? void 0 : _c.mode) === "tags") {
|
|
78
|
-
schema["x-component-props"]["enableLink"] = true;
|
|
79
|
-
schema["x-component-props"]["mode"] = "Select";
|
|
80
|
-
} else if (((_d = schema["x-component-props"]) == null ? void 0 : _d.mode) === "links") {
|
|
81
|
-
schema["x-component-props"]["enableLink"] = true;
|
|
82
|
-
schema["x-component-props"]["mode"] = "Select";
|
|
83
|
-
}
|
|
84
|
-
item.set("schema", schema);
|
|
85
|
-
await item.save({ transaction });
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
async migrateViewer() {
|
|
90
|
-
const r = this.db.getRepository("uiSchemas");
|
|
91
|
-
const items = await r.find({
|
|
92
|
-
filter: {
|
|
93
|
-
"schema.x-component": "RecordPicker.Viewer"
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
await this.db.sequelize.transaction(async (transaction) => {
|
|
97
|
-
for (const item of items) {
|
|
98
|
-
const schema = item.schema;
|
|
99
|
-
schema["x-component"] = "AssociationField.Viewer";
|
|
100
|
-
item.set("schema", schema);
|
|
101
|
-
await item.save({ transaction });
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
async migrateSelector() {
|
|
106
|
-
const r = this.db.getRepository("uiSchemas");
|
|
107
|
-
const items = await r.find({
|
|
108
|
-
filter: {
|
|
109
|
-
"schema.x-component": "RecordPicker.Selector"
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
await this.db.sequelize.transaction(async (transaction) => {
|
|
113
|
-
for (const item of items) {
|
|
114
|
-
const schema = item.schema;
|
|
115
|
-
schema["x-component"] = "AssociationField.Selector";
|
|
116
|
-
item.set("schema", schema);
|
|
117
|
-
await item.save({ transaction });
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
@@ -1,13 +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
|
-
import { Migration } from '@nocobase/server';
|
|
10
|
-
export default class extends Migration {
|
|
11
|
-
appVersion: string;
|
|
12
|
-
up(): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,100 +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 form_field_exports = {};
|
|
38
|
-
__export(form_field_exports, {
|
|
39
|
-
default: () => form_field_default
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(form_field_exports);
|
|
42
|
-
var import_json_schema = require("@formily/json-schema");
|
|
43
|
-
var import_server = require("@nocobase/server");
|
|
44
|
-
var import_utils = require("@nocobase/utils");
|
|
45
|
-
var import_lodash = __toESM(require("lodash"));
|
|
46
|
-
/* istanbul ignore file -- @preserve */
|
|
47
|
-
class form_field_default extends import_server.Migration {
|
|
48
|
-
appVersion = "<0.9.3-alpha.1";
|
|
49
|
-
async up() {
|
|
50
|
-
const result = await this.app.version.satisfies("<0.9.2-alpha.5");
|
|
51
|
-
if (!result) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const r = this.db.getRepository("uiSchemas");
|
|
55
|
-
const items = await r.find({
|
|
56
|
-
filter: {
|
|
57
|
-
"schema.x-component": "FormField"
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
console.log(items == null ? void 0 : items.length);
|
|
61
|
-
await this.db.sequelize.transaction(async (transaction) => {
|
|
62
|
-
var _a, _b;
|
|
63
|
-
for (const item of items) {
|
|
64
|
-
const schema = item.schema;
|
|
65
|
-
schema["type"] = "object";
|
|
66
|
-
schema["x-component"] = "CollectionField";
|
|
67
|
-
import_lodash.default.set(schema, "x-component-props.mode", "Nester");
|
|
68
|
-
item.set("schema", schema);
|
|
69
|
-
await item.save({ transaction });
|
|
70
|
-
const s = await r.getProperties(item["x-uid"], { transaction });
|
|
71
|
-
const instance = new import_json_schema.Schema(s);
|
|
72
|
-
const find = (instance2, component) => {
|
|
73
|
-
return instance2.reduceProperties((buf, ss) => {
|
|
74
|
-
if (ss["x-component"] === component) {
|
|
75
|
-
return ss;
|
|
76
|
-
}
|
|
77
|
-
const result2 = find(ss, component);
|
|
78
|
-
if (result2) {
|
|
79
|
-
return result2;
|
|
80
|
-
}
|
|
81
|
-
return buf;
|
|
82
|
-
}, null);
|
|
83
|
-
};
|
|
84
|
-
const gridSchema = find(instance, "Grid").toJSON();
|
|
85
|
-
await r.insertAdjacent("afterBegin", item["x-uid"], gridSchema, {
|
|
86
|
-
wrap: {
|
|
87
|
-
type: "void",
|
|
88
|
-
"x-uid": (0, import_utils.uid)(),
|
|
89
|
-
"x-component": "AssociationField.Nester"
|
|
90
|
-
},
|
|
91
|
-
transaction
|
|
92
|
-
});
|
|
93
|
-
const removed = (_b = (_a = Object.values(instance.properties)) == null ? void 0 : _a[0]) == null ? void 0 : _b["x-uid"];
|
|
94
|
-
if (removed) {
|
|
95
|
-
await r.remove(removed, { transaction });
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
@@ -1,13 +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
|
-
import { Migration } from '@nocobase/server';
|
|
10
|
-
export default class extends Migration {
|
|
11
|
-
appVersion: string;
|
|
12
|
-
up(): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,74 +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 __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 association_field_exports = {};
|
|
28
|
-
__export(association_field_exports, {
|
|
29
|
-
default: () => association_field_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(association_field_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
class association_field_default extends import_server.Migration {
|
|
35
|
-
appVersion = "<0.9.4-alpha.1";
|
|
36
|
-
async up() {
|
|
37
|
-
const result = await this.app.version.satisfies("<0.9.3-alpha.2");
|
|
38
|
-
if (!result) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const r = this.db.getRepository("uiSchemas");
|
|
42
|
-
const items = await r.find({
|
|
43
|
-
filter: {
|
|
44
|
-
"schema.x-component": "CollectionField"
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
console.log(items == null ? void 0 : items.length);
|
|
48
|
-
await this.db.sequelize.transaction(async (transaction) => {
|
|
49
|
-
for (const item of items) {
|
|
50
|
-
const schema = item.schema;
|
|
51
|
-
if (!schema["x-collection-field"]) {
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
if (schema["type"] === "string") {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
const field = this.db.getFieldByPath(schema["x-collection-field"]);
|
|
58
|
-
if (!field) {
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
console.log(schema["x-collection-field"], schema["type"]);
|
|
62
|
-
if (["hasOne", "belongsTo"].includes(field.type)) {
|
|
63
|
-
schema["type"] = "string";
|
|
64
|
-
} else if (["hasMany", "belongsToMany"].includes(field.type)) {
|
|
65
|
-
schema["type"] = "string";
|
|
66
|
-
} else {
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
item.set("schema", schema);
|
|
70
|
-
await item.save({ transaction });
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
package/dist/server/migrations/20231015125000-support-filter-blocks-in-select-record-drawer.d.ts
DELETED
|
@@ -1,13 +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
|
-
import { Migration } from '@nocobase/server';
|
|
10
|
-
export default class extends Migration {
|
|
11
|
-
appVersion: string;
|
|
12
|
-
up(): Promise<void>;
|
|
13
|
-
}
|
package/dist/server/migrations/20231015125000-support-filter-blocks-in-select-record-drawer.js
DELETED
|
@@ -1,55 +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 __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 support_filter_blocks_in_select_record_drawer_exports = {};
|
|
28
|
-
__export(support_filter_blocks_in_select_record_drawer_exports, {
|
|
29
|
-
default: () => support_filter_blocks_in_select_record_drawer_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(support_filter_blocks_in_select_record_drawer_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
class support_filter_blocks_in_select_record_drawer_default extends import_server.Migration {
|
|
35
|
-
appVersion = "<0.14.0-alpha.8";
|
|
36
|
-
async up() {
|
|
37
|
-
const result = await this.app.version.satisfies("<=0.14.0-alpha.7");
|
|
38
|
-
if (!result) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const r = this.db.getRepository("uiSchemas");
|
|
42
|
-
const items = await r.find({
|
|
43
|
-
filter: {
|
|
44
|
-
"schema.x-designer": "TableSelectorDesigner"
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
await this.db.sequelize.transaction(async (transaction) => {
|
|
48
|
-
for (const item of items) {
|
|
49
|
-
const schema = item.schema;
|
|
50
|
-
schema["x-component"] = "CardItem";
|
|
51
|
-
await item.save({ transaction });
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
package/dist/server/model.d.ts
DELETED
|
@@ -1,14 +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
|
-
import { MagicAttributeModel } from '@nocobase/database';
|
|
10
|
-
import { HookType } from './server-hooks';
|
|
11
|
-
declare class UiSchemaModel extends MagicAttributeModel {
|
|
12
|
-
getServerHooksByType(type: HookType): any;
|
|
13
|
-
}
|
|
14
|
-
export { UiSchemaModel };
|