@tachybase/module-workflow 0.23.8
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/.turbo/turbo-build.log +12 -0
- package/README.md +9 -0
- package/README.zh-CN.md +9 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/Branch.d.ts +9 -0
- package/dist/client/CanvasContent.d.ts +4 -0
- package/dist/client/CanvasContentWrapper.d.ts +4 -0
- package/dist/client/ExecutionCanvas.d.ts +2 -0
- package/dist/client/ExecutionContextProvider.d.ts +7 -0
- package/dist/client/ExecutionLink.d.ts +2 -0
- package/dist/client/ExecutionPage.d.ts +2 -0
- package/dist/client/ExecutionResourceProvider.d.ts +6 -0
- package/dist/client/FlowContext.d.ts +3 -0
- package/dist/client/Plugin.d.ts +39 -0
- package/dist/client/WorkflowCanvas.d.ts +2 -0
- package/dist/client/WorkflowLink.d.ts +2 -0
- package/dist/client/WorkflowPage.d.ts +2 -0
- package/dist/client/WorkflowPane.d.ts +2 -0
- package/dist/client/components/AddNotifiedPerson.d.ts +3 -0
- package/dist/client/components/AutoResizeInput.d.ts +4 -0
- package/dist/client/components/CheckboxGroupWithTooltip.d.ts +7 -0
- package/dist/client/components/CollectionBlockInitializer.d.ts +2 -0
- package/dist/client/components/CollectionFieldset.d.ts +3 -0
- package/dist/client/components/ColumnShowCollection.d.ts +2 -0
- package/dist/client/components/ColumnShowTitle.d.ts +2 -0
- package/dist/client/components/ConfigButtonMessage.d.ts +2 -0
- package/dist/client/components/DetailsBlockProvider.d.ts +6 -0
- package/dist/client/components/DrawerDescription.d.ts +5 -0
- package/dist/client/components/DrawerForm.d.ts +5 -0
- package/dist/client/components/ExecutionStatus.d.ts +5 -0
- package/dist/client/components/ExecutionTime.d.ts +3 -0
- package/dist/client/components/FieldsSelect.d.ts +2 -0
- package/dist/client/components/FilterDynamicComponent.d.ts +6 -0
- package/dist/client/components/GoBackButton.d.ts +2 -0
- package/dist/client/components/OpenDrawer.d.ts +7 -0
- package/dist/client/components/RadioWithTooltip.d.ts +7 -0
- package/dist/client/components/SelectNotifiedPerson.d.ts +2 -0
- package/dist/client/components/ShowNodeTypesInWorkflow.d.ts +2 -0
- package/dist/client/components/SimpleDesigner.d.ts +2 -0
- package/dist/client/components/StatusButton.d.ts +2 -0
- package/dist/client/components/ValueBlock.d.ts +5 -0
- package/dist/client/components/WorkflowLink.d.ts +2 -0
- package/dist/client/components/index.d.ts +15 -0
- package/dist/client/components/renderEngineReference.d.ts +2 -0
- package/dist/client/constants.d.ts +37 -0
- package/dist/client/features/aggregate/AggregateInstruction.d.ts +217 -0
- package/dist/client/features/aggregate/index.d.ts +4 -0
- package/dist/client/features/common/constants.d.ts +3 -0
- package/dist/client/features/delay/DelayInstruction.d.ts +48 -0
- package/dist/client/features/delay/index.d.ts +4 -0
- package/dist/client/features/dynamic-calculation/DynamicCalculation.d.ts +76 -0
- package/dist/client/features/dynamic-calculation/DynamicExpression.d.ts +6 -0
- package/dist/client/features/dynamic-calculation/expression.d.ts +35 -0
- package/dist/client/features/dynamic-calculation/index.d.ts +4 -0
- package/dist/client/features/interceptor/WorkflowTriggerInterceptor.d.ts +100 -0
- package/dist/client/features/interceptor/index.d.ts +4 -0
- package/dist/client/features/js-parse/JSParse.instruction.d.ts +123 -0
- package/dist/client/features/js-parse/index.d.ts +5 -0
- package/dist/client/features/json-parse/JSONParse.instruction.d.ts +119 -0
- package/dist/client/features/json-parse/index.d.ts +5 -0
- package/dist/client/features/loop/LoopInstruction.d.ts +33 -0
- package/dist/client/features/loop/index.d.ts +4 -0
- package/dist/client/features/manual/WorkflowTodo.d.ts +5 -0
- package/dist/client/features/manual/WorkflowTodoBlockInitializer.d.ts +2 -0
- package/dist/client/features/manual/index.d.ts +5 -0
- package/dist/client/features/manual/instruction/AssigneesSelect.d.ts +6 -0
- package/dist/client/features/manual/instruction/FormBlockInitializer.d.ts +2 -0
- package/dist/client/features/manual/instruction/FormBlockProvider.d.ts +2 -0
- package/dist/client/features/manual/instruction/ModeConfig.d.ts +5 -0
- package/dist/client/features/manual/instruction/SchemaConfig.d.ts +50 -0
- package/dist/client/features/manual/instruction/createManualFormBlockUISchema.d.ts +57 -0
- package/dist/client/features/manual/instruction/forms/create.d.ts +3 -0
- package/dist/client/features/manual/instruction/forms/custom.d.ts +5 -0
- package/dist/client/features/manual/instruction/forms/update.d.ts +3 -0
- package/dist/client/features/manual/instruction/index.d.ts +91 -0
- package/dist/client/features/manual/instruction/utils.d.ts +1 -0
- package/dist/client/features/notice/common/flowNodes.collection.d.ts +38 -0
- package/dist/client/features/notice/common/notice.collection.d.ts +127 -0
- package/dist/client/features/notice/common/workflow.collection.d.ts +30 -0
- package/dist/client/features/notice/configuration/Notice.instruction.d.ts +76 -0
- package/dist/client/features/notice/configuration/config-items/AddNotifiedPerson.view.d.ts +2 -0
- package/dist/client/features/notice/configuration/config-items/ConfigButtonNotice.view.d.ts +2 -0
- package/dist/client/features/notice/configuration/config-items/SelectNotifiedPerson.view.d.ts +2 -0
- package/dist/client/features/notice/configuration/kit.d.ts +5 -0
- package/dist/client/features/notice/configuration/show-interface/NoticeDetail.block.d.ts +2 -0
- package/dist/client/features/notice/configuration/show-interface/NoticeDetail.initializer.d.ts +2 -0
- package/dist/client/features/notice/configuration/show-interface/NoticeDetail.schema.d.ts +6 -0
- package/dist/client/features/notice/configuration/show-interface/NoticeDetailContainer.schema.d.ts +2 -0
- package/dist/client/features/notice/configuration/show-interface/style.d.ts +3 -0
- package/dist/client/features/notice/configuration/style.d.ts +5 -0
- package/dist/client/features/notice/index.d.ts +5 -0
- package/dist/client/features/notice/locale.d.ts +7 -0
- package/dist/client/features/notice/usage/NoticeBlock.initializer.d.ts +6 -0
- package/dist/client/features/notice/usage/NoticeBlock.provider.d.ts +5 -0
- package/dist/client/features/notice/usage/NoticeCenter.schema.d.ts +2 -0
- package/dist/client/features/notice/usage/column/column.action.d.ts +2 -0
- package/dist/client/features/notice/usage/column/column.node.d.ts +1 -0
- package/dist/client/features/notice/usage/column/column.status.d.ts +8 -0
- package/dist/client/features/notice/usage/column/column.user.d.ts +1 -0
- package/dist/client/features/notice/usage/column/column.workflow.d.ts +2 -0
- package/dist/client/features/notice/usage/kit.d.ts +5 -0
- package/dist/client/features/notice/usage/show-detail/NoticeDetail.provider.d.ts +5 -0
- package/dist/client/features/notice/usage/show-detail/NoticeDetail.schema.d.ts +2 -0
- package/dist/client/features/notice/usage/show-detail/contexts/MyComponent.context.d.ts +9 -0
- package/dist/client/features/notice/usage/show-detail/contexts/WorkflowNotice.context.d.ts +4 -0
- package/dist/client/features/notice/usage/show-detail/hooks/usePropsNoticeDetail.d.ts +3 -0
- package/dist/client/features/omni-trigger/OmniActionTrigger.d.ts +84 -0
- package/dist/client/features/omni-trigger/index.d.ts +5 -0
- package/dist/client/features/omni-trigger/usage/APIRegular.schema.d.ts +2 -0
- package/dist/client/features/omni-trigger/usage/APIRegular.setting.d.ts +2 -0
- package/dist/client/features/omni-trigger/usage/hooks.d.ts +3 -0
- package/dist/client/features/omni-trigger/usage/kit.d.ts +4 -0
- package/dist/client/features/omni-trigger/useFormWorkflowCustomActionProps.d.ts +3 -0
- package/dist/client/features/omni-trigger/useRecordWorkflowCustomTriggerActionProps.d.ts +3 -0
- package/dist/client/features/parallel/ParallelInstruction.d.ts +34 -0
- package/dist/client/features/parallel/index.d.ts +4 -0
- package/dist/client/features/request/RequestInstruction.d.ts +220 -0
- package/dist/client/features/request/index.d.ts +4 -0
- package/dist/client/features/response/index.d.ts +4 -0
- package/dist/client/features/script/Script.instruction.d.ts +198 -0
- package/dist/client/features/script/index.d.ts +5 -0
- package/dist/client/features/sql/SQLInstruction.d.ts +54 -0
- package/dist/client/features/sql/index.d.ts +4 -0
- package/dist/client/features/trigger-instruction/TriggerInstruction.d.ts +93 -0
- package/dist/client/features/trigger-instruction/index.d.ts +0 -0
- package/dist/client/features/trigger-instruction/plugin.d.ts +4 -0
- package/dist/client/features/variables/VariableTargetSelect.d.ts +5 -0
- package/dist/client/features/variables/VariablesInstruction.d.ts +54 -0
- package/dist/client/features/variables/index.d.ts +4 -0
- package/dist/client/features/variables/useStyles.d.ts +3 -0
- package/dist/client/hooks/index.d.ts +3 -0
- package/dist/client/hooks/useGetAriaLabelOfAddButton.d.ts +6 -0
- package/dist/client/hooks/useTriggerWorkflowActionProps.d.ts +6 -0
- package/dist/client/hooks/useWorkflowExecuted.d.ts +2 -0
- package/dist/client/index.d.ts +19 -0
- package/dist/client/index.js +876 -0
- package/dist/client/locale/index.d.ts +4 -0
- package/dist/client/nodes/calculation.d.ts +88 -0
- package/dist/client/nodes/condition.d.ts +108 -0
- package/dist/client/nodes/create.d.ts +68 -0
- package/dist/client/nodes/default-node/Node.context.d.ts +3 -0
- package/dist/client/nodes/default-node/Node.d.ts +4 -0
- package/dist/client/nodes/default-node/Node.style.d.ts +4 -0
- package/dist/client/nodes/default-node/buttons/ArrowDownButton.d.ts +2 -0
- package/dist/client/nodes/default-node/buttons/ArrowUpButton.d.ts +2 -0
- package/dist/client/nodes/default-node/buttons/DragButton.d.ts +2 -0
- package/dist/client/nodes/default-node/buttons/JobButton.d.ts +2 -0
- package/dist/client/nodes/default-node/buttons/JobButton.style.d.ts +5 -0
- package/dist/client/nodes/default-node/buttons/RemoveButton.d.ts +2 -0
- package/dist/client/nodes/default-node/components/AddButton.d.ts +11 -0
- package/dist/client/nodes/default-node/components/AddButton.props.d.ts +11 -0
- package/dist/client/nodes/default-node/components/AddButton.style.d.ts +6 -0
- package/dist/client/nodes/default-node/components/NodeConfig.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodeConfig.provider.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodeConfig.schema.d.ts +15 -0
- package/dist/client/nodes/default-node/components/NodeConfig.view.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodeConfigTitle.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodeDefaultView.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodeDefaultView.style.d.ts +5 -0
- package/dist/client/nodes/default-node/components/NodePoint.d.ts +2 -0
- package/dist/client/nodes/default-node/components/NodePoint.style.d.ts +4 -0
- package/dist/client/nodes/default-node/hooks/useAvailableUpstreams.d.ts +1 -0
- package/dist/client/nodes/default-node/hooks/useFormProviderProps.d.ts +3 -0
- package/dist/client/nodes/default-node/hooks/useUpdateAction.d.ts +3 -0
- package/dist/client/nodes/default-node/hooks/useUpstreamScopes.d.ts +1 -0
- package/dist/client/nodes/default-node/index.d.ts +4 -0
- package/dist/client/nodes/default-node/interface.d.ts +49 -0
- package/dist/client/nodes/destroy.d.ts +46 -0
- package/dist/client/nodes/end.d.ts +25 -0
- package/dist/client/nodes/query.d.ts +221 -0
- package/dist/client/nodes/update.d.ts +82 -0
- package/dist/client/schemas/collection.d.ts +162 -0
- package/dist/client/schemas/executions.d.ts +380 -0
- package/dist/client/schemas/workflows.d.ts +47 -0
- package/dist/client/settings/customizeSubmitToWorkflowActionSettings.d.ts +2 -0
- package/dist/client/style.d.ts +19 -0
- package/dist/client/triggers/collection.d.ts +133 -0
- package/dist/client/triggers/index.d.ts +25 -0
- package/dist/client/triggers/schedule/EndsByField.d.ts +5 -0
- package/dist/client/triggers/schedule/OnField.d.ts +5 -0
- package/dist/client/triggers/schedule/RepeatField.d.ts +5 -0
- package/dist/client/triggers/schedule/ScheduleConfig.d.ts +2 -0
- package/dist/client/triggers/schedule/constants.d.ts +4 -0
- package/dist/client/triggers/schedule/index.d.ts +22 -0
- package/dist/client/triggers/schedule/locale/Cron.zh-CN.d.ts +34 -0
- package/dist/client/utils.d.ts +5 -0
- package/dist/client/variable.d.ts +97 -0
- package/dist/common/constants.d.ts +5 -0
- package/dist/common/constants.js +39 -0
- package/dist/externalVersion.js +25 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +319 -0
- package/dist/locale/es-ES.json +129 -0
- package/dist/locale/fr-FR.json +129 -0
- package/dist/locale/ja-JP.json +87 -0
- package/dist/locale/ko_KR.json +246 -0
- package/dist/locale/pt-BR.json +129 -0
- package/dist/locale/ru-RU.json +87 -0
- package/dist/locale/tr-TR.json +87 -0
- package/dist/locale/zh-CN.json +399 -0
- package/dist/node_modules/@babel/core/LICENSE +22 -0
- package/dist/node_modules/@babel/core/cjs-proxy.cjs +68 -0
- package/dist/node_modules/@babel/core/lib/config/cache-contexts.js +3 -0
- package/dist/node_modules/@babel/core/lib/config/caching.js +261 -0
- package/dist/node_modules/@babel/core/lib/config/config-chain.js +469 -0
- package/dist/node_modules/@babel/core/lib/config/config-descriptors.js +190 -0
- package/dist/node_modules/@babel/core/lib/config/files/configuration.js +287 -0
- package/dist/node_modules/@babel/core/lib/config/files/import.cjs +6 -0
- package/dist/node_modules/@babel/core/lib/config/files/index-browser.js +58 -0
- package/dist/node_modules/@babel/core/lib/config/files/index.js +78 -0
- package/dist/node_modules/@babel/core/lib/config/files/module-types.js +195 -0
- package/dist/node_modules/@babel/core/lib/config/files/package.js +61 -0
- package/dist/node_modules/@babel/core/lib/config/files/plugins.js +229 -0
- package/dist/node_modules/@babel/core/lib/config/files/types.js +3 -0
- package/dist/node_modules/@babel/core/lib/config/files/utils.js +36 -0
- package/dist/node_modules/@babel/core/lib/config/full.js +312 -0
- package/dist/node_modules/@babel/core/lib/config/helpers/config-api.js +84 -0
- package/dist/node_modules/@babel/core/lib/config/helpers/deep-array.js +23 -0
- package/dist/node_modules/@babel/core/lib/config/helpers/environment.js +12 -0
- package/dist/node_modules/@babel/core/lib/config/index.js +93 -0
- package/dist/node_modules/@babel/core/lib/config/item.js +67 -0
- package/dist/node_modules/@babel/core/lib/config/partial.js +158 -0
- package/dist/node_modules/@babel/core/lib/config/pattern-to-regex.js +38 -0
- package/dist/node_modules/@babel/core/lib/config/plugin.js +33 -0
- package/dist/node_modules/@babel/core/lib/config/printer.js +113 -0
- package/dist/node_modules/@babel/core/lib/config/resolve-targets-browser.js +41 -0
- package/dist/node_modules/@babel/core/lib/config/resolve-targets.js +61 -0
- package/dist/node_modules/@babel/core/lib/config/util.js +31 -0
- package/dist/node_modules/@babel/core/lib/config/validation/option-assertions.js +277 -0
- package/dist/node_modules/@babel/core/lib/config/validation/options.js +189 -0
- package/dist/node_modules/@babel/core/lib/config/validation/plugins.js +67 -0
- package/dist/node_modules/@babel/core/lib/config/validation/removed.js +68 -0
- package/dist/node_modules/@babel/core/lib/errors/config-error.js +18 -0
- package/dist/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js +98 -0
- package/dist/node_modules/@babel/core/lib/gensync-utils/async.js +90 -0
- package/dist/node_modules/@babel/core/lib/gensync-utils/fs.js +31 -0
- package/dist/node_modules/@babel/core/lib/gensync-utils/functional.js +58 -0
- package/dist/node_modules/@babel/core/lib/index.js +227 -0
- package/dist/node_modules/@babel/core/lib/parse.js +47 -0
- package/dist/node_modules/@babel/core/lib/parser/index.js +79 -0
- package/dist/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js +339 -0
- package/dist/node_modules/@babel/core/lib/tools/build-external-helpers.js +144 -0
- package/dist/node_modules/@babel/core/lib/transform-ast.js +50 -0
- package/dist/node_modules/@babel/core/lib/transform-file-browser.js +23 -0
- package/dist/node_modules/@babel/core/lib/transform-file.js +40 -0
- package/dist/node_modules/@babel/core/lib/transform.js +49 -0
- package/dist/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js +84 -0
- package/dist/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs +4 -0
- package/dist/node_modules/@babel/core/lib/transformation/file/file.js +214 -0
- package/dist/node_modules/@babel/core/lib/transformation/file/generate.js +84 -0
- package/dist/node_modules/@babel/core/lib/transformation/file/merge-map.js +37 -0
- package/dist/node_modules/@babel/core/lib/transformation/index.js +92 -0
- package/dist/node_modules/@babel/core/lib/transformation/normalize-file.js +129 -0
- package/dist/node_modules/@babel/core/lib/transformation/normalize-opts.js +59 -0
- package/dist/node_modules/@babel/core/lib/transformation/plugin-pass.js +50 -0
- package/dist/node_modules/@babel/core/lib/transformation/util/clone-deep.js +36 -0
- package/dist/node_modules/@babel/core/lib/vendor/import-meta-resolve.js +1043 -0
- package/dist/node_modules/@babel/core/node_modules/.bin/json5 +17 -0
- package/dist/node_modules/@babel/core/node_modules/.bin/parser +17 -0
- package/dist/node_modules/@babel/core/node_modules/.bin/semver +17 -0
- package/dist/node_modules/@babel/core/package.json +1 -0
- package/dist/node_modules/@babel/core/src/config/files/index-browser.ts +113 -0
- package/dist/node_modules/@babel/core/src/config/files/index.ts +29 -0
- package/dist/node_modules/@babel/core/src/config/resolve-targets-browser.ts +40 -0
- package/dist/node_modules/@babel/core/src/config/resolve-targets.ts +56 -0
- package/dist/node_modules/@babel/core/src/transform-file-browser.ts +31 -0
- package/dist/node_modules/@babel/core/src/transform-file.ts +55 -0
- package/dist/node_modules/cron-parser/LICENSE +21 -0
- package/dist/node_modules/cron-parser/lib/date.js +252 -0
- package/dist/node_modules/cron-parser/lib/expression.js +1002 -0
- package/dist/node_modules/cron-parser/lib/field_compactor.js +70 -0
- package/dist/node_modules/cron-parser/lib/field_stringify.js +58 -0
- package/dist/node_modules/cron-parser/lib/parser.js +1 -0
- package/dist/node_modules/cron-parser/package.json +1 -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/form-data/License +19 -0
- package/dist/node_modules/form-data/index.d.ts +62 -0
- package/dist/node_modules/form-data/lib/browser.js +2 -0
- package/dist/node_modules/form-data/lib/form_data.js +14 -0
- package/dist/node_modules/form-data/lib/populate.js +10 -0
- package/dist/node_modules/form-data/package.json +1 -0
- package/dist/node_modules/jsonata/LICENSE +19 -0
- package/dist/node_modules/jsonata/jsonata-es5.js +9875 -0
- package/dist/node_modules/jsonata/jsonata-es5.min.js +1 -0
- package/dist/node_modules/jsonata/jsonata.d.ts +72 -0
- package/dist/node_modules/jsonata/jsonata.js +1 -0
- package/dist/node_modules/jsonata/jsonata.min.js +1 -0
- package/dist/node_modules/jsonata/package.json +1 -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/node_modules/mime-types/LICENSE +23 -0
- package/dist/node_modules/mime-types/index.js +14 -0
- package/dist/node_modules/mime-types/package.json +1 -0
- package/dist/node_modules/qrcode/bin/qrcode +159 -0
- package/dist/node_modules/qrcode/helper/to-sjis-browser.js +2 -0
- package/dist/node_modules/qrcode/helper/to-sjis.js +105 -0
- package/dist/node_modules/qrcode/lib/browser.js +76 -0
- package/dist/node_modules/qrcode/lib/can-promise.js +7 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +83 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +59 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.js +37 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.js +65 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.js +30 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.js +135 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.js +50 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.js +22 -0
- package/dist/node_modules/qrcode/lib/core/format-info.js +29 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.js +69 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.js +54 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.js +234 -0
- package/dist/node_modules/qrcode/lib/core/mode.js +167 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.js +43 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.js +62 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.js +495 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +56 -0
- package/dist/node_modules/qrcode/lib/core/regex.js +31 -0
- package/dist/node_modules/qrcode/lib/core/segments.js +330 -0
- package/dist/node_modules/qrcode/lib/core/utils.js +63 -0
- package/dist/node_modules/qrcode/lib/core/version-check.js +9 -0
- package/dist/node_modules/qrcode/lib/core/version.js +163 -0
- package/dist/node_modules/qrcode/lib/index.js +1 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.js +63 -0
- package/dist/node_modules/qrcode/lib/renderer/png.js +78 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +81 -0
- package/dist/node_modules/qrcode/lib/renderer/svg.js +19 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +85 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal/terminal.js +49 -0
- package/dist/node_modules/qrcode/lib/renderer/terminal.js +9 -0
- package/dist/node_modules/qrcode/lib/renderer/utf8.js +71 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.js +99 -0
- package/dist/node_modules/qrcode/lib/server.js +138 -0
- package/dist/node_modules/qrcode/license +10 -0
- package/dist/node_modules/qrcode/package.json +1 -0
- package/dist/server/Plugin.d.ts +50 -0
- package/dist/server/Plugin.js +498 -0
- package/dist/server/Processor.d.ts +59 -0
- package/dist/server/Processor.js +306 -0
- package/dist/server/actions/executions.d.ts +3 -0
- package/dist/server/actions/executions.js +87 -0
- package/dist/server/actions/index.d.ts +3 -0
- package/dist/server/actions/index.js +59 -0
- package/dist/server/actions/nodes.d.ts +6 -0
- package/dist/server/actions/nodes.js +322 -0
- package/dist/server/actions/workflows.d.ts +10 -0
- package/dist/server/actions/workflows.js +347 -0
- package/dist/server/collections/1-users_jobs.d.ts +2 -0
- package/dist/server/collections/1-users_jobs.js +73 -0
- package/dist/server/collections/2-jobs.d.ts +2 -0
- package/dist/server/collections/2-jobs.js +40 -0
- package/dist/server/collections/3-users.d.ts +2 -0
- package/dist/server/collections/3-users.js +38 -0
- package/dist/server/collections/executions.d.ts +3 -0
- package/dist/server/collections/executions.js +64 -0
- package/dist/server/collections/flow_nodes.d.ts +3 -0
- package/dist/server/collections/flow_nodes.js +78 -0
- package/dist/server/collections/jobs.d.ts +3 -0
- package/dist/server/collections/jobs.js +61 -0
- package/dist/server/collections/workflows.d.ts +2 -0
- package/dist/server/collections/workflows.js +130 -0
- package/dist/server/constants.d.ts +22 -0
- package/dist/server/constants.js +52 -0
- package/dist/server/features/_deprecated-js-parse/JSParse.instruction.d.ts +10 -0
- package/dist/server/features/_deprecated-js-parse/JSParse.instruction.js +100 -0
- package/dist/server/features/_deprecated-js-parse/index.d.ts +1 -0
- package/dist/server/features/_deprecated-js-parse/index.js +33 -0
- package/dist/server/features/_deprecated-js-parse/plugin.d.ts +5 -0
- package/dist/server/features/_deprecated-js-parse/plugin.js +48 -0
- package/dist/server/features/_deprecated-json-parse/JSONParse.instruction.d.ts +11 -0
- package/dist/server/features/_deprecated-json-parse/JSONParse.instruction.js +81 -0
- package/dist/server/features/_deprecated-json-parse/index.d.ts +1 -0
- package/dist/server/features/_deprecated-json-parse/index.js +33 -0
- package/dist/server/features/_deprecated-json-parse/plugin.d.ts +5 -0
- package/dist/server/features/_deprecated-json-parse/plugin.js +48 -0
- package/dist/server/features/aggregate/AggregateInstruction.d.ts +7 -0
- package/dist/server/features/aggregate/AggregateInstruction.js +56 -0
- package/dist/server/features/aggregate/Plugin.d.ts +4 -0
- package/dist/server/features/aggregate/Plugin.js +45 -0
- package/dist/server/features/common/constants.d.ts +4 -0
- package/dist/server/features/common/constants.js +36 -0
- package/dist/server/features/delay/DelayInstruction.d.ts +12 -0
- package/dist/server/features/delay/DelayInstruction.js +106 -0
- package/dist/server/features/delay/Plugin.d.ts +4 -0
- package/dist/server/features/delay/Plugin.js +45 -0
- package/dist/server/features/dynamic-calculation/DynamicCalculation.d.ts +10 -0
- package/dist/server/features/dynamic-calculation/DynamicCalculation.js +62 -0
- package/dist/server/features/dynamic-calculation/Plugin.d.ts +4 -0
- package/dist/server/features/dynamic-calculation/Plugin.js +49 -0
- package/dist/server/features/dynamic-calculation/expression-field.d.ts +7 -0
- package/dist/server/features/dynamic-calculation/expression-field.js +32 -0
- package/dist/server/features/interception/RequestInterceptionTrigger.d.ts +11 -0
- package/dist/server/features/interception/RequestInterceptionTrigger.js +146 -0
- package/dist/server/features/interception/index.d.ts +4 -0
- package/dist/server/features/interception/index.js +35 -0
- package/dist/server/features/loop/LoopInstruction.d.ts +13 -0
- package/dist/server/features/loop/LoopInstruction.js +100 -0
- package/dist/server/features/loop/Plugin.d.ts +4 -0
- package/dist/server/features/loop/Plugin.js +45 -0
- package/dist/server/features/manual/ManualInstruction.d.ts +28 -0
- package/dist/server/features/manual/ManualInstruction.js +152 -0
- package/dist/server/features/manual/Plugin.d.ts +4 -0
- package/dist/server/features/manual/Plugin.js +70 -0
- package/dist/server/features/manual/actions.d.ts +2 -0
- package/dist/server/features/manual/actions.js +104 -0
- package/dist/server/features/manual/forms/create.d.ts +6 -0
- package/dist/server/features/manual/forms/create.js +41 -0
- package/dist/server/features/manual/forms/index.d.ts +6 -0
- package/dist/server/features/manual/forms/index.js +38 -0
- package/dist/server/features/manual/forms/update.d.ts +7 -0
- package/dist/server/features/manual/forms/update.js +41 -0
- package/dist/server/features/notice/NoticeInstruction.d.ts +9 -0
- package/dist/server/features/notice/NoticeInstruction.js +172 -0
- package/dist/server/features/notice/actions.d.ts +3 -0
- package/dist/server/features/notice/actions.js +124 -0
- package/dist/server/features/notice/collections/workflowNotice.d.ts +3 -0
- package/dist/server/features/notice/collections/workflowNotice.js +90 -0
- package/dist/server/features/notice/constants.d.ts +16 -0
- package/dist/server/features/notice/constants.js +44 -0
- package/dist/server/features/notice/index.d.ts +1 -0
- package/dist/server/features/notice/index.js +33 -0
- package/dist/server/features/notice/plugin.d.ts +12 -0
- package/dist/server/features/notice/plugin.js +83 -0
- package/dist/server/features/notice/tools.d.ts +17 -0
- package/dist/server/features/notice/tools.js +163 -0
- package/dist/server/features/omni-trigger/CustomActionTrigger.d.ts +11 -0
- package/dist/server/features/omni-trigger/CustomActionTrigger.js +270 -0
- package/dist/server/features/omni-trigger/Plugin.d.ts +4 -0
- package/dist/server/features/omni-trigger/Plugin.js +45 -0
- package/dist/server/features/omni-trigger/index.d.ts +1 -0
- package/dist/server/features/omni-trigger/index.js +21 -0
- package/dist/server/features/parallel/ParallelInstruction.d.ts +11 -0
- package/dist/server/features/parallel/ParallelInstruction.js +137 -0
- package/dist/server/features/parallel/Plugin.d.ts +4 -0
- package/dist/server/features/parallel/Plugin.js +45 -0
- package/dist/server/features/request/Plugin.d.ts +4 -0
- package/dist/server/features/request/Plugin.js +45 -0
- package/dist/server/features/request/RequestInstruction.d.ts +14 -0
- package/dist/server/features/request/RequestInstruction.js +183 -0
- package/dist/server/features/response/Plugin.d.ts +4 -0
- package/dist/server/features/response/Plugin.js +45 -0
- package/dist/server/features/response/ResponseMessageInstruction.d.ts +7 -0
- package/dist/server/features/response/ResponseMessageInstruction.js +57 -0
- package/dist/server/features/response/index.d.ts +1 -0
- package/dist/server/features/response/index.js +21 -0
- package/dist/server/features/script/index.d.ts +1 -0
- package/dist/server/features/script/index.js +33 -0
- package/dist/server/features/script/plugin.d.ts +5 -0
- package/dist/server/features/script/plugin.js +48 -0
- package/dist/server/features/script/script.instruction.d.ts +10 -0
- package/dist/server/features/script/script.instruction.js +212 -0
- package/dist/server/features/sql/Plugin.d.ts +4 -0
- package/dist/server/features/sql/Plugin.js +45 -0
- package/dist/server/features/sql/SQLInstruction.d.ts +10 -0
- package/dist/server/features/sql/SQLInstruction.js +48 -0
- package/dist/server/features/trigger-instruction/TriggerInstruction.d.ts +15 -0
- package/dist/server/features/trigger-instruction/TriggerInstruction.js +71 -0
- package/dist/server/features/trigger-instruction/flownode-check.d.ts +2 -0
- package/dist/server/features/trigger-instruction/flownode-check.js +114 -0
- package/dist/server/features/trigger-instruction/index.d.ts +0 -0
- package/dist/server/features/trigger-instruction/index.js +0 -0
- package/dist/server/features/trigger-instruction/plugin.d.ts +4 -0
- package/dist/server/features/trigger-instruction/plugin.js +37 -0
- package/dist/server/features/variables/Plugin.d.ts +4 -0
- package/dist/server/features/variables/Plugin.js +45 -0
- package/dist/server/features/variables/VariableInstruction.d.ts +7 -0
- package/dist/server/features/variables/VariableInstruction.js +61 -0
- package/dist/server/features/variables/index.d.ts +1 -0
- package/dist/server/features/variables/index.js +27 -0
- package/dist/server/features/webhook/Plugin.d.ts +4 -0
- package/dist/server/features/webhook/Plugin.js +109 -0
- package/dist/server/features/webhook/index.d.ts +1 -0
- package/dist/server/features/webhook/index.js +27 -0
- package/dist/server/features/webhook/webhooks.d.ts +9 -0
- package/dist/server/features/webhook/webhooks.js +286 -0
- package/dist/server/functions/index.d.ts +9 -0
- package/dist/server/functions/index.js +31 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.js +54 -0
- package/dist/server/instructions/CalculationInstruction.d.ts +17 -0
- package/dist/server/instructions/CalculationInstruction.js +59 -0
- package/dist/server/instructions/ConditionInstruction.d.ts +29 -0
- package/dist/server/instructions/ConditionInstruction.js +160 -0
- package/dist/server/instructions/CreateInstruction.d.ts +10 -0
- package/dist/server/instructions/CreateInstruction.js +175 -0
- package/dist/server/instructions/DestroyInstruction.d.ts +10 -0
- package/dist/server/instructions/DestroyInstruction.js +50 -0
- package/dist/server/instructions/EndInstruction.d.ts +6 -0
- package/dist/server/instructions/EndInstruction.js +47 -0
- package/dist/server/instructions/QueryInstruction.d.ts +13 -0
- package/dist/server/instructions/QueryInstruction.js +78 -0
- package/dist/server/instructions/UpdateInstruction.d.ts +10 -0
- package/dist/server/instructions/UpdateInstruction.js +159 -0
- package/dist/server/instructions/index.d.ts +23 -0
- package/dist/server/instructions/index.js +33 -0
- package/dist/server/migrations/20241118104303-add-initAt.d.ts +6 -0
- package/dist/server/migrations/20241118104303-add-initAt.js +47 -0
- package/dist/server/migrations/20241206122842-add-createdBy.d.ts +6 -0
- package/dist/server/migrations/20241206122842-add-createdBy.js +46 -0
- package/dist/server/migrations/20241220001154-bigInt.d.ts +6 -0
- package/dist/server/migrations/20241220001154-bigInt.js +39 -0
- package/dist/server/triggers/CollectionTrigger.d.ts +14 -0
- package/dist/server/triggers/CollectionTrigger.js +188 -0
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.d.ts +31 -0
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +342 -0
- package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.d.ts +15 -0
- package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +143 -0
- package/dist/server/triggers/ScheduleTrigger/index.d.ts +13 -0
- package/dist/server/triggers/ScheduleTrigger/index.js +74 -0
- package/dist/server/triggers/ScheduleTrigger/utils.d.ts +5 -0
- package/dist/server/triggers/ScheduleTrigger/utils.js +35 -0
- package/dist/server/triggers/index.d.ts +13 -0
- package/dist/server/triggers/index.js +37 -0
- package/dist/server/types/Execution.d.ts +17 -0
- package/dist/server/types/Execution.js +25 -0
- package/dist/server/types/FlowNode.d.ts +16 -0
- package/dist/server/types/FlowNode.js +25 -0
- package/dist/server/types/Job.d.ts +14 -0
- package/dist/server/types/Job.js +25 -0
- package/dist/server/types/Workflow.d.ts +27 -0
- package/dist/server/types/Workflow.js +25 -0
- package/dist/server/types/index.d.ts +4 -0
- package/dist/server/types/index.js +15 -0
- package/dist/server/utils.d.ts +1 -0
- package/dist/server/utils.js +42 -0
- package/dist/swagger/index.d.ts +754 -0
- package/dist/swagger/index.js +798 -0
- package/package.json +63 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var ManualInstruction_exports = {};
|
|
29
|
+
__export(ManualInstruction_exports, {
|
|
30
|
+
default: () => ManualInstruction_default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(ManualInstruction_exports);
|
|
33
|
+
var import_utils = require("@tachybase/utils");
|
|
34
|
+
var import__ = require("../..");
|
|
35
|
+
var import_forms = __toESM(require("./forms"));
|
|
36
|
+
const MULTIPLE_ASSIGNED_MODE = {
|
|
37
|
+
SINGLE: Symbol("single"),
|
|
38
|
+
ALL: Symbol("all"),
|
|
39
|
+
ANY: Symbol("any"),
|
|
40
|
+
ALL_PERCENTAGE: Symbol("all percentage"),
|
|
41
|
+
ANY_PERCENTAGE: Symbol("any percentage")
|
|
42
|
+
};
|
|
43
|
+
const Modes = {
|
|
44
|
+
[MULTIPLE_ASSIGNED_MODE.SINGLE]: {
|
|
45
|
+
getStatus(distribution, assignees) {
|
|
46
|
+
const done = distribution.find((item) => item.status !== import__.JOB_STATUS.PENDING && item.count > 0);
|
|
47
|
+
return done ? done.status : null;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
[MULTIPLE_ASSIGNED_MODE.ALL]: {
|
|
51
|
+
getStatus(distribution, assignees) {
|
|
52
|
+
const resolved = distribution.find((item) => item.status === import__.JOB_STATUS.RESOLVED);
|
|
53
|
+
if (resolved && resolved.count === assignees.length) {
|
|
54
|
+
return import__.JOB_STATUS.RESOLVED;
|
|
55
|
+
}
|
|
56
|
+
const rejected = distribution.find((item) => item.status < import__.JOB_STATUS.PENDING);
|
|
57
|
+
if (rejected && rejected.count) {
|
|
58
|
+
return rejected.status;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
[MULTIPLE_ASSIGNED_MODE.ANY]: {
|
|
64
|
+
getStatus(distribution, assignees) {
|
|
65
|
+
const resolved = distribution.find((item) => item.status === import__.JOB_STATUS.RESOLVED);
|
|
66
|
+
if (resolved && resolved.count) {
|
|
67
|
+
return import__.JOB_STATUS.RESOLVED;
|
|
68
|
+
}
|
|
69
|
+
const rejectedCount = distribution.reduce(
|
|
70
|
+
(count, item) => item.status < import__.JOB_STATUS.PENDING ? count + item.count : count,
|
|
71
|
+
0
|
|
72
|
+
);
|
|
73
|
+
if (rejectedCount === assignees.length) {
|
|
74
|
+
return import__.JOB_STATUS.REJECTED;
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
function getMode(mode) {
|
|
81
|
+
switch (true) {
|
|
82
|
+
case mode === 1:
|
|
83
|
+
return Modes[MULTIPLE_ASSIGNED_MODE.ALL];
|
|
84
|
+
case mode === -1:
|
|
85
|
+
return Modes[MULTIPLE_ASSIGNED_MODE.ANY];
|
|
86
|
+
case mode > 0:
|
|
87
|
+
return Modes[MULTIPLE_ASSIGNED_MODE.ALL_PERCENTAGE];
|
|
88
|
+
case mode < 0:
|
|
89
|
+
return Modes[MULTIPLE_ASSIGNED_MODE.ANY_PERCENTAGE];
|
|
90
|
+
default:
|
|
91
|
+
return Modes[MULTIPLE_ASSIGNED_MODE.SINGLE];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
class ManualInstruction_default extends import__.Instruction {
|
|
95
|
+
constructor(workflow) {
|
|
96
|
+
super(workflow);
|
|
97
|
+
this.workflow = workflow;
|
|
98
|
+
(0, import_forms.default)(this);
|
|
99
|
+
}
|
|
100
|
+
formTypes = new import_utils.Registry();
|
|
101
|
+
async run(node, prevJob, processor) {
|
|
102
|
+
const { mode, ...config } = node.config;
|
|
103
|
+
const assignees = [...new Set(processor.getParsedValue(config.assignees, node.id).flat().filter(Boolean))];
|
|
104
|
+
const job = await processor.saveJob({
|
|
105
|
+
status: import__.JOB_STATUS.PENDING,
|
|
106
|
+
result: mode ? [] : null,
|
|
107
|
+
nodeId: node.id,
|
|
108
|
+
nodeKey: node.key,
|
|
109
|
+
upstreamId: (prevJob == null ? void 0 : prevJob.id) ?? null
|
|
110
|
+
});
|
|
111
|
+
const UserJobModel = this.workflow.app.db.getModel("users_jobs");
|
|
112
|
+
await UserJobModel.bulkCreate(
|
|
113
|
+
assignees.map((userId) => ({
|
|
114
|
+
userId,
|
|
115
|
+
jobId: job.id,
|
|
116
|
+
nodeId: node.id,
|
|
117
|
+
executionId: job.executionId,
|
|
118
|
+
workflowId: node.workflowId,
|
|
119
|
+
status: import__.JOB_STATUS.PENDING
|
|
120
|
+
})),
|
|
121
|
+
{
|
|
122
|
+
// transaction: processor.transaction,
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
return job;
|
|
126
|
+
}
|
|
127
|
+
async resume(node, job, processor) {
|
|
128
|
+
var _a;
|
|
129
|
+
const { mode } = node.config;
|
|
130
|
+
const assignees = [...new Set(processor.getParsedValue(node.config.assignees, node.id).flat().filter(Boolean))];
|
|
131
|
+
const UserJobModel = this.workflow.app.db.getModel("users_jobs");
|
|
132
|
+
const distribution = await UserJobModel.count({
|
|
133
|
+
where: {
|
|
134
|
+
jobId: job.id
|
|
135
|
+
},
|
|
136
|
+
group: ["status"]
|
|
137
|
+
// transaction: processor.transaction,
|
|
138
|
+
});
|
|
139
|
+
const submitted = distribution.reduce(
|
|
140
|
+
(count, item) => item.status !== import__.JOB_STATUS.PENDING ? count + item.count : count,
|
|
141
|
+
0
|
|
142
|
+
);
|
|
143
|
+
const status = job.status || (getMode(mode).getStatus(distribution, assignees) ?? import__.JOB_STATUS.PENDING);
|
|
144
|
+
const result = mode ? (submitted || 0) / assignees.length : ((_a = job.latestUserJob) == null ? void 0 : _a.result) ?? job.result;
|
|
145
|
+
processor.logger.debug(`manual resume job and next status: ${status}`);
|
|
146
|
+
job.set({
|
|
147
|
+
status,
|
|
148
|
+
result
|
|
149
|
+
});
|
|
150
|
+
return job;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var Plugin_exports = {};
|
|
29
|
+
__export(Plugin_exports, {
|
|
30
|
+
PluginManual: () => PluginManual
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(Plugin_exports);
|
|
33
|
+
var import_actions = __toESM(require("@tachybase/actions"));
|
|
34
|
+
var import_server = require("@tachybase/server");
|
|
35
|
+
var import__ = __toESM(require("../.."));
|
|
36
|
+
var import_actions2 = require("./actions");
|
|
37
|
+
var import_ManualInstruction = __toESM(require("./ManualInstruction"));
|
|
38
|
+
class PluginManual extends import_server.Plugin {
|
|
39
|
+
async load() {
|
|
40
|
+
this.app.resourcer.define({
|
|
41
|
+
name: "users_jobs",
|
|
42
|
+
actions: {
|
|
43
|
+
list: {
|
|
44
|
+
filter: {
|
|
45
|
+
$or: [
|
|
46
|
+
{
|
|
47
|
+
"workflow.enabled": true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"workflow.enabled": false,
|
|
51
|
+
status: {
|
|
52
|
+
$ne: import__.JOB_STATUS.PENDING
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
handler: import_actions.default.list
|
|
58
|
+
},
|
|
59
|
+
submit: import_actions2.submit
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
this.app.acl.allow("users_jobs", ["list", "get", "submit"], "loggedIn");
|
|
63
|
+
const workflowPlugin = this.app.pm.get(import__.default);
|
|
64
|
+
workflowPlugin.registerInstruction("manual", import_ManualInstruction.default);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
PluginManual
|
|
70
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var actions_exports = {};
|
|
29
|
+
__export(actions_exports, {
|
|
30
|
+
submit: () => submit
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(actions_exports);
|
|
33
|
+
var import_actions = require("@tachybase/actions");
|
|
34
|
+
var import__ = __toESM(require("../.."));
|
|
35
|
+
async function submit(context, next) {
|
|
36
|
+
var _a, _b, _c;
|
|
37
|
+
const repository = import_actions.utils.getRepositoryFromParams(context);
|
|
38
|
+
const { filterByTk, values } = context.action.params;
|
|
39
|
+
const { currentUser } = context.state;
|
|
40
|
+
if (!currentUser) {
|
|
41
|
+
return context.throw(401);
|
|
42
|
+
}
|
|
43
|
+
const plugin = context.app.getPlugin(import__.default);
|
|
44
|
+
const instruction = plugin.instructions.get("manual");
|
|
45
|
+
const userJob = await repository.findOne({
|
|
46
|
+
filterByTk,
|
|
47
|
+
// filter: {
|
|
48
|
+
// userId: currentUser?.id
|
|
49
|
+
// },
|
|
50
|
+
appends: ["job", "node", "execution", "workflow"],
|
|
51
|
+
context
|
|
52
|
+
});
|
|
53
|
+
if (!userJob) {
|
|
54
|
+
return context.throw(404);
|
|
55
|
+
}
|
|
56
|
+
const { forms = {} } = userJob.node.config;
|
|
57
|
+
const [formKey] = Object.keys(values.result ?? {}).filter((key) => key !== "_");
|
|
58
|
+
const actionKey = (_a = values.result) == null ? void 0 : _a._;
|
|
59
|
+
const actionItem = (_c = (_b = forms[formKey]) == null ? void 0 : _b.actions) == null ? void 0 : _c.find((item) => item.key === actionKey);
|
|
60
|
+
if (userJob.status !== import__.JOB_STATUS.PENDING || userJob.job.status !== import__.JOB_STATUS.PENDING || userJob.execution.status !== import__.EXECUTION_STATUS.STARTED || !userJob.workflow.enabled || !actionKey || (actionItem == null ? void 0 : actionItem.status) == null) {
|
|
61
|
+
return context.throw(400);
|
|
62
|
+
}
|
|
63
|
+
userJob.execution.workflow = userJob.workflow;
|
|
64
|
+
const processor = plugin.createProcessor(userJob.execution);
|
|
65
|
+
await processor.prepare();
|
|
66
|
+
const assignees = processor.getParsedValue(userJob.node.config.assignees ?? [], userJob.nodeId).flat().filter(Boolean);
|
|
67
|
+
if (!assignees.includes(currentUser.id) || userJob.userId !== currentUser.id) {
|
|
68
|
+
return context.throw(403);
|
|
69
|
+
}
|
|
70
|
+
const presetValues = processor.getParsedValue(actionItem.values ?? {}, userJob.nodeId, {
|
|
71
|
+
// @deprecated
|
|
72
|
+
currentUser,
|
|
73
|
+
// @deprecated
|
|
74
|
+
currentRecord: values.result[formKey],
|
|
75
|
+
// @deprecated
|
|
76
|
+
currentTime: /* @__PURE__ */ new Date(),
|
|
77
|
+
$user: currentUser,
|
|
78
|
+
$nForm: values.result[formKey],
|
|
79
|
+
$nDate: {
|
|
80
|
+
now: /* @__PURE__ */ new Date()
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
userJob.set({
|
|
84
|
+
status: actionItem.status,
|
|
85
|
+
result: actionItem.status > import__.JOB_STATUS.PENDING ? { [formKey]: Object.assign(values.result[formKey], presetValues), _: actionKey } : Object.assign(userJob.result ?? {}, values.result)
|
|
86
|
+
});
|
|
87
|
+
const handler = instruction.formTypes.get(forms[formKey].type);
|
|
88
|
+
if (handler && userJob.status) {
|
|
89
|
+
await handler.call(instruction, userJob, forms[formKey], processor);
|
|
90
|
+
}
|
|
91
|
+
await userJob.save();
|
|
92
|
+
await processor.exit();
|
|
93
|
+
context.body = userJob;
|
|
94
|
+
context.status = 202;
|
|
95
|
+
await next();
|
|
96
|
+
userJob.job.execution = userJob.execution;
|
|
97
|
+
userJob.job.latestUserJob = userJob;
|
|
98
|
+
processor.logger.info(`manual node (${userJob.nodeId}) action trigger execution (${userJob.execution.id}) to resume`);
|
|
99
|
+
plugin.resume(userJob.job);
|
|
100
|
+
}
|
|
101
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
102
|
+
0 && (module.exports = {
|
|
103
|
+
submit
|
|
104
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Processor } from '../../..';
|
|
2
|
+
import ManualInstruction from '../ManualInstruction';
|
|
3
|
+
export default function (this: ManualInstruction, instance: any, { dataSource, collection }: {
|
|
4
|
+
dataSource?: string;
|
|
5
|
+
collection: any;
|
|
6
|
+
}, processor: Processor): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var create_exports = {};
|
|
19
|
+
__export(create_exports, {
|
|
20
|
+
default: () => create_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(create_exports);
|
|
23
|
+
async function create_default(instance, { dataSource = "main", collection }, processor) {
|
|
24
|
+
const repo = this.workflow.app.dataSourceManager.dataSources.get(dataSource).collectionManager.getRepository(collection);
|
|
25
|
+
if (!repo) {
|
|
26
|
+
throw new Error(`collection ${collection} for create data on manual node not found`);
|
|
27
|
+
}
|
|
28
|
+
const { _, ...form } = instance.result;
|
|
29
|
+
const [values] = Object.values(form);
|
|
30
|
+
await repo.create({
|
|
31
|
+
values: {
|
|
32
|
+
...values ?? {},
|
|
33
|
+
createdBy: instance.userId,
|
|
34
|
+
updatedBy: instance.userId
|
|
35
|
+
},
|
|
36
|
+
context: {
|
|
37
|
+
executionId: processor.execution.id
|
|
38
|
+
},
|
|
39
|
+
transaction: processor.transaction
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Processor } from '../../..';
|
|
2
|
+
import ManualInstruction from '../ManualInstruction';
|
|
3
|
+
export type FormHandler = (this: ManualInstruction, instance: any, formConfig: any, processor: Processor) => Promise<void>;
|
|
4
|
+
export default function ({ formTypes }: {
|
|
5
|
+
formTypes: any;
|
|
6
|
+
}): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var forms_exports = {};
|
|
29
|
+
__export(forms_exports, {
|
|
30
|
+
default: () => forms_default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(forms_exports);
|
|
33
|
+
var import_create = __toESM(require("./create"));
|
|
34
|
+
var import_update = __toESM(require("./update"));
|
|
35
|
+
function forms_default({ formTypes }) {
|
|
36
|
+
formTypes.register("create", import_create.default);
|
|
37
|
+
formTypes.register("update", import_update.default);
|
|
38
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Processor } from '../../..';
|
|
2
|
+
import ManualInstruction from '../ManualInstruction';
|
|
3
|
+
export default function (this: ManualInstruction, instance: any, { dataSource, collection, filter }: {
|
|
4
|
+
dataSource?: string;
|
|
5
|
+
collection: any;
|
|
6
|
+
filter?: {};
|
|
7
|
+
}, processor: Processor): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var update_exports = {};
|
|
19
|
+
__export(update_exports, {
|
|
20
|
+
default: () => update_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(update_exports);
|
|
23
|
+
async function update_default(instance, { dataSource = "main", collection, filter = {} }, processor) {
|
|
24
|
+
const repo = this.workflow.app.dataSourceManager.dataSources.get(dataSource).collectionManager.getRepository(collection);
|
|
25
|
+
if (!repo) {
|
|
26
|
+
throw new Error(`collection ${collection} for update data on manual node not found`);
|
|
27
|
+
}
|
|
28
|
+
const { _, ...form } = instance.result;
|
|
29
|
+
const [values] = Object.values(form);
|
|
30
|
+
await repo.update({
|
|
31
|
+
filter: processor.getParsedValue(filter, instance.nodeId),
|
|
32
|
+
values: {
|
|
33
|
+
...values ?? {},
|
|
34
|
+
updatedBy: instance.userId
|
|
35
|
+
},
|
|
36
|
+
context: {
|
|
37
|
+
executionId: processor.execution.id
|
|
38
|
+
},
|
|
39
|
+
transaction: processor.transaction
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Instruction from '../../instructions';
|
|
2
|
+
declare class NoticeInstruction extends Instruction {
|
|
3
|
+
run(node: any, prevJob: any, processor: any): Promise<any>;
|
|
4
|
+
resume(node: any, job: any, processor: any): Promise<any>;
|
|
5
|
+
duplicateConfig(node: any, { transaction }: {
|
|
6
|
+
transaction: any;
|
|
7
|
+
}): Promise<any>;
|
|
8
|
+
}
|
|
9
|
+
export default NoticeInstruction;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var NoticeInstruction_exports = {};
|
|
29
|
+
__export(NoticeInstruction_exports, {
|
|
30
|
+
default: () => NoticeInstruction_default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(NoticeInstruction_exports);
|
|
33
|
+
var import_utils = require("@tachybase/utils");
|
|
34
|
+
var import_constants = require("../../constants");
|
|
35
|
+
var import_instructions = __toESM(require("../../instructions"));
|
|
36
|
+
var import_constants2 = require("../common/constants");
|
|
37
|
+
var import_constants3 = require("./constants");
|
|
38
|
+
var import_tools = require("./tools");
|
|
39
|
+
class NoticeInstruction extends import_instructions.default {
|
|
40
|
+
async run(node, prevJob, processor) {
|
|
41
|
+
const job = await processor.saveJob({
|
|
42
|
+
status: import_constants.JOB_STATUS.RESOLVED,
|
|
43
|
+
nodeId: node.id,
|
|
44
|
+
nodeKey: node.key,
|
|
45
|
+
upstreamId: (prevJob == null ? void 0 : prevJob.id) ?? null
|
|
46
|
+
});
|
|
47
|
+
const notifiedPerson = await (0, import_tools.parsePerson)(node, processor);
|
|
48
|
+
if (notifiedPerson && notifiedPerson.length > 0) {
|
|
49
|
+
const { db } = processor.options.plugin;
|
|
50
|
+
const ApprovalRepo = db.getRepository("approvals");
|
|
51
|
+
const approval = await ApprovalRepo.findOne({
|
|
52
|
+
filter: {
|
|
53
|
+
"executions.id": processor.execution.id
|
|
54
|
+
},
|
|
55
|
+
fields: ["id", "status", "data", "summary", "collectionName"],
|
|
56
|
+
appends: ["approvalExecutions"],
|
|
57
|
+
except: ["data"]
|
|
58
|
+
});
|
|
59
|
+
const NoticeModel = db.getModel(import_constants2.COLLECTION_NOTICE_NAME);
|
|
60
|
+
const notifiedPersonMapData = notifiedPerson.map((userId, index) => ({
|
|
61
|
+
userId,
|
|
62
|
+
jobId: job.id,
|
|
63
|
+
nodeId: node.id,
|
|
64
|
+
executionId: job.executionId,
|
|
65
|
+
workflowId: node.workflowId,
|
|
66
|
+
index,
|
|
67
|
+
status: node.config.order && index ? import_constants3.NOTICE_ACTION_STATUS.ASSIGNED : import_constants3.NOTICE_ACTION_STATUS.APPROVED,
|
|
68
|
+
snapshot: approval.data,
|
|
69
|
+
summary: approval.summary,
|
|
70
|
+
collectionName: approval.collectionName,
|
|
71
|
+
dataKey: approval.dataKey
|
|
72
|
+
}));
|
|
73
|
+
await NoticeModel.bulkCreate(notifiedPersonMapData, {
|
|
74
|
+
transaction: processor.transaction
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
this.workflow.noticeManager.notify("workflow:regular", { msg: "done" });
|
|
78
|
+
return job;
|
|
79
|
+
}
|
|
80
|
+
// NOTE: 目前没有用处, 不过留着作为未来如果有动作的实现的参考
|
|
81
|
+
async resume(node, job, processor) {
|
|
82
|
+
if (job.nodeId !== node.id) {
|
|
83
|
+
const nodeJob = processor.findBranchParentJob(job, node);
|
|
84
|
+
if (job.status === import_constants.JOB_STATUS.RESOLVED) {
|
|
85
|
+
const jobNode = processor.nodesMap.get(job.nodeId);
|
|
86
|
+
const branchStart = processor.findBranchStartNode(jobNode);
|
|
87
|
+
if (branchStart.branchIndex === import_constants3.NOTICE_ACTION_STATUS.RETURNED) {
|
|
88
|
+
nodeJob.set("status", import_constants.JOB_STATUS.RETRY_NEEDED);
|
|
89
|
+
} else if (branchStart.branchIndex === import_constants3.NOTICE_ACTION_STATUS.REJECTED && node.config.endOnReject) {
|
|
90
|
+
nodeJob.set("status", import_constants.JOB_STATUS.REJECTED);
|
|
91
|
+
}
|
|
92
|
+
return nodeJob;
|
|
93
|
+
}
|
|
94
|
+
return processor.exit(job.status);
|
|
95
|
+
}
|
|
96
|
+
const { branchMode, negotiation, order } = node.config;
|
|
97
|
+
const notifiedPerson = await (0, import_tools.parsePerson)(node, processor);
|
|
98
|
+
const NoticeRepo = this.workflow.app.db.getRepository(import_constants2.COLLECTION_NOTICE_NAME);
|
|
99
|
+
const records = await NoticeRepo.find({
|
|
100
|
+
filter: {
|
|
101
|
+
jobId: job.id
|
|
102
|
+
},
|
|
103
|
+
except: ["snapshot"],
|
|
104
|
+
sort: ["index"],
|
|
105
|
+
transaction: processor.transaction
|
|
106
|
+
});
|
|
107
|
+
const distribution = records.reduce((prev, record) => {
|
|
108
|
+
const item = prev.find((item2) => item2.status === record.status);
|
|
109
|
+
if (item) {
|
|
110
|
+
item.count += 1;
|
|
111
|
+
} else {
|
|
112
|
+
prev.push({
|
|
113
|
+
status: record.status,
|
|
114
|
+
count: 1
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return prev;
|
|
118
|
+
}, []);
|
|
119
|
+
const processing = Boolean(distribution.find((item) => item.status !== import_constants3.NOTICE_ACTION_STATUS.PENDING));
|
|
120
|
+
const status = job.status || ((0, import_tools.getNegotiationMode)(negotiation).getStatus(distribution, notifiedPerson, negotiation) ?? import_constants.JOB_STATUS.PENDING);
|
|
121
|
+
const result = import_tools.NoticeJobStatusMap[status];
|
|
122
|
+
processor.logger.debug(`notice resume job and next status: ${status}`);
|
|
123
|
+
job.set({
|
|
124
|
+
status: status && status !== import_constants.JOB_STATUS.CANCELED ? branchMode ? import_constants.JOB_STATUS.RESOLVED : status : status,
|
|
125
|
+
result
|
|
126
|
+
});
|
|
127
|
+
if (status && status !== import_constants.JOB_STATUS.CANCELED || negotiation && processing) {
|
|
128
|
+
await job.latestUserJob.approval.update(
|
|
129
|
+
{
|
|
130
|
+
status: import_constants3.NOTICE_STATUS.PROCESSING
|
|
131
|
+
},
|
|
132
|
+
{ transaction: processor.transaction }
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
const nextPerson = notifiedPerson[notifiedPerson.indexOf(job.latestUserJob.userId) + 1];
|
|
136
|
+
if (!status && negotiation && order && nextPerson) {
|
|
137
|
+
await NoticeRepo.update({
|
|
138
|
+
values: {
|
|
139
|
+
status: import_constants3.NOTICE_ACTION_STATUS.PENDING
|
|
140
|
+
},
|
|
141
|
+
filter: {
|
|
142
|
+
jobId: job.id,
|
|
143
|
+
userId: nextPerson
|
|
144
|
+
},
|
|
145
|
+
transaction: processor.transaction
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
if (branchMode) {
|
|
149
|
+
const branchNode = processor.nodes.find((item) => item.upstream === node && item.branchIndex === result);
|
|
150
|
+
if (branchNode) {
|
|
151
|
+
await processor.saveJob(job);
|
|
152
|
+
await processor.run(branchNode, job);
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return job;
|
|
157
|
+
}
|
|
158
|
+
async duplicateConfig(node, { transaction }) {
|
|
159
|
+
const uiSchemaRepo = this.workflow.app.db.getRepository("uiSchemas");
|
|
160
|
+
if (!node.config.showNoticeDetail) {
|
|
161
|
+
return node.config;
|
|
162
|
+
}
|
|
163
|
+
const result = await uiSchemaRepo.duplicate(node.config.showNoticeDetail, {
|
|
164
|
+
transaction
|
|
165
|
+
});
|
|
166
|
+
return {
|
|
167
|
+
...node.config,
|
|
168
|
+
showNoticeDetail: (result == null ? void 0 : result["x-uid"]) ?? (0, import_utils.uid)()
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
var NoticeInstruction_default = NoticeInstruction;
|