gina 0.1.1-alpha.99 → 0.1.2-alpha.1

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/LICENSE +1 -1
  2. package/README-4Contributors.md +30 -0
  3. package/README.md +125 -39
  4. package/bin/cli +130 -41
  5. package/bin/cli-debug +46 -15
  6. package/bin/cmd +63 -41
  7. package/bin/gina +57 -49
  8. package/framework/{v0.1.1-alpha.99/lib/inherits → v0.1.2-alpha.1}/LICENSE +1 -1
  9. package/framework/v0.1.2-alpha.1/VERSION +1 -0
  10. package/framework/{v0.1.1-alpha.99/core/asset/js/plugin/readme.md → v0.1.2-alpha.1/core/asset/plugin/README.md} +34 -12
  11. package/framework/v0.1.2-alpha.1/core/asset/plugin/dist/vendor/gina/css/gina.min.css +1 -0
  12. package/framework/v0.1.2-alpha.1/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
  13. package/framework/v0.1.2-alpha.1/core/asset/plugin/dist/vendor/gina/html/toolbar.html +251 -0
  14. package/framework/{v0.1.1-alpha.99/core/asset/js/plugin/dist → v0.1.2-alpha.1/core/asset/plugin/dist/vendor/gina/js}/gina.js +4588 -3416
  15. package/framework/v0.1.2-alpha.1/core/asset/plugin/dist/vendor/gina/js/gina.min.js +765 -0
  16. package/framework/v0.1.2-alpha.1/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
  17. package/framework/v0.1.2-alpha.1/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +7 -0
  18. package/framework/v0.1.2-alpha.1/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
  19. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/config.js +315 -131
  20. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/connectors/couchbase/index.js +460 -274
  21. package/framework/v0.1.2-alpha.1/core/connectors/couchbase/lib/connector.js +22 -0
  22. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/connectors/couchbase/lib/connector.v2.js +51 -51
  23. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/connectors/couchbase/lib/connector.v3.js +51 -51
  24. package/framework/v0.1.2-alpha.1/core/connectors/couchbase/lib/connector.v4.js +384 -0
  25. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/connectors/couchbase/lib/n1ql.js +3 -2
  26. package/framework/v0.1.2-alpha.1/core/connectors/couchbase/lib/session-store.js +22 -0
  27. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/connectors/couchbase/lib/session-store.v3.js +12 -12
  28. package/framework/v0.1.2-alpha.1/core/connectors/couchbase/lib/session-store.v4.js +361 -0
  29. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/controller/controller.js +1351 -902
  30. package/framework/v0.1.2-alpha.1/core/controller/index.js +23 -0
  31. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/dev/index.js +1 -1
  32. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/dev/lib/class.js +1 -1
  33. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/dev/lib/factory.js +2 -2
  34. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/gna.js +48 -24
  35. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/locales/README.md +5 -0
  36. package/framework/v0.1.2-alpha.1/core/locales/dist/region/en.json +5727 -0
  37. package/framework/v0.1.2-alpha.1/core/locales/dist/region/fr.json +11452 -0
  38. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/locales/index.js +2 -2
  39. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/locales/src/make.js +39 -41
  40. package/framework/v0.1.2-alpha.1/core/locales/src/resources/region.mapping.json +43 -0
  41. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/model/entity.js +87 -67
  42. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/model/index.js +16 -16
  43. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/model/template/entityFactory.js +1 -1
  44. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/model/template/index.js +17 -15
  45. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/index.js +1 -1
  46. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/file/package.json +1 -1
  47. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/intl/package.json +1 -1
  48. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/intl/src/main.js +5 -5
  49. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/storage/package.json +1 -1
  50. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/storage/src/main.js +6 -5
  51. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/validator/package.json +1 -1
  52. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/validator/src/form-validator.js +404 -300
  53. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/validator/src/main.js +1384 -1314
  54. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/router.js +221 -122
  55. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/server.express.js +69 -65
  56. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/server.isaac.js +274 -180
  57. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/server.js +710 -615
  58. package/framework/v0.1.2-alpha.1/core/template/boilerplate/bundle/config/settings.json +12 -0
  59. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/config/settings.server.json +4 -4
  60. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/config/templates.json +4 -4
  61. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/controllers/controller.content.js +1 -1
  62. package/framework/v0.1.2-alpha.1/core/template/boilerplate/bundle/controllers/setup.js +111 -0
  63. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/index.js +13 -1
  64. package/framework/v0.1.2-alpha.1/core/template/boilerplate/bundle_templates/html/content/homepage.html +8 -0
  65. package/framework/v0.1.2-alpha.1/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +11 -0
  66. package/framework/v0.1.2-alpha.1/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +8 -0
  67. package/framework/{v0.1.1-alpha.99/core/template/boilerplate/bundle_templates/html/layout → v0.1.2-alpha.1/core/template/boilerplate/bundle_templates/html/layouts}/main.html +10 -3
  68. package/framework/v0.1.2-alpha.1/core/template/command/gina.bat.tpl +8 -0
  69. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/command/gina.tpl +4 -4
  70. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/conf/env.json +12 -0
  71. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/conf/manifest.json +2 -0
  72. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/conf/package.json +2 -2
  73. package/framework/v0.1.2-alpha.1/core/template/conf/statics.json +12 -0
  74. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/conf/templates.json +9 -9
  75. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/console.js +3 -3
  76. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/context.js +233 -75
  77. package/framework/v0.1.2-alpha.1/helpers/data/LICENSE +9 -0
  78. package/framework/v0.1.2-alpha.1/helpers/data/README.md +12 -0
  79. package/framework/v0.1.2-alpha.1/helpers/data/package.json +20 -0
  80. package/framework/v0.1.2-alpha.1/helpers/data/src/main.js +295 -0
  81. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/dateFormat.js +9 -7
  82. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/index.js +13 -8
  83. package/framework/v0.1.2-alpha.1/helpers/json/LICENSE +9 -0
  84. package/framework/v0.1.2-alpha.1/helpers/json/README.md +12 -0
  85. package/framework/{v0.1.1-alpha.99/helpers/plugins → v0.1.2-alpha.1/helpers/json}/package.json +2 -2
  86. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/json/src/main.js +33 -28
  87. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/path.js +97 -22
  88. package/framework/{v0.1.1-alpha.99/helpers/json → v0.1.2-alpha.1/helpers/plugins}/package.json +2 -2
  89. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/plugins/src/api-error.js +23 -23
  90. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/plugins/src/main.js +3 -3
  91. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/prototypes.js +46 -38
  92. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/text.js +2 -2
  93. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/archiver/package.json +1 -1
  94. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/archiver/src/dep/jszip.min.js +3 -3
  95. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/archiver/src/main.js +183 -168
  96. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/aliases.json +4 -1
  97. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/add.js +84 -28
  98. package/framework/v0.1.2-alpha.1/lib/cmd/bundle/arguments.json +8 -0
  99. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/help.txt +4 -2
  100. package/framework/v0.1.2-alpha.1/lib/cmd/bundle/list.js +175 -0
  101. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/remove.js +39 -27
  102. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/restart.js +14 -8
  103. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/start.js +283 -49
  104. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/stop.js +93 -74
  105. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/env/add.js +87 -49
  106. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/env/list.js +26 -4
  107. package/framework/{v0.1.1-alpha.99/lib/cmd/scope → v0.1.2-alpha.1/lib/cmd/env}/remove.js +29 -24
  108. package/framework/v0.1.2-alpha.1/lib/cmd/env/use.js +106 -0
  109. package/framework/v0.1.2-alpha.1/lib/cmd/framework/build.js +93 -0
  110. package/framework/v0.1.2-alpha.1/lib/cmd/framework/init.js +932 -0
  111. package/framework/v0.1.2-alpha.1/lib/cmd/framework/link-node-modules.js +123 -0
  112. package/framework/v0.1.2-alpha.1/lib/cmd/framework/link.js +132 -0
  113. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/open.js +25 -1
  114. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/restart.js +78 -26
  115. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/set.js +120 -40
  116. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/start.js +49 -20
  117. package/framework/v0.1.2-alpha.1/lib/cmd/framework/status.js +144 -0
  118. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/stop.js +64 -31
  119. package/framework/v0.1.2-alpha.1/lib/cmd/framework/tail.js +303 -0
  120. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/version.js +19 -4
  121. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/helper.js +357 -53
  122. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/index.js +23 -23
  123. package/framework/v0.1.2-alpha.1/lib/cmd/port/inc/scan.js +142 -0
  124. package/framework/v0.1.2-alpha.1/lib/cmd/port/list.js +464 -0
  125. package/framework/v0.1.2-alpha.1/lib/cmd/port/reset.js +417 -0
  126. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/add.js +344 -157
  127. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/arguments.json +2 -1
  128. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/build.js +28 -28
  129. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/help.txt +7 -1
  130. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/list.js +22 -2
  131. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/remove.js +19 -17
  132. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/rename.js +11 -11
  133. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/protocol/set.js +260 -211
  134. package/framework/v0.1.2-alpha.1/lib/cmd/scope/add.js +129 -0
  135. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/scope/help.txt +4 -4
  136. package/framework/{v0.1.1-alpha.99/lib/cmd/env/use.js → v0.1.2-alpha.1/lib/cmd/scope/link-production.js} +22 -21
  137. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/scope/list.js +34 -11
  138. package/framework/v0.1.2-alpha.1/lib/cmd/scope/remove.js +122 -0
  139. package/framework/v0.1.2-alpha.1/lib/cmd/scope/use.js +68 -0
  140. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/view/add.js +35 -10
  141. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/collection/package.json +1 -1
  142. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/collection/src/main.js +247 -244
  143. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/config.js +33 -31
  144. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cron/package.json +1 -1
  145. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cron/src/main.js +16 -11
  146. package/framework/v0.1.2-alpha.1/lib/domain/LICENSE +9 -0
  147. package/framework/v0.1.2-alpha.1/lib/domain/README.md +46 -0
  148. package/framework/v0.1.2-alpha.1/lib/domain/dist/public_suffix_list.dat +14186 -0
  149. package/framework/v0.1.2-alpha.1/lib/domain/package.json +20 -0
  150. package/framework/v0.1.2-alpha.1/lib/domain/src/main.js +442 -0
  151. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/generator/index.js +5 -5
  152. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/index.js +3 -2
  153. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1/lib/inherits}/LICENSE +1 -1
  154. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/inherits/README.md +2 -2
  155. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/inherits/package.json +3 -4
  156. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/inherits/src/main.js +3 -3
  157. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/package.json +2 -2
  158. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/src/containers/default/index.js +15 -2
  159. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/src/containers/file/index.js +109 -14
  160. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/src/containers/mq/index.js +12 -3
  161. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/src/containers/mq/listener.js +29 -21
  162. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/src/containers/mq/speaker.js +33 -4
  163. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/src/helper.js +22 -1
  164. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/src/main.js +36 -9
  165. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/math/index.js +9 -9
  166. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/merge/README.md +2 -2
  167. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/merge/package.json +1 -1
  168. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/merge/src/main.js +118 -91
  169. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/model.js +10 -10
  170. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/proc.js +92 -49
  171. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/routing/package.json +1 -1
  172. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/routing/src/main.js +377 -420
  173. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/session-store.js +13 -7
  174. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/shell.js +3 -3
  175. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/swig-filters/package.json +1 -1
  176. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/swig-filters/src/main.js +140 -119
  177. package/framework/v0.1.2-alpha.1/lib/url/README.md +0 -0
  178. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/validator.js +2 -2
  179. package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/package.json +1 -1
  180. package/package.json +10 -10
  181. package/resources/home/main.json +39 -5
  182. package/resources/home/settings.json +8 -0
  183. package/resources/package.json.template +1 -1
  184. package/script/lib.js +0 -0
  185. package/script/post_install.js +179 -89
  186. package/script/pre_install.js +95 -12
  187. package/services/.gna/67fdf1b224a2ed5597e63d4b64283834468e05e3.txt +0 -0
  188. package/services/.gna/arch +1 -0
  189. package/services/.gna/locals.json +14 -0
  190. package/services/.gna/platform +1 -0
  191. package/services/configure +6 -0
  192. package/services/env.json +18 -0
  193. package/services/manifest.json +30 -0
  194. package/services/package.json +11 -0
  195. package/services/src/proxy/config/app.json +6 -0
  196. package/services/src/proxy/config/routing.json +11 -0
  197. package/services/src/proxy/config/settings.json +9 -0
  198. package/services/src/proxy/config/settings.server.json +31 -0
  199. package/services/src/proxy/config/statics.json +3 -0
  200. package/services/src/proxy/controllers/controller.content.js +58 -0
  201. package/services/src/proxy/controllers/controller.js +30 -0
  202. package/{framework/v0.1.1-alpha.99/core/template/boilerplate/bundle → services/src/proxy}/controllers/setup.js +14 -14
  203. package/services/src/proxy/index.js +31 -0
  204. package/services/src/proxy/lib/domain/README.md +48 -0
  205. package/services/src/proxy/lib/domain/src/config/public_suffix_list.dat +14186 -0
  206. package/services/src/toolbar/config/app.json +6 -0
  207. package/services/src/toolbar/config/routing.json +11 -0
  208. package/{framework/v0.1.1-alpha.99/core/template/boilerplate/bundle → services/src/toolbar}/config/settings.json +0 -0
  209. package/services/src/toolbar/config/settings.server.json +30 -0
  210. package/services/src/toolbar/controllers/controller.content.js +39 -0
  211. package/services/src/toolbar/controllers/controller.js +30 -0
  212. package/services/src/toolbar/controllers/setup.js +111 -0
  213. package/services/src/toolbar/index.js +43 -0
  214. package/utils/helper.js +25 -156
  215. package/utils/prototypes.js +9 -9
  216. package/utils/prototypes.json_clone.js +70 -37
  217. package/framework/v0.1.1-alpha.99/VERSION +0 -1
  218. package/framework/v0.1.1-alpha.99/core/asset/js/plugin/dist/gina.js.map +0 -56
  219. package/framework/v0.1.1-alpha.99/core/asset/js/plugin/dist/gina.min.css +0 -1
  220. package/framework/v0.1.1-alpha.99/core/asset/js/plugin/dist/gina.min.css.map +0 -1
  221. package/framework/v0.1.1-alpha.99/core/asset/js/plugin/dist/gina.min.js +0 -736
  222. package/framework/v0.1.1-alpha.99/core/asset/js/plugin/dist/gina.min.js.map +0 -56
  223. package/framework/v0.1.1-alpha.99/core/asset/js/plugin/dist/gina.onload.min.js +0 -5
  224. package/framework/v0.1.1-alpha.99/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
  225. package/framework/v0.1.1-alpha.99/core/connectors/couchbase/lib/connector.js +0 -20
  226. package/framework/v0.1.1-alpha.99/core/connectors/couchbase/lib/session-store.js +0 -21
  227. package/framework/v0.1.1-alpha.99/core/controller/index.js +0 -27
  228. package/framework/v0.1.1-alpha.99/core/locales/dist/region/en.json +0 -9492
  229. package/framework/v0.1.1-alpha.99/core/locales/dist/region/fr.json +0 -9492
  230. package/framework/v0.1.1-alpha.99/core/locales/src/resources/region.mapping.json +0 -28
  231. package/framework/v0.1.1-alpha.99/core/template/boilerplate/bundle_templates/html/homepage.html +0 -4
  232. package/framework/v0.1.1-alpha.99/core/template/conf/statics.json +0 -10
  233. package/framework/v0.1.1-alpha.99/lib/cmd/bundle/arguments.json +0 -4
  234. package/framework/v0.1.1-alpha.99/lib/cmd/bundle/list.js +0 -129
  235. package/framework/v0.1.1-alpha.99/lib/cmd/env/remove.js +0 -150
  236. package/framework/v0.1.1-alpha.99/lib/cmd/framework/init.js +0 -541
  237. package/framework/v0.1.1-alpha.99/lib/cmd/framework/status.js +0 -72
  238. package/framework/v0.1.1-alpha.99/lib/cmd/framework/tail.js +0 -184
  239. package/framework/v0.1.1-alpha.99/lib/cmd/port/inc/scan.js +0 -108
  240. package/framework/v0.1.1-alpha.99/lib/cmd/port/list.js +0 -176
  241. package/framework/v0.1.1-alpha.99/lib/cmd/scope/set.js +0 -57
  242. package/framework/v0.1.1-alpha.99/lib/cmd/scope/unset.js +0 -44
  243. package/framework/v0.1.1-alpha.99/lib/cmd/scope/use.js +0 -79
  244. package/script/post_publish.js +0 -185
  245. package/script/prepare_version.js +0 -552
  246. /package/{framework/v0.1.1-alpha.99/core/template/command/gina.bat.tpl → bin/gina.bat} +0 -0
  247. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/AUTHORS +0 -0
  248. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/asset/html/nolayout.html +0 -0
  249. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/asset/html/static.html +0 -0
  250. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/asset/img/android-chrome-192x192.png +0 -0
  251. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/asset/img/android-chrome-512x512.png +0 -0
  252. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/asset/img/apple-touch-icon.png +0 -0
  253. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/asset/img/favicon-16x16.png +0 -0
  254. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/asset/img/favicon-32x32.png +0 -0
  255. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/asset/img/favicon.ico +0 -0
  256. /package/framework/{v0.1.1-alpha.99/core/asset/js → v0.1.2-alpha.1/core/asset}/plugin/uuid.json +0 -0
  257. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  258. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/controller/controller.framework.js +0 -0
  259. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/busboy/.travis.yml +0 -0
  260. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/busboy/LICENSE +0 -0
  261. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/busboy/README.md +0 -0
  262. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
  263. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/busboy/deps/encoding/encoding.js +0 -0
  264. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/busboy/lib/main.js +0 -0
  265. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/busboy/lib/types/multipart.js +0 -0
  266. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/busboy/lib/types/urlencoded.js +0 -0
  267. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/busboy/lib/utils.js +0 -0
  268. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/busboy/package.json +0 -0
  269. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  270. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/dev/lib/tools.js +0 -0
  271. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/locales/currency.json +0 -0
  272. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/locales/dist/language/en.json +0 -0
  273. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/locales/dist/language/fr.json +0 -0
  274. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/locales/src/resources/currency.csv +0 -0
  275. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/locales/src/resources/region.csv +0 -0
  276. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/mime.types +0 -0
  277. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/README.md +0 -0
  278. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/file/README.md +0 -0
  279. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/file/build.json +0 -0
  280. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/intl/README.md +0 -0
  281. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/intl/build.json +0 -0
  282. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/storage/README.md +0 -0
  283. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/storage/build.json +0 -0
  284. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/validator/README.md +0 -0
  285. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/plugins/lib/validator/build.json +0 -0
  286. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/status.codes +0 -0
  287. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/config/app.json +0 -0
  288. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/config/routing.json +0 -0
  289. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  290. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  291. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  292. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  293. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  294. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  295. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_public/readme.md +0 -0
  296. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  297. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/conf/settings.json +0 -0
  298. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/error/client/json/401.json +0 -0
  299. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/error/client/json/403.json +0 -0
  300. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/error/client/json/404.json +0 -0
  301. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/error/server/html/50x.html +0 -0
  302. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/error/server/json/500.json +0 -0
  303. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/error/server/json/503.json +0 -0
  304. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/core/template/extensions/logger/config.json +0 -0
  305. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/plugins/README.md +0 -0
  306. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/helpers/task.js +0 -0
  307. /package/framework/{v0.1.1-alpha.99/helpers/json → v0.1.2-alpha.1/lib/archiver}/README.md +0 -0
  308. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/archiver/build.json +0 -0
  309. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/copy.js +0 -0
  310. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/cp.js +0 -0
  311. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/help.js +0 -0
  312. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/rename.js +0 -0
  313. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/rm.js +0 -0
  314. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/bundle/status.js +0 -0
  315. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/env/get.js +0 -0
  316. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/env/help.js +0 -0
  317. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/env/help.txt +0 -0
  318. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/env/link-dev.js +0 -0
  319. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/env/rm.js +0 -0
  320. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/env/set.js +0 -0
  321. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/env/unset.js +0 -0
  322. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/dot.js +0 -0
  323. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/get.js +0 -0
  324. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/help.js +0 -0
  325. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/help.txt +0 -0
  326. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/msg.json +0 -0
  327. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/framework/update.js +0 -0
  328. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/gina-dev.1.md +0 -0
  329. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/gina-framework.1.md +0 -0
  330. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/gina.1.md +0 -0
  331. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/msg.json +0 -0
  332. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/port/help.js +0 -0
  333. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/port/help.txt +0 -0
  334. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/port/set.js +0 -0
  335. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/help.js +0 -0
  336. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/import.js +0 -0
  337. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/move.js +0 -0
  338. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/restart.js +0 -0
  339. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/rm.js +0 -0
  340. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/start.js +0 -0
  341. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/status.js +0 -0
  342. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/project/stop.js +0 -0
  343. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/protocol/help.js +0 -0
  344. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/protocol/help.txt +0 -0
  345. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/protocol/list.js +0 -0
  346. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/scope/help.js +0 -0
  347. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/scope/link-local.js +0 -0
  348. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cmd/scope/rm.js +0 -0
  349. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/collection/README.md +0 -0
  350. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/collection/build.json +0 -0
  351. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/cron/README.md +0 -0
  352. /package/framework/{v0.1.1-alpha.99/lib/archiver/README.md → v0.1.2-alpha.1/lib/domain/exemples/backend.js} +0 -0
  353. /package/framework/{v0.1.1-alpha.99/lib/routing/README.md → v0.1.2-alpha.1/lib/domain/exemples/frontend.html} +0 -0
  354. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  355. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/inherits/example/protected_inheritance.js +0 -0
  356. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/inherits/example/simple_inheritance.js +0 -0
  357. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  358. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/README.md +0 -0
  359. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  360. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  361. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/merge/example/merge.js +0 -0
  362. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/merge/example/merge_2_literal objects.js +0 -0
  363. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/merge/example/merge_and_preserve_first.js +0 -0
  364. /package/framework/{v0.1.1-alpha.99/lib/swig-filters → v0.1.2-alpha.1/lib/routing}/README.md +0 -0
  365. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/routing/build.json +0 -0
  366. /package/framework/{v0.1.1-alpha.99/lib/url → v0.1.2-alpha.1/lib/swig-filters}/README.md +0 -0
  367. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/url/index.js +0 -0
  368. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/url/mocks.json +0 -0
  369. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/url/routing.json +0 -0
  370. /package/framework/{v0.1.1-alpha.99 → v0.1.2-alpha.1}/lib/url/test.js +0 -0
