@kalisio/kdk 2.6.3 → 2.6.4
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/.vscode/settings.json +5 -0
- package/coverage/core/api/application.js.html +398 -392
- package/coverage/core/api/authentication.js.html +187 -352
- package/coverage/core/api/db.js.html +126 -165
- package/coverage/core/api/hooks/hooks.authentication.js.html +196 -22
- package/coverage/core/api/hooks/hooks.authorisations.js.html +662 -383
- package/coverage/{lcov-report/core/api/hooks/hooks.tags.js.html → core/api/hooks/hooks.groups.js.html} +76 -100
- package/coverage/core/api/hooks/hooks.logger.js.html +41 -41
- package/coverage/core/api/hooks/hooks.model.js.html +101 -113
- package/coverage/core/api/hooks/hooks.organisations.js.html +541 -0
- package/coverage/core/api/hooks/hooks.push.js.html +97 -112
- package/coverage/core/api/hooks/hooks.query.js.html +222 -270
- 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.users.js.html +447 -255
- package/coverage/core/api/hooks/index.html +122 -107
- package/coverage/core/api/hooks/index.js.html +10 -4
- package/coverage/core/api/index.html +61 -46
- package/coverage/core/api/index.js.html +9 -9
- package/coverage/core/api/marshall.js.html +9 -9
- package/coverage/{lcov-report/map/api/models/styles.model.mongodb.js.html → core/api/models/groups.model.mongodb.js.html} +7 -10
- package/coverage/core/api/models/index.html +50 -35
- package/coverage/core/api/models/messages.model.mongodb.js.html +27 -39
- package/coverage/{lcov-report/core/api/models/configurations.model.mongodb.js.html → core/api/models/organisations.model.mongodb.js.html} +7 -10
- package/coverage/core/api/models/tags.model.mongodb.js.html +32 -26
- 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 +222 -213
- package/coverage/core/api/services/authorisations/index.html +21 -21
- 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/{lcov-report/core/api/services/configurations/configurations.hooks.js.html → core/api/services/groups/groups.hooks.js.html} +10 -16
- package/coverage/core/api/services/{configurations → groups}/index.html +8 -8
- 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 +142 -313
- 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 +76 -112
- package/coverage/{lcov-report/map/api/services/styles → core/api/services/organisations}/index.html +25 -10
- package/coverage/core/api/services/{configurations/configurations.hooks.js.html → organisations/organisations.hooks.js.html} +10 -16
- package/coverage/core/api/services/organisations/organisations.service.js.html +343 -0
- 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 +71 -119
- package/coverage/core/api/services/users/index.html +12 -27
- package/coverage/core/api/services/users/users.hooks.js.html +11 -14
- package/coverage/core/api/utils.js.html +118 -0
- package/coverage/core/common/errors.js.html +1 -1
- package/coverage/core/common/index.html +27 -42
- package/coverage/core/common/index.js.html +1 -1
- package/coverage/core/common/permissions.js.html +472 -166
- package/coverage/core/common/schema.js.html +4 -4
- package/coverage/core/common/utils.js.html +25 -31
- package/coverage/index.html +192 -192
- package/coverage/lcov-report/core/api/application.js.html +398 -392
- package/coverage/lcov-report/core/api/authentication.js.html +187 -352
- package/coverage/lcov-report/core/api/db.js.html +126 -165
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +196 -22
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +662 -383
- package/coverage/{core/api/hooks/hooks.tags.js.html → lcov-report/core/api/hooks/hooks.groups.js.html} +76 -100
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +41 -41
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +101 -113
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +541 -0
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +97 -112
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +222 -270
- 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.users.js.html +447 -255
- package/coverage/lcov-report/core/api/hooks/index.html +122 -107
- package/coverage/lcov-report/core/api/hooks/index.js.html +10 -4
- package/coverage/lcov-report/core/api/index.html +61 -46
- package/coverage/lcov-report/core/api/index.js.html +9 -9
- package/coverage/lcov-report/core/api/marshall.js.html +9 -9
- package/coverage/{map/api/models/styles.model.mongodb.js.html → lcov-report/core/api/models/groups.model.mongodb.js.html} +7 -10
- package/coverage/lcov-report/core/api/models/index.html +50 -35
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +27 -39
- package/coverage/{core/api/models/configurations.model.mongodb.js.html → lcov-report/core/api/models/organisations.model.mongodb.js.html} +7 -10
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +32 -26
- 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 +222 -213
- package/coverage/lcov-report/core/api/services/authorisations/index.html +21 -21
- 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/{map/api/services/styles/styles.hooks.js.html → core/api/services/groups/groups.hooks.js.html} +12 -45
- package/coverage/lcov-report/core/api/services/{configurations → groups}/index.html +8 -8
- 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 +142 -313
- 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 +76 -112
- package/coverage/{map/api/services/styles → lcov-report/core/api/services/organisations}/index.html +25 -10
- package/coverage/{map/api/services/styles/styles.hooks.js.html → lcov-report/core/api/services/organisations/organisations.hooks.js.html} +12 -45
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +343 -0
- 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 +71 -119
- package/coverage/lcov-report/core/api/services/users/index.html +12 -27
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +11 -14
- package/coverage/lcov-report/core/api/utils.js.html +118 -0
- package/coverage/lcov-report/core/common/errors.js.html +1 -1
- package/coverage/lcov-report/core/common/index.html +27 -42
- package/coverage/lcov-report/core/common/index.js.html +1 -1
- package/coverage/lcov-report/core/common/permissions.js.html +472 -166
- package/coverage/lcov-report/core/common/schema.js.html +4 -4
- package/coverage/lcov-report/core/common/utils.js.html +25 -31
- package/coverage/lcov-report/index.html +192 -192
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +31 -169
- 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 +7 -82
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/index.html +7 -22
- package/coverage/lcov-report/map/api/models/projects.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 +12 -39
- 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 +11 -86
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +4 -307
- 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 +50 -326
- 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/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 +10 -7
- 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 +7 -4
- package/coverage/lcov-report/map/common/permissions.js.html +4 -10
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/tms-utils.js.html +12 -9
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +3 -3
- package/coverage/lcov-report/map/common/wcs-utils.js.html +15 -12
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +2 -2
- package/coverage/lcov-report/map/common/wfs-utils.js.html +17 -14
- package/coverage/lcov-report/map/common/wms-utils.js.html +12 -30
- package/coverage/lcov-report/map/common/wmts-utils.js.html +13 -10
- package/coverage/lcov.info +4096 -4359
- package/coverage/map/api/hooks/hooks.catalog.js.html +31 -169
- 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 +7 -82
- package/coverage/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/index.html +7 -22
- package/coverage/map/api/models/projects.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 +12 -39
- 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 +11 -86
- package/coverage/map/api/services/features/features.service.js.html +4 -307
- 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 +50 -326
- 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/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 +10 -7
- 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 +7 -4
- package/coverage/map/common/permissions.js.html +4 -10
- package/coverage/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/map/common/tms-utils.js.html +12 -9
- package/coverage/map/common/wcs-grid-source.js.html +3 -3
- package/coverage/map/common/wcs-utils.js.html +15 -12
- package/coverage/map/common/weacast-grid-source.js.html +2 -2
- package/coverage/map/common/wfs-utils.js.html +17 -14
- package/coverage/map/common/wms-utils.js.html +12 -30
- package/coverage/map/common/wmts-utils.js.html +13 -10
- package/coverage/tmp/coverage-151166-1723543324307-0.json +1 -0
- package/coverage/tmp/coverage-151178-1723543324283-0.json +1 -0
- package/coverage/tmp/coverage-151189-1723543324271-0.json +1 -0
- package/coverage/tmp/coverage-151201-1723543324248-0.json +1 -0
- package/coverage/tmp/coverage-151208-1723543324227-0.json +1 -0
- package/extras/tours/pane.top.js +9 -0
- package/map/client/i18n/map_en.json +2 -1
- package/map/client/i18n/map_fr.json +2 -1
- package/package.json +1 -1
- package/test/api/core/test-log-2024-04-22.log +84 -0
- package/test/api/core/{test-log-2025-10-03.log → test-log-2024-04-23.log} +9 -4
- package/test/api/core/test-log-2024-08-13.log +3 -0
- 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/coverage/core/api/services/users/users.service.js.html +0 -100
- package/coverage/core/common/utils.offline.js.html +0 -199
- package/coverage/lcov-report/core/api/services/users/users.service.js.html +0 -100
- package/coverage/lcov-report/core/common/utils.offline.js.html +0 -199
- 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/coverage/tmp/coverage-222566-1765963609278-0.json +0 -1
- package/test/api/core/test-log-2025-07-31.log +0 -15
- 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/test/api/{core/test-log-2025-11-10.log → map/test-log-2025-03-08.log} +0 -0
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">25.86% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>67/259</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">80% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>8/10</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">36.36% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>4/11</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">25.86% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>67/259</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 low'></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,24 +322,7 @@
|
|
|
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>
|
|
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>
|
|
325
|
+
<a name='L260'></a><a href='#L260'>260</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
343
326
|
<span class="cline-any cline-yes">1x</span>
|
|
344
327
|
<span class="cline-any cline-yes">1x</span>
|
|
345
328
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -357,12 +340,12 @@
|
|
|
357
340
|
<span class="cline-any cline-no"> </span>
|
|
358
341
|
<span class="cline-any cline-yes">1x</span>
|
|
359
342
|
<span class="cline-any cline-yes">1x</span>
|
|
360
|
-
<span class="cline-any cline-yes">
|
|
361
|
-
<span class="cline-any cline-yes">
|
|
362
|
-
<span class="cline-any cline-yes">
|
|
363
|
-
<span class="cline-any cline-yes">
|
|
364
|
-
<span class="cline-any cline-yes">
|
|
365
|
-
<span class="cline-any cline-yes">
|
|
343
|
+
<span class="cline-any cline-yes">1x</span>
|
|
344
|
+
<span class="cline-any cline-yes">1x</span>
|
|
345
|
+
<span class="cline-any cline-yes">1x</span>
|
|
346
|
+
<span class="cline-any cline-yes">1x</span>
|
|
347
|
+
<span class="cline-any cline-yes">1x</span>
|
|
348
|
+
<span class="cline-any cline-yes">1x</span>
|
|
366
349
|
<span class="cline-any cline-yes">1x</span>
|
|
367
350
|
<span class="cline-any cline-yes">1x</span>
|
|
368
351
|
<span class="cline-any cline-no"> </span>
|
|
@@ -412,79 +395,79 @@
|
|
|
412
395
|
<span class="cline-any cline-no"> </span>
|
|
413
396
|
<span class="cline-any cline-yes">1x</span>
|
|
414
397
|
<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>
|
|
426
398
|
<span class="cline-any cline-no"> </span>
|
|
427
399
|
<span class="cline-any cline-no"> </span>
|
|
428
400
|
<span class="cline-any cline-no"> </span>
|
|
429
|
-
<span class="cline-any cline-yes">4x</span>
|
|
430
401
|
<span class="cline-any cline-no"> </span>
|
|
431
402
|
<span class="cline-any cline-no"> </span>
|
|
432
403
|
<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>
|
|
441
404
|
<span class="cline-any cline-no"> </span>
|
|
442
405
|
<span class="cline-any cline-no"> </span>
|
|
443
406
|
<span class="cline-any cline-no"> </span>
|
|
444
|
-
<span class="cline-any cline-yes">4x</span>
|
|
445
407
|
<span class="cline-any cline-no"> </span>
|
|
446
408
|
<span class="cline-any cline-no"> </span>
|
|
447
409
|
<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>
|
|
451
410
|
<span class="cline-any cline-no"> </span>
|
|
452
411
|
<span class="cline-any cline-no"> </span>
|
|
453
412
|
<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>
|
|
466
413
|
<span class="cline-any cline-no"> </span>
|
|
467
414
|
<span class="cline-any cline-no"> </span>
|
|
468
415
|
<span class="cline-any cline-no"> </span>
|
|
469
416
|
<span class="cline-any cline-no"> </span>
|
|
470
|
-
<span class="cline-any cline-yes">4x</span>
|
|
471
417
|
<span class="cline-any cline-no"> </span>
|
|
472
418
|
<span class="cline-any cline-no"> </span>
|
|
473
419
|
<span class="cline-any cline-no"> </span>
|
|
474
|
-
<span class="cline-any cline-yes">4x</span>
|
|
475
420
|
<span class="cline-any cline-no"> </span>
|
|
476
421
|
<span class="cline-any cline-no"> </span>
|
|
477
422
|
<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>
|
|
482
423
|
<span class="cline-any cline-no"> </span>
|
|
483
424
|
<span class="cline-any cline-no"> </span>
|
|
484
425
|
<span class="cline-any cline-no"> </span>
|
|
485
426
|
<span class="cline-any cline-no"> </span>
|
|
486
|
-
<span class="cline-any cline-
|
|
487
|
-
<span class="cline-any cline-
|
|
427
|
+
<span class="cline-any cline-no"> </span>
|
|
428
|
+
<span class="cline-any cline-no"> </span>
|
|
429
|
+
<span class="cline-any cline-no"> </span>
|
|
430
|
+
<span class="cline-any cline-no"> </span>
|
|
431
|
+
<span class="cline-any cline-no"> </span>
|
|
432
|
+
<span class="cline-any cline-no"> </span>
|
|
433
|
+
<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>
|
|
488
471
|
<span class="cline-any cline-yes">1x</span>
|
|
489
472
|
<span class="cline-any cline-yes">1x</span>
|
|
490
473
|
<span class="cline-any cline-no"> </span>
|
|
@@ -501,85 +484,85 @@
|
|
|
501
484
|
<span class="cline-any cline-no"> </span>
|
|
502
485
|
<span class="cline-any cline-yes">1x</span>
|
|
503
486
|
<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>
|
|
515
487
|
<span class="cline-any cline-no"> </span>
|
|
516
488
|
<span class="cline-any cline-no"> </span>
|
|
517
489
|
<span class="cline-any cline-no"> </span>
|
|
518
|
-
<span class="cline-any cline-yes">4x</span>
|
|
519
490
|
<span class="cline-any cline-no"> </span>
|
|
520
491
|
<span class="cline-any cline-no"> </span>
|
|
521
492
|
<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>
|
|
530
493
|
<span class="cline-any cline-no"> </span>
|
|
531
494
|
<span class="cline-any cline-no"> </span>
|
|
532
495
|
<span class="cline-any cline-no"> </span>
|
|
533
|
-
<span class="cline-any cline-yes">4x</span>
|
|
534
496
|
<span class="cline-any cline-no"> </span>
|
|
535
497
|
<span class="cline-any cline-no"> </span>
|
|
536
498
|
<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>
|
|
545
499
|
<span class="cline-any cline-no"> </span>
|
|
546
500
|
<span class="cline-any cline-no"> </span>
|
|
547
501
|
<span class="cline-any cline-no"> </span>
|
|
548
502
|
<span class="cline-any cline-no"> </span>
|
|
549
503
|
<span class="cline-any cline-no"> </span>
|
|
550
504
|
<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>
|
|
561
505
|
<span class="cline-any cline-no"> </span>
|
|
562
506
|
<span class="cline-any cline-no"> </span>
|
|
563
507
|
<span class="cline-any cline-no"> </span>
|
|
564
|
-
<span class="cline-any cline-yes">4x</span>
|
|
565
508
|
<span class="cline-any cline-no"> </span>
|
|
566
509
|
<span class="cline-any cline-no"> </span>
|
|
567
510
|
<span class="cline-any cline-no"> </span>
|
|
568
|
-
<span class="cline-any cline-yes">4x</span>
|
|
569
511
|
<span class="cline-any cline-no"> </span>
|
|
570
512
|
<span class="cline-any cline-no"> </span>
|
|
571
513
|
<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>
|
|
576
514
|
<span class="cline-any cline-no"> </span>
|
|
577
515
|
<span class="cline-any cline-no"> </span>
|
|
578
516
|
<span class="cline-any cline-no"> </span>
|
|
579
517
|
<span class="cline-any cline-no"> </span>
|
|
580
|
-
<span class="cline-any cline-
|
|
581
|
-
<span class="cline-any cline-
|
|
582
|
-
<span class="cline-any cline-
|
|
518
|
+
<span class="cline-any cline-no"> </span>
|
|
519
|
+
<span class="cline-any cline-no"> </span>
|
|
520
|
+
<span class="cline-any cline-no"> </span>
|
|
521
|
+
<span class="cline-any cline-no"> </span>
|
|
522
|
+
<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>
|
|
583
566
|
<span class="cline-any cline-yes">1x</span>
|
|
584
567
|
<span class="cline-any cline-yes">1x</span>
|
|
585
568
|
<span class="cline-any cline-no"> </span>
|
|
@@ -588,36 +571,20 @@
|
|
|
588
571
|
<span class="cline-any cline-yes">1x</span>
|
|
589
572
|
<span class="cline-any cline-yes">1x</span>
|
|
590
573
|
<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>
|
|
593
574
|
<span class="cline-any cline-yes">2x</span>
|
|
594
|
-
<span class="cline-any cline-yes">
|
|
595
|
-
<span class="cline-any cline-yes">
|
|
596
|
-
<span class="cline-any cline-yes">
|
|
597
|
-
<span class="cline-any cline-yes">
|
|
598
|
-
<span class="cline-any cline-yes">
|
|
599
|
-
<span class="cline-any cline-yes">
|
|
600
|
-
<span class="cline-any cline-yes">
|
|
601
|
-
<span class="cline-any cline-yes">
|
|
602
|
-
<span class="cline-any cline-yes">
|
|
603
|
-
<span class="cline-any cline-
|
|
604
|
-
|
|
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'
|
|
575
|
+
<span class="cline-any cline-yes">2x</span>
|
|
576
|
+
<span class="cline-any cline-yes">2x</span>
|
|
577
|
+
<span class="cline-any cline-yes">2x</span>
|
|
578
|
+
<span class="cline-any cline-yes">2x</span>
|
|
579
|
+
<span class="cline-any cline-yes">2x</span>
|
|
580
|
+
<span class="cline-any cline-yes">2x</span>
|
|
581
|
+
<span class="cline-any cline-yes">2x</span>
|
|
582
|
+
<span class="cline-any cline-yes">2x</span>
|
|
583
|
+
<span class="cline-any cline-yes">2x</span>
|
|
584
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import _ from 'lodash'
|
|
585
|
+
import { marshallComparisonFields, marshallTime, marshallBooleanFields, marshallNumberFields, marshallDateFields } from '../marshall.js'
|
|
617
586
|
import mongodb from 'mongodb'
|
|
618
587
|
import makeDebug from 'debug'
|
|
619
|
-
import { marshallComparisonFields, marshallTime, marshallBooleanFields, marshallNumberFields, marshallDateFields } from '../marshall.js'
|
|
620
|
-
import { isValidObjectID, isObjectID } from '../db.js'
|
|
621
588
|
import { makeDiacriticPattern } from '../../common/utils.js'
|
|
622
589
|
|
|
623
590
|
const { ObjectID } = mongodb
|
|
@@ -686,80 +653,80 @@ export <span class="fstat-no" title="function not covered" >async function aggre
|
|
|
686
653
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
687
654
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
688
655
|
|
|
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')
|
|
656
|
+
export <span class="fstat-no" title="function not covered" >function populateObject (options) {</span>
|
|
657
|
+
<span class="cstat-no" title="statement not covered" > return async function (hook) {</span>
|
|
658
|
+
<span class="cstat-no" title="statement not covered" > const app = hook.app</span>
|
|
659
|
+
<span class="cstat-no" title="statement not covered" > const data = hook.data</span>
|
|
660
|
+
<span class="cstat-no" title="statement not covered" > const params = hook.params</span>
|
|
661
|
+
<span class="cstat-no" title="statement not covered" > const query = params.query</span>
|
|
662
|
+
<span class="cstat-no" title="statement not covered" > const context = hook.service.context</span>
|
|
663
|
+
<span class="cstat-no" title="statement not covered" > const idProperty = options.nameIdAs || options.idField</span>
|
|
664
|
+
<span class="cstat-no" title="statement not covered" > const serviceProperty = options.nameServiceAs || options.serviceField</span>
|
|
665
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
666
|
+
<span class="cstat-no" title="statement not covered" > // Check if not already done</span>
|
|
667
|
+
<span class="cstat-no" title="statement not covered" > if (typeof _.get(params, idProperty) === 'object') {</span>
|
|
701
668
|
<span class="cstat-no" title="statement not covered" > debug(`Skipping populating ${idProperty} as already done`)</span>
|
|
702
669
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
703
670
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
704
|
-
if (typeof _.get(params, serviceProperty) === 'object')
|
|
671
|
+
<span class="cstat-no" title="statement not covered" > if (typeof _.get(params, serviceProperty) === 'object') {</span>
|
|
705
672
|
<span class="cstat-no" title="statement not covered" > debug(`Skipping populating ${serviceProperty} as already done`)</span>
|
|
706
673
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
707
674
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
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
|
-
|
|
675
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
676
|
+
<span class="cstat-no" title="statement not covered" > // Get service where we can find the object to populate</span>
|
|
677
|
+
<span class="cstat-no" title="statement not covered" > // Make hook usable with query params as well and service name or real object</span>
|
|
678
|
+
<span class="cstat-no" title="statement not covered" > let service = _.get(data, options.serviceField) || _.get(query, options.serviceField)</span>
|
|
679
|
+
<span class="cstat-no" title="statement not covered" > if (typeof service === 'string') {</span>
|
|
680
|
+
<span class="cstat-no" title="statement not covered" > const message = `Cannot find the service for ${options.serviceField} = ${service} to dynamically populate.`</span>
|
|
681
|
+
<span class="cstat-no" title="statement not covered" > service = app.getService(service, context)</span>
|
|
682
|
+
<span class="cstat-no" title="statement not covered" > if (!service) {</span>
|
|
716
683
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(message)</span>
|
|
717
684
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
718
685
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
719
|
-
|
|
686
|
+
<span class="cstat-no" title="statement not covered" > } else if (!service) {</span>
|
|
720
687
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(`No ${options.serviceField} given to dynamically populate.`)</span>
|
|
721
688
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
722
689
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
723
|
-
// Then the object ID
|
|
724
|
-
const id = _.get(data, options.idField) || _.get(query, options.idField) || _.get(hook, 'id')
|
|
725
|
-
|
|
690
|
+
<span class="cstat-no" title="statement not covered" > // Then the object ID</span>
|
|
691
|
+
<span class="cstat-no" title="statement not covered" > const id = _.get(data, options.idField) || _.get(query, options.idField) || _.get(hook, 'id')</span>
|
|
692
|
+
<span class="cstat-no" title="statement not covered" > if (!id) {</span>
|
|
726
693
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(`Cannot find the ${options.idField} to dynamically populate.`)</span>
|
|
727
694
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
728
695
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
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' ||
|
|
734
|
-
const args = { user: hook.params.user }
|
|
735
|
-
let object
|
|
736
|
-
try {
|
|
737
|
-
// Get by ID or name
|
|
738
|
-
if (
|
|
739
|
-
object = await service.get(id.toString(), args)
|
|
740
|
-
|
|
696
|
+
<span class="cstat-no" title="statement not covered" > debug(`Populating ${idProperty} with ID ${id}`)</span>
|
|
697
|
+
<span class="cstat-no" title="statement not covered" > // Set the retrieved service on the same field or given one in hook params</span>
|
|
698
|
+
<span class="cstat-no" title="statement not covered" > _.set(params, serviceProperty, service)</span>
|
|
699
|
+
<span class="cstat-no" title="statement not covered" > // Let it work with id/name string or real object</span>
|
|
700
|
+
<span class="cstat-no" title="statement not covered" > if (typeof id === 'string' || ObjectID.isValid(id)) {</span>
|
|
701
|
+
<span class="cstat-no" title="statement not covered" > const args = { user: hook.params.user }</span>
|
|
702
|
+
<span class="cstat-no" title="statement not covered" > let object</span>
|
|
703
|
+
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
704
|
+
<span class="cstat-no" title="statement not covered" > // Get by ID or name ?</span>
|
|
705
|
+
<span class="cstat-no" title="statement not covered" > if (ObjectID.isValid(id)) {</span>
|
|
706
|
+
<span class="cstat-no" title="statement not covered" > object = await service.get(id.toString(), args)</span>
|
|
707
|
+
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
741
708
|
<span class="cstat-no" title="statement not covered" > Object.assign(args, { query: { name: id.toString() }, paginate: false })</span>
|
|
742
709
|
<span class="cstat-no" title="statement not covered" > const results = await service.find(args)</span>
|
|
743
710
|
<span class="cstat-no" title="statement not covered" > if (results.length >= 0) object = results[0]</span>
|
|
744
711
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
745
|
-
|
|
712
|
+
<span class="cstat-no" title="statement not covered" > } catch (error) {</span>
|
|
746
713
|
<span class="cstat-no" title="statement not covered" > // Not found error is managed hereafter</span>
|
|
747
714
|
<span class="cstat-no" title="statement not covered" > if (error.code !== 404) throw error</span>
|
|
748
715
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
749
|
-
|
|
716
|
+
<span class="cstat-no" title="statement not covered" > if (!object) {</span>
|
|
750
717
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(`Cannot find object with id ${id} to dynamically populate.`)</span>
|
|
751
718
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
752
719
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
753
|
-
// Set the retrieved object on the same field or given one in hook params
|
|
754
|
-
_.set(params, idProperty, object)
|
|
755
|
-
return hook
|
|
756
|
-
|
|
720
|
+
<span class="cstat-no" title="statement not covered" > // Set the retrieved object on the same field or given one in hook params</span>
|
|
721
|
+
<span class="cstat-no" title="statement not covered" > _.set(params, idProperty, object)</span>
|
|
722
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
723
|
+
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
757
724
|
<span class="cstat-no" title="statement not covered" > // Set the object on the same field or given one in hook params</span>
|
|
758
725
|
<span class="cstat-no" title="statement not covered" > _.set(params, idProperty, id)</span>
|
|
759
726
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
760
727
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
761
|
-
}
|
|
762
|
-
}
|
|
728
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
729
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
763
730
|
|
|
764
731
|
export <span class="fstat-no" title="function not covered" >function unpopulateObject (options) {</span>
|
|
765
732
|
<span class="cstat-no" title="statement not covered" > return function (hook) {</span>
|
|
@@ -775,127 +742,112 @@ export <span class="fstat-no" title="function not covered" >function unpopulateO
|
|
|
775
742
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
776
743
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
777
744
|
|
|
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)))
|
|
745
|
+
export <span class="fstat-no" title="function not covered" >function populateObjects (options) {</span>
|
|
746
|
+
<span class="cstat-no" title="statement not covered" > return async function (hook) {</span>
|
|
747
|
+
<span class="cstat-no" title="statement not covered" > const app = hook.app</span>
|
|
748
|
+
<span class="cstat-no" title="statement not covered" > const data = hook.data</span>
|
|
749
|
+
<span class="cstat-no" title="statement not covered" > const params = hook.params</span>
|
|
750
|
+
<span class="cstat-no" title="statement not covered" > const query = params.query</span>
|
|
751
|
+
<span class="cstat-no" title="statement not covered" > const context = hook.service.context</span>
|
|
752
|
+
<span class="cstat-no" title="statement not covered" > const idProperty = options.nameIdAs || options.idField</span>
|
|
753
|
+
<span class="cstat-no" title="statement not covered" > const serviceProperty = options.nameServiceAs || options.serviceField</span>
|
|
754
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
755
|
+
<span class="cstat-no" title="statement not covered" > // Check if not already done</span>
|
|
756
|
+
<span class="cstat-no" title="statement not covered" > if (Array.isArray(_.get(params, idProperty))) {</span>
|
|
790
757
|
<span class="cstat-no" title="statement not covered" > debug(`Skipping populating ${idProperty} as already done`)</span>
|
|
791
758
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
792
759
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
793
|
-
if (typeof _.get(params, serviceProperty) === 'object')
|
|
760
|
+
<span class="cstat-no" title="statement not covered" > if (typeof _.get(params, serviceProperty) === 'object') {</span>
|
|
794
761
|
<span class="cstat-no" title="statement not covered" > debug(`Skipping populating ${serviceProperty} as already done`)</span>
|
|
795
762
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
796
763
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
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
|
-
|
|
764
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
765
|
+
<span class="cstat-no" title="statement not covered" > // Get service where we can find the object to populate</span>
|
|
766
|
+
<span class="cstat-no" title="statement not covered" > // Make hook usable with query params as well and service name or real object</span>
|
|
767
|
+
<span class="cstat-no" title="statement not covered" > let service = _.get(data, options.serviceField) || _.get(query, options.serviceField)</span>
|
|
768
|
+
<span class="cstat-no" title="statement not covered" > if (typeof service === 'string') {</span>
|
|
769
|
+
<span class="cstat-no" title="statement not covered" > const message = `Cannot find the service for ${options.serviceField} = ${service} to dynamically populate.`</span>
|
|
770
|
+
<span class="cstat-no" title="statement not covered" > service = app.getService(service, context)</span>
|
|
771
|
+
<span class="cstat-no" title="statement not covered" > if (!service) {</span>
|
|
805
772
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(message)</span>
|
|
806
773
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
807
774
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
808
|
-
|
|
775
|
+
<span class="cstat-no" title="statement not covered" > } else if (!service) {</span>
|
|
809
776
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(`No ${options.serviceField} given to dynamically populate.`)</span>
|
|
810
777
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
811
778
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
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
|
-
|
|
779
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
780
|
+
<span class="cstat-no" title="statement not covered" > // Set the retrieved service on the same field or given one in hook params</span>
|
|
781
|
+
<span class="cstat-no" title="statement not covered" > _.set(params, serviceProperty, service)</span>
|
|
782
|
+
<span class="cstat-no" title="statement not covered" ></span>
|
|
783
|
+
<span class="cstat-no" title="statement not covered" > // Then the object ID</span>
|
|
784
|
+
<span class="cstat-no" title="statement not covered" > const id = _.get(data, options.idField) || _.get(query, options.idField)</span>
|
|
785
|
+
<span class="cstat-no" title="statement not covered" > // If no ID given we perform a find, no pagination to be sure we get all objects</span>
|
|
786
|
+
<span class="cstat-no" title="statement not covered" > if (!id) {</span>
|
|
820
787
|
<span class="cstat-no" title="statement not covered" > debug(`Populating ${idProperty}`)</span>
|
|
821
788
|
<span class="cstat-no" title="statement not covered" > const objects = await service.find({ query: {}, paginate: false, user: hook.params.user })</span>
|
|
822
789
|
<span class="cstat-no" title="statement not covered" > // Set the retrieved objects on the same field or given one in hook params</span>
|
|
823
790
|
<span class="cstat-no" title="statement not covered" > debug(`Populated ${objects.length} ${idProperty}`)</span>
|
|
824
791
|
<span class="cstat-no" title="statement not covered" > _.set(params, idProperty, objects)</span>
|
|
825
792
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
826
|
-
} else {
|
|
827
|
-
debug(`Populating ${idProperty} with ID ${id}`)
|
|
828
|
-
// Let it work with id/name string or real object
|
|
829
|
-
|
|
830
|
-
let object
|
|
831
|
-
try {
|
|
832
|
-
// Get by ID or name
|
|
833
|
-
if (
|
|
834
|
-
object = await service.get(id.toString(), { user: hook.params.user })
|
|
835
|
-
|
|
793
|
+
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
794
|
+
<span class="cstat-no" title="statement not covered" > debug(`Populating ${idProperty} with ID ${id}`)</span>
|
|
795
|
+
<span class="cstat-no" title="statement not covered" > // Let it work with id/name string or real object</span>
|
|
796
|
+
<span class="cstat-no" title="statement not covered" > if (typeof id === 'string' || ObjectID.isValid(id)) {</span>
|
|
797
|
+
<span class="cstat-no" title="statement not covered" > let object</span>
|
|
798
|
+
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
799
|
+
<span class="cstat-no" title="statement not covered" > // Get by ID or name ?</span>
|
|
800
|
+
<span class="cstat-no" title="statement not covered" > if (ObjectID.isValid(id)) {</span>
|
|
801
|
+
<span class="cstat-no" title="statement not covered" > object = await service.get(id.toString(), { user: hook.params.user })</span>
|
|
802
|
+
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
836
803
|
<span class="cstat-no" title="statement not covered" > const results = await service.find({ query: { name: id.toString() }, paginate: false, user: hook.params.user })</span>
|
|
837
804
|
<span class="cstat-no" title="statement not covered" > if (results.length >= 0) object = results[0]</span>
|
|
838
805
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
839
|
-
|
|
806
|
+
<span class="cstat-no" title="statement not covered" > } catch (error) {</span>
|
|
840
807
|
<span class="cstat-no" title="statement not covered" > // Not found error is managed hereafter</span>
|
|
841
808
|
<span class="cstat-no" title="statement not covered" > if (error.code !== 404) throw error</span>
|
|
842
809
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
843
|
-
|
|
810
|
+
<span class="cstat-no" title="statement not covered" > if (!object) {</span>
|
|
844
811
|
<span class="cstat-no" title="statement not covered" > if (options.throwOnNotFound) throw new Error(`Cannot find ${options.idField} = ${id} to dynamically populate.`)</span>
|
|
845
812
|
<span class="cstat-no" title="statement not covered" > else return hook</span>
|
|
846
813
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
847
|
-
// Set the retrieved object on the same field or given one in hook params
|
|
848
|
-
_.set(params, idProperty, [object])
|
|
849
|
-
return hook
|
|
850
|
-
|
|
814
|
+
<span class="cstat-no" title="statement not covered" > // Set the retrieved object on the same field or given one in hook params</span>
|
|
815
|
+
<span class="cstat-no" title="statement not covered" > _.set(params, idProperty, [object])</span>
|
|
816
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
817
|
+
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
851
818
|
<span class="cstat-no" title="statement not covered" > // Set the object on the same field or given one in hook params</span>
|
|
852
819
|
<span class="cstat-no" title="statement not covered" > _.set(params, idProperty, [id])</span>
|
|
853
820
|
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
854
821
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
}
|
|
822
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
823
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
824
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
858
825
|
|
|
859
826
|
export <span class="fstat-no" title="function not covered" >function unpopulateObjects (options) {</span>
|
|
860
827
|
<span class="cstat-no" title="statement not covered" > // These are similar behaviour</span>
|
|
861
828
|
<span class="cstat-no" title="statement not covered" > return unpopulateObject(options)</span>
|
|
862
829
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
863
830
|
|
|
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) {
|
|
874
|
-
// Take care to support as well case sensitivity by keeping flags
|
|
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)
|
|
880
|
-
}
|
|
881
|
-
})
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
|
|
885
831
|
// Used to manage diacritic insensitive fuzzy search
|
|
886
832
|
export function diacriticSearch (options = {}) {
|
|
887
833
|
return hook => {
|
|
888
834
|
const query = hook.params.query
|
|
889
|
-
|
|
835
|
+
_.forOwn(query, (value, key) => {
|
|
836
|
+
if (value.$regex && value.$regex.source && !value.$diacriticSensitive) {
|
|
837
|
+
// Take care to support as well case sensitivity by keeping flags
|
|
838
|
+
query[key].$regex = new RegExp(makeDiacriticPattern(value.$regex.source), value.$regex.flags)
|
|
839
|
+
}
|
|
840
|
+
})
|
|
890
841
|
}
|
|
891
|
-
}
|
|
842
|
+
}
|
|
843
|
+
</pre></td></tr></table></pre>
|
|
892
844
|
|
|
893
845
|
<div class='push'></div><!-- for sticky footer -->
|
|
894
846
|
</div><!-- /wrapper -->
|
|
895
847
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
896
848
|
Code coverage generated by
|
|
897
849
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
898
|
-
at
|
|
850
|
+
at 2024-08-13T10:02:04.843Z
|
|
899
851
|
</div>
|
|
900
852
|
<script src="../../../prettify.js"></script>
|
|
901
853
|
<script>
|