@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.
Files changed (175) hide show
  1. package/lib/esm/FormioModule.js.map +1 -1
  2. package/lib/esm/builder/FormioMapper.js.map +1 -1
  3. package/lib/esm/components/AlterActions.js.map +1 -1
  4. package/lib/esm/components/AlterAudit.js.map +1 -1
  5. package/lib/esm/components/AlterHost.js.map +1 -1
  6. package/lib/esm/components/AlterLog.js.map +1 -1
  7. package/lib/esm/components/AlterSkip.js.map +1 -1
  8. package/lib/esm/components/AlterTemplateExportSteps.js +1 -1
  9. package/lib/esm/components/AlterTemplateExportSteps.js.map +1 -1
  10. package/lib/esm/components/AlterTemplateImportSteps.js +1 -1
  11. package/lib/esm/components/AlterTemplateImportSteps.js.map +1 -1
  12. package/lib/esm/decorators/action.js.map +1 -1
  13. package/lib/esm/decorators/actionCtx.js.map +1 -1
  14. package/lib/esm/decorators/alter.js.map +1 -1
  15. package/lib/esm/decorators/on.js.map +1 -1
  16. package/lib/esm/decorators/useFormioAuth.js.map +1 -1
  17. package/lib/esm/domain/FormioModels.js.map +1 -1
  18. package/lib/esm/middlewares/FormioAuthMiddleware.js.map +1 -1
  19. package/lib/esm/services/FormioAuthService.js.map +1 -1
  20. package/lib/esm/services/FormioDatabase.js +1 -1
  21. package/lib/esm/services/FormioDatabase.js.map +1 -1
  22. package/lib/esm/services/FormioHooksService.js.map +1 -1
  23. package/lib/esm/services/FormioInstaller.js.map +1 -1
  24. package/lib/esm/services/FormioRepository.js.map +1 -1
  25. package/lib/esm/services/FormioService.js +1 -1
  26. package/lib/esm/services/FormioService.js.map +1 -1
  27. package/lib/types/decorators/actionCtx.d.ts +1 -1
  28. package/lib/types/domain/Formio.d.ts +26 -1
  29. package/lib/types/domain/FormioAction.d.ts +1 -1
  30. package/lib/types/domain/FormioBaseModel.d.ts +27 -1
  31. package/lib/types/domain/FormioCtxMapper.d.ts +1 -1
  32. package/lib/types/domain/FormioHooks.d.ts +26 -0
  33. package/lib/types/domain/FormioModels.d.ts +26 -1
  34. package/lib/types/domain/Resource.d.ts +1 -1
  35. package/lib/types/services/FormioAuthService.d.ts +11 -7
  36. package/lib/types/services/FormioDatabase.d.ts +36 -21
  37. package/lib/types/services/FormioHooksService.d.ts +1 -1
  38. package/lib/types/services/FormioRepository.d.ts +8 -3
  39. package/lib/types/services/FormioService.d.ts +25 -0
  40. package/package.json +26 -24
  41. package/vitest.config.mts +5 -5
  42. package/lib/cjs/FormioModule.js +0 -132
  43. package/lib/cjs/FormioModule.js.map +0 -1
  44. package/lib/cjs/builder/FormioMapper.js +0 -61
  45. package/lib/cjs/builder/FormioMapper.js.map +0 -1
  46. package/lib/cjs/components/AlterActions.js +0 -113
  47. package/lib/cjs/components/AlterActions.js.map +0 -1
  48. package/lib/cjs/components/AlterAudit.js +0 -16
  49. package/lib/cjs/components/AlterAudit.js.map +0 -1
  50. package/lib/cjs/components/AlterHost.js +0 -15
  51. package/lib/cjs/components/AlterHost.js.map +0 -1
  52. package/lib/cjs/components/AlterLog.js +0 -16
  53. package/lib/cjs/components/AlterLog.js.map +0 -1
  54. package/lib/cjs/components/AlterSkip.js +0 -32
  55. package/lib/cjs/components/AlterSkip.js.map +0 -1
  56. package/lib/cjs/components/AlterTemplateExportSteps.js +0 -52
  57. package/lib/cjs/components/AlterTemplateExportSteps.js.map +0 -1
  58. package/lib/cjs/components/AlterTemplateImportSteps.js +0 -45
  59. package/lib/cjs/components/AlterTemplateImportSteps.js.map +0 -1
  60. package/lib/cjs/decorators/action.js +0 -20
  61. package/lib/cjs/decorators/action.js.map +0 -1
  62. package/lib/cjs/decorators/actionCtx.js +0 -23
  63. package/lib/cjs/decorators/actionCtx.js.map +0 -1
  64. package/lib/cjs/decorators/alter.js +0 -20
  65. package/lib/cjs/decorators/alter.js.map +0 -1
  66. package/lib/cjs/decorators/on.js +0 -20
  67. package/lib/cjs/decorators/on.js.map +0 -1
  68. package/lib/cjs/decorators/useFormioAuth.js +0 -15
  69. package/lib/cjs/decorators/useFormioAuth.js.map +0 -1
  70. package/lib/cjs/domain/AlterHook.js +0 -3
  71. package/lib/cjs/domain/AlterHook.js.map +0 -1
  72. package/lib/cjs/domain/Formio.js +0 -3
  73. package/lib/cjs/domain/Formio.js.map +0 -1
  74. package/lib/cjs/domain/FormioAction.js +0 -3
  75. package/lib/cjs/domain/FormioAction.js.map +0 -1
  76. package/lib/cjs/domain/FormioActionsIndex.js +0 -3
  77. package/lib/cjs/domain/FormioActionsIndex.js.map +0 -1
  78. package/lib/cjs/domain/FormioAuth.js +0 -3
  79. package/lib/cjs/domain/FormioAuth.js.map +0 -1
  80. package/lib/cjs/domain/FormioBaseModel.js +0 -3
  81. package/lib/cjs/domain/FormioBaseModel.js.map +0 -1
  82. package/lib/cjs/domain/FormioConfig.js +0 -3
  83. package/lib/cjs/domain/FormioConfig.js.map +0 -1
  84. package/lib/cjs/domain/FormioCtxMapper.js +0 -3
  85. package/lib/cjs/domain/FormioCtxMapper.js.map +0 -1
  86. package/lib/cjs/domain/FormioDecodedToken.js +0 -3
  87. package/lib/cjs/domain/FormioDecodedToken.js.map +0 -1
  88. package/lib/cjs/domain/FormioErrors.js +0 -3
  89. package/lib/cjs/domain/FormioErrors.js.map +0 -1
  90. package/lib/cjs/domain/FormioHooks.js +0 -3
  91. package/lib/cjs/domain/FormioHooks.js.map +0 -1
  92. package/lib/cjs/domain/FormioJs.js +0 -3
  93. package/lib/cjs/domain/FormioJs.js.map +0 -1
  94. package/lib/cjs/domain/FormioModels.js +0 -5
  95. package/lib/cjs/domain/FormioModels.js.map +0 -1
  96. package/lib/cjs/domain/FormioRouter.js +0 -3
  97. package/lib/cjs/domain/FormioRouter.js.map +0 -1
  98. package/lib/cjs/domain/FormioSettings.js +0 -3
  99. package/lib/cjs/domain/FormioSettings.js.map +0 -1
  100. package/lib/cjs/domain/FormioTemplate.js +0 -3
  101. package/lib/cjs/domain/FormioTemplate.js.map +0 -1
  102. package/lib/cjs/domain/FormioTemplateUtil.js +0 -3
  103. package/lib/cjs/domain/FormioTemplateUtil.js.map +0 -1
  104. package/lib/cjs/domain/FormioUpdate.js +0 -3
  105. package/lib/cjs/domain/FormioUpdate.js.map +0 -1
  106. package/lib/cjs/domain/FormioUtils.js +0 -3
  107. package/lib/cjs/domain/FormioUtils.js.map +0 -1
  108. package/lib/cjs/domain/OnHook.js +0 -3
  109. package/lib/cjs/domain/OnHook.js.map +0 -1
  110. package/lib/cjs/domain/Resource.js +0 -3
  111. package/lib/cjs/domain/Resource.js.map +0 -1
  112. package/lib/cjs/index.js +0 -50
  113. package/lib/cjs/index.js.map +0 -1
  114. package/lib/cjs/middlewares/FormioAuthMiddleware.js +0 -41
  115. package/lib/cjs/middlewares/FormioAuthMiddleware.js.map +0 -1
  116. package/lib/cjs/package.json +0 -3
  117. package/lib/cjs/services/FormioAuthService.js +0 -182
  118. package/lib/cjs/services/FormioAuthService.js.map +0 -1
  119. package/lib/cjs/services/FormioDatabase.js +0 -140
  120. package/lib/cjs/services/FormioDatabase.js.map +0 -1
  121. package/lib/cjs/services/FormioHooksService.js +0 -81
  122. package/lib/cjs/services/FormioHooksService.js.map +0 -1
  123. package/lib/cjs/services/FormioInstaller.js +0 -44
  124. package/lib/cjs/services/FormioInstaller.js.map +0 -1
  125. package/lib/cjs/services/FormioRepository.js +0 -42
  126. package/lib/cjs/services/FormioRepository.js.map +0 -1
  127. package/lib/cjs/services/FormioService.js +0 -103
  128. package/lib/cjs/services/FormioService.js.map +0 -1
  129. package/lib/cjs/utils/isMongoId.js +0 -8
  130. package/lib/cjs/utils/isMongoId.js.map +0 -1
  131. package/lib/esm/package.json +0 -3
  132. package/lib/types-esm/FormioModule.d.ts +0 -24
  133. package/lib/types-esm/builder/FormioMapper.d.ts +0 -11
  134. package/lib/types-esm/components/AlterActions.d.ts +0 -18
  135. package/lib/types-esm/components/AlterAudit.d.ts +0 -5
  136. package/lib/types-esm/components/AlterHost.d.ts +0 -5
  137. package/lib/types-esm/components/AlterLog.d.ts +0 -5
  138. package/lib/types-esm/components/AlterSkip.d.ts +0 -7
  139. package/lib/types-esm/components/AlterTemplateExportSteps.d.ts +0 -12
  140. package/lib/types-esm/components/AlterTemplateImportSteps.d.ts +0 -11
  141. package/lib/types-esm/decorators/action.d.ts +0 -7
  142. package/lib/types-esm/decorators/actionCtx.d.ts +0 -23
  143. package/lib/types-esm/decorators/alter.d.ts +0 -6
  144. package/lib/types-esm/decorators/on.d.ts +0 -6
  145. package/lib/types-esm/decorators/useFormioAuth.d.ts +0 -6
  146. package/lib/types-esm/domain/AlterHook.d.ts +0 -3
  147. package/lib/types-esm/domain/Formio.d.ts +0 -112
  148. package/lib/types-esm/domain/FormioAction.d.ts +0 -20
  149. package/lib/types-esm/domain/FormioActionsIndex.d.ts +0 -15
  150. package/lib/types-esm/domain/FormioAuth.d.ts +0 -67
  151. package/lib/types-esm/domain/FormioBaseModel.d.ts +0 -11
  152. package/lib/types-esm/domain/FormioConfig.d.ts +0 -59
  153. package/lib/types-esm/domain/FormioCtxMapper.d.ts +0 -7
  154. package/lib/types-esm/domain/FormioDecodedToken.d.ts +0 -12
  155. package/lib/types-esm/domain/FormioErrors.d.ts +0 -53
  156. package/lib/types-esm/domain/FormioHooks.d.ts +0 -194
  157. package/lib/types-esm/domain/FormioJs.d.ts +0 -17
  158. package/lib/types-esm/domain/FormioModels.d.ts +0 -42
  159. package/lib/types-esm/domain/FormioRouter.d.ts +0 -7
  160. package/lib/types-esm/domain/FormioSettings.d.ts +0 -53
  161. package/lib/types-esm/domain/FormioTemplate.d.ts +0 -8
  162. package/lib/types-esm/domain/FormioTemplateUtil.d.ts +0 -13
  163. package/lib/types-esm/domain/FormioUpdate.d.ts +0 -19
  164. package/lib/types-esm/domain/FormioUtils.d.ts +0 -307
  165. package/lib/types-esm/domain/OnHook.d.ts +0 -3
  166. package/lib/types-esm/domain/Resource.d.ts +0 -18
  167. package/lib/types-esm/index.d.ts +0 -46
  168. package/lib/types-esm/middlewares/FormioAuthMiddleware.d.ts +0 -11
  169. package/lib/types-esm/services/FormioAuthService.d.ts +0 -84
  170. package/lib/types-esm/services/FormioDatabase.d.ts +0 -84
  171. package/lib/types-esm/services/FormioHooksService.d.ts +0 -17
  172. package/lib/types-esm/services/FormioInstaller.d.ts +0 -12
  173. package/lib/types-esm/services/FormioRepository.d.ts +0 -41
  174. package/lib/types-esm/services/FormioService.d.ts +0 -36
  175. 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"}
