@nocobase/plugin-workflow 0.7.0-alpha.9 → 0.7.1-alpha.6

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 (159) hide show
  1. package/lib/Plugin.d.ts +18 -0
  2. package/lib/Plugin.js +285 -0
  3. package/lib/Processor.d.ts +40 -0
  4. package/lib/Processor.js +440 -0
  5. package/lib/actions/index.d.ts +3 -1
  6. package/lib/actions/index.js +33 -26
  7. package/{esm/actions/flow_nodes.d.ts → lib/actions/nodes.d.ts} +1 -0
  8. package/lib/actions/nodes.js +321 -0
  9. package/lib/actions/workflows.d.ts +2 -0
  10. package/lib/actions/workflows.js +197 -0
  11. package/lib/calculators/index.d.ts +2 -2
  12. package/lib/calculators/index.js +144 -92
  13. package/lib/collections/executions.js +32 -38
  14. package/lib/collections/flow_nodes.js +60 -72
  15. package/lib/collections/jobs.js +26 -47
  16. package/lib/collections/workflows.d.ts +1 -2
  17. package/lib/collections/workflows.js +70 -63
  18. package/lib/constants.js +22 -17
  19. package/lib/index.d.ts +4 -3
  20. package/lib/index.js +85 -22
  21. package/lib/instructions/calculation.d.ts +1 -1
  22. package/lib/instructions/calculation.js +32 -29
  23. package/lib/instructions/condition.d.ts +2 -2
  24. package/lib/instructions/condition.js +91 -88
  25. package/lib/instructions/create.d.ts +2 -2
  26. package/lib/instructions/create.js +39 -25
  27. package/lib/instructions/delay.d.ts +14 -0
  28. package/lib/instructions/delay.js +138 -0
  29. package/lib/instructions/destroy.d.ts +1 -1
  30. package/lib/instructions/destroy.js +38 -25
  31. package/lib/instructions/index.d.ts +11 -8
  32. package/lib/instructions/index.js +76 -25
  33. package/lib/instructions/parallel.d.ts +3 -3
  34. package/lib/instructions/parallel.js +95 -84
  35. package/lib/instructions/prompt.d.ts +2 -2
  36. package/lib/instructions/prompt.js +21 -13
  37. package/lib/instructions/query.d.ts +2 -1
  38. package/lib/instructions/query.js +42 -25
  39. package/lib/instructions/update.d.ts +2 -1
  40. package/lib/instructions/update.js +40 -25
  41. package/lib/models/Execution.d.ts +3 -33
  42. package/lib/models/Execution.js +18 -254
  43. package/lib/models/FlowNode.js +18 -5
  44. package/lib/models/Job.js +18 -5
  45. package/lib/models/Workflow.d.ts +5 -6
  46. package/lib/models/Workflow.js +18 -76
  47. package/lib/triggers/collection.d.ts +12 -0
  48. package/lib/triggers/collection.js +184 -0
  49. package/lib/triggers/index.d.ts +11 -7
  50. package/lib/triggers/index.js +64 -11
  51. package/lib/triggers/schedule.d.ts +38 -0
  52. package/lib/triggers/schedule.js +672 -0
  53. package/package.json +8 -12
  54. package/esm/actions/flow_nodes.js +0 -139
  55. package/esm/actions/flow_nodes.js.map +0 -1
  56. package/esm/actions/index.d.ts +0 -1
  57. package/esm/actions/index.js +0 -8
  58. package/esm/actions/index.js.map +0 -1
  59. package/esm/calculators/index.d.ts +0 -38
  60. package/esm/calculators/index.js +0 -128
  61. package/esm/calculators/index.js.map +0 -1
  62. package/esm/collections/executions.d.ts +0 -3
  63. package/esm/collections/executions.js +0 -38
  64. package/esm/collections/executions.js.map +0 -1
  65. package/esm/collections/flow_nodes.d.ts +0 -3
  66. package/esm/collections/flow_nodes.js +0 -72
  67. package/esm/collections/flow_nodes.js.map +0 -1
  68. package/esm/collections/jobs.d.ts +0 -3
  69. package/esm/collections/jobs.js +0 -47
  70. package/esm/collections/jobs.js.map +0 -1
  71. package/esm/collections/workflows.d.ts +0 -3
  72. package/esm/collections/workflows.js +0 -63
  73. package/esm/collections/workflows.js.map +0 -1
  74. package/esm/constants.d.ts +0 -17
  75. package/esm/constants.js +0 -18
  76. package/esm/constants.js.map +0 -1
  77. package/esm/index.d.ts +0 -5
  78. package/esm/index.js +0 -6
  79. package/esm/index.js.map +0 -1
  80. package/esm/instructions/calculation.d.ts +0 -8
  81. package/esm/instructions/calculation.js +0 -55
  82. package/esm/instructions/calculation.js.map +0 -1
  83. package/esm/instructions/condition.d.ts +0 -5
  84. package/esm/instructions/condition.js +0 -99
  85. package/esm/instructions/condition.js.map +0 -1
  86. package/esm/instructions/create.d.ts +0 -8
  87. package/esm/instructions/create.js +0 -25
  88. package/esm/instructions/create.js.map +0 -1
  89. package/esm/instructions/destroy.d.ts +0 -8
  90. package/esm/instructions/destroy.js +0 -25
  91. package/esm/instructions/destroy.js.map +0 -1
  92. package/esm/instructions/index.d.ts +0 -15
  93. package/esm/instructions/index.js +0 -20
  94. package/esm/instructions/index.js.map +0 -1
  95. package/esm/instructions/parallel.d.ts +0 -13
  96. package/esm/instructions/parallel.js +0 -88
  97. package/esm/instructions/parallel.js.map +0 -1
  98. package/esm/instructions/prompt.d.ts +0 -7
  99. package/esm/instructions/prompt.js +0 -13
  100. package/esm/instructions/prompt.js.map +0 -1
  101. package/esm/instructions/query.d.ts +0 -8
  102. package/esm/instructions/query.js +0 -25
  103. package/esm/instructions/query.js.map +0 -1
  104. package/esm/instructions/update.d.ts +0 -8
  105. package/esm/instructions/update.js +0 -25
  106. package/esm/instructions/update.js.map +0 -1
  107. package/esm/models/Execution.d.ts +0 -50
  108. package/esm/models/Execution.js +0 -250
  109. package/esm/models/Execution.js.map +0 -1
  110. package/esm/models/FlowNode.d.ts +0 -17
  111. package/esm/models/FlowNode.js +0 -4
  112. package/esm/models/FlowNode.js.map +0 -1
  113. package/esm/models/Job.d.ts +0 -15
  114. package/esm/models/Job.js +0 -4
  115. package/esm/models/Job.js.map +0 -1
  116. package/esm/models/Workflow.d.ts +0 -27
  117. package/esm/models/Workflow.js +0 -72
  118. package/esm/models/Workflow.js.map +0 -1
  119. package/esm/server.d.ts +0 -5
  120. package/esm/server.js +0 -62
  121. package/esm/server.js.map +0 -1
  122. package/esm/triggers/index.d.ts +0 -9
  123. package/esm/triggers/index.js +0 -6
  124. package/esm/triggers/index.js.map +0 -1
  125. package/esm/triggers/model.d.ts +0 -12
  126. package/esm/triggers/model.js +0 -47
  127. package/esm/triggers/model.js.map +0 -1
  128. package/lib/actions/flow_nodes.d.ts +0 -3
  129. package/lib/actions/flow_nodes.js +0 -163
  130. package/lib/actions/flow_nodes.js.map +0 -1
  131. package/lib/actions/index.js.map +0 -1
  132. package/lib/calculators/index.js.map +0 -1
  133. package/lib/collections/executions.js.map +0 -1
  134. package/lib/collections/flow_nodes.js.map +0 -1
  135. package/lib/collections/jobs.js.map +0 -1
  136. package/lib/collections/workflows.js.map +0 -1
  137. package/lib/constants.js.map +0 -1
  138. package/lib/index.js.map +0 -1
  139. package/lib/instructions/calculation.js.map +0 -1
  140. package/lib/instructions/condition.js.map +0 -1
  141. package/lib/instructions/create.js.map +0 -1
  142. package/lib/instructions/destroy.js.map +0 -1
  143. package/lib/instructions/index.js.map +0 -1
  144. package/lib/instructions/parallel.js.map +0 -1
  145. package/lib/instructions/prompt.js.map +0 -1
  146. package/lib/instructions/query.js.map +0 -1
  147. package/lib/instructions/update.js.map +0 -1
  148. package/lib/models/Execution.js.map +0 -1
  149. package/lib/models/FlowNode.js.map +0 -1
  150. package/lib/models/Job.js.map +0 -1
  151. package/lib/models/Workflow.js.map +0 -1
  152. package/lib/server.d.ts +0 -5
  153. package/lib/server.js +0 -68
  154. package/lib/server.js.map +0 -1
  155. package/lib/triggers/index.js.map +0 -1
  156. package/lib/triggers/model.d.ts +0 -12
  157. package/lib/triggers/model.js +0 -49
  158. package/lib/triggers/model.js.map +0 -1
  159. package/tsconfig.build.json +0 -9
