@tsed/formio 6.88.1 → 6.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{FormioModule.d.ts → cjs/FormioModule.d.ts} +0 -0
- package/lib/{FormioModule.js → cjs/FormioModule.js} +34 -34
- package/lib/cjs/FormioModule.js.map +1 -0
- package/lib/{builder → cjs/builder}/FormioMapper.d.ts +0 -0
- package/lib/{builder → cjs/builder}/FormioMapper.js +0 -0
- package/lib/cjs/builder/FormioMapper.js.map +1 -0
- package/lib/{components → cjs/components}/AlterActions.d.ts +0 -0
- package/lib/{components → cjs/components}/AlterActions.js +8 -8
- package/lib/cjs/components/AlterActions.js.map +1 -0
- package/lib/{components → cjs/components}/AlterAudit.d.ts +0 -0
- package/lib/{components → cjs/components}/AlterAudit.js +2 -2
- package/lib/cjs/components/AlterAudit.js.map +1 -0
- package/lib/{components → cjs/components}/AlterHost.d.ts +0 -0
- package/lib/{components → cjs/components}/AlterHost.js +2 -2
- package/lib/cjs/components/AlterHost.js.map +1 -0
- package/lib/{components → cjs/components}/AlterLog.d.ts +0 -0
- package/lib/{components → cjs/components}/AlterLog.js +2 -2
- package/lib/cjs/components/AlterLog.js.map +1 -0
- package/lib/{components → cjs/components}/AlterSkip.d.ts +0 -0
- package/lib/{components → cjs/components}/AlterSkip.js +9 -9
- package/lib/cjs/components/AlterSkip.js.map +1 -0
- package/lib/{components → cjs/components}/AlterTemplateExportSteps.d.ts +0 -0
- package/lib/{components → cjs/components}/AlterTemplateExportSteps.js +6 -6
- package/lib/cjs/components/AlterTemplateExportSteps.js.map +1 -0
- package/lib/{components → cjs/components}/AlterTemplateImportSteps.d.ts +0 -0
- package/lib/{components → cjs/components}/AlterTemplateImportSteps.js +5 -5
- package/lib/cjs/components/AlterTemplateImportSteps.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/action.d.ts +0 -0
- package/lib/{decorators → cjs/decorators}/action.js +3 -3
- package/lib/cjs/decorators/action.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/actionCtx.d.ts +0 -0
- package/lib/{decorators → cjs/decorators}/actionCtx.js +1 -1
- package/lib/cjs/decorators/actionCtx.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/alter.d.ts +0 -0
- package/lib/{decorators → cjs/decorators}/alter.js +3 -3
- package/lib/cjs/decorators/alter.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/on.d.ts +0 -0
- package/lib/{decorators → cjs/decorators}/on.js +3 -3
- package/lib/cjs/decorators/on.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/useFormioAuth.d.ts +0 -0
- package/lib/{decorators → cjs/decorators}/useFormioAuth.js +1 -1
- package/lib/cjs/decorators/useFormioAuth.js.map +1 -0
- package/lib/{domain → cjs/domain}/AlterHook.d.ts +0 -0
- package/lib/{domain → cjs/domain}/AlterHook.js +0 -0
- package/lib/cjs/domain/AlterHook.js.map +1 -0
- package/lib/{domain → cjs/domain}/Formio.d.ts +0 -0
- package/lib/{domain → cjs/domain}/Formio.js +0 -0
- package/lib/cjs/domain/Formio.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioAction.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioAction.js +0 -0
- package/lib/cjs/domain/FormioAction.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioActionsIndex.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioActionsIndex.js +0 -0
- package/lib/cjs/domain/FormioActionsIndex.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioAuth.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioAuth.js +0 -0
- package/lib/cjs/domain/FormioAuth.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioBaseModel.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioBaseModel.js +0 -0
- package/lib/cjs/domain/FormioBaseModel.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioConfig.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioConfig.js +0 -0
- package/lib/cjs/domain/FormioConfig.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioCtxMapper.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioCtxMapper.js +0 -0
- package/lib/cjs/domain/FormioCtxMapper.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioDecodedToken.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioDecodedToken.js +0 -0
- package/lib/cjs/domain/FormioDecodedToken.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioErrors.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioErrors.js +0 -0
- package/lib/cjs/domain/FormioErrors.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioHooks.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioHooks.js +0 -0
- package/lib/cjs/domain/FormioHooks.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioJs.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioJs.js +0 -0
- package/lib/cjs/domain/FormioJs.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioModels.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioModels.js +1 -1
- package/lib/cjs/domain/FormioModels.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioRouter.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioRouter.js +0 -0
- package/lib/cjs/domain/FormioRouter.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioSettings.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioSettings.js +0 -0
- package/lib/cjs/domain/FormioSettings.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioTemplate.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioTemplate.js +0 -0
- package/lib/cjs/domain/FormioTemplate.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioTemplateUtil.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioTemplateUtil.js +0 -0
- package/lib/cjs/domain/FormioTemplateUtil.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioUpdate.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioUpdate.js +0 -0
- package/lib/cjs/domain/FormioUpdate.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioUtils.d.ts +0 -0
- package/lib/{domain → cjs/domain}/FormioUtils.js +0 -0
- package/lib/cjs/domain/FormioUtils.js.map +1 -0
- package/lib/{domain → cjs/domain}/OnHook.d.ts +0 -0
- package/lib/{domain → cjs/domain}/OnHook.js +0 -0
- package/lib/cjs/domain/OnHook.js.map +1 -0
- package/lib/{domain → cjs/domain}/Resource.d.ts +0 -0
- package/lib/{domain → cjs/domain}/Resource.js +0 -0
- package/lib/cjs/domain/Resource.js.map +1 -0
- package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
- package/lib/cjs/index.js +46 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/FormioAuthMiddleware.d.ts +0 -0
- package/lib/{middlewares → cjs/middlewares}/FormioAuthMiddleware.js +12 -12
- package/lib/cjs/middlewares/FormioAuthMiddleware.js.map +1 -0
- package/lib/{services → cjs/services}/FormioAuthService.d.ts +1 -1
- package/lib/{services → cjs/services}/FormioAuthService.js +13 -13
- package/lib/cjs/services/FormioAuthService.js.map +1 -0
- package/lib/{services → cjs/services}/FormioDatabase.d.ts +0 -0
- package/lib/{services → cjs/services}/FormioDatabase.js +10 -10
- package/lib/cjs/services/FormioDatabase.js.map +1 -0
- package/lib/{services → cjs/services}/FormioHooksService.d.ts +0 -0
- package/lib/{services → cjs/services}/FormioHooksService.js +9 -9
- package/lib/cjs/services/FormioHooksService.js.map +1 -0
- package/lib/{services → cjs/services}/FormioInstaller.d.ts +0 -0
- package/lib/{services → cjs/services}/FormioInstaller.js +8 -8
- package/lib/cjs/services/FormioInstaller.js.map +1 -0
- package/lib/{services → cjs/services}/FormioService.d.ts +0 -0
- package/lib/{services → cjs/services}/FormioService.js +8 -8
- package/lib/cjs/services/FormioService.js.map +1 -0
- package/lib/{utils → cjs/utils}/isMongoId.d.ts +0 -0
- package/lib/{utils → cjs/utils}/isMongoId.js +0 -0
- package/lib/cjs/utils/isMongoId.js.map +1 -0
- package/lib/esm/FormioModule.js +147 -0
- package/lib/{FormioModule.js.map → esm/FormioModule.js.map} +1 -1
- package/lib/esm/builder/FormioMapper.js +49 -0
- package/lib/esm/builder/FormioMapper.js.map +1 -0
- package/lib/esm/components/AlterActions.js +63 -0
- package/lib/esm/components/AlterActions.js.map +1 -0
- package/lib/esm/components/AlterAudit.js +13 -0
- package/lib/esm/components/AlterAudit.js.map +1 -0
- package/lib/esm/components/AlterHost.js +12 -0
- package/lib/esm/components/AlterHost.js.map +1 -0
- package/lib/esm/components/AlterLog.js +13 -0
- package/lib/esm/components/AlterLog.js.map +1 -0
- package/lib/esm/components/AlterSkip.js +29 -0
- package/lib/esm/components/AlterSkip.js.map +1 -0
- package/lib/esm/components/AlterTemplateExportSteps.js +49 -0
- package/lib/esm/components/AlterTemplateExportSteps.js.map +1 -0
- package/lib/esm/components/AlterTemplateImportSteps.js +42 -0
- package/lib/esm/components/AlterTemplateImportSteps.js.map +1 -0
- package/lib/esm/decorators/action.js +16 -0
- package/lib/esm/decorators/action.js.map +1 -0
- package/lib/esm/decorators/actionCtx.js +19 -0
- package/lib/esm/decorators/actionCtx.js.map +1 -0
- package/lib/esm/decorators/alter.js +16 -0
- package/lib/esm/decorators/alter.js.map +1 -0
- package/lib/esm/decorators/on.js +16 -0
- package/lib/esm/decorators/on.js.map +1 -0
- package/lib/esm/decorators/useFormioAuth.js +11 -0
- package/lib/esm/decorators/useFormioAuth.js.map +1 -0
- package/lib/esm/domain/AlterHook.js +2 -0
- package/lib/esm/domain/AlterHook.js.map +1 -0
- package/lib/esm/domain/Formio.js +2 -0
- package/lib/esm/domain/Formio.js.map +1 -0
- package/lib/esm/domain/FormioAction.js +2 -0
- package/lib/esm/domain/FormioAction.js.map +1 -0
- package/lib/esm/domain/FormioActionsIndex.js +2 -0
- package/lib/esm/domain/FormioActionsIndex.js.map +1 -0
- package/lib/esm/domain/FormioAuth.js +2 -0
- package/lib/esm/domain/FormioAuth.js.map +1 -0
- package/lib/esm/domain/FormioBaseModel.js +2 -0
- package/lib/esm/domain/FormioBaseModel.js.map +1 -0
- package/lib/esm/domain/FormioConfig.js +2 -0
- package/lib/esm/domain/FormioConfig.js.map +1 -0
- package/lib/esm/domain/FormioCtxMapper.js +2 -0
- package/lib/esm/domain/FormioCtxMapper.js.map +1 -0
- package/lib/esm/domain/FormioDecodedToken.js +2 -0
- package/lib/esm/domain/FormioDecodedToken.js.map +1 -0
- package/lib/esm/domain/FormioErrors.js +2 -0
- package/lib/esm/domain/FormioErrors.js.map +1 -0
- package/lib/esm/domain/FormioHooks.js +2 -0
- package/lib/esm/domain/FormioHooks.js.map +1 -0
- package/lib/esm/domain/FormioJs.js +2 -0
- package/lib/esm/domain/FormioJs.js.map +1 -0
- package/lib/esm/domain/FormioModels.js +2 -0
- package/lib/esm/domain/FormioModels.js.map +1 -0
- package/lib/esm/domain/FormioRouter.js +2 -0
- package/lib/esm/domain/FormioRouter.js.map +1 -0
- package/lib/esm/domain/FormioSettings.js +2 -0
- package/lib/esm/domain/FormioSettings.js.map +1 -0
- package/lib/esm/domain/FormioTemplate.js +2 -0
- package/lib/esm/domain/FormioTemplate.js.map +1 -0
- package/lib/esm/domain/FormioTemplateUtil.js +2 -0
- package/lib/esm/domain/FormioTemplateUtil.js.map +1 -0
- package/lib/esm/domain/FormioUpdate.js +2 -0
- package/lib/esm/domain/FormioUpdate.js.map +1 -0
- package/lib/esm/domain/FormioUtils.js +2 -0
- package/lib/esm/domain/FormioUtils.js.map +1 -0
- package/lib/esm/domain/OnHook.js +2 -0
- package/lib/esm/domain/OnHook.js.map +1 -0
- package/lib/esm/domain/Resource.js +2 -0
- package/lib/esm/domain/Resource.js.map +1 -0
- package/lib/esm/index.js +43 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/middlewares/FormioAuthMiddleware.js +38 -0
- package/lib/esm/middlewares/FormioAuthMiddleware.js.map +1 -0
- package/lib/esm/services/FormioAuthService.js +179 -0
- package/lib/esm/services/FormioAuthService.js.map +1 -0
- package/lib/esm/services/FormioDatabase.js +100 -0
- package/lib/{services → esm/services}/FormioDatabase.js.map +1 -1
- package/lib/esm/services/FormioHooksService.js +78 -0
- package/lib/esm/services/FormioHooksService.js.map +1 -0
- package/lib/esm/services/FormioInstaller.js +47 -0
- package/lib/esm/services/FormioInstaller.js.map +1 -0
- package/lib/esm/services/FormioService.js +97 -0
- package/lib/esm/services/FormioService.js.map +1 -0
- package/lib/esm/utils/isMongoId.js +4 -0
- package/lib/esm/utils/isMongoId.js.map +1 -0
- package/lib/types/FormioModule.d.ts +24 -0
- package/lib/types/builder/FormioMapper.d.ts +11 -0
- package/lib/types/components/AlterActions.d.ts +15 -0
- package/lib/types/components/AlterAudit.d.ts +5 -0
- package/lib/types/components/AlterHost.d.ts +5 -0
- package/lib/types/components/AlterLog.d.ts +5 -0
- package/lib/types/components/AlterSkip.d.ts +7 -0
- package/lib/types/components/AlterTemplateExportSteps.d.ts +12 -0
- package/lib/types/components/AlterTemplateImportSteps.d.ts +11 -0
- package/lib/types/decorators/action.d.ts +7 -0
- package/lib/types/decorators/actionCtx.d.ts +23 -0
- package/lib/types/decorators/alter.d.ts +6 -0
- package/lib/types/decorators/on.d.ts +6 -0
- package/lib/types/decorators/useFormioAuth.d.ts +6 -0
- package/lib/types/domain/AlterHook.d.ts +3 -0
- package/lib/types/domain/Formio.d.ts +112 -0
- package/lib/types/domain/FormioAction.d.ts +20 -0
- package/lib/types/domain/FormioActionsIndex.d.ts +15 -0
- package/lib/types/domain/FormioAuth.d.ts +67 -0
- package/lib/types/domain/FormioBaseModel.d.ts +11 -0
- package/lib/types/domain/FormioConfig.d.ts +59 -0
- package/lib/types/domain/FormioCtxMapper.d.ts +7 -0
- package/lib/types/domain/FormioDecodedToken.d.ts +12 -0
- package/lib/types/domain/FormioErrors.d.ts +53 -0
- package/lib/types/domain/FormioHooks.d.ts +194 -0
- package/lib/types/domain/FormioJs.d.ts +17 -0
- package/lib/types/domain/FormioModels.d.ts +42 -0
- package/lib/types/domain/FormioRouter.d.ts +7 -0
- package/lib/types/domain/FormioSettings.d.ts +53 -0
- package/lib/types/domain/FormioTemplate.d.ts +8 -0
- package/lib/types/domain/FormioTemplateUtil.d.ts +13 -0
- package/lib/types/domain/FormioUpdate.d.ts +19 -0
- package/lib/types/domain/FormioUtils.d.ts +307 -0
- package/lib/types/domain/OnHook.d.ts +3 -0
- package/lib/types/domain/Resource.d.ts +18 -0
- package/lib/types/index.d.ts +38 -0
- package/lib/types/middlewares/FormioAuthMiddleware.d.ts +11 -0
- package/lib/types/services/FormioAuthService.d.ts +54 -0
- package/lib/types/services/FormioDatabase.d.ts +24 -0
- package/lib/types/services/FormioHooksService.d.ts +17 -0
- package/lib/types/services/FormioInstaller.d.ts +14 -0
- package/lib/types/services/FormioService.d.ts +36 -0
- package/lib/types/utils/isMongoId.d.ts +1 -0
- package/package.json +22 -14
- package/tsconfig.compile.esm.json +23 -0
- package/lib/builder/FormioMapper.js.map +0 -1
- package/lib/components/AlterActions.js.map +0 -1
- package/lib/components/AlterAudit.js.map +0 -1
- package/lib/components/AlterHost.js.map +0 -1
- package/lib/components/AlterLog.js.map +0 -1
- package/lib/components/AlterSkip.js.map +0 -1
- package/lib/components/AlterTemplateExportSteps.js.map +0 -1
- package/lib/components/AlterTemplateImportSteps.js.map +0 -1
- package/lib/decorators/action.js.map +0 -1
- package/lib/decorators/actionCtx.js.map +0 -1
- package/lib/decorators/alter.js.map +0 -1
- package/lib/decorators/on.js.map +0 -1
- package/lib/decorators/useFormioAuth.js.map +0 -1
- package/lib/domain/AlterHook.js.map +0 -1
- package/lib/domain/Formio.js.map +0 -1
- package/lib/domain/FormioAction.js.map +0 -1
- package/lib/domain/FormioActionsIndex.js.map +0 -1
- package/lib/domain/FormioAuth.js.map +0 -1
- package/lib/domain/FormioBaseModel.js.map +0 -1
- package/lib/domain/FormioConfig.js.map +0 -1
- package/lib/domain/FormioCtxMapper.js.map +0 -1
- package/lib/domain/FormioDecodedToken.js.map +0 -1
- package/lib/domain/FormioErrors.js.map +0 -1
- package/lib/domain/FormioHooks.js.map +0 -1
- package/lib/domain/FormioJs.js.map +0 -1
- package/lib/domain/FormioModels.js.map +0 -1
- package/lib/domain/FormioRouter.js.map +0 -1
- package/lib/domain/FormioSettings.js.map +0 -1
- package/lib/domain/FormioTemplate.js.map +0 -1
- package/lib/domain/FormioTemplateUtil.js.map +0 -1
- package/lib/domain/FormioUpdate.js.map +0 -1
- package/lib/domain/FormioUtils.js.map +0 -1
- package/lib/domain/OnHook.js.map +0 -1
- package/lib/domain/Resource.js.map +0 -1
- package/lib/index.js +0 -46
- package/lib/index.js.map +0 -1
- package/lib/middlewares/FormioAuthMiddleware.js.map +0 -1
- package/lib/services/FormioAuthService.js.map +0 -1
- package/lib/services/FormioHooksService.js.map +0 -1
- package/lib/services/FormioInstaller.js.map +0 -1
- package/lib/services/FormioService.js.map +0 -1
- package/lib/utils/isMongoId.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioMapper.js","sourceRoot":"","sources":["../../src/builder/FormioMapper.ts"],"names":[],"mappings":";;;AAEA,MAAa,YAAY;IACvB,YAAqB,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;IAAG,CAAC;IAEjD,IAAI,CAAC,GAAW;QACd,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAE1E,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,C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QAEzC,IAAI,GAAG,EAAE;YACP,OAAO,GAAG,CAAC;SACZ;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC,EAAE;YACvD,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;gBACvD,OAAO;oBACL,GAAG,GAAG;oBACN,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC;iBACrC,CAAC;YACJ,CAAC,EAAE,EAAE,CAAC,CAAC;SACR;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA3DD,oCA2DC","sourcesContent":["import {FormioCtxMapper} from \"../domain/FormioCtxMapper\";\n\nexport class FormioMapper {\n constructor(readonly ctxData: FormioCtxMapper) {}\n\n find(key: string) {\n const store = Object.values(this.ctxData).find((store) => store.get(key));\n\n return store?.get(key);\n }\n\n findId(data: string) {\n const key = String(data).startsWith(\"$machineName:\") ? String(data) : `$machineName:${String(data)}`;\n const item = this.find(key);\n\n return item ? item._id : undefined;\n }\n\n findMachineName(data: any) {\n const key = String(data);\n const item: any = this.find(key);\n\n return item ? `$machineName:${item.machineName}` : undefined;\n }\n\n mapToExport(data: any) {\n return this.mapData(data, this.findMachineName.bind(this));\n }\n\n mapToImport(data: any) {\n return this.mapData(data, this.findId.bind(this));\n }\n\n mapData(data: any, resolver: any): any {\n if (!data) {\n return data;\n }\n\n if (Array.isArray(data)) {\n return data.map((item) => {\n return this.mapData(item, resolver);\n });\n }\n\n const key = resolver(data, this.ctxData);\n\n if (key) {\n return key;\n }\n\n if (typeof data === \"object\" && !(data instanceof Date)) {\n return Object.entries(data).reduce((obj, [key, value]) => {\n return {\n ...obj,\n [key]: this.mapData(value, resolver)\n };\n }, {});\n }\n\n return data;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|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I,CAAC,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;CACF,CAAA;AAhEC;IADC,WAAM,EAAE;sCACW,oBAAe;8CAAC;AAGpC;IADC,WAAM,EAAE;sCACS,6BAAa;4CAAC;AALrB,YAAY;IADxB,aAAK,CAAC,SAAS,CAAC;GACJ,YAAY,CAkExB;AAlEY,oCAAY","sourcesContent":["import {EndpointMetadata, PlatformContext, PlatformHandler} from \"@tsed/common\";\nimport {Inject, InjectorService, Provider} from \"@tsed/di\";\nimport {FormioActionInfo} from \"@tsed/formio-types\";\nimport {Alter} from \"../decorators/alter\";\nimport {AlterHook} from \"../domain/AlterHook\";\nimport {SetActionItemMessage} from \"../domain/FormioAction\";\nimport {FormioActions} from \"../domain/FormioActionsIndex\";\nimport {FormioService} from \"../services/FormioService\";\n\n@Alter(\"actions\")\nexport class AlterActions implements AlterHook {\n @Inject()\n protected injector: InjectorService;\n\n @Inject()\n protected formio: FormioService;\n\n transform(actions: FormioActions): FormioActions {\n const {Action} = this.formio;\n\n return this.getActions().reduce((actions, provider) => {\n const instance = this.injector.invoke<any>(provider.token);\n const options = provider.store.get<FormioActionInfo>(\"formio:action\");\n const resolveHandler = this.createResolveHandler(provider);\n\n return {\n ...actions,\n [options.name]: class extends Action {\n static access = options.access;\n static async info(req: any, res: any, next: Function) {\n let opts = {...options};\n\n if (instance.info) {\n opts = await instance.info(opts, req, res);\n }\n\n next(null, opts);\n }\n\n static async settingsForm(req: any, res: any, next: Function) {\n next(null, await instance.settingsForm(req, res));\n }\n\n resolve(handler: string, method: string, req: any, res: any, next: Function, setActionItemMessage: SetActionItemMessage): void {\n resolveHandler(this, handler, method, req, res, next, setActionItemMessage);\n }\n }\n };\n }, actions);\n }\n\n protected getActions() {\n return this.injector.getProviders(\"formio:action\");\n }\n\n protected createResolveHandler(provider: Provider<any>) {\n const platformHandler = this.injector.get<PlatformHandler>(PlatformHandler)!;\n const middleware = platformHandler.createCustomHandler(provider, \"resolve\");\n\n return (\n action: any,\n handler: string,\n method: string,\n req: {$ctx: PlatformContext},\n res: Response,\n next: any,\n setActionItemMessage: SetActionItemMessage\n ) => {\n req.$ctx.set(\"ACTION_CTX\", {handler, method, setActionItemMessage, action});\n req.$ctx.endpoint = EndpointMetadata.get(provider.useClass, \"resolve\");\n\n middleware(req.$ctx)\n .then(() => (req.$ctx.data ? platformHandler.flush(req.$ctx.data, req.$ctx) : next()))\n .catch(next);\n };\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterAudit.js","sourceRoot":"","sources":["../../src/components/AlterAudit.ts"],"names":[],"mappings":";;;;AACA,+CAA0C;AAI1C,IAAa,UAAU,GAAvB,MAAa,UAAU;IACrB,SAAS,CAAC,IAAW,EAAE,KAAa,EAAE,GAAoB;QACxD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AALY,UAAU;IADtB,aAAK,CAAC,OAAO,CAAC;GACF,UAAU,CAKtB;AALY,gCAAU","sourcesContent":["import {PlatformContext} from \"@tsed/common\";\nimport {Alter} from \"../decorators/alter\";\nimport {AlterHook} from \"../domain/AlterHook\";\n\n@Alter(\"audit\")\nexport class AlterAudit implements AlterHook {\n transform(info: any[], event: string, ctx: PlatformContext): boolean {\n ctx.logger.info({event, info});\n return false;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterHost.js","sourceRoot":"","sources":["../../src/components/AlterHost.ts"],"names":[],"mappings":";;;;AACA,+CAA0C;AAI1C,IAAa,SAAS,GAAtB,MAAa,SAAS;IACpB,SAAS,CAAC,OAAe,EAAE,GAAoB;QAC7C,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,EAAE,CAAC;IACnE,CAAC;CACF,CAAA;AAJY,SAAS;IADrB,aAAK,CAAC,MAAM,CAAC;GACD,SAAS,CAIrB;AAJY,8BAAS","sourcesContent":["import {PlatformContext} from \"@tsed/common\";\nimport {Alter} from \"../decorators/alter\";\nimport {AlterHook} from \"../domain/AlterHook\";\n\n@Alter(\"host\")\nexport class AlterHost implements AlterHook<string> {\n transform(baseUrl: string, ctx: PlatformContext) {\n return `${ctx.request.protocol}://${ctx.request.host}${baseUrl}`;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterLog.js","sourceRoot":"","sources":["../../src/components/AlterLog.ts"],"names":[],"mappings":";;;;AACA,+CAA0C;AAI1C,IAAa,QAAQ,GAArB,MAAa,QAAQ;IACnB,SAAS,CAAC,KAAa,EAAE,GAAoB,EAAE,GAAG,IAAW;QAC3D,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AALY,QAAQ;IADpB,aAAK,CAAC,KAAK,CAAC;GACA,QAAQ,CAKpB;AALY,4BAAQ","sourcesContent":["import {PlatformContext} from \"@tsed/common\";\nimport {Alter} from \"../decorators/alter\";\nimport {AlterHook} from \"../domain/AlterHook\";\n\n@Alter(\"log\")\nexport class AlterLog implements AlterHook {\n transform(event: string, ctx: PlatformContext, ...info: any[]): boolean {\n ctx.logger.debug({event, info});\n return false;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterSkip.js","sourceRoot":"","sources":["../../src/components/AlterSkip.ts"],"names":[],"mappings":";;;;AAAA,yCAAuD;AACvD,yCAA2C;AAC3C,+CAA0C;AAI1C,IAAa,SAAS,GAAtB,MAAa,SAAS;IAOpB,SAAS,CAAC,KAAU,EAAE,GAAoB;QACxC,IAAI,KAAK,EAAE;YACT,OAAO,IAAI,CAAC;SACb;QAED,MAAM,EAAC,OAAO,EAAC,GAAG,GAAG,CAAC;QACtB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtC,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;YACrC,OAAO,sBAAa,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAjBC;IADC,iBAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC;;0CAChB;AAGhB;IADC,iBAAQ,CAAC,kBAAkB,EAAE,CAAC,YAAY,CAAC,CAAC;;4CACzB;AALT,SAAS;IADrB,aAAK,CAAC,MAAM,CAAC;GACD,SAAS,CAmBrB;AAnBY,8BAAS","sourcesContent":["import {Constant, PlatformContext} from \"@tsed/common\";\nimport {normalizePath} from \"@tsed/common\";\nimport {Alter} from \"../decorators/alter\";\nimport {AlterHook} from \"../domain/AlterHook\";\n\n@Alter(\"skip\")\nexport class AlterSkip implements AlterHook {\n @Constant(\"formio.baseUrl\", \"/\")\n baseUrl: string;\n\n @Constant(\"formio.whiteList\", [\"/spec.json\"])\n whiteList: string[];\n\n transform(value: any, ctx: PlatformContext): any {\n if (value) {\n return true;\n }\n\n const {request} = ctx;\n const url = request.url.split(\"?\")[0];\n\n return !!this.whiteList.find((entry) => {\n return normalizePath(this.baseUrl, entry) === url;\n });\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterTemplateExportSteps.js","sourceRoot":"","sources":["../../src/components/AlterTemplateExportSteps.ts"],"names":[],"mappings":";;;;AAAA,qCAAoC;AACpC,iCAAgC;AAGhC,+CAA0C;AAI1C,+DAA0D;AAE1D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAG/B,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IAInC,SAA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,CAAC,GAAG,CAAC,GAAG,eAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;YAElC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;gBACZ,GAAG,UAAU;gBACb,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE;gBACtC,QAAQ,EAAE,QAAQ,IAAI,QAAQ,CAAC,QAAQ,EAAE;gBACzC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC;gBACzC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;gBAChD,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;aAC/B,CAAC,CAAC;YAEH,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,CAAC;CACF,CAAA;AA1CC;IADC,WAAM,EAAE;sCACW,+BAAc;0DAAC;AAFxB,wBAAwB;IADpC,aAAK,CAAC,qBAAqB,CAAC;GAChB,wBAAwB,CA4CpC;AA5CY,4DAAwB","sourcesContent":["import {getValue} from \"@tsed/core\";\nimport {Inject} from \"@tsed/di\";\nimport {MongooseDocument} from \"@tsed/mongoose\";\nimport {FormioMapper} from \"../builder/FormioMapper\";\nimport {Alter} from \"../decorators/alter\";\nimport {AlterHook} from \"../domain/AlterHook\";\nimport {FormioSubmission} from \"../domain/FormioModels\";\nimport {FormioTemplate} from \"../domain/FormioTemplate\";\nimport {FormioDatabase} from \"../services/FormioDatabase\";\n\nconst async = require(\"async\");\n\n@Alter(\"templateExportSteps\")\nexport class AlterTemplateExportSteps implements AlterHook {\n @Inject()\n protected database: FormioDatabase;\n\n transform(queue: any[], template: FormioTemplate, map: any, options: any): any {\n queue.push(async.apply(this.exportSubmissions.bind(this), template, map, options));\n\n return queue;\n }\n\n protected async exportSubmissions(template: FormioTemplate, map: any, options: any, next: any) {\n const [mapper, submissions] = await Promise.all([\n this.database.getFormioMapper(),\n this.database.submissionModel.find({\n deleted: {$eq: null}\n })\n ]);\n\n template.submissions = await this.mapSubmissions(submissions, mapper);\n\n next(null, template);\n }\n\n protected mapSubmissions(submissions: MongooseDocument<FormioSubmission>[], mapper: FormioMapper) {\n return submissions\n .map((submission) => submission.toObject())\n .reduce((acc: any, {_id, created, updated, modified, __v, owner, roles, form, metadata, ...submission}) => {\n const machineName = mapper.mapToExport(form.toString());\n const key = machineName.replace(\"$machineName:\", \"\");\n\n acc[key] = getValue(acc, key, []);\n\n acc[key].push({\n ...submission,\n created: created && created.toString(),\n modified: modified && modified.toString(),\n data: mapper.mapToExport(submission.data),\n roles: mapper.mapToExport(roles).filter(Boolean),\n form: mapper.mapToExport(form)\n });\n\n return acc;\n }, {});\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterTemplateImportSteps.js","sourceRoot":"","sources":["../../src/components/AlterTemplateImportSteps.ts"],"names":[],"mappings":";;;;AAAA,iCAAgC;AAEhC,+CAA0C;AAI1C,+DAA0D;AAE1D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAG/B,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IAInC,SAAS,CAAC,KAAY,EAAE,OAAiB,EAAE,QAAiC;QAC1E,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;QAErE,OAAO,KAAK,CAAC;IACf,CAAC;IAES,KAAK,CAAC,iBAAiB,CAAC,QAAiC,EAAE,IAAS;QAC5E,IAAI,QAAQ,IAAI,QAAQ,CAAC,WAAW,EAAE;YACpC,wBAAwB;YACxB,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAEnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC;YACtD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YAErD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;gBAC3B,KAAK,MAAM,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE;oBACjC,MAAM,IAAI,CAAC,gBAAgB,CAAC,EAAC,GAAG,UAAU,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,EAAC,EAAE,OAAO,CAAC,CAAC;iBAC1F;aACF;SACF;QAED,IAAI,EAAE,CAAC;IACT,CAAC;IAES,KAAK,CAAC,gBAAgB,CAAC,UAAqC,EAAE,MAAoB;QAC1F,MAAM,KAAK,GAAG;YACZ,GAAG,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;YACjC,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;SAChF,CAAC;QAEF,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAElD,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AApCC;IADC,WAAM,EAAE;sCACW,+BAAc;0DAAC;AAFxB,wBAAwB;IADpC,aAAK,CAAC,qBAAqB,CAAC;GAChB,wBAAwB,CAsCpC;AAtCY,4DAAwB","sourcesContent":["import {Inject} from \"@tsed/di\";\nimport {FormioMapper} from \"../builder/FormioMapper\";\nimport {Alter} from \"../decorators/alter\";\nimport {AlterHook} from \"../domain/AlterHook\";\nimport {FormioSubmission} from \"../domain/FormioModels\";\nimport {FormioTemplate} from \"../domain/FormioTemplate\";\nimport {FormioDatabase} from \"../services/FormioDatabase\";\n\nconst async = require(\"async\");\n\n@Alter(\"templateImportSteps\")\nexport class AlterTemplateImportSteps implements AlterHook {\n @Inject()\n protected database: FormioDatabase;\n\n transform(queue: any[], install: Function, template: Partial<FormioTemplate>): any {\n queue.push(async.apply(this.importSubmissions.bind(this), template));\n\n return queue;\n }\n\n protected async importSubmissions(template: Partial<FormioTemplate>, done: any) {\n if (template && template.submissions) {\n // clean all submissions\n await this.database.submissionModel.deleteMany({});\n\n const ctxData = await this.database.getFormioMapper();\n const entries = Object.entries(template.submissions);\n\n for (const entry of entries) {\n for (const submission of entry[1]) {\n await this.importSubmission({...submission, form: submission.form || entry[0]}, ctxData);\n }\n }\n }\n\n done();\n }\n\n protected async importSubmission(submission: Partial<FormioSubmission>, mapper: FormioMapper) {\n const value = {\n ...mapper.mapToImport(submission),\n roles: [...new Set(mapper.mapToImport(submission.roles || []))].filter(Boolean)\n };\n\n await this.database.submissionModel.create(value);\n\n return value;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/decorators/action.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,iCAA0C;AAG1C;;;;GAIG;AACH,SAAgB,MAAM,CAAC,OAAyB;IAC9C,OAAO,oBAAa,CAAC,CAAC,MAAW,EAAE,EAAE;QACnC,qBAAgB,CAAC;YACf,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,eAAe;SACtB,CAAC,CAAC;IACL,CAAC,EAAE,eAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;AACzC,CAAC;AAPD,wBAOC","sourcesContent":["import {StoreSet, useDecorators} from \"@tsed/core\";\nimport {registerProvider} from \"@tsed/di\";\nimport {FormioActionInfo} from \"@tsed/formio-types\";\n\n/**\n * Create a new FormIO Action.\n * @param options\n * @decorator\n */\nexport function Action(options: FormioActionInfo): ClassDecorator {\n return useDecorators((target: any) => {\n registerProvider({\n provide: target,\n type: \"formio:action\"\n });\n }, StoreSet(\"formio:action\", options));\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actionCtx.js","sourceRoot":"","sources":["../../src/decorators/actionCtx.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAIrC;;;;;;;;;;;;;GAaG;AACH,SAAgB,SAAS,CAAC,UAAmB;IAC3C,OAAO,gBAAO,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACvE,CAAC;AAFD,8BAEC","sourcesContent":["import {Context} from \"@tsed/common\";\nimport {SetActionItemMessage} from \"../domain/FormioAction\";\nimport {FormioAction} from \"@tsed/formio-types\";\n\n/**\n * Return the current action context with the following data:\n *\n * ```typescript\n * export type ActionCtx = {\n * handler: string;\n * method: string;\n * setActionItemMessage: SetActionItemMessage;\n * action: FormioAction;\n * };\n * ```\n * @param expression\n * @constructor\n */\nexport function ActionCtx(expression?: string): ParameterDecorator {\n return Context([\"ACTION_CTX\", expression].filter(Boolean).join(\".\"));\n}\n\nexport type ActionCtx = {\n handler: string;\n method: string;\n setActionItemMessage: SetActionItemMessage;\n action: FormioAction;\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alter.js","sourceRoot":"","sources":["../../src/decorators/alter.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,iCAA0C;AAE1C;;;;GAIG;AACH,SAAgB,KAAK,CAAC,IAAY;IAChC,OAAO,oBAAa,CAAC,CAAC,MAAW,EAAE,EAAE;QACnC,qBAAgB,CAAC;YACf,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,cAAc;SACrB,CAAC,CAAC;IACL,CAAC,EAAE,eAAQ,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC;AAPD,sBAOC","sourcesContent":["import {StoreSet, useDecorators} from \"@tsed/core\";\nimport {registerProvider} from \"@tsed/di\";\n\n/**\n *\n * @param name\n * @constructor\n */\nexport function Alter(name: string): ClassDecorator {\n return useDecorators((target: any) => {\n registerProvider({\n provide: target,\n type: \"formio:alter\"\n });\n }, StoreSet(\"formio:alter:name\", name));\n}\n"]}
|
package/lib/decorators/on.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"on.js","sourceRoot":"","sources":["../../src/decorators/on.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,iCAA0C;AAE1C;;;;GAIG;AACH,SAAgB,EAAE,CAAC,IAAY;IAC7B,OAAO,oBAAa,CAAC,CAAC,MAAW,EAAE,EAAE;QACnC,qBAAgB,CAAC;YACf,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;IACL,CAAC,EAAE,eAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC;AACvC,CAAC;AAPD,gBAOC","sourcesContent":["import {StoreSet, useDecorators} from \"@tsed/core\";\nimport {registerProvider} from \"@tsed/di\";\n\n/**\n * Create a Form io hook event listener\n * @param name\n * @constructor\n */\nexport function On(name: string): ClassDecorator {\n return useDecorators((target: any) => {\n registerProvider({\n provide: target,\n type: \"formio:on\"\n });\n }, StoreSet(\"formio:on:name\", name));\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFormioAuth.js","sourceRoot":"","sources":["../../src/decorators/useFormioAuth.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,8EAAyE;AAEzE;;;;GAIG;AACH,SAAgB,aAAa;IAC3B,OAAO,gBAAO,CAAC,2CAAoB,CAAC,CAAC;AACvC,CAAC;AAFD,sCAEC","sourcesContent":["import {UseAuth} from \"@tsed/common\";\nimport {FormioAuthMiddleware} from \"../middlewares/FormioAuthMiddleware\";\n\n/**\n * Check if a user is connected by using the Formio Auth middleware\n * @decorator\n * @formio\n */\nexport function UseFormioAuth(): Function {\n return UseAuth(FormioAuthMiddleware);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterHook.js","sourceRoot":"","sources":["../../src/domain/AlterHook.ts"],"names":[],"mappings":"","sourcesContent":["export interface AlterHook<T = any> {\n transform(...args: any[]): T;\n}\n"]}
|
package/lib/domain/Formio.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Formio.js","sourceRoot":"","sources":["../../src/domain/Formio.ts"],"names":[],"mappings":"","sourcesContent":["import {EventEmitter} from \"events\";\nimport {NextFunction, Request, Response} from \"express\";\nimport {Db} from \"mongodb\";\nimport {Mongoose, Schema} from \"mongoose\";\nimport {FormioActionModelCtor} from \"./FormioAction\";\nimport {FormioActionsIndex} from \"./FormioActionsIndex\";\nimport {FormioAuth} from \"./FormioAuth\";\nimport {FormioBaseModel} from \"./FormioBaseModel\";\nimport {FormioConfig} from \"./FormioConfig\";\nimport {FormioHook, FormioHooks} from \"./FormioHooks\";\nimport {FormioModels, FormioSchemas} from \"./FormioModels\";\nimport {FormioTemplateUtil} from \"./FormioTemplateUtil\";\nimport {FormioUpdate} from \"./FormioUpdate\";\nimport {FormioUtil} from \"./FormioUtils\";\n\nexport interface FormioBase {\n /**\n * Auth\n */\n auth: FormioAuth;\n /**\n * Event emitter\n */\n events: EventEmitter;\n /**\n * Formio configuration\n */\n config: FormioConfig & {schema: string};\n\n /**\n * Emit alter `log` event. Return false to disable event logging.\n * @param event\n * @param req\n * @param info\n */\n log(event: string, req: Request, ...info: any[]): void;\n\n /**\n * Emit alter `audit` event if `config.audit` is enabled. Return false to disable event logging.\n * Use `console.log`.\n * @param event\n * @param req\n * @param info\n */\n audit(event: string, req: Request, ...info: any[]): void;\n}\n\nexport interface FormioMiddlewares {\n alias(req: Request, res: Response, next: NextFunction): void;\n\n params(req: Request, res: Response, next: NextFunction): void;\n\n accessHandler(req: Request, res: Response, next: NextFunction): void;\n\n /**\n * Authorize all urls based on roles and permissions.\n * @param req\n * @param res\n * @param next\n */\n permissionHandler(req: Request, res: Response, next: NextFunction): void;\n\n restrictRequestTypes(req: Request, res: Response, next: NextFunction): void;\n tokenHandler(req: Request, res: Response, next: NextFunction): void;\n}\n\nexport interface Formio extends FormioBase {\n Action: FormioActionModelCtor;\n BaseModel: FormioBaseModel;\n actions: FormioActionsIndex;\n resources: any;\n /**\n * Database connection\n */\n db: Db;\n\n schemas: FormioSchemas & {\n AccessSchema: Schema;\n PermissionSchema: Schema;\n FieldMatchAccessPermissionSchema: Schema;\n };\n\n models: FormioModels;\n /**\n * Mongoose lib.\n */\n mongoose: Mongoose;\n /**\n * Exported formio middlewares\n */\n readonly middleware: FormioMiddlewares;\n /**\n * Hooks.\n */\n hooks: FormioHooks;\n /**\n * Plugins.\n */\n plugins: any;\n /**\n * Formio hook util.\n */\n readonly hook: FormioHook;\n /**\n * The formio utils.\n */\n readonly util: FormioUtil;\n /**\n * Update system.\n */\n readonly update: FormioUpdate;\n /**\n * Template export/import\n */\n readonly template: FormioTemplateUtil;\n\n /**\n * Encryption system.\n */\n encrypt(text: string, next: (err: null | Error, hash: string) => void): void;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioAction.js","sourceRoot":"","sources":["../../src/domain/FormioAction.ts"],"names":[],"mappings":"","sourcesContent":["import {Request, Response} from \"express\";\nimport {FormioMongooseSchema} from \"./FormioBaseModel\";\nimport {FormioComponent} from \"./FormioModels\";\nimport {FormioAction, FormioActionInfo} from \"@tsed/formio-types\";\n\nexport interface FormioActionModel extends FormioAction {\n resolve(handler: string, method: string, req: Request, res: Response, next: Function, setActionItemMessage: SetActionItemMessage): void;\n}\n\nexport type FormioActionMongooseSchema = FormioMongooseSchema<FormioAction>;\nexport type SetActionItemMessage = (message: string, data?: any, state?: any) => void;\n\nexport interface FormioActionModelCtor {\n schema?: FormioActionMongooseSchema;\n\n info(req: Request, response: Response, next: (err: any, info: FormioActionInfo) => void): void;\n\n settingsForm(req: Request, response: Response, next: (err: any, info: FormioComponent[]) => void): void;\n\n new (data: FormioAction, req: Request, res: Response): FormioActionModel;\n}\n\nexport interface ActionMethods {\n info?(req: Request, response: Response): Promise<FormioAction>;\n\n settingsForm(req: Request, response: Response): Promise<FormioComponent[]>;\n\n resolve(...args: any[]): Promise<any>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioActionsIndex.js","sourceRoot":"","sources":["../../src/domain/FormioActionsIndex.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {FormioActionModelCtor} from \"./FormioAction\";\n\nexport interface FormioActions {\n email: FormioActionModelCtor;\n login: FormioActionModelCtor;\n resetpass: FormioActionModelCtor;\n role: FormioActionModelCtor;\n save: FormioActionModelCtor;\n sql: FormioActionModelCtor;\n webhook: FormioActionModelCtor;\n\n [key: string]: FormioActionModelCtor;\n}\n\nexport interface FormioActionsIndex {\n actions: FormioActions & Record<string, Type<FormioActionModelCtor>>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioAuth.js","sourceRoot":"","sources":["../../src/domain/FormioAuth.ts"],"names":[],"mappings":"","sourcesContent":["import {Next, Req, Res} from \"@tsed/common\";\nimport {FormioDecodedToken, FormioPayloadToken} from \"./FormioDecodedToken\";\nimport {FormioForm} from \"./FormioModels\";\n\nexport interface FormioAuth {\n /**\n * Send the current user.\n *\n * @param req\n * @param res\n * @param next\n */\n currentUser(req: Req, res: Res, next: Function): void;\n\n /**\n * Checks to see if a decoded token is allowed to access this path.\n * @param req\n * @param decoded\n * @return {boolean}\n */\n isTokenAllowed(req: Req, decoded: FormioDecodedToken): boolean;\n\n /**\n * Generate our JWT with the given payload, and pass it to the given callback function.\n *\n * @param payload {Object}\n * The decoded JWT.\n *\n * @return {String|Boolean}\n * The JWT from the given payload, or false if the jwt payload is still valid.\n */\n getToken(payload: FormioPayloadToken): string | boolean;\n\n /**\n * Generate a temporary token for a specific path and expiration.\n *\n * @param req\n * @param res\n * @param allow\n * @param expire\n * @param admin\n * @param cb\n */\n getTempToken(req: Req, res: Res, allow: boolean, expire: number, admin: boolean, cb: Function): void;\n\n tempToken(req: Req, res: Res): void;\n\n /**\n * Authenticate a user.\n *\n * @param req\n * @param forms {Mixed}\n * A single form or an array of forms to authenticate against.\n * @param userField {String}\n * The user submission field that contains the username.\n * @param passField {String}\n * The user submission field that contains the password.\n * @param username {String}\n * The user submission username to login with.\n * @param password {String}\n * The user submission password to login with.\n * @param next {Function}\n * The callback function to call after authentication.\n */\n authenticate(\n req: Req,\n forms: FormioForm | FormioForm[],\n userField: string,\n passField: string,\n username: string,\n password: string,\n next: Function\n ): void;\n\n /**\n * Interception logout request.\n * @param req\n * @param res\n * @param next\n */\n logout(req: Req, res: Res, next: Next): void;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioBaseModel.js","sourceRoot":"","sources":["../../src/domain/FormioBaseModel.ts"],"names":[],"mappings":"","sourcesContent":["import {MongooseDocument} from \"@tsed/mongoose\";\nimport {Schema, Document} from \"mongoose\";\n\nexport type FormioMongooseSchema<T> = Schema<Document<T>> & {\n machineName(document: MongooseDocument<T>, done: Function): void;\n};\n\nexport interface FormioBaseModel<T = any> {\n schema: Schema<Document<T>>;\n}\n\nexport interface FormioModel<T = any> extends FormioBaseModel<T> {\n schema: FormioMongooseSchema<T>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioConfig.js","sourceRoot":"","sources":["../../src/domain/FormioConfig.ts"],"names":[],"mappings":"","sourcesContent":["import {FormioSettings} from \"./FormioSettings\";\nimport {FormioTemplate} from \"./FormioTemplate\";\n\nexport interface FormioJwtConfig {\n secret: string;\n expireTime?: number;\n}\n\nexport interface FormioEmailConfig {\n type: string;\n username: string;\n password: string;\n}\n\nexport interface FormioConfig {\n /**\n * Base url to mount the formio endpoints with Ts.ED server. Default: '/'\n */\n baseUrl: string;\n /**\n * Skip installation process\n */\n skipInstall?: boolean;\n\n template?: FormioTemplate;\n /**\n * Cors allowed origin configuration. Default: `[\"*\"]`.\n */\n allowedOrigins?: string[];\n /**\n *\n */\n mongoCA?: any;\n mongo?: string;\n mongoConfig?: string;\n /**\n * Reserved keywords form name list\n */\n reservedForms?: string[];\n /**\n * Jwt configuration\n */\n jwt: FormioJwtConfig;\n /**\n * Email sendgrid settings\n */\n email?: FormioEmailConfig;\n /**\n * Settings of external formio services\n */\n settings?: FormioSettings;\n /**\n * Enable audit log. Default: false\n */\n audit?: boolean;\n /**\n * User root credentials\n */\n root: {\n email: string;\n password: string;\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioCtxMapper.js","sourceRoot":"","sources":["../../src/domain/FormioCtxMapper.ts"],"names":[],"mappings":"","sourcesContent":["import {MongooseDocument} from \"@tsed/mongoose\";\nimport {FormioAction, FormioForm, FormioRole} from \"@tsed/formio-types\";\n\nexport interface FormioCtxMapper {\n forms: Map<string, MongooseDocument<FormioForm>>;\n actions: Map<string, MongooseDocument<FormioAction>>;\n roles: Map<string, MongooseDocument<FormioRole>>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioDecodedToken.js","sourceRoot":"","sources":["../../src/domain/FormioDecodedToken.ts"],"names":[],"mappings":"","sourcesContent":["export interface FormioDecodedToken extends Record<string, unknown> {\n user: {\n _id: string;\n };\n form: {\n _id: string;\n };\n}\n\nexport interface FormioPayloadToken {\n token: string;\n decoded: FormioDecodedToken;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioErrors.js","sourceRoot":"","sources":["../../src/domain/FormioErrors.ts"],"names":[],"mappings":"","sourcesContent":["export interface FormioErrors {\n app: {\n ESETTINGSLOAD: \"Cannot load app settings.\";\n EDBCONFIG: \"Database settings is missing.\";\n EDBHOST: \"Invalid SQL Host.\";\n };\n db: {\n EINVQUERY: \"Invalid query.\";\n EDBCONN: \"Connection error.\";\n EQUERY: \"Query request error.\";\n };\n emailer: {\n ENOTRANSP: \"Cannot get emailer transports.\";\n ESENDMAIL: \"Email sending failed.\";\n ESUBPARAMS: \"Failed to get substitution parameters.\";\n };\n cache: {\n EFORMLOAD: \"Cannot load form.\";\n };\n form: {\n ENOFORM: \"Form not found.\";\n };\n auth: {\n EAUTH: \"Authentication failed.\";\n EPASSFIELD: \"Invalid password field.\";\n EPASSRESET: \"Unable to change password.\";\n ERESETTOKEN: \"Invalid reset password token.\";\n ENOPASSP: \"No password provided.\";\n ELOGINCOUNT: \"Unable to update login count.\";\n };\n submission: {\n ENOSUB: \"Submission not found.\";\n ESUBLOAD: \"Cannot load submission.\";\n ESUBSAVE: \"Cannot save submission.\";\n };\n user: {\n ENOUSER: \"User not found.\";\n ENONAMEP: \"No user name provided.\";\n };\n role: {\n EROLESLOAD: \"Cannot load the Roles.\";\n ENOROLE: \"Role not found.\";\n EROLELOAD: \"Cannot load role.\";\n EROLEEXIST: \"Provided role already exists.\";\n };\n request: {\n EREQRECUR: \"Too many recursive requests.\";\n };\n resource: {\n ENOIDP: \"Resource id is missing.\";\n ENOHANDLER: \"Resource handler not found.\";\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioHooks.js","sourceRoot":"","sources":["../../src/domain/FormioHooks.ts"],"names":[],"mappings":"","sourcesContent":["import {MongooseDocument} from \"@tsed/mongoose\";\nimport {Request} from \"express\";\nimport {FilterQuery, Schema, SchemaDefinition} from \"mongoose\";\nimport {Formio} from \"./Formio\";\nimport {FormioActions} from \"./FormioActionsIndex\";\nimport {FormioConfig} from \"./FormioConfig\";\nimport {FormioDecodedToken} from \"./FormioDecodedToken\";\nimport {FormioJs} from \"./FormioJs\";\nimport {FormioActionItem, FormioForm, FormioModelsModels, FormioSubmission} from \"./FormioModels\";\nimport {FormioSettings} from \"./FormioSettings\";\nimport {ResourceRestOptions} from \"./Resource\";\n\nexport type FormioInitEvent = \"alias\" | \"params\" | \"token\" | \"getTempToken\" | \"logout\" | \"current\" | \"access\" | \"perms\";\n\nexport interface FormioHooks {\n settings?: (settings: FormioSettings, req: Request, cb: Function) => FormioSettings;\n alter?: {\n alias?: (alias: string, req: Request, res: Response) => string;\n /**\n * Alter FormioJs configuration\n * @param formIo\n */\n configFormio?: (formIo: {Formio: FormioJs}) => void;\n /**\n * Alter formio server configuration.\n * @param config\n */\n updateConfig?: (config: FormioConfig) => FormioConfig;\n /**\n * Alter audit log.\n * @param info\n * @param event\n * @param req\n */\n audit?: (info: any[], event: string, req: Request) => void;\n /**\n * Alter log.\n * @param info\n * @param event\n * @param req\n */\n log?: (event: string, req: Request, ...info: string[]) => void;\n /**\n * Alter available actions\n * @param info\n * @param event\n * @param req\n */\n actions?: (actions: FormioActions) => FormioActions;\n /**\n * Skip auth for the current request.\n * @param info\n * @param event\n * @param req\n */\n skip?: (value: boolean, req: Request) => boolean;\n /**\n * Resolve host.\n * @param baseUrl\n * @param req\n */\n host?: (baseUrl: string, req: Request) => string;\n /**\n * `/form/${req.params.formId}/action`\n * @param action\n * @param req\n */\n path?: (path: string, req: Request) => any;\n /**\n * Restrict request types\n * @param methods\n */\n methods?: (methods: string[]) => string[];\n /**\n * Return the cors configuration.\n */\n cors?: () => Record<string, any>;\n /**\n * Return the current user submission.\n */\n currentUser?: (user: any) => any;\n /**\n * Alter current form.\n * @param form\n */\n currentForm?: (form: FormioForm) => FormioForm;\n /**\n * Alter formio\n * @param formio\n */\n formio?: (formio: Formio) => Formio;\n /**\n * Alter models\n * @param models\n */\n models?: (models: FormioModelsModels) => FormioModelsModels;\n /**\n * Alter resources\n * @param resources\n */\n resources?: (resources: {form: any; submission: any; role: any}) => any;\n\n resourceAccessFilter?: (search: any, req: Request, done: (err: unknown, newSearch: any) => void) => void;\n\n // machineName\n actionMachineName?: (name: string, document: MongooseDocument<any>, done: Function) => void;\n formMachineName?: (name: string, document: MongooseDocument<any>, done: Function) => void;\n roleMachineName?: (name: string, document: MongooseDocument<any>, done: Function) => void;\n\n // schemas\n actionSchema?: (schema: Schema) => Schema;\n actionItemSchema?: (schema: Schema) => Schema;\n formSchema?: (schema: Schema) => Schema;\n roleSchema?: (schema: Schema) => Schema;\n schemaSchema?: (schema: Schema) => Schema;\n submissionSchema?: (schema: Schema | SchemaDefinition) => Schema;\n tokenSchema?: (schema: Schema) => Schema;\n permissionSchema?: (schema: SchemaDefinition) => SchemaDefinition;\n fieldMatchAccessPermissionSchema?: (schemaOptions: SchemaDefinition) => SchemaDefinition;\n\n // query\n actionsQuery?: <DocType = any>(query: FilterQuery<DocType>, req: Request) => FilterQuery<DocType>;\n submissionQuery?: <DocType = any>(query: FilterQuery<DocType>, req: Request) => FilterQuery<DocType>;\n roleQuery?: <DocType = any>(query: FilterQuery<DocType>, req: Request) => FilterQuery<DocType>;\n formQuery?: <DocType = any>(query: FilterQuery<DocType>, req: Request) => FilterQuery<DocType>;\n\n // Data\n actionItem?: (actionItem: FormioActionItem, req: Request) => FormioActionItem;\n actionContext?: (actionContext: any, req: Request) => any;\n actionInfo?: (action: any, req: Request) => any;\n\n // submission\n submission?: (req: Request, res: Response, done: Function) => void;\n submissionRequest?: (submission: FormioSubmission) => FormioSubmission;\n validateSubmissionForm?: (form: FormioForm, submission: FormioSubmission, done: Function) => void;\n postSubmissionUpdate?: (req: Request, res: Response, submissionUpdate: FormioSubmission) => void;\n\n // response\n /**\n * Allow modules to hook into the form loader middleware.\n * @param item\n * @param req\n * @param done\n */\n formResponse?: (item: any, req: Request, done: Function) => void;\n\n // params\n requestParams?: (req: Request & {formId: string; subId: string; roleId: string}, params: Record<string, any>) => void;\n /**\n * Alter submitted params\n * @param params\n */\n submissionParams?: (params: string[]) => string[];\n\n // Routes\n /**\n * Alter actions routes.\n */\n actionRoutes?: (options: ResourceRestOptions) => ResourceRestOptions;\n /**\n * Alter roles routes.\n */\n rolesRoutes?: (options: ResourceRestOptions) => ResourceRestOptions;\n /**\n * Alter forms routes.\n */\n formRoutes?: (options: ResourceRestOptions) => ResourceRestOptions;\n /**\n * Alter submission routes.\n */\n submissionRoutes?: (options: ResourceRestOptions) => ResourceRestOptions;\n\n // Auth\n user?: (user: any, done: (err: any, user: any) => void) => void;\n login?: (user: any, req: Request, done: (err: any) => void) => void;\n token?: (token: FormioDecodedToken, form: FormioForm, req: Request) => FormioDecodedToken;\n tokenDecode?: (token: FormioDecodedToken, req: Request, done: (err: any, decoded: FormioDecodedToken) => void) => void;\n submissionRequestTokenQuery?: (query: {formId: string; submissionId: string}, token: string) => any;\n\n [key: string]: any;\n };\n on?: {\n init?: (type: FormioInitEvent) => boolean;\n [key: string]: any;\n };\n}\n\nexport interface FormioHook {\n /**\n * Run settings function.\n */\n settings(req: Request, cb: Function): void;\n\n /**\n * Emit an event.\n * @param args\n */\n invoke<T = any>(...args: any[]): T | boolean;\n\n /**\n * Alter the given value by calling all listener.\n * @param event\n * @param args\n */\n alter(event: string, ...args: any[]): any;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioJs.js","sourceRoot":"","sources":["../../src/domain/FormioJs.ts"],"names":[],"mappings":"","sourcesContent":["export interface FormioJs {\n forms: Record<string, any>;\n cache: Record<string, any>;\n Components: {\n components: {\n component: {\n Validator: {\n db: any | null;\n token: any | null;\n form: any | null;\n submission: any | null;\n };\n };\n };\n };\n\n getToken(): string;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioModels.js","sourceRoot":"","sources":["../../src/domain/FormioModels.ts"],"names":[],"mappings":";;;AAMA,6DAAmC","sourcesContent":["import {MongooseDocument} from \"@tsed/mongoose\";\nimport {Schema} from \"mongoose\";\nimport {FormioActionModelCtor, FormioActionMongooseSchema} from \"./FormioAction\";\nimport {FormioBaseModel, FormioModel, FormioMongooseSchema} from \"./FormioBaseModel\";\nimport {FormioActionItem, FormioForm, FormioRole, FormioSchema, FormioSubmission, FormioToken} from \"@tsed/formio-types\";\n\nexport * from \"@tsed/formio-types\";\n\nexport type WithID<T> = T & {_id: string};\n\nexport interface FormioSchemas {\n action: FormioActionMongooseSchema;\n actionItem: Schema<MongooseDocument<FormioActionItem>>;\n form: FormioMongooseSchema<FormioForm>;\n role: FormioMongooseSchema<FormioRole>;\n schema: Schema<MongooseDocument<FormioSchema>>;\n submission: Schema<MongooseDocument<FormioSubmission>>;\n token: Schema<MongooseDocument<FormioToken>>;\n\n [key: string]: Schema<MongooseDocument<any>>;\n}\n\nexport type FormioModelsModels = {\n action: FormioActionModelCtor;\n actionItem: FormioBaseModel<FormioActionItem>;\n form: FormioModel<FormioForm>;\n role: FormioModel<FormioRole>;\n schema: FormioBaseModel<FormioSchema>;\n submission: FormioBaseModel<FormioSubmission>;\n token: FormioBaseModel<FormioToken>;\n} & Record<string, FormioBaseModel>;\n\nexport interface FormioModels {\n schemas: FormioSchemas;\n models: FormioModelsModels;\n specs: {\n action: any;\n actionItem: any;\n form: any;\n role: any;\n schema: any;\n submission: any;\n token: any;\n\n [key: string]: any;\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioRouter.js","sourceRoot":"","sources":["../../src/domain/FormioRouter.ts"],"names":[],"mappings":"","sourcesContent":["import {Router} from \"express\";\nimport {Formio, FormioBase} from \"./Formio\";\nimport {FormioHooks} from \"./FormioHooks\";\n\nexport interface FormioRouter extends Router {\n formio: FormioBase;\n\n init(hooks: FormioHooks): Promise<Formio>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioSettings.js","sourceRoot":"","sources":["../../src/domain/FormioSettings.ts"],"names":[],"mappings":"","sourcesContent":["export interface FormioSettings extends Record<string, any> {\n office365: {\n tenant: string;\n clientId: string;\n email: string;\n cert: string;\n thumbprint: string;\n\n [key: string]: any;\n };\n\n databases: {\n mysql: {\n host: string;\n port: string;\n database: string;\n user: string;\n password: string;\n\n [key: string]: any;\n };\n mssql: {\n host: string;\n port: string;\n database: string;\n user: string;\n password: string;\n\n [key: string]: any;\n };\n };\n email: {\n gmail: {\n auth: {\n user: string;\n pass: string;\n [key: string]: any;\n };\n\n [key: string]: any;\n };\n sendgrid: {\n auth: {\n api_user: string;\n api_key: string;\n\n [key: string]: any;\n };\n\n [key: string]: any;\n };\n mandrill: {\n auth: {\n apiKey: string;\n\n [key: string]: any;\n };\n [key: string]: any;\n };\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioTemplate.js","sourceRoot":"","sources":["../../src/domain/FormioTemplate.ts"],"names":[],"mappings":"","sourcesContent":["import {FormioActionItem, FormioForm, FormioRole, FormioSubmission} from \"./FormioModels\";\n\nexport interface FormioTemplate {\n roles?: Record<string, FormioRole>;\n forms: Record<string, FormioForm>;\n resources: Record<string, FormioForm>;\n actions: Record<string, FormioActionItem>;\n submissions?: Record<string, FormioSubmission[]>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioTemplateUtil.js","sourceRoot":"","sources":["../../src/domain/FormioTemplateUtil.ts"],"names":[],"mappings":"","sourcesContent":["import {FormioTemplate} from \"./FormioTemplate\";\n\nexport interface FormioExportOptions {\n title: string;\n version: string;\n description: string;\n name: string;\n}\n\nexport interface FormioTemplateUtil {\n import: {\n template(template: FormioTemplate, cb: (er: unknown, data: FormioTemplate) => void): void;\n };\n export(options: Partial<FormioExportOptions>, cb: (er: unknown, data: FormioTemplate) => void): void;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioUpdate.js","sourceRoot":"","sources":["../../src/domain/FormioUpdate.ts"],"names":[],"mappings":"","sourcesContent":["import {NextFunction, Request, Response} from \"express\";\nimport {Db} from \"mongodb\";\nimport {Formio} from \"./Formio\";\n\nexport interface FormioUpdate {\n db: Db;\n version: string;\n\n /**\n *\n * @param cb\n */\n initialize(cb: (err: unknown, db: any) => void): Promise<Formio>;\n\n /**\n *\n * @param req\n * @param res\n * @param next\n */\n sanityCheck(req: Request, res: Response, next: NextFunction): void;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioUtils.js","sourceRoot":"","sources":["../../src/domain/FormioUtils.ts"],"names":[],"mappings":"","sourcesContent":["import {Request, Response} from \"express\";\nimport {FormioErrors} from \"./FormioErrors\";\nimport {FormioJs} from \"./FormioJs\";\n\nexport interface FormioUtil {\n Formio: FormioJs;\n /**\n * Iterate through each component within a form.\n *\n * @param {Object} components\n * The components to iterate.\n * @param {Function} fn\n * The iteration function to invoke for each component.\n * @param {Boolean} includeAll\n * Whether or not to include layout components.\n * @param {String} path\n */\n eachComponent: Function;\n /**\n * Get a component by its key\n *\n * @param {Object} components\n * The components to iterate.\n * @param {String} key\n * The key of the component to get.\n *\n * @returns {Object}\n * The component that matches the given key, or undefined if not found.\n */\n getComponent: Function;\n /**\n * Define if component should be considered input component\n *\n * @param {Object} componentJson\n * JSON of component to check\n *\n * @returns {Boolean}\n * If component is input or not\n */\n isInputComponent: Function;\n /**\n * Flatten the form components for data manipulation.\n *\n * @param {Object} components\n * The components to iterate.\n * @param {Boolean} includeAll\n * Whether or not to include layout components.\n *\n * @returns {Object}\n * The flattened components map.\n */\n flattenComponents: Function;\n /**\n * Get the value for a component key, in the given submission.\n *\n * @param {Object} submission\n * A submission object to search.\n * @param {String} key\n * A for components API key to search for.\n */\n getValue: Function;\n /**\n * Determine if a component is a layout component or not.\n *\n * @param {Object} component\n * The component to check.\n *\n * @returns {Boolean}\n * Whether or not the component is a layout component.\n */\n isLayoutComponent: Function;\n /**\n * Apply JSON logic functionality.\n *\n * @param component\n * @param row\n * @param data\n */\n jsonLogic: Function;\n /**\n * Check if the condition for a component is true or not.\n *\n * @param component\n * @param row\n * @param data\n */\n checkCondition: Function;\n flattenComponentsForRender: Function;\n renderFormSubmission: Function;\n renderComponentValue: Function;\n /**\n * A node-fetch shim adding support for http(s) proxy and allowing\n * invalid tls certificates (to be used with self signed certificates).\n *\n * @param {any} url The request url string or url like object.\n * @param {any} options The request options object.\n * @returns {Promise<Response>} The promise with the node-fetch response object.\n */\n fetch: any;\n /* eslint-disable new-cap */\n base64: {\n /**\n * Base64 encode the given data.\n *\n * @param {String} decoded\n * The decoded data to encode.\n *\n * @return {String}\n * The base64 representation of the given data.\n */\n encode(decoded: string): string;\n /**\n * Base64 decode the given data.\n *\n * @param {String} encoded\n * The encoded data to decode.\n *\n * @return {String}\n * The ascii representation of the given encoded data.\n */\n decode(encoded: string): string;\n };\n /**\n * Application error codes.\n */\n errorCodes: FormioErrors;\n\n layoutComponents: (\"panel\" | \"table\" | \"well\" | \"columns\" | \"fieldset\" | \"tabs\" | string)[];\n\n deleteProp(target: any, propertyKey: any): any;\n\n /**\n * A wrapper around console.log that gets ignored by eslint.\n *\n * @param {*} content\n * The content to pass to console.log.\n */\n log(content: string): void;\n\n /**\n * Determine if a value is a boolean representation.\n * @param value\n * @return {boolean}\n */\n isBoolean(value: any): boolean;\n\n /**\n * Quick boolean coercer.\n * @param value\n * @return {boolean}\n */\n boolean(value: any): boolean;\n\n /**\n * A wrapper around console.error that gets ignored by eslint.\n *\n * @param {*} content\n * The content to pass to console.error.\n */\n error(content: any): void;\n\n /**\n * Returns the URL alias for a form provided the url.\n */\n getAlias(req: Request, reservedForms: string[]): {alias: string; additional: string};\n\n /**\n * Escape a string for use in regex.\n *\n * @param str\n * @returns {*}\n */\n escapeRegExp(str: string): string;\n\n /**\n * Create a sub response object that only handles errors.\n *\n * @param res\n * @return {{send: function(), sendStatus: function(*=), status: function(*=)}}\n */\n createSubResponse(res: Response): Response;\n\n /**\n * Create a sub-request object from the original request.\n *\n * @param req\n */\n createSubRequest(req: Request): Request;\n\n /**\n * Return the objectId.\n *\n * @param id\n * @returns {*}\n * @constructor\n */\n ObjectId(id: string): any;\n\n /**\n * Search the request headers for the given key.\n *\n * @param req\n * The Express request object.\n * @param key\n * The key to search for in the headers.\n *\n * @return\n * The header value if found or false.\n */\n getHeader(req: Request, key: string): string | false;\n\n /**\n * Search the request query for the given key.\n *\n * @param req\n * The Express request object.\n * @param key\n * The key to search for in the query.\n *\n * @return\n * The query value if found or false.\n */\n getQuery(req: Request, key: string): any | false;\n\n /**\n * Search the request parameters for the given key.\n *\n * @param req\n * The Express request object.\n * @param key\n * The key to search for in the parameters.\n *\n * @return\n * The parameter value if found or false.\n */\n getParameter(req: Request, key: string): any | false;\n\n /**\n * Determine if the request has the given key set as a header or url parameter.\n *\n * @param req\n * The Express request object.\n * @param key\n * The key to search for.\n *\n * @return\n * Return the value of the key or false if not found.\n */\n getRequestValue(req: Request, key: string): any | false;\n\n /**\n * Split the given URL into its key/value pairs.\n *\n * @param url\n * The request url to split, typically req.url.\n *\n * @returns {{}}\n * The key/value pairs of the request url.\n */\n getUrlParams(url: string): Record<string, any>;\n\n /**\n * Converts a form component key into a submission key\n * by putting .data. between each nested component\n * (ex: `user.name` becomes `user.data.name` in a submission)\n * @param key\n * The key to convert\n * @return\n * The submission key\n */\n getSubmissionKey(key: string): string;\n\n /**\n * Converts a submission key into a form component key\n * by replacing .data. with .\n * (ex: `user.data.name` becomes `user.name` in a submission)\n * @param key\n * The key to convert\n * @return\n * The form component key\n */\n getFormComponentKey(key: string): string;\n\n /**\n * Utility function to ensure the given id is always a BSON object.\n *\n * @param _id {String|Object}\n * A mongo id as a string or object.\n *\n * @returns {Object}\n * The mongo BSON id.\n */\n idToBson(_id: string | any): any;\n\n /**\n * Utility function to ensure the given id is always a string object.\n *\n * @param _id {String|Object}\n * A mongo id as a string or object.\n *\n * @returns {String}\n * The mongo string id.\n */\n idToString(_id: string | any): string;\n\n /* eslint-enable new-cap */\n\n /**\n * Ensures that a submission data has MongoDB ObjectID's for all \"id\" fields.\n * @param data\n * @return {boolean}\n */\n ensureIds(data: any[]): any;\n\n removeProtectedFields(form: string, action: string, submissions: any): void;\n\n /**\n * Retrieve a unique machine name\n *\n * @param document\n * @param model\n * @param next\n * @return {*}\n */\n uniqueMachineName(document: {machineName: string}, model: any, next: (err?: Error) => void): void;\n\n castValue<T = any>(valueType: \"string\" | \"number\" | \"boolean\" | \"[number]\" | \"[string]\", value: any): T;\n\n valuePath(prefix: string, key: string): string;\n\n eachValue(components: any, data: any, fn: Function, context: any, path?: string): void;\n}\n"]}
|
package/lib/domain/OnHook.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OnHook.js","sourceRoot":"","sources":["../../src/domain/OnHook.ts"],"names":[],"mappings":"","sourcesContent":["export interface OnHook<T = any> {\n on(...args: any[]): boolean | void;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../src/domain/Resource.ts"],"names":[],"mappings":"","sourcesContent":["import Express from \"express\";\n\nexport type ResourceHttpHandler = (req: Request, res: Response, next: Express.NextFunction) => void;\n\nexport interface ResourceHttpMethodOptions {\n before?: ResourceHttpHandler;\n after?: ResourceHttpHandler;\n}\n\nexport interface ResourceRestOptions extends ResourceHttpMethodOptions {\n beforePut?: ResourceHttpHandler;\n beforePatch?: ResourceHttpHandler;\n beforePost?: ResourceHttpHandler;\n beforeIndex?: ResourceHttpHandler;\n beforeGet?: ResourceHttpHandler;\n afterPut?: ResourceHttpHandler;\n afterPatch?: ResourceHttpHandler;\n afterPost?: ResourceHttpHandler;\n afterIndex?: ResourceHttpHandler;\n afterGet?: ResourceHttpHandler;\n}\n"]}
|
package/lib/index.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
// decorators
|
|
5
|
-
tslib_1.__exportStar(require("./decorators/action"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./decorators/actionCtx"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./decorators/alter"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./decorators/on"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./decorators/useFormioAuth"), exports);
|
|
10
|
-
// middlewares
|
|
11
|
-
tslib_1.__exportStar(require("./middlewares/FormioAuthMiddleware"), exports);
|
|
12
|
-
// domain
|
|
13
|
-
tslib_1.__exportStar(require("./domain/AlterHook"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./domain/Formio"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./domain/FormioDecodedToken"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./domain/FormioAction"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./domain/FormioActionsIndex"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./domain/FormioAuth"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./domain/FormioBaseModel"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./domain/FormioConfig"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./domain/FormioCtxMapper"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./domain/FormioErrors"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./domain/FormioHooks"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./domain/FormioJs"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./domain/FormioModels"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./domain/FormioRouter"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./domain/FormioSettings"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./domain/FormioUpdate"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./domain/FormioUtils"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./domain/FormioTemplate"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./domain/FormioTemplateUtil"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./domain/OnHook"), exports);
|
|
33
|
-
// module
|
|
34
|
-
tslib_1.__exportStar(require("./FormioModule"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./builder/FormioMapper"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./services/FormioService"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("./services/FormioDatabase"), exports);
|
|
38
|
-
tslib_1.__exportStar(require("./services/FormioDatabase"), exports);
|
|
39
|
-
tslib_1.__exportStar(require("./services/FormioAuthService"), exports);
|
|
40
|
-
tslib_1.__exportStar(require("./services/FormioHooksService"), exports);
|
|
41
|
-
tslib_1.__exportStar(require("./components/AlterActions"), exports);
|
|
42
|
-
tslib_1.__exportStar(require("./components/AlterAudit"), exports);
|
|
43
|
-
tslib_1.__exportStar(require("./components/AlterLog"), exports);
|
|
44
|
-
tslib_1.__exportStar(require("./components/AlterHost"), exports);
|
|
45
|
-
tslib_1.__exportStar(require("./components/AlterSkip"), exports);
|
|
46
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,aAAa;AACb,8DAAoC;AACpC,iEAAuC;AACvC,6DAAmC;AACnC,0DAAgC;AAChC,qEAA2C;AAE3C,cAAc;AACd,6EAAmD;AAEnD,SAAS;AACT,6DAAmC;AACnC,0DAAgC;AAChC,sEAA4C;AAC5C,gEAAsC;AACtC,sEAA4C;AAC5C,8DAAoC;AACpC,mEAAyC;AACzC,gEAAsC;AACtC,mEAAyC;AACzC,gEAAsC;AACtC,+DAAqC;AACrC,4DAAkC;AAClC,gEAAsC;AACtC,gEAAsC;AACtC,kEAAwC;AACxC,gEAAsC;AACtC,+DAAqC;AACrC,kEAAwC;AACxC,sEAA4C;AAC5C,0DAAgC;AAEhC,SAAS;AACT,yDAA+B;AAC/B,iEAAuC;AACvC,mEAAyC;AACzC,oEAA0C;AAC1C,oEAA0C;AAC1C,uEAA6C;AAC7C,wEAA8C;AAC9C,oEAA0C;AAC1C,kEAAwC;AACxC,gEAAsC;AACtC,iEAAuC;AACvC,iEAAuC","sourcesContent":["// decorators\nexport * from \"./decorators/action\";\nexport * from \"./decorators/actionCtx\";\nexport * from \"./decorators/alter\";\nexport * from \"./decorators/on\";\nexport * from \"./decorators/useFormioAuth\";\n\n// middlewares\nexport * from \"./middlewares/FormioAuthMiddleware\";\n\n// domain\nexport * from \"./domain/AlterHook\";\nexport * from \"./domain/Formio\";\nexport * from \"./domain/FormioDecodedToken\";\nexport * from \"./domain/FormioAction\";\nexport * from \"./domain/FormioActionsIndex\";\nexport * from \"./domain/FormioAuth\";\nexport * from \"./domain/FormioBaseModel\";\nexport * from \"./domain/FormioConfig\";\nexport * from \"./domain/FormioCtxMapper\";\nexport * from \"./domain/FormioErrors\";\nexport * from \"./domain/FormioHooks\";\nexport * from \"./domain/FormioJs\";\nexport * from \"./domain/FormioModels\";\nexport * from \"./domain/FormioRouter\";\nexport * from \"./domain/FormioSettings\";\nexport * from \"./domain/FormioUpdate\";\nexport * from \"./domain/FormioUtils\";\nexport * from \"./domain/FormioTemplate\";\nexport * from \"./domain/FormioTemplateUtil\";\nexport * from \"./domain/OnHook\";\n\n// module\nexport * from \"./FormioModule\";\nexport * from \"./builder/FormioMapper\";\nexport * from \"./services/FormioService\";\nexport * from \"./services/FormioDatabase\";\nexport * from \"./services/FormioDatabase\";\nexport * from \"./services/FormioAuthService\";\nexport * from \"./services/FormioHooksService\";\nexport * from \"./components/AlterActions\";\nexport * from \"./components/AlterAudit\";\nexport * from \"./components/AlterLog\";\nexport * from \"./components/AlterHost\";\nexport * from \"./components/AlterSkip\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioAuthMiddleware.js","sourceRoot":"","sources":["../../src/middlewares/FormioAuthMiddleware.ts"],"names":[],"mappings":";;;;AAAA,yCAAyD;AACzD,qCAAoC;AACpC,iDAA8C;AAC9C,+BAA+B;AAC/B,6DAAwD;AAExD;;;GAGG;AAEH,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAI/B,IAAI,YAAY;QACd,OAAO,gBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,GAAG,CAAY,GAAY;QAC/B,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QAE9B,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAElC,IAAI,CAAC,eAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC,EAAE;YACpC,MAAM,IAAI,yBAAY,CAAC,mBAAmB,CAAC,CAAC;SAC7C;IACH,CAAC;CACF,CAAA;AAhBC;IADC,eAAM,EAAE;sCACS,6BAAa;oDAAC;AAMhC;IAAW,mBAAA,gBAAO,EAAE,CAAA;;;;+CASnB;AAjBU,oBAAoB;IADhC,mBAAU,EAAE;GACA,oBAAoB,CAkBhC;AAlBY,oDAAoB","sourcesContent":["import {Context, Inject, Middleware} from \"@tsed/common\";\nimport {getValue} from \"@tsed/core\";\nimport {Unauthorized} from \"@tsed/exceptions\";\nimport {promisify} from \"util\";\nimport {FormioService} from \"../services/FormioService\";\n\n/**\n * @middleware\n * @formio\n */\n@Middleware()\nexport class FormioAuthMiddleware {\n @Inject()\n protected formio: FormioService;\n\n get tokenHandler(): any {\n return promisify(this.formio.middleware.tokenHandler);\n }\n\n async use(@Context() ctx: Context) {\n const req = ctx.getRequest();\n const res = ctx.getResponse();\n\n await this.tokenHandler(req, res);\n\n if (!getValue(req, \"token.user._id\")) {\n throw new Unauthorized(\"User unauthorized\");\n }\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioAuthService.js","sourceRoot":"","sources":["../../src/services/FormioAuthService.ts"],"names":[],"mappings":";;;;AACA,qCAAsC;AACtC,iCAA4C;AAC5C,iDAAoE;AACpE,+BAA+B;AAG/B,qDAAgD;AAChD,6DAAwD;AACxD,mDAA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U,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU,CAAa,IAAoC;QAC/D,MAAM,IAAI,CAAC,EAAE,CAAC,eAAe,CAAC,SAAS,CACrC;YACE,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,EACD,EAAC,IAAI,EAAE,IAAI,EAAC,CACb,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AApNC;IADC,WAAM,EAAE;sCACD,6BAAa;iDAAC;AAGtB;IADC,WAAM,EAAE;sCACF,uCAAkB;gDAAC;AAG1B;IADC,WAAM,EAAE;sCACL,+BAAc;6CAAC;AARR,iBAAiB;IAD7B,eAAU,EAAE;GACA,iBAAiB,CAsN7B;AAtNY,8CAAiB","sourcesContent":["import {PlatformContext, Req} from \"@tsed/common\";\nimport {isFunction} from \"@tsed/core\";\nimport {Inject, Injectable} from \"@tsed/di\";\nimport {BadRequest, NotFound, Unauthorized} from \"@tsed/exceptions\";\nimport {promisify} from \"util\";\nimport {FormioPayloadToken} from \"../domain/FormioDecodedToken\";\nimport {FormioForm, FormioSubmission, WithID} from \"../domain/FormioModels\";\nimport {FormioDatabase} from \"./FormioDatabase\";\nimport {FormioHooksService} from \"./FormioHooksService\";\nimport {FormioService} from \"./FormioService\";\n\n@Injectable()\nexport class FormioAuthService {\n @Inject()\n formio: FormioService;\n\n @Inject()\n hooks: FormioHooksService;\n\n @Inject()\n db: FormioDatabase;\n\n get currentUser() {\n return promisify(this.formio.auth.currentUser);\n }\n\n get getToken() {\n return this.formio.auth.getToken;\n }\n\n get tempToken() {\n return this.formio.auth.tempToken;\n }\n\n get logout() {\n return this.formio.auth.logout;\n }\n\n setCurrentUser<User = any>(user: WithID<FormioSubmission<User>>, token: FormioPayloadToken, ctx: PlatformContext) {\n const request = ctx.getRequest();\n const response = ctx.getResponse();\n\n request.submission.data = user.data;\n request.user = user;\n request.token = token.decoded;\n response.token = token.token;\n request[\"x-jwt-token\"] = token.token;\n\n return this;\n }\n\n /**\n * Generate the payload token for the session\n * @param user\n * @param ctx\n */\n async generatePayloadToken<User = any>(\n user: WithID<FormioSubmission<User>>,\n ctx: PlatformContext\n ): Promise<{user: WithID<FormioSubmission<User>>; token: FormioPayloadToken}> {\n const req = ctx.getRequest();\n const audit = this.formio.audit;\n let form: FormioForm | null;\n\n try {\n form = (await this.db.getForm(user.form)) as any;\n } catch (err) {\n audit(\n \"EAUTH_USERFORM\",\n {\n ...req,\n userId: user._id\n },\n user.form,\n err\n );\n throw err;\n }\n\n if (!form) {\n audit(\n \"EAUTH_USERFORM\",\n {\n ...req,\n userId: user._id\n },\n user.form,\n {message: \"User form not found\"}\n );\n\n throw new NotFound(\"User form not found.\");\n }\n\n try {\n user = await this.hooks.alterAsync(\"user\", user);\n } catch (err) {\n // istanbul ignore next\n ctx.logger.debug(err);\n }\n\n await this.hooks.alterAsync(\"login\", user, req);\n\n // Allow anyone to hook and modify the token.\n const token = this.hooks.alter(\n \"token\",\n {\n user: {\n _id: user._id\n },\n form: {\n _id: form?._id\n }\n },\n form,\n req\n );\n\n const decoded = this.hooks.alter(\"tokenDecode\", token, req);\n\n return {\n user,\n token: {\n token: this.getToken(token) as string,\n decoded\n }\n };\n }\n\n /**\n * Generate session from the given authenticated user.\n * @param user\n * @param ctx\n */\n async generateSession<User = any>(user: WithID<FormioSubmission<User>>, ctx: PlatformContext) {\n try {\n const {user: userSession, token} = await this.generatePayloadToken(user, ctx);\n this.setCurrentUser(userSession, token, ctx);\n\n await this.currentUser(ctx.getRequest(), ctx.getResponse());\n } catch (err) {\n ctx.logger.error({event: \"Error on OAuthActions\", error: err});\n throw new Unauthorized(err.message);\n }\n }\n\n /**\n * Retrieve roles\n * @param req\n */\n async getRoles(req?: Req) {\n try {\n const query = this.hooks.alter(\"roleQuery\", {deleted: {$eq: null}}, req);\n\n return await this.db.roleModel.find(query).sort({title: 1}).lean().exec();\n } catch (err) {\n throw new BadRequest(this.formio.util.errorCodes.role.EROLESLOAD);\n }\n }\n\n /**\n * Update the role of the current user submission\n * @param _id\n * @param role\n * @param req\n */\n async updateUserRole(_id: string | any, role: string, req?: Req) {\n const query = this.hooks.alter(\n \"submissionQuery\",\n {\n _id: this.formio.util.idToBson(_id),\n deleted: {$eq: null}\n },\n req\n );\n\n const user = await this.db.submissionModel.findOne(query).exec();\n\n if (!user) {\n throw new BadRequest(\"No Submission was found with the given setting `submission`.\");\n }\n\n user.roles = [this.formio.util.idToBson(role)];\n\n if (isFunction(user.save)) {\n await user.save();\n }\n\n return user;\n }\n\n /**\n * Create a user submission in formio\n * @param user\n */\n async createUser<User = any>(user: Partial<FormioSubmission<User>>) {\n const submission = new this.db.submissionModel({\n owner: null,\n deleted: null,\n roles: [],\n externalsIds: [],\n ...user,\n created: new Date().toISOString(),\n modified: new Date().toISOString()\n });\n\n user.form && (submission.form = this.db.idToBson(user.form));\n\n await submission.save();\n\n return submission.toObject();\n }\n\n /**\n * Update user submission in formio\n * @param user\n */\n async updateUser<User = any>(user: WithID<FormioSubmission<User>>) {\n await this.db.submissionModel.updateOne(\n {\n _id: user._id\n },\n {$set: user}\n );\n\n return user;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioHooksService.js","sourceRoot":"","sources":["../../src/services/FormioHooksService.ts"],"names":[],"mappings":";;;;AAAA,yCAAiE;AACjE,+BAA+B;AAE/B,mDAA8C;AAI9C,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAO7B,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IACjC,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;IAChC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,gBAAS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,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,CAA6B,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YACpF,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC3D,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,CAAC;YACvD,MAAM,IAAI,GAAe,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAE3C,MAAM,IAAI,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,CAC9B,QAAQ,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAC7C,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE;gBACzB,OAAO,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;YAClD,CAAC,CAAC,CACH,CAAC;YAEJ,OAAO;gBACL,GAAG,KAAK;gBACR,CAAC,IAAI,CAAC,EAAG,EAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;aAC9C,CAAC;QACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;CACF,CAAA;AAhFC;IADC,eAAM,EAAE;sCACW,wBAAe;oDAAC;AAGpC;IADC,eAAM,CAAC,6BAAa,CAAC;sCACJ,6BAAa;kDAAC;AALrB,kBAAkB;IAD9B,mBAAU,EAAE;GACA,kBAAkB,CAkF9B;AAlFY,gDAAkB","sourcesContent":["import {Inject, Injectable, InjectorService} from \"@tsed/common\";\nimport {promisify} from \"util\";\nimport {FormioHooks} from \"../domain/FormioHooks\";\nimport {FormioService} from \"./FormioService\";\nimport {Request} from \"express\";\n\n@Injectable()\nexport class FormioHooksService {\n @Inject()\n protected injector: InjectorService;\n\n @Inject(FormioService)\n protected formio: FormioService;\n\n get settings(): (req: Request, cb: Function) => void {\n return this.formio.hook.settings;\n }\n\n get invoke() {\n return this.formio.hook.invoke;\n }\n\n get alter(): (event: string, ...args: any[]) => any {\n return this.formio.hook.alter;\n }\n\n get alterAsync(): (event: string, ...args: any[]) => Promise<any> {\n return promisify(this.alter);\n }\n\n getHooks(): FormioHooks {\n return {\n alter: this.getHooksProvider(\"alter\"),\n on: this.getHooksProvider(\"on\")\n };\n }\n\n protected getProviders(type: \"alter\" | \"on\") {\n return this.injector.getProviders(`formio:${type}`);\n }\n\n protected getHooksProvider(type: \"alter\" | \"on\") {\n return this.bindHooks(type, this.createHooks(type));\n }\n\n protected bindHooks(type: \"alter\" | \"on\", hooks: Record<string, Function[]>) {\n return Object.entries(hooks).reduce((newHooks, [key, pool]) => {\n const wrap = (input: any, ...args: any[]): any => {\n let last: any;\n\n for (const fn of pool) {\n const result = fn(input, ...args);\n\n if (type === \"alter\") {\n input = result;\n } else {\n last = result;\n }\n }\n\n return type === \"alter\" ? input : last;\n };\n\n return {\n ...newHooks,\n [key]: wrap\n };\n }, {});\n }\n\n private createHooks(type: \"alter\" | \"on\") {\n return this.getProviders(type).reduce<Record<string, Function[]>>((hooks, provider) => {\n const instance = this.injector.invoke<any>(provider.token);\n const name = provider.store.get(`formio:${type}:name`);\n const pool: Function[] = hooks[name] || [];\n\n const hook = (...args: any[]) =>\n instance[type === \"alter\" ? \"transform\" : \"on\"](\n ...args.map((input: any) => {\n return input && input.$ctx ? input.$ctx : input;\n })\n );\n\n return {\n ...hooks,\n [name]: ([] as Function[]).concat(pool, hook)\n };\n }, {});\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioInstaller.js","sourceRoot":"","sources":["../../src/services/FormioInstaller.ts"],"names":[],"mappings":";;;;AAAA,iCAA4C;AAC5C,yCAAoC;AAGpC,qDAAgD;AAChD,mDAA8C;AAG9C,IAAa,eAAe,GAA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GhC;IADC,WAAM,EAAE;sCACS,eAAM;+CAAC;AALd,eAAe;IAD3B,eAAU,EAAE;GACA,eAAe,CAwC3B;AAxCY,0CAAe","sourcesContent":["import {Inject, Injectable} from \"@tsed/di\";\nimport {Logger} from \"@tsed/logger\";\nimport {FormioSubmission} from \"../domain/FormioModels\";\nimport {FormioTemplate} from \"../domain/FormioTemplate\";\nimport {FormioDatabase} from \"./FormioDatabase\";\nimport {FormioService} from \"./FormioService\";\n\n@Injectable()\nexport class FormioInstaller extends FormioDatabase {\n @Inject()\n protected formio: FormioService;\n\n @Inject()\n protected logger: Logger;\n\n async install(template: FormioTemplate, root: any) {\n this.logger.info(\"Install formio template...\");\n template = await this.formio.importTemplate(template);\n\n if (root) {\n this.logger.info(\"Create root user...\");\n await this.createRootUser(root, template);\n }\n }\n\n async createRootUser<User = unknown>(user: {email: string; password: string}, template: FormioTemplate): Promise<FormioSubmission<User>> {\n const hash = await this.formio.encrypt(user.password);\n\n return new Promise((resolve, reject) => {\n this.formio.resources.submission.model.create(\n {\n form: template.resources.admin._id,\n data: {\n email: user.email,\n password: hash\n },\n roles: [template.roles?.administrator._id].filter(Boolean)\n },\n (err: unknown, item: any) => {\n if (err) {\n return reject(err);\n }\n\n resolve(item);\n }\n );\n });\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioService.js","sourceRoot":"","sources":["../../src/services/FormioService.ts"],"names":[],"mappings":";;;;AAAA,yCAAiE;AAIjE,+BAA+B;AAS/B,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACvC,MAAM,OAAO,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AACtD,MAAM,IAAI,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAGhD,IAAa,aAAa,GAA1B,MAAa,aAAa;IAMxB,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,GAAE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iBAAiB,CAAC,CAAC;SACjG;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAES,UAAU;QAClB,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;QAExB,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;CACF,CAAA;AA3GC;IADC,eAAM,EAAE;sCACW,wBAAe;+CAAC;AAJzB,aAAa;IADzB,mBAAU,EAAE;GACA,aAAa,CA+GzB;AA/GY,sCAAa","sourcesContent":["import {Inject, Injectable, InjectorService} from \"@tsed/common\";\nimport {MongooseConnectionOptions} from \"@tsed/mongoose\";\nimport {Db} from \"mongodb\";\nimport {Mongoose} from \"mongoose\";\nimport {promisify} from \"util\";\nimport {Formio} from \"../domain/Formio\";\nimport {FormioConfig} from \"../domain/FormioConfig\";\nimport {FormioHook, FormioHooks} from \"../domain/FormioHooks\";\nimport {FormioSchemas} from \"../domain/FormioModels\";\nimport {FormioRouter} from \"../domain/FormioRouter\";\nimport {FormioTemplate} from \"../domain/FormioTemplate\";\nimport {FormioExportOptions} from \"../domain/FormioTemplateUtil\";\n\nconst createRouter = require(\"formio\");\nconst swagger = require(\"formio/src/util/swagger.js\");\nconst util = require(\"formio/src/util/util.js\");\n\n@Injectable()\nexport class FormioService {\n router: FormioRouter;\n\n @Inject()\n protected injector: InjectorService;\n\n get audit(): Function {\n return this.formio.audit || (() => {});\n }\n\n get auth() {\n return this.formio.auth;\n }\n\n // istanbul ignore next\n get swagger() {\n return (...args: any[]) => new Promise((resolve) => swagger(...args, resolve));\n }\n\n get config(): FormioConfig {\n return this.formio.config;\n }\n\n get db(): Db {\n return this.formio.db;\n }\n\n get resources() {\n return this.formio.resources;\n }\n\n get mongoose(): Mongoose {\n return this.formio.mongoose;\n }\n\n get middleware() {\n return this.formio.middleware;\n }\n\n get schemas(): FormioSchemas {\n return this.formio.schemas;\n }\n\n get formio(): Formio {\n return this.router.formio as Formio;\n }\n\n get hook(): FormioHook {\n return this.formio.hook;\n }\n\n get util() {\n return this.formio.util;\n }\n\n get template() {\n return this.formio.template;\n }\n\n get Action() {\n return this.formio.Action;\n }\n\n async exportTemplate(options: Partial<FormioExportOptions> = {}): Promise<FormioTemplate> {\n return promisify(this.formio.template.export)(options);\n }\n\n async importTemplate(template: FormioTemplate): Promise<FormioTemplate> {\n return promisify(this.formio.template.import.template)(template);\n }\n\n encrypt(text: string) {\n return promisify(this.formio.encrypt)(text);\n }\n\n isInit() {\n return !!this.router;\n }\n\n // istanbul ignore next\n public createRouter(options: FormioConfig) {\n return createRouter(options);\n }\n\n public init(options: FormioConfig, hooks: FormioHooks = {}) {\n if (options && Object.keys(options).length) {\n this.router = this.createRouter(this.mapConfiguration(options));\n this.bindLogger();\n\n return this.router.init(hooks);\n }\n }\n\n protected mapConfiguration(options: FormioConfig) {\n const {injector} = this;\n const mongooseSettings = injector.settings.get<MongooseConnectionOptions>(\"mongoose.0\");\n\n if (mongooseSettings) {\n options.mongo = options.mongo || mongooseSettings.url;\n options.mongoConfig = options.mongoConfig || JSON.stringify(mongooseSettings.connectionOptions);\n }\n\n return options;\n }\n\n protected bindLogger() {\n const {injector} = this;\n\n util.log = injector.logger.info.bind(injector.logger);\n util.error = injector.logger.error.bind(injector.logger);\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isMongoId.js","sourceRoot":"","sources":["../../src/utils/isMongoId.ts"],"names":[],"mappings":";;;AAAA,SAAgB,SAAS,CAAC,IAAY;IACpC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AACpD,CAAC;AAFD,8BAEC","sourcesContent":["export function isMongoId(text: string) {\n return text.toString().match(/^[0-9a-fA-F]{24}$/);\n}\n"]}
|