gina 0.1.6-alpha.144 → 0.1.6-alpha.146

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 (385) hide show
  1. package/framework/v0.1.6-alpha.146/VERSION +1 -0
  2. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/dist/vendor/gina/css/gina.min.css.gz +0 -0
  3. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -1
  4. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/dist/vendor/gina/html/toolbar.html.gz +0 -0
  5. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/dist/vendor/gina/js/gina.js +5687 -5584
  6. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/dist/vendor/gina/js/gina.min.js +616 -613
  7. package/framework/v0.1.6-alpha.146/core/asset/plugin/dist/vendor/gina/js/gina.min.js.br +0 -0
  8. package/framework/v0.1.6-alpha.146/core/asset/plugin/dist/vendor/gina/js/gina.min.js.gz +0 -0
  9. package/framework/v0.1.6-alpha.146/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
  10. package/framework/v0.1.6-alpha.146/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +9 -0
  11. package/framework/v0.1.6-alpha.146/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.br +0 -0
  12. package/framework/v0.1.6-alpha.146/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.gz +0 -0
  13. package/framework/v0.1.6-alpha.146/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
  14. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/config.js +3 -0
  15. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/controller/controller.js +435 -1332
  16. package/framework/v0.1.6-alpha.146/core/controller/controller.renderSwig.js +932 -0
  17. package/framework/v0.1.6-alpha.146/core/controller/controller.renderv1.js +911 -0
  18. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/dist/swig.min.js.map +2 -2
  19. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/gna.js +12 -0
  20. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/validator/src/main.js +4 -5
  21. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/server.isaac.js +140 -14
  22. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/server.js +41 -7
  23. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/conf/env.json +1 -2
  24. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/path.js +1 -1
  25. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/prototypes.js +8 -1
  26. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/tail.js +1 -1
  27. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/helper.js +23 -0
  28. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/domain/src/main.js +3 -6
  29. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/src/containers/file/index.js +2 -0
  30. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/routing/src/main.js +21 -9
  31. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/swig-filters/src/main.js +25 -3
  32. package/package.json +2 -2
  33. package/framework/v0.1.6-alpha.144/VERSION +0 -1
  34. package/framework/v0.1.6-alpha.144/core/asset/plugin/dist/vendor/gina/js/gina.min.js.br +0 -0
  35. package/framework/v0.1.6-alpha.144/core/asset/plugin/dist/vendor/gina/js/gina.min.js.gz +0 -0
  36. package/framework/v0.1.6-alpha.144/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +0 -8
  37. package/framework/v0.1.6-alpha.144/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -8
  38. package/framework/v0.1.6-alpha.144/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.br +0 -0
  39. package/framework/v0.1.6-alpha.144/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.gz +0 -0
  40. package/framework/v0.1.6-alpha.144/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +0 -8
  41. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/AUTHORS +0 -0
  42. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/LICENSE +0 -0
  43. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/html/nolayout.html +0 -0
  44. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/html/static.html +0 -0
  45. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/img/android-chrome-192x192.png +0 -0
  46. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/img/android-chrome-512x512.png +0 -0
  47. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/img/apple-touch-icon.png +0 -0
  48. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/img/favicon-16x16.png +0 -0
  49. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/img/favicon-32x32.png +0 -0
  50. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/img/favicon.ico +0 -0
  51. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/README.md +0 -0
  52. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -0
  53. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/dist/vendor/gina/css/gina.min.css.br +0 -0
  54. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +0 -0
  55. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/dist/vendor/gina/html/toolbar.html.br +0 -0
  56. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/asset/plugin/uuid.json +0 -0
  57. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/connectors/couchbase/index.js +0 -0
  58. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/connectors/couchbase/lib/connector.js +0 -0
  59. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/connectors/couchbase/lib/connector.v2.js +0 -0
  60. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/connectors/couchbase/lib/connector.v3.js +0 -0
  61. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/connectors/couchbase/lib/connector.v4.js +0 -0
  62. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/connectors/couchbase/lib/n1ql.js +0 -0
  63. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/connectors/couchbase/lib/session-store.js +0 -0
  64. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  65. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  66. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/connectors/couchbase/lib/session-store.v4.js +0 -0
  67. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/content.encoding +0 -0
  68. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/controller/controller.framework.js +0 -0
  69. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/controller/index.js +0 -0
  70. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/.github/workflows/ci.yml +0 -0
  71. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/.github/workflows/lint.yml +0 -0
  72. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/LICENSE +0 -0
  73. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/README.md +0 -0
  74. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-big.js +0 -0
  75. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-small.js +0 -0
  76. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-big.js +0 -0
  77. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-small.js +0 -0
  78. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-100pairs-small.js +0 -0
  79. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-900pairs-small-alt.js +0 -0
  80. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/lib/index.js +0 -0
  81. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/lib/types/multipart.js +0 -0
  82. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/lib/types/urlencoded.js +0 -0
  83. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/lib/utils.js +0 -0
  84. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/busboy-1.6.0/package.json +0 -0
  85. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/.travis.yml +0 -0
  86. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/LICENSE +0 -0
  87. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/bool.js +0 -0
  88. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/boolean_double.js +0 -0
  89. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/boolean_single.js +0 -0
  90. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/default_hash.js +0 -0
  91. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/default_singles.js +0 -0
  92. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/divide.js +0 -0
  93. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/line_count.js +0 -0
  94. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/line_count_options.js +0 -0
  95. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/line_count_wrap.js +0 -0
  96. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/nonopt.js +0 -0
  97. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/reflect.js +0 -0
  98. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/short.js +0 -0
  99. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/string.js +0 -0
  100. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/usage-options.js +0 -0
  101. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/example/xup.js +0 -0
  102. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/index.js +0 -0
  103. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/package.json +0 -0
  104. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/package.json.dist +0 -0
  105. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/optimist-0.6.1/readme.markdown +0 -0
  106. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/HISTORY.md +0 -0
  107. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/LICENSE +0 -0
  108. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/README.md +0 -0
  109. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/bin/swig.js +0 -0
  110. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/bin/swig.js.dist +0 -0
  111. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/dist/swig.min.js +0 -0
  112. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/index.js +0 -0
  113. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/dateformatter.js +0 -0
  114. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/filters.js +0 -0
  115. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/lexer.js +0 -0
  116. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/loaders/filesystem.js +0 -0
  117. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/loaders/index.js +0 -0
  118. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/loaders/memory.js +0 -0
  119. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/parser.js +0 -0
  120. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/swig.js +0 -0
  121. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/autoescape.js +0 -0
  122. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/block.js +0 -0
  123. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/else.js +0 -0
  124. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/elseif.js +0 -0
  125. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/extends.js +0 -0
  126. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/filter.js +0 -0
  127. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/for.js +0 -0
  128. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/if.js +0 -0
  129. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/import.js +0 -0
  130. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/include.js +0 -0
  131. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/index.js +0 -0
  132. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/macro.js +0 -0
  133. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/parent.js +0 -0
  134. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/raw.js +0 -0
  135. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/set.js +0 -0
  136. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/tags/spaceless.js +0 -0
  137. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/lib/utils.js +0 -0
  138. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/package.json +0 -0
  139. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-1.4.2/package.json.dist +0 -0
  140. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  141. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/deps/swig-client/swig.js +0 -0
  142. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/dev/index.js +0 -0
  143. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/dev/lib/class.js +0 -0
  144. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/dev/lib/factory.js +0 -0
  145. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/dev/lib/tools.js +0 -0
  146. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/README.md +0 -0
  147. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/currency.json +0 -0
  148. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/dist/language/en.json +0 -0
  149. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/dist/language/fr.json +0 -0
  150. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/dist/region/en.json +0 -0
  151. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/dist/region/fr.json +0 -0
  152. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/index.js +0 -0
  153. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/src/make.js +0 -0
  154. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/src/resources/currency.csv +0 -0
  155. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/src/resources/region.csv +0 -0
  156. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/locales/src/resources/region.mapping.json +0 -0
  157. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/mime.types +0 -0
  158. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/model/entity.js +0 -0
  159. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/model/index.js +0 -0
  160. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/model/template/entityFactory.js +0 -0
  161. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/model/template/index.js +0 -0
  162. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/README.md +0 -0
  163. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/index.js +0 -0
  164. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/file/README.md +0 -0
  165. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/file/build.json +0 -0
  166. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/file/package.json +0 -0
  167. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/intl/README.md +0 -0
  168. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/intl/build.json +0 -0
  169. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/intl/package.json +0 -0
  170. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/intl/src/main.js +0 -0
  171. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/storage/README.md +0 -0
  172. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/storage/build.json +0 -0
  173. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/storage/package.json +0 -0
  174. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/storage/src/main.js +0 -0
  175. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/validator/README.md +0 -0
  176. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/validator/build.json +0 -0
  177. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/validator/package.json +0 -0
  178. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/plugins/lib/validator/src/form-validator.js +0 -0
  179. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/router.js +0 -0
  180. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/server.express.js +0 -0
  181. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/status.codes +0 -0
  182. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/_gitignore +0 -0
  183. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle/config/app.json +0 -0
  184. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle/config/routing.json +0 -0
  185. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle/config/settings.json +0 -0
  186. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
  187. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle/config/templates.json +0 -0
  188. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  189. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  190. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle/controllers/setup.js +0 -0
  191. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle/index.js +0 -0
  192. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  193. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  194. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  195. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  196. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  197. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_public/readme.md +0 -0
  198. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  199. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
  200. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
  201. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
  202. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
  203. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/command/gina.bat.tpl +0 -0
  204. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/command/gina.tpl +0 -0
  205. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/conf/manifest.json +0 -0
  206. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/conf/package.json +0 -0
  207. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/conf/settings.json +0 -0
  208. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/conf/statics.json +0 -0
  209. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/conf/templates.json +0 -0
  210. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/error/client/json/401.json +0 -0
  211. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/error/client/json/403.json +0 -0
  212. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/error/client/json/404.json +0 -0
  213. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/error/server/html/50x.html +0 -0
  214. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/error/server/json/500.json +0 -0
  215. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/error/server/json/503.json +0 -0
  216. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/core/template/extensions/logger/config.json +0 -0
  217. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/console.js +0 -0
  218. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/context.js +0 -0
  219. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/data/LICENSE +0 -0
  220. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/data/README.md +0 -0
  221. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/data/package.json +0 -0
  222. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/data/src/main.js +0 -0
  223. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/dateFormat.js +0 -0
  224. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/index.js +0 -0
  225. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/json/LICENSE +0 -0
  226. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/json/README.md +0 -0
  227. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/json/package.json +0 -0
  228. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/json/src/main.js +0 -0
  229. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/plugins/README.md +0 -0
  230. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/plugins/package.json +0 -0
  231. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/plugins/src/api-error.js +0 -0
  232. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/plugins/src/main.js +0 -0
  233. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/task.js +0 -0
  234. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/helpers/text.js +0 -0
  235. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/archiver/README.md +0 -0
  236. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/archiver/build.json +0 -0
  237. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/archiver/package.json +0 -0
  238. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/archiver/src/dep/jszip.min.js +0 -0
  239. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/archiver/src/main.js +0 -0
  240. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/aliases.json +0 -0
  241. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/add.js +0 -0
  242. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/arguments.json +0 -0
  243. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/copy.js +0 -0
  244. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/cp.js +0 -0
  245. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/help.js +0 -0
  246. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/help.txt +0 -0
  247. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/list.js +0 -0
  248. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/remove.js +0 -0
  249. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/rename.js +0 -0
  250. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/restart.js +0 -0
  251. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/rm.js +0 -0
  252. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/start.js +0 -0
  253. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/status.js +0 -0
  254. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/bundle/stop.js +0 -0
  255. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/add.js +0 -0
  256. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/get.js +0 -0
  257. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/help.js +0 -0
  258. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/help.txt +0 -0
  259. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/link-dev.js +0 -0
  260. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/list.js +0 -0
  261. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/remove.js +0 -0
  262. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/rm.js +0 -0
  263. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/set.js +0 -0
  264. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/unset.js +0 -0
  265. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/env/use.js +0 -0
  266. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/arguments.json +0 -0
  267. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/build.js +0 -0
  268. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/dot.js +0 -0
  269. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/get.js +0 -0
  270. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/help.js +0 -0
  271. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/help.txt +0 -0
  272. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/init.js +0 -0
  273. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/link-node-modules.js +0 -0
  274. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/link.js +0 -0
  275. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/msg.json +0 -0
  276. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/open.js +0 -0
  277. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/restart.js +0 -0
  278. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/set.js +0 -0
  279. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/start.js +0 -0
  280. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/status.js +0 -0
  281. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/stop.js +0 -0
  282. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/update.js +0 -0
  283. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/framework/version.js +0 -0
  284. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/gina-dev.1.md +0 -0
  285. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/gina-framework.1.md +0 -0
  286. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/gina.1.md +0 -0
  287. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/index.js +0 -0
  288. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/minion/help.js +0 -0
  289. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/minion/help.txt +0 -0
  290. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/msg.json +0 -0
  291. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/port/help.js +0 -0
  292. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/port/help.txt +0 -0
  293. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/port/inc/scan.js +0 -0
  294. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/port/list.js +0 -0
  295. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/port/reset.js +0 -0
  296. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/port/set.js +0 -0
  297. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/add.js +0 -0
  298. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/arguments.json +0 -0
  299. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/build.js +0 -0
  300. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/help.js +0 -0
  301. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/help.txt +0 -0
  302. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/import.js +0 -0
  303. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/list.js +0 -0
  304. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/move.js +0 -0
  305. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/remove.js +0 -0
  306. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/rename.js +0 -0
  307. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/restart.js +0 -0
  308. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/rm.js +0 -0
  309. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/start.js +0 -0
  310. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/status.js +0 -0
  311. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/project/stop.js +0 -0
  312. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/protocol/help.js +0 -0
  313. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/protocol/help.txt +0 -0
  314. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/protocol/list.js +0 -0
  315. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/protocol/set.js +0 -0
  316. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/scope/add.js +0 -0
  317. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/scope/help.js +0 -0
  318. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/scope/help.txt +0 -0
  319. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/scope/link-local.js +0 -0
  320. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/scope/link-production.js +0 -0
  321. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/scope/list.js +0 -0
  322. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/scope/remove.js +0 -0
  323. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/scope/rm.js +0 -0
  324. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/scope/use.js +0 -0
  325. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cmd/view/add.js +0 -0
  326. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/collection/README.md +0 -0
  327. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/collection/build.json +0 -0
  328. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/collection/package.json +0 -0
  329. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/collection/src/main.js +0 -0
  330. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/config.js +0 -0
  331. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cron/README.md +0 -0
  332. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cron/package.json +0 -0
  333. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/cron/src/main.js +0 -0
  334. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/domain/LICENSE +0 -0
  335. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/domain/README.md +0 -0
  336. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/domain/dist/2025-03-14_13-41-20_UTC.dat +0 -0
  337. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/domain/dist/public_suffix_list.dat +0 -0
  338. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/domain/dist/public_suffix_list.dat.br +0 -0
  339. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/domain/dist/public_suffix_list.dat.gz +0 -0
  340. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/domain/exemples/backend.js +0 -0
  341. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/domain/exemples/frontend.html +0 -0
  342. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/domain/package.json +0 -0
  343. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/generator/index.js +0 -0
  344. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/index.js +0 -0
  345. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/inherits/LICENSE +0 -0
  346. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/inherits/README.md +0 -0
  347. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  348. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/inherits/example/protected_inheritance.js +0 -0
  349. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/inherits/example/simple_inheritance.js +0 -0
  350. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  351. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/inherits/package.json +0 -0
  352. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/inherits/src/main.js +0 -0
  353. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/README.md +0 -0
  354. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/package.json +0 -0
  355. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/src/containers/default/index.js +0 -0
  356. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  357. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  358. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/src/containers/mq/index.js +0 -0
  359. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/src/containers/mq/listener.js +0 -0
  360. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/src/containers/mq/speaker.js +0 -0
  361. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/src/helper.js +0 -0
  362. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/logger/src/main.js +0 -0
  363. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/math/index.js +0 -0
  364. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/merge/README.md +0 -0
  365. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/merge/example/merge.js +0 -0
  366. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/merge/example/merge_2_literal objects.js +0 -0
  367. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/merge/example/merge_and_preserve_first.js +0 -0
  368. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/merge/package.json +0 -0
  369. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/merge/src/main.js +0 -0
  370. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/model.js +0 -0
  371. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/proc.js +0 -0
  372. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/routing/README.md +0 -0
  373. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/routing/build.json +0 -0
  374. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/routing/package.json +0 -0
  375. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/session-store.js +0 -0
  376. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/shell.js +0 -0
  377. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/swig-filters/README.md +0 -0
  378. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/swig-filters/package.json +0 -0
  379. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/url/README.md +0 -0
  380. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/url/index.js +0 -0
  381. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/url/mocks.json +0 -0
  382. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/url/routing.json +0 -0
  383. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/url/test.js +0 -0
  384. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/lib/validator.js +0 -0
  385. package/framework/{v0.1.6-alpha.144 → v0.1.6-alpha.146}/package.json +1 -1
