firebase-tools 11.14.0 → 11.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (942) hide show
  1. package/lib/accountExporter.js +0 -1
  2. package/lib/accountImporter.js +0 -1
  3. package/lib/api.js +0 -1
  4. package/lib/apiv2.js +0 -1
  5. package/lib/appdistribution/client.js +0 -1
  6. package/lib/appdistribution/distribution.js +0 -1
  7. package/lib/appdistribution/options-parser-util.js +0 -1
  8. package/lib/archiveDirectory.js +0 -1
  9. package/lib/auth.js +0 -1
  10. package/lib/bin/firebase.js +3 -4
  11. package/lib/checkMinRequiredVersion.js +0 -1
  12. package/lib/checkValidTargetFilters.js +0 -1
  13. package/lib/command.js +0 -1
  14. package/lib/commands/appdistribution-distribute.js +0 -1
  15. package/lib/commands/appdistribution-testers-add.js +0 -1
  16. package/lib/commands/appdistribution-testers-remove.js +0 -1
  17. package/lib/commands/apps-android-sha-create.js +0 -1
  18. package/lib/commands/apps-android-sha-delete.js +0 -1
  19. package/lib/commands/apps-android-sha-list.js +0 -1
  20. package/lib/commands/apps-create.js +0 -1
  21. package/lib/commands/apps-list.js +0 -1
  22. package/lib/commands/apps-sdkconfig.js +0 -1
  23. package/lib/commands/auth-export.js +0 -1
  24. package/lib/commands/auth-import.js +0 -1
  25. package/lib/commands/crashlytics-mappingfile-generateid.js +0 -1
  26. package/lib/commands/crashlytics-mappingfile-upload.js +0 -1
  27. package/lib/commands/crashlytics-symbols-upload.js +0 -1
  28. package/lib/commands/database-get.js +0 -1
  29. package/lib/commands/database-instances-create.js +0 -1
  30. package/lib/commands/database-instances-list.js +0 -1
  31. package/lib/commands/database-profile.js +0 -1
  32. package/lib/commands/database-push.js +0 -1
  33. package/lib/commands/database-remove.js +0 -1
  34. package/lib/commands/database-rules-canary.js +0 -1
  35. package/lib/commands/database-rules-get.js +0 -1
  36. package/lib/commands/database-rules-list.js +0 -1
  37. package/lib/commands/database-rules-release.js +0 -1
  38. package/lib/commands/database-rules-stage.js +0 -1
  39. package/lib/commands/database-set.js +0 -1
  40. package/lib/commands/database-settings-get.js +0 -1
  41. package/lib/commands/database-settings-set.js +0 -1
  42. package/lib/commands/database-update.js +0 -1
  43. package/lib/commands/deploy.js +3 -4
  44. package/lib/commands/emulators-exec.js +0 -1
  45. package/lib/commands/emulators-export.js +0 -1
  46. package/lib/commands/emulators-start.js +20 -17
  47. package/lib/commands/experimental-functions-shell.js +0 -1
  48. package/lib/commands/experiments-describe.js +0 -1
  49. package/lib/commands/experiments-disable.js +0 -1
  50. package/lib/commands/experiments-enable.js +0 -1
  51. package/lib/commands/experiments-list.js +0 -1
  52. package/lib/commands/ext-configure.js +0 -1
  53. package/lib/commands/ext-dev-deprecate.js +0 -1
  54. package/lib/commands/ext-dev-emulators-exec.js +0 -1
  55. package/lib/commands/ext-dev-emulators-start.js +0 -1
  56. package/lib/commands/ext-dev-extension-delete.js +0 -1
  57. package/lib/commands/ext-dev-init.js +0 -1
  58. package/lib/commands/ext-dev-list.js +0 -1
  59. package/lib/commands/ext-dev-publish.js +0 -1
  60. package/lib/commands/ext-dev-register.js +0 -1
  61. package/lib/commands/ext-dev-undeprecate.js +0 -1
  62. package/lib/commands/ext-dev-unpublish.js +0 -1
  63. package/lib/commands/ext-dev-usage.js +0 -1
  64. package/lib/commands/ext-export.js +0 -1
  65. package/lib/commands/ext-info.js +0 -1
  66. package/lib/commands/ext-install.js +0 -1
  67. package/lib/commands/ext-list.js +0 -1
  68. package/lib/commands/ext-sources-create.js +0 -1
  69. package/lib/commands/ext-uninstall.js +0 -1
  70. package/lib/commands/ext-update.js +0 -1
  71. package/lib/commands/ext.js +0 -1
  72. package/lib/commands/firestore-delete.js +0 -1
  73. package/lib/commands/firestore-indexes-list.js +0 -1
  74. package/lib/commands/functions-config-clone.js +0 -1
  75. package/lib/commands/functions-config-export.js +0 -1
  76. package/lib/commands/functions-config-get.js +0 -1
  77. package/lib/commands/functions-config-set.js +0 -1
  78. package/lib/commands/functions-config-unset.js +0 -1
  79. package/lib/commands/functions-delete.js +0 -1
  80. package/lib/commands/functions-deletegcfartifacts.js +0 -1
  81. package/lib/commands/functions-list.js +0 -1
  82. package/lib/commands/functions-log.js +0 -1
  83. package/lib/commands/functions-secrets-access.js +0 -1
  84. package/lib/commands/functions-secrets-destroy.js +0 -1
  85. package/lib/commands/functions-secrets-get.js +0 -1
  86. package/lib/commands/functions-secrets-prune.js +0 -1
  87. package/lib/commands/functions-secrets-set.js +0 -1
  88. package/lib/commands/functions-shell.js +0 -1
  89. package/lib/commands/help.js +0 -1
  90. package/lib/commands/hosting-channel-create.js +0 -1
  91. package/lib/commands/hosting-channel-delete.js +0 -1
  92. package/lib/commands/hosting-channel-deploy.js +0 -1
  93. package/lib/commands/hosting-channel-list.js +0 -1
  94. package/lib/commands/hosting-channel-open.js +0 -1
  95. package/lib/commands/hosting-clone.js +0 -1
  96. package/lib/commands/hosting-disable.js +0 -1
  97. package/lib/commands/hosting-sites-create.js +0 -1
  98. package/lib/commands/hosting-sites-delete.js +0 -1
  99. package/lib/commands/hosting-sites-get.js +0 -1
  100. package/lib/commands/hosting-sites-list.js +0 -1
  101. package/lib/commands/index.js +0 -1
  102. package/lib/commands/init.js +0 -1
  103. package/lib/commands/login-add.js +0 -1
  104. package/lib/commands/login-ci.js +0 -1
  105. package/lib/commands/login-list.js +0 -1
  106. package/lib/commands/login-use.js +0 -1
  107. package/lib/commands/login.js +0 -1
  108. package/lib/commands/logout.js +0 -1
  109. package/lib/commands/open.js +0 -1
  110. package/lib/commands/projects-addfirebase.js +0 -1
  111. package/lib/commands/projects-create.js +0 -1
  112. package/lib/commands/projects-list.js +0 -1
  113. package/lib/commands/remoteconfig-get.js +0 -1
  114. package/lib/commands/remoteconfig-rollback.js +0 -1
  115. package/lib/commands/remoteconfig-versions-list.js +0 -1
  116. package/lib/commands/serve.js +0 -1
  117. package/lib/commands/setup-emulators-database.js +0 -1
  118. package/lib/commands/setup-emulators-firestore.js +0 -1
  119. package/lib/commands/setup-emulators-pubsub.js +0 -1
  120. package/lib/commands/setup-emulators-storage.js +0 -1
  121. package/lib/commands/setup-emulators-ui.js +0 -1
  122. package/lib/commands/target-apply.js +0 -1
  123. package/lib/commands/target-clear.js +0 -1
  124. package/lib/commands/target-remove.js +0 -1
  125. package/lib/commands/target.js +0 -1
  126. package/lib/commands/use.js +0 -1
  127. package/lib/config.js +0 -1
  128. package/lib/configstore.js +0 -1
  129. package/lib/crashlytics/buildToolsJarHelper.js +0 -1
  130. package/lib/database/api.js +0 -1
  131. package/lib/database/listRemote.js +0 -1
  132. package/lib/database/metadata.js +0 -1
  133. package/lib/database/remove.js +0 -1
  134. package/lib/database/removeRemote.js +0 -1
  135. package/lib/database/rulesConfig.js +0 -1
  136. package/lib/database/settings.js +0 -1
  137. package/lib/defaultCredentials.js +0 -1
  138. package/lib/deploy/database/deploy.js +0 -1
  139. package/lib/deploy/database/index.js +0 -1
  140. package/lib/deploy/database/prepare.js +0 -1
  141. package/lib/deploy/database/release.js +0 -1
  142. package/lib/deploy/extensions/args.js +0 -1
  143. package/lib/deploy/extensions/deploy.js +0 -1
  144. package/lib/deploy/extensions/deploymentSummary.js +0 -1
  145. package/lib/deploy/extensions/errors.js +0 -1
  146. package/lib/deploy/extensions/index.js +0 -1
  147. package/lib/deploy/extensions/planner.js +0 -1
  148. package/lib/deploy/extensions/prepare.js +0 -1
  149. package/lib/deploy/extensions/release.js +0 -1
  150. package/lib/deploy/extensions/secrets.js +0 -1
  151. package/lib/deploy/extensions/tasks.js +0 -1
  152. package/lib/deploy/extensions/validate.js +0 -1
  153. package/lib/deploy/firestore/deploy.js +0 -1
  154. package/lib/deploy/firestore/index.js +0 -1
  155. package/lib/deploy/firestore/prepare.js +0 -1
  156. package/lib/deploy/firestore/release.js +0 -1
  157. package/lib/deploy/functions/args.js +0 -1
  158. package/lib/deploy/functions/backend.js +0 -1
  159. package/lib/deploy/functions/build.js +0 -1
  160. package/lib/deploy/functions/cache/applyHash.js +0 -1
  161. package/lib/deploy/functions/cache/hash.js +0 -1
  162. package/lib/deploy/functions/cel.js +0 -1
  163. package/lib/deploy/functions/checkIam.js +0 -1
  164. package/lib/deploy/functions/containerCleaner.js +0 -1
  165. package/lib/deploy/functions/deploy.js +0 -1
  166. package/lib/deploy/functions/ensure.js +0 -1
  167. package/lib/deploy/functions/ensureCloudBuildEnabled.js +0 -1
  168. package/lib/deploy/functions/functionsDeployHelper.js +0 -1
  169. package/lib/deploy/functions/index.js +0 -1
  170. package/lib/deploy/functions/params.js +9 -2
  171. package/lib/deploy/functions/prepare.js +0 -1
  172. package/lib/deploy/functions/prepareFunctionsUpload.js +0 -1
  173. package/lib/deploy/functions/pricing.js +0 -1
  174. package/lib/deploy/functions/prompts.js +0 -1
  175. package/lib/deploy/functions/release/executor.js +0 -1
  176. package/lib/deploy/functions/release/fabricator.js +1 -1
  177. package/lib/deploy/functions/release/index.js +0 -1
  178. package/lib/deploy/functions/release/planner.js +0 -1
  179. package/lib/deploy/functions/release/reporter.js +0 -1
  180. package/lib/deploy/functions/release/sourceTokenScraper.js +0 -1
  181. package/lib/deploy/functions/release/timer.js +0 -1
  182. package/lib/deploy/functions/runtimes/discovery/index.js +0 -1
  183. package/lib/deploy/functions/runtimes/discovery/mockDiscoveryServer.js +0 -1
  184. package/lib/deploy/functions/runtimes/discovery/parsing.js +0 -1
  185. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +0 -1
  186. package/lib/deploy/functions/runtimes/golang/gomod.js +0 -1
  187. package/lib/deploy/functions/runtimes/golang/index.js +0 -1
  188. package/lib/deploy/functions/runtimes/index.js +0 -1
  189. package/lib/deploy/functions/runtimes/node/extractTriggers.js +0 -1
  190. package/lib/deploy/functions/runtimes/node/index.js +0 -1
  191. package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +0 -1
  192. package/lib/deploy/functions/runtimes/node/parseTriggers.js +0 -1
  193. package/lib/deploy/functions/runtimes/node/triggerParser.js +0 -1
  194. package/lib/deploy/functions/runtimes/node/validate.js +0 -1
  195. package/lib/deploy/functions/runtimes/node/versioning.js +0 -1
  196. package/lib/deploy/functions/services/auth.js +0 -1
  197. package/lib/deploy/functions/services/database.js +0 -1
  198. package/lib/deploy/functions/services/firebaseAlerts.js +0 -1
  199. package/lib/deploy/functions/services/index.js +0 -1
  200. package/lib/deploy/functions/services/remoteConfig.js +0 -1
  201. package/lib/deploy/functions/services/storage.js +0 -1
  202. package/lib/deploy/functions/services/testLab.js +0 -1
  203. package/lib/deploy/functions/triggerRegionHelper.js +0 -1
  204. package/lib/deploy/functions/validate.js +0 -1
  205. package/lib/deploy/hosting/args.js +0 -1
  206. package/lib/deploy/hosting/context.js +0 -1
  207. package/lib/deploy/hosting/convertConfig.js +24 -7
  208. package/lib/deploy/hosting/deploy.js +5 -1
  209. package/lib/deploy/hosting/hashcache.js +0 -1
  210. package/lib/deploy/hosting/index.js +0 -1
  211. package/lib/deploy/hosting/prepare.js +0 -1
  212. package/lib/deploy/hosting/release.js +0 -1
  213. package/lib/deploy/hosting/uploader.js +0 -1
  214. package/lib/deploy/index.js +10 -1
  215. package/lib/deploy/lifecycleHooks.js +0 -1
  216. package/lib/deploy/remoteconfig/deploy.js +0 -1
  217. package/lib/deploy/remoteconfig/functions.js +0 -1
  218. package/lib/deploy/remoteconfig/index.js +0 -1
  219. package/lib/deploy/remoteconfig/prepare.js +0 -1
  220. package/lib/deploy/remoteconfig/release.js +0 -1
  221. package/lib/deploy/storage/deploy.js +0 -1
  222. package/lib/deploy/storage/index.js +0 -1
  223. package/lib/deploy/storage/prepare.js +0 -1
  224. package/lib/deploy/storage/release.js +0 -1
  225. package/lib/deploymentTool.js +0 -1
  226. package/lib/detectProjectRoot.js +0 -1
  227. package/lib/downloadUtils.js +0 -1
  228. package/lib/dynamicImport.js +10 -7
  229. package/lib/emulator/ExpressBasedEmulator.js +92 -0
  230. package/lib/emulator/adminSdkConfig.js +0 -1
  231. package/lib/emulator/auth/apiSpec.js +0 -1
  232. package/lib/emulator/auth/cloudFunctions.js +3 -13
  233. package/lib/emulator/auth/errors.js +0 -1
  234. package/lib/emulator/auth/handlers.js +0 -1
  235. package/lib/emulator/auth/index.js +10 -5
  236. package/lib/emulator/auth/operations.js +0 -1
  237. package/lib/emulator/auth/schema.js +0 -1
  238. package/lib/emulator/auth/server.js +15 -2
  239. package/lib/emulator/auth/state.js +0 -1
  240. package/lib/emulator/auth/types.js +0 -1
  241. package/lib/emulator/auth/utils.js +1 -2
  242. package/lib/emulator/auth/widget_ui.js +0 -1
  243. package/lib/emulator/commandUtils.js +21 -45
  244. package/lib/emulator/constants.js +2 -10
  245. package/lib/emulator/controller.js +135 -133
  246. package/lib/emulator/databaseEmulator.js +3 -9
  247. package/lib/emulator/dns.js +49 -0
  248. package/lib/emulator/download.js +0 -1
  249. package/lib/emulator/downloadableEmulators.js +19 -14
  250. package/lib/emulator/emulatorLogger.js +14 -8
  251. package/lib/emulator/env.js +35 -0
  252. package/lib/emulator/eventarcEmulator.js +2 -9
  253. package/lib/emulator/events/types.js +0 -1
  254. package/lib/emulator/extensions/postinstall.js +8 -9
  255. package/lib/emulator/extensions/validation.js +0 -1
  256. package/lib/emulator/extensionsEmulator.js +7 -8
  257. package/lib/emulator/firestoreEmulator.js +5 -12
  258. package/lib/emulator/functionsEmulator.js +24 -61
  259. package/lib/emulator/functionsEmulatorRuntime.js +0 -1
  260. package/lib/emulator/functionsEmulatorShared.js +5 -4
  261. package/lib/emulator/functionsEmulatorShell.js +1 -2
  262. package/lib/emulator/functionsEmulatorUtils.js +0 -1
  263. package/lib/emulator/functionsRuntimeWorker.js +0 -1
  264. package/lib/emulator/hostingEmulator.js +0 -1
  265. package/lib/emulator/hub.js +50 -59
  266. package/lib/emulator/hubClient.js +24 -11
  267. package/lib/emulator/hubExport.js +3 -12
  268. package/lib/emulator/loggingEmulator.js +0 -1
  269. package/lib/emulator/portUtils.js +208 -30
  270. package/lib/emulator/pubsubEmulator.js +11 -13
  271. package/lib/emulator/registry.js +11 -21
  272. package/lib/emulator/shared/request.js +0 -1
  273. package/lib/emulator/storage/apis/firebase.js +0 -1
  274. package/lib/emulator/storage/apis/gcloud.js +3 -7
  275. package/lib/emulator/storage/cloudFunctions.js +2 -8
  276. package/lib/emulator/storage/crc.js +0 -1
  277. package/lib/emulator/storage/errors.js +0 -1
  278. package/lib/emulator/storage/files.js +0 -1
  279. package/lib/emulator/storage/index.js +0 -1
  280. package/lib/emulator/storage/metadata.js +11 -6
  281. package/lib/emulator/storage/multipart.js +0 -1
  282. package/lib/emulator/storage/persistence.js +0 -1
  283. package/lib/emulator/storage/rules/config.js +0 -1
  284. package/lib/emulator/storage/rules/expressionValue.js +0 -1
  285. package/lib/emulator/storage/rules/manager.js +0 -1
  286. package/lib/emulator/storage/rules/runtime.js +1 -7
  287. package/lib/emulator/storage/rules/types.js +0 -1
  288. package/lib/emulator/storage/rules/utils.js +0 -1
  289. package/lib/emulator/storage/server.js +0 -1
  290. package/lib/emulator/storage/upload.js +0 -1
  291. package/lib/emulator/types.js +0 -1
  292. package/lib/emulator/ui.js +6 -8
  293. package/lib/emulator/workQueue.js +0 -1
  294. package/lib/ensureApiEnabled.js +0 -1
  295. package/lib/ensureCloudResourceLocation.js +0 -1
  296. package/lib/error.js +0 -1
  297. package/lib/errorOut.js +0 -1
  298. package/lib/experiments.js +10 -2
  299. package/lib/extensions/askUserForConsent.js +0 -1
  300. package/lib/extensions/askUserForEventsConfig.js +0 -1
  301. package/lib/extensions/askUserForParam.js +0 -1
  302. package/lib/extensions/billingMigrationHelper.js +0 -1
  303. package/lib/extensions/change-log.js +0 -1
  304. package/lib/extensions/checkProjectBilling.js +0 -1
  305. package/lib/extensions/diagnose.js +0 -1
  306. package/lib/extensions/displayExtensionInfo.js +43 -7
  307. package/lib/extensions/emulator/optionsHelper.js +0 -1
  308. package/lib/extensions/emulator/specHelper.js +0 -1
  309. package/lib/extensions/emulator/triggerHelper.js +0 -1
  310. package/lib/extensions/etags.js +0 -1
  311. package/lib/extensions/export.js +0 -1
  312. package/lib/extensions/extensionsApi.js +0 -1
  313. package/lib/extensions/extensionsHelper.js +0 -1
  314. package/lib/extensions/listExtensions.js +0 -1
  315. package/lib/extensions/localHelper.js +0 -1
  316. package/lib/extensions/manifest.js +0 -1
  317. package/lib/extensions/metricsTypeDef.js +0 -1
  318. package/lib/extensions/metricsUtils.js +0 -1
  319. package/lib/extensions/paramHelper.js +0 -1
  320. package/lib/extensions/provisioningHelper.js +0 -1
  321. package/lib/extensions/publishHelpers.js +0 -1
  322. package/lib/extensions/refs.js +0 -1
  323. package/lib/extensions/resolveSource.js +0 -1
  324. package/lib/extensions/secretsUtils.js +2 -2
  325. package/lib/extensions/types.js +0 -1
  326. package/lib/extensions/updateHelper.js +0 -1
  327. package/lib/extensions/utils.js +0 -1
  328. package/lib/extensions/versionHelper.js +0 -1
  329. package/lib/extensions/warnings.js +0 -1
  330. package/lib/fetchMOTD.js +0 -1
  331. package/lib/fetchWebSetup.js +0 -1
  332. package/lib/filterTargets.js +0 -1
  333. package/lib/firebaseConfig.js +0 -1
  334. package/lib/firebaseConfigValidate.js +0 -1
  335. package/lib/firestore/checkDatabaseType.js +0 -1
  336. package/lib/firestore/delete.js +0 -1
  337. package/lib/firestore/encodeFirestoreValue.js +0 -1
  338. package/lib/firestore/indexes-api.js +0 -1
  339. package/lib/firestore/indexes-sort.js +0 -1
  340. package/lib/firestore/indexes-spec.js +0 -1
  341. package/lib/firestore/indexes.js +0 -1
  342. package/lib/firestore/util.js +0 -1
  343. package/lib/firestore/validator.js +0 -1
  344. package/lib/frameworks/angular/index.js +1 -2
  345. package/lib/frameworks/express/index.js +1 -2
  346. package/lib/frameworks/index.js +33 -18
  347. package/lib/frameworks/lit/index.js +0 -1
  348. package/lib/frameworks/next/index.js +1 -2
  349. package/lib/frameworks/nuxt/index.js +1 -2
  350. package/lib/frameworks/preact/index.js +0 -1
  351. package/lib/frameworks/react/index.js +0 -1
  352. package/lib/frameworks/svelte/index.js +0 -1
  353. package/lib/frameworks/vite/index.js +1 -2
  354. package/lib/fsAsync.js +0 -1
  355. package/lib/fsutils.js +0 -1
  356. package/lib/functional.js +0 -1
  357. package/lib/functions/constants.js +0 -1
  358. package/lib/functions/ensureTargeted.js +21 -0
  359. package/lib/functions/env.js +33 -20
  360. package/lib/functions/events/index.js +0 -1
  361. package/lib/functions/events/v1.js +0 -1
  362. package/lib/functions/events/v2.js +0 -1
  363. package/lib/functions/functionslog.js +0 -1
  364. package/lib/functions/projectConfig.js +0 -1
  365. package/lib/functions/runtimeConfigExport.js +0 -1
  366. package/lib/functions/secrets.js +0 -1
  367. package/lib/functionsConfig.js +0 -1
  368. package/lib/functionsConfigClone.js +0 -1
  369. package/lib/functionsShellCommandAction.js +12 -6
  370. package/lib/gcp/artifactregistry.js +0 -1
  371. package/lib/gcp/auth.js +0 -1
  372. package/lib/gcp/cloudbilling.js +0 -1
  373. package/lib/gcp/cloudfunctions.js +0 -1
  374. package/lib/gcp/cloudfunctionsv2.js +0 -1
  375. package/lib/gcp/cloudlogging.js +0 -1
  376. package/lib/gcp/cloudmonitoring.js +0 -1
  377. package/lib/gcp/cloudscheduler.js +0 -1
  378. package/lib/gcp/cloudtasks.js +0 -1
  379. package/lib/gcp/docker.js +0 -1
  380. package/lib/gcp/firedata.js +0 -1
  381. package/lib/gcp/firestore.js +0 -1
  382. package/lib/gcp/iam.js +0 -1
  383. package/lib/gcp/identityPlatform.js +0 -1
  384. package/lib/gcp/index.js +0 -1
  385. package/lib/gcp/location.js +0 -1
  386. package/lib/gcp/proto.js +0 -1
  387. package/lib/gcp/pubsub.js +0 -1
  388. package/lib/gcp/resourceManager.js +0 -1
  389. package/lib/gcp/rules.js +0 -1
  390. package/lib/gcp/run.js +0 -2
  391. package/lib/gcp/runtimeconfig.js +0 -1
  392. package/lib/gcp/secretManager.js +0 -1
  393. package/lib/gcp/serviceusage.js +0 -1
  394. package/lib/gcp/storage.js +0 -1
  395. package/lib/getDefaultDatabaseInstance.js +0 -1
  396. package/lib/getDefaultHostingSite.js +0 -1
  397. package/lib/getProjectNumber.js +0 -1
  398. package/lib/handlePreviewToggles.js +2 -3
  399. package/lib/hosting/api.js +0 -1
  400. package/lib/hosting/cloudRunProxy.js +0 -1
  401. package/lib/hosting/config.js +4 -4
  402. package/lib/hosting/expireUtils.js +0 -1
  403. package/lib/hosting/functionsProxy.js +2 -4
  404. package/lib/hosting/implicitInit.js +2 -12
  405. package/lib/hosting/initMiddleware.js +0 -1
  406. package/lib/hosting/options.js +0 -1
  407. package/lib/hosting/proxy.js +0 -1
  408. package/lib/hosting/runTags.js +3 -5
  409. package/lib/index.js +0 -1
  410. package/lib/init/features/account.js +0 -1
  411. package/lib/init/features/database.js +0 -1
  412. package/lib/init/features/emulators.js +0 -1
  413. package/lib/init/features/firestore/index.js +0 -1
  414. package/lib/init/features/firestore/indexes.js +0 -1
  415. package/lib/init/features/firestore/rules.js +0 -1
  416. package/lib/init/features/functions/golang.js +0 -1
  417. package/lib/init/features/functions/index.js +0 -1
  418. package/lib/init/features/functions/javascript.js +0 -1
  419. package/lib/init/features/functions/npm-dependencies.js +0 -1
  420. package/lib/init/features/functions/typescript.js +0 -1
  421. package/lib/init/features/hosting/github.js +0 -1
  422. package/lib/init/features/hosting/index.js +0 -1
  423. package/lib/init/features/index.js +0 -1
  424. package/lib/init/features/project.js +0 -1
  425. package/lib/init/features/remoteconfig.js +0 -1
  426. package/lib/init/features/storage.js +0 -1
  427. package/lib/init/index.js +0 -1
  428. package/lib/listFiles.js +0 -1
  429. package/lib/loadCJSON.js +0 -1
  430. package/lib/localFunction.js +0 -1
  431. package/lib/logError.js +0 -1
  432. package/lib/logger.js +0 -1
  433. package/lib/management/apps.js +0 -1
  434. package/lib/management/database.js +0 -1
  435. package/lib/management/projects.js +0 -1
  436. package/lib/metaprogramming.js +0 -1
  437. package/lib/operation-poller.js +0 -1
  438. package/lib/options.js +0 -1
  439. package/lib/parseBoltRules.js +0 -1
  440. package/lib/profileReport.js +0 -1
  441. package/lib/profiler.js +0 -1
  442. package/lib/projectPath.js +0 -1
  443. package/lib/projectUtils.js +0 -1
  444. package/lib/prompt.js +0 -1
  445. package/lib/rc.js +0 -1
  446. package/lib/remoteconfig/get.js +0 -1
  447. package/lib/remoteconfig/interfaces.js +0 -1
  448. package/lib/remoteconfig/rollback.js +0 -1
  449. package/lib/remoteconfig/versionslist.js +0 -1
  450. package/lib/requireAuth.js +0 -1
  451. package/lib/requireConfig.js +0 -1
  452. package/lib/requireDatabaseInstance.js +0 -1
  453. package/lib/requireHostingSite.js +0 -1
  454. package/lib/requireInteractive.js +0 -1
  455. package/lib/requirePermissions.js +0 -1
  456. package/lib/responseToError.js +0 -1
  457. package/lib/rtdb.js +0 -1
  458. package/lib/rulesDeploy.js +0 -1
  459. package/lib/scopes.js +0 -1
  460. package/lib/serve/functions.js +8 -11
  461. package/lib/serve/hosting.js +10 -5
  462. package/lib/serve/index.js +2 -3
  463. package/lib/shortenUrl.js +0 -1
  464. package/lib/throttler/errors/retries-exhausted-error.js +0 -1
  465. package/lib/throttler/errors/task-error.js +0 -1
  466. package/lib/throttler/errors/timeout-error.js +0 -1
  467. package/lib/throttler/queue.js +0 -1
  468. package/lib/throttler/stack.js +0 -1
  469. package/lib/throttler/throttler.js +0 -1
  470. package/lib/track.js +0 -1
  471. package/lib/utils.js +14 -2
  472. package/npm-shrinkwrap.json +2 -2
  473. package/package.json +1 -1
  474. package/templates/hosting/init.js +3 -2
  475. package/lib/accountExporter.js.map +0 -1
  476. package/lib/accountImporter.js.map +0 -1
  477. package/lib/api.js.map +0 -1
  478. package/lib/apiv2.js.map +0 -1
  479. package/lib/appdistribution/client.js.map +0 -1
  480. package/lib/appdistribution/distribution.js.map +0 -1
  481. package/lib/appdistribution/options-parser-util.js.map +0 -1
  482. package/lib/archiveDirectory.js.map +0 -1
  483. package/lib/auth.js.map +0 -1
  484. package/lib/bin/firebase.js.map +0 -1
  485. package/lib/checkMinRequiredVersion.js.map +0 -1
  486. package/lib/checkValidTargetFilters.js.map +0 -1
  487. package/lib/command.js.map +0 -1
  488. package/lib/commands/appdistribution-distribute.js.map +0 -1
  489. package/lib/commands/appdistribution-testers-add.js.map +0 -1
  490. package/lib/commands/appdistribution-testers-remove.js.map +0 -1
  491. package/lib/commands/apps-android-sha-create.js.map +0 -1
  492. package/lib/commands/apps-android-sha-delete.js.map +0 -1
  493. package/lib/commands/apps-android-sha-list.js.map +0 -1
  494. package/lib/commands/apps-create.js.map +0 -1
  495. package/lib/commands/apps-list.js.map +0 -1
  496. package/lib/commands/apps-sdkconfig.js.map +0 -1
  497. package/lib/commands/auth-export.js.map +0 -1
  498. package/lib/commands/auth-import.js.map +0 -1
  499. package/lib/commands/crashlytics-mappingfile-generateid.js.map +0 -1
  500. package/lib/commands/crashlytics-mappingfile-upload.js.map +0 -1
  501. package/lib/commands/crashlytics-symbols-upload.js.map +0 -1
  502. package/lib/commands/database-get.js.map +0 -1
  503. package/lib/commands/database-instances-create.js.map +0 -1
  504. package/lib/commands/database-instances-list.js.map +0 -1
  505. package/lib/commands/database-profile.js.map +0 -1
  506. package/lib/commands/database-push.js.map +0 -1
  507. package/lib/commands/database-remove.js.map +0 -1
  508. package/lib/commands/database-rules-canary.js.map +0 -1
  509. package/lib/commands/database-rules-get.js.map +0 -1
  510. package/lib/commands/database-rules-list.js.map +0 -1
  511. package/lib/commands/database-rules-release.js.map +0 -1
  512. package/lib/commands/database-rules-stage.js.map +0 -1
  513. package/lib/commands/database-set.js.map +0 -1
  514. package/lib/commands/database-settings-get.js.map +0 -1
  515. package/lib/commands/database-settings-set.js.map +0 -1
  516. package/lib/commands/database-update.js.map +0 -1
  517. package/lib/commands/deploy.js.map +0 -1
  518. package/lib/commands/emulators-exec.js.map +0 -1
  519. package/lib/commands/emulators-export.js.map +0 -1
  520. package/lib/commands/emulators-start.js.map +0 -1
  521. package/lib/commands/experimental-functions-shell.js.map +0 -1
  522. package/lib/commands/experiments-describe.js.map +0 -1
  523. package/lib/commands/experiments-disable.js.map +0 -1
  524. package/lib/commands/experiments-enable.js.map +0 -1
  525. package/lib/commands/experiments-list.js.map +0 -1
  526. package/lib/commands/ext-configure.js.map +0 -1
  527. package/lib/commands/ext-dev-deprecate.js.map +0 -1
  528. package/lib/commands/ext-dev-emulators-exec.js.map +0 -1
  529. package/lib/commands/ext-dev-emulators-start.js.map +0 -1
  530. package/lib/commands/ext-dev-extension-delete.js.map +0 -1
  531. package/lib/commands/ext-dev-init.js.map +0 -1
  532. package/lib/commands/ext-dev-list.js.map +0 -1
  533. package/lib/commands/ext-dev-publish.js.map +0 -1
  534. package/lib/commands/ext-dev-register.js.map +0 -1
  535. package/lib/commands/ext-dev-undeprecate.js.map +0 -1
  536. package/lib/commands/ext-dev-unpublish.js.map +0 -1
  537. package/lib/commands/ext-dev-usage.js.map +0 -1
  538. package/lib/commands/ext-export.js.map +0 -1
  539. package/lib/commands/ext-info.js.map +0 -1
  540. package/lib/commands/ext-install.js.map +0 -1
  541. package/lib/commands/ext-list.js.map +0 -1
  542. package/lib/commands/ext-sources-create.js.map +0 -1
  543. package/lib/commands/ext-uninstall.js.map +0 -1
  544. package/lib/commands/ext-update.js.map +0 -1
  545. package/lib/commands/ext.js.map +0 -1
  546. package/lib/commands/firestore-delete.js.map +0 -1
  547. package/lib/commands/firestore-indexes-list.js.map +0 -1
  548. package/lib/commands/functions-config-clone.js.map +0 -1
  549. package/lib/commands/functions-config-export.js.map +0 -1
  550. package/lib/commands/functions-config-get.js.map +0 -1
  551. package/lib/commands/functions-config-set.js.map +0 -1
  552. package/lib/commands/functions-config-unset.js.map +0 -1
  553. package/lib/commands/functions-delete.js.map +0 -1
  554. package/lib/commands/functions-deletegcfartifacts.js.map +0 -1
  555. package/lib/commands/functions-list.js.map +0 -1
  556. package/lib/commands/functions-log.js.map +0 -1
  557. package/lib/commands/functions-secrets-access.js.map +0 -1
  558. package/lib/commands/functions-secrets-destroy.js.map +0 -1
  559. package/lib/commands/functions-secrets-get.js.map +0 -1
  560. package/lib/commands/functions-secrets-prune.js.map +0 -1
  561. package/lib/commands/functions-secrets-set.js.map +0 -1
  562. package/lib/commands/functions-shell.js.map +0 -1
  563. package/lib/commands/help.js.map +0 -1
  564. package/lib/commands/hosting-channel-create.js.map +0 -1
  565. package/lib/commands/hosting-channel-delete.js.map +0 -1
  566. package/lib/commands/hosting-channel-deploy.js.map +0 -1
  567. package/lib/commands/hosting-channel-list.js.map +0 -1
  568. package/lib/commands/hosting-channel-open.js.map +0 -1
  569. package/lib/commands/hosting-clone.js.map +0 -1
  570. package/lib/commands/hosting-disable.js.map +0 -1
  571. package/lib/commands/hosting-sites-create.js.map +0 -1
  572. package/lib/commands/hosting-sites-delete.js.map +0 -1
  573. package/lib/commands/hosting-sites-get.js.map +0 -1
  574. package/lib/commands/hosting-sites-list.js.map +0 -1
  575. package/lib/commands/index.js.map +0 -1
  576. package/lib/commands/init.js.map +0 -1
  577. package/lib/commands/login-add.js.map +0 -1
  578. package/lib/commands/login-ci.js.map +0 -1
  579. package/lib/commands/login-list.js.map +0 -1
  580. package/lib/commands/login-use.js.map +0 -1
  581. package/lib/commands/login.js.map +0 -1
  582. package/lib/commands/logout.js.map +0 -1
  583. package/lib/commands/open.js.map +0 -1
  584. package/lib/commands/projects-addfirebase.js.map +0 -1
  585. package/lib/commands/projects-create.js.map +0 -1
  586. package/lib/commands/projects-list.js.map +0 -1
  587. package/lib/commands/remoteconfig-get.js.map +0 -1
  588. package/lib/commands/remoteconfig-rollback.js.map +0 -1
  589. package/lib/commands/remoteconfig-versions-list.js.map +0 -1
  590. package/lib/commands/serve.js.map +0 -1
  591. package/lib/commands/setup-emulators-database.js.map +0 -1
  592. package/lib/commands/setup-emulators-firestore.js.map +0 -1
  593. package/lib/commands/setup-emulators-pubsub.js.map +0 -1
  594. package/lib/commands/setup-emulators-storage.js.map +0 -1
  595. package/lib/commands/setup-emulators-ui.js.map +0 -1
  596. package/lib/commands/target-apply.js.map +0 -1
  597. package/lib/commands/target-clear.js.map +0 -1
  598. package/lib/commands/target-remove.js.map +0 -1
  599. package/lib/commands/target.js.map +0 -1
  600. package/lib/commands/use.js.map +0 -1
  601. package/lib/config.js.map +0 -1
  602. package/lib/configstore.js.map +0 -1
  603. package/lib/crashlytics/buildToolsJarHelper.js.map +0 -1
  604. package/lib/database/api.js.map +0 -1
  605. package/lib/database/listRemote.js.map +0 -1
  606. package/lib/database/metadata.js.map +0 -1
  607. package/lib/database/remove.js.map +0 -1
  608. package/lib/database/removeRemote.js.map +0 -1
  609. package/lib/database/rulesConfig.js.map +0 -1
  610. package/lib/database/settings.js.map +0 -1
  611. package/lib/defaultCredentials.js.map +0 -1
  612. package/lib/deploy/database/deploy.js.map +0 -1
  613. package/lib/deploy/database/index.js.map +0 -1
  614. package/lib/deploy/database/prepare.js.map +0 -1
  615. package/lib/deploy/database/release.js.map +0 -1
  616. package/lib/deploy/extensions/args.js.map +0 -1
  617. package/lib/deploy/extensions/deploy.js.map +0 -1
  618. package/lib/deploy/extensions/deploymentSummary.js.map +0 -1
  619. package/lib/deploy/extensions/errors.js.map +0 -1
  620. package/lib/deploy/extensions/index.js.map +0 -1
  621. package/lib/deploy/extensions/planner.js.map +0 -1
  622. package/lib/deploy/extensions/prepare.js.map +0 -1
  623. package/lib/deploy/extensions/release.js.map +0 -1
  624. package/lib/deploy/extensions/secrets.js.map +0 -1
  625. package/lib/deploy/extensions/tasks.js.map +0 -1
  626. package/lib/deploy/extensions/validate.js.map +0 -1
  627. package/lib/deploy/firestore/deploy.js.map +0 -1
  628. package/lib/deploy/firestore/index.js.map +0 -1
  629. package/lib/deploy/firestore/prepare.js.map +0 -1
  630. package/lib/deploy/firestore/release.js.map +0 -1
  631. package/lib/deploy/functions/args.js.map +0 -1
  632. package/lib/deploy/functions/backend.js.map +0 -1
  633. package/lib/deploy/functions/build.js.map +0 -1
  634. package/lib/deploy/functions/cache/applyHash.js.map +0 -1
  635. package/lib/deploy/functions/cache/hash.js.map +0 -1
  636. package/lib/deploy/functions/cel.js.map +0 -1
  637. package/lib/deploy/functions/checkIam.js.map +0 -1
  638. package/lib/deploy/functions/containerCleaner.js.map +0 -1
  639. package/lib/deploy/functions/deploy.js.map +0 -1
  640. package/lib/deploy/functions/ensure.js.map +0 -1
  641. package/lib/deploy/functions/ensureCloudBuildEnabled.js.map +0 -1
  642. package/lib/deploy/functions/functionsDeployHelper.js.map +0 -1
  643. package/lib/deploy/functions/index.js.map +0 -1
  644. package/lib/deploy/functions/params.js.map +0 -1
  645. package/lib/deploy/functions/prepare.js.map +0 -1
  646. package/lib/deploy/functions/prepareFunctionsUpload.js.map +0 -1
  647. package/lib/deploy/functions/pricing.js.map +0 -1
  648. package/lib/deploy/functions/prompts.js.map +0 -1
  649. package/lib/deploy/functions/release/executor.js.map +0 -1
  650. package/lib/deploy/functions/release/fabricator.js.map +0 -1
  651. package/lib/deploy/functions/release/index.js.map +0 -1
  652. package/lib/deploy/functions/release/planner.js.map +0 -1
  653. package/lib/deploy/functions/release/reporter.js.map +0 -1
  654. package/lib/deploy/functions/release/sourceTokenScraper.js.map +0 -1
  655. package/lib/deploy/functions/release/timer.js.map +0 -1
  656. package/lib/deploy/functions/runtimes/discovery/index.js.map +0 -1
  657. package/lib/deploy/functions/runtimes/discovery/mockDiscoveryServer.js.map +0 -1
  658. package/lib/deploy/functions/runtimes/discovery/parsing.js.map +0 -1
  659. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js.map +0 -1
  660. package/lib/deploy/functions/runtimes/golang/gomod.js.map +0 -1
  661. package/lib/deploy/functions/runtimes/golang/index.js.map +0 -1
  662. package/lib/deploy/functions/runtimes/index.js.map +0 -1
  663. package/lib/deploy/functions/runtimes/node/extractTriggers.js.map +0 -1
  664. package/lib/deploy/functions/runtimes/node/index.js.map +0 -1
  665. package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js.map +0 -1
  666. package/lib/deploy/functions/runtimes/node/parseTriggers.js.map +0 -1
  667. package/lib/deploy/functions/runtimes/node/triggerParser.js.map +0 -1
  668. package/lib/deploy/functions/runtimes/node/validate.js.map +0 -1
  669. package/lib/deploy/functions/runtimes/node/versioning.js.map +0 -1
  670. package/lib/deploy/functions/services/auth.js.map +0 -1
  671. package/lib/deploy/functions/services/database.js.map +0 -1
  672. package/lib/deploy/functions/services/firebaseAlerts.js.map +0 -1
  673. package/lib/deploy/functions/services/index.js.map +0 -1
  674. package/lib/deploy/functions/services/remoteConfig.js.map +0 -1
  675. package/lib/deploy/functions/services/storage.js.map +0 -1
  676. package/lib/deploy/functions/services/testLab.js.map +0 -1
  677. package/lib/deploy/functions/triggerRegionHelper.js.map +0 -1
  678. package/lib/deploy/functions/validate.js.map +0 -1
  679. package/lib/deploy/hosting/args.js.map +0 -1
  680. package/lib/deploy/hosting/context.js.map +0 -1
  681. package/lib/deploy/hosting/convertConfig.js.map +0 -1
  682. package/lib/deploy/hosting/deploy.js.map +0 -1
  683. package/lib/deploy/hosting/hashcache.js.map +0 -1
  684. package/lib/deploy/hosting/index.js.map +0 -1
  685. package/lib/deploy/hosting/prepare.js.map +0 -1
  686. package/lib/deploy/hosting/release.js.map +0 -1
  687. package/lib/deploy/hosting/uploader.js.map +0 -1
  688. package/lib/deploy/index.js.map +0 -1
  689. package/lib/deploy/lifecycleHooks.js.map +0 -1
  690. package/lib/deploy/remoteconfig/deploy.js.map +0 -1
  691. package/lib/deploy/remoteconfig/functions.js.map +0 -1
  692. package/lib/deploy/remoteconfig/index.js.map +0 -1
  693. package/lib/deploy/remoteconfig/prepare.js.map +0 -1
  694. package/lib/deploy/remoteconfig/release.js.map +0 -1
  695. package/lib/deploy/storage/deploy.js.map +0 -1
  696. package/lib/deploy/storage/index.js.map +0 -1
  697. package/lib/deploy/storage/prepare.js.map +0 -1
  698. package/lib/deploy/storage/release.js.map +0 -1
  699. package/lib/deploymentTool.js.map +0 -1
  700. package/lib/detectProjectRoot.js.map +0 -1
  701. package/lib/downloadUtils.js.map +0 -1
  702. package/lib/emulator/adminSdkConfig.js.map +0 -1
  703. package/lib/emulator/auth/apiSpec.js.map +0 -1
  704. package/lib/emulator/auth/cloudFunctions.js.map +0 -1
  705. package/lib/emulator/auth/errors.js.map +0 -1
  706. package/lib/emulator/auth/handlers.js.map +0 -1
  707. package/lib/emulator/auth/index.js.map +0 -1
  708. package/lib/emulator/auth/operations.js.map +0 -1
  709. package/lib/emulator/auth/schema.js.map +0 -1
  710. package/lib/emulator/auth/server.js.map +0 -1
  711. package/lib/emulator/auth/state.js.map +0 -1
  712. package/lib/emulator/auth/types.js.map +0 -1
  713. package/lib/emulator/auth/utils.js.map +0 -1
  714. package/lib/emulator/auth/widget_ui.js.map +0 -1
  715. package/lib/emulator/commandUtils.js.map +0 -1
  716. package/lib/emulator/constants.js.map +0 -1
  717. package/lib/emulator/controller.js.map +0 -1
  718. package/lib/emulator/databaseEmulator.js.map +0 -1
  719. package/lib/emulator/download.js.map +0 -1
  720. package/lib/emulator/downloadableEmulators.js.map +0 -1
  721. package/lib/emulator/emulatorLogger.js.map +0 -1
  722. package/lib/emulator/emulatorServer.js +0 -30
  723. package/lib/emulator/emulatorServer.js.map +0 -1
  724. package/lib/emulator/eventarcEmulator.js.map +0 -1
  725. package/lib/emulator/events/types.js.map +0 -1
  726. package/lib/emulator/extensions/postinstall.js.map +0 -1
  727. package/lib/emulator/extensions/validation.js.map +0 -1
  728. package/lib/emulator/extensionsEmulator.js.map +0 -1
  729. package/lib/emulator/firestoreEmulator.js.map +0 -1
  730. package/lib/emulator/functionsEmulator.js.map +0 -1
  731. package/lib/emulator/functionsEmulatorRuntime.js.map +0 -1
  732. package/lib/emulator/functionsEmulatorShared.js.map +0 -1
  733. package/lib/emulator/functionsEmulatorShell.js.map +0 -1
  734. package/lib/emulator/functionsEmulatorUtils.js.map +0 -1
  735. package/lib/emulator/functionsRuntimeWorker.js.map +0 -1
  736. package/lib/emulator/hostingEmulator.js.map +0 -1
  737. package/lib/emulator/hub.js.map +0 -1
  738. package/lib/emulator/hubClient.js.map +0 -1
  739. package/lib/emulator/hubExport.js.map +0 -1
  740. package/lib/emulator/loggingEmulator.js.map +0 -1
  741. package/lib/emulator/portUtils.js.map +0 -1
  742. package/lib/emulator/pubsubEmulator.js.map +0 -1
  743. package/lib/emulator/registry.js.map +0 -1
  744. package/lib/emulator/shared/request.js.map +0 -1
  745. package/lib/emulator/storage/apis/firebase.js.map +0 -1
  746. package/lib/emulator/storage/apis/gcloud.js.map +0 -1
  747. package/lib/emulator/storage/cloudFunctions.js.map +0 -1
  748. package/lib/emulator/storage/crc.js.map +0 -1
  749. package/lib/emulator/storage/errors.js.map +0 -1
  750. package/lib/emulator/storage/files.js.map +0 -1
  751. package/lib/emulator/storage/index.js.map +0 -1
  752. package/lib/emulator/storage/metadata.js.map +0 -1
  753. package/lib/emulator/storage/multipart.js.map +0 -1
  754. package/lib/emulator/storage/persistence.js.map +0 -1
  755. package/lib/emulator/storage/rules/config.js.map +0 -1
  756. package/lib/emulator/storage/rules/expressionValue.js.map +0 -1
  757. package/lib/emulator/storage/rules/manager.js.map +0 -1
  758. package/lib/emulator/storage/rules/runtime.js.map +0 -1
  759. package/lib/emulator/storage/rules/types.js.map +0 -1
  760. package/lib/emulator/storage/rules/utils.js.map +0 -1
  761. package/lib/emulator/storage/server.js.map +0 -1
  762. package/lib/emulator/storage/upload.js.map +0 -1
  763. package/lib/emulator/types.js.map +0 -1
  764. package/lib/emulator/ui.js.map +0 -1
  765. package/lib/emulator/workQueue.js.map +0 -1
  766. package/lib/ensureApiEnabled.js.map +0 -1
  767. package/lib/ensureCloudResourceLocation.js.map +0 -1
  768. package/lib/error.js.map +0 -1
  769. package/lib/errorOut.js.map +0 -1
  770. package/lib/experiments.js.map +0 -1
  771. package/lib/extensions/askUserForConsent.js.map +0 -1
  772. package/lib/extensions/askUserForEventsConfig.js.map +0 -1
  773. package/lib/extensions/askUserForParam.js.map +0 -1
  774. package/lib/extensions/billingMigrationHelper.js.map +0 -1
  775. package/lib/extensions/change-log.js.map +0 -1
  776. package/lib/extensions/checkProjectBilling.js.map +0 -1
  777. package/lib/extensions/diagnose.js.map +0 -1
  778. package/lib/extensions/displayExtensionInfo.js.map +0 -1
  779. package/lib/extensions/emulator/optionsHelper.js.map +0 -1
  780. package/lib/extensions/emulator/specHelper.js.map +0 -1
  781. package/lib/extensions/emulator/triggerHelper.js.map +0 -1
  782. package/lib/extensions/etags.js.map +0 -1
  783. package/lib/extensions/export.js.map +0 -1
  784. package/lib/extensions/extensionsApi.js.map +0 -1
  785. package/lib/extensions/extensionsHelper.js.map +0 -1
  786. package/lib/extensions/listExtensions.js.map +0 -1
  787. package/lib/extensions/localHelper.js.map +0 -1
  788. package/lib/extensions/manifest.js.map +0 -1
  789. package/lib/extensions/metricsTypeDef.js.map +0 -1
  790. package/lib/extensions/metricsUtils.js.map +0 -1
  791. package/lib/extensions/paramHelper.js.map +0 -1
  792. package/lib/extensions/provisioningHelper.js.map +0 -1
  793. package/lib/extensions/publishHelpers.js.map +0 -1
  794. package/lib/extensions/refs.js.map +0 -1
  795. package/lib/extensions/resolveSource.js.map +0 -1
  796. package/lib/extensions/secretsUtils.js.map +0 -1
  797. package/lib/extensions/types.js.map +0 -1
  798. package/lib/extensions/updateHelper.js.map +0 -1
  799. package/lib/extensions/utils.js.map +0 -1
  800. package/lib/extensions/versionHelper.js.map +0 -1
  801. package/lib/extensions/warnings.js.map +0 -1
  802. package/lib/fetchMOTD.js.map +0 -1
  803. package/lib/fetchWebSetup.js.map +0 -1
  804. package/lib/filterTargets.js.map +0 -1
  805. package/lib/firebaseConfig.js.map +0 -1
  806. package/lib/firebaseConfigValidate.js.map +0 -1
  807. package/lib/firestore/checkDatabaseType.js.map +0 -1
  808. package/lib/firestore/delete.js.map +0 -1
  809. package/lib/firestore/encodeFirestoreValue.js.map +0 -1
  810. package/lib/firestore/indexes-api.js.map +0 -1
  811. package/lib/firestore/indexes-sort.js.map +0 -1
  812. package/lib/firestore/indexes-spec.js.map +0 -1
  813. package/lib/firestore/indexes.js.map +0 -1
  814. package/lib/firestore/util.js.map +0 -1
  815. package/lib/firestore/validator.js.map +0 -1
  816. package/lib/frameworks/angular/index.js.map +0 -1
  817. package/lib/frameworks/express/index.js.map +0 -1
  818. package/lib/frameworks/index.js.map +0 -1
  819. package/lib/frameworks/lit/index.js.map +0 -1
  820. package/lib/frameworks/next/index.js.map +0 -1
  821. package/lib/frameworks/nuxt/index.js.map +0 -1
  822. package/lib/frameworks/preact/index.js.map +0 -1
  823. package/lib/frameworks/react/index.js.map +0 -1
  824. package/lib/frameworks/svelte/index.js.map +0 -1
  825. package/lib/frameworks/vite/index.js.map +0 -1
  826. package/lib/fsAsync.js.map +0 -1
  827. package/lib/fsutils.js.map +0 -1
  828. package/lib/functional.js.map +0 -1
  829. package/lib/functions/constants.js.map +0 -1
  830. package/lib/functions/env.js.map +0 -1
  831. package/lib/functions/events/index.js.map +0 -1
  832. package/lib/functions/events/v1.js.map +0 -1
  833. package/lib/functions/events/v2.js.map +0 -1
  834. package/lib/functions/functionslog.js.map +0 -1
  835. package/lib/functions/projectConfig.js.map +0 -1
  836. package/lib/functions/runtimeConfigExport.js.map +0 -1
  837. package/lib/functions/secrets.js.map +0 -1
  838. package/lib/functionsConfig.js.map +0 -1
  839. package/lib/functionsConfigClone.js.map +0 -1
  840. package/lib/functionsShellCommandAction.js.map +0 -1
  841. package/lib/gcp/artifactregistry.js.map +0 -1
  842. package/lib/gcp/auth.js.map +0 -1
  843. package/lib/gcp/cloudbilling.js.map +0 -1
  844. package/lib/gcp/cloudfunctions.js.map +0 -1
  845. package/lib/gcp/cloudfunctionsv2.js.map +0 -1
  846. package/lib/gcp/cloudlogging.js.map +0 -1
  847. package/lib/gcp/cloudmonitoring.js.map +0 -1
  848. package/lib/gcp/cloudscheduler.js.map +0 -1
  849. package/lib/gcp/cloudtasks.js.map +0 -1
  850. package/lib/gcp/docker.js.map +0 -1
  851. package/lib/gcp/firedata.js.map +0 -1
  852. package/lib/gcp/firestore.js.map +0 -1
  853. package/lib/gcp/iam.js.map +0 -1
  854. package/lib/gcp/identityPlatform.js.map +0 -1
  855. package/lib/gcp/index.js.map +0 -1
  856. package/lib/gcp/location.js.map +0 -1
  857. package/lib/gcp/proto.js.map +0 -1
  858. package/lib/gcp/pubsub.js.map +0 -1
  859. package/lib/gcp/resourceManager.js.map +0 -1
  860. package/lib/gcp/rules.js.map +0 -1
  861. package/lib/gcp/run.js.map +0 -1
  862. package/lib/gcp/runtimeconfig.js.map +0 -1
  863. package/lib/gcp/secretManager.js.map +0 -1
  864. package/lib/gcp/serviceusage.js.map +0 -1
  865. package/lib/gcp/storage.js.map +0 -1
  866. package/lib/getDefaultDatabaseInstance.js.map +0 -1
  867. package/lib/getDefaultHostingSite.js.map +0 -1
  868. package/lib/getProjectNumber.js.map +0 -1
  869. package/lib/handlePreviewToggles.js.map +0 -1
  870. package/lib/hosting/api.js.map +0 -1
  871. package/lib/hosting/cloudRunProxy.js.map +0 -1
  872. package/lib/hosting/config.js.map +0 -1
  873. package/lib/hosting/expireUtils.js.map +0 -1
  874. package/lib/hosting/functionsProxy.js.map +0 -1
  875. package/lib/hosting/implicitInit.js.map +0 -1
  876. package/lib/hosting/initMiddleware.js.map +0 -1
  877. package/lib/hosting/options.js.map +0 -1
  878. package/lib/hosting/proxy.js.map +0 -1
  879. package/lib/hosting/runTags.js.map +0 -1
  880. package/lib/index.js.map +0 -1
  881. package/lib/init/features/account.js.map +0 -1
  882. package/lib/init/features/database.js.map +0 -1
  883. package/lib/init/features/emulators.js.map +0 -1
  884. package/lib/init/features/firestore/index.js.map +0 -1
  885. package/lib/init/features/firestore/indexes.js.map +0 -1
  886. package/lib/init/features/firestore/rules.js.map +0 -1
  887. package/lib/init/features/functions/golang.js.map +0 -1
  888. package/lib/init/features/functions/index.js.map +0 -1
  889. package/lib/init/features/functions/javascript.js.map +0 -1
  890. package/lib/init/features/functions/npm-dependencies.js.map +0 -1
  891. package/lib/init/features/functions/typescript.js.map +0 -1
  892. package/lib/init/features/hosting/github.js.map +0 -1
  893. package/lib/init/features/hosting/index.js.map +0 -1
  894. package/lib/init/features/index.js.map +0 -1
  895. package/lib/init/features/project.js.map +0 -1
  896. package/lib/init/features/remoteconfig.js.map +0 -1
  897. package/lib/init/features/storage.js.map +0 -1
  898. package/lib/init/index.js.map +0 -1
  899. package/lib/listFiles.js.map +0 -1
  900. package/lib/loadCJSON.js.map +0 -1
  901. package/lib/localFunction.js.map +0 -1
  902. package/lib/logError.js.map +0 -1
  903. package/lib/logger.js.map +0 -1
  904. package/lib/management/apps.js.map +0 -1
  905. package/lib/management/database.js.map +0 -1
  906. package/lib/management/projects.js.map +0 -1
  907. package/lib/metaprogramming.js.map +0 -1
  908. package/lib/operation-poller.js.map +0 -1
  909. package/lib/options.js.map +0 -1
  910. package/lib/parseBoltRules.js.map +0 -1
  911. package/lib/profileReport.js.map +0 -1
  912. package/lib/profiler.js.map +0 -1
  913. package/lib/projectPath.js.map +0 -1
  914. package/lib/projectUtils.js.map +0 -1
  915. package/lib/prompt.js.map +0 -1
  916. package/lib/rc.js.map +0 -1
  917. package/lib/remoteconfig/get.js.map +0 -1
  918. package/lib/remoteconfig/interfaces.js.map +0 -1
  919. package/lib/remoteconfig/rollback.js.map +0 -1
  920. package/lib/remoteconfig/versionslist.js.map +0 -1
  921. package/lib/requireAuth.js.map +0 -1
  922. package/lib/requireConfig.js.map +0 -1
  923. package/lib/requireDatabaseInstance.js.map +0 -1
  924. package/lib/requireHostingSite.js.map +0 -1
  925. package/lib/requireInteractive.js.map +0 -1
  926. package/lib/requirePermissions.js.map +0 -1
  927. package/lib/responseToError.js.map +0 -1
  928. package/lib/rtdb.js.map +0 -1
  929. package/lib/rulesDeploy.js.map +0 -1
  930. package/lib/scopes.js.map +0 -1
  931. package/lib/serve/functions.js.map +0 -1
  932. package/lib/serve/hosting.js.map +0 -1
  933. package/lib/serve/index.js.map +0 -1
  934. package/lib/shortenUrl.js.map +0 -1
  935. package/lib/throttler/errors/retries-exhausted-error.js.map +0 -1
  936. package/lib/throttler/errors/task-error.js.map +0 -1
  937. package/lib/throttler/errors/timeout-error.js.map +0 -1
  938. package/lib/throttler/queue.js.map +0 -1
  939. package/lib/throttler/stack.js.map +0 -1
  940. package/lib/throttler/throttler.js.map +0 -1
  941. package/lib/track.js.map +0 -1
  942. package/lib/utils.js.map +0 -1
