not-node 5.0.22 → 5.1.2

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 (126) hide show
  1. package/.eslintrc.json +1 -1
  2. package/bin/not-deploy.js +52 -0
  3. package/index.js +21 -19
  4. package/package.json +1 -1
  5. package/src/app.js +61 -58
  6. package/src/auth/abstract.js +17 -19
  7. package/src/auth/const.js +8 -12
  8. package/src/auth/fields.js +143 -124
  9. package/src/auth/index.js +14 -14
  10. package/src/auth/roles.js +64 -63
  11. package/src/auth/routes.js +89 -54
  12. package/src/auth/rules.js +63 -63
  13. package/src/auth/session.js +60 -62
  14. package/src/bootstrap/form.js +13 -13
  15. package/src/bootstrap/logic.js +45 -41
  16. package/src/bootstrap/model.js +14 -17
  17. package/src/bootstrap/route.js +132 -53
  18. package/src/common.js +86 -79
  19. package/src/core/fields/ID.js +6 -6
  20. package/src/core/fields/__closed.js +3 -3
  21. package/src/core/fields/__latest.js +3 -3
  22. package/src/core/fields/__version.js +3 -3
  23. package/src/core/fields/__versions.js +3 -3
  24. package/src/core/fields/_id.js +6 -6
  25. package/src/core/fields/active.js +9 -9
  26. package/src/core/fields/codeName.js +9 -9
  27. package/src/core/fields/createdAt.js +17 -17
  28. package/src/core/fields/default.js +9 -9
  29. package/src/core/fields/description.js +11 -11
  30. package/src/core/fields/email.js +9 -9
  31. package/src/core/fields/enabled.js +9 -9
  32. package/src/core/fields/expiredAt.js +16 -16
  33. package/src/core/fields/height.js +11 -11
  34. package/src/core/fields/ip.js +10 -10
  35. package/src/core/fields/objectId.js +10 -10
  36. package/src/core/fields/owner.js +13 -13
  37. package/src/core/fields/ownerModel.js +11 -11
  38. package/src/core/fields/price.js +11 -11
  39. package/src/core/fields/requiredObject.js +10 -10
  40. package/src/core/fields/session.js +10 -10
  41. package/src/core/fields/size.js +11 -11
  42. package/src/core/fields/telephone.js +9 -9
  43. package/src/core/fields/title.js +15 -15
  44. package/src/core/fields/updatedAt.js +17 -17
  45. package/src/core/fields/userId.js +11 -12
  46. package/src/core/fields/uuid.js +11 -11
  47. package/src/core/fields/validators/email.js +6 -4
  48. package/src/core/fields/validators/owner.js +6 -4
  49. package/src/core/fields/width.js +11 -11
  50. package/src/domain.js +435 -431
  51. package/src/env.js +23 -23
  52. package/src/error.js +20 -23
  53. package/src/exceptions/db.js +23 -0
  54. package/src/exceptions/http.js +43 -0
  55. package/src/fields/index.js +106 -111
  56. package/src/form/fabric.js +19 -24
  57. package/src/form/form.js +195 -186
  58. package/src/form/index.js +2 -2
  59. package/src/generic/index.js +2 -0
  60. package/src/generic/logic.js +595 -0
  61. package/src/generic/route.js +76 -0
  62. package/src/init/additional.js +7 -7
  63. package/src/init/app.js +75 -68
  64. package/src/init/bodyparser.js +14 -14
  65. package/src/init/compression.js +6 -7
  66. package/src/init/core.js +12 -12
  67. package/src/init/cors.js +22 -24
  68. package/src/init/db/index.js +41 -43
  69. package/src/init/db/ioredis.js +28 -20
  70. package/src/init/db/mongoose.js +42 -32
  71. package/src/init/db/redis.js +59 -48
  72. package/src/init/env.js +44 -36
  73. package/src/init/express.js +18 -21
  74. package/src/init/fileupload.js +8 -10
  75. package/src/init/http.js +65 -47
  76. package/src/init/index.js +141 -148
  77. package/src/init/informer.js +7 -9
  78. package/src/init/methodoverride.js +4 -6
  79. package/src/init/middleware.js +23 -26
  80. package/src/init/modules.js +4 -4
  81. package/src/init/monitoring.js +8 -8
  82. package/src/init/rateLimiter.js +53 -45
  83. package/src/init/routes.js +67 -69
  84. package/src/init/security.js +37 -33
  85. package/src/init/sequence.js +111 -107
  86. package/src/init/sequence.standart.js +54 -56
  87. package/src/init/sessions/index.js +21 -21
  88. package/src/init/sessions/mongoose.js +49 -36
  89. package/src/init/sessions/redis.js +28 -27
  90. package/src/init/static.js +53 -40
  91. package/src/init/template.js +17 -17
  92. package/src/lib.js +230 -200
  93. package/src/manifest/batchRunner.js +26 -25
  94. package/src/manifest/initializator/forms.js +24 -24
  95. package/src/manifest/initializator/index.js +8 -10
  96. package/src/manifest/initializator/manifests.js +45 -42
  97. package/src/manifest/initializator/models.js +37 -34
  98. package/src/manifest/manifest.filter.js +130 -97
  99. package/src/manifest/manifest.js +103 -77
  100. package/src/manifest/module.js +350 -360
  101. package/src/manifest/registrator/fields.js +90 -85
  102. package/src/manifest/registrator/forms.js +47 -47
  103. package/src/manifest/registrator/index.js +14 -16
  104. package/src/manifest/registrator/locales.js +17 -16
  105. package/src/manifest/registrator/logics.js +66 -64
  106. package/src/manifest/registrator/models.js +64 -62
  107. package/src/manifest/registrator/routes.js +171 -132
  108. package/src/manifest/registrator/routes.ws.js +109 -103
  109. package/src/manifest/route.js +216 -161
  110. package/src/model/buildValidator.js +53 -42
  111. package/src/model/default.js +304 -286
  112. package/src/model/enrich.js +69 -61
  113. package/src/model/increment.js +124 -137
  114. package/src/model/proto.js +179 -148
  115. package/src/model/routine.js +85 -76
  116. package/src/model/utils.js +33 -0
  117. package/src/model/versioning.js +148 -130
  118. package/src/obsolete.js +12 -8
  119. package/src/parser.js +29 -22
  120. package/src/repos.js +29 -31
  121. package/src/rollup.js +75 -65
  122. package/src/shell.helpers.js +28 -28
  123. package/static.js +31 -0
  124. package/src/generic/router.js +0 -16
  125. package/src/manifest/module.models.js +0 -0
  126. package/src/manifest/module.status.js +0 -0