@@ -1,132 +1,184 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.calculate = exports.calculators = void 0;
4
- const lodash_1 = require("lodash");
5
- const utils_1 = require("@nocobase/utils");
6
- exports.calculators = new utils_1.Registry();
7
- exports.default = exports.calculators;
8
- // @deprecated
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.calculate = calculate;
7
+ exports.default = exports.calculators = void 0;
8
+
9
+ function _lodash() {
10
+ const data = require("lodash");
11
+
12
+ _lodash = function _lodash() {
13
+ return data;
14
+ };
15
+
16
+ return data;
17
+ }
18
+
19
+ function _utils() {
20
+ const data = require("@nocobase/utils");
21
+
22
+ _utils = function _utils() {
23
+ return data;
24
+ };
25
+
26
+ return data;
27
+ }
28
+
29
+ const calculators = new (_utils().Registry)();
30
+ exports.calculators = calculators;
31
+ var _default = calculators; // @deprecated
9
32
  // HACK: if no path provided, return self
10
33
  // @see https://github.com/lodash/lodash/pull/1270
11
34
  // TODO(question): should add default value as lodash?
35
+
36
+ exports.default = _default;
37
+
12
38
  function get(object, path) {
13
- return path == null || !path.length ? object : (0, lodash_1.get)(object, path);
14
- }
15
- // NOTE:
39
+ return path == null || !path.length ? object : (0, _lodash().get)(object, path);
40
+ } // NOTE:
16
41
  // this method could only be used in executing nodes.
