firebase-tools-with-isolate 13.29.1 → 14.10.1-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.md +53 -4
  2. package/lib/api.js +10 -2
  3. package/lib/appdistribution/client.js +2 -2
  4. package/lib/apphosting/backend.js +157 -55
  5. package/lib/apphosting/config.js +121 -101
  6. package/lib/apphosting/githubConnections.js +65 -100
  7. package/lib/apphosting/repo.js +22 -36
  8. package/lib/apphosting/rollout.js +5 -11
  9. package/lib/apphosting/secrets/dialogs.js +13 -11
  10. package/lib/apphosting/secrets/index.js +47 -5
  11. package/lib/apphosting/utils.js +1 -3
  12. package/lib/apphosting/yaml.js +35 -49
  13. package/lib/auth.js +23 -6
  14. package/lib/bin/cli.js +99 -0
  15. package/lib/bin/firebase.js +7 -123
  16. package/lib/bin/mcp.js +49 -0
  17. package/lib/checkValidTargetFilters.js +1 -0
  18. package/lib/command.js +3 -2
  19. package/lib/commands/appdistribution-distribute.js +1 -1
  20. package/lib/commands/appdistribution-groups-create.js +1 -1
  21. package/lib/commands/appdistribution-groups-delete.js +1 -1
  22. package/lib/commands/appdistribution-groups-list.js +2 -2
  23. package/lib/commands/appdistribution-testers-add.js +1 -1
  24. package/lib/commands/appdistribution-testers-list.js +3 -3
  25. package/lib/commands/appdistribution-testers-remove.js +1 -1
  26. package/lib/commands/apphosting-backends-create.js +3 -3
  27. package/lib/commands/apphosting-backends-delete.js +23 -27
  28. package/lib/commands/apphosting-backends-get.js +12 -12
  29. package/lib/commands/apphosting-backends-list.js +5 -5
  30. package/lib/commands/apphosting-builds-create.js +8 -2
  31. package/lib/commands/apphosting-builds-get.js +8 -1
  32. package/lib/commands/apphosting-rollouts-create.js +3 -3
  33. package/lib/commands/apphosting-rollouts-list.js +8 -2
  34. package/lib/commands/apphosting-secrets-access.js +1 -1
  35. package/lib/commands/apphosting-secrets-describe.js +2 -2
  36. package/lib/commands/apphosting-secrets-grantaccess.js +20 -10
  37. package/lib/commands/apphosting-secrets-set.js +27 -1
  38. package/lib/commands/apps-android-sha-create.js +1 -1
  39. package/lib/commands/apps-android-sha-delete.js +1 -1
  40. package/lib/commands/apps-android-sha-list.js +2 -2
  41. package/lib/commands/apps-create.js +4 -108
  42. package/lib/commands/apps-init.js +94 -0
  43. package/lib/commands/apps-list.js +1 -1
  44. package/lib/commands/apps-sdkconfig.js +5 -10
  45. package/lib/commands/auth-export.js +1 -1
  46. package/lib/commands/auth-import.js +1 -1
  47. package/lib/commands/database-import.js +4 -6
  48. package/lib/commands/database-instances-create.js +1 -1
  49. package/lib/commands/database-instances-list.js +1 -1
  50. package/lib/commands/database-profile.js +1 -2
  51. package/lib/commands/database-remove.js +4 -6
  52. package/lib/commands/database-set.js +6 -6
  53. package/lib/commands/database-settings-set.js +1 -1
  54. package/lib/commands/database-update.js +6 -6
  55. package/lib/commands/dataconnect-sdk-generate.js +5 -2
  56. package/lib/commands/dataconnect-services-list.js +2 -2
  57. package/lib/commands/dataconnect-sql-diff.js +2 -2
  58. package/lib/commands/dataconnect-sql-grant.js +3 -3
  59. package/lib/commands/dataconnect-sql-migrate.js +2 -2
  60. package/lib/commands/dataconnect-sql-setup.js +39 -0
  61. package/lib/commands/dataconnect-sql-shell.js +5 -7
  62. package/lib/commands/deploy.js +4 -3
  63. package/lib/commands/emulators-exec.js +1 -1
  64. package/lib/commands/emulators-start.js +4 -3
  65. package/lib/commands/experiments-list.js +1 -1
  66. package/lib/commands/ext-dev-deprecate.js +1 -0
  67. package/lib/commands/ext-dev-init.js +3 -12
  68. package/lib/commands/ext-dev-list.js +1 -1
  69. package/lib/commands/ext-dev-register.js +3 -5
  70. package/lib/commands/ext-dev-undeprecate.js +1 -2
  71. package/lib/commands/ext-dev-usage.js +4 -6
  72. package/lib/commands/ext-export.js +1 -2
  73. package/lib/commands/ext-install.js +3 -3
  74. package/lib/commands/ext-sdk-install.js +1 -0
  75. package/lib/commands/ext-update.js +1 -0
  76. package/lib/commands/firestore-backups-delete.js +3 -4
  77. package/lib/commands/firestore-backups-get.js +1 -1
  78. package/lib/commands/firestore-backups-list.js +2 -2
  79. package/lib/commands/firestore-backups-schedules-create.js +4 -4
  80. package/lib/commands/firestore-backups-schedules-delete.js +3 -4
  81. package/lib/commands/firestore-backups-schedules-list.js +2 -2
  82. package/lib/commands/firestore-backups-schedules-update.js +1 -1
  83. package/lib/commands/firestore-databases-create.js +6 -6
  84. package/lib/commands/firestore-databases-delete.js +3 -7
  85. package/lib/commands/firestore-databases-get.js +1 -1
  86. package/lib/commands/firestore-databases-list.js +1 -1
  87. package/lib/commands/firestore-databases-restore.js +5 -5
  88. package/lib/commands/firestore-databases-update.js +4 -4
  89. package/lib/commands/firestore-delete.js +13 -14
  90. package/lib/commands/firestore-indexes-list.js +4 -4
  91. package/lib/commands/firestore-locations.js +1 -1
  92. package/lib/commands/functions-artifacts-setpolicy.js +132 -0
  93. package/lib/commands/functions-config-export.js +6 -10
  94. package/lib/commands/functions-delete.js +5 -7
  95. package/lib/commands/functions-deletegcfartifacts.js +5 -5
  96. package/lib/commands/functions-list.js +24 -33
  97. package/lib/commands/functions-secrets-access.js +1 -1
  98. package/lib/commands/functions-secrets-describe.js +1 -1
  99. package/lib/commands/functions-secrets-destroy.js +10 -12
  100. package/lib/commands/functions-secrets-get.js +1 -1
  101. package/lib/commands/functions-secrets-prune.js +14 -15
  102. package/lib/commands/functions-secrets-set.js +14 -18
  103. package/lib/commands/hosting-channel-create.js +1 -2
  104. package/lib/commands/hosting-channel-delete.js +4 -4
  105. package/lib/commands/hosting-channel-list.js +1 -1
  106. package/lib/commands/hosting-channel-open.js +2 -3
  107. package/lib/commands/hosting-disable.js +5 -5
  108. package/lib/commands/hosting-sites-delete.js +4 -4
  109. package/lib/commands/hosting-sites-get.js +1 -1
  110. package/lib/commands/hosting-sites-list.js +1 -1
  111. package/lib/commands/index.js +7 -4
  112. package/lib/commands/init.js +54 -60
  113. package/lib/commands/internaltesting-frameworks-compose.js +1 -1
  114. package/lib/commands/login-use.js +2 -11
  115. package/lib/commands/login.js +10 -8
  116. package/lib/commands/logout.js +2 -3
  117. package/lib/commands/mcp.js +11 -0
  118. package/lib/commands/open.js +4 -2
  119. package/lib/commands/projects-create.js +1 -2
  120. package/lib/commands/projects-list.js +1 -1
  121. package/lib/commands/remoteconfig-get.js +1 -1
  122. package/lib/commands/remoteconfig-rollback.js +5 -5
  123. package/lib/commands/remoteconfig-versions-list.js +2 -2
  124. package/lib/commands/setup-emulators-database.js +1 -1
  125. package/lib/commands/setup-emulators-dataconnect.js +1 -1
  126. package/lib/commands/setup-emulators-firestore.js +1 -1
  127. package/lib/commands/setup-emulators-pubsub.js +1 -1
  128. package/lib/commands/setup-emulators-storage.js +1 -1
  129. package/lib/commands/setup-emulators-ui.js +1 -1
  130. package/lib/commands/use.js +115 -111
  131. package/lib/config.js +49 -33
  132. package/lib/crashlytics/buildToolsJarHelper.js +1 -1
  133. package/lib/crashlytics/listTopIssues.js +45 -0
  134. package/lib/dataconnect/build.js +61 -4
  135. package/lib/dataconnect/client.js +26 -17
  136. package/lib/dataconnect/cloudAICompanionClient.js +72 -0
  137. package/lib/dataconnect/dataplaneClient.js +19 -2
  138. package/lib/dataconnect/ensureApis.js +6 -3
  139. package/lib/dataconnect/fileUtils.js +39 -6
  140. package/lib/dataconnect/freeTrial.js +21 -9
  141. package/lib/dataconnect/graphqlError.js +56 -2
  142. package/lib/dataconnect/provisionCloudSql.js +23 -12
  143. package/lib/dataconnect/schemaMigration.js +46 -26
  144. package/lib/dataconnect/types.js +5 -1
  145. package/lib/defaultCredentials.js +12 -1
  146. package/lib/deploy/apphosting/args.js +2 -0
  147. package/lib/deploy/apphosting/deploy.js +77 -0
  148. package/lib/deploy/apphosting/index.js +9 -0
  149. package/lib/deploy/apphosting/prepare.js +138 -0
  150. package/lib/deploy/apphosting/release.js +56 -0
  151. package/lib/deploy/apphosting/util.js +65 -0
  152. package/lib/deploy/dataconnect/deploy.js +14 -7
  153. package/lib/deploy/dataconnect/prepare.js +3 -5
  154. package/lib/deploy/extensions/v2FunctionHelper.js +2 -1
  155. package/lib/deploy/firestore/deploy.js +50 -4
  156. package/lib/deploy/functions/build.js +1 -0
  157. package/lib/deploy/functions/checkIam.js +41 -6
  158. package/lib/deploy/functions/containerCleaner.js +17 -2
  159. package/lib/deploy/functions/ensure.js +2 -1
  160. package/lib/deploy/functions/params.js +10 -17
  161. package/lib/deploy/functions/prepare.js +51 -18
  162. package/lib/deploy/functions/prepareFunctionsUpload.js +9 -5
  163. package/lib/deploy/functions/prompts.js +24 -17
  164. package/lib/deploy/functions/release/fabricator.js +4 -4
  165. package/lib/deploy/functions/release/index.js +27 -9
  166. package/lib/deploy/functions/release/planner.js +1 -0
  167. package/lib/deploy/functions/runtimes/discovery/index.js +13 -5
  168. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +4 -4
  169. package/lib/deploy/functions/runtimes/python/index.js +4 -1
  170. package/lib/deploy/functions/runtimes/supported/types.js +17 -11
  171. package/lib/deploy/functions/services/firestore.js +23 -4
  172. package/lib/deploy/index.js +29 -10
  173. package/lib/deploy/lifecycleHooks.js +6 -12
  174. package/lib/emulator/ExpressBasedEmulator.js +1 -1
  175. package/lib/emulator/apphosting/config.js +15 -14
  176. package/lib/emulator/apphosting/index.js +2 -0
  177. package/lib/emulator/apphosting/serve.js +147 -10
  178. package/lib/emulator/auth/cloudFunctions.js +13 -1
  179. package/lib/emulator/auth/operations.js +2 -1
  180. package/lib/emulator/auth/widget_ui.js +2 -1
  181. package/lib/emulator/commandUtils.js +14 -20
  182. package/lib/emulator/constants.js +2 -0
  183. package/lib/emulator/controller.js +24 -9
  184. package/lib/emulator/dataconnect/pgliteServer.js +136 -45
  185. package/lib/emulator/dataconnectEmulator.js +34 -6
  186. package/lib/emulator/dataconnectToolkitController.js +5 -0
  187. package/lib/emulator/downloadableEmulatorInfo.json +81 -0
  188. package/lib/emulator/downloadableEmulators.js +28 -80
  189. package/lib/emulator/env.js +47 -1
  190. package/lib/emulator/extensionsEmulator.js +5 -3
  191. package/lib/emulator/functionsEmulator.js +6 -26
  192. package/lib/emulator/hub.js +5 -4
  193. package/lib/emulator/hubClient.js +5 -0
  194. package/lib/emulator/initEmulators.js +29 -15
  195. package/lib/emulator/ui.js +4 -8
  196. package/lib/ensureApiEnabled.js +32 -1
  197. package/lib/experiments.js +11 -12
  198. package/lib/extensions/askUserForEventsConfig.js +6 -15
  199. package/lib/extensions/askUserForParam.js +23 -52
  200. package/lib/extensions/change-log.js +1 -25
  201. package/lib/extensions/checkProjectBilling.js +3 -9
  202. package/lib/extensions/diagnose.js +3 -6
  203. package/lib/extensions/emulator/triggerHelper.js +4 -0
  204. package/lib/extensions/extensionsHelper.js +25 -31
  205. package/lib/extensions/listExtensions.js +1 -1
  206. package/lib/extensions/manifest.js +3 -7
  207. package/lib/extensions/paramHelper.js +11 -2
  208. package/lib/extensions/provisioningHelper.js +1 -1
  209. package/lib/extensions/tos.js +4 -2
  210. package/lib/extensions/utils.js +1 -10
  211. package/lib/firebaseConfigValidate.js +7 -5
  212. package/lib/firestore/delete.js +5 -4
  213. package/lib/firestore/pretty-print.js +1 -1
  214. package/lib/frameworks/angular/index.js +11 -6
  215. package/lib/frameworks/angular/utils.js +76 -47
  216. package/lib/frameworks/constants.js +1 -1
  217. package/lib/frameworks/index.js +6 -4
  218. package/lib/frameworks/next/index.js +7 -4
  219. package/lib/frameworks/utils.js +11 -3
  220. package/lib/frameworks/vite/index.js +2 -3
  221. package/lib/fsAsync.js +9 -2
  222. package/lib/fsutils.js +16 -1
  223. package/lib/functions/artifacts.js +196 -0
  224. package/lib/functions/secrets.js +15 -16
  225. package/lib/gcp/apphosting.js +13 -1
  226. package/lib/gcp/artifactregistry.js +27 -2
  227. package/lib/gcp/auth.js +113 -1
  228. package/lib/gcp/cloudbilling.js +12 -1
  229. package/lib/gcp/cloudfunctions.js +32 -4
  230. package/lib/gcp/cloudfunctionsv2.js +15 -9
  231. package/lib/gcp/cloudscheduler.js +2 -2
  232. package/lib/gcp/cloudsql/cloudsqladmin.js +32 -11
  233. package/lib/gcp/cloudsql/connect.js +21 -14
  234. package/lib/gcp/cloudsql/interactive.js +1 -1
  235. package/lib/gcp/cloudsql/permissions.js +46 -99
  236. package/lib/gcp/cloudsql/permissionsSetup.js +224 -0
  237. package/lib/gcp/computeEngine.js +19 -2
  238. package/lib/gcp/devConnect.js +6 -1
  239. package/lib/gcp/firestore.js +55 -16
  240. package/lib/gcp/iam.js +1 -5
  241. package/lib/gcp/proto.js +4 -3
  242. package/lib/gcp/run.js +18 -1
  243. package/lib/gcp/serviceusage.js +2 -1
  244. package/lib/gcp/storage.js +47 -1
  245. package/lib/gemini/fdcExperience.js +56 -0
  246. package/lib/gemini/types.js +2 -0
  247. package/lib/hosting/api.js +4 -0
  248. package/lib/hosting/implicitInit.js +7 -3
  249. package/lib/hosting/interactive.js +2 -3
  250. package/lib/index.js +1 -2
  251. package/lib/init/features/account.js +2 -4
  252. package/lib/init/features/apphosting.js +75 -6
  253. package/lib/init/features/database.js +63 -62
  254. package/lib/init/features/dataconnect/index.js +131 -85
  255. package/lib/init/features/dataconnect/sdk.js +73 -18
  256. package/lib/init/features/emulators.js +29 -46
  257. package/lib/init/features/firestore/index.js +79 -43
  258. package/lib/init/features/firestore/indexes.js +30 -45
  259. package/lib/init/features/firestore/rules.js +36 -62
  260. package/lib/init/features/functions/index.js +11 -16
  261. package/lib/init/features/functions/javascript.js +17 -30
  262. package/lib/init/features/functions/npm-dependencies.js +4 -8
  263. package/lib/init/features/functions/python.js +1 -3
  264. package/lib/init/features/functions/typescript.js +25 -43
  265. package/lib/init/features/genkit/index.js +111 -106
  266. package/lib/init/features/hosting/github.js +22 -52
  267. package/lib/init/features/hosting/index.js +37 -57
  268. package/lib/init/features/index.js +10 -5
  269. package/lib/init/features/project.js +18 -21
  270. package/lib/init/features/remoteconfig.js +5 -10
  271. package/lib/init/features/storage.js +30 -10
  272. package/lib/init/index.js +79 -24
  273. package/lib/logger.js +76 -3
  274. package/lib/management/apps.js +292 -7
  275. package/lib/management/projects.js +100 -52
  276. package/lib/mcp/errors.js +20 -0
  277. package/lib/mcp/index.js +227 -0
  278. package/lib/mcp/tool.js +12 -0
  279. package/lib/mcp/tools/apphosting/fetch_logs.js +68 -0
  280. package/lib/mcp/tools/apphosting/index.js +6 -0
  281. package/lib/mcp/tools/apphosting/list_backends.js +51 -0
  282. package/lib/mcp/tools/auth/disable_user.js +30 -0
  283. package/lib/mcp/tools/auth/get_user.js +38 -0
  284. package/lib/mcp/tools/auth/index.js +15 -0
  285. package/lib/mcp/tools/auth/list_users.js +36 -0
  286. package/lib/mcp/tools/auth/set_claims.js +43 -0
  287. package/lib/mcp/tools/auth/set_sms_region_policy.js +36 -0
  288. package/lib/mcp/tools/core/consult_assistant.js +28 -0
  289. package/lib/mcp/tools/core/create_android_sha.js +43 -0
  290. package/lib/mcp/tools/core/create_app.js +90 -0
  291. package/lib/mcp/tools/core/create_project.js +68 -0
  292. package/lib/mcp/tools/core/get_admin_sdk_config.js +26 -0
  293. package/lib/mcp/tools/core/get_environment.js +51 -0
  294. package/lib/mcp/tools/core/get_project.js +22 -0
  295. package/lib/mcp/tools/core/get_sdk_config.js +40 -0
  296. package/lib/mcp/tools/core/index.js +29 -0
  297. package/lib/mcp/tools/core/init.js +153 -0
  298. package/lib/mcp/tools/core/list_apps.js +34 -0
  299. package/lib/mcp/tools/core/list_projects.js +45 -0
  300. package/lib/mcp/tools/core/update_environment.js +55 -0
  301. package/lib/mcp/tools/crashlytics/index.js +5 -0
  302. package/lib/mcp/tools/crashlytics/list_top_issues.js +39 -0
  303. package/lib/mcp/tools/dataconnect/converter.js +60 -0
  304. package/lib/mcp/tools/dataconnect/emulator.js +16 -0
  305. package/lib/mcp/tools/dataconnect/execute_graphql.js +48 -0
  306. package/lib/mcp/tools/dataconnect/execute_graphql_read.js +48 -0
  307. package/lib/mcp/tools/dataconnect/execute_mutation.js +62 -0
  308. package/lib/mcp/tools/dataconnect/execute_query.js +62 -0
  309. package/lib/mcp/tools/dataconnect/generate_operation.js +34 -0
  310. package/lib/mcp/tools/dataconnect/generate_schema.js +26 -0
  311. package/lib/mcp/tools/dataconnect/get_connector.js +31 -0
  312. package/lib/mcp/tools/dataconnect/get_schema.js +31 -0
  313. package/lib/mcp/tools/dataconnect/index.js +23 -0
  314. package/lib/mcp/tools/dataconnect/list_services.js +23 -0
  315. package/lib/mcp/tools/firestore/converter.js +102 -0
  316. package/lib/mcp/tools/firestore/delete_document.js +50 -0
  317. package/lib/mcp/tools/firestore/get_documents.js +58 -0
  318. package/lib/mcp/tools/firestore/index.js +17 -0
  319. package/lib/mcp/tools/firestore/list_collections.js +36 -0
  320. package/lib/mcp/tools/firestore/query_collection.js +132 -0
  321. package/lib/mcp/tools/index.js +62 -0
  322. package/lib/mcp/tools/messaging/index.js +5 -0
  323. package/lib/mcp/tools/messaging/send_message.js +42 -0
  324. package/lib/mcp/tools/remoteconfig/get_template.js +27 -0
  325. package/lib/mcp/tools/remoteconfig/index.js +7 -0
  326. package/lib/mcp/tools/remoteconfig/publish_template.js +34 -0
  327. package/lib/mcp/tools/remoteconfig/rollback_template.js +29 -0
  328. package/lib/mcp/tools/rules/get_rules.js +29 -0
  329. package/lib/mcp/tools/rules/validate_rules.js +97 -0
  330. package/lib/mcp/tools/storage/get_download_url.js +40 -0
  331. package/lib/mcp/tools/storage/get_rules.js +26 -0
  332. package/lib/mcp/tools/storage/index.js +11 -0
  333. package/lib/mcp/types.js +13 -0
  334. package/lib/mcp/util.js +214 -0
  335. package/lib/mcp/util.test.js +468 -0
  336. package/lib/messaging/interfaces.js +2 -0
  337. package/lib/messaging/sendMessage.js +48 -0
  338. package/lib/operation-poller.js +3 -1
  339. package/lib/profileReport.js +1 -1
  340. package/lib/prompt.js +86 -54
  341. package/lib/remoteconfig/publish.js +39 -0
  342. package/lib/requireAuth.js +2 -2
  343. package/lib/requireTosAcceptance.js +4 -0
  344. package/lib/rulesDeploy.js +10 -15
  345. package/lib/track.js +7 -37
  346. package/lib/utils.js +28 -41
  347. package/lib/vsCodeUtils.js +7 -3
  348. package/package.json +31 -15
  349. package/schema/connector-yaml.json +12 -0
  350. package/schema/dataconnect-yaml.json +5 -0
  351. package/schema/extension-yaml.json +17 -4
  352. package/schema/firebase-config.json +1117 -2121
  353. package/standalone/package-lock.json +1255 -992
  354. package/standalone/package.json +1 -1
  355. package/templates/dataconnect-prompts/operation-generation-cursor-windsurf-rule.txt +273 -0
  356. package/templates/dataconnect-prompts/schema-generation-cursor-windsurf-rule.txt +653 -0
  357. package/templates/genkit/firebase.0.9.0.template +1 -1
  358. package/templates/genkit/firebase.1.0.0.template +71 -0
  359. package/templates/init/dataconnect/connector.yaml +4 -1
  360. package/templates/init/dataconnect/dataconnect.yaml +1 -1
  361. package/templates/init/dataconnect/mutations.gql +9 -26
  362. package/templates/init/dataconnect/queries.gql +9 -14
  363. package/templates/init/dataconnect/schema.gql +28 -21
  364. package/templates/init/firestore/firestore.rules +2 -0
  365. package/templates/init/functions/javascript/index.js +14 -1
  366. package/templates/init/functions/javascript/package.lint.json +1 -1
  367. package/templates/init/functions/javascript/package.nolint.json +1 -1
  368. package/templates/init/functions/python/_gitignore +6 -1
  369. package/templates/init/functions/python/main.py +8 -0
  370. package/templates/init/functions/typescript/index.ts +14 -1
  371. package/templates/init/functions/typescript/package.lint.json +2 -2
  372. package/templates/init/functions/typescript/package.nolint.json +3 -3
  373. package/lib/commands/apphosting-config-export.js +0 -28
  374. package/lib/commands/experimental-functions-shell.js +0 -13
  375. package/lib/emulator/dataconnect/pg-gateway/auth/base-auth-flow.js +0 -11
  376. package/lib/emulator/dataconnect/pg-gateway/auth/cert.js +0 -58
  377. package/lib/emulator/dataconnect/pg-gateway/auth/index.js +0 -22
  378. package/lib/emulator/dataconnect/pg-gateway/auth/md5.js +0 -124
  379. package/lib/emulator/dataconnect/pg-gateway/auth/password.js +0 -54
  380. package/lib/emulator/dataconnect/pg-gateway/auth/sasl/sasl-mechanism.js +0 -34
  381. package/lib/emulator/dataconnect/pg-gateway/auth/sasl/scram-sha-256.js +0 -270
  382. package/lib/emulator/dataconnect/pg-gateway/backend-error.js +0 -75
  383. package/lib/emulator/dataconnect/pg-gateway/buffer-reader.js +0 -54
  384. package/lib/emulator/dataconnect/pg-gateway/buffer-writer.js +0 -79
  385. package/lib/emulator/dataconnect/pg-gateway/connection.js +0 -315
  386. package/lib/emulator/dataconnect/pg-gateway/connection.types.js +0 -8
  387. package/lib/emulator/dataconnect/pg-gateway/crypto.js +0 -40
  388. package/lib/emulator/dataconnect/pg-gateway/duplex.js +0 -53
  389. package/lib/emulator/dataconnect/pg-gateway/index.js +0 -27
  390. package/lib/emulator/dataconnect/pg-gateway/message-buffer.js +0 -82
  391. package/lib/emulator/dataconnect/pg-gateway/message-codes.js +0 -52
  392. package/lib/emulator/dataconnect/pg-gateway/platforms/node/index.js +0 -16
  393. package/lib/emulator/dataconnect/pg-gateway/polyfills/readable-stream-async-iterator.js +0 -35
  394. package/lib/emulator/dataconnect/pg-gateway/utils.js +0 -40
  395. package/templates/setup/web.js +0 -5
  396. /package/lib/{emulator/dataconnect/pg-gateway/auth/trust.js → dataconnect/cloudAICompanionTypes.js} +0 -0
