@formio/appserver 2.0.0-rc.1 → 2.0.0-rc.31

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 (44) hide show
  1. package/README.md +12 -6
  2. package/lib/actions/index.d.ts +3 -156
  3. package/lib/actions/login/LoginAction.d.ts +2 -108
  4. package/lib/actions/login/LoginAction.js +124 -213
  5. package/lib/actions/role/RoleAction.d.ts +2 -61
  6. package/lib/actions/role/RoleAction.js +13 -20
  7. package/lib/actions/save/SaveAction.d.ts +2 -28
  8. package/lib/actions/save/SaveAction.js +27 -45
  9. package/lib/modules/index.d.ts +1 -3
  10. package/lib/modules/index.js +3 -5
  11. package/lib/modules/mongodb/db.d.ts +127 -0
  12. package/lib/modules/mongodb/db.js +832 -0
  13. package/lib/server.d.ts +5 -174
  14. package/lib/server.js +61 -58
  15. package/package.json +25 -25
  16. package/lib/modules/auth/auth.d.ts +0 -5
  17. package/lib/modules/auth/auth.js +0 -70
  18. package/lib/prepare/access.d.ts +0 -3
  19. package/lib/prepare/access.js +0 -62
  20. package/lib/prepare/bcrypt.d.ts +0 -3
  21. package/lib/prepare/bcrypt.js +0 -25
  22. package/lib/prepare/index.d.ts +0 -11
  23. package/lib/prepare/index.js +0 -60
  24. package/lib/prepare/password.d.ts +0 -3
  25. package/lib/prepare/password.js +0 -27
  26. package/lib/prepare/persist.d.ts +0 -3
  27. package/lib/prepare/persist.js +0 -24
  28. package/lib/prepare/protect.d.ts +0 -3
  29. package/lib/prepare/protect.js +0 -28
  30. package/lib/prepare/reference.d.ts +0 -3
  31. package/lib/prepare/reference.js +0 -71
  32. package/lib/types/action.d.ts +0 -7
  33. package/lib/types/action.js +0 -2
  34. package/lib/types/form.d.ts +0 -4
  35. package/lib/types/form.js +0 -2
  36. package/lib/types/index.d.ts +0 -5
  37. package/lib/types/index.js +0 -21
  38. package/lib/types/project.d.ts +0 -4
  39. package/lib/types/project.js +0 -2
  40. package/lib/types/server.d.ts +0 -102
  41. package/lib/types/server.js +0 -2
  42. package/lib/types/submission.d.ts +0 -47
  43. package/lib/types/submission.js +0 -2
  44. package/server.js +0 -1
package/README.md CHANGED
@@ -170,12 +170,18 @@ const { CustomAction } = require('./actions/custom');
170
170
  *
171
171
  * The "scope" argument is a ProcessScope type. See https://github.com/formio/appserver/blob/main/src/types/submission.ts
172
172
  */
173
- processors: Processor.processors.concat([
174
- async (scope) => {
175
- console.log('Custom Processor');
176
- return [];
177
- },
178
- ])
173
+ processors: {
174
+ submission: [
175
+ (scope) => {},
176
+ (scope) => {}
177
+ ],
178
+ evaluator: [
179
+ (scope) => {}
180
+ ],
181
+ prepare: [
182
+ (scope) => {}
183
+ ]
184
+ }
179
185
  });
180
186
 
181
187
  // Initialize the server.
