not-node 5.0.22 → 5.1.2

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.
Files changed (126) hide show
  1. package/.eslintrc.json +1 -1
  2. package/bin/not-deploy.js +52 -0
  3. package/index.js +21 -19
  4. package/package.json +1 -1
  5. package/src/app.js +61 -58
  6. package/src/auth/abstract.js +17 -19
  7. package/src/auth/const.js +8 -12
  8. package/src/auth/fields.js +143 -124
  9. package/src/auth/index.js +14 -14
  10. package/src/auth/roles.js +64 -63
  11. package/src/auth/routes.js +89 -54
  12. package/src/auth/rules.js +63 -63
  13. package/src/auth/session.js +60 -62
  14. package/src/bootstrap/form.js +13 -13
  15. package/src/bootstrap/logic.js +45 -41
  16. package/src/bootstrap/model.js +14 -17
  17. package/src/bootstrap/route.js +132 -53
  18. package/src/common.js +86 -79
  19. package/src/core/fields/ID.js +6 -6
  20. package/src/core/fields/__closed.js +3 -3
  21. package/src/core/fields/__latest.js +3 -3
  22. package/src/core/fields/__version.js +3 -3
  23. package/src/core/fields/__versions.js +3 -3
  24. package/src/core/fields/_id.js +6 -6
  25. package/src/core/fields/active.js +9 -9
  26. package/src/core/fields/codeName.js +9 -9
  27. package/src/core/fields/createdAt.js +17 -17
  28. package/src/core/fields/default.js +9 -9
  29. package/src/core/fields/description.js +11 -11
  30. package/src/core/fields/email.js +9 -9
  31. package/src/core/fields/enabled.js +9 -9
  32. package/src/core/fields/expiredAt.js +16 -16
  33. package/src/core/fields/height.js +11 -11
  34. package/src/core/fields/ip.js +10 -10
  35. package/src/core/fields/objectId.js +10 -10
  36. package/src/core/fields/owner.js +13 -13
  37. package/src/core/fields/ownerModel.js +11 -11
  38. package/src/core/fields/price.js +11 -11
  39. package/src/core/fields/requiredObject.js +10 -10
  40. package/src/core/fields/session.js +10 -10
  41. package/src/core/fields/size.js +11 -11
  42. package/src/core/fields/telephone.js +9 -9
  43. package/src/core/fields/title.js +15 -15
  44. package/src/core/fields/updatedAt.js +17 -17
  45. package/src/core/fields/userId.js +11 -12
  46. package/src/core/fields/uuid.js +11 -11
  47. package/src/core/fields/validators/email.js +6 -4
  48. package/src/core/fields/validators/owner.js +6 -4
  49. package/src/core/fields/width.js +11 -11
  50. package/src/domain.js +435 -431
  51. package/src/env.js +23 -23
  52. package/src/error.js +20 -23
  53. package/src/exceptions/db.js +23 -0
  54. package/src/exceptions/http.js +43 -0
  55. package/src/fields/index.js +106 -111
  56. package/src/form/fabric.js +19 -24
  57. package/src/form/form.js +195 -186
  58. package/src/form/index.js +2 -2
  59. package/src/generic/index.js +2 -0
  60. package/src/generic/logic.js +595 -0
  61. package/src/generic/route.js +76 -0
  62. package/src/init/additional.js +7 -7
  63. package/src/init/app.js +75 -68
  64. package/src/init/bodyparser.js +14 -14
  65. package/src/init/compression.js +6 -7
  66. package/src/init/core.js +12 -12
  67. package/src/init/cors.js +22 -24
  68. package/src/init/db/index.js +41 -43
  69. package/src/init/db/ioredis.js +28 -20
  70. package/src/init/db/mongoose.js +42 -32
  71. package/src/init/db/redis.js +59 -48
  72. package/src/init/env.js +44 -36
  73. package/src/init/express.js +18 -21
  74. package/src/init/fileupload.js +8 -10
  75. package/src/init/http.js +65 -47
  76. package/src/init/index.js +141 -148
  77. package/src/init/informer.js +7 -9
  78. package/src/init/methodoverride.js +4 -6
  79. package/src/init/middleware.js +23 -26
  80. package/src/init/modules.js +4 -4
  81. package/src/init/monitoring.js +8 -8
  82. package/src/init/rateLimiter.js +53 -45
  83. package/src/init/routes.js +67 -69
  84. package/src/init/security.js +37 -33
  85. package/src/init/sequence.js +111 -107
  86. package/src/init/sequence.standart.js +54 -56
  87. package/src/init/sessions/index.js +21 -21
  88. package/src/init/sessions/mongoose.js +49 -36
  89. package/src/init/sessions/redis.js +28 -27
  90. package/src/init/static.js +53 -40
  91. package/src/init/template.js +17 -17
  92. package/src/lib.js +230 -200
  93. package/src/manifest/batchRunner.js +26 -25
  94. package/src/manifest/initializator/forms.js +24 -24
  95. package/src/manifest/initializator/index.js +8 -10
  96. package/src/manifest/initializator/manifests.js +45 -42
  97. package/src/manifest/initializator/models.js +37 -34
  98. package/src/manifest/manifest.filter.js +130 -97
  99. package/src/manifest/manifest.js +103 -77
  100. package/src/manifest/module.js +350 -360
  101. package/src/manifest/registrator/fields.js +90 -85
  102. package/src/manifest/registrator/forms.js +47 -47
  103. package/src/manifest/registrator/index.js +14 -16
  104. package/src/manifest/registrator/locales.js +17 -16
  105. package/src/manifest/registrator/logics.js +66 -64
  106. package/src/manifest/registrator/models.js +64 -62
  107. package/src/manifest/registrator/routes.js +171 -132
  108. package/src/manifest/registrator/routes.ws.js +109 -103
  109. package/src/manifest/route.js +216 -161
  110. package/src/model/buildValidator.js +53 -42
  111. package/src/model/default.js +304 -286
  112. package/src/model/enrich.js +69 -61
  113. package/src/model/increment.js +124 -137
  114. package/src/model/proto.js +179 -148
  115. package/src/model/routine.js +85 -76
  116. package/src/model/utils.js +33 -0
  117. package/src/model/versioning.js +148 -130
  118. package/src/obsolete.js +12 -8
  119. package/src/parser.js +29 -22
  120. package/src/repos.js +29 -31
  121. package/src/rollup.js +75 -65
  122. package/src/shell.helpers.js +28 -28
  123. package/static.js +31 -0
  124. package/src/generic/router.js +0 -16
  125. package/src/manifest/module.models.js +0 -0
  126. package/src/manifest/module.status.js +0 -0
