@angular/fire 7.6.1 → 16.0.0-canary.5793d6f

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 (515) hide show
  1. package/analytics/analytics.module.d.ts +2 -2
  2. package/analytics/is-analytics-supported-factory.d.ts +4 -0
  3. package/analytics/screen-tracking.service.d.ts +3 -3
  4. package/app-check/app-check.d.ts +0 -6
  5. package/app-check/app-check.module.d.ts +3 -4
  6. package/app-check/public_api.d.ts +2 -1
  7. package/auth/auth.module.d.ts +2 -2
  8. package/auth-guard/auth-guard.d.ts +6 -6
  9. package/compat/analytics/analytics.d.ts +1 -3
  10. package/compat/analytics/analytics.module.d.ts +1 -1
  11. package/compat/analytics/screen-tracking.service.d.ts +1 -1
  12. package/compat/analytics/user-tracking.service.d.ts +1 -1
  13. package/compat/auth/auth.d.ts +4 -4
  14. package/compat/auth-guard/auth-guard.d.ts +8 -6
  15. package/compat/database/database.d.ts +4 -4
  16. package/compat/database/interfaces.d.ts +14 -14
  17. package/compat/database/list/audit-trail.d.ts +1 -1
  18. package/compat/database/list/create-reference.d.ts +1 -1
  19. package/compat/database/list/data-operation.d.ts +1 -1
  20. package/compat/database/list/state-changes.d.ts +1 -1
  21. package/compat/database/object/create-reference.d.ts +1 -1
  22. package/compat/database/observable/fromRef.d.ts +1 -1
  23. package/compat/database/utils.d.ts +1 -1
  24. package/compat/firebase.app.module.d.ts +1 -1
  25. package/compat/firestore/collection/collection.d.ts +2 -2
  26. package/compat/firestore/collection-group/collection-group.d.ts +2 -2
  27. package/compat/firestore/document/document.d.ts +4 -4
  28. package/compat/firestore/firestore.d.ts +7 -7
  29. package/compat/firestore/interfaces.d.ts +19 -19
  30. package/compat/functions/functions.d.ts +3 -3
  31. package/compat/messaging/messaging.d.ts +2 -2
  32. package/compat/performance/performance.d.ts +2 -2
  33. package/compat/proxy.d.ts +8 -8
  34. package/compat/remote-config/interfaces.d.ts +1 -1
  35. package/compat/remote-config/remote-config.d.ts +15 -49
  36. package/compat/storage/interfaces.d.ts +8 -8
  37. package/compat/storage/observable/fromTask.d.ts +1 -2
  38. package/compat/storage/pipes/storageUrl.pipe.d.ts +1 -1
  39. package/compat/storage/ref.d.ts +1 -1
  40. package/compat/storage/storage.d.ts +3 -3
  41. package/compat/storage/task.d.ts +1 -1
  42. package/core.d.ts +8 -12
  43. package/database/database.module.d.ts +2 -2
  44. package/{esm2015/analytics/analytics.js → esm2022/analytics/analytics.mjs} +1 -1
  45. package/esm2022/analytics/analytics.module.mjs +94 -0
  46. package/esm2022/analytics/is-analytics-supported-factory.mjs +16 -0
  47. package/esm2022/analytics/overrides.mjs +3 -0
  48. package/esm2022/analytics/screen-tracking.service.mjs +148 -0
  49. package/esm2022/analytics/user-tracking.service.mjs +44 -0
  50. package/{esm2015/app/app.js → esm2022/app/app.mjs} +1 -1
  51. package/esm2022/app/app.module.mjs +85 -0
  52. package/esm2022/app-check/app-check.mjs +10 -0
  53. package/esm2022/app-check/app-check.module.mjs +78 -0
  54. package/esm2022/app-check/public_api.mjs +5 -0
  55. package/{esm2015/auth/auth.js → esm2022/auth/auth.mjs} +1 -1
  56. package/esm2022/auth/auth.module.mjs +71 -0
  57. package/esm2022/auth-guard/auth-guard.mjs +53 -0
  58. package/{esm2015/auth-guard/auth-guard.module.js → esm2022/auth-guard/auth-guard.module.mjs} +7 -7
  59. package/esm2022/compat/analytics/analytics.mjs +160 -0
  60. package/esm2022/compat/analytics/analytics.module.mjs +35 -0
  61. package/esm2022/compat/analytics/screen-tracking.service.mjs +49 -0
  62. package/esm2022/compat/analytics/user-tracking.service.mjs +53 -0
  63. package/esm2022/compat/auth/auth.mjs +161 -0
  64. package/{esm2015/compat/auth/auth.module.js → esm2022/compat/auth/auth.module.mjs} +7 -7
  65. package/{esm2015/compat/auth/public_api.js → esm2022/compat/auth/public_api.mjs} +1 -1
  66. package/esm2022/compat/auth-guard/auth-guard.mjs +53 -0
  67. package/{esm2015/compat/auth-guard/auth-guard.module.js → esm2022/compat/auth-guard/auth-guard.module.mjs} +7 -7
  68. package/{esm2015/compat/cache.js → esm2022/compat/cache.mjs} +4 -3
  69. package/esm2022/compat/database/database.mjs +119 -0
  70. package/{esm2015/compat/database/database.module.js → esm2022/compat/database/database.module.mjs} +7 -7
  71. package/esm2022/compat/database/interfaces.mjs +2 -0
  72. package/{esm2015/compat/database/list/audit-trail.js → esm2022/compat/database/list/audit-trail.mjs} +3 -3
  73. package/esm2022/compat/database/list/changes.mjs +85 -0
  74. package/esm2022/compat/database/list/create-reference.mjs +44 -0
  75. package/{esm2015/compat/database/list/data-operation.js → esm2022/compat/database/list/data-operation.mjs} +1 -1
  76. package/{esm2015/compat/database/list/snapshot-changes.js → esm2022/compat/database/list/snapshot-changes.mjs} +1 -1
  77. package/{esm2015/compat/database/list/state-changes.js → esm2022/compat/database/list/state-changes.mjs} +2 -2
  78. package/{esm2015/compat/database/object/create-reference.js → esm2022/compat/database/object/create-reference.mjs} +2 -2
  79. package/{esm2015/compat/database/object/snapshot-changes.js → esm2022/compat/database/object/snapshot-changes.mjs} +1 -1
  80. package/esm2022/compat/database/observable/fromRef.mjs +48 -0
  81. package/{esm2015/compat/database/utils.js → esm2022/compat/database/utils.mjs} +1 -1
  82. package/{esm2015/compat/firebase.app.js → esm2022/compat/firebase.app.mjs} +1 -1
  83. package/esm2022/compat/firebase.app.module.mjs +71 -0
  84. package/esm2022/compat/firestore/collection/changes.mjs +108 -0
  85. package/esm2022/compat/firestore/collection/collection.mjs +123 -0
  86. package/esm2022/compat/firestore/collection-group/collection-group.mjs +86 -0
  87. package/esm2022/compat/firestore/document/document.mjs +87 -0
  88. package/esm2022/compat/firestore/firestore.mjs +257 -0
  89. package/{esm2015/compat/firestore/firestore.module.js → esm2022/compat/firestore/firestore.module.mjs} +7 -7
  90. package/esm2022/compat/firestore/interfaces.mjs +2 -0
  91. package/esm2022/compat/firestore/observable/fromRef.mjs +40 -0
  92. package/esm2022/compat/functions/functions.mjs +69 -0
  93. package/{esm2015/compat/functions/functions.module.js → esm2022/compat/functions/functions.module.mjs} +7 -7
  94. package/{esm2015/compat/functions/public_api.js → esm2022/compat/functions/public_api.mjs} +1 -1
  95. package/esm2022/compat/messaging/messaging.mjs +81 -0
  96. package/{esm2015/compat/messaging/messaging.module.js → esm2022/compat/messaging/messaging.module.mjs} +7 -7
  97. package/esm2022/compat/performance/performance.mjs +105 -0
  98. package/esm2022/compat/performance/performance.module.mjs +27 -0
  99. package/esm2022/compat/performance/performance.service.mjs +28 -0
  100. package/esm2022/compat/proxy.mjs +58 -0
  101. package/esm2022/compat/remote-config/remote-config.mjs +206 -0
  102. package/{esm2015/compat/remote-config/remote-config.module.js → esm2022/compat/remote-config/remote-config.module.mjs} +7 -7
  103. package/esm2022/compat/storage/observable/fromTask.mjs +36 -0
  104. package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +58 -0
  105. package/{esm2015/compat/storage/ref.js → esm2022/compat/storage/ref.mjs} +3 -3
  106. package/esm2022/compat/storage/storage.mjs +95 -0
  107. package/esm2022/compat/storage/storage.module.mjs +22 -0
  108. package/{esm2015/compat/storage/task.js → esm2022/compat/storage/task.mjs} +2 -2
  109. package/esm2022/core.mjs +43 -0
  110. package/{esm2015/database/database.js → esm2022/database/database.mjs} +1 -1
  111. package/esm2022/database/database.module.mjs +74 -0
  112. package/esm2022/firestore/firebase.mjs +54 -0
  113. package/{esm2015/firestore/firestore.js → esm2022/firestore/firestore.mjs} +1 -1
  114. package/esm2022/firestore/firestore.module.mjs +74 -0
  115. package/{esm2015/firestore/lite/lite.js → esm2022/firestore/lite/lite.mjs} +1 -1
  116. package/esm2022/firestore/lite/lite.module.mjs +73 -0
  117. package/esm2022/firestore/rxfire.mjs +15 -0
  118. package/{esm2015/functions/functions.js → esm2022/functions/functions.mjs} +1 -1
  119. package/esm2022/functions/functions.module.mjs +74 -0
  120. package/esm2022/messaging/is-messaging-supported-factory.mjs +16 -0
  121. package/{esm2015/messaging/messaging.js → esm2022/messaging/messaging.mjs} +1 -1
  122. package/esm2022/messaging/messaging.module.mjs +86 -0
  123. package/esm2022/messaging/overrides.mjs +3 -0
  124. package/{esm2015/performance/performance.js → esm2022/performance/performance.mjs} +1 -1
  125. package/esm2022/performance/performance.module.mjs +81 -0
  126. package/esm2022/remote-config/is-remote-config-supported-factory.mjs +16 -0
  127. package/esm2022/remote-config/overrides.mjs +3 -0
  128. package/{esm2015/remote-config/remote-config.js → esm2022/remote-config/remote-config.mjs} +1 -1
  129. package/esm2022/remote-config/remote-config.module.mjs +86 -0
  130. package/{esm2015/storage/storage.js → esm2022/storage/storage.mjs} +1 -1
  131. package/esm2022/storage/storage.module.mjs +74 -0
  132. package/esm2022/zones.mjs +194 -0
  133. package/{fesm2015/angular-fire-analytics.js → fesm2022/angular-fire-analytics.mjs} +64 -40
  134. package/fesm2022/angular-fire-analytics.mjs.map +1 -0
  135. package/{fesm2015/angular-fire-app-check.js → fesm2022/angular-fire-app-check.mjs} +16 -24
  136. package/fesm2022/angular-fire-app-check.mjs.map +1 -0
  137. package/{fesm2015/angular-fire-app.js → fesm2022/angular-fire-app.mjs} +10 -9
  138. package/fesm2022/angular-fire-app.mjs.map +1 -0
  139. package/{fesm2015/angular-fire-auth-guard.js → fesm2022/angular-fire-auth-guard.mjs} +31 -27
  140. package/fesm2022/angular-fire-auth-guard.mjs.map +1 -0
  141. package/{fesm2015/angular-fire-auth.js → fesm2022/angular-fire-auth.mjs} +10 -11
  142. package/fesm2022/angular-fire-auth.mjs.map +1 -0
  143. package/{fesm2015/angular-fire-compat-analytics.js → fesm2022/angular-fire-compat-analytics.mjs} +43 -41
  144. package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -0
  145. package/{fesm2015/angular-fire-compat-auth-guard.js → fesm2022/angular-fire-compat-auth-guard.mjs} +30 -26
  146. package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -0
  147. package/{fesm2015/angular-fire-compat-auth.js → fesm2022/angular-fire-compat-auth.mjs} +38 -16
  148. package/fesm2022/angular-fire-compat-auth.mjs.map +1 -0
  149. package/{fesm2015/angular-fire-compat-database.js → fesm2022/angular-fire-compat-database.mjs} +138 -132
  150. package/fesm2022/angular-fire-compat-database.mjs.map +1 -0
  151. package/{fesm2015/angular-fire-compat-firestore.js → fesm2022/angular-fire-compat-firestore.mjs} +119 -98
  152. package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -0
  153. package/{fesm2015/angular-fire-compat-functions.js → fesm2022/angular-fire-compat-functions.mjs} +13 -12
  154. package/fesm2022/angular-fire-compat-functions.mjs.map +1 -0
  155. package/{fesm2015/angular-fire-compat-messaging.js → fesm2022/angular-fire-compat-messaging.mjs} +25 -19
  156. package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -0
  157. package/{fesm2015/angular-fire-compat-performance.js → fesm2022/angular-fire-compat-performance.mjs} +29 -34
  158. package/fesm2022/angular-fire-compat-performance.mjs.map +1 -0
  159. package/{fesm2015/angular-fire-compat-remote-config.js → fesm2022/angular-fire-compat-remote-config.mjs} +35 -22
  160. package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -0
  161. package/{fesm2015/angular-fire-compat-storage.js → fesm2022/angular-fire-compat-storage.mjs} +30 -23
  162. package/fesm2022/angular-fire-compat-storage.mjs.map +1 -0
  163. package/{fesm2015/angular-fire-compat.js → fesm2022/angular-fire-compat.mjs} +25 -25
  164. package/fesm2022/angular-fire-compat.mjs.map +1 -0
  165. package/{fesm2015/angular-fire-database.js → fesm2022/angular-fire-database.mjs} +11 -12
  166. package/fesm2022/angular-fire-database.mjs.map +1 -0
  167. package/{fesm2015/angular-fire-firestore-lite.js → fesm2022/angular-fire-firestore-lite.mjs} +11 -12
  168. package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -0
  169. package/{fesm2015/angular-fire-firestore.js → fesm2022/angular-fire-firestore.mjs} +17 -15
  170. package/fesm2022/angular-fire-firestore.mjs.map +1 -0
  171. package/{fesm2015/angular-fire-functions.js → fesm2022/angular-fire-functions.mjs} +12 -13
  172. package/fesm2022/angular-fire-functions.mjs.map +1 -0
  173. package/{fesm2015/angular-fire-messaging.js → fesm2022/angular-fire-messaging.mjs} +33 -19
  174. package/fesm2022/angular-fire-messaging.mjs.map +1 -0
  175. package/{fesm2015/angular-fire-performance.js → fesm2022/angular-fire-performance.mjs} +11 -11
  176. package/fesm2022/angular-fire-performance.mjs.map +1 -0
  177. package/{fesm2015/angular-fire-remote-config.js → fesm2022/angular-fire-remote-config.mjs} +34 -20
  178. package/fesm2022/angular-fire-remote-config.mjs.map +1 -0
  179. package/{fesm2015/angular-fire-storage.js → fesm2022/angular-fire-storage.mjs} +10 -11
  180. package/fesm2022/angular-fire-storage.mjs.map +1 -0
  181. package/{fesm2015/angular-fire.js → fesm2022/angular-fire.mjs} +33 -58
  182. package/fesm2022/angular-fire.mjs.map +1 -0
  183. package/firestore/firebase.d.ts +2 -1
  184. package/firestore/firestore.module.d.ts +2 -2
  185. package/firestore/lite/lite.module.d.ts +2 -2
  186. package/firestore/rxfire.d.ts +3 -1
  187. package/functions/functions.module.d.ts +2 -2
  188. package/messaging/is-messaging-supported-factory.d.ts +4 -0
  189. package/messaging/messaging.module.d.ts +2 -2
  190. package/package.json +158 -7
  191. package/performance/performance.module.d.ts +2 -2
  192. package/publish.sh +1 -0
  193. package/remote-config/is-remote-config-supported-factory.d.ts +4 -0
  194. package/remote-config/remote-config.module.d.ts +2 -2
  195. package/schematics/add/index.js +2 -2
  196. package/schematics/common.js +9 -5
  197. package/schematics/deploy/actions.js +69 -69
  198. package/schematics/deploy/builder.js +7 -7
  199. package/schematics/firebaseTools.js +9 -5
  200. package/schematics/setup/index.js +27 -27
  201. package/schematics/setup/prompts.js +22 -18
  202. package/schematics/update/index.js +1 -1
  203. package/schematics/update/v7/index.js +7 -7
  204. package/schematics/utils.js +34 -34
  205. package/storage/storage.module.d.ts +2 -2
  206. package/README.md +0 -216
  207. package/analytics/package.json +0 -11
  208. package/app/package.json +0 -11
  209. package/app-check/package.json +0 -11
  210. package/auth/package.json +0 -11
  211. package/auth-guard/package.json +0 -11
  212. package/bundles/angular-fire-analytics.umd.js +0 -673
  213. package/bundles/angular-fire-analytics.umd.js.map +0 -1
  214. package/bundles/angular-fire-app-check.umd.js +0 -465
  215. package/bundles/angular-fire-app-check.umd.js.map +0 -1
  216. package/bundles/angular-fire-app.umd.js +0 -477
  217. package/bundles/angular-fire-app.umd.js.map +0 -1
  218. package/bundles/angular-fire-auth-guard.umd.js +0 -109
  219. package/bundles/angular-fire-auth-guard.umd.js.map +0 -1
  220. package/bundles/angular-fire-auth.umd.js +0 -557
  221. package/bundles/angular-fire-auth.umd.js.map +0 -1
  222. package/bundles/angular-fire-compat-analytics.umd.js +0 -672
  223. package/bundles/angular-fire-compat-analytics.umd.js.map +0 -1
  224. package/bundles/angular-fire-compat-auth-guard.umd.js +0 -112
  225. package/bundles/angular-fire-compat-auth-guard.umd.js.map +0 -1
  226. package/bundles/angular-fire-compat-auth.umd.js +0 -559
  227. package/bundles/angular-fire-compat-auth.umd.js.map +0 -1
  228. package/bundles/angular-fire-compat-database.umd.js +0 -799
  229. package/bundles/angular-fire-compat-database.umd.js.map +0 -1
  230. package/bundles/angular-fire-compat-firestore.umd.js +0 -1073
  231. package/bundles/angular-fire-compat-firestore.umd.js.map +0 -1
  232. package/bundles/angular-fire-compat-functions.umd.js +0 -443
  233. package/bundles/angular-fire-compat-functions.umd.js.map +0 -1
  234. package/bundles/angular-fire-compat-messaging.umd.js +0 -465
  235. package/bundles/angular-fire-compat-messaging.umd.js.map +0 -1
  236. package/bundles/angular-fire-compat-performance.umd.js +0 -212
  237. package/bundles/angular-fire-compat-performance.umd.js.map +0 -1
  238. package/bundles/angular-fire-compat-remote-config.umd.js +0 -605
  239. package/bundles/angular-fire-compat-remote-config.umd.js.map +0 -1
  240. package/bundles/angular-fire-compat-storage.umd.js +0 -598
  241. package/bundles/angular-fire-compat-storage.umd.js.map +0 -1
  242. package/bundles/angular-fire-compat.umd.js +0 -535
  243. package/bundles/angular-fire-compat.umd.js.map +0 -1
  244. package/bundles/angular-fire-database.umd.js +0 -557
  245. package/bundles/angular-fire-database.umd.js.map +0 -1
  246. package/bundles/angular-fire-firestore-lite.umd.js +0 -531
  247. package/bundles/angular-fire-firestore-lite.umd.js.map +0 -1
  248. package/bundles/angular-fire-firestore.umd.js +0 -565
  249. package/bundles/angular-fire-firestore.umd.js.map +0 -1
  250. package/bundles/angular-fire-functions.umd.js +0 -461
  251. package/bundles/angular-fire-functions.umd.js.map +0 -1
  252. package/bundles/angular-fire-messaging.umd.js +0 -473
  253. package/bundles/angular-fire-messaging.umd.js.map +0 -1
  254. package/bundles/angular-fire-performance.umd.js +0 -473
  255. package/bundles/angular-fire-performance.umd.js.map +0 -1
  256. package/bundles/angular-fire-remote-config.umd.js +0 -499
  257. package/bundles/angular-fire-remote-config.umd.js.map +0 -1
  258. package/bundles/angular-fire-storage.umd.js +0 -485
  259. package/bundles/angular-fire-storage.umd.js.map +0 -1
  260. package/bundles/angular-fire.umd.js +0 -308
  261. package/bundles/angular-fire.umd.js.map +0 -1
  262. package/compat/analytics/package.json +0 -11
  263. package/compat/auth/package.json +0 -11
  264. package/compat/auth-guard/package.json +0 -11
  265. package/compat/database/package.json +0 -11
  266. package/compat/firestore/package.json +0 -11
  267. package/compat/functions/package.json +0 -11
  268. package/compat/messaging/package.json +0 -11
  269. package/compat/package.json +0 -11
  270. package/compat/performance/package.json +0 -11
  271. package/compat/remote-config/package.json +0 -11
  272. package/compat/storage/package.json +0 -11
  273. package/database/package.json +0 -11
  274. package/docs/analytics.md +0 -67
  275. package/docs/app-check.md +0 -53
  276. package/docs/auth.md +0 -165
  277. package/docs/compat/analytics/getting-started.md +0 -137
  278. package/docs/compat/auth/getting-started.md +0 -162
  279. package/docs/compat/auth/router-guards.md +0 -104
  280. package/docs/compat/emulators/emulators.md +0 -134
  281. package/docs/compat/firestore/collections.md +0 -326
  282. package/docs/compat/firestore/documents.md +0 -115
  283. package/docs/compat/firestore/offline-data.md +0 -39
  284. package/docs/compat/firestore/querying-collections.md +0 -204
  285. package/docs/compat/functions/functions.md +0 -166
  286. package/docs/compat/messaging/messaging.md +0 -232
  287. package/docs/compat/performance/getting-started.md +0 -132
  288. package/docs/compat/remote-config/getting-started.md +0 -134
  289. package/docs/compat/rtdb/lists.md +0 -257
  290. package/docs/compat/rtdb/objects.md +0 -182
  291. package/docs/compat/rtdb/querying-lists.md +0 -155
  292. package/docs/compat/storage/storage.md +0 -257
  293. package/docs/compat.md +0 -70
  294. package/docs/database.md +0 -175
  295. package/docs/deploy/getting-started.md +0 -204
  296. package/docs/firebase.json +0 -16
  297. package/docs/firestore.md +0 -148
  298. package/docs/functions.md +0 -52
  299. package/docs/images/analytics-illo_1x.png +0 -0
  300. package/docs/images/auth-illo_1x.png +0 -0
  301. package/docs/images/cloud-messaging-illo_1x.png +0 -0
  302. package/docs/images/database-illo_1x.png +0 -0
  303. package/docs/images/firestore-illo_1x.png +0 -0
  304. package/docs/images/functions-illo_1x.png +0 -0
  305. package/docs/images/hosting-illo_1x.png +0 -0
  306. package/docs/images/performance-illo_1x.png +0 -0
  307. package/docs/images/reCAPTCHA-logo@1x.png +0 -0
  308. package/docs/images/remote-config-illo_1x.png +0 -0
  309. package/docs/images/storage-illo_1x.png +0 -0
  310. package/docs/install-and-setup.md +0 -114
  311. package/docs/install-angular-cli-windows10.md +0 -82
  312. package/docs/messaging.md +0 -25
  313. package/docs/performance.md +0 -57
  314. package/docs/remote-config.md +0 -53
  315. package/docs/storage.md +0 -90
  316. package/docs/universal/cloud-functions.md +0 -75
  317. package/docs/universal/getting-started.md +0 -153
  318. package/docs/universal/prerendering.md +0 -72
  319. package/docs/version-4-upgrade.md +0 -119
  320. package/docs/version-5-upgrade.md +0 -82
  321. package/docs/version-6-upgrade.md +0 -16
  322. package/docs/version-7-upgrade.md +0 -298
  323. package/esm2015/analytics/analytics.module.js +0 -93
  324. package/esm2015/analytics/overrides.js +0 -3
  325. package/esm2015/analytics/screen-tracking.service.js +0 -139
  326. package/esm2015/analytics/user-tracking.service.js +0 -43
  327. package/esm2015/app/app.module.js +0 -84
  328. package/esm2015/app-check/app-check.js +0 -16
  329. package/esm2015/app-check/app-check.module.js +0 -81
  330. package/esm2015/app-check/public_api.js +0 -4
  331. package/esm2015/auth/auth.module.js +0 -71
  332. package/esm2015/auth-guard/auth-guard.js +0 -49
  333. package/esm2015/compat/analytics/analytics.js +0 -163
  334. package/esm2015/compat/analytics/analytics.module.js +0 -32
  335. package/esm2015/compat/analytics/screen-tracking.service.js +0 -49
  336. package/esm2015/compat/analytics/user-tracking.service.js +0 -52
  337. package/esm2015/compat/auth/auth.js +0 -139
  338. package/esm2015/compat/auth-guard/auth-guard.js +0 -49
  339. package/esm2015/compat/database/database.js +0 -117
  340. package/esm2015/compat/database/interfaces.js +0 -2
  341. package/esm2015/compat/database/list/changes.js +0 -85
  342. package/esm2015/compat/database/list/create-reference.js +0 -41
  343. package/esm2015/compat/database/observable/fromRef.js +0 -47
  344. package/esm2015/compat/firebase.app.module.js +0 -69
  345. package/esm2015/compat/firestore/collection/changes.js +0 -107
  346. package/esm2015/compat/firestore/collection/collection.js +0 -117
  347. package/esm2015/compat/firestore/collection-group/collection-group.js +0 -81
  348. package/esm2015/compat/firestore/document/document.js +0 -82
  349. package/esm2015/compat/firestore/firestore.js +0 -254
  350. package/esm2015/compat/firestore/interfaces.js +0 -2
  351. package/esm2015/compat/firestore/observable/fromRef.js +0 -39
  352. package/esm2015/compat/functions/functions.js +0 -68
  353. package/esm2015/compat/messaging/messaging.js +0 -75
  354. package/esm2015/compat/performance/performance.js +0 -110
  355. package/esm2015/compat/performance/performance.module.js +0 -28
  356. package/esm2015/compat/performance/performance.service.js +0 -27
  357. package/esm2015/compat/proxy.js +0 -61
  358. package/esm2015/compat/remote-config/remote-config.js +0 -193
  359. package/esm2015/compat/storage/observable/fromTask.js +0 -34
  360. package/esm2015/compat/storage/pipes/storageUrl.pipe.js +0 -54
  361. package/esm2015/compat/storage/storage.js +0 -94
  362. package/esm2015/compat/storage/storage.module.js +0 -22
  363. package/esm2015/core.js +0 -79
  364. package/esm2015/database/database.module.js +0 -74
  365. package/esm2015/firestore/firebase.js +0 -53
  366. package/esm2015/firestore/firestore.module.js +0 -74
  367. package/esm2015/firestore/lite/lite.module.js +0 -74
  368. package/esm2015/firestore/rxfire.js +0 -13
  369. package/esm2015/functions/functions.module.js +0 -74
  370. package/esm2015/messaging/messaging.module.js +0 -85
  371. package/esm2015/messaging/overrides.js +0 -3
  372. package/esm2015/performance/performance.module.js +0 -81
  373. package/esm2015/remote-config/overrides.js +0 -3
  374. package/esm2015/remote-config/remote-config.module.js +0 -85
  375. package/esm2015/storage/storage.module.js +0 -74
  376. package/esm2015/zones.js +0 -183
  377. package/fesm2015/angular-fire-analytics.js.map +0 -1
  378. package/fesm2015/angular-fire-app-check.js.map +0 -1
  379. package/fesm2015/angular-fire-app.js.map +0 -1
  380. package/fesm2015/angular-fire-auth-guard.js.map +0 -1
  381. package/fesm2015/angular-fire-auth.js.map +0 -1
  382. package/fesm2015/angular-fire-compat-analytics.js.map +0 -1
  383. package/fesm2015/angular-fire-compat-auth-guard.js.map +0 -1
  384. package/fesm2015/angular-fire-compat-auth.js.map +0 -1
  385. package/fesm2015/angular-fire-compat-database.js.map +0 -1
  386. package/fesm2015/angular-fire-compat-firestore.js.map +0 -1
  387. package/fesm2015/angular-fire-compat-functions.js.map +0 -1
  388. package/fesm2015/angular-fire-compat-messaging.js.map +0 -1
  389. package/fesm2015/angular-fire-compat-performance.js.map +0 -1
  390. package/fesm2015/angular-fire-compat-remote-config.js.map +0 -1
  391. package/fesm2015/angular-fire-compat-storage.js.map +0 -1
  392. package/fesm2015/angular-fire-compat.js.map +0 -1
  393. package/fesm2015/angular-fire-database.js.map +0 -1
  394. package/fesm2015/angular-fire-firestore-lite.js.map +0 -1
  395. package/fesm2015/angular-fire-firestore.js.map +0 -1
  396. package/fesm2015/angular-fire-functions.js.map +0 -1
  397. package/fesm2015/angular-fire-messaging.js.map +0 -1
  398. package/fesm2015/angular-fire-performance.js.map +0 -1
  399. package/fesm2015/angular-fire-remote-config.js.map +0 -1
  400. package/fesm2015/angular-fire-storage.js.map +0 -1
  401. package/fesm2015/angular-fire.js.map +0 -1
  402. package/firestore/lite/package.json +0 -11
  403. package/firestore/package.json +0 -11
  404. package/firestore-protos.js +0 -4
  405. package/functions/package.json +0 -11
  406. package/messaging/package.json +0 -11
  407. package/performance/package.json +0 -11
  408. package/remote-config/package.json +0 -11
  409. package/schematics/add/schema.json +0 -16
  410. package/schematics/builders.json +0 -10
  411. package/schematics/collection.json +0 -15
  412. package/schematics/deploy/schema.json +0 -119
  413. package/schematics/migration.json +0 -15
  414. package/schematics/setup/schema.json +0 -16
  415. package/storage/package.json +0 -11
  416. /package/analytics/{angular-fire-analytics.d.ts → index.d.ts} +0 -0
  417. /package/app/{angular-fire-app.d.ts → index.d.ts} +0 -0
  418. /package/app-check/{angular-fire-app-check.d.ts → index.d.ts} +0 -0
  419. /package/auth/{angular-fire-auth.d.ts → index.d.ts} +0 -0
  420. /package/auth-guard/{angular-fire-auth-guard.d.ts → index.d.ts} +0 -0
  421. /package/compat/analytics/{angular-fire-compat-analytics.d.ts → index.d.ts} +0 -0
  422. /package/compat/auth/{angular-fire-compat-auth.d.ts → index.d.ts} +0 -0
  423. /package/compat/auth-guard/{angular-fire-compat-auth-guard.d.ts → index.d.ts} +0 -0
  424. /package/compat/database/{angular-fire-compat-database.d.ts → index.d.ts} +0 -0
  425. /package/compat/firestore/{angular-fire-compat-firestore.d.ts → index.d.ts} +0 -0
  426. /package/compat/functions/{angular-fire-compat-functions.d.ts → index.d.ts} +0 -0
  427. /package/compat/{angular-fire-compat.d.ts → index.d.ts} +0 -0
  428. /package/compat/messaging/{angular-fire-compat-messaging.d.ts → index.d.ts} +0 -0
  429. /package/compat/performance/{angular-fire-compat-performance.d.ts → index.d.ts} +0 -0
  430. /package/compat/remote-config/{angular-fire-compat-remote-config.d.ts → index.d.ts} +0 -0
  431. /package/compat/storage/{angular-fire-compat-storage.d.ts → index.d.ts} +0 -0
  432. /package/database/{angular-fire-database.d.ts → index.d.ts} +0 -0
  433. /package/{esm2015/analytics/angular-fire-analytics.js → esm2022/analytics/angular-fire-analytics.mjs} +0 -0
  434. /package/{esm2015/analytics/firebase.js → esm2022/analytics/firebase.mjs} +0 -0
  435. /package/{esm2015/analytics/public_api.js → esm2022/analytics/public_api.mjs} +0 -0
  436. /package/{esm2015/angular-fire.js → esm2022/angular-fire.mjs} +0 -0
  437. /package/{esm2015/app/angular-fire-app.js → esm2022/app/angular-fire-app.mjs} +0 -0
  438. /package/{esm2015/app/firebase.js → esm2022/app/firebase.mjs} +0 -0
  439. /package/{esm2015/app/public_api.js → esm2022/app/public_api.mjs} +0 -0
  440. /package/{esm2015/app-check/angular-fire-app-check.js → esm2022/app-check/angular-fire-app-check.mjs} +0 -0
  441. /package/{esm2015/app-check/firebase.js → esm2022/app-check/firebase.mjs} +0 -0
  442. /package/{esm2015/auth/angular-fire-auth.js → esm2022/auth/angular-fire-auth.mjs} +0 -0
  443. /package/{esm2015/auth/firebase.js → esm2022/auth/firebase.mjs} +0 -0
  444. /package/{esm2015/auth/public_api.js → esm2022/auth/public_api.mjs} +0 -0
  445. /package/{esm2015/auth/rxfire.js → esm2022/auth/rxfire.mjs} +0 -0
  446. /package/{esm2015/auth-guard/angular-fire-auth-guard.js → esm2022/auth-guard/angular-fire-auth-guard.mjs} +0 -0
  447. /package/{esm2015/auth-guard/public_api.js → esm2022/auth-guard/public_api.mjs} +0 -0
  448. /package/{esm2015/compat/analytics/angular-fire-compat-analytics.js → esm2022/compat/analytics/angular-fire-compat-analytics.mjs} +0 -0
  449. /package/{esm2015/compat/analytics/base.js → esm2022/compat/analytics/base.mjs} +0 -0
  450. /package/{esm2015/compat/analytics/public_api.js → esm2022/compat/analytics/public_api.mjs} +0 -0
  451. /package/{esm2015/compat/angular-fire-compat.js → esm2022/compat/angular-fire-compat.mjs} +0 -0
  452. /package/{esm2015/compat/auth/angular-fire-compat-auth.js → esm2022/compat/auth/angular-fire-compat-auth.mjs} +0 -0
  453. /package/{esm2015/compat/auth/base.js → esm2022/compat/auth/base.mjs} +0 -0
  454. /package/{esm2015/compat/auth-guard/angular-fire-compat-auth-guard.js → esm2022/compat/auth-guard/angular-fire-compat-auth-guard.mjs} +0 -0
  455. /package/{esm2015/compat/auth-guard/public_api.js → esm2022/compat/auth-guard/public_api.mjs} +0 -0
  456. /package/{esm2015/compat/database/angular-fire-compat-database.js → esm2022/compat/database/angular-fire-compat-database.mjs} +0 -0
  457. /package/{esm2015/compat/database/list/remove.js → esm2022/compat/database/list/remove.mjs} +0 -0
  458. /package/{esm2015/compat/database/list/utils.js → esm2022/compat/database/list/utils.mjs} +0 -0
  459. /package/{esm2015/compat/database/public_api.js → esm2022/compat/database/public_api.mjs} +0 -0
  460. /package/{esm2015/compat/firestore/angular-fire-compat-firestore.js → esm2022/compat/firestore/angular-fire-compat-firestore.mjs} +0 -0
  461. /package/{esm2015/compat/firestore/public_api.js → esm2022/compat/firestore/public_api.mjs} +0 -0
  462. /package/{esm2015/compat/functions/angular-fire-compat-functions.js → esm2022/compat/functions/angular-fire-compat-functions.mjs} +0 -0
  463. /package/{esm2015/compat/functions/base.js → esm2022/compat/functions/base.mjs} +0 -0
  464. /package/{esm2015/compat/messaging/angular-fire-compat-messaging.js → esm2022/compat/messaging/angular-fire-compat-messaging.mjs} +0 -0
  465. /package/{esm2015/compat/messaging/base.js → esm2022/compat/messaging/base.mjs} +0 -0
  466. /package/{esm2015/compat/messaging/public_api.js → esm2022/compat/messaging/public_api.mjs} +0 -0
  467. /package/{esm2015/compat/performance/angular-fire-compat-performance.js → esm2022/compat/performance/angular-fire-compat-performance.mjs} +0 -0
  468. /package/{esm2015/compat/performance/base.js → esm2022/compat/performance/base.mjs} +0 -0
  469. /package/{esm2015/compat/performance/public_api.js → esm2022/compat/performance/public_api.mjs} +0 -0
  470. /package/{esm2015/compat/public_api.js → esm2022/compat/public_api.mjs} +0 -0
  471. /package/{esm2015/compat/remote-config/angular-fire-compat-remote-config.js → esm2022/compat/remote-config/angular-fire-compat-remote-config.mjs} +0 -0
  472. /package/{esm2015/compat/remote-config/base.js → esm2022/compat/remote-config/base.mjs} +0 -0
  473. /package/{esm2015/compat/remote-config/interfaces.js → esm2022/compat/remote-config/interfaces.mjs} +0 -0
  474. /package/{esm2015/compat/remote-config/public_api.js → esm2022/compat/remote-config/public_api.mjs} +0 -0
  475. /package/{esm2015/compat/storage/angular-fire-compat-storage.js → esm2022/compat/storage/angular-fire-compat-storage.mjs} +0 -0
  476. /package/{esm2015/compat/storage/interfaces.js → esm2022/compat/storage/interfaces.mjs} +0 -0
  477. /package/{esm2015/compat/storage/public_api.js → esm2022/compat/storage/public_api.mjs} +0 -0
  478. /package/{esm2015/database/angular-fire-database.js → esm2022/database/angular-fire-database.mjs} +0 -0
  479. /package/{esm2015/database/firebase.js → esm2022/database/firebase.mjs} +0 -0
  480. /package/{esm2015/database/public_api.js → esm2022/database/public_api.mjs} +0 -0
  481. /package/{esm2015/database/rxfire.js → esm2022/database/rxfire.mjs} +0 -0
  482. /package/{esm2015/firestore/angular-fire-firestore.js → esm2022/firestore/angular-fire-firestore.mjs} +0 -0
  483. /package/{esm2015/firestore/lite/angular-fire-firestore-lite.js → esm2022/firestore/lite/angular-fire-firestore-lite.mjs} +0 -0
  484. /package/{esm2015/firestore/lite/firebase.js → esm2022/firestore/lite/firebase.mjs} +0 -0
  485. /package/{esm2015/firestore/lite/public_api.js → esm2022/firestore/lite/public_api.mjs} +0 -0
  486. /package/{esm2015/firestore/lite/rxfire.js → esm2022/firestore/lite/rxfire.mjs} +0 -0
  487. /package/{esm2015/firestore/public_api.js → esm2022/firestore/public_api.mjs} +0 -0
  488. /package/{esm2015/functions/angular-fire-functions.js → esm2022/functions/angular-fire-functions.mjs} +0 -0
  489. /package/{esm2015/functions/firebase.js → esm2022/functions/firebase.mjs} +0 -0
  490. /package/{esm2015/functions/public_api.js → esm2022/functions/public_api.mjs} +0 -0
  491. /package/{esm2015/functions/rxfire.js → esm2022/functions/rxfire.mjs} +0 -0
  492. /package/{esm2015/messaging/angular-fire-messaging.js → esm2022/messaging/angular-fire-messaging.mjs} +0 -0
  493. /package/{esm2015/messaging/firebase.js → esm2022/messaging/firebase.mjs} +0 -0
  494. /package/{esm2015/messaging/public_api.js → esm2022/messaging/public_api.mjs} +0 -0
  495. /package/{esm2015/performance/angular-fire-performance.js → esm2022/performance/angular-fire-performance.mjs} +0 -0
  496. /package/{esm2015/performance/firebase.js → esm2022/performance/firebase.mjs} +0 -0
  497. /package/{esm2015/performance/public_api.js → esm2022/performance/public_api.mjs} +0 -0
  498. /package/{esm2015/performance/rxfire.js → esm2022/performance/rxfire.mjs} +0 -0
  499. /package/{esm2015/public_api.js → esm2022/public_api.mjs} +0 -0
  500. /package/{esm2015/remote-config/angular-fire-remote-config.js → esm2022/remote-config/angular-fire-remote-config.mjs} +0 -0
  501. /package/{esm2015/remote-config/firebase.js → esm2022/remote-config/firebase.mjs} +0 -0
  502. /package/{esm2015/remote-config/public_api.js → esm2022/remote-config/public_api.mjs} +0 -0
  503. /package/{esm2015/remote-config/rxfire.js → esm2022/remote-config/rxfire.mjs} +0 -0
  504. /package/{esm2015/storage/angular-fire-storage.js → esm2022/storage/angular-fire-storage.mjs} +0 -0
  505. /package/{esm2015/storage/firebase.js → esm2022/storage/firebase.mjs} +0 -0
  506. /package/{esm2015/storage/public_api.js → esm2022/storage/public_api.mjs} +0 -0
  507. /package/{esm2015/storage/rxfire.js → esm2022/storage/rxfire.mjs} +0 -0
  508. /package/firestore/{angular-fire-firestore.d.ts → index.d.ts} +0 -0
  509. /package/firestore/lite/{angular-fire-firestore-lite.d.ts → index.d.ts} +0 -0
  510. /package/functions/{angular-fire-functions.d.ts → index.d.ts} +0 -0
  511. /package/{angular-fire.d.ts → index.d.ts} +0 -0
  512. /package/messaging/{angular-fire-messaging.d.ts → index.d.ts} +0 -0
  513. /package/performance/{angular-fire-performance.d.ts → index.d.ts} +0 -0
  514. /package/remote-config/{angular-fire-remote-config.d.ts → index.d.ts} +0 -0
  515. /package/storage/{angular-fire-storage.d.ts → index.d.ts} +0 -0
