not-node 6.3.94 → 6.3.96

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": "not-node",
3
- "version": "6.3.94",
3
+ "version": "6.3.96",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,5 +8,6 @@ module.exports = {
8
8
  model: {
9
9
  type: Number,
10
10
  required: true,
11
+ safe: require("../safety.protocols").ownerRootAdmin,
11
12
  },
12
13
  };
@@ -5,4 +5,7 @@ module.exports = {
5
5
  label: "_id",
6
6
  readonly: true,
7
7
  },
8
+ model: {
9
+ safe: require("../safety.protocols").systemManageable,
10
+ },
8
11
  };
@@ -6,6 +6,7 @@ module.exports = {
6
6
  model: {
7
7
  type: Boolean,
8
8
  default: false,
9
- required: true
9
+ required: true,
10
+ safe: require("../safety.protocols").ownerRootAdmin,
10
11
  },
11
12
  };
@@ -6,6 +6,7 @@ module.exports = {
6
6
  model: {
7
7
  type: Boolean,
8
8
  default: false,
9
- required: true
9
+ required: true,
10
+ safe: require("../safety.protocols").ownerRootAdmin,
10
11
  },
11
12
  };
@@ -7,6 +7,7 @@ module.exports = {
7
7
  model: {
8
8
  type: String,
9
9
  required: true,
10
- transformers: ['xss']
10
+ transformers: ["xss"],
11
+ safe: require("../safety.protocols").ownerRootAdmin,
11
12
  },
12
13
  };
@@ -11,9 +11,6 @@ module.exports = {
11
11
  default: Date.now,
12
12
  searchable: true,
13
13
  sortable: true,
14
- safe: {
15
- create: ["@system"],
16
- read: ["@owner", "root", "admin"],
17
- },
14
+ safe: require("../safety.protocols").systemManageable,
18
15
  },
19
16
  };
@@ -7,5 +7,6 @@ module.exports = {
7
7
  type: Boolean,
8
8
  default: false,
9
9
  required: true,
10
+ safe: require("../safety.protocols").ownerRootAdmin,
10
11
  },
11
12
  };
@@ -9,6 +9,7 @@ module.exports = {
9
9
  required: true,
10
10
  searchable: true,
11
11
  sortable: true,
12
- transformers: ['xss']
12
+ transformers: ["xss"],
13
+ safe: require("../safety.protocols").ownerRootAdmin,
13
14
  },
14
15
  };
@@ -7,6 +7,7 @@ module.exports = {
7
7
  model: {
8
8
  type: String,
9
9
  required: true,
10
- transformers: ['xss']
10
+ transformers: ["xss"],
11
+ safe: require("../safety.protocols").ownerRootAdmin,
11
12
  },
12
13
  };
@@ -7,5 +7,6 @@ module.exports = {
7
7
  type: Boolean,
8
8
  default: true,
9
9
  required: true,
10
+ safe: require("../safety.protocols").ownerRootAdmin,
10
11
  },
11
12
  };
@@ -10,9 +10,6 @@ module.exports = {
10
10
  required: false,
11
11
  searchable: true,
12
12
  sortable: true,
13
- safe: {
14
- update: ["@owner", "root", "admin"],
15
- read: ["@owner", "root", "admin"],
16
- },
13
+ safe: require("../safety.protocols").ownerRootAdmin,
17
14
  },
18
15
  };
@@ -9,5 +9,6 @@ module.exports = {
9
9
  required: true,
10
10
  searchable: true,
11
11
  sortable: true,
12
+ safe: require("../safety.protocols").ownerRootAdmin,
12
13
  },
13
14
  };
@@ -4,9 +4,6 @@ module.exports = {
4
4
  model: {
5
5
  type: Schema.Types.Mixed,
6
6
  required: true,
7
- safe: {
8
- update: ["@owner", "root", "admin"],
9
- read: ["@owner", "root", "admin"],
10
- },
7
+ safe: require("../safety.protocols").ownerRootAdmin,
11
8
  },
12
9
  };
@@ -8,6 +8,7 @@ module.exports = {
8
8
  type: String,
9
9
  searchable: true,
10
10
  required: true,
11
- transformers: ['xss']
11
+ safe: require("../safety.protocols").ownerRootAdmin,
12
+ transformers: ["xss"],
12
13
  },
13
14
  };
