gina 0.1.6-alpha.15 → 0.1.6-alpha.151

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