package/src/common.js CHANGED
@@ -1,6 +1,6 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const notPath = require('not-path');
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+ const notPath = require("not-path");
4
4
 
5
5
  /** @module Common */
6
6
  /**
@@ -9,8 +9,8 @@ const notPath = require('not-path');
9
9
  * @return {string} result
10
10
  */
11
11
 
12
- module.exports.firstLetterToLower = function(string) {
13
- return string.charAt(0).toLowerCase() + string.slice(1);
12
+ module.exports.firstLetterToLower = function (string) {
13
+ return string.charAt(0).toLowerCase() + string.slice(1);
14
14
  };
15
15
 
16
16
  /**
@@ -19,8 +19,8 @@ module.exports.firstLetterToLower = function(string) {
19
19
  * @return {string} result
20
20
  */
21
21
 
22
- module.exports.firstLetterToUpper = function(string) {
23
- return string.charAt(0).toUpperCase() + string.slice(1);
22
+ module.exports.firstLetterToUpper = function (string) {
23
+ return string.charAt(0).toUpperCase() + string.slice(1);
24
24
  };
25
25
 
26
26
  /**
@@ -29,11 +29,11 @@ module.exports.firstLetterToUpper = function(string) {
29
29
  * @return {booelean} true if check is not failed
30
30
  */
31
31
  module.exports.validateObjectId = (id) => {
32
- try {
33
- return id.match(/^[0-9a-fA-F]{24}$/) ? true : false;
34
- } catch (e) {
35
- return false;
36
- }
32
+ try {
33
+ return id.match(/^[0-9a-fA-F]{24}$/) ? true : false;
34
+ } catch (e) {
35
+ return false;
36
+ }
37
37
  };
38
38
 
39
39
  /**
@@ -43,25 +43,25 @@ module.exports.validateObjectId = (id) => {
43
43
  * @return {booelean} true if equal
44
44
  */
45
45
  module.exports.compareObjectIds = (firstId, secondId) => {
46
- try {
47
- let a = firstId,
48
- b = secondId;
49
- if (typeof firstId !== 'string') {
50
- a = a.toString();
51
- }
52
- if (typeof secondId !== 'string') {
53
- b = b.toString();
54
- }
55
- if (
56
- !module.exports.validateObjectId(a) ||
57
- !module.exports.validateObjectId(b)
58
- ) {
59
- return false;
46
+ try {
47
+ let a = firstId,
48
+ b = secondId;
49
+ if (typeof firstId !== "string") {
50
+ a = a.toString();
51
+ }
52
+ if (typeof secondId !== "string") {
53
+ b = b.toString();
54
+ }
55
+ if (
56
+ !module.exports.validateObjectId(a) ||
57
+ !module.exports.validateObjectId(b)
58
+ ) {
59
+ return false;
60
+ }
61
+ return a === b;
62
+ } catch (e) {
63
+ return false;
60
64
  }
61
- return a === b;
62
- } catch (e) {
63
- return false;
64
- }
65
65
  };
66
66
 
67
67
  /**
@@ -69,11 +69,10 @@ module.exports.compareObjectIds = (firstId, secondId) => {
69
69
  * @return {number} current date with 00:00:00 in ms of unix time
70
70
  */
71
71
  module.exports.getTodayDate = () => {
72
- let t = new Date();
73
- return (new Date(t.getFullYear(), t.getMonth(), t.getDate())).getTime();
72
+ let t = new Date();
73
+ return new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime();
74
74
  };
75
75
 
76
-
77
76
  /**
78
77
  * Returns true if object has field of name
79
78
  * @param {object} obj some object
@@ -81,20 +80,19 @@ module.exports.getTodayDate = () => {
81
80
  * @return {boolean} if object contains field with name
82
81
  **/
83
82
  const objHas = (obj, name) => {
84
- if(typeof obj === 'undefined') return false;
85
- if(obj === null) return false;
86
- return Object.prototype.hasOwnProperty.call(obj, name);
83
+ if (typeof obj === "undefined") return false;
84
+ if (obj === null) return false;
85
+ return Object.prototype.hasOwnProperty.call(obj, name);
87
86
  };
88
87
  module.exports.objHas = objHas;
89
88
 
90
-
91
89
  /**
92
90
  * Copies object to secure it from changes
93
91
  * @param {object} obj original object
94
92
  * @return {object} copy of object
95
93
  **/
96
94
  module.exports.copyObj = (obj) => {
97
- return JSON.parse(JSON.stringify(obj));
95
+ return JSON.parse(JSON.stringify(obj));
98
96
  };
99
97
 
100
98
  /**
@@ -103,34 +101,51 @@ module.exports.copyObj = (obj) => {
103
101
  * @return {object} copy of object
104
102
  **/
105
103
  module.exports.partCopyObj = (obj, list) => {
106
- let partObj = Object.keys(obj).reduce((prev, curr) => {
107
- if (list.includes(curr)) {
108
- prev[curr] = obj[curr];
109
- }
110
- return prev;
111
- }, {});
112
- return JSON.parse(JSON.stringify(partObj));
104
+ let partObj = Object.keys(obj).reduce((prev, curr) => {
105
+ if (list.includes(curr)) {
106
+ prev[curr] = obj[curr];
107
+ }
108
+ return prev;
109
+ }, {});
110
+ return JSON.parse(JSON.stringify(partObj));
113
111
  };
114
112
 
115
-
116
113
  /**
117
114
  * Test argument type to be 'function'
118
115
  * @param {any} func possible function
119
116
  * @return {boolean} if this is a function
120
117
  **/
121
- const isFunc = module.exports.isFunc = (func) => {
122
- return typeof func === 'function';
123
- };
118
+ const isFunc = (module.exports.isFunc = (func) => {
119
+ return typeof func === "function";
120
+ });
124
121
 
125
122
  /**
126
123
  * Returns true if argument is Async function
127
124
  * @param {function} func to test
128
125
  * @return {boolean} if this function is constructed as AsyncFunction
129
126
  **/
130
- const isAsync = module.exports.isAsync = (func) => {
131
- return func.constructor.name === 'AsyncFunction';
127
+ const isAsync = (module.exports.isAsync = (func) => {
128
+ return func.constructor.name === "AsyncFunction";
129
+ });
130
+
131
+ /**
132
+ * Executes method in appropriate way inside Promise
133
+ * @param {function} proc function to execute
134
+ * @param {Array} params array of params
135
+ * @return {Promise} results of method execution
136
+ **/
137
+ const executeFunctionAsAsync = async (proc, params) => {
138
+ if (isFunc(proc)) {
139
+ if (isAsync(proc)) {
140
+ return await proc(...params);
141
+ } else {
142
+ return proc(...params);
143
+ }
144
+ }
145
+ //throw new Error("Could not execute `proc` is not a function");
132
146
  };
133
147
 
148
+ module.exports.executeFunctionAsAsync = executeFunctionAsAsync;
134
149
 
135
150
  /**
136
151
  * Executes method of object in appropriate way inside Promise
@@ -140,19 +155,12 @@ const isAsync = module.exports.isAsync = (func) => {
140
155
  * @return {Promise} results of method execution
141
156
  **/
142
157
  module.exports.executeObjectFunction = async (obj, name, params) => {
143
- if (obj) {
144
- const proc = notPath.get(':' + name, obj);
145
- if (isFunc(proc)) {
146
- if (isAsync(proc)) {
147
- return await proc(...params);
148
- } else {
149
- return proc(...params);
150
- }
158
+ if (obj) {
159
+ const proc = notPath.get(":" + name, obj);
160
+ return await executeFunctionAsAsync(proc, params);
151
161
  }
152
- }
153
162
  };
154
163
 
155
-
156
164
  /**
157
165
  * Executes method of object in apropriate way inside Promise
158
166
  * @param {Object} from original object
@@ -161,26 +169,25 @@ module.exports.executeObjectFunction = async (obj, name, params) => {
161
169
  * @return {Promise} results of method execution
162
170
  **/
163
171
  module.exports.mapBind = (from, to, list) => {
164
- list.forEach((item) => {
165
- if (typeof from[item] === 'function') {
166
- to[item] = from[item].bind(from);
167
- }
168
- });
172
+ list.forEach((item) => {
173
+ if (typeof from[item] === "function") {
174
+ to[item] = from[item].bind(from);
175
+ }
176
+ });
169
177
  };
170
178
 
171
-
172
179
  /**
173
180
  * Synchronously check file existence and if it's really a file
174
181
  * @param {string} filePath full path to file
175
182
  * @return {boolean} true if path exists and it's a file
176
183
  **/
177
184
  module.exports.tryFile = (filePath) => {
178
- try {
179
- const stat = fs.lstatSync(filePath);
180
- return stat && stat.isFile();
181
- } catch (e) {
182
- return false;
183
- }
185
+ try {
186
+ const stat = fs.lstatSync(filePath);
187
+ return stat && stat.isFile();
188
+ } catch (e) {
189
+ return false;
190
+ }
184
191
  };
185
192
 
186
193
  /**
@@ -190,10 +197,10 @@ module.exports.tryFile = (filePath) => {
190
197
  * @param {string} relative path to parent folder of components
191
198
  * @param {Object} paths object for module/index.js
192
199
  **/
193
- module.exports.generatePaths = (content = [], relative = 'src') => {
194
- const toPath = (name) => path.join(relative, name);
195
- return content.reduce((prev, cur) => {
196
- prev[cur] = toPath(cur);
197
- return prev;
198
- }, {});
200
+ module.exports.generatePaths = (content = [], relative = "src") => {
201
+ const toPath = (name) => path.join(relative, name);
202
+ return content.reduce((prev, cur) => {
203
+ prev[cur] = toPath(cur);
204
+ return prev;
205
+ }, {});
199
206
  };
@@ -1,8 +1,8 @@
1
1
  module.exports = {
2
- ui: {
3
- component: 'UITextfield',
4
- placeholder: 'not-node:field_ID_placeholder',
5
- label: 'not-node:field_ID_label',
6
- readonly: true
7
- }
2
+ ui: {
3
+ component: "UITextfield",
4
+ placeholder: "not-node:field_ID_placeholder",
5
+ label: "not-node:field_ID_label",
6
+ readonly: true,
7
+ },
8
8
  };
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UIHidden'
4
- }
2
+ ui: {
3
+ component: "UIHidden",
4
+ },
5
5
  };
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UIHidden'
4
- }
2
+ ui: {
3
+ component: "UIHidden",
4
+ },
5
5
  };
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UIHidden'
4
- }
2
+ ui: {
3
+ component: "UIHidden",
4
+ },
5
5
  };
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UIHidden'
4
- }
2
+ ui: {
3
+ component: "UIHidden",
4
+ },
5
5
  };