@@ -2,10 +2,10 @@
2
2
  * FormValidatorUtil
3
3
  *
4
4
  * Dependencies:
5
- * - utils/helpers
6
- * - utils/helpers/dateFormat
7
- * - utils/merge
8
- * - utils/routing (for API calls)
5
+ * - lib/helpers
6
+ * - lib/helpers/dateFormat
7
+ * - lib/merge
8
+ * - lib/routing (for API calls)
9
9
  *
10
10
  * @param {object} data
11
11
  * @param {object} [ $fields ] - isGFFCtx only
@@ -18,14 +18,14 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
18
18
 
19
19
  // if (isGFFCtx && !$fields )
20
20
  // throw new Error('No `Validator` instance found.\nTry:\nvar FormValidator = require("gina/validator"):\nvar formValidator = new FormValidator(...);')
21
-
22
- var merge = (isGFFCtx) ? require('utils/merge') : require('../../../../../lib/merge');
21
+
22
+ var merge = (isGFFCtx) ? require('lib/merge') : require('../../../../../lib/merge');
23
23
  var helpers = (isGFFCtx) ? {} : require('../../../../../helpers');
24
24
  var dateFormat = (isGFFCtx) ? require('helpers/dateFormat') : helpers.dateFormat;
25
- var routing = (isGFFCtx) ? require('utils/routing') : require('../../../../../lib/routing');
26
-
25
+ var routing = (isGFFCtx) ? require('lib/routing') : require('../../../../../lib/routing');
26
+
27
27
  var hasUserValidators = function() {
28
-
28
+
29
29
  var _hasUserValidators = false, formsContext = null;
30
30
  // backend validation check
31
31
  if (!isGFFCtx) {
@@ -38,7 +38,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
38
38
  _hasUserValidators = true
39
39
  }
40
40
  return _hasUserValidators;
41
- }
41
+ }
42
42
  /**@js_externs local*/