17
42
  // because type of 'job' need loaded jobs in runtime execution.
18
43
  // or the execution should be prepared first.
19
- function calculate(operand, lastJob, execution) {
20
- switch (operand.type) {
21
- // @Deprecated
22
- // from execution context
23
- case '$context':
24
- return get(execution.context, operand.options.path);
25
- // @Deprecated
26
- // from last job (or input job)
27
- case '$input':
28
- return lastJob !== null && lastJob !== void 0 ? lastJob : get(lastJob.result, operand.options.path);
29
- // @Deprecated
30
- // from job in execution
31
- case '$jobsMapByNodeId':
32
- // assume jobs have been fetched from execution before
33
- const job = execution.jobsMapByNodeId[operand.options.nodeId];
34
- return job && get(job, operand.options.path);
35
- case '$calculation':
36
- const fn = exports.calculators.get(operand.options.calculator);
37
- if (!fn) {
38
- throw new Error(`no calculator function registered for "${operand.options.calculator}"`);
39
- }
40
- return fn(...operand.options.operands.map(item => calculate(item, lastJob, execution)));
41
- // constant
42
- default:
43
- return operand.value;
44
- }
45
- }
46
- exports.calculate = calculate;
47
- // built-in functions
44
+
45
+
46
+ function calculate(operand, lastJob, processor) {
47
+ switch (operand.type) {
48
+ // @Deprecated
49
+ // from execution context
50
+ case '$context':
51
+ return get(processor.execution.context, operand.options.path);
52
+ // @Deprecated
53
+ // from last job (or input job)
54
+
55
+ case '$input':
56
+ return lastJob !== null && lastJob !== void 0 ? lastJob : get(lastJob.result, operand.options.path);
57
+ // @Deprecated
58
+ // from job in execution
59
+
60
+ case '$jobsMapByNodeId':
61
+ // assume jobs have been fetched from execution before
62
+ const job = processor.jobsMapByNodeId[operand.options.nodeId];
63
+ return job && get(job, operand.options.path);
64
+
65
+ case '$calculation':
66
+ const fn = calculators.get(operand.options.calculator);
67
+
68
+ if (!fn) {
69
+ throw new Error(`no calculator function registered for "${operand.options.calculator}"`);
70
+ }
71
+
72
+ return fn(...operand.options.operands.map(item => calculate(item, lastJob, processor)));
73
+ // constant
74
+
75
+ default:
76
+ return operand.value;
77
+ }
78
+ } // built-in functions
79
+
80
+
48
81
  function equal(a, b) {
49
- return a === b;
82
+ return a === b;
50
83
  }
