gina 0.1.1-alpha.18 → 0.1.1-alpha.180

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 (365) hide show
  1. package/AUTHORS +2 -1
  2. package/LICENSE +1 -1
  3. package/README-4Contributors.md +30 -0
  4. package/README.md +208 -32
  5. package/bin/cli +165 -68
  6. package/bin/cli-debug +49 -18
  7. package/bin/cmd +40 -18
  8. package/bin/gina +48 -37
  9. package/framework/{v0.1.1-alpha.18/lib/inherits → v0.1.1-alpha.180}/LICENSE +1 -1
  10. package/framework/v0.1.1-alpha.180/VERSION +1 -0
  11. package/framework/{v0.1.1-alpha.18/core/asset/js/plugin/readme.md → v0.1.1-alpha.180/core/asset/plugin/README.md} +31 -9
  12. package/framework/v0.1.1-alpha.180/core/asset/plugin/dist/vendor/gina/css/gina.min.css +1 -0
  13. package/framework/v0.1.1-alpha.180/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
  14. package/framework/v0.1.1-alpha.180/core/asset/plugin/dist/vendor/gina/html/toolbar.html +251 -0
  15. package/framework/{v0.1.1-alpha.18/core/asset/js/plugin/dist → v0.1.1-alpha.180/core/asset/plugin/dist/vendor/gina/js}/gina.js +3958 -3170
  16. package/framework/v0.1.1-alpha.180/core/asset/plugin/dist/vendor/gina/js/gina.min.js +759 -0
  17. package/framework/v0.1.1-alpha.180/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
  18. package/framework/v0.1.1-alpha.180/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +5 -0
  19. package/framework/v0.1.1-alpha.180/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
  20. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/config.js +123 -54
  21. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/connectors/couchbase/index.js +373 -259
  22. package/framework/v0.1.1-alpha.180/core/connectors/couchbase/lib/connector.js +22 -0
  23. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/connectors/couchbase/lib/connector.v2.js +51 -51
  24. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/connectors/couchbase/lib/connector.v3.js +51 -51
  25. package/framework/v0.1.1-alpha.180/core/connectors/couchbase/lib/connector.v4.js +384 -0
  26. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/connectors/couchbase/lib/n1ql.js +3 -2
  27. package/framework/v0.1.1-alpha.180/core/connectors/couchbase/lib/session-store.js +22 -0
  28. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/connectors/couchbase/lib/session-store.v3.js +12 -12
  29. package/framework/v0.1.1-alpha.180/core/connectors/couchbase/lib/session-store.v4.js +361 -0
  30. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/controller/controller.js +900 -767
  31. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/dev/index.js +1 -1
  32. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/dev/lib/class.js +1 -1
  33. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/dev/lib/factory.js +2 -2
  34. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/gna.js +13 -9
  35. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/locales/README.md +5 -0
  36. package/framework/v0.1.1-alpha.180/core/locales/dist/region/en.json +5727 -0
  37. package/framework/v0.1.1-alpha.180/core/locales/dist/region/fr.json +11452 -0
  38. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/locales/index.js +2 -2
  39. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/locales/src/make.js +39 -41
  40. package/framework/v0.1.1-alpha.180/core/locales/src/resources/region.mapping.json +43 -0
  41. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/model/entity.js +87 -67
  42. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/model/index.js +16 -16
  43. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/model/template/entityFactory.js +1 -1
  44. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/model/template/index.js +15 -14
  45. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/index.js +1 -1
  46. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/file/package.json +1 -1
  47. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/intl/package.json +1 -1
  48. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/intl/src/main.js +5 -5
  49. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/storage/package.json +1 -1
  50. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/storage/src/main.js +4 -4
  51. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/validator/package.json +1 -1
  52. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/validator/src/form-validator.js +399 -298
  53. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/validator/src/main.js +1292 -1258
  54. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/router.js +96 -90
  55. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/server.isaac.js +184 -179
  56. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/server.js +245 -67
  57. package/framework/v0.1.1-alpha.180/core/template/boilerplate/bundle/config/settings.json +12 -0
  58. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle/config/settings.server.json +4 -4
  59. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle/config/templates.json +4 -4
  60. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle/controllers/controller.content.js +1 -1
  61. package/framework/v0.1.1-alpha.180/core/template/boilerplate/bundle/controllers/setup.js +111 -0
  62. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle/index.js +13 -1
  63. package/framework/v0.1.1-alpha.180/core/template/boilerplate/bundle_templates/html/content/homepage.html +8 -0
  64. package/framework/v0.1.1-alpha.180/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +11 -0
  65. package/framework/v0.1.1-alpha.180/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +8 -0
  66. package/framework/{v0.1.1-alpha.18/core/template/boilerplate/bundle_templates/html/layout → v0.1.1-alpha.180/core/template/boilerplate/bundle_templates/html/layouts}/main.html +10 -3
  67. package/framework/v0.1.1-alpha.180/core/template/command/gina.bat.tpl +8 -0
  68. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/command/gina.tpl +4 -4
  69. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/conf/env.json +11 -0
  70. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/conf/package.json +1 -1
  71. package/framework/v0.1.1-alpha.180/core/template/conf/statics.json +12 -0
  72. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/conf/templates.json +2 -2
  73. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/console.js +3 -3
  74. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/context.js +146 -6
  75. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/dateFormat.js +9 -7
  76. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/index.js +13 -8
  77. package/framework/v0.1.1-alpha.180/helpers/json/LICENSE +9 -0
  78. package/framework/{v0.1.1-alpha.18/helpers/plugins → v0.1.1-alpha.180/helpers/json}/package.json +2 -2
  79. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/json/src/main.js +51 -25
  80. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/path.js +163 -96
  81. package/framework/{v0.1.1-alpha.18/helpers/json → v0.1.1-alpha.180/helpers/plugins}/package.json +2 -2
  82. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/plugins/src/api-error.js +23 -23
  83. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/plugins/src/main.js +3 -3
  84. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/prototypes.js +46 -38
  85. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/task.js +21 -14
  86. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/text.js +2 -2
  87. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/archiver/package.json +1 -1
  88. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/archiver/src/dep/jszip.min.js +3 -3
  89. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/archiver/src/main.js +168 -168
  90. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/aliases.json +4 -1
  91. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/add.js +79 -22
  92. package/framework/v0.1.1-alpha.180/lib/cmd/bundle/arguments.json +7 -0
  93. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/help.txt +4 -2
  94. package/framework/v0.1.1-alpha.180/lib/cmd/bundle/list.js +176 -0
  95. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/remove.js +22 -22
  96. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/start.js +264 -46
  97. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/stop.js +93 -74
  98. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/env/list.js +20 -4
  99. package/framework/{v0.1.1-alpha.18/lib/cmd/scope → v0.1.1-alpha.180/lib/cmd/env}/use.js +21 -1
  100. package/framework/v0.1.1-alpha.180/lib/cmd/framework/build.js +85 -0
  101. package/framework/v0.1.1-alpha.180/lib/cmd/framework/init.js +798 -0
  102. package/framework/v0.1.1-alpha.180/lib/cmd/framework/link-node-modules.js +86 -0
  103. package/framework/v0.1.1-alpha.180/lib/cmd/framework/link.js +109 -0
  104. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/open.js +15 -0
  105. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/restart.js +58 -26
  106. package/framework/v0.1.1-alpha.180/lib/cmd/framework/set.js +273 -0
  107. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/start.js +43 -20
  108. package/framework/v0.1.1-alpha.180/lib/cmd/framework/status.js +138 -0
  109. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/stop.js +44 -28
  110. package/framework/v0.1.1-alpha.180/lib/cmd/framework/tail.js +299 -0
  111. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/version.js +12 -3
  112. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/helper.js +74 -5
  113. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/index.js +23 -23
  114. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/port/inc/scan.js +32 -16
  115. package/framework/v0.1.1-alpha.180/lib/cmd/port/list.js +459 -0
  116. package/framework/v0.1.1-alpha.180/lib/cmd/port/reset.js +426 -0
  117. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/add.js +146 -122
  118. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/arguments.json +2 -1
  119. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/list.js +16 -2
  120. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/remove.js +17 -17
  121. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/protocol/set.js +239 -201
  122. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/scope/list.js +24 -8
  123. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/view/add.js +34 -9
  124. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/collection/package.json +1 -1
  125. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/collection/src/main.js +241 -241
  126. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/config.js +31 -30
  127. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cron/package.json +1 -1
  128. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cron/src/main.js +10 -9
  129. package/framework/v0.1.1-alpha.180/lib/domain/LICENSE +9 -0
  130. package/framework/v0.1.1-alpha.180/lib/domain/README.md +46 -0
  131. package/framework/v0.1.1-alpha.180/lib/domain/dist/public_suffix_list.dat +14186 -0
  132. package/framework/v0.1.1-alpha.180/lib/domain/package.json +20 -0
  133. package/framework/v0.1.1-alpha.180/lib/domain/src/main.js +442 -0
  134. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/generator/index.js +4 -4
  135. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/index.js +3 -2
  136. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180/lib/inherits}/LICENSE +1 -1
  137. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/inherits/README.md +2 -2
  138. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/inherits/package.json +3 -4
  139. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/inherits/src/main.js +3 -3
  140. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/package.json +2 -2
  141. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/src/containers/default/index.js +13 -2
  142. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/src/containers/file/index.js +109 -14
  143. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/src/containers/mq/index.js +12 -3
  144. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/src/containers/mq/listener.js +16 -14
  145. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/src/containers/mq/speaker.js +32 -3
  146. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/src/helper.js +21 -1
  147. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/src/main.js +34 -9
  148. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/math/index.js +9 -9
  149. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/merge/README.md +2 -2
  150. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/merge/package.json +1 -1
  151. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/merge/src/main.js +76 -88
  152. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/model.js +10 -10
  153. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/proc.js +87 -49
  154. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/routing/package.json +1 -1
  155. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/routing/src/main.js +280 -274
  156. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/session-store.js +6 -6
  157. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/shell.js +3 -3
  158. package/framework/v0.1.1-alpha.180/lib/swig-filters/README.md +0 -0
  159. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/swig-filters/package.json +1 -1
  160. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/swig-filters/src/main.js +140 -119
  161. package/framework/v0.1.1-alpha.180/lib/url/README.md +0 -0
  162. package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/validator.js +2 -2
  163. package/framework/v0.1.1-alpha.180/package.json +14 -0
  164. package/package.json +33 -24
  165. package/resources/home/main.json +53 -4
  166. package/resources/home/settings.json +9 -0
  167. package/resources/home/user/extensions/logger/default/config.json +1 -1
  168. package/resources/package.json.template +29 -18
  169. package/script/post_install.js +411 -126
  170. package/script/post_publish.js +186 -0
  171. package/script/pre_install.js +425 -77
  172. package/script/prepare_version.js +275 -98
  173. package/services/.gna/67fdf1b224a2ed5597e63d4b64283834468e05e3.txt +0 -0
  174. package/services/.gna/arch +1 -0
  175. package/services/.gna/locals.json +14 -0
  176. package/services/.gna/platform +1 -0
  177. package/services/configure +6 -0
  178. package/services/env.json +18 -0
  179. package/services/manifest.json +30 -0
  180. package/services/package.json +11 -0
  181. package/services/src/proxy/config/app.json +6 -0
  182. package/services/src/proxy/config/routing.json +11 -0
  183. package/services/src/proxy/config/settings.json +9 -0
  184. package/services/src/proxy/config/settings.server.json +31 -0
  185. package/services/src/proxy/config/statics.json +3 -0
  186. package/services/src/proxy/controllers/controller.content.js +58 -0
  187. package/services/src/proxy/controllers/controller.js +30 -0
  188. package/{framework/v0.1.1-alpha.18/core/template/boilerplate/bundle → services/src/proxy}/controllers/setup.js +14 -14
  189. package/services/src/proxy/index.js +31 -0
  190. package/services/src/proxy/lib/domain/README.md +48 -0
  191. package/services/src/proxy/lib/domain/src/config/public_suffix_list.dat +14186 -0
  192. package/services/src/toolbar/config/app.json +6 -0
  193. package/services/src/toolbar/config/routing.json +11 -0
  194. package/{framework/v0.1.1-alpha.18/core/template/boilerplate/bundle → services/src/toolbar}/config/settings.json +0 -0
  195. package/services/src/toolbar/config/settings.server.json +30 -0
  196. package/services/src/toolbar/controllers/controller.content.js +39 -0
  197. package/services/src/toolbar/controllers/controller.js +30 -0
  198. package/services/src/toolbar/controllers/setup.js +111 -0
  199. package/services/src/toolbar/index.js +43 -0
  200. package/utils/helper.js +236 -185
  201. package/utils/prototypes.js +9 -9
  202. package/utils/prototypes.json_clone.js +36 -35
  203. package/doc/framework/cli/doc.json +0 -9
  204. package/doc/framework/index.md +0 -60
  205. package/framework/v0.1.1-alpha.18/VERSION +0 -1
  206. package/framework/v0.1.1-alpha.18/core/asset/js/plugin/dist/gina.js.map +0 -56
  207. package/framework/v0.1.1-alpha.18/core/asset/js/plugin/dist/gina.min.css +0 -1
  208. package/framework/v0.1.1-alpha.18/core/asset/js/plugin/dist/gina.min.css.map +0 -1
  209. package/framework/v0.1.1-alpha.18/core/asset/js/plugin/dist/gina.min.js +0 -736
  210. package/framework/v0.1.1-alpha.18/core/asset/js/plugin/dist/gina.min.js.map +0 -56
  211. package/framework/v0.1.1-alpha.18/core/asset/js/plugin/dist/gina.onload.min.js +0 -5
  212. package/framework/v0.1.1-alpha.18/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
  213. package/framework/v0.1.1-alpha.18/core/connectors/couchbase/lib/connector.js +0 -20
  214. package/framework/v0.1.1-alpha.18/core/connectors/couchbase/lib/session-store.js +0 -21
  215. package/framework/v0.1.1-alpha.18/core/locales/dist/region/en.json +0 -9492
  216. package/framework/v0.1.1-alpha.18/core/locales/dist/region/fr.json +0 -9492
  217. package/framework/v0.1.1-alpha.18/core/locales/src/resources/region.mapping.json +0 -28
  218. package/framework/v0.1.1-alpha.18/core/template/boilerplate/bundle_templates/html/homepage.html +0 -4
  219. package/framework/v0.1.1-alpha.18/core/template/conf/statics.json +0 -10
  220. package/framework/v0.1.1-alpha.18/lib/cmd/bundle/arguments.json +0 -4
  221. package/framework/v0.1.1-alpha.18/lib/cmd/bundle/list.js +0 -129
  222. package/framework/v0.1.1-alpha.18/lib/cmd/framework/init.js +0 -514
  223. package/framework/v0.1.1-alpha.18/lib/cmd/framework/set.js +0 -161
  224. package/framework/v0.1.1-alpha.18/lib/cmd/framework/status.js +0 -72
  225. package/framework/v0.1.1-alpha.18/lib/cmd/framework/tail.js +0 -183
  226. package/framework/v0.1.1-alpha.18/lib/cmd/port/list.js +0 -176
  227. package/framework/v0.1.1-alpha.18/package.json +0 -14
  228. /package/{framework/v0.1.1-alpha.18/core/template/command/gina.bat.tpl → bin/gina.bat} +0 -0
  229. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/AUTHORS +0 -0
  230. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/asset/html/nolayout.html +0 -0
  231. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/asset/html/static.html +0 -0
  232. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/asset/img/android-chrome-192x192.png +0 -0
  233. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/asset/img/android-chrome-512x512.png +0 -0
  234. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/asset/img/apple-touch-icon.png +0 -0
  235. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/asset/img/favicon-16x16.png +0 -0
  236. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/asset/img/favicon-32x32.png +0 -0
  237. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/asset/img/favicon.ico +0 -0
  238. /package/framework/{v0.1.1-alpha.18/core/asset/js → v0.1.1-alpha.180/core/asset}/plugin/uuid.json +0 -0
  239. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  240. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/controller/controller.framework.js +0 -0
  241. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/controller/index.js +0 -0
  242. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/busboy/.travis.yml +0 -0
  243. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/busboy/LICENSE +0 -0
  244. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/busboy/README.md +0 -0
  245. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
  246. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/busboy/deps/encoding/encoding.js +0 -0
  247. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/busboy/lib/main.js +0 -0
  248. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/busboy/lib/types/multipart.js +0 -0
  249. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/busboy/lib/types/urlencoded.js +0 -0
  250. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/busboy/lib/utils.js +0 -0
  251. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/busboy/package.json +0 -0
  252. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  253. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/dev/lib/tools.js +0 -0
  254. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/locales/currency.json +0 -0
  255. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/locales/dist/language/en.json +0 -0
  256. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/locales/dist/language/fr.json +0 -0
  257. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/locales/src/resources/currency.csv +0 -0
  258. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/locales/src/resources/region.csv +0 -0
  259. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/mime.types +0 -0
  260. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/README.md +0 -0
  261. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/file/README.md +0 -0
  262. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/file/build.json +0 -0
  263. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/intl/README.md +0 -0
  264. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/intl/build.json +0 -0
  265. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/storage/README.md +0 -0
  266. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/storage/build.json +0 -0
  267. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/validator/README.md +0 -0
  268. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/plugins/lib/validator/build.json +0 -0
  269. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/server.express.js +0 -0
  270. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/status.codes +0 -0
  271. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle/config/app.json +0 -0
  272. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle/config/routing.json +0 -0
  273. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  274. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  275. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  276. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  277. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  278. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  279. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle_public/readme.md +0 -0
  280. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  281. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/conf/manifest.json +0 -0
  282. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/conf/settings.json +0 -0
  283. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/error/client/json/401.json +0 -0
  284. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/error/client/json/403.json +0 -0
  285. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/error/client/json/404.json +0 -0
  286. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/error/server/html/50x.html +0 -0
  287. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/error/server/json/500.json +0 -0
  288. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/error/server/json/503.json +0 -0
  289. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/core/template/extensions/logger/config.json +0 -0
  290. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/json/README.md +0 -0
  291. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/helpers/plugins/README.md +0 -0
  292. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/archiver/README.md +0 -0
  293. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/archiver/build.json +0 -0
  294. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/copy.js +0 -0
  295. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/cp.js +0 -0
  296. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/help.js +0 -0
  297. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/rename.js +0 -0
  298. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/restart.js +0 -0
  299. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/rm.js +0 -0
  300. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/bundle/status.js +0 -0
  301. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/env/add.js +0 -0
  302. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/env/get.js +0 -0
  303. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/env/help.js +0 -0
  304. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/env/help.txt +0 -0
  305. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/env/link-dev.js +0 -0
  306. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/env/remove.js +0 -0
  307. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/env/rm.js +0 -0
  308. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/env/set.js +0 -0
  309. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/env/unset.js +0 -0
  310. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/dot.js +0 -0
  311. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/get.js +0 -0
  312. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/help.js +0 -0
  313. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/help.txt +0 -0
  314. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/msg.json +0 -0
  315. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/framework/update.js +0 -0
  316. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/gina-dev.1.md +0 -0
  317. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/gina-framework.1.md +0 -0
  318. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/gina.1.md +0 -0
  319. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/msg.json +0 -0
  320. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/port/help.js +0 -0
  321. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/port/help.txt +0 -0
  322. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/port/set.js +0 -0
  323. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/build.js +0 -0
  324. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/help.js +0 -0
  325. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/help.txt +0 -0
  326. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/import.js +0 -0
  327. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/move.js +0 -0
  328. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/rename.js +0 -0
  329. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/restart.js +0 -0
  330. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/rm.js +0 -0
  331. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/start.js +0 -0
  332. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/status.js +0 -0
  333. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/project/stop.js +0 -0
  334. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/protocol/help.js +0 -0
  335. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/protocol/help.txt +0 -0
  336. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/protocol/list.js +0 -0
  337. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/scope/help.js +0 -0
  338. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/scope/help.txt +0 -0
  339. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/scope/link-local.js +0 -0
  340. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/scope/remove.js +0 -0
  341. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/scope/rm.js +0 -0
  342. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/scope/set.js +0 -0
  343. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cmd/scope/unset.js +0 -0
  344. /package/framework/{v0.1.1-alpha.18/lib/cmd/env → v0.1.1-alpha.180/lib/cmd/scope}/use.js +0 -0
  345. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/collection/README.md +0 -0
  346. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/collection/build.json +0 -0
  347. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/cron/README.md +0 -0
  348. /package/framework/{v0.1.1-alpha.18/lib/routing/README.md → v0.1.1-alpha.180/lib/domain/exemples/backend.js} +0 -0
  349. /package/framework/{v0.1.1-alpha.18/lib/routing/build.json → v0.1.1-alpha.180/lib/domain/exemples/frontend.html} +0 -0
  350. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  351. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/inherits/example/protected_inheritance.js +0 -0
  352. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/inherits/example/simple_inheritance.js +0 -0
  353. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  354. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/README.md +0 -0
  355. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  356. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  357. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/merge/example/merge.js +0 -0
  358. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/merge/example/merge_2_literal objects.js +0 -0
  359. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/merge/example/merge_and_preserve_first.js +0 -0
  360. /package/framework/{v0.1.1-alpha.18/lib/swig-filters → v0.1.1-alpha.180/lib/routing}/README.md +0 -0
  361. /package/framework/{v0.1.1-alpha.18/lib/url/README.md → v0.1.1-alpha.180/lib/routing/build.json} +0 -0
  362. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/url/index.js +0 -0
  363. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/url/mocks.json +0 -0
  364. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/url/routing.json +0 -0
  365. /package/framework/{v0.1.1-alpha.18 → v0.1.1-alpha.180}/lib/url/test.js +0 -0
