@kalisio/kdk 2.6.3 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/api/application.js +2 -4
- package/core/api/authentication.js +2 -3
- package/core/api/db.js +10 -2
- package/core/api/hooks/hooks.authorisations.js +4 -2
- package/core/api/hooks/hooks.push.js +6 -2
- package/core/api/hooks/hooks.query.js +29 -12
- package/core/api/hooks/hooks.users.js +30 -17
- package/core/api/models/configurations.model.mongodb.js +4 -0
- package/core/api/services/authorisations/authorisations.service.js +1 -1
- package/core/api/services/configurations/configurations.hooks.js +33 -0
- package/core/api/services/index.js +41 -7
- package/core/api/services/messages/messages.hooks.js +9 -3
- package/core/client/api.js +14 -1
- package/core/client/capabilities.js +1 -6
- package/core/client/components/KAvatar.vue +24 -20
- package/core/client/components/account/KProfile.vue +10 -71
- package/core/client/components/account/index.js +0 -2
- package/core/client/components/app/KSettings.vue +1 -0
- package/core/client/components/collection/KBoard.vue +4 -3
- package/core/client/components/collection/KCardSection.vue +1 -0
- package/core/client/components/collection/KGrid.vue +2 -0
- package/core/client/components/collection/KTable.vue +5 -1
- package/core/client/components/collection/KTimeLine.vue +9 -1
- package/core/client/components/collection/index.js +0 -2
- package/core/client/components/form/KChipsField.vue +2 -1
- package/core/client/components/form/KEmailField.vue +1 -0
- package/core/client/components/form/KFileField.vue +22 -1
- package/core/client/components/form/KForm.vue +2 -0
- package/core/client/components/form/KItemField.vue +1 -0
- package/core/client/components/form/KNumberField.vue +1 -0
- package/core/client/components/form/KPasswordField.vue +1 -0
- package/core/client/components/form/KPhoneField.vue +1 -0
- package/core/client/components/form/KPropertyItemField.vue +1 -0
- package/core/client/components/form/KResolutionField.vue +1 -0
- package/core/client/components/form/KSelectField.vue +31 -0
- package/core/client/components/form/KTagField.vue +1 -0
- package/core/client/components/form/KTextField.vue +1 -0
- package/core/client/components/form/KTokenField.vue +1 -0
- package/core/client/components/form/KUnitField.vue +1 -0
- package/core/client/components/form/KUrlField.vue +1 -0
- package/core/client/components/graphics/KIcon.vue +3 -4
- package/core/client/components/layout/KPage.vue +1 -0
- package/core/client/components/layout/KWindow.vue +6 -3
- package/core/client/components/messages/KMessageComposer.vue +2 -1
- package/core/client/components/messages/KMessagesTimeLine.vue +1 -1
- package/core/client/components/time/KDate.vue +1 -2
- package/core/client/components/time/KDateTime.vue +11 -11
- package/core/client/components/time/KTime.vue +1 -1
- package/core/client/composables/collection.js +33 -8
- package/core/client/composables/errors.js +1 -1
- package/core/client/composables/layout.js +9 -9
- package/core/client/configurations.js +50 -0
- package/core/client/exporter.js +1 -1
- package/core/client/i18n/core_en.json +6 -39
- package/core/client/i18n/core_fr.json +6 -39
- package/core/client/index.js +2 -0
- package/core/client/layout.js +8 -8
- package/core/client/mixins/mixin.base-activity.js +5 -2
- package/core/client/mixins/mixin.base-field.js +3 -3
- package/core/client/search.js +2 -1
- package/core/client/utils/utils.collection.js +8 -8
- package/core/client/utils/utils.items.js +4 -0
- package/core/client/utils/utils.push.js +3 -3
- package/core/client/utils/utils.session.js +7 -5
- package/core/client/utils/utils.shapes.js +38 -7
- package/core/client/utils/utils.time.js +21 -22
- package/core/common/schemas/users.update-profile.json +3 -2
- package/coverage/core/api/application.js.html +1 -1
- package/coverage/core/api/authentication.js.html +1 -1
- package/coverage/core/api/db.js.html +1 -1
- package/coverage/core/api/hooks/hooks.authentication.js.html +1 -1
- package/coverage/core/api/hooks/hooks.authorisations.js.html +1 -1
- package/coverage/core/api/hooks/hooks.logger.js.html +1 -1
- package/coverage/core/api/hooks/hooks.model.js.html +1 -1
- package/coverage/core/api/hooks/hooks.push.js.html +22 -10
- package/coverage/core/api/hooks/hooks.query.js.html +33 -6
- package/coverage/core/api/hooks/hooks.schemas.js.html +1 -1
- 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.tags.js.html +1 -1
- package/coverage/core/api/hooks/hooks.users.js.html +4 -4
- package/coverage/core/api/hooks/index.html +23 -23
- package/coverage/core/api/hooks/index.js.html +1 -1
- package/coverage/core/api/index.html +1 -1
- package/coverage/core/api/index.js.html +1 -1
- package/coverage/core/api/marshall.js.html +1 -1
- package/coverage/core/api/models/configurations.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/index.html +1 -1
- package/coverage/core/api/models/messages.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/tags.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/users.model.mongodb.js.html +1 -1
- package/coverage/core/api/services/account/account.hooks.js.html +1 -1
- package/coverage/core/api/services/account/account.service.js.html +1 -1
- package/coverage/core/api/services/account/index.html +1 -1
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +1 -1
- package/coverage/core/api/services/authorisations/index.html +1 -1
- package/coverage/core/api/services/configurations/configurations.hooks.js.html +1 -1
- package/coverage/core/api/services/configurations/index.html +1 -1
- 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 +1 -1
- package/coverage/core/api/services/import-export/import-export.service.js.html +1 -1
- package/coverage/core/api/services/import-export/index.html +1 -1
- package/coverage/core/api/services/index.html +1 -1
- package/coverage/core/api/services/index.js.html +1 -1
- package/coverage/core/api/services/mailer/index.html +1 -1
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +1 -1
- package/coverage/core/api/services/mailer/mailer.service.js.html +1 -1
- package/coverage/core/api/services/messages/index.html +1 -1
- package/coverage/core/api/services/messages/messages.hooks.js.html +1 -1
- package/coverage/core/api/services/push/index.html +1 -1
- package/coverage/core/api/services/push/push.hooks.js.html +1 -1
- package/coverage/core/api/services/push/push.service.js.html +1 -1
- package/coverage/core/api/services/storage/index.html +1 -1
- package/coverage/core/api/services/storage/storage.hooks.js.html +1 -1
- package/coverage/core/api/services/storage/storage.service.js.html +1 -1
- package/coverage/core/api/services/tags/index.html +1 -1
- package/coverage/core/api/services/tags/tags.hooks.js.html +1 -1
- package/coverage/core/api/services/users/index.html +1 -1
- package/coverage/core/api/services/users/users.hooks.js.html +1 -1
- package/coverage/core/api/services/users/users.service.js.html +1 -1
- package/coverage/core/common/errors.js.html +1 -1
- package/coverage/core/common/index.html +1 -1
- package/coverage/core/common/index.js.html +1 -1
- package/coverage/core/common/permissions.js.html +1 -1
- package/coverage/core/common/schema.js.html +1 -1
- package/coverage/core/common/utils.js.html +1 -1
- package/coverage/core/common/utils.offline.js.html +1 -1
- package/coverage/index.html +17 -17
- package/coverage/lcov-report/core/api/application.js.html +1 -1
- package/coverage/lcov-report/core/api/authentication.js.html +1 -1
- package/coverage/lcov-report/core/api/db.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +22 -10
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +33 -6
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +1 -1
- 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.tags.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +4 -4
- package/coverage/lcov-report/core/api/hooks/index.html +23 -23
- package/coverage/lcov-report/core/api/hooks/index.js.html +1 -1
- package/coverage/lcov-report/core/api/index.html +1 -1
- package/coverage/lcov-report/core/api/index.js.html +1 -1
- package/coverage/lcov-report/core/api/marshall.js.html +1 -1
- package/coverage/lcov-report/core/api/models/configurations.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/index.html +1 -1
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/account/index.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/core/api/services/authorisations/index.html +1 -1
- package/coverage/lcov-report/core/api/services/configurations/configurations.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/configurations/index.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/index.html +1 -1
- package/coverage/lcov-report/core/api/services/index.html +1 -1
- package/coverage/lcov-report/core/api/services/index.js.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/index.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/messages/index.html +1 -1
- package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/push/index.html +1 -1
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/index.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/tags/index.html +1 -1
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/users/index.html +1 -1
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/users/users.service.js.html +1 -1
- package/coverage/lcov-report/core/common/errors.js.html +1 -1
- package/coverage/lcov-report/core/common/index.html +1 -1
- package/coverage/lcov-report/core/common/index.js.html +1 -1
- package/coverage/lcov-report/core/common/permissions.js.html +1 -1
- package/coverage/lcov-report/core/common/schema.js.html +1 -1
- package/coverage/lcov-report/core/common/utils.js.html +1 -1
- package/coverage/lcov-report/core/common/utils.offline.js.html +1 -1
- package/coverage/lcov-report/index.html +17 -17
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +1 -1
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +1 -1
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +184 -4
- 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 +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/models/projects.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/styles.model.mongodb.js.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/features.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/features/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/api/services/projects/index.html +1 -1
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/styles/index.html +1 -1
- package/coverage/lcov-report/map/api/services/styles/styles.hooks.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 +358 -280
- package/coverage/map/api/hooks/hooks.catalog.js.html +1 -1
- package/coverage/map/api/hooks/hooks.features.js.html +1 -1
- package/coverage/map/api/hooks/hooks.query.js.html +184 -4
- 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 +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/models/projects.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/styles.model.mongodb.js.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/features.service.js.html +1 -1
- package/coverage/map/api/services/features/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/api/services/projects/index.html +1 -1
- package/coverage/map/api/services/projects/projects.hooks.js.html +1 -1
- package/coverage/map/api/services/styles/index.html +1 -1
- package/coverage/map/api/services/styles/styles.hooks.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/coverage/tmp/coverage-1028514-1773134124472-0.json +1 -0
- package/coverage/tmp/coverage-1028526-1773134124448-0.json +1 -0
- package/coverage/tmp/coverage-1028537-1773134124431-0.json +1 -0
- package/coverage/tmp/coverage-1028549-1773134124401-0.json +1 -0
- package/coverage/tmp/{coverage-222566-1765963609278-0.json → coverage-1028556-1773134124353-0.json} +1 -1
- package/extras/configs/widgets.top.js +3 -3
- package/extras/tests/core/collection.mjs +2 -9
- package/map/api/hooks/hooks.catalog.js +18 -4
- package/map/api/services/catalog/catalog.hooks.js +3 -0
- package/map/api/services/features/features.hooks.js +3 -1
- package/map/api/services/index.js +2 -6
- package/map/api/services/styles/styles.hooks.js +6 -1
- package/map/client/components/KFeatureActionButton.vue +9 -3
- package/map/client/components/KFeaturesFilterManager.vue +5 -5
- package/map/client/components/KFilterCondition.vue +17 -10
- package/map/client/components/KLayerEditor.vue +49 -39
- package/map/client/components/KMeasureTool.vue +7 -1
- package/map/client/components/KTimezoneMap.vue +29 -9
- package/map/client/components/catalog/KLayersPanel.vue +26 -16
- package/map/client/components/catalog/KLayersSelector.vue +13 -2
- package/map/client/components/catalog/KViewsPanel.vue +5 -4
- package/map/client/components/form/KSelectLayersField.vue +28 -17
- package/map/client/components/form/KSelectViewsField.vue +18 -9
- package/map/client/components/form/KTimezoneField.vue +1 -2
- package/map/client/components/legend/KVariablesLegend.vue +10 -1
- package/map/client/components/location/KLocationCardSection.vue +7 -2
- package/map/client/components/location/KLocationMap.vue +31 -7
- package/map/client/components/selection/KSelectedLayerFeatures.vue +2 -2
- package/map/client/components/stickies/KZoomControl.vue +1 -1
- package/map/client/components/styles/KStyleManager.vue +4 -1
- package/map/client/components/widget/KTimeSeries.vue +174 -497
- package/map/client/components/widget/KTimeSeriesSelector.vue +72 -0
- package/map/client/components/widget/KTimeSeriesToolbar.vue +83 -0
- package/map/client/composables/catalog.js +6 -10
- package/map/client/composables/highlight.js +12 -9
- package/map/client/composables/project.js +1 -1
- package/map/client/composables/selection.js +8 -7
- package/map/client/composables/weather.js +9 -2
- package/map/client/geolocation.js +8 -5
- package/map/client/i18n/map_en.json +10 -8
- package/map/client/i18n/map_fr.json +9 -7
- package/map/client/leaflet/TiledFeatureLayer.js +85 -82
- package/map/client/leaflet/utils/utils.geojson.js +3 -3
- package/map/client/mixins/globe/mixin.base-globe.js +15 -6
- package/map/client/mixins/globe/mixin.geojson-layers.js +27 -18
- package/map/client/mixins/map/mixin.edit-layers.js +9 -1
- package/map/client/mixins/map/mixin.pmtiles-layers.js +118 -29
- package/map/client/mixins/map/mixin.tiled-mesh-layers.js +12 -5
- package/map/client/mixins/map/mixin.tiled-wind-layers.js +19 -10
- package/map/client/mixins/mixin.activity.js +23 -30
- package/map/client/mixins/mixin.feature-selection.js +41 -5
- package/map/client/planets.js +1 -1
- package/map/client/readers/reader.kml.js +2 -3
- package/map/client/utils/utils.catalog.js +36 -10
- package/map/client/utils/utils.layers.js +39 -8
- package/map/client/utils/utils.project.js +4 -0
- package/map/client/utils/utils.style.js +37 -7
- package/map/client/utils/utils.time-series.js +215 -6
- package/map/common/schemas/catalog.update.json +1 -1
- package/map/common/weacast-grid-source.js +1 -1
- package/package.json +3 -3
- package/scripts/kash/CHANGELOG.md +0 -4
- package/scripts/kash/README.md +0 -9
- package/scripts/kash/kash.sh +45 -40
- package/scripts/kash/scripts/run_tests.sh +1 -4
- package/test/api/core/authentication.test.js +9 -4
- package/test/api/core/config/default.cjs +1 -0
- package/test/api/core/hooks.test.js +6 -0
- package/test/api/core/index.test.js +43 -18
- package/test/api/core/push.test.js +8 -8
- package/test/api/core/test-log-2026-03-10.log +60 -0
- package/test/api/core/users.test.js +384 -0
- package/test/api/map/grid-sources.test.js +1 -1
- package/test/api/map/test-log-2026-03-10.log +56 -0
- package/vite/package.json +11 -2
- package/vite/test/core/composables.test.js +77 -0
- package/vite/vitest.config.js +13 -0
- package/vite/yarn.lock +1096 -18
- package/client/css/core.variables.scss +0 -72
- package/client/i18n/core_en.json +0 -744
- package/client/i18n/core_fr.json +0 -744
- package/client/i18n/map_en.json +0 -800
- package/client/i18n/map_fr.json +0 -800
- package/client/kdk.client.css +0 -47
- package/client/kdk.client.js +0 -41097
- package/client/kdk.client.map.css +0 -47
- package/client/kdk.client.map.js +0 -38182
- package/client/kdk.client.map.min.css +0 -1
- package/client/kdk.client.map.min.js +0 -27032
- package/client/kdk.client.min.css +0 -1
- package/client/kdk.client.min.js +0 -29074
- package/client/schemas/capture.create.json +0 -132
- package/client/schemas/catalog.update.json +0 -44
- package/client/schemas/messages.update.json +0 -16
- package/client/schemas/projects.create.json +0 -52
- package/client/schemas/projects.update.json +0 -52
- package/client/schemas/settings.update.json +0 -286
- package/client/schemas/tags.update.json +0 -35
- package/client/schemas/users.update-profile.json +0 -34
- package/core/client/components/account/KAccount.vue +0 -68
- package/core/client/components/account/KDeleteAccountManager.vue +0 -62
- package/core/client/components/account/KEmailManager.vue +0 -128
- package/core/client/components/account/KPasswordManager.vue +0 -90
- package/core/client/components/account/KVerifyEmailManager.vue +0 -105
- package/core/client/components/collection/KColumn.vue +0 -227
- package/core/client/components/collection/KHistory.vue +0 -113
- package/core/client/components/collection/KHistoryEntry.vue +0 -109
- package/coverage/tmp/coverage-222524-1765963609350-0.json +0 -1
- package/coverage/tmp/coverage-222536-1765963609335-0.json +0 -1
- package/coverage/tmp/coverage-222547-1765963609324-0.json +0 -1
- package/coverage/tmp/coverage-222559-1765963609309-0.json +0 -1
- package/scripts/kash/LICENSE +0 -21
- package/test/api/core/test-log-2025-07-31.log +0 -15
- package/test/api/core/test-log-2025-10-03.log +0 -18
- package/test/api/core/test-log-2025-11-10.log +0 -0
- package/test/api/core/test-log-2025-11-12.log +0 -117
- package/test/api/core/test-log-2025-11-27.log +0 -0
- package/test/api/core/test-log-2025-11-28.log +0 -17
- package/test/api/core/test-log-2025-12-09.log +0 -148
- package/test/api/core/test-log-2025-12-17.log +0 -58
- package/test/api/core/test-log-2026-01-29.log +0 -17
- package/test/api/map/test-log-2025-07-23.log +0 -1
- package/test/api/map/test-log-2025-11-28.log +0 -33
- package/test/api/map/test-log-2025-12-10.log +0 -2
- package/test/api/map/test-log-2026-01-06.log +0 -26
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalisio/kdk",
|
|
3
3
|
"description": "Kalisio Development Kit",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.7.0",
|
|
5
5
|
"homepage": "https://github.com/kalisio/kdk",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [
|
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
"@feathersjs/feathers": "^5.0.8",
|
|
95
95
|
"@feathersjs/schema": "^5.0.8",
|
|
96
96
|
"@feathersjs/socketio": "^5.0.8",
|
|
97
|
-
"@kalisio/feathers-import-export": "^1.4.
|
|
98
|
-
"@kalisio/feathers-s3": "^1.
|
|
97
|
+
"@kalisio/feathers-import-export": "^1.4.1",
|
|
98
|
+
"@kalisio/feathers-s3": "^1.6.0",
|
|
99
99
|
"@kalisio/feathers-webpush": "^1.0.2",
|
|
100
100
|
"@turf/bbox": "^6.0.1",
|
|
101
101
|
"@weacast/core": "^2.2.1",
|
|
@@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
|
-
- added `get_toml_value` to extract values from TOML fields
|
|
13
12
|
- support for mongo 8 (`install_mongo8`)
|
|
14
13
|
- added `get_flavor_from_git_ref` `get_version_from_git_ref` `get_custom_from_git_ref` helpers to parse git ref names (tag or branch names).
|
|
15
14
|
- added `install_sona_scanner_cli` to install SonarQube scanner cli tool
|
|
@@ -19,7 +18,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
18
|
- support for mongo 4,5,6
|
|
20
19
|
- helper to install k9s
|
|
21
20
|
- support for node 16,18
|
|
22
|
-
- support for Code Climate
|
|
23
21
|
|
|
24
22
|
### Changed
|
|
25
23
|
|
|
@@ -34,8 +32,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
34
32
|
- node22 bumped to `22.16`
|
|
35
33
|
- mongodb7 bumped to `7.0.21`
|
|
36
34
|
- mongodb8 bumped to `8.0.10`
|
|
37
|
-
- allow `_` character in custom fields (see `get_custom_from_git_ref`)
|
|
38
|
-
- run_app_tests now run lint on whole project repo (using `yarn lint`)
|
|
39
35
|
|
|
40
36
|
### Fixed
|
|
41
37
|
|
package/scripts/kash/README.md
CHANGED
|
@@ -2,12 +2,3 @@
|
|
|
2
2
|
Kalisio's bash snippets repository
|
|
3
3
|
|
|
4
4
|
## HOWTO use
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## License
|
|
8
|
-
|
|
9
|
-
Licensed under the [MIT license](LICENSE).
|
|
10
|
-
|
|
11
|
-
Copyright (c) 2017-present [Kalisio](https://kalisio.com)
|
|
12
|
-
|
|
13
|
-
[](https://kalisio.com)
|
package/scripts/kash/kash.sh
CHANGED
|
@@ -129,11 +129,11 @@ AGE_VERSION=1.1.1
|
|
|
129
129
|
SOPS_VERSION=3.8.1
|
|
130
130
|
|
|
131
131
|
# https://github.com/kubernetes/kubernetes/tree/master/CHANGELOG
|
|
132
|
-
KUBECTL_VERSION=1.
|
|
132
|
+
KUBECTL_VERSION=1.28.13
|
|
133
133
|
# https://github.com/helm/helm/releases
|
|
134
|
-
HELM_VERSION=3.
|
|
134
|
+
HELM_VERSION=3.14.4
|
|
135
135
|
# https://github.com/helmfile/helmfile/releases
|
|
136
|
-
HELMFILE_VERSION=
|
|
136
|
+
HELMFILE_VERSION=0.167.1
|
|
137
137
|
|
|
138
138
|
# https://github.com/nvm-sh/nvm/releases
|
|
139
139
|
NVM_VERSION=0.40.3
|
|
@@ -246,6 +246,34 @@ ensure_sops() {
|
|
|
246
246
|
fi
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
+
# Install code climate test reporter in ~/.local/bin
|
|
250
|
+
# Arg1: a writable folder where to write downloaded files
|
|
251
|
+
install_cc_test_reporter() {
|
|
252
|
+
local DL_ROOT=$1
|
|
253
|
+
local DL_PATH="$DL_ROOT/cc"
|
|
254
|
+
if [ ! -d "$DL_PATH" ]; then
|
|
255
|
+
mkdir -p "$DL_PATH" && cd "$DL_PATH"
|
|
256
|
+
curl -OLsS https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
|
|
257
|
+
curl -OLsS https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64.sha256
|
|
258
|
+
sha256sum --ignore-missing --quiet -c test-reporter-latest-linux-amd64.sha256
|
|
259
|
+
cd ~-
|
|
260
|
+
fi
|
|
261
|
+
cd "$DL_PATH"
|
|
262
|
+
cp test-reporter-latest-linux-amd64 ~/.local/bin/cc-test-reporter
|
|
263
|
+
chmod +x ~/.local/bin/cc-test-reporter
|
|
264
|
+
cd ~-
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
# Sends test coverage to code climate
|
|
268
|
+
# Arg1: code climate identifier for authentication
|
|
269
|
+
# Arg2: prefix to use when using format-coverage (can be empty)
|
|
270
|
+
send_coverage_to_cc() {
|
|
271
|
+
local CC_TEST_REPORTER_ID=$1
|
|
272
|
+
local CC_PREFIX=${2:-}
|
|
273
|
+
~/.local/bin/cc-test-reporter format-coverage -t lcov --add-prefix "$CC_PREFIX" coverage/lcov.info
|
|
274
|
+
~/.local/bin/cc-test-reporter upload-coverage -r "$CC_TEST_REPORTER_ID"
|
|
275
|
+
}
|
|
276
|
+
|
|
249
277
|
# Make sure nvm is installed
|
|
250
278
|
# Arg1: a writable folder where to write downloaded files
|
|
251
279
|
# NOTE: also define 'yarn' as a default package, ie. it'll be automatically
|
|
@@ -458,28 +486,12 @@ use_mongo() {
|
|
|
458
486
|
### Utils
|
|
459
487
|
###
|
|
460
488
|
|
|
461
|
-
# Extract a value from a TOML file
|
|
462
|
-
# Expected args:
|
|
463
|
-
# 1. the toml file
|
|
464
|
-
# 2. the field to extract
|
|
465
|
-
get_toml_value() {
|
|
466
|
-
local TOML_SRC="$1"
|
|
467
|
-
local TOML_FIELD="$2"
|
|
468
|
-
|
|
469
|
-
ensure_yq
|
|
470
|
-
yq --input-format=toml --output-format=yaml ".$TOML_FIELD" "$TOML_SRC"
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
# Extract a value from a JSON file
|
|
474
|
-
# Expected args:
|
|
475
|
-
# 1. the toml file
|
|
476
|
-
# 2. the field to extract
|
|
477
489
|
get_json_value() {
|
|
478
490
|
local JSON_SRC="$1"
|
|
479
491
|
local JSON_FIELD="$2"
|
|
480
492
|
|
|
481
493
|
ensure_yq
|
|
482
|
-
yq --
|
|
494
|
+
yq --output-format=yaml ".$JSON_FIELD" "$JSON_SRC"
|
|
483
495
|
}
|
|
484
496
|
|
|
485
497
|
# Extract version major from a version string.
|
|
@@ -991,7 +1003,7 @@ get_version_from_git_ref() {
|
|
|
991
1003
|
get_custom_from_git_ref() {
|
|
992
1004
|
local GIT_REF=$1
|
|
993
1005
|
|
|
994
|
-
local CUSTOM_REGEX="(^|-)([a-zA-Z0-
|
|
1006
|
+
local CUSTOM_REGEX="(^|-)([a-zA-Z0-9]+)$"
|
|
995
1007
|
if [[ "$GIT_REF" =~ $CUSTOM_REGEX ]]; then
|
|
996
1008
|
if [[ "${BASH_REMATCH[1]}" == "" ]]; then
|
|
997
1009
|
# If first capture group is empty => that's probably a 'dev' flavor.
|
|
@@ -1272,13 +1284,13 @@ get_app_kli_file() {
|
|
|
1272
1284
|
# Expected arguments:
|
|
1273
1285
|
# 1. the app repository directory
|
|
1274
1286
|
# 2. the directory in which we'll find kli files relative to the 'development' repository root directory
|
|
1275
|
-
# 3.
|
|
1287
|
+
# 3. wether to publish code coverage results (boolean)
|
|
1276
1288
|
# 4. the node version to use (16, 18, ...)
|
|
1277
1289
|
# 5. the mongo version to use (5, 6, ...). Mongo will not be started if not provided
|
|
1278
1290
|
run_app_tests() {
|
|
1279
1291
|
local REPO_DIR="$1"
|
|
1280
1292
|
local KLI_BASE="$2"
|
|
1281
|
-
local
|
|
1293
|
+
local CODE_COVERAGE="$3"
|
|
1282
1294
|
local NODE_VER="$4"
|
|
1283
1295
|
local MONGO_VER="$5"
|
|
1284
1296
|
local WORKSPACE_DIR
|
|
@@ -1295,13 +1307,6 @@ run_app_tests() {
|
|
|
1295
1307
|
|
|
1296
1308
|
echo "About to run tests for $APP v$VERSION-$FLAVOR ..."
|
|
1297
1309
|
|
|
1298
|
-
## Lint whole project
|
|
1299
|
-
##
|
|
1300
|
-
|
|
1301
|
-
cd "$REPO_DIR"
|
|
1302
|
-
yarn lint
|
|
1303
|
-
cd ~-
|
|
1304
|
-
|
|
1305
1310
|
## Start mongo
|
|
1306
1311
|
##
|
|
1307
1312
|
|
|
@@ -1317,19 +1322,19 @@ run_app_tests() {
|
|
|
1317
1322
|
## Run tests
|
|
1318
1323
|
##
|
|
1319
1324
|
|
|
1320
|
-
|
|
1325
|
+
pushd "$REPO_DIR/api"
|
|
1321
1326
|
|
|
1322
1327
|
use_node "$NODE_VER"
|
|
1323
1328
|
yarn test
|
|
1324
1329
|
|
|
1325
|
-
##
|
|
1330
|
+
## Publish code coverage
|
|
1326
1331
|
##
|
|
1327
1332
|
|
|
1328
|
-
if [ "$
|
|
1329
|
-
|
|
1333
|
+
if [ "$CODE_COVERAGE" = true ]; then
|
|
1334
|
+
send_coverage_to_cc "$CC_TEST_REPORTER_ID" "api"
|
|
1330
1335
|
fi
|
|
1331
1336
|
|
|
1332
|
-
|
|
1337
|
+
popd
|
|
1333
1338
|
}
|
|
1334
1339
|
|
|
1335
1340
|
# Setup the workspace for a lib project.
|
|
@@ -1392,12 +1397,12 @@ get_lib_branch() {
|
|
|
1392
1397
|
# Run tests for a library module
|
|
1393
1398
|
# Expected arguments
|
|
1394
1399
|
# 1. Root directory
|
|
1395
|
-
# 2.
|
|
1400
|
+
# 2. true to publish code coverage to code climate (CC_TEST_REPORTER_ID env var should be defined in this case)
|
|
1396
1401
|
# 3. node version to be used
|
|
1397
1402
|
# 4. mongo version to be used if required by tests
|
|
1398
1403
|
run_lib_tests () {
|
|
1399
1404
|
local ROOT_DIR="$1"
|
|
1400
|
-
local
|
|
1405
|
+
local CODE_COVERAGE="$2"
|
|
1401
1406
|
local NODE_VER="$3"
|
|
1402
1407
|
local MONGO_VER="$4"
|
|
1403
1408
|
local WORKSPACE_DIR
|
|
@@ -1432,11 +1437,11 @@ run_lib_tests () {
|
|
|
1432
1437
|
use_node "$NODE_VER"
|
|
1433
1438
|
yarn && yarn test
|
|
1434
1439
|
|
|
1435
|
-
##
|
|
1440
|
+
## Publish code coverage
|
|
1436
1441
|
##
|
|
1437
1442
|
|
|
1438
|
-
if [ "$
|
|
1439
|
-
|
|
1443
|
+
if [ "$CODE_COVERAGE" = true ]; then
|
|
1444
|
+
send_coverage_to_cc "$CC_TEST_REPORTER_ID"
|
|
1440
1445
|
fi
|
|
1441
1446
|
}
|
|
1442
1447
|
|
|
@@ -11,7 +11,7 @@ ROOT_DIR=$(dirname "$THIS_DIR")
|
|
|
11
11
|
### Github Actions
|
|
12
12
|
|
|
13
13
|
init_github() {
|
|
14
|
-
install_reqs yq age sops nvm node20 node22 sonar_scanner_cli
|
|
14
|
+
install_reqs yq age sops nvm node20 node22 cc_test_reporter sonar_scanner_cli
|
|
15
15
|
|
|
16
16
|
# mongo is not available for alpine hosts
|
|
17
17
|
if [ "$OS_ID" != "alpine" ]; then
|
|
@@ -49,8 +49,6 @@ mkdir -p "$TMP_DIR/utils"
|
|
|
49
49
|
cd "$TMP_DIR/utils"
|
|
50
50
|
curl -OLsS "https://raw.githubusercontent.com/kalisio/krawler/master/package.json"
|
|
51
51
|
[ "$(get_json_value "$TMP_DIR/utils/package.json" 'name')" != "@kalisio/krawler" ] && exit 1
|
|
52
|
-
curl -OLsS "https://raw.githubusercontent.com/kalisio/kazarr/refs/heads/master/pyproject.toml"
|
|
53
|
-
[ "$(get_toml_value "$TMP_DIR/utils/pyproject.toml" 'project.name')" != "kazarr" ] && exit 1
|
|
54
52
|
cd ~-
|
|
55
53
|
|
|
56
54
|
[ "$(get_semver_major "1" )" != "1" ] && exit 1
|
|
@@ -131,7 +129,6 @@ git_shallow_clone https://github.com/kalisio/kApp.git "$TMP_DIR/kApp.v1.3.0" pro
|
|
|
131
129
|
[[ "$(get_custom_from_git_ref "test-v4.3-blabla")" != "blabla" ]] && exit 1
|
|
132
130
|
[[ "$(get_custom_from_git_ref "prod-v4.5.3")" != "" ]] && exit 1
|
|
133
131
|
[[ "$(get_custom_from_git_ref "prod-v4.5.3-custom")" != "custom" ]] && exit 1
|
|
134
|
-
[[ "$(get_custom_from_git_ref "prod-v4.5.3-custom_foo")" != "custom_foo" ]] && exit 1
|
|
135
132
|
|
|
136
133
|
# Setup a fake workspace with additional dependencies
|
|
137
134
|
mkdir -p "$TMP_DIR/fake"
|
|
@@ -42,11 +42,9 @@ describe('core:authentication', () => {
|
|
|
42
42
|
try {
|
|
43
43
|
await request.get(`${baseUrl}/users`)
|
|
44
44
|
} catch (error) {
|
|
45
|
-
|
|
46
|
-
expect(error).toExist()
|
|
47
|
-
expect(error.name).to.equal('NotAuthenticated')
|
|
48
|
-
*/
|
|
45
|
+
// Not sure why but in this case the raised error is in text/html format
|
|
49
46
|
expect(error.status).to.equal(500)
|
|
47
|
+
expect(error.response.text.includes('NotAuthenticated')).beTrue()
|
|
50
48
|
}
|
|
51
49
|
})
|
|
52
50
|
|
|
@@ -154,6 +152,7 @@ describe('core:authentication', () => {
|
|
|
154
152
|
expect(accessToken).not.to.equal(statelessAccessToken)
|
|
155
153
|
expect(user).beUndefined()
|
|
156
154
|
const payload = await authenticationService.verifyAccessToken(accessToken, app.get('authentication').jwtOptions)
|
|
155
|
+
expect(payload.sub).to.equal('mycustomapp')
|
|
157
156
|
expect(payload.property).to.equal('mycustomproperty')
|
|
158
157
|
})
|
|
159
158
|
|
|
@@ -175,6 +174,12 @@ describe('core:authentication', () => {
|
|
|
175
174
|
expect(users[0]._id).to.equal(userObject._id.toString())
|
|
176
175
|
})
|
|
177
176
|
|
|
177
|
+
it('removes user', async () => {
|
|
178
|
+
await userService.remove(userObject._id)
|
|
179
|
+
})
|
|
180
|
+
// Let enough time to process
|
|
181
|
+
.timeout(5000)
|
|
182
|
+
|
|
178
183
|
// Cleanup
|
|
179
184
|
after(async () => {
|
|
180
185
|
if (server) await server.close()
|
|
@@ -272,6 +272,12 @@ describe('core:hooks', () => {
|
|
|
272
272
|
fuzzySearch({ fields: ['name'] })(hook)
|
|
273
273
|
hooks.diacriticSearch()(hook)
|
|
274
274
|
expect(hook.params.query.name.$regex.source).to.equal('árë')
|
|
275
|
+
// Ensure it works on complex queries
|
|
276
|
+
hook.params.query = { $or: [{ name: { $search: 'are' } }, { name: { $search: 'árë' } }] }
|
|
277
|
+
fuzzySearch({ fields: ['name'] })(hook)
|
|
278
|
+
hooks.diacriticSearch()(hook)
|
|
279
|
+
expect(hook.params.query.$or[0].name.$regex.source).to.equal('[a,á,à,ä,â,ã]r[e,é,ë,è,ê]')
|
|
280
|
+
expect(hook.params.query.$or[1].name.$regex.source).to.equal('árë')
|
|
275
281
|
})
|
|
276
282
|
|
|
277
283
|
it('rate limiting', (done) => {
|
|
@@ -6,6 +6,7 @@ import request from 'superagent'
|
|
|
6
6
|
import chai from 'chai'
|
|
7
7
|
import chailint from 'chai-lint'
|
|
8
8
|
import spies from 'chai-spies'
|
|
9
|
+
import fuzzySearch from 'feathers-mongodb-fuzzy-search'
|
|
9
10
|
import core, { kdk, hooks, permissions, createMessagesService } from '../../../core/api/index.js'
|
|
10
11
|
import { fileURLToPath } from 'url'
|
|
11
12
|
|
|
@@ -15,7 +16,7 @@ const { util, expect } = chai
|
|
|
15
16
|
|
|
16
17
|
describe('core:services', () => {
|
|
17
18
|
let app, server, port, baseUrl, accessToken,
|
|
18
|
-
|
|
19
|
+
usersService, userObject, authorisationService, messagesService, messageObject,
|
|
19
20
|
spyUpdateAbilities
|
|
20
21
|
|
|
21
22
|
before(async () => {
|
|
@@ -44,8 +45,12 @@ describe('core:services', () => {
|
|
|
44
45
|
it('registers the services', async () => {
|
|
45
46
|
await app.configure(core)
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
expect(
|
|
48
|
+
usersService = app.getService('users')
|
|
49
|
+
expect(usersService).toExist()
|
|
50
|
+
// Register search hooks
|
|
51
|
+
usersService.hooks({
|
|
52
|
+
before: { find: [fuzzySearch({ fields: ['profile.name'] }), hooks.diacriticSearch()] }
|
|
53
|
+
})
|
|
49
54
|
// Create a global messages service for tests
|
|
50
55
|
await createMessagesService.call(app)
|
|
51
56
|
messagesService = app.getService('messages')
|
|
@@ -108,11 +113,11 @@ describe('core:services', () => {
|
|
|
108
113
|
const [localStrategy] = app.service('api/authentication').getStrategies('local')
|
|
109
114
|
const previousPassword = await localStrategy.hashPassword('weak;')
|
|
110
115
|
|
|
111
|
-
await assert.rejects(() =>
|
|
116
|
+
await assert.rejects(() => usersService.create({
|
|
112
117
|
email: 'test@test.org',
|
|
113
118
|
password: 'weak;',
|
|
114
119
|
previousPasswords: [previousPassword],
|
|
115
|
-
name: '
|
|
120
|
+
name: 'maëlis'
|
|
116
121
|
}), error => {
|
|
117
122
|
expect(error).toExist()
|
|
118
123
|
expect(error.name).to.equal('BadRequest')
|
|
@@ -120,10 +125,10 @@ describe('core:services', () => {
|
|
|
120
125
|
return true
|
|
121
126
|
})
|
|
122
127
|
|
|
123
|
-
await assert.rejects(() =>
|
|
128
|
+
await assert.rejects(() => usersService.create({
|
|
124
129
|
email: 'test@test.org',
|
|
125
130
|
password: '12345678',
|
|
126
|
-
name: '
|
|
131
|
+
name: 'maëlis'
|
|
127
132
|
}), error => {
|
|
128
133
|
expect(error).toExist()
|
|
129
134
|
expect(error.name).to.equal('BadRequest')
|
|
@@ -137,17 +142,17 @@ describe('core:services', () => {
|
|
|
137
142
|
it('creates a user', async () => {
|
|
138
143
|
// Test password generation
|
|
139
144
|
const hook = hooks.generatePassword()({ type: 'before', data: {}, params: {}, app })
|
|
140
|
-
userObject = await
|
|
145
|
+
userObject = await usersService.create({
|
|
141
146
|
email: 'test@test.org',
|
|
142
147
|
password: hook.data.password,
|
|
143
|
-
name: '
|
|
148
|
+
name: 'maëlis',
|
|
144
149
|
profile: { phone: '0623256968' }
|
|
145
150
|
}, { checkAuthorisation: true })
|
|
146
151
|
expect(spyUpdateAbilities).to.have.been.called.once
|
|
147
152
|
spyUpdateAbilities.reset()
|
|
148
153
|
// Keep track of clear password
|
|
149
154
|
userObject.clearPassword = hook.data.password
|
|
150
|
-
const users = await
|
|
155
|
+
const users = await usersService.find({ query: { 'profile.name': 'maëlis' } })
|
|
151
156
|
expect(users.data.length > 0).beTrue()
|
|
152
157
|
expect(users.data[0].email).toExist()
|
|
153
158
|
expect(users.data[0].clearPassword).beUndefined()
|
|
@@ -159,10 +164,10 @@ describe('core:services', () => {
|
|
|
159
164
|
.timeout(10000)
|
|
160
165
|
|
|
161
166
|
it('changing user password keeps password history', async () => {
|
|
162
|
-
await
|
|
167
|
+
await usersService.patch(userObject._id.toString(), { password: userObject.password })
|
|
163
168
|
expect(spyUpdateAbilities).to.have.been.called.once
|
|
164
169
|
spyUpdateAbilities.reset()
|
|
165
|
-
const user = await
|
|
170
|
+
const user = await usersService.get(userObject._id.toString())
|
|
166
171
|
expect(user.previousPasswords).toExist()
|
|
167
172
|
expect(user.previousPasswords).to.deep.equal([userObject.password])
|
|
168
173
|
})
|
|
@@ -226,15 +231,16 @@ describe('core:services', () => {
|
|
|
226
231
|
.timeout(5000)
|
|
227
232
|
|
|
228
233
|
it('authenticated user can access services', () => {
|
|
229
|
-
return
|
|
234
|
+
return usersService.find({ query: {}, params: { user: userObject, checkAuthorisation: true } })
|
|
230
235
|
.then(users => {
|
|
231
236
|
expect(users.data.length === 1).beTrue()
|
|
232
237
|
})
|
|
233
238
|
})
|
|
234
239
|
|
|
235
240
|
it('get user profile', () => {
|
|
236
|
-
return
|
|
241
|
+
return usersService.find({ query: { $select: ['profile'] } })
|
|
237
242
|
.then(users => {
|
|
243
|
+
expect(users.data.length > 0).beTrue()
|
|
238
244
|
expect(users.data[0].name).beUndefined()
|
|
239
245
|
expect(users.data[0].profile.name).toExist()
|
|
240
246
|
expect(users.data[0].profile.description).toExist()
|
|
@@ -242,6 +248,25 @@ describe('core:services', () => {
|
|
|
242
248
|
})
|
|
243
249
|
})
|
|
244
250
|
|
|
251
|
+
it('search user profile', async () => {
|
|
252
|
+
const hook = hooks.generatePassword()({ type: 'before', data: {}, params: {}, app })
|
|
253
|
+
const user = await usersService.create({
|
|
254
|
+
email: 'anothertest@test.org',
|
|
255
|
+
password: hook.data.password,
|
|
256
|
+
name: 'maelis',
|
|
257
|
+
profile: { phone: '0623256968' }
|
|
258
|
+
})
|
|
259
|
+
spyUpdateAbilities.reset()
|
|
260
|
+
const allUsers = await usersService.find({ query: { 'profile.name': { $search: 'Mae' } } })
|
|
261
|
+
// Diacritic should be more specific
|
|
262
|
+
const singleUsers = await usersService.find({ query: { 'profile.name': { $search: 'Maë' } } })
|
|
263
|
+
await usersService.remove(user._id)
|
|
264
|
+
expect(allUsers.data.length === 2).beTrue()
|
|
265
|
+
expect(singleUsers.data.length === 1).beTrue()
|
|
266
|
+
})
|
|
267
|
+
// Let enough time to process
|
|
268
|
+
.timeout(10000)
|
|
269
|
+
|
|
245
270
|
it('creates a user message', async () => {
|
|
246
271
|
const message = await messagesService.create({
|
|
247
272
|
title: 'Title',
|
|
@@ -271,7 +296,7 @@ describe('core:services', () => {
|
|
|
271
296
|
expect(authorisation).toExist()
|
|
272
297
|
expect(spyUpdateAbilities).to.have.been.called.once
|
|
273
298
|
spyUpdateAbilities.reset()
|
|
274
|
-
userObject = await
|
|
299
|
+
userObject = await usersService.get(userObject._id.toString())
|
|
275
300
|
expect(userObject.authorisations).toExist()
|
|
276
301
|
expect(userObject.authorisations.length > 0).beTrue()
|
|
277
302
|
expect(userObject.authorisations[0].permissions).to.deep.equal('manager')
|
|
@@ -334,7 +359,7 @@ describe('core:services', () => {
|
|
|
334
359
|
expect(authorisation).toExist()
|
|
335
360
|
expect(spyUpdateAbilities).to.have.been.called.once
|
|
336
361
|
spyUpdateAbilities.reset()
|
|
337
|
-
const user = await
|
|
362
|
+
const user = await usersService.get(userObject._id.toString())
|
|
338
363
|
expect(user.authorisations).toExist()
|
|
339
364
|
expect(user.authorisations.length === 0).beTrue()
|
|
340
365
|
})
|
|
@@ -361,11 +386,11 @@ describe('core:services', () => {
|
|
|
361
386
|
})
|
|
362
387
|
|
|
363
388
|
it('removes a user', async () => {
|
|
364
|
-
await
|
|
389
|
+
await usersService.remove(userObject._id, {
|
|
365
390
|
user: userObject,
|
|
366
391
|
checkAuthorisation: true
|
|
367
392
|
})
|
|
368
|
-
const users = await
|
|
393
|
+
const users = await usersService.find({ query: { name: 'maëlis' } })
|
|
369
394
|
expect(users.data.length === 0).beTrue()
|
|
370
395
|
const messages = await messagesService.find({ query: { title: 'Title' } })
|
|
371
396
|
expect(messages.data.length === 0).beTrue()
|
|
@@ -14,7 +14,7 @@ const { util, expect } = chai
|
|
|
14
14
|
|
|
15
15
|
describe('core:push', () => {
|
|
16
16
|
let app, server, port, mailerStub, gmailUser, user,
|
|
17
|
-
mailerService,
|
|
17
|
+
mailerService, usersService, pushService
|
|
18
18
|
|
|
19
19
|
const subscription = {
|
|
20
20
|
endpoint: process.env.SUBSCRIPTION_ENDPOINT,
|
|
@@ -71,9 +71,9 @@ describe('core:push', () => {
|
|
|
71
71
|
|
|
72
72
|
it('registers the services', async () => {
|
|
73
73
|
await app.configure(core)
|
|
74
|
-
|
|
75
|
-
expect(
|
|
76
|
-
|
|
74
|
+
usersService = app.getService('users')
|
|
75
|
+
expect(usersService).toExist()
|
|
76
|
+
usersService.hooks({
|
|
77
77
|
before: {
|
|
78
78
|
remove: [hooks.unregisterDevices]
|
|
79
79
|
},
|
|
@@ -101,7 +101,7 @@ describe('core:push', () => {
|
|
|
101
101
|
.timeout(5000)
|
|
102
102
|
|
|
103
103
|
it('create a user', () => {
|
|
104
|
-
return
|
|
104
|
+
return usersService.create({
|
|
105
105
|
email: gmailUser,
|
|
106
106
|
password: 'Pass;word1',
|
|
107
107
|
name: 'user'
|
|
@@ -117,7 +117,7 @@ describe('core:push', () => {
|
|
|
117
117
|
const previousUser = _.cloneDeep(user)
|
|
118
118
|
await addSubscription(user, subscription, 'subscriptions')
|
|
119
119
|
// Subscriptions change detection requires the previous user to be set
|
|
120
|
-
await
|
|
120
|
+
await usersService.patch(user._id, { subscriptions: user.subscriptions }, { user: previousUser })
|
|
121
121
|
expect(user.subscriptions).toExist()
|
|
122
122
|
expect(user.subscriptions.length === 1).beTrue()
|
|
123
123
|
expect(user.subscriptions[0].endpoint).to.equal(subscription.endpoint)
|
|
@@ -156,7 +156,7 @@ describe('core:push', () => {
|
|
|
156
156
|
it('delete expired subscriptions', async () => {
|
|
157
157
|
// Add expired subscription
|
|
158
158
|
await addSubscription(user, expiredSubscription, 'subscriptions')
|
|
159
|
-
await
|
|
159
|
+
await usersService.patch(user._id, { subscriptions: user.subscriptions })
|
|
160
160
|
expect(user.subscriptions).toExist()
|
|
161
161
|
expect(user.subscriptions.length === 2).beTrue()
|
|
162
162
|
// Send push notification
|
|
@@ -166,7 +166,7 @@ describe('core:push', () => {
|
|
|
166
166
|
subscriptionProperty: 'subscriptions',
|
|
167
167
|
subscriptionFilter: { _id: user._id }
|
|
168
168
|
})
|
|
169
|
-
const users = await
|
|
169
|
+
const users = await usersService.find({ query: { email: gmailUser } })
|
|
170
170
|
expect(users.data.length > 0).beTrue()
|
|
171
171
|
user = users.data[0]
|
|
172
172
|
// Check that expired subscriptions have been deleted
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
2
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
3
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
4
|
+
{"level":"error","message":"error: api/messages - Method: create: You are not allowed to access service messages"}
|
|
5
|
+
{"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
|
|
6
|
+
{"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
|
|
7
|
+
{"level":"error","message":"error: api/authorisations - Method: create: You are not allowed to change authorisation on resource"}
|
|
8
|
+
{"level":"error","message":"error: api/authorisations - Method: remove: You are not allowed to change authorisation on subject(s)"}
|
|
9
|
+
{"level":"info","message":"This is a log test"}
|
|
10
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
11
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
12
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
13
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
14
|
+
{"level":"error","message":"error: api/storage - Method: get: NoSuchKey"}
|
|
15
|
+
{"level":"error","message":"error: api/storage - Method: get: NoSuchKey"}
|
|
16
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
17
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
18
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
19
|
+
{"level":"error","message":"error: api/messages - Method: create: You are not allowed to access service messages"}
|
|
20
|
+
{"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
|
|
21
|
+
{"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
|
|
22
|
+
{"level":"error","message":"error: api/authorisations - Method: create: You are not allowed to change authorisation on resource"}
|
|
23
|
+
{"level":"error","message":"error: api/authorisations - Method: remove: You are not allowed to change authorisation on subject(s)"}
|
|
24
|
+
{"level":"info","message":"This is a log test"}
|
|
25
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
26
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
27
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
28
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
29
|
+
{"level":"error","message":"error: api/storage - Method: get: NoSuchKey"}
|
|
30
|
+
{"level":"error","message":"error: api/storage - Method: get: NoSuchKey"}
|
|
31
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
32
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
33
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
34
|
+
{"level":"error","message":"error: api/messages - Method: create: You are not allowed to access service messages"}
|
|
35
|
+
{"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
|
|
36
|
+
{"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
|
|
37
|
+
{"level":"error","message":"error: api/authorisations - Method: create: You are not allowed to change authorisation on resource"}
|
|
38
|
+
{"level":"error","message":"error: api/authorisations - Method: remove: You are not allowed to change authorisation on subject(s)"}
|
|
39
|
+
{"level":"info","message":"This is a log test"}
|
|
40
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
41
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
42
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
43
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
44
|
+
{"level":"error","message":"error: api/storage - Method: get: NoSuchKey"}
|
|
45
|
+
{"level":"error","message":"error: api/storage - Method: get: NoSuchKey"}
|
|
46
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
47
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
48
|
+
{"level":"error","message":"error: api/account - Method: create: The provided password does not comply to the password policy"}
|
|
49
|
+
{"level":"error","message":"error: api/messages - Method: create: You are not allowed to access service messages"}
|
|
50
|
+
{"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
|
|
51
|
+
{"level":"error","message":"error: api/users - Method: create: The provided password does not comply to the password policy"}
|
|
52
|
+
{"level":"error","message":"error: api/authorisations - Method: create: You are not allowed to change authorisation on resource"}
|
|
53
|
+
{"level":"error","message":"error: api/authorisations - Method: remove: You are not allowed to change authorisation on subject(s)"}
|
|
54
|
+
{"level":"info","message":"This is a log test"}
|
|
55
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
56
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
57
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
58
|
+
{"level":"error","message":"error: api/service - Method: create: validation failed"}
|
|
59
|
+
{"level":"error","message":"error: api/storage - Method: get: NoSuchKey"}
|
|
60
|
+
{"level":"error","message":"error: api/storage - Method: get: NoSuchKey"}
|