@@ -5,9 +5,7 @@ module.exports = {
5
5
  type: ObjectId,
6
6
  required: true,
7
7
  default: {},
8
- safe: {
9
- update: ["@owner", "root", "admin"],
10
- read: ["@owner", "root", "admin"],
11
- },
8
+ transformers: ["xss", "__CLEAR__"],
9
+ safe: require("../safety.protocols").ownerRootAdmin,
12
10
  },
13
11
  };
@@ -1,13 +1,18 @@
1
1
  const Schema = require("mongoose").Schema;
2
+ const notFieldsFilter = require("../../fields/filter");
3
+ const { ownerRootAdmin } = require("../safety.protocols");
4
+ const { ACTION_SIGNATURES } = require("../../auth/const");
5
+
2
6
  module.exports = {
3
7
  model: {
4
8
  type: Schema.Types.ObjectId,
5
9
  refPath: "ownerModel",
6
10
  required: false,
7
- safe: {
8
- update: ["root", "admin"],
9
- read: ["@owner", "root", "admin"],
10
- },
11
+ safe: notFieldsFilter.mergeSafetyProtocols(ownerRootAdmin, {
12
+ [ACTION_SIGNATURES.CREATE]: ["-@owner"],
13
+ [ACTION_SIGNATURES.UPDATE]: ["-@owner"],
14
+ [ACTION_SIGNATURES.DELETE]: ["-@owner"],
15
+ }),
11
16
  },
12
17
  ui: {
13
18
  component: "UIHidden",
@@ -2,11 +2,8 @@ module.exports = {
2
2
  model: {
3
3
  type: String,
4
4
  required: false,
5
- safe: {
6
- update: ["@owner", "root", "admin"],
7
- read: ["@owner", "root", "admin"],
8
- },
9
- transformers: ['xss']
5
+ safe: require("../safety.protocols").ownerRootAdmin,
6
+ transformers: ["xss"],
10
7
  },
11
8
  ui: {
12
9
  component: "UIHidden",
@@ -9,5 +9,6 @@ module.exports = {
9
9
  required: true,
10
10
  searchable: true,
11
11
  sortable: true,
12
+ safe: require("../safety.protocols").ownerRootAdmin,
12
13
  },
13
14
  };
@@ -5,9 +5,6 @@ module.exports = {
5
5
  type: Schema.Types.Mixed,
6
6
  required: true,
7
7
  default: {},
8
- safe: {
9
- update: ["@owner", "root", "admin"],
10
- read: ["@owner", "root", "admin"],
11
- },
8
+ safe: require("../safety.protocols").ownerRootAdmin,
12
9
  },
13
10
  };
@@ -8,6 +8,7 @@ module.exports = {
8
8
  type: String,
9
9
  searchable: true,
10
10
  required: true,
11
- transformers: ['xss']
11
+ transformers: ["xss"],
12
+ safe: require("../safety.protocols").ownerRootAdmin,
12
13
  },
13
14
  };
@@ -9,5 +9,6 @@ module.exports = {
9
9
  required: true,
10
10
  searchable: true,
11
11
  sortable: true,
12
+ safe: require("../safety.protocols").ownerRootAdmin,
12
13
  },
13
14
  };
@@ -7,6 +7,7 @@ module.exports = {
7
7
  model: {
8
8
  type: String,
9
9
  required: true,
10
- transformers: ['xss']
10
+ transformers: ["xss"],
11
+ safe: require("../safety.protocols").ownerRootAdmin,
11
12
  },
12
13
  };
@@ -9,10 +9,7 @@ module.exports = {
9
9
  required: true,
10
10
  searchable: true,
11
11
  sortable: true,
12
- safe: {
13
- update: ["@owner", "root", "admin"],
14
- read: ["@owner", "root", "admin"],
15
- },
16
- transformers: ['xss']
12
+ safe: require("../safety.protocols").ownerRootAdmin,
13
+ transformers: ["xss"],
17
14
  },
18
15
  };
@@ -11,9 +11,6 @@ module.exports = {
11
11
  type: Date,
12
12
  required: true,
13
13
  default: Date.now,
14
- safe: {
15
- update: ["@owner", "root", "admin"],
16
- read: ["@owner", "root", "admin"],
17
- },
14
+ safe: require("../safety.protocols").ownerRootAdmin,
18
15
  },
19
16
  };
@@ -10,5 +10,6 @@ module.exports = {
10
10
  type: Schema.Types.ObjectId,
11
11
  ref: "User",
12
12
  required: false,
13
+ safe: require("../safety.protocols").ownerRootAdmin,
13
14
  },
