gina 0.1.1-alpha.98 → 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.98/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.98/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.98/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.98 → v0.1.2-alpha.1}/core/config.js +315 -131
  20. package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/core/connectors/couchbase/lib/connector.v2.js +51 -51
  23. package/framework/{v0.1.1-alpha.98 → 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.98 → 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.98 → 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.98 → 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.98 → v0.1.2-alpha.1}/core/dev/index.js +1 -1
  32. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/dev/lib/class.js +1 -1
  33. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/dev/lib/factory.js +2 -2
  34. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/gna.js +48 -24
  35. package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/core/locales/index.js +2 -2
  39. package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/core/model/entity.js +87 -67
  42. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/model/index.js +16 -16
  43. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/model/template/entityFactory.js +1 -1
  44. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/model/template/index.js +17 -15
  45. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/index.js +1 -1
  46. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/file/package.json +1 -1
  47. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/intl/package.json +1 -1
  48. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/intl/src/main.js +5 -5
  49. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/storage/package.json +1 -1
  50. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/storage/src/main.js +6 -5
  51. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/validator/package.json +1 -1
  52. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/validator/src/form-validator.js +404 -300
  53. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/validator/src/main.js +1384 -1314
  54. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/router.js +221 -122
  55. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/server.express.js +69 -65
  56. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/server.isaac.js +274 -180
  57. package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/config/settings.server.json +4 -4
  60. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/config/templates.json +4 -4
  61. package/framework/{v0.1.1-alpha.98 → 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.98 → 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.98/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.98 → v0.1.2-alpha.1}/core/template/command/gina.tpl +4 -4
  70. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/conf/env.json +12 -0
  71. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/conf/manifest.json +2 -0
  72. package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/core/template/conf/templates.json +9 -9
  75. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/helpers/console.js +3 -3
  76. package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/helpers/dateFormat.js +9 -7
  82. package/framework/{v0.1.1-alpha.98 → 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.98/helpers/plugins → v0.1.2-alpha.1/helpers/json}/package.json +2 -2
  86. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/helpers/json/src/main.js +33 -28
  87. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/helpers/path.js +97 -22
  88. package/framework/{v0.1.1-alpha.98/helpers/json → v0.1.2-alpha.1/helpers/plugins}/package.json +2 -2
  89. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/helpers/plugins/src/api-error.js +23 -23
  90. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/helpers/plugins/src/main.js +3 -3
  91. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/helpers/prototypes.js +46 -38
  92. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/helpers/text.js +2 -2
  93. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/archiver/package.json +1 -1
  94. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/archiver/src/dep/jszip.min.js +3 -3
  95. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/archiver/src/main.js +183 -168
  96. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/aliases.json +4 -1
  97. package/framework/{v0.1.1-alpha.98 → 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.98 → 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.98 → v0.1.2-alpha.1}/lib/cmd/bundle/remove.js +39 -27
  102. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/bundle/restart.js +14 -8
  103. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/bundle/start.js +283 -49
  104. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/bundle/stop.js +93 -74
  105. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/env/add.js +87 -49
  106. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/env/list.js +26 -4
  107. package/framework/{v0.1.1-alpha.98/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.98 → v0.1.2-alpha.1}/lib/cmd/framework/open.js +25 -1
  114. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/framework/restart.js +78 -26
  115. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/framework/set.js +120 -40
  116. package/framework/{v0.1.1-alpha.98 → 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.98 → 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.98 → v0.1.2-alpha.1}/lib/cmd/framework/version.js +19 -4
  121. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/helper.js +357 -53
  122. package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/lib/cmd/project/add.js +344 -157
  127. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/arguments.json +2 -1
  128. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/build.js +28 -28
  129. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/help.txt +7 -1
  130. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/list.js +22 -2
  131. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/remove.js +19 -17
  132. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/rename.js +11 -11
  133. package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/lib/cmd/scope/help.txt +4 -4
  136. package/framework/{v0.1.1-alpha.98/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.98 → 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.98 → v0.1.2-alpha.1}/lib/cmd/view/add.js +35 -10
  141. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/collection/package.json +1 -1
  142. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/collection/src/main.js +247 -244
  143. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/config.js +33 -31
  144. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cron/package.json +1 -1
  145. package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/lib/generator/index.js +5 -5
  152. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/index.js +3 -2
  153. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1/lib/inherits}/LICENSE +1 -1
  154. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/inherits/README.md +2 -2
  155. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/inherits/package.json +3 -4
  156. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/inherits/src/main.js +3 -3
  157. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/logger/package.json +2 -2
  158. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/logger/src/containers/default/index.js +15 -2
  159. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/logger/src/containers/file/index.js +109 -14
  160. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/logger/src/containers/mq/index.js +12 -3
  161. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/logger/src/containers/mq/listener.js +29 -21
  162. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/logger/src/containers/mq/speaker.js +33 -4
  163. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/logger/src/helper.js +22 -1
  164. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/logger/src/main.js +36 -9
  165. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/math/index.js +9 -9
  166. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/merge/README.md +2 -2
  167. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/merge/package.json +1 -1
  168. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/merge/src/main.js +118 -91
  169. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/model.js +10 -10
  170. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/proc.js +92 -49
  171. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/routing/package.json +1 -1
  172. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/routing/src/main.js +377 -420
  173. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/session-store.js +13 -7
  174. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/shell.js +3 -3
  175. package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/swig-filters/package.json +1 -1
  176. package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/lib/validator.js +2 -2
  179. package/framework/{v0.1.1-alpha.98 → 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 +180 -90
  186. package/script/pre_install.js +97 -13
  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.98/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.98/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.98/VERSION +0 -1
  218. package/framework/v0.1.1-alpha.98/core/asset/js/plugin/dist/gina.js.map +0 -56
  219. package/framework/v0.1.1-alpha.98/core/asset/js/plugin/dist/gina.min.css +0 -1
  220. package/framework/v0.1.1-alpha.98/core/asset/js/plugin/dist/gina.min.css.map +0 -1
  221. package/framework/v0.1.1-alpha.98/core/asset/js/plugin/dist/gina.min.js +0 -736
  222. package/framework/v0.1.1-alpha.98/core/asset/js/plugin/dist/gina.min.js.map +0 -56
  223. package/framework/v0.1.1-alpha.98/core/asset/js/plugin/dist/gina.onload.min.js +0 -5
  224. package/framework/v0.1.1-alpha.98/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
  225. package/framework/v0.1.1-alpha.98/core/connectors/couchbase/lib/connector.js +0 -20
  226. package/framework/v0.1.1-alpha.98/core/connectors/couchbase/lib/session-store.js +0 -21
  227. package/framework/v0.1.1-alpha.98/core/controller/index.js +0 -27
  228. package/framework/v0.1.1-alpha.98/core/locales/dist/region/en.json +0 -9492
  229. package/framework/v0.1.1-alpha.98/core/locales/dist/region/fr.json +0 -9492
  230. package/framework/v0.1.1-alpha.98/core/locales/src/resources/region.mapping.json +0 -28
  231. package/framework/v0.1.1-alpha.98/core/template/boilerplate/bundle_templates/html/homepage.html +0 -4
  232. package/framework/v0.1.1-alpha.98/core/template/conf/statics.json +0 -10
  233. package/framework/v0.1.1-alpha.98/lib/cmd/bundle/arguments.json +0 -4
  234. package/framework/v0.1.1-alpha.98/lib/cmd/bundle/list.js +0 -129
  235. package/framework/v0.1.1-alpha.98/lib/cmd/env/remove.js +0 -150
  236. package/framework/v0.1.1-alpha.98/lib/cmd/framework/init.js +0 -541
  237. package/framework/v0.1.1-alpha.98/lib/cmd/framework/status.js +0 -72
  238. package/framework/v0.1.1-alpha.98/lib/cmd/framework/tail.js +0 -184
  239. package/framework/v0.1.1-alpha.98/lib/cmd/port/inc/scan.js +0 -108
  240. package/framework/v0.1.1-alpha.98/lib/cmd/port/list.js +0 -176
  241. package/framework/v0.1.1-alpha.98/lib/cmd/scope/set.js +0 -57
  242. package/framework/v0.1.1-alpha.98/lib/cmd/scope/unset.js +0 -44
  243. package/framework/v0.1.1-alpha.98/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.98/core/template/command/gina.bat.tpl → bin/gina.bat} +0 -0
  247. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/AUTHORS +0 -0
  248. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/asset/html/nolayout.html +0 -0
  249. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/asset/html/static.html +0 -0
  250. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/asset/img/android-chrome-192x192.png +0 -0
  251. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/asset/img/android-chrome-512x512.png +0 -0
  252. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/asset/img/apple-touch-icon.png +0 -0
  253. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/asset/img/favicon-16x16.png +0 -0
  254. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/asset/img/favicon-32x32.png +0 -0
  255. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/asset/img/favicon.ico +0 -0
  256. /package/framework/{v0.1.1-alpha.98/core/asset/js → v0.1.2-alpha.1/core/asset}/plugin/uuid.json +0 -0
  257. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  258. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/controller/controller.framework.js +0 -0
  259. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/busboy/.travis.yml +0 -0
  260. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/busboy/LICENSE +0 -0
  261. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/busboy/README.md +0 -0
  262. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
  263. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/busboy/deps/encoding/encoding.js +0 -0
  264. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/busboy/lib/main.js +0 -0
  265. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/busboy/lib/types/multipart.js +0 -0
  266. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/busboy/lib/types/urlencoded.js +0 -0
  267. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/busboy/lib/utils.js +0 -0
  268. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/busboy/package.json +0 -0
  269. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  270. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/dev/lib/tools.js +0 -0
  271. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/locales/currency.json +0 -0
  272. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/locales/dist/language/en.json +0 -0
  273. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/locales/dist/language/fr.json +0 -0
  274. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/locales/src/resources/currency.csv +0 -0
  275. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/locales/src/resources/region.csv +0 -0
  276. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/mime.types +0 -0
  277. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/README.md +0 -0
  278. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/file/README.md +0 -0
  279. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/file/build.json +0 -0
  280. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/intl/README.md +0 -0
  281. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/intl/build.json +0 -0
  282. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/storage/README.md +0 -0
  283. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/storage/build.json +0 -0
  284. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/validator/README.md +0 -0
  285. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/plugins/lib/validator/build.json +0 -0
  286. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/status.codes +0 -0
  287. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/config/app.json +0 -0
  288. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/config/routing.json +0 -0
  289. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  290. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  291. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  292. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  293. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  294. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  295. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_public/readme.md +0 -0
  296. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  297. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/conf/settings.json +0 -0
  298. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/error/client/json/401.json +0 -0
  299. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/error/client/json/403.json +0 -0
  300. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/error/client/json/404.json +0 -0
  301. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/error/server/html/50x.html +0 -0
  302. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/error/server/json/500.json +0 -0
  303. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/error/server/json/503.json +0 -0
  304. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/core/template/extensions/logger/config.json +0 -0
  305. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/helpers/plugins/README.md +0 -0
  306. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/helpers/task.js +0 -0
  307. /package/framework/{v0.1.1-alpha.98/helpers/json → v0.1.2-alpha.1/lib/archiver}/README.md +0 -0
  308. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/archiver/build.json +0 -0
  309. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/bundle/copy.js +0 -0
  310. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/bundle/cp.js +0 -0
  311. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/bundle/help.js +0 -0
  312. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/bundle/rename.js +0 -0
  313. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/bundle/rm.js +0 -0
  314. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/bundle/status.js +0 -0
  315. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/env/get.js +0 -0
  316. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/env/help.js +0 -0
  317. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/env/help.txt +0 -0
  318. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/env/link-dev.js +0 -0
  319. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/env/rm.js +0 -0
  320. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/env/set.js +0 -0
  321. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/env/unset.js +0 -0
  322. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/framework/dot.js +0 -0
  323. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/framework/get.js +0 -0
  324. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/framework/help.js +0 -0
  325. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/framework/help.txt +0 -0
  326. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/framework/msg.json +0 -0
  327. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/framework/update.js +0 -0
  328. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/gina-dev.1.md +0 -0
  329. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/gina-framework.1.md +0 -0
  330. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/gina.1.md +0 -0
  331. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/msg.json +0 -0
  332. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/port/help.js +0 -0
  333. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/port/help.txt +0 -0
  334. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/port/set.js +0 -0
  335. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/help.js +0 -0
  336. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/import.js +0 -0
  337. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/move.js +0 -0
  338. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/restart.js +0 -0
  339. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/rm.js +0 -0
  340. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/start.js +0 -0
  341. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/status.js +0 -0
  342. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/project/stop.js +0 -0
  343. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/protocol/help.js +0 -0
  344. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/protocol/help.txt +0 -0
  345. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/protocol/list.js +0 -0
  346. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/scope/help.js +0 -0
  347. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/scope/link-local.js +0 -0
  348. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cmd/scope/rm.js +0 -0
  349. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/collection/README.md +0 -0
  350. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/collection/build.json +0 -0
  351. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/cron/README.md +0 -0
  352. /package/framework/{v0.1.1-alpha.98/lib/archiver/README.md → v0.1.2-alpha.1/lib/domain/exemples/backend.js} +0 -0
  353. /package/framework/{v0.1.1-alpha.98/lib/routing/README.md → v0.1.2-alpha.1/lib/domain/exemples/frontend.html} +0 -0
  354. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  355. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/inherits/example/protected_inheritance.js +0 -0
  356. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/inherits/example/simple_inheritance.js +0 -0
  357. /package/framework/{v0.1.1-alpha.98 → 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.98 → v0.1.2-alpha.1}/lib/logger/README.md +0 -0
  359. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  360. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  361. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/merge/example/merge.js +0 -0
  362. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/merge/example/merge_2_literal objects.js +0 -0
  363. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/merge/example/merge_and_preserve_first.js +0 -0
  364. /package/framework/{v0.1.1-alpha.98/lib/swig-filters → v0.1.2-alpha.1/lib/routing}/README.md +0 -0
  365. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/routing/build.json +0 -0
  366. /package/framework/{v0.1.1-alpha.98/lib/url → v0.1.2-alpha.1/lib/swig-filters}/README.md +0 -0
  367. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/url/index.js +0 -0
  368. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/url/mocks.json +0 -0
  369. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/lib/url/routing.json +0 -0
  370. /package/framework/{v0.1.1-alpha.98 → v0.1.2-alpha.1}/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,35 +9,40 @@
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
- if ( typeof(process.env.NODE_ENV_IS_DEV) != 'undefined' && /true/i.test(process.env.NODE_ENV_IS_DEV) ) {
40
- delete require.cache[filename];
41
+ if (
42
+ typeof(process.env.NODE_ENV_IS_DEV) != 'undefined'
43
+ && /true/i.test(process.env.NODE_ENV_IS_DEV)
44
+ ) {
45
+ delete require.cache[require.resolve(filename)];
41
46
  }
42
47
  jsonStr = fs.readFileSync(filename).toString();
43
48
  } catch (err) {
@@ -45,18 +50,18 @@ module.exports = function(){
45
50
  console.emerg(err.stack);
46
51
  process.exit(1);
47
52
  }
48
- throw err
53
+ throw err
49
54
  }