@@ -1,17 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseChangelog = exports.getLocalChangelog = exports.breakingChangesInUpdate = exports.displayReleaseNotes = exports.getReleaseNotesForUpdate = void 0;
4
- const clc = require("colorette");
3
+ exports.parseChangelog = exports.getLocalChangelog = exports.breakingChangesInUpdate = exports.getReleaseNotesForUpdate = void 0;
5
4
  const marked_1 = require("marked");
6
5
  const path = require("path");
7
6
  const semver = require("semver");
8
7
  const marked_terminal_1 = require("marked-terminal");
9
- const Table = require("cli-table");
10
8
  const extensionsApi_1 = require("./extensionsApi");
11
9
  const localHelper_1 = require("./localHelper");
12
- const logger_1 = require("../logger");
13
10
  const refs = require("./refs");
14
- const utils_1 = require("../utils");
15
11
  marked_1.marked.use((0, marked_terminal_1.markedTerminal)());
16
12
  const EXTENSIONS_CHANGELOG = "CHANGELOG.md";
17
13
  const VERSION_LINE_REGEX = /##.+?(\d+\.\d+\.\d+(?:-((\d+|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(\d+|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?).*/;
@@ -31,26 +27,6 @@ async function getReleaseNotesForUpdate(args) {
31
27
  return releaseNotes;
32
28
  }
