@nocobase/plugin-workflow 2.1.0-alpha.1 → 2.1.0-alpha.11

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 (136) hide show
  1. package/LICENSE +201 -661
  2. package/README.md +79 -10
  3. package/dist/client/93d3f3f8ced1c194.js +10 -0
  4. package/dist/client/AddNodeContext.d.ts +1 -0
  5. package/dist/client/NodeClipboardContext.d.ts +11 -0
  6. package/dist/client/NodeDragContext.d.ts +11 -0
  7. package/dist/client/c46a9a8d11a5be44.js +10 -0
  8. package/dist/client/cd221313681d6736.js +10 -0
  9. package/dist/client/e9463c8cd2a45481.js +10 -0
  10. package/dist/client/hooks/{useWorkflowFilterActionProps.d.ts → useResourceFilterActionProps.d.ts} +1 -1
  11. package/dist/client/index.d.ts +3 -0
  12. package/dist/client/index.js +1 -1
  13. package/dist/client/models/NodeDetailsGridModel.d.ts +13 -0
  14. package/dist/client/models/NodeDetailsModel.d.ts +34 -0
  15. package/dist/client/models/NodeValueModel.d.ts +15 -0
  16. package/dist/client/models/TaskCardCommonItemModel.d.ts +14 -0
  17. package/dist/client/models/index.d.ts +11 -0
  18. package/dist/client/nodeVariableUtils.d.ts +14 -0
  19. package/dist/client/nodes/calculation.d.ts +7 -0
  20. package/dist/client/nodes/create.d.ts +23 -0
  21. package/dist/client/nodes/destroy.d.ts +10 -0
  22. package/dist/client/nodes/index.d.ts +24 -0
  23. package/dist/client/nodes/output.d.ts +53 -0
  24. package/dist/client/nodes/query.d.ts +23 -0
  25. package/dist/client/nodes/update.d.ts +11 -0
  26. package/dist/client/schemas/executions.d.ts +41 -22
  27. package/dist/client/style.d.ts +4 -0
  28. package/dist/client/triggers/collection.d.ts +27 -1
  29. package/dist/client/triggers/index.d.ts +14 -0
  30. package/dist/client/triggers/schedule/constants.d.ts +4 -0
  31. package/dist/client/triggers/schedule/index.d.ts +28 -0
  32. package/dist/common/collections/executions.d.ts +22 -22
  33. package/dist/common/collections/executions.js +12 -0
  34. package/dist/common/collections/jobs.js +4 -0
  35. package/dist/common/collections/workflows.d.ts +22 -9
  36. package/dist/common/collections/workflows.js +9 -1
  37. package/dist/externalVersion.js +12 -12
  38. package/dist/locale/de-DE.json +10 -3
  39. package/dist/locale/en-US.json +22 -3
  40. package/dist/locale/es-ES.json +10 -3
  41. package/dist/locale/fr-FR.json +10 -3
  42. package/dist/locale/hu-HU.json +10 -2
  43. package/dist/locale/id-ID.json +10 -2
  44. package/dist/locale/it-IT.json +10 -3
  45. package/dist/locale/ja-JP.json +10 -5
  46. package/dist/locale/ko-KR.json +10 -3
  47. package/dist/locale/nl-NL.json +10 -3
  48. package/dist/locale/pt-BR.json +10 -3
  49. package/dist/locale/ru-RU.json +10 -3
  50. package/dist/locale/tr-TR.json +10 -3
  51. package/dist/locale/uk-UA.json +10 -3
  52. package/dist/locale/vi-VN.json +10 -2
  53. package/dist/locale/zh-CN.json +28 -5
  54. package/dist/locale/zh-TW.json +10 -3
  55. package/dist/node_modules/cron-parser/package.json +1 -1
  56. package/dist/node_modules/joi/dist/joi-browser.min.js +1 -0
  57. package/dist/node_modules/joi/lib/annotate.js +175 -0
  58. package/dist/node_modules/joi/lib/base.js +1069 -0
  59. package/dist/node_modules/joi/lib/cache.js +143 -0
  60. package/dist/node_modules/joi/lib/common.js +216 -0
  61. package/dist/node_modules/joi/lib/compile.js +283 -0
  62. package/dist/node_modules/joi/lib/errors.js +271 -0
  63. package/dist/node_modules/joi/lib/extend.js +312 -0
  64. package/dist/node_modules/joi/lib/index.d.ts +2365 -0
  65. package/dist/node_modules/joi/lib/index.js +1 -0
  66. package/dist/node_modules/joi/lib/manifest.js +476 -0
  67. package/dist/node_modules/joi/lib/messages.js +178 -0
  68. package/dist/node_modules/joi/lib/modify.js +267 -0
  69. package/dist/node_modules/joi/lib/ref.js +414 -0
  70. package/dist/node_modules/joi/lib/schemas.js +302 -0
  71. package/dist/node_modules/joi/lib/state.js +166 -0
  72. package/dist/node_modules/joi/lib/template.js +463 -0
  73. package/dist/node_modules/joi/lib/trace.js +346 -0
  74. package/dist/node_modules/joi/lib/types/alternatives.js +364 -0
  75. package/dist/node_modules/joi/lib/types/any.js +174 -0
  76. package/dist/node_modules/joi/lib/types/array.js +809 -0
  77. package/dist/node_modules/joi/lib/types/binary.js +100 -0
  78. package/dist/node_modules/joi/lib/types/boolean.js +150 -0
  79. package/dist/node_modules/joi/lib/types/date.js +233 -0
  80. package/dist/node_modules/joi/lib/types/function.js +93 -0
  81. package/dist/node_modules/joi/lib/types/keys.js +1067 -0
  82. package/dist/node_modules/joi/lib/types/link.js +168 -0
  83. package/dist/node_modules/joi/lib/types/number.js +363 -0
  84. package/dist/node_modules/joi/lib/types/object.js +22 -0
  85. package/dist/node_modules/joi/lib/types/string.js +850 -0
  86. package/dist/node_modules/joi/lib/types/symbol.js +102 -0
  87. package/dist/node_modules/joi/lib/validator.js +750 -0
  88. package/dist/node_modules/joi/lib/values.js +263 -0
  89. package/dist/node_modules/joi/node_modules/@hapi/topo/lib/index.d.ts +60 -0
  90. package/dist/node_modules/joi/node_modules/@hapi/topo/lib/index.js +225 -0
  91. package/dist/node_modules/joi/node_modules/@hapi/topo/package.json +30 -0
  92. package/dist/node_modules/joi/package.json +1 -0
  93. package/dist/node_modules/lru-cache/package.json +1 -1
  94. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  95. package/dist/server/Dispatcher.d.ts +3 -2
  96. package/dist/server/Dispatcher.js +76 -62
  97. package/dist/server/Plugin.d.ts +1 -0
  98. package/dist/server/Plugin.js +32 -1
  99. package/dist/server/Processor.d.ts +9 -0
  100. package/dist/server/Processor.js +6 -1
  101. package/dist/server/actions/index.js +2 -0
  102. package/dist/server/actions/nodes.d.ts +7 -0
  103. package/dist/server/actions/nodes.js +315 -4
  104. package/dist/server/actions/workflows.d.ts +6 -0
  105. package/dist/server/actions/workflows.js +38 -0
  106. package/dist/server/instructions/ConditionInstruction.js +4 -1
  107. package/dist/server/instructions/CreateInstruction.d.ts +3 -0
  108. package/dist/server/instructions/CreateInstruction.js +21 -0
  109. package/dist/server/instructions/DestroyInstruction.d.ts +3 -0
  110. package/dist/server/instructions/DestroyInstruction.js +22 -0
  111. package/dist/server/instructions/EndInstruction.d.ts +2 -0
  112. package/dist/server/instructions/EndInstruction.js +4 -0
  113. package/dist/server/instructions/OutputInstruction.d.ts +21 -0
  114. package/dist/server/instructions/OutputInstruction.js +54 -0
  115. package/dist/server/instructions/QueryInstruction.d.ts +3 -0
  116. package/dist/server/instructions/QueryInstruction.js +21 -0
  117. package/dist/server/instructions/UpdateInstruction.d.ts +3 -0
  118. package/dist/server/instructions/UpdateInstruction.js +22 -0
  119. package/dist/server/instructions/index.d.ts +4 -0
  120. package/dist/server/instructions/index.js +18 -0
  121. package/dist/server/repositories/WorkflowRepository.js +2 -1
  122. package/dist/server/triggers/CollectionTrigger.d.ts +3 -0
  123. package/dist/server/triggers/CollectionTrigger.js +23 -0
  124. package/dist/server/triggers/ScheduleTrigger/index.d.ts +3 -0
  125. package/dist/server/triggers/ScheduleTrigger/index.js +18 -3
  126. package/dist/server/triggers/index.d.ts +3 -0
  127. package/dist/server/triggers/index.js +18 -0
  128. package/dist/server/utils.d.ts +2 -0
  129. package/dist/server/utils.js +22 -2
  130. package/dist/swagger/index.d.ts +814 -62
  131. package/dist/swagger/index.js +975 -205
  132. package/package.json +4 -3
  133. package/dist/client/27bd65abee87cafa.js +0 -10
  134. package/dist/client/80d4cd8911e03c27.js +0 -10
  135. package/dist/client/bfc2a351589613e1.js +0 -10
  136. package/dist/client/e078314a62391f36.js +0 -10
