@angular/fire 18.0.1 → 19.0.0-canary.35e0a98

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 (297) hide show
  1. package/README.md +11 -30
  2. package/analytics/analytics.module.d.ts +2 -2
  3. package/analytics/firebase.d.ts +3 -3
  4. package/analytics/screen-tracking.service.d.ts +1 -1
  5. package/app-check/app-check.d.ts +6 -0
  6. package/app-check/public_api.d.ts +1 -2
  7. package/auth/firebase.d.ts +1 -2
  8. package/auth/rxfire.d.ts +2 -2
  9. package/compat/auth/auth.d.ts +1 -0
  10. package/compat/database/database.d.ts +2 -1
  11. package/compat/database/list/create-reference.d.ts +2 -1
  12. package/compat/database/object/create-reference.d.ts +2 -1
  13. package/compat/firestore/collection/collection.d.ts +1 -0
  14. package/compat/firestore/collection-group/collection-group.d.ts +1 -0
  15. package/compat/firestore/document/document.d.ts +1 -0
  16. package/compat/firestore/firestore.d.ts +2 -1
  17. package/compat/remote-config/remote-config.d.ts +1 -0
  18. package/compat/storage/pipes/storageUrl.pipe.d.ts +2 -2
  19. package/compat/storage/ref.d.ts +2 -1
  20. package/compat/storage/storage.d.ts +2 -1
  21. package/compat/storage/storage.module.d.ts +1 -1
  22. package/core.d.ts +0 -7
  23. package/data-connect/data-connect.d.ts +9 -0
  24. package/data-connect/data-connect.module.d.ts +13 -0
  25. package/data-connect/firebase.d.ts +12 -0
  26. package/{vertexai-preview → data-connect}/index.d.ts +1 -1
  27. package/data-connect/package.json +3 -0
  28. package/data-connect/public_api.d.ts +3 -0
  29. package/database/firebase.d.ts +1 -2
  30. package/database/rxfire.d.ts +4 -4
  31. package/docs/install-and-setup.md +10 -5
  32. package/docs/vertexai.md +3 -3
  33. package/docs/zones.md +39 -0
  34. package/fesm2022/angular-fire-analytics.mjs +31 -58
  35. package/fesm2022/angular-fire-analytics.mjs.map +1 -1
  36. package/fesm2022/angular-fire-app-check.mjs +16 -11
  37. package/fesm2022/angular-fire-app-check.mjs.map +1 -1
  38. package/fesm2022/angular-fire-app.mjs +4 -4
  39. package/fesm2022/angular-fire-app.mjs.map +1 -1
  40. package/fesm2022/angular-fire-auth-guard.mjs +7 -7
  41. package/fesm2022/angular-fire-auth-guard.mjs.map +1 -1
  42. package/fesm2022/angular-fire-auth.mjs +48 -48
  43. package/fesm2022/angular-fire-auth.mjs.map +1 -1
  44. package/fesm2022/angular-fire-compat-analytics.mjs +15 -15
  45. package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -1
  46. package/fesm2022/angular-fire-compat-auth-guard.mjs +7 -7
  47. package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -1
  48. package/fesm2022/angular-fire-compat-auth.mjs +12 -10
  49. package/fesm2022/angular-fire-compat-auth.mjs.map +1 -1
  50. package/fesm2022/angular-fire-compat-database.mjs +25 -23
  51. package/fesm2022/angular-fire-compat-database.mjs.map +1 -1
  52. package/fesm2022/angular-fire-compat-firestore.mjs +29 -24
  53. package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -1
  54. package/fesm2022/angular-fire-compat-functions.mjs +7 -7
  55. package/fesm2022/angular-fire-compat-functions.mjs.map +1 -1
  56. package/fesm2022/angular-fire-compat-messaging.mjs +7 -7
  57. package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -1
  58. package/fesm2022/angular-fire-compat-performance.mjs +10 -10
  59. package/fesm2022/angular-fire-compat-performance.mjs.map +1 -1
  60. package/fesm2022/angular-fire-compat-remote-config.mjs +12 -10
  61. package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -1
  62. package/fesm2022/angular-fire-compat-storage.mjs +28 -25
  63. package/fesm2022/angular-fire-compat-storage.mjs.map +1 -1
  64. package/fesm2022/angular-fire-compat.mjs +4 -4
  65. package/fesm2022/angular-fire-compat.mjs.map +1 -1
  66. package/fesm2022/angular-fire-data-connect.mjs +100 -0
  67. package/fesm2022/angular-fire-data-connect.mjs.map +1 -0
  68. package/fesm2022/angular-fire-database.mjs +35 -35
  69. package/fesm2022/angular-fire-database.mjs.map +1 -1
  70. package/fesm2022/angular-fire-firestore-lite.mjs +42 -45
  71. package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -1
  72. package/fesm2022/angular-fire-firestore.mjs +46 -55
  73. package/fesm2022/angular-fire-firestore.mjs.map +1 -1
  74. package/fesm2022/angular-fire-functions.mjs +7 -6
  75. package/fesm2022/angular-fire-functions.mjs.map +1 -1
  76. package/fesm2022/angular-fire-messaging.mjs +16 -43
  77. package/fesm2022/angular-fire-messaging.mjs.map +1 -1
  78. package/fesm2022/angular-fire-performance.mjs +7 -7
  79. package/fesm2022/angular-fire-performance.mjs.map +1 -1
  80. package/fesm2022/angular-fire-remote-config.mjs +22 -48
  81. package/fesm2022/angular-fire-remote-config.mjs.map +1 -1
  82. package/fesm2022/angular-fire-storage.mjs +10 -9
  83. package/fesm2022/angular-fire-storage.mjs.map +1 -1
  84. package/fesm2022/{angular-fire-vertexai-preview.mjs → angular-fire-vertexai.mjs} +11 -10
  85. package/fesm2022/angular-fire-vertexai.mjs.map +1 -0
  86. package/fesm2022/angular-fire.mjs +74 -116
  87. package/fesm2022/angular-fire.mjs.map +1 -1
  88. package/firestore/firebase.d.ts +2 -12
  89. package/firestore/lite/firebase.d.ts +2 -6
  90. package/firestore/lite/rxfire.d.ts +4 -4
  91. package/firestore/rxfire.d.ts +7 -7
  92. package/messaging/firebase.d.ts +2 -2
  93. package/messaging/messaging.module.d.ts +2 -2
  94. package/package.json +21 -76
  95. package/performance/rxfire.d.ts +2 -2
  96. package/publish.sh +1 -0
  97. package/remote-config/firebase.d.ts +3 -2
  98. package/remote-config/remote-config.module.d.ts +2 -2
  99. package/remote-config/rxfire.d.ts +5 -5
  100. package/schematics/add/index.js +1 -13
  101. package/schematics/deploy/actions.js +138 -394
  102. package/schematics/deploy/builder.js +139 -61
  103. package/schematics/setup/index.js +94 -64
  104. package/schematics/update/index.js +1 -7
  105. package/schematics/update/v7/index.js +1 -67
  106. package/schematics/versions.json +2 -3
  107. package/vertexai/firebase.d.ts +4 -0
  108. package/vertexai/index.d.ts +5 -0
  109. package/vertexai/package.json +3 -0
  110. package/{vertexai-preview → vertexai}/vertexai.d.ts +1 -1
  111. package/{vertexai-preview → vertexai}/vertexai.module.d.ts +1 -1
  112. package/zones.d.ts +9 -15
  113. package/analytics/is-analytics-supported-factory.d.ts +0 -4
  114. package/analytics/overrides.d.ts +0 -1
  115. package/esm2022/analytics/analytics.mjs +0 -16
  116. package/esm2022/analytics/analytics.module.mjs +0 -101
  117. package/esm2022/analytics/angular-fire-analytics.mjs +0 -5
  118. package/esm2022/analytics/firebase.mjs +0 -17
  119. package/esm2022/analytics/is-analytics-supported-factory.mjs +0 -16
  120. package/esm2022/analytics/overrides.mjs +0 -3
  121. package/esm2022/analytics/public_api.mjs +0 -6
  122. package/esm2022/analytics/screen-tracking.service.mjs +0 -148
  123. package/esm2022/analytics/user-tracking.service.mjs +0 -44
  124. package/esm2022/angular-fire.mjs +0 -5
  125. package/esm2022/app/angular-fire-app.mjs +0 -5
  126. package/esm2022/app/app.mjs +0 -15
  127. package/esm2022/app/app.module.mjs +0 -91
  128. package/esm2022/app/firebase.mjs +0 -13
  129. package/esm2022/app/public_api.mjs +0 -4
  130. package/esm2022/app-check/angular-fire-app-check.mjs +0 -5
  131. package/esm2022/app-check/app-check.mjs +0 -10
  132. package/esm2022/app-check/app-check.module.mjs +0 -80
  133. package/esm2022/app-check/firebase.mjs +0 -10
  134. package/esm2022/app-check/public_api.mjs +0 -5
  135. package/esm2022/auth/angular-fire-auth.mjs +0 -5
  136. package/esm2022/auth/auth.mjs +0 -16
  137. package/esm2022/auth/auth.module.mjs +0 -73
  138. package/esm2022/auth/firebase.mjs +0 -59
  139. package/esm2022/auth/public_api.mjs +0 -5
  140. package/esm2022/auth/rxfire.mjs +0 -7
  141. package/esm2022/auth-guard/angular-fire-auth-guard.mjs +0 -5
  142. package/esm2022/auth-guard/auth-guard.mjs +0 -53
  143. package/esm2022/auth-guard/auth-guard.module.mjs +0 -20
  144. package/esm2022/auth-guard/public_api.mjs +0 -3
  145. package/esm2022/compat/analytics/analytics.mjs +0 -160
  146. package/esm2022/compat/analytics/analytics.module.mjs +0 -35
  147. package/esm2022/compat/analytics/angular-fire-compat-analytics.mjs +0 -5
  148. package/esm2022/compat/analytics/base.mjs +0 -11
  149. package/esm2022/compat/analytics/public_api.mjs +0 -5
  150. package/esm2022/compat/analytics/screen-tracking.service.mjs +0 -49
  151. package/esm2022/compat/analytics/user-tracking.service.mjs +0 -53
  152. package/esm2022/compat/angular-fire-compat.mjs +0 -5
  153. package/esm2022/compat/auth/angular-fire-compat-auth.mjs +0 -5
  154. package/esm2022/compat/auth/auth.mjs +0 -161
  155. package/esm2022/compat/auth/auth.module.mjs +0 -20
  156. package/esm2022/compat/auth/base.mjs +0 -39
  157. package/esm2022/compat/auth/public_api.mjs +0 -4
  158. package/esm2022/compat/auth-guard/angular-fire-compat-auth-guard.mjs +0 -5
  159. package/esm2022/compat/auth-guard/auth-guard.mjs +0 -53
  160. package/esm2022/compat/auth-guard/auth-guard.module.mjs +0 -20
  161. package/esm2022/compat/auth-guard/public_api.mjs +0 -3
  162. package/esm2022/compat/cache.mjs +0 -33
  163. package/esm2022/compat/database/angular-fire-compat-database.mjs +0 -5
  164. package/esm2022/compat/database/database.mjs +0 -119
  165. package/esm2022/compat/database/database.module.mjs +0 -20
  166. package/esm2022/compat/database/interfaces.mjs +0 -2
  167. package/esm2022/compat/database/list/audit-trail.mjs +0 -47
  168. package/esm2022/compat/database/list/changes.mjs +0 -85
  169. package/esm2022/compat/database/list/create-reference.mjs +0 -44
  170. package/esm2022/compat/database/list/data-operation.mjs +0 -11
  171. package/esm2022/compat/database/list/remove.mjs +0 -16
  172. package/esm2022/compat/database/list/snapshot-changes.mjs +0 -7
  173. package/esm2022/compat/database/list/state-changes.mjs +0 -9
  174. package/esm2022/compat/database/list/utils.mjs +0 -8
  175. package/esm2022/compat/database/object/create-reference.mjs +0 -19
  176. package/esm2022/compat/database/object/snapshot-changes.mjs +0 -7
  177. package/esm2022/compat/database/observable/fromRef.mjs +0 -48
  178. package/esm2022/compat/database/public_api.mjs +0 -9
  179. package/esm2022/compat/database/utils.mjs +0 -36
  180. package/esm2022/compat/firebase.app.mjs +0 -6
  181. package/esm2022/compat/firebase.app.module.mjs +0 -71
  182. package/esm2022/compat/firestore/angular-fire-compat-firestore.mjs +0 -5
  183. package/esm2022/compat/firestore/collection/changes.mjs +0 -108
  184. package/esm2022/compat/firestore/collection/collection.mjs +0 -123
  185. package/esm2022/compat/firestore/collection-group/collection-group.mjs +0 -86
  186. package/esm2022/compat/firestore/document/document.mjs +0 -87
  187. package/esm2022/compat/firestore/firestore.mjs +0 -257
  188. package/esm2022/compat/firestore/firestore.module.mjs +0 -32
  189. package/esm2022/compat/firestore/interfaces.mjs +0 -2
  190. package/esm2022/compat/firestore/observable/fromRef.mjs +0 -40
  191. package/esm2022/compat/firestore/public_api.mjs +0 -9
  192. package/esm2022/compat/functions/angular-fire-compat-functions.mjs +0 -5
  193. package/esm2022/compat/functions/base.mjs +0 -8
  194. package/esm2022/compat/functions/functions.mjs +0 -69
  195. package/esm2022/compat/functions/functions.module.mjs +0 -20
  196. package/esm2022/compat/functions/public_api.mjs +0 -4
  197. package/esm2022/compat/messaging/angular-fire-compat-messaging.mjs +0 -5
  198. package/esm2022/compat/messaging/base.mjs +0 -9
  199. package/esm2022/compat/messaging/messaging.mjs +0 -81
  200. package/esm2022/compat/messaging/messaging.module.mjs +0 -20
  201. package/esm2022/compat/messaging/public_api.mjs +0 -3
  202. package/esm2022/compat/performance/angular-fire-compat-performance.mjs +0 -5
  203. package/esm2022/compat/performance/base.mjs +0 -9
  204. package/esm2022/compat/performance/performance.mjs +0 -105
  205. package/esm2022/compat/performance/performance.module.mjs +0 -27
  206. package/esm2022/compat/performance/performance.service.mjs +0 -28
  207. package/esm2022/compat/performance/public_api.mjs +0 -4
  208. package/esm2022/compat/proxy.mjs +0 -58
  209. package/esm2022/compat/public_api.mjs +0 -5
  210. package/esm2022/compat/remote-config/angular-fire-compat-remote-config.mjs +0 -5
  211. package/esm2022/compat/remote-config/base.mjs +0 -20
  212. package/esm2022/compat/remote-config/interfaces.mjs +0 -2
  213. package/esm2022/compat/remote-config/public_api.mjs +0 -3
  214. package/esm2022/compat/remote-config/remote-config.mjs +0 -206
  215. package/esm2022/compat/remote-config/remote-config.module.mjs +0 -20
  216. package/esm2022/compat/storage/angular-fire-compat-storage.mjs +0 -5
  217. package/esm2022/compat/storage/interfaces.mjs +0 -2
  218. package/esm2022/compat/storage/observable/fromTask.mjs +0 -36
  219. package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +0 -56
  220. package/esm2022/compat/storage/public_api.mjs +0 -7
  221. package/esm2022/compat/storage/ref.mjs +0 -28
  222. package/esm2022/compat/storage/storage.mjs +0 -95
  223. package/esm2022/compat/storage/storage.module.mjs +0 -22
  224. package/esm2022/compat/storage/task.mjs +0 -21
  225. package/esm2022/core.mjs +0 -43
  226. package/esm2022/database/angular-fire-database.mjs +0 -5
  227. package/esm2022/database/database.mjs +0 -16
  228. package/esm2022/database/database.module.mjs +0 -76
  229. package/esm2022/database/firebase.mjs +0 -44
  230. package/esm2022/database/public_api.mjs +0 -5
  231. package/esm2022/database/rxfire.mjs +0 -13
  232. package/esm2022/firestore/angular-fire-firestore.mjs +0 -5
  233. package/esm2022/firestore/firebase.mjs +0 -73
  234. package/esm2022/firestore/firestore.mjs +0 -16
  235. package/esm2022/firestore/firestore.module.mjs +0 -76
  236. package/esm2022/firestore/lite/angular-fire-firestore-lite.mjs +0 -5
  237. package/esm2022/firestore/lite/firebase.mjs +0 -48
  238. package/esm2022/firestore/lite/lite.mjs +0 -16
  239. package/esm2022/firestore/lite/lite.module.mjs +0 -75
  240. package/esm2022/firestore/lite/public_api.mjs +0 -5
  241. package/esm2022/firestore/lite/rxfire.mjs +0 -12
  242. package/esm2022/firestore/public_api.mjs +0 -5
  243. package/esm2022/firestore/rxfire.mjs +0 -15
  244. package/esm2022/functions/angular-fire-functions.mjs +0 -5
  245. package/esm2022/functions/firebase.mjs +0 -9
  246. package/esm2022/functions/functions.mjs +0 -16
  247. package/esm2022/functions/functions.module.mjs +0 -76
  248. package/esm2022/functions/public_api.mjs +0 -5
  249. package/esm2022/functions/rxfire.mjs +0 -5
  250. package/esm2022/messaging/angular-fire-messaging.mjs +0 -5
  251. package/esm2022/messaging/firebase.mjs +0 -10
  252. package/esm2022/messaging/is-messaging-supported-factory.mjs +0 -16
  253. package/esm2022/messaging/messaging.mjs +0 -16
  254. package/esm2022/messaging/messaging.module.mjs +0 -93
  255. package/esm2022/messaging/overrides.mjs +0 -3
  256. package/esm2022/messaging/public_api.mjs +0 -4
  257. package/esm2022/performance/angular-fire-performance.mjs +0 -5
  258. package/esm2022/performance/firebase.mjs +0 -8
  259. package/esm2022/performance/performance.mjs +0 -16
  260. package/esm2022/performance/performance.module.mjs +0 -83
  261. package/esm2022/performance/public_api.mjs +0 -5
  262. package/esm2022/performance/rxfire.mjs +0 -8
  263. package/esm2022/public_api.mjs +0 -3
  264. package/esm2022/remote-config/angular-fire-remote-config.mjs +0 -5
  265. package/esm2022/remote-config/firebase.mjs +0 -17
  266. package/esm2022/remote-config/is-remote-config-supported-factory.mjs +0 -16
  267. package/esm2022/remote-config/overrides.mjs +0 -3
  268. package/esm2022/remote-config/public_api.mjs +0 -5
  269. package/esm2022/remote-config/remote-config.mjs +0 -16
  270. package/esm2022/remote-config/remote-config.module.mjs +0 -93
  271. package/esm2022/remote-config/rxfire.mjs +0 -9
  272. package/esm2022/storage/angular-fire-storage.mjs +0 -5
  273. package/esm2022/storage/firebase.mjs +0 -20
  274. package/esm2022/storage/public_api.mjs +0 -5
  275. package/esm2022/storage/rxfire.mjs +0 -6
  276. package/esm2022/storage/storage.mjs +0 -16
  277. package/esm2022/storage/storage.module.mjs +0 -76
  278. package/esm2022/vertexai-preview/angular-fire-vertexai-preview.mjs +0 -5
  279. package/esm2022/vertexai-preview/firebase.mjs +0 -7
  280. package/esm2022/vertexai-preview/public_api.mjs +0 -4
  281. package/esm2022/vertexai-preview/vertexai.mjs +0 -16
  282. package/esm2022/vertexai-preview/vertexai.module.mjs +0 -73
  283. package/esm2022/zones.mjs +0 -194
  284. package/fesm2022/angular-fire-vertexai-preview.mjs.map +0 -1
  285. package/messaging/is-messaging-supported-factory.d.ts +0 -4
  286. package/messaging/overrides.d.ts +0 -1
  287. package/remote-config/is-remote-config-supported-factory.d.ts +0 -4
  288. package/remote-config/overrides.d.ts +0 -1
  289. package/schematics/common.js +0 -81
  290. package/schematics/deploy/functions-templates.js +0 -57
  291. package/schematics/firebaseTools.js +0 -78
  292. package/schematics/interfaces.js +0 -16
  293. package/schematics/setup/prompts.js +0 -195
  294. package/schematics/utils.js +0 -189
  295. package/vertexai-preview/firebase.d.ts +0 -4
  296. package/vertexai-preview/package.json +0 -3
  297. /package/{vertexai-preview → vertexai}/public_api.d.ts +0 -0