33
29
  exports.getReleaseNotesForUpdate = getReleaseNotesForUpdate;
34
- function displayReleaseNotes(releaseNotes, fromVersion) {
35
- const versions = [fromVersion].concat(Object.keys(releaseNotes));
36
- const breakingVersions = breakingChangesInUpdate(versions);
37
- const table = new Table({ head: ["Version", "What's New"], style: { head: ["yellow", "bold"] } });
38
- for (const [version, note] of Object.entries(releaseNotes)) {
39
- if (breakingVersions.includes(version)) {
40
- table.push([clc.yellow(clc.bold(version)), (0, marked_1.marked)(note)]);
41
- }
42
- else {
43
- table.push([version, (0, marked_1.marked)(note)]);
44
- }
45
- }
46
- logger_1.logger.info(clc.bold("What's new with this update:"));
47
- if (breakingVersions.length) {
48
- (0, utils_1.logLabeledWarning)("warning", "This is a major version update, which means it may contain breaking changes." +
49
- " Read the release notes carefully before continuing with this update.");
50
- }
51
- logger_1.logger.info(table.toString());
52
- }
53
- exports.displayReleaseNotes = displayReleaseNotes;
54
30
  function breakingChangesInUpdate(versionsInUpdate) {
55
31
  const breakingVersions = [];
56
32
  const semvers = versionsInUpdate.map((v) => semver.parse(v)).sort(semver.compare);
@@ -25,9 +25,7 @@ async function openBillingAccount(projectId, url, open) {
25
25
  logger_1.logger.debug("Unable to open billing URL: " + err.stack);
26
26
  }
27
27
  }
