not-node 6.3.43 → 6.3.46

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.43",
3
+ "version": "6.3.46",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ ui: {
3
+ component: "UISwitch",
4
+ label: "not-node:field_boolean_label",
5
+ },
6
+ model: {
7
+ type: Boolean,
8
+ default: false,
9
+ required: true,
10
+ },
11
+ };
@@ -2,13 +2,19 @@
2
2
  const Form = require("../form/form");
3
3
 
4
4
  //form
5
- const FIELDS = [["identity", "not-node//requiredObject"]];
5
+ const STANDART_FIELDS = [["identity", "not-node//identity"]];
6
6
 
7
- module.exports = ({ MODULE_NAME, MODEL_NAME, actionName }) => {
7
+ module.exports = ({ MODULE_NAME, MODEL_NAME, actionName, FIELDS = [] }) => {
8
8
  const FORM_NAME = Form.createName(MODULE_NAME, MODEL_NAME, actionName);
9
9
  return class extends Form {
10
10
  constructor(params) {
11
- super({ ...params, MODULE_NAME, MODEL_NAME, FIELDS, FORM_NAME });
11
+ super({
12
+ ...params,
13
+ MODULE_NAME,
14
+ MODEL_NAME,
15
+ FIELDS: [...STANDART_FIELDS, ...FIELDS],
16
+ FORM_NAME,
17
+ });
12
18
  }
13
19
 
14
20
  async extract(req) {
@@ -228,7 +228,7 @@ class notRoute {
228
228
  }
229
229
  if (Array.isArray(result)) {
230
230
  result = result.map((itm) =>
231
- itm.toObject ? itm.toObject() : itm
231
+ itm && itm.toObject ? itm.toObject() : itm
232
232
  );
233
233
  }
234
234
  notManifestRouteResultFilter.filter(req.notRouteData, result);
package/src/types.js CHANGED
@@ -1,3 +1,12 @@
1
+ /**
2
+ * @typedef {object} notAppResponse
3
+ * @property {string} status ok or error
4
+ * @property {string} message
5
+ * @property {Array<string>|Object<string, Array<string>>} [errors]
6
+ * @property {object} [result]
7
+ * @property {string} [redirect]
8
+ */
9
+
1
10
  /**
2
11
  * @typedef {object} Query
3
12
  * @property {number} skip