@nocobase/plugin-workflow 1.2.12-alpha → 1.3.0-alpha.20240710084543
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +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,126 +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 workflows_exports = {};
|
|
28
|
-
__export(workflows_exports, {
|
|
29
|
-
default: () => workflows_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(workflows_exports);
|
|
32
|
-
function workflows_default() {
|
|
33
|
-
return {
|
|
34
|
-
dumpRules: "required",
|
|
35
|
-
name: "workflows",
|
|
36
|
-
shared: true,
|
|
37
|
-
fields: [
|
|
38
|
-
{
|
|
39
|
-
name: "key",
|
|
40
|
-
type: "uid"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
type: "string",
|
|
44
|
-
name: "title",
|
|
45
|
-
required: true
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
type: "boolean",
|
|
49
|
-
name: "enabled",
|
|
50
|
-
defaultValue: false
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: "text",
|
|
54
|
-
name: "description"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
type: "string",
|
|
58
|
-
name: "type",
|
|
59
|
-
required: true
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
type: "string",
|
|
63
|
-
name: "triggerTitle"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: "jsonb",
|
|
67
|
-
name: "config",
|
|
68
|
-
required: true,
|
|
69
|
-
defaultValue: {}
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
type: "hasMany",
|
|
73
|
-
name: "nodes",
|
|
74
|
-
target: "flow_nodes",
|
|
75
|
-
onDelete: "CASCADE"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
type: "hasMany",
|
|
79
|
-
name: "executions",
|
|
80
|
-
onDelete: "CASCADE"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
type: "integer",
|
|
84
|
-
name: "executed",
|
|
85
|
-
defaultValue: 0
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
type: "integer",
|
|
89
|
-
name: "allExecuted",
|
|
90
|
-
defaultValue: 0
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
type: "boolean",
|
|
94
|
-
name: "current",
|
|
95
|
-
defaultValue: false
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
type: "boolean",
|
|
99
|
-
name: "sync",
|
|
100
|
-
defaultValue: false
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
type: "hasMany",
|
|
104
|
-
name: "revisions",
|
|
105
|
-
target: "workflows",
|
|
106
|
-
foreignKey: "key",
|
|
107
|
-
sourceKey: "key",
|
|
108
|
-
// NOTE: no constraints needed here because tricky self-referencing
|
|
109
|
-
constraints: false,
|
|
110
|
-
onDelete: "NO ACTION"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
type: "jsonb",
|
|
114
|
-
name: "options",
|
|
115
|
-
defaultValue: {}
|
|
116
|
-
}
|
|
117
|
-
],
|
|
118
|
-
// NOTE: use unique index for avoiding deadlock in mysql when setCurrent
|
|
119
|
-
indexes: [
|
|
120
|
-
{
|
|
121
|
-
unique: true,
|
|
122
|
-
fields: ["key", "current"]
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
};
|
|
126
|
-
}
|
|
@@ -1,29 +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 declare const EXECUTION_STATUS: {
|
|
10
|
-
readonly QUEUEING: any;
|
|
11
|
-
readonly STARTED: 0;
|
|
12
|
-
readonly RESOLVED: 1;
|
|
13
|
-
readonly FAILED: -1;
|
|
14
|
-
readonly ERROR: -2;
|
|
15
|
-
readonly ABORTED: -3;
|
|
16
|
-
readonly CANCELED: -4;
|
|
17
|
-
readonly REJECTED: -5;
|
|
18
|
-
readonly RETRY_NEEDED: -6;
|
|
19
|
-
};
|
|
20
|
-
export declare const JOB_STATUS: {
|
|
21
|
-
readonly PENDING: 0;
|
|
22
|
-
readonly RESOLVED: 1;
|
|
23
|
-
readonly FAILED: -1;
|
|
24
|
-
readonly ERROR: -2;
|
|
25
|
-
readonly ABORTED: -3;
|
|
26
|
-
readonly CANCELED: -4;
|
|
27
|
-
readonly REJECTED: -5;
|
|
28
|
-
readonly RETRY_NEEDED: -6;
|
|
29
|
-
};
|
package/dist/server/constants.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var constants_exports = {};
|
|
28
|
-
__export(constants_exports, {
|
|
29
|
-
EXECUTION_STATUS: () => EXECUTION_STATUS,
|
|
30
|
-
JOB_STATUS: () => JOB_STATUS
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(constants_exports);
|
|
33
|
-
const EXECUTION_STATUS = {
|
|
34
|
-
QUEUEING: null,
|
|
35
|
-
STARTED: 0,
|
|
36
|
-
RESOLVED: 1,
|
|
37
|
-
FAILED: -1,
|
|
38
|
-
ERROR: -2,
|
|
39
|
-
ABORTED: -3,
|
|
40
|
-
CANCELED: -4,
|
|
41
|
-
REJECTED: -5,
|
|
42
|
-
RETRY_NEEDED: -6
|
|
43
|
-
};
|
|
44
|
-
const JOB_STATUS = {
|
|
45
|
-
PENDING: 0,
|
|
46
|
-
RESOLVED: 1,
|
|
47
|
-
FAILED: -1,
|
|
48
|
-
ERROR: -2,
|
|
49
|
-
ABORTED: -3,
|
|
50
|
-
CANCELED: -4,
|
|
51
|
-
REJECTED: -5,
|
|
52
|
-
RETRY_NEEDED: -6
|
|
53
|
-
};
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
EXECUTION_STATUS,
|
|
57
|
-
JOB_STATUS
|
|
58
|
-
});
|
|
@@ -1,17 +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 Plugin from '..';
|
|
10
|
-
import type { ExecutionModel, FlowNodeModel } from '../types';
|
|
11
|
-
export type CustomFunction = (this: {
|
|
12
|
-
execution: ExecutionModel;
|
|
13
|
-
node?: FlowNodeModel;
|
|
14
|
-
}) => any;
|
|
15
|
-
export default function ({ functions }: Plugin, more?: {
|
|
16
|
-
[key: string]: CustomFunction;
|
|
17
|
-
}): void;
|
|
@@ -1,40 +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 functions_exports = {};
|
|
28
|
-
__export(functions_exports, {
|
|
29
|
-
default: () => functions_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(functions_exports);
|
|
32
|
-
function now() {
|
|
33
|
-
return /* @__PURE__ */ new Date();
|
|
34
|
-
}
|
|
35
|
-
function functions_default({ functions }, more = {}) {
|
|
36
|
-
functions.register("now", now);
|
|
37
|
-
for (const [name, fn] of Object.entries(more)) {
|
|
38
|
-
functions.register(name, fn);
|
|
39
|
-
}
|
|
40
|
-
}
|
package/dist/server/index.d.ts
DELETED
|
@@ -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
|
-
export * from './utils';
|
|
10
|
-
export * from './constants';
|
|
11
|
-
export * from './instructions';
|
|
12
|
-
export { Trigger } from './triggers';
|
|
13
|
-
export { default as Processor } from './Processor';
|
|
14
|
-
export { default } from './Plugin';
|
|
15
|
-
export * from './types';
|
package/dist/server/index.js
DELETED
|
@@ -1,60 +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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
-
mod
|
|
36
|
-
));
|
|
37
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
-
var server_exports = {};
|
|
39
|
-
__export(server_exports, {
|
|
40
|
-
Processor: () => import_Processor.default,
|
|
41
|
-
Trigger: () => import_triggers.Trigger,
|
|
42
|
-
default: () => import_Plugin.default
|
|
43
|
-
});
|
|
44
|
-
module.exports = __toCommonJS(server_exports);
|
|
45
|
-
__reExport(server_exports, require("./utils"), module.exports);
|
|
46
|
-
__reExport(server_exports, require("./constants"), module.exports);
|
|
47
|
-
__reExport(server_exports, require("./instructions"), module.exports);
|
|
48
|
-
var import_triggers = require("./triggers");
|
|
49
|
-
var import_Processor = __toESM(require("./Processor"));
|
|
50
|
-
var import_Plugin = __toESM(require("./Plugin"));
|
|
51
|
-
__reExport(server_exports, require("./types"), module.exports);
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {
|
|
54
|
-
Processor,
|
|
55
|
-
Trigger,
|
|
56
|
-
...require("./utils"),
|
|
57
|
-
...require("./constants"),
|
|
58
|
-
...require("./instructions"),
|
|
59
|
-
...require("./types")
|
|
60
|
-
});
|
|
@@ -1,25 +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 { Instruction } from '.';
|
|
10
|
-
import type Processor from '../Processor';
|
|
11
|
-
import type { FlowNodeModel } from '../types';
|
|
12
|
-
export interface CalculationConfig {
|
|
13
|
-
engine?: string;
|
|
14
|
-
expression?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare class CalculationInstruction extends Instruction {
|
|
17
|
-
run(node: FlowNodeModel, prevJob: any, processor: Processor): Promise<{
|
|
18
|
-
result: any;
|
|
19
|
-
status: 1;
|
|
20
|
-
} | {
|
|
21
|
-
result: any;
|
|
22
|
-
status: -2;
|
|
23
|
-
}>;
|
|
24
|
-
}
|
|
25
|
-
export default CalculationInstruction;
|
|
@@ -1,59 +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 CalculationInstruction_exports = {};
|
|
28
|
-
__export(CalculationInstruction_exports, {
|
|
29
|
-
CalculationInstruction: () => CalculationInstruction,
|
|
30
|
-
default: () => CalculationInstruction_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(CalculationInstruction_exports);
|
|
33
|
-
var import_evaluators = require("@nocobase/evaluators");
|
|
34
|
-
var import__ = require(".");
|
|
35
|
-
var import_constants = require("../constants");
|
|
36
|
-
class CalculationInstruction extends import__.Instruction {
|
|
37
|
-
async run(node, prevJob, processor) {
|
|
38
|
-
const { engine = "math.js", expression = "" } = node.config;
|
|
39
|
-
const scope = processor.getScope(node.id);
|
|
40
|
-
const evaluator = import_evaluators.evaluators.get(engine);
|
|
41
|
-
try {
|
|
42
|
-
const result = evaluator && expression ? evaluator(expression, scope) : null;
|
|
43
|
-
return {
|
|
44
|
-
result,
|
|
45
|
-
status: import_constants.JOB_STATUS.RESOLVED
|
|
46
|
-
};
|
|
47
|
-
} catch (e) {
|
|
48
|
-
return {
|
|
49
|
-
result: e.toString(),
|
|
50
|
-
status: import_constants.JOB_STATUS.ERROR
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
var CalculationInstruction_default = CalculationInstruction;
|
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
-
0 && (module.exports = {
|
|
58
|
-
CalculationInstruction
|
|
59
|
-
});
|
|
@@ -1,36 +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 { Registry } from '@nocobase/utils';
|
|
10
|
-
import { Instruction } from '.';
|
|
11
|
-
import type Processor from '../Processor';
|
|
12
|
-
import type { FlowNodeModel, JobModel } from '../types';
|
|
13
|
-
type Comparer = (a: any, b: any) => boolean;
|
|
14
|
-
export declare const BRANCH_INDEX: {
|
|
15
|
-
readonly DEFAULT: any;
|
|
16
|
-
readonly ON_TRUE: 1;
|
|
17
|
-
readonly ON_FALSE: 0;
|
|
18
|
-
};
|
|
19
|
-
export declare const calculators: Registry<Comparer>;
|
|
20
|
-
export declare class ConditionInstruction extends Instruction {
|
|
21
|
-
run(node: FlowNodeModel, prevJob: any, processor: Processor): Promise<{
|
|
22
|
-
status: 1;
|
|
23
|
-
result: boolean;
|
|
24
|
-
nodeId: number;
|
|
25
|
-
nodeKey: any;
|
|
26
|
-
upstreamId: any;
|
|
27
|
-
} | {
|
|
28
|
-
result: any;
|
|
29
|
-
status: -2;
|
|
30
|
-
} | {
|
|
31
|
-
status: -1;
|
|
32
|
-
result: boolean;
|
|
33
|
-
}>;
|
|
34
|
-
resume(node: FlowNodeModel, branchJob: JobModel, processor: Processor): Promise<any>;
|
|
35
|
-
}
|
|
36
|
-
export default ConditionInstruction;
|
|
@@ -1,167 +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 ConditionInstruction_exports = {};
|
|
28
|
-
__export(ConditionInstruction_exports, {
|
|
29
|
-
BRANCH_INDEX: () => BRANCH_INDEX,
|
|
30
|
-
ConditionInstruction: () => ConditionInstruction,
|
|
31
|
-
calculators: () => calculators,
|
|
32
|
-
default: () => ConditionInstruction_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(ConditionInstruction_exports);
|
|
35
|
-
var import_evaluators = require("@nocobase/evaluators");
|
|
36
|
-
var import_utils = require("@nocobase/utils");
|
|
37
|
-
var import__ = require(".");
|
|
38
|
-
var import_constants = require("../constants");
|
|
39
|
-
const BRANCH_INDEX = {
|
|
40
|
-
DEFAULT: null,
|
|
41
|
-
ON_TRUE: 1,
|
|
42
|
-
ON_FALSE: 0
|
|
43
|
-
};
|
|
44
|
-
const calculators = new import_utils.Registry();
|
|
45
|
-
function equal(a, b) {
|
|
46
|
-
return a == b;
|
|
47
|
-
}
|
|
48
|
-
function notEqual(a, b) {
|
|
49
|
-
return a != b;
|
|
50
|
-
}
|
|
51
|
-
function gt(a, b) {
|
|
52
|
-
return a > b;
|
|
53
|
-
}
|
|
54
|
-
function gte(a, b) {
|
|
55
|
-
return a >= b;
|
|
56
|
-
}
|
|
57
|
-
function lt(a, b) {
|
|
58
|
-
return a < b;
|
|
59
|
-
}
|
|
60
|
-
function lte(a, b) {
|
|
61
|
-
return a <= b;
|
|
62
|
-
}
|
|
63
|
-
calculators.register("equal", equal);
|
|
64
|
-
calculators.register("notEqual", notEqual);
|
|
65
|
-
calculators.register("gt", gt);
|
|
66
|
-
calculators.register("gte", gte);
|
|
67
|
-
calculators.register("lt", lt);
|
|
68
|
-
calculators.register("lte", lte);
|
|
69
|
-
calculators.register("==", equal);
|
|
70
|
-
calculators.register("!=", notEqual);
|
|
71
|
-
calculators.register(">", gt);
|
|
72
|
-
calculators.register(">=", gte);
|
|
73
|
-
calculators.register("<", lt);
|
|
74
|
-
calculators.register("<=", lte);
|
|
75
|
-
function includes(a, b) {
|
|
76
|
-
return a.includes(b);
|
|
77
|
-
}
|
|
78
|
-
function notIncludes(a, b) {
|
|
79
|
-
return !a.includes(b);
|
|
80
|
-
}
|
|
81
|
-
function startsWith(a, b) {
|
|
82
|
-
return a.startsWith(b);
|
|
83
|
-
}
|
|
84
|
-
function notStartsWith(a, b) {
|
|
85
|
-
return !a.startsWith(b);
|
|
86
|
-
}
|
|
87
|
-
function endsWith(a, b) {
|
|
88
|
-
return a.endsWith(b);
|
|
89
|
-
}
|
|
90
|
-
function notEndsWith(a, b) {
|
|
91
|
-
return !a.endsWith(b);
|
|
92
|
-
}
|
|
93
|
-
calculators.register("includes", includes);
|
|
94
|
-
calculators.register("notIncludes", notIncludes);
|
|
95
|
-
calculators.register("startsWith", startsWith);
|
|
96
|
-
calculators.register("notStartsWith", notStartsWith);
|
|
97
|
-
calculators.register("endsWith", endsWith);
|
|
98
|
-
calculators.register("notEndsWith", notEndsWith);
|
|
99
|
-
function calculate(calculation = {}) {
|
|
100
|
-
let fn;
|
|
101
|
-
if (!(calculation.calculator && (fn = calculators.get(calculation.calculator)))) {
|
|
102
|
-
throw new Error(`no calculator function registered for "${calculation.calculator}"`);
|
|
103
|
-
}
|
|
104
|
-
return Boolean(fn(...calculation.operands ?? []));
|
|
105
|
-
}
|
|
106
|
-
function logicCalculate(calculation) {
|
|
107
|
-
if (!calculation) {
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
if (typeof calculation["group"] === "object") {
|
|
111
|
-
const method = calculation["group"].type === "and" ? "every" : "some";
|
|
112
|
-
return (calculation["group"].calculations ?? [])[method]((item) => logicCalculate(item));
|
|
113
|
-
}
|
|
114
|
-
return calculate(calculation);
|
|
115
|
-
}
|
|
116
|
-
class ConditionInstruction extends import__.Instruction {
|
|
117
|
-
async run(node, prevJob, processor) {
|
|
118
|
-
const { engine, calculation, expression, rejectOnFalse } = node.config || {};
|
|
119
|
-
const evaluator = import_evaluators.evaluators.get(engine);
|
|
120
|
-
let result = true;
|
|
121
|
-
try {
|
|
122
|
-
result = evaluator ? evaluator(expression, processor.getScope(node.id)) : logicCalculate(processor.getParsedValue(calculation, node.id));
|
|
123
|
-
} catch (e) {
|
|
124
|
-
return {
|
|
125
|
-
result: e.toString(),
|
|
126
|
-
status: import_constants.JOB_STATUS.ERROR
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
if (!result && rejectOnFalse) {
|
|
130
|
-
return {
|
|
131
|
-
status: import_constants.JOB_STATUS.FAILED,
|
|
132
|
-
result
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
const job = {
|
|
136
|
-
status: import_constants.JOB_STATUS.RESOLVED,
|
|
137
|
-
result,
|
|
138
|
-
// TODO(optimize): try unify the building of job
|
|
139
|
-
nodeId: node.id,
|
|
140
|
-
nodeKey: node.key,
|
|
141
|
-
upstreamId: prevJob && prevJob.id || null
|
|
142
|
-
};
|
|
143
|
-
const branchNode = processor.nodes.find(
|
|
144
|
-
(item) => item.upstreamId === node.id && item.branchIndex != null && Boolean(item.branchIndex) === result
|
|
145
|
-
);
|
|
146
|
-
if (!branchNode) {
|
|
147
|
-
return job;
|
|
148
|
-
}
|
|
149
|
-
const savedJob = await processor.saveJob(job);
|
|
150
|
-
await processor.run(branchNode, savedJob);
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
async resume(node, branchJob, processor) {
|
|
154
|
-
const job = processor.findBranchParentJob(branchJob, node);
|
|
155
|
-
if (branchJob.status === import_constants.JOB_STATUS.RESOLVED) {
|
|
156
|
-
return job;
|
|
157
|
-
}
|
|
158
|
-
return processor.exit(branchJob.status);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
var ConditionInstruction_default = ConditionInstruction;
|
|
162
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
163
|
-
0 && (module.exports = {
|
|
164
|
-
BRANCH_INDEX,
|
|
165
|
-
ConditionInstruction,
|
|
166
|
-
calculators
|
|
167
|
-
});
|
|
@@ -1,18 +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 type Processor from '../Processor';
|
|
10
|
-
import type { FlowNodeModel } from '../types';
|
|
11
|
-
import { Instruction } from '.';
|
|
12
|
-
export declare class CreateInstruction extends Instruction {
|
|
13
|
-
run(node: FlowNodeModel, input: any, processor: Processor): Promise<{
|
|
14
|
-
result: any;
|
|
15
|
-
status: 1;
|
|
16
|
-
}>;
|
|
17
|
-
}
|
|
18
|
-
export default CreateInstruction;
|