28
- await prompt.promptOnce({
29
- name: "continue",
30
- type: "confirm",
28
+ await prompt.confirm({
31
29
  message: "Press enter when finished upgrading your project to continue setting up your extension.",
32
30
  default: true,
33
31
  });
@@ -36,9 +34,7 @@ async function openBillingAccount(projectId, url, open) {
36
34
  async function chooseBillingAccount(projectId, accounts) {
37
35
  const choices = accounts.map((m) => m.displayName);
38
36
  choices.push(ADD_BILLING_ACCOUNT);
39
- const answer = await prompt.promptOnce({
40
- name: "billing",
41
- type: "list",
37
+ const answer = await prompt.select({
42
38
  message: `Extensions require your project to be upgraded to the Blaze plan. You have access to the following billing accounts.
43
39
  Please select the one that you would like to associate with this project:`,
44
40
  choices: choices,
@@ -61,9 +57,7 @@ async function setUpBillingAccount(projectId) {
61
57
  logger_1.logger.info();
62
58
  logger_1.logger.info(clc.bold(clc.underline(billingURL)));
63
59
  logger_1.logger.info();
64
- const open = await prompt.promptOnce({
65
- name: "open-url",
66
- type: "confirm",
60
+ const open = await prompt.confirm({
67
61
  message: "Press enter to open the URL.",
68
62
  default: true,
69
63
  });
@@ -5,8 +5,8 @@ const extensionsHelper_1 = require("./extensionsHelper");
5
5
  const getProjectNumber_1 = require("../getProjectNumber");
6
6
  const utils = require("../utils");
7
7
  const resourceManager = require("../gcp/resourceManager");
8
- const extensionsApi_1 = require("./extensionsApi");
9
8
  const prompt_1 = require("../prompt");
9
+ const extensionsApi_1 = require("./extensionsApi");
10
10
  const logger_1 = require("../logger");
11
11
  const error_1 = require("../error");
12
12
  const SERVICE_AGENT_ROLE = "roles/firebasemods.serviceAgent";
@@ -36,11 +36,8 @@ async function diagnose(projectId) {
36
36
  else {
37
37
  utils.logWarning("Firebase Extensions Service Agent is missing a required IAM role " +
38
38
  "`Firebase Extensions API Service Agent`.");
39
- const fix = await (0, prompt_1.promptOnce)({
40
- type: "confirm",
41
- message: "Would you like to fix the issue by updating IAM policy to include Firebase " +
42
- "Extensions Service Agent with role `Firebase Extensions API Service Agent`",
43
- });
39
+ const fix = await (0, prompt_1.confirm)("Would you like to fix the issue by updating IAM policy to include Firebase " +
40
+ "Extensions Service Agent with role `Firebase Extensions API Service Agent`");
44
41
  if (fix) {
45
42
  policy.bindings.push({
46
43
  role: SERVICE_AGENT_ROLE,
@@ -91,6 +91,10 @@ function functionResourceToEmulatedTriggerDefintion(resource, systemParams = {})
91
91
  eventFilterPathPatterns[filter.attribute] = filter.value;
92
92
  }
93
93
  }
94
+ if (properties.eventTrigger.eventType.includes("google.cloud.firestore")) {
95
+ eventFilters["database"] = eventFilters["database"] ?? "(default)";
96
+ eventFilters["namespace"] = eventFilters["namespace"] ?? "(default)";
97
+ }
94
98
  etd.eventTrigger.eventFilters = eventFilters;
95
99
  etd.eventTrigger.eventFilterPathPatterns = eventFilterPathPatterns;
96
100
  }
@@ -26,9 +26,9 @@ const storage_1 = require("../gcp/storage");
26
26
  const projectUtils_1 = require("../projectUtils");
27
27
  const extensionsApi_1 = require("./extensionsApi");
28
28
  const publisherApi_1 = require("./publisherApi");
29
+ const prompt_1 = require("../prompt");
29
30
  const refs = require("./refs");
30
31
  const localHelper_1 = require("./localHelper");
31
- const prompt_1 = require("../prompt");
32
32
  const logger_1 = require("../logger");
33
33
  const utils_2 = require("../utils");
34
34
  const change_log_1 = require("./change-log");
@@ -283,8 +283,7 @@ async function promptForValidInstanceId(instanceId) {
283
283
  let newInstanceId = "";
284
284
  const instanceIdRegex = /^[a-z][a-z\d\-]*[a-z\d]$/;
285
285
  while (!instanceIdIsValid) {
286
- newInstanceId = await (0, prompt_1.promptOnce)({
287
- type: "input",
286
+ newInstanceId = await (0, prompt_1.input)({
288
287
  default: instanceId,
289
288
  message: `Please enter a new name for this instance:`,
290
289
  });
@@ -306,10 +305,7 @@ async function promptForValidRepoURI() {
306
305
  let repoIsValid = false;
307
306
  let extensionRoot = "";
308
307
  while (!repoIsValid) {
309
- extensionRoot = await (0, prompt_1.promptOnce)({
310
- type: "input",
311
- message: "Enter the GitHub repo URI where this extension's source code is located:",
312
- });
308
+ extensionRoot = await (0, prompt_1.input)("Enter the GitHub repo URI where this extension's source code is located:");
313
309
  if (!repoRegex.test(extensionRoot)) {
314
310
  logger_1.logger.info("Repo URI must follow this format: https://github.com/<user>/<repo>");
315
311
  }
@@ -321,8 +317,7 @@ async function promptForValidRepoURI() {
321
317
  }
322
318
  exports.promptForValidRepoURI = promptForValidRepoURI;
323
319
  async function promptForExtensionRoot(defaultRoot) {
324
- return await (0, prompt_1.promptOnce)({
325
- type: "input",
320
+ return await (0, prompt_1.input)({
326
321
  message: "Enter this extension's root directory in the repo (defaults to previous root if set):",
327
322
  default: defaultRoot,
328
323
  });
@@ -343,22 +338,20 @@ async function promptForReleaseStage(args) {
343
338
  };
344
339
  choices.push(stableChoice);
345
340
  }
346
- stage = await (0, prompt_1.promptOnce)({
347
- type: "list",
341
+ stage = await (0, prompt_1.select)({
348
342
  message: "Choose the release stage:",
349
343
  choices: choices,
350
344
  default: stage,
351
345
  });
352
346
  if (stage === "stable" && !args.hasVersions) {
353
- logger_1.logger.info(`${clc.bold(clc.yellow("Warning:"))} It's highly recommended to first upload a pre-release version before choosing stable.`);
354
347
  const confirmed = await (0, prompt_1.confirm)({
348
+ message: `${clc.bold(clc.yellow("Warning:"))} It's highly recommended to first upload a pre-release version before choosing stable.`,
355
349
  nonInteractive: args.nonInteractive,
356
350
  force: args.force,
357
351
  default: false,
358
352
  });
359
353
  if (!confirmed) {
360
- stage = await (0, prompt_1.promptOnce)({
361
- type: "list",
354
+ stage = await (0, prompt_1.select)({
362
355
  message: "Choose the release stage:",
363
356
  choices: choices,
364
357
  default: stage,
@@ -577,8 +570,7 @@ async function uploadExtensionVersionFromGitHubSource(args) {
577
570
  const defaultSourceRef = "HEAD";
578
571
  if (!sourceRef) {
579
572
  if (!args.nonInteractive) {
580
- sourceRef = await (0, prompt_1.promptOnce)({
581
- type: "input",
573
+ sourceRef = await (0, prompt_1.input)({
582
574
  message: "Enter the commit hash, branch, or tag name to build from in the repo:",
583
575
  default: defaultSourceRef,
584
576
  });
@@ -617,6 +609,7 @@ async function uploadExtensionVersionFromGitHubSource(args) {
617
609
  autoReview: stage === "stable" && autoReview,
618
610
  });
619
611
  const confirmed = await (0, prompt_1.confirm)({
612
+ message: "Continue?",
620
613
  nonInteractive: args.nonInteractive,
621
614
  force: args.force,
622
615
  default: false,
@@ -685,6 +678,7 @@ async function uploadExtensionVersionFromLocalSource(args) {
685
678
  const releaseNotes = validateReleaseNotes(args.rootDirectory, extensionSpec.version, extension);
686
679
  displayReleaseNotes({ extensionRef, newVersion, releaseNotes, autoReview: false });
687
680
  const confirmed = await (0, prompt_1.confirm)({
681
+ message: "Continue?",
688
682
  nonInteractive: args.nonInteractive,
689
683
  force: args.force,
690
684
  default: false,
@@ -790,9 +784,7 @@ function displayReleaseNotes(args) {
790
784
  exports.displayReleaseNotes = displayReleaseNotes;
791
785
  async function promptForOfficialExtension(message) {
792
786
  const officialExts = await (0, resolveSource_1.getExtensionRegistry)(true);
793
- return await (0, prompt_1.promptOnce)({
794
- name: "input",
795
- type: "list",
787
+ return await (0, prompt_1.select)({
796
788
  message,
797
789
  choices: (0, utils_1.convertOfficialExtensionsToList)(officialExts),
798
790
  pageSize: Object.keys(officialExts).length,
@@ -801,15 +793,13 @@ async function promptForOfficialExtension(message) {
801
793
  exports.promptForOfficialExtension = promptForOfficialExtension;
802
794
  async function promptForRepeatInstance(projectName, extensionName) {
803
795
  const message = `An extension with the ID '${clc.bold(extensionName)}' already exists in the project '${clc.bold(projectName)}'. What would you like to do?`;
804
- const choices = [
805
- { name: "Update or reconfigure the existing instance", value: "updateExisting" },
806
- { name: "Install a new instance with a different ID", value: "installNew" },
807
- { name: "Cancel extension installation", value: "cancel" },
808
- ];
809
- return await (0, prompt_1.promptOnce)({
810
- type: "list",
796
+ return await (0, prompt_1.select)({
811
797
  message,
812
- choices,
798
+ choices: [
799
+ { name: "Update or reconfigure the existing instance", value: "updateExisting" },
800
+ { name: "Install a new instance with a different ID", value: "installNew" },
801
+ { name: "Cancel extension installation", value: "cancel" },
802
+ ],
813
803
  });
814
804
  }
815
805
  exports.promptForRepeatInstance = promptForRepeatInstance;
@@ -840,10 +830,14 @@ function isUrlPath(extInstallPath) {
840
830
  exports.isUrlPath = isUrlPath;
841
831
  function isLocalPath(extInstallPath) {
842
832
  const trimmedPath = extInstallPath.trim();
843
- return (trimmedPath.startsWith("~/") ||
844
- trimmedPath.startsWith("./") ||
845
- trimmedPath.startsWith("../") ||
846
- trimmedPath.startsWith("/") ||
833
+ return (trimmedPath.startsWith(`~${path.sep}`) ||
834
+ trimmedPath.startsWith(`.${path.sep}`) ||
835
+ trimmedPath.startsWith(`..${path.sep}`) ||
836
+ trimmedPath.startsWith(`${path.sep}`) ||
837
+ trimmedPath.startsWith(`~/`) ||
838
+ trimmedPath.startsWith(`./`) ||
839
+ trimmedPath.startsWith(`../`) ||
840
+ trimmedPath.startsWith(`/`) ||
847
841
  [".", ".."].includes(trimmedPath));
848
842
  }
849
843
  exports.isLocalPath = isLocalPath;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.listExtensions = void 0;
4
4
  const clc = require("colorette");
5
- const Table = require("cli-table");
5
+ const Table = require("cli-table3");
6
6
  const extensionsApi_1 = require("./extensionsApi");
7
7
  const logger_1 = require("../logger");
8
8
  const utils_1 = require("../utils");
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.readInstanceParam = exports.writeExtensionsToFirebaseJson = exports.getInstanceRef = exports.getInstanceTarget = exports.instanceExists = exports.loadConfig = exports.removeFromManifest = exports.writeLocalSecrets = exports.writeEmptyManifest = exports.writeToManifest = exports.ENV_DIRECTORY = void 0;
4
- const clc = require("colorette");
5
4
  const path = require("path");
6
5
  const fs = require("fs-extra");
7
6
  const refs = require("./refs");
@@ -11,7 +10,6 @@ const logger_1 = require("../logger");
11
10
  const prompt_1 = require("../prompt");
12
11
  const paramHelper_1 = require("./paramHelper");
13
12
  const error_1 = require("../error");
14
- const utils = require("../utils");
15
13
  const extensionsHelper_1 = require("./extensionsHelper");
16
14
  const types_1 = require("./types");
17
15
  exports.ENV_DIRECTORY = "extensions";
@@ -24,8 +22,7 @@ async function writeToManifest(specs, config, options, allowOverwrite = false) {
24
22
  .map((i) => `${i[0]}: ${i[1]}`)
25
23
  .join("\n\t");
26
24
  if (allowOverwrite) {
27
- const overwrite = await (0, prompt_1.promptOnce)({
28
- type: "list",
25
+ const overwrite = await (0, prompt_1.select)({
29
26
  message: `firebase.json already contains extensions:\n${currentExtensions}\nWould you like to overwrite or merge?`,
30
27
  choices: [
31
28
  { name: "Overwrite", value: true },
@@ -52,8 +49,8 @@ async function writeEmptyManifest(config, options) {
52
49
  .join("\n\t");
53
50
  if (!(await (0, prompt_1.confirm)({
54
51
  message: `firebase.json already contains extensions:\n${currentExtensions}\nWould you like to overwrite them?`,
55
- nonInteractive: options.nonInteractive,
56
- force: options.force,
52
+ nonInteractive: options?.nonInteractive,
53
+ force: options?.force,
57
54
  default: false,
58
55
  }))) {
59
56
  return;
@@ -152,7 +149,6 @@ function writeExtensionsToFirebaseJson(specs, config) {
152
149
  }
153
150
  config.set("extensions", extensions);
154
151
  config.writeProjectFile("firebase.json", config.src);
155
- utils.logSuccess("Wrote extensions to " + clc.bold("firebase.json") + "...");
156
152
  }
157
153
  exports.writeExtensionsToFirebaseJson = writeExtensionsToFirebaseJson;
158
154
  async function writeEnvFiles(specs, config, force) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSystemParam = exports.readEnvFile = exports.promptForNewParams = exports.getParamsForUpdate = exports.getParams = exports.setNewDefaults = exports.buildBindingOptionsWithBaseValue = exports.getBaseParamBindings = void 0;
3
+ exports.populateDefaultParams = exports.isSystemParam = exports.readEnvFile = exports.promptForNewParams = exports.getParamsForUpdate = exports.getParams = exports.setNewDefaults = exports.buildBindingOptionsWithBaseValue = exports.getBaseParamBindings = void 0;
4
4
  const path = require("path");
5
5
  const clc = require("colorette");
6
6
  const fs = require("fs-extra");
@@ -39,7 +39,8 @@ function setNewDefaults(params, newDefaults) {
39
39
  if (newDefaults[param.param]) {
40
40
  param.default = newDefaults[param.param];
41
41
  }
42
- else if ((param.param = `firebaseextensions.v1beta.function/location` && newDefaults["LOCATION"])) {
42
+ else if (param.param === `firebaseextensions.v1beta.function/location` &&
43
+ newDefaults["LOCATION"]) {
43
44
  param.default = newDefaults["LOCATION"];
44
45
  }
45
46
  }
@@ -143,3 +144,11 @@ function isSystemParam(paramName) {
143
144
  return regex.test(paramName);
144
145
  }
145
146
  exports.isSystemParam = isSystemParam;
147
+ function populateDefaultParams(params, spec) {
148
+ const ret = { ...params };
149
+ for (const p of spec.params) {
150
+ ret[p.param] = ret[p.param] ?? p.default;
151
+ }
152
+ return ret;
153
+ }
154
+ exports.populateDefaultParams = populateDefaultParams;
@@ -94,7 +94,7 @@ async function isStorageProvisioned(projectId) {
94
94
  return !!resp.body?.buckets?.find((bucket) => {
95
95
  const bucketResourceName = bucket.name;
96
96
  const bucketResourceNameTokens = bucketResourceName.split("/");
97
- const pattern = "^" + projectId + "(.[[a-z0-9]+)*.appspot.com$";
97
+ const pattern = "^" + projectId + "(.[[a-z0-9]+)*.(appspot.com|firebasestorage.app)$";
98
98
  return new RegExp(pattern).test(bucketResourceNameTokens[bucketResourceNameTokens.length - 1]);
99
99
  });
100
100
  }
@@ -50,8 +50,9 @@ async function acceptLatestPublisherTOS(options, projectId) {
50
50
  const tosLink = extensionsTosUrl("publisher");
51
51
  logger_1.logger.info(`To continue, you must accept the Firebase Extensions Publisher Terms of Service: ${tosLink}`);
52
52
  if (await (0, prompt_1.confirm)({
53
- ...options,
54
53
  message: "Do you accept the Firebase Extensions Publisher Terms of Service?",
54
+ nonInteractive: options.nonInteractive,
55
+ force: options.force,
55
56
  })) {
56
57
  return acceptPublisherTOS(projectId, currentAcceptance.latestTosVersion);
57
58
  }
@@ -73,8 +74,9 @@ async function acceptLatestAppDeveloperTOS(options, projectId, instanceIds) {
73
74
  logger_1.logger.debug(`User Terms of Service aready accepted on project ${projectId}.`);
74
75
  }
75
76
  else if (!(await (0, prompt_1.confirm)({
76
- ...options,
77
77
  message: "Do you accept the Firebase Extensions User Terms of Service?",
78
+ nonInteractive: options.nonInteractive,
79
+ force: options.force,
78
80
  }))) {
79
81
  throw new error_1.FirebaseError("You must accept the terms of service to continue.");
80
82
  }
@@ -1,16 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getResourceRuntime = exports.formatTimestamp = exports.getRandomString = exports.convertOfficialExtensionsToList = exports.convertExtensionOptionToLabeledList = exports.onceWithJoin = void 0;
4
- const prompt_1 = require("../prompt");
3
+ exports.getResourceRuntime = exports.formatTimestamp = exports.getRandomString = exports.convertOfficialExtensionsToList = exports.convertExtensionOptionToLabeledList = void 0;
5
4
  const types_1 = require("./types");
6
- async function onceWithJoin(question) {
7
- const response = await (0, prompt_1.promptOnce)(question);
8
- if (Array.isArray(response)) {
9
- return response.join(",");
10
- }
11
- return response;
12
- }
13
- exports.onceWithJoin = onceWithJoin;
14
5
  function convertExtensionOptionToLabeledList(options) {
15
6
  return options.map((option) => {
16
7
  return {
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getErrorMessage = exports.getValidator = void 0;
4
4
  const fs = require("fs");
5
5
  const path = require("path");
6
- const Ajv = require("ajv");
7
- const ajv = new Ajv();
6
+ const ajv_1 = require("ajv");
7
+ const ajv_formats_1 = require("ajv-formats");
8
+ const ajv = new ajv_1.Ajv({ allowUnionTypes: true });
9
+ (0, ajv_formats_1.default)(ajv);
8
10
  let _VALIDATOR = undefined;
9
11
  function getValidator() {
10
12
  if (!_VALIDATOR) {
@@ -17,13 +19,13 @@ function getValidator() {
17
19
  exports.getValidator = getValidator;
18
20
  function getErrorMessage(e) {
19
21
  if (e.keyword === "additionalProperties") {
20
- return `Object "${e.dataPath}" in "firebase.json" has unknown property: ${JSON.stringify(e.params)}`;
22
+ return `Object "${e.instancePath}" in "firebase.json" has unknown property: ${JSON.stringify(e.params)}`;
21
23
  }
22
24
  else if (e.keyword === "required") {
23
- return `Object "${e.dataPath}" in "firebase.json" is missing required property: ${JSON.stringify(e.params)}`;
25
+ return `Object "${e.instancePath}" in "firebase.json" is missing required property: ${JSON.stringify(e.params)}`;
24
26
  }
25
27
  else {
26
- return `Field "${e.dataPath}" in "firebase.json" is possibly invalid: ${e.message}`;
28
+ return `Field "${e.instancePath}" in "firebase.json" is possibly invalid: ${e.message}`;
27
29
  }
28
30
  }
29
31
  exports.getErrorMessage = getErrorMessage;
@@ -18,6 +18,7 @@ class FirestoreDelete {
18
18
  this.shallow = Boolean(options.shallow);
19
19
  this.allCollections = Boolean(options.allCollections);
20
20
  this.databaseId = options.databaseId;
21
+ this.urlPrefix = options.urlPrefix ?? (0, api_1.firestoreOriginOrEmulator)();
21
22
  this.readBatchSize = 7500;
22
23
  this.maxPendingDeletes = 15;
23
24
  this.deleteBatchSize = 250;
@@ -41,7 +42,7 @@ class FirestoreDelete {
41
42
  this.apiClient = new apiv2.Client({
42
43
  auth: true,
43
44
  apiVersion: "v1",
44
- urlPrefix: (0, api_1.firestoreOriginOrEmulator)(),
45
+ urlPrefix: this.urlPrefix,
45
46
  });
46
47
  }
47
48
  setDeleteBatchSize(size) {
@@ -219,7 +220,7 @@ class FirestoreDelete {
219
220
  }
220
221
  numPendingDeletes++;
221
222
  firestore
222
- .deleteDocuments(this.project, toDelete, true)
223
+ .deleteDocuments(this.project, toDelete, this.databaseId, this.urlPrefix)
223
224
  .then((numDeleted) => {
224
225
  FirestoreDelete.progressBar.tick(numDeleted);
225
226
  numDocsDeleted += numDeleted;
@@ -291,7 +292,7 @@ class FirestoreDelete {
291
292
  let initialDelete;
292
293
  if (this.isDocumentPath) {
293
294
  const doc = { name: this.root + "/" + this.path };
294
- initialDelete = firestore.deleteDocument(doc, true).catch((err) => {
295
+ initialDelete = firestore.deleteDocument(doc, this.urlPrefix).catch((err) => {
295
296
  logger_1.logger.debug("deletePath:initialDelete:error", err);
296
297
  if (this.allDescendants) {
297
298
  return Promise.resolve();
@@ -308,7 +309,7 @@ class FirestoreDelete {
308
309
  }
309
310
  deleteDatabase() {
310
311
  return firestore
311
- .listCollectionIds(this.project, true)
312
+ .listCollectionIds(this.project, this.databaseId, this.urlPrefix)
312
313
  .catch((err) => {
313
314
  logger_1.logger.debug("deleteDatabase:listCollectionIds:error", err);
314
315
  return utils.reject("Unable to list collection IDs");
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PrettyPrint = void 0;
4
4
  const clc = require("colorette");
5
- const Table = require("cli-table");
5
+ const Table = require("cli-table3");
6
6
  const sort = require("./api-sort");
7
7
  const types = require("./api-types");
8
8
  const logger_1 = require("../logger");
@@ -15,7 +15,7 @@ exports.support = "preview";
15
15
  exports.type = 3;
16
16
  exports.docsUrl = "https://firebase.google.com/docs/hosting/frameworks/angular";
17
17
  const DEFAULT_BUILD_SCRIPT = ["ng build"];
18
- exports.supportedRange = "16 - 18";
18
+ exports.supportedRange = "16 - 20";
19
19
  async function discover(dir) {
20
20
  if (!(await (0, fs_extra_1.pathExists)((0, path_1.join)(dir, "package.json"))))
21
21
  return;
@@ -181,17 +181,22 @@ exports.handle = function(req,res) {
181
181
  }
182
182
  else if (serverOutputPath) {
183
183
  bootstrapScript = `
184
- const app = new Promise((resolve) => {
184
+ const app = new Promise((resolve, reject) => {
185
185
  setTimeout(() => {
186
186
  const port = process.env.PORT;
187
187
  const socket = 'express.sock';
188
188
  process.env.PORT = socket;
189
-
189
+
190
190
  ${serverEntry?.endsWith(".mjs")
191
191
  ? `import(\`./${serverOutputPath}/${serverEntry}\`)`
192
- : `Promise.resolve(require('./${serverOutputPath}/${serverEntry}'))`}.then(({ app }) => {
193
- process.env.PORT = port;
194
- resolve(app());
192
+ : `Promise.resolve(require('./${serverOutputPath}/${serverEntry}'))`}.then(({ default: defHandler, reqHandler, app }) => {
193
+ const handler = app?.() ?? reqHandler ?? defHandler;
194
+ if (!handler) {
195
+ reject(\`The file at "./${serverOutputPath}/${serverEntry}" did not export a valid request handler. Expected exports: 'app', 'default', or 'reqHandler'.\`);
196
+ } else {
197
+ process.env.PORT = port;
198
+ resolve(handler);
199
+ }
195
200
  });
196
201
  }, 0);
197
202
  });