@nocobase/plugin-workflow 0.9.1-alpha.2 → 0.9.2-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 (131) hide show
  1. package/lib/client/AddButton.js +17 -64
  2. package/lib/client/Branch.js +0 -13
  3. package/lib/client/ExecutionCanvas.js +16 -63
  4. package/lib/client/ExecutionLink.js +3 -21
  5. package/lib/client/ExecutionPage.js +1 -19
  6. package/lib/client/ExecutionResourceProvider.js +6 -23
  7. package/lib/client/FlowContext.js +0 -8
  8. package/lib/client/WorkflowCanvas.js +56 -127
  9. package/lib/client/WorkflowLink.js +3 -21
  10. package/lib/client/WorkflowPage.js +1 -19
  11. package/lib/client/WorkflowProvider.js +24 -47
  12. package/lib/client/WorkflowShortcut.js +0 -16
  13. package/lib/client/components/CollectionBlockInitializer.js +12 -22
  14. package/lib/client/components/CollectionFieldInitializers.js +5 -24
  15. package/lib/client/components/CollectionFieldset.js +31 -79
  16. package/lib/client/components/Duration.js +0 -14
  17. package/lib/client/components/DynamicExpression.d.ts +4 -0
  18. package/lib/client/components/DynamicExpression.js +102 -0
  19. package/lib/client/components/FieldsSelect.d.ts +2 -0
  20. package/lib/client/components/FieldsSelect.js +66 -0
  21. package/lib/client/components/FilterDynamicComponent.js +1 -10
  22. package/lib/client/components/NullRender.js +0 -1
  23. package/lib/client/components/OpenDrawer.js +10 -35
  24. package/lib/client/components/RadioWithTooltip.js +5 -27
  25. package/lib/client/components/renderEngineReference.d.ts +1 -0
  26. package/lib/client/components/renderEngineReference.js +55 -0
  27. package/lib/client/constants.js +0 -9
  28. package/lib/client/index.js +0 -6
  29. package/lib/client/interfaces/expression.d.ts +3 -0
  30. package/lib/client/interfaces/expression.js +37 -0
  31. package/lib/client/locale/index.js +5 -15
  32. package/lib/client/locale/pt-BR.d.ts +130 -0
  33. package/lib/client/locale/pt-BR.js +136 -0
  34. package/lib/client/locale/zh-CN.d.ts +16 -1
  35. package/lib/client/locale/zh-CN.js +17 -2
  36. package/lib/client/nodes/calculation.d.ts +54 -3
  37. package/lib/client/nodes/calculation.js +136 -63
  38. package/lib/client/nodes/condition.d.ts +1 -1
  39. package/lib/client/nodes/condition.js +21 -76
  40. package/lib/client/nodes/create.d.ts +35 -9
  41. package/lib/client/nodes/create.js +13 -19
  42. package/lib/client/nodes/delay.d.ts +1 -3
  43. package/lib/client/nodes/delay.js +3 -10
  44. package/lib/client/nodes/destroy.d.ts +1 -6
  45. package/lib/client/nodes/destroy.js +12 -9
  46. package/lib/client/nodes/index.d.ts +2 -2
  47. package/lib/client/nodes/index.js +45 -147
  48. package/lib/client/nodes/manual/AssigneesSelect.js +6 -17
  49. package/lib/client/nodes/manual/ModeConfig.js +0 -27
  50. package/lib/client/nodes/manual/SchemaConfig.js +87 -449
  51. package/lib/client/nodes/manual/WorkflowTodo.js +99 -163
  52. package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +4 -20
  53. package/lib/client/nodes/manual/forms/customForm.d.ts +40 -0
  54. package/lib/client/nodes/manual/forms/customForm.js +411 -0
  55. package/lib/client/nodes/manual/index.d.ts +12 -1
  56. package/lib/client/nodes/manual/index.js +54 -41
  57. package/lib/client/nodes/parallel.js +7 -41
  58. package/lib/client/nodes/query.d.ts +28 -7
  59. package/lib/client/nodes/query.js +15 -22
  60. package/lib/client/nodes/request.d.ts +2 -3
  61. package/lib/client/nodes/request.js +5 -22
  62. package/lib/client/nodes/update.d.ts +1 -6
  63. package/lib/client/nodes/update.js +8 -16
  64. package/lib/client/schemas/collection.d.ts +20 -4
  65. package/lib/client/schemas/collection.js +26 -22
  66. package/lib/client/schemas/executions.js +3 -18
  67. package/lib/client/schemas/workflows.js +10 -33
  68. package/lib/client/style.js +24 -21
  69. package/lib/client/triggers/collection.d.ts +24 -20
  70. package/lib/client/triggers/collection.js +34 -123
  71. package/lib/client/triggers/index.d.ts +2 -5
  72. package/lib/client/triggers/index.js +34 -105
  73. package/lib/client/triggers/schedule/DateFieldsSelect.js +6 -29
  74. package/lib/client/triggers/schedule/EndsByField.js +1 -18
  75. package/lib/client/triggers/schedule/OnField.js +10 -38
  76. package/lib/client/triggers/schedule/RepeatField.js +4 -32
  77. package/lib/client/triggers/schedule/ScheduleConfig.js +10 -51
  78. package/lib/client/triggers/schedule/index.d.ts +21 -0
  79. package/lib/client/triggers/schedule/index.js +21 -22
  80. package/lib/client/triggers/schedule/locale/Cron.zh-CN.js +8 -4
  81. package/lib/client/utils.d.ts +1 -0
  82. package/lib/client/utils.js +31 -10
  83. package/lib/client/variable.d.ts +7 -6
  84. package/lib/client/variable.js +132 -71
  85. package/lib/index.js +0 -2
  86. package/lib/server/Plugin.d.ts +7 -7
  87. package/lib/server/Plugin.js +76 -111
  88. package/lib/server/Processor.d.ts +2 -0
  89. package/lib/server/Processor.js +62 -125
  90. package/lib/server/actions/index.js +3 -10
  91. package/lib/server/actions/nodes.js +34 -87
  92. package/lib/server/actions/workflows.js +46 -96
  93. package/lib/server/collections/executions.js +1 -1
  94. package/lib/server/collections/flow_nodes.js +7 -4
  95. package/lib/server/collections/jobs.js +1 -1
  96. package/lib/server/collections/workflows.js +3 -4
  97. package/lib/server/fields/expression-field.d.ts +8 -0
  98. package/lib/server/fields/expression-field.js +26 -0
  99. package/lib/server/fields/index.d.ts +1 -0
  100. package/lib/server/fields/index.js +12 -0
  101. package/lib/server/functions/index.js +3 -14
  102. package/lib/server/index.js +0 -6
  103. package/lib/server/instructions/calculation.js +22 -17
  104. package/lib/server/instructions/condition.js +8 -52
  105. package/lib/server/instructions/create.js +31 -15
  106. package/lib/server/instructions/delay.js +4 -32
  107. package/lib/server/instructions/destroy.js +6 -12
  108. package/lib/server/instructions/index.js +6 -23
  109. package/lib/server/instructions/manual/actions.js +22 -31
  110. package/lib/server/instructions/manual/collecions/users_jobs.js +1 -1
  111. package/lib/server/instructions/manual/index.d.ts +13 -12
  112. package/lib/server/instructions/manual/index.js +9 -47
  113. package/lib/server/instructions/parallel.js +9 -36
  114. package/lib/server/instructions/query.js +17 -15
  115. package/lib/server/instructions/request.js +7 -30
  116. package/lib/server/instructions/update.js +8 -14
  117. package/lib/server/migrations/20221129153547-calculation-variables.js +3 -27
  118. package/lib/server/migrations/20230221032941-change-request-body-type.js +3 -26
  119. package/lib/server/migrations/20230221071831-calculation-expression.js +1 -33
  120. package/lib/server/migrations/20230221121203-condition-calculation.js +5 -28
  121. package/lib/server/migrations/20230221162902-jsonb-to-json.js +3 -18
  122. package/lib/server/migrations/20230411034722-manual-multi-form.d.ts +4 -0
  123. package/lib/server/migrations/20230411034722-manual-multi-form.js +303 -0
  124. package/lib/server/models/Execution.js +0 -5
  125. package/lib/server/models/FlowNode.js +0 -5
  126. package/lib/server/models/Job.js +0 -5
  127. package/lib/server/models/Workflow.js +0 -5
  128. package/lib/server/triggers/collection.js +39 -61
  129. package/lib/server/triggers/index.js +3 -22
  130. package/lib/server/triggers/schedule.js +72 -194
  131. package/package.json +14 -11