@@ -1,8 +1,8 @@
1
1
  module.exports = {
2
- ui: {
3
- component: 'UIHidden',
4
- placeholder: '_id',
5
- label: '_id',
6
- readonly: true
7
- }
2
+ ui: {
3
+ component: "UIHidden",
4
+ placeholder: "_id",
5
+ label: "_id",
6
+ readonly: true,
7
+ },
8
8
  };
@@ -1,11 +1,11 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UISwitch',
4
- label: 'not-node:field_active_label'
5
- },
6
- model:{
7
- type: Boolean,
8
- default: false,
9
- required: true
10
- }
2
+ ui: {
3
+ component: "UISwitch",
4
+ label: "not-node:field_active_label",
5
+ },
6
+ model: {
7
+ type: Boolean,
8
+ default: false,
9
+ required: true,
10
+ },
11
11
  };
@@ -1,11 +1,11 @@
1
1
  module.exports = {
2
- ui: {
3
- component: 'UITextfield',
4
- placeholder: 'not-node:field_codeName_placeholder',
5
- label: 'not-node:field_codeName_label'
6
- },
7
- model: {
8
- type: String,
9
- required: true
10
- }
2
+ ui: {
3
+ component: "UITextfield",
4
+ placeholder: "not-node:field_codeName_placeholder",
5
+ label: "not-node:field_codeName_label",
6
+ },
7
+ model: {
8
+ type: String,
9
+ required: true,
10
+ },
11
11
  };
