gina 0.1.6-alpha.15 → 0.1.6-alpha.150

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 (408) hide show
  1. package/LICENSE +1 -1
  2. package/README-4Contributors.md +14 -8
  3. package/README.md +13 -4
  4. package/bin/cli +16 -2
  5. package/bin/gina +29 -1
  6. package/framework/{v0.1.6-alpha.15/lib/inherits → v0.1.6-alpha.150}/LICENSE +1 -1
  7. package/framework/v0.1.6-alpha.150/VERSION +1 -0
  8. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/plugin/README.md +1 -0
  9. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/css/gina.min.css.br +0 -0
  10. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/css/gina.min.css.gz +0 -0
  11. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
  12. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +1 -1
  13. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/html/toolbar.html.br +0 -0
  14. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/html/toolbar.html.gz +0 -0
  15. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/plugin/dist/vendor/gina/js/gina.js +6403 -5609
  16. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.min.js +789 -0
  17. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.min.js.br +0 -0
  18. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.min.js.gz +0 -0
  19. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
  20. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +9 -0
  21. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.br +0 -0
  22. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.gz +0 -0
  23. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
  24. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/config.js +167 -76
  25. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/index.js +108 -26
  26. package/framework/{v0.1.6-alpha.15/core/connectors/couchbase/lib/connector.v4.js → v0.1.6-alpha.150/core/connectors/couchbase/lib/connector.v3.js} +170 -69
  27. package/framework/v0.1.6-alpha.150/core/connectors/couchbase/lib/connector.v4.js +470 -0
  28. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/session-store.v4.js +5 -2
  29. package/framework/v0.1.6-alpha.150/core/content.encoding +9 -0
  30. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/controller/controller.js +861 -1185
  31. package/framework/v0.1.6-alpha.150/core/controller/controller.renderSwig.js +1022 -0
  32. package/framework/v0.1.6-alpha.150/core/controller/controller.renderv1.js +911 -0
  33. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/controller/index.js +2 -2
  34. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/.github/workflows/ci.yml +24 -0
  35. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/.github/workflows/lint.yml +23 -0
  36. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/README.md +191 -0
  37. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-big.js +149 -0
  38. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-small.js +143 -0
  39. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-big.js +154 -0
  40. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-small.js +148 -0
  41. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-100pairs-small.js +101 -0
  42. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-900pairs-small-alt.js +84 -0
  43. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/lib/index.js +57 -0
  44. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/lib/types/multipart.js +680 -0
  45. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/lib/types/urlencoded.js +350 -0
  46. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/lib/utils.js +596 -0
  47. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/package.json +22 -0
  48. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/.travis.yml +4 -0
  49. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/LICENSE +21 -0
  50. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/bool.js +10 -0
  51. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/boolean_double.js +7 -0
  52. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/boolean_single.js +7 -0
  53. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/default_hash.js +8 -0
  54. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/default_singles.js +7 -0
  55. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/divide.js +8 -0
  56. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/line_count.js +20 -0
  57. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/line_count_options.js +29 -0
  58. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/line_count_wrap.js +29 -0
  59. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/nonopt.js +4 -0
  60. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/reflect.js +2 -0
  61. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/short.js +3 -0
  62. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/string.js +11 -0
  63. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/usage-options.js +19 -0
  64. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/xup.js +10 -0
  65. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/index.js +343 -0
  66. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/package.json +31 -0
  67. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/package.json.dist +39 -0
  68. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/readme.markdown +513 -0
  69. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/HISTORY.md +498 -0
  70. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/LICENSE +7 -0
  71. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/README.md +88 -0
  72. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/bin/swig.js +161 -0
  73. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/bin/swig.js.dist +161 -0
  74. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/dist/swig.min.js +7 -0
  75. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/dist/swig.min.js.map +8 -0
  76. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/index.js +1 -0
  77. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/dateformatter.js +198 -0
  78. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/filters.js +630 -0
  79. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/lexer.js +306 -0
  80. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/loaders/filesystem.js +59 -0
  81. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/loaders/index.js +53 -0
  82. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/loaders/memory.js +63 -0
  83. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/parser.js +744 -0
  84. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/swig.js +740 -0
  85. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/autoescape.js +37 -0
  86. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/block.js +25 -0
  87. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/else.js +25 -0
  88. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/elseif.js +28 -0
  89. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/extends.js +19 -0
  90. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/filter.js +68 -0
  91. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/for.js +130 -0
  92. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/if.js +86 -0
  93. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/import.js +91 -0
  94. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/include.js +100 -0
  95. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/index.js +16 -0
  96. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/macro.js +79 -0
  97. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/parent.js +51 -0
  98. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/raw.js +23 -0
  99. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/set.js +109 -0
  100. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/spaceless.js +42 -0
  101. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/utils.js +184 -0
  102. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/package.json +57 -0
  103. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/package.json.dist +61 -0
  104. package/framework/v0.1.6-alpha.150/core/deps/swig-client/swig.js +5031 -0
  105. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/dev/index.js +1 -1
  106. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/dev/lib/factory.js +1 -1
  107. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/gna.js +123 -23
  108. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/index.js +3 -3
  109. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/src/make.js +1 -1
  110. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/mime.types +1 -0
  111. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/model/entity.js +5 -5
  112. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/model/index.js +30 -26
  113. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/model/template/entityFactory.js +1 -1
  114. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/model/template/index.js +1 -1
  115. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/index.js +3 -3
  116. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/file/package.json +2 -2
  117. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/intl/package.json +2 -2
  118. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/storage/package.json +2 -2
  119. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/validator/package.json +2 -2
  120. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/validator/src/form-validator.js +39 -27
  121. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/validator/src/main.js +496 -119
  122. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/router.js +92 -47
  123. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/server.isaac.js +329 -43
  124. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/server.js +433 -159
  125. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/status.codes +1 -11
  126. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/controllers/setup.js +2 -2
  127. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/command/gina.tpl +1 -1
  128. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/env.json +20 -2
  129. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/settings.json +4 -1
  130. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/templates.json +4 -2
  131. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/console.js +1 -1
  132. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/context.js +30 -13
  133. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/data/package.json +2 -2
  134. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/data/src/main.js +1 -1
  135. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/dateFormat.js +1 -1
  136. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/index.js +1 -1
  137. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/json/package.json +2 -2
  138. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/json/src/main.js +7 -4
  139. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/path.js +32 -16
  140. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/plugins/package.json +2 -2
  141. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/plugins/src/api-error.js +2 -2
  142. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/plugins/src/main.js +1 -1
  143. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/prototypes.js +8 -1
  144. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/task.js +2 -2
  145. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/text.js +1 -1
  146. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/archiver/package.json +2 -2
  147. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/archiver/src/main.js +11 -11
  148. package/framework/v0.1.6-alpha.150/lib/cache/package.json +20 -0
  149. package/framework/v0.1.6-alpha.150/lib/cache/src/main.js +160 -0
  150. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/add.js +2 -1
  151. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/restart.js +2 -2
  152. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/start.js +26 -11
  153. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/get.js +1 -1
  154. package/framework/v0.1.6-alpha.150/lib/cmd/env/help.js +30 -0
  155. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/set.js +21 -0
  156. package/framework/v0.1.6-alpha.150/lib/cmd/framework/arguments.json +7 -0
  157. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/build.js +1 -1
  158. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/dot.js +21 -0
  159. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/init.js +19 -1
  160. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/link-node-modules.js +2 -3
  161. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/link.js +3 -2
  162. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/restart.js +3 -3
  163. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/start.js +1 -1
  164. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/tail.js +29 -12
  165. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/version.js +15 -1
  166. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/helper.js +44 -15
  167. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/index.js +1 -1
  168. package/framework/v0.1.6-alpha.150/lib/cmd/minion/help.txt +18 -0
  169. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/reset.js +1 -1
  170. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/add.js +7 -2
  171. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/arguments.json +1 -0
  172. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/build.js +32 -7
  173. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/help.txt +4 -0
  174. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/list.js +1 -1
  175. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/protocol/list.js +71 -50
  176. package/framework/v0.1.6-alpha.150/lib/collection/README.md +5 -0
  177. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/collection/package.json +2 -2
  178. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/collection/src/main.js +21 -14
  179. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/config.js +1 -1
  180. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cron/package.json +2 -2
  181. package/framework/v0.1.6-alpha.150/lib/domain/dist/2025-03-14_13-41-20_UTC.dat +15754 -0
  182. package/framework/v0.1.6-alpha.150/lib/domain/dist/public_suffix_list.dat +15754 -0
  183. package/framework/v0.1.6-alpha.150/lib/domain/dist/public_suffix_list.dat.br +0 -0
  184. package/framework/v0.1.6-alpha.150/lib/domain/dist/public_suffix_list.dat.gz +0 -0
  185. package/framework/v0.1.6-alpha.150/lib/domain/exemples/backend.js +12 -0
  186. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/domain/package.json +2 -2
  187. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/domain/src/main.js +75 -13
  188. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/generator/index.js +1 -1
  189. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/index.js +3 -2
  190. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150/lib/inherits}/LICENSE +1 -1
  191. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/package.json +2 -2
  192. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/src/main.js +1 -1
  193. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/package.json +2 -2
  194. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/file/index.js +2 -0
  195. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/mq/listener.js +10 -2
  196. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/helper.js +1 -1
  197. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/main.js +1 -1
  198. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/math/index.js +1 -1
  199. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/package.json +2 -2
  200. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/model.js +3 -3
  201. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/proc.js +10 -2
  202. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/routing/package.json +2 -2
  203. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/routing/src/main.js +201 -35
  204. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/session-store.js +3 -3
  205. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/shell.js +7 -6
  206. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/swig-filters/package.json +2 -2
  207. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/swig-filters/src/main.js +100 -17
  208. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/validator.js +2 -2
  209. package/framework/v0.1.6-alpha.150/package.json +11 -0
  210. package/package.json +3 -3
  211. package/resources/package.json.template +1 -1
  212. package/script/post_install.js +4 -4
  213. package/script/pre_install.js +3 -3
  214. package/utils/helper.js +38 -14
  215. package/framework/v0.1.6-alpha.15/VERSION +0 -1
  216. package/framework/v0.1.6-alpha.15/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +0 -1
  217. package/framework/v0.1.6-alpha.15/core/asset/plugin/dist/vendor/gina/js/gina.min.js +0 -766
  218. package/framework/v0.1.6-alpha.15/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +0 -8
  219. package/framework/v0.1.6-alpha.15/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -7
  220. package/framework/v0.1.6-alpha.15/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +0 -8
  221. package/framework/v0.1.6-alpha.15/core/connectors/couchbase/lib/connector.v3.js +0 -432
  222. package/framework/v0.1.6-alpha.15/core/deps/busboy/.travis.yml +0 -17
  223. package/framework/v0.1.6-alpha.15/core/deps/busboy/README.md +0 -225
  224. package/framework/v0.1.6-alpha.15/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -73
  225. package/framework/v0.1.6-alpha.15/core/deps/busboy/deps/encoding/encoding.js +0 -2391
  226. package/framework/v0.1.6-alpha.15/core/deps/busboy/lib/main.js +0 -89
  227. package/framework/v0.1.6-alpha.15/core/deps/busboy/lib/types/multipart.js +0 -328
  228. package/framework/v0.1.6-alpha.15/core/deps/busboy/lib/types/urlencoded.js +0 -214
  229. package/framework/v0.1.6-alpha.15/core/deps/busboy/lib/utils.js +0 -191
  230. package/framework/v0.1.6-alpha.15/core/deps/busboy/package.json +0 -69
  231. package/framework/v0.1.6-alpha.15/lib/domain/dist/public_suffix_list.dat +0 -14186
  232. package/framework/v0.1.6-alpha.15/package.json +0 -14
  233. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/AUTHORS +0 -0
  234. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/html/nolayout.html +0 -0
  235. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/html/static.html +0 -0
  236. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/android-chrome-192x192.png +0 -0
  237. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/android-chrome-512x512.png +0 -0
  238. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/apple-touch-icon.png +0 -0
  239. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/favicon-16x16.png +0 -0
  240. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/favicon-32x32.png +0 -0
  241. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/favicon.ico +0 -0
  242. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -0
  243. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/plugin/uuid.json +0 -0
  244. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/connector.js +0 -0
  245. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/connector.v2.js +0 -0
  246. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/n1ql.js +0 -0
  247. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/session-store.js +0 -0
  248. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  249. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  250. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/controller/controller.framework.js +0 -0
  251. /package/framework/{v0.1.6-alpha.15/core/deps/busboy → v0.1.6-alpha.150/core/deps/busboy-1.6.0}/LICENSE +0 -0
  252. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  253. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/dev/lib/class.js +0 -0
  254. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/dev/lib/tools.js +0 -0
  255. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/README.md +0 -0
  256. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/currency.json +0 -0
  257. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/dist/language/en.json +0 -0
  258. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/dist/language/fr.json +0 -0
  259. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/dist/region/en.json +0 -0
  260. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/dist/region/fr.json +0 -0
  261. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/src/resources/currency.csv +0 -0
  262. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/src/resources/region.csv +0 -0
  263. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/src/resources/region.mapping.json +0 -0
  264. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/README.md +0 -0
  265. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/file/README.md +0 -0
  266. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/file/build.json +0 -0
  267. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/intl/README.md +0 -0
  268. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/intl/build.json +0 -0
  269. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/intl/src/main.js +0 -0
  270. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/storage/README.md +0 -0
  271. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/storage/build.json +0 -0
  272. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/storage/src/main.js +0 -0
  273. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/validator/README.md +0 -0
  274. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/validator/build.json +0 -0
  275. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/server.express.js +0 -0
  276. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/_gitignore +0 -0
  277. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/config/app.json +0 -0
  278. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/config/routing.json +0 -0
  279. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/config/settings.json +0 -0
  280. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
  281. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/config/templates.json +0 -0
  282. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  283. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  284. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/index.js +0 -0
  285. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  286. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  287. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  288. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  289. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  290. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_public/readme.md +0 -0
  291. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  292. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
  293. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
  294. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
  295. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
  296. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/command/gina.bat.tpl +0 -0
  297. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/manifest.json +0 -0
  298. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/package.json +0 -0
  299. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/statics.json +0 -0
  300. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/client/json/401.json +0 -0
  301. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/client/json/403.json +0 -0
  302. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/client/json/404.json +0 -0
  303. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/server/html/50x.html +0 -0
  304. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/server/json/500.json +0 -0
  305. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/server/json/503.json +0 -0
  306. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/extensions/logger/config.json +0 -0
  307. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/data/LICENSE +0 -0
  308. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/data/README.md +0 -0
  309. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/json/LICENSE +0 -0
  310. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/json/README.md +0 -0
  311. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/plugins/README.md +0 -0
  312. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/archiver/README.md +0 -0
  313. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/archiver/build.json +0 -0
  314. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/archiver/src/dep/jszip.min.js +0 -0
  315. /package/framework/{v0.1.6-alpha.15/lib/collection → v0.1.6-alpha.150/lib/cache}/README.md +0 -0
  316. /package/framework/{v0.1.6-alpha.15/lib/collection → v0.1.6-alpha.150/lib/cache}/build.json +0 -0
  317. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/aliases.json +0 -0
  318. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/arguments.json +0 -0
  319. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/copy.js +0 -0
  320. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/cp.js +0 -0
  321. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/help.js +0 -0
  322. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/help.txt +0 -0
  323. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/list.js +0 -0
  324. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/remove.js +0 -0
  325. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/rename.js +0 -0
  326. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/rm.js +0 -0
  327. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/status.js +0 -0
  328. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/stop.js +0 -0
  329. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/add.js +0 -0
  330. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/help.txt +0 -0
  331. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/link-dev.js +0 -0
  332. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/list.js +0 -0
  333. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/remove.js +0 -0
  334. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/rm.js +0 -0
  335. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/unset.js +0 -0
  336. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/use.js +0 -0
  337. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/get.js +0 -0
  338. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/help.js +0 -0
  339. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/help.txt +0 -0
  340. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/msg.json +0 -0
  341. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/open.js +0 -0
  342. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/set.js +0 -0
  343. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/status.js +0 -0
  344. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/stop.js +0 -0
  345. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/update.js +0 -0
  346. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/gina-dev.1.md +0 -0
  347. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/gina-framework.1.md +0 -0
  348. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/gina.1.md +0 -0
  349. /package/framework/{v0.1.6-alpha.15/lib/cmd/env → v0.1.6-alpha.150/lib/cmd/minion}/help.js +0 -0
  350. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/msg.json +0 -0
  351. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/help.js +0 -0
  352. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/help.txt +0 -0
  353. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/inc/scan.js +0 -0
  354. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/list.js +0 -0
  355. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/set.js +0 -0
  356. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/help.js +0 -0
  357. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/import.js +0 -0
  358. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/move.js +0 -0
  359. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/remove.js +0 -0
  360. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/rename.js +0 -0
  361. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/restart.js +0 -0
  362. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/rm.js +0 -0
  363. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/start.js +0 -0
  364. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/status.js +0 -0
  365. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/stop.js +0 -0
  366. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/protocol/help.js +0 -0
  367. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/protocol/help.txt +0 -0
  368. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/protocol/set.js +0 -0
  369. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/add.js +0 -0
  370. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/help.js +0 -0
  371. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/help.txt +0 -0
  372. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/link-local.js +0 -0
  373. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/link-production.js +0 -0
  374. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/list.js +0 -0
  375. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/remove.js +0 -0
  376. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/rm.js +0 -0
  377. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/use.js +0 -0
  378. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/view/add.js +0 -0
  379. /package/framework/{v0.1.6-alpha.15/lib/routing → v0.1.6-alpha.150/lib/collection}/build.json +0 -0
  380. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cron/README.md +0 -0
  381. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cron/src/main.js +0 -0
  382. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/domain/LICENSE +0 -0
  383. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/domain/README.md +0 -0
  384. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/domain/exemples/frontend.html +0 -0
  385. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/README.md +0 -0
  386. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  387. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/example/protected_inheritance.js +0 -0
  388. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/example/simple_inheritance.js +0 -0
  389. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  390. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/README.md +0 -0
  391. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/default/index.js +0 -0
  392. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  393. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  394. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/mq/index.js +0 -0
  395. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/mq/speaker.js +0 -0
  396. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/README.md +0 -0
  397. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/example/merge.js +0 -0
  398. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/example/merge_2_literal objects.js +0 -0
  399. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/example/merge_and_preserve_first.js +0 -0
  400. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/src/main.js +0 -0
  401. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/routing/README.md +0 -0
  402. /package/framework/{v0.1.6-alpha.15/lib/domain/exemples/backend.js → v0.1.6-alpha.150/lib/routing/build.json} +0 -0
  403. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/swig-filters/README.md +0 -0
  404. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/url/README.md +0 -0
  405. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/url/index.js +0 -0
  406. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/url/mocks.json +0 -0
  407. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/url/routing.json +0 -0
  408. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/url/test.js +0 -0
