@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.
Files changed (86) hide show
  1. package/dist/client/93d3f3f8ced1c194.js +10 -0
  2. package/dist/client/c46a9a8d11a5be44.js +10 -0
  3. package/dist/client/cd221313681d6736.js +10 -0
  4. package/dist/client/e9463c8cd2a45481.js +10 -0
  5. package/dist/client/index.js +1 -1
  6. package/dist/client/nodes/create.d.ts +10 -0
  7. package/dist/client/nodes/destroy.d.ts +10 -0
  8. package/dist/client/nodes/query.d.ts +10 -0
  9. package/dist/client/nodes/update.d.ts +10 -0
  10. package/dist/client/triggers/collection.d.ts +14 -1
  11. package/dist/client/triggers/index.d.ts +4 -0
  12. package/dist/client/triggers/schedule/constants.d.ts +4 -0
  13. package/dist/client/triggers/schedule/index.d.ts +15 -0
  14. package/dist/externalVersion.js +12 -12
  15. package/dist/locale/zh-CN.json +1 -0
  16. package/dist/node_modules/cron-parser/package.json +1 -1
  17. package/dist/node_modules/joi/dist/joi-browser.min.js +1 -0
  18. package/dist/node_modules/joi/lib/annotate.js +175 -0
  19. package/dist/node_modules/joi/lib/base.js +1069 -0
  20. package/dist/node_modules/joi/lib/cache.js +143 -0
  21. package/dist/node_modules/joi/lib/common.js +216 -0
  22. package/dist/node_modules/joi/lib/compile.js +283 -0
  23. package/dist/node_modules/joi/lib/errors.js +271 -0
  24. package/dist/node_modules/joi/lib/extend.js +312 -0
  25. package/dist/node_modules/joi/lib/index.d.ts +2365 -0
  26. package/dist/node_modules/joi/lib/index.js +1 -0
  27. package/dist/node_modules/joi/lib/manifest.js +476 -0
  28. package/dist/node_modules/joi/lib/messages.js +178 -0
  29. package/dist/node_modules/joi/lib/modify.js +267 -0
  30. package/dist/node_modules/joi/lib/ref.js +414 -0
  31. package/dist/node_modules/joi/lib/schemas.js +302 -0
  32. package/dist/node_modules/joi/lib/state.js +166 -0
  33. package/dist/node_modules/joi/lib/template.js +463 -0
  34. package/dist/node_modules/joi/lib/trace.js +346 -0
  35. package/dist/node_modules/joi/lib/types/alternatives.js +364 -0
  36. package/dist/node_modules/joi/lib/types/any.js +174 -0
  37. package/dist/node_modules/joi/lib/types/array.js +809 -0
  38. package/dist/node_modules/joi/lib/types/binary.js +100 -0
  39. package/dist/node_modules/joi/lib/types/boolean.js +150 -0
  40. package/dist/node_modules/joi/lib/types/date.js +233 -0
  41. package/dist/node_modules/joi/lib/types/function.js +93 -0
  42. package/dist/node_modules/joi/lib/types/keys.js +1067 -0
  43. package/dist/node_modules/joi/lib/types/link.js +168 -0
  44. package/dist/node_modules/joi/lib/types/number.js +363 -0
  45. package/dist/node_modules/joi/lib/types/object.js +22 -0
  46. package/dist/node_modules/joi/lib/types/string.js +850 -0
  47. package/dist/node_modules/joi/lib/types/symbol.js +102 -0
  48. package/dist/node_modules/joi/lib/validator.js +750 -0
  49. package/dist/node_modules/joi/lib/values.js +263 -0
  50. package/dist/node_modules/joi/node_modules/@hapi/topo/lib/index.d.ts +60 -0
  51. package/dist/node_modules/joi/node_modules/@hapi/topo/lib/index.js +225 -0
  52. package/dist/node_modules/joi/node_modules/@hapi/topo/package.json +30 -0
  53. package/dist/node_modules/joi/package.json +1 -0
  54. package/dist/node_modules/lru-cache/package.json +1 -1
  55. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  56. package/dist/server/Plugin.d.ts +1 -0
  57. package/dist/server/Plugin.js +26 -0
  58. package/dist/server/actions/nodes.d.ts +5 -0
  59. package/dist/server/actions/nodes.js +34 -2
  60. package/dist/server/actions/workflows.d.ts +6 -0
  61. package/dist/server/actions/workflows.js +38 -0
  62. package/dist/server/instructions/CreateInstruction.d.ts +3 -0
  63. package/dist/server/instructions/CreateInstruction.js +21 -0
  64. package/dist/server/instructions/DestroyInstruction.d.ts +3 -0
  65. package/dist/server/instructions/DestroyInstruction.js +22 -0
  66. package/dist/server/instructions/EndInstruction.d.ts +2 -0
  67. package/dist/server/instructions/EndInstruction.js +4 -0
  68. package/dist/server/instructions/QueryInstruction.d.ts +3 -0
  69. package/dist/server/instructions/QueryInstruction.js +21 -0
  70. package/dist/server/instructions/UpdateInstruction.d.ts +3 -0
  71. package/dist/server/instructions/UpdateInstruction.js +22 -0
  72. package/dist/server/instructions/index.d.ts +4 -0
  73. package/dist/server/instructions/index.js +18 -0
  74. package/dist/server/triggers/CollectionTrigger.d.ts +3 -0
  75. package/dist/server/triggers/CollectionTrigger.js +23 -0
  76. package/dist/server/triggers/ScheduleTrigger/index.d.ts +3 -0
  77. package/dist/server/triggers/ScheduleTrigger/index.js +18 -3
  78. package/dist/server/triggers/index.d.ts +3 -0
  79. package/dist/server/triggers/index.js +18 -0
  80. package/dist/server/utils.d.ts +2 -0
  81. package/dist/server/utils.js +22 -2
  82. package/package.json +3 -2
  83. package/dist/client/0e7da88f89e15485.js +0 -10
  84. package/dist/client/37560b46d530bcf9.js +0 -10
  85. package/dist/client/4464fed3a8411375.js +0 -10
  86. package/dist/client/973723cf75f1e4e9.js +0 -10