@@ -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,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=AlterHook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AlterHook.js","sourceRoot":"","sources":["../../../src/domain/AlterHook.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Formio.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Formio.js","sourceRoot":"","sources":["../../../src/domain/Formio.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioAction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioAction.js","sourceRoot":"","sources":["../../../src/domain/FormioAction.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioActionsIndex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioActionsIndex.js","sourceRoot":"","sources":["../../../src/domain/FormioActionsIndex.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioAuth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioAuth.js","sourceRoot":"","sources":["../../../src/domain/FormioAuth.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioBaseModel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioBaseModel.js","sourceRoot":"","sources":["../../../src/domain/FormioBaseModel.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioConfig.js","sourceRoot":"","sources":["../../../src/domain/FormioConfig.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioCtxMapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioCtxMapper.js","sourceRoot":"","sources":["../../../src/domain/FormioCtxMapper.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioDecodedToken.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioDecodedToken.js","sourceRoot":"","sources":["../../../src/domain/FormioDecodedToken.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioErrors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioErrors.js","sourceRoot":"","sources":["../../../src/domain/FormioErrors.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioHooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioHooks.js","sourceRoot":"","sources":["../../../src/domain/FormioHooks.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioJs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioJs.js","sourceRoot":"","sources":["../../../src/domain/FormioJs.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("@tsed/formio-types"), exports);
5
- //# sourceMappingURL=FormioModels.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioModels.js","sourceRoot":"","sources":["../../../src/domain/FormioModels.ts"],"names":[],"mappings":";;;AAMA,6DAAmC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioRouter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioRouter.js","sourceRoot":"","sources":["../../../src/domain/FormioRouter.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioSettings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioSettings.js","sourceRoot":"","sources":["../../../src/domain/FormioSettings.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioTemplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioTemplate.js","sourceRoot":"","sources":["../../../src/domain/FormioTemplate.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioTemplateUtil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioTemplateUtil.js","sourceRoot":"","sources":["../../../src/domain/FormioTemplateUtil.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioUpdate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioUpdate.js","sourceRoot":"","sources":["../../../src/domain/FormioUpdate.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FormioUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormioUtils.js","sourceRoot":"","sources":["../../../src/domain/FormioUtils.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=OnHook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OnHook.js","sourceRoot":"","sources":["../../../src/domain/OnHook.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Resource.js.map
@@ -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
@@ -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"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }