not-node 6.3.26 → 6.3.28

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.26",
3
+ "version": "6.3.28",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/form/form.js CHANGED
@@ -68,7 +68,7 @@ class Form {
68
68
  EXTRACTORS = {},
69
69
  ENV_EXTRACTORS = {},
70
70
  TRANSFORMERS = {},
71
- rate = null,
71
+ rate,
72
72
  }) {
73
73
  this.#FORM_NAME = FORM_NAME;
74
74
  this.#MODEL_NAME = MODEL_NAME;
@@ -471,7 +471,7 @@ class Form {
471
471
  }
472
472
 
473
473
  #createRateLimiter(rate) {
474
- if (rate) {
474
+ if (rate && rate.options && typeof rate.options == "object") {
475
475
  if (typeof rate.idGetter === "function") {
476
476
  this.#rateLimiterIdGetter = rate.idGetter;
477
477
  }
@@ -481,16 +481,10 @@ class Form {
481
481
  if (rate.client && typeof rate.client === "string") {
482
482
  this.#rateLimiterClientName = rate.client;
483
483
  }
484
- if (
485
- rate.options &&
486
- typeof rate.options == "object" &&
487
- typeof rate.client === "string"
488
- ) {
489
- this.#rateLimiter = InitRateLimiter.initCustom(
490
- rate.options,
491
- this.#rateLimiterClientName
492
- );
493
- }
484
+ this.#rateLimiter = InitRateLimiter.initCustom(
485
+ rate.options,
486
+ this.#rateLimiterClientName
487
+ );
494
488
  }
495
489
  }
496
490
 
@@ -8,7 +8,7 @@ const FIELDS = [
8
8
  ["identity", "not-node//requiredObject"],
9
9
  ];
10
10
 
11
- module.exports = ({ MODULE_NAME, MODEL_NAME, actionName }) => {
11
+ module.exports = ({ MODULE_NAME, MODEL_NAME, actionName = "getByID" }) => {
12
12
  const FORM_NAME = `${MODULE_NAME}:${MODEL_NAME}:${firstLetterToUpper(
13
13
  actionName
14
14
  )}Form`;
@@ -8,7 +8,7 @@ const FIELDS = [
8
8
  ["identity", "not-node//requiredObject"],
9
9
  ];
10
10
 
11
- module.exports = ({ MODULE_NAME, MODEL_NAME, actionName }) => {
11
+ module.exports = ({ MODULE_NAME, MODEL_NAME, actionName = "getById" }) => {
12
12
  const FORM_NAME = `${MODULE_NAME}:${MODEL_NAME}:${firstLetterToUpper(
13
13
  actionName
14
14
  )}Form`;
@@ -17,7 +17,7 @@ const FIELDS = [
17
17
  * @param {string} params.actionName //action name
18
18
  * @return {Form} form class definition
19
19
  */
20
- const FactoryFormList = ({ MODULE_NAME, MODEL_NAME, actionName }) => {
20
+ const FactoryFormList = ({ MODULE_NAME, MODEL_NAME, actionName = "list" }) => {
21
21
  const FORM_NAME = `${MODULE_NAME}:${MODEL_NAME}:${firstLetterToUpper(
22
22
  actionName
23
23
  )}Form`;
@@ -17,7 +17,11 @@ const FIELDS = [
17
17
  * @param {string} params.actionName //action name
18
18
  * @return {Form} form class definition
19
19
  */
20
- const FactoryFormListAndCount = ({ MODULE_NAME, MODEL_NAME, actionName }) => {
20
+ const FactoryFormListAndCount = ({
21
+ MODULE_NAME,
22
+ MODEL_NAME,
23
+ actionName = "listAndCount",
24
+ }) => {
21
25
  const FORM_NAME = `${MODULE_NAME}:${MODEL_NAME}:${firstLetterToUpper(
22
26
  actionName
23
27
  )}Form`;
@@ -48,7 +48,7 @@ module.exports = class InitRoutes {
48
48
  message: err.message,
49
49
  });
50
50
  } else {
51
- log.error("Unknown error:", err);
51
+ log?.error("Unknown error:", err);
52
52
  res.status(500).json({
53
53
  status: "error",
54
54
  });
@@ -58,7 +58,7 @@ module.exports = class InitRoutes {
58
58
  }
59
59
 
60
60
  async run({ master, config, options }) {
61
- log.info("Setting up routes...");
61
+ log?.info("Setting up routes...");
62
62
  //pages rendering
63
63
  await master.getApp().execInModules("registerPagesRoutes", master);
64
64
  //api first