84
+
51
85
  function notEqual(a, b) {
52
- return a !== b;
86
+ return a !== b;
53
87
  }
88
+
54
89
  function gt(a, b) {
55
- return a > b;
90
+ return a > b;
56
91
  }
92
+
57
93
  function gte(a, b) {
58
- return a >= b;
94
+ return a >= b;
59
95
  }
96
+
60
97
  function lt(a, b) {
61
- return a < b;
98
+ return a < b;
62
99
  }
100
+
63
101
  function lte(a, b) {
64
- return a <= b;
65
- }
66
- exports.calculators.register('equal', equal);
67
- exports.calculators.register('notEqual', notEqual);
68
- exports.calculators.register('gt', gt);
69
- exports.calculators.register('gte', gte);
70
- exports.calculators.register('lt', lt);
71
- exports.calculators.register('lte', lte);
72
- exports.calculators.register('===', equal);
73
- exports.calculators.register('!==', notEqual);
74
- exports.calculators.register('>', gt);
75
- exports.calculators.register('>=', gte);
76
- exports.calculators.register('<', lt);
77
- exports.calculators.register('<=', lte);
102
+ return a <= b;
103
+ }
104
+
105
+ calculators.register('equal', equal);
106
+ calculators.register('notEqual', notEqual);
107
+ calculators.register('gt', gt);
108
+ calculators.register('gte', gte);
109
+ calculators.register('lt', lt);
110
+ calculators.register('lte', lte);
111
+ calculators.register('===', equal);
112
+ calculators.register('!==', notEqual);
113
+ calculators.register('>', gt);
114
+ calculators.register('>=', gte);
115
+ calculators.register('<', lt);
116
+ calculators.register('<=', lte);
117
+
78
118
  function add(...args) {
79
- return args.reduce((sum, a) => sum + a, 0);
119
+ return args.reduce((sum, a) => sum + a, 0);
80
120
  }
121
+
81
122
  function minus(a, b) {
82
- return a - b;
123
+ return a - b;
83
124
  }
84
- function multipe(...args) {
85
- return args.reduce((result, a) => result * a, 1);
125
+
126
+ function multiple(...args) {
127
+ return args.reduce((result, a) => result * a, 1);
86
128
  }
129
+
87
130
  function divide(a, b) {
88
- return a / b;
131
+ return a / b;
89
132
  }
133
+
90
134
  function mod(a, b) {
91
- return a % b;
92
- }
93
- exports.calculators.register('add', add);
94
- exports.calculators.register('minus', minus);
95
- exports.calculators.register('multipe', multipe);
96
- exports.calculators.register('divide', divide);
97
- exports.calculators.register('mod', mod);
98
- exports.calculators.register('+', add);
99
- exports.calculators.register('-', minus);
100
- exports.calculators.register('*', multipe);
101
- exports.calculators.register('/', divide);
102
- exports.calculators.register('%', mod);
135
+ return a % b;
136
+ }
137
+
138
+ calculators.register('add', add);
139
+ calculators.register('minus', minus);
140
+ calculators.register('multiple', multiple);
141
+ calculators.register('divide', divide);
142
+ calculators.register('mod', mod);
143
+ calculators.register('+', add);
144
+ calculators.register('-', minus);
145
+ calculators.register('*', multiple);
146
+ calculators.register('/', divide);
147
+ calculators.register('%', mod);
148
+
103
149
  function includes(a, b) {
104
- return a.includes(b);
150
+ return a.includes(b);
105
151
  }
152
+
106
153
  function notIncludes(a, b) {
107
- return !a.includes(b);
154
+ return !a.includes(b);
108
155
  }
156
+
109
157
  function startsWith(a, b) {
110
- return a.startsWith(b);
158
+ return a.startsWith(b);
111
159
  }
160
+
112
161
  function notStartsWith(a, b) {
113
- return !a.startsWith(b);
162
+ return !a.startsWith(b);
114
163
  }
164
+
115
165
  function endsWith(a, b) {
116
- return a.endsWith(b);
166
+ return a.endsWith(b);
117
167
  }