@@ -1,19 +1,19 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UIDate',
4
- label: 'not-node:field_createdAt_label',
5
- placeholder: "not-node:field_createdAt_placeholder",
6
- readonly: true
7
- },
8
- model: {
9
- type: Date,
10
- required: true,
11
- default: Date.now,
12
- searchable: true,
13
- sortable: true,
14
- safe: {
15
- update: ['@owner', 'root', 'admin'],
16
- read: ['@owner', 'root', 'admin']
17
- }
18
- }
2
+ ui: {
3
+ component: "UIDate",
4
+ label: "not-node:field_createdAt_label",
5
+ placeholder: "not-node:field_createdAt_placeholder",
6
+ readonly: true,
7
+ },
8
+ model: {
9
+ type: Date,
10
+ required: true,
11
+ default: Date.now,
12
+ searchable: true,
13
+ sortable: true,
14
+ safe: {
15
+ update: ["@owner", "root", "admin"],
16
+ read: ["@owner", "root", "admin"],
17
+ },
18
+ },
19
19
  };
@@ -1,11 +1,11 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UISwitch',
4
- label: 'not-node:field_default_label'
5
- },
6
- model:{
7
- type: Boolean,
8
- default: false,
9
- required: true
10
- }
2
+ ui: {
3
+ component: "UISwitch",
4
+ label: "not-node:field_default_label",
5
+ },
6
+ model: {
7
+ type: Boolean,
8
+ default: false,
9
+ required: true,
10
+ },
11
11
  };
