not-node 5.1.38 → 5.1.41

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": "5.1.38",
3
+ "version": "5.1.41",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5,4 +5,8 @@ module.exports = {
5
5
  label: "not-node:field_ID_label",
6
6
  readonly: true,
7
7
  },
8
+ model: {
9
+ type: Number,
10
+ required: true,
11
+ },
8
12
  };
package/src/domain.js CHANGED
@@ -105,7 +105,7 @@ class notDomain extends EventEmitter {
105
105
  notApp: this,
106
106
  fields: this.#options.fields,
107
107
  });
108
- this.importModule(mod, moduleName || mod.getName());
108
+ this.importModule(mod, mod.getName() || moduleName);
109
109
  return this;
110
110
  }
111
111
 
@@ -63,7 +63,7 @@ module.exports.initSchemaField = (
63
63
  let proto = findFieldPrototype(app, srcName, type);
64
64
  if (!proto) {
65
65
  error(
66
- `field ${moduleName}//${destName} prototype ${srcName} of ${type} type is not found`
66
+ `${type} field ${moduleName}//${destName} prototype ${srcName} is not found`
67
67
  );
68
68
  }
69
69
  let schemaFieldValue = Object.assign({}, clone(proto), mutation);
@@ -102,7 +102,7 @@ const parseFieldDescription = (field) => {
102
102
  } else {
103
103
  if (field.includes(DEFAULT_SPLITER)) {
104
104
  //form 5
105
- destName = field.split(DEFAULT_SPLITER)[0];
105
+ destName = field.split(DEFAULT_SPLITER)[1];
106
106
  srcName = field;
107
107
  } else {
108
108
  destName = srcName = field; //form 1
package/src/form/form.js CHANGED
@@ -108,7 +108,7 @@ class Form {
108
108
 
109
109
  extractRequestEnvs(req) {
110
110
  const result = {};
111
- Array.values(this.#ENV_EXTRACTORS).forEach((extractor) => {
111
+ Object.values(this.#ENV_EXTRACTORS).forEach((extractor) => {
112
112
  const extracted = extractor(this, req);
113
113
  if (
114
114
  extracted &&
@@ -208,11 +208,16 @@ class notModule {
208
208
  }
209
209
 
210
210
  getStatus() {
211
+ const fieldsList = Object.keys(this.fields);
211
212
  const formsList = Object.keys(this.forms);
212
213
  const modelsList = Object.keys(this.models);
213
214
  const routesList = Object.keys(this.routes);
214
215
  const actionsList = this.getActionsList();
215
216
  return {
217
+ fields: {
218
+ count: fieldsList.length,
219
+ list: fieldsList,
220
+ },
216
221
  forms: {
217
222
  count: formsList.length,
218
223
  list: formsList,
@@ -373,6 +378,19 @@ class notModule {
373
378
  this.routesWS[collectionType][collectionName][endPointType] = {};
374
379
  }
375
380
  }
381
+
382
+ printOutModuleContent() {
383
+ const status = this.getStatus();
384
+ Object.keys(status).forEach((contentType) => {
385
+ if (status[contentType].count) {
386
+ log.log(
387
+ `${this.getName()} ${contentType}(${
388
+ status[contentType].count
389
+ }): ${status[contentType].list.join(", ")}`
390
+ );
391
+ }
392
+ });
393
+ }
376
394
  }
377
395
 
378
396
  module.exports = notModule;