@nocobase/plugin-workflow 0.9.1-alpha.1 → 0.9.2-alpha.1

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 (132) hide show
  1. package/lib/client/AddButton.js +50 -86
  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 +57 -129
  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 +33 -85
  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 +56 -7
  37. package/lib/client/nodes/calculation.js +141 -74
  38. package/lib/client/nodes/condition.d.ts +5 -9
  39. package/lib/client/nodes/condition.js +30 -93
  40. package/lib/client/nodes/create.d.ts +36 -12
  41. package/lib/client/nodes/create.js +14 -28
  42. package/lib/client/nodes/delay.d.ts +3 -7
  43. package/lib/client/nodes/delay.js +5 -14
  44. package/lib/client/nodes/destroy.d.ts +3 -11
  45. package/lib/client/nodes/destroy.js +14 -12
  46. package/lib/client/nodes/index.d.ts +2 -2
  47. package/lib/client/nodes/index.js +181 -222
  48. package/lib/client/nodes/manual/AssigneesSelect.js +8 -18
  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 +15 -6
  56. package/lib/client/nodes/manual/index.js +58 -54
  57. package/lib/client/nodes/parallel.d.ts +1 -2
  58. package/lib/client/nodes/parallel.js +16 -45
  59. package/lib/client/nodes/query.d.ts +30 -12
  60. package/lib/client/nodes/query.js +17 -25
  61. package/lib/client/nodes/request.d.ts +9 -17
  62. package/lib/client/nodes/request.js +13 -37
  63. package/lib/client/nodes/update.d.ts +27 -28
  64. package/lib/client/nodes/update.js +17 -18
  65. package/lib/client/schemas/collection.d.ts +20 -7
  66. package/lib/client/schemas/collection.js +27 -28
  67. package/lib/client/schemas/executions.js +3 -18
  68. package/lib/client/schemas/workflows.js +10 -33
  69. package/lib/client/style.js +75 -26
  70. package/lib/client/triggers/collection.d.ts +47 -18
  71. package/lib/client/triggers/collection.js +65 -123
  72. package/lib/client/triggers/index.d.ts +3 -6
  73. package/lib/client/triggers/index.js +146 -146
  74. package/lib/client/triggers/schedule/DateFieldsSelect.js +7 -32
  75. package/lib/client/triggers/schedule/EndsByField.js +1 -18
  76. package/lib/client/triggers/schedule/OnField.js +10 -38
  77. package/lib/client/triggers/schedule/RepeatField.js +4 -32
  78. package/lib/client/triggers/schedule/ScheduleConfig.js +25 -68
  79. package/lib/client/triggers/schedule/index.d.ts +21 -1
  80. package/lib/client/triggers/schedule/index.js +22 -24
  81. package/lib/client/triggers/schedule/locale/Cron.zh-CN.js +8 -4
  82. package/lib/client/utils.d.ts +1 -0
  83. package/lib/client/utils.js +31 -10
  84. package/lib/client/variable.d.ts +7 -6
  85. package/lib/client/variable.js +132 -71
  86. package/lib/index.js +0 -2
  87. package/lib/server/Plugin.d.ts +7 -7
  88. package/lib/server/Plugin.js +76 -111
  89. package/lib/server/Processor.d.ts +2 -0
  90. package/lib/server/Processor.js +62 -125
  91. package/lib/server/actions/index.js +3 -10
  92. package/lib/server/actions/nodes.js +34 -87
  93. package/lib/server/actions/workflows.js +46 -96
  94. package/lib/server/collections/executions.js +1 -1
  95. package/lib/server/collections/flow_nodes.js +7 -4
  96. package/lib/server/collections/jobs.js +1 -1
  97. package/lib/server/collections/workflows.js +3 -4
  98. package/lib/server/fields/expression-field.d.ts +8 -0
  99. package/lib/server/fields/expression-field.js +26 -0
  100. package/lib/server/fields/index.d.ts +1 -0
  101. package/lib/server/fields/index.js +12 -0
  102. package/lib/server/functions/index.js +3 -14
  103. package/lib/server/index.js +0 -6
  104. package/lib/server/instructions/calculation.js +22 -17
  105. package/lib/server/instructions/condition.js +8 -52
  106. package/lib/server/instructions/create.js +31 -15
  107. package/lib/server/instructions/delay.js +4 -32
  108. package/lib/server/instructions/destroy.js +6 -12
  109. package/lib/server/instructions/index.js +6 -23
  110. package/lib/server/instructions/manual/actions.js +22 -31
  111. package/lib/server/instructions/manual/collecions/users_jobs.js +1 -1
  112. package/lib/server/instructions/manual/index.d.ts +13 -12
  113. package/lib/server/instructions/manual/index.js +9 -47
  114. package/lib/server/instructions/parallel.js +9 -36
  115. package/lib/server/instructions/query.js +17 -15
  116. package/lib/server/instructions/request.js +7 -30
  117. package/lib/server/instructions/update.js +8 -14
  118. package/lib/server/migrations/20221129153547-calculation-variables.js +3 -27
  119. package/lib/server/migrations/20230221032941-change-request-body-type.js +3 -26
  120. package/lib/server/migrations/20230221071831-calculation-expression.js +1 -33
  121. package/lib/server/migrations/20230221121203-condition-calculation.js +5 -28
  122. package/lib/server/migrations/20230221162902-jsonb-to-json.js +3 -18
  123. package/lib/server/migrations/20230411034722-manual-multi-form.d.ts +4 -0
  124. package/lib/server/migrations/20230411034722-manual-multi-form.js +303 -0
  125. package/lib/server/models/Execution.js +0 -5
  126. package/lib/server/models/FlowNode.js +0 -5
  127. package/lib/server/models/Job.js +0 -5
  128. package/lib/server/models/Workflow.js +0 -5
  129. package/lib/server/triggers/collection.js +39 -61
  130. package/lib/server/triggers/index.js +3 -22
  131. package/lib/server/triggers/schedule.js +72 -194
  132. package/package.json +14 -11
