@tsed/formio 7.0.0-alpha.2 → 7.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{FormioModule.js → cjs/FormioModule.js} +38 -51
- package/lib/cjs/FormioModule.js.map +1 -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.js +8 -8
- package/lib/cjs/components/AlterActions.js.map +1 -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.js +2 -2
- package/lib/cjs/components/AlterHost.js.map +1 -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.js +9 -9
- package/lib/cjs/components/AlterSkip.js.map +1 -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.js +5 -5
- package/lib/cjs/components/AlterTemplateImportSteps.js.map +1 -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.js +1 -1
- package/lib/cjs/decorators/actionCtx.js.map +1 -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.js +3 -3
- package/lib/cjs/decorators/on.js.map +1 -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.js +0 -0
- package/lib/cjs/domain/AlterHook.js.map +1 -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.js +0 -0
- package/lib/cjs/domain/FormioAction.js.map +1 -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.js +0 -0
- package/lib/cjs/domain/FormioAuth.js.map +1 -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.js +0 -0
- package/lib/cjs/domain/FormioConfig.js.map +1 -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.js +0 -0
- package/lib/cjs/domain/FormioDecodedToken.js.map +1 -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.js +0 -0
- package/lib/cjs/domain/FormioHooks.js.map +1 -0
- package/lib/{domain → cjs/domain}/FormioJs.js +0 -0
- package/lib/cjs/domain/FormioJs.js.map +1 -0
- package/lib/cjs/domain/FormioModels.js +5 -0
- package/lib/cjs/domain/FormioModels.js.map +1 -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.js +0 -0
- package/lib/cjs/domain/FormioSettings.js.map +1 -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.js +0 -0
- package/lib/cjs/domain/FormioTemplateUtil.js.map +1 -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.js +0 -0
- package/lib/cjs/domain/FormioUtils.js.map +1 -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.js +0 -0
- package/lib/cjs/domain/Resource.js.map +1 -0
- package/lib/cjs/index.js +46 -0
- package/lib/cjs/index.js.map +1 -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.js +13 -13
- package/lib/cjs/services/FormioAuthService.js.map +1 -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.js +9 -9
- package/lib/cjs/services/FormioHooksService.js.map +1 -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.js +8 -8
- package/lib/cjs/services/FormioService.js.map +1 -0
- package/lib/{utils → cjs/utils}/isMongoId.js +0 -0
- package/lib/cjs/utils/isMongoId.js.map +1 -0
- package/lib/esm/FormioModule.js +134 -0
- package/lib/esm/FormioModule.js.map +1 -0
- 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/esm/services/FormioDatabase.js.map +1 -0
- 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/{FormioModule.d.ts → types/FormioModule.d.ts} +0 -0
- package/lib/{builder → types/builder}/FormioMapper.d.ts +0 -0
- package/lib/{components → types/components}/AlterActions.d.ts +0 -0
- package/lib/{components → types/components}/AlterAudit.d.ts +0 -0
- package/lib/{components → types/components}/AlterHost.d.ts +0 -0
- package/lib/{components → types/components}/AlterLog.d.ts +0 -0
- package/lib/{components → types/components}/AlterSkip.d.ts +0 -0
- package/lib/{components → types/components}/AlterTemplateExportSteps.d.ts +0 -0
- package/lib/{components → types/components}/AlterTemplateImportSteps.d.ts +0 -0
- package/lib/{decorators → types/decorators}/action.d.ts +1 -1
- package/lib/{decorators → types/decorators}/actionCtx.d.ts +2 -1
- package/lib/{decorators → types/decorators}/alter.d.ts +0 -0
- package/lib/{decorators → types/decorators}/on.d.ts +0 -0
- package/lib/{decorators → types/decorators}/useFormioAuth.d.ts +0 -0
- package/lib/{domain → types/domain}/AlterHook.d.ts +0 -0
- package/lib/{domain → types/domain}/Formio.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioAction.d.ts +1 -26
- package/lib/{domain → types/domain}/FormioActionsIndex.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioAuth.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioBaseModel.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioConfig.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioCtxMapper.d.ts +1 -2
- package/lib/{domain → types/domain}/FormioDecodedToken.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioErrors.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioHooks.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioJs.d.ts +0 -0
- package/lib/types/domain/FormioModels.d.ts +42 -0
- package/lib/{domain → types/domain}/FormioRouter.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioSettings.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioTemplate.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioTemplateUtil.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioUpdate.d.ts +0 -0
- package/lib/{domain → types/domain}/FormioUtils.d.ts +0 -0
- package/lib/{domain → types/domain}/OnHook.d.ts +0 -0
- package/lib/{domain → types/domain}/Resource.d.ts +0 -0
- package/lib/{index.d.ts → types/index.d.ts} +0 -0
- package/lib/types/middlewares/FormioAuthMiddleware.d.ts +11 -0
- package/lib/{services → types/services}/FormioAuthService.d.ts +1 -1
- package/lib/{services → types/services}/FormioDatabase.d.ts +1 -2
- package/lib/{services → types/services}/FormioHooksService.d.ts +2 -3
- package/lib/{services → types/services}/FormioInstaller.d.ts +0 -0
- package/lib/{services → types/services}/FormioService.d.ts +0 -0
- package/lib/{utils → types/utils}/isMongoId.d.ts +0 -0
- package/package.json +23 -17
- package/tsconfig.compile.esm.json +23 -0
- package/lib/FormioModule.js.map +0 -1
- 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.d.ts +0 -183
- package/lib/domain/FormioModels.js +0 -3
- 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.d.ts +0 -13
- package/lib/middlewares/FormioAuthMiddleware.js.map +0 -1
- package/lib/services/FormioAuthService.js.map +0 -1
- package/lib/services/FormioDatabase.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
|
@@ -18,7 +18,7 @@ const FormioInstaller_1 = require("./services/FormioInstaller");
|
|
|
18
18
|
const FormioService_1 = require("./services/FormioService");
|
|
19
19
|
let FormioModule = class FormioModule {
|
|
20
20
|
$onInit() {
|
|
21
|
-
return this.init(core_1.deepClone(this.settings));
|
|
21
|
+
return this.init((0, core_1.deepClone)(this.settings));
|
|
22
22
|
}
|
|
23
23
|
async init(options) {
|
|
24
24
|
return this.formio.init(options, this.hooks.getHooks());
|
|
@@ -50,7 +50,7 @@ let FormioModule = class FormioModule {
|
|
|
50
50
|
return {
|
|
51
51
|
method,
|
|
52
52
|
name: operation.operationId,
|
|
53
|
-
url: common_1.normalizePath(baseUrl, path.replace(/\/{(.*)}/gi, "/:$1")),
|
|
53
|
+
url: (0, common_1.normalizePath)(baseUrl, path.replace(/\/{(.*)}/gi, "/:$1")),
|
|
54
54
|
className: "formio",
|
|
55
55
|
methodClassName: operation.operationId,
|
|
56
56
|
parameters: [],
|
|
@@ -65,24 +65,11 @@ let FormioModule = class FormioModule {
|
|
|
65
65
|
}
|
|
66
66
|
// istanbul ignore next
|
|
67
67
|
async $onReady() {
|
|
68
|
-
if (this.formio.isInit()) {
|
|
68
|
+
if (this.formio.isInit() && this.injector.settings.getBestHost) {
|
|
69
69
|
const { injector } = this;
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
injector.logger.info(`Form.io API is available on ${url}${this.baseUrl || "/"}`);
|
|
74
|
-
};
|
|
75
|
-
/* istanbul ignore next */
|
|
76
|
-
if (httpsPort) {
|
|
77
|
-
this.formio.config.protocol = "https";
|
|
78
|
-
const host = injector.settings.getHttpsPort();
|
|
79
|
-
displayLog({ protocol: "https", ...host });
|
|
80
|
-
}
|
|
81
|
-
else if (httpPort) {
|
|
82
|
-
this.formio.config.protocol = "http";
|
|
83
|
-
const host = injector.settings.getHttpPort();
|
|
84
|
-
displayLog({ protocol: "http", ...host });
|
|
85
|
-
}
|
|
70
|
+
const host = injector.settings.getBestHost();
|
|
71
|
+
const url = host.toString();
|
|
72
|
+
injector.logger.info(`Form.io API is available on ${url}${this.baseUrl || "/"}`);
|
|
86
73
|
}
|
|
87
74
|
}
|
|
88
75
|
async shouldInstall() {
|
|
@@ -90,48 +77,48 @@ let FormioModule = class FormioModule {
|
|
|
90
77
|
return this.template && !(hasForms || this.skipInstall);
|
|
91
78
|
}
|
|
92
79
|
};
|
|
93
|
-
tslib_1.__decorate([
|
|
94
|
-
common_1.Inject(),
|
|
95
|
-
tslib_1.__metadata("design:type", FormioService_1.FormioService)
|
|
80
|
+
(0, tslib_1.__decorate)([
|
|
81
|
+
(0, common_1.Inject)(),
|
|
82
|
+
(0, tslib_1.__metadata)("design:type", FormioService_1.FormioService)
|
|
96
83
|
], FormioModule.prototype, "formio", void 0);
|
|
97
|
-
tslib_1.__decorate([
|
|
98
|
-
common_1.Inject(),
|
|
99
|
-
tslib_1.__metadata("design:type", FormioHooksService_1.FormioHooksService)
|
|
84
|
+
(0, tslib_1.__decorate)([
|
|
85
|
+
(0, common_1.Inject)(),
|
|
86
|
+
(0, tslib_1.__metadata)("design:type", FormioHooksService_1.FormioHooksService)
|
|
100
87
|
], FormioModule.prototype, "hooks", void 0);
|
|
101
|
-
tslib_1.__decorate([
|
|
102
|
-
common_1.Inject(),
|
|
103
|
-
tslib_1.__metadata("design:type", FormioInstaller_1.FormioInstaller)
|
|
88
|
+
(0, tslib_1.__decorate)([
|
|
89
|
+
(0, common_1.Inject)(),
|
|
90
|
+
(0, tslib_1.__metadata)("design:type", FormioInstaller_1.FormioInstaller)
|
|
104
91
|
], FormioModule.prototype, "installer", void 0);
|
|
105
|
-
tslib_1.__decorate([
|
|
106
|
-
common_1.Inject(),
|
|
107
|
-
tslib_1.__metadata("design:type", common_1.PlatformApplication)
|
|
92
|
+
(0, tslib_1.__decorate)([
|
|
93
|
+
(0, common_1.Inject)(),
|
|
94
|
+
(0, tslib_1.__metadata)("design:type", common_1.PlatformApplication)
|
|
108
95
|
], FormioModule.prototype, "app", void 0);
|
|
109
|
-
tslib_1.__decorate([
|
|
110
|
-
common_1.Inject(),
|
|
111
|
-
tslib_1.__metadata("design:type", common_1.InjectorService)
|
|
96
|
+
(0, tslib_1.__decorate)([
|
|
97
|
+
(0, common_1.Inject)(),
|
|
98
|
+
(0, tslib_1.__metadata)("design:type", common_1.InjectorService)
|
|
112
99
|
], FormioModule.prototype, "injector", void 0);
|
|
113
|
-
tslib_1.__decorate([
|
|
114
|
-
common_1.Constant("formio", {}),
|
|
115
|
-
tslib_1.__metadata("design:type", Object)
|
|
100
|
+
(0, tslib_1.__decorate)([
|
|
101
|
+
(0, common_1.Constant)("formio", {}),
|
|
102
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
116
103
|
], FormioModule.prototype, "settings", void 0);
|
|
117
|
-
tslib_1.__decorate([
|
|
118
|
-
common_1.Constant("formio.baseUrl", "/"),
|
|
119
|
-
tslib_1.__metadata("design:type", String)
|
|
104
|
+
(0, tslib_1.__decorate)([
|
|
105
|
+
(0, common_1.Constant)("formio.baseUrl", "/"),
|
|
106
|
+
(0, tslib_1.__metadata)("design:type", String)
|
|
120
107
|
], FormioModule.prototype, "baseUrl", void 0);
|
|
121
|
-
tslib_1.__decorate([
|
|
122
|
-
common_1.Constant("formio.skipInstall", false),
|
|
123
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
108
|
+
(0, tslib_1.__decorate)([
|
|
109
|
+
(0, common_1.Constant)("formio.skipInstall", false),
|
|
110
|
+
(0, tslib_1.__metadata)("design:type", Boolean)
|
|
124
111
|
], FormioModule.prototype, "skipInstall", void 0);
|
|
125
|
-
tslib_1.__decorate([
|
|
126
|
-
common_1.Constant("formio.template"),
|
|
127
|
-
tslib_1.__metadata("design:type", Object)
|
|
112
|
+
(0, tslib_1.__decorate)([
|
|
113
|
+
(0, common_1.Constant)("formio.template"),
|
|
114
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
128
115
|
], FormioModule.prototype, "template", void 0);
|
|
129
|
-
tslib_1.__decorate([
|
|
130
|
-
common_1.Constant("formio.root"),
|
|
131
|
-
tslib_1.__metadata("design:type", Object)
|
|
116
|
+
(0, tslib_1.__decorate)([
|
|
117
|
+
(0, common_1.Constant)("formio.root"),
|
|
118
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
132
119
|
], FormioModule.prototype, "root", void 0);
|
|
133
|
-
FormioModule = tslib_1.__decorate([
|
|
134
|
-
di_1.Module({
|
|
120
|
+
FormioModule = (0, tslib_1.__decorate)([
|
|
121
|
+
(0, di_1.Module)({
|
|
135
122
|
imports: [
|
|
136
123
|
FormioService_1.FormioService,
|
|
137
124
|
FormioHooksService_1.FormioHooksService,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormioModule.js","sourceRoot":"","sources":["../../src/FormioModule.ts"],"names":[],"mappings":";;;;AAAA,yCASsB;AACtB,qCAAqC;AACrC,iCAAgC;AAChC,4DAAuD;AACvD,wDAAmD;AACnD,sDAAiD;AACjD,oDAA+C;AAC/C,sDAAiD;AACjD,oFAA+E;AAC/E,oFAA+E;AAG/E,oEAA+D;AAC/D,sEAAiE;AACjE,gEAA2D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AAQ,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1D,CAAC;CACF,CAAA;AAtGC;IADC,IAAA,eAAM,GAAE;2CACS,6BAAa;4CAAC;AAGhC;IADC,IAAA,eAAM,GAAE;2CACQ,uCAAkB;2CAAC;AAGpC;IADC,IAAA,eAAM,GAAE;2CACY,iCAAe;+CAAC;AAGrC;IADC,IAAA,eAAM,GAAE;2CACM,4BAAmB;yCAAC;AAGnC;IADC,IAAA,eAAM,GAAE;2CACW,wBAAe;8CAAC;AAGpC;IADC,IAAA,iBAAQ,EAAC,QAAQ,EAAE,EAAE,CAAC;;8CACU;AAGjC;IADC,IAAA,iBAAQ,EAAC,gBAAgB,EAAE,GAAG,CAAC;;6CACN;AAG1B;IADC,IAAA,iBAAQ,EAAC,oBAAoB,EAAE,KAAK,CAAC;;iDACP;AAG/B;IADC,IAAA,iBAAQ,EAAC,iBAAiB,CAAC;;8CACQ;AAGpC;IADC,IAAA,iBAAQ,EAAC,aAAa,CAAC;;0CACH;AA7BV,YAAY;IAdxB,IAAA,WAAM,EAAC;QACN,OAAO,EAAE;YACP,6BAAa;YACb,uCAAkB;YAClB,qCAAiB;YACjB,2BAAY;YACZ,qBAAS;YACT,uBAAU;YACV,mBAAQ;YACR,qBAAS;YACT,mDAAwB;YACxB,mDAAwB;SACzB;KACF,CAAC;GACW,YAAY,CAwGxB;AAxGY,oCAAY","sourcesContent":["import {\n Constant,\n Inject,\n InjectorService,\n normalizePath,\n OnReady,\n OnRoutesInit,\n PlatformApplication,\n PlatformRouteDetails\n} from \"@tsed/common\";\nimport {deepClone} from \"@tsed/core\";\nimport {Module} from \"@tsed/di\";\nimport {AlterActions} from \"./components/AlterActions\";\nimport {AlterAudit} from \"./components/AlterAudit\";\nimport {AlterHost} from \"./components/AlterHost\";\nimport {AlterLog} from \"./components/AlterLog\";\nimport {AlterSkip} from \"./components/AlterSkip\";\nimport {AlterTemplateExportSteps} from \"./components/AlterTemplateExportSteps\";\nimport {AlterTemplateImportSteps} from \"./components/AlterTemplateImportSteps\";\nimport {FormioConfig} from \"./domain/FormioConfig\";\nimport {FormioTemplate} from \"./domain/FormioTemplate\";\nimport {FormioAuthService} from \"./services/FormioAuthService\";\nimport {FormioHooksService} from \"./services/FormioHooksService\";\nimport {FormioInstaller} from \"./services/FormioInstaller\";\nimport {FormioService} from \"./services/FormioService\";\n\n@Module({\n imports: [\n FormioService,\n FormioHooksService,\n FormioAuthService,\n AlterActions,\n AlterHost,\n AlterAudit,\n AlterLog,\n AlterSkip,\n AlterTemplateImportSteps,\n AlterTemplateExportSteps\n ]\n})\nexport class FormioModule implements OnRoutesInit, OnReady {\n @Inject()\n protected formio: FormioService;\n\n @Inject()\n protected hooks: FormioHooksService;\n\n @Inject()\n protected installer: FormioInstaller;\n\n @Inject()\n protected app: PlatformApplication;\n\n @Inject()\n protected injector: InjectorService;\n\n @Constant(\"formio\", {})\n protected settings: FormioConfig;\n\n @Constant(\"formio.baseUrl\", \"/\")\n protected baseUrl: string;\n\n @Constant(\"formio.skipInstall\", false)\n protected skipInstall: boolean;\n\n @Constant(\"formio.template\")\n protected template?: FormioTemplate;\n\n @Constant(\"formio.root\")\n protected root?: any;\n\n $onInit() {\n return this.init(deepClone(this.settings));\n }\n\n async init(options: FormioConfig) {\n return this.formio.init(options, this.hooks.getHooks());\n }\n\n async $onRoutesInit() {\n if (this.formio.isInit()) {\n const router: any = this.app.getRouter();\n\n router.use(this.baseUrl, this.formio.middleware.restrictRequestTypes, this.formio.router);\n\n if (await this.shouldInstall()) {\n await this.installer.install(this.template!, this.root);\n }\n }\n }\n\n async $logRoutes(routes: PlatformRouteDetails[]): Promise<PlatformRouteDetails[]> {\n if (this.formio.isInit()) {\n const spec = (await this.formio.swagger(\n {\n $ctx: {\n request: {\n protocol: \"http\",\n host: \"localhost\"\n }\n }\n },\n this.formio.router\n )) as any;\n const {baseUrl} = this;\n\n Object.entries(spec.paths).forEach(([path, methods]: [string, any]) => {\n Object.entries(methods).forEach(([method, operation]: [string, any]) => {\n routes.push({\n toJSON() {\n return {\n method,\n name: operation.operationId,\n url: normalizePath(baseUrl, path.replace(/\\/{(.*)}/gi, \"/:$1\")),\n className: \"formio\",\n methodClassName: operation.operationId,\n parameters: [],\n rawBody: false\n };\n }\n } as any);\n });\n });\n }\n\n return routes;\n }\n\n // istanbul ignore next\n async $onReady(): Promise<void> {\n if (this.formio.isInit() && this.injector.settings.getBestHost) {\n const {injector} = this;\n const host = injector.settings.getBestHost();\n const url = host.toString();\n\n injector.logger.info(`Form.io API is available on ${url}${this.baseUrl || \"/\"}`);\n }\n }\n\n protected async shouldInstall() {\n const hasForms = await this.installer.hasForms();\n\n return this.template && !(hasForms || this.skipInstall);\n }\n}\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,gBAAgB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACrG,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE5B,OAAO,IAA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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"]}
|
|
@@ -51,16 +51,16 @@ let AlterActions = class AlterActions {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
tslib_1.__decorate([
|
|
55
|
-
di_1.Inject(),
|
|
56
|
-
tslib_1.__metadata("design:type", di_1.InjectorService)
|
|
54
|
+
(0, tslib_1.__decorate)([
|
|
55
|
+
(0, di_1.Inject)(),
|
|
56
|
+
(0, tslib_1.__metadata)("design:type", di_1.InjectorService)
|
|
57
57
|
], AlterActions.prototype, "injector", void 0);
|
|
58
|
-
tslib_1.__decorate([
|
|
59
|
-
di_1.Inject(),
|
|
60
|
-
tslib_1.__metadata("design:type", FormioService_1.FormioService)
|
|
58
|
+
(0, tslib_1.__decorate)([
|
|
59
|
+
(0, di_1.Inject)(),
|
|
60
|
+
(0, tslib_1.__metadata)("design:type", FormioService_1.FormioService)
|
|
61
61
|
], AlterActions.prototype, "formio", void 0);
|
|
62
|
-
AlterActions = tslib_1.__decorate([
|
|
63
|
-
alter_1.Alter("actions")
|
|
62
|
+
AlterActions = (0, tslib_1.__decorate)([
|
|
63
|
+
(0, alter_1.Alter)("actions")
|
|
64
64
|
], AlterActions);
|
|
65
65
|
exports.AlterActions = AlterActions;
|
|
66
66
|
//# sourceMappingURL=AlterActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlterActions.js","sourceRoot":"","sources":["../../../src/components/AlterActions.ts"],"names":[],"mappings":";;;;AAAA,yCAAgF;AAChF,iCAA2D;AAE3D,+CAA0C;AAI1C,6DAAwD;AAGxD,IAAa,YAAY,GAAzB,MAAa,YAAY;IAOvB,SAAS,CAAC,OAAsB;QAC9B,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAE7B,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;;YACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC3D,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAmB,eAAe,CAAC,CAAC;YACtE,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;YAE3D,OAAO;gBACL,GAAG,OAAO;gBACV,CAAC,OAAO,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AC5B,GAAa,EACb,IAAS,EACT,oBAA0C,EAC1C,EAAE;YACF,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAC,CAAC,CAAC;YAC5E,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,yBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YAEvE,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;iBACjB,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;iBACrF,KAAK,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;CACF,CAAA;AAhEC;IADC,IAAA,WAAM,GAAE;2CACW,oBAAe;8CAAC;AAGpC;IADC,IAAA,WAAM,GAAE;2CACS,6BAAa;4CAAC;AALrB,YAAY;IADxB,IAAA,aAAK,EAAC,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"]}
|
|
@@ -9,8 +9,8 @@ let AlterAudit = class AlterAudit {
|
|
|
9
9
|
return false;
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
AlterAudit = tslib_1.__decorate([
|
|
13
|
-
alter_1.Alter("audit")
|
|
12
|
+
AlterAudit = (0, tslib_1.__decorate)([
|
|
13
|
+
(0, alter_1.Alter)("audit")
|
|
14
14
|
], AlterAudit);
|
|
15
15
|
exports.AlterAudit = AlterAudit;
|
|
16
16
|
//# sourceMappingURL=AlterAudit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAA,aAAK,EAAC,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"]}
|
|
@@ -8,8 +8,8 @@ let AlterHost = class AlterHost {
|
|
|
8
8
|
return `${ctx.request.protocol}://${ctx.request.host}${baseUrl}`;
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
AlterHost = tslib_1.__decorate([
|
|
12
|
-
alter_1.Alter("host")
|
|
11
|
+
AlterHost = (0, tslib_1.__decorate)([
|
|
12
|
+
(0, alter_1.Alter)("host")
|
|
13
13
|
], AlterHost);
|
|
14
14
|
exports.AlterHost = AlterHost;
|
|
15
15
|
//# sourceMappingURL=AlterHost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAA,aAAK,EAAC,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"]}
|
|
@@ -9,8 +9,8 @@ let AlterLog = class AlterLog {
|
|
|
9
9
|
return false;
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
AlterLog = tslib_1.__decorate([
|
|
13
|
-
alter_1.Alter("log")
|
|
12
|
+
AlterLog = (0, tslib_1.__decorate)([
|
|
13
|
+
(0, alter_1.Alter)("log")
|
|
14
14
|
], AlterLog);
|
|
15
15
|
exports.AlterLog = AlterLog;
|
|
16
16
|
//# sourceMappingURL=AlterLog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAA,aAAK,EAAC,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"]}
|
|
@@ -13,20 +13,20 @@ let AlterSkip = class AlterSkip {
|
|
|
13
13
|
const { request } = ctx;
|
|
14
14
|
const url = request.url.split("?")[0];
|
|
15
15
|
return !!this.whiteList.find((entry) => {
|
|
16
|
-
return common_2.normalizePath(this.baseUrl, entry) === url;
|
|
16
|
+
return (0, common_2.normalizePath)(this.baseUrl, entry) === url;
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
tslib_1.__decorate([
|
|
21
|
-
common_1.Constant("formio.baseUrl", "/"),
|
|
22
|
-
tslib_1.__metadata("design:type", String)
|
|
20
|
+
(0, tslib_1.__decorate)([
|
|
21
|
+
(0, common_1.Constant)("formio.baseUrl", "/"),
|
|
22
|
+
(0, tslib_1.__metadata)("design:type", String)
|
|
23
23
|
], AlterSkip.prototype, "baseUrl", void 0);
|
|
24
|
-
tslib_1.__decorate([
|
|
25
|
-
common_1.Constant("formio.whiteList", ["/spec.json"]),
|
|
26
|
-
tslib_1.__metadata("design:type", Array)
|
|
24
|
+
(0, tslib_1.__decorate)([
|
|
25
|
+
(0, common_1.Constant)("formio.whiteList", ["/spec.json"]),
|
|
26
|
+
(0, tslib_1.__metadata)("design:type", Array)
|
|
27
27
|
], AlterSkip.prototype, "whiteList", void 0);
|
|
28
|
-
AlterSkip = tslib_1.__decorate([
|
|
29
|
-
alter_1.Alter("skip")
|
|
28
|
+
AlterSkip = (0, tslib_1.__decorate)([
|
|
29
|
+
(0, alter_1.Alter)("skip")
|
|
30
30
|
], AlterSkip);
|
|
31
31
|
exports.AlterSkip = AlterSkip;
|
|
32
32
|
//# sourceMappingURL=AlterSkip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAA,sBAAa,EAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAjBC;IADC,IAAA,iBAAQ,EAAC,gBAAgB,EAAE,GAAG,CAAC;;0CAChB;AAGhB;IADC,IAAA,iBAAQ,EAAC,kBAAkB,EAAE,CAAC,YAAY,CAAC,CAAC;;4CACzB;AALT,SAAS;IADrB,IAAA,aAAK,EAAC,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"]}
|
|
@@ -28,7 +28,7 @@ let AlterTemplateExportSteps = class AlterTemplateExportSteps {
|
|
|
28
28
|
.reduce((acc, { _id, created, updated, modified, __v, owner, roles, form, metadata, ...submission }) => {
|
|
29
29
|
const machineName = mapper.mapToExport(form.toString());
|
|
30
30
|
const key = machineName.replace("$machineName:", "");
|
|
31
|
-
acc[key] = core_1.getValue(acc, key, []);
|
|
31
|
+
acc[key] = (0, core_1.getValue)(acc, key, []);
|
|
32
32
|
acc[key].push({
|
|
33
33
|
...submission,
|
|
34
34
|
created: created && created.toString(),
|
|
@@ -41,12 +41,12 @@ let AlterTemplateExportSteps = class AlterTemplateExportSteps {
|
|
|
41
41
|
}, {});
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
di_1.Inject(),
|
|
46
|
-
tslib_1.__metadata("design:type", FormioDatabase_1.FormioDatabase)
|
|
44
|
+
(0, tslib_1.__decorate)([
|
|
45
|
+
(0, di_1.Inject)(),
|
|
46
|
+
(0, tslib_1.__metadata)("design:type", FormioDatabase_1.FormioDatabase)
|
|
47
47
|
], AlterTemplateExportSteps.prototype, "database", void 0);
|
|
48
|
-
AlterTemplateExportSteps = tslib_1.__decorate([
|
|
49
|
-
alter_1.Alter("templateExportSteps")
|
|
48
|
+
AlterTemplateExportSteps = (0, tslib_1.__decorate)([
|
|
49
|
+
(0, alter_1.Alter)("templateExportSteps")
|
|
50
50
|
], AlterTemplateExportSteps);
|
|
51
51
|
exports.AlterTemplateExportSteps = AlterTemplateExportSteps;
|
|
52
52
|
//# sourceMappingURL=AlterTemplateExportSteps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,SAAS,CAAC,KAAY,EAAE,QAAwB,EAAE,GAAQ,EAAE,OAAY;QACtE,K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G,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,IAAA,WAAM,GAAE;2CACW,+BAAc;0DAAC;AAFxB,wBAAwB;IADpC,IAAA,aAAK,EAAC,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"]}
|
|
@@ -34,12 +34,12 @@ let AlterTemplateImportSteps = class AlterTemplateImportSteps {
|
|
|
34
34
|
return value;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
tslib_1.__decorate([
|
|
38
|
-
di_1.Inject(),
|
|
39
|
-
tslib_1.__metadata("design:type", FormioDatabase_1.FormioDatabase)
|
|
37
|
+
(0, tslib_1.__decorate)([
|
|
38
|
+
(0, di_1.Inject)(),
|
|
39
|
+
(0, tslib_1.__metadata)("design:type", FormioDatabase_1.FormioDatabase)
|
|
40
40
|
], AlterTemplateImportSteps.prototype, "database", void 0);
|
|
41
|
-
AlterTemplateImportSteps = tslib_1.__decorate([
|
|
42
|
-
alter_1.Alter("templateImportSteps")
|
|
41
|
+
AlterTemplateImportSteps = (0, tslib_1.__decorate)([
|
|
42
|
+
(0, alter_1.Alter)("templateImportSteps")
|
|
43
43
|
], AlterTemplateImportSteps);
|
|
44
44
|
exports.AlterTemplateImportSteps = AlterTemplateImportSteps;
|
|
45
45
|
//# sourceMappingURL=AlterTemplateImportSteps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlterTemplateImportSteps.js","sourceRoot":"","sources":["../../../src/components/AlterTemplateImportSteps.ts"],"names":[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AC,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,IAAA,WAAM,GAAE;2CACW,+BAAc;0DAAC;AAFxB,wBAAwB;IADpC,IAAA,aAAK,EAAC,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"]}
|
|
@@ -9,12 +9,12 @@ const di_1 = require("@tsed/di");
|
|
|
9
9
|
* @decorator
|
|
10
10
|
*/
|
|
11
11
|
function Action(options) {
|
|
12
|
-
return core_1.useDecorators((target) => {
|
|
13
|
-
di_1.registerProvider({
|
|
12
|
+
return (0, core_1.useDecorators)((target) => {
|
|
13
|
+
(0, di_1.registerProvider)({
|
|
14
14
|
provide: target,
|
|
15
15
|
type: "formio:action"
|
|
16
16
|
});
|
|
17
|
-
}, core_1.StoreSet("formio:action", options));
|
|
17
|
+
}, (0, core_1.StoreSet)("formio:action", options));
|
|
18
18
|
}
|
|
19
19
|
exports.Action = Action;
|
|
20
20
|
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAA,oBAAa,EAAC,CAAC,MAAW,EAAE,EAAE;QACnC,IAAA,qBAAgB,EAAC;YACf,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,eAAe;SACtB,CAAC,CAAC;IACL,CAAC,EAAE,IAAA,eAAQ,EAAC,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"]}
|
|
@@ -17,7 +17,7 @@ const common_1 = require("@tsed/common");
|
|
|
17
17
|
* @constructor
|
|
18
18
|
*/
|
|
19
19
|
function ActionCtx(expression) {
|
|
20
|
-
return common_1.Context(["ACTION_CTX", expression].filter(Boolean).join("."));
|
|
20
|
+
return (0, common_1.Context)(["ACTION_CTX", expression].filter(Boolean).join("."));
|
|
21
21
|
}
|
|
22
22
|
exports.ActionCtx = ActionCtx;
|
|
23
23
|
//# sourceMappingURL=actionCtx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAA,gBAAO,EAAC,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"]}
|
|
@@ -9,12 +9,12 @@ const di_1 = require("@tsed/di");
|
|
|
9
9
|
* @constructor
|
|
10
10
|
*/
|
|
11
11
|
function Alter(name) {
|
|
12
|
-
return core_1.useDecorators((target) => {
|
|
13
|
-
di_1.registerProvider({
|
|
12
|
+
return (0, core_1.useDecorators)((target) => {
|
|
13
|
+
(0, di_1.registerProvider)({
|
|
14
14
|
provide: target,
|
|
15
15
|
type: "formio:alter"
|
|
16
16
|
});
|
|
17
|
-
}, core_1.StoreSet("formio:alter:name", name));
|
|
17
|
+
}, (0, core_1.StoreSet)("formio:alter:name", name));
|
|
18
18
|
}
|
|
19
19
|
exports.Alter = Alter;
|
|
20
20
|
//# sourceMappingURL=alter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAA,oBAAa,EAAC,CAAC,MAAW,EAAE,EAAE;QACnC,IAAA,qBAAgB,EAAC;YACf,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,cAAc;SACrB,CAAC,CAAC;IACL,CAAC,EAAE,IAAA,eAAQ,EAAC,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"]}
|
|
@@ -9,12 +9,12 @@ const di_1 = require("@tsed/di");
|
|
|
9
9
|
* @constructor
|
|
10
10
|
*/
|
|
11
11
|
function On(name) {
|
|
12
|
-
return core_1.useDecorators((target) => {
|
|
13
|
-
di_1.registerProvider({
|
|
12
|
+
return (0, core_1.useDecorators)((target) => {
|
|
13
|
+
(0, di_1.registerProvider)({
|
|
14
14
|
provide: target,
|
|
15
15
|
type: "formio:on"
|
|
16
16
|
});
|
|
17
|
-
}, core_1.StoreSet("formio:on:name", name));
|
|
17
|
+
}, (0, core_1.StoreSet)("formio:on:name", name));
|
|
18
18
|
}
|
|
19
19
|
exports.On = On;
|
|
20
20
|
//# sourceMappingURL=on.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAA,oBAAa,EAAC,CAAC,MAAW,EAAE,EAAE;QACnC,IAAA,qBAAgB,EAAC;YACf,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;IACL,CAAC,EAAE,IAAA,eAAQ,EAAC,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"]}
|
|
@@ -9,7 +9,7 @@ const FormioAuthMiddleware_1 = require("../middlewares/FormioAuthMiddleware");
|
|
|
9
9
|
* @formio
|
|
10
10
|
*/
|
|
11
11
|
function UseFormioAuth() {
|
|
12
|
-
return common_1.UseAuth(FormioAuthMiddleware_1.FormioAuthMiddleware);
|
|
12
|
+
return (0, common_1.UseAuth)(FormioAuthMiddleware_1.FormioAuthMiddleware);
|
|
13
13
|
}
|
|
14
14
|
exports.UseFormioAuth = UseFormioAuth;
|
|
15
15
|
//# sourceMappingURL=useFormioAuth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAA,gBAAO,EAAC,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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormioModels.js","sourceRoot":"","sources":["../../../src/domain/FormioModels.ts"],"names":[],"mappings":";;;AAMA,kEAAmC","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"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
File without changes
|