@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.
- package/lib/client/AddButton.js +17 -64
- package/lib/client/Branch.js +0 -13
- package/lib/client/ExecutionCanvas.js +16 -63
- package/lib/client/ExecutionLink.js +3 -21
- package/lib/client/ExecutionPage.js +1 -19
- package/lib/client/ExecutionResourceProvider.js +6 -23
- package/lib/client/FlowContext.js +0 -8
- package/lib/client/WorkflowCanvas.js +56 -127
- package/lib/client/WorkflowLink.js +3 -21
- package/lib/client/WorkflowPage.js +1 -19
- package/lib/client/WorkflowProvider.js +24 -47
- package/lib/client/WorkflowShortcut.js +0 -16
- package/lib/client/components/CollectionBlockInitializer.js +12 -22
- package/lib/client/components/CollectionFieldInitializers.js +5 -24
- package/lib/client/components/CollectionFieldset.js +31 -79
- package/lib/client/components/Duration.js +0 -14
- package/lib/client/components/DynamicExpression.d.ts +4 -0
- package/lib/client/components/DynamicExpression.js +102 -0
- package/lib/client/components/FieldsSelect.d.ts +2 -0
- package/lib/client/components/FieldsSelect.js +66 -0
- package/lib/client/components/FilterDynamicComponent.js +1 -10
- package/lib/client/components/NullRender.js +0 -1
- package/lib/client/components/OpenDrawer.js +10 -35
- package/lib/client/components/RadioWithTooltip.js +5 -27
- package/lib/client/components/renderEngineReference.d.ts +1 -0
- package/lib/client/components/renderEngineReference.js +55 -0
- package/lib/client/constants.js +0 -9
- package/lib/client/index.js +0 -6
- package/lib/client/interfaces/expression.d.ts +3 -0
- package/lib/client/interfaces/expression.js +37 -0
- package/lib/client/locale/index.js +5 -15
- package/lib/client/locale/pt-BR.d.ts +130 -0
- package/lib/client/locale/pt-BR.js +136 -0
- package/lib/client/locale/zh-CN.d.ts +16 -1
- package/lib/client/locale/zh-CN.js +17 -2
- package/lib/client/nodes/calculation.d.ts +54 -3
- package/lib/client/nodes/calculation.js +136 -63
- package/lib/client/nodes/condition.d.ts +1 -1
- package/lib/client/nodes/condition.js +21 -76
- package/lib/client/nodes/create.d.ts +35 -9
- package/lib/client/nodes/create.js +13 -19
- package/lib/client/nodes/delay.d.ts +1 -3
- package/lib/client/nodes/delay.js +3 -10
- package/lib/client/nodes/destroy.d.ts +1 -6
- package/lib/client/nodes/destroy.js +12 -9
- package/lib/client/nodes/index.d.ts +2 -2
- package/lib/client/nodes/index.js +45 -147
- package/lib/client/nodes/manual/AssigneesSelect.js +6 -17
- package/lib/client/nodes/manual/ModeConfig.js +0 -27
- package/lib/client/nodes/manual/SchemaConfig.js +87 -449
- package/lib/client/nodes/manual/WorkflowTodo.js +99 -163
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +4 -20
- package/lib/client/nodes/manual/forms/customForm.d.ts +40 -0
- package/lib/client/nodes/manual/forms/customForm.js +411 -0
- package/lib/client/nodes/manual/index.d.ts +12 -1
- package/lib/client/nodes/manual/index.js +54 -41
- package/lib/client/nodes/parallel.js +7 -41
- package/lib/client/nodes/query.d.ts +28 -7
- package/lib/client/nodes/query.js +15 -22
- package/lib/client/nodes/request.d.ts +2 -3
- package/lib/client/nodes/request.js +5 -22
- package/lib/client/nodes/update.d.ts +1 -6
- package/lib/client/nodes/update.js +8 -16
- package/lib/client/schemas/collection.d.ts +20 -4
- package/lib/client/schemas/collection.js +26 -22
- package/lib/client/schemas/executions.js +3 -18
- package/lib/client/schemas/workflows.js +10 -33
- package/lib/client/style.js +24 -21
- package/lib/client/triggers/collection.d.ts +24 -20
- package/lib/client/triggers/collection.js +34 -123
- package/lib/client/triggers/index.d.ts +2 -5
- package/lib/client/triggers/index.js +34 -105
- package/lib/client/triggers/schedule/DateFieldsSelect.js +6 -29
- package/lib/client/triggers/schedule/EndsByField.js +1 -18
- package/lib/client/triggers/schedule/OnField.js +10 -38
- package/lib/client/triggers/schedule/RepeatField.js +4 -32
- package/lib/client/triggers/schedule/ScheduleConfig.js +10 -51
- package/lib/client/triggers/schedule/index.d.ts +21 -0
- package/lib/client/triggers/schedule/index.js +21 -22
- package/lib/client/triggers/schedule/locale/Cron.zh-CN.js +8 -4
- package/lib/client/utils.d.ts +1 -0
- package/lib/client/utils.js +31 -10
- package/lib/client/variable.d.ts +7 -6
- package/lib/client/variable.js +132 -71
- package/lib/index.js +0 -2
- package/lib/server/Plugin.d.ts +7 -7
- package/lib/server/Plugin.js +76 -111
- package/lib/server/Processor.d.ts +2 -0
- package/lib/server/Processor.js +62 -125
- package/lib/server/actions/index.js +3 -10
- package/lib/server/actions/nodes.js +34 -87
- package/lib/server/actions/workflows.js +46 -96
- package/lib/server/collections/executions.js +1 -1
- package/lib/server/collections/flow_nodes.js +7 -4
- package/lib/server/collections/jobs.js +1 -1
- package/lib/server/collections/workflows.js +3 -4
- package/lib/server/fields/expression-field.d.ts +8 -0
- package/lib/server/fields/expression-field.js +26 -0
- package/lib/server/fields/index.d.ts +1 -0
- package/lib/server/fields/index.js +12 -0
- package/lib/server/functions/index.js +3 -14
- package/lib/server/index.js +0 -6
- package/lib/server/instructions/calculation.js +22 -17
- package/lib/server/instructions/condition.js +8 -52
- package/lib/server/instructions/create.js +31 -15
- package/lib/server/instructions/delay.js +4 -32
- package/lib/server/instructions/destroy.js +6 -12
- package/lib/server/instructions/index.js +6 -23
- package/lib/server/instructions/manual/actions.js +22 -31
- package/lib/server/instructions/manual/collecions/users_jobs.js +1 -1
- package/lib/server/instructions/manual/index.d.ts +13 -12
- package/lib/server/instructions/manual/index.js +9 -47
- package/lib/server/instructions/parallel.js +9 -36
- package/lib/server/instructions/query.js +17 -15
- package/lib/server/instructions/request.js +7 -30
- package/lib/server/instructions/update.js +8 -14
- package/lib/server/migrations/20221129153547-calculation-variables.js +3 -27
- package/lib/server/migrations/20230221032941-change-request-body-type.js +3 -26
- package/lib/server/migrations/20230221071831-calculation-expression.js +1 -33
- package/lib/server/migrations/20230221121203-condition-calculation.js +5 -28
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +3 -18
- package/lib/server/migrations/20230411034722-manual-multi-form.d.ts +4 -0
- package/lib/server/migrations/20230411034722-manual-multi-form.js +303 -0
- package/lib/server/models/Execution.js +0 -5
- package/lib/server/models/FlowNode.js +0 -5
- package/lib/server/models/Job.js +0 -5
- package/lib/server/models/Workflow.js +0 -5
- package/lib/server/triggers/collection.js +39 -61
- package/lib/server/triggers/index.js +3 -22
- package/lib/server/triggers/schedule.js +72 -194
- package/package.json +14 -11
package/lib/client/variable.js
CHANGED
|
@@ -3,47 +3,39 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
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
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
|
83
|
-
boolean: new Set(['
|
|
84
|
-
number: new Set(['
|
|
85
|
-
string: new Set(['
|
|
86
|
-
date: new Set(['date', '
|
|
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
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return Boolean((
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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(
|
|
119
|
-
disabled:
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
package/lib/server/Plugin.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
15
|
-
pending
|
|
16
|
-
events
|
|
17
|
-
|
|
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;
|