@nocobase/plugin-workflow 0.9.2-alpha.2 → 0.9.2-alpha.3
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/AddButton.js +1 -3
- package/lib/client/Branch.d.ts +1 -1
- package/lib/client/ExecutionCanvas.js +1 -1
- package/lib/client/FlowContext.d.ts +1 -1
- package/lib/client/WorkflowProvider.js +0 -1
- package/lib/client/components/CollectionFieldset.d.ts +1 -1
- package/lib/client/components/CollectionFieldset.js +13 -13
- package/lib/client/components/Duration.js +3 -3
- package/lib/client/components/DynamicExpression.d.ts +1 -1
- package/lib/client/components/RadioWithTooltip.js +4 -4
- package/lib/client/components/renderEngineReference.js +3 -2
- package/lib/client/interfaces/expression.d.ts +1 -1
- package/lib/client/locale/en-US.d.ts +70 -70
- package/lib/client/locale/en-US.js +115 -115
- package/lib/client/locale/ja-JP.d.ts +57 -57
- package/lib/client/locale/ja-JP.js +85 -85
- package/lib/client/locale/pt-BR.d.ts +70 -70
- package/lib/client/locale/pt-BR.js +115 -115
- package/lib/client/locale/ru-RU.d.ts +57 -57
- package/lib/client/locale/ru-RU.js +85 -85
- package/lib/client/locale/tr-TR.d.ts +57 -57
- package/lib/client/locale/tr-TR.js +85 -85
- package/lib/client/locale/zh-CN.js +55 -55
- package/lib/client/nodes/calculation.js +6 -6
- package/lib/client/nodes/condition.d.ts +3 -3
- package/lib/client/nodes/condition.js +46 -42
- package/lib/client/nodes/delay.d.ts +1 -1
- package/lib/client/nodes/index.js +35 -37
- package/lib/client/nodes/manual/ModeConfig.js +5 -5
- package/lib/client/nodes/manual/SchemaConfig.js +2 -5
- package/lib/client/nodes/manual/WorkflowTodo.js +3 -3
- package/lib/client/nodes/manual/forms/customForm.js +1 -2
- package/lib/client/nodes/parallel.d.ts +1 -1
- package/lib/client/nodes/parallel.js +6 -6
- package/lib/client/nodes/request.d.ts +2 -0
- package/lib/client/nodes/request.js +7 -5
- package/lib/client/style.js +67 -63
- package/lib/client/triggers/index.d.ts +4 -4
- package/lib/client/triggers/index.js +5 -7
- package/lib/client/triggers/schedule/DateFieldsSelect.d.ts +1 -1
- package/lib/client/triggers/schedule/EndsByField.js +3 -3
- package/lib/client/triggers/schedule/OnField.js +3 -3
- package/lib/client/triggers/schedule/RepeatField.js +16 -16
- package/lib/client/triggers/schedule/ScheduleConfig.js +2 -2
- package/lib/client/utils.js +1 -1
- package/lib/client/variable.js +4 -4
- package/lib/server/Processor.js +1 -1
- package/lib/server/functions/index.d.ts +1 -1
- package/lib/server/functions/index.js +1 -2
- package/lib/server/instructions/calculation.d.ts +1 -1
- package/lib/server/instructions/condition.d.ts +2 -2
- package/lib/server/instructions/create.d.ts +1 -1
- package/lib/server/instructions/destroy.d.ts +1 -1
- package/lib/server/instructions/manual/index.js +1 -2
- package/lib/server/instructions/parallel.d.ts +3 -3
- package/lib/server/instructions/query.d.ts +2 -2
- package/lib/server/instructions/request.js +0 -1
- package/lib/server/instructions/update.d.ts +2 -2
- package/lib/server/migrations/20230221071831-calculation-expression.js +11 -11
- package/lib/server/migrations/20230221121203-condition-calculation.js +6 -6
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +3 -5
- package/lib/server/migrations/20230411034722-manual-multi-form.js +3 -2
- package/lib/server/triggers/collection.d.ts +2 -2
- package/lib/server/triggers/collection.js +2 -2
- package/lib/server/triggers/schedule.js +26 -20
- package/package.json +12 -12
|
@@ -22,16 +22,14 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
22
22
|
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); }); }; }
|
|
23
23
|
class _default extends _server().Migration {
|
|
24
24
|
up() {
|
|
25
|
-
var
|
|
26
|
-
_this = this;
|
|
25
|
+
var _this = this;
|
|
27
26
|
return _asyncToGenerator(function* () {
|
|
28
27
|
const match = yield _this.app.version.satisfies('<0.9.0-alpha.3');
|
|
29
28
|
if (!match) {
|
|
30
29
|
return;
|
|
31
30
|
}
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
queryInterface = _arguments$0$context.queryInterface;
|
|
31
|
+
const sequelize = _this.sequelize;
|
|
32
|
+
const queryInterface = _this.queryInterface;
|
|
35
33
|
const db = _this.app.db;
|
|
36
34
|
yield sequelize.transaction( /*#__PURE__*/function () {
|
|
37
35
|
var _ref = _asyncToGenerator(function* (transaction) {
|
|
@@ -185,7 +185,7 @@ function migrateUsedConfig(config, manualForms) {
|
|
|
185
185
|
}
|
|
186
186
|
return `{{$jobsMapByNodeId.${id}.${manualForms[id]}${path || ''}}}`;
|
|
187
187
|
});
|
|
188
|
-
} else if (valueType === 'object') {
|
|
188
|
+
} else if (valueType === 'object' && config[key]) {
|
|
189
189
|
migrateUsedConfig(config[key], manualForms);
|
|
190
190
|
}
|
|
191
191
|
});
|
|
@@ -285,8 +285,9 @@ class _default extends _server().Migration {
|
|
|
285
285
|
}
|
|
286
286
|
});
|
|
287
287
|
yield usedNodes.reduce((promise, node) => promise.then( /*#__PURE__*/_asyncToGenerator(function* () {
|
|
288
|
+
var _node$config2;
|
|
288
289
|
yield node.update({
|
|
289
|
-
config: migrateUsedConfig((0, _lodash().cloneDeep)(node.config), nodeForms)
|
|
290
|
+
config: migrateUsedConfig((0, _lodash().cloneDeep)((_node$config2 = node.config) !== null && _node$config2 !== void 0 ? _node$config2 : {}), nodeForms)
|
|
290
291
|
}, {
|
|
291
292
|
silent: true,
|
|
292
293
|
transaction
|
|
@@ -112,7 +112,7 @@ class CollectionTrigger extends _.Trigger {
|
|
|
112
112
|
_step;
|
|
113
113
|
try {
|
|
114
114
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
115
|
-
|
|
115
|
+
const _step$value = _slicedToArray(_step.value, 2),
|
|
116
116
|
key = _step$value[0],
|
|
117
117
|
type = _step$value[1];
|
|
118
118
|
const event = `${collection}.${type}`;
|
|
@@ -150,7 +150,7 @@ class CollectionTrigger extends _.Trigger {
|
|
|
150
150
|
_step2;
|
|
151
151
|
try {
|
|
152
152
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
153
|
-
|
|
153
|
+
const _step2$value = _slicedToArray(_step2.value, 2),
|
|
154
154
|
key = _step2$value[0],
|
|
155
155
|
type = _step2$value[1];
|
|
156
156
|
const event = `${collection}.${type}`;
|
|
@@ -106,18 +106,20 @@ function getOnTimestampWithOffset(on, now) {
|
|
|
106
106
|
case 'string':
|
|
107
107
|
return parseDateWithoutMs(on);
|
|
108
108
|
case 'object':
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
{
|
|
110
|
+
const field = on.field,
|
|
111
|
+
_on$offset = on.offset,
|
|
112
|
+
offset = _on$offset === void 0 ? 0 : _on$offset,
|
|
113
|
+
_on$unit = on.unit,
|
|
114
|
+
unit = _on$unit === void 0 ? 1000 : _on$unit;
|
|
115
|
+
if (!field) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
const timestamp = now.getTime();
|
|
119
|
+
// onDate + offset > now
|
|
120
|
+
// onDate > now - offset
|
|
121
|
+
return timestamp - offset * unit;
|
|
116
122
|
}
|
|
117
|
-
const timestamp = now.getTime();
|
|
118
|
-
// onDate + offset > now
|
|
119
|
-
// onDate > now - offset
|
|
120
|
-
return timestamp - offset * unit;
|
|
121
123
|
default:
|
|
122
124
|
return null;
|
|
123
125
|
}
|
|
@@ -128,15 +130,19 @@ function getDataOptionTime(data, on, dir = 1) {
|
|
|
128
130
|
}
|
|
129
131
|
switch (typeof on) {
|
|
130
132
|
case 'string':
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
{
|
|
134
|
+
const time = parseDateWithoutMs(on);
|
|
135
|
+
return time ? time : null;
|
|
136
|
+
}
|
|
133
137
|
case 'object':
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
{
|
|
139
|
+
const field = on.field,
|
|
140
|
+
_on$offset2 = on.offset,
|
|
141
|
+
offset = _on$offset2 === void 0 ? 0 : _on$offset2,
|
|
142
|
+
_on$unit2 = on.unit,
|
|
143
|
+
unit = _on$unit2 === void 0 ? 1000 : _on$unit2;
|
|
144
|
+
return data.get(field) ? data.get(field).getTime() - offset * unit * dir : null;
|
|
145
|
+
}
|
|
140
146
|
default:
|
|
141
147
|
return null;
|
|
142
148
|
}
|
|
@@ -365,7 +371,7 @@ function matchNext(workflow, now, range = this.cacheCycle) {
|
|
|
365
371
|
const interval = _cronParser().default.parseExpression(repeat, {
|
|
366
372
|
currentDate
|
|
367
373
|
});
|
|
368
|
-
|
|
374
|
+
const next = interval.next();
|
|
369
375
|
// NOTE: cache all workflows will be matched in current cycle
|
|
370
376
|
if (next.getTime() - timestamp <= range) {
|
|
371
377
|
return true;
|
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.3",
|
|
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.3",
|
|
10
|
+
"@nocobase/client": "0.9.2-alpha.3",
|
|
11
|
+
"@nocobase/database": "0.9.2-alpha.3",
|
|
12
|
+
"@nocobase/evaluators": "0.9.2-alpha.3",
|
|
13
|
+
"@nocobase/logger": "0.9.2-alpha.3",
|
|
14
|
+
"@nocobase/resourcer": "0.9.2-alpha.3",
|
|
15
|
+
"@nocobase/server": "0.9.2-alpha.3",
|
|
16
|
+
"@nocobase/utils": "0.9.2-alpha.3",
|
|
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.3",
|
|
28
|
+
"@nocobase/test": "0.9.2-alpha.3",
|
|
29
29
|
"@types/ejs": "^3.1.1"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "b6b5f9372202d942c97d2d90a4197e060db05124"
|
|
32
32
|
}
|