gina 0.1.6-alpha.14 → 0.1.6-alpha.141

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 (390) 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.14/lib/inherits → v0.1.6-alpha.141}/LICENSE +1 -1
  7. package/framework/v0.1.6-alpha.141/VERSION +1 -0
  8. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/plugin/README.md +1 -0
  9. package/framework/v0.1.6-alpha.141/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
  10. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +1 -1
  11. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/plugin/dist/vendor/gina/js/gina.js +794 -257
  12. package/framework/v0.1.6-alpha.141/core/asset/plugin/dist/vendor/gina/js/gina.min.js +782 -0
  13. package/framework/v0.1.6-alpha.141/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
  14. package/framework/v0.1.6-alpha.141/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +8 -0
  15. package/framework/v0.1.6-alpha.141/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
  16. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/config.js +158 -78
  17. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/connectors/couchbase/index.js +108 -26
  18. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/connectors/couchbase/lib/connector.v4.js +124 -22
  19. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/connectors/couchbase/lib/session-store.v4.js +5 -2
  20. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/controller/controller.js +762 -189
  21. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/controller/index.js +2 -2
  22. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/.github/workflows/ci.yml +24 -0
  23. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/.github/workflows/lint.yml +23 -0
  24. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/README.md +191 -0
  25. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-big.js +149 -0
  26. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-small.js +143 -0
  27. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-big.js +154 -0
  28. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-small.js +148 -0
  29. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-100pairs-small.js +101 -0
  30. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-900pairs-small-alt.js +84 -0
  31. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/lib/index.js +57 -0
  32. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/lib/types/multipart.js +680 -0
  33. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/lib/types/urlencoded.js +350 -0
  34. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/lib/utils.js +596 -0
  35. package/framework/v0.1.6-alpha.141/core/deps/busboy-1.6.0/package.json +22 -0
  36. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/.travis.yml +4 -0
  37. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/LICENSE +21 -0
  38. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/bool.js +10 -0
  39. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/boolean_double.js +7 -0
  40. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/boolean_single.js +7 -0
  41. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/default_hash.js +8 -0
  42. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/default_singles.js +7 -0
  43. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/divide.js +8 -0
  44. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/line_count.js +20 -0
  45. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/line_count_options.js +29 -0
  46. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/line_count_wrap.js +29 -0
  47. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/nonopt.js +4 -0
  48. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/reflect.js +2 -0
  49. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/short.js +3 -0
  50. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/string.js +11 -0
  51. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/usage-options.js +19 -0
  52. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/example/xup.js +10 -0
  53. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/index.js +343 -0
  54. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/package.json +31 -0
  55. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/package.json.dist +39 -0
  56. package/framework/v0.1.6-alpha.141/core/deps/optimist-0.6.1/readme.markdown +513 -0
  57. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/HISTORY.md +498 -0
  58. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/LICENSE +7 -0
  59. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/README.md +88 -0
  60. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/bin/swig.js +161 -0
  61. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/bin/swig.js.dist +161 -0
  62. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/dist/swig.min.js +7 -0
  63. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/dist/swig.min.js.map +8 -0
  64. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/index.js +1 -0
  65. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/dateformatter.js +198 -0
  66. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/filters.js +630 -0
  67. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/lexer.js +306 -0
  68. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/loaders/filesystem.js +59 -0
  69. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/loaders/index.js +53 -0
  70. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/loaders/memory.js +63 -0
  71. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/parser.js +744 -0
  72. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/swig.js +740 -0
  73. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/autoescape.js +37 -0
  74. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/block.js +25 -0
  75. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/else.js +25 -0
  76. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/elseif.js +28 -0
  77. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/extends.js +19 -0
  78. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/filter.js +68 -0
  79. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/for.js +130 -0
  80. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/if.js +86 -0
  81. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/import.js +91 -0
  82. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/include.js +100 -0
  83. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/index.js +16 -0
  84. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/macro.js +79 -0
  85. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/parent.js +51 -0
  86. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/raw.js +23 -0
  87. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/set.js +109 -0
  88. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/tags/spaceless.js +42 -0
  89. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/lib/utils.js +184 -0
  90. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/package.json +57 -0
  91. package/framework/v0.1.6-alpha.141/core/deps/swig-1.4.2/package.json.dist +61 -0
  92. package/framework/v0.1.6-alpha.141/core/deps/swig-client/swig.js +5031 -0
  93. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/dev/index.js +1 -1
  94. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/dev/lib/factory.js +1 -1
  95. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/gna.js +106 -22
  96. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/index.js +3 -3
  97. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/src/make.js +1 -1
  98. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/mime.types +1 -0
  99. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/model/entity.js +5 -5
  100. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/model/index.js +30 -26
  101. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/model/template/entityFactory.js +1 -1
  102. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/model/template/index.js +1 -1
  103. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/index.js +3 -3
  104. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/file/package.json +2 -2
  105. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/intl/package.json +2 -2
  106. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/storage/package.json +2 -2
  107. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/validator/package.json +2 -2
  108. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/validator/src/form-validator.js +39 -27
  109. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/validator/src/main.js +490 -114
  110. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/router.js +92 -47
  111. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/server.isaac.js +94 -43
  112. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/server.js +329 -134
  113. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/status.codes +1 -11
  114. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle/controllers/setup.js +2 -2
  115. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/command/gina.tpl +1 -1
  116. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/conf/env.json +19 -0
  117. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/conf/templates.json +4 -2
  118. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/console.js +1 -1
  119. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/context.js +30 -13
  120. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/data/package.json +2 -2
  121. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/data/src/main.js +1 -1
  122. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/dateFormat.js +1 -1
  123. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/index.js +1 -1
  124. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/json/package.json +2 -2
  125. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/json/src/main.js +6 -4
  126. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/path.js +31 -15
  127. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/plugins/package.json +2 -2
  128. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/plugins/src/api-error.js +2 -2
  129. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/plugins/src/main.js +1 -1
  130. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/task.js +2 -2
  131. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/text.js +1 -1
  132. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/archiver/package.json +2 -2
  133. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/archiver/src/main.js +11 -11
  134. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/add.js +2 -1
  135. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/start.js +21 -8
  136. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/env/get.js +1 -1
  137. package/framework/v0.1.6-alpha.141/lib/cmd/env/help.js +30 -0
  138. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/build.js +1 -1
  139. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/dot.js +21 -0
  140. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/init.js +19 -1
  141. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/link-node-modules.js +2 -3
  142. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/link.js +3 -2
  143. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/restart.js +3 -3
  144. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/start.js +1 -1
  145. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/tail.js +29 -12
  146. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/version.js +15 -1
  147. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/helper.js +8 -4
  148. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/index.js +1 -1
  149. package/framework/v0.1.6-alpha.141/lib/cmd/minion/help.txt +18 -0
  150. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/port/reset.js +1 -1
  151. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/add.js +7 -2
  152. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/arguments.json +1 -0
  153. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/build.js +4 -4
  154. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/help.txt +4 -0
  155. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/list.js +1 -1
  156. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/protocol/list.js +71 -50
  157. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/collection/package.json +2 -2
  158. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/collection/src/main.js +20 -14
  159. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/config.js +1 -1
  160. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cron/package.json +2 -2
  161. package/framework/v0.1.6-alpha.141/lib/domain/dist/2025-03-14_13-41-20_UTC.dat +15754 -0
  162. package/framework/v0.1.6-alpha.141/lib/domain/dist/public_suffix_list.dat +15754 -0
  163. package/framework/v0.1.6-alpha.141/lib/domain/exemples/backend.js +12 -0
  164. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/domain/package.json +2 -2
  165. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/domain/src/main.js +20 -6
  166. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/generator/index.js +1 -1
  167. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/index.js +1 -1
  168. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141/lib/inherits}/LICENSE +1 -1
  169. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/inherits/package.json +2 -2
  170. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/inherits/src/main.js +1 -1
  171. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/package.json +2 -2
  172. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/src/containers/mq/listener.js +10 -2
  173. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/src/helper.js +1 -1
  174. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/src/main.js +1 -1
  175. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/math/index.js +1 -1
  176. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/merge/package.json +2 -2
  177. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/model.js +3 -3
  178. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/proc.js +10 -2
  179. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/routing/package.json +2 -2
  180. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/routing/src/main.js +82 -26
  181. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/session-store.js +3 -3
  182. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/swig-filters/package.json +2 -2
  183. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/swig-filters/src/main.js +76 -15
  184. package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/validator.js +2 -2
  185. package/framework/v0.1.6-alpha.141/package.json +11 -0
  186. package/package.json +3 -3
  187. package/resources/package.json.template +1 -1
  188. package/script/post_install.js +4 -4
  189. package/script/pre_install.js +3 -3
  190. package/utils/helper.js +38 -14
  191. package/framework/v0.1.6-alpha.14/VERSION +0 -1
  192. package/framework/v0.1.6-alpha.14/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +0 -1
  193. package/framework/v0.1.6-alpha.14/core/asset/plugin/dist/vendor/gina/js/gina.min.js +0 -766
  194. package/framework/v0.1.6-alpha.14/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +0 -8
  195. package/framework/v0.1.6-alpha.14/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -7
  196. package/framework/v0.1.6-alpha.14/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +0 -8
  197. package/framework/v0.1.6-alpha.14/core/deps/busboy/.travis.yml +0 -17
  198. package/framework/v0.1.6-alpha.14/core/deps/busboy/README.md +0 -225
  199. package/framework/v0.1.6-alpha.14/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -73
  200. package/framework/v0.1.6-alpha.14/core/deps/busboy/deps/encoding/encoding.js +0 -2391
  201. package/framework/v0.1.6-alpha.14/core/deps/busboy/lib/main.js +0 -89
  202. package/framework/v0.1.6-alpha.14/core/deps/busboy/lib/types/multipart.js +0 -328
  203. package/framework/v0.1.6-alpha.14/core/deps/busboy/lib/types/urlencoded.js +0 -214
  204. package/framework/v0.1.6-alpha.14/core/deps/busboy/lib/utils.js +0 -191
  205. package/framework/v0.1.6-alpha.14/core/deps/busboy/package.json +0 -69
  206. package/framework/v0.1.6-alpha.14/lib/domain/dist/public_suffix_list.dat +0 -14186
  207. package/framework/v0.1.6-alpha.14/lib/domain/exemples/backend.js +0 -0
  208. package/framework/v0.1.6-alpha.14/package.json +0 -14
  209. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/AUTHORS +0 -0
  210. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/html/nolayout.html +0 -0
  211. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/html/static.html +0 -0
  212. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/img/android-chrome-192x192.png +0 -0
  213. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/img/android-chrome-512x512.png +0 -0
  214. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/img/apple-touch-icon.png +0 -0
  215. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/img/favicon-16x16.png +0 -0
  216. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/img/favicon-32x32.png +0 -0
  217. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/img/favicon.ico +0 -0
  218. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -0
  219. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/asset/plugin/uuid.json +0 -0
  220. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/connectors/couchbase/lib/connector.js +0 -0
  221. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/connectors/couchbase/lib/connector.v2.js +0 -0
  222. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/connectors/couchbase/lib/connector.v3.js +0 -0
  223. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/connectors/couchbase/lib/n1ql.js +0 -0
  224. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/connectors/couchbase/lib/session-store.js +0 -0
  225. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  226. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  227. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/controller/controller.framework.js +0 -0
  228. /package/framework/{v0.1.6-alpha.14/core/deps/busboy → v0.1.6-alpha.141/core/deps/busboy-1.6.0}/LICENSE +0 -0
  229. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  230. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/dev/lib/class.js +0 -0
  231. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/dev/lib/tools.js +0 -0
  232. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/README.md +0 -0
  233. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/currency.json +0 -0
  234. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/dist/language/en.json +0 -0
  235. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/dist/language/fr.json +0 -0
  236. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/dist/region/en.json +0 -0
  237. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/dist/region/fr.json +0 -0
  238. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/src/resources/currency.csv +0 -0
  239. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/src/resources/region.csv +0 -0
  240. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/locales/src/resources/region.mapping.json +0 -0
  241. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/README.md +0 -0
  242. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/file/README.md +0 -0
  243. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/file/build.json +0 -0
  244. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/intl/README.md +0 -0
  245. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/intl/build.json +0 -0
  246. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/intl/src/main.js +0 -0
  247. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/storage/README.md +0 -0
  248. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/storage/build.json +0 -0
  249. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/storage/src/main.js +0 -0
  250. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/validator/README.md +0 -0
  251. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/plugins/lib/validator/build.json +0 -0
  252. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/server.express.js +0 -0
  253. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/_gitignore +0 -0
  254. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle/config/app.json +0 -0
  255. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle/config/routing.json +0 -0
  256. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle/config/settings.json +0 -0
  257. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
  258. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle/config/templates.json +0 -0
  259. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  260. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  261. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle/index.js +0 -0
  262. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  263. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  264. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  265. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  266. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  267. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_public/readme.md +0 -0
  268. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  269. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
  270. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
  271. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
  272. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
  273. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/command/gina.bat.tpl +0 -0
  274. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/conf/manifest.json +0 -0
  275. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/conf/package.json +0 -0
  276. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/conf/settings.json +0 -0
  277. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/conf/statics.json +0 -0
  278. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/error/client/json/401.json +0 -0
  279. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/error/client/json/403.json +0 -0
  280. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/error/client/json/404.json +0 -0
  281. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/error/server/html/50x.html +0 -0
  282. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/error/server/json/500.json +0 -0
  283. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/error/server/json/503.json +0 -0
  284. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/core/template/extensions/logger/config.json +0 -0
  285. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/data/LICENSE +0 -0
  286. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/data/README.md +0 -0
  287. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/json/LICENSE +0 -0
  288. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/json/README.md +0 -0
  289. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/plugins/README.md +0 -0
  290. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/helpers/prototypes.js +0 -0
  291. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/archiver/README.md +0 -0
  292. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/archiver/build.json +0 -0
  293. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/archiver/src/dep/jszip.min.js +0 -0
  294. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/aliases.json +0 -0
  295. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/arguments.json +0 -0
  296. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/copy.js +0 -0
  297. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/cp.js +0 -0
  298. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/help.js +0 -0
  299. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/help.txt +0 -0
  300. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/list.js +0 -0
  301. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/remove.js +0 -0
  302. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/rename.js +0 -0
  303. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/restart.js +0 -0
  304. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/rm.js +0 -0
  305. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/status.js +0 -0
  306. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/bundle/stop.js +0 -0
  307. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/env/add.js +0 -0
  308. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/env/help.txt +0 -0
  309. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/env/link-dev.js +0 -0
  310. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/env/list.js +0 -0
  311. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/env/remove.js +0 -0
  312. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/env/rm.js +0 -0
  313. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/env/set.js +0 -0
  314. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/env/unset.js +0 -0
  315. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/env/use.js +0 -0
  316. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/get.js +0 -0
  317. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/help.js +0 -0
  318. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/help.txt +0 -0
  319. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/msg.json +0 -0
  320. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/open.js +0 -0
  321. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/set.js +0 -0
  322. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/status.js +0 -0
  323. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/stop.js +0 -0
  324. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/framework/update.js +0 -0
  325. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/gina-dev.1.md +0 -0
  326. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/gina-framework.1.md +0 -0
  327. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/gina.1.md +0 -0
  328. /package/framework/{v0.1.6-alpha.14/lib/cmd/env → v0.1.6-alpha.141/lib/cmd/minion}/help.js +0 -0
  329. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/msg.json +0 -0
  330. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/port/help.js +0 -0
  331. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/port/help.txt +0 -0
  332. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/port/inc/scan.js +0 -0
  333. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/port/list.js +0 -0
  334. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/port/set.js +0 -0
  335. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/help.js +0 -0
  336. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/import.js +0 -0
  337. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/move.js +0 -0
  338. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/remove.js +0 -0
  339. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/rename.js +0 -0
  340. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/restart.js +0 -0
  341. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/rm.js +0 -0
  342. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/start.js +0 -0
  343. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/status.js +0 -0
  344. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/project/stop.js +0 -0
  345. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/protocol/help.js +0 -0
  346. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/protocol/help.txt +0 -0
  347. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/protocol/set.js +0 -0
  348. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/scope/add.js +0 -0
  349. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/scope/help.js +0 -0
  350. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/scope/help.txt +0 -0
  351. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/scope/link-local.js +0 -0
  352. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/scope/link-production.js +0 -0
  353. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/scope/list.js +0 -0
  354. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/scope/remove.js +0 -0
  355. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/scope/rm.js +0 -0
  356. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/scope/use.js +0 -0
  357. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cmd/view/add.js +0 -0
  358. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/collection/README.md +0 -0
  359. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/collection/build.json +0 -0
  360. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cron/README.md +0 -0
  361. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/cron/src/main.js +0 -0
  362. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/domain/LICENSE +0 -0
  363. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/domain/README.md +0 -0
  364. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/domain/exemples/frontend.html +0 -0
  365. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/inherits/README.md +0 -0
  366. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  367. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/inherits/example/protected_inheritance.js +0 -0
  368. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/inherits/example/simple_inheritance.js +0 -0
  369. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  370. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/README.md +0 -0
  371. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/src/containers/default/index.js +0 -0
  372. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/src/containers/file/index.js +0 -0
  373. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  374. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  375. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/src/containers/mq/index.js +0 -0
  376. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/logger/src/containers/mq/speaker.js +0 -0
  377. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/merge/README.md +0 -0
  378. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/merge/example/merge.js +0 -0
  379. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/merge/example/merge_2_literal objects.js +0 -0
  380. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/merge/example/merge_and_preserve_first.js +0 -0
  381. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/merge/src/main.js +0 -0
  382. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/routing/README.md +0 -0
  383. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/routing/build.json +0 -0
  384. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/shell.js +0 -0
  385. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/swig-filters/README.md +0 -0
  386. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/url/README.md +0 -0
  387. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/url/index.js +0 -0
  388. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/url/mocks.json +0 -0
  389. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/url/routing.json +0 -0
  390. /package/framework/{v0.1.6-alpha.14 → v0.1.6-alpha.141}/lib/url/test.js +0 -0
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * This file is part of the gina package.
4
- * Copyright (c) 2009-2023 Rhinostone <contact@gina.io>
4
+ * Copyright (c) 2009-2025 Rhinostone <contact@gina.io>
5
5
  *