14
15
  };
@@ -9,6 +9,7 @@ module.exports = {
9
9
  type: String,
10
10
  searchable: true,
11
11
  required: true,
12
- transformers: ['xss']
12
+ transformers: ["xss"],
13
+ safe: require("../safety.protocols").ownerRootAdmin,
13
14
  },
14
15
  };
@@ -9,5 +9,6 @@ module.exports = {
9
9
  required: true,
10
10
  searchable: true,
11
11
  sortable: true,
12
+ safe: require("../safety.protocols").ownerRootAdmin,
12
13
  },
13
14
  };
@@ -0,0 +1,22 @@
1
+ const { ACTION_SIGNATURES } = require("../auth/const");
2
+
3
+ module.exports.ownerRootAdmin = Object.freeze({
4
+ [ACTION_SIGNATURES.CREATE]: ["@owner", "root", "admin"],
5
+ [ACTION_SIGNATURES.READ]: ["@owner", "root", "admin"],
6
+ [ACTION_SIGNATURES.UPDATE]: ["@owner", "root", "admin"],
7
+ [ACTION_SIGNATURES.DELETE]: ["@owner", "root", "admin"],
8
+ });
9
+
10
+ module.exports.systemManageable = Object.freeze({
11
+ [ACTION_SIGNATURES.CREATE]: ["@system"],
12
+ [ACTION_SIGNATURES.READ]: ["@system", "@owner", "root", "admin"],
13
+ [ACTION_SIGNATURES.UPDATE]: ["@system"],
14
+ [ACTION_SIGNATURES.DELETE]: ["@system"],
15
+ });
16
+
17
+ module.exports.publicReadable = Object.freeze({
18
+ [ACTION_SIGNATURES.CREATE]: [],
19
+ [ACTION_SIGNATURES.READ]: ["@*"],
20
+ [ACTION_SIGNATURES.UPDATE]: [],
21
+ [ACTION_SIGNATURES.DELETE]: [],
22
+ });
@@ -5,7 +5,10 @@ const {
5
5
  isNotEmptyString,
6
6
  } = require("../common");
7
7
  const { getSafeFieldsForRoleAction } = require("../auth/fields");