@@ -1,13 +1,13 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UITextarea',
4
- placeholder: 'not-node:field_description_placeholder',
5
- label: 'not-node:field_description_label'
6
- },
7
- model:{
8
- type: String,
9
- required: true,
10
- searchable: true,
11
- sortable: true
12
- }
2
+ ui: {
3
+ component: "UITextarea",
4
+ placeholder: "not-node:field_description_placeholder",
5
+ label: "not-node:field_description_label",
6
+ },
7
+ model: {
8
+ type: String,
9
+ required: true,
10
+ searchable: true,
11
+ sortable: true,
12
+ },
13
13
  };
@@ -1,11 +1,11 @@
1
1
  module.exports = {
2
- ui: {
3
- component: 'UIEmail',
4
- placeholder: 'not-node:field_email_placeholder',
5
- label: 'not-node:field_email_label'
6
- },
7
- model: {
8
- type: String,
9
- required: true
10
- }
2
+ ui: {
3
+ component: "UIEmail",
4
+ placeholder: "not-node:field_email_placeholder",
5
+ label: "not-node:field_email_label",
6
+ },
7
+ model: {
8
+ type: String,
9
+ required: true,
10
+ },
11
11
  };
@@ -1,11 +1,11 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UISwitch',
4
- label: 'not-node:field_enabled_label'
5
- },
6
- model:{
7
- type: Boolean,
8
- default: true,
9
- required: true
10
- }
2
+ ui: {
3
+ component: "UISwitch",
4
+ label: "not-node:field_enabled_label",
5
+ },
6
+ model: {
7
+ type: Boolean,
8
+ default: true,
9
+ required: true,
10
+ },
11
11
  };
