@ngageoint/mage.service 6.2.2
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/bin/mage.service.js +230 -0
- package/bin/migration.js +60 -0
- package/bin/poststop.sh +1 -0
- package/bin/prestart.sh +1 -0
- package/lib/@types/express/index.d.ts +18 -0
- package/lib/@types/geojson-validation/index.d.ts +15 -0
- package/lib/@types/mongodb-migrations/index.d.ts +99 -0
- package/lib/access/index.d.ts +21 -0
- package/lib/access/index.d.ts.map +1 -0
- package/lib/access/index.js +40 -0
- package/lib/access/index.js.map +1 -0
- package/lib/adapters/adapters.controllers.web.d.ts +22 -0
- package/lib/adapters/adapters.controllers.web.d.ts.map +1 -0
- package/lib/adapters/adapters.controllers.web.js +55 -0
- package/lib/adapters/adapters.controllers.web.js.map +1 -0
- package/lib/adapters/adapters.db.mongoose.d.ts +5 -0
- package/lib/adapters/adapters.db.mongoose.d.ts.map +1 -0
- package/lib/adapters/adapters.db.mongoose.js +70 -0
- package/lib/adapters/adapters.db.mongoose.js.map +1 -0
- package/lib/adapters/adapters.simple_id_factory.d.ts +5 -0
- package/lib/adapters/adapters.simple_id_factory.d.ts.map +1 -0
- package/lib/adapters/adapters.simple_id_factory.js +24 -0
- package/lib/adapters/adapters.simple_id_factory.js.map +1 -0
- package/lib/adapters/base/adapters.base.db.mongoose.d.ts +59 -0
- package/lib/adapters/base/adapters.base.db.mongoose.d.ts.map +1 -0
- package/lib/adapters/base/adapters.base.db.mongoose.js +143 -0
- package/lib/adapters/base/adapters.base.db.mongoose.js.map +1 -0
- package/lib/adapters/events/adapters.events.controllers.web.d.ts +14 -0
- package/lib/adapters/events/adapters.events.controllers.web.d.ts.map +1 -0
- package/lib/adapters/events/adapters.events.controllers.web.js +83 -0
- package/lib/adapters/events/adapters.events.controllers.web.js.map +1 -0
- package/lib/adapters/events/adapters.events.db.mongoose.d.ts +27 -0
- package/lib/adapters/events/adapters.events.db.mongoose.d.ts.map +1 -0
- package/lib/adapters/events/adapters.events.db.mongoose.js +127 -0
- package/lib/adapters/events/adapters.events.db.mongoose.js.map +1 -0
- package/lib/adapters/feeds/adapters.feeds.controllers.web.d.ts +25 -0
- package/lib/adapters/feeds/adapters.feeds.controllers.web.d.ts.map +1 -0
- package/lib/adapters/feeds/adapters.feeds.controllers.web.js +234 -0
- package/lib/adapters/feeds/adapters.feeds.controllers.web.js.map +1 -0
- package/lib/adapters/feeds/adapters.feeds.db.mongoose.d.ts +63 -0
- package/lib/adapters/feeds/adapters.feeds.db.mongoose.d.ts.map +1 -0
- package/lib/adapters/feeds/adapters.feeds.db.mongoose.js +199 -0
- package/lib/adapters/feeds/adapters.feeds.db.mongoose.js.map +1 -0
- package/lib/adapters/icons/adapters.icons.content_store.file_system.d.ts +7 -0
- package/lib/adapters/icons/adapters.icons.content_store.file_system.d.ts.map +1 -0
- package/lib/adapters/icons/adapters.icons.content_store.file_system.js +13 -0
- package/lib/adapters/icons/adapters.icons.content_store.file_system.js.map +1 -0
- package/lib/adapters/icons/adapters.icons.controllers.web.d.ts +10 -0
- package/lib/adapters/icons/adapters.icons.controllers.web.d.ts.map +1 -0
- package/lib/adapters/icons/adapters.icons.controllers.web.js +118 -0
- package/lib/adapters/icons/adapters.icons.controllers.web.js.map +1 -0
- package/lib/adapters/icons/adapters.icons.db.mongoose.d.ts +38 -0
- package/lib/adapters/icons/adapters.icons.db.mongoose.d.ts.map +1 -0
- package/lib/adapters/icons/adapters.icons.db.mongoose.js +287 -0
- package/lib/adapters/icons/adapters.icons.db.mongoose.js.map +1 -0
- package/lib/adapters/observations/adapters.observations.attachment_store.file_system.d.ts +29 -0
- package/lib/adapters/observations/adapters.observations.attachment_store.file_system.d.ts.map +1 -0
- package/lib/adapters/observations/adapters.observations.attachment_store.file_system.js +274 -0
- package/lib/adapters/observations/adapters.observations.attachment_store.file_system.js.map +1 -0
- package/lib/adapters/observations/adapters.observations.controllers.web.d.ts +40 -0
- package/lib/adapters/observations/adapters.observations.controllers.web.d.ts.map +1 -0
- package/lib/adapters/observations/adapters.observations.controllers.web.js +196 -0
- package/lib/adapters/observations/adapters.observations.controllers.web.js.map +1 -0
- package/lib/adapters/observations/adapters.observations.db.mongoose.d.ts +30 -0
- package/lib/adapters/observations/adapters.observations.db.mongoose.d.ts.map +1 -0
- package/lib/adapters/observations/adapters.observations.db.mongoose.js +294 -0
- package/lib/adapters/observations/adapters.observations.db.mongoose.js.map +1 -0
- package/lib/adapters/plugins/adapters.plugins.db.mongoose.d.ts +17 -0
- package/lib/adapters/plugins/adapters.plugins.db.mongoose.d.ts.map +1 -0
- package/lib/adapters/plugins/adapters.plugins.db.mongoose.js +59 -0
- package/lib/adapters/plugins/adapters.plugins.db.mongoose.js.map +1 -0
- package/lib/adapters/url_schemes/adapters.url_schemes.plugin.d.ts +38 -0
- package/lib/adapters/url_schemes/adapters.url_schemes.plugin.d.ts.map +1 -0
- package/lib/adapters/url_schemes/adapters.url_schemes.plugin.js +110 -0
- package/lib/adapters/url_schemes/adapters.url_schemes.plugin.js.map +1 -0
- package/lib/adapters/users/adapters.users.controllers.web.d.ts +7 -0
- package/lib/adapters/users/adapters.users.controllers.web.d.ts.map +1 -0
- package/lib/adapters/users/adapters.users.controllers.web.js +37 -0
- package/lib/adapters/users/adapters.users.controllers.web.js.map +1 -0
- package/lib/adapters/users/adapters.users.db.mongoose.d.ts +19 -0
- package/lib/adapters/users/adapters.users.db.mongoose.d.ts.map +1 -0
- package/lib/adapters/users/adapters.users.db.mongoose.js +126 -0
- package/lib/adapters/users/adapters.users.db.mongoose.js.map +1 -0
- package/lib/adapters/web_ui_plugins/adapters.web_ui_plugins.controllers.web.d.ts +3 -0
- package/lib/adapters/web_ui_plugins/adapters.web_ui_plugins.controllers.web.d.ts.map +1 -0
- package/lib/adapters/web_ui_plugins/adapters.web_ui_plugins.controllers.web.js +53 -0
- package/lib/adapters/web_ui_plugins/adapters.web_ui_plugins.controllers.web.js.map +1 -0
- package/lib/api/attachment.d.ts +12 -0
- package/lib/api/attachment.d.ts.map +1 -0
- package/lib/api/attachment.js +81 -0
- package/lib/api/attachment.js.map +1 -0
- package/lib/api/event.d.ts +20 -0
- package/lib/api/event.d.ts.map +1 -0
- package/lib/api/event.js +185 -0
- package/lib/api/event.js.map +1 -0
- package/lib/api/events/location.d.ts +11 -0
- package/lib/api/events/location.d.ts.map +1 -0
- package/lib/api/events/location.js +13 -0
- package/lib/api/events/location.js.map +1 -0
- package/lib/api/events/observation.d.ts +15 -0
- package/lib/api/events/observation.d.ts.map +1 -0
- package/lib/api/events/observation.js +21 -0
- package/lib/api/events/observation.js.map +1 -0
- package/lib/api/feature.d.ts +8 -0
- package/lib/api/feature.d.ts.map +1 -0
- package/lib/api/feature.js +15 -0
- package/lib/api/feature.js.map +1 -0
- package/lib/api/field/attachmentField.d.ts +12 -0
- package/lib/api/field/attachmentField.d.ts.map +1 -0
- package/lib/api/field/attachmentField.js +40 -0
- package/lib/api/field/attachmentField.js.map +1 -0
- package/lib/api/field/checkboxField.d.ts +7 -0
- package/lib/api/field/checkboxField.d.ts.map +1 -0
- package/lib/api/field/checkboxField.js +19 -0
- package/lib/api/field/checkboxField.js.map +1 -0
- package/lib/api/field/dateField.d.ts +8 -0
- package/lib/api/field/dateField.d.ts.map +1 -0
- package/lib/api/field/dateField.js +21 -0
- package/lib/api/field/dateField.js.map +1 -0
- package/lib/api/field/emailField.d.ts +7 -0
- package/lib/api/field/emailField.d.ts.map +1 -0
- package/lib/api/field/emailField.js +19 -0
- package/lib/api/field/emailField.js.map +1 -0
- package/lib/api/field/field.d.ts +12 -0
- package/lib/api/field/field.d.ts.map +1 -0
- package/lib/api/field/field.js +12 -0
- package/lib/api/field/field.js.map +1 -0
- package/lib/api/field/geometryField.d.ts +7 -0
- package/lib/api/field/geometryField.d.ts.map +1 -0
- package/lib/api/field/geometryField.js +35 -0
- package/lib/api/field/geometryField.js.map +1 -0
- package/lib/api/field/index.d.ts +7 -0
- package/lib/api/field/index.d.ts.map +1 -0
- package/lib/api/field/index.js +30 -0
- package/lib/api/field/index.js.map +1 -0
- package/lib/api/field/multiSelectField.d.ts +7 -0
- package/lib/api/field/multiSelectField.d.ts.map +1 -0
- package/lib/api/field/multiSelectField.js +27 -0
- package/lib/api/field/multiSelectField.js.map +1 -0
- package/lib/api/field/numberField.d.ts +7 -0
- package/lib/api/field/numberField.d.ts.map +1 -0
- package/lib/api/field/numberField.js +27 -0
- package/lib/api/field/numberField.js.map +1 -0
- package/lib/api/field/selectField.d.ts +7 -0
- package/lib/api/field/selectField.d.ts.map +1 -0
- package/lib/api/field/selectField.js +22 -0
- package/lib/api/field/selectField.js.map +1 -0
- package/lib/api/field/textField.d.ts +7 -0
- package/lib/api/field/textField.d.ts.map +1 -0
- package/lib/api/field/textField.js +21 -0
- package/lib/api/field/textField.js.map +1 -0
- package/lib/api/form.d.ts +12 -0
- package/lib/api/form.d.ts.map +1 -0
- package/lib/api/form.js +239 -0
- package/lib/api/form.js.map +1 -0
- package/lib/api/icon.d.ts +22 -0
- package/lib/api/icon.d.ts.map +1 -0
- package/lib/api/icon.js +178 -0
- package/lib/api/icon.js.map +1 -0
- package/lib/api/index.d.ts +10 -0
- package/lib/api/index.d.ts.map +1 -0
- package/lib/api/index.js +11 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/layer.d.ts +14 -0
- package/lib/api/layer.d.ts.map +1 -0
- package/lib/api/layer.js +70 -0
- package/lib/api/layer.js.map +1 -0
- package/lib/api/location.d.ts +14 -0
- package/lib/api/location.d.ts.map +1 -0
- package/lib/api/location.js +35 -0
- package/lib/api/location.js.map +1 -0
- package/lib/api/observation.d.ts +25 -0
- package/lib/api/observation.d.ts.map +1 -0
- package/lib/api/observation.js +224 -0
- package/lib/api/observation.js.map +1 -0
- package/lib/api/user.d.ts +16 -0
- package/lib/api/user.d.ts.map +1 -0
- package/lib/api/user.js +250 -0
- package/lib/api/user.js.map +1 -0
- package/lib/app.api/app.api.errors.d.ts +42 -0
- package/lib/app.api/app.api.errors.d.ts.map +1 -0
- package/lib/app.api/app.api.errors.js +43 -0
- package/lib/app.api/app.api.errors.js.map +1 -0
- package/lib/app.api/app.api.global.d.ts +74 -0
- package/lib/app.api/app.api.global.d.ts.map +1 -0
- package/lib/app.api/app.api.global.js +59 -0
- package/lib/app.api/app.api.global.js.map +1 -0
- package/lib/app.api/events/app.api.events.d.ts +31 -0
- package/lib/app.api/events/app.api.events.d.ts.map +1 -0
- package/lib/app.api/events/app.api.events.js +3 -0
- package/lib/app.api/events/app.api.events.js.map +1 -0
- package/lib/app.api/feeds/app.api.feeds.d.ts +139 -0
- package/lib/app.api/feeds/app.api.feeds.d.ts.map +1 -0
- package/lib/app.api/feeds/app.api.feeds.js +26 -0
- package/lib/app.api/feeds/app.api.feeds.js.map +1 -0
- package/lib/app.api/icons/app.api.icons.d.ts +60 -0
- package/lib/app.api/icons/app.api.icons.d.ts.map +1 -0
- package/lib/app.api/icons/app.api.icons.js +29 -0
- package/lib/app.api/icons/app.api.icons.js.map +1 -0
- package/lib/app.api/observations/app.api.observations.d.ts +126 -0
- package/lib/app.api/observations/app.api.observations.d.ts.map +1 -0
- package/lib/app.api/observations/app.api.observations.js +61 -0
- package/lib/app.api/observations/app.api.observations.js.map +1 -0
- package/lib/app.api/users/app.api.users.d.ts +24 -0
- package/lib/app.api/users/app.api.users.d.ts.map +1 -0
- package/lib/app.api/users/app.api.users.js +3 -0
- package/lib/app.api/users/app.api.users.js.map +1 -0
- package/lib/app.d.ts +38 -0
- package/lib/app.d.ts.map +1 -0
- package/lib/app.impl/events/app.impl.events.d.ts +8 -0
- package/lib/app.impl/events/app.impl.events.d.ts.map +1 -0
- package/lib/app.impl/events/app.impl.events.js +107 -0
- package/lib/app.impl/events/app.impl.events.js.map +1 -0
- package/lib/app.impl/feeds/app.impl.feeds.d.ts +21 -0
- package/lib/app.impl/feeds/app.impl.feeds.d.ts.map +1 -0
- package/lib/app.impl/feeds/app.impl.feeds.js +527 -0
- package/lib/app.impl/feeds/app.impl.feeds.js.map +1 -0
- package/lib/app.impl/icons/app.impl.icons.d.ts +7 -0
- package/lib/app.impl/icons/app.impl.icons.d.ts.map +1 -0
- package/lib/app.impl/icons/app.impl.icons.js +81 -0
- package/lib/app.impl/icons/app.impl.icons.js.map +1 -0
- package/lib/app.impl/observations/app.impl.observations.d.ts +11 -0
- package/lib/app.impl/observations/app.impl.observations.d.ts.map +1 -0
- package/lib/app.impl/observations/app.impl.observations.js +357 -0
- package/lib/app.impl/observations/app.impl.observations.js.map +1 -0
- package/lib/app.impl/users/app.impl.users.d.ts +4 -0
- package/lib/app.impl/users/app.impl.users.d.ts.map +1 -0
- package/lib/app.impl/users/app.impl.users.js +37 -0
- package/lib/app.impl/users/app.impl.users.js.map +1 -0
- package/lib/app.js +507 -0
- package/lib/app.js.map +1 -0
- package/lib/assets/default-icon.png +0 -0
- package/lib/authentication/anonymous.d.ts +6 -0
- package/lib/authentication/anonymous.d.ts.map +1 -0
- package/lib/authentication/anonymous.js +17 -0
- package/lib/authentication/anonymous.js.map +1 -0
- package/lib/authentication/index.d.ts +24 -0
- package/lib/authentication/index.d.ts.map +1 -0
- package/lib/authentication/index.js +104 -0
- package/lib/authentication/index.js.map +1 -0
- package/lib/authentication/ldap.d.ts +2 -0
- package/lib/authentication/ldap.d.ts.map +1 -0
- package/lib/authentication/ldap.js +130 -0
- package/lib/authentication/ldap.js.map +1 -0
- package/lib/authentication/local.d.ts +2 -0
- package/lib/authentication/local.d.ts.map +1 -0
- package/lib/authentication/local.js +77 -0
- package/lib/authentication/local.js.map +1 -0
- package/lib/authentication/oauth.d.ts +2 -0
- package/lib/authentication/oauth.d.ts.map +1 -0
- package/lib/authentication/oauth.js +197 -0
- package/lib/authentication/oauth.js.map +1 -0
- package/lib/authentication/openidconnect.d.ts +2 -0
- package/lib/authentication/openidconnect.d.ts.map +1 -0
- package/lib/authentication/openidconnect.js +148 -0
- package/lib/authentication/openidconnect.js.map +1 -0
- package/lib/authentication/saml.d.ts +2 -0
- package/lib/authentication/saml.d.ts.map +1 -0
- package/lib/authentication/saml.js +287 -0
- package/lib/authentication/saml.js.map +1 -0
- package/lib/authentication/verification.d.ts +33 -0
- package/lib/authentication/verification.d.ts.map +1 -0
- package/lib/authentication/verification.js +144 -0
- package/lib/authentication/verification.js.map +1 -0
- package/lib/config.d.ts +15 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +20 -0
- package/lib/config.js.map +1 -0
- package/lib/dist-package.json +203 -0
- package/lib/docs/auth/local.yaml +90 -0
- package/lib/docs/geojson.yaml +375 -0
- package/lib/docs/openapi.yaml +4591 -0
- package/lib/entities/authentication/entities.authentication.d.ts +14 -0
- package/lib/entities/authentication/entities.authentication.d.ts.map +1 -0
- package/lib/entities/authentication/entities.authentication.js +3 -0
- package/lib/entities/authentication/entities.authentication.js.map +1 -0
- package/lib/entities/authorization/entities.authorization.d.ts +7 -0
- package/lib/entities/authorization/entities.authorization.d.ts.map +1 -0
- package/lib/entities/authorization/entities.authorization.js +3 -0
- package/lib/entities/authorization/entities.authorization.js.map +1 -0
- package/lib/entities/authorization/entities.permissions.d.ts +143 -0
- package/lib/entities/authorization/entities.permissions.d.ts.map +1 -0
- package/lib/entities/authorization/entities.permissions.js +101 -0
- package/lib/entities/authorization/entities.permissions.js.map +1 -0
- package/lib/entities/entities.domain_events.d.ts +1 -0
- package/lib/entities/entities.domain_events.d.ts.map +1 -0
- package/lib/entities/entities.domain_events.js +20 -0
- package/lib/entities/entities.domain_events.js.map +1 -0
- package/lib/entities/entities.global.d.ts +107 -0
- package/lib/entities/entities.global.d.ts.map +1 -0
- package/lib/entities/entities.global.js +67 -0
- package/lib/entities/entities.global.js.map +1 -0
- package/lib/entities/entities.i18n.d.ts +78 -0
- package/lib/entities/entities.i18n.d.ts.map +1 -0
- package/lib/entities/entities.i18n.js +69 -0
- package/lib/entities/entities.i18n.js.map +1 -0
- package/lib/entities/entities.json_types.d.ts +42 -0
- package/lib/entities/entities.json_types.d.ts.map +1 -0
- package/lib/entities/entities.json_types.js +3 -0
- package/lib/entities/entities.json_types.js.map +1 -0
- package/lib/entities/events/entities.events.d.ts +118 -0
- package/lib/entities/events/entities.events.d.ts.map +1 -0
- package/lib/entities/events/entities.events.forms.d.ts +132 -0
- package/lib/entities/events/entities.events.forms.d.ts.map +1 -0
- package/lib/entities/events/entities.events.forms.js +102 -0
- package/lib/entities/events/entities.events.forms.js.map +1 -0
- package/lib/entities/events/entities.events.js +146 -0
- package/lib/entities/events/entities.events.js.map +1 -0
- package/lib/entities/feeds/entities.feeds.d.ts +340 -0
- package/lib/entities/feeds/entities.feeds.d.ts.map +1 -0
- package/lib/entities/feeds/entities.feeds.js +213 -0
- package/lib/entities/feeds/entities.feeds.js.map +1 -0
- package/lib/entities/icons/entities.icons.d.ts +106 -0
- package/lib/entities/icons/entities.icons.d.ts.map +1 -0
- package/lib/entities/icons/entities.icons.js +26 -0
- package/lib/entities/icons/entities.icons.js.map +1 -0
- package/lib/entities/observations/entities.observations.d.ts +569 -0
- package/lib/entities/observations/entities.observations.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.attachment.d.ts +5 -0
- package/lib/entities/observations/entities.observations.fields.attachment.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.attachment.js +24 -0
- package/lib/entities/observations/entities.observations.fields.attachment.js.map +1 -0
- package/lib/entities/observations/entities.observations.fields.checkbox.d.ts +3 -0
- package/lib/entities/observations/entities.observations.fields.checkbox.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.checkbox.js +17 -0
- package/lib/entities/observations/entities.observations.fields.checkbox.js.map +1 -0
- package/lib/entities/observations/entities.observations.fields.d.ts +20 -0
- package/lib/entities/observations/entities.observations.fields.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.date.d.ts +3 -0
- package/lib/entities/observations/entities.observations.fields.date.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.date.js +21 -0
- package/lib/entities/observations/entities.observations.fields.date.js.map +1 -0
- package/lib/entities/observations/entities.observations.fields.email.d.ts +3 -0
- package/lib/entities/observations/entities.observations.fields.email.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.email.js +20 -0
- package/lib/entities/observations/entities.observations.fields.email.js.map +1 -0
- package/lib/entities/observations/entities.observations.fields.geometry.d.ts +3 -0
- package/lib/entities/observations/entities.observations.fields.geometry.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.geometry.js +62 -0
- package/lib/entities/observations/entities.observations.fields.geometry.js.map +1 -0
- package/lib/entities/observations/entities.observations.fields.js +37 -0
- package/lib/entities/observations/entities.observations.fields.js.map +1 -0
- package/lib/entities/observations/entities.observations.fields.multiselect.d.ts +3 -0
- package/lib/entities/observations/entities.observations.fields.multiselect.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.multiselect.js +24 -0
- package/lib/entities/observations/entities.observations.fields.multiselect.js.map +1 -0
- package/lib/entities/observations/entities.observations.fields.numeric.d.ts +3 -0
- package/lib/entities/observations/entities.observations.fields.numeric.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.numeric.js +24 -0
- package/lib/entities/observations/entities.observations.fields.numeric.js.map +1 -0
- package/lib/entities/observations/entities.observations.fields.required.d.ts +3 -0
- package/lib/entities/observations/entities.observations.fields.required.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.required.js +14 -0
- package/lib/entities/observations/entities.observations.fields.required.js.map +1 -0
- package/lib/entities/observations/entities.observations.fields.select.d.ts +3 -0
- package/lib/entities/observations/entities.observations.fields.select.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.select.js +17 -0
- package/lib/entities/observations/entities.observations.fields.select.js.map +1 -0
- package/lib/entities/observations/entities.observations.fields.text.d.ts +3 -0
- package/lib/entities/observations/entities.observations.fields.text.d.ts.map +1 -0
- package/lib/entities/observations/entities.observations.fields.text.js +15 -0
- package/lib/entities/observations/entities.observations.fields.text.js.map +1 -0
- package/lib/entities/observations/entities.observations.js +873 -0
- package/lib/entities/observations/entities.observations.js.map +1 -0
- package/lib/entities/ogcapi-features/entities.ogcapi-features.d.ts +98 -0
- package/lib/entities/ogcapi-features/entities.ogcapi-features.d.ts.map +1 -0
- package/lib/entities/ogcapi-features/entities.ogcapi-features.js +30 -0
- package/lib/entities/ogcapi-features/entities.ogcapi-features.js.map +1 -0
- package/lib/entities/teams/entities.teams.d.ts +26 -0
- package/lib/entities/teams/entities.teams.d.ts.map +1 -0
- package/lib/entities/teams/entities.teams.js +3 -0
- package/lib/entities/teams/entities.teams.js.map +1 -0
- package/lib/entities/users/entities.users.d.ts +66 -0
- package/lib/entities/users/entities.users.d.ts.map +1 -0
- package/lib/entities/users/entities.users.js +10 -0
- package/lib/entities/users/entities.users.js.map +1 -0
- package/lib/environment/env.d.ts +29 -0
- package/lib/environment/env.d.ts.map +1 -0
- package/lib/environment/env.js +106 -0
- package/lib/environment/env.js.map +1 -0
- package/lib/export/csv.d.ts +11 -0
- package/lib/export/csv.d.ts.map +1 -0
- package/lib/export/csv.js +243 -0
- package/lib/export/csv.js.map +1 -0
- package/lib/export/exporter.d.ts +12 -0
- package/lib/export/exporter.d.ts.map +1 -0
- package/lib/export/exporter.js +38 -0
- package/lib/export/exporter.js.map +1 -0
- package/lib/export/exporterFactory.d.ts +11 -0
- package/lib/export/exporterFactory.d.ts.map +1 -0
- package/lib/export/exporterFactory.js +17 -0
- package/lib/export/exporterFactory.js.map +1 -0
- package/lib/export/geojson.d.ts +10 -0
- package/lib/export/geojson.d.ts.map +1 -0
- package/lib/export/geojson.js +167 -0
- package/lib/export/geojson.js.map +1 -0
- package/lib/export/geopackage.d.ts +25 -0
- package/lib/export/geopackage.d.ts.map +1 -0
- package/lib/export/geopackage.js +687 -0
- package/lib/export/geopackage.js.map +1 -0
- package/lib/export/kml.d.ts +10 -0
- package/lib/export/kml.d.ts.map +1 -0
- package/lib/export/kml.js +128 -0
- package/lib/export/kml.js.map +1 -0
- package/lib/export/kmlWriter.d.ts +24 -0
- package/lib/export/kmlWriter.d.ts.map +1 -0
- package/lib/export/kmlWriter.js +431 -0
- package/lib/export/kmlWriter.js.map +1 -0
- package/lib/express.d.ts +9 -0
- package/lib/express.d.ts.map +1 -0
- package/lib/express.js +70 -0
- package/lib/express.js.map +1 -0
- package/lib/format/geoJsonFormat.d.ts +3 -0
- package/lib/format/geoJsonFormat.d.ts.map +1 -0
- package/lib/format/geoJsonFormat.js +65 -0
- package/lib/format/geoJsonFormat.js.map +1 -0
- package/lib/logger.d.ts +2 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +21 -0
- package/lib/logger.js.map +1 -0
- package/lib/main.impl/main.impl.plugins.d.ts +12 -0
- package/lib/main.impl/main.impl.plugins.d.ts.map +1 -0
- package/lib/main.impl/main.impl.plugins.js +41 -0
- package/lib/main.impl/main.impl.plugins.js.map +1 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.events.d.ts +3 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.events.d.ts.map +1 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.events.js +32 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.events.js.map +1 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.feeds.d.ts +4 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.feeds.d.ts.map +1 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.feeds.js +26 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.feeds.js.map +1 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.icons.d.ts +4 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.icons.d.ts.map +1 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.icons.js +41 -0
- package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.icons.js.map +1 -0
- package/lib/migrate.d.ts +4 -0
- package/lib/migrate.d.ts.map +1 -0
- package/lib/migrate.js +96 -0
- package/lib/migrate.js.map +1 -0
- package/lib/migrations/002-create-user-role.d.ts +4 -0
- package/lib/migrations/002-create-user-role.d.ts.map +1 -0
- package/lib/migrations/002-create-user-role.js +30 -0
- package/lib/migrations/002-create-user-role.js.map +1 -0
- package/lib/migrations/003-create-admin-role.d.ts +4 -0
- package/lib/migrations/003-create-admin-role.d.ts.map +1 -0
- package/lib/migrations/003-create-admin-role.js +31 -0
- package/lib/migrations/003-create-admin-role.js.map +1 -0
- package/lib/migrations/005-create-osm-layer.d.ts +4 -0
- package/lib/migrations/005-create-osm-layer.d.ts.map +1 -0
- package/lib/migrations/005-create-osm-layer.js +51 -0
- package/lib/migrations/005-create-osm-layer.js.map +1 -0
- package/lib/migrations/006-event-teams.d.ts +4 -0
- package/lib/migrations/006-event-teams.d.ts.map +1 -0
- package/lib/migrations/006-event-teams.js +40 -0
- package/lib/migrations/006-event-teams.js.map +1 -0
- package/lib/migrations/007-user-icon.d.ts +4 -0
- package/lib/migrations/007-user-icon.d.ts.map +1 -0
- package/lib/migrations/007-user-icon.js +21 -0
- package/lib/migrations/007-user-icon.js.map +1 -0
- package/lib/migrations/008-create-user-no-edit-role.d.ts +4 -0
- package/lib/migrations/008-create-user-no-edit-role.d.ts.map +1 -0
- package/lib/migrations/008-create-user-no-edit-role.js +34 -0
- package/lib/migrations/008-create-user-no-edit-role.js.map +1 -0
- package/lib/migrations/009-create-manager-role.d.ts +4 -0
- package/lib/migrations/009-create-manager-role.d.ts.map +1 -0
- package/lib/migrations/009-create-manager-role.js +50 -0
- package/lib/migrations/009-create-manager-role.js.map +1 -0
- package/lib/migrations/010-add-user-device-manager-role.d.ts +4 -0
- package/lib/migrations/010-add-user-device-manager-role.d.ts.map +1 -0
- package/lib/migrations/010-add-user-device-manager-role.js +38 -0
- package/lib/migrations/010-add-user-device-manager-role.js.map +1 -0
- package/lib/migrations/011-multiple-forms.d.ts +4 -0
- package/lib/migrations/011-multiple-forms.d.ts.map +1 -0
- package/lib/migrations/011-multiple-forms.js +161 -0
- package/lib/migrations/011-multiple-forms.js.map +1 -0
- package/lib/migrations/012-user-role-remove-delete.d.ts +4 -0
- package/lib/migrations/012-user-role-remove-delete.d.ts.map +1 -0
- package/lib/migrations/012-user-role-remove-delete.js +15 -0
- package/lib/migrations/012-user-role-remove-delete.js.map +1 -0
- package/lib/migrations/013-ensure-event-indexes.d.ts +4 -0
- package/lib/migrations/013-ensure-event-indexes.d.ts.map +1 -0
- package/lib/migrations/013-ensure-event-indexes.js +50 -0
- package/lib/migrations/013-ensure-event-indexes.js.map +1 -0
- package/lib/migrations/014-add-role-update-permission.d.ts +4 -0
- package/lib/migrations/014-add-role-update-permission.d.ts.map +1 -0
- package/lib/migrations/014-add-role-update-permission.js +15 -0
- package/lib/migrations/014-add-role-update-permission.js.map +1 -0
- package/lib/migrations/015-manager-role-add-user-create.d.ts +4 -0
- package/lib/migrations/015-manager-role-add-user-create.d.ts.map +1 -0
- package/lib/migrations/015-manager-role-add-user-create.js +15 -0
- package/lib/migrations/015-manager-role-add-user-create.js.map +1 -0
- package/lib/migrations/016-set-feed-primary-secondary.d.ts +4 -0
- package/lib/migrations/016-set-feed-primary-secondary.d.ts.map +1 -0
- package/lib/migrations/016-set-feed-primary-secondary.js +36 -0
- package/lib/migrations/016-set-feed-primary-secondary.js.map +1 -0
- package/lib/migrations/017-make-layers-available.d.ts +4 -0
- package/lib/migrations/017-make-layers-available.d.ts.map +1 -0
- package/lib/migrations/017-make-layers-available.js +48 -0
- package/lib/migrations/017-make-layers-available.js.map +1 -0
- package/lib/migrations/018-feeds-admin-permissions.d.ts +4 -0
- package/lib/migrations/018-feeds-admin-permissions.d.ts.map +1 -0
- package/lib/migrations/018-feeds-admin-permissions.js +32 -0
- package/lib/migrations/018-feeds-admin-permissions.js.map +1 -0
- package/lib/migrations/018-set-default-password-policy.d.ts +4 -0
- package/lib/migrations/018-set-default-password-policy.d.ts.map +1 -0
- package/lib/migrations/018-set-default-password-policy.js +58 -0
- package/lib/migrations/018-set-default-password-policy.js.map +1 -0
- package/lib/migrations/019-move-user-authentication.d.ts +4 -0
- package/lib/migrations/019-move-user-authentication.d.ts.map +1 -0
- package/lib/migrations/019-move-user-authentication.js +68 -0
- package/lib/migrations/019-move-user-authentication.js.map +1 -0
- package/lib/migrations/020-add-export-permissions.d.ts +4 -0
- package/lib/migrations/020-add-export-permissions.d.ts.map +1 -0
- package/lib/migrations/020-add-export-permissions.js +36 -0
- package/lib/migrations/020-add-export-permissions.js.map +1 -0
- package/lib/migrations/022-copy-auth-from-config-to-db.d.ts +4 -0
- package/lib/migrations/022-copy-auth-from-config-to-db.d.ts.map +1 -0
- package/lib/migrations/022-copy-auth-from-config-to-db.js +86 -0
- package/lib/migrations/022-copy-auth-from-config-to-db.js.map +1 -0
- package/lib/migrations/023-move-local-auth-from-settings.d.ts +4 -0
- package/lib/migrations/023-move-local-auth-from-settings.d.ts.map +1 -0
- package/lib/migrations/023-move-local-auth-from-settings.js +54 -0
- package/lib/migrations/023-move-local-auth-from-settings.js.map +1 -0
- package/lib/migrations/024-link-auth-to-auth-config.d.ts +4 -0
- package/lib/migrations/024-link-auth-to-auth-config.d.ts.map +1 -0
- package/lib/migrations/024-link-auth-to-auth-config.js +59 -0
- package/lib/migrations/024-link-auth-to-auth-config.js.map +1 -0
- package/lib/migrations/025-add-auth-config-permissions.d.ts +4 -0
- package/lib/migrations/025-add-auth-config-permissions.d.ts.map +1 -0
- package/lib/migrations/025-add-auth-config-permissions.js +32 -0
- package/lib/migrations/025-add-auth-config-permissions.js.map +1 -0
- package/lib/migrations/028-move-security-settings-to-secret-store.d.ts +4 -0
- package/lib/migrations/028-move-security-settings-to-secret-store.d.ts.map +1 -0
- package/lib/migrations/028-move-security-settings-to-secret-store.js +59 -0
- package/lib/migrations/028-move-security-settings-to-secret-store.js.map +1 -0
- package/lib/migrations/029-attachment-form-field.d.ts +4 -0
- package/lib/migrations/029-attachment-form-field.d.ts.map +1 -0
- package/lib/migrations/029-attachment-form-field.js +130 -0
- package/lib/migrations/029-attachment-form-field.js.map +1 -0
- package/lib/models/authentication.d.ts +17 -0
- package/lib/models/authentication.d.ts.map +1 -0
- package/lib/models/authentication.js +174 -0
- package/lib/models/authentication.js.map +1 -0
- package/lib/models/authenticationconfiguration.d.ts +15 -0
- package/lib/models/authenticationconfiguration.d.ts.map +1 -0
- package/lib/models/authenticationconfiguration.js +105 -0
- package/lib/models/authenticationconfiguration.js.map +1 -0
- package/lib/models/cappedLocation.d.ts +8 -0
- package/lib/models/cappedLocation.d.ts.map +1 -0
- package/lib/models/cappedLocation.js +78 -0
- package/lib/models/cappedLocation.js.map +1 -0
- package/lib/models/counter.d.ts +3 -0
- package/lib/models/counter.d.ts.map +1 -0
- package/lib/models/counter.js +37 -0
- package/lib/models/counter.js.map +1 -0
- package/lib/models/device.d.ts +14 -0
- package/lib/models/device.d.ts.map +1 -0
- package/lib/models/device.js +220 -0
- package/lib/models/device.js.map +1 -0
- package/lib/models/event.d.ts +75 -0
- package/lib/models/event.d.ts.map +1 -0
- package/lib/models/event.js +839 -0
- package/lib/models/event.js.map +1 -0
- package/lib/models/export.d.ts +18 -0
- package/lib/models/export.d.ts.map +1 -0
- package/lib/models/export.js +107 -0
- package/lib/models/export.js.map +1 -0
- package/lib/models/feature.d.ts +4 -0
- package/lib/models/feature.d.ts.map +1 -0
- package/lib/models/feature.js +43 -0
- package/lib/models/feature.js.map +1 -0
- package/lib/models/icon.d.ts +9 -0
- package/lib/models/icon.d.ts.map +1 -0
- package/lib/models/icon.js +69 -0
- package/lib/models/icon.js.map +1 -0
- package/lib/models/index.d.ts +2 -0
- package/lib/models/index.d.ts.map +1 -0
- package/lib/models/index.js +12 -0
- package/lib/models/index.js.map +1 -0
- package/lib/models/layer.d.ts +13 -0
- package/lib/models/layer.d.ts.map +1 -0
- package/lib/models/layer.js +149 -0
- package/lib/models/layer.js.map +1 -0
- package/lib/models/location.d.ts +8 -0
- package/lib/models/location.d.ts.map +1 -0
- package/lib/models/location.js +96 -0
- package/lib/models/location.js.map +1 -0
- package/lib/models/login.d.ts +4 -0
- package/lib/models/login.d.ts.map +1 -0
- package/lib/models/login.js +90 -0
- package/lib/models/login.js.map +1 -0
- package/lib/models/observation.d.ts +93 -0
- package/lib/models/observation.d.ts.map +1 -0
- package/lib/models/observation.js +461 -0
- package/lib/models/observation.js.map +1 -0
- package/lib/models/role.d.ts +22 -0
- package/lib/models/role.d.ts.map +1 -0
- package/lib/models/role.js +80 -0
- package/lib/models/role.js.map +1 -0
- package/lib/models/setting.d.ts +6 -0
- package/lib/models/setting.d.ts.map +1 -0
- package/lib/models/setting.js +31 -0
- package/lib/models/setting.js.map +1 -0
- package/lib/models/team.d.ts +31 -0
- package/lib/models/team.d.ts.map +1 -0
- package/lib/models/team.js +511 -0
- package/lib/models/team.js.map +1 -0
- package/lib/models/token.d.ts +6 -0
- package/lib/models/token.d.ts.map +1 -0
- package/lib/models/token.js +68 -0
- package/lib/models/token.js.map +1 -0
- package/lib/models/user.d.ts +60 -0
- package/lib/models/user.d.ts.map +1 -0
- package/lib/models/user.js +400 -0
- package/lib/models/user.js.map +1 -0
- package/lib/permissions/permissions.events.d.ts +69 -0
- package/lib/permissions/permissions.events.d.ts.map +1 -0
- package/lib/permissions/permissions.events.js +154 -0
- package/lib/permissions/permissions.events.js.map +1 -0
- package/lib/permissions/permissions.feeds.d.ts +19 -0
- package/lib/permissions/permissions.feeds.d.ts.map +1 -0
- package/lib/permissions/permissions.feeds.js +58 -0
- package/lib/permissions/permissions.feeds.js.map +1 -0
- package/lib/permissions/permissions.icons.d.ts +9 -0
- package/lib/permissions/permissions.icons.d.ts.map +1 -0
- package/lib/permissions/permissions.icons.js +28 -0
- package/lib/permissions/permissions.icons.js.map +1 -0
- package/lib/permissions/permissions.observations.d.ts +14 -0
- package/lib/permissions/permissions.observations.d.ts.map +1 -0
- package/lib/permissions/permissions.observations.js +113 -0
- package/lib/permissions/permissions.observations.js.map +1 -0
- package/lib/permissions/permissions.role-based.base.d.ts +15 -0
- package/lib/permissions/permissions.role-based.base.d.ts.map +1 -0
- package/lib/permissions/permissions.role-based.base.js +14 -0
- package/lib/permissions/permissions.role-based.base.js.map +1 -0
- package/lib/permissions/permissions.users.d.ts +8 -0
- package/lib/permissions/permissions.users.d.ts.map +1 -0
- package/lib/permissions/permissions.users.js +23 -0
- package/lib/permissions/permissions.users.js.map +1 -0
- package/lib/plugins.api/index.d.ts +55 -0
- package/lib/plugins.api/index.d.ts.map +1 -0
- package/lib/plugins.api/index.js +5 -0
- package/lib/plugins.api/index.js.map +1 -0
- package/lib/plugins.api/plugins.api.db.d.ts +7 -0
- package/lib/plugins.api/plugins.api.db.d.ts.map +1 -0
- package/lib/plugins.api/plugins.api.db.js +5 -0
- package/lib/plugins.api/plugins.api.db.js.map +1 -0
- package/lib/plugins.api/plugins.api.events.d.ts +24 -0
- package/lib/plugins.api/plugins.api.events.d.ts.map +1 -0
- package/lib/plugins.api/plugins.api.events.js +5 -0
- package/lib/plugins.api/plugins.api.events.js.map +1 -0
- package/lib/plugins.api/plugins.api.feeds.d.ts +35 -0
- package/lib/plugins.api/plugins.api.feeds.d.ts.map +1 -0
- package/lib/plugins.api/plugins.api.feeds.js +12 -0
- package/lib/plugins.api/plugins.api.feeds.js.map +1 -0
- package/lib/plugins.api/plugins.api.icons.d.ts +21 -0
- package/lib/plugins.api/plugins.api.icons.d.ts.map +1 -0
- package/lib/plugins.api/plugins.api.icons.js +5 -0
- package/lib/plugins.api/plugins.api.icons.js.map +1 -0
- package/lib/plugins.api/plugins.api.observations.d.ts +10 -0
- package/lib/plugins.api/plugins.api.observations.d.ts.map +1 -0
- package/lib/plugins.api/plugins.api.observations.js +11 -0
- package/lib/plugins.api/plugins.api.observations.js.map +1 -0
- package/lib/plugins.api/plugins.api.users.d.ts +4 -0
- package/lib/plugins.api/plugins.api.users.d.ts.map +1 -0
- package/lib/plugins.api/plugins.api.users.js +5 -0
- package/lib/plugins.api/plugins.api.users.js.map +1 -0
- package/lib/plugins.api/plugins.api.web.d.ts +10 -0
- package/lib/plugins.api/plugins.api.web.d.ts.map +1 -0
- package/lib/plugins.api/plugins.api.web.js +3 -0
- package/lib/plugins.api/plugins.api.web.js.map +1 -0
- package/lib/provision/index.d.ts +23 -0
- package/lib/provision/index.d.ts.map +1 -0
- package/lib/provision/index.js +60 -0
- package/lib/provision/index.js.map +1 -0
- package/lib/provision/none.d.ts +3 -0
- package/lib/provision/none.d.ts.map +1 -0
- package/lib/provision/none.js +41 -0
- package/lib/provision/none.js.map +1 -0
- package/lib/provision/strategies/none.d.ts +9 -0
- package/lib/provision/strategies/none.d.ts.map +1 -0
- package/lib/provision/strategies/none.js +25 -0
- package/lib/provision/strategies/none.js.map +1 -0
- package/lib/provision/strategies/uid.d.ts +9 -0
- package/lib/provision/strategies/uid.d.ts.map +1 -0
- package/lib/provision/strategies/uid.js +28 -0
- package/lib/provision/strategies/uid.js.map +1 -0
- package/lib/provision/uid.d.ts +3 -0
- package/lib/provision/uid.d.ts.map +1 -0
- package/lib/provision/uid.js +43 -0
- package/lib/provision/uid.js.map +1 -0
- package/lib/routes/authenticationconfigurations.d.ts +3 -0
- package/lib/routes/authenticationconfigurations.d.ts.map +1 -0
- package/lib/routes/authenticationconfigurations.js +209 -0
- package/lib/routes/authenticationconfigurations.js.map +1 -0
- package/lib/routes/devices.d.ts +3 -0
- package/lib/routes/devices.d.ts.map +1 -0
- package/lib/routes/devices.js +201 -0
- package/lib/routes/devices.js.map +1 -0
- package/lib/routes/events.d.ts +47 -0
- package/lib/routes/events.d.ts.map +1 -0
- package/lib/routes/events.js +495 -0
- package/lib/routes/events.js.map +1 -0
- package/lib/routes/exports.d.ts +3 -0
- package/lib/routes/exports.d.ts.map +1 -0
- package/lib/routes/exports.js +204 -0
- package/lib/routes/exports.js.map +1 -0
- package/lib/routes/imports.d.ts +3 -0
- package/lib/routes/imports.d.ts.map +1 -0
- package/lib/routes/imports.js +41 -0
- package/lib/routes/imports.js.map +1 -0
- package/lib/routes/index.d.ts +3 -0
- package/lib/routes/index.d.ts.map +1 -0
- package/lib/routes/index.js +151 -0
- package/lib/routes/index.js.map +1 -0
- package/lib/routes/layers.d.ts +3 -0
- package/lib/routes/layers.d.ts.map +1 -0
- package/lib/routes/layers.js +433 -0
- package/lib/routes/layers.js.map +1 -0
- package/lib/routes/locations.d.ts +3 -0
- package/lib/routes/locations.d.ts.map +1 -0
- package/lib/routes/locations.js +124 -0
- package/lib/routes/locations.js.map +1 -0
- package/lib/routes/logins.d.ts +3 -0
- package/lib/routes/logins.d.ts.map +1 -0
- package/lib/routes/logins.js +64 -0
- package/lib/routes/logins.js.map +1 -0
- package/lib/routes/observations.d.ts +3 -0
- package/lib/routes/observations.d.ts.map +1 -0
- package/lib/routes/observations.js +363 -0
- package/lib/routes/observations.js.map +1 -0
- package/lib/routes/plugins.d.ts +3 -0
- package/lib/routes/plugins.d.ts.map +1 -0
- package/lib/routes/plugins.js +29 -0
- package/lib/routes/plugins.js.map +1 -0
- package/lib/routes/roles.d.ts +3 -0
- package/lib/routes/roles.d.ts.map +1 -0
- package/lib/routes/roles.js +64 -0
- package/lib/routes/roles.js.map +1 -0
- package/lib/routes/settings.d.ts +3 -0
- package/lib/routes/settings.d.ts.map +1 -0
- package/lib/routes/settings.js +21 -0
- package/lib/routes/settings.js.map +1 -0
- package/lib/routes/setup.d.ts +3 -0
- package/lib/routes/setup.d.ts.map +1 -0
- package/lib/routes/setup.js +90 -0
- package/lib/routes/setup.js.map +1 -0
- package/lib/routes/teams.d.ts +3 -0
- package/lib/routes/teams.d.ts.map +1 -0
- package/lib/routes/teams.js +213 -0
- package/lib/routes/teams.js.map +1 -0
- package/lib/routes/users.d.ts +3 -0
- package/lib/routes/users.d.ts.map +1 -0
- package/lib/routes/users.js +478 -0
- package/lib/routes/users.js.map +1 -0
- package/lib/schedule/export/export-task.d.ts +14 -0
- package/lib/schedule/export/export-task.d.ts.map +1 -0
- package/lib/schedule/export/export-task.js +70 -0
- package/lib/schedule/export/export-task.js.map +1 -0
- package/lib/schedule/index.d.ts +2 -0
- package/lib/schedule/index.d.ts.map +1 -0
- package/lib/schedule/index.js +27 -0
- package/lib/schedule/index.js.map +1 -0
- package/lib/security/key-mgt/key-mgt-factory.d.ts +7 -0
- package/lib/security/key-mgt/key-mgt-factory.d.ts.map +1 -0
- package/lib/security/key-mgt/key-mgt-factory.js +10 -0
- package/lib/security/key-mgt/key-mgt-factory.js.map +1 -0
- package/lib/security/key-mgt/plaintext-key-manager.d.ts +42 -0
- package/lib/security/key-mgt/plaintext-key-manager.d.ts.map +1 -0
- package/lib/security/key-mgt/plaintext-key-manager.js +52 -0
- package/lib/security/key-mgt/plaintext-key-manager.js.map +1 -0
- package/lib/security/responses/data-response.d.ts +13 -0
- package/lib/security/responses/data-response.d.ts.map +1 -0
- package/lib/security/responses/data-response.js +25 -0
- package/lib/security/responses/data-response.js.map +1 -0
- package/lib/security/secret-store-service.d.ts +39 -0
- package/lib/security/secret-store-service.d.ts.map +1 -0
- package/lib/security/secret-store-service.js +94 -0
- package/lib/security/secret-store-service.js.map +1 -0
- package/lib/security/storage/file-system-secret-store.d.ts +17 -0
- package/lib/security/storage/file-system-secret-store.d.ts.map +1 -0
- package/lib/security/storage/file-system-secret-store.js +46 -0
- package/lib/security/storage/file-system-secret-store.js.map +1 -0
- package/lib/security/storage/json-provider.d.ts +6 -0
- package/lib/security/storage/json-provider.d.ts.map +1 -0
- package/lib/security/storage/json-provider.js +17 -0
- package/lib/security/storage/json-provider.js.map +1 -0
- package/lib/security/utilities/secure-property-appender.d.ts +8 -0
- package/lib/security/utilities/secure-property-appender.d.ts.map +1 -0
- package/lib/security/utilities/secure-property-appender.js +39 -0
- package/lib/security/utilities/secure-property-appender.js.map +1 -0
- package/lib/transformers/authenticationconfiguration.d.ts +2 -0
- package/lib/transformers/authenticationconfiguration.d.ts.map +1 -0
- package/lib/transformers/authenticationconfiguration.js +22 -0
- package/lib/transformers/authenticationconfiguration.js.map +1 -0
- package/lib/transformers/export.d.ts +2 -0
- package/lib/transformers/export.d.ts.map +1 -0
- package/lib/transformers/export.js +13 -0
- package/lib/transformers/export.js.map +1 -0
- package/lib/transformers/geojson.d.ts +2 -0
- package/lib/transformers/geojson.d.ts.map +1 -0
- package/lib/transformers/geojson.js +24 -0
- package/lib/transformers/geojson.js.map +1 -0
- package/lib/transformers/layer.d.ts +2 -0
- package/lib/transformers/layer.d.ts.map +1 -0
- package/lib/transformers/layer.js +13 -0
- package/lib/transformers/layer.js.map +1 -0
- package/lib/transformers/observation.d.ts +2 -0
- package/lib/transformers/observation.d.ts.map +1 -0
- package/lib/transformers/observation.js +13 -0
- package/lib/transformers/observation.js.map +1 -0
- package/lib/transformers/pageinfo.d.ts +2 -0
- package/lib/transformers/pageinfo.d.ts.map +1 -0
- package/lib/transformers/pageinfo.js +27 -0
- package/lib/transformers/pageinfo.js.map +1 -0
- package/lib/transformers/user.d.ts +2 -0
- package/lib/transformers/user.d.ts.map +1 -0
- package/lib/transformers/user.js +21 -0
- package/lib/transformers/user.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/upload.d.ts +8 -0
- package/lib/upload.d.ts.map +1 -0
- package/lib/upload.js +30 -0
- package/lib/upload.js.map +1 -0
- package/lib/utilities/authenticationApiAppender.d.ts +10 -0
- package/lib/utilities/authenticationApiAppender.d.ts.map +1 -0
- package/lib/utilities/authenticationApiAppender.js +48 -0
- package/lib/utilities/authenticationApiAppender.js.map +1 -0
- package/lib/utilities/filterParser.d.ts +2 -0
- package/lib/utilities/filterParser.d.ts.map +1 -0
- package/lib/utilities/filterParser.js +87 -0
- package/lib/utilities/filterParser.js.map +1 -0
- package/lib/utilities/geopackage.d.ts +56 -0
- package/lib/utilities/geopackage.d.ts.map +1 -0
- package/lib/utilities/geopackage.js +335 -0
- package/lib/utilities/geopackage.js.map +1 -0
- package/lib/utilities/loader.d.ts +9 -0
- package/lib/utilities/loader.d.ts.map +1 -0
- package/lib/utilities/loader.js +25 -0
- package/lib/utilities/loader.js.map +1 -0
- package/lib/utilities/paging.d.ts +15 -0
- package/lib/utilities/paging.d.ts.map +1 -0
- package/lib/utilities/paging.js +56 -0
- package/lib/utilities/paging.js.map +1 -0
- package/lib/utilities/passwordValidator.d.ts +8 -0
- package/lib/utilities/passwordValidator.d.ts.map +1 -0
- package/lib/utilities/passwordValidator.js +175 -0
- package/lib/utilities/passwordValidator.js.map +1 -0
- package/lib/utilities/pbkdf2.d.ts +6 -0
- package/lib/utilities/pbkdf2.d.ts.map +1 -0
- package/lib/utilities/pbkdf2.js +79 -0
- package/lib/utilities/pbkdf2.js.map +1 -0
- package/lib/utilities/togeojson.d.ts +2 -0
- package/lib/utilities/togeojson.d.ts.map +1 -0
- package/lib/utilities/togeojson.js +308 -0
- package/lib/utilities/togeojson.js.map +1 -0
- package/lib/utilities/waitForMongooseConnection.d.ts +3 -0
- package/lib/utilities/waitForMongooseConnection.d.ts.map +1 -0
- package/lib/utilities/waitForMongooseConnection.js +34 -0
- package/lib/utilities/waitForMongooseConnection.js.map +1 -0
- package/lib/utilities/whitelist.d.ts +2 -0
- package/lib/utilities/whitelist.d.ts.map +1 -0
- package/lib/utilities/whitelist.js +18 -0
- package/lib/utilities/whitelist.js.map +1 -0
- package/lib/views/authentication.pug +10 -0
- package/lib/views/oauth.pug +12 -0
- package/lib/views/observation.pug +137 -0
- package/package.json +203 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/api/location.js"],"names":[],"mappings":";AAAA,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,EACxB,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC,EAChD,aAAa,GAAG,OAAO,CAAC,oBAAoB,CAAC,EAC7C,mBAAmB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAE9D,SAAS,QAAQ;AACjB,CAAC;AAED,IAAI,YAAY,GAAG,IAAI,cAAc,EAAE,CAAC;AACxC,QAAQ,CAAC,EAAE,G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
|
+
constructor(event: any, user: any, deviceId: any);
|
|
5
|
+
_event: any;
|
|
6
|
+
_user: any;
|
|
7
|
+
_deviceId: any;
|
|
8
|
+
getAll(options: any, callback: any): void;
|
|
9
|
+
getById(observationId: any, options: any, callback: any): void;
|
|
10
|
+
validate(observation: any): Error | undefined;
|
|
11
|
+
createObservationId(callback: any): void;
|
|
12
|
+
validateObservationId(id: any, callback: any): void;
|
|
13
|
+
update(observationId: any, observation: any, callback: any): any;
|
|
14
|
+
addFavorite(observationId: any, user: any, callback: any): void;
|
|
15
|
+
removeFavorite(observation: any, user: any, callback: any): void;
|
|
16
|
+
addImportant(observationId: any, important: any, callback: any): void;
|
|
17
|
+
removeImportant(observation: any, callback: any): void;
|
|
18
|
+
addState(observationId: any, state: any, callback: any): void;
|
|
19
|
+
}
|
|
20
|
+
declare namespace Observation {
|
|
21
|
+
export { EventEmitter as on };
|
|
22
|
+
}
|
|
23
|
+
declare const EventEmitter: ObservationEvents;
|
|
24
|
+
import ObservationEvents = require("./events/observation.js");
|
|
25
|
+
//# sourceMappingURL=observation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observation.d.ts","sourceRoot":"","sources":["../../src/api/observation.js"],"names":[],"mappings":";AASA,yEAIC;;IAJD,kDAIC;IAHC,YAAmB;IACnB,WAAiB;IACjB,eAAyB;IAM3B,0CA0BC;IAED,+DAOC;IAED,8CA0HC;IAED,yCAEC;IAED,oDAWC;IAGD,iEAyCC;IAED,gEAEC;IAED,iEAEC;IAED,sEAEC;IAED,uDAEC;IAED,8DASC;;;;;AA1PD,8CAA6C"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const async = require('async'), log = require('winston'), ObservationEvents = require('./events/observation.js'), FieldFactory = require('./field'), ObservationModel = require('../models/observation'), Attachment = require('./attachment');
|
|
3
|
+
const fieldFactory = new FieldFactory();
|
|
4
|
+
function Observation(event, user, deviceId) {
|
|
5
|
+
this._event = event;
|
|
6
|
+
this._user = user;
|
|
7
|
+
this._deviceId = deviceId;
|
|
8
|
+
}
|
|
9
|
+
const EventEmitter = new ObservationEvents();
|
|
10
|
+
Observation.on = EventEmitter;
|
|
11
|
+
Observation.prototype.getAll = function (options, callback) {
|
|
12
|
+
const event = this._event;
|
|
13
|
+
const filter = options.filter;
|
|
14
|
+
if (filter && filter.geometries) {
|
|
15
|
+
let allObservations = [];
|
|
16
|
+
async.each(filter.geometries, function (geometry, done) {
|
|
17
|
+
options.filter.geometry = geometry;
|
|
18
|
+
ObservationModel.getObservations(event, options, function (err, observations) {
|
|
19
|
+
if (err)
|
|
20
|
+
return done(err);
|
|
21
|
+
if (observations) {
|
|
22
|
+
allObservations = allObservations.concat(observations);
|
|
23
|
+
}
|
|
24
|
+
done();
|
|
25
|
+
});
|
|
26
|
+
}, function (err) {
|
|
27
|
+
callback(err, allObservations);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
ObservationModel.getObservations(event, options, callback);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
Observation.prototype.getById = function (observationId, options, callback) {
|
|
35
|
+
if (typeof options === 'function') {
|
|
36
|
+
callback = options;
|
|
37
|
+
options = {};
|
|
38
|
+
}
|
|
39
|
+
ObservationModel.getObservationById(this._event, observationId, options, callback);
|
|
40
|
+
};
|
|
41
|
+
Observation.prototype.validate = function (observation) {
|
|
42
|
+
const errors = {};
|
|
43
|
+
let message = '';
|
|
44
|
+
if (observation.type !== 'Feature') {
|
|
45
|
+
errors.type = { error: 'required', message: observation.type ? 'type is required' : 'type must equal "Feature"' };
|
|
46
|
+
message += observation.type ? '\u2022 type is required\n' : '\u2022 type must equal "Feature"\n';
|
|
47
|
+
}
|
|
48
|
+
// validate timestamp
|
|
49
|
+
const properties = observation.properties || {};
|
|
50
|
+
const timestampError = fieldFactory.createField({
|
|
51
|
+
type: 'date',
|
|
52
|
+
required: true,
|
|
53
|
+
name: 'timestamp',
|
|
54
|
+
title: 'Date'
|
|
55
|
+
}, properties).validate();
|
|
56
|
+
if (timestampError) {
|
|
57
|
+
errors.timestamp = timestampError;
|
|
58
|
+
message += `\u2022 ${timestampError.message}\n`;
|
|
59
|
+
}
|
|
60
|
+
// validate geometry
|
|
61
|
+
const geometryError = fieldFactory.createField({
|
|
62
|
+
type: 'geometry',
|
|
63
|
+
required: true,
|
|
64
|
+
name: 'geometry',
|
|
65
|
+
title: 'Location'
|
|
66
|
+
}, observation).validate();
|
|
67
|
+
if (geometryError) {
|
|
68
|
+
errors.geometry = geometryError;
|
|
69
|
+
message += `\u2022 ${geometryError.message}\n`;
|
|
70
|
+
}
|
|
71
|
+
const formEntries = properties.forms || [];
|
|
72
|
+
const formCount = formEntries.reduce((count, form) => {
|
|
73
|
+
count[form.formId] = (count[form.formId] || 0) + 1;
|
|
74
|
+
return count;
|
|
75
|
+
}, {});
|
|
76
|
+
const formDefinitions = {};
|
|
77
|
+
// Validate total number of forms
|
|
78
|
+
if (this._event.minObservationForms != null && formEntries.length < this._event.minObservationForms) {
|
|
79
|
+
errors.minObservationForms = new Error("Insufficient number of forms");
|
|
80
|
+
message += `\u2022 Total number of forms in observation must be at least ${this._event.minObservationForms}\n`;
|
|
81
|
+
}
|
|
82
|
+
if (this._event.maxObservationForms != null && formEntries.length > this._event.maxObservationForms) {
|
|
83
|
+
errors.maxObservationForms = new Error("Exceeded maximum number of forms");
|
|
84
|
+
message += `\u2022 Total number of forms in observation cannot be more than ${this._event.maxObservationForms}\n`;
|
|
85
|
+
}
|
|
86
|
+
// Validate forms min/max occurrences
|
|
87
|
+
const formError = {};
|
|
88
|
+
this._event.forms
|
|
89
|
+
.filter(form => !form.archived)
|
|
90
|
+
.forEach(formDefinition => {
|
|
91
|
+
formDefinitions[formDefinition._id] = formDefinition;
|
|
92
|
+
const count = formCount[formDefinition.id] || 0;
|
|
93
|
+
if (formDefinition.min && count < formDefinition.min) {
|
|
94
|
+
formError[formDefinition.id] = {
|
|
95
|
+
error: 'min',
|
|
96
|
+
message: `${formDefinition.name} form must be included in observation at least ${formDefinition.min} times`
|
|
97
|
+
};
|
|
98
|
+
message += `\u2022 ${formDefinition.name} form must be included in observation at least ${formDefinition.min} times\n`;
|
|
99
|
+
}
|
|
100
|
+
else if (formDefinition.max && (count > formDefinition.max)) {
|
|
101
|
+
formError[formDefinition.id] = {
|
|
102
|
+
error: 'max',
|
|
103
|
+
message: `${formDefinition.name} form cannot be included in observation more than ${formDefinition.max} times`
|
|
104
|
+
};
|
|
105
|
+
message += `\u2022 ${formDefinition.name} form cannot be included in observation more than ${formDefinition.max} times\n`;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
// TODO attachment-work, validate attachment restrictions and min/max
|
|
109
|
+
if (Object.keys(formError).length) {
|
|
110
|
+
errors.form = formError;
|
|
111
|
+
}
|
|
112
|
+
// Validate form fields
|
|
113
|
+
const formErrors = [];
|
|
114
|
+
formEntries.forEach(formEntry => {
|
|
115
|
+
let fieldsMessage = '';
|
|
116
|
+
const fieldsError = {};
|
|
117
|
+
formDefinitions[formEntry.formId].fields
|
|
118
|
+
.filter(fieldDefinition => !fieldDefinition.archived)
|
|
119
|
+
.forEach(fieldDefinition => {
|
|
120
|
+
const field = fieldFactory.createField(fieldDefinition, formEntry, observation);
|
|
121
|
+
const fieldError = field.validate();
|
|
122
|
+
if (fieldError) {
|
|
123
|
+
fieldsError[field.name] = fieldError;
|
|
124
|
+
fieldsMessage += ` \u2022 ${fieldError.message}\n`;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
if (Object.keys(fieldsError).length) {
|
|
128
|
+
formErrors.push(fieldsError);
|
|
129
|
+
message += `${formDefinitions[formEntry.formId].name} form is invalid\n`;
|
|
130
|
+
message += fieldsMessage;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
if (formErrors.length) {
|
|
134
|
+
errors.forms = formErrors;
|
|
135
|
+
}
|
|
136
|
+
if (Object.keys(errors).length) {
|
|
137
|
+
const err = new Error('Invalid Observation');
|
|
138
|
+
err.name = 'ValidationError';
|
|
139
|
+
err.status = 400;
|
|
140
|
+
err.message = message;
|
|
141
|
+
err.errors = errors;
|
|
142
|
+
return err;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
Observation.prototype.createObservationId = function (callback) {
|
|
146
|
+
ObservationModel.createObservationId(callback);
|
|
147
|
+
};
|
|
148
|
+
Observation.prototype.validateObservationId = function (id, callback) {
|
|
149
|
+
ObservationModel.getObservationId(id, function (err, id) {
|
|
150
|
+
if (err)
|
|
151
|
+
return callback(err);
|
|
152
|
+
if (!id) {
|
|
153
|
+
err = new Error();
|
|
154
|
+
err.status = 404;
|
|
155
|
+
}
|
|
156
|
+
callback(err, id);
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
// TODO create is gone, do I need to figure out if this is an observation create?
|
|
160
|
+
Observation.prototype.update = function (observationId, observation, callback) {
|
|
161
|
+
if (this._user)
|
|
162
|
+
observation.userId = this._user._id;
|
|
163
|
+
if (this._deviceId)
|
|
164
|
+
observation.deviceId = this._deviceId;
|
|
165
|
+
const err = this.validate(observation);
|
|
166
|
+
if (err)
|
|
167
|
+
return callback(err);
|
|
168
|
+
ObservationModel.updateObservation(this._event, observationId, observation, (err, updatedObservation) => {
|
|
169
|
+
if (updatedObservation) {
|
|
170
|
+
EventEmitter.emit(ObservationEvents.events.update, updatedObservation.toObject({ event: this._event }), this._event, this._user);
|
|
171
|
+
// Remove any deleted attachments from file system
|
|
172
|
+
/*
|
|
173
|
+
TODO: this might not even work. observation form entries are not stored
|
|
174
|
+
with field entry keys for attachment fields, so finding attachments based
|
|
175
|
+
on matching form entry keys with form field names will not produce any
|
|
176
|
+
results.
|
|
177
|
+
*/
|
|
178
|
+
const { forms: formEntries = [] } = observation.properties || {};
|
|
179
|
+
formEntries.forEach(formEntry => {
|
|
180
|
+
const formDefinition = this._event.forms.find(form => form._id === formEntry.formId);
|
|
181
|
+
Object.keys(formEntry).forEach(fieldName => {
|
|
182
|
+
const fieldDefinition = formDefinition.fields.find(field => field.name === fieldName);
|
|
183
|
+
if (fieldDefinition && fieldDefinition.type === 'attachment') {
|
|
184
|
+
const attachmentsField = formEntry[fieldName] || [];
|
|
185
|
+
attachmentsField.filter(attachmentField => attachmentField.action === 'delete').forEach(attachmentField => {
|
|
186
|
+
const attachment = observation.attachments.find(attachment => attachment._id.toString() === attachmentField.id);
|
|
187
|
+
if (attachment) {
|
|
188
|
+
console.info(`deleting attachment ${attachment.id} for field ${fieldName} on observation ${observation.id}`);
|
|
189
|
+
new Attachment(this._event, observation).delete(attachment._id, err => {
|
|
190
|
+
log.warn('Error removing deleted attachment from file system', err);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
callback(err, updatedObservation);
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
Observation.prototype.addFavorite = function (observationId, user, callback) {
|
|
202
|
+
ObservationModel.addFavorite(this._event, observationId, user, callback);
|
|
203
|
+
};
|
|
204
|
+
Observation.prototype.removeFavorite = function (observation, user, callback) {
|
|
205
|
+
ObservationModel.removeFavorite(this._event, observation, user, callback);
|
|
206
|
+
};
|
|
207
|
+
Observation.prototype.addImportant = function (observationId, important, callback) {
|
|
208
|
+
ObservationModel.addImportant(this._event, observationId, important, callback);
|
|
209
|
+
};
|
|
210
|
+
Observation.prototype.removeImportant = function (observation, callback) {
|
|
211
|
+
ObservationModel.removeImportant(this._event, observation, callback);
|
|
212
|
+
};
|
|
213
|
+
Observation.prototype.addState = function (observationId, state, callback) {
|
|
214
|
+
ObservationModel.addState(this._event, observationId, state, (err, state) => {
|
|
215
|
+
if (!err) {
|
|
216
|
+
if (state.name === 'archive') {
|
|
217
|
+
EventEmitter.emit(ObservationEvents.events.remove, observationId, this._event);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
callback(err, state);
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
module.exports = Observation;
|
|
224
|
+
//# sourceMappingURL=observation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observation.js","sourceRoot":"","sources":["../../src/api/observation.js"],"names":[],"mappings":";AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,EAC1B,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,EACxB,iBAAiB,GAAG,OAAO,CAAC,yBAAyB,CAAC,EACtD,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,EACjC,gBAAgB,GAAG,OAAO,CAAC,uBAAuB,CAAC,EACnD,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAEzC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAExC,SAAS,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ;IACxC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IAClB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;AAC5B,CAAC;AAED,MAAM,YAAY,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAC7C,WAAW,CAAC,EAAE,GAAG,YAAY,CAAC;AAE9B,WAAW,CAAC,SAAS,CAAC,MAAM,GAAG,UAAS,OAAO,EAAE,QAAQ;IACvD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;IAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,IAAI,MAAM,IAAI,MAAM,CAAC,UAAU,EAAE;QAC/B,IAAI,eAAe,GAAG,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CACR,MAAM,CAAC,UAAU,EACjB,UAAS,QAAQ,EAAE,IAAI;YACrB,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACnC,gBAAgB,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,U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Y,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACjF,CAAC,CAAC;AAEF,WAAW,CAAC,SAAS,CAAC,eAAe,GAAG,UAAS,WAAW,EAAE,QAAQ;IACpE,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;AACvE,CAAC,CAAC;AAEF,WAAW,CAAC,SAAS,CAAC,QAAQ,GAAG,UAAS,aAAa,EAAE,KAAK,EAAE,QAAQ;IACtE,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC1E,IAAI,CAAC,GAAG,EAAE;YACR,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;gBAC5B,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;aAChF;SACF;QACD,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export = User;
|
|
2
|
+
declare function User(): void;
|
|
3
|
+
declare class User {
|
|
4
|
+
login(user: any, device: any, options: any, callback: any): void;
|
|
5
|
+
logout(token: any, callback: any): any;
|
|
6
|
+
count(options: any, callback: any): void;
|
|
7
|
+
getAll(filter: any, callback: any): void;
|
|
8
|
+
getById(id: any, callback: any): void;
|
|
9
|
+
create(user: any, options?: {}): Promise<any>;
|
|
10
|
+
update(user: any, options: any, callback: any): void;
|
|
11
|
+
delete(user: any, callback: any): void;
|
|
12
|
+
avatar(user: any, callback: any): any;
|
|
13
|
+
icon(user: any, callback: any): any;
|
|
14
|
+
addRecentEvent(user: any, event: any, callback: any): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/api/user.js"],"names":[],"mappings":";AAgCA,8BACC;;IAED,iEA2BC;IAED,uCAMC;IAED,yCASC;IAED,yCASC;IAED,sCAIC;IAED,8CAiFC;IAED,qDA4EC;IAED,uCAIC;IAED,sCAOC;IAED,oCAOC;IAED,2DAEC"}
|
package/lib/api/user.js
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
const UserModel = require('../models/user'), log = require('winston'), TokenModel = require('../models/token'), LoginModel = require('../models/login'), DeviceModel = require('../models/device'), TeamModel = require('../models/team'), AuthenticationConfiguration = require('../models/authenticationconfiguration'), path = require('path'), fs = require('fs-extra'), util = require('util'), async = require('async'), environment = require('../environment/env');
|
|
12
|
+
const userBase = environment.userBaseDirectory;
|
|
13
|
+
function contentPath(id, user, content, type) {
|
|
14
|
+
const relativePath = path.join(id.toString(), type + path.extname(content.path));
|
|
15
|
+
const absolutePath = path.join(userBase, relativePath);
|
|
16
|
+
return {
|
|
17
|
+
relativePath: relativePath,
|
|
18
|
+
absolutePath: absolutePath
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function avatarPath(id, user, avatar) {
|
|
22
|
+
return contentPath(id, user, avatar, 'avatar');
|
|
23
|
+
}
|
|
24
|
+
function iconPath(id, user, icon) {
|
|
25
|
+
return contentPath(id, user, icon, 'icon');
|
|
26
|
+
}
|
|
27
|
+
function User() {
|
|
28
|
+
}
|
|
29
|
+
User.prototype.login = function (user, device, options, callback) {
|
|
30
|
+
if (typeof options === 'function') {
|
|
31
|
+
callback = options;
|
|
32
|
+
options = {};
|
|
33
|
+
}
|
|
34
|
+
TokenModel.createToken({ userId: user._id, device: device }, function (err, token) {
|
|
35
|
+
if (err)
|
|
36
|
+
return callback(err);
|
|
37
|
+
LoginModel.createLogin(user, device, function (err) {
|
|
38
|
+
if (err) {
|
|
39
|
+
log.error('could not add login', err);
|
|
40
|
+
return callback(err);
|
|
41
|
+
}
|
|
42
|
+
if (device) {
|
|
43
|
+
// set user-agent and mage version on device
|
|
44
|
+
DeviceModel.updateDevice(device._id, { userAgent: options.userAgent, appVersion: options.appVersion }).then(() => {
|
|
45
|
+
callback(null, token);
|
|
46
|
+
}).catch(err => {
|
|
47
|
+
callback(err);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
callback(null, token);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
User.prototype.logout = function (token, callback) {
|
|
57
|
+
if (!token)
|
|
58
|
+
return callback();
|
|
59
|
+
TokenModel.removeToken(token, function (err) {
|
|
60
|
+
callback(err);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
User.prototype.count = function (options, callback) {
|
|
64
|
+
if (typeof options === 'function') {
|
|
65
|
+
callback = options;
|
|
66
|
+
options = {};
|
|
67
|
+
}
|
|
68
|
+
UserModel.count(options, callback, function (err, count) {
|
|
69
|
+
callback(err, count);
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
User.prototype.getAll = function (filter, callback) {
|
|
73
|
+
if (typeof filter === 'function') {
|
|
74
|
+
callback = filter;
|
|
75
|
+
filter = {};
|
|
76
|
+
}
|
|
77
|
+
UserModel.getUsers(filter, function (err, users, pageInfo) {
|
|
78
|
+
callback(err, users, pageInfo);
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
User.prototype.getById = function (id, callback) {
|
|
82
|
+
UserModel.getUserById(id, function (err, user) {
|
|
83
|
+
callback(err, user);
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
User.prototype.create = function (user, options = {}) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const authType = user.authentication.type;
|
|
89
|
+
const authName = user.authentication.authenticationConfiguration.name;
|
|
90
|
+
const authenticationConfig = yield AuthenticationConfiguration.getConfiguration(authType, authName);
|
|
91
|
+
delete user.authentication.authenticationConfiguration;
|
|
92
|
+
let defaultTeams;
|
|
93
|
+
let defaultEvents;
|
|
94
|
+
if (authenticationConfig) {
|
|
95
|
+
user.authentication.authenticationConfigurationId = authenticationConfig._id;
|
|
96
|
+
const requireAdminActivation = authenticationConfig.settings.usersReqAdmin || { enabled: true };
|
|
97
|
+
if (requireAdminActivation) {
|
|
98
|
+
user.active = user.active || !requireAdminActivation.enabled;
|
|
99
|
+
}
|
|
100
|
+
defaultTeams = authenticationConfig.settings.newUserTeams;
|
|
101
|
+
defaultEvents = authenticationConfig.settings.newUserEvents;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
throw new Error('No configuration defined for ' + user.authentication.type);
|
|
105
|
+
}
|
|
106
|
+
const newUser = yield util.promisify(UserModel.createUser)(user);
|
|
107
|
+
if (options.avatar) {
|
|
108
|
+
try {
|
|
109
|
+
const avatar = avatarPath(newUser._id, newUser, options.avatar);
|
|
110
|
+
yield fs.move(options.avatar.path, avatar.absolutePath);
|
|
111
|
+
newUser.avatar = {
|
|
112
|
+
relativePath: avatar.relativePath,
|
|
113
|
+
contentType: options.avatar.mimetype,
|
|
114
|
+
size: options.avatar.size
|
|
115
|
+
};
|
|
116
|
+
yield newUser.save();
|
|
117
|
+
}
|
|
118
|
+
catch (_a) { }
|
|
119
|
+
}
|
|
120
|
+
if (options.icon && (options.icon.type === 'create' || options.icon.type === 'upload')) {
|
|
121
|
+
try {
|
|
122
|
+
const icon = iconPath(newUser._id, newUser, options.icon);
|
|
123
|
+
yield fs.move(options.icon.path, icon.absolutePath);
|
|
124
|
+
newUser.icon.type = options.icon.type;
|
|
125
|
+
newUser.icon.relativePath = icon.relativePath;
|
|
126
|
+
newUser.icon.contentType = options.icon.mimetype;
|
|
127
|
+
newUser.icon.size = options.icon.size;
|
|
128
|
+
newUser.icon.text = options.icon.text;
|
|
129
|
+
newUser.icon.color = options.icon.color;
|
|
130
|
+
yield newUser.save();
|
|
131
|
+
}
|
|
132
|
+
catch (_b) { }
|
|
133
|
+
}
|
|
134
|
+
if (defaultTeams && Array.isArray(defaultTeams)) {
|
|
135
|
+
const addUserToTeam = util.promisify(TeamModel.addUser);
|
|
136
|
+
for (let i = 0; i < defaultTeams.length; i++) {
|
|
137
|
+
try {
|
|
138
|
+
yield addUserToTeam({ _id: defaultTeams[i] }, newUser);
|
|
139
|
+
}
|
|
140
|
+
catch (_c) { }
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (defaultEvents && Array.isArray(defaultEvents)) {
|
|
144
|
+
const addUserToTeam = util.promisify(TeamModel.addUser);
|
|
145
|
+
const getTeamForEvent = util.promisify(TeamModel.getTeamForEvent);
|
|
146
|
+
for (let i = 0; i < defaultEvents.length; i++) {
|
|
147
|
+
const team = yield getTeamForEvent({ _id: defaultEvents[i] });
|
|
148
|
+
if (team) {
|
|
149
|
+
try {
|
|
150
|
+
yield addUserToTeam(team, newUser);
|
|
151
|
+
}
|
|
152
|
+
catch (_d) { }
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return newUser;
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
User.prototype.update = function (user, options, callback) {
|
|
160
|
+
if (typeof options === 'function') {
|
|
161
|
+
callback = options;
|
|
162
|
+
options = {};
|
|
163
|
+
}
|
|
164
|
+
const operations = [];
|
|
165
|
+
operations.push(function (done) {
|
|
166
|
+
done(null, user);
|
|
167
|
+
});
|
|
168
|
+
if (options.avatar) {
|
|
169
|
+
operations.push(function (updatedUser, done) {
|
|
170
|
+
const avatar = avatarPath(updatedUser._id, updatedUser, options.avatar);
|
|
171
|
+
fs.move(options.avatar.path, avatar.absolutePath, { clobber: true }, function (err) {
|
|
172
|
+
if (err) {
|
|
173
|
+
return done(err);
|
|
174
|
+
}
|
|
175
|
+
updatedUser.avatar = {
|
|
176
|
+
relativePath: avatar.relativePath,
|
|
177
|
+
contentType: options.avatar.mimetype,
|
|
178
|
+
size: options.avatar.size
|
|
179
|
+
};
|
|
180
|
+
done(null, updatedUser);
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (options.icon && options.icon.type) {
|
|
185
|
+
if (options.icon.type === 'none') {
|
|
186
|
+
if (user.icon.relativePath) {
|
|
187
|
+
// delete it
|
|
188
|
+
operations.push(function (updatedUser, done) {
|
|
189
|
+
const icon = updatedUser.icon;
|
|
190
|
+
icon.path = path.join(userBase, updatedUser.icon.relativePath);
|
|
191
|
+
const iconPaths = iconPath(updatedUser._id, updatedUser, icon);
|
|
192
|
+
fs.remove(iconPaths.absolutePath, function (err) {
|
|
193
|
+
if (err) {
|
|
194
|
+
log.warn('Error removing users map icon from ' + iconPaths.absolutePath);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
updatedUser.icon = {
|
|
198
|
+
type: options.icon.type
|
|
199
|
+
};
|
|
200
|
+
done(null, updatedUser);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
operations.push(function (updatedUser, done) {
|
|
206
|
+
const icon = iconPath(updatedUser._id, updatedUser, options.icon);
|
|
207
|
+
fs.move(options.icon.path, icon.absolutePath, { clobber: true }, function (err) {
|
|
208
|
+
if (err)
|
|
209
|
+
return done(err);
|
|
210
|
+
updatedUser.icon.type = options.icon.type;
|
|
211
|
+
updatedUser.icon.relativePath = icon.relativePath;
|
|
212
|
+
updatedUser.icon.contentType = options.icon.mimetype;
|
|
213
|
+
updatedUser.icon.size = options.icon.size;
|
|
214
|
+
updatedUser.icon.text = options.icon.type === 'create' ? options.icon.text : undefined;
|
|
215
|
+
updatedUser.icon.color = options.icon.type === 'create' ? options.icon.color : undefined;
|
|
216
|
+
done(null, updatedUser);
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
async.waterfall(operations, function (err, updatedUser) {
|
|
222
|
+
if (err)
|
|
223
|
+
return callback(err);
|
|
224
|
+
UserModel.updateUser(updatedUser, callback);
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
User.prototype.delete = function (user, callback) {
|
|
228
|
+
UserModel.deleteUser(user, function (err) {
|
|
229
|
+
callback(err);
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
User.prototype.avatar = function (user, callback) {
|
|
233
|
+
if (!user.avatar.relativePath)
|
|
234
|
+
return callback();
|
|
235
|
+
const avatar = user.avatar.toObject();
|
|
236
|
+
avatar.path = path.join(userBase, user.avatar.relativePath);
|
|
237
|
+
callback(null, avatar);
|
|
238
|
+
};
|
|
239
|
+
User.prototype.icon = function (user, callback) {
|
|
240
|
+
if (!user.icon.relativePath)
|
|
241
|
+
return callback();
|
|
242
|
+
const icon = user.icon.toObject();
|
|
243
|
+
icon.path = path.join(userBase, user.icon.relativePath);
|
|
244
|
+
callback(null, icon);
|
|
245
|
+
};
|
|
246
|
+
User.prototype.addRecentEvent = function (user, event, callback) {
|
|
247
|
+
UserModel.addRecentEventForUser(user, event, callback);
|
|
248
|
+
};
|
|
249
|
+
module.exports = User;
|
|
250
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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AC,YAAY;QAAE,OAAO,QAAQ,EAAE,CAAC;IAE/C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAExD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,IAAI,CAAC,SAAS,CAAC,cAAc,GAAG,UAAU,IAAI,EAAE,KAAK,EAAE,QAAQ;IAC7D,SAAS,CAAC,qBAAqB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const ErrPermissionDenied: unique symbol;
|
|
2
|
+
export declare const ErrInvalidInput: unique symbol;
|
|
3
|
+
export declare const ErrEntityNotFound: unique symbol;
|
|
4
|
+
export declare const ErrInfrastructure: unique symbol;
|
|
5
|
+
export declare type PermissionDeniedError = MageError<typeof ErrPermissionDenied, PermissionDeniedErrorData>;
|
|
6
|
+
export declare type InvalidInputError = MageError<typeof ErrInvalidInput, KeyPathError[]>;
|
|
7
|
+
export declare type EntityNotFoundError = MageError<typeof ErrEntityNotFound, EntityNotFoundErrorData>;
|
|
8
|
+
/**
|
|
9
|
+
* An infrastructure error bubbles up from some adapter layer component, such
|
|
10
|
+
* as a file system service or database driver. These are typically errors
|
|
11
|
+
* that do not occur as a result of a malformed client request or business
|
|
12
|
+
* logic condition, but some unexpected event like a lost network connection
|
|
13
|
+
* or disk failure. From an external web client perspective, this would
|
|
14
|
+
* translate to a 500 HTTP response code.
|
|
15
|
+
*/
|
|
16
|
+
export declare type InfrastructureError = MageError<typeof ErrInfrastructure>;
|
|
17
|
+
export declare class MageError<Code extends symbol, Data = null> extends Error {
|
|
18
|
+
readonly code: Code;
|
|
19
|
+
readonly data: Data;
|
|
20
|
+
constructor(code: Code, data: Data, message?: string);
|
|
21
|
+
}
|
|
22
|
+
export interface PermissionDeniedErrorData {
|
|
23
|
+
subject: string;
|
|
24
|
+
permission: string;
|
|
25
|
+
object: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface EntityNotFoundErrorData {
|
|
28
|
+
readonly entityType: string;
|
|
29
|
+
readonly entityId: any;
|
|
30
|
+
}
|
|
31
|
+
export declare function permissionDenied(permission: string, subject: string, object?: string): PermissionDeniedError;
|
|
32
|
+
export declare function entityNotFound(entityId: any, entityType: string, message?: string): EntityNotFoundError;
|
|
33
|
+
export declare function invalidInput(summary?: string, ...errors: KeyPathError[]): InvalidInputError;
|
|
34
|
+
export declare function infrastructureError(why: string | Error): InfrastructureError;
|
|
35
|
+
/**
|
|
36
|
+
* The KeyPathError type is simply an array whose first element is an error
|
|
37
|
+
* (string message or `Error` object, typically), and the remaining elements are
|
|
38
|
+
* strings that represent the chain of JSON properties whose value the error
|
|
39
|
+
* describes.
|
|
40
|
+
*/
|
|
41
|
+
export declare type KeyPathError = [any, ...string[]];
|
|
42
|
+
//# sourceMappingURL=app.api.errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.api.errors.d.ts","sourceRoot":"","sources":["../../src/app.api/app.api.errors.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB,eAA2C,CAAA;AAC3E,eAAO,MAAM,eAAe,eAAuC,CAAA;AACnE,eAAO,MAAM,iBAAiB,eAAyC,CAAA;AACvE,eAAO,MAAM,iBAAiB,eAAyC,CAAA;AAEvE,oBAAY,qBAAqB,GAAG,SAAS,CAAC,OAAO,mBAAmB,EAAE,yBAAyB,CAAC,CAAA;AACpG,oBAAY,iBAAiB,GAAG,SAAS,CAAC,OAAO,eAAe,EAAE,YAAY,EAAE,CAAC,CAAA;AACjF,oBAAY,mBAAmB,GAAG,SAAS,CAAC,OAAO,iBAA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