@tsed/formio 7.0.0-alpha.1 → 7.0.0-beta.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 (276) hide show
  1. package/.mocharc.js +2 -2
  2. package/.nycrc +6 -5
  3. package/lib/{FormioModule.js → cjs/FormioModule.js} +17 -30
  4. package/lib/cjs/FormioModule.js.map +1 -0
  5. package/lib/{builder → cjs/builder}/FormioMapper.js +11 -3
  6. package/lib/cjs/builder/FormioMapper.js.map +1 -0
  7. package/lib/cjs/components/AlterActions.js +111 -0
  8. package/lib/cjs/components/AlterActions.js.map +1 -0
  9. package/lib/{components → cjs/components}/AlterAudit.js +1 -1
  10. package/lib/cjs/components/AlterAudit.js.map +1 -0
  11. package/lib/{components → cjs/components}/AlterHost.js +1 -1
  12. package/lib/cjs/components/AlterHost.js.map +1 -0
  13. package/lib/{components → cjs/components}/AlterLog.js +1 -1
  14. package/lib/cjs/components/AlterLog.js.map +1 -0
  15. package/lib/{components → cjs/components}/AlterSkip.js +4 -4
  16. package/lib/cjs/components/AlterSkip.js.map +1 -0
  17. package/lib/{components → cjs/components}/AlterTemplateExportSteps.js +5 -5
  18. package/lib/cjs/components/AlterTemplateExportSteps.js.map +1 -0
  19. package/lib/{components → cjs/components}/AlterTemplateImportSteps.js +4 -4
  20. package/lib/cjs/components/AlterTemplateImportSteps.js.map +1 -0
  21. package/lib/{decorators → cjs/decorators}/action.js +3 -3
  22. package/lib/cjs/decorators/action.js.map +1 -0
  23. package/lib/{decorators → cjs/decorators}/actionCtx.js +1 -1
  24. package/lib/cjs/decorators/actionCtx.js.map +1 -0
  25. package/lib/{decorators → cjs/decorators}/alter.js +3 -3
  26. package/lib/cjs/decorators/alter.js.map +1 -0
  27. package/lib/{decorators → cjs/decorators}/on.js +3 -3
  28. package/lib/cjs/decorators/on.js.map +1 -0
  29. package/lib/{decorators → cjs/decorators}/useFormioAuth.js +1 -1
  30. package/lib/cjs/decorators/useFormioAuth.js.map +1 -0
  31. package/lib/{domain → cjs/domain}/AlterHook.js +0 -0
  32. package/lib/cjs/domain/AlterHook.js.map +1 -0
  33. package/lib/{domain → cjs/domain}/Formio.js +0 -0
  34. package/lib/cjs/domain/Formio.js.map +1 -0
  35. package/lib/{domain → cjs/domain}/FormioAction.js +0 -0
  36. package/lib/cjs/domain/FormioAction.js.map +1 -0
  37. package/lib/{domain → cjs/domain}/FormioActionsIndex.js +0 -0
  38. package/lib/cjs/domain/FormioActionsIndex.js.map +1 -0
  39. package/lib/{domain → cjs/domain}/FormioAuth.js +0 -0
  40. package/lib/cjs/domain/FormioAuth.js.map +1 -0
  41. package/lib/{domain → cjs/domain}/FormioBaseModel.js +0 -0
  42. package/lib/cjs/domain/FormioBaseModel.js.map +1 -0
  43. package/lib/{domain → cjs/domain}/FormioConfig.js +0 -0
  44. package/lib/cjs/domain/FormioConfig.js.map +1 -0
  45. package/lib/{domain → cjs/domain}/FormioCtxMapper.js +0 -0
  46. package/lib/cjs/domain/FormioCtxMapper.js.map +1 -0
  47. package/lib/{domain → cjs/domain}/FormioDecodedToken.js +0 -0
  48. package/lib/cjs/domain/FormioDecodedToken.js.map +1 -0
  49. package/lib/{domain → cjs/domain}/FormioErrors.js +0 -0
  50. package/lib/cjs/domain/FormioErrors.js.map +1 -0
  51. package/lib/{domain → cjs/domain}/FormioHooks.js +0 -0
  52. package/lib/cjs/domain/FormioHooks.js.map +1 -0
  53. package/lib/{domain → cjs/domain}/FormioJs.js +0 -0
  54. package/lib/cjs/domain/FormioJs.js.map +1 -0
  55. package/lib/cjs/domain/FormioModels.js +5 -0
  56. package/lib/cjs/domain/FormioModels.js.map +1 -0
  57. package/lib/{domain → cjs/domain}/FormioRouter.js +0 -0
  58. package/lib/cjs/domain/FormioRouter.js.map +1 -0
  59. package/lib/{domain → cjs/domain}/FormioSettings.js +0 -0
  60. package/lib/cjs/domain/FormioSettings.js.map +1 -0
  61. package/lib/{domain → cjs/domain}/FormioTemplate.js +0 -0
  62. package/lib/cjs/domain/FormioTemplate.js.map +1 -0
  63. package/lib/{domain → cjs/domain}/FormioTemplateUtil.js +0 -0
  64. package/lib/cjs/domain/FormioTemplateUtil.js.map +1 -0
  65. package/lib/{domain → cjs/domain}/FormioUpdate.js +0 -0
  66. package/lib/cjs/domain/FormioUpdate.js.map +1 -0
  67. package/lib/{domain → cjs/domain}/FormioUtils.js +0 -0
  68. package/lib/cjs/domain/FormioUtils.js.map +1 -0
  69. package/lib/{domain → cjs/domain}/OnHook.js +0 -0
  70. package/lib/cjs/domain/OnHook.js.map +1 -0
  71. package/lib/{domain → cjs/domain}/Resource.js +0 -0
  72. package/lib/cjs/domain/Resource.js.map +1 -0
  73. package/lib/{index.js → cjs/index.js} +22 -18
  74. package/lib/cjs/index.js.map +1 -0
  75. package/lib/{middlewares → cjs/middlewares}/FormioAuthMiddleware.js +5 -5
  76. package/lib/cjs/middlewares/FormioAuthMiddleware.js.map +1 -0
  77. package/lib/cjs/package.json +3 -0
  78. package/lib/{services → cjs/services}/FormioAuthService.js +6 -6
  79. package/lib/cjs/services/FormioAuthService.js.map +1 -0
  80. package/lib/{services → cjs/services}/FormioDatabase.js +50 -13
  81. package/lib/cjs/services/FormioDatabase.js.map +1 -0
  82. package/lib/{services → cjs/services}/FormioHooksService.js +4 -4
  83. package/lib/cjs/services/FormioHooksService.js.map +1 -0
  84. package/lib/{services → cjs/services}/FormioInstaller.js +3 -3
  85. package/lib/cjs/services/FormioInstaller.js.map +1 -0
  86. package/lib/cjs/services/FormioRepository.js +42 -0
  87. package/lib/cjs/services/FormioRepository.js.map +1 -0
  88. package/lib/cjs/services/FormioService.js +103 -0
  89. package/lib/cjs/services/FormioService.js.map +1 -0
  90. package/lib/{utils → cjs/utils}/isMongoId.js +0 -0
  91. package/lib/cjs/utils/isMongoId.js.map +1 -0
  92. package/lib/esm/FormioModule.js +134 -0
  93. package/lib/esm/FormioModule.js.map +1 -0
  94. package/lib/esm/builder/FormioMapper.js +57 -0
  95. package/lib/esm/builder/FormioMapper.js.map +1 -0
  96. package/lib/esm/components/AlterActions.js +108 -0
  97. package/lib/esm/components/AlterActions.js.map +1 -0
  98. package/lib/esm/components/AlterAudit.js +13 -0
  99. package/lib/esm/components/AlterAudit.js.map +1 -0
  100. package/lib/esm/components/AlterHost.js +12 -0
  101. package/lib/esm/components/AlterHost.js.map +1 -0
  102. package/lib/esm/components/AlterLog.js +13 -0
  103. package/lib/esm/components/AlterLog.js.map +1 -0
  104. package/lib/esm/components/AlterSkip.js +29 -0
  105. package/lib/esm/components/AlterSkip.js.map +1 -0
  106. package/lib/esm/components/AlterTemplateExportSteps.js +49 -0
  107. package/lib/esm/components/AlterTemplateExportSteps.js.map +1 -0
  108. package/lib/esm/components/AlterTemplateImportSteps.js +42 -0
  109. package/lib/esm/components/AlterTemplateImportSteps.js.map +1 -0
  110. package/lib/esm/decorators/action.js +16 -0
  111. package/lib/esm/decorators/action.js.map +1 -0
  112. package/lib/esm/decorators/actionCtx.js +19 -0
  113. package/lib/esm/decorators/actionCtx.js.map +1 -0
  114. package/lib/esm/decorators/alter.js +16 -0
  115. package/lib/esm/decorators/alter.js.map +1 -0
  116. package/lib/esm/decorators/on.js +16 -0
  117. package/lib/esm/decorators/on.js.map +1 -0
  118. package/lib/esm/decorators/useFormioAuth.js +11 -0
  119. package/lib/esm/decorators/useFormioAuth.js.map +1 -0
  120. package/lib/esm/domain/AlterHook.js +2 -0
  121. package/lib/esm/domain/AlterHook.js.map +1 -0
  122. package/lib/esm/domain/Formio.js +2 -0
  123. package/lib/esm/domain/Formio.js.map +1 -0
  124. package/lib/esm/domain/FormioAction.js +2 -0
  125. package/lib/esm/domain/FormioAction.js.map +1 -0
  126. package/lib/esm/domain/FormioActionsIndex.js +2 -0
  127. package/lib/esm/domain/FormioActionsIndex.js.map +1 -0
  128. package/lib/esm/domain/FormioAuth.js +2 -0
  129. package/lib/esm/domain/FormioAuth.js.map +1 -0
  130. package/lib/esm/domain/FormioBaseModel.js +2 -0
  131. package/lib/esm/domain/FormioBaseModel.js.map +1 -0
  132. package/lib/esm/domain/FormioConfig.js +2 -0
  133. package/lib/esm/domain/FormioConfig.js.map +1 -0
  134. package/lib/esm/domain/FormioCtxMapper.js +2 -0
  135. package/lib/esm/domain/FormioCtxMapper.js.map +1 -0
  136. package/lib/esm/domain/FormioDecodedToken.js +2 -0
  137. package/lib/esm/domain/FormioDecodedToken.js.map +1 -0
  138. package/lib/esm/domain/FormioErrors.js +2 -0
  139. package/lib/esm/domain/FormioErrors.js.map +1 -0
  140. package/lib/esm/domain/FormioHooks.js +2 -0
  141. package/lib/esm/domain/FormioHooks.js.map +1 -0
  142. package/lib/esm/domain/FormioJs.js +2 -0
  143. package/lib/esm/domain/FormioJs.js.map +1 -0
  144. package/lib/esm/domain/FormioModels.js +2 -0
  145. package/lib/esm/domain/FormioModels.js.map +1 -0
  146. package/lib/esm/domain/FormioRouter.js +2 -0
  147. package/lib/esm/domain/FormioRouter.js.map +1 -0
  148. package/lib/esm/domain/FormioSettings.js +2 -0
  149. package/lib/esm/domain/FormioSettings.js.map +1 -0
  150. package/lib/esm/domain/FormioTemplate.js +2 -0
  151. package/lib/esm/domain/FormioTemplate.js.map +1 -0
  152. package/lib/esm/domain/FormioTemplateUtil.js +2 -0
  153. package/lib/esm/domain/FormioTemplateUtil.js.map +1 -0
  154. package/lib/esm/domain/FormioUpdate.js +2 -0
  155. package/lib/esm/domain/FormioUpdate.js.map +1 -0
  156. package/lib/esm/domain/FormioUtils.js +2 -0
  157. package/lib/esm/domain/FormioUtils.js.map +1 -0
  158. package/lib/esm/domain/OnHook.js +2 -0
  159. package/lib/esm/domain/OnHook.js.map +1 -0
  160. package/lib/esm/domain/Resource.js +2 -0
  161. package/lib/esm/domain/Resource.js.map +1 -0
  162. package/lib/esm/index.js +47 -0
  163. package/lib/esm/index.js.map +1 -0
  164. package/lib/esm/middlewares/FormioAuthMiddleware.js +38 -0
  165. package/lib/esm/middlewares/FormioAuthMiddleware.js.map +1 -0
  166. package/lib/esm/package.json +3 -0
  167. package/lib/esm/services/FormioAuthService.js +179 -0
  168. package/lib/esm/services/FormioAuthService.js.map +1 -0
  169. package/lib/esm/services/FormioDatabase.js +137 -0
  170. package/lib/esm/services/FormioDatabase.js.map +1 -0
  171. package/lib/esm/services/FormioHooksService.js +78 -0
  172. package/lib/esm/services/FormioHooksService.js.map +1 -0
  173. package/lib/esm/services/FormioInstaller.js +47 -0
  174. package/lib/esm/services/FormioInstaller.js.map +1 -0
  175. package/lib/esm/services/FormioRepository.js +38 -0
  176. package/lib/esm/services/FormioRepository.js.map +1 -0
  177. package/lib/{services → esm/services}/FormioService.js +18 -18
  178. package/lib/esm/services/FormioService.js.map +1 -0
  179. package/lib/esm/utils/isMongoId.js +4 -0
  180. package/lib/esm/utils/isMongoId.js.map +1 -0
  181. package/lib/{FormioModule.d.ts → types/FormioModule.d.ts} +0 -0
  182. package/lib/{builder → types/builder}/FormioMapper.d.ts +0 -0
  183. package/lib/{components → types/components}/AlterActions.d.ts +8 -3
  184. package/lib/types/components/AlterAudit.d.ts +5 -0
  185. package/lib/{components → types/components}/AlterHost.d.ts +0 -0
  186. package/lib/{components → types/components}/AlterLog.d.ts +0 -0
  187. package/lib/{components → types/components}/AlterSkip.d.ts +0 -0
  188. package/lib/{components → types/components}/AlterTemplateExportSteps.d.ts +0 -0
  189. package/lib/{components → types/components}/AlterTemplateImportSteps.d.ts +0 -0
  190. package/lib/{decorators → types/decorators}/action.d.ts +1 -1
  191. package/lib/{decorators → types/decorators}/actionCtx.d.ts +2 -1
  192. package/lib/{decorators → types/decorators}/alter.d.ts +0 -0
  193. package/lib/{decorators → types/decorators}/on.d.ts +0 -0
  194. package/lib/{decorators → types/decorators}/useFormioAuth.d.ts +0 -0
  195. package/lib/{domain → types/domain}/AlterHook.d.ts +0 -0
  196. package/lib/{domain → types/domain}/Formio.d.ts +0 -0
  197. package/lib/{domain → types/domain}/FormioAction.d.ts +1 -26
  198. package/lib/{domain → types/domain}/FormioActionsIndex.d.ts +0 -0
  199. package/lib/{domain → types/domain}/FormioAuth.d.ts +0 -0
  200. package/lib/{domain → types/domain}/FormioBaseModel.d.ts +0 -0
  201. package/lib/{domain → types/domain}/FormioConfig.d.ts +0 -0
  202. package/lib/{domain → types/domain}/FormioCtxMapper.d.ts +1 -2
  203. package/lib/{domain → types/domain}/FormioDecodedToken.d.ts +0 -0
  204. package/lib/{domain → types/domain}/FormioErrors.d.ts +0 -0
  205. package/lib/{domain → types/domain}/FormioHooks.d.ts +1 -1
  206. package/lib/{domain → types/domain}/FormioJs.d.ts +0 -0
  207. package/lib/types/domain/FormioModels.d.ts +42 -0
  208. package/lib/{domain → types/domain}/FormioRouter.d.ts +0 -0
  209. package/lib/{domain → types/domain}/FormioSettings.d.ts +0 -0
  210. package/lib/{domain → types/domain}/FormioTemplate.d.ts +0 -0
  211. package/lib/{domain → types/domain}/FormioTemplateUtil.d.ts +0 -0
  212. package/lib/{domain → types/domain}/FormioUpdate.d.ts +0 -0
  213. package/lib/{domain → types/domain}/FormioUtils.d.ts +0 -0
  214. package/lib/{domain → types/domain}/OnHook.d.ts +0 -0
  215. package/lib/{domain → types/domain}/Resource.d.ts +2 -2
  216. package/lib/{index.d.ts → types/index.d.ts} +22 -14
  217. package/lib/types/middlewares/FormioAuthMiddleware.d.ts +11 -0
  218. package/lib/{services → types/services}/FormioAuthService.d.ts +14 -3
  219. package/lib/types/services/FormioDatabase.d.ts +63 -0
  220. package/lib/{services → types/services}/FormioHooksService.d.ts +2 -3
  221. package/lib/{services → types/services}/FormioInstaller.d.ts +0 -0
  222. package/lib/types/services/FormioRepository.d.ts +24 -0
  223. package/lib/{services → types/services}/FormioService.d.ts +0 -0
  224. package/lib/{utils → types/utils}/isMongoId.d.ts +0 -0
  225. package/package.json +32 -17
  226. package/readme.md +5 -9
  227. package/tsconfig.compile.esm.json +12 -0
  228. package/lib/FormioModule.js.map +0 -1
  229. package/lib/builder/FormioMapper.js.map +0 -1
  230. package/lib/components/AlterActions.js +0 -66
  231. package/lib/components/AlterActions.js.map +0 -1
  232. package/lib/components/AlterAudit.d.ts +0 -5
  233. package/lib/components/AlterAudit.js.map +0 -1
  234. package/lib/components/AlterHost.js.map +0 -1
  235. package/lib/components/AlterLog.js.map +0 -1
  236. package/lib/components/AlterSkip.js.map +0 -1
  237. package/lib/components/AlterTemplateExportSteps.js.map +0 -1
  238. package/lib/components/AlterTemplateImportSteps.js.map +0 -1
  239. package/lib/decorators/action.js.map +0 -1
  240. package/lib/decorators/actionCtx.js.map +0 -1
  241. package/lib/decorators/alter.js.map +0 -1
  242. package/lib/decorators/on.js.map +0 -1
  243. package/lib/decorators/useFormioAuth.js.map +0 -1
  244. package/lib/domain/AlterHook.js.map +0 -1
  245. package/lib/domain/Formio.js.map +0 -1
  246. package/lib/domain/FormioAction.js.map +0 -1
  247. package/lib/domain/FormioActionsIndex.js.map +0 -1
  248. package/lib/domain/FormioAuth.js.map +0 -1
  249. package/lib/domain/FormioBaseModel.js.map +0 -1
  250. package/lib/domain/FormioConfig.js.map +0 -1
  251. package/lib/domain/FormioCtxMapper.js.map +0 -1
  252. package/lib/domain/FormioDecodedToken.js.map +0 -1
  253. package/lib/domain/FormioErrors.js.map +0 -1
  254. package/lib/domain/FormioHooks.js.map +0 -1
  255. package/lib/domain/FormioJs.js.map +0 -1
  256. package/lib/domain/FormioModels.d.ts +0 -183
  257. package/lib/domain/FormioModels.js +0 -3
  258. package/lib/domain/FormioModels.js.map +0 -1
  259. package/lib/domain/FormioRouter.js.map +0 -1
  260. package/lib/domain/FormioSettings.js.map +0 -1
  261. package/lib/domain/FormioTemplate.js.map +0 -1
  262. package/lib/domain/FormioTemplateUtil.js.map +0 -1
  263. package/lib/domain/FormioUpdate.js.map +0 -1
  264. package/lib/domain/FormioUtils.js.map +0 -1
  265. package/lib/domain/OnHook.js.map +0 -1
  266. package/lib/domain/Resource.js.map +0 -1
  267. package/lib/index.js.map +0 -1
  268. package/lib/middlewares/FormioAuthMiddleware.d.ts +0 -13
  269. package/lib/middlewares/FormioAuthMiddleware.js.map +0 -1
  270. package/lib/services/FormioAuthService.js.map +0 -1
  271. package/lib/services/FormioDatabase.d.ts +0 -25
  272. package/lib/services/FormioDatabase.js.map +0 -1
  273. package/lib/services/FormioHooksService.js.map +0 -1
  274. package/lib/services/FormioInstaller.js.map +0 -1
  275. package/lib/services/FormioService.js.map +0 -1
  276. package/lib/utils/isMongoId.js.map +0 -1
