@nocobase/plugin-workflow 0.11.1-alpha.5 → 0.12.0-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/client.d.ts +2 -3
- package/client.js +1 -1
- package/dist/client/index.js +7802 -0
- package/{lib → dist}/client/nodes/aggregate.d.ts +1 -5
- package/{lib → dist}/client/nodes/create.d.ts +1 -2
- package/{lib → dist}/client/nodes/destroy.d.ts +1 -1
- package/{lib → dist}/client/nodes/query.d.ts +1 -2
- package/{lib → dist}/client/nodes/request.d.ts +1 -2
- package/{lib → dist}/client/nodes/update.d.ts +1 -1
- package/{lib → dist}/client/schemas/collection.d.ts +1 -2
- package/{lib → dist}/client/triggers/collection.d.ts +6 -7
- package/{lib → dist}/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/locale/en-US.js +133 -0
- package/{lib → dist}/locale/es-ES.js +51 -54
- package/dist/locale/fr-FR.js +133 -0
- package/dist/locale/ja-JP.js +91 -0
- package/dist/locale/pt-BR.js +133 -0
- package/dist/locale/ru-RU.js +91 -0
- package/dist/locale/tr-TR.js +91 -0
- package/dist/locale/zh-CN.js +216 -0
- package/dist/node_modules/cron-parser/.eslintrc.json +15 -0
- package/dist/node_modules/cron-parser/.travis.yml +7 -0
- package/dist/node_modules/cron-parser/LICENSE +21 -0
- package/dist/node_modules/cron-parser/component.json +11 -0
- package/dist/node_modules/cron-parser/index.d.ts +1 -0
- package/dist/node_modules/cron-parser/lib/date.js +252 -0
- package/dist/node_modules/cron-parser/lib/expression.js +983 -0
- package/dist/node_modules/cron-parser/lib/field_compactor.js +70 -0
- package/dist/node_modules/cron-parser/lib/field_stringify.js +38 -0
- package/dist/node_modules/cron-parser/lib/parser.js +1 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/build/amd/luxon.js +8489 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/build/cjs-browser/luxon.js +8487 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/build/global/luxon.js +8490 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/build/global/luxon.min.js +1 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/build/node/luxon.js +7522 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/package.json +96 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/datetime.js +2169 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/duration.js +880 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/errors.js +61 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/conversions.js +157 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/diff.js +80 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/digits.js +76 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/english.js +233 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/formats.js +191 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/formatter.js +386 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/invalid.js +14 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/locale.js +482 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/regexParser.js +335 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/tokenParser.js +424 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/util.js +292 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/impl/zoneUtil.js +36 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/info.js +193 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/interval.js +602 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/luxon.js +26 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/luxonFilled.js +13 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/settings.js +137 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zone.js +88 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/IANAZone.js +191 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/fixedOffsetZone.js +94 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/invalidZone.js +53 -0
- package/dist/node_modules/cron-parser/node_modules/luxon/src/zones/localZone.js +63 -0
- package/dist/node_modules/cron-parser/package.json +1 -0
- package/dist/node_modules/cron-parser/test/31_of_month.js +17 -0
- package/dist/node_modules/cron-parser/test/bug.js +29 -0
- package/dist/node_modules/cron-parser/test/crondate.js +16 -0
- package/dist/node_modules/cron-parser/test/crontab.example +7 -0
- package/dist/node_modules/cron-parser/test/empty_around_comma.js +22 -0
- package/dist/node_modules/cron-parser/test/expression.js +1489 -0
- package/dist/node_modules/cron-parser/test/field_compactor.js +250 -0
- package/dist/node_modules/cron-parser/test/field_stringify.js +84 -0
- package/dist/node_modules/cron-parser/test/fields.js +32 -0
- package/dist/node_modules/cron-parser/test/increment_on_first_iteration.js +22 -0
- package/dist/node_modules/cron-parser/test/index-ts3.test-d.ts +133 -0
- package/dist/node_modules/cron-parser/test/index.test-d.ts +138 -0
- package/dist/node_modules/cron-parser/test/leap_year.js +17 -0
- package/dist/node_modules/cron-parser/test/parser.js +46 -0
- package/dist/node_modules/cron-parser/test/parser_crondate_formats.js +145 -0
- package/dist/node_modules/cron-parser/test/parser_day_of_month.js +169 -0
- package/dist/node_modules/cron-parser/test/prev_date.js +32 -0
- package/dist/node_modules/cron-parser/test/stringify.js +402 -0
- package/dist/node_modules/cron-parser/test/timezone.js +422 -0
- package/dist/node_modules/cron-parser/types/common.d.ts +131 -0
- package/dist/node_modules/cron-parser/types/index.d.ts +45 -0
- package/dist/node_modules/cron-parser/types/ts3/index.d.ts +28 -0
- package/dist/node_modules/lru-cache/index-cjs.d.ts +7 -0
- package/dist/node_modules/lru-cache/index-cjs.js +1 -0
- package/dist/node_modules/lru-cache/index.d.ts +807 -0
- package/dist/node_modules/lru-cache/index.js +1334 -0
- package/dist/node_modules/lru-cache/index.min.js +2 -0
- package/dist/node_modules/lru-cache/package.json +1 -0
- package/dist/server/Plugin.js +297 -0
- package/{src/server/Processor.ts → dist/server/Processor.js} +80 -147
- package/dist/server/actions/index.js +49 -0
- package/{src/server/actions/nodes.ts → dist/server/actions/nodes.js} +55 -81
- package/{src/server/actions/workflows.ts → dist/server/actions/workflows.js} +60 -72
- package/dist/server/collections/executions.js +37 -0
- package/dist/server/collections/flow_nodes.js +56 -0
- package/dist/server/collections/jobs.js +33 -0
- package/dist/server/collections/workflows.js +90 -0
- package/{lib → dist}/server/constants.js +5 -8
- package/dist/server/fields/expression-field.js +11 -0
- package/dist/server/fields/index.js +11 -0
- package/dist/server/functions/index.js +13 -0
- package/dist/server/index.js +41 -0
- package/dist/server/instructions/aggregate.js +37 -0
- package/dist/server/instructions/calculation.js +34 -0
- package/dist/server/instructions/condition.js +123 -0
- package/{src/server/instructions/create.ts → dist/server/instructions/create.js} +17 -17
- package/dist/server/instructions/delay.js +87 -0
- package/dist/server/instructions/destroy.js +24 -0
- package/dist/server/instructions/index.js +40 -0
- package/{src/server/instructions/loop.ts → dist/server/instructions/loop.js} +21 -43
- package/{src/server/instructions/manual/actions.ts → dist/server/instructions/manual/actions.js} +18 -44
- package/dist/server/instructions/manual/collecions/jobs.js +21 -0
- package/dist/server/instructions/manual/collecions/users.js +19 -0
- package/dist/server/instructions/manual/collecions/users_jobs.js +52 -0
- package/{src/server/instructions/manual/forms/create.ts → dist/server/instructions/manual/forms/create.js} +8 -8
- package/dist/server/instructions/manual/forms/index.js +16 -0
- package/{src/server/instructions/manual/forms/update.ts → dist/server/instructions/manual/forms/update.js} +8 -8
- package/dist/server/instructions/manual/index.js +160 -0
- package/dist/server/instructions/parallel.js +105 -0
- package/dist/server/instructions/query.js +36 -0
- package/dist/server/instructions/request.js +69 -0
- package/dist/server/instructions/sql.js +26 -0
- package/dist/server/instructions/update.js +24 -0
- package/{src/server/migrations/20221129153547-calculation-variables.ts → dist/server/migrations/20221129153547-calculation-variables.js} +20 -19
- package/dist/server/migrations/20230221032941-change-request-body-type.js +71 -0
- package/dist/server/migrations/20230221071831-calculation-expression.js +94 -0
- package/dist/server/migrations/20230221121203-condition-calculation.js +41 -0
- package/dist/server/migrations/20230221162902-jsonb-to-json.js +52 -0
- package/dist/server/migrations/20230411034722-manual-multi-form.js +252 -0
- package/dist/server/migrations/20230612021134-manual-collection-block.js +126 -0
- package/dist/server/migrations/20230710115902-manual-action-values.js +74 -0
- package/{src/server/triggers/collection.ts → dist/server/triggers/collection.js} +34 -64
- package/dist/server/triggers/index.js +27 -0
- package/{src/server/triggers/schedule.ts → dist/server/triggers/schedule.js} +108 -220
- package/dist/server/types/Execution.js +8 -0
- package/dist/server/types/FlowNode.js +8 -0
- package/dist/server/types/Job.js +8 -0
- package/dist/server/types/Workflow.js +8 -0
- package/dist/server/types/index.js +2 -0
- package/{lib → dist}/server/utils.js +6 -8
- package/package.json +26 -37
- package/server.d.ts +2 -3
- package/server.js +1 -1
- package/lib/client/AddButton.js +0 -161
- package/lib/client/Branch.js +0 -50
- package/lib/client/CanvasContent.js +0 -51
- package/lib/client/ExecutionCanvas.js +0 -218
- package/lib/client/ExecutionLink.js +0 -48
- package/lib/client/ExecutionPage.js +0 -68
- package/lib/client/ExecutionResourceProvider.js +0 -48
- package/lib/client/FlowContext.js +0 -21
- package/lib/client/WorkflowCanvas.js +0 -300
- package/lib/client/WorkflowLink.js +0 -48
- package/lib/client/WorkflowPage.js +0 -70
- package/lib/client/WorkflowProvider.js +0 -100
- package/lib/client/components/CollectionBlockInitializer.js +0 -103
- package/lib/client/components/CollectionFieldset.js +0 -198
- package/lib/client/components/Duration.js +0 -72
- package/lib/client/components/DynamicExpression.js +0 -117
- package/lib/client/components/FieldsSelect.js +0 -72
- package/lib/client/components/FilterDynamicComponent.js +0 -34
- package/lib/client/components/NodeDescription.js +0 -73
- package/lib/client/components/NullRender.js +0 -9
- package/lib/client/components/OpenDrawer.js +0 -68
- package/lib/client/components/RadioWithTooltip.js +0 -65
- package/lib/client/components/ValueBlock.js +0 -103
- package/lib/client/components/renderEngineReference.js +0 -49
- package/lib/client/constants.js +0 -126
- package/lib/client/index.js +0 -121
- package/lib/client/interfaces/expression.js +0 -38
- package/lib/client/locale/index.js +0 -42
- package/lib/client/nodes/aggregate.js +0 -353
- package/lib/client/nodes/calculation.js +0 -292
- package/lib/client/nodes/condition.js +0 -531
- package/lib/client/nodes/create.js +0 -110
- package/lib/client/nodes/delay.js +0 -47
- package/lib/client/nodes/destroy.js +0 -49
- package/lib/client/nodes/index.js +0 -550
- package/lib/client/nodes/loop.js +0 -171
- package/lib/client/nodes/manual/AssigneesSelect.js +0 -56
- package/lib/client/nodes/manual/DetailsBlockProvider.js +0 -106
- package/lib/client/nodes/manual/FormBlockInitializer.js +0 -107
- package/lib/client/nodes/manual/FormBlockProvider.js +0 -113
- package/lib/client/nodes/manual/ModeConfig.js +0 -126
- package/lib/client/nodes/manual/SchemaConfig.js +0 -468
- package/lib/client/nodes/manual/WorkflowTodo.js +0 -642
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +0 -60
- package/lib/client/nodes/manual/forms/create.js +0 -111
- package/lib/client/nodes/manual/forms/custom.js +0 -428
- package/lib/client/nodes/manual/forms/update.js +0 -168
- package/lib/client/nodes/manual/index.js +0 -168
- package/lib/client/nodes/manual/utils.js +0 -31
- package/lib/client/nodes/parallel.js +0 -162
- package/lib/client/nodes/query.js +0 -112
- package/lib/client/nodes/request.js +0 -225
- package/lib/client/nodes/sql.js +0 -61
- package/lib/client/nodes/update.js +0 -127
- package/lib/client/schemas/collection.js +0 -93
- package/lib/client/schemas/executions.js +0 -190
- package/lib/client/schemas/workflows.js +0 -397
- package/lib/client/style.js +0 -350
- package/lib/client/triggers/collection.js +0 -188
- package/lib/client/triggers/index.js +0 -356
- package/lib/client/triggers/schedule/EndsByField.js +0 -71
- package/lib/client/triggers/schedule/OnField.js +0 -117
- package/lib/client/triggers/schedule/RepeatField.js +0 -155
- package/lib/client/triggers/schedule/ScheduleConfig.js +0 -251
- package/lib/client/triggers/schedule/constants.js +0 -11
- package/lib/client/triggers/schedule/index.js +0 -101
- package/lib/client/triggers/schedule/locale/Cron.zh-CN.js +0 -48
- package/lib/client/utils.js +0 -59
- package/lib/client/variable.js +0 -319
- package/lib/index.js +0 -13
- package/lib/locale/en-US.js +0 -136
- package/lib/locale/fr-FR.js +0 -136
- package/lib/locale/ja-JP.js +0 -94
- package/lib/locale/pt-BR.js +0 -136
- package/lib/locale/ru-RU.js +0 -94
- package/lib/locale/tr-TR.js +0 -94
- package/lib/locale/zh-CN.js +0 -219
- package/lib/server/Plugin.js +0 -382
- package/lib/server/Processor.js +0 -394
- package/lib/server/actions/index.js +0 -30
- package/lib/server/actions/nodes.js +0 -269
- package/lib/server/actions/workflows.js +0 -273
- package/lib/server/collections/executions.js +0 -33
- package/lib/server/collections/flow_nodes.js +0 -53
- package/lib/server/collections/jobs.js +0 -30
- package/lib/server/collections/workflows.js +0 -76
- package/lib/server/fields/expression-field.js +0 -19
- package/lib/server/fields/index.js +0 -12
- package/lib/server/functions/index.js +0 -26
- package/lib/server/index.js +0 -55
- package/lib/server/instructions/aggregate.js +0 -57
- package/lib/server/instructions/calculation.js +0 -59
- package/lib/server/instructions/condition.js +0 -150
- package/lib/server/instructions/create.js +0 -60
- package/lib/server/instructions/delay.js +0 -118
- package/lib/server/instructions/destroy.js +0 -37
- package/lib/server/instructions/index.js +0 -44
- package/lib/server/instructions/loop.js +0 -107
- package/lib/server/instructions/manual/actions.js +0 -99
- package/lib/server/instructions/manual/collecions/jobs.js +0 -21
- package/lib/server/instructions/manual/collecions/users.js +0 -19
- package/lib/server/instructions/manual/collecions/users_jobs.js +0 -46
- package/lib/server/instructions/manual/forms/create.js +0 -52
- package/lib/server/instructions/manual/forms/index.js +0 -15
- package/lib/server/instructions/manual/forms/update.js +0 -53
- package/lib/server/instructions/manual/index.js +0 -174
- package/lib/server/instructions/parallel.js +0 -128
- package/lib/server/instructions/query.js +0 -53
- package/lib/server/instructions/request.js +0 -99
- package/lib/server/instructions/sql.js +0 -34
- package/lib/server/instructions/update.js +0 -38
- package/lib/server/migrations/20221129153547-calculation-variables.js +0 -92
- package/lib/server/migrations/20230221032941-change-request-body-type.js +0 -90
- package/lib/server/migrations/20230221071831-calculation-expression.js +0 -111
- package/lib/server/migrations/20230221121203-condition-calculation.js +0 -103
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +0 -64
- package/lib/server/migrations/20230411034722-manual-multi-form.js +0 -297
- package/lib/server/migrations/20230612021134-manual-collection-block.js +0 -155
- package/lib/server/migrations/20230710115902-manual-action-values.js +0 -97
- package/lib/server/triggers/collection.js +0 -175
- package/lib/server/triggers/index.js +0 -46
- package/lib/server/triggers/schedule.js +0 -582
- package/lib/server/types/Execution.js +0 -15
- package/lib/server/types/FlowNode.js +0 -15
- package/lib/server/types/Job.js +0 -15
- package/lib/server/types/Workflow.js +0 -15
- package/lib/server/types/index.js +0 -5
- package/src/client/AddButton.tsx +0 -111
- package/src/client/Branch.tsx +0 -37
- package/src/client/CanvasContent.tsx +0 -25
- package/src/client/ExecutionCanvas.tsx +0 -166
- package/src/client/ExecutionLink.tsx +0 -16
- package/src/client/ExecutionPage.tsx +0 -45
- package/src/client/ExecutionResourceProvider.tsx +0 -21
- package/src/client/FlowContext.ts +0 -7
- package/src/client/WorkflowCanvas.tsx +0 -221
- package/src/client/WorkflowLink.tsx +0 -16
- package/src/client/WorkflowPage.tsx +0 -52
- package/src/client/WorkflowProvider.tsx +0 -84
- package/src/client/components/CollectionBlockInitializer.tsx +0 -71
- package/src/client/components/CollectionFieldset.tsx +0 -152
- package/src/client/components/Duration.tsx +0 -45
- package/src/client/components/DynamicExpression.tsx +0 -57
- package/src/client/components/FieldsSelect.tsx +0 -32
- package/src/client/components/FilterDynamicComponent.tsx +0 -15
- package/src/client/components/NodeDescription.tsx +0 -51
- package/src/client/components/NullRender.tsx +0 -3
- package/src/client/components/OpenDrawer.tsx +0 -24
- package/src/client/components/RadioWithTooltip.tsx +0 -38
- package/src/client/components/ValueBlock.tsx +0 -67
- package/src/client/components/renderEngineReference.tsx +0 -30
- package/src/client/constants.tsx +0 -91
- package/src/client/index.tsx +0 -51
- package/src/client/interfaces/expression.tsx +0 -25
- package/src/client/locale/index.ts +0 -18
- package/src/client/nodes/aggregate.tsx +0 -327
- package/src/client/nodes/calculation.tsx +0 -216
- package/src/client/nodes/condition.tsx +0 -463
- package/src/client/nodes/create.tsx +0 -85
- package/src/client/nodes/delay.tsx +0 -37
- package/src/client/nodes/destroy.tsx +0 -34
- package/src/client/nodes/index.tsx +0 -500
- package/src/client/nodes/loop.tsx +0 -144
- package/src/client/nodes/manual/AssigneesSelect.tsx +0 -33
- package/src/client/nodes/manual/DetailsBlockProvider.tsx +0 -80
- package/src/client/nodes/manual/FormBlockInitializer.tsx +0 -69
- package/src/client/nodes/manual/FormBlockProvider.tsx +0 -75
- package/src/client/nodes/manual/ModeConfig.tsx +0 -84
- package/src/client/nodes/manual/SchemaConfig.tsx +0 -509
- package/src/client/nodes/manual/WorkflowTodo.tsx +0 -607
- package/src/client/nodes/manual/WorkflowTodoBlockInitializer.tsx +0 -28
- package/src/client/nodes/manual/forms/create.tsx +0 -92
- package/src/client/nodes/manual/forms/custom.tsx +0 -392
- package/src/client/nodes/manual/forms/update.tsx +0 -134
- package/src/client/nodes/manual/index.tsx +0 -162
- package/src/client/nodes/manual/utils.ts +0 -28
- package/src/client/nodes/parallel.tsx +0 -138
- package/src/client/nodes/query.tsx +0 -88
- package/src/client/nodes/request.tsx +0 -185
- package/src/client/nodes/sql.tsx +0 -37
- package/src/client/nodes/update.tsx +0 -100
- package/src/client/schemas/collection.ts +0 -75
- package/src/client/schemas/executions.tsx +0 -169
- package/src/client/schemas/workflows.ts +0 -364
- package/src/client/style.tsx +0 -350
- package/src/client/triggers/collection.tsx +0 -190
- package/src/client/triggers/index.tsx +0 -311
- package/src/client/triggers/schedule/EndsByField.tsx +0 -40
- package/src/client/triggers/schedule/OnField.tsx +0 -64
- package/src/client/triggers/schedule/RepeatField.tsx +0 -116
- package/src/client/triggers/schedule/ScheduleConfig.tsx +0 -227
- package/src/client/triggers/schedule/constants.ts +0 -4
- package/src/client/triggers/schedule/index.tsx +0 -78
- package/src/client/triggers/schedule/locale/Cron.zh-CN.ts +0 -79
- package/src/client/utils.ts +0 -36
- package/src/client/variable.tsx +0 -318
- package/src/index.ts +0 -1
- package/src/locale/en-US.ts +0 -136
- package/src/locale/es-ES.ts +0 -129
- package/src/locale/fr-FR.ts +0 -137
- package/src/locale/ja-JP.ts +0 -90
- package/src/locale/pt-BR.ts +0 -136
- package/src/locale/ru-RU.ts +0 -90
- package/src/locale/tr-TR.ts +0 -90
- package/src/locale/zh-CN.ts +0 -248
- package/src/server/Plugin.ts +0 -355
- package/src/server/__tests__/Plugin.test.ts +0 -398
- package/src/server/__tests__/Processor.test.ts +0 -474
- package/src/server/__tests__/actions/workflows.test.ts +0 -419
- package/src/server/__tests__/collections/categories.ts +0 -27
- package/src/server/__tests__/collections/comments.ts +0 -24
- package/src/server/__tests__/collections/posts.ts +0 -42
- package/src/server/__tests__/collections/replies.ts +0 -9
- package/src/server/__tests__/collections/tags.ts +0 -15
- package/src/server/__tests__/index.ts +0 -89
- package/src/server/__tests__/instructions/aggregate.test.ts +0 -294
- package/src/server/__tests__/instructions/calculation.test.ts +0 -265
- package/src/server/__tests__/instructions/condition.test.ts +0 -434
- package/src/server/__tests__/instructions/create.test.ts +0 -129
- package/src/server/__tests__/instructions/delay.test.ts +0 -182
- package/src/server/__tests__/instructions/destroy.test.ts +0 -58
- package/src/server/__tests__/instructions/loop.test.ts +0 -331
- package/src/server/__tests__/instructions/manual.test.ts +0 -1173
- package/src/server/__tests__/instructions/parallel.test.ts +0 -445
- package/src/server/__tests__/instructions/query.test.ts +0 -359
- package/src/server/__tests__/instructions/request.test.ts +0 -247
- package/src/server/__tests__/instructions/sql.test.ts +0 -162
- package/src/server/__tests__/instructions/update.test.ts +0 -189
- package/src/server/__tests__/triggers/collection.test.ts +0 -333
- package/src/server/__tests__/triggers/schedule.test.ts +0 -369
- package/src/server/actions/index.ts +0 -25
- package/src/server/collections/executions.ts +0 -35
- package/src/server/collections/flow_nodes.ts +0 -54
- package/src/server/collections/jobs.ts +0 -31
- package/src/server/collections/workflows.ts +0 -88
- package/src/server/constants.ts +0 -26
- package/src/server/fields/expression-field.ts +0 -11
- package/src/server/fields/index.ts +0 -7
- package/src/server/functions/index.ts +0 -16
- package/src/server/index.ts +0 -6
- package/src/server/instructions/aggregate.ts +0 -42
- package/src/server/instructions/calculation.ts +0 -41
- package/src/server/instructions/condition.ts +0 -172
- package/src/server/instructions/delay.ts +0 -105
- package/src/server/instructions/destroy.ts +0 -23
- package/src/server/instructions/index.ts +0 -64
- package/src/server/instructions/manual/collecions/jobs.ts +0 -17
- package/src/server/instructions/manual/collecions/users.ts +0 -15
- package/src/server/instructions/manual/collecions/users_jobs.ts +0 -50
- package/src/server/instructions/manual/forms/index.ts +0 -12
- package/src/server/instructions/manual/index.ts +0 -184
- package/src/server/instructions/parallel.ts +0 -121
- package/src/server/instructions/query.ts +0 -42
- package/src/server/instructions/request.ts +0 -88
- package/src/server/instructions/sql.ts +0 -25
- package/src/server/instructions/update.ts +0 -24
- package/src/server/migrations/20230221032941-change-request-body-type.ts +0 -76
- package/src/server/migrations/20230221071831-calculation-expression.ts +0 -102
- package/src/server/migrations/20230221121203-condition-calculation.ts +0 -82
- package/src/server/migrations/20230221162902-jsonb-to-json.ts +0 -51
- package/src/server/migrations/20230411034722-manual-multi-form.ts +0 -282
- package/src/server/migrations/20230612021134-manual-collection-block.ts +0 -138
- package/src/server/migrations/20230710115902-manual-action-values.ts +0 -78
- package/src/server/triggers/index.ts +0 -22
- package/src/server/types/Execution.ts +0 -26
- package/src/server/types/FlowNode.ts +0 -21
- package/src/server/types/Job.ts +0 -18
- package/src/server/types/Workflow.ts +0 -36
- package/src/server/types/index.ts +0 -4
- package/src/server/utils.ts +0 -17
- /package/{lib → dist}/client/AddButton.d.ts +0 -0
- /package/{lib → dist}/client/Branch.d.ts +0 -0
- /package/{lib → dist}/client/CanvasContent.d.ts +0 -0
- /package/{lib → dist}/client/ExecutionCanvas.d.ts +0 -0
- /package/{lib → dist}/client/ExecutionLink.d.ts +0 -0
- /package/{lib → dist}/client/ExecutionPage.d.ts +0 -0
- /package/{lib → dist}/client/ExecutionResourceProvider.d.ts +0 -0
- /package/{lib → dist}/client/FlowContext.d.ts +0 -0
- /package/{lib → dist}/client/WorkflowCanvas.d.ts +0 -0
- /package/{lib → dist}/client/WorkflowLink.d.ts +0 -0
- /package/{lib → dist}/client/WorkflowPage.d.ts +0 -0
- /package/{lib → dist}/client/WorkflowProvider.d.ts +0 -0
- /package/{lib → dist}/client/components/CollectionBlockInitializer.d.ts +0 -0
- /package/{lib → dist}/client/components/CollectionFieldset.d.ts +0 -0
- /package/{lib → dist}/client/components/Duration.d.ts +0 -0
- /package/{lib → dist}/client/components/DynamicExpression.d.ts +0 -0
- /package/{lib → dist}/client/components/FieldsSelect.d.ts +0 -0
- /package/{lib → dist}/client/components/FilterDynamicComponent.d.ts +0 -0
- /package/{lib → dist}/client/components/NodeDescription.d.ts +0 -0
- /package/{lib → dist}/client/components/NullRender.d.ts +0 -0
- /package/{lib → dist}/client/components/OpenDrawer.d.ts +0 -0
- /package/{lib → dist}/client/components/RadioWithTooltip.d.ts +0 -0
- /package/{lib → dist}/client/components/ValueBlock.d.ts +0 -0
- /package/{lib → dist}/client/components/renderEngineReference.d.ts +0 -0
- /package/{lib → dist}/client/constants.d.ts +0 -0
- /package/{lib → dist}/client/index.d.ts +0 -0
- /package/{lib → dist}/client/interfaces/expression.d.ts +0 -0
- /package/{lib → dist}/client/locale/index.d.ts +0 -0
- /package/{lib → dist}/client/nodes/calculation.d.ts +0 -0
- /package/{lib → dist}/client/nodes/condition.d.ts +0 -0
- /package/{lib → dist}/client/nodes/delay.d.ts +0 -0
- /package/{lib → dist}/client/nodes/index.d.ts +0 -0
- /package/{lib → dist}/client/nodes/loop.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/AssigneesSelect.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/DetailsBlockProvider.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/FormBlockInitializer.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/FormBlockProvider.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/ModeConfig.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/SchemaConfig.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/WorkflowTodo.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/forms/create.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/forms/custom.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/forms/update.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/index.d.ts +0 -0
- /package/{lib → dist}/client/nodes/manual/utils.d.ts +0 -0
- /package/{lib → dist}/client/nodes/parallel.d.ts +0 -0
- /package/{lib → dist}/client/nodes/sql.d.ts +0 -0
- /package/{lib → dist}/client/schemas/executions.d.ts +0 -0
- /package/{lib → dist}/client/schemas/workflows.d.ts +0 -0
- /package/{lib → dist}/client/style.d.ts +0 -0
- /package/{lib → dist}/client/triggers/index.d.ts +0 -0
- /package/{lib → dist}/client/triggers/schedule/EndsByField.d.ts +0 -0
- /package/{lib → dist}/client/triggers/schedule/OnField.d.ts +0 -0
- /package/{lib → dist}/client/triggers/schedule/RepeatField.d.ts +0 -0
- /package/{lib → dist}/client/triggers/schedule/ScheduleConfig.d.ts +0 -0
- /package/{lib → dist}/client/triggers/schedule/constants.d.ts +0 -0
- /package/{lib → dist}/client/triggers/schedule/index.d.ts +0 -0
- /package/{lib → dist}/client/triggers/schedule/locale/Cron.zh-CN.d.ts +0 -0
- /package/{lib → dist}/client/utils.d.ts +0 -0
- /package/{lib → dist}/client/variable.d.ts +0 -0
- /package/{lib → dist}/locale/en-US.d.ts +0 -0
- /package/{lib → dist}/locale/es-ES.d.ts +0 -0
- /package/{lib → dist}/locale/fr-FR.d.ts +0 -0
- /package/{lib → dist}/locale/ja-JP.d.ts +0 -0
- /package/{lib → dist}/locale/pt-BR.d.ts +0 -0
- /package/{lib → dist}/locale/ru-RU.d.ts +0 -0
- /package/{lib → dist}/locale/tr-TR.d.ts +0 -0
- /package/{lib → dist}/locale/zh-CN.d.ts +0 -0
- /package/{lib → dist}/server/Plugin.d.ts +0 -0
- /package/{lib → dist}/server/Processor.d.ts +0 -0
- /package/{lib → dist}/server/actions/index.d.ts +0 -0
- /package/{lib → dist}/server/actions/nodes.d.ts +0 -0
- /package/{lib → dist}/server/actions/workflows.d.ts +0 -0
- /package/{lib → dist}/server/collections/executions.d.ts +0 -0
- /package/{lib → dist}/server/collections/flow_nodes.d.ts +0 -0
- /package/{lib → dist}/server/collections/jobs.d.ts +0 -0
- /package/{lib → dist}/server/collections/workflows.d.ts +0 -0
- /package/{lib → dist}/server/constants.d.ts +0 -0
- /package/{lib → dist}/server/fields/expression-field.d.ts +0 -0
- /package/{lib → dist}/server/fields/index.d.ts +0 -0
- /package/{lib → dist}/server/functions/index.d.ts +0 -0
- /package/{lib → dist}/server/index.d.ts +0 -0
- /package/{lib → dist}/server/instructions/aggregate.d.ts +0 -0
- /package/{lib → dist}/server/instructions/calculation.d.ts +0 -0
- /package/{lib → dist}/server/instructions/condition.d.ts +0 -0
- /package/{lib → dist}/server/instructions/create.d.ts +0 -0
- /package/{lib → dist}/server/instructions/delay.d.ts +0 -0
- /package/{lib → dist}/server/instructions/destroy.d.ts +0 -0
- /package/{lib → dist}/server/instructions/index.d.ts +0 -0
- /package/{lib → dist}/server/instructions/loop.d.ts +0 -0
- /package/{lib → dist}/server/instructions/manual/actions.d.ts +0 -0
- /package/{lib → dist}/server/instructions/manual/collecions/jobs.d.ts +0 -0
- /package/{lib → dist}/server/instructions/manual/collecions/users.d.ts +0 -0
- /package/{lib → dist}/server/instructions/manual/collecions/users_jobs.d.ts +0 -0
- /package/{lib → dist}/server/instructions/manual/forms/create.d.ts +0 -0
- /package/{lib → dist}/server/instructions/manual/forms/index.d.ts +0 -0
- /package/{lib → dist}/server/instructions/manual/forms/update.d.ts +0 -0
- /package/{lib → dist}/server/instructions/manual/index.d.ts +0 -0
- /package/{lib → dist}/server/instructions/parallel.d.ts +0 -0
- /package/{lib → dist}/server/instructions/query.d.ts +0 -0
- /package/{lib → dist}/server/instructions/request.d.ts +0 -0
- /package/{lib → dist}/server/instructions/sql.d.ts +0 -0
- /package/{lib → dist}/server/instructions/update.d.ts +0 -0
- /package/{lib → dist}/server/migrations/20221129153547-calculation-variables.d.ts +0 -0
- /package/{lib → dist}/server/migrations/20230221032941-change-request-body-type.d.ts +0 -0
- /package/{lib → dist}/server/migrations/20230221071831-calculation-expression.d.ts +0 -0
- /package/{lib → dist}/server/migrations/20230221121203-condition-calculation.d.ts +0 -0
- /package/{lib → dist}/server/migrations/20230221162902-jsonb-to-json.d.ts +0 -0
- /package/{lib → dist}/server/migrations/20230411034722-manual-multi-form.d.ts +0 -0
- /package/{lib → dist}/server/migrations/20230612021134-manual-collection-block.d.ts +0 -0
- /package/{lib → dist}/server/migrations/20230710115902-manual-action-values.d.ts +0 -0
- /package/{lib → dist}/server/triggers/collection.d.ts +0 -0
- /package/{lib → dist}/server/triggers/index.d.ts +0 -0
- /package/{lib → dist}/server/triggers/schedule.d.ts +0 -0
- /package/{lib → dist}/server/types/Execution.d.ts +0 -0
- /package/{lib → dist}/server/types/FlowNode.d.ts +0 -0
- /package/{lib → dist}/server/types/Job.d.ts +0 -0
- /package/{lib → dist}/server/types/Workflow.d.ts +0 -0
- /package/{lib → dist}/server/types/index.d.ts +0 -0
- /package/{lib → dist}/server/utils.d.ts +0 -0
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { BlockInitializers, SchemaInitializerItemOptions, useCollectionManager, useCompile } from '@nocobase/client';
|
|
2
|
-
|
|
3
|
-
import { CollectionBlockInitializer } from '../../components/CollectionBlockInitializer';
|
|
4
|
-
import { defaultFieldNames, getCollectionFieldOptions } from '../../variable';
|
|
5
|
-
import { NAMESPACE } from '../../locale';
|
|
6
|
-
import { SchemaConfig, SchemaConfigButton } from './SchemaConfig';
|
|
7
|
-
import { ModeConfig } from './ModeConfig';
|
|
8
|
-
import { AssigneesSelect } from './AssigneesSelect';
|
|
9
|
-
|
|
10
|
-
const MULTIPLE_ASSIGNED_MODE = {
|
|
11
|
-
SINGLE: Symbol('single'),
|
|
12
|
-
ALL: Symbol('all'),
|
|
13
|
-
ANY: Symbol('any'),
|
|
14
|
-
ALL_PERCENTAGE: Symbol('all percentage'),
|
|
15
|
-
ANY_PERCENTAGE: Symbol('any percentage'),
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// TODO(optimize): change to register way
|
|
19
|
-
const initializerGroup = BlockInitializers.items.find((group) => group.key === 'media');
|
|
20
|
-
if (!initializerGroup.children.find((item) => item.key === 'workflowTodos')) {
|
|
21
|
-
initializerGroup.children.push({
|
|
22
|
-
key: 'workflowTodos',
|
|
23
|
-
type: 'item',
|
|
24
|
-
title: `{{t("Workflow todos", { ns: "${NAMESPACE}" })}}`,
|
|
25
|
-
component: 'WorkflowTodoBlockInitializer',
|
|
26
|
-
icon: 'CheckSquareOutlined',
|
|
27
|
-
} as any);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default {
|
|
31
|
-
title: `{{t("Manual", { ns: "${NAMESPACE}" })}}`,
|
|
32
|
-
type: 'manual',
|
|
33
|
-
group: 'manual',
|
|
34
|
-
description: `{{t("Could be used for manually submitting data, and determine whether to continue or exit. Workflow will generate a todo item for assigned user when it reaches a manual node, and continue processing after user submits the form.", { ns: "${NAMESPACE}" })}}`,
|
|
35
|
-
fieldset: {
|
|
36
|
-
assignees: {
|
|
37
|
-
type: 'array',
|
|
38
|
-
title: `{{t("Assignees", { ns: "${NAMESPACE}" })}}`,
|
|
39
|
-
'x-decorator': 'FormItem',
|
|
40
|
-
'x-component': 'AssigneesSelect',
|
|
41
|
-
'x-component-props': {
|
|
42
|
-
// multiple: true,
|
|
43
|
-
},
|
|
44
|
-
required: true,
|
|
45
|
-
default: [],
|
|
46
|
-
},
|
|
47
|
-
mode: {
|
|
48
|
-
type: 'number',
|
|
49
|
-
title: `{{t("Mode", { ns: "${NAMESPACE}" })}}`,
|
|
50
|
-
'x-decorator': 'FormItem',
|
|
51
|
-
'x-component': 'ModeConfig',
|
|
52
|
-
default: 1,
|
|
53
|
-
'x-reactions': {
|
|
54
|
-
dependencies: ['assignees'],
|
|
55
|
-
fulfill: {
|
|
56
|
-
state: {
|
|
57
|
-
visible: '{{$deps[0].length > 1}}',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
schema: {
|
|
63
|
-
type: 'void',
|
|
64
|
-
title: `{{t("User interface", { ns: "${NAMESPACE}" })}}`,
|
|
65
|
-
'x-decorator': 'FormItem',
|
|
66
|
-
'x-component': 'SchemaConfigButton',
|
|
67
|
-
properties: {
|
|
68
|
-
schema: {
|
|
69
|
-
type: 'object',
|
|
70
|
-
'x-component': 'SchemaConfig',
|
|
71
|
-
default: null,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
forms: {
|
|
76
|
-
type: 'object',
|
|
77
|
-
default: {},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
view: {},
|
|
81
|
-
scope: {},
|
|
82
|
-
components: {
|
|
83
|
-
SchemaConfigButton,
|
|
84
|
-
SchemaConfig,
|
|
85
|
-
ModeConfig,
|
|
86
|
-
AssigneesSelect,
|
|
87
|
-
},
|
|
88
|
-
useVariables({ id, title, config }, { types, fieldNames = defaultFieldNames }) {
|
|
89
|
-
const compile = useCompile();
|
|
90
|
-
const { getCollectionFields } = useCollectionManager();
|
|
91
|
-
const formKeys = Object.keys(config.forms ?? {});
|
|
92
|
-
if (!formKeys.length) {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const options = formKeys
|
|
97
|
-
.map((formKey) => {
|
|
98
|
-
const form = config.forms[formKey];
|
|
99
|
-
|
|
100
|
-
const fieldsOptions = getCollectionFieldOptions({
|
|
101
|
-
fields: form.collection?.fields,
|
|
102
|
-
collection: form.collection,
|
|
103
|
-
types,
|
|
104
|
-
compile,
|
|
105
|
-
getCollectionFields,
|
|
106
|
-
});
|
|
107
|
-
const label = compile(form.title) || formKey;
|
|
108
|
-
return fieldsOptions.length
|
|
109
|
-
? {
|
|
110
|
-
key: formKey,
|
|
111
|
-
value: formKey,
|
|
112
|
-
label,
|
|
113
|
-
title: label,
|
|
114
|
-
children: fieldsOptions,
|
|
115
|
-
}
|
|
116
|
-
: null;
|
|
117
|
-
})
|
|
118
|
-
.filter(Boolean);
|
|
119
|
-
|
|
120
|
-
return options.length
|
|
121
|
-
? {
|
|
122
|
-
[fieldNames.value]: `${id}`,
|
|
123
|
-
[fieldNames.label]: title,
|
|
124
|
-
[fieldNames.children]: options,
|
|
125
|
-
}
|
|
126
|
-
: null;
|
|
127
|
-
},
|
|
128
|
-
useInitializers(node): SchemaInitializerItemOptions | null {
|
|
129
|
-
const { getCollection } = useCollectionManager();
|
|
130
|
-
const formKeys = Object.keys(node.config.forms ?? {});
|
|
131
|
-
if (!formKeys.length || node.config.mode) {
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const forms = formKeys
|
|
136
|
-
.map((formKey) => {
|
|
137
|
-
const form = node.config.forms[formKey];
|
|
138
|
-
const { fields = [] } = getCollection(form.collection);
|
|
139
|
-
|
|
140
|
-
return fields.length
|
|
141
|
-
? ({
|
|
142
|
-
type: 'item',
|
|
143
|
-
title: form.title ?? formKey,
|
|
144
|
-
component: CollectionBlockInitializer,
|
|
145
|
-
collection: form.collection,
|
|
146
|
-
dataSource: `{{$jobsMapByNodeId.${node.id}.${formKey}}}`,
|
|
147
|
-
} as SchemaInitializerItemOptions)
|
|
148
|
-
: null;
|
|
149
|
-
})
|
|
150
|
-
.filter(Boolean);
|
|
151
|
-
|
|
152
|
-
return forms.length
|
|
153
|
-
? {
|
|
154
|
-
key: 'forms',
|
|
155
|
-
type: 'subMenu',
|
|
156
|
-
title: node.title,
|
|
157
|
-
children: forms,
|
|
158
|
-
}
|
|
159
|
-
: null;
|
|
160
|
-
},
|
|
161
|
-
initializers: {},
|
|
162
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export function traverseSchema(schema, fn) {
|
|
2
|
-
fn(schema);
|
|
3
|
-
if (schema.properties) {
|
|
4
|
-
Object.keys(schema.properties).forEach((key) => {
|
|
5
|
-
traverseSchema(schema.properties[key], fn);
|
|
6
|
-
});
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function findSchema(schema, filter, onlyLeaf = false) {
|
|
11
|
-
const result = [];
|
|
12
|
-
|
|
13
|
-
if (!schema) {
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (filter(schema) && (!onlyLeaf || !schema.properties)) {
|
|
18
|
-
result.push(schema);
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (schema.properties) {
|
|
23
|
-
Object.keys(schema.properties).forEach((key) => {
|
|
24
|
-
result.push(...findSchema(schema.properties[key], filter));
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return result;
|
|
28
|
-
}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { PlusOutlined } from '@ant-design/icons';
|
|
2
|
-
import { css, cx } from '@nocobase/client';
|
|
3
|
-
import { Button, Tooltip } from 'antd';
|
|
4
|
-
import React, { useState } from 'react';
|
|
5
|
-
import { NodeDefaultView } from '.';
|
|
6
|
-
import { Branch } from '../Branch';
|
|
7
|
-
import { useFlowContext } from '../FlowContext';
|
|
8
|
-
import { RadioWithTooltip } from '../components/RadioWithTooltip';
|
|
9
|
-
import { NAMESPACE, lang } from '../locale';
|
|
10
|
-
import useStyles from '../style';
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
title: `{{t("Parallel branch", { ns: "${NAMESPACE}" })}}`,
|
|
14
|
-
type: 'parallel',
|
|
15
|
-
group: 'control',
|
|
16
|
-
description: `{{t("Run multiple branch processes in parallel.", { ns: "${NAMESPACE}" })}}`,
|
|
17
|
-
fieldset: {
|
|
18
|
-
mode: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
title: `{{t("Mode", { ns: "${NAMESPACE}" })}}`,
|
|
21
|
-
'x-decorator': 'FormItem',
|
|
22
|
-
'x-component': 'RadioWithTooltip',
|
|
23
|
-
'x-component-props': {
|
|
24
|
-
options: [
|
|
25
|
-
{
|
|
26
|
-
value: 'all',
|
|
27
|
-
label: `{{t('All succeeded', { ns: "${NAMESPACE}" })}}`,
|
|
28
|
-
tooltip: `{{t('Continue after all branches succeeded', { ns: "${NAMESPACE}" })}}`,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
value: 'any',
|
|
32
|
-
label: `{{t('Any succeeded', { ns: "${NAMESPACE}" })}}`,
|
|
33
|
-
tooltip: `{{t('Continue after any branch succeeded', { ns: "${NAMESPACE}" })}}`,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
value: 'race',
|
|
37
|
-
label: `{{t('Any succeeded or failed', { ns: "${NAMESPACE}" })}}`,
|
|
38
|
-
tooltip: `{{t('Continue after any branch succeeded, or exit after any branch failed.', { ns: "${NAMESPACE}" })}}`,
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
default: 'all',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
view: {},
|
|
46
|
-
component: function Component({ data }) {
|
|
47
|
-
const { styles } = useStyles();
|
|
48
|
-
const {
|
|
49
|
-
id,
|
|
50
|
-
config: { mode },
|
|
51
|
-
} = data;
|
|
52
|
-
const { workflow, nodes } = useFlowContext();
|
|
53
|
-
const branches = nodes
|
|
54
|
-
.reduce((result, node) => {
|
|
55
|
-
if (node.upstreamId === id && node.branchIndex != null) {
|
|
56
|
-
return result.concat(node);
|
|
57
|
-
}
|
|
58
|
-
return result;
|
|
59
|
-
}, [])
|
|
60
|
-
.sort((a, b) => a.branchIndex - b.branchIndex);
|
|
61
|
-
const [branchCount, setBranchCount] = useState(Math.max(2, branches.length));
|
|
62
|
-
|
|
63
|
-
const tempBranches = Array(Math.max(0, branchCount - branches.length)).fill(null);
|
|
64
|
-
const lastBranchHead = branches[branches.length - 1];
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<NodeDefaultView data={data}>
|
|
68
|
-
<div className={cx(styles.nodeSubtreeClass)}>
|
|
69
|
-
<div className={cx(styles.branchBlockClass)}>
|
|
70
|
-
{branches.map((branch) => (
|
|
71
|
-
<Branch key={branch.id} from={data} entry={branch} branchIndex={branch.branchIndex} />
|
|
72
|
-
))}
|
|
73
|
-
{tempBranches.map((_, i) => (
|
|
74
|
-
<Branch
|
|
75
|
-
key={`temp_${branches.length + i}`}
|
|
76
|
-
from={data}
|
|
77
|
-
branchIndex={(lastBranchHead ? lastBranchHead.branchIndex : 0) + i + 1}
|
|
78
|
-
controller={
|
|
79
|
-
branches.length + i > 1 ? (
|
|
80
|
-
<div
|
|
81
|
-
className={css`
|
|
82
|
-
padding-top: 2em;
|
|
83
|
-
|
|
84
|
-
> button {
|
|
85
|
-
.anticon {
|
|
86
|
-
transform: rotate(45deg);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
`}
|
|
90
|
-
>
|
|
91
|
-
<Button
|
|
92
|
-
shape="circle"
|
|
93
|
-
icon={<PlusOutlined />}
|
|
94
|
-
onClick={() => setBranchCount(branchCount - 1)}
|
|
95
|
-
disabled={workflow.executed}
|
|
96
|
-
/>
|
|
97
|
-
</div>
|
|
98
|
-
) : null
|
|
99
|
-
}
|
|
100
|
-
/>
|
|
101
|
-
))}
|
|
102
|
-
</div>
|
|
103
|
-
<div
|
|
104
|
-
className={css`
|
|
105
|
-
position: relative;
|
|
106
|
-
height: 2em;
|
|
107
|
-
`}
|
|
108
|
-
>
|
|
109
|
-
<Tooltip
|
|
110
|
-
title={lang('Add branch')}
|
|
111
|
-
className={css`
|
|
112
|
-
visibility: ${workflow.executed ? 'hidden' : 'visible'};
|
|
113
|
-
`}
|
|
114
|
-
>
|
|
115
|
-
<Button
|
|
116
|
-
icon={<PlusOutlined />}
|
|
117
|
-
className={css`
|
|
118
|
-
position: absolute;
|
|
119
|
-
top: calc(50% - 1px);
|
|
120
|
-
transform: translateX(-50%) rotate(45deg);
|
|
121
|
-
|
|
122
|
-
.anticon {
|
|
123
|
-
transform: rotate(-45deg);
|
|
124
|
-
}
|
|
125
|
-
`}
|
|
126
|
-
onClick={() => setBranchCount(branchCount + 1)}
|
|
127
|
-
disabled={workflow.executed}
|
|
128
|
-
/>
|
|
129
|
-
</Tooltip>
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
</NodeDefaultView>
|
|
133
|
-
);
|
|
134
|
-
},
|
|
135
|
-
components: {
|
|
136
|
-
RadioWithTooltip,
|
|
137
|
-
},
|
|
138
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { SchemaInitializerItemOptions, useCollectionDataSource, useCollectionManager, useCompile } from '@nocobase/client';
|
|
2
|
-
|
|
3
|
-
import { appends, collection, filter } from '../schemas/collection';
|
|
4
|
-
import { NAMESPACE } from '../locale';
|
|
5
|
-
import { CollectionBlockInitializer } from '../components/CollectionBlockInitializer';
|
|
6
|
-
import { FilterDynamicComponent } from '../components/FilterDynamicComponent';
|
|
7
|
-
import { getCollectionFieldOptions } from '../variable';
|
|
8
|
-
import { FieldsSelect } from '../components/FieldsSelect';
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
title: `{{t("Query record", { ns: "${NAMESPACE}" })}}`,
|
|
12
|
-
type: 'query',
|
|
13
|
-
group: 'collection',
|
|
14
|
-
description: `{{t("Query records from a collection. You can use variables from upstream nodes as query conditions.", { ns: "${NAMESPACE}" })}}`,
|
|
15
|
-
fieldset: {
|
|
16
|
-
collection,
|
|
17
|
-
multiple: {
|
|
18
|
-
type: 'boolean',
|
|
19
|
-
title: `{{t("Allow multiple records as result", { ns: "${NAMESPACE}" })}}`,
|
|
20
|
-
'x-decorator': 'FormItem',
|
|
21
|
-
'x-component': 'Checkbox',
|
|
22
|
-
description: `{{t("If checked, when there are multiple records in the query result, an array will be returned as the result, which can be operated on one by one using a loop node. Otherwise, only one record will be returned.", { ns: "${NAMESPACE}" })}}`,
|
|
23
|
-
},
|
|
24
|
-
params: {
|
|
25
|
-
type: 'object',
|
|
26
|
-
properties: {
|
|
27
|
-
filter,
|
|
28
|
-
appends,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
failOnEmpty: {
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
title: `{{t("Exit when query result is null", { ns: "${NAMESPACE}" })}}`,
|
|
34
|
-
'x-decorator': 'FormItem',
|
|
35
|
-
'x-component': 'Checkbox',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
view: {},
|
|
39
|
-
scope: {
|
|
40
|
-
useCollectionDataSource,
|
|
41
|
-
},
|
|
42
|
-
components: {
|
|
43
|
-
FilterDynamicComponent,
|
|
44
|
-
},
|
|
45
|
-
useVariables({ id, title, config }, options) {
|
|
46
|
-
const compile = useCompile();
|
|
47
|
-
const { getCollectionFields } = useCollectionManager();
|
|
48
|
-
// const depth = config?.params?.appends?.length
|
|
49
|
-
// ? config?.params?.appends.reduce((max, item) => Math.max(max, item.split('.').length), 1)
|
|
50
|
-
// : 0;
|
|
51
|
-
const name = `${id}`;
|
|
52
|
-
const [result] = getCollectionFieldOptions({
|
|
53
|
-
// collection: config.collection,
|
|
54
|
-
...options,
|
|
55
|
-
fields: [
|
|
56
|
-
{
|
|
57
|
-
collectionName: config.collection,
|
|
58
|
-
name,
|
|
59
|
-
type: 'hasOne',
|
|
60
|
-
target: config.collection,
|
|
61
|
-
uiSchema: {
|
|
62
|
-
title,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
// depth: options?.depth ?? depth,
|
|
67
|
-
appends: [name, ...(config.params?.appends?.map((item) => `${name}.${item}`) || [])],
|
|
68
|
-
compile,
|
|
69
|
-
getCollectionFields,
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
return result;
|
|
73
|
-
},
|
|
74
|
-
useInitializers(node): SchemaInitializerItemOptions | null {
|
|
75
|
-
if (!node.config.collection || node.config.multiple) {
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
type: 'item',
|
|
81
|
-
title: node.title ?? `#${node.id}`,
|
|
82
|
-
component: CollectionBlockInitializer,
|
|
83
|
-
collection: node.config.collection,
|
|
84
|
-
dataSource: `{{$jobsMapByNodeId.${node.id}}}`,
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
initializers: {},
|
|
88
|
-
};
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { ArrayItems } from '@formily/antd-v5';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import { Variable } from '@nocobase/client';
|
|
5
|
-
import { NAMESPACE } from '../locale';
|
|
6
|
-
import { useWorkflowVariableOptions } from '../variable';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: `{{t("HTTP request", { ns: "${NAMESPACE}" })}}`,
|
|
10
|
-
type: 'request',
|
|
11
|
-
group: 'extended',
|
|
12
|
-
description: `{{t("Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.", { ns: "${NAMESPACE}" })}}`,
|
|
13
|
-
fieldset: {
|
|
14
|
-
method: {
|
|
15
|
-
type: 'string',
|
|
16
|
-
required: true,
|
|
17
|
-
title: `{{t("HTTP method", { ns: "${NAMESPACE}" })}}`,
|
|
18
|
-
'x-decorator': 'FormItem',
|
|
19
|
-
'x-component': 'Select',
|
|
20
|
-
'x-component-props': {
|
|
21
|
-
showSearch: false,
|
|
22
|
-
allowClear: false,
|
|
23
|
-
},
|
|
24
|
-
enum: [
|
|
25
|
-
{ label: 'GET', value: 'GET' },
|
|
26
|
-
{ label: 'POST', value: 'POST' },
|
|
27
|
-
{ label: 'PUT', value: 'PUT' },
|
|
28
|
-
{ label: 'PATCH', value: 'PATCH' },
|
|
29
|
-
{ label: 'DELETE', value: 'DELETE' },
|
|
30
|
-
],
|
|
31
|
-
default: 'POST',
|
|
32
|
-
},
|
|
33
|
-
url: {
|
|
34
|
-
type: 'string',
|
|
35
|
-
required: true,
|
|
36
|
-
title: `{{t("URL", { ns: "${NAMESPACE}" })}}`,
|
|
37
|
-
'x-decorator': 'FormItem',
|
|
38
|
-
'x-decorator-props': {},
|
|
39
|
-
'x-component': 'Input',
|
|
40
|
-
'x-component-props': {
|
|
41
|
-
placeholder: 'https://www.nocobase.com',
|
|
42
|
-
className: 'full-width',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
headers: {
|
|
46
|
-
type: 'array',
|
|
47
|
-
'x-component': 'ArrayItems',
|
|
48
|
-
'x-decorator': 'FormItem',
|
|
49
|
-
title: `{{t("Headers", { ns: "${NAMESPACE}" })}}`,
|
|
50
|
-
description: `{{t('"Content-Type" only support "application/json", and no need to specify', { ns: "${NAMESPACE}" })}}`,
|
|
51
|
-
items: {
|
|
52
|
-
type: 'object',
|
|
53
|
-
properties: {
|
|
54
|
-
space: {
|
|
55
|
-
type: 'void',
|
|
56
|
-
'x-component': 'Space',
|
|
57
|
-
properties: {
|
|
58
|
-
name: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
'x-decorator': 'FormItem',
|
|
61
|
-
'x-component': 'Input',
|
|
62
|
-
'x-component-props': {
|
|
63
|
-
placeholder: `{{t("Name")}}`,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
value: {
|
|
67
|
-
type: 'string',
|
|
68
|
-
'x-decorator': 'FormItem',
|
|
69
|
-
'x-component': 'Variable.Input',
|
|
70
|
-
'x-component-props': {
|
|
71
|
-
scope: '{{useWorkflowVariableOptions()}}',
|
|
72
|
-
useTypedConstant: true,
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
remove: {
|
|
76
|
-
type: 'void',
|
|
77
|
-
'x-decorator': 'FormItem',
|
|
78
|
-
'x-component': 'ArrayItems.Remove',
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
properties: {
|
|
85
|
-
add: {
|
|
86
|
-
type: 'void',
|
|
87
|
-
title: `{{t("Add request header", { ns: "${NAMESPACE}" })}}`,
|
|
88
|
-
'x-component': 'ArrayItems.Addition',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
params: {
|
|
93
|
-
type: 'array',
|
|
94
|
-
'x-component': 'ArrayItems',
|
|
95
|
-
'x-decorator': 'FormItem',
|
|
96
|
-
title: `{{t("Parameters", { ns: "${NAMESPACE}" })}}`,
|
|
97
|
-
items: {
|
|
98
|
-
type: 'object',
|
|
99
|
-
properties: {
|
|
100
|
-
space: {
|
|
101
|
-
type: 'void',
|
|
102
|
-
'x-component': 'Space',
|
|
103
|
-
properties: {
|
|
104
|
-
name: {
|
|
105
|
-
type: 'string',
|
|
106
|
-
'x-decorator': 'FormItem',
|
|
107
|
-
'x-component': 'Input',
|
|
108
|
-
'x-component-props': {
|
|
109
|
-
placeholder: `{{t("Name")}}`,
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
value: {
|
|
113
|
-
type: 'string',
|
|
114
|
-
'x-decorator': 'FormItem',
|
|
115
|
-
'x-component': 'Variable.Input',
|
|
116
|
-
'x-component-props': {
|
|
117
|
-
scope: '{{useWorkflowVariableOptions()}}',
|
|
118
|
-
useTypedConstant: true,
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
remove: {
|
|
122
|
-
type: 'void',
|
|
123
|
-
'x-decorator': 'FormItem',
|
|
124
|
-
'x-component': 'ArrayItems.Remove',
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
properties: {
|
|
131
|
-
add: {
|
|
132
|
-
type: 'void',
|
|
133
|
-
title: `{{t("Add parameter", { ns: "${NAMESPACE}" })}}`,
|
|
134
|
-
'x-component': 'ArrayItems.Addition',
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
data: {
|
|
139
|
-
type: 'string',
|
|
140
|
-
title: `{{t("Body", { ns: "${NAMESPACE}" })}}`,
|
|
141
|
-
'x-decorator': 'FormItem',
|
|
142
|
-
'x-decorator-props': {},
|
|
143
|
-
'x-component': 'RequestBody',
|
|
144
|
-
'x-component-props': {
|
|
145
|
-
changeOnSelect: true,
|
|
146
|
-
autoSize: {
|
|
147
|
-
minRows: 10,
|
|
148
|
-
},
|
|
149
|
-
placeholder: `{{t("Input request data", { ns: "${NAMESPACE}" })}}`,
|
|
150
|
-
className: 'full-width',
|
|
151
|
-
},
|
|
152
|
-
description: `{{t("Only support standard JSON data", { ns: "${NAMESPACE}" })}}`,
|
|
153
|
-
},
|
|
154
|
-
timeout: {
|
|
155
|
-
type: 'number',
|
|
156
|
-
title: `{{t("Timeout config", { ns: "${NAMESPACE}" })}}`,
|
|
157
|
-
'x-decorator': 'FormItem',
|
|
158
|
-
'x-decorator-props': {},
|
|
159
|
-
'x-component': 'InputNumber',
|
|
160
|
-
'x-component-props': {
|
|
161
|
-
addonAfter: `{{t("ms", { ns: "${NAMESPACE}" })}}`,
|
|
162
|
-
min: 1,
|
|
163
|
-
step: 1000,
|
|
164
|
-
defaultValue: 5000,
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
ignoreFail: {
|
|
168
|
-
type: 'boolean',
|
|
169
|
-
title: `{{t("Ignore fail request and continue workflow", { ns: "${NAMESPACE}" })}}`,
|
|
170
|
-
'x-decorator': 'FormItem',
|
|
171
|
-
'x-component': 'Checkbox',
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
view: {},
|
|
175
|
-
scope: {
|
|
176
|
-
useWorkflowVariableOptions,
|
|
177
|
-
},
|
|
178
|
-
components: {
|
|
179
|
-
ArrayItems,
|
|
180
|
-
RequestBody(props) {
|
|
181
|
-
const scope = useWorkflowVariableOptions();
|
|
182
|
-
return <Variable.JSON scope={scope} {...props} />;
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
};
|
package/src/client/nodes/sql.tsx
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Variable, css } from '@nocobase/client';
|
|
4
|
-
|
|
5
|
-
import { NAMESPACE } from '../locale';
|
|
6
|
-
import { useWorkflowVariableOptions } from '../variable';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: `{{t("SQL action", { ns: "${NAMESPACE}" })}}`,
|
|
10
|
-
type: 'sql',
|
|
11
|
-
group: 'extended',
|
|
12
|
-
description: `{{t("Execute a SQL statement in database.", { ns: "${NAMESPACE}" })}}`,
|
|
13
|
-
fieldset: {
|
|
14
|
-
sql: {
|
|
15
|
-
type: 'string',
|
|
16
|
-
required: true,
|
|
17
|
-
title: 'SQL',
|
|
18
|
-
description: `{{t("Usage of SQL query result is not supported yet.", { ns: "${NAMESPACE}" })}}`,
|
|
19
|
-
'x-decorator': 'FormItem',
|
|
20
|
-
'x-component': 'SQLInput',
|
|
21
|
-
'x-component-props': {
|
|
22
|
-
rows: 20,
|
|
23
|
-
className: css`
|
|
24
|
-
font-size: 80%;
|
|
25
|
-
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
26
|
-
`,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
scope: {},
|
|
31
|
-
components: {
|
|
32
|
-
SQLInput(props) {
|
|
33
|
-
const scope = useWorkflowVariableOptions();
|
|
34
|
-
return <Variable.RawTextArea scope={scope} {...props} />;
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|