@kalisio/kdk 2.5.2 → 2.5.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/core/client/components/input/KShapePicker.vue +4 -4
- package/coverage/core/api/application.js.html +344 -344
- package/coverage/core/api/authentication.js.html +79 -79
- package/coverage/core/api/db.js.html +167 -167
- package/coverage/core/api/hooks/hooks.authentication.js.html +12 -12
- package/coverage/core/api/hooks/hooks.authorisations.js.html +166 -163
- package/coverage/core/api/hooks/hooks.groups.js.html +1 -1
- package/coverage/core/api/hooks/hooks.logger.js.html +18 -18
- package/coverage/core/api/hooks/hooks.model.js.html +280 -268
- package/coverage/core/api/hooks/hooks.organisations.js.html +1 -1
- package/coverage/core/api/hooks/hooks.push.js.html +12 -12
- package/coverage/core/api/hooks/hooks.query.js.html +92 -92
- package/coverage/core/api/hooks/hooks.schemas.js.html +13 -13
- package/coverage/core/api/hooks/hooks.service.js.html +28 -28
- package/coverage/core/api/hooks/hooks.storage.js.html +7 -7
- package/coverage/core/api/hooks/hooks.users.js.html +48 -48
- package/coverage/core/api/hooks/index.html +49 -49
- package/coverage/core/api/hooks/index.js.html +11 -11
- package/coverage/core/api/index.html +42 -42
- package/coverage/core/api/index.js.html +22 -22
- package/coverage/core/api/marshall.js.html +127 -127
- package/coverage/core/api/models/groups.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/index.html +1 -1
- package/coverage/core/api/models/messages.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/organisations.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/tags.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/users.model.mongodb.js.html +11 -11
- package/coverage/core/api/services/account/account.hooks.js.html +42 -42
- package/coverage/core/api/services/account/account.service.js.html +34 -34
- package/coverage/core/api/services/account/index.html +1 -1
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +34 -34
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +108 -120
- package/coverage/core/api/services/authorisations/index.html +19 -19
- 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/groups/groups.hooks.js.html +1 -1
- package/coverage/core/api/services/groups/index.html +1 -1
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +1 -1
- package/coverage/core/api/services/import-export/import-export.service.js.html +1 -1
- package/coverage/core/api/services/import-export/index.html +1 -1
- package/coverage/core/api/services/index.html +15 -15
- package/coverage/core/api/services/index.js.html +97 -85
- package/coverage/core/api/services/mailer/index.html +1 -1
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +1 -1
- package/coverage/core/api/services/mailer/mailer.service.js.html +1 -1
- package/coverage/core/api/services/messages/index.html +5 -5
- package/coverage/core/api/services/messages/messages.hooks.js.html +11 -8
- package/coverage/core/api/services/organisations/index.html +1 -1
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +1 -1
- package/coverage/core/api/services/organisations/organisations.service.js.html +1 -1
- package/coverage/core/api/services/push/index.html +1 -1
- package/coverage/core/api/services/push/push.hooks.js.html +1 -1
- package/coverage/core/api/services/push/push.service.js.html +1 -1
- package/coverage/core/api/services/storage/index.html +1 -1
- package/coverage/core/api/services/storage/storage.hooks.js.html +36 -36
- package/coverage/core/api/services/storage/storage.service.js.html +30 -30
- package/coverage/core/api/services/tags/index.html +1 -1
- package/coverage/core/api/services/tags/tags.hooks.js.html +1 -1
- package/coverage/core/api/services/users/index.html +7 -7
- package/coverage/core/api/services/users/users.hooks.js.html +83 -80
- package/coverage/core/api/services/users/users.service.js.html +4 -4
- package/coverage/core/api/utils.js.html +1 -1
- package/coverage/core/common/errors.js.html +2 -2
- package/coverage/core/common/index.html +30 -30
- package/coverage/core/common/index.js.html +11 -11
- package/coverage/core/common/permissions.js.html +187 -187
- package/coverage/core/common/schema.js.html +26 -26
- package/coverage/core/common/utils.js.html +61 -61
- package/coverage/core/common/utils.offline.js.html +6 -6
- package/coverage/index.html +179 -164
- package/coverage/lcov-report/core/api/application.js.html +344 -344
- package/coverage/lcov-report/core/api/authentication.js.html +79 -79
- package/coverage/lcov-report/core/api/db.js.html +167 -167
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +12 -12
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +166 -163
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +18 -18
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +280 -268
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +12 -12
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +92 -92
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +13 -13
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +28 -28
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +7 -7
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +48 -48
- package/coverage/lcov-report/core/api/hooks/index.html +49 -49
- package/coverage/lcov-report/core/api/hooks/index.js.html +11 -11
- package/coverage/lcov-report/core/api/index.html +42 -42
- package/coverage/lcov-report/core/api/index.js.html +22 -22
- package/coverage/lcov-report/core/api/marshall.js.html +127 -127
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/index.html +1 -1
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +11 -11
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +42 -42
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +34 -34
- package/coverage/lcov-report/core/api/services/account/index.html +1 -1
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +34 -34
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +108 -120
- package/coverage/lcov-report/core/api/services/authorisations/index.html +19 -19
- 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/groups/groups.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/groups/index.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/index.html +1 -1
- package/coverage/lcov-report/core/api/services/index.html +15 -15
- package/coverage/lcov-report/core/api/services/index.js.html +97 -85
- package/coverage/lcov-report/core/api/services/mailer/index.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/messages/index.html +5 -5
- package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +11 -8
- package/coverage/lcov-report/core/api/services/organisations/index.html +1 -1
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/push/index.html +1 -1
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/index.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +36 -36
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +30 -30
- package/coverage/lcov-report/core/api/services/tags/index.html +1 -1
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/users/index.html +7 -7
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +83 -80
- package/coverage/lcov-report/core/api/services/users/users.service.js.html +4 -4
- package/coverage/lcov-report/core/api/utils.js.html +1 -1
- package/coverage/lcov-report/core/common/errors.js.html +2 -2
- package/coverage/lcov-report/core/common/index.html +30 -30
- package/coverage/lcov-report/core/common/index.js.html +11 -11
- package/coverage/lcov-report/core/common/permissions.js.html +187 -187
- package/coverage/lcov-report/core/common/schema.js.html +26 -26
- package/coverage/lcov-report/core/common/utils.js.html +61 -61
- package/coverage/lcov-report/core/common/utils.offline.js.html +6 -6
- package/coverage/lcov-report/index.html +179 -164
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +348 -258
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +218 -218
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +795 -810
- package/coverage/lcov-report/map/api/hooks/index.html +54 -54
- package/coverage/lcov-report/map/api/hooks/index.js.html +16 -16
- package/coverage/lcov-report/map/api/index.html +32 -32
- package/coverage/lcov-report/map/api/index.js.html +46 -46
- package/coverage/lcov-report/map/api/marshall.js.html +72 -72
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +24 -24
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +69 -27
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +80 -80
- package/coverage/lcov-report/map/api/models/index.html +69 -54
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +26 -26
- package/coverage/lcov-report/map/api/models/styles.model.mongodb.js.html +112 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +136 -136
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +343 -343
- package/coverage/lcov-report/map/api/services/alerts/index.html +32 -32
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +177 -162
- package/coverage/lcov-report/map/api/services/catalog/index.html +21 -21
- 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 +160 -160
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +117 -117
- package/coverage/lcov-report/map/api/services/features/index.html +31 -31
- package/coverage/lcov-report/map/api/services/index.html +21 -21
- package/coverage/lcov-report/map/api/services/index.js.html +404 -296
- package/coverage/lcov-report/map/api/services/projects/index.html +21 -21
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +237 -237
- package/coverage/lcov-report/map/api/services/styles/index.html +116 -0
- package/coverage/lcov-report/map/api/services/styles/styles.hooks.js.html +196 -0
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +68 -68
- package/coverage/lcov-report/map/common/errors.js.html +16 -16
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +267 -267
- package/coverage/lcov-report/map/common/grid.js.html +554 -554
- package/coverage/lcov-report/map/common/index.html +158 -158
- package/coverage/lcov-report/map/common/index.js.html +68 -68
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +73 -73
- package/coverage/lcov-report/map/common/moment-utils.js.html +18 -18
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +484 -484
- package/coverage/lcov-report/map/common/opendap-utils.js.html +353 -353
- package/coverage/lcov-report/map/common/permissions.js.html +42 -36
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +59 -59
- package/coverage/lcov-report/map/common/tms-utils.js.html +6 -6
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +190 -190
- package/coverage/lcov-report/map/common/wcs-utils.js.html +339 -339
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +345 -345
- package/coverage/lcov-report/map/common/wfs-utils.js.html +11 -11
- package/coverage/lcov-report/map/common/wms-utils.js.html +8 -8
- package/coverage/lcov-report/map/common/wmts-utils.js.html +7 -7
- package/coverage/lcov.info +7022 -5894
- package/coverage/map/api/hooks/hooks.catalog.js.html +348 -258
- package/coverage/map/api/hooks/hooks.features.js.html +218 -218
- package/coverage/map/api/hooks/hooks.query.js.html +795 -810
- package/coverage/map/api/hooks/index.html +54 -54
- package/coverage/map/api/hooks/index.js.html +16 -16
- package/coverage/map/api/index.html +32 -32
- package/coverage/map/api/index.js.html +46 -46
- package/coverage/map/api/marshall.js.html +72 -72
- package/coverage/map/api/models/alerts.model.mongodb.js.html +24 -24
- package/coverage/map/api/models/catalog.model.mongodb.js.html +69 -27
- package/coverage/map/api/models/features.model.mongodb.js.html +80 -80
- package/coverage/map/api/models/index.html +69 -54
- package/coverage/map/api/models/projects.model.mongodb.js.html +26 -26
- package/coverage/map/api/models/styles.model.mongodb.js.html +112 -0
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +136 -136
- package/coverage/map/api/services/alerts/alerts.service.js.html +343 -343
- package/coverage/map/api/services/alerts/index.html +32 -32
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +177 -162
- package/coverage/map/api/services/catalog/index.html +21 -21
- 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 +160 -160
- package/coverage/map/api/services/features/features.service.js.html +117 -117
- package/coverage/map/api/services/features/index.html +31 -31
- package/coverage/map/api/services/index.html +21 -21
- package/coverage/map/api/services/index.js.html +404 -296
- package/coverage/map/api/services/projects/index.html +21 -21
- package/coverage/map/api/services/projects/projects.hooks.js.html +237 -237
- package/coverage/map/api/services/styles/index.html +116 -0
- package/coverage/map/api/services/styles/styles.hooks.js.html +196 -0
- package/coverage/map/common/dynamic-grid-source.js.html +68 -68
- package/coverage/map/common/errors.js.html +16 -16
- package/coverage/map/common/geotiff-grid-source.js.html +267 -267
- package/coverage/map/common/grid.js.html +554 -554
- package/coverage/map/common/index.html +158 -158
- package/coverage/map/common/index.js.html +68 -68
- package/coverage/map/common/meteo-model-grid-source.js.html +73 -73
- package/coverage/map/common/moment-utils.js.html +18 -18
- package/coverage/map/common/opendap-grid-source.js.html +484 -484
- package/coverage/map/common/opendap-utils.js.html +353 -353
- package/coverage/map/common/permissions.js.html +42 -36
- package/coverage/map/common/time-based-grid-source.js.html +59 -59
- package/coverage/map/common/tms-utils.js.html +6 -6
- package/coverage/map/common/wcs-grid-source.js.html +190 -190
- package/coverage/map/common/wcs-utils.js.html +339 -339
- package/coverage/map/common/weacast-grid-source.js.html +345 -345
- package/coverage/map/common/wfs-utils.js.html +11 -11
- package/coverage/map/common/wms-utils.js.html +8 -8
- package/coverage/map/common/wmts-utils.js.html +7 -7
- package/coverage/tmp/coverage-151198-1753351220086-0.json +1 -0
- package/coverage/tmp/coverage-151210-1753351220070-0.json +1 -0
- package/coverage/tmp/coverage-151221-1753351129816-0.json +1 -0
- package/coverage/tmp/coverage-151233-1753351129803-0.json +1 -0
- package/coverage/tmp/coverage-151240-1753351129770-0.json +1 -0
- package/coverage/tmp/coverage-151307-1753351220058-0.json +1 -0
- package/coverage/tmp/coverage-151319-1753351220044-0.json +1 -0
- package/coverage/tmp/coverage-151326-1753351220010-0.json +1 -0
- package/map/api/services/styles/styles.hooks.js +1 -1
- package/map/client/components/KLayerEditor.vue +4 -0
- package/map/client/components/catalog/KLayerCategories.vue +2 -0
- package/map/client/components/stickies/KLevelSlider.vue +10 -8
- package/map/client/components/styles/KStyleEditor.vue +1 -1
- package/map/client/components/styles/KStyleManager.vue +7 -1
- package/map/client/composables/highlight.js +5 -1
- package/map/client/i18n/map_en.json +4 -1
- package/map/client/i18n/map_fr.json +4 -1
- package/map/client/mixins/globe/mixin.geojson-layers.js +11 -5
- package/map/client/mixins/mixin.activity.js +9 -0
- package/map/client/utils/utils.layers.js +0 -2
- package/package.json +1 -1
- package/test/api/core/push.test.js +1 -1
- package/test/api/core/test-log-2025-02-05.log +23 -0
- package/test/api/core/test-log-2025-05-21.log +15 -0
- package/test/api/core/test-log-2025-06-25.log +9 -0
- package/test/api/core/test-log-2025-07-24.log +44 -0
- package/test/api/map/test-log-2025-05-27.log +13 -0
- package/test/api/map/test-log-2025-06-23.log +7 -0
- package/test/api/map/{test-log-2025-05-26.log → test-log-2025-07-24.log} +3 -4
- package/coverage/tmp/coverage-122123-1739872365211-0.json +0 -1
- package/coverage/tmp/coverage-122135-1739872365196-0.json +0 -1
- package/coverage/tmp/coverage-122146-1739872365184-0.json +0 -1
- package/coverage/tmp/coverage-122158-1739872365169-0.json +0 -1
- package/coverage/tmp/coverage-122165-1739872365141-0.json +0 -1
- package/test/api/core/test-log-2025-05-26.log +0 -22
|
@@ -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">50.15% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>162/323</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">76.92% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>10/13</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">37.5% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>6/16</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">50.15% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>162/323</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>
|
|
@@ -350,23 +350,149 @@
|
|
|
350
350
|
<a name='L285'></a><a href='#L285'>285</a>
|
|
351
351
|
<a name='L286'></a><a href='#L286'>286</a>
|
|
352
352
|
<a name='L287'></a><a href='#L287'>287</a>
|
|
353
|
-
<a name='L288'></a><a href='#L288'>288</a
|
|
353
|
+
<a name='L288'></a><a href='#L288'>288</a>
|
|
354
|
+
<a name='L289'></a><a href='#L289'>289</a>
|
|
355
|
+
<a name='L290'></a><a href='#L290'>290</a>
|
|
356
|
+
<a name='L291'></a><a href='#L291'>291</a>
|
|
357
|
+
<a name='L292'></a><a href='#L292'>292</a>
|
|
358
|
+
<a name='L293'></a><a href='#L293'>293</a>
|
|
359
|
+
<a name='L294'></a><a href='#L294'>294</a>
|
|
360
|
+
<a name='L295'></a><a href='#L295'>295</a>
|
|
361
|
+
<a name='L296'></a><a href='#L296'>296</a>
|
|
362
|
+
<a name='L297'></a><a href='#L297'>297</a>
|
|
363
|
+
<a name='L298'></a><a href='#L298'>298</a>
|
|
364
|
+
<a name='L299'></a><a href='#L299'>299</a>
|
|
365
|
+
<a name='L300'></a><a href='#L300'>300</a>
|
|
366
|
+
<a name='L301'></a><a href='#L301'>301</a>
|
|
367
|
+
<a name='L302'></a><a href='#L302'>302</a>
|
|
368
|
+
<a name='L303'></a><a href='#L303'>303</a>
|
|
369
|
+
<a name='L304'></a><a href='#L304'>304</a>
|
|
370
|
+
<a name='L305'></a><a href='#L305'>305</a>
|
|
371
|
+
<a name='L306'></a><a href='#L306'>306</a>
|
|
372
|
+
<a name='L307'></a><a href='#L307'>307</a>
|
|
373
|
+
<a name='L308'></a><a href='#L308'>308</a>
|
|
374
|
+
<a name='L309'></a><a href='#L309'>309</a>
|
|
375
|
+
<a name='L310'></a><a href='#L310'>310</a>
|
|
376
|
+
<a name='L311'></a><a href='#L311'>311</a>
|
|
377
|
+
<a name='L312'></a><a href='#L312'>312</a>
|
|
378
|
+
<a name='L313'></a><a href='#L313'>313</a>
|
|
379
|
+
<a name='L314'></a><a href='#L314'>314</a>
|
|
380
|
+
<a name='L315'></a><a href='#L315'>315</a>
|
|
381
|
+
<a name='L316'></a><a href='#L316'>316</a>
|
|
382
|
+
<a name='L317'></a><a href='#L317'>317</a>
|
|
383
|
+
<a name='L318'></a><a href='#L318'>318</a>
|
|
384
|
+
<a name='L319'></a><a href='#L319'>319</a>
|
|
385
|
+
<a name='L320'></a><a href='#L320'>320</a>
|
|
386
|
+
<a name='L321'></a><a href='#L321'>321</a>
|
|
387
|
+
<a name='L322'></a><a href='#L322'>322</a>
|
|
388
|
+
<a name='L323'></a><a href='#L323'>323</a>
|
|
389
|
+
<a name='L324'></a><a href='#L324'>324</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
390
|
+
<span class="cline-any cline-yes">1x</span>
|
|
391
|
+
<span class="cline-any cline-yes">1x</span>
|
|
392
|
+
<span class="cline-any cline-yes">1x</span>
|
|
393
|
+
<span class="cline-any cline-yes">1x</span>
|
|
394
|
+
<span class="cline-any cline-yes">1x</span>
|
|
395
|
+
<span class="cline-any cline-yes">1x</span>
|
|
396
|
+
<span class="cline-any cline-yes">1x</span>
|
|
397
|
+
<span class="cline-any cline-yes">1x</span>
|
|
398
|
+
<span class="cline-any cline-yes">1x</span>
|
|
399
|
+
<span class="cline-any cline-yes">1x</span>
|
|
400
|
+
<span class="cline-any cline-yes">1x</span>
|
|
401
|
+
<span class="cline-any cline-yes">1x</span>
|
|
402
|
+
<span class="cline-any cline-yes">1x</span>
|
|
403
|
+
<span class="cline-any cline-yes">1x</span>
|
|
404
|
+
<span class="cline-any cline-yes">1x</span>
|
|
405
|
+
<span class="cline-any cline-yes">5x</span>
|
|
406
|
+
<span class="cline-any cline-yes">5x</span>
|
|
407
|
+
<span class="cline-any cline-yes">5x</span>
|
|
408
|
+
<span class="cline-any cline-yes">5x</span>
|
|
409
|
+
<span class="cline-any cline-yes">5x</span>
|
|
410
|
+
<span class="cline-any cline-yes">5x</span>
|
|
411
|
+
<span class="cline-any cline-yes">5x</span>
|
|
412
|
+
<span class="cline-any cline-yes">5x</span>
|
|
413
|
+
<span class="cline-any cline-yes">5x</span>
|
|
414
|
+
<span class="cline-any cline-yes">5x</span>
|
|
415
|
+
<span class="cline-any cline-yes">5x</span>
|
|
416
|
+
<span class="cline-any cline-yes">5x</span>
|
|
417
|
+
<span class="cline-any cline-yes">5x</span>
|
|
418
|
+
<span class="cline-any cline-yes">5x</span>
|
|
419
|
+
<span class="cline-any cline-yes">5x</span>
|
|
420
|
+
<span class="cline-any cline-yes">12x</span>
|
|
421
|
+
<span class="cline-any cline-yes">12x</span>
|
|
422
|
+
<span class="cline-any cline-yes">5x</span>
|
|
423
|
+
<span class="cline-any cline-yes">5x</span>
|
|
424
|
+
<span class="cline-any cline-yes">5x</span>
|
|
425
|
+
<span class="cline-any cline-yes">5x</span>
|
|
426
|
+
<span class="cline-any cline-yes">5x</span>
|
|
427
|
+
<span class="cline-any cline-yes">5x</span>
|
|
428
|
+
<span class="cline-any cline-yes">1x</span>
|
|
429
|
+
<span class="cline-any cline-yes">1x</span>
|
|
354
430
|
<span class="cline-any cline-no"> </span>
|
|
355
431
|
<span class="cline-any cline-no"> </span>
|
|
356
432
|
<span class="cline-any cline-no"> </span>
|
|
357
433
|
<span class="cline-any cline-no"> </span>
|
|
434
|
+
<span class="cline-any cline-yes">1x</span>
|
|
435
|
+
<span class="cline-any cline-yes">1x</span>
|
|
436
|
+
<span class="cline-any cline-yes">2x</span>
|
|
437
|
+
<span class="cline-any cline-yes">2x</span>
|
|
438
|
+
<span class="cline-any cline-yes">2x</span>
|
|
439
|
+
<span class="cline-any cline-yes">2x</span>
|
|
440
|
+
<span class="cline-any cline-yes">2x</span>
|
|
441
|
+
<span class="cline-any cline-yes">2x</span>
|
|
442
|
+
<span class="cline-any cline-yes">2x</span>
|
|
443
|
+
<span class="cline-any cline-yes">2x</span>
|
|
444
|
+
<span class="cline-any cline-yes">2x</span>
|
|
445
|
+
<span class="cline-any cline-yes">2x</span>
|
|
446
|
+
<span class="cline-any cline-yes">2x</span>
|
|
447
|
+
<span class="cline-any cline-yes">2x</span>
|
|
448
|
+
<span class="cline-any cline-yes">2x</span>
|
|
449
|
+
<span class="cline-any cline-yes">2x</span>
|
|
450
|
+
<span class="cline-any cline-yes">2x</span>
|
|
451
|
+
<span class="cline-any cline-yes">2x</span>
|
|
452
|
+
<span class="cline-any cline-yes">1x</span>
|
|
453
|
+
<span class="cline-any cline-yes">1x</span>
|
|
358
454
|
<span class="cline-any cline-no"> </span>
|
|
359
455
|
<span class="cline-any cline-no"> </span>
|
|
360
456
|
<span class="cline-any cline-no"> </span>
|
|
361
457
|
<span class="cline-any cline-no"> </span>
|
|
458
|
+
<span class="cline-any cline-yes">1x</span>
|
|
459
|
+
<span class="cline-any cline-yes">1x</span>
|
|
460
|
+
<span class="cline-any cline-yes">1x</span>
|
|
461
|
+
<span class="cline-any cline-yes">1x</span>
|
|
462
|
+
<span class="cline-any cline-yes">1x</span>
|
|
463
|
+
<span class="cline-any cline-yes">1x</span>
|
|
464
|
+
<span class="cline-any cline-yes">1x</span>
|
|
465
|
+
<span class="cline-any cline-yes">1x</span>
|
|
466
|
+
<span class="cline-any cline-yes">1x</span>
|
|
467
|
+
<span class="cline-any cline-yes">1x</span>
|
|
468
|
+
<span class="cline-any cline-yes">1x</span>
|
|
469
|
+
<span class="cline-any cline-yes">1x</span>
|
|
470
|
+
<span class="cline-any cline-yes">1x</span>
|
|
362
471
|
<span class="cline-any cline-no"> </span>
|
|
363
472
|
<span class="cline-any cline-no"> </span>
|
|
364
473
|
<span class="cline-any cline-no"> </span>
|
|
365
474
|
<span class="cline-any cline-no"> </span>
|
|
475
|
+
<span class="cline-any cline-yes">1x</span>
|
|
476
|
+
<span class="cline-any cline-yes">1x</span>
|
|
477
|
+
<span class="cline-any cline-yes">1x</span>
|
|
478
|
+
<span class="cline-any cline-yes">1x</span>
|
|
479
|
+
<span class="cline-any cline-yes">1x</span>
|
|
480
|
+
<span class="cline-any cline-yes">1x</span>
|
|
481
|
+
<span class="cline-any cline-yes">1x</span>
|
|
482
|
+
<span class="cline-any cline-yes">1x</span>
|
|
483
|
+
<span class="cline-any cline-yes">1x</span>
|
|
484
|
+
<span class="cline-any cline-yes">1x</span>
|
|
485
|
+
<span class="cline-any cline-yes">1x</span>
|
|
486
|
+
<span class="cline-any cline-yes">1x</span>
|
|
487
|
+
<span class="cline-any cline-yes">1x</span>
|
|
488
|
+
<span class="cline-any cline-yes">1x</span>
|
|
366
489
|
<span class="cline-any cline-no"> </span>
|
|
367
490
|
<span class="cline-any cline-no"> </span>
|
|
368
491
|
<span class="cline-any cline-no"> </span>
|
|
369
492
|
<span class="cline-any cline-no"> </span>
|
|
493
|
+
<span class="cline-any cline-yes">1x</span>
|
|
494
|
+
<span class="cline-any cline-yes">1x</span>
|
|
495
|
+
<span class="cline-any cline-yes">1x</span>
|
|
370
496
|
<span class="cline-any cline-no"> </span>
|
|
371
497
|
<span class="cline-any cline-no"> </span>
|
|
372
498
|
<span class="cline-any cline-no"> </span>
|
|
@@ -388,6 +514,8 @@
|
|
|
388
514
|
<span class="cline-any cline-no"> </span>
|
|
389
515
|
<span class="cline-any cline-no"> </span>
|
|
390
516
|
<span class="cline-any cline-no"> </span>
|
|
517
|
+
<span class="cline-any cline-yes">1x</span>
|
|
518
|
+
<span class="cline-any cline-yes">1x</span>
|
|
391
519
|
<span class="cline-any cline-no"> </span>
|
|
392
520
|
<span class="cline-any cline-no"> </span>
|
|
393
521
|
<span class="cline-any cline-no"> </span>
|
|
@@ -400,6 +528,8 @@
|
|
|
400
528
|
<span class="cline-any cline-no"> </span>
|
|
401
529
|
<span class="cline-any cline-no"> </span>
|
|
402
530
|
<span class="cline-any cline-no"> </span>
|
|
531
|
+
<span class="cline-any cline-yes">1x</span>
|
|
532
|
+
<span class="cline-any cline-yes">1x</span>
|
|
403
533
|
<span class="cline-any cline-no"> </span>
|
|
404
534
|
<span class="cline-any cline-no"> </span>
|
|
405
535
|
<span class="cline-any cline-no"> </span>
|
|
@@ -414,6 +544,10 @@
|
|
|
414
544
|
<span class="cline-any cline-no"> </span>
|
|
415
545
|
<span class="cline-any cline-no"> </span>
|
|
416
546
|
<span class="cline-any cline-no"> </span>
|
|
547
|
+
<span class="cline-any cline-yes">1x</span>
|
|
548
|
+
<span class="cline-any cline-yes">1x</span>
|
|
549
|
+
<span class="cline-any cline-yes">1x</span>
|
|
550
|
+
<span class="cline-any cline-yes">1x</span>
|
|
417
551
|
<span class="cline-any cline-no"> </span>
|
|
418
552
|
<span class="cline-any cline-no"> </span>
|
|
419
553
|
<span class="cline-any cline-no"> </span>
|
|
@@ -496,6 +630,9 @@
|
|
|
496
630
|
<span class="cline-any cline-no"> </span>
|
|
497
631
|
<span class="cline-any cline-no"> </span>
|
|
498
632
|
<span class="cline-any cline-no"> </span>
|
|
633
|
+
<span class="cline-any cline-yes">1x</span>
|
|
634
|
+
<span class="cline-any cline-yes">1x</span>
|
|
635
|
+
<span class="cline-any cline-yes">1x</span>
|
|
499
636
|
<span class="cline-any cline-no"> </span>
|
|
500
637
|
<span class="cline-any cline-no"> </span>
|
|
501
638
|
<span class="cline-any cline-no"> </span>
|
|
@@ -503,247 +640,182 @@
|
|
|
503
640
|
<span class="cline-any cline-no"> </span>
|
|
504
641
|
<span class="cline-any cline-no"> </span>
|
|
505
642
|
<span class="cline-any cline-no"> </span>
|
|
643
|
+
<span class="cline-any cline-yes">1x</span>
|
|
644
|
+
<span class="cline-any cline-yes">1x</span>
|
|
645
|
+
<span class="cline-any cline-yes">4x</span>
|
|
646
|
+
<span class="cline-any cline-yes">4x</span>
|
|
647
|
+
<span class="cline-any cline-yes">4x</span>
|
|
648
|
+
<span class="cline-any cline-yes">4x</span>
|
|
649
|
+
<span class="cline-any cline-yes">4x</span>
|
|
650
|
+
<span class="cline-any cline-yes">4x</span>
|
|
651
|
+
<span class="cline-any cline-yes">1x</span>
|
|
652
|
+
<span class="cline-any cline-yes">1x</span>
|
|
506
653
|
<span class="cline-any cline-no"> </span>
|
|
507
654
|
<span class="cline-any cline-no"> </span>
|
|
508
655
|
<span class="cline-any cline-no"> </span>
|
|
656
|
+
<span class="cline-any cline-yes">1x</span>
|
|
657
|
+
<span class="cline-any cline-yes">1x</span>
|
|
658
|
+
<span class="cline-any cline-yes">4x</span>
|
|
659
|
+
<span class="cline-any cline-yes">4x</span>
|
|
660
|
+
<span class="cline-any cline-yes">4x</span>
|
|
661
|
+
<span class="cline-any cline-yes">4x</span>
|
|
509
662
|
<span class="cline-any cline-no"> </span>
|
|
510
663
|
<span class="cline-any cline-no"> </span>
|
|
664
|
+
<span class="cline-any cline-yes">4x</span>
|
|
665
|
+
<span class="cline-any cline-yes">4x</span>
|
|
511
666
|
<span class="cline-any cline-no"> </span>
|
|
512
667
|
<span class="cline-any cline-no"> </span>
|
|
668
|
+
<span class="cline-any cline-yes">4x</span>
|
|
669
|
+
<span class="cline-any cline-yes">4x</span>
|
|
670
|
+
<span class="cline-any cline-yes">14x</span>
|
|
671
|
+
<span class="cline-any cline-yes">1x</span>
|
|
672
|
+
<span class="cline-any cline-yes">1x</span>
|
|
673
|
+
<span class="cline-any cline-yes">1x</span>
|
|
674
|
+
<span class="cline-any cline-yes">1x</span>
|
|
675
|
+
<span class="cline-any cline-yes">4x</span>
|
|
676
|
+
<span class="cline-any cline-yes">4x</span>
|
|
677
|
+
<span class="cline-any cline-yes">4x</span>
|
|
513
678
|
<span class="cline-any cline-no"> </span>
|
|
514
679
|
<span class="cline-any cline-no"> </span>
|
|
515
|
-
<span class="cline-any cline-
|
|
516
|
-
<span class="cline-any cline-
|
|
517
|
-
<span class="cline-any cline-
|
|
518
|
-
<span class="cline-any cline-
|
|
519
|
-
<span class="cline-any cline-
|
|
520
|
-
<span class="cline-any cline-
|
|
521
|
-
<span class="cline-any cline-
|
|
522
|
-
<span class="cline-any cline-
|
|
523
|
-
<span class="cline-any cline-
|
|
524
|
-
<span class="cline-any cline-
|
|
525
|
-
<span class="cline-any cline-
|
|
526
|
-
<span class="cline-any cline-
|
|
527
|
-
<span class="cline-any cline-
|
|
528
|
-
<span class="cline-any cline-
|
|
529
|
-
<span class="cline-any cline-
|
|
530
|
-
<span class="cline-any cline-
|
|
531
|
-
<span class="cline-any cline-
|
|
532
|
-
<span class="cline-any cline-
|
|
533
|
-
<span class="cline-any cline-
|
|
534
|
-
<span class="cline-any cline-
|
|
535
|
-
<span class="cline-any cline-
|
|
536
|
-
<span class="cline-any cline-
|
|
537
|
-
<span class="cline-any cline-
|
|
538
|
-
<span class="cline-any cline-
|
|
539
|
-
<span class="cline-any cline-
|
|
540
|
-
<span class="cline-any cline-
|
|
541
|
-
<span class="cline-any cline-
|
|
542
|
-
<span class="cline-any cline-
|
|
543
|
-
<span class="cline-any cline-
|
|
544
|
-
<span class="cline-any cline-
|
|
545
|
-
<span class="cline-any cline-
|
|
546
|
-
<span class="cline-any cline-
|
|
547
|
-
<span class="cline-any cline-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
<span class="
|
|
588
|
-
<span class="cline-any cline-no"> </span>
|
|
589
|
-
<span class="cline-any cline-no"> </span>
|
|
590
|
-
<span class="cline-any cline-no"> </span>
|
|
591
|
-
<span class="cline-any cline-no"> </span>
|
|
592
|
-
<span class="cline-any cline-no"> </span>
|
|
593
|
-
<span class="cline-any cline-no"> </span>
|
|
594
|
-
<span class="cline-any cline-no"> </span>
|
|
595
|
-
<span class="cline-any cline-no"> </span>
|
|
596
|
-
<span class="cline-any cline-no"> </span>
|
|
597
|
-
<span class="cline-any cline-no"> </span>
|
|
598
|
-
<span class="cline-any cline-no"> </span>
|
|
599
|
-
<span class="cline-any cline-no"> </span>
|
|
600
|
-
<span class="cline-any cline-no"> </span>
|
|
601
|
-
<span class="cline-any cline-no"> </span>
|
|
602
|
-
<span class="cline-any cline-no"> </span>
|
|
603
|
-
<span class="cline-any cline-no"> </span>
|
|
604
|
-
<span class="cline-any cline-no"> </span>
|
|
605
|
-
<span class="cline-any cline-no"> </span>
|
|
606
|
-
<span class="cline-any cline-no"> </span>
|
|
607
|
-
<span class="cline-any cline-no"> </span>
|
|
608
|
-
<span class="cline-any cline-no"> </span>
|
|
609
|
-
<span class="cline-any cline-no"> </span>
|
|
610
|
-
<span class="cline-any cline-no"> </span>
|
|
611
|
-
<span class="cline-any cline-no"> </span>
|
|
612
|
-
<span class="cline-any cline-no"> </span>
|
|
613
|
-
<span class="cline-any cline-no"> </span>
|
|
614
|
-
<span class="cline-any cline-no"> </span>
|
|
615
|
-
<span class="cline-any cline-no"> </span>
|
|
616
|
-
<span class="cline-any cline-no"> </span>
|
|
617
|
-
<span class="cline-any cline-no"> </span>
|
|
618
|
-
<span class="cline-any cline-no"> </span>
|
|
619
|
-
<span class="cline-any cline-no"> </span>
|
|
620
|
-
<span class="cline-any cline-no"> </span>
|
|
621
|
-
<span class="cline-any cline-no"> </span>
|
|
622
|
-
<span class="cline-any cline-no"> </span>
|
|
623
|
-
<span class="cline-any cline-no"> </span>
|
|
624
|
-
<span class="cline-any cline-no"> </span>
|
|
625
|
-
<span class="cline-any cline-no"> </span>
|
|
626
|
-
<span class="cline-any cline-no"> </span>
|
|
627
|
-
<span class="cline-any cline-no"> </span>
|
|
628
|
-
<span class="cline-any cline-no"> </span>
|
|
629
|
-
<span class="cline-any cline-no"> </span>
|
|
630
|
-
<span class="cline-any cline-no"> </span>
|
|
631
|
-
<span class="cline-any cline-no"> </span>
|
|
632
|
-
<span class="cline-any cline-no"> </span>
|
|
633
|
-
<span class="cline-any cline-no"> </span>
|
|
634
|
-
<span class="cline-any cline-no"> </span>
|
|
635
|
-
<span class="cline-any cline-no"> </span>
|
|
636
|
-
<span class="cline-any cline-no"> </span>
|
|
637
|
-
<span class="cline-any cline-no"> </span>
|
|
638
|
-
<span class="cline-any cline-no"> </span>
|
|
639
|
-
<span class="cline-any cline-no"> </span>
|
|
640
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js"><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ><span class="branch-0 cbranch-no" title="branch not covered" >import _ from 'lodash'</span></span></span>
|
|
641
|
-
<span class="cstat-no" title="statement not covered" >import path from 'path'</span>
|
|
642
|
-
<span class="cstat-no" title="statement not covered" >import fs from 'fs-extra'</span>
|
|
643
|
-
<span class="cstat-no" title="statement not covered" >import zlib from 'zlib'</span>
|
|
644
|
-
<span class="cstat-no" title="statement not covered" >import request from 'superagent'</span>
|
|
645
|
-
<span class="cstat-no" title="statement not covered" >import makeDebug from 'debug'</span>
|
|
646
|
-
<span class="cstat-no" title="statement not covered" >import { fileURLToPath } from 'url'</span>
|
|
647
|
-
<span class="cstat-no" title="statement not covered" >import * as permissions from '../../../core/common/permissions.js'</span>
|
|
648
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
649
|
-
<span class="cstat-no" title="statement not covered" >const __dirname = path.dirname(fileURLToPath(import.meta.url))</span>
|
|
650
|
-
<span class="cstat-no" title="statement not covered" >const modelsPath = path.join(__dirname, '..', 'models')</span>
|
|
651
|
-
<span class="cstat-no" title="statement not covered" >const servicesPath = path.join(__dirname, '..', 'services')</span>
|
|
652
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
653
|
-
<span class="cstat-no" title="statement not covered" >const debug = makeDebug('kdk:map:services')</span>
|
|
654
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
655
|
-
<span class="cstat-no" title="statement not covered" >export function createFeaturesService (options = {}) {</span>
|
|
656
|
-
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
657
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
658
|
-
<span class="cstat-no" title="statement not covered" > debug('Creating features service with options', options)</span>
|
|
659
|
-
<span class="cstat-no" title="statement not covered" > const service = app.createService(options.collection, Object.assign({</span>
|
|
660
|
-
<span class="cstat-no" title="statement not covered" > modelName: 'features',</span>
|
|
661
|
-
<span class="cstat-no" title="statement not covered" > servicesPath,</span>
|
|
662
|
-
<span class="cstat-no" title="statement not covered" > modelsPath,</span>
|
|
663
|
-
<span class="cstat-no" title="statement not covered" > paginate: { default: 5000, max: 5000 },</span>
|
|
664
|
-
<span class="cstat-no" title="statement not covered" > // FIXME: no real-time events for now since we create big batches,</span>
|
|
665
|
-
<span class="cstat-no" title="statement not covered" > // does not seem to be sufficient also require a hook (see https://github.com/feathersjs/feathers/issues/922)</span>
|
|
666
|
-
<span class="cstat-no" title="statement not covered" > events: ['features'],</span>
|
|
667
|
-
<span class="cstat-no" title="statement not covered" > methods: ['find', 'get', 'create', 'update', 'patch', 'remove', 'heatmap', 'formatGeoJSON']</span>
|
|
668
|
-
<span class="cstat-no" title="statement not covered" > }, options))</span>
|
|
669
|
-
<span class="cstat-no" title="statement not covered" > // As a features service can be created dynamically register default permissions for it</span>
|
|
670
|
-
<span class="cstat-no" title="statement not covered" > permissions.defineAbilities.registerHook((subject, can, cannot) => {</span>
|
|
671
|
-
<span class="cstat-no" title="statement not covered" > can('service', options.collection)</span>
|
|
672
|
-
<span class="cstat-no" title="statement not covered" > can('read', options.collection)</span>
|
|
673
|
-
<span class="cstat-no" title="statement not covered" > })</span>
|
|
674
|
-
<span class="cstat-no" title="statement not covered" > // We then need to update abilities cache</span>
|
|
675
|
-
<span class="cstat-no" title="statement not covered" > const authorisationService = app.getService('authorisations')</span>
|
|
676
|
-
<span class="cstat-no" title="statement not covered" > if (authorisationService) authorisationService.clearAbilities()</span>
|
|
677
|
-
<span class="cstat-no" title="statement not covered" > return service</span>
|
|
678
|
-
<span class="cstat-no" title="statement not covered" >}</span>
|
|
679
|
-
<span class="cstat-no" title="statement not covered" ></span>
|
|
680
|
-
<span class="cstat-no" title="statement not covered" >export function removeFeaturesService (options = {}) {</span>
|
|
680
|
+
<span class="cline-any cline-yes">4x</span>
|
|
681
|
+
<span class="cline-any cline-yes">4x</span>
|
|
682
|
+
<span class="cline-any cline-yes">4x</span>
|
|
683
|
+
<span class="cline-any cline-yes">4x</span>
|
|
684
|
+
<span class="cline-any cline-yes">4x</span>
|
|
685
|
+
<span class="cline-any cline-yes">4x</span>
|
|
686
|
+
<span class="cline-any cline-yes">4x</span>
|
|
687
|
+
<span class="cline-any cline-yes">4x</span>
|
|
688
|
+
<span class="cline-any cline-yes">4x</span>
|
|
689
|
+
<span class="cline-any cline-yes">4x</span>
|
|
690
|
+
<span class="cline-any cline-yes">4x</span>
|
|
691
|
+
<span class="cline-any cline-yes">4x</span>
|
|
692
|
+
<span class="cline-any cline-yes">4x</span>
|
|
693
|
+
<span class="cline-any cline-yes">4x</span>
|
|
694
|
+
<span class="cline-any cline-yes">4x</span>
|
|
695
|
+
<span class="cline-any cline-yes">4x</span>
|
|
696
|
+
<span class="cline-any cline-yes">4x</span>
|
|
697
|
+
<span class="cline-any cline-yes">4x</span>
|
|
698
|
+
<span class="cline-any cline-yes">4x</span>
|
|
699
|
+
<span class="cline-any cline-yes">4x</span>
|
|
700
|
+
<span class="cline-any cline-yes">4x</span>
|
|
701
|
+
<span class="cline-any cline-yes">4x</span>
|
|
702
|
+
<span class="cline-any cline-yes">4x</span>
|
|
703
|
+
<span class="cline-any cline-yes">4x</span>
|
|
704
|
+
<span class="cline-any cline-yes">4x</span>
|
|
705
|
+
<span class="cline-any cline-yes">4x</span>
|
|
706
|
+
<span class="cline-any cline-yes">4x</span>
|
|
707
|
+
<span class="cline-any cline-yes">4x</span>
|
|
708
|
+
<span class="cline-any cline-yes">4x</span>
|
|
709
|
+
<span class="cline-any cline-yes">4x</span>
|
|
710
|
+
<span class="cline-any cline-yes">4x</span>
|
|
711
|
+
<span class="cline-any cline-yes">4x</span>
|
|
712
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import _ from 'lodash'
|
|
713
|
+
import path from 'path'
|
|
714
|
+
import fs from 'fs-extra'
|
|
715
|
+
import zlib from 'zlib'
|
|
716
|
+
import request from 'superagent'
|
|
717
|
+
import makeDebug from 'debug'
|
|
718
|
+
import { fileURLToPath } from 'url'
|
|
719
|
+
import * as permissions from '../../../core/common/permissions.js'
|
|
720
|
+
|
|
721
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
722
|
+
const modelsPath = path.join(__dirname, '..', 'models')
|
|
723
|
+
const servicesPath = path.join(__dirname, '..', 'services')
|
|
724
|
+
|
|
725
|
+
const debug = makeDebug('kdk:map:services')
|
|
726
|
+
|
|
727
|
+
export function createFeaturesService (options = {}) {
|
|
728
|
+
const app = this
|
|
729
|
+
|
|
730
|
+
debug('Creating features service with options', options)
|
|
731
|
+
const service = app.createService(options.collection, Object.assign({
|
|
732
|
+
modelName: 'features',
|
|
733
|
+
servicesPath,
|
|
734
|
+
modelsPath,
|
|
735
|
+
paginate: { default: 5000, max: 5000 },
|
|
736
|
+
// FIXME: no real-time events for now since we create big batches,
|
|
737
|
+
// does not seem to be sufficient also require a hook (see https://github.com/feathersjs/feathers/issues/922)
|
|
738
|
+
events: ['features'],
|
|
739
|
+
methods: ['find', 'get', 'create', 'update', 'patch', 'remove', 'heatmap', 'formatGeoJSON']
|
|
740
|
+
}, options))
|
|
741
|
+
// As a features service can be created dynamically register default permissions for it
|
|
742
|
+
permissions.defineAbilities.registerHook((subject, can, cannot) => {
|
|
743
|
+
can('service', options.collection)
|
|
744
|
+
can('read', options.collection)
|
|
745
|
+
})
|
|
746
|
+
// We then need to update abilities cache
|
|
747
|
+
const authorisationService = app.getService('authorisations')
|
|
748
|
+
if (authorisationService) authorisationService.clearAbilities()
|
|
749
|
+
return service
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
export <span class="fstat-no" title="function not covered" >function removeFeaturesService (options = {}) {</span>
|
|
681
753
|
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
682
754
|
<span class="cstat-no" title="statement not covered" > debug('Removing features service with options', options)</span>
|
|
683
755
|
<span class="cstat-no" title="statement not covered" > return app.removeService(app.getService(options.collection, options.context))</span>
|
|
684
756
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
<span class="
|
|
757
|
+
|
|
758
|
+
export function createCatalogService (options = {}) {
|
|
759
|
+
const app = this
|
|
760
|
+
|
|
761
|
+
// Read default categories/sublegends config, which can be overriden by options
|
|
762
|
+
const catalogConfig = app.get('catalog') || {}
|
|
763
|
+
const categories = catalogConfig.categories
|
|
764
|
+
const sublegends = catalogConfig.sublegends
|
|
765
|
+
|
|
766
|
+
debug('Creating catalog service with options', options)
|
|
767
|
+
return app.createService('catalog', Object.assign({
|
|
768
|
+
servicesPath,
|
|
769
|
+
modelsPath,
|
|
770
|
+
paginate: { default: 1000, max: 1000 },
|
|
771
|
+
categories,
|
|
772
|
+
sublegends
|
|
773
|
+
}, options))
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
export <span class="fstat-no" title="function not covered" >function removeCatalogService (options = {}) {</span>
|
|
705
777
|
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
706
778
|
<span class="cstat-no" title="statement not covered" > debug('Removing catalog service with options', options)</span>
|
|
707
779
|
<span class="cstat-no" title="statement not covered" > return app.removeService(app.getService('catalog', options.context))</span>
|
|
708
780
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
<span class="
|
|
781
|
+
|
|
782
|
+
export async function createProjectsService (options = {}) {
|
|
783
|
+
const app = this
|
|
784
|
+
|
|
785
|
+
debug('Creating projects service with options', options)
|
|
786
|
+
await app.createService('projects', Object.assign({
|
|
787
|
+
servicesPath,
|
|
788
|
+
modelsPath,
|
|
789
|
+
paginate: { default: 20, max: 5000 }
|
|
790
|
+
}, options))
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
export <span class="fstat-no" title="function not covered" >function removeProjectsService (options = {}) {</span>
|
|
722
794
|
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
723
795
|
<span class="cstat-no" title="statement not covered" > debug('Removing projects service with options', options)</span>
|
|
724
796
|
<span class="cstat-no" title="statement not covered" > return app.removeService(app.getService('projects', options.context))</span>
|
|
725
797
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
<span class="
|
|
798
|
+
|
|
799
|
+
export function createAlertsService (options = {}) {
|
|
800
|
+
const app = this
|
|
801
|
+
|
|
802
|
+
debug('Creating alerts service with options', options)
|
|
803
|
+
const paginate = { default: 5000, max: 5000 }
|
|
804
|
+
return app.createService('alerts', Object.assign({
|
|
805
|
+
servicesPath,
|
|
806
|
+
modelsPath,
|
|
807
|
+
paginate
|
|
808
|
+
}, options))
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
export <span class="fstat-no" title="function not covered" >function removeAlertsService (options = {}) {</span>
|
|
740
812
|
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
741
813
|
<span class="cstat-no" title="statement not covered" > debug('Removing alerts service with options', options)</span>
|
|
742
814
|
<span class="cstat-no" title="statement not covered" > return app.removeService(app.getService('alerts', options.context))</span>
|
|
743
815
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
<span class="
|
|
816
|
+
|
|
817
|
+
// Helper to register service and permissions for a layer
|
|
818
|
+
export <span class="fstat-no" title="function not covered" >async function createFeaturesServiceForLayer (layer, context) {</span>
|
|
747
819
|
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
748
820
|
<span class="cstat-no" title="statement not covered" > // Check if service(s) are associated to this layer</span>
|
|
749
821
|
<span class="cstat-no" title="statement not covered" > // Avoid create it twice as we can share services between different layers</span>
|
|
@@ -765,8 +837,8 @@
|
|
|
765
837
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
766
838
|
<span class="cstat-no" title="statement not covered" > return service || probeService</span>
|
|
767
839
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
768
|
-
|
|
769
|
-
<span class="
|
|
840
|
+
// Helper to unregister service for a layer
|
|
841
|
+
export <span class="fstat-no" title="function not covered" >async function removeFeaturesServiceForLayer (layer, context) {</span>
|
|
770
842
|
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
771
843
|
<span class="cstat-no" title="statement not covered" > // Check if service(s) are associated to this layer and remove it</span>
|
|
772
844
|
<span class="cstat-no" title="statement not covered" > let probeService = (layer.probeService ? app.getService(layer.probeService, context) : null)</span>
|
|
@@ -779,20 +851,26 @@
|
|
|
779
851
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
780
852
|
<span class="cstat-no" title="statement not covered" > return service || probeService</span>
|
|
781
853
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
782
|
-
|
|
783
|
-
<span class="
|
|
854
|
+
// Helper to create features from source for a layer
|
|
855
|
+
export <span class="fstat-no" title="function not covered" >async function createFeaturesForLayer (features, layer, options = {}) {</span>
|
|
784
856
|
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
785
857
|
<span class="cstat-no" title="statement not covered" > const featuresService = app.getService(layer.service, options.context)</span>
|
|
786
858
|
<span class="cstat-no" title="statement not covered" > if (options && options.filter) features = await options.filter(features, layer, app)</span>
|
|
859
|
+
<span class="cstat-no" title="statement not covered" > // User-defined layers requires layer ID</span>
|
|
860
|
+
<span class="cstat-no" title="statement not covered" > if (layer.service === 'features') {</span>
|
|
861
|
+
<span class="cstat-no" title="statement not covered" > features.forEach(feature => {</span>
|
|
862
|
+
<span class="cstat-no" title="statement not covered" > feature.layer = layer._id</span>
|
|
863
|
+
<span class="cstat-no" title="statement not covered" > })</span>
|
|
864
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
787
865
|
<span class="cstat-no" title="statement not covered" > if (!features.length) return</span>
|
|
788
866
|
<span class="cstat-no" title="statement not covered" > // The unordered option ensure a faster processing when inserting multiple items</span>
|
|
789
867
|
<span class="cstat-no" title="statement not covered" > // and that after an error remaining write operations in the queue will continue anyway</span>
|
|
790
868
|
<span class="cstat-no" title="statement not covered" > await featuresService.create(features, { mongodb: { ordered: false } })</span>
|
|
791
869
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
<span class="
|
|
870
|
+
|
|
871
|
+
// Read default layers configured and create, if not found in DB, or update it accordingly
|
|
872
|
+
// Will also clean and feed default data (ie features) if provided as input file
|
|
873
|
+
export <span class="fstat-no" title="function not covered" >async function createDefaultCatalogLayers (options = {}) {</span>
|
|
796
874
|
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
797
875
|
<span class="cstat-no" title="statement not covered" > const catalogService = app.getService('catalog', options.context)</span>
|
|
798
876
|
<span class="cstat-no" title="statement not covered" > const catalog = app.get('catalog')</span>
|
|
@@ -801,32 +879,38 @@
|
|
|
801
879
|
<span class="cstat-no" title="statement not covered" > const layers = await catalogService.find({ query: {}, paginate: false })</span>
|
|
802
880
|
<span class="cstat-no" title="statement not covered" > for (let i = 0; i < defaultLayers.length; i++) {</span>
|
|
803
881
|
<span class="cstat-no" title="statement not covered" > const defaultLayer = defaultLayers[i]</span>
|
|
804
|
-
<span class="cstat-no" title="statement not covered" >
|
|
882
|
+
<span class="cstat-no" title="statement not covered" > let createdLayer = _.find(layers, { name: defaultLayer.name })</span>
|
|
883
|
+
<span class="cstat-no" title="statement not covered" > const isLayerAlreadyCreated = !_.isNil(createdLayer)</span>
|
|
805
884
|
<span class="cstat-no" title="statement not covered" > let featuresService</span>
|
|
806
885
|
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
886
|
+
<span class="cstat-no" title="statement not covered" > // Used to filter properties only used to initialize a layer and related data</span>
|
|
887
|
+
<span class="cstat-no" title="statement not covered" > const reservedProperties = ['filter', 'url', 'fileName', 'forceDataUpdate']</span>
|
|
888
|
+
<span class="cstat-no" title="statement not covered" > // Create or update the layer removing any option only used to manage layer setup</span>
|
|
889
|
+
<span class="cstat-no" title="statement not covered" > if (!isLayerAlreadyCreated) {</span>
|
|
890
|
+
<span class="cstat-no" title="statement not covered" > app.logger.info('Adding default layer (name = ' + defaultLayer.name + ')')</span>
|
|
891
|
+
<span class="cstat-no" title="statement not covered" > createdLayer = await catalogService.create(_.omit(defaultLayer, reservedProperties))</span>
|
|
892
|
+
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
893
|
+
<span class="cstat-no" title="statement not covered" > app.logger.info('Updating default layer (name = ' + defaultLayer.name + ')')</span>
|
|
894
|
+
<span class="cstat-no" title="statement not covered" > createdLayer = await catalogService.update(createdLayer._id, _.omit(defaultLayer, reservedProperties))</span>
|
|
895
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
896
|
+
<span class="cstat-no" title="statement not covered" > // Features creation might require the layer ID</span>
|
|
897
|
+
<span class="cstat-no" title="statement not covered" > defaultLayer._id = createdLayer._id</span>
|
|
807
898
|
<span class="cstat-no" title="statement not covered" > // Check if service(s) are associated to this layer and create the related service(s) if required</span>
|
|
808
899
|
<span class="cstat-no" title="statement not covered" > if (defaultLayer.service) {</span>
|
|
809
900
|
<span class="cstat-no" title="statement not covered" > featuresService = app.getService(defaultLayer.service)</span>
|
|
810
901
|
<span class="cstat-no" title="statement not covered" > // Avoid create it twice as we can share services between different layers</span>
|
|
811
|
-
<span class="cstat-no" title="statement not covered" > if (featuresService) continue</span>
|
|
812
902
|
<span class="cstat-no" title="statement not covered" > featuresService = await createFeaturesServiceForLayer.call(app, defaultLayer, options.context)</span>
|
|
813
903
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
814
|
-
<span class="cstat-no" title="statement not covered" > // Create or update the layer removing any option only used to manage layer setup</span>
|
|
815
|
-
<span class="cstat-no" title="statement not covered" > if (!createdLayer) {</span>
|
|
816
|
-
<span class="cstat-no" title="statement not covered" > app.logger.info('Adding default layer (name = ' + defaultLayer.name + ')')</span>
|
|
817
|
-
<span class="cstat-no" title="statement not covered" > await catalogService.create(_.omit(defaultLayer, ['filter']))</span>
|
|
818
|
-
<span class="cstat-no" title="statement not covered" > } else {</span>
|
|
819
|
-
<span class="cstat-no" title="statement not covered" > app.logger.info('Updating default layer (name = ' + defaultLayer.name + ')')</span>
|
|
820
|
-
<span class="cstat-no" title="statement not covered" > await catalogService.update(createdLayer._id, _.omit(defaultLayer, ['filter']))</span>
|
|
821
|
-
<span class="cstat-no" title="statement not covered" > }</span>
|
|
822
904
|
<span class="cstat-no" title="statement not covered" > } catch (error) {</span>
|
|
823
905
|
<span class="cstat-no" title="statement not covered" > console.error(error)</span>
|
|
824
906
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
825
907
|
<span class="cstat-no" title="statement not covered" > // And if we need to initialize some data as well</span>
|
|
826
|
-
<span class="cstat-no" title="statement not covered" > if (!
|
|
908
|
+
<span class="cstat-no" title="statement not covered" > if ((!isLayerAlreadyCreated || defaultLayer.forceDataUpdate) && featuresService && (defaultLayer.url || defaultLayer.fileName)) {</span>
|
|
909
|
+
<span class="cstat-no" title="statement not covered" > app.logger.info('Updating data for default layer (name = ' + defaultLayer.name + ')')</span>
|
|
827
910
|
<span class="cstat-no" title="statement not covered" > // Cleanup</span>
|
|
828
911
|
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
829
|
-
<span class="cstat-no" title="statement not covered" >
|
|
912
|
+
<span class="cstat-no" title="statement not covered" > // Keep track of user-created content for editable layer, ie features having a layer ID</span>
|
|
913
|
+
<span class="cstat-no" title="statement not covered" > await featuresService.remove(null, { query: { layer: { $exists: false } } })</span>
|
|
830
914
|
<span class="cstat-no" title="statement not covered" > } catch (error) {</span>
|
|
831
915
|
<span class="cstat-no" title="statement not covered" > console.error(error)</span>
|
|
832
916
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
@@ -844,9 +928,15 @@
|
|
|
844
928
|
<span class="cstat-no" title="statement not covered" > .pipe(zlib.createGunzip())</span>
|
|
845
929
|
<span class="cstat-no" title="statement not covered" > .pipe(fs.createWriteStream(extractedFileName))</span>
|
|
846
930
|
<span class="cstat-no" title="statement not covered" > .on('close', async () => {</span>
|
|
847
|
-
<span class="cstat-no" title="statement not covered" >
|
|
931
|
+
<span class="cstat-no" title="statement not covered" > let geojson = fs.readJsonSync(extractedFileName)</span>
|
|
932
|
+
<span class="cstat-no" title="statement not covered" > // We allow GeoJson collection or features array</span>
|
|
933
|
+
<span class="cstat-no" title="statement not covered" > geojson = Array.isArray(geojson) ? geojson : geojson.features</span>
|
|
934
|
+
<span class="cstat-no" title="statement not covered" > // We also allow for data exported from MongoDB, in this case remove any Mongo specific ID</span>
|
|
935
|
+
<span class="cstat-no" title="statement not covered" > geojson.forEach(feature => {</span>
|
|
936
|
+
<span class="cstat-no" title="statement not covered" > delete feature._id</span>
|
|
937
|
+
<span class="cstat-no" title="statement not covered" > })</span>
|
|
848
938
|
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
849
|
-
<span class="cstat-no" title="statement not covered" > await createFeaturesForLayer.call(app, geojson
|
|
939
|
+
<span class="cstat-no" title="statement not covered" > await createFeaturesForLayer.call(app, geojson, defaultLayer, options)</span>
|
|
850
940
|
<span class="cstat-no" title="statement not covered" > } catch (error) {</span>
|
|
851
941
|
<span class="cstat-no" title="statement not covered" > console.error(error)</span>
|
|
852
942
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
@@ -863,9 +953,9 @@
|
|
|
863
953
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
864
954
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
865
955
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
<span class="
|
|
956
|
+
|
|
957
|
+
// Create the required features services for layers found in catalog
|
|
958
|
+
export <span class="fstat-no" title="function not covered" >async function createCatalogFeaturesServices (options = {}) {</span>
|
|
869
959
|
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
870
960
|
<span class="cstat-no" title="statement not covered" > const catalogService = app.getService('catalog', options.context)</span>
|
|
871
961
|
<span class="cstat-no" title="statement not covered" > const layers = await catalogService.find({ query: { service: { $exists: true } }, paginate: false, $select: ['service'] })</span>
|
|
@@ -873,57 +963,75 @@
|
|
|
873
963
|
<span class="cstat-no" title="statement not covered" > await createFeaturesServiceForLayer.call(app, layers[i], options.context)</span>
|
|
874
964
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
875
965
|
<span class="cstat-no" title="statement not covered" >}</span>
|
|
876
|
-
|
|
877
|
-
|
|
966
|
+
|
|
967
|
+
export function createStylesService (options = {}) {
|
|
968
|
+
const app = this
|
|
969
|
+
return app.createService('styles', Object.assign({
|
|
970
|
+
servicesPath,
|
|
971
|
+
modelsPath
|
|
972
|
+
}, options))
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
export <span class="fstat-no" title="function not covered" >function removeStylesService (options = {}) {</span>
|
|
878
976
|
<span class="cstat-no" title="statement not covered" > const app = this</span>
|
|
879
|
-
<span class="cstat-no" title="statement not covered"
|
|
880
|
-
<span class="cstat-no" title="statement not covered" >
|
|
881
|
-
|
|
977
|
+
<span class="cstat-no" title="statement not covered" > return app.removeService(app.getService('styles', options.context))</span>
|
|
978
|
+
<span class="cstat-no" title="statement not covered" >}</span>
|
|
979
|
+
|
|
980
|
+
export default async function () {
|
|
981
|
+
const app = this
|
|
982
|
+
|
|
983
|
+
const catalogConfig = app.get('catalog')
|
|
984
|
+
if (catalogConfig) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
882
985
|
<span class="cstat-no" title="statement not covered" > await createCatalogService.call(app)</span>
|
|
883
986
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
884
|
-
|
|
885
|
-
<span class="
|
|
987
|
+
const projectsConfig = app.get('projects')
|
|
988
|
+
if (projectsConfig) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
886
989
|
<span class="cstat-no" title="statement not covered" > await createProjectsService.call(app)</span>
|
|
887
990
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
<span class="
|
|
991
|
+
// Add app-specific hooks to required services
|
|
992
|
+
app.on('service', async service => {
|
|
993
|
+
if (service.name === 'alerts') {
|
|
994
|
+
// On startup restore alerts CRON tasks if service not disabled
|
|
995
|
+
const alerts = await service.find({ paginate: false })
|
|
996
|
+
alerts.forEach(alert => service.registerAlert(alert, false))
|
|
997
|
+
}
|
|
998
|
+
})
|
|
999
|
+
const alertsConfig = app.get('alerts')
|
|
1000
|
+
if (alertsConfig) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
|
|
898
1001
|
<span class="cstat-no" title="statement not covered" > await createAlertsService.call(app)</span>
|
|
899
1002
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1003
|
+
const stylesConfig = app.get('styles')
|
|
1004
|
+
if (stylesConfig) {
|
|
1005
|
+
await createStylesService.call(app)
|
|
1006
|
+
debug('\'styles\' service created')
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/*
|
|
1010
|
+
app.createService('daptiles', Object.assign({
|
|
1011
|
+
servicesPath,
|
|
1012
|
+
middlewares: {
|
|
1013
|
+
after: [
|
|
1014
|
+
(req, res, next) => {
|
|
1015
|
+
const buffers = _.get(res.data, 'buffers')
|
|
1016
|
+
if (buffers) {
|
|
1017
|
+
const binary = Buffer.concat(buffers)
|
|
1018
|
+
res.set({
|
|
1019
|
+
'Content-Type': 'application/octet-stream'
|
|
1020
|
+
}).status(200)
|
|
1021
|
+
// for (const buf of buffers) {
|
|
1022
|
+
// // res.send(buf)
|
|
1023
|
+
// res.write(buf)
|
|
1024
|
+
// }
|
|
1025
|
+
// res.end()
|
|
1026
|
+
res.end(binary)
|
|
1027
|
+
}
|
|
1028
|
+
next()
|
|
1029
|
+
}
|
|
1030
|
+
]
|
|
1031
|
+
}
|
|
1032
|
+
}))
|
|
1033
|
+
*/
|
|
1034
|
+
}
|
|
927
1035
|
</pre></td></tr></table></pre>
|
|
928
1036
|
|
|
929
1037
|
<div class='push'></div><!-- for sticky footer -->
|
|
@@ -931,7 +1039,7 @@
|
|
|
931
1039
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
932
1040
|
Code coverage generated by
|
|
933
1041
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
934
|
-
at 2025-
|
|
1042
|
+
at 2025-07-24T10:00:20.476Z
|
|
935
1043
|
</div>
|
|
936
1044
|
<script src="../../../prettify.js"></script>
|
|
937
1045
|
<script>
|