@tsed/formio 7.83.3 → 8.0.0-alpha.10
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/esm/FormioModule.js.map +1 -1
- package/lib/esm/builder/FormioMapper.js.map +1 -1
- package/lib/esm/components/AlterActions.js.map +1 -1
- package/lib/esm/components/AlterAudit.js.map +1 -1
- package/lib/esm/components/AlterHost.js.map +1 -1
- package/lib/esm/components/AlterLog.js.map +1 -1
- package/lib/esm/components/AlterSkip.js.map +1 -1
- package/lib/esm/components/AlterTemplateExportSteps.js +1 -1
- package/lib/esm/components/AlterTemplateExportSteps.js.map +1 -1
- package/lib/esm/components/AlterTemplateImportSteps.js +1 -1
- package/lib/esm/components/AlterTemplateImportSteps.js.map +1 -1
- package/lib/esm/decorators/action.js.map +1 -1
- package/lib/esm/decorators/actionCtx.js.map +1 -1
- package/lib/esm/decorators/alter.js.map +1 -1
- package/lib/esm/decorators/on.js.map +1 -1
- package/lib/esm/decorators/useFormioAuth.js.map +1 -1
- package/lib/esm/domain/FormioModels.js.map +1 -1
- package/lib/esm/middlewares/FormioAuthMiddleware.js.map +1 -1
- package/lib/esm/services/FormioAuthService.js.map +1 -1
- package/lib/esm/services/FormioDatabase.js +1 -1
- package/lib/esm/services/FormioDatabase.js.map +1 -1
- package/lib/esm/services/FormioHooksService.js.map +1 -1
- package/lib/esm/services/FormioInstaller.js.map +1 -1
- package/lib/esm/services/FormioRepository.js.map +1 -1
- package/lib/esm/services/FormioService.js +1 -1
- package/lib/esm/services/FormioService.js.map +1 -1
- package/lib/types/decorators/actionCtx.d.ts +1 -1
- package/lib/types/domain/Formio.d.ts +26 -1
- package/lib/types/domain/FormioAction.d.ts +1 -1
- package/lib/types/domain/FormioBaseModel.d.ts +27 -1
- package/lib/types/domain/FormioCtxMapper.d.ts +1 -1
- package/lib/types/domain/FormioHooks.d.ts +26 -0
- package/lib/types/domain/FormioModels.d.ts +26 -1
- package/lib/types/domain/Resource.d.ts +1 -1
- package/lib/types/services/FormioAuthService.d.ts +11 -7
- package/lib/types/services/FormioDatabase.d.ts +36 -21
- package/lib/types/services/FormioHooksService.d.ts +1 -1
- package/lib/types/services/FormioRepository.d.ts +8 -3
- package/lib/types/services/FormioService.d.ts +25 -0
- package/package.json +26 -24
- package/vitest.config.mts +5 -5
- package/lib/cjs/FormioModule.js +0 -132
- package/lib/cjs/FormioModule.js.map +0 -1
- package/lib/cjs/builder/FormioMapper.js +0 -61
- package/lib/cjs/builder/FormioMapper.js.map +0 -1
- package/lib/cjs/components/AlterActions.js +0 -113
- package/lib/cjs/components/AlterActions.js.map +0 -1
- package/lib/cjs/components/AlterAudit.js +0 -16
- package/lib/cjs/components/AlterAudit.js.map +0 -1
- package/lib/cjs/components/AlterHost.js +0 -15
- package/lib/cjs/components/AlterHost.js.map +0 -1
- package/lib/cjs/components/AlterLog.js +0 -16
- package/lib/cjs/components/AlterLog.js.map +0 -1
- package/lib/cjs/components/AlterSkip.js +0 -32
- package/lib/cjs/components/AlterSkip.js.map +0 -1
- package/lib/cjs/components/AlterTemplateExportSteps.js +0 -52
- package/lib/cjs/components/AlterTemplateExportSteps.js.map +0 -1
- package/lib/cjs/components/AlterTemplateImportSteps.js +0 -45
- package/lib/cjs/components/AlterTemplateImportSteps.js.map +0 -1
- package/lib/cjs/decorators/action.js +0 -20
- package/lib/cjs/decorators/action.js.map +0 -1
- package/lib/cjs/decorators/actionCtx.js +0 -23
- package/lib/cjs/decorators/actionCtx.js.map +0 -1
- package/lib/cjs/decorators/alter.js +0 -20
- package/lib/cjs/decorators/alter.js.map +0 -1
- package/lib/cjs/decorators/on.js +0 -20
- package/lib/cjs/decorators/on.js.map +0 -1
- package/lib/cjs/decorators/useFormioAuth.js +0 -15
- package/lib/cjs/decorators/useFormioAuth.js.map +0 -1
- package/lib/cjs/domain/AlterHook.js +0 -3
- package/lib/cjs/domain/AlterHook.js.map +0 -1
- package/lib/cjs/domain/Formio.js +0 -3
- package/lib/cjs/domain/Formio.js.map +0 -1
- package/lib/cjs/domain/FormioAction.js +0 -3
- package/lib/cjs/domain/FormioAction.js.map +0 -1
- package/lib/cjs/domain/FormioActionsIndex.js +0 -3
- package/lib/cjs/domain/FormioActionsIndex.js.map +0 -1
- package/lib/cjs/domain/FormioAuth.js +0 -3
- package/lib/cjs/domain/FormioAuth.js.map +0 -1
- package/lib/cjs/domain/FormioBaseModel.js +0 -3
- package/lib/cjs/domain/FormioBaseModel.js.map +0 -1
- package/lib/cjs/domain/FormioConfig.js +0 -3
- package/lib/cjs/domain/FormioConfig.js.map +0 -1
- package/lib/cjs/domain/FormioCtxMapper.js +0 -3
- package/lib/cjs/domain/FormioCtxMapper.js.map +0 -1
- package/lib/cjs/domain/FormioDecodedToken.js +0 -3
- package/lib/cjs/domain/FormioDecodedToken.js.map +0 -1
- package/lib/cjs/domain/FormioErrors.js +0 -3
- package/lib/cjs/domain/FormioErrors.js.map +0 -1
- package/lib/cjs/domain/FormioHooks.js +0 -3
- package/lib/cjs/domain/FormioHooks.js.map +0 -1
- package/lib/cjs/domain/FormioJs.js +0 -3
- package/lib/cjs/domain/FormioJs.js.map +0 -1
- package/lib/cjs/domain/FormioModels.js +0 -5
- package/lib/cjs/domain/FormioModels.js.map +0 -1
- package/lib/cjs/domain/FormioRouter.js +0 -3
- package/lib/cjs/domain/FormioRouter.js.map +0 -1
- package/lib/cjs/domain/FormioSettings.js +0 -3
- package/lib/cjs/domain/FormioSettings.js.map +0 -1
- package/lib/cjs/domain/FormioTemplate.js +0 -3
- package/lib/cjs/domain/FormioTemplate.js.map +0 -1
- package/lib/cjs/domain/FormioTemplateUtil.js +0 -3
- package/lib/cjs/domain/FormioTemplateUtil.js.map +0 -1
- package/lib/cjs/domain/FormioUpdate.js +0 -3
- package/lib/cjs/domain/FormioUpdate.js.map +0 -1
- package/lib/cjs/domain/FormioUtils.js +0 -3
- package/lib/cjs/domain/FormioUtils.js.map +0 -1
- package/lib/cjs/domain/OnHook.js +0 -3
- package/lib/cjs/domain/OnHook.js.map +0 -1
- package/lib/cjs/domain/Resource.js +0 -3
- package/lib/cjs/domain/Resource.js.map +0 -1
- package/lib/cjs/index.js +0 -50
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/middlewares/FormioAuthMiddleware.js +0 -41
- package/lib/cjs/middlewares/FormioAuthMiddleware.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/services/FormioAuthService.js +0 -182
- package/lib/cjs/services/FormioAuthService.js.map +0 -1
- package/lib/cjs/services/FormioDatabase.js +0 -140
- package/lib/cjs/services/FormioDatabase.js.map +0 -1
- package/lib/cjs/services/FormioHooksService.js +0 -81
- package/lib/cjs/services/FormioHooksService.js.map +0 -1
- package/lib/cjs/services/FormioInstaller.js +0 -44
- package/lib/cjs/services/FormioInstaller.js.map +0 -1
- package/lib/cjs/services/FormioRepository.js +0 -42
- package/lib/cjs/services/FormioRepository.js.map +0 -1
- package/lib/cjs/services/FormioService.js +0 -103
- package/lib/cjs/services/FormioService.js.map +0 -1
- package/lib/cjs/utils/isMongoId.js +0 -8
- package/lib/cjs/utils/isMongoId.js.map +0 -1
- package/lib/esm/package.json +0 -3
- package/lib/types-esm/FormioModule.d.ts +0 -24
- package/lib/types-esm/builder/FormioMapper.d.ts +0 -11
- package/lib/types-esm/components/AlterActions.d.ts +0 -18
- package/lib/types-esm/components/AlterAudit.d.ts +0 -5
- package/lib/types-esm/components/AlterHost.d.ts +0 -5
- package/lib/types-esm/components/AlterLog.d.ts +0 -5
- package/lib/types-esm/components/AlterSkip.d.ts +0 -7
- package/lib/types-esm/components/AlterTemplateExportSteps.d.ts +0 -12
- package/lib/types-esm/components/AlterTemplateImportSteps.d.ts +0 -11
- package/lib/types-esm/decorators/action.d.ts +0 -7
- package/lib/types-esm/decorators/actionCtx.d.ts +0 -23
- package/lib/types-esm/decorators/alter.d.ts +0 -6
- package/lib/types-esm/decorators/on.d.ts +0 -6
- package/lib/types-esm/decorators/useFormioAuth.d.ts +0 -6
- package/lib/types-esm/domain/AlterHook.d.ts +0 -3
- package/lib/types-esm/domain/Formio.d.ts +0 -112
- package/lib/types-esm/domain/FormioAction.d.ts +0 -20
- package/lib/types-esm/domain/FormioActionsIndex.d.ts +0 -15
- package/lib/types-esm/domain/FormioAuth.d.ts +0 -67
- package/lib/types-esm/domain/FormioBaseModel.d.ts +0 -11
- package/lib/types-esm/domain/FormioConfig.d.ts +0 -59
- package/lib/types-esm/domain/FormioCtxMapper.d.ts +0 -7
- package/lib/types-esm/domain/FormioDecodedToken.d.ts +0 -12
- package/lib/types-esm/domain/FormioErrors.d.ts +0 -53
- package/lib/types-esm/domain/FormioHooks.d.ts +0 -194
- package/lib/types-esm/domain/FormioJs.d.ts +0 -17
- package/lib/types-esm/domain/FormioModels.d.ts +0 -42
- package/lib/types-esm/domain/FormioRouter.d.ts +0 -7
- package/lib/types-esm/domain/FormioSettings.d.ts +0 -53
- package/lib/types-esm/domain/FormioTemplate.d.ts +0 -8
- package/lib/types-esm/domain/FormioTemplateUtil.d.ts +0 -13
- package/lib/types-esm/domain/FormioUpdate.d.ts +0 -19
- package/lib/types-esm/domain/FormioUtils.d.ts +0 -307
- package/lib/types-esm/domain/OnHook.d.ts +0 -3
- package/lib/types-esm/domain/Resource.d.ts +0 -18
- package/lib/types-esm/index.d.ts +0 -46
- package/lib/types-esm/middlewares/FormioAuthMiddleware.d.ts +0 -11
- package/lib/types-esm/services/FormioAuthService.d.ts +0 -84
- package/lib/types-esm/services/FormioDatabase.d.ts +0 -84
- package/lib/types-esm/services/FormioHooksService.d.ts +0 -17
- package/lib/types-esm/services/FormioInstaller.d.ts +0 -12
- package/lib/types-esm/services/FormioRepository.d.ts +0 -41
- package/lib/types-esm/services/FormioService.d.ts +0 -36
- package/lib/types-esm/utils/isMongoId.d.ts +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AlterHost = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const alter_js_1 = require("../decorators/alter.js");
|
|
6
|
-
let AlterHost = class AlterHost {
|
|
7
|
-
transform(baseUrl, ctx) {
|
|
8
|
-
return `${ctx.request.protocol}://${ctx.request.host}${baseUrl}`;
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
AlterHost = tslib_1.__decorate([
|
|
12
|
-
(0, alter_js_1.Alter)("host")
|
|
13
|
-
], AlterHost);
|
|
14
|
-
exports.AlterHost = AlterHost;
|
|
15
|
-
//# sourceMappingURL=AlterHost.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterHost.js","sourceRoot":"","sources":["../../../src/components/AlterHost.ts"],"names":[],"mappings":";;;;AACA,qDAA6C;AAItC,IAAM,SAAS,GAAf,MAAM,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,gBAAK,EAAC,MAAM,CAAC;GACD,SAAS,CAIrB;AAJY,8BAAS"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AlterLog = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const alter_js_1 = require("../decorators/alter.js");
|
|
6
|
-
let AlterLog = class AlterLog {
|
|
7
|
-
transform(event, ctx, ...info) {
|
|
8
|
-
ctx.logger.debug({ event, info });
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
AlterLog = tslib_1.__decorate([
|
|
13
|
-
(0, alter_js_1.Alter)("log")
|
|
14
|
-
], AlterLog);
|
|
15
|
-
exports.AlterLog = AlterLog;
|
|
16
|
-
//# sourceMappingURL=AlterLog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterLog.js","sourceRoot":"","sources":["../../../src/components/AlterLog.ts"],"names":[],"mappings":";;;;AACA,qDAA6C;AAItC,IAAM,QAAQ,GAAd,MAAM,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,gBAAK,EAAC,KAAK,CAAC;GACA,QAAQ,CAKpB;AALY,4BAAQ"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AlterSkip = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const common_1 = require("@tsed/common");
|
|
6
|
-
const normalize_path_1 = require("@tsed/normalize-path");
|
|
7
|
-
const alter_js_1 = require("../decorators/alter.js");
|
|
8
|
-
let AlterSkip = class AlterSkip {
|
|
9
|
-
transform(value, ctx) {
|
|
10
|
-
if (value) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
const { request } = ctx;
|
|
14
|
-
const url = request.url.split("?")[0];
|
|
15
|
-
return !!this.whiteList.find((entry) => {
|
|
16
|
-
return (0, normalize_path_1.normalizePath)(this.baseUrl, entry) === url;
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
tslib_1.__decorate([
|
|
21
|
-
(0, common_1.Constant)("formio.baseUrl", "/"),
|
|
22
|
-
tslib_1.__metadata("design:type", String)
|
|
23
|
-
], AlterSkip.prototype, "baseUrl", void 0);
|
|
24
|
-
tslib_1.__decorate([
|
|
25
|
-
(0, common_1.Constant)("formio.whiteList", ["/spec.json"]),
|
|
26
|
-
tslib_1.__metadata("design:type", Array)
|
|
27
|
-
], AlterSkip.prototype, "whiteList", void 0);
|
|
28
|
-
AlterSkip = tslib_1.__decorate([
|
|
29
|
-
(0, alter_js_1.Alter)("skip")
|
|
30
|
-
], AlterSkip);
|
|
31
|
-
exports.AlterSkip = AlterSkip;
|
|
32
|
-
//# sourceMappingURL=AlterSkip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterSkip.js","sourceRoot":"","sources":["../../../src/components/AlterSkip.ts"],"names":[],"mappings":";;;;AAAA,yCAAuD;AACvD,yDAAmD;AACnD,qDAA6C;AAItC,IAAM,SAAS,GAAf,MAAM,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,8BAAa,EAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAlBC;IAAC,IAAA,iBAAQ,EAAC,gBAAgB,EAAE,GAAG,CAAC;;0CAChB;AAEhB;IAAC,IAAA,iBAAQ,EAAC,kBAAkB,EAAE,CAAC,YAAY,CAAC,CAAC;;4CACzB;AALT,SAAS;IADrB,IAAA,gBAAK,EAAC,MAAM,CAAC;GACD,SAAS,CAmBrB;AAnBY,8BAAS"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AlterTemplateExportSteps = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@tsed/core");
|
|
6
|
-
const di_1 = require("@tsed/di");
|
|
7
|
-
const alter_js_1 = require("../decorators/alter.js");
|
|
8
|
-
const FormioDatabase_js_1 = require("../services/FormioDatabase.js");
|
|
9
|
-
const async_1 = tslib_1.__importDefault(require("async"));
|
|
10
|
-
let AlterTemplateExportSteps = class AlterTemplateExportSteps {
|
|
11
|
-
transform(queue, template, map, options) {
|
|
12
|
-
queue.push(async_1.default.apply(this.exportSubmissions.bind(this), template, map, options));
|
|
13
|
-
return queue;
|
|
14
|
-
}
|
|
15
|
-
async exportSubmissions(template, map, options, next) {
|
|
16
|
-
const [mapper, submissions] = await Promise.all([
|
|
17
|
-
this.database.getFormioMapper(),
|
|
18
|
-
this.database.submissionModel.find({
|
|
19
|
-
deleted: { $eq: null }
|
|
20
|
-
})
|
|
21
|
-
]);
|
|
22
|
-
template.submissions = await this.mapSubmissions(submissions, mapper);
|
|
23
|
-
next(null, template);
|
|
24
|
-
}
|
|
25
|
-
mapSubmissions(submissions, mapper) {
|
|
26
|
-
return submissions
|
|
27
|
-
.map((submission) => submission.toObject())
|
|
28
|
-
.reduce((acc, { _id, created, updated, modified, __v, owner, roles, form, metadata, ...submission }) => {
|
|
29
|
-
const machineName = mapper.mapToExport(form.toString());
|
|
30
|
-
const key = machineName.replace("$machineName:", "");
|
|
31
|
-
acc[key] = (0, core_1.getValue)(acc, key, []);
|
|
32
|
-
acc[key].push({
|
|
33
|
-
...submission,
|
|
34
|
-
created: created && created.toString(),
|
|
35
|
-
modified: modified && modified.toString(),
|
|
36
|
-
data: mapper.mapToExport(submission.data),
|
|
37
|
-
roles: mapper.mapToExport(roles).filter(Boolean),
|
|
38
|
-
form: mapper.mapToExport(form)
|
|
39
|
-
});
|
|
40
|
-
return acc;
|
|
41
|
-
}, {});
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
(0, di_1.Inject)(),
|
|
46
|
-
tslib_1.__metadata("design:type", FormioDatabase_js_1.FormioDatabase)
|
|
47
|
-
], AlterTemplateExportSteps.prototype, "database", void 0);
|
|
48
|
-
AlterTemplateExportSteps = tslib_1.__decorate([
|
|
49
|
-
(0, alter_js_1.Alter)("templateExportSteps")
|
|
50
|
-
], AlterTemplateExportSteps);
|
|
51
|
-
exports.AlterTemplateExportSteps = AlterTemplateExportSteps;
|
|
52
|
-
//# sourceMappingURL=AlterTemplateExportSteps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterTemplateExportSteps.js","sourceRoot":"","sources":["../../../src/components/AlterTemplateExportSteps.ts"],"names":[],"mappings":";;;;AAAA,qCAAoC;AACpC,iCAAgC;AAGhC,qDAA6C;AAI7C,qEAA6D;AAC7D,0DAA0B;AAGnB,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAInC,SAAS,CAAC,KAAY,EAAE,QAAwB,EAAE,GAAQ,EAAE,OAAY;QACtE,KAAK,CAAC,IAAI,CAAC,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;QAEnF,OAAO,KAAK,CAAC;IACf,CAAC;IAES,KAAK,CAAC,iBAAiB,CAAC,QAAwB,EAAE,GAAQ,EAAE,OAAY,EAAE,IAAS;QAC3F,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC;gBACjC,OAAO,EAAE,EAAC,GAAG,EAAE,IAAI,EAAC;aACrB,CAAC;SACH,CAAC,CAAC;QAEH,QAAQ,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAEtE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACvB,CAAC;IAES,cAAc,CAAC,WAAiD,EAAE,MAAoB;QAC9F,OAAO,WAAW;aACf,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;aAC1C,MAAM,CAAC,CAAC,GAAQ,EAAE,EAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAC,EAAE,EAAE;YACxG,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YACxD,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;YAErD,GAAG,CAAC,GAAG,CAAC,GAAG,IAAA,eAAQ,EAAC,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;AA3CC;IAAC,IAAA,WAAM,GAAE;sCACW,kCAAc;0DAAC;AAFxB,wBAAwB;IADpC,IAAA,gBAAK,EAAC,qBAAqB,CAAC;GAChB,wBAAwB,CA4CpC;AA5CY,4DAAwB"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AlterTemplateImportSteps = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const di_1 = require("@tsed/di");
|
|
6
|
-
const alter_js_1 = require("../decorators/alter.js");
|
|
7
|
-
const FormioDatabase_js_1 = require("../services/FormioDatabase.js");
|
|
8
|
-
const async_1 = tslib_1.__importDefault(require("async"));
|
|
9
|
-
let AlterTemplateImportSteps = class AlterTemplateImportSteps {
|
|
10
|
-
transform(queue, install, template) {
|
|
11
|
-
queue.push(async_1.default.apply(this.importSubmissions.bind(this), template));
|
|
12
|
-
return queue;
|
|
13
|
-
}
|
|
14
|
-
async importSubmissions(template, done) {
|
|
15
|
-
if (template && template.submissions) {
|
|
16
|
-
// clean all submissions
|
|
17
|
-
await this.database.submissionModel.deleteMany({});
|
|
18
|
-
const ctxData = await this.database.getFormioMapper();
|
|
19
|
-
const entries = Object.entries(template.submissions);
|
|
20
|
-
for (const entry of entries) {
|
|
21
|
-
for (const submission of entry[1]) {
|
|
22
|
-
await this.importSubmission({ ...submission, form: submission.form || entry[0] }, ctxData);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
done();
|
|
27
|
-
}
|
|
28
|
-
async importSubmission(submission, mapper) {
|
|
29
|
-
const value = {
|
|
30
|
-
...mapper.mapToImport(submission),
|
|
31
|
-
roles: [...new Set(mapper.mapToImport(submission.roles || []))].filter(Boolean)
|
|
32
|
-
};
|
|
33
|
-
await this.database.submissionModel.create(value);
|
|
34
|
-
return value;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
tslib_1.__decorate([
|
|
38
|
-
(0, di_1.Inject)(),
|
|
39
|
-
tslib_1.__metadata("design:type", FormioDatabase_js_1.FormioDatabase)
|
|
40
|
-
], AlterTemplateImportSteps.prototype, "database", void 0);
|
|
41
|
-
AlterTemplateImportSteps = tslib_1.__decorate([
|
|
42
|
-
(0, alter_js_1.Alter)("templateImportSteps")
|
|
43
|
-
], AlterTemplateImportSteps);
|
|
44
|
-
exports.AlterTemplateImportSteps = AlterTemplateImportSteps;
|
|
45
|
-
//# sourceMappingURL=AlterTemplateImportSteps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterTemplateImportSteps.js","sourceRoot":"","sources":["../../../src/components/AlterTemplateImportSteps.ts"],"names":[],"mappings":";;;;AAAA,iCAAgC;AAEhC,qDAA6C;AAI7C,qEAA6D;AAC7D,0DAA0B;AAGnB,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAInC,SAAS,CAAC,KAAY,EAAE,OAAiB,EAAE,QAAiC;QAC1E,KAAK,CAAC,IAAI,CAAC,eAAK,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;AArCC;IAAC,IAAA,WAAM,GAAE;sCACW,kCAAc;0DAAC;AAFxB,wBAAwB;IADpC,IAAA,gBAAK,EAAC,qBAAqB,CAAC;GAChB,wBAAwB,CAsCpC;AAtCY,4DAAwB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Action = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const di_1 = require("@tsed/di");
|
|
6
|
-
/**
|
|
7
|
-
* Create a new FormIO Action.
|
|
8
|
-
* @param options
|
|
9
|
-
* @decorator
|
|
10
|
-
*/
|
|
11
|
-
function Action(options) {
|
|
12
|
-
return (0, core_1.useDecorators)((target) => {
|
|
13
|
-
(0, di_1.registerProvider)({
|
|
14
|
-
provide: target,
|
|
15
|
-
type: "formio:action"
|
|
16
|
-
});
|
|
17
|
-
}, (0, core_1.StoreSet)("formio:action", options));
|
|
18
|
-
}
|
|
19
|
-
exports.Action = Action;
|
|
20
|
-
//# sourceMappingURL=action.js.map
|
|
@@ -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,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"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionCtx = void 0;
|
|
4
|
-
const common_1 = require("@tsed/common");
|
|
5
|
-
/**
|
|
6
|
-
* Return the current action context with the following data:
|
|
7
|
-
*
|
|
8
|
-
* ```typescript
|
|
9
|
-
* export type ActionCtx = {
|
|
10
|
-
* handler: string;
|
|
11
|
-
* method: string;
|
|
12
|
-
* setActionItemMessage: SetActionItemMessage;
|
|
13
|
-
* action: FormioAction;
|
|
14
|
-
* };
|
|
15
|
-
* ```
|
|
16
|
-
* @param expression
|
|
17
|
-
* @constructor
|
|
18
|
-
*/
|
|
19
|
-
function ActionCtx(expression) {
|
|
20
|
-
return (0, common_1.Context)(["ACTION_CTX", expression].filter(Boolean).join("."));
|
|
21
|
-
}
|
|
22
|
-
exports.ActionCtx = ActionCtx;
|
|
23
|
-
//# sourceMappingURL=actionCtx.js.map
|
|
@@ -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,IAAA,gBAAO,EAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACvE,CAAC;AAFD,8BAEC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Alter = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const di_1 = require("@tsed/di");
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param name
|
|
9
|
-
* @constructor
|
|
10
|
-
*/
|
|
11
|
-
function Alter(name) {
|
|
12
|
-
return (0, core_1.useDecorators)((target) => {
|
|
13
|
-
(0, di_1.registerProvider)({
|
|
14
|
-
provide: target,
|
|
15
|
-
type: "formio:alter"
|
|
16
|
-
});
|
|
17
|
-
}, (0, core_1.StoreSet)("formio:alter:name", name));
|
|
18
|
-
}
|
|
19
|
-
exports.Alter = Alter;
|
|
20
|
-
//# sourceMappingURL=alter.js.map
|
|
@@ -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,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"}
|
package/lib/cjs/decorators/on.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.On = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const di_1 = require("@tsed/di");
|
|
6
|
-
/**
|
|
7
|
-
* Create a Form io hook event listener
|
|
8
|
-
* @param name
|
|
9
|
-
* @constructor
|
|
10
|
-
*/
|
|
11
|
-
function On(name) {
|
|
12
|
-
return (0, core_1.useDecorators)((target) => {
|
|
13
|
-
(0, di_1.registerProvider)({
|
|
14
|
-
provide: target,
|
|
15
|
-
type: "formio:on"
|
|
16
|
-
});
|
|
17
|
-
}, (0, core_1.StoreSet)("formio:on:name", name));
|
|
18
|
-
}
|
|
19
|
-
exports.On = On;
|
|
20
|
-
//# sourceMappingURL=on.js.map
|
|
@@ -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,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"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UseFormioAuth = void 0;
|
|
4
|
-
const common_1 = require("@tsed/common");
|
|
5
|
-
const FormioAuthMiddleware_js_1 = require("../middlewares/FormioAuthMiddleware.js");
|
|
6
|
-
/**
|
|
7
|
-
* Check if a user is connected by using the Formio Auth middleware
|
|
8
|
-
* @decorator
|
|
9
|
-
* @formio
|
|
10
|
-
*/
|
|
11
|
-
function UseFormioAuth() {
|
|
12
|
-
return (0, common_1.UseAuth)(FormioAuthMiddleware_js_1.FormioAuthMiddleware);
|
|
13
|
-
}
|
|
14
|
-
exports.UseFormioAuth = UseFormioAuth;
|
|
15
|
-
//# sourceMappingURL=useFormioAuth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFormioAuth.js","sourceRoot":"","sources":["../../../src/decorators/useFormioAuth.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,oFAA4E;AAE5E;;;;GAIG;AACH,SAAgB,aAAa;IAC3B,OAAO,IAAA,gBAAO,EAAC,8CAAoB,CAAC,CAAC;AACvC,CAAC;AAFD,sCAEC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlterHook.js","sourceRoot":"","sources":["../../../src/domain/AlterHook.ts"],"names":[],"mappings":""}
|
package/lib/cjs/domain/Formio.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Formio.js","sourceRoot":"","sources":["../../../src/domain/Formio.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioAction.js","sourceRoot":"","sources":["../../../src/domain/FormioAction.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioActionsIndex.js","sourceRoot":"","sources":["../../../src/domain/FormioActionsIndex.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioAuth.js","sourceRoot":"","sources":["../../../src/domain/FormioAuth.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioBaseModel.js","sourceRoot":"","sources":["../../../src/domain/FormioBaseModel.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioConfig.js","sourceRoot":"","sources":["../../../src/domain/FormioConfig.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioCtxMapper.js","sourceRoot":"","sources":["../../../src/domain/FormioCtxMapper.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioDecodedToken.js","sourceRoot":"","sources":["../../../src/domain/FormioDecodedToken.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioErrors.js","sourceRoot":"","sources":["../../../src/domain/FormioErrors.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioHooks.js","sourceRoot":"","sources":["../../../src/domain/FormioHooks.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioJs.js","sourceRoot":"","sources":["../../../src/domain/FormioJs.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioModels.js","sourceRoot":"","sources":["../../../src/domain/FormioModels.ts"],"names":[],"mappings":";;;AAMA,6DAAmC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioRouter.js","sourceRoot":"","sources":["../../../src/domain/FormioRouter.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioSettings.js","sourceRoot":"","sources":["../../../src/domain/FormioSettings.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioTemplate.js","sourceRoot":"","sources":["../../../src/domain/FormioTemplate.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioTemplateUtil.js","sourceRoot":"","sources":["../../../src/domain/FormioTemplateUtil.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioUpdate.js","sourceRoot":"","sources":["../../../src/domain/FormioUpdate.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioUtils.js","sourceRoot":"","sources":["../../../src/domain/FormioUtils.ts"],"names":[],"mappings":""}
|
package/lib/cjs/domain/OnHook.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OnHook.js","sourceRoot":"","sources":["../../../src/domain/OnHook.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../../src/domain/Resource.ts"],"names":[],"mappings":""}
|
package/lib/cjs/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/**
|
|
5
|
-
* @file Automatically generated by @tsed/barrels.
|
|
6
|
-
*/
|
|
7
|
-
tslib_1.__exportStar(require("./builder/FormioMapper.js"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./components/AlterActions.js"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./components/AlterAudit.js"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./components/AlterHost.js"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./components/AlterLog.js"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./components/AlterSkip.js"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./components/AlterTemplateExportSteps.js"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./components/AlterTemplateImportSteps.js"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./decorators/action.js"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./decorators/actionCtx.js"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./decorators/alter.js"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./decorators/on.js"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./decorators/useFormioAuth.js"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./domain/AlterHook.js"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./domain/Formio.js"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./domain/FormioAction.js"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./domain/FormioActionsIndex.js"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./domain/FormioAuth.js"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./domain/FormioBaseModel.js"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./domain/FormioConfig.js"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./domain/FormioCtxMapper.js"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./domain/FormioDecodedToken.js"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./domain/FormioErrors.js"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./domain/FormioHooks.js"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./domain/FormioJs.js"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./domain/FormioModels.js"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./domain/FormioRouter.js"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./domain/FormioSettings.js"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./domain/FormioTemplate.js"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./domain/FormioTemplateUtil.js"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("./domain/FormioUpdate.js"), exports);
|
|
38
|
-
tslib_1.__exportStar(require("./domain/FormioUtils.js"), exports);
|
|
39
|
-
tslib_1.__exportStar(require("./domain/OnHook.js"), exports);
|
|
40
|
-
tslib_1.__exportStar(require("./domain/Resource.js"), exports);
|
|
41
|
-
tslib_1.__exportStar(require("./FormioModule.js"), exports);
|
|
42
|
-
tslib_1.__exportStar(require("./middlewares/FormioAuthMiddleware.js"), exports);
|
|
43
|
-
tslib_1.__exportStar(require("./services/FormioAuthService.js"), exports);
|
|
44
|
-
tslib_1.__exportStar(require("./services/FormioDatabase.js"), exports);
|
|
45
|
-
tslib_1.__exportStar(require("./services/FormioHooksService.js"), exports);
|
|
46
|
-
tslib_1.__exportStar(require("./services/FormioInstaller.js"), exports);
|
|
47
|
-
tslib_1.__exportStar(require("./services/FormioRepository.js"), exports);
|
|
48
|
-
tslib_1.__exportStar(require("./services/FormioService.js"), exports);
|
|
49
|
-
tslib_1.__exportStar(require("./utils/isMongoId.js"), exports);
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,oEAA0C;AAC1C,uEAA6C;AAC7C,qEAA2C;AAC3C,oEAA0C;AAC1C,mEAAyC;AACzC,oEAA0C;AAC1C,mFAAyD;AACzD,mFAAyD;AACzD,iEAAuC;AACvC,oEAA0C;AAC1C,gEAAsC;AACtC,6DAAmC;AACnC,wEAA8C;AAC9C,gEAAsC;AACtC,6DAAmC;AACnC,mEAAyC;AACzC,yEAA+C;AAC/C,iEAAuC;AACvC,sEAA4C;AAC5C,mEAAyC;AACzC,sEAA4C;AAC5C,yEAA+C;AAC/C,mEAAyC;AACzC,kEAAwC;AACxC,+DAAqC;AACrC,mEAAyC;AACzC,mEAAyC;AACzC,qEAA2C;AAC3C,qEAA2C;AAC3C,yEAA+C;AAC/C,mEAAyC;AACzC,kEAAwC;AACxC,6DAAmC;AACnC,+DAAqC;AACrC,4DAAkC;AAClC,gFAAsD;AACtD,0EAAgD;AAChD,uEAA6C;AAC7C,2EAAiD;AACjD,wEAA8C;AAC9C,yEAA+C;AAC/C,sEAA4C;AAC5C,+DAAqC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormioAuthMiddleware = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const common_1 = require("@tsed/common");
|
|
6
|
-
const core_1 = require("@tsed/core");
|
|
7
|
-
const exceptions_1 = require("@tsed/exceptions");
|
|
8
|
-
const util_1 = require("util");
|
|
9
|
-
const FormioService_js_1 = require("../services/FormioService.js");
|
|
10
|
-
/**
|
|
11
|
-
* @middleware
|
|
12
|
-
* @formio
|
|
13
|
-
*/
|
|
14
|
-
let FormioAuthMiddleware = class FormioAuthMiddleware {
|
|
15
|
-
get tokenHandler() {
|
|
16
|
-
return (0, util_1.promisify)(this.formio.middleware.tokenHandler);
|
|
17
|
-
}
|
|
18
|
-
async use(ctx) {
|
|
19
|
-
const req = ctx.getRequest();
|
|
20
|
-
const res = ctx.getResponse();
|
|
21
|
-
await this.tokenHandler(req, res);
|
|
22
|
-
if (!(0, core_1.getValue)(req, "token.user._id")) {
|
|
23
|
-
throw new exceptions_1.Unauthorized("User unauthorized");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
tslib_1.__decorate([
|
|
28
|
-
(0, common_1.Inject)(),
|
|
29
|
-
tslib_1.__metadata("design:type", FormioService_js_1.FormioService)
|
|
30
|
-
], FormioAuthMiddleware.prototype, "formio", void 0);
|
|
31
|
-
tslib_1.__decorate([
|
|
32
|
-
tslib_1.__param(0, (0, common_1.Context)()),
|
|
33
|
-
tslib_1.__metadata("design:type", Function),
|
|
34
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
35
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
36
|
-
], FormioAuthMiddleware.prototype, "use", null);
|
|
37
|
-
FormioAuthMiddleware = tslib_1.__decorate([
|
|
38
|
-
(0, common_1.Middleware)()
|
|
39
|
-
], FormioAuthMiddleware);
|
|
40
|
-
exports.FormioAuthMiddleware = FormioAuthMiddleware;
|
|
41
|
-
//# sourceMappingURL=FormioAuthMiddleware.js.map
|
|
@@ -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,mEAA2D;AAE3D;;;GAGG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAI/B,IAAI,YAAY;QACd,OAAO,IAAA,gBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IACxD,CAAC;IAEK,AAAN,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,IAAA,eAAQ,EAAC,GAAG,EAAE,gBAAgB,CAAC,EAAE;YACpC,MAAM,IAAI,yBAAY,CAAC,mBAAmB,CAAC,CAAC;SAC7C;IACH,CAAC;CACF,CAAA;AAjBC;IAAC,IAAA,eAAM,GAAE;sCACS,gCAAa;oDAAC;AAM1B;IAAK,mBAAA,IAAA,gBAAO,GAAE,CAAA;;;;+CASnB;AAjBU,oBAAoB;IADhC,IAAA,mBAAU,GAAE;GACA,oBAAoB,CAkBhC;AAlBY,oDAAoB"}
|
package/lib/cjs/package.json
DELETED