@@ -12,23 +12,37 @@ class EmulatorHubClient {
12
12
  foundHub() {
13
13
  return this.locator !== undefined;
14
14
  }
15
- async getStatus() {
16
- const apiClient = new apiv2_1.Client({ urlPrefix: this.origin, auth: false });
17
- await apiClient.get("/");
15
+ getStatus() {
16
+ return this.tryOrigins(async (client, origin) => {
17
+ await client.get("/");
18
+ return origin;
19
+ });
20
+ }
21
+ async tryOrigins(task) {
22
+ const origins = this.assertLocator().origins;
23
+ let err = undefined;
24
+ for (const origin of origins) {
25
+ try {
26
+ const apiClient = new apiv2_1.Client({ urlPrefix: origin, auth: false });
27
+ return await task(apiClient, origin);
28
+ }
29
+ catch (e) {
30
+ if (!err) {
31
+ err = e;
32
+ }
33
+ }
34
+ }
35
+ throw err !== null && err !== void 0 ? err : new Error("Cannot find working hub origin. Tried:" + origins.join(" "));
18
36
  }
19
37
  async getEmulators() {
20
- const apiClient = new apiv2_1.Client({ urlPrefix: this.origin, auth: false });
21
- const res = await apiClient.get(hub_1.EmulatorHub.PATH_EMULATORS);
38
+ const res = await this.tryOrigins((client) => client.get(hub_1.EmulatorHub.PATH_EMULATORS));
22
39
  return res.body;
23
40
  }
24
41
  async postExport(options) {
25
- const apiClient = new apiv2_1.Client({ urlPrefix: this.origin, auth: false });
42
+ const origin = await this.getStatus();
43
+ const apiClient = new apiv2_1.Client({ urlPrefix: origin, auth: false });
26
44
  await apiClient.post(hub_1.EmulatorHub.PATH_EXPORT, options);
27
45
  }
28
- get origin() {
29
- const locator = this.assertLocator();
30
- return `http://${locator.host}:${locator.port}`;
31
- }
32
46
  assertLocator() {
33
47
  if (this.locator === undefined) {
34
48
  throw new error_1.FirebaseError(`Cannot contact the Emulator Hub for project ${this.projectId}`);
@@ -37,4 +51,3 @@ class EmulatorHubClient {
37
51
  }
38
52
  }
39
53
  exports.EmulatorHubClient = EmulatorHubClient;
40
- //# sourceMappingURL=hubClient.js.map
@@ -12,7 +12,6 @@ const error_1 = require("../error");
12
12
  const hub_1 = require("./hub");
13
13
  const downloadableEmulators_1 = require("./downloadableEmulators");
14
14
  const rimraf = require("rimraf");
15
- const apiv2_1 = require("../apiv2");
16
15
  const track_1 = require("../track");
17
16
  class HubExport {
18
17
  constructor(projectId, options) {
@@ -83,20 +82,16 @@ class HubExport {
83
82
  initiated_by: this.options.initiatedBy,
84
83
  emulator_name: types_1.Emulators.FIRESTORE,
85
84
  });
86
- const firestoreInfo = registry_1.EmulatorRegistry.get(types_1.Emulators.FIRESTORE).getInfo();
87
- const firestoreHost = `http://${registry_1.EmulatorRegistry.getInfoHostString(firestoreInfo)}`;
88
85
  const firestoreExportBody = {
89
86
  database: `projects/${this.projectId}/databases/(default)`,
90
87
  export_directory: this.tmpDir,
91
88
  export_name: metadata.firestore.path,
92
89
  };
93
- const client = new apiv2_1.Client({ urlPrefix: firestoreHost, auth: false });
94
- await client.post(`/emulator/v1/projects/${this.projectId}:export`, firestoreExportBody);
90
+ await registry_1.EmulatorRegistry.client(types_1.Emulators.FIRESTORE).post(`/emulator/v1/projects/${this.projectId}:export`, firestoreExportBody);
95
91
  }
96
92
  async exportDatabase(metadata) {
97
93
  const databaseEmulator = registry_1.EmulatorRegistry.get(types_1.Emulators.DATABASE);
98
- const databaseAddr = `http://${registry_1.EmulatorRegistry.getInfoHostString(databaseEmulator.getInfo())}`;
99
- const client = new apiv2_1.Client({ urlPrefix: databaseAddr, auth: true });
94
+ const client = registry_1.EmulatorRegistry.client(types_1.Emulators.DATABASE, { auth: true });
100
95
  const inspectURL = `/.inspect/databases.json`;
101
96
  const inspectRes = await client.get(inspectURL, {
102
97
  queryParams: { ns: this.projectId },
@@ -174,19 +169,16 @@ class HubExport {
174
169
  }, configFile);
175
170
  }
176
171
  async exportStorage(metadata) {
177
- const storageEmulator = registry_1.EmulatorRegistry.get(types_1.Emulators.STORAGE);
178
172
  const storageExportPath = path.join(this.tmpDir, metadata.storage.path);
179
173
  if (fs.existsSync(storageExportPath)) {
180
174
  fse.removeSync(storageExportPath);
181
175
  }
182
176
  fs.mkdirSync(storageExportPath, { recursive: true });
183
- const storageHost = `http://${registry_1.EmulatorRegistry.getInfoHostString(storageEmulator.getInfo())}`;
184
177
  const storageExportBody = {
185
178
  path: storageExportPath,
186
179
  initiatedBy: this.options.initiatedBy,
187
180
  };
188
- const client = new apiv2_1.Client({ urlPrefix: storageHost, auth: false });
189
- const res = await client.request({
181
+ const res = await registry_1.EmulatorRegistry.client(types_1.Emulators.STORAGE).request({
190
182
  method: "POST",
191
183
  path: "/internal/export",
192
184
  headers: { "Content-Type": "application/json" },
@@ -214,4 +206,3 @@ function fetchToFile(options, path) {
214
206
  function shouldExport(e) {
215
207
  return types_1.IMPORT_EXPORT_EMULATORS.includes(e) && registry_1.EmulatorRegistry.isRunning(e);
216
208
  }
217
- //# sourceMappingURL=hubExport.js.map
@@ -116,4 +116,3 @@ class WebSocketTransport extends TransportStream {
116
116
  }
117
117
  }
118
118
  }
119
- //# sourceMappingURL=loggingEmulator.js.map
@@ -1,13 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitForPortClosed = exports.checkPortOpen = exports.findAvailablePort = exports.suggestUnrestricted = exports.isRestricted = void 0;
4
- const pf = require("portfinder");
3
+ exports.resolveHostAndAssignPorts = exports.waitForPortClosed = exports.checkListenable = void 0;
4
+ const clc = require("colorette");
5
5
  const tcpport = require("tcp-port-used");
6
- const dns = require("dns");
6
+ const node_net_1 = require("node:net");
7
7
  const error_1 = require("../error");
8
- const logger_1 = require("../logger");
9
- dns.setDefaultResultOrder("ipv4first");
10
- const RESTRICTED_PORTS = [
8
+ const utils = require("../utils");
9
+ const dns_1 = require("./dns");
10
+ const types_1 = require("./types");
11
+ const constants_1 = require("./constants");
12
+ const emulatorLogger_1 = require("./emulatorLogger");
13
+ const RESTRICTED_PORTS = new Set([
11
14
  1,
12
15
  7,
13
16
  9,
@@ -75,11 +78,10 @@ const RESTRICTED_PORTS = [
75
78
  6668,
76
79
  6669,
77
80
  6697,
78
- ];
81
+ ]);
79
82
  function isRestricted(port) {
80
- return RESTRICTED_PORTS.includes(port);
83
+ return RESTRICTED_PORTS.has(port);
81
84
  }
82
- exports.isRestricted = isRestricted;
83
85
  function suggestUnrestricted(port) {
84
86
  if (!isRestricted(port)) {
85
87
  return port;
@@ -90,27 +92,37 @@ function suggestUnrestricted(port) {
90
92
  }
91
93
  return newPort;
92
94
  }
93
- exports.suggestUnrestricted = suggestUnrestricted;
94
- async function findAvailablePort(host, start, avoidRestricted = true) {
95
- const openPort = await pf.getPortPromise({ host, port: start });
96
- if (avoidRestricted && isRestricted(openPort)) {
97
- logger_1.logger.debug(`portUtils: skipping restricted port ${openPort}`);
98
- return findAvailablePort(host, suggestUnrestricted(openPort), avoidRestricted);
99
- }
100
- return openPort;
101
- }
102
- exports.findAvailablePort = findAvailablePort;
103
- async function checkPortOpen(port, host) {
104
- try {
105
- const inUse = await tcpport.check(port, host);
106
- return !inUse;
107
- }
108
- catch (e) {
109
- logger_1.logger.debug(`port check error: ${e}`);
110
- return false;
111
- }
95
+ async function checkListenable(arg1, port) {
96
+ const addr = port === undefined ? arg1 : listenSpec(arg1, port);
97
+ return new Promise((resolve, reject) => {
98
+ const dummyServer = (0, node_net_1.createServer)(() => {
99
+ });
100
+ dummyServer.once("error", (err) => {
101
+ dummyServer.removeAllListeners();
102
+ const e = err;
103
+ if (e.code === "EADDRINUSE" || e.code === "EACCES") {
104
+ resolve(false);
105
+ }
106
+ else {
107
+ reject(e);
108
+ }
109
+ });
110
+ dummyServer.once("listening", () => {
111
+ dummyServer.removeAllListeners();
112
+ dummyServer.close((err) => {
113
+ dummyServer.removeAllListeners();
114
+ if (err) {
115
+ reject(err);
116
+ }
117
+ else {
118
+ resolve(true);
119
+ }
120
+ });
121
+ });
122
+ dummyServer.listen({ host: addr.address, port: addr.port, ipv6Only: addr.family === "IPv6" });
123
+ });
112
124
  }
113
- exports.checkPortOpen = checkPortOpen;
125
+ exports.checkListenable = checkListenable;
114
126
  async function waitForPortClosed(port, host) {
115
127
  const interval = 250;
116
128
  const timeout = 60000;
@@ -122,4 +134,170 @@ async function waitForPortClosed(port, host) {
122
134
  }
123
135
  }
124
136
  exports.waitForPortClosed = waitForPortClosed;
125
- //# sourceMappingURL=portUtils.js.map
137
+ const EMULATOR_CAN_LISTEN_ON_PRIMARY_ONLY = {
138
+ database: true,
139
+ firestore: true,
140
+ "firestore.websocket": true,
141
+ pubsub: true,
142
+ hub: false,
143
+ ui: false,
144
+ auth: true,
145
+ eventarc: true,
146
+ extensions: true,
147
+ functions: true,
148
+ logging: true,
149
+ storage: true,
150
+ hosting: true,
151
+ };
152
+ const MAX_PORT = 65535;
153
+ async function resolveHostAndAssignPorts(listenConfig) {
154
+ const lookupForHost = new Map();
155
+ const takenPorts = new Map();
156
+ const result = {};
157
+ const tasks = [];
158
+ for (const name of Object.keys(listenConfig)) {
159
+ const config = listenConfig[name];
160
+ if (!config) {
161
+ continue;
162
+ }
163
+ else if (config instanceof Array) {
164
+ result[name] = config;
165
+ for (const { port } of config) {
166
+ takenPorts.set(port, name);
167
+ }
168
+ continue;
169
+ }
170
+ const { host, port, portFixed } = config;
171
+ let lookup = lookupForHost.get(host);
172
+ if (!lookup) {
173
+ lookup = dns_1.Resolver.DEFAULT.lookupAll(host);
174
+ lookupForHost.set(host, lookup);
175
+ }
176
+ const findAddrs = lookup.then(async (addrs) => {
177
+ const emuLogger = emulatorLogger_1.EmulatorLogger.forEmulator(name === "firestore.websocket" ? types_1.Emulators.FIRESTORE : name);
178
+ if (addrs.some((addr) => addr.address === dns_1.IPV6_UNSPECIFIED.address)) {
179
+ if (!addrs.some((addr) => addr.address === dns_1.IPV4_UNSPECIFIED.address)) {
180
+ emuLogger.logLabeled("DEBUG", name, `testing listening on IPv4 wildcard in addition to IPv6. To listen on IPv6 only, use "::0" instead.`);
181
+ addrs.push(dns_1.IPV4_UNSPECIFIED);
182
+ }
183
+ }
184
+ for (let p = port; p <= MAX_PORT; p++) {
185
+ if (takenPorts.has(p)) {
186
+ continue;
187
+ }
188
+ if (!portFixed && RESTRICTED_PORTS.has(p)) {
189
+ emuLogger.logLabeled("DEBUG", name, `portUtils: skipping restricted port ${p}`);
190
+ continue;
191
+ }
192
+ const available = [];
193
+ const unavailable = [];
194
+ let i;
195
+ for (i = 0; i < addrs.length; i++) {
196
+ const addr = addrs[i];
197
+ const listen = listenSpec(addr, p);
198
+ if (await checkListenable(listen)) {
199
+ available.push(listen);
200
+ }
201
+ else {
202
+ if (!portFixed) {
203
+ if (i > 0) {
204
+ emuLogger.logLabeled("DEBUG", name, `Port ${p} taken on secondary address ${addr.address}, will keep searching to find a better port.`);
205
+ }
206
+ break;
207
+ }
208
+ unavailable.push(addr.address);
209
+ }
210
+ }
211
+ if (i === addrs.length) {
212
+ if (unavailable.length > 0) {
213
+ if (unavailable[0] === addrs[0].address) {
214
+ return fixedPortNotAvailable(name, host, port, emuLogger, unavailable);
215
+ }
216
+ warnPartiallyAvailablePort(emuLogger, port, available, unavailable);
217
+ }
218
+ if (takenPorts.has(p)) {
219
+ continue;
220
+ }
221
+ takenPorts.set(p, name);
222
+ if (RESTRICTED_PORTS.has(p)) {
223
+ const suggested = suggestUnrestricted(port);
224
+ emuLogger.logLabeled("WARN", name, `Port ${port} is restricted by some web browsers, including Chrome. You may want to choose a different port such as ${suggested}.`);
225
+ }
226
+ if (p !== port && name !== "firestore.websocket") {
227
+ emuLogger.logLabeled("WARN", `${portDescription(name)} unable to start on port ${port}, starting on ${p} instead.`);
228
+ }
229
+ if (available.length > 1 && EMULATOR_CAN_LISTEN_ON_PRIMARY_ONLY[name]) {
230
+ emuLogger.logLabeled("DEBUG", name, `${portDescription(name)} only supports listening on one address (${available[0].address}). Not listening on ${addrs
231
+ .slice(1)
232
+ .map((s) => s.address)
233
+ .join(",")}`);
234
+ result[name] = [available[0]];
235
+ }
236
+ else {
237
+ result[name] = available;
238
+ }
239
+ return;
240
+ }
241
+ }
242
+ return utils.reject(`Could not find any open port in ${port}-${MAX_PORT} for ${portDescription(name)}`, {});
243
+ });
244
+ tasks.push(findAddrs);
245
+ }
246
+ await Promise.all(tasks);
247
+ return result;
248
+ }
249
+ exports.resolveHostAndAssignPorts = resolveHostAndAssignPorts;
250
+ function portDescription(name) {
251
+ return name === "firestore.websocket"
252
+ ? `websocket server for ${types_1.Emulators.FIRESTORE}`
253
+ : constants_1.Constants.description(name);
254
+ }
255
+ function warnPartiallyAvailablePort(emuLogger, port, available, unavailable) {
256
+ emuLogger.logLabeled("WARN", `Port ${port} is available on ` +
257
+ available.map((s) => s.address).join(",") +
258
+ ` but not ${unavailable.join(",")}. This may cause issues with some clients.`);
259
+ emuLogger.logLabeled("WARN", `If you encounter connectivity issues, consider switching to a different port or explicitly specifying ${clc.yellow('"host": "<ip address>"')} instead of hostname in firebase.json`);
260
+ }
261
+ function fixedPortNotAvailable(name, host, port, emuLogger, unavailableAddrs) {
262
+ if (unavailableAddrs.length !== 1 || unavailableAddrs[0] !== host) {
263
+ host = `${host} (${unavailableAddrs.join(",")})`;
264
+ }
265
+ const description = portDescription(name);
266
+ emuLogger.logLabeled("WARN", `Port ${port} is not open on ${host}, could not start ${description}.`);
267
+ if (name === "firestore.websocket") {
268
+ emuLogger.logLabeled("WARN", `To select a different port, specify that port in a firebase.json config file:
269
+ {
270
+ // ...
271
+ "emulators": {
272
+ "${types_1.Emulators.FIRESTORE}": {
273
+ "host": "${clc.yellow("HOST")}",
274
+ ...
275
+ "websocketPort": "${clc.yellow("WEBSOCKET_PORT")}"
276
+ }
277
+ }
278
+ }`);
279
+ }
280
+ else {
281
+ emuLogger.logLabeled("WARN", `To select a different host/port, specify that host/port in a firebase.json config file:
282
+ {
283
+ // ...
284
+ "emulators": {
285
+ "${emuLogger.name}": {
286
+ "host": "${clc.yellow("HOST")}",
287
+ "port": "${clc.yellow("PORT")}"
288
+ }
289
+ }
290
+ }`);
291
+ }
292
+ return utils.reject(`Could not start ${description}, port taken.`, {});
293
+ }
294
+ function listenSpec(lookup, port) {
295
+ if (lookup.family !== 4 && lookup.family !== 6) {
296
+ throw new Error(`Unsupported address family "${lookup.family}" for address ${lookup.address}.`);
297
+ }
298
+ return {
299
+ address: lookup.address,
300
+ family: lookup.family === 4 ? "IPv4" : "IPv6",
301
+ port: port,
302
+ };
303
+ }
@@ -4,7 +4,6 @@ exports.PubsubEmulator = void 0;
4
4
  const uuid = require("uuid");
5
5
  const pubsub_1 = require("@google-cloud/pubsub");
6
6
  const downloadableEmulators = require("./downloadableEmulators");
7
- const apiv2_1 = require("../apiv2");
8
7
  const emulatorLogger_1 = require("./emulatorLogger");
9
8
  const types_1 = require("../emulator/types");
10
9
  const constants_1 = require("./constants");
@@ -14,14 +13,18 @@ class PubsubEmulator {
14
13
  constructor(args) {
15
14
  this.args = args;
16
15
  this.logger = emulatorLogger_1.EmulatorLogger.forEmulator(types_1.Emulators.PUBSUB);
17
- const { host, port } = this.getInfo();
18
- this.pubsub = new pubsub_1.PubSub({
19
- apiEndpoint: `${host}:${port}`,
20
- projectId: this.args.projectId,
21
- });
22
16
  this.triggersForTopic = new Map();
23
17
  this.subscriptionForTopic = new Map();
24
18
  }
19
+ get pubsub() {
20
+ if (!this._pubsub) {
21
+ this._pubsub = new pubsub_1.PubSub({
22
+ apiEndpoint: registry_1.EmulatorRegistry.url(types_1.Emulators.PUBSUB).host,
23
+ projectId: this.args.projectId,
24
+ });
25
+ }
26
+ return this._pubsub;
27
+ }
25
28
  async start() {
26
29
  return downloadableEmulators.start(types_1.Emulators.PUBSUB, this.args);
27
30
  }
@@ -94,14 +97,10 @@ class PubsubEmulator {
94
97
  ensureFunctionsClient() {
95
98
  if (this.client !== undefined)
96
99
  return;
97
- const funcEmulator = registry_1.EmulatorRegistry.get(types_1.Emulators.FUNCTIONS);
98
- if (!funcEmulator) {
100
+ if (!registry_1.EmulatorRegistry.isRunning(types_1.Emulators.FUNCTIONS)) {
99
101
  throw new error_1.FirebaseError(`Attempted to execute pubsub trigger but could not find the Functions emulator`);
100
102
  }
101
- this.client = new apiv2_1.Client({
102
- urlPrefix: `http://${registry_1.EmulatorRegistry.getInfoHostString(funcEmulator.getInfo())}`,
103
- auth: false,
104
- });
103
+ this.client = registry_1.EmulatorRegistry.client(types_1.Emulators.FUNCTIONS);
105
104
  }
106
105
  createLegacyEventRequestBody(topic, message) {
107
106
  return {
@@ -170,4 +169,3 @@ class PubsubEmulator {
170
169
  }
171
170
  }
172
171
  exports.PubsubEmulator = PubsubEmulator;
173
- //# sourceMappingURL=pubsubEmulator.js.map
@@ -6,6 +6,8 @@ const error_1 = require("../error");
6
6
  const portUtils = require("./portUtils");
7
7
  const constants_1 = require("./constants");
8
8
  const emulatorLogger_1 = require("./emulatorLogger");
9
+ const utils_1 = require("../utils");
10
+ const apiv2_1 = require("../apiv2");
9
11
  class EmulatorRegistry {
10
12
  static async start(instance) {
11
13
  const description = constants_1.Constants.description(instance.getName());
@@ -16,7 +18,7 @@ class EmulatorRegistry {
16
18
  await instance.start();
17
19
  if (instance.getName() !== types_1.Emulators.EXTENSIONS) {
18
20
  const info = instance.getInfo();
19
- await portUtils.waitForPortClosed(info.port, info.host);
21
+ await portUtils.waitForPortClosed(info.port, (0, utils_1.connectableHostname)(info.host));
20
22
  }
21
23
  }
22
24
  static async stop(name) {
@@ -74,20 +76,12 @@ class EmulatorRegistry {
74
76
  return this.INSTANCES.get(emulator);
75
77
  }
76
78
  static getInfo(emulator) {
77
- const instance = this.INSTANCES.get(emulator === types_1.Emulators.EXTENSIONS ? types_1.Emulators.FUNCTIONS : emulator);
78
- if (!instance) {
79
+ var _a;
80
+ const info = (_a = EmulatorRegistry.get(emulator)) === null || _a === void 0 ? void 0 : _a.getInfo();
81
+ if (!info) {
79
82
  return undefined;
80
83
  }
81
- return instance.getInfo();
82
- }
83
- static getInfoHostString(info) {
84
- const { host, port } = info;
85
- if (host.includes(":")) {
86
- return `[${host}]:${port}`;
87
- }
88
- else {
89
- return `${host}:${port}`;
90
- }
84
+ return Object.assign(Object.assign({}, info), { host: (0, utils_1.connectableHostname)(info.host) });
91
85
  }
92
86
  static url(emulator, req) {
93
87
  const url = new URL("http://unknown/");
@@ -101,13 +95,7 @@ class EmulatorRegistry {
101
95
  }
102
96
  const info = EmulatorRegistry.getInfo(emulator);
103
97
  if (info) {
104
- if (info.host === "0.0.0.0") {
105
- url.hostname = "127.0.0.1";
106
- }
107
- else if (info.host === "::") {
108
- url.hostname = "[::1]";
109
- }
110
- else if (info.host.includes(":")) {
98
+ if (info.host.includes(":")) {
111
99
  url.hostname = `[${info.host}]`;
112
100
  }
113
101
  else {
@@ -120,6 +108,9 @@ class EmulatorRegistry {
120
108
  }
121
109
  return url;
122
110
  }
111
+ static client(emulator, options = {}) {
112
+ return new apiv2_1.Client(Object.assign({ urlPrefix: EmulatorRegistry.url(emulator).toString(), auth: false }, options));
113
+ }
123
114
  static set(emulator, instance) {
124
115
  this.INSTANCES.set(emulator, instance);
125
116
  }
@@ -129,4 +120,3 @@ class EmulatorRegistry {
129
120
  }
130
121
  exports.EmulatorRegistry = EmulatorRegistry;
131
122
  EmulatorRegistry.INSTANCES = new Map();
132
- //# sourceMappingURL=registry.js.map
@@ -17,4 +17,3 @@ async function reqBodyToBuffer(req) {
17
17
  return Buffer.concat(bufs);
18
18
  }
19
19
  exports.reqBodyToBuffer = reqBodyToBuffer;
20
- //# sourceMappingURL=request.js.map
@@ -517,4 +517,3 @@ function isValidNonEncodedPathString(path) {
517
517
  function removeAtMostOneTrailingSlash(path) {
518
518
  return path.replace(/\/$/, "");
519
519
  }
520
- //# sourceMappingURL=firebase.js.map
@@ -187,7 +187,6 @@ function createCloudEndpoints(emulator) {
187
187
  return res.json(new metadata_1.CloudStorageObjectMetadata(metadata));
188
188
  });
189
189
  gcloudStorageAPI.post("/b/:bucketId/o/:objectId/acl", async (req, res) => {
190
- var _a, _b;
191
190
  emulatorLogger_1.EmulatorLogger.forEmulator(types_1.Emulators.STORAGE).log("WARN_ONCE", "Cloud Storage ACLs are not supported in the Storage Emulator. All related methods will succeed, but have no effect.");
192
191
  let getObjectResponse;
193
192
  try {
@@ -207,11 +206,13 @@ function createCloudEndpoints(emulator) {
207
206
  }
208
207
  const { metadata } = getObjectResponse;
209
208
  metadata.update({});
209
+ const selfLink = registry_1.EmulatorRegistry.url(types_1.Emulators.STORAGE);
210
+ selfLink.pathname = `/storage/v1/b/${metadata.bucket}/o/${encodeURIComponent(metadata.name)}/acl/allUsers`;
210
211
  return res.json({
211
212
  kind: "storage#objectAccessControl",
212
213
  object: metadata.name,
213
214
  id: `${req.params.bucketId}/${metadata.name}/${metadata.generation}/allUsers`,
214
- selfLink: `http://${(_a = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.STORAGE)) === null || _a === void 0 ? void 0 : _a.host}:${(_b = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.STORAGE)) === null || _b === void 0 ? void 0 : _b.port}/storage/v1/b/${metadata.bucket}/o/${encodeURIComponent(metadata.name)}/acl/allUsers`,
215
+ selfLink: selfLink.toString(),
215
216
  bucket: metadata.bucket,
216
217
  entity: req.body.entity,
217
218
  role: req.body.role,
@@ -222,10 +223,6 @@ function createCloudEndpoints(emulator) {
222
223
  gcloudStorageAPI.post("/upload/storage/v1/b/:bucketId/o", async (req, res) => {
223
224
  const uploadType = req.query.uploadType || req.header("X-Goog-Upload-Protocol");
224
225
  if (uploadType === "resumable") {
225
- const emulatorInfo = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.STORAGE);
226
- if (emulatorInfo === undefined) {
227
- return res.sendStatus(500);
228
- }
229
226
  const name = getIncomingFileNameFromRequest(req.query, req.body);
230
227
  if (name === undefined) {
231
228
  res.sendStatus(400);
@@ -430,4 +427,3 @@ function getIncomingFileNameFromRequest(query, metadata) {
430
427
  const name = ((_a = query === null || query === void 0 ? void 0 : query.name) === null || _a === void 0 ? void 0 : _a.toString()) || (metadata === null || metadata === void 0 ? void 0 : metadata.name);
431
428
  return (name === null || name === void 0 ? void 0 : name.startsWith("/")) ? name.slice(1) : name;
432
429
  }
433
- //# sourceMappingURL=gcloud.js.map
@@ -6,7 +6,6 @@ const registry_1 = require("../registry");
6
6
  const types_1 = require("../types");
7
7
  const emulatorLogger_1 = require("../emulatorLogger");
8
8
  const metadata_1 = require("./metadata");
9
- const apiv2_1 = require("../../apiv2");
10
9
  const STORAGE_V2_ACTION_MAP = {
11
10
  finalize: "finalized",
12
11
  metadataUpdate: "metadataUpdated",
@@ -17,16 +16,12 @@ class StorageCloudFunctions {
17
16
  constructor(projectId) {
18
17
  this.projectId = projectId;
19
18
  this.logger = emulatorLogger_1.EmulatorLogger.forEmulator(types_1.Emulators.STORAGE);
20
- this.multicastOrigin = "";
21
19
  this.multicastPath = "";
22
20
  this.enabled = false;
23
- const functionsEmulator = registry_1.EmulatorRegistry.get(types_1.Emulators.FUNCTIONS);
24
- if (functionsEmulator) {
21
+ if (registry_1.EmulatorRegistry.isRunning(types_1.Emulators.FUNCTIONS)) {
25
22
  this.enabled = true;
26
- this.functionsEmulatorInfo = functionsEmulator.getInfo();
27
- this.multicastOrigin = `http://${registry_1.EmulatorRegistry.getInfoHostString(this.functionsEmulatorInfo)}`;
28
23
  this.multicastPath = `/functions/projects/${projectId}/trigger_multicast`;
29
- this.client = new apiv2_1.Client({ urlPrefix: this.multicastOrigin, auth: false });
24
+ this.client = registry_1.EmulatorRegistry.client(types_1.Emulators.FUNCTIONS);
30
25
  }
31
26
  }
32
27
  async dispatch(action, object) {
@@ -91,4 +86,3 @@ class StorageCloudFunctions {
91
86
  }
92
87
  }
93
88
  exports.StorageCloudFunctions = StorageCloudFunctions;
94
- //# sourceMappingURL=cloudFunctions.js.map
@@ -31,4 +31,3 @@ function crc32cToString(crc32cValue) {
31
31
  return buffer.toString("base64");
32
32
  }
33
33
  exports.crc32cToString = crc32cToString;
34
- //# sourceMappingURL=crc.js.map
@@ -7,4 +7,3 @@ exports.NotFoundError = NotFoundError;
7
7
  class ForbiddenError extends Error {
8
8
  }
9
9
  exports.ForbiddenError = ForbiddenError;
10
- //# sourceMappingURL=errors.js.map
@@ -401,4 +401,3 @@ function getPathSep(decodedPath) {
401
401
  const firstSepIndex = decodedPath.search(/[\/|\\\\]/g);
402
402
  return decodedPath[firstSepIndex];
403
403
  }
404
- //# sourceMappingURL=files.js.map
@@ -95,4 +95,3 @@ class StorageEmulator {
95
95
  }
96
96
  }
97
97
  exports.StorageEmulator = StorageEmulator;
98
- //# sourceMappingURL=index.js.map
@@ -237,11 +237,12 @@ class OutgoingFirebaseMetadata {
237
237
  exports.OutgoingFirebaseMetadata = OutgoingFirebaseMetadata;
238
238
  class CloudStorageBucketMetadata {
239
239
  constructor(id) {
240
- var _a, _b;
241
240
  this.kind = "storage#bucket";
242
241
  this.name = id;
243
242
  this.id = id;
244
- this.selfLink = `http://${(_a = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.STORAGE)) === null || _a === void 0 ? void 0 : _a.host}:${(_b = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.STORAGE)) === null || _b === void 0 ? void 0 : _b.port}/v1/b/${this.id}`;
243
+ const selfLink = registry_1.EmulatorRegistry.url(types_1.Emulators.STORAGE);
244
+ selfLink.pathname = `/v1/b/${this.id}`;
245
+ this.selfLink = selfLink.toString();
245
246
  this.timeCreated = toSerializedDate(new Date());
246
247
  this.updated = this.timeCreated;
247
248
  this.projectNumber = "000000000000";
@@ -269,7 +270,6 @@ class CloudStorageObjectAccessControlMetadata {
269
270
  exports.CloudStorageObjectAccessControlMetadata = CloudStorageObjectAccessControlMetadata;
270
271
  class CloudStorageObjectMetadata {
271
272
  constructor(metadata) {
272
- var _a, _b, _c, _d;
273
273
  this.kind = "storage#object";
274
274
  this.name = metadata.name;
275
275
  this.bucket = metadata.bucket;
@@ -311,8 +311,14 @@ class CloudStorageObjectMetadata {
311
311
  this.crc32c = (0, crc_1.crc32cToString)(metadata.crc32c);
312
312
  this.timeStorageClassUpdated = toSerializedDate(metadata.timeCreated);
313
313
  this.id = `${metadata.bucket}/${metadata.name}/${metadata.generation}`;
314
- this.selfLink = `http://${(_a = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.STORAGE)) === null || _a === void 0 ? void 0 : _a.host}:${(_b = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.STORAGE)) === null || _b === void 0 ? void 0 : _b.port}/storage/v1/b/${metadata.bucket}/o/${encodeURIComponent(metadata.name)}`;
315
- this.mediaLink = `http://${(_c = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.STORAGE)) === null || _c === void 0 ? void 0 : _c.host}:${(_d = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.STORAGE)) === null || _d === void 0 ? void 0 : _d.port}/download/storage/v1/b/${metadata.bucket}/o/${encodeURIComponent(metadata.name)}?generation=${metadata.generation}&alt=media`;
314
+ const selfLink = registry_1.EmulatorRegistry.url(types_1.Emulators.STORAGE);
315
+ selfLink.pathname = `/storage/v1/b/${metadata.bucket}/o/${encodeURIComponent(metadata.name)}`;
316
+ this.selfLink = selfLink.toString();
317
+ const mediaLink = registry_1.EmulatorRegistry.url(types_1.Emulators.STORAGE);
318
+ mediaLink.pathname = `/download/storage/v1/b/${metadata.bucket}/o/${encodeURIComponent(metadata.name)}`;
319
+ mediaLink.searchParams.set("generation", metadata.generation.toString());
320
+ mediaLink.searchParams.set("alt", "media");
321
+ this.mediaLink = mediaLink.toString();
316
322
  }
317
323
  }
318
324
  exports.CloudStorageObjectMetadata = CloudStorageObjectMetadata;
@@ -341,4 +347,3 @@ function generateETag(generation, metadatageneration) {
341
347
  hash.update(`${generation}/${metadatageneration}`);
342
348
  return hash.digest("base64").slice(0, -1);
343
349
  }
344
- //# sourceMappingURL=metadata.js.map