43
43
  var local = {
44
44
  'errors': {},
@@ -84,15 +84,17 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
84
84
  throw new Error('missing data param')
85
85
  } else {
86
86
  // cloning
87
- self = merge( JSON.clone(data), self );
88
- local.data = merge( JSON.clone(data), local.data);
87
+ self = merge(JSON.clone(data), self );
88
+ // self = merge(data, self );
89
+ local.data = merge(JSON.clone(data), local.data);
90
+ // local.data = merge(data, local.data);
89
91
  }
90
-
92
+
91
93
  var getElementByName = function($form, name) { // frontend only
92
94
  var $foundElement = null;
93
95
  for (let f in fieldsSet) {
94
96
  if (fieldsSet[f].name !== name) continue;
95
-
97
+
96
98
  $foundElement = new DOMParser()
97
99
  .parseFromString($form.innerHTML , 'text/html')
98
100
  .getElementById( fieldsSet[f].id );
@@ -100,16 +102,16 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
100
102
  }
101
103
  if ($foundElement)
102
104
  return $foundElement;
103
-
105
+
104
106
  throw new Error('Field `'+ name +'` not found in fieldsSet');
105
107
  }
106
-
108
+
107
109
  /**
108
110
  * bufferToString - Convert Buffer to String
109
111
  * Will apply `Utf8Array` to `String`
110
- * @param {array} arrayBuffer
112
+ * @param {array} arrayBuffer
111
113
  */
