@azteam/express 1.2.241 → 1.2.243

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.241",
3
+ "version": "1.2.243",
4
4
  "main": "src/index.js",
5
5
  "engines": {
6
6
  "node": ">= 12.0.0",
@@ -11,19 +11,24 @@ class AdminController extends Controller {
11
11
  super(pathName, repository);
12
12
 
13
13
  this.roles = {
14
+ EXEC: null,
14
15
  READ: null,
15
16
  CREATE: null,
16
17
  UPDATE: null,
17
18
  DELETE: null,
18
19
  RESTORE: null,
19
20
  DESTROY: null,
21
+ IMPORT: null,
22
+ EXPORT: null,
20
23
 
21
24
  ...options.roles,
22
25
  };
23
26
 
24
27
  this.paginateOptions = options.paginateOptions || {};
25
- this.guardResponse = options.guardResponse || {};
26
- this.allowResponse = options.allowResponse || {};
28
+ this.guardResponse = options.guardResponse || [];
29
+ this.allowResponse = options.allowResponse
30
+ ? [...options.allowResponse, 'created_id', 'modified_id', 'restored_id', 'deleted_id']
31
+ : ['created_id', 'modified_id', 'restored_id', 'deleted_id'];
27
32
 
28
33
  this.rulesCreate =
29
34
  {
package/src/validate.js CHANGED
@@ -121,6 +121,12 @@ export const schemaObject = (props = {}, optional = false) => ({
121
121
  optional,
122
122
  });
123
123
 
124
+ export const schemaEnum = (values, optional = false) => ({
125
+ type: 'enum',
126
+ values,
127
+ optional,
128
+ });
129
+
124
130
  /* rules */
125
131
 
126
132
  export const rulesId = {