@tsed/formio 8.0.0-alpha.5 → 8.0.0-alpha.7

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 +25 -1
  29. package/lib/types/domain/FormioAction.d.ts +1 -1
  30. package/lib/types/domain/FormioBaseModel.d.ts +26 -1
  31. package/lib/types/domain/FormioCtxMapper.d.ts +1 -1
  32. package/lib/types/domain/FormioHooks.d.ts +25 -0
  33. package/lib/types/domain/FormioModels.d.ts +25 -1
  34. package/lib/types/domain/Resource.d.ts +1 -1
  35. package/lib/types/services/FormioAuthService.d.ts +2 -0
  36. package/lib/types/services/FormioDatabase.d.ts +4 -1
  37. package/lib/types/services/FormioHooksService.d.ts +1 -1
  38. package/lib/types/services/FormioRepository.d.ts +4 -1
  39. package/lib/types/services/FormioService.d.ts +24 -0
  40. package/package.json +15 -16
  41. package/vitest.config.mts +3 -3
  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,8 +0,0 @@
1
- import { FormioActionItem, FormioForm, FormioRole, FormioSubmission } from "./FormioModels.js";
2
- export interface FormioTemplate {
3
- roles?: Record<string, FormioRole>;
4
- forms: Record<string, FormioForm>;
5
- resources: Record<string, FormioForm>;
6
- actions: Record<string, FormioActionItem>;
7
- submissions?: Record<string, FormioSubmission[]>;
8
- }
@@ -1,13 +0,0 @@
1
- import { FormioTemplate } from "./FormioTemplate.js";
2
- export interface FormioExportOptions {
3
- title: string;
4
- version: string;
5
- description: string;
6
- name: string;
7
- }
8
- export interface FormioTemplateUtil {
9
- import: {
10
- template(template: FormioTemplate, cb: (er: unknown, data: FormioTemplate) => void): void;
11
- };
12
- export(options: Partial<FormioExportOptions>, cb: (er: unknown, data: FormioTemplate) => void): void;
13
- }
@@ -1,19 +0,0 @@
1
- import { NextFunction, Request, Response } from "express";
2
- import { Db } from "mongodb";
3
- import { Formio } from "./Formio.js";
4
- export interface FormioUpdate {
5
- db: Db;
6
- version: string;
7
- /**
8
- *
9
- * @param cb
10
- */
11
- initialize(cb: (err: unknown, db: any) => void): Promise<Formio>;
12
- /**
13
- *
14
- * @param req
15
- * @param res
16
- * @param next
17
- */
18
- sanityCheck(req: Request, res: Response, next: NextFunction): void;
19
- }
@@ -1,307 +0,0 @@
1
- import { Request, Response } from "express";
2
- import { FormioErrors } from "./FormioErrors.js";
3
- import { FormioJs } from "./FormioJs.js";
4
- export interface FormioUtil {
5
- Formio: FormioJs;
6
- /**
7
- * Iterate through each component within a form.
8
- *
9
- * @param {Object} components
10
- * The components to iterate.
11
- * @param {Function} fn
12
- * The iteration function to invoke for each component.
13
- * @param {Boolean} includeAll
14
- * Whether or not to include layout components.
15
- * @param {String} path
16
- */
17
- eachComponent: Function;
18
- /**
19
- * Get a component by its key
20
- *
21
- * @param {Object} components
22
- * The components to iterate.
23
- * @param {String} key
24
- * The key of the component to get.
25
- *
26
- * @returns {Object}
27
- * The component that matches the given key, or undefined if not found.
28
- */
29
- getComponent: Function;
30
- /**
31
- * Define if component should be considered input component
32
- *
33
- * @param {Object} componentJson
34
- * JSON of component to check
35
- *
36
- * @returns {Boolean}
37
- * If component is input or not
38
- */
39
- isInputComponent: Function;
40
- /**
41
- * Flatten the form components for data manipulation.
42
- *
43
- * @param {Object} components
44
- * The components to iterate.
45
- * @param {Boolean} includeAll
46
- * Whether or not to include layout components.
47
- *
48
- * @returns {Object}
49
- * The flattened components map.
50
- */
51
- flattenComponents: Function;
52
- /**
53
- * Get the value for a component key, in the given submission.
54
- *
55
- * @param {Object} submission
56
- * A submission object to search.
57
- * @param {String} key
58
- * A for components API key to search for.
59
- */
60
- getValue: Function;
61
- /**
62
- * Determine if a component is a layout component or not.
63
- *
64
- * @param {Object} component
65
- * The component to check.
66
- *
67
- * @returns {Boolean}
68
- * Whether or not the component is a layout component.
69
- */
70
- isLayoutComponent: Function;
71
- /**
72
- * Apply JSON logic functionality.
73
- *
74
- * @param component
75
- * @param row
76
- * @param data
77
- */
78
- jsonLogic: Function;
79
- /**
80
- * Check if the condition for a component is true or not.
81
- *
82
- * @param component
83
- * @param row
84
- * @param data
85
- */
86
- checkCondition: Function;
87
- flattenComponentsForRender: Function;
88
- renderFormSubmission: Function;
89
- renderComponentValue: Function;
90
- /**
91
- * A node-fetch shim adding support for http(s) proxy and allowing
92
- * invalid tls certificates (to be used with self signed certificates).
93
- *
94
- * @param {any} url The request url string or url like object.
95
- * @param {any} options The request options object.
96
- * @returns {Promise<Response>} The promise with the node-fetch response object.
97
- */
98
- fetch: any;
99
- base64: {
100
- /**
101
- * Base64 encode the given data.
102
- *
103
- * @param {String} decoded
104
- * The decoded data to encode.
105
- *
106
- * @return {String}
107
- * The base64 representation of the given data.
108
- */
109
- encode(decoded: string): string;
110
- /**
111
- * Base64 decode the given data.
112
- *
113
- * @param {String} encoded
114
- * The encoded data to decode.
115
- *
116
- * @return {String}
117
- * The ascii representation of the given encoded data.
118
- */
119
- decode(encoded: string): string;
120
- };
121
- /**
122
- * Application error codes.
123
- */
124
- errorCodes: FormioErrors;
125
- layoutComponents: ("panel" | "table" | "well" | "columns" | "fieldset" | "tabs" | string)[];
126
- deleteProp(target: any, propertyKey: any): any;
127
- /**
128
- * A wrapper around console.log that gets ignored by eslint.
129
- *
130
- * @param {*} content
131
- * The content to pass to console.log.
132
- */
133
- log(content: string): void;
134
- /**
135
- * Determine if a value is a boolean representation.
136
- * @param value
137
- * @return {boolean}
138
- */
139
- isBoolean(value: any): boolean;
140
- /**
141
- * Quick boolean coercer.
142
- * @param value
143
- * @return {boolean}
144
- */
145
- boolean(value: any): boolean;
146
- /**
147
- * A wrapper around console.error that gets ignored by eslint.
148
- *
149
- * @param {*} content
150
- * The content to pass to console.error.
151
- */
152
- error(content: any): void;
153
- /**
154
- * Returns the URL alias for a form provided the url.
155
- */
156
- getAlias(req: Request, reservedForms: string[]): {
157
- alias: string;
158
- additional: string;
159
- };
160
- /**
161
- * Escape a string for use in regex.
162
- *
163
- * @param str
164
- * @returns {*}
165
- */
166
- escapeRegExp(str: string): string;
167
- /**
168
- * Create a sub response object that only handles errors.
169
- *
170
- * @param res
171
- * @return {{send: function(), sendStatus: function(*=), status: function(*=)}}
172
- */
173
- createSubResponse(res: Response): Response;
174
- /**
175
- * Create a sub-request object from the original request.
176
- *
177
- * @param req
178
- */
179
- createSubRequest(req: Request): Request;
180
- /**
181
- * Return the objectId.
182
- *
183
- * @param id
184
- * @returns {*}
185
- * @constructor
186
- */
187
- ObjectId(id: string): any;
188
- /**
189
- * Search the request headers for the given key.
190
- *
191
- * @param req
192
- * The Express request object.
193
- * @param key
194
- * The key to search for in the headers.
195
- *
196
- * @return
197
- * The header value if found or false.
198
- */
199
- getHeader(req: Request, key: string): string | false;
200
- /**
201
- * Search the request query for the given key.
202
- *
203
- * @param req
204
- * The Express request object.
205
- * @param key
206
- * The key to search for in the query.
207
- *
208
- * @return
209
- * The query value if found or false.
210
- */
211
- getQuery(req: Request, key: string): any | false;
212
- /**
213
- * Search the request parameters for the given key.
214
- *
215
- * @param req
216
- * The Express request object.
217
- * @param key
218
- * The key to search for in the parameters.
219
- *
220
- * @return
221
- * The parameter value if found or false.
222
- */
223
- getParameter(req: Request, key: string): any | false;
224
- /**
225
- * Determine if the request has the given key set as a header or url parameter.
226
- *
227
- * @param req
228
- * The Express request object.
229
- * @param key
230
- * The key to search for.
231
- *
232
- * @return
233
- * Return the value of the key or false if not found.
234
- */
235
- getRequestValue(req: Request, key: string): any | false;
236
- /**
237
- * Split the given URL into its key/value pairs.
238
- *
239
- * @param url
240
- * The request url to split, typically req.url.
241
- *
242
- * @returns {{}}
243
- * The key/value pairs of the request url.
244
- */
245
- getUrlParams(url: string): Record<string, any>;
246
- /**
247
- * Converts a form component key into a submission key
248
- * by putting .data. between each nested component
249
- * (ex: `user.name` becomes `user.data.name` in a submission)
250
- * @param key
251
- * The key to convert
252
- * @return
253
- * The submission key
254
- */
255
- getSubmissionKey(key: string): string;
256
- /**
257
- * Converts a submission key into a form component key
258
- * by replacing .data. with .
259
- * (ex: `user.data.name` becomes `user.name` in a submission)
260
- * @param key
261
- * The key to convert
262
- * @return
263
- * The form component key
264
- */
265
- getFormComponentKey(key: string): string;
266
- /**
267
- * Utility function to ensure the given id is always a BSON object.
268
- *
269
- * @param _id {String|Object}
270
- * A mongo id as a string or object.
271
- *
272
- * @returns {Object}
273
- * The mongo BSON id.
274
- */
275
- idToBson(_id: string | any): any;
276
- /**
277
- * Utility function to ensure the given id is always a string object.
278
- *
279
- * @param _id {String|Object}
280
- * A mongo id as a string or object.
281
- *
282
- * @returns {String}
283
- * The mongo string id.
284
- */
285
- idToString(_id: string | any): string;
286
- /**
287
- * Ensures that a submission data has MongoDB ObjectID's for all "id" fields.
288
- * @param data
289
- * @return {boolean}
290
- */
291
- ensureIds(data: any[]): any;
292
- removeProtectedFields(form: string, action: string, submissions: any): void;
293
- /**
294
- * Retrieve a unique machine name
295
- *
296
- * @param document
297
- * @param model
298
- * @param next
299
- * @return {*}
300
- */
301
- uniqueMachineName(document: {
302
- machineName: string;
303
- }, model: any, next: (err?: Error) => void): void;
304
- castValue<T = any>(valueType: "string" | "number" | "boolean" | "[number]" | "[string]", value: any): T;
305
- valuePath(prefix: string, key: string): string;
306
- eachValue(components: any, data: any, fn: Function, context: any, path?: string): void;
307
- }
@@ -1,3 +0,0 @@
1
- export interface OnHook<T = any> {
2
- on(...args: any[]): boolean | void;
3
- }
@@ -1,18 +0,0 @@
1
- import { Request, Response, NextFunction } from "express";
2
- export type ResourceHttpHandler = (req: Request, res: Response, next: NextFunction) => void;
3
- export interface ResourceHttpMethodOptions {
4
- before?: ResourceHttpHandler;
5
- after?: ResourceHttpHandler;
6
- }
7
- export interface ResourceRestOptions extends ResourceHttpMethodOptions {
8
- beforePut?: ResourceHttpHandler;
9
- beforePatch?: ResourceHttpHandler;
10
- beforePost?: ResourceHttpHandler;
11
- beforeIndex?: ResourceHttpHandler;
12
- beforeGet?: ResourceHttpHandler;
13
- afterPut?: ResourceHttpHandler;
14
- afterPatch?: ResourceHttpHandler;
15
- afterPost?: ResourceHttpHandler;
16
- afterIndex?: ResourceHttpHandler;
17
- afterGet?: ResourceHttpHandler;
18
- }
@@ -1,46 +0,0 @@
1
- /**
2
- * @file Automatically generated by @tsed/barrels.
3
- */
4
- export * from "./builder/FormioMapper.js";
5
- export * from "./components/AlterActions.js";
6
- export * from "./components/AlterAudit.js";
7
- export * from "./components/AlterHost.js";
8
- export * from "./components/AlterLog.js";
9
- export * from "./components/AlterSkip.js";
10
- export * from "./components/AlterTemplateExportSteps.js";
11
- export * from "./components/AlterTemplateImportSteps.js";
12
- export * from "./decorators/action.js";
13
- export * from "./decorators/actionCtx.js";
14
- export * from "./decorators/alter.js";
15
- export * from "./decorators/on.js";
16
- export * from "./decorators/useFormioAuth.js";
17
- export * from "./domain/AlterHook.js";
18
- export * from "./domain/Formio.js";
19
- export * from "./domain/FormioAction.js";
20
- export * from "./domain/FormioActionsIndex.js";
21
- export * from "./domain/FormioAuth.js";
22
- export * from "./domain/FormioBaseModel.js";
23
- export * from "./domain/FormioConfig.js";
24
- export * from "./domain/FormioCtxMapper.js";
25
- export * from "./domain/FormioDecodedToken.js";
26
- export * from "./domain/FormioErrors.js";
27
- export * from "./domain/FormioHooks.js";
28
- export * from "./domain/FormioJs.js";
29
- export * from "./domain/FormioModels.js";
30
- export * from "./domain/FormioRouter.js";
31
- export * from "./domain/FormioSettings.js";
32
- export * from "./domain/FormioTemplate.js";
33
- export * from "./domain/FormioTemplateUtil.js";
34
- export * from "./domain/FormioUpdate.js";
35
- export * from "./domain/FormioUtils.js";
36
- export * from "./domain/OnHook.js";
37
- export * from "./domain/Resource.js";
38
- export * from "./FormioModule.js";
39
- export * from "./middlewares/FormioAuthMiddleware.js";
40
- export * from "./services/FormioAuthService.js";
41
- export * from "./services/FormioDatabase.js";
42
- export * from "./services/FormioHooksService.js";
43
- export * from "./services/FormioInstaller.js";
44
- export * from "./services/FormioRepository.js";
45
- export * from "./services/FormioService.js";
46
- export * from "./utils/isMongoId.js";
@@ -1,11 +0,0 @@
1
- import { Context } from "@tsed/common";
2
- import { FormioService } from "../services/FormioService.js";
3
- /**
4
- * @middleware
5
- * @formio
6
- */
7
- export declare class FormioAuthMiddleware {
8
- protected formio: FormioService;
9
- get tokenHandler(): any;
10
- use(ctx: Context): Promise<void>;
11
- }
@@ -1,84 +0,0 @@
1
- /// <reference types="mongoose/types/aggregate.js" />
2
- /// <reference types="mongoose/types/callback.js" />
3
- /// <reference types="mongoose/types/collection.js" />
4
- /// <reference types="mongoose/types/connection.js" />
5
- /// <reference types="mongoose/types/cursor.js" />
6
- /// <reference types="mongoose/types/document.js" />
7
- /// <reference types="mongoose/types/error.js" />
8
- /// <reference types="mongoose/types/expressions.js" />
9
- /// <reference types="mongoose/types/helpers.js" />
10
- /// <reference types="mongoose/types/middlewares.js" />
11
- /// <reference types="mongoose/types/indexes.js" />
12
- /// <reference types="mongoose/types/models.js" />
13
- /// <reference types="mongoose/types/mongooseoptions.js" />
14
- /// <reference types="mongoose/types/pipelinestage.js" />
15
- /// <reference types="mongoose/types/populate.js" />
16
- /// <reference types="mongoose/types/query.js" />
17
- /// <reference types="mongoose/types/schemaoptions.js" />
18
- /// <reference types="mongoose/types/schematypes.js" />
19
- /// <reference types="mongoose/types/session.js" />
20
- /// <reference types="mongoose/types/types.js" />
21
- /// <reference types="mongoose/types/utility.js" />
22
- /// <reference types="mongoose/types/validation.js" />
23
- /// <reference types="mongoose/types/virtuals.js" />
24
- /// <reference types="mongoose" />
25
- /// <reference types="mongoose/types/inferschematype.js" />
26
- import { PlatformContext, Req } from "@tsed/common";
27
- import { FormioPayloadToken } from "../domain/FormioDecodedToken.js";
28
- import { FormioSubmission, WithID } from "../domain/FormioModels.js";
29
- import { FormioDatabase } from "./FormioDatabase.js";
30
- import { FormioHooksService } from "./FormioHooksService.js";
31
- import { FormioService } from "./FormioService.js";
32
- export declare class FormioAuthService {
33
- formio: FormioService;
34
- hooks: FormioHooksService;
35
- db: FormioDatabase;
36
- get currentUser(): (arg1: Req, arg2: import("@tsed/common").Res) => Promise<unknown>;
37
- get getToken(): (payload: FormioPayloadToken) => string | boolean;
38
- get tempToken(): (req: Req, res: import("@tsed/common").Res) => void;
39
- get logout(): (req: Req, res: import("@tsed/common").Res, next: TsED.NextFunction) => void;
40
- setCurrentUser<User = any>(user: WithID<FormioSubmission<User>>, token: FormioPayloadToken, ctx: PlatformContext): this;
41
- /**
42
- * Generate the payload token for the session
43
- * @param user
44
- * @param ctx
45
- */
46
- generatePayloadToken<User = any>(user: WithID<FormioSubmission<User>>, ctx: PlatformContext): Promise<{
47
- user: WithID<FormioSubmission<User>>;
48
- token: FormioPayloadToken;
49
- }>;
50
- /**
51
- * Generate session from the given authenticated user.
52
- * @param user
53
- * @param ctx
54
- */
55
- generateSession<User = any>(user: WithID<FormioSubmission<User>>, ctx: PlatformContext): Promise<void>;
56
- /**
57
- * Retrieve roles
58
- * @param req
59
- */
60
- getRoles(req?: Req): Promise<import("mongoose").LeanDocument<import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & import("../domain/FormioModels.js").FormioRole & import("@tsed/mongoose").MongooseDocumentMethods<import("../domain/FormioModels.js").FormioRole>> & {
61
- _id: import("mongoose").Types.ObjectId;
62
- }>[]>;
63
- /**
64
- * Update the role of the current user submission
65
- * @param _id
66
- * @param role
67
- * @param req
68
- */
69
- updateUserRole(_id: string | any, role: string, req?: Req): Promise<import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioSubmission<any> & import("@tsed/mongoose").MongooseDocumentMethods<FormioSubmission<any>>> & {
70
- _id: import("mongoose").Types.ObjectId;
71
- }>;
72
- /**
73
- * Create a user submission in formio
74
- * @param user
75
- */
76
- createUser<User = any>(user: Partial<FormioSubmission<User>>): Promise<import("mongoose").LeanDocument<any> & Required<{
77
- _id: unknown;
78
- }>>;
79
- /**
80
- * Update user submission in formio
81
- * @param user
82
- */
83
- updateUser<User = any>(user: WithID<FormioSubmission<User>>): Promise<WithID<FormioSubmission<User>>>;
84
- }
@@ -1,84 +0,0 @@
1
- /// <reference types="mongoose/types/aggregate.js" />
2
- /// <reference types="mongoose/types/callback.js" />
3
- /// <reference types="mongoose/types/collection.js" />
4
- /// <reference types="mongoose/types/connection.js" />
5
- /// <reference types="mongoose/types/cursor.js" />
6
- /// <reference types="mongoose/types/document.js" />
7
- /// <reference types="mongoose/types/error.js" />
8
- /// <reference types="mongoose/types/expressions.js" />
9
- /// <reference types="mongoose/types/helpers.js" />
10
- /// <reference types="mongoose/types/middlewares.js" />
11
- /// <reference types="mongoose/types/indexes.js" />
12
- /// <reference types="mongoose/types/models.js" />
13
- /// <reference types="mongoose/types/mongooseoptions.js" />
14
- /// <reference types="mongoose/types/pipelinestage.js" />
15
- /// <reference types="mongoose/types/populate.js" />
16
- /// <reference types="mongoose/types/query.js" />
17
- /// <reference types="mongoose/types/schemaoptions.js" />
18
- /// <reference types="mongoose/types/schematypes.js" />
19
- /// <reference types="mongoose/types/session.js" />
20
- /// <reference types="mongoose/types/types.js" />
21
- /// <reference types="mongoose/types/utility.js" />
22
- /// <reference types="mongoose/types/validation.js" />
23
- /// <reference types="mongoose/types/virtuals.js" />
24
- /// <reference types="mongoose/types/inferschematype.js" />
25
- import { MongooseDocument, MongooseModel } from "@tsed/mongoose";
26
- import type { FilterQuery } from "mongoose";
27
- import { FormioAction, FormioActionItem, FormioForm, FormioRole, FormioSubmission, FormioToken } from "@tsed/formio-types";
28
- import { FormioMapper } from "../builder/FormioMapper.js";
29
- import { FormioService } from "./FormioService.js";
30
- export declare class FormioDatabase {
31
- protected formio: FormioService;
32
- get models(): import("mongoose").Models;
33
- get roleModel(): MongooseModel<FormioRole>;
34
- get formModel(): MongooseModel<FormioForm>;
35
- get actionModel(): MongooseModel<FormioAction>;
36
- get submissionModel(): MongooseModel<FormioSubmission>;
37
- get tokenModel(): MongooseModel<FormioToken>;
38
- get actionItemModel(): MongooseModel<FormioActionItem>;
39
- getFormioMapper(): Promise<FormioMapper>;
40
- hasForms(): Promise<boolean>;
41
- hasForm(name: string): Promise<boolean>;
42
- getForm(nameOrId: string): Promise<import("mongoose").LeanDocument<import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioForm & import("@tsed/mongoose").MongooseDocumentMethods<FormioForm>> & {
43
- _id: import("mongoose").Types.ObjectId;
44
- }> | null>;
45
- /**
46
- * Import form previously exported by export tool.
47
- * This method transform alias to a real mongoose _id
48
- * @param form
49
- * @param onCreate
50
- */
51
- importFormIfNotExists(form: FormioForm, onCreate?: (form: FormioForm) => any): Promise<import("mongoose").LeanDocument<import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioForm & import("@tsed/mongoose").MongooseDocumentMethods<FormioForm>> & {
52
- _id: import("mongoose").Types.ObjectId;
53
- }> | null>;
54
- /**
55
- * Import form previously exported by export tool.
56
- * This method transform alias to a real mongoose _id
57
- * @param form
58
- */
59
- importForm(form: FormioForm): Promise<import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioForm & import("@tsed/mongoose").MongooseDocumentMethods<FormioForm>> & {
60
- _id: import("mongoose").Types.ObjectId;
61
- }>;
62
- saveForm(form: FormioForm): import("mongoose").Query<import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioForm & import("@tsed/mongoose").MongooseDocumentMethods<FormioForm>> & {
63
- _id: import("mongoose").Types.ObjectId;
64
- }, import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioForm & import("@tsed/mongoose").MongooseDocumentMethods<FormioForm>> & {
65
- _id: import("mongoose").Types.ObjectId;
66
- }, {}, import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioForm & import("@tsed/mongoose").MongooseDocumentMethods<FormioForm>>>;
67
- getSubmissions<Data>(query?: FilterQuery<MongooseModel<FormioSubmission<Data>>>): Promise<MongooseDocument<FormioSubmission<Data>>[]>;
68
- /**
69
- * Import submission previously exported by export tool.
70
- * This method transform alias to a real mongoose _id
71
- * @param submission
72
- */
73
- importSubmission<Data = any>(submission: Omit<Partial<FormioSubmission<Data>>, "form"> & {
74
- form?: any;
75
- }): Promise<import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioSubmission<any> & import("@tsed/mongoose").MongooseDocumentMethods<FormioSubmission<any>>> & {
76
- _id: import("mongoose").Types.ObjectId;
77
- }>;
78
- saveSubmission<Data = any>(submission: Partial<FormioSubmission<Data>>): import("mongoose").Query<import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioSubmission<any> & import("@tsed/mongoose").MongooseDocumentMethods<FormioSubmission<any>>> & {
79
- _id: import("mongoose").Types.ObjectId;
80
- }, import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioSubmission<any> & import("@tsed/mongoose").MongooseDocumentMethods<FormioSubmission<any>>> & {
81
- _id: import("mongoose").Types.ObjectId;
82
- }, {}, import("@tsed/mongoose").MongooseMergedDocument<import("mongoose").Document<any, any, any> & FormioSubmission<any> & import("@tsed/mongoose").MongooseDocumentMethods<FormioSubmission<any>>>>;
83
- idToBson(form?: any): any;
84
- }
@@ -1,17 +0,0 @@
1
- import { InjectorService } from "@tsed/common";
2
- import { FormioHooks } from "../domain/FormioHooks.js";
3
- import { FormioService } from "./FormioService.js";
4
- import { Request } from "express";
5
- export declare class FormioHooksService {
6
- protected injector: InjectorService;
7
- protected formio: FormioService;
8
- get settings(): (req: Request, cb: Function) => void;
9
- get invoke(): <T = any>(...args: any[]) => boolean | T;
10
- get alter(): (event: string, ...args: any[]) => any;
11
- get alterAsync(): (event: string, ...args: any[]) => Promise<any>;
12
- getHooks(): FormioHooks;
13
- protected getProviders(type: "alter" | "on"): import("@tsed/common").Provider<any>[];
14
- protected getHooksProvider(type: "alter" | "on"): {};
15
- protected bindHooks(type: "alter" | "on", hooks: Record<string, Function[]>): {};
16
- private createHooks;
17
- }
@@ -1,12 +0,0 @@
1
- import { Logger } from "@tsed/logger";
2
- import { FormioSubmission } from "../domain/FormioModels.js";
3
- import { FormioTemplate } from "../domain/FormioTemplate.js";
4
- import { FormioDatabase } from "./FormioDatabase.js";
5
- export declare class FormioInstaller extends FormioDatabase {
6
- protected logger: Logger;
7
- install(template: FormioTemplate, root: any): Promise<void>;
8
- createRootUser<User = unknown>(user: {
9
- email: string;
10
- password: string;
11
- }, template: FormioTemplate): Promise<FormioSubmission<User>>;
12
- }