@kalisio/kdk 2.6.4 → 2.7.0

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 (398) hide show
  1. package/core/api/application.js +2 -4
  2. package/core/api/authentication.js +2 -3
  3. package/core/api/db.js +10 -2
  4. package/core/api/hooks/hooks.authorisations.js +4 -2
  5. package/core/api/hooks/hooks.push.js +6 -2
  6. package/core/api/hooks/hooks.query.js +29 -12
  7. package/core/api/hooks/hooks.users.js +30 -17
  8. package/core/api/models/configurations.model.mongodb.js +4 -0
  9. package/core/api/services/authorisations/authorisations.service.js +1 -1
  10. package/core/api/services/configurations/configurations.hooks.js +33 -0
  11. package/core/api/services/index.js +41 -7
  12. package/core/api/services/messages/messages.hooks.js +9 -3
  13. package/core/client/api.js +14 -1
  14. package/core/client/capabilities.js +1 -6
  15. package/core/client/components/KAvatar.vue +24 -20
  16. package/core/client/components/account/KProfile.vue +10 -71
  17. package/core/client/components/account/index.js +0 -2
  18. package/core/client/components/app/KSettings.vue +1 -0
  19. package/core/client/components/collection/KBoard.vue +4 -3
  20. package/core/client/components/collection/KCardSection.vue +1 -0
  21. package/core/client/components/collection/KGrid.vue +2 -0
  22. package/core/client/components/collection/KTable.vue +5 -1
  23. package/core/client/components/collection/KTimeLine.vue +9 -1
  24. package/core/client/components/collection/index.js +0 -2
  25. package/core/client/components/form/KChipsField.vue +2 -1
  26. package/core/client/components/form/KEmailField.vue +1 -0
  27. package/core/client/components/form/KFileField.vue +22 -1
  28. package/core/client/components/form/KForm.vue +2 -0
  29. package/core/client/components/form/KItemField.vue +1 -0
  30. package/core/client/components/form/KNumberField.vue +1 -0
  31. package/core/client/components/form/KPasswordField.vue +1 -0
  32. package/core/client/components/form/KPhoneField.vue +1 -0
  33. package/core/client/components/form/KPropertyItemField.vue +1 -0
  34. package/core/client/components/form/KResolutionField.vue +1 -0
  35. package/core/client/components/form/KSelectField.vue +31 -0
  36. package/core/client/components/form/KTagField.vue +1 -0
  37. package/core/client/components/form/KTextField.vue +1 -0
  38. package/core/client/components/form/KTokenField.vue +1 -0
  39. package/core/client/components/form/KUnitField.vue +1 -0
  40. package/core/client/components/form/KUrlField.vue +1 -0
  41. package/core/client/components/graphics/KIcon.vue +3 -4
  42. package/core/client/components/layout/KPage.vue +1 -0
  43. package/core/client/components/layout/KWindow.vue +6 -3
  44. package/core/client/components/messages/KMessageComposer.vue +2 -1
  45. package/core/client/components/messages/KMessagesTimeLine.vue +1 -1
  46. package/core/client/components/time/KDate.vue +1 -2
  47. package/core/client/components/time/KDateTime.vue +11 -11
  48. package/core/client/components/time/KTime.vue +1 -1
  49. package/core/client/composables/collection.js +33 -8
  50. package/core/client/composables/errors.js +1 -1
  51. package/core/client/composables/layout.js +9 -9
  52. package/core/client/configurations.js +50 -0
  53. package/core/client/exporter.js +1 -1
  54. package/core/client/i18n/core_en.json +6 -39
  55. package/core/client/i18n/core_fr.json +6 -39
  56. package/core/client/index.js +2 -0
  57. package/core/client/layout.js +8 -8
  58. package/core/client/mixins/mixin.base-activity.js +5 -2
  59. package/core/client/mixins/mixin.base-field.js +3 -3
  60. package/core/client/search.js +2 -1
  61. package/core/client/utils/utils.collection.js +8 -8
  62. package/core/client/utils/utils.items.js +4 -0
  63. package/core/client/utils/utils.push.js +3 -3
  64. package/core/client/utils/utils.session.js +7 -5
  65. package/core/client/utils/utils.shapes.js +38 -7
  66. package/core/client/utils/utils.time.js +21 -22
  67. package/core/common/schemas/users.update-profile.json +3 -2
  68. package/coverage/core/api/application.js.html +392 -398
  69. package/coverage/core/api/authentication.js.html +352 -187
  70. package/coverage/core/api/db.js.html +165 -126
  71. package/coverage/core/api/hooks/hooks.authentication.js.html +22 -196
  72. package/coverage/core/api/hooks/hooks.authorisations.js.html +383 -662
  73. package/coverage/core/api/hooks/hooks.logger.js.html +41 -41
  74. package/coverage/core/api/hooks/hooks.model.js.html +113 -101
  75. package/coverage/core/api/hooks/hooks.push.js.html +124 -97
  76. package/coverage/core/api/hooks/hooks.query.js.html +292 -217
  77. package/coverage/core/api/hooks/hooks.schemas.js.html +123 -123
  78. package/coverage/core/api/hooks/hooks.service.js.html +1 -1
  79. package/coverage/core/api/hooks/hooks.storage.js.html +1 -1
  80. package/coverage/core/api/hooks/{hooks.groups.js.html → hooks.tags.js.html} +100 -76
  81. package/coverage/core/api/hooks/hooks.users.js.html +255 -447
  82. package/coverage/core/api/hooks/index.html +107 -122
  83. package/coverage/core/api/hooks/index.js.html +4 -10
  84. package/coverage/core/api/index.html +46 -61
  85. package/coverage/core/api/index.js.html +9 -9
  86. package/coverage/core/api/marshall.js.html +9 -9
  87. package/coverage/core/api/models/{organisations.model.mongodb.js.html → configurations.model.mongodb.js.html} +10 -7
  88. package/coverage/core/api/models/index.html +35 -50
  89. package/coverage/core/api/models/messages.model.mongodb.js.html +39 -27
  90. package/coverage/core/api/models/tags.model.mongodb.js.html +26 -32
  91. package/coverage/core/api/models/users.model.mongodb.js.html +10 -10
  92. package/coverage/core/api/services/account/account.hooks.js.html +5 -5
  93. package/coverage/core/api/services/account/account.service.js.html +127 -127
  94. package/coverage/core/api/services/account/index.html +22 -22
  95. package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
  96. package/coverage/core/api/services/authorisations/authorisations.service.js.html +213 -222
  97. package/coverage/core/api/services/authorisations/index.html +21 -21
  98. package/coverage/core/api/services/{organisations/organisations.hooks.js.html → configurations/configurations.hooks.js.html} +16 -10
  99. package/coverage/core/api/services/{groups → configurations}/index.html +8 -8
  100. package/coverage/core/api/services/databases/databases.hooks.js.html +1 -1
  101. package/coverage/core/api/services/databases/databases.service.js.html +1 -1
  102. package/coverage/core/api/services/databases/index.html +1 -1
  103. package/coverage/core/api/services/import-export/import-export.hooks.js.html +76 -76
  104. package/coverage/core/api/services/import-export/import-export.service.js.html +32 -32
  105. package/coverage/core/api/services/import-export/index.html +32 -32
  106. package/coverage/core/api/services/index.html +21 -21
  107. package/coverage/core/api/services/index.js.html +313 -142
  108. package/coverage/core/api/services/mailer/index.html +32 -32
  109. package/coverage/core/api/services/mailer/mailer.hooks.js.html +80 -80
  110. package/coverage/core/api/services/mailer/mailer.service.js.html +32 -32
  111. package/coverage/core/api/services/messages/index.html +21 -21
  112. package/coverage/core/api/services/messages/messages.hooks.js.html +112 -76
  113. package/coverage/core/api/services/push/index.html +32 -32
  114. package/coverage/core/api/services/push/push.hooks.js.html +80 -80
  115. package/coverage/core/api/services/push/push.service.js.html +34 -34
  116. package/coverage/core/api/services/storage/index.html +29 -29
  117. package/coverage/core/api/services/storage/storage.hooks.js.html +80 -80
  118. package/coverage/core/api/services/storage/storage.service.js.html +29 -29
  119. package/coverage/core/api/services/tags/index.html +21 -21
  120. package/coverage/core/api/services/tags/tags.hooks.js.html +119 -71
  121. package/coverage/core/api/services/users/index.html +27 -12
  122. package/coverage/core/api/services/users/users.hooks.js.html +14 -11
  123. package/coverage/core/api/services/users/users.service.js.html +100 -0
  124. package/coverage/core/common/errors.js.html +1 -1
  125. package/coverage/core/common/index.html +42 -27
  126. package/coverage/core/common/index.js.html +1 -1
  127. package/coverage/core/common/permissions.js.html +166 -472
  128. package/coverage/core/common/schema.js.html +4 -4
  129. package/coverage/core/common/utils.js.html +31 -25
  130. package/coverage/core/common/utils.offline.js.html +199 -0
  131. package/coverage/index.html +192 -192
  132. package/coverage/lcov-report/core/api/application.js.html +392 -398
  133. package/coverage/lcov-report/core/api/authentication.js.html +352 -187
  134. package/coverage/lcov-report/core/api/db.js.html +165 -126
  135. package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +22 -196
  136. package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +383 -662
  137. package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +41 -41
  138. package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +113 -101
  139. package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +124 -97
  140. package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +292 -217
  141. package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +123 -123
  142. package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +1 -1
  143. package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +1 -1
  144. package/coverage/lcov-report/core/api/hooks/{hooks.groups.js.html → hooks.tags.js.html} +100 -76
  145. package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +255 -447
  146. package/coverage/lcov-report/core/api/hooks/index.html +107 -122
  147. package/coverage/lcov-report/core/api/hooks/index.js.html +4 -10
  148. package/coverage/lcov-report/core/api/index.html +46 -61
  149. package/coverage/lcov-report/core/api/index.js.html +9 -9
  150. package/coverage/lcov-report/core/api/marshall.js.html +9 -9
  151. package/coverage/lcov-report/core/api/models/{organisations.model.mongodb.js.html → configurations.model.mongodb.js.html} +10 -7
  152. package/coverage/lcov-report/core/api/models/index.html +35 -50
  153. package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +39 -27
  154. package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +26 -32
  155. package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +10 -10
  156. package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +5 -5
  157. package/coverage/lcov-report/core/api/services/account/account.service.js.html +127 -127
  158. package/coverage/lcov-report/core/api/services/account/index.html +22 -22
  159. package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
  160. package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +213 -222
  161. package/coverage/lcov-report/core/api/services/authorisations/index.html +21 -21
  162. package/coverage/lcov-report/core/api/services/{groups/groups.hooks.js.html → configurations/configurations.hooks.js.html} +16 -10
  163. package/coverage/lcov-report/core/api/services/{groups → configurations}/index.html +8 -8
  164. package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +1 -1
  165. package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +1 -1
  166. package/coverage/lcov-report/core/api/services/databases/index.html +1 -1
  167. package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +76 -76
  168. package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +32 -32
  169. package/coverage/lcov-report/core/api/services/import-export/index.html +32 -32
  170. package/coverage/lcov-report/core/api/services/index.html +21 -21
  171. package/coverage/lcov-report/core/api/services/index.js.html +313 -142
  172. package/coverage/lcov-report/core/api/services/mailer/index.html +32 -32
  173. package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +80 -80
  174. package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +32 -32
  175. package/coverage/lcov-report/core/api/services/messages/index.html +21 -21
  176. package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +112 -76
  177. package/coverage/lcov-report/core/api/services/push/index.html +32 -32
  178. package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +80 -80
  179. package/coverage/lcov-report/core/api/services/push/push.service.js.html +34 -34
  180. package/coverage/lcov-report/core/api/services/storage/index.html +29 -29
  181. package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +80 -80
  182. package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +29 -29
  183. package/coverage/lcov-report/core/api/services/tags/index.html +21 -21
  184. package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +119 -71
  185. package/coverage/lcov-report/core/api/services/users/index.html +27 -12
  186. package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +14 -11
  187. package/coverage/lcov-report/core/api/services/users/users.service.js.html +100 -0
  188. package/coverage/lcov-report/core/common/errors.js.html +1 -1
  189. package/coverage/lcov-report/core/common/index.html +42 -27
  190. package/coverage/lcov-report/core/common/index.js.html +1 -1
  191. package/coverage/lcov-report/core/common/permissions.js.html +166 -472
  192. package/coverage/lcov-report/core/common/schema.js.html +4 -4
  193. package/coverage/lcov-report/core/common/utils.js.html +31 -25
  194. package/coverage/lcov-report/core/common/utils.offline.js.html +199 -0
  195. package/coverage/lcov-report/index.html +192 -192
  196. package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +169 -31
  197. package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +1 -1
  198. package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +215 -35
  199. package/coverage/lcov-report/map/api/hooks/index.html +7 -7
  200. package/coverage/lcov-report/map/api/hooks/index.js.html +1 -1
  201. package/coverage/lcov-report/map/api/index.html +1 -1
  202. package/coverage/lcov-report/map/api/index.js.html +1 -1
  203. package/coverage/lcov-report/map/api/marshall.js.html +1 -1
  204. package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +1 -1
  205. package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +82 -7
  206. package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +1 -1
  207. package/coverage/lcov-report/map/api/models/index.html +22 -7
  208. package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +1 -1
  209. package/coverage/lcov-report/{core/api/models/groups.model.mongodb.js.html → map/api/models/styles.model.mongodb.js.html} +10 -7
  210. package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +1 -1
  211. package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +1 -1
  212. package/coverage/lcov-report/map/api/services/alerts/index.html +1 -1
  213. package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +39 -12
  214. package/coverage/lcov-report/map/api/services/catalog/index.html +5 -5
  215. package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1 -1
  216. package/coverage/lcov-report/map/api/services/daptiles/index.html +1 -1
  217. package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +86 -11
  218. package/coverage/lcov-report/map/api/services/features/features.service.js.html +307 -4
  219. package/coverage/lcov-report/map/api/services/features/index.html +7 -7
  220. package/coverage/lcov-report/map/api/services/index.html +5 -5
  221. package/coverage/lcov-report/map/api/services/index.js.html +326 -50
  222. package/coverage/lcov-report/map/api/services/projects/index.html +1 -1
  223. package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +1 -1
  224. package/coverage/{core/api/services/organisations → lcov-report/map/api/services/styles}/index.html +10 -25
  225. package/coverage/lcov-report/{core/api/services/organisations/organisations.hooks.js.html → map/api/services/styles/styles.hooks.js.html} +45 -12
  226. package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +1 -1
  227. package/coverage/lcov-report/map/common/errors.js.html +1 -1
  228. package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +7 -10
  229. package/coverage/lcov-report/map/common/grid.js.html +1 -1
  230. package/coverage/lcov-report/map/common/index.html +19 -19
  231. package/coverage/lcov-report/map/common/index.js.html +1 -1
  232. package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +1 -1
  233. package/coverage/lcov-report/map/common/moment-utils.js.html +1 -1
  234. package/coverage/lcov-report/map/common/opendap-grid-source.js.html +1 -1
  235. package/coverage/lcov-report/map/common/opendap-utils.js.html +4 -7
  236. package/coverage/lcov-report/map/common/permissions.js.html +10 -4
  237. package/coverage/lcov-report/map/common/time-based-grid-source.js.html +1 -1
  238. package/coverage/lcov-report/map/common/tms-utils.js.html +9 -12
  239. package/coverage/lcov-report/map/common/wcs-grid-source.js.html +3 -3
  240. package/coverage/lcov-report/map/common/wcs-utils.js.html +12 -15
  241. package/coverage/lcov-report/map/common/weacast-grid-source.js.html +2 -2
  242. package/coverage/lcov-report/map/common/wfs-utils.js.html +14 -17
  243. package/coverage/lcov-report/map/common/wms-utils.js.html +30 -12
  244. package/coverage/lcov-report/map/common/wmts-utils.js.html +10 -13
  245. package/coverage/lcov.info +4157 -3816
  246. package/coverage/map/api/hooks/hooks.catalog.js.html +169 -31
  247. package/coverage/map/api/hooks/hooks.features.js.html +1 -1
  248. package/coverage/map/api/hooks/hooks.query.js.html +215 -35
  249. package/coverage/map/api/hooks/index.html +7 -7
  250. package/coverage/map/api/hooks/index.js.html +1 -1
  251. package/coverage/map/api/index.html +1 -1
  252. package/coverage/map/api/index.js.html +1 -1
  253. package/coverage/map/api/marshall.js.html +1 -1
  254. package/coverage/map/api/models/alerts.model.mongodb.js.html +1 -1
  255. package/coverage/map/api/models/catalog.model.mongodb.js.html +82 -7
  256. package/coverage/map/api/models/features.model.mongodb.js.html +1 -1
  257. package/coverage/map/api/models/index.html +22 -7
  258. package/coverage/map/api/models/projects.model.mongodb.js.html +1 -1
  259. package/coverage/{core/api/models/groups.model.mongodb.js.html → map/api/models/styles.model.mongodb.js.html} +10 -7
  260. package/coverage/map/api/services/alerts/alerts.hooks.js.html +1 -1
  261. package/coverage/map/api/services/alerts/alerts.service.js.html +1 -1
  262. package/coverage/map/api/services/alerts/index.html +1 -1
  263. package/coverage/map/api/services/catalog/catalog.hooks.js.html +39 -12
  264. package/coverage/map/api/services/catalog/index.html +5 -5
  265. package/coverage/map/api/services/daptiles/daptiles.service.js.html +1 -1
  266. package/coverage/map/api/services/daptiles/index.html +1 -1
  267. package/coverage/map/api/services/features/features.hooks.js.html +86 -11
  268. package/coverage/map/api/services/features/features.service.js.html +307 -4
  269. package/coverage/map/api/services/features/index.html +7 -7
  270. package/coverage/map/api/services/index.html +5 -5
  271. package/coverage/map/api/services/index.js.html +326 -50
  272. package/coverage/map/api/services/projects/index.html +1 -1
  273. package/coverage/map/api/services/projects/projects.hooks.js.html +1 -1
  274. package/coverage/{lcov-report/core/api/services/organisations → map/api/services/styles}/index.html +10 -25
  275. package/coverage/{core/api/services/groups/groups.hooks.js.html → map/api/services/styles/styles.hooks.js.html} +45 -12
  276. package/coverage/map/common/dynamic-grid-source.js.html +1 -1
  277. package/coverage/map/common/errors.js.html +1 -1
  278. package/coverage/map/common/geotiff-grid-source.js.html +7 -10
  279. package/coverage/map/common/grid.js.html +1 -1
  280. package/coverage/map/common/index.html +19 -19
  281. package/coverage/map/common/index.js.html +1 -1
  282. package/coverage/map/common/meteo-model-grid-source.js.html +1 -1
  283. package/coverage/map/common/moment-utils.js.html +1 -1
  284. package/coverage/map/common/opendap-grid-source.js.html +1 -1
  285. package/coverage/map/common/opendap-utils.js.html +4 -7
  286. package/coverage/map/common/permissions.js.html +10 -4
  287. package/coverage/map/common/time-based-grid-source.js.html +1 -1
  288. package/coverage/map/common/tms-utils.js.html +9 -12
  289. package/coverage/map/common/wcs-grid-source.js.html +3 -3
  290. package/coverage/map/common/wcs-utils.js.html +12 -15
  291. package/coverage/map/common/weacast-grid-source.js.html +2 -2
  292. package/coverage/map/common/wfs-utils.js.html +14 -17
  293. package/coverage/map/common/wms-utils.js.html +30 -12
  294. package/coverage/map/common/wmts-utils.js.html +10 -13
  295. package/coverage/tmp/coverage-1028514-1773134124472-0.json +1 -0
  296. package/coverage/tmp/coverage-1028526-1773134124448-0.json +1 -0
  297. package/coverage/tmp/coverage-1028537-1773134124431-0.json +1 -0
  298. package/coverage/tmp/coverage-1028549-1773134124401-0.json +1 -0
  299. package/coverage/tmp/coverage-1028556-1773134124353-0.json +1 -0
  300. package/extras/configs/widgets.top.js +3 -3
  301. package/extras/tests/core/collection.mjs +2 -9
  302. package/extras/tours/pane.top.js +0 -9
  303. package/map/api/hooks/hooks.catalog.js +18 -4
  304. package/map/api/services/catalog/catalog.hooks.js +3 -0
  305. package/map/api/services/features/features.hooks.js +3 -1
  306. package/map/api/services/index.js +2 -6
  307. package/map/api/services/styles/styles.hooks.js +6 -1
  308. package/map/client/components/KFeatureActionButton.vue +9 -3
  309. package/map/client/components/KFeaturesFilterManager.vue +5 -5
  310. package/map/client/components/KFilterCondition.vue +17 -10
  311. package/map/client/components/KLayerEditor.vue +49 -39
  312. package/map/client/components/KMeasureTool.vue +7 -1
  313. package/map/client/components/KTimezoneMap.vue +29 -9
  314. package/map/client/components/catalog/KLayersPanel.vue +26 -16
  315. package/map/client/components/catalog/KLayersSelector.vue +13 -2
  316. package/map/client/components/catalog/KViewsPanel.vue +5 -4
  317. package/map/client/components/form/KSelectLayersField.vue +28 -17
  318. package/map/client/components/form/KSelectViewsField.vue +18 -9
  319. package/map/client/components/form/KTimezoneField.vue +1 -2
  320. package/map/client/components/legend/KVariablesLegend.vue +10 -1
  321. package/map/client/components/location/KLocationCardSection.vue +7 -2
  322. package/map/client/components/location/KLocationMap.vue +31 -7
  323. package/map/client/components/selection/KSelectedLayerFeatures.vue +2 -2
  324. package/map/client/components/stickies/KZoomControl.vue +1 -1
  325. package/map/client/components/styles/KStyleManager.vue +4 -1
  326. package/map/client/components/widget/KTimeSeries.vue +174 -497
  327. package/map/client/components/widget/KTimeSeriesSelector.vue +72 -0
  328. package/map/client/components/widget/KTimeSeriesToolbar.vue +83 -0
  329. package/map/client/composables/catalog.js +6 -10
  330. package/map/client/composables/highlight.js +12 -9
  331. package/map/client/composables/project.js +1 -1
  332. package/map/client/composables/selection.js +8 -7
  333. package/map/client/composables/weather.js +9 -2
  334. package/map/client/geolocation.js +8 -5
  335. package/map/client/i18n/map_en.json +11 -10
  336. package/map/client/i18n/map_fr.json +10 -9
  337. package/map/client/leaflet/TiledFeatureLayer.js +85 -82
  338. package/map/client/leaflet/utils/utils.geojson.js +3 -3
  339. package/map/client/mixins/globe/mixin.base-globe.js +15 -6
  340. package/map/client/mixins/globe/mixin.geojson-layers.js +27 -18
  341. package/map/client/mixins/map/mixin.edit-layers.js +9 -1
  342. package/map/client/mixins/map/mixin.pmtiles-layers.js +118 -29
  343. package/map/client/mixins/map/mixin.tiled-mesh-layers.js +12 -5
  344. package/map/client/mixins/map/mixin.tiled-wind-layers.js +19 -10
  345. package/map/client/mixins/mixin.activity.js +23 -30
  346. package/map/client/mixins/mixin.feature-selection.js +41 -5
  347. package/map/client/planets.js +1 -1
  348. package/map/client/readers/reader.kml.js +2 -3
  349. package/map/client/utils/utils.catalog.js +36 -10
  350. package/map/client/utils/utils.layers.js +39 -8
  351. package/map/client/utils/utils.project.js +4 -0
  352. package/map/client/utils/utils.style.js +37 -7
  353. package/map/client/utils/utils.time-series.js +215 -6
  354. package/map/common/schemas/catalog.update.json +1 -1
  355. package/map/common/weacast-grid-source.js +1 -1
  356. package/package.json +3 -3
  357. package/scripts/kash/CHANGELOG.md +0 -4
  358. package/scripts/kash/README.md +0 -9
  359. package/scripts/kash/kash.sh +45 -40
  360. package/scripts/kash/scripts/run_tests.sh +1 -4
  361. package/test/api/core/authentication.test.js +9 -4
  362. package/test/api/core/config/default.cjs +1 -0
  363. package/test/api/core/hooks.test.js +6 -0
  364. package/test/api/core/index.test.js +43 -18
  365. package/test/api/core/push.test.js +8 -8
  366. package/test/api/core/test-log-2026-03-10.log +60 -0
  367. package/test/api/core/users.test.js +384 -0
  368. package/test/api/map/grid-sources.test.js +1 -1
  369. package/test/api/map/test-log-2026-03-10.log +56 -0
  370. package/vite/package.json +11 -2
  371. package/vite/test/core/composables.test.js +77 -0
  372. package/vite/vitest.config.js +13 -0
  373. package/vite/yarn.lock +1096 -18
  374. package/.vscode/settings.json +0 -5
  375. package/core/client/components/account/KAccount.vue +0 -68
  376. package/core/client/components/account/KDeleteAccountManager.vue +0 -62
  377. package/core/client/components/account/KEmailManager.vue +0 -128
  378. package/core/client/components/account/KPasswordManager.vue +0 -90
  379. package/core/client/components/account/KVerifyEmailManager.vue +0 -105
  380. package/core/client/components/collection/KColumn.vue +0 -227
  381. package/core/client/components/collection/KHistory.vue +0 -113
  382. package/core/client/components/collection/KHistoryEntry.vue +0 -109
  383. package/coverage/core/api/hooks/hooks.organisations.js.html +0 -541
  384. package/coverage/core/api/services/organisations/organisations.service.js.html +0 -343
  385. package/coverage/core/api/utils.js.html +0 -118
  386. package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +0 -541
  387. package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +0 -343
  388. package/coverage/lcov-report/core/api/utils.js.html +0 -118
  389. package/coverage/tmp/coverage-151166-1723543324307-0.json +0 -1
  390. package/coverage/tmp/coverage-151178-1723543324283-0.json +0 -1
  391. package/coverage/tmp/coverage-151189-1723543324271-0.json +0 -1
  392. package/coverage/tmp/coverage-151201-1723543324248-0.json +0 -1
  393. package/coverage/tmp/coverage-151208-1723543324227-0.json +0 -1
  394. package/scripts/kash/LICENSE +0 -21
  395. package/test/api/core/test-log-2024-04-22.log +0 -84
  396. package/test/api/core/test-log-2024-04-23.log +0 -23
  397. package/test/api/core/test-log-2024-08-13.log +0 -3
  398. package/test/api/map/test-log-2025-03-08.log +0 -0
