@kalisio/kdk 2.3.2 → 2.4.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 (449) hide show
  1. package/.eslintignore +2 -1
  2. package/.github/workflows/main.yaml +3 -3
  3. package/README.md +1 -0
  4. package/core/api/db.js +6 -1
  5. package/core/api/hooks/hooks.model.js +1 -1
  6. package/core/api/hooks/hooks.schemas.js +0 -2
  7. package/core/api/models/messages.model.mongodb.js +13 -0
  8. package/core/api/services/authorisations/authorisations.service.js +13 -4
  9. package/core/api/services/index.js +19 -0
  10. package/core/api/services/messages/messages.hooks.js +38 -0
  11. package/core/client/api.js +7 -32
  12. package/core/client/capabilities.js +2 -2
  13. package/core/client/components/KActivity.vue +29 -6
  14. package/core/client/components/KContent.vue +2 -2
  15. package/core/client/components/KDialog.vue +4 -7
  16. package/core/client/components/KStamp.vue +3 -9
  17. package/core/client/components/KStore.vue +2 -4
  18. package/core/client/components/KTab.vue +95 -0
  19. package/core/client/components/action/KAction.vue +15 -2
  20. package/core/client/components/action/KBugReportAction.vue +4 -2
  21. package/core/client/components/action/KToggleFullscreenAction.vue +25 -0
  22. package/core/client/components/app/KSettings.vue +17 -13
  23. package/core/client/components/chart/KDataTable.vue +6 -9
  24. package/core/client/components/chart/KTimeSeriesChart.vue +62 -49
  25. package/core/client/components/collection/KBoard.vue +22 -33
  26. package/core/client/components/collection/KCard.vue +71 -56
  27. package/core/client/components/collection/KCardSection.vue +20 -10
  28. package/core/client/components/collection/KDescriptionCardSection.vue +47 -0
  29. package/core/client/components/collection/KGrid.vue +234 -54
  30. package/core/client/components/collection/KScrollDown.vue +97 -0
  31. package/core/client/components/collection/KScrollToTop.vue +93 -0
  32. package/core/client/components/collection/KTable.vue +87 -33
  33. package/core/client/components/collection/KTimeLine.vue +406 -0
  34. package/core/client/components/collection/index.js +1 -5
  35. package/core/client/components/document/KDocument.vue +20 -55
  36. package/core/client/components/document/KHtml.vue +17 -7
  37. package/core/client/components/document/KImage.vue +78 -0
  38. package/core/client/components/document/KMarkdown.vue +12 -16
  39. package/core/client/components/document/KPdf.vue +69 -0
  40. package/core/client/components/form/KFileField.vue +2 -2
  41. package/core/client/components/form/KSelectField.vue +2 -1
  42. package/core/client/components/form/KUnitField.vue +3 -1
  43. package/core/client/components/layout/KFab.vue +9 -10
  44. package/core/client/components/layout/KLayout.vue +104 -6
  45. package/core/client/components/layout/KOpener.vue +14 -19
  46. package/core/client/components/layout/KPage.vue +195 -105
  47. package/core/client/components/layout/KWindow.vue +54 -32
  48. package/core/client/components/layout/index.js +0 -2
  49. package/core/client/components/media/KRibbon.vue +95 -0
  50. package/core/client/components/menu/KMenu.vue +4 -4
  51. package/core/client/components/team/KGroupsActivity.vue +25 -27
  52. package/core/client/components/team/KMembersActivity.vue +21 -23
  53. package/core/client/components/team/KOrganisationsActivity.vue +20 -22
  54. package/core/client/components/team/KTagsActivity.vue +21 -23
  55. package/core/client/components/time/KAbsoluteTimeRange.vue +70 -170
  56. package/core/client/components/time/KDate.vue +4 -1
  57. package/core/client/components/time/KDateTimeRange.vue +2 -2
  58. package/core/client/components/time/KTime.vue +3 -1
  59. package/core/client/composables/activity.js +14 -12
  60. package/core/client/composables/collection.js +3 -1
  61. package/core/client/composables/counter.js +51 -0
  62. package/core/client/composables/index.js +3 -0
  63. package/core/client/composables/layout.js +13 -2
  64. package/core/client/composables/messages.js +15 -0
  65. package/core/client/composables/pwa.js +1 -1
  66. package/core/client/composables/schema.js +6 -6
  67. package/core/client/composables/screen.js +23 -0
  68. package/core/client/directives/index.js +1 -0
  69. package/core/client/directives/v-hover.js +23 -0
  70. package/core/client/document.js +61 -0
  71. package/core/client/exporter.js +1 -1
  72. package/core/client/filter.js +0 -1
  73. package/core/client/guards.js +1 -1
  74. package/core/client/i18n/core_en.json +14 -8
  75. package/core/client/i18n/core_fr.json +15 -9
  76. package/core/client/index.js +9 -3
  77. package/core/client/layout.js +129 -29
  78. package/core/client/local-storage.js +1 -1
  79. package/core/client/mixins/index.js +0 -1
  80. package/core/client/mixins/mixin.base-activity.js +23 -13
  81. package/core/client/mixins/mixin.base-item.js +6 -3
  82. package/core/client/services/index.js +4 -1
  83. package/core/client/services/local-settings.service.js +4 -0
  84. package/core/client/storage.js +1 -1
  85. package/core/client/store.js +1 -1
  86. package/core/client/template-context.js +17 -0
  87. package/core/client/time.js +1 -1
  88. package/core/client/units.js +49 -27
  89. package/core/client/utils/index.js +3 -2
  90. package/core/client/utils/utils.actions.js +4 -0
  91. package/core/client/utils/utils.colors.js +155 -2
  92. package/core/client/utils/utils.items.js +26 -0
  93. package/core/client/utils/utils.math.js +3 -0
  94. package/core/client/utils/utils.platform.js +3 -1
  95. package/core/client/utils/utils.screen.js +82 -0
  96. package/core/client/utils/utils.time.js +0 -1
  97. package/core/common/schemas/settings.update.json +12 -0
  98. package/coverage/base.css +224 -0
  99. package/coverage/block-navigation.js +87 -0
  100. package/coverage/core/api/application.js.html +1870 -0
  101. package/coverage/core/api/authentication.js.html +742 -0
  102. package/coverage/core/api/db.js.html +793 -0
  103. package/coverage/core/api/hooks/hooks.authentication.js.html +313 -0
  104. package/coverage/core/api/hooks/hooks.authorisations.js.html +1243 -0
  105. package/coverage/core/api/hooks/hooks.groups.js.html +229 -0
  106. package/coverage/core/api/hooks/hooks.logger.js.html +163 -0
  107. package/coverage/core/api/hooks/hooks.model.js.html +955 -0
  108. package/coverage/core/api/hooks/hooks.organisations.js.html +541 -0
  109. package/coverage/core/api/hooks/hooks.push.js.html +253 -0
  110. package/coverage/core/api/hooks/hooks.query.js.html +862 -0
  111. package/coverage/core/api/hooks/hooks.schemas.js.html +298 -0
  112. package/coverage/core/api/hooks/hooks.service.js.html +319 -0
  113. package/coverage/core/api/hooks/hooks.storage.js.html +193 -0
  114. package/coverage/core/api/hooks/hooks.users.js.html +868 -0
  115. package/coverage/core/api/hooks/index.html +296 -0
  116. package/coverage/core/api/hooks/index.js.html +121 -0
  117. package/coverage/core/api/index.html +191 -0
  118. package/coverage/core/api/index.js.html +148 -0
  119. package/coverage/core/api/marshall.js.html +448 -0
  120. package/coverage/core/api/models/groups.model.mongodb.js.html +109 -0
  121. package/coverage/core/api/models/index.html +176 -0
  122. package/coverage/core/api/models/messages.model.mongodb.js.html +121 -0
  123. package/coverage/core/api/models/organisations.model.mongodb.js.html +94 -0
  124. package/coverage/core/api/models/tags.model.mongodb.js.html +115 -0
  125. package/coverage/core/api/models/users.model.mongodb.js.html +115 -0
  126. package/coverage/core/api/services/account/account.hooks.js.html +208 -0
  127. package/coverage/core/api/services/account/account.service.js.html +436 -0
  128. package/coverage/core/api/services/account/index.html +131 -0
  129. package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
  130. package/coverage/core/api/services/authorisations/authorisations.service.js.html +529 -0
  131. package/coverage/core/api/services/authorisations/index.html +131 -0
  132. package/coverage/core/api/services/databases/databases.hooks.js.html +193 -0
  133. package/coverage/core/api/services/databases/databases.service.js.html +100 -0
  134. package/coverage/core/api/services/databases/index.html +131 -0
  135. package/coverage/core/api/services/groups/groups.hooks.js.html +178 -0
  136. package/coverage/core/api/services/groups/index.html +116 -0
  137. package/coverage/core/api/services/import-export/import-export.hooks.js.html +184 -0
  138. package/coverage/core/api/services/import-export/import-export.service.js.html +118 -0
  139. package/coverage/core/api/services/import-export/index.html +131 -0
  140. package/coverage/core/api/services/index.html +116 -0
  141. package/coverage/core/api/services/index.js.html +556 -0
  142. package/coverage/core/api/services/mailer/index.html +131 -0
  143. package/coverage/core/api/services/mailer/mailer.hooks.js.html +190 -0
  144. package/coverage/core/api/services/mailer/mailer.service.js.html +118 -0
  145. package/coverage/core/api/services/messages/index.html +116 -0
  146. package/coverage/core/api/services/messages/messages.hooks.js.html +199 -0
  147. package/coverage/core/api/services/organisations/index.html +131 -0
  148. package/coverage/core/api/services/organisations/organisations.hooks.js.html +178 -0
  149. package/coverage/core/api/services/organisations/organisations.service.js.html +343 -0
  150. package/coverage/core/api/services/push/index.html +131 -0
  151. package/coverage/core/api/services/push/push.hooks.js.html +190 -0
  152. package/coverage/core/api/services/push/push.service.js.html +121 -0
  153. package/coverage/core/api/services/storage/index.html +131 -0
  154. package/coverage/core/api/services/storage/storage.hooks.js.html +190 -0
  155. package/coverage/core/api/services/storage/storage.service.js.html +172 -0
  156. package/coverage/core/api/services/tags/index.html +116 -0
  157. package/coverage/core/api/services/tags/tags.hooks.js.html +178 -0
  158. package/coverage/core/api/services/users/index.html +116 -0
  159. package/coverage/core/api/services/users/users.hooks.js.html +307 -0
  160. package/coverage/core/api/utils.js.html +118 -0
  161. package/coverage/core/common/errors.js.html +88 -0
  162. package/coverage/core/common/index.html +176 -0
  163. package/coverage/core/common/index.js.html +115 -0
  164. package/coverage/core/common/permissions.js.html +1048 -0
  165. package/coverage/core/common/schema.js.html +190 -0
  166. package/coverage/core/common/utils.js.html +220 -0
  167. package/coverage/favicon.png +0 -0
  168. package/coverage/index.html +506 -0
  169. package/coverage/lcov-report/base.css +224 -0
  170. package/coverage/lcov-report/block-navigation.js +87 -0
  171. package/coverage/lcov-report/core/api/application.js.html +1870 -0
  172. package/coverage/lcov-report/core/api/authentication.js.html +742 -0
  173. package/coverage/lcov-report/core/api/db.js.html +793 -0
  174. package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +313 -0
  175. package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +1243 -0
  176. package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +229 -0
  177. package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +163 -0
  178. package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +955 -0
  179. package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +541 -0
  180. package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +253 -0
  181. package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +862 -0
  182. package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +298 -0
  183. package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +319 -0
  184. package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +193 -0
  185. package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +868 -0
  186. package/coverage/lcov-report/core/api/hooks/index.html +296 -0
  187. package/coverage/lcov-report/core/api/hooks/index.js.html +121 -0
  188. package/coverage/lcov-report/core/api/index.html +191 -0
  189. package/coverage/lcov-report/core/api/index.js.html +148 -0
  190. package/coverage/lcov-report/core/api/marshall.js.html +448 -0
  191. package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +109 -0
  192. package/coverage/lcov-report/core/api/models/index.html +176 -0
  193. package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +121 -0
  194. package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +94 -0
  195. package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +115 -0
  196. package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +115 -0
  197. package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +208 -0
  198. package/coverage/lcov-report/core/api/services/account/account.service.js.html +436 -0
  199. package/coverage/lcov-report/core/api/services/account/index.html +131 -0
  200. package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
  201. package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +529 -0
  202. package/coverage/lcov-report/core/api/services/authorisations/index.html +131 -0
  203. package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +193 -0
  204. package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +100 -0
  205. package/coverage/lcov-report/core/api/services/databases/index.html +131 -0
  206. package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +178 -0
  207. package/coverage/lcov-report/core/api/services/groups/index.html +116 -0
  208. package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +184 -0
  209. package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +118 -0
  210. package/coverage/lcov-report/core/api/services/import-export/index.html +131 -0
  211. package/coverage/lcov-report/core/api/services/index.html +116 -0
  212. package/coverage/lcov-report/core/api/services/index.js.html +556 -0
  213. package/coverage/lcov-report/core/api/services/mailer/index.html +131 -0
  214. package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +190 -0
  215. package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +118 -0
  216. package/coverage/lcov-report/core/api/services/messages/index.html +116 -0
  217. package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +199 -0
  218. package/coverage/lcov-report/core/api/services/organisations/index.html +131 -0
  219. package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +178 -0
  220. package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +343 -0
  221. package/coverage/lcov-report/core/api/services/push/index.html +131 -0
  222. package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +190 -0
  223. package/coverage/lcov-report/core/api/services/push/push.service.js.html +121 -0
  224. package/coverage/lcov-report/core/api/services/storage/index.html +131 -0
  225. package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +190 -0
  226. package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +172 -0
  227. package/coverage/lcov-report/core/api/services/tags/index.html +116 -0
  228. package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +178 -0
  229. package/coverage/lcov-report/core/api/services/users/index.html +116 -0
  230. package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +307 -0
  231. package/coverage/lcov-report/core/api/utils.js.html +118 -0
  232. package/coverage/lcov-report/core/common/errors.js.html +88 -0
  233. package/coverage/lcov-report/core/common/index.html +176 -0
  234. package/coverage/lcov-report/core/common/index.js.html +115 -0
  235. package/coverage/lcov-report/core/common/permissions.js.html +1048 -0
  236. package/coverage/lcov-report/core/common/schema.js.html +190 -0
  237. package/coverage/lcov-report/core/common/utils.js.html +220 -0
  238. package/coverage/lcov-report/favicon.png +0 -0
  239. package/coverage/lcov-report/index.html +506 -0
  240. package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +457 -0
  241. package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +397 -0
  242. package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +1309 -0
  243. package/coverage/lcov-report/map/api/hooks/index.html +161 -0
  244. package/coverage/lcov-report/map/api/hooks/index.js.html +94 -0
  245. package/coverage/lcov-report/map/api/index.html +131 -0
  246. package/coverage/lcov-report/map/api/index.js.html +139 -0
  247. package/coverage/lcov-report/map/api/marshall.js.html +178 -0
  248. package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +106 -0
  249. package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +127 -0
  250. package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +196 -0
  251. package/coverage/lcov-report/map/api/models/index.html +161 -0
  252. package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +109 -0
  253. package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +274 -0
  254. package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +610 -0
  255. package/coverage/lcov-report/map/api/services/alerts/index.html +131 -0
  256. package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +310 -0
  257. package/coverage/lcov-report/map/api/services/catalog/index.html +116 -0
  258. package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1510 -0
  259. package/coverage/lcov-report/map/api/services/daptiles/index.html +116 -0
  260. package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +241 -0
  261. package/coverage/lcov-report/map/api/services/features/features.service.js.html +241 -0
  262. package/coverage/lcov-report/map/api/services/features/index.html +131 -0
  263. package/coverage/lcov-report/map/api/services/index.html +116 -0
  264. package/coverage/lcov-report/map/api/services/index.js.html +817 -0
  265. package/coverage/lcov-report/map/api/services/projects/index.html +116 -0
  266. package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +439 -0
  267. package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +466 -0
  268. package/coverage/lcov-report/map/common/errors.js.html +94 -0
  269. package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +541 -0
  270. package/coverage/lcov-report/map/common/grid.js.html +1612 -0
  271. package/coverage/lcov-report/map/common/index.html +371 -0
  272. package/coverage/lcov-report/map/common/index.js.html +172 -0
  273. package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +556 -0
  274. package/coverage/lcov-report/map/common/moment-utils.js.html +157 -0
  275. package/coverage/lcov-report/map/common/opendap-grid-source.js.html +868 -0
  276. package/coverage/lcov-report/map/common/opendap-utils.js.html +826 -0
  277. package/coverage/lcov-report/map/common/permissions.js.html +124 -0
  278. package/coverage/lcov-report/map/common/time-based-grid-source.js.html +418 -0
  279. package/coverage/lcov-report/map/common/tms-utils.js.html +274 -0
  280. package/coverage/lcov-report/map/common/wcs-grid-source.js.html +364 -0
  281. package/coverage/lcov-report/map/common/wcs-utils.js.html +586 -0
  282. package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1033 -0
  283. package/coverage/lcov-report/map/common/wfs-utils.js.html +574 -0
  284. package/coverage/lcov-report/map/common/wms-utils.js.html +451 -0
  285. package/coverage/lcov-report/map/common/wmts-utils.js.html +547 -0
  286. package/coverage/lcov-report/prettify.css +1 -0
  287. package/coverage/lcov-report/prettify.js +2 -0
  288. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  289. package/coverage/lcov-report/sorter.js +196 -0
  290. package/coverage/lcov.info +11245 -0
  291. package/coverage/map/api/hooks/hooks.catalog.js.html +457 -0
  292. package/coverage/map/api/hooks/hooks.features.js.html +397 -0
  293. package/coverage/map/api/hooks/hooks.query.js.html +1309 -0
  294. package/coverage/map/api/hooks/index.html +161 -0
  295. package/coverage/map/api/hooks/index.js.html +94 -0
  296. package/coverage/map/api/index.html +131 -0
  297. package/coverage/map/api/index.js.html +139 -0
  298. package/coverage/map/api/marshall.js.html +178 -0
  299. package/coverage/map/api/models/alerts.model.mongodb.js.html +106 -0
  300. package/coverage/map/api/models/catalog.model.mongodb.js.html +127 -0
  301. package/coverage/map/api/models/features.model.mongodb.js.html +196 -0
  302. package/coverage/map/api/models/index.html +161 -0
  303. package/coverage/map/api/models/projects.model.mongodb.js.html +109 -0
  304. package/coverage/map/api/services/alerts/alerts.hooks.js.html +274 -0
  305. package/coverage/map/api/services/alerts/alerts.service.js.html +610 -0
  306. package/coverage/map/api/services/alerts/index.html +131 -0
  307. package/coverage/map/api/services/catalog/catalog.hooks.js.html +310 -0
  308. package/coverage/map/api/services/catalog/index.html +116 -0
  309. package/coverage/map/api/services/daptiles/daptiles.service.js.html +1510 -0
  310. package/coverage/map/api/services/daptiles/index.html +116 -0
  311. package/coverage/map/api/services/features/features.hooks.js.html +241 -0
  312. package/coverage/map/api/services/features/features.service.js.html +241 -0
  313. package/coverage/map/api/services/features/index.html +131 -0
  314. package/coverage/map/api/services/index.html +116 -0
  315. package/coverage/map/api/services/index.js.html +817 -0
  316. package/coverage/map/api/services/projects/index.html +116 -0
  317. package/coverage/map/api/services/projects/projects.hooks.js.html +439 -0
  318. package/coverage/map/common/dynamic-grid-source.js.html +466 -0
  319. package/coverage/map/common/errors.js.html +94 -0
  320. package/coverage/map/common/geotiff-grid-source.js.html +541 -0
  321. package/coverage/map/common/grid.js.html +1612 -0
  322. package/coverage/map/common/index.html +371 -0
  323. package/coverage/map/common/index.js.html +172 -0
  324. package/coverage/map/common/meteo-model-grid-source.js.html +556 -0
  325. package/coverage/map/common/moment-utils.js.html +157 -0
  326. package/coverage/map/common/opendap-grid-source.js.html +868 -0
  327. package/coverage/map/common/opendap-utils.js.html +826 -0
  328. package/coverage/map/common/permissions.js.html +124 -0
  329. package/coverage/map/common/time-based-grid-source.js.html +418 -0
  330. package/coverage/map/common/tms-utils.js.html +274 -0
  331. package/coverage/map/common/wcs-grid-source.js.html +364 -0
  332. package/coverage/map/common/wcs-utils.js.html +586 -0
  333. package/coverage/map/common/weacast-grid-source.js.html +1033 -0
  334. package/coverage/map/common/wfs-utils.js.html +574 -0
  335. package/coverage/map/common/wms-utils.js.html +451 -0
  336. package/coverage/map/common/wmts-utils.js.html +547 -0
  337. package/coverage/prettify.css +1 -0
  338. package/coverage/prettify.js +2 -0
  339. package/coverage/sort-arrow-sprite.png +0 -0
  340. package/coverage/sorter.js +196 -0
  341. package/coverage/tmp/coverage-280506-1731704745613-0.json +1 -0
  342. package/coverage/tmp/coverage-280518-1731704745599-0.json +1 -0
  343. package/coverage/tmp/coverage-280529-1731704745588-0.json +1 -0
  344. package/coverage/tmp/coverage-280541-1731704745574-0.json +1 -0
  345. package/coverage/tmp/coverage-280548-1731704745545-0.json +1 -0
  346. package/extras/css/core.variables.scss +32 -8
  347. package/extras/icons/attribution.png +0 -0
  348. package/map/api/services/catalog/catalog.hooks.js +5 -7
  349. package/map/api/services/features/features.hooks.js +1 -1
  350. package/map/client/cesium/utils/utils.style.js +11 -2
  351. package/map/client/components/KAttribution.vue +108 -0
  352. package/map/client/components/KPositionIndicator.vue +11 -18
  353. package/map/client/components/KProjectMenu.vue +4 -4
  354. package/map/client/components/catalog/KCategoryItem.vue +74 -0
  355. package/map/client/components/catalog/KLayerCategories.vue +24 -12
  356. package/map/client/components/catalog/KLayersPanel.vue +139 -116
  357. package/map/client/components/catalog/KProjectSelector.vue +29 -17
  358. package/map/client/components/catalog/KProjectsPanel.vue +19 -35
  359. package/map/client/components/catalog/KViewSelector.vue +37 -25
  360. package/map/client/components/catalog/KViewsPanel.vue +19 -35
  361. package/map/client/components/form/KLocationField.vue +1 -2
  362. package/map/client/components/legend/KLegend.vue +34 -34
  363. package/map/client/components/location/KLocationCardSection.vue +18 -22
  364. package/map/client/components/location/KLocationMap.vue +36 -38
  365. package/map/client/components/location/KLocationTimeLineCard.vue +147 -0
  366. package/map/client/components/location/KLocationTip.vue +12 -2
  367. package/map/client/components/widget/KInformationBox.vue +0 -4
  368. package/map/client/components/widget/KStackableTimeSeries.vue +8 -1
  369. package/map/client/components/widget/KTimeSeries.vue +1 -1
  370. package/map/client/composables/highlight.js +29 -31
  371. package/map/client/composables/probe.js +7 -3
  372. package/map/client/composables/weather.js +71 -31
  373. package/map/client/i18n/map_en.json +3 -0
  374. package/map/client/i18n/map_fr.json +3 -0
  375. package/map/client/init.js +4 -3
  376. package/map/client/leaflet/ShapeMarker.js +1 -1
  377. package/map/client/leaflet/TiledFeatureLayer.js +2 -3
  378. package/map/client/leaflet/utils/utils.events.js +1 -1
  379. package/map/client/leaflet/utils/utils.style.js +20 -8
  380. package/map/client/mixins/globe/mixin.base-globe.js +111 -13
  381. package/map/client/mixins/globe/mixin.file-layers.js +10 -10
  382. package/map/client/mixins/globe/mixin.geojson-layers.js +90 -15
  383. package/map/client/mixins/globe/mixin.style.js +2 -0
  384. package/map/client/mixins/index.js +0 -1
  385. package/map/client/mixins/map/index.js +1 -0
  386. package/map/client/mixins/map/mixin.base-map.js +21 -2
  387. package/map/client/mixins/map/mixin.canvas-layers.js +7 -2
  388. package/map/client/mixins/map/mixin.edit-layers.js +12 -4
  389. package/map/client/mixins/map/mixin.file-layers.js +3 -0
  390. package/map/client/mixins/map/mixin.geojson-layers.js +92 -6
  391. package/map/client/mixins/map/mixin.pmtiles-layers.js +106 -0
  392. package/map/client/mixins/mixin.activity.js +8 -3
  393. package/map/client/mixins/mixin.feature-service.js +73 -32
  394. package/map/client/mixins/mixin.levels.js +1 -0
  395. package/map/client/mixins/mixin.weacast.js +10 -87
  396. package/map/client/utils/index.js +1 -0
  397. package/map/client/utils/utils.capture.js +1 -1
  398. package/map/client/utils/utils.catalog.js +7 -7
  399. package/map/client/utils/utils.features.js +59 -1
  400. package/map/client/utils/utils.js +10 -0
  401. package/map/client/utils/utils.layers.js +8 -0
  402. package/map/client/utils/utils.time-series.js +195 -0
  403. package/map/client/utils/utils.weacast.js +102 -0
  404. package/package.json +6 -6
  405. package/scripts/init_runner.sh +2 -2
  406. package/scripts/kash/CHANGELOG.md +12 -0
  407. package/scripts/kash/README.md +2 -0
  408. package/scripts/kash/kash.sh +34 -32
  409. package/scripts/run_tests.sh +2 -2
  410. package/scripts/setup_workspace.sh +24 -6
  411. package/test/api/core/hooks.test.js +6 -3
  412. package/test/api/core/test-log-2023-12-19.log +7 -0
  413. package/test/api/core/test-log-2024-01-04.log +14 -0
  414. package/test/api/core/test-log-2024-05-14.log +6 -0
  415. package/test/api/core/{test-log-2024-04-23.log → test-log-2024-06-06.log} +3 -3
  416. package/test/api/core/test-log-2024-06-26.log +25 -0
  417. package/test/api/core/test-log-2024-06-28.log +2 -0
  418. package/test/api/core/test-log-2024-07-09.log +0 -0
  419. package/test/api/core/test-log-2024-08-13.log +69 -0
  420. package/test/api/core/test-log-2024-10-28.log +53 -0
  421. package/test/api/core/test-log-2024-11-05.log +30 -0
  422. package/test/api/core/test-log-2024-11-15.log +23 -0
  423. package/test/api/core/test-log-2024-11-18.log +0 -0
  424. package/test/api/core/test-log-2024-12-03.log +30 -0
  425. package/test/api/map/alerts.test.js +3 -1
  426. package/test/api/map/config/layers.json +3 -1
  427. package/test/api/map/index.test.js +18 -1
  428. package/test/api/map/test-log-2023-11-24.log +121 -0
  429. package/test/api/map/test-log-2023-12-12.log +29 -0
  430. package/test/api/map/test-log-2023-12-13.log +5 -0
  431. package/test/api/map/test-log-2024-01-04.log +2 -0
  432. package/test/api/map/test-log-2024-01-11.log +1 -0
  433. package/test/api/map/test-log-2024-01-25.log +19 -0
  434. package/test/api/map/test-log-2024-06-06.log +39 -0
  435. package/test/api/map/test-log-2024-08-13.log +13 -0
  436. package/test/api/map/test-log-2024-08-20.log +55 -0
  437. package/test/api/map/test-log-2024-09-09.log +92 -0
  438. package/test/api/map/test-log-2024-10-28.log +11 -0
  439. package/test/client/core/utils.js +13 -0
  440. package/test/client/map/api.js +34 -0
  441. package/test/client/map/catalog.js +6 -2
  442. package/test/client/map/index.js +1 -0
  443. package/test/client/map/utils.js +4 -2
  444. package/core/client/components/collection/KList.vue +0 -135
  445. package/core/client/components/layout/KPageSticky.vue +0 -53
  446. package/core/client/mixins/mixin.base-collection.js +0 -162
  447. package/core/client/utils/utils.data.js +0 -22
  448. package/map/client/mixins/mixin.catalog-panel.js +0 -26
  449. package/test/api/core/test-log-2024-04-22.log +0 -84
