@nocobase/plugin-workflow 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 +3 -3
- package/dist/client/AddButton.d.ts +0 -16
- package/dist/client/Branch.d.ts +0 -17
- package/dist/client/CanvasContent.d.ts +0 -12
- package/dist/client/ExecutionCanvas.d.ts +0 -10
- package/dist/client/ExecutionContextProvider.d.ts +0 -15
- package/dist/client/ExecutionLink.d.ts +0 -10
- package/dist/client/ExecutionPage.d.ts +0 -10
- package/dist/client/ExecutionResourceProvider.d.ts +0 -14
- package/dist/client/FlowContext.d.ts +0 -11
- package/dist/client/WorkflowCanvas.d.ts +0 -10
- package/dist/client/WorkflowLink.d.ts +0 -10
- package/dist/client/WorkflowPage.d.ts +0 -10
- package/dist/client/WorkflowPane.d.ts +0 -10
- package/dist/client/components/AssignedFieldsFormSchemaConfig.d.ts +0 -10
- package/dist/client/components/CheckboxGroupWithTooltip.d.ts +0 -15
- package/dist/client/components/CollectionBlockInitializer.d.ts +0 -10
- package/dist/client/components/CollectionFieldset.d.ts +0 -14
- package/dist/client/components/DetailsBlockProvider.d.ts +0 -14
- package/dist/client/components/DrawerDescription.d.ts +0 -10
- package/dist/client/components/DrawerForm.d.ts +0 -13
- package/dist/client/components/ExecutionStatus.d.ts +0 -13
- package/dist/client/components/FieldsSelect.d.ts +0 -10
- package/dist/client/components/FilterDynamicComponent.d.ts +0 -14
- package/dist/client/components/OpenDrawer.d.ts +0 -14
- package/dist/client/components/RadioWithTooltip.d.ts +0 -15
- package/dist/client/components/SimpleDesigner.d.ts +0 -10
- package/dist/client/components/StatusButton.d.ts +0 -10
- package/dist/client/components/TriggerOptionRender.d.ts +0 -12
- package/dist/client/components/ValueBlock.d.ts +0 -14
- package/dist/client/components/index.d.ts +0 -16
- package/dist/client/components/renderEngineReference.d.ts +0 -10
- package/dist/client/constants.d.ts +0 -45
- package/dist/client/hooks/index.d.ts +0 -11
- package/dist/client/hooks/useGetAriaLabelOfAddButton.d.ts +0 -14
- package/dist/client/hooks/useRefreshActionProps.d.ts +0 -11
- package/dist/client/hooks/useTriggerWorkflowActionProps.d.ts +0 -20
- package/dist/client/hooks/useWorkflowExecuted.d.ts +0 -10
- package/dist/client/index.d.ts +0 -43
- package/dist/client/index.js +0 -569
- package/dist/client/locale/index.d.ts +0 -11
- package/dist/client/nodes/calculation.d.ts +0 -80
- package/dist/client/nodes/condition.d.ts +0 -108
- package/dist/client/nodes/create.d.ts +0 -110
- package/dist/client/nodes/destroy.d.ts +0 -54
- package/dist/client/nodes/end.d.ts +0 -30
- package/dist/client/nodes/index.d.ts +0 -76
- package/dist/client/nodes/query.d.ts +0 -236
- package/dist/client/nodes/update.d.ts +0 -114
- package/dist/client/schemas/collection.d.ts +0 -170
- package/dist/client/schemas/executions.d.ts +0 -282
- package/dist/client/schemas/workflows.d.ts +0 -10
- package/dist/client/settings/customizeSubmitToWorkflowActionSettings.d.ts +0 -10
- package/dist/client/style.d.ts +0 -30
- package/dist/client/triggers/collection.d.ts +0 -124
- package/dist/client/triggers/index.d.ts +0 -36
- package/dist/client/triggers/schedule/EndsByField.d.ts +0 -13
- package/dist/client/triggers/schedule/OnField.d.ts +0 -13
- package/dist/client/triggers/schedule/RepeatField.d.ts +0 -13
- package/dist/client/triggers/schedule/ScheduleConfig.d.ts +0 -10
- package/dist/client/triggers/schedule/constants.d.ts +0 -12
- package/dist/client/triggers/schedule/index.d.ts +0 -33
- package/dist/client/triggers/schedule/locale/Cron.zh-CN.d.ts +0 -42
- package/dist/client/utils.d.ts +0 -12
- package/dist/client/variable.d.ts +0 -93
- package/dist/externalVersion.js +0 -34
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -48
- package/dist/locale/en-US.json +0 -98
- package/dist/locale/es-ES.json +0 -98
- package/dist/locale/fr-FR.json +0 -98
- package/dist/locale/ja-JP.json +0 -82
- package/dist/locale/ko_KR.json +0 -168
- package/dist/locale/pt-BR.json +0 -98
- package/dist/locale/ru-RU.json +0 -82
- package/dist/locale/tr-TR.json +0 -82
- package/dist/locale/zh-CN.json +0 -205
- package/dist/node_modules/cron-parser/.eslintrc.json +0 -15
- package/dist/node_modules/cron-parser/.travis.yml +0 -7
- package/dist/node_modules/cron-parser/LICENSE +0 -21
- package/dist/node_modules/cron-parser/component.json +0 -11
- package/dist/node_modules/cron-parser/index.d.ts +0 -1
- package/dist/node_modules/cron-parser/lib/date.js +0 -252
- package/dist/node_modules/cron-parser/lib/expression.js +0 -983
- package/dist/node_modules/cron-parser/lib/field_compactor.js +0 -70
- package/dist/node_modules/cron-parser/lib/field_stringify.js +0 -38
- package/dist/node_modules/cron-parser/lib/parser.js +0 -1
- package/dist/node_modules/cron-parser/node_modules/luxon/build/amd/luxon.js +0 -8489
- package/dist/node_modules/cron-parser/node_modules/luxon/build/cjs-browser/luxon.js +0 -8487
- package/dist/node_modules/cron-parser/node_modules/luxon/build/global/luxon.js +0 -8490
- package/dist/node_modules/cron-parser/node_modules/luxon/build/global/luxon.min.js +0 -1
- package/dist/node_modules/cron-parser/node_modules/luxon/build/node/luxon.js +0 -7522
- package/dist/node_modules/cron-parser/node_modules/luxon/package.json +0 -96
- package/dist/node_modules/cron-parser/node_modules/luxon/src/datetime.js +0 -2169
- package/dist/node_modules/cron-parser/node_modules/luxon/src/duration.js +0 -880
- package/dist/node_modules/cron-parser/node_modules/luxon/src/errors.js +0 -61
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/conversions.js +0 -157
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/diff.js +0 -80
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/digits.js +0 -76
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/english.js +0 -233
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/formats.js +0 -191
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/formatter.js +0 -386
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/invalid.js +0 -14
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/locale.js +0 -482
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/regexParser.js +0 -335
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/tokenParser.js +0 -424
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/util.js +0 -292
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/zoneUtil.js +0 -36
- package/dist/node_modules/cron-parser/node_modules/luxon/src/info.js +0 -193
- package/dist/node_modules/cron-parser/node_modules/luxon/src/interval.js +0 -602
- package/dist/node_modules/cron-parser/node_modules/luxon/src/luxon.js +0 -26
- package/dist/node_modules/cron-parser/node_modules/luxon/src/luxonFilled.js +0 -13
- package/dist/node_modules/cron-parser/node_modules/luxon/src/settings.js +0 -137
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zone.js +0 -88
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/IANAZone.js +0 -191
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/fixedOffsetZone.js +0 -94
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/invalidZone.js +0 -53
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/localZone.js +0 -63
- package/dist/node_modules/cron-parser/package.json +0 -1
- package/dist/node_modules/cron-parser/test/31_of_month.js +0 -17
- package/dist/node_modules/cron-parser/test/bug.js +0 -29
- package/dist/node_modules/cron-parser/test/crondate.js +0 -16
- package/dist/node_modules/cron-parser/test/crontab.example +0 -7
- package/dist/node_modules/cron-parser/test/empty_around_comma.js +0 -22
- package/dist/node_modules/cron-parser/test/expression.js +0 -1489
- package/dist/node_modules/cron-parser/test/field_compactor.js +0 -250
- package/dist/node_modules/cron-parser/test/field_stringify.js +0 -84
- package/dist/node_modules/cron-parser/test/fields.js +0 -32
- package/dist/node_modules/cron-parser/test/increment_on_first_iteration.js +0 -22
- package/dist/node_modules/cron-parser/test/index-ts3.test-d.ts +0 -133
- package/dist/node_modules/cron-parser/test/index.test-d.ts +0 -138
- package/dist/node_modules/cron-parser/test/leap_year.js +0 -17
- package/dist/node_modules/cron-parser/test/parser.js +0 -46
- package/dist/node_modules/cron-parser/test/parser_crondate_formats.js +0 -145
- package/dist/node_modules/cron-parser/test/parser_day_of_month.js +0 -169
- package/dist/node_modules/cron-parser/test/prev_date.js +0 -32
- package/dist/node_modules/cron-parser/test/stringify.js +0 -402
- package/dist/node_modules/cron-parser/test/timezone.js +0 -422
- package/dist/node_modules/cron-parser/types/common.d.ts +0 -131
- package/dist/node_modules/cron-parser/types/index.d.ts +0 -45
- package/dist/node_modules/cron-parser/types/ts3/index.d.ts +0 -28
- package/dist/node_modules/lru-cache/LICENSE +0 -15
- package/dist/node_modules/lru-cache/dist/cjs/index-cjs.d.ts +0 -7
- package/dist/node_modules/lru-cache/dist/cjs/index-cjs.js +0 -1
- package/dist/node_modules/lru-cache/dist/cjs/index.d.ts +0 -807
- package/dist/node_modules/lru-cache/dist/cjs/index.js +0 -1334
- package/dist/node_modules/lru-cache/dist/cjs/index.min.js +0 -2
- package/dist/node_modules/lru-cache/dist/cjs/package.json +0 -3
- package/dist/node_modules/lru-cache/dist/mjs/index.d.ts +0 -807
- package/dist/node_modules/lru-cache/dist/mjs/index.js +0 -1330
- package/dist/node_modules/lru-cache/dist/mjs/index.min.js +0 -2
- package/dist/node_modules/lru-cache/dist/mjs/package.json +0 -3
- package/dist/node_modules/lru-cache/package.json +0 -1
- package/dist/server/Plugin.d.ts +0 -84
- package/dist/server/Plugin.js +0 -503
- package/dist/server/Processor.d.ts +0 -115
- package/dist/server/Processor.js +0 -363
- package/dist/server/actions/executions.d.ts +0 -11
- package/dist/server/actions/executions.js +0 -96
- package/dist/server/actions/index.d.ts +0 -11
- package/dist/server/actions/index.js +0 -66
- package/dist/server/actions/nodes.d.ts +0 -12
- package/dist/server/actions/nodes.js +0 -217
- package/dist/server/actions/workflows.d.ts +0 -14
- package/dist/server/actions/workflows.js +0 -184
- package/dist/server/collections/executions.d.ts +0 -11
- package/dist/server/collections/executions.js +0 -66
- package/dist/server/collections/flow_nodes.d.ts +0 -11
- package/dist/server/collections/flow_nodes.js +0 -87
- package/dist/server/collections/jobs.d.ts +0 -11
- package/dist/server/collections/jobs.js +0 -66
- package/dist/server/collections/workflows.d.ts +0 -10
- package/dist/server/collections/workflows.js +0 -126
- package/dist/server/constants.d.ts +0 -29
- package/dist/server/constants.js +0 -58
- package/dist/server/functions/index.d.ts +0 -17
- package/dist/server/functions/index.js +0 -40
- package/dist/server/index.d.ts +0 -15
- package/dist/server/index.js +0 -60
- package/dist/server/instructions/CalculationInstruction.d.ts +0 -25
- package/dist/server/instructions/CalculationInstruction.js +0 -59
- package/dist/server/instructions/ConditionInstruction.d.ts +0 -36
- package/dist/server/instructions/ConditionInstruction.js +0 -167
- package/dist/server/instructions/CreateInstruction.d.ts +0 -18
- package/dist/server/instructions/CreateInstruction.js +0 -75
- package/dist/server/instructions/DestroyInstruction.d.ts +0 -18
- package/dist/server/instructions/DestroyInstruction.js +0 -59
- package/dist/server/instructions/EndInstruction.d.ts +0 -14
- package/dist/server/instructions/EndInstruction.js +0 -55
- package/dist/server/instructions/QueryInstruction.d.ts +0 -21
- package/dist/server/instructions/QueryInstruction.js +0 -82
- package/dist/server/instructions/UpdateInstruction.d.ts +0 -18
- package/dist/server/instructions/UpdateInstruction.js +0 -59
- package/dist/server/instructions/index.d.ts +0 -31
- package/dist/server/instructions/index.js +0 -42
- package/dist/server/migrations/20221129153547-calculation-variables.d.ts +0 -14
- package/dist/server/migrations/20221129153547-calculation-variables.js +0 -92
- package/dist/server/migrations/20230221032941-change-request-body-type.d.ts +0 -14
- package/dist/server/migrations/20230221032941-change-request-body-type.js +0 -102
- package/dist/server/migrations/20230221071831-calculation-expression.d.ts +0 -13
- package/dist/server/migrations/20230221071831-calculation-expression.js +0 -121
- package/dist/server/migrations/20230221121203-condition-calculation.d.ts +0 -13
- package/dist/server/migrations/20230221121203-condition-calculation.js +0 -106
- package/dist/server/migrations/20230221162902-jsonb-to-json.d.ts +0 -13
- package/dist/server/migrations/20230221162902-jsonb-to-json.js +0 -63
- package/dist/server/migrations/20230411034722-manual-multi-form.d.ts +0 -13
- package/dist/server/migrations/20230411034722-manual-multi-form.js +0 -283
- package/dist/server/migrations/20230612021134-manual-collection-block.d.ts +0 -13
- package/dist/server/migrations/20230612021134-manual-collection-block.js +0 -152
- package/dist/server/migrations/20230710115902-manual-action-values.d.ts +0 -13
- package/dist/server/migrations/20230710115902-manual-action-values.js +0 -101
- package/dist/server/migrations/20230809113132-workflow-options.d.ts +0 -13
- package/dist/server/migrations/20230809113132-workflow-options.js +0 -64
- package/dist/server/migrations/20231024172342-add-node-key.d.ts +0 -13
- package/dist/server/migrations/20231024172342-add-node-key.js +0 -90
- package/dist/server/migrations/20231122143143-split-to-plugins.d.ts +0 -13
- package/dist/server/migrations/20231122143143-split-to-plugins.js +0 -67
- package/dist/server/migrations/20240115220721-add-node-key-to-job.d.ts +0 -14
- package/dist/server/migrations/20240115220721-add-node-key-to-job.js +0 -63
- package/dist/server/migrations/20240613222612-fix-assign-field-config.d.ts +0 -13
- package/dist/server/migrations/20240613222612-fix-assign-field-config.js +0 -62
- package/dist/server/triggers/CollectionTrigger.d.ts +0 -22
- package/dist/server/triggers/CollectionTrigger.js +0 -184
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.d.ts +0 -39
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +0 -356
- package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.d.ts +0 -21
- package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +0 -152
- package/dist/server/triggers/ScheduleTrigger/index.d.ts +0 -18
- package/dist/server/triggers/ScheduleTrigger/index.js +0 -84
- package/dist/server/triggers/ScheduleTrigger/utils.d.ts +0 -13
- package/dist/server/triggers/ScheduleTrigger/utils.js +0 -44
- package/dist/server/triggers/index.d.ts +0 -21
- package/dist/server/triggers/index.js +0 -46
- package/dist/server/types/Execution.d.ts +0 -25
- package/dist/server/types/Execution.js +0 -34
- package/dist/server/types/FlowNode.d.ts +0 -24
- package/dist/server/types/FlowNode.js +0 -34
- package/dist/server/types/Job.d.ts +0 -22
- package/dist/server/types/Job.js +0 -34
- package/dist/server/types/Workflow.d.ts +0 -35
- package/dist/server/types/Workflow.js +0 -34
- package/dist/server/types/index.d.ts +0 -12
- package/dist/server/types/index.js +0 -24
- package/dist/server/utils.d.ts +0 -9
- package/dist/server/utils.js +0 -51
- package/dist/swagger/index.d.ts +0 -762
- package/dist/swagger/index.js +0 -807
|
@@ -1,283 +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 manual_multi_form_exports = {};
|
|
38
|
-
__export(manual_multi_form_exports, {
|
|
39
|
-
default: () => manual_multi_form_default
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(manual_multi_form_exports);
|
|
42
|
-
var import_server = require("@nocobase/server");
|
|
43
|
-
var import_utils = require("@nocobase/utils");
|
|
44
|
-
var import_lodash = __toESM(require("lodash"));
|
|
45
|
-
function findSchema(root, filter, onlyLeaf = false) {
|
|
46
|
-
const result = [];
|
|
47
|
-
if (!root) {
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
if (filter(root) && (!onlyLeaf || !root.properties)) {
|
|
51
|
-
result.push(root);
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
|
-
if (root.properties) {
|
|
55
|
-
Object.keys(root.properties).forEach((key) => {
|
|
56
|
-
result.push(...findSchema(root.properties[key], filter));
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
function findParent(root, node) {
|
|
62
|
-
return findSchema(root, (item) => item.properties && Object.values(item.properties).includes(node))[0];
|
|
63
|
-
}
|
|
64
|
-
function migrateConfig({ schema = {}, actions = [] }) {
|
|
65
|
-
const { blocks, collection } = schema;
|
|
66
|
-
if (!blocks) {
|
|
67
|
-
return {
|
|
68
|
-
forms: {}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
const root = { properties: blocks };
|
|
72
|
-
const formBlocks = findSchema(root, (item) => {
|
|
73
|
-
return item["x-component"] === "CardItem" && item["x-designer"] === "SimpleDesigner" && item.properties.grid["x-initializer"] === "AddFormField";
|
|
74
|
-
});
|
|
75
|
-
if (!formBlocks.length) {
|
|
76
|
-
return {
|
|
77
|
-
schema: blocks,
|
|
78
|
-
forms: {}
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
formBlocks.forEach((formBlock2, i) => {
|
|
82
|
-
const formItems = findSchema(
|
|
83
|
-
formBlock2,
|
|
84
|
-
(item) => {
|
|
85
|
-
return item["x-component"] === "CollectionField" && item["x-decorator"] === "FormItem";
|
|
86
|
-
},
|
|
87
|
-
true
|
|
88
|
-
);
|
|
89
|
-
formItems.forEach((item) => {
|
|
90
|
-
Object.assign(item, {
|
|
91
|
-
"x-interface-options": collection.fields.find((field) => field.name === item.name)
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
if (!i) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
Object.assign(formBlocks[0].properties.grid.properties, formBlock2.properties.grid.properties);
|
|
98
|
-
const col = findParent(root, formBlock2);
|
|
99
|
-
const row = findParent(root, col);
|
|
100
|
-
delete row.properties[col.name];
|
|
101
|
-
if (!Object.keys(row.properties).length) {
|
|
102
|
-
const grid = findParent(root, row);
|
|
103
|
-
delete grid.properties[row.name];
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
const [formBlock] = formBlocks;
|
|
107
|
-
Object.assign(formBlock, {
|
|
108
|
-
"x-decorator": "FormCollectionProvider",
|
|
109
|
-
"x-decorator-props": {
|
|
110
|
-
collection
|
|
111
|
-
},
|
|
112
|
-
"x-component-props": {
|
|
113
|
-
title: '{{t("Form")}}'
|
|
114
|
-
},
|
|
115
|
-
"x-designer-props": {
|
|
116
|
-
type: "customForm"
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
const formId = (0, import_utils.uid)();
|
|
120
|
-
const newFormBlock = {
|
|
121
|
-
[formId]: {
|
|
122
|
-
type: "void",
|
|
123
|
-
"x-component": "FormV2",
|
|
124
|
-
"x-use-component-props": "useFormBlockProps",
|
|
125
|
-
properties: {
|
|
126
|
-
grid: Object.assign(formBlock.properties.grid, {
|
|
127
|
-
"x-initializer": "workflowManual:customForm:configureFields"
|
|
128
|
-
}),
|
|
129
|
-
// 7.
|
|
130
|
-
actions: {
|
|
131
|
-
type: "void",
|
|
132
|
-
"x-decorator": "ActionBarProvider",
|
|
133
|
-
"x-component": "ActionBar",
|
|
134
|
-
"x-component-props": {
|
|
135
|
-
layout: "one-column",
|
|
136
|
-
style: {
|
|
137
|
-
marginTop: "1.5em"
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"x-initializer": "workflowManual:form:configureActions",
|
|
141
|
-
properties: schema.actions
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
delete formBlock.properties.grid;
|
|
147
|
-
Object.assign(formBlock.properties, newFormBlock);
|
|
148
|
-
return {
|
|
149
|
-
schema: blocks,
|
|
150
|
-
forms: {
|
|
151
|
-
[formId]: {
|
|
152
|
-
type: "custom",
|
|
153
|
-
title: '{{t("Form")}}',
|
|
154
|
-
actions,
|
|
155
|
-
collection
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
function migrateUsedConfig(config, manualForms) {
|
|
161
|
-
Object.keys(config).forEach((key) => {
|
|
162
|
-
const valueType = typeof config[key];
|
|
163
|
-
if (valueType === "string") {
|
|
164
|
-
config[key] = config[key].replace(/{{\s*\$jobsMapByNodeId\.(\d+)(\.[^}]+)?\s*}}/g, (matched, id, path) => {
|
|
165
|
-
if (!manualForms[id]) {
|
|
166
|
-
return matched;
|
|
167
|
-
}
|
|
168
|
-
return `{{$jobsMapByNodeId.${id}.${manualForms[id]}${path || ""}}}`;
|
|
169
|
-
});
|
|
170
|
-
} else if (valueType === "object" && config[key]) {
|
|
171
|
-
migrateUsedConfig(config[key], manualForms);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
return config;
|
|
175
|
-
}
|
|
176
|
-
class manual_multi_form_default extends import_server.Migration {
|
|
177
|
-
appVersion = "<0.9.1-alpha.3";
|
|
178
|
-
async up() {
|
|
179
|
-
const match = await this.app.version.satisfies("<0.9.1-alpha.3");
|
|
180
|
-
if (!match) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
const { db } = this.context;
|
|
184
|
-
const NodeRepo = db.getRepository("flow_nodes");
|
|
185
|
-
const UserJobRepo = db.getRepository("users_jobs");
|
|
186
|
-
await db.sequelize.transaction(async (transaction) => {
|
|
187
|
-
const nodes = await NodeRepo.find({
|
|
188
|
-
filter: {
|
|
189
|
-
type: "manual"
|
|
190
|
-
},
|
|
191
|
-
transaction
|
|
192
|
-
});
|
|
193
|
-
console.log("%d nodes need to be migrated.", nodes.length);
|
|
194
|
-
await nodes.reduce(
|
|
195
|
-
(promise, node) => promise.then(() => {
|
|
196
|
-
const { forms, schema, actions, ...config } = node.config;
|
|
197
|
-
if (forms) {
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
return node.update(
|
|
201
|
-
{
|
|
202
|
-
config: {
|
|
203
|
-
...config,
|
|
204
|
-
...migrateConfig({ schema, actions })
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
silent: true,
|
|
209
|
-
transaction
|
|
210
|
-
}
|
|
211
|
-
);
|
|
212
|
-
}),
|
|
213
|
-
Promise.resolve()
|
|
214
|
-
);
|
|
215
|
-
const usersJobs = await UserJobRepo.find({
|
|
216
|
-
filter: {
|
|
217
|
-
nodeId: nodes.map((item) => item.id)
|
|
218
|
-
},
|
|
219
|
-
appends: ["job", "node"],
|
|
220
|
-
transaction
|
|
221
|
-
});
|
|
222
|
-
await usersJobs.reduce(
|
|
223
|
-
(promise, userJob) => promise.then(async () => {
|
|
224
|
-
const { result, job, node } = userJob;
|
|
225
|
-
const { forms } = node.config;
|
|
226
|
-
const [formId] = Object.keys(forms);
|
|
227
|
-
if (result) {
|
|
228
|
-
await userJob.update(
|
|
229
|
-
{
|
|
230
|
-
result: { [formId]: result }
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
silent: true,
|
|
234
|
-
transaction
|
|
235
|
-
}
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
if (job.result) {
|
|
239
|
-
await job.update(
|
|
240
|
-
{
|
|
241
|
-
result: { [formId]: result }
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
silent: true,
|
|
245
|
-
transaction
|
|
246
|
-
}
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
}),
|
|
250
|
-
Promise.resolve()
|
|
251
|
-
);
|
|
252
|
-
const usedNodes = await NodeRepo.find({
|
|
253
|
-
filter: {
|
|
254
|
-
type: {
|
|
255
|
-
$notIn: ["delay", "parallel"]
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
transaction
|
|
259
|
-
});
|
|
260
|
-
const nodeForms = {};
|
|
261
|
-
nodes.forEach((node) => {
|
|
262
|
-
const [form] = Object.keys(node.config.forms);
|
|
263
|
-
if (form) {
|
|
264
|
-
nodeForms[node.id] = form;
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
await usedNodes.reduce(
|
|
268
|
-
(promise, node) => promise.then(async () => {
|
|
269
|
-
await node.update(
|
|
270
|
-
{
|
|
271
|
-
config: migrateUsedConfig(import_lodash.default.cloneDeep(node.config ?? {}), nodeForms)
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
silent: true,
|
|
275
|
-
transaction
|
|
276
|
-
}
|
|
277
|
-
);
|
|
278
|
-
}),
|
|
279
|
-
Promise.resolve()
|
|
280
|
-
);
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
}
|
|
@@ -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,152 +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 manual_collection_block_exports = {};
|
|
28
|
-
__export(manual_collection_block_exports, {
|
|
29
|
-
default: () => manual_collection_block_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(manual_collection_block_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
var import_utils = require("@nocobase/utils");
|
|
34
|
-
function findSchema(root, filter, onlyLeaf = false) {
|
|
35
|
-
const result = [];
|
|
36
|
-
if (!root) {
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
if (filter(root) && (!onlyLeaf || !root.properties)) {
|
|
40
|
-
result.push(root);
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
if (root.properties) {
|
|
44
|
-
Object.keys(root.properties).forEach((key) => {
|
|
45
|
-
result.push(...findSchema(root.properties[key], filter));
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
function migrateSchema(schema = {}) {
|
|
51
|
-
const root = { properties: schema };
|
|
52
|
-
const collectionBlocks = findSchema(root, (item) => {
|
|
53
|
-
return item["x-component"] === "CardItem" && item["x-designer"] === "SimpleDesigner" && item["x-decorator"] === "CollectionProvider_deprecated";
|
|
54
|
-
});
|
|
55
|
-
collectionBlocks.forEach((block) => {
|
|
56
|
-
const id = (0, import_utils.uid)();
|
|
57
|
-
const { grid } = block.properties;
|
|
58
|
-
delete block.properties.grid;
|
|
59
|
-
const fields = findSchema(grid, (item) => {
|
|
60
|
-
return item["x-decorator"] === "FormItem";
|
|
61
|
-
});
|
|
62
|
-
fields.forEach((field) => {
|
|
63
|
-
Object.assign(field, {
|
|
64
|
-
"x-component": "CollectionField",
|
|
65
|
-
"x-collection-field": `${block["x-decorator-props"].collection}.${field["x-collection-field"]}`
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
Object.assign(block, {
|
|
69
|
-
"x-decorator": "DetailsBlockProvider",
|
|
70
|
-
"x-decorator-props": {
|
|
71
|
-
...block["x-decorator-props"],
|
|
72
|
-
dataSource: grid["x-context-datasource"]
|
|
73
|
-
},
|
|
74
|
-
properties: {
|
|
75
|
-
[id]: {
|
|
76
|
-
type: "void",
|
|
77
|
-
name: id,
|
|
78
|
-
"x-component": "FormV2",
|
|
79
|
-
"x-use-component-props": "useDetailsBlockProps",
|
|
80
|
-
properties: {
|
|
81
|
-
grid: {
|
|
82
|
-
type: "void",
|
|
83
|
-
name: "grid",
|
|
84
|
-
"x-component": "Grid",
|
|
85
|
-
"x-initializer": "details:configureFields",
|
|
86
|
-
properties: grid.properties
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
const customForms = findSchema(root, (item) => {
|
|
94
|
-
return item["x-decorator"] === "FormCollectionProvider";
|
|
95
|
-
});
|
|
96
|
-
customForms.forEach((item) => {
|
|
97
|
-
Object.assign(item, {
|
|
98
|
-
"x-decorator": "CustomFormBlockProvider"
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
const customFormFields = findSchema(root, (item) => {
|
|
102
|
-
return item["x-interface-options"];
|
|
103
|
-
});
|
|
104
|
-
customFormFields.forEach((field) => {
|
|
105
|
-
const options = field["x-interface-options"];
|
|
106
|
-
delete field["x-interface-options"];
|
|
107
|
-
Object.assign(field, {
|
|
108
|
-
"x-component-props": {
|
|
109
|
-
field: options
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
return schema;
|
|
114
|
-
}
|
|
115
|
-
class manual_collection_block_default extends import_server.Migration {
|
|
116
|
-
appVersion = "<0.9.4-alpha.3";
|
|
117
|
-
async up() {
|
|
118
|
-
const match = await this.app.version.satisfies("<0.9.4-alpha.3");
|
|
119
|
-
if (!match) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
const { db } = this.context;
|
|
123
|
-
const NodeRepo = db.getRepository("flow_nodes");
|
|
124
|
-
await NodeRepo.collection.sync();
|
|
125
|
-
await db.sequelize.transaction(async (transaction) => {
|
|
126
|
-
const nodes = await NodeRepo.find({
|
|
127
|
-
filter: {
|
|
128
|
-
type: "manual"
|
|
129
|
-
},
|
|
130
|
-
transaction
|
|
131
|
-
});
|
|
132
|
-
console.log("%d nodes need to be migrated.", nodes.length);
|
|
133
|
-
await nodes.reduce(
|
|
134
|
-
(promise, node) => promise.then(() => {
|
|
135
|
-
const { schema, ...config } = node.config;
|
|
136
|
-
node.set("config", {
|
|
137
|
-
...config,
|
|
138
|
-
schema: {
|
|
139
|
-
...migrateSchema(schema)
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
node.changed("config", true);
|
|
143
|
-
return node.save({
|
|
144
|
-
silent: true,
|
|
145
|
-
transaction
|
|
146
|
-
});
|
|
147
|
-
}),
|
|
148
|
-
Promise.resolve()
|
|
149
|
-
);
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
@@ -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,101 +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 manual_action_values_exports = {};
|
|
28
|
-
__export(manual_action_values_exports, {
|
|
29
|
-
default: () => manual_action_values_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(manual_action_values_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 migrateConfig(config) {
|
|
50
|
-
const { forms = {}, schema = {} } = config;
|
|
51
|
-
const root = { properties: schema };
|
|
52
|
-
Object.keys(forms).forEach((key) => {
|
|
53
|
-
const form = forms[key];
|
|
54
|
-
const formSchema = findSchema(root, (item) => item.name === key);
|
|
55
|
-
const actions = findSchema(formSchema[0], (item) => item["x-component"] === "Action");
|
|
56
|
-
form.actions = actions.map((action) => {
|
|
57
|
-
action["x-designer"] = "ManualActionDesigner";
|
|
58
|
-
action["x-action-settings"] = {};
|
|
59
|
-
delete action["x-action"];
|
|
60
|
-
return {
|
|
61
|
-
status: action["x-decorator-props"].value,
|
|
62
|
-
values: {},
|
|
63
|
-
key: action.name
|
|
64
|
-
};
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
return config;
|
|
68
|
-
}
|
|
69
|
-
class manual_action_values_default extends import_server.Migration {
|
|
70
|
-
appVersion = "<0.11.0-alpha.2";
|
|
71
|
-
async up() {
|
|
72
|
-
const match = await this.app.version.satisfies("<0.11.0-alpha.2");
|
|
73
|
-
if (!match) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const { db } = this.context;
|
|
77
|
-
const NodeRepo = db.getRepository("flow_nodes");
|
|
78
|
-
await db.sequelize.transaction(async (transaction) => {
|
|
79
|
-
const nodes = await NodeRepo.find({
|
|
80
|
-
filter: {
|
|
81
|
-
type: "manual"
|
|
82
|
-
},
|
|
83
|
-
transaction
|
|
84
|
-
});
|
|
85
|
-
console.log("%d nodes need to be migrated.", nodes.length);
|
|
86
|
-
await nodes.reduce(
|
|
87
|
-
(promise, node) => promise.then(() => {
|
|
88
|
-
node.set("config", {
|
|
89
|
-
...migrateConfig(node.config)
|
|
90
|
-
});
|
|
91
|
-
node.changed("config", true);
|
|
92
|
-
return node.save({
|
|
93
|
-
silent: true,
|
|
94
|
-
transaction
|
|
95
|
-
});
|
|
96
|
-
}),
|
|
97
|
-
Promise.resolve()
|
|
98
|
-
);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -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,64 +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 workflow_options_exports = {};
|
|
28
|
-
__export(workflow_options_exports, {
|
|
29
|
-
default: () => workflow_options_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(workflow_options_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
class workflow_options_default extends import_server.Migration {
|
|
34
|
-
appVersion = "<0.14.0-alpha.8";
|
|
35
|
-
async up() {
|
|
36
|
-
const match = await this.app.version.satisfies("<0.14.0-alpha.8");
|
|
37
|
-
if (!match) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const { db } = this.context;
|
|
41
|
-
const WorkflowRepo = db.getRepository("workflows");
|
|
42
|
-
await db.sequelize.transaction(async (transaction) => {
|
|
43
|
-
const workflows = await WorkflowRepo.find({
|
|
44
|
-
transaction
|
|
45
|
-
});
|
|
46
|
-
await workflows.reduce(
|
|
47
|
-
(promise, workflow) => promise.then(() => {
|
|
48
|
-
if (!workflow.useTransaction) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
workflow.set("options", {
|
|
52
|
-
useTransaction: workflow.get("useTransaction")
|
|
53
|
-
});
|
|
54
|
-
workflow.changed("options", true);
|
|
55
|
-
return workflow.save({
|
|
56
|
-
silent: true,
|
|
57
|
-
transaction
|
|
58
|
-
});
|
|
59
|
-
}),
|
|
60
|
-
Promise.resolve()
|
|
61
|
-
);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -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
|
-
}
|