168
+
118
169
  function notEndsWith(a, b) {
119
- return !a.endsWith(b);
120
- }
121
- exports.calculators.register('includes', includes);
122
- exports.calculators.register('notIncludes', notIncludes);
123
- exports.calculators.register('startsWith', startsWith);
124
- exports.calculators.register('notStartsWith', notStartsWith);
125
- exports.calculators.register('endsWith', endsWith);
126
- exports.calculators.register('notEndsWith', notEndsWith);
170
+ return !a.endsWith(b);
171
+ }
172
+
173
+ calculators.register('includes', includes);
174
+ calculators.register('notIncludes', notIncludes);
175
+ calculators.register('startsWith', startsWith);
176
+ calculators.register('notStartsWith', notStartsWith);
177
+ calculators.register('endsWith', endsWith);
178
+ calculators.register('notEndsWith', notEndsWith);
179
+
127
180
  function before(a, b) {
128
- return a < b;
181
+ return a < b;
129
182
  }
130
- exports.calculators.register('now', () => new Date());
131
- // TODO: add more common calculators
132
- //# sourceMappingURL=index.js.map
183
+
184
+ calculators.register('now', () => new Date()); // TODO: add more common calculators
@@ -1,40 +1,34 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- name: 'executions',
5
- model: 'ExecutionModel',
6
- title: '执行流程',
7
- fields: [
8
- {
9
- interface: 'linkTo',
10
- type: 'belongsTo',
11
- name: 'workflow',
12
- title: '所属工作流'
13
- },
14
- {
15
- type: 'boolean',
16
- name: 'useTransaction',
17
- title: '使用事务',
18
- defaultValue: false
19
- },
20
- {
21
- interface: 'linkTo',
22
- type: 'hasMany',
23
- name: 'jobs',
24
- title: '流程记录'
25
- },
26
- {
27
- interface: 'json',
28
- type: 'jsonb',
29
- name: 'context',
30
- title: '上下文数据'
31
- },
32
- {
33
- interface: 'select',
34
- type: 'integer',
35
- name: 'status',
36
- title: '状态'
37
- }
38
- ]
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = {
8
+ name: 'executions',
9
+ fields: [{
10
+ type: 'belongsTo',
11
+ name: 'workflow'
12
+ }, {
13
+ type: 'uid',
14
+ name: 'key'
15
+ }, {
16
+ type: 'boolean',
17
+ name: 'useTransaction',
18
+ defaultValue: false
19
+ }, {
20
+ type: 'uuid',
21
+ name: 'transaction',
22
+ defaultValue: null
23
+ }, {
24
+ type: 'hasMany',
25
+ name: 'jobs'
26
+ }, {
27
+ type: 'jsonb',
28
+ name: 'context'
29
+ }, {
30
+ type: 'integer',
31
+ name: 'status'
32
+ }]
39
33
  };