@@ -1,37 +1,39 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, NgModule } from '@angular/core';
3
+ import * as i2 from '@angular/fire/compat/auth';
3
4
  import * as i1 from '@angular/router';
4
5
  import { of, pipe } from 'rxjs';
5
6
  import { map, take, switchMap } from 'rxjs/operators';
6
- import * as i2 from '@angular/fire/compat/auth';
7
- import firebase from 'firebase/compat/app';
8
7
  import { VERSION } from '@angular/fire';
8
+ import firebase from 'firebase/compat/app';
9
9
 
10
10
  const loggedIn = map(user => !!user);
11
11
  class AngularFireAuthGuard {
12
+ router;
13
+ auth;
12
14
  constructor(router, auth) {
13
15
  this.router = router;
14
16
  this.auth = auth;
15
- this.canActivate = (next, state) => {
16
- const authPipeFactory = next.data.authGuardPipe || (() => loggedIn);
17
- return this.auth.user.pipe(take(1), authPipeFactory(next, state), map(can => {
18
- if (typeof can === 'boolean') {
19
- return can;
20
- }
21
- else if (Array.isArray(can)) {
22
- return this.router.createUrlTree(can);
23
- }
24
- else {
25
- // TODO(EdricChan03): Add tests
26
- return this.router.parseUrl(can);
27
- }
28
- }));
29
- };
30
17
  }
18
+ canActivate = (next, state) => {
19
+ const authPipeFactory = next.data.authGuardPipe || (() => loggedIn);
20
+ return this.auth.user.pipe(take(1), authPipeFactory(next, state), map(can => {
21
+ if (typeof can === 'boolean') {
22
+ return can;
23
+ }
24
+ else if (Array.isArray(can)) {
25
+ return this.router.createUrlTree(can);
26
+ }
27
+ else {
28
+ // TODO(EdricChan03): Add tests
29
+ return this.router.parseUrl(can);
30
+ }
31
+ }));
32
+ };
33
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthGuard, deps: [{ token: i1.Router }, { token: i2.AngularFireAuth }], target: i0.ɵɵFactoryTarget.Injectable });
34
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthGuard, providedIn: 'any' });
31
35
  }