@@ -1,195 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.appPrompt = exports.projectPrompt = exports.userPrompt = exports.featuresPrompt = exports.searchApps = exports.searchProjects = void 0;
36
- const child_process_1 = require("child_process");
37
- const fuzzy = __importStar(require("fuzzy"));
38
- const inquirer = __importStar(require("inquirer"));
39
- const firebaseTools_1 = require("../firebaseTools");
40
- const interfaces_1 = require("../interfaces");
41
- const utils_1 = require("../utils");
42
- inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
43
- const NEW_OPTION = '~~angularfire-new~~';
44
- const isProject = (elem) => {
45
- return elem.original === undefined;
46
- };
47
- const isApp = (elem) => {
48
- return elem.original === undefined;
49
- };
50
- const searchProjects = (projects) => (_, input) => __awaiter(void 0, void 0, void 0, function* () {
51
- projects.unshift({
52
- projectId: NEW_OPTION,
53
- displayName: '[CREATE NEW PROJECT]'
54
- });
55
- return fuzzy.filter(input, projects, {
56
- extract(el) {
57
- return `${el.projectId} ${el.displayName}`;
58
- }
59
- }).map((result) => {
60
- let original;
61
- if (isProject(result)) {
62
- original = result;
63
- }
64
- else {
65
- original = result.original;
66
- }
67
- return {
68
- name: original.displayName,
69
- title: original.displayName,
70
- value: original.projectId
71
- };
72
- });
73
- });
74
- exports.searchProjects = searchProjects;
75
- const searchApps = (apps) => (_, input) => __awaiter(void 0, void 0, void 0, function* () {
76
- apps.unshift({
77
- appId: NEW_OPTION,
78
- displayName: '[CREATE NEW APP]',
79
- });
80
- return fuzzy.filter(input, apps, {
81
- extract(el) {
82
- return el.displayName;
83
- }
84
- }).map((result) => {
85
- let original;
86
- if (isApp(result)) {
87
- original = result;
88
- }
89
- else {
90
- original = result.original;
91
- }
92
- return {
93
- name: original.displayName,
94
- title: original.displayName,
95
- value: (0, utils_1.shortAppId)(original),
96
- };
97
- });
98
- });
99
- exports.searchApps = searchApps;
100
- const autocomplete = (questions) => inquirer.prompt(questions);
101
- const featuresPrompt = () => __awaiter(void 0, void 0, void 0, function* () {
102
- const { features } = yield inquirer.prompt({
103
- type: 'checkbox',
104
- name: 'features',
105
- choices: interfaces_1.featureOptions,
106
- message: 'What features would you like to setup?',
107
- default: [],
108
- });
109
- return features;
110
- });
111
- exports.featuresPrompt = featuresPrompt;
112
- const userPrompt = (options) => __awaiter(void 0, void 0, void 0, function* () {
113
- var _a;
114
- const firebaseTools = yield (0, firebaseTools_1.getFirebaseTools)();
115
- let loginList = yield firebaseTools.login.list();
116
- if (!Array.isArray(loginList) || loginList.length === 0) {
117
- (0, child_process_1.spawnSync)('firebase login', { shell: true, cwd: options.projectRoot, stdio: 'inherit' });
118
- return yield firebaseTools.login(options);
119
- }
120
- else {
121
- const defaultUser = yield firebaseTools.login(options);
122
- const choices = loginList.map(({ user }) => ({ name: user.email, value: user }));
123
- const newChoice = { name: '[Login in with another account]', value: NEW_OPTION };
124
- const { user } = yield inquirer.prompt({
125
- type: 'list',
126
- name: 'user',
127
- choices: [newChoice].concat(choices),
128
- message: 'Which Firebase account would you like to use?',
129
- default: (_a = choices.find(it => it.value.email === defaultUser.email)) === null || _a === void 0 ? void 0 : _a.value,
130
- });
131
- if (user === NEW_OPTION) {
132
- (0, child_process_1.spawnSync)('firebase login:add', { shell: true, cwd: options.projectRoot, stdio: 'inherit' });
133
- loginList = yield firebaseTools.login.list();
134
- if (!Array.isArray(loginList)) {
135
- throw new Error("firebase login:list did not respond as expected");
136
- }
137
- const priorEmails = choices.map(it => it.name);
138
- const newLogin = loginList.find(it => !priorEmails.includes(it.user.email));
139
- if (!newLogin) {
140
- throw new Error("Did not find a new user.");
141
- }
142
- return newLogin.user;
143
- }
144
- return user;
145
- }
146
- });
147
- exports.userPrompt = userPrompt;
148
- const projectPrompt = (defaultProject, options) => __awaiter(void 0, void 0, void 0, function* () {
149
- const firebaseTools = yield (0, firebaseTools_1.getFirebaseTools)();
150
- const projects = yield firebaseTools.projects.list(options);
151
- const { projectId } = yield autocomplete({
152
- type: 'autocomplete',
153
- name: 'projectId',
154
- source: (0, exports.searchProjects)(projects),
155
- message: 'Please select a project:',
156
- default: defaultProject,
157
- });
158
- if (projectId === NEW_OPTION) {
159
- const { projectId } = yield inquirer.prompt({
160
- type: 'input',
161
- name: 'projectId',
162
- message: `Please specify a unique project id (cannot be modified afterward) [6-30 characters]:`,
163
- });
164
- const { displayName } = yield inquirer.prompt({
165
- type: 'input',
166
- name: 'displayName',
167
- message: 'What would you like to call your project?',
168
- default: projectId,
169
- });
170
- return yield firebaseTools.projects.create(projectId, { account: options.account, displayName, nonInteractive: true });
171
- }
172
- return (projects).find(it => it.projectId === projectId);
173
- });
174
- exports.projectPrompt = projectPrompt;
175
- const appPrompt = (_b, defaultAppId_1, options_1) => __awaiter(void 0, [_b, defaultAppId_1, options_1], void 0, function* ({ projectId: project }, defaultAppId, options) {
176
- const firebaseTools = yield (0, firebaseTools_1.getFirebaseTools)();
177
- const apps = yield firebaseTools.apps.list('web', Object.assign(Object.assign({}, options), { project }));
178
- const { appId } = yield autocomplete({
179
- type: 'autocomplete',
180
- name: 'appId',
181
- source: (0, exports.searchApps)(apps),
182
- message: 'Please select an app:',
183
- default: defaultAppId,
184
- });
185
- if (appId === NEW_OPTION) {
186
- const { displayName } = yield inquirer.prompt({
187
- type: 'input',
188
- name: 'displayName',
189
- message: 'What would you like to call your app?',
190
- });
191
- return yield firebaseTools.apps.create('web', displayName, Object.assign(Object.assign({}, options), { nonInteractive: true, project }));
192
- }
193
- return (apps).find(it => (0, utils_1.shortAppId)(it) === appId);
194
- });
195
- exports.appPrompt = appPrompt;
@@ -1,189 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addIgnoreFiles = exports.featureToRules = exports.addFixesToServer = exports.getFirebaseProjectNameFromFs = exports.getFirebaseProjectNameFromHost = exports.getProject = exports.getWorkspace = exports.shortAppId = void 0;
4
- const fs_1 = require("fs");
5
- const path_1 = require("path");
6
- const schematics_1 = require("@angular-devkit/schematics");
7
- const utility_1 = require("@schematics/angular/utility");
8
- const common_1 = require("./common");
9
- const shortAppId = (app) => { var _a; return (_a = app === null || app === void 0 ? void 0 : app.appId) === null || _a === void 0 ? void 0 : _a.split('/').pop(); };
10
- exports.shortAppId = shortAppId;
11
- function getWorkspace(host) {
12
- const path = '/angular.json';
13
- const configBuffer = path && host.read(path);
14
- if (!configBuffer) {
15
- throw new schematics_1.SchematicsException(`Could not find angular.json`);
16
- }
17
- const { parse } = require('jsonc-parser');
18
- const workspace = parse(configBuffer.toString());
19
- if (!workspace) {
20
- throw new schematics_1.SchematicsException('Could not parse angular.json');
21
- }
22
- return {
23
- path,
24
- workspace
25
- };
26
- }
27
- exports.getWorkspace = getWorkspace;
28
- const getProject = (options, host) => {
29
- const { workspace } = getWorkspace(host);
30
- const projectName = options.project || workspace.defaultProject;
31
- if (!projectName) {
32
- throw new schematics_1.SchematicsException('No Angular project selected and no default project in the workspace');
33
- }
34
- const project = workspace.projects[projectName];
35
- if (!project) {
36
- throw new schematics_1.SchematicsException('The specified Angular project is not defined in this workspace');
37
- }
38
- if (project.projectType !== 'application') {
39
- throw new schematics_1.SchematicsException(`Deploy requires an Angular project type of "application" in angular.json`);
40
- }
41
- return { project, projectName };
42
- };
43
- exports.getProject = getProject;
44
- function getFirebaseProjectNameFromHost(host, target) {
45
- const buffer = host.read('/.firebaserc');
46
- if (!buffer) {
47
- return [undefined, undefined];
48
- }
49
- const rc = JSON.parse(buffer.toString());
50
- return projectFromRc(rc, target);
51
- }
52
- exports.getFirebaseProjectNameFromHost = getFirebaseProjectNameFromHost;
53
- function getFirebaseProjectNameFromFs(root, target) {
54
- const path = (0, path_1.join)(root, '.firebaserc');
55
- try {
56
- const buffer = (0, fs_1.readFileSync)(path);
57
- const rc = JSON.parse(buffer.toString());
58
- return projectFromRc(rc, target);
59
- }
60
- catch (e) {
61
- return [undefined, undefined];
62
- }
63
- }
64
- exports.getFirebaseProjectNameFromFs = getFirebaseProjectNameFromFs;
65
- const projectFromRc = (rc, target) => {
66
- var _a, _b, _c, _d, _e;
67
- const defaultProject = (_a = rc.projects) === null || _a === void 0 ? void 0 : _a.default;
68
- const project = Object.keys(rc.targets || {}).find(project => { var _a, _b, _c; return !!((_c = (_b = (_a = rc.targets) === null || _a === void 0 ? void 0 : _a[project]) === null || _b === void 0 ? void 0 : _b.hosting) === null || _c === void 0 ? void 0 : _c[target]); });
69
- const site = project && ((_e = (_d = (_c = (_b = rc.targets) === null || _b === void 0 ? void 0 : _b[project]) === null || _c === void 0 ? void 0 : _c.hosting) === null || _d === void 0 ? void 0 : _d[target]) === null || _e === void 0 ? void 0 : _e[0]);
70
- return [project || defaultProject, site];
71
- };
72
- function addFixesToServer(host) {
73
- const serverPath = `/server.ts`;
74
- if (!host.exists(serverPath)) {
75
- return host;
76
- }
77
- const text = host.read(serverPath);
78
- if (text === null) {
79
- throw new schematics_1.SchematicsException(`File ${serverPath} does not exist.`);
80
- }
81
- const sourceText = text.toString('utf-8');
82
- const addZonePatch = !sourceText.includes('import \'zone.js/dist/zone-patch-rxjs\';');
83
- if (addZonePatch) {
84
- (0, common_1.overwriteIfExists)(host, serverPath, sourceText.replace('import \'zone.js/dist/zone-node\';', `import 'zone.js/dist/zone-node';
85
- ${addZonePatch ? 'import \'zone.js/dist/zone-patch-rxjs\';' : ''}`));
86
- }
87
- return host;
88
- }
89
- exports.addFixesToServer = addFixesToServer;
90
- function featureToRules(features, projectName) {
91
- return features.map(feature => {
92
- switch (feature) {
93
- case 2:
94
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
95
- external('initializeAppCheck', '@angular/fire/app-check');
96
- external('ReCaptchaEnterpriseProvider', '@angular/fire/app-check');
97
- return code `${external('provideAppCheck', '@angular/fire/app-check')}(() => {
98
- // TODO get a reCAPTCHA Enterprise here https://console.cloud.google.com/security/recaptcha?project=_
99
- const provider = new ReCaptchaEnterpriseProvider(/* reCAPTCHA Enterprise site key */);
100
- return initializeAppCheck(undefined, { provider, isTokenAutoRefreshEnabled: true });
101
- })`;
102
- });
103
- case 1:
104
- return (0, schematics_1.chain)([
105
- (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
106
- external('getAnalytics', '@angular/fire/analytics');
107
- return code `${external('provideAnalytics', '@angular/fire/analytics')}(() => getAnalytics())`;
108
- }),
109
- (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
110
- return code `${external('ScreenTrackingService', '@angular/fire/analytics')}`;
111
- }),
112
- ...(features.includes(0) ? [
113
- (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
114
- return code `${external('UserTrackingService', '@angular/fire/analytics')}`;
115
- })
116
- ] : []),
117
- ]);
118
- case 0:
119
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
120
- external('getAuth', '@angular/fire/auth');
121
- return code `${external('provideAuth', '@angular/fire/auth')}(() => getAuth())`;
122
- });
123
- case 3:
124
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
125
- external('getDatabase', '@angular/fire/database');
126
- return code `${external('provideDatabase', '@angular/fire/database')}(() => getDatabase())`;
127
- });
128
- case 7:
129
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
130
- external('getFirestore', '@angular/fire/firestore');
131
- return code `${external('provideFirestore', '@angular/fire/firestore')}(() => getFirestore())`;
132
- });
133
- case 4:
134
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
135
- external('getFunctions', '@angular/fire/functions');
136
- return code `${external('provideFunctions', '@angular/fire/functions')}(() => getFunctions())`;
137
- });
138
- case 5:
139
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
140
- external('getMessaging', '@angular/fire/messaging');
141
- return code `${external('provideMessaging', '@angular/fire/messaging')}(() => getMessaging())`;
142
- });
143
- case 6:
144
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
145
- external('getPerformance', '@angular/fire/performance');
146
- return code `${external('providePerformance', '@angular/fire/performance')}(() => getPerformance())`;
147
- });
148
- case 8:
149
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
150
- external('getStorage', '@angular/fire/storage');
151
- return code `${external('provideStorage', '@angular/fire/storage')}(() => getStorage())`;
152
- });
153
- case 9:
154
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
155
- external('getRemoteConfig', '@angular/fire/remote-config');
156
- return code `${external('provideRemoteConfig', '@angular/fire/remote-config')}(() => getRemoteConfig())`;
157
- });
158
- case 10:
159
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
160
- external('getVertexAI', '@angular/fire/vertexai-preview');
161
- return code `${external('provideVertexAI', '@angular/fire/vertexai-preview')}(() => getVertexAI())`;
162
- });
163
- default:
164
- return undefined;
165
- }
166
- }).filter((it) => !!it);
167
- }
168
- exports.featureToRules = featureToRules;
169
- const addIgnoreFiles = (host) => {
170
- const path = '/.gitignore';
171
- if (!host.exists(path)) {
172
- return host;
173
- }
174
- const buffer = host.read(path);
175
- if (!buffer) {
176
- return host;
177
- }
178
- const content = buffer.toString();
179
- if (!content.includes('# Firebase')) {
180
- (0, common_1.overwriteIfExists)(host, path, content.concat(`
181
- # Firebase
182
- .firebase
183
- *-debug.log
184
- .runtimeconfig.json
185
- `));
186
- }
187
- return host;
188
- };
189
- exports.addIgnoreFiles = addIgnoreFiles;
@@ -1,4 +0,0 @@
1
- export * from 'firebase/vertexai-preview';
2
- import { getVertexAI as _getVertexAI, getGenerativeModel as _getGenerativeModel } from 'firebase/vertexai-preview';
3
- export declare const getVertexAI: typeof _getVertexAI;
4
- export declare const getGenerativeModel: typeof _getGenerativeModel;
@@ -1,3 +0,0 @@
1
- {
2
- "module": "../fesm2022/angular-fire-vertexai-preview.mjs"
3
- }
File without changes