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
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setEnvVarsForEmulators = void 0;
4
+ const constants_1 = require("./constants");
5
+ const types_1 = require("./types");
6
+ const registry_1 = require("./registry");
7
+ function setEnvVarsForEmulators(env) {
8
+ if (registry_1.EmulatorRegistry.isRunning(types_1.Emulators.DATABASE)) {
9
+ env[constants_1.Constants.FIREBASE_DATABASE_EMULATOR_HOST] = registry_1.EmulatorRegistry.url(types_1.Emulators.DATABASE).host;
10
+ }
11
+ if (registry_1.EmulatorRegistry.isRunning(types_1.Emulators.FIRESTORE)) {
12
+ const { host } = registry_1.EmulatorRegistry.url(types_1.Emulators.FIRESTORE);
13
+ env[constants_1.Constants.FIRESTORE_EMULATOR_HOST] = host;
14
+ env[constants_1.Constants.FIRESTORE_EMULATOR_ENV_ALT] = host;
15
+ }
16
+ if (registry_1.EmulatorRegistry.isRunning(types_1.Emulators.STORAGE)) {
17
+ const { host } = registry_1.EmulatorRegistry.url(types_1.Emulators.STORAGE);
18
+ env[constants_1.Constants.FIREBASE_STORAGE_EMULATOR_HOST] = host;
19
+ env[constants_1.Constants.CLOUD_STORAGE_EMULATOR_HOST] = `http://${host}`;
20
+ }
21
+ if (registry_1.EmulatorRegistry.isRunning(types_1.Emulators.AUTH)) {
22
+ env[constants_1.Constants.FIREBASE_AUTH_EMULATOR_HOST] = registry_1.EmulatorRegistry.url(types_1.Emulators.AUTH).host;
23
+ }
24
+ if (registry_1.EmulatorRegistry.isRunning(types_1.Emulators.HUB)) {
25
+ env[constants_1.Constants.FIREBASE_EMULATOR_HUB] = registry_1.EmulatorRegistry.url(types_1.Emulators.HUB).host;
26
+ }
27
+ const pubsubEmulator = registry_1.EmulatorRegistry.isRunning(types_1.Emulators.PUBSUB);
28
+ if (pubsubEmulator) {
29
+ env[constants_1.Constants.PUBSUB_EMULATOR_HOST] = registry_1.EmulatorRegistry.url(types_1.Emulators.PUBSUB).host;
30
+ }
31
+ if (registry_1.EmulatorRegistry.isRunning(types_1.Emulators.EVENTARC)) {
32
+ env[constants_1.Constants.CLOUD_EVENTARC_EMULATOR_HOST] = `http://${registry_1.EmulatorRegistry.url(types_1.Emulators.EVENTARC).host}`;
33
+ }
34
+ }
35
+ exports.setEnvVarsForEmulators = setEnvVarsForEmulators;
@@ -7,7 +7,6 @@ const types_1 = require("./types");
7
7
  const utils_1 = require("../utils");
8
8
  const emulatorLogger_1 = require("./emulatorLogger");
9
9
  const registry_1 = require("./registry");
10
- const apiv2_1 = require("../apiv2");
11
10
  const error_1 = require("../error");