@@ -15,7 +15,7 @@ const swig = require( _(GINA_FRAMEWORK_DIR +'/node_modules/swig', true)
15
15
  var Config = require('./config');
16
16
  var Router = require('./router');
17
17
  var lib = require('./../lib');
18
- var routingUtils = lib.routing;
18
+ var routingLib = lib.routing;
19
19
  var inherits = lib.inherits;
20
20
  var merge = lib.merge;
21
21
  var Proc = lib.Proc;
@@ -227,13 +227,56 @@ function Server(options) {
227
227
  })
228
228
  });
229
229
  } catch (err) {
230
- console.emerg(sslDetails +'\n'+ err.stack);
231
- return;
230
+ if (!sslDetails) {
231
+ throw new Error('DNS issue ? Did you check your `/etc/hosts` or your DNS configuration ?\n'+ err.stack);
232
+ }
233
+ throw new Error(sslDetails +'\n'+ err.stack);
232
234
  }
233
235
 
234
236
 
235
237
  const failed = !sslDetails.valid;
236
238
  const humanView = JSON.stringify(sslDetails, null, ' ');
239
+
240
+ // Wildcard exception - See https://github.com/dyaa/ssl-checker/issues/381
241
+ // Date of the test: 2022-12-18T00:00:00.000Z
242
+ // container-87546.dev.sample.app -> not valid when it should return true.
243
+ // {
244
+ // "daysRemaining": 290,
245
+ // "valid": false,
246
+ // "validFrom": "2022-10-03T00:00:00.000Z",
247
+ // "validTo": "2023-10-03T23:59:59.000Z",
248
+ // "validFor": [
249
+ // "*.sample.app",
250
+ // "sample.app"
251
+ // ]
252
+ // }
253
+
254
+ const isHandleByWildcardCert = function(endpoint, hv) {
255
+ var isAllowed = false;
256
+ const start = new Date(hv.validFrom).format('longIsoDateTime');
257
+ const end = new Date(hv.validTo).format('longIsoDateTime');
258
+ const today = new Date().format('longIsoDateTime');
259
+ const allowed = hv.validFor;
260
+
261
+ for (let i=0, len=allowed.length; i<len; ++i ) {
262
+ // skip if not a wildcard
263
+ if ( ! /^[*]\./.test(allowed[i]) ) continue;
264
+
265
+ let re = new RegExp( allowed[i].replace(/^[*]/, '')+'$' );
266
+ if ( ! re.test(endpoint) ) continue;
267
+
268
+ if ( today >= start && today < end) {
269
+ isAllowed = true;
270
+ break
271
+ }
272
+ }
273
+ return isAllowed;
274
+ }
275
+ if ( failed && Array.isArray(sslDetails.validFor) && isHandleByWildcardCert(endpoint, sslDetails) ) {
276
+ return;
277
+ }
278
+
279
+
237
280
  if (failed) {
238
281
  if (sslDetails.daysRemaining > -1) {
239
282
  console.emerg(`[Certificate] ${endpoint} : It is like there is a problem with your CA certificate${'\n'} ${humanView}`);
@@ -1128,7 +1171,12 @@ function Server(options) {
1128
1171
 
1129
1172
  var headerValue = null;
1130
1173
  for (var h in resHeaders) {
1131
- if (!response.headersSent) {
1174
+ if (
1175
+ // typeof(response.finished) != 'undefined' && !response.finished
1176
+ // || typeof(response.writableEnded) != 'undefined' && !response.writableEnded
1177
+ // ||
1178
+ !response.headersSent
1179
+ ) {
1132
1180
  // handles multiple origins
1133
1181
  if ( /access\-control\-allow\-origin/i.test(h) ) { // re.test(resHeaders[h]
1134
1182
  if (sameOrigin) {
@@ -1151,13 +1199,26 @@ function Server(options) {
1151
1199
  origin = sameOrigin;
1152
1200
 
1153
1201
 
1154
- response.setHeader(h, origin);
1202
+ // if (
1203
+ // typeof(response.finished) != 'undefined' && !response.finished
1204
+ // || typeof(response.writableEnded) != 'undefined' && !response.writableEnded
1205
+ // || !response.headersSent
1206
+ // ) {
1207
+ response.setHeader(h, origin);
1208
+ // }
1209
+
1155
1210
  }
1156
1211
  sameOrigin = false;
1157
1212
  } else {
1158
1213
  headerValue = resHeaders[h];
1159
1214
  try {
1160
- response.setHeader(h, headerValue)
1215
+ // if (
1216
+ // typeof(response.finished) != 'undefined' && !response.finished
1217
+ // || typeof(response.writableEnded) != 'undefined' && !response.writableEnded
1218
+ // || !response.headersSent
1219
+ // ) {
1220
+ response.setHeader(h, headerValue)
1221
+ // }
1161
1222
  } catch (headerError) {
1162
1223
  console.error(headerError)
1163
1224
  }
@@ -1178,11 +1239,92 @@ function Server(options) {
1178
1239
  }
1179
1240
 
1180
1241
  this.onHttp2Stream = function(stream, headers, response) {
1242
+ var header = null
1243
+ , isWebroot = false
1244
+ , pathname = null
1245
+ , asset = null
1246
+ , assets = this._options.template.assets
1247
+ , conf = this._options.conf
1248
+ , cacheless = conf.cacheless
1249
+ ;
1250
+
1251
+
1252
+ if (
1253
+ headers[':path'] == '/'
1254
+ || headers[':path'] == this._options.conf.server.webroot
1255
+ ) {
1256
+
1257
+ if (
1258
+ this._options.conf.server.webroot != headers[':path']
1259
+ && this._options.conf.server.webrootAutoredirect
1260
+ || headers[':path'] == this._options.conf.server.webroot
1261
+ && this._options.conf.server.webrootAutoredirect
1262
+ ) {
1263
+ isWebroot = true
1264
+ }
1265
+ }
1266
+
1267
+ var url = (isWebroot) ? this._referrer : headers[':path'];
1268
+
1269
+ var hanlersPath = conf.handlersPath
1270
+ , isHandler = (
1271
+ typeof(assets[ url ]) != 'undefined'
1272
+ && typeof(assets[ url ].filename) != 'undefined'
1273
+ && new RegExp('^'+ hanlersPath).test(assets[ url ].filename)
1274
+ ) ? true: false
1275
+ ;
1181
1276
 
1182
1277
  if (!stream.pushAllowed) {
1183
- //header = merge({ ':status': 200 }, response.getHeaders());
1184
- stream.respond({ ':status': 200 });
1185
- stream.end();
1278
+ asset = {
1279
+ url : url,
1280
+ filename : assets[ url ].filename,
1281
+ file : null,
1282
+ isAvailable : assets[ url ].isAvailable,
1283
+ mime : assets[ url ].mime,
1284
+ encoding : conf.encoding,
1285
+ isBinary : assets[ url ].isBinary,
1286
+ isHandler : assets[ url ].isHandler
1287
+ };
1288
+ header = merge({ ':status': 200 }, response.getHeaders());
1289
+ header['content-type'] = ( !/charset/.test(asset.mime ) ) ? asset.mime + '; charset='+ asset.encoding : asset.mime;
1290
+ header = completeHeaders(header, local.request, response);
1291
+ if (asset.isBinary || asset.isHandler ) {
1292
+
1293
+
1294
+ if (asset.isHandler) {
1295
+ // adding handler `gina.ready(...)` wrapper
1296
+ var file = null;
1297
+ if ( !fs.existsSync(asset.filename) ) {
1298
+ throwError({stream: stream}, 404, 'Page not found: \n' + headers[':path']);
1299
+ return;
1300
+ }
1301
+
1302
+ if (!assets[ url ].file) {
1303
+ file = fs.readFileSync(asset.filename, asset.encoding).toString();
1304
+ file = '(gina.ready(function onGinaReady($){\n'+ file + '\n},window["originalContext"]));';
1305
+ this._options.template.assets[ headers[':path'] ].file = file;
1306
+ } else {
1307
+ file = assets[ url ].file;
1308
+ }
1309
+
1310
+ // header['content-length'] = fs.statSync(file).size;
1311
+ stream.respond(header);
1312
+ stream.end(file);
1313
+
1314
+ return;
1315
+ }
1316
+
1317
+ header['content-length'] = fs.statSync(asset.filename).size;
1318
+ stream.respondWithFile(
1319
+ asset.filename
1320
+ , header
1321
+ //, { onError }
1322
+ );
1323
+ } else {
1324
+ stream.respond(header);
1325
+ stream.end();
1326
+ }
1327
+
1186
1328
  return;
1187
1329
  }
1188
1330
 
@@ -1193,18 +1335,18 @@ function Server(options) {
1193
1335
  return;
1194
1336
  }
1195
1337
 
1196
- var header = null, isWebroot = false, pathname = null;
1197
1338
  if (
1198
- headers[':path'] == '/'
1199
- || headers[':path'] == this._options.conf.server.webroot
1339
+ // headers[':path'] == '/'
1340
+ // || headers[':path'] == this._options.conf.server.webroot
1341
+ /^true$/i.test(isWebroot)
1200
1342
  ) {
1201
1343
 
1202
- if (
1203
- this._options.conf.server.webroot != headers[':path']
1204
- && this._options.conf.server.webrootAutoredirect
1205
- || headers[':path'] == this._options.conf.server.webroot
1206
- && this._options.conf.server.webrootAutoredirect
1207
- ) {
1344
+ // if (
1345
+ // this._options.conf.server.webroot != headers[':path']
1346
+ // && this._options.conf.server.webrootAutoredirect
1347
+ // || headers[':path'] == this._options.conf.server.webroot
1348
+ // && this._options.conf.server.webrootAutoredirect
1349
+ // ) {
1208
1350
 
1209
1351
  header = {
1210
1352
  ':status': 301
@@ -1220,9 +1362,10 @@ function Server(options) {
1220
1362
  stream.respond(header);
1221
1363
  stream.end();
1222
1364
  return;
1223
- } else {
1224
- isWebroot = true;
1225
- }
1365
+ // }
1366
+ // else {
1367
+ // isWebroot = true;
1368
+ // }
1226
1369
  }
1227
1370
 
1228
1371
  if (
@@ -1235,21 +1378,19 @@ function Server(options) {
1235
1378
  header = {
1236
1379
  ':status': 200
1237
1380
  };
1238
- var url = (isWebroot) ? this._referrer : headers[':path'];
1239
- var assets = this._options.template.assets;
1381
+ // var assets = this._options.template.assets;
1382
+ // var url = (isWebroot) ? this._referrer : headers[':path'];
1240
1383
  var responseHeaders = ( typeof(this._responseHeaders) != 'undefined') ? this._responseHeaders : null;
1241
- var conf = this._options.conf;
1242
- var asset = {
1243
- url : url,
1244
- filename : assets[ url ].filename,
1245
- file : null,
1246
- isAvailable : assets[ url ].isAvailable,
1247
- mime : assets[ url ].mime,
1248
- encoding : conf.encoding,
1249
- isHandler : false
1250
- }
1251
- , cacheless = conf.cacheless
1252
- ;
1384
+ // var conf = this._options.conf;
1385
+ asset = {
1386
+ url : url,
1387
+ filename : assets[ url ].filename,
1388
+ file : null,
1389
+ isAvailable : assets[ url ].isAvailable,
1390
+ mime : assets[ url ].mime,
1391
+ encoding : conf.encoding,
1392
+ isHandler : isHandler
1393
+ };
1253
1394
 
1254
1395
  console.debug('h2 pushing: '+ headers[':path'] + ' -> '+ asset.filename);
1255
1396
 
@@ -1261,7 +1402,7 @@ function Server(options) {
1261
1402
  return;
1262
1403
  }
1263
1404
 
1264
- asset.isHandler = true;
1405
+ asset.isHandler = this._options.template.assets[ headers[':path'] ].isHandler = true;
1265
1406
  asset.file = fs.readFileSync(asset.filename, asset.encoding).toString();
1266
1407
  asset.file = '(gina.ready(function onGinaReady($){\n'+ asset.file + '\n},window["originalContext"]));';
1267
1408
 
@@ -1287,6 +1428,9 @@ function Server(options) {
1287
1428
 
1288
1429
 
1289
1430
  header['content-type'] = ( !/charset/.test(asset.mime ) ) ? asset.mime + '; charset='+ asset.encoding : asset.mime;
1431
+ if (assets[ url ].isBinary) {
1432
+ header['content-length'] = fs.statSync(assets[ url ].filename).size;
1433
+ }
1290
1434
 
1291
1435
  if (cacheless) {
1292
1436
  // source maps integration for javascript & css
@@ -1305,8 +1449,9 @@ function Server(options) {
1305
1449
  header = merge(header, responseHeaders);
1306
1450
  }
1307
1451
  header = completeHeaders(header, local.request, response);
1452
+ var pushedFile = (/index.html$/.test(headers[':path']) && /\/$/.test(asset.filename) ) ? asset.filename +'index.html': asset.filename;
1308
1453
  pushStream.respondWithFile(
1309
- asset.filename
1454
+ pushedFile
1310
1455
  , header
1311
1456
  //, { onError }
1312
1457
  );
@@ -1382,6 +1527,7 @@ function Server(options) {
1382
1527
  var isFilenameDir = null
1383
1528
  , dirname = null
1384
1529
  , isBinary = null
1530
+ , isHandler = null
1385
1531
  , hanlersPath = null
1386
1532
  ;
1387
1533
 
@@ -1458,20 +1604,27 @@ function Server(options) {
1458
1604
  }
1459
1605
 
1460
1606
 
1461
- if (cacheless)
1607
+ if (cacheless) {
1462
1608
  delete require.cache[require.resolve(filename)];
1609
+ }
1463
1610
 
1464
-
1611
+ if (response.headersSent) {
1612
+ // May be sent by http/2 push
1613
+ return
1614
+ }
1465
1615
  fs.readFile(filename, bundleConf.encoding, function onStaticFileRead(err, file) {
1466
1616
  if (err) {
1467
1617
  throwError(response, 404, 'Page not found: \n' + pathname, next);
1468
1618
  return;
1469
- } else if (!response.headersSent) {
1619
+ }
1620
+
1621
+ if (!response.headersSent) {
1470
1622
 
1471
- isBinary = true;
1623
+ isBinary = true;
1624
+ isHandler = false;
1472
1625
 
1473
1626
  try {
1474
- contentType = getHead(response, filename);
1627
+ contentType = getContentTypeByFilename(filename);
1475
1628
 
1476
1629
  // adding gina loader
1477
1630
  if ( /text\/html/i.test(contentType) && self.isCacheless() ) {
@@ -1488,7 +1641,8 @@ function Server(options) {
1488
1641
  hanlersPath = bundleConf.handlersPath;
1489
1642
 
1490
1643
  if ( new RegExp('^'+ hanlersPath).test(filename) ) {
1491
- isBinary = false;
1644
+ isBinary = false;
1645
+ isHandler = true;
1492
1646
  file = '(gina.ready(function onGinaReady($){\n'+ file + '\n},window["originalContext"]));'
1493
1647
  }
1494
1648
  }
@@ -1513,7 +1667,9 @@ function Server(options) {
1513
1667
  isAvailable: true,
1514
1668
  mime: contentType,
1515
1669
  url: request.url,
1516
- filename: filename
1670
+ filename: filename,
1671
+ isBinary: isBinary,
1672
+ isHandler: isHandler
1517
1673
  }
1518
1674
  }
1519
1675
 
@@ -1577,7 +1733,7 @@ function Server(options) {
1577
1733
  }
1578
1734
  }
1579
1735
 
1580
- contentType = getHead(response, filename);
1736
+ contentType = getContentTypeByFilename(filename);
1581
1737
  contentType = contentType +'; charset='+ bundleConf.encoding;
1582
1738
  ext = request.url.match(/\.([A-Za-z0-9]+)$/);
1583
1739
  request.url = ( ext != null && typeof(ext[0]) != 'undefined' ) ? request.url : request.url + 'index.html';
@@ -1592,12 +1748,15 @@ function Server(options) {
1592
1748
  isAvailable: (!/404\.html/.test(filename)) ? true : false,
1593
1749
  mime: contentType,
1594
1750
  url: request.url,
1595
- filename: filename
1751
+ filename: filename,
1752
+ isBinary: isBinary,
1753
+ isHandler: isHandler
1596
1754
  }
1597
1755
  }
1598
1756
 
1599
1757
  if (!fs.existsSync(filename)) return;
1600
- isBinary = ( /text\/html/i.test(contentType) ) ? false : true;
1758
+ isBinary = ( /text\/html/i.test(contentType) ) ? false : true;
1759
+ isHandler = ( new RegExp('^'+ bundleConf.handlersPath).test(filename) ) ? true : false;
1601
1760
  if ( isBinary ) {
1602
1761
  // override
1603
1762
  self._options.template.assets[request.url] = {
@@ -1605,7 +1764,19 @@ function Server(options) {
1605
1764
  isAvailable: true,
1606
1765
  mime: contentType,
1607
1766
  url: request.url,
1608
- filename: filename
1767
+ filename: filename,
1768
+ isBinary: isBinary,
1769
+ isHandler: isHandler
1770
+ }
1771
+ }
1772
+
1773
+ if ( isHandler ) {
1774
+ // adding handler `gina.ready(...)` wrapper
1775
+ var file = null;
1776
+ if (!self._options.template.assets[request.url].file) {
1777
+ file = fs.readFileSync(filename, bundleConf.encoding).toString();
1778
+ file = '(gina.ready(function onGinaReady($){\n'+ file + '\n},window["originalContext"]));';
1779
+ self._options.template.assets[request.url].file = file;
1609
1780
  }
1610
1781
  }
1611
1782
  self.onHttp2Stream(stream, headers, response);
@@ -2155,16 +2326,16 @@ function Server(options) {
2155
2326
 
2156
2327
  });//EO this.instance
2157
2328
 
2158
-
2159
2329
  self.instance.listen(self.conf[self.appName][self.env].server.port);//By Default 3100
2160
2330
  self.instance.timeout = (1000 * 300); // e.g.: 1000x60 => 60 sec
2161
2331
 
2332
+
2162
2333
  self.emit('started', self.conf[self.appName][self.env], true);
2163
2334
  }
2164
2335
 
2165
2336
  var processRequestData = function(request, response, next) {
2166
2337
 
2167
- var bodyStr = null, obj = null;
2338
+ var bodyStr = null, obj = null, exception = null;
2168
2339
  // to compare with /core/controller/controller.js -> getParams()
2169
2340
  switch( request.method.toLowerCase() ) {
2170
2341
  case 'post':
@@ -2194,6 +2365,11 @@ function Server(options) {
2194
2365
 
2195
2366
  try {
2196
2367
  obj = parseBody(bodyStr);
2368
+ if ( !obj) {
2369
+ exception = new Error('Could not convert POST::BODY_STRING to POST::OBJECT. Possible JSON error in `bodyStr`');
2370
+ throwError(response, 500, exception, next);
2371
+ return;
2372
+ }
2197
2373
  request.post = obj;
2198
2374
  isPostSet = true;
2199
2375
  } catch (err) {
@@ -2226,7 +2402,8 @@ function Server(options) {
2226
2402
  if (request.body.count() == 0 && typeof(request.query) != 'string' && request.query.count() > 0 ) {
2227
2403
  request.body = request.query
2228
2404
  }
2229
- bodyStr = JSON.stringify(request.body);
2405
+ // 2023-01-31: fixed `request.body` might not be an `object`
2406
+ bodyStr = ( typeof(request.body) == 'object') ? JSON.stringify(request.body) : request.body;
2230
2407
  // false & true case
2231
2408
  if ( /(\"false\"|\"true\"|\"on\")/.test(bodyStr) )
2232
2409
  bodyStr = bodyStr.replace(/\"false\"/g, false).replace(/\"true\"/g, true).replace(/\"on\"/g, true);
@@ -2235,7 +2412,7 @@ function Server(options) {
2235
2412
  }
2236
2413
 
2237
2414
  try {
2238
- if ( obj.count() > 0 ) {
2415
+ if ( typeof(obj) == 'object' && obj.count() > 0 ) {
2239
2416
  // still need this to allow compatibility with express & connect middlewares
2240
2417
  request.body = request.post = obj;
2241
2418
  }
@@ -2418,21 +2595,21 @@ function Server(options) {
2418
2595
  })
2419
2596
  }
2420
2597
 
2421
- var getHead = function(response, file) {
2598
+ var getContentTypeByFilename = function(filename) {
2422
2599
  try {
2423
- var s = file.split(/\./);
2600
+ var s = filename.split(/\./);
2424
2601
  var ext = s[s.length-1];
2425
2602
  var type = null;
2426
2603
  var mime = self.conf[self.appName][self.env].server.coreConfiguration.mime;
2427
2604
 
2428
- if( typeof(mime[ext]) != 'undefined' ) {
2605
+ if ( typeof(mime[ext]) != 'undefined' ) {
2429
2606
  type = mime[ext];
2430
2607
  } else {
2431
- console.warn('[ '+file+' ] extension: `'+s[2]+'` not supported by gina: `core/mime.types`. Replacing with `plain/text` ')
2608
+ console.warn('[ '+filename+' ] extension: `'+s[2]+'` not supported by gina: `core/mime.types`. Pathname must be a directory. Replacing with `plain/text` ')
2432
2609
  }
2433
- return type || 'plain/text'
2610
+ return type || 'plain/text'
2434
2611
  } catch (err) {
2435
- console.error('Error while trying to getHead('+ file +') extention. Replacing with `plain/text` '+ err.stack);
2612
+ console.error('Error while trying to getContentTypeByFilename('+ filename +') extention. Replacing with `plain/text` '+ err.stack);
2436
2613
  return 'plain/text'
2437
2614
  }
2438
2615
 
@@ -2531,13 +2708,13 @@ function Server(options) {
2531
2708
  }
2532
2709
 
2533
2710
  expressMiddlewares[nextMiddleware._index](nextMiddleware._request, nextMiddleware._response, function onNextMiddleware(err, request, response) {
2534
- ++nextMiddleware._index;
2535
2711
 
2536
2712
  if (err) {
2537
2713
  throwError(nextMiddleware._response, 500, (err.stack||err.message||err), nextMiddleware._next, nextMiddleware._nextAction);
2538
2714
  return;
2539
2715
  }
2540
2716
 
2717
+ ++nextMiddleware._index;
2541
2718
  if (request)
2542
2719
  nextMiddleware._request = request;
2543
2720
 
@@ -2632,7 +2809,7 @@ function Server(options) {
2632
2809
  , wroot = null
2633
2810
  ;
2634
2811
 
2635
- //matched = routingUtils.getRouteByUrl(req.url, bundle, (req.method||req[':method']), req);
2812
+ //matched = routingLib.getRouteByUrl(req.url, bundle, (req.method||req[':method']), req);
2636
2813
 
2637
2814
  req = checkPreflightRequest(req);
2638
2815
  var params = {}
@@ -2657,9 +2834,10 @@ function Server(options) {
2657
2834
  }
2658
2835
  var isMethodAllowed = null, hostname = null;
2659
2836
  out:
2660
- for (var name in routing) {
2661
- if (typeof(routing[name]['param']) == 'undefined')
2837
+ for (let name in routing) {
2838
+ if ( typeof(routing[name]['param']) == 'undefined' ) {
2662
2839
  break;
2840
+ }
2663
2841
 
2664
2842
  // updating hostname
2665
2843
  // if (
@@ -2687,7 +2865,7 @@ function Server(options) {
2687
2865
  method : method,
2688
2866
  requirements : routing[name].requirements,
2689
2867
  namespace : routing[name].namespace || undefined,
2690
- url : unescape(pathname), /// avoid %20
2868
+ url : decodeURI(pathname), /// avoid %20
2691
2869
  rule : routing[name].originalRule || name,
2692
2870
  param : JSON.clone(routing[name].param),
2693
2871
  middleware : JSON.clone(routing[name].middleware),
@@ -2698,7 +2876,7 @@ function Server(options) {
2698
2876
 
2699
2877
  //Parsing for the right url.
2700
2878
  try {
2701
- isRoute = await routingUtils.compareUrls(params, routing[name].url, req, res, next);
2879
+ isRoute = await routingLib.compareUrls(params, routing[name].url, req, res, next);
2702
2880
  } catch (err) {
2703
2881
  var msg = 'Internal server error.\nRule [ '+name+' ] needs your attention.\n';
2704
2882
  // TODO - Refactor `ApiError`to handle the following param
@@ -2818,7 +2996,7 @@ function Server(options) {
2818
2996
  }
2819
2997
 
2820
2998
  if (!res.headersSent) {
2821
- res.headersSent = true;
2999
+ // res.headersSent = true;
2822
3000
  local.request = checkPreflightRequest(local.request);
2823
3001
  // updated filter on controller.js : 2020/09/25
2824
3002
  //if (isXMLRequest || !withViews || !isUsingTemplate ) {
@@ -2875,7 +3053,7 @@ function Server(options) {
2875
3053
  //console.error('[ BUNDLE ][ '+self.appName+' ] '+ local.request.method +' [ '+code+' ] '+ local.request.url);
2876
3054
  console.error(local.request.method +' [ '+code+' ] '+ local.request.url);
2877
3055
  // intercept none HTML mime types
2878
- var url = unescape(local.request.url) /// avoid %20
3056
+ var url = decodeURI(local.request.url) /// avoid %20
2879
3057
  , ext = null
2880
3058
  , isHtmlContent = false
2881
3059
  , hasCustomErrorFile = false
@@ -2937,7 +3115,7 @@ function Server(options) {
2937
3115
  }
2938
3116
 
2939
3117
  var eRule = 'custom-error-page@'+ self.appName;
2940
- var routeObj = routingUtils.getRoute(eRule);
3118
+ var routeObj = routingLib.getRoute(eRule);
2941
3119
  routeObj.rule = eRule;
2942
3120
  routeObj.url = url;
2943
3121
  routeObj.param.title = ( typeof(eData.title) != 'undefined' ) ? eData.title : 'Error ' + eData.status;
@@ -0,0 +1,12 @@
1
+ // bundle needs to be restarted on changes !!
2
+ {
3
+ "region": {
4
+ // <language>_<COUNTRY_ISO_SHORT_CODE>
5
+ "culture": "en_CM",
6
+ // <country_iso_short_code>
7
+ "isoShort": "en",
8
+ "date": "yyyy/mm/dd",
9
+ // https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
10
+ "timeZone": "Africa/Douala"
11
+ }
12
+ }
@@ -6,19 +6,19 @@
6
6
  * Default is `true`: set to false if you have describe a redirection rule from your `routing.json`
7
7
  */
8
8
  // "webrootAutoredirect": false,
9
-
9
+
10
10
  /**
11
11
  * `template` settings
12
12
  * Default is `false`: will automatically be set to `true` when you add a view/template (`false` is right for APIs only)
13
13
  */
14
- // "template": false
15
-
14
+ // "template": false,
15
+
16
16
  /**
17
17
  * `response` settings
18
18
  * This section is mostly used to setup CORS
19
19
  */
20
20
  // "response": {
21
- // CORS settings sample
21
+ // // CORS settings sample
22
22
  // "header": {
23
23
  // "access-control-allow-origin": "{bundle}@{project}, https://checkout.stripe.com",
24
24
  // "access-control-allow-headers": "X-Requested-With", // To allow AJAX request
@@ -3,7 +3,7 @@
3
3
  // common definitions : will apply for all templates
4
4
  "_common": {
5
5
  // by default, or it will load `layout.html` if exists or `nolayout.html`(from the framework assets)
6
- "layout": "{templatesPath}/html/layout/main.html",
6
+ "layout": "{templatesPath}/html/layouts/main.html",
7
7
  // means that the file name of the template is the same as the route name
8
8
  // You can override it through the routing.json
9
9
  "routeNameAsFilenameEnabled": true,
@@ -26,16 +26,16 @@
26
26
 
27
27
  "home": {
28
28
  // If you want to exclude all global css
29
- //"stylesheetsExcluded": "*",
29
+ //"stylesheetsExcluded": "*",
30
30
  // If you also want to get rid of `gina` definitions, use "**" while excluding
31
-
31
+
32
32
  // local css - Will fetch from {bundle}/public
33
33
  "stylesheets": [
34
34
  {
35
35
  "url": "/css/home.css"
36
36
  }
37
37
  ]
38
-
38
+
39
39
  // If you want to exclude all global js
40
40
  //"javascriptsExcluded": "*"
41
41
  }
@@ -20,7 +20,7 @@ function {Bundle}ContentController() {
20
20
  var data = {
21
21
  msg: appConf.greeting
22
22
  };
23
-
23
+
24
24
  self.renderJSON(data);
25
25
 
26
26
  // use this to render errors