not-node 4.0.3 → 4.0.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.
package/.eslintrc.json CHANGED
@@ -31,6 +31,7 @@
31
31
  "node/prefer-global/url": ["error", "always"],
32
32
  "node/prefer-promises/dns": "error",
33
33
  "node/prefer-promises/fs": "error",
34
+ "node/no-unpublished-require": "warn",
34
35
  "indent": ["error", 2],
35
36
  "linebreak-style": [
36
37
  "error",
package/index.js CHANGED
@@ -29,6 +29,8 @@ module.exports.Routine = require('./src/model/routine');
29
29
  module.exports.Common = require('./src/common');
30
30
  /** Fields library manager */
31
31
  module.exports.Fields = require('./src/fields');
32
+ /** Form validation template **/
33
+ module.exports.Form = require('./src/form');
32
34
  /** Application initialization procedures */
33
35
  module.exports.Init = require('./src/init').Init;
34
36
  /** Application object */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "4.0.3",
3
+ "version": "4.0.7",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -78,6 +78,7 @@
78
78
  "eslint-plugin-promise": "^5.1.1",
79
79
  "eslint-plugin-sonarjs": "^0.10.0",
80
80
  "ink-docstrap": "^1.3.2",
81
+ "ioredis": "^4.28.1",
81
82
  "jsdoc": "^3.6.7",
82
83
  "mocha": "*",
83
84
  "mocha-suppress-logs": "^0.3.1",
package/src/domain.js CHANGED
@@ -133,6 +133,17 @@ class notDomain extends EventEmitter {
133
133
  return null;
134
134
  }
135
135
 
136
+ /**
137
+ * Returns form
138
+ * @param {string} name 'formName' or 'moduleName//formName'
139
+ * ('login', 'not-user//login')
140
+ * @return {object} form
141
+ **/
142
+ getForm(name) {
143
+ const type = 'form';
144
+ return this.getByPath(name, type);
145
+ }
146
+
136
147
  /**
137
148
  * Returns model
138
149
  * @param {string} name 'modelName' or 'moduleName//modelName'
@@ -141,11 +152,7 @@ class notDomain extends EventEmitter {
141
152
  **/
142
153
  getModel(name) {
143
154
  const type = 'model';
144
- if (name.indexOf('//') > 0) {
145
- return this.getByFullPath(name, type);
146
- } else {
147
- return this.getByShortPath(name, type);
148
- }
155
+ return this.getByPath(name, type);
149
156
  }
150
157
 
151
158
  getByFullPath(name, type){
@@ -169,31 +176,23 @@ class notDomain extends EventEmitter {
169
176
 
170
177
  /**
171
178
  * Returns file with model declarations
172
- * @param {string} modelName 'modelName' or 'moduleName//modelName'
179
+ * @param {string} name 'modelName' or 'moduleName//modelName'
173
180
  * @return {object} CommonJS module object
174
181
  **/
175
- getModelFile(modelName) {
182
+ getModelFile(name) {
176
183
  const type = 'modelFile';
177
- if (modelName.indexOf('//') > 0) {
178
- return this.getByFullPath(modelName, type);
179
- } else {
180
- return this.getByShortPath(modelName, type);
181
- }
184
+ return this.getByPath(name, type);
182
185
  }
183
186
 
184
187
  /**
185
188
  * Returns specified by name or 'moduleName//modelName' model Schema
186
- * @param {string} modelName 'modelName' or 'moduleName//modelName'
189
+ * @param {string} name 'modelName' or 'moduleName//modelName'
187
190
  * @return {object} model schema
188
191
  **/
189
192
 
190
- getModelSchema(modelName) {
193
+ getModelSchema(name) {
191
194
  const type = 'modelSchema';
192
- if (modelName.indexOf('//') > 0) {
193
- return this.getByFullPath(modelName, type);
194
- } else {
195
- return this.getByShortPath(modelName, type);
196
- }
195
+ return this.getByPath(name, type);
197
196
  }
198
197
 
199
198
  /**
@@ -204,25 +203,25 @@ class notDomain extends EventEmitter {
204
203
  **/
205
204
  getLogic(name) {
206
205
  const type = 'logic';
207
- if (name.indexOf('//') > 0) {
208
- return this.getByFullPath(name, type);
209
- } else {
210
- return this.getByShortPath(name, type);
211
- }
206
+ return this.getByPath(name, type);
212
207
  }
213
208
 
214
209
 
215
210
  /**
216
211
  * Returns file with logic declarations
217
- * @param {string} logicName 'logicName' or 'moduleName//logicName'
212
+ * @param {string} name 'logicName' or 'moduleName//logicName'
218
213
  * @return {object} CommonJS module object
219
214
  **/
220
- getLogicFile(logicName) {
215
+ getLogicFile(name) {
221
216
  const type = 'logicFile';
222
- if (logicName.indexOf('//') > 0) {
223
- return this.getByFullPath(logicName, type);
217
+ return this.getByPath(name, type);
218
+ }
219
+
220
+ getByPath(name, type){
221
+ if (name.indexOf('//') > 0) {
222
+ return this.getByFullPath(name, type);
224
223
  } else {
225
- return this.getByShortPath(logicName, type);
224
+ return this.getByShortPath(name, type);
226
225
  }
227
226
  }
228
227
 
@@ -403,6 +402,10 @@ class notDomain extends EventEmitter {
403
402
  count: 0,
404
403
  list: []
405
404
  },
405
+ forms: {
406
+ count: 0,
407
+ list: []
408
+ },
406
409
  actions: {
407
410
  count: 0,
408
411
  list: []
@@ -418,8 +421,9 @@ class notDomain extends EventEmitter {
418
421
  stats.modules.content[modName] = modStatus;
419
422
  stats.routes.count += modStatus.routes.count;
420
423
  stats.models.count += modStatus.models.count;
424
+ stats.forms.count += modStatus.forms.count;
421
425
  stats.actions.count += modStatus.actions.count;
422
- for (let t of ['routes', 'models', 'actions']) {
426
+ for (let t of ['routes', 'models', 'actions', 'forms']) {
423
427
  stats[t].list.push(...(modStatus[t].list.map(itmName => `${modName}//${itmName}`)));
424
428
  }
425
429
  }
@@ -0,0 +1,82 @@
1
+ //DB related validation tools
2
+ const mongoose = require('mongoose');
3
+ const Schema = mongoose.Schema;
4
+ //not-node
5
+ const initFields = require('../fields').initFields;
6
+ const {
7
+ byFieldsValidators
8
+ } = require('../model/enrich');
9
+ const {
10
+ notValidationError,
11
+ notError
12
+ } = require('not-error');
13
+
14
+ /**
15
+ * Generic form validation class
16
+ **/
17
+ module.exports = class Form {
18
+ constructor({
19
+ FIELDS,
20
+ FORM_NAME
21
+ }) {
22
+ this.FORM_NAME = FORM_NAME;
23
+ this.FIELDS = FIELDS;
24
+ this.SCHEMA = byFieldsValidators(initFields(FIELDS, 'model'));
25
+ if (mongoose.modelNames().indexOf(targetModule.thisModelName)===-1){
26
+ this.MODEL = mongoose.model(FORM_NAME, Schema(this.SCHEMA));
27
+ }else{
28
+ this.MODEL = mongoose.connection.model(FORM_NAME);
29
+ }
30
+ }
31
+
32
+ /**
33
+ * Extract data from ExpressRequest object and validates it
34
+ * returns it or throws
35
+ * @param {ExpressRequest} req expressjs request object
36
+ * @return {Promise<Object>} form data
37
+ * @throws {notValidationError}
38
+ **/
39
+ async run(req) {
40
+ let data = await this.extract(req);
41
+ await this.validate(data);
42
+ return data;
43
+ }
44
+
45
+ /**
46
+ * Extracts data, should be overriden
47
+ * @param {ExpressRequest} req expressjs request object
48
+ * @return {Object} forma data
49
+ **/
50
+ async extract( /*req*/ ) {
51
+ return {};
52
+ }
53
+
54
+ /**
55
+ * Validates form data or throws
56
+ * @param {Object} data form data
57
+ * @return {Object}
58
+ * @throws {notValidationError}
59
+ **/
60
+ async validate(data) {
61
+ try {
62
+ await this.MODEL.validate(data, this.FIELDS);
63
+ } catch (e) {
64
+ let fields = {};
65
+ if (e instanceof mongoose.Error.ValidationError) {
66
+ Object.keys(e.errors).forEach(name => {
67
+ fields[name] = [e.errors[name].message];
68
+ });
69
+ throw new notValidationError(e.message, fields, e, data);
70
+ } else {
71
+ throw new notError(
72
+ 'core:form_validation_error', {
73
+ FORM_NAME: this.FORM_NAME,
74
+ FIELDS: this.FIELDS,
75
+ data
76
+ },
77
+ e
78
+ );
79
+ }
80
+ }
81
+ }
82
+ };
@@ -1,4 +1,3 @@
1
- const {notError} = require('not-error');
2
1
  const log = require('not-log')(module, 'not-node//init');
3
2
  const ADDS = require('../additional');
4
3
 
@@ -28,6 +28,7 @@ module.exports = class InitDBMongoose{
28
28
  }
29
29
 
30
30
  async run({config, options, master, conf, alias}){
31
+ log.info(`db.${alias}.pre`);
31
32
  await ADDS.run(`db.${alias}.pre`, {config, options, master, conf, alias});
32
33
  await InitDBMongoose.initMongoose({conf, master, alias});
33
34
  await ADDS.run(`db.${alias}.post`, {config, options, master, conf, alias});
package/src/init/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  //
2
+ const os = require('os');
2
3
  const path = require('path');
3
4
  const logger = require('not-log');
4
5
  const log = logger(module, 'not-node:Init');
@@ -78,7 +79,7 @@ class Init {
78
79
  static setEnv(key, val) {
79
80
  Env.setEnv(key, val);
80
81
  }
81
-
82
+
82
83
  static getEnv(key) {
83
84
  return Env.getEnv(key);
84
85
  }
@@ -126,7 +127,7 @@ class Init {
126
127
  additional
127
128
  }) {
128
129
  try {
129
- log.info('Kick start app...');
130
+ log.info('Kick start app...'+ os.platform()+os.arch());
130
131
  ADDS.init(additional);
131
132
  const initSequence = new InitSequence(STANDART_INIT_SEQUENCE);
132
133
  await ADDS.run('pre', {
@@ -149,6 +150,11 @@ class Init {
149
150
  };
150
151
  //running all prepared initalizers with current context
151
152
  await initSequence.run(context);
153
+ await ADDS.run('post', {
154
+ config,
155
+ options,
156
+ manifest
157
+ });
152
158
  log.info('Application initalization finished');
153
159
  } catch (e) {
154
160
  Init.throwError(e.message, 1);
@@ -18,7 +18,9 @@ module.exports = class InitMiddleware{
18
18
  } else {
19
19
  proc = require(warePath);
20
20
  }
21
- master.getServer().use(proc);
21
+ if(typeof proc === 'function'){
22
+ master.getServer().use(proc);
23
+ }
22
24
  }
23
25
  }
24
26
  await ADDS.run('middleware.post', {config, options, master});
@@ -29,7 +29,7 @@ module.exports = class InitRateLimiter{
29
29
  return new RateLimiterRedis({
30
30
  storeClient: master.getEnv('db.redis'),
31
31
  keyPrefix: 'middleware',
32
- points: 10, // 10 requests
32
+ points: 100, // 10 requests
33
33
  duration: 1, // per 1 second by IP
34
34
  });
35
35
  }
@@ -4,6 +4,7 @@ const serveStatic = require('serve-static');
4
4
  const log = require('not-log')(module, 'not-node//init');
5
5
  const {
6
6
  notError,
7
+ notValidationError,
7
8
  notRequestError
8
9
  } = require('not-error');
9
10
 
@@ -12,27 +13,38 @@ module.exports = class InitRoutes {
12
13
  static finalError({
13
14
  master
14
15
  }) {
15
- return (err, req, res) => {
16
+ return (err, req, res, next) => {
17
+ //reportable errors from known cases
16
18
  if (err instanceof notError) {
17
19
  master.getApp().report(err);
20
+ //if request params - ok, but result is not
18
21
  if (err instanceof notRequestError) {
19
22
  if (err.getRedirect()) {
20
- res.redirect(err.getRedirect());
23
+ return res.redirect(err.getRedirect());
21
24
  } else {
22
-
23
- res.status(err.getCode()).json({
25
+ return res.status(err.getCode()).json({
24
26
  status: 'error',
25
- error: err.getResult().message,
27
+ message: err.getResult().message,
26
28
  errors: err.getResult().errors
27
29
  });
28
30
  }
31
+ //bad request params
32
+ }else if (err instanceof notValidationError){
33
+ return res.status(400).json({
34
+ status: 'error',
35
+ message: err.message,
36
+ errors: err.getFieldsErrors()
37
+ });
29
38
  }
30
- } else if (err instanceof Error && (res && res.status && res.json)) {
39
+ }
40
+ //other cases
41
+ if (err instanceof Error && (res && res.status && res.json)) {
31
42
  res.status(err.statusCode || 500);
43
+ //reporting as unknown
32
44
  master.getApp().report(new notError(`Internal error(${res.statusCode}): %${req.url} - %${err.message}`, {}, err));
33
45
  res.json({
34
46
  status: 'error',
35
- error: err.message
47
+ message: err.message
36
48
  });
37
49
  } else {
38
50
  log.error('Unknown error:', err);
@@ -40,6 +52,7 @@ module.exports = class InitRoutes {
40
52
  status: 'error'
41
53
  });
42
54
  }
55
+ next();
43
56
  };
44
57
  }
45
58
 
@@ -47,6 +47,7 @@ class notModule {
47
47
  };
48
48
  this.models = {};
49
49
  this.logics = {};
50
+ this.forms = {};
50
51
  this.manifests = {};
51
52
  this.faulty = false;
52
53
  this.paths = {
@@ -220,10 +221,15 @@ class notModule {
220
221
  }
221
222
 
222
223
  getStatus() {
224
+ const formsList = Object.keys(this.forms);
223
225
  const modelsList = Object.keys(this.models);
224
226
  const routesList = Object.keys(this.routes);
225
227
  const actionsList = this.getActionsList();
226
228
  return {
229
+ forms: {
230
+ count: formsList.length,
231
+ list: formsList
232
+ },
227
233
  models: {
228
234
  count: modelsList.length,
229
235
  list: modelsList,
@@ -271,11 +277,18 @@ class notModule {
271
277
  return content;
272
278
  }
273
279
 
274
-
275
280
  setManifest(key, val){
276
281
  this.manifests[key] = val;
277
282
  }
278
283
 
284
+ getForm(key) {
285
+ return this.forms[key];
286
+ }
287
+
288
+ setForm(key, val) {
289
+ this.forms[key] = val;
290
+ }
291
+
279
292
  setModel(key, val){
280
293
  this.models[key] = val;
281
294
  }
@@ -0,0 +1,48 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+ const {tryFile} = require('../../common');
4
+
5
+ module.exports = class notModuleRegistratorForms{
6
+
7
+ static openFile = require;
8
+
9
+ constructor({nModule}){
10
+ this.run({nModule});
11
+ }
12
+
13
+ run({nModule}){
14
+ const srcDir = notModuleRegistratorForms.getPath(nModule);
15
+ if (!srcDir) { return false; }
16
+ this.findAll(
17
+ {
18
+ nModule,
19
+ srcDir
20
+ }
21
+ );
22
+ return true;
23
+ }
24
+
25
+ static getPath(nModule){
26
+ return nModule.module.paths.forms;
27
+ }
28
+
29
+ /**
30
+ * Searching forms in directory
31
+ * @param {Object} input
32
+ * @param {string} input.srcDir
33
+ **/
34
+ findAll({nModule, srcDir}){
35
+ fs.readdirSync(srcDir).forEach((file) => {
36
+ let fromPath = path.join(srcDir, file);
37
+ if (!tryFile(fromPath)) { return; }
38
+ this.register({nModule, fromPath});
39
+ });
40
+ }
41
+
42
+ register({nModule, fromPath}){
43
+ const Form = notModuleRegistratorForms.openFile(fromPath);
44
+ const parts = path.parse(fromPath);
45
+ nModule.setForm(parts.name, new Form());
46
+ }
47
+
48
+ };
@@ -5,6 +5,7 @@
5
5
 
6
6
  const
7
7
  notModuleRegistratorFields = require('./fields'),
8
+ notModuleRegistratorForms = require('./forms'),
8
9
  notModuleRegistratorModels = require('./models'),
9
10
  notModuleRegistratorLogics = require('./logics'),
10
11
  notModuleRegistratorRoutes = require('./routes'),
@@ -13,6 +14,7 @@ const
13
14
 
14
15
  const DEFAULT_REGISTRATORS = [
15
16
  notModuleRegistratorFields,
17
+ notModuleRegistratorForms,
16
18
  notModuleRegistratorModels,
17
19
  notModuleRegistratorLogics,
18
20
  notModuleRegistratorRoutes,
@@ -133,11 +133,41 @@ class notRoute{
133
133
  );
134
134
  }
135
135
 
136
+ extractReturn(notRouteData){
137
+ if(objHas(notRouteData.rule, 'return')){
138
+ return [...notRouteData.rule.return];
139
+ }else if(objHas(notRouteData.actionData, 'return')){
140
+ return [...notRouteData.actionData.return];
141
+ }else{
142
+ return undefined;
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Removes fields from result object acctoding to actionData.return array
148
+ * if presented
149
+ * @param {ExpressRequest} req request object
150
+ * @param {object} result result returned by main action processor
151
+ */
152
+ filterResultByReturnRule(req, result){
153
+ const returnList = this.extractReturn(req.notRouteData);
154
+ if(result && (typeof result === 'object') && returnList && Array.isArray(returnList)){
155
+ let presented = Object.keys(result);
156
+ presented.forEach(fieldName => {
157
+ if(!returnList.includes(fieldName)){
158
+ delete result[fieldName];
159
+ }
160
+ });
161
+ }
162
+ }
163
+
136
164
  async executeRoute(modRoute, actionName, {req, res, next}){
137
165
  //waiting preparation
138
166
  let prepared = await this.executeFunction(modRoute, CONST_BEFORE_ACTION, [req, res, next]);
139
167
  //waiting results
140
168
  let result = await this.executeFunction(modRoute, actionName, [req, res, next, prepared]);
169
+ //filter result IF actionData.return specified
170
+ this.filterResultByReturnRule(req, result);
141
171
  //run after with results, continue without waiting when it finished
142
172
  return this.executeFunction(modRoute, CONST_AFTER_ACTION, [req, res, next, result]);
143
173
  }
@@ -17,7 +17,7 @@ module.exports = ({expect})=>{
17
17
  json(dat){
18
18
  expect(dat).to.be.deep.equal({
19
19
  status: 'error',
20
- error: 'Serious generic error'
20
+ message: 'Serious generic error'
21
21
  });
22
22
  done();
23
23
  }
@@ -120,7 +120,7 @@ module.exports = ({expect})=>{
120
120
  json(dat){
121
121
  expect(dat).to.be.deep.equal({
122
122
  status: 'error',
123
- error: 'Serious not error request',
123
+ message: 'Serious not error request',
124
124
  errors: {field: ['name']},
125
125
  });
126
126
  done();
@@ -142,8 +142,10 @@ module.exports = ({expect})=>{
142
142
 
143
143
 
144
144
  describe('run', ()=>{
145
- it('', async ()=>{
146
- const fakeServer = { sarver: true};
145
+ it('run', async ()=>{
146
+ const fakeServer = { sarver: true, use(fn){
147
+ expect(typeof fn).to.be.equal('function');
148
+ }};
147
149
  const fakeApp = {
148
150
  report(){},
149
151
  use(fn){
@@ -22,7 +22,7 @@ module.exports = (input)=>{
22
22
  notModuleRegistrator.setRegistrators(regs);
23
23
  expect(notModuleRegistrator.registrators.length).to.be.equal(0);
24
24
  notModuleRegistrator.resetRegistrators();
25
- expect(notModuleRegistrator.registrators.length).to.be.equal(5);
25
+ expect(notModuleRegistrator.registrators.length).to.be.equal(6);
26
26
  });
27
27
 
28
28
  it('with paths', ()=>{
package/test/notDomain.js CHANGED
@@ -184,7 +184,7 @@ describe('notDomain', function() {
184
184
  it('model name short', function() {
185
185
  const route = 'Jungle';
186
186
  const ctx = {
187
- getByShortPath(){return null;}
187
+ getByPath(){return null;}
188
188
  };
189
189
  const res = notDomain.prototype.getModel.call(ctx, route);
190
190
  expect(res).to.be.null;
@@ -194,7 +194,7 @@ describe('notDomain', function() {
194
194
  const id = Math.random();
195
195
  const route = 'module//Jungle';
196
196
  const ctx = {
197
- getByFullPath(){return id;}
197
+ getByPath(){return id;}
198
198
  };
199
199
  const res = notDomain.prototype.getModel.call(ctx, route);
200
200
  expect(res).to.be.equal(id);
@@ -206,7 +206,7 @@ describe('notDomain', function() {
206
206
  const id = Math.random();
207
207
  const route = 'Jungle';
208
208
  const ctx = {
209
- getByShortPath(){return id;}
209
+ getByPath(){return id;}
210
210
  };
211
211
  const res = notDomain.prototype.getModelFile.call(ctx, route);
212
212
  expect(res).to.be.equal(id);
@@ -216,7 +216,7 @@ describe('notDomain', function() {
216
216
  const id = Math.random();
217
217
  const route = 'module//Jungle';
218
218
  const ctx = {
219
- getByFullPath(){return id;}
219
+ getByPath(){return id;}
220
220
  };
221
221
  const res = notDomain.prototype.getModelFile.call(ctx, route);
222
222
  expect(res).to.be.equal(id);
@@ -229,7 +229,7 @@ describe('notDomain', function() {
229
229
  const id = Math.random();
230
230
  const route = 'Jungle';
231
231
  const ctx = {
232
- getByShortPath(){return id;}
232
+ getByPath(){return id;}
233
233
  };
234
234
  const res = notDomain.prototype.getModelSchema.call(ctx, route);
235
235
  expect(res).to.be.equal(id);
@@ -239,7 +239,7 @@ describe('notDomain', function() {
239
239
  const id = Math.random();
240
240
  const route = 'module//Jungle';
241
241
  const ctx = {
242
- getByFullPath(){return id;}
242
+ getByPath(){return id;}
243
243
  };
244
244
  const res = notDomain.prototype.getModelSchema.call(ctx, route);
245
245
  expect(res).to.be.equal(id);
@@ -252,7 +252,7 @@ describe('notDomain', function() {
252
252
  const id = Math.random();
253
253
  const route = 'Jungle';
254
254
  const ctx = {
255
- getByShortPath(){return id;}
255
+ getByPath(){return id;}
256
256
  };
257
257
  const res = notDomain.prototype.getLogic.call(ctx, route);
258
258
  expect(res).to.be.equal(id);
@@ -262,7 +262,7 @@ describe('notDomain', function() {
262
262
  const id = Math.random();
263
263
  const route = 'module//Jungle';
264
264
  const ctx = {
265
- getByFullPath(){return id;}
265
+ getByPath(){return id;}
266
266
  };
267
267
  const res = notDomain.prototype.getLogic.call(ctx, route);
268
268
  expect(res).to.be.equal(id);
@@ -274,7 +274,7 @@ describe('notDomain', function() {
274
274
  const id = Math.random();
275
275
  const route = 'Jungle';
276
276
  const ctx = {
277
- getByShortPath(){return id;}
277
+ getByPath(){return id;}
278
278
  };
279
279
  const res = notDomain.prototype.getLogicFile.call(ctx, route);
280
280
  expect(res).to.be.equal(id);
@@ -284,7 +284,7 @@ describe('notDomain', function() {
284
284
  const id = Math.random();
285
285
  const route = 'module//Jungle';
286
286
  const ctx = {
287
- getByFullPath(){return id;}
287
+ getByPath(){return id;}
288
288
  };
289
289
  const res = notDomain.prototype.getLogicFile.call(ctx, route);
290
290
  expect(res).to.be.equal(id);
@@ -711,6 +711,10 @@ describe('notDomain', function() {
711
711
  actions: {
712
712
  count: 2,
713
713
  list: ['user//list', 'role//list']
714
+ },
715
+ forms: {
716
+ count: 3,
717
+ list: ['user//listAll', 'user//list', 'role//list']
714
718
  }
715
719
  };
716
720
  }
@@ -737,10 +741,18 @@ describe('notDomain', function() {
737
741
  actions: {
738
742
  count: 2,
739
743
  list: ['user//list', 'role//list']
744
+ },
745
+ forms: {
746
+ count: 3,
747
+ list: ['user//listAll', 'user//list', 'role//list']
740
748
  }
741
749
  }
742
750
  }
743
751
  },
752
+ forms: {
753
+ count: 3,
754
+ list: ['not-user//user//listAll', 'not-user//user//list', 'not-user//role//list']
755
+ },
744
756
  routes: {
745
757
  count: 2,
746
758
  list: ["not-user//user","not-user//role"]
package/test/notModule.js CHANGED
@@ -468,6 +468,9 @@ describe('notModule', function() {
468
468
  routes: {
469
469
  userRoute: {}
470
470
  },
471
+ forms: {
472
+ 'route//action':{}
473
+ },
471
474
  getModelsStatuses() {
472
475
  return {
473
476
  user: {
@@ -505,6 +508,10 @@ describe('notModule', function() {
505
508
  actions: {
506
509
  count: 1,
507
510
  list: ['route//action']
511
+ },
512
+ forms: {
513
+ count: 1,
514
+ list: ['route//action']
508
515
  }
509
516
  });
510
517
  });