32
- AngularFireAuthGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthGuard, deps: [{ token: i1.Router }, { token: i2.AngularFireAuth }], target: i0.ɵɵFactoryTarget.Injectable });
33
- AngularFireAuthGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthGuard, providedIn: 'any' });
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthGuard, decorators: [{
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthGuard, decorators: [{
35
37
  type: Injectable,
36
38
  args: [{
37
39
  providedIn: 'any'
@@ -44,7 +46,9 @@ const isNotAnonymous = map(user => !!user && !user.isAnonymous);
44
46
  const idTokenResult = switchMap((user) => user ? user.getIdTokenResult() : of(null));
45
47
  const emailVerified = map(user => !!user && user.emailVerified);
46
48
  const customClaims = pipe(idTokenResult, map(idTokenResult => idTokenResult ? idTokenResult.claims : []));
47
- const hasCustomClaim = (claim) => pipe(customClaims, map(claims => claims.hasOwnProperty(claim)));
49
+ const hasCustomClaim =
50
+ // eslint-disable-next-line no-prototype-builtins
51
+ (claim) => pipe(customClaims, map(claims => claims.hasOwnProperty(claim)));
48
52
  const redirectUnauthorizedTo = (redirect) => pipe(loggedIn, map(loggedIn => loggedIn || redirect));
49
53
  const redirectLoggedInTo = (redirect) => pipe(loggedIn, map(loggedIn => loggedIn && redirect || true));
50
54
 
@@ -52,11 +56,11 @@ class AngularFireAuthGuardModule {
52
56
  constructor() {
53
57
  firebase.registerVersion('angularfire', VERSION.full, 'auth-guard-compat');
54
58
  }
59
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthGuardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
60
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthGuardModule });
61
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthGuardModule, providers: [AngularFireAuthGuard] });
55
62
  }
56
- AngularFireAuthGuardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthGuardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
57
- AngularFireAuthGuardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthGuardModule });
58
- AngularFireAuthGuardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthGuardModule, providers: [AngularFireAuthGuard] });
59
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthGuardModule, decorators: [{
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthGuardModule, decorators: [{
60
64
  type: NgModule,
61
65
  args: [{
62
66
  providers: [AngularFireAuthGuard]
@@ -68,4 +72,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImpor
68
72
  */
69
73
 
70
74
  export { AngularFireAuthGuard, AngularFireAuthGuardModule, canActivate, customClaims, emailVerified, hasCustomClaim, idTokenResult, isNotAnonymous, loggedIn, redirectLoggedInTo, redirectUnauthorizedTo };
71
- //# sourceMappingURL=angular-fire-compat-auth-guard.js.map
75
+ //# sourceMappingURL=angular-fire-compat-auth-guard.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-fire-compat-auth-guard.mjs","sources":["../../../src/compat/auth-guard/auth-guard.ts","../../../src/compat/auth-guard/auth-guard.module.ts","../../../src/compat/auth-guard/angular-fire-compat-auth-guard.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { AngularFireAuth } from '@angular/fire/compat/auth';\nimport { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';\nimport firebase from 'firebase/compat/app';\nimport { Observable, UnaryFunction, of, pipe } from 'rxjs';\nimport { map, switchMap, take } from 'rxjs/operators';\n\nexport type AuthPipeGenerator = (next: ActivatedRouteSnapshot, state: RouterStateSnapshot) => AuthPipe;\nexport type AuthPipe = UnaryFunction<Observable<firebase.User|null>, Observable<boolean|string|any[]>>;\n\nexport const loggedIn: AuthPipe = map(user => !!user);\n\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFireAuthGuard implements CanActivate {\n\n constructor(private router: Router, private auth: AngularFireAuth) {}\n\n canActivate = (next: ActivatedRouteSnapshot, state: RouterStateSnapshot) => {\n const authPipeFactory = next.data.authGuardPipe as AuthPipeGenerator || (() => loggedIn);\n return this.auth.user.pipe(\n take(1),\n authPipeFactory(next, state),\n map(can => {\n if (typeof can === 'boolean') {\n return can;\n } else if (Array.isArray(can)) {\n return this.router.createUrlTree(can);\n } else {\n // TODO(EdricChan03): Add tests\n return this.router.parseUrl(can);\n }\n })\n );\n }\n\n}\n\nexport const canActivate = (pipe: AuthPipeGenerator) => ({\n canActivate: [ AngularFireAuthGuard ], data: { authGuardPipe: pipe }\n});\n\n\nexport const isNotAnonymous: AuthPipe = map(user => !!user && !user.isAnonymous);\nexport const idTokenResult = switchMap((user: firebase.User|null) => user ? user.getIdTokenResult() : of(null));\nexport const emailVerified: AuthPipe = map(user => !!user && user.emailVerified);\nexport const customClaims = pipe(idTokenResult, map(idTokenResult => idTokenResult ? idTokenResult.claims : []));\nexport const hasCustomClaim: (claim: string) => AuthPipe =\n // eslint-disable-next-line no-prototype-builtins\n (claim) => pipe(customClaims, map(claims => claims.hasOwnProperty(claim)));\nexport const redirectUnauthorizedTo: (redirect: string|any[]) => AuthPipe =\n (redirect) => pipe(loggedIn, map(loggedIn => loggedIn || redirect));\nexport const redirectLoggedInTo: (redirect: string|any[]) => AuthPipe =\n (redirect) => pipe(loggedIn, map(loggedIn => loggedIn && redirect || true));\n","import { NgModule } from '@angular/core';\nimport { VERSION } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { AngularFireAuthGuard } from './auth-guard';\n\n@NgModule({\n providers: [ AngularFireAuthGuard ]\n})\nexport class AngularFireAuthGuardModule {\n constructor() {\n firebase.registerVersion('angularfire', VERSION.full, 'auth-guard-compat');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAUO,MAAM,QAAQ,GAAa,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE;MAKzC,oBAAoB,CAAA;AAEX,IAAA,MAAA,CAAA;AAAwB,IAAA,IAAA,CAAA;IAA5C,WAAoB,CAAA,MAAc,EAAU,IAAqB,EAAA;QAA7C,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QAAU,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAiB;KAAI;AAErE,IAAA,WAAW,GAAG,CAAC,IAA4B,EAAE,KAA0B,KAAI;AACzE,QAAA,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,aAAkC,KAAK,MAAM,QAAQ,CAAC,CAAC;QACzF,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CACxB,IAAI,CAAC,CAAC,CAAC,EACP,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,EAC5B,GAAG,CAAC,GAAG,IAAG;AACR,YAAA,IAAI,OAAO,GAAG,KAAK,SAAS,EAAE;AAC5B,gBAAA,OAAO,GAAG,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_ID, Injectable, Inject, Optional, NgModule } from '@angular/core';
4
- import { Subject, of, Observable, from, merge } from 'rxjs';
5
- import { observeOn, switchMap, map, shareReplay, first, switchMapTo, subscribeOn, filter } from 'rxjs/operators';
6
5
  import * as i1 from '@angular/fire';
7
6
  import { keepUnstableUntilFirst, VERSION } from '@angular/fire';
8
- import { ɵcacheInstance, ɵfirebaseAppFactory, ɵlazySDKProxy, FIREBASE_OPTIONS, FIREBASE_APP_NAME, ɵapplyMixins } from '@angular/fire/compat';
9
- import { isPlatformServer } from '@angular/common';
10
7
  import * as i2 from '@angular/fire/app-check';
8
+ import { ɵcacheInstance, ɵfirebaseAppFactory, ɵlazySDKProxy, FIREBASE_OPTIONS, FIREBASE_APP_NAME, ɵapplyMixins } from '@angular/fire/compat';
9
+ import { Subject, of, Observable, from, merge } from 'rxjs';
10
+ import { observeOn, switchMap, map, shareReplay, first, switchMapTo, subscribeOn, filter } from 'rxjs/operators';
11
11
  import firebase from 'firebase/compat/app';
12
12
 
13
13
  // DO NOT MODIFY, this file is autogenerated by tools/build.ts
@@ -78,8 +78,30 @@ const ɵauthFactory = (app, zone, useEmulator, tenantId, languageCode, useDevice
78
78
  return auth;
79
79
  }, [useEmulator, tenantId, languageCode, useDeviceLanguage, settings, persistence]);
80
80
  class AngularFireAuth {
81
+ /**
82
+ * Observable of authentication state; as of Firebase 4.0 this is only triggered via sign-in/out
83
+ */
84
+ authState;
85
+ /**
86
+ * Observable of the currently signed-in user's JWT token used to identify the user to a Firebase service (or null).
87
+ */
88
+ idToken;
89
+ /**
90
+ * Observable of the currently signed-in user (or null).
91
+ */
92
+ user;
93
+ /**
94
+ * Observable of the currently signed-in user's IdTokenResult object which contains the ID token JWT string and other
95
+ * helper properties for getting different data associated with the token as well as all the decoded payload claims
96
+ * (or null).
97
+ */
98
+ idTokenResult;
99
+ /**
100
+ * Observable of the currently signed-in user's credential, or null
101
+ */
102
+ credential;
81
103
  constructor(options, name,
82
- // tslint:disable-next-line:ban-types
104
+ // eslint-disable-next-line @typescript-eslint/ban-types
83
105
  platformId, zone, schedulers, useEmulator, // can't use the tuple here
84
106
  settings, // can't use firebase.auth.AuthSettings here
85
107
  tenantId, languageCode, useDeviceLanguage, persistence, _appCheckInstances) {
@@ -94,7 +116,7 @@ class AngularFireAuth {
94
116
  // as we're completely lazy. Let's eagerly load the Auth SDK here.
95
117
  // There could potentially be race conditions still... but this greatly decreases the odds while
96
118
  // we reevaluate the API.
97
- const _ = auth.pipe(first()).subscribe();
119
+ auth.pipe(first()).subscribe();
98
120
  const redirectResult = auth.pipe(switchMap(auth => auth.getRedirectResult().then(it => it, () => null)), keepUnstableUntilFirst, shareReplay({ bufferSize: 1, refCount: false }));
99
121
  const authStateChanged = auth.pipe(switchMap(auth => new Observable(sub => ({ unsubscribe: zone.runOutsideAngular(() => auth.onAuthStateChanged(next => sub.next(next), err => sub.error(err), () => sub.complete())) }))));
100
122
  const idTokenChanged = auth.pipe(switchMap(auth => new Observable(sub => ({ unsubscribe: zone.runOutsideAngular(() => auth.onIdTokenChanged(next => sub.next(next), err => sub.error(err), () => sub.complete())) }))));
@@ -108,7 +130,7 @@ class AngularFireAuth {
108
130
  this.authState.pipe(filter(it => !it))).pipe(
109
131
  // handle the { user: { } } when a user is already logged in, rather have null
110
132
  // TODO handle the type corcersion better
111
- map(credential => (credential === null || credential === void 0 ? void 0 : credential.user) ? credential : null), subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular));
133
+ map(credential => credential?.user ? credential : null), subscribeOn(schedulers.outsideAngular), observeOn(schedulers.insideAngular));
112
134
  }
113
135
  return ɵlazySDKProxy(this, auth, zone, { spy: {
114
136
  apply: (name, _, val) => {
@@ -122,10 +144,10 @@ class AngularFireAuth {
122
144
  }
123
145
  } });
124
146
  }
147
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuth, deps: [{ token: FIREBASE_OPTIONS }, { token: FIREBASE_APP_NAME, optional: true }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: i1.ɵAngularFireSchedulers }, { token: USE_EMULATOR, optional: true }, { token: SETTINGS, optional: true }, { token: TENANT_ID, optional: true }, { token: LANGUAGE_CODE, optional: true }, { token: USE_DEVICE_LANGUAGE, optional: true }, { token: PERSISTENCE, optional: true }, { token: i2.AppCheckInstances, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
148
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuth, providedIn: 'any' });
125
149
  }
126
- AngularFireAuth.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuth, deps: [{ token: FIREBASE_OPTIONS }, { token: FIREBASE_APP_NAME, optional: true }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: i1.ɵAngularFireSchedulers }, { token: USE_EMULATOR, optional: true }, { token: SETTINGS, optional: true }, { token: TENANT_ID, optional: true }, { token: LANGUAGE_CODE, optional: true }, { token: USE_DEVICE_LANGUAGE, optional: true }, { token: PERSISTENCE, optional: true }, { token: i2.AppCheckInstances, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
127
- AngularFireAuth.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuth, providedIn: 'any' });
128
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuth, decorators: [{
150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuth, decorators: [{
129
151
  type: Injectable,
130
152
  args: [{
131
153
  providedIn: 'any'
@@ -180,11 +202,11 @@ class AngularFireAuthModule {
180
202
  constructor() {
181
203
  firebase.registerVersion('angularfire', VERSION.full, 'auth-compat');
182
204
  }
205
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
206
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthModule });
207
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthModule, providers: [AngularFireAuth] });
183
208
  }
184
- AngularFireAuthModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
185
- AngularFireAuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthModule });
186
- AngularFireAuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthModule, providers: [AngularFireAuth] });
187
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireAuthModule, decorators: [{
209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireAuthModule, decorators: [{
188
210
  type: NgModule,
189
211
  args: [{
190
212
  providers: [AngularFireAuth]
@@ -196,4 +218,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImpor
196
218
  */
197
219
 
198
220
  export { AngularFireAuth, AngularFireAuthModule, LANGUAGE_CODE, PERSISTENCE, SETTINGS, TENANT_ID, USE_DEVICE_LANGUAGE, USE_EMULATOR, ɵauthFactory };
199
- //# sourceMappingURL=angular-fire-compat-auth.js.map
221
+ //# sourceMappingURL=angular-fire-compat-auth.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-fire-compat-auth.mjs","sources":["../../../src/compat/auth/base.ts","../../../src/compat/auth/auth.ts","../../../src/compat/auth/auth.module.ts","../../../src/compat/auth/angular-fire-compat-auth.ts"],"sourcesContent":["// DO NOT MODIFY, this file is autogenerated by tools/build.ts\n// Export a null object with the same keys as firebase/compat/auth, so Proxy can work with proxy-polyfill in Internet Explorer\nexport const proxyPolyfillCompat = {\n name: null,\n config: null,\n emulatorConfig: null,\n app: null,\n applyActionCode: null,\n checkActionCode: null,\n confirmPasswordReset: null,\n createUserWithEmailAndPassword: null,\n currentUser: null,\n fetchSignInMethodsForEmail: null,\n isSignInWithEmailLink: null,\n getRedirectResult: null,\n languageCode: null,\n settings: null,\n onAuthStateChanged: null,\n onIdTokenChanged: null,\n sendSignInLinkToEmail: null,\n sendPasswordResetEmail: null,\n setPersistence: null,\n signInAndRetrieveDataWithCredential: null,\n signInAnonymously: null,\n signInWithCredential: null,\n signInWithCustomToken: null,\n signInWithEmailAndPassword: null,\n signInWithPhoneNumber: null,\n signInWithEmailLink: null,\n signInWithPopup: null,\n signInWithRedirect: null,\n signOut: null,\n tenantId: null,\n updateCurrentUser: null,\n useDeviceLanguage: null,\n useEmulator: null,\n verifyPasswordResetCode: null,\n};\n","import { isPlatformServer } from '@angular/common';\nimport { Inject, Injectable, InjectionToken, NgZone, Optional, PLATFORM_ID } from '@angular/core';\nimport { keepUnstableUntilFirst, ɵAngularFireSchedulers } from '@angular/fire';\nimport { AppCheckInstances } from '@angular/fire/app-check';\nimport { ɵPromiseProxy, ɵapplyMixins, ɵlazySDKProxy } from '@angular/fire/compat';\nimport { FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseApp, ɵcacheInstance, ɵfirebaseAppFactory } from '@angular/fire/compat';\nimport { FirebaseOptions } from 'firebase/app';\nimport firebase from 'firebase/compat/app';\nimport { Observable, Subject, from, merge, of } from 'rxjs';\nimport { filter, first, map, observeOn, shareReplay, subscribeOn, switchMap, switchMapTo } from 'rxjs/operators';\nimport { proxyPolyfillCompat } from './base';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface AngularFireAuth extends ɵPromiseProxy<firebase.auth.Auth> {}\n\ntype UseEmulatorArguments = Parameters<firebase.auth.Auth['useEmulator']>;\nexport const USE_EMULATOR = new InjectionToken<UseEmulatorArguments>('angularfire2.auth.use-emulator');\n\nexport const SETTINGS = new InjectionToken<firebase.auth.AuthSettings>('angularfire2.auth.settings');\nexport const TENANT_ID = new InjectionToken<string>('angularfire2.auth.tenant-id');\nexport const LANGUAGE_CODE = new InjectionToken<string>('angularfire2.auth.langugage-code');\nexport const USE_DEVICE_LANGUAGE = new InjectionToken<boolean>('angularfire2.auth.use-device-language');\nexport const PERSISTENCE = new InjectionToken<string>('angularfire.auth.persistence');\n\nexport const ɵauthFactory = (\n app: FirebaseApp, zone: NgZone, useEmulator: UseEmulatorArguments|null,\n tenantId: string, languageCode: string|null, useDeviceLanguage: boolean|null,\n settings: firebase.auth.AuthSettings|null, persistence: string|null,\n) => ɵcacheInstance(`${app.name}.auth`, 'AngularFireAuth', app.name, () => {\n const auth = zone.runOutsideAngular(() => app.auth());\n if (useEmulator) {\n auth.useEmulator(...useEmulator);\n }\n if (tenantId) {\n auth.tenantId = tenantId;\n }\n auth.languageCode = languageCode;\n if (useDeviceLanguage) {\n auth.useDeviceLanguage();\n }\n if (settings) {\n for (const [k, v] of Object.entries(settings)) {\n auth.settings[k] = v;\n }\n }\n if (persistence) {\n auth.setPersistence(persistence);\n }\n return auth;\n}, [useEmulator, tenantId, languageCode, useDeviceLanguage, settings, persistence]);\n\n@Injectable({\n providedIn: 'any'\n})\nexport class AngularFireAuth {\n\n /**\n * Observable of authentication state; as of Firebase 4.0 this is only triggered via sign-in/out\n */\n public readonly authState: Observable<firebase.User|null>;\n\n /**\n * Observable of the currently signed-in user's JWT token used to identify the user to a Firebase service (or null).\n */\n public readonly idToken: Observable<string|null>;\n\n /**\n * Observable of the currently signed-in user (or null).\n */\n public readonly user: Observable<firebase.User|null>;\n\n /**\n * Observable of the currently signed-in user's IdTokenResult object which contains the ID token JWT string and other\n * helper properties for getting different data associated with the token as well as all the decoded payload claims\n * (or null).\n */\n public readonly idTokenResult: Observable<firebase.auth.IdTokenResult|null>;\n\n /**\n * Observable of the currently signed-in user's credential, or null\n */\n public readonly credential: Observable<Required<firebase.auth.UserCredential>|null>;\n\n constructor(\n @Inject(FIREBASE_OPTIONS) options: FirebaseOptions,\n @Optional() @Inject(FIREBASE_APP_NAME) name: string|null|undefined,\n // eslint-disable-next-line @typescript-eslint/ban-types\n @Inject(PLATFORM_ID) platformId: Object,\n zone: NgZone,\n schedulers: ɵAngularFireSchedulers,\n @Optional() @Inject(USE_EMULATOR) useEmulator: any, // can't use the tuple here\n @Optional() @Inject(SETTINGS) settings: any, // can't use firebase.auth.AuthSettings here\n @Optional() @Inject(TENANT_ID) tenantId: string | null,\n @Optional() @Inject(LANGUAGE_CODE) languageCode: string | null,\n @Optional() @Inject(USE_DEVICE_LANGUAGE) useDeviceLanguage: boolean | null,\n @Optional() @Inject(PERSISTENCE) persistence: string | null,\n @Optional() _appCheckInstances: AppCheckInstances,\n ) {\n const logins = new Subject<Required<firebase.auth.UserCredential>>();\n\n const auth = of(undefined).pipe(\n observeOn(schedulers.outsideAngular),\n switchMap(() => zone.runOutsideAngular(() => import('firebase/compat/auth'))),\n map(() => ɵfirebaseAppFactory(options, zone, name)),\n map(app => ɵauthFactory(app, zone, useEmulator, tenantId, languageCode, useDeviceLanguage, settings, persistence)),\n shareReplay({ bufferSize: 1, refCount: false }),\n );\n\n if (isPlatformServer(platformId)) {\n\n this.authState = this.user = this.idToken = this.idTokenResult = this.credential = of(null);\n\n } else {\n\n // HACK, as we're exporting auth.Auth, rather than auth, developers importing firebase.auth\n // (e.g, `import { auth } from 'firebase/compat/app'`) are getting an undefined auth object unexpectedly\n // as we're completely lazy. Let's eagerly load the Auth SDK here.\n // There could potentially be race conditions still... but this greatly decreases the odds while\n // we reevaluate the API.\n auth.pipe(first()).subscribe();\n\n const redirectResult = auth.pipe(\n switchMap(auth => auth.getRedirectResult().then(it => it, () => null)),\n keepUnstableUntilFirst,\n shareReplay({ bufferSize: 1, refCount: false }),\n );\n\n const authStateChanged = auth.pipe(\n switchMap(auth => new Observable<firebase.User|null>(sub =>\n ({ unsubscribe: zone.runOutsideAngular(() => auth.onAuthStateChanged(\n next => sub.next(next),\n err => sub.error(err),\n () => sub.complete()\n ))})\n )),\n );\n\n const idTokenChanged = auth.pipe(\n switchMap(auth => new Observable<firebase.User|null>(sub =>\n ({ unsubscribe: zone.runOutsideAngular(() => auth.onIdTokenChanged(\n next => sub.next(next),\n err => sub.error(err),\n () => sub.complete()\n ))})\n ))\n );\n\n this.authState = redirectResult.pipe(\n switchMapTo(authStateChanged),\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n );\n\n this.user = redirectResult.pipe(\n switchMapTo(idTokenChanged),\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n );\n\n this.idToken = this.user.pipe(\n switchMap(user => user ? from(user.getIdToken()) : of(null))\n );\n\n this.idTokenResult = this.user.pipe(\n switchMap(user => user ? from(user.getIdTokenResult()) : of(null))\n );\n\n this.credential = merge(\n redirectResult,\n logins,\n // pipe in null authState to make credential zipable, just a weird devexp if\n // authState and user go null to still have a credential\n this.authState.pipe(filter(it => !it))\n ).pipe(\n // handle the { user: { } } when a user is already logged in, rather have null\n // TODO handle the type corcersion better\n map(credential => credential?.user ? credential as Required<firebase.auth.UserCredential> : null),\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n );\n\n }\n\n return ɵlazySDKProxy(this, auth, zone, { spy: {\n apply: (name, _, val) => {\n // If they call a signIn or createUser function listen into the promise\n // this will give us the user credential, push onto the logins Subject\n // to be consumed in .credential\n if (name.startsWith('signIn') || name.startsWith('createUser')) {\n // TODO fix the types, the trouble is UserCredential has everything optional\n val.then((user: firebase.auth.UserCredential) => logins.next(user as any));\n }\n }\n }});\n\n }\n\n}\n\nɵapplyMixins(AngularFireAuth, [proxyPolyfillCompat]);\n","import { NgModule } from '@angular/core';\nimport { VERSION } from '@angular/fire';\nimport firebase from 'firebase/compat/app';\nimport { AngularFireAuth } from './auth';\n\n@NgModule({\n providers: [ AngularFireAuth ]\n})\nexport class AngularFireAuthModule {\n constructor() {\n firebase.registerVersion('angularfire', VERSION.full, 'auth-compat');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;AACO,MAAM,mBAAmB,GAAG;AACjC,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,cAAc,EAAE,IAAI;AACpB,IAAA,GAAG,EAAE,IAAI;AACT,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,oBAAoB,EAAE,IAAI;AAC1B,IAAA,8BAA8B,EAAE,IAAI;AACpC,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,0BAA0B,EAAE,IAAI;AAChC,IAAA,qBAAqB,EAAE,IAAI;AAC3B,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,kBAAkB,EAAE,IAAI;AACxB,IAAA,gBAAgB,EAAE,IAAI;AACtB,IAAA,qBAAqB,EAAE,IAAI;AAC3B,IAAA,sBAAsB,EAAE,IAAI;AAC5B,IAAA,cAAc,EAAE,IAAI;AACpB,IAAA,mCAAmC,EAAE,IAAI;AACzC,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,oBAAoB,EAAE,IAAI;AAC1B,IAAA,qBAAqB,EAAE,IAAI;AAC3B,IAAA,0BAA0B,EAAE,IAAI;AAChC,IAAA,qBAAqB,EAAE,IAAI;AAC3B,IAAA,mBAAmB,EAAE,IAAI;AACzB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,kBAAkB,EAAE,IAAI;AACxB,IAAA,OAAO,EAAE,IAAI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rB,CAAE,eAAe,CAAE,EAAA,CAAA,CAAA;;2FAEnB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,SAAS,EAAE,CAAE,eAAe,CAAE;AAC/B,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -1,53 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, PLATFORM_ID, Injectable, Inject, Optional, NgModule } from '@angular/core';
3
- import { asyncScheduler, Observable, of, merge } from 'rxjs';
4
- import { map, share, switchMap, scan, distinctUntilChanged, withLatestFrom, skipWhile } from 'rxjs/operators';
5
3
  import * as i1 from '@angular/fire';
6
4
  import { keepUnstableUntilFirst, VERSION } from '@angular/fire';
5
+ import * as i3 from '@angular/fire/app-check';
7
6
  import { ɵfirebaseAppFactory, ɵcacheInstance, FIREBASE_OPTIONS, FIREBASE_APP_NAME } from '@angular/fire/compat';
8
- import 'firebase/compat/auth';
9
- import 'firebase/compat/database';
10
7
  import * as i2 from '@angular/fire/compat/auth';
11
8
  import { ɵauthFactory, USE_EMULATOR as USE_EMULATOR$1, SETTINGS, TENANT_ID, LANGUAGE_CODE, USE_DEVICE_LANGUAGE, PERSISTENCE } from '@angular/fire/compat/auth';
12
- import * as i3 from '@angular/fire/app-check';
9
+ import { map, share, scan, withLatestFrom, skipWhile, switchMap, distinctUntilChanged } from 'rxjs/operators';
10
+ import { Observable, asyncScheduler, merge, of } from 'rxjs';
11
+ import 'firebase/compat/auth';
12
+ import 'firebase/compat/database';
13
13
  import firebase from 'firebase/compat/app';
14
14
 
15
- function isString(value) {
16
- return typeof value === 'string';
17
- }
18
- function isFirebaseDataSnapshot(value) {
19
- return typeof value.exportVal === 'function';
20
- }
21
- function isNil(obj) {
22
- return obj === undefined || obj === null;
23
- }
24
- function isFirebaseRef(value) {
25
- return typeof value.set === 'function';
26
- }
27
- /**
28
- * Returns a database reference given a Firebase App and an
29
- * absolute or relative path.
30
- * @param database - Firebase Database
31
- * @param pathRef - Database path, relative or absolute
32
- */
33
- function getRef(database, pathRef) {
34
- // if a db ref was passed in, just return it
35
- return isFirebaseRef(pathRef) ? pathRef
36
- : database.ref(pathRef);
37
- }
38
- function checkOperationCases(item, cases) {
39
- if (isString(item)) {
40
- return cases.stringCase();
41
- }
42
- else if (isFirebaseRef(item)) {
43
- return cases.firebaseCase();
44
- }
45
- else if (isFirebaseDataSnapshot(item)) {
46
- return cases.snapshotCase();
47
- }
48
- throw new Error(`Expects a string, snapshot, or reference. Got: ${typeof item}`);
49
- }
50
-
51
15
  /**
52
16
  * Create an observable from a Database Reference or Database Query.
53
17
  * @param ref Database Reference
@@ -79,6 +43,7 @@ function fromRef(ref, event, listenType = 'on', scheduler = asyncScheduler) {
79
43
  }
80
44
  else {
81
45
  return {
46
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
82
47
  unsubscribe() {
83
48
  }
84
49
  };
@@ -93,85 +58,40 @@ function fromRef(ref, event, listenType = 'on', scheduler = asyncScheduler) {
93
58
  }), share());
94
59
  }
95
60
 
96
- function listChanges(ref, events, scheduler) {
97
- return fromRef(ref, 'value', 'once', scheduler).pipe(switchMap(snapshotAction => {
98
- const childEvent$ = [of(snapshotAction)];
99
- events.forEach(event => childEvent$.push(fromRef(ref, event, 'on', scheduler)));
100
- return merge(...childEvent$).pipe(scan(buildView, []));
101
- }), distinctUntilChanged());
61
+ function isString(value) {
62
+ return typeof value === 'string';
102
63
  }
103
- function positionFor(changes, key) {
104
- const len = changes.length;
105
- for (let i = 0; i < len; i++) {
106
- if (changes[i].payload.key === key) {
107
- return i;
108
- }
109
- }
110
- return -1;
64
+ function isFirebaseDataSnapshot(value) {
65
+ return typeof value.exportVal === 'function';
111
66
  }
112
- function positionAfter(changes, prevKey) {
113
- if (isNil(prevKey)) {
114
- return 0;
67
+ function isNil(obj) {
68
+ return obj === undefined || obj === null;
69
+ }
70
+ function isFirebaseRef(value) {
71
+ return typeof value.set === 'function';
72
+ }
73
+ /**
74
+ * Returns a database reference given a Firebase App and an
75
+ * absolute or relative path.
76
+ * @param database - Firebase Database
77
+ * @param pathRef - Database path, relative or absolute
78
+ */
79
+ function getRef(database, pathRef) {
80
+ // if a db ref was passed in, just return it
81
+ return isFirebaseRef(pathRef) ? pathRef
82
+ : database.ref(pathRef);
83
+ }
84
+ function checkOperationCases(item, cases) {
85
+ if (isString(item)) {
86
+ return cases.stringCase();
115
87
  }
116
- else {
117
- const i = positionFor(changes, prevKey);
118
- if (i === -1) {
119
- return changes.length;
120
- }
121
- else {
122
- return i + 1;
123
- }
88
+ else if (isFirebaseRef(item)) {
89
+ return cases.firebaseCase();
124
90
  }
125
- }
126
- function buildView(current, action) {
127
- const { payload, prevKey, key } = action;
128
- const currentKeyPosition = positionFor(current, key);
129
- const afterPreviousKeyPosition = positionAfter(current, prevKey);
130
- switch (action.type) {
131
- case 'value':
132
- if (action.payload && action.payload.exists()) {
133
- let prevKey = null;
134
- action.payload.forEach(payload => {
135
- const action = { payload, type: 'value', prevKey, key: payload.key };
136
- prevKey = payload.key;
137
- current = [...current, action];
138
- return false;
139
- });
140
- }
141
- return current;
142
- case 'child_added':
143
- if (currentKeyPosition > -1) {
144
- // check that the previouskey is what we expect, else reorder
145
- const previous = current[currentKeyPosition - 1];
146
- if ((previous && previous.key || null) !== prevKey) {
147
- current = current.filter(x => x.payload.key !== payload.key);
148
- current.splice(afterPreviousKeyPosition, 0, action);
149
- }
150
- }
151
- else if (prevKey == null) {
152
- return [action, ...current];
153
- }
154
- else {
155
- current = current.slice();
156
- current.splice(afterPreviousKeyPosition, 0, action);
157
- }
158
- return current;
159
- case 'child_removed':
160
- return current.filter(x => x.payload.key !== payload.key);
161
- case 'child_changed':
162
- return current.map(x => x.payload.key === key ? action : x);
163
- case 'child_moved':
164
- if (currentKeyPosition > -1) {
165
- const data = current.splice(currentKeyPosition, 1)[0];
166
- current = current.slice();
167
- current.splice(afterPreviousKeyPosition, 0, data);
168
- return current;
169
- }
170
- return current;
171
- // default will also remove null results
172
- default:
173
- return current;
91
+ else if (isFirebaseDataSnapshot(item)) {
92
+ return cases.snapshotCase();
174
93
  }
94
+ throw new Error(`Expects a string, snapshot, or reference. Got: ${typeof item}`);
175
95
  }
176
96
 
177
97
  function validateEventsArray(events) {
@@ -181,11 +101,6 @@ function validateEventsArray(events) {
181
101
  return events;
182
102
  }
183
103
 
184
- function snapshotChanges(query, events, scheduler) {
185
- events = validateEventsArray(events);
186
- return listChanges(query, events, scheduler);
187
- }
188
-
189
104
  function stateChanges(query, events, scheduler) {
190
105
  events = validateEventsArray(events);
191
106
  const childEvent$ = events.map(event => fromRef(query, event, 'on', scheduler));
@@ -261,6 +176,92 @@ function createRemoveMethod(ref) {
261
176
  };
262
177
  }
263
178
 
179
+ function listChanges(ref, events, scheduler) {
180
+ return fromRef(ref, 'value', 'once', scheduler).pipe(switchMap(snapshotAction => {
181
+ const childEvent$ = [of(snapshotAction)];
182
+ events.forEach(event => childEvent$.push(fromRef(ref, event, 'on', scheduler)));
183
+ return merge(...childEvent$).pipe(scan(buildView, []));
184
+ }), distinctUntilChanged());
185
+ }
186
+ function positionFor(changes, key) {
187
+ const len = changes.length;
188
+ for (let i = 0; i < len; i++) {
189
+ if (changes[i].payload.key === key) {
190
+ return i;
191
+ }
192
+ }
193
+ return -1;
194
+ }
195
+ function positionAfter(changes, prevKey) {
196
+ if (isNil(prevKey)) {
197
+ return 0;
198
+ }
199
+ else {
200
+ const i = positionFor(changes, prevKey);
201
+ if (i === -1) {
202
+ return changes.length;
203
+ }
204
+ else {
205
+ return i + 1;
206
+ }
207
+ }
208
+ }
209
+ function buildView(current, action) {
210
+ const { payload, prevKey, key } = action;
211
+ const currentKeyPosition = positionFor(current, key);
212
+ const afterPreviousKeyPosition = positionAfter(current, prevKey);
213
+ switch (action.type) {
214
+ case 'value':
215
+ if (action.payload?.exists()) {
216
+ let prevKey = null;
217
+ action.payload.forEach(payload => {
218
+ const action = { payload, type: 'value', prevKey, key: payload.key };
219
+ prevKey = payload.key;
220
+ current = [...current, action];
221
+ return false;
222
+ });
223
+ }
224
+ return current;
225
+ case 'child_added':
226
+ if (currentKeyPosition > -1) {
227
+ // check that the previouskey is what we expect, else reorder
228
+ const previous = current[currentKeyPosition - 1];
229
+ if ((previous?.key || null) !== prevKey) {
230
+ current = current.filter(x => x.payload.key !== payload.key);
231
+ current.splice(afterPreviousKeyPosition, 0, action);
232
+ }
233
+ }
234
+ else if (prevKey == null) {
235
+ return [action, ...current];
236
+ }
237
+ else {
238
+ current = current.slice();
239
+ current.splice(afterPreviousKeyPosition, 0, action);
240
+ }
241
+ return current;
242
+ case 'child_removed':
243
+ return current.filter(x => x.payload.key !== payload.key);
244
+ case 'child_changed':
245
+ return current.map(x => x.payload.key === key ? action : x);
246
+ case 'child_moved':
247
+ if (currentKeyPosition > -1) {
248
+ const data = current.splice(currentKeyPosition, 1)[0];
249
+ current = current.slice();
250
+ current.splice(afterPreviousKeyPosition, 0, data);
251
+ return current;
252
+ }
253
+ return current;
254
+ // default will also remove null results
255
+ default:
256
+ return current;
257
+ }
258
+ }
259
+
260
+ function snapshotChanges(query, events, scheduler) {
261
+ events = validateEventsArray(events);
262
+ return listChanges(query, events, scheduler);
263
+ }
264
+
264
265
  function createListReference(query, afDatabase) {
265
266
  const outsideAngularScheduler = afDatabase.schedulers.outsideAngular;
266
267
  const refInZone = afDatabase.schedulers.ngZone.run(() => query.ref);
@@ -283,9 +284,12 @@ function createListReference(query, afDatabase) {
283
284
  const snapshotChanges$ = snapshotChanges(query, events, outsideAngularScheduler);
284
285
  return snapshotChanges$.pipe(map(actions => actions.map(a => {
285
286
  if (options && options.idField) {
286
- return Object.assign(Object.assign({}, a.payload.val()), {
287
- [options.idField]: a.key
288
- });
287
+ return {
288
+ ...a.payload.val(),
289
+ ...{
290
+ [options.idField]: a.key
291
+ }
292
+ };
289
293
  }
290
294
  else {
291
295
  return a.payload.val();
@@ -320,8 +324,10 @@ function createObjectReference(query, afDatabase) {
320
324
  const URL = new InjectionToken('angularfire2.realtimeDatabaseURL');
321
325
  const USE_EMULATOR = new InjectionToken('angularfire2.database.use-emulator');
322
326
  class AngularFireDatabase {
327
+ schedulers;
328
+ database;
323
329
  constructor(options, name, databaseURL,
324
- // tslint:disable-next-line:ban-types
330
+ // eslint-disable-next-line @typescript-eslint/ban-types
325
331
  platformId, zone, schedulers, _useEmulator, // tuple isn't working here
326
332
  auth, useAuthEmulator, authSettings, // can't use firebase.auth.AuthSettings here
327
333
  tenantId, languageCode, useDeviceLanguage, persistence, _appCheckInstances) {
@@ -355,10 +361,10 @@ class AngularFireDatabase {
355
361
  const ref = this.schedulers.ngZone.runOutsideAngular(() => this.database.ref());
356
362
  return ref.push().key;
357
363
  }
364
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireDatabase, deps: [{ token: FIREBASE_OPTIONS }, { token: FIREBASE_APP_NAME, optional: true }, { token: URL, optional: true }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: i1.ɵAngularFireSchedulers }, { token: USE_EMULATOR, optional: true }, { token: i2.AngularFireAuth, optional: true }, { token: USE_EMULATOR$1, optional: true }, { token: SETTINGS, optional: true }, { token: TENANT_ID, optional: true }, { token: LANGUAGE_CODE, optional: true }, { token: USE_DEVICE_LANGUAGE, optional: true }, { token: PERSISTENCE, optional: true }, { token: i3.AppCheckInstances, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
365
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireDatabase, providedIn: 'any' });
358
366
  }
359
- AngularFireDatabase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireDatabase, deps: [{ token: FIREBASE_OPTIONS }, { token: FIREBASE_APP_NAME, optional: true }, { token: URL, optional: true }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: i1.ɵAngularFireSchedulers }, { token: USE_EMULATOR, optional: true }, { token: i2.AngularFireAuth, optional: true }, { token: USE_EMULATOR$1, optional: true }, { token: SETTINGS, optional: true }, { token: TENANT_ID, optional: true }, { token: LANGUAGE_CODE, optional: true }, { token: USE_DEVICE_LANGUAGE, optional: true }, { token: PERSISTENCE, optional: true }, { token: i3.AppCheckInstances, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
360
- AngularFireDatabase.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireDatabase, providedIn: 'any' });
361
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireDatabase, decorators: [{
367
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireDatabase, decorators: [{
362
368
  type: Injectable,
363
369
  args: [{
364
370
  providedIn: 'any'
@@ -424,11 +430,11 @@ class AngularFireDatabaseModule {
424
430
  constructor() {
425
431
  firebase.registerVersion('angularfire', VERSION.full, 'rtdb-compat');
426
432
  }
433
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireDatabaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
434
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.3", ngImport: i0, type: AngularFireDatabaseModule });
435
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireDatabaseModule, providers: [AngularFireDatabase] });
427
436
  }
428
- AngularFireDatabaseModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireDatabaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
429
- AngularFireDatabaseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireDatabaseModule });
430
- AngularFireDatabaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireDatabaseModule, providers: [AngularFireDatabase] });
431
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: AngularFireDatabaseModule, decorators: [{
437
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.3", ngImport: i0, type: AngularFireDatabaseModule, decorators: [{
432
438
  type: NgModule,
433
439
  args: [{
434
440
  providers: [AngularFireDatabase]
@@ -440,4 +446,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImpor
440
446
  */
441
447
 
442
448
  export { AngularFireDatabase, AngularFireDatabaseModule, URL, USE_EMULATOR, auditTrail, createListReference, fromRef, listChanges, snapshotChanges, stateChanges };
443
- //# sourceMappingURL=angular-fire-compat-database.js.map
449
+ //# sourceMappingURL=angular-fire-compat-database.mjs.map