@@ -1,18 +1,18 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UITextfield',
4
- label: 'not-node:field_expiredAt_label',
5
- placeholder: 'not-node:field_expiredAt_placeholder',
6
- readonly: true
7
- },
8
- model:{
9
- type: Date,
10
- required: false,
11
- searchable: true,
12
- sortable: true,
13
- safe: {
14
- update: ['@owner', 'root', 'admin'],
15
- read: ['@owner', 'root', 'admin']
16
- }
17
- }
2
+ ui: {
3
+ component: "UITextfield",
4
+ label: "not-node:field_expiredAt_label",
5
+ placeholder: "not-node:field_expiredAt_placeholder",
6
+ readonly: true,
7
+ },
8
+ model: {
9
+ type: Date,
10
+ required: false,
11
+ searchable: true,
12
+ sortable: true,
13
+ safe: {
14
+ update: ["@owner", "root", "admin"],
15
+ read: ["@owner", "root", "admin"],
16
+ },
17
+ },
18
18
  };
@@ -1,13 +1,13 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UITextfield',
4
- label: 'not-node:field_height_label',
5
- placeholder: 'not-node:field_height_placeholder'
6
- },
7
- model:{
8
- type: Number,
9
- required: true,
10
- searchable: true,
11
- sortable: true
12
- }
2
+ ui: {
3
+ component: "UITextfield",
4
+ label: "not-node:field_height_label",
5
+ placeholder: "not-node:field_height_placeholder",
6
+ },
7
+ model: {
8
+ type: Number,
9
+ required: true,
10
+ searchable: true,
11
+ sortable: true,
12
+ },
13
13
  };
@@ -1,12 +1,12 @@
1
1
  module.exports = {
2
- ui:{
3
- component: 'UITextfield',
4
- label: 'not-node:field_IP_label',
5
- placeholder: 'not-node:field_IP_placeholder'
6
- },
7
- model:{
8
- type: String,
9
- searchable: true,
10
- required: true
11
- }
2
+ ui: {
3
+ component: "UITextfield",
4
+ label: "not-node:field_IP_label",
5
+ placeholder: "not-node:field_IP_placeholder",
6
+ },
7
+ model: {
8
+ type: String,
9
+ searchable: true,
10
+ required: true,
11
+ },
12
12
  };
@@ -1,13 +1,13 @@
1
- const ObjectId = require('mongoose').Schema.Types.ObjectId;
1
+ const ObjectId = require("mongoose").Schema.Types.ObjectId;
2
2
 
3
3
  module.exports = {
4
- model: {
5
- type: ObjectId,
6
- required: true,
7
- default: {},
8
- safe: {
9
- update: ['@owner', 'root', 'admin'],
10
- read: ['@owner', 'root', 'admin']
11
- }
12
- }
4
+ model: {
5
+ type: ObjectId,
6
+ required: true,
7
+ default: {},
8
+ safe: {
9
+ update: ["@owner", "root", "admin"],
10
+ read: ["@owner", "root", "admin"],
11
+ },
12
+ },
13
13
  };
@@ -1,15 +1,15 @@
1
- const Schema = require('mongoose').Schema;
1
+ const Schema = require("mongoose").Schema;
2
2
  module.exports = {
3
- model:{
4
- type: Schema.Types.ObjectId,
5
- refPath: 'ownerModel',
6
- required: false,
7
- safe: {
8
- update: ['root', 'admin'],
9
- read: ['@owner', 'root', 'admin']
10
- }
11
- },
12
- ui:{
13
- component: 'UIHidden'
14
- }
3
+ model: {
4
+ type: Schema.Types.ObjectId,
5
+ refPath: "ownerModel",
6
+ required: false,
7
+ safe: {
8
+ update: ["root", "admin"],
9
+ read: ["@owner", "root", "admin"],
10
+ },
11
+ },
12
+ ui: {
13
+ component: "UIHidden",
14
+ },
15
15
  };