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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/LICENSE +1 -1
  2. package/README-4Contributors.md +14 -8
  3. package/README.md +13 -4
  4. package/bin/cli +16 -2
  5. package/bin/gina +29 -1
  6. package/framework/{v0.1.6-alpha.15/lib/inherits → v0.1.6-alpha.150}/LICENSE +1 -1
  7. package/framework/v0.1.6-alpha.150/VERSION +1 -0
  8. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/plugin/README.md +1 -0
  9. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/css/gina.min.css.br +0 -0
  10. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/css/gina.min.css.gz +0 -0
  11. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
  12. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +1 -1
  13. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/html/toolbar.html.br +0 -0
  14. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/html/toolbar.html.gz +0 -0
  15. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/plugin/dist/vendor/gina/js/gina.js +6403 -5609
  16. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.min.js +789 -0
  17. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.min.js.br +0 -0
  18. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.min.js.gz +0 -0
  19. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
  20. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +9 -0
  21. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.br +0 -0
  22. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.gz +0 -0
  23. package/framework/v0.1.6-alpha.150/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
  24. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/config.js +167 -76
  25. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/index.js +108 -26
  26. package/framework/{v0.1.6-alpha.15/core/connectors/couchbase/lib/connector.v4.js → v0.1.6-alpha.150/core/connectors/couchbase/lib/connector.v3.js} +170 -69
  27. package/framework/v0.1.6-alpha.150/core/connectors/couchbase/lib/connector.v4.js +470 -0
  28. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/session-store.v4.js +5 -2
  29. package/framework/v0.1.6-alpha.150/core/content.encoding +9 -0
  30. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/controller/controller.js +861 -1185
  31. package/framework/v0.1.6-alpha.150/core/controller/controller.renderSwig.js +1022 -0
  32. package/framework/v0.1.6-alpha.150/core/controller/controller.renderv1.js +911 -0
  33. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/controller/index.js +2 -2
  34. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/.github/workflows/ci.yml +24 -0
  35. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/.github/workflows/lint.yml +23 -0
  36. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/README.md +191 -0
  37. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-big.js +149 -0
  38. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-small.js +143 -0
  39. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-big.js +154 -0
  40. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-small.js +148 -0
  41. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-100pairs-small.js +101 -0
  42. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-900pairs-small-alt.js +84 -0
  43. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/lib/index.js +57 -0
  44. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/lib/types/multipart.js +680 -0
  45. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/lib/types/urlencoded.js +350 -0
  46. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/lib/utils.js +596 -0
  47. package/framework/v0.1.6-alpha.150/core/deps/busboy-1.6.0/package.json +22 -0
  48. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/.travis.yml +4 -0
  49. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/LICENSE +21 -0
  50. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/bool.js +10 -0
  51. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/boolean_double.js +7 -0
  52. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/boolean_single.js +7 -0
  53. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/default_hash.js +8 -0
  54. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/default_singles.js +7 -0
  55. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/divide.js +8 -0
  56. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/line_count.js +20 -0
  57. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/line_count_options.js +29 -0
  58. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/line_count_wrap.js +29 -0
  59. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/nonopt.js +4 -0
  60. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/reflect.js +2 -0
  61. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/short.js +3 -0
  62. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/string.js +11 -0
  63. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/usage-options.js +19 -0
  64. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/example/xup.js +10 -0
  65. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/index.js +343 -0
  66. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/package.json +31 -0
  67. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/package.json.dist +39 -0
  68. package/framework/v0.1.6-alpha.150/core/deps/optimist-0.6.1/readme.markdown +513 -0
  69. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/HISTORY.md +498 -0
  70. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/LICENSE +7 -0
  71. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/README.md +88 -0
  72. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/bin/swig.js +161 -0
  73. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/bin/swig.js.dist +161 -0
  74. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/dist/swig.min.js +7 -0
  75. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/dist/swig.min.js.map +8 -0
  76. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/index.js +1 -0
  77. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/dateformatter.js +198 -0
  78. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/filters.js +630 -0
  79. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/lexer.js +306 -0
  80. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/loaders/filesystem.js +59 -0
  81. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/loaders/index.js +53 -0
  82. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/loaders/memory.js +63 -0
  83. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/parser.js +744 -0
  84. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/swig.js +740 -0
  85. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/autoescape.js +37 -0
  86. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/block.js +25 -0
  87. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/else.js +25 -0
  88. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/elseif.js +28 -0
  89. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/extends.js +19 -0
  90. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/filter.js +68 -0
  91. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/for.js +130 -0
  92. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/if.js +86 -0
  93. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/import.js +91 -0
  94. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/include.js +100 -0
  95. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/index.js +16 -0
  96. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/macro.js +79 -0
  97. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/parent.js +51 -0
  98. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/raw.js +23 -0
  99. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/set.js +109 -0
  100. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/tags/spaceless.js +42 -0
  101. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/lib/utils.js +184 -0
  102. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/package.json +57 -0
  103. package/framework/v0.1.6-alpha.150/core/deps/swig-1.4.2/package.json.dist +61 -0
  104. package/framework/v0.1.6-alpha.150/core/deps/swig-client/swig.js +5031 -0
  105. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/dev/index.js +1 -1
  106. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/dev/lib/factory.js +1 -1
  107. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/gna.js +123 -23
  108. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/index.js +3 -3
  109. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/src/make.js +1 -1
  110. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/mime.types +1 -0
  111. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/model/entity.js +5 -5
  112. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/model/index.js +30 -26
  113. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/model/template/entityFactory.js +1 -1
  114. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/model/template/index.js +1 -1
  115. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/index.js +3 -3
  116. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/file/package.json +2 -2
  117. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/intl/package.json +2 -2
  118. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/storage/package.json +2 -2
  119. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/validator/package.json +2 -2
  120. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/validator/src/form-validator.js +39 -27
  121. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/validator/src/main.js +496 -119
  122. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/router.js +92 -47
  123. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/server.isaac.js +329 -43
  124. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/server.js +433 -159
  125. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/status.codes +1 -11
  126. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/controllers/setup.js +2 -2
  127. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/command/gina.tpl +1 -1
  128. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/env.json +20 -2
  129. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/settings.json +4 -1
  130. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/templates.json +4 -2
  131. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/console.js +1 -1
  132. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/context.js +30 -13
  133. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/data/package.json +2 -2
  134. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/data/src/main.js +1 -1
  135. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/dateFormat.js +1 -1
  136. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/index.js +1 -1
  137. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/json/package.json +2 -2
  138. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/json/src/main.js +7 -4
  139. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/path.js +32 -16
  140. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/plugins/package.json +2 -2
  141. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/plugins/src/api-error.js +2 -2
  142. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/plugins/src/main.js +1 -1
  143. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/prototypes.js +8 -1
  144. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/task.js +2 -2
  145. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/text.js +1 -1
  146. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/archiver/package.json +2 -2
  147. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/archiver/src/main.js +11 -11
  148. package/framework/v0.1.6-alpha.150/lib/cache/package.json +20 -0
  149. package/framework/v0.1.6-alpha.150/lib/cache/src/main.js +160 -0
  150. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/add.js +2 -1
  151. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/restart.js +2 -2
  152. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/start.js +26 -11
  153. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/get.js +1 -1
  154. package/framework/v0.1.6-alpha.150/lib/cmd/env/help.js +30 -0
  155. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/set.js +21 -0
  156. package/framework/v0.1.6-alpha.150/lib/cmd/framework/arguments.json +7 -0
  157. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/build.js +1 -1
  158. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/dot.js +21 -0
  159. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/init.js +19 -1
  160. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/link-node-modules.js +2 -3
  161. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/link.js +3 -2
  162. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/restart.js +3 -3
  163. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/start.js +1 -1
  164. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/tail.js +29 -12
  165. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/version.js +15 -1
  166. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/helper.js +44 -15
  167. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/index.js +1 -1
  168. package/framework/v0.1.6-alpha.150/lib/cmd/minion/help.txt +18 -0
  169. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/reset.js +1 -1
  170. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/add.js +7 -2
  171. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/arguments.json +1 -0
  172. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/build.js +32 -7
  173. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/help.txt +4 -0
  174. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/list.js +1 -1
  175. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/protocol/list.js +71 -50
  176. package/framework/v0.1.6-alpha.150/lib/collection/README.md +5 -0
  177. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/collection/package.json +2 -2
  178. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/collection/src/main.js +21 -14
  179. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/config.js +1 -1
  180. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cron/package.json +2 -2
  181. package/framework/v0.1.6-alpha.150/lib/domain/dist/2025-03-14_13-41-20_UTC.dat +15754 -0
  182. package/framework/v0.1.6-alpha.150/lib/domain/dist/public_suffix_list.dat +15754 -0
  183. package/framework/v0.1.6-alpha.150/lib/domain/dist/public_suffix_list.dat.br +0 -0
  184. package/framework/v0.1.6-alpha.150/lib/domain/dist/public_suffix_list.dat.gz +0 -0
  185. package/framework/v0.1.6-alpha.150/lib/domain/exemples/backend.js +12 -0
  186. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/domain/package.json +2 -2
  187. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/domain/src/main.js +75 -13
  188. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/generator/index.js +1 -1
  189. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/index.js +3 -2
  190. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150/lib/inherits}/LICENSE +1 -1
  191. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/package.json +2 -2
  192. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/src/main.js +1 -1
  193. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/package.json +2 -2
  194. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/file/index.js +2 -0
  195. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/mq/listener.js +10 -2
  196. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/helper.js +1 -1
  197. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/main.js +1 -1
  198. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/math/index.js +1 -1
  199. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/package.json +2 -2
  200. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/model.js +3 -3
  201. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/proc.js +10 -2
  202. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/routing/package.json +2 -2
  203. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/routing/src/main.js +201 -35
  204. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/session-store.js +3 -3
  205. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/shell.js +7 -6
  206. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/swig-filters/package.json +2 -2
  207. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/swig-filters/src/main.js +100 -17
  208. package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/validator.js +2 -2
  209. package/framework/v0.1.6-alpha.150/package.json +11 -0
  210. package/package.json +3 -3
  211. package/resources/package.json.template +1 -1
  212. package/script/post_install.js +4 -4
  213. package/script/pre_install.js +3 -3
  214. package/utils/helper.js +38 -14
  215. package/framework/v0.1.6-alpha.15/VERSION +0 -1
  216. package/framework/v0.1.6-alpha.15/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +0 -1
  217. package/framework/v0.1.6-alpha.15/core/asset/plugin/dist/vendor/gina/js/gina.min.js +0 -766
  218. package/framework/v0.1.6-alpha.15/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +0 -8
  219. package/framework/v0.1.6-alpha.15/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -7
  220. package/framework/v0.1.6-alpha.15/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +0 -8
  221. package/framework/v0.1.6-alpha.15/core/connectors/couchbase/lib/connector.v3.js +0 -432
  222. package/framework/v0.1.6-alpha.15/core/deps/busboy/.travis.yml +0 -17
  223. package/framework/v0.1.6-alpha.15/core/deps/busboy/README.md +0 -225
  224. package/framework/v0.1.6-alpha.15/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -73
  225. package/framework/v0.1.6-alpha.15/core/deps/busboy/deps/encoding/encoding.js +0 -2391
  226. package/framework/v0.1.6-alpha.15/core/deps/busboy/lib/main.js +0 -89
  227. package/framework/v0.1.6-alpha.15/core/deps/busboy/lib/types/multipart.js +0 -328
  228. package/framework/v0.1.6-alpha.15/core/deps/busboy/lib/types/urlencoded.js +0 -214
  229. package/framework/v0.1.6-alpha.15/core/deps/busboy/lib/utils.js +0 -191
  230. package/framework/v0.1.6-alpha.15/core/deps/busboy/package.json +0 -69
  231. package/framework/v0.1.6-alpha.15/lib/domain/dist/public_suffix_list.dat +0 -14186
  232. package/framework/v0.1.6-alpha.15/package.json +0 -14
  233. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/AUTHORS +0 -0
  234. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/html/nolayout.html +0 -0
  235. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/html/static.html +0 -0
  236. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/android-chrome-192x192.png +0 -0
  237. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/android-chrome-512x512.png +0 -0
  238. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/apple-touch-icon.png +0 -0
  239. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/favicon-16x16.png +0 -0
  240. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/favicon-32x32.png +0 -0
  241. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/img/favicon.ico +0 -0
  242. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -0
  243. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/asset/plugin/uuid.json +0 -0
  244. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/connector.js +0 -0
  245. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/connector.v2.js +0 -0
  246. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/n1ql.js +0 -0
  247. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/session-store.js +0 -0
  248. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  249. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  250. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/controller/controller.framework.js +0 -0
  251. /package/framework/{v0.1.6-alpha.15/core/deps/busboy → v0.1.6-alpha.150/core/deps/busboy-1.6.0}/LICENSE +0 -0
  252. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  253. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/dev/lib/class.js +0 -0
  254. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/dev/lib/tools.js +0 -0
  255. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/README.md +0 -0
  256. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/currency.json +0 -0
  257. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/dist/language/en.json +0 -0
  258. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/dist/language/fr.json +0 -0
  259. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/dist/region/en.json +0 -0
  260. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/dist/region/fr.json +0 -0
  261. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/src/resources/currency.csv +0 -0
  262. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/src/resources/region.csv +0 -0
  263. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/locales/src/resources/region.mapping.json +0 -0
  264. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/README.md +0 -0
  265. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/file/README.md +0 -0
  266. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/file/build.json +0 -0
  267. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/intl/README.md +0 -0
  268. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/intl/build.json +0 -0
  269. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/intl/src/main.js +0 -0
  270. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/storage/README.md +0 -0
  271. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/storage/build.json +0 -0
  272. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/storage/src/main.js +0 -0
  273. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/validator/README.md +0 -0
  274. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/plugins/lib/validator/build.json +0 -0
  275. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/server.express.js +0 -0
  276. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/_gitignore +0 -0
  277. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/config/app.json +0 -0
  278. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/config/routing.json +0 -0
  279. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/config/settings.json +0 -0
  280. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
  281. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/config/templates.json +0 -0
  282. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  283. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  284. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle/index.js +0 -0
  285. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  286. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  287. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  288. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  289. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  290. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_public/readme.md +0 -0
  291. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  292. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
  293. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
  294. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
  295. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
  296. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/command/gina.bat.tpl +0 -0
  297. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/manifest.json +0 -0
  298. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/package.json +0 -0
  299. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/conf/statics.json +0 -0
  300. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/client/json/401.json +0 -0
  301. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/client/json/403.json +0 -0
  302. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/client/json/404.json +0 -0
  303. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/server/html/50x.html +0 -0
  304. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/server/json/500.json +0 -0
  305. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/error/server/json/503.json +0 -0
  306. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/core/template/extensions/logger/config.json +0 -0
  307. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/data/LICENSE +0 -0
  308. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/data/README.md +0 -0
  309. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/json/LICENSE +0 -0
  310. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/json/README.md +0 -0
  311. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/helpers/plugins/README.md +0 -0
  312. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/archiver/README.md +0 -0
  313. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/archiver/build.json +0 -0
  314. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/archiver/src/dep/jszip.min.js +0 -0
  315. /package/framework/{v0.1.6-alpha.15/lib/collection → v0.1.6-alpha.150/lib/cache}/README.md +0 -0
  316. /package/framework/{v0.1.6-alpha.15/lib/collection → v0.1.6-alpha.150/lib/cache}/build.json +0 -0
  317. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/aliases.json +0 -0
  318. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/arguments.json +0 -0
  319. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/copy.js +0 -0
  320. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/cp.js +0 -0
  321. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/help.js +0 -0
  322. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/help.txt +0 -0
  323. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/list.js +0 -0
  324. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/remove.js +0 -0
  325. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/rename.js +0 -0
  326. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/rm.js +0 -0
  327. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/status.js +0 -0
  328. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/bundle/stop.js +0 -0
  329. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/add.js +0 -0
  330. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/help.txt +0 -0
  331. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/link-dev.js +0 -0
  332. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/list.js +0 -0
  333. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/remove.js +0 -0
  334. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/rm.js +0 -0
  335. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/unset.js +0 -0
  336. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/env/use.js +0 -0
  337. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/get.js +0 -0
  338. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/help.js +0 -0
  339. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/help.txt +0 -0
  340. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/msg.json +0 -0
  341. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/open.js +0 -0
  342. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/set.js +0 -0
  343. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/status.js +0 -0
  344. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/stop.js +0 -0
  345. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/framework/update.js +0 -0
  346. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/gina-dev.1.md +0 -0
  347. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/gina-framework.1.md +0 -0
  348. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/gina.1.md +0 -0
  349. /package/framework/{v0.1.6-alpha.15/lib/cmd/env → v0.1.6-alpha.150/lib/cmd/minion}/help.js +0 -0
  350. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/msg.json +0 -0
  351. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/help.js +0 -0
  352. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/help.txt +0 -0
  353. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/inc/scan.js +0 -0
  354. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/list.js +0 -0
  355. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/port/set.js +0 -0
  356. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/help.js +0 -0
  357. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/import.js +0 -0
  358. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/move.js +0 -0
  359. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/remove.js +0 -0
  360. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/rename.js +0 -0
  361. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/restart.js +0 -0
  362. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/rm.js +0 -0
  363. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/start.js +0 -0
  364. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/status.js +0 -0
  365. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/project/stop.js +0 -0
  366. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/protocol/help.js +0 -0
  367. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/protocol/help.txt +0 -0
  368. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/protocol/set.js +0 -0
  369. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/add.js +0 -0
  370. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/help.js +0 -0
  371. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/help.txt +0 -0
  372. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/link-local.js +0 -0
  373. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/link-production.js +0 -0
  374. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/list.js +0 -0
  375. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/remove.js +0 -0
  376. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/rm.js +0 -0
  377. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/scope/use.js +0 -0
  378. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cmd/view/add.js +0 -0
  379. /package/framework/{v0.1.6-alpha.15/lib/routing → v0.1.6-alpha.150/lib/collection}/build.json +0 -0
  380. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cron/README.md +0 -0
  381. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/cron/src/main.js +0 -0
  382. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/domain/LICENSE +0 -0
  383. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/domain/README.md +0 -0
  384. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/domain/exemples/frontend.html +0 -0
  385. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/README.md +0 -0
  386. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  387. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/example/protected_inheritance.js +0 -0
  388. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/example/simple_inheritance.js +0 -0
  389. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  390. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/README.md +0 -0
  391. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/default/index.js +0 -0
  392. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  393. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  394. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/mq/index.js +0 -0
  395. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/logger/src/containers/mq/speaker.js +0 -0
  396. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/README.md +0 -0
  397. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/example/merge.js +0 -0
  398. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/example/merge_2_literal objects.js +0 -0
  399. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/example/merge_and_preserve_first.js +0 -0
  400. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/merge/src/main.js +0 -0
  401. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/routing/README.md +0 -0
  402. /package/framework/{v0.1.6-alpha.15/lib/domain/exemples/backend.js → v0.1.6-alpha.150/lib/routing/build.json} +0 -0
  403. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/swig-filters/README.md +0 -0
  404. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/url/README.md +0 -0
  405. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/url/index.js +0 -0
  406. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/url/mocks.json +0 -0
  407. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/url/routing.json +0 -0
  408. /package/framework/{v0.1.6-alpha.15 → v0.1.6-alpha.150}/lib/url/test.js +0 -0
