@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,130 @@
|
|
|
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 log = require('winston'), ObjectID = require('mongodb').ObjectID;
|
|
12
|
+
exports.id = 'attachment-form-field';
|
|
13
|
+
function createAttachmentField(db) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const collection = yield db.collection('events');
|
|
16
|
+
const formCounterCollection = yield db.collection('counters');
|
|
17
|
+
const events = yield collection.find().toArray();
|
|
18
|
+
for (const event of events) {
|
|
19
|
+
log.info(`creating attachment fields for event ${event.name}`);
|
|
20
|
+
event.forms.forEach(form => {
|
|
21
|
+
let id = 0;
|
|
22
|
+
const fields = form.fields.slice() || [];
|
|
23
|
+
if (fields.length) {
|
|
24
|
+
id = fields.sort((a, b) => b.id - a.id)[0].id + 1;
|
|
25
|
+
}
|
|
26
|
+
// Attachment field will be first, add one to every other field id
|
|
27
|
+
fields.forEach(field => field.id = ++field.id);
|
|
28
|
+
fields.push({
|
|
29
|
+
id: 0,
|
|
30
|
+
name: `field${id}`,
|
|
31
|
+
required: false,
|
|
32
|
+
type: 'attachment',
|
|
33
|
+
title: 'Attachments',
|
|
34
|
+
choices: [],
|
|
35
|
+
allowedAttachmentTypes: ['image', 'video', 'audio']
|
|
36
|
+
});
|
|
37
|
+
log.info('adding attachment field to form', fields[fields.length - 1]);
|
|
38
|
+
form.fields = fields;
|
|
39
|
+
});
|
|
40
|
+
if (event.forms.length === 0) {
|
|
41
|
+
log.info(`Event ${event.name} has no forms`);
|
|
42
|
+
const observationCollection = yield db.collection(`observations${event._id}`);
|
|
43
|
+
const count = yield observationCollection.count({ attachments: { $exists: true, $ne: [] } });
|
|
44
|
+
if (count > 0) {
|
|
45
|
+
log.info(`Event ${event.name} has no forms, but does contain attachments, create new form w/ attachment field`);
|
|
46
|
+
const counter = yield formCounterCollection.findOneAndUpdate({ _id: 'form' }, { $inc: { sequence: 1 } }, { upsert: true, returnOriginal: false });
|
|
47
|
+
// Create a new form for this event that would allow users to submit attachments
|
|
48
|
+
event.forms = [{
|
|
49
|
+
_id: counter.value.sequence,
|
|
50
|
+
name: event.name,
|
|
51
|
+
color: '#1E88E5',
|
|
52
|
+
userFields: [],
|
|
53
|
+
archived: false,
|
|
54
|
+
default: false,
|
|
55
|
+
fields: [{
|
|
56
|
+
id: 1,
|
|
57
|
+
name: 'field1',
|
|
58
|
+
required: false,
|
|
59
|
+
type: 'attachment',
|
|
60
|
+
title: 'Attachments',
|
|
61
|
+
choices: [],
|
|
62
|
+
allowedAttachmentTypes: ['image', 'video', 'audio']
|
|
63
|
+
}]
|
|
64
|
+
}];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
yield collection.findOneAndUpdate({ _id: event._id }, event);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function updateEventAttachments(db, event) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const collectionName = `observations${event._id}`;
|
|
74
|
+
log.info(`updating observations ${collectionName}`);
|
|
75
|
+
const collection = yield db.collection(collectionName);
|
|
76
|
+
const observations = yield collection.find().toArray();
|
|
77
|
+
log.info(`found ${observations.length} in collection`);
|
|
78
|
+
for (const observation of observations) {
|
|
79
|
+
// Add _id to observation form, if exists
|
|
80
|
+
const observationFormId = new ObjectID();
|
|
81
|
+
if (observation.properties.forms && observation.properties.forms.length) {
|
|
82
|
+
const observationForm = observation.properties.forms[0];
|
|
83
|
+
observationForm._id = observationFormId;
|
|
84
|
+
}
|
|
85
|
+
const attachments = observation.attachments || [];
|
|
86
|
+
if (attachments.length) {
|
|
87
|
+
// observation has attachments, add to form if exists, create if not
|
|
88
|
+
let observationForm;
|
|
89
|
+
if (observation.properties.forms && observation.properties.forms.length) {
|
|
90
|
+
observationForm = observation.properties.forms[0];
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
observationForm = {
|
|
94
|
+
_id: observationFormId,
|
|
95
|
+
formId: event.forms[0]._id
|
|
96
|
+
};
|
|
97
|
+
observation.properties.forms = [observationForm];
|
|
98
|
+
}
|
|
99
|
+
const form = event.forms.find(form => form._id === observationForm.formId);
|
|
100
|
+
const attachmentField = form.fields.find(field => field.type === 'attachment');
|
|
101
|
+
attachments.forEach(attachment => {
|
|
102
|
+
attachment.observationFormId = observationFormId;
|
|
103
|
+
attachment.fieldName = attachmentField.name;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
log.info('updating observation attachments', observation.attachments);
|
|
107
|
+
yield collection.findOneAndUpdate({ _id: observation._id }, observation);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function updateAttachments(db) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
const collection = yield db.collection('events');
|
|
114
|
+
const events = yield collection.find().toArray();
|
|
115
|
+
for (const event of events) {
|
|
116
|
+
yield updateEventAttachments(db, event);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
exports.up = function (done) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
yield createAttachmentField(this.db);
|
|
123
|
+
yield updateAttachments(this.db);
|
|
124
|
+
done();
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
exports.down = function (done) {
|
|
128
|
+
done();
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=029-attachment-form-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"029-attachment-form-field.js","sourceRoot":"","sources":["../../src/migrations/029-attachment-form-field.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;AAEb,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,EAC1B,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC;AAE3C,OAAO,CAAC,EAAE,GAAG,uBAAuB,CAAC;AAErC,SAAe,qBAAqB,CAAC,EAAE;;QACrC,MAAM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,GAAG,UAAgB,IAAI;;QAC/B,MAAM,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEjC,IAAI,EAAE,CAAC;IACT,CAAC;CAAA,CAAA;AAED,OAAO,CAAC,IAAI,GAAG,UAAU,IAAI;IAC3B,IAAI,EAAE,CAAC;AACT,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference path="../permissions/permissions.events.d.ts" />
|
|
2
|
+
export function getAuthenticationByStrategy(strategy: any, uid: any, callback: any): mongoose.DocumentQuery<mongoose.Document | null, mongoose.Document> | undefined;
|
|
3
|
+
export function getAuthenticationsByType(type: any): Promise<mongoose.Document[]>;
|
|
4
|
+
export function getAuthenticationsByAuthConfigId(authConfigId: any): Promise<mongoose.Document[]>;
|
|
5
|
+
export function countAuthenticationsByAuthConfigId(authConfigId: any): Promise<number>;
|
|
6
|
+
export function createAuthentication(authentication: any): Promise<mongoose.Document>;
|
|
7
|
+
export function updateAuthentication(authentication: any): any;
|
|
8
|
+
export function removeAuthenticationById(authenticationId: any, done: any): void;
|
|
9
|
+
declare const Authentication: mongoose.Model<mongoose.Document>;
|
|
10
|
+
declare const LocalAuthentication: mongoose.Model<mongoose.Document>;
|
|
11
|
+
declare const SamlAuthentication: mongoose.Model<mongoose.Document>;
|
|
12
|
+
declare const LdapAuthentication: mongoose.Model<mongoose.Document>;
|
|
13
|
+
declare const OauthAuthentication: mongoose.Model<mongoose.Document>;
|
|
14
|
+
declare const OpenIdConnectAuthentication: mongoose.Model<mongoose.Document>;
|
|
15
|
+
import mongoose = require("mongoose");
|
|
16
|
+
export { Authentication as Model, LocalAuthentication as Local, SamlAuthentication as SAML, LdapAuthentication as LDAP, OauthAuthentication as Oauth, OpenIdConnectAuthentication as OpenIdConnect };
|
|
17
|
+
//# sourceMappingURL=authentication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/models/authentication.js"],"names":[],"mappings":";AA0KsC,qKAMrC;AAEkC,kFAElC;AAE0C,kGAE1C;AAE4C,uFAE5C;AAE8B,sFAe9B;AAE8B,+DAE9B;AAEkC,iFAElC;AA7DD,gEAA8E;AAG9E,qEAA+E;AAG/E,oEAA4E;AAG5E,oEAA4E;AAG5E,qEAA+E;AAG/E,6EAAuG"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const mongoose = require('mongoose'), async = require("async"), hasher = require('../utilities/pbkdf2')(), User = require('./user'), Token = require('./token'), AuthenticationConfiguration = require('./authenticationconfiguration'), PasswordValidator = require('../utilities/passwordValidator');
|
|
3
|
+
const Schema = mongoose.Schema;
|
|
4
|
+
const AuthenticationSchema = new Schema({
|
|
5
|
+
type: { type: String, required: true },
|
|
6
|
+
id: { type: String, required: false },
|
|
7
|
+
authenticationConfigurationId: { type: Schema.Types.ObjectId, ref: 'AuthenticationConfiguration', required: false }
|
|
8
|
+
}, {
|
|
9
|
+
discriminatorKey: 'type',
|
|
10
|
+
timestamps: {
|
|
11
|
+
updatedAt: 'lastUpdated'
|
|
12
|
+
},
|
|
13
|
+
toObject: {
|
|
14
|
+
transform: DbAuthenticationToObject
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
function DbAuthenticationToObject(authIn, authOut, options) {
|
|
18
|
+
delete authOut._id;
|
|
19
|
+
authOut.id = authIn._id;
|
|
20
|
+
if (authIn.populated('authenticationConfigurationId') && authIn.authenticationConfigurationId) {
|
|
21
|
+
delete authOut.authenticationConfigurationId;
|
|
22
|
+
authOut.authenticationConfiguration = authIn.authenticationConfigurationId.toObject(options);
|
|
23
|
+
}
|
|
24
|
+
return authOut;
|
|
25
|
+
}
|
|
26
|
+
const LocalSchema = new Schema({
|
|
27
|
+
password: { type: String, required: true },
|
|
28
|
+
previousPasswords: { type: [String], default: [] },
|
|
29
|
+
security: {
|
|
30
|
+
locked: { type: Boolean, default: false },
|
|
31
|
+
lockedUntil: { type: Date },
|
|
32
|
+
invalidLoginAttempts: { type: Number, default: 0 },
|
|
33
|
+
numberOfTimesLocked: { type: Number, default: 0 }
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
toObject: {
|
|
37
|
+
transform: DbLocalAuthenticationToObject
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
function DbLocalAuthenticationToObject(authIn, authOut, options) {
|
|
41
|
+
authOut = DbAuthenticationToObject(authIn, authOut, options);
|
|
42
|
+
delete authOut.password;
|
|
43
|
+
delete authOut.previousPasswords;
|
|
44
|
+
return authOut;
|
|
45
|
+
}
|
|
46
|
+
const SamlSchema = new Schema({});
|
|
47
|
+
const LdapSchema = new Schema({});
|
|
48
|
+
const OauthSchema = new Schema({});
|
|
49
|
+
const OpenIdConnectSchema = new Schema({});
|
|
50
|
+
AuthenticationSchema.method('validatePassword', function (password, callback) {
|
|
51
|
+
hasher.validPassword(password, this.password, callback);
|
|
52
|
+
});
|
|
53
|
+
// Encrypt password before save
|
|
54
|
+
LocalSchema.pre('save', function (next) {
|
|
55
|
+
const authentication = this;
|
|
56
|
+
// only hash the password if it has been modified (or is new)
|
|
57
|
+
if (!authentication.isModified('password')) {
|
|
58
|
+
return next();
|
|
59
|
+
}
|
|
60
|
+
async.waterfall([
|
|
61
|
+
function (done) {
|
|
62
|
+
AuthenticationConfiguration.Model.findById(authentication.authenticationConfigurationId).then(localConfiguration => {
|
|
63
|
+
done(null, localConfiguration.settings.passwordPolicy);
|
|
64
|
+
}).catch(err => done(err));
|
|
65
|
+
},
|
|
66
|
+
function (policy, done) {
|
|
67
|
+
const { password, previousPasswords } = authentication;
|
|
68
|
+
PasswordValidator.validate(policy, { password, previousPasswords }).then(validationStatus => {
|
|
69
|
+
if (!validationStatus.valid) {
|
|
70
|
+
const err = new Error(validationStatus.errorMsg);
|
|
71
|
+
err.status = 400;
|
|
72
|
+
return done(err);
|
|
73
|
+
}
|
|
74
|
+
done(null, policy);
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
function (policy, done) {
|
|
78
|
+
hasher.hashPassword(authentication.password, function (err, password) {
|
|
79
|
+
done(err, policy, password);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
], function (err, policy, password) {
|
|
83
|
+
if (err)
|
|
84
|
+
return next(err);
|
|
85
|
+
authentication.password = password;
|
|
86
|
+
authentication.previousPasswords.unshift(password);
|
|
87
|
+
authentication.previousPasswords = authentication.previousPasswords.slice(0, policy.passwordHistoryCount);
|
|
88
|
+
next();
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
// Remove Token if password changed
|
|
92
|
+
LocalSchema.pre('save', function (next) {
|
|
93
|
+
const authentication = this;
|
|
94
|
+
// only remove token if password has been modified (or is new)
|
|
95
|
+
if (!authentication.isModified('password')) {
|
|
96
|
+
return next();
|
|
97
|
+
}
|
|
98
|
+
async.waterfall([
|
|
99
|
+
function (done) {
|
|
100
|
+
User.getUserByAuthenticationId(authentication._id).then(user => {
|
|
101
|
+
done(null, user);
|
|
102
|
+
}).catch(err => {
|
|
103
|
+
done(err);
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
function (user, done) {
|
|
107
|
+
if (user) {
|
|
108
|
+
Token.removeTokensForUser(user, function (err) {
|
|
109
|
+
if (err)
|
|
110
|
+
return done(err);
|
|
111
|
+
done();
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
done();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
], function (err) {
|
|
119
|
+
return next(err);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
AuthenticationSchema.virtual('authenticationConfiguration').get(function () {
|
|
123
|
+
return this.populated('authenticationConfigurationId') ? this.authenticationConfigurationId : null;
|
|
124
|
+
});
|
|
125
|
+
const Authentication = mongoose.model('Authentication', AuthenticationSchema);
|
|
126
|
+
exports.Model = Authentication;
|
|
127
|
+
const LocalAuthentication = Authentication.discriminator('local', LocalSchema);
|
|
128
|
+
exports.Local = LocalAuthentication;
|
|
129
|
+
const SamlAuthentication = Authentication.discriminator('saml', SamlSchema);
|
|
130
|
+
exports.SAML = SamlAuthentication;
|
|
131
|
+
const LdapAuthentication = Authentication.discriminator('ldap', LdapSchema);
|
|
132
|
+
exports.LDAP = LdapAuthentication;
|
|
133
|
+
const OauthAuthentication = Authentication.discriminator('oauth', OauthSchema);
|
|
134
|
+
exports.Oauth = OauthAuthentication;
|
|
135
|
+
const OpenIdConnectAuthentication = Authentication.discriminator('openidconnect', OpenIdConnectSchema);
|
|
136
|
+
exports.OpenIdConnect = OpenIdConnectAuthentication;
|
|
137
|
+
exports.getAuthenticationByStrategy = function (strategy, uid, callback) {
|
|
138
|
+
if (callback) {
|
|
139
|
+
Authentication.findOne({ id: uid, type: strategy }, callback);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
return Authentication.findOne({ id: uid, type: strategy });
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
exports.getAuthenticationsByType = function (type) {
|
|
146
|
+
return Authentication.find({ type: type }).exec();
|
|
147
|
+
};
|
|
148
|
+
exports.getAuthenticationsByAuthConfigId = function (authConfigId) {
|
|
149
|
+
return Authentication.find({ authenticationConfigurationId: authConfigId }).exec();
|
|
150
|
+
};
|
|
151
|
+
exports.countAuthenticationsByAuthConfigId = function (authConfigId) {
|
|
152
|
+
return Authentication.count({ authenticationConfigurationId: authConfigId }).exec();
|
|
153
|
+
};
|
|
154
|
+
exports.createAuthentication = function (authentication) {
|
|
155
|
+
const document = {
|
|
156
|
+
id: authentication.id,
|
|
157
|
+
type: authentication.type,
|
|
158
|
+
authenticationConfigurationId: authentication.authenticationConfigurationId,
|
|
159
|
+
};
|
|
160
|
+
if (authentication.type === 'local') {
|
|
161
|
+
document.password = authentication.password;
|
|
162
|
+
document.security = {
|
|
163
|
+
lockedUntil: null
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
return Authentication.create(document);
|
|
167
|
+
};
|
|
168
|
+
exports.updateAuthentication = function (authentication) {
|
|
169
|
+
return authentication.save();
|
|
170
|
+
};
|
|
171
|
+
exports.removeAuthenticationById = function (authenticationId, done) {
|
|
172
|
+
Authentication.findByIdAndRemove(authenticationId, done);
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=authentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../src/models/authentication.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,EAChC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,EACxB,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,EAAE,EACzC,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,EACxB,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,EAC1B,2BAA2B,GAAG,OAAO,CAAC,+BAA+B,CAAC,EACtE,iBAAiB,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;AAElE,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AAE/B,MAAM,oBAAoB,GAAG,IAAI,MAAM,CACrC;IACE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACtC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;IACrC,6BAA6B,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,6BAA6B,EAAE,QAAQ,EAAE,KAAK,EAAE;CACpH,EACD;IACE,gBAAgB,EAAE,MAAM;IACxB,UAAU,EAAE;QACV,SAAS,EAAE,aAAa;KACzB;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,wBAAwB;KACpC;CACF,CACF,CAAC;AAEF,SAAS,wBAA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B,IAAI,EAAE,cAAc,CAAC,IAAI;QACzB,6BAA6B,EAAE,cAAc,CAAC,6BAA6B;KAC5E,CAAA;IAED,IAAI,cAAc,CAAC,IAAI,KAAK,OAAO,EAAE;QACnC,QAAQ,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;QAC5C,QAAQ,CAAC,QAAQ,GAAE;YACjB,WAAW,EAAE,IAAI;SAClB,CAAA;KACF;IAED,OAAO,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF,OAAO,CAAC,oBAAoB,GAAG,UAAU,cAAc;IACrD,OAAO,cAAc,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,CAAC,wBAAwB,GAAG,UAAU,gBAAgB,EAAE,IAAI;IACjE,cAAc,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AAC3D,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference path="../permissions/permissions.events.d.ts" />
|
|
2
|
+
export function getById(id: any): Promise<mongoose.Document | null>;
|
|
3
|
+
export function getConfiguration(type: any, name: any): Promise<mongoose.Document | null>;
|
|
4
|
+
export function getConfigurationsByType(type: any): Promise<mongoose.Document[]>;
|
|
5
|
+
export function getAllConfigurations(): Promise<mongoose.Document[]>;
|
|
6
|
+
export function create(config: any): Promise<mongoose.Document>;
|
|
7
|
+
export function update(id: any, config: any): Promise<mongoose.Document | null>;
|
|
8
|
+
export function remove(id: any): Promise<mongoose.Document | null>;
|
|
9
|
+
declare function DbAuthenticationConfigurationToObject(config: any, ret: any, options: any): void;
|
|
10
|
+
export const secureMask: "*****";
|
|
11
|
+
export const blacklist: string[];
|
|
12
|
+
declare const AuthenticationConfiguration: mongoose.Model<mongoose.Document>;
|
|
13
|
+
import mongoose = require("mongoose");
|
|
14
|
+
export { DbAuthenticationConfigurationToObject as transform, AuthenticationConfiguration as Model };
|
|
15
|
+
//# sourceMappingURL=authenticationconfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticationconfiguration.d.ts","sourceRoot":"","sources":["../../src/models/authenticationconfiguration.js"],"names":[],"mappings":";AAsEkB,oEAEjB;AAE0B,0FAE1B;AAEiC,iFAEjC;AAE8B,qEAE9B;AA4BgB,gEAKhB;AAEgB,gFAKhB;AAEgB,mEAEhB;AA7FD,kGA0BC;AA5BD,iCAA2B;AAD3B,iCAAsF;AAmCtF,6EAAqH"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const mongoose = require('mongoose');
|
|
3
|
+
// Creates a new Mongoose Schema object
|
|
4
|
+
const Schema = mongoose.Schema;
|
|
5
|
+
const AuthenticationConfigurationSchema = new Schema({
|
|
6
|
+
name: { type: String, required: true },
|
|
7
|
+
type: { type: String, required: true },
|
|
8
|
+
title: { type: String, required: false },
|
|
9
|
+
textColor: { type: String, required: false },
|
|
10
|
+
buttonColor: { type: String, required: false },
|
|
11
|
+
icon: { type: Buffer, required: false },
|
|
12
|
+
enabled: { type: Boolean, default: true },
|
|
13
|
+
settings: Schema.Types.Mixed
|
|
14
|
+
}, {
|
|
15
|
+
timestamps: {
|
|
16
|
+
updatedAt: 'lastUpdated'
|
|
17
|
+
},
|
|
18
|
+
versionKey: false,
|
|
19
|
+
toObject: {
|
|
20
|
+
transform: DbAuthenticationConfigurationToObject
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
AuthenticationConfigurationSchema.index({ name: 1, type: 1 }, { unique: true });
|
|
24
|
+
const whitelist = ['name', 'type', 'title', 'textColor', 'buttonColor', 'icon'];
|
|
25
|
+
const blacklist = ['clientsecret', 'bindcredentials', 'privatecert', 'decryptionpvk'];
|
|
26
|
+
const secureMask = '*****';
|
|
27
|
+
function DbAuthenticationConfigurationToObject(config, ret, options) {
|
|
28
|
+
if ('function' !== typeof config.ownerDocument) {
|
|
29
|
+
delete ret.__v;
|
|
30
|
+
if (options.whitelist) {
|
|
31
|
+
if (config.type === 'local') {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
Object.keys(ret).forEach(key => {
|
|
35
|
+
if (!whitelist.includes(key)) {
|
|
36
|
+
delete ret[key];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (options.blacklist) {
|
|
41
|
+
Object.keys(ret.settings).forEach(key => {
|
|
42
|
+
if (blacklist.includes(key.toLowerCase())) {
|
|
43
|
+
ret.settings[key] = secureMask;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
ret.icon = ret.icon ? ret.icon.toString('base64') : null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
;
|
|
51
|
+
exports.transform = DbAuthenticationConfigurationToObject;
|
|
52
|
+
exports.secureMask = secureMask;
|
|
53
|
+
exports.blacklist = blacklist;
|
|
54
|
+
const AuthenticationConfiguration = mongoose.model('AuthenticationConfiguration', AuthenticationConfigurationSchema);
|
|
55
|
+
exports.Model = AuthenticationConfiguration;
|
|
56
|
+
exports.getById = function (id) {
|
|
57
|
+
return AuthenticationConfiguration.findById(id).exec();
|
|
58
|
+
};
|
|
59
|
+
exports.getConfiguration = function (type, name) {
|
|
60
|
+
return AuthenticationConfiguration.findOne({ type: type, name: name }).exec();
|
|
61
|
+
};
|
|
62
|
+
exports.getConfigurationsByType = function (type) {
|
|
63
|
+
return AuthenticationConfiguration.find({ type: type }).exec();
|
|
64
|
+
};
|
|
65
|
+
exports.getAllConfigurations = function () {
|
|
66
|
+
return AuthenticationConfiguration.find({}).exec();
|
|
67
|
+
};
|
|
68
|
+
function manageIcon(config) {
|
|
69
|
+
if (config.icon) {
|
|
70
|
+
if (config.icon.startsWith('data')) {
|
|
71
|
+
config.icon = Buffer.from(config.icon.split(",")[1], "base64");
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
config.icon = Buffer.from(config.icon, 'base64');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
config.icon = null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function manageSettings(config) {
|
|
82
|
+
if (config.settings.scope) {
|
|
83
|
+
if (!Array.isArray(config.settings.scope)) {
|
|
84
|
+
config.settings.scope = config.settings.scope.split(',');
|
|
85
|
+
}
|
|
86
|
+
for (let i = 0; i < config.settings.scope.length; i++) {
|
|
87
|
+
config.settings.scope[i] = config.settings.scope[i].trim();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//TODO move the 'manage' methods to a pre save method
|
|
92
|
+
exports.create = function (config) {
|
|
93
|
+
manageIcon(config);
|
|
94
|
+
manageSettings(config);
|
|
95
|
+
return AuthenticationConfiguration.create(config);
|
|
96
|
+
};
|
|
97
|
+
exports.update = function (id, config) {
|
|
98
|
+
manageIcon(config);
|
|
99
|
+
manageSettings(config);
|
|
100
|
+
return AuthenticationConfiguration.findByIdAndUpdate(id, config, { new: true }).exec();
|
|
101
|
+
};
|
|
102
|
+
exports.remove = function (id) {
|
|
103
|
+
return AuthenticationConfiguration.findByIdAndRemove(id).exec();
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=authenticationconfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticationconfiguration.js","sourceRoot":"","sources":["../../src/models/authenticationconfiguration.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,uCAAuC;AACvC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AAE/B,MAAM,iCAAiC,GAAG,IAAI,MAAM,CAClD;IACE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACtC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE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AM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SAC5D;KACF;AACH,CAAC;AAED,qDAAqD;AAErD,OAAO,CAAC,MAAM,GAAG,UAAU,MAAM;IAC/B,UAAU,CAAC,MAAM,CAAC,CAAC;IACnB,cAAc,CAAC,MAAM,CAAC,CAAC;IAEvB,OAAO,2BAA2B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,OAAO,CAAC,MAAM,GAAG,UAAU,EAAE,EAAE,MAAM;IACnC,UAAU,CAAC,MAAM,CAAC,CAAC;IACnB,cAAc,CAAC,MAAM,CAAC,CAAC;IAEvB,OAAO,2BAA2B,CAAC,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACzF,CAAC,CAAC;AAEF,OAAO,CAAC,MAAM,GAAG,UAAU,EAAE;IAC3B,OAAO,2BAA2B,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAClE,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference path="../permissions/permissions.events.d.ts" />
|
|
2
|
+
export { CappedLocation as Model };
|
|
3
|
+
export function addLocations(user: any, event: any, locations: any, callback: any): void;
|
|
4
|
+
export function getLocations(options: any, callback: any): void;
|
|
5
|
+
export function removeLocationsForUser(user: any, callback: any): void;
|
|
6
|
+
declare const CappedLocation: mongoose.Model<mongoose.Document>;
|
|
7
|
+
import mongoose = require("mongoose");
|
|
8
|
+
//# sourceMappingURL=cappedLocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cappedLocation.d.ts","sourceRoot":"","sources":["../../src/models/cappedLocation.js"],"names":[],"mappings":";;AAgDuB,yFAUtB;AAEsB,gEA4BtB;AAEgC,uEAKhC;AAlDD,gEAA8E"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const mongoose = require('mongoose'), config = require('../config.js'), Location = require('./location');
|
|
3
|
+
// Creates a new Mongoose Schema object
|
|
4
|
+
const Schema = mongoose.Schema;
|
|
5
|
+
const locationLimit = config.server.locationServices.userCollectionLocationLimit;
|
|
6
|
+
// Creates the Schema for FFT Locations
|
|
7
|
+
const CappedLocationSchema = new Schema({
|
|
8
|
+
userId: { type: Schema.Types.ObjectId, required: false, sparse: true, ref: 'User' },
|
|
9
|
+
eventId: { type: Number, required: false, sparse: true, ref: 'Event' },
|
|
10
|
+
locations: [Location.Model.schema]
|
|
11
|
+
}, {
|
|
12
|
+
versionKey: false
|
|
13
|
+
});
|
|
14
|
+
// TODO: this seems superfluous - probably remove because there's already an index on eventId in the field definition
|
|
15
|
+
CappedLocationSchema.index({ 'eventId': 1 });
|
|
16
|
+
// TODO: this seems superflous because there's already an index on properties.timestamp in LocationSchema. do child-schema indexes get created on parent collections?
|
|
17
|
+
CappedLocationSchema.index({ 'locations.properties.timestamp': 1 });
|
|
18
|
+
CappedLocationSchema.index({ 'locations.properties.timestamp': 1, 'eventId': 1 });
|
|
19
|
+
const transform = function (userLocation, ret) {
|
|
20
|
+
if ('function' !== typeof userLocation.ownerDocument) {
|
|
21
|
+
if (userLocation.populated('userId')) {
|
|
22
|
+
ret.user = userLocation.userId.toObject();
|
|
23
|
+
delete ret.user.icon;
|
|
24
|
+
}
|
|
25
|
+
delete ret._id;
|
|
26
|
+
ret.id = ret.user ? ret.user.id : userLocation.userId;
|
|
27
|
+
ret.locations = (userLocation.locations || []).reverse();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
CappedLocationSchema.set("toJSON", {
|
|
31
|
+
transform: transform
|
|
32
|
+
});
|
|
33
|
+
CappedLocationSchema.set("toObject", {
|
|
34
|
+
transform: transform
|
|
35
|
+
});
|
|
36
|
+
// Creates the Model for the User Schema
|
|
37
|
+
const CappedLocation = mongoose.model('CappedLocation', CappedLocationSchema);
|
|
38
|
+
exports.Model = CappedLocation;
|
|
39
|
+
exports.addLocations = function (user, event, locations, callback) {
|
|
40
|
+
const update = {
|
|
41
|
+
$push: {
|
|
42
|
+
locations: { $each: locations, $sort: { "properties.timestamp": 1 }, $slice: -1 * locationLimit }
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
CappedLocation.findOneAndUpdate({ userId: user._id, eventId: event._id }, update, { upsert: true, new: true }, function (err, user) {
|
|
46
|
+
callback(err, user);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
exports.getLocations = function (options, callback) {
|
|
50
|
+
let limit = options.limit;
|
|
51
|
+
limit = limit <= locationLimit ? limit : locationLimit;
|
|
52
|
+
const filter = options.filter;
|
|
53
|
+
const parameters = {};
|
|
54
|
+
if (filter.eventId)
|
|
55
|
+
parameters.eventId = filter.eventId;
|
|
56
|
+
const query = CappedLocation.find(parameters, { userId: 1, locations: { $slice: -1 * limit } });
|
|
57
|
+
// TODO take out where
|
|
58
|
+
if (filter.startDate) {
|
|
59
|
+
query.where('locations.properties.timestamp').gte(filter.startDate);
|
|
60
|
+
}
|
|
61
|
+
if (filter.endDate) {
|
|
62
|
+
query.where('locations.properties.timestamp').lt(filter.endDate);
|
|
63
|
+
}
|
|
64
|
+
if (options.populate) {
|
|
65
|
+
query.populate({
|
|
66
|
+
path: 'userId',
|
|
67
|
+
select: 'icon displayName email phones'
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
query.exec(callback);
|
|
71
|
+
};
|
|
72
|
+
exports.removeLocationsForUser = function (user, callback) {
|
|
73
|
+
const conditions = { "userId": user._id };
|
|
74
|
+
CappedLocation.remove(conditions, function (err) {
|
|
75
|
+
callback(err);
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=cappedLocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cappedLocation.js","sourceRoot":"","sources":["../../src/models/cappedLocation.js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,EAAE,UAAS,GAAG;QAC5C,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../src/models/counter.js"],"names":[],"mappings":"AAyBA,uDAIC;AAED,uEASC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
let mongoose = require('mongoose');
|
|
3
|
+
// Creates a new Mongoose Schema object
|
|
4
|
+
let Schema = mongoose.Schema;
|
|
5
|
+
// Collection to hold counters/sequences for ids
|
|
6
|
+
let CounterSchema = new Schema({
|
|
7
|
+
_id: { type: String, required: true },
|
|
8
|
+
sequence: { type: Number, required: true }
|
|
9
|
+
}, {
|
|
10
|
+
versionKey: false
|
|
11
|
+
});
|
|
12
|
+
// Creates the Model for the Attachments Schema
|
|
13
|
+
let Counter = mongoose.model('Counter', CounterSchema);
|
|
14
|
+
function range(start, end) {
|
|
15
|
+
let values = [];
|
|
16
|
+
for (var i = start; i <= end; i++) {
|
|
17
|
+
values.push(i);
|
|
18
|
+
}
|
|
19
|
+
return values;
|
|
20
|
+
}
|
|
21
|
+
function getNext(collection) {
|
|
22
|
+
return getGroup(collection, 1).then(function (ids) {
|
|
23
|
+
return Promise.resolve(ids[0]);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function getGroup(collection, amount) {
|
|
27
|
+
const query = { _id: collection };
|
|
28
|
+
const update = { $inc: { sequence: amount } };
|
|
29
|
+
const options = { upsert: true, new: true };
|
|
30
|
+
return Counter.findOneAndUpdate(query, update, options).exec().then(function (counter) {
|
|
31
|
+
const ids = range(counter.sequence, counter.sequence + amount);
|
|
32
|
+
return Promise.resolve(ids);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
exports.getNext = getNext;
|
|
36
|
+
exports.getGroup = getGroup;
|
|
37
|
+
//# sourceMappingURL=counter.js.map
|
|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