12
11
  class EventarcEmulator {
13
12
  constructor(args) {
@@ -77,21 +76,16 @@ class EventarcEmulator {
77
76
  return hub;
78
77
  }
79
78
  async triggerCustomEventFunction(channel, event) {
80
- const functionsEmulator = registry_1.EmulatorRegistry.get(types_1.Emulators.FUNCTIONS);
81
- if (!functionsEmulator) {
79
+ if (!registry_1.EmulatorRegistry.isRunning(types_1.Emulators.FUNCTIONS)) {
82
80
  this.logger.log("INFO", "Functions emulator not found. This should not happen.");
83
81
  return Promise.reject();
84
82
  }
85
83
  const key = `${event.type}-${channel}`;
86
84
  const triggers = this.customEvents[key] || [];
87
- const apiClient = new apiv2_1.Client({
88
- urlPrefix: `http://${registry_1.EmulatorRegistry.getInfoHostString(functionsEmulator.getInfo())}`,
89
- auth: false,
90
- });
91
85
  return await Promise.all(triggers
92
86
  .filter((trigger) => !trigger.eventTrigger.eventFilters ||
93
87
  this.matchesAll(event, trigger.eventTrigger.eventFilters))
94
- .map((trigger) => apiClient
88
+ .map((trigger) => registry_1.EmulatorRegistry.client(types_1.Emulators.FUNCTIONS)
95
89
  .request({
96
90
  method: "POST",
97
91
  path: `/functions/projects/${trigger.projectId}/triggers/${trigger.triggerName}`,
@@ -146,4 +140,3 @@ class EventarcEmulator {
146
140
  }
147
141
  }
148
142
  exports.EventarcEmulator = EventarcEmulator;
149
- //# sourceMappingURL=eventarcEmulator.js.map
@@ -26,4 +26,3 @@ class EventUtils {
26
26
  }
27
27
  }
28
28
  exports.EventUtils = EventUtils;
29
- //# sourceMappingURL=types.js.map
@@ -4,33 +4,33 @@ exports.replaceConsoleLinks = void 0;
4
4
  const registry_1 = require("../registry");
5
5
  const types_1 = require("../types");
6
6
  function replaceConsoleLinks(postinstall) {
7
- const uiInfo = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.UI);
8
- const uiUrl = uiInfo ? `http://${registry_1.EmulatorRegistry.getInfoHostString(uiInfo)}` : "unknown";
7
+ const uiRunning = registry_1.EmulatorRegistry.isRunning(types_1.Emulators.UI);
8
+ const uiUrl = uiRunning ? registry_1.EmulatorRegistry.url(types_1.Emulators.UI).toString() : "unknown";
9
9
  let subbedPostinstall = postinstall;
10
10
  const linkReplacements = new Map([
11
11
  [
12
12
  /(http[s]?:\/\/)?console\.firebase\.google\.com\/(u\/[0-9]\/)?project\/[A-Za-z0-9-]+\/storage[A-Za-z0-9\/-]*(?=[\)\]\s])/,
13
- `${uiUrl}/${types_1.Emulators.STORAGE}`,
13
+ `${uiUrl}${types_1.Emulators.STORAGE}`,
14
14
  ],
15
15
  [
16
16
  /(http[s]?:\/\/)?console\.firebase\.google\.com\/(u\/[0-9]\/)?project\/[A-Za-z0-9-]+\/firestore[A-Za-z0-9\/-]*(?=[\)\]\s])/,
17
- `${uiUrl}/${types_1.Emulators.FIRESTORE}`,
17
+ `${uiUrl}${types_1.Emulators.FIRESTORE}`,
18
18
  ],
19
19
  [
20
20
  /(http[s]?:\/\/)?console\.firebase\.google\.com\/(u\/[0-9]\/)?project\/[A-Za-z0-9-]+\/database[A-Za-z0-9\/-]*(?=[\)\]\s])/,
21
- `${uiUrl}/${types_1.Emulators.DATABASE}`,
21
+ `${uiUrl}${types_1.Emulators.DATABASE}`,
22
22
  ],
23
23
  [
24
24
  /(http[s]?:\/\/)?console\.firebase\.google\.com\/(u\/[0-9]\/)?project\/[A-Za-z0-9-]+\/authentication[A-Za-z0-9\/-]*(?=[\)\]\s])/,
25
- `${uiUrl}/${types_1.Emulators.AUTH}`,
25
+ `${uiUrl}${types_1.Emulators.AUTH}`,
26
26
  ],
27
27
  [
28
28
  /(http[s]?:\/\/)?console\.firebase\.google\.com\/(u\/[0-9]\/)?project\/[A-Za-z0-9-]+\/functions[A-Za-z0-9\/-]*(?=[\)\]\s])/,
29
- `${uiUrl}/logs`,
29
+ `${uiUrl}logs`,
30
30
  ],
31
31
  [
32
32
  /(http[s]?:\/\/)?console\.firebase\.google\.com\/(u\/[0-9]\/)?project\/[A-Za-z0-9-]+\/extensions[A-Za-z0-9\/-]*(?=[\)\]\s])/,
33
- `${uiUrl}/${types_1.Emulators.EXTENSIONS}`,
33
+ `${uiUrl}${types_1.Emulators.EXTENSIONS}`,
34
34
  ],
35
35
  ]);
