@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
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">91.03% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>132/145</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">70% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>21/30</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">85.71% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>6/7</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">91.03% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>132/145</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line high'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -208,10 +208,11 @@
|
|
|
208
208
|
<a name='L143'></a><a href='#L143'>143</a>
|
|
209
209
|
<a name='L144'></a><a href='#L144'>144</a>
|
|
210
210
|
<a name='L145'></a><a href='#L145'>145</a>
|
|
211
|
-
<a name='L146'></a><a href='#L146'>146</a>
|
|
212
|
-
<
|
|
213
|
-
<
|
|
214
|
-
<
|
|
211
|
+
<a name='L146'></a><a href='#L146'>146</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
212
|
+
<span class="cline-any cline-yes">1x</span>
|
|
213
|
+
<span class="cline-any cline-yes">1x</span>
|
|
214
|
+
<span class="cline-any cline-yes">1x</span>
|
|
215
|
+
<span class="cline-any cline-yes">1x</span>
|
|
215
216
|
<span class="cline-any cline-yes">1x</span>
|
|
216
217
|
<span class="cline-any cline-yes">1x</span>
|
|
217
218
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -226,92 +227,15 @@
|
|
|
226
227
|
<span class="cline-any cline-yes">1x</span>
|
|
227
228
|
<span class="cline-any cline-yes">1x</span>
|
|
228
229
|
<span class="cline-any cline-yes">1x</span>
|
|
229
|
-
<span class="cline-any cline-no"> </span>
|
|
230
|
-
<span class="cline-any cline-no"> </span>
|
|
231
|
-
<span class="cline-any cline-no"> </span>
|
|
232
|
-
<span class="cline-any cline-no"> </span>
|
|
233
|
-
<span class="cline-any cline-no"> </span>
|
|
234
|
-
<span class="cline-any cline-no"> </span>
|
|
235
|
-
<span class="cline-any cline-no"> </span>
|
|
236
|
-
<span class="cline-any cline-no"> </span>
|
|
237
|
-
<span class="cline-any cline-no"> </span>
|
|
238
|
-
<span class="cline-any cline-no"> </span>
|
|
239
|
-
<span class="cline-any cline-no"> </span>
|
|
240
|
-
<span class="cline-any cline-no"> </span>
|
|
241
|
-
<span class="cline-any cline-no"> </span>
|
|
242
|
-
<span class="cline-any cline-no"> </span>
|
|
243
|
-
<span class="cline-any cline-no"> </span>
|
|
244
|
-
<span class="cline-any cline-no"> </span>
|
|
245
|
-
<span class="cline-any cline-no"> </span>
|
|
246
|
-
<span class="cline-any cline-no"> </span>
|
|
247
|
-
<span class="cline-any cline-no"> </span>
|
|
248
|
-
<span class="cline-any cline-no"> </span>
|
|
249
|
-
<span class="cline-any cline-no"> </span>
|
|
250
|
-
<span class="cline-any cline-no"> </span>
|
|
251
|
-
<span class="cline-any cline-no"> </span>
|
|
252
|
-
<span class="cline-any cline-no"> </span>
|
|
253
|
-
<span class="cline-any cline-no"> </span>
|
|
254
|
-
<span class="cline-any cline-no"> </span>
|
|
255
|
-
<span class="cline-any cline-no"> </span>
|
|
256
|
-
<span class="cline-any cline-no"> </span>
|
|
257
|
-
<span class="cline-any cline-no"> </span>
|
|
258
|
-
<span class="cline-any cline-no"> </span>
|
|
259
|
-
<span class="cline-any cline-no"> </span>
|
|
260
|
-
<span class="cline-any cline-no"> </span>
|
|
261
|
-
<span class="cline-any cline-no"> </span>
|
|
262
|
-
<span class="cline-any cline-no"> </span>
|
|
263
|
-
<span class="cline-any cline-no"> </span>
|
|
264
|
-
<span class="cline-any cline-no"> </span>
|
|
265
|
-
<span class="cline-any cline-no"> </span>
|
|
266
230
|
<span class="cline-any cline-yes">1x</span>
|
|
267
231
|
<span class="cline-any cline-yes">1x</span>
|
|
268
232
|
<span class="cline-any cline-yes">1x</span>
|
|
269
233
|
<span class="cline-any cline-yes">1x</span>
|
|
270
234
|
<span class="cline-any cline-yes">1x</span>
|
|
271
235
|
<span class="cline-any cline-yes">1x</span>
|
|
272
|
-
<span class="cline-any cline-no"> </span>
|
|
273
|
-
<span class="cline-any cline-no"> </span>
|
|
274
|
-
<span class="cline-any cline-no"> </span>
|
|
275
|
-
<span class="cline-any cline-no"> </span>
|
|
276
|
-
<span class="cline-any cline-no"> </span>
|
|
277
|
-
<span class="cline-any cline-no"> </span>
|
|
278
|
-
<span class="cline-any cline-no"> </span>
|
|
279
|
-
<span class="cline-any cline-no"> </span>
|
|
280
|
-
<span class="cline-any cline-no"> </span>
|
|
281
|
-
<span class="cline-any cline-no"> </span>
|
|
282
|
-
<span class="cline-any cline-no"> </span>
|
|
283
|
-
<span class="cline-any cline-no"> </span>
|
|
284
|
-
<span class="cline-any cline-no"> </span>
|
|
285
|
-
<span class="cline-any cline-no"> </span>
|
|
286
|
-
<span class="cline-any cline-no"> </span>
|
|
287
|
-
<span class="cline-any cline-no"> </span>
|
|
288
|
-
<span class="cline-any cline-no"> </span>
|
|
289
|
-
<span class="cline-any cline-no"> </span>
|
|
290
|
-
<span class="cline-any cline-no"> </span>
|
|
291
|
-
<span class="cline-any cline-no"> </span>
|
|
292
|
-
<span class="cline-any cline-no"> </span>
|
|
293
|
-
<span class="cline-any cline-no"> </span>
|
|
294
|
-
<span class="cline-any cline-no"> </span>
|
|
295
|
-
<span class="cline-any cline-no"> </span>
|
|
296
|
-
<span class="cline-any cline-no"> </span>
|
|
297
|
-
<span class="cline-any cline-no"> </span>
|
|
298
|
-
<span class="cline-any cline-no"> </span>
|
|
299
|
-
<span class="cline-any cline-no"> </span>
|
|
300
|
-
<span class="cline-any cline-no"> </span>
|
|
301
|
-
<span class="cline-any cline-no"> </span>
|
|
302
236
|
<span class="cline-any cline-yes">1x</span>
|
|
303
237
|
<span class="cline-any cline-yes">1x</span>
|
|
304
238
|
<span class="cline-any cline-yes">1x</span>
|
|
305
|
-
<span class="cline-any cline-no"> </span>
|
|
306
|
-
<span class="cline-any cline-no"> </span>
|
|
307
|
-
<span class="cline-any cline-no"> </span>
|
|
308
|
-
<span class="cline-any cline-no"> </span>
|
|
309
|
-
<span class="cline-any cline-no"> </span>
|
|
310
|
-
<span class="cline-any cline-no"> </span>
|
|
311
|
-
<span class="cline-any cline-no"> </span>
|
|
312
|
-
<span class="cline-any cline-no"> </span>
|
|
313
|
-
<span class="cline-any cline-no"> </span>
|
|
314
|
-
<span class="cline-any cline-no"> </span>
|
|
315
239
|
<span class="cline-any cline-no"> </span>
|
|
316
240
|
<span class="cline-any cline-no"> </span>
|
|
317
241
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -319,25 +243,28 @@
|
|
|
319
243
|
<span class="cline-any cline-yes">1x</span>
|
|
320
244
|
<span class="cline-any cline-yes">1x</span>
|
|
321
245
|
<span class="cline-any cline-yes">1x</span>
|
|
322
|
-
<span class="cline-any cline-
|
|
323
|
-
<span class="cline-any cline-
|
|
324
|
-
<span class="cline-any cline-
|
|
325
|
-
<span class="cline-any cline-
|
|
326
|
-
<span class="cline-any cline-
|
|
327
|
-
<span class="cline-any cline-
|
|
328
|
-
<span class="cline-any cline-
|
|
329
|
-
<span class="cline-any cline-
|
|
330
|
-
<span class="cline-any cline-
|
|
331
|
-
<span class="cline-any cline-
|
|
332
|
-
<span class="cline-any cline-
|
|
333
|
-
<span class="cline-any cline-
|
|
334
|
-
<span class="cline-any cline-
|
|
335
|
-
<span class="cline-any cline-
|
|
336
|
-
<span class="cline-any cline-
|
|
337
|
-
<span class="cline-any cline-
|
|
338
|
-
<span class="cline-any cline-
|
|
339
|
-
<span class="cline-any cline-
|
|
340
|
-
<span class="cline-any cline-
|
|
246
|
+
<span class="cline-any cline-yes">1x</span>
|
|
247
|
+
<span class="cline-any cline-yes">1x</span>
|
|
248
|
+
<span class="cline-any cline-yes">1x</span>
|
|
249
|
+
<span class="cline-any cline-yes">1x</span>
|
|
250
|
+
<span class="cline-any cline-yes">1x</span>
|
|
251
|
+
<span class="cline-any cline-yes">1x</span>
|
|
252
|
+
<span class="cline-any cline-yes">1x</span>
|
|
253
|
+
<span class="cline-any cline-yes">1x</span>
|
|
254
|
+
<span class="cline-any cline-yes">1x</span>
|
|
255
|
+
<span class="cline-any cline-yes">1x</span>
|
|
256
|
+
<span class="cline-any cline-yes">1x</span>
|
|
257
|
+
<span class="cline-any cline-yes">1x</span>
|
|
258
|
+
<span class="cline-any cline-yes">1x</span>
|
|
259
|
+
<span class="cline-any cline-yes">1x</span>
|
|
260
|
+
<span class="cline-any cline-yes">1x</span>
|
|
261
|
+
<span class="cline-any cline-yes">1x</span>
|
|
262
|
+
<span class="cline-any cline-yes">1x</span>
|
|
263
|
+
<span class="cline-any cline-yes">1x</span>
|
|
264
|
+
<span class="cline-any cline-yes">1x</span>
|
|
265
|
+
<span class="cline-any cline-yes">1x</span>
|
|
266
|
+
<span class="cline-any cline-yes">1x</span>
|
|
267
|
+
<span class="cline-any cline-yes">1x</span>
|
|
341
268
|
<span class="cline-any cline-yes">1x</span>
|
|
342
269
|
<span class="cline-any cline-yes">1x</span>
|
|
343
270
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -345,17 +272,84 @@
|
|
|
345
272
|
<span class="cline-any cline-no"> </span>
|
|
346
273
|
<span class="cline-any cline-no"> </span>
|
|
347
274
|
<span class="cline-any cline-no"> </span>
|
|
275
|
+
<span class="cline-any cline-yes">1x</span>
|
|
276
|
+
<span class="cline-any cline-yes">1x</span>
|
|
277
|
+
<span class="cline-any cline-yes">1x</span>
|
|
278
|
+
<span class="cline-any cline-yes">1x</span>
|
|
279
|
+
<span class="cline-any cline-yes">1x</span>
|
|
280
|
+
<span class="cline-any cline-yes">1x</span>
|
|
281
|
+
<span class="cline-any cline-yes">1x</span>
|
|
282
|
+
<span class="cline-any cline-yes">1x</span>
|
|
283
|
+
<span class="cline-any cline-yes">1x</span>
|
|
284
|
+
<span class="cline-any cline-yes">1x</span>
|
|
285
|
+
<span class="cline-any cline-yes">1x</span>
|
|
286
|
+
<span class="cline-any cline-yes">1x</span>
|
|
287
|
+
<span class="cline-any cline-yes">1x</span>
|
|
288
|
+
<span class="cline-any cline-yes">1x</span>
|
|
289
|
+
<span class="cline-any cline-yes">1x</span>
|
|
290
|
+
<span class="cline-any cline-yes">1x</span>
|
|
348
291
|
<span class="cline-any cline-no"> </span>
|
|
292
|
+
<span class="cline-any cline-yes">1x</span>
|
|
293
|
+
<span class="cline-any cline-yes">1x</span>
|
|
294
|
+
<span class="cline-any cline-yes">1x</span>
|
|
295
|
+
<span class="cline-any cline-yes">1x</span>
|
|
296
|
+
<span class="cline-any cline-yes">8x</span>
|
|
297
|
+
<span class="cline-any cline-yes">8x</span>
|
|
298
|
+
<span class="cline-any cline-yes">8x</span>
|
|
299
|
+
<span class="cline-any cline-yes">8x</span>
|
|
300
|
+
<span class="cline-any cline-yes">8x</span>
|
|
301
|
+
<span class="cline-any cline-yes">8x</span>
|
|
302
|
+
<span class="cline-any cline-yes">8x</span>
|
|
303
|
+
<span class="cline-any cline-yes">8x</span>
|
|
304
|
+
<span class="cline-any cline-yes">8x</span>
|
|
305
|
+
<span class="cline-any cline-yes">8x</span>
|
|
306
|
+
<span class="cline-any cline-yes">8x</span>
|
|
349
307
|
<span class="cline-any cline-no"> </span>
|
|
350
308
|
<span class="cline-any cline-no"> </span>
|
|
351
|
-
<span class="cline-any cline-no"> </span>
|
|
352
|
-
<span class="cline-any cline-no"> </span>
|
|
353
|
-
<span class="cline-any cline-no"> </span>
|
|
354
|
-
<span class="cline-any cline-no"> </span>
|
|
355
309
|
<span class="cline-any cline-yes">1x</span>
|
|
356
310
|
<span class="cline-any cline-yes">1x</span>
|
|
357
311
|
<span class="cline-any cline-yes">1x</span>
|
|
312
|
+
<span class="cline-any cline-yes">48x</span>
|
|
313
|
+
<span class="cline-any cline-yes">48x</span>
|
|
314
|
+
<span class="cline-any cline-yes">48x</span>
|
|
315
|
+
<span class="cline-any cline-yes">48x</span>
|
|
316
|
+
<span class="cline-any cline-yes">48x</span>
|
|
317
|
+
<span class="cline-any cline-yes">48x</span>
|
|
318
|
+
<span class="cline-any cline-yes">1x</span>
|
|
319
|
+
<span class="cline-any cline-yes">1x</span>
|
|
320
|
+
<span class="cline-any cline-yes">1x</span>
|
|
321
|
+
<span class="cline-any cline-yes">1x</span>
|
|
322
|
+
<span class="cline-any cline-yes">1x</span>
|
|
323
|
+
<span class="cline-any cline-yes">26x</span>
|
|
324
|
+
<span class="cline-any cline-yes">26x</span>
|
|
325
|
+
<span class="cline-any cline-yes">23x</span>
|
|
326
|
+
<span class="cline-any cline-yes">23x</span>
|
|
327
|
+
<span class="cline-any cline-yes">23x</span>
|
|
328
|
+
<span class="cline-any cline-yes">23x</span>
|
|
329
|
+
<span class="cline-any cline-yes">23x</span>
|
|
330
|
+
<span class="cline-any cline-yes">23x</span>
|
|
331
|
+
<span class="cline-any cline-yes">23x</span>
|
|
332
|
+
<span class="cline-any cline-yes">23x</span>
|
|
333
|
+
<span class="cline-any cline-yes">23x</span>
|
|
334
|
+
<span class="cline-any cline-yes">23x</span>
|
|
358
335
|
<span class="cline-any cline-yes">1x</span>
|
|
336
|
+
<span class="cline-any cline-yes">1x</span>
|
|
337
|
+
<span class="cline-any cline-yes">1x</span>
|
|
338
|
+
<span class="cline-any cline-yes">1x</span>
|
|
339
|
+
<span class="cline-any cline-yes">22x</span>
|
|
340
|
+
<span class="cline-any cline-yes">22x</span>
|
|
341
|
+
<span class="cline-any cline-yes">22x</span>
|
|
342
|
+
<span class="cline-any cline-yes">22x</span>
|
|
343
|
+
<span class="cline-any cline-yes">22x</span>
|
|
344
|
+
<span class="cline-any cline-yes">22x</span>
|
|
345
|
+
<span class="cline-any cline-yes">22x</span>
|
|
346
|
+
<span class="cline-any cline-yes">1x</span>
|
|
347
|
+
<span class="cline-any cline-yes">1x</span>
|
|
348
|
+
<span class="cline-any cline-yes">1x</span>
|
|
349
|
+
<span class="cline-any cline-yes">1x</span>
|
|
350
|
+
<span class="cline-any cline-no"> </span>
|
|
351
|
+
<span class="cline-any cline-no"> </span>
|
|
352
|
+
<span class="cline-any cline-no"> </span>
|
|
359
353
|
<span class="cline-any cline-no"> </span>
|
|
360
354
|
<span class="cline-any cline-no"> </span>
|
|
361
355
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -373,138 +367,135 @@ export default {
|
|
|
373
367
|
// Used to change permissions for a subject on a resource
|
|
374
368
|
// We pass parameters in the query/data object
|
|
375
369
|
// The params object should be already filled by populate hooks
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
<span class="
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
<span class="
|
|
390
|
-
<span class="cstat-no" title="statement not covered" > // On first authorisation create the resource in scope</span>
|
|
391
|
-
<span class="cstat-no" title="statement not covered" > if (!resource) {</span>
|
|
392
|
-
<span class="cstat-no" title="statement not covered" > resource = Object.assign({}, params.resource)</span>
|
|
393
|
-
<span class="cstat-no" title="statement not covered" > if (context) {</span>
|
|
370
|
+
create (data, params) {
|
|
371
|
+
const query = params.query
|
|
372
|
+
const context = params.resourcesService.context
|
|
373
|
+
// Make hook usable with query params as well
|
|
374
|
+
const scopeName = data.scope <span class="branch-0 cbranch-no" title="branch not covered" >|| query.scope </span>// Get scope name first
|
|
375
|
+
return Promise.all(params.subjects.map(async subject => {
|
|
376
|
+
// Then retrieve the right scope on the subject
|
|
377
|
+
const scope = _.get(subject, scopeName, [])
|
|
378
|
+
// Then the target resource
|
|
379
|
+
let resource = _.find(scope, resource => resource._id && (resource._id.toString() === params.resource._id.toString()))
|
|
380
|
+
// On first authorisation create the resource in scope
|
|
381
|
+
if (!resource) {
|
|
382
|
+
resource = Object.assign({}, params.resource)
|
|
383
|
+
if (context) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
394
384
|
<span class="cstat-no" title="statement not covered" > resource.context = (typeof context === 'object' ? context._id.toString() : context.toString())</span>
|
|
395
385
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
<span class="
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
<span class="cstat-no" title="statement not covered" > }))</span>
|
|
386
|
+
scope.push(resource)
|
|
387
|
+
}
|
|
388
|
+
// Hooks should have populate subject/resource,
|
|
389
|
+
// now we have to set permissions on the given subject's scope
|
|
390
|
+
resource.permissions = data.permissions <span class="branch-0 cbranch-no" title="branch not covered" >|| query.permissions</span>
|
|
391
|
+
// This cover the case when we create the scope on the first auth,
|
|
392
|
+
// so that if the caller want to get back the update subject he can have it
|
|
393
|
+
_.set(subject, scopeName, scope)
|
|
394
|
+
debug('Updating scope ' + scopeName + ' for subject ' + subject._id + ' on resource ' + params.resource._id + ':', scope)
|
|
395
|
+
subject = await params.subjectsService.patch(subject._id, {
|
|
396
|
+
[scopeName]: scope
|
|
397
|
+
}, {
|
|
398
|
+
user: params.user
|
|
399
|
+
})
|
|
400
|
+
debug('Authorisation ' + data.permissions + ' set for subject ' + subject._id + ' on resource ' + params.resource._id + ' with scope ' + scopeName)
|
|
401
|
+
return subject
|
|
402
|
+
}))
|
|
414
403
|
},
|
|
415
404
|
|
|
416
405
|
// Used to remove permissions for a subject on a resource
|
|
417
406
|
// We use ID as target resource and pass parameters in the query object
|
|
418
407
|
// The params object should be already filled by populate hooks
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
<span class="
|
|
408
|
+
remove (id, params) {
|
|
409
|
+
const query = params.query
|
|
410
|
+
const scopeName = query.scope // Get scope name first
|
|
411
|
+
return Promise.all(params.subjects.map(async subject => {
|
|
412
|
+
// Then retrieve the right scope on the subject
|
|
413
|
+
const scope = _.get(subject, scopeName, [])
|
|
414
|
+
// Remove the target resource if any
|
|
415
|
+
let resources = _.remove(scope, resource => resource._id && (resource._id.toString() === id.toString()))
|
|
416
|
+
if (resources.length === 0) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
428
417
|
<span class="cstat-no" title="statement not covered" > // Fallback as name</span>
|
|
429
|
-
<span class="cstat-no" title="statement not covered" > resources = _.remove(scope, resource => resource.name && (resource.name === id))</span>
|
|
430
|
-
<span class="cstat-no" title="statement not covered" > }</span>
|
|
431
|
-
<span class="cstat-no" title="statement not covered" > if (resources.length > 0) {</span>
|
|
432
|
-
<span class="cstat-no" title="statement not covered" > // This cover the case when we create the scope on the first auth,</span>
|
|
433
|
-
<span class="cstat-no" title="statement not covered" > // so that if the caller want to get back the update subject he can have it</span>
|
|
434
|
-
<span class="cstat-no" title="statement not covered" > _.set(subject, scopeName, scope)</span>
|
|
435
|
-
<span class="cstat-no" title="statement not covered" > // Skip patching if the subject is currently deleted</span>
|
|
436
|
-
<span class="cstat-no" title="statement not covered" > if (!subject.deleted) {</span>
|
|
437
|
-
<span class="cstat-no" title="statement not covered" > debug('Updating scope ' + scopeName + ' for subject ' + subject._id + ' on resource ' + id + ':', scope)</span>
|
|
438
|
-
<span class="cstat-no" title="statement not covered" > subject = await params.subjectsService.patch(subject._id, {</span>
|
|
439
|
-
<span class="cstat-no" title="statement not covered" > [scopeName]: scope</span>
|
|
440
|
-
<span class="cstat-no" title="statement not covered" > }, {</span>
|
|
441
|
-
<span class="cstat-no" title="statement not covered" > user: params.user</span>
|
|
442
|
-
<span class="cstat-no" title="statement not covered" > })</span>
|
|
443
|
-
<span class="cstat-no" title="statement not covered" > await this.updateAbilities(subject)</span>
|
|
444
|
-
<span class="cstat-no" title="statement not covered" > debug('Authorisation unset for subject ' + subject._id + ' on resource ' + id + ' with scope ' + scopeName)</span>
|
|
445
|
-
<span class="cstat-no" title="statement not covered" > return subject</span>
|
|
446
|
-
<span class="cstat-no" title="statement not covered" > }</span>
|
|
418
|
+
<span class="cstat-no" title="statement not covered" > resources = _.remove(scope, resource => resource.name && (resource.name === id.toString()))</span>
|
|
447
419
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
448
|
-
|
|
449
|
-
|
|
420
|
+
if (resources.length > 0) {
|
|
421
|
+
// This cover the case when we create the scope on the first auth,
|
|
422
|
+
// so that if the caller want to get back the update subject he can have it
|
|
423
|
+
_.set(subject, scopeName, scope)
|
|
424
|
+
// Skip patching if the subject is currently deleted
|
|
425
|
+
if (!subject.deleted) {
|
|
426
|
+
debug('Updating scope ' + scopeName + ' for subject ' + subject._id + ' on resource ' + id + ':', scope)
|
|
427
|
+
subject = await params.subjectsService.patch(subject._id, {
|
|
428
|
+
[scopeName]: scope
|
|
429
|
+
}, {
|
|
430
|
+
user: params.user
|
|
431
|
+
})
|
|
432
|
+
debug('Authorisation unset for subject ' + subject._id + ' on resource ' + id + ' with scope ' + scopeName)
|
|
433
|
+
return subject
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
<span class="cstat-no" title="statement not covered" ><span class="branch-0 cbranch-no" title="branch not covered" > return subject</span></span>
|
|
437
|
+
}))
|
|
450
438
|
},
|
|
451
439
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
<span class="
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
440
|
+
setup (app) {
|
|
441
|
+
const config = app.get('authorisation')
|
|
442
|
+
if (config && config.cache) {
|
|
443
|
+
this.cacheConfig = config.cache
|
|
444
|
+
// Store abilities of the N most active users in LRU cache (defaults to 1000)
|
|
445
|
+
const max = this.cacheConfig.maxUsers <span class="branch-0 cbranch-no" title="branch not covered" >|| 1000</span>
|
|
446
|
+
// LRU cache lib switched from positional parameters to options object at some point
|
|
447
|
+
// so that now we directly pass the options to it while before we used the max argument
|
|
448
|
+
if (!this.cacheConfig.max && !this.cacheConfig.ttl && !this.cacheConfig.maxSize) this.cacheConfig.max = max
|
|
449
|
+
this.cache = new LRUCache(this.cacheConfig)
|
|
450
|
+
debug('Using LRU cache for user abilities')
|
|
451
|
+
}<span class="branch-0 cbranch-no" title="branch not covered" > else {</span>
|
|
463
452
|
<span class="cstat-no" title="statement not covered" > debug('Do not use LRU cache for user abilities')</span>
|
|
464
453
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
465
454
|
},
|
|
455
|
+
|
|
456
|
+
getCacheKey (subject) {
|
|
457
|
+
if (!this.cache) <span class="branch-0 cbranch-no" title="branch not covered" >return null</span>
|
|
458
|
+
let cacheKey
|
|
459
|
+
// Compute cache key based on provided function or user ID
|
|
460
|
+
if (typeof this.cacheConfig.key === 'function') <span class="branch-0 cbranch-no" title="branch not covered" >cacheKey = this.cacheConfig.key(subject)</span>
|
|
461
|
+
if (!cacheKey && subject && subject._id) cacheKey = subject._id.toString()
|
|
462
|
+
return cacheKey || ANONYMOUS_USER
|
|
463
|
+
},
|
|
466
464
|
|
|
467
465
|
// Compute abilities for a given user and set it in cache the first time
|
|
468
466
|
// or get it from cache if found
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
<span class="cstat-no" title="statement not covered" > this.cache.set(subject._id.toString(), abilities)</span>
|
|
483
|
-
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
484
|
-
<span class="cstat-no" title="statement not covered" > this.cache.set(ANONYMOUS_USER, abilities)</span>
|
|
485
|
-
<span class="cstat-no" title="statement not covered" > }</span>
|
|
486
|
-
<span class="cstat-no" title="statement not covered" > }</span>
|
|
487
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
488
|
-
<span class="cstat-no" title="statement not covered" > return abilities</span>
|
|
467
|
+
async getAbilities (subject) {
|
|
468
|
+
const cacheKey = this.getCacheKey(subject)
|
|
469
|
+
if (cacheKey && this.cache.has(cacheKey)) return this.cache.get(cacheKey)
|
|
470
|
+
|
|
471
|
+
// Provide app for any complex use case requiring to make requests
|
|
472
|
+
const abilities = await defineAbilities(subject, this.app)
|
|
473
|
+
|
|
474
|
+
if (cacheKey) {
|
|
475
|
+
debug('Updating abilities of subject ' + (subject ? subject._id : ANONYMOUS_USER) + ' with cache key ' + cacheKey)
|
|
476
|
+
this.cache.set(cacheKey, abilities)
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
return abilities
|
|
489
480
|
},
|
|
490
481
|
|
|
491
482
|
// Compute abilities for a given user and update it in cache
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
501
|
-
<span class="cstat-no" title="statement not covered" > const abilities = await this.getAbilities(subject)</span>
|
|
502
|
-
<span class="cstat-no" title="statement not covered" > return abilities</span>
|
|
483
|
+
async updateAbilities (subject) {
|
|
484
|
+
const cacheKey = this.getCacheKey(subject)
|
|
485
|
+
|
|
486
|
+
// Remove abilities from cache so that next call will populate it again
|
|
487
|
+
if (cacheKey && this.cache.has(cacheKey)) this.cache.delete(cacheKey)
|
|
488
|
+
|
|
489
|
+
const abilities = await this.getAbilities(subject)
|
|
490
|
+
return abilities
|
|
503
491
|
},
|
|
504
492
|
|
|
505
493
|
// Clear abilities
|
|
506
494
|
<span class="fstat-no" title="function not covered" > clearAbilities() {</span>
|
|
507
|
-
<span class="cstat-no" title="statement not covered" > if (this.cache)
|
|
495
|
+
<span class="cstat-no" title="statement not covered" > if (this.cache) {</span>
|
|
496
|
+
<span class="cstat-no" title="statement not covered" > debug('Clearing user abilities cache')</span>
|
|
497
|
+
<span class="cstat-no" title="statement not covered" > this.cache.clear()</span>
|
|
498
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
508
499
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
509
500
|
}
|
|
510
501
|
</pre></td></tr></table></pre>
|
|
@@ -514,7 +505,7 @@ export default {
|
|
|
514
505
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
515
506
|
Code coverage generated by
|
|
516
507
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
517
|
-
at
|
|
508
|
+
at 2026-03-10T09:15:24.743Z
|
|
518
509
|
</div>
|
|
519
510
|
<script src="../../../../prettify.js"></script>
|
|
520
511
|
<script>
|