@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
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/468</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/468</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -471,7 +471,127 @@
|
|
|
471
471
|
<a name='L406'></a><a href='#L406'>406</a>
|
|
472
472
|
<a name='L407'></a><a href='#L407'>407</a>
|
|
473
473
|
<a name='L408'></a><a href='#L408'>408</a>
|
|
474
|
-
<a name='L409'></a><a href='#L409'>409</a
|
|
474
|
+
<a name='L409'></a><a href='#L409'>409</a>
|
|
475
|
+
<a name='L410'></a><a href='#L410'>410</a>
|
|
476
|
+
<a name='L411'></a><a href='#L411'>411</a>
|
|
477
|
+
<a name='L412'></a><a href='#L412'>412</a>
|
|
478
|
+
<a name='L413'></a><a href='#L413'>413</a>
|
|
479
|
+
<a name='L414'></a><a href='#L414'>414</a>
|
|
480
|
+
<a name='L415'></a><a href='#L415'>415</a>
|
|
481
|
+
<a name='L416'></a><a href='#L416'>416</a>
|
|
482
|
+
<a name='L417'></a><a href='#L417'>417</a>
|
|
483
|
+
<a name='L418'></a><a href='#L418'>418</a>
|
|
484
|
+
<a name='L419'></a><a href='#L419'>419</a>
|
|
485
|
+
<a name='L420'></a><a href='#L420'>420</a>
|
|
486
|
+
<a name='L421'></a><a href='#L421'>421</a>
|
|
487
|
+
<a name='L422'></a><a href='#L422'>422</a>
|
|
488
|
+
<a name='L423'></a><a href='#L423'>423</a>
|
|
489
|
+
<a name='L424'></a><a href='#L424'>424</a>
|
|
490
|
+
<a name='L425'></a><a href='#L425'>425</a>
|
|
491
|
+
<a name='L426'></a><a href='#L426'>426</a>
|
|
492
|
+
<a name='L427'></a><a href='#L427'>427</a>
|
|
493
|
+
<a name='L428'></a><a href='#L428'>428</a>
|
|
494
|
+
<a name='L429'></a><a href='#L429'>429</a>
|
|
495
|
+
<a name='L430'></a><a href='#L430'>430</a>
|
|
496
|
+
<a name='L431'></a><a href='#L431'>431</a>
|
|
497
|
+
<a name='L432'></a><a href='#L432'>432</a>
|
|
498
|
+
<a name='L433'></a><a href='#L433'>433</a>
|
|
499
|
+
<a name='L434'></a><a href='#L434'>434</a>
|
|
500
|
+
<a name='L435'></a><a href='#L435'>435</a>
|
|
501
|
+
<a name='L436'></a><a href='#L436'>436</a>
|
|
502
|
+
<a name='L437'></a><a href='#L437'>437</a>
|
|
503
|
+
<a name='L438'></a><a href='#L438'>438</a>
|
|
504
|
+
<a name='L439'></a><a href='#L439'>439</a>
|
|
505
|
+
<a name='L440'></a><a href='#L440'>440</a>
|
|
506
|
+
<a name='L441'></a><a href='#L441'>441</a>
|
|
507
|
+
<a name='L442'></a><a href='#L442'>442</a>
|
|
508
|
+
<a name='L443'></a><a href='#L443'>443</a>
|
|
509
|
+
<a name='L444'></a><a href='#L444'>444</a>
|
|
510
|
+
<a name='L445'></a><a href='#L445'>445</a>
|
|
511
|
+
<a name='L446'></a><a href='#L446'>446</a>
|
|
512
|
+
<a name='L447'></a><a href='#L447'>447</a>
|
|
513
|
+
<a name='L448'></a><a href='#L448'>448</a>
|
|
514
|
+
<a name='L449'></a><a href='#L449'>449</a>
|
|
515
|
+
<a name='L450'></a><a href='#L450'>450</a>
|
|
516
|
+
<a name='L451'></a><a href='#L451'>451</a>
|
|
517
|
+
<a name='L452'></a><a href='#L452'>452</a>
|
|
518
|
+
<a name='L453'></a><a href='#L453'>453</a>
|
|
519
|
+
<a name='L454'></a><a href='#L454'>454</a>
|
|
520
|
+
<a name='L455'></a><a href='#L455'>455</a>
|
|
521
|
+
<a name='L456'></a><a href='#L456'>456</a>
|
|
522
|
+
<a name='L457'></a><a href='#L457'>457</a>
|
|
523
|
+
<a name='L458'></a><a href='#L458'>458</a>
|
|
524
|
+
<a name='L459'></a><a href='#L459'>459</a>
|
|
525
|
+
<a name='L460'></a><a href='#L460'>460</a>
|
|
526
|
+
<a name='L461'></a><a href='#L461'>461</a>
|
|
527
|
+
<a name='L462'></a><a href='#L462'>462</a>
|
|
528
|
+
<a name='L463'></a><a href='#L463'>463</a>
|
|
529
|
+
<a name='L464'></a><a href='#L464'>464</a>
|
|
530
|
+
<a name='L465'></a><a href='#L465'>465</a>
|
|
531
|
+
<a name='L466'></a><a href='#L466'>466</a>
|
|
532
|
+
<a name='L467'></a><a href='#L467'>467</a>
|
|
533
|
+
<a name='L468'></a><a href='#L468'>468</a>
|
|
534
|
+
<a name='L469'></a><a href='#L469'>469</a></td><td class="line-coverage quiet"><span class="cline-any cline-no"> </span>
|
|
535
|
+
<span class="cline-any cline-no"> </span>
|
|
536
|
+
<span class="cline-any cline-no"> </span>
|
|
537
|
+
<span class="cline-any cline-no"> </span>
|
|
538
|
+
<span class="cline-any cline-no"> </span>
|
|
539
|
+
<span class="cline-any cline-no"> </span>
|
|
540
|
+
<span class="cline-any cline-no"> </span>
|
|
541
|
+
<span class="cline-any cline-no"> </span>
|
|
542
|
+
<span class="cline-any cline-no"> </span>
|
|
543
|
+
<span class="cline-any cline-no"> </span>
|
|
544
|
+
<span class="cline-any cline-no"> </span>
|
|
545
|
+
<span class="cline-any cline-no"> </span>
|
|
546
|
+
<span class="cline-any cline-no"> </span>
|
|
547
|
+
<span class="cline-any cline-no"> </span>
|
|
548
|
+
<span class="cline-any cline-no"> </span>
|
|
549
|
+
<span class="cline-any cline-no"> </span>
|
|
550
|
+
<span class="cline-any cline-no"> </span>
|
|
551
|
+
<span class="cline-any cline-no"> </span>
|
|
552
|
+
<span class="cline-any cline-no"> </span>
|
|
553
|
+
<span class="cline-any cline-no"> </span>
|
|
554
|
+
<span class="cline-any cline-no"> </span>
|
|
555
|
+
<span class="cline-any cline-no"> </span>
|
|
556
|
+
<span class="cline-any cline-no"> </span>
|
|
557
|
+
<span class="cline-any cline-no"> </span>
|
|
558
|
+
<span class="cline-any cline-no"> </span>
|
|
559
|
+
<span class="cline-any cline-no"> </span>
|
|
560
|
+
<span class="cline-any cline-no"> </span>
|
|
561
|
+
<span class="cline-any cline-no"> </span>
|
|
562
|
+
<span class="cline-any cline-no"> </span>
|
|
563
|
+
<span class="cline-any cline-no"> </span>
|
|
564
|
+
<span class="cline-any cline-no"> </span>
|
|
565
|
+
<span class="cline-any cline-no"> </span>
|
|
566
|
+
<span class="cline-any cline-no"> </span>
|
|
567
|
+
<span class="cline-any cline-no"> </span>
|
|
568
|
+
<span class="cline-any cline-no"> </span>
|
|
569
|
+
<span class="cline-any cline-no"> </span>
|
|
570
|
+
<span class="cline-any cline-no"> </span>
|
|
571
|
+
<span class="cline-any cline-no"> </span>
|
|
572
|
+
<span class="cline-any cline-no"> </span>
|
|
573
|
+
<span class="cline-any cline-no"> </span>
|
|
574
|
+
<span class="cline-any cline-no"> </span>
|
|
575
|
+
<span class="cline-any cline-no"> </span>
|
|
576
|
+
<span class="cline-any cline-no"> </span>
|
|
577
|
+
<span class="cline-any cline-no"> </span>
|
|
578
|
+
<span class="cline-any cline-no"> </span>
|
|
579
|
+
<span class="cline-any cline-no"> </span>
|
|
580
|
+
<span class="cline-any cline-no"> </span>
|
|
581
|
+
<span class="cline-any cline-no"> </span>
|
|
582
|
+
<span class="cline-any cline-no"> </span>
|
|
583
|
+
<span class="cline-any cline-no"> </span>
|
|
584
|
+
<span class="cline-any cline-no"> </span>
|
|
585
|
+
<span class="cline-any cline-no"> </span>
|
|
586
|
+
<span class="cline-any cline-no"> </span>
|
|
587
|
+
<span class="cline-any cline-no"> </span>
|
|
588
|
+
<span class="cline-any cline-no"> </span>
|
|
589
|
+
<span class="cline-any cline-no"> </span>
|
|
590
|
+
<span class="cline-any cline-no"> </span>
|
|
591
|
+
<span class="cline-any cline-no"> </span>
|
|
592
|
+
<span class="cline-any cline-no"> </span>
|
|
593
|
+
<span class="cline-any cline-no"> </span>
|
|
594
|
+
<span class="cline-any cline-no"> </span>
|
|
475
595
|
<span class="cline-any cline-no"> </span>
|
|
476
596
|
<span class="cline-any cline-no"> </span>
|
|
477
597
|
<span class="cline-any cline-no"> </span>
|
|
@@ -880,10 +1000,12 @@
|
|
|
880
1000
|
<span class="cline-any cline-no"> </span>
|
|
881
1001
|
<span class="cline-any cline-no"> </span>
|
|
882
1002
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js"><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ><span class="branch-0 cbranch-no" title="branch not covered" >import _ from 'lodash'</span></span></span>
|
|
1003
|
+
<span class="cstat-no" title="statement not covered" >import errors from '@feathersjs/errors'</span>
|
|
883
1004
|
<span class="cstat-no" title="statement not covered" >import { marshallGeometry } from '../marshall.js'</span>
|
|
884
1005
|
<span class="cstat-no" title="statement not covered" >import makeDebug from 'debug'</span>
|
|
885
1006
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
886
1007
|
<span class="cstat-no" title="statement not covered" >const debug = makeDebug('kdk:map:query:hooks')</span>
|
|
1008
|
+
<span class="cstat-no" title="statement not covered" >const { Forbidden } = errors</span>
|
|
887
1009
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
888
1010
|
<span class="cstat-no" title="statement not covered" >export function marshallGeometryQuery (hook) {</span>
|
|
889
1011
|
<span class="cstat-no" title="statement not covered" > const query = hook.params.query</span>
|
|
@@ -1018,7 +1140,7 @@
|
|
|
1018
1140
|
<span class="cstat-no" title="statement not covered" > const params = hook.params</span>
|
|
1019
1141
|
<span class="cstat-no" title="statement not covered" > const query = params.query</span>
|
|
1020
1142
|
<span class="cstat-no" title="statement not covered" > if (!options.force && !params.asGeoJson) return</span>
|
|
1021
|
-
<span class="cstat-no" title="statement not covered" > if (query
|
|
1143
|
+
<span class="cstat-no" title="statement not covered" > if (_.has(query, '$distinct') || _.has(query, '$aggregation')) return // Not applicable in this case</span>
|
|
1022
1144
|
<span class="cstat-no" title="statement not covered" > const longitudeProperty = (options.longitudeProperty || 'longitude')</span>
|
|
1023
1145
|
<span class="cstat-no" title="statement not covered" > const latitudeProperty = (options.latitudeProperty || 'latitude')</span>
|
|
1024
1146
|
<span class="cstat-no" title="statement not covered" > const altitudeProperty = (options.altitudeProperty || 'altitude')</span>
|
|
@@ -1119,6 +1241,62 @@
|
|
|
1119
1241
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1120
1242
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
1121
1243
|
<span class="cstat-no" title="statement not covered" ></span>
|
|
1244
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1245
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1246
|
+
<span class="cstat-no" title="statement not covered" >// Verifies that only authorized accumulation operators are used</span>
|
|
1247
|
+
<span class="cstat-no" title="statement not covered" >function validateGroupExpression(expression) {</span>
|
|
1248
|
+
<span class="cstat-no" title="statement not covered" > // Safe accumulation operators for $group</span>
|
|
1249
|
+
<span class="cstat-no" title="statement not covered" > const SAFE_GROUP_ACCUMULATORS = new Set([</span>
|
|
1250
|
+
<span class="cstat-no" title="statement not covered" > '$sum', '$avg', '$first', '$last', '$max', '$min'</span>
|
|
1251
|
+
<span class="cstat-no" title="statement not covered" > ])</span>
|
|
1252
|
+
<span class="cstat-no" title="statement not covered" > // Safe expression operators usable in $group</span>
|
|
1253
|
+
<span class="cstat-no" title="statement not covered" > const SAFE_GROUP_EXPRESSIONS = new Set([</span>
|
|
1254
|
+
<span class="cstat-no" title="statement not covered" > // Arithmetic operators</span>
|
|
1255
|
+
<span class="cstat-no" title="statement not covered" > '$add', '$subtract', '$multiply', '$divide', '$mod',</span>
|
|
1256
|
+
<span class="cstat-no" title="statement not covered" > '$abs', '$ceil', '$floor', '$round', '$trunc',</span>
|
|
1257
|
+
<span class="cstat-no" title="statement not covered" > '$sqrt', '$pow', '$exp', '$ln', '$log', '$log10',</span>
|
|
1258
|
+
<span class="cstat-no" title="statement not covered" > // Comparison operators</span>
|
|
1259
|
+
<span class="cstat-no" title="statement not covered" > '$eq', '$ne', '$gt', '$gte', '$lt', '$lte', '$cmp',</span>
|
|
1260
|
+
<span class="cstat-no" title="statement not covered" > // Logical operators</span>
|
|
1261
|
+
<span class="cstat-no" title="statement not covered" > '$and', '$or', '$not',</span>
|
|
1262
|
+
<span class="cstat-no" title="statement not covered" > // Date operators</span>
|
|
1263
|
+
<span class="cstat-no" title="statement not covered" > '$dateToString', '$year', '$month', '$dayOfMonth', '$hour',</span>
|
|
1264
|
+
<span class="cstat-no" title="statement not covered" > '$minute', '$second', '$dayOfWeek', '$dayOfYear', '$week',</span>
|
|
1265
|
+
<span class="cstat-no" title="statement not covered" > // Conditional operators</span>
|
|
1266
|
+
<span class="cstat-no" title="statement not covered" > '$cond', '$ifNull', '$switch',</span>
|
|
1267
|
+
<span class="cstat-no" title="statement not covered" > // Type operators</span>
|
|
1268
|
+
<span class="cstat-no" title="statement not covered" > '$toString', '$toInt', '$toDouble'</span>
|
|
1269
|
+
<span class="cstat-no" title="statement not covered" > ])</span>
|
|
1270
|
+
<span class="cstat-no" title="statement not covered" > // Dangerous operators to reject in $group (arbitrary code execution)</span>
|
|
1271
|
+
<span class="cstat-no" title="statement not covered" > const DANGEROUS_GROUP_OPERATORS = new Set([</span>
|
|
1272
|
+
<span class="cstat-no" title="statement not covered" > '$accumulator', // Custom JavaScript execution</span>
|
|
1273
|
+
<span class="cstat-no" title="statement not covered" > '$function', // JavaScript function execution</span>
|
|
1274
|
+
<span class="cstat-no" title="statement not covered" > '$where' // JavaScript code execution</span>
|
|
1275
|
+
<span class="cstat-no" title="statement not covered" > ])</span>
|
|
1276
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1277
|
+
<span class="cstat-no" title="statement not covered" > if (_.isNil(expression)) {</span>
|
|
1278
|
+
<span class="cstat-no" title="statement not covered" > return</span>
|
|
1279
|
+
<span class="cstat-no" title="statement not covered" > } else if (Array.isArray(expression)) {</span>
|
|
1280
|
+
<span class="cstat-no" title="statement not covered" > expression.forEach(validateGroupExpression)</span>
|
|
1281
|
+
<span class="cstat-no" title="statement not covered" > return</span>
|
|
1282
|
+
<span class="cstat-no" title="statement not covered" > } else if (typeof expression === 'object') {</span>
|
|
1283
|
+
<span class="cstat-no" title="statement not covered" > for (const [key, value] of Object.entries(expression)) {</span>
|
|
1284
|
+
<span class="cstat-no" title="statement not covered" > // Check if it's an operator</span>
|
|
1285
|
+
<span class="cstat-no" title="statement not covered" > if (key.startsWith('$')) {</span>
|
|
1286
|
+
<span class="cstat-no" title="statement not covered" > if (DANGEROUS_GROUP_OPERATORS.has(key)) throw new Forbidden(`You are not allowed to use ${key} operator`)</span>
|
|
1287
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1288
|
+
<span class="cstat-no" title="statement not covered" > // Check if operator is in the allowed list</span>
|
|
1289
|
+
<span class="cstat-no" title="statement not covered" > const isAccumulator = SAFE_GROUP_ACCUMULATORS.has(key)</span>
|
|
1290
|
+
<span class="cstat-no" title="statement not covered" > const isExpression = SAFE_GROUP_EXPRESSIONS.has(key)</span>
|
|
1291
|
+
<span class="cstat-no" title="statement not covered" > if (!isAccumulator && !isExpression) throw new Forbidden(`You are not allowed to use ${key} operator`)</span>
|
|
1292
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1293
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1294
|
+
<span class="cstat-no" title="statement not covered" > // Recursively validate the value</span>
|
|
1295
|
+
<span class="cstat-no" title="statement not covered" > validateGroupExpression(value)</span>
|
|
1296
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1297
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1298
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
1299
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
1122
1300
|
<span class="cstat-no" title="statement not covered" >export async function aggregateFeaturesQuery (hook) {</span>
|
|
1123
1301
|
<span class="cstat-no" title="statement not covered" > const query = hook.params.query</span>
|
|
1124
1302
|
<span class="cstat-no" title="statement not covered" > const service = hook.service</span>
|
|
@@ -1130,19 +1308,24 @@
|
|
|
1130
1308
|
<span class="cstat-no" title="statement not covered" > let featureId = (service.options ? service.options.featureId : [])</span>
|
|
1131
1309
|
<span class="cstat-no" title="statement not covered" > // Support compound ID</span>
|
|
1132
1310
|
<span class="cstat-no" title="statement not covered" > featureId = (Array.isArray(featureId) ? featureId : [featureId])</span>
|
|
1311
|
+
<span class="cstat-no" title="statement not covered" > const hasFeatureId = !_.isEmpty(featureId)</span>
|
|
1133
1312
|
<span class="cstat-no" title="statement not covered" > let featureIdType = (service.options ? service.options.featureIdType : [])</span>
|
|
1134
1313
|
<span class="cstat-no" title="statement not covered" > featureIdType = (Array.isArray(featureIdType) ? featureIdType : [featureIdType])</span>
|
|
1135
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1136
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1137
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1138
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1139
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1140
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1314
|
+
<span class="cstat-no" title="statement not covered" > // Default is not to group by UUID</span>
|
|
1315
|
+
<span class="cstat-no" title="statement not covered" > const groupBy = { _id: '$_id' }</span>
|
|
1316
|
+
<span class="cstat-no" title="statement not covered" > let keys = ['_id']</span>
|
|
1317
|
+
<span class="cstat-no" title="statement not covered" > if (query.$groupBy) {</span>
|
|
1318
|
+
<span class="cstat-no" title="statement not covered" > groupBy._id = typeof query.$groupBy === 'string' // Group by matching ID(s), ie single ID or array of field to create a compound ID</span>
|
|
1319
|
+
<span class="cstat-no" title="statement not covered" > ? { [query.$groupBy]: '$properties.' + query.$groupBy }</span>
|
|
1320
|
+
<span class="cstat-no" title="statement not covered" > // Aggregated in an accumulator to avoid conflict with feature properties</span>
|
|
1321
|
+
<span class="cstat-no" title="statement not covered" > : query.$groupBy.reduce((object, id) => Object.assign(object, { [id]: '$properties.' + id }), {})</span>
|
|
1322
|
+
<span class="cstat-no" title="statement not covered" > keys = _.keys(groupBy._id)</span>
|
|
1323
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1141
1324
|
<span class="cstat-no" title="statement not covered" > // Do we only keep first or last available time ?</span>
|
|
1142
1325
|
<span class="cstat-no" title="statement not covered" > const singleTime = (_.toNumber(query.$limit) === 1)</span>
|
|
1143
1326
|
<span class="cstat-no" title="statement not covered" > if (singleTime) {</span>
|
|
1144
1327
|
<span class="cstat-no" title="statement not covered" > // When single time no aggregation is performed at all so we only have raw features</span>
|
|
1145
|
-
<span class="cstat-no" title="statement not covered" > keys = keys.map(key => 'properties.' + key)</span>
|
|
1328
|
+
<span class="cstat-no" title="statement not covered" > if (hasFeatureId) keys = keys.map(key => 'properties.' + key)</span>
|
|
1146
1329
|
<span class="cstat-no" title="statement not covered" > // In this case no need to aggregate on each element we simply keep the first feature</span>
|
|
1147
1330
|
<span class="cstat-no" title="statement not covered" > // BUG: according to https://jira.mongodb.org/browse/SERVER-9507 MongoDB is not yet</span>
|
|
1148
1331
|
<span class="cstat-no" title="statement not covered" > // able to optimize this kind of operations to avoid full index scan</span>
|
|
@@ -1170,6 +1353,8 @@
|
|
|
1170
1353
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1171
1354
|
<span class="cstat-no" title="statement not covered" > // Merge with any additional group expression</span>
|
|
1172
1355
|
<span class="cstat-no" title="statement not covered" > const group = _.get(query, '$group', {})</span>
|
|
1356
|
+
<span class="cstat-no" title="statement not covered" > // Check for possible injection</span>
|
|
1357
|
+
<span class="cstat-no" title="statement not covered" > validateGroupExpression(group)</span>
|
|
1173
1358
|
<span class="cstat-no" title="statement not covered" > Object.assign(groupBy, group)</span>
|
|
1174
1359
|
<span class="cstat-no" title="statement not covered" > // The query contains the match stage except options relevent to the aggregation pipeline</span>
|
|
1175
1360
|
<span class="cstat-no" title="statement not covered" > const match = _.omit(query, ['$group', '$groupBy', '$aggregate', '$geoNear', '$sort', '$limit', '$skip'])</span>
|
|
@@ -1184,6 +1369,8 @@
|
|
|
1184
1369
|
<span class="cstat-no" title="statement not covered" > // Ensure we do not mix results with/without relevant element values</span>
|
|
1185
1370
|
<span class="cstat-no" title="statement not covered" > // by separately querying each element then merging</span>
|
|
1186
1371
|
<span class="cstat-no" title="statement not covered" > let aggregatedResults</span>
|
|
1372
|
+
<span class="cstat-no" title="statement not covered" > // Associative map used to optimize merging between aggregated elements</span>
|
|
1373
|
+
<span class="cstat-no" title="statement not covered" > const aggregatedResultsMap = new Map()</span>
|
|
1187
1374
|
<span class="cstat-no" title="statement not covered" > const aggregateOptions = {</span>
|
|
1188
1375
|
<span class="cstat-no" title="statement not covered" > allowDiskUse: true</span>
|
|
1189
1376
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
@@ -1219,29 +1406,10 @@
|
|
|
1219
1406
|
<span class="cstat-no" title="statement not covered" > pipeline.forEach(stage => {</span>
|
|
1220
1407
|
<span class="cstat-no" title="statement not covered" > _.forOwn(stage, (value, key) => debug('Stage', key, value))</span>
|
|
1221
1408
|
<span class="cstat-no" title="statement not covered" > })</span>
|
|
1222
|
-
<span class="cstat-no" title="statement not covered" > // Provide a hint to the aggregation targeting feature ID and aggregation elements.</span>
|
|
1223
|
-
<span class="cstat-no" title="statement not covered" > // The problem with the aggregation hint option is that it should correspond</span>
|
|
1224
|
-
<span class="cstat-no" title="statement not covered" > // exactly to an existing index otherwise it raises an error.</span>
|
|
1225
|
-
<span class="cstat-no" title="statement not covered" > // We use a convention to get the order right: geometry => feature ID => aggregated element => time.</span>
|
|
1226
|
-
<span class="cstat-no" title="statement not covered" > // We check anyway if the index does exist to avoid any error</span>
|
|
1227
|
-
<span class="cstat-no" title="statement not covered" > // FIXME: Instead of assuming the appropriate index is defined in the right order,</span>
|
|
1228
|
-
<span class="cstat-no" title="statement not covered" > // we might select the "best" available index (ie having the most similarities with the required one).</span>
|
|
1229
|
-
<span class="cstat-no" title="statement not covered" > const hint = {}</span>
|
|
1230
|
-
<span class="cstat-no" title="statement not covered" > if (isGeometry || query.$geoNear || match.geometry) Object.assign(hint, { geometry: '2dsphere' })</span>
|
|
1231
|
-
<span class="cstat-no" title="statement not covered" > featureId.forEach(id => {</span>
|
|
1232
|
-
<span class="cstat-no" title="statement not covered" > hint['properties.' + id] = 1</span>
|
|
1233
|
-
<span class="cstat-no" title="statement not covered" > })</span>
|
|
1234
|
-
<span class="cstat-no" title="statement not covered" > Object.assign(hint, { ['properties.' + element]: 1 })</span>
|
|
1235
|
-
<span class="cstat-no" title="statement not covered" > // Use provided sort time option if any</span>
|
|
1236
|
-
<span class="cstat-no" title="statement not covered" > hint.time = _.get(query, '$sort.time', 1)</span>
|
|
1237
|
-
<span class="cstat-no" title="statement not covered" > const hintIndexName = _.reduce(hint, (name, value, key) => name ? `${name}_${key}_${value}` : `${key}_${value}`, '')</span>
|
|
1238
|
-
<span class="cstat-no" title="statement not covered" > debug('Best aggregation hint index found', hintIndexName)</span>
|
|
1239
|
-
<span class="cstat-no" title="statement not covered" > const hintIndex = _.find(indexes, { name: hintIndexName })</span>
|
|
1240
1409
|
<span class="cstat-no" title="statement not covered" > const aggregateElementOptions = Object.assign({}, aggregateOptions)</span>
|
|
1241
|
-
<span class="cstat-no" title="statement not covered" > if (hintIndex) aggregateElementOptions.hint = hintIndexName</span>
|
|
1242
1410
|
<span class="cstat-no" title="statement not covered" > debug('Aggregation options', aggregateElementOptions)</span>
|
|
1243
1411
|
<span class="cstat-no" title="statement not covered" > const elementResults = await collection.aggregate(pipeline, aggregateElementOptions).toArray()</span>
|
|
1244
|
-
<span class="cstat-no" title="statement not covered" > debug(`Generated ${elementResults.length} feature(s) for ${element} element`, elementResults)</span>
|
|
1412
|
+
<span class="cstat-no" title="statement not covered" > debug(`Generated ${elementResults.length} feature(s) for ${element} element, picked first two`, elementResults.slice(0,2))</span>
|
|
1245
1413
|
<span class="cstat-no" title="statement not covered" > // Rearrange data so that we get ordered arrays indexed by element</span>
|
|
1246
1414
|
<span class="cstat-no" title="statement not covered" > elementResults.forEach(result => {</span>
|
|
1247
1415
|
<span class="cstat-no" title="statement not covered" > result.time = { [element]: result.time }</span>
|
|
@@ -1257,13 +1425,24 @@
|
|
|
1257
1425
|
<span class="cstat-no" title="statement not covered" > // Now merge with previous element results</span>
|
|
1258
1426
|
<span class="cstat-no" title="statement not covered" > if (!aggregatedResults) {</span>
|
|
1259
1427
|
<span class="cstat-no" title="statement not covered" > aggregatedResults = elementResults</span>
|
|
1428
|
+
<span class="cstat-no" title="statement not covered" > aggregatedResults.forEach(result => {</span>
|
|
1429
|
+
<span class="cstat-no" title="statement not covered" > // Keep track of result in map to improve search later</span>
|
|
1430
|
+
<span class="cstat-no" title="statement not covered" > const resultKeys = keys.map(key => _.get(singleTime ? result : result._id, key))</span>
|
|
1431
|
+
<span class="cstat-no" title="statement not covered" > const resultKey = resultKeys.join('-')</span>
|
|
1432
|
+
<span class="cstat-no" title="statement not covered" > aggregatedResultsMap.set(resultKey, result)</span>
|
|
1433
|
+
<span class="cstat-no" title="statement not covered" > })</span>
|
|
1260
1434
|
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
1261
1435
|
<span class="cstat-no" title="statement not covered" > elementResults.forEach(result => {</span>
|
|
1262
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1436
|
+
<span class="cstat-no" title="statement not covered" > // When single time no aggregation is performed at all so we only have raw features</span>
|
|
1437
|
+
<span class="cstat-no" title="statement not covered" > const resultKeys = keys.map(key => _.get(singleTime ? result : result._id, key))</span>
|
|
1438
|
+
<span class="cstat-no" title="statement not covered" > /* Optimize previous result search with map, kept the naive code here for reference/debug purpose</span>
|
|
1263
1439
|
<span class="cstat-no" title="statement not covered" > const previousResult = aggregatedResults.find(aggregatedResult => {</span>
|
|
1264
|
-
<span class="cstat-no" title="statement not covered" > const aggregatedResultKeys = _.
|
|
1440
|
+
<span class="cstat-no" title="statement not covered" > const aggregatedResultKeys = keys.map(key => _.get(singleTime ? result : result._id, key))</span>
|
|
1265
1441
|
<span class="cstat-no" title="statement not covered" > return _.isEqual(aggregatedResultKeys, resultKeys)</span>
|
|
1266
1442
|
<span class="cstat-no" title="statement not covered" > })</span>
|
|
1443
|
+
<span class="cstat-no" title="statement not covered" > */</span>
|
|
1444
|
+
<span class="cstat-no" title="statement not covered" > const resultKey = resultKeys.join('-')</span>
|
|
1445
|
+
<span class="cstat-no" title="statement not covered" > const previousResult = aggregatedResultsMap.get(resultKey)</span>
|
|
1267
1446
|
<span class="cstat-no" title="statement not covered" > // Merge with previous matching feature if any</span>
|
|
1268
1447
|
<span class="cstat-no" title="statement not covered" > if (previousResult) {</span>
|
|
1269
1448
|
<span class="cstat-no" title="statement not covered" > Object.assign(previousResult.time, result.time)</span>
|
|
@@ -1274,6 +1453,7 @@
|
|
|
1274
1453
|
<span class="cstat-no" title="statement not covered" > _.set(previousResult, prefix + element, _.get(result, prefix + element))</span>
|
|
1275
1454
|
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
1276
1455
|
<span class="cstat-no" title="statement not covered" > aggregatedResults.push(result)</span>
|
|
1456
|
+
<span class="cstat-no" title="statement not covered" > aggregatedResultsMap.set(resultKey, result)</span>
|
|
1277
1457
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1278
1458
|
<span class="cstat-no" title="statement not covered" > })</span>
|
|
1279
1459
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
@@ -1283,7 +1463,7 @@
|
|
|
1283
1463
|
<span class="cstat-no" title="statement not covered" > delete query.$aggregate</span>
|
|
1284
1464
|
<span class="cstat-no" title="statement not covered" > delete query.$geoNear</span>
|
|
1285
1465
|
<span class="cstat-no" title="statement not covered" > // Set result to avoid service DB call</span>
|
|
1286
|
-
<span class="cstat-no" title="statement not covered" > hook.result = aggregatedResults</span>
|
|
1466
|
+
<span class="cstat-no" title="statement not covered" > hook.result = aggregatedResults || []</span>
|
|
1287
1467
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1288
1468
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
1289
1469
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
@@ -1294,7 +1474,7 @@
|
|
|
1294
1474
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1295
1475
|
Code coverage generated by
|
|
1296
1476
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1297
|
-
at
|
|
1477
|
+
at 2026-03-10T09:15:24.743Z
|
|
1298
1478
|
</div>
|
|
1299
1479
|
<script src="../../../prettify.js"></script>
|
|
1300
1480
|
<script>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
26
|
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>0/
|
|
28
|
+
<span class='fraction'>0/746</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
47
|
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>0/
|
|
49
|
+
<span class='fraction'>0/746</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -84,13 +84,13 @@
|
|
|
84
84
|
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
|
|
85
85
|
</td>
|
|
86
86
|
<td data-value="0" class="pct low">0%</td>
|
|
87
|
-
<td data-value="
|
|
87
|
+
<td data-value="171" class="abs low">0/171</td>
|
|
88
88
|
<td data-value="0" class="pct low">0%</td>
|
|
89
89
|
<td data-value="1" class="abs low">0/1</td>
|
|
90
90
|
<td data-value="0" class="pct low">0%</td>
|
|
91
91
|
<td data-value="1" class="abs low">0/1</td>
|
|
92
92
|
<td data-value="0" class="pct low">0%</td>
|
|
93
|
-
<td data-value="
|
|
93
|
+
<td data-value="171" class="abs low">0/171</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
<tr>
|
|
@@ -114,13 +114,13 @@
|
|
|
114
114
|
<div class="chart"><div class="cover-fill" style="width: 0%"></div><div class="cover-empty" style="width: 100%"></div></div>
|
|
115
115
|
</td>
|
|
116
116
|
<td data-value="0" class="pct low">0%</td>
|
|
117
|
-
<td data-value="
|
|
117
|
+
<td data-value="468" class="abs low">0/468</td>
|
|
118
118
|
<td data-value="0" class="pct low">0%</td>
|
|
119
119
|
<td data-value="1" class="abs low">0/1</td>
|
|
120
120
|
<td data-value="0" class="pct low">0%</td>
|
|
121
121
|
<td data-value="1" class="abs low">0/1</td>
|
|
122
122
|
<td data-value="0" class="pct low">0%</td>
|
|
123
|
-
<td data-value="
|
|
123
|
+
<td data-value="468" class="abs low">0/468</td>
|
|
124
124
|
</tr>
|
|
125
125
|
|
|
126
126
|
<tr>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
147
147
|
Code coverage generated by
|
|
148
148
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
149
|
-
at
|
|
149
|
+
at 2026-03-10T09:15:24.743Z
|
|
150
150
|
</div>
|
|
151
151
|
<script src="../../../prettify.js"></script>
|
|
152
152
|
<script>
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
80
80
|
Code coverage generated by
|
|
81
81
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
82
|
-
at
|
|
82
|
+
at 2026-03-10T09:15:24.743Z
|
|
83
83
|
</div>
|
|
84
84
|
<script src="../../../prettify.js"></script>
|
|
85
85
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at
|
|
119
|
+
at 2026-03-10T09:15:24.743Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
125
125
|
Code coverage generated by
|
|
126
126
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
127
|
-
at
|
|
127
|
+
at 2026-03-10T09:15:24.743Z
|
|
128
128
|
</div>
|
|
129
129
|
<script src="../../prettify.js"></script>
|
|
130
130
|
<script>
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
164
164
|
Code coverage generated by
|
|
165
165
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
166
|
-
at
|
|
166
|
+
at 2026-03-10T09:15:24.743Z
|
|
167
167
|
</div>
|
|
168
168
|
<script src="../../prettify.js"></script>
|
|
169
169
|
<script>
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
92
92
|
Code coverage generated by
|
|
93
93
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
94
|
-
at
|
|
94
|
+
at 2026-03-10T09:15:24.743Z
|
|
95
95
|
</div>
|
|
96
96
|
<script src="../../../prettify.js"></script>
|
|
97
97
|
<script>
|