@nocobase/plugin-workflow-loop 2.2.16 → 2.2.18
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/externalVersion.js +6 -6
- package/dist/node_modules/joi/dist/joi-browser.min.js +1 -1
- package/dist/node_modules/joi/lib/index.js +1 -1
- package/dist/node_modules/joi/lib/messages.js +35 -6
- package/dist/node_modules/joi/lib/types/keys.js +18 -1
- package/dist/node_modules/joi/lib/types/link.js +18 -2
- package/dist/node_modules/joi/lib/types/string.js +2 -2
- package/dist/node_modules/joi/package.json +1 -1
- package/package.json +3 -3
|
@@ -37,11 +37,21 @@ exports.compile = function (messages, target) {
|
|
|
37
37
|
if (code === 'root' ||
|
|
38
38
|
Template.isTemplate(message)) {
|
|
39
39
|
|
|
40
|
+
// A flat code named __proto__ triggers the legacy accessor on plain-object assignment, and
|
|
41
|
+
// what we assign is always a Template, i.e. an object the accessor accepts, so it replaces
|
|
42
|
+
// target's own prototype instead of creating an own property. That in turn makes
|
|
43
|
+
// Template.isTemplate(target) true, so every code renders that one message
|
|
44
|
+
|
|
45
|
+
Assert(code !== '__proto__', 'Cannot use __proto__ as a message code');
|
|
46
|
+
|
|
40
47
|
target[code] = message;
|
|
41
48
|
continue;
|
|
42
49
|
}
|
|
43
50
|
|
|
44
51
|
if (typeof message === 'string') {
|
|
52
|
+
|
|
53
|
+
Assert(code !== '__proto__', 'Cannot use __proto__ as a message code');
|
|
54
|
+
|
|
45
55
|
target[code] = new Template(message);
|
|
46
56
|
continue;
|
|
47
57
|
}
|
|
@@ -51,20 +61,26 @@ exports.compile = function (messages, target) {
|
|
|
51
61
|
Assert(typeof message === 'object' && !Array.isArray(message), 'Invalid message for', code);
|
|
52
62
|
|
|
53
63
|
const language = code;
|
|
54
|
-
|
|
64
|
+
|
|
65
|
+
// Don't reuse an inherited object, otherwise a language named __proto__ or constructor writes on the prototype
|
|
66
|
+
|
|
67
|
+
const localizedTarget = Object.prototype.hasOwnProperty.call(target, language) ? target[language] : {};
|
|
68
|
+
target[language] = localizedTarget;
|
|
55
69
|
|
|
56
70
|
for (code in message) {
|
|
57
71
|
const localized = message[code];
|
|
58
72
|
|
|
73
|
+
Assert(code !== '__proto__', 'Cannot use __proto__ as a message code');
|
|
74
|
+
|
|
59
75
|
if (code === 'root' ||
|
|
60
76
|
Template.isTemplate(localized)) {
|
|
61
77
|
|
|
62
|
-
|
|
78
|
+
localizedTarget[code] = localized;
|
|
63
79
|
continue;
|
|
64
80
|
}
|
|
65
81
|
|
|
66
82
|
Assert(typeof localized === 'string', 'Invalid message for', code, 'in', language);
|
|
67
|
-
|
|
83
|
+
localizedTarget[code] = new Template(localized);
|
|
68
84
|
}
|
|
69
85
|
}
|
|
70
86
|
|
|
@@ -143,11 +159,18 @@ exports.merge = function (base, extended) {
|
|
|
143
159
|
if (code === 'root' ||
|
|
144
160
|
Template.isTemplate(message)) {
|
|
145
161
|
|
|
162
|
+
// Same as in compile(), a flat code named __proto__ replaces target's own prototype
|
|
163
|
+
|
|
164
|
+
Assert(code !== '__proto__', 'Cannot use __proto__ as a message code');
|
|
165
|
+
|
|
146
166
|
target[code] = message;
|
|
147
167
|
continue;
|
|
148
168
|
}
|
|
149
169
|
|
|
150
170
|
if (typeof message === 'string') {
|
|
171
|
+
|
|
172
|
+
Assert(code !== '__proto__', 'Cannot use __proto__ as a message code');
|
|
173
|
+
|
|
151
174
|
target[code] = new Template(message);
|
|
152
175
|
continue;
|
|
153
176
|
}
|
|
@@ -157,20 +180,26 @@ exports.merge = function (base, extended) {
|
|
|
157
180
|
Assert(typeof message === 'object' && !Array.isArray(message), 'Invalid message for', code);
|
|
158
181
|
|
|
159
182
|
const language = code;
|
|
160
|
-
|
|
183
|
+
|
|
184
|
+
// Same as in compile(), don't reuse an inherited object
|
|
185
|
+
|
|
186
|
+
const localizedTarget = Object.prototype.hasOwnProperty.call(target, language) ? target[language] : {};
|
|
187
|
+
target[language] = localizedTarget;
|
|
161
188
|
|
|
162
189
|
for (code in message) {
|
|
163
190
|
const localized = message[code];
|
|
164
191
|
|
|
192
|
+
Assert(code !== '__proto__', 'Cannot use __proto__ as a message code');
|
|
193
|
+
|
|
165
194
|
if (code === 'root' ||
|
|
166
195
|
Template.isTemplate(localized)) {
|
|
167
196
|
|
|
168
|
-
|
|
197
|
+
localizedTarget[code] = localized;
|
|
169
198
|
continue;
|
|
170
199
|
}
|
|
171
200
|
|
|
172
201
|
Assert(typeof localized === 'string', 'Invalid message for', code, 'in', language);
|
|
173
|
-
|
|
202
|
+
localizedTarget[code] = new Template(localized);
|
|
174
203
|
}
|
|
175
204
|
}
|
|
176
205
|
|
|
@@ -547,6 +547,7 @@ module.exports = Any.extend({
|
|
|
547
547
|
'object.regex': '{{#label}} must be a RegExp object',
|
|
548
548
|
'object.rename.multiple': '{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}',
|
|
549
549
|
'object.rename.override': '{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists',
|
|
550
|
+
'object.rename.proto': '{{#label}} cannot rename {{:#from}} because target {{:#to}} is a reserved key',
|
|
550
551
|
'object.schema': '{{#label}} must be a Joi schema of {{#type}} type',
|
|
551
552
|
'object.unknown': '{{#label}} is not allowed',
|
|
552
553
|
'object.with': '{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}',
|
|
@@ -567,8 +568,15 @@ internals.clone = function (value, prefs) {
|
|
|
567
568
|
return Clone(value, { shallow: true });
|
|
568
569
|
}
|
|
569
570
|
|
|
570
|
-
const
|
|
571
|
+
const proto = Object.getPrototypeOf(value);
|
|
572
|
+
const clone = Object.create(proto);
|
|
571
573
|
Object.assign(clone, value);
|
|
574
|
+
|
|
575
|
+
// Restore the prototype in case of pre-existing prototype pollution
|
|
576
|
+
if (Object.getPrototypeOf(clone) !== proto) {
|
|
577
|
+
Object.setPrototypeOf(clone, proto);
|
|
578
|
+
}
|
|
579
|
+
|
|
572
580
|
return clone;
|
|
573
581
|
}
|
|
574
582
|
|
|
@@ -867,6 +875,15 @@ internals.rename = function (schema, value, state, prefs, errors) {
|
|
|
867
875
|
}
|
|
868
876
|
}
|
|
869
877
|
|
|
878
|
+
if (to === '__proto__') {
|
|
879
|
+
errors.push(schema.$_createError('object.rename.proto', value, { from, to, pattern }, state, prefs));
|
|
880
|
+
if (prefs.abortEarly) {
|
|
881
|
+
return false;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
continue;
|
|
885
|
+
}
|
|
886
|
+
|
|
870
887
|
if (value[from] === undefined) {
|
|
871
888
|
delete value[to];
|
|
872
889
|
}
|
|
@@ -29,13 +29,25 @@ module.exports = Any.extend({
|
|
|
29
29
|
return schema.ref(ref);
|
|
30
30
|
},
|
|
31
31
|
|
|
32
|
-
validate(value, { schema, state, prefs }) {
|
|
32
|
+
validate(value, { schema, state, prefs, error }) {
|
|
33
33
|
|
|
34
34
|
Assert(schema.$_terms.link, 'Uninitialized link schema');
|
|
35
35
|
|
|
36
36
|
const linked = internals.generate(schema, value, state, prefs);
|
|
37
37
|
const ref = schema.$_terms.link[0].ref;
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
return linked.$_validate(value, state.nest(linked, `link:${ref.display}:${linked.type}`), prefs);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
/* $lab:coverage:off$ */
|
|
44
|
+
if (!(err instanceof RangeError)) {
|
|
45
|
+
throw err;
|
|
46
|
+
}
|
|
47
|
+
/* $lab:coverage:on$ */
|
|
48
|
+
|
|
49
|
+
return { value, errors: error('link.depth') };
|
|
50
|
+
}
|
|
39
51
|
},
|
|
40
52
|
|
|
41
53
|
generate(schema, value, state, prefs) {
|
|
@@ -88,6 +100,10 @@ module.exports = Any.extend({
|
|
|
88
100
|
}
|
|
89
101
|
},
|
|
90
102
|
|
|
103
|
+
messages: {
|
|
104
|
+
'link.depth': '{{#label}} exceeds maximum recursion depth supported by the runtime'
|
|
105
|
+
},
|
|
106
|
+
|
|
91
107
|
manifest: {
|
|
92
108
|
|
|
93
109
|
build(obj, desc) {
|
|
@@ -829,8 +829,8 @@ internals.isoDate = function (value) {
|
|
|
829
829
|
return null;
|
|
830
830
|
}
|
|
831
831
|
|
|
832
|
-
if (
|
|
833
|
-
value += '00';
|
|
832
|
+
if (/T.*[+-]\d\d$/.test(value)) { // Add missing separator and trailing zeros to timeshift
|
|
833
|
+
value += ':00';
|
|
834
834
|
}
|
|
835
835
|
|
|
836
836
|
const date = new Date(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"joi","description":"Object schema validation","version":"17.13.
|
|
1
|
+
{"name":"joi","description":"Object schema validation","version":"17.13.8","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-09-25T14:54:17.401Z"}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Used to repeat the sub-process processing of each value in an array, and can also be used for fixed times of sub-process processing.",
|
|
7
7
|
"description.zh-CN": "用于对一个数组中的每个值进行重复的子流程处理,也可用于固定次数的重复子流程处理。",
|
|
8
8
|
"description.ru-RU": "Используется для повторения обработки каждого значения в массиве, а также может использоваться для фиксированного количества повторений подпроцесса.",
|
|
9
|
-
"version": "2.2.
|
|
9
|
+
"version": "2.2.18",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/workflow-loop",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/workflow-loop",
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@ant-design/icons": "5.x",
|
|
17
|
-
"joi": "^17.13.
|
|
17
|
+
"joi": "^17.13.6",
|
|
18
18
|
"react": "18.x",
|
|
19
19
|
"react-i18next": "^11.15.1"
|
|
20
20
|
},
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@nocobase/server": "2.x",
|
|
28
28
|
"@nocobase/test": "2.x"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "0c464cd27b2c1ccdf10b00d339bf6599b18bee22",
|
|
31
31
|
"keywords": [
|
|
32
32
|
"Workflow"
|
|
33
33
|
]
|