gina 0.1.1-alpha.2 → 0.1.1-alpha.200

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