6
6
  * For the full copyright and license information, please view the LICENSE
7
7
  * file that was distributed with this source code.
@@ -10,12 +10,14 @@
10
10
  //Imports.
11
11
  var fs = require('fs');
12
12
  const {promises: {readFile}} = require("fs");
13
+ const exec = require('child_process').exec;
13
14
  var util = require('util');
14
15
  var promisify = util.promisify;
15
16
  var EventEmitter = require('events').EventEmitter;
16
- var zlib = require('zlib');
17
+ var zlib = require('zlib'); // Included with NodeJS
17
18
 
18
- //var dns = require('dns');
19
+ const { Resolver } = require('node:dns').promises;
20
+ const resolver = new Resolver();
19
21
  // var tls = require('tls');
20
22
  // var crypto = require('crypto');
21
23
 
@@ -25,9 +27,10 @@ var inherits = lib.inherits;
25
27
  var console = lib.logger;
26
28
  var Collection = lib.Collection;
27
29
  var routingLib = lib.routing;
28
- var swig = require('swig');
29
- // Swig 2
30
- // var swig = require('./../deps/swig-client/swig-2.0.0.min.js');
30
+ var Domain = lib.Domain;
31
+ var domainLib = new Domain();
32
+ var swig = require('./../deps/swig-1.4.2');
33
+ const { type } = require('node:os');
31
34
  var SwigFilters = lib.SwigFilters;
32
35
  var statusCodes = requireJSON( _( getPath('gina').core + '/status.codes') );
33
36
 