@@ -14,12 +14,9 @@ const exec = require('child_process').exec;
14
14
  var util = require('util');
15
15
  var promisify = util.promisify;
16
16
  var EventEmitter = require('events').EventEmitter;
17
- var zlib = require('zlib'); // Included with NodeJS
18
17
 
19
18
  const { Resolver } = require('node:dns').promises;
20
19
  const resolver = new Resolver();
21
- // var tls = require('tls');
22
- // var crypto = require('crypto');
23
20
 
24
21
  var lib = require('./../../lib') || require.cache[require.resolve('./../../lib')];
25
22
  var merge = lib.merge;
@@ -30,7 +27,7 @@ var routingLib = lib.routing;
30
27
  var Domain = lib.Domain;
31
28
  var domainLib = new Domain();
32
29
  var swig = require('./../deps/swig-1.4.2');
33
- const { type } = require('node:os');
30
+ const { type } = require('node:os');
34
31
  var SwigFilters = lib.SwigFilters;
35
32
  var statusCodes = requireJSON( _( getPath('gina').core + '/status.codes') );
36
33
 
@@ -78,6 +75,7 @@ function SuperController(options) {
78
75
  if (local.options) {
79
76
  SuperController.instance._options = local.options;
80
77
  }
78
+
81
79
  SuperController.initialized = true;
82
80
  }
83
81
 
@@ -89,6 +87,7 @@ function SuperController(options) {
89
87
  return SuperController.instance;
90
88
  }
91
89
 
90
+
92
91
  var hasViews = function() {
93
92
  return ( typeof(local.options.template) != 'undefined' ) ? true : false;
94
93
  }
@@ -193,12 +192,12 @@ function SuperController(options) {
193
192
  return (/^true$/i.test(process.env.NODE_SCOPE_IS_PRODUCTION)) ? true : false;
194
193
  }
195
194
 
