@nocobase/plugin-workflow-manual 1.2.13-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/WorkflowTodo.d.ts +0 -13
- package/dist/client/WorkflowTodoBlockInitializer.d.ts +0 -10
- package/dist/client/index.d.ts +0 -14
- package/dist/client/index.js +0 -22
- package/dist/client/instruction/AssigneesSelect.d.ts +0 -14
- package/dist/client/instruction/FormBlockInitializer.d.ts +0 -10
- package/dist/client/instruction/FormBlockProvider.d.ts +0 -10
- package/dist/client/instruction/ModeConfig.d.ts +0 -13
- package/dist/client/instruction/SchemaConfig.d.ts +0 -68
- package/dist/client/instruction/createManualFormBlockUISchema.d.ts +0 -65
- package/dist/client/instruction/forms/create.d.ts +0 -11
- package/dist/client/instruction/forms/custom.d.ts +0 -18
- package/dist/client/instruction/forms/update.d.ts +0 -11
- package/dist/client/instruction/index.d.ts +0 -99
- package/dist/client/instruction/utils.d.ts +0 -9
- package/dist/externalVersion.js +0 -29
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -48
- package/dist/locale/en-US.json +0 -30
- package/dist/locale/index.d.ts +0 -12
- package/dist/locale/index.js +0 -51
- package/dist/locale/ko_KR.json +0 -32
- package/dist/locale/zh-CN.json +0 -32
- package/dist/server/ManualInstruction.d.ts +0 -36
- package/dist/server/ManualInstruction.js +0 -164
- package/dist/server/Plugin.d.ts +0 -12
- package/dist/server/Plugin.js +0 -77
- package/dist/server/actions.d.ts +0 -10
- package/dist/server/actions.js +0 -113
- package/dist/server/collections/1-users_jobs.d.ts +0 -10
- package/dist/server/collections/1-users_jobs.js +0 -82
- package/dist/server/collections/2-jobs.d.ts +0 -14
- package/dist/server/collections/2-jobs.js +0 -49
- package/dist/server/collections/3-users.d.ts +0 -14
- package/dist/server/collections/3-users.js +0 -47
- package/dist/server/forms/create.d.ts +0 -14
- package/dist/server/forms/create.js +0 -50
- package/dist/server/forms/index.d.ts +0 -14
- package/dist/server/forms/index.js +0 -47
- package/dist/server/forms/update.d.ts +0 -15
- package/dist/server/forms/update.js +0 -50
- package/dist/server/index.d.ts +0 -9
- package/dist/server/index.js +0 -42
- package/dist/server/migrations/20240325213145-fix-schema.d.ts +0 -13
- package/dist/server/migrations/20240325213145-fix-schema.js +0 -98
|
@@ -1,49 +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 jobs_exports = {};
|
|
28
|
-
__export(jobs_exports, {
|
|
29
|
-
default: () => jobs_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(jobs_exports);
|
|
32
|
-
var import_database = require("@nocobase/database");
|
|
33
|
-
var jobs_default = (0, import_database.extendCollection)({
|
|
34
|
-
name: "jobs",
|
|
35
|
-
fields: [
|
|
36
|
-
{
|
|
37
|
-
type: "belongsToMany",
|
|
38
|
-
name: "users",
|
|
39
|
-
through: "users_jobs"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
type: "hasMany",
|
|
43
|
-
name: "usersJobs",
|
|
44
|
-
target: "users_jobs",
|
|
45
|
-
foreignKey: "jobId",
|
|
46
|
-
onDelete: "CASCADE"
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
});
|
|
@@ -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
|
-
declare const _default: {
|
|
10
|
-
collectionOptions: import("@nocobase/database").CollectionOptions;
|
|
11
|
-
mergeOptions: import("deepmerge").Options;
|
|
12
|
-
extend: boolean;
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
|
@@ -1,47 +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 users_exports = {};
|
|
28
|
-
__export(users_exports, {
|
|
29
|
-
default: () => users_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(users_exports);
|
|
32
|
-
var import_database = require("@nocobase/database");
|
|
33
|
-
var users_default = (0, import_database.extendCollection)({
|
|
34
|
-
name: "users",
|
|
35
|
-
fields: [
|
|
36
|
-
{
|
|
37
|
-
type: "belongsToMany",
|
|
38
|
-
name: "jobs",
|
|
39
|
-
through: "users_jobs"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
type: "hasMany",
|
|
43
|
-
name: "usersJobs",
|
|
44
|
-
target: "users_jobs"
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
});
|
|
@@ -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 { Processor } from '@nocobase/plugin-workflow';
|
|
10
|
-
import ManualInstruction from '../ManualInstruction';
|
|
11
|
-
export default function (this: ManualInstruction, instance: any, { dataSource, collection }: {
|
|
12
|
-
dataSource?: string;
|
|
13
|
-
collection: any;
|
|
14
|
-
}, processor: Processor): Promise<void>;
|
|
@@ -1,50 +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 create_exports = {};
|
|
28
|
-
__export(create_exports, {
|
|
29
|
-
default: () => create_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(create_exports);
|
|
32
|
-
async function create_default(instance, { dataSource = "main", collection }, processor) {
|
|
33
|
-
const repo = this.workflow.app.dataSourceManager.dataSources.get(dataSource).collectionManager.getRepository(collection);
|
|
34
|
-
if (!repo) {
|
|
35
|
-
throw new Error(`collection ${collection} for create data on manual node not found`);
|
|
36
|
-
}
|
|
37
|
-
const { _, ...form } = instance.result;
|
|
38
|
-
const [values] = Object.values(form);
|
|
39
|
-
await repo.create({
|
|
40
|
-
values: {
|
|
41
|
-
...values ?? {},
|
|
42
|
-
createdBy: instance.userId,
|
|
43
|
-
updatedBy: instance.userId
|
|
44
|
-
},
|
|
45
|
-
context: {
|
|
46
|
-
executionId: processor.execution.id
|
|
47
|
-
},
|
|
48
|
-
transaction: processor.transaction
|
|
49
|
-
});
|
|
50
|
-
}
|
|
@@ -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 { Processor } from '@nocobase/plugin-workflow';
|
|
10
|
-
import ManualInstruction from '../ManualInstruction';
|
|
11
|
-
export type FormHandler = (this: ManualInstruction, instance: any, formConfig: any, processor: Processor) => Promise<void>;
|
|
12
|
-
export default function ({ formTypes }: {
|
|
13
|
-
formTypes: any;
|
|
14
|
-
}): void;
|
|
@@ -1,47 +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 forms_exports = {};
|
|
38
|
-
__export(forms_exports, {
|
|
39
|
-
default: () => forms_default
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(forms_exports);
|
|
42
|
-
var import_create = __toESM(require("./create"));
|
|
43
|
-
var import_update = __toESM(require("./update"));
|
|
44
|
-
function forms_default({ formTypes }) {
|
|
45
|
-
formTypes.register("create", import_create.default);
|
|
46
|
-
formTypes.register("update", import_update.default);
|
|
47
|
-
}
|
|
@@ -1,15 +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 { Processor } from '@nocobase/plugin-workflow';
|
|
10
|
-
import ManualInstruction from '../ManualInstruction';
|
|
11
|
-
export default function (this: ManualInstruction, instance: any, { dataSource, collection, filter }: {
|
|
12
|
-
dataSource?: string;
|
|
13
|
-
collection: any;
|
|
14
|
-
filter?: {};
|
|
15
|
-
}, processor: Processor): Promise<void>;
|
|
@@ -1,50 +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 update_exports = {};
|
|
28
|
-
__export(update_exports, {
|
|
29
|
-
default: () => update_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(update_exports);
|
|
32
|
-
async function update_default(instance, { dataSource = "main", collection, filter = {} }, processor) {
|
|
33
|
-
const repo = this.workflow.app.dataSourceManager.dataSources.get(dataSource).collectionManager.getRepository(collection);
|
|
34
|
-
if (!repo) {
|
|
35
|
-
throw new Error(`collection ${collection} for update data on manual node not found`);
|
|
36
|
-
}
|
|
37
|
-
const { _, ...form } = instance.result;
|
|
38
|
-
const [values] = Object.values(form);
|
|
39
|
-
await repo.update({
|
|
40
|
-
filter: processor.getParsedValue(filter, instance.nodeId),
|
|
41
|
-
values: {
|
|
42
|
-
...values ?? {},
|
|
43
|
-
updatedBy: instance.userId
|
|
44
|
-
},
|
|
45
|
-
context: {
|
|
46
|
-
executionId: processor.execution.id
|
|
47
|
-
},
|
|
48
|
-
transaction: processor.transaction
|
|
49
|
-
});
|
|
50
|
-
}
|
package/dist/server/index.d.ts
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
|
-
export { default } from './Plugin';
|
package/dist/server/index.js
DELETED
|
@@ -1,42 +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
|
-
default: () => import_Plugin.default
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(server_exports);
|
|
42
|
-
var import_Plugin = __toESM(require("./Plugin"));
|
|
@@ -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,98 +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 fix_schema_exports = {};
|
|
28
|
-
__export(fix_schema_exports, {
|
|
29
|
-
default: () => fix_schema_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(fix_schema_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
function findSchema(root, filter, onlyLeaf = false) {
|
|
34
|
-
const result = [];
|
|
35
|
-
if (!root) {
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
if (filter(root) && (!onlyLeaf || !root.properties)) {
|
|
39
|
-
result.push(root);
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
if (root.properties) {
|
|
43
|
-
Object.keys(root.properties).forEach((key) => {
|
|
44
|
-
result.push(...findSchema(root.properties[key], filter));
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
return result;
|
|
48
|
-
}
|
|
49
|
-
function changeToDataPath(item) {
|
|
50
|
-
var _a;
|
|
51
|
-
if (item && ((_a = item["x-decorator-props"]) == null ? void 0 : _a.dataSource)) {
|
|
52
|
-
item["x-decorator-props"].dataPath = item["x-decorator-props"].dataSource.replace(/^{{|}}$/g, "");
|
|
53
|
-
delete item["x-decorator-props"].dataSource;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function migrateSchema(schema) {
|
|
57
|
-
const root = { properties: schema };
|
|
58
|
-
const detailNodes = findSchema(root, (item) => {
|
|
59
|
-
return item["x-decorator"] === "DetailsBlockProvider" && item["x-component"] === "CardItem" && item["x-designer"] === "SimpleDesigner";
|
|
60
|
-
});
|
|
61
|
-
detailNodes.forEach(changeToDataPath);
|
|
62
|
-
return schema;
|
|
63
|
-
}
|
|
64
|
-
class fix_schema_default extends import_server.Migration {
|
|
65
|
-
appVersion = "<0.21.0-alpha.15";
|
|
66
|
-
async up() {
|
|
67
|
-
const { db } = this.context;
|
|
68
|
-
const NodeRepo = db.getRepository("flow_nodes");
|
|
69
|
-
await db.sequelize.transaction(async (transaction) => {
|
|
70
|
-
const nodes = await NodeRepo.find({
|
|
71
|
-
filter: {
|
|
72
|
-
type: "manual"
|
|
73
|
-
},
|
|
74
|
-
transaction
|
|
75
|
-
});
|
|
76
|
-
console.log("%d nodes need to be migrated.", nodes.length);
|
|
77
|
-
await nodes.reduce(
|
|
78
|
-
(promise, node) => promise.then(() => {
|
|
79
|
-
const { assignees, forms, schema = {}, ...tabs } = node.config;
|
|
80
|
-
return node.update(
|
|
81
|
-
{
|
|
82
|
-
config: {
|
|
83
|
-
assignees,
|
|
84
|
-
forms,
|
|
85
|
-
schema: migrateSchema({ ...tabs, ...schema })
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
silent: true,
|
|
90
|
-
transaction
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
}),
|
|
94
|
-
Promise.resolve()
|
|
95
|
-
);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|