@simitgroup/simpleapp-generator 1.6.7-o-alpha → 2.0.0-a-alpha
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/ReleaseNote.md +4 -0
- package/dist/buildinschemas/autoincreament.js +1 -1
- package/dist/buildinschemas/branch.d.ts.map +1 -1
- package/dist/buildinschemas/branch.js +2 -0
- package/dist/buildinschemas/branch.js.map +1 -1
- package/dist/buildinschemas/docnoformat.js +1 -1
- package/dist/buildinschemas/docnoformat.js.map +1 -1
- package/dist/buildinschemas/documentevent.js +1 -1
- package/dist/buildinschemas/documentnoformat.d.ts +3 -0
- package/dist/buildinschemas/documentnoformat.d.ts.map +1 -0
- package/dist/buildinschemas/documentnoformat.js +58 -0
- package/dist/buildinschemas/documentnoformat.js.map +1 -0
- package/dist/buildinschemas/index.d.ts +0 -5
- package/dist/buildinschemas/index.d.ts.map +1 -1
- package/dist/buildinschemas/index.js +5 -11
- package/dist/buildinschemas/index.js.map +1 -1
- package/dist/buildinschemas/organization.d.ts.map +1 -1
- package/dist/buildinschemas/organization.js +3 -19
- package/dist/buildinschemas/organization.js.map +1 -1
- package/dist/buildinschemas/user.d.ts.map +1 -1
- package/dist/buildinschemas/user.js +5 -2
- package/dist/buildinschemas/user.js.map +1 -1
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +118 -23
- package/dist/generate.js.map +1 -1
- package/dist/type.d.ts +6 -0
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js.map +1 -1
- package/package.json +1 -1
- package/src/buildinschemas/{autoincreament.ts → autoincreament.ts.backup} +1 -1
- package/src/buildinschemas/branch.ts +2 -0
- package/src/buildinschemas/{documentevent.ts → documentevent.ts.backup} +1 -1
- package/src/buildinschemas/{docnoformat.ts → documentnoformat.ts.backup} +3 -3
- package/src/buildinschemas/index.ts +4 -5
- package/src/buildinschemas/organization.ts +3 -19
- package/src/buildinschemas/user.ts +5 -2
- package/src/generate.ts +128 -28
- package/src/type.ts +6 -1
- package/templates/basic/nest/api.controller.ts.eta +153 -0
- package/templates/basic/nest/api.module.ts.eta +32 -0
- package/templates/basic/nest/api.resolver.ts.eta +94 -0
- package/templates/basic/nest/api.schema.ts.eta +20 -0
- package/templates/basic/nest/api.service.ts.eta +85 -0
- package/templates/basic/nest/controller.ts.eta +18 -119
- package/templates/basic/nest/default.ts.eta +16 -10
- package/templates/basic/nest/enum.ts.eta +16 -0
- package/templates/basic/nest/model.ts.eta +6 -28
- package/templates/basic/nest/module.ts.eta +25 -0
- package/templates/basic/nest/resolver.ts.eta +12 -56
- package/templates/basic/nest/schema.ts.eta +133 -0
- package/templates/basic/nest/service.ts.eta +82 -73
- package/templates/basic/nest/service.ts.eta-backup +50 -0
- package/templates/basic/nuxt/default.ts.eta +10 -8
- package/templates/basic/nuxt/pages.[id].vue.eta +2 -2
- package/templates/basic/nuxt/pages.form.vue.eta +2 -2
- package/templates/basic/nuxt/pages.viewer.vue.eta +2 -2
- package/templates/basic/nuxt/simpleapp.doc.ts.eta +1 -1
- package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +7 -5
- package/templates/nest/src/app.module.ts._eta +53 -69
- package/templates/nest/src/main.ts._eta +1 -1
- package/templates/nest/src/simple-app/.core/features/auth/api-key/api-key.service.ts.eta +29 -0
- package/templates/nest/src/simple-app/.core/features/auth/api-key/api-key.type.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/auth/api-key/validators/interface.ts.eta +7 -0
- package/templates/nest/src/simple-app/.core/features/auth/api-key/validators/mini-api-key.validator.ts.eta +30 -0
- package/templates/nest/src/simple-app/.core/features/auth/api-key/validators/static-api-key.validator.ts.eta +27 -0
- package/templates/nest/src/simple-app/.core/features/auth/auth.module.ts.eta +9 -0
- package/templates/nest/src/{simpleapp/generate/commons/roles → simple-app/.core/features/auth/role-guard}/roles.enum.ts.eta +7 -7
- package/templates/nest/src/{simpleapp/generate/commons/roles → simple-app/.core/features/auth/role-guard}/roles.guard.ts.eta +1 -1
- package/templates/nest/src/simple-app/.core/features/auto-increament/auto-increament.model.ts.eta +10 -0
- package/templates/nest/src/simple-app/.core/features/auto-increament/auto-increament.module.ts.eta +18 -0
- package/templates/nest/src/simple-app/.core/features/auto-increament/auto-increament.schema.ts.eta +119 -0
- package/templates/nest/src/simple-app/.core/features/auto-increament/auto-increament.service.ts.eta +65 -0
- package/templates/nest/src/simple-app/.core/features/cron/base/cron.base.ts.eta +13 -0
- package/templates/nest/src/simple-app/.core/features/cron/cron-system/cron-system.module.ts.eta +17 -0
- package/templates/nest/src/simple-app/.core/features/cron/cron-system/cron-system.service.ts.eta +37 -0
- package/templates/nest/src/simple-app/.core/features/cron/cron-system/schemas/index.ts.eta +2 -0
- package/templates/nest/src/simple-app/.core/features/cron/cron.module.ts.eta +10 -0
- package/templates/nest/src/simple-app/.core/features/document-no-format/document-no-format.controller.ts.eta +31 -0
- package/templates/nest/src/simple-app/.core/features/document-no-format/document-no-format.model.ts.eta +15 -0
- package/templates/nest/src/simple-app/.core/features/document-no-format/document-no-format.module.ts.eta +12 -0
- package/templates/nest/src/simple-app/.core/features/document-no-format/document-no-format.schema.ts.eta +162 -0
- package/templates/nest/src/simple-app/.core/features/document-no-format/document-no-format.service.ts.eta +189 -0
- package/templates/nest/src/simple-app/.core/features/event/event.module.ts.eta +9 -0
- package/templates/nest/src/simple-app/.core/features/event/event.type.ts.eta +23 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-after-create.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-after-delete.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-after-set-status.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-after-update.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-before-create.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-before-delete.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-before-set-status.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/event-before-update.interface.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/event/interface/index.ts.eta +8 -0
- package/templates/nest/src/simple-app/.core/features/foreign-key/foreign-key.module.ts.eta +16 -0
- package/templates/nest/src/simple-app/.core/features/log/log.module.ts.eta +20 -0
- package/templates/nest/src/simple-app/.core/features/log/log.service.ts.eta +68 -0
- package/templates/nest/src/simple-app/.core/features/log/schemas/api-event.schema.ts.eta +57 -0
- package/templates/nest/src/simple-app/.core/features/log/schemas/document-event.schema.ts.eta +87 -0
- package/templates/nest/src/simple-app/.core/features/log/schemas/index.ts.eta +2 -0
- package/templates/nest/src/simple-app/.core/features/maintenance/maintenance.controller.ts.eta +84 -0
- package/templates/nest/src/simple-app/.core/features/maintenance/maintenance.module.ts.eta +19 -0
- package/templates/nest/src/simple-app/.core/features/maintenance/maintenance.service.ts.eta +86 -0
- package/templates/nest/src/simple-app/.core/features/maintenance/schemas/environment.ts.eta +23 -0
- package/templates/nest/src/{simpleapp/maintenance/apischemas → simple-app/.core/features/maintenance/schemas}/index.ts.eta +1 -1
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal-bridge.service.ts.eta.eta +31 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal-env-development.service.ts.eta +124 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal-env-production.service.ts.eta +50 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal.controller.ts.eta +41 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal.schema.ts.eta +18 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/developer-portal.service.ts.eta +94 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/dto/developer-portal-create-app.dto.ts.eta +22 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/developer-portal/dto/developer-portal-publish-app.dto.ts.eta +0 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/dto/imports.ts.eta +2 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/dto/index.ts.eta +2 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/dto/mini-app.ts.eta +55 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager-bridge.service.ts.eta +162 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager-env-development.service.ts.eta +140 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager-env-production.service.ts.eta +125 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager-policy.service.ts.eta +43 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager.controller.ts.eta +81 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager.enum.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager.error.ts.eta +24 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager.processor.ts.eta +309 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-manager/mini-app-manager.service.ts.eta +346 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-scope/mini-app-scope.decorator.ts.eta +5 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-scope/mini-app-scope.guard.ts.eta +43 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app-scope/mini-app-scope.service.ts.eta +101 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/mini-app.module.ts.eta +24 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/types/miniApp.ts.eta +23 -0
- package/templates/nest/src/simple-app/.core/features/mini-app/utils/mini-app.util.ts.eta +26 -0
- package/templates/nest/src/simple-app/.core/features/policy/policy.module.ts.eta +12 -0
- package/templates/nest/src/simple-app/.core/features/policy/policy.service.ts.eta +45 -0
- package/templates/nest/src/{simpleapp/profile/profile.controller.ts._eta → simple-app/.core/features/profile/profile.controller.ts.eta} +37 -83
- package/templates/nest/src/simple-app/.core/features/profile/profile.module.ts.eta +22 -0
- package/templates/nest/src/simple-app/.core/features/profile/profile.schema.ts.eta +165 -0
- package/templates/nest/src/{simpleapp/profile/profile.service.ts._eta → simple-app/.core/features/profile/profile.service.ts.eta} +36 -48
- package/templates/nest/src/simple-app/.core/features/queue/queue-base/queue-base.consumer.ts.eta +196 -0
- package/templates/nest/src/simple-app/.core/features/queue/queue-base/queue-base.producer.ts.eta +147 -0
- package/templates/nest/src/simple-app/.core/features/queue/queue-user-context/queue-user-context.service.ts.eta +35 -0
- package/templates/nest/src/simple-app/.core/features/queue/queue.module.ts.eta +24 -0
- package/templates/nest/src/simple-app/.core/features/queue/queue.type.ts.eta +75 -0
- package/templates/nest/src/simple-app/.core/features/simple-app-core-features.module.ts.eta +51 -0
- package/templates/nest/src/{simpleapp/generate/commons/robotuser.service.ts.eta → simple-app/.core/features/user-context/robot-user.service.ts.eta} +27 -16
- package/templates/nest/src/simple-app/.core/features/user-context/user-context.module.ts.eta +24 -0
- package/templates/nest/src/simple-app/.core/features/user-context/user-context.type.ts.eta +15 -0
- package/templates/nest/src/{simpleapp/generate/commons → simple-app/.core/features/user-context}/user.context.ts.eta +469 -449
- package/templates/nest/src/{simpleapp/generate/commons/runwebhook.service.ts.eta → simple-app/.core/features/webhook/run-webhook.service.ts.eta} +7 -11
- package/templates/nest/src/simple-app/.core/features/webhook/schemas/index.ts.eta +2 -0
- package/templates/nest/src/simple-app/.core/features/webhook/schemas/webhook-log.schema.ts.eta +116 -0
- package/templates/nest/src/simple-app/.core/features/webhook/schemas/webhook.schema.ts.eta +177 -0
- package/templates/nest/src/simple-app/.core/features/webhook/webhook.module.ts.eta +20 -0
- package/templates/nest/src/{simpleapp/generate/controllers/simpleapp.controller.ts.eta → simple-app/.core/framework/base/simple-app.controller.ts.eta} +13 -35
- package/templates/nest/src/{simpleapp/generate/processors/simpleapp.processor.ts.eta → simple-app/.core/framework/base/simple-app.service.ts.eta} +239 -139
- package/templates/nest/src/simple-app/.core/framework/custom-exception.ts.eta +26 -0
- package/templates/nest/src/simple-app/.core/framework/framework.module.ts.eta +12 -0
- package/templates/nest/src/simple-app/.core/framework/schemas/index.ts.eta +3 -0
- package/templates/nest/src/simple-app/.core/framework/schemas/others.schema.ts.eta +153 -0
- package/templates/nest/src/simple-app/.core/framework/schemas/simple-app.schema.ts.eta +172 -0
- package/templates/nest/src/{simpleapp/generate/commons/interceptors/response.interceptor.ts.eta → simple-app/.core/framework/simple-app.interceptor.ts.eta} +12 -22
- package/templates/nest/src/{simpleapp/generate/commons/middlewares/tenant.middleware.ts.eta → simple-app/.core/framework/simple-app.middleware.ts.eta} +28 -26
- package/templates/nest/src/simple-app/.core/readme.md.eta +3 -0
- package/templates/nest/src/simple-app/.core/resources/core-resources.module.ts.eta +38 -0
- package/templates/nest/src/simple-app/.core/simple-app-core.module.ts.eta +18 -0
- package/templates/nest/src/simple-app/.core/utils/dayjs.ts.eta +47 -0
- package/templates/nest/src/simple-app/.core/utils/locale-tool.ts.eta +11 -0
- package/templates/nest/src/simple-app/.core/utils/string-utils.ts.eta +1 -0
- package/templates/nest/src/simple-app/.resources/readme.md.eta +3 -0
- package/templates/nest/src/simple-app/.resources/resources.module.ts.eta +36 -0
- package/templates/nest/src/simple-app/apis/readme.md.eta +9 -0
- package/templates/nest/src/simple-app/apis/resource-api.module.ts.eta +37 -0
- package/templates/nest/src/simple-app/events/branch-event/branch-event.module.ts._eta +20 -0
- package/templates/nest/src/simple-app/events/branch-event/branch-event.service.ts._eta +43 -0
- package/templates/nest/src/simple-app/events/branch-event/branch-event.type.ts._eta +7 -0
- package/templates/nest/src/simple-app/events/events.module.ts._eta +17 -0
- package/templates/nest/src/simple-app/events/organization-event/organization-event.module.ts._eta +13 -0
- package/templates/nest/src/simple-app/events/organization-event/organization-event.service.ts._eta +52 -0
- package/templates/nest/src/simple-app/events/organization-event/organization-event.type.ts._eta +1 -0
- package/templates/nest/src/simple-app/events/permission-event/permission-event.module.ts.eta +11 -0
- package/templates/nest/src/simple-app/events/permission-event/permission-event.service.ts.eta +33 -0
- package/templates/nest/src/simple-app/events/permission-event/permission-event.type.ts.eta +1 -0
- package/templates/nest/src/simple-app/events/readme.md.eta +76 -0
- package/templates/nest/src/simple-app/events/tenant-event/tenant-event.module.ts_eta +12 -0
- package/templates/nest/src/simple-app/events/tenant-event/tenant-event.service.ts_eta +30 -0
- package/templates/nest/src/simple-app/events/tenant-event/tenant-event.type.ts_eta +1 -0
- package/templates/nest/src/{simpleapp/additional.module.ts._eta → simple-app/features/features.module.ts._eta} +8 -7
- package/templates/nest/src/{printapi/printapi.module.ts.eta → simple-app/features/print/print.module.ts.eta} +4 -4
- package/templates/nest/src/{printapi/printapi.service.ts.eta → simple-app/features/print/print.service.ts.eta} +7 -7
- package/templates/nest/src/simple-app/features/readme.md._eta +6 -0
- package/templates/nest/src/simple-app/simple-app.module.ts.eta +32 -0
- package/templates/nuxt/.env._eta +2 -0
- package/templates/nuxt/app.vue.eta +15 -7
- package/templates/nuxt/components/header/HeaderSelectBranch.vue.eta +2 -1
- package/templates/nuxt/components/image/ImageAvatar.vue._eta +63 -0
- package/templates/nuxt/components/image/ImageOrganization.vue._eta +77 -0
- package/templates/nuxt/components/simpleApp/SimpleAppForm.vue.eta +1 -1
- package/templates/nuxt/components/simpleApp/SimpleAppFormToolBar.vue._eta +95 -20
- package/templates/nuxt/components/user/UserButtonCreateTenant.vue._eta +20 -21
- package/templates/nuxt/components/user/UserTenantPicker.vue._eta +1 -1
- package/templates/nuxt/composables/docformat.generate.ts.eta +4 -2
- package/templates/nuxt/enums/enums.generate.ts.eta +1 -1
- package/templates/nuxt/middleware/30.acl.global.ts.eta +6 -6
- package/templates/nuxt/nuxt.config.ts._eta +1 -0
- package/templates/nuxt/pages/login.vue._eta +21 -15
- package/templates/nuxt/pages/profile.vue._eta +24 -32
- package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +31 -24
- package/templates/nuxt/plugins/50.simpleapp-client.ts.eta +2 -2
- package/templates/nuxt/providers/my-provider.ts.eta +5 -6
- package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +1 -0
- package/templates/nuxt/simpleapp/generate/defaults/index.ts.eta +1 -1
- package/templates/nuxt/simpleapp/generate/types/index.ts.eta +1 -1
- package/templates/nuxt/types/schema.ts.eta +1 -0
- package/templates/nuxt/types/user.ts.eta +39 -38
- package/templates/project/build.sh.eta +2 -2
- package/templates/basic/nest/apischema.ts.eta +0 -96
- package/templates/basic/nest/processor.ts.eta +0 -86
- package/templates/nest/src/cloudapi/cloudapi.module.ts._eta +0 -15
- package/templates/nest/src/cloudapi/cloudapi.service.ts._eta +0 -15
- package/templates/nest/src/enums/enums.generate.ts.eta +0 -23
- package/templates/nest/src/simpleapp/apischemas/index.ts._eta +0 -85
- package/templates/nest/src/simpleapp/generate/apischemas/index.ts.eta +0 -15
- package/templates/nest/src/simpleapp/generate/apischemas/simpleapp.apischema.ts.eta +0 -62
- package/templates/nest/src/simpleapp/generate/commons/audittrail.service.ts.eta +0 -52
- package/templates/nest/src/simpleapp/generate/commons/customkeycloa.guard.ts.eta +0 -45
- package/templates/nest/src/simpleapp/generate/commons/docnogenerator.service.ts.eta +0 -129
- package/templates/nest/src/simpleapp/generate/commons/providers/workflow.provider.ts.etax +0 -87
- package/templates/nest/src/simpleapp/generate/jsonschemas/index.ts.eta +0 -11
- package/templates/nest/src/simpleapp/generate/models/apievent.model.ts.eta +0 -27
- package/templates/nest/src/simpleapp/generate/processors/autoinc.processor.ts.eta +0 -88
- package/templates/nest/src/simpleapp/generate/processors/branch.processor.ts.eta +0 -110
- package/templates/nest/src/simpleapp/generate/processors/docno.processor.ts.eta +0 -77
- package/templates/nest/src/simpleapp/generate/processors/org.processor.ts.eta +0 -110
- package/templates/nest/src/simpleapp/generate/processors/perm.processor.ts.eta +0 -71
- package/templates/nest/src/simpleapp/generate/processors/sysmsg.processor.ts.eta +0 -49
- package/templates/nest/src/simpleapp/generate/processors/tenant.processor.ts.eta +0 -52
- package/templates/nest/src/simpleapp/generate/processors/webhooklog.processor.ts.eta +0 -45
- package/templates/nest/src/simpleapp/generate/types/index.ts.eta +0 -7
- package/templates/nest/src/simpleapp/generate/types/schema.type.ts.eta +0 -193
- package/templates/nest/src/simpleapp/generate/types/simpleapp.type.ts.eta +0 -299
- package/templates/nest/src/simpleapp/generate/types/workflow.type.ts.eta +0 -15
- package/templates/nest/src/simpleapp/generate/workflow/formschema/SimpleApproveReject.ts.eta +0 -8
- package/templates/nest/src/simpleapp/generate/workflow/formschema/index.ts.eta +0 -7
- package/templates/nest/src/simpleapp/generate/workflow/workflow.apischema.ts.eta +0 -136
- package/templates/nest/src/simpleapp/generate/workflow/workflow.config.ts.eta +0 -79
- package/templates/nest/src/simpleapp/generate/workflow/workflow.controller.ts.eta +0 -414
- package/templates/nest/src/simpleapp/generate/workflow/workflow.delegate.ts.eta +0 -201
- package/templates/nest/src/simpleapp/generate/workflow/workflow.service.ts.eta +0 -641
- package/templates/nest/src/simpleapp/generate/workflow/workflow.type.ts.eta +0 -98
- package/templates/nest/src/simpleapp/generate/workflow/workflow.userservice.ts.eta +0 -83
- package/templates/nest/src/simpleapp/maintenance/apischemas/environment.ts.eta +0 -11
- package/templates/nest/src/simpleapp/maintenance/maintenance.controller.ts.eta +0 -72
- package/templates/nest/src/simpleapp/maintenance/maintenance.service.ts.eta +0 -88
- package/templates/nest/src/simpleapp/maintenance/models/environment.model.ts.eta +0 -16
- package/templates/nest/src/simpleapp/profile/profile.apischema.ts._eta +0 -95
- package/templates/nest/src/simpleapp/resolvers/readme.md.eta +0 -1
- package/templates/nest/src/simpleapp/services/autoinc.service.ts.etaxx +0 -59
- package/templates/nest/src/simpleapp/services/branch.service.ts.etaxxx +0 -83
- package/templates/nest/src/simpleapp/services/docno.service.ts.etaxxx +0 -59
- package/templates/nest/src/simpleapp/services/org.service.ts.etaxxx +0 -37
- package/templates/nest/src/simpleapp/services/perm.service.ts.etaxxx +0 -56
- package/templates/nest/src/simpleapp/services/sysmsg.service.ts._etaxxx +0 -43
- package/templates/nest/src/simpleapp/services/tenant.service.ts.etaxxx +0 -38
- package/templates/nest/src/simpleapp/services/user.service.ts.eta.old +0 -118
- package/templates/nest/src/simpleapp/services/userresolver.service.ts._eta +0 -67
- package/templates/nest/src/simpleapp/services/webhook.service.ts._eta +0 -37
- package/templates/nest/src/simpleapp/simpleapp.module.ts.eta +0 -85
- package/templates/nest/src/simpleapp/types/index.ts._eta +0 -45
- package/templates/nest/src/simpleapp/webhooks/branch.ts._eta +0 -44
- package/templates/nest/src/simpleapp/webhooks/index.ts._eta +0 -21
- package/templates/nest/src/simpleapp/workflows/bpmn/readme.md._eta +0 -1
- package/templates/nest/src/simpleapp/workflows/listeners/simpleapp.listener.ts.eta +0 -31
- package/templates/nest/src/simpleapp/workflows/readme.md._eta +0 -1
- package/templates/nuxt/components/image/ImageAvatar.vue.eta +0 -56
- package/templates/nuxt/components/image/ImageOrganization.vue.eta +0 -66
- /package/src/buildinschemas/{webhook.ts → webhook.ts.backup} +0 -0
- /package/src/buildinschemas/{webhooklog.ts → webhooklog.ts.backup} +0 -0
- /package/templates/basic/nest/{type.ts.eta → type.ts.eta-backup} +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/customkeycloak.guard.ts.eta → simple-app/.core/features/auth/keycloak/keycloak.guard.ts.eta} +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/roles → simple-app/.core/features/auth/role-guard}/roles.decorator.ts.eta +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/roles → simple-app/.core/features/auth/role-guard}/roles.group.ts.eta +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/dicts/documents.ts.eta → simple-app/.core/features/document-no-format/document.dict.ts.eta} +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/dicts/foreignkeys.ts.eta → simple-app/.core/features/foreign-key/foreignkeys.dict.ts.eta} +0 -0
- /package/templates/nest/src/{simpleapp/maintenance/dbupdate → simple-app/.core/features/maintenance/db-update}/1.00.00/index.ts._eta +0 -0
- /package/templates/nest/src/{simpleapp/maintenance/dbupdate → simple-app/.core/features/maintenance/db-update}/index.ts._eta +0 -0
- /package/templates/nest/src/{simpleapp/maintenance/apischemas/dbupdate.ts.eta → simple-app/.core/features/maintenance/schemas/db-update.ts.eta} +0 -0
- /package/templates/nest/src/{simpleapp/profile/profile.types.ts.eta → simple-app/.core/features/profile/profile.types.ts.eta-backup} +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/decorators → simple-app/.core/features/user-context}/appuser.decorator.ts.eta +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons/exceptions/SimpleAppExceptionFilter.ts.eta → simple-app/.core/framework/exception-filter.ts.eta} +0 -0
- /package/templates/nest/src/{simpleapp/generate/commons → simple-app/.core/utils}/encryption.static.ts.eta +0 -0
- /package/templates/nest/src/{simpleapp → simple-app}/.gitignore.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/.gitignore.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/.npmignore.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/.openapi-generator/FILES.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/.openapi-generator/VERSION.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/.openapi-generator-ignore.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/api.ts.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/base.ts.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/common.ts.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/configuration.ts.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/git_push.sh.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/index.ts.eta +0 -0
- /package/templates/nest/src/{printapi → simple-app/features/print}/api/openapitools.json.eta +0 -0
- /package/templates/project/{sharelibs → share-libs}/hello.ts._eta +0 -0
- /package/templates/project/{sharelibs → share-libs}/index.ts.eta +0 -0
- /package/templates/project/{sharelibs → share-libs}/money.ts.eta +0 -0
- /package/templates/project/{sharelibs → share-libs}/validate.ts.eta +0 -0
|
@@ -1,414 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-04-21
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
import {
|
|
8
|
-
Controller,
|
|
9
|
-
Get,
|
|
10
|
-
Post,
|
|
11
|
-
Req,
|
|
12
|
-
Put,
|
|
13
|
-
Param,
|
|
14
|
-
Body,
|
|
15
|
-
Delete,
|
|
16
|
-
HttpCode,
|
|
17
|
-
} from '@nestjs/common';
|
|
18
|
-
|
|
19
|
-
import { WorkflowService } from './workflow.service';
|
|
20
|
-
import { UserTaskActors } from './workflow.type';
|
|
21
|
-
import { Roles } from '../commons/roles/roles.decorator';
|
|
22
|
-
import { Role } from '../commons/roles/roles.enum';
|
|
23
|
-
import {
|
|
24
|
-
WorkflowDataApiSchema,
|
|
25
|
-
WorkflowProcessApiSchema,
|
|
26
|
-
SearchWorkflowProcessApiSchema,
|
|
27
|
-
UserTaskActorsApiSchema,
|
|
28
|
-
UserTaskApiSchema,
|
|
29
|
-
} from './workflow.apischema';
|
|
30
|
-
import { ApiTags, ApiBody, ApiResponse, ApiOperation } from '@nestjs/swagger';
|
|
31
|
-
import { AppUser } from '../commons/decorators/appuser.decorator';
|
|
32
|
-
import { UserContext } from '../commons/user.context';
|
|
33
|
-
import { WorkflowName } from '../types';
|
|
34
|
-
@ApiTags('workflow')
|
|
35
|
-
@Controller('workflow')
|
|
36
|
-
export class WorkflowController {
|
|
37
|
-
constructor(private readonly workflowService: WorkflowService) {}
|
|
38
|
-
|
|
39
|
-
/********************* workflow user task begin ***********************/
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* get all user task under me, which base on assignee, candidateUsers, candidateGroup
|
|
43
|
-
* @param appuser
|
|
44
|
-
* @returns
|
|
45
|
-
*/
|
|
46
|
-
@Get('/')
|
|
47
|
-
@ApiOperation({
|
|
48
|
-
operationId: 'getMyUserTask',
|
|
49
|
-
description:
|
|
50
|
-
'get all my active user task in this tenant **not yet complete**',
|
|
51
|
-
})
|
|
52
|
-
@ApiResponse({
|
|
53
|
-
status: 200,
|
|
54
|
-
type: [UserTaskApiSchema],
|
|
55
|
-
description: 'usertask id not found, or not in waiting stage',
|
|
56
|
-
})
|
|
57
|
-
async getMyUserTask(@AppUser() appuser: UserContext) {
|
|
58
|
-
return await this.workflowService.getMyUserTask(appuser);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* get all user task under me, which base on assignee, candidateUsers, candidateGroup
|
|
62
|
-
* @param appuser
|
|
63
|
-
* @returns
|
|
64
|
-
*/
|
|
65
|
-
@Get('/actor/:uid')
|
|
66
|
-
@ApiOperation({
|
|
67
|
-
operationId: 'getActorUserTask',
|
|
68
|
-
description:
|
|
69
|
-
'get all my active user task in this tenant **not yet complete**',
|
|
70
|
-
})
|
|
71
|
-
async getUserTaskByActor(
|
|
72
|
-
@AppUser() appuser: UserContext,
|
|
73
|
-
@Param() uid: string,
|
|
74
|
-
) {
|
|
75
|
-
return await this.workflowService.getActorUserTask(appuser);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* trigger user task and go to next step
|
|
80
|
-
* @param appuser
|
|
81
|
-
* @param id
|
|
82
|
-
* @param taskId
|
|
83
|
-
* @param data
|
|
84
|
-
* @returns
|
|
85
|
-
*/
|
|
86
|
-
@Post('/invoke-task/:taskId')
|
|
87
|
-
@HttpCode(200)
|
|
88
|
-
@ApiResponse({
|
|
89
|
-
status: 200,
|
|
90
|
-
|
|
91
|
-
description: 'Success',
|
|
92
|
-
})
|
|
93
|
-
@ApiResponse({
|
|
94
|
-
status: 404,
|
|
95
|
-
description: 'usertask id not found, or not in waiting stage',
|
|
96
|
-
})
|
|
97
|
-
@ApiBody({
|
|
98
|
-
description: 'invoke workflow data, like reason and etc',
|
|
99
|
-
type: Object,
|
|
100
|
-
})
|
|
101
|
-
@ApiOperation({
|
|
102
|
-
operationId: 'invokeWorkflowUserTask',
|
|
103
|
-
description: 'invoke workflow user task',
|
|
104
|
-
})
|
|
105
|
-
async invokeWorkflowUserTask(
|
|
106
|
-
@AppUser() appuser: UserContext,
|
|
107
|
-
@Param('taskId') taskId: string,
|
|
108
|
-
@Body() data: any,
|
|
109
|
-
) {
|
|
110
|
-
return await this.workflowService.invokeWorkflowUserTask(
|
|
111
|
-
appuser,
|
|
112
|
-
taskId,
|
|
113
|
-
data,
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// change workflow user task like change assignee, candidateUsers/groups
|
|
118
|
-
/**
|
|
119
|
-
* change specific user task assignee, candidatesUsers/groups
|
|
120
|
-
* @param appuser
|
|
121
|
-
* @param id
|
|
122
|
-
* @param taskId
|
|
123
|
-
* @param data
|
|
124
|
-
* @returns
|
|
125
|
-
*/
|
|
126
|
-
@Put('/:id/task/:taskId')
|
|
127
|
-
@ApiBody({
|
|
128
|
-
description:
|
|
129
|
-
'update user task assignee: string, candidateUsers:string[], candidateGroups:string[]',
|
|
130
|
-
type: UserTaskActorsApiSchema,
|
|
131
|
-
})
|
|
132
|
-
@ApiOperation({
|
|
133
|
-
operationId: 'updateWorkflowUserTask',
|
|
134
|
-
description: 'update workflow user task',
|
|
135
|
-
})
|
|
136
|
-
async updateWorkflowUserTask(
|
|
137
|
-
@AppUser() appuser: UserContext,
|
|
138
|
-
@Param('id') id: string,
|
|
139
|
-
@Param('taskId') taskId: string,
|
|
140
|
-
@Body() data: UserTaskActors,
|
|
141
|
-
) {
|
|
142
|
-
return await this.workflowService.updateWorkflowUserTask(
|
|
143
|
-
appuser,
|
|
144
|
-
id,
|
|
145
|
-
taskId,
|
|
146
|
-
data,
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
/********************* workflow user task end ***********************/
|
|
150
|
-
|
|
151
|
-
/*********************** workflow admin api begin ***********************/
|
|
152
|
-
//done: get all pending workflow processes and its waiting task
|
|
153
|
-
@Get('/admin/get-all-active-process')
|
|
154
|
-
@ApiOperation({
|
|
155
|
-
operationId: 'getAllActiveProcesses',
|
|
156
|
-
description: 'get all active process in this database (done)',
|
|
157
|
-
})
|
|
158
|
-
@ApiResponse({
|
|
159
|
-
status: 200,
|
|
160
|
-
type: [WorkflowProcessApiSchema],
|
|
161
|
-
description: 'Success',
|
|
162
|
-
})
|
|
163
|
-
async getAllActiveProcesses(@AppUser() appuser: UserContext) {
|
|
164
|
-
return await this.workflowService.getAllActiveProcesses(appuser);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* obtain input fields expected for specific user task
|
|
169
|
-
* @param appuser
|
|
170
|
-
* @param workflowname
|
|
171
|
-
* @param elementId
|
|
172
|
-
* @returns array of field
|
|
173
|
-
*/
|
|
174
|
-
@Get('/user-task-fields/:workflowname/:elementId')
|
|
175
|
-
@ApiOperation({
|
|
176
|
-
operationId: 'getWorkflowUserTaskFormKey',
|
|
177
|
-
description: 'obtain input fields expected for specific user task',
|
|
178
|
-
})
|
|
179
|
-
async getWorkflowUserTaskFormKey(
|
|
180
|
-
@AppUser() appuser: UserContext,
|
|
181
|
-
@Param('workflowname') workflowname: string,
|
|
182
|
-
@Param('elementId') elementId: string,
|
|
183
|
-
) {
|
|
184
|
-
return await this.workflowService.getWorkflowUserTaskFormKey(
|
|
185
|
-
appuser,
|
|
186
|
-
workflowname,
|
|
187
|
-
elementId,
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
//!! not yet
|
|
192
|
-
//get all workflow definitions
|
|
193
|
-
@Get('/admin/definition')
|
|
194
|
-
@ApiOperation({
|
|
195
|
-
operationId: 'getWorkflowDefinitions',
|
|
196
|
-
description: 'list all workflow definitions, **not yet complete**',
|
|
197
|
-
})
|
|
198
|
-
async getWorkflowDefinitions(@AppUser() appuser: UserContext) {
|
|
199
|
-
return await this.workflowService.getWorkflowDefinitions(appuser);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
//!! not yet
|
|
203
|
-
//create new workflow definitions
|
|
204
|
-
@Post('/admin/definition')
|
|
205
|
-
@ApiOperation({
|
|
206
|
-
operationId: 'newWorkflowDefinitions',
|
|
207
|
-
description: 'create new workflow definitions, **not yet complete**',
|
|
208
|
-
})
|
|
209
|
-
@ApiBody({
|
|
210
|
-
description: 'bpmn definitions in xml',
|
|
211
|
-
type: String,
|
|
212
|
-
})
|
|
213
|
-
async newWorkflowDefinitions(
|
|
214
|
-
@AppUser() appuser: UserContext,
|
|
215
|
-
@Param('workflowname') workflowname: WorkflowName,
|
|
216
|
-
@Body() xml: string,
|
|
217
|
-
) {
|
|
218
|
-
return await this.workflowService.newWorkflowDefinitions(
|
|
219
|
-
appuser,
|
|
220
|
-
workflowname,
|
|
221
|
-
xml,
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
//!! **not yet complete**
|
|
226
|
-
//update workflow definition
|
|
227
|
-
@Put('/admin/definition/:workflowname')
|
|
228
|
-
@ApiOperation({
|
|
229
|
-
operationId: 'updateWorkflowDefinition',
|
|
230
|
-
description:
|
|
231
|
-
'update new workflow definitions with new bpmn definition file **not yet complete**',
|
|
232
|
-
})
|
|
233
|
-
@ApiBody({
|
|
234
|
-
description: 'bpmn definition in xml',
|
|
235
|
-
type: String,
|
|
236
|
-
})
|
|
237
|
-
async updateWorkflowDefinition(
|
|
238
|
-
@AppUser() appuser: UserContext,
|
|
239
|
-
@Param('workflowname') workflowname: WorkflowName,
|
|
240
|
-
@Body() xml: string,
|
|
241
|
-
) {
|
|
242
|
-
return await this.workflowService.updateWorkflowDefinition(
|
|
243
|
-
appuser,
|
|
244
|
-
workflowname,
|
|
245
|
-
xml,
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
//!! **not yet complete**
|
|
250
|
-
//read workflow definition
|
|
251
|
-
@Get('/admin/definition/:workflowname')
|
|
252
|
-
@ApiOperation({
|
|
253
|
-
operationId: 'readWorkflowDefinition',
|
|
254
|
-
description:
|
|
255
|
-
'read workflow process definition and svg **not yet complete**',
|
|
256
|
-
})
|
|
257
|
-
async readWorkflowDefinition(
|
|
258
|
-
@AppUser() appuser: UserContext,
|
|
259
|
-
@Param('workflowname') workflowname: WorkflowName,
|
|
260
|
-
) {
|
|
261
|
-
return await this.workflowService.readWorkflowDefinition(
|
|
262
|
-
appuser,
|
|
263
|
-
workflowname,
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
//!! **not yet complete**
|
|
268
|
-
//drop new workflow definitions
|
|
269
|
-
@Delete('/admin/definition/:workflowname')
|
|
270
|
-
@ApiOperation({
|
|
271
|
-
operationId: 'deleteWorkflowDefinition',
|
|
272
|
-
description: 'delete workflow definitions **not yet complete**',
|
|
273
|
-
})
|
|
274
|
-
async dropWorkflowDefinition(
|
|
275
|
-
@AppUser() appuser: UserContext,
|
|
276
|
-
@Param('workflowname') workflowname: WorkflowName,
|
|
277
|
-
) {
|
|
278
|
-
return await this.workflowService.deleteWorkflowDefinition(
|
|
279
|
-
appuser,
|
|
280
|
-
workflowname,
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
/********************* workflow admin api end ***********************/
|
|
284
|
-
/********************* workflow flow crud begin***********************/
|
|
285
|
-
|
|
286
|
-
//search all workflow in this tenant
|
|
287
|
-
@Post('/search-all')
|
|
288
|
-
@HttpCode(200)
|
|
289
|
-
@ApiOperation({
|
|
290
|
-
operationId: 'searchWorkflowProcesses',
|
|
291
|
-
description: 'search all workflow processes',
|
|
292
|
-
})
|
|
293
|
-
@ApiBody({
|
|
294
|
-
description: 'workflow data',
|
|
295
|
-
type: SearchWorkflowProcessApiSchema,
|
|
296
|
-
})
|
|
297
|
-
@ApiResponse({
|
|
298
|
-
status: 200,
|
|
299
|
-
type: [WorkflowProcessApiSchema],
|
|
300
|
-
description: 'Success',
|
|
301
|
-
})
|
|
302
|
-
async searchWorkflows(@AppUser() appuser: UserContext, @Body() filter: any) {
|
|
303
|
-
return await this.workflowService.searchWorkflowProcesses(appuser, filter);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
@Post('/search-active')
|
|
307
|
-
@HttpCode(200)
|
|
308
|
-
@ApiOperation({
|
|
309
|
-
operationId: 'searchRunningWorkflowProcesses',
|
|
310
|
-
description: 'search running workflow processes',
|
|
311
|
-
})
|
|
312
|
-
@ApiBody({
|
|
313
|
-
description: 'workflow data',
|
|
314
|
-
type: SearchWorkflowProcessApiSchema,
|
|
315
|
-
})
|
|
316
|
-
@ApiResponse({
|
|
317
|
-
status: 200,
|
|
318
|
-
type: [WorkflowProcessApiSchema],
|
|
319
|
-
description: 'Success',
|
|
320
|
-
})
|
|
321
|
-
async searchRunningWorkflowProcesses(
|
|
322
|
-
@AppUser() appuser: UserContext,
|
|
323
|
-
@Body() filter: any,
|
|
324
|
-
) {
|
|
325
|
-
return await this.workflowService.searchRunningWorkflowProcesses(
|
|
326
|
-
appuser,
|
|
327
|
-
filter,
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* initiate new workflow
|
|
333
|
-
* @param appuser
|
|
334
|
-
* @param workflowname
|
|
335
|
-
* @param data
|
|
336
|
-
* @returns process
|
|
337
|
-
*/
|
|
338
|
-
@Post('/:workflowname')
|
|
339
|
-
@ApiBody({
|
|
340
|
-
description: 'workflow data',
|
|
341
|
-
type: Object,
|
|
342
|
-
})
|
|
343
|
-
@ApiOperation({
|
|
344
|
-
operationId: 'startWorkflow',
|
|
345
|
-
description: 'start new workflow process',
|
|
346
|
-
})
|
|
347
|
-
async startWorkflow(
|
|
348
|
-
@AppUser() appuser: UserContext,
|
|
349
|
-
@Param('workflowname') workflowname: WorkflowName,
|
|
350
|
-
@Body() data: any,
|
|
351
|
-
) {
|
|
352
|
-
return await this.workflowService.startWorkflow(
|
|
353
|
-
appuser,
|
|
354
|
-
workflowname,
|
|
355
|
-
data,
|
|
356
|
-
);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* read single workflow process
|
|
361
|
-
* status: done
|
|
362
|
-
* @param appuser
|
|
363
|
-
* @param id
|
|
364
|
-
* @returns workflow
|
|
365
|
-
*/
|
|
366
|
-
@Get('/:id')
|
|
367
|
-
@ApiOperation({
|
|
368
|
-
operationId: 'getWorkflowById',
|
|
369
|
-
description: 'get workflow process data and task status',
|
|
370
|
-
})
|
|
371
|
-
async getWorkflowById(
|
|
372
|
-
@AppUser() appuser: UserContext,
|
|
373
|
-
@Param('id') id: string,
|
|
374
|
-
) {
|
|
375
|
-
return await this.workflowService.getWorkflowById(appuser, id);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
// update workflow seems not require
|
|
379
|
-
// //update single workflow
|
|
380
|
-
// @Put('/:id')
|
|
381
|
-
// @ApiOperation({
|
|
382
|
-
// operationId: 'updateWorkflowById',
|
|
383
|
-
// description: 'update specific workflow process',
|
|
384
|
-
// })
|
|
385
|
-
// @ApiBody({
|
|
386
|
-
// description: 'workflow data',
|
|
387
|
-
// type: WorkflowDataApiSchema,
|
|
388
|
-
// })
|
|
389
|
-
// @Roles(Role.Everyone)
|
|
390
|
-
// async updateWorkflowById(@AppUser() appuser: UserContext,@Param('id') id: string,@Body() data: any,) {
|
|
391
|
-
// return await this.workflowService.updateWorkflowById(appuser,id,data);
|
|
392
|
-
// }
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* delete/cancel single workflow process
|
|
396
|
-
* status: done
|
|
397
|
-
* @param appuser
|
|
398
|
-
* @param id
|
|
399
|
-
* @returns
|
|
400
|
-
*/
|
|
401
|
-
@Delete('/:id')
|
|
402
|
-
@ApiOperation({
|
|
403
|
-
operationId: 'deleteWorkflowById',
|
|
404
|
-
description: 'delete specific workflow process',
|
|
405
|
-
})
|
|
406
|
-
async deleteWorkflowById(
|
|
407
|
-
@AppUser() appuser: UserContext,
|
|
408
|
-
@Param('id') id: string,
|
|
409
|
-
) {
|
|
410
|
-
return await this.workflowService.deleteWorkflowById(appuser, id);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
/********************* workflow flow crud end ***********************/
|
|
414
|
-
}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by simpleapp generator. Every
|
|
3
|
-
* MODIFICATION OVERRIDE BY GENERATEOR
|
|
4
|
-
* last change 2024-04-23
|
|
5
|
-
* Author: Ks Tan
|
|
6
|
-
*/
|
|
7
|
-
import {
|
|
8
|
-
Injectable,
|
|
9
|
-
InternalServerErrorException,
|
|
10
|
-
Logger,
|
|
11
|
-
Inject,
|
|
12
|
-
} from '@nestjs/common';
|
|
13
|
-
import {
|
|
14
|
-
IExecution,
|
|
15
|
-
Item,
|
|
16
|
-
NODE_ACTION,
|
|
17
|
-
FLOW_ACTION,
|
|
18
|
-
IAppDelegate,
|
|
19
|
-
IDefinition,
|
|
20
|
-
BPMNServer,
|
|
21
|
-
Execution,
|
|
22
|
-
} from 'bpmn-server';
|
|
23
|
-
import { UserResolverService } from '../../services/userresolver.service';
|
|
24
|
-
import { moddleOptions } from 'bpmn-server/dist/elements/js-bpmn-moddle';
|
|
25
|
-
let mydelegate: WorkflowDelegate;
|
|
26
|
-
@Injectable()
|
|
27
|
-
export class WorkflowDelegate implements IAppDelegate {
|
|
28
|
-
protected logger = new Logger();
|
|
29
|
-
server: BPMNServer;
|
|
30
|
-
|
|
31
|
-
@Inject(UserResolverService)
|
|
32
|
-
servicesProvider: UserResolverService;
|
|
33
|
-
|
|
34
|
-
constructor() {}
|
|
35
|
-
getServicesProvider = (execution: Execution) => this.servicesProvider;
|
|
36
|
-
|
|
37
|
-
//config will use setServer to define bpmnserver
|
|
38
|
-
setServer(server: BPMNServer) {
|
|
39
|
-
mydelegate = this;
|
|
40
|
-
this.server = server;
|
|
41
|
-
return mydelegate;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async startUp(options) {
|
|
45
|
-
// mydelegate.startUp(options);
|
|
46
|
-
// if (options['cron'] == false) {
|
|
47
|
-
// return;
|
|
48
|
-
// }
|
|
49
|
-
// console.log('myserver started');
|
|
50
|
-
// var query = { "items.status": "start" };
|
|
51
|
-
// var list = await this.server.dataStore.findItems(query);
|
|
52
|
-
// if (list.length > 0) {
|
|
53
|
-
// this.server.logger.log("** There are " + list.length," items that seems to be hung");
|
|
54
|
-
// }
|
|
55
|
-
}
|
|
56
|
-
sendEmail(to, msg, body) {
|
|
57
|
-
throw Error('sendEmail must be implemented by AppDelegate');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
get moddleOptions() {
|
|
61
|
-
return moddleOptions;
|
|
62
|
-
}
|
|
63
|
-
async executionStarted(execution: IExecution) {}
|
|
64
|
-
async executionEvent(context, event) {}
|
|
65
|
-
|
|
66
|
-
async messageThrown(messageId, data, messageMatchingKey: any, item: Item) {
|
|
67
|
-
const msgId = item.node.messageId;
|
|
68
|
-
// item.context.logger.log('Message Issued' + msgId);
|
|
69
|
-
// issue it back for others to receive
|
|
70
|
-
const resp = await item.context.engine.throwMessage(
|
|
71
|
-
msgId,
|
|
72
|
-
data,
|
|
73
|
-
messageMatchingKey,
|
|
74
|
-
);
|
|
75
|
-
if (resp && resp.instance) {
|
|
76
|
-
// item.context.logger.log(
|
|
77
|
-
// ' invoked another process ' +
|
|
78
|
-
// resp.instance.id +
|
|
79
|
-
// ' for ' +
|
|
80
|
-
// resp.instance.name,
|
|
81
|
-
// );
|
|
82
|
-
} else await this.issueMessage(messageId, data);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
async issueMessage(messageId, data) {}
|
|
86
|
-
async issueSignal(signalId, data) {}
|
|
87
|
-
async signalThrown(signalId, data, messageMatchingKey: any, item: Item) {
|
|
88
|
-
// item.context.logger.log('Signal Issued' + signalId);
|
|
89
|
-
|
|
90
|
-
const resp = await item.context.engine.throwSignal(
|
|
91
|
-
signalId,
|
|
92
|
-
data,
|
|
93
|
-
messageMatchingKey,
|
|
94
|
-
);
|
|
95
|
-
if (resp && resp.instance) {
|
|
96
|
-
// item.context.logger.log(
|
|
97
|
-
// ' invoked another process ' +
|
|
98
|
-
// resp.instance.id +
|
|
99
|
-
// ' for ' +
|
|
100
|
-
// resp.instance.name,
|
|
101
|
-
// );
|
|
102
|
-
} else await this.issueSignal(signalId, data);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
consoleKeyTypes = (obj1) => {
|
|
106
|
-
const keys = Object.getOwnPropertyNames(obj1);
|
|
107
|
-
// console.log('consoleKeyTypesconsoleKeyTypesconsoleKeyTypes', keys);
|
|
108
|
-
for (let k = 0; k < keys.length; k++) {
|
|
109
|
-
const key = keys[k];
|
|
110
|
-
|
|
111
|
-
if (!obj1[key]) {
|
|
112
|
-
// console.log(key, 'empty ');
|
|
113
|
-
} else if (typeof obj1[key] == 'object') {
|
|
114
|
-
// console.log(key, typeof obj1[key], Object.keys(obj1[key]));
|
|
115
|
-
} else {
|
|
116
|
-
// console.log(key, typeof obj1[key], obj1[key]);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
async serviceCalled(inputdata, item: Item) {
|
|
121
|
-
// try{
|
|
122
|
-
//server
|
|
123
|
-
//uids
|
|
124
|
-
//instance
|
|
125
|
-
//definition
|
|
126
|
-
//process =>[ '$type', 'id', 'isExecutable', 'flowElements' ]
|
|
127
|
-
//Item => cant get
|
|
128
|
-
//state
|
|
129
|
-
// this.logger.error('EXECUTING serviceCalled');
|
|
130
|
-
// const delegateServiceName = item['item']['element']['def']['delegateExpression']
|
|
131
|
-
// this.logger.error("EXECUTING serviceCalled",delegateServiceName)
|
|
132
|
-
// const processName = item['instance']['name'];
|
|
133
|
-
// const data = item['instance']['data'];
|
|
134
|
-
// const vars = item['instance']['vars'];
|
|
135
|
-
// const props = {
|
|
136
|
-
// processName: processName,
|
|
137
|
-
// delegateName: delegateServiceName,
|
|
138
|
-
// inputData: inputdata,
|
|
139
|
-
// vars: vars,
|
|
140
|
-
// data: data,
|
|
141
|
-
// };
|
|
142
|
-
// if (
|
|
143
|
-
// this.servicesProvider[processName] &&
|
|
144
|
-
// this.servicesProvider[processName][delegateServiceName]
|
|
145
|
-
// ) {
|
|
146
|
-
// this.servicesProvider[processName][delegateServiceName](props, item);
|
|
147
|
-
// } else {
|
|
148
|
-
// this.logger.error(
|
|
149
|
-
// `Undefined delegate service "${processName}":"${delegateServiceName}"`,
|
|
150
|
-
// props,
|
|
151
|
-
// );
|
|
152
|
-
// }
|
|
153
|
-
// }catch(e){
|
|
154
|
-
// this.logger.error(
|
|
155
|
-
// `Unknown error delegate service `,
|
|
156
|
-
// Object.keys(item)
|
|
157
|
-
// );
|
|
158
|
-
// }
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
scopeEval(scope, script) {
|
|
162
|
-
let result;
|
|
163
|
-
|
|
164
|
-
try {
|
|
165
|
-
var js = `
|
|
166
|
-
var item=this;
|
|
167
|
-
var data=this.data;
|
|
168
|
-
var input=this.input;
|
|
169
|
-
var output=this.output;
|
|
170
|
-
return (${script});`;
|
|
171
|
-
result = Function(js).bind(scope)();
|
|
172
|
-
} catch (exc) {
|
|
173
|
-
// console.log('error in script evaluation', js);
|
|
174
|
-
// console.log(exc);
|
|
175
|
-
}
|
|
176
|
-
return result;
|
|
177
|
-
}
|
|
178
|
-
async scopeJS(scope, script) {
|
|
179
|
-
const AsyncFunction = Object.getPrototypeOf(
|
|
180
|
-
async function () {},
|
|
181
|
-
).constructor;
|
|
182
|
-
let result;
|
|
183
|
-
try {
|
|
184
|
-
var js = `
|
|
185
|
-
var item=this;
|
|
186
|
-
var data=this.data;
|
|
187
|
-
var input=this.input;
|
|
188
|
-
var output=this.output;
|
|
189
|
-
${script}`;
|
|
190
|
-
result = await new AsyncFunction(js).bind(scope)();
|
|
191
|
-
// scope.token.log('..executing js is done ' + scope.id);
|
|
192
|
-
} catch (exc) {
|
|
193
|
-
// scope.token.log(
|
|
194
|
-
// 'ERROR in executing Script ' + exc.message + '\n' + script,
|
|
195
|
-
// );
|
|
196
|
-
// console.log('error in script execution', js);
|
|
197
|
-
// console.log(exc);
|
|
198
|
-
}
|
|
199
|
-
return result;
|
|
200
|
-
}
|
|
201
|
-
}
|