@@ -1,17 +1,16 @@
1
- //"use strict";
2
1
  //Imports.
3
2
  const fs = require('fs');
4
3
  const os = require('os');
5
4
  const path = require('path');
6
5
  const EventEmitter = require('events').EventEmitter;
7
- const Busboy = require('./deps/busboy');
6
+ const swig = require('./deps/swig-1.4.2');
7
+ const Busboy = require('./deps/busboy-1.6.0');
8
8
  const Stream = require('stream');
9
- const zlib = require('zlib'); // gzip / deflate
10
9
  const util = require('util');
11
10
  var https = require('https');
12
11
  const sslChecker = require('ssl-checker');
13
12
 
14
- const swig = require( _(GINA_FRAMEWORK_DIR +'/node_modules/swig', true) );
13
+
15
14
  var Config = require('./config');
16
15
  var Router = require('./router');
17
16
  var lib = require('./../lib');
@@ -21,6 +20,8 @@ var merge = lib.merge;
21
20
  var Proc = lib.Proc;
22
21
  var console = lib.logger;
23
22
  var SwigFilters = lib.SwigFilters;
23
+ var Domain = lib.Domain;
24
+ var domainLib = new Domain();
24
25
 
25
26
  function Server(options) {
26
27
 
@@ -48,7 +49,7 @@ function Server(options) {
48
49
  var swigOptions = {
49
50
  autoescape: ( typeof(conf.autoescape) != 'undefined') ? conf.autoescape: false,
50
51
  loader: swig.loaders.fs(dir),
51
- cache: (conf.cacheless) ? false : 'memory'
52
+ cache: (conf.isCacheless) ? false : 'memory'
52
53
  };
53
54
 
54
55
  swig.setDefaults(swigOptions);
@@ -60,8 +61,8 @@ function Server(options) {
60
61
 
61
62
  try {
62
63
  // Allows you to get a bundle web root
63
- // swig.setFilter('getWebroot', filters.getWebroot);
64
- // swig.setFilter('nl2br', filters.nl2br);
64
+ // e.g.: swig.setFilter('getWebroot', filters.getWebroot);
65
+ // e.g.: swig.setFilter('nl2br', filters.nl2br);
65
66
  for (let filter in filters) {
66
67
  if ( typeof(filters[filter]) == 'function' && !/^getConfig$/.test(filter) ) {
67
68
  swig.setFilter(filter, filters[filter]);
@@ -144,9 +145,14 @@ function Server(options) {
144
145
  },
145
146
  serverOpt,
146
147
  {
147
- engine: options.conf[self.appName][self.env].server.engine,
148
- protocol: options.conf[self.appName][self.env].server.protocol,
149
- scheme: options.conf[self.appName][self.env].server.scheme
148
+ engine : options.conf[self.appName][self.env].server.engine,
149
+ protocol : options.conf[self.appName][self.env].server.protocol,
150
+ scheme : options.conf[self.appName][self.env].server.scheme,
151
+ coreConfiguration : options.conf[self.appName][self.env].server.coreConfiguration,
152
+ isCacheless : options.conf[self.appName][self.env].isCacheless,
153
+ routing : options.conf[self.appName][self.env].routing,
154
+ allRoutes : options.conf.routing,
155
+ cachePath : options.conf[self.appName][self.env].cachePath
150
156
  }
151
157
  );
152
158
 
@@ -162,9 +168,10 @@ function Server(options) {
162
168
  ;
163
169
 
164
170
  // locking port & protocol so it can't be changed by the user's settings
165
- self.conf[self.appName][self.env].server.protocol = serverOpt.protocol;
166
- self.conf[self.appName][self.env].server.scheme = serverOpt.scheme;
167
- self.conf[self.appName][self.env].server.engine = serverOpt.engine;
171
+ self.conf[self.appName][self.env].server.protocol = serverOpt.protocol;
172
+ self.conf[self.appName][self.env].server.scheme = serverOpt.scheme;
173
+ self.conf[self.appName][self.env].server.engine = serverOpt.engine;
174
+ self.conf[self.appName][self.env].server.cachePath = serverOpt.cachePath;
168
175
 
169
176
  serverOpt.port = self.conf[self.appName][self.env].server.port = portsReverse[ self.appName +'@'+ self.projectName ][self.env][serverOpt.protocol][serverOpt.scheme];
170
177
  self.conf[self.appName][self.env].server.debugPort = getContext().debugPort;
@@ -225,7 +232,13 @@ function Server(options) {
225
232
  init(options);
226
233
  }
227
234
 
228
-
235
+ /**
236
+ * Verify certificate validity
237
+ *
238
+ * @param {string} endpoint
239
+ * @param {number} port
240
+ * @returns
241
+ */
229
242
  this.verifyCertificate = async function(endpoint, port) {
230
243
  let sslDetails = null;
231
244
  console.debug('Checking certificate validity...');
@@ -293,6 +306,24 @@ function Server(options) {
293
306
 
294
307
  if (failed) {
295
308
  if (sslDetails.daysRemaining > -1) {
309
+ var isProxyHost = getContext('isProxyHost');
310
+ if ( /^true$/i.test(isProxyHost) ) {
311
+ console.warn("Host is behind a reverse proxy, skipping server.verifyCertificate(...) ");
312
+ return;
313
+ }
314
+ var rootDomain = domainLib.getRootDomain(endpoint).value;
315
+ hasMatchedEntry = false;
316
+ for (let i in sslDetails.validFor) {
317
+ if ( new RegExp(sslDetails.validFor[i].replace(/^\*\./, '') + '$').test(rootDomain) ) {
318
+ hasMatchedEntry = true;
319
+ break;
320
+ }
321
+ }
322
+ if (!hasMatchedEntry) {
323
+ console.warn(`[Certificate] "${endpoint}" : Root domain not matching your certificate. If you plan to run your service behind a revese proxy, please do not forget to add "proxy.json" at the root of your project while going to production.${'\n'} ${humanView}`);
324
+ return;
325
+ }
326
+ // sslDetails.validFor
296
327
  console.emerg(`[Certificate] ${endpoint} : It is like there is a problem with your CA certificate${'\n'} ${humanView}`);
297
328
  return;
298
329
  }
@@ -311,6 +342,13 @@ function Server(options) {
311
342
  instance.getAssets = getAssets;
312
343
  instance.completeHeaders = completeHeaders;
313
344
 
345
+ if ( typeof(instance._cached) == 'undefined' ) {
346
+ instance._cached = new Map();
347
+ }
348
+ if ( typeof(instance._cachedPath) == 'undefined' ) {
349
+ instance._cachePath = self.conf[self.appName][self.env].server.cachePath;
350
+ }
351
+
314
352
  router.setServerInstance(instance);
315
353
  }
316
354
 
@@ -331,7 +369,7 @@ function Server(options) {
331
369
  , serverCoreConf = self.conf.core
332
370
  , routing = {}
333
371
  , reverseRouting = {}
334
- , cacheless = config.isCacheless()
372
+ , isCacheless = config.isCacheless()
335
373
  , env = self.env
336
374
  , scope = self.scope
337
375
  , apps = conf.allBundles // conf.bundles
@@ -371,7 +409,7 @@ function Server(options) {
371
409
  filename = main
372
410
  }
373
411
 
374
- if (cacheless) {
412
+ if (isCacheless) {
375
413
  delete require.cache[require.resolve(_(filename, true))]
376
414
  }
377
415
 
@@ -424,15 +462,15 @@ function Server(options) {
424
462
  }
425
463
 
426
464
  if (typeof(tmp[rule].url) != 'object') {
427
- if (tmp[rule].url.length > 1 && tmp[rule].url.substr(0,1) != '/') {
465
+ if (tmp[rule].url.length > 1 && tmp[rule].url.substring(0,1) != '/') {
428
466
  tmp[rule].url = '/'+tmp[rule].url
429
467
  }
430
- /** else if (tmp[rule].url.length > 1 && conf.envConf[apps[i]][env].server.webroot.substr(conf.envConf[apps[i]][env].server.webroot.length-1,1) == '/') {
431
- tmp[rule].url = tmp[rule].url.substr(1)
468
+ /** else if (tmp[rule].url.length > 1 && conf.envConf[apps[i]][env].server.webroot.substring(conf.envConf[apps[i]][env].server.webroot.length-1,1) == '/') {
469
+ tmp[rule].url = tmp[rule].url.substring(1)
432
470
  }*/
433
471
  else {
434
- if (wroot.substr(wroot.length-1,1) == '/') {
435
- wroot = wroot.substr(wroot.length-1,1).replace('/', '')
472
+ if (wroot.substring(wroot.length-1,1) == '/') {
473
+ wroot = wroot.substring(wroot.length-1,1).replace('/', '')
436
474
  }
437
475
  }
438
476
 
@@ -448,8 +486,8 @@ function Server(options) {
448
486
  localWroot = '/'+ routing[rule].bundle;
449
487
  conf.envConf[tmp[rule].bundle][env].server.webroot = localWroot
450
488
  }
451
- if (localWroot.substr(localWroot.length-1,1) == '/') {
452
- localWroot = localWroot.substr(localWroot.length-1,1).replace('/', '')
489
+ if (localWroot.substring(localWroot.length-1,1) == '/') {
490
+ localWroot = localWroot.substring(localWroot.length-1,1).replace('/', '')
453
491
  }
454
492
  if ( typeof(tmp[rule].param.ignoreWebRoot) == 'undefined' || !tmp[rule].param.ignoreWebRoot )
455
493
  tmp[rule].url = localWroot + tmp[rule].url
@@ -463,11 +501,11 @@ function Server(options) {
463
501
  } else {
464
502
 
465
503
  for (var u=0; u<tmp[rule].url.length; ++u) {
466
- if (tmp[rule].url[u].length > 1 && tmp[rule].url[u].substr(0,1) != '/') {
504
+ if (tmp[rule].url[u].length > 1 && tmp[rule].url[u].substring(0,1) != '/') {
467
505
  tmp[rule].url[u] = '/'+tmp[rule].url[u]
468
506
  } else {
469
- if (wroot.substr(wroot.length-1,1) == '/') {
470
- wroot = wroot.substr(wroot.length-1,1).replace('/', '')
507
+ if (wroot.substring(wroot.length-1,1) == '/') {
508
+ wroot = wroot.substring(wroot.length-1,1).replace('/', '')
471
509
  }
472
510
  }
473
511
  if ( typeof(tmp[rule].param.ignoreWebRoot) == 'undefined' || !tmp[rule].param.ignoreWebRoot )
@@ -584,7 +622,7 @@ function Server(options) {
584
622
  ) {
585
623
 
586
624
  // by default
587
- path = url.replace(url.substr(url.lastIndexOf('/')+1), '');
625
+ path = url.replace(url.substring(url.lastIndexOf('/')+1), '');
588
626
  if ( typeof(altConf) != 'undefined' && altConf ) {
589
627
  bundleConf = self.conf[altConf.split(/\@/)[1]][bundleConf.env];
590
628
  backedupPath = path;
@@ -592,7 +630,7 @@ function Server(options) {
592
630
  }
593
631
 
594
632
 
595
- // catch `statics.json` defined paths || bundleConf.staticResources.indexOf(url.replace(url.substr(url.lastIndexOf('/')+1), '')) > -1
633
+ // catch `statics.json` defined paths || bundleConf.staticResources.indexOf(url.replace(url.substring(url.lastIndexOf('/')+1), '')) > -1
596
634
  if ( bundleConf.staticResources.indexOf(path) > -1 || bundleConf.staticResources.indexOf(staticProps.firstLevel) > -1 ) {
597
635
  if ( typeof(altConf) != 'undefined' && altConf && backedupPath ) {
598
636
  filename = (bundleConf.staticResources.indexOf(path) > -1) ? bundleConf.content.statics[path] + url.replace(backedupPath, '/') : bundleConf.content.statics[staticProps.firstLevel] + url.replace(staticProps.firstLevel, '/');
@@ -631,8 +669,8 @@ function Server(options) {
631
669
  */
632
670
  var getAssets = function (bundleConf, layoutStr, swig, data) {
633
671
 
634
- // layout search for <link|script|img>
635
- var layoutAssets = layoutStr.match(/<link .*?<\/link>|<link .*?(rel\=\"(stylesheet|icon|manifest|(.*)\-icon))(.*)|<script.*?<\/script>|<img .*?(.*)/g) || [];
672
+ // layout search for <link|source|script|img>
673
+ var layoutAssets = layoutStr.match(/<link .*?<\/link>|<link .*?(rel\=\"(stylesheet|icon|manifest|(.*)\-icon))(.*)|<source .*?(type\=\"(image))(.*)|<script.*?<\/script>|<img .*?(.*)/g) || [];
636
674
 
637
675
  var assets = {}
638
676
  , cssFiles = []
@@ -652,63 +690,150 @@ function Server(options) {
652
690
  // layout assets
653
691
  i = 0;
654
692
  len = layoutAssets.length;
655
- var type = null
656
- , isAvailable = null
657
- , tag = null
658
- , properties = null
659
- , p = 0
660
- , pArr = []
693
+ var type = null
694
+ , isAvailable = null
695
+ , tag = null
696
+ , properties = null
697
+ , p = 0
698
+ , pArr = []
699
+ , sourceTagSrcSetStr = ''
661
700
  ;
662
701
  for (; i < len; ++i) {
663
702
 
664
703
  if (
665
- !/(\<img|\<link|\<script)/g.test(layoutAssets[i])
666
- || /\<img/.test(layoutAssets[i]) && /srcset/.test(layoutAssets[i]) // not able to handle this case for now
704
+ !/(\<img|\<link|\<source|\<script)/g.test(layoutAssets[i])
705
+ // ||
706
+ // not able to handle srcset case for now
707
+ /**
708
+ /\<img/.test(layoutAssets[i])
709
+ && /srcset/.test(layoutAssets[i])*/
667
710
  ) {
668
711
  continue;
669
712
  }
670
713
 
714
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preload
715
+ let asType = null;
716
+
671
717
  if ( /\<img/.test(layoutAssets[i]) ) {
672
718
  type = 'image';
673
719
  tag = 'img';
720
+ asType = type;
674
721
  }
675
722
 
676
- if ( /\<script/.test(layoutAssets[i]) ) {
677
- type = 'javascript';
678
- tag = 'script';
679
- }
723
+
680
724
 
681
725
  if ( /\<link/.test(layoutAssets[i]) ) {
682
- if ( /rel\=\"stylesheet/.test(layoutAssets[i]) ) {
683
- type = 'stylesheet';
684
- } else if ( /rel\=\"(icon|(.*)\-icon)/.test(layoutAssets[i]) ) {
685
- type = 'image';
686
- } else {
687
- type = 'file';
726
+ // if ( /rel\=\"stylesheet/.test(layoutAssets[i]) ) {
727
+ // type = 'stylesheet';
728
+ // } else if ( /rel\=\"(icon|(.*)\-icon)/.test(layoutAssets[i]) ) {
729
+ // type = 'image';
730
+ // } else {
731
+ // type = 'file';
732
+ // }
733
+ type = layoutAssets[i].match(/rel=\"[-a-z 0-9]+\"/)[0] || null;
734
+ if (type) {
735
+ type = type.replace(/^rel\=\"|"$/g, '');
736
+ }
737
+
738
+
739
+ switch (type) {
740
+ case /stylesheet/.test(type):
741
+ asType = 'style';
742
+ break;
743
+
744
+ case /javascript/.test(type):
745
+ asType = 'script';
746
+ break;
747
+
748
+ default:
749
+ asType = null;
750
+ if ( /icon/.test(type) ) {
751
+ asType = 'image';
752
+ // ignoring all (fav)icons type: rel="*icon*" case
753
+ continue;
754
+ }
755
+ if ( /font/.test(type) ) {
756
+ asType = 'font';
757
+ }
758
+ // if ( /manifest/.test(type) ) {
759
+ // asType = 'webmanifest';
760
+ // }
761
+ break;
688
762
  }
689
763
 
690
764
  tag = 'link';
691
765
  }
692
766
 
767
+ if ( /\<source/.test(layoutAssets[i]) ) {
768
+ if ( /type\=\"image/.test(layoutAssets[i]) ) {
769
+ type = 'image';
770
+ }
771
+
772
+ tag = 'source';
773
+ }
774
+
775
+ if ( /\<script/.test(layoutAssets[i]) ) {
776
+ type = 'javascript';
777
+ tag = 'script';
778
+ }
779
+
693
780
  domain = null;
781
+ let isEncodedContent = false;
782
+ // repsonsive images
783
+ // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesrcset
784
+ let srcset = null;
785
+ // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesizes
786
+ let sizes = null;
787
+ let urlArr = null;
694
788
  try {
695
- url = layoutAssets[i].match(/(src|href)\=(\".*?\"|\'.*?\')/)[0];
789
+ urlArr = layoutAssets[i].match(/(src|href|srcset)\=(\".*?\"|\'.*?\')/g);
790
+ for (let u=0, uLen=urlArr.length; u<uLen; u++) {
791
+ if ( /data\:/.test(urlArr[u]) ) {
792
+ isEncodedContent = true;
793
+ break;
794
+ }
795
+ if ( /^srcset\=/.test(urlArr[u]) ) {
796
+ srcset = urlArr[u]
797
+ .replace(/((src|href|srcset)\=\"|(src|href|srcset)\=\')/g, '')
798
+ .replace(/\"/g, '');
799
+ if ( /source/i.test(tag) ) {
800
+ sourceTagSrcSetStr += srcset + ','
801
+ }
802
+ }
803
+ if ( /^(src|href)\=/.test(urlArr[u]) ) {
804
+ url = urlArr[u]
805
+ .replace(/((src|href|srcset)\=\"|(src|href|srcset)\=\')/g, '')
806
+ .replace(/\"/g, '');
807
+ }
808
+ }
809
+ if ( isEncodedContent ) { // ignoring "data:..."
810
+ continue
811
+ }
812
+ // url = urlArr[0];
696
813
  } catch (err) {
697
- console.warn('Problem with this asset ('+ i +'/'+ len +'): '+ layoutAssets[i].substr(0, 80) +'...');
814
+ console.warn('Problem with this asset ('+ i +'/'+ len +'): '+ layoutAssets[i].substring(0, 80) +'...');
698
815
  continue;
699
816
  }
700
817
 
701
-
702
- if ( /data\:/.test(url) ) { // ignoring "data:..."
703
- continue
818
+ if ( /source/i.test(tag) ) {
819
+ continue;
704
820
  }
821
+
822
+
823
+ // if ( /data\:/.test(url) ) { // ignoring "data:..."
824
+ // continue
825
+ // }
705
826
  //url = url.replace(/((src|href)\=\"|(src|href)\=\'|\"|\')/g, '');
706
- url = url.replace(/((src|href)\=\"|(src|href)\=\')/g, '');
827
+ // url = url
828
+ // .replace(/((src|href|srcset)\=\"|(src|href|srcset)\=\')/g, '')
829
+ // .replace(/\"/g, '')
830
+ // ;
707
831
  if ( !/^\{\{/.test(url) ) {
708
832
  url = url.replace(/(\"|\')/g, '');
709
833
  }
710
- if (swig && /^\{\{/.test(url) )
834
+ if (swig && /^\{\{/.test(url) ) {
711
835
  url = swig.compile(url, swig.getOptions())(data);
836
+ }
712
837
 
713
838
  if (!/(\:\/\/|^\/\/)/.test(url) ) {
714
839
  filename = getAssetFilenameFromUrl(bundleConf, url);
@@ -728,7 +853,7 @@ function Server(options) {
728
853
  isAvailable = ( /404/.test(filename) ) ? false : true;
729
854
  if ( isAvailable ) {
730
855
  try {
731
- ext = url.substr(url.lastIndexOf('.')).match(/(\.[A-Za-z0-9]+)/)[0];
856
+ ext = url.substring(url.lastIndexOf('.')).match(/(\.[A-Za-z0-9]+)/)[0];
732
857
  } catch(err) {
733
858
 
734
859
  console.warn('No extension found for `'+ filename +'`\n'+ err.stack );
@@ -739,15 +864,41 @@ function Server(options) {
739
864
 
740
865
  assets[key] = {
741
866
  type : type,
867
+ as : asType,
742
868
  url : url,
743
869
  ext : ext,
744
- mime : (!ext) ? 'NA' : (bundleConf.server.coreConfiguration.mime[ext.substr(1)] || 'NA'),
870
+ mime : (!ext) ? 'NA' : (bundleConf.server.coreConfiguration.mime[ext.substring(1)] || 'NA'),
745
871
  filename : ( /404/.test(filename) ) ? 'not found' : filename,
746
872
  isAvailable : isAvailable
747
873
  };
748
874
 
749
- if (domain)
875
+ //sourceTagSrcSetStr
876
+ if (sourceTagSrcSetStr.length > 0) {
877
+ assets[key]['imagesrcset'] = sourceTagSrcSetStr.substring(0, sourceTagSrcSetStr.length-1);
878
+ // reset
879
+ sourceTagSrcSetStr = '';
880
+ }
881
+
882
+ if (srcset) {
883
+ if ( typeof(assets[key]['imagesrcset']) != 'undefined' ) {
884
+ assets[key]['imagesrcset'] += ', '+ srcset;
885
+ } else {
886
+ assets[key]['imagesrcset'] = srcset;
887
+ }
888
+
889
+ }
890
+
891
+ if (sizes) {
892
+ if ( typeof(assets[key]['imagesizes']) != 'undefined' ) {
893
+ assets[key]['imagesizes'] += ', '+ sizes;
894
+ } else {
895
+ assets[key]['imagesizes'] = sizes;
896
+ }
897
+ }
898
+
899
+ if (domain) {
750
900
  assets[key].domain = domain;
901
+ }
751
902
 
752
903
  if ( type == 'stylesheet' && !/not found/.test(assets[key].filename) ) {
753
904
  cssFiles.push(assets[key].filename)
@@ -873,14 +1024,14 @@ function Server(options) {
873
1024
  //key = (( /404/.test(filename) ) ? '[404]' : '[200]') +' '+ url;
874
1025
  key = url;
875
1026
  isAvailable = ( /404/.test(filename) ) ? false : true;
876
- ext = url.substr(url.lastIndexOf('.')).match(/(\.[A-Za-z0-9]+)/)[0];
1027
+ ext = url.substring(url.lastIndexOf('.')).match(/(\.[A-Za-z0-9]+)/)[0];
877
1028
  assets[key] = {
878
1029
  referrer : cssFiles[i],
879
1030
  definition : definition,
880
1031
  type : type,
881
1032
  url : url,
882
1033
  ext : ext,
883
- mime : bundleConf.server.coreConfiguration.mime[ext.substr(1)] || 'NA',
1034
+ mime : bundleConf.server.coreConfiguration.mime[ext.substring(1)] || 'NA',
884
1035
  filename : ( /404/.test(filename) ) ? 'not found' : filename
885
1036
  };
886
1037
 
@@ -936,12 +1087,14 @@ function Server(options) {
936
1087
  * }
937
1088
  */
938
1089
 
939
- if (swig) {
1090
+
1091
+ if (swig) { // Deprecated
940
1092
  var assetsStr = JSON.stringify(assets);
941
1093
  assets = swig.compile( assetsStr.substring(1, assetsStr.length-1), swig.getOptions() )(data);
942
- return '{'+ assets +'}'
1094
+
1095
+ return '{'+ assets +'}';
943
1096
  } else {
944
- return assets
1097
+ return JSON.stringify(assets)
945
1098
  }
946
1099
  }
947
1100
 
@@ -997,8 +1150,10 @@ function Server(options) {
997
1150
  if ( typeof(request.headers.origin) != 'undefined' ) {
998
1151
  authority = request.headers.origin;
999
1152
  } else if (request.headers.referer) {
1000
- referer = request.headers.referer.match(/^[https://|http://][a-z0-9-_.:/]+\//)[0];
1001
- referer = referer.substring(0, referer.length-1);
1153
+ referer = request.headers.referer.match(/^[https://|http://][a-z0-9-_.:/]+\//);
1154
+ if (Array.isArray(referer) && referer.length > 0) {
1155
+ referer = referer[0].substring(0, referer.length-1);
1156
+ }
1002
1157
  }
1003
1158
 
1004
1159
  // access-control-allow-origin settings
@@ -1027,6 +1182,7 @@ function Server(options) {
1027
1182
 
1028
1183
  re = new RegExp(authority);
1029
1184
  allowedOrigin = ( typeof(conf.server.response.header['access-control-allow-origin']) != 'undefined' && conf.server.response.header['access-control-allow-origin'] != '' ) ? conf.server.response.header['access-control-allow-origin'] : authority;
1185
+ // console.debug('[ server ][access-control-allow-origin] ', allowedOrigin);
1030
1186
  var found = null, origin = null, origins = null; // to handles multiple origins
1031
1187
 
1032
1188
  var originHostReplacement = function(name) {
@@ -1035,8 +1191,8 @@ function Server(options) {
1035
1191
  return name
1036
1192
  }
1037
1193
 
1038
- var env = self.conf.env
1039
- , scope = self.conf.scope
1194
+ var env = self.conf.env || self.env
1195
+ , scope = self.conf.scope || self.scope
1040
1196
  ;
1041
1197
 
1042
1198
  for (let i=0, len=matched.length; i<len; ++i) {
@@ -1054,6 +1210,9 @@ function Server(options) {
1054
1210
  project = arr[0];
1055
1211
  env = (arr[1]) ? arr[1] : env;
1056
1212
  }
1213
+ if ( typeof(self.conf[bundle]) == 'undefined' ) {
1214
+ continue;
1215
+ }
1057
1216
  scheme = self.conf[bundle][env].server.scheme;
1058
1217
  hostname = ( !self.conf[bundle][env].hostname ) ? self.conf[bundle][env].server.scheme + '://' + self.conf[bundle][env].host + ':' + self.conf[bundle][env].server.port : self.conf[bundle][env].hostname;
1059
1218
  name = name.replace(oldHost, hostname);
@@ -1112,7 +1271,7 @@ function Server(options) {
1112
1271
 
1113
1272
  // update response
1114
1273
  try {
1115
- if ( responseHeaders && responseHeaders.count() > 0 ) {
1274
+ if ( responseHeaders && Object.keys(responseHeaders).length > 0 ) {
1116
1275
  return merge(responseHeaders, response.getHeaders());
1117
1276
  }
1118
1277
  return response.getHeaders();
@@ -1122,13 +1281,13 @@ function Server(options) {
1122
1281
  }
1123
1282
 
1124
1283
  this.onHttp2Stream = function(stream, headers, response) {
1125
- var header = null
1126
- , isWebroot = false
1127
- , pathname = null
1128
- , asset = null
1129
- , assets = this._options.template.assets
1130
- , conf = this._options.conf
1131
- , cacheless = conf.cacheless
1284
+ var header = null
1285
+ , isWebroot = false
1286
+ , pathname = null
1287
+ , asset = null
1288
+ , assets = this._options.template.assets
1289
+ , conf = this._options.conf
1290
+ , isCacheless = conf.isCacheless
1132
1291
  ;
1133
1292
 
1134
1293
 
@@ -1157,7 +1316,17 @@ function Server(options) {
1157
1316
  ) ? true: false
1158
1317
  ;
1159
1318
 
1160
- if (!stream.pushAllowed) {
1319
+ if (!stream.pushAllowed ) {
1320
+
1321
+ // Fix added for static sites
1322
+ if (
1323
+ !assets[ url ]
1324
+ ||
1325
+ !assets[ url ].isBinary && !assets[ url ].isHandler
1326
+ ) {
1327
+ return;
1328
+ }
1329
+
1161
1330
  asset = {
1162
1331
  url : url,
1163
1332
  filename : assets[ url ].filename,
@@ -1203,6 +1372,7 @@ function Server(options) {
1203
1372
  , header
1204
1373
  //, { onError }
1205
1374
  );
1375
+
1206
1376
  } else {
1207
1377
  stream.respond(header);
1208
1378
  stream.end();
@@ -1227,7 +1397,7 @@ function Server(options) {
1227
1397
  ':status': 301
1228
1398
  };
1229
1399
 
1230
- if (cacheless) {
1400
+ if (isCacheless) {
1231
1401
  header['cache-control'] = 'no-cache, no-store, must-revalidate';
1232
1402
  header['pragma'] = 'no-cache';
1233
1403
  header['expires'] = '0';
@@ -1300,7 +1470,7 @@ function Server(options) {
1300
1470
  header['content-length'] = fs.statSync(assets[ url ].filename).size;
1301
1471
  }
1302
1472
 
1303
- if (cacheless) {
1473
+ if (isCacheless) {
1304
1474
  // source maps integration for javascript & css
1305
1475
  if ( /(.js|.css)$/.test(asset.filename) && fs.existsSync(asset.filename +'.map') ) {
1306
1476
  //pathname = asset.filename +'.map';
@@ -1389,7 +1559,7 @@ function Server(options) {
1389
1559
  self._options.conf = bundleConf
1390
1560
  }
1391
1561
 
1392
- var cacheless = bundleConf.cacheless;
1562
+ var isCacheless = bundleConf.isCacheless;
1393
1563
  // by default
1394
1564
  var filename = bundleConf.publicPath + pathname;
1395
1565
  var isFilenameDir = null
@@ -1397,6 +1567,9 @@ function Server(options) {
1397
1567
  , isBinary = null
1398
1568
  , isHandler = null
1399
1569
  , hanlersPath = null
1570
+ , preferedEncoding = bundleConf.server.preferedCompressionEncodingOrder
1571
+ , acceptEncodingArr = (request.headers['accept-encoding']) ? request.headers['accept-encoding'].replace(/\s+/g, '').split(/\,/) : []
1572
+ , acceptEncoding = null
1400
1573
  ;
1401
1574
 
1402
1575
  // catch `statics.json` defined paths
@@ -1417,7 +1590,6 @@ function Server(options) {
1417
1590
  var key = pathname.replace(pathname.split('/').splice(-1), '');
1418
1591
  for ( ; s < sLen; ++s ) {
1419
1592
  if ( bundleConf.staticResources[s] == key ) {
1420
- // if ( eval('/^' + bundleConf.staticResources[s].replace(/\//g,'\\/') +'/').test(pathname) ) {
1421
1593
  filename = bundleConf.content.statics[ bundleConf.staticResources[s] ] +'/'+ pathname.replace(bundleConf.staticResources[s], '');
1422
1594
  break;
1423
1595
  }
@@ -1431,9 +1603,11 @@ function Server(options) {
1431
1603
 
1432
1604
 
1433
1605
  filename = decodeURIComponent(filename);
1434
- fs.exists(filename, function onStaticExists(exist) {
1606
+ let filenameObj = new _(filename, true);
1607
+ filenameObj.exists(function onStaticExists(exists) {
1608
+ // fs.exists(filename, function onStaticExists(exists) {
1435
1609
 
1436
- if (!exist) {
1610
+ if (!exists) {
1437
1611
  return throwError(response, 404, 'Page not found: \n' + pathname, next);
1438
1612
  }
1439
1613
 
@@ -1446,48 +1620,49 @@ function Server(options) {
1446
1620
  if ( !fs.existsSync(filename) ) {
1447
1621
  throwError(response, 403, 'Forbidden: \n' + pathname, next);
1448
1622
  return;
1449
- } else {
1450
- var ext = 'html';
1451
- if ( /http\/2/.test(protocol) ) {
1452
- header = {
1453
- ':status': 301,
1454
- 'location': request.url,
1455
- 'content-type': bundleConf.server.coreConfiguration.mime[ext]+'; charset='+ bundleConf.encoding
1456
- };
1623
+ }
1457
1624
 
1458
- if (cacheless) {
1459
- header['cache-control'] = 'no-cache, no-store, must-revalidate';
1460
- header['pragma'] = 'no-cache';
1461
- header['expires'] = '0';
1462
- }
1463
- request = checkPreflightRequest(request, response);
1464
- header = completeHeaders(header, request, response);
1625
+ var ext = 'html';
1626
+ if ( /http\/2/.test(protocol) ) {
1627
+ header = {
1628
+ ':status': 301,
1629
+ 'location': request.url,
1630
+ 'content-type': bundleConf.server.coreConfiguration.mime[ext]+'; charset='+ bundleConf.encoding
1631
+ };
1465
1632
 
1466
- if (!stream.destroyed) {
1467
- stream.respond(header);
1468
- stream.end();
1469
- }
1633
+ if (isCacheless) {
1634
+ header['cache-control'] = 'no-cache, no-store, must-revalidate';
1635
+ header['pragma'] = 'no-cache';
1636
+ header['expires'] = '0';
1637
+ }
1638
+ request = checkPreflightRequest(request, response);
1639
+ header = completeHeaders(header, request, response);
1470
1640
 
1471
- } else {
1472
- response.setHeader('location', request.url);
1473
- request = checkPreflightRequest(request, response);
1474
- completeHeaders(null, request, response);
1475
- if (cacheless) {
1476
- response.writeHead(301, {
1477
- 'cache-control': 'no-cache, no-store, must-revalidate', // preventing browsers from using cache
1478
- 'pragma': 'no-cache',
1479
- 'expires': '0',
1480
- 'content-type': bundleConf.server.coreConfiguration.mime[ext]
1481
- });
1482
- }
1483
- response.end()
1641
+ if (!stream.destroyed) {
1642
+ stream.respond(header);
1643
+ stream.end();
1644
+ }
1645
+
1646
+ } else {
1647
+ response.setHeader('location', request.url);
1648
+ request = checkPreflightRequest(request, response);
1649
+ completeHeaders(null, request, response);
1650
+ if (isCacheless) {
1651
+ response.writeHead(301, {
1652
+ 'cache-control': 'no-cache, no-store, must-revalidate', // preventing browsers from using cache
1653
+ 'pragma': 'no-cache',
1654
+ 'expires': '0',
1655
+ 'content-type': bundleConf.server.coreConfiguration.mime[ext]
1656
+ });
1484
1657
  }
1658
+ response.end()
1485
1659
  }
1660
+
1486
1661
  return;
1487
1662
  }
1488
1663
 
1489
1664
 
1490
- if (cacheless) {
1665
+ if (isCacheless) {
1491
1666
  delete require.cache[require.resolve(filename)];
1492
1667
  }
1493
1668
 
@@ -1527,6 +1702,23 @@ function Server(options) {
1527
1702
  isBinary = false;
1528
1703
  isHandler = true;
1529
1704
  file = '(gina.ready(function onGinaReady($){\n'+ file + '\n},window["originalContext"]));'
1705
+
1706
+ // acceptEncodingArr = request.headers['accept-encoding'].replace(/\s+/g, '').split(/\,/);
1707
+ // acceptEncoding = null;
1708
+ for (let e=0, eLen=preferedEncoding.length; e<eLen; e++) {
1709
+ if ( acceptEncodingArr && acceptEncodingArr.indexOf(preferedEncoding[e]) > -1 ) {
1710
+ acceptEncoding = bundleConf.server.coreConfiguration.encoding[ preferedEncoding[e] ] ;
1711
+ break;
1712
+ }
1713
+ }
1714
+ // Compressed content
1715
+ if (
1716
+ !isCacheless
1717
+ && acceptEncoding
1718
+ && fs.existsSync(filename + acceptEncoding)
1719
+ ) {
1720
+ isBinary = true;
1721
+ }
1530
1722
  }
1531
1723
  }
1532
1724
 
@@ -1537,8 +1729,12 @@ function Server(options) {
1537
1729
  request.url = ( ext != null && typeof(ext[0]) != 'undefined' ) ? request.url : request.url + 'index.html';
1538
1730
 
1539
1731
  self._responseHeaders = response.getHeaders();
1540
- if (!isBinary && typeof(self._options.template.assets[request.url]) == 'undefined')
1732
+ if (
1733
+ !isBinary
1734
+ && typeof(self._options.template.assets[request.url]) == 'undefined'
1735
+ ) {
1541
1736
  self._options.template.assets = getAssets(bundleConf, file);
1737
+ }
1542
1738
 
1543
1739
  if (
1544
1740
  typeof(self._options.template.assets[request.url]) == 'undefined'
@@ -1603,7 +1799,7 @@ function Server(options) {
1603
1799
  'location': request.url
1604
1800
  };
1605
1801
 
1606
- if (cacheless) {
1802
+ if (isCacheless) {
1607
1803
  header['cache-control'] = 'no-cache, no-store, must-revalidate';
1608
1804
  header['pragma'] = 'no-cache';
1609
1805
  header['expires'] = '0';
@@ -1674,11 +1870,11 @@ function Server(options) {
1674
1870
  'content-type': contentType + '; charset='+ bundleConf.encoding
1675
1871
  };
1676
1872
 
1677
- if (cacheless) {
1873
+ if (isCacheless) {
1678
1874
  // source maps integration for javascript & css
1679
1875
  if ( /(.js|.css)$/.test(filename) && fs.existsSync(filename +'.map') && !/sourceMappingURL/.test(file) ) {
1680
1876
  //pathname = pathname +'.map';
1681
- pathname = webroot + pathname.substr(1) +'.map';
1877
+ pathname = webroot + pathname.substring(1) +'.map';
1682
1878
  // serve without cache
1683
1879
  header['X-SourceMap'] = pathname;
1684
1880
  header['cache-control'] = 'no-cache, no-store, must-revalidate';
@@ -1702,17 +1898,40 @@ function Server(options) {
1702
1898
  completeHeaders(null, request, response);
1703
1899
  response.setHeader('content-type', contentType +'; charset='+ bundleConf.encoding);
1704
1900
  // if (/\.(woff|woff2)$/i.test(filename) ) {
1705
- // response.setHeader("Transfer-Encoding", 'Identity')
1901
+ // response.setHeader("transfer-encoding", 'Identity')
1706
1902
  // }
1903
+
1904
+
1707
1905
  if (isBinary) {
1708
1906
  response.setHeader('content-length', fs.statSync(filename).size);
1907
+
1908
+ // acceptEncodingArr = request.headers['accept-encoding'].replace(/\s+/g, '').split(/\,/);
1909
+ // acceptEncoding = null;
1910
+ for (let e=0, eLen=preferedEncoding.length; e<eLen; e++) {
1911
+ if ( acceptEncodingArr && acceptEncodingArr.indexOf(preferedEncoding[e]) > -1 ) {
1912
+ acceptEncoding = bundleConf.server.coreConfiguration.encoding[ preferedEncoding[e] ] ;
1913
+ break;
1914
+ }
1915
+ }
1916
+ // Compressed content
1917
+ if (
1918
+ !isCacheless
1919
+ && acceptEncoding
1920
+ && fs.existsSync(filename + acceptEncoding)
1921
+ ) {
1922
+ filename += acceptEncoding;
1923
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Encoding
1924
+ response.setHeader('content-encoding', acceptEncoding.replace(/^\./, ''));
1925
+ // override content length
1926
+ response.setHeader('content-length', fs.statSync(filename).size);
1927
+ }
1709
1928
  }
1710
1929
 
1711
- if (cacheless) {
1930
+ if (isCacheless) {
1712
1931
  // source maps integration for javascript & css
1713
1932
  if ( /(.js|.css)$/.test(filename) && fs.existsSync(filename +'.map') && !/sourceMappingURL/.test(file) ) {
1714
1933
  //pathname = pathname +'.map'
1715
- pathname = webroot + pathname.substr(1) +'.map';
1934
+ pathname = webroot + pathname.substring(1) +'.map';
1716
1935
  response.setHeader("X-SourceMap", pathname)
1717
1936
  }
1718
1937
 
@@ -1729,6 +1948,7 @@ function Server(options) {
1729
1948
 
1730
1949
 
1731
1950
  if (isBinary) { // images, javascript, pdf ....
1951
+
1732
1952
  fs.createReadStream(filename)
1733
1953
  .on('end', function onResponse(){
1734
1954
  console.info(request.method +' [200] '+ pathname);
@@ -1753,7 +1973,8 @@ function Server(options) {
1753
1973
  });
1754
1974
 
1755
1975
 
1756
- })
1976
+ });
1977
+ filenameObj = null;
1757
1978
  }
1758
1979
 
1759
1980
 
@@ -1765,6 +1986,28 @@ function Server(options) {
1765
1986
  // catch all (request urls)
1766
1987
  self.instance.all('*', function onInstance(request, response, next) {
1767
1988
 
1989
+ // Caching = [...]
1990
+ // TODO - handle this through a middleware
1991
+ /**
1992
+ * var cacheIndex = ['/api/document/get/b47c4dd3-f7c4-44b2-b1fb-401948be1ca4'].indexOf(request.url)
1993
+ * if ( cacheIndex > -1) {
1994
+ * // return caching[cacheIndex].content
1995
+ * }
1996
+ */
1997
+
1998
+ // Retrieving cached route
1999
+ // var cachedUrls = ['/'];
2000
+ // if (cachedUrls.indexOf(request.url) > -1) {
2001
+ // request.routing = JSON.parse('{"method":"GET","namespace":"home","url":"/","rule":"home@public","param":{"control":"home","file":"../home"},"middleware":["middlewares.maintenance.check"],"bundle":"public","isXMLRequest":false,"isWithCredentials":false}');
2002
+ // var headers = JSON.parse('{"x-powered-by":"Gina I/O - v0.1.6-alpha.94","access-control-allow-headers":"X-Requested-With, Content-Type","access-control-allow-methods":"GET","access-control-allow-credentials":true,"vary":"Origin","accept-language":"en-US,en;q=0.8,fr;q=0.6"}');
2003
+ // for (let h in headers) {
2004
+ // response.setHeader(h, headers[h]);
2005
+ // }
2006
+
2007
+ // return local.router.route(request, response, next, request.routing);
2008
+ // }
2009
+
2010
+
1768
2011
 
1769
2012
  request.setEncoding(self.conf[self.appName][self.env].encoding);
1770
2013
  // be carfull, if you are using jQuery + cross domain, you have to set the header manually in your $.ajax query -> headers: {'X-Requested-With': 'XMLHttpRequest'}
@@ -1864,7 +2107,7 @@ function Server(options) {
1864
2107
  if ( typeof(ext) != 'undefined' && ext != null) {
1865
2108
  ext = ext[0];
1866
2109
  // if image with `@` found
1867
- if ( /^image/i.test(self.conf[self.appName][self.env].server.coreConfiguration.mime[ext.substr(1)]) ) {
2110
+ if ( /^image/i.test(self.conf[self.appName][self.env].server.coreConfiguration.mime[ext.substring(1)]) ) {
1868
2111
  isImage = true
1869
2112
  }
1870
2113
  }
@@ -1873,7 +2116,7 @@ function Server(options) {
1873
2116
  // and must not be an email
1874
2117
  && !/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(request.url)
1875
2118
  // and must be handled by mime.types
1876
- && typeof(self.conf[self.appName][self.env].server.coreConfiguration.mime[ext.substr(1)]) != 'undefined'
2119
+ && typeof(self.conf[self.appName][self.env].server.coreConfiguration.mime[ext.substring(1)]) != 'undefined'
1877
2120
  ||
1878
2121
  ext != null
1879
2122
  && isImage
@@ -1899,7 +2142,7 @@ function Server(options) {
1899
2142
 
1900
2143
  if (
1901
2144
  staticProps.isStaticFilename && staticsArr.indexOf(request.url) > -1
1902
- || staticProps.isStaticFilename && staticsArr.indexOf( request.url.replace(request.url.substr(request.url.lastIndexOf('/')+1), '') ) > -1
2145
+ || staticProps.isStaticFilename && staticsArr.indexOf( request.url.replace(request.url.substring(request.url.lastIndexOf('/')+1), '') ) > -1
1903
2146
  || staticProps.isStaticFilename && new RegExp('^'+ staticProps.firstLevel).test(request.url)
1904
2147
  || /\/$/.test(request.url) && !isWebrootHandledByRouting && !/\/engine\.io\//.test(request.url)
1905
2148
  ) {
@@ -2067,11 +2310,14 @@ function Server(options) {
2067
2310
  'method': 'POST',
2068
2311
  'bundle' : self.appName
2069
2312
  };
2070
- var busboy = new Busboy({ headers: request.headers });
2313
+ var busboy = Busboy({ headers: request.headers });
2071
2314
 
2072
2315
  // busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated) {
2073
2316
  // console.log('Field [' + fieldname + ']: value: ' + inspect(val));
2074
2317
  // });
2318
+
2319
+ // Attention: on busboy upgrade, we needs to adapt `busboy/lib/types/multipart.js`
2320
+ // For this, check the emit method
2075
2321
  busboy.on('file', function(fieldname, file, filename, encoding, mimetype, group) {
2076
2322
 
2077
2323
  file._dataLen = 0;
@@ -2087,7 +2333,7 @@ function Server(options) {
2087
2333
  && opt.groups[group].allowedExtensions != '*'
2088
2334
  ) {
2089
2335
  var ext = opt.groups[group].allowedExtensions;
2090
- var fileExt = filename.substr(filename.lastIndexOf('.')+1)
2336
+ var fileExt = filename.substring(filename.lastIndexOf('.')+1)
2091
2337
  if ( !Array.isArray(ext) ) {
2092
2338
  ext = [ext]
2093
2339
  }
@@ -2224,10 +2470,11 @@ function Server(options) {
2224
2470
 
2225
2471
  });//EO this.instance
2226
2472
 
2227
- self.instance.listen(self.conf[self.appName][self.env].server.port);//By Default 3100
2473
+
2228
2474
  // Timeout in milliseconds - e.g.: (1000x60)x2 => 2 min
2229
2475
  self.instance.timeout = 0; // zero for unlimited
2230
-
2476
+ //Port by default would be 3100
2477
+ self.instance.listen(self.conf[self.appName][self.env].server.port);
2231
2478
 
2232
2479
  self.emit('started', self.conf[self.appName][self.env], true);
2233
2480
  }
@@ -2243,12 +2490,12 @@ function Server(options) {
2243
2490
  // get rid of encoding issues
2244
2491
  try {
2245
2492
  if ( !/multipart\/form-data;/.test(request.headers['content-type']) ) {
2246
- if ( /application\/x\-www\-form\-urlencoded/.test(request.headers['content-type']) && /\+/.test(request.body) ) {
2493
+ if ( !/application\/x\-www\-form\-urlencoded/.test(request.headers['content-type']) && /\+/.test(request.body) ) {
2247
2494
  request.body = request.body.replace(/\+/g, ' ');
2248
2495
  }
2249
2496
 
2250
- if ( request.body.substr(0,1) == '?')
2251
- request.body = request.body.substr(1);
2497
+ if ( request.body.substring(0,1) == '?')
2498
+ request.body = request.body.substring(1);
2252
2499
 
2253
2500
  try {
2254
2501
  bodyStr = decodeURIComponent(request.body); // it is already a string for sure
@@ -2399,8 +2646,8 @@ function Server(options) {
2399
2646
  request.body = request.body.replace(/\+/g, ' ');
2400
2647
  }
2401
2648
 
2402
- if ( request.body.substr(0,1) == '?')
2403
- request.body = request.body.substr(1);
2649
+ if ( request.body.substring(0,1) == '?')
2650
+ request.body = request.body.substring(1);
2404
2651
 
2405
2652
  // false & true case
2406
2653
  try {
@@ -2521,8 +2768,10 @@ function Server(options) {
2521
2768
 
2522
2769
  var config = new Config();
2523
2770
  config.setBundles(self.bundles);
2524
- var conf = config.getInstance(); // for all loaded bundles
2525
- if ( typeof(conf) != 'undefined') {//for cacheless mode
2771
+ // for all loaded bundles
2772
+ var conf = config.getInstance();
2773
+ //for cacheless mode
2774
+ if ( typeof(conf) != 'undefined') {
2526
2775
  self.conf = conf;
2527
2776
  }
2528
2777
 
@@ -2537,7 +2786,7 @@ function Server(options) {
2537
2786
  if (self.bundles.indexOf(b) < 0) continue;
2538
2787
  if ( typeof(conf[b][self.env].content) != 'undefined' && typeof(conf[b][self.env].content.statics) != 'undefined' && conf[b][self.env].content.statics.count() > 0 ) {
2539
2788
  for (let s in conf[b][self.env].content.statics) {
2540
- s = (s.substr(0,1) == '/') ? s.substr(1) : s;
2789
+ s = (s.substring(0,1) == '/') ? s.substring(1) : s;
2541
2790
  if ( (new RegExp('^/'+s)).test(pathname) ) {
2542
2791
  bundle = b;
2543
2792
  break end
@@ -2572,18 +2821,18 @@ function Server(options) {
2572
2821
  }
2573
2822
 
2574
2823
  var onBundleConfigLoaded = function(bundle, options) {
2575
- var err = options.err
2576
- , cacheless = options.config.isCacheless()
2577
- , pathname = options.pathname
2578
- , req = options.req
2579
- , res = options.res
2580
- , config = options.conf
2581
- , next = options.next
2582
- , callback = options.callback
2824
+ var err = options.err
2825
+ , isCacheless = options.config.isCacheless()
2826
+ , pathname = options.pathname
2827
+ , req = options.req
2828
+ , res = options.res
2829
+ , config = options.conf
2830
+ , next = options.next
2831
+ , callback = options.callback
2583
2832
  ;
2584
2833
 
2585
2834
  //Reloading assets & files.
2586
- // if (!cacheless) { // all but dev & debug
2835
+ // if (!isCacheless) { // all but dev & debug
2587
2836
  callback(err, bundle, pathname, options.config, req, res, next)
2588
2837
  // } else {
2589
2838
  // config.refresh(bundle, function(err, routing) {
@@ -2703,10 +2952,10 @@ function Server(options) {
2703
2952
  var handle = async function(req, res, next, bundle, pathname, config) {
2704
2953
 
2705
2954
  var matched = false
2706
- , isRoute = {}
2955
+ , isRoute = null
2707
2956
  , withViews = hasViews(bundle)
2708
2957
  , router = local.router
2709
- , cacheless = config.isCacheless()
2958
+ , isCacheless = config.isCacheless()
2710
2959
  , wroot = null
2711
2960
  ;
2712
2961
 
@@ -2734,13 +2983,35 @@ function Server(options) {
2734
2983
  return;
2735
2984
  }
2736
2985
  var isMethodAllowed = null, hostname = null;
2986
+
2987
+ // Checking cached route
2988
+ var hasCachedRoute = await routingLib.getCached(req.method +':'+ pathname, req) || null;
2989
+ if ( hasCachedRoute ) {
2990
+ // Supposed to have everything we need to route
2991
+ isRoute = hasCachedRoute;
2992
+ // req = isRoute.request;
2993
+ } else {
2994
+ isRoute = {}
2995
+ }
2996
+
2737
2997
  out:
2738
2998
  for (let name in routing) {
2999
+ // Ignore cached route
3000
+ if ( hasCachedRoute ) {
3001
+ matched = true;
3002
+ break;
3003
+ }
3004
+
3005
+ // Ignoring routes out of scope
3006
+ if ( routing[name].scopes.indexOf(process.env.NODE_SCOPE) < 0 ) {
3007
+ continue;
3008
+ }
3009
+
2739
3010
  if ( typeof(routing[name]['param']) == 'undefined' ) {
2740
3011
  break;
2741
3012
  }
2742
3013
 
2743
- // updating hostname
3014
+ // Updating hostname
2744
3015
  // if (
2745
3016
  // typeof(routing[name].hostname) == 'undefined' && !/^redirect$/.test(routing[name].param.control)
2746
3017
  // || !routing[name].hostname && !/^redirect$/.test(routing[name].param.control)
@@ -2755,7 +3026,7 @@ function Server(options) {
2755
3026
  // }
2756
3027
 
2757
3028
  if (routing[name].bundle != bundle) continue;
2758
- // method filter
3029
+ // Method filter
2759
3030
  method = routing[name].method;
2760
3031
  if ( /\,/.test( method ) && reMethod.test(method) ) {
2761
3032
  method = req.method
@@ -2764,10 +3035,12 @@ function Server(options) {
2764
3035
  // Preparing params to relay to the router.
2765
3036
  params = {
2766
3037
  method : method,
3038
+ control : routing[name].param.control,
2767
3039
  requirements : routing[name].requirements,
2768
3040
  namespace : routing[name].namespace || undefined,
2769
3041
  url : decodeURI(pathname), /// avoid %20
2770
3042
  rule : routing[name].originalRule || name,
3043
+ cache : routing[name].cache || null,
2771
3044
  // We clone because we are going to modify it while comparing urls
2772
3045
  param : JSON.clone(routing[name].param),
2773
3046
  // We clone because we are going to modify it while routing (.splice(..))
@@ -2777,7 +3050,7 @@ function Server(options) {
2777
3050
  isWithCredentials : req.isWithCredentials
2778
3051
  };
2779
3052
 
2780
- //Parsing for the right url.
3053
+ // Parsing for the right url.
2781
3054
  try {
2782
3055
  isRoute = await routingLib.compareUrls(params, routing[name].url, req, res, next);
2783
3056
  } catch (err) {
@@ -2793,7 +3066,7 @@ function Server(options) {
2793
3066
 
2794
3067
  _routing = req.routing;
2795
3068
 
2796
- // comparing routing method VS request.url method
3069
+ // Comparing routing method VS request.url method
2797
3070
  isMethodAllowed = reMethod.test(_routing.method);
2798
3071
  if (!isMethodAllowed) {
2799
3072
  // Exception - Method override
@@ -2807,7 +3080,7 @@ function Server(options) {
2807
3080
  }
2808
3081
  }
2809
3082
 
2810
- // handling GET method exception - if no param found
3083
+ // Handling GET method exception - if no param found
2811
3084
  var methods = ['get', 'delete'], method = req.method.toLowerCase();
2812
3085
  var p = null;
2813
3086
  if (
@@ -2845,13 +3118,14 @@ function Server(options) {
2845
3118
  // onRouting Event ???
2846
3119
  if (isRoute.past) {
2847
3120
  matched = true;
3121
+ // Caching route
3122
+ routingLib.cache(req.method +':'+ pathname, name, routing[name], params, req[method]);
2848
3123
  isRoute = {};
2849
3124
 
2850
3125
  break;
2851
3126
  }
2852
-
2853
3127
  }
2854
- }
3128
+ } // EO for (let name in routing) {
2855
3129
 
2856
3130
 
2857
3131
 
@@ -2961,11 +3235,11 @@ function Server(options) {
2961
3235
  , ext = null
2962
3236
  , isHtmlContent = false
2963
3237
  , hasCustomErrorFile = false
2964
- , eCode = code.toString().substr(0,1) + 'xx'
3238
+ , eCode = code.toString().substring(0,1) + 'xx'
2965
3239
  ;
2966
- var extArr = url.substr(url.lastIndexOf('.')).match(/(\.[A-Za-z0-9]+)/);
3240
+ var extArr = url.substring(url.lastIndexOf('.')).match(/(\.[A-Za-z0-9]+)/);
2967
3241
  if (extArr) {
2968
- ext = extArr[0].substr(1);
3242
+ ext = extArr[0].substring(1);
2969
3243
  }
2970
3244
  if ( !ext || /^(html|htm)$/i.test(ext) ) {
2971
3245
  isHtmlContent = true;