@@ -0,0 +1,174 @@
1
+ 'use strict';
2
+
3
+ const Assert = require('@hapi/hoek/lib/assert');
4
+
5
+ const Base = require('../base');
6
+ const Common = require('../common');
7
+ const Messages = require('../messages');
8
+
9
+
10
+ const internals = {};
11
+
12
+
13
+ module.exports = Base.extend({
14
+
15
+ type: 'any',
16
+
17
+ flags: {
18
+
19
+ only: { default: false }
20
+ },
21
+
22
+ terms: {
23
+
24
+ alterations: { init: null },
25
+ examples: { init: null },
26
+ externals: { init: null },
27
+ metas: { init: [] },
28
+ notes: { init: [] },
29
+ shared: { init: null },
30
+ tags: { init: [] },
31
+ whens: { init: null }
32
+ },
33
+
34
+ rules: {
35
+
36
+ custom: {
37
+ method(method, description) {
38
+
39
+ Assert(typeof method === 'function', 'Method must be a function');
40
+ Assert(description === undefined || description && typeof description === 'string', 'Description must be a non-empty string');
41
+
42
+ return this.$_addRule({ name: 'custom', args: { method, description } });
43
+ },
44
+ validate(value, helpers, { method }) {
45
+
46
+ try {
47
+ return method(value, helpers);
48
+ }
49
+ catch (err) {
50
+ return helpers.error('any.custom', { error: err });
51
+ }
52
+ },
53
+ args: ['method', 'description'],
54
+ multi: true
55
+ },
56
+
57
+ messages: {
58
+ method(messages) {
59
+
60
+ return this.prefs({ messages });
61
+ }
62
+ },
63
+
64
+ shared: {
65
+ method(schema) {
66
+
67
+ Assert(Common.isSchema(schema) && schema._flags.id, 'Schema must be a schema with an id');
68
+
69
+ const obj = this.clone();
70
+ obj.$_terms.shared = obj.$_terms.shared || [];
71
+ obj.$_terms.shared.push(schema);
72
+ obj.$_mutateRegister(schema);
73
+ return obj;
74
+ }
75
+ },
76
+
77
+ warning: {
78
+ method(code, local) {
79
+
80
+ Assert(code && typeof code === 'string', 'Invalid warning code');
81
+
82
+ return this.$_addRule({ name: 'warning', args: { code, local }, warn: true });
83
+ },
84
+ validate(value, helpers, { code, local }) {
85
+
86
+ return helpers.error(code, local);
87
+ },
88
+ args: ['code', 'local'],
89
+ multi: true
90
+ }
91
+ },
92
+
93
+ modifiers: {
94
+
95
+ keep(rule, enabled = true) {
96
+
97
+ rule.keep = enabled;
98
+ },
99
+
100
+ message(rule, message) {
101
+
102
+ rule.message = Messages.compile(message);
103
+ },
104
+
105
+ warn(rule, enabled = true) {
106
+
107
+ rule.warn = enabled;
108
+ }
109
+ },
110
+
111
+ manifest: {
112
+
113
+ build(obj, desc) {
114
+
115
+ for (const key in desc) {
116
+ const values = desc[key];
117
+
118
+ if (['examples', 'externals', 'metas', 'notes', 'tags'].includes(key)) {
119
+ for (const value of values) {
120
+ obj = obj[key.slice(0, -1)](value);
121
+ }
122
+
123
+ continue;
124
+ }
125
+
126
+ if (key === 'alterations') {
127
+ const alter = {};
128
+ for (const { target, adjuster } of values) {
129
+ alter[target] = adjuster;
130
+ }
131
+
132
+ obj = obj.alter(alter);
133
+ continue;
134
+ }
135
+
136
+ if (key === 'whens') {
137
+ for (const value of values) {
138
+ const { ref, is, not, then, otherwise, concat } = value;
139
+ if (concat) {
140
+ obj = obj.concat(concat);
141
+ }
142
+ else if (ref) {
143
+ obj = obj.when(ref, { is, not, then, otherwise, switch: value.switch, break: value.break });
144
+ }
145
+ else {
146
+ obj = obj.when(is, { then, otherwise, break: value.break });
147
+ }
148
+ }
149
+
150
+ continue;
151
+ }
152
+
153
+ if (key === 'shared') {
154
+ for (const value of values) {
155
+ obj = obj.shared(value);
156
+ }
157
+ }
158
+ }
159
+
160
+ return obj;
161
+ }
162
+ },
163
+
164
+ messages: {
165
+ 'any.custom': '{{#label}} failed custom validation because {{#error.message}}',
166
+ 'any.default': '{{#label}} threw an error when running default method',
167
+ 'any.failover': '{{#label}} threw an error when running failover method',
168
+ 'any.invalid': '{{#label}} contains an invalid value',
169
+ 'any.only': '{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',
170
+ 'any.ref': '{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}',
171
+ 'any.required': '{{#label}} is required',
172
+ 'any.unknown': '{{#label}} is not allowed'
173
+ }
174
+ });