@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,102 +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 change_request_body_type_exports = {};
|
|
28
|
-
__export(change_request_body_type_exports, {
|
|
29
|
-
default: () => change_request_body_type_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(change_request_body_type_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
const EJS_RE = /"?<%=\s*(ctx|node)([\w\.\[\]-]+)\s*.*%>"?/;
|
|
34
|
-
function migrateData(input) {
|
|
35
|
-
if (typeof input !== "string") {
|
|
36
|
-
return input;
|
|
37
|
-
}
|
|
38
|
-
if (!input) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
const typeMap = {
|
|
42
|
-
ctx: "$context",
|
|
43
|
-
node: "$jobsMapByNodeId"
|
|
44
|
-
};
|
|
45
|
-
return input.replace(EJS_RE, (_, type, path) => {
|
|
46
|
-
if (type === "ctx") {
|
|
47
|
-
return `"{{$context${path}}}"`;
|
|
48
|
-
}
|
|
49
|
-
if (type === "node") {
|
|
50
|
-
return `"{{$jobsMapByNodeId${path.replace("[", ".").replace("]", ".").replace(/\.$/, "")}}}"`;
|
|
51
|
-
}
|
|
52
|
-
return _;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
class change_request_body_type_default extends import_server.Migration {
|
|
56
|
-
appVersion = "<0.9.0-alpha.3";
|
|
57
|
-
async up() {
|
|
58
|
-
const match = await this.app.version.satisfies("<0.9.0-alpha.3");
|
|
59
|
-
if (!match) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const NodeRepo = this.context.db.getRepository("flow_nodes");
|
|
63
|
-
await this.context.db.sequelize.transaction(async (transaction) => {
|
|
64
|
-
const nodes = await NodeRepo.find({
|
|
65
|
-
filter: {
|
|
66
|
-
type: "request"
|
|
67
|
-
},
|
|
68
|
-
transaction
|
|
69
|
-
});
|
|
70
|
-
console.log("%d nodes need to be migrated.", nodes.length);
|
|
71
|
-
await nodes.reduce(
|
|
72
|
-
(promise, node) => promise.then(async () => {
|
|
73
|
-
if (typeof node.config.data !== "string") {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
let data = migrateData(node.config.data);
|
|
77
|
-
try {
|
|
78
|
-
data = JSON.parse(node.config.data);
|
|
79
|
-
return node.update(
|
|
80
|
-
{
|
|
81
|
-
config: {
|
|
82
|
-
...node.config,
|
|
83
|
-
data
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
transaction
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
} catch (error) {
|
|
91
|
-
console.error(
|
|
92
|
-
`flow_node #${node.id} config migrating failed! you should migrate its format from ejs to json-templates manually in your db.`
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
}),
|
|
96
|
-
Promise.resolve()
|
|
97
|
-
);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
async down() {
|
|
101
|
-
}
|
|
102
|
-
}
|
|
@@ -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,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 calculation_expression_exports = {};
|
|
28
|
-
__export(calculation_expression_exports, {
|
|
29
|
-
default: () => calculation_expression_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(calculation_expression_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
function addQuote(v) {
|
|
34
|
-
if (typeof v !== "string") {
|
|
35
|
-
return v;
|
|
36
|
-
}
|
|
37
|
-
if (v.match(/^{{\s*([^{}]+)\s*}}$/)) {
|
|
38
|
-
return v;
|
|
39
|
-
}
|
|
40
|
-
return `'${v}'`;
|
|
41
|
-
}
|
|
42
|
-
const calculatorsMap = {
|
|
43
|
-
equal: "==",
|
|
44
|
-
"===": "==",
|
|
45
|
-
notEqual: "!=",
|
|
46
|
-
"!==": "!=",
|
|
47
|
-
gt: ">",
|
|
48
|
-
gte: ">=",
|
|
49
|
-
lt: "<",
|
|
50
|
-
lte: "<=",
|
|
51
|
-
add: "+",
|
|
52
|
-
minus: "-",
|
|
53
|
-
multiple: "*",
|
|
54
|
-
divide: "/",
|
|
55
|
-
mod: "%",
|
|
56
|
-
includes(a, b) {
|
|
57
|
-
return `SEARCH(${b}, ${a}) >= 0`;
|
|
58
|
-
},
|
|
59
|
-
notIncludes(a, b) {
|
|
60
|
-
return `SEARCH(${b}, ${a}) < 0`;
|
|
61
|
-
},
|
|
62
|
-
startsWith(a, b) {
|
|
63
|
-
return `SEARCH(${b}, ${a}) == 0`;
|
|
64
|
-
},
|
|
65
|
-
endsWith(a, b) {
|
|
66
|
-
return `RIGHT(${a}, LEN(${b})) == ${b}`;
|
|
67
|
-
},
|
|
68
|
-
notStartsWith(a, b) {
|
|
69
|
-
return `SEARCH(${b}, ${a}) != 0`;
|
|
70
|
-
},
|
|
71
|
-
notEndsWith(a, b) {
|
|
72
|
-
return `RIGHT(${a}, LEN(${b})) != ${b}`;
|
|
73
|
-
},
|
|
74
|
-
concat(a, b) {
|
|
75
|
-
return `CONCATENATE(${a}, ${b})`;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
function migrateConfig({ calculation, ...config } = {}) {
|
|
79
|
-
var _a;
|
|
80
|
-
if (!(calculation == null ? void 0 : calculation.calculator) || !((_a = calculation == null ? void 0 : calculation.operands) == null ? void 0 : _a.length)) {
|
|
81
|
-
return config;
|
|
82
|
-
}
|
|
83
|
-
const calculator = calculatorsMap[calculation.calculator];
|
|
84
|
-
const operands = (calculator.operands ?? []).map((operand) => addQuote(operand));
|
|
85
|
-
return {
|
|
86
|
-
engine: "formula.js",
|
|
87
|
-
expression: typeof calculator === "function" ? calculator(...operands) : operands.join(` ${calculator ?? calculation.calculator} `)
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
class calculation_expression_default extends import_server.Migration {
|
|
91
|
-
appVersion = "<0.9.0-alpha.3";
|
|
92
|
-
async up() {
|
|
93
|
-
const match = await this.app.version.satisfies("<0.9.0-alpha.3");
|
|
94
|
-
if (!match) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const NodeRepo = this.context.db.getRepository("flow_nodes");
|
|
98
|
-
await this.context.db.sequelize.transaction(async (transaction) => {
|
|
99
|
-
const nodes = await NodeRepo.find({
|
|
100
|
-
filter: {
|
|
101
|
-
type: "calculation"
|
|
102
|
-
},
|
|
103
|
-
transaction
|
|
104
|
-
});
|
|
105
|
-
console.log("%d nodes need to be migrated.", nodes.length);
|
|
106
|
-
await nodes.reduce(
|
|
107
|
-
(promise, node) => promise.then(() => {
|
|
108
|
-
return node.update(
|
|
109
|
-
{
|
|
110
|
-
config: migrateConfig(node.config)
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
transaction
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
}),
|
|
117
|
-
Promise.resolve()
|
|
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,106 +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 condition_calculation_exports = {};
|
|
28
|
-
__export(condition_calculation_exports, {
|
|
29
|
-
default: () => condition_calculation_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(condition_calculation_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
const calculatorsMap = {
|
|
34
|
-
equal: "==",
|
|
35
|
-
"===": "==",
|
|
36
|
-
notEqual: "!=",
|
|
37
|
-
"!==": "!=",
|
|
38
|
-
gt: ">",
|
|
39
|
-
gte: ">=",
|
|
40
|
-
lt: "<",
|
|
41
|
-
lte: "<=",
|
|
42
|
-
includes(a, b) {
|
|
43
|
-
return `SEARCH('${b}', '${a}') >= 0`;
|
|
44
|
-
},
|
|
45
|
-
notIncludes(a, b) {
|
|
46
|
-
return `SEARCH('${b}', '${a}') < 0`;
|
|
47
|
-
},
|
|
48
|
-
startsWith(a, b) {
|
|
49
|
-
return `SEARCH('${b}', '${a}') == 0`;
|
|
50
|
-
},
|
|
51
|
-
endsWith(a, b) {
|
|
52
|
-
return `RIGHT('${a}', LEN('${b}')) == '${b}'`;
|
|
53
|
-
},
|
|
54
|
-
notStartsWith(a, b) {
|
|
55
|
-
return `SEARCH('${b}', '${a}') != 0`;
|
|
56
|
-
},
|
|
57
|
-
notEndsWith(a, b) {
|
|
58
|
-
return `RIGHT('${a}', LEN('${b}')) != '${b}'`;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
function migrateConfig({ group: { type = "and", calculations = [] } }) {
|
|
62
|
-
return {
|
|
63
|
-
group: {
|
|
64
|
-
type,
|
|
65
|
-
calculations: calculations.map(({ calculator = "===", operands = [] }) => {
|
|
66
|
-
return `(${operands.map((operand) => (operand == null ? void 0 : operand.group) ? migrateConfig(operand) : operand).join(` ${calculatorsMap[calculator]} `)})`;
|
|
67
|
-
})
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
class condition_calculation_default extends import_server.Migration {
|
|
72
|
-
appVersion = "<0.9.0-alpha.3";
|
|
73
|
-
async up() {
|
|
74
|
-
const match = await this.app.version.satisfies("<0.9.0-alpha.3");
|
|
75
|
-
if (!match) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const NodeRepo = this.context.db.getRepository("flow_nodes");
|
|
79
|
-
await this.context.db.sequelize.transaction(async (transaction) => {
|
|
80
|
-
const nodes = await NodeRepo.find({
|
|
81
|
-
filter: {
|
|
82
|
-
type: "condition"
|
|
83
|
-
},
|
|
84
|
-
transaction
|
|
85
|
-
});
|
|
86
|
-
console.log("%d nodes need to be migrated.", nodes.length);
|
|
87
|
-
await nodes.reduce(
|
|
88
|
-
(promise, node) => promise.then(() => {
|
|
89
|
-
return node.update(
|
|
90
|
-
{
|
|
91
|
-
config: {
|
|
92
|
-
...node.config,
|
|
93
|
-
engine: "basic"
|
|
94
|
-
// calculation: migrateConfig(node.config.calculation)
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
transaction
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
}),
|
|
102
|
-
Promise.resolve()
|
|
103
|
-
);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -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,63 +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 jsonb_to_json_exports = {};
|
|
28
|
-
__export(jsonb_to_json_exports, {
|
|
29
|
-
default: () => jsonb_to_json_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(jsonb_to_json_exports);
|
|
32
|
-
var import_database = require("@nocobase/database");
|
|
33
|
-
var import_server = require("@nocobase/server");
|
|
34
|
-
class jsonb_to_json_default extends import_server.Migration {
|
|
35
|
-
appVersion = "<0.9.0-alpha.3";
|
|
36
|
-
async up() {
|
|
37
|
-
const match = await this.app.version.satisfies("<0.9.0-alpha.3");
|
|
38
|
-
if (!match) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const sequelize = this.sequelize;
|
|
42
|
-
const queryInterface = this.queryInterface;
|
|
43
|
-
const { db } = this.app;
|
|
44
|
-
await sequelize.transaction(async (transaction) => {
|
|
45
|
-
await queryInterface.changeColumn(
|
|
46
|
-
db.getCollection("workflows").model.getTableName(),
|
|
47
|
-
"config",
|
|
48
|
-
{
|
|
49
|
-
type: import_database.DataTypes.JSON
|
|
50
|
-
},
|
|
51
|
-
{ transaction }
|
|
52
|
-
);
|
|
53
|
-
await queryInterface.changeColumn(
|
|
54
|
-
db.getCollection("flow_nodes").model.getTableName(),
|
|
55
|
-
"config",
|
|
56
|
-
{
|
|
57
|
-
type: import_database.DataTypes.JSON
|
|
58
|
-
},
|
|
59
|
-
{ transaction }
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -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
|
-
}
|