@ngageoint/mage.service 6.3.0-beta.0

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 +76 -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 +151 -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 +26 -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 +69 -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 +206 -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 +39 -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 +295 -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 +295 -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 +39 -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 +133 -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 +73 -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 +81 -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 +61 -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 +506 -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 +201 -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 +108 -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 +107 -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 +580 -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 +26 -0
  378. package/lib/environment/env.d.ts.map +1 -0
  379. package/lib/environment/env.js +136 -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 +79 -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 +73 -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 +64 -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 +43 -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 +64 -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 +55 -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 +39 -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 +102 -0
  542. package/lib/models/authentication.d.ts.map +1 -0
  543. package/lib/models/authentication.js +148 -0
  544. package/lib/models/authentication.js.map +1 -0
  545. package/lib/models/authenticationconfiguration.d.ts +196 -0
  546. package/lib/models/authenticationconfiguration.d.ts.map +1 -0
  547. package/lib/models/authenticationconfiguration.js +102 -0
  548. package/lib/models/authenticationconfiguration.js.map +1 -0
  549. package/lib/models/cappedLocation.d.ts +59 -0
  550. package/lib/models/cappedLocation.d.ts.map +1 -0
  551. package/lib/models/cappedLocation.js +76 -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 +131 -0
  558. package/lib/models/device.d.ts.map +1 -0
  559. package/lib/models/device.js +205 -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 +831 -0
  564. package/lib/models/event.js.map +1 -0
  565. package/lib/models/export.d.ts +263 -0
  566. package/lib/models/export.d.ts.map +1 -0
  567. package/lib/models/export.js +105 -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 +41 -0
  572. package/lib/models/feature.js.map +1 -0
  573. package/lib/models/icon.d.ts +44 -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 +82 -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 +95 -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 +88 -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 +457 -0
  596. package/lib/models/observation.js.map +1 -0
  597. package/lib/models/role.d.ts +21 -0
  598. package/lib/models/role.d.ts.map +1 -0
  599. package/lib/models/role.js +78 -0
  600. package/lib/models/role.js.map +1 -0
  601. package/lib/models/setting.d.ts +53 -0
  602. package/lib/models/setting.d.ts.map +1 -0
  603. package/lib/models/setting.js +29 -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 +518 -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 +405 -0
  616. package/lib/models/user.js.map +1 -0
  617. package/lib/permissions/permissions.events.d.ts +65 -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 +262 -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 +206 -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 +368 -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 +19 -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 +201 -0
