gina 0.1.1-alpha.16 → 0.1.1-alpha.161

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 (324) hide show
  1. package/AUTHORS +2 -1
  2. package/LICENSE +1 -1
  3. package/README-4Contributors.md +30 -0
  4. package/README.md +202 -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.16/core/template/command/gina.bat.tpl → bin/gina.bat} +0 -0
  10. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/AUTHORS +0 -0
  11. package/framework/{v0.1.1-alpha.16/lib/inherits → v0.1.1-alpha.161}/LICENSE +1 -1
  12. package/framework/v0.1.1-alpha.161/VERSION +1 -0
  13. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/asset/html/nolayout.html +0 -0
  14. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/asset/html/static.html +0 -0
  15. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/asset/img/android-chrome-192x192.png +0 -0
  16. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/asset/img/android-chrome-512x512.png +0 -0
  17. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/asset/img/apple-touch-icon.png +0 -0
  18. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/asset/img/favicon-16x16.png +0 -0
  19. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/asset/img/favicon-32x32.png +0 -0
  20. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/asset/img/favicon.ico +0 -0
  21. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.161/core/asset}/plugin/dist/gina.js +887 -874
  22. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.161/core/asset}/plugin/dist/gina.js.map +3 -3
  23. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.161/core/asset}/plugin/dist/gina.min.css +0 -0
  24. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.161/core/asset}/plugin/dist/gina.min.css.map +0 -0
  25. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/gina.min.js +739 -0
  26. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/gina.min.js.map +8 -0
  27. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.161/core/asset}/plugin/dist/gina.onload.min.js +0 -0
  28. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.161/core/asset}/plugin/dist/gina.onload.min.js.map +0 -0
  29. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/toolbar/css/toolbar-min.css +1 -0
  30. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/toolbar/css/toolbar.css +3 -0
  31. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/toolbar/css/toolbar.css.map +1 -0
  32. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/toolbar/js/jquery-3.1.0.min.js +4 -0
  33. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/toolbar/main.js +1542 -0
  34. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/toolbar/toolbar.html +251 -0
  35. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.161/core/asset}/plugin/readme.md +6 -6
  36. package/framework/{v0.1.1-alpha.16/core/asset/js → v0.1.1-alpha.161/core/asset}/plugin/uuid.json +0 -0
  37. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/config.js +29 -14
  38. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/connectors/couchbase/index.js +331 -222
  39. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/connectors/couchbase/lib/connector.js +6 -4
  40. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/connectors/couchbase/lib/connector.v2.js +47 -47
  41. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/connectors/couchbase/lib/connector.v3.js +0 -0
  42. package/framework/v0.1.1-alpha.161/core/connectors/couchbase/lib/connector.v4.js +384 -0
  43. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/connectors/couchbase/lib/n1ql.js +3 -2
  44. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/connectors/couchbase/lib/session-store.js +6 -5
  45. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  46. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  47. package/framework/v0.1.1-alpha.161/core/connectors/couchbase/lib/session-store.v4.js +362 -0
  48. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/controller/controller.framework.js +0 -0
  49. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/controller/controller.js +691 -677
  50. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/controller/index.js +0 -0
  51. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/busboy/.travis.yml +0 -0
  52. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/busboy/LICENSE +0 -0
  53. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/busboy/README.md +0 -0
  54. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
  55. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/busboy/deps/encoding/encoding.js +0 -0
  56. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/busboy/lib/main.js +0 -0
  57. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/busboy/lib/types/multipart.js +0 -0
  58. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/busboy/lib/types/urlencoded.js +0 -0
  59. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/busboy/lib/utils.js +0 -0
  60. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/busboy/package.json +0 -0
  61. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  62. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/dev/index.js +1 -1
  63. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/dev/lib/class.js +0 -0
  64. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/dev/lib/factory.js +1 -1
  65. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/dev/lib/tools.js +0 -0
  66. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/gna.js +3 -4
  67. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/README.md +0 -0
  68. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/currency.json +0 -0
  69. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/dist/language/en.json +0 -0
  70. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/dist/language/fr.json +0 -0
  71. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/dist/region/en.json +0 -0
  72. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/dist/region/fr.json +0 -0
  73. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/index.js +2 -2
  74. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/src/make.js +0 -0
  75. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/src/resources/currency.csv +0 -0
  76. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/src/resources/region.csv +0 -0
  77. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/locales/src/resources/region.mapping.json +0 -0
  78. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/mime.types +0 -0
  79. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/model/entity.js +81 -61
  80. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/model/index.js +8 -7
  81. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/model/template/entityFactory.js +1 -1
  82. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/model/template/index.js +1 -1
  83. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/README.md +0 -0
  84. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/index.js +1 -1
  85. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/file/README.md +0 -0
  86. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/file/build.json +0 -0
  87. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/file/package.json +1 -1
  88. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/intl/README.md +0 -0
  89. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/intl/build.json +0 -0
  90. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/intl/package.json +1 -1
  91. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/intl/src/main.js +0 -0
  92. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/storage/README.md +0 -0
  93. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/storage/build.json +0 -0
  94. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/storage/package.json +1 -1
  95. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/storage/src/main.js +0 -0
  96. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/validator/README.md +0 -0
  97. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/validator/build.json +0 -0
  98. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/validator/package.json +1 -1
  99. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/validator/src/form-validator.js +0 -0
  100. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/plugins/lib/validator/src/main.js +0 -0
  101. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/router.js +92 -79
  102. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/server.express.js +0 -0
  103. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/server.isaac.js +117 -108
  104. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/server.js +44 -1
  105. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/status.codes +0 -0
  106. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle/config/app.json +0 -0
  107. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle/config/routing.json +0 -0
  108. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle/config/settings.json +0 -0
  109. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
  110. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle/config/templates.json +4 -4
  111. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  112. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  113. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle/controllers/setup.js +0 -0
  114. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle/index.js +0 -0
  115. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  116. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  117. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  118. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  119. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  120. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle_public/readme.md +0 -0
  121. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  122. package/framework/v0.1.1-alpha.161/core/template/boilerplate/bundle_templates/html/content/homepage.html +8 -0
  123. package/framework/v0.1.1-alpha.161/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +11 -0
  124. package/framework/v0.1.1-alpha.161/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +8 -0
  125. package/framework/{v0.1.1-alpha.16/core/template/boilerplate/bundle_templates/html/layout → v0.1.1-alpha.161/core/template/boilerplate/bundle_templates/html/layouts}/main.html +10 -3
  126. package/framework/v0.1.1-alpha.161/core/template/command/gina.bat.tpl +8 -0
  127. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/command/gina.tpl +1 -1
  128. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/conf/env.json +0 -0
  129. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/conf/manifest.json +0 -0
  130. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/conf/package.json +1 -1
  131. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/conf/settings.json +0 -0
  132. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/conf/statics.json +3 -3
  133. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/conf/templates.json +2 -2
  134. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/error/client/json/401.json +0 -0
  135. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/error/client/json/403.json +0 -0
  136. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/error/client/json/404.json +0 -0
  137. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/error/server/html/50x.html +0 -0
  138. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/error/server/json/500.json +0 -0
  139. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/error/server/json/503.json +0 -0
  140. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/core/template/extensions/logger/config.json +0 -0
  141. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/console.js +1 -1
  142. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/context.js +145 -5
  143. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/dateFormat.js +4 -2
  144. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/index.js +10 -5
  145. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/json/README.md +0 -0
  146. package/framework/{v0.1.1-alpha.16/helpers/plugins → v0.1.1-alpha.161/helpers/json}/package.json +1 -1
  147. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/json/src/main.js +22 -22
  148. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/path.js +143 -89
  149. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/plugins/README.md +0 -0
  150. package/framework/{v0.1.1-alpha.16/helpers/json → v0.1.1-alpha.161/helpers/plugins}/package.json +1 -1
  151. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/plugins/src/api-error.js +23 -23
  152. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/plugins/src/main.js +2 -2
  153. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/prototypes.js +35 -36
  154. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/task.js +21 -14
  155. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/helpers/text.js +1 -1
  156. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/archiver/README.md +0 -0
  157. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/archiver/build.json +0 -0
  158. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/archiver/package.json +1 -1
  159. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/archiver/src/dep/jszip.min.js +0 -0
  160. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/archiver/src/main.js +167 -167
  161. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/aliases.json +4 -1
  162. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/add.js +43 -17
  163. package/framework/v0.1.1-alpha.161/lib/cmd/bundle/arguments.json +6 -0
  164. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/copy.js +0 -0
  165. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/cp.js +0 -0
  166. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/help.js +0 -0
  167. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/help.txt +2 -2
  168. package/framework/v0.1.1-alpha.161/lib/cmd/bundle/list.js +176 -0
  169. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/remove.js +22 -22
  170. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/rename.js +0 -0
  171. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/restart.js +0 -0
  172. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/rm.js +0 -0
  173. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/start.js +257 -46
  174. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/status.js +0 -0
  175. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/bundle/stop.js +93 -74
  176. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/env/add.js +0 -0
  177. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/env/get.js +0 -0
  178. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/env/help.js +0 -0
  179. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/env/help.txt +0 -0
  180. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/env/link-dev.js +0 -0
  181. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/env/list.js +0 -0
  182. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/env/remove.js +0 -0
  183. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/env/rm.js +0 -0
  184. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/env/set.js +0 -0
  185. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/env/unset.js +0 -0
  186. package/framework/{v0.1.1-alpha.16/lib/cmd/scope → v0.1.1-alpha.161/lib/cmd/env}/use.js +21 -1
  187. package/framework/v0.1.1-alpha.161/lib/cmd/framework/build.js +85 -0
  188. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/dot.js +0 -0
  189. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/get.js +0 -0
  190. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/help.js +0 -0
  191. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/help.txt +0 -0
  192. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/init.js +212 -21
  193. package/framework/v0.1.1-alpha.161/lib/cmd/framework/link-node-modules.js +86 -0
  194. package/framework/v0.1.1-alpha.161/lib/cmd/framework/link.js +94 -0
  195. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/msg.json +0 -0
  196. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/open.js +15 -0
  197. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/restart.js +58 -26
  198. package/framework/v0.1.1-alpha.161/lib/cmd/framework/set.js +264 -0
  199. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/start.js +35 -12
  200. package/framework/v0.1.1-alpha.161/lib/cmd/framework/status.js +138 -0
  201. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/stop.js +44 -28
  202. package/framework/v0.1.1-alpha.161/lib/cmd/framework/tail.js +271 -0
  203. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/update.js +0 -0
  204. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/framework/version.js +12 -3
  205. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/gina-dev.1.md +0 -0
  206. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/gina-framework.1.md +0 -0
  207. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/gina.1.md +0 -0
  208. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/helper.js +74 -5
  209. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/index.js +22 -22
  210. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/msg.json +0 -0
  211. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/port/help.js +0 -0
  212. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/port/help.txt +0 -0
  213. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/port/inc/scan.js +32 -17
  214. package/framework/v0.1.1-alpha.161/lib/cmd/port/list.js +446 -0
  215. package/framework/v0.1.1-alpha.161/lib/cmd/port/reset.js +426 -0
  216. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/port/set.js +0 -0
  217. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/add.js +146 -122
  218. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/arguments.json +0 -0
  219. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/build.js +0 -0
  220. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/help.js +0 -0
  221. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/help.txt +0 -0
  222. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/import.js +0 -0
  223. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/list.js +16 -2
  224. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/move.js +0 -0
  225. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/remove.js +17 -17
  226. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/rename.js +0 -0
  227. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/restart.js +0 -0
  228. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/rm.js +0 -0
  229. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/start.js +0 -0
  230. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/status.js +0 -0
  231. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/project/stop.js +0 -0
  232. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/protocol/help.js +0 -0
  233. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/protocol/help.txt +0 -0
  234. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/protocol/list.js +0 -0
  235. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/protocol/set.js +239 -201
  236. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/scope/help.js +0 -0
  237. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/scope/help.txt +0 -0
  238. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/scope/link-local.js +0 -0
  239. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/scope/list.js +0 -0
  240. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/scope/remove.js +0 -0
  241. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/scope/rm.js +0 -0
  242. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/scope/set.js +0 -0
  243. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/scope/unset.js +0 -0
  244. package/framework/{v0.1.1-alpha.16/lib/cmd/env → v0.1.1-alpha.161/lib/cmd/scope}/use.js +0 -0
  245. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cmd/view/add.js +34 -9
  246. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/collection/README.md +0 -0
  247. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/collection/build.json +0 -0
  248. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/collection/package.json +1 -1
  249. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/collection/src/main.js +0 -0
  250. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/config.js +2 -1
  251. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cron/README.md +0 -0
  252. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cron/package.json +1 -1
  253. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/cron/src/main.js +0 -0
  254. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/generator/index.js +1 -1
  255. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/index.js +1 -1
  256. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161/lib/inherits}/LICENSE +1 -1
  257. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/inherits/README.md +0 -0
  258. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  259. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/inherits/example/protected_inheritance.js +0 -0
  260. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/inherits/example/simple_inheritance.js +0 -0
  261. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  262. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/inherits/package.json +1 -1
  263. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/inherits/src/main.js +1 -1
  264. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/README.md +0 -0
  265. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/package.json +1 -1
  266. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/src/containers/default/index.js +13 -2
  267. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/src/containers/file/index.js +105 -14
  268. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  269. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  270. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/src/containers/mq/index.js +2 -1
  271. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/src/containers/mq/listener.js +16 -14
  272. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/src/containers/mq/speaker.js +32 -3
  273. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/src/helper.js +20 -1
  274. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/logger/src/main.js +5 -2
  275. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/math/index.js +7 -7
  276. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/merge/README.md +0 -0
  277. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/merge/example/merge.js +0 -0
  278. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/merge/example/merge_2_literal objects.js +0 -0
  279. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/merge/example/merge_and_preserve_first.js +0 -0
  280. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/merge/package.json +1 -1
  281. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/merge/src/main.js +0 -0
  282. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/model.js +9 -9
  283. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/proc.js +75 -47
  284. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/routing/README.md +0 -0
  285. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/routing/build.json +0 -0
  286. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/routing/package.json +1 -1
  287. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/routing/src/main.js +258 -258
  288. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/session-store.js +6 -6
  289. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/shell.js +3 -3
  290. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/swig-filters/README.md +0 -0
  291. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/swig-filters/package.json +1 -1
  292. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/swig-filters/src/main.js +55 -52
  293. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/url/README.md +0 -0
  294. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/url/index.js +0 -0
  295. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/url/mocks.json +0 -0
  296. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/url/routing.json +0 -0
  297. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/url/test.js +0 -0
  298. package/framework/{v0.1.1-alpha.16 → v0.1.1-alpha.161}/lib/validator.js +0 -0
  299. package/framework/v0.1.1-alpha.161/package.json +14 -0
  300. package/package.json +33 -24
  301. package/resources/home/main.json +44 -1
  302. package/resources/home/settings.json +7 -0
  303. package/resources/home/user/extensions/logger/default/config.json +1 -1
  304. package/resources/package.json.template +29 -18
  305. package/script/post_install.js +410 -120
  306. package/script/post_publish.js +185 -0
  307. package/script/pre_install.js +424 -76
  308. package/script/prepare_version.js +152 -22
  309. package/utils/helper.js +230 -185
  310. package/utils/prototypes.js +9 -9
  311. package/utils/prototypes.json_clone.js +31 -31
  312. package/doc/framework/cli/doc.json +0 -9
  313. package/doc/framework/index.md +0 -60
  314. package/framework/v0.1.1-alpha.16/VERSION +0 -1
  315. package/framework/v0.1.1-alpha.16/core/asset/js/plugin/dist/gina.min.js +0 -736
  316. package/framework/v0.1.1-alpha.16/core/asset/js/plugin/dist/gina.min.js.map +0 -56
  317. package/framework/v0.1.1-alpha.16/core/template/boilerplate/bundle_templates/html/homepage.html +0 -4
  318. package/framework/v0.1.1-alpha.16/lib/cmd/bundle/arguments.json +0 -4
  319. package/framework/v0.1.1-alpha.16/lib/cmd/bundle/list.js +0 -129
  320. package/framework/v0.1.1-alpha.16/lib/cmd/framework/set.js +0 -161
  321. package/framework/v0.1.1-alpha.16/lib/cmd/framework/status.js +0 -72
  322. package/framework/v0.1.1-alpha.16/lib/cmd/framework/tail.js +0 -183
  323. package/framework/v0.1.1-alpha.16/lib/cmd/port/list.js +0 -176
  324. package/framework/v0.1.1-alpha.16/package.json +0 -14
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * This file is part of the gina package.
3
- * Copyright (c) 2009-2022 Rhinostone <contact@gina.io>
3
+ * Copyright (c) 2009-2023 Rhinostone <contact@gina.io>
4
4
  *