@@ -0,0 +1,175 @@
1
+ 'use strict';
2
+
3
+ const Clone = require('@hapi/hoek/lib/clone');
4
+
5
+ const Common = require('./common');
6
+
7
+
8
+ const internals = {
9
+ annotations: Symbol('annotations')
10
+ };
11
+
12
+
13
+ exports.error = function (stripColorCodes) {
14
+
15
+ if (!this._original ||
16
+ typeof this._original !== 'object') {
17
+
18
+ return this.details[0].message;
19
+ }
20
+
21
+ const redFgEscape = stripColorCodes ? '' : '\u001b[31m';
22
+ const redBgEscape = stripColorCodes ? '' : '\u001b[41m';
23
+ const endColor = stripColorCodes ? '' : '\u001b[0m';
24
+
25
+ const obj = Clone(this._original);
26
+
27
+ for (let i = this.details.length - 1; i >= 0; --i) { // Reverse order to process deepest child first
28
+ const pos = i + 1;
29
+ const error = this.details[i];
30
+ const path = error.path;
31
+ let node = obj;
32
+ for (let j = 0; ; ++j) {
33
+ const seg = path[j];
34
+
35
+ if (Common.isSchema(node)) {
36
+ node = node.clone(); // joi schemas are not cloned by hoek, we have to take this extra step
37
+ }
38
+
39
+ if (j + 1 < path.length &&
40
+ typeof node[seg] !== 'string') {
41
+
42
+ node = node[seg];
43
+ }
44
+ else {
45
+ const refAnnotations = node[internals.annotations] || { errors: {}, missing: {} };
46
+ node[internals.annotations] = refAnnotations;
47
+
48
+ const cacheKey = seg || error.context.key;
49
+
50
+ if (node[seg] !== undefined) {
51
+ refAnnotations.errors[cacheKey] = refAnnotations.errors[cacheKey] || [];
52
+ refAnnotations.errors[cacheKey].push(pos);
53
+ }
54
+ else {
55
+ refAnnotations.missing[cacheKey] = pos;
56
+ }
57
+
58
+ break;
59
+ }
60
+ }
61
+ }
62
+
63
+ const replacers = {
64
+ key: /_\$key\$_([, \d]+)_\$end\$_"/g,
65
+ missing: /"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,
66
+ arrayIndex: /\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,
67
+ specials: /"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g
68
+ };
69
+
70
+ let message = internals.safeStringify(obj, 2)
71
+ .replace(replacers.key, ($0, $1) => `" ${redFgEscape}[${$1}]${endColor}`)
72
+ .replace(replacers.missing, ($0, $1, $2) => `${redBgEscape}"${$1}"${endColor}${redFgEscape} [${$2}]: -- missing --${endColor}`)
73
+ .replace(replacers.arrayIndex, ($0, $1, $2) => `\n${$2} ${redFgEscape}[${$1}]${endColor}`)
74
+ .replace(replacers.specials, ($0, $1) => $1);
75
+
76
+ message = `${message}\n${redFgEscape}`;
77
+
78
+ for (let i = 0; i < this.details.length; ++i) {
79
+ const pos = i + 1;
80
+ message = `${message}\n[${pos}] ${this.details[i].message}`;
81
+ }
82
+
83
+ message = message + endColor;
84
+
85
+ return message;
86
+ };
87
+
88
+
89
+ // Inspired by json-stringify-safe
90
+
91
+ internals.safeStringify = function (obj, spaces) {
92
+
93
+ return JSON.stringify(obj, internals.serializer(), spaces);
94
+ };
95
+
96
+
97
+ internals.serializer = function () {
98
+
99
+ const keys = [];
100
+ const stack = [];
101
+
102
+ const cycleReplacer = (key, value) => {
103
+
104
+ if (stack[0] === value) {
105
+ return '[Circular ~]';
106
+ }
107
+
108
+ return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']';
109
+ };
110
+
111
+ return function (key, value) {
112
+
113
+ if (stack.length > 0) {
114
+ const thisPos = stack.indexOf(this);
115
+ if (~thisPos) {
116
+ stack.length = thisPos + 1;
117
+ keys.length = thisPos + 1;
118
+ keys[thisPos] = key;
119
+ }
120
+ else {
121
+ stack.push(this);
122
+ keys.push(key);
123
+ }
124
+
125
+ if (~stack.indexOf(value)) {
126
+ value = cycleReplacer.call(this, key, value);
127
+ }
128
+ }
129
+ else {
130
+ stack.push(value);
131
+ }
132
+
133
+ if (value) {
134
+ const annotations = value[internals.annotations];
135
+ if (annotations) {
136
+ if (Array.isArray(value)) {
137
+ const annotated = [];
138
+
139
+ for (let i = 0; i < value.length; ++i) {
140
+ if (annotations.errors[i]) {
141
+ annotated.push(`_$idx$_${annotations.errors[i].sort().join(', ')}_$end$_`);
142
+ }
143
+
144
+ annotated.push(value[i]);
145
+ }
146
+
147
+ value = annotated;
148
+ }
149
+ else {
150
+ for (const errorKey in annotations.errors) {
151
+ value[`${errorKey}_$key$_${annotations.errors[errorKey].sort().join(', ')}_$end$_`] = value[errorKey];
152
+ value[errorKey] = undefined;
153
+ }
154
+
155
+ for (const missingKey in annotations.missing) {
156
+ value[`_$miss$_${missingKey}|${annotations.missing[missingKey]}_$end$_`] = '__missing__';
157
+ }
158
+ }
159
+
160
+ return value;
161
+ }
162
+ }
163
+
164
+ if (value === Infinity ||
165
+ value === -Infinity ||
166
+ Number.isNaN(value) ||
167
+ typeof value === 'function' ||
168
+ typeof value === 'symbol') {
169
+
170
+ return '[' + value.toString() + ']';
171
+ }
172
+
173
+ return value;
174
+ };
175
+ };