@nocobase/plugin-workflow 2.1.0-alpha.4 → 2.1.0-alpha.45
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/LICENSE +201 -661
- package/README.md +79 -10
- package/dist/client/214.7e602cfe7a8251b8.js +10 -0
- package/dist/client/618.19af7f84261c815d.js +10 -0
- package/dist/client/67.452743ce8ec30617.js +10 -0
- package/dist/client/964.ffbf5b47ed12bbdc.js +10 -0
- package/dist/client/Branch.d.ts +7 -3
- package/dist/client/BranchContext.d.ts +18 -0
- package/dist/client/components/TimeoutInput.d.ts +11 -0
- package/dist/client/constants.d.ts +13 -0
- package/dist/client/flows/triggerWorkflows.d.ts +14 -1
- package/dist/client/hooks/{useWorkflowFilterActionProps.d.ts → useResourceFilterActionProps.d.ts} +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/nodes/create.d.ts +10 -0
- package/dist/client/nodes/destroy.d.ts +10 -0
- package/dist/client/nodes/index.d.ts +5 -0
- package/dist/client/nodes/query.d.ts +18 -2
- package/dist/client/nodes/update.d.ts +10 -0
- package/dist/client/schemas/collection.d.ts +8 -2
- package/dist/client/schemas/executions.d.ts +62 -2
- package/dist/client/triggers/collection.d.ts +14 -1
- package/dist/client/triggers/index.d.ts +4 -0
- package/dist/client/triggers/schedule/constants.d.ts +4 -0
- package/dist/client/triggers/schedule/index.d.ts +15 -0
- package/dist/client/utils.d.ts +17 -0
- package/dist/common/collections/executions.d.ts +43 -1
- package/dist/common/collections/executions.js +62 -1
- package/dist/common/collections/jobs.js +7 -0
- package/dist/common/collections/workflows.d.ts +65 -11
- package/dist/common/collections/workflows.js +34 -2
- package/dist/common/constants.d.ts +5 -0
- package/dist/common/constants.js +7 -0
- package/dist/externalVersion.js +15 -13
- package/dist/locale/de-DE.json +4 -0
- package/dist/locale/en-US.json +7 -0
- package/dist/locale/es-ES.json +4 -0
- package/dist/locale/fr-FR.json +4 -0
- package/dist/locale/hu-HU.json +7 -3
- package/dist/locale/id-ID.json +4 -0
- package/dist/locale/it-IT.json +4 -0
- package/dist/locale/ja-JP.json +5 -1
- package/dist/locale/ko-KR.json +4 -0
- package/dist/locale/nl-NL.json +7 -3
- package/dist/locale/pt-BR.json +4 -0
- package/dist/locale/ru-RU.json +4 -0
- package/dist/locale/tr-TR.json +4 -0
- package/dist/locale/uk-UA.json +7 -3
- package/dist/locale/vi-VN.json +7 -3
- package/dist/locale/zh-CN.json +12 -1
- package/dist/locale/zh-TW.json +7 -3
- package/dist/node_modules/cron-parser/lib/parser.js +1 -1
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/node_modules/joi/dist/joi-browser.min.js +1 -0
- package/dist/node_modules/joi/lib/annotate.js +175 -0
- package/dist/node_modules/joi/lib/base.js +1069 -0
- package/dist/node_modules/joi/lib/cache.js +143 -0
- package/dist/node_modules/joi/lib/common.js +216 -0
- package/dist/node_modules/joi/lib/compile.js +283 -0
- package/dist/node_modules/joi/lib/errors.js +271 -0
- package/dist/node_modules/joi/lib/extend.js +312 -0
- package/dist/node_modules/joi/lib/index.d.ts +2365 -0
- package/dist/node_modules/joi/lib/index.js +1 -0
- package/dist/node_modules/joi/lib/manifest.js +476 -0
- package/dist/node_modules/joi/lib/messages.js +178 -0
- package/dist/node_modules/joi/lib/modify.js +267 -0
- package/dist/node_modules/joi/lib/ref.js +414 -0
- package/dist/node_modules/joi/lib/schemas.js +302 -0
- package/dist/node_modules/joi/lib/state.js +166 -0
- package/dist/node_modules/joi/lib/template.js +463 -0
- package/dist/node_modules/joi/lib/trace.js +346 -0
- package/dist/node_modules/joi/lib/types/alternatives.js +364 -0
- package/dist/node_modules/joi/lib/types/any.js +174 -0
- package/dist/node_modules/joi/lib/types/array.js +809 -0
- package/dist/node_modules/joi/lib/types/binary.js +100 -0
- package/dist/node_modules/joi/lib/types/boolean.js +150 -0
- package/dist/node_modules/joi/lib/types/date.js +233 -0
- package/dist/node_modules/joi/lib/types/function.js +93 -0
- package/dist/node_modules/joi/lib/types/keys.js +1067 -0
- package/dist/node_modules/joi/lib/types/link.js +168 -0
- package/dist/node_modules/joi/lib/types/number.js +363 -0
- package/dist/node_modules/joi/lib/types/object.js +22 -0
- package/dist/node_modules/joi/lib/types/string.js +850 -0
- package/dist/node_modules/joi/lib/types/symbol.js +102 -0
- package/dist/node_modules/joi/lib/validator.js +750 -0
- package/dist/node_modules/joi/lib/values.js +263 -0
- package/dist/node_modules/joi/node_modules/@hapi/topo/lib/index.d.ts +60 -0
- package/dist/node_modules/joi/node_modules/@hapi/topo/lib/index.js +225 -0
- package/dist/node_modules/joi/node_modules/@hapi/topo/package.json +30 -0
- package/dist/node_modules/joi/package.json +1 -0
- package/dist/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +5 -0
- package/dist/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +10 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.d.ts +1381 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.js +1692 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +1 -0
- package/dist/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +5 -0
- package/dist/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +4 -0
- package/dist/node_modules/lru-cache/dist/esm/browser/index.d.ts +1381 -0
- package/dist/node_modules/lru-cache/dist/{mjs → esm/browser}/index.js +537 -179
- package/dist/node_modules/lru-cache/dist/esm/browser/index.min.js +2 -0
- package/dist/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts +5 -0
- package/dist/node_modules/lru-cache/dist/esm/diagnostics-channel.js +19 -0
- package/dist/node_modules/lru-cache/dist/esm/index.d.ts +1381 -0
- package/dist/node_modules/lru-cache/dist/{cjs → esm}/index.js +538 -184
- package/dist/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- package/dist/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +5 -0
- package/dist/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +7 -0
- package/dist/node_modules/lru-cache/dist/esm/node/index.d.ts +1381 -0
- package/dist/node_modules/lru-cache/dist/esm/node/index.js +1688 -0
- package/dist/node_modules/lru-cache/dist/esm/node/index.min.js +2 -0
- package/dist/node_modules/lru-cache/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/nodejs_snowflake.js +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/server/Dispatcher.d.ts +9 -6
- package/dist/server/Dispatcher.js +241 -160
- package/dist/server/ExecutionTimeoutManager.d.ts +45 -0
- package/dist/server/ExecutionTimeoutManager.js +312 -0
- package/dist/server/Plugin.d.ts +13 -0
- package/dist/server/Plugin.js +49 -4
- package/dist/server/Processor.d.ts +65 -9
- package/dist/server/Processor.js +285 -33
- package/dist/server/RunningExecutionRegistry.d.ts +18 -0
- package/dist/server/RunningExecutionRegistry.js +48 -0
- package/dist/server/actions/executions.d.ts +4 -3
- package/dist/server/actions/executions.js +42 -21
- package/dist/server/actions/jobs.d.ts +2 -1
- package/dist/server/actions/jobs.js +28 -1
- package/dist/server/actions/nodes.d.ts +5 -0
- package/dist/server/actions/nodes.js +38 -5
- package/dist/server/actions/workflows.d.ts +6 -0
- package/dist/server/actions/workflows.js +38 -0
- package/dist/server/constants.d.ts +2 -0
- package/dist/server/constants.js +3 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +2 -0
- package/dist/server/instructions/ConditionInstruction.d.ts +2 -0
- package/dist/server/instructions/ConditionInstruction.js +17 -0
- package/dist/server/instructions/CreateInstruction.d.ts +3 -0
- package/dist/server/instructions/CreateInstruction.js +25 -0
- package/dist/server/instructions/DestroyInstruction.d.ts +3 -0
- package/dist/server/instructions/DestroyInstruction.js +25 -0
- package/dist/server/instructions/EndInstruction.d.ts +2 -0
- package/dist/server/instructions/EndInstruction.js +4 -0
- package/dist/server/instructions/MultiConditionsInstruction.d.ts +2 -0
- package/dist/server/instructions/MultiConditionsInstruction.js +23 -0
- package/dist/server/instructions/OutputInstruction.d.ts +2 -0
- package/dist/server/instructions/OutputInstruction.js +14 -0
- package/dist/server/instructions/QueryInstruction.d.ts +3 -0
- package/dist/server/instructions/QueryInstruction.js +32 -7
- package/dist/server/instructions/UpdateInstruction.d.ts +3 -0
- package/dist/server/instructions/UpdateInstruction.js +27 -0
- package/dist/server/instructions/index.d.ts +24 -4
- package/dist/server/instructions/index.js +18 -0
- package/dist/server/migrations/20260423225800-fill-workflow-created-updated-by.d.ts +13 -0
- package/dist/server/migrations/20260423225800-fill-workflow-created-updated-by.js +57 -0
- package/dist/server/migrations/20260501120000-workflow-timeout.d.ts +13 -0
- package/dist/server/migrations/20260501120000-workflow-timeout.js +63 -0
- package/dist/server/timeout-errors.d.ts +13 -0
- package/dist/server/timeout-errors.js +47 -0
- package/dist/server/triggers/CollectionTrigger.d.ts +3 -0
- package/dist/server/triggers/CollectionTrigger.js +28 -0
- package/dist/server/triggers/ScheduleTrigger/index.d.ts +3 -0
- package/dist/server/triggers/ScheduleTrigger/index.js +18 -3
- package/dist/server/triggers/index.d.ts +3 -0
- package/dist/server/triggers/index.js +18 -0
- package/dist/server/types/Execution.d.ts +6 -0
- package/dist/server/types/Job.d.ts +3 -3
- package/dist/server/types/Workflow.d.ts +6 -1
- package/dist/server/utils.d.ts +27 -0
- package/dist/server/utils.js +138 -2
- package/dist/swagger/index.d.ts +849 -106
- package/dist/swagger/index.js +969 -208
- package/package.json +6 -5
- package/dist/client/27bd65abee87cafa.js +0 -10
- package/dist/client/478692c1637f2742.js +0 -10
- package/dist/client/c1347b9d21f864d9.js +0 -10
- package/dist/client/f39e94207f92e352.js +0 -10
- 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.min.js +0 -2
- package/dist/node_modules/lru-cache/dist/mjs/index.d.ts +0 -807
- package/dist/node_modules/lru-cache/dist/mjs/index.min.js +0 -2
- /package/dist/node_modules/lru-cache/dist/{cjs → commonjs}/package.json +0 -0
- /package/dist/node_modules/lru-cache/dist/{mjs → esm}/package.json +0 -0
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { Context } from '@nocobase/actions';
|
|
10
|
+
export declare class NodeValidationError extends Error {
|
|
11
|
+
status: number;
|
|
12
|
+
errors: Record<string, string>;
|
|
13
|
+
constructor(errors: Record<string, string>);
|
|
14
|
+
}
|
|
10
15
|
export declare function create(context: Context, next: any): Promise<void>;
|
|
11
16
|
export declare function duplicate(context: Context, next: any): Promise<void>;
|
|
12
17
|
export declare function destroy(context: Context, next: any): Promise<void>;
|
|
@@ -36,6 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
37
|
var nodes_exports = {};
|
|
38
38
|
__export(nodes_exports, {
|
|
39
|
+
NodeValidationError: () => NodeValidationError,
|
|
39
40
|
create: () => create,
|
|
40
41
|
destroy: () => destroy,
|
|
41
42
|
destroyBranch: () => destroyBranch,
|
|
@@ -48,6 +49,35 @@ module.exports = __toCommonJS(nodes_exports);
|
|
|
48
49
|
var import_actions = require("@nocobase/actions");
|
|
49
50
|
var import_database = require("@nocobase/database");
|
|
50
51
|
var import__ = __toESM(require(".."));
|
|
52
|
+
class NodeValidationError extends Error {
|
|
53
|
+
status = 400;
|
|
54
|
+
errors;
|
|
55
|
+
constructor(errors) {
|
|
56
|
+
super("Node validation failed");
|
|
57
|
+
this.name = "NodeValidationError";
|
|
58
|
+
this.errors = errors;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function validateNode(context, workflow, values) {
|
|
62
|
+
const { type, config } = values;
|
|
63
|
+
if (!type) {
|
|
64
|
+
context.throw(400, "Node type is required");
|
|
65
|
+
}
|
|
66
|
+
const workflowPlugin = context.app.pm.get(import__.default);
|
|
67
|
+
const instruction = workflowPlugin.instructions.get(type);
|
|
68
|
+
if (!instruction) {
|
|
69
|
+
context.throw(400, `Node type "${type}" is not registered`);
|
|
70
|
+
}
|
|
71
|
+
if (workflow && typeof instruction.isAvailable === "function" && !instruction.isAvailable(workflow, values)) {
|
|
72
|
+
context.throw(400, `Node type "${type}" is not available in the current workflow`);
|
|
73
|
+
}
|
|
74
|
+
if (config && typeof instruction.validateConfig === "function") {
|
|
75
|
+
const errors = instruction.validateConfig(config);
|
|
76
|
+
if (errors) {
|
|
77
|
+
throw new NodeValidationError(errors);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
51
81
|
async function create(context, next) {
|
|
52
82
|
const { db } = context;
|
|
53
83
|
const repository = import_actions.utils.getRepositoryFromParams(context);
|
|
@@ -61,6 +91,7 @@ async function create(context, next) {
|
|
|
61
91
|
if (workflow.versionStats.executed > 0) {
|
|
62
92
|
context.throw(400, "Node could not be created in executed workflow");
|
|
63
93
|
}
|
|
94
|
+
validateNode(context, workflow, values);
|
|
64
95
|
const NODES_LIMIT = process.env.WORKFLOW_NODES_LIMIT ? parseInt(process.env.WORKFLOW_NODES_LIMIT, 10) : null;
|
|
65
96
|
if (NODES_LIMIT) {
|
|
66
97
|
const nodesCount = await workflow.countNodes({ transaction });
|
|
@@ -617,15 +648,18 @@ async function update(context, next) {
|
|
|
617
648
|
const { db } = context;
|
|
618
649
|
const repository = import_actions.utils.getRepositoryFromParams(context);
|
|
619
650
|
const { filterByTk, values, whitelist, blacklist, filter, updateAssociationValues } = context.action.params;
|
|
651
|
+
const workflowPlugin = context.app.pm.get(import__.default);
|
|
620
652
|
context.body = await db.sequelize.transaction(async (transaction) => {
|
|
621
|
-
const
|
|
653
|
+
const instance = await repository.findOne({
|
|
622
654
|
filterByTk,
|
|
623
655
|
appends: ["workflow.versionStats.executed"],
|
|
624
656
|
transaction
|
|
625
657
|
});
|
|
626
|
-
if (workflow.versionStats.executed > 0) {
|
|
658
|
+
if (instance.workflow.versionStats.executed > 0) {
|
|
627
659
|
context.throw(400, "Nodes in executed workflow could not be reconfigured");
|
|
628
660
|
}
|
|
661
|
+
const merged = Object.assign({}, instance.get(), values);
|
|
662
|
+
validateNode(context, null, merged);
|
|
629
663
|
return repository.update({
|
|
630
664
|
filterByTk,
|
|
631
665
|
values,
|
|
@@ -644,12 +678,10 @@ async function test(context, next) {
|
|
|
644
678
|
const { type, config = {} } = values;
|
|
645
679
|
const plugin = context.app.pm.get(import__.default);
|
|
646
680
|
const instruction = plugin.instructions.get(type);
|
|
647
|
-
if (!instruction) {
|
|
648
|
-
context.throw(400, `instruction "${type}" not registered`);
|
|
649
|
-
}
|
|
650
681
|
if (typeof instruction.test !== "function") {
|
|
651
682
|
context.throw(400, `test method of instruction "${type}" not implemented`);
|
|
652
683
|
}
|
|
684
|
+
validateNode(context, null, values);
|
|
653
685
|
try {
|
|
654
686
|
context.body = await instruction.test(config);
|
|
655
687
|
} catch (error) {
|
|
@@ -659,6 +691,7 @@ async function test(context, next) {
|
|
|
659
691
|
}
|
|
660
692
|
// Annotate the CommonJS export names for ESM import in node:
|
|
661
693
|
0 && (module.exports = {
|
|
694
|
+
NodeValidationError,
|
|
662
695
|
create,
|
|
663
696
|
destroy,
|
|
664
697
|
destroyBranch,
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { Context } from '@nocobase/actions';
|
|
10
|
+
export declare class WorkflowValidationError extends Error {
|
|
11
|
+
status: number;
|
|
12
|
+
errors: Record<string, string>;
|
|
13
|
+
constructor(errors: Record<string, string>);
|
|
14
|
+
}
|
|
15
|
+
export declare function create(context: Context, next: any): Promise<void>;
|
|
10
16
|
export declare function update(context: Context, next: any): Promise<void>;
|
|
11
17
|
export declare function destroy(context: Context, next: any): Promise<void>;
|
|
12
18
|
export declare function revision(context: Context, next: any): Promise<void>;
|
|
@@ -36,6 +36,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
37
|
var workflows_exports = {};
|
|
38
38
|
__export(workflows_exports, {
|
|
39
|
+
WorkflowValidationError: () => WorkflowValidationError,
|
|
40
|
+
create: () => create,
|
|
39
41
|
destroy: () => destroy,
|
|
40
42
|
execute: () => execute,
|
|
41
43
|
revision: () => revision,
|
|
@@ -46,7 +48,38 @@ module.exports = __toCommonJS(workflows_exports);
|
|
|
46
48
|
var import_actions = __toESM(require("@nocobase/actions"));
|
|
47
49
|
var import_database = require("@nocobase/database");
|
|
48
50
|
var import_Plugin = __toESM(require("../Plugin"));
|
|
51
|
+
class WorkflowValidationError extends Error {
|
|
52
|
+
status = 400;
|
|
53
|
+
errors;
|
|
54
|
+
constructor(errors) {
|
|
55
|
+
super("Workflow validation failed");
|
|
56
|
+
this.name = "WorkflowValidationError";
|
|
57
|
+
this.errors = errors;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function validateWorkflow(context, plugin, { type, config }) {
|
|
61
|
+
if (!type) {
|
|
62
|
+
context.throw(400, "Trigger type is required");
|
|
63
|
+
}
|
|
64
|
+
const trigger = plugin.triggers.get(type);
|
|
65
|
+
if (!trigger) {
|
|
66
|
+
context.throw(400, `Trigger type "${type}" is not registered`);
|
|
67
|
+
}
|
|
68
|
+
if (config && typeof trigger.validateConfig === "function") {
|
|
69
|
+
const errors = trigger.validateConfig(config);
|
|
70
|
+
if (errors) {
|
|
71
|
+
throw new WorkflowValidationError(errors);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function create(context, next) {
|
|
76
|
+
const plugin = context.app.pm.get(import_Plugin.default);
|
|
77
|
+
const { values } = context.action.params;
|
|
78
|
+
validateWorkflow(context, plugin, values);
|
|
79
|
+
return import_actions.default.create(context, next);
|
|
80
|
+
}
|
|
49
81
|
async function update(context, next) {
|
|
82
|
+
const plugin = context.app.pm.get(import_Plugin.default);
|
|
50
83
|
const repository = import_actions.utils.getRepositoryFromParams(context);
|
|
51
84
|
const { filterByTk, values } = context.action.params;
|
|
52
85
|
context.action.mergeParams({
|
|
@@ -60,6 +93,9 @@ async function update(context, next) {
|
|
|
60
93
|
if (workflow.versionStats.executed > 0) {
|
|
61
94
|
return context.throw(400, "config of executed workflow can not be updated");
|
|
62
95
|
}
|
|
96
|
+
const type = values.type ?? workflow.type;
|
|
97
|
+
const config = values.config ?? workflow.config;
|
|
98
|
+
validateWorkflow(context, plugin, { type, config });
|
|
63
99
|
}
|
|
64
100
|
return import_actions.default.update(context, next);
|
|
65
101
|
}
|
|
@@ -180,6 +216,8 @@ async function execute(context, next) {
|
|
|
180
216
|
}
|
|
181
217
|
// Annotate the CommonJS export names for ESM import in node:
|
|
182
218
|
0 && (module.exports = {
|
|
219
|
+
WorkflowValidationError,
|
|
220
|
+
create,
|
|
183
221
|
destroy,
|
|
184
222
|
execute,
|
|
185
223
|
revision,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import { EXECUTION_REASON } from '../common/constants';
|
|
9
10
|
export declare const EXECUTION_STATUS: {
|
|
10
11
|
readonly QUEUEING: any;
|
|
11
12
|
readonly STARTED: 0;
|
|
@@ -17,6 +18,7 @@ export declare const EXECUTION_STATUS: {
|
|
|
17
18
|
readonly REJECTED: -5;
|
|
18
19
|
readonly RETRY_NEEDED: -6;
|
|
19
20
|
};
|
|
21
|
+
export { EXECUTION_REASON };
|
|
20
22
|
export declare const JOB_STATUS: {
|
|
21
23
|
readonly PENDING: 0;
|
|
22
24
|
readonly RESOLVED: 1;
|
package/dist/server/constants.js
CHANGED
|
@@ -26,10 +26,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
26
26
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
27
|
var constants_exports = {};
|
|
28
28
|
__export(constants_exports, {
|
|
29
|
+
EXECUTION_REASON: () => import_constants.EXECUTION_REASON,
|
|
29
30
|
EXECUTION_STATUS: () => EXECUTION_STATUS,
|
|
30
31
|
JOB_STATUS: () => JOB_STATUS
|
|
31
32
|
});
|
|
32
33
|
module.exports = __toCommonJS(constants_exports);
|
|
34
|
+
var import_constants = require("../common/constants");
|
|
33
35
|
const EXECUTION_STATUS = {
|
|
34
36
|
QUEUEING: null,
|
|
35
37
|
STARTED: 0,
|
|
@@ -53,6 +55,7 @@ const JOB_STATUS = {
|
|
|
53
55
|
};
|
|
54
56
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55
57
|
0 && (module.exports = {
|
|
58
|
+
EXECUTION_REASON,
|
|
56
59
|
EXECUTION_STATUS,
|
|
57
60
|
JOB_STATUS
|
|
58
61
|
});
|
package/dist/server/index.d.ts
CHANGED
|
@@ -11,8 +11,10 @@ export * from './constants';
|
|
|
11
11
|
export * from './instructions';
|
|
12
12
|
export * from './functions';
|
|
13
13
|
export * from './logicCalculate';
|
|
14
|
+
export * from './timeout-errors';
|
|
14
15
|
export { Trigger } from './triggers';
|
|
15
16
|
export type { EventOptions } from './Dispatcher';
|
|
16
17
|
export { default as Processor } from './Processor';
|
|
18
|
+
export type { BackgroundAbortHandle, ProcessorOptions } from './Processor';
|
|
17
19
|
export { default } from './Plugin';
|
|
18
20
|
export * from './types';
|
package/dist/server/index.js
CHANGED
|
@@ -47,6 +47,7 @@ __reExport(server_exports, require("./constants"), module.exports);
|
|
|
47
47
|
__reExport(server_exports, require("./instructions"), module.exports);
|
|
48
48
|
__reExport(server_exports, require("./functions"), module.exports);
|
|
49
49
|
__reExport(server_exports, require("./logicCalculate"), module.exports);
|
|
50
|
+
__reExport(server_exports, require("./timeout-errors"), module.exports);
|
|
50
51
|
var import_triggers = require("./triggers");
|
|
51
52
|
var import_Processor = __toESM(require("./Processor"));
|
|
52
53
|
var import_Plugin = __toESM(require("./Plugin"));
|
|
@@ -60,5 +61,6 @@ __reExport(server_exports, require("./types"), module.exports);
|
|
|
60
61
|
...require("./instructions"),
|
|
61
62
|
...require("./functions"),
|
|
62
63
|
...require("./logicCalculate"),
|
|
64
|
+
...require("./timeout-errors"),
|
|
63
65
|
...require("./types")
|
|
64
66
|
});
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import Joi from 'joi';
|
|
9
10
|
import { Instruction } from '.';
|
|
10
11
|
import type Processor from '../Processor';
|
|
11
12
|
import type { FlowNodeModel, JobModel } from '../types';
|
|
@@ -15,6 +16,7 @@ export declare const BRANCH_INDEX: {
|
|
|
15
16
|
readonly ON_FALSE: 0;
|
|
16
17
|
};
|
|
17
18
|
export declare class ConditionInstruction extends Instruction {
|
|
19
|
+
configSchema: Joi.ObjectSchema<any>;
|
|
18
20
|
run(node: FlowNodeModel, prevJob: any, processor: Processor): Promise<{
|
|
19
21
|
status: 1;
|
|
20
22
|
result: boolean;
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
var __create = Object.create;
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
13
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
15
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
16
|
var __export = (target, all) => {
|
|
15
17
|
for (var name in all)
|
|
@@ -23,6 +25,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
25
|
}
|
|
24
26
|
return to;
|
|
25
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
|
+
));
|
|
26
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
37
|
var ConditionInstruction_exports = {};
|
|
28
38
|
__export(ConditionInstruction_exports, {
|
|
@@ -31,6 +41,7 @@ __export(ConditionInstruction_exports, {
|
|
|
31
41
|
default: () => ConditionInstruction_default
|
|
32
42
|
});
|
|
33
43
|
module.exports = __toCommonJS(ConditionInstruction_exports);
|
|
44
|
+
var import_joi = __toESM(require("joi"));
|
|
34
45
|
var import_evaluators = require("@nocobase/evaluators");
|
|
35
46
|
var import__ = require(".");
|
|
36
47
|
var import_constants = require("../constants");
|
|
@@ -41,6 +52,12 @@ const BRANCH_INDEX = {
|
|
|
41
52
|
ON_FALSE: 0
|
|
42
53
|
};
|
|
43
54
|
class ConditionInstruction extends import__.Instruction {
|
|
55
|
+
configSchema = import_joi.default.object({
|
|
56
|
+
rejectOnFalse: import_joi.default.boolean().required(),
|
|
57
|
+
engine: import_joi.default.string().valid("basic", "math.js", "formula.js"),
|
|
58
|
+
calculation: import_joi.default.object(),
|
|
59
|
+
expression: import_joi.default.string()
|
|
60
|
+
});
|
|
44
61
|
async run(node, prevJob, processor) {
|
|
45
62
|
const { engine, calculation, expression, rejectOnFalse } = node.config || {};
|
|
46
63
|
const evaluator = import_evaluators.evaluators.get(engine);
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import Joi from 'joi';
|
|
9
10
|
import type Processor from '../Processor';
|
|
10
11
|
import type { FlowNodeModel } from '../types';
|
|
11
12
|
import { Instruction } from '.';
|
|
12
13
|
export declare class CreateInstruction extends Instruction {
|
|
14
|
+
configSchema: Joi.ObjectSchema<any>;
|
|
15
|
+
validateConfig(config: Record<string, any>): Record<string, string>;
|
|
13
16
|
run(node: FlowNodeModel, input: any, processor: Processor): Promise<{
|
|
14
17
|
result: any;
|
|
15
18
|
status: 1;
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
var __create = Object.create;
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
13
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
15
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
16
|
var __export = (target, all) => {
|
|
15
17
|
for (var name in all)
|
|
@@ -23,6 +25,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
25
|
}
|
|
24
26
|
return to;
|
|
25
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
|
+
));
|
|
26
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
37
|
var CreateInstruction_exports = {};
|
|
28
38
|
__export(CreateInstruction_exports, {
|
|
@@ -30,11 +40,26 @@ __export(CreateInstruction_exports, {
|
|
|
30
40
|
default: () => CreateInstruction_default
|
|
31
41
|
});
|
|
32
42
|
module.exports = __toCommonJS(CreateInstruction_exports);
|
|
43
|
+
var import_joi = __toESM(require("joi"));
|
|
33
44
|
var import_data_source_manager = require("@nocobase/data-source-manager");
|
|
34
45
|
var import_constants = require("../constants");
|
|
35
46
|
var import_utils = require("../utils");
|
|
36
47
|
var import__ = require(".");
|
|
37
48
|
class CreateInstruction extends import__.Instruction {
|
|
49
|
+
configSchema = import_joi.default.object({
|
|
50
|
+
collection: import_joi.default.string().required().messages({ "any.required": "Collection is not configured" }),
|
|
51
|
+
params: import_joi.default.object({
|
|
52
|
+
values: import_joi.default.object(),
|
|
53
|
+
appends: import_joi.default.array().items(import_joi.default.string())
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
validateConfig(config) {
|
|
57
|
+
const errors = super.validateConfig(config);
|
|
58
|
+
if (errors) {
|
|
59
|
+
return errors;
|
|
60
|
+
}
|
|
61
|
+
return (0, import_utils.validateCollectionField)(config.collection, this.workflow.app.dataSourceManager);
|
|
62
|
+
}
|
|
38
63
|
async run(node, input, processor) {
|
|
39
64
|
const { collection, params: { appends = [], ...params } = {} } = node.config;
|
|
40
65
|
const [dataSourceName, collectionName] = (0, import_data_source_manager.parseCollectionName)(collection);
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import Joi from 'joi';
|
|
9
10
|
import { Instruction } from '.';
|
|
10
11
|
import type Processor from '../Processor';
|
|
11
12
|
import type { FlowNodeModel } from '../types';
|
|
12
13
|
export declare class DestroyInstruction extends Instruction {
|
|
14
|
+
configSchema: Joi.ObjectSchema<any>;
|
|
15
|
+
validateConfig(config: Record<string, any>): Record<string, string>;
|
|
13
16
|
run(node: FlowNodeModel, input: any, processor: Processor): Promise<{
|
|
14
17
|
result: any;
|
|
15
18
|
status: 1;
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
var __create = Object.create;
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
13
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
15
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
16
|
var __export = (target, all) => {
|
|
15
17
|
for (var name in all)
|
|
@@ -23,6 +25,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
25
|
}
|
|
24
26
|
return to;
|
|
25
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
|
+
));
|
|
26
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
37
|
var DestroyInstruction_exports = {};
|
|
28
38
|
__export(DestroyInstruction_exports, {
|
|
@@ -30,10 +40,25 @@ __export(DestroyInstruction_exports, {
|
|
|
30
40
|
default: () => DestroyInstruction_default
|
|
31
41
|
});
|
|
32
42
|
module.exports = __toCommonJS(DestroyInstruction_exports);
|
|
43
|
+
var import_joi = __toESM(require("joi"));
|
|
33
44
|
var import_data_source_manager = require("@nocobase/data-source-manager");
|
|
34
45
|
var import__ = require(".");
|
|
35
46
|
var import_constants = require("../constants");
|
|
47
|
+
var import_utils = require("../utils");
|
|
36
48
|
class DestroyInstruction extends import__.Instruction {
|
|
49
|
+
configSchema = import_joi.default.object({
|
|
50
|
+
collection: import_joi.default.string().required().messages({ "any.required": "Collection is not configured" }),
|
|
51
|
+
params: import_joi.default.object({
|
|
52
|
+
filter: import_joi.default.object()
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
validateConfig(config) {
|
|
56
|
+
const errors = super.validateConfig(config);
|
|
57
|
+
if (errors) {
|
|
58
|
+
return errors;
|
|
59
|
+
}
|
|
60
|
+
return (0, import_utils.validateCollectionField)(config.collection, this.workflow.app.dataSourceManager);
|
|
61
|
+
}
|
|
37
62
|
async run(node, input, processor) {
|
|
38
63
|
const { collection, params = {} } = node.config;
|
|
39
64
|
const [dataSourceName, collectionName] = (0, import_data_source_manager.parseCollectionName)(collection);
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import Joi from 'joi';
|
|
9
10
|
import Instruction from '.';
|
|
10
11
|
import Processor from '../Processor';
|
|
11
12
|
import { FlowNodeModel } from '../types';
|
|
12
13
|
export default class extends Instruction {
|
|
14
|
+
configSchema: Joi.ObjectSchema<any>;
|
|
13
15
|
run(node: FlowNodeModel, prevJob: any, processor: Processor): Promise<any>;
|
|
14
16
|
}
|
|
@@ -39,9 +39,13 @@ __export(EndInstruction_exports, {
|
|
|
39
39
|
default: () => EndInstruction_default
|
|
40
40
|
});
|
|
41
41
|
module.exports = __toCommonJS(EndInstruction_exports);
|
|
42
|
+
var import_joi = __toESM(require("joi"));
|
|
42
43
|
var import__ = __toESM(require("."));
|
|
43
44
|
var import_constants = require("../constants");
|
|
44
45
|
class EndInstruction_default extends import__.default {
|
|
46
|
+
configSchema = import_joi.default.object({
|
|
47
|
+
endStatus: import_joi.default.number().valid(import_constants.JOB_STATUS.RESOLVED, import_constants.JOB_STATUS.FAILED)
|
|
48
|
+
});
|
|
45
49
|
async run(node, prevJob, processor) {
|
|
46
50
|
const { endStatus = import_constants.JOB_STATUS.RESOLVED } = node.config;
|
|
47
51
|
processor.saveJob({
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import Joi from 'joi';
|
|
9
10
|
import { Instruction } from '.';
|
|
10
11
|
import type Processor from '../Processor';
|
|
11
12
|
import type { FlowNodeModel, JobModel } from '../types';
|
|
12
13
|
export declare class MultiConditionsInstruction extends Instruction {
|
|
14
|
+
configSchema: Joi.ObjectSchema<any>;
|
|
13
15
|
run(node: FlowNodeModel, prevJob: any, processor: Processor): Promise<JobModel>;
|
|
14
16
|
resume(node: FlowNodeModel, branchJob: JobModel, processor: Processor): Promise<any>;
|
|
15
17
|
private evaluateCondition;
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
var __create = Object.create;
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
13
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
15
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
16
|
var __export = (target, all) => {
|
|
15
17
|
for (var name in all)
|
|
@@ -23,6 +25,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
25
|
}
|
|
24
26
|
return to;
|
|
25
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
|
+
));
|
|
26
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
37
|
var MultiConditionsInstruction_exports = {};
|
|
28
38
|
__export(MultiConditionsInstruction_exports, {
|
|
@@ -30,11 +40,24 @@ __export(MultiConditionsInstruction_exports, {
|
|
|
30
40
|
default: () => MultiConditionsInstruction_default
|
|
31
41
|
});
|
|
32
42
|
module.exports = __toCommonJS(MultiConditionsInstruction_exports);
|
|
43
|
+
var import_joi = __toESM(require("joi"));
|
|
33
44
|
var import_evaluators = require("@nocobase/evaluators");
|
|
34
45
|
var import__ = require(".");
|
|
35
46
|
var import_constants = require("../constants");
|
|
36
47
|
var import_logicCalculate = require("../logicCalculate");
|
|
37
48
|
class MultiConditionsInstruction extends import__.Instruction {
|
|
49
|
+
configSchema = import_joi.default.object({
|
|
50
|
+
conditions: import_joi.default.array().items(
|
|
51
|
+
import_joi.default.object({
|
|
52
|
+
uid: import_joi.default.string(),
|
|
53
|
+
title: import_joi.default.string(),
|
|
54
|
+
engine: import_joi.default.string(),
|
|
55
|
+
calculation: import_joi.default.any(),
|
|
56
|
+
expression: import_joi.default.string()
|
|
57
|
+
})
|
|
58
|
+
),
|
|
59
|
+
continueOnNoMatch: import_joi.default.boolean()
|
|
60
|
+
});
|
|
38
61
|
async run(node, prevJob, processor) {
|
|
39
62
|
const { conditions = [], continueOnNoMatch = false } = node.config || {};
|
|
40
63
|
const meta = { conditions: [] };
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import Joi from 'joi';
|
|
9
10
|
import { Instruction } from '.';
|
|
10
11
|
import Processor from '../Processor';
|
|
11
12
|
import { FlowNodeModel } from '../types';
|
|
12
13
|
export default class ExecutionResultInstruction extends Instruction {
|
|
14
|
+
configSchema: Joi.ObjectSchema<any>;
|
|
13
15
|
run(node: FlowNodeModel, prevJob: any, processor: Processor): Promise<{
|
|
14
16
|
result: any;
|
|
15
17
|
status: -1;
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
var __create = Object.create;
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
13
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
15
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
16
|
var __export = (target, all) => {
|
|
15
17
|
for (var name in all)
|
|
@@ -23,15 +25,27 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
25
|
}
|
|
24
26
|
return to;
|
|
25
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
|
+
));
|
|
26
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
37
|
var OutputInstruction_exports = {};
|
|
28
38
|
__export(OutputInstruction_exports, {
|
|
29
39
|
default: () => ExecutionResultInstruction
|
|
30
40
|
});
|
|
31
41
|
module.exports = __toCommonJS(OutputInstruction_exports);
|
|
42
|
+
var import_joi = __toESM(require("joi"));
|
|
32
43
|
var import__ = require(".");
|
|
33
44
|
var import_constants = require("../constants");
|
|
34
45
|
class ExecutionResultInstruction extends import__.Instruction {
|
|
46
|
+
configSchema = import_joi.default.object({
|
|
47
|
+
value: import_joi.default.any()
|
|
48
|
+
});
|
|
35
49
|
async run(node, prevJob, processor) {
|
|
36
50
|
const { value } = node.config;
|
|
37
51
|
const output = processor.getParsedValue(value, node.id);
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import Joi from 'joi';
|
|
9
10
|
import type Processor from '../Processor';
|
|
10
11
|
import type { FlowNodeModel } from '../types';
|
|
11
12
|
import { Instruction } from '.';
|
|
12
13
|
export declare class QueryInstruction extends Instruction {
|
|
14
|
+
configSchema: Joi.ObjectSchema<any>;
|
|
15
|
+
validateConfig(config: Record<string, any>): Record<string, string>;
|
|
13
16
|
run(node: FlowNodeModel, input: any, processor: Processor): Promise<{
|
|
14
17
|
result: any;
|
|
15
18
|
status: -1;
|