@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
|
@@ -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">63.76% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>176/276</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">57.69% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>30/52</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">58.33% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>7/12</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">63.76% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>176/276</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line medium'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -322,7 +322,24 @@
|
|
|
322
322
|
<a name='L257'></a><a href='#L257'>257</a>
|
|
323
323
|
<a name='L258'></a><a href='#L258'>258</a>
|
|
324
324
|
<a name='L259'></a><a href='#L259'>259</a>
|
|
325
|
-
<a name='L260'></a><a href='#L260'>260</a
|
|
325
|
+
<a name='L260'></a><a href='#L260'>260</a>
|
|
326
|
+
<a name='L261'></a><a href='#L261'>261</a>
|
|
327
|
+
<a name='L262'></a><a href='#L262'>262</a>
|
|
328
|
+
<a name='L263'></a><a href='#L263'>263</a>
|
|
329
|
+
<a name='L264'></a><a href='#L264'>264</a>
|
|
330
|
+
<a name='L265'></a><a href='#L265'>265</a>
|
|
331
|
+
<a name='L266'></a><a href='#L266'>266</a>
|
|
332
|
+
<a name='L267'></a><a href='#L267'>267</a>
|
|
333
|
+
<a name='L268'></a><a href='#L268'>268</a>
|
|
334
|
+
<a name='L269'></a><a href='#L269'>269</a>
|
|
335
|
+
<a name='L270'></a><a href='#L270'>270</a>
|
|
336
|
+
<a name='L271'></a><a href='#L271'>271</a>
|
|
337
|
+
<a name='L272'></a><a href='#L272'>272</a>
|
|
338
|
+
<a name='L273'></a><a href='#L273'>273</a>
|
|
339
|
+
<a name='L274'></a><a href='#L274'>274</a>
|
|
340
|
+
<a name='L275'></a><a href='#L275'>275</a>
|
|
341
|
+
<a name='L276'></a><a href='#L276'>276</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
342
|
+
<span class="cline-any cline-yes">1x</span>
|
|
326
343
|
<span class="cline-any cline-yes">1x</span>
|
|
327
344
|
<span class="cline-any cline-yes">1x</span>
|
|
328
345
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -340,12 +357,12 @@
|
|
|
340
357
|
<span class="cline-any cline-no"> </span>
|
|
341
358
|
<span class="cline-any cline-yes">1x</span>
|
|
342
359
|
<span class="cline-any cline-yes">1x</span>
|
|
343
|
-
<span class="cline-any cline-yes">
|
|
344
|
-
<span class="cline-any cline-yes">
|
|
345
|
-
<span class="cline-any cline-yes">
|
|
346
|
-
<span class="cline-any cline-yes">
|
|
347
|
-
<span class="cline-any cline-yes">
|
|
348
|
-
<span class="cline-any cline-yes">
|
|
360
|
+
<span class="cline-any cline-yes">4x</span>
|
|
361
|
+
<span class="cline-any cline-yes">4x</span>
|
|
362
|
+
<span class="cline-any cline-yes">3x</span>
|
|
363
|
+
<span class="cline-any cline-yes">3x</span>
|
|
364
|
+
<span class="cline-any cline-yes">3x</span>
|
|
365
|
+
<span class="cline-any cline-yes">4x</span>
|
|
349
366
|
<span class="cline-any cline-yes">1x</span>
|
|
350
367
|
<span class="cline-any cline-yes">1x</span>
|
|
351
368
|
<span class="cline-any cline-no"> </span>
|
|
@@ -395,79 +412,79 @@
|
|
|
395
412
|
<span class="cline-any cline-no"> </span>
|
|
396
413
|
<span class="cline-any cline-yes">1x</span>
|
|
397
414
|
<span class="cline-any cline-yes">1x</span>
|
|
415
|
+
<span class="cline-any cline-yes">4x</span>
|
|
416
|
+
<span class="cline-any cline-yes">4x</span>
|
|
417
|
+
<span class="cline-any cline-yes">4x</span>
|
|
418
|
+
<span class="cline-any cline-yes">4x</span>
|
|
419
|
+
<span class="cline-any cline-yes">4x</span>
|
|
420
|
+
<span class="cline-any cline-yes">4x</span>
|
|
421
|
+
<span class="cline-any cline-yes">4x</span>
|
|
422
|
+
<span class="cline-any cline-yes">4x</span>
|
|
423
|
+
<span class="cline-any cline-yes">4x</span>
|
|
424
|
+
<span class="cline-any cline-yes">4x</span>
|
|
425
|
+
<span class="cline-any cline-yes">4x</span>
|
|
398
426
|
<span class="cline-any cline-no"> </span>
|
|
399
427
|
<span class="cline-any cline-no"> </span>
|
|
400
428
|
<span class="cline-any cline-no"> </span>
|
|
429
|
+
<span class="cline-any cline-yes">4x</span>
|
|
401
430
|
<span class="cline-any cline-no"> </span>
|
|
402
431
|
<span class="cline-any cline-no"> </span>
|
|
403
432
|
<span class="cline-any cline-no"> </span>
|
|
433
|
+
<span class="cline-any cline-yes">4x</span>
|
|
434
|
+
<span class="cline-any cline-yes">4x</span>
|
|
435
|
+
<span class="cline-any cline-yes">4x</span>
|
|
436
|
+
<span class="cline-any cline-yes">4x</span>
|
|
437
|
+
<span class="cline-any cline-yes">4x</span>
|
|
438
|
+
<span class="cline-any cline-yes">4x</span>
|
|
439
|
+
<span class="cline-any cline-yes">4x</span>
|
|
440
|
+
<span class="cline-any cline-yes">4x</span>
|
|
404
441
|
<span class="cline-any cline-no"> </span>
|
|
405
442
|
<span class="cline-any cline-no"> </span>
|
|
406
443
|
<span class="cline-any cline-no"> </span>
|
|
444
|
+
<span class="cline-any cline-yes">4x</span>
|
|
407
445
|
<span class="cline-any cline-no"> </span>
|
|
408
446
|
<span class="cline-any cline-no"> </span>
|
|
409
447
|
<span class="cline-any cline-no"> </span>
|
|
448
|
+
<span class="cline-any cline-yes">4x</span>
|
|
449
|
+
<span class="cline-any cline-yes">4x</span>
|
|
450
|
+
<span class="cline-any cline-yes">4x</span>
|
|
410
451
|
<span class="cline-any cline-no"> </span>
|
|
411
452
|
<span class="cline-any cline-no"> </span>
|
|
412
453
|
<span class="cline-any cline-no"> </span>
|
|
454
|
+
<span class="cline-any cline-yes">4x</span>
|
|
455
|
+
<span class="cline-any cline-yes">4x</span>
|
|
456
|
+
<span class="cline-any cline-yes">4x</span>
|
|
457
|
+
<span class="cline-any cline-yes">4x</span>
|
|
458
|
+
<span class="cline-any cline-yes">4x</span>
|
|
459
|
+
<span class="cline-any cline-yes">4x</span>
|
|
460
|
+
<span class="cline-any cline-yes">4x</span>
|
|
461
|
+
<span class="cline-any cline-yes">4x</span>
|
|
462
|
+
<span class="cline-any cline-yes">4x</span>
|
|
463
|
+
<span class="cline-any cline-yes">4x</span>
|
|
464
|
+
<span class="cline-any cline-yes">4x</span>
|
|
465
|
+
<span class="cline-any cline-yes">4x</span>
|
|
413
466
|
<span class="cline-any cline-no"> </span>
|
|
414
467
|
<span class="cline-any cline-no"> </span>
|
|
415
468
|
<span class="cline-any cline-no"> </span>
|
|
416
469
|
<span class="cline-any cline-no"> </span>
|
|
470
|
+
<span class="cline-any cline-yes">4x</span>
|
|
417
471
|
<span class="cline-any cline-no"> </span>
|
|
418
472
|
<span class="cline-any cline-no"> </span>
|
|
419
473
|
<span class="cline-any cline-no"> </span>
|
|
474
|
+
<span class="cline-any cline-yes">4x</span>
|
|
420
475
|
<span class="cline-any cline-no"> </span>
|
|
421
476
|
<span class="cline-any cline-no"> </span>
|
|
422
477
|
<span class="cline-any cline-no"> </span>
|
|
478
|
+
<span class="cline-any cline-yes">4x</span>
|
|
479
|
+
<span class="cline-any cline-yes">4x</span>
|
|
480
|
+
<span class="cline-any cline-yes">4x</span>
|
|
481
|
+
<span class="cline-any cline-yes">4x</span>
|
|
423
482
|
<span class="cline-any cline-no"> </span>
|
|
424
483
|
<span class="cline-any cline-no"> </span>
|
|
425
484
|
<span class="cline-any cline-no"> </span>
|
|
426
485
|
<span class="cline-any cline-no"> </span>
|
|
427
|
-
<span class="cline-any cline-
|
|
428
|
-
<span class="cline-any cline-
|
|
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
|
-
<span class="cline-any cline-no"> </span>
|
|
434
|
-
<span class="cline-any cline-no"> </span>
|
|
435
|
-
<span class="cline-any cline-no"> </span>
|
|
436
|
-
<span class="cline-any cline-no"> </span>
|
|
437
|
-
<span class="cline-any cline-no"> </span>
|
|
438
|
-
<span class="cline-any cline-no"> </span>
|
|
439
|
-
<span class="cline-any cline-no"> </span>
|
|
440
|
-
<span class="cline-any cline-no"> </span>
|
|
441
|
-
<span class="cline-any cline-no"> </span>
|
|
442
|
-
<span class="cline-any cline-no"> </span>
|
|
443
|
-
<span class="cline-any cline-no"> </span>
|
|
444
|
-
<span class="cline-any cline-no"> </span>
|
|
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
|
-
<span class="cline-any cline-no"> </span>
|
|
450
|
-
<span class="cline-any cline-no"> </span>
|
|
451
|
-
<span class="cline-any cline-no"> </span>
|
|
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
|
-
<span class="cline-any cline-no"> </span>
|
|
458
|
-
<span class="cline-any cline-no"> </span>
|
|
459
|
-
<span class="cline-any cline-no"> </span>
|
|
460
|
-
<span class="cline-any cline-no"> </span>
|
|
461
|
-
<span class="cline-any cline-no"> </span>
|
|
462
|
-
<span class="cline-any cline-no"> </span>
|
|
463
|
-
<span class="cline-any cline-no"> </span>
|
|
464
|
-
<span class="cline-any cline-no"> </span>
|
|
465
|
-
<span class="cline-any cline-no"> </span>
|
|
466
|
-
<span class="cline-any cline-no"> </span>
|
|
467
|
-
<span class="cline-any cline-no"> </span>
|
|
468
|
-
<span class="cline-any cline-no"> </span>
|
|
469
|
-
<span class="cline-any cline-no"> </span>
|
|
470
|
-
<span class="cline-any cline-no"> </span>
|
|
486
|
+
<span class="cline-any cline-yes">4x</span>
|
|
487
|
+
<span class="cline-any cline-yes">4x</span>
|
|
471
488
|
<span class="cline-any cline-yes">1x</span>
|
|
472
489
|
<span class="cline-any cline-yes">1x</span>
|
|
473
490
|
<span class="cline-any cline-no"> </span>
|
|
@@ -484,85 +501,85 @@
|
|
|
484
501
|
<span class="cline-any cline-no"> </span>
|
|
485
502
|
<span class="cline-any cline-yes">1x</span>
|
|
486
503
|
<span class="cline-any cline-yes">1x</span>
|
|
504
|
+
<span class="cline-any cline-yes">4x</span>
|
|
505
|
+
<span class="cline-any cline-yes">4x</span>
|
|
506
|
+
<span class="cline-any cline-yes">4x</span>
|
|
507
|
+
<span class="cline-any cline-yes">4x</span>
|
|
508
|
+
<span class="cline-any cline-yes">4x</span>
|
|
509
|
+
<span class="cline-any cline-yes">4x</span>
|
|
510
|
+
<span class="cline-any cline-yes">4x</span>
|
|
511
|
+
<span class="cline-any cline-yes">4x</span>
|
|
512
|
+
<span class="cline-any cline-yes">4x</span>
|
|
513
|
+
<span class="cline-any cline-yes">4x</span>
|
|
514
|
+
<span class="cline-any cline-yes">4x</span>
|
|
487
515
|
<span class="cline-any cline-no"> </span>
|
|
488
516
|
<span class="cline-any cline-no"> </span>
|
|
489
517
|
<span class="cline-any cline-no"> </span>
|
|
518
|
+
<span class="cline-any cline-yes">4x</span>
|
|
490
519
|
<span class="cline-any cline-no"> </span>
|
|
491
520
|
<span class="cline-any cline-no"> </span>
|
|
492
521
|
<span class="cline-any cline-no"> </span>
|
|
522
|
+
<span class="cline-any cline-yes">4x</span>
|
|
523
|
+
<span class="cline-any cline-yes">4x</span>
|
|
524
|
+
<span class="cline-any cline-yes">4x</span>
|
|
525
|
+
<span class="cline-any cline-yes">4x</span>
|
|
526
|
+
<span class="cline-any cline-yes">4x</span>
|
|
527
|
+
<span class="cline-any cline-yes">4x</span>
|
|
528
|
+
<span class="cline-any cline-yes">4x</span>
|
|
529
|
+
<span class="cline-any cline-yes">4x</span>
|
|
493
530
|
<span class="cline-any cline-no"> </span>
|
|
494
531
|
<span class="cline-any cline-no"> </span>
|
|
495
532
|
<span class="cline-any cline-no"> </span>
|
|
533
|
+
<span class="cline-any cline-yes">4x</span>
|
|
496
534
|
<span class="cline-any cline-no"> </span>
|
|
497
535
|
<span class="cline-any cline-no"> </span>
|
|
498
536
|
<span class="cline-any cline-no"> </span>
|
|
537
|
+
<span class="cline-any cline-yes">4x</span>
|
|
538
|
+
<span class="cline-any cline-yes">4x</span>
|
|
539
|
+
<span class="cline-any cline-yes">4x</span>
|
|
540
|
+
<span class="cline-any cline-yes">4x</span>
|
|
541
|
+
<span class="cline-any cline-yes">4x</span>
|
|
542
|
+
<span class="cline-any cline-yes">4x</span>
|
|
543
|
+
<span class="cline-any cline-yes">4x</span>
|
|
544
|
+
<span class="cline-any cline-yes">4x</span>
|
|
499
545
|
<span class="cline-any cline-no"> </span>
|
|
500
546
|
<span class="cline-any cline-no"> </span>
|
|
501
547
|
<span class="cline-any cline-no"> </span>
|
|
502
548
|
<span class="cline-any cline-no"> </span>
|
|
503
549
|
<span class="cline-any cline-no"> </span>
|
|
504
550
|
<span class="cline-any cline-no"> </span>
|
|
551
|
+
<span class="cline-any cline-yes">4x</span>
|
|
552
|
+
<span class="cline-any cline-yes">4x</span>
|
|
553
|
+
<span class="cline-any cline-yes">4x</span>
|
|
554
|
+
<span class="cline-any cline-yes">4x</span>
|
|
555
|
+
<span class="cline-any cline-yes">4x</span>
|
|
556
|
+
<span class="cline-any cline-yes">4x</span>
|
|
557
|
+
<span class="cline-any cline-yes">4x</span>
|
|
558
|
+
<span class="cline-any cline-yes">4x</span>
|
|
559
|
+
<span class="cline-any cline-yes">4x</span>
|
|
560
|
+
<span class="cline-any cline-yes">4x</span>
|
|
505
561
|
<span class="cline-any cline-no"> </span>
|
|
506
562
|
<span class="cline-any cline-no"> </span>
|
|
507
563
|
<span class="cline-any cline-no"> </span>
|
|
564
|
+
<span class="cline-any cline-yes">4x</span>
|
|
508
565
|
<span class="cline-any cline-no"> </span>
|
|
509
566
|
<span class="cline-any cline-no"> </span>
|
|
510
567
|
<span class="cline-any cline-no"> </span>
|
|
568
|
+
<span class="cline-any cline-yes">4x</span>
|
|
511
569
|
<span class="cline-any cline-no"> </span>
|
|
512
570
|
<span class="cline-any cline-no"> </span>
|
|
513
571
|
<span class="cline-any cline-no"> </span>
|
|
572
|
+
<span class="cline-any cline-yes">4x</span>
|
|
573
|
+
<span class="cline-any cline-yes">4x</span>
|
|
574
|
+
<span class="cline-any cline-yes">4x</span>
|
|
575
|
+
<span class="cline-any cline-yes">4x</span>
|
|
514
576
|
<span class="cline-any cline-no"> </span>
|
|
515
577
|
<span class="cline-any cline-no"> </span>
|
|
516
578
|
<span class="cline-any cline-no"> </span>
|
|
517
579
|
<span class="cline-any cline-no"> </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-no"> </span>
|
|
522
|
-
<span class="cline-any cline-no"> </span>
|
|
523
|
-
<span class="cline-any cline-no"> </span>
|
|
524
|
-
<span class="cline-any cline-no"> </span>
|
|
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
|
-
<span class="cline-any cline-no"> </span>
|
|
529
|
-
<span class="cline-any cline-no"> </span>
|
|
530
|
-
<span class="cline-any cline-no"> </span>
|
|
531
|
-
<span class="cline-any cline-no"> </span>
|
|
532
|
-
<span class="cline-any cline-no"> </span>
|
|
533
|
-
<span class="cline-any cline-no"> </span>
|
|
534
|
-
<span class="cline-any cline-no"> </span>
|
|
535
|
-
<span class="cline-any cline-no"> </span>
|
|
536
|
-
<span class="cline-any cline-no"> </span>
|
|
537
|
-
<span class="cline-any cline-no"> </span>
|
|
538
|
-
<span class="cline-any cline-no"> </span>
|
|
539
|
-
<span class="cline-any cline-no"> </span>
|
|
540
|
-
<span class="cline-any cline-no"> </span>
|
|
541
|
-
<span class="cline-any cline-no"> </span>
|
|
542
|
-
<span class="cline-any cline-no"> </span>
|
|
543
|
-
<span class="cline-any cline-no"> </span>
|
|
544
|
-
<span class="cline-any cline-no"> </span>
|
|
545
|
-
<span class="cline-any cline-no"> </span>
|
|
546
|
-
<span class="cline-any cline-no"> </span>
|
|
547
|
-
<span class="cline-any cline-no"> </span>
|
|
548
|
-
<span class="cline-any cline-no"> </span>
|
|
549
|
-
<span class="cline-any cline-no"> </span>
|
|
550
|
-
<span class="cline-any cline-no"> </span>
|
|
551
|
-
<span class="cline-any cline-no"> </span>
|
|
552
|
-
<span class="cline-any cline-no"> </span>
|
|
553
|
-
<span class="cline-any cline-no"> </span>
|
|
554
|
-
<span class="cline-any cline-no"> </span>
|
|
555
|
-
<span class="cline-any cline-no"> </span>
|
|
556
|
-
<span class="cline-any cline-no"> </span>
|
|
557
|
-
<span class="cline-any cline-no"> </span>
|
|
558
|
-
<span class="cline-any cline-no"> </span>
|
|
559
|
-
<span class="cline-any cline-no"> </span>
|
|
560
|
-
<span class="cline-any cline-no"> </span>
|
|
561
|
-
<span class="cline-any cline-no"> </span>
|
|
562
|
-
<span class="cline-any cline-no"> </span>
|
|
563
|
-
<span class="cline-any cline-no"> </span>
|
|
564
|
-
<span class="cline-any cline-no"> </span>
|
|
565
|
-
<span class="cline-any cline-no"> </span>
|
|
580
|
+
<span class="cline-any cline-yes">4x</span>
|
|
581
|
+
<span class="cline-any cline-yes">4x</span>
|
|
582
|
+
<span class="cline-any cline-yes">4x</span>
|
|
566
583
|
<span class="cline-any cline-yes">1x</span>
|
|
567
584
|
<span class="cline-any cline-yes">1x</span>
|
|
568
585
|
<span class="cline-any cline-no"> </span>
|
|
@@ -571,20 +588,36 @@
|
|
|
571
588
|
<span class="cline-any cline-yes">1x</span>
|
|
572
589
|
<span class="cline-any cline-yes">1x</span>
|
|
573
590
|
<span class="cline-any cline-yes">1x</span>
|
|
591
|
+
<span class="cline-any cline-yes">1x</span>
|
|
592
|
+
<span class="cline-any cline-yes">29x</span>
|
|
574
593
|
<span class="cline-any cline-yes">2x</span>
|
|
575
|
-
<span class="cline-any cline-yes">
|
|
576
|
-
<span class="cline-any cline-yes">
|
|
577
|
-
<span class="cline-any cline-yes">
|
|
578
|
-
<span class="cline-any cline-yes">
|
|
579
|
-
<span class="cline-any cline-yes">
|
|
580
|
-
<span class="cline-any cline-yes">
|
|
581
|
-
<span class="cline-any cline-yes">
|
|
582
|
-
<span class="cline-any cline-yes">
|
|
583
|
-
<span class="cline-any cline-yes">
|
|
584
|
-
<span class="cline-any cline-
|
|
585
|
-
|
|
594
|
+
<span class="cline-any cline-yes">29x</span>
|
|
595
|
+
<span class="cline-any cline-yes">17x</span>
|
|
596
|
+
<span class="cline-any cline-yes">17x</span>
|
|
597
|
+
<span class="cline-any cline-yes">17x</span>
|
|
598
|
+
<span class="cline-any cline-yes">17x</span>
|
|
599
|
+
<span class="cline-any cline-yes">6x</span>
|
|
600
|
+
<span class="cline-any cline-yes">6x</span>
|
|
601
|
+
<span class="cline-any cline-yes">6x</span>
|
|
602
|
+
<span class="cline-any cline-yes">6x</span>
|
|
603
|
+
<span class="cline-any cline-yes">17x</span>
|
|
604
|
+
<span class="cline-any cline-yes">11x</span>
|
|
605
|
+
<span class="cline-any cline-yes">11x</span>
|
|
606
|
+
<span class="cline-any cline-yes">17x</span>
|
|
607
|
+
<span class="cline-any cline-yes">17x</span>
|
|
608
|
+
<span class="cline-any cline-yes">29x</span>
|
|
609
|
+
<span class="cline-any cline-yes">1x</span>
|
|
610
|
+
<span class="cline-any cline-yes">1x</span>
|
|
611
|
+
<span class="cline-any cline-yes">1x</span>
|
|
612
|
+
<span class="cline-any cline-yes">6x</span>
|
|
613
|
+
<span class="cline-any cline-yes">16x</span>
|
|
614
|
+
<span class="cline-any cline-yes">16x</span>
|
|
615
|
+
<span class="cline-any cline-yes">16x</span>
|
|
616
|
+
<span class="cline-any cline-yes">6x</span></td><td class="text"><pre class="prettyprint lang-js">import _ from 'lodash'
|
|
586
617
|
import mongodb from 'mongodb'
|
|
587
618
|
import makeDebug from 'debug'
|
|
619
|
+
import { marshallComparisonFields, marshallTime, marshallBooleanFields, marshallNumberFields, marshallDateFields } from '../marshall.js'
|
|
620
|
+
import { isValidObjectID, isObjectID } from '../db.js'
|
|
588
621
|
import { makeDiacriticPattern } from '../../common/utils.js'
|
|
589
622
|
|
|
590
623
|
const { ObjectID } = mongodb
|
|
@@ -653,80 +686,80 @@ export <span class="fstat-no" title="function not covered" >async function aggre
|
|
|
653
686
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
654
687
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
655
688
|
|
|
656
|
-
export
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
689
|
+
export function populateObject (options) {
|
|
690
|
+
return async function (hook) {
|
|
691
|
+
const app = hook.app
|
|
692
|
+
const data = hook.data
|
|
693
|
+
const params = hook.params
|
|
694
|
+
const query = params.query
|
|
695
|
+
const context = hook.service.context
|
|
696
|
+
const idProperty = options.nameIdAs || options.idField
|
|
697
|
+
const serviceProperty = options.nameServiceAs || options.serviceField
|
|
698
|
+
|
|
699
|
+
// Check if not already done
|
|
700
|
+
if (typeof _.get(params, idProperty) === 'object') <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
668
701
|
<span class="cstat-no" title="statement not covered" > debug(`Skipping populating ${idProperty} as already done`)</span>
|
|
669
702
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
670
703
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
671
|
-
|
|
704
|
+
if (typeof _.get(params, serviceProperty) === 'object') <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
672
705
|
<span class="cstat-no" title="statement not covered" > debug(`Skipping populating ${serviceProperty} as already done`)</span>
|
|
673
706
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
674
707
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
<span class="
|
|
708
|
+
|
|
709
|
+
// Get service where we can find the object to populate
|
|
710
|
+
// Make hook usable with query params as well and service name or real object
|
|
711
|
+
let service = _.get(data, options.serviceField) || _.get(query, options.serviceField)
|
|
712
|
+
if (typeof service === 'string') {
|
|
713
|
+
const message = `Cannot find the service for ${options.serviceField} = ${service} to dynamically populate.`
|
|
714
|
+
service = app.getService(service, context)
|
|
715
|
+
if (!service) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
683
716
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(message)</span>
|
|
684
717
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
685
718
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
686
|
-
<span class="
|
|
719
|
+
}<span class="branch-0 cbranch-no" title="branch not covered" > else if (!service) {</span>
|
|
687
720
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(`No ${options.serviceField} given to dynamically populate.`)</span>
|
|
688
721
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
689
722
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
<span class="
|
|
723
|
+
// Then the object ID
|
|
724
|
+
const id = _.get(data, options.idField) || _.get(query, options.idField) || _.get(hook, 'id')
|
|
725
|
+
if (!id) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
693
726
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(`Cannot find the ${options.idField} to dynamically populate.`)</span>
|
|
694
727
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
695
728
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
<span class="
|
|
729
|
+
debug(`Populating ${idProperty} with ID ${id}`)
|
|
730
|
+
// Set the retrieved service on the same field or given one in hook params
|
|
731
|
+
_.set(params, serviceProperty, service)
|
|
732
|
+
// Let it work with id/name string or real object
|
|
733
|
+
if (typeof id === 'string' || isObjectID(id)) {
|
|
734
|
+
const args = { user: hook.params.user }
|
|
735
|
+
let object
|
|
736
|
+
try {
|
|
737
|
+
// Get by ID or name ?
|
|
738
|
+
if (isObjectID(id) || isValidObjectID(id)) {
|
|
739
|
+
object = await service.get(id.toString(), args)
|
|
740
|
+
}<span class="branch-0 cbranch-no" title="branch not covered" > else {</span>
|
|
708
741
|
<span class="cstat-no" title="statement not covered" > Object.assign(args, { query: { name: id.toString() }, paginate: false })</span>
|
|
709
742
|
<span class="cstat-no" title="statement not covered" > const results = await service.find(args)</span>
|
|
710
743
|
<span class="cstat-no" title="statement not covered" > if (results.length >= 0) object = results[0]</span>
|
|
711
744
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
712
|
-
<span class="
|
|
745
|
+
} <span class="branch-0 cbranch-no" title="branch not covered" >catch (error) {</span>
|
|
713
746
|
<span class="cstat-no" title="statement not covered" > // Not found error is managed hereafter</span>
|
|
714
747
|
<span class="cstat-no" title="statement not covered" > if (error.code !== 404) throw error</span>
|
|
715
748
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
716
|
-
<span class="
|
|
749
|
+
if (!object) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
717
750
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(`Cannot find object with id ${id} to dynamically populate.`)</span>
|
|
718
751
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
719
752
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
<span class="
|
|
753
|
+
// Set the retrieved object on the same field or given one in hook params
|
|
754
|
+
_.set(params, idProperty, object)
|
|
755
|
+
return hook
|
|
756
|
+
}<span class="branch-0 cbranch-no" title="branch not covered" > else {</span>
|
|
724
757
|
<span class="cstat-no" title="statement not covered" > // Set the object on the same field or given one in hook params</span>
|
|
725
758
|
<span class="cstat-no" title="statement not covered" > _.set(params, idProperty, id)</span>
|
|
726
759
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
727
760
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
728
|
-
|
|
729
|
-
|
|
761
|
+
}
|
|
762
|
+
}
|
|
730
763
|
|
|
731
764
|
export <span class="fstat-no" title="function not covered" >function unpopulateObject (options) {</span>
|
|
732
765
|
<span class="cstat-no" title="statement not covered" > return function (hook) {</span>
|
|
@@ -742,112 +775,127 @@ export <span class="fstat-no" title="function not covered" >function unpopulateO
|
|
|
742
775
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
743
776
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
744
777
|
|
|
745
|
-
export
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
<span class="
|
|
778
|
+
export function populateObjects (options) {
|
|
779
|
+
return async function (hook) {
|
|
780
|
+
const app = hook.app
|
|
781
|
+
const data = hook.data
|
|
782
|
+
const params = hook.params
|
|
783
|
+
const query = params.query
|
|
784
|
+
const context = hook.service.context
|
|
785
|
+
const idProperty = options.nameIdAs || options.idField
|
|
786
|
+
const serviceProperty = options.nameServiceAs || options.serviceField
|
|
787
|
+
|
|
788
|
+
// Check if not already done
|
|
789
|
+
if (Array.isArray(_.get(params, idProperty))) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
757
790
|
<span class="cstat-no" title="statement not covered" > debug(`Skipping populating ${idProperty} as already done`)</span>
|
|
758
791
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
759
792
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
760
|
-
|
|
793
|
+
if (typeof _.get(params, serviceProperty) === 'object') <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
761
794
|
<span class="cstat-no" title="statement not covered" > debug(`Skipping populating ${serviceProperty} as already done`)</span>
|
|
762
795
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
763
796
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
<span class="
|
|
797
|
+
|
|
798
|
+
// Get service where we can find the object to populate
|
|
799
|
+
// Make hook usable with query params as well and service name or real object
|
|
800
|
+
let service = _.get(data, options.serviceField) || _.get(query, options.serviceField)
|
|
801
|
+
if (typeof service === 'string') {
|
|
802
|
+
const message = `Cannot find the service for ${options.serviceField} = ${service} to dynamically populate.`
|
|
803
|
+
service = app.getService(service, context)
|
|
804
|
+
if (!service) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
772
805
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(message)</span>
|
|
773
806
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
774
807
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
775
|
-
<span class="
|
|
808
|
+
}<span class="branch-0 cbranch-no" title="branch not covered" > else if (!service) {</span>
|
|
776
809
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(`No ${options.serviceField} given to dynamically populate.`)</span>
|
|
777
810
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
778
811
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
<span class="
|
|
812
|
+
|
|
813
|
+
// Set the retrieved service on the same field or given one in hook params
|
|
814
|
+
_.set(params, serviceProperty, service)
|
|
815
|
+
|
|
816
|
+
// Then the object ID
|
|
817
|
+
const id = _.get(data, options.idField) || _.get(query, options.idField)
|
|
818
|
+
// If no ID given we perform a find, no pagination to be sure we get all objects
|
|
819
|
+
if (!id) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
787
820
|
<span class="cstat-no" title="statement not covered" > debug(`Populating ${idProperty}`)</span>
|
|
788
821
|
<span class="cstat-no" title="statement not covered" > const objects = await service.find({ query: {}, paginate: false, user: hook.params.user })</span>
|
|
789
822
|
<span class="cstat-no" title="statement not covered" > // Set the retrieved objects on the same field or given one in hook params</span>
|
|
790
823
|
<span class="cstat-no" title="statement not covered" > debug(`Populated ${objects.length} ${idProperty}`)</span>
|
|
791
824
|
<span class="cstat-no" title="statement not covered" > _.set(params, idProperty, objects)</span>
|
|
792
825
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
<span class="
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
<span class="
|
|
826
|
+
} else {
|
|
827
|
+
debug(`Populating ${idProperty} with ID ${id}`)
|
|
828
|
+
// Let it work with id/name string or real object
|
|
829
|
+
if (typeof id === 'string' <span class="branch-0 cbranch-no" title="branch not covered" >|| isObjectID(id))</span> {
|
|
830
|
+
let object
|
|
831
|
+
try {
|
|
832
|
+
// Get by ID or name ?
|
|
833
|
+
if (isObjectID(id) || isValidObjectID(id)) {
|
|
834
|
+
object = await service.get(id.toString(), { user: hook.params.user })
|
|
835
|
+
}<span class="branch-0 cbranch-no" title="branch not covered" > else {</span>
|
|
803
836
|
<span class="cstat-no" title="statement not covered" > const results = await service.find({ query: { name: id.toString() }, paginate: false, user: hook.params.user })</span>
|
|
804
837
|
<span class="cstat-no" title="statement not covered" > if (results.length >= 0) object = results[0]</span>
|
|
805
838
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
806
|
-
<span class="
|
|
839
|
+
} <span class="branch-0 cbranch-no" title="branch not covered" >catch (error) {</span>
|
|
807
840
|
<span class="cstat-no" title="statement not covered" > // Not found error is managed hereafter</span>
|
|
808
841
|
<span class="cstat-no" title="statement not covered" > if (error.code !== 404) throw error</span>
|
|
809
842
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
810
|
-
<span class="
|
|
843
|
+
if (!object) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
811
844
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(`Cannot find ${options.idField} = ${id} to dynamically populate.`)</span>
|
|
812
845
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
813
846
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
<span class="
|
|
847
|
+
// Set the retrieved object on the same field or given one in hook params
|
|
848
|
+
_.set(params, idProperty, [object])
|
|
849
|
+
return hook
|
|
850
|
+
}<span class="branch-0 cbranch-no" title="branch not covered" > else {</span>
|
|
818
851
|
<span class="cstat-no" title="statement not covered" > // Set the object on the same field or given one in hook params</span>
|
|
819
852
|
<span class="cstat-no" title="statement not covered" > _.set(params, idProperty, [id])</span>
|
|
820
853
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
821
854
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
}
|
|
825
858
|
|
|
826
859
|
export <span class="fstat-no" title="function not covered" >function unpopulateObjects (options) {</span>
|
|
827
860
|
<span class="cstat-no" title="statement not covered" > // These are similar behaviour</span>
|
|
828
861
|
<span class="cstat-no" title="statement not covered" > return unpopulateObject(options)</span>
|
|
829
862
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
830
863
|
|
|
831
|
-
//
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
864
|
+
// Recursively transform any $regex on object to a new $regex managing diacritics.
|
|
865
|
+
// Will flag the regex items with a diacritic property in order to avoid do it twice.
|
|
866
|
+
export function toDiacriticRegex(object) {
|
|
867
|
+
if (Array.isArray(object)) {
|
|
868
|
+
object.forEach(toDiacriticRegex)
|
|
869
|
+
} else if (typeof object === 'object') {
|
|
870
|
+
_.forOwn(object, (value, key) => {
|
|
871
|
+
if (!value) <span class="branch-0 cbranch-no" title="branch not covered" >return</span>
|
|
872
|
+
// Check if applicable
|
|
873
|
+
if (value.$regex && !value.$regex.diacritic && value.$regex.source && !value.$diacriticSensitive) {
|
|
837
874
|
// Take care to support as well case sensitivity by keeping flags
|
|
838
|
-
|
|
875
|
+
value.$regex = new RegExp(makeDiacriticPattern(value.$regex.source), value.$regex.flags)
|
|
876
|
+
// Custom internal property to make the hook reentrant
|
|
877
|
+
value.$regex.diacritic = true
|
|
878
|
+
} else {
|
|
879
|
+
toDiacriticRegex(value)
|
|
839
880
|
}
|
|
840
881
|
})
|
|
841
882
|
}
|
|
842
883
|
}
|
|
843
|
-
 
|
|
884
|
+
|
|
885
|
+
// Used to manage diacritic insensitive fuzzy search
|
|
886
|
+
export function diacriticSearch (options = {}) {
|
|
887
|
+
return hook => {
|
|
888
|
+
const query = hook.params.query
|
|
889
|
+
if (query) toDiacriticRegex(query)
|
|
890
|
+
}
|
|
891
|
+
}</pre></td></tr></table></pre>
|
|
844
892
|
|
|
845
893
|
<div class='push'></div><!-- for sticky footer -->
|
|
846
894
|
</div><!-- /wrapper -->
|
|
847
895
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
848
896
|
Code coverage generated by
|
|
849
897
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
850
|
-
at
|
|
898
|
+
at 2025-12-17T09:26:49.774Z
|
|
851
899
|
</div>
|
|
852
900
|
<script src="../../../prettify.js"></script>
|
|
853
901
|
<script>
|