@nocobase/plugin-workflow 0.9.0-alpha.2 → 0.9.1-alpha.2

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 (138) hide show
  1. package/README.md +9 -0
  2. package/README.zh-CN.md +9 -0
  3. package/lib/client/AddButton.d.ts +1 -1
  4. package/lib/client/AddButton.js +43 -27
  5. package/lib/client/Branch.d.ts +1 -1
  6. package/lib/client/ExecutionCanvas.js +5 -10
  7. package/lib/client/WorkflowCanvas.js +12 -42
  8. package/lib/client/WorkflowProvider.js +10 -1
  9. package/lib/client/components/CollectionBlockInitializer.d.ts +7 -0
  10. package/lib/client/components/CollectionBlockInitializer.js +81 -0
  11. package/lib/client/components/CollectionFieldInitializers.d.ts +2 -0
  12. package/lib/client/components/CollectionFieldInitializers.js +89 -0
  13. package/lib/client/components/CollectionFieldset.js +25 -33
  14. package/lib/client/components/FilterDynamicComponent.d.ts +6 -0
  15. package/lib/client/components/FilterDynamicComponent.js +43 -0
  16. package/lib/client/components/NullRender.d.ts +1 -0
  17. package/lib/client/components/NullRender.js +10 -0
  18. package/lib/client/components/RadioWithTooltip.d.ts +7 -0
  19. package/lib/client/components/RadioWithTooltip.js +94 -0
  20. package/lib/client/constants.d.ts +10 -8
  21. package/lib/client/constants.js +52 -14
  22. package/lib/client/index.d.ts +0 -1
  23. package/lib/client/index.js +1 -10
  24. package/lib/client/locale/en-US.d.ts +18 -18
  25. package/lib/client/locale/en-US.js +19 -19
  26. package/lib/client/locale/zh-CN.d.ts +47 -20
  27. package/lib/client/locale/zh-CN.js +48 -21
  28. package/lib/client/nodes/calculation.d.ts +39 -7
  29. package/lib/client/nodes/calculation.js +165 -19
  30. package/lib/client/nodes/condition.d.ts +67 -4
  31. package/lib/client/nodes/condition.js +283 -31
  32. package/lib/client/nodes/create.d.ts +10 -10
  33. package/lib/client/nodes/create.js +28 -42
  34. package/lib/client/nodes/delay.d.ts +4 -4
  35. package/lib/client/nodes/delay.js +10 -8
  36. package/lib/client/nodes/destroy.d.ts +4 -7
  37. package/lib/client/nodes/destroy.js +4 -5
  38. package/lib/client/nodes/index.d.ts +10 -2
  39. package/lib/client/nodes/index.js +217 -110
  40. package/lib/client/nodes/manual/AssigneesSelect.d.ts +6 -0
  41. package/lib/client/nodes/manual/AssigneesSelect.js +65 -0
  42. package/lib/client/nodes/manual/ModeConfig.d.ts +5 -0
  43. package/lib/client/nodes/manual/ModeConfig.js +160 -0
  44. package/lib/client/nodes/manual/SchemaConfig.d.ts +6 -0
  45. package/lib/client/nodes/manual/SchemaConfig.js +715 -0
  46. package/lib/client/nodes/manual/WorkflowTodo.d.ts +8 -0
  47. package/lib/client/nodes/manual/WorkflowTodo.js +691 -0
  48. package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +5 -0
  49. package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +75 -0
  50. package/lib/client/nodes/manual/index.d.ts +62 -0
  51. package/lib/client/nodes/manual/index.js +137 -0
  52. package/lib/client/nodes/parallel.d.ts +12 -7
  53. package/lib/client/nodes/parallel.js +32 -39
  54. package/lib/client/nodes/query.d.ts +11 -19
  55. package/lib/client/nodes/query.js +40 -47
  56. package/lib/client/nodes/request.d.ts +77 -42
  57. package/lib/client/nodes/request.js +123 -69
  58. package/lib/client/nodes/update.d.ts +33 -29
  59. package/lib/client/nodes/update.js +14 -7
  60. package/lib/client/schemas/collection.d.ts +0 -3
  61. package/lib/client/schemas/collection.js +2 -7
  62. package/lib/client/schemas/executions.js +1 -1
  63. package/lib/client/schemas/workflows.js +1 -1
  64. package/lib/client/style.js +51 -9
  65. package/lib/client/triggers/collection.d.ts +44 -15
  66. package/lib/client/triggers/collection.js +104 -82
  67. package/lib/client/triggers/index.d.ts +6 -3
  68. package/lib/client/triggers/index.js +167 -74
  69. package/lib/client/triggers/schedule/DateFieldsSelect.js +1 -3
  70. package/lib/client/triggers/schedule/ScheduleConfig.js +15 -17
  71. package/lib/client/triggers/schedule/index.d.ts +7 -6
  72. package/lib/client/triggers/schedule/index.js +39 -81
  73. package/lib/client/utils.d.ts +1 -0
  74. package/lib/client/utils.js +38 -0
  75. package/lib/client/variable.d.ts +21 -0
  76. package/lib/client/variable.js +147 -0
  77. package/lib/server/Plugin.d.ts +3 -3
  78. package/lib/server/Plugin.js +12 -21
  79. package/lib/server/Processor.d.ts +9 -2
  80. package/lib/server/Processor.js +33 -33
  81. package/lib/server/actions/index.js +2 -4
  82. package/lib/server/actions/workflows.d.ts +1 -0
  83. package/lib/server/actions/workflows.js +80 -23
  84. package/lib/server/collections/executions.js +5 -7
  85. package/lib/server/collections/flow_nodes.js +6 -18
  86. package/lib/server/collections/jobs.js +3 -1
  87. package/lib/server/collections/workflows.js +8 -4
  88. package/lib/server/constants.d.ts +9 -3
  89. package/lib/server/constants.js +11 -5
  90. package/lib/server/functions/index.d.ts +4 -0
  91. package/lib/server/functions/index.js +38 -0
  92. package/lib/server/index.d.ts +0 -1
  93. package/lib/server/index.js +0 -14
  94. package/lib/server/instructions/calculation.d.ts +2 -7
  95. package/lib/server/instructions/calculation.js +32 -37
  96. package/lib/server/instructions/condition.d.ts +4 -4
  97. package/lib/server/instructions/condition.js +126 -54
  98. package/lib/server/instructions/index.js +1 -1
  99. package/lib/server/instructions/manual/actions.js +101 -0
  100. package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/jobs.d.ts +2 -0
  101. package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/jobs.js +2 -1
  102. package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users_jobs.js +10 -10
  103. package/lib/server/instructions/manual/index.d.ts +25 -0
  104. package/lib/server/instructions/manual/index.js +200 -0
  105. package/lib/server/instructions/parallel.js +11 -7
  106. package/lib/server/instructions/request.d.ts +5 -4
  107. package/lib/server/instructions/request.js +60 -79
  108. package/lib/server/migrations/20230221032941-change-request-body-type.d.ts +5 -0
  109. package/lib/server/migrations/20230221032941-change-request-body-type.js +113 -0
  110. package/lib/server/migrations/20230221071831-calculation-expression.d.ts +4 -0
  111. package/lib/server/migrations/20230221071831-calculation-expression.js +143 -0
  112. package/lib/server/migrations/20230221121203-condition-calculation.d.ts +4 -0
  113. package/lib/server/migrations/20230221121203-condition-calculation.js +126 -0
  114. package/lib/server/migrations/20230221162902-jsonb-to-json.d.ts +4 -0
  115. package/lib/server/migrations/20230221162902-jsonb-to-json.js +81 -0
  116. package/lib/server/triggers/schedule.js +11 -3
  117. package/package.json +10 -10
  118. package/lib/client/calculators.d.ts +0 -89
  119. package/lib/client/calculators.js +0 -668
  120. package/lib/client/components/CollectionFieldSelect.d.ts +0 -2
  121. package/lib/client/components/CollectionFieldSelect.js +0 -106
  122. package/lib/client/components/EjsTextArea.d.ts +0 -2
  123. package/lib/client/components/EjsTextArea.js +0 -232
  124. package/lib/server/actions/jobs.d.ts +0 -2
  125. package/lib/server/actions/jobs.js +0 -39
  126. package/lib/server/calculators/index.d.ts +0 -40
  127. package/lib/server/calculators/index.js +0 -187
  128. package/lib/server/extensions/assignees/actions.js +0 -75
  129. package/lib/server/extensions/assignees/index.d.ts +0 -2
  130. package/lib/server/extensions/assignees/index.js +0 -273
  131. package/lib/server/extensions/index.d.ts +0 -3
  132. package/lib/server/extensions/index.js +0 -13
  133. package/lib/server/instructions/prompt.d.ts +0 -19
  134. package/lib/server/instructions/prompt.js +0 -131
  135. /package/lib/server/{extensions/assignees → instructions/manual}/actions.d.ts +0 -0
  136. /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users.d.ts +0 -0
  137. /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users.js +0 -0
  138. /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users_jobs.d.ts +0 -0
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare function ModeConfig({ value, onChange }: {
3
+ value: any;
4
+ onChange: any;
5
+ }): JSX.Element;
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ModeConfig = ModeConfig;
7
+
8
+ function _react() {
9
+ const data = _interopRequireDefault(require("react"));
10
+
11
+ _react = function _react() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _antd() {
19
+ const data = require("@formily/antd");
20
+
21
+ _antd = function _antd() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ function _antd2() {
29
+ const data = require("antd");
30
+
31
+ _antd2 = function _antd2() {
32
+ return data;
33
+ };
34
+
35
+ return data;
36
+ }
37
+
38
+ function _icons() {
39
+ const data = require("@ant-design/icons");
40
+
41
+ _icons = function _icons() {
42
+ return data;
43
+ };
44
+
45
+ return data;
46
+ }
47
+
48
+ function _css() {
49
+ const data = require("@emotion/css");
50
+
51
+ _css = function _css() {
52
+ return data;
53
+ };
54
+
55
+ return data;
56
+ }
57
+
58
+ function _client() {
59
+ const data = require("@nocobase/client");
60
+
61
+ _client = function _client() {
62
+ return data;
63
+ };
64
+
65
+ return data;
66
+ }
67
+
68
+ var _locale = require("../../locale");
69
+
70
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
71
+
72
+ function parseMode(v) {
73
+ if (!v) {
74
+ return 'single';
75
+ }
76
+
77
+ if (v >= 1) {
78
+ return 'all';
79
+ }
80
+
81
+ if (v <= -1) {
82
+ return 'any';
83
+ }
84
+
85
+ const dir = Math.sign(v);
86
+
87
+ if (dir > 0) {
88
+ return '';
89
+ }
90
+ }
91
+
92
+ function ModeConfig({
93
+ value,
94
+ onChange: _onChange
95
+ }) {
96
+ const mode = parseMode(value);
97
+ return _react().default.createElement("fieldset", {
98
+ className: (0, _css().css)`
99
+ .ant-radio-group{
100
+ .anticon{
101
+ margin-left: .5em;
102
+ }
103
+ }
104
+ `
105
+ }, _react().default.createElement(_antd2().Form.Item, null, _react().default.createElement(_antd2().Radio.Group, {
106
+ value: Boolean(value),
107
+ onChange: ({
108
+ target: {
109
+ value: v
110
+ }
111
+ }) => {
112
+ console.log(v);
113
+
114
+ _onChange(Number(v));
115
+ }
116
+ }, _react().default.createElement(_antd2().Radio, {
117
+ value: true
118
+ }, _react().default.createElement(_antd2().Tooltip, {
119
+ title: (0, _locale.lang)('Each user has own task'),
120
+ placement: "bottom"
121
+ }, _react().default.createElement("span", null, (0, _locale.lang)('Separately')), _react().default.createElement(_icons().QuestionCircleOutlined, {
122
+ style: {
123
+ color: '#999'
124
+ }
125
+ }))), _react().default.createElement(_antd2().Radio, {
126
+ value: false
127
+ }, _react().default.createElement(_antd2().Tooltip, {
128
+ title: (0, _locale.lang)('Everyone shares one task'),
129
+ placement: "bottom"
130
+ }, _react().default.createElement("span", null, (0, _locale.lang)('Collaboratively')), _react().default.createElement(_icons().QuestionCircleOutlined, {
131
+ style: {
132
+ color: '#999'
133
+ }
134
+ }))))), value ? _react().default.createElement("fieldset", null, _react().default.createElement(_antd().FormLayout, {
135
+ layout: "vertical"
136
+ }, _react().default.createElement(_client().FormItem, {
137
+ label: (0, _locale.lang)('Negotiation')
138
+ }, _react().default.createElement(_antd2().Radio.Group, {
139
+ value: value,
140
+ onChange: _onChange
141
+ }, _react().default.createElement(_antd2().Radio, {
142
+ value: 1
143
+ }, _react().default.createElement(_antd2().Tooltip, {
144
+ title: (0, _locale.lang)('Everyone should pass'),
145
+ placement: "bottom"
146
+ }, _react().default.createElement("span", null, (0, _locale.lang)('All pass')), _react().default.createElement(_icons().QuestionCircleOutlined, {
147
+ style: {
148
+ color: '#999'
149
+ }
150
+ }))), _react().default.createElement(_antd2().Radio, {
151
+ value: -1
152
+ }, _react().default.createElement(_antd2().Tooltip, {
153
+ title: (0, _locale.lang)('Anyone pass'),
154
+ placement: "bottom"
155
+ }, _react().default.createElement("span", null, (0, _locale.lang)('Any pass')), _react().default.createElement(_icons().QuestionCircleOutlined, {
156
+ style: {
157
+ color: '#999'
158
+ }
159
+ }))))))) : null);
160
+ }
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare function SchemaConfig({ value, onChange }: {
3
+ value: any;
4
+ onChange: any;
5
+ }): JSX.Element;
6
+ export declare function SchemaConfigButton(props: any): JSX.Element;