firebase-tools 9.23.2 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/lib/api.js +1 -1
  2. package/lib/apiv2.js +2 -2
  3. package/lib/appdistribution/client.js +1 -1
  4. package/lib/appdistribution/options-parser-util.js +1 -1
  5. package/lib/auth.js +2 -2
  6. package/lib/command.js +26 -26
  7. package/lib/commands/appdistribution-distribute.js +4 -4
  8. package/lib/commands/appdistribution-testers-add.js +2 -2
  9. package/lib/commands/appdistribution-testers-remove.js +2 -2
  10. package/lib/commands/apps-android-sha-create.js +2 -2
  11. package/lib/commands/apps-android-sha-delete.js +2 -2
  12. package/lib/commands/apps-android-sha-list.js +2 -2
  13. package/lib/commands/apps-create.js +9 -9
  14. package/lib/commands/apps-list.js +3 -3
  15. package/lib/commands/apps-sdkconfig.js +8 -8
  16. package/lib/commands/database-get.js +1 -1
  17. package/lib/commands/database-instances-create.js +4 -4
  18. package/lib/commands/database-instances-list.js +4 -4
  19. package/lib/commands/database-profile.js +1 -1
  20. package/lib/commands/database-push.js +1 -1
  21. package/lib/commands/database-remove.js +4 -4
  22. package/lib/commands/database-set.js +4 -4
  23. package/lib/commands/database-settings-get.js +1 -1
  24. package/lib/commands/database-settings-set.js +1 -1
  25. package/lib/commands/database-update.js +4 -4
  26. package/lib/commands/ext-configure.js +2 -2
  27. package/lib/commands/ext-dev-deprecate.js +4 -4
  28. package/lib/commands/ext-dev-extension-delete.js +3 -3
  29. package/lib/commands/ext-dev-init.js +3 -3
  30. package/lib/commands/ext-dev-list.js +1 -1
  31. package/lib/commands/ext-dev-publish.js +3 -3
  32. package/lib/commands/ext-dev-register.js +5 -5
  33. package/lib/commands/ext-dev-undeprecate.js +4 -4
  34. package/lib/commands/ext-dev-unpublish.js +3 -3
  35. package/lib/commands/ext-dev-usage.js +145 -0
  36. package/lib/commands/ext-export.js +8 -8
  37. package/lib/commands/ext-info.js +4 -4
  38. package/lib/commands/ext-install.js +26 -22
  39. package/lib/commands/ext-list.js +2 -2
  40. package/lib/commands/ext-sources-create.js +2 -2
  41. package/lib/commands/ext-uninstall.js +3 -3
  42. package/lib/commands/ext-update.js +17 -17
  43. package/lib/commands/ext.js +3 -3
  44. package/lib/commands/firestore-delete.js +3 -3
  45. package/lib/commands/functions-config-export.js +11 -11
  46. package/lib/commands/functions-delete.js +3 -3
  47. package/lib/commands/functions-deletegcfartifacts.js +4 -4
  48. package/lib/commands/functions-list.js +1 -1
  49. package/lib/commands/functions-log.js +1 -1
  50. package/lib/commands/hosting-channel-create.js +12 -12
  51. package/lib/commands/hosting-channel-delete.js +9 -9
  52. package/lib/commands/hosting-channel-deploy.js +17 -17
  53. package/lib/commands/hosting-channel-list.js +5 -5
  54. package/lib/commands/hosting-channel-open.js +9 -9
  55. package/lib/commands/hosting-clone.js +15 -15
  56. package/lib/commands/hosting-disable.js +4 -4
  57. package/lib/commands/hosting-sites-create.js +7 -7
  58. package/lib/commands/hosting-sites-delete.js +7 -7
  59. package/lib/commands/hosting-sites-get.js +2 -2
  60. package/lib/commands/hosting-sites-list.js +3 -3
  61. package/lib/commands/index.js +1 -0
  62. package/lib/commands/login.js +2 -2
  63. package/lib/commands/logout.js +1 -1
  64. package/lib/commands/open.js +1 -1
  65. package/lib/commands/projects-addfirebase.js +2 -2
  66. package/lib/commands/projects-create.js +2 -2
  67. package/lib/commands/projects-list.js +1 -1
  68. package/lib/commands/remoteconfig-get.js +3 -3
  69. package/lib/commands/remoteconfig-rollback.js +3 -3
  70. package/lib/commands/remoteconfig-versions-list.js +1 -1
  71. package/lib/commands/setup-emulators-storage.js +1 -1
  72. package/lib/config.js +6 -6
  73. package/lib/database/api.js +2 -2
  74. package/lib/deploy/extensions/deploy.js +4 -4
  75. package/lib/deploy/extensions/deploymentSummary.js +5 -4
  76. package/lib/deploy/extensions/index.js +1 -0
  77. package/lib/deploy/extensions/params.js +1 -1
  78. package/lib/deploy/extensions/planner.js +3 -3
  79. package/lib/deploy/extensions/prepare.js +9 -9
  80. package/lib/deploy/extensions/release.js +1 -1
  81. package/lib/deploy/extensions/secrets.js +7 -7
  82. package/lib/deploy/extensions/validate.js +2 -2
  83. package/lib/deploy/functions/backend.js +6 -4
  84. package/lib/deploy/functions/checkIam.js +7 -7
  85. package/lib/deploy/functions/containerCleaner.js +3 -3
  86. package/lib/deploy/functions/deploy.js +10 -11
  87. package/lib/deploy/functions/ensureCloudBuildEnabled.js +3 -3
  88. package/lib/deploy/functions/index.js +1 -0
  89. package/lib/deploy/functions/prepare.js +13 -13
  90. package/lib/deploy/functions/prompts.js +5 -5
  91. package/lib/deploy/functions/release/executor.js +4 -1
  92. package/lib/deploy/functions/release/fabricator.js +5 -5
  93. package/lib/deploy/functions/release/index.js +3 -3
  94. package/lib/deploy/functions/release/planner.js +6 -6
  95. package/lib/deploy/functions/release/reporter.js +8 -4
  96. package/lib/deploy/functions/runtimes/discovery/index.js +2 -2
  97. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +14 -14
  98. package/lib/deploy/functions/runtimes/golang/index.js +6 -6
  99. package/lib/deploy/functions/runtimes/node/index.js +3 -3
  100. package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +1 -1
  101. package/lib/deploy/functions/runtimes/node/parseTriggers.js +3 -3
  102. package/lib/deploy/functions/services/storage.js +1 -1
  103. package/lib/deploy/functions/triggerRegionHelper.js +1 -1
  104. package/lib/deploy/hosting/deploy.js +7 -7
  105. package/lib/deploy/hosting/uploader.js +1 -1
  106. package/lib/deploy/hosting/validate.js +3 -3
  107. package/lib/deploy/remoteconfig/prepare.js +3 -3
  108. package/lib/deploy/remoteconfig/release.js +3 -3
  109. package/lib/deploy/storage/deploy.js +1 -1
  110. package/lib/deploy/storage/release.js +2 -2
  111. package/lib/detectProjectRoot.js +5 -5
  112. package/lib/emulator/auth/apiSpec.js +13 -7
  113. package/lib/emulator/auth/handlers.js +3 -3
  114. package/lib/emulator/auth/index.js +1 -1
  115. package/lib/emulator/auth/operations.js +256 -248
  116. package/lib/emulator/auth/server.js +11 -8
  117. package/lib/emulator/auth/state.js +12 -12
  118. package/lib/emulator/auth/widget_ui.js +1 -1
  119. package/lib/emulator/commandUtils.js +5 -5
  120. package/lib/emulator/controller.js +16 -11
  121. package/lib/emulator/downloadableEmulators.js +7 -7
  122. package/lib/emulator/emulatorLogger.js +1 -1
  123. package/lib/emulator/functionsEmulator.js +101 -74
  124. package/lib/emulator/functionsEmulatorRuntime.js +33 -18
  125. package/lib/emulator/functionsEmulatorShell.js +3 -2
  126. package/lib/emulator/functionsRuntimeWorker.js +1 -1
  127. package/lib/emulator/hubExport.js +2 -2
  128. package/lib/emulator/storage/apis/firebase.js +2 -2
  129. package/lib/emulator/storage/apis/gcloud.js +2 -2
  130. package/lib/emulator/storage/cloudFunctions.js +1 -1
  131. package/lib/emulator/storage/files.js +14 -14
  132. package/lib/emulator/storage/index.js +2 -2
  133. package/lib/emulator/storage/metadata.js +7 -6
  134. package/lib/emulator/storage/rules/runtime.js +5 -5
  135. package/lib/emulator/storage/server.js +2 -2
  136. package/lib/ensureApiEnabled.js +7 -7
  137. package/lib/error.js +3 -3
  138. package/lib/extensions/askUserForConsent.js +2 -3
  139. package/lib/extensions/askUserForParam.js +10 -10
  140. package/lib/extensions/billingMigrationHelper.js +1 -1
  141. package/lib/extensions/changelog.js +3 -3
  142. package/lib/extensions/displayExtensionInfo.js +5 -5
  143. package/lib/extensions/emulator/optionsHelper.js +1 -1
  144. package/lib/extensions/emulator/specHelper.js +1 -1
  145. package/lib/extensions/emulator/triggerHelper.js +1 -1
  146. package/lib/extensions/export.js +6 -6
  147. package/lib/extensions/extensionsApi.js +14 -1
  148. package/lib/extensions/extensionsHelper.js +38 -29
  149. package/lib/extensions/listExtensions.js +1 -1
  150. package/lib/extensions/localHelper.js +1 -1
  151. package/lib/extensions/metricsTypeDef.js +2 -0
  152. package/lib/extensions/metricsUtils.js +98 -0
  153. package/lib/extensions/paramHelper.js +6 -6
  154. package/lib/extensions/provisioningHelper.js +6 -4
  155. package/lib/extensions/resolveSource.js +1 -1
  156. package/lib/extensions/secretsUtils.js +3 -3
  157. package/lib/extensions/updateHelper.js +9 -9
  158. package/lib/extensions/utils.js +1 -1
  159. package/lib/extensions/warnings.js +10 -9
  160. package/lib/fetchWebSetup.js +2 -2
  161. package/lib/filterTargets.js +2 -2
  162. package/lib/firestore/indexes.js +2 -2
  163. package/lib/fsAsync.js +3 -3
  164. package/lib/fsutils.js +2 -2
  165. package/lib/functional.js +2 -1
  166. package/lib/functions/env.js +1 -1
  167. package/lib/functions/runtimeConfigExport.js +4 -4
  168. package/lib/functionsConfig.js +3 -3
  169. package/lib/functionsShellCommandAction.js +4 -3
  170. package/lib/gcp/cloudmonitoring.js +74 -0
  171. package/lib/gcp/cloudscheduler.js +1 -1
  172. package/lib/gcp/iam.js +2 -2
  173. package/lib/gcp/resourceManager.js +2 -2
  174. package/lib/gcp/secretManager.js +3 -2
  175. package/lib/getDefaultDatabaseInstance.js +1 -1
  176. package/lib/getDefaultHostingSite.js +1 -1
  177. package/lib/getProjectNumber.js +2 -2
  178. package/lib/handlePreviewToggles.js +5 -5
  179. package/lib/hosting/api.js +6 -6
  180. package/lib/hosting/cloudRunProxy.js +6 -6
  181. package/lib/hosting/functionsProxy.js +3 -3
  182. package/lib/hosting/implicitInit.js +2 -2
  183. package/lib/hosting/normalizedHostingConfigs.js +3 -3
  184. package/lib/hosting/proxy.js +2 -2
  185. package/lib/init/features/account.js +7 -7
  186. package/lib/init/features/database.js +9 -9
  187. package/lib/init/features/emulators.js +8 -8
  188. package/lib/init/features/firestore/index.js +3 -3
  189. package/lib/init/features/firestore/indexes.js +2 -2
  190. package/lib/init/features/firestore/rules.js +2 -2
  191. package/lib/init/features/functions/golang.js +4 -4
  192. package/lib/init/features/functions/index.js +4 -4
  193. package/lib/init/features/hosting/github.js +31 -31
  194. package/lib/init/features/project.js +8 -8
  195. package/lib/init/features/remoteconfig.js +2 -2
  196. package/lib/init/features/storage.js +2 -2
  197. package/lib/listFiles.js +1 -1
  198. package/lib/management/apps.js +3 -3
  199. package/lib/management/projects.js +6 -6
  200. package/lib/previews.js +2 -2
  201. package/lib/profiler.js +1 -1
  202. package/lib/projectPath.js +1 -1
  203. package/lib/projectUtils.js +1 -1
  204. package/lib/prompt.js +0 -1
  205. package/lib/rc.js +1 -1
  206. package/lib/requireAuth.js +2 -2
  207. package/lib/requireDatabaseInstance.js +1 -1
  208. package/lib/requireHostingSite.js +1 -1
  209. package/lib/requirePermissions.js +4 -4
  210. package/lib/rulesDeploy.js +2 -2
  211. package/lib/serve/functions.js +14 -7
  212. package/lib/serve/hosting.js +7 -7
  213. package/lib/utils.js +3 -2
  214. package/npm-shrinkwrap.json +24926 -0
  215. package/package.json +24 -24
  216. package/standalone/firepit.js +4 -4
  217. package/templates/init/functions/javascript/package.lint.json +1 -1
  218. package/templates/init/functions/javascript/package.nolint.json +1 -1
  219. package/templates/init/functions/typescript/package.lint.json +1 -1
  220. package/templates/init/functions/typescript/package.nolint.json +1 -1
  221. package/templates/init/hosting/index.html +1 -1
  222. package/CHANGELOG.md +0 -7
