firebase-tools 9.23.3 → 10.1.1

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 (223) 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 +27 -21
  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 +9 -13
  99. package/lib/deploy/functions/runtimes/index.js +6 -10
  100. package/lib/deploy/functions/runtimes/node/index.js +6 -10
  101. package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +1 -1
  102. package/lib/deploy/functions/runtimes/node/parseTriggers.js +3 -3
  103. package/lib/deploy/functions/runtimes/node/validate.js +2 -1
  104. package/lib/deploy/functions/services/storage.js +1 -1
  105. package/lib/deploy/functions/triggerRegionHelper.js +1 -1
  106. package/lib/deploy/functions/validate.js +4 -3
  107. package/lib/deploy/hosting/deploy.js +7 -7
  108. package/lib/deploy/hosting/uploader.js +1 -1
  109. package/lib/deploy/hosting/validate.js +3 -3
  110. package/lib/deploy/remoteconfig/prepare.js +3 -3
  111. package/lib/deploy/remoteconfig/release.js +3 -3
  112. package/lib/deploy/storage/deploy.js +1 -1
  113. package/lib/deploy/storage/release.js +2 -2
  114. package/lib/detectProjectRoot.js +5 -5
  115. package/lib/emulator/auth/apiSpec.js +13 -7
  116. package/lib/emulator/auth/handlers.js +3 -3
  117. package/lib/emulator/auth/index.js +1 -1
  118. package/lib/emulator/auth/operations.js +256 -248
  119. package/lib/emulator/auth/server.js +11 -8
  120. package/lib/emulator/auth/state.js +12 -12
  121. package/lib/emulator/commandUtils.js +5 -5
  122. package/lib/emulator/controller.js +16 -11
  123. package/lib/emulator/downloadableEmulators.js +2 -2
  124. package/lib/emulator/emulatorLogger.js +1 -1
  125. package/lib/emulator/functionsEmulator.js +101 -74
  126. package/lib/emulator/functionsEmulatorRuntime.js +33 -18
  127. package/lib/emulator/functionsEmulatorShell.js +3 -2
  128. package/lib/emulator/functionsRuntimeWorker.js +1 -1
  129. package/lib/emulator/hubExport.js +2 -2
  130. package/lib/emulator/storage/apis/firebase.js +2 -2
  131. package/lib/emulator/storage/apis/gcloud.js +2 -2
  132. package/lib/emulator/storage/cloudFunctions.js +1 -1
  133. package/lib/emulator/storage/files.js +14 -14
  134. package/lib/emulator/storage/index.js +2 -2
  135. package/lib/emulator/storage/metadata.js +7 -6
  136. package/lib/emulator/storage/rules/runtime.js +5 -5
  137. package/lib/emulator/storage/server.js +2 -2
  138. package/lib/ensureApiEnabled.js +7 -7
  139. package/lib/error.js +3 -3
  140. package/lib/extensions/askUserForConsent.js +2 -3
  141. package/lib/extensions/askUserForParam.js +10 -10
  142. package/lib/extensions/billingMigrationHelper.js +1 -1
  143. package/lib/extensions/changelog.js +3 -3
  144. package/lib/extensions/displayExtensionInfo.js +5 -5
  145. package/lib/extensions/emulator/optionsHelper.js +1 -1
  146. package/lib/extensions/emulator/specHelper.js +1 -1
  147. package/lib/extensions/emulator/triggerHelper.js +1 -1
  148. package/lib/extensions/export.js +6 -6
  149. package/lib/extensions/extensionsApi.js +14 -1
  150. package/lib/extensions/extensionsHelper.js +38 -29
  151. package/lib/extensions/listExtensions.js +1 -1
  152. package/lib/extensions/localHelper.js +1 -1
  153. package/lib/extensions/metricsTypeDef.js +2 -0
  154. package/lib/extensions/metricsUtils.js +98 -0
  155. package/lib/extensions/paramHelper.js +6 -6
  156. package/lib/extensions/provisioningHelper.js +6 -4
  157. package/lib/extensions/resolveSource.js +1 -1
  158. package/lib/extensions/secretsUtils.js +3 -3
  159. package/lib/extensions/updateHelper.js +9 -9
  160. package/lib/extensions/utils.js +1 -1
  161. package/lib/extensions/warnings.js +10 -9
  162. package/lib/fetchWebSetup.js +2 -2
  163. package/lib/filterTargets.js +2 -2
  164. package/lib/firestore/indexes.js +2 -2
  165. package/lib/fsAsync.js +3 -3
  166. package/lib/fsutils.js +2 -2
  167. package/lib/functional.js +2 -1
  168. package/lib/functions/env.js +1 -1
  169. package/lib/functions/runtimeConfigExport.js +4 -4
  170. package/lib/functionsConfig.js +3 -3
  171. package/lib/functionsShellCommandAction.js +4 -3
  172. package/lib/gcp/cloudmonitoring.js +74 -0
  173. package/lib/gcp/cloudscheduler.js +1 -1
  174. package/lib/gcp/iam.js +2 -2
  175. package/lib/gcp/resourceManager.js +2 -2
  176. package/lib/gcp/secretManager.js +3 -2
  177. package/lib/getDefaultDatabaseInstance.js +1 -1
  178. package/lib/getDefaultHostingSite.js +1 -1
  179. package/lib/getProjectNumber.js +2 -2
  180. package/lib/handlePreviewToggles.js +5 -5
  181. package/lib/hosting/api.js +6 -6
  182. package/lib/hosting/cloudRunProxy.js +6 -6
  183. package/lib/hosting/functionsProxy.js +3 -3
  184. package/lib/hosting/implicitInit.js +2 -2
  185. package/lib/hosting/normalizedHostingConfigs.js +3 -3
  186. package/lib/hosting/proxy.js +2 -2
  187. package/lib/init/features/account.js +7 -7
  188. package/lib/init/features/database.js +9 -9
  189. package/lib/init/features/emulators.js +8 -8
  190. package/lib/init/features/firestore/index.js +3 -3
  191. package/lib/init/features/firestore/indexes.js +2 -2
  192. package/lib/init/features/firestore/rules.js +2 -2
  193. package/lib/init/features/functions/golang.js +4 -4
  194. package/lib/init/features/functions/index.js +4 -4
  195. package/lib/init/features/hosting/github.js +31 -31
  196. package/lib/init/features/project.js +8 -8
  197. package/lib/init/features/remoteconfig.js +2 -2
  198. package/lib/init/features/storage.js +2 -2
  199. package/lib/listFiles.js +1 -1
  200. package/lib/management/apps.js +3 -3
  201. package/lib/management/projects.js +6 -6
  202. package/lib/previews.js +2 -2
  203. package/lib/profiler.js +1 -1
  204. package/lib/projectPath.js +1 -1
  205. package/lib/projectUtils.js +1 -1
  206. package/lib/prompt.js +0 -1
  207. package/lib/rc.js +1 -1
  208. package/lib/requireAuth.js +2 -2
  209. package/lib/requireDatabaseInstance.js +1 -1
  210. package/lib/requireHostingSite.js +1 -1
  211. package/lib/requirePermissions.js +4 -4
  212. package/lib/rulesDeploy.js +2 -2
  213. package/lib/serve/functions.js +14 -7
  214. package/lib/serve/hosting.js +7 -7
  215. package/lib/utils.js +3 -2
  216. package/npm-shrinkwrap.json +24889 -0
  217. package/package.json +24 -24
  218. package/templates/init/functions/javascript/package.lint.json +1 -1
  219. package/templates/init/functions/javascript/package.nolint.json +1 -1
  220. package/templates/init/functions/typescript/package.lint.json +1 -1
  221. package/templates/init/functions/typescript/package.nolint.json +1 -1
  222. package/templates/init/hosting/index.html +1 -1
  223. package/CHANGELOG.md +0 -1