5
5
  * For the full copyright and license information, please view the LICENSE
6
6
  * file that was distributed with this source code.
@@ -21,10 +21,10 @@ function Routing() {
21
21
  allowedMethods: ['get', 'post', 'put', 'delete'],
22
22
  reservedParams: ['controle', 'file','title', 'namespace', 'path'],
23
23
  notFound: {}
24
- };
25
-
24
+ };
25
+
26
26
  self.allowedMethodsString = self.allowedMethods.join(',');
27
-
27
+
28
28
  // loading utils & plugins
29
29
  var plugins = null, inherits = null, merge = null, Validator = null, fs = null, promisify = null;
30
30
  if (!isGFFCtx) {
@@ -34,8 +34,8 @@ function Routing() {
34
34
  merge = require('../../merge');
35
35
  plugins = require(__dirname+'/../../../core/plugins') || getContext('gina').plugins;
36
36
  Validator = plugins.Validator;
37
-
38
- }
37
+
38
+ }
39
39
  // BO - In case of partial rendering whithout handler defined for the partial
40
40
  else {
41
41
  if ( !merge || typeof(merge) != 'function' ) {
@@ -44,16 +44,16 @@ function Routing() {
44
44
  if ( !Validator || typeof(Validator) != 'function' ) {
45
45
  var Validator = require('utils/form-validator');
46
46
  }
47
- }
47
+ }
48
48
  // EO - In case of partial rendering whithout handler defined for the partial
49
-
49
+
50
50
  /**
51
51
  * Get url props
52
52
  * Used to retrieve additional properties for routes with redirect flag for example
53
- *
53
+ *
54
54
  * @param {string} [bundle]
55
- * @param {string} [env]
56
- *
55
+ * @param {string} [env]
56
+ *
57
57
  * @returns {object} urlProps - { .host, .hostname, .webroot }
58
58
  */
59
59
  self.getUrlProps = function(bundle, env) {
@@ -69,7 +69,7 @@ function Routing() {
69
69
  urlProps.hostname = _route.hostname;
70
70
  urlProps.host = _route.host;
71
71
  urlProps.webroot = _route.webroot;
72
- }
72
+ }
73
73
  } else {
74
74
  config = getContext('gina').config;
75
75
  if ( typeof(getContext('argvFilename')) != 'undefined' ) {
@@ -81,47 +81,47 @@ function Routing() {
81
81
  if ( typeof(env) == 'undefined' ) {
82
82
  env = config.env;
83
83
  }
84
-
84
+
85
85
  urlProps.hostname = config.envConf[bundle][env].hostname;
86
86
  urlProps.host = config.envConf[bundle][env].host;
87
87
  urlProps.webroot = config.envConf[bundle][env].server.webroot;
88
88
  }
89
-
89
+
90
90
  return urlProps;
91
91
  }
92
-
92
+
93
93
  /**
94
94
  * Load bundle routing configuration
95
- *
95
+ *
96
96
  * @param {object} options
97
97
  * {
98
98
  * isStadalone: false,
99
99
  * bundle: 'default', // bundle's name
100
100
  * wroot: '/', // by default
101
- *
101
+ *
102
102
  * }
103
- *
103
+ *
104
104
  */
105
105
  // self.loadBundleRoutingConfiguration = function(options, filename) {
106
-
106
+
107
107
  // }
108
-
108
+
109
109
  /**
110
110
  * Get routing
111
- *
111
+ *
112
112
  * @param {string} [bundle]
113
113
  */
114
114
  // self.getRouting = function(bundle) {
115
-
115
+
116
116
  // }
117
-
117
+
118
118
  /**
119
119
  * Get reversed routing
120
- *
120
+ *
121
121
  * @param {string} [bundle]
122
122
  */
123
123
  // self.getReverseRouting = function(bundle) {
124
-
124
+
125
125
  // }
126
126
 
127
127
  /**
@@ -136,7 +136,7 @@ function Routing() {
136
136
  * @returns {object|false} foundRoute
137
137
  * */
138
138
  self.compareUrls = async function(params, url, request, response, next) {
139
-
139
+
140
140
  if ( typeof(request) == 'undefined' ) {
141
141
  request = { routing: {} };
142
142
  }
@@ -190,12 +190,12 @@ function Routing() {
190
190
  *
191
191
  * */
192
192
  var parseRouting = async function(params, url, request, response, next) {
193
-
193
+
194
194
  // Sample debug break for specific rule
195
195
  // if ( params.rule == 'my-specific-rule@bundle' ) {
196
196
  // console.debug('passed '+ params.rule);
197
197
  // }
198
-
198
+
199
199
  var uRe = params.url.split(/\//)
200
200
  , uRo = url.split(/\//)
201
201
  , uReCount = 0
@@ -206,30 +206,30 @@ function Routing() {
206
206
  , i = 0
207
207
  , method = request.method.toLowerCase()
208
208
  ;
209
-
209
+
210
210
  // TODO - remove comments
211
211
  // when requirement is not listed but still validated
212
- // if (
213
- // typeof(params.requirements) != 'undefined'
212
+ // if (
213
+ // typeof(params.requirements) != 'undefined'
214
214
  // && method == params.method.toLowerCase()
215
215
  // //&& /validator\:\:/.test(JSON.stringify(params.requirements))
216
216
  // ) {
217
-
217
+
218
218
  // var requiremements = Object.getOwnPropertyNames(params.requirements);
219
219
  // var r = 0;
220
220
  // // In order to filter variables
221
221
  // var uRoVars = uRo.join(',').match(/\:[-_a-z0-9]+/g);
222
222
  // // var uRoVarCount = (uRoVars) ? uRoVars.length : 0;
223
223
  // while ( r < requiremements.length ) {
224
-
224
+
225
225
  // // if not listed, but still needing validation
226
- // if (
227
- // typeof(params.param[ requiremements[r] ]) == 'undefined'
226
+ // if (
227
+ // typeof(params.param[ requiremements[r] ]) == 'undefined'
228
228
  // && /^validator\:\:/i.test(params.requirements[ requiremements[r] ])
229
229
  // && typeof(request[method][ requiremements[r] ])
230
230
  // ) {
231
231
  // if (uRo.length != uRe.length) {
232
- // // r++;
232
+ // // r++;
233
233
  // // continue;
234
234
  // break;
235
235
  // }
@@ -239,22 +239,22 @@ function Routing() {
239
239
  // * "requirements" : {
240
240
  // * "email": "validator::{ isEmail: true, isString: [7] }"
241
241
  // * }
242
- // *
242
+ // *
243
243
  // * e.g.: result = new Validator('routing', _data, null, {email: {isEmail: true, subject: \"Anything\"}} ).isEmail().valid;
244
- // */
244
+ // */
245
245
  // let regex = params.requirements[ requiremements[r] ];
246
246
  // let _data = {}, _ruleObj = {}, _rule = {};
247
-
247
+
248
248
  // try {
249
249
  // _ruleObj = JSON.parse(
250
250
  // regex.split(/::/).splice(1)[0]
251
251
  // .replace(/([^\:\"\s+](\w+))\:/g, '"$1":') // { query: { validIf: true }} => { "query": { "validIf": true }}
252
252
  // .replace(/([^\:\"\s+](\w+))\s+\:/g, '"$1":') // note the space between `validIf` & `:` { query: { validIf : true }} => { "query": { "validIf": true }}
253
- // );
253
+ // );
254
254
  // } catch (err) {
255
255
  // throw err;
256
256
  // }
257
-
257
+
258
258
  // let key = requiremements[r];
259
259
  // // validator.query case
260
260
  // if (typeof(_ruleObj.query) != 'undefined' && typeof(_ruleObj.query.data) != 'undefined') {
@@ -268,7 +268,7 @@ function Routing() {
268
268
  // for (let p = 0, pLen = uRo.length; p < pLen; p++) {
269
269
  // // :variable only
270
270
  // if (!/^\:/.test(uRo[p])) continue;
271
-
271
+
272
272
  // let pName = uRo[p].replace(/^\:/, '');
273
273
  // if ( pName != '' && typeof(uRe[p]) != 'undefined' ) {
274
274
  // _data[ pName ] = uRe[p];
@@ -278,24 +278,24 @@ function Routing() {
278
278
  // request.params[pName] = uRe[p];
279
279
  // }
280
280
  // }
281
- // }
281
+ // }
282
282
  // }
283
283
  // // normal case
284
284
  // _data = merge(_data, request[method]);
285
-
285
+
286
286
  // if ( typeof(_data[key]) == 'undefined' ) {
287
287
  // // init default value for unlisted variable/param
288
288
  // _data[key] = null;
289
289
  // }
290
-
291
- // _rule[key] = _ruleObj;
290
+
291
+ // _rule[key] = _ruleObj;
292
292
  // _validator = new Validator('routing', _data, null, _rule );
293
-
293
+
294
294
  // if (_ruleObj.count() == 0 ) {
295
295
  // console.error('Route validation failed '+ params.rule);
296
296
  // return false;
297
297
  // }
298
-
298
+
299
299
  // for (let rule in _ruleObj) {
300
300
  // let _result = null;
301
301
  // if (Array.isArray(_ruleObj[rule])) { // has args
@@ -313,12 +313,12 @@ function Routing() {
313
313
  // r++
314
314
  // }
315
315
  // }
316
-
316
+
317
317
  // attaching routing description for this request
318
318
  var paramMethod = params.method.toLowerCase();
319
-
319
+
320
320
  var hasAlreadyBeenScored = false;
321
- if (
321
+ if (
322
322
  typeof(params.requirements) != 'undefined'
323
323
  && /get|delete/i.test(method)
324
324
  && typeof(request[method]) != 'undefined'
@@ -327,20 +327,20 @@ function Routing() {
327
327
  typeof(params.requirements) != 'undefined'
328
328
  && /get/i.test(method)
329
329
  && /delete/i.test(paramMethod)
330
- ) {
330
+ ) {
331
331
  if ( /get/i.test(method) && /delete/i.test(paramMethod) ) {
332
332
  method = paramMethod;
333
333
  }
334
334
  // `delete` methods don't have a body
335
335
  // So, request.delete is {} by default
336
- if ( /^(delete)$/i.test(method) && uRe.length === uRo.length ) {
336
+ if ( /^(delete)$/i.test(method) && uRe.length === uRo.length ) {
337
337
  // just in case
338
338
  if ( typeof(request[method]) == 'undefined' ) {
339
339
  request[method] = {};
340
340
  }
341
341
  for (let p = 0, pLen = uRo.length; p < pLen; p++) {
342
- if (uRe[p] === uRo[p]) {
343
- ++score;
342
+ if (uRe[p] === uRo[p]) {
343
+ ++score;
344
344
  continue;
345
345
  }
346
346
  let _key = uRo[p].substr(1);
@@ -355,44 +355,44 @@ function Routing() {
355
355
  continue;
356
356
  }
357
357
  if (
358
- /^:/.test(uRo[p])
358
+ /^:/.test(uRo[p])
359
359
  && typeof(condition) != 'undefined'
360
360
  && new RegExp(condition).test(uRe[p])
361
361
  ) {
362
- ++score;
363
- request[method][uRo[p].substr(1)] = uRe[p];
362
+ ++score;
363
+ request[method][uRo[p].substr(1)] = uRe[p];
364
364
  }
365
365
  }
366
- hasAlreadyBeenScored = true;
367
- }
368
-
366
+ hasAlreadyBeenScored = true;
367
+ }
368
+
369
369
  // Sample debug break for specific rule
370
370
  // if ( params.rule == 'my-specific-rule@bundle' ) {
371
371
  // console.debug('passed '+ params.rule);
372
372
  // }
373
373
  for (let p in request[method]) {
374
374
  if ( typeof(params.requirements[p]) != 'undefined' && uRo.indexOf(':' + p) < 0 ) {
375
- uRo[uRoCount] = ':' + p;
375
+ uRo[uRoCount] = ':' + p;
376
376
  ++uRoCount;
377
-
377
+
378
378
  uRe[uReCount] = request[method][p];
379
379
  ++uReCount;
380
380
  if (!hasAlreadyBeenScored && uRe.length === uRo.length)
381
- ++maxLen;
381
+ ++maxLen;
382
382
  }
383
383
  }
384
384
  }
385
-
386
-
385
+
386
+
387
387
  // Sample debug break for specific rule
388
388
  // if ( params.rule == 'my-specific-rule@bundle' ) {
389
389
  // console.debug('passed '+ params.rule);
390
390
  // }
391
-
391
+
392
392
  if (!hasAlreadyBeenScored && uRe.length === uRo.length) {
393
-
393
+
394
394
  for (; i < maxLen; ++i) {
395
-
395
+
396
396
  if (uRe[i] === uRo[i]) {
397
397
  ++score;
398
398
  }
@@ -401,15 +401,15 @@ function Routing() {
401
401
  }
402
402
  }
403
403
  }
404
-
404
+
405
405
  // This test is done to catch `validator::` rules under requirements
406
- if (
407
- typeof(params.requirements) != 'undefined'
406
+ if (
407
+ typeof(params.requirements) != 'undefined'
408
408
  && method == params.method.toLowerCase()
409
409
  && !hasAlreadyBeenScored
410
410
  && score >= maxLen
411
411
  ) {
412
-
412
+
413
413
  var requiremements = Object.getOwnPropertyNames(params.requirements);
414
414
  var r = 0;
415
415
  // In order to filter variables
@@ -419,12 +419,12 @@ function Routing() {
419
419
  // requirement name as `key`
420
420
  let key = requiremements[r];
421
421
  // if not listed, but still needing validation
422
- if (
423
- typeof(params.param[ key ]) == 'undefined'
422
+ if (
423
+ typeof(params.param[ key ]) == 'undefined'
424
424
  && /^validator\:\:/i.test(params.requirements[ key ])
425
425
  ) {
426
426
  if (uRo.length != uRe.length) {
427
- // r++;
427
+ // r++;
428
428
  // continue;
429
429
  break;
430
430
  }
@@ -434,22 +434,22 @@ function Routing() {
434
434
  * "requirements" : {
435
435
  * "email": "validator::{ isEmail: true, isString: [7] }"
436
436
  * }
437
- *
437
+ *
438
438
  * e.g.: result = new Validator('routing', _data, null, {email: {isEmail: true, subject: \"Anything\"}} ).isEmail().valid;
439
- */
439
+ */
440
440
  let regex = params.requirements[ key ];
441
441
  let _data = {}, _ruleObj = {}, _rule = {};
442
-
442
+
443
443
  try {
444
444
  _ruleObj = JSON.parse(
445
445
  regex.split(/::/).splice(1)[0]
446
446
  .replace(/([^\:\"\s+](\w+))\:/g, '"$1":') // { query: { validIf: true }} => { "query": { "validIf": true }}
447
447
  .replace(/([^\:\"\s+](\w+))\s+\:/g, '"$1":') // note the space between `validIf` & `:` { query: { validIf : true }} => { "query": { "validIf": true }}
448
- );
448
+ );
449
449
  } catch (err) {
450
450
  throw err;
451
451
  }
452
-
452
+
453
453
  // validator.query case
454
454
  if (typeof(_ruleObj.query) != 'undefined' && typeof(_ruleObj.query.data) != 'undefined') {
455
455
  _data = _ruleObj.query.data;
@@ -462,7 +462,7 @@ function Routing() {
462
462
  for (let p = 0, pLen = uRo.length; p < pLen; p++) {
463
463
  // :variable only
464
464
  if (!/^\:/.test(uRo[p])) continue;
465
-
465
+
466
466
  let pName = uRo[p].replace(/^\:/, '');
467
467
  if ( pName != '' && typeof(uRe[p]) != 'undefined' ) {
468
468
  _data[ pName ] = uRe[p];
@@ -472,9 +472,9 @@ function Routing() {
472
472
  request.params[pName] = uRe[p];
473
473
  }
474
474
  }
475
- }
475
+ }
476
476
  }
477
-
477
+
478
478
  // If validator.query has data, _data should inherit from request data
479
479
  _data = merge(_data, JSON.clone(request[method]) || {} );
480
480
  // This test is to initialize query.data[key] to null by default
@@ -482,20 +482,20 @@ function Routing() {
482
482
  // init default value for unlisted variable/param
483
483
  _data[key] = null;
484
484
  }
485
-
486
- _rule[key] = _ruleObj;
485
+
486
+ _rule[key] = _ruleObj;
487
487
  if (!isGFFCtx) {
488
488
  _validator = new Validator('routing', _data, null, _rule );
489
489
  } else {
490
490
  _validator = new Validator(_data);
491
491
  }
492
-
492
+
493
493
  if (_ruleObj.count() == 0 ) {
494
494
  console.error('Route validation failed '+ params.rule);
495
495
  --score;
496
496
  r++;
497
497
  continue;
498
- }
498
+ }
499
499
  // for each validation rule
500
500
  for (let rule in _ruleObj) {
501
501
  // updating query.data
@@ -507,8 +507,8 @@ function Routing() {
507
507
  _result = await _validator[key][rule].apply(_validator[key], _ruleObj[rule]);
508
508
  } else {
509
509
  _result = await _validator[key][rule](_ruleObj[rule], request, response, next);
510
- }
511
-
510
+ }
511
+
512
512
  //let condition = _ruleObj[rule].validIf.replace(new RegExp('\\$isValid'), _result.isValid);
513
513
  // if ( eval(condition)) {
514
514
  if ( !_result.isValid ) {
@@ -524,7 +524,7 @@ function Routing() {
524
524
  }
525
525
 
526
526
  foundRoute.past = (score === maxLen) ? true : false;
527
-
527
+
528
528
  if (foundRoute.past) {
529
529
  // attaching routing description for this request
530
530
  //request.routing = params; // can be retried in controller with: req.routing
@@ -532,7 +532,7 @@ function Routing() {
532
532
  request.routing = checkRouteParams(params, request[method]);
533
533
  foundRoute.request = request;
534
534
  }
535
-
535
+
536
536
 
537
537
  return foundRoute;
538
538
  };
@@ -563,7 +563,7 @@ function Routing() {
563
563
  , flags = null
564
564
  , key = null
565
565
  , tested = false
566
-
566
+
567
567
  , _validator = null
568
568
  , _data = null
569
569
  , _ruleObj = null
@@ -573,57 +573,57 @@ function Routing() {
573
573
  // request method
574
574
  , requestMethod = request.method.toLowerCase()
575
575
  ;
576
-
576
+
577
577
  if (!_param.length) return false;
578
578
 
579
579
  // if custom path, path rewrite
580
580
  if (params.param.path && regex.test(params.param.path)) {
581
581
  params.param.path = params.param.path.replace(regex, urlVal);
582
582
  }
583
-
583
+
584
584
  // if custom namespace, namespace rewrite
585
- if (params.param.namespace && regex.test(params.param.namespace)) {
586
- params.param.namespace = params.param.namespace.replace(regex, urlVal);
585
+ if (params.param.namespace && regex.test(params.param.namespace)) {
586
+ params.param.namespace = params.param.namespace.replace(regex, urlVal);
587
587
  }
588
-
588
+
589
589
  // if custom file, file rewrite
590
- // if (params.param.file && regex.test(params.param.file)) {
591
- // params.param.file = params.param.file.replace(regex, urlVal);
590
+ // if (params.param.file && regex.test(params.param.file)) {
591
+ // params.param.file = params.param.file.replace(regex, urlVal);
592
592
  // }
593
593
  // file is handle like url replacement (path is like pathname)
594
594
  if (typeof (params.param.file) != 'undefined' && /:/.test(params.param.file)) {
595
- var _regex = new RegExp('(:'+urlVar+'/|:'+urlVar+'$)', 'g');
596
- replacement.variable = urlVal;
595
+ var _regex = new RegExp('(:'+urlVar+'/|:'+urlVar+'$)', 'g');
596
+ replacement.variable = urlVal;
597
597
  params.param.file = params.param.file.replace( _regex, replacement );
598
598
  }
599
599
 
600
600
  // if custom title, title rewrite
601
- if (params.param.title && regex.test(params.param.title)) {
601
+ if (params.param.title && regex.test(params.param.title)) {
602
602
  params.param.title = params.param.title.replace(regex, urlVal);
603
603
  }
604
604
 
605
605
  if (_param.length == 1) { // fast one
606
-
606
+
607
607
  re = new RegExp( _param[0]);
608
608
  matched = (_param.indexOf(urlVar) > -1) ? _param.indexOf(urlVar) : false;
609
-
609
+
610
610
  if (matched === false ) {
611
611
  // In order to support rules defined like :
612
612
  // { params.url } => `/section/:name/page:number`
613
613
  // { request.url } => `/section/plante/page4`
614
614
  //
615
615
  // with keys = [ ":name", ":number" ]
616
-
616
+
617
617
  if ( urlVar.match(re) ) {
618
618
  matched = 0;
619
619
  }
620
620
  }
621
-
621
+
622
622
 
623
623
  if (matched === false) return matched;
624
624
  // filter on method
625
625
  if (params.method.toLowerCase() !== requestMethod) return false;
626
-
626
+
627
627
  if ( typeof(request[requestMethod]) == 'undefined' ) {
628
628
  request[requestMethod] = {}
629
629
  }
@@ -635,7 +635,7 @@ function Routing() {
635
635
  regex = params.requirements[key];
636
636
  if (/^\//.test(regex)) {
637
637
  re = regex.match(/\/(.*)\//).pop();
638
- flags = regex.replace('/' + re + '/', '');
638
+ flags = regex.replace('/' + re + '/', '');
639
639
 
640
640
  tested = new RegExp(re, flags).test(urlVal)
641
641
  } else if ( /^validator\:\:/.test(regex) && urlVal) {
@@ -644,11 +644,11 @@ function Routing() {
644
644
  * "id" : "/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i",
645
645
  * "email": "validator::{ isEmail: true, isString: [7] }"
646
646
  * }
647
- *
647
+ *
648
648
  * e.g.: tested = new Validator('routing', _data, null, {email: {isEmail: true, subject: \"Anything\"}} ).isEmail().valid;
649
- */
650
- _data = {}; _ruleObj = {}; _rule = {}; str = '';
651
- urlVar.replace( new RegExp('[^'+ key +']','g'), function(){ str += arguments[0] });
649
+ */
650
+ _data = {}; _ruleObj = {}; _rule = {}; str = '';
651
+ urlVar.replace( new RegExp('[^'+ key +']','g'), function(){ str += arguments[0] });
652
652
  _data[key] = urlVal.replace( new RegExp(str, 'g'), '');
653
653
  try {
654
654
  //_ruleObj = JSON.parse(regex.split(/::/).splice(1)[0].replace(/([^\W+ true false])+(\w+)/g, '"$&"'));
@@ -656,11 +656,11 @@ function Routing() {
656
656
  regex.split(/::/).splice(1)[0]
657
657
  .replace(/([^\:\"\s+](\w+))\:/g, '"$1":') // { query: { validIf: true }} => { "query": { "validIf": true }}
658
658
  .replace(/([^\:\"\s+](\w+))\s+\:/g, '"$1":') // note the space between `validIf` & `:` { query: { validIf : true }} => { "query": { "validIf": true }}
659
- );
659
+ );
660
660
  } catch (err) {
661
661
  throw err;
662
662
  }
663
- //_ruleObj = JSON.parse(regex.split(/::/).splice(1)[0].replace(/([^\W+ true false])+(\w+)/g, '"$&"'));
663
+ //_ruleObj = JSON.parse(regex.split(/::/).splice(1)[0].replace(/([^\W+ true false])+(\w+)/g, '"$&"'));
664
664
  if (typeof(_ruleObj.query) != 'undefined' && typeof(_ruleObj.query.data) != 'undefined') {
665
665
  // since we only have one param
666
666
  // :var1 == :var1
@@ -670,7 +670,7 @@ function Routing() {
670
670
  request.params[key] = _data[key];
671
671
  }
672
672
  }
673
- _rule[key] = _ruleObj;
673
+ _rule[key] = _ruleObj;
674
674
  _validator = new Validator('routing', _data, null, _rule );
675
675
  if (_ruleObj.count() == 0 ) {
676
676
  console.error('Route validation failed '+ params.rule);
@@ -681,7 +681,7 @@ function Routing() {
681
681
  await _validator[key][rule].apply(_validator[key], _ruleObj[rule]);
682
682
  } else {
683
683
  await _validator[key][rule](_ruleObj[rule], request, response, next);
684
- }
684
+ }
685
685
  }
686
686
  tested = _validator.isValid();
687
687
  } else {
@@ -694,7 +694,7 @@ function Routing() {
694
694
  typeof(params.requirements[key]) != 'undefined' &&
695
695
  typeof(request.params) != 'undefined' &&
696
696
  tested
697
- ) {
697
+ ) {
698
698
  request.params[key] = urlVal;
699
699
  if ( typeof(request[requestMethod][key]) == 'undefined' ) {
700
700
  request[requestMethod][key] = urlVal;
@@ -744,22 +744,22 @@ function Routing() {
744
744
  * "id" : "/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i",
745
745
  * "email": "validator::{ isEmail: true, isString: [7] }"
746
746
  * }
747
- *
747
+ *
748
748
  * e.g.: tested = new Validator('routing', _data, null, {email: {isEmail: true}} ).isEmail().valid;
749
- */
750
- _data = {}; _ruleObj = {}; _rule = {}; str = '';
751
- urlVar.replace( new RegExp('[^'+ key[0] +']','g'), function(){ str += arguments[0] });
749
+ */
750
+ _data = {}; _ruleObj = {}; _rule = {}; str = '';
751
+ urlVar.replace( new RegExp('[^'+ key[0] +']','g'), function(){ str += arguments[0] });
752
752
  _data[key[0]] = urlVal.replace( new RegExp(str, 'g'), '');
753
- _ruleObj = JSON.parse(regex.split(/::/).splice(1)[0].replace(/([^\W+ true false])+(\w+)/g, '"$&"'));
754
- _rule[key[0]] = _ruleObj;
753
+ _ruleObj = JSON.parse(regex.split(/::/).splice(1)[0].replace(/([^\W+ true false])+(\w+)/g, '"$&"'));
754
+ _rule[key[0]] = _ruleObj;
755
755
  _validator = new Validator('routing', _data, null, _rule );
756
-
756
+
757
757
  for (let rule in _ruleObj) {
758
758
  if (Array.isArray(_ruleObj[rule])) { // has args
759
759
  _validator[key[0]][rule].apply(_validator[key[0]], _ruleObj[rule])
760
760
  } else {
761
761
  _validator[key[0]][rule](_ruleObj[rule])
762
- }
762
+ }
763
763
  }
764
764
  tested = _validator.isValid();
765
765
  } else {
@@ -817,9 +817,9 @@ function Routing() {
817
817
 
818
818
  return false
819
819
  }
820
-
820
+
821
821
  var replacement = function(matched){
822
- return ( /\/$/.test(matched) ? replacement.variable+ '/': replacement.variable )
822
+ return ( /\/$/.test(matched) ? replacement.variable+ '/': replacement.variable )
823
823
  };
824
824
  var checkRouteParams = function(route, params) {
825
825
  var variable = null
@@ -833,14 +833,14 @@ function Routing() {
833
833
  ;
834
834
  for (p in route.param) {
835
835
  if ( typeof(params) != 'undefined' && typeof(params[p]) == 'undefined' ) continue;
836
-
836
+
837
837
  if ( /^:/.test(route.param[p]) ) {
838
838
  variable = route.param[p].substr(1);
839
-
839
+
840
840
  if ( typeof(params) != 'undefined' && typeof(params[variable]) != 'undefined' ) {
841
-
842
- regex = new RegExp('(:'+variable+'/|:'+variable+'$)', 'g');
843
-
841
+
842
+ regex = new RegExp('(:'+variable+'/|:'+variable+'$)', 'g');
843
+
844
844
 
845
845
  if ( typeof(route.param.path) != 'undefined' && /:/.test(route.param.path) ) {
846
846
  route.param.path = route.param.path.replace( regex, params[variable]);
@@ -853,28 +853,28 @@ function Routing() {
853
853
  }
854
854
  // file is handle like url replacement (path is like pathname)
855
855
  if (typeof (route.param.file) != 'undefined' && /:/.test(route.param.file)) {
856
- replacement.variable = params[variable];
856
+ replacement.variable = params[variable];
857
857
  route.param.file = route.param.file.replace( regex, replacement );
858
858
  }
859
-
860
- if ( /\,/.test(route.url) ) {
859
+
860
+ if ( /\,/.test(route.url) ) {
861
861
  urls = route.url.split(/\,/g);
862
862
  i = 0; len = urls.length;
863
863
  for (; i < len; ++i) {
864
- replacement.variable = params[variable];
864
+ replacement.variable = params[variable];
865
865
  urls[i] = urls[i].replace( regex, replacement );
866
866
  }
867
867
  route.url = urls.join(',');
868
- } else {
869
- replacement.variable = params[variable];
868
+ } else {
869
+ replacement.variable = params[variable];
870
870
  route.url = route.url.replace( regex, replacement );
871
871
  }
872
872
  }
873
873
  }
874
874
  }
875
-
875
+
876
876
  // Selecting url in case of multiple urls & optional requirmements
877
- if ( urls ) {
877
+ if ( urls ) {
878
878
  i = 0; len = urls.length;
879
879
  var rawUrlVars = null
880
880
  , rawUrlScore = null
@@ -901,8 +901,8 @@ function Routing() {
901
901
  route.urlIndex = i;
902
902
  }
903
903
  }
904
- }
905
-
904
+ }
905
+
906
906
  return route;
907
907
  }
908
908
 
@@ -916,7 +916,7 @@ function Routing() {
916
916
  * @returns {object} route
917
917
  * */
918
918
  self.getRoute = function(rule, params, urlIndex) {
919
-
919
+
920
920
  var config = null;
921
921
  if (isGFFCtx) {
922
922
  config = window.gina.config;
@@ -926,13 +926,13 @@ function Routing() {
926
926
  config.getRouting = getContext('gina').Config.instance.getRouting;
927
927
  }
928
928
  }
929
-
929
+
930
930
  var env = config.env || GINA_ENV // by default, takes the current bundle
931
931
  , envTmp = null
932
932
  //, scheme = null
933
933
  , bundle = config.bundle // by default, takes the current bundle
934
934
  ;
935
-
935
+
936
936
  if ( !/\@/.test(rule) && typeof(bundle) != 'undefined' && bundle != null) {
937
937
  rule = rule.toLowerCase()
938
938
  rule += '@' + bundle
@@ -957,8 +957,8 @@ function Routing() {
957
957
 
958
958
  rule = arr[0].toLowerCase() +'@'+ bundle;
959
959
  }
960
-
961
-
960
+
961
+
962
962
  var routing = config.getRouting(bundle, env);
963
963
 
964
964
  if ( typeof(routing[rule]) == 'undefined' ) {
@@ -981,14 +981,14 @@ function Routing() {
981
981
  delete route.urlIndex;
982
982
  }
983
983
  urlIndex = ( typeof(urlIndex) != 'undefined' ) ? urlIndex : 0;
984
- route.url = route.url.split(/,/g)[urlIndex];
984
+ route.url = route.url.split(/,/g)[urlIndex];
985
985
  }
986
986
  // fix url in case of empty param value allowed by the routing rule
987
987
  // to prevent having a folder.
988
988
  // eg.: {..., id: '/^\\s*$/'} => {..., id: ''} => /path/to/ becoming /path/to
989
989
  if ( /\/$/.test(route.url) && route.url != '/' )
990
990
  route.url = route.url.substr(0, route.url.length-1);
991
-
991
+
992
992
  // Completeting url with extra params e.g.: ?param1=val1&param2=val2
993
993
  if ( /GET/i.test(route.method) && typeof(params) != 'undefined' ) {
994
994
  var queryParams = '?', maskedUrl = routing[rule].url;
@@ -999,46 +999,46 @@ function Routing() {
999
999
  if (typeof(params[r]) != 'undefined' )
1000
1000
  queryParams += r +'='+ encodeURIComponent(params[r])+ '&';
1001
1001
  }
1002
-
1002
+
1003
1003
  if (queryParams.length > 1) {
1004
1004
  queryParams = queryParams.substring(0, queryParams.length-1);
1005
1005
  route.url += queryParams;
1006
1006
  }
1007
1007
  }
1008
-
1008
+
1009
1009
  // recommanded for x-bundle coms
1010
1010
  // leave `ignoreWebRoot` empty or set it to false for x-bundle coms
1011
1011
  route.toUrl = function (ignoreWebRoot) {
1012
-
1012
+
1013
1013
  var urlProps = null;
1014
1014
  if ( /^redirect$/i.test(this.param.control) ) {
1015
1015
  urlProps = self.getUrlProps(this.bundle, (env||GINA_ENV));
1016
1016
  }
1017
-
1017
+
1018
1018
  var wroot = this.webroot || urlProps.webroot
1019
1019
  , hostname = this.hostname || urlProps.hostname
1020
1020
  , path = this.url
1021
1021
  ;
1022
-
1022
+
1023
1023
  this.url = ( typeof(ignoreWebRoot) != 'undefined' && ignoreWebRoot == true ) ? path.replace(wroot, '/') : path;
1024
1024
 
1025
1025
  return hostname + this.url
1026
1026
  };
1027
-
1027
+
1028
1028
  /**
1029
1029
  * request current url
1030
- *
1031
- *
1032
- *
1030
+ *
1031
+ *
1032
+ *
1033
1033
  * @param {boolean} [ignoreWebRoot]
1034
1034
  * @param {object} [options] - see: https://nodejs.org/api/https.html#https_new_agent_options
1035
1035
  * @param {object} [_this] - current context: only used when `promisify`is used
1036
- *
1036
+ *
1037
1037
  * @callback {callback} [cb] - see: https://nodejs.org/api/https.html#https_new_agent_options
1038
1038
  * @param {object} res
1039
1039
  */
1040
1040
  route.request = function(ignoreWebRoot, options) {
1041
-
1041
+
1042
1042
  var cb = null, _this = null;
1043
1043
  if ( typeof(arguments[arguments.length-1]) == 'function' ) {
1044
1044
  cb = arguments[arguments.length-1];
@@ -1046,14 +1046,14 @@ function Routing() {
1046
1046
  if ( typeof(arguments[2]) == 'object' ) {
1047
1047
  _this = arguments[2];
1048
1048
  }
1049
-
1049
+
1050
1050
  var wroot = this.webroot || _this.webroot
1051
1051
  , hostname = this.hostname || _this.hostname
1052
1052
  , url = ( typeof(ignoreWebRoot) != 'undefined' && ignoreWebRoot == true ) ? path.replace(wroot, '/') : this.url || _this.url
1053
1053
  ;
1054
-
1054
+
1055
1055
  var scheme = ( /^https/.test(hostname) ) ? 'https' : 'http';
1056
-
1056
+
1057
1057
  if (isGFFCtx) {
1058
1058
  var target = ( typeof(options) != 'undefined' && typeof(options.target) != 'undefined' ) ? options.target : "_self";
1059
1059
  window.open(url, target)
@@ -1063,11 +1063,11 @@ function Routing() {
1063
1063
  // create an agent just for this request
1064
1064
  options.agent = false;
1065
1065
  }
1066
- var agent = require(''+scheme);
1067
- var onAgentResponse = function(res) {
1068
-
1066
+ var agent = require(''+scheme);
1067
+ var onAgentResponse = function(res) {
1068
+
1069
1069
  var data = '', err = false;
1070
-
1070
+
1071
1071
  res.on('data', function (chunk) {
1072
1072
  data += chunk;
1073
1073
  });
@@ -1091,26 +1091,26 @@ function Routing() {
1091
1091
  err = parseError
1092
1092
  }
1093
1093
  }
1094
- if (err) {
1094
+ if (err) {
1095
1095
  cb(err);
1096
1096
  return;
1097
1097
  }
1098
-
1098
+
1099
1099
  cb(false, data);
1100
1100
  return;
1101
1101
  });
1102
1102
  }
1103
- if (cb) {
1103
+ if (cb) {
1104
1104
  agent.get(url, options, onAgentResponse);
1105
1105
  } else {
1106
1106
  // just throw the request without waiting/handling response
1107
1107
  agent.get(url, options);
1108
- }
1108
+ }
1109
1109
  }
1110
- return;
1111
-
1110
+ return;
1111
+
1112
1112
  } // EO route.request()
1113
-
1113
+
1114
1114
  if ( /\:/.test(route.url) ) {
1115
1115
  var paramList = route.url
1116
1116
  .match(/(\:(.*)\/|\:(.*)$)/g)
@@ -1134,21 +1134,21 @@ function Routing() {
1134
1134
  // adding hash if found
1135
1135
  if (hash)
1136
1136
  url += hash;
1137
-
1137
+
1138
1138
  route.url = url;
1139
1139
  // recommanded for x-bundle coms
1140
1140
  // leave `ignoreWebRoot` empty or set it to false for x-bundle coms
1141
- route.toUrl = function (ignoreWebRoot) {
1141
+ route.toUrl = function (ignoreWebRoot) {
1142
1142
  var wroot = this.webroot
1143
1143
  , hostname = this.hostname
1144
1144
  , path = this.url
1145
1145
  ;
1146
-
1146
+
1147
1147
  this.url = ( typeof(ignoreWebRoot) != 'undefined' && ignoreWebRoot == true ) ? path.replace(wroot, '/') : path;
1148
1148
 
1149
1149
  return hostname + this.url
1150
1150
  };
1151
-
1151
+
1152
1152
  return route
1153
1153
  }
1154
1154
 
@@ -1161,18 +1161,18 @@ function Routing() {
1161
1161
  * @param {string} url e.g.: /webroot/some/url/path or http
1162
1162
  * @param {string} [bundle] targeted bundle
1163
1163
  * @param {string} [method] request method (GET|PUT|PUT|DELETE) - GET is set by default
1164
- * @param {object} [request]
1164
+ * @param {object} [request]
1165
1165
  * @param {boolean} [isOverridinMethod] // will replace request.method by the provided method - Used for redirections
1166
- *
1166
+ *
1167
1167
  * @returns {object|boolean} route - when route is found; `false` when not found
1168
1168
  * */
1169
-
1169
+
1170
1170
  self.getRouteByUrl = function (url, bundle, method, request, isOverridinMethod) {
1171
-
1171
+
1172
1172
  if (
1173
- arguments.length == 2
1174
- && typeof(arguments[1]) != 'undefined'
1175
- && self.allowedMethods.indexOf(arguments[1].toLowerCase()) > -1
1173
+ arguments.length == 2
1174
+ && typeof(arguments[1]) != 'undefined'
1175
+ && self.allowedMethods.indexOf(arguments[1].toLowerCase()) > -1
1176
1176
  ) {
1177
1177
  method = arguments[1];
1178
1178
  bundle = undefined;
@@ -1185,24 +1185,24 @@ function Routing() {
1185
1185
  , hostname = null
1186
1186
  , host = null
1187
1187
  ;
1188
-
1188
+
1189
1189
  if ( /\#/.test(url) && url.length > 1 ) {
1190
1190
  var urlPart = url.split(/\#/);
1191
1191
  url = urlPart[0];
1192
1192
  hash = '#' + urlPart[1];
1193
-
1193
+
1194
1194
  urlPart = null;
1195
1195
  }
1196
-
1196
+
1197
1197
  // fast method
1198
1198
  if (
1199
- arguments.length == 1
1200
- && typeof(arguments[0]) != 'undefined'
1199
+ arguments.length == 1
1200
+ && typeof(arguments[0]) != 'undefined'
1201
1201
  ) {
1202
1202
  if ( !/^(https|http)/i.test(url) && !/^\//.test(url)) {
1203
1203
  url = '/'+ url;
1204
1204
  }
1205
-
1205
+
1206
1206
  webroot = '/' + url.split(/\//g)[1];
1207
1207
  if (isGFFCtx) {
1208
1208
  reverseRouting = gina.config.reverseRouting;
@@ -1216,24 +1216,24 @@ function Routing() {
1216
1216
  host = infos.host;
1217
1217
  hostname = infos.hostname;
1218
1218
  infos = null;
1219
- }
1219
+ }
1220
1220
  }
1221
-
1221
+
1222
1222
  isOverridinMethod = ( typeof(arguments[arguments.length-1]) != 'boolean') ? false : arguments[arguments.length-1];
1223
1223
 
1224
- var matched = false
1224
+ var matched = false
1225
1225
  , config = null
1226
1226
  , env = null
1227
1227
  , prefix = null
1228
1228
  , pathname = null
1229
1229
  , params = null
1230
1230
  , isRoute = null
1231
- , foundRoute = null
1232
- , routeObj = null
1231
+ , foundRoute = null
1232
+ , routeObj = null
1233
1233
  ;
1234
-
1235
-
1236
-
1234
+
1235
+
1236
+
1237
1237
  var isMethodProvidedByDefault = ( typeof(method) != 'undefined' ) ? true : false;
1238
1238
 
1239
1239
  if (isGFFCtx) {
@@ -1257,18 +1257,18 @@ function Routing() {
1257
1257
  } else {
1258
1258
 
1259
1259
  var gnaCtx = getContext('gina');
1260
-
1260
+
1261
1261
  config = gnaCtx.config;
1262
1262
  bundle = (typeof (bundle) != 'undefined') ? bundle : config.bundle;
1263
1263
  env = config.env;
1264
1264
  routing = config.getRouting(bundle);
1265
-
1266
-
1265
+
1266
+
1267
1267
 
1268
1268
  hostname = config.envConf[bundle][env].hostname;
1269
1269
  webroot = config.envConf[bundle][env].server.webroot;
1270
1270
  prefix = hostname + webroot;
1271
-
1271
+
1272
1272
  if ( !request ) {
1273
1273
  request = {
1274
1274
  routing: {},
@@ -1288,11 +1288,11 @@ function Routing() {
1288
1288
  if ( typeof(request.routing.path) == 'undefined' )
1289
1289
  request.routing.path = unescape(pathname);
1290
1290
  method = ( typeof(method) != 'undefined' ) ? method.toLowerCase() : 'get';
1291
-
1291
+
1292
1292
  if (isMethodProvidedByDefault) {
1293
1293
  // to handle 303 redirect like PUT -> GET
1294
1294
  request.originalMethod = request.method;
1295
-
1295
+
1296
1296
  request.method = method;
1297
1297
  request.routing.path = unescape(pathname)
1298
1298
  }
@@ -1302,8 +1302,8 @@ function Routing() {
1302
1302
 
1303
1303
  // getting params
1304
1304
  params = {};
1305
-
1306
-
1305
+
1306
+
1307
1307
 
1308
1308
  var paramsList = null;
1309
1309
  var re = new RegExp(method, 'i');
@@ -1318,13 +1318,13 @@ function Routing() {
1318
1318
  if (routing[name].bundle != bundle) continue;
1319
1319
 
1320
1320
  // method filter
1321
- localMethod = routing[name].method;
1321
+ localMethod = routing[name].method;
1322
1322
  if ( /\,/.test( localMethod ) && re.test(localMethod) ) {
1323
1323
  localMethod = request.method
1324
- }
1324
+ }
1325
1325
  if (typeof (routing[name].method) != 'undefined' && !re.test(localMethod)) continue;
1326
-
1327
- //Preparing params to relay to the core/router.
1326
+
1327
+ //Preparing params to relay to the core/router.
1328
1328
  params = {
1329
1329
  method : localMethod,
1330
1330
  requirements : routing[name].requirements,
@@ -1340,8 +1340,8 @@ function Routing() {
1340
1340
 
1341
1341
  // normal case
1342
1342
  //Parsing for the right url.
1343
- try {
1344
-
1343
+ try {
1344
+
1345
1345
  isRoute = self.compareUrls(params, routing[name].url, request);
1346
1346
 
1347
1347
  if (isRoute.past) {
@@ -1361,96 +1361,96 @@ function Routing() {
1361
1361
  } //EO for break out
1362
1362
 
1363
1363
  if (!matched) {
1364
- if (isGFFCtx) {
1365
- var urlHasChanged = false;
1366
- if (
1367
- url == '#'
1368
- && /GET/i.test(method)
1369
- && isMethodProvidedByDefault
1364
+ if (isGFFCtx) {
1365
+ var urlHasChanged = false;
1366
+ if (
1367
+ url == '#'
1368
+ && /GET/i.test(method)
1369
+ && isMethodProvidedByDefault
1370
1370
  || /^404\:/.test(url)
1371
1371
  ) {
1372
1372
  url = location.pathname;
1373
1373
  urlHasChanged = true;
1374
1374
  }
1375
-
1375
+
1376
1376
  if ( typeof(self.notFound) == 'undefined' ) {
1377
1377
  self.notFound = {}
1378
1378
  }
1379
-
1379
+
1380
1380
  var notFound = null, msg = '[ RoutingHelper::getRouteByUrl(rule[, bundle, method]) ] : route [ %r ] is called but not found inside your view: `' + url + '` !';
1381
1381
  if ( gina.hasPopinHandler && gina.popinIsBinded ) {
1382
1382
  notFound = gina.popin.getActivePopin().target.innerHTML.match(/404\:\[\w+\][a-z 0-9-_@]+/);
1383
1383
  } else {
1384
1384
  notFound = document.body.innerHTML.match(/404\:\[\w+\][a-z 0-9-_@]+/);
1385
1385
  }
1386
-
1386
+
1387
1387
  notFound = (notFound && notFound.length > 0) ? notFound[0] : null;
1388
-
1388
+
1389
1389
  if ( notFound && isMethodProvidedByDefault && urlHasChanged ) {
1390
-
1391
- var m = notFound.match(/\[\w+\]/)[0];
1392
-
1390
+
1391
+ var m = notFound.match(/\[\w+\]/)[0];
1392
+
1393
1393
  notFound = notFound.replace('404:'+m, m.replace(/\[|\]/g, '')+'::' );
1394
-
1394
+
1395
1395
  msg = msg.replace(/\%r/, notFound.replace(/404\:\s+/, ''));
1396
-
1396
+
1397
1397
  if (typeof(self.notFound[notFound]) == 'undefined') {
1398
- self.notFound[notFound] = {
1398
+ self.notFound[notFound] = {
1399
1399
  count: 1,
1400
- message: msg
1400
+ message: msg
1401
1401
  };
1402
1402
  } else if ( isMethodProvidedByDefault && typeof(self.notFound[notFound]) != 'undefined' ) {
1403
1403
  ++self.notFound[notFound].count;
1404
1404
  }
1405
-
1406
- return false
1407
- }
1408
-
1409
- notFound = null;
1410
-
1411
- var altRule = gina.config.reverseRouting[url] || null;
1405
+
1406
+ return false
1407
+ }
1408
+
1409
+ notFound = null;
1410
+
1411
+ var altRule = gina.config.reverseRouting[url] || null;
1412
1412
  if (
1413
- !notFound
1413
+ !notFound
1414
1414
  && altRule
1415
1415
  && typeof(altRule) != 'undefined'
1416
1416
  && altRule.split(/\@(.+)$/)[1] == bundle
1417
1417
  ) {
1418
-
1418
+
1419
1419
  notFound = altRule;
1420
1420
  if ( typeof(self.notFound[notFound]) == 'undefined' ) {
1421
-
1421
+
1422
1422
  msg = msg.replace(/\%r/, method.toUpperCase() +'::'+ altRule);
1423
-
1424
- self.notFound[notFound] = {
1423
+
1424
+ self.notFound[notFound] = {
1425
1425
  count: 1,
1426
- message: msg
1426
+ message: msg
1427
1427
  };
1428
- //console.warn(msg);
1428
+ //console.warn(msg);
1429
1429
  } else if ( isMethodProvidedByDefault && typeof(self.notFound[notFound]) != 'undefined' ) {
1430
1430
  ++self.notFound[notFound].count;
1431
1431
  }
1432
-
1432
+
1433
1433
  return false
1434
1434
  }
1435
-
1435
+
1436
1436
  // forms
1437
1437
  var altRoute = self.compareUrls(params, url, request) || null;
1438
1438
  if(altRoute.past && isMethodProvidedByDefault) {
1439
1439
  notFound = method.toUpperCase() +'::'+ altRoute.request.routing.rule;
1440
1440
  if ( typeof(self.notFound[notFound]) == 'undefined' ) {
1441
1441
  msg = msg.replace(/\%r/, notFound);
1442
- //console.warn(msg);
1442
+ //console.warn(msg);
1443
1443
  } else {
1444
1444
  ++self.notFound[notFound].count;
1445
1445
  }
1446
-
1446
+
1447
1447
  return false
1448
- }
1448
+ }
1449
1449
  return false
1450
1450
  }
1451
1451
 
1452
-
1453
- console.warn( new Error('[ RoutingHelper::getRouteByUrl(rule[, bundle, method, request]) ] : route not found for url: `' + url + '` !').stack );
1452
+
1453
+ console.warn( new Error('[ RoutingHelper::getRouteByUrl(rule[, bundle, method, request]) ] : route not found for url: `' + url + '` !').stack );
1454
1454
  return false;
1455
1455
  } else {
1456
1456
  // fix url in case of empty param value allowed by the routing rule
@@ -1461,21 +1461,21 @@ function Routing() {
1461
1461
  // adding hash if found
1462
1462
  if (hash)
1463
1463
  url += hash;
1464
-
1464
+
1465
1465
  route.url = url;
1466
1466
  // recommanded for x-bundle coms
1467
1467
  // leave `ignoreWebRoot` empty or set it to false for x-bundle coms
1468
- route.toUrl = function (ignoreWebRoot) {
1468
+ route.toUrl = function (ignoreWebRoot) {
1469
1469
  var wroot = this.webroot
1470
1470
  , hostname = this.hostname
1471
1471
  , path = this.url
1472
1472
  ;
1473
-
1473
+
1474
1474
  this.url = ( typeof(ignoreWebRoot) != 'undefined' && ignoreWebRoot == true ) ? path.replace(wroot, '/') : path;
1475
-
1475
+
1476
1476
  return hostname + this.url
1477
1477
  };
1478
-
1478
+
1479
1479
  return route
1480
1480
  }
1481
1481
  }
@@ -1487,6 +1487,6 @@ if ((typeof (module) !== 'undefined') && module.exports) {
1487
1487
  // Publish as node.js module
1488
1488
  module.exports = Routing()
1489
1489
  } else if (typeof (define) === 'function' && define.amd) {
1490
- // Publish as AMD module
1490
+ // Publish as AMD module
1491
1491
  define('utils/routing', ['require', 'utils/form-validator', 'utils/merge'], function() { return Routing() })
1492
1492
  }