@@ -1,159 +1,6 @@
1
1
  declare const _default: {
2
- save: {
3
- readonly info: {
4
- name: string;
5
- title: string;
6
- description: string;
7
- priority: number;
8
- defaults: {
9
- handler: string[];
10
- method: string[];
11
- };
12
- access: {
13
- handler: boolean;
14
- method: boolean;
15
- };
16
- };
17
- mappingComponents(scope: import("src/types/lib").ActionScope): Promise<any>;
18
- settingsForm(scope: import("src/types/lib").ActionScope): Promise<any>;
19
- saveToForm(scope: import("src/types/lib").ActionScope, resource: string): undefined;
20
- childSubmission(scope: import("src/types/lib").ActionScope, req: import("src/types/lib").SubmissionRequest, res: import("src/types/lib").SubmissionResponse, submission: any): any;
21
- childResponse(scope: import("src/types/lib").ActionScope, req: import("src/types/lib").SubmissionRequest, res: import("src/types/lib").SubmissionResponse): void;
22
- executor(scope: import("src/types/lib").ActionScope): Promise<(req: import("src/types/lib").SubmissionRequest, res: import("src/types/lib").SubmissionResponse, next: import("express").NextFunction) => Promise<void>>;
23
- };
24
- login: {
25
- readonly info: {
26
- name: string;
27
- title: string;
28
- description: string;
29
- priority: number;
30
- defaults: {
31
- handler: string[];
32
- method: string[];
33
- };
34
- access: {
35
- handler: boolean;
36
- method: boolean;
37
- };
38
- };
39
- settingsForm(scope: import("src/types/lib").ActionScope): Promise<({
40
- type: string;
41
- label: string;
42
- key: string;
43
- placeholder: string;
44
- dataSrc: string;
45
- valueProperty: string;
46
- data: {
47
- json: any;
48
- };
49
- multiple: boolean;
50
- validate: {
51
- required: boolean;
52
- };
53
- input?: undefined;
54
- description?: undefined;
55
- defaultValue?: undefined;
56
- suffix?: undefined;
57
- } | {
58
- type: string;
59
- input: boolean;
60
- label: string;
61
- key: string;
62
- placeholder: string;
63
- dataSrc: string;
64
- valueProperty: string;
65
- data: {
66
- json: any;
67
- };
68
- multiple: boolean;
69
- validate: {
70
- required: boolean;
71
- };
72
- description?: undefined;
73
- defaultValue?: undefined;
74
- suffix?: undefined;
75
- } | {
76
- type: string;
77
- key: string;
78
- input: boolean;
79
- label: string;
80
- description: string;
81
- defaultValue: string;
82
- placeholder?: undefined;
83
- dataSrc?: undefined;
84
- valueProperty?: undefined;
85
- data?: undefined;
86
- multiple?: undefined;
87
- validate?: undefined;
88
- suffix?: undefined;
89
- } | {
90
- type: string;
91
- key: string;
92
- input: boolean;
93
- label: string;
94
- description: string;
95
- defaultValue: string;
96
- suffix: string;
97
- placeholder?: undefined;
98
- dataSrc?: undefined;
99
- valueProperty?: undefined;
100
- data?: undefined;
101
- multiple?: undefined;
102
- validate?: undefined;
103
- })[]>;
104
- waitText(time: number): string;
105
- checkAttempts(scope: import("src/types/lib").ActionScope, error: any, user: import("src/types/lib").User): Promise<any>;
106
- executor(scope: import("src/types/lib").ActionScope): Promise<(req: import("src/types/lib").SubmissionRequest, res: import("src/types/lib").SubmissionResponse, next: import("express").NextFunction) => Promise<void>>;
107
- };
108
- role: {
109
- readonly info: {
110
- name: string;
111
- title: string;
112
- description: string;
113
- priority: number;
114
- defaults: {
115
- handler: string[];
116
- method: string[];
117
- };
118
- access: {
119
- handler: boolean;
120
- method: boolean;
121
- };
122
- };
123
- settingsForm(scope: import("src/types/lib").ActionScope): Promise<({
124
- type: string;
125
- input: boolean;
126
- label: string;
127
- key: string;
128
- placeholder: string;
129
- template: string;
130
- dataSrc: string;
131
- data: {
132
- json: string;
133
- };
134
- valueProperty: string;
135
- multiple: boolean;
136
- validate: {
137
- required: boolean;
138
- };
139
- } | {
140
- type: string;
141
- input: boolean;
142
- label: string;
143
- key: string;
144
- placeholder: string;
145
- template: string;
146
- dataSrc: string;
147
- data: {
148
- json: unknown[];
149
- };
150
- valueProperty: string;
151
- multiple: boolean;
152
- validate: {
153
- required: boolean;
154
- };
155
- })[]>;
156
- executor(scope: import("src/types/lib").ActionScope): Promise<(req: import("src/types/lib").SubmissionRequest, res: import("src/types/lib").SubmissionResponse, next: import("express").NextFunction) => Promise<void | import("src/types/lib").SubmissionResponse>>;
157
- };
2
+ save: import("@formio/appserver-core").Action;
3
+ login: import("@formio/appserver-core").Action;
4
+ role: import("@formio/appserver-core").Action;
158
5
  };
