gina 0.1.1-alpha.21 → 0.1.1-alpha.210

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 (369) 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.21/lib/inherits → v0.1.1-alpha.210}/LICENSE +1 -1
  10. package/framework/v0.1.1-alpha.210/VERSION +1 -0
  11. package/framework/{v0.1.1-alpha.21/core/asset/js/plugin/readme.md → v0.1.1-alpha.210/core/asset/plugin/README.md} +31 -9
  12. package/framework/v0.1.1-alpha.210/core/asset/plugin/dist/vendor/gina/css/gina.min.css +1 -0
  13. package/framework/v0.1.1-alpha.210/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
  14. package/framework/v0.1.1-alpha.210/core/asset/plugin/dist/vendor/gina/html/toolbar.html +251 -0
  15. package/framework/{v0.1.1-alpha.21/core/asset/js/plugin/dist → v0.1.1-alpha.210/core/asset/plugin/dist/vendor/gina/js}/gina.js +4364 -3175
  16. package/framework/v0.1.1-alpha.210/core/asset/plugin/dist/vendor/gina/js/gina.min.js +764 -0
  17. package/framework/v0.1.1-alpha.210/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
  18. package/framework/v0.1.1-alpha.210/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +5 -0
  19. package/framework/v0.1.1-alpha.210/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
  20. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/config.js +172 -79
  21. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/connectors/couchbase/index.js +373 -259
  22. package/framework/v0.1.1-alpha.210/core/connectors/couchbase/lib/connector.js +22 -0
  23. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/connectors/couchbase/lib/connector.v2.js +51 -51
  24. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/connectors/couchbase/lib/connector.v3.js +51 -51
  25. package/framework/v0.1.1-alpha.210/core/connectors/couchbase/lib/connector.v4.js +384 -0
  26. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/connectors/couchbase/lib/n1ql.js +3 -2
  27. package/framework/v0.1.1-alpha.210/core/connectors/couchbase/lib/session-store.js +22 -0
  28. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/connectors/couchbase/lib/session-store.v3.js +12 -12
  29. package/framework/v0.1.1-alpha.210/core/connectors/couchbase/lib/session-store.v4.js +361 -0
  30. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/controller/controller.js +921 -773
  31. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/dev/index.js +1 -1
  32. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/dev/lib/class.js +1 -1
  33. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/dev/lib/factory.js +2 -2
  34. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/gna.js +13 -9
  35. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/locales/README.md +5 -0
  36. package/framework/v0.1.1-alpha.210/core/locales/dist/region/en.json +5727 -0
  37. package/framework/v0.1.1-alpha.210/core/locales/dist/region/fr.json +11452 -0
  38. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/locales/index.js +2 -2
  39. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/locales/src/make.js +39 -41
  40. package/framework/v0.1.1-alpha.210/core/locales/src/resources/region.mapping.json +43 -0
  41. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/model/entity.js +87 -67
  42. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/model/index.js +16 -16
  43. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/model/template/entityFactory.js +1 -1
  44. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/model/template/index.js +17 -15
  45. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/index.js +1 -1
  46. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/file/package.json +1 -1
  47. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/intl/package.json +1 -1
  48. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/intl/src/main.js +5 -5
  49. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/storage/package.json +1 -1
  50. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/storage/src/main.js +6 -5
  51. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/validator/package.json +1 -1
  52. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/validator/src/form-validator.js +403 -300
  53. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/validator/src/main.js +1368 -1314
  54. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/router.js +99 -90
  55. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/server.isaac.js +203 -180
  56. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/server.js +439 -238
  57. package/framework/v0.1.1-alpha.210/core/template/boilerplate/bundle/config/settings.json +12 -0
  58. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle/config/settings.server.json +4 -4
  59. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle/config/templates.json +4 -4
  60. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle/controllers/controller.content.js +1 -1
  61. package/framework/v0.1.1-alpha.210/core/template/boilerplate/bundle/controllers/setup.js +111 -0
  62. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle/index.js +13 -1
  63. package/framework/v0.1.1-alpha.210/core/template/boilerplate/bundle_templates/html/content/homepage.html +8 -0
  64. package/framework/v0.1.1-alpha.210/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +11 -0
  65. package/framework/v0.1.1-alpha.210/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +8 -0
  66. package/framework/{v0.1.1-alpha.21/core/template/boilerplate/bundle_templates/html/layout → v0.1.1-alpha.210/core/template/boilerplate/bundle_templates/html/layouts}/main.html +10 -3
  67. package/framework/v0.1.1-alpha.210/core/template/command/gina.bat.tpl +8 -0
  68. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/command/gina.tpl +4 -4
  69. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/conf/env.json +11 -0
  70. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/conf/package.json +1 -1
  71. package/framework/v0.1.1-alpha.210/core/template/conf/statics.json +12 -0
  72. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/conf/templates.json +2 -2
  73. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/console.js +3 -3
  74. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/context.js +148 -7
  75. package/framework/v0.1.1-alpha.210/helpers/data/LICENSE +9 -0
  76. package/framework/v0.1.1-alpha.210/helpers/data/README.md +12 -0
  77. package/framework/v0.1.1-alpha.210/helpers/data/package.json +20 -0
  78. package/framework/v0.1.1-alpha.210/helpers/data/src/main.js +295 -0
  79. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/dateFormat.js +9 -7
  80. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/index.js +13 -8
  81. package/framework/v0.1.1-alpha.210/helpers/json/LICENSE +9 -0
  82. package/framework/v0.1.1-alpha.210/helpers/json/README.md +12 -0
  83. package/framework/{v0.1.1-alpha.21/helpers/plugins → v0.1.1-alpha.210/helpers/json}/package.json +2 -2
  84. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/json/src/main.js +28 -26
  85. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/path.js +176 -96
  86. package/framework/{v0.1.1-alpha.21/helpers/json → v0.1.1-alpha.210/helpers/plugins}/package.json +2 -2
  87. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/plugins/src/api-error.js +23 -23
  88. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/plugins/src/main.js +3 -3
  89. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/prototypes.js +46 -38
  90. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/task.js +21 -14
  91. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/text.js +2 -2
  92. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/archiver/package.json +1 -1
  93. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/archiver/src/dep/jszip.min.js +3 -3
  94. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/archiver/src/main.js +168 -168
  95. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/aliases.json +4 -1
  96. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/add.js +84 -27
  97. package/framework/v0.1.1-alpha.210/lib/cmd/bundle/arguments.json +7 -0
  98. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/help.txt +4 -2
  99. package/framework/v0.1.1-alpha.210/lib/cmd/bundle/list.js +176 -0
  100. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/remove.js +36 -27
  101. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/start.js +264 -46
  102. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/stop.js +93 -74
  103. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/env/add.js +44 -43
  104. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/env/list.js +23 -4
  105. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/env/remove.js +19 -19
  106. package/framework/{v0.1.1-alpha.21/lib/cmd/scope → v0.1.1-alpha.210/lib/cmd/env}/use.js +21 -1
  107. package/framework/v0.1.1-alpha.210/lib/cmd/framework/build.js +88 -0
  108. package/framework/v0.1.1-alpha.210/lib/cmd/framework/init.js +798 -0
  109. package/framework/v0.1.1-alpha.210/lib/cmd/framework/link-node-modules.js +116 -0
  110. package/framework/v0.1.1-alpha.210/lib/cmd/framework/link.js +114 -0
  111. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/open.js +22 -1
  112. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/restart.js +61 -26
  113. package/framework/v0.1.1-alpha.210/lib/cmd/framework/set.js +285 -0
  114. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/start.js +46 -20
  115. package/framework/v0.1.1-alpha.210/lib/cmd/framework/status.js +141 -0
  116. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/stop.js +47 -28
  117. package/framework/v0.1.1-alpha.210/lib/cmd/framework/tail.js +302 -0
  118. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/version.js +15 -3
  119. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/helper.js +131 -18
  120. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/index.js +23 -23
  121. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/port/inc/scan.js +32 -16
  122. package/framework/v0.1.1-alpha.210/lib/cmd/port/list.js +462 -0
  123. package/framework/v0.1.1-alpha.210/lib/cmd/port/reset.js +429 -0
  124. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/add.js +147 -122
  125. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/arguments.json +2 -1
  126. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/build.js +28 -28
  127. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/list.js +19 -2
  128. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/remove.js +19 -17
  129. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/rename.js +11 -11
  130. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/protocol/set.js +256 -209
  131. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/scope/list.js +27 -8
  132. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/scope/remove.js +19 -19
  133. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/view/add.js +35 -10
  134. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/collection/package.json +1 -1
  135. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/collection/src/main.js +243 -242
  136. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/config.js +31 -30
  137. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cron/package.json +1 -1
  138. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cron/src/main.js +10 -9
  139. package/framework/v0.1.1-alpha.210/lib/domain/LICENSE +9 -0
  140. package/framework/v0.1.1-alpha.210/lib/domain/README.md +46 -0
  141. package/framework/v0.1.1-alpha.210/lib/domain/dist/public_suffix_list.dat +14186 -0
  142. package/framework/v0.1.1-alpha.210/lib/domain/package.json +20 -0
  143. package/framework/v0.1.1-alpha.210/lib/domain/src/main.js +442 -0
  144. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/generator/index.js +5 -5
  145. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/index.js +3 -2
  146. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210/lib/inherits}/LICENSE +1 -1
  147. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/inherits/README.md +2 -2
  148. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/inherits/package.json +3 -4
  149. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/inherits/src/main.js +3 -3
  150. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/package.json +2 -2
  151. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/src/containers/default/index.js +13 -2
  152. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/src/containers/file/index.js +109 -14
  153. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/src/containers/mq/index.js +12 -3
  154. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/src/containers/mq/listener.js +16 -14
  155. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/src/containers/mq/speaker.js +32 -3
  156. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/src/helper.js +21 -1
  157. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/src/main.js +36 -9
  158. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/math/index.js +9 -9
  159. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/merge/README.md +2 -2
  160. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/merge/package.json +1 -1
  161. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/merge/src/main.js +118 -91
  162. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/model.js +10 -10
  163. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/proc.js +87 -49
  164. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/routing/package.json +1 -1
  165. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/routing/src/main.js +313 -285
  166. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/session-store.js +6 -6
  167. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/shell.js +3 -3
  168. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/swig-filters/package.json +1 -1
  169. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/swig-filters/src/main.js +140 -119
  170. package/framework/v0.1.1-alpha.210/lib/url/README.md +0 -0
  171. package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/validator.js +2 -2
  172. package/framework/v0.1.1-alpha.210/package.json +14 -0
  173. package/package.json +37 -25
  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 +496 -139
  180. package/script/pre_install.js +489 -77
  181. package/services/.gna/67fdf1b224a2ed5597e63d4b64283834468e05e3.txt +0 -0
  182. package/services/.gna/arch +1 -0
  183. package/services/.gna/locals.json +14 -0
  184. package/services/.gna/platform +1 -0
  185. package/services/configure +6 -0
  186. package/services/env.json +18 -0
  187. package/services/manifest.json +30 -0
  188. package/services/package.json +11 -0
  189. package/services/src/proxy/config/app.json +6 -0
  190. package/services/src/proxy/config/routing.json +11 -0
  191. package/services/src/proxy/config/settings.json +9 -0
  192. package/services/src/proxy/config/settings.server.json +31 -0
  193. package/services/src/proxy/config/statics.json +3 -0
  194. package/services/src/proxy/controllers/controller.content.js +58 -0
  195. package/services/src/proxy/controllers/controller.js +30 -0
  196. package/{framework/v0.1.1-alpha.21/core/template/boilerplate/bundle → services/src/proxy}/controllers/setup.js +14 -14
  197. package/services/src/proxy/index.js +31 -0
  198. package/services/src/proxy/lib/domain/README.md +48 -0
  199. package/services/src/proxy/lib/domain/src/config/public_suffix_list.dat +14186 -0
  200. package/services/src/toolbar/config/app.json +6 -0
  201. package/services/src/toolbar/config/routing.json +11 -0
  202. package/{framework/v0.1.1-alpha.21/core/template/boilerplate/bundle → services/src/toolbar}/config/settings.json +0 -0
  203. package/services/src/toolbar/config/settings.server.json +30 -0
  204. package/services/src/toolbar/controllers/controller.content.js +39 -0
  205. package/services/src/toolbar/controllers/controller.js +30 -0
  206. package/services/src/toolbar/controllers/setup.js +111 -0
  207. package/services/src/toolbar/index.js +43 -0
  208. package/utils/helper.js +236 -185
  209. package/utils/prototypes.js +9 -9
  210. package/utils/prototypes.json_clone.js +70 -37
  211. package/doc/framework/cli/doc.json +0 -9
  212. package/doc/framework/index.md +0 -60
  213. package/framework/v0.1.1-alpha.21/VERSION +0 -1
  214. package/framework/v0.1.1-alpha.21/core/asset/js/plugin/dist/gina.js.map +0 -56
  215. package/framework/v0.1.1-alpha.21/core/asset/js/plugin/dist/gina.min.css +0 -1
  216. package/framework/v0.1.1-alpha.21/core/asset/js/plugin/dist/gina.min.css.map +0 -1
  217. package/framework/v0.1.1-alpha.21/core/asset/js/plugin/dist/gina.min.js +0 -736
  218. package/framework/v0.1.1-alpha.21/core/asset/js/plugin/dist/gina.min.js.map +0 -56
  219. package/framework/v0.1.1-alpha.21/core/asset/js/plugin/dist/gina.onload.min.js +0 -5
  220. package/framework/v0.1.1-alpha.21/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
  221. package/framework/v0.1.1-alpha.21/core/connectors/couchbase/lib/connector.js +0 -20
  222. package/framework/v0.1.1-alpha.21/core/connectors/couchbase/lib/session-store.js +0 -21
  223. package/framework/v0.1.1-alpha.21/core/locales/dist/region/en.json +0 -9492
  224. package/framework/v0.1.1-alpha.21/core/locales/dist/region/fr.json +0 -9492
  225. package/framework/v0.1.1-alpha.21/core/locales/src/resources/region.mapping.json +0 -28
  226. package/framework/v0.1.1-alpha.21/core/template/boilerplate/bundle_templates/html/homepage.html +0 -4
  227. package/framework/v0.1.1-alpha.21/core/template/conf/statics.json +0 -10
  228. package/framework/v0.1.1-alpha.21/lib/cmd/bundle/arguments.json +0 -4
  229. package/framework/v0.1.1-alpha.21/lib/cmd/bundle/list.js +0 -129
  230. package/framework/v0.1.1-alpha.21/lib/cmd/framework/init.js +0 -514
  231. package/framework/v0.1.1-alpha.21/lib/cmd/framework/set.js +0 -161
  232. package/framework/v0.1.1-alpha.21/lib/cmd/framework/status.js +0 -72
  233. package/framework/v0.1.1-alpha.21/lib/cmd/framework/tail.js +0 -183
  234. package/framework/v0.1.1-alpha.21/lib/cmd/port/list.js +0 -176
  235. package/framework/v0.1.1-alpha.21/package.json +0 -14
  236. package/script/prepare_version.js +0 -429
  237. /package/{framework/v0.1.1-alpha.21/core/template/command/gina.bat.tpl → bin/gina.bat} +0 -0
  238. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/AUTHORS +0 -0
  239. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/asset/html/nolayout.html +0 -0
  240. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/asset/html/static.html +0 -0
  241. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/asset/img/android-chrome-192x192.png +0 -0
  242. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/asset/img/android-chrome-512x512.png +0 -0
  243. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/asset/img/apple-touch-icon.png +0 -0
  244. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/asset/img/favicon-16x16.png +0 -0
  245. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/asset/img/favicon-32x32.png +0 -0
  246. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/asset/img/favicon.ico +0 -0
  247. /package/framework/{v0.1.1-alpha.21/core/asset/js → v0.1.1-alpha.210/core/asset}/plugin/uuid.json +0 -0
  248. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  249. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/controller/controller.framework.js +0 -0
  250. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/controller/index.js +0 -0
  251. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/busboy/.travis.yml +0 -0
  252. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/busboy/LICENSE +0 -0
  253. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/busboy/README.md +0 -0
  254. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
  255. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/busboy/deps/encoding/encoding.js +0 -0
  256. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/busboy/lib/main.js +0 -0
  257. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/busboy/lib/types/multipart.js +0 -0
  258. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/busboy/lib/types/urlencoded.js +0 -0
  259. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/busboy/lib/utils.js +0 -0
  260. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/busboy/package.json +0 -0
  261. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  262. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/dev/lib/tools.js +0 -0
  263. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/locales/currency.json +0 -0
  264. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/locales/dist/language/en.json +0 -0
  265. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/locales/dist/language/fr.json +0 -0
  266. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/locales/src/resources/currency.csv +0 -0
  267. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/locales/src/resources/region.csv +0 -0
  268. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/mime.types +0 -0
  269. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/README.md +0 -0
  270. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/file/README.md +0 -0
  271. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/file/build.json +0 -0
  272. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/intl/README.md +0 -0
  273. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/intl/build.json +0 -0
  274. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/storage/README.md +0 -0
  275. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/storage/build.json +0 -0
  276. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/validator/README.md +0 -0
  277. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/plugins/lib/validator/build.json +0 -0
  278. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/server.express.js +0 -0
  279. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/status.codes +0 -0
  280. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle/config/app.json +0 -0
  281. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle/config/routing.json +0 -0
  282. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  283. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  284. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  285. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  286. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  287. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  288. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle_public/readme.md +0 -0
  289. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  290. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/conf/manifest.json +0 -0
  291. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/conf/settings.json +0 -0
  292. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/error/client/json/401.json +0 -0
  293. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/error/client/json/403.json +0 -0
  294. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/error/client/json/404.json +0 -0
  295. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/error/server/html/50x.html +0 -0
  296. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/error/server/json/500.json +0 -0
  297. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/error/server/json/503.json +0 -0
  298. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/core/template/extensions/logger/config.json +0 -0
  299. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/helpers/plugins/README.md +0 -0
  300. /package/framework/{v0.1.1-alpha.21/helpers/json → v0.1.1-alpha.210/lib/archiver}/README.md +0 -0
  301. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/archiver/build.json +0 -0
  302. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/copy.js +0 -0
  303. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/cp.js +0 -0
  304. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/help.js +0 -0
  305. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/rename.js +0 -0
  306. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/restart.js +0 -0
  307. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/rm.js +0 -0
  308. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/bundle/status.js +0 -0
  309. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/env/get.js +0 -0
  310. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/env/help.js +0 -0
  311. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/env/help.txt +0 -0
  312. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/env/link-dev.js +0 -0
  313. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/env/rm.js +0 -0
  314. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/env/set.js +0 -0
  315. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/env/unset.js +0 -0
  316. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/dot.js +0 -0
  317. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/get.js +0 -0
  318. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/help.js +0 -0
  319. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/help.txt +0 -0
  320. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/msg.json +0 -0
  321. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/framework/update.js +0 -0
  322. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/gina-dev.1.md +0 -0
  323. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/gina-framework.1.md +0 -0
  324. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/gina.1.md +0 -0
  325. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/msg.json +0 -0
  326. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/port/help.js +0 -0
  327. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/port/help.txt +0 -0
  328. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/port/set.js +0 -0
  329. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/help.js +0 -0
  330. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/help.txt +0 -0
  331. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/import.js +0 -0
  332. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/move.js +0 -0
  333. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/restart.js +0 -0
  334. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/rm.js +0 -0
  335. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/start.js +0 -0
  336. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/status.js +0 -0
  337. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/project/stop.js +0 -0
  338. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/protocol/help.js +0 -0
  339. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/protocol/help.txt +0 -0
  340. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/protocol/list.js +0 -0
  341. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/scope/help.js +0 -0
  342. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/scope/help.txt +0 -0
  343. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/scope/link-local.js +0 -0
  344. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/scope/rm.js +0 -0
  345. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/scope/set.js +0 -0
  346. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cmd/scope/unset.js +0 -0
  347. /package/framework/{v0.1.1-alpha.21/lib/cmd/env → v0.1.1-alpha.210/lib/cmd/scope}/use.js +0 -0
  348. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/collection/README.md +0 -0
  349. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/collection/build.json +0 -0
  350. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/cron/README.md +0 -0
  351. /package/framework/{v0.1.1-alpha.21/lib/archiver/README.md → v0.1.1-alpha.210/lib/domain/exemples/backend.js} +0 -0
  352. /package/framework/{v0.1.1-alpha.21/lib/routing/README.md → v0.1.1-alpha.210/lib/domain/exemples/frontend.html} +0 -0
  353. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  354. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/inherits/example/protected_inheritance.js +0 -0
  355. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/inherits/example/simple_inheritance.js +0 -0
  356. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  357. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/README.md +0 -0
  358. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  359. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  360. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/merge/example/merge.js +0 -0
  361. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/merge/example/merge_2_literal objects.js +0 -0
  362. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/merge/example/merge_and_preserve_first.js +0 -0
  363. /package/framework/{v0.1.1-alpha.21/lib/swig-filters → v0.1.1-alpha.210/lib/routing}/README.md +0 -0
  364. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/routing/build.json +0 -0
  365. /package/framework/{v0.1.1-alpha.21/lib/url → v0.1.1-alpha.210/lib/swig-filters}/README.md +0 -0
  366. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/url/index.js +0 -0
  367. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/url/mocks.json +0 -0
  368. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/url/routing.json +0 -0
  369. /package/framework/{v0.1.1-alpha.21 → v0.1.1-alpha.210}/lib/url/test.js +0 -0
@@ -0,0 +1,295 @@
1
+ /*
2
+ * This file is part of the gina package.
3
+ * Copyright (c) 2009-2023 Rhinostone <contact@gina.io>
4
+ *
5
+ * For the full copyright and license information, please view the LICENSE
6
+ * file that was distributed with this source code.
7
+ */
8
+
9
+
10
+ /**
11
+ * DataHelper
12
+ *
13
+ * @package Gina.Lib.Helpers
14
+ * @author Rhinostone <contact@gina.io>
15
+ * @api public
16
+ * */
17
+
18
+ function DataHelper(){
19
+
20
+ /** imports */
21
+ var isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;
22
+ // if (!isGFFCtx) {
23
+ // var console = require('./../../../lib/logger');
24
+ // }
25
+
26
+ encodeRFC5987ValueChars = function(str) {
27
+ // return encodeURIComponent(str).
28
+ // // Bien que la RFC 3986 réserve "!", RFC 5987 ne réserve pas ce caractère,
29
+ // // il n'est donc pas nécessaire l'échapper
30
+ // replace(/['()*]/g, c => '%' + c.charCodeAt(0).toString(16)). // i.e., %27 %28 %29 %2a
31
+ // // on notera que l'encodage valide pour "*" est %2A et qui faut donc appeler toUpperCase()
32
+ // // pour encoder exactement.
33
+
34
+ // // Selon la RFC 5987 ce qui suit n'est pas nécessairement requis
35
+ // // on peut donc bénéficier d'un peu plus de lisibilité : |`^
36
+ // replace(/%(7C|60|5E)/g, (str, hex) => String.fromCharCode(parseInt(hex, 16)));
37
+
38
+ // return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
39
+ // return '%' + c.charCodeAt(0).toString(16);
40
+ // });
41
+
42
+ return encodeURIComponent(str).
43
+ // Bien que la RFC 3986 réserve "!", RFC 5987 ne réserve pas ce caractère,
44
+ // il n'est donc pas nécessaire l'échapper
45
+ replace(/['()]/g, escape). // c'est-à-dire %27 %28 %29
46
+ replace(/\*/g, '%2A').
47
+ // Selon la RFC 5987 ce qui suit n'est pas nécessairement requis
48
+ // on peut donc bénéficier d'un peu plus de lisibilité : |`^
49
+ replace(/%(?:7C|60|5E)/g, unescape);
50
+ };
51
+
52
+ /**
53
+ * Convert JSON string with structured keys to object
54
+ *
55
+ * @param {string} JSON string with structured keys
56
+ * */
57
+ formatDataFromString = function(bodyStr){
58
+
59
+ if ( typeof(bodyStr) == 'object' ) {
60
+ bodyStr = JSON.stringify(bodyStr)
61
+ }
62
+
63
+ try {
64
+ bodyStr = decodeURIComponent(bodyStr);
65
+ } catch (err) {
66
+ // Already decoded - ignoring
67
+ }
68
+
69
+ // false & true case
70
+ if ( /(\"false\"|\"true\"|\"on\")/.test(bodyStr) ) {
71
+ bodyStr = bodyStr.replace(/\"false\"/g, false).replace(/\"true\"/g, true).replace(/\"on\"/g, true);
72
+ }
73
+ if ( /(\"null\")/i.test(bodyStr) ) {
74
+ bodyStr = bodyStr.replace(/\"null\"/ig, null);
75
+ }
76
+
77
+ return parseBody(bodyStr);
78
+ }
79
+
80
+ var parseCollection = function (collection, obj) {
81
+
82
+ for(var i = 0, len = collection.length; i<len; ++i) {
83
+ obj[i] = parseObject(collection[i], obj);
84
+ }
85
+
86
+ return obj
87
+ }
88
+
89
+ var parseObject = function (tmp, obj) {
90
+ var el = []
91
+ , key = null
92
+ ;
93
+
94
+ if (!obj) {
95
+ obj = {}
96
+ }
97
+
98
+ for (let o in tmp) {
99
+
100
+ el[0] = o;
101
+ el[1] = tmp[o];
102
+
103
+ if ( /^(.*)\[(.*)\]/.test(el[0]) ) { // some[field] ?
104
+ key = el[0].replace(/\]/g, '').split(/\[/g);
105
+ obj = parseLocalObj(obj, key, 0, el[1])
106
+ } else {
107
+ obj[ el[0] ] = el[1]
108
+ }
109
+ }
110
+
111
+ return obj
112
+ }
113
+
114
+ var parseBody = function(body) {
115
+ var obj = null
116
+ , tmp = null
117
+ , arr = null
118
+ , isArrayType = null
119
+ ;
120
+ if ( /^(\{|\[|\%7B|\%5B)/.test(body) ) {
121
+ try {
122
+ isArrayType = ( /^(\{|\%7B)/.test(body) ) ? false : true;
123
+ obj = ( isArrayType ) ? [] : {};
124
+
125
+ if ( /^(\%7B|\%5B)/.test(body) ) {
126
+ tmp = JSON.parse(decodeURIComponent(body))
127
+ } else {
128
+ tmp = JSON.parse(body)
129
+ }
130
+
131
+ if ( Array.isArray(tmp) ) {
132
+ obj = parseCollection(tmp, obj)
133
+ } else {
134
+ obj = parseObject(tmp, obj)
135
+ }
136
+
137
+ return obj
138
+ } catch (err) {
139
+ console.error('[365] could not parse body:\n' + body)
140
+ }
141
+
142
+ } else {
143
+ obj = {};
144
+ arr = body.split(/&/g);
145
+ if ( /(\"false\"|\"true\"|\"on\")/.test(body) )
146
+ body = body.replace(/\"false\"/g, false).replace(/\"true\"/g, true).replace(/\"on\"/g, true);
147
+
148
+
149
+ var el = {}
150
+ , value = null
151
+ , key = null;
152
+
153
+ for (var i = 0, len = arr.length; i < len; ++i) {
154
+ if (!arr[i]) continue;
155
+
156
+ arr[i] = decodeURIComponent(arr[i]);
157
+
158
+ if ( /^\{/.test(arr[i]) || /\=\{/.test(arr[i]) || /\=\[/.test(arr[i]) ) {
159
+ try {
160
+ if (/^\{/.test(arr[i])) {
161
+ obj = JSON.parse(arr[i]);
162
+ break;
163
+ } else {
164
+ el = arr[i].match(/\=(.*)/);
165
+ el[0] = arr[i].split(/\=/)[0];
166
+ obj[ el[0] ] = JSON.parse( el[1] );
167
+ }
168
+
169
+
170
+ } catch (err) {
171
+ console.error('[parseBody#1] could not parse body:\n' + arr[i])
172
+ }
173
+ } else {
174
+ el = arr[i].split(/=/);
175
+ if ( /\{\}\"\:/.test(el[1]) ) { //might be a json
176
+ try {
177
+ el[1] = JSON.parse(el[1])
178
+ } catch (err) {
179
+ console.error('[parseBody#2] could not parse body:\n' + el[1])
180
+ }
181
+ }
182
+
183
+ if ( typeof(el[1]) == 'string' && !/\[object /.test(el[1])) {
184
+ key = null;
185
+ el[0] = decodeURIComponent(el[0]);
186
+ el[1] = decodeURIComponent(el[1]);
187
+
188
+ if ( /^(.*)\[(.*)\]/.test(el[0]) ) { // some[field] ?
189
+ key = el[0].replace(/\]/g, '').split(/\[/g);
190
+ obj = parseLocalObj(obj, key, 0, el[1])
191
+ } else {
192
+ obj[ el[0] ] = el[1]
193
+ }
194
+ }
195
+ }
196
+ }
197
+
198
+ return obj
199
+ }
200
+ }
201
+
202
+ // var parseLocalObj = function(obj, key, k, value) {
203
+ // if ( typeof(obj[ key[k] ]) == 'undefined' ) {
204
+ // obj[ key[k] ] = {};
205
+ // }
206
+
207
+ // for (var prop in obj) {
208
+
209
+ // if (k == key.length-1) {
210
+
211
+ // if (prop == key[k]) {
212
+ // obj[prop] = ( typeof(value) != 'undefined' ) ? value : '';
213
+ // }
214
+
215
+ // } else if ( key.indexOf(prop) > -1 ) {
216
+ // ++k;
217
+ // if ( !obj[prop][ key[k] ] )
218
+ // obj[prop][ key[k] ] = {};
219
+
220
+
221
+ // parseLocalObj(obj[prop], key, k, value)
222
+
223
+ // }
224
+ // }
225
+
226
+ // return obj;
227
+ // }
228
+
229
+ var parseLocalObj = function(obj, key, k, value) {
230
+
231
+ for (let i=0,len=key.length; i<len; i++) {
232
+ // by default
233
+ let _key = key[k];
234
+ if (i == k) {
235
+ // Array or Object ?
236
+ if ( typeof(obj[ key[k] ]) == 'undefined' || typeof(obj[ key[k] ]) == 'string' ) {
237
+ if ( Array.isArray(obj) ) {
238
+ // index
239
+ // _key = obj.length;
240
+ _key = ~~key[k];
241
+ obj[ _key ] = ( /^\d+$/.test(key[k+1]) ) ? [] : {};
242
+ } else {
243
+ obj[ key[k] ] = ( /^\d+$/.test(key[k+1]) ) ? [] : {};
244
+ }
245
+ }
246
+
247
+ // Assinging value
248
+ if (k == key.length-1) {
249
+ let _value = ( typeof(value) != 'undefined' ) ? value : '';
250
+ if ( Array.isArray( obj[key[k]] ) ) {
251
+ obj[key[k]].push(_value);
252
+ // _key = (obj.length > 0) ? obj.length-1 : 0;
253
+ // obj[ _key ] = _value;
254
+ }
255
+ else {
256
+ obj[ key[k] ] = _value;
257
+ }
258
+ break;
259
+ }
260
+ // Assinging index or key
261
+ else {
262
+ if ( /^\d+$/.test(key[k]) && !Array.isArray(obj) ) {
263
+ obj = [];
264
+ // _key = (obj.length > 0) ? obj.length-1 : 0;
265
+ }
266
+ // Handle unstructured array from object
267
+ // E.G.: design[1][id] where design is starting with `1` index instead of `0`
268
+ // if ( Array.isArray(obj) ) {
269
+ // // current Index
270
+ // _key = ~~key[k];
271
+ // // _key = (obj.length > 0) ? obj.length-1 : 0;
272
+ // }
273
+ // Init array or object
274
+ if ( typeof(obj[ _key ]) == 'undefined' ) {
275
+ // obj[ _key ] = ( /^\d+$/.test(key[k+1]) ) ? [] : {};
276
+ obj[ _key ] = null;
277
+ }
278
+
279
+ parseLocalObj(obj[ _key ], key, k+1, value);
280
+ }
281
+ }
282
+ }
283
+
284
+ return obj;
285
+ }
286
+
287
+ } //EO DataHelper
288
+
289
+ if ( ( typeof(module) !== 'undefined' ) && module.exports ) {
290
+ // Publish as node.js module
291
+ module.exports = DataHelper
292
+ } else if ( typeof(define) === 'function' && define.amd) {
293
+ // Publish as AMD module
294
+ define(function(){ return DataHelper() })
295
+ }
@@ -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.
@@ -30,7 +30,7 @@
30
30
  function DateFormatHelper() {
31
31
 
32
32
  var isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;
33
- var merge = (isGFFCtx) ? require('utils/merge') : require('./../lib/merge');
33
+ var merge = (isGFFCtx) ? require('lib/merge') : require('./../lib/merge');
34
34
 
35
35
 
36
36
  // if ( typeof(define) === 'function' && define.amd ) {
@@ -65,6 +65,7 @@ function DateFormatHelper() {
65
65
  shortIsoTime: "HH:MM",
66
66
  longIsoTime: "HH:MM:ss TT",
67
67
  isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
68
+ longIsoDateTime: "yyyy-mm-dd'T'HH:MM:ss.L",
68
69
  isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
69
70
  };
70
71
 
@@ -125,7 +126,7 @@ function DateFormatHelper() {
125
126
  var format = function(date, mask, utc) {
126
127
 
127
128
  // if ( typeof(merge) == 'undefined' || !merge ) {
128
- // merge = (isGFFCtx) ? require('utils/merge') : require('./../lib/merge');
129
+ // merge = (isGFFCtx) ? require('lib/merge') : require('./../lib/merge');
129
130
 
130
131
  // }
131
132
 
@@ -140,7 +141,7 @@ function DateFormatHelper() {
140
141
  } catch( mergeErr) {
141
142
  // called from logger - redefinition needed for none-dev env: cache issue
142
143
  isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;
143
- merge = (isGFFCtx) ? require('utils/merge') : require('./../lib/merge');
144
+ merge = (isGFFCtx) ? require('lib/merge') : require('./../lib/merge');
144
145
  masksList = merge(i18n.masks, dF.masks);
145
146
  }
146
147
 
@@ -209,7 +210,8 @@ function DateFormatHelper() {
209
210
  s: s,
210
211
  ss: pad(s),
211
212
  l: pad(L, 3),
212
- L: pad(L > 99 ? Math.round(L / 10) : L),
213
+ // L: pad(L > 99 ? Math.round(L / 10) : L),
214
+ L: pad(L),
213
215
  t: H < 12 ? "a" : "p",
214
216
  tt: H < 12 ? "am" : "pm",
215
217
  T: H < 12 ? "A" : "P",
@@ -278,8 +280,8 @@ function DateFormatHelper() {
278
280
  /**
279
281
  * Will give an array of dates between the current date to a targeted date
280
282
  *
281
- * TODO - add a closure to `ignoreWeekend()` based on Utils::Validator
282
- * TODO - add a closure to `ignoreFromList(array)` based on Utils::Validator
283
+ * TODO - add a closure to `ignoreWeekend()` based on Lib::Validator
284
+ * TODO - add a closure to `ignoreFromList(array)` based on Lib::Validator
283
285
  *
284
286
  * @param {object} dateTo
285
287
  * @param {string} [ mask ]
@@ -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.
@@ -10,10 +10,10 @@ var fs = require('fs');
10
10
  /**
11
11
  * @module Helpers
12
12
  *
13
- * Gina Utils Helpers
13
+ * Gina Lib Helpers
14
14
  *
15
- * @package Gina.Utils
16
- * @namespace Gina.Utils.Helpers
15
+ * @package Gina.Lib
16
+ * @namespace Gina.Lib.Helpers
17
17
  * @author Rhinostone <contact@gina.io>
18
18
  */
19
19
  var _require = function(path) {
@@ -43,7 +43,7 @@ var helpers = {}
43
43
 
44
44
  var PrototypesHelper = null, PluginsHelper = null;
45
45
  // loading main helpers
46
- for (; f < len; ++f) {
46
+ for (; f < len; ++f) {
47
47
  if ( ! /^\./.test(files[f]) && files[f] != 'index.js') {
48
48
  helper = files[f].replace(/.js/, '');
49
49
  if (/prototypes/i.test(helper)) {
@@ -63,11 +63,11 @@ new PrototypesHelper({
63
63
  });
64
64
 
65
65
  // loading plugins helpers
66
- if (
66
+ if (
67
67
  typeof(getContext) != 'undefined'
68
- && typeof(getContext().gina) != 'undefined'
68
+ && typeof(getContext().gina) != 'undefined'
69
69
  ) {
70
- new PluginsHelper(getContext('gina').plugins);
70
+ new PluginsHelper(getContext('gina').plugins);
71
71
  }
72
72
  // adding ApiError to helper in case Validator plugin is not loaded
73
73
  if ( typeof(getContext) != 'undefined' && typeof(ApiError) == 'undefined' /*&& typeof(helpers.ApiError) == 'undefined'*/ ) {
@@ -75,5 +75,10 @@ if ( typeof(getContext) != 'undefined' && typeof(ApiError) == 'undefined' /*&& t
75
75
  ApiError = require('./plugins/src/api-error');
76
76
  }
77
77
 
78
+ // loading `gina/utils/helper` if not yet loaded
79
+ if ( typeof(getTmpDir) == 'undefined' ) {
80
+ _require(__dirname + '/../../../utils/helper')
81
+ }
82
+
78
83
  // Publish as node.js module
79
84
  module.exports = helpers;
@@ -0,0 +1,9 @@
1
+ License (MIT)
2
+
3
+ Copyright © 2023 Martin-Luther ETOUMAN <martin-luther.etouman@gina.io>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,12 @@
1
+ # json()
2
+
3
+ **Package:** gina.helpers
4
+ **Name:** json
5
+
6
+
7
+
8
+ ## Debuging your test with nodeunit
9
+
10
+ ```tty
11
+ node --inspect-brk=6959 `which nodeunit` ./test/01-require_json.js
12
+ ```
@@ -5,9 +5,9 @@
5
5
 
6
6
  "author": {
7
7
  "name": "Maritn-Luther ETOUMAN",
8
- "email": "martinluther@gina.io"
8
+ "email": "martin-luther@gina.io"
9
9
  },
10
- "copyright": "Copyright (c) 2009-2022 Rhinostone <contact@gina.io>",
10
+ "copyright": "Copyright (c) 2009-2023 Rhinostone <contact@gina.io>",
11
11
  "engines": {
12
12
  "node": ">=0.10.22"
13
13
  },
@@ -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.
@@ -9,32 +9,34 @@
9
9
  var fs = require('fs');
10
10
  var console = require('./../../../lib/logger');
11
11
  /**
12
- * TextHelper
12
+ * JSONHelper
13
13
  *
14
- * @package Gina.Utils.Helpers
14
+ * @package Gina.Lib.Helpers
15
15
  * @author Rhinostone <contact@gina.io>
16
16
  * @api public
17
17
  * */
18
18
 
19
19
  module.exports = function(){
20
20
 
21
- // `JSON.clone()` is a prototype defined in `GINA_DIR//utils/prototypes.json_clone`
22
-
21
+ // `JSON.clone()` is a prototype defined in `GINA_DIR//lib/prototypes.json_clone`
22
+
23
23
  /**
24
24
  * Load a json file and removing comments if found
25
25
  *
26
- * @returns {string} filename - path
26
+ * @param {string} filename - path to json content
27
+ *
28
+ * @return {object} jsonObject
27
29
  * */
28
- requireJSON = function(filename){
29
-
30
+ requireJSON = function(filename){
31
+
30
32
  //console.debug('[ Helpers ][ requireJSON ] ', filename);
31
-
33
+
32
34
  var i = null
33
35
  , len = null
34
36
  , commentsWithSlashes = null
35
37
  , jsonStr = null
36
38
  ;
37
-
39
+
38
40
  try {
39
41
  if ( typeof(process.env.NODE_ENV_IS_DEV) != 'undefined' && /true/i.test(process.env.NODE_ENV_IS_DEV) ) {
40
42
  delete require.cache[filename];
@@ -45,18 +47,18 @@ module.exports = function(){
45
47
  console.emerg(err.stack);
46
48
  process.exit(1);
47
49
  }
48
- throw err
50
+ throw err
49
51
  }
50
-
51
-
52
+
53
+
52
54
  /** block style comments */
53
55
  if ( /\/\*\*/.test(jsonStr) ) {
54
56
  jsonStr = jsonStr.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)/g, '');
55
57
  }
56
-
58
+
57
59
  // line style comments
58
- commentsWithSlashes = jsonStr.match(/\/\/(.*)?/g);
59
-
60
+ commentsWithSlashes = jsonStr.match(/\/\/(.*)?/g);
61
+
60
62
  len = ( commentsWithSlashes) ? commentsWithSlashes.length : 0;
61
63
  if (commentsWithSlashes && len > 0) {
62
64
  i = 0;
@@ -64,12 +66,12 @@ module.exports = function(){
64
66
  // ignore urls
65
67
  if ( /(\:|\")/.test( jsonStr.substr(jsonStr.indexOf(commentsWithSlashes[i])-1,1) ) )
66
68
  continue;
67
-
69
+
68
70
  jsonStr = jsonStr.replace(commentsWithSlashes[i], '');
69
71
  }
70
- }
71
-
72
- try {
72
+ }
73
+
74
+ try {
73
75
  return JSON.parse(jsonStr)
74
76
  } catch (err) {
75
77
  var pos = null
@@ -78,20 +80,20 @@ module.exports = function(){
78
80
  ;
79
81
  var stack = err.stack.match(/position(\s|\s+)\d+/);
80
82
  if ( Array.isArray(stack) && stack.length > 0) {
81
- pos = stack[0].replace(/[^\d+]/g, '');
83
+ pos = stack[0].replace(/[^\d+]/g, '');
82
84
  jsonStr = jsonStr.substr(0, pos) + '--(ERROR !)--\n' + jsonStr.substr(pos);
83
85
  msg = (jsonStr.length > 400) ? '...'+ jsonStr.substr(pos-200, 300) +'...' : jsonStr;
84
- error = new Error('[ requireJSON ] could not parse `'+ filename +'`:' +'\n\rSomething is wrong around this portion:\n\r'+msg+'<strong style="color:red">"</strong>\n\rPlease check your file: `'+ filename +'`'+ '\n\r<strong style="color:red">'+err.stack+'</strong>\n');
86
+ error = new Error('[ requireJSON ] could not parse `'+ filename +'`:' +'\n\rSomething is wrong around this portion:\n\r'+msg+'<strong style="color:red">"</strong>\n\rPlease check your file: `'+ filename +'`'+ '\n\r<strong style="color:red">'+err.stack+'</strong>\n');
85
87
  } else {
86
- error = new Error('[ requireJSON ] could not parse `'+ filename +'`:' +'\n\rSomething is wrong with the content of your file.\n\rPlease check the syntax of your file : `'+ filename +'`'+ '\n\r<strong style="color:red">'+err.stack+'</strong>\n');
88
+ error = new Error('[ requireJSON ] could not parse `'+ filename +'`:' +'\n\rSomething is wrong with the content of your file.\n\rPlease check the syntax of your file : `'+ filename +'`'+ '\n\r<strong style="color:red">'+err.stack+'</strong>\n');
87
89
  }
88
-
90
+
89
91
  if ( !/\/controllers/i.test(err.stack) && typeof(console.emerg) != 'undefined' ) {
90
92
  console.emerg(error.message);
91
93
  process.exit(1);
92
- }
94
+ }
93
95
  throw error;
94
- }
96
+ }
95
97
  };
96
98
 
97
99
  };//EO JSONHelper.