package/.mocharc.js CHANGED
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- ...require('@tsed/mocha-config')(),
2
+ ...require("@tsed/mocha-config")(),
3
3
  spec: ["{src,test}/**/*.spec.ts"],
4
- exclude: [],
4
+ exclude: []
5
5
  };
package/.nycrc CHANGED
@@ -6,7 +6,8 @@
6
6
  "**/*.d.ts",
7
7
  "node_modules",
8
8
  "**/interfaces/**",
9
- "**/index.ts"
9
+ "**/index.ts",
10
+ "**/*.spec.ts"
10
11
  ],
11
12
  "extension": [
12
13
  ".ts"
@@ -19,8 +20,8 @@
19
20
  "json"
20
21
  ],
21
22
  "check-coverage": true,
22
- "statements": 99.61,
23
- "branches": 81.2,
24
- "functions": 96.99,
25
- "lines": 99.59
23
+ "statements": 100,
24
+ "branches": 80.42,
25
+ "functions": 100,
26
+ "lines": 100
26
27
  }
@@ -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 { httpsPort, httpPort } = injector.settings;
71
- const displayLog = (host) => {
72
- const url = [`${host.protocol}://${host.address}`, typeof host.port === "number" && host.port].filter(Boolean).join(":");
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() {
@@ -91,47 +78,47 @@ let FormioModule = class FormioModule {
91
78
  }
92
79
  };
93
80
  tslib_1.__decorate([
94
- common_1.Inject(),
81
+ (0, common_1.Inject)(),
95
82
  tslib_1.__metadata("design:type", FormioService_1.FormioService)
96
83
  ], FormioModule.prototype, "formio", void 0);
97
84
  tslib_1.__decorate([
98
- common_1.Inject(),
85
+ (0, common_1.Inject)(),
99
86
  tslib_1.__metadata("design:type", FormioHooksService_1.FormioHooksService)
100
87
  ], FormioModule.prototype, "hooks", void 0);
101
88
  tslib_1.__decorate([
102
- common_1.Inject(),
89
+ (0, common_1.Inject)(),
103
90
  tslib_1.__metadata("design:type", FormioInstaller_1.FormioInstaller)
104
91
  ], FormioModule.prototype, "installer", void 0);
105
92
  tslib_1.__decorate([
106
- common_1.Inject(),
93
+ (0, common_1.Inject)(),
107
94
  tslib_1.__metadata("design:type", common_1.PlatformApplication)
108
95
  ], FormioModule.prototype, "app", void 0);
109
96
  tslib_1.__decorate([
110
- common_1.Inject(),
97
+ (0, common_1.Inject)(),
111
98
  tslib_1.__metadata("design:type", common_1.InjectorService)
112
99
  ], FormioModule.prototype, "injector", void 0);
113
100
  tslib_1.__decorate([
114
- common_1.Constant("formio", {}),
101
+ (0, common_1.Constant)("formio", {}),
115
102
  tslib_1.__metadata("design:type", Object)
116
103
  ], FormioModule.prototype, "settings", void 0);
117
104
  tslib_1.__decorate([
118
- common_1.Constant("formio.baseUrl", "/"),
105
+ (0, common_1.Constant)("formio.baseUrl", "/"),
119
106
  tslib_1.__metadata("design:type", String)
120
107
  ], FormioModule.prototype, "baseUrl", void 0);
121
108
  tslib_1.__decorate([
122
- common_1.Constant("formio.skipInstall", false),
109
+ (0, common_1.Constant)("formio.skipInstall", false),
123
110
  tslib_1.__metadata("design:type", Boolean)
124
111
  ], FormioModule.prototype, "skipInstall", void 0);
125
112
  tslib_1.__decorate([
126
- common_1.Constant("formio.template"),
113
+ (0, common_1.Constant)("formio.template"),
127
114
  tslib_1.__metadata("design:type", Object)
128
115
  ], FormioModule.prototype, "template", void 0);
129
116
  tslib_1.__decorate([
130
- common_1.Constant("formio.root"),
117
+ (0, common_1.Constant)("formio.root"),
131
118
  tslib_1.__metadata("design:type", Object)
132
119
  ], FormioModule.prototype, "root", void 0);
133
120
  FormioModule = tslib_1.__decorate([
134
- di_1.Module({
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;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C,QAAQ,IAAI,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1D,CAAC;CACF,CAAA;AAtGC;IADC,IAAA,eAAM,GAAE;sCACS,6BAAa;4CAAC;AAGhC;IADC,IAAA,eAAM,GAAE;sCACQ,uCAAkB;2CAAC;AAGpC;IADC,IAAA,eAAM,GAAE;sCACY,iCAAe;+CAAC;AAGrC;IADC,IAAA,eAAM,GAAE;sCACM,4BAAmB;yCAAC;AAGnC;IADC,IAAA,eAAM,GAAE;sCACW,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"]}
@@ -17,7 +17,7 @@ class FormioMapper {
17
17
  findMachineName(data) {
18
18
  const key = String(data);
19
19
  const item = this.find(key);
20
- return item ? `$machineName:${item.machineName}` : undefined;
20
+ return item ? `$machineName:${item.name || item.machineName}` : undefined;
21
21
  }
22
22
  mapToExport(data) {
23
23
  return this.mapData(data, this.findMachineName.bind(this));
@@ -38,13 +38,21 @@ class FormioMapper {
38
38
  if (key) {
39
39
  return key;
40
40
  }
41
- if (typeof data === "object" && !(data instanceof Date)) {
42
- return Object.entries(data).reduce((obj, [key, value]) => {
41
+ if (typeof data === "object" && !("_bsontype" in data) && !(data instanceof Date)) {
42
+ const isForm = data.path && data.type;
43
+ const mapped = Object.entries(data).reduce((obj, [key, value]) => {
43
44
  return {
44
45
  ...obj,
45
46
  [key]: this.mapData(value, resolver)
46
47
  };
47
48
  }, {});
49
+ return isForm
50
+ ? {
51
+ ...mapped,
52
+ name: data.name,
53
+ machineName: data.machineName || data.name
54
+ }
55
+ : mapped;
48
56
  }
49
57
  return data;
50
58
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormioMapper.js","sourceRoot":"","sources":["../../../src/builder/FormioMapper.ts"],"names":[],"mappings":";;;AAEA,MAAa,YAAY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oCAoEC","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.name || 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\" && !(\"_bsontype\" in data) && !(data instanceof Date)) {\n const isForm = data.path && data.type;\n const mapped = Object.entries(data).reduce((obj, [key, value]) => {\n return {\n ...obj,\n [key]: this.mapData(value, resolver)\n };\n }, {});\n\n return isForm\n ? {\n ...mapped,\n name: data.name,\n machineName: data.machineName || data.name\n }\n : mapped;\n }\n\n return data;\n }\n}\n"]}
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlterActions = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const di_1 = require("@tsed/di");
6
+ const schema_1 = require("@tsed/schema");
7
+ const platform_params_1 = require("@tsed/platform-params");
8
+ const platform_response_filter_1 = require("@tsed/platform-response-filter");
9
+ const core_1 = require("@tsed/core");
10
+ const common_1 = require("@tsed/common");
11
+ const alter_1 = require("../decorators/alter");
12
+ const FormioService_1 = require("../services/FormioService");
13
+ let AlterActions = class AlterActions {
14
+ transform(actions) {
15
+ const { Action } = this.formio;
16
+ return this.getActions().reduce((actions, provider) => {
17
+ var _a;
18
+ const instance = this.injector.invoke(provider.token);
19
+ const options = provider.store.get("formio:action");
20
+ const resolveHandler = this.createHandler(provider, "resolve");
21
+ return {
22
+ ...actions,
23
+ [options.name]: (_a = class extends Action {
24
+ static async info(req, res, next) {
25
+ let opts = { ...options };
26
+ if (instance.info) {
27
+ opts = await instance.info(opts, req, res);
28
+ }
29
+ next(null, opts);
30
+ }
31
+ static async settingsForm(req, res, next) {
32
+ next(null, await instance.settingsForm(req, res));
33
+ }
34
+ resolve(handler, method, req, res, next, setActionItemMessage) {
35
+ resolveHandler(this, handler, method, req, res, next, setActionItemMessage);
36
+ }
37
+ },
38
+ _a.access = options.access,
39
+ _a)
40
+ };
41
+ }, actions);
42
+ }
43
+ getActions() {
44
+ return this.injector.getProviders("formio:action");
45
+ }
46
+ createHandler(provider, propertyKey) {
47
+ const promisedHandler = this.params.compileHandler({
48
+ token: provider.token,
49
+ propertyKey
50
+ });
51
+ return async (action, handler, method, req, res, next, setActionItemMessage) => {
52
+ const $ctx = req.$ctx;
53
+ $ctx.set("ACTION_CTX", { handler, method, setActionItemMessage, action });
54
+ $ctx.endpoint = schema_1.EndpointMetadata.get(provider.useClass, "resolve");
55
+ await (0, di_1.runInContext)($ctx, async () => {
56
+ try {
57
+ const resolver = new core_1.AnyToPromise();
58
+ const handler = await promisedHandler;
59
+ const { state, data, status, headers } = await resolver.call(() => handler({ $ctx }));
60
+ if (state === core_1.AnyToPromiseStatus.RESOLVED) {
61
+ if (status) {
62
+ $ctx.response.status(status);
63
+ }
64
+ if (headers) {
65
+ $ctx.response.setHeaders(headers);
66
+ }
67
+ if (data !== undefined) {
68
+ $ctx.data = data;
69
+ return await this.flush($ctx.data, $ctx);
70
+ }
71
+ next();
72
+ }
73
+ }
74
+ catch (er) {
75
+ next(er);
76
+ }
77
+ });
78
+ };
79
+ }
80
+ async flush(data, $ctx) {
81
+ const { response } = $ctx;
82
+ if (!response.isDone()) {
83
+ (0, common_1.setResponseHeaders)($ctx);
84
+ data = await this.responseFilter.serialize(data, $ctx);
85
+ data = await this.responseFilter.transform(data, $ctx);
86
+ response.body(data);
87
+ }
88
+ return response;
89
+ }
90
+ };
91
+ tslib_1.__decorate([
92
+ (0, di_1.Inject)(),
93
+ tslib_1.__metadata("design:type", di_1.InjectorService)
94
+ ], AlterActions.prototype, "injector", void 0);
95
+ tslib_1.__decorate([
96
+ (0, di_1.Inject)(),
97
+ tslib_1.__metadata("design:type", FormioService_1.FormioService)
98
+ ], AlterActions.prototype, "formio", void 0);
99
+ tslib_1.__decorate([
100
+ (0, di_1.Inject)(),
101
+ tslib_1.__metadata("design:type", platform_params_1.PlatformParams)
102
+ ], AlterActions.prototype, "params", void 0);
103
+ tslib_1.__decorate([
104
+ (0, di_1.Inject)(),
105
+ tslib_1.__metadata("design:type", platform_response_filter_1.PlatformResponseFilter)
106
+ ], AlterActions.prototype, "responseFilter", void 0);
107
+ AlterActions = tslib_1.__decorate([
108
+ (0, alter_1.Alter)("actions")
109
+ ], AlterActions);
110
+ exports.AlterActions = AlterActions;
111
+ //# sourceMappingURL=AlterActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlterActions.js","sourceRoot":"","sources":["../../../src/components/AlterActions.ts"],"names":[],"mappings":";;;;AAAA,iCAAyE;AACzE,yCAA8C;AAE9C,2DAAqD;AACrD,6EAAsE;AACtE,qCAA4D;AAC5D,yCAAiE;AACjE,+CAA0C;AAI1C,6DAAwD;AAGxD,IAAa,YAAY,GAAzB,MAAa,YAAY;IAavB,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,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AE,IAAI,CAAC,CAAC;yBAC1C;wBAED,IAAI,EAAE,CAAC;qBACR;iBACF;gBAAC,OAAO,EAAE,EAAE;oBACX,IAAI,CAAC,EAAE,CAAC,CAAC;iBACV;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,KAAK,CAAC,IAAS,EAAE,IAAqB;QAClD,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;QAExB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE;YACtB,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC;YAEzB,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACvD,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEvD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACrB;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAA;AAhHC;IADC,IAAA,WAAM,GAAE;sCACW,oBAAe;8CAAC;AAGpC;IADC,IAAA,WAAM,GAAE;sCACS,6BAAa;4CAAC;AAGhC;IADC,IAAA,WAAM,GAAE;sCACS,gCAAc;4CAAC;AAGjC;IADC,IAAA,WAAM,GAAE;sCACiB,iDAAsB;oDAAC;AAXtC,YAAY;IADxB,IAAA,aAAK,EAAC,SAAS,CAAC;GACJ,YAAY,CAkHxB;AAlHY,oCAAY","sourcesContent":["import {Inject, InjectorService, Provider, runInContext} from \"@tsed/di\";\nimport {EndpointMetadata} from \"@tsed/schema\";\nimport {FormioActionInfo} from \"@tsed/formio-types\";\nimport {PlatformParams} from \"@tsed/platform-params\";\nimport {PlatformResponseFilter} from \"@tsed/platform-response-filter\";\nimport {AnyToPromise, AnyToPromiseStatus} from \"@tsed/core\";\nimport {PlatformContext, setResponseHeaders} from \"@tsed/common\";\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 @Inject()\n protected params: PlatformParams;\n\n @Inject()\n protected responseFilter: PlatformResponseFilter;\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.createHandler(provider, \"resolve\");\n\n return {\n ...actions,\n [options.name]: class extends Action {\n static access = options.access;\n\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 createHandler(provider: Provider, propertyKey: string | symbol) {\n const promisedHandler = this.params.compileHandler({\n token: provider.token,\n propertyKey\n });\n\n return async (\n action: any,\n handler: string,\n method: string,\n req: {$ctx: PlatformContext},\n res: any,\n next: any,\n setActionItemMessage: SetActionItemMessage\n ) => {\n const $ctx = req.$ctx;\n $ctx.set(\"ACTION_CTX\", {handler, method, setActionItemMessage, action});\n $ctx.endpoint = EndpointMetadata.get(provider.useClass, \"resolve\");\n\n await runInContext($ctx, async () => {\n try {\n const resolver = new AnyToPromise();\n const handler = await promisedHandler;\n const {state, data, status, headers} = await resolver.call(() => handler({$ctx}));\n if (state === AnyToPromiseStatus.RESOLVED) {\n if (status) {\n $ctx.response.status(status);\n }\n\n if (headers) {\n $ctx.response.setHeaders(headers);\n }\n\n if (data !== undefined) {\n $ctx.data = data;\n\n return await this.flush($ctx.data, $ctx);\n }\n\n next();\n }\n } catch (er) {\n next(er);\n }\n });\n };\n }\n\n private async flush(data: any, $ctx: PlatformContext) {\n const {response} = $ctx;\n\n if (!response.isDone()) {\n setResponseHeaders($ctx);\n\n data = await this.responseFilter.serialize(data, $ctx);\n data = await this.responseFilter.transform(data, $ctx);\n\n response.body(data);\n }\n\n return response;\n }\n}\n"]}
@@ -10,7 +10,7 @@ let AlterAudit = class AlterAudit {
10
10
  }
11
11
  };
12
12
  AlterAudit = tslib_1.__decorate([
13
- alter_1.Alter("audit")
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,GAAc;QAClD,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 {DIContext} from \"@tsed/di\";\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: DIContext): boolean {\n ctx.logger.info({event, info});\n return false;\n }\n}\n"]}
@@ -9,7 +9,7 @@ let AlterHost = class AlterHost {
9
9
  }
10
10
  };
11
11
  AlterHost = tslib_1.__decorate([
12
- alter_1.Alter("host")
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"]}
@@ -10,7 +10,7 @@ let AlterLog = class AlterLog {
10
10
  }
11
11
  };
12
12
  AlterLog = tslib_1.__decorate([
13
- alter_1.Alter("log")
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
20
  tslib_1.__decorate([
21
- common_1.Constant("formio.baseUrl", "/"),
21
+ (0, common_1.Constant)("formio.baseUrl", "/"),
22
22
  tslib_1.__metadata("design:type", String)
23
23
  ], AlterSkip.prototype, "baseUrl", void 0);
24
24
  tslib_1.__decorate([
25
- common_1.Constant("formio.whiteList", ["/spec.json"]),
25
+ (0, common_1.Constant)("formio.whiteList", ["/spec.json"]),
26
26
  tslib_1.__metadata("design:type", Array)
27
27
  ], AlterSkip.prototype, "whiteList", void 0);
28
28
  AlterSkip = tslib_1.__decorate([
29
- alter_1.Alter("skip")
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"]}
@@ -6,10 +6,10 @@ const core_1 = require("@tsed/core");
6
6
  const di_1 = require("@tsed/di");
7
7
  const alter_1 = require("../decorators/alter");
8
8
  const FormioDatabase_1 = require("../services/FormioDatabase");
9
- const async = require("async");
9
+ const async_1 = tslib_1.__importDefault(require("async"));
10
10
  let AlterTemplateExportSteps = class AlterTemplateExportSteps {
11
11
  transform(queue, template, map, options) {
12
- queue.push(async.apply(this.exportSubmissions.bind(this), template, map, options));
12
+ queue.push(async_1.default.apply(this.exportSubmissions.bind(this), template, map, options));
13
13
  return queue;
14
14
  }
15
15
  async exportSubmissions(template, map, options, next) {
@@ -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(),
@@ -42,11 +42,11 @@ let AlterTemplateExportSteps = class AlterTemplateExportSteps {
42
42
  }
43
43
  };
44
44
  tslib_1.__decorate([
45
- di_1.Inject(),
45
+ (0, di_1.Inject)(),
46
46
  tslib_1.__metadata("design:type", FormioDatabase_1.FormioDatabase)
47
47
  ], AlterTemplateExportSteps.prototype, "database", void 0);
48
48
  AlterTemplateExportSteps = tslib_1.__decorate([
49
- alter_1.Alter("templateExportSteps")
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;AAC1D,0DAA0B;AAG1B,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IAInC,SAAS,CAAC,KAAY,EAAE,QAAwB,EAAE,GAAQ,EAAE,OAAY;QACtE,KAAK,CAAC,IAAI,CAAC,eAAK,CAAC,KAA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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;sCACW,+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\";\nimport async from \"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"]}
@@ -5,10 +5,10 @@ const tslib_1 = require("tslib");
5
5
  const di_1 = require("@tsed/di");
6
6
  const alter_1 = require("../decorators/alter");
7
7
  const FormioDatabase_1 = require("../services/FormioDatabase");
8
- const async = require("async");
8
+ const async_1 = tslib_1.__importDefault(require("async"));
9
9
  let AlterTemplateImportSteps = class AlterTemplateImportSteps {
10
10
  transform(queue, install, template) {
11
- queue.push(async.apply(this.importSubmissions.bind(this), template));
11
+ queue.push(async_1.default.apply(this.importSubmissions.bind(this), template));
12
12
  return queue;
13
13
  }
14
14
  async importSubmissions(template, done) {
@@ -35,11 +35,11 @@ let AlterTemplateImportSteps = class AlterTemplateImportSteps {
35
35
  }
36
36
  };
37
37
  tslib_1.__decorate([
38
- di_1.Inject(),
38
+ (0, di_1.Inject)(),
39
39
  tslib_1.__metadata("design:type", FormioDatabase_1.FormioDatabase)
40
40
  ], AlterTemplateImportSteps.prototype, "database", void 0);
41
41
  AlterTemplateImportSteps = tslib_1.__decorate([
42
- alter_1.Alter("templateImportSteps")
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":"AlterTemplateImport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M,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;SAChF,CAAC;QAEF,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAElD,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AApCC;IADC,IAAA,WAAM,GAAE;sCACW,+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\";\nimport async from \"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