50
-
51
-
55
+
56
+
52
57
  /** block style comments */
53
58
  if ( /\/\*\*/.test(jsonStr) ) {
54
59
  jsonStr = jsonStr.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)/g, '');
55
60
  }
56
-
61
+
57
62
  // line style comments
58
- commentsWithSlashes = jsonStr.match(/\/\/(.*)?/g);
59
-
63
+ commentsWithSlashes = jsonStr.match(/\/\/(.*)?/g);
64
+
60
65
  len = ( commentsWithSlashes) ? commentsWithSlashes.length : 0;
61
66
  if (commentsWithSlashes && len > 0) {
62
67
  i = 0;
@@ -64,12 +69,12 @@ module.exports = function(){
64
69
  // ignore urls
65
70
  if ( /(\:|\")/.test( jsonStr.substr(jsonStr.indexOf(commentsWithSlashes[i])-1,1) ) )
66
71
  continue;
67
-
72
+
68
73
  jsonStr = jsonStr.replace(commentsWithSlashes[i], '');
69
74
  }
70
- }
71
-
72
- try {
75
+ }
76
+
77
+ try {
73
78
  return JSON.parse(jsonStr)
74
79
  } catch (err) {
75
80
  var pos = null
@@ -78,20 +83,20 @@ module.exports = function(){
78
83
  ;
79
84
  var stack = err.stack.match(/position(\s|\s+)\d+/);
80
85
  if ( Array.isArray(stack) && stack.length > 0) {
81
- pos = stack[0].replace(/[^\d+]/g, '');
86
+ pos = stack[0].replace(/[^\d+]/g, '');
82
87
  jsonStr = jsonStr.substr(0, pos) + '--(ERROR !)--\n' + jsonStr.substr(pos);
83
88
  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');
89
+ 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
90
  } 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');
91
+ 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
92
  }
88
-
93
+
89
94
  if ( !/\/controllers/i.test(err.stack) && typeof(console.emerg) != 'undefined' ) {
90
95
  console.emerg(error.message);
91
96
  process.exit(1);
92
- }
97
+ }
93
98
  throw error;
94
- }
99
+ }
95
100
  };
96
101
 
97
102
  };//EO JSONHelper.