36
36
  for (const [consoleLinkRegex, replacement] of linkReplacements) {
@@ -39,4 +39,3 @@ function replaceConsoleLinks(postinstall) {
39
39
  return subbedPostinstall;
40
40
  }
41
41
  exports.replaceConsoleLinks = replaceConsoleLinks;
42
- //# sourceMappingURL=postinstall.js.map
@@ -68,4 +68,3 @@ function checkForUnemulatedTriggerTypes(backend, options) {
68
68
  return [...new Set(unemulatedTriggers)];
69
69
  }
70
70
  exports.checkForUnemulatedTriggerTypes = checkForUnemulatedTriggerTypes;
71
- //# sourceMappingURL=validation.js.map
@@ -40,11 +40,11 @@ class ExtensionsEmulator {
40
40
  return Promise.resolve();
41
41
  }
42
42
  getInfo() {
43
- const info = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.FUNCTIONS);
44
- if (!info) {
43
+ const functionsEmulator = registry_1.EmulatorRegistry.get(types_1.Emulators.FUNCTIONS);
44
+ if (!functionsEmulator) {
45
45
  throw new error_1.FirebaseError("Extensions Emulator is running but Functions emulator is not. This should never happen.");
46
46
  }
47
- return info;
47
+ return functionsEmulator.getInfo();
48
48
  }
49
49
  getName() {
50
50
  return types_1.Emulators.EXTENSIONS;
@@ -222,12 +222,12 @@ class ExtensionsEmulator {
222
222
  return filteredBackends;
223
223
  }
224
224
  extensionDetailsUILink(backend) {
225
- const uiInfo = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.UI);
226
- if (!uiInfo || !backend.extensionInstanceId) {
225
+ if (!registry_1.EmulatorRegistry.isRunning(types_1.Emulators.UI) || !backend.extensionInstanceId) {
227
226
  return "";
228
227
  }
229
- const uiUrl = registry_1.EmulatorRegistry.getInfoHostString(uiInfo);
230
- return clc.underline(clc.bold(`http://${uiUrl}/${types_1.Emulators.EXTENSIONS}/${backend.extensionInstanceId}`));
228
+ const uiUrl = registry_1.EmulatorRegistry.url(types_1.Emulators.UI);
229
+ uiUrl.pathname = `/${types_1.Emulators.EXTENSIONS}/${backend.extensionInstanceId}`;
230
+ return clc.underline(clc.bold(uiUrl.toString()));
231
231
  }
232
232
  extensionsInfoTable(options) {
233
233
  var _a;
@@ -250,4 +250,3 @@ class ExtensionsEmulator {
250
250
  }
251
251
  }
252
252
  exports.ExtensionsEmulator = ExtensionsEmulator;
253
- //# sourceMappingURL=extensionsEmulator.js.map
@@ -10,15 +10,13 @@ const downloadableEmulators = require("./downloadableEmulators");
10
10
  const types_1 = require("../emulator/types");
11
11
  const registry_1 = require("./registry");
12
12
  const constants_1 = require("./constants");
13
- const apiv2_1 = require("../apiv2");
14
13
  class FirestoreEmulator {
15
14
  constructor(args) {
16
15
  this.args = args;
17
16
  }
18
17
  async start() {
19
- const functionsInfo = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.FUNCTIONS);
20
- if (functionsInfo) {
21
- this.args.functions_emulator = registry_1.EmulatorRegistry.getInfoHostString(functionsInfo);
18
+ if (registry_1.EmulatorRegistry.isRunning(types_1.Emulators.FUNCTIONS)) {
19
+ this.args.functions_emulator = registry_1.EmulatorRegistry.url(types_1.Emulators.FUNCTIONS).host;
22
20
  }
23
21
  if (this.args.rules && this.args.project_id) {
24
22
  const rulesPath = this.args.rules;
@@ -62,6 +60,8 @@ class FirestoreEmulator {
62
60
  port,
63
61
  pid: downloadableEmulators.getPID(types_1.Emulators.FIRESTORE),
64
62
  reservedPorts: reservedPorts,
63
+ webSocketHost: this.args.websocket_port ? host : undefined,
64
+ webSocketPort: this.args.websocket_port ? this.args.websocket_port : undefined,
65
65
  };
66
66
  }
67
67
  getName() {
@@ -69,7 +69,6 @@ class FirestoreEmulator {
69
69
  }
70
70
  async updateRules(content) {
71
71
  const projectId = this.args.project_id;
72
- const info = this.getInfo();
73
72
  const body = {
74
73
  ignore_errors: true,
75
74
  rules: {
@@ -81,11 +80,7 @@ class FirestoreEmulator {
81
80
  ],
82
81
  },
83
82
  };
84
- const client = new apiv2_1.Client({
85
- urlPrefix: `http://${registry_1.EmulatorRegistry.getInfoHostString(info)}`,
86
- auth: false,
87
- });
88
- const res = await client.put(`/emulator/v1/projects/${projectId}:securityRules`, body);
83
+ const res = await registry_1.EmulatorRegistry.client(types_1.Emulators.FIRESTORE).put(`/emulator/v1/projects/${projectId}:securityRules`, body);
89
84
  if (res.body && Array.isArray(res.body.issues)) {
90
85
  return res.body.issues;
91
86
  }
@@ -99,5 +94,3 @@ class FirestoreEmulator {
99
94
  }
100
95
  }
101
96
  exports.FirestoreEmulator = FirestoreEmulator;
102
- FirestoreEmulator.FIRESTORE_EMULATOR_ENV_ALT = "FIREBASE_FIRESTORE_EMULATOR_ADDRESS";
103
- //# sourceMappingURL=firestoreEmulator.js.map
@@ -31,8 +31,8 @@ const runtimes = require("../deploy/functions/runtimes");
31
31
  const backend = require("../deploy/functions/backend");
32
32
  const functionsEnv = require("../functions/env");
33
33
  const v1_1 = require("../functions/events/v1");
34
- const apiv2_1 = require("../apiv2");
35
34
  const build_1 = require("../deploy/functions/build");
35
+ const env_1 = require("./env");
36
36
  const EVENT_INVOKE = "functions:invoke";
37
37
  const EVENT_INVOKE_GA4 = "functions_invoke";
38
38
  const DATABASE_PATH_PATTERN = new RegExp("^projects/[^/]+/instances/([^/]+)/refs(/.*)$");
@@ -60,8 +60,16 @@ class FunctionsEmulator {
60
60
  }
61
61
  this.workQueue = new workQueue_1.WorkQueue(mode);
62
62
  }
63
- static getHttpFunctionUrl(host, port, projectId, name, region) {
64
- return `http://${host}:${port}/${projectId}/${region}/${name}`;
63
+ static getHttpFunctionUrl(projectId, name, region, info) {
64
+ let url;
65
+ if (info) {
66
+ url = new url_1.URL("http://" + (0, functionsEmulatorShared_1.formatHost)(info));
67
+ }
68
+ else {
69
+ url = registry_1.EmulatorRegistry.url(types_1.Emulators.FUNCTIONS);
70
+ }
71
+ url.pathname = `/${projectId}/${region}/${name}`;
72
+ return url.toString();
65
73
  }
66
74
  async getCredentialsEnvironment() {
67
75
  const credentialEnv = {};
@@ -124,7 +132,7 @@ class FunctionsEmulator {
124
132
  this.workQueue.submit(() => {
125
133
  return new Promise((resolve, reject) => {
126
134
  const trigReq = http.request({
127
- host,
135
+ host: (0, utils_1.connectableHostname)(host),
128
136
  port,
129
137
  method: req.method,
130
138
  path: `/functions/projects/${projectId}/triggers/${triggerId}`,
@@ -312,10 +320,9 @@ class FunctionsEmulator {
312
320
  }
313
321
  let added = false;
314
322
  let url = undefined;
315
- const { host, port } = this.getInfo();
316
323
  if (definition.httpsTrigger) {
317
324
  added = true;
318
- url = FunctionsEmulator.getHttpFunctionUrl(host, port, this.args.projectId, definition.name, definition.region);
325
+ url = FunctionsEmulator.getHttpFunctionUrl(this.args.projectId, definition.name, definition.region);
319
326
  }
320
327
  else if (definition.eventTrigger) {
321
328
  const service = (0, functionsEmulatorShared_1.getFunctionService)(definition);
@@ -346,8 +353,7 @@ class FunctionsEmulator {
346
353
  }
347
354
  }
348
355
  else if (definition.blockingTrigger) {
349
- const { host, port } = this.getInfo();
350
- url = FunctionsEmulator.getHttpFunctionUrl(host, port, this.args.projectId, definition.name, definition.region);
356
+ url = FunctionsEmulator.getHttpFunctionUrl(this.args.projectId, definition.name, definition.region);
351
357
  added = this.addBlockingTrigger(url, definition.blockingTrigger);
352
358
  }
353
359
  else {
@@ -374,19 +380,14 @@ class FunctionsEmulator {
374
380
  }
375
381
  }
376
382
  addEventarcTrigger(projectId, key, eventTrigger) {
377
- const eventarcEmu = registry_1.EmulatorRegistry.get(types_1.Emulators.EVENTARC);
378
- if (!eventarcEmu) {
383
+ if (!registry_1.EmulatorRegistry.isRunning(types_1.Emulators.EVENTARC)) {
379
384
  return Promise.resolve(false);
380
385
  }
381
386
  const bundle = {
382
387
  eventTrigger: Object.assign(Object.assign({}, eventTrigger), { service: "eventarc.googleapis.com" }),
383
388
  };
384
389
  logger_1.logger.debug(`addEventarcTrigger`, JSON.stringify(bundle));
385
- const client = new apiv2_1.Client({
386
- urlPrefix: `http://${registry_1.EmulatorRegistry.getInfoHostString(eventarcEmu.getInfo())}`,
387
- auth: false,
388
- });
389
- return client
390
+ return registry_1.EmulatorRegistry.client(types_1.Emulators.EVENTARC)
390
391
  .post(`/emulator/v1/projects/${projectId}/triggers/${key}`, bundle)
391
392
  .then(() => true)
392
393
  .catch((err) => {
@@ -399,16 +400,12 @@ class FunctionsEmulator {
399
400
  !this.blockingFunctionsConfig.forwardInboundCredentials) {
400
401
  return;
401
402
  }
402
- const authEmu = registry_1.EmulatorRegistry.get(types_1.Emulators.AUTH);
403
- if (!authEmu) {
403
+ if (!registry_1.EmulatorRegistry.isRunning(types_1.Emulators.AUTH)) {
404
404
  return;
405
405
  }
406
406
  const path = `/identitytoolkit.googleapis.com/v2/projects/${this.getProjectId()}/config?updateMask=blockingFunctions`;
407
407
  try {
408
- const client = new apiv2_1.Client({
409
- urlPrefix: `http://${registry_1.EmulatorRegistry.getInfoHostString(authEmu.getInfo())}`,
410
- auth: false,
411
- });
408
+ const client = registry_1.EmulatorRegistry.client(types_1.Emulators.AUTH);
412
409
  await client.patch(path, { blockingFunctions: this.blockingFunctionsConfig }, {
413
410
  headers: { Authorization: "Bearer owner" },
414
411
  });
@@ -461,18 +458,14 @@ class FunctionsEmulator {
461
458
  return { bundle, apiPath, instance };
462
459
  }
463
460
  async addRealtimeDatabaseTrigger(projectId, key, eventTrigger, signature, region) {
464
- const databaseEmu = registry_1.EmulatorRegistry.get(types_1.Emulators.DATABASE);
465
- if (!databaseEmu) {
461
+ if (!registry_1.EmulatorRegistry.isRunning(types_1.Emulators.DATABASE)) {
466
462
  return false;
467
463
  }
468
464
  const { bundle, apiPath, instance } = signature === "cloudevent"
469
465
  ? this.getV2DatabaseApiAttributes(projectId, key, eventTrigger, region)
470
466
  : this.getV1DatabaseApiAttributes(projectId, key, eventTrigger);
471
467
  logger_1.logger.debug(`addRealtimeDatabaseTrigger[${instance}]`, JSON.stringify(bundle));
472
- const client = new apiv2_1.Client({
473
- urlPrefix: `http://${registry_1.EmulatorRegistry.getInfoHostString(databaseEmu.getInfo())}`,
474
- auth: false,
475
- });
468
+ const client = registry_1.EmulatorRegistry.client(types_1.Emulators.DATABASE);
476
469
  try {
477
470
  await client.post(apiPath, bundle, { headers: { Authorization: "Bearer owner" } });
478
471
  }
@@ -483,18 +476,14 @@ class FunctionsEmulator {
483
476
  return true;
484
477
  }
485
478
  async addFirestoreTrigger(projectId, key, eventTrigger) {
486
- const firestoreEmu = registry_1.EmulatorRegistry.get(types_1.Emulators.FIRESTORE);
487
- if (!firestoreEmu) {
479
+ if (!registry_1.EmulatorRegistry.isRunning(types_1.Emulators.FIRESTORE)) {
488
480
  return Promise.resolve(false);
489
481
  }
490
482
  const bundle = JSON.stringify({
491
483
  eventTrigger: Object.assign(Object.assign({}, eventTrigger), { service: "firestore.googleapis.com" }),
492
484
  });
493
485
  logger_1.logger.debug(`addFirestoreTrigger`, JSON.stringify(bundle));
494
- const client = new apiv2_1.Client({
495
- urlPrefix: `http://${registry_1.EmulatorRegistry.getInfoHostString(firestoreEmu.getInfo())}`,
496
- auth: false,
497
- });
486
+ const client = registry_1.EmulatorRegistry.client(types_1.Emulators.FIRESTORE);
498
487
  try {
499
488
  await client.put(`/emulator/v1/projects/${projectId}/triggers/${key}`, bundle);
500
489
  }
@@ -718,32 +707,7 @@ class FunctionsEmulator {
718
707
  skipTokenVerification: true,
719
708
  enableCors: true,
720
709
  });
721
- const firestoreEmulator = this.getEmulatorInfo(types_1.Emulators.FIRESTORE);
722
- if (firestoreEmulator != null) {
723
- envs[constants_1.Constants.FIRESTORE_EMULATOR_HOST] = (0, functionsEmulatorShared_1.formatHost)(firestoreEmulator);
724
- }
725
- const databaseEmulator = this.getEmulatorInfo(types_1.Emulators.DATABASE);
726
- if (databaseEmulator) {
727
- envs[constants_1.Constants.FIREBASE_DATABASE_EMULATOR_HOST] = (0, functionsEmulatorShared_1.formatHost)(databaseEmulator);
728
- }
729
- const authEmulator = this.getEmulatorInfo(types_1.Emulators.AUTH);
730
- if (authEmulator) {
731
- envs[constants_1.Constants.FIREBASE_AUTH_EMULATOR_HOST] = (0, functionsEmulatorShared_1.formatHost)(authEmulator);
732
- }
733
- const storageEmulator = this.getEmulatorInfo(types_1.Emulators.STORAGE);
734
- if (storageEmulator) {
735
- envs[constants_1.Constants.FIREBASE_STORAGE_EMULATOR_HOST] = (0, functionsEmulatorShared_1.formatHost)(storageEmulator);
736
- envs[constants_1.Constants.CLOUD_STORAGE_EMULATOR_HOST] = `http://${(0, functionsEmulatorShared_1.formatHost)(storageEmulator)}`;
737
- }
738
- const pubsubEmulator = this.getEmulatorInfo(types_1.Emulators.PUBSUB);
739
- if (pubsubEmulator) {
740
- const pubsubHost = (0, functionsEmulatorShared_1.formatHost)(pubsubEmulator);
741
- process.env.PUBSUB_EMULATOR_HOST = pubsubHost;
742
- }
743
- const eventarcEmulator = this.getEmulatorInfo(types_1.Emulators.EVENTARC);
744
- if (eventarcEmulator) {
745
- envs[constants_1.Constants.CLOUD_EVENTARC_EMULATOR_HOST] = `http://${(0, functionsEmulatorShared_1.formatHost)(eventarcEmulator)}`;
746
- }
710
+ (0, env_1.setEnvVarsForEmulators)(envs);
747
711
  if (this.args.debugPort) {
748
712
  envs["FUNCTION_DEBUG_MODE"] = "true";
749
713
  }
@@ -821,7 +785,7 @@ class FunctionsEmulator {
821
785
  }
822
786
  else {
823
787
  const { host } = this.getInfo();
824
- args.unshift(`--inspect=${host}:${this.args.debugPort}`);
788
+ args.unshift(`--inspect=${(0, utils_1.connectableHostname)(host)}:${this.args.debugPort}`);
825
789
  }
826
790
  }
827
791
  const pnpPath = path.join(backend.functionsDir, ".pnp.js");
@@ -959,4 +923,3 @@ class FunctionsEmulator {
959
923
  }
960
924
  }
961
925
  exports.FunctionsEmulator = FunctionsEmulator;
962
- //# sourceMappingURL=functionsEmulator.js.map
@@ -740,4 +740,3 @@ if (require.main === module) {
740
740
  return flushAndExit(1);
741
741
  });
742
742
  }
743
- //# sourceMappingURL=functionsEmulatorRuntime.js.map
@@ -14,6 +14,7 @@ const postinstall_1 = require("./extensions/postinstall");
14
14
  const services_1 = require("../deploy/functions/services");
15
15
  const prepare_1 = require("../deploy/functions/prepare");
16
16
  const events = require("../functions/events");
17
+ const utils_1 = require("../utils");
17
18
  const V2_EVENTS = [
18
19
  events.v2.PUBSUB_PUBLISH_EVENT,
19
20
  ...events.v2.STORAGE_EVENTS,
@@ -246,11 +247,12 @@ function findModuleRoot(moduleName, filepath) {
246
247
  }
247
248
  exports.findModuleRoot = findModuleRoot;
248
249
  function formatHost(info) {
249
- if (info.host.includes(":")) {
250
- return `[${info.host}]:${info.port}`;
250
+ const host = (0, utils_1.connectableHostname)(info.host);
251
+ if (host.includes(":")) {
252
+ return `[${host}]:${info.port}`;
251
253
  }
252
254
  else {
253
- return `${info.host}:${info.port}`;
255
+ return `${host}:${info.port}`;
254
256
  }
255
257
  }
256
258
  exports.formatHost = formatHost;
@@ -303,4 +305,3 @@ function toBackendInfo(e, cf3Triggers) {
303
305
  }));
304
306
  }
305
307
  exports.toBackendInfo = toBackendInfo;
306
- //# sourceMappingURL=functionsEmulatorShared.js.map
@@ -16,7 +16,7 @@ class FunctionsEmulatorShell {
16
16
  utils.logLabeledBullet("functions", `Loaded functions: ${entryPoints.join(", ")}`);
17
17
  for (const trigger of this.triggers) {
18
18
  if (trigger.httpsTrigger) {
19
- this.urls[trigger.id] = functionsEmulator_1.FunctionsEmulator.getHttpFunctionUrl(this.emu.getInfo().host, this.emu.getInfo().port, this.emu.getProjectId(), trigger.name, trigger.region);
19
+ this.urls[trigger.id] = functionsEmulator_1.FunctionsEmulator.getHttpFunctionUrl(this.emu.getProjectId(), trigger.name, trigger.region, this.emu.getInfo());
20
20
  }
21
21
  }
22
22
  }
@@ -54,4 +54,3 @@ class FunctionsEmulatorShell {
54
54
  }
55
55
  }
56
56
  exports.FunctionsEmulatorShell = FunctionsEmulatorShell;
57
- //# sourceMappingURL=functionsEmulatorShell.js.map
@@ -89,4 +89,3 @@ function isLocalHost(href) {
89
89
  return !!href.match(/^(http(s)?:\/\/)?(localhost|127.0.0.1|\[::1])/);
90
90
  }
91
91
  exports.isLocalHost = isLocalHost;
92
- //# sourceMappingURL=functionsEmulatorUtils.js.map
@@ -277,4 +277,3 @@ class RuntimeWorkerPool {
277
277
  }
278
278
  }
279
279
  exports.RuntimeWorkerPool = RuntimeWorkerPool;
280
- //# sourceMappingURL=functionsRuntimeWorker.js.map
@@ -33,4 +33,3 @@ class HostingEmulator {
33
33
  }
34
34
  }
35
35
  exports.HostingEmulator = HostingEmulator;
36
- //# sourceMappingURL=hostingEmulator.js.map
@@ -1,37 +1,58 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EmulatorHub = void 0;
4
- const cors = require("cors");
5
- const express = require("express");
6
4
  const os = require("os");
7
5
  const fs = require("fs");
8
6
  const path = require("path");
9
- const bodyParser = require("body-parser");
10
7
  const utils = require("../utils");
11
8
  const logger_1 = require("../logger");
12
- const constants_1 = require("./constants");
13
9
  const types_1 = require("./types");
14
10
  const hubExport_1 = require("./hubExport");
15
11
  const registry_1 = require("./registry");
12
+ const ExpressBasedEmulator_1 = require("./ExpressBasedEmulator");
16
13
  const pkg = require("../../package.json");
17
- class EmulatorHub {
14
+ class EmulatorHub extends ExpressBasedEmulator_1.ExpressBasedEmulator {
18
15
  constructor(args) {
16
+ super({
17
+ listen: args.listen,
18
+ });
19
19
  this.args = args;
20
- this.hub = express();
21
- this.hub.use(cors({ origin: true }));
22
- this.hub.use(bodyParser.json());
23
- this.hub.get("/", (req, res) => {
24
- res.json(this.getLocator());
20
+ }
21
+ static readLocatorFile(projectId) {
22
+ const locatorPath = this.getLocatorFilePath(projectId);
23
+ if (!fs.existsSync(locatorPath)) {
24
+ return undefined;
25
+ }
26
+ const data = fs.readFileSync(locatorPath, "utf8").toString();
27
+ const locator = JSON.parse(data);
28
+ if (locator.version !== this.CLI_VERSION) {
29
+ logger_1.logger.debug(`Found locator with mismatched version, ignoring: ${JSON.stringify(locator)}`);
30
+ return undefined;
31
+ }
32
+ return locator;
33
+ }
34
+ static getLocatorFilePath(projectId) {
35
+ const dir = os.tmpdir();
36
+ const filename = `hub-${projectId}.json`;
37
+ return path.join(dir, filename);
38
+ }
39
+ async start() {
40
+ await super.start();
41
+ await this.writeLocatorFile();
42
+ }
43
+ async createExpressApp() {
44
+ const app = await super.createExpressApp();
45
+ app.get("/", (req, res) => {
46
+ res.json(Object.assign(Object.assign({}, this.getLocator()), { host: utils.connectableHostname(this.args.listen[0].address), port: this.args.listen[0].port }));
25
47
  });
26
- this.hub.get(EmulatorHub.PATH_EMULATORS, (req, res) => {
48
+ app.get(EmulatorHub.PATH_EMULATORS, (req, res) => {
27
49
  const body = {};
28
- for (const emulator of registry_1.EmulatorRegistry.listRunning()) {
29
- const info = registry_1.EmulatorRegistry.getInfo(emulator);
30
- body[emulator] = info;
50
+ for (const info of registry_1.EmulatorRegistry.listRunningWithInfo()) {
51
+ body[info.name] = Object.assign({ listen: this.args.listenForEmulator[info.name] }, info);
31
52
  }
32
53
  res.json(body);
33
54
  });
34
- this.hub.post(EmulatorHub.PATH_EXPORT, async (req, res) => {
55
+ app.post(EmulatorHub.PATH_EXPORT, async (req, res) => {
35
56
  const path = req.body.path;
36
57
  const initiatedBy = req.body.initiatedBy || "unknown";
37
58
  utils.logLabeledBullet("emulators", `Received export request. Exporting data to ${path}.`);
@@ -53,7 +74,7 @@ class EmulatorHub {
53
74
  });
54
75
  }
55
76
  });
56
- this.hub.put(EmulatorHub.PATH_DISABLE_FUNCTIONS, async (req, res) => {
77
+ app.put(EmulatorHub.PATH_DISABLE_FUNCTIONS, async (req, res) => {
57
78
  utils.logLabeledBullet("emulators", `Disabling Cloud Functions triggers, non-HTTP functions will not execute.`);
58
79
  const instance = registry_1.EmulatorRegistry.get(types_1.Emulators.FUNCTIONS);
59
80
  if (!instance) {
@@ -64,7 +85,7 @@ class EmulatorHub {
64
85
  await emu.disableBackgroundTriggers();
65
86
  res.status(200).json({ enabled: false });
66
87
  });
67
- this.hub.put(EmulatorHub.PATH_ENABLE_FUNCTIONS, async (req, res) => {
88
+ app.put(EmulatorHub.PATH_ENABLE_FUNCTIONS, async (req, res) => {
68
89
  utils.logLabeledBullet("emulators", `Enabling Cloud Functions triggers, non-HTTP functions will execute.`);
69
90
  const instance = registry_1.EmulatorRegistry.get(types_1.Emulators.FUNCTIONS);
70
91
  if (!instance) {
@@ -75,58 +96,29 @@ class EmulatorHub {
75
96
  await emu.reloadTriggers();
76
97
  res.status(200).json({ enabled: true });
77
98
  });
78
- }
79
- static readLocatorFile(projectId) {
80
- const locatorPath = this.getLocatorFilePath(projectId);
81
- if (!fs.existsSync(locatorPath)) {
82
- return undefined;
83
- }
84
- const data = fs.readFileSync(locatorPath, "utf8").toString();
85
- const locator = JSON.parse(data);
86
- if (locator.version !== this.CLI_VERSION) {
87
- logger_1.logger.debug(`Found locator with mismatched version, ignoring: ${JSON.stringify(locator)}`);
88
- return undefined;
89
- }
90
- return locator;
91
- }
92
- static getLocatorFilePath(projectId) {
93
- const dir = os.tmpdir();
94
- const filename = `hub-${projectId}.json`;
95
- return path.join(dir, filename);
96
- }
97
- async start() {
98
- const { host, port } = this.getInfo();
99
- const server = this.hub.listen(port, host);
100
- this.destroyServer = utils.createDestroyer(server);
101
- await this.writeLocatorFile();
102
- }
103
- async connect() {
99
+ return app;
104
100
  }
105
101
  async stop() {
106
- if (this.destroyServer) {
107
- await this.destroyServer();
108
- }
102
+ await super.stop();
109
103
  await this.deleteLocatorFile();
110
104
  }
111
- getInfo() {
112
- const host = this.args.host || constants_1.Constants.getDefaultHost();
113
- const port = this.args.port || constants_1.Constants.getDefaultPort(types_1.Emulators.HUB);
114
- return {
115
- name: this.getName(),
116
- host,
117
- port,
118
- };
119
- }
120
105
  getName() {
121
106
  return types_1.Emulators.HUB;
122
107
  }
123
108
  getLocator() {
124
- const { host, port } = this.getInfo();
125
109
  const version = pkg.version;
110
+ const origins = [];
111
+ for (const spec of this.args.listen) {
112
+ if (spec.family === "IPv6") {
113
+ origins.push(`http://[${utils.connectableHostname(spec.address)}]:${spec.port}`);
114
+ }
115
+ else {
116
+ origins.push(`http://${utils.connectableHostname(spec.address)}:${spec.port}`);
117
+ }
118
+ }
126
119
  return {
127
120
  version,
128
- host,
129
- port,
121
+ origins,
130
122
  };
131
123
  }
132
124
  async writeLocatorFile() {
@@ -168,4 +160,3 @@ EmulatorHub.PATH_EXPORT = "/_admin/export";
168
160
  EmulatorHub.PATH_DISABLE_FUNCTIONS = "/functions/disableBackgroundTriggers";
169
161
  EmulatorHub.PATH_ENABLE_FUNCTIONS = "/functions/enableBackgroundTriggers";
170
162
  EmulatorHub.PATH_EMULATORS = "/emulators";
171
- //# sourceMappingURL=hub.js.map