@kalisio/kdk 2.6.2 → 2.6.3
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/client/css/core.variables.scss +72 -0
- package/client/i18n/core_en.json +744 -0
- package/client/i18n/core_fr.json +744 -0
- package/client/i18n/map_en.json +800 -0
- package/client/i18n/map_fr.json +800 -0
- package/client/kdk.client.css +47 -0
- package/client/kdk.client.js +41097 -0
- package/client/kdk.client.map.css +47 -0
- package/client/kdk.client.map.js +38182 -0
- package/client/kdk.client.map.min.css +1 -0
- package/client/kdk.client.map.min.js +27032 -0
- package/client/kdk.client.min.css +1 -0
- package/client/kdk.client.min.js +29074 -0
- package/client/schemas/capture.create.json +132 -0
- package/client/schemas/catalog.update.json +44 -0
- package/client/schemas/messages.update.json +16 -0
- package/client/schemas/projects.create.json +52 -0
- package/client/schemas/projects.update.json +52 -0
- package/client/schemas/settings.update.json +286 -0
- package/client/schemas/tags.update.json +35 -0
- package/client/schemas/users.update-profile.json +34 -0
- package/core/api/authentication.js +13 -1
- package/core/api/hooks/hooks.query.js +9 -0
- package/core/client/capabilities.js +6 -1
- package/core/client/components/KChip.vue +27 -6
- package/core/client/components/collection/KCard.vue +2 -2
- package/core/client/utils/utils.session.js +5 -1
- 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 +112 -97
- package/coverage/core/api/hooks/hooks.query.js.html +270 -222
- 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/{groups/groups.hooks.js.html → configurations/configurations.hooks.js.html} +16 -10
- package/coverage/{lcov-report/core/api/services/groups → core/api/services/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 +112 -97
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +270 -222
- 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/{core/api/services/groups → lcov-report/core/api/services/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 +32 -32
- package/coverage/lcov-report/map/api/hooks/index.html +5 -5
- 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/{core/api/services/organisations/organisations.hooks.js.html → lcov-report/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 +4172 -3909
- 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 +32 -32
- package/coverage/map/api/hooks/index.html +5 -5
- 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/{lcov-report/core/api/services/organisations/organisations.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-222524-1765963609350-0.json +1 -0
- package/coverage/tmp/coverage-222536-1765963609335-0.json +1 -0
- package/coverage/tmp/coverage-222547-1765963609324-0.json +1 -0
- package/coverage/tmp/coverage-222559-1765963609309-0.json +1 -0
- package/coverage/tmp/coverage-222566-1765963609278-0.json +1 -0
- package/map/api/hooks/hooks.query.js +60 -0
- package/map/client/components/stickies/KZoomControl.vue +17 -9
- package/map/client/i18n/map_en.json +6 -0
- package/map/client/i18n/map_fr.json +6 -0
- package/map/client/mixins/map/mixin.base-map.js +19 -1
- package/package.json +2 -2
- package/scripts/kash/CHANGELOG.md +4 -0
- package/scripts/kash/LICENSE +21 -0
- package/scripts/kash/README.md +9 -0
- package/scripts/kash/kash.sh +40 -45
- package/scripts/kash/scripts/run_tests.sh +4 -1
- package/test/api/core/config/default.cjs +1 -0
- package/test/api/core/test-log-2025-07-31.log +15 -0
- package/test/api/core/{test-log-2024-04-23.log → test-log-2025-10-03.log} +4 -9
- package/test/api/core/test-log-2025-11-12.log +117 -0
- package/test/api/core/test-log-2025-11-27.log +0 -0
- package/test/api/core/test-log-2025-11-28.log +17 -0
- package/test/api/core/test-log-2025-12-09.log +148 -0
- package/test/api/core/test-log-2025-12-17.log +58 -0
- package/test/api/core/test-log-2026-01-29.log +17 -0
- package/test/api/map/index.test.js +21 -0
- package/test/api/map/test-log-2025-07-23.log +1 -0
- package/test/api/map/test-log-2025-11-28.log +33 -0
- package/test/api/map/test-log-2025-12-10.log +2 -0
- package/test/api/map/test-log-2026-01-06.log +26 -0
- package/.vscode/settings.json +0 -5
- 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/test/api/core/test-log-2024-04-22.log +0 -84
- package/test/api/core/test-log-2024-08-13.log +0 -3
- /package/test/api/{map/test-log-2025-03-08.log → core/test-log-2025-11-10.log} +0 -0
|
@@ -30,6 +30,16 @@ export class Authentication extends AuthenticationService {
|
|
|
30
30
|
return {}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
// Similarly the subject will not be set by Feathers for stateless tokens that do not target existing users.
|
|
35
|
+
async getTokenOptions (authResult, params) {
|
|
36
|
+
const jwtOptions = await super.getTokenOptions(authResult, params)
|
|
37
|
+
if (!jwtOptions.subject) {
|
|
38
|
+
const subject = _.get(authResult, 'authentication.payload.sub')
|
|
39
|
+
if (subject) jwtOptions.subject = subject
|
|
40
|
+
}
|
|
41
|
+
return jwtOptions
|
|
42
|
+
}
|
|
33
43
|
}
|
|
34
44
|
|
|
35
45
|
export class AuthenticationProviderStrategy extends OAuthStrategy {
|
|
@@ -105,6 +115,7 @@ export class JWTAuthenticationStrategy extends JWTStrategy {
|
|
|
105
115
|
const { identityFields } = authConfig
|
|
106
116
|
const { entity } = this.configuration
|
|
107
117
|
const renewJwt = _.get(this.configuration, 'renewJwt', true)
|
|
118
|
+
const { provider, ...paramsWithoutProvider } = params
|
|
108
119
|
|
|
109
120
|
if (!accessToken) {
|
|
110
121
|
throw new NotAuthenticated('No access token')
|
|
@@ -142,7 +153,8 @@ export class JWTAuthenticationStrategy extends JWTStrategy {
|
|
|
142
153
|
$or: _.reduce(identityFields, (or, field) => or.concat([{ [field]: payload.sub }]), []),
|
|
143
154
|
$limit: 1
|
|
144
155
|
}
|
|
145
|
-
|
|
156
|
+
// Avoid sending provider to internal call as it might raises some issues with hooks relying on it otherwise
|
|
157
|
+
const response = await this.entityService.find({ ...paramsWithoutProvider, query })
|
|
146
158
|
const [value = null] = response.data ? response.data : response
|
|
147
159
|
// Otherwise assume a stateless token
|
|
148
160
|
if (value) {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import _ from 'lodash'
|
|
2
2
|
import { marshallComparisonFields, marshallTime, marshallBooleanFields, marshallNumberFields, marshallDateFields } from '../marshall.js'
|
|
3
3
|
import mongodb from 'mongodb'
|
|
4
|
+
import errors from '@feathersjs/errors'
|
|
4
5
|
import makeDebug from 'debug'
|
|
5
6
|
import { makeDiacriticPattern } from '../../common/utils.js'
|
|
6
7
|
|
|
7
8
|
const { ObjectID } = mongodb
|
|
9
|
+
const { Forbidden } = errors
|
|
8
10
|
const debug = makeDebug('kdk:core:query:hooks')
|
|
9
11
|
|
|
10
12
|
export function marshallTimeQuery (hook) {
|
|
@@ -59,10 +61,17 @@ export function marshallHttpQuery (hook) {
|
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
export async function aggregationQuery (hook) {
|
|
64
|
+
if (hook.type !== 'before') {
|
|
65
|
+
throw new Error('The \'aggregationQuery\' hook should only be used as a \'before\' hook.')
|
|
66
|
+
}
|
|
62
67
|
const query = hook.params.query
|
|
63
68
|
if (!query) return
|
|
64
69
|
const service = hook.service
|
|
65
70
|
if (query.$aggregation) {
|
|
71
|
+
// Generic aggregation request could allow to disclose or update information in DB so that it should only be used through controlled internal calls
|
|
72
|
+
if (hook.params.provider) {
|
|
73
|
+
throw new Forbidden('You are not allowed to perform aggregation')
|
|
74
|
+
}
|
|
66
75
|
const collection = service.Model
|
|
67
76
|
// Set result to avoid service DB call
|
|
68
77
|
hook.result = await collection.aggregate(query.$aggregation.pipeline, query.$aggregation.options).toArray()
|
|
@@ -17,7 +17,12 @@ export const Capabilities = {
|
|
|
17
17
|
const capabilities = await window.fetch(api.getConfig('domain') + _.get(config, 'apiPath') + '/capabilities')
|
|
18
18
|
this.content = await capabilities.json()
|
|
19
19
|
// Store latest capabilities data for offline mode
|
|
20
|
-
|
|
20
|
+
// Avoid blocking on eg QuotaExceededError
|
|
21
|
+
try {
|
|
22
|
+
await LocalCache.setItem('capabilities', this.content)
|
|
23
|
+
} catch (error) {
|
|
24
|
+
logger.error(error)
|
|
25
|
+
}
|
|
21
26
|
}
|
|
22
27
|
logger.debug('[KDK] Capabilities initialized with content:', this.content)
|
|
23
28
|
if (!this.content) return
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<q-chip
|
|
3
3
|
v-model="computedState"
|
|
4
4
|
:selected="selected"
|
|
5
|
-
:icon="
|
|
5
|
+
:icon="computedIcon"
|
|
6
6
|
:iconRight="iconRight"
|
|
7
7
|
:iconRemove="iconRemove"
|
|
8
8
|
:iconSelected="iconSelected"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
@click="event => emit('click', event)"
|
|
18
18
|
class="k-chip"
|
|
19
19
|
>
|
|
20
|
-
<div v-if="computedLabel"
|
|
20
|
+
<div v-if="!hideLabel && computedLabel"
|
|
21
21
|
:id="id"
|
|
22
22
|
class="ellipsis"
|
|
23
23
|
:class="{ 'q-pl-sm': !dense && (icon || isTruncated ) , 'q-pl-xs': dense && (icon || isTruncated) }"
|
|
@@ -46,10 +46,21 @@ const props = defineProps({
|
|
|
46
46
|
type: [String, Number],
|
|
47
47
|
default: ''
|
|
48
48
|
},
|
|
49
|
+
hideLabel: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
},
|
|
49
53
|
tooltip: {
|
|
50
54
|
type: String,
|
|
51
55
|
default: undefined
|
|
52
56
|
},
|
|
57
|
+
tooltipBehavior: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: 'truncated',
|
|
60
|
+
validator: (value) => {
|
|
61
|
+
return ['always', 'truncated', 'never'].includes(value)
|
|
62
|
+
}
|
|
63
|
+
},
|
|
53
64
|
icon: {
|
|
54
65
|
type: String,
|
|
55
66
|
default: undefined
|
|
@@ -66,6 +77,10 @@ const props = defineProps({
|
|
|
66
77
|
type: String,
|
|
67
78
|
default: 'check'
|
|
68
79
|
},
|
|
80
|
+
hideIcon: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false
|
|
83
|
+
},
|
|
69
84
|
modelValue: {
|
|
70
85
|
type: Boolean,
|
|
71
86
|
default: true
|
|
@@ -129,11 +144,17 @@ const computedState = computed({
|
|
|
129
144
|
}
|
|
130
145
|
})
|
|
131
146
|
const computedLabel = computed(() => {
|
|
132
|
-
return i18n.tie(props.label)
|
|
147
|
+
if (!props.hideLabel && props.label) return i18n.tie(props.label)
|
|
148
|
+
})
|
|
149
|
+
const computedIcon = computed(() => {
|
|
150
|
+
if (!props.hideIcon) return props.icon
|
|
133
151
|
})
|
|
134
152
|
const computedTooltip = computed(() => {
|
|
135
|
-
if (props.
|
|
136
|
-
if (props.
|
|
153
|
+
if (props.tooltipBehavior === 'never') return
|
|
154
|
+
if (props.tooltipBehavior === 'truncated') {
|
|
155
|
+
if (!isTruncated.value) return
|
|
156
|
+
}
|
|
157
|
+
return props.label ? i18n.tie(props.label) : props.tooltip
|
|
137
158
|
})
|
|
138
159
|
const computedColor = computed(() => {
|
|
139
160
|
return props.outline ? 'transparent' : getHtmlColor(props.color)
|
|
@@ -153,7 +174,7 @@ const computedBorderColor = computed(() => {
|
|
|
153
174
|
function onResize () {
|
|
154
175
|
// check whether the label is truncated
|
|
155
176
|
const chipElement = document.getElementById(id)
|
|
156
|
-
if (chipElement) isTruncated.value = (chipElement && chipElement.offsetWidth < chipElement.scrollWidth)
|
|
177
|
+
if (chipElement) isTruncated.value = (chipElement && (chipElement.offsetWidth < chipElement.scrollWidth))
|
|
157
178
|
}
|
|
158
179
|
</script>
|
|
159
180
|
|
|
@@ -163,10 +163,10 @@ export default {
|
|
|
163
163
|
computedSections () {
|
|
164
164
|
return _.map(this.sections, (value, key) => {
|
|
165
165
|
return {
|
|
166
|
-
...value,
|
|
167
166
|
item: this.item,
|
|
168
167
|
actions: _.filter(this.itemActions, { scope: key }),
|
|
169
|
-
dense: this.dense
|
|
168
|
+
dense: this.dense,
|
|
169
|
+
...value
|
|
170
170
|
}
|
|
171
171
|
})
|
|
172
172
|
},
|
|
@@ -11,7 +11,11 @@ async function authenticate(authentication) {
|
|
|
11
11
|
let user = Store.get('user')
|
|
12
12
|
if (user) return
|
|
13
13
|
// Store latest authentication data for offline mode
|
|
14
|
-
|
|
14
|
+
try {
|
|
15
|
+
await LocalCache.setItem('authentication', authentication)
|
|
16
|
+
} catch (error) {
|
|
17
|
+
logger.error(error)
|
|
18
|
+
}
|
|
15
19
|
// Anonymous user or user account ?
|
|
16
20
|
user = authentication.user ? authentication.user : { name: i18n.t('composables.ANONYMOUS'), anonymous: true }
|
|
17
21
|
Store.set('user', user)
|