@nocobase/plugin-workflow 0.9.2-alpha.3 → 0.9.2-alpha.4
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/lib/client/components/DynamicExpression.js +19 -19
- package/lib/client/components/renderEngineReference.js +9 -9
- package/lib/client/interfaces/expression.js +2 -1
- package/lib/client/nodes/calculation.d.ts +1 -1
- package/lib/client/nodes/calculation.js +23 -23
- package/lib/client/nodes/condition.d.ts +1 -1
- package/lib/client/nodes/condition.js +30 -30
- package/lib/server/Processor.d.ts +2 -2
- package/lib/server/Processor.js +7 -7
- package/lib/server/instructions/calculation.js +7 -7
- package/lib/server/instructions/condition.js +7 -8
- package/package.json +12 -12
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DynamicExpression = void 0;
|
|
7
|
-
function _react() {
|
|
8
|
-
const data = _interopRequireWildcard(require("react"));
|
|
9
|
-
_react = function _react() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _core() {
|
|
15
8
|
const data = require("@formily/core");
|
|
16
9
|
_core = function _core() {
|
|
@@ -18,9 +11,9 @@ function _core() {
|
|
|
18
11
|
};
|
|
19
12
|
return data;
|
|
20
13
|
}
|
|
21
|
-
function
|
|
14
|
+
function _react() {
|
|
22
15
|
const data = require("@formily/react");
|
|
23
|
-
|
|
16
|
+
_react = function _react() {
|
|
24
17
|
return data;
|
|
25
18
|
};
|
|
26
19
|
return data;
|
|
@@ -32,6 +25,13 @@ function _antd() {
|
|
|
32
25
|
};
|
|
33
26
|
return data;
|
|
34
27
|
}
|
|
28
|
+
function _react2() {
|
|
29
|
+
const data = _interopRequireWildcard(require("react"));
|
|
30
|
+
_react2 = function _react2() {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
35
|
function _reactI18next() {
|
|
36
36
|
const data = require("react-i18next");
|
|
37
37
|
_reactI18next = function _reactI18next() {
|
|
@@ -61,15 +61,15 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
61
61
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
62
62
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
63
63
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
64
|
-
const InternalExpression = (0,
|
|
64
|
+
const InternalExpression = (0, _react().observer)(props => {
|
|
65
65
|
const onChange = props.onChange;
|
|
66
|
-
const _useForm = (0,
|
|
66
|
+
const _useForm = (0, _react().useForm)(),
|
|
67
67
|
values = _useForm.values;
|
|
68
|
-
const _useState = (0,
|
|
68
|
+
const _useState = (0, _react2().useState)(values === null || values === void 0 ? void 0 : values.sourceCollection),
|
|
69
69
|
_useState2 = _slicedToArray(_useState, 2),
|
|
70
70
|
collection = _useState2[0],
|
|
71
71
|
setCollection = _useState2[1];
|
|
72
|
-
(0,
|
|
72
|
+
(0, _react().useFormEffects)(() => {
|
|
73
73
|
(0, _core().onFormInitialValuesChange)(form => {
|
|
74
74
|
setCollection(form.values.sourceCollection);
|
|
75
75
|
});
|
|
@@ -79,9 +79,9 @@ const InternalExpression = (0, _react2().observer)(props => {
|
|
|
79
79
|
});
|
|
80
80
|
});
|
|
81
81
|
const options = (0, _variable.useCollectionFieldOptions)({
|
|
82
|
-
collection
|
|
82
|
+
collection: collection
|
|
83
83
|
});
|
|
84
|
-
return
|
|
84
|
+
return _react2().default.createElement(_client().Variable.TextArea, _objectSpread(_objectSpread({}, props), {}, {
|
|
85
85
|
scope: options
|
|
86
86
|
}));
|
|
87
87
|
});
|
|
@@ -89,14 +89,14 @@ function Result(props) {
|
|
|
89
89
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
90
90
|
t = _useTranslation.t;
|
|
91
91
|
const values = (0, _client().useRecord)();
|
|
92
|
-
const options = (0,
|
|
92
|
+
const options = (0, _react2().useMemo)(() => (0, _variable.useCollectionFieldOptions)({
|
|
93
93
|
collection: values.sourceCollection
|
|
94
94
|
}), [values.sourceCollection, values.sourceCollection]);
|
|
95
|
-
return props.value ?
|
|
95
|
+
return props.value ? _react2().default.createElement(_client().Variable.TextArea, _objectSpread(_objectSpread({}, props), {}, {
|
|
96
96
|
scope: options
|
|
97
|
-
})) :
|
|
97
|
+
})) : _react2().default.createElement(_antd().Tag, null, t('Unconfigured', {
|
|
98
98
|
ns: _locale.NAMESPACE
|
|
99
99
|
}));
|
|
100
100
|
}
|
|
101
|
-
const DynamicExpression = (0,
|
|
101
|
+
const DynamicExpression = (0, _react().connect)(InternalExpression, (0, _react().mapReadPretty)(Result));
|
|
102
102
|
exports.DynamicExpression = DynamicExpression;
|
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.renderEngineReference = void 0;
|
|
7
|
-
function _react() {
|
|
8
|
-
const data = _interopRequireDefault(require("react"));
|
|
9
|
-
_react = function _react() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _css() {
|
|
15
8
|
const data = require("@emotion/css");
|
|
16
9
|
_css = function _css() {
|
|
@@ -26,15 +19,22 @@ function _client() {
|
|
|
26
19
|
return data;
|
|
27
20
|
}
|
|
28
21
|
function _client2() {
|
|
29
|
-
const data =
|
|
22
|
+
const data = require("@nocobase/evaluators/client");
|
|
30
23
|
_client2 = function _client2() {
|
|
31
24
|
return data;
|
|
32
25
|
};
|
|
33
26
|
return data;
|
|
34
27
|
}
|
|
28
|
+
function _react() {
|
|
29
|
+
const data = _interopRequireDefault(require("react"));
|
|
30
|
+
_react = function _react() {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
36
36
|
const renderEngineReference = key => {
|
|
37
|
-
const engine = _client2().
|
|
37
|
+
const engine = _client2().evaluators.get(key);
|
|
38
38
|
if (!engine) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaInitializerItemOptions } from '@nocobase/client';
|
|
2
|
-
import { useWorkflowVariableOptions } from '../variable';
|
|
3
2
|
import { RadioWithTooltip } from '../components/RadioWithTooltip';
|
|
3
|
+
import { useWorkflowVariableOptions } from '../variable';
|
|
4
4
|
declare function useWorkflowVariableEntityOptions(): {
|
|
5
5
|
label: any;
|
|
6
6
|
value: any;
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
function
|
|
8
|
-
const data =
|
|
9
|
-
|
|
7
|
+
function _css() {
|
|
8
|
+
const data = require("@emotion/css");
|
|
9
|
+
_css = function _css() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
@@ -18,53 +18,53 @@ function _antd() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const data = require("@
|
|
23
|
-
|
|
21
|
+
function _client() {
|
|
22
|
+
const data = require("@nocobase/client");
|
|
23
|
+
_client = function _client() {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
const data =
|
|
30
|
-
|
|
28
|
+
function _client2() {
|
|
29
|
+
const data = require("@nocobase/evaluators/client");
|
|
30
|
+
_client2 = function _client2() {
|
|
31
31
|
return data;
|
|
32
32
|
};
|
|
33
33
|
return data;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
const data = require("
|
|
37
|
-
|
|
35
|
+
function _antd2() {
|
|
36
|
+
const data = require("antd");
|
|
37
|
+
_antd2 = function _antd2() {
|
|
38
38
|
return data;
|
|
39
39
|
};
|
|
40
40
|
return data;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const data = require("
|
|
44
|
-
|
|
42
|
+
function _jsonTemplates() {
|
|
43
|
+
const data = _interopRequireDefault(require("json-templates"));
|
|
44
|
+
_jsonTemplates = function _jsonTemplates() {
|
|
45
45
|
return data;
|
|
46
46
|
};
|
|
47
47
|
return data;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
const data = require("
|
|
51
|
-
|
|
49
|
+
function _react() {
|
|
50
|
+
const data = _interopRequireDefault(require("react"));
|
|
51
|
+
_react = function _react() {
|
|
52
52
|
return data;
|
|
53
53
|
};
|
|
54
54
|
return data;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const data = require("
|
|
58
|
-
|
|
56
|
+
function _reactI18next() {
|
|
57
|
+
const data = require("react-i18next");
|
|
58
|
+
_reactI18next = function _reactI18next() {
|
|
59
59
|
return data;
|
|
60
60
|
};
|
|
61
61
|
return data;
|
|
62
62
|
}
|
|
63
63
|
var _FlowContext = require("../FlowContext");
|
|
64
|
-
var _locale = require("../locale");
|
|
65
|
-
var _variable = require("../variable");
|
|
66
64
|
var _RadioWithTooltip = require("../components/RadioWithTooltip");
|
|
67
65
|
var _renderEngineReference = require("../components/renderEngineReference");
|
|
66
|
+
var _locale = require("../locale");
|
|
67
|
+
var _variable = require("../variable");
|
|
68
68
|
const _excluded = ["node", "insert"];
|
|
69
69
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
70
70
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Registry } from '@nocobase/utils/client';
|
|
3
|
-
import { useWorkflowVariableOptions } from '../variable';
|
|
4
3
|
import { RadioWithTooltip } from '../components/RadioWithTooltip';
|
|
4
|
+
import { useWorkflowVariableOptions } from '../variable';
|
|
5
5
|
interface Calculator {
|
|
6
6
|
name: string;
|
|
7
7
|
type: 'boolean' | 'number' | 'string' | 'date' | 'unknown' | 'null' | 'array';
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Calculation = Calculation;
|
|
7
7
|
exports.default = exports.calculators = void 0;
|
|
8
|
-
function
|
|
9
|
-
const data =
|
|
10
|
-
|
|
8
|
+
function _icons() {
|
|
9
|
+
const data = require("@ant-design/icons");
|
|
10
|
+
_icons = function _icons() {
|
|
11
11
|
return data;
|
|
12
12
|
};
|
|
13
13
|
return data;
|
|
@@ -19,44 +19,44 @@ function _css() {
|
|
|
19
19
|
};
|
|
20
20
|
return data;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const data = require("
|
|
24
|
-
|
|
22
|
+
function _client() {
|
|
23
|
+
const data = require("@nocobase/client");
|
|
24
|
+
_client = function _client() {
|
|
25
25
|
return data;
|
|
26
26
|
};
|
|
27
27
|
return data;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const data = require("@
|
|
31
|
-
|
|
29
|
+
function _client2() {
|
|
30
|
+
const data = require("@nocobase/evaluators/client");
|
|
31
|
+
_client2 = function _client2() {
|
|
32
32
|
return data;
|
|
33
33
|
};
|
|
34
34
|
return data;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const data = require("
|
|
38
|
-
|
|
36
|
+
function _client3() {
|
|
37
|
+
const data = require("@nocobase/utils/client");
|
|
38
|
+
_client3 = function _client3() {
|
|
39
39
|
return data;
|
|
40
40
|
};
|
|
41
41
|
return data;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const data = require("
|
|
45
|
-
|
|
43
|
+
function _antd() {
|
|
44
|
+
const data = require("antd");
|
|
45
|
+
_antd = function _antd() {
|
|
46
46
|
return data;
|
|
47
47
|
};
|
|
48
48
|
return data;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const data = require("
|
|
52
|
-
|
|
50
|
+
function _react() {
|
|
51
|
+
const data = _interopRequireDefault(require("react"));
|
|
52
|
+
_react = function _react() {
|
|
53
53
|
return data;
|
|
54
54
|
};
|
|
55
55
|
return data;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
const data = require("
|
|
59
|
-
|
|
57
|
+
function _reactI18next() {
|
|
58
|
+
const data = require("react-i18next");
|
|
59
|
+
_reactI18next = function _reactI18next() {
|
|
60
60
|
return data;
|
|
61
61
|
};
|
|
62
62
|
return data;
|
|
@@ -64,18 +64,18 @@ function _client3() {
|
|
|
64
64
|
var _ = require(".");
|
|
65
65
|
var _Branch = require("../Branch");
|
|
66
66
|
var _FlowContext = require("../FlowContext");
|
|
67
|
-
var _style = require("../style");
|
|
68
|
-
var _locale = require("../locale");
|
|
69
|
-
var _variable = require("../variable");
|
|
70
67
|
var _RadioWithTooltip = require("../components/RadioWithTooltip");
|
|
71
68
|
var _renderEngineReference = require("../components/renderEngineReference");
|
|
69
|
+
var _locale = require("../locale");
|
|
70
|
+
var _style = require("../style");
|
|
71
|
+
var _variable = require("../variable");
|
|
72
72
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
73
73
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
74
74
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
75
75
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
76
76
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
77
77
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
78
|
-
const calculators = new (
|
|
78
|
+
const calculators = new (_client3().Registry)();
|
|
79
79
|
exports.calculators = calculators;
|
|
80
80
|
calculators.register('equal', {
|
|
81
81
|
name: '=',
|
|
@@ -188,7 +188,7 @@ function Calculation({
|
|
|
188
188
|
operands = [],
|
|
189
189
|
onChange: _onChange
|
|
190
190
|
}) {
|
|
191
|
-
const compile = (0,
|
|
191
|
+
const compile = (0, _client().useCompile)();
|
|
192
192
|
const options = (0, _variable.useWorkflowVariableOptions)();
|
|
193
193
|
return _react().default.createElement("fieldset", {
|
|
194
194
|
className: (0, _css().css)`
|
|
@@ -197,7 +197,7 @@ function Calculation({
|
|
|
197
197
|
align-items: center;
|
|
198
198
|
flex-wrap: wrap;
|
|
199
199
|
`
|
|
200
|
-
}, _react().default.createElement(
|
|
200
|
+
}, _react().default.createElement(_client().Variable.Input, {
|
|
201
201
|
value: operands[0],
|
|
202
202
|
onChange: v => _onChange({
|
|
203
203
|
calculator,
|
|
@@ -220,7 +220,7 @@ function Calculation({
|
|
|
220
220
|
}]) => _react().default.createElement(_antd().Select.Option, {
|
|
221
221
|
key: value,
|
|
222
222
|
value: value
|
|
223
|
-
}, compile(name)))))), _react().default.createElement(
|
|
223
|
+
}, compile(name)))))), _react().default.createElement(_client().Variable.Input, {
|
|
224
224
|
value: operands[1],
|
|
225
225
|
onChange: v => _onChange({
|
|
226
226
|
calculator,
|
|
@@ -405,7 +405,7 @@ var _default = {
|
|
|
405
405
|
'x-component-props': {
|
|
406
406
|
options: [['basic', {
|
|
407
407
|
label: `{{t("Basic", { ns: "${_locale.NAMESPACE}" })}}`
|
|
408
|
-
}], ...Array.from(
|
|
408
|
+
}], ...Array.from(_client2().evaluators.getEntities())].reduce((result, [value, options]) => result.concat(_objectSpread({
|
|
409
409
|
value
|
|
410
410
|
}, options)), [])
|
|
411
411
|
},
|
|
@@ -439,7 +439,7 @@ var _default = {
|
|
|
439
439
|
form
|
|
440
440
|
}) {
|
|
441
441
|
const values = form.values;
|
|
442
|
-
const _evaluators$get =
|
|
442
|
+
const _evaluators$get = _client2().evaluators.get(values.engine),
|
|
443
443
|
evaluate = _evaluators$get.evaluate;
|
|
444
444
|
const exp = value.trim().replace(/{{([^{}]+)}}/g, ' 1 ');
|
|
445
445
|
try {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { Logger } from '@nocobase/logger';
|
|
1
2
|
import { Transaction, Transactionable } from 'sequelize';
|
|
2
3
|
import Plugin from '.';
|
|
3
4
|
import ExecutionModel from './models/Execution';
|
|
4
|
-
import JobModel from './models/Job';
|
|
5
5
|
import FlowNodeModel from './models/FlowNode';
|
|
6
|
-
import
|
|
6
|
+
import JobModel from './models/Job';
|
|
7
7
|
export interface ProcessorOptions extends Transactionable {
|
|
8
8
|
plugin: Plugin;
|
|
9
9
|
}
|
package/lib/server/Processor.js
CHANGED
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
function _jsonTemplates() {
|
|
8
|
-
const data = _interopRequireDefault(require("json-templates"));
|
|
9
|
-
_jsonTemplates = function _jsonTemplates() {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
7
|
function _database() {
|
|
15
8
|
const data = require("@nocobase/database");
|
|
16
9
|
_database = function _database() {
|
|
@@ -25,6 +18,13 @@ function _evaluators() {
|
|
|
25
18
|
};
|
|
26
19
|
return data;
|
|
27
20
|
}
|
|
21
|
+
function _jsonTemplates() {
|
|
22
|
+
const data = _interopRequireDefault(require("json-templates"));
|
|
23
|
+
_jsonTemplates = function _jsonTemplates() {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
28
|
var _constants = require("./constants");
|
|
29
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
30
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
@@ -4,16 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
function
|
|
8
|
-
const data =
|
|
9
|
-
|
|
7
|
+
function _evaluators() {
|
|
8
|
+
const data = require("@nocobase/evaluators");
|
|
9
|
+
_evaluators = function _evaluators() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data = _interopRequireDefault(require("
|
|
16
|
-
|
|
14
|
+
function _jsonTemplates() {
|
|
15
|
+
const data = _interopRequireDefault(require("json-templates"));
|
|
16
|
+
_jsonTemplates = function _jsonTemplates() {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
@@ -41,7 +41,7 @@ var _default = {
|
|
|
41
41
|
expression = parsed.expression;
|
|
42
42
|
scope = (_parse2 = (0, _jsonTemplates().default)((_node$config$scope = node.config.scope) !== null && _node$config$scope !== void 0 ? _node$config$scope : '')(scope)) !== null && _parse2 !== void 0 ? _parse2 : {};
|
|
43
43
|
}
|
|
44
|
-
const evaluator = _evaluators().
|
|
44
|
+
const evaluator = _evaluators().evaluators.get(engine);
|
|
45
45
|
try {
|
|
46
46
|
const result = evaluator && expression ? evaluator(expression, scope) : null;
|
|
47
47
|
return {
|
|
@@ -4,22 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.calculators = void 0;
|
|
7
|
-
function
|
|
8
|
-
const data = require("@nocobase/
|
|
9
|
-
|
|
7
|
+
function _evaluators() {
|
|
8
|
+
const data = require("@nocobase/evaluators");
|
|
9
|
+
_evaluators = function _evaluators() {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const data =
|
|
16
|
-
|
|
14
|
+
function _utils() {
|
|
15
|
+
const data = require("@nocobase/utils");
|
|
16
|
+
_utils = function _utils() {
|
|
17
17
|
return data;
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
21
|
var _constants = require("../constants");
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
22
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
24
23
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
25
24
|
const calculators = new (_utils().Registry)();
|
|
@@ -106,7 +105,7 @@ var _default = {
|
|
|
106
105
|
calculation = _ref.calculation,
|
|
107
106
|
expression = _ref.expression,
|
|
108
107
|
rejectOnFalse = _ref.rejectOnFalse;
|
|
109
|
-
const evaluator = _evaluators().
|
|
108
|
+
const evaluator = _evaluators().evaluators.get(engine);
|
|
110
109
|
let result = true;
|
|
111
110
|
try {
|
|
112
111
|
result = evaluator ? evaluator(expression, processor.getScope()) : logicCalculate(processor.getParsedValue(calculation));
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-workflow",
|
|
3
|
-
"version": "0.9.2-alpha.
|
|
3
|
+
"version": "0.9.2-alpha.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/actions": "0.9.2-alpha.
|
|
10
|
-
"@nocobase/client": "0.9.2-alpha.
|
|
11
|
-
"@nocobase/database": "0.9.2-alpha.
|
|
12
|
-
"@nocobase/evaluators": "0.9.2-alpha.
|
|
13
|
-
"@nocobase/logger": "0.9.2-alpha.
|
|
14
|
-
"@nocobase/resourcer": "0.9.2-alpha.
|
|
15
|
-
"@nocobase/server": "0.9.2-alpha.
|
|
16
|
-
"@nocobase/utils": "0.9.2-alpha.
|
|
9
|
+
"@nocobase/actions": "0.9.2-alpha.4",
|
|
10
|
+
"@nocobase/client": "0.9.2-alpha.4",
|
|
11
|
+
"@nocobase/database": "0.9.2-alpha.4",
|
|
12
|
+
"@nocobase/evaluators": "0.9.2-alpha.4",
|
|
13
|
+
"@nocobase/logger": "0.9.2-alpha.4",
|
|
14
|
+
"@nocobase/resourcer": "0.9.2-alpha.4",
|
|
15
|
+
"@nocobase/server": "0.9.2-alpha.4",
|
|
16
|
+
"@nocobase/utils": "0.9.2-alpha.4",
|
|
17
17
|
"antd": "4.22.8",
|
|
18
18
|
"axios": "^0.27.2",
|
|
19
19
|
"classnames": "^2.3.1",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"react-js-cron": "^3.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@nocobase/plugin-formula-field": "0.9.2-alpha.
|
|
28
|
-
"@nocobase/test": "0.9.2-alpha.
|
|
27
|
+
"@nocobase/plugin-formula-field": "0.9.2-alpha.4",
|
|
28
|
+
"@nocobase/test": "0.9.2-alpha.4",
|
|
29
29
|
"@types/ejs": "^3.1.1"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "96cb023f353a4fb099dea074c575be65ebab813f"
|
|
32
32
|
}
|