40
- //# sourceMappingURL=executions.js.map
34
+ exports.default = _default;
@@ -1,74 +1,62 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- name: 'flow_nodes',
5
- // model: 'FlowNodeModel',
6
- title: 'Workflow Nodes',
7
- fields: [
8
- {
9
- interface: 'string',
10
- type: 'string',
11
- name: 'title',
12
- title: '名称'
13
- },
14
- // which workflow belongs to
15
- {
16
- interface: 'linkTo',
17
- name: 'workflow',
18
- type: 'belongsTo',
19
- },
20
- {
21
- interface: 'linkTo',
22
- name: 'upstream',
23
- type: 'belongsTo',
24
- target: 'flow_nodes'
25
- },
26
- {
27
- interface: 'linkTo',
28
- name: 'branches',
29
- type: 'hasMany',
30
- target: 'flow_nodes',
31
- sourceKey: 'id',
32
- foreignKey: 'upstreamId',
33
- },
34
- // only works when upstream node is branching type, such as condition and parallel.
35
- // put here because the design of flow-links model is not really necessary for now.
36
- // or it should be put into flow-links model.
37
- {
38
- interface: 'select',
39
- name: 'branchIndex',
40
- type: 'integer',
41
- title: 'branch index'
42
- },
43
- // for reasons:
44
- // 1. redirect type node to solve cycle flow.
45
- // 2. recognize as real next node after branches.
46
- {
47
- interface: 'linkTo',
48
- name: 'downstream',
49
- type: 'belongsTo',
50
- target: 'flow_nodes'
51
- },
52
- {
53
- interface: 'select',
54
- type: 'string',
55
- name: 'type',
56
- title: '类型',
57
- // TODO: data for test only now
58
- dataSource: [
59
- { label: '数据处理', value: 'data' },
60
- { label: '数据查询', value: 'query' },
61
- { label: '等待人工输入', value: 'prompt' },
62
- { label: '条件判断', value: 'condition' },
63
- ]
64
- },
65
- {
66
- interface: 'json',
67
- type: 'jsonb',
68
- name: 'config',
69
- title: '配置',
70
- defaultValue: {}
71
- }
72
- ]
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = {
8
+ name: 'flow_nodes',
9
+ // model: 'FlowNodeModel',
10
+ title: 'Workflow Nodes',
11
+ fields: [{
12
+ interface: 'string',
13
+ type: 'string',
14
+ name: 'title',
15
+ title: '名称'
16
+ }, // which workflow belongs to
17
+ {
18
+ interface: 'linkTo',
19
+ name: 'workflow',
20
+ type: 'belongsTo'
21
+ }, {
22
+ interface: 'linkTo',
23
+ name: 'upstream',
24
+ type: 'belongsTo',
25
+ target: 'flow_nodes'
26
+ }, {
27
+ interface: 'linkTo',
28
+ name: 'branches',
29
+ type: 'hasMany',
30
+ target: 'flow_nodes',
31
+ sourceKey: 'id',
32
+ foreignKey: 'upstreamId'
33
+ }, // only works when upstream node is branching type, such as condition and parallel.
34
+ // put here because the design of flow-links model is not really necessary for now.
35
+ // or it should be put into flow-links model.
36
+ {
37
+ interface: 'select',
38
+ name: 'branchIndex',
39
+ type: 'integer',
40
+ title: 'branch index'
41
+ }, // Note: for reasons:
42
+ // 1. redirect type node to solve cycle flow.
43
+ // 2. recognize as real next node after branches.
44
+ {
45
+ interface: 'linkTo',
46
+ name: 'downstream',
47
+ type: 'belongsTo',
48
+ target: 'flow_nodes'
49
+ }, {
50
+ interface: 'select',
51
+ type: 'string',
52
+ name: 'type',
53
+ title: '类型'
54
+ }, {
55
+ interface: 'json',
56
+ type: 'jsonb',
57
+ name: 'config',
58
+ title: '配置',
59
+ defaultValue: {}
60
+ }]
73
61
  };
74
- //# sourceMappingURL=flow_nodes.js.map
62
+ exports.default = _default;
@@ -1,49 +1,28 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- name: 'jobs',
5
- title: '流程记录',
6
- fields: [
7
- {
8
- interface: 'linkTo',
9
- type: 'belongsTo',
10
- name: 'execution',
11
- title: '所属流程'
12
- },
13
- {
14
- interface: 'linkTo',
15
- type: 'belongsTo',
16
- name: 'node',
17
- target: 'flow_nodes',
18
- title: '所属节点'
19
- },
20
- {
21
- interface: 'linkTo',
22
- type: 'belongsTo',
23
- name: 'upstream',
24
- target: 'jobs',
25
- title: '上游记录'
26
- },
27
- // pending / resolved / rejected
28
- {
29
- interface: 'status',
30
- type: 'integer',
31
- name: 'status',
32
- title: '处理状态'
33
- },
34
- {
35
- interface: 'json',
36
- type: 'jsonb',
37
- name: 'result',
38
- title: '处理结果'
39
- },
40
- // TODO: possibly need node snapshot in case if node has been changed
41
- // {
42
- // interface: 'json',
43
- // type: 'jsonb',
44
- // name: 'nodeSnapshot',
45
- // title: 'node snapshot'
46
- // }
47
- ]
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = {
8
+ name: 'jobs',
9
+ fields: [{
10
+ type: 'belongsTo',
11
+ name: 'execution'
12
+ }, {
13
+ type: 'belongsTo',
14
+ name: 'node',
15
+ target: 'flow_nodes'
16
+ }, {
17
+ type: 'belongsTo',
18
+ name: 'upstream',
19
+ target: 'jobs'
20
+ }, {
21
+ type: 'integer',
22
+ name: 'status'
23
+ }, {
24
+ type: 'jsonb',
25
+ name: 'result'
26
+ }]
48
27
  };
49
- //# sourceMappingURL=jobs.js.map
28
+ exports.default = _default;
@@ -1,3 +1,2 @@
1
1
  import { CollectionOptions } from '@nocobase/database';
2
- declare const _default: CollectionOptions;
3
- export default _default;
2
+ export default function (): CollectionOptions;