firebase-tools 10.0.1 → 10.1.3

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 (254) hide show
  1. package/lib/accountExporter.js +9 -8
  2. package/lib/accountImporter.js +10 -8
  3. package/lib/api.js +1 -0
  4. package/lib/apiv2.js +91 -48
  5. package/lib/appdistribution/client.js +1 -1
  6. package/lib/appdistribution/options-parser-util.js +1 -1
  7. package/lib/archiveDirectory.js +63 -73
  8. package/lib/auth.js +2 -2
  9. package/lib/bin/firebase.js +1 -1
  10. package/lib/command.js +26 -26
  11. package/lib/commands/appdistribution-distribute.js +4 -4
  12. package/lib/commands/appdistribution-testers-add.js +2 -2
  13. package/lib/commands/appdistribution-testers-remove.js +2 -2
  14. package/lib/commands/apps-android-sha-create.js +2 -2
  15. package/lib/commands/apps-android-sha-delete.js +2 -2
  16. package/lib/commands/apps-android-sha-list.js +2 -2
  17. package/lib/commands/apps-create.js +9 -9
  18. package/lib/commands/apps-list.js +3 -3
  19. package/lib/commands/apps-sdkconfig.js +8 -8
  20. package/lib/commands/auth-export.js +26 -25
  21. package/lib/commands/auth-import.js +88 -78
  22. package/lib/commands/database-get.js +1 -1
  23. package/lib/commands/database-instances-create.js +4 -4
  24. package/lib/commands/database-instances-list.js +4 -4
  25. package/lib/commands/database-profile.js +1 -1
  26. package/lib/commands/database-push.js +1 -1
  27. package/lib/commands/database-remove.js +2 -2
  28. package/lib/commands/database-set.js +2 -2
  29. package/lib/commands/database-settings-get.js +1 -1
  30. package/lib/commands/database-settings-set.js +1 -1
  31. package/lib/commands/database-update.js +2 -2
  32. package/lib/commands/ext-configure.js +3 -3
  33. package/lib/commands/ext-dev-deprecate.js +4 -4
  34. package/lib/commands/ext-dev-extension-delete.js +3 -3
  35. package/lib/commands/ext-dev-init.js +4 -4
  36. package/lib/commands/ext-dev-list.js +1 -1
  37. package/lib/commands/ext-dev-publish.js +4 -4
  38. package/lib/commands/ext-dev-register.js +6 -6
  39. package/lib/commands/ext-dev-undeprecate.js +4 -4
  40. package/lib/commands/ext-dev-unpublish.js +3 -3
  41. package/lib/commands/ext-dev-usage.js +140 -0
  42. package/lib/commands/ext-export.js +8 -8
  43. package/lib/commands/ext-info.js +5 -5
  44. package/lib/commands/ext-install.js +27 -23
  45. package/lib/commands/ext-list.js +2 -2
  46. package/lib/commands/ext-sources-create.js +2 -2
  47. package/lib/commands/ext-uninstall.js +4 -4
  48. package/lib/commands/ext-update.js +18 -18
  49. package/lib/commands/ext.js +3 -3
  50. package/lib/commands/firestore-delete.js +1 -1
  51. package/lib/commands/functions-config-clone.js +22 -23
  52. package/lib/commands/functions-config-export.js +11 -11
  53. package/lib/commands/functions-config-get.js +22 -22
  54. package/lib/commands/functions-config-set.js +24 -22
  55. package/lib/commands/functions-config-unset.js +20 -22
  56. package/lib/commands/functions-delete.js +3 -3
  57. package/lib/commands/functions-deletegcfartifacts.js +4 -4
  58. package/lib/commands/functions-list.js +1 -1
  59. package/lib/commands/functions-log.js +1 -1
  60. package/lib/commands/help.js +12 -12
  61. package/lib/commands/hosting-channel-create.js +13 -13
  62. package/lib/commands/hosting-channel-delete.js +10 -10
  63. package/lib/commands/hosting-channel-deploy.js +18 -18
  64. package/lib/commands/hosting-channel-list.js +5 -5
  65. package/lib/commands/hosting-channel-open.js +9 -9
  66. package/lib/commands/hosting-clone.js +16 -16
  67. package/lib/commands/hosting-disable.js +1 -1
  68. package/lib/commands/hosting-sites-create.js +7 -7
  69. package/lib/commands/hosting-sites-delete.js +7 -7
  70. package/lib/commands/hosting-sites-get.js +2 -2
  71. package/lib/commands/hosting-sites-list.js +3 -3
  72. package/lib/commands/index.js +1 -0
  73. package/lib/commands/login-ci.js +10 -10
  74. package/lib/commands/login.js +2 -2
  75. package/lib/commands/logout.js +1 -1
  76. package/lib/commands/open.js +1 -1
  77. package/lib/commands/projects-addfirebase.js +2 -2
  78. package/lib/commands/projects-create.js +2 -2
  79. package/lib/commands/projects-list.js +1 -1
  80. package/lib/commands/remoteconfig-get.js +3 -3
  81. package/lib/commands/remoteconfig-rollback.js +3 -3
  82. package/lib/commands/remoteconfig-versions-list.js +7 -2
  83. package/lib/commands/setup-emulators-database.js +8 -7
  84. package/lib/commands/setup-emulators-firestore.js +8 -7
  85. package/lib/commands/setup-emulators-pubsub.js +5 -4
  86. package/lib/commands/setup-emulators-storage.js +4 -3
  87. package/lib/commands/setup-emulators-ui.js +8 -7
  88. package/lib/commands/target-apply.js +17 -16
  89. package/lib/commands/target-clear.js +11 -10
  90. package/lib/commands/target-remove.js +10 -9
  91. package/lib/commands/target.js +20 -20
  92. package/lib/config.js +6 -6
  93. package/lib/database/api.js +2 -2
  94. package/lib/database/metadata.js +16 -24
  95. package/lib/defaultCredentials.js +3 -3
  96. package/lib/deploy/extensions/deploy.js +4 -4
  97. package/lib/deploy/extensions/deploymentSummary.js +5 -4
  98. package/lib/deploy/extensions/index.js +1 -0
  99. package/lib/deploy/extensions/params.js +1 -1
  100. package/lib/deploy/extensions/planner.js +3 -3
  101. package/lib/deploy/extensions/prepare.js +9 -9
  102. package/lib/deploy/extensions/release.js +1 -1
  103. package/lib/deploy/extensions/secrets.js +7 -7
  104. package/lib/deploy/extensions/validate.js +2 -2
  105. package/lib/deploy/functions/backend.js +9 -5
  106. package/lib/deploy/functions/checkIam.js +7 -7
  107. package/lib/deploy/functions/containerCleaner.js +3 -3
  108. package/lib/deploy/functions/deploy.js +4 -4
  109. package/lib/deploy/functions/ensureCloudBuildEnabled.js +3 -3
  110. package/lib/deploy/functions/index.js +1 -0
  111. package/lib/deploy/functions/prepare.js +29 -23
  112. package/lib/deploy/functions/prompts.js +5 -5
  113. package/lib/deploy/functions/release/executor.js +4 -1
  114. package/lib/deploy/functions/release/fabricator.js +9 -6
  115. package/lib/deploy/functions/release/index.js +2 -2
  116. package/lib/deploy/functions/release/planner.js +6 -6
  117. package/lib/deploy/functions/release/reporter.js +8 -4
  118. package/lib/deploy/functions/runtimes/discovery/index.js +2 -2
  119. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +14 -14
  120. package/lib/deploy/functions/runtimes/golang/index.js +11 -14
  121. package/lib/deploy/functions/runtimes/index.js +6 -10
  122. package/lib/deploy/functions/runtimes/node/index.js +6 -10
  123. package/lib/deploy/functions/runtimes/node/parseTriggers.js +3 -3
  124. package/lib/deploy/functions/runtimes/node/validate.js +2 -1
  125. package/lib/deploy/functions/services/storage.js +1 -1
  126. package/lib/deploy/functions/triggerRegionHelper.js +1 -1
  127. package/lib/deploy/functions/validate.js +32 -4
  128. package/lib/deploy/hosting/convertConfig.js +45 -24
  129. package/lib/deploy/hosting/deploy.js +7 -7
  130. package/lib/deploy/hosting/prepare.js +1 -1
  131. package/lib/deploy/hosting/uploader.js +1 -1
  132. package/lib/deploy/hosting/validate.js +3 -3
  133. package/lib/deploy/remoteconfig/prepare.js +3 -3
  134. package/lib/deploy/remoteconfig/release.js +3 -3
  135. package/lib/deploy/storage/deploy.js +1 -1
  136. package/lib/deploy/storage/release.js +2 -2
  137. package/lib/detectProjectRoot.js +5 -5
  138. package/lib/emulator/auth/apiSpec.js +13 -7
  139. package/lib/emulator/auth/handlers.js +3 -3
  140. package/lib/emulator/auth/index.js +1 -1
  141. package/lib/emulator/auth/operations.js +256 -248
  142. package/lib/emulator/auth/server.js +11 -8
  143. package/lib/emulator/auth/state.js +12 -12
  144. package/lib/emulator/commandUtils.js +5 -5
  145. package/lib/emulator/controller.js +16 -11
  146. package/lib/emulator/downloadableEmulators.js +5 -4
  147. package/lib/emulator/emulatorLogger.js +1 -1
  148. package/lib/emulator/functionsEmulator.js +110 -75
  149. package/lib/emulator/functionsEmulatorRuntime.js +36 -21
  150. package/lib/emulator/functionsEmulatorShell.js +3 -2
  151. package/lib/emulator/functionsRuntimeWorker.js +1 -1
  152. package/lib/emulator/hubExport.js +2 -2
  153. package/lib/emulator/storage/apis/firebase.js +2 -2
  154. package/lib/emulator/storage/apis/gcloud.js +2 -2
  155. package/lib/emulator/storage/cloudFunctions.js +1 -1
  156. package/lib/emulator/storage/files.js +14 -14
  157. package/lib/emulator/storage/index.js +2 -2
  158. package/lib/emulator/storage/metadata.js +7 -6
  159. package/lib/emulator/storage/rules/runtime.js +10 -9
  160. package/lib/emulator/storage/server.js +2 -2
  161. package/lib/ensureApiEnabled.js +7 -7
  162. package/lib/error.js +3 -3
  163. package/lib/extensions/askUserForConsent.js +3 -4
  164. package/lib/extensions/askUserForParam.js +11 -11
  165. package/lib/extensions/billingMigrationHelper.js +2 -2
  166. package/lib/extensions/changelog.js +4 -4
  167. package/lib/extensions/displayExtensionInfo.js +6 -6
  168. package/lib/extensions/emulator/optionsHelper.js +1 -1
  169. package/lib/extensions/emulator/specHelper.js +1 -1
  170. package/lib/extensions/emulator/triggerHelper.js +1 -1
  171. package/lib/extensions/export.js +6 -6
  172. package/lib/extensions/extensionsApi.js +68 -110
  173. package/lib/extensions/extensionsHelper.js +56 -43
  174. package/lib/extensions/listExtensions.js +1 -1
  175. package/lib/extensions/localHelper.js +1 -1
  176. package/lib/extensions/metricsTypeDef.js +2 -0
  177. package/lib/extensions/metricsUtils.js +98 -0
  178. package/lib/extensions/paramHelper.js +6 -6
  179. package/lib/extensions/provisioningHelper.js +13 -14
  180. package/lib/extensions/resolveSource.js +6 -6
  181. package/lib/extensions/secretsUtils.js +3 -3
  182. package/lib/extensions/updateHelper.js +10 -10
  183. package/lib/extensions/utils.js +1 -1
  184. package/lib/extensions/warnings.js +11 -10
  185. package/lib/fetchWebSetup.js +2 -2
  186. package/lib/filterTargets.js +2 -2
  187. package/lib/firestore/indexes.js +2 -2
  188. package/lib/fsAsync.js +3 -3
  189. package/lib/fsutils.js +2 -2
  190. package/lib/functional.js +2 -1
  191. package/lib/functions/env.js +1 -1
  192. package/lib/functions/runtimeConfigExport.js +4 -4
  193. package/lib/functionsConfig.js +7 -8
  194. package/lib/functionsShellCommandAction.js +4 -3
  195. package/lib/gcp/cloudbilling.js +8 -19
  196. package/lib/gcp/cloudfunctions.js +22 -46
  197. package/lib/gcp/cloudlogging.js +8 -11
  198. package/lib/gcp/cloudmonitoring.js +77 -0
  199. package/lib/gcp/cloudscheduler.js +8 -19
  200. package/lib/gcp/firedata.js +5 -4
  201. package/lib/gcp/firestore.js +5 -5
  202. package/lib/gcp/iam.js +19 -34
  203. package/lib/gcp/resourceManager.js +10 -15
  204. package/lib/gcp/rules.js +18 -41
  205. package/lib/gcp/runtimeconfig.js +31 -53
  206. package/lib/gcp/secretManager.js +24 -45
  207. package/lib/gcp/storage.js +24 -29
  208. package/lib/getDefaultDatabaseInstance.js +1 -1
  209. package/lib/getDefaultHostingSite.js +1 -1
  210. package/lib/getProjectNumber.js +2 -2
  211. package/lib/handlePreviewToggles.js +5 -5
  212. package/lib/hosting/api.js +6 -6
  213. package/lib/hosting/cloudRunProxy.js +6 -6
  214. package/lib/hosting/functionsProxy.js +3 -3
  215. package/lib/hosting/implicitInit.js +2 -2
  216. package/lib/hosting/normalizedHostingConfigs.js +3 -3
  217. package/lib/hosting/proxy.js +2 -2
  218. package/lib/init/features/account.js +7 -7
  219. package/lib/init/features/database.js +9 -9
  220. package/lib/init/features/emulators.js +8 -8
  221. package/lib/init/features/firestore/index.js +3 -3
  222. package/lib/init/features/firestore/indexes.js +2 -2
  223. package/lib/init/features/firestore/rules.js +2 -2
  224. package/lib/init/features/functions/golang.js +4 -4
  225. package/lib/init/features/functions/index.js +4 -4
  226. package/lib/init/features/hosting/github.js +31 -31
  227. package/lib/init/features/project.js +8 -8
  228. package/lib/init/features/remoteconfig.js +2 -2
  229. package/lib/init/features/storage.js +2 -2
  230. package/lib/listFiles.js +1 -1
  231. package/lib/management/apps.js +3 -3
  232. package/lib/management/projects.js +6 -6
  233. package/lib/previews.js +2 -2
  234. package/lib/profiler.js +1 -1
  235. package/lib/projectPath.js +1 -1
  236. package/lib/projectUtils.js +2 -2
  237. package/lib/prompt.js +0 -1
  238. package/lib/rc.js +1 -1
  239. package/lib/remoteconfig/get.js +14 -8
  240. package/lib/remoteconfig/rollback.js +13 -6
  241. package/lib/remoteconfig/versionslist.js +13 -7
  242. package/lib/requireAuth.js +2 -2
  243. package/lib/requireDatabaseInstance.js +1 -1
  244. package/lib/requireHostingSite.js +1 -1
  245. package/lib/requirePermissions.js +4 -4
  246. package/lib/rulesDeploy.js +2 -2
  247. package/lib/serve/functions.js +14 -7
  248. package/lib/serve/hosting.js +7 -7
  249. package/lib/utils.js +3 -2
  250. package/npm-shrinkwrap.json +24090 -0
  251. package/package.json +36 -31
  252. package/schema/firebase-config.json +387 -12
  253. package/lib/commands/functions-config-legacy.js +0 -45
  254. package/lib/prepareFirebaseRules.js +0 -58
@@ -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
  }