@@ -5,37 +5,37 @@
5
5
  // released under MIT License
6
6
  // version: 0.1.0 (2013/02/01)
7
7
 
8
-
9
8
  // execute a single shell command where "cmd" is a string
10
- module.exports.exec = function(cmd, cb){
11
- // this would be way easier on a shell/bash script :P
12
- const child_process = require('child_process');
13
- var parts = cmd.split(/\s+/g);
14
- var p = child_process.spawn(parts[0], parts.slice(1), {stdio: 'inherit'});
15
- p.on('exit', function(code){
16
- var err = null;
17
- if (code) {
18
- err = new Error(`command "${cmd}" exited with wrong status code "${code}"`);
19
- err.code = code;
20
- err.cmd = cmd;
21
- }
22
- if (cb) cb(err);
23
- });
9
+ module.exports.exec = function (cmd, cb) {
10
+ // this would be way easier on a shell/bash script :P
11
+ const child_process = require("child_process");
12
+ var parts = cmd.split(/\s+/g);
13
+ var p = child_process.spawn(parts[0], parts.slice(1), { stdio: "inherit" });
14
+ p.on("exit", function (code) {
15
+ var err = null;
16
+ if (code) {
17
+ err = new Error(
18
+ `command "${cmd}" exited with wrong status code "${code}"`
19
+ );
20
+ err.code = code;
21
+ err.cmd = cmd;
22
+ }
23
+ if (cb) cb(err);
24
+ });
24
25
  };
25
26
 
26
-
27
27
  // execute multiple commands in series
28
28
  // this could be replaced by any flow control lib
29
- module.exports.series = function(cmds, cb){
30
- const execNext = function(){
31
- module.exports.exec(cmds.shift(), function(err){
32
- if (err) {
33
- cb(err);
34
- } else {
35
- if (cmds.length) execNext();
36
- else cb(null);
37
- }
38
- });
39
- };
40
- execNext();
29
+ module.exports.series = function (cmds, cb) {
30
+ const execNext = function () {
31
+ module.exports.exec(cmds.shift(), function (err) {
32
+ if (err) {
33
+ cb(err);
34
+ } else {
35
+ if (cmds.length) execNext();
36
+ else cb(null);
37
+ }
38
+ });
39
+ };
40
+ execNext();
41
41
  };
package/static.js ADDED
@@ -0,0 +1,31 @@
1
+ const generate = ({ NAME }) => {
2
+ return class {
3
+ static run(prefix) {
4
+ return prefix + NAME;
5
+ }
6
+
7
+ static faster(prefix) {
8
+ return this.run(prefix) + " is faster";
9
+ }
10
+ };
11
+ };
12
+
13
+ const proto1 = generate({ NAME: "sonic" });
14
+ const proto2 = generate({ NAME: "lorde" });
15
+ const proto3 = generate({ NAME: "vanish" });
16
+
17
+ class res1 extends proto1 {
18
+ static faster(prefix) {
19
+ return this.run(prefix) + " is even faster";
20
+ }
21
+ }
22
+
23
+ class res2 extends proto2 {}
24
+
25
+ class res3 extends proto3 {}
26
+
27
+ console.log(res1.run("res 1 - "));
28
+ console.log(res1.faster("res 1 - "));
29
+ console.log(proto3.run("proto 3 - "));
30
+ console.log(res3.run("res 3 - "));
31
+ console.log(res2.faster("res 2 - "));
@@ -1,16 +0,0 @@
1
- class notGenericRoute {
2
- static sadf = "sadf";
3
- static create() {}
4
-
5
- static update() {}
6
-
7
- static get() {}
8
-
9
- static getRaw() {}
10
-
11
- static listAll() {}
12
-
13
- static listAndCount() {}
14
- }
15
-
16
- module.exports = notGenericRoute;
File without changes
File without changes