8
- const { DEFAULT_USER_ROLE_FOR_GUEST } = require("../auth/const");
8
+ const {
9
+ DEFAULT_USER_ROLE_FOR_GUEST,
10
+ ACTION_SIGNATURES,
11
+ } = require("../auth/const");
9
12
  /**
10
13
  * notFieldsFilter.filter(fields, getApp().getModelSchema(MODEL_NAME), {action});
11
14
  *
@@ -125,9 +128,14 @@ class notFieldsFilter {
125
128
  system
126
129
  );
127
130
  },
128
- [SPECIAL_SET_UNSAFE]: ["salt", "password"],
131
+ [SPECIAL_SET_UNSAFE]: ["salt", "password", "session"],
129
132
  [SPECIAL_SET_TIMESTAMPS]: ["createdAt", "updatedAt"],
130
- [SPECIAL_SET_OWNAGE]: ["owner", "ownerId", "ownerModel"],
133
+ [SPECIAL_SET_OWNAGE]: (schema) => {
134
+ const inSchema = Object.keys(schema);
135
+ return ["owner", "ownerId", "ownerModel"].filter((itm) =>
136
+ inSchema.includes(itm)
137
+ );
138
+ },
131
139
  [SPECIAL_SET_VERSIONING]: [
132
140
  "__version",
133
141
  "__versions",
@@ -302,6 +310,10 @@ class notFieldsFilter {
302
310
  return result;
303
311
  }
304
312
 
313
+ static clearFromDuplicated(fields) {
314
+ return [...new Set(fields)];
315
+ }
316
+
305
317
  /**
306
318
  * Creates plain fields list from fields list with fields, synonyms, fields sets
307
319
  * and exlude operations
@@ -320,7 +332,74 @@ class notFieldsFilter {
320
332
  static filter(fieldsSet, schema = {}, mods = { action: undefined }) {
321
333
  const fields = [...fieldsSet];
322
334
  this.specialsToPlain(fields, schema, mods);
323
- return this.removeExcludedFields(fields);
335
+ return this.clearFromDuplicated(this.removeExcludedFields(fields));
336
+ }
337
+
338
+ /**
339
+ *
340
+ *
341
+ * @static
342
+ * @param {Object} base
343
+ * @param {Object} addition
344
+ * @return {Object}
345
+ * @memberof notFieldsFilter
346
+ */
347
+ static mergeSafetyProtocols(base, addition) {
348
+ const result = {
349
+ [ACTION_SIGNATURES.CREATE]: [
350
+ ...(base[ACTION_SIGNATURES.CREATE] || []),
351
+ ],
352
+ [ACTION_SIGNATURES.READ]: [...(base[ACTION_SIGNATURES.READ] || [])],
353
+ [ACTION_SIGNATURES.UPDATE]: [
354
+ ...(base[ACTION_SIGNATURES.UPDATE] || []),
355
+ ],
356
+ [ACTION_SIGNATURES.DELETE]: [
357
+ ...(base[ACTION_SIGNATURES.DELETE] || []),
358
+ ],
359
+ };
360
+ for (const type of Object.keys(addition)) {
361
+ if (Array.isArray(addition[type])) {
362
+ addition[type].forEach((rule) => {
363
+ if (this.isExcludeOperation(rule)) {
364
+ const ruleToDelete = this.unmarkFieldToExlude(rule);
365
+ if (result[type].includes(ruleToDelete)) {
366
+ result[type].splice(
367
+ result[type].indexOf(ruleToDelete),
368
+ 1
369
+ );
370
+ }
371
+ } else {
372
+ if (!result[type].includes(rule)) {
373
+ result[type].push(rule);
374
+ }
375
+ }
376
+ });
377
+ }
378
+ }
379
+ return Object.freeze(result);
380
+ }
381
+
382
+ static initSafetyProtocol(
383
+ create = [],
384
+ read = [],
385
+ update = [],
386
+ del = [],
387
+ all = []
388
+ ) {
389
+ return this.mergeSafetyProtocols(
390
+ {
391
+ [ACTION_SIGNATURES.CREATE]: [...all],
392
+ [ACTION_SIGNATURES.READ]: [...all],
393
+ [ACTION_SIGNATURES.UPDATE]: [...all],
394
+ [ACTION_SIGNATURES.DELETE]: [...all],
395
+ },
396
+ {
397
+ [ACTION_SIGNATURES.CREATE]: [...create],
398
+ [ACTION_SIGNATURES.READ]: [...read],
399
+ [ACTION_SIGNATURES.UPDATE]: [...update],
400
+ [ACTION_SIGNATURES.DELETE]: [...del],
401
+ }
402
+ );
324
403
  }
325
404
  }
326
405
 
@@ -0,0 +1,3 @@
1
+ module.exports = (input) => {
2
+ return input === "__CLEAR__" ? undefined : input;
3
+ };
@@ -6,4 +6,5 @@ module.exports = {
6
6
  stringToJSON: require("./stringToJSON.js"),
7
7
  xss: require("./xss.js"),
8
8
  boolean: require("./boolean.js"),
9
+ __CLEAR__: require("./__CLEAR__.js"),
9
10
  };
package/test/filter.js CHANGED
@@ -1,7 +1,9 @@
1
1
  const mongoose = require("mongoose");
2
2
  const Schema = mongoose.Schema;
3
3
  const expect = require("chai").expect,
4
- notFieldsFilter = require("../src/fields/filter");
4
+ notFieldsFilter = require("../src/fields/filter"),
5
+ { ACTION_SIGNATURES } = require("../src/auth/const"),
6
+ safetyProtocols = require("../src/core/safety.protocols");
5
7
 
6
8
  const SCHEMA = () => {
7
9
  return {
@@ -277,10 +279,101 @@ describe("Fields/notFieldsFilter", function () {
277
279
  expect(result).to.be.deep.equal([
278
280
  "id",
279
281
  "name",
280
- "name",
281
282
  "username",
282
283
  "country",
283
284
  ]);
284
285
  });
285
286
  });