159
6
  export default _default;
@@ -1,108 +1,2 @@
1
- import { NextFunction } from 'express';
2
- import { ActionScope, User, SubmissionRequest, SubmissionResponse } from '@formio/appserver-types';
3
- export declare const LoginAction: {
4
- readonly info: {
5
- name: string;
6
- title: string;
7
- description: string;
8
- priority: number;
9
- defaults: {
10
- handler: string[];
11
- method: string[];
12
- };
13
- access: {
14
- handler: boolean;
15
- method: boolean;
16
- };
17
- };
18
- /**
19
- * The settings form for this action.
20
- * @param {*} scope
21
- */
22
- settingsForm(scope: ActionScope): Promise<({
23
- type: string;
24
- label: string;
25
- key: string;
26
- placeholder: string;
27
- dataSrc: string;
28
- valueProperty: string;
29
- data: {
30
- json: any;
31
- };
32
- multiple: boolean;
33
- validate: {
34
- required: boolean;
35
- };
36
- input?: undefined;
37
- description?: undefined;
38
- defaultValue?: undefined;
39
- suffix?: undefined;
40
- } | {
41
- type: string;
42
- input: boolean;
43
- label: string;
44
- key: string;
45
- placeholder: string;
46
- dataSrc: string;
47
- valueProperty: string;
48
- data: {
49
- json: any;
50
- };
51
- multiple: boolean;
52
- validate: {
53
- required: boolean;
54
- };
55
- description?: undefined;
56
- defaultValue?: undefined;
57
- suffix?: undefined;
58
- } | {
59
- type: string;
60
- key: string;
61
- input: boolean;
62
- label: string;
63
- description: string;
64
- defaultValue: string;
65
- placeholder?: undefined;
66
- dataSrc?: undefined;
67
- valueProperty?: undefined;
68
- data?: undefined;
69
- multiple?: undefined;
70
- validate?: undefined;
71
- suffix?: undefined;
72
- } | {
73
- type: string;
74
- key: string;
75
- input: boolean;
76
- label: string;
77
- description: string;
78
- defaultValue: string;
79
- suffix: string;
80
- placeholder?: undefined;
81
- dataSrc?: undefined;
82
- valueProperty?: undefined;
83
- data?: undefined;
84
- multiple?: undefined;
85
- validate?: undefined;
86
- })[]>;
87
- /**
88
- * Format a string to show how long one must wait.
89
- *
90
- * @param time - In seconds.
91
- * @returns {string}
92
- */
93
- waitText(time: number): string;
94
- /**
95
- * Checks the login attempts for a certain login.
96
- *
97
- * @param user
98
- * @param next
99
- * @returns {*}
100
- */
101
- checkAttempts(scope: ActionScope, error: any, user: User): Promise<any>;
102
- /**
103
- * Returns the action middleware.
104
- *
105
- * @param {*} scope
106
- */
107
- executor(scope: ActionScope): Promise<(req: SubmissionRequest, res: SubmissionResponse, next: NextFunction) => Promise<void>>;
108
- };
1
+ import { Action } from '@formio/appserver-core';
2
+ export declare const LoginAction: Action;