@@ -0,0 +1,580 @@
1
+ /// <reference types="node" />
2
+ import { UserId } from '../users/entities.users';
3
+ import { BBox, Feature, Geometry } from 'geojson';
4
+ import { MageEvent, MageEventAttrs, MageEventId } from '../events/entities.events';
5
+ import { PageOf, PagingParameters, PendingEntityId } from '../entities.global';
6
+ import { Form, FormField, FormId } from '../events/entities.events.forms';
7
+ import { JsonPrimitive } from '../entities.json_types';
8
+ export type ObservationId = string;
9
+ export interface ObservationAttrs extends Feature<Geometry, ObservationFeatureProperties> {
10
+ id: ObservationId;
11
+ eventId: MageEventId;
12
+ userId?: UserId;
13
+ deviceId?: string;
14
+ createdAt: Date;
15
+ lastModified: Date;
16
+ attachments: readonly Attachment[];
17
+ important?: Readonly<ObservationImportantFlag> | undefined;
18
+ /**
19
+ * TODO: scalability - potential problem if thousands of users favorite;
20
+ * this should not be returned to the client
21
+ */
22
+ favoriteUserIds: readonly UserId[];
23
+ /**
24
+ * * TODO: scalability - likely not a problem in practice most of the time
25
+ * * TODO: we do not actually have a reason to maintain an array of states -
26
+ * state should just be a single value object, and should not need
27
+ * a unique id
28
+ */
29
+ states: readonly ObservationState[];
30
+ }
31
+ export interface ObservationFeatureProperties {
32
+ /**
33
+ * This timestamp is a user-supplied timestamp that indicates the actual time
34
+ * the observation occurred.
35
+ */
36
+ timestamp: Date;
37
+ forms: FormEntry[];
38
+ }
39
+ export interface ObservationImportantFlag {
40
+ userId?: UserId;
41
+ timestamp?: Date;
42
+ description?: string;
43
+ }
44
+ export interface ObservationState {
45
+ id: string | PendingEntityId;
46
+ name: 'active' | 'archived';
47
+ userId?: UserId | undefined;
48
+ }
49
+ export type FormEntryId = string;
50
+ /**
51
+ * TODO: create strong types and union for form field values, basically json
52
+ * primitives along with attachment array and geojson geometry object
53
+ */
54
+ export interface FormEntry {
55
+ id: FormEntryId;
56
+ formId: FormId;
57
+ [formFieldName: string]: FormFieldEntry;
58
+ }
59
+ export type FormFieldEntryItem = Exclude<JsonPrimitive, null> | Geometry | Date;
60
+ export type FormFieldEntry = FormFieldEntryItem | FormFieldEntryItem[] | null;
61
+ export type AttachmentId = string;
62
+ /**
63
+ * TODO: Currently the web app uses the `name` and `contentType` keys in the
64
+ * attachment object to correlate pending file uploads to newly saved
65
+ * attachments. While this works most of the time, especially for the web
66
+ * when uplaods are nearly immediate, maybe something like a `pendingUploadId`
67
+ * key would be more reliable for correlating a saved attachment record to
68
+ * the file that the client intends to upload for that attachment.
69
+ */
70
+ export interface Attachment {
71
+ /**
72
+ * Attachment IDs are globally unique, not unique only in the context of an
73
+ * observation or form entry.
74
+ */
75
+ id: AttachmentId;
76
+ observationFormId: FormEntryId;
77
+ fieldName: string;
78
+ /**
79
+ * TODO: Nothing seems to use this property. Should we remove it, or
80
+ * actually use it to inform browser caching?
81
+ */
82
+ lastModified?: Date;
83
+ /**
84
+ * The content type is an IANA standard media type string, e.g., `image/jpeg`.
85
+ */
86
+ contentType?: string;
87
+ size?: number;
88
+ name?: string;
89
+ width?: number;
90
+ height?: number;
91
+ /**
92
+ * The attachment's content locator is an abstract term that mostly exists
93
+ * to reconcile with the legacy design of storing the relative file system
94
+ * path of an attachment's file on the attachment document itself. However,
95
+ * as MAGE transitions to cloud-native infrastructure, one can more easily
96
+ * envision swapping some sort of cloud-based BLOB storage service for the
97
+ * legacy local file system storage. Renaming the old `relativePath`
98
+ * property to `contentLocator` is an attempt to allow for saving a lookup key
99
+ * that does not necessarily imply an underlying file system as the storage
100
+ * layer. Implementations of the abstract {@link AttachmentStore} interface
101
+ * would assign their own lookup key to this property, although the intention
102
+ * of that interface's design is to be completely opaque with respect to how
103
+ * an implementation stores and indexes attachment content. An attachment
104
+ * store implementation may not use `contentLocator` at all.
105
+ */
106
+ contentLocator?: string;
107
+ /**
108
+ * TODO: this needs to allow a more robust value, such as
109
+ * `undefined | boolean` or maybe even allow `{ error: string }` so the
110
+ * image plugin's unprocessed attachment query can easily find attachments
111
+ * that have not yet been touched vs. attachments whose content could not be
112
+ * oriented. admins should also be able to easily query for the faulty
113
+ * attachments to take corrective action if possible.
114
+ *
115
+ * also, because this and the `thumbnails` field are specific to the image
116
+ * plugin, they should both be moved out of the core domain type.
117
+ */
118
+ oriented: boolean;
119
+ thumbnails: Thumbnail[];
120
+ }
121
+ export interface Thumbnail {
122
+ minDimension: number;
123
+ /**
124
+ * See {@link Attachment.contentLocator} for an explanation.
125
+ */
126
+ contentLocator?: string;
127
+ contentType?: string;
128
+ size?: number;
129
+ name?: string;
130
+ width?: number;
131
+ height?: number;
132
+ }
133
+ export declare function copyObservationAttrs(from: ObservationAttrs): ObservationAttrs;
134
+ export declare function copyAttachmentAttrs(from: Attachment): Attachment;
135
+ export declare function copyThumbnailAttrs(from: Thumbnail): Thumbnail;
136
+ export declare function copyObservationStateAttrs(from: ObservationState): ObservationState;
137
+ export declare function copyImportantFlagAttrs(from: ObservationImportantFlag): ObservationImportantFlag;
138
+ /**
139
+ * The intention of this class is to provide a mutation model for observation
140
+ * updates. While `ObservationAttrs` is more just raw the keys and values of
141
+ * observations, this class retains some extra context for validation so
142
+ * the client can make changes to the observation data while receiving
143
+ * validation feedback for every operation performed on the observation.
144
+ * TODO: add domain event tracking to this class
145
+ */
146
+ export declare class Observation implements Readonly<ObservationAttrs> {
147
+ #private;
148
+ /**
149
+ * Validate the given observation attributes against the given MAGE event's
150
+ * constraints and forms, and create the corresponding `Observation` instance
151
+ * with the validation result.
152
+ * @param attrs
153
+ * @param mageEvent
154
+ */
155
+ static evaluate(attrs: ObservationAttrs, mageEvent: MageEvent): Observation;
156
+ /**
157
+ * TODO: This does not currently do anything besides assigning the
158
+ * `lastModified` timestamp on the updated observation and calling
159
+ * {@link Observation.evaluate()} with the given update attributes.
160
+ * Eventually this should perform the logic to find the differences and
161
+ * produce the domain events resulting from updating the target observation
162
+ * to the update attributes.
163
+ *
164
+ * Return an {@link ObservationUpdateError} if the event IDs on the target
165
+ * and udpate do not match.
166
+ *
167
+ * @param target
168
+ * @param update
169
+ * @returns
170
+ */
171
+ static assignTo(target: Observation, update: ObservationAttrs): Observation | ObservationUpdateError;
172
+ readonly id: string;
173
+ readonly eventId: number;
174
+ readonly mageEvent: MageEvent;
175
+ /**
176
+ * If an observation has no user ID, the user that created the observation
177
+ * was removed from the system.
178
+ */
179
+ readonly userId?: UserId | undefined;
180
+ /**
181
+ * If an observation has no device ID, the device that submitted the
182
+ * observation was removed from the system.
183
+ */
184
+ readonly deviceId?: string | undefined;
185
+ readonly createdAt: Date;
186
+ readonly lastModified: Date;
187
+ readonly important?: Readonly<ObservationImportantFlag> | undefined;
188
+ readonly states: readonly ObservationState[];
189
+ readonly favoriteUserIds: readonly UserId[];
190
+ readonly type = "Feature";
191
+ readonly bbox?: BBox | undefined;
192
+ readonly geometry: Readonly<Geometry>;
193
+ readonly properties: Readonly<ObservationFeatureProperties>;
194
+ readonly attachments: readonly Attachment[];
195
+ readonly pendingEvents: readonly PendingObservationDomainEvent[];
196
+ constructor(...args: unknown[]);
197
+ get validation(): ObservationValidationResult;
198
+ /**
199
+ * This is a convenience accessor for {@link ObservationFeatureProperties.timestamp}.
200
+ */
201
+ get timestamp(): Date;
202
+ /**
203
+ * This is a convenience accessor for {@link ObservationFeatureProperties.forms}.
204
+ */
205
+ get formEntries(): FormEntry[];
206
+ formEntryForId(id: FormEntryId): FormEntry | null;
207
+ attachmentFor(id: AttachmentId): Attachment | null;
208
+ attachmentsForField(fieldName: string, formEntryId: FormEntryId): Attachment[];
209
+ }
210
+ export declare enum ObservationDomainEventType {
211
+ AttachmentsRemoved = "Observation.AttachmentsRemoved"
212
+ }
213
+ /**
214
+ * A pending domain event waits for dispatch in the {@link Observation.pendingEvents | pending events}
215
+ * on the observation instance that generated the event. To avoid a circular
216
+ * reference, pending events do not have a member for the observation instance
217
+ * that generated them.
218
+ */
219
+ export type PendingObservationDomainEvent = {
220
+ readonly type: ObservationDomainEventType;
221
+ } & ({
222
+ type: ObservationDomainEventType.AttachmentsRemoved;
223
+ readonly removedAttachments: readonly Readonly<Attachment>[];
224
+ });
225
+ /**
226
+ * This type simply adds the subject observation instance to the {@link PendingObservationDomainEvent}
227
+ * so listeners of the event will have the observation that generated the
228
+ * event when received.
229
+ */
230
+ export type ObservationEmitted<Pending extends PendingObservationDomainEvent> = Pending & {
231
+ /**
232
+ * For now, this value is the snapshot of the observation just after the save
233
+ * operation that initiated domain event dispatch. Hence, this observation
234
+ * will have no pending events and reflects the state of the observation
235
+ * after the mutations that created the domain events. That understanding
236
+ * could change if more domain event requirements present themselves, but
237
+ * this is sufficient for the, at this time, singular domain event that
238
+ * supports attachment removal.
239
+ */
240
+ readonly observation: Observation;
241
+ };
242
+ export type AttachmentsRemovedDomainEvent = Extract<PendingObservationDomainEvent, {
243
+ type: ObservationDomainEventType.AttachmentsRemoved;
244
+ }>;
245
+ export interface ObservationValidationResult {
246
+ readonly hasErrors: boolean;
247
+ readonly coreAttrsErrors: {
248
+ readonly [attr in ObservationValidationCoreAttrKey]?: string;
249
+ };
250
+ readonly formCountErrors: readonly [FormId, FormCountError][];
251
+ readonly formEntryErrors: readonly [number, FormEntryValidationError][];
252
+ /**
253
+ * This list contains attachment error map entries where the key is the
254
+ * position of the attachment in the `attachments` array on the observation,
255
+ * and the value is the `AttachmentValidationError`.
256
+ */
257
+ readonly attachmentErrors: readonly [number, AttachmentValidationError][];
258
+ readonly totalFormCountError: TotalFormCountError | null;
259
+ }
260
+ export declare function validateObservation(observationAttrs: ObservationAttrs, mageEvent: MageEvent): ObservationValidationResult;
261
+ export type ObservationValidationCoreAttrKey = 'eventId' | 'type' | 'geometry' | 'timestamp' | 'forms';
262
+ export declare const MinFormsConstraint: unique symbol;
263
+ export declare const MaxFormsConstraint: unique symbol;
264
+ export declare class TotalFormCountError {
265
+ readonly constraint: typeof MinFormsConstraint | typeof MaxFormsConstraint;
266
+ readonly constraintCount: number;
267
+ static tooFewFormEntries(mageEvent: MageEventAttrs): TotalFormCountError;
268
+ static tooManyFormEntries(mageEvent: MageEventAttrs): TotalFormCountError;
269
+ private constructor();
270
+ message(): string;
271
+ }
272
+ export declare class FormCountError {
273
+ readonly constraint: typeof MinFormsConstraint | typeof MaxFormsConstraint;
274
+ readonly constraintCount: number;
275
+ readonly formId: FormId;
276
+ readonly formName: string;
277
+ static tooFewEntriesForForm(form: Form): FormCountError;
278
+ static tooManyEntriesForForm(form: Form): FormCountError;
279
+ private constructor();
280
+ message(): string;
281
+ }
282
+ export declare class FormEntryValidationError {
283
+ #private;
284
+ readonly formEntryId: FormEntryId;
285
+ readonly formEntryPosition: number;
286
+ /**
287
+ * If there is no form reference error, set the form name for convenience
288
+ * when building the validation error message text.
289
+ */
290
+ formName: string | null;
291
+ constructor(formEntryId: FormEntryId, formEntryPosition: number);
292
+ addEntryLevelError(x: FormEntryValidationErrorReason): this;
293
+ addFieldError(x: FormFieldValidationError): this;
294
+ get entryLevelErrors(): Set<FormEntryValidationErrorReason>;
295
+ /**
296
+ * This is a map of field names to form field validation errors.
297
+ */
298
+ get fieldErrors(): Map<string, FormFieldValidationError>;
299
+ }
300
+ export declare enum FormEntryValidationErrorReason {
301
+ FormRef = "FormEntryValidationErrorReason.FormRef",
302
+ DuplicateId = "FormEntryValidationErrorReason.DuplicateId"
303
+ }
304
+ export type FormFieldValidationErrorAttrs = {
305
+ [Prop in keyof Omit<FormFieldValidationError, 'error'>]: FormFieldValidationError[Prop];
306
+ };
307
+ export declare enum FieldConstraintKey {
308
+ Value = "value",
309
+ Min = "min",
310
+ Max = "max",
311
+ Required = "required"
312
+ }
313
+ export declare class FormFieldValidationError {
314
+ readonly fieldName: string;
315
+ readonly constraint: FieldConstraintKey;
316
+ readonly message: string;
317
+ constructor(attrs: FormFieldValidationErrorAttrs);
318
+ /**
319
+ * `error` is a readonly accessor alias for `validationRuleKey` for backward
320
+ * compatibility.
321
+ * TODO: verify this is still necessary (NECESSARY?!)
322
+ */
323
+ get error(): string;
324
+ }
325
+ export declare enum AttachmentValidationErrorReason {
326
+ FieldRef = "AttachmentValidationErrorReason.FieldRef",
327
+ FormEntryRef = "AttachmentValidationErrorReason.FormEntryRef",
328
+ DuplicateId = "AttachmentValidationErrorReason.DuplicateId"
329
+ }
330
+ export declare class AttachmentValidationError {
331
+ readonly reason: AttachmentValidationErrorReason;
332
+ readonly message: string;
333
+ constructor(reason: AttachmentValidationErrorReason, message: string);
334
+ }
335
+ export declare function validationResultMessage(result: ObservationValidationResult): string;
336
+ export declare class ObservationUpdateError extends Error {
337
+ readonly reason: ObservationUpdateErrorReason;
338
+ static eventIdMismatch(expected: MageEventId, actual: MageEventId | undefined): ObservationUpdateError;
339
+ constructor(reason: ObservationUpdateErrorReason, message: string);
340
+ }
341
+ export declare enum ObservationUpdateErrorReason {
342
+ EventId = "event_id"
343
+ }
344
+ export declare function formEntryForId(formEntryId: FormEntryId, observation: ObservationAttrs): FormEntry | null;
345
+ export declare function attachmentsForField(field: FormField | string, formEntry: FormEntry | FormEntryId, observationAttrs: ObservationAttrs): Attachment[];
346
+ /**
347
+ * Remove the form entry with the given ID and return the resulting
348
+ * (potentially invalid) observation.
349
+ *
350
+ * TODO: add a `FormEntryNotFound` error similar to `removeAttachment()`
351
+ */
352
+ export declare function removeFormEntry(observation: Observation, formEntryId: FormEntryId): Observation;
353
+ export type AttachmentCreateAttrs = Omit<Attachment, 'id' | 'observationFormId' | 'fieldName' | 'lastModified'>;
354
+ export type AttachmentPatchAttrs = Partial<AttachmentCreateAttrs>;
355
+ export type AttachmentContentPatchAttrs = Required<Pick<Attachment, 'contentLocator' | 'size'>>;
356
+ export type ThumbnailContentPatchAttrs = Required<Pick<Thumbnail, 'contentLocator' | 'size'>> & Thumbnail;
357
+ /**
358
+ * Add the given attachment to the given observation. Return a new observation
359
+ * instance with the added attachment, or return an {@link AttachmentAddError}
360
+ * if the given attachment does not reference a valid form entry and field.
361
+ * Note that the returned observation may still have validation errors resulting
362
+ * from the added attachment if the attachment violates the associated form
363
+ * constraints, such as min/max or allowed attachment types.
364
+ * @param observation
365
+ * @param fieldName
366
+ * @param formEntryId
367
+ * @param attrs
368
+ * @returns
369
+ */
370
+ export declare function addAttachment(observation: Observation, attachmentId: AttachmentId, fieldName: string, formEntryId: FormEntryId, attrs: AttachmentCreateAttrs): Observation | AttachmentAddError;
371
+ /**
372
+ * Update the attachment for the given ID with the given patch object. Keys
373
+ * that are present in the patch whose values are `undefined` will assign
374
+ * `undefined` to the resulting updated attachment. Keys not present in the
375
+ * patch will have no affect on the resulting updated attachment.
376
+ * @param observation
377
+ * @param attachmentId
378
+ * @param patch
379
+ * @returns
380
+ */
381
+ export declare function patchAttachment(observation: Observation, attachmentId: AttachmentId, patch: AttachmentPatchAttrs): Observation | AttachmentNotFoundError;
382
+ export declare function removeAttachment(observation: Observation, attachmentId: AttachmentId): Observation | AttachmentNotFoundError;
383
+ /**
384
+ * Add the given thumbnail to the given attachment. If the attachment already
385
+ * has a thumbnail at the same minimum dimension as the given thumbnail,
386
+ * replace the existing thumbnail with the given thumbnail at the same position
387
+ * in the thumbnails array.
388
+ * @param observation
389
+ * @param attachmentId
390
+ * @param thumbnail
391
+ * @returns
392
+ */
393
+ export declare function putAttachmentThumbnailForMinDimension(observation: Observation, attachmentId: AttachmentId, thumbnail: Thumbnail): Observation | AttachmentNotFoundError;
394
+ /**
395
+ * Return the index of the thumbnail on the given attachment that best satisfies
396
+ * the given target dimension. That will be the thumbnail with the smallest
397
+ * {@link Attachment.minDimension} greater than the target dimension.
398
+ */
399
+ export declare function thumbnailIndexForTargetDimension(targetDimension: number, attachment: Attachment): number | undefined;
400
+ export declare class AttachmentAddError extends Error {
401
+ readonly validationErr: AttachmentValidationError;
402
+ static invalidNewAttachment(invalidErr: AttachmentValidationError): AttachmentAddError;
403
+ constructor(validationErr: AttachmentValidationError);
404
+ }
405
+ export declare class AttachmentNotFoundError extends Error {
406
+ readonly attachmentId: AttachmentId;
407
+ constructor(attachmentId: AttachmentId);
408
+ }
409
+ /**
410
+ * This repository provides persistence operations for `Observation` entities
411
+ * within the scope of one MAGE event.
412
+ */
413
+ export interface EventScopedObservationRepository {
414
+ readonly eventScope: MageEventId;
415
+ allocateObservationId(): Promise<ObservationId>;
416
+ /**
417
+ * Save the given observation. This operation uses PUT semantics, so
418
+ * essentially overwrites an existing observation with the given attributes.
419
+ * Therefore, the risk of conflicting udpates exists, when two or more
420
+ * clients fetch the same version of an observation, and each client makes
421
+ * different changes to the observation, the client that saves its changes
422
+ * last will win, overwriting the changes the other clients saved.
423
+ * @param observation
424
+ */
425
+ save(observation: Observation): Promise<Observation | ObservationRepositoryError>;
426
+ findById(id: ObservationId): Promise<Observation | null>;
427
+ /**
428
+ * Return the most recent observation in the event as determined by
429
+ * the observation's `lastModified` timestamp. Return null if there are no
430
+ * observations in the event.
431
+ * @returns an `Observation` object or `null`
432
+ */
433
+ findLatest(): Promise<ObservationAttrs | null>;
434
+ findLastModifiedAfter(timestamp: number, paging: PagingParameters): Promise<PageOf<ObservationAttrs>>;
435
+ /**
436
+ * Update the specified attachment with the given attributes. This
437
+ * persistence function exists alongside the {@link save} method to prevent
438
+ * concurrent updates from colliding and overwriting each other. That
439
+ * situation is common when storing attachment content because a single
440
+ * client will intiate several parallel content uploads for multiple
441
+ * attachments. Each separate content upload could fetch the same version of
442
+ * the observation from the database, store the content, then update that
443
+ * version of the observation record. If using the whole observation `save()`
444
+ * method to apply the update just for a single attachment, each save
445
+ * operation would overwrite the changes for the save operations that came
446
+ * before. Return the updated `Observation` entity instance on a successful
447
+ * update. Return an `AttachmentNotFoundError` if the given observation did
448
+ * not have an attachment with the given attachment ID. Return null if the
449
+ * given observation does not exist in the database.
450
+ *
451
+ * Note that this is a shallow patch, so if the patch has the `thumbnails`
452
+ * key, the method will persist the value of that key to the database, as
453
+ * opposed to deeply patching any thumbnails present in the array. This
454
+ * method should essentially use {@link patchAttachment} to perform the
455
+ * patch for the resulting attachment.
456
+ *
457
+ * TODO: Account for patch invalidating the attachment media type.
458
+ */
459
+ patchAttachment(observation: Observation, attachmentId: AttachmentId, contentInfo: AttachmentPatchAttrs): Promise<Observation | AttachmentNotFoundError | null>;
460
+ /**
461
+ * Because attachments reference a form entry by its ID, an API to generate
462
+ * form entry IDs is necessary.
463
+ */
464
+ nextFormEntryIds(count?: number): Promise<FormEntryId[]>;
465
+ nextAttachmentIds(count?: number): Promise<AttachmentId[]>;
466
+ }
467
+ export declare class ObservationRepositoryError extends Error {
468
+ readonly code: ObservationRepositoryErrorCode;
469
+ constructor(code: ObservationRepositoryErrorCode, message?: string);
470
+ }
471
+ export declare enum ObservationRepositoryErrorCode {
472
+ InvalidObservationId = "ObservationRepositoryError.InvalidObservationId",
473
+ InvalidObservation = "ObservationRepositoryError.InvalidObservation"
474
+ }
475
+ export interface ObservationRepositoryForEvent {
476
+ (event: MageEventId): Promise<EventScopedObservationRepository>;
477
+ }
478
+ export type StagedAttachmentContentId = unknown;
479
+ export declare class StagedAttachmentContentRef {
480
+ readonly id: StagedAttachmentContentId;
481
+ constructor(id: StagedAttachmentContentId);
482
+ }
483
+ export declare class StagedAttachmentContent extends StagedAttachmentContentRef {
484
+ readonly tempLocation: NodeJS.WritableStream;
485
+ constructor(id: StagedAttachmentContentId, tempLocation: NodeJS.WritableStream);
486
+ }
487
+ /**
488
+ * TODO: Maybe instead of the `null | Observation | AttachmentStoreError`
489
+ * pattern many of these method signatures use, a single `AttachmentStoreResult`
490
+ * class with a `success` flag and `observation` and `error` properties would
491
+ * be eaiser for clients to consume.
492
+ */
493
+ export interface AttachmentStore {
494
+ /**
495
+ * Create a temporary staging area to hold attachment content pending
496
+ * persistence of the associated attachment record to the observation in the
497
+ * database. After saving the attachment record to the parent observation,
498
+ * the client must move the temporary content to the proper permanent
499
+ * location for the saved attachment using the {@link saveContent()} function.
500
+ * This mechanism is useful in cases when a content stream exists, but the
501
+ * provider of the content stream needs to examine the bytes while streaming
502
+ * to the temporary location in order to determine the attachment meta-data.
503
+ * This mechanism also facilitates periodic cleanup of orphaned temporary
504
+ * content.
505
+ */
506
+ stagePendingContent(): Promise<StagedAttachmentContent>;
507
+ /**
508
+ * Save the given content to the store for the specified attachment. If the
509
+ * `content` argument is an ID for {@link StagedAttachmentContent staged content},
510
+ * the store will move the content at the temporary location to the permanent
511
+ * location for the specified attachment. If the store assigns a new
512
+ * {@link Attachment.contentLocator | content locator} to the attachment after
513
+ * a successful save, and/or changes the size of the attachment to the actual
514
+ * number of bytes written, return a {@link AttachmentContentPatchAttrs patch}
515
+ * to {@link EventScopedObservationRepository.patchAttachment update}
516
+ * the attachment new observation instance with the {@link patchAttachment | patched}
517
+ * attachment. Return `null` if the save succeeded and no change to the
518
+ * attachment was necessary. Return an {@link AttachmentStoreError} if the
519
+ * save failed.
520
+ */
521
+ saveContent(content: NodeJS.ReadableStream | StagedAttachmentContentRef, attachmentId: AttachmentId, observation: Observation): Promise<null | AttachmentContentPatchAttrs | AttachmentStoreError>;
522
+ /**
523
+ * Similar to {@link saveContent()}, but for thumbnails of attachments.
524
+ * The store distinguishes thumbnails by their standard minimum dimension.
525
+ * If the `contentLocator` or the `size` of the stored thumbnail content is
526
+ * different than what is on the input thumbnail meta-data, return thumbnail
527
+ * attributes suitable to pass to {@link putAttachmentThumbnailForMinDimension}
528
+ * to update the observation with the new attachment thumbnail.
529
+ */
530
+ saveThumbnailContent(content: NodeJS.ReadableStream | StagedAttachmentContentId, minDimension: number, attachmentId: AttachmentId, observation: Observation): Promise<null | ThumbnailContentPatchAttrs | AttachmentStoreError>;
531
+ /**
532
+ * Return a read stream of the content for the given attachment. The client
533
+ * can specify an optional zero-based range of bytes to read from the
534
+ * content, which will return a read stream limited the specified range.
535
+ * Note that the end index of the range is inclusive, as is the case with
536
+ * Node's streams API, as opposed to array and string operations, for
537
+ * which the end index is usually exclusive. Return `null` if not content
538
+ * exists for the given attachment. Return an `AttachmentStoreError` if
539
+ * an error occurred reading from the underlying storage.
540
+ */
541
+ readContent(attachmentId: AttachmentId, observation: Observation, range?: {
542
+ start: number;
543
+ end?: number;
544
+ }): Promise<NodeJS.ReadableStream | null | AttachmentStoreError>;
545
+ readThumbnailContent(minDimension: number, attachmentId: AttachmentId, observation: Observation): Promise<NodeJS.ReadableStream | null | AttachmentStoreError>;
546
+ /**
547
+ * Delete the given attachment's content, including thumbnail content. If
548
+ * the attachment no longer exists on the given observation, return null upon
549
+ * success. If the attachment still exists on the observation, return
550
+ * {@link AttachmentContentPatchAttrs patch} attributes that reflect the
551
+ * missing content to {@link EventScopedObservationRepository.patchAttachment update}
552
+ * the attachment.
553
+ */
554
+ deleteContent(attachment: Attachment, observation: Observation): Promise<null | AttachmentPatchAttrs | AttachmentStoreError>;
555
+ }
556
+ export declare class AttachmentStoreError extends Error {
557
+ readonly errorCode: AttachmentStoreErrorCode;
558
+ static invalidAttachmentId(attachmentId: AttachmentId, observation: Observation): AttachmentStoreError;
559
+ static invalidThumbnailDimension(minDimension: number, attachmentId: AttachmentId, observation: Observation): AttachmentStoreError;
560
+ constructor(errorCode: AttachmentStoreErrorCode, message?: string);
561
+ }
562
+ export declare enum AttachmentStoreErrorCode {
563
+ /**
564
+ * The given attachment ID was not found in the given observation's
565
+ * attachment list.
566
+ */
567
+ InvalidAttachmentId = "AttachmentStoreError.InvalidAttachmentId",
568
+ InvalidThumbnailDimension = "AttachmentStoreError.InvalidThumbnailDimension",
569
+ /**
570
+ * The content for the given attachment ID was not found in the attachment
571
+ * store.
572
+ */
573
+ ContentNotFound = "AttachmentStoreError.ContentNotFound",
574
+ /**
575
+ * The underlying storage system, e.g. file system, raised an error during
576
+ * some I/O operation.
577
+ */
578
+ StorageError = "AttachmentStoreError.StorageError"
579
+ }
580
+ //# sourceMappingURL=entities.observations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.observations.d.ts","sourceRoot":"","sources":["../../../src/entities/observations/entities.observations.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAClF,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC9E,OAAO,EAAE,IAAI,EAAE,SAAS,EAAiB,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAGtD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAA;AAElC,MAAM,WAAW,gBAAiB,SAAQ,OAAO,CAAC,QAAQ,EAAE,4BAA4B,CAAC;IACvF,EAAE,EAAE,aAAa,CAAA;IACjB,OAAO,EAAE,WAAW,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,IAAI,CAAA;IACf,YAAY,EAAE,IAAI,CAAA;IAClB,WAAW,EAAE,SAAS,UAAU,EAAE,CAAA;IAClC,SAAS,CAAC,EAAE,QAAQ,CAAC,wBAAwB,CAAC,GAAG,SAAS,CAAA;IAC1D;;;OAGG;IACH,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC;;;;;OAKG;I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,GAAG,oBAAoB,CAAC,CAAA;IAC/N;;;;;;;;;OASG;IACH,WAAW,CAAC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,GAAG,IAAI,GAAG,oBAAoB,CAAC,CAAA;IACxK,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,GAAG,IAAI,GAAG,oBAAoB,CAAC,CAAA;IAC9J;;;;;;;OAOG;IACH,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,GAAG,oBAAoB,GAAG,oBAAoB,CAAC,CAAA;CAC7H;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAUjC,QAAQ,CAAC,SAAS,EAAE,wBAAwB;IARxD,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,GAAG,oBAAoB;IAItG,MAAM,CAAC,yBAAyB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,GAAG,oBAAoB;gBAI7G,SAAS,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,MAAM;CAI3E;AAED,oBAAY,wBAAwB;IAClC;;;OAGG;IACH,mBAAmB,6CAA6C;IAChE,yBAAyB,mDAAmD;IAC5E;;;OAGG;IACH,eAAe,yCAAyC;IACxD;;;OAGG;IACH,YAAY,sCAAsC;CACnD"}
@@ -0,0 +1,5 @@
1
+ import { FormField } from '../events/entities.events.forms';
2
+ import { FormEntryId, ObservationAttrs } from './entities.observations';
3
+ import { SimpleFieldValidationResult } from './entities.observations.fields';
4
+ export declare const AttachmentFieldValidation: <Failed, Succeeded>(field: FormField, formEntryId: FormEntryId, observationAttrs: ObservationAttrs, result: SimpleFieldValidationResult<Failed, Succeeded>) => Failed | Succeeded;
5
+ //# sourceMappingURL=entities.observations.fields.attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.observations.fields.attachment.d.ts","sourceRoot":"","sources":["../../../src/entities/observations/entities.observations.fields.attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAC1F,OAAO,EAA2C,WAAW,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAChH,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAG5E,eAAO,MAAM,yBAAyB,6BAAgE,SAAS,eAAe,WAAW,oBAAoB,gBAAgB,+EAiB5K,CAAA"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttachmentFieldValidation = void 0;
4
+ const entities_events_forms_1 = require("../events/entities.events.forms");
5
+ const entities_observations_1 = require("./entities.observations");
6
+ const AttachmentFieldValidation = function AttachmentFieldValidation(field, formEntryId, observationAttrs, result) {
7
+ var _a;
8
+ const attachments = (0, entities_observations_1.attachmentsForField)(field, formEntryId, observationAttrs);
9
+ if (typeof field.min === 'number' && attachments.length < field.min) {
10
+ return result.failedBecauseTheEntry(`requires at least ${field.min} ${field.min > 1 ? 'attachments' : 'attachment'}`, entities_observations_1.FieldConstraintKey.Min);
11
+ }
12
+ if (typeof field.max === 'number' && attachments.length > field.max) {
13
+ return result.failedBecauseTheEntry(`allows at most ${field.max} ${field.max > 1 ? 'attachments' : 'attachment'}`, entities_observations_1.FieldConstraintKey.Max);
14
+ }
15
+ // TODO: ensure new attachment content types
16
+ // TODO: attachmentTypeIsValidForField() should probably just move here
17
+ // TODO: invalidate if form entry has a value?
18
+ if (attachments.some(x => !(0, entities_events_forms_1.attachmentTypeIsValidForField)(field, x.contentType))) {
19
+ return result.failedBecauseTheEntry(`allows only content of type ${(_a = field.allowedAttachmentTypes) === null || _a === void 0 ? void 0 : _a.join(', ')}`);
20
+ }
21
+ return result.succeeded();
22
+ };
23
+ exports.AttachmentFieldValidation = AttachmentFieldValidation;
24
+ //# sourceMappingURL=entities.observations.fields.attachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.observations.fields.attachment.js","sourceRoot":"","sources":["../../../src/entities/observations/entities.observations.fields.attachment.ts"],"names":[],"mappings":";;;AAAA,2EAA0F;AAC1F,mEAAgH;AAIzG,MAAM,yBAAyB,GAAG,SAAS,yBAAyB,CAAoB,KAAgB,EAAE,WAAwB,EAAE,gBAAkC,EAAE,MAAsD;;IACnO,MAAM,WAAW,GAAG,IAAA,2CAAmB,EAAC,KAAK,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAA;IAC7E,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,EAAE;QACnE,OAAO,MAAM,CAAC,qBAAqB,CAAC,qBAAqB,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,0CAAkB,CAAC,GAAG,CAAC,CAAA;KAC9I;IACD,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,EAAE;QACnE,OAAO,MAAM,CAAC,qBAAqB,CAAC,kBAAkB,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,0CAAkB,CAAC,GAAG,CAAC,CAAA;KAC3I;IAED,4CAA4C;IAC5C,uEAAuE;IACvE,8CAA8C;IAE9C,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAA,qDAA6B,EAAC,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE;QAC/E,OAAO,MAAM,CAAC,qBAAqB,CAAC,+BAA+B,MAAA,KAAK,CAAC,sBAAsB,0CAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;KAC/G;IACD,OAAO,MAAM,CAAC,SAAS,EAAE,CAAA;AAC3B,CAAC,CAAA;AAjBY,QAAA,yBAAyB,6BAiBrC"}
@@ -0,0 +1,3 @@
1
+ import { SimpleFieldValidation } from './entities.observations.fields';
2
+ export declare const CheckboxFieldValidation: SimpleFieldValidation;
3
+ //# sourceMappingURL=entities.observations.fields.checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.observations.fields.checkbox.d.ts","sourceRoot":"","sources":["../../../src/entities/observations/entities.observations.fields.checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAMtE,eAAO,MAAM,uBAAuB,EAAE,qBAQrC,CAAA"}