287
+
288
+ describe("mergeSafetyProtocols", () => {
289
+ it("ownerRootAdmin + publicReadable", () => {
290
+ const result = notFieldsFilter.mergeSafetyProtocols(
291
+ safetyProtocols.ownerRootAdmin,
292
+ safetyProtocols.publicReadable
293
+ );
294
+ expect(result).to.be.deep.equal({
295
+ [ACTION_SIGNATURES.CREATE]: ["@owner", "root", "admin"],
296
+ [ACTION_SIGNATURES.READ]: ["@owner", "root", "admin", "@*"],
297
+ [ACTION_SIGNATURES.UPDATE]: ["@owner", "root", "admin"],
298
+ [ACTION_SIGNATURES.DELETE]: ["@owner", "root", "admin"],
299
+ });
300
+ });
301
+
302
+ it("ownerRootAdmin - @owner", () => {
303
+ const result = notFieldsFilter.mergeSafetyProtocols(
304
+ safetyProtocols.ownerRootAdmin,
305
+ {
306
+ [ACTION_SIGNATURES.CREATE]: ["-@owner"],
307
+ [ACTION_SIGNATURES.READ]: ["-@owner"],
308
+ [ACTION_SIGNATURES.UPDATE]: ["-@owner"],
309
+ [ACTION_SIGNATURES.DELETE]: ["-@owner"],
310
+ }
311
+ );
312
+ expect(result).to.be.deep.equal({
313
+ [ACTION_SIGNATURES.CREATE]: ["root", "admin"],
314
+ [ACTION_SIGNATURES.READ]: ["root", "admin"],
315
+ [ACTION_SIGNATURES.UPDATE]: ["root", "admin"],
316
+ [ACTION_SIGNATURES.DELETE]: ["root", "admin"],
317
+ });
318
+ });
319
+ });
320
+
321
+ describe("initSafetyProtocol", () => {
322
+ it("empty", () => {
323
+ const result = notFieldsFilter.initSafetyProtocol();
324
+ expect(result).to.be.deep.equal({
325
+ [ACTION_SIGNATURES.CREATE]: [],
326
+ [ACTION_SIGNATURES.READ]: [],
327
+ [ACTION_SIGNATURES.UPDATE]: [],
328
+ [ACTION_SIGNATURES.DELETE]: [],
329
+ });
330
+ });
331
+
332
+ it("all = user", () => {
333
+ const result = notFieldsFilter.initSafetyProtocol(
334
+ undefined,
335
+ undefined,
336
+ undefined,
337
+ undefined,
338
+ ["user"]
339
+ );
340
+ expect(result).to.be.deep.equal({
341
+ [ACTION_SIGNATURES.CREATE]: ["user"],
342
+ [ACTION_SIGNATURES.READ]: ["user"],
343
+ [ACTION_SIGNATURES.UPDATE]: ["user"],
344
+ [ACTION_SIGNATURES.DELETE]: ["user"],
345
+ });
346
+ });
347
+
348
+ it("CRUD - @owner", () => {
349
+ const result = notFieldsFilter.initSafetyProtocol(
350
+ ["@owner"],
351
+ ["@owner"],
352
+ ["@owner"],
353
+ ["@owner"]
354
+ );
355
+ expect(result).to.be.deep.equal({
356
+ [ACTION_SIGNATURES.CREATE]: ["@owner"],
357
+ [ACTION_SIGNATURES.READ]: ["@owner"],
358
+ [ACTION_SIGNATURES.UPDATE]: ["@owner"],
359
+ [ACTION_SIGNATURES.DELETE]: ["@owner"],
360
+ });
361
+ });
362
+
363
+ it("D - -@owner, ALL - @owner, root, admin", () => {
364
+ const result = notFieldsFilter.initSafetyProtocol(
365
+ undefined,
366
+ undefined,
367
+ undefined,
368
+ ["-@owner"],
369
+ ["@owner", "root", "admin"]
370
+ );
371
+ expect(result).to.be.deep.equal({
372
+ [ACTION_SIGNATURES.CREATE]: ["@owner", "root", "admin"],
373
+ [ACTION_SIGNATURES.READ]: ["@owner", "root", "admin"],
374
+ [ACTION_SIGNATURES.UPDATE]: ["@owner", "root", "admin"],
375
+ [ACTION_SIGNATURES.DELETE]: ["root", "admin"],
376
+ });
377
+ });
378
+ });
286
379
  });
@@ -6,29 +6,29 @@ import CRUDActionList from "not-bulma/src/frame/crud/actions/list";
6
6
  const { notCRUD } = Frame;
7
7
 
8
8
  const MODEL_NAME = "<%- ModelName %>";
9
- const modelName = notCommon.lowerFirstLetter(MODEL_NAME);
9
+ const modelName = notCommon.lowerFirstLetter(MODEL_NAME);
10
10
 
