@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.
- package/core/api/application.js +2 -4
- package/core/api/authentication.js +2 -3
- package/core/api/db.js +10 -2
- package/core/api/hooks/hooks.authorisations.js +4 -2
- package/core/api/hooks/hooks.push.js +6 -2
- package/core/api/hooks/hooks.query.js +29 -12
- package/core/api/hooks/hooks.users.js +30 -17
- package/core/api/models/configurations.model.mongodb.js +4 -0
- package/core/api/services/authorisations/authorisations.service.js +1 -1
- package/core/api/services/configurations/configurations.hooks.js +33 -0
- package/core/api/services/index.js +41 -7
- package/core/api/services/messages/messages.hooks.js +9 -3
- package/core/client/api.js +14 -1
- package/core/client/capabilities.js +1 -6
- package/core/client/components/KAvatar.vue +24 -20
- package/core/client/components/account/KProfile.vue +10 -71
- package/core/client/components/account/index.js +0 -2
- package/core/client/components/app/KSettings.vue +1 -0
- package/core/client/components/collection/KBoard.vue +4 -3
- package/core/client/components/collection/KCardSection.vue +1 -0
- package/core/client/components/collection/KGrid.vue +2 -0
- package/core/client/components/collection/KTable.vue +5 -1
- package/core/client/components/collection/KTimeLine.vue +9 -1
- package/core/client/components/collection/index.js +0 -2
- package/core/client/components/form/KChipsField.vue +2 -1
- package/core/client/components/form/KEmailField.vue +1 -0
- package/core/client/components/form/KFileField.vue +22 -1
- package/core/client/components/form/KForm.vue +2 -0
- package/core/client/components/form/KItemField.vue +1 -0
- package/core/client/components/form/KNumberField.vue +1 -0
- package/core/client/components/form/KPasswordField.vue +1 -0
- package/core/client/components/form/KPhoneField.vue +1 -0
- package/core/client/components/form/KPropertyItemField.vue +1 -0
- package/core/client/components/form/KResolutionField.vue +1 -0
- package/core/client/components/form/KSelectField.vue +31 -0
- package/core/client/components/form/KTagField.vue +1 -0
- package/core/client/components/form/KTextField.vue +1 -0
- package/core/client/components/form/KTokenField.vue +1 -0
- package/core/client/components/form/KUnitField.vue +1 -0
- package/core/client/components/form/KUrlField.vue +1 -0
- package/core/client/components/graphics/KIcon.vue +3 -4
- package/core/client/components/layout/KPage.vue +1 -0
- package/core/client/components/layout/KWindow.vue +6 -3
- package/core/client/components/messages/KMessageComposer.vue +2 -1
- package/core/client/components/messages/KMessagesTimeLine.vue +1 -1
- package/core/client/components/time/KDate.vue +1 -2
- package/core/client/components/time/KDateTime.vue +11 -11
- package/core/client/components/time/KTime.vue +1 -1
- package/core/client/composables/collection.js +33 -8
- package/core/client/composables/errors.js +1 -1
- package/core/client/composables/layout.js +9 -9
- package/core/client/configurations.js +50 -0
- package/core/client/exporter.js +1 -1
- package/core/client/i18n/core_en.json +6 -39
- package/core/client/i18n/core_fr.json +6 -39
- package/core/client/index.js +2 -0
- package/core/client/layout.js +8 -8
- package/core/client/mixins/mixin.base-activity.js +5 -2
- package/core/client/mixins/mixin.base-field.js +3 -3
- package/core/client/search.js +2 -1
- package/core/client/utils/utils.collection.js +8 -8
- package/core/client/utils/utils.items.js +4 -0
- package/core/client/utils/utils.push.js +3 -3
- package/core/client/utils/utils.session.js +7 -5
- package/core/client/utils/utils.shapes.js +38 -7
- package/core/client/utils/utils.time.js +21 -22
- package/core/common/schemas/users.update-profile.json +3 -2
- package/coverage/core/api/application.js.html +392 -398
- package/coverage/core/api/authentication.js.html +352 -187
- package/coverage/core/api/db.js.html +165 -126
- package/coverage/core/api/hooks/hooks.authentication.js.html +22 -196
- package/coverage/core/api/hooks/hooks.authorisations.js.html +383 -662
- package/coverage/core/api/hooks/hooks.logger.js.html +41 -41
- package/coverage/core/api/hooks/hooks.model.js.html +113 -101
- package/coverage/core/api/hooks/hooks.push.js.html +124 -97
- package/coverage/core/api/hooks/hooks.query.js.html +292 -217
- package/coverage/core/api/hooks/hooks.schemas.js.html +123 -123
- package/coverage/core/api/hooks/hooks.service.js.html +1 -1
- package/coverage/core/api/hooks/hooks.storage.js.html +1 -1
- package/coverage/core/api/hooks/{hooks.groups.js.html → hooks.tags.js.html} +100 -76
- package/coverage/core/api/hooks/hooks.users.js.html +255 -447
- package/coverage/core/api/hooks/index.html +107 -122
- package/coverage/core/api/hooks/index.js.html +4 -10
- package/coverage/core/api/index.html +46 -61
- package/coverage/core/api/index.js.html +9 -9
- package/coverage/core/api/marshall.js.html +9 -9
- package/coverage/core/api/models/{organisations.model.mongodb.js.html → configurations.model.mongodb.js.html} +10 -7
- package/coverage/core/api/models/index.html +35 -50
- package/coverage/core/api/models/messages.model.mongodb.js.html +39 -27
- package/coverage/core/api/models/tags.model.mongodb.js.html +26 -32
- package/coverage/core/api/models/users.model.mongodb.js.html +10 -10
- package/coverage/core/api/services/account/account.hooks.js.html +5 -5
- package/coverage/core/api/services/account/account.service.js.html +127 -127
- package/coverage/core/api/services/account/index.html +22 -22
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +213 -222
- package/coverage/core/api/services/authorisations/index.html +21 -21
- package/coverage/core/api/services/{organisations/organisations.hooks.js.html → configurations/configurations.hooks.js.html} +16 -10
- package/coverage/core/api/services/{groups → configurations}/index.html +8 -8
- package/coverage/core/api/services/databases/databases.hooks.js.html +1 -1
- package/coverage/core/api/services/databases/databases.service.js.html +1 -1
- package/coverage/core/api/services/databases/index.html +1 -1
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +76 -76
- package/coverage/core/api/services/import-export/import-export.service.js.html +32 -32
- package/coverage/core/api/services/import-export/index.html +32 -32
- package/coverage/core/api/services/index.html +21 -21
- package/coverage/core/api/services/index.js.html +313 -142
- package/coverage/core/api/services/mailer/index.html +32 -32
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +80 -80
- package/coverage/core/api/services/mailer/mailer.service.js.html +32 -32
- package/coverage/core/api/services/messages/index.html +21 -21
- package/coverage/core/api/services/messages/messages.hooks.js.html +112 -76
- package/coverage/core/api/services/push/index.html +32 -32
- package/coverage/core/api/services/push/push.hooks.js.html +80 -80
- package/coverage/core/api/services/push/push.service.js.html +34 -34
- package/coverage/core/api/services/storage/index.html +29 -29
- package/coverage/core/api/services/storage/storage.hooks.js.html +80 -80
- package/coverage/core/api/services/storage/storage.service.js.html +29 -29
- package/coverage/core/api/services/tags/index.html +21 -21
- package/coverage/core/api/services/tags/tags.hooks.js.html +119 -71
- package/coverage/core/api/services/users/index.html +27 -12
- package/coverage/core/api/services/users/users.hooks.js.html +14 -11
- package/coverage/core/api/services/users/users.service.js.html +100 -0
- package/coverage/core/common/errors.js.html +1 -1
- package/coverage/core/common/index.html +42 -27
- package/coverage/core/common/index.js.html +1 -1
- package/coverage/core/common/permissions.js.html +166 -472
- package/coverage/core/common/schema.js.html +4 -4
- package/coverage/core/common/utils.js.html +31 -25
- package/coverage/core/common/utils.offline.js.html +199 -0
- package/coverage/index.html +192 -192
- package/coverage/lcov-report/core/api/application.js.html +392 -398
- package/coverage/lcov-report/core/api/authentication.js.html +352 -187
- package/coverage/lcov-report/core/api/db.js.html +165 -126
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +22 -196
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +383 -662
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +41 -41
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +113 -101
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +124 -97
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +292 -217
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +123 -123
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/{hooks.groups.js.html → hooks.tags.js.html} +100 -76
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +255 -447
- package/coverage/lcov-report/core/api/hooks/index.html +107 -122
- package/coverage/lcov-report/core/api/hooks/index.js.html +4 -10
- package/coverage/lcov-report/core/api/index.html +46 -61
- package/coverage/lcov-report/core/api/index.js.html +9 -9
- package/coverage/lcov-report/core/api/marshall.js.html +9 -9
- package/coverage/lcov-report/core/api/models/{organisations.model.mongodb.js.html → configurations.model.mongodb.js.html} +10 -7
- package/coverage/lcov-report/core/api/models/index.html +35 -50
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +39 -27
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +26 -32
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +10 -10
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +5 -5
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +127 -127
- package/coverage/lcov-report/core/api/services/account/index.html +22 -22
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +213 -222
- package/coverage/lcov-report/core/api/services/authorisations/index.html +21 -21
- package/coverage/lcov-report/core/api/services/{groups/groups.hooks.js.html → configurations/configurations.hooks.js.html} +16 -10
- package/coverage/lcov-report/core/api/services/{groups → configurations}/index.html +8 -8
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/databases/index.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +76 -76
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +32 -32
- package/coverage/lcov-report/core/api/services/import-export/index.html +32 -32
- package/coverage/lcov-report/core/api/services/index.html +21 -21
- package/coverage/lcov-report/core/api/services/index.js.html +313 -142
- package/coverage/lcov-report/core/api/services/mailer/index.html +32 -32
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +80 -80
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +32 -32
- package/coverage/lcov-report/core/api/services/messages/index.html +21 -21
- package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +112 -76
- package/coverage/lcov-report/core/api/services/push/index.html +32 -32
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +80 -80
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +34 -34
- package/coverage/lcov-report/core/api/services/storage/index.html +29 -29
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +80 -80
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +29 -29
- package/coverage/lcov-report/core/api/services/tags/index.html +21 -21
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +119 -71
- package/coverage/lcov-report/core/api/services/users/index.html +27 -12
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +14 -11
- package/coverage/lcov-report/core/api/services/users/users.service.js.html +100 -0
- package/coverage/lcov-report/core/common/errors.js.html +1 -1
- package/coverage/lcov-report/core/common/index.html +42 -27
- package/coverage/lcov-report/core/common/index.js.html +1 -1
- package/coverage/lcov-report/core/common/permissions.js.html +166 -472
- package/coverage/lcov-report/core/common/schema.js.html +4 -4
- package/coverage/lcov-report/core/common/utils.js.html +31 -25
- package/coverage/lcov-report/core/common/utils.offline.js.html +199 -0
- package/coverage/lcov-report/index.html +192 -192
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +169 -31
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +1 -1
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +215 -35
- package/coverage/lcov-report/map/api/hooks/index.html +7 -7
- package/coverage/lcov-report/map/api/hooks/index.js.html +1 -1
- package/coverage/lcov-report/map/api/index.html +1 -1
- package/coverage/lcov-report/map/api/index.js.html +1 -1
- package/coverage/lcov-report/map/api/marshall.js.html +1 -1
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +82 -7
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/index.html +22 -7
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/{core/api/models/groups.model.mongodb.js.html → map/api/models/styles.model.mongodb.js.html} +10 -7
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/index.html +1 -1
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +39 -12
- package/coverage/lcov-report/map/api/services/catalog/index.html +5 -5
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/daptiles/index.html +1 -1
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +86 -11
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +307 -4
- package/coverage/lcov-report/map/api/services/features/index.html +7 -7
- package/coverage/lcov-report/map/api/services/index.html +5 -5
- package/coverage/lcov-report/map/api/services/index.js.html +326 -50
- package/coverage/lcov-report/map/api/services/projects/index.html +1 -1
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +1 -1
- package/coverage/{core/api/services/organisations → lcov-report/map/api/services/styles}/index.html +10 -25
- package/coverage/lcov-report/{core/api/services/organisations/organisations.hooks.js.html → map/api/services/styles/styles.hooks.js.html} +45 -12
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/errors.js.html +1 -1
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +7 -10
- package/coverage/lcov-report/map/common/grid.js.html +1 -1
- package/coverage/lcov-report/map/common/index.html +19 -19
- package/coverage/lcov-report/map/common/index.js.html +1 -1
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/moment-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/opendap-utils.js.html +4 -7
- package/coverage/lcov-report/map/common/permissions.js.html +10 -4
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/tms-utils.js.html +9 -12
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +3 -3
- package/coverage/lcov-report/map/common/wcs-utils.js.html +12 -15
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +2 -2
- package/coverage/lcov-report/map/common/wfs-utils.js.html +14 -17
- package/coverage/lcov-report/map/common/wms-utils.js.html +30 -12
- package/coverage/lcov-report/map/common/wmts-utils.js.html +10 -13
- package/coverage/lcov.info +4157 -3816
- package/coverage/map/api/hooks/hooks.catalog.js.html +169 -31
- package/coverage/map/api/hooks/hooks.features.js.html +1 -1
- package/coverage/map/api/hooks/hooks.query.js.html +215 -35
- package/coverage/map/api/hooks/index.html +7 -7
- package/coverage/map/api/hooks/index.js.html +1 -1
- package/coverage/map/api/index.html +1 -1
- package/coverage/map/api/index.js.html +1 -1
- package/coverage/map/api/marshall.js.html +1 -1
- package/coverage/map/api/models/alerts.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/catalog.model.mongodb.js.html +82 -7
- package/coverage/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/index.html +22 -7
- package/coverage/map/api/models/projects.model.mongodb.js.html +1 -1
- package/coverage/{core/api/models/groups.model.mongodb.js.html → map/api/models/styles.model.mongodb.js.html} +10 -7
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +1 -1
- package/coverage/map/api/services/alerts/alerts.service.js.html +1 -1
- package/coverage/map/api/services/alerts/index.html +1 -1
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +39 -12
- package/coverage/map/api/services/catalog/index.html +5 -5
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +1 -1
- package/coverage/map/api/services/daptiles/index.html +1 -1
- package/coverage/map/api/services/features/features.hooks.js.html +86 -11
- package/coverage/map/api/services/features/features.service.js.html +307 -4
- package/coverage/map/api/services/features/index.html +7 -7
- package/coverage/map/api/services/index.html +5 -5
- package/coverage/map/api/services/index.js.html +326 -50
- package/coverage/map/api/services/projects/index.html +1 -1
- package/coverage/map/api/services/projects/projects.hooks.js.html +1 -1
- package/coverage/{lcov-report/core/api/services/organisations → map/api/services/styles}/index.html +10 -25
- package/coverage/{core/api/services/groups/groups.hooks.js.html → map/api/services/styles/styles.hooks.js.html} +45 -12
- package/coverage/map/common/dynamic-grid-source.js.html +1 -1
- package/coverage/map/common/errors.js.html +1 -1
- package/coverage/map/common/geotiff-grid-source.js.html +7 -10
- package/coverage/map/common/grid.js.html +1 -1
- package/coverage/map/common/index.html +19 -19
- package/coverage/map/common/index.js.html +1 -1
- package/coverage/map/common/meteo-model-grid-source.js.html +1 -1
- package/coverage/map/common/moment-utils.js.html +1 -1
- package/coverage/map/common/opendap-grid-source.js.html +1 -1
- package/coverage/map/common/opendap-utils.js.html +4 -7
- package/coverage/map/common/permissions.js.html +10 -4
- package/coverage/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/map/common/tms-utils.js.html +9 -12
- package/coverage/map/common/wcs-grid-source.js.html +3 -3
- package/coverage/map/common/wcs-utils.js.html +12 -15
- package/coverage/map/common/weacast-grid-source.js.html +2 -2
- package/coverage/map/common/wfs-utils.js.html +14 -17
- package/coverage/map/common/wms-utils.js.html +30 -12
- package/coverage/map/common/wmts-utils.js.html +10 -13
- package/coverage/tmp/coverage-1028514-1773134124472-0.json +1 -0
- package/coverage/tmp/coverage-1028526-1773134124448-0.json +1 -0
- package/coverage/tmp/coverage-1028537-1773134124431-0.json +1 -0
- package/coverage/tmp/coverage-1028549-1773134124401-0.json +1 -0
- package/coverage/tmp/coverage-1028556-1773134124353-0.json +1 -0
- package/extras/configs/widgets.top.js +3 -3
- package/extras/tests/core/collection.mjs +2 -9
- package/extras/tours/pane.top.js +0 -9
- package/map/api/hooks/hooks.catalog.js +18 -4
- package/map/api/services/catalog/catalog.hooks.js +3 -0
- package/map/api/services/features/features.hooks.js +3 -1
- package/map/api/services/index.js +2 -6
- package/map/api/services/styles/styles.hooks.js +6 -1
- package/map/client/components/KFeatureActionButton.vue +9 -3
- package/map/client/components/KFeaturesFilterManager.vue +5 -5
- package/map/client/components/KFilterCondition.vue +17 -10
- package/map/client/components/KLayerEditor.vue +49 -39
- package/map/client/components/KMeasureTool.vue +7 -1
- package/map/client/components/KTimezoneMap.vue +29 -9
- package/map/client/components/catalog/KLayersPanel.vue +26 -16
- package/map/client/components/catalog/KLayersSelector.vue +13 -2
- package/map/client/components/catalog/KViewsPanel.vue +5 -4
- package/map/client/components/form/KSelectLayersField.vue +28 -17
- package/map/client/components/form/KSelectViewsField.vue +18 -9
- package/map/client/components/form/KTimezoneField.vue +1 -2
- package/map/client/components/legend/KVariablesLegend.vue +10 -1
- package/map/client/components/location/KLocationCardSection.vue +7 -2
- package/map/client/components/location/KLocationMap.vue +31 -7
- package/map/client/components/selection/KSelectedLayerFeatures.vue +2 -2
- package/map/client/components/stickies/KZoomControl.vue +1 -1
- package/map/client/components/styles/KStyleManager.vue +4 -1
- package/map/client/components/widget/KTimeSeries.vue +174 -497
- package/map/client/components/widget/KTimeSeriesSelector.vue +72 -0
- package/map/client/components/widget/KTimeSeriesToolbar.vue +83 -0
- package/map/client/composables/catalog.js +6 -10
- package/map/client/composables/highlight.js +12 -9
- package/map/client/composables/project.js +1 -1
- package/map/client/composables/selection.js +8 -7
- package/map/client/composables/weather.js +9 -2
- package/map/client/geolocation.js +8 -5
- package/map/client/i18n/map_en.json +11 -10
- package/map/client/i18n/map_fr.json +10 -9
- package/map/client/leaflet/TiledFeatureLayer.js +85 -82
- package/map/client/leaflet/utils/utils.geojson.js +3 -3
- package/map/client/mixins/globe/mixin.base-globe.js +15 -6
- package/map/client/mixins/globe/mixin.geojson-layers.js +27 -18
- package/map/client/mixins/map/mixin.edit-layers.js +9 -1
- package/map/client/mixins/map/mixin.pmtiles-layers.js +118 -29
- package/map/client/mixins/map/mixin.tiled-mesh-layers.js +12 -5
- package/map/client/mixins/map/mixin.tiled-wind-layers.js +19 -10
- package/map/client/mixins/mixin.activity.js +23 -30
- package/map/client/mixins/mixin.feature-selection.js +41 -5
- package/map/client/planets.js +1 -1
- package/map/client/readers/reader.kml.js +2 -3
- package/map/client/utils/utils.catalog.js +36 -10
- package/map/client/utils/utils.layers.js +39 -8
- package/map/client/utils/utils.project.js +4 -0
- package/map/client/utils/utils.style.js +37 -7
- package/map/client/utils/utils.time-series.js +215 -6
- package/map/common/schemas/catalog.update.json +1 -1
- package/map/common/weacast-grid-source.js +1 -1
- package/package.json +3 -3
- package/scripts/kash/CHANGELOG.md +0 -4
- package/scripts/kash/README.md +0 -9
- package/scripts/kash/kash.sh +45 -40
- package/scripts/kash/scripts/run_tests.sh +1 -4
- package/test/api/core/authentication.test.js +9 -4
- package/test/api/core/config/default.cjs +1 -0
- package/test/api/core/hooks.test.js +6 -0
- package/test/api/core/index.test.js +43 -18
- package/test/api/core/push.test.js +8 -8
- package/test/api/core/test-log-2026-03-10.log +60 -0
- package/test/api/core/users.test.js +384 -0
- package/test/api/map/grid-sources.test.js +1 -1
- package/test/api/map/test-log-2026-03-10.log +56 -0
- package/vite/package.json +11 -2
- package/vite/test/core/composables.test.js +77 -0
- package/vite/vitest.config.js +13 -0
- package/vite/yarn.lock +1096 -18
- package/.vscode/settings.json +0 -5
- package/core/client/components/account/KAccount.vue +0 -68
- package/core/client/components/account/KDeleteAccountManager.vue +0 -62
- package/core/client/components/account/KEmailManager.vue +0 -128
- package/core/client/components/account/KPasswordManager.vue +0 -90
- package/core/client/components/account/KVerifyEmailManager.vue +0 -105
- package/core/client/components/collection/KColumn.vue +0 -227
- package/core/client/components/collection/KHistory.vue +0 -113
- package/core/client/components/collection/KHistoryEntry.vue +0 -109
- package/coverage/core/api/hooks/hooks.organisations.js.html +0 -541
- package/coverage/core/api/services/organisations/organisations.service.js.html +0 -343
- package/coverage/core/api/utils.js.html +0 -118
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +0 -541
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +0 -343
- package/coverage/lcov-report/core/api/utils.js.html +0 -118
- package/coverage/tmp/coverage-151166-1723543324307-0.json +0 -1
- package/coverage/tmp/coverage-151178-1723543324283-0.json +0 -1
- package/coverage/tmp/coverage-151189-1723543324271-0.json +0 -1
- package/coverage/tmp/coverage-151201-1723543324248-0.json +0 -1
- package/coverage/tmp/coverage-151208-1723543324227-0.json +0 -1
- package/scripts/kash/LICENSE +0 -21
- package/test/api/core/test-log-2024-04-22.log +0 -84
- package/test/api/core/test-log-2024-04-23.log +0 -23
- package/test/api/core/test-log-2024-08-13.log +0 -3
- 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 {
|
|
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: `${
|
|
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: `${
|
|
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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalisio/kdk",
|
|
3
3
|
"description": "Kalisio Development Kit",
|
|
4
|
-
"version": "2.
|
|
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.
|
|
98
|
-
"@kalisio/feathers-s3": "^1.
|
|
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
|
|
package/scripts/kash/README.md
CHANGED
|
@@ -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
|
-
[](https://kalisio.com)
|
package/scripts/kash/kash.sh
CHANGED
|
@@ -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.
|
|
132
|
+
KUBECTL_VERSION=1.28.13
|
|
133
133
|
# https://github.com/helm/helm/releases
|
|
134
|
-
HELM_VERSION=3.
|
|
134
|
+
HELM_VERSION=3.14.4
|
|
135
135
|
# https://github.com/helmfile/helmfile/releases
|
|
136
|
-
HELMFILE_VERSION=
|
|
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 --
|
|
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-
|
|
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.
|
|
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
|
|
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
|
-
|
|
1325
|
+
pushd "$REPO_DIR/api"
|
|
1321
1326
|
|
|
1322
1327
|
use_node "$NODE_VER"
|
|
1323
1328
|
yarn test
|
|
1324
1329
|
|
|
1325
|
-
##
|
|
1330
|
+
## Publish code coverage
|
|
1326
1331
|
##
|
|
1327
1332
|
|
|
1328
|
-
if [ "$
|
|
1329
|
-
|
|
1333
|
+
if [ "$CODE_COVERAGE" = true ]; then
|
|
1334
|
+
send_coverage_to_cc "$CC_TEST_REPORTER_ID" "api"
|
|
1330
1335
|
fi
|
|
1331
1336
|
|
|
1332
|
-
|
|
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.
|
|
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
|
|
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
|
-
##
|
|
1440
|
+
## Publish code coverage
|
|
1436
1441
|
##
|
|
1437
1442
|
|
|
1438
|
-
if [ "$
|
|
1439
|
-
|
|
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
|
-
|
|
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()
|
|
@@ -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) => {
|