@nocobase/plugin-workflow 2.1.0-alpha.10 → 2.1.0-alpha.12
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/dist/client/93d3f3f8ced1c194.js +10 -0
- package/dist/client/c46a9a8d11a5be44.js +10 -0
- package/dist/client/cd221313681d6736.js +10 -0
- package/dist/client/e9463c8cd2a45481.js +10 -0
- 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/query.d.ts +10 -0
- package/dist/client/nodes/update.d.ts +10 -0
- 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/externalVersion.js +12 -12
- package/dist/locale/zh-CN.json +1 -0
- 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/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/server/Plugin.d.ts +1 -0
- package/dist/server/Plugin.js +26 -0
- package/dist/server/actions/nodes.d.ts +5 -0
- package/dist/server/actions/nodes.js +34 -2
- package/dist/server/actions/workflows.d.ts +6 -0
- package/dist/server/actions/workflows.js +38 -0
- package/dist/server/instructions/CreateInstruction.d.ts +3 -0
- package/dist/server/instructions/CreateInstruction.js +21 -0
- package/dist/server/instructions/DestroyInstruction.d.ts +3 -0
- package/dist/server/instructions/DestroyInstruction.js +22 -0
- package/dist/server/instructions/EndInstruction.d.ts +2 -0
- package/dist/server/instructions/EndInstruction.js +4 -0
- package/dist/server/instructions/QueryInstruction.d.ts +3 -0
- package/dist/server/instructions/QueryInstruction.js +21 -0
- package/dist/server/instructions/UpdateInstruction.d.ts +3 -0
- package/dist/server/instructions/UpdateInstruction.js +22 -0
- package/dist/server/instructions/index.d.ts +4 -0
- package/dist/server/instructions/index.js +18 -0
- package/dist/server/triggers/CollectionTrigger.d.ts +3 -0
- package/dist/server/triggers/CollectionTrigger.js +23 -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/utils.d.ts +2 -0
- package/dist/server/utils.js +22 -2
- package/package.json +3 -2
- package/dist/client/0e7da88f89e15485.js +0 -10
- package/dist/client/37560b46d530bcf9.js +0 -10
- package/dist/client/4464fed3a8411375.js +0 -10
- package/dist/client/973723cf75f1e4e9.js +0 -10
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const Assert = require('@hapi/hoek/lib/assert');
|
|
4
|
+
|
|
5
|
+
const Any = require('./any');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const internals = {};
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
internals.Map = class extends Map {
|
|
12
|
+
|
|
13
|
+
slice() {
|
|
14
|
+
|
|
15
|
+
return new internals.Map(this);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
module.exports = Any.extend({
|
|
21
|
+
|
|
22
|
+
type: 'symbol',
|
|
23
|
+
|
|
24
|
+
terms: {
|
|
25
|
+
|
|
26
|
+
map: { init: new internals.Map() }
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
coerce: {
|
|
30
|
+
method(value, { schema, error }) {
|
|
31
|
+
|
|
32
|
+
const lookup = schema.$_terms.map.get(value);
|
|
33
|
+
if (lookup) {
|
|
34
|
+
value = lookup;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!schema._flags.only ||
|
|
38
|
+
typeof value === 'symbol') {
|
|
39
|
+
|
|
40
|
+
return { value };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return { value, errors: error('symbol.map', { map: schema.$_terms.map }) };
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
validate(value, { error }) {
|
|
48
|
+
|
|
49
|
+
if (typeof value !== 'symbol') {
|
|
50
|
+
return { value, errors: error('symbol.base') };
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
rules: {
|
|
55
|
+
map: {
|
|
56
|
+
method(iterable) {
|
|
57
|
+
|
|
58
|
+
if (iterable &&
|
|
59
|
+
!iterable[Symbol.iterator] &&
|
|
60
|
+
typeof iterable === 'object') {
|
|
61
|
+
|
|
62
|
+
iterable = Object.entries(iterable);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
Assert(iterable && iterable[Symbol.iterator], 'Iterable must be an iterable or object');
|
|
66
|
+
|
|
67
|
+
const obj = this.clone();
|
|
68
|
+
|
|
69
|
+
const symbols = [];
|
|
70
|
+
for (const entry of iterable) {
|
|
71
|
+
Assert(entry && entry[Symbol.iterator], 'Entry must be an iterable');
|
|
72
|
+
const [key, value] = entry;
|
|
73
|
+
|
|
74
|
+
Assert(typeof key !== 'object' && typeof key !== 'function' && typeof key !== 'symbol', 'Key must not be of type object, function, or Symbol');
|
|
75
|
+
Assert(typeof value === 'symbol', 'Value must be a Symbol');
|
|
76
|
+
|
|
77
|
+
obj.$_terms.map.set(key, value);
|
|
78
|
+
symbols.push(value);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return obj.valid(...symbols);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
manifest: {
|
|
87
|
+
|
|
88
|
+
build(obj, desc) {
|
|
89
|
+
|
|
90
|
+
if (desc.map) {
|
|
91
|
+
obj = obj.map(desc.map);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return obj;
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
messages: {
|
|
99
|
+
'symbol.base': '{{#label}} must be a symbol',
|
|
100
|
+
'symbol.map': '{{#label}} must be one of {{#map}}'
|
|
101
|
+
}
|
|
102
|
+
});
|