@@ -9,8 +9,8 @@ function backendFromV1Alpha1(yaml, project, region, runtime) {
9
9
  const manifest = JSON.parse(JSON.stringify(yaml));
10
10
  const bkend = backend.empty();
11
11
  bkend.requiredAPIs = parseRequiredAPIs(manifest);
12
- parsing_1.requireKeys("", manifest, "endpoints");
13
- parsing_1.assertKeyTypes("", manifest, {
12
+ (0, parsing_1.requireKeys)("", manifest, "endpoints");
13
+ (0, parsing_1.assertKeyTypes)("", manifest, {
14
14
  specVersion: "string",
15
15
  requiredAPIs: "object",
16
16
  endpoints: "object",
@@ -41,7 +41,7 @@ function parseEndpoints(manifest, id, project, defaultRegion, runtime) {
41
41
  const allParsed = [];
42
42
  const prefix = `endpoints[${id}]`;
43
43
  const ep = manifest.endpoints[id];
44
- parsing_1.assertKeyTypes(prefix, ep, {
44
+ (0, parsing_1.assertKeyTypes)(prefix, ep, {
45
45
  region: "array",
46
46
  platform: "string",
47
47
  entryPoint: "string",
@@ -83,8 +83,8 @@ function parseEndpoints(manifest, id, project, defaultRegion, runtime) {
83
83
  for (const region of ep.region || [defaultRegion]) {
84
84
  let triggered;
85
85
  if (backend.isEventTriggered(ep)) {
86
- parsing_1.requireKeys(prefix + ".eventTrigger", ep.eventTrigger, "eventType", "eventFilters");
87
- parsing_1.assertKeyTypes(prefix + ".eventTrigger", ep.eventTrigger, {
86
+ (0, parsing_1.requireKeys)(prefix + ".eventTrigger", ep.eventTrigger, "eventType", "eventFilters");
87
+ (0, parsing_1.assertKeyTypes)(prefix + ".eventTrigger", ep.eventTrigger, {
88
88
  eventFilters: "object",
89
89
  eventType: "string",
90
90
  retry: "boolean",
@@ -94,19 +94,19 @@ function parseEndpoints(manifest, id, project, defaultRegion, runtime) {
94
94
  triggered = { eventTrigger: ep.eventTrigger };
95
95
  }
96
96
  else if (backend.isHttpsTriggered(ep)) {
97
- parsing_1.assertKeyTypes(prefix + ".httpsTrigger", ep.httpsTrigger, {
97
+ (0, parsing_1.assertKeyTypes)(prefix + ".httpsTrigger", ep.httpsTrigger, {
98
98
  invoker: "array",
99
99
  });
100
100
  triggered = { httpsTrigger: {} };
101
- proto_1.copyIfPresent(triggered.httpsTrigger, ep.httpsTrigger, "invoker");
101
+ (0, proto_1.copyIfPresent)(triggered.httpsTrigger, ep.httpsTrigger, "invoker");
102
102
  }
103
103
  else if (backend.isScheduleTriggered(ep)) {
104
- parsing_1.assertKeyTypes(prefix + ".scheduleTrigger", ep.scheduleTrigger, {
104
+ (0, parsing_1.assertKeyTypes)(prefix + ".scheduleTrigger", ep.scheduleTrigger, {
105
105
  schedule: "string",
106
106
  timeZone: "string",
107
107
  retryConfig: "object",
108
108
  });
109
- parsing_1.assertKeyTypes(prefix + ".scheduleTrigger.retryConfig", ep.scheduleTrigger.retryConfig, {
109
+ (0, parsing_1.assertKeyTypes)(prefix + ".scheduleTrigger.retryConfig", ep.scheduleTrigger.retryConfig, {
110
110
  retryCount: "number",
111
111
  maxDoublings: "number",
112
112
  minBackoffDuration: "string",
@@ -116,20 +116,20 @@ function parseEndpoints(manifest, id, project, defaultRegion, runtime) {
116
116
  triggered = { scheduleTrigger: ep.scheduleTrigger };
117
117
  }
118
118
  else if (backend.isTaskQueueTriggered(ep)) {
119
- parsing_1.assertKeyTypes(prefix + ".taskQueueTrigger", ep.taskQueueTrigger, {
119
+ (0, parsing_1.assertKeyTypes)(prefix + ".taskQueueTrigger", ep.taskQueueTrigger, {
120
120
  rateLimits: "object",
121
121
  retryConfig: "object",
122
122
  invoker: "array",
123
123
  });
124
124
  if (ep.taskQueueTrigger.rateLimits) {
125
- parsing_1.assertKeyTypes(prefix + ".taskQueueTrigger.rateLimits", ep.taskQueueTrigger.rateLimits, {
125
+ (0, parsing_1.assertKeyTypes)(prefix + ".taskQueueTrigger.rateLimits", ep.taskQueueTrigger.rateLimits, {
126
126
  maxBurstSize: "number",
127
127
  maxConcurrentDispatches: "number",
128
128
  maxDispatchesPerSecond: "number",
129
129
  });
130
130
  }
131
131
  if (ep.taskQueueTrigger.retryConfig) {
132
- parsing_1.assertKeyTypes(prefix + ".taskQueueTrigger.retryConfig", ep.taskQueueTrigger.retryConfig, {
132
+ (0, parsing_1.assertKeyTypes)(prefix + ".taskQueueTrigger.retryConfig", ep.taskQueueTrigger.retryConfig, {
133
133
  maxAttempts: "number",
134
134
  maxRetryDuration: "string",
135
135
  minBackoff: "string",
@@ -143,12 +143,12 @@ function parseEndpoints(manifest, id, project, defaultRegion, runtime) {
143
143
  throw new error_1.FirebaseError(`Do not recognize trigger type for endpoint ${id}. Try upgrading ` +
144
144
  "firebase-tools with npm install -g firebase-tools@latest");
145
145
  }
146
- parsing_1.requireKeys(prefix, ep, "entryPoint");
146
+ (0, parsing_1.requireKeys)(prefix, ep, "entryPoint");
147
147
  const parsed = Object.assign({ platform: ep.platform || "gcfv2", id,
148
148
  region,
149
149
  project,
150
150
  runtime, entryPoint: ep.entryPoint }, triggered);
151
- proto_1.copyIfPresent(parsed, ep, "availableMemoryMb", "maxInstances", "minInstances", "concurrency", "serviceAccountEmail", "timeout", "vpcConnector", "vpcConnectorEgressSettings", "labels", "ingressSettings", "environmentVariables");
151
+ (0, proto_1.copyIfPresent)(parsed, ep, "availableMemoryMb", "maxInstances", "minInstances", "concurrency", "serviceAccountEmail", "timeout", "vpcConnector", "vpcConnectorEgressSettings", "labels", "ingressSettings", "environmentVariables");
152
152
  allParsed.push(parsed);
153
153
  }
154
154
  return allParsed;
@@ -23,10 +23,10 @@ async function tryCreateDelegate(context, options) {
23
23
  const relativeSourceDir = options.config.get("functions.source");
24
24
  const sourceDir = options.config.path(relativeSourceDir);
25
25
  const goModPath = path.join(sourceDir, "go.mod");
26
- const projectId = projectUtils_1.needProjectId(options);
26
+ const projectId = (0, projectUtils_1.needProjectId)(options);
27
27
  let module;
28
28
  try {
29
- const modBuffer = await util_1.promisify(fs.readFile)(goModPath);
29
+ const modBuffer = await (0, util_1.promisify)(fs.readFile)(goModPath);
30
30
  module = gomod.parseModule(modBuffer.toString("utf8"));
31
31
  }
32
32
  catch (err) {
@@ -59,7 +59,7 @@ class Delegate {
59
59
  }
60
60
  async build() {
61
61
  try {
62
- await util_1.promisify(fs.mkdir)(path.join(this.sourceDir, "autogen"));
62
+ await (0, util_1.promisify)(fs.mkdir)(path.join(this.sourceDir, "autogen"));
63
63
  }
64
64
  catch (err) {
65
65
  if ((err === null || err === void 0 ? void 0 : err.code) !== "EEXIST") {
@@ -80,7 +80,7 @@ class Delegate {
80
80
  children: [new Error(genBinary.stderr.toString())],
81
81
  });
82
82
  }
83
- await util_1.promisify(fs.writeFile)(path.join(this.sourceDir, "autogen", "main.go"), genBinary.stdout);
83
+ await (0, util_1.promisify)(fs.writeFile)(path.join(this.sourceDir, "autogen", "main.go"), genBinary.stdout);
84
84
  }
85
85
  watch() {
86
86
  return Promise.resolve(() => Promise.resolve());
@@ -99,7 +99,7 @@ class Delegate {
99
99
  childProcess.once("exit", resolve);
100
100
  childProcess.once("error", reject);
101
101
  });
102
- await node_fetch_1.default(`http://localhost:${adminPort}/quitquitquit`);
102
+ await (0, node_fetch_1.default)(`http://localhost:${adminPort}/quitquitquit`);
103
103
  setTimeout(() => {
104
104
  if (!childProcess.killed) {
105
105
  childProcess.kill("SIGKILL");
@@ -111,7 +111,7 @@ class Delegate {
111
111
  async discoverSpec(configValues, envs) {
112
112
  let discovered = await discovery.detectFromYaml(this.sourceDir, this.projectId, this.runtime);
113
113
  if (!discovered) {
114
- const getPort = util_1.promisify(portfinder.getPort);
114
+ const getPort = (0, util_1.promisify)(portfinder.getPort);
115
115
  const port = await getPort();
116
116
  portfinder.basePort = port + 1;
117
117
  const adminPort = await getPort();
@@ -15,17 +15,17 @@ async function tryCreateDelegate(context, options) {
15
15
  const projectRelativeSourceDir = options.config.get("functions.source");
16
16
  const sourceDir = options.config.path(projectRelativeSourceDir);
17
17
  const packageJsonPath = path.join(sourceDir, "package.json");
18
- if (!(await util_1.promisify(fs.exists)(packageJsonPath))) {
18
+ if (!(await (0, util_1.promisify)(fs.exists)(packageJsonPath))) {
19
19
  logger_1.logger.debug("Customer code is not Node");
20
20
  return undefined;
21
21
  }
22
22
  let runtime = options.config.get("functions.runtime") || "";
23
- runtime = parseRuntimeAndValidateSDK_1.getRuntimeChoice(sourceDir, runtime);
23
+ runtime = (0, parseRuntimeAndValidateSDK_1.getRuntimeChoice)(sourceDir, runtime);
24
24
  if (!runtime.startsWith("nodejs")) {
25
25
  logger_1.logger.debug("Customer has a package.json but did not get a nodejs runtime. This should not happen");
26
26
  throw new error_1.FirebaseError(`Unexpected runtime ${runtime}`);
27
27
  }
28
- return new Delegate(projectUtils_1.needProjectId(options), options.config.projectDir, sourceDir, runtime);
28
+ return new Delegate((0, projectUtils_1.needProjectId)(options), options.config.projectDir, sourceDir, runtime);
29
29
  }
30
30
  exports.tryCreateDelegate = tryCreateDelegate;
31
31
  class Delegate {
@@ -18,7 +18,7 @@ const ENGINE_RUNTIMES = {
18
18
  const ENGINE_RUNTIMES_NAMES = Object.values(ENGINE_RUNTIMES);
19
19
  exports.RUNTIME_NOT_SET = "`runtime` field is required but was not found in firebase.json.\n" +
20
20
  "To fix this, add the following lines to the `functions` section of your firebase.json:\n" +
21
- '"runtime": "nodejs14"\n';
21
+ '"runtime": "nodejs16"\n';
22
22
  exports.UNSUPPORTED_NODE_VERSION_FIREBASE_JSON_MSG = clc.bold(`functions.runtime value is unsupported. ` +
23
23
  `Valid choices are: ${clc.bold("nodejs{10|12|14|16}")}.`);
24
24
  exports.UNSUPPORTED_NODE_VERSION_PACKAGE_JSON_MSG = clc.bold(`package.json in functions directory has an engines field which is unsupported. ` +
@@ -25,7 +25,7 @@ function parseTriggers(projectId, sourceDir, configValues, envs) {
25
25
  if (env.NODE_OPTIONS) {
26
26
  env.NODE_OPTIONS = removeInspectOptions(env.NODE_OPTIONS.split(" ")).join(" ");
27
27
  }
28
- const parser = child_process_1.fork(TRIGGER_PARSER, [sourceDir], {
28
+ const parser = (0, child_process_1.fork)(TRIGGER_PARSER, [sourceDir], {
29
29
  silent: true,
30
30
  env: env,
31
31
  execArgv: execArgv,
@@ -100,9 +100,9 @@ function addResourcesToBackend(projectId, runtime, annotation, want) {
100
100
  }
101
101
  }
102
102
  const endpoint = Object.assign({ platform: annotation.platform || "gcfv1", id: annotation.name, region: region, project: projectId, entryPoint: annotation.entryPoint, runtime: runtime }, triggered);
103
- if (annotation.vpcConnector) {
103
+ if (annotation.vpcConnector != null) {
104
104
  let maybeId = annotation.vpcConnector;
105
- if (!maybeId.includes("/")) {
105
+ if (maybeId && !maybeId.includes("/")) {
106
106
  maybeId = `projects/${projectId}/locations/${region}/connectors/${maybeId}`;
107
107
  }
108
108
  endpoint.vpcConnector = maybeId;
@@ -36,7 +36,7 @@ async function ensureStorageTriggerRegion(endpoint, eventTrigger) {
36
36
  }
37
37
  if (endpoint.region !== eventTrigger.region &&
38
38
  eventTrigger.region !== "us-central1" &&
39
- !location_1.regionInLocation(endpoint.region, eventTrigger.region)) {
39
+ !(0, location_1.regionInLocation)(endpoint.region, eventTrigger.region)) {
40
40
  throw new error_1.FirebaseError(`A function in region ${endpoint.region} cannot listen to a bucket in region ${eventTrigger.region}`);
41
41
  }
42
42
  }
@@ -9,7 +9,7 @@ async function ensureTriggerRegions(want) {
9
9
  if (ep.platform === "gcfv1" || !backend.isEventTriggered(ep)) {
10
10
  continue;
11
11
  }
12
- regionLookups.push(services_1.serviceForEndpoint(ep).ensureTriggerRegion(ep, ep.eventTrigger));
12
+ regionLookups.push((0, services_1.serviceForEndpoint)(ep).ensureTriggerRegion(ep, ep.eventTrigger));
13
13
  }
14
14
  await Promise.all(regionLookups);
15
15
  }
@@ -18,7 +18,7 @@ async function deploy(context, options) {
18
18
  let spins = 0;
19
19
  function updateSpinner(newMessage, debugging) {
20
20
  if (debugging) {
21
- utils_1.logLabeledBullet("hosting", newMessage);
21
+ (0, utils_1.logLabeledBullet)("hosting", newMessage);
22
22
  }
23
23
  else {
24
24
  process.stdout.write(_ERASE_LINE + clc.move(-9999, 0));
@@ -33,20 +33,20 @@ async function deploy(context, options) {
33
33
  return;
34
34
  }
35
35
  if (!((_a = deploy.config) === null || _a === void 0 ? void 0 : _a.public)) {
36
- utils_1.logLabeledBullet(`hosting[${deploy.site}]`, 'no "public" directory to upload, continuing with release');
36
+ (0, utils_1.logLabeledBullet)(`hosting[${deploy.site}]`, 'no "public" directory to upload, continuing with release');
37
37
  return runDeploys(deploys, debugging);
38
38
  }
39
- utils_1.logLabeledBullet("hosting[" + deploy.site + "]", "beginning deploy...");
39
+ (0, utils_1.logLabeledBullet)("hosting[" + deploy.site + "]", "beginning deploy...");
40
40
  const t0 = Date.now();
41
41
  const publicDir = options.config.path(deploy.config.public);
42
- const files = listFiles_1.listFiles(publicDir, deploy.config.ignore);
43
- utils_1.logLabeledBullet(`hosting[${deploy.site}]`, `found ${files.length} files in ${clc.bold(deploy.config.public)}`);
42
+ const files = (0, listFiles_1.listFiles)(publicDir, deploy.config.ignore);
43
+ (0, utils_1.logLabeledBullet)(`hosting[${deploy.site}]`, `found ${files.length} files in ${clc.bold(deploy.config.public)}`);
44
44
  const uploader = new uploader_1.Uploader({
45
45
  version: deploy.version,
46
46
  files: files,
47
47
  public: publicDir,
48
48
  cwd: options.cwd,
49
- projectRoot: detectProjectRoot_1.detectProjectRoot(options),
49
+ projectRoot: (0, detectProjectRoot_1.detectProjectRoot)(options),
50
50
  });
51
51
  const progressInterval = setInterval(() => updateSpinner(uploader.statusMessage(), debugging), debugging ? 2000 : 200);
52
52
  try {
@@ -62,7 +62,7 @@ async function deploy(context, options) {
62
62
  if (!debugging) {
63
63
  process.stdout.write(_ERASE_LINE + clc.move(-9999, 0));
64
64
  }
65
- utils_1.logLabeledSuccess("hosting[" + deploy.site + "]", "file upload complete");
65
+ (0, utils_1.logLabeledSuccess)("hosting[" + deploy.site + "]", "file upload complete");
66
66
  const dt = Date.now() - t0;
67
67
  logger_1.logger.debug("[hosting] deploy completed after " + dt + "ms");
68
68
  track("Hosting Deploy", "success", dt);
@@ -145,7 +145,7 @@ class Uploader {
145
145
  this.hashMap[hash] = filePath;
146
146
  this.pathMap[filePath] = hash;
147
147
  this.populateBatch["/" + filePath] = hash;
148
- const curBatchSize = lodash_1.size(this.populateBatch);
148
+ const curBatchSize = (0, lodash_1.size)(this.populateBatch);
149
149
  if (curBatchSize > 0 && curBatchSize % this.populateBatchSize === 0) {
150
150
  this.queuePopulate();
151
151
  }
@@ -20,7 +20,7 @@ function validateDeploy(deploy, options) {
20
20
  if (!hasPublicDir && !hasAnyDynamicRewrites && !hasAnyRedirects) {
21
21
  throw new error_1.FirebaseError('Must supply a "public" directory or at least one rewrite or redirect in each "hosting" config.');
22
22
  }
23
- if (hasPublicDir && !fsutils_1.dirExistsSync(projectPath_1.resolveProjectPath(options, cfg.public))) {
23
+ if (hasPublicDir && !(0, fsutils_1.dirExistsSync)((0, projectPath_1.resolveProjectPath)(options, cfg.public))) {
24
24
  throw new error_1.FirebaseError(`Specified "public" directory "${cfg.public}" does not exist, can't deploy hosting to site "${deploy.site}"`);
25
25
  }
26
26
  if (cfg.i18n) {
@@ -32,8 +32,8 @@ function validateDeploy(deploy, options) {
32
32
  }
33
33
  else {
34
34
  const i18nPath = path.join(cfg.public, cfg.i18n.root);
35
- if (!fsutils_1.dirExistsSync(projectPath_1.resolveProjectPath(options, i18nPath))) {
36
- utils_1.logLabeledWarning("hosting", `Couldn't find specified i18n root directory ${clc.bold(cfg.i18n.root)} in public directory ${clc.bold(cfg.public)}.`);
35
+ if (!(0, fsutils_1.dirExistsSync)((0, projectPath_1.resolveProjectPath)(options, i18nPath))) {
36
+ (0, utils_1.logLabeledWarning)("hosting", `Couldn't find specified i18n root directory ${clc.bold(cfg.i18n.root)} in public directory ${clc.bold(cfg.public)}.`);
37
37
  }
38
38
  }
39
39
  }
@@ -14,9 +14,9 @@ async function default_1(context, options) {
14
14
  return;
15
15
  }
16
16
  const template = loadCJSON(filePath);
17
- const projectNumber = await projectUtils_1.needProjectNumber(options);
18
- template.etag = await functions_1.getEtag(projectNumber);
19
- functions_2.validateInputRemoteConfigTemplate(template);
17
+ const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
18
+ template.etag = await (0, functions_1.getEtag)(projectNumber);
19
+ (0, functions_2.validateInputRemoteConfigTemplate)(template);
20
20
  context.remoteconfigTemplate = template;
21
21
  return;
22
22
  }
@@ -7,8 +7,8 @@ async function default_1(context, options) {
7
7
  return;
8
8
  }
9
9
  const template = context.remoteconfigTemplate;
10
- const projectNumber = await projectUtils_1.needProjectNumber(options);
11
- const etag = await functions_1.getEtag(projectNumber);
12
- return functions_1.publishTemplate(projectNumber, template, etag, options);
10
+ const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
11
+ const etag = await (0, functions_1.getEtag)(projectNumber);
12
+ return (0, functions_1.publishTemplate)(projectNumber, template, etag, options);
13
13
  }
14
14
  exports.default = default_1;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const lodash_1 = require("lodash");
4
4
  const rulesDeploy_1 = require("../../rulesDeploy");
5
5
  async function default_1(context) {
6
- const rulesDeploy = lodash_1.get(context, "storage.rulesDeploy");
6
+ const rulesDeploy = (0, lodash_1.get)(context, "storage.rulesDeploy");
7
7
  if (!rulesDeploy) {
8
8
  return;
9
9
  }
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const lodash_1 = require("lodash");
4
4
  const rulesDeploy_1 = require("../../rulesDeploy");
5
5
  async function default_1(context, options) {
6
- const rules = lodash_1.get(context, "storage.rules", []);
7
- const rulesDeploy = lodash_1.get(context, "storage.rulesDeploy");
6
+ const rules = (0, lodash_1.get)(context, "storage.rules", []);
7
+ const rulesDeploy = (0, lodash_1.get)(context, "storage.rulesDeploy");
8
8
  if (!rules.length || !rulesDeploy) {
9
9
  return;
10
10
  }
@@ -7,14 +7,14 @@ const path_1 = require("path");
7
7
  function detectProjectRoot(options) {
8
8
  let projectRootDir = options.cwd || process.cwd();
9
9
  if (options.configPath) {
10
- const fullPath = path_1.resolve(projectRootDir, options.configPath);
11
- if (!fsutils_1.fileExistsSync(fullPath)) {
10
+ const fullPath = (0, path_1.resolve)(projectRootDir, options.configPath);
11
+ if (!(0, fsutils_1.fileExistsSync)(fullPath)) {
12
12
  throw new error_1.FirebaseError(`Could not load config file ${options.configPath}.`, { exit: 1 });
13
13
  }
14
- return path_1.dirname(fullPath);
14
+ return (0, path_1.dirname)(fullPath);
15
15
  }
16
- while (!fsutils_1.fileExistsSync(path_1.resolve(projectRootDir, "./firebase.json"))) {
17
- const parentDir = path_1.dirname(projectRootDir);
16
+ while (!(0, fsutils_1.fileExistsSync)((0, path_1.resolve)(projectRootDir, "./firebase.json"))) {
17
+ const parentDir = (0, path_1.dirname)(projectRootDir);
18
18
  if (parentDir === projectRootDir) {
19
19
  return null;
20
20
  }
@@ -4191,7 +4191,7 @@ exports.default = {
4191
4191
  type: "string",
4192
4192
  },
4193
4193
  email: {
4194
- description: "The account's email address to send the OOB code to, and generally the email address of the account that needs to be updated. Required for PASSWORD_RESET, EMAIL_SIGNIN, and VERIFY_EMAIL.",
4194
+ description: "The account's email address to send the OOB code to, and generally the email address of the account that needs to be updated. Required for PASSWORD_RESET, EMAIL_SIGNIN, and VERIFY_EMAIL. Only required for VERIFY_AND_CHANGE_EMAIL requests when return_oob_link is set to true. In this case, it is the original email of the user.",
4195
4195
  type: "string",
4196
4196
  },
4197
4197
  iOSAppStoreId: {
@@ -4202,10 +4202,16 @@ exports.default = {
4202
4202
  description: "If an associated iOS app can handle the OOB code, the iOS bundle id of this app. This will allow the correct app to open if it is already installed.",
4203
4203
  type: "string",
4204
4204
  },
4205
- idToken: { type: "string" },
4206
- newEmail: { type: "string" },
4205
+ idToken: {
4206
+ description: "An ID token for the account. It is required for VERIFY_AND_CHANGE_EMAIL and VERIFY_EMAIL requests unless return_oob_link is set to true.",
4207
+ type: "string",
4208
+ },
4209
+ newEmail: {
4210
+ description: "The email address the account is being updated to. Required only for VERIFY_AND_CHANGE_EMAIL requests.",
4211
+ type: "string",
4212
+ },
4207
4213
  requestType: {
4208
- description: "Required. The type of out-of-band (OOB) code to send. Depending on this value, other fields in this request will be required and/or have different meanings. There are 3 different OOB codes that can be sent: * PASSWORD_RESET * EMAIL_SIGNIN * VERIFY_EMAIL",
4214
+ description: "Required. The type of out-of-band (OOB) code to send. Depending on this value, other fields in this request will be required and/or have different meanings. There are 4 different OOB codes that can be sent: * PASSWORD_RESET * EMAIL_SIGNIN * VERIFY_EMAIL * VERIFY_AND_CHANGE_EMAIL",
4209
4215
  enum: [
4210
4216
  "OOB_REQ_TYPE_UNSPECIFIED",
4211
4217
  "PASSWORD_RESET",
@@ -5198,7 +5204,7 @@ exports.default = {
5198
5204
  properties: {
5199
5205
  captchaChallenge: { type: "string" },
5200
5206
  captchaResponse: {
5201
- description: "The response from a reCaptcha challenge. A recaptcha response is required when the service detects possible abuse activity.",
5207
+ description: "The reCAPTCHA token provided by the reCAPTCHA client-side integration. reCAPTCHA Enterprise uses it for risk assessment. Required when reCAPTCHA Enterprise is enabled.",
5202
5208
  type: "string",
5203
5209
  },
5204
5210
  delegatedProjectNumber: { format: "int64", type: "string" },
@@ -5363,7 +5369,7 @@ exports.default = {
5363
5369
  properties: {
5364
5370
  captchaChallenge: { type: "string" },
5365
5371
  captchaResponse: {
5366
- description: "The response from a reCaptcha challenge. A reCaptcha response is required when the service detects potential abuse activity.",
5372
+ description: "The reCAPTCHA token provided by the reCAPTCHA client-side integration. reCAPTCHA Enterprise uses it for assessment. Required when reCAPTCHA enterprise is enabled.",
5367
5373
  type: "string",
5368
5374
  },
5369
5375
  disabled: {
@@ -6720,7 +6726,7 @@ exports.default = {
6720
6726
  description: "Encapsulates settings provided to GetIamPolicy.",
6721
6727
  properties: {
6722
6728
  requestedPolicyVersion: {
6723
- description: "Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).",
6729
+ description: "Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).",
6724
6730
  format: "int32",
6725
6731
  type: "integer",
6726
6732
  },
@@ -38,7 +38,7 @@ function registerHandlers(app, getProjectStateByApiKey) {
38
38
  });
39
39
  }
40
40
  try {
41
- const resp = operations_1.setAccountInfoImpl(state, {
41
+ const resp = (0, operations_1.setAccountInfoImpl)(state, {
42
42
  oobCode,
43
43
  });
44
44
  const email = resp.email;
@@ -91,7 +91,7 @@ function registerHandlers(app, getProjectStateByApiKey) {
91
91
  },
92
92
  });
93
93
  }
94
- const { email } = operations_1.resetPassword(state, {
94
+ const { email } = (0, operations_1.resetPassword)(state, {
95
95
  oobCode,
96
96
  newPassword: req.query.newPassword,
97
97
  });
@@ -106,7 +106,7 @@ function registerHandlers(app, getProjectStateByApiKey) {
106
106
  }
107
107
  case "verifyEmail": {
108
108
  try {
109
- const { email } = operations_1.setAccountInfoImpl(state, { oobCode });
109
+ const { email } = (0, operations_1.setAccountInfoImpl)(state, { oobCode });
110
110
  if (continueUrl) {
111
111
  return res.redirect(303, continueUrl);
112
112
  }
@@ -16,7 +16,7 @@ class AuthEmulator {
16
16
  }
17
17
  async start() {
18
18
  const { host, port } = this.getInfo();
19
- const app = await server_1.createApp(this.args.projectId);
19
+ const app = await (0, server_1.createApp)(this.args.projectId);
20
20
  const server = app.listen(port, host);
21
21
  this.destroyServer = utils.createDestroyer(server);
22
22
  }