112
- var bufferToString = function(arrayBuffer) {
114
+ var bufferToString = function(arrayBuffer) {
113
115
  var out = null
114
116
  , i = null
115
117
  , len = null
@@ -122,7 +124,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
122
124
  i = 0;
123
125
  while(i < len) {
124
126
  c = arrayBuffer[i++];
125
- switch (c >> 4) {
127
+ switch (c >> 4) {
126
128
  case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
127
129
  // 0xxxxxxx
128
130
  out += String.fromCharCode(c);
@@ -145,22 +147,40 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
145
147
 
146
148
  return out;
147
149
  };
148
-
150
+
151
+ var compileError = function(error, data) {
152
+ var varArr = error.match(/\{\{([^{{}}]+)\}\}/g );
153
+ for (let v=0, vLen=varArr.length; v<vLen; v++) {
154
+ let localValue = varArr[v]
155
+ .replace(/\[/g, '["')
156
+ .replace(/\]/g, '"]')
157
+ .replace(/\{|\}/g, '')
158
+ .trim();
159
+
160
+ try {
161
+ localValue = eval('data.'+ localValue).replace(/^\"|\"$/g, '');
162
+ error = error.replace( new RegExp( varArr[v].replace(/\{|\[|\]|\}/g, '\\$&') , 'g'), localValue);
163
+ } catch(e) {}
164
+ }
165
+
166
+ return error
167
+ };
168
+
149
169
  // TODO - One method for the front, and one for the server
150
170
  var queryFromFrontend = function(options, errorMessage) {
151
- var errors = self[this['name']]['errors'] || {};
171
+ var errors = self[this['name']]['errors'] || {};
152
172
  var id = this.target.id || this.target.getAttribute('id');
153
-
154
-
155
- // stop if
156
- // - previous error detected
157
- if ( !self.isValid() ) {
173
+
174
+
175
+ // stop if
176
+ // - previous error detected
177
+ if ( !self.isValid() ) {
158
178
  console.debug('stopping on errors ...');
159
179
  triggerEvent(gina, this.target, 'asyncCompleted.' + id, self[this['name']]);
160
180
  //return self[this.name];
161
181
  return;
162
182
  }
163
-
183
+
164
184
  var testedValue = this.target.dataset.ginaFormValidatorTestedValue;
165
185
  console.debug('[ '+ this['name'] +' ]', 'TESTED VALUE -> ' + this.value +' vs '+ testedValue);
166
186
  var _evt = 'asyncCompleted.' + id;
@@ -170,53 +190,54 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
170
190
  && typeof(gina.validator.$forms[currentFormId]) != 'undefined'
171
191
  && typeof(gina.validator.$forms[currentFormId].cachedErrors) != 'undefined'
172
192
  )
173
- ? gina.validator.$forms[currentFormId].cachedErrors
193
+ ? gina.validator.$forms[currentFormId].cachedErrors
174
194
  : null;
175
195
  if ( !testedValue || typeof(testedValue) == 'undefined' || testedValue !== this.value ) {
176
196
  this.target.dataset.ginaFormValidatorTestedValue = this.value;
177
197
  // remove cachedErrors
178
- if (
179
- cachedErrors
198
+ if (
199
+ cachedErrors
180
200
  && typeof(cachedErrors[this.name]) != 'undefined'
181
201
  && typeof(cachedErrors[this.name].query) != 'undefined'
182
202
  ) {
183
203
  delete cachedErrors[this.name].query;
184
- if (
204
+ if (
185
205
  typeof(gina.validator.$forms[currentFormId]) != 'undefined'
186
206
  &&
187
207
  typeof(gina.validator.$forms[currentFormId].errors) != 'undefined'
188
208
  ) {
189
209
  delete gina.validator.$forms[currentFormId].errors.query;
190
210
  }
191
-
211
+
192
212
  }
193
213
  } else if (testedValue === this.value) {
194
214
  // not resending to backend, but in case of cached errors, re display same error message
195
- var hasCachedErrors = false;
196
- if (
197
- cachedErrors
215
+ var hasCachedErrors = false;
216
+ if (
217
+ cachedErrors
198
218
  && typeof(cachedErrors[this.name]) != 'undefined'
199
- && typeof(cachedErrors[this.name].query) != 'undefined'
200
- && typeof(cachedErrors[this.name].query[this.value]) != 'undefined'
219
+ && typeof(cachedErrors[this.name].query) != 'undefined'
220
+ && typeof(cachedErrors[this.name].query[this.value]) != 'undefined'
201
221
  ) {
202
222
  this.error = errorMessage = cachedErrors[this.name].query[this.value].slice(0);
203
223
  hasCachedErrors = true;
204
224
  }
205
225
  errors['query'] = replace( this.error || errorMessage || local.errorLabels['query'], this);
206
-
226
+ console.debug('[2] potential cached error detected !! ', hasCachedErrors, cachedErrors, ' vs ', errors['query']);
227
+
207
228
  if (hasCachedErrors) {
208
229
  this['errors'] = errors;
209
230
  this.valid = false;
210
231
  }
211
- // Do not remove this test
232
+ // Do not remove this test
212
233
  if ( typeof( gina.events[_evt]) != 'undefined' ) {
213
234
  triggerEvent(gina, this.target, _evt, self[this['name']]);
214
- }
215
-
235
+ }
236
+
216
237
  return self[this.name];
217
238
  }
218
239
  //console.debug('Did not return !!!');
219
-
240
+
220
241
  var xhr = null, _this = this;
221
242
  // setting up AJAX
222
243
  if (window.XMLHttpRequest) { // Mozilla, Safari, ...
@@ -231,17 +252,17 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
231
252
  catch (e) {}
232
253
  }
233
254
  }
234
-
255
+
235
256
  // forcing to sync mode
236
- var queryOptions = { isSynchrone: false, headers: {} };
257
+ var queryOptions = { isSynchrone: false, headers: {} };
237
258
  var queryData = options.data || null, strData = null;
238
259
  var isInlineValidation = (/^true$/i.test(this.target.form.dataset.ginaFormLiveCheckEnabled)) ? true : false; // TRUE if liveCheckEnabled
239
-
260
+
240
261
  // replace placeholders by field values
241
262
  strData = JSON.stringify(queryData);
242
263
  if ( /\$/.test(strData) ) {
243
264
  var variables = strData.match(/\$[-_\[\]a-z 0-9]+/g) || [];
244
- var value = null, key = null;
265
+ var value = null, key = null;
245
266
  for (let i = 0, len = variables.length; i < len; i++) {
246
267
  key = variables[i].replace(/\$/g, '');
247
268
  re = new RegExp("\\"+ variables[i].replace(/\[|\]/g, '\\$&'), "g");
@@ -250,26 +271,26 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
250
271
  // Retrieving live value instead of using fieldsSet.value
251
272
  value = getElementByName(this.target.form, key).value;
252
273
  }
253
-
274
+
254
275
  strData = strData.replace( re, value );
255
276
  }
256
277
  }
257
278
  // cleanup before sending
258
- queryData = strData.replace(/\\"/g, '');
279
+ queryData = strData.replace(/\\"/g, '');
259
280
  // TODO - support regexp for validIf
260
281
  var validIf = ( typeof(options.validIf) == 'undefined' ) ? true : options.validIf;
261
-
282
+
262
283
  queryOptions = merge(queryOptions, options, xhrOptions);
263
284
  delete queryOptions.data;
264
285
  delete queryOptions.validIf;
265
-
286
+
266
287
  var enctype = queryOptions.headers['Content-Type'];
267
288
  var result = null
268
289
  , $target = this.target
269
290
  //, id = $target.getAttribute('id')
270
291
  ;
271
292
  id = $target.getAttribute('id')
272
-
293
+
273
294
  // checking url
274
295
  if (!/^http/.test(queryOptions.url) && /\@/.test(queryOptions.url) ) {
275
296
  try {
@@ -279,7 +300,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
279
300
  throw routingError;
280
301
  }
281
302
  }
282
-
303
+
283
304
  if ( queryOptions.withCredentials ) {
284
305
  if ('withCredentials' in xhr) {
285
306
  // XHR for Chrome/Firefox/Opera/Safari.
@@ -295,7 +316,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
295
316
  // xhr.open(queryOptions.method, queryOptions.url, queryOptions.isSynchrone);
296
317
  // } else {
297
318
  xhr.open(queryOptions.method, queryOptions.url);
298
- // }
319
+ // }
299
320
  } else {
300
321
  // CORS not supported.
301
322
  xhr = null;
@@ -303,10 +324,10 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
303
324
  //triggerEvent(gina, $target, 'error.' + id, result);
304
325
  throw new Error(result);
305
326
  }
306
-
327
+
307
328
  if ( typeof(queryOptions.responseType) != 'undefined' ) {
308
329
  /**
309
- * Note: We expect to remove support for synchronous use of XMLHTTPRequest() during page unloads in Chrome in version 88,
330
+ * Note: We expect to remove support for synchronous use of XMLHTTPRequest() during page unloads in Chrome in version 88,
310
331
  * scheduled to ship in January 2021.
311
332
  * The XMLHttpRequest2 spec was recently changed to prohibit sending a synchronous request when XMLHttpRequest.responseType
312
333
  */
@@ -323,132 +344,213 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
323
344
  xhr.open(queryOptions.method, queryOptions.url)
324
345
  }
325
346
  }
326
-
347
+
327
348
  // setting up headers - all but Content-Type ; it will be set right before .send() is called
328
349
  for (var hearder in queryOptions.headers) {
329
350
  if (hearder == 'Content-Type' && typeof (enctype) != 'undefined' && enctype != null && enctype != '')
330
351
  continue;
331
352
 
332
353
  xhr.setRequestHeader(hearder, queryOptions.headers[hearder]);
333
- }
354
+ }
334
355
  if (typeof (enctype) != 'undefined' && enctype != null && enctype != '') {
335
356
  xhr.setRequestHeader('Content-Type', enctype);
336
357
  }
337
-
338
- if (xhr) {
339
-
340
- xhr.onload = function () {
341
-
342
- var onResult = function(result) {
343
-
344
- _this.value = local['data'][_this.name] = (_this.value) ? _this.value.toLowerCase() : _this.value;
345
-
346
- var isValid = result.isValid || false;
347
- if (validIf != isValid) {
348
- isValid = false;
349
- } else {
350
- isValid = true;
358
+
359
+ var onResult = function(result) {
360
+
361
+ _this.value = local['data'][_this.name] = (_this.value) ? _this.value.toLowerCase() : _this.value;
362
+
363
+ var isValid = result.isValid || false;
364
+ if (validIf != isValid) {
365
+ isValid = false;
366
+ } else {
367
+ isValid = true;
368
+ }
369
+ self[_this['name']].valid = isValid;
370
+ var errors = self[_this['name']]['errors'] || {};
371
+
372
+ var errorFields = ( typeof(result.error) != 'undefined' && typeof(result.fields) != 'undefined' ) ? result.fields : {};
373
+
374
+ if (errorFields.count() > 0 && !isValid || !isValid) {
375
+
376
+ if (!isValid) {
377
+ var systemError = null;
378
+ if ( typeof(errorFields[_this.name]) != 'undefined') {
379
+
380
+ // compiling against rules[field].query.data
381
+ local.errorLabels['query'] = compileError(errorFields[_this.name], options.data);
382
+
383
+
384
+ } else if ( typeof(result.error) != 'undefined' && /^5/.test(result.status) ) {
385
+ // system error
386
+ systemError = result.error;
351
387
  }
352
- self[_this['name']].valid = isValid;
353
- var errors = self[_this['name']]['errors'] || {};
354
-
355
- var errorFields = ( typeof(result.error) != 'undefined' && typeof(result.fields) != 'undefined' ) ? result.fields : {};
356
-
357
- if (errorFields.count() > 0 && !isValid || !isValid) {
358
-
359
- if (!isValid) {
360
- var systemError = null;
361
- if ( typeof(errorFields[_this.name]) != 'undefined') {
362
- local.errorLabels['query'] = errorFields[_this.name];
363
- } else if ( typeof(result.error) != 'undefined' && /^5/.test(result.status) ) {
364
- // system error
365
- //console.debug('found system error: ', result);
366
- systemError = result.error;
367
- }
368
- errors['query'] = replace(systemError || _this['error'] || options['error'] || local.errorLabels['query'], _this);
369
- console.debug('query error detected !! ', result);
370
- }
371
-
372
- if ( !errors['query'] && _this.value == '' ) {
373
- isValid = true;
374
- }
388
+ // Fixed on 2023-01-10
389
+ // We want `local.errorLabels['query']` before the generic|user defined `rule` error
390
+ var optionError = ( typeof(options['error']) != 'undefined' ) ? options['error'] : null;
391
+ errors['query'] = replace(systemError || _this['error'] || optionError || local.errorLabels['query'], _this);
392
+ console.debug('[1] query error detected !! ', result);
393
+ }
394
+
395
+ if ( !errors['query'] && _this.value == '' ) {
396
+ isValid = true;
397
+ }
398
+ }
399
+
400
+ // if error tagged by a previous validation, remove it when isValid == true
401
+ if ( isValid && typeof(errors['query']) != 'undefined' ) {
402
+ delete errors['query'];
403
+ }
404
+
405
+ // To handle multiple errors from backend
406
+ // for (var f in errorFields.length) {
407
+ // if ( !errors['query'] && _this.value == '' ) {
408
+ // isValid = true;
409
+ // }
410
+
411
+ // if (!isValid) {
412
+ // errors['query'] = replace(_this['error'] || local.errorLabels['query'], _this)
413
+ // }
414
+ // // if error tagged by a previous validation, remove it when isValid == true
415
+ // else if ( isValid && typeof(errors['query']) != 'undefined' ) {
416
+ // delete errors['query'];
417
+ // }
418
+ // }
419
+
420
+ _this.valid = isValid;
421
+ var cachedErrors = gina.validator.$forms[_this.target.form.getAttribute('id')].cachedErrors || {};
422
+ if ( errors.count() > 0 ) {
423
+
424
+ _this['errors'] = errors;
425
+ if ( typeof(self[_this['name']].errors) == 'undefined' ) {
426
+ self[_this['name']].errors = {};
427
+ }
428
+
429
+ self[_this['name']].errors = merge(self[_this['name']].errors, errors);
430
+
431
+ if ( typeof(errors.query) != 'undefined' && errors.query ) {
432
+
433
+ if ( typeof(cachedErrors[_this.name]) == 'undefined' ) {
434
+ cachedErrors[_this.name] = {}
375
435
  }
376
-
377
- // if error tagged by a previous validation, remove it when isValid == true
378
- if ( isValid && typeof(errors['query']) != 'undefined' ) {
379
- delete errors['query'];
436
+ if ( typeof(cachedErrors[_this.name].query) == 'undefined' ) {
437
+ cachedErrors[_this.name].query = {}
380
438
  }
381
-
382
- // To handle multiple errors from backend
383
- // for (var f in errorFields.length) {
384
- // if ( !errors['query'] && _this.value == '' ) {
385
- // isValid = true;
386
- // }
387
-
388
- // if (!isValid) {
389
- // errors['query'] = replace(_this['error'] || local.errorLabels['query'], _this)
390
- // }
391
- // // if error tagged by a previous validation, remove it when isValid == true
392
- // else if ( isValid && typeof(errors['query']) != 'undefined' ) {
393
- // delete errors['query'];
394
- // }
395
- // }
396
-
397
- _this.valid = isValid;
398
- var cachedErrors = gina.validator.$forms[_this.target.form.getAttribute('id')].cachedErrors || {};
399
- if ( errors.count() > 0 ) {
400
-
401
- _this['errors'] = errors;
402
- if ( typeof(self[_this['name']].errors) == 'undefined' ) {
403
- self[_this['name']].errors = {};
404
- }
405
-
406
- self[_this['name']].errors = merge(self[_this['name']].errors, errors);
407
-
408
- if ( typeof(errors.query) != 'undefined' && errors.query ) {
409
-
410
- if ( typeof(cachedErrors[_this.name]) == 'undefined' ) {
411
- cachedErrors[_this.name] = {}
412
- }
413
- if ( typeof(cachedErrors[_this.name].query) == 'undefined' ) {
414
- cachedErrors[_this.name].query = {}
415
- }
416
-
417
- cachedErrors[_this.name].query[_this.value] = errors.query.slice(0);
418
- }
419
-
420
- var errClass = _this.target.getAttribute('data-gina-form-errors');
421
- if ( !/query/.test(errClass) ) {
422
- if ( !errClass || errClass =='' ) {
423
- errClass = 'query'
424
- } else {
425
- errClass +=' query'
439
+
440
+ cachedErrors[_this.name].query[_this.value] = errors.query.slice(0);
441
+ }
442
+
443
+ var errClass = _this.target.getAttribute('data-gina-form-errors');
444
+ if ( !/query/.test(errClass) ) {
445
+ if ( !errClass || errClass =='' ) {
446
+ errClass = 'query'
447
+ } else {
448
+ errClass +=' query'
449
+ }
450
+ _this.target.setAttribute('data-gina-form-errors', errClass);
451
+ }
452
+ } else if (
453
+ typeof(cachedErrors[_this.name]) != 'undefined'
454
+ && typeof(cachedErrors[_this.name].query) != 'undefined'
455
+ && typeof(cachedErrors[_this.name].query[_this.value]) != 'undefined'
456
+ ) {
457
+ delete cachedErrors[_this.name].query[_this.value];
458
+ }
459
+
460
+ var id = _this.target.id || _this.target.getAttribute('id');
461
+ console.debug('prematurely completed event `'+ 'asyncCompleted.' + id +'`');
462
+ return triggerEvent(gina, _this.target, 'asyncCompleted.' + id, self[_this['name']]);
463
+ } // EO onResult
464
+
465
+
466
+ if (xhr) {
467
+
468
+ xhr.onerror = function(event, err) {
469
+
470
+ var error = 'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.';
471
+ var result = {
472
+ 'status': xhr.status, //500,
473
+ 'error' : error
474
+ };
475
+
476
+ console.debug('query error [2] detected !! ', err, error);
477
+ isOnException = true;
478
+ result = this.responseText;
479
+ var contentType = this.getResponseHeader("Content-Type");
480
+ if ( /\/json/.test( contentType ) ) {
481
+ result = JSON.parse(this.responseText);
482
+
483
+ if ( typeof(result.status) == 'undefined' )
484
+ result.status = this.status;
485
+
486
+ //triggerEvent(gina, $target, 'success.' + id, result);
487
+ return onResult(result)
488
+ } else {
489
+ result = { 'status': xhr.status, 'message': '' };
490
+ if ( /^(\{|\[)/.test( xhr.responseText ) ) {
491
+ try {
492
+ result = merge( result, JSON.parse(xhr.responseText) );
493
+ } catch (err) {
494
+ result = merge(result, err);
426
495
  }
427
- _this.target.setAttribute('data-gina-form-errors', errClass);
428
496
  }
429
- } else if (
430
- typeof(cachedErrors[_this.name]) != 'undefined'
431
- && typeof(cachedErrors[_this.name].query) != 'undefined'
432
- && typeof(cachedErrors[_this.name].query[_this.value]) != 'undefined'
433
- ) {
434
- delete cachedErrors[_this.name].query[_this.value];
497
+ return onResult(result);
435
498
  }
436
-
437
- var id = _this.target.id || _this.target.getAttribute('id');
438
- console.debug('prematurely completed event `'+ 'asyncCompleted.' + id +'`');
439
- return triggerEvent(gina, _this.target, 'asyncCompleted.' + id, self[_this['name']]);
440
- }
441
-
499
+
500
+ }// Eo xhr.onerror
501
+
502
+ // catching ready state cb
503
+ // var isOnException = false;
504
+ // xhr.onreadystatechange = function (event) {
505
+ // if (xhr.readyState == 4) {
506
+
507
+ // console.warn(xhr.status, xhr.responseText);
508
+
509
+ // if (xhr.status === 200) {
510
+ // console.log("-> Success [3]" + xhr.responseText);
511
+ // try {
512
+ // result = this.responseText;
513
+ // var contentType = this.getResponseHeader("Content-Type");
514
+ // if ( /\/json/.test( contentType ) ) {
515
+ // result = JSON.parse(this.responseText);
516
+
517
+ // if ( typeof(result.status) == 'undefined' )
518
+ // result.status = this.status;
519
+
520
+ // //triggerEvent(gina, $target, 'success.' + id, result);
521
+ // return onResult(result)
522
+ // } else {
523
+ // result = { 'status': xhr.status, 'message': '' };
524
+ // if ( /^(\{|\[)/.test( xhr.responseText ) ) {
525
+ // try {
526
+ // result = merge( result, JSON.parse(xhr.responseText) );
527
+ // } catch (err) {
528
+ // result = merge(result, err);
529
+ // }
530
+ // }
531
+ // return onResult(result);
532
+ // }
533
+ // } catch (err) {
534
+ // throw err;
535
+ // }
536
+ // } else {
537
+ // isOnException = true;
538
+ // console.log("-> Error [3]", xhr.statusText, 'isOnException: '+ isOnException);
539
+ // }
540
+ // }
541
+ // } // EO xhr.onreadystatechange = function (event) {
542
+
543
+ xhr.onload = function () {
442
544
  try {
443
545
  result = this.responseText;
444
546
  var contentType = this.getResponseHeader("Content-Type");
445
547
  if ( /\/json/.test( contentType ) ) {
446
548
  result = JSON.parse(this.responseText);
447
-
549
+
448
550
  if ( typeof(result.status) == 'undefined' )
449
551
  result.status = this.status;
450
-
451
- //triggerEvent(gina, $target, 'success.' + id, result);
552
+
553
+ //triggerEvent(gina, $target, 'success.' + id, result);
452
554
  return onResult(result)
453
555
  } else {
454
556
  result = { 'status': xhr.status, 'message': '' };
@@ -463,32 +565,32 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
463
565
  }
464
566
  } catch (err) {
465
567
  throw err;
466
- }
467
- }
468
-
568
+ }
569
+ }// xhr.onload = function () {
570
+
469
571
  if (data) {
470
572
  xhr.send( queryData ); // stringyfied
471
573
  } else {
472
574
  xhr.send();
473
- }
575
+ }
474
576
  }
475
577
  }
476
-
578
+
477
579
  /**
478
580
  * queryFromBackend
479
- *
480
- *
481
- * @param {object} options
482
- * @param {object} request
483
- * @param {object} response
581
+ *
582
+ *
583
+ * @param {object} options
584
+ * @param {object} request
585
+ * @param {object} response
484
586
  * @param {callback} next
485
- *
486
- *
587
+ *
588
+ *
487
589
  */
488
590
  var queryFromBackend = async function(options, request, response, next) {
489
591
  var Config = require(_(GINA_FRAMEWORK_DIR +'/core/config.js', true));
490
592
  var config = new Config().getInstance();
491
-
593
+
492
594
  var opt = null
493
595
  //appConf.proxy.<bundle>;
494
596
  , rule = null
@@ -497,7 +599,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
497
599
  ;
498
600
  // trying to retrieve proxy conf
499
601
  if ( /\@/.test(options.url) ) {
500
- var attr = options.url.split(/@/);
602
+ var attr = options.url.split(/@/);
501
603
  rule = attr[0];
502
604
  bundle = attr[1];
503
605
  var proxyConf = getConfig( currentBundle, 'app' ).proxy;
@@ -505,19 +607,21 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
505
607
  if (config.bundle !== bundle) { // ignore if same bundle
506
608
  // getting proxy conf when available
507
609
  opt = getConfig( currentBundle, 'app' ).proxy[bundle];
508
- }
610
+ }
509
611
  } catch (proxyError) {
510
612
  throw new Error('Could not retrieve `proxy` configuration for bundle `'+ bundle +'`. Please check your `/config/app.json`.\n'+proxyError.stack);
511
613
  }
512
-
614
+
513
615
  attr = null;
514
616
  } else {
515
617
  // TODO - handle else; when it is an external domain/url
516
618
  throw new Error('external url/domain not handled at this moment, please contact us if you need support for it.')
517
619
  }
518
620
  var route = JSON.clone(routing.getRoute(options.url, options.data));
621
+ // var route = routing.getRoute(options.url, options.data);
622
+
519
623
  var env = config.env;
520
- var conf = config[bundle][env];
624
+ var conf = config[bundle][env];
521
625
  if (!opt) { // setup opt by default if no proxy conf found
522
626
  if (config.bundle == bundle) {
523
627
  var credentials = getConfig( currentBundle, 'settings' ).server.credentials;
@@ -527,13 +631,13 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
527
631
  options.protocol = conf.server.protocol;
528
632
  options.rejectUnauthorized = false;
529
633
  }
530
- opt = {
634
+ opt = {
531
635
  "ca" : options.ca,
532
- "hostname" : options.hostname,
533
- "port" : options.port,
636
+ "hostname" : options.hostname,
637
+ "port" : options.port,
534
638
  "path" : options.path
535
639
  };
536
-
640
+
537
641
  if ( typeof(options.protocol) != 'undefined' ) {
538
642
  opt.protocol = options.protocol
539
643
  }
@@ -541,18 +645,18 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
541
645
  opt.rejectUnauthorized = options.rejectUnauthorized
542
646
  }
543
647
  }
544
-
648
+
545
649
  /**
546
650
  * BO routing configuration
547
651
  * Attention: this portion of code is from `router.js`
548
652
  * Any modification on this part must be reflected on `router.js`
549
653
  */
550
654
  // default param setting
551
- var params = {
655
+ var params = {
552
656
  method : route.method,
553
657
  requirements : route.requirements,
554
658
  namespace : route.namespace || undefined,
555
- url : unescape(route.url), /// avoid %20
659
+ url : decodeURI(route.url), /// avoid %20
556
660
  rule : rule + '@' + bundle,
557
661
  param : JSON.clone(route.param),
558
662
  middleware : JSON.clone(route.middleware),
@@ -560,7 +664,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
560
664
  isXMLRequest : request.isXMLRequest,
561
665
  isWithCredentials : request.isWithCredentials
562
666
  };
563
-
667
+
564
668
  var templateName = params.rule.replace('\@'+ bundle, '') || '_common';
565
669
  var routeHasViews = ( typeof(conf.content.templates) != 'undefined' ) ? true : false;
566
670
  var controllerOptions = {
@@ -574,8 +678,6 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
574
678
  //bundle : bundle,//module
575
679
  // bundlePath : conf.bundlesPath + '/' + bundle,
576
680
  // rootPath : self.executionPath,
577
- // We don't want to keep original conf untouched
578
- conf : JSON.clone(conf),
579
681
  //instance: self.serverInstance,
580
682
  //template: (routeHasViews) ? conf.content.templates[templateName] : undefined,
581
683
  //isUsingTemplate: local.isUsingTemplate,
@@ -583,12 +685,14 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
583
685
  //path: params.param.path || null, // user custom path : namespace should be ignored | left blank
584
686
  //assets: {}
585
687
  };
586
-
587
- controllerOptions = merge(controllerOptions, params);
588
-
688
+
689
+ controllerOptions = merge(controllerOptions, params);
690
+
589
691
  // BO - Template outside of namespace fix added on 2021-08-19
590
692
  // We want to keep original conf untouched
591
- controllerOptions.conf = JSON.clone(conf);
693
+ var _conf = JSON.clone(conf);
694
+ // controllerOptions.conf = JSON.clone(conf);
695
+ controllerOptions.conf = _conf;
592
696
  controllerOptions.conf.content.routing[controllerOptions.rule].param = params.param;
593
697
  // inheriting from _common
594
698
  if (
@@ -596,7 +700,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
596
700
  && typeof(controllerOptions.template.ginaLoader) == 'undefined'
597
701
  ) {
598
702
  controllerOptions.template.ginaLoader = controllerOptions.conf.content.templates._common.ginaLoader;
599
- }
703
+ }
600
704
  controllerOptions.conf.content.routing[controllerOptions.rule].param = params.param;
601
705
  delete controllerOptions.middleware;
602
706
  delete controllerOptions.param;
@@ -605,17 +709,17 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
605
709
  /**
606
710
  * EO routing configuration
607
711
  */
608
-
712
+
609
713
  var Controller = require(_(GINA_FRAMEWORK_DIR +'/core/controller/controller.js'), true);
610
714
  var controller = new Controller(controllerOptions);
611
- controller.name = route.param.control;
715
+ controller.name = route.param.control;
612
716
  //controller.serverInstance = serverInstance;
613
717
  controller.setOptions(request, response, next, controllerOptions);
614
-
615
-
718
+
719
+
616
720
  var data = ( typeof(options.data) == 'object' && options.data.count() > 0 )
617
721
  ? options.data
618
- : {};
722
+ : {};
619
723
  // inherited data from current query asking for validation
620
724
  var urlParams = '';
621
725
  if ( /^get|delete|put$/i.test(options.method) ) {
@@ -625,7 +729,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
625
729
  if (i > 0) {
626
730
  urlParams += '&';
627
731
  }
628
- let val = (typeof(data[p]) == 'object') ? encodeURIComponent(JSON.stringify(data[p])) : data[p];
732
+ let val = (typeof(data[p]) == 'object') ? encodeRFC5987ValueChars(JSON.stringify(data[p])) : data[p];
629
733
  urlParams += p +'='+ val;
630
734
  i++;
631
735
  }
@@ -633,11 +737,11 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
633
737
  opt.method = options.method;
634
738
  //opt.path = route.url + urlParams;
635
739
  opt.path = route.url;
636
-
740
+
637
741
  var util = require('util');
638
742
  var promisify = util.promisify;
639
743
  var result = { isValid: false }, err = false;
640
-
744
+
641
745
  await promisify(controller.query)(opt, data)
642
746
  .then(function onResult(_result) {
643
747
  result = _result;
@@ -649,10 +753,10 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
649
753
  //throw err;
650
754
  console.error(err);
651
755
  result.error = err;
652
- }
756
+ }
653
757
  return result;
654
758
  };
655
-
759
+
656
760
  /**
657
761
  * query
658
762
  */
@@ -667,16 +771,16 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
667
771
  /**
668
772
  * addField
669
773
  * Add field to the validation context
670
- * @param {string} el
671
- * @param {string|boolean|number|object} [value]
774
+ * @param {string} el
775
+ * @param {string|boolean|number|object} [value]
672
776
  */
673
- var addField = function(el, value) {
777
+ var addField = function(el, value) {
674
778
  var val = null, label = null;
675
-
779
+
676
780
  if ( typeof(self[el]) == 'undefined' && typeof(value) != 'undefined' ) {
677
781
  self[el] = val = value;
678
782
  }
679
-
783
+
680
784
  if ( typeof(self[el]) == 'object' ) {
681
785
  try {
682
786
  val = JSON.parse( JSON.stringify( self[el] ))
@@ -726,17 +830,17 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
726
830
  var alias = ( typeof(window) != 'undefined' && typeof(window._currentValidatorAlias) != 'undefined' ) ? window._currentValidatorAlias : 'is';
727
831
  if ( typeof(window) != 'undefined' && window._currentValidatorAlias)
728
832
  delete window._currentValidatorAlias;
729
-
730
- var errors = self[this['name']]['errors'] || {};
833
+
834
+ var errors = self[this['name']]['errors'] || {};
731
835
  local.data[this.name] = self[this.name].value;
732
-
733
- if (
836
+
837
+ if (
734
838
  typeof(errors['isRequired']) == 'undefined'
735
839
  && this.value == ''
736
- && !/^false$/i.test(this.value)
737
- && this.value != 0
840
+ && !/^false$/i.test(this.value)
841
+ && this.value != 0
738
842
  ||
739
- !errors['isRequired']
843
+ !errors['isRequired']
740
844
  && this.value == ''
741
845
  && !/^false$/i.test(this.value)
742
846
  && this.value != 0
@@ -745,14 +849,14 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
745
849
  } else if (!errors['isRequired'] && typeof(this.value) == 'string' && this.value == '') {
746
850
  isValid = true;
747
851
  }
748
-
852
+
749
853
  if ( !isValid && /^(true|false)$/i.test(condition) ) { // because it can be evaluated on backend validation
750
854
  isValid = condition;
751
855
  } else if (!isValid) {
752
856
  var re = null, flags = null;
753
857
  // Fixed on 2021-03-13: $variable now replaced with real value beafore validation
754
858
  if ( /[\!\=>\>\<a-z 0-9]+/i.test(condition) ) {
755
- var variables = condition.match(/\${0}[-_,.\[\]a-z0-9]+/ig); // without space(s)
859
+ var variables = condition.match(/\${0}[-_,.\[\]a-z0-9]+/ig); // without space(s)
756
860
  if (variables && variables.length > 0) {
757
861
  var compiledCondition = condition;
758
862
  for (var i = 0, len = variables.length; i < len; ++i) {
@@ -768,7 +872,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
768
872
  }
769
873
  }
770
874
  }
771
-
875
+
772
876
  try {
773
877
  // security checks
774
878
  compiledCondition = compiledCondition.replace(/(\(|\)|return)/g, '');
@@ -777,7 +881,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
777
881
  } else {
778
882
  isValid = eval(compiledCondition)
779
883
  }
780
-
884
+
781
885
  } catch (err) {
782
886
  throw new Error(err.stack||err.message)
783
887
  }
@@ -801,7 +905,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
801
905
  } else {
802
906
  isValid = eval(condition);
803
907
  }
804
-
908
+
805
909
  //valid = new RegExp(condition.replace(/\//g, '')).test(this.value)
806
910
  } catch (err) {
807
911
  throw new Error(err.stack||err.message)
@@ -814,7 +918,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
814
918
  if ( typeof(errorStack) != 'undefined' )
815
919
  errors['stack'] = errorStack;
816
920
  }
817
- // if error tagged by a previous vlaidation, remove it when isValid == true
921
+ // if error tagged by a previous vlaidation, remove it when isValid == true
818
922
  else if ( isValid && typeof(errors[alias]) != 'undefined' ) {
819
923
  delete errors[alias];
820
924
  //delete errors['stack'];
@@ -824,16 +928,16 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
824
928
  if ( errors.count() > 0 )
825
929
  this['errors'] = errors;
826
930
 
827
-
931
+
828
932
  return self[this.name]
829
933
  }
830
-
934
+
831
935
  self[el]['set'] = function(value) {
832
936
  this.value = local['data'][this.name] = value;
833
- // html
937
+ // html
834
938
  this.target.setAttribute('value', value);
835
939
  // Todo : select and radio case to apply change
836
-
940
+
837
941
  return self[this.name]
838
942
  }
839
943
 
@@ -842,15 +946,15 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
842
946
 
843
947
  this.value = local['data'][this.name] = (this.value) ? this.value.toLowerCase() : this.value;
844
948
  // Apply on current field upper -> lower
845
- if (
949
+ if (
846
950
  isGFFCtx
847
951
  && this.target
848
- && this.target.value != ''
849
- && /[A-Z]+/.test(this.target.value)
952
+ && this.target.value != ''
953
+ && /[A-Z]+/.test(this.target.value)
850
954
  ) {
851
955
  this.target.value = this.value;
852
956
  }
853
-
957
+
854
958
 
855
959
  var rgx = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
856
960
  var isValid = rgx.test(this['value']) ? true : false;
@@ -863,7 +967,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
863
967
  if (!isValid) {
864
968
  errors['isEmail'] = replace(this['error'] || local.errorLabels['isEmail'], this)
865
969
  }
866
- // if error tagged by a previous vlaidation, remove it when isValid == true
970
+ // if error tagged by a previous vlaidation, remove it when isValid == true
867
971
  else if ( isValid && typeof(errors['isEmail']) != 'undefined' ) {
868
972
  delete errors['isEmail'];
869
973
  //delete errors['stack'];
@@ -882,11 +986,11 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
882
986
 
883
987
  this.value = local['data'][this.name] = (this.value) ? this.value.toLowerCase() : this.value;
884
988
  // Apply on current field upper -> lower
885
- if (
989
+ if (
886
990
  isGFFCtx
887
991
  && this.target
888
- && this.target.value != ''
889
- && /[A-Z]+/.test(this.target.value)
992
+ && this.target.value != ''
993
+ && /[A-Z]+/.test(this.target.value)
890
994
  ) {
891
995
  this.target.value = this.value;
892
996
  }
@@ -902,7 +1006,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
902
1006
  if (!isValid) {
903
1007
  errors['isJsonWebToken'] = replace(this['error'] || local.errorLabels['isJsonWebToken'], this)
904
1008
  }
905
- // if error tagged by a previous vlaidation, remove it when isValid == true
1009
+ // if error tagged by a previous vlaidation, remove it when isValid == true
906
1010
  else if ( isValid && typeof(errors['isJsonWebToken']) != 'undefined' ) {
907
1011
  delete errors['isJsonWebToken'];
908
1012
  //delete errors['stack'];
@@ -915,7 +1019,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
915
1019
 
916
1020
  return self[this['name']]
917
1021
  }
918
-
1022
+
919
1023
  /**
920
1024
  * Check if boolean and convert to `true/false` booloean if value is a string or a number
921
1025
  * Will include `false` value if isRequired
@@ -943,13 +1047,13 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
943
1047
  val = this.value = local.data[this.name] = false;
944
1048
  break;
945
1049
  }
946
-
1050
+
947
1051
  var isValid = (val !== null) ? true : false;
948
1052
 
949
1053
  if (!isValid) {
950
1054
  errors['isBoolean'] = replace(this.error || local.errorLabels['isBoolean'], this)
951
1055
  }
952
- // if error tagged by a previous vlaidation, remove it when isValid == true
1056
+ // if error tagged by a previous vlaidation, remove it when isValid == true
953
1057
  else if ( isValid && typeof(errors['isBoolean']) != 'undefined' ) {
954
1058
  delete errors['isBoolean'];
955
1059
  //delete errors['stack'];
@@ -981,7 +1085,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
981
1085
  , isMaxLength = true
982
1086
  , errors = self[this['name']]['errors'] || {}
983
1087
  ;
984
-
1088
+
985
1089
  // test if val is a number
986
1090
  try {
987
1091
  // if val is a string replaces comas by points
@@ -1030,7 +1134,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1030
1134
 
1031
1135
  isValid = false;
1032
1136
  }
1033
- // if error tagged by a previous vlaidation, remove it when isValid == true
1137
+ // if error tagged by a previous vlaidation, remove it when isValid == true
1034
1138
  if ( isValid && typeof(errors['isNumberLength']) != 'undefined') {
1035
1139
  delete errors['isNumberLength'];
1036
1140
  }
@@ -1136,7 +1240,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1136
1240
  // document.getElementById(this.target.id).value = this.value;
1137
1241
  // //triggerEvent(gina, this.target, 'change', self[this['name']]);
1138
1242
  // }
1139
-
1243
+
1140
1244
  } else {
1141
1245
  this.value = this.value.replace(/\,/g,'');
1142
1246
  }
@@ -1249,7 +1353,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1249
1353
  if ( typeof(isApplicable) == 'boolean' && !isApplicable ) {
1250
1354
 
1251
1355
  this.valid = true;
1252
-
1356
+
1253
1357
  // is in excluded ?
1254
1358
  var excludedIndex = local.excluded.indexOf(this.name);
1255
1359
  if ( excludedIndex > -1 ) {
@@ -1260,12 +1364,12 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1260
1364
  }
1261
1365
 
1262
1366
  // radio group case
1263
- if (
1264
- isGFFCtx
1265
- && this.target
1266
- && this.target.tagName == 'INPUT'
1267
- && typeof(this.target.type) != 'undefined'
1268
- && this.target.type == 'radio'
1367
+ if (
1368
+ isGFFCtx
1369
+ && this.target
1370
+ && this.target.tagName == 'INPUT'
1371
+ && typeof(this.target.type) != 'undefined'
1372
+ && this.target.type == 'radio'
1269
1373
  ) {
1270
1374
  var radios = document.getElementsByName(this.name);
1271
1375
  for (var i = 0, len = radios.length; i < len; ++i) {
@@ -1290,7 +1394,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1290
1394
  if (!isValid) {
1291
1395
  errors['isRequired'] = replace(this.error || local.errorLabels['isRequired'], this)
1292
1396
  }
1293
- // if error tagged by a previous vlaidation, remove it when isValid == true
1397
+ // if error tagged by a previous vlaidation, remove it when isValid == true
1294
1398
  else if ( isValid ) {
1295
1399
  if (typeof(errors['isRequired']) != 'undefined' )
1296
1400
  delete errors['isRequired'];
@@ -1315,7 +1419,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1315
1419
  * {
1316
1420
  * "password": {
1317
1421
  * "isRequired": true,
1318
- *
1422
+ *
1319
1423
  * "isString": true // Means that we just want a string and we don't care of its length
1320
1424
  * // OR
1321
1425
  * "isString": 7 // Means at least 7 chars length
@@ -1393,9 +1497,9 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1393
1497
  *
1394
1498
  * @param {string|boolean} [mask] - by default "yyyy-mm-dd"
1395
1499
  *
1396
- * @returns {date} date - extended by gina::utils::dateFormat; an adaptation of Steven Levithan's code
1500
+ * @returns {date} date - extended by gina::lib::helpers::dateFormat; an adaptation of Steven Levithan's code
1397
1501
  * */
1398
- self[el]['isDate'] = function(mask) {
1502
+ self[el]['isDate'] = function(mask) {
1399
1503
  var val = this.value
1400
1504
  , isValid = false
1401
1505
  , errors = self[this['name']]['errors'] || {}
@@ -1403,37 +1507,37 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1403
1507
  , date = null
1404
1508
  ;
1405
1509
  // Default validation on livecheck & invalid init value
1406
- if (!val || val == '' || /NaN|Invalid Date/i.test(val) ) {
1510
+ if (!val || val == '' || /NaN|Invalid Date/i.test(val) ) {
1407
1511
  if ( /NaN|Invalid Date/i.test(val) ) {
1408
1512
  console.warn('[FormValidator::isDate] Provided value for field `'+ this.name +'` is not allowed: `'+ val +'`');
1409
1513
  errors['isDate'] = replace(this.error || local.errorLabels['isDate'], this);
1410
-
1514
+
1411
1515
  }
1412
1516
  this.valid = isValid;
1413
1517
  if ( errors.count() > 0 )
1414
- this['errors'] = errors;
1415
-
1518
+ this['errors'] = errors;
1519
+
1416
1520
  return self[this.name];
1417
1521
  }
1418
-
1419
- if (
1522
+
1523
+ if (
1420
1524
  typeof(mask) == 'undefined'
1421
1525
  ||
1422
1526
  typeof(mask) != 'undefined' && /true/i.test(mask)
1423
1527
  ) {
1424
1528
  mask = "yyyy-mm-dd"; // by default
1425
1529
  }
1426
-
1530
+
1427
1531
  if (val instanceof Date) {
1428
1532
  date = val.format(mask);
1429
1533
  } else {
1430
-
1534
+
1431
1535
  try {
1432
1536
  m = mask.match(/[^\/\- ]+/g);
1433
1537
  } catch (err) {
1434
1538
  throw new Error('[FormValidator::isDate] Provided mask not allowed: `'+ mask +'`');
1435
1539
  }
1436
-
1540
+
1437
1541
  try {
1438
1542
  val = val.match(/[^\/\- ]+/g);
1439
1543
  var dic = {}, d, len;
@@ -1447,10 +1551,10 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1447
1551
  } catch (err) {
1448
1552
  throw new Error('[FormValidator::isDate] Provided value not allowed: `'+ val +'`' + err);
1449
1553
  }
1450
-
1554
+
1451
1555
 
1452
1556
  date = this.value = local.data[this.name] = new Date(formatedDate);
1453
-
1557
+
1454
1558
  if ( /Invalid Date/i.test(date) || date instanceof Date === false ) {
1455
1559
  if ( !errors['isRequired'] && this.value == '' ) {
1456
1560
  isValid = true
@@ -1474,7 +1578,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1474
1578
 
1475
1579
  /**
1476
1580
  * Formating date using DateFormatHelper
1477
- * Check out documentation in the helper source: `utils/helpers/dateFormat.js`
1581
+ * Check out documentation in the helper source: `lib/helpers/dateFormat.js`
1478
1582
  * e.g.:
1479
1583
  * d.start
1480
1584
  * .isDate('dd/mm/yyyy')
@@ -1512,7 +1616,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1512
1616
  }
1513
1617
  return self[this.name]
1514
1618
  }
1515
-
1619
+
1516
1620
  /**
1517
1621
  * Trim when string starts or ends with white space(s)
1518
1622
  *
@@ -1536,11 +1640,11 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1536
1640
  self[el]['exclude'] = function(isApplicable) {
1537
1641
 
1538
1642
  if ( typeof(isApplicable) == 'boolean' && !isApplicable ) {
1539
-
1643
+
1540
1644
  if ( /^true|false$/i.test(this.value)) {
1541
1645
  this.value = (/^true$/i.test(this.value)) ? true : false;
1542
1646
  local.data[this.name] = this.value;
1543
- }
1647
+ }
1544
1648
 
1545
1649
  return self[this.name]
1546
1650
  }
@@ -1550,8 +1654,8 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1550
1654
  local.excluded.push(this.name);
1551
1655
  this.isExcluded = true;
1552
1656
  }
1553
-
1554
-
1657
+
1658
+
1555
1659
  // remove existing errors
1556
1660
  return self[this.name];
1557
1661
  }
@@ -1561,8 +1665,8 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1561
1665
  * a request to the remote host if previous rules failed
1562
1666
  */
1563
1667
  self[el]['query'] = query;
1564
-
1565
-
1668
+
1669
+
1566
1670
  self[el]['getValidationContext'] = function() {
1567
1671
  return {
1568
1672
  'isGFFCtx' : isGFFCtx,
@@ -1572,10 +1676,10 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1572
1676
  }
1573
1677
  }
1574
1678
  // Merging user validators
1575
- // To debug, open inspector and look into `Extra Scripts`
1679
+ // To debug, open inspector and look into `Extra Scripts`
1576
1680
  if ( hasUserValidators() ) {
1577
1681
  var userValidator = null, filename = null;
1578
- try {
1682
+ try {
1579
1683
  for (let v in gina.forms.validators) {
1580
1684
  filename = '/validators/'+ v + '/main.js';
1581
1685
  // setting default local error
@@ -1586,12 +1690,12 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1586
1690
  userValidator = bufferToString(gina.forms.validators[v].data); // ok
1587
1691
  var passedContext = 'var validationContext = this.getValidationContext(),isGFFCtx = validationContext.isGFFCtx,self = validationContext.self,local = validationContext.local,replace = validationContext.replace;';
1588
1692
  userValidator = userValidator.replace(/(\)\s+\{|\)\{){1}/, '$&\n\t'+ passedContext);
1589
-
1693
+
1590
1694
  //userValidator += '\n//#sourceURL='+ v +'.js';
1591
1695
  } else {
1592
1696
  userValidator = gina.forms.validators[v].toString();
1593
1697
  }
1594
-
1698
+
1595
1699
  self[el][v] = eval('(' + userValidator + ')\n//# sourceURL='+ v +'.js');
1596
1700
  //self[el][v] = Function('errorMessage', 'errorStack', userValidator);
1597
1701
  }
@@ -1599,22 +1703,22 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1599
1703
  throw new Error('[UserFormValidator] Could not evaluate: `'+ filename +'`\n'+userValidatorError.stack);
1600
1704
  }
1601
1705
  }
1602
- } // EO addField(el, value)
1603
-
1604
-
1605
- for (let el in self) {
1706
+ } // EO addField(el, value)
1707
+
1708
+
1709
+ for (let el in self) {
1606
1710
  // Adding fields & validators to context
1607
1711
  addField(el, self[el]);
1608
1712
  }
1609
-
1713
+
1610
1714
  self['addField'] = function(el, value) {
1611
1715
  if ( typeof(self[el]) != 'undefined' ) {
1612
1716
  return
1613
1717
  }
1614
1718
  addField(el, value);
1615
1719
  };
1616
-
1617
-
1720
+
1721
+
1618
1722
  // self['getExcludedFields'] = function() {
1619
1723
  // return local.excluded;
1620
1724
  // };
@@ -1644,33 +1748,33 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1644
1748
  // }
1645
1749
  for (var r in self[field]) {
1646
1750
  // no error for the current field rule
1647
- if (
1751
+ if (
1648
1752
  typeof(errors[field]) != 'object'
1649
1753
  ||
1650
1754
  typeof(errors[field][r]) == 'undefined'
1651
1755
  ) {
1652
1756
  continue;
1653
1757
  }
1654
-
1655
-
1656
- if (
1657
- typeof(self[field].valid) != 'undefined'
1658
- && /^true$/i.test(self[field].valid)
1758
+
1759
+
1760
+ if (
1761
+ typeof(self[field].valid) != 'undefined'
1762
+ && /^true$/i.test(self[field].valid)
1659
1763
  ) {
1660
1764
  delete errors[field][r];
1661
1765
  continue;
1662
1766
  }
1663
-
1664
-
1767
+
1768
+
1665
1769
  if ( typeof( self[field]['errors']) == 'undefined' ) {
1666
1770
  self[field]['errors'] = {}
1667
1771
  }
1668
-
1669
- self[field]['errors'][r] = errors[field][r];
1772
+
1773
+ self[field]['errors'][r] = errors[field][r];
1670
1774
  }
1671
-
1775
+
1672
1776
  // if field does not have errors, remove errors[field]
1673
- if (
1777
+ if (
1674
1778
  typeof(self[field]['errors']) == 'undefined'
1675
1779
  && typeof(errors[field]) != 'undefined'
1676
1780
  ||
@@ -1687,34 +1791,34 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1687
1791
  /**
1688
1792
  * getErrors
1689
1793
  * NB.: This portion is shared between the front & the back
1690
- *
1794
+ *
1691
1795
  * @param {string} [fieldName]
1692
- *
1796
+ *
1693
1797
  * @returns errors
1694
1798
  */
1695
1799
  self['getErrors'] = function(fieldName) {
1696
1800
  var errors = {};
1697
-
1801
+
1698
1802
  if ( typeof(fieldName) != 'undefined' ) {
1699
1803
  if ( typeof(self[fieldName]) != 'undefined' && self[fieldName] && typeof(self[fieldName]['errors']) != 'undefined' && self[fieldName]['errors'].count() > 0 ) {
1700
1804
  errors[fieldName] = self[fieldName]['errors'];
1701
- }
1805
+ }
1702
1806
  return errors
1703
1807
  }
1704
-
1808
+
1705
1809
  for (var field in self) {
1706
- if (
1810
+ if (
1707
1811
  typeof(self[field]) != 'object'
1708
1812
  ) {
1709
1813
  continue;
1710
1814
  }
1711
-
1815
+
1712
1816
  if ( typeof(self[field]['errors']) != 'undefined' ) {
1713
1817
  if ( self[field]['errors'].count() > 0)
1714
1818
  errors[field] = self[field]['errors'];
1715
1819
  }
1716
1820
  }
1717
-
1821
+
1718
1822
  return errors
1719
1823
  }
1720
1824
 
@@ -1731,7 +1835,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
1731
1835
  // local.data = JSON.parse(JSON.stringify(local.data).replace(/\"(true|false)\"/gi, '$1'))
1732
1836
  return local.data
1733
1837
  }
1734
-
1838
+
1735
1839
  /**@js_externs replace*/
1736
1840
  var replace = function(target, fieldObj) {
1737
1841
  var keys = target.match(/%[a-z]+/gi);