@kalisio/kdk 1.4.2 → 1.5.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/.nyc_output/{2e74ca23-8cf0-4161-9536-f71c2a1a74bb.json → 058fc679-d60a-4501-ac04-71171e5200b8.json} +0 -0
- package/.nyc_output/2226bcce-9d22-4dad-b9fa-46564b5565c7.json +1 -0
- package/.nyc_output/{2c5b7c8e-81db-4d2c-a7a4-02dc640d301f.json → 6dc4b140-1a8a-4d69-b91c-89c557883d6e.json} +1 -1
- package/.nyc_output/{81d21e46-766a-46bc-b1b7-143ca577347a.json → 8b1830fa-932e-4a61-9837-4a5b18f83ea9.json} +0 -0
- package/.nyc_output/{aaf3ebbb-f895-4d7b-9255-bc5dee832570.json → afd2d144-3570-4858-b94a-b523dbd023dd.json} +0 -0
- package/.nyc_output/processinfo/058fc679-d60a-4501-ac04-71171e5200b8.json +1 -0
- package/.nyc_output/processinfo/{a762cb58-70dc-4d39-ab69-928635affa98.json → 2226bcce-9d22-4dad-b9fa-46564b5565c7.json} +1 -1
- package/.nyc_output/processinfo/{2c5b7c8e-81db-4d2c-a7a4-02dc640d301f.json → 6dc4b140-1a8a-4d69-b91c-89c557883d6e.json} +1 -1
- package/.nyc_output/processinfo/8b1830fa-932e-4a61-9837-4a5b18f83ea9.json +1 -0
- package/.nyc_output/processinfo/afd2d144-3570-4858-b94a-b523dbd023dd.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/CHANGELOG.md +21 -8
- package/coverage/core/api/application.js.html +455 -455
- package/coverage/core/api/authentication.js.html +119 -119
- package/coverage/core/api/db.js.html +201 -201
- package/coverage/core/api/hooks/hooks.account.js.html +45 -45
- package/coverage/core/api/hooks/hooks.authentication.js.html +71 -71
- package/coverage/core/api/hooks/hooks.authorisations.js.html +353 -353
- package/coverage/core/api/hooks/hooks.devices.js.html +49 -49
- package/coverage/core/api/hooks/hooks.groups.js.html +37 -37
- package/coverage/core/api/hooks/hooks.logger.js.html +27 -27
- package/coverage/core/api/hooks/hooks.model.js.html +269 -269
- package/coverage/core/api/hooks/hooks.organisations.js.html +190 -190
- package/coverage/core/api/hooks/hooks.pusher.js.html +114 -114
- package/coverage/core/api/hooks/hooks.query.js.html +200 -200
- package/coverage/core/api/hooks/hooks.service.js.html +82 -82
- package/coverage/core/api/hooks/hooks.storage.js.html +121 -121
- package/coverage/core/api/hooks/hooks.tags.js.html +232 -232
- package/coverage/core/api/hooks/hooks.users.js.html +263 -263
- package/coverage/core/api/hooks/index.html +172 -172
- package/coverage/core/api/hooks/index.js.html +24 -24
- package/coverage/core/api/index.html +75 -75
- package/coverage/core/api/index.js.html +26 -26
- package/coverage/core/api/marshall.js.html +57 -57
- package/coverage/core/api/models/groups.model.mongodb.js.html +20 -20
- package/coverage/core/api/models/index.html +50 -50
- package/coverage/core/api/models/organisations.model.mongodb.js.html +12 -12
- package/coverage/core/api/models/tags.model.mongodb.js.html +22 -22
- package/coverage/core/api/models/users.model.mongodb.js.html +20 -20
- package/coverage/core/api/oauth2-handler.js.html +18 -18
- package/coverage/core/api/oauth2-verifier.js.html +38 -38
- package/coverage/core/api/services/account/account.hooks.js.html +16 -16
- package/coverage/core/api/services/account/account.service.js.html +104 -104
- package/coverage/core/api/services/account/index.html +32 -32
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +9 -9
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +132 -132
- package/coverage/core/api/services/authorisations/index.html +28 -28
- package/coverage/core/api/services/databases/databases.hooks.js.html +9 -9
- package/coverage/core/api/services/databases/databases.service.js.html +12 -12
- package/coverage/core/api/services/databases/index.html +24 -24
- package/coverage/core/api/services/devices/devices.hooks.js.html +9 -9
- package/coverage/core/api/services/devices/devices.service.js.html +121 -121
- package/coverage/core/api/services/devices/index.html +28 -28
- package/coverage/core/api/services/groups/groups.hooks.js.html +9 -9
- package/coverage/core/api/services/groups/index.html +13 -13
- package/coverage/core/api/services/index.html +21 -21
- package/coverage/core/api/services/index.js.html +137 -137
- package/coverage/core/api/services/mailer/index.html +24 -24
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +9 -9
- package/coverage/core/api/services/mailer/mailer.service.js.html +19 -19
- package/coverage/core/api/services/organisations/index.html +24 -24
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +8 -8
- package/coverage/core/api/services/organisations/organisations.service.js.html +67 -67
- package/coverage/core/api/services/pusher/index.html +34 -34
- package/coverage/core/api/services/pusher/pusher.channels.js.html +8 -8
- package/coverage/core/api/services/pusher/pusher.hooks.js.html +10 -10
- package/coverage/core/api/services/pusher/pusher.service.js.html +414 -414
- package/coverage/core/api/services/storage/index.html +21 -21
- package/coverage/core/api/services/storage/storage.hooks.js.html +35 -35
- package/coverage/core/api/services/tags/index.html +21 -21
- package/coverage/core/api/services/tags/tags.hooks.js.html +25 -25
- package/coverage/core/api/services/users/index.html +21 -21
- package/coverage/core/api/services/users/users.hooks.js.html +33 -33
- package/coverage/core/common/errors.js.html +1 -1
- package/coverage/core/common/index.html +42 -27
- package/coverage/core/common/index.js.html +16 -16
- package/coverage/core/common/permissions.js.html +274 -274
- package/coverage/index.html +178 -178
- package/coverage/lcov-report/core/api/application.js.html +455 -455
- package/coverage/lcov-report/core/api/authentication.js.html +119 -119
- package/coverage/lcov-report/core/api/db.js.html +201 -201
- package/coverage/lcov-report/core/api/hooks/hooks.account.js.html +45 -45
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +71 -71
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +353 -353
- package/coverage/lcov-report/core/api/hooks/hooks.devices.js.html +49 -49
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +37 -37
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +27 -27
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +269 -269
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +190 -190
- package/coverage/lcov-report/core/api/hooks/hooks.pusher.js.html +114 -114
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +200 -200
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +82 -82
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +121 -121
- package/coverage/lcov-report/core/api/hooks/hooks.tags.js.html +232 -232
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +263 -263
- package/coverage/lcov-report/core/api/hooks/index.html +172 -172
- package/coverage/lcov-report/core/api/hooks/index.js.html +24 -24
- package/coverage/lcov-report/core/api/index.html +75 -75
- package/coverage/lcov-report/core/api/index.js.html +26 -26
- package/coverage/lcov-report/core/api/marshall.js.html +57 -57
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +20 -20
- package/coverage/lcov-report/core/api/models/index.html +50 -50
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +12 -12
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +22 -22
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +20 -20
- package/coverage/lcov-report/core/api/oauth2-handler.js.html +18 -18
- package/coverage/lcov-report/core/api/oauth2-verifier.js.html +38 -38
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +16 -16
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +104 -104
- package/coverage/lcov-report/core/api/services/account/index.html +32 -32
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +132 -132
- package/coverage/lcov-report/core/api/services/authorisations/index.html +28 -28
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +12 -12
- package/coverage/lcov-report/core/api/services/databases/index.html +24 -24
- package/coverage/lcov-report/core/api/services/devices/devices.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/devices/devices.service.js.html +121 -121
- package/coverage/lcov-report/core/api/services/devices/index.html +28 -28
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/groups/index.html +13 -13
- package/coverage/lcov-report/core/api/services/index.html +21 -21
- package/coverage/lcov-report/core/api/services/index.js.html +137 -137
- package/coverage/lcov-report/core/api/services/mailer/index.html +24 -24
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +19 -19
- package/coverage/lcov-report/core/api/services/organisations/index.html +24 -24
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +8 -8
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +67 -67
- package/coverage/lcov-report/core/api/services/pusher/index.html +34 -34
- package/coverage/lcov-report/core/api/services/pusher/pusher.channels.js.html +8 -8
- package/coverage/lcov-report/core/api/services/pusher/pusher.hooks.js.html +10 -10
- package/coverage/lcov-report/core/api/services/pusher/pusher.service.js.html +414 -414
- package/coverage/lcov-report/core/api/services/storage/index.html +21 -21
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +35 -35
- package/coverage/lcov-report/core/api/services/tags/index.html +21 -21
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +25 -25
- package/coverage/lcov-report/core/api/services/users/index.html +21 -21
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +33 -33
- 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 +16 -16
- package/coverage/lcov-report/core/common/permissions.js.html +274 -274
- package/coverage/lcov-report/index.html +178 -178
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +1 -1
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +25 -7
- 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 +1 -1
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/index.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/map/api/services/catalog/index.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/map/api/services/features/index.html +1 -1
- package/coverage/lcov-report/map/api/services/geocoder/geocoder.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/geocoder/geocoder.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/geocoder/index.html +1 -1
- package/coverage/lcov-report/map/api/services/index.html +1 -1
- package/coverage/lcov-report/map/api/services/index.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/map/common/grid.js.html +1 -1
- package/coverage/lcov-report/map/common/index.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/map/common/permissions.js.html +1 -1
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/tms-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/wcs-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/wfs-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/wms-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/wmts-utils.js.html +1 -1
- package/coverage/lcov.info +3403 -3724
- package/coverage/map/api/hooks/hooks.catalog.js.html +1 -1
- package/coverage/map/api/hooks/hooks.query.js.html +25 -7
- 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 +1 -1
- package/coverage/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/index.html +1 -1
- 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 +1 -1
- package/coverage/map/api/services/catalog/index.html +1 -1
- 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 +1 -1
- package/coverage/map/api/services/features/index.html +1 -1
- package/coverage/map/api/services/geocoder/geocoder.hooks.js.html +1 -1
- package/coverage/map/api/services/geocoder/geocoder.service.js.html +1 -1
- package/coverage/map/api/services/geocoder/index.html +1 -1
- package/coverage/map/api/services/index.html +1 -1
- package/coverage/map/api/services/index.js.html +1 -1
- 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 +1 -1
- package/coverage/map/common/grid.js.html +1 -1
- package/coverage/map/common/index.html +1 -1
- 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 +1 -1
- package/coverage/map/common/permissions.js.html +1 -1
- package/coverage/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/map/common/tms-utils.js.html +1 -1
- package/coverage/map/common/wcs-grid-source.js.html +1 -1
- package/coverage/map/common/wcs-utils.js.html +1 -1
- package/coverage/map/common/weacast-grid-source.js.html +1 -1
- package/coverage/map/common/wfs-utils.js.html +1 -1
- package/coverage/map/common/wms-utils.js.html +1 -1
- package/coverage/map/common/wmts-utils.js.html +1 -1
- package/lib/core/client/components/form/KFileField.vue +11 -40
- package/lib/core/client/components/input/KOptionsChooser.vue +2 -2
- package/lib/core/client/i18n/core_en.json +6 -1
- package/lib/core/client/i18n/core_fr.json +6 -1
- package/lib/core/client/index.js +18 -0
- package/lib/core/client/index.js.map +1 -1
- package/lib/core/client/layout.js +8 -1
- package/lib/core/client/layout.js.map +1 -1
- package/lib/core/client/reader.js +54 -0
- package/lib/core/client/reader.js.map +1 -0
- package/lib/core/client/readers/index.js +30 -0
- package/lib/core/client/readers/index.js.map +1 -0
- package/lib/core/client/readers/reader.csv.js +43 -0
- package/lib/core/client/readers/reader.csv.js.map +1 -0
- package/lib/core/client/readers/reader.json.js +38 -0
- package/lib/core/client/readers/reader.json.js.map +1 -0
- package/lib/map/api/hooks/hooks.query.js +7 -2
- package/lib/map/api/hooks/hooks.query.js.map +1 -1
- package/lib/map/client/components/KCaptureToolbar.vue +156 -0
- package/lib/map/client/components/KFeaturesFilter.vue +3 -1
- package/lib/map/client/components/KLayerEditionToolbar.vue +19 -11
- package/lib/map/client/components/KLayerStyleEditor.vue +2 -1
- package/lib/map/client/components/KLayerStyleForm.vue +34 -23
- package/lib/map/client/components/KMeasureTool.vue +340 -0
- package/lib/map/client/components/KTimeline.vue +0 -1
- package/lib/map/client/components/catalog/KImportLayer.vue +8 -35
- package/lib/map/client/components/catalog/KLayersSelector.vue +5 -3
- package/lib/map/client/components/widget/KTimeSeries.vue +81 -3
- package/lib/map/client/i18n/map_en.json +41 -4
- package/lib/map/client/i18n/map_fr.json +41 -4
- package/lib/map/client/init.js +6 -1
- package/lib/map/client/init.js.map +1 -1
- package/lib/map/client/leaflet/MaskLayer.js +9 -0
- package/lib/map/client/leaflet/MaskLayer.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.base-globe.js +3 -5
- package/lib/map/client/mixins/globe/mixin.base-globe.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.popup.js +4 -0
- package/lib/map/client/mixins/globe/mixin.popup.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.tooltip.js +4 -0
- package/lib/map/client/mixins/globe/mixin.tooltip.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.base-map.js +45 -6
- package/lib/map/client/mixins/map/mixin.base-map.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.canvas-layers.js +2 -0
- package/lib/map/client/mixins/map/mixin.canvas-layers.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.file-layers.js +47 -101
- package/lib/map/client/mixins/map/mixin.file-layers.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.geojson-layers.js +4 -1
- package/lib/map/client/mixins/map/mixin.geojson-layers.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.popup.js +4 -0
- package/lib/map/client/mixins/map/mixin.popup.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.tooltip.js +4 -0
- package/lib/map/client/mixins/map/mixin.tooltip.js.map +1 -1
- package/lib/map/client/mixins/mixin.activity.js +2 -0
- package/lib/map/client/mixins/mixin.activity.js.map +1 -1
- package/lib/map/client/mixins/mixin.context.js +26 -3
- package/lib/map/client/mixins/mixin.context.js.map +1 -1
- package/lib/map/client/mixins/mixin.feature-service.js +2 -2
- package/lib/map/client/mixins/mixin.feature-service.js.map +1 -1
- package/lib/map/client/mixins/mixin.infobox.js +4 -0
- package/lib/map/client/mixins/mixin.infobox.js.map +1 -1
- package/lib/map/client/readers/index.js +42 -0
- package/lib/map/client/readers/index.js.map +1 -0
- package/lib/map/client/readers/reader.geojson.js +59 -0
- package/lib/map/client/readers/reader.geojson.js.map +1 -0
- package/lib/map/client/readers/reader.gpx.js +41 -0
- package/lib/map/client/readers/reader.gpx.js.map +1 -0
- package/lib/map/client/readers/reader.kml.js +41 -0
- package/lib/map/client/readers/reader.kml.js.map +1 -0
- package/lib/map/client/utils.js +2 -1
- package/lib/map/client/utils.js.map +1 -1
- package/lib/test/client/core/runner.js +1 -2
- package/lib/test/client/core/runner.js.map +1 -1
- package/lib/test/client/core/utils.js +2 -2
- package/lib/test/client/core/utils.js.map +1 -1
- package/lib/test/client/map/catalog.js +50 -49
- package/lib/test/client/map/catalog.js.map +1 -1
- package/package.json +3 -2
- package/.nyc_output/a762cb58-70dc-4d39-ab69-928635affa98.json +0 -1
- package/.nyc_output/dbeb2602-0ac2-4e66-978b-0d29548359ca.json +0 -1
- package/.nyc_output/e47d1e4c-2fff-4dcb-908f-d3081162547c.json +0 -1
- package/.nyc_output/processinfo/2e74ca23-8cf0-4161-9536-f71c2a1a74bb.json +0 -1
- package/.nyc_output/processinfo/81d21e46-766a-46bc-b1b7-143ca577347a.json +0 -1
- package/.nyc_output/processinfo/aaf3ebbb-f895-4d7b-9255-bc5dee832570.json +0 -1
- package/.nyc_output/processinfo/dbeb2602-0ac2-4e66-978b-0d29548359ca.json +0 -1
- package/.nyc_output/processinfo/e47d1e4c-2fff-4dcb-908f-d3081162547c.json +0 -1
- package/extras/testcafe/Dockerfile +0 -48
- package/extras/testcafe/docker-entrypoint.sh +0 -27
- package/extras/testcafe/page-models/core/account.js +0 -75
- package/extras/testcafe/page-models/core/base-collection.js +0 -41
- package/extras/testcafe/page-models/core/base-page.js +0 -25
- package/extras/testcafe/page-models/core/groups.js +0 -36
- package/extras/testcafe/page-models/core/index.js +0 -140
- package/extras/testcafe/page-models/core/layout.js +0 -145
- package/extras/testcafe/page-models/core/members.js +0 -98
- package/extras/testcafe/page-models/core/organisations.js +0 -76
- package/extras/testcafe/page-models/core/screens.js +0 -99
- package/extras/testcafe/page-models/core/tags.js +0 -21
- package/extras/testcafe/page-models/map/add-layer.js +0 -51
- package/extras/testcafe/page-models/map/catalog.js +0 -132
- package/extras/testcafe/page-models/map/index.js +0 -36
- package/extras/testcafe/page-models/map/map-activity.js +0 -42
- package/extras/testcafe/page-models/map/timeline.js +0 -67
|
@@ -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">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>0/143</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>0/74</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>0/34</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>0/129</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
57
|
</div>
|
|
58
|
-
<div class='status-line
|
|
58
|
+
<div class='status-line low'></div>
|
|
59
59
|
<pre><table class="coverage">
|
|
60
60
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
61
61
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -356,22 +356,22 @@
|
|
|
356
356
|
<a name='L297'></a><a href='#L297'>297</a>
|
|
357
357
|
<a name='L298'></a><a href='#L298'>298</a>
|
|
358
358
|
<a name='L299'></a><a href='#L299'>299</a>
|
|
359
|
-
<a name='L300'></a><a href='#L300'>300</a></td><td class="line-coverage quiet"><span class="cline-any cline-
|
|
360
|
-
<span class="cline-any cline-yes">1x</span>
|
|
359
|
+
<a name='L300'></a><a href='#L300'>300</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
361
360
|
<span class="cline-any cline-neutral"> </span>
|
|
362
361
|
<span class="cline-any cline-neutral"> </span>
|
|
363
|
-
<span class="cline-any cline-yes">1x</span>
|
|
364
|
-
<span class="cline-any cline-yes">1x</span>
|
|
365
|
-
<span class="cline-any cline-yes">1x</span>
|
|
366
|
-
<span class="cline-any cline-yes">1x</span>
|
|
367
362
|
<span class="cline-any cline-neutral"> </span>
|
|
368
|
-
<span class="cline-any cline-
|
|
363
|
+
<span class="cline-any cline-no"> </span>
|
|
364
|
+
<span class="cline-any cline-no"> </span>
|
|
365
|
+
<span class="cline-any cline-no"> </span>
|
|
366
|
+
<span class="cline-any cline-no"> </span>
|
|
367
|
+
<span class="cline-any cline-neutral"> </span>
|
|
368
|
+
<span class="cline-any cline-no"> </span>
|
|
369
369
|
<span class="cline-any cline-neutral"> </span>
|
|
370
370
|
<span class="cline-any cline-neutral"> </span>
|
|
371
371
|
<span class="cline-any cline-neutral"> </span>
|
|
372
372
|
<span class="cline-any cline-neutral"> </span>
|
|
373
373
|
<span class="cline-any cline-neutral"> </span>
|
|
374
|
-
<span class="cline-any cline-
|
|
374
|
+
<span class="cline-any cline-no"> </span>
|
|
375
375
|
<span class="cline-any cline-neutral"> </span>
|
|
376
376
|
<span class="cline-any cline-neutral"> </span>
|
|
377
377
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -398,208 +398,208 @@
|
|
|
398
398
|
<span class="cline-any cline-neutral"> </span>
|
|
399
399
|
<span class="cline-any cline-neutral"> </span>
|
|
400
400
|
<span class="cline-any cline-neutral"> </span>
|
|
401
|
-
<span class="cline-any cline-
|
|
401
|
+
<span class="cline-any cline-no"> </span>
|
|
402
402
|
<span class="cline-any cline-neutral"> </span>
|
|
403
403
|
<span class="cline-any cline-neutral"> </span>
|
|
404
|
-
<span class="cline-any cline-
|
|
405
|
-
<span class="cline-any cline-
|
|
404
|
+
<span class="cline-any cline-no"> </span>
|
|
405
|
+
<span class="cline-any cline-no"> </span>
|
|
406
406
|
<span class="cline-any cline-neutral"> </span>
|
|
407
407
|
<span class="cline-any cline-neutral"> </span>
|
|
408
|
-
<span class="cline-any cline-
|
|
408
|
+
<span class="cline-any cline-no"> </span>
|
|
409
409
|
<span class="cline-any cline-neutral"> </span>
|
|
410
|
-
<span class="cline-any cline-
|
|
411
|
-
<span class="cline-any cline-
|
|
410
|
+
<span class="cline-any cline-no"> </span>
|
|
411
|
+
<span class="cline-any cline-no"> </span>
|
|
412
412
|
<span class="cline-any cline-neutral"> </span>
|
|
413
|
-
<span class="cline-any cline-
|
|
414
|
-
<span class="cline-any cline-
|
|
415
|
-
<span class="cline-any cline-
|
|
413
|
+
<span class="cline-any cline-no"> </span>
|
|
414
|
+
<span class="cline-any cline-no"> </span>
|
|
415
|
+
<span class="cline-any cline-no"> </span>
|
|
416
416
|
<span class="cline-any cline-neutral"> </span>
|
|
417
|
-
<span class="cline-any cline-
|
|
418
|
-
<span class="cline-any cline-
|
|
417
|
+
<span class="cline-any cline-no"> </span>
|
|
418
|
+
<span class="cline-any cline-no"> </span>
|
|
419
419
|
<span class="cline-any cline-neutral"> </span>
|
|
420
420
|
<span class="cline-any cline-neutral"> </span>
|
|
421
421
|
<span class="cline-any cline-neutral"> </span>
|
|
422
422
|
<span class="cline-any cline-neutral"> </span>
|
|
423
423
|
<span class="cline-any cline-neutral"> </span>
|
|
424
424
|
<span class="cline-any cline-neutral"> </span>
|
|
425
|
-
<span class="cline-any cline-
|
|
426
|
-
<span class="cline-any cline-
|
|
425
|
+
<span class="cline-any cline-no"> </span>
|
|
426
|
+
<span class="cline-any cline-no"> </span>
|
|
427
427
|
<span class="cline-any cline-neutral"> </span>
|
|
428
|
-
<span class="cline-any cline-
|
|
429
|
-
<span class="cline-any cline-
|
|
430
|
-
<span class="cline-any cline-
|
|
431
|
-
<span class="cline-any cline-
|
|
432
|
-
<span class="cline-any cline-
|
|
428
|
+
<span class="cline-any cline-no"> </span>
|
|
429
|
+
<span class="cline-any cline-no"> </span>
|
|
430
|
+
<span class="cline-any cline-no"> </span>
|
|
431
|
+
<span class="cline-any cline-no"> </span>
|
|
432
|
+
<span class="cline-any cline-no"> </span>
|
|
433
433
|
<span class="cline-any cline-neutral"> </span>
|
|
434
|
-
<span class="cline-any cline-
|
|
434
|
+
<span class="cline-any cline-no"> </span>
|
|
435
435
|
<span class="cline-any cline-neutral"> </span>
|
|
436
|
-
<span class="cline-any cline-
|
|
436
|
+
<span class="cline-any cline-no"> </span>
|
|
437
437
|
<span class="cline-any cline-neutral"> </span>
|
|
438
|
-
<span class="cline-any cline-
|
|
438
|
+
<span class="cline-any cline-no"> </span>
|
|
439
439
|
<span class="cline-any cline-neutral"> </span>
|
|
440
|
-
<span class="cline-any cline-
|
|
440
|
+
<span class="cline-any cline-no"> </span>
|
|
441
441
|
<span class="cline-any cline-neutral"> </span>
|
|
442
|
-
<span class="cline-any cline-
|
|
442
|
+
<span class="cline-any cline-no"> </span>
|
|
443
443
|
<span class="cline-any cline-neutral"> </span>
|
|
444
444
|
<span class="cline-any cline-neutral"> </span>
|
|
445
|
-
<span class="cline-any cline-
|
|
446
|
-
<span class="cline-any cline-
|
|
447
|
-
<span class="cline-any cline-
|
|
448
|
-
<span class="cline-any cline-
|
|
445
|
+
<span class="cline-any cline-no"> </span>
|
|
446
|
+
<span class="cline-any cline-no"> </span>
|
|
447
|
+
<span class="cline-any cline-no"> </span>
|
|
448
|
+
<span class="cline-any cline-no"> </span>
|
|
449
449
|
<span class="cline-any cline-neutral"> </span>
|
|
450
|
-
<span class="cline-any cline-
|
|
450
|
+
<span class="cline-any cline-no"> </span>
|
|
451
451
|
<span class="cline-any cline-neutral"> </span>
|
|
452
|
-
<span class="cline-any cline-
|
|
453
|
-
<span class="cline-any cline-
|
|
454
|
-
<span class="cline-any cline-
|
|
455
|
-
<span class="cline-any cline-
|
|
456
|
-
<span class="cline-any cline-
|
|
452
|
+
<span class="cline-any cline-no"> </span>
|
|
453
|
+
<span class="cline-any cline-no"> </span>
|
|
454
|
+
<span class="cline-any cline-no"> </span>
|
|
455
|
+
<span class="cline-any cline-no"> </span>
|
|
456
|
+
<span class="cline-any cline-no"> </span>
|
|
457
457
|
<span class="cline-any cline-neutral"> </span>
|
|
458
458
|
<span class="cline-any cline-neutral"> </span>
|
|
459
459
|
<span class="cline-any cline-neutral"> </span>
|
|
460
460
|
<span class="cline-any cline-neutral"> </span>
|
|
461
461
|
<span class="cline-any cline-neutral"> </span>
|
|
462
|
-
<span class="cline-any cline-
|
|
462
|
+
<span class="cline-any cline-no"> </span>
|
|
463
463
|
<span class="cline-any cline-neutral"> </span>
|
|
464
464
|
<span class="cline-any cline-neutral"> </span>
|
|
465
|
-
<span class="cline-any cline-
|
|
466
|
-
<span class="cline-any cline-
|
|
465
|
+
<span class="cline-any cline-no"> </span>
|
|
466
|
+
<span class="cline-any cline-no"> </span>
|
|
467
467
|
<span class="cline-any cline-neutral"> </span>
|
|
468
468
|
<span class="cline-any cline-neutral"> </span>
|
|
469
469
|
<span class="cline-any cline-neutral"> </span>
|
|
470
470
|
<span class="cline-any cline-neutral"> </span>
|
|
471
|
-
<span class="cline-any cline-
|
|
471
|
+
<span class="cline-any cline-no"> </span>
|
|
472
472
|
<span class="cline-any cline-neutral"> </span>
|
|
473
|
-
<span class="cline-any cline-
|
|
474
|
-
<span class="cline-any cline-
|
|
473
|
+
<span class="cline-any cline-no"> </span>
|
|
474
|
+
<span class="cline-any cline-no"> </span>
|
|
475
475
|
<span class="cline-any cline-neutral"> </span>
|
|
476
|
-
<span class="cline-any cline-
|
|
476
|
+
<span class="cline-any cline-no"> </span>
|
|
477
477
|
<span class="cline-any cline-neutral"> </span>
|
|
478
478
|
<span class="cline-any cline-neutral"> </span>
|
|
479
479
|
<span class="cline-any cline-neutral"> </span>
|
|
480
480
|
<span class="cline-any cline-neutral"> </span>
|
|
481
|
-
<span class="cline-any cline-
|
|
482
|
-
<span class="cline-any cline-
|
|
483
|
-
<span class="cline-any cline-
|
|
481
|
+
<span class="cline-any cline-no"> </span>
|
|
482
|
+
<span class="cline-any cline-no"> </span>
|
|
483
|
+
<span class="cline-any cline-no"> </span>
|
|
484
484
|
<span class="cline-any cline-neutral"> </span>
|
|
485
485
|
<span class="cline-any cline-neutral"> </span>
|
|
486
486
|
<span class="cline-any cline-neutral"> </span>
|
|
487
|
-
<span class="cline-any cline-
|
|
487
|
+
<span class="cline-any cline-no"> </span>
|
|
488
488
|
<span class="cline-any cline-no"> </span>
|
|
489
489
|
<span class="cline-any cline-neutral"> </span>
|
|
490
490
|
<span class="cline-any cline-neutral"> </span>
|
|
491
491
|
<span class="cline-any cline-neutral"> </span>
|
|
492
|
-
<span class="cline-any cline-
|
|
492
|
+
<span class="cline-any cline-no"> </span>
|
|
493
493
|
<span class="cline-any cline-neutral"> </span>
|
|
494
494
|
<span class="cline-any cline-neutral"> </span>
|
|
495
495
|
<span class="cline-any cline-neutral"> </span>
|
|
496
|
-
<span class="cline-any cline-
|
|
497
|
-
<span class="cline-any cline-
|
|
496
|
+
<span class="cline-any cline-no"> </span>
|
|
497
|
+
<span class="cline-any cline-no"> </span>
|
|
498
498
|
<span class="cline-any cline-neutral"> </span>
|
|
499
499
|
<span class="cline-any cline-neutral"> </span>
|
|
500
500
|
<span class="cline-any cline-neutral"> </span>
|
|
501
|
-
<span class="cline-any cline-
|
|
501
|
+
<span class="cline-any cline-no"> </span>
|
|
502
502
|
<span class="cline-any cline-neutral"> </span>
|
|
503
|
-
<span class="cline-any cline-
|
|
504
|
-
<span class="cline-any cline-
|
|
503
|
+
<span class="cline-any cline-no"> </span>
|
|
504
|
+
<span class="cline-any cline-no"> </span>
|
|
505
505
|
<span class="cline-any cline-neutral"> </span>
|
|
506
|
-
<span class="cline-any cline-
|
|
506
|
+
<span class="cline-any cline-no"> </span>
|
|
507
507
|
<span class="cline-any cline-neutral"> </span>
|
|
508
|
-
<span class="cline-any cline-
|
|
508
|
+
<span class="cline-any cline-no"> </span>
|
|
509
509
|
<span class="cline-any cline-neutral"> </span>
|
|
510
|
-
<span class="cline-any cline-
|
|
510
|
+
<span class="cline-any cline-no"> </span>
|
|
511
511
|
<span class="cline-any cline-neutral"> </span>
|
|
512
512
|
<span class="cline-any cline-neutral"> </span>
|
|
513
513
|
<span class="cline-any cline-neutral"> </span>
|
|
514
514
|
<span class="cline-any cline-neutral"> </span>
|
|
515
|
-
<span class="cline-any cline-
|
|
515
|
+
<span class="cline-any cline-no"> </span>
|
|
516
516
|
<span class="cline-any cline-neutral"> </span>
|
|
517
517
|
<span class="cline-any cline-neutral"> </span>
|
|
518
|
-
<span class="cline-any cline-
|
|
519
|
-
<span class="cline-any cline-
|
|
520
|
-
<span class="cline-any cline-
|
|
521
|
-
<span class="cline-any cline-
|
|
518
|
+
<span class="cline-any cline-no"> </span>
|
|
519
|
+
<span class="cline-any cline-no"> </span>
|
|
520
|
+
<span class="cline-any cline-no"> </span>
|
|
521
|
+
<span class="cline-any cline-no"> </span>
|
|
522
522
|
<span class="cline-any cline-neutral"> </span>
|
|
523
523
|
<span class="cline-any cline-neutral"> </span>
|
|
524
524
|
<span class="cline-any cline-neutral"> </span>
|
|
525
|
-
<span class="cline-any cline-
|
|
526
|
-
<span class="cline-any cline-
|
|
527
|
-
<span class="cline-any cline-
|
|
525
|
+
<span class="cline-any cline-no"> </span>
|
|
526
|
+
<span class="cline-any cline-no"> </span>
|
|
527
|
+
<span class="cline-any cline-no"> </span>
|
|
528
528
|
<span class="cline-any cline-neutral"> </span>
|
|
529
|
-
<span class="cline-any cline-
|
|
529
|
+
<span class="cline-any cline-no"> </span>
|
|
530
530
|
<span class="cline-any cline-neutral"> </span>
|
|
531
531
|
<span class="cline-any cline-neutral"> </span>
|
|
532
|
-
<span class="cline-any cline-
|
|
532
|
+
<span class="cline-any cline-no"> </span>
|
|
533
533
|
<span class="cline-any cline-neutral"> </span>
|
|
534
534
|
<span class="cline-any cline-neutral"> </span>
|
|
535
535
|
<span class="cline-any cline-neutral"> </span>
|
|
536
536
|
<span class="cline-any cline-neutral"> </span>
|
|
537
537
|
<span class="cline-any cline-neutral"> </span>
|
|
538
|
-
<span class="cline-any cline-
|
|
538
|
+
<span class="cline-any cline-no"> </span>
|
|
539
539
|
<span class="cline-any cline-neutral"> </span>
|
|
540
|
-
<span class="cline-any cline-
|
|
541
|
-
<span class="cline-any cline-
|
|
540
|
+
<span class="cline-any cline-no"> </span>
|
|
541
|
+
<span class="cline-any cline-no"> </span>
|
|
542
542
|
<span class="cline-any cline-neutral"> </span>
|
|
543
543
|
<span class="cline-any cline-neutral"> </span>
|
|
544
|
-
<span class="cline-any cline-
|
|
544
|
+
<span class="cline-any cline-no"> </span>
|
|
545
545
|
<span class="cline-any cline-neutral"> </span>
|
|
546
546
|
<span class="cline-any cline-neutral"> </span>
|
|
547
547
|
<span class="cline-any cline-neutral"> </span>
|
|
548
|
-
<span class="cline-any cline-
|
|
549
|
-
<span class="cline-any cline-
|
|
550
|
-
<span class="cline-any cline-
|
|
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
551
|
<span class="cline-any cline-neutral"> </span>
|
|
552
|
-
<span class="cline-any cline-
|
|
552
|
+
<span class="cline-any cline-no"> </span>
|
|
553
553
|
<span class="cline-any cline-neutral"> </span>
|
|
554
554
|
<span class="cline-any cline-neutral"> </span>
|
|
555
555
|
<span class="cline-any cline-neutral"> </span>
|
|
556
556
|
<span class="cline-any cline-neutral"> </span>
|
|
557
|
-
<span class="cline-any cline-
|
|
557
|
+
<span class="cline-any cline-no"> </span>
|
|
558
558
|
<span class="cline-any cline-neutral"> </span>
|
|
559
|
-
<span class="cline-any cline-
|
|
559
|
+
<span class="cline-any cline-no"> </span>
|
|
560
560
|
<span class="cline-any cline-neutral"> </span>
|
|
561
561
|
<span class="cline-any cline-neutral"> </span>
|
|
562
562
|
<span class="cline-any cline-neutral"> </span>
|
|
563
563
|
<span class="cline-any cline-neutral"> </span>
|
|
564
|
-
<span class="cline-any cline-
|
|
564
|
+
<span class="cline-any cline-no"> </span>
|
|
565
565
|
<span class="cline-any cline-neutral"> </span>
|
|
566
|
-
<span class="cline-any cline-
|
|
566
|
+
<span class="cline-any cline-no"> </span>
|
|
567
567
|
<span class="cline-any cline-neutral"> </span>
|
|
568
|
-
<span class="cline-any cline-
|
|
568
|
+
<span class="cline-any cline-no"> </span>
|
|
569
569
|
<span class="cline-any cline-neutral"> </span>
|
|
570
570
|
<span class="cline-any cline-neutral"> </span>
|
|
571
571
|
<span class="cline-any cline-neutral"> </span>
|
|
572
572
|
<span class="cline-any cline-neutral"> </span>
|
|
573
|
-
<span class="cline-any cline-
|
|
573
|
+
<span class="cline-any cline-no"> </span>
|
|
574
574
|
<span class="cline-any cline-neutral"> </span>
|
|
575
|
-
<span class="cline-any cline-
|
|
576
|
-
<span class="cline-any cline-
|
|
575
|
+
<span class="cline-any cline-no"> </span>
|
|
576
|
+
<span class="cline-any cline-no"> </span>
|
|
577
577
|
<span class="cline-any cline-neutral"> </span>
|
|
578
|
-
<span class="cline-any cline-
|
|
579
|
-
<span class="cline-any cline-
|
|
580
|
-
<span class="cline-any cline-
|
|
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
581
|
<span class="cline-any cline-neutral"> </span>
|
|
582
|
-
<span class="cline-any cline-
|
|
582
|
+
<span class="cline-any cline-no"> </span>
|
|
583
583
|
<span class="cline-any cline-neutral"> </span>
|
|
584
|
-
<span class="cline-any cline-
|
|
585
|
-
<span class="cline-any cline-
|
|
584
|
+
<span class="cline-any cline-no"> </span>
|
|
585
|
+
<span class="cline-any cline-no"> </span>
|
|
586
586
|
<span class="cline-any cline-neutral"> </span>
|
|
587
587
|
<span class="cline-any cline-neutral"> </span>
|
|
588
|
-
<span class="cline-any cline-
|
|
589
|
-
<span class="cline-any cline-
|
|
590
|
-
<span class="cline-any cline-
|
|
591
|
-
<span class="cline-any cline-
|
|
592
|
-
<span class="cline-any cline-
|
|
593
|
-
<span class="cline-any cline-
|
|
594
|
-
<span class="cline-any cline-
|
|
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>
|
|
595
595
|
<span class="cline-any cline-neutral"> </span>
|
|
596
|
-
<span class="cline-any cline-
|
|
597
|
-
<span class="cline-any cline-
|
|
598
|
-
<span class="cline-any cline-
|
|
599
|
-
<span class="cline-any cline-
|
|
600
|
-
<span class="cline-any cline-
|
|
596
|
+
<span class="cline-any cline-no"> </span>
|
|
597
|
+
<span class="cline-any cline-no"> </span>
|
|
598
|
+
<span class="cline-any cline-no"> </span>
|
|
599
|
+
<span class="cline-any cline-no"> </span>
|
|
600
|
+
<span class="cline-any cline-no"> </span>
|
|
601
601
|
<span class="cline-any cline-neutral"> </span>
|
|
602
|
-
<span class="cline-any cline-
|
|
602
|
+
<span class="cline-any cline-no"> </span>
|
|
603
603
|
<span class="cline-any cline-neutral"> </span>
|
|
604
604
|
<span class="cline-any cline-neutral"> </span>
|
|
605
605
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -609,12 +609,12 @@
|
|
|
609
609
|
<span class="cline-any cline-neutral"> </span>
|
|
610
610
|
<span class="cline-any cline-neutral"> </span>
|
|
611
611
|
<span class="cline-any cline-neutral"> </span>
|
|
612
|
-
<span class="cline-any cline-
|
|
613
|
-
<span class="cline-any cline-
|
|
614
|
-
<span class="cline-any cline-
|
|
615
|
-
<span class="cline-any cline-
|
|
612
|
+
<span class="cline-any cline-no"> </span>
|
|
613
|
+
<span class="cline-any cline-no"> </span>
|
|
614
|
+
<span class="cline-any cline-no"> </span>
|
|
615
|
+
<span class="cline-any cline-no"> </span>
|
|
616
616
|
<span class="cline-any cline-neutral"> </span>
|
|
617
|
-
<span class="cline-any cline-
|
|
617
|
+
<span class="cline-any cline-no"> </span>
|
|
618
618
|
<span class="cline-any cline-neutral"> </span>
|
|
619
619
|
<span class="cline-any cline-neutral"> </span>
|
|
620
620
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -624,7 +624,7 @@
|
|
|
624
624
|
<span class="cline-any cline-neutral"> </span>
|
|
625
625
|
<span class="cline-any cline-neutral"> </span>
|
|
626
626
|
<span class="cline-any cline-neutral"> </span>
|
|
627
|
-
<span class="cline-any cline-
|
|
627
|
+
<span class="cline-any cline-no"> </span>
|
|
628
628
|
<span class="cline-any cline-neutral"> </span>
|
|
629
629
|
<span class="cline-any cline-neutral"> </span>
|
|
630
630
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -633,7 +633,7 @@
|
|
|
633
633
|
<span class="cline-any cline-neutral"> </span>
|
|
634
634
|
<span class="cline-any cline-neutral"> </span>
|
|
635
635
|
<span class="cline-any cline-neutral"> </span>
|
|
636
|
-
<span class="cline-any cline-
|
|
636
|
+
<span class="cline-any cline-no"> </span>
|
|
637
637
|
<span class="cline-any cline-neutral"> </span>
|
|
638
638
|
<span class="cline-any cline-neutral"> </span>
|
|
639
639
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -659,246 +659,246 @@
|
|
|
659
659
|
import { Ability, AbilityBuilder, toMongoQuery } from 'casl/dist/umd'
|
|
660
660
|
|
|
661
661
|
// Define some alias to simplify ability definitions
|
|
662
|
-
Ability.addAlias('update', 'patch')
|
|
663
|
-
Ability.addAlias('read', ['get', 'find'])
|
|
664
|
-
Ability.addAlias('remove', 'delete')
|
|
665
|
-
Ability.addAlias('all', ['read', 'create', 'update', 'remove'])
|
|
662
|
+
<span class="cstat-no" title="statement not covered" >Ability.addAlias('update', 'patch')</span>
|
|
663
|
+
<span class="cstat-no" title="statement not covered" >Ability.addAlias('read', ['get', 'find'])</span>
|
|
664
|
+
<span class="cstat-no" title="statement not covered" >Ability.addAlias('remove', 'delete')</span>
|
|
665
|
+
<span class="cstat-no" title="statement not covered" >Ability.addAlias('all', ['read', 'create', 'update', 'remove'])</span>
|
|
666
666
|
|
|
667
|
-
export const Roles = {
|
|
667
|
+
export const Roles = <span class="cstat-no" title="statement not covered" >{</span>
|
|
668
668
|
member: 0,
|
|
669
669
|
manager: 1,
|
|
670
670
|
owner: 2
|
|
671
671
|
}
|
|
672
672
|
|
|
673
|
-
export const RoleNames = [
|
|
673
|
+
export const RoleNames = <span class="cstat-no" title="statement not covered" >[</span>
|
|
674
674
|
'member',
|
|
675
675
|
'manager',
|
|
676
676
|
'owner'
|
|
677
677
|
]
|
|
678
678
|
|
|
679
|
-
export function <span class="fstat-no" title="function not covered" >isSeniorRole
|
|
680
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
679
|
+
export function <span class="fstat-no" title="function not covered" >isSeniorRole </span>(roleName, juniorName) {
|
|
680
|
+
<span class="cstat-no" title="statement not covered" > return Roles[roleName] >= Roles[juniorName]</span>
|
|
681
681
|
}
|
|
682
682
|
|
|
683
|
-
export function <span class="fstat-no" title="function not covered" >isJuniorRole
|
|
684
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
683
|
+
export function <span class="fstat-no" title="function not covered" >isJuniorRole </span>(roleName, seniorName) {
|
|
684
|
+
<span class="cstat-no" title="statement not covered" > return Roles[roleName] < Roles[seniorName]</span>
|
|
685
685
|
}
|
|
686
686
|
|
|
687
|
-
export function <span class="fstat-no" title="function not covered" >getSeniorRoles
|
|
687
|
+
export function <span class="fstat-no" title="function not covered" >getSeniorRoles </span>(roleName) {
|
|
688
688
|
const seniorRoles = <span class="cstat-no" title="statement not covered" >[]</span>
|
|
689
|
-
<span class="cstat-no" title="statement not covered" > _.
|
|
690
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
689
|
+
<span class="cstat-no" title="statement not covered" > _.forEach(Roles, <span class="fstat-no" title="function not covered" >ro</span>le => { <span class="cstat-no" title="statement not covered" >if (Roles[roleName] < role) <span class="cstat-no" title="statement not covered" >seniorRoles.push(RoleNames[role]) </span></span>})</span>
|
|
690
|
+
<span class="cstat-no" title="statement not covered" > return seniorRoles</span>
|
|
691
691
|
}
|
|
692
692
|
|
|
693
|
-
export function <span class="fstat-no" title="function not covered" >getJuniorRoles
|
|
693
|
+
export function <span class="fstat-no" title="function not covered" >getJuniorRoles </span>(roleName) {
|
|
694
694
|
const juniorRoles = <span class="cstat-no" title="statement not covered" >[]</span>
|
|
695
|
-
<span class="cstat-no" title="statement not covered" > _.
|
|
696
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
695
|
+
<span class="cstat-no" title="statement not covered" > _.forEach(Roles, <span class="fstat-no" title="function not covered" >ro</span>le => { <span class="cstat-no" title="statement not covered" >if (Roles[roleName] >= role) <span class="cstat-no" title="statement not covered" >juniorRoles.push(RoleNames[role]) </span></span>})</span>
|
|
696
|
+
<span class="cstat-no" title="statement not covered" > return juniorRoles</span>
|
|
697
697
|
}
|
|
698
698
|
|
|
699
699
|
// Hooks that can be added to customize abilities computation
|
|
700
|
-
let hooks = []
|
|
700
|
+
let hooks = <span class="cstat-no" title="statement not covered" >[]</span>
|
|
701
701
|
|
|
702
702
|
// Get the unique global symbol to store resource type / context on a resource object
|
|
703
|
-
export const RESOURCE_TYPE = 'type'
|
|
704
|
-
export const RESOURCE_TYPE_KEY = Symbol.for(RESOURCE_TYPE)
|
|
703
|
+
export const RESOURCE_TYPE = <span class="cstat-no" title="statement not covered" >'type'</span>
|
|
704
|
+
export const RESOURCE_TYPE_KEY = <span class="cstat-no" title="statement not covered" >Symbol.for(RESOURCE_TYPE)</span>
|
|
705
705
|
|
|
706
|
-
export function defineResourceRules (subject, resource, resourceService, can) {
|
|
707
|
-
const role = Roles[resource.permissions]
|
|
706
|
+
export function <span class="fstat-no" title="function not covered" >defineResourceRules </span>(subject, resource, resourceService, can) {
|
|
707
|
+
const role = <span class="cstat-no" title="statement not covered" >Roles[resource.permissions]</span>
|
|
708
708
|
|
|
709
|
-
|
|
710
|
-
can('read', resourceService, { _id: resource._id })
|
|
709
|
+
<span class="cstat-no" title="statement not covered" > if (role >= Roles.member) {</span>
|
|
710
|
+
<span class="cstat-no" title="statement not covered" > can('read', resourceService, { _id: resource._id })</span>
|
|
711
711
|
}
|
|
712
|
-
if (role >= Roles.manager) {
|
|
713
|
-
can('update', resourceService, { _id: resource._id })
|
|
714
|
-
can(['create', 'remove'], 'authorisations', { resource: resource._id })
|
|
712
|
+
<span class="cstat-no" title="statement not covered" > if (role >= Roles.manager) {</span>
|
|
713
|
+
<span class="cstat-no" title="statement not covered" > can('update', resourceService, { _id: resource._id })</span>
|
|
714
|
+
<span class="cstat-no" title="statement not covered" > can(['create', 'remove'], 'authorisations', { resource: resource._id })</span>
|
|
715
715
|
}
|
|
716
|
-
if (role >= Roles.owner) {
|
|
717
|
-
can('remove', resourceService, { _id: resource._id })
|
|
716
|
+
<span class="cstat-no" title="statement not covered" > if (role >= Roles.owner) {</span>
|
|
717
|
+
<span class="cstat-no" title="statement not covered" > can('remove', resourceService, { _id: resource._id })</span>
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
// Hook computing default abilities for a given user
|
|
722
|
-
export function defineUserAbilities (subject, can, cannot) {
|
|
722
|
+
export function <span class="fstat-no" title="function not covered" >defineUserAbilities </span>(subject, can, cannot) {
|
|
723
723
|
// Allow user registration
|
|
724
|
-
can('service', 'users')
|
|
725
|
-
can('create', 'users')
|
|
724
|
+
<span class="cstat-no" title="statement not covered" > can('service', 'users')</span>
|
|
725
|
+
<span class="cstat-no" title="statement not covered" > can('create', 'users')</span>
|
|
726
726
|
// Verification email, reset password, etc.
|
|
727
|
-
can('service', 'account')
|
|
728
|
-
can('create', 'account')
|
|
729
|
-
can('service', 'devices')
|
|
730
|
-
can('update', 'devices')
|
|
731
|
-
can('remove', 'devices')
|
|
727
|
+
<span class="cstat-no" title="statement not covered" > can('service', 'account')</span>
|
|
728
|
+
<span class="cstat-no" title="statement not covered" > can('create', 'account')</span>
|
|
729
|
+
<span class="cstat-no" title="statement not covered" > can('service', 'devices')</span>
|
|
730
|
+
<span class="cstat-no" title="statement not covered" > can('update', 'devices')</span>
|
|
731
|
+
<span class="cstat-no" title="statement not covered" > can('remove', 'devices')</span>
|
|
732
732
|
|
|
733
|
-
if (subject && subject._id) {
|
|
733
|
+
<span class="cstat-no" title="statement not covered" > if (subject && subject._id) {</span>
|
|
734
734
|
// Read user profiles for authorizing
|
|
735
|
-
can('read', 'users')
|
|
735
|
+
<span class="cstat-no" title="statement not covered" > can('read', 'users')</span>
|
|
736
736
|
// Update user profile and destroy it
|
|
737
|
-
can(['update', 'remove'], 'users', { _id: subject._id })
|
|
737
|
+
<span class="cstat-no" title="statement not covered" > can(['update', 'remove'], 'users', { _id: subject._id })</span>
|
|
738
738
|
// Access authorisation service, then rights will be granted on a per-resource basis
|
|
739
|
-
can('service', 'authorisations')
|
|
739
|
+
<span class="cstat-no" title="statement not covered" > can('service', 'authorisations')</span>
|
|
740
740
|
// Access storage service, then rights will be granted on a per-resource basis
|
|
741
|
-
can('service', 'storage')
|
|
741
|
+
<span class="cstat-no" title="statement not covered" > can('service', 'storage')</span>
|
|
742
742
|
// This is for the user avatar
|
|
743
743
|
// take care that the storage service uses 'id' as input but produces _id as output
|
|
744
|
-
can('create', 'storage', { id: 'avatars/' + subject._id.toString() })
|
|
745
|
-
can('create', 'storage', { id: 'avatars/' + subject._id.toString() + '.thumbnail' })
|
|
746
|
-
can('remove', 'storage', { _id: 'avatars/' + subject._id.toString() })
|
|
747
|
-
can('remove', 'storage', { _id: 'avatars/' + subject._id.toString() + '.thumbnail' })
|
|
744
|
+
<span class="cstat-no" title="statement not covered" > can('create', 'storage', { id: 'avatars/' + subject._id.toString() })</span>
|
|
745
|
+
<span class="cstat-no" title="statement not covered" > can('create', 'storage', { id: 'avatars/' + subject._id.toString() + '.thumbnail' })</span>
|
|
746
|
+
<span class="cstat-no" title="statement not covered" > can('remove', 'storage', { _id: 'avatars/' + subject._id.toString() })</span>
|
|
747
|
+
<span class="cstat-no" title="statement not covered" > can('remove', 'storage', { _id: 'avatars/' + subject._id.toString() + '.thumbnail' })</span>
|
|
748
748
|
// Avatar is part of user profiles so that they can be read by any
|
|
749
|
-
can('read', 'storage', { _id: { $regex: '^avatars/*' } })
|
|
749
|
+
<span class="cstat-no" title="statement not covered" > can('read', 'storage', { _id: { $regex: '^avatars/*' } })</span>
|
|
750
750
|
// Verification email, reset password, etc.
|
|
751
|
-
can('service', 'account')
|
|
752
|
-
can('create', 'account')
|
|
753
|
-
can('service', 'devices')
|
|
754
|
-
can('update', 'devices')
|
|
755
|
-
can('remove', 'devices')
|
|
751
|
+
<span class="cstat-no" title="statement not covered" > can('service', 'account')</span>
|
|
752
|
+
<span class="cstat-no" title="statement not covered" > can('create', 'account')</span>
|
|
753
|
+
<span class="cstat-no" title="statement not covered" > can('service', 'devices')</span>
|
|
754
|
+
<span class="cstat-no" title="statement not covered" > can('update', 'devices')</span>
|
|
755
|
+
<span class="cstat-no" title="statement not covered" > can('remove', 'devices')</span>
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
|
|
759
759
|
// Compute abilities for a given user
|
|
760
|
-
export async function defineAbilities (subject, ...args) {
|
|
761
|
-
const { rules, can, cannot } = AbilityBuilder.extract()
|
|
760
|
+
export async function <span class="fstat-no" title="function not covered" >defineAbilities </span>(subject, ...args) {
|
|
761
|
+
const { rules, can, cannot } = <span class="cstat-no" title="statement not covered" >AbilityBuilder.extract()</span>
|
|
762
762
|
|
|
763
763
|
// Run registered hooks providing any additional arguments used to handle complex use cases
|
|
764
|
-
await Promise.all(hooks.map(
|
|
765
|
-
await hook(subject, can, cannot, ...args)
|
|
764
|
+
<span class="cstat-no" title="statement not covered" > await Promise.all(hooks.map(<span class="fstat-no" title="function not covered" >as</span>ync hook => {</span>
|
|
765
|
+
<span class="cstat-no" title="statement not covered" > await hook(subject, can, cannot, ...args)</span>
|
|
766
766
|
}))
|
|
767
767
|
|
|
768
768
|
// CASL cannot infer the object type from the object itself so we need
|
|
769
769
|
// to tell it how he can find the object type, i.e. service name.
|
|
770
|
-
return new Ability(rules, {
|
|
771
|
-
subjectName:
|
|
772
|
-
if (!resource || typeof resource === 'string') {
|
|
773
|
-
return resource
|
|
770
|
+
<span class="cstat-no" title="statement not covered" > return new Ability(rules, {</span>
|
|
771
|
+
subjectName: <span class="fstat-no" title="function not covered" >re</span>source => {
|
|
772
|
+
<span class="cstat-no" title="statement not covered" > if (!resource || typeof resource === 'string') {</span>
|
|
773
|
+
<span class="cstat-no" title="statement not covered" > return resource</span>
|
|
774
774
|
}
|
|
775
|
-
return resource[RESOURCE_TYPE_KEY]
|
|
775
|
+
<span class="cstat-no" title="statement not covered" > return resource[RESOURCE_TYPE_KEY]</span>
|
|
776
776
|
}
|
|
777
777
|
})
|
|
778
778
|
}
|
|
779
779
|
|
|
780
|
-
defineAbilities.registerHook = function (hook) {
|
|
781
|
-
if (!hooks.includes(hook)) {
|
|
782
|
-
hooks.push(hook)
|
|
780
|
+
<span class="cstat-no" title="statement not covered" >defineAbilities.registerHook = <span class="fstat-no" title="function not covered" >fu</span>nction (hook) {</span>
|
|
781
|
+
<span class="cstat-no" title="statement not covered" > if (!hooks.includes(hook)) {</span>
|
|
782
|
+
<span class="cstat-no" title="statement not covered" > hooks.push(hook)</span>
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
|
|
786
|
-
defineAbilities.unregisterHook = <span class="fstat-no" title="function not covered" >
|
|
787
|
-
<span class="cstat-no" title="statement not covered" > hooks =
|
|
786
|
+
<span class="cstat-no" title="statement not covered" >defineAbilities.unregisterHook = <span class="fstat-no" title="function not covered" >fu</span>nction (hook) {</span>
|
|
787
|
+
<span class="cstat-no" title="statement not covered" > hooks = hooks.filter(<span class="fstat-no" title="function not covered" >re</span>gisteredHook => <span class="cstat-no" title="statement not covered" >registeredHook !== hook)</span></span>
|
|
788
788
|
}
|
|
789
789
|
|
|
790
|
-
export function hasServiceAbilities (abilities, service) {
|
|
791
|
-
|
|
790
|
+
export function <span class="fstat-no" title="function not covered" >hasServiceAbilities </span>(abilities, service) {
|
|
791
|
+
<span class="cstat-no" title="statement not covered" > if (!abilities) <span class="cstat-no" title="statement not covered" >return false</span></span>
|
|
792
792
|
// The unique identifier of a service is its path not its name.
|
|
793
793
|
// Indeed we have for instance a 'groups' service in each organisation
|
|
794
794
|
// Take care that in client we have the service path while on server we have the actual object
|
|
795
|
-
const path =
|
|
796
|
-
return abilities.can('service', path) || abilities.can('service', _.replace(path, /^.*\//, '*/'))
|
|
795
|
+
const path = <span class="cstat-no" title="statement not covered" >typeof service === 'string' ? service : service.getPath()</span>
|
|
796
|
+
<span class="cstat-no" title="statement not covered" > return abilities.can('service', path) || abilities.can('service', _.replace(path, /^.*\//, '*/'))</span>
|
|
797
797
|
}
|
|
798
798
|
|
|
799
|
-
export function hasResourceAbilities (abilities, operation, resourceType, context, resource) {
|
|
800
|
-
|
|
799
|
+
export function <span class="fstat-no" title="function not covered" >hasResourceAbilities </span>(abilities, operation, resourceType, context, resource) {
|
|
800
|
+
<span class="cstat-no" title="statement not covered" > if (!abilities) <span class="cstat-no" title="statement not covered" >return false</span></span>
|
|
801
801
|
// Create a shallow copy adding context and type
|
|
802
|
-
const object = Object.assign({}, resource)
|
|
803
|
-
object[RESOURCE_TYPE_KEY] = resourceType
|
|
802
|
+
const object = <span class="cstat-no" title="statement not covered" >Object.assign({}, resource)</span>
|
|
803
|
+
<span class="cstat-no" title="statement not covered" > object[RESOURCE_TYPE_KEY] = resourceType</span>
|
|
804
804
|
// Add a virtual context to take it into account for object having no link to it
|
|
805
|
-
if (context) object.context = (typeof context === 'object' ? context._id.toString() :
|
|
805
|
+
<span class="cstat-no" title="statement not covered" > if (context) <span class="cstat-no" title="statement not covered" >object.context = (typeof context === 'object' ? context._id.toString() : context.toString())</span></span>
|
|
806
806
|
|
|
807
|
-
const result = abilities.can(operation, object)
|
|
807
|
+
const result = <span class="cstat-no" title="statement not covered" >abilities.can(operation, object)</span>
|
|
808
808
|
|
|
809
|
-
return result
|
|
809
|
+
<span class="cstat-no" title="statement not covered" > return result</span>
|
|
810
810
|
}
|
|
811
811
|
|
|
812
812
|
// Utility function used to remove the virtual context from query
|
|
813
|
-
export function removeContext (query) {
|
|
814
|
-
_.forOwn(query, (
|
|
813
|
+
export function <span class="fstat-no" title="function not covered" >removeContext </span>(query) {
|
|
814
|
+
<span class="cstat-no" title="statement not covered" > _.forOwn(query, <span class="fstat-no" title="function not covered" >(v</span>alue, key) => {</span>
|
|
815
815
|
// Process current attributes or recurse
|
|
816
816
|
// Take care to nested fields like 'field._id'
|
|
817
|
-
if (key === 'context') {
|
|
818
|
-
delete query.context
|
|
819
|
-
} else if (Array.isArray(value)) {
|
|
820
|
-
value.forEach(
|
|
817
|
+
<span class="cstat-no" title="statement not covered" > if (key === 'context') {</span>
|
|
818
|
+
<span class="cstat-no" title="statement not covered" > delete query.context</span>
|
|
819
|
+
} else <span class="cstat-no" title="statement not covered" >if (Array.isArray(value)) {</span>
|
|
820
|
+
<span class="cstat-no" title="statement not covered" > value.forEach(<span class="fstat-no" title="function not covered" >it</span>em => <span class="cstat-no" title="statement not covered" >removeContext(item))</span></span>
|
|
821
821
|
// Remove empty objects from array
|
|
822
822
|
// _.remove(value, item => _.isEmpty(item))
|
|
823
823
|
// Remove empty arrays from query
|
|
824
|
-
|
|
825
|
-
} else if (typeof value === 'object') {
|
|
826
|
-
removeContext(value)
|
|
824
|
+
<span class="cstat-no" title="statement not covered" > if (_.isEmpty(value)) <span class="cstat-no" title="statement not covered" >delete query[key]</span></span>
|
|
825
|
+
} else <span class="cstat-no" title="statement not covered" >if (typeof value === 'object') {</span>
|
|
826
|
+
<span class="cstat-no" title="statement not covered" > removeContext(value)</span>
|
|
827
827
|
// Remove empty objects from query
|
|
828
|
-
|
|
828
|
+
<span class="cstat-no" title="statement not covered" > if (_.isEmpty(value)) <span class="cstat-no" title="statement not covered" >delete query[key]</span></span>
|
|
829
829
|
}
|
|
830
830
|
})
|
|
831
|
-
return query
|
|
831
|
+
<span class="cstat-no" title="statement not covered" > return query</span>
|
|
832
832
|
}
|
|
833
833
|
|
|
834
834
|
// Get the query used to filter the objects according to given abilities
|
|
835
835
|
// A null query indicates that access should not be granted
|
|
836
|
-
export function getQueryForAbilities (abilities, operation, resourceType) {
|
|
837
|
-
|
|
836
|
+
export function <span class="fstat-no" title="function not covered" >getQueryForAbilities </span>(abilities, operation, resourceType) {
|
|
837
|
+
<span class="cstat-no" title="statement not covered" > if (!abilities) <span class="cstat-no" title="statement not covered" >return null</span></span>
|
|
838
838
|
|
|
839
|
-
const rules = abilities.rulesFor(operation, resourceType)
|
|
840
|
-
const query = toMongoQuery(rules)
|
|
839
|
+
const rules = <span class="cstat-no" title="statement not covered" >abilities.rulesFor(operation, resourceType)</span>
|
|
840
|
+
const query = <span class="cstat-no" title="statement not covered" >toMongoQuery(rules)</span>
|
|
841
841
|
// Remove any context to avoid taking it into account because it is not really stored on objects
|
|
842
842
|
// We clone the object here because of references to the abilities rules (see https://github.com/kalisio/kdk/issues/384)
|
|
843
|
-
return (query ? removeContext(_.cloneDeep(query)) : null)
|
|
843
|
+
<span class="cstat-no" title="statement not covered" > return (query ? removeContext(_.cloneDeep(query)) : null)</span>
|
|
844
844
|
}
|
|
845
845
|
|
|
846
|
-
function buildSubjectsQueryForResource (resourceScope, resourceId, role) {
|
|
847
|
-
const query = { [resourceScope]: { $elemMatch: { _id: resourceId } } }
|
|
848
|
-
|
|
849
|
-
_.set(query[resourceScope], '$elemMatch.permissions', (typeof role === 'string' ?
|
|
846
|
+
function <span class="fstat-no" title="function not covered" >buildSubjectsQueryForResource </span>(resourceScope, resourceId, role) {
|
|
847
|
+
const query = <span class="cstat-no" title="statement not covered" >{ [resourceScope]: { $elemMatch: { _id: resourceId } } }</span>
|
|
848
|
+
<span class="cstat-no" title="statement not covered" > if (role) {</span>
|
|
849
|
+
<span class="cstat-no" title="statement not covered" > _.set(query[resourceScope], '$elemMatch.permissions', (typeof role === 'string' ? role : RoleNames[role]))</span>
|
|
850
850
|
}
|
|
851
|
-
return query
|
|
851
|
+
<span class="cstat-no" title="statement not covered" > return query</span>
|
|
852
852
|
}
|
|
853
853
|
|
|
854
|
-
export function findSubjectsForResource (subjectService, resourceScope, resourceId, role) {
|
|
854
|
+
export function <span class="fstat-no" title="function not covered" >findSubjectsForResource </span>(subjectService, resourceScope, resourceId, role) {
|
|
855
855
|
// Build the query
|
|
856
|
-
const query = buildSubjectsQueryForResource(resourceScope, resourceId, role)
|
|
856
|
+
const query = <span class="cstat-no" title="statement not covered" >buildSubjectsQueryForResource(resourceScope, resourceId, role)</span>
|
|
857
857
|
// Execute the query
|
|
858
|
-
return subjectService.find({ query })
|
|
858
|
+
<span class="cstat-no" title="statement not covered" > return subjectService.find({ query })</span>
|
|
859
859
|
}
|
|
860
860
|
|
|
861
|
-
export function countSubjectsForResource (subjectService, resourceScope, resourceId, role) {
|
|
861
|
+
export function <span class="fstat-no" title="function not covered" >countSubjectsForResource </span>(subjectService, resourceScope, resourceId, role) {
|
|
862
862
|
// Build the query
|
|
863
|
-
const query = buildSubjectsQueryForResource(resourceScope, resourceId, role)
|
|
863
|
+
const query = <span class="cstat-no" title="statement not covered" >buildSubjectsQueryForResource(resourceScope, resourceId, role)</span>
|
|
864
864
|
// Indicate we'd only like to count
|
|
865
|
-
query.$limit = 0
|
|
865
|
+
<span class="cstat-no" title="statement not covered" > query.$limit = 0</span>
|
|
866
866
|
// Execute the query
|
|
867
|
-
return subjectService.find({ query })
|
|
867
|
+
<span class="cstat-no" title="statement not covered" > return subjectService.find({ query })</span>
|
|
868
868
|
}
|
|
869
869
|
|
|
870
870
|
// Hook computing organisation abilities for a given user
|
|
871
|
-
export function defineOrganisationAbilities (subject, can, cannot) {
|
|
872
|
-
if (subject) {
|
|
871
|
+
export function <span class="fstat-no" title="function not covered" >defineOrganisationAbilities </span>(subject, can, cannot) {
|
|
872
|
+
<span class="cstat-no" title="statement not covered" > if (subject) {</span>
|
|
873
873
|
// Create new organisations
|
|
874
|
-
can('service', 'organisations')
|
|
875
|
-
can('create', 'organisations')
|
|
874
|
+
<span class="cstat-no" title="statement not covered" > can('service', 'organisations')</span>
|
|
875
|
+
<span class="cstat-no" title="statement not covered" > can('create', 'organisations')</span>
|
|
876
876
|
|
|
877
|
-
|
|
878
|
-
subject.organisations.forEach(
|
|
879
|
-
|
|
877
|
+
<span class="cstat-no" title="statement not covered" > if (subject.organisations) {</span>
|
|
878
|
+
<span class="cstat-no" title="statement not covered" > subject.organisations.forEach(<span class="fstat-no" title="function not covered" >or</span>ganisation => {</span>
|
|
879
|
+
<span class="cstat-no" title="statement not covered" > if (organisation._id) {</span>
|
|
880
880
|
// Generic rules for resources
|
|
881
|
-
defineResourceRules(subject, organisation, 'organisations', can)
|
|
881
|
+
<span class="cstat-no" title="statement not covered" > defineResourceRules(subject, organisation, 'organisations', can)</span>
|
|
882
882
|
// Specific rules for organisations
|
|
883
|
-
const role = Roles[organisation.permissions]
|
|
884
|
-
|
|
883
|
+
const role = <span class="cstat-no" title="statement not covered" >Roles[organisation.permissions]</span>
|
|
884
|
+
<span class="cstat-no" title="statement not covered" > if (role >= Roles.member) {</span>
|
|
885
885
|
// The unique identifier of a service is its path not its name.
|
|
886
886
|
// Indeed we have for instance a 'groups' service in each organisation.
|
|
887
|
-
can('service', organisation._id.toString() + '/members')
|
|
888
|
-
can('read', 'members', { context: organisation._id })
|
|
889
|
-
can('service', organisation._id.toString() + '/tags')
|
|
890
|
-
can('read', 'tags', { context: organisation._id })
|
|
891
|
-
can('service', organisation._id.toString() + '/groups')
|
|
892
|
-
can('service', organisation._id.toString() + '/storage')
|
|
893
|
-
can(['read', 'create', 'remove'], 'storage', { context: organisation._id })
|
|
887
|
+
<span class="cstat-no" title="statement not covered" > can('service', organisation._id.toString() + '/members')</span>
|
|
888
|
+
<span class="cstat-no" title="statement not covered" > can('read', 'members', { context: organisation._id })</span>
|
|
889
|
+
<span class="cstat-no" title="statement not covered" > can('service', organisation._id.toString() + '/tags')</span>
|
|
890
|
+
<span class="cstat-no" title="statement not covered" > can('read', 'tags', { context: organisation._id })</span>
|
|
891
|
+
<span class="cstat-no" title="statement not covered" > can('service', organisation._id.toString() + '/groups')</span>
|
|
892
|
+
<span class="cstat-no" title="statement not covered" > can('service', organisation._id.toString() + '/storage')</span>
|
|
893
|
+
<span class="cstat-no" title="statement not covered" > can(['read', 'create', 'remove'], 'storage', { context: organisation._id })</span>
|
|
894
894
|
}
|
|
895
|
-
if (role >= Roles.manager) {
|
|
896
|
-
can('update', 'members', { context: organisation._id })
|
|
897
|
-
can('update', 'tags', { context: organisation._id })
|
|
898
|
-
can('create', 'groups', { context: organisation._id })
|
|
899
|
-
can(['create', 'remove'], 'tags', { context: organisation._id })
|
|
895
|
+
<span class="cstat-no" title="statement not covered" > if (role >= Roles.manager) {</span>
|
|
896
|
+
<span class="cstat-no" title="statement not covered" > can('update', 'members', { context: organisation._id })</span>
|
|
897
|
+
<span class="cstat-no" title="statement not covered" > can('update', 'tags', { context: organisation._id })</span>
|
|
898
|
+
<span class="cstat-no" title="statement not covered" > can('create', 'groups', { context: organisation._id })</span>
|
|
899
|
+
<span class="cstat-no" title="statement not covered" > can(['create', 'remove'], 'tags', { context: organisation._id })</span>
|
|
900
900
|
// Remove invited members
|
|
901
|
-
can(['remove'], 'users', { 'sponsor.organisationId': organisation._id })
|
|
901
|
+
<span class="cstat-no" title="statement not covered" > can(['remove'], 'users', { 'sponsor.organisationId': organisation._id })</span>
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
904
|
})
|
|
@@ -907,13 +907,13 @@ export function defineOrganisationAbilities (subject, can, cannot) {
|
|
|
907
907
|
}
|
|
908
908
|
|
|
909
909
|
// Hook computing group abilities for a given user
|
|
910
|
-
export function defineGroupAbilities (subject, can, cannot) {
|
|
911
|
-
if (subject) {
|
|
912
|
-
if (subject.groups) {
|
|
913
|
-
subject.groups.forEach(
|
|
914
|
-
|
|
910
|
+
export function <span class="fstat-no" title="function not covered" >defineGroupAbilities </span>(subject, can, cannot) {
|
|
911
|
+
<span class="cstat-no" title="statement not covered" > if (subject) {</span>
|
|
912
|
+
<span class="cstat-no" title="statement not covered" > if (subject.groups) {</span>
|
|
913
|
+
<span class="cstat-no" title="statement not covered" > subject.groups.forEach(<span class="fstat-no" title="function not covered" >gr</span>oup => {</span>
|
|
914
|
+
<span class="cstat-no" title="statement not covered" > if (group._id) {</span>
|
|
915
915
|
// Generic rules for resources
|
|
916
|
-
defineResourceRules(subject, group, 'groups', can)
|
|
916
|
+
<span class="cstat-no" title="statement not covered" > defineResourceRules(subject, group, 'groups', can)</span>
|
|
917
917
|
// No specific rules for groups
|
|
918
918
|
}
|
|
919
919
|
})
|
|
@@ -922,37 +922,37 @@ export function defineGroupAbilities (subject, can, cannot) {
|
|
|
922
922
|
}
|
|
923
923
|
|
|
924
924
|
// Helper functions to find the members of a given organisation
|
|
925
|
-
export function findMembersOfOrganisation (usersService, organisationId, role) {
|
|
926
|
-
return findSubjectsForResource(usersService, 'organisations', organisationId, role)
|
|
925
|
+
export function <span class="fstat-no" title="function not covered" >findMembersOfOrganisation </span>(usersService, organisationId, role) {
|
|
926
|
+
<span class="cstat-no" title="statement not covered" > return findSubjectsForResource(usersService, 'organisations', organisationId, role)</span>
|
|
927
927
|
}
|
|
928
928
|
|
|
929
|
-
export function <span class="fstat-no" title="function not covered" >countMembersOfOrganisation
|
|
930
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
929
|
+
export function <span class="fstat-no" title="function not covered" >countMembersOfOrganisation </span>(usersService, organisationId, role) {
|
|
930
|
+
<span class="cstat-no" title="statement not covered" > return countSubjectsForResource(usersService, 'organisations', organisationId, role)</span>
|
|
931
931
|
}
|
|
932
932
|
|
|
933
933
|
// Helper functions to find the members of a given group
|
|
934
|
-
export function findMembersOfGroup (membersService, groupId, role) {
|
|
935
|
-
return findSubjectsForResource(membersService, 'groups', groupId, role)
|
|
934
|
+
export function <span class="fstat-no" title="function not covered" >findMembersOfGroup </span>(membersService, groupId, role) {
|
|
935
|
+
<span class="cstat-no" title="statement not covered" > return findSubjectsForResource(membersService, 'groups', groupId, role)</span>
|
|
936
936
|
}
|
|
937
937
|
|
|
938
|
-
export function <span class="fstat-no" title="function not covered" >countMembersOfGroup
|
|
939
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
938
|
+
export function <span class="fstat-no" title="function not covered" >countMembersOfGroup </span>(membersService, groupId, role) {
|
|
939
|
+
<span class="cstat-no" title="statement not covered" > return countSubjectsForResource(membersService, 'groups', groupId, role)</span>
|
|
940
940
|
}
|
|
941
941
|
|
|
942
|
-
export function <span class="fstat-no" title="function not covered" >getRoleForOrganisation
|
|
943
|
-
const result = <span class="cstat-no" title="statement not covered" >_.
|
|
944
|
-
<span class="cstat-no" title="statement not covered" > if (!_.isUndefined(result)) <span class="cstat-no" title="statement not covered" >return
|
|
945
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
942
|
+
export function <span class="fstat-no" title="function not covered" >getRoleForOrganisation </span>(user, organisationId) {
|
|
943
|
+
const result = <span class="cstat-no" title="statement not covered" >_.find(user.organisations, { _id: organisationId })</span>
|
|
944
|
+
<span class="cstat-no" title="statement not covered" > if (!_.isUndefined(result)) <span class="cstat-no" title="statement not covered" >return result.permissions</span></span>
|
|
945
|
+
<span class="cstat-no" title="statement not covered" > return undefined</span>
|
|
946
946
|
}
|
|
947
947
|
|
|
948
|
-
export function <span class="fstat-no" title="function not covered" >getRoleForGroup
|
|
949
|
-
const result = <span class="cstat-no" title="statement not covered" >_.
|
|
950
|
-
<span class="cstat-no" title="statement not covered" > if (!_.isUndefined(result)) <span class="cstat-no" title="statement not covered" >return
|
|
951
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
948
|
+
export function <span class="fstat-no" title="function not covered" >getRoleForGroup </span>(user, organisationId, groupId) {
|
|
949
|
+
const result = <span class="cstat-no" title="statement not covered" >_.find(user.groups, { context: organisationId, _id: groupId })</span>
|
|
950
|
+
<span class="cstat-no" title="statement not covered" > if (!_.isUndefined(result)) <span class="cstat-no" title="statement not covered" >return result.permissions</span></span>
|
|
951
|
+
<span class="cstat-no" title="statement not covered" > return undefined</span>
|
|
952
952
|
}
|
|
953
953
|
|
|
954
|
-
export function <span class="fstat-no" title="function not covered" >findGroupsWithRole
|
|
955
|
-
<span class="cstat-no" title="statement not covered" > return _
|
|
954
|
+
export function <span class="fstat-no" title="function not covered" >findGroupsWithRole </span>(user, organisationId, role) {
|
|
955
|
+
<span class="cstat-no" title="statement not covered" > return _.filter(user.groups || [], { context: organisationId, permissions: (typeof role === 'string' ? role : RoleNames[role]) })</span>
|
|
956
956
|
}
|
|
957
957
|
</pre></td></tr></table></pre>
|
|
958
958
|
|
|
@@ -961,7 +961,7 @@ export function <span class="fstat-no" title="function not covered" >findGroupsW
|
|
|
961
961
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
962
962
|
Code coverage generated by
|
|
963
963
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
964
|
-
at
|
|
964
|
+
at Fri Jan 07 2022 19:29:56 GMT+0100 (GMT+01:00)
|
|
965
965
|
</div>
|
|
966
966
|
</div>
|
|
967
967
|
<script src="../../prettify.js"></script>
|