@@ -1,10 +1,68 @@
1
1
  import _ from 'lodash'
2
2
  import moment from 'moment'
3
+ import { unref } from 'vue'
4
+ import sift from 'sift'
5
+ import chroma from 'chroma-js'
3
6
  import centroid from '@turf/centroid'
4
- import { Time, Units, i18n } from '../../../core/client/index.js'
5
- import { isMeasureLayer } from './utils.layers.js'
7
+ import { Time, Store, Units, i18n } from '../../../core/client/index.js'
8
+ import { getFeatureId, getFeatureLabel } from './utils.js'
6
9
  import { getMeasureForFeature } from './utils.features.js'
10
+ import { formatUserCoordinates } from './utils.location.js'
11
+ import { isMeasureLayer } from './utils.layers.js'
7
12
  import { getForecastForLocation, getForecastProbe, getForecastForFeature } from './utils.weacast.js'
13
+ import { useCurrentActivity } from '../composables/activity.js'
14
+
15
+ // When organizing time series by feature the dataset color is the variable color as given in the layer
16
+ // eg 'temperature' data in red and 'humidity' data in blue
17
+ // When organizing time series by variable the dataset color should be different for each feature
18
+ // eg 'Toulouse' data in red, 'Paris' data in blue, etc.
19
+ // We pregenerate a fixed set of colors for this to ensure they are always assigned in the same order
20
+ const nbColors = 10
21
+ const Colors = chroma.scale('Set1').colors(nbColors)
22
+
23
+ // Add a small delta (minutes) to data time range so that some ticks are always visible
24
+ // and points on on the left/right side are not cut
25
+ const TimeRangeDelta = 2
26
+
27
+ // ID of weather forecast probe timeseries
28
+ export const ForecastProbeId = 'forecast-probe'
29
+
30
+ export function getChartOptions (title) {
31
+ return {
32
+ title: {
33
+ display: true,
34
+ text: title,
35
+ align: 'start'
36
+ },
37
+ scales: {
38
+ x: {
39
+ min: (startTime, endTime) => startTime.clone().subtract(TimeRangeDelta, 'minutes').valueOf(),
40
+ max: (startTime, endTime) => endTime.clone().add(TimeRangeDelta, 'minutes').valueOf()
41
+ }
42
+ },
43
+ plugins: {
44
+ legend: {
45
+ labels: {
46
+ usePointStyle: true,
47
+ generateLabels: (chart) => {
48
+ return chart.data.datasets.map((dataset, index) => {
49
+ // If we have a single value but like to draw a line it does not make sense so that we "force" point display
50
+ const hasSingleValue = (dataset.data.length === 1)
51
+ return {
52
+ text: dataset.label,
53
+ datasetIndex: index,
54
+ fillStyle: dataset.backgroundColor,
55
+ strokeStyle: dataset.borderColor,
56
+ pointStyle: (hasSingleValue ? 'rectRot' : 'line'),
57
+ hidden: !chart.isDatasetVisible(index)
58
+ }
59
+ })
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
8
66
 
9
67
  // Extract target variable data for timeseries from timeseries request result
10
68
  async function getDataForVariable(data, variable, forecastLevel, runTime) {
@@ -81,7 +139,7 @@ async function fetchDataForMeasureSeries({
81
139
  // Build timeseries to be used in charts for target feature and associated layer definition or probe location
82
140
  export function getForecastTimeSeries({
83
141
  feature, location, layer, startTime, endTime, runTime,
84
- forecastLayers, forecastModel, forecastLevel, weacastApi, fetchDelay
142
+ forecastLayers, forecastModel, forecastLevel, forecastLevelUnit, weacastApi, fetchDelay
85
143
  }) {
86
144
  let forecastVariables = []
87
145
  if (forecastLayers && forecastLayers.length > 0) forecastLayers.forEach(layer => { forecastVariables = forecastVariables.concat(_.get(layer, 'variables', [])) })
@@ -106,12 +164,16 @@ export function getForecastTimeSeries({
106
164
  // Known by the unit system ?
107
165
  const unit = Units.getUnit(baseUnit)
108
166
  const targetUnit = Units.getTargetUnit(baseUnit)
167
+ // We allow variable name to be customized based on level information
168
+ const label = _.template(i18n.tie(variable.label))({
169
+ level: forecastLevel, levelUnit: forecastLevelUnit
170
+ })
109
171
  const serie = {
110
172
  probedLocationData: forecastData,
111
173
  data: getDataForVariable(forecastData, variable, forecastLevel, runTime),
112
174
  variable: {
113
175
  name: variable.name,
114
- label: `${i18n.tie(variable.label)} (${Units.getTargetUnitSymbol(baseUnit)})`,
176
+ label: `${label} (${Units.getTargetUnitSymbol(baseUnit)})`,
115
177
  unit,
116
178
  targetUnit,
117
179
  chartjs: Object.assign({
@@ -138,7 +200,7 @@ export function getForecastTimeSeries({
138
200
  // Build timeseries to be used in charts for target feature and associated layer definition or probe location
139
201
  export function getMeasureTimeSeries({
140
202
  feature, location, layer, layers, startTime, endTime, runTime,
141
- level, probeFunction, fetchDelay
203
+ level, levelUnit, probeFunction, fetchDelay
142
204
  }) {
143
205
  // A feature comes from a single layer so target variables from it by default
144
206
  let variables = _.get(layer, 'variables', [])
@@ -165,12 +227,16 @@ export function getMeasureTimeSeries({
165
227
  // Known by the unit system ?
166
228
  const unit = Units.getUnit(baseUnit)
167
229
  const targetUnit = Units.getTargetUnit(baseUnit)
230
+ // We allow variable name to be customized based on level information
231
+ const label = _.template(i18n.tie(variable.label))({
232
+ level, levelUnit
233
+ })
168
234
  const serie = {
169
235
  probedLocationData: data,
170
236
  data: getDataForVariable(data, variable),
171
237
  variable: {
172
238
  name: variable.name,
173
- label: `${i18n.tie(variable.label)} (${Units.getTargetUnitSymbol(baseUnit)})`,
239
+ label: `${label} (${Units.getTargetUnitSymbol(baseUnit)})`,
174
240
  unit,
175
241
  targetUnit,
176
242
  chartjs: Object.assign({
@@ -193,3 +259,146 @@ export function getMeasureTimeSeries({
193
259
 
194
260
  return series
195
261
  }
262
+
263
+ // Helper function to update time series whenever something related changes, eg time span
264
+ export async function updateTimeSeries (previousTimeSeries) {
265
+ const { CurrentActivity, hasSelectedItems, getSelectedItems, hasProbedLocation, getProbedLocation } = useCurrentActivity()
266
+ const activity = unref(CurrentActivity)
267
+ if (!activity) return
268
+ // Initialize the time range
269
+ const span = Store.get('timeseries.span')
270
+ const start = moment(Time.getCurrentTime()).subtract(span, 'm')
271
+ const end = moment(Time.getCurrentTime()).add(span, 'm')
272
+ Time.patchRange({ start, end })
273
+ // Weather probe targets variables coming from multiple layers
274
+ const forecastLayers = _.values(activity.layers).filter(sift({ tags: ['weather', 'forecast'] }))
275
+ const featureLevel = activity.selectableLevelsLayer ? ` - ${activity.selectedLevel} ${activity.selectableLevels.unit}` : ''
276
+ const forecastLevel = activity.forecastLevel ? ` - ${activity.forecastLevel} ${activity.selectableLevels.unit}` : ''
277
+
278
+ let timeSeries = []
279
+ if (hasProbedLocation()) {
280
+ const coordinates = formatUserCoordinates(getProbedLocation().lat, getProbedLocation().lng, Store.get('locationFormat', 'FFf'))
281
+ // When custom probe function we provide visible layers as input
282
+ if (activity.probeLocation) {
283
+ let variableLayers = _.difference(_.values(activity.layers).filter(sift({ variables: { $exists: true }, isVisible: true })), forecastLayers)
284
+ variableLayers = variableLayers.filter(layer => activity.canProbeLocation({ location: getProbedLocation(), layer, level: activity.selectedLevel }))
285
+ variableLayers.forEach(layer => {
286
+ const series = getMeasureTimeSeries({
287
+ location: getProbedLocation(),
288
+ layer,
289
+ level: activity.selectedLevel,
290
+ levelUnit: (activity.selectableLevels ? activity.selectableLevels.unit : ''),
291
+ probeFunction: activity.probeLocation
292
+ })
293
+ if (!_.isEmpty(series)) {
294
+ timeSeries.push({
295
+ id: `${layer.name}-measure-probe`,
296
+ label: `${layer.label} (${coordinates})` + featureLevel,
297
+ series
298
+ })
299
+ }
300
+ })
301
+ }
302
+ // Or weather forecast probe
303
+ if (_.isEmpty(timeSeries) && activity.forecastModel) {
304
+ const series = getForecastTimeSeries({
305
+ location: getProbedLocation(),
306
+ forecastLayers,
307
+ forecastModel: activity.forecastModel,
308
+ forecastLevel: activity.forecastLevel,
309
+ forecastLevelUnit: (activity.selectableLevels ? activity.selectableLevels.unit : ''),
310
+ weacastApi: activity.getWeacastApi()
311
+ })
312
+ if (!_.isEmpty(series)) {
313
+ timeSeries.push({
314
+ id: ForecastProbeId,
315
+ label: `${activity.forecastModel.label} (${coordinates})` + forecastLevel,
316
+ series
317
+ })
318
+ }
319
+ }
320
+ }
321
+ if (hasSelectedItems()) {
322
+ getSelectedItems().forEach(item => {
323
+ const featureId = getFeatureId(item.feature, item.layer)
324
+ const featureLabel = getFeatureLabel(item.feature, item.layer)
325
+ // Measure
326
+ if (isMeasureLayer(item.layer)) {
327
+ const series = getMeasureTimeSeries({
328
+ feature: item.feature,
329
+ layer: item.layer,
330
+ level: activity.selectedLevel
331
+ })
332
+ if (!_.isEmpty(series)) {
333
+ timeSeries.push({
334
+ id: `${item.layer.name}-${featureId}-measure`,
335
+ label: `${item.layer.label} - ${featureLabel || featureId}` + featureLevel,
336
+ series
337
+ })
338
+ }
339
+ }
340
+ // Or weather forecast probe
341
+ if (_.isEmpty(timeSeries) && activity.forecastModel) {
342
+ const series = getForecastTimeSeries({
343
+ feature: item.feature,
344
+ layer: item.layer,
345
+ forecastLayers,
346
+ forecastModel: activity.forecastModel,
347
+ forecastLevel: activity.forecastLevel,
348
+ weacastApi: activity.getWeacastApi()
349
+ })
350
+ if (!_.isEmpty(series)) {
351
+ timeSeries.push({
352
+ id: `${item.layer.name}-${featureId}-probe`,
353
+ label: `${activity.forecastModel.label} (${item.layer.label} - ${featureLabel || featureId})` + forecastLevel,
354
+ series
355
+ })
356
+ }
357
+ }
358
+ })
359
+ }
360
+
361
+ const groupBy = Store.get('timeseries.groupBy')
362
+ // Default is to group by feature
363
+ if (groupBy === 'variable') {
364
+ const timeSeriesByVariable = {}
365
+ timeSeries.forEach((timeSerie, index) => {
366
+ timeSerie.series.forEach(serie => {
367
+ // We do not mix variables with different units
368
+ const variable = `${_.get(serie, 'variable.name')}-${_.get(serie, 'variable.unit.name')}`
369
+ const variableLabel = _.get(serie, 'variable.label')
370
+ // When organizing time series by feature chart name is the feature name while the dataset label is the variable name,
371
+ // eg a 'Toulouse' station collecting 'temperature' and 'humidity' data
372
+ // When organizing time series by variable the chart name is the variable name while the dataset label is the feature name
373
+ // eg the 'temperature' data for different stations 'Toulouse', 'Paris', etc.
374
+ _.set(serie, 'variable.label', timeSerie.label)
375
+ _.set(serie, 'variable.chartjs.backgroundColor', Colors[index % nbColors])
376
+ _.set(serie, 'variable.chartjs.borderColor', Colors[index % nbColors])
377
+ if (timeSeriesByVariable[variable]) {
378
+ timeSeriesByVariable[variable].series.push(serie)
379
+ } else {
380
+ timeSeriesByVariable[variable] = {
381
+ id: variable,
382
+ label: variableLabel,
383
+ series: [serie]
384
+ }
385
+ }
386
+ })
387
+ })
388
+ timeSeries = _.values(timeSeriesByVariable)
389
+ }
390
+ // Restore previous state if any
391
+ if (previousTimeSeries) {
392
+ timeSeries.forEach(timeSerie => {
393
+ const previousTimeSerie = _.find(previousTimeSeries, { id: timeSerie.id })
394
+ // Keep track of some states only
395
+ if (previousTimeSerie) Object.assign(timeSerie, _.pick(previousTimeSerie, ['visible', 'pinned', 'logarithmic']))
396
+ })
397
+ }
398
+ // Make first serie visible if required, always measure first if any
399
+ if (!_.isEmpty(timeSeries) && !_.find(timeSeries, { visible: true })) {
400
+ const timeSerie = _.find(timeSeries, timeSerie => timeSerie.label.includes('measure')) || timeSeries[0]
401
+ timeSerie.visible = true
402
+ }
403
+ return timeSeries
404
+ }
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "description": {
18
18
  "type": ["string", "null"],
19
- "maxLength": 256,
19
+ "maxLength": 4096,
20
20
  "field": {
21
21
  "component": "form/KTextField",
22
22
  "label": "schemas.CATALOG_DESCRIPTION_FIELD_LABEL"
@@ -58,7 +58,7 @@ export class WeacastGridSource extends GridSource {
58
58
  constructor (options) {
59
59
  super(options)
60
60
 
61
- this.api = options.weacastApi
61
+ this.api = options.planetApi
62
62
  this.usable = false
63
63
  }
64
64
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kalisio/kdk",
3
3
  "description": "Kalisio Development Kit",
4
- "version": "2.6.4",
4
+ "version": "2.7.0",
5
5
  "homepage": "https://github.com/kalisio/kdk",
6
6
  "type": "module",
7
7
  "keywords": [
@@ -94,8 +94,8 @@
94
94
  "@feathersjs/feathers": "^5.0.8",
95
95
  "@feathersjs/schema": "^5.0.8",
96
96
  "@feathersjs/socketio": "^5.0.8",
97
- "@kalisio/feathers-import-export": "^1.4.0",
98
- "@kalisio/feathers-s3": "^1.5.0",
97
+ "@kalisio/feathers-import-export": "^1.4.1",
98
+ "@kalisio/feathers-s3": "^1.6.0",
99
99
  "@kalisio/feathers-webpush": "^1.0.2",
100
100
  "@turf/bbox": "^6.0.1",
101
101
  "@weacast/core": "^2.2.1",
@@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
- - added `get_toml_value` to extract values from TOML fields
13
12
  - support for mongo 8 (`install_mongo8`)
14
13
  - added `get_flavor_from_git_ref` `get_version_from_git_ref` `get_custom_from_git_ref` helpers to parse git ref names (tag or branch names).
15
14
  - added `install_sona_scanner_cli` to install SonarQube scanner cli tool
@@ -19,7 +18,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
19
18
  - support for mongo 4,5,6
20
19
  - helper to install k9s
21
20
  - support for node 16,18
22
- - support for Code Climate
23
21
 
24
22
  ### Changed
25
23
 
@@ -34,8 +32,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
34
32
  - node22 bumped to `22.16`
35
33
  - mongodb7 bumped to `7.0.21`
36
34
  - mongodb8 bumped to `8.0.10`
37
- - allow `_` character in custom fields (see `get_custom_from_git_ref`)
38
- - run_app_tests now run lint on whole project repo (using `yarn lint`)
39
35
 
40
36
  ### Fixed
41
37
 
@@ -2,12 +2,3 @@
2
2
  Kalisio's bash snippets repository
3
3
 
4
4
  ## HOWTO use
5
-
6
-
7
- ## License
8
-
9
- Licensed under the [MIT license](LICENSE).
10
-
11
- Copyright (c) 2017-present [Kalisio](https://kalisio.com)
12
-
13
- [![Kalisio](https://kalisio.github.io/kalisioscope/kalisio/kalisio-logo-black-256x84.png)](https://kalisio.com)
@@ -129,11 +129,11 @@ AGE_VERSION=1.1.1
129
129
  SOPS_VERSION=3.8.1
130
130
 
131
131
  # https://github.com/kubernetes/kubernetes/tree/master/CHANGELOG
132
- KUBECTL_VERSION=1.31.11
132
+ KUBECTL_VERSION=1.28.13
133
133
  # https://github.com/helm/helm/releases
134
- HELM_VERSION=3.18.4
134
+ HELM_VERSION=3.14.4
135
135
  # https://github.com/helmfile/helmfile/releases
136
- HELMFILE_VERSION=1.1.3
136
+ HELMFILE_VERSION=0.167.1
137
137
 
138
138
  # https://github.com/nvm-sh/nvm/releases
139
139
  NVM_VERSION=0.40.3
@@ -246,6 +246,34 @@ ensure_sops() {
246
246
  fi
247
247
  }
248
248
 
249
+ # Install code climate test reporter in ~/.local/bin
250
+ # Arg1: a writable folder where to write downloaded files
251
+ install_cc_test_reporter() {
252
+ local DL_ROOT=$1
253
+ local DL_PATH="$DL_ROOT/cc"
254
+ if [ ! -d "$DL_PATH" ]; then
255
+ mkdir -p "$DL_PATH" && cd "$DL_PATH"
256
+ curl -OLsS https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
257
+ curl -OLsS https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64.sha256
258
+ sha256sum --ignore-missing --quiet -c test-reporter-latest-linux-amd64.sha256
259
+ cd ~-
260
+ fi
261
+ cd "$DL_PATH"
262
+ cp test-reporter-latest-linux-amd64 ~/.local/bin/cc-test-reporter
263
+ chmod +x ~/.local/bin/cc-test-reporter
264
+ cd ~-
265
+ }
266
+
267
+ # Sends test coverage to code climate
268
+ # Arg1: code climate identifier for authentication
269
+ # Arg2: prefix to use when using format-coverage (can be empty)
270
+ send_coverage_to_cc() {
271
+ local CC_TEST_REPORTER_ID=$1
272
+ local CC_PREFIX=${2:-}
273
+ ~/.local/bin/cc-test-reporter format-coverage -t lcov --add-prefix "$CC_PREFIX" coverage/lcov.info
274
+ ~/.local/bin/cc-test-reporter upload-coverage -r "$CC_TEST_REPORTER_ID"
275
+ }
276
+
249
277
  # Make sure nvm is installed
250
278
  # Arg1: a writable folder where to write downloaded files
251
279
  # NOTE: also define 'yarn' as a default package, ie. it'll be automatically
@@ -458,28 +486,12 @@ use_mongo() {
458
486
  ### Utils
459
487
  ###
460
488
 
461
- # Extract a value from a TOML file
462
- # Expected args:
463
- # 1. the toml file
464
- # 2. the field to extract
465
- get_toml_value() {
466
- local TOML_SRC="$1"
467
- local TOML_FIELD="$2"
468
-
469
- ensure_yq
470
- yq --input-format=toml --output-format=yaml ".$TOML_FIELD" "$TOML_SRC"
471
- }
472
-
473
- # Extract a value from a JSON file
474
- # Expected args:
475
- # 1. the toml file
476
- # 2. the field to extract
477
489
  get_json_value() {
478
490
  local JSON_SRC="$1"
479
491
  local JSON_FIELD="$2"
480
492
 
481
493
  ensure_yq
482
- yq --input-format=yaml --output-format=yaml ".$JSON_FIELD" "$JSON_SRC"
494
+ yq --output-format=yaml ".$JSON_FIELD" "$JSON_SRC"
483
495
  }
484
496
 
485
497
  # Extract version major from a version string.
@@ -991,7 +1003,7 @@ get_version_from_git_ref() {
991
1003
  get_custom_from_git_ref() {
992
1004
  local GIT_REF=$1
993
1005
 
994
- local CUSTOM_REGEX="(^|-)([a-zA-Z0-9_]+)$"
1006
+ local CUSTOM_REGEX="(^|-)([a-zA-Z0-9]+)$"
995
1007
  if [[ "$GIT_REF" =~ $CUSTOM_REGEX ]]; then
996
1008
  if [[ "${BASH_REMATCH[1]}" == "" ]]; then
997
1009
  # If first capture group is empty => that's probably a 'dev' flavor.
@@ -1272,13 +1284,13 @@ get_app_kli_file() {
1272
1284
  # Expected arguments:
1273
1285
  # 1. the app repository directory
1274
1286
  # 2. the directory in which we'll find kli files relative to the 'development' repository root directory
1275
- # 3. whether to run SonarQube analysis and publish code quality & coverage results (boolean)
1287
+ # 3. wether to publish code coverage results (boolean)
1276
1288
  # 4. the node version to use (16, 18, ...)
1277
1289
  # 5. the mongo version to use (5, 6, ...). Mongo will not be started if not provided
1278
1290
  run_app_tests() {
1279
1291
  local REPO_DIR="$1"
1280
1292
  local KLI_BASE="$2"
1281
- local RUN_SONAR="$3"
1293
+ local CODE_COVERAGE="$3"
1282
1294
  local NODE_VER="$4"
1283
1295
  local MONGO_VER="$5"
1284
1296
  local WORKSPACE_DIR
@@ -1295,13 +1307,6 @@ run_app_tests() {
1295
1307
 
1296
1308
  echo "About to run tests for $APP v$VERSION-$FLAVOR ..."
1297
1309
 
1298
- ## Lint whole project
1299
- ##
1300
-
1301
- cd "$REPO_DIR"
1302
- yarn lint
1303
- cd ~-
1304
-
1305
1310
  ## Start mongo
1306
1311
  ##
1307
1312
 
@@ -1317,19 +1322,19 @@ run_app_tests() {
1317
1322
  ## Run tests
1318
1323
  ##
1319
1324
 
1320
- cd "$REPO_DIR/api"
1325
+ pushd "$REPO_DIR/api"
1321
1326
 
1322
1327
  use_node "$NODE_VER"
1323
1328
  yarn test
1324
1329
 
1325
- ## Run SonarQube analysis and publish code quality & coverage reports
1330
+ ## Publish code coverage
1326
1331
  ##
1327
1332
 
1328
- if [ "$RUN_SONAR" = true ]; then
1329
- cd "$ROOT_DIR" && sonar-scanner
1333
+ if [ "$CODE_COVERAGE" = true ]; then
1334
+ send_coverage_to_cc "$CC_TEST_REPORTER_ID" "api"
1330
1335
  fi
1331
1336
 
1332
- cd ~-
1337
+ popd
1333
1338
  }
1334
1339
 
1335
1340
  # Setup the workspace for a lib project.
@@ -1392,12 +1397,12 @@ get_lib_branch() {
1392
1397
  # Run tests for a library module
1393
1398
  # Expected arguments
1394
1399
  # 1. Root directory
1395
- # 2. whether to run SonarQube analysis and publish code quality & coverage results (boolean)
1400
+ # 2. true to publish code coverage to code climate (CC_TEST_REPORTER_ID env var should be defined in this case)
1396
1401
  # 3. node version to be used
1397
1402
  # 4. mongo version to be used if required by tests
1398
1403
  run_lib_tests () {
1399
1404
  local ROOT_DIR="$1"
1400
- local RUN_SONAR="$2"
1405
+ local CODE_COVERAGE="$2"
1401
1406
  local NODE_VER="$3"
1402
1407
  local MONGO_VER="$4"
1403
1408
  local WORKSPACE_DIR
@@ -1432,11 +1437,11 @@ run_lib_tests () {
1432
1437
  use_node "$NODE_VER"
1433
1438
  yarn && yarn test
1434
1439
 
1435
- ## Run SonarQube analysis and publish code quality & coverage reports
1440
+ ## Publish code coverage
1436
1441
  ##
1437
1442
 
1438
- if [ "$RUN_SONAR" = true ]; then
1439
- cd "$ROOT_DIR" && sonar-scanner
1443
+ if [ "$CODE_COVERAGE" = true ]; then
1444
+ send_coverage_to_cc "$CC_TEST_REPORTER_ID"
1440
1445
  fi
1441
1446
  }
1442
1447
 
@@ -11,7 +11,7 @@ ROOT_DIR=$(dirname "$THIS_DIR")
11
11
  ### Github Actions
12
12
 
13
13
  init_github() {
14
- install_reqs yq age sops nvm node20 node22 sonar_scanner_cli
14
+ install_reqs yq age sops nvm node20 node22 cc_test_reporter sonar_scanner_cli
15
15
 
16
16
  # mongo is not available for alpine hosts
17
17
  if [ "$OS_ID" != "alpine" ]; then
@@ -49,8 +49,6 @@ mkdir -p "$TMP_DIR/utils"
49
49
  cd "$TMP_DIR/utils"
50
50
  curl -OLsS "https://raw.githubusercontent.com/kalisio/krawler/master/package.json"
51
51
  [ "$(get_json_value "$TMP_DIR/utils/package.json" 'name')" != "@kalisio/krawler" ] && exit 1
52
- curl -OLsS "https://raw.githubusercontent.com/kalisio/kazarr/refs/heads/master/pyproject.toml"
53
- [ "$(get_toml_value "$TMP_DIR/utils/pyproject.toml" 'project.name')" != "kazarr" ] && exit 1
54
52
  cd ~-
55
53
 
56
54
  [ "$(get_semver_major "1" )" != "1" ] && exit 1
@@ -131,7 +129,6 @@ git_shallow_clone https://github.com/kalisio/kApp.git "$TMP_DIR/kApp.v1.3.0" pro
131
129
  [[ "$(get_custom_from_git_ref "test-v4.3-blabla")" != "blabla" ]] && exit 1
132
130
  [[ "$(get_custom_from_git_ref "prod-v4.5.3")" != "" ]] && exit 1
133
131
  [[ "$(get_custom_from_git_ref "prod-v4.5.3-custom")" != "custom" ]] && exit 1
134
- [[ "$(get_custom_from_git_ref "prod-v4.5.3-custom_foo")" != "custom_foo" ]] && exit 1
135
132
 
136
133
  # Setup a fake workspace with additional dependencies
137
134
  mkdir -p "$TMP_DIR/fake"
@@ -42,11 +42,9 @@ describe('core:authentication', () => {
42
42
  try {
43
43
  await request.get(`${baseUrl}/users`)
44
44
  } catch (error) {
45
- /* FIXME: Not sure why but in this case the raised error is in text format
46
- expect(error).toExist()
47
- expect(error.name).to.equal('NotAuthenticated')
48
- */
45
+ // Not sure why but in this case the raised error is in text/html format
49
46
  expect(error.status).to.equal(500)
47
+ expect(error.response.text.includes('NotAuthenticated')).beTrue()
50
48
  }
51
49
  })
52
50
 
@@ -154,6 +152,7 @@ describe('core:authentication', () => {
154
152
  expect(accessToken).not.to.equal(statelessAccessToken)
155
153
  expect(user).beUndefined()
156
154
  const payload = await authenticationService.verifyAccessToken(accessToken, app.get('authentication').jwtOptions)
155
+ expect(payload.sub).to.equal('mycustomapp')
157
156
  expect(payload.property).to.equal('mycustomproperty')
158
157
  })
159
158
 
@@ -175,6 +174,12 @@ describe('core:authentication', () => {
175
174
  expect(users[0]._id).to.equal(userObject._id.toString())
176
175
  })
177
176
 
177
+ it('removes user', async () => {
178
+ await userService.remove(userObject._id)
179
+ })
180
+ // Let enough time to process
181
+ .timeout(5000)
182
+
178
183
  // Cleanup
179
184
  after(async () => {
180
185
  if (server) await server.close()
@@ -20,6 +20,7 @@ module.exports = {
20
20
  service: API_PREFIX + '/users',
21
21
  entity: 'user',
22
22
  identityFields: ['email', 'profile.phone'],
23
+ disallowRegistration: true,
23
24
  authStrategies: [
24
25
  'jwt',
25
26
  'local'
@@ -272,6 +272,12 @@ describe('core:hooks', () => {
272
272
  fuzzySearch({ fields: ['name'] })(hook)
273
273
  hooks.diacriticSearch()(hook)
274
274
  expect(hook.params.query.name.$regex.source).to.equal('árë')
275
+ // Ensure it works on complex queries
276
+ hook.params.query = { $or: [{ name: { $search: 'are' } }, { name: { $search: 'árë' } }] }
277
+ fuzzySearch({ fields: ['name'] })(hook)
278
+ hooks.diacriticSearch()(hook)
279
+ expect(hook.params.query.$or[0].name.$regex.source).to.equal('[a,á,à,ä,â,ã]r[e,é,ë,è,ê]')
280
+ expect(hook.params.query.$or[1].name.$regex.source).to.equal('árë')
275
281
  })
276
282
 
277
283
  it('rate limiting', (done) => {