package/lib/api.js CHANGED
@@ -71,6 +71,7 @@ var api = {
71
71
  clientSecret: utils.envOverride("FIREBASE_CLIENT_SECRET", "j9iVZfS8kkCEFUPaAeJV0sAi"),
72
72
  cloudbillingOrigin: utils.envOverride("FIREBASE_CLOUDBILLING_URL", "https://cloudbilling.googleapis.com"),
73
73
  cloudloggingOrigin: utils.envOverride("FIREBASE_CLOUDLOGGING_URL", "https://logging.googleapis.com"),
74
+ cloudMonitoringOrigin: utils.envOverride("CLOUD_MONITORING_URL", "https://monitoring.googleapis.com"),
74
75
  containerRegistryDomain: utils.envOverride("CONTAINER_REGISTRY_DOMAIN", "gcr.io"),
75
76
  artifactRegistryDomain: utils.envOverride("ARTIFACT_REGISTRY_DOMAIN", "https://artifactregistry.googleapis.com"),
76
77
  appDistributionOrigin: utils.envOverride("FIREBASE_APP_DISTRIBUTION_URL", "https://firebaseappdistribution.googleapis.com"),
@@ -93,7 +94,6 @@ var api = {
93
94
  functionsOrigin: utils.envOverride("FIREBASE_FUNCTIONS_URL", "https://cloudfunctions.googleapis.com"),
94
95
  functionsV2Origin: utils.envOverride("FIREBASE_FUNCTIONS_V2_URL", "https://cloudfunctions.googleapis.com"),
95
96
  runOrigin: utils.envOverride("CLOUD_RUN_URL", "https://run.googleapis.com"),
96
- functionsUploadRegion: utils.envOverride("FIREBASE_FUNCTIONS_UPLOAD_REGION", "us-central1"),
97
97
  functionsDefaultRegion: utils.envOverride("FIREBASE_FUNCTIONS_DEFAULT_REGION", "us-central1"),
98
98
  cloudschedulerOrigin: utils.envOverride("FIREBASE_CLOUDSCHEDULER_URL", "https://cloudscheduler.googleapis.com"),
99
99
  cloudTasksOrigin: utils.envOverride("FIREBASE_CLOUD_TAKS_URL", "https://cloudtasks.googleapis.com"),
package/lib/apiv2.js CHANGED
@@ -202,7 +202,7 @@ class Client {
202
202
  this.logRequest(options);
203
203
  let res;
204
204
  try {
205
- res = await node_fetch_1.default(fetchURL, fetchOptions);
205
+ res = await (0, node_fetch_1.default)(fetchURL, fetchOptions);
206
206
  }
207
207
  catch (thrown) {
208
208
  const err = thrown instanceof Error ? thrown : new Error(thrown);
@@ -282,7 +282,7 @@ class Client {
282
282
  }
283
283
  exports.Client = Client;
284
284
  function isLocalInsecureRequest(urlPrefix) {
285
- const u = url_1.parse(urlPrefix);
285
+ const u = (0, url_1.parse)(urlPrefix);
286
286
  return u.protocol === "http:";
287
287
  }
288
288
  function bodyToString(body) {
@@ -83,7 +83,7 @@ class AppDistributionClient {
83
83
  });
84
84
  }
85
85
  catch (err) {
86
- throw new error_1.FirebaseError(`failed to update release notes with ${err.message}`, { exit: 1 });
86
+ throw new error_1.FirebaseError(`failed to update release notes with ${err === null || err === void 0 ? void 0 : err.message}`, { exit: 1 });
87
87
  }
88
88
  utils.logSuccess("added release notes successfully");
89
89
  }
@@ -37,7 +37,7 @@ function splitter(value) {
37
37
  .filter((entry) => !!entry);
38
38
  }
39
39
  async function getProjectName(options) {
40
- const projectNumber = await projectUtils_1.needProjectNumber(options);
40
+ const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
41
41
  return `projects/${projectNumber}`;
42
42
  }
43
43
  exports.getProjectName = getProjectName;
package/lib/auth.js CHANGED
@@ -256,7 +256,7 @@ async function loginWithoutLocalhost(userHint) {
256
256
  logger_1.logger.info(clc.bold.underline(authUrl));
257
257
  logger_1.logger.info();
258
258
  open(authUrl);
259
- const code = await prompt_1.promptOnce({
259
+ const code = await (0, prompt_1.promptOnce)({
260
260
  type: "input",
261
261
  name: "code",
262
262
  message: "Paste authorization code here:",
@@ -401,7 +401,7 @@ function logoutCurrentSession(refreshToken) {
401
401
  if (!account) {
402
402
  return;
403
403
  }
404
- defaultCredentials_1.clearCredentials(account);
404
+ (0, defaultCredentials_1.clearCredentials)(account);
405
405
  deleteAccount(account);
406
406
  }
407
407
  async function refreshTokens(refreshToken, authScopes) {
package/lib/command.js CHANGED
@@ -25,7 +25,7 @@ class Command {
25
25
  this.befores = [];
26
26
  this.helpText = "";
27
27
  this.positionalArgs = [];
28
- this.name = lodash_1.first(cmd.split(" ")) || "";
28
+ this.name = (0, lodash_1.first)(cmd.split(" ")) || "";
29
29
  }
30
30
  description(t) {
31
31
  this.descriptionText = t;
@@ -71,14 +71,14 @@ class Command {
71
71
  cmd.action((...args) => {
72
72
  const runner = this.runner();
73
73
  const start = new Date().getTime();
74
- const options = lodash_1.last(args);
74
+ const options = (0, lodash_1.last)(args);
75
75
  if (args.length - 1 > cmd._args.length) {
76
- client.errorOut(new error_1.FirebaseError(`Too many arguments. Run ${cli_color_1.bold("firebase help " + this.name)} for usage instructions`, { exit: 1 }));
76
+ client.errorOut(new error_1.FirebaseError(`Too many arguments. Run ${(0, cli_color_1.bold)("firebase help " + this.name)} for usage instructions`, { exit: 1 }));
77
77
  return;
78
78
  }
79
79
  runner(...args)
80
80
  .then((result) => {
81
- if (utils_1.getInheritedOption(options, "json")) {
81
+ if ((0, utils_1.getInheritedOption)(options, "json")) {
82
82
  console.log(JSON.stringify({
83
83
  status: "success",
84
84
  result: result,
@@ -88,7 +88,7 @@ class Command {
88
88
  track(this.name, "success", duration).then(() => process.exit());
89
89
  })
90
90
  .catch(async (err) => {
91
- if (utils_1.getInheritedOption(options, "json")) {
91
+ if ((0, utils_1.getInheritedOption)(options, "json")) {
92
92
  console.log(JSON.stringify({
93
93
  status: "error",
94
94
  error: err.message,
@@ -103,25 +103,25 @@ class Command {
103
103
  }
104
104
  async prepare(options) {
105
105
  options = options || {};
106
- options.project = utils_1.getInheritedOption(options, "project");
107
- if (!process.stdin.isTTY || utils_1.getInheritedOption(options, "nonInteractive")) {
106
+ options.project = (0, utils_1.getInheritedOption)(options, "project");
107
+ if (!process.stdin.isTTY || (0, utils_1.getInheritedOption)(options, "nonInteractive")) {
108
108
  options.nonInteractive = true;
109
109
  }
110
- if (utils_1.getInheritedOption(options, "interactive")) {
110
+ if ((0, utils_1.getInheritedOption)(options, "interactive")) {
111
111
  options.interactive = true;
112
112
  options.nonInteractive = false;
113
113
  }
114
- if (utils_1.getInheritedOption(options, "debug")) {
114
+ if ((0, utils_1.getInheritedOption)(options, "debug")) {
115
115
  options.debug = true;
116
116
  }
117
- if (utils_1.getInheritedOption(options, "json")) {
117
+ if ((0, utils_1.getInheritedOption)(options, "json")) {
118
118
  options.nonInteractive = true;
119
119
  }
120
120
  else {
121
- utils_1.setupLoggers();
121
+ (0, utils_1.setupLoggers)();
122
122
  }
123
- if (utils_1.getInheritedOption(options, "config")) {
124
- options.configPath = utils_1.getInheritedOption(options, "config");
123
+ if ((0, utils_1.getInheritedOption)(options, "config")) {
124
+ options.configPath = (0, utils_1.getInheritedOption)(options, "config");
125
125
  }
126
126
  try {
127
127
  options.config = config_1.Config.load(options);
@@ -129,13 +129,13 @@ class Command {
129
129
  catch (e) {
130
130
  options.configError = e;
131
131
  }
132
- const account = utils_1.getInheritedOption(options, "account");
132
+ const account = (0, utils_1.getInheritedOption)(options, "account");
133
133
  options.account = account;
134
- options.projectRoot = detectProjectRoot_1.detectProjectRoot(options);
134
+ options.projectRoot = (0, detectProjectRoot_1.detectProjectRoot)(options);
135
135
  const projectRoot = options.projectRoot;
136
- const activeAccount = auth_1.selectAccount(account, projectRoot);
136
+ const activeAccount = (0, auth_1.selectAccount)(account, projectRoot);
137
137
  if (activeAccount) {
138
- auth_1.setActiveAccount(options, activeAccount);
138
+ (0, auth_1.setActiveAccount)(options, activeAccount);
139
139
  }
140
140
  this.applyRC(options);
141
141
  if (options.project) {
@@ -144,7 +144,7 @@ class Command {
144
144
  }
145
145
  }
146
146
  applyRC(options) {
147
- const rc = rc_1.loadRC(options);
147
+ const rc = (0, rc_1.loadRC)(options);
148
148
  options.rc = rc;
149
149
  options.project =
150
150
  options.project || (configstore_1.configstore.get("activeProjects") || {})[options.projectRoot];
@@ -152,21 +152,21 @@ class Command {
152
152
  options.project = options.config.defaults.project;
153
153
  }
154
154
  const aliases = rc.projects;
155
- const rcProject = lodash_1.get(aliases, options.project);
155
+ const rcProject = (0, lodash_1.get)(aliases, options.project);
156
156
  if (rcProject) {
157
157
  options.projectAlias = options.project;
158
158
  options.project = rcProject;
159
159
  }
160
- else if (!options.project && lodash_1.size(aliases) === 1) {
161
- options.projectAlias = lodash_1.head(lodash_1.keys(aliases));
162
- options.project = lodash_1.head(lodash_1.values(aliases));
160
+ else if (!options.project && (0, lodash_1.size)(aliases) === 1) {
161
+ options.projectAlias = (0, lodash_1.head)((0, lodash_1.keys)(aliases));
162
+ options.project = (0, lodash_1.head)((0, lodash_1.values)(aliases));
163
163
  }
164
164
  }
165
165
  async resolveProjectIdentifiers(options) {
166
166
  var _a;
167
167
  if ((_a = options.project) === null || _a === void 0 ? void 0 : _a.match(/^\d+$/)) {
168
- await requireAuth_1.requireAuth(options);
169
- const { projectId, projectNumber } = await projects_1.getFirebaseProject(options.project);
168
+ await (0, requireAuth_1.requireAuth)(options);
169
+ const { projectId, projectNumber } = await (0, projects_1.getFirebaseProject)(options.project);
170
170
  options.projectId = projectId;
171
171
  options.projectNumber = projectNumber;
172
172
  }
@@ -176,13 +176,13 @@ class Command {
176
176
  }
177
177
  runner() {
178
178
  return async (...args) => {
179
- if (typeof lodash_1.last(args) !== "object" || lodash_1.last(args) === null) {
179
+ if (typeof (0, lodash_1.last)(args) !== "object" || (0, lodash_1.last)(args) === null) {
180
180
  args.push({});
181
181
  }
182
182
  while (args.length < this.positionalArgs.length + 1) {
183
183
  args.splice(args.length - 1, 0, "");
184
184
  }
185
- const options = lodash_1.last(args);
185
+ const options = (0, lodash_1.last)(args);
186
186
  await this.prepare(options);
187
187
  for (const before of this.befores) {
188
188
  await before.fn(options, ...before.args);
@@ -13,7 +13,7 @@ function getReleaseNotes(releaseNotes, releaseNotesFile) {
13
13
  return releaseNotes.replace(/\\n/g, "\n");
14
14
  }
15
15
  else if (releaseNotesFile) {
16
- options_parser_util_1.ensureFileExists(releaseNotesFile);
16
+ (0, options_parser_util_1.ensureFileExists)(releaseNotesFile);
17
17
  return fs.readFileSync(releaseNotesFile, "utf8");
18
18
  }
19
19
  return "";
@@ -29,11 +29,11 @@ module.exports = new command_1.Command("appdistribution:distribute <release-bina
29
29
  .option("--groups-file <file>", "path to file with a comma separated list of group aliases to distribute to")
30
30
  .before(requireAuth_1.requireAuth)
31
31
  .action(async (file, options) => {
32
- const appName = options_parser_util_1.getAppName(options);
32
+ const appName = (0, options_parser_util_1.getAppName)(options);
33
33
  const distribution = new distribution_1.Distribution(file);
34
34
  const releaseNotes = getReleaseNotes(options.releaseNotes, options.releaseNotesFile);
35
- const testers = options_parser_util_1.getTestersOrGroups(options.testers, options.testersFile);
36
- const groups = options_parser_util_1.getTestersOrGroups(options.groups, options.groupsFile);
35
+ const testers = (0, options_parser_util_1.getTestersOrGroups)(options.testers, options.testersFile);
36
+ const groups = (0, options_parser_util_1.getTestersOrGroups)(options.groups, options.groupsFile);
37
37
  const requests = new client_1.AppDistributionClient();
38
38
  let aabInfo;
39
39
  if (distribution.distributionFileType() === distribution_1.DistributionFileType.AAB) {
@@ -10,9 +10,9 @@ module.exports = new command_1.Command("appdistribution:testers:add [emails...]"
10
10
  .option("--file <file>", "a path to a file containing a list of tester emails to be added")
11
11
  .before(requireAuth_1.requireAuth)
12
12
  .action(async (emails, options) => {
13
- const projectName = await options_parser_util_1.getProjectName(options);
13
+ const projectName = await (0, options_parser_util_1.getProjectName)(options);
14
14
  const appDistroClient = new client_1.AppDistributionClient();
15
- const emailsToAdd = options_parser_util_1.getEmails(emails, options.file);
15
+ const emailsToAdd = (0, options_parser_util_1.getEmails)(emails, options.file);
16
16
  utils.logBullet(`Adding ${emailsToAdd.length} testers to project`);
17
17
  await appDistroClient.addTesters(projectName, emailsToAdd);
18
18
  });
@@ -12,9 +12,9 @@ module.exports = new command_1.Command("appdistribution:testers:remove [emails..
12
12
  .option("--file <file>", "a path to a file containing a list of tester emails to be removed")
13
13
  .before(requireAuth_1.requireAuth)
14
14
  .action(async (emails, options) => {
15
- const projectName = await options_parser_util_1.getProjectName(options);
15
+ const projectName = await (0, options_parser_util_1.getProjectName)(options);
16
16
  const appDistroClient = new client_1.AppDistributionClient();
17
- const emailsArr = options_parser_util_1.getEmails(emails, options.file);
17
+ const emailsArr = (0, options_parser_util_1.getEmails)(emails, options.file);
18
18
  let deleteResponse;
19
19
  try {
20
20
  utils.logBullet(`Deleting ${emailsArr.length} testers from project`);
@@ -19,8 +19,8 @@ module.exports = new command_1.Command("apps:android:sha:create <appId> <shaHash
19
19
  .description("add a SHA certificate hash for a given app id.")
20
20
  .before(requireAuth_1.requireAuth)
21
21
  .action(async (appId = "", shaHash = "", options) => {
22
- const projectId = projectUtils_1.needProjectId(options);
23
- const shaCertificate = await utils_1.promiseWithSpinner(async () => await apps_1.createAppAndroidSha(projectId, appId, {
22
+ const projectId = (0, projectUtils_1.needProjectId)(options);
23
+ const shaCertificate = await (0, utils_1.promiseWithSpinner)(async () => await (0, apps_1.createAppAndroidSha)(projectId, appId, {
24
24
  shaHash: shaHash,
25
25
  certType: getCertHashType(shaHash),
26
26
  }), `Creating Android SHA certificate ${clc.bold(options.shaHash)}with Android app Id ${clc.bold(appId)}`);
@@ -10,6 +10,6 @@ module.exports = new command_1.Command("apps:android:sha:delete <appId> <shaId>"
10
10
  .description("delete a SHA certificate hash for a given app id.")
11
11
  .before(requireAuth_1.requireAuth)
12
12
  .action(async (appId = "", shaId = "", options) => {
13
- const projectId = projectUtils_1.needProjectId(options);
14
- await utils_1.promiseWithSpinner(async () => await apps_1.deleteAppAndroidSha(projectId, appId, shaId), `Deleting Android SHA certificate hash with SHA id ${clc.bold(shaId)} and Android app Id ${clc.bold(appId)}`);
13
+ const projectId = (0, projectUtils_1.needProjectId)(options);
14
+ await (0, utils_1.promiseWithSpinner)(async () => await (0, apps_1.deleteAppAndroidSha)(projectId, appId, shaId), `Deleting Android SHA certificate hash with SHA id ${clc.bold(shaId)} and Android app Id ${clc.bold(appId)}`);
15
15
  });
@@ -33,8 +33,8 @@ module.exports = new command_1.Command("apps:android:sha:list <appId>")
33
33
  .description("list the SHA certificate hashes for a given app id. ")
34
34
  .before(requireAuth_1.requireAuth)
35
35
  .action(async (appId = "", options) => {
36
- const projectId = projectUtils_1.needProjectId(options);
37
- const shaCertificates = await utils_1.promiseWithSpinner(async () => await apps_1.listAppAndroidSha(projectId, appId), "Preparing the list of your Firebase Android app SHA certificate hashes");
36
+ const projectId = (0, projectUtils_1.needProjectId)(options);
37
+ const shaCertificates = await (0, utils_1.promiseWithSpinner)(async () => await (0, apps_1.listAppAndroidSha)(projectId, appId), "Preparing the list of your Firebase Android app SHA certificate hashes");
38
38
  logCertificatesList(shaCertificates);
39
39
  logCertificatesCount(shaCertificates.length);
40
40
  return shaCertificates;
@@ -40,7 +40,7 @@ function logPostAppCreationInformation(appMetadata, appPlatform) {
40
40
  }
41
41
  async function initiateIosAppCreation(options) {
42
42
  if (!options.nonInteractive) {
43
- await prompt_1.prompt(options, [
43
+ await (0, prompt_1.prompt)(options, [
44
44
  DISPLAY_NAME_QUESTION,
45
45
  {
46
46
  type: "input",
@@ -61,7 +61,7 @@ async function initiateIosAppCreation(options) {
61
61
  }
62
62
  const spinner = ora("Creating your iOS app").start();
63
63
  try {
64
- const appData = await apps_1.createIosApp(options.project, {
64
+ const appData = await (0, apps_1.createIosApp)(options.project, {
65
65
  displayName: options.displayName,
66
66
  bundleId: options.bundleId,
67
67
  appStoreId: options.appStoreId,
@@ -76,7 +76,7 @@ async function initiateIosAppCreation(options) {
76
76
  }
77
77
  async function initiateAndroidAppCreation(options) {
78
78
  if (!options.nonInteractive) {
79
- await prompt_1.prompt(options, [
79
+ await (0, prompt_1.prompt)(options, [
80
80
  DISPLAY_NAME_QUESTION,
81
81
  {
82
82
  type: "input",
@@ -91,7 +91,7 @@ async function initiateAndroidAppCreation(options) {
91
91
  }
92
92
  const spinner = ora("Creating your Android app").start();
93
93
  try {
94
- const appData = await apps_1.createAndroidApp(options.project, {
94
+ const appData = await (0, apps_1.createAndroidApp)(options.project, {
95
95
  displayName: options.displayName,
96
96
  packageName: options.packageName,
97
97
  });
@@ -105,14 +105,14 @@ async function initiateAndroidAppCreation(options) {
105
105
  }
106
106
  async function initiateWebAppCreation(options) {
107
107
  if (!options.nonInteractive) {
108
- await prompt_1.prompt(options, [DISPLAY_NAME_QUESTION]);
108
+ await (0, prompt_1.prompt)(options, [DISPLAY_NAME_QUESTION]);
109
109
  }
110
110
  if (!options.displayName) {
111
111
  throw new error_1.FirebaseError("Display name for Web app cannot be empty");
112
112
  }
113
113
  const spinner = ora("Creating your Web app").start();
114
114
  try {
115
- const appData = await apps_1.createWebApp(options.project, { displayName: options.displayName });
115
+ const appData = await (0, apps_1.createWebApp)(options.project, { displayName: options.displayName });
116
116
  spinner.succeed();
117
117
  return appData;
118
118
  }
@@ -128,9 +128,9 @@ module.exports = new command_1.Command("apps:create [platform] [displayName]")
128
128
  .option("-s, --app-store-id <appStoreId>", "(optional) app store id for the iOS app")
129
129
  .before(requireAuth_1.requireAuth)
130
130
  .action(async (platform = "", displayName, options) => {
131
- const projectId = projectUtils_1.needProjectId(options);
131
+ const projectId = (0, projectUtils_1.needProjectId)(options);
132
132
  if (!options.nonInteractive && !platform) {
133
- platform = await prompt_1.promptOnce({
133
+ platform = await (0, prompt_1.promptOnce)({
134
134
  type: "list",
135
135
  message: "Please choose the platform of the app:",
136
136
  choices: [
@@ -140,7 +140,7 @@ module.exports = new command_1.Command("apps:create [platform] [displayName]")
140
140
  ],
141
141
  });
142
142
  }
143
- const appPlatform = apps_1.getAppPlatform(platform);
143
+ const appPlatform = (0, apps_1.getAppPlatform)(platform);
144
144
  if (appPlatform === apps_1.AppPlatform.ANY) {
145
145
  throw new error_1.FirebaseError("App platform must be provided");
146
146
  }
@@ -33,13 +33,13 @@ module.exports = new command_1.Command("apps:list [platform]")
33
33
  "Optionally filter apps by [platform]: IOS, ANDROID or WEB (case insensitive)")
34
34
  .before(requireAuth_1.requireAuth)
35
35
  .action(async (platform, options) => {
36
- const projectId = projectUtils_1.needProjectId(options);
37
- const appPlatform = apps_1.getAppPlatform(platform || "");
36
+ const projectId = (0, projectUtils_1.needProjectId)(options);
37
+ const appPlatform = (0, apps_1.getAppPlatform)(platform || "");
38
38
  let apps;
39
39
  const spinner = ora("Preparing the list of your Firebase " +
40
40
  `${appPlatform === apps_1.AppPlatform.ANY ? "" : appPlatform + " "}apps`).start();
41
41
  try {
42
- apps = await apps_1.listFirebaseApps(projectId, appPlatform);
42
+ apps = await (0, apps_1.listFirebaseApps)(projectId, appPlatform);
43
43
  }
44
44
  catch (err) {
45
45
  spinner.fail();
@@ -22,7 +22,7 @@ async function selectAppInteractively(apps, appPlatform) {
22
22
  value: app,
23
23
  };
24
24
  });
25
- return await prompt_1.promptOnce({
25
+ return await (0, prompt_1.promptOnce)({
26
26
  type: "list",
27
27
  message: `Select the ${appPlatform === apps_1.AppPlatform.ANY ? "" : appPlatform + " "}` +
28
28
  "app to get the configuration data:",
@@ -35,17 +35,17 @@ module.exports = new command_1.Command("apps:sdkconfig [platform] [appId]")
35
35
  .option("-o, --out [file]", "(optional) write config output to a file")
36
36
  .before(requireAuth_1.requireAuth)
37
37
  .action(async (platform = "", appId = "", options) => {
38
- let appPlatform = apps_1.getAppPlatform(platform);
38
+ let appPlatform = (0, apps_1.getAppPlatform)(platform);
39
39
  if (!appId) {
40
- let projectId = projectUtils_1.needProjectId(options);
40
+ let projectId = (0, projectUtils_1.needProjectId)(options);
41
41
  if (options.nonInteractive && !projectId) {
42
42
  throw new error_1.FirebaseError("Must supply app and project ids in non-interactive mode.");
43
43
  }
44
44
  else if (!projectId) {
45
- const result = await projects_1.getOrPromptProject(options);
45
+ const result = await (0, projects_1.getOrPromptProject)(options);
46
46
  projectId = result.projectId;
47
47
  }
48
- const apps = await apps_1.listFirebaseApps(projectId, appPlatform);
48
+ const apps = await (0, apps_1.listFirebaseApps)(projectId, appPlatform);
49
49
  if (apps.length === 1) {
50
50
  appId = apps[0].appId;
51
51
  appPlatform = apps[0].platform;
@@ -62,14 +62,14 @@ module.exports = new command_1.Command("apps:sdkconfig [platform] [appId]")
62
62
  let configData;
63
63
  const spinner = ora(`Downloading configuration data of your Firebase ${appPlatform} app`).start();
64
64
  try {
65
- configData = await apps_1.getAppConfig(appId, appPlatform);
65
+ configData = await (0, apps_1.getAppConfig)(appId, appPlatform);
66
66
  }
67
67
  catch (err) {
68
68
  spinner.fail();
69
69
  throw err;
70
70
  }
71
71
  spinner.succeed();
72
- const fileInfo = apps_1.getAppConfigFile(configData, appPlatform);
72
+ const fileInfo = (0, apps_1.getAppConfigFile)(configData, appPlatform);
73
73
  if (appPlatform == apps_1.AppPlatform.WEB) {
74
74
  fileInfo.sdkConfig = configData;
75
75
  }
@@ -83,7 +83,7 @@ module.exports = new command_1.Command("apps:sdkconfig [platform] [appId]")
83
83
  if (options.nonInteractive) {
84
84
  throw new error_1.FirebaseError(`${filename} already exists`);
85
85
  }
86
- const overwrite = await prompt_1.promptOnce({
86
+ const overwrite = await (0, prompt_1.promptOnce)({
87
87
  type: "confirm",
88
88
  default: false,
89
89
  message: `${filename} already exists. Do you want to overwrite?`,
@@ -56,7 +56,7 @@ exports.default = new command_1.Command("database:get <path>")
56
56
  if (!path.startsWith("/")) {
57
57
  return utils.reject("Path must begin with /", { exit: 1 });
58
58
  }
59
- const dbHost = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
59
+ const dbHost = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
60
60
  const dbUrl = utils.getDatabaseUrl(dbHost, options.instance, path + ".json");
61
61
  const query = {};
62
62
  if (options.shallow) {
@@ -16,13 +16,13 @@ exports.default = new command_1.Command("database:instances:create <instanceName
16
16
  .before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.create"])
17
17
  .before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.DATABASE)
18
18
  .action(async (instanceName, options) => {
19
- const projectId = projectUtils_1.needProjectId(options);
20
- const defaultDatabaseInstance = await getDefaultDatabaseInstance_1.getDefaultDatabaseInstance({ project: projectId });
19
+ const projectId = (0, projectUtils_1.needProjectId)(options);
20
+ const defaultDatabaseInstance = await (0, getDefaultDatabaseInstance_1.getDefaultDatabaseInstance)({ project: projectId });
21
21
  if (defaultDatabaseInstance === "") {
22
22
  throw new error_1.FirebaseError(requireDatabaseInstance_1.MISSING_DEFAULT_INSTANCE_ERROR_MESSAGE);
23
23
  }
24
- const location = database_1.parseDatabaseLocation(options.location, database_1.DatabaseLocation.US_CENTRAL1);
25
- const instance = await database_1.createInstance(projectId, instanceName, location, database_1.DatabaseInstanceType.USER_DATABASE);
24
+ const location = (0, database_1.parseDatabaseLocation)(options.location, database_1.DatabaseLocation.US_CENTRAL1);
25
+ const instance = await (0, database_1.createInstance)(projectId, instanceName, location, database_1.DatabaseInstanceType.USER_DATABASE);
26
26
  logger_1.logger.info(`created database instance ${instance.name}`);
27
27
  return instance;
28
28
  });
@@ -37,14 +37,14 @@ let cmd = new command_1.Command("database:instances:list")
37
37
  .before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.list"])
38
38
  .before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.DATABASE)
39
39
  .action(async (options) => {
40
- const location = database_1.parseDatabaseLocation(options.location, database_1.DatabaseLocation.ANY);
40
+ const location = (0, database_1.parseDatabaseLocation)(options.location, database_1.DatabaseLocation.ANY);
41
41
  const spinner = ora("Preparing the list of your Firebase Realtime Database instances" +
42
42
  `${location === database_1.DatabaseLocation.ANY ? "" : ` for location: ${location}`}`).start();
43
43
  let instances;
44
44
  if (previews_1.previews.rtdbmanagement) {
45
- const projectId = projectUtils_2.needProjectId(options);
45
+ const projectId = (0, projectUtils_2.needProjectId)(options);
46
46
  try {
47
- instances = await database_1.listDatabaseInstances(projectId, location);
47
+ instances = await (0, database_1.listDatabaseInstances)(projectId, location);
48
48
  }
49
49
  catch (err) {
50
50
  spinner.fail();
@@ -55,7 +55,7 @@ let cmd = new command_1.Command("database:instances:list")
55
55
  logInstancesCount(instances.length);
56
56
  return instances;
57
57
  }
58
- const projectNumber = await projectUtils_1.needProjectNumber(options);
58
+ const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
59
59
  try {
60
60
  instances = await firedata.listDatabaseInstances(projectNumber);
61
61
  }
@@ -42,5 +42,5 @@ module.exports = new command_1.Command("database:profile")
42
42
  exit: 1,
43
43
  });
44
44
  }
45
- return profiler_1.profiler(options);
45
+ return (0, profiler_1.profiler)(options);
46
46
  });
@@ -28,7 +28,7 @@ exports.default = new command_1.Command("database:push <path> [infile]")
28
28
  throw new error_1.FirebaseError("Path must begin with /");
29
29
  }
30
30
  const inStream = utils.stringToStream(options.data) || (infile ? fs.createReadStream(infile) : process.stdin);
31
- const origin = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
31
+ const origin = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
32
32
  const u = new url_1.URL(utils.getDatabaseUrl(origin, options.instance, path + ".json"));
33
33
  if (!infile && !options.data) {
34
34
  utils.explainStdin();
@@ -14,7 +14,7 @@ const clc = require("cli-color");
14
14
  const _ = require("lodash");
15
15
  module.exports = new command_1.Command("database:remove <path>")
16
16
  .description("remove data from your Firebase at the specified path")
17
- .option("-y, --confirm", "pass this option to bypass confirmation prompt")
17
+ .option("-f, --force", "pass this option to bypass confirmation prompt")
18
18
  .option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, use default database instance)")
19
19
  .before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.update"])
20
20
  .before(requireDatabaseInstance_1.requireDatabaseInstance)
@@ -24,11 +24,11 @@ module.exports = new command_1.Command("database:remove <path>")
24
24
  if (!_.startsWith(path, "/")) {
25
25
  return utils.reject("Path must begin with /", { exit: 1 });
26
26
  }
27
- const origin = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
27
+ const origin = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
28
28
  const databaseUrl = utils.getDatabaseUrl(origin, options.instance, path);
29
- const confirm = await prompt_1.promptOnce({
29
+ const confirm = await (0, prompt_1.promptOnce)({
30
30
  type: "confirm",
31
- name: "confirm",
31
+ name: "force",
32
32
  default: false,
33
33
  message: "You are about to remove all data at " + clc.cyan(databaseUrl) + ". Are you sure?",
34
34
  }, options);
@@ -19,7 +19,7 @@ const utils = require("../utils");
19
19
  exports.default = new command_1.Command("database:set <path> [infile]")
20
20
  .description("store JSON data at the specified path via STDIN, arg, or file")
21
21
  .option("-d, --data <data>", "specify escaped JSON directly")
22
- .option("-y, --confirm", "pass this option to bypass confirmation prompt")
22
+ .option("-f, --force", "pass this option to bypass confirmation prompt")
23
23
  .option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, use default database instance)")
24
24
  .before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.update"])
25
25
  .before(requireDatabaseInstance_1.requireDatabaseInstance)
@@ -29,12 +29,12 @@ exports.default = new command_1.Command("database:set <path> [infile]")
29
29
  if (!_.startsWith(path, "/")) {
30
30
  throw new error_1.FirebaseError("Path must begin with /");
31
31
  }
32
- const origin = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
32
+ const origin = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
33
33
  const dbPath = utils.getDatabaseUrl(origin, options.instance, path);
34
34
  const dbJsonURL = new url_1.URL(utils.getDatabaseUrl(origin, options.instance, path + ".json"));
35
- const confirm = await prompt_1.promptOnce({
35
+ const confirm = await (0, prompt_1.promptOnce)({
36
36
  type: "confirm",
37
- name: "confirm",
37
+ name: "force",
38
38
  default: false,
39
39
  message: "You are about to overwrite all data at " + clc.cyan(dbPath) + ". Are you sure?",
40
40
  }, options);
@@ -24,7 +24,7 @@ exports.default = new command_1.Command("database:settings:get <path>")
24
24
  if (!settings_1.DATABASE_SETTINGS.has(path)) {
25
25
  throw new error_1.FirebaseError(settings_1.INVALID_PATH_ERROR, { exit: 1 });
26
26
  }
27
- const u = new url_1.URL(utils.getDatabaseUrl(api_1.realtimeOriginOrCustomUrl(options.instanceDetails.databaseUrl), options.instance, `/.settings/${path}.json`));
27
+ const u = new url_1.URL(utils.getDatabaseUrl((0, api_1.realtimeOriginOrCustomUrl)(options.instanceDetails.databaseUrl), options.instance, `/.settings/${path}.json`));
28
28
  const c = new apiv2_1.Client({ urlPrefix: u.origin, auth: true });
29
29
  let res;
30
30
  try {
@@ -29,7 +29,7 @@ exports.default = new command_1.Command("database:settings:set <path> <value>")
29
29
  if (parsedValue === undefined) {
30
30
  return utils.reject(setting.parseInputErrorMessge, { exit: 1 });
31
31
  }
32
- const u = new url_1.URL(utils.getDatabaseUrl(api_1.realtimeOriginOrCustomUrl(options.instanceDetails.databaseUrl), options.instance, `/.settings/${path}.json`));
32
+ const u = new url_1.URL(utils.getDatabaseUrl((0, api_1.realtimeOriginOrCustomUrl)(options.instanceDetails.databaseUrl), options.instance, `/.settings/${path}.json`));
33
33
  const c = new apiv2_1.Client({ urlPrefix: u.origin, auth: true });
34
34
  try {
35
35
  await c.put(u.pathname, JSON.stringify(parsedValue));
@@ -18,7 +18,7 @@ const utils = require("../utils");
18
18
  exports.default = new command_1.Command("database:update <path> [infile]")
19
19
  .description("update some of the keys for the defined path in your Firebase")
20
20
  .option("-d, --data <data>", "specify escaped JSON directly")
21
- .option("-y, --confirm", "pass this option to bypass confirmation prompt")
21
+ .option("-f, --force", "pass this option to bypass confirmation prompt")
22
22
  .option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, use default database instance)")
23
23
  .before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.update"])
24
24
  .before(requireDatabaseInstance_1.requireDatabaseInstance)
@@ -28,11 +28,11 @@ exports.default = new command_1.Command("database:update <path> [infile]")
28
28
  if (!path.startsWith("/")) {
29
29
  throw new error_1.FirebaseError("Path must begin with /");
30
30
  }
31
- const origin = api_1.realtimeOriginOrEmulatorOrCustomUrl(options.instanceDetails.databaseUrl);
31
+ const origin = (0, api_1.realtimeOriginOrEmulatorOrCustomUrl)(options.instanceDetails.databaseUrl);
32
32
  const url = utils.getDatabaseUrl(origin, options.instance, path);
33
- const confirmed = await prompt_1.promptOnce({
33
+ const confirmed = await (0, prompt_1.promptOnce)({
34
34
  type: "confirm",
35
- name: "confirm",
35
+ name: "force",
36
36
  default: false,
37
37
  message: `You are about to modify data at ${clc.cyan(url)}. Are you sure?`,
38
38
  }, options);