195
+
196
196
  this.setOptions = function(req, res, next, options) {
197
197
  local.options = SuperController.instance._options = options;
198
198
  local.options.renderingStack = (local.options.renderingStack) ? local.options.renderingStack : [];
199
199
  local.options.isRenderingCustomError = (local.options.isRenderingCustomError) ? local.options.isRenderingCustomError : false;
200
200
 
201
-
202
201
  // N.B.: Avoid setting `page` properties as much as possible from the routing.json
203
202
  // It will be easier for the framework if set from the controller.
204
203
  //
@@ -466,10 +465,14 @@ function SuperController(options) {
466
465
  ctx.config.envConf._isRoutingUpdateNeeded = false;
467
466
 
468
467
  }
469
- set('page.environment.routing', encodeRFC5987ValueChars(JSON.stringify(routing))); // export for GFF
470
- //reverseRouting
468
+ // Adding 289 KB of datas in the page when including routing & reverseRouting
469
+ // set('page.environment.routing', encodeRFC5987ValueChars(JSON.stringify(routing))); // export for GFF
470
+ set('page.environment.routing',encodeRFC5987ValueChars('{}'));
471
+
472
+ //// reverseRouting
471
473
  var reverseRouting = local.options.conf.reverseRouting = ctx.config.envConf.reverseRouting; // all routes
472
- set('page.environment.reverseRouting', encodeRFC5987ValueChars(JSON.stringify(reverseRouting))); // export for GFF
474
+ // set('page.environment.reverseRouting', encodeRFC5987ValueChars(JSON.stringify(reverseRouting))); // export for GFF
475
+ set('page.environment.reverseRouting',encodeRFC5987ValueChars('{}'));
473
476
 
474
477
  var forms = local.options.conf.forms = options.conf.content.forms // all forms
475
478
  set('page.environment.forms', encodeRFC5987ValueChars(JSON.stringify(forms))); // export for GFF
@@ -561,7 +564,7 @@ function SuperController(options) {
561
564
  //TODO - detect when to use swig
562
565
  var dir = null;
563
566
  if (local.options.template || self.templates) {
564
- dir = local.options.template.templates || self.templates;
567
+ dir = local.options.template.html || self.templates;
565
568
 
566
569
  var swigOptions = {
567
570
  autoescape : ( typeof(local.options.autoescape) != 'undefined') ? local.options.autoescape : false,
@@ -585,6 +588,7 @@ function SuperController(options) {
585
588
  swig.setDefaultTZOffset(defaultTZOffset);
586
589
  defaultTZOffset = null;
587
590
 
591
+
588
592
  self.engine = swig;
589
593
 
590
594
  dir = null;
@@ -595,1370 +599,211 @@ function SuperController(options) {
595
599
  freeMemory([action, rule, ext, isWithoutLayout, namespace, ctx, version, routing, reverseRouting, forms, parameters, acceptLanguage, userCulture, userCultureCode, userLangCode, userCountryCode, locales, userLocales], false);
596
600
  }
597
601
 
598
- this.renderWithoutLayout = function (data, displayToolbar) {
602
+ var parseDataObject = function(o, obj, override) {
599
603
 
600
- // preventing multiple call of self.renderWithoutLayout() when controller is rendering from another required controller
601
- if (local.options.renderingStack.length > 1) {
602
- return false;
604
+ for (let i in o) {
605
+ if ( o[i] !== null && typeof(o[i]) == 'object' || override && o[i] !== null && typeof(o[i]) == 'object' ) {
606
+ parseDataObject(o[i], obj);
607
+ } else if (o[i] == '_content_'){
608
+ o[i] = obj
609
+ }
603
610
  }
604
611
 
605
- local.options.isWithoutLayout = true;
606
-
607
- self.render(data, displayToolbar);
612
+ return o
608
613
  }
609
614
 
610
615
  /**
611
- * Render HTML templates : Swig is the default template engine
612
- *
613
- * Extend default filters
614
- * - length
615
- *
616
- * Available filters:
617
- * - getWebroot()
618
- * - getUrl()
619
- *
620
- * N.B.: Filters can be extended through your `<project>/src/<bundle>/controllers/setup.js`
616
+ * Set data
621
617
  *
618
+ * @param {string} nave - variable name to set
619
+ * @param {string|object} value - value to set
620
+ * @param {boolean} [override]
622
621
  *
623
- * @param {object} userData
624
- * @param {boolean} [displayToolbar]
625
- * @param {object} [errOptions]
626
622
  * @returns {void}
627
623
  * */
628
- this.render = async function(userData, displayToolbar, errOptions) {
629
- var err = null;
630
- var isRenderingCustomError = (
631
- typeof(userData.isRenderingCustomError) != 'undefined'
632
- && /^true$/i.test(userData.isRenderingCustomError)
633
- ) ? true : false;
634
- if (isRenderingCustomError)
635
- delete userData.isRenderingCustomError;
636
-
637
- var localOptions = (errOptions) ? errOptions : local.options;
638
- localOptions.renderingStack.push( self.name );
639
- // preventing multiple call of self.render() when controller is rendering from another required controller
640
- if ( localOptions.renderingStack.length > 1 && !isRenderingCustomError ) {
641
- return false;
642
- }
624
+ var set = function(name, value, override) {
643
625
 
626
+ var override = ( typeof(override) != 'undefined' ) ? override : false;
644
627
 
645
- var data = null
646
- , layout = null
647
- , template = null
648
- , file = null
649
- , path = null
650
- , plugin = null
651
- // By default
652
- , isWithoutLayout = (localOptions.isWithoutLayout) ? true : false
653
- ;
628
+ if ( typeof(name) == 'string' && /\./.test(name) ) {
629
+ var keys = name.split(/\./g)
630
+ , newObj = {}
631
+ , str = '{'
632
+ , _count = 0;
654
633
 
655
- try {
656
- data = getData();
657
- // Display session
658
- if (
659
- typeof(local.req.session) != 'undefined'
660
- ) {
661
- if ( typeof(data.page.data) == 'undefined' ) {
662
- data.page.data = {};
663
- }
634
+ for (let k = 0, len = keys.length; k<len; ++k) {
635
+ str += "\""+ keys.splice(0,1)[0] + "\":{";
664
636
 
665
- if ( typeof(local.req.session.cookie._expires) != 'undefined' ) {
666
- var dateEnd = local.req.session.cookie._expires;
667
- var dateStart = ( typeof(local.req.session.lastModified) != 'undefined')
668
- ? new Date(local.req.session.lastModified)
669
- : new Date()
670
- ;
671
- var elapsed = dateEnd - dateStart;
672
- // var expiresAt =
673
- if ( typeof(data.page.data.session) == 'undefined' ) {
674
- data.page.data.session = {
675
- id : local.req.session.id,
676
- lastModified: local.req.session.lastModified
677
- };
637
+ ++_count;
638
+ if (k == len-1) {
639
+ str = str.substring(0, str.length-1);
640
+ str += "\"_content_\"";
641
+ for (let c = 0; c<_count; ++c) {
642
+ str += "}"
678
643
  }
679
- // In milliseconds
680
- data.page.data.session.createdAt = local.req.session.createdAt;
681
- data.page.data.session.expiresAt = dateEnd.format('isoDateTime');
682
- data.page.data.session.timeout = elapsed;
683
-
684
- dateEnd = null;
685
- dateStart = null;
686
- elapsed = null;
687
644
  }
688
645
  }
689
646
 
690
- // in case `local.req.routing.param.file` has been changed on the fly
691
- if (
692
- local.req.routing.param.file
693
- && local.req.routing.param.file != data.page.view.file
694
- ) {
695
- data.page.view.file = local.req.routing.param.file;
696
- }
697
- if (
698
- local.req.routing.param.ext
699
- && local.req.routing.param.ext != data.page.view.ext
700
- ) {
701
- data.page.view.ext = local.req.routing.param.ext;
702
- }
703
- file = (isRenderingCustomError) ? localOptions.file : data.page.view.file;
704
- // making path thru [namespace &] file
705
- if ( typeof(localOptions.namespace) != 'undefined' && localOptions.namespace ) {
706
- // excepted for custom paths
707
- var fileNamingConvention = file.replace(localOptions.namespace+'-', '');
708
- if ( !/^(\.|\/|\\)/.test(file) && file != fileNamingConvention ) {
709
- var _ext = data.page.view.ext;
710
-
711
- console.warn('file `'+ file +'` used in routing `'+ localOptions.rule +'` does not respect gina naming convention ! You should rename the file `'+ file + _ext +'` to `'+ ''+ fileNamingConvention + _ext +'`');
712
- console.warn('The reason you are getting this message is because your filename begeins with `<namespace>-`\n If you don\‘t want to rename, use template path like ./../'+ localOptions.namespace +'/'+file);
713
- file = ''+ file.replace(localOptions.namespace+'-', '');
714
- }
715
- fileNamingConvention = null;
716
- _ext = null;
717
-
718
-
719
- // means that rule name === namespace -> pointing to root namespace dir
720
- if (!file || file === localOptions.namespace) {
721
- file = 'index'
722
- }
723
- path = (isRenderingCustomError) ? _(file) : _(localOptions.template.html +'/'+ localOptions.namespace + '/' + file)
724
- } else {
725
- if ( localOptions.path && !/(\?|\#)/.test(localOptions.path) ) {
726
- path = _(localOptions.path);
727
- var re = new RegExp( data.page.view.ext+'$');
728
- if ( data.page.view.ext && re.test(data.page.view.file) ) {
729
- data.page.view.path = path.replace('/'+ data.page.view.file, '');
730
-
731
- path = path.replace(re, '');
732
- data.page.view.file = data.page.view.file.replace(re, '');
733
-
734
- } else {
735
- data.page.view.path = path.replace('/'+ data.page.view.file, '');
736
- }
737
- re = null;
738
- } else {
739
- path = (!isRenderingCustomError && !/^(\.|\/|\\)/.test(file))
740
- ? _(localOptions.template.html +'/'+ file)
741
- : file
742
- }
743
- }
647
+ newObj = parseDataObject(JSON.parse(str), value, override);
648
+ local.userData = merge(local.userData, newObj);
744
649
 
745
- if (data.page.view.ext && !new RegExp(data.page.view.ext+ '$').test(file) ) {
746
- path += data.page.view.ext
747
- }
650
+ freeMemory([name, value, keys, newObj, str, _count], false);
748
651
 
749
- data.page.view.path = path;
750
- } catch (dataErr) {
751
- return self.throwError(dataErr);
652
+ } else if ( typeof(local.userData[name]) == 'undefined' ) {
653
+ local.userData[name] = value.replace(/\\/g, '');
654
+ freeMemory([name, value], false)
752
655
  }
656
+ }
753
657
 
754
- // isWithoutLayout from content
755
- var pageContentObj = new _(data.page.view.path);
756
- var _templateContent = null;
757
- try {
758
- _templateContent = fs.readFileSync(path).toString()
759
- } catch (pathException) {
760
- console.warn("Path exception: ", pathException);
658
+ /**
659
+ * Get data
660
+ *
661
+ * @param {String} variable Data name to set
662
+ * @returns {Object | String} data Data object or String
663
+ * */
664
+ var get = function(variable) {
665
+ return local.userData[variable]
666
+ }
667
+
668
+ /**
669
+ * Set resources
670
+ *
671
+ * @param {object} template - template configuration
672
+ * */
673
+ var setResources = function(viewConf) {
674
+ if (!viewConf) {
675
+ return self.throwError(500, new Error('No views configuration found. Did you try to add views before using Controller::render(...) ? Try to run: gina view:add '+ options.conf.bundle +' @'+ options.conf.projectName));
761
676
  }
762
- var hasLayoutInPath = /\{\%(\s+extends|extends)/.test(_templateContent) || false;
763
- var layoutPath = null;
764
677
 
678
+ var authority = ( typeof(local.req.headers['x-forwarded-proto']) != 'undefined' ) ? local.req.headers['x-forwarded-proto'] : local.options.conf.server.scheme;
679
+ authority += '://'+ local.req.headers.host;
680
+ var useWebroot = false;
765
681
  if (
766
- !isWithoutLayout
767
- && !isRenderingCustomError
768
- && pageContentObj.existsSync()
769
- && !hasLayoutInPath
682
+ !/^\/$/.test(local.options.conf.server.webroot)
683
+ && local.options.conf.server.webroot.length > 0
684
+ // && local.options.conf.hostname.replace(/\:\d+$/, '') == authority
770
685
  ) {
771
- isWithoutLayout = true;
772
- }
773
- pageContentObj = null;
774
-
775
- // Retrieve layoutPath from content
776
- if (hasLayoutInPath && _templateContent) {
777
- var extendFound = _templateContent.match(/\{\%(\s+extends|extends)(.*)\%}/);
778
- if (extendFound && Array.isArray(extendFound)) {
779
- var extendPath = null;
780
- try {
781
- // localOptions.template.templates +'/'+
782
- layoutPath = extendFound[0].match(/(\"|\')(.*)(\"|\')/)[0].replace(/(\"|\')/g, '');
783
- data.page.view.layout = layoutPath;
784
- layoutPath = localOptions.template.templates +'/'+ layoutPath;
785
- localOptions.template.layout = layoutPath;
786
- } catch (extendErr) {
787
- // nothing to do
788
- }
789
- extendPath = null;
790
- }
791
- extendFound = null;
686
+ useWebroot = true
792
687
  }
793
- hasLayoutInPath = null;
794
- _templateContent = null;
688
+ authority = null;
795
689
 
796
- localOptions.debugMode = ( typeof(displayToolbar) == 'undefined' ) ? undefined : ( (/true/i.test(displayToolbar)) ? true : false ); // only active for dev env
690
+ var reURL = new RegExp('^'+ local.options.conf.server.webroot);
797
691
 
798
- // specific override
799
- if (
800
- self.isCacheless()
801
- && typeof(local.req[ local.req.method.toLowerCase() ]) != 'undefined'
802
- && typeof(local.req[ local.req.method.toLowerCase() ].debug) != 'undefined'
803
- ) {
804
- if ( !/^(true|false)$/i.test(local.req[ local.req.method.toLowerCase() ].debug) ) {
805
- console.warn('Detected wrong value for `debug`: '+ local.req[ local.req.method.toLowerCase() ].debug);
806
- console.warn('Switching `debug` to `true` as `cacheless` mode is enabled');
807
- local.req[ local.req.method.toLowerCase() ].debug = true;
808
- }
809
- localOptions.debugMode = ( /^true$/i.test(local.req[ local.req.method.toLowerCase() ].debug) ) ? true : false;
810
- } else if (
811
- self.isCacheless()
812
- && hasViews()
813
- && !isWithoutLayout
814
- && localOptions.debugMode == undefined
815
- ) {
816
- localOptions.debugMode = true;
817
- } else if ( localOptions.debugMode == undefined ) {
818
- localOptions.debugMode = self.isCacheless()
692
+ var cssStr = ''
693
+ , jsStr = ''
694
+ ;
695
+ //Get css
696
+ if( viewConf.stylesheets ) {
697
+ // cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL);
698
+ // Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
699
+ var cssColl = new Collection(viewConf.stylesheets).orderBy({route: 'asc'})
700
+ cssStr = getNodeRes('css', cssColl, useWebroot, reURL);
701
+ cssColl = null;
702
+ }
703
+ //Get js
704
+ if( viewConf.javascripts ) {
705
+ // jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL);
706
+ // Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
707
+ var jsColl = new Collection(viewConf.javascripts).orderBy({route: 'asc'})
708
+ jsStr = getNodeRes('js', jsColl, useWebroot, reURL);
709
+ jsColl = null;
819
710
  }
820
711
 
821
- try {
822
-
823
- if (!userData) {
824
- userData = { page: { view: {}}}
825
- } else if ( userData && !userData['page']) {
712
+ set('page.view.stylesheets', cssStr);
713
+ set('page.view.scripts', jsStr);
826
714
 
827
- if ( typeof(data['page']['data']) == 'undefined' )
828
- data['page']['data'] = userData;
829
- else
830
- data['page']['data'] = (isRenderingCustomError) ? userData : merge( userData, data['page']['data'] );
831
- } else {
832
- data = (isRenderingCustomError) ? userData : merge(userData, data)
833
- }
715
+ reURL = null;
716
+ cssStr = null;
717
+ jsStr = null;
718
+ }
834
719
 
835
- template = localOptions.rule.replace('\@'+ localOptions.bundle, '');
836
- var localTemplateConf = localOptions.template;
837
- if ( isWithoutLayout ) {
838
- localTemplateConf = JSON.clone(localOptions.template);
839
- localTemplateConf.javascripts = new Collection(localTemplateConf.javascripts).find({ isCommon: false}, { isCommon: true, name: 'gina' });
840
- localTemplateConf.stylesheets = new Collection(localTemplateConf.stylesheets).find({ isCommon: false}, { isCommon: true, name: 'gina' });
841
- }
842
- setResources(localTemplateConf);
843
- // localTemplateConf = null;
720
+ /**
721
+ * Get node resources
722
+ *
723
+ * @param {string} type
724
+ * @param {string} resStr
725
+ * @param {array} resArr
726
+ * @param {boolean} useWebroot
727
+ * @param {object} reURL - RegExp for webroot
728
+ *
729
+ * @returns {object} content
730
+ *
731
+ * @private
732
+ * */
733
+ var getNodeRes = function(type, resArr, useWebroot, reURL) {
844
734
 
845
- // Allowing file & ext override
846
- if (
847
- typeof(local.req.routing.param.file) != 'undefined'
848
- && data.page.view.file !== local.req.routing.param.file
849
- ) {
850
- data.page.view.file = localOptions.file = local.req.routing.param.file
851
- }
852
- if (
853
- typeof(local.req.routing.param.ext) != 'undefined'
854
- && data.page.view.ext !== local.req.routing.param.ext
855
- ) {
856
- data.page.view.ext = localOptions.template.ext = local.req.routing.param.ext
857
- }
735
+ var r = 0
736
+ , rLen = resArr.length
737
+ , obj = null
738
+ , str = ''
739
+ , isProxyHost = getContext('isProxyHost')
740
+ , requestHost = ( /http\/2/.test(local.options.conf.server.protocol) )
741
+ ? local.req.headers[':host']
742
+ : local.req.headers.host
743
+ , hostname = ( typeof(requestHost) != 'undefined' && local.options.conf.host != requestHost)
744
+ ? local.options.conf.server.scheme +'://'+ requestHost
745
+ : local.options.conf.hostname
746
+ , scheme = hostname.match(/^(https|http)/)[0]
747
+ ;
748
+ var requestPort = (local.req.headers.port||local.req.headers[':port']);
749
+ var hostPort = local.options.conf.hostname.match(/(\:d+\/|\:\d+)$/);
750
+ hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : local.options.conf.port[local.options.conf.server.protocol][local.options.conf.server.scheme];
751
+ // Linking bundle B from bundle A wihtout proxy
752
+ var isSpecialCase = (
753
+ getContext('bundle') != local.options.conf.bundle
754
+ && requestPort != hostPort
755
+ && local.req.headers[':host'] != process.gina.PROXY_HOST
756
+ ) ? true : false;
858
757
 
859
- // file = (isRenderingCustomError) ? localOptions.file : data.page.view.file;
758
+ if (isSpecialCase) {
759
+ hostname = local.options.conf.hostname
760
+ }
860
761
 
861
- // pre-compiling variables
862
- data = merge(data, getData()); // needed !!
863
762
 
864
- if (typeof(data.page.data) == 'undefined' ) {
865
- data.page.data = {}
866
- }
763
+ if (
764
+ isProxyHost
765
+ && !isSpecialCase
766
+ ) {
867
767
 
768
+ hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']||process.gina.PROXY_HOST);
868
769
 
869
770
  if (
870
- !local.options.isRenderingCustomError
871
- && typeof(data.page.data.status) != 'undefined'
872
- && !/^2/.test(data.page.data.status)
873
- && typeof(data.page.data.error) != 'undefined'
771
+ !/^(80|443)$/.test(requestPort)
772
+ && !new RegExp(requestPort+'$').test(hostname)
874
773
  ) {
875
- // var statusCode = localOptions.conf.server.coreConfiguration.statusCodes;
876
- var errorObject = {
877
- status: data.page.data.status,
878
- //errors: msg.error || msg.errors || msg,
879
- error: statusCodes[data.page.data.status] || msg.error || msg,
880
- message: data.page.data.message || data.page.data.error,
881
- stack: data.page.data.stack
882
- };
883
- if ( typeof(data.page.data.session) != 'undefined' ) {
884
- errorObject.session = data.page.data.session;
885
- }
886
-
887
- return self.throwError(errorObject);
888
- }
889
-
890
- // // making path thru [namespace &] file
891
- // if ( typeof(localOptions.namespace) != 'undefined' && localOptions.namespace ) {
892
- // // excepted for custom paths
893
- // var fileNamingConvention = file.replace(localOptions.namespace+'-', '');
894
- // if ( !/^(\.|\/|\\)/.test(file) && file != fileNamingConvention ) {
895
- // var _ext = data.page.view.ext;
896
-
897
- // console.warn('file `'+ file +'` used in routing `'+ localOptions.rule +'` does not respect gina naming convention ! You should rename the file `'+ file + _ext +'` to `'+ ''+ fileNamingConvention + _ext +'`');
898
- // console.warn('The reason you are getting this message is because your filename begeins with `<namespace>-`\n If you don\‘t want to rename, use template path like ./../'+ localOptions.namespace +'/'+file);
899
- // file = ''+ file.replace(localOptions.namespace+'-', '');
900
- // }
901
-
902
-
903
- // // means that rule name === namespace -> pointing to root namespace dir
904
- // if (!file || file === localOptions.namespace) {
905
- // file = 'index'
906
- // }
907
- // path = (isRenderingCustomError) ? _(file) : _(localOptions.template.html +'/'+ localOptions.namespace + '/' + file)
908
- // } else {
909
- // if ( localOptions.path && !/(\?|\#)/.test(localOptions.path) ) {
910
- // path = _(localOptions.path);
911
- // var re = new RegExp( data.page.view.ext+'$');
912
- // if ( data.page.view.ext && re.test(data.page.view.file) ) {
913
- // data.page.view.path = path.replace('/'+ data.page.view.file, '');
914
-
915
- // path = path.replace(re, '');
916
- // data.page.view.file = data.page.view.file.replace(re, '');
917
-
918
- // } else {
919
- // data.page.view.path = path.replace('/'+ data.page.view.file, '');
920
- // }
921
-
922
- // } else {
923
- // path = (!isRenderingCustomError && !/^(\.|\/|\\)/.test(file))
924
- // ? _(localOptions.template.html +'/'+ file)
925
- // : file
926
- // }
927
- // }
928
-
929
- // if (data.page.view.ext && !new RegExp(data.page.view.ext+ '$').test(file) /** && hasViews() && fs.existsSync(_(path + data.page.view.ext, true))*/ ) {
930
- // path += data.page.view.ext
931
- // }
932
-
933
- // data.page.view.path = path;
934
-
935
- var dic = {}, msg = '';
936
- for (let d in data.page) {
937
- dic['page.'+d] = data.page[d]
774
+ hostname += ':'+ requestPort;
938
775
  }
776
+ }
939
777
 
778
+ switch(type){
779
+ case 'css':
780
+ for (; r < rLen; ++r) {
781
+ obj = resArr[r];
782
+ if (useWebroot && !reURL.test(obj.url) ) {
783
+ obj.url = local.options.conf.server.webroot + obj.url.substring(1);
784
+ }
785
+ // HTTP2 Push via Link
786
+ if (
787
+ /http\/2/.test(local.options.conf.server.protocol)
788
+ && !self.isCacheless()
789
+ ) {
790
+ local.options.template.h2Links += '<'+ obj.url +'>; as=style; rel=preload,'
791
+ }
792
+ // TODO - add support for cdn
793
+ if (!/\:\/\//.test(obj.url) ) {
794
+ obj.url = hostname + obj.url;
795
+ }
940
796
 
797
+ if (obj.media) {
798
+ str += '\n\t\t<link href="'+ obj.url +'" media="'+ obj.media +'" rel="'+ obj.rel +'" type="'+ obj.type +'">';
799
+ } else {
800
+ str += '\n\t\t<link href="'+ obj.url +'" rel="'+ obj.rel +'" type="'+ obj.type +'">';
801
+ }
802
+ }
803
+ break;
941
804
 
942
- // please, do not start with a slashe when including...
943
- // ex.:
944
- // /html/inc/_partial.html (BAD)
945
- // html/inc/_partial.html (GOOD)
946
- // ./html/namespace/page.html (GOOD)
947
-
948
- if ( !fs.existsSync(path) ) {
949
- msg = 'could not open "'+ path +'"' +
950
- '\n1) The requested file does not exists in your templates/html (check your template directory). Can you find: '+path +
951
- '\n2) Check the following rule in your `'+localOptions.conf.bundlePath+'/config/routing.json` and look around `param` to make sure that nothing is wrong with your file declaration: '+
952
- '\n' + options.rule +':'+ JSON.stringify(options.conf.content.routing[options.rule], null, 4) +
953
- '\n3) At this point, if you still have problems trying to run this portion of code, you can contact us telling us how to reproduce the bug.'
954
- //'\n\r[ stack trace ] '
955
- ;
956
- err = new ApiError(msg, 500);
957
- console.error(err.stack);
958
- self.throwError(err);
959
- return;
960
- }
961
-
962
- var localRequestPort = local.req.headers.port || local.req.headers[':port'];
963
- var isProxyHost = (
964
- typeof(local.req.headers.host) != 'undefined'
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'
981
- ) ? true : false;
982
-
983
-
984
- // setup swig default filters
985
- var filters = SwigFilters({
986
- options : JSON.clone(localOptions),
987
- isProxyHost : isProxyHost,
988
- throwError : self.throwError,
989
- req : local.req,
990
- res : local.res
991
- });
992
-
993
- try {
994
-
995
- // Extends default `length` filter
996
- swig.setFilter('length', filters.length);
997
-
998
-
999
-
1000
- // Allows you to get a bundle web root
1001
- swig.setFilter('getWebroot', filters.getWebroot);
1002
-
1003
- swig.setFilter('getUrl', filters.getUrl);
1004
-
1005
- } catch (err) {
1006
- // [ martin ]
1007
- // i sent an email to [ paul@paularmstrongdesigns.com ] on 2014/08 to see if there is:
1008
- // a way of retrieving swig compilation stack traces
1009
- //var stack = __stack.splice(1).toString().split(',').join('\n');
1010
- // -> no response...
1011
- self.throwError(local.res, 500, new Error('template compilation exception encoutered: [ '+path+' ]\n'+(err.stack||err.message)));
1012
- return;
1013
- }
1014
-
1015
-
1016
-
1017
- var assets = null
1018
- , mapping = null
1019
- , XHRData = null
1020
- , XHRView = null
1021
- , isDeferModeEnabled = null
1022
- , hasExternalsPlugins = null
1023
- , viewInfos = null
1024
- , filename = null
1025
- , isWithSwigLayout = null
1026
- , isUsingGinaLayout = (!isWithoutLayout && typeof(localOptions.template.layout) != 'undefined' && fs.existsSync(local.options.template.layout)) ? true : false
1027
- ;
1028
-
1029
- if ( isWithoutLayout || isUsingGinaLayout ) {
1030
- layoutPath = (isWithoutLayout) ? localOptions.template.noLayout : localOptions.template.layout;
1031
- // user layout override
1032
- if ( isUsingGinaLayout && !isWithoutLayout ) {
1033
- layoutPath = localOptions.template.layout;
1034
- }
1035
- if (isWithoutLayout) {
1036
- data.page.view.layout = layoutPath;
1037
- }
1038
- }
1039
- // without layout case
1040
- else {
1041
-
1042
- // by default
1043
- layoutPath = localOptions.template.layout;
1044
- if ( !/^\//.test(layoutPath)) {
1045
- layoutPath = localOptions.template.templates +'/'+ layoutPath;
1046
- }
1047
- // default layout
1048
- if (
1049
- !isWithoutLayout && !fs.existsSync(layoutPath) && layoutPath == localOptions.template.templates +'/index.html'
1050
- ) {
1051
- console.warn('Layout '+ local.options.template.layout +' not found, replacing with `nolayout`: '+ localOptions.template.noLayout);
1052
- layoutPath = localOptions.template.noLayout
1053
- isWithoutLayout = true;
1054
- data.page.view.layout = layoutPath;
1055
- }
1056
- // user defiend layout
1057
- else if ( !isWithoutLayout && !fs.existsSync(layoutPath) ) {
1058
- isWithSwigLayout = true;
1059
- layoutPath = localOptions.template.noLayout;
1060
- data.page.view.layout = layoutPath;
1061
- }
1062
- // layout defiendd but not found
1063
- else if (!fs.existsSync(layoutPath) ) {
1064
- err = new ApiError(options.bundle +' SuperController exception while trying to load your layout `'+ layoutPath +'`.\nIt seems like you have defined a layout, but gina could not locate the file.\nFor more informations, check your `config/templates.json` declaration around `'+ local.options.rule.replace(/\@(.*)/g, '') +'`', 500);
1065
- self.throwError(err);
1066
- return;
1067
- }
1068
- }
1069
-
1070
- var isLoadingPartial = false;
1071
- try {
1072
- assets = {assets:"${assets}"};
1073
-
1074
- /**
1075
- * retrieve template & layout
1076
- * */
1077
- var tpl = null;
1078
- // tpl = fs.readFileSync(path).toString();
1079
- // layout = fs.readFileSync(layoutPath).toString();
1080
-
1081
- await Promise.all([
1082
- readFile(layoutPath),
1083
- readFile(path)
1084
- ])
1085
- .then(([_layout, _tpl]) => {
1086
- layout = _layout.toString();
1087
- tpl = _tpl.toString();
1088
- })
1089
- .catch(error => {
1090
- console.error(error.message);
1091
- return;
1092
- });
1093
-
1094
-
1095
- // mappin conf
1096
- mapping = { filename: path };
1097
- if (isRenderingCustomError) {
1098
- // TODO - Test if there is a block call `gina-error` in the layout & replace block name from tpl
1099
-
1100
- if ( !/\{\%(\s+extends|extends)/.test(tpl) ) {
1101
- tpl = "\n{% extends '"+ layoutPath +"' %}\n" + tpl;
1102
- }
1103
- if (!/\{\% block content/.test(tpl)) {
1104
- // TODO - test if lyout has <body>
1105
- tpl = '{% block content %}<p>If you view this message you didn’t define a content block in your template.</p>{% endblock %}' + tpl;
1106
- }
1107
-
1108
- tpl = tpl.replace(/\{\{ page\.content \}\}/g, '');
1109
- }
1110
-
1111
- if ( isWithoutLayout || isWithSwigLayout) {
1112
- layout = tpl;
1113
- } else if (isUsingGinaLayout) {
1114
- mapping = { filename: path };
1115
- if ( /(\{\{|\{\{\s+)page\.content/.test(layout) ) {
1116
-
1117
- if ( /\{\%(\s+extends|extends)/.test(tpl) ) {
1118
- err = new Error('You cannot use at the same time `page.content` in your layout `'+ layoutPath +'` while calling `extends` from your page or content `'+ path +'`. You have to choose one or the other');
1119
- self.throwError(local.res, 500, err);
1120
- return
1121
- }
1122
- layout = layout.replace('{{ page.content }}', tpl);
1123
- } else {
1124
- layout = layout.replace(/\<\/body\>/i, '\t'+tpl+'\n</body>');
1125
- }
1126
-
1127
- } else {
1128
- tpl = tpl.replace('{{ page.view.layout }}', data.page.view.layout);
1129
- if (/\<\/body\>/i.test(layout)) {
1130
- layout = layout.replace(/\<\/body\>/i, '\t'+tpl+'\n</body>');
1131
- }
1132
- else {
1133
- layout += tpl;
1134
- }
1135
- }
1136
-
1137
- // precompilation needed in case of `extends` or in order to display the toolbar
1138
- if ( hasViews() && self.isCacheless() || /\{\%(\s+extends|extends)/.test(layout) ) {
1139
- layout = swig.compile(layout, mapping)(data);
1140
- }
1141
- //dic['page.content'] = layout;
1142
-
1143
- tpl = null;
1144
-
1145
- } catch(err) {
1146
- err.stack = 'Exception, bad syntax or undefined data found: start investigating in '+ mapping.filename +'\n' + err.stack;
1147
- return self.throwError(local.res, 500, err);
1148
- }
1149
- mapping = null;
1150
- filename = null;
1151
-
1152
- isLoadingPartial = (
1153
- !/\<html/i.test(layout)
1154
- || !/\<head/i.test(layout)
1155
- || !/\<body/i.test(layout)
1156
- ) ? true : false;
1157
-
1158
- // if (isLoadingPartial) {
1159
- // console.warn('----------------> loading partial `'+ path);
1160
- // }
1161
-
1162
- isDeferModeEnabled = localOptions.template.javascriptsDeferEnabled || localOptions.conf.content.templates._common.javascriptsDeferEnabled || false;
1163
- hasExternalsPlugins = (localOptions.template.externalPlugins.length > 0) ? true : false;
1164
-
1165
- // iframe case - without HTML TAG
1166
- if (!self.isXMLRequest() && !/\<html/.test(layout) ) {
1167
- layout = '<html>\n\t<head></head>\n\t<body class="gina-iframe-body">\n\t\t'+ layout +'\n\t</body>\n</html>';
1168
- }
1169
-
1170
- // adding stylesheets
1171
- if (!isWithoutLayout && data.page.view.stylesheets && !/\{\{\s+(page\.view\.stylesheets)\s+\}\}/.test(layout) ) {
1172
- layout = layout.replace(/\<\/head\>/i, '\n\t{{ page.view.stylesheets }}\n</head>')
1173
- }
1174
-
1175
- if (hasViews() && isWithoutLayout) {
1176
- // $.getScript(...)
1177
- //var isProxyHost = ( typeof(local.req.headers.host) != 'undefined' && localOptions.conf.server.scheme +'://'+ local.req.headers.host != localOptions.conf.hostname || typeof(local.req.headers[':authority']) != 'undefined' && localOptions.conf.server.scheme +'://'+ local.req.headers[':authority'] != localOptions.conf.hostname ) ? true : false;
1178
- //var hostname = (isProxyHost) ? localOptions.conf.hostname.replace(/\:\d+$/, '') : localOptions.conf.hostname;
1179
-
1180
-
1181
-
1182
- var scripts = data.page.view.scripts;
1183
- scripts = scripts.replace(/\s+\<script/g, '\n<script');
1184
-
1185
- if (!isProxyHost) {
1186
- var webroot = data.page.environment.webroot;
1187
- scripts = scripts.replace(/src\=\"\/(.*)\"/g, 'src="'+ webroot +'$1"');
1188
- //stylesheets = stylesheets.replace(/href\=\"\/(.*)\"/g, 'href="'+ webroot +'$1"')
1189
- webroot = null;
1190
- }
1191
-
1192
- // iframe case - without HTML TAG
1193
- if (self.isXMLRequest() || !/\<html/.test(layout) ) {
1194
- layout += scripts;
1195
- //layout += stylesheets;
1196
- }
1197
-
1198
- }
1199
-
1200
- // adding plugins
1201
- // means that we don't want GFF context or we already have it loaded
1202
- viewInfos = JSON.clone(data.page.view);
1203
- if ( !isWithoutLayout )
1204
- viewInfos.assets = assets;
1205
-
1206
- if (
1207
- hasViews() && self.isCacheless() && !isWithoutLayout
1208
- && localOptions.debugMode
1209
- ||
1210
- hasViews() && self.isCacheless() && !isWithoutLayout
1211
- && typeof(localOptions.debugMode) == 'undefined'
1212
- ||
1213
- hasViews() && localOptions.debugMode
1214
- ) {
1215
-
1216
- layout = ''
1217
- // + '{%- set ginaDataInspector = JSON.clone(page) -%}'
1218
- + '{%- set ginaDataInspector = JSON.clone(page) -%}'
1219
- // + '{%- set ginaDataInspector = { view: {}, environment: { routing: {}}} -%}'
1220
- + '{%- set ginaDataInspector.view.assets = {} -%}'
1221
- + '{%- set ginaDataInspector.view.scripts = "ignored-by-toolbar" -%}'
1222
- + '{%- set ginaDataInspector.view.stylesheets = "ignored-by-toolbar" -%}'
1223
- + layout
1224
- ;
1225
-
1226
- plugin = '\t'
1227
- + '{# Gina Toolbar #}'
1228
- + '{%- set userDataInspector = JSON.clone(page) -%}'
1229
- // + '{%- set userDataInspector = { view: {}, environment: { routing: {}}} -%}'
1230
- + '{%- set userDataInspector.view.scripts = "ignored-by-toolbar" -%}'
1231
- + '{%- set userDataInspector.view.stylesheets = "ignored-by-toolbar" -%}'
1232
- + '{%- set userDataInspector.view.assets = '+ JSON.stringify(assets) +' -%}'
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
1235
- ;
1236
-
1237
-
1238
- if (isWithoutLayout && localOptions.debugMode || localOptions.debugMode ) {
1239
-
1240
- if (self.isXMLRequest()) {
1241
- XHRData = '\t<input type="hidden" id="gina-without-layout-xhr-data" value="'+ encodeRFC5987ValueChars(JSON.stringify(data.page.data)) +'">\n\r';
1242
- XHRView = '\n<input type="hidden" id="gina-without-layout-xhr-view" value="'+ encodeRFC5987ValueChars(JSON.stringify(viewInfos)) +'">';
1243
- if ( /<\/body>/i.test(layout) ) {
1244
- layout = layout.replace(/<\/body>/i, XHRData + XHRView + '\n\t</body>');
1245
- } else {
1246
- // Popin case
1247
- // Fix added on 2023-01-25
1248
- layout += XHRData + XHRView + '\n\t'
1249
- }
1250
- }
1251
-
1252
-
1253
- }
1254
-
1255
- if (self.isCacheless() || localOptions.debugMode ) {
1256
- layout = layout.replace(/<\/body>/i, plugin + '\n\t</body>');
1257
- }
1258
-
1259
- // adding javascripts
1260
- layout.replace('{{ page.view.scripts }}', '');
1261
- // placed in the HEAD excepted when rendering a partial or when `isDeferModeEnabled` == true
1262
- if (isLoadingPartial) {
1263
- layout += '\t{{ page.view.scripts }}';
1264
- } else {
1265
- // placed in the HEAD
1266
- if ( isDeferModeEnabled ) {
1267
- layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1268
- }
1269
- // placed in the BODY
1270
- else {
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
- }
1277
- }
1278
- }
1279
-
1280
- // ginaLoader cannot be deferred
1281
- if ( !localOptions.template.javascriptsExcluded || localOptions.template.javascriptsExcluded != '**' ) {
1282
- layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.ginaLoader +'\n</head>');
1283
- }
1284
-
1285
- } else if ( hasViews() && self.isCacheless() && self.isXMLRequest() ) {
1286
-
1287
- if (isWithoutLayout) {
1288
- delete data.page.view.scripts;
1289
- delete data.page.view.stylesheets;
1290
- }
1291
- // means that we don't want GFF context or we already have it loaded
1292
- // viewInfos = JSON.clone(data.page.view);
1293
- // if ( !isWithoutLayout )
1294
- // viewInfos.assets = assets;
1295
-
1296
-
1297
- XHRData = '\n<input type="hidden" id="gina-without-layout-xhr-data" value="'+ encodeRFC5987ValueChars(JSON.stringify(data.page.data)) +'">';
1298
- XHRView = '\n<input type="hidden" id="gina-without-layout-xhr-view" value="'+ encodeRFC5987ValueChars(JSON.stringify(viewInfos)) +'">';
1299
- if ( /<\/body>/i.test(layout) ) {
1300
- layout = layout.replace(/<\/body>/i, XHRData + XHRView + '\n\t</body>');
1301
- } else {
1302
- // Popin case
1303
- // Fix added on 2023-01-25
1304
- layout += XHRData + XHRView + '\n\t'
1305
- }
1306
-
1307
- // layout += XHRData + XHRView;
1308
-
1309
- } else { // other envs like prod ...
1310
-
1311
- // adding javascripts
1312
- // cleanup first
1313
- layout.replace('{{ page.view.scripts }}', '');
1314
- // placed in the HEAD excepted when rendering a partial or when `isDeferModeEnabled` == true
1315
- // if (isLoadingPartial) {
1316
- // layout += '\t{{ page.view.scripts }}';
1317
- // } else {
1318
- // if ( isDeferModeEnabled ) {
1319
- // layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1320
- // } else { // placed in the BODY
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
- // }
1327
- // }
1328
- // }
1329
-
1330
- // // ginaLoader cannot be deferred
1331
- // if ( !localOptions.template.javascriptsExcluded || localOptions.template.javascriptsExcluded != '**' ) {
1332
- // layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.ginaLoader +'\n</head>');
1333
- // }
1334
-
1335
- // adding javascripts
1336
- layout.replace('{{ page.view.scripts }}', '');
1337
- if (isLoadingPartial) {
1338
- layout += '\t{{ page.view.scripts }}\n';
1339
- if ( !localOptions.template.javascriptsExcluded || localOptions.template.javascriptsExcluded != '**' ) {
1340
- layout += '\t'+ localOptions.template.ginaLoader +'\n';
1341
- }
1342
- } else {
1343
- // placed in the HEAD
1344
- if ( isDeferModeEnabled && /\<\/head\>/i.test(layout) ) { // placed in the HEAD
1345
- layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1346
- }
1347
- // placed in the BODY
1348
- else {
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
- }
1355
- }
1356
- // ginaLoader cannot be deferred
1357
- if ( !localOptions.template.javascriptsExcluded || localOptions.template.javascriptsExcluded != '**' ) {
1358
- layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.ginaLoader +'\n</head>');
1359
- }
1360
- }
1361
- }
1362
-
1363
-
1364
- layout = whisper(dic, layout, /\{{ ([a-zA-Z.]+) \}}/g );
1365
- dic['page.content'] = layout;
1366
- /**
1367
- // special case for template without layout in debug mode - dev only
1368
- if ( hasViews() && localOptions.debugMode && self.isCacheless() && !/\{\# Gina Toolbar \#\}/.test(layout) ) {
1369
- try {
1370
-
1371
- layout = layout.replace(/<\/body>/i, plugin + '\n\t</body>');
1372
- layout = whisper(dic, layout, /\{{ ([a-zA-Z.]+) \}}/g );
1373
- //swig.invalidateCache();
1374
- layout = swig.compile(layout, mapping)(swigData);
1375
-
1376
-
1377
- } catch (err) {
1378
- filename = localOptions.template.html;
1379
- filename += ( typeof(data.page.view.namespace) != 'undefined' && data.page.view.namespace != '' && new RegExp('^' + data.page.view.namespace +'-').test(data.page.view.file) ) ? '/' + data.page.view.namespace + data.page.view.file.split(data.page.view.namespace +'-').join('/') + ( (data.page.view.ext != '') ? data.page.view.ext: '' ) : '/' + data.page.view.file+ ( (data.page.view.ext != '') ? data.page.view.ext: '' );
1380
- self.throwError(local.res, 500, new Error('Compilation error encountered while trying to process template `'+ filename + '`\n'+(err.stack||err.message)));
1381
- return;
1382
- }
1383
- }
1384
- else if (hasViews() && localOptions.debugMode && self.isCacheless()) {
1385
- try {
1386
- //layout = whisper(dic, layout, /\{{ ([a-zA-Z.]+) \}}/g );
1387
- layout = swig.compile(layout, mapping)(swigData);
1388
- } catch (err) {
1389
- filename = localOptions.template.html;
1390
- filename += ( typeof(data.page.view.namespace) != 'undefined' && data.page.view.namespace != '' && new RegExp('^' + data.page.view.namespace +'-').test(data.page.view.file) ) ? '/' + data.page.view.namespace + data.page.view.file.split(data.page.view.namespace +'-').join('/') + ( (data.page.view.ext != '') ? data.page.view.ext: '' ) : '/' + data.page.view.file+ ( (data.page.view.ext != '') ? data.page.view.ext: '' );
1391
- self.throwError(local.res, 500, new Error('Compilation error encountered while trying to process template `'+ filename + '`\n'+(err.stack||err.message)));
1392
- return;
1393
- }
1394
- }
1395
- */
1396
-
1397
-
1398
- // if ( !local.res.headersSent ) {
1399
- if ( !headersSent() ) {
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.
1407
- if (
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)
1417
- ) {
1418
-
1419
- try {
1420
- local.res.statusMessage = localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status];
1421
- } catch (err){
1422
- local.res.statusCode = 500;
1423
- local.res.statusMessage = err.stack||err.message||localOptions.conf.server.coreConfiguration.statusCodes[local.res.statusCode];
1424
- }
1425
- }
1426
-
1427
- local.res.setHeader('content-type', localOptions.conf.server.coreConfiguration.mime['html'] + '; charset='+ localOptions.conf.encoding );
1428
-
1429
- try {
1430
-
1431
- // escape special chars
1432
- var blacklistRe = new RegExp('[\<\>]', 'g');
1433
- // DO NOT REPLACE IT BY JSON.clone() !!!!
1434
-
1435
- data.page.data = JSON.parse(JSON.stringify(data.page.data).replace(blacklistRe, '\$&'));
1436
- blacklistRe = null;
1437
- } catch (err) {
1438
- filename = localOptions.template.html;
1439
- filename += ( typeof(data.page.view.namespace) != 'undefined' && data.page.view.namespace != '' && new RegExp('^' + data.page.view.namespace +'-').test(data.page.view.file) ) ? '/' + data.page.view.namespace + data.page.view.file.split(data.page.view.namespace +'-').join('/') + ( (data.page.view.ext != '') ? data.page.view.ext: '' ) : '/' + data.page.view.file+ ( (data.page.view.ext != '') ? data.page.view.ext: '' );
1440
- self.throwError(local.res, 500, new Error('Controller::render(...) compilation error encountered while trying to process template `'+ filename + '`\n' + (err.stack||err.message||err) ));
1441
- filename = null;
1442
- blacklistRe = null;
1443
- return;
1444
- }
1445
-
1446
-
1447
-
1448
- // Only available for http/2.0 for now
1449
- if ( !self.isXMLRequest() && /http\/2/.test(localOptions.conf.server.protocol) ) {
1450
- var assets = null;
1451
- try {
1452
- // TODO - button in toolbar to empty url assets cache
1453
- if ( /** self.isCacheless() ||*/ typeof(localOptions.template.assets) == 'undefined' || typeof(localOptions.template.assets[local.req.url]) == 'undefined' ) {
1454
- // assets string -> object
1455
- //assets = self.serverInstance.getAssets(localOptions.conf, layout.toString(), swig, data);
1456
- assets = self.serverInstance.getAssets(localOptions.conf, layout, swig, data);
1457
- localOptions.template.assets = JSON.parse(assets);
1458
- }
1459
-
1460
- // only for toolbar - TODO hasToolbar()
1461
- if (
1462
- self.isCacheless() && hasViews() && !isWithoutLayout
1463
- || hasViews() && localOptions.debugMode
1464
- || self.isCacheless() && hasViews() && self.isXMLRequest()
1465
- ) {
1466
- layout = layout.replace('{"assets":"${assets}"}', assets );
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
-
1502
- assets = null;
1503
-
1504
- } catch (err) {
1505
- assets = null;
1506
- self.throwError(local.res, 500, new Error('Controller::render(...) calling getAssets(...) \n' + (err.stack||err.message||err) ));
1507
- return;
1508
- }
1509
- }
1510
-
1511
- // Last compilation before rendering
1512
- // Now we can use `data` instead of `swigData`
1513
- layout = swig.compile(layout, mapping)(data);
1514
-
1515
- if ( !headersSent() ) {
1516
- if ( local.options.isRenderingCustomError ) {
1517
- local.options.isRenderingCustomError = false;
1518
- }
1519
-
1520
- local.res.end(layout);
1521
- layout = null;
1522
- }
1523
-
1524
- console.info(local.req.method +' ['+local.res.statusCode +'] '+ local.req.url);
1525
-
1526
- if ( typeof(local.next) != 'undefined' ) {
1527
- return local.next();
1528
- }
1529
- return;
1530
- }
1531
-
1532
-
1533
- if ( typeof(local.req.params.errorObject) != 'undefined' ) {
1534
- return self.throwError(local.req.params.errorObject);
1535
- }
1536
- local.res.end('Unexpected controller error while trying to render.');
1537
-
1538
- if (typeof(local.next) != 'undefined') {
1539
- return local.next();
1540
- }
1541
-
1542
- return;
1543
-
1544
- } catch (err) {
1545
- return self.throwError(local.res, 500, err);
1546
- }
1547
- }
1548
-
1549
-
1550
- this.isXMLRequest = function() {
1551
- return local.options.isXMLRequest;
1552
- }
1553
-
1554
- this.isWithCredentials = function() {
1555
- return ( /true/.test(local.options.withCredentials) ) ? true : false;
1556
- }
1557
-
1558
- this.isPopinContext = function() {
1559
- return (
1560
- typeof(local.req.headers['x-gina-popin-id']) != 'undefined'
1561
- || typeof(local.req.headers['x-gina-popin-name']) != 'undefined'
1562
- ) ? true : false;
1563
- }
1564
-
1565
- /**
1566
- * Render JSON
1567
- *
1568
- * @param {object|string} jsonObj
1569
- * @param {object} [req]
1570
- * @param {object} [res]
1571
- *
1572
- * @callback {function} [next]
1573
- *
1574
- * */
1575
- this.renderJSON = function(jsonObj) {
1576
-
1577
- // preventing multiple call of self.renderJSON() when controller is rendering from another required controller
1578
- if (local.options.renderingStack.length > 1) {
1579
- return false
1580
- }
1581
- if ( self.isProcessingError ) {
1582
- return;
1583
- }
1584
-
1585
- var request = local.req;
1586
- var response = local.res;
1587
- var next = local.next || null;
1588
- // var stream = null;
1589
- // if ( /http\/2/.test(local.options.conf.server.protocol) ) {
1590
- // stream = response.stream;
1591
- // }
1592
-
1593
- // Added on 2023-06-12
1594
- if ( headersSent(response) ) {
1595
- freeMemory([jsonObj, request, response, next]);
1596
- return;
1597
- }
1598
-
1599
- if (!jsonObj) {
1600
- jsonObj = {}
1601
- }
1602
-
1603
- try {
1604
- // just in case
1605
- if ( typeof(jsonObj) == 'string') {
1606
- jsonObj = JSON.parse(jsonObj)
1607
- }
1608
- var data = JSON.stringify(jsonObj);
1609
-
1610
- // if( typeof(local.options) != "undefined" && typeof(local.options.charset) != "undefined" ){
1611
- // response.setHeader("charset", local.options.charset);
1612
- // }
1613
-
1614
-
1615
- //catching errors
1616
- if (
1617
- typeof(jsonObj.errno) != 'undefined' && response.statusCode == 200
1618
- ||
1619
- typeof(jsonObj.status) != 'undefined' && jsonObj.status != 200
1620
- && typeof(local.options.conf.server.coreConfiguration.statusCodes[jsonObj.status]) != 'undefined'
1621
- ) {
1622
-
1623
- try {
1624
- response.statusCode = 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
- }
1632
- } catch (err){
1633
- response.statusCode = 500;
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
- }
1641
- }
1642
- }
1643
-
1644
- // Internet Explorer override
1645
- if ( /msie/i.test(request.headers['user-agent']) ) {
1646
- response.setHeader('content-type', 'text/plain' + '; charset='+ local.options.conf.encoding)
1647
- } else {
1648
- response.setHeader('content-type', local.options.conf.server.coreConfiguration.mime['json'] + '; charset='+ local.options.conf.encoding)
1649
- }
1650
-
1651
- console.info(request.method +' ['+ response.statusCode +'] '+ request.url);
1652
-
1653
-
1654
- if ( local.options.isXMLRequest && self.isWithCredentials() ) {
1655
-
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
- }
1661
-
1662
- response.write(data);
1663
-
1664
- // required to close connection
1665
- setTimeout(function () {
1666
- response.end();
1667
- try {
1668
- response.headersSent = true;
1669
- } catch(err) {
1670
- // Ignoring warning
1671
- //console.warn(err);
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);
1692
- }
1693
- }
1694
- if ( next ) {
1695
- return next()
1696
- }
1697
-
1698
- freeMemory([jsonObj, data, request, response, next]);
1699
-
1700
- return;
1701
-
1702
- } catch (err) {
1703
- return self.throwError(response, 500, err);
1704
- }
1705
- }
1706
-
1707
-
1708
- this.renderTEXT = function(content) {
1709
-
1710
- // preventing multiple call of self.renderTEXT() when controller is rendering from another required controller
1711
- if (local.options.renderingStack.length > 1) {
1712
- return false
1713
- }
1714
- if ( self.isProcessingError ) {
1715
- return;
1716
- }
1717
-
1718
- var request = local.req;
1719
- var response = local.res;
1720
- var next = local.next || null;
1721
- // var stream = null;
1722
- // if ( /http\/2/.test(local.options.conf.server.protocol) ) {
1723
- // stream = response.stream;
1724
- // }
1725
-
1726
- // Added on 2023-06-12
1727
- if ( headersSent(response) ) {
1728
- freeMemory([content, request, response, next]);
1729
- return;
1730
- }
1731
-
1732
- if ( typeof(content) != "string" ) {
1733
- content = content.toString();
1734
- }
1735
-
1736
- // if (typeof(options) != "undefined" && typeof(options.charset) !="undefined") {
1737
- // response.setHeader("charset", options.charset);
1738
- // }
1739
- if ( !response.getHeaders()['content-type'] ) {
1740
- response.setHeader('content-type', 'text/plain' + '; charset='+ local.options.conf.encoding);
1741
- }
1742
-
1743
- if ( !headersSent() ) {
1744
- console.info(request.method +' ['+response.statusCode +'] '+ request.url);
1745
- response.end(content);
1746
- try {
1747
- response.headersSent = true
1748
- } catch(err) {
1749
- // Ignoring warning
1750
- //console.warn(err);
1751
- }
1752
-
1753
- freeMemory([content, request, response, next]);
1754
- }
1755
- }
1756
-
1757
- var parseDataObject = function(o, obj, override) {
1758
-
1759
- for (let i in o) {
1760
- if ( o[i] !== null && typeof(o[i]) == 'object' || override && o[i] !== null && typeof(o[i]) == 'object' ) {
1761
- parseDataObject(o[i], obj);
1762
- } else if (o[i] == '_content_'){
1763
- o[i] = obj
1764
- }
1765
- }
1766
-
1767
- return o
1768
- }
1769
-
1770
- /**
1771
- * Set data
1772
- *
1773
- * @param {string} nave - variable name to set
1774
- * @param {string|object} value - value to set
1775
- * @param {boolean} [override]
1776
- *
1777
- * @returns {void}
1778
- * */
1779
- var set = function(name, value, override) {
1780
-
1781
- var override = ( typeof(override) != 'undefined' ) ? override : false;
1782
-
1783
- if ( typeof(name) == 'string' && /\./.test(name) ) {
1784
- var keys = name.split(/\./g)
1785
- , newObj = {}
1786
- , str = '{'
1787
- , _count = 0;
1788
-
1789
- for (let k = 0, len = keys.length; k<len; ++k) {
1790
- str += "\""+ keys.splice(0,1)[0] + "\":{";
1791
-
1792
- ++_count;
1793
- if (k == len-1) {
1794
- str = str.substring(0, str.length-1);
1795
- str += "\"_content_\"";
1796
- for (let c = 0; c<_count; ++c) {
1797
- str += "}"
1798
- }
1799
- }
1800
- }
1801
-
1802
- newObj = parseDataObject(JSON.parse(str), value, override);
1803
- local.userData = merge(local.userData, newObj);
1804
-
1805
- freeMemory([name, value, keys, newObj, str, _count], false);
1806
-
1807
- } else if ( typeof(local.userData[name]) == 'undefined' ) {
1808
- local.userData[name] = value.replace(/\\/g, '');
1809
- freeMemory([name, value], false)
1810
- }
1811
- }
1812
-
1813
- /**
1814
- * Get data
1815
- *
1816
- * @param {String} variable Data name to set
1817
- * @returns {Object | String} data Data object or String
1818
- * */
1819
- var get = function(variable) {
1820
- return local.userData[variable]
1821
- }
1822
-
1823
- /**
1824
- * Set resources
1825
- *
1826
- * @param {object} template - template configuration
1827
- * */
1828
- var setResources = function(viewConf) {
1829
- if (!viewConf) {
1830
- return self.throwError(500, new Error('No views configuration found. Did you try to add views before using Controller::render(...) ? Try to run: gina view:add '+ options.conf.bundle +' @'+ options.conf.projectName));
1831
- }
1832
-
1833
- var authority = ( typeof(local.req.headers['x-forwarded-proto']) != 'undefined' ) ? local.req.headers['x-forwarded-proto'] : local.options.conf.server.scheme;
1834
- authority += '://'+ local.req.headers.host;
1835
- var useWebroot = false;
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
- ) {
1841
- useWebroot = true
1842
- }
1843
- authority = null;
1844
-
1845
- var reURL = new RegExp('^'+ local.options.conf.server.webroot);
1846
-
1847
- var cssStr = ''
1848
- , jsStr = ''
1849
- ;
1850
- //Get css
1851
- if( viewConf.stylesheets ) {
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;
1857
- }
1858
- //Get js
1859
- if( viewConf.javascripts ) {
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;
1865
- }
1866
-
1867
- set('page.view.stylesheets', cssStr);
1868
- set('page.view.scripts', jsStr);
1869
-
1870
- reURL = null;
1871
- cssStr = null;
1872
- jsStr = null;
1873
- }
1874
-
1875
- /**
1876
- * Get node resources
1877
- *
1878
- * @param {string} type
1879
- * @param {string} resStr
1880
- * @param {array} resArr
1881
- * @param {boolean} useWebroot
1882
- * @param {object} reURL - RegExp for webroot
1883
- *
1884
- * @returns {object} content
1885
- *
1886
- * @private
1887
- * */
1888
- var getNodeRes = function(type, resArr, useWebroot, reURL) {
1889
-
1890
- var r = 0
1891
- , rLen = resArr.length
1892
- , obj = null
1893
- , str = ''
1894
- , isProxyHost = getContext('isProxyHost')
1895
- , requestHost = ( /http\/2/.test(local.options.conf.server.protocol) )
1896
- ? local.req.headers[':host']
1897
- : local.req.headers.host
1898
- , hostname = ( typeof(requestHost) != 'undefined' && local.options.conf.host != requestHost)
1899
- ? local.options.conf.server.scheme +'://'+ requestHost
1900
- : local.options.conf.hostname
1901
- , scheme = hostname.match(/^(https|http)/)[0]
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
-
1933
- switch(type){
1934
- case 'css':
1935
- for (; r < rLen; ++r) {
1936
- obj = resArr[r];
1937
- if (useWebroot && !reURL.test(obj.url) ) {
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,'
1946
- }
1947
- // TODO - add support for cdn
1948
- if (!/\:\/\//.test(obj.url) ) {
1949
- obj.url = hostname + obj.url;
1950
- }
1951
-
1952
- if (obj.media) {
1953
- str += '\n\t\t<link href="'+ obj.url +'" media="'+ obj.media +'" rel="'+ obj.rel +'" type="'+ obj.type +'">';
1954
- } else {
1955
- str += '\n\t\t<link href="'+ obj.url +'" rel="'+ obj.rel +'" type="'+ obj.type +'">';
1956
- }
1957
- }
1958
- break;
1959
-
1960
- case 'js':
1961
- var deferMode = (local.options.template.javascriptsDeferEnabled) ? ' defer' : '';
805
+ case 'js':
806
+ var deferMode = (local.options.template.javascriptsDeferEnabled) ? ' defer' : '';
1962
807
 
1963
808
  for (; r < rLen; ++r) {
1964
809
  obj = resArr[r];
@@ -2009,9 +854,6 @@ function SuperController(options) {
2009
854
  //
2010
855
  // }
2011
856
 
2012
- var getData = function() {
2013
- return refToObj( local.userData )
2014
- }
2015
857
 
2016
858
 
2017
859
  var isValidURL = function(url){
@@ -2019,6 +861,268 @@ function SuperController(options) {
2019
861
  return (/(http|ftp|https|sftp):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?/.test(url)) ? true : false;
2020
862
  }
2021
863
 
864
+ this.renderWithoutLayout = function (data, displayToolbar) {
865
+
866
+ // preventing multiple call of self.renderWithoutLayout() when controller is rendering from another required controller
867
+ if (local.options.renderingStack.length > 1) {
868
+ return false;
869
+ }
870
+
871
+ local.options.isWithoutLayout = true;
872
+
873
+ self.render(data, displayToolbar);
874
+ }
875
+
876
+
877
+ var getData = function() {
878
+ return refToObj( local.userData )
879
+ }
880
+
881
+ if (this.isCacheless() ) {
882
+ delete require.cache[require.resolve( _(__dirname + '/controller.renderv1', true))];
883
+ delete require.cache[require.resolve( _(__dirname + '/controller.renderSwig', true))];
884
+ }
885
+
886
+ /**
887
+ * Render HTML templates : Swig is the default template engine
888
+ *
889
+ * Extend default filters
890
+ * - length
891
+ *
892
+ * Available filters:
893
+ * - getWebroot()
894
+ * - getUrl()
895
+ *
896
+ * N.B.: Filters can be extended through your `<project>/src/<bundle>/controllers/setup.js`
897
+ *
898
+ *
899
+ * @param {object} userData
900
+ * @param {boolean} [displayToolbar]
901
+ * @param {object} [errOptions]
902
+ * @returns {void}
903
+ * */
904
+ this.render = require( _(__dirname + '/controller.renderSwig', true) )({
905
+ self : self,
906
+ local : local,
907
+ getData : getData,
908
+ hasViews : hasViews,
909
+ setResources: setResources,
910
+ swig : swig,
911
+ SwigFilters : SwigFilters,
912
+ headersSent : headersSent
913
+ }); //(userData, displayToolbar, errOptions)
914
+
915
+
916
+
917
+ this.isXMLRequest = function() {
918
+ return local.options.isXMLRequest;
919
+ }
920
+
921
+ this.isWithCredentials = function() {
922
+ return ( /true/.test(local.options.withCredentials) ) ? true : false;
923
+ }
924
+
925
+ this.isPopinContext = function() {
926
+ return (
927
+ typeof(local.req.headers['x-gina-popin-id']) != 'undefined'
928
+ || typeof(local.req.headers['x-gina-popin-name']) != 'undefined'
929
+ ) ? true : false;
930
+ }
931
+
932
+ /**
933
+ * Render JSON
934
+ *
935
+ * @param {object|string} jsonObj
936
+ * @param {object} [req]
937
+ * @param {object} [res]
938
+ *
939
+ * @callback {function} [next]
940
+ *
941
+ * */
942
+ this.renderJSON = function(jsonObj) {
943
+
944
+ // preventing multiple call of self.renderJSON() when controller is rendering from another required controller
945
+ if (local.options.renderingStack.length > 1) {
946
+ return false
947
+ }
948
+ if ( self.isProcessingError ) {
949
+ return;
950
+ }
951
+
952
+ var request = local.req;
953
+ var response = local.res;
954
+ var next = local.next || null;
955
+ // var stream = null;
956
+ // if ( /http\/2/.test(local.options.conf.server.protocol) ) {
957
+ // stream = response.stream;
958
+ // }
959
+
960
+ // Added on 2023-06-12
961
+ if ( headersSent(response) ) {
962
+ freeMemory([jsonObj, request, response, next]);
963
+ return;
964
+ }
965
+
966
+ if (!jsonObj) {
967
+ jsonObj = {}
968
+ }
969
+
970
+ try {
971
+ // just in case
972
+ if ( typeof(jsonObj) == 'string') {
973
+ jsonObj = JSON.parse(jsonObj)
974
+ }
975
+ var data = JSON.stringify(jsonObj);
976
+
977
+ // if( typeof(local.options) != "undefined" && typeof(local.options.charset) != "undefined" ){
978
+ // response.setHeader("charset", local.options.charset);
979
+ // }
980
+
981
+
982
+ //catching errors
983
+ if (
984
+ typeof(jsonObj.errno) != 'undefined' && response.statusCode == 200
985
+ ||
986
+ typeof(jsonObj.status) != 'undefined' && jsonObj.status != 200
987
+ && typeof(local.options.conf.server.coreConfiguration.statusCodes[jsonObj.status]) != 'undefined'
988
+ ) {
989
+
990
+ try {
991
+ response.statusCode = jsonObj.status;
992
+ // HTTP/2 (RFC7540 8.1.2.4):
993
+ // This standard for HTTP/2 explicitly states that status messages are not supported.
994
+ // In HTTP/2, the status is conveyed solely by the numerical status code (e.g., 200, 404, 500),
995
+ // and there is no field for a human-readable status message.
996
+ if ( !/http\/2/.test(local.options.conf.server.protocol) ) {
997
+ response.statusMessage = local.options.conf.server.coreConfiguration.statusCodes[jsonObj.status];
998
+ }
999
+ } catch (err){
1000
+ response.statusCode = 500;
1001
+ // HTTP/2 (RFC7540 8.1.2.4):
1002
+ // This standard for HTTP/2 explicitly states that status messages are not supported.
1003
+ // In HTTP/2, the status is conveyed solely by the numerical status code (e.g., 200, 404, 500),
1004
+ // and there is no field for a human-readable status message.
1005
+ if ( !/http\/2/.test(local.options.conf.server.protocol) ) {
1006
+ response.statusMessage = err.stack;
1007
+ }
1008
+ }
1009
+ }
1010
+
1011
+ // Internet Explorer override
1012
+ if ( /msie/i.test(request.headers['user-agent']) ) {
1013
+ response.setHeader('content-type', 'text/plain' + '; charset='+ local.options.conf.encoding)
1014
+ } else {
1015
+ response.setHeader('content-type', local.options.conf.server.coreConfiguration.mime['json'] + '; charset='+ local.options.conf.encoding)
1016
+ }
1017
+
1018
+ console.info(request.method +' ['+ response.statusCode +'] '+ request.url);
1019
+
1020
+
1021
+ if ( local.options.isXMLRequest && self.isWithCredentials() ) {
1022
+
1023
+ // content length must be the right size !
1024
+ var len = Buffer.byteLength(data, 'utf8') || 0;
1025
+ if ( !headersSent(response) ) {
1026
+ response.setHeader("content-length", len);
1027
+ }
1028
+
1029
+ response.write(data);
1030
+
1031
+ // required to close connection
1032
+ setTimeout(function () {
1033
+ response.end();
1034
+ try {
1035
+ response.headersSent = true;
1036
+ } catch(err) {
1037
+ // Ignoring warning
1038
+ //console.warn(err);
1039
+ }
1040
+
1041
+ if ( next ) {
1042
+ next()
1043
+ }
1044
+
1045
+ freeMemory([jsonObj, data, request, response, next]);
1046
+ }, 200);
1047
+
1048
+ // force completion
1049
+ return
1050
+ }
1051
+ // normal case
1052
+ response.end(JSON.stringify(jsonObj));
1053
+ if (!headersSent(response)) {
1054
+ try {
1055
+ response.headersSent = true;
1056
+ } catch(err) {
1057
+ // Ignoring warning
1058
+ //console.warn(err);
1059
+ }
1060
+ }
1061
+ if ( next ) {
1062
+ return next()
1063
+ }
1064
+
1065
+ freeMemory([jsonObj, data, request, response, next]);
1066
+
1067
+ return;
1068
+
1069
+ } catch (err) {
1070
+ return self.throwError(response, 500, err);
1071
+ }
1072
+ }
1073
+
1074
+
1075
+ this.renderTEXT = function(content) {
1076
+
1077
+ // preventing multiple call of self.renderTEXT() when controller is rendering from another required controller
1078
+ if (local.options.renderingStack.length > 1) {
1079
+ return false
1080
+ }
1081
+ if ( self.isProcessingError ) {
1082
+ return;
1083
+ }
1084
+
1085
+ var request = local.req;
1086
+ var response = local.res;
1087
+ var next = local.next || null;
1088
+ // var stream = null;
1089
+ // if ( /http\/2/.test(local.options.conf.server.protocol) ) {
1090
+ // stream = response.stream;
1091
+ // }
1092
+
1093
+ // Added on 2023-06-12
1094
+ if ( headersSent(response) ) {
1095
+ freeMemory([content, request, response, next]);
1096
+ return;
1097
+ }
1098
+
1099
+ if ( typeof(content) != "string" ) {
1100
+ content = content.toString();
1101
+ }
1102
+
1103
+ // if (typeof(options) != "undefined" && typeof(options.charset) !="undefined") {
1104
+ // response.setHeader("charset", options.charset);
1105
+ // }
1106
+ if ( !response.getHeaders()['content-type'] ) {
1107
+ response.setHeader('content-type', 'text/plain' + '; charset='+ local.options.conf.encoding);
1108
+ }
1109
+
1110
+ if ( !headersSent() ) {
1111
+ console.info(request.method +' ['+response.statusCode +'] '+ request.url);
1112
+ response.end(content);
1113
+ try {
1114
+ response.headersSent = true
1115
+ } catch(err) {
1116
+ // Ignoring warning
1117
+ //console.warn(err);
1118
+ }
1119
+
1120
+ freeMemory([content, request, response, next]);
1121
+ }
1122
+ }
1123
+
1124
+
1125
+
2022
1126
  /**
2023
1127
  * Set method - Override current method
2024
1128
  * E.g.: in case of redirect, to force PUT to GET
@@ -4573,7 +3677,6 @@ function SuperController(options) {
4573
3677
  //rootPath : self.executionPath,
4574
3678
  // We don't want to keep original conf untouched
4575
3679
  //conf : JSON.clone(conf),
4576
- //instance: self.serverInstance,
4577
3680
  //template: (routeHasViews) ? bundleConf.content.templates[templateName] : undefined,
4578
3681
  //isUsingTemplate: local.isUsingTemplate,
4579
3682
  //isCacheless: isCacheless,