@@ -0,0 +1,1022 @@
1
+ const fs = require('fs');
2
+
3
+ const lib = require('./../../lib') || require.cache[require.resolve('./../../lib')];
4
+ const Collection = lib.Collection;
5
+ const cache = new lib.Cache();
6
+
7
+ // Inherited from controller
8
+ var self = null
9
+ , local = null
10
+ , getData = null
11
+ , hasViews = null
12
+ , setResources = null
13
+ // Default filters
14
+ , SwigFilters = null
15
+ , headersSent = null
16
+ , cachedTemplates = null
17
+ , cachedIndexes = null
18
+ , cachedHtml = null
19
+ , cachePath = null
20
+ ;
21
+ /**
22
+ * Render HTML templates : Swig is the default template engine
23
+ *
24
+ * Extend default filters
25
+ * - length
26
+ *
27
+ * Available filters:
28
+ * - getWebroot()
29
+ * - getUrl()
30
+ *
31
+ * N.B.: Filters can be extended through your `<project>/src/<bundle>/templates/swig/filters.js`
32
+ *
33
+ *
34
+ * @param {object} userData
35
+ * @param {boolean} [displayToolbar]
36
+ * @param {object} [errOptions]
37
+ *
38
+ * @returns {void}
39
+ * */
40
+ async function render(userData, displayToolbar, errOptions) {
41
+
42
+ // Using server cache to cache compiledTemplates
43
+ cache.from(self.serverInstance._cached);
44
+
45
+ cachePath = self.serverInstance._cachePath;
46
+ // cachedTemplates = self.serverInstance._cached.templates;
47
+ // cachedIndexes = self.serverInstance._cached.indexes || null;
48
+ // cachedHtml = self.serverInstance._cached.html || null;
49
+
50
+ var err = null;
51
+ var isRenderingCustomError = (
52
+ typeof(userData.isRenderingCustomError) != 'undefined'
53
+ && /^true$/i.test(userData.isRenderingCustomError)
54
+ ) ? true : false;
55
+ if (isRenderingCustomError)
56
+ delete userData.isRenderingCustomError;
57
+
58
+ var localOptions = (errOptions) ? errOptions : local.options;
59
+ localOptions.renderingStack.push( self.name );
60
+ // preventing multiple call of self.render() when controller is rendering from another required controller
61
+ if ( localOptions.renderingStack.length > 1 && !isRenderingCustomError ) {
62
+ return false;
63
+ }
64
+
65
+
66
+ var data = null
67
+ , layout = null
68
+ , newLayoutFilename = null
69
+ , fd = null
70
+ , buffer = null
71
+ , compiledTemplate = null
72
+ , template = null
73
+ , file = null
74
+ , path = null
75
+ , htmlContent = null
76
+ , cacheKey = null
77
+ , plugin = null
78
+ // By default
79
+ , isWithoutLayout = (localOptions.isWithoutLayout) ? true : false
80
+ ;
81
+
82
+ try {
83
+ data = getData();
84
+ // Display session
85
+ if (
86
+ typeof(local.req.session) != 'undefined'
87
+ ) {
88
+ if ( typeof(data.page.data) == 'undefined' ) {
89
+ data.page.data = {};
90
+ }
91
+
92
+ if ( typeof(local.req.session.cookie._expires) != 'undefined' ) {
93
+ var dateEnd = local.req.session.cookie._expires;
94
+ var dateStart = ( typeof(local.req.session.lastModified) != 'undefined')
95
+ ? new Date(local.req.session.lastModified)
96
+ : new Date()
97
+ ;
98
+ var elapsed = dateEnd - dateStart;
99
+ // var expiresAt =
100
+ if ( typeof(data.page.data.session) == 'undefined' ) {
101
+ data.page.data.session = {
102
+ id : local.req.session.id,
103
+ lastModified: local.req.session.lastModified
104
+ };
105
+ }
106
+ // In milliseconds
107
+ data.page.data.session.createdAt = local.req.session.createdAt;
108
+ data.page.data.session.expiresAt = dateEnd.format('isoDateTime');
109
+ data.page.data.session.timeout = elapsed;
110
+
111
+ dateEnd = null;
112
+ dateStart = null;
113
+ elapsed = null;
114
+ }
115
+ }
116
+
117
+ // in case `local.req.routing.param.file` has been changed on the fly
118
+ if (
119
+ local.req.routing.param.file
120
+ && local.req.routing.param.file != data.page.view.file
121
+ ) {
122
+ data.page.view.file = local.req.routing.param.file;
123
+ }
124
+ if (
125
+ local.req.routing.param.ext
126
+ && local.req.routing.param.ext != data.page.view.ext
127
+ ) {
128
+ data.page.view.ext = local.req.routing.param.ext;
129
+ }
130
+ file = (isRenderingCustomError) ? localOptions.file : data.page.view.file;
131
+ // making path thru [namespace &] file
132
+ if ( typeof(localOptions.namespace) != 'undefined' && localOptions.namespace ) {
133
+ // excepted for custom paths
134
+ var fileNamingConvention = file.replace(localOptions.namespace+'-', '');
135
+ if ( !/^(\.|\/|\\)/.test(file) && file != fileNamingConvention ) {
136
+ var _ext = data.page.view.ext;
137
+
138
+ 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 +'`');
139
+ 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);
140
+ file = ''+ file.replace(localOptions.namespace+'-', '');
141
+ }
142
+ fileNamingConvention = null;
143
+ _ext = null;
144
+
145
+
146
+ // means that rule name === namespace -> pointing to root namespace dir
147
+ if (!file || file === localOptions.namespace) {
148
+ file = 'index'
149
+ }
150
+ path = (isRenderingCustomError) ? _(file) : _(localOptions.template.html +'/'+ localOptions.namespace + '/' + file)
151
+ } else {
152
+ if ( localOptions.path && !/(\?|\#)/.test(localOptions.path) ) {
153
+ path = _(localOptions.path);
154
+ var re = new RegExp( data.page.view.ext+'$');
155
+ if ( data.page.view.ext && re.test(data.page.view.file) ) {
156
+ data.page.view.path = path.replace('/'+ data.page.view.file, '');
157
+
158
+ path = path.replace(re, '');
159
+ data.page.view.file = data.page.view.file.replace(re, '');
160
+
161
+ } else {
162
+ data.page.view.path = path.replace('/'+ data.page.view.file, '');
163
+ }
164
+ re = null;
165
+ } else {
166
+ path = (!isRenderingCustomError && !/^(\.|\/|\\)/.test(file))
167
+ ? _(localOptions.template.html +'/'+ file)
168
+ : file
169
+ }
170
+ }
171
+
172
+ if (data.page.view.ext && !new RegExp(data.page.view.ext+ '$').test(file) ) {
173
+ path += data.page.view.ext
174
+ }
175
+
176
+ data.page.view.path = path;
177
+ } catch (dataErr) {
178
+ return self.throwError(dataErr);
179
+ }
180
+
181
+ // isWithoutLayout from content
182
+ var pageContentObj = new _(data.page.view.path);
183
+ var _templateContent = null;
184
+ try {
185
+ _templateContent = fs.readFileSync(path).toString()
186
+ } catch (pathException) {
187
+ console.warn("Path exception: ", pathException);
188
+ }
189
+ var hasLayoutInPath = /\{\%(\s+extends|extends)/.test(_templateContent) || false;
190
+ var layoutPath = null;
191
+ var subFolder = path.split(/\//g).slice(0, -1).join('/').replace(localOptions.template.html, '') || '';
192
+ var hasSubFolder = (subFolder && subFolder != '') ? true : false;
193
+
194
+ if (
195
+ !isWithoutLayout
196
+ && !isRenderingCustomError
197
+ && pageContentObj.existsSync()
198
+ && !hasLayoutInPath
199
+ ) {
200
+ isWithoutLayout = true;
201
+ }
202
+ pageContentObj = null;
203
+
204
+ cacheKey = 'swig:' + localOptions.bundle + subFolder +'/'+ data.page.view.file;
205
+ // Retrieve layoutPath from content
206
+ if (
207
+ hasLayoutInPath
208
+ && _templateContent
209
+ && !cache.has(cacheKey)
210
+ ) {
211
+
212
+ // subFolder = path.split(/\//g).slice(0, -1).join('/').replace(localOptions.template.html, '');
213
+ // hasSubFolder = (subFolder) ? true : false;
214
+ var extendFound = _templateContent.match(/\{\%(\s+extends|extends)(.*)\%}/);
215
+ if (extendFound && Array.isArray(extendFound)) {
216
+ try {
217
+ // localOptions.template.templates +'/'+
218
+ layoutPath = extendFound[0].match(/(\"|\')(.*)(\"|\')/)[0].replace(/(\"|\')/g, '');
219
+
220
+ // adding layout
221
+ var newLayoutPath = 'swig' + subFolder +'/'+ layoutPath;
222
+ newLayoutFilename = _(cachePath +'/'+ localOptions.bundle +'/'+ newLayoutPath, true);
223
+
224
+ if ( !fs.existsSync( newLayoutFilename ) ) {
225
+ var newLayoutDir = newLayoutFilename.split(/\//g).slice(0, -1).join('/');
226
+ var newLayoutDirObj = new _(newLayoutDir);
227
+ if ( !newLayoutDirObj.existsSync() ) {
228
+ newLayoutDirObj.mkdirSync()
229
+ }
230
+ newLayoutDirObj = null;
231
+ fd = fs.openSync(newLayoutFilename, 'w'); // Open file for writing
232
+ buffer = Buffer.from( fs.readFileSync(localOptions.template.html + '/'+ layoutPath) );
233
+ fs.writeSync(fd, buffer, 0, buffer.length, 0); // Write the buffer
234
+ buffer = null;
235
+ fs.closeSync(fd); // Close the file descriptor
236
+ fd = null;
237
+ }
238
+
239
+ // updating extends
240
+ _templateContent = _templateContent.replace(layoutPath, _(cachePath +'/'+ localOptions.bundle +'/'+ newLayoutPath, true) );
241
+
242
+ // override layout path
243
+ layoutPath = newLayoutPath;
244
+
245
+ data.page.view.layout = layoutPath;
246
+ layoutPath = cachePath +'/'+ localOptions.bundle +'/'+ layoutPath;
247
+
248
+ localOptions.template.layout = layoutPath;
249
+
250
+ } catch (extendErr) {
251
+ // nothing to do
252
+ }
253
+ }
254
+ extendFound = null;
255
+ }
256
+
257
+ localOptions.debugMode = ( typeof(displayToolbar) == 'undefined' ) ? undefined : ( (/true/i.test(displayToolbar)) ? true : false ); // only active for dev env
258
+
259
+ // specific override
260
+ if (
261
+ self.isCacheless()
262
+ && typeof(local.req[ local.req.method.toLowerCase() ]) != 'undefined'
263
+ && typeof(local.req[ local.req.method.toLowerCase() ].debug) != 'undefined'
264
+ ) {
265
+ if ( !/^(true|false)$/i.test(local.req[ local.req.method.toLowerCase() ].debug) ) {
266
+ console.warn('Detected wrong value for `debug`: '+ local.req[ local.req.method.toLowerCase() ].debug);
267
+ console.warn('Switching `debug` to `true` as `cacheless` mode is enabled');
268
+ local.req[ local.req.method.toLowerCase() ].debug = true;
269
+ }
270
+ localOptions.debugMode = ( /^true$/i.test(local.req[ local.req.method.toLowerCase() ].debug) ) ? true : false;
271
+ } else if (
272
+ self.isCacheless()
273
+ && hasViews()
274
+ && !isWithoutLayout
275
+ && localOptions.debugMode == undefined
276
+ ) {
277
+ localOptions.debugMode = true;
278
+ } else if ( localOptions.debugMode == undefined ) {
279
+ localOptions.debugMode = self.isCacheless()
280
+ }
281
+
282
+ try {
283
+
284
+ if (!userData) {
285
+ userData = { page: { view: {}}}
286
+ } else if ( userData && !userData['page']) {
287
+
288
+ if ( typeof(data['page']['data']) == 'undefined' )
289
+ data['page']['data'] = userData;
290
+ else
291
+ data['page']['data'] = (isRenderingCustomError) ? userData : merge( userData, data['page']['data'] );
292
+ } else {
293
+ data = (isRenderingCustomError) ? userData : merge(userData, data)
294
+ }
295
+
296
+ template = localOptions.rule.replace('\@'+ localOptions.bundle, '');
297
+ var localTemplateConf = localOptions.template;
298
+ if ( isWithoutLayout ) {
299
+ localTemplateConf = JSON.clone(localOptions.template);
300
+ localTemplateConf.javascripts = new Collection(localTemplateConf.javascripts).find({ isCommon: false}, { isCommon: true, name: 'gina' });
301
+ localTemplateConf.stylesheets = new Collection(localTemplateConf.stylesheets).find({ isCommon: false}, { isCommon: true, name: 'gina' });
302
+ }
303
+ setResources(localTemplateConf);
304
+
305
+ // Allowing file & ext override
306
+ if (
307
+ typeof(local.req.routing.param.file) != 'undefined'
308
+ && data.page.view.file !== local.req.routing.param.file
309
+ ) {
310
+ data.page.view.file = localOptions.file = local.req.routing.param.file
311
+ }
312
+ if (
313
+ typeof(local.req.routing.param.ext) != 'undefined'
314
+ && data.page.view.ext !== local.req.routing.param.ext
315
+ ) {
316
+ data.page.view.ext = localOptions.template.ext = local.req.routing.param.ext
317
+ }
318
+
319
+
320
+ // pre-compiling variables
321
+ data = merge(data, getData()); // needed !!
322
+
323
+ if (typeof(data.page.data) == 'undefined' ) {
324
+ data.page.data = {}
325
+ }
326
+
327
+
328
+ if (
329
+ !localOptions.isRenderingCustomError
330
+ && typeof(data.page.data.status) != 'undefined'
331
+ && !/^2/.test(data.page.data.status)
332
+ && typeof(data.page.data.error) != 'undefined'
333
+ ) {
334
+
335
+ var errorObject = {
336
+ status : data.page.data.status,
337
+ error : statusCodes[data.page.data.status] || msg.error || msg,
338
+ message : data.page.data.message || data.page.data.error,
339
+ stack : data.page.data.stack
340
+ };
341
+ if ( typeof(data.page.data.session) != 'undefined' ) {
342
+ errorObject.session = data.page.data.session;
343
+ }
344
+
345
+ return self.throwError(errorObject);
346
+ }
347
+
348
+
349
+ // data.page.view.path = path;
350
+
351
+ var dic = {}, msg = '';
352
+ for (let d in data.page) {
353
+ dic['page.'+d] = data.page[d]
354
+ }
355
+
356
+
357
+
358
+ // please, do not start with a slashe when including...
359
+ // ex.:
360
+ // /inc/_partial.html (BAD)
361
+ // inc/_partial.html (GOOD)
362
+ // ./namespace/page.html (GOOD)
363
+
364
+ if ( !fs.existsSync(path) ) {
365
+ msg = 'could not open "'+ path +'"' +
366
+ '\n1) The requested file does not exists in your templates/html (check your template directory). Can you find: '+path +
367
+ '\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: '+
368
+ '\n' + localOptions.rule +':'+ JSON.stringify(localOptions.conf.content.routing[localOptions.rule], null, 4) +
369
+ '\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.'
370
+ //'\n\r[ stack trace ] '
371
+ ;
372
+ err = new ApiError(msg, 500);
373
+ console.error(err.stack);
374
+ self.throwError(err);
375
+ return;
376
+ }
377
+
378
+ var localRequestPort = local.req.headers.port || local.req.headers[':port'];
379
+ var isProxyHost = (
380
+ typeof(local.req.headers.host) != 'undefined'
381
+ && typeof(localRequestPort) != 'undefined'
382
+ && /^(80|443)$/.test(localRequestPort)
383
+ && localOptions.conf.server.scheme +'://'+ local.req.headers.host+':'+ localRequestPort != localOptions.conf.hostname.replace(/\:\d+$/, '') +':'+ localOptions.conf.server.port
384
+ ||
385
+ typeof(local.req.headers[':authority']) != 'undefined'
386
+ && localOptions.conf.server.scheme +'://'+ local.req.headers[':authority'] != localOptions.conf.hostname
387
+ ||
388
+ typeof(local.req.headers.host) != 'undefined'
389
+ && typeof(localRequestPort) != 'undefined'
390
+ && /^(80|443)$/.test(localRequestPort)
391
+ && local.req.headers.host == localOptions.conf.host
392
+ ||
393
+ typeof(local.req.headers['x-nginx-proxy']) != 'undefined'
394
+ && /^true$/i.test(local.req.headers['x-nginx-proxy'])
395
+ ||
396
+ typeof(process.gina.PROXY_HOSTNAME) != 'undefined'
397
+ ) ? true : false;
398
+
399
+
400
+ // Setup swig default filters
401
+ var filters = SwigFilters({
402
+ options : JSON.clone(localOptions),
403
+ isProxyHost : isProxyHost,
404
+ throwError : self.throwError,
405
+ req : local.req,
406
+ res : local.res
407
+ });
408
+ try {
409
+
410
+ // To extends default filters with user defined filters, go to controllers/setup.js
411
+
412
+ // Allows you to get a bundle web root
413
+ // e.g.: swig.setFilter('getWebroot', filters.getWebroot);
414
+ // e.g.: swig.setFilter('nl2br', filters.nl2br);
415
+ for (let filter in filters) {
416
+ if ( typeof(filters[filter]) == 'function' && !/^getConfig$/.test(filter) ) {
417
+ swig.setFilter(filter, filters[filter]);
418
+ }
419
+ }
420
+ } catch (err) {
421
+ self.throwError(local.res, 500, new Error('[SwigFilters] template filters setup exception encoutered: [ '+path+' ]\n'+(err.stack||err.message)));
422
+ return;
423
+ }
424
+
425
+
426
+ var assets = null
427
+ , mapping = null
428
+ , XHRData = null
429
+ , XHRView = null
430
+ , isDeferModeEnabled = null
431
+ , hasExternalsPlugins = null
432
+ , viewInfos = null
433
+ , filename = null
434
+ , isWithSwigLayout = null
435
+ , isUsingGinaLayout = (!isWithoutLayout && typeof(localOptions.template.layout) != 'undefined' && fs.existsSync(localOptions.template.layout)) ? true : false
436
+ ;
437
+
438
+ if ( isWithoutLayout || isUsingGinaLayout ) {
439
+ layoutPath = (isWithoutLayout) ? localOptions.template.noLayout : localOptions.template.layout;
440
+ // user layout override
441
+ if ( isUsingGinaLayout && !isWithoutLayout ) {
442
+ layoutPath = localOptions.template.layout;
443
+ }
444
+ if (isWithoutLayout) {
445
+ data.page.view.layout = layoutPath;
446
+ }
447
+ }
448
+ // without layout case
449
+ else if (!hasLayoutInPath) {
450
+
451
+ // by default
452
+ layoutPath = localOptions.template.layout;
453
+ if ( !/^\//.test(layoutPath)) {
454
+ layoutPath = localOptions.template.templates +'/'+ layoutPath;
455
+ }
456
+ // default layout
457
+ if (
458
+ !isWithoutLayout && !fs.existsSync(layoutPath) && layoutPath == localOptions.template.templates +'/index.html'
459
+ ) {
460
+ console.warn('Layout '+ localOptions.template.layout +' not found, replacing with `nolayout`: '+ localOptions.template.noLayout);
461
+ layoutPath = localOptions.template.noLayout
462
+ isWithoutLayout = true;
463
+ data.page.view.layout = layoutPath;
464
+ }
465
+ // user defined layout
466
+ else if ( !isWithoutLayout && !fs.existsSync(layoutPath) ) {
467
+ isWithSwigLayout = true;
468
+ layoutPath = localOptions.template.noLayout;
469
+ data.page.view.layout = layoutPath;
470
+ }
471
+ // layout defiendd but not found
472
+ else if (!fs.existsSync(layoutPath) ) {
473
+ err = new ApiError(localOptions.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 `'+ localOptions.rule.replace(/\@(.*)/g, '') +'`', 500);
474
+ self.throwError(err);
475
+ return;
476
+ }
477
+ }
478
+
479
+
480
+ // errors first
481
+ if (!headersSent) {
482
+
483
+ //catching errors
484
+ local.res.statusCode = ( typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined' ) ? data.page.data.status : 200; // by default
485
+
486
+ // HTTP/2 (RFC7540 8.1.2.4):
487
+ // This standard for HTTP/2 explicitly states that status messages are not supported.
488
+ // In HTTP/2, the status is conveyed solely by the numerical status code (e.g., 200, 404, 500),
489
+ // and there is no field for a human-readable status message.
490
+ if (
491
+ typeof(data.page.data.errno) != 'undefined'
492
+ && /^2/.test(data.page.data.status)
493
+ && typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined'
494
+ && !/http\/2/.test(localOptions.conf.server.protocol)
495
+ ||
496
+ typeof(data.page.data.status) != 'undefined'
497
+ && !/^2/.test(data.page.data.status)
498
+ && typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined'
499
+ && !/http\/2/.test(localOptions.conf.server.protocol)
500
+ ) {
501
+
502
+ try {
503
+ local.res.statusMessage = localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status];
504
+ } catch (err){
505
+ local.res.statusCode = 500;
506
+ local.res.statusMessage = err.stack||err.message||localOptions.conf.server.coreConfiguration.statusCodes[local.res.statusCode];
507
+ }
508
+ }
509
+
510
+ local.res.setHeader('content-type', localOptions.conf.server.coreConfiguration.mime['html'] + '; charset='+ localOptions.conf.encoding );
511
+
512
+ try {
513
+
514
+ // escape special chars
515
+ var blacklistRe = new RegExp('[\<\>]', 'g');
516
+ // DO NOT REPLACE IT BY JSON.clone() !!!!
517
+
518
+ data.page.data = JSON.parse(JSON.stringify(data.page.data).replace(blacklistRe, '\$&'));
519
+ blacklistRe = null;
520
+ } catch (err) {
521
+ filename = localOptions.template.html;
522
+ 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: '' );
523
+ self.throwError(local.res, 500, new Error('Controller::render(...) compilation error encountered while trying to process template `'+ filename + '`\n' + (err.stack||err.message||err) ));
524
+ filename = null;
525
+ blacklistRe = null;
526
+ return;
527
+ }
528
+ }
529
+
530
+
531
+ var isLoadingPartial = false;
532
+ assets = {assets:"${assets}"};
533
+ layout = fs.readFileSync(layoutPath, 'utf8');
534
+ // Loading from cache
535
+ if (
536
+ /**!self.isCacheless()
537
+ &&*/
538
+ cache.has(cacheKey)
539
+ ) {
540
+ // compiledTemplate = cachedTemplates[ localOptions.bundle + subFolder +'/'+ data.page.view.file ];
541
+ compiledTemplate = cache.get(cacheKey).template;
542
+
543
+ if ( !headersSent() ) {
544
+ if ( localOptions.isRenderingCustomError ) {
545
+ localOptions.isRenderingCustomError = false;
546
+ }
547
+ console.info(local.req.method +' ['+local.res.statusCode +'] '+ local.req.url);
548
+ local.res.end( compiledTemplate(data) );
549
+ layout = null;
550
+ }
551
+
552
+ if ( typeof(local.next) != 'undefined' ) {
553
+ return local.next();
554
+ }
555
+ return;
556
+ } // EO if ( cachedTemplates[ ... ] )
557
+
558
+
559
+
560
+ isLoadingPartial = (
561
+ !/\<html/i.test(layout)
562
+ || !/\<head/i.test(layout)
563
+ || !/\<body/i.test(layout)
564
+ ) ? true : false;
565
+
566
+ // if (isLoadingPartial) {
567
+ // console.warn('----------------> loading partial `'+ path);
568
+ // }
569
+
570
+ isDeferModeEnabled = localOptions.template.javascriptsDeferEnabled || localOptions.conf.content.templates._common.javascriptsDeferEnabled || false;
571
+ hasExternalsPlugins = (localOptions.template.externalPlugins.length > 0) ? true : false;
572
+
573
+ // iframe case - without HTML TAG
574
+ if (!self.isXMLRequest() && !/\<html/.test(layout) ) {
575
+ layout = '<html>\n\t<head></head>\n\t<body class="gina-iframe-body">\n\t\t'+ layout +'\n\t</body>\n</html>';
576
+ }
577
+
578
+ // adding stylesheets
579
+ if (!isWithoutLayout && data.page.view.stylesheets && !/\{\{\s+(page\.view\.stylesheets)\s+\}\}/.test(layout) ) {
580
+ layout = layout.replace(/\<\/head\>/i, '\n\t{{ page.view.stylesheets }}\n</head>')
581
+ }
582
+
583
+ if (hasViews() && isWithoutLayout) {
584
+ // $.getScript(...)
585
+ //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;
586
+ //var hostname = (isProxyHost) ? localOptions.conf.hostname.replace(/\:\d+$/, '') : localOptions.conf.hostname;
587
+
588
+
589
+
590
+ var scripts = data.page.view.scripts;
591
+ scripts = scripts.replace(/\s+\<script/g, '\n<script');
592
+
593
+ if (!isProxyHost) {
594
+ var webroot = data.page.environment.webroot;
595
+ scripts = scripts.replace(/src\=\"\/(.*)\"/g, 'src="'+ webroot +'$1"');
596
+ //stylesheets = stylesheets.replace(/href\=\"\/(.*)\"/g, 'href="'+ webroot +'$1"')
597
+ webroot = null;
598
+ }
599
+
600
+ // iframe case - without HTML TAG
601
+ if (self.isXMLRequest() || !/\<html/.test(layout) ) {
602
+ layout += scripts;
603
+ //layout += stylesheets;
604
+ }
605
+
606
+ }
607
+
608
+ // Adding plugins
609
+ // Means that we don't want GFF context or we already have it loaded
610
+ viewInfos = JSON.clone(data.page.view);
611
+ if ( !isWithoutLayout )
612
+ viewInfos.assets = assets;
613
+
614
+ if (
615
+ hasViews() && self.isCacheless() && !isWithoutLayout
616
+ && localOptions.debugMode
617
+ ||
618
+ hasViews() && self.isCacheless() && !isWithoutLayout
619
+ && typeof(localOptions.debugMode) == 'undefined'
620
+ ||
621
+ hasViews() && localOptions.debugMode
622
+ ) {
623
+ if ( !/\{\%\- set ginaDataInspector/.test(layout) ) {
624
+ layout = ''
625
+ // + '{%- set ginaDataInspector = JSON.clone(page) -%}'
626
+ + '{%- set ginaDataInspector = JSON.clone(page) -%}'
627
+ // + '{%- set ginaDataInspector = { view: {}, environment: { routing: {}}} -%}'
628
+ + '{%- set ginaDataInspector.view.assets = {} -%}'
629
+ + '{%- set ginaDataInspector.view.scripts = "ignored-by-toolbar" -%}'
630
+ + '{%- set ginaDataInspector.view.stylesheets = "ignored-by-toolbar" -%}'
631
+ + layout
632
+ ;
633
+ }
634
+
635
+
636
+ plugin = '\t'
637
+ + '{# Gina Toolbar #}'
638
+ + '{%- set userDataInspector = JSON.clone(page) -%}'
639
+ + '{%- set userDataInspector.view.scripts = "ignored-by-toolbar" -%}'
640
+ + '{%- set userDataInspector.view.stylesheets = "ignored-by-toolbar" -%}'
641
+ + '{%- set userDataInspector.view.assets = '+ JSON.stringify(assets) +' -%}'
642
+ + '{# END Gina Toolbar #}'
643
+ + '{%- include "'+ getPath('gina').core +'/asset/plugin/dist/vendor/gina/html/toolbar.html" with { gina: ginaDataInspector, user: userDataInspector } -%}'// jshint ignore:line
644
+ ;
645
+
646
+
647
+ if (isWithoutLayout && localOptions.debugMode || localOptions.debugMode ) {
648
+ if (self.isXMLRequest()) {
649
+ XHRData = '\t<input type="hidden" id="gina-without-layout-xhr-data" value="'+ encodeRFC5987ValueChars(JSON.stringify(data.page.data)) +'">\n\r';
650
+ XHRView = '\n<input type="hidden" id="gina-without-layout-xhr-view" value="'+ encodeRFC5987ValueChars(JSON.stringify(viewInfos)) +'">';
651
+ if ( /<\/body>/i.test(layout) ) {
652
+ layout = layout.replace(/<\/body>/i, XHRData + XHRView + '\n\t</body>');
653
+ } else {
654
+ // Popin case
655
+ // Fix added on 2023-01-25
656
+ layout += XHRData + XHRView + '\n\t'
657
+ }
658
+ }
659
+ }
660
+
661
+
662
+ if (
663
+ self.isCacheless()
664
+ && !/\{\# Gina Toolbar \#\}/.test(layout)
665
+ ||
666
+ localOptions.debugMode
667
+ && !/\{\# Gina Toolbar \#\}/.test(layout)
668
+ ) {
669
+ layout = layout.replace(/<\/body>/i, plugin + '\n\t</body>');
670
+ }
671
+
672
+ // adding javascripts
673
+ layout.replace('{{ page.view.scripts }}', '');
674
+ // placed in the HEAD excepted when rendering a partial or when `isDeferModeEnabled` == true
675
+ if (isLoadingPartial) {
676
+ if ( !/\{\{ page\.view\.scripts \}\}/.test(layout) ) {
677
+ layout += '\t{{ page.view.scripts }}';
678
+ }
679
+ } else {
680
+ // placed in the HEAD
681
+ if ( isDeferModeEnabled ) {
682
+ layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
683
+ }
684
+ // placed in the BODY
685
+ else {
686
+ if ( !/\{\{ page\.view\.scripts \}\}/.test(layout) ) {
687
+ layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
688
+ }
689
+ if (hasExternalsPlugins) {
690
+ for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
691
+ layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
692
+ }
693
+ }
694
+ }
695
+ }
696
+
697
+ // ginaLoader cannot be deferred
698
+ if (
699
+ !localOptions.template.javascriptsExcluded
700
+ && !/window\.onGinaLoaded/.test(layout)
701
+ ||
702
+ localOptions.template.javascriptsExcluded != '**'
703
+ && !/window\.onGinaLoaded/.test(layout)
704
+
705
+ ) {
706
+ layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.ginaLoader +'\n</head>');
707
+ }
708
+
709
+ } else if ( hasViews() && self.isCacheless() && self.isXMLRequest() ) {
710
+
711
+ if (isWithoutLayout) {
712
+ delete data.page.view.scripts;
713
+ delete data.page.view.stylesheets;
714
+ }
715
+ // means that we don't want GFF context or we already have it loaded
716
+ // viewInfos = JSON.clone(data.page.view);
717
+ // if ( !isWithoutLayout )
718
+ // viewInfos.assets = assets;
719
+
720
+
721
+ XHRData = '\n<input type="hidden" id="gina-without-layout-xhr-data" value="'+ encodeRFC5987ValueChars(JSON.stringify(data.page.data)) +'">';
722
+ XHRView = '\n<input type="hidden" id="gina-without-layout-xhr-view" value="'+ encodeRFC5987ValueChars(JSON.stringify(viewInfos)) +'">';
723
+ if ( /<\/body>/i.test(layout) ) {
724
+ layout = layout.replace(/<\/body>/i, XHRData + XHRView + '\n\t</body>');
725
+ } else {
726
+ // Popin case
727
+ // Fix added on 2023-01-25
728
+ layout += XHRData + XHRView + '\n\t'
729
+ }
730
+
731
+ // layout += XHRData + XHRView;
732
+
733
+ } else { // other envs like prod ...
734
+ // adding javascripts
735
+ layout.replace('{{ page.view.scripts }}', '');
736
+ if (isLoadingPartial) {
737
+ if ( !/\{\{ page\.view\.scripts \}\}/.test(layout) ) {
738
+ layout += '\t{{ page.view.scripts }}\n';
739
+ }
740
+ if (
741
+ !localOptions.template.javascriptsExcluded
742
+ && !/window\.onGinaLoaded/.test(layout)
743
+ ||
744
+ localOptions.template.javascriptsExcluded != '**'
745
+ && !/window\.onGinaLoaded/.test(layout)
746
+
747
+ ) {
748
+ layout += '\t'+ localOptions.template.ginaLoader +'\n';
749
+ }
750
+ } else {
751
+ // placed in the HEAD
752
+ if (
753
+ isDeferModeEnabled && /\<\/head\>/i.test(layout)
754
+ && !/\{\{ page\.view\.scripts \}\}/.test(layout)
755
+ ) { // placed in the HEAD
756
+ layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
757
+ }
758
+ // placed in the BODY
759
+ else {
760
+ if ( !/\{\{ page\.view\.scripts \}\}/.test(layout) ) {
761
+ layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
762
+ }
763
+ if (hasExternalsPlugins) {
764
+ for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
765
+ layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
766
+ }
767
+ }
768
+ }
769
+ // ginaLoader cannot be deferred
770
+ if (
771
+ !localOptions.template.javascriptsExcluded
772
+ && !/window\.onGinaLoaded/.test(layout)
773
+ ||
774
+ localOptions.template.javascriptsExcluded != '**'
775
+ && !/window\.onGinaLoaded/.test(layout)
776
+
777
+ ) {
778
+ layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.ginaLoader +'\n</head>');
779
+ }
780
+ }
781
+ }
782
+
783
+
784
+ layout = whisper(dic, layout, /\{{ ([a-zA-Z.]+) \}}/g );
785
+ dic['page.content'] = layout;
786
+
787
+
788
+ if ( !headersSent() ) {
789
+ // //catching errors
790
+ // local.res.statusCode = ( typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined' ) ? data.page.data.status : 200; // by default
791
+
792
+ // // HTTP/2 (RFC7540 8.1.2.4):
793
+ // // This standard for HTTP/2 explicitly states that status messages are not supported.
794
+ // // In HTTP/2, the status is conveyed solely by the numerical status code (e.g., 200, 404, 500),
795
+ // // and there is no field for a human-readable status message.
796
+ // if (
797
+ // typeof(data.page.data.errno) != 'undefined'
798
+ // && /^2/.test(data.page.data.status)
799
+ // && typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined'
800
+ // && !/http\/2/.test(localOptions.conf.server.protocol)
801
+ // ||
802
+ // typeof(data.page.data.status) != 'undefined'
803
+ // && !/^2/.test(data.page.data.status)
804
+ // && typeof(localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status]) != 'undefined'
805
+ // && !/http\/2/.test(localOptions.conf.server.protocol)
806
+ // ) {
807
+
808
+ // try {
809
+ // local.res.statusMessage = localOptions.conf.server.coreConfiguration.statusCodes[data.page.data.status];
810
+ // } catch (err){
811
+ // local.res.statusCode = 500;
812
+ // local.res.statusMessage = err.stack||err.message||localOptions.conf.server.coreConfiguration.statusCodes[local.res.statusCode];
813
+ // }
814
+ // }
815
+
816
+ // local.res.setHeader('content-type', localOptions.conf.server.coreConfiguration.mime['html'] + '; charset='+ localOptions.conf.encoding );
817
+
818
+ // try {
819
+
820
+ // // escape special chars
821
+ // var blacklistRe = new RegExp('[\<\>]', 'g');
822
+ // // DO NOT REPLACE IT BY JSON.clone() !!!!
823
+
824
+ // data.page.data = JSON.parse(JSON.stringify(data.page.data).replace(blacklistRe, '\$&'));
825
+ // blacklistRe = null;
826
+ // } catch (err) {
827
+ // filename = localOptions.template.html;
828
+ // 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: '' );
829
+ // self.throwError(local.res, 500, new Error('Controller::render(...) compilation error encountered while trying to process template `'+ filename + '`\n' + (err.stack||err.message||err) ));
830
+ // filename = null;
831
+ // blacklistRe = null;
832
+ // return;
833
+ // }
834
+
835
+
836
+
837
+ // Only available for http/2.0 for now
838
+ if ( !self.isXMLRequest() && /http\/2/.test(localOptions.conf.server.protocol) ) {
839
+ var assets = null;
840
+ try {
841
+ // TODO - button in toolbar to empty url assets cache
842
+ if ( /** self.isCacheless() ||*/ typeof(localOptions.template.assets) == 'undefined' || typeof(localOptions.template.assets[local.req.url]) == 'undefined' ) {
843
+ // assets string -> object
844
+ //assets = self.serverInstance.getAssets(localOptions.conf, layout.toString(), swig, data);
845
+ assets = self.serverInstance.getAssets(localOptions.conf, layout, null, data);
846
+ localOptions.template.assets = JSON.parse(assets);
847
+ }
848
+
849
+ // only for toolbar - TODO hasToolbar()
850
+ if (
851
+ self.isCacheless() && hasViews() && !isWithoutLayout
852
+ || hasViews() && localOptions.debugMode
853
+ || self.isCacheless() && hasViews() && self.isXMLRequest()
854
+ ) {
855
+ layout = layout.replace('{"assets":"${assets}"}', assets );
856
+ }
857
+
858
+ if ( !self.isCacheless() ) {
859
+ var links = localOptions.template.h2Links;
860
+ for (let l in localOptions.template.assets) {
861
+ let link = localOptions.template.assets[l]
862
+ if (
863
+ /^_/.test(l)
864
+ || typeof(link.as) == 'undefined'
865
+ || typeof(link.as) != 'undefined'
866
+ && link.as != 'null'
867
+ && !link.isAvailable
868
+ || !link.as
869
+ ) {
870
+ // ignoring
871
+ continue;
872
+ }
873
+
874
+ links += '<'+ l +'>; as='+ link.as +'; '
875
+ if ( link.imagesrcset) {
876
+ links += 'imagesrcset='+ link.imagesrcset +'; ';
877
+ }
878
+ if ( link.imagesizes) {
879
+ links += 'imagesizes='+ link.imagesizes +'; ';
880
+ }
881
+ links += 'rel=preload,'
882
+
883
+ }
884
+ if ( /\,$/.test(links) ) {
885
+ links = links.substring(0, links.length-1);
886
+ }
887
+ local.res.setHeader('link', links);
888
+ links = null;
889
+ }
890
+
891
+ assets = null;
892
+
893
+ } catch (err) {
894
+ assets = null;
895
+ self.throwError(local.res, 500, new Error('Controller::render(...) calling getAssets(...) \n' + (err.stack||err.message||err) ));
896
+ return;
897
+ }
898
+ }
899
+
900
+ if (newLayoutFilename) {
901
+ fd = fs.openSync(newLayoutFilename, 'w'); // Open file for writing
902
+ buffer = Buffer.from( layout );
903
+ fs.writeSync(fd, buffer, 0, buffer.length, 0); // Write the buffer
904
+ buffer = null;
905
+ fs.closeSync(fd); // Close the file descriptor
906
+ fd = null;
907
+ }
908
+
909
+ // Last compilation before rendering
910
+ // Now we can use `data` instead of `swigData`
911
+ mapping = { filename: path };
912
+ compiledTemplate = swig.compile(_templateContent, mapping);
913
+
914
+ if (
915
+ /**!self.isCacheless
916
+ &&*/ hasLayoutInPath
917
+ && !cache.has(cacheKey)
918
+ ) {
919
+ // Caching template
920
+ cache.set(cacheKey, {
921
+ template: compiledTemplate
922
+ });
923
+ }
924
+
925
+ if ( !headersSent() ) {
926
+ if ( localOptions.isRenderingCustomError ) {
927
+ localOptions.isRenderingCustomError = false;
928
+ }
929
+ htmlContent = compiledTemplate(data);
930
+ local.res.setHeader('content-type', localOptions.conf.server.coreConfiguration.mime['html'] + '; charset='+ localOptions.conf.encoding );
931
+
932
+ if (
933
+ !self.isCacheless
934
+ && typeof(local.req.routing.cache) != 'undefined'
935
+ && /^GET$/i.test(local.req.method)
936
+ ) {
937
+ cacheKey = "html:"+ local.req.url;
938
+ if ( !cache.has(cacheKey) ) {
939
+ // Caching to memory
940
+ if ( /^memory$/i.test(local.req.routing.cache) ) {
941
+ cache.set(cacheKey, {
942
+ content : htmlContent,
943
+ responseHeaders : local.res.getHeaders(),
944
+ fromMemory : true,
945
+ // ttl : 120 // In secs
946
+ });
947
+ }
948
+ // Caching to file
949
+ if ( /^static$/i.test(local.req.routing.cache) ) {
950
+ var url = local.req.url;
951
+ if ( /\/$/.test(url) ) {
952
+ url += 'index'
953
+ }
954
+ var htmlFilename = _(cachePath +'/'+ localOptions.bundle +'/html'+ url + '.html', true);
955
+ var htmlDir = htmlFilename.split(/\//g).slice(0, -1).join('/');
956
+ var htmlDirObj = new _(htmlDir);
957
+ if ( !htmlDirObj.existsSync() ) {
958
+ htmlDirObj.mkdirSync()
959
+ }
960
+ htmlDirObj = null;
961
+
962
+ console.debug("Writting cache to: ", htmlFilename);
963
+ fd = fs.openSync(htmlFilename, 'w'); // Open file for writing
964
+ buffer = Buffer.from( htmlContent );
965
+ fs.writeSync(fd, buffer, 0, buffer.length, 0); // Write the buffer
966
+ buffer = null;
967
+ fs.closeSync(fd); // Close the file descriptor
968
+ fd = null;
969
+
970
+ cache.set(cacheKey, {
971
+ filename : htmlFilename,
972
+ responseHeaders : local.res.getHeaders()
973
+ });
974
+ }
975
+ }
976
+ }
977
+
978
+
979
+ console.info(local.req.method +' ['+local.res.statusCode +'] '+ local.req.url);
980
+ local.res.end( htmlContent );
981
+
982
+ layout = null;
983
+ }
984
+
985
+ // console.info(local.req.method +' ['+local.res.statusCode +'] '+ local.req.url);
986
+
987
+ if ( typeof(local.next) != 'undefined' ) {
988
+ return local.next();
989
+ }
990
+ return;
991
+ }
992
+
993
+
994
+ if ( typeof(local.req.params.errorObject) != 'undefined' ) {
995
+ return self.throwError(local.req.params.errorObject);
996
+ }
997
+ local.res.end('Unexpected controller error while trying to render.');
998
+
999
+ if (typeof(local.next) != 'undefined') {
1000
+ return local.next();
1001
+ }
1002
+
1003
+ return;
1004
+
1005
+ } catch (err) {
1006
+ return self.throwError(local.res, 500, err);
1007
+ }
1008
+ }
1009
+
1010
+ module.exports = function onDeps(deps) {
1011
+
1012
+ self = deps.self;
1013
+ local = deps.local;
1014
+ getData = deps.getData;
1015
+ hasViews = deps.hasViews;
1016
+ setResources = deps.setResources;
1017
+ swig = deps.swig;
1018
+ SwigFilters = deps.SwigFilters;
1019
+ headersSent = deps.headersSent;
1020
+
1021
+ return render;
1022
+ };