@@ -68,24 +71,19 @@ function SuperController(options) {
68
71
  var init = function() {
69
72
 
70
73
  if ( typeof(SuperController.initialized) != 'undefined' ) {
71
- return getInstance()
72
- } else {
73
-
74
- SuperController.instance = self;
75
-
76
-
77
- if (local.options) {
78
- SuperController.instance._options = local.options;
79
- }
80
-
81
- SuperController.initialized = true;
74
+ return getInstance();
75
+ }
82
76
 
77
+ SuperController.instance = self;
78
+ if (local.options) {
79
+ SuperController.instance._options = local.options;
83
80
  }
81
+ SuperController.initialized = true;
84
82
  }
85
83
 
86
84
  var getInstance = function() {
87
85
  local.options = SuperController.instance._options = options;
88
- // 2022-03-07 Fix for none-developpement environnements (without cache)
86
+ // Fixed on 2022-03-07 for none-developpement environnements (without cache)
89
87
  self._options = local.options;
90
88
 
91
89
  return SuperController.instance;
@@ -240,12 +238,12 @@ function SuperController(options) {
240
238
 
241
239
  if ( /^:/.test(value) ) {
242
240
  str = 'page.view.params.'+ key + '.';
243
- set(str.substr(0, str.length-1), req.params[value.substr(1)]);
241
+ set(str.substring(0, str.length-1), req.params[value.substring(1)]);
244
242
  } else if (/^(file|title)$/.test(key)) {
245
243
  str = 'page.view.'+ key + '.';
246
- set(str.substr(0, str.length-1), value);
244
+ set(str.substring(0, str.length-1), value);
247
245
  } else {
248
- set(str.substr(0, str.length-1), value)
246
+ set(str.substring(0, str.length-1), value)
249
247
  }
250
248
 
251
249
  str = 'page.'
@@ -322,10 +320,24 @@ function SuperController(options) {
322
320
 
323
321
  var ctx = getContext('gina');
324
322
  // new declaration && overrides
323
+ var arch = process.arch;
324
+ switch (process.arch) {
325
+ case 'x64':
326
+ arch = 'amd64'
327
+ break;
328
+ case 'armv7l':
329
+ arch = 'armhf'
330
+ break;
331
+ case 'x86':
332
+ arch = 'i386'
333
+ break;
334
+ default:
335
+ break;
336
+ }
325
337
  var version = {
326
338
  "number" : ctx.version,
327
339
  "platform" : process.platform,
328
- "arch" : process.arch,
340
+ "arch" : arch,
329
341
  "nodejs" : process.versions.node,
330
342
  "middleware" : ctx.middleware
331
343
  };
@@ -336,15 +348,124 @@ function SuperController(options) {
336
348
  set('page.environment.gina pid', GINA_PID);
337
349
  set('page.environment.nodejs', version.nodejs +' '+ version.platform +' '+ version.arch);
338
350
  set('page.environment.engine', options.conf.server.engine);//version.middleware
351
+ set('page.environment.uvThreadpoolSize', process.env.UV_THREADPOOL_SIZE);
339
352
  set('page.environment.env', process.env.NODE_ENV);
340
- set('page.environment.envIsDev', self.isCacheless());
353
+ set('page.environment.envIsDev', /^true$/i.test(process.env.NODE_ENV_IS_DEV) );
341
354
  set('page.environment.scope', process.env.NODE_SCOPE);
342
355
  set('page.environment.scopeIsLocal', /^true$/i.test(process.env.NODE_SCOPE_IS_LOCAL) );
343
356
  set('page.environment.scopeIsProduction', /^true$/i.test(process.env.NODE_SCOPE_IS_PRODUCTION) );
344
357
  set('page.environment.date.now', new Date().format("isoDateTime"));
358
+ set('page.environment.isCacheless', self.isCacheless());
359
+
360
+ // var requestPort = req.headers.port || req.headers[':port'];
361
+ // var isProxyHost = (
362
+ // typeof(req.headers.host) != 'undefined'
363
+ // && typeof(requestPort) != 'undefined'
364
+ // && /^(80|443)$/.test(requestPort)
365
+ // && local.options.conf.server.scheme +'://'+ req.headers.host +':'+ requestPort != local.options.conf.hostname.replace(/\:\d+$/, '') +':'+ local.options.conf.server.port
366
+ // ||
367
+ // typeof(req.headers[':authority']) != 'undefined'
368
+ // && local.options.conf.server.scheme +'://'+ req.headers[':authority'] != local.options.conf.hostname
369
+ // ||
370
+ // typeof(req.headers.host) != 'undefined'
371
+ // && typeof(requestPort) != 'undefined'
372
+ // && /^(80|443)$/.test(requestPort)
373
+ // && req.headers.host == local.options.conf.host
374
+ // ||
375
+ // typeof(req.headers['x-nginx-proxy']) != 'undefined'
376
+ // && /^true$/i.test(req.headers['x-nginx-proxy'])
377
+ // ) ? true : false;
378
+ // setContext('isProxyHost', isProxyHost);
379
+ var isProxyHost = getContext('isProxyHost') || false;
380
+ set('page.environment.isProxyHost', isProxyHost);
381
+ if ( /^true$/.test(isProxyHost) ) {
382
+ set('page.environment.proxyHost', process.gina.PROXY_HOST);
383
+ set('page.environment.proxyHostname', process.gina.PROXY_HOSTNAME);
384
+ }
345
385
 
386
+ var _config = ctx.config.envConf[options.conf.bundle][process.env.NODE_ENV];
387
+ // by default
388
+ var hostname = _config.hostname + _config.server.webroot;
389
+ var scheme = hostname.match(/^(https|http)/)[0];
390
+ var requestPort = (local.req.headers.port||local.req.headers[':port']);
391
+
392
+ var hostPort = hostname.match(/(\:d+\/|\:\d+)$/);
393
+ hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : _config.port[_config.server.protocol][_config.server.scheme];
394
+ // Linking bundle B from bundle A wihtout proxy
395
+ var isSpecialCase = (
396
+ getContext('bundle') != _config.bundle
397
+ && requestPort != hostPort
398
+ && local.req.headers[':host'] != process.gina.PROXY_HOST
399
+ ) ? true : false;
346
400
 
347
- var routing = local.options.conf.routing = ctx.config.envConf.routing; // all routes
401
+ if (isSpecialCase) {
402
+ hostname = _config.hostname;
403
+ }
404
+
405
+ // if (
406
+ // isProxyHost
407
+ // && !isSpecialCase
408
+ // ) {
409
+ // // Rewrite hostname vs req.headers.host
410
+ // hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']);
411
+
412
+ // if (
413
+ // !/^(80|443)$/.test(requestPort)
414
+ // && !new RegExp(requestPort+'$').test(hostname)
415
+ // ) {
416
+ // hostname += ':'+ requestPort;
417
+ // }
418
+ // }
419
+
420
+ set('page.environment.hostname', hostname);
421
+ // Updating _config.rootDomain - 2024/04/15
422
+ // _config.rootDomain = domainLib.getRootDomain(hostname).value;
423
+
424
+
425
+ set('page.environment.rootDomain', _config.rootDomain);
426
+ set('page.environment.webroot', options.conf.server.webroot);
427
+
428
+ if ( typeof(ctx.config.envConf._isRoutingUpdateNeeded) == 'undefined') {
429
+ ctx.config.envConf._isRoutingUpdateNeeded = false;
430
+ }
431
+
432
+ if (
433
+ typeof(ctx.config.envConf._proxyHostname) == 'undefined'
434
+ ||
435
+ hostname != ctx.config.envConf._proxyHostname
436
+ ) {
437
+ ctx.config.envConf._proxyHostname = (isProxyHost) ? hostname : null;
438
+ ctx.config.envConf._isRoutingUpdateNeeded = true;
439
+ }
440
+
441
+ if ( typeof(ctx.config.envConf._routingCloned) == 'undefined' ) {
442
+ ctx.config.envConf._routingCloned = JSON.clone(ctx.config.envConf.routing);
443
+ }
444
+
445
+ var routing = local.options.conf.routing = ctx.config.envConf._routingCloned; // all routes
446
+ if ( /^true$/i.test(ctx.config.envConf._isRoutingUpdateNeeded) ) {
447
+
448
+ for (let r in ctx.config.envConf.routing) {
449
+ if ( isProxyHost ) {
450
+ local.options.conf.routing[r].host = hostname.replace(/^(https|http)\:\/\//, '');
451
+ local.options.conf.routing[r].hostname = hostname;
452
+ let scheme = hostname.match(/^(https|http)/)[0];
453
+ local.options.conf.routing[r].hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']);
454
+ let requestPort = (local.req.headers.port||local.req.headers[':port']);
455
+ if (
456
+ !/^(80|443)$/.test(requestPort)
457
+ && !new RegExp(requestPort+'$').test(local.options.conf.routing[r].hostname)
458
+ ) {
459
+ local.options.conf.routing[r].hostname += ':'+ requestPort
460
+ }
461
+ continue;
462
+ }
463
+ local.options.conf.routing[r].host = ctx.config.envConf.routing[r].host;
464
+ local.options.conf.routing[r].hostname = ctx.config.envConf.routing[r].hostname;
465
+ }
466
+ ctx.config.envConf._isRoutingUpdateNeeded = false;
467
+
468
+ }
348
469
  set('page.environment.routing', encodeRFC5987ValueChars(JSON.stringify(routing))); // export for GFF
349
470
  //reverseRouting
350
471
  var reverseRouting = local.options.conf.reverseRouting = ctx.config.envConf.reverseRouting; // all routes
@@ -354,9 +475,8 @@ function SuperController(options) {
354
475
  set('page.environment.forms', encodeRFC5987ValueChars(JSON.stringify(forms))); // export for GFF
355
476
  set('page.forms', options.conf.content.forms);
356
477
 
357
- set('page.environment.hostname', ctx.config.envConf[options.conf.bundle][process.env.NODE_ENV].hostname);
358
- set('page.environment.rootDomain', ctx.config.envConf[options.conf.bundle][process.env.NODE_ENV].rootDomain);
359
- set('page.environment.webroot', options.conf.server.webroot);
478
+
479
+
360
480
  set('page.environment.bundle', options.conf.bundle);
361
481
  set('page.environment.project', options.conf.projectName);
362
482
  set('page.environment.protocol', options.conf.server.protocol);
@@ -426,7 +546,7 @@ function SuperController(options) {
426
546
  // user locale
427
547
  options.conf.locale = new Collection(userLocales).findOne({ short: userCountryCode }) || {};
428
548
 
429
- //set('page.date.now', new Date().format("isoDateTime"));
549
+ // current date
430
550
  if ( typeof(options.conf.locale) == 'undefined' || !options.conf.locale ) {
431
551
  options.conf.locale = {}
432
552
  }
@@ -437,11 +557,6 @@ function SuperController(options) {
437
557
  set('page.view.lang', userCulture);
438
558
  }
439
559
 
440
- if ( !getContext('isProxyHost') ) {
441
- var isProxyHost = ( typeof(req.headers.host) != 'undefined' && local.options.conf.server.scheme +'://'+ req.headers.host != local.options.conf.hostname || typeof(req.headers[':authority']) != 'undefined' && local.options.conf.server.scheme +'://'+ req.headers[':authority'] != local.options.conf.hostname ) ? true : false;
442
- setContext('isProxyHost', isProxyHost);
443
- isProxyHost = null;
444
- }
445
560
 
446
561
  //TODO - detect when to use swig
447
562
  var dir = null;
@@ -451,7 +566,7 @@ function SuperController(options) {
451
566
  var swigOptions = {
452
567
  autoescape : ( typeof(local.options.autoescape) != 'undefined') ? local.options.autoescape : false,
453
568
  // `memory` is no working yet ... advanced rendering setup required
454
- // cache : (local.options.cacheless) ? false : 'memory'
569
+ // cache : (local.options.isCacheless) ? false : 'memory'
455
570
  cache : false
456
571
  };
457
572
  if (dir) {
@@ -498,7 +613,7 @@ function SuperController(options) {
498
613
  * Extend default filters
499
614
  * - length
500
615
  *
501
- * Avilable filters:
616
+ * Available filters:
502
617
  * - getWebroot()
503
618
  * - getUrl()
504
619
  *
@@ -638,7 +753,12 @@ function SuperController(options) {
638
753
 
639
754
  // isWithoutLayout from content
640
755
  var pageContentObj = new _(data.page.view.path);
641
- var _templateContent = fs.readFileSync(path).toString() || null;
756
+ var _templateContent = null;
757
+ try {
758
+ _templateContent = fs.readFileSync(path).toString()
759
+ } catch (pathException) {
760
+ console.warn("Path exception: ", pathException);
761
+ }
642
762
  var hasLayoutInPath = /\{\%(\s+extends|extends)/.test(_templateContent) || false;
643
763
  var layoutPath = null;
644
764
 
@@ -839,12 +959,28 @@ function SuperController(options) {
839
959
  return;
840
960
  }
841
961
 
962
+ var localRequestPort = local.req.headers.port || local.req.headers[':port'];
842
963
  var isProxyHost = (
843
964
  typeof(local.req.headers.host) != 'undefined'
844
- && localOptions.conf.server.scheme +'://'+ local.req.headers.host != localOptions.conf.hostname
845
- || typeof(local.req.headers[':authority']) != 'undefined'
846
- && localOptions.conf.server.scheme +'://'+ local.req.headers[':authority'] != localOptions.conf.hostname
965
+ && typeof(localRequestPort) != 'undefined'
966
+ && /^(80|443)$/.test(localRequestPort)
967
+ && localOptions.conf.server.scheme +'://'+ local.req.headers.host+':'+ localRequestPort != localOptions.conf.hostname.replace(/\:\d+$/, '') +':'+ localOptions.conf.server.port
968
+ ||
969
+ typeof(local.req.headers[':authority']) != 'undefined'
970
+ && localOptions.conf.server.scheme +'://'+ local.req.headers[':authority'] != localOptions.conf.hostname
971
+ ||
972
+ typeof(local.req.headers.host) != 'undefined'
973
+ && typeof(localRequestPort) != 'undefined'
974
+ && /^(80|443)$/.test(localRequestPort)
975
+ && local.req.headers.host == localOptions.conf.host
976
+ ||
977
+ typeof(local.req.headers['x-nginx-proxy']) != 'undefined'
978
+ && /^true$/i.test(local.req.headers['x-nginx-proxy'])
979
+ ||
980
+ typeof(process.gina.PROXY_HOSTNAME) != 'undefined'
847
981
  ) ? true : false;
982
+
983
+
848
984
  // setup swig default filters
849
985
  var filters = SwigFilters({
850
986
  options : JSON.clone(localOptions),
@@ -883,6 +1019,7 @@ function SuperController(options) {
883
1019
  , XHRData = null
884
1020
  , XHRView = null
885
1021
  , isDeferModeEnabled = null
1022
+ , hasExternalsPlugins = null
886
1023
  , viewInfos = null
887
1024
  , filename = null
888
1025
  , isWithSwigLayout = null
@@ -898,7 +1035,9 @@ function SuperController(options) {
898
1035
  if (isWithoutLayout) {
899
1036
  data.page.view.layout = layoutPath;
900
1037
  }
901
- } else { // without layout case
1038
+ }
1039
+ // without layout case
1040
+ else {
902
1041
 
903
1042
  // by default
904
1043
  layoutPath = localOptions.template.layout;
@@ -926,10 +1065,8 @@ function SuperController(options) {
926
1065
  self.throwError(err);
927
1066
  return;
928
1067
  }
929
-
930
1068
  }
931
1069
 
932
-
933
1070
  var isLoadingPartial = false;
934
1071
  try {
935
1072
  assets = {assets:"${assets}"};
@@ -1023,6 +1160,7 @@ function SuperController(options) {
1023
1160
  // }
1024
1161
 
1025
1162
  isDeferModeEnabled = localOptions.template.javascriptsDeferEnabled || localOptions.conf.content.templates._common.javascriptsDeferEnabled || false;
1163
+ hasExternalsPlugins = (localOptions.template.externalPlugins.length > 0) ? true : false;
1026
1164
 
1027
1165
  // iframe case - without HTML TAG
1028
1166
  if (!self.isXMLRequest() && !/\<html/.test(layout) ) {
@@ -1092,8 +1230,8 @@ function SuperController(options) {
1092
1230
  + '{%- set userDataInspector.view.scripts = "ignored-by-toolbar" -%}'
1093
1231
  + '{%- set userDataInspector.view.stylesheets = "ignored-by-toolbar" -%}'
1094
1232
  + '{%- set userDataInspector.view.assets = '+ JSON.stringify(assets) +' -%}'
1095
- + '{%- include "'+ getPath('gina').core +'/asset/plugin/dist/vendor/gina/html/toolbar.html" with { gina: ginaDataInspector, user: userDataInspector } -%}'// jshint ignore:line
1096
1233
  + '{# END Gina Toolbar #}'
1234
+ + '{%- include "'+ getPath('gina').core +'/asset/plugin/dist/vendor/gina/html/toolbar.html" with { gina: ginaDataInspector, user: userDataInspector } -%}'// jshint ignore:line
1097
1235
  ;
1098
1236
 
1099
1237
 
@@ -1124,10 +1262,18 @@ function SuperController(options) {
1124
1262
  if (isLoadingPartial) {
1125
1263
  layout += '\t{{ page.view.scripts }}';
1126
1264
  } else {
1265
+ // placed in the HEAD
1127
1266
  if ( isDeferModeEnabled ) {
1128
1267
  layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1129
- } else { // placed in the BODY
1268
+ }
1269
+ // placed in the BODY
1270
+ else {
1130
1271
  layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
1272
+ if (hasExternalsPlugins) {
1273
+ for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
1274
+ layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
1275
+ }
1276
+ }
1131
1277
  }
1132
1278
  }
1133
1279
 
@@ -1173,6 +1319,11 @@ function SuperController(options) {
1173
1319
  // layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1174
1320
  // } else { // placed in the BODY
1175
1321
  // layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
1322
+ // if (hasExternalsPlugins) {
1323
+ // for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
1324
+ // layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
1325
+ // }
1326
+ // }
1176
1327
  // }
1177
1328
  // }
1178
1329
 
@@ -1189,11 +1340,18 @@ function SuperController(options) {
1189
1340
  layout += '\t'+ localOptions.template.ginaLoader +'\n';
1190
1341
  }
1191
1342
  } else {
1343
+ // placed in the HEAD
1192
1344
  if ( isDeferModeEnabled && /\<\/head\>/i.test(layout) ) { // placed in the HEAD
1193
1345
  layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1194
-
1195
- } else { // placed in the BODY
1346
+ }
1347
+ // placed in the BODY
1348
+ else {
1196
1349
  layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
1350
+ if (hasExternalsPlugins) {
1351
+ for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
1352
+ layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
1353
+ }
1354
+ }
1197
1355
  }
1198
1356
  // ginaLoader cannot be deferred
1199
1357
  if ( !localOptions.template.javascriptsExcluded || localOptions.template.javascriptsExcluded != '**' ) {
@@ -1239,11 +1397,23 @@ function SuperController(options) {
1239
1397
 
1240
1398
  // if ( !local.res.headersSent ) {
1241
1399
  if ( !headersSent() ) {
1242
- local.res.statusCode = ( typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined' ) ? data.page.data.status : 200; // by default
1243
1400
  //catching errors
1401
+ local.res.statusCode = ( typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined' ) ? data.page.data.status : 200; // by default
1402
+
1403
+ // HTTP/2 (RFC7540 8.1.2.4):
1404
+ // This standard for HTTP/2 explicitly states that status messages are not supported.
1405
+ // In HTTP/2, the status is conveyed solely by the numerical status code (e.g., 200, 404, 500),
1406
+ // and there is no field for a human-readable status message.
1244
1407
  if (
1245
- typeof(data.page.data.errno) != 'undefined' && /^2/.test(data.page.data.status) && typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined'
1246
- || typeof(data.page.data.status) != 'undefined' && !/^2/.test(data.page.data.status) && typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined'
1408
+ typeof(data.page.data.errno) != 'undefined'
1409
+ && /^2/.test(data.page.data.status)
1410
+ && typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined'
1411
+ && !/http\/2/.test(local.options.conf.server.protocol)
1412
+ ||
1413
+ typeof(data.page.data.status) != 'undefined'
1414
+ && !/^2/.test(data.page.data.status)
1415
+ && typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined'
1416
+ && !/http\/2/.test(local.options.conf.server.protocol)
1247
1417
  ) {
1248
1418
 
1249
1419
  try {
@@ -1295,6 +1465,40 @@ function SuperController(options) {
1295
1465
  ) {
1296
1466
  layout = layout.replace('{"assets":"${assets}"}', assets );
1297
1467
  }
1468
+
1469
+ if ( !self.isCacheless() ) {
1470
+ var links = local.options.template.h2Links;
1471
+ for (let l in localOptions.template.assets) {
1472
+ let link = localOptions.template.assets[l]
1473
+ if (
1474
+ /^_/.test(l)
1475
+ || typeof(link.as) == 'undefined'
1476
+ || typeof(link.as) != 'undefined'
1477
+ && link.as != 'null'
1478
+ && !link.isAvailable
1479
+ || !link.as
1480
+ ) {
1481
+ // ignoring
1482
+ continue;
1483
+ }
1484
+
1485
+ links += '<'+ l +'>; as='+ link.as +'; '
1486
+ if ( link.imagesrcset) {
1487
+ links += 'imagesrcset='+ link.imagesrcset +'; ';
1488
+ }
1489
+ if ( link.imagesizes) {
1490
+ links += 'imagesizes='+ link.imagesizes +'; ';
1491
+ }
1492
+ links += 'rel=preload,'
1493
+
1494
+ }
1495
+ if ( /\,$/.test(links) ) {
1496
+ links = links.substring(0, links.length-1);
1497
+ }
1498
+ local.res.setHeader('link', links);
1499
+ links = null;
1500
+ }
1501
+
1298
1502
  assets = null;
1299
1503
 
1300
1504
  } catch (err) {
@@ -1418,14 +1622,25 @@ function SuperController(options) {
1418
1622
 
1419
1623
  try {
1420
1624
  response.statusCode = jsonObj.status;
1421
- response.statusMessage = local.options.conf.server.coreConfiguration.statusCodes[jsonObj.status];
1625
+ // HTTP/2 (RFC7540 8.1.2.4):
1626
+ // This standard for HTTP/2 explicitly states that status messages are not supported.
1627
+ // In HTTP/2, the status is conveyed solely by the numerical status code (e.g., 200, 404, 500),
1628
+ // and there is no field for a human-readable status message.
1629
+ if ( !/http\/2/.test(local.options.conf.server.protocol) ) {
1630
+ response.statusMessage = local.options.conf.server.coreConfiguration.statusCodes[jsonObj.status];
1631
+ }
1422
1632
  } catch (err){
1423
1633
  response.statusCode = 500;
1424
- response.statusMessage = err.stack;
1634
+ // HTTP/2 (RFC7540 8.1.2.4):
1635
+ // This standard for HTTP/2 explicitly states that status messages are not supported.
1636
+ // In HTTP/2, the status is conveyed solely by the numerical status code (e.g., 200, 404, 500),
1637
+ // and there is no field for a human-readable status message.
1638
+ if ( !/http\/2/.test(local.options.conf.server.protocol) ) {
1639
+ response.statusMessage = err.stack;
1640
+ }
1425
1641
  }
1426
1642
  }
1427
1643
 
1428
-
1429
1644
  // Internet Explorer override
1430
1645
  if ( /msie/i.test(request.headers['user-agent']) ) {
1431
1646
  response.setHeader('content-type', 'text/plain' + '; charset='+ local.options.conf.encoding)
@@ -1433,58 +1648,57 @@ function SuperController(options) {
1433
1648
  response.setHeader('content-type', local.options.conf.server.coreConfiguration.mime['json'] + '; charset='+ local.options.conf.encoding)
1434
1649
  }
1435
1650
 
1436
- // if ( !headersSent(response) ) {
1437
- console.info(request.method +' ['+ response.statusCode +'] '+ request.url);
1651
+ console.info(request.method +' ['+ response.statusCode +'] '+ request.url);
1438
1652
 
1439
1653
 
1440
- if ( local.options.isXMLRequest && self.isWithCredentials() ) {
1654
+ if ( local.options.isXMLRequest && self.isWithCredentials() ) {
1441
1655
 
1442
- // content length must be the right size !
1443
- var len = Buffer.byteLength(data, 'utf8') || 0;
1444
- if ( !headersSent(response) ) {
1445
- response.setHeader("content-length", len);
1446
- }
1447
-
1448
- response.write(data);
1449
-
1450
- // required to close connection
1451
- setTimeout(function () {
1452
- response.end();
1453
- try {
1454
- response.headersSent = true;
1455
- } catch(err) {
1456
- // Ignoring warning
1457
- //console.warn(err);
1458
- }
1459
-
1460
- if ( next ) {
1461
- next()
1462
- }
1656
+ // content length must be the right size !
1657
+ var len = Buffer.byteLength(data, 'utf8') || 0;
1658
+ if ( !headersSent(response) ) {
1659
+ response.setHeader("content-length", len);
1660
+ }
1463
1661
 
1464
- freeMemory([jsonObj, data, request, response, next]);
1465
- }, 200);
1662
+ response.write(data);
1466
1663
 
1467
- // force completion
1468
- return
1469
- }
1470
- // normal case
1471
- response.end(JSON.stringify(jsonObj));
1472
- if (!headersSent(response)) {
1664
+ // required to close connection
1665
+ setTimeout(function () {
1666
+ response.end();
1473
1667
  try {
1474
1668
  response.headersSent = true;
1475
1669
  } catch(err) {
1476
1670
  // Ignoring warning
1477
1671
  //console.warn(err);
1478
1672
  }
1673
+
1674
+ if ( next ) {
1675
+ next()
1676
+ }
1677
+
1678
+ freeMemory([jsonObj, data, request, response, next]);
1679
+ }, 200);
1680
+
1681
+ // force completion
1682
+ return
1683
+ }
1684
+ // normal case
1685
+ response.end(JSON.stringify(jsonObj));
1686
+ if (!headersSent(response)) {
1687
+ try {
1688
+ response.headersSent = true;
1689
+ } catch(err) {
1690
+ // Ignoring warning
1691
+ //console.warn(err);
1479
1692
  }
1480
- if ( next ) {
1481
- return next()
1482
- }
1693
+ }
1694
+ if ( next ) {
1695
+ return next()
1696
+ }
1483
1697
 
1484
- freeMemory([jsonObj, data, request, response, next]);
1698
+ freeMemory([jsonObj, data, request, response, next]);
1699
+
1700
+ return;
1485
1701
 
1486
- return;
1487
- // }
1488
1702
  } catch (err) {
1489
1703
  return self.throwError(response, 500, err);
1490
1704
  }
@@ -1536,7 +1750,7 @@ function SuperController(options) {
1536
1750
  //console.warn(err);
1537
1751
  }
1538
1752
 
1539
- freeMemory([jsonObj, data, request, response, next]);
1753
+ freeMemory([content, request, response, next]);
1540
1754
  }
1541
1755
  }
1542
1756
 
@@ -1577,7 +1791,7 @@ function SuperController(options) {
1577
1791
 
1578
1792
  ++_count;
1579
1793
  if (k == len-1) {
1580
- str = str.substr(0, str.length-1);
1794
+ str = str.substring(0, str.length-1);
1581
1795
  str += "\"_content_\"";
1582
1796
  for (let c = 0; c<_count; ++c) {
1583
1797
  str += "}"
@@ -1619,22 +1833,35 @@ function SuperController(options) {
1619
1833
  var authority = ( typeof(local.req.headers['x-forwarded-proto']) != 'undefined' ) ? local.req.headers['x-forwarded-proto'] : local.options.conf.server.scheme;
1620
1834
  authority += '://'+ local.req.headers.host;
1621
1835
  var useWebroot = false;
1622
- if ( !/^\/$/.test(local.options.conf.server.webroot) && local.options.conf.server.webroot.length > 0 && local.options.conf.hostname.replace(/\:\d+$/, '') == authority ) {
1836
+ if (
1837
+ !/^\/$/.test(local.options.conf.server.webroot)
1838
+ && local.options.conf.server.webroot.length > 0
1839
+ // && local.options.conf.hostname.replace(/\:\d+$/, '') == authority
1840
+ ) {
1623
1841
  useWebroot = true
1624
1842
  }
1625
1843
  authority = null;
1626
1844
 
1627
1845
  var reURL = new RegExp('^'+ local.options.conf.server.webroot);
1628
1846
 
1629
- var cssStr = '', jsStr = '';
1630
-
1847
+ var cssStr = ''
1848
+ , jsStr = ''
1849
+ ;
1631
1850
  //Get css
1632
1851
  if( viewConf.stylesheets ) {
1633
- cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL)
1852
+ // cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL);
1853
+ // Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
1854
+ var cssColl = new Collection(viewConf.stylesheets).orderBy({route: 'asc'})
1855
+ cssStr = getNodeRes('css', cssColl, useWebroot, reURL);
1856
+ cssColl = null;
1634
1857
  }
1635
1858
  //Get js
1636
1859
  if( viewConf.javascripts ) {
1637
- jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL)
1860
+ // jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL);
1861
+ // Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
1862
+ var jsColl = new Collection(viewConf.javascripts).orderBy({route: 'asc'})
1863
+ jsStr = getNodeRes('js', jsColl, useWebroot, reURL);
1864
+ jsColl = null;
1638
1865
  }
1639
1866
 
1640
1867
  set('page.view.stylesheets', cssStr);
@@ -1651,7 +1878,8 @@ function SuperController(options) {
1651
1878
  * @param {string} type
1652
1879
  * @param {string} resStr
1653
1880
  * @param {array} resArr
1654
- * @param {object} resObj
1881
+ * @param {boolean} useWebroot
1882
+ * @param {object} reURL - RegExp for webroot
1655
1883
  *
1656
1884
  * @returns {object} content
1657
1885
  *
@@ -1663,29 +1891,69 @@ function SuperController(options) {
1663
1891
  , rLen = resArr.length
1664
1892
  , obj = null
1665
1893
  , str = ''
1894
+ , isProxyHost = getContext('isProxyHost')
1666
1895
  , requestHost = ( /http\/2/.test(local.options.conf.server.protocol) )
1667
1896
  ? local.req.headers[':host']
1668
1897
  : local.req.headers.host
1669
1898
  , hostname = ( typeof(requestHost) != 'undefined' && local.options.conf.host != requestHost)
1670
- ? local.options.conf.server.scheme +'://'+ requestHost + ':'+ local.options.conf.server.port
1899
+ ? local.options.conf.server.scheme +'://'+ requestHost
1671
1900
  : local.options.conf.hostname
1901
+ , scheme = hostname.match(/^(https|http)/)[0]
1672
1902
  ;
1903
+ var requestPort = (local.req.headers.port||local.req.headers[':port']);
1904
+ var hostPort = local.options.conf.hostname.match(/(\:d+\/|\:\d+)$/);
1905
+ hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : local.options.conf.port[local.options.conf.server.protocol][local.options.conf.server.scheme];
1906
+ // Linking bundle B from bundle A wihtout proxy
1907
+ var isSpecialCase = (
1908
+ getContext('bundle') != local.options.conf.bundle
1909
+ && requestPort != hostPort
1910
+ && local.req.headers[':host'] != process.gina.PROXY_HOST
1911
+ ) ? true : false;
1912
+
1913
+ if (isSpecialCase) {
1914
+ hostname = local.options.conf.hostname
1915
+ }
1916
+
1917
+
1918
+ if (
1919
+ isProxyHost
1920
+ && !isSpecialCase
1921
+ ) {
1922
+
1923
+ hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']||process.gina.PROXY_HOST);
1924
+
1925
+ if (
1926
+ !/^(80|443)$/.test(requestPort)
1927
+ && !new RegExp(requestPort+'$').test(hostname)
1928
+ ) {
1929
+ hostname += ':'+ requestPort;
1930
+ }
1931
+ }
1932
+
1673
1933
  switch(type){
1674
1934
  case 'css':
1675
1935
  for (; r < rLen; ++r) {
1676
1936
  obj = resArr[r];
1677
1937
  if (useWebroot && !reURL.test(obj.url) ) {
1678
- obj.url = local.options.conf.server.webroot + obj.url.substr(1);
1938
+ obj.url = local.options.conf.server.webroot + obj.url.substring(1);
1939
+ }
1940
+ // HTTP2 Push via Link
1941
+ if (
1942
+ /http\/2/.test(local.options.conf.server.protocol)
1943
+ && !self.isCacheless()
1944
+ ) {
1945
+ local.options.template.h2Links += '<'+ obj.url +'>; as=style; rel=preload,'
1679
1946
  }
1680
1947
  // TODO - add support for cdn
1681
1948
  if (!/\:\/\//.test(obj.url) ) {
1682
1949
  obj.url = hostname + obj.url;
1683
1950
  }
1684
1951
 
1685
- if (obj.media)
1952
+ if (obj.media) {
1686
1953
  str += '\n\t\t<link href="'+ obj.url +'" media="'+ obj.media +'" rel="'+ obj.rel +'" type="'+ obj.type +'">';
1687
- else
1954
+ } else {
1688
1955
  str += '\n\t\t<link href="'+ obj.url +'" rel="'+ obj.rel +'" type="'+ obj.type +'">';
1956
+ }
1689
1957
  }
1690
1958
  break;
1691
1959
 
@@ -1695,13 +1963,34 @@ function SuperController(options) {
1695
1963
  for (; r < rLen; ++r) {
1696
1964
  obj = resArr[r];
1697
1965
  if (useWebroot && !reURL.test(obj.url) ) {
1698
- obj.url = local.options.conf.server.webroot + obj.url.substr(1);
1966
+ obj.url = local.options.conf.server.webroot + obj.url.substring(1);
1967
+ }
1968
+ // HTTP2 Push via Link
1969
+ if (
1970
+ /http\/2/.test(local.options.conf.server.protocol)
1971
+ && !self.isCacheless()
1972
+ ) {
1973
+ local.options.template.h2Links += '<'+ obj.url +'>; as=script; rel=preload,'
1699
1974
  }
1700
1975
  // TODO - add support for cdn
1701
1976
  if (!/\:\/\//.test(obj.url) ) {
1702
1977
  obj.url = hostname + obj.url;
1703
1978
  }
1704
- str += '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>'
1979
+
1980
+
1981
+ if ( /\/jquery\.(.*)\.(min\.js|js)$/i.test(obj.url) ) {
1982
+ console.warn('jQuery Plugin found in templates.json !\nIf you want to load it before [gina.min.js], you should declare it at the top of your handler using requireJS or add property "isExternalPlugin: true" in your templates.json, under: '+ (obj.route || local.req.routing.rule) +' .');
1983
+ }
1984
+ // Allow jQuery & other external plugins to be loaded in the HEAD section before gina
1985
+ if (
1986
+ obj.isExternalPlugin
1987
+ ) {
1988
+ local.options.template.externalPlugins.splice(1, 0, '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>');
1989
+ }
1990
+ else {
1991
+ // normal case
1992
+ str += '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>';
1993
+ }
1705
1994
  }
1706
1995
  break;
1707
1996
  }
@@ -1797,7 +2086,7 @@ function SuperController(options) {
1797
2086
 
1798
2087
  if (
1799
2088
  staticProps.isStaticFilename && staticsArr.indexOf(url) > -1
1800
- || staticProps.isStaticFilename && staticsArr.indexOf( url.replace(url.substr(url.lastIndexOf('/')+1), '') ) > -1
2089
+ || staticProps.isStaticFilename && staticsArr.indexOf( url.replace(url.substring(url.lastIndexOf('/')+1), '') ) > -1
1801
2090
  || staticProps.isStaticFilename && staticsArr.indexOf(staticProps.firstLevel) > -1
1802
2091
  ) {
1803
2092
  staticProps = null;
@@ -1895,9 +2184,9 @@ function SuperController(options) {
1895
2184
  // ignoreWebRoot = false
1896
2185
  // } else
1897
2186
  if (typeof(res) === 'string' || typeof(res) === 'number' || typeof(res) === 'boolean') {
1898
- if ( /true|1/.test(res) ) {
2187
+ if ( /^(true|1)$/i.test(res) ) {
1899
2188
  ignoreWebRoot = true
1900
- } else if ( /false|0/.test(res) ) {
2189
+ } else if ( /^(false|0)$/i.test(res) ) {
1901
2190
  ignoreWebRoot = false
1902
2191
  } else {
1903
2192
  res = local.res;
@@ -1918,13 +2207,13 @@ function SuperController(options) {
1918
2207
 
1919
2208
  }
1920
2209
 
1921
- if ( req.substr(0,1) === '/') { // is relative (not checking if the URI is defined in the routing.json)
1922
- // if (wroot.substr(wroot.length-1,1) == '/') {
1923
- // wroot = wroot.substr(wroot.length-1,1).replace('/', '')
2210
+ if ( req.substring(0,1) === '/') { // is relative (not checking if the URI is defined in the routing.json)
2211
+ // if (wroot.substring(wroot.length-1,1) == '/') {
2212
+ // wroot = wroot.substring(wroot.length-1,1).replace('/', '')
1924
2213
  // }
1925
2214
 
1926
2215
  if ( /^\//.test(req) && !ignoreWebRoot )
1927
- req = req.substr(1);
2216
+ req = req.substring(1);
1928
2217
 
1929
2218
  rte = ( ignoreWebRoot != null && ignoreWebRoot ) ? req : wroot + req;
1930
2219
  // cleaning url in case of ?param=value
@@ -2015,11 +2304,32 @@ function SuperController(options) {
2015
2304
 
2016
2305
  if ( !self.forward404Unless(condition, req, res) ) { // forward to 404 if bad route
2017
2306
 
2018
- var isProxyHost = ( typeof(local.req.headers.host) != 'undefined' && local.options.conf.server.scheme +'://'+ local.req.headers.host != local.options.conf.hostname || typeof(local.req.headers[':authority']) != 'undefined' && local.options.conf.server.scheme +'://'+ local.req.headers[':authority'] != local.options.conf.hostname ) ? true : false;
2019
- var hostname = (isProxyHost) ? ctx.config.envConf[bundle][env].hostname.replace(/\:\d+$/, '') : ctx.config.envConf[bundle][env].hostname;
2307
+ var localRequestPort = local.req.headers.port || local.req.headers[':port'];
2308
+ var isProxyHost = (
2309
+ typeof(local.req.headers.host) != 'undefined'
2310
+ && typeof(localRequestPort) != 'undefined'
2311
+ && /^(80|443)$/.test(localRequestPort)
2312
+ && local.options.conf.server.scheme +'://'+ local.req.headers.host +':'+ localRequestPort != local.options.conf.hostname.replace(/\:\d+$/, '') +':'+ local.options.conf.server.port
2313
+ ||
2314
+ typeof(local.req.headers[':authority']) != 'undefined'
2315
+ && local.options.conf.server.scheme +'://'+ local.req.headers[':authority'] != local.options.conf.hostname
2316
+ ||
2317
+ typeof(local.req.headers.host) != 'undefined'
2318
+ && typeof(localRequestPort) != 'undefined'
2319
+ && /^(80|443)$/.test(localRequestPort)
2320
+ && req.headers.host == local.options.conf.host
2321
+ ||
2322
+ typeof(local.req.headers['x-nginx-proxy']) != 'undefined'
2323
+ && /^true$/i.test(local.req.headers['x-nginx-proxy'])
2324
+ ||
2325
+ typeof(process.gina.PROXY_HOSTNAME) != 'undefined'
2326
+ ) ? true : false;
2327
+
2328
+ // var isProxyHost = getContext('isProxyHost');
2329
+ var hostname = (isProxyHost)
2330
+ ? process.gina.PROXY_HOSTNAME
2331
+ : ctx.config.envConf[bundle][env].hostname;
2020
2332
 
2021
- // if ( !/\:\d+$/.test(req.headers.host) )
2022
- // hostname = hostname.replace(/\:\d+$/, '');
2023
2333
 
2024
2334
  if (route) { // will go with route first
2025
2335
 
@@ -2078,7 +2388,7 @@ function SuperController(options) {
2078
2388
  originalMethod && !/GET/i.test(originalMethod)
2079
2389
  ) { // trying to redirect using the wrong method ?
2080
2390
 
2081
- console.warn(new Error('Your are trying to redirect using the wrong method: `'+ req.method+'`.\nThis can often occur while redirecting from a controller to another controller or from a bundle to another.\nA redirection is not permitted in this scenario.\nD\'ont panic :)\nSwitching request method to `GET` method instead.\n').message);
2391
+ console.warn(new Error('Your are trying to redirect using the wrong method: `'+ req.method+'`.\nThis can often occur while redirecting from a controller to another controller or from a bundle to another.\nA redirection is not permitted in this scenario.\nDon\'t panic :)\nSwitching request method to `GET` method instead.\n').message);
2082
2392
  method = local.req.method = self.setRequestMethod('GET', conf);
2083
2393
  code = 303;
2084
2394
  }
@@ -2287,9 +2597,8 @@ function SuperController(options) {
2287
2597
  * @param {string} url - eg.: https://upload.wikimedia.org/wikipedia/fr/2/2f/Firefox_Old_Logo.png
2288
2598
  * @param {object} [options]
2289
2599
  *
2290
- *
2291
2600
  * */
2292
- this.downloadFromURL = function(url, options) {
2601
+ this.downloadFromURL = function(url, options, cb) {
2293
2602
 
2294
2603
  var defaultOptions = {
2295
2604
  // file name i you want to rename the file
@@ -2326,15 +2635,13 @@ function SuperController(options) {
2326
2635
 
2327
2636
  if ( /\:\/\//.test(url) ) {
2328
2637
  scheme = url.match(/^\w+\:/)[0];
2329
- scheme = scheme.substr(0, scheme.length-1);
2638
+ scheme = scheme.substring(0, scheme.length-1);
2330
2639
 
2331
2640
  if ( !/^http/.test(scheme) ) {
2332
2641
  self.throwError(local.res, 500, new Error('[ '+ scheme +' ] Scheme not supported. Ref.: `http` or `https` only'));
2333
2642
  return;
2334
2643
  }
2335
2644
 
2336
-
2337
-
2338
2645
  } else { // by default
2339
2646
  scheme = 'http';
2340
2647
  }
@@ -2342,9 +2649,10 @@ function SuperController(options) {
2342
2649
  requestOptions.scheme = scheme +':';
2343
2650
 
2344
2651
  //defining port
2652
+ // console.debug('[ CONTROLLER ][ HTTP/2.0#downloadFromURL ] defining port from: ', url);
2345
2653
  var port = url.match(/\:\d+\//) || null;
2346
2654
  if ( port != null ) {
2347
- port = port[0].substr(1, port[0].length-2);
2655
+ port = port[0].match(/\d+/)[0];
2348
2656
  requestOptions.port = ~~port;
2349
2657
  }
2350
2658
 
@@ -2376,7 +2684,7 @@ function SuperController(options) {
2376
2684
  opt.contentDisposition += '; filename=' + filename;
2377
2685
  }
2378
2686
 
2379
- var ext = filename.match(/\.\w+$/)[0].substr(1)
2687
+ var ext = filename.match(/\.\w+$/)[0].substring(1)
2380
2688
  , contentType = null
2381
2689
  , tmp = _(GINA_TMPDIR +'/'+ filename, true)
2382
2690
  ;
@@ -2394,11 +2702,32 @@ function SuperController(options) {
2394
2702
  requestOptions.headers['content-type'] = contentType;
2395
2703
  requestOptions.headers['content-disposition'] = opt.contentDisposition;
2396
2704
 
2705
+ if (
2706
+ typeof(local.req.headers['x-client-ip']) != 'undefined'
2707
+ && local.req.headers['x-client-ip'] != requestOptions.headers['x-client-ip']
2708
+ ) {
2709
+ requestOptions.headers['x-client-ip'] = local.req.headers['x-client-ip']
2710
+ }
2711
+
2712
+ if (
2713
+ typeof(local.req.headers['x-ingress-ip']) != 'undefined'
2714
+ && local.req.headers['x-ingress-ip'] != requestOptions.headers['x-ingress-ip']
2715
+ ) {
2716
+ requestOptions.headers['x-ingress-ip'] = local.req.headers['x-ingress-ip']
2717
+ }
2718
+
2719
+ if (
2720
+ typeof(local.req.headers['x-forwarded-for']) != 'undefined'
2721
+ && local.req.headers['x-forwarded-for'] != requestOptions.headers['x-forwarded-for']
2722
+ ) {
2723
+ requestOptions.headers['x-forwarded-for'] = local.req.headers['x-forwarded-for']
2724
+ }
2725
+
2397
2726
  var browser = require(''+ scheme);
2398
- //console.debug('requestOptions: \n', JSON.stringify(requestOptions, null, 4));
2727
+ // console.debug('requestOptions: \n', JSON.stringify(requestOptions, null, 2));
2399
2728
 
2400
2729
  browser
2401
- .get(requestOptions, function(response) {
2730
+ .get(requestOptions, async function(response) {
2402
2731
 
2403
2732
  local.res.setHeader('content-type', contentType + '; charset='+ local.options.conf.encoding);
2404
2733
  local.res.setHeader('content-disposition', opt.contentDisposition);
@@ -2410,9 +2739,15 @@ function SuperController(options) {
2410
2739
  // local.res.setHeader('pragma', 'must-revalidate');
2411
2740
 
2412
2741
 
2413
- response.pipe(local.res);
2742
+ await response.pipe(local.res);
2743
+ if ( typeof(cb) != 'undefined' ) {
2744
+ cb(false)
2745
+ }
2414
2746
  })
2415
2747
  .on('error', function onDownloadError(err) {
2748
+ if ( typeof(cb) != 'undefined' ) {
2749
+ return cb(err)
2750
+ }
2416
2751
  self.throwError(local.res, 500, err);
2417
2752
  });
2418
2753
 
@@ -2659,7 +2994,8 @@ function SuperController(options) {
2659
2994
  ) {
2660
2995
  return false
2661
2996
  }
2662
- self.isProcessingError = false; // by default
2997
+ // by default
2998
+ self.isProcessingError = false;
2663
2999
 
2664
3000
  var queryData = {}
2665
3001
  , defaultOptions = local.query.options
@@ -2669,14 +3005,14 @@ function SuperController(options) {
2669
3005
 
2670
3006
  // options must be used as a copy in case of multiple calls of self.query(options, ...)
2671
3007
  options = merge(JSON.clone(options), defaultOptions);
2672
- // options = merge(options, defaultOptions);
2673
3008
 
2674
- for (var o in options) {//cleaning
3009
+ for (let o in options) {//cleaning
2675
3010
  if ( typeof(options[o]) == 'undefined' || options[o] == undefined) {
2676
3011
  delete options[o]
2677
3012
  }
2678
3013
  }
2679
3014
 
3015
+
2680
3016
  if (self.isCacheless() || self.isLocalScope() ) {
2681
3017
  options.rejectUnauthorized = false;
2682
3018
  }
@@ -2745,14 +3081,17 @@ function SuperController(options) {
2745
3081
  if ( local.req != null && typeof(local.req.ginaHeaders) != 'undefined' ) {
2746
3082
  // gina form headers
2747
3083
  for (let h in local.req.ginaHeaders.form) {
2748
- let k = h.substr(0,1).toUpperCase() + h.substr(1);
3084
+ let k = h.substring(0,1).toUpperCase() + h.substring(1);
2749
3085
  options.headers['X-Gina-Form-' + k ] = local.req.ginaHeaders.form[h];
2750
3086
  }
2751
3087
  }
2752
3088
 
2753
- var ctx = getContext()
2754
- , protocol = null
2755
- , scheme = null
3089
+ var ctx = getContext()
3090
+ , protocol = null
3091
+ , scheme = null
3092
+ , isProxyHost = getContext('isProxyHost')
3093
+ , bundle = null
3094
+ , webroot = options.webroot || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.webroot;// bundle servers's webroot by default
2756
3095
  ;
2757
3096
  // cleanup options.path
2758
3097
  if (/\:\/\//.test(options.path)) {
@@ -2769,11 +3108,16 @@ function SuperController(options) {
2769
3108
  .replace(':'+port, '');
2770
3109
  }
2771
3110
 
3111
+ // if ( typeof(options.protocol) == 'undefined' ) {
3112
+ // options.protocol = ctx.gina.config.envConf[ctx.bundle][ctx.env].server.protocol;
3113
+ // }
3114
+
2772
3115
  // retrieve protocol & scheme: if empty, take the bundles protocol
2773
3116
  protocol = options.protocol || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.protocol;// bundle servers's protocol by default
2774
3117
  protocol = protocol.match(/[.a-z 0-9]+/ig)[0];
2775
3118
  scheme = options.scheme || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.scheme;// bundle servers's scheme by default
2776
3119
  scheme = scheme.match(/[a-z 0-9]+/ig)[0];
3120
+
2777
3121
  // retrieve credentials
2778
3122
  if ( typeof(options.ca) == 'undefined' || ! options.ca ) {
2779
3123
  options.ca = ctx.gina.config.envConf[ctx.bundle][ctx.env].server.credentials.ca;
@@ -2782,24 +3126,18 @@ function SuperController(options) {
2782
3126
  //retrieving dynamic host, hostname & port
2783
3127
  if ( /\@/.test(options.hostname) ) {
2784
3128
 
2785
- var bundle = ( options.hostname.replace(/(.*)\:\/\//, '') ).split(/\@/)[0];
2786
-
3129
+ bundle = ( options.hostname.replace(/(.*)\:\/\//, '') ).split(/\@/)[0];
2787
3130
  // No shorcut possible because conf.hostname might differ from user inputs
2788
3131
  options.host = ctx.gina.config.envConf[bundle][ctx.env].host.replace(/(.*)\:\/\//, '').replace(/\:\d+/, '');
2789
3132
  options.hostname = ctx.gina.config.envConf[bundle][ctx.env].hostname;
2790
3133
  options.port = ctx.gina.config.envConf[bundle][ctx.env].server.port;
2791
-
2792
- options.protocol = ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
3134
+ options.protocol = options.protocol || ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
2793
3135
  options.scheme = ctx.gina.config.envConf[bundle][ctx.env].server.scheme;
2794
3136
 
2795
3137
  // retrieve credentials
2796
3138
  if ( typeof(options.ca) == 'undefined' || ! options.ca ) {
2797
3139
  options.ca = ctx.gina.config.envConf[bundle][ctx.env].server.credentials.ca;
2798
3140
  }
2799
-
2800
- // might be != from the bundle requesting
2801
- //options.protocol = ctx.gina.config.envConf[bundle][ctx.env].content.settings.server.protocol || ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
2802
- //options.scheme = ctx.gina.config.envConf[bundle][ctx.env].content.settings.server.scheme || ctx.gina.config.envConf[bundle][ctx.env].server.scheme;
2803
3141
  }
2804
3142
 
2805
3143
  if ( typeof(options.protocol) == 'undefined' ) {
@@ -2813,45 +3151,224 @@ function SuperController(options) {
2813
3151
 
2814
3152
 
2815
3153
  // reformating scheme
2816
- if( !/\:$/.test(options.scheme) )
3154
+ if( !/\:$/.test(options.scheme) ) {
2817
3155
  options.scheme += ':';
3156
+ }
3157
+
3158
+ if (isProxyHost) {
3159
+ // X-Forwarded-Host
3160
+ options.headers['x-forwarded-host'] = process.gina.PROXY_HOST;
3161
+ // X-Forwarded-Proto
3162
+ options.headers['x-forwarded-proto'] = process.gina.PROXY_SCHEME;
3163
+ }
3164
+
3165
+ if ( ctx.gina.config.envConf[ctx.bundle][ctx.env].server.resolvers.length > 0 ) {
3166
+ var resolversColl = new Collection(ctx.gina.config.envConf[ctx.bundle][ctx.env].server.resolvers);
3167
+ options.nameservers = resolversColl.findOne({ scope: process.env.NODE_SCOPE}).nameservers;
3168
+ resolversColl = null;
3169
+ }
2818
3170
 
2819
3171
  try {
2820
3172
  options.queryData = queryData;
3173
+
3174
+ bundle = null;
3175
+
3176
+ // TODO - Add preferred communication method option: cCurl or HTTP
3177
+ // return handleCurlRequest(options, callback);
3178
+
2821
3179
  var protocolVersion = ~~options.protocol.match(/\/(.*)$/)[1].replace(/\.\d+/, '');
2822
3180
  var httpLib = options.protocol.match(/^(.*)\//)[1] + ( (protocolVersion >= 2) ? protocolVersion : '' );
2823
3181
  if ( !/http2/.test(httpLib) && /https/.test(options.scheme) ) {
2824
3182
  httpLib += 's';
2825
3183
  }
2826
-
2827
3184
  browser = require(''+ httpLib);
2828
-
2829
3185
  if ( /http2/.test(httpLib) ) {
2830
3186
  return handleHTTP2ClientRequest(browser, options, callback);
2831
3187
  } else {
2832
3188
  return handleHTTP1ClientRequest(browser, options, callback);
2833
3189
  }
2834
3190
 
2835
-
2836
3191
  } catch(err) {
2837
3192
  if (callback) {
2838
3193
  return callback(err)
2839
3194
  }
2840
3195
  self.emit('query#complete', err)
2841
3196
  }
3197
+ }
3198
+
3199
+ var handleCurlRequest = async function(opt, callback) {
3200
+
3201
+
3202
+ var body = null;
3203
+ // https://docs.couchbase.com/server/current/n1ql-rest-query/index.html#Request
3204
+ var cmd = [
3205
+ '$(which curl)'
3206
+ ];
3207
+
3208
+ if (!opt.rejectUnauthorized) {
3209
+ // (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers
3210
+ // same as --insecure
3211
+ cmd.splice(1,0,'-k');
3212
+ }
3213
+
3214
+ // method
3215
+ if ( !/get/i.test(opt.method) ) {
3216
+ cmd.splice(1,0,'-X '+ opt.method.toUpperCase() );
3217
+ }
3218
+
3219
+
3220
+ if ( /(post|put)/i.test(opt.method) && opt.queryData.length > 0) {
3221
+ cmd.push('-d '+ opt.queryData );
3222
+ body = Buffer.from(opt.queryData);
3223
+ opt.headers['content-length'] = body.length;
3224
+ } else if (
3225
+ /get/i.test(opt.method)
3226
+ && typeof(opt.headers['content-length']) != 'undefined'
3227
+ ) {
3228
+ delete opt.headers['content-length'];
3229
+ }
2842
3230
 
3231
+ if ( opt.headers.count() > 0) {
3232
+ for (let h in opt.headers) {
3233
+ cmd.splice(1,0,'-H "'+ h +': '+ opt.headers[h] +'"');
3234
+ }
3235
+ }
3236
+
3237
+ // resolvers
3238
+ if (opt.nameservers) {
3239
+ resolver.setServers(opt.nameservers);
3240
+ await resolver
3241
+ .resolve4(opt.host)
3242
+ .catch( function onResolverErr(e) {
3243
+ var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
3244
+ var msg = 'Could not resolve with these `settings.server.resolvers`:\n'+ opt.nameservers.toString() +'\n' + e.stack+ '\nController Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r';
3245
+ var exception = new Error(msg);
3246
+ exception.status = 500;
3247
+ return self.throwError(exception);
3248
+ })
3249
+ .then( function onResolved(ips) {
3250
+ if ( typeof(ips) == 'undefined' || !Array.isArray(ips) || !ips.length ) {
3251
+ var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
3252
+ var e = new Error('`Unable to resolve ${opt.host}`');
3253
+ var msg = 'Please check`settings.server.resolvers`:\n'+ opt.nameservers.toString() +'\n'+ e.stack + 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r';
3254
+ var exception = new Error(msg);
3255
+ exception.status = 500;
3256
+ return self.throwError(exception);
3257
+ }
3258
+ for (let i=0, len=ips.length; i<len; i++) {
3259
+ // e.g.: --resolve www.example.com:443:127.0.0.1
3260
+ cmd.push('--resolve '+ opt.host +':'+ opt.port +':'+ ips[i]);
3261
+ }
3262
+ });
3263
+ }
3264
+
3265
+
3266
+
3267
+
3268
+ cmd.push('-v "'+ opt.hostname + opt.path +'"');
3269
+
3270
+ // Default maxBuffer is 200KB (=> 1024 * 200)
3271
+ // Setting it to 10MB - preventing: stdout maxBuffer length exceeded
3272
+ var maxBuffer = (1024 * 1024 * 10);
3273
+ exec(cmd.join(' '), { maxBuffer: maxBuffer }, function onResult(err, dataStr, infos) {
3274
+ var error = null;
3275
+ if (err) {
3276
+ try {
3277
+ // by default
3278
+ error = new Error('[ CONTROLLER ][ CURL#query ] request aborted\n'+ err.stack);
3279
+ if (
3280
+ typeof(err.message) != 'undefined'
3281
+ && /Failed to connect/i.test(err.message)
3282
+ ) {
3283
+ var port = getContext('gina').ports[opt.protocol][opt.scheme.replace(/\:/, '')][ opt.port ];
3284
+ error.accessPoint = port;
3285
+ error.message = 'Could not connect to [ ' + error.accessPoint + ' ].\nThe `'+port.split(/\@/)[0]+'` bundle is offline or unreachable.\n';
3286
+ }
3287
+ console.error(error.stack);
3288
+ if ( typeof(callback) != 'undefined' ) {
3289
+ callback(error)
3290
+ } else {
3291
+ self.emit('query#complete', error)
3292
+ }
3293
+ } catch (e) {
3294
+ // console.error(e.stack);
3295
+ var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
3296
+ var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
3297
+ var exception = new Error(msg);
3298
+ exception.status = 500;
3299
+ self.throwError(exception);
3300
+ }
3301
+ return;
3302
+ }
3303
+
3304
+
3305
+ try {
3306
+ let data = JSON.parse(dataStr);
3307
+ if ( typeof(data) == 'undefined' ) {
3308
+ data = {}
3309
+ }
3310
+ if ( typeof(callback) != 'undefined' ) {
3311
+ callback(err, data)
3312
+ } else {
3313
+ self.emit('query#complete', err, data)
3314
+ }
3315
+ } catch (e) {
3316
+ // _err.stack = '[ CONTROLLER ][ CURL#query ] onCallbackError: '+ e.stack;
3317
+ // console.error(e.stack);
3318
+ var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
3319
+ var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
3320
+ var exception = new Error(msg);
3321
+ exception.status = 500;
3322
+ self.throwError(exception);
3323
+ return;
3324
+ }
3325
+ });
2843
3326
  }
2844
3327
 
3328
+ var handleHTTP1ClientRequestv2 = function (browser, options, callback) {
3329
+ var agent = new browser.Agent({ keepAlive: true });
3330
+ var options = {
3331
+ host: options.host,
3332
+ port: options.port,
3333
+ path: options.path,
3334
+ method: 'GET',
3335
+ agent: agent
3336
+ };
3337
+
3338
+ var req = browser.request(options, function(res) {
3339
+ var str = "";
3340
+ var err = false;
3341
+ res.on('data', function (chunk) {
3342
+ str += chunk;
3343
+ });
3344
+ res.on('end', function () {
3345
+ // done
3346
+ return callback( err, data );
3347
+ });
3348
+ });
3349
+ req.write('');
3350
+ req.end();
3351
+ req.on('error', function(error) {
3352
+ err = error
3353
+ });
3354
+ };
3355
+
2845
3356
  var handleHTTP1ClientRequest = function(browser, options, callback) {
2846
3357
 
2847
3358
  var altOpt = JSON.clone(options);
3359
+ // var credentials = self.getConfig('settings').server.credentials;
3360
+ // options.ca = credentials.ca;
3361
+ // options.encKey = credentials.privateKey;
3362
+ // options.encCert = credentials.certificate;
3363
+
2848
3364
 
2849
3365
  altOpt.protocol = options.scheme;
2850
3366
  altOpt.hostname = options.host;
2851
3367
  altOpt.port = options.port;
3368
+ altOpt.maxSockets = options.maxSockets || 1;
2852
3369
  if ( typeof(altOpt.encKey) != 'undefined' ) {
2853
3370
  try {
2854
- altOpt.encKey = fs.readFileSync(options.encKey);
3371
+ altOpt.encKey = fs.readFileSync(altOpt.encKey);
2855
3372
  } catch(err) {
2856
3373
  self.emit('query#complete', err);
2857
3374
  }
@@ -2862,7 +3379,7 @@ function SuperController(options) {
2862
3379
 
2863
3380
  if ( typeof(altOpt.encCert) != 'undefined' ) {
2864
3381
  try {
2865
- altOpt.encCert = fs.readFileSync(options.encCert);
3382
+ altOpt.encCert = fs.readFileSync(altOpt.encCert);
2866
3383
  } catch(err) {
2867
3384
  self.emit('query#complete', err);
2868
3385
  }
@@ -2871,6 +3388,11 @@ function SuperController(options) {
2871
3388
  console.warn('[ CONTROLLER ][ HTTP/1.0#query ] options.encCert not found !');
2872
3389
  }
2873
3390
 
3391
+
3392
+ delete altOpt.ca;
3393
+ delete altOpt.encKey;
3394
+ delete altOpt.encCert;
3395
+
2874
3396
  altOpt.agent = new browser.Agent(altOpt);
2875
3397
 
2876
3398
  var req = browser.request(altOpt, function(res) {
@@ -2930,7 +3452,7 @@ function SuperController(options) {
2930
3452
  return;
2931
3453
  }
2932
3454
  } catch (e) {
2933
- var infos = local.options, controllerName = infos.controller.substr(infos.controller.lastIndexOf('/'));
3455
+ var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
2934
3456
  var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
2935
3457
  var exception = new Error(msg);
2936
3458
  exception.status = 500;
@@ -3024,7 +3546,7 @@ function SuperController(options) {
3024
3546
  cb(err, data)
3025
3547
  }
3026
3548
  } catch (e) {
3027
- var infos = local.options, controllerName = infos.controller.substr(infos.controller.lastIndexOf('/'));
3549
+ var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
3028
3550
  var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
3029
3551
  var exception = new Error(msg);
3030
3552
  exception.status = 500;
@@ -3101,10 +3623,8 @@ function SuperController(options) {
3101
3623
  delete options.queryData;
3102
3624
 
3103
3625
 
3104
-
3105
3626
  const client = browser.connect(options.hostname, options);
3106
3627
 
3107
-
3108
3628
  const {
3109
3629
  HTTP2_HEADER_PROTOCOL,
3110
3630
  HTTP2_HEADER_SCHEME,
@@ -3127,6 +3647,32 @@ function SuperController(options) {
3127
3647
  options.headers['content-type'] = local.req.headers['content-type']
3128
3648
  }
3129
3649
 
3650
+ if ( typeof(local.req.headers['x-client-ip']) != 'undefined' && local.req.headers['x-client-ip'] != options.headers['x-client-ip'] ) {
3651
+ options.headers['x-client-ip'] = local.req.headers['x-client-ip']
3652
+ }
3653
+
3654
+ if ( typeof(local.req.headers['x-ingress-ip']) != 'undefined' && local.req.headers['x-ingress-ip'] != options.headers['x-ingress-ip'] ) {
3655
+ options.headers['x-ingress-ip'] = local.req.headers['x-ingress-ip']
3656
+ }
3657
+
3658
+ // x-forwarded-for check
3659
+ // console.debug('[ CONTROLLER ][ HTTP/2.0#query ] checking x-forwarded-for');
3660
+ if (
3661
+ // Previous proxies
3662
+ typeof(local.req.headers['x-forwarded-for']) != 'undefined'
3663
+ && local.req.headers['x-forwarded-for'] != ""
3664
+ // current proxy
3665
+ && typeof(local.req.headers['x-real-ip']) != 'undefined'
3666
+ ) {
3667
+ // console.debug('[ CONTROLLER ][ HTTP/2.0#query ] options.headers', JSON.stringify(options.headers, null, 2));
3668
+ // console.debug('[ CONTROLLER ][ HTTP/2.0#query ] local.req.headers', JSON.stringify(local.req.headers, null, 2));
3669
+ var xForwardedFor = "" + local.req.headers['x-forwarded-for'];
3670
+ // Adding the current PI to the list
3671
+ xForwardedFor += ", "+local.req.headers['x-real-ip'];
3672
+ xForwardedFor = null;
3673
+ // console.debug('[ CONTROLLER ][ HTTP/2.0#query ] options.headers["x-forwarded-for"]', options.headers['x-forwarded-for']);
3674
+ }
3675
+
3130
3676
  var headers = merge({
3131
3677
  [HTTP2_HEADER_METHOD]: options[':method'],
3132
3678
  [HTTP2_HEADER_PATH]: options[':path']
@@ -3134,7 +3680,11 @@ function SuperController(options) {
3134
3680
 
3135
3681
  // merging with user options
3136
3682
  for (var o in options) {
3137
- if (!/^\:/.test(o) && !/headers/.test(o) && typeof(headers[o]) == 'undefined' ) {
3683
+ if (
3684
+ !/^\:/.test(o)
3685
+ && !/headers/.test(o)
3686
+ && typeof(headers[o]) == 'undefined'
3687
+ ) {
3138
3688
  headers[o] = options[o]
3139
3689
  }
3140
3690
  }
@@ -3154,6 +3704,7 @@ function SuperController(options) {
3154
3704
  }
3155
3705
 
3156
3706
 
3707
+
3157
3708
  client.on('error', (error) => {
3158
3709
 
3159
3710
  console.error( '`'+ options[':path']+ '` : '+ error.stack||error.message);
@@ -3289,7 +3840,7 @@ function SuperController(options) {
3289
3840
  }
3290
3841
 
3291
3842
  } catch (e) {
3292
- var infos = local.options, controllerName = infos.controller.substr(infos.controller.lastIndexOf('/'));
3843
+ var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
3293
3844
  var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
3294
3845
  var exception = new Error(msg);
3295
3846
  exception.status = 500;
@@ -3367,7 +3918,7 @@ function SuperController(options) {
3367
3918
  cb(err, data)
3368
3919
  }
3369
3920
  } catch (e) {
3370
- var infos = local.options, controllerName = infos.controller.substr(infos.controller.lastIndexOf('/'));
3921
+ var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
3371
3922
  var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
3372
3923
  var exception = new Error(msg);
3373
3924
  exception.status = 500;
@@ -3502,11 +4053,11 @@ function SuperController(options) {
3502
4053
  project = route.param.project;
3503
4054
  } // TODO - add support for project pointer : getContext('gina').projects[project]
3504
4055
  if (/\@(.*)$/.test(route.param.url)) {
3505
- var targetedBundle = route.param.url.substr(route.param.url.lastIndexOf('@')+1);
4056
+ var targetedBundle = route.param.url.substring(route.param.url.lastIndexOf('@')+1);
3506
4057
  hostname = targetedBundle +'@'+ project;
3507
4058
  port = hostname;
3508
4059
  var webroot = getContext('gina').config.envConf[targetedBundle][local.options.conf.env].server.webroot;
3509
- path = (/\/$/.test(webroot)) ? webroot.substr(0, webroot.length-1) : webroot;
4060
+ path = (/\/$/.test(webroot)) ? webroot.substring(0, webroot.length-1) : webroot;
3510
4061
  } else {
3511
4062
  hostname = route.param.hostname;
3512
4063
  port = route.param.port;
@@ -3560,24 +4111,28 @@ function SuperController(options) {
3560
4111
  *
3561
4112
  * */
3562
4113
  this.getConfig = function(name) {
4114
+ var tmp = null;
3563
4115
  if ( typeof(name) != 'undefined' ) {
3564
4116
  try {
3565
- // needs to be read only
3566
- //config = JSON.clone(local.options.conf.content[name]);
3567
- //config = Object.freeze(local.options.conf.content[name]);
3568
- //Object.seal(local.options.conf.content[name]);
3569
- //Object.freeze(local.options.conf.content[name]);
3570
- // if ( self.isCacheless() ) {
3571
- // }
3572
- return JSON.clone(local.options.conf.content[name]);
4117
+ // Needs to be read only
4118
+ tmp = JSON.clone(local.options.conf.content[name]);
3573
4119
  } catch (err) {
3574
4120
  return undefined;
3575
4121
  }
3576
4122
  } else {
3577
- // config = JSON.stringify(local.options.conf);
3578
- // return JSON.parse(config)
3579
- return JSON.clone(local.options.conf);
4123
+ tmp = JSON.clone(local.options.conf);
3580
4124
  }
4125
+
4126
+ if (
4127
+ getContext('isProxyHost')
4128
+ && typeof(tmp.hostname) != 'undefined'
4129
+ ) {
4130
+ tmp.hostname = process.gina.PROXY_HOSTNAME;
4131
+ tmp.host = process.gina.PROXY_HOST;
4132
+ // tmp.hostname = getContext('gina').config.envConf._proxyHostname
4133
+ // tmp.host = tmp.hostname.replace(/^(https|http)\:\/\//, '');
4134
+ }
4135
+ return tmp;
3581
4136
  }
3582
4137
 
3583
4138
  /**
@@ -3687,45 +4242,64 @@ function SuperController(options) {
3687
4242
  return rules;
3688
4243
  }
3689
4244
 
3690
- this.push = function(payload) {
4245
+ this.push = function(payload, option, callback) {
3691
4246
 
3692
4247
  var req = local.req, res = local.res;
3693
4248
  var method = req.method.toLowerCase();
3694
4249
  // if no session defined, will push to all active clients
4250
+ // resuming current session
3695
4251
  var sessionId = ( typeof(req[method].sessionID) != 'undefined' ) ? req[method].sessionID : null;
3696
-
3697
- // resume current session
4252
+ // retrieve section if existing
4253
+ var section = ( typeof(req[method].section) != 'undefined' ) ? req[method].section : null;
3698
4254
 
3699
4255
  if (!payload) {
3700
4256
  payload = null;
3701
4257
  if ( typeof(req[method]) != 'undefined' && typeof(req[method].payload) != 'undefined' ) {
3702
4258
  if ( typeof(payload) == 'string' ) {
3703
- payload = decodeURIComponent(req[method].payload)
4259
+ payload = decodeURIComponent(req[method].payload);
4260
+ payload = JSON.parse(payload);
4261
+ if ( section && typeof(payload.section) == 'undefined' ) {
4262
+ payload.section = section
4263
+ }
4264
+ payload = JSON.stringify(payload)
3704
4265
  } else {
4266
+ if ( section && typeof(req[method].payload.section) == 'undefined' ) {
4267
+ req[method].payload.section = section
4268
+ }
3705
4269
  payload = JSON.stringify(req[method].payload)
3706
4270
  }
3707
4271
  }
3708
4272
  } else if ( typeof(payload) == 'object' ) {
4273
+ if ( section && typeof(payload.section) == 'undefined' ) {
4274
+ payload.section = section
4275
+ }
3709
4276
  payload = JSON.stringify(payload)
3710
4277
  }
3711
4278
 
3712
4279
  try {
3713
4280
  var clients = null;
3714
- if (sessionId) {
3715
- clients = self.serverInstance.eio.getClientsBySessionId(sessionId);
3716
- if (clients)
3717
- clients.send(payload);
3718
- }
4281
+ clients = self.serverInstance.eio.clients;
4282
+ if ( clients ) {
4283
+ for (let s in clients) {
4284
+ if ( !clients[s].constructor.name == 'Socket' ) {
4285
+ continue;
4286
+ }
3719
4287
 
3720
- // send to all clients if no specific sessionId defined
3721
- if (!sessionId) {
3722
- clients = self.serverInstance.eio.clients;
3723
- for (var id in clients) {
3724
- clients[id].send(payload)
4288
+ if (
4289
+ // session filter
4290
+ sessionId
4291
+ && typeof(clients[s].sessionId) != 'undefined'
4292
+ && clients[s].sessionId == sessionId
4293
+ ||
4294
+ // send to all clients if no specific sessionId defined
4295
+ !sessionId
4296
+ ) {
4297
+ clients[s].sendPacket("message", payload, options, callback);
4298
+ }
3725
4299
  }
3726
4300
  }
3727
4301
 
3728
- res.end();
4302
+ // res.end();
3729
4303
  } catch(err) {
3730
4304
  self.throwError(err);
3731
4305
  return;
@@ -4002,7 +4576,7 @@ function SuperController(options) {
4002
4576
  //instance: self.serverInstance,
4003
4577
  //template: (routeHasViews) ? bundleConf.content.templates[templateName] : undefined,
4004
4578
  //isUsingTemplate: local.isUsingTemplate,
4005
- //cacheless: cacheless,
4579
+ //isCacheless: isCacheless,
4006
4580
  path: null //, // user custom path : namespace should be ignored | left blank
4007
4581
  //assets: {}
4008
4582
  };
@@ -4228,11 +4802,11 @@ function SuperController(options) {
4228
4802
  , ext = null
4229
4803
  , isHtmlContent = false
4230
4804
  , hasCustomErrorFile = false
4231
- , eCode = code.toString().substr(0,1) + 'xx'
4805
+ , eCode = code.toString().substring(0,1) + 'xx'
4232
4806
  ;
4233
- var extArr = url.substr(url.lastIndexOf('.')).match(/(\.[A-Za-z0-9]+)/);
4807
+ var extArr = url.substring(url.lastIndexOf('.')).match(/(\.[A-Za-z0-9]+)/);
4234
4808
  if (extArr) {
4235
- ext = extArr[0].substr(1);
4809
+ ext = extArr[0].substring(1);
4236
4810
  }
4237
4811
  if ( !ext || /^(html|htm)$/i.test(ext) ) {
4238
4812
  isHtmlContent = true;
@@ -4306,8 +4880,7 @@ function SuperController(options) {
4306
4880
 
4307
4881
  local.req.routing = routeObj;
4308
4882
  local.req.params.errorObject = errorObject;
4309
- self.renderCustomError(local.req, res, local.next);
4310
- return;
4883
+ return self.renderCustomError(local.req, res, local.next);
4311
4884
  }
4312
4885
 
4313
4886
  }
@@ -4390,7 +4963,7 @@ function SuperController(options) {
4390
4963
  return next();
4391
4964
  }
4392
4965
 
4393
- if ( /http\/2/.test(protocol) ) {
4966
+ if ( stream && /http\/2/.test(protocol) ) {
4394
4967
  return stream.end();
4395
4968
  }
4396
4969