@@ -3,47 +3,39 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TypeSets = void 0;
6
+ exports.BaseTypeSets = void 0;
7
7
  exports.filterTypedFields = filterTypedFields;
8
8
  exports.useCollectionFieldOptions = useCollectionFieldOptions;
9
9
  exports.useWorkflowVariableOptions = useWorkflowVariableOptions;
10
-
11
10
  function _client() {
12
11
  const data = require("@nocobase/client");
13
-
14
12
  _client = function _client() {
15
13
  return data;
16
14
  };
17
-
18
15
  return data;
19
16
  }
20
-
21
- var _nodes = require("./nodes");
22
-
23
17
  var _FlowContext = require("./FlowContext");
24
-
25
- var _triggers = require("./triggers");
26
-
27
18
  var _locale = require("./locale");
28
-
19
+ var _nodes = require("./nodes");
20
+ var _triggers = require("./triggers");
21
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
22
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
25
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
29
26
  const VariableTypes = [{
30
27
  title: `{{t("Node result", { ns: "${_locale.NAMESPACE}" })}}`,
31
28
  value: '$jobsMapByNodeId',
32
-
33
29
  options(types) {
34
30
  const current = (0, _nodes.useNodeContext)();
35
31
  const upstreams = (0, _nodes.useAvailableUpstreams)(current);
36
32
  const options = [];
37
33
  upstreams.forEach(node => {
38
34
  var _instruction$getOptio;
39
-
40
35
  const instruction = _nodes.instructions.get(node.type);
41
-
42
36
  const subOptions = (_instruction$getOptio = instruction.getOptions) === null || _instruction$getOptio === void 0 ? void 0 : _instruction$getOptio.call(instruction, node.config, types);
43
-
44
37
  if (subOptions) {
45
38
  var _node$title;
46
-
47
39
  options.push({
48
40
  key: node.id.toString(),
49
41
  value: node.id.toString(),
@@ -54,94 +46,163 @@ const VariableTypes = [{
54
46
  });
55
47
  return options;
56
48
  }
57
-
58
49
  }, {
59
50
  title: `{{t("Trigger variables", { ns: "${_locale.NAMESPACE}" })}}`,
60
51
  value: '$context',
61
-
62
52
  options(types) {
63
53
  var _trigger$getOptions, _trigger$getOptions2;
64
-
65
54
  const _useFlowContext = (0, _FlowContext.useFlowContext)(),
66
- workflow = _useFlowContext.workflow;
67
-
55
+ workflow = _useFlowContext.workflow;
68
56
  const trigger = _triggers.triggers.get(workflow.type);
69
-
70
57
  return (_trigger$getOptions = trigger === null || trigger === void 0 ? void 0 : (_trigger$getOptions2 = trigger.getOptions) === null || _trigger$getOptions2 === void 0 ? void 0 : _trigger$getOptions2.call(trigger, workflow.config, types)) !== null && _trigger$getOptions !== void 0 ? _trigger$getOptions : null;
71
58
  }
72
-
73
59
  }, {
74
60
  title: `{{t("System variables", { ns: "${_locale.NAMESPACE}" })}}`,
75
61
  value: '$system',
76
- options: [{
77
- key: 'now',
78
- value: 'now',
79
- label: `{{t("Current time", { ns: "${_locale.NAMESPACE}" })}}`
80
- }]
62
+ options(types) {
63
+ return [...(!types || types.includes('date') ? [{
64
+ key: 'now',
65
+ value: 'now',
66
+ label: `{{t("System time")}}`
67
+ }] : [])];
68
+ }
81
69
  }];
82
- const TypeSets = {
83
- boolean: new Set(['boolean']),
84
- number: new Set(['integer', 'bigInt', 'float', 'double', 'real', 'decimal']),
85
- string: new Set(['string', 'text', 'password']),
86
- date: new Set(['date', 'time'])
70
+ const BaseTypeSets = {
71
+ boolean: new Set(['checkbox']),
72
+ number: new Set(['number', 'percent']),
73
+ string: new Set(['input', 'password', 'email', 'phone', 'select', 'radioGroup', 'text', 'markdown', 'richText', 'expression', 'time']),
74
+ date: new Set(['date', 'createdAt', 'updatedAt'])
87
75
  };
88
- exports.TypeSets = TypeSets;
89
-
76
+ // { type: 'reference', options: { collection: 'users', multiple: false } }
77
+ // { type: 'reference', options: { collection: 'attachments', multiple: false } }
78
+ // { type: 'reference', options: { collection: 'myExpressions', entity: false } }
79
+ exports.BaseTypeSets = BaseTypeSets;
90
80
  function matchFieldType(field, type) {
91
- if (typeof type === 'string') {
92
- var _TypeSets$type;
93
-
94
- return Boolean((_TypeSets$type = TypeSets[type]) === null || _TypeSets$type === void 0 ? void 0 : _TypeSets$type.has(field.type));
81
+ const inputType = typeof type;
82
+ if (inputType === 'string') {
83
+ var _BaseTypeSets$type;
84
+ return Boolean((_BaseTypeSets$type = BaseTypeSets[type]) === null || _BaseTypeSets$type === void 0 ? void 0 : _BaseTypeSets$type.has(field.interface));
95
85
  }
96
-
97
- if (typeof type === 'object' && type.type === 'reference') {
98
- var _type$options, _type$options2;
99
-
100
- return field.collectionName === ((_type$options = type.options) === null || _type$options === void 0 ? void 0 : _type$options.collection) && field.name === 'id' || field.type === 'belongsTo' && field.target === ((_type$options2 = type.options) === null || _type$options2 === void 0 ? void 0 : _type$options2.collection);
86
+ if (inputType === 'object' && type.type === 'reference') {
87
+ if (isAssociationField(field)) {
88
+ var _type$options, _type$options2, _type$options3;
89
+ return ((_type$options = type.options) === null || _type$options === void 0 ? void 0 : _type$options.entity) && (field.collectionName === ((_type$options2 = type.options) === null || _type$options2 === void 0 ? void 0 : _type$options2.collection) || ((_type$options3 = type.options) === null || _type$options3 === void 0 ? void 0 : _type$options3.collection) === '*');
90
+ } else if (field.isForeignKey) {
91
+ var _type$options4, _type$options5;
92
+ return field.collectionName === ((_type$options4 = type.options) === null || _type$options4 === void 0 ? void 0 : _type$options4.collection) && field.name === 'id' || field.target === ((_type$options5 = type.options) === null || _type$options5 === void 0 ? void 0 : _type$options5.collection);
93
+ } else {
94
+ return false;
95
+ }
96
+ }
97
+ if (inputType === 'function') {
98
+ return type(field);
101
99
  }
102
-
103
100
  return false;
104
101
  }
105
-
106
- function filterTypedFields(fields, types) {
107
- return types ? fields.filter(field => types.some(type => matchFieldType(field, type))) : fields;
102
+ function isAssociationField(field) {
103
+ return ['belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type);
108
104
  }
109
-
110
- function useWorkflowVariableOptions() {
105
+ function filterTypedFields(fields, types, depth = 1) {
106
+ if (!types) {
107
+ return fields;
108
+ }
109
+ return fields.filter(field => {
110
+ if (isAssociationField(field) && depth && filterTypedFields(useNormallizedFields(field.target), types, depth - 1).length) {
111
+ return true;
112
+ }
113
+ return types.some(type => matchFieldType(field, type));
114
+ });
115
+ }
116
+ function useWorkflowVariableOptions(types) {
111
117
  const compile = (0, _client().useCompile)();
112
118
  const options = VariableTypes.map(item => {
113
- const options = typeof item.options === 'function' ? item.options().filter(Boolean) : item.options;
119
+ const opts = typeof item.options === 'function' ? item.options(types).filter(Boolean) : item.options;
114
120
  return {
115
121
  label: compile(item.title),
116
122
  value: item.value,
117
123
  key: item.value,
118
- children: compile(options),
119
- disabled: options && !options.length
124
+ children: compile(opts),
125
+ disabled: opts && !opts.length
120
126
  };
121
127
  });
122
128
  return options;
123
129
  }
124
-
125
- function useCollectionFieldOptions(props) {
126
- const fields = props.fields,
127
- collection = props.collection,
128
- types = props.types;
130
+ function useNormallizedFields(collectionName) {
129
131
  const compile = (0, _client().useCompile)();
130
-
131
132
  const _useCollectionManager = (0, _client().useCollectionManager)(),
132
- getCollectionFields = _useCollectionManager.getCollectionFields;
133
-
134
- return filterTypedFields(fields !== null && fields !== void 0 ? fields : getCollectionFields(collection), types).filter(field => field.interface && (!field.target || field.type === 'belongsTo')).map(field => {
135
- var _field$uiSchema, _field$uiSchema2;
136
-
137
- return field.type === 'belongsTo' ? {
138
- label: `${compile(((_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.title) || field.name)} ID`,
139
- key: field.foreignKey,
140
- value: field.foreignKey
141
- } : {
142
- label: compile(((_field$uiSchema2 = field.uiSchema) === null || _field$uiSchema2 === void 0 ? void 0 : _field$uiSchema2.title) || field.name),
133
+ getCollection = _useCollectionManager.getCollection;
134
+ const collection = getCollection(collectionName);
135
+ if (!collection) {
136
+ return [];
137
+ }
138
+ const fields = collection.fields;
139
+ const foreignKeyFields = [];
140
+ const otherFields = [];
141
+ fields.forEach(field => {
142
+ if (field.isForeignKey) {
143
+ foreignKeyFields.push(field);
144
+ } else {
145
+ otherFields.push(field);
146
+ }
147
+ });
148
+ for (let i = otherFields.length - 1; i >= 0; i--) {
149
+ const field = otherFields[i];
150
+ if (field.type === 'belongsTo') {
151
+ const foreignKeyField = foreignKeyFields.find(f => f.name === field.foreignKey);
152
+ if (foreignKeyField) {
153
+ var _field$uiSchema, _field$uiSchema2;
154
+ otherFields.splice(i, 0, _objectSpread(_objectSpread({}, foreignKeyField), {}, {
155
+ uiSchema: _objectSpread(_objectSpread({}, field.uiSchema), {}, {
156
+ title: ((_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.title) ? `${compile((_field$uiSchema2 = field.uiSchema) === null || _field$uiSchema2 === void 0 ? void 0 : _field$uiSchema2.title)} ID` : foreignKeyField.name
157
+ })
158
+ }));
159
+ } else {
160
+ var _field$uiSchema3, _field$uiSchema4;
161
+ otherFields.splice(i, 0, _objectSpread(_objectSpread({}, field), {}, {
162
+ name: field.foreignKey,
163
+ type: 'bigInt',
164
+ isForeignKey: true,
165
+ interface: field.interface,
166
+ uiSchema: _objectSpread(_objectSpread({}, field.uiSchema), {}, {
167
+ title: ((_field$uiSchema3 = field.uiSchema) === null || _field$uiSchema3 === void 0 ? void 0 : _field$uiSchema3.title) ? `${compile((_field$uiSchema4 = field.uiSchema) === null || _field$uiSchema4 === void 0 ? void 0 : _field$uiSchema4.title)} ID` : field.name
168
+ })
169
+ }));
170
+ }
171
+ } else if (field.type === 'context' && field.collectionName === 'users') {
172
+ var _otherFields$find, _belongsToField$uiSch, _belongsToField$uiSch2;
173
+ const belongsToField = (_otherFields$find = otherFields.find(f => f.type === 'belongsTo' && f.target === 'users' && f.foreignKey === field.name)) !== null && _otherFields$find !== void 0 ? _otherFields$find : {};
174
+ otherFields.splice(i, 0, _objectSpread(_objectSpread({}, field), {}, {
175
+ type: field.dataType,
176
+ interface: belongsToField.interface,
177
+ uiSchema: _objectSpread(_objectSpread({}, belongsToField.uiSchema), {}, {
178
+ title: ((_belongsToField$uiSch = belongsToField.uiSchema) === null || _belongsToField$uiSch === void 0 ? void 0 : _belongsToField$uiSch.title) ? `${compile((_belongsToField$uiSch2 = belongsToField.uiSchema) === null || _belongsToField$uiSch2 === void 0 ? void 0 : _belongsToField$uiSch2.title)} ID` : field.name
179
+ })
180
+ }));
181
+ }
182
+ }
183
+ return otherFields.filter(field => field.interface && !field.hidden);
184
+ }
185
+ function useCollectionFieldOptions(options) {
186
+ const fields = options.fields,
187
+ collection = options.collection,
188
+ types = options.types,
189
+ _options$depth = options.depth,
190
+ depth = _options$depth === void 0 ? 1 : _options$depth;
191
+ const compile = (0, _client().useCompile)();
192
+ const normalizedFields = fields !== null && fields !== void 0 ? fields : useNormallizedFields(collection);
193
+ const result = filterTypedFields(normalizedFields, types, depth).filter(field => !isAssociationField(field) || depth).map(field => {
194
+ var _field$uiSchema5;
195
+ const label = compile(((_field$uiSchema5 = field.uiSchema) === null || _field$uiSchema5 === void 0 ? void 0 : _field$uiSchema5.title) || field.name);
196
+ return {
197
+ label,
143
198
  key: field.name,
144
- value: field.name
199
+ value: field.name,
200
+ children: isAssociationField(field) && depth ? useCollectionFieldOptions({
201
+ collection: field.target,
202
+ types,
203
+ depth: depth - 1
204
+ }) : null
145
205
  };
146
206
  });
207
+ return result;
147
208
  }
package/lib/index.js CHANGED
@@ -9,7 +9,5 @@ Object.defineProperty(exports, "default", {
9
9
  return _server.default;
10
10
  }
11
11
  });
12
-
13
12
  var _server = _interopRequireDefault(require("./server"));
14
-
15
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -2,20 +2,20 @@ import { Plugin } from '@nocobase/server';
2
2
  import { Registry } from '@nocobase/utils';
3
3
  import { Instruction } from './instructions';
4
4
  import ExecutionModel from './models/Execution';
5
- import JobModel from './models/Job';
6
5
  import WorkflowModel from './models/Workflow';
7
6
  import Processor from './Processor';
8
7
  import { Trigger } from './triggers';
9
- declare type Pending = [ExecutionModel, JobModel?];
8
+ import { Logger } from '@nocobase/logger';
9
+ declare type ID = number | string;
10
10
  export default class WorkflowPlugin extends Plugin {
11
11
  instructions: Registry<Instruction>;
12
12
  triggers: Registry<Trigger>;
13
13
  functions: Registry<Function>;
14
- executing: ExecutionModel | null;
15
- pending: Pending[];
16
- events: [WorkflowModel, any, {
17
- context?: any;
18
- }][];
14
+ private executing;
15
+ private pending;
16
+ private events;
17
+ private loggerCache;
18
+ getLogger(workflowId: ID): Logger;
19
19
  onBeforeSave: (instance: WorkflowModel, options: any) => Promise<void>;
20
20
  load(): Promise<void>;
21
21
  toggle(workflow: WorkflowModel, enable?: boolean): void;