not-node 6.4.7 → 6.4.9

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.4.7",
3
+ "version": "6.4.9",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -55,7 +55,6 @@
55
55
  "inquirer": "^10.1.8",
56
56
  "inquirer-autocomplete-prompt": "^3.0.1",
57
57
  "jsonwebtoken": "^9.0.2",
58
- "lower-case": "*",
59
58
  "method-override": "^3.0.0",
60
59
  "mongoose-validator": "*",
61
60
  "nconf": "*",
package/src/form/form.js CHANGED
@@ -256,6 +256,11 @@ class Form {
256
256
  };
257
257
  if (this.getActionDataDataTypes(req).includes(ACTION_DATA_TYPES.DATA)) {
258
258
  result.data = this.#extractByBestInstructions(req);
259
+ } else if (this.getActionDataDataTypes(req).includes("record")) {
260
+ getApp().warn(
261
+ 'actionData.data = record is obsolete, use data instead aka data:["data"]'
262
+ );
263
+ result.data = this.#extractByBestInstructions(req);
259
264
  }
260
265
  return result;
261
266
  }
@@ -16,6 +16,9 @@ const DIRTY_FIELDS = [
16
16
  "actionSignature",
17
17
  ];
18
18
 
19
+ //allow access to safe (for a specific user auth status) fields only
20
+ const DEFAULT_FIELDS_SET = ["@safe"];
21
+
19
22
  module.exports = class notManifestFilter {
20
23
  static schemaLoader = (name) => getApp().getModelSchema(name);
21
24
 
@@ -310,13 +313,22 @@ module.exports = class notManifestFilter {
310
313
  //this action
311
314
  const fullModelName = this.composeFullModelName(moduleName, modelName);
312
315
  const modelSchema = this.loadSchema(fullModelName);
313
- if (notManifestFilter.ruleSetHasFieldsDirective(ruleSet)) {
314
- copy.fields = notFieldsFilter.filter(
315
- [...ruleSet.fields],
316
- modelSchema,
317
- { action: actionSignature, roles: role, auth, root, modelName }
318
- );
316
+ const fields = notManifestFilter.ruleSetHasFieldsDirective(ruleSet)
317
+ ? [...ruleSet.fields]
318
+ : DEFAULT_FIELDS_SET;
319
+
320
+ copy.fields = notFieldsFilter.filter(fields, modelSchema, {
321
+ action: actionSignature,
322
+ roles: role,
323
+ auth,
324
+ root,
325
+ modelName,
326
+ });
327
+ //remove fields property if list is empty
328
+ if (copy.fields.length == 0) {
329
+ delete copy.fields;
319
330
  }
331
+
320
332
  if (ruleSet && ruleSet.return) {
321
333
  copy.return = notManifestFilter.filterReturnSet(
322
334
  ruleSet.return,