11
- const LABELS = {
11
+ const LABELS = {
12
12
  plural: `${MODULE_NAME}:${modelName}_label_plural`,
13
13
  single: `${MODULE_NAME}:${modelName}_label_single`,
14
- };
14
+ };
15
15
 
16
- Object.freeze(LABELS);
16
+ Object.freeze(LABELS);
17
17
 
18
- class nc<%- ModelName %>Common extends notCRUD {
19
- static get MODULE_NAME(){
18
+ class nc<%- ModelName %>Common extends notCRUD {
19
+ static get MODULE_NAME(){
20
20
  return MODULE_NAME;
21
- }
21
+ }
22
22
 
23
- static get MODEL_NAME(){
23
+ static get MODEL_NAME(){
24
24
  return MODEL_NAME;
25
- }
25
+ }
26
26
 
27
- static get LABELS(){
27
+ static get LABELS(){
28
28
  return LABELS;
29
- }
29
+ }
30
30
 
31
- constructor(app, params) {
31
+ constructor(app, params) {
32
32
  super(app, `${MODULE_NAME}.${MODEL_NAME}`);
33
33
  this.setModuleName(MODULE_NAME);
34
34
  this.setModelName(MODEL_NAME);
@@ -36,59 +36,61 @@ const MODEL_NAME = "<%- ModelName %>";
36
36
  this.setValidators(Validators);
37
37
  this.setOptions("params", params);
38
38
  this.setOptions("list", {
39
- interface: {
40
- combined: true,
41
- factory: this.make.<%- modelName %>,
39
+ interface: {
40
+ combined: true,
41
+ factory: this.make.<%- modelName %>,
42
42
  },
43
43
  endless: false,
44
44
  preload: {},
45
45
  sorter: {
46
- id: -1,
46
+ id: -1,
47
47
  },
48
48
  showSearch: true,
49
49
  idField: "_id",
50
50
  fields: [
51
- <% if (increment) { %>
51
+ <% if (increment) { %>
52
52
  {
53
- path: ":<%- modelName %>ID",
53
+ path: ":<%- modelName %>ID",
54
54
  title: "ID",
55
55
  searchable: true,
56
56
  sortable: true,
57
- },
58
- <% } %>
59
- <% for (let fieldName of fields){ %>
60
- {
61
- path: ":<%- fieldName[0] %>",
62
- title: `${MODULE_NAME}:<%- `${modelName}_field_${fieldName[0]}_label` %>`,
63
- searchable: true,
64
- sortable: true,
65
- },
66
- <% } %>
67
- {
68
- path: ":_id",
69
- title: "Действия",
70
- type: "button",
71
- preprocessor: (value) => CRUDActionList.createActionsButtons(this, value),
72
- },
73
- ],
74
- });
57
+ },
58
+ <% } %>
59
+ <% for (let fieldName of fields){ %>
60
+ {
61
+ path: ":<%- fieldName[0] %>",
62
+ title: `${MODULE_NAME}:<%- `${modelName}_field_${fieldName[0]}_label` %>`,
63
+ searchable: true,
64
+ sortable: true,
65
+ },
66
+ <% } %>
67
+ {
68
+ path: ":_id",
69
+ title: "Действия",
70
+ type: "button",
71
+ preprocessor: (value) => CRUDActionList.createActionsButtons(this, value),
72
+ },
73
+ ],
74
+ });
75
+
76
+ this.start();
77
+ return this;
78
+ }
79
+
80
+ createDefault() {
81
+ let newRecord = this.getModel({
82
+ <% for (let fieldName of fields){ %><%- fieldName[0] %>: undefined,
83
+ <% } %>
84
+ });
85
+ return newRecord;
86
+ }
75
87
 
76
- this.start();
77
- return this;
78
- }
88
+ static getMenu(){
89
+ return notCRUD.getCommonMenu(nc<%- ModelName %>Common);
90
+ }
79
91
 
80
- createDefault() {
81
- let newRecord = this.getModel({
82
- <% for (let fieldName of fields){ %><%- fieldName[0] %>: undefined,
83
- <% } %>
84
- });
85
- return newRecord;
86
- }
92
+ }
87
93
 
88
- static getMenu(){
89
- return notCRUD.getCommonMenu(nc<%- ModelName %>Common);
90
- }
94
+ export default nc<%- ModelName %>Common;
91
95
 
92
- }
93
96
 
94
- export default nc<%- ModelName %>Common;