@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.
Files changed (869) hide show
  1. package/bin/mage.service.js +230 -0
  2. package/bin/migration.js +60 -0
  3. package/bin/poststop.sh +1 -0
  4. package/bin/prestart.sh +1 -0
  5. package/lib/@types/express/index.d.ts +18 -0
  6. package/lib/@types/geojson-validation/index.d.ts +15 -0
  7. package/lib/@types/mongodb-migrations/index.d.ts +99 -0
  8. package/lib/access/index.d.ts +21 -0
  9. package/lib/access/index.d.ts.map +1 -0
  10. package/lib/access/index.js +40 -0
  11. package/lib/access/index.js.map +1 -0
  12. package/lib/adapters/adapters.controllers.web.d.ts +22 -0
  13. package/lib/adapters/adapters.controllers.web.d.ts.map +1 -0
  14. package/lib/adapters/adapters.controllers.web.js +55 -0
  15. package/lib/adapters/adapters.controllers.web.js.map +1 -0
  16. package/lib/adapters/adapters.db.mongoose.d.ts +5 -0
  17. package/lib/adapters/adapters.db.mongoose.d.ts.map +1 -0
  18. package/lib/adapters/adapters.db.mongoose.js +70 -0
  19. package/lib/adapters/adapters.db.mongoose.js.map +1 -0
  20. package/lib/adapters/adapters.simple_id_factory.d.ts +5 -0
  21. package/lib/adapters/adapters.simple_id_factory.d.ts.map +1 -0
  22. package/lib/adapters/adapters.simple_id_factory.js +24 -0
  23. package/lib/adapters/adapters.simple_id_factory.js.map +1 -0
  24. package/lib/adapters/base/adapters.base.db.mongoose.d.ts +59 -0
  25. package/lib/adapters/base/adapters.base.db.mongoose.d.ts.map +1 -0
  26. package/lib/adapters/base/adapters.base.db.mongoose.js +143 -0
  27. package/lib/adapters/base/adapters.base.db.mongoose.js.map +1 -0
  28. package/lib/adapters/events/adapters.events.controllers.web.d.ts +14 -0
  29. package/lib/adapters/events/adapters.events.controllers.web.d.ts.map +1 -0
  30. package/lib/adapters/events/adapters.events.controllers.web.js +83 -0
  31. package/lib/adapters/events/adapters.events.controllers.web.js.map +1 -0
  32. package/lib/adapters/events/adapters.events.db.mongoose.d.ts +27 -0
  33. package/lib/adapters/events/adapters.events.db.mongoose.d.ts.map +1 -0
  34. package/lib/adapters/events/adapters.events.db.mongoose.js +127 -0
  35. package/lib/adapters/events/adapters.events.db.mongoose.js.map +1 -0
  36. package/lib/adapters/feeds/adapters.feeds.controllers.web.d.ts +25 -0
  37. package/lib/adapters/feeds/adapters.feeds.controllers.web.d.ts.map +1 -0
  38. package/lib/adapters/feeds/adapters.feeds.controllers.web.js +234 -0
  39. package/lib/adapters/feeds/adapters.feeds.controllers.web.js.map +1 -0
  40. package/lib/adapters/feeds/adapters.feeds.db.mongoose.d.ts +63 -0
  41. package/lib/adapters/feeds/adapters.feeds.db.mongoose.d.ts.map +1 -0
  42. package/lib/adapters/feeds/adapters.feeds.db.mongoose.js +199 -0
  43. package/lib/adapters/feeds/adapters.feeds.db.mongoose.js.map +1 -0
  44. package/lib/adapters/icons/adapters.icons.content_store.file_system.d.ts +7 -0
  45. package/lib/adapters/icons/adapters.icons.content_store.file_system.d.ts.map +1 -0
  46. package/lib/adapters/icons/adapters.icons.content_store.file_system.js +13 -0
  47. package/lib/adapters/icons/adapters.icons.content_store.file_system.js.map +1 -0
  48. package/lib/adapters/icons/adapters.icons.controllers.web.d.ts +10 -0
  49. package/lib/adapters/icons/adapters.icons.controllers.web.d.ts.map +1 -0
  50. package/lib/adapters/icons/adapters.icons.controllers.web.js +118 -0
  51. package/lib/adapters/icons/adapters.icons.controllers.web.js.map +1 -0
  52. package/lib/adapters/icons/adapters.icons.db.mongoose.d.ts +38 -0
  53. package/lib/adapters/icons/adapters.icons.db.mongoose.d.ts.map +1 -0
  54. package/lib/adapters/icons/adapters.icons.db.mongoose.js +287 -0
  55. package/lib/adapters/icons/adapters.icons.db.mongoose.js.map +1 -0
  56. package/lib/adapters/observations/adapters.observations.attachment_store.file_system.d.ts +29 -0
  57. package/lib/adapters/observations/adapters.observations.attachment_store.file_system.d.ts.map +1 -0
  58. package/lib/adapters/observations/adapters.observations.attachment_store.file_system.js +274 -0
  59. package/lib/adapters/observations/adapters.observations.attachment_store.file_system.js.map +1 -0
  60. package/lib/adapters/observations/adapters.observations.controllers.web.d.ts +40 -0
  61. package/lib/adapters/observations/adapters.observations.controllers.web.d.ts.map +1 -0
  62. package/lib/adapters/observations/adapters.observations.controllers.web.js +196 -0
  63. package/lib/adapters/observations/adapters.observations.controllers.web.js.map +1 -0
  64. package/lib/adapters/observations/adapters.observations.db.mongoose.d.ts +30 -0
  65. package/lib/adapters/observations/adapters.observations.db.mongoose.d.ts.map +1 -0
  66. package/lib/adapters/observations/adapters.observations.db.mongoose.js +294 -0
  67. package/lib/adapters/observations/adapters.observations.db.mongoose.js.map +1 -0
  68. package/lib/adapters/plugins/adapters.plugins.db.mongoose.d.ts +17 -0
  69. package/lib/adapters/plugins/adapters.plugins.db.mongoose.d.ts.map +1 -0
  70. package/lib/adapters/plugins/adapters.plugins.db.mongoose.js +59 -0
  71. package/lib/adapters/plugins/adapters.plugins.db.mongoose.js.map +1 -0
  72. package/lib/adapters/url_schemes/adapters.url_schemes.plugin.d.ts +38 -0
  73. package/lib/adapters/url_schemes/adapters.url_schemes.plugin.d.ts.map +1 -0
  74. package/lib/adapters/url_schemes/adapters.url_schemes.plugin.js +110 -0
  75. package/lib/adapters/url_schemes/adapters.url_schemes.plugin.js.map +1 -0
  76. package/lib/adapters/users/adapters.users.controllers.web.d.ts +7 -0
  77. package/lib/adapters/users/adapters.users.controllers.web.d.ts.map +1 -0
  78. package/lib/adapters/users/adapters.users.controllers.web.js +37 -0
  79. package/lib/adapters/users/adapters.users.controllers.web.js.map +1 -0
  80. package/lib/adapters/users/adapters.users.db.mongoose.d.ts +19 -0
  81. package/lib/adapters/users/adapters.users.db.mongoose.d.ts.map +1 -0
  82. package/lib/adapters/users/adapters.users.db.mongoose.js +126 -0
  83. package/lib/adapters/users/adapters.users.db.mongoose.js.map +1 -0
  84. package/lib/adapters/web_ui_plugins/adapters.web_ui_plugins.controllers.web.d.ts +3 -0
  85. package/lib/adapters/web_ui_plugins/adapters.web_ui_plugins.controllers.web.d.ts.map +1 -0
  86. package/lib/adapters/web_ui_plugins/adapters.web_ui_plugins.controllers.web.js +53 -0
  87. package/lib/adapters/web_ui_plugins/adapters.web_ui_plugins.controllers.web.js.map +1 -0
  88. package/lib/api/attachment.d.ts +12 -0
  89. package/lib/api/attachment.d.ts.map +1 -0
  90. package/lib/api/attachment.js +81 -0
  91. package/lib/api/attachment.js.map +1 -0
  92. package/lib/api/event.d.ts +20 -0
  93. package/lib/api/event.d.ts.map +1 -0
  94. package/lib/api/event.js +185 -0
  95. package/lib/api/event.js.map +1 -0
  96. package/lib/api/events/location.d.ts +11 -0
  97. package/lib/api/events/location.d.ts.map +1 -0
  98. package/lib/api/events/location.js +13 -0
  99. package/lib/api/events/location.js.map +1 -0
  100. package/lib/api/events/observation.d.ts +15 -0
  101. package/lib/api/events/observation.d.ts.map +1 -0
  102. package/lib/api/events/observation.js +21 -0
  103. package/lib/api/events/observation.js.map +1 -0
  104. package/lib/api/feature.d.ts +8 -0
  105. package/lib/api/feature.d.ts.map +1 -0
  106. package/lib/api/feature.js +15 -0
  107. package/lib/api/feature.js.map +1 -0
  108. package/lib/api/field/attachmentField.d.ts +12 -0
  109. package/lib/api/field/attachmentField.d.ts.map +1 -0
  110. package/lib/api/field/attachmentField.js +40 -0
  111. package/lib/api/field/attachmentField.js.map +1 -0
  112. package/lib/api/field/checkboxField.d.ts +7 -0
  113. package/lib/api/field/checkboxField.d.ts.map +1 -0
  114. package/lib/api/field/checkboxField.js +19 -0
  115. package/lib/api/field/checkboxField.js.map +1 -0
  116. package/lib/api/field/dateField.d.ts +8 -0
  117. package/lib/api/field/dateField.d.ts.map +1 -0
  118. package/lib/api/field/dateField.js +21 -0
  119. package/lib/api/field/dateField.js.map +1 -0
  120. package/lib/api/field/emailField.d.ts +7 -0
  121. package/lib/api/field/emailField.d.ts.map +1 -0
  122. package/lib/api/field/emailField.js +19 -0
  123. package/lib/api/field/emailField.js.map +1 -0
  124. package/lib/api/field/field.d.ts +12 -0
  125. package/lib/api/field/field.d.ts.map +1 -0
  126. package/lib/api/field/field.js +12 -0
  127. package/lib/api/field/field.js.map +1 -0
  128. package/lib/api/field/geometryField.d.ts +7 -0
  129. package/lib/api/field/geometryField.d.ts.map +1 -0
  130. package/lib/api/field/geometryField.js +35 -0
  131. package/lib/api/field/geometryField.js.map +1 -0
  132. package/lib/api/field/index.d.ts +7 -0
  133. package/lib/api/field/index.d.ts.map +1 -0
  134. package/lib/api/field/index.js +30 -0
  135. package/lib/api/field/index.js.map +1 -0
  136. package/lib/api/field/multiSelectField.d.ts +7 -0
  137. package/lib/api/field/multiSelectField.d.ts.map +1 -0
  138. package/lib/api/field/multiSelectField.js +27 -0
  139. package/lib/api/field/multiSelectField.js.map +1 -0
  140. package/lib/api/field/numberField.d.ts +7 -0
  141. package/lib/api/field/numberField.d.ts.map +1 -0
  142. package/lib/api/field/numberField.js +27 -0
  143. package/lib/api/field/numberField.js.map +1 -0
  144. package/lib/api/field/selectField.d.ts +7 -0
  145. package/lib/api/field/selectField.d.ts.map +1 -0
  146. package/lib/api/field/selectField.js +22 -0
  147. package/lib/api/field/selectField.js.map +1 -0
  148. package/lib/api/field/textField.d.ts +7 -0
  149. package/lib/api/field/textField.d.ts.map +1 -0
  150. package/lib/api/field/textField.js +21 -0
  151. package/lib/api/field/textField.js.map +1 -0
  152. package/lib/api/form.d.ts +12 -0
  153. package/lib/api/form.d.ts.map +1 -0
  154. package/lib/api/form.js +239 -0
  155. package/lib/api/form.js.map +1 -0
  156. package/lib/api/icon.d.ts +22 -0
  157. package/lib/api/icon.d.ts.map +1 -0
  158. package/lib/api/icon.js +178 -0
  159. package/lib/api/icon.js.map +1 -0
  160. package/lib/api/index.d.ts +10 -0
  161. package/lib/api/index.d.ts.map +1 -0
  162. package/lib/api/index.js +11 -0
  163. package/lib/api/index.js.map +1 -0
  164. package/lib/api/layer.d.ts +14 -0
  165. package/lib/api/layer.d.ts.map +1 -0
  166. package/lib/api/layer.js +70 -0
  167. package/lib/api/layer.js.map +1 -0
  168. package/lib/api/location.d.ts +14 -0
  169. package/lib/api/location.d.ts.map +1 -0
  170. package/lib/api/location.js +35 -0
  171. package/lib/api/location.js.map +1 -0
  172. package/lib/api/observation.d.ts +25 -0
  173. package/lib/api/observation.d.ts.map +1 -0
  174. package/lib/api/observation.js +224 -0
  175. package/lib/api/observation.js.map +1 -0
  176. package/lib/api/user.d.ts +16 -0
  177. package/lib/api/user.d.ts.map +1 -0
  178. package/lib/api/user.js +250 -0
  179. package/lib/api/user.js.map +1 -0
  180. package/lib/app.api/app.api.errors.d.ts +42 -0
  181. package/lib/app.api/app.api.errors.d.ts.map +1 -0
  182. package/lib/app.api/app.api.errors.js +43 -0
  183. package/lib/app.api/app.api.errors.js.map +1 -0
  184. package/lib/app.api/app.api.global.d.ts +74 -0
  185. package/lib/app.api/app.api.global.d.ts.map +1 -0
  186. package/lib/app.api/app.api.global.js +59 -0
  187. package/lib/app.api/app.api.global.js.map +1 -0
  188. package/lib/app.api/events/app.api.events.d.ts +31 -0
  189. package/lib/app.api/events/app.api.events.d.ts.map +1 -0
  190. package/lib/app.api/events/app.api.events.js +3 -0
  191. package/lib/app.api/events/app.api.events.js.map +1 -0
  192. package/lib/app.api/feeds/app.api.feeds.d.ts +139 -0
  193. package/lib/app.api/feeds/app.api.feeds.d.ts.map +1 -0
  194. package/lib/app.api/feeds/app.api.feeds.js +26 -0
  195. package/lib/app.api/feeds/app.api.feeds.js.map +1 -0
  196. package/lib/app.api/icons/app.api.icons.d.ts +60 -0
  197. package/lib/app.api/icons/app.api.icons.d.ts.map +1 -0
  198. package/lib/app.api/icons/app.api.icons.js +29 -0
  199. package/lib/app.api/icons/app.api.icons.js.map +1 -0
  200. package/lib/app.api/observations/app.api.observations.d.ts +126 -0
  201. package/lib/app.api/observations/app.api.observations.d.ts.map +1 -0
  202. package/lib/app.api/observations/app.api.observations.js +61 -0
  203. package/lib/app.api/observations/app.api.observations.js.map +1 -0
  204. package/lib/app.api/users/app.api.users.d.ts +24 -0
  205. package/lib/app.api/users/app.api.users.d.ts.map +1 -0
  206. package/lib/app.api/users/app.api.users.js +3 -0
  207. package/lib/app.api/users/app.api.users.js.map +1 -0
  208. package/lib/app.d.ts +38 -0
  209. package/lib/app.d.ts.map +1 -0
  210. package/lib/app.impl/events/app.impl.events.d.ts +8 -0
  211. package/lib/app.impl/events/app.impl.events.d.ts.map +1 -0
  212. package/lib/app.impl/events/app.impl.events.js +107 -0
  213. package/lib/app.impl/events/app.impl.events.js.map +1 -0
  214. package/lib/app.impl/feeds/app.impl.feeds.d.ts +21 -0
  215. package/lib/app.impl/feeds/app.impl.feeds.d.ts.map +1 -0
  216. package/lib/app.impl/feeds/app.impl.feeds.js +527 -0
  217. package/lib/app.impl/feeds/app.impl.feeds.js.map +1 -0
  218. package/lib/app.impl/icons/app.impl.icons.d.ts +7 -0
  219. package/lib/app.impl/icons/app.impl.icons.d.ts.map +1 -0
  220. package/lib/app.impl/icons/app.impl.icons.js +81 -0
  221. package/lib/app.impl/icons/app.impl.icons.js.map +1 -0
  222. package/lib/app.impl/observations/app.impl.observations.d.ts +11 -0
  223. package/lib/app.impl/observations/app.impl.observations.d.ts.map +1 -0
  224. package/lib/app.impl/observations/app.impl.observations.js +357 -0
  225. package/lib/app.impl/observations/app.impl.observations.js.map +1 -0
  226. package/lib/app.impl/users/app.impl.users.d.ts +4 -0
  227. package/lib/app.impl/users/app.impl.users.d.ts.map +1 -0
  228. package/lib/app.impl/users/app.impl.users.js +37 -0
  229. package/lib/app.impl/users/app.impl.users.js.map +1 -0
  230. package/lib/app.js +507 -0
  231. package/lib/app.js.map +1 -0
  232. package/lib/assets/default-icon.png +0 -0
  233. package/lib/authentication/anonymous.d.ts +6 -0
  234. package/lib/authentication/anonymous.d.ts.map +1 -0
  235. package/lib/authentication/anonymous.js +17 -0
  236. package/lib/authentication/anonymous.js.map +1 -0
  237. package/lib/authentication/index.d.ts +24 -0
  238. package/lib/authentication/index.d.ts.map +1 -0
  239. package/lib/authentication/index.js +104 -0
  240. package/lib/authentication/index.js.map +1 -0
  241. package/lib/authentication/ldap.d.ts +2 -0
  242. package/lib/authentication/ldap.d.ts.map +1 -0
  243. package/lib/authentication/ldap.js +130 -0
  244. package/lib/authentication/ldap.js.map +1 -0
  245. package/lib/authentication/local.d.ts +2 -0
  246. package/lib/authentication/local.d.ts.map +1 -0
  247. package/lib/authentication/local.js +77 -0
  248. package/lib/authentication/local.js.map +1 -0
  249. package/lib/authentication/oauth.d.ts +2 -0
  250. package/lib/authentication/oauth.d.ts.map +1 -0
  251. package/lib/authentication/oauth.js +197 -0
  252. package/lib/authentication/oauth.js.map +1 -0
  253. package/lib/authentication/openidconnect.d.ts +2 -0
  254. package/lib/authentication/openidconnect.d.ts.map +1 -0
  255. package/lib/authentication/openidconnect.js +148 -0
  256. package/lib/authentication/openidconnect.js.map +1 -0
  257. package/lib/authentication/saml.d.ts +2 -0
  258. package/lib/authentication/saml.d.ts.map +1 -0
  259. package/lib/authentication/saml.js +287 -0
  260. package/lib/authentication/saml.js.map +1 -0
  261. package/lib/authentication/verification.d.ts +33 -0
  262. package/lib/authentication/verification.d.ts.map +1 -0
  263. package/lib/authentication/verification.js +144 -0
  264. package/lib/authentication/verification.js.map +1 -0
  265. package/lib/config.d.ts +15 -0
  266. package/lib/config.d.ts.map +1 -0
  267. package/lib/config.js +20 -0
  268. package/lib/config.js.map +1 -0
  269. package/lib/dist-package.json +203 -0
  270. package/lib/docs/auth/local.yaml +90 -0
  271. package/lib/docs/geojson.yaml +375 -0
  272. package/lib/docs/openapi.yaml +4591 -0
  273. package/lib/entities/authentication/entities.authentication.d.ts +14 -0
  274. package/lib/entities/authentication/entities.authentication.d.ts.map +1 -0
  275. package/lib/entities/authentication/entities.authentication.js +3 -0
  276. package/lib/entities/authentication/entities.authentication.js.map +1 -0
  277. package/lib/entities/authorization/entities.authorization.d.ts +7 -0
  278. package/lib/entities/authorization/entities.authorization.d.ts.map +1 -0
  279. package/lib/entities/authorization/entities.authorization.js +3 -0
  280. package/lib/entities/authorization/entities.authorization.js.map +1 -0
  281. package/lib/entities/authorization/entities.permissions.d.ts +143 -0
  282. package/lib/entities/authorization/entities.permissions.d.ts.map +1 -0
  283. package/lib/entities/authorization/entities.permissions.js +101 -0
  284. package/lib/entities/authorization/entities.permissions.js.map +1 -0
  285. package/lib/entities/entities.domain_events.d.ts +1 -0
  286. package/lib/entities/entities.domain_events.d.ts.map +1 -0
  287. package/lib/entities/entities.domain_events.js +20 -0
  288. package/lib/entities/entities.domain_events.js.map +1 -0
  289. package/lib/entities/entities.global.d.ts +107 -0
  290. package/lib/entities/entities.global.d.ts.map +1 -0
  291. package/lib/entities/entities.global.js +67 -0
  292. package/lib/entities/entities.global.js.map +1 -0
  293. package/lib/entities/entities.i18n.d.ts +78 -0
  294. package/lib/entities/entities.i18n.d.ts.map +1 -0
  295. package/lib/entities/entities.i18n.js +69 -0
  296. package/lib/entities/entities.i18n.js.map +1 -0
  297. package/lib/entities/entities.json_types.d.ts +42 -0
  298. package/lib/entities/entities.json_types.d.ts.map +1 -0
  299. package/lib/entities/entities.json_types.js +3 -0
  300. package/lib/entities/entities.json_types.js.map +1 -0
  301. package/lib/entities/events/entities.events.d.ts +118 -0
  302. package/lib/entities/events/entities.events.d.ts.map +1 -0
  303. package/lib/entities/events/entities.events.forms.d.ts +132 -0
  304. package/lib/entities/events/entities.events.forms.d.ts.map +1 -0
  305. package/lib/entities/events/entities.events.forms.js +102 -0
  306. package/lib/entities/events/entities.events.forms.js.map +1 -0
  307. package/lib/entities/events/entities.events.js +146 -0
  308. package/lib/entities/events/entities.events.js.map +1 -0
  309. package/lib/entities/feeds/entities.feeds.d.ts +340 -0
  310. package/lib/entities/feeds/entities.feeds.d.ts.map +1 -0
  311. package/lib/entities/feeds/entities.feeds.js +213 -0
  312. package/lib/entities/feeds/entities.feeds.js.map +1 -0
  313. package/lib/entities/icons/entities.icons.d.ts +106 -0
  314. package/lib/entities/icons/entities.icons.d.ts.map +1 -0
  315. package/lib/entities/icons/entities.icons.js +26 -0
  316. package/lib/entities/icons/entities.icons.js.map +1 -0
  317. package/lib/entities/observations/entities.observations.d.ts +569 -0
  318. package/lib/entities/observations/entities.observations.d.ts.map +1 -0
  319. package/lib/entities/observations/entities.observations.fields.attachment.d.ts +5 -0
  320. package/lib/entities/observations/entities.observations.fields.attachment.d.ts.map +1 -0
  321. package/lib/entities/observations/entities.observations.fields.attachment.js +24 -0
  322. package/lib/entities/observations/entities.observations.fields.attachment.js.map +1 -0
  323. package/lib/entities/observations/entities.observations.fields.checkbox.d.ts +3 -0
  324. package/lib/entities/observations/entities.observations.fields.checkbox.d.ts.map +1 -0
  325. package/lib/entities/observations/entities.observations.fields.checkbox.js +17 -0
  326. package/lib/entities/observations/entities.observations.fields.checkbox.js.map +1 -0
  327. package/lib/entities/observations/entities.observations.fields.d.ts +20 -0
  328. package/lib/entities/observations/entities.observations.fields.d.ts.map +1 -0
  329. package/lib/entities/observations/entities.observations.fields.date.d.ts +3 -0
  330. package/lib/entities/observations/entities.observations.fields.date.d.ts.map +1 -0
  331. package/lib/entities/observations/entities.observations.fields.date.js +21 -0
  332. package/lib/entities/observations/entities.observations.fields.date.js.map +1 -0
  333. package/lib/entities/observations/entities.observations.fields.email.d.ts +3 -0
  334. package/lib/entities/observations/entities.observations.fields.email.d.ts.map +1 -0
  335. package/lib/entities/observations/entities.observations.fields.email.js +20 -0
  336. package/lib/entities/observations/entities.observations.fields.email.js.map +1 -0
  337. package/lib/entities/observations/entities.observations.fields.geometry.d.ts +3 -0
  338. package/lib/entities/observations/entities.observations.fields.geometry.d.ts.map +1 -0
  339. package/lib/entities/observations/entities.observations.fields.geometry.js +62 -0
  340. package/lib/entities/observations/entities.observations.fields.geometry.js.map +1 -0
  341. package/lib/entities/observations/entities.observations.fields.js +37 -0
  342. package/lib/entities/observations/entities.observations.fields.js.map +1 -0
  343. package/lib/entities/observations/entities.observations.fields.multiselect.d.ts +3 -0
  344. package/lib/entities/observations/entities.observations.fields.multiselect.d.ts.map +1 -0
  345. package/lib/entities/observations/entities.observations.fields.multiselect.js +24 -0
  346. package/lib/entities/observations/entities.observations.fields.multiselect.js.map +1 -0
  347. package/lib/entities/observations/entities.observations.fields.numeric.d.ts +3 -0
  348. package/lib/entities/observations/entities.observations.fields.numeric.d.ts.map +1 -0
  349. package/lib/entities/observations/entities.observations.fields.numeric.js +24 -0
  350. package/lib/entities/observations/entities.observations.fields.numeric.js.map +1 -0
  351. package/lib/entities/observations/entities.observations.fields.required.d.ts +3 -0
  352. package/lib/entities/observations/entities.observations.fields.required.d.ts.map +1 -0
  353. package/lib/entities/observations/entities.observations.fields.required.js +14 -0
  354. package/lib/entities/observations/entities.observations.fields.required.js.map +1 -0
  355. package/lib/entities/observations/entities.observations.fields.select.d.ts +3 -0
  356. package/lib/entities/observations/entities.observations.fields.select.d.ts.map +1 -0
  357. package/lib/entities/observations/entities.observations.fields.select.js +17 -0
  358. package/lib/entities/observations/entities.observations.fields.select.js.map +1 -0
  359. package/lib/entities/observations/entities.observations.fields.text.d.ts +3 -0
  360. package/lib/entities/observations/entities.observations.fields.text.d.ts.map +1 -0
  361. package/lib/entities/observations/entities.observations.fields.text.js +15 -0
  362. package/lib/entities/observations/entities.observations.fields.text.js.map +1 -0
  363. package/lib/entities/observations/entities.observations.js +873 -0
  364. package/lib/entities/observations/entities.observations.js.map +1 -0
  365. package/lib/entities/ogcapi-features/entities.ogcapi-features.d.ts +98 -0
  366. package/lib/entities/ogcapi-features/entities.ogcapi-features.d.ts.map +1 -0
  367. package/lib/entities/ogcapi-features/entities.ogcapi-features.js +30 -0
  368. package/lib/entities/ogcapi-features/entities.ogcapi-features.js.map +1 -0
  369. package/lib/entities/teams/entities.teams.d.ts +26 -0
  370. package/lib/entities/teams/entities.teams.d.ts.map +1 -0
  371. package/lib/entities/teams/entities.teams.js +3 -0
  372. package/lib/entities/teams/entities.teams.js.map +1 -0
  373. package/lib/entities/users/entities.users.d.ts +66 -0
  374. package/lib/entities/users/entities.users.d.ts.map +1 -0
  375. package/lib/entities/users/entities.users.js +10 -0
  376. package/lib/entities/users/entities.users.js.map +1 -0
  377. package/lib/environment/env.d.ts +29 -0
  378. package/lib/environment/env.d.ts.map +1 -0
  379. package/lib/environment/env.js +106 -0
  380. package/lib/environment/env.js.map +1 -0
  381. package/lib/export/csv.d.ts +11 -0
  382. package/lib/export/csv.d.ts.map +1 -0
  383. package/lib/export/csv.js +243 -0
  384. package/lib/export/csv.js.map +1 -0
  385. package/lib/export/exporter.d.ts +12 -0
  386. package/lib/export/exporter.d.ts.map +1 -0
  387. package/lib/export/exporter.js +38 -0
  388. package/lib/export/exporter.js.map +1 -0
  389. package/lib/export/exporterFactory.d.ts +11 -0
  390. package/lib/export/exporterFactory.d.ts.map +1 -0
  391. package/lib/export/exporterFactory.js +17 -0
  392. package/lib/export/exporterFactory.js.map +1 -0
  393. package/lib/export/geojson.d.ts +10 -0
  394. package/lib/export/geojson.d.ts.map +1 -0
  395. package/lib/export/geojson.js +167 -0
  396. package/lib/export/geojson.js.map +1 -0
  397. package/lib/export/geopackage.d.ts +25 -0
  398. package/lib/export/geopackage.d.ts.map +1 -0
  399. package/lib/export/geopackage.js +687 -0
  400. package/lib/export/geopackage.js.map +1 -0
  401. package/lib/export/kml.d.ts +10 -0
  402. package/lib/export/kml.d.ts.map +1 -0
  403. package/lib/export/kml.js +128 -0
  404. package/lib/export/kml.js.map +1 -0
  405. package/lib/export/kmlWriter.d.ts +24 -0
  406. package/lib/export/kmlWriter.d.ts.map +1 -0
  407. package/lib/export/kmlWriter.js +431 -0
  408. package/lib/export/kmlWriter.js.map +1 -0
  409. package/lib/express.d.ts +9 -0
  410. package/lib/express.d.ts.map +1 -0
  411. package/lib/express.js +70 -0
  412. package/lib/express.js.map +1 -0
  413. package/lib/format/geoJsonFormat.d.ts +3 -0
  414. package/lib/format/geoJsonFormat.d.ts.map +1 -0
  415. package/lib/format/geoJsonFormat.js +65 -0
  416. package/lib/format/geoJsonFormat.js.map +1 -0
  417. package/lib/logger.d.ts +2 -0
  418. package/lib/logger.d.ts.map +1 -0
  419. package/lib/logger.js +21 -0
  420. package/lib/logger.js.map +1 -0
  421. package/lib/main.impl/main.impl.plugins.d.ts +12 -0
  422. package/lib/main.impl/main.impl.plugins.d.ts.map +1 -0
  423. package/lib/main.impl/main.impl.plugins.js +41 -0
  424. package/lib/main.impl/main.impl.plugins.js.map +1 -0
  425. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.events.d.ts +3 -0
  426. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.events.d.ts.map +1 -0
  427. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.events.js +32 -0
  428. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.events.js.map +1 -0
  429. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.feeds.d.ts +4 -0
  430. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.feeds.d.ts.map +1 -0
  431. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.feeds.js +26 -0
  432. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.feeds.js.map +1 -0
  433. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.icons.d.ts +4 -0
  434. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.icons.d.ts.map +1 -0
  435. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.icons.js +41 -0
  436. package/lib/main.impl/plugin_hooks/main.impl.plugin_hooks.icons.js.map +1 -0
  437. package/lib/migrate.d.ts +4 -0
  438. package/lib/migrate.d.ts.map +1 -0
  439. package/lib/migrate.js +96 -0
  440. package/lib/migrate.js.map +1 -0
  441. package/lib/migrations/002-create-user-role.d.ts +4 -0
  442. package/lib/migrations/002-create-user-role.d.ts.map +1 -0
  443. package/lib/migrations/002-create-user-role.js +30 -0
  444. package/lib/migrations/002-create-user-role.js.map +1 -0
  445. package/lib/migrations/003-create-admin-role.d.ts +4 -0
  446. package/lib/migrations/003-create-admin-role.d.ts.map +1 -0
  447. package/lib/migrations/003-create-admin-role.js +31 -0
  448. package/lib/migrations/003-create-admin-role.js.map +1 -0
  449. package/lib/migrations/005-create-osm-layer.d.ts +4 -0
  450. package/lib/migrations/005-create-osm-layer.d.ts.map +1 -0
  451. package/lib/migrations/005-create-osm-layer.js +51 -0
  452. package/lib/migrations/005-create-osm-layer.js.map +1 -0
  453. package/lib/migrations/006-event-teams.d.ts +4 -0
  454. package/lib/migrations/006-event-teams.d.ts.map +1 -0
  455. package/lib/migrations/006-event-teams.js +40 -0
  456. package/lib/migrations/006-event-teams.js.map +1 -0
  457. package/lib/migrations/007-user-icon.d.ts +4 -0
  458. package/lib/migrations/007-user-icon.d.ts.map +1 -0
  459. package/lib/migrations/007-user-icon.js +21 -0
  460. package/lib/migrations/007-user-icon.js.map +1 -0
  461. package/lib/migrations/008-create-user-no-edit-role.d.ts +4 -0
  462. package/lib/migrations/008-create-user-no-edit-role.d.ts.map +1 -0
  463. package/lib/migrations/008-create-user-no-edit-role.js +34 -0
  464. package/lib/migrations/008-create-user-no-edit-role.js.map +1 -0
  465. package/lib/migrations/009-create-manager-role.d.ts +4 -0
  466. package/lib/migrations/009-create-manager-role.d.ts.map +1 -0
  467. package/lib/migrations/009-create-manager-role.js +50 -0
  468. package/lib/migrations/009-create-manager-role.js.map +1 -0
  469. package/lib/migrations/010-add-user-device-manager-role.d.ts +4 -0
  470. package/lib/migrations/010-add-user-device-manager-role.d.ts.map +1 -0
  471. package/lib/migrations/010-add-user-device-manager-role.js +38 -0
  472. package/lib/migrations/010-add-user-device-manager-role.js.map +1 -0
  473. package/lib/migrations/011-multiple-forms.d.ts +4 -0
  474. package/lib/migrations/011-multiple-forms.d.ts.map +1 -0
  475. package/lib/migrations/011-multiple-forms.js +161 -0
  476. package/lib/migrations/011-multiple-forms.js.map +1 -0
  477. package/lib/migrations/012-user-role-remove-delete.d.ts +4 -0
  478. package/lib/migrations/012-user-role-remove-delete.d.ts.map +1 -0
  479. package/lib/migrations/012-user-role-remove-delete.js +15 -0
  480. package/lib/migrations/012-user-role-remove-delete.js.map +1 -0
  481. package/lib/migrations/013-ensure-event-indexes.d.ts +4 -0
  482. package/lib/migrations/013-ensure-event-indexes.d.ts.map +1 -0
  483. package/lib/migrations/013-ensure-event-indexes.js +50 -0
  484. package/lib/migrations/013-ensure-event-indexes.js.map +1 -0
  485. package/lib/migrations/014-add-role-update-permission.d.ts +4 -0
  486. package/lib/migrations/014-add-role-update-permission.d.ts.map +1 -0
  487. package/lib/migrations/014-add-role-update-permission.js +15 -0
  488. package/lib/migrations/014-add-role-update-permission.js.map +1 -0
  489. package/lib/migrations/015-manager-role-add-user-create.d.ts +4 -0
  490. package/lib/migrations/015-manager-role-add-user-create.d.ts.map +1 -0
  491. package/lib/migrations/015-manager-role-add-user-create.js +15 -0
  492. package/lib/migrations/015-manager-role-add-user-create.js.map +1 -0
  493. package/lib/migrations/016-set-feed-primary-secondary.d.ts +4 -0
  494. package/lib/migrations/016-set-feed-primary-secondary.d.ts.map +1 -0
  495. package/lib/migrations/016-set-feed-primary-secondary.js +36 -0
  496. package/lib/migrations/016-set-feed-primary-secondary.js.map +1 -0
  497. package/lib/migrations/017-make-layers-available.d.ts +4 -0
  498. package/lib/migrations/017-make-layers-available.d.ts.map +1 -0
  499. package/lib/migrations/017-make-layers-available.js +48 -0
  500. package/lib/migrations/017-make-layers-available.js.map +1 -0
  501. package/lib/migrations/018-feeds-admin-permissions.d.ts +4 -0
  502. package/lib/migrations/018-feeds-admin-permissions.d.ts.map +1 -0
  503. package/lib/migrations/018-feeds-admin-permissions.js +32 -0
  504. package/lib/migrations/018-feeds-admin-permissions.js.map +1 -0
  505. package/lib/migrations/018-set-default-password-policy.d.ts +4 -0
  506. package/lib/migrations/018-set-default-password-policy.d.ts.map +1 -0
  507. package/lib/migrations/018-set-default-password-policy.js +58 -0
  508. package/lib/migrations/018-set-default-password-policy.js.map +1 -0
  509. package/lib/migrations/019-move-user-authentication.d.ts +4 -0
  510. package/lib/migrations/019-move-user-authentication.d.ts.map +1 -0
  511. package/lib/migrations/019-move-user-authentication.js +68 -0
  512. package/lib/migrations/019-move-user-authentication.js.map +1 -0
  513. package/lib/migrations/020-add-export-permissions.d.ts +4 -0
  514. package/lib/migrations/020-add-export-permissions.d.ts.map +1 -0
  515. package/lib/migrations/020-add-export-permissions.js +36 -0
  516. package/lib/migrations/020-add-export-permissions.js.map +1 -0
  517. package/lib/migrations/022-copy-auth-from-config-to-db.d.ts +4 -0
  518. package/lib/migrations/022-copy-auth-from-config-to-db.d.ts.map +1 -0
  519. package/lib/migrations/022-copy-auth-from-config-to-db.js +86 -0
  520. package/lib/migrations/022-copy-auth-from-config-to-db.js.map +1 -0
  521. package/lib/migrations/023-move-local-auth-from-settings.d.ts +4 -0
  522. package/lib/migrations/023-move-local-auth-from-settings.d.ts.map +1 -0
  523. package/lib/migrations/023-move-local-auth-from-settings.js +54 -0
  524. package/lib/migrations/023-move-local-auth-from-settings.js.map +1 -0
  525. package/lib/migrations/024-link-auth-to-auth-config.d.ts +4 -0
  526. package/lib/migrations/024-link-auth-to-auth-config.d.ts.map +1 -0
  527. package/lib/migrations/024-link-auth-to-auth-config.js +59 -0
  528. package/lib/migrations/024-link-auth-to-auth-config.js.map +1 -0
  529. package/lib/migrations/025-add-auth-config-permissions.d.ts +4 -0
  530. package/lib/migrations/025-add-auth-config-permissions.d.ts.map +1 -0
  531. package/lib/migrations/025-add-auth-config-permissions.js +32 -0
  532. package/lib/migrations/025-add-auth-config-permissions.js.map +1 -0
  533. package/lib/migrations/028-move-security-settings-to-secret-store.d.ts +4 -0
  534. package/lib/migrations/028-move-security-settings-to-secret-store.d.ts.map +1 -0
  535. package/lib/migrations/028-move-security-settings-to-secret-store.js +59 -0
  536. package/lib/migrations/028-move-security-settings-to-secret-store.js.map +1 -0
  537. package/lib/migrations/029-attachment-form-field.d.ts +4 -0
  538. package/lib/migrations/029-attachment-form-field.d.ts.map +1 -0
  539. package/lib/migrations/029-attachment-form-field.js +130 -0
  540. package/lib/migrations/029-attachment-form-field.js.map +1 -0
  541. package/lib/models/authentication.d.ts +17 -0
  542. package/lib/models/authentication.d.ts.map +1 -0
  543. package/lib/models/authentication.js +174 -0
  544. package/lib/models/authentication.js.map +1 -0
  545. package/lib/models/authenticationconfiguration.d.ts +15 -0
  546. package/lib/models/authenticationconfiguration.d.ts.map +1 -0
  547. package/lib/models/authenticationconfiguration.js +105 -0
  548. package/lib/models/authenticationconfiguration.js.map +1 -0
  549. package/lib/models/cappedLocation.d.ts +8 -0
  550. package/lib/models/cappedLocation.d.ts.map +1 -0
  551. package/lib/models/cappedLocation.js +78 -0
  552. package/lib/models/cappedLocation.js.map +1 -0
  553. package/lib/models/counter.d.ts +3 -0
  554. package/lib/models/counter.d.ts.map +1 -0
  555. package/lib/models/counter.js +37 -0
  556. package/lib/models/counter.js.map +1 -0
  557. package/lib/models/device.d.ts +14 -0
  558. package/lib/models/device.d.ts.map +1 -0
  559. package/lib/models/device.js +220 -0
  560. package/lib/models/device.js.map +1 -0
  561. package/lib/models/event.d.ts +75 -0
  562. package/lib/models/event.d.ts.map +1 -0
  563. package/lib/models/event.js +839 -0
  564. package/lib/models/event.js.map +1 -0
  565. package/lib/models/export.d.ts +18 -0
  566. package/lib/models/export.d.ts.map +1 -0
  567. package/lib/models/export.js +107 -0
  568. package/lib/models/export.js.map +1 -0
  569. package/lib/models/feature.d.ts +4 -0
  570. package/lib/models/feature.d.ts.map +1 -0
  571. package/lib/models/feature.js +43 -0
  572. package/lib/models/feature.js.map +1 -0
  573. package/lib/models/icon.d.ts +9 -0
  574. package/lib/models/icon.d.ts.map +1 -0
  575. package/lib/models/icon.js +69 -0
  576. package/lib/models/icon.js.map +1 -0
  577. package/lib/models/index.d.ts +2 -0
  578. package/lib/models/index.d.ts.map +1 -0
  579. package/lib/models/index.js +12 -0
  580. package/lib/models/index.js.map +1 -0
  581. package/lib/models/layer.d.ts +13 -0
  582. package/lib/models/layer.d.ts.map +1 -0
  583. package/lib/models/layer.js +149 -0
  584. package/lib/models/layer.js.map +1 -0
  585. package/lib/models/location.d.ts +8 -0
  586. package/lib/models/location.d.ts.map +1 -0
  587. package/lib/models/location.js +96 -0
  588. package/lib/models/location.js.map +1 -0
  589. package/lib/models/login.d.ts +4 -0
  590. package/lib/models/login.d.ts.map +1 -0
  591. package/lib/models/login.js +90 -0
  592. package/lib/models/login.js.map +1 -0
  593. package/lib/models/observation.d.ts +93 -0
  594. package/lib/models/observation.d.ts.map +1 -0
  595. package/lib/models/observation.js +461 -0
  596. package/lib/models/observation.js.map +1 -0
  597. package/lib/models/role.d.ts +22 -0
  598. package/lib/models/role.d.ts.map +1 -0
  599. package/lib/models/role.js +80 -0
  600. package/lib/models/role.js.map +1 -0
  601. package/lib/models/setting.d.ts +6 -0
  602. package/lib/models/setting.d.ts.map +1 -0
  603. package/lib/models/setting.js +31 -0
  604. package/lib/models/setting.js.map +1 -0
  605. package/lib/models/team.d.ts +31 -0
  606. package/lib/models/team.d.ts.map +1 -0
  607. package/lib/models/team.js +511 -0
  608. package/lib/models/team.js.map +1 -0
  609. package/lib/models/token.d.ts +6 -0
  610. package/lib/models/token.d.ts.map +1 -0
  611. package/lib/models/token.js +68 -0
  612. package/lib/models/token.js.map +1 -0
  613. package/lib/models/user.d.ts +60 -0
  614. package/lib/models/user.d.ts.map +1 -0
  615. package/lib/models/user.js +400 -0
  616. package/lib/models/user.js.map +1 -0
  617. package/lib/permissions/permissions.events.d.ts +69 -0
  618. package/lib/permissions/permissions.events.d.ts.map +1 -0
  619. package/lib/permissions/permissions.events.js +154 -0
  620. package/lib/permissions/permissions.events.js.map +1 -0
  621. package/lib/permissions/permissions.feeds.d.ts +19 -0
  622. package/lib/permissions/permissions.feeds.d.ts.map +1 -0
  623. package/lib/permissions/permissions.feeds.js +58 -0
  624. package/lib/permissions/permissions.feeds.js.map +1 -0
  625. package/lib/permissions/permissions.icons.d.ts +9 -0
  626. package/lib/permissions/permissions.icons.d.ts.map +1 -0
  627. package/lib/permissions/permissions.icons.js +28 -0
  628. package/lib/permissions/permissions.icons.js.map +1 -0
  629. package/lib/permissions/permissions.observations.d.ts +14 -0
  630. package/lib/permissions/permissions.observations.d.ts.map +1 -0
  631. package/lib/permissions/permissions.observations.js +113 -0
  632. package/lib/permissions/permissions.observations.js.map +1 -0
  633. package/lib/permissions/permissions.role-based.base.d.ts +15 -0
  634. package/lib/permissions/permissions.role-based.base.d.ts.map +1 -0
  635. package/lib/permissions/permissions.role-based.base.js +14 -0
  636. package/lib/permissions/permissions.role-based.base.js.map +1 -0
  637. package/lib/permissions/permissions.users.d.ts +8 -0
  638. package/lib/permissions/permissions.users.d.ts.map +1 -0
  639. package/lib/permissions/permissions.users.js +23 -0
  640. package/lib/permissions/permissions.users.js.map +1 -0
  641. package/lib/plugins.api/index.d.ts +55 -0
  642. package/lib/plugins.api/index.d.ts.map +1 -0
  643. package/lib/plugins.api/index.js +5 -0
  644. package/lib/plugins.api/index.js.map +1 -0
  645. package/lib/plugins.api/plugins.api.db.d.ts +7 -0
  646. package/lib/plugins.api/plugins.api.db.d.ts.map +1 -0
  647. package/lib/plugins.api/plugins.api.db.js +5 -0
  648. package/lib/plugins.api/plugins.api.db.js.map +1 -0
  649. package/lib/plugins.api/plugins.api.events.d.ts +24 -0
  650. package/lib/plugins.api/plugins.api.events.d.ts.map +1 -0
  651. package/lib/plugins.api/plugins.api.events.js +5 -0
  652. package/lib/plugins.api/plugins.api.events.js.map +1 -0
  653. package/lib/plugins.api/plugins.api.feeds.d.ts +35 -0
  654. package/lib/plugins.api/plugins.api.feeds.d.ts.map +1 -0
  655. package/lib/plugins.api/plugins.api.feeds.js +12 -0
  656. package/lib/plugins.api/plugins.api.feeds.js.map +1 -0
  657. package/lib/plugins.api/plugins.api.icons.d.ts +21 -0
  658. package/lib/plugins.api/plugins.api.icons.d.ts.map +1 -0
  659. package/lib/plugins.api/plugins.api.icons.js +5 -0
  660. package/lib/plugins.api/plugins.api.icons.js.map +1 -0
  661. package/lib/plugins.api/plugins.api.observations.d.ts +10 -0
  662. package/lib/plugins.api/plugins.api.observations.d.ts.map +1 -0
  663. package/lib/plugins.api/plugins.api.observations.js +11 -0
  664. package/lib/plugins.api/plugins.api.observations.js.map +1 -0
  665. package/lib/plugins.api/plugins.api.users.d.ts +4 -0
  666. package/lib/plugins.api/plugins.api.users.d.ts.map +1 -0
  667. package/lib/plugins.api/plugins.api.users.js +5 -0
  668. package/lib/plugins.api/plugins.api.users.js.map +1 -0
  669. package/lib/plugins.api/plugins.api.web.d.ts +10 -0
  670. package/lib/plugins.api/plugins.api.web.d.ts.map +1 -0
  671. package/lib/plugins.api/plugins.api.web.js +3 -0
  672. package/lib/plugins.api/plugins.api.web.js.map +1 -0
  673. package/lib/provision/index.d.ts +23 -0
  674. package/lib/provision/index.d.ts.map +1 -0
  675. package/lib/provision/index.js +60 -0
  676. package/lib/provision/index.js.map +1 -0
  677. package/lib/provision/none.d.ts +3 -0
  678. package/lib/provision/none.d.ts.map +1 -0
  679. package/lib/provision/none.js +41 -0
  680. package/lib/provision/none.js.map +1 -0
  681. package/lib/provision/strategies/none.d.ts +9 -0
  682. package/lib/provision/strategies/none.d.ts.map +1 -0
  683. package/lib/provision/strategies/none.js +25 -0
  684. package/lib/provision/strategies/none.js.map +1 -0
  685. package/lib/provision/strategies/uid.d.ts +9 -0
  686. package/lib/provision/strategies/uid.d.ts.map +1 -0
  687. package/lib/provision/strategies/uid.js +28 -0
  688. package/lib/provision/strategies/uid.js.map +1 -0
  689. package/lib/provision/uid.d.ts +3 -0
  690. package/lib/provision/uid.d.ts.map +1 -0
  691. package/lib/provision/uid.js +43 -0
  692. package/lib/provision/uid.js.map +1 -0
  693. package/lib/routes/authenticationconfigurations.d.ts +3 -0
  694. package/lib/routes/authenticationconfigurations.d.ts.map +1 -0
  695. package/lib/routes/authenticationconfigurations.js +209 -0
  696. package/lib/routes/authenticationconfigurations.js.map +1 -0
  697. package/lib/routes/devices.d.ts +3 -0
  698. package/lib/routes/devices.d.ts.map +1 -0
  699. package/lib/routes/devices.js +201 -0
  700. package/lib/routes/devices.js.map +1 -0
  701. package/lib/routes/events.d.ts +47 -0
  702. package/lib/routes/events.d.ts.map +1 -0
  703. package/lib/routes/events.js +495 -0
  704. package/lib/routes/events.js.map +1 -0
  705. package/lib/routes/exports.d.ts +3 -0
  706. package/lib/routes/exports.d.ts.map +1 -0
  707. package/lib/routes/exports.js +204 -0
  708. package/lib/routes/exports.js.map +1 -0
  709. package/lib/routes/imports.d.ts +3 -0
  710. package/lib/routes/imports.d.ts.map +1 -0
  711. package/lib/routes/imports.js +41 -0
  712. package/lib/routes/imports.js.map +1 -0
  713. package/lib/routes/index.d.ts +3 -0
  714. package/lib/routes/index.d.ts.map +1 -0
  715. package/lib/routes/index.js +151 -0
  716. package/lib/routes/index.js.map +1 -0
  717. package/lib/routes/layers.d.ts +3 -0
  718. package/lib/routes/layers.d.ts.map +1 -0
  719. package/lib/routes/layers.js +433 -0
  720. package/lib/routes/layers.js.map +1 -0
  721. package/lib/routes/locations.d.ts +3 -0
  722. package/lib/routes/locations.d.ts.map +1 -0
  723. package/lib/routes/locations.js +124 -0
  724. package/lib/routes/locations.js.map +1 -0
  725. package/lib/routes/logins.d.ts +3 -0
  726. package/lib/routes/logins.d.ts.map +1 -0
  727. package/lib/routes/logins.js +64 -0
  728. package/lib/routes/logins.js.map +1 -0
  729. package/lib/routes/observations.d.ts +3 -0
  730. package/lib/routes/observations.d.ts.map +1 -0
  731. package/lib/routes/observations.js +363 -0
  732. package/lib/routes/observations.js.map +1 -0
  733. package/lib/routes/plugins.d.ts +3 -0
  734. package/lib/routes/plugins.d.ts.map +1 -0
  735. package/lib/routes/plugins.js +29 -0
  736. package/lib/routes/plugins.js.map +1 -0
  737. package/lib/routes/roles.d.ts +3 -0
  738. package/lib/routes/roles.d.ts.map +1 -0
  739. package/lib/routes/roles.js +64 -0
  740. package/lib/routes/roles.js.map +1 -0
  741. package/lib/routes/settings.d.ts +3 -0
  742. package/lib/routes/settings.d.ts.map +1 -0
  743. package/lib/routes/settings.js +21 -0
  744. package/lib/routes/settings.js.map +1 -0
  745. package/lib/routes/setup.d.ts +3 -0
  746. package/lib/routes/setup.d.ts.map +1 -0
  747. package/lib/routes/setup.js +90 -0
  748. package/lib/routes/setup.js.map +1 -0
  749. package/lib/routes/teams.d.ts +3 -0
  750. package/lib/routes/teams.d.ts.map +1 -0
  751. package/lib/routes/teams.js +213 -0
  752. package/lib/routes/teams.js.map +1 -0
  753. package/lib/routes/users.d.ts +3 -0
  754. package/lib/routes/users.d.ts.map +1 -0
  755. package/lib/routes/users.js +478 -0
  756. package/lib/routes/users.js.map +1 -0
  757. package/lib/schedule/export/export-task.d.ts +14 -0
  758. package/lib/schedule/export/export-task.d.ts.map +1 -0
  759. package/lib/schedule/export/export-task.js +70 -0
  760. package/lib/schedule/export/export-task.js.map +1 -0
  761. package/lib/schedule/index.d.ts +2 -0
  762. package/lib/schedule/index.d.ts.map +1 -0
  763. package/lib/schedule/index.js +27 -0
  764. package/lib/schedule/index.js.map +1 -0
  765. package/lib/security/key-mgt/key-mgt-factory.d.ts +7 -0
  766. package/lib/security/key-mgt/key-mgt-factory.d.ts.map +1 -0
  767. package/lib/security/key-mgt/key-mgt-factory.js +10 -0
  768. package/lib/security/key-mgt/key-mgt-factory.js.map +1 -0
  769. package/lib/security/key-mgt/plaintext-key-manager.d.ts +42 -0
  770. package/lib/security/key-mgt/plaintext-key-manager.d.ts.map +1 -0
  771. package/lib/security/key-mgt/plaintext-key-manager.js +52 -0
  772. package/lib/security/key-mgt/plaintext-key-manager.js.map +1 -0
  773. package/lib/security/responses/data-response.d.ts +13 -0
  774. package/lib/security/responses/data-response.d.ts.map +1 -0
  775. package/lib/security/responses/data-response.js +25 -0
  776. package/lib/security/responses/data-response.js.map +1 -0
  777. package/lib/security/secret-store-service.d.ts +39 -0
  778. package/lib/security/secret-store-service.d.ts.map +1 -0
  779. package/lib/security/secret-store-service.js +94 -0
  780. package/lib/security/secret-store-service.js.map +1 -0
  781. package/lib/security/storage/file-system-secret-store.d.ts +17 -0
  782. package/lib/security/storage/file-system-secret-store.d.ts.map +1 -0
  783. package/lib/security/storage/file-system-secret-store.js +46 -0
  784. package/lib/security/storage/file-system-secret-store.js.map +1 -0
  785. package/lib/security/storage/json-provider.d.ts +6 -0
  786. package/lib/security/storage/json-provider.d.ts.map +1 -0
  787. package/lib/security/storage/json-provider.js +17 -0
  788. package/lib/security/storage/json-provider.js.map +1 -0
  789. package/lib/security/utilities/secure-property-appender.d.ts +8 -0
  790. package/lib/security/utilities/secure-property-appender.d.ts.map +1 -0
  791. package/lib/security/utilities/secure-property-appender.js +39 -0
  792. package/lib/security/utilities/secure-property-appender.js.map +1 -0
  793. package/lib/transformers/authenticationconfiguration.d.ts +2 -0
  794. package/lib/transformers/authenticationconfiguration.d.ts.map +1 -0
  795. package/lib/transformers/authenticationconfiguration.js +22 -0
  796. package/lib/transformers/authenticationconfiguration.js.map +1 -0
  797. package/lib/transformers/export.d.ts +2 -0
  798. package/lib/transformers/export.d.ts.map +1 -0
  799. package/lib/transformers/export.js +13 -0
  800. package/lib/transformers/export.js.map +1 -0
  801. package/lib/transformers/geojson.d.ts +2 -0
  802. package/lib/transformers/geojson.d.ts.map +1 -0
  803. package/lib/transformers/geojson.js +24 -0
  804. package/lib/transformers/geojson.js.map +1 -0
  805. package/lib/transformers/layer.d.ts +2 -0
  806. package/lib/transformers/layer.d.ts.map +1 -0
  807. package/lib/transformers/layer.js +13 -0
  808. package/lib/transformers/layer.js.map +1 -0
  809. package/lib/transformers/observation.d.ts +2 -0
  810. package/lib/transformers/observation.d.ts.map +1 -0
  811. package/lib/transformers/observation.js +13 -0
  812. package/lib/transformers/observation.js.map +1 -0
  813. package/lib/transformers/pageinfo.d.ts +2 -0
  814. package/lib/transformers/pageinfo.d.ts.map +1 -0
  815. package/lib/transformers/pageinfo.js +27 -0
  816. package/lib/transformers/pageinfo.js.map +1 -0
  817. package/lib/transformers/user.d.ts +2 -0
  818. package/lib/transformers/user.d.ts.map +1 -0
  819. package/lib/transformers/user.js +21 -0
  820. package/lib/transformers/user.js.map +1 -0
  821. package/lib/tsconfig.tsbuildinfo +1 -0
  822. package/lib/upload.d.ts +8 -0
  823. package/lib/upload.d.ts.map +1 -0
  824. package/lib/upload.js +30 -0
  825. package/lib/upload.js.map +1 -0
  826. package/lib/utilities/authenticationApiAppender.d.ts +10 -0
  827. package/lib/utilities/authenticationApiAppender.d.ts.map +1 -0
  828. package/lib/utilities/authenticationApiAppender.js +48 -0
  829. package/lib/utilities/authenticationApiAppender.js.map +1 -0
  830. package/lib/utilities/filterParser.d.ts +2 -0
  831. package/lib/utilities/filterParser.d.ts.map +1 -0
  832. package/lib/utilities/filterParser.js +87 -0
  833. package/lib/utilities/filterParser.js.map +1 -0
  834. package/lib/utilities/geopackage.d.ts +56 -0
  835. package/lib/utilities/geopackage.d.ts.map +1 -0
  836. package/lib/utilities/geopackage.js +335 -0
  837. package/lib/utilities/geopackage.js.map +1 -0
  838. package/lib/utilities/loader.d.ts +9 -0
  839. package/lib/utilities/loader.d.ts.map +1 -0
  840. package/lib/utilities/loader.js +25 -0
  841. package/lib/utilities/loader.js.map +1 -0
  842. package/lib/utilities/paging.d.ts +15 -0
  843. package/lib/utilities/paging.d.ts.map +1 -0
  844. package/lib/utilities/paging.js +56 -0
  845. package/lib/utilities/paging.js.map +1 -0
  846. package/lib/utilities/passwordValidator.d.ts +8 -0
  847. package/lib/utilities/passwordValidator.d.ts.map +1 -0
  848. package/lib/utilities/passwordValidator.js +175 -0
  849. package/lib/utilities/passwordValidator.js.map +1 -0
  850. package/lib/utilities/pbkdf2.d.ts +6 -0
  851. package/lib/utilities/pbkdf2.d.ts.map +1 -0
  852. package/lib/utilities/pbkdf2.js +79 -0
  853. package/lib/utilities/pbkdf2.js.map +1 -0
  854. package/lib/utilities/togeojson.d.ts +2 -0
  855. package/lib/utilities/togeojson.d.ts.map +1 -0
  856. package/lib/utilities/togeojson.js +308 -0
  857. package/lib/utilities/togeojson.js.map +1 -0
  858. package/lib/utilities/waitForMongooseConnection.d.ts +3 -0
  859. package/lib/utilities/waitForMongooseConnection.d.ts.map +1 -0
  860. package/lib/utilities/waitForMongooseConnection.js +34 -0
  861. package/lib/utilities/waitForMongooseConnection.js.map +1 -0
  862. package/lib/utilities/whitelist.d.ts +2 -0
  863. package/lib/utilities/whitelist.d.ts.map +1 -0
  864. package/lib/utilities/whitelist.js +18 -0
  865. package/lib/utilities/whitelist.js.map +1 -0
  866. package/lib/views/authentication.pug +10 -0
  867. package/lib/views/oauth.pug +12 -0
  868. package/lib/views/observation.pug +137 -0
  869. package/package.json +203 -0
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ const crypto = require('crypto'), verification = require('./verification'), api = require('../api/'), config = require('../config.js'), log = require('../logger'), userTransformer = require('../transformers/user'), authenticationApiAppender = require('../utilities/authenticationApiAppender'), AuthenticationConfiguration = require('../models/authenticationconfiguration'), SecurePropertyAppender = require('../security/utilities/secure-property-appender');
3
+ const JWTService = verification.JWTService;
4
+ const TokenAssertion = verification.TokenAssertion;
5
+ class AuthenticationInitializer {
6
+ static initialize(app, passport, provision) {
7
+ AuthenticationInitializer.app = app;
8
+ AuthenticationInitializer.passport = passport;
9
+ AuthenticationInitializer.provision = provision;
10
+ const BearerStrategy = require('passport-http-bearer').Strategy, User = require('../models/user'), Token = require('../models/token');
11
+ passport.serializeUser(function (user, done) {
12
+ done(null, user._id);
13
+ });
14
+ passport.deserializeUser(function (id, done) {
15
+ User.getUserById(id, function (err, user) {
16
+ done(err, user);
17
+ });
18
+ });
19
+ passport.use(new BearerStrategy({
20
+ passReqToCallback: true
21
+ }, function (req, token, done) {
22
+ Token.getToken(token, function (err, credentials) {
23
+ if (err) {
24
+ return done(err);
25
+ }
26
+ if (!credentials || !credentials.user) {
27
+ return done(null, false);
28
+ }
29
+ req.token = credentials.token;
30
+ if (credentials.token.deviceId) {
31
+ req.provisionedDeviceId = credentials.token.deviceId;
32
+ }
33
+ return done(null, credentials.user, { scope: 'all' });
34
+ });
35
+ }));
36
+ passport.use('authorization', new BearerStrategy(function (token, done) {
37
+ const expectation = {
38
+ assertion: TokenAssertion.Authorized
39
+ };
40
+ AuthenticationInitializer.tokenService.verifyToken(token, expectation)
41
+ .then(payload => {
42
+ User.getUserById(payload.subject)
43
+ .then(user => done(null, user))
44
+ .catch(err => done(err));
45
+ })
46
+ .catch(err => done(err));
47
+ }));
48
+ function authorize(req, res, next) {
49
+ passport.authenticate('authorization', function (err, user, info = {}) {
50
+ if (!user)
51
+ return res.status(401).send(info.message);
52
+ req.user = user;
53
+ next();
54
+ })(req, res, next);
55
+ }
56
+ function provisionDevice(req, res, next) {
57
+ provision.check(req.user.authentication.authenticationConfiguration.type, req.user.authentication.authenticationConfiguration.name)(req, res, next);
58
+ }
59
+ app.post('/auth/token', authorize, provisionDevice, function (req, res, next) {
60
+ const options = {
61
+ userAgent: req.headers['user-agent'],
62
+ appVersion: req.param('appVersion')
63
+ };
64
+ new api.User().login(req.user, req.provisionedDevice, options, function (err, token) {
65
+ if (err)
66
+ return next(err);
67
+ authenticationApiAppender.append(config.api).then(api => {
68
+ res.json({
69
+ token: token.token,
70
+ expirationDate: token.expirationDate,
71
+ user: userTransformer.transform(req.user, { path: req.getRoot() }),
72
+ device: req.provisionedDevice,
73
+ api: api
74
+ });
75
+ }).catch(err => {
76
+ next(err);
77
+ });
78
+ });
79
+ req.session = null;
80
+ });
81
+ AuthenticationConfiguration.getAllConfigurations().then(configs => {
82
+ configs.forEach(config => {
83
+ const strategy = require('../authentication/' + config.type);
84
+ SecurePropertyAppender.appendToConfig(config).then(appendedConfig => {
85
+ strategy.initialize(appendedConfig);
86
+ }).catch(err => {
87
+ log.error(err);
88
+ });
89
+ });
90
+ }).catch(err => {
91
+ log.warn(err);
92
+ });
93
+ //TODO due to a timing issue on startup, local may not yet be configured during setup phase
94
+ //For now, always load it (even though it may have already be loaded above)
95
+ require('./local').initialize();
96
+ require('./anonymous').initialize();
97
+ return {
98
+ passport: passport
99
+ };
100
+ }
101
+ }
102
+ AuthenticationInitializer.tokenService = new JWTService(crypto.randomBytes(64).toString('hex'), 'urn:mage');
103
+ module.exports = AuthenticationInitializer;
104
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authentication/index.js"],"names":[],"mappings":";AAAA,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,EAC5B,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,EACxC,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,EACxB,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,EAChC,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,EAC1B,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC,EACjD,yBAAyB,GAAG,OAAO,CAAC,wCAAwC,CAAC,EAC7E,2BAA2B,GAAG,OAAO,CAAC,uCAAuC,CAAC,EAC9E,sBAAsB,GAAG,OAAO,CAAC,gDAAgD,CAAC,CAAC;AAEvF,MAAM,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;AAC3C,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;AAEnD,MAAM,yBAAyB;IAM7B,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS;QACxC,yBAAyB,CAAC,GAAG,GAAG,GAAG,CAAC;QACpC,yBAAyB,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC9C,yBAAyB,CAAC,SAAS,GAAG,SAAS,CAAC;QAEhD,MAAM,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAC3D,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAChC,KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAEvC,QAAQ,CA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AAC,cAAc,CAAC,EAAE;oBAClE,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;gBACtC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;oBACb,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACjB,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACb,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,2FAA2F;QAC3F,2EAA2E;QAC3E,OAAO,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC;QAChC,OAAO,CAAC,aAAa,CAAC,CAAC,UAAU,EAAE,CAAC;QAEpC,OAAO;YACL,QAAQ,EAAE,QAAQ;SACnB,CAAC;IACJ,CAAC;;AA1HM,sCAAY,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AA6H3F,MAAM,CAAC,OAAO,GAAG,yBAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export function initialize(strategy: any): void;
2
+ //# sourceMappingURL=ldap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ldap.d.ts","sourceRoot":"","sources":["../../src/authentication/ldap.js"],"names":[],"mappings":"AA0FA,gDAqDC"}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ const LdapStrategy = require('passport-ldapauth'), log = require('winston'), User = require('../models/user'), Role = require('../models/role'), TokenAssertion = require('./verification').TokenAssertion, api = require('../api'), userTransformer = require('../transformers/user'), { app, passport, tokenService } = require('./index');
3
+ function configure(strategy) {
4
+ log.info('Configuring ' + strategy.title + ' authentication');
5
+ passport.use(strategy.name, new LdapStrategy({
6
+ server: {
7
+ url: strategy.settings.url,
8
+ bindDN: strategy.settings.bindDN,
9
+ bindCredentials: strategy.settings.bindCredentials,
10
+ searchBase: strategy.settings.searchBase,
11
+ searchFilter: strategy.settings.searchFilter,
12
+ searchScope: strategy.settings.searchScope,
13
+ groupSearchBase: strategy.settings.groupSearchBase,
14
+ groupSearchFilter: strategy.settings.groupSearchFilter,
15
+ groupSearchScope: strategy.settings.groupSearchScope,
16
+ bindProperty: strategy.settings.bindProperty,
17
+ groupDnProperty: strategy.settings.groupDnProperty
18
+ }
19
+ }, function (profile, done) {
20
+ const username = profile[strategy.settings.profile.id];
21
+ User.getUserByAuthenticationStrategy(strategy.type, username, function (err, user) {
22
+ if (err)
23
+ return done(err);
24
+ if (!user) {
25
+ // Create an account for the user
26
+ Role.getRole('USER_ROLE', function (err, role) {
27
+ if (err)
28
+ return done(err);
29
+ const user = {
30
+ username: username,
31
+ displayName: profile[strategy.settings.profile.displayName],
32
+ email: profile[strategy.settings.profile.email],
33
+ active: false,
34
+ roleId: role._id,
35
+ authentication: {
36
+ type: strategy.name,
37
+ id: username,
38
+ authenticationConfiguration: {
39
+ name: strategy.name
40
+ }
41
+ }
42
+ };
43
+ new api.User().create(user).then(newUser => {
44
+ if (!newUser.authentication.authenticationConfiguration.enabled) {
45
+ log.warn(newUser.authentication.authenticationConfiguration.title + " authentication is not enabled");
46
+ return done(null, newUser, { message: 'Authentication method is not enabled, please contact a MAGE administrator for assistance.' });
47
+ }
48
+ if (newUser.active) {
49
+ done(null, newUser);
50
+ }
51
+ else {
52
+ done(null, newUser, { status: 403 });
53
+ }
54
+ }).catch(err => done(err));
55
+ });
56
+ }
57
+ else if (!user.authentication.authenticationConfiguration.enabled) {
58
+ log.warn(user.authentication.authenticationConfiguration.title + " authentication is not enabled");
59
+ return done(null, user, { message: 'Authentication method is not enabled, please contact a MAGE administrator for assistance.' });
60
+ }
61
+ else {
62
+ return done(null, user);
63
+ }
64
+ });
65
+ }));
66
+ }
67
+ function setDefaults(strategy) {
68
+ if (!strategy.settings.profile) {
69
+ strategy.settings.profile = {};
70
+ }
71
+ if (!strategy.settings.profile.displayName) {
72
+ strategy.settings.profile.displayName = 'givenname';
73
+ }
74
+ if (!strategy.settings.profile.email) {
75
+ strategy.settings.profile.email = 'mail';
76
+ }
77
+ if (!strategy.settings.profile.id) {
78
+ strategy.settings.profile.id = 'cn';
79
+ }
80
+ }
81
+ function initialize(strategy) {
82
+ setDefaults(strategy);
83
+ configure(strategy);
84
+ const authenticationOptions = {
85
+ invalidLogonHours: `Not Permitted to login to ${strategy.title} account at this time.`,
86
+ invalidWorkstation: `Not permited to logon to ${strategy.title} account at this workstation.`,
87
+ passwordExpired: `${strategy.title} password expired.`,
88
+ accountDisabled: `${strategy.title} account disabled.`,
89
+ accountExpired: `${strategy.title} account expired.`,
90
+ passwordMustChange: `User must reset ${strategy.title} password.`,
91
+ accountLockedOut: `${strategy.title} user account locked.`,
92
+ invalidCredentials: `Invalid ${strategy.title} username/password.`
93
+ };
94
+ app.post(`/auth/${strategy.name}/signin`, function authenticate(req, res, next) {
95
+ passport.authenticate(strategy.name, authenticationOptions, function (err, user, info = {}) {
96
+ if (err)
97
+ return next(err);
98
+ if (!user) {
99
+ return res.status(401).send(info.message);
100
+ }
101
+ if (!user.active) {
102
+ return res.status(info.status || 401).send('User account is not approved, please contact your MAGE administrator to approve your account.');
103
+ }
104
+ if (!user.enabled) {
105
+ log.warn('Failed user login attempt: User ' + user.username + ' account is disabled.');
106
+ return res.status(401).send('Your account has been disabled, please contact a MAGE administrator for assistance.');
107
+ }
108
+ if (!user.authentication.authenticationConfigurationId) {
109
+ log.warn('Failed user login attempt: ' + user.authentication.type + ' is not configured');
110
+ return res.status(401).send(user.authentication.type + ' authentication is not configured, please contact a MAGE administrator for assistance.');
111
+ }
112
+ if (!user.authentication.authenticationConfiguration.enabled) {
113
+ log.warn('Failed user login attempt: Authentication ' + user.authentication.authenticationConfiguration.title + ' is disabled.');
114
+ return res.status(401).send(user.authentication.authenticationConfiguration.title + ' authentication is disabled, please contact a MAGE administrator for assistance.');
115
+ }
116
+ tokenService.generateToken(user._id.toString(), TokenAssertion.Authorized, 60 * 5)
117
+ .then(token => {
118
+ res.json({
119
+ user: userTransformer.transform(req.user, { path: req.getRoot() }),
120
+ token: token
121
+ });
122
+ }).catch(err => next(err));
123
+ })(req, res, next);
124
+ });
125
+ }
126
+ ;
127
+ module.exports = {
128
+ initialize
129
+ };
130
+ //# sourceMappingURL=ldap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ldap.js","sourceRoot":"","sources":["../../src/authentication/ldap.js"],"names":[],"mappings":";AAAA,MAAM,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,EAC7C,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,EACxB,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAChC,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAChC,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,cAAc,EACzD,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,EACvB,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC,EACjD,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEzD,SAAS,SAAS,CAAC,QAAQ;IACzB,GAAG,CAAC,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,KAAK,GAAG,iBAAiB,CAAC,CAAC;IAE9D,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,YAAY,CAAC;QAC3C,MAAM,EAAE;YACN,GAAG,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG;YAC1B,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM;YAChC,eAAe,EAAE,QAAQ,CAAC,QAAQ,CAAC,eAAe;YAClD,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU;YACxC,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,YAAY;YAC5C,WAAW,EAAE,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,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,cAAc,CAAC,UAAU,EAAE,EAAE,GAAG,CAAC,CAAC;iBAC/E,IAAI,CAAC,KAAK,CAAC,EAAE;gBACZ,GAAG,CAAC,IAAI,CAAC;oBACP,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;oBAClE,KAAK,EAAE,KAAK;iBACb,CAAC,CAAC;YACL,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACrB,CAAC,CACF,CAAC;AACJ,CAAC;AAAA,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG;IACf,UAAU;CACX,CAAA"}
@@ -0,0 +1,2 @@
1
+ export function initialize(): void;
2
+ //# sourceMappingURL=local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/authentication/local.js"],"names":[],"mappings":"AAkEA,mCAsBC"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ const log = require('winston'), moment = require('moment'), LocalStrategy = require('passport-local').Strategy, TokenAssertion = require('./verification').TokenAssertion, User = require('../models/user'), userTransformer = require('../transformers/user'), { app, passport, tokenService } = require('./index'), Authentication = require('../models/authentication');
3
+ function configure() {
4
+ log.info('Configuring local authentication');
5
+ passport.use(new LocalStrategy(function (username, password, done) {
6
+ User.getUserByUsername(username, function (err, user) {
7
+ if (err) {
8
+ return done(err);
9
+ }
10
+ if (!user) {
11
+ log.warn('Failed login attempt: User with username ' + username + ' not found');
12
+ return done(null, false, { message: 'Please check your username and password and try again.' });
13
+ }
14
+ if (!user.active) {
15
+ log.warn('Failed user login attempt: User ' + user.username + ' is not active');
16
+ return done(null, false, { message: 'User account is not approved, please contact your MAGE administrator to approve your account.' });
17
+ }
18
+ if (!user.enabled) {
19
+ log.warn('Failed user login attempt: User ' + user.username + ' account is disabled.');
20
+ return done(null, false, { message: 'Your account has been disabled, please contact a MAGE administrator for assistance.' });
21
+ }
22
+ const settings = user.authentication.security;
23
+ if (settings && settings.locked && moment().isBefore(moment(settings.lockedUntil))) {
24
+ log.warn('Failed user login attempt: User ' + user.username + ' account is locked until ' + settings.lockedUntil);
25
+ return done(null, false, { message: 'Your account has been temporarily locked, please try again later or contact a MAGE administrator for assistance.' });
26
+ }
27
+ if (!(user.authentication instanceof Authentication.Local)) {
28
+ log.warn(user.username + " is not a local account");
29
+ return done(null, false, { message: 'You do not have a local account, please contact a MAGE administrator for assistance.' });
30
+ }
31
+ if (!user.authentication.authenticationConfiguration.enabled) {
32
+ log.warn(user.authentication.authenticationConfiguration.title + " authentication is not enabled");
33
+ return done(null, false, { message: 'Authentication method is not enabled, please contact a MAGE administrator for assistance.' });
34
+ }
35
+ user.authentication.validatePassword(password, function (err, isValid) {
36
+ if (err)
37
+ return done(err);
38
+ if (isValid) {
39
+ User.validLogin(user)
40
+ .then(() => done(null, user))
41
+ .catch(err => done(err));
42
+ }
43
+ else {
44
+ log.warn('Failed login attempt: User with username ' + username + ' provided an invalid password');
45
+ User.invalidLogin(user)
46
+ .then(() => done(null, false, { message: 'Please check your username and password and try again.' }))
47
+ .catch(err => done(err));
48
+ }
49
+ });
50
+ });
51
+ }));
52
+ }
53
+ function initialize() {
54
+ configure();
55
+ app.post('/auth/local/signin', function authenticate(req, res, next) {
56
+ passport.authenticate('local', function (err, user, info = {}) {
57
+ if (err)
58
+ return next(err);
59
+ if (!user)
60
+ return res.status(401).send(info.message);
61
+ tokenService.generateToken(user._id.toString(), TokenAssertion.Authorized, 60 * 5)
62
+ .then(token => {
63
+ res.json({
64
+ token: token,
65
+ user: userTransformer.transform(user, { path: req.getRoot() })
66
+ });
67
+ }).catch(err => {
68
+ next(err);
69
+ });
70
+ })(req, res, next);
71
+ });
72
+ }
73
+ ;
74
+ module.exports = {
75
+ initialize
76
+ };
77
+ //# sourceMappingURL=local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/authentication/local.js"],"names":[],"mappings":";AAAA,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,EAC1B,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,EAC1B,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAClD,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,cAAc,EACzD,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAChC,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC,EACjD,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,EACpD,cAAc,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAEzD,SAAS,SAAS;IAChB,GAAG,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAC7C,QAAQ,CAAC,GAAG,CAAC,IAAI,aAAa,CAC5B,UAAU,QAAQ,EAAE,QAAQ,EAAE,IAAI;QAChC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,UAAU,GAAG,EAAE,IAAI;YAClD,IAAI,GAAG,EAAE;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;aAAE;YAE9B,IAAI,CAAC,IAAI,EAAE;gBACT,GAAG,CAAC,IAAI,CAAC,2CAA2C,GAAG,QAAQ,GAAG,YAAY,CAAC,CAAC;gBAChF,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,wDAAwD,EAAE,CAAC,CAAC;aACjG;YAED,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;gBAChB,GAAG,CAAC,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,QAA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,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAErD,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,cAAc,CAAC,UAAU,EAAE,EAAE,GAAG,CAAC,CAAC;iBAC/E,IAAI,CAAC,KAAK,CAAC,EAAE;gBACZ,GAAG,CAAC,IAAI,CAAC;oBACP,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;iBAC/D,CAAC,CAAC;YACL,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;gBACb,IAAI,CAAC,GAAG,CAAC,CAAC;YACZ,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IACrB,CAAC,CACF,CAAC;AACJ,CAAC;AAAA,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG;IACf,UAAU;CACX,CAAA"}
@@ -0,0 +1,2 @@
1
+ export function initialize(strategy: any): void;
2
+ //# sourceMappingURL=oauth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/authentication/oauth.js"],"names":[],"mappings":"AAmJA,gDAuEC"}
@@ -0,0 +1,197 @@
1
+ 'use strict';
2
+ const OAuth2Strategy = require('passport-oauth2').Strategy, TokenAssertion = require('./verification').TokenAssertion, base64 = require('base-64'), api = require('../api'), log = require('../logger'), User = require('../models/user'), Role = require('../models/role'), { app, passport, tokenService } = require('./index');
3
+ class OAuth2ProfileStrategy extends OAuth2Strategy {
4
+ constructor(options, verify) {
5
+ super(options, verify);
6
+ if (!options.profileURL) {
7
+ throw new TypeError('OAuth2Strategy requires a profileURL option');
8
+ }
9
+ this._profileURL = options.profileURL;
10
+ this._oauth2.useAuthorizationHeaderforGET(true);
11
+ }
12
+ userProfile(accessToken, done) {
13
+ this._oauth2.get(this._profileURL, accessToken, function (err, body) {
14
+ if (err) {
15
+ return done(new InternalOAuthError('Failed to fetch user profile', err));
16
+ }
17
+ try {
18
+ const json = JSON.parse(body);
19
+ const profile = {};
20
+ profile.provider = 'oauth2';
21
+ profile.raw = body;
22
+ profile.json = json;
23
+ done(null, profile);
24
+ }
25
+ catch (e) {
26
+ log.warn('Error parsing oauth profile', e);
27
+ done(e);
28
+ }
29
+ });
30
+ }
31
+ }
32
+ function configure(strategy) {
33
+ log.info('Configuring ' + strategy.title + ' authentication');
34
+ let customHeaders = null;
35
+ if (strategy.settings.headers) {
36
+ customHeaders = {};
37
+ if (strategy.settings.headers.basic) {
38
+ customHeaders['Authorization'] = `Basic ${base64.encode(`${strategy.settings.clientID}:${strategy.settings.clientSecret}`)}`;
39
+ }
40
+ }
41
+ passport.use(strategy.name, new OAuth2ProfileStrategy({
42
+ clientID: strategy.settings.clientID,
43
+ clientSecret: strategy.settings.clientSecret,
44
+ callbackURL: `/auth/${strategy.name}/callback`,
45
+ authorizationURL: strategy.settings.authorizationURL,
46
+ tokenURL: strategy.settings.tokenURL,
47
+ profileURL: strategy.settings.profileURL,
48
+ customHeaders: customHeaders,
49
+ scope: strategy.settings.scope,
50
+ pkce: strategy.settings.pkce,
51
+ store: true
52
+ }, function (accessToken, refreshToken, profileResponse, done) {
53
+ const profile = profileResponse.json;
54
+ if (!profile[strategy.settings.profile.id]) {
55
+ log.warn("JSON: " + JSON.stringify(profile) + " RAW: " + profileResponse.raw);
56
+ return done(`OAuth2 user profile does not contain id property named ${strategy.settings.profile.id}`);
57
+ }
58
+ const profileId = profile[strategy.settings.profile.id];
59
+ User.getUserByAuthenticationStrategy(strategy.type, profileId, function (err, user) {
60
+ if (err)
61
+ return done(err);
62
+ if (!user) {
63
+ // Create an account for the user
64
+ Role.getRole('USER_ROLE', function (err, role) {
65
+ if (err)
66
+ return done(err);
67
+ let email = null;
68
+ if (profile[strategy.settings.profile.email]) {
69
+ if (Array.isArray(profile[strategy.settings.profile.email])) {
70
+ email = profile[strategy.settings.profile.email].find(email => {
71
+ email.verified === true;
72
+ });
73
+ }
74
+ else {
75
+ email = profile[strategy.settings.profile.email];
76
+ }
77
+ }
78
+ else {
79
+ log.warn(`OAuth2 user profile does not contain email property named ${strategy.settings.profile.email}`);
80
+ log.debug(JSON.stringify(profile));
81
+ }
82
+ const user = {
83
+ username: profileId,
84
+ displayName: profile[strategy.settings.profile.displayName] || profileId,
85
+ email: email,
86
+ active: false,
87
+ roleId: role._id,
88
+ authentication: {
89
+ type: strategy.type,
90
+ id: profileId,
91
+ authenticationConfiguration: {
92
+ name: strategy.name
93
+ }
94
+ }
95
+ };
96
+ new api.User().create(user).then(newUser => {
97
+ if (!newUser.authentication.authenticationConfiguration.enabled) {
98
+ log.warn(newUser.authentication.authenticationConfiguration.title + " authentication is not enabled");
99
+ return done(null, false, { message: 'Authentication method is not enabled, please contact a MAGE administrator for assistance.' });
100
+ }
101
+ return done(null, newUser);
102
+ }).catch(err => done(err));
103
+ });
104
+ }
105
+ else if (!user.active) {
106
+ return done(null, user, { message: "User is not approved, please contact your MAGE administrator to approve your account." });
107
+ }
108
+ else if (!user.authentication.authenticationConfiguration.enabled) {
109
+ log.warn(user.authentication.authenticationConfiguration.title + " authentication is not enabled");
110
+ return done(null, user, { message: 'Authentication method is not enabled, please contact a MAGE administrator for assistance.' });
111
+ }
112
+ else {
113
+ return done(null, user);
114
+ }
115
+ });
116
+ }));
117
+ }
118
+ function setDefaults(strategy) {
119
+ if (!strategy.settings.profile) {
120
+ strategy.settings.profile = {};
121
+ }
122
+ if (!strategy.settings.profile.displayName) {
123
+ strategy.settings.profile.displayName = 'displayName';
124
+ }
125
+ if (!strategy.settings.profile.email) {
126
+ strategy.settings.profile.email = 'email';
127
+ }
128
+ if (!strategy.settings.profile.id) {
129
+ strategy.settings.profile.id = 'id';
130
+ }
131
+ }
132
+ function initialize(strategy) {
133
+ setDefaults(strategy);
134
+ // TODO lets test with newer geoaxis server to see if this is still needed
135
+ // If it is, this should be a admin client side option, would also need to modify the
136
+ // renderer to provide a more generic message
137
+ strategy.redirect = false;
138
+ configure(strategy);
139
+ function authenticate(req, res, next) {
140
+ passport.authenticate(strategy.name, function (err, user, info = {}) {
141
+ if (err)
142
+ return next(err);
143
+ req.user = user;
144
+ // For inactive or disabled accounts don't generate an authorization token
145
+ if (!user.active || !user.enabled) {
146
+ log.warn('Failed user login attempt: User ' + user.username + ' account is inactive or disabled.');
147
+ return next();
148
+ }
149
+ if (!user.authentication.authenticationConfigurationId) {
150
+ log.warn('Failed user login attempt: ' + user.authentication.type + ' is not configured');
151
+ return next();
152
+ }
153
+ if (!user.authentication.authenticationConfiguration.enabled) {
154
+ log.warn('Failed user login attempt: Authentication ' + user.authentication.authenticationConfiguration.title + ' is disabled.');
155
+ return next();
156
+ }
157
+ tokenService.generateToken(user._id.toString(), TokenAssertion.Authorized, 60 * 5)
158
+ .then(token => {
159
+ req.token = token;
160
+ req.user = user;
161
+ req.info = info;
162
+ next();
163
+ }).catch(err => next(err));
164
+ })(req, res, next);
165
+ }
166
+ app.get(`/auth/${strategy.name}/signin`, function (req, res, next) {
167
+ passport.authenticate(strategy.name, {
168
+ scope: strategy.settings.scope,
169
+ state: req.query.state
170
+ })(req, res, next);
171
+ });
172
+ app.get(`/auth/${strategy.name}/callback`, authenticate, function (req, res) {
173
+ if (req.query.state === 'mobile') {
174
+ let uri;
175
+ if (!req.user.active || !req.user.enabled) {
176
+ uri = `mage://app/invalid_account?active=${req.user.active}&enabled=${req.user.enabled}`;
177
+ }
178
+ else {
179
+ uri = `mage://app/authentication?token=${req.token}`;
180
+ }
181
+ if (strategy.redirect) {
182
+ res.redirect(uri);
183
+ }
184
+ else {
185
+ res.render('oauth', { uri: uri });
186
+ }
187
+ }
188
+ else {
189
+ res.render('authentication', { host: req.getRoot(), login: { token: req.token, user: req.user } });
190
+ }
191
+ });
192
+ }
193
+ ;
194
+ module.exports = {
195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AY,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;aAC3F;iBAAM;gBACJ,GAAG,GAAG,mCAAmC,GAAG,CAAC,KAAK,EAAE,CAAA;aACtD;YAED,IAAI,QAAQ,CAAC,QAAQ,EAAE;gBACpB,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;aACpB;iBAAM;gBACJ,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;aACpC;SACH;aAAM;YACJ,GAAG,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACrG;IACJ,CAAC,CACH,CAAC;AACL,CAAC;AAAA,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG;IACd,UAAU;CACZ,CAAA"}
@@ -0,0 +1,2 @@
1
+ export function initialize(strategy: any): void;
2
+ //# sourceMappingURL=openidconnect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openidconnect.d.ts","sourceRoot":"","sources":["../../src/authentication/openidconnect.js"],"names":[],"mappings":"AAsJA,gDAYC"}