@@ -0,0 +1,195 @@
1
+ import _ from 'lodash'
2
+ import moment from 'moment'
3
+ import centroid from '@turf/centroid'
4
+ import { Time, Units, i18n } from '../../../core/client/index.js'
5
+ import { isMeasureLayer } from './utils.layers.js'
6
+ import { getMeasureForFeature } from './utils.features.js'
7
+ import { getForecastForLocation, getForecastProbe, getForecastForFeature } from './utils.weacast.js'
8
+
9
+ // Extract target variable data for timeseries from timeseries request result
10
+ async function getDataForVariable(data, variable, forecastLevel, runTime) {
11
+ data = await data
12
+ const times = _.get(data, 'time', _.get(data, 'forecastTime', {}))
13
+ const runTimes = _.get(data, 'runTime', {})
14
+ const properties = _.get(data, 'properties', {})
15
+ // Check if we are targetting a specific variable at level (forecast model case)
16
+ const name = (forecastLevel ? `${variable.name}-${forecastLevel}` : variable.name)
17
+ let values = []
18
+ // Aggregated variable available for feature ?
19
+ if (properties[name] && Array.isArray(properties[name])) {
20
+ // Build data structure as expected by visualisation
21
+ values = properties[name].map((value, index) => {
22
+ value = Units.convert(value, variable.unit, variable.targetUnit)
23
+ return { time: moment.utc(times[name][index]).valueOf(), [name]: value }
24
+ })
25
+ // Keep only selected value if multiple are provided for the same time (eg different forecasts)
26
+ if (variable.runTimes && runTime && !_.isEmpty(_.get(runTimes, name))) {
27
+ values = values.filter((value, index) => (runTimes[name][index] === runTime.toISOString()))
28
+ } else values = _.uniqBy(values, 'time')
29
+ }
30
+ return values
31
+ }
32
+
33
+ // Retrieve data coming from a weather forecast request for timeseries
34
+ async function fetchDataForForecastSeries({
35
+ feature, location, layer, startTime, endTime,
36
+ forecastModel, forecastLevel, weacastApi
37
+ }) {
38
+ // Use current time range if not provided
39
+ const { start, end } = Time.getRange()
40
+ if (!startTime) startTime = start
41
+ if (!endTime) endTime = end
42
+ // Depending on input use the right function to retrieve data
43
+ let data
44
+ // No feature clicked => custom probe function or dynamic weacast probe at position
45
+ if (!feature) {
46
+ data = await getForecastForLocation({ longitude: location.lng, latitude: location.lat, startTime, endTime, forecastModel, forecastLevel, weacastApi })
47
+ } else if (layer.probe) { // Static weacast probe
48
+ const probe = await getForecastProbe({ name: layer.probe, forecastModel, weacastApi })
49
+ if (probe) {
50
+ data = await getForecastForFeature({ probe, featureId: _.get(feature, probe.featureId), startTime, endTime, forecastModel, forecastLevel, weacastApi })
51
+ }
52
+ } else { // Dynamic weacast probe at feature position
53
+ const location = centroid(feature)
54
+ const longitude = _.get(location, 'geometry.coordinates[0]')
55
+ const latitude = _.get(location, 'geometry.coordinates[1]')
56
+ data = await getForecastForLocation({ longitude, latitude, startTime, endTime, forecastModel, forecastLevel, weacastApi })
57
+ }
58
+ return data
59
+ }
60
+
61
+ // Retrieve data coming from a measure request for timeseries
62
+ // Can also use a custom probing function if provided
63
+ async function fetchDataForMeasureSeries({
64
+ feature, location, layer, startTime, endTime, level, probeFunction
65
+ }) {
66
+ // Use current time range if not provided
67
+ const { start, end } = Time.getRange()
68
+ if (!startTime) startTime = start
69
+ if (!endTime) endTime = end
70
+ // Depending on input use the right function to retrieve data
71
+ let data
72
+ // No feature clicked => custom probe function or dynamic weacast probe at position
73
+ if (probeFunction) {
74
+ data = await probeFunction({ feature, location, layer, level, startTime, endTime })
75
+ } else if (isMeasureLayer(layer)) { // Static measure probe
76
+ data = await getMeasureForFeature(layer, feature, startTime, endTime, level)
77
+ }
78
+ return data
79
+ }
80
+
81
+ // Build timeseries to be used in charts for target feature and associated layer definition or probe location
82
+ export function getForecastTimeSeries({
83
+ feature, location, layer, startTime, endTime, runTime,
84
+ forecastLayers, forecastModel, forecastLevel, weacastApi, fetchDelay
85
+ }) {
86
+ let forecastVariables = []
87
+ if (forecastLayers && forecastLayers.length > 0) forecastLayers.forEach(layer => { forecastVariables = forecastVariables.concat(_.get(layer, 'variables', [])) })
88
+ forecastVariables = _.uniqBy(forecastVariables, 'name')
89
+ if (forecastVariables.length === 0) return []
90
+ const properties = _.get(feature, 'properties', {})
91
+ // Create promise to fetch data as it will be shared by all series,
92
+ // indeed a weather forecast request gets all aggregated variables
93
+ const forecastData = fetchDataForForecastSeries({
94
+ feature, location, layer, startTime, endTime, forecastModel, forecastLevel, weacastApi
95
+ })
96
+ // Fetch data function to request data update,
97
+ // we use debounce as a weather forecast request stores all aggregated variables
98
+ // so that when all series are updated at once a single query will be send.
99
+ const fetchForecast = _.debounce(() => fetchDataForForecastSeries({
100
+ feature, location, layer, startTime, endTime, forecastModel, forecastLevel, weacastApi
101
+ }), fetchDelay || 250, { leading: true, trailing: false })
102
+
103
+ const series = forecastVariables.map(variable => {
104
+ // Base unit could be either directly the unit or the property of the measure storing the unit
105
+ const baseUnit = _.get(properties, 'unit', variable.unit)
106
+ // Known by the unit system ?
107
+ const unit = Units.getUnit(baseUnit)
108
+ const targetUnit = Units.getTargetUnit(baseUnit)
109
+ const serie = {
110
+ probedLocationData: forecastData,
111
+ data: getDataForVariable(forecastData, variable, forecastLevel, runTime),
112
+ variable: {
113
+ name: variable.name,
114
+ label: `${i18n.tie(variable.label)} (${Units.getTargetUnitSymbol(baseUnit)})`,
115
+ unit,
116
+ targetUnit,
117
+ chartjs: Object.assign({
118
+ parsing: {
119
+ xAxisKey: 'time',
120
+ yAxisKey: (forecastLevel ? `${variable.name}-${forecastLevel}` : variable.name)
121
+ },
122
+ cubicInterpolationMode: 'monotone',
123
+ tension: 0.4
124
+ }, _.cloneDeep(variable.chartjs))
125
+ }
126
+ }
127
+ serie.fetch = () => {
128
+ serie.probedLocationData = fetchForecast()
129
+ serie.data = getDataForVariable(serie.probedLocationData, variable, forecastLevel, runTime)
130
+ return serie.data
131
+ }
132
+ return serie
133
+ })
134
+
135
+ return series
136
+ }
137
+
138
+ // Build timeseries to be used in charts for target feature and associated layer definition or probe location
139
+ export function getMeasureTimeSeries({
140
+ feature, location, layer, layers, startTime, endTime, runTime,
141
+ level, probeFunction, fetchDelay
142
+ }) {
143
+ // A feature comes from a single layer so target variables from it by default
144
+ let variables = _.get(layer, 'variables', [])
145
+ // However, a probe can target variables coming from multiple layers
146
+ if (layers && layers.length > 0) layers.forEach(layer => { variables = variables.concat(_.get(layer, 'variables', [])) })
147
+ variables = _.uniqBy(variables, 'name')
148
+ if (variables.length === 0) return []
149
+ const properties = _.get(feature, 'properties', {})
150
+ // Create promise to fetch data as it will be shared by all series,
151
+ // indeed a measure request gets all aggregated variables
152
+ const data = fetchDataForMeasureSeries({
153
+ feature, location, layer, startTime, endTime, level, probeFunction
154
+ })
155
+ // Fetch data function to request data update,
156
+ // we use debounce as a measure request stores all aggregated variables
157
+ // so that when all series are updated at once a single query will be send.
158
+ const fetch = _.debounce(() => fetchDataForMeasureSeries({
159
+ feature, location, layer, startTime, endTime, level, probeFunction
160
+ }), fetchDelay || 250, { leading: true, trailing: false })
161
+
162
+ const series = variables.map(variable => {
163
+ // Base unit could be either directly the unit or the property of the measure storing the unit
164
+ const baseUnit = _.get(properties, 'unit', variable.unit)
165
+ // Known by the unit system ?
166
+ const unit = Units.getUnit(baseUnit)
167
+ const targetUnit = Units.getTargetUnit(baseUnit)
168
+ const serie = {
169
+ probedLocationData: data,
170
+ data: getDataForVariable(data, variable),
171
+ variable: {
172
+ name: variable.name,
173
+ label: `${i18n.tie(variable.label)} (${Units.getTargetUnitSymbol(baseUnit)})`,
174
+ unit,
175
+ targetUnit,
176
+ chartjs: Object.assign({
177
+ parsing: {
178
+ xAxisKey: 'time',
179
+ yAxisKey: variable.name
180
+ },
181
+ cubicInterpolationMode: 'monotone',
182
+ tension: 0.4
183
+ }, _.cloneDeep(variable.chartjs))
184
+ }
185
+ }
186
+ serie.fetch = () => {
187
+ serie.probedLocationData = fetch()
188
+ serie.data = getDataForVariable(serie.probedLocationData, variable)
189
+ return serie.data
190
+ }
191
+ return serie
192
+ })
193
+
194
+ return series
195
+ }
@@ -0,0 +1,102 @@
1
+ import _ from 'lodash'
2
+ import logger from 'loglevel'
3
+
4
+ export async function getForecastForLocation ({ longitude, latitude, startTime, endTime, forecastModel, forecastLevel, weacastApi }) {
5
+ // Not yet ready
6
+ if (!forecastModel) return
7
+ // From now to last available time
8
+ const geometry = {
9
+ type: 'Point',
10
+ coordinates: [longitude, latitude]
11
+ }
12
+ const query = {
13
+ forecastTime: {
14
+ $gte: startTime.format(),
15
+ $lte: endTime.format()
16
+ },
17
+ geometry: {
18
+ $geoIntersects: {
19
+ $geometry: geometry
20
+ }
21
+ }
22
+ }
23
+ let probedLocation
24
+ try {
25
+ let elements = forecastModel.elements.map(element => element.name)
26
+ // Filter available elements according to current level if any
27
+ if (forecastLevel) elements = elements.filter(element => element.endsWith(forecastLevel.toString()))
28
+ else {
29
+ elements = elements.filter(element => {
30
+ const tokens = element.split('-')
31
+ return (tokens.length === 0) || !_.isFinite(_.toNumber(tokens[tokens.length - 1]))
32
+ })
33
+ }
34
+ const response = await weacastApi.getService('probes')
35
+ .create({
36
+ forecast: forecastModel.name,
37
+ elements
38
+ }, { query })
39
+ if (response.features.length > 0) {
40
+ probedLocation = response.features[0]
41
+ } else throw new Error('Cannot find valid forecast at location')
42
+ } catch (error) {
43
+ logger.error(error)
44
+ }
45
+ return probedLocation
46
+ }
47
+
48
+ export async function getForecastProbe ({ name, forecastModel, weacastApi }) {
49
+ const results = await weacastApi.getService('probes').find({
50
+ query: {
51
+ name,
52
+ forecast: forecastModel.name,
53
+ $paginate: false,
54
+ $select: ['elements', 'forecast', 'featureId']
55
+ }
56
+ })
57
+ if (results.length > 0) {
58
+ const probe = results[0]
59
+ return probe
60
+ } else {
61
+ return null
62
+ }
63
+ }
64
+
65
+ export async function getForecastForFeature ({ probe, featureId, startTime, endTime, forecastModel, forecastLevel, weacastApi }) {
66
+ let probedLocation
67
+ try {
68
+ let elements = forecastModel.elements.map(element => element.name)
69
+ // Filter available elements according to current level if any
70
+ if (forecastLevel) {
71
+ elements = elements.filter(element => element.endsWith(forecastLevel.toString()))
72
+ } else {
73
+ elements = elements.filter(element => {
74
+ const tokens = element.split('-')
75
+ return (tokens.length === 0) || !_.isFinite(_.toNumber(tokens[tokens.length - 1]))
76
+ })
77
+ }
78
+ // Need to add derived values for static probes as they are not computed on the fly
79
+ const windDirection = (forecastLevel ? `windDirection-${forecastLevel}` : 'windDirection')
80
+ const windSpeed = (forecastLevel ? `windSpeed-${forecastLevel}` : 'windSpeed')
81
+ elements = elements.concat([windDirection, windSpeed])
82
+
83
+ const results = await weacastApi.getService('probe-results').find({
84
+ query: {
85
+ probeId: probe._id,
86
+ forecastTime: {
87
+ $gte: startTime.format(),
88
+ $lte: endTime.format()
89
+ },
90
+ [probe.featureId]: featureId,
91
+ $groupBy: probe.featureId,
92
+ $aggregate: elements
93
+ }
94
+ })
95
+ if (results.length > 0) {
96
+ probedLocation = results[0]
97
+ } else throw new Error('Cannot find valid forecast for feature')
98
+ } catch (error) {
99
+ logger.error(error)
100
+ }
101
+ return probedLocation
102
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kalisio/kdk",
3
3
  "description": "Kalisio Development Kit",
4
- "version": "2.3.2",
4
+ "version": "2.4.1",
5
5
  "homepage": "https://github.com/kalisio/kdk",
6
6
  "type": "module",
7
7
  "keywords": [
@@ -118,14 +118,14 @@
118
118
  "jsdap": "^8.1.0",
119
119
  "limiter": "^1.1.3",
120
120
  "lodash": "^4.17.15",
121
- "lru-cache": "^5.1.1",
121
+ "lru-cache": "^10.2.2",
122
122
  "moment": "^2.24.0",
123
123
  "mongodb": "^3.6.2",
124
124
  "node-fetch": "^2.6.0",
125
125
  "papaparse": "^5.4.1",
126
126
  "password-generator": "^2.3.2",
127
127
  "password-validator": "^4.0.0",
128
- "sanitize-html": "^2.3.2",
128
+ "sanitize-html": "^2.13.0",
129
129
  "sift": "^8.0.0",
130
130
  "superagent": "^5.1.0",
131
131
  "tiny-emitter": "^2.1.0",
@@ -139,10 +139,10 @@
139
139
  "devDependencies": {
140
140
  "@feathersjs/authentication-client": "^5.0.8",
141
141
  "@feathersjs/memory": "^5.0.8",
142
- "@kalisio/feathers-distributed": "^2.3.0",
142
+ "@kalisio/feathers-distributed": "^2.4.0",
143
143
  "@turf/intersect": "^6.1.3",
144
- "@weacast/gfs": "^2.1.5",
145
- "@weacast/probe": "^2.1.5",
144
+ "@weacast/gfs": "^2.2.1",
145
+ "@weacast/probe": "^2.2.1",
146
146
  "body-parser": "^1.17.1",
147
147
  "c8": "^7.11.0",
148
148
  "chai": "^4.2.0",
@@ -12,11 +12,11 @@ THIS_DIR=$(dirname "$THIS_FILE")
12
12
  ### Github Actions
13
13
 
14
14
  init_github_run_tests() {
15
- install_reqs age sops nvm node16 mongo4 cc_test_reporter
15
+ install_reqs age sops nvm node20 mongo7 cc_test_reporter
16
16
  }
17
17
 
18
18
  init_github_additional_tests() {
19
- install_reqs age sops nvm node18 node20 mongo5 mongo6 mongo7
19
+ install_reqs age sops nvm node18 node22 mongo5 mongo6 mongo7
20
20
  }
21
21
 
22
22
  init_github_build_docs() {
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Changed
11
+
12
+ - `build_docs` now takes a fourth parameter, the version of node to use to build the docs
@@ -1,2 +1,4 @@
1
1
  # kash
2
2
  Kalisio's bash snippets repository
3
+
4
+ ## HOWTO use
@@ -124,6 +124,7 @@ NVM_VERSION=0.39.7
124
124
  NODE16_VERSION=16.20.2
125
125
  NODE18_VERSION=18.19.1
126
126
  NODE20_VERSION=20.11.1
127
+ NODE22_VERSION=22.3.0
127
128
 
128
129
  # https://www.mongodb.com/try/download/community
129
130
  MONGODB4_VERSION=4.4.28
@@ -144,7 +145,7 @@ install_yq() {
144
145
  curl -OLsS https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/checksums_hashes_order
145
146
  curl -OLsS https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/extract-checksum.sh
146
147
  chmod u+x extract-checksum.sh
147
- ./extract-checksum.sh "SHA-256" "yq_linux_amd64.tar.gz" | awk '{ print $2 " " $1}' | sha256sum --check
148
+ ./extract-checksum.sh "SHA-256" "yq_linux_amd64.tar.gz" | awk '{ print $2 " " $1}' | sha256sum --check --quiet
148
149
  cd ~-
149
150
  fi
150
151
  cd "$DL_PATH"
@@ -295,6 +296,11 @@ install_node20() {
295
296
  bash -i -c "nvm install $NODE20_VERSION"
296
297
  }
297
298
 
299
+ # Install node22, requires nvm to be installed
300
+ install_node22() {
301
+ bash -i -c "nvm install $NODE22_VERSION"
302
+ }
303
+
298
304
  # Install mongo4 in ~/.local/bin/mongo4
299
305
  # Arg1: a writable folder where to write downloaded files
300
306
  # NOTE: each mongo version is installed in a separate folder to support multiple versions
@@ -545,57 +551,53 @@ get_json_value() {
545
551
  # Returns the current git tag (or empty string if not on a tag)
546
552
  # Arg1: the repository root
547
553
  get_git_tag() {
548
- local REPO_ROOT="$1"
549
- cd "$REPO_ROOT"
550
- git tag --points-at
551
-
552
- # case "$CI_ID" in
554
+ case "$CI_ID" in
555
+ gitlab)
556
+ echo "${CI_COMMIT_TAG:-}"
557
+ ;;
553
558
  # github)
554
559
  # if [ "$GITHUB_REF_TYPE" = "tag" ]; then
555
560
  # echo "$GITHUB_REF_NAME"
556
561
  # fi
557
562
  # ;;
558
- # gitlab)
559
- # echo "${CI_COMMIT_TAG:-}"
560
- # ;;
561
563
  # travis)
562
564
  # echo "${TRAVIS_TAG:-}"
563
565
  # ;;
564
- # *)
565
- # git tag --points-at
566
- # ;;
567
- # esac
568
- cd ~-
566
+ *)
567
+ local REPO_ROOT="$1"
568
+ cd "$REPO_ROOT"
569
+ git tag --points-at
570
+ cd ~-
571
+ ;;
572
+ esac
569
573
  }
570
574
 
571
575
  # Returns the current git branch (might be empty string if on a tag and repo was checked out with --depth 1)
572
576
  # Arg1: the repository root
573
577
  get_git_branch() {
574
- local REPO_ROOT="$1"
575
- cd "$REPO_ROOT"
576
- git branch --show-current
577
-
578
- # case "$CI_ID" in
578
+ case "$CI_ID" in
579
+ gitlab)
580
+ if [ -z "${CI_COMMIT_TAG:-}" ]; then
581
+ echo "$CI_COMMIT_REF_NAME"
582
+ fi
583
+ ;;
579
584
  # github)
580
585
  # if [ "$GITHUB_REF_TYPE" = "branch" ]; then
581
586
  # echo "$GITHUB_REF_NAME"
582
587
  # fi
583
588
  # ;;
584
- # gitlab)
585
- # if [ -z "$CI_COMMIT_TAG" ]; then
586
- # echo "$CI_COMMIT_REF_NAME"
587
- # fi
588
- # ;;
589
589
  # travis)
590
590
  # if [ -z "$TRAVIS_TAG" ]; then
591
591
  # echo "$TRAVIS_BRANCH"
592
592
  # fi
593
593
  # ;;
594
- # *)
595
- # git branch --show-current
596
- # ;;
597
- # esac
598
- cd ~-
594
+ *)
595
+ local REPO_ROOT="$1"
596
+ cd "$REPO_ROOT"
597
+ git branch --show-current
598
+ cd ~-
599
+ ;;
600
+ esac
599
601
  }
600
602
 
601
603
  # Returns the current git commit sha, always defined
@@ -744,7 +746,7 @@ begin_group() {
744
746
  elif [ "$CI_ID" = "gitlab" ]; then
745
747
  # see https://docs.gitlab.com/ee/ci/jobs/#custom-collapsible-sections
746
748
  local SECTION
747
- SECTION=$(echo "$TITLE" | tr ' .' '_')
749
+ SECTION=$(echo "$TITLE" | tr ' .:-' '_')
748
750
  echo -e "section_start:$(date +%s):$SECTION\r\e[0K\e[95m$TITLE\e[0m"
749
751
  elif [ "$CI_ID" = "travis" ]; then
750
752
  # see
@@ -765,7 +767,7 @@ end_group() {
765
767
  echo "::endgroup::"
766
768
  elif [ "$CI_ID" = "gitlab" ]; then
767
769
  local SECTION
768
- SECTION=$(echo "$TITLE" | tr ' .' '_')
770
+ SECTION=$(echo "$TITLE" | tr ' .:-' '_')
769
771
  echo -e "section_end:$(date +%s):$SECTION\r\e[0K"
770
772
  elif [ "$CI_ID" = "travis" ]; then
771
773
  echo "travis_fold:end:$TITLE"
@@ -1505,7 +1507,7 @@ build_job() {
1505
1507
  docker push "$IMAGE_NAME:$IMAGE_TAG"
1506
1508
  fi
1507
1509
 
1508
- docker logout
1510
+ docker logout "$REGISTRY_URL"
1509
1511
 
1510
1512
  end_group "Building $IMAGE_NAME:$IMAGE_TAG ..."
1511
1513
  }
@@ -12,8 +12,8 @@ WORKSPACE_DIR="$(dirname "$ROOT_DIR")"
12
12
  ## Parse options
13
13
  ##
14
14
 
15
- NODE_VER=16
16
- MONGO_VER="4"
15
+ NODE_VER=20
16
+ MONGO_VER=7
17
17
  CI_STEP_NAME="Run tests"
18
18
  CODE_COVERAGE=false
19
19
  while getopts "m:n:cr:" option; do
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
- # set -x
3
+ #set -x
4
4
 
5
5
  THIS_FILE=$(readlink -f "${BASH_SOURCE[0]}")
6
6
  THIS_DIR=$(dirname "$THIS_FILE")
@@ -12,6 +12,21 @@ WORKSPACE_DIR="$(dirname "$ROOT_DIR")"
12
12
  ## Parse options
13
13
  ##
14
14
 
15
+ WORKSPACE_NODE=20
16
+ WORKSPACE_KIND=klifull
17
+ OPT_LIST="n:k:"
18
+
19
+ while getopts "$OPT_LIST" OPT; do
20
+ case $OPT in
21
+ n) # defines node version
22
+ WORKSPACE_NODE=$OPTARG;;
23
+ k) # workspace kind (nokli kli klifull)
24
+ WORKSPACE_KIND=$OPTARG;;
25
+ *)
26
+ ;;
27
+ esac
28
+ done
29
+
15
30
  begin_group "Setting up workspace ..."
16
31
 
17
32
  if [ "$CI" != true ]; then
@@ -31,12 +46,15 @@ if [ "$CI" != true ]; then
31
46
 
32
47
  # Clone project in the workspace
33
48
  git_shallow_clone "$KALISIO_GITHUB_URL/kalisio/kdk.git" "$WORKSPACE_DIR/kdk" "${WORKSPACE_TAG:-${WORKSPACE_BRANCH:-}}"
49
+
50
+ # unset KALISIO_DEVELOPMENT_DIR because we want kli to clone everyhting in $WORKSPACE_DIR
51
+ unset KALISIO_DEVELOPMENT_DIR
34
52
  fi
35
53
 
36
- setup_lib_workspace "$WORKSPACE_DIR" "$KALISIO_GITHUB_URL/kalisio/development.git" \
37
- "https://github.com/kalisio/feathers-distributed.git" \
38
- "https://github.com/kalisio/feathers-webpush.git" \
39
- "https://github.com/kalisio/feathers-s3.git" \
40
- "https://github.com/kalisio/feathers-import-export.git"
54
+ setup_lib_workspace "$WORKSPACE_DIR" "$KALISIO_GITHUB_URL/kalisio/development.git"
55
+
56
+ if [ "$WORKSPACE_KIND" != "nokli" ]; then
57
+ run_kli "$WORKSPACE_DIR" "$WORKSPACE_NODE" "$WORKSPACE_DIR/development/workspaces/libs/kdk/dev/kdk.cjs" "$WORKSPACE_KIND"
58
+ fi
41
59
 
42
60
  end_group "Setting up workspace ..."
@@ -69,7 +69,7 @@ describe('core:hooks', () => {
69
69
  data: {
70
70
  'field._id': id.toString(),
71
71
  objects: [{
72
- _id: id.toString(), date: new Date()
72
+ _id: id.toString(), date: new Date(), string: 'transmission'
73
73
  }, {
74
74
  _id: anotherId, date: new Date()
75
75
  }],
@@ -79,6 +79,7 @@ describe('core:hooks', () => {
79
79
  query: {
80
80
  _id: { $in: [id.toString()] },
81
81
  id: anotherId,
82
+ tags: { $in: ['transmission'] },
82
83
  array: [new Date(), new Date()]
83
84
  }
84
85
  }
@@ -92,16 +93,17 @@ describe('core:hooks', () => {
92
93
  expect(Array.isArray(hook.data.objects)).beTrue()
93
94
  expect(hook.data.objects.length).to.equal(2)
94
95
  let object = hook.data.objects[0]
95
- expect(Object.keys(object)).to.deep.equal(['_id', 'date'])
96
+ expect(Object.keys(object)).to.deep.equal(['_id', 'date', 'string'])
96
97
  expect(ObjectID.isValid(object._id)).beTrue()
97
98
  expect(object._id.toString()).to.equal(id.toString())
98
99
  expect(object.date instanceof Date).beTrue()
100
+ expect(typeof object.string === 'string').beTrue()
99
101
  object = hook.data.objects[1]
100
102
  expect(Object.keys(object)).to.deep.equal(['_id', 'date'])
101
103
  expect(ObjectID.isValid(object._id)).beTrue()
102
104
  expect(object._id.toString()).to.equal(anotherId.toString())
103
105
  expect(object.date instanceof Date).beTrue()
104
- expect(Object.keys(hook.params.query)).to.deep.equal(['_id', 'id', 'array'])
106
+ expect(Object.keys(hook.params.query)).to.deep.equal(['_id', 'id', 'tags', 'array'])
105
107
  expect(Array.isArray(hook.params.query.array)).beTrue()
106
108
  expect(hook.params.query.array.length).to.equal(2)
107
109
  hook.params.query.array.forEach(value => {
@@ -111,6 +113,7 @@ describe('core:hooks', () => {
111
113
  expect(hook.params.query._id.$in[0].toString()).to.equal(id.toString())
112
114
  expect(ObjectID.isValid(hook.params.query.id)).beTrue()
113
115
  expect(hook.params.query.id.toString()).to.equal(anotherId.toString())
116
+ expect(typeof hook.params.query.tags.$in[0] === 'string').beTrue()
114
117
  })
115
118
 
116
119
  it('check uniqueness', async () => {
@@ -0,0 +1,7 @@
1
+ {"level":"info","message":"This is a log test"}
2
+ {"level":"error","message":"error: api/tags - Method: create: You are not allowed to access service tags"}
3
+ {"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
4
+ {"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
5
+ {"level":"error","message":"error: api/authorisations - Method: create: You are not allowed to change authorisation on resource"}
6
+ {"level":"error","message":"error: api/authorisations - Method: remove: You are not allowed to change authorisation on subject(s)"}
7
+ {"level":"info","message":"This is a log test"}
@@ -0,0 +1,14 @@
1
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
2
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
3
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
4
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
5
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
6
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
7
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
8
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
9
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
10
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
11
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
12
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
13
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
14
+ {"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
@@ -0,0 +1,6 @@
1
+ {"level":"error","message":"error: api/tags - Method: create: You are not allowed to access service tags"}
2
+ {"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
3
+ {"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
4
+ {"level":"error","message":"error: api/authorisations - Method: create: You are not allowed to change authorisation on resource"}
5
+ {"level":"error","message":"error: api/authorisations - Method: remove: You are not allowed to change authorisation on subject(s)"}
6
+ {"level":"info","message":"This is a log test"}
@@ -15,9 +15,9 @@
15
15
  {"level":"error","message":"error: api/storage - Method: get: The specified key does not exist."}
16
16
  {"level":"error","message":"error: api/organisations - Method: create: You are not allowed to access service organisations"}
17
17
  {"level":"error","message":"error: api/authorisations - Method: create: You are not allowed to perform create operation on authorisations"}
18
- {"level":"error","message":"error: api/66275eb3b88564fe1c99b8ee/storage - Method: get: You are not allowed to access service 66275eb3b88564fe1c99b8ee/storage"}
19
- {"level":"error","message":"error: api/66275eb3b88564fe1c99b8ee/groups - Method: create: You are not allowed to perform create operation on groups"}
20
- {"level":"error","message":"error: api/66275eb3b88564fe1c99b8ee/groups - Method: patch: You are not allowed to perform patch operation on groups"}
18
+ {"level":"error","message":"error: api/666168414d1b825f7ae70b7a/storage - Method: get: You are not allowed to access service 666168414d1b825f7ae70b7a/storage"}
19
+ {"level":"error","message":"error: api/666168414d1b825f7ae70b7a/groups - Method: create: You are not allowed to perform create operation on groups"}
20
+ {"level":"error","message":"error: api/666168414d1b825f7ae70b7a/groups - Method: patch: You are not allowed to perform patch operation on groups"}
21
21
  {"level":"error","message":"error: api/authorisations - Method: create: You are not allowed to perform create operation on authorisations"}
22
22
  {"level":"error","message":"error: api/authorisations - Method: create: You are not allowed to perform create operation on authorisations"}
23
23
  {"level":"error","message":"error: api/users - Method: remove: You are not allowed to delete the user undefined"}