@@ -5,113 +5,76 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Calculation = Calculation;
7
7
  exports.default = exports.calculators = void 0;
8
-
9
8
  function _react() {
10
9
  const data = _interopRequireDefault(require("react"));
11
-
12
10
  _react = function _react() {
13
11
  return data;
14
12
  };
15
-
16
13
  return data;
17
14
  }
18
-
19
15
  function _css() {
20
16
  const data = require("@emotion/css");
21
-
22
17
  _css = function _css() {
23
18
  return data;
24
19
  };
25
-
26
20
  return data;
27
21
  }
28
-
29
22
  function _antd() {
30
23
  const data = require("antd");
31
-
32
24
  _antd = function _antd() {
33
25
  return data;
34
26
  };
35
-
36
27
  return data;
37
28
  }
38
-
39
29
  function _icons() {
40
30
  const data = require("@ant-design/icons");
41
-
42
31
  _icons = function _icons() {
43
32
  return data;
44
33
  };
45
-
46
34
  return data;
47
35
  }
48
-
49
36
  function _reactI18next() {
50
37
  const data = require("react-i18next");
51
-
52
38
  _reactI18next = function _reactI18next() {
53
39
  return data;
54
40
  };
55
-
56
41
  return data;
57
42
  }
58
-
59
43
  function _client() {
60
44
  const data = require("@nocobase/utils/client");
61
-
62
45
  _client = function _client() {
63
46
  return data;
64
47
  };
65
-
66
48
  return data;
67
49
  }
68
-
69
50
  function _client2() {
70
51
  const data = require("@nocobase/client");
71
-
72
52
  _client2 = function _client2() {
73
53
  return data;
74
54
  };
75
-
76
55
  return data;
77
56
  }
78
-
79
57
  function _client3() {
80
- const data = _interopRequireWildcard(require("@nocobase/evaluators/client"));
81
-
58
+ const data = require("@nocobase/evaluators/client");
82
59
  _client3 = function _client3() {
83
60
  return data;
84
61
  };
85
-
86
62
  return data;
87
63
  }
88
-
89
64
  var _ = require(".");
90
-
91
65
  var _Branch = require("../Branch");
92
-
93
66
  var _FlowContext = require("../FlowContext");
94
-
95
67
  var _style = require("../style");
96
-
97
68
  var _locale = require("../locale");
98
-
99
69
  var _variable = require("../variable");
100
-
101
70
  var _RadioWithTooltip = require("../components/RadioWithTooltip");
102
-
103
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
104
-
105
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
106
-
71
+ var _renderEngineReference = require("../components/renderEngineReference");
107
72
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
108
-
109
73
  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; }
110
-
111
74
  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; }
112
-
113
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
114
-
75
+ 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; }
76
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
77
+ 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); }
115
78
  const calculators = new (_client().Registry)();
116
79
  exports.calculators = calculators;
117
80
  calculators.register('equal', {
@@ -217,11 +180,9 @@ const calculatorGroups = [{
217
180
  value: 'date',
218
181
  title: `{{t("Date", { ns: "${_locale.NAMESPACE}" })}}`
219
182
  }];
220
-
221
183
  function getGroupCalculators(group) {
222
184
  return Array.from(calculators.getEntities()).filter(([key, value]) => value.group === group);
223
185
  }
224
-
225
186
  function Calculation({
226
187
  calculator,
227
188
  operands = [],
@@ -242,7 +203,8 @@ function Calculation({
242
203
  calculator,
243
204
  operands: [v, operands[1]]
244
205
  }),
245
- scope: options
206
+ scope: options,
207
+ useTypedConstant: true
246
208
  }), _react().default.createElement(_antd().Select, {
247
209
  value: calculator,
248
210
  onChange: v => _onChange({
@@ -264,10 +226,10 @@ function Calculation({
264
226
  calculator,
265
227
  operands: [operands[0], v]
266
228
  }),
267
- scope: options
229
+ scope: options,
230
+ useTypedConstant: true
268
231
  }));
269
232
  }
270
-
271
233
  function CalculationItem({
272
234
  value,
273
235
  onChange: _onChange2,
@@ -276,10 +238,9 @@ function CalculationItem({
276
238
  if (!value) {
277
239
  return null;
278
240
  }
279
-
280
241
  const calculator = value.calculator,
281
- _value$operands = value.operands,
282
- operands = _value$operands === void 0 ? [] : _value$operands;
242
+ _value$operands = value.operands,
243
+ operands = _value$operands === void 0 ? [] : _value$operands;
283
244
  return _react().default.createElement("div", {
284
245
  className: (0, _css().css)`
285
246
  display: flex;
@@ -301,19 +262,16 @@ function CalculationItem({
301
262
  icon: _react().default.createElement(_icons().CloseCircleOutlined, null)
302
263
  }));
303
264
  }
304
-
305
265
  function CalculationGroup({
306
266
  value,
307
267
  onChange: _onChange3
308
268
  }) {
309
269
  const _useTranslation = (0, _reactI18next().useTranslation)(),
310
- t = _useTranslation.t;
311
-
270
+ t = _useTranslation.t;
312
271
  const _value$type = value.type,
313
- type = _value$type === void 0 ? 'and' : _value$type,
314
- _value$calculations = value.calculations,
315
- calculations = _value$calculations === void 0 ? [] : _value$calculations;
316
-
272
+ type = _value$type === void 0 ? 'and' : _value$type,
273
+ _value$calculations = value.calculations,
274
+ calculations = _value$calculations === void 0 ? [] : _value$calculations;
317
275
  function onAddSingle() {
318
276
  _onChange3(_objectSpread(_objectSpread({}, value), {}, {
319
277
  calculations: [...calculations, {
@@ -322,7 +280,6 @@ function CalculationGroup({
322
280
  }]
323
281
  }));
324
282
  }
325
-
326
283
  function onAddGroup() {
327
284
  _onChange3(_objectSpread(_objectSpread({}, value), {}, {
328
285
  calculations: [...calculations, {
@@ -334,23 +291,18 @@ function CalculationGroup({
334
291
  }]
335
292
  }));
336
293
  }
337
-
338
294
  function _onRemove(i) {
339
295
  calculations.splice(i, 1);
340
-
341
296
  _onChange3(_objectSpread(_objectSpread({}, value), {}, {
342
297
  calculations: [...calculations]
343
298
  }));
344
299
  }
345
-
346
300
  function onItemChange(i, v) {
347
301
  calculations.splice(i, 1, v);
348
-
349
302
  _onChange3(_objectSpread(_objectSpread({}, value), {}, {
350
303
  calculations: [...calculations]
351
304
  }));
352
305
  }
353
-
354
306
  return _react().default.createElement("div", {
355
307
  className: (0, _css().cx)('node-type-condition-group', (0, _css().css)`
356
308
  position: relative;
@@ -407,7 +359,6 @@ function CalculationGroup({
407
359
  onClick: onAddGroup
408
360
  }, t('Add condition group'))));
409
361
  }
410
-
411
362
  function CalculationConfig({
412
363
  value,
413
364
  onChange: _onChange4
@@ -425,15 +376,13 @@ function CalculationConfig({
425
376
  }))
426
377
  });
427
378
  }
428
-
429
379
  var _default = {
430
380
  title: `{{t("Condition", { ns: "${_locale.NAMESPACE}" })}}`,
431
381
  type: 'condition',
432
382
  group: 'control',
433
383
  fieldset: {
434
- 'config.rejectOnFalse': {
384
+ rejectOnFalse: {
435
385
  type: 'boolean',
436
- name: 'config.rejectOnFalse',
437
386
  title: `{{t("Mode", { ns: "${_locale.NAMESPACE}" })}}`,
438
387
  'x-decorator': 'FormItem',
439
388
  'x-component': 'Radio.Group',
@@ -448,30 +397,28 @@ var _default = {
448
397
  label: `{{t('Branch into "Yes" and "No"', { ns: "${_locale.NAMESPACE}" })}}`
449
398
  }]
450
399
  },
451
- 'config.engine': {
400
+ engine: {
452
401
  type: 'string',
453
402
  title: `{{t("Calculation engine", { ns: "${_locale.NAMESPACE}" })}}`,
454
- name: 'config.engine',
455
403
  'x-decorator': 'FormItem',
456
404
  'x-component': 'RadioWithTooltip',
457
405
  'x-component-props': {
458
406
  options: [['basic', {
459
407
  label: `{{t("Basic", { ns: "${_locale.NAMESPACE}" })}}`
460
- }], ...Array.from(_client3().default.getEntities())].reduce((result, [value, options]) => result.concat(_objectSpread({
408
+ }], ...Array.from(_client3().evaluators.getEntities())].reduce((result, [value, options]) => result.concat(_objectSpread({
461
409
  value
462
410
  }, options)), [])
463
411
  },
464
412
  required: true,
465
413
  default: 'basic'
466
414
  },
467
- 'config.calculation': {
415
+ calculation: {
468
416
  type: 'string',
469
- name: 'config.calculation',
470
417
  title: `{{t("Condition", { ns: "${_locale.NAMESPACE}" })}}`,
471
418
  'x-decorator': 'FormItem',
472
419
  'x-component': 'CalculationConfig',
473
420
  'x-reactions': {
474
- dependencies: ['config.engine'],
421
+ dependencies: ['engine'],
475
422
  fulfill: {
476
423
  state: {
477
424
  visible: '{{$deps[0] === "basic"}}'
@@ -480,26 +427,21 @@ var _default = {
480
427
  },
481
428
  required: true
482
429
  },
483
- 'config.expression': {
430
+ expression: {
484
431
  type: 'string',
485
432
  title: `{{t("Condition expression", { ns: "${_locale.NAMESPACE}" })}}`,
486
- name: 'config.expression',
487
433
  'x-decorator': 'FormItem',
488
434
  'x-component': 'Variable.TextArea',
489
435
  'x-component-props': {
490
436
  scope: '{{useWorkflowVariableOptions}}'
491
437
  },
492
-
493
438
  ['x-validator'](value, rules, {
494
439
  form
495
440
  }) {
496
441
  const values = form.values;
497
-
498
- const _evaluators$get = _client3().default.get(values.config.engine),
499
- evaluate = _evaluators$get.evaluate;
500
-
501
- const exp = value.trim().replace(/{{([^{}]+)}}/g, '1');
502
-
442
+ const _evaluators$get = _client3().evaluators.get(values.engine),
443
+ evaluate = _evaluators$get.evaluate;
444
+ const exp = value.trim().replace(/{{([^{}]+)}}/g, ' 1 ');
503
445
  try {
504
446
  evaluate(exp);
505
447
  return '';
@@ -507,15 +449,14 @@ var _default = {
507
449
  return (0, _locale.lang)('Expression syntax error');
508
450
  }
509
451
  },
510
-
511
452
  'x-reactions': {
512
- dependencies: ['config.engine'],
453
+ dependencies: ['engine'],
513
454
  fulfill: {
514
455
  state: {
515
456
  visible: '{{$deps[0] !== "basic"}}'
516
457
  },
517
458
  schema: {
518
- description: '{{renderReference($deps[0])}}'
459
+ description: '{{renderEngineReference($deps[0])}}'
519
460
  }
520
461
  }
521
462
  },
@@ -536,16 +477,13 @@ var _default = {
536
477
  rejectOnFalse: false
537
478
  }
538
479
  }],
539
-
540
480
  render(data) {
541
481
  const _useTranslation2 = (0, _reactI18next().useTranslation)(),
542
- t = _useTranslation2.t;
543
-
482
+ t = _useTranslation2.t;
544
483
  const _useFlowContext = (0, _FlowContext.useFlowContext)(),
545
- nodes = _useFlowContext.nodes;
546
-
484
+ nodes = _useFlowContext.nodes;
547
485
  const id = data.id,
548
- rejectOnFalse = data.config.rejectOnFalse;
486
+ rejectOnFalse = data.config.rejectOnFalse;
549
487
  const trueEntry = nodes.find(item => item.upstreamId === id && item.branchIndex === 1);
550
488
  const falseEntry = nodes.find(item => item.upstreamId === id && item.branchIndex === 0);
551
489
  return _react().default.createElement(_.NodeDefaultView, {
@@ -589,9 +527,8 @@ var _default = {
589
527
  className: (0, _css().css)`left: 4em;`
590
528
  }, t('Yes')))));
591
529
  },
592
-
593
530
  scope: {
594
- renderReference: _client3().renderReference,
531
+ renderEngineReference: _renderEngineReference.renderEngineReference,
595
532
  useWorkflowVariableOptions: _variable.useWorkflowVariableOptions
596
533
  },
597
534
  components: {
@@ -5,8 +5,7 @@ declare const _default: {
5
5
  type: string;
6
6
  group: string;
7
7
  fieldset: {
8
- 'config.collection': {
9
- name: string;
8
+ collection: {
10
9
  type: string;
11
10
  title: string;
12
11
  required: boolean;
@@ -17,17 +16,41 @@ declare const _default: {
17
16
  placeholder: string;
18
17
  };
19
18
  };
20
- 'config.params.values': {
19
+ params: {
21
20
  type: string;
22
- title: string;
23
- name: string;
24
- 'x-decorator': string;
25
- 'x-decorator-props': {
26
- labelAlign: string;
27
- className: string;
21
+ properties: {
22
+ values: {
23
+ type: string;
24
+ title: string;
25
+ 'x-decorator': string;
26
+ 'x-decorator-props': {
27
+ labelAlign: string;
28
+ className: string;
29
+ };
30
+ 'x-component': string;
31
+ description: string;
32
+ };
33
+ appends: {
34
+ type: string;
35
+ title: string;
36
+ description: string;
37
+ 'x-decorator': string;
38
+ 'x-component': string;
39
+ 'x-component-props': {
40
+ mode: string;
41
+ placeholder: string;
42
+ filter(field: any): boolean;
43
+ };
44
+ 'x-reactions': {
45
+ dependencies: string[];
46
+ fulfill: {
47
+ state: {
48
+ visible: string;
49
+ };
50
+ };
51
+ }[];
52
+ };
28
53
  };
29
- 'x-component': string;
30
- description: string;
31
54
  };
32
55
  };
33
56
  view: {};
@@ -36,8 +59,9 @@ declare const _default: {
36
59
  };
37
60
  components: {
38
61
  CollectionFieldset: import("react").MemoExoticComponent<import("react").FunctionComponent<Pick<any, string | number | symbol>>>;
62
+ FieldsSelect: import("react").MemoExoticComponent<import("react").FunctionComponent<Pick<any, string | number | symbol>>>;
39
63
  };
40
- getOptions(config: any, types: any): any;
64
+ getOptions(config: any, types: any): import("../variable").VariableOption[];
41
65
  useInitializers(node: any): SchemaInitializerItemOptions | null;
42
66
  initializers: {
43
67
  CollectionFieldInitializers: typeof CollectionFieldInitializers;
@@ -4,45 +4,27 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  function _client() {
9
8
  const data = require("@nocobase/client");
10
-
11
9
  _client = function _client() {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  var _collection = require("../schemas/collection");
19
-
20
15
  var _CollectionFieldset = _interopRequireDefault(require("../components/CollectionFieldset"));
21
-
22
16
  var _locale = require("../locale");
23
-
24
17
  var _CollectionBlockInitializer = require("../components/CollectionBlockInitializer");
25
-
26
18
  var _CollectionFieldInitializers = require("../components/CollectionFieldInitializers");
27
-
28
19
  var _variable = require("../variable");
29
-
20
+ var _FieldsSelect = require("../components/FieldsSelect");
30
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
-
32
- 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; }
33
-
34
- 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; }
35
-
36
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
37
-
38
22
  var _default = {
39
23
  title: `{{t("Create record", { ns: "${_locale.NAMESPACE}" })}}`,
40
24
  type: 'create',
41
25
  group: 'collection',
42
26
  fieldset: {
43
- 'config.collection': _objectSpread(_objectSpread({}, _collection.collection), {}, {
44
- name: 'config.collection'
45
- }),
27
+ collection: _collection.collection,
46
28
  // multiple: {
47
29
  // type: 'boolean',
48
30
  // title: '多条数据',
@@ -53,30 +35,35 @@ var _default = {
53
35
  // disabled: true
54
36
  // }
55
37
  // },
56
- 'config.params.values': _collection.values
38
+ params: {
39
+ type: 'object',
40
+ properties: {
41
+ values: _collection.values,
42
+ appends: _collection.appends
43
+ }
44
+ }
57
45
  },
58
46
  view: {},
59
47
  scope: {
60
48
  useCollectionDataSource: _client().useCollectionDataSource
61
49
  },
62
50
  components: {
63
- CollectionFieldset: _CollectionFieldset.default
51
+ CollectionFieldset: _CollectionFieldset.default,
52
+ FieldsSelect: _FieldsSelect.FieldsSelect
64
53
  },
65
-
66
54
  getOptions(config, types) {
55
+ var _config$params, _config$params$append;
67
56
  return (0, _variable.useCollectionFieldOptions)({
68
57
  collection: config.collection,
69
- types
58
+ types,
59
+ depth: ((_config$params = config.params) === null || _config$params === void 0 ? void 0 : (_config$params$append = _config$params.appends) === null || _config$params$append === void 0 ? void 0 : _config$params$append.length) ? 1 : 0
70
60
  });
71
61
  },
72
-
73
62
  useInitializers(node) {
74
63
  var _node$title;
75
-
76
64
  if (!node.config.collection) {
77
65
  return null;
78
66
  }
79
-
80
67
  return {
81
68
  type: 'item',
82
69
  title: (_node$title = node.title) !== null && _node$title !== void 0 ? _node$title : `#${node.id}`,
@@ -85,7 +72,6 @@ var _default = {
85
72
  dataSource: `{{$jobsMapByNodeId.${node.id}}}`
86
73
  };
87
74
  },
88
-
89
75
  initializers: {
90
76
  CollectionFieldInitializers: _CollectionFieldInitializers.CollectionFieldInitializers
91
77
  }
@@ -4,29 +4,25 @@ declare const _default: {
4
4
  type: string;
5
5
  group: string;
6
6
  fieldset: {
7
- 'config.duration': {
7
+ duration: {
8
8
  type: string;
9
- name: string;
10
9
  title: string;
11
10
  'x-decorator': string;
12
11
  'x-component': string;
13
12
  default: number;
14
13
  required: boolean;
15
14
  };
16
- 'config.endStatus': {
15
+ endStatus: {
17
16
  type: string;
18
- name: string;
19
17
  title: string;
20
18
  'x-decorator': string;
21
19
  'x-component': string;
22
- 'x-component-props': {
23
- placeholder: string;
24
- };
25
20
  enum: {
26
21
  label: string;
27
22
  value: number;
28
23
  }[];
29
24
  required: boolean;
25
+ default: number;
30
26
  };
31
27
  };
32
28
  view: {};
@@ -4,38 +4,28 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _Duration = _interopRequireDefault(require("../components/Duration"));
9
-
10
8
  var _constants = require("../constants");
11
-
12
9
  var _locale = require("../locale");
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  var _default = {
17
12
  title: `{{t("Delay", { ns: "${_locale.NAMESPACE}" })}}`,
18
13
  type: 'delay',
19
14
  group: 'control',
20
15
  fieldset: {
21
- 'config.duration': {
16
+ duration: {
22
17
  type: 'number',
23
- name: 'config.duration',
24
18
  title: `{{t("Duration", { ns: "${_locale.NAMESPACE}" })}}`,
25
19
  'x-decorator': 'FormItem',
26
20
  'x-component': 'Duration',
27
21
  default: 60000,
28
22
  required: true
29
23
  },
30
- 'config.endStatus': {
24
+ endStatus: {
31
25
  type: 'number',
32
- name: 'config.endStatus',
33
26
  title: `{{t("End Status", { ns: "${_locale.NAMESPACE}" })}}`,
34
27
  'x-decorator': 'FormItem',
35
- 'x-component': 'Select',
36
- 'x-component-props': {
37
- placeholder: `{{t("Select status", { ns: "${_locale.NAMESPACE}" })}}`
38
- },
28
+ 'x-component': 'Radio.Group',
39
29
  enum: [{
40
30
  label: `{{t("Succeed and continue", { ns: "${_locale.NAMESPACE}" })}}`,
41
31
  value: _constants.JOB_STATUS.RESOLVED
@@ -43,7 +33,8 @@ var _default = {
43
33
  label: `{{t("Fail and exit", { ns: "${_locale.NAMESPACE}" })}}`,
44
34
  value: _constants.JOB_STATUS.FAILED
45
35
  }],
46
- required: true
36
+ required: true,
37
+ default: _constants.JOB_STATUS.RESOLVED
47
38
  }
48
39
  },
49
40
  view: {},
@@ -5,10 +5,9 @@ declare const _default: {
5
5
  type: string;
6
6
  group: string;
7
7
  fieldset: {
8
- 'config.collection': {
8
+ collection: {
9
9
  type: string;
10
10
  title: string;
11
- name: string;
12
11
  required: boolean;
13
12
  'x-reactions': string[];
14
13
  'x-decorator': string;
@@ -17,21 +16,14 @@ declare const _default: {
17
16
  placeholder: string;
18
17
  };
19
18
  };
20
- 'config.params': {
19
+ params: {
21
20
  type: string;
22
- name: string;
23
- title: string;
24
- 'x-decorator': string;
25
21
  properties: {
26
22
  filter: {
23
+ "x-validator"(value: any): string;
27
24
  type: string;
28
25
  title: string;
29
- name: string;
30
26
  'x-decorator': string;
31
- 'x-decorator-props': {
32
- labelAlign: string;
33
- className: string;
34
- };
35
27
  'x-component': string;
36
28
  'x-component-props': {
37
29
  useProps(): {