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
@@ -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?`,
@@ -1,39 +1,40 @@
1
1
  "use strict";
2
- var clc = require("cli-color");
3
- var fs = require("fs");
4
- var os = require("os");
5
- var { Command } = require("../command");
6
- var accountExporter = require("../accountExporter");
7
- var needProjectId = require("../projectUtils").needProjectId;
8
- const { logger } = require("../logger");
9
- var { requirePermissions } = require("../requirePermissions");
10
- var MAX_BATCH_SIZE = 1000;
11
- var validateOptions = accountExporter.validateOptions;
12
- var serialExportUsers = accountExporter.serialExportUsers;
13
- module.exports = new Command("auth:export [dataFile]")
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const clc = require("cli-color");
4
+ const fs = require("fs");
5
+ const os = require("os");
6
+ const command_1 = require("../command");
7
+ const logger_1 = require("../logger");
8
+ const projectUtils_1 = require("../projectUtils");
9
+ const requirePermissions_1 = require("../requirePermissions");
10
+ const accountExporter_1 = require("../accountExporter");
11
+ const MAX_BATCH_SIZE = 1000;
12
+ exports.default = new command_1.Command("auth:export [dataFile]")
14
13
  .description("Export accounts from your Firebase project into a data file")
15
- .option("--format <format>", "Format of exported data (csv, json). Ignored if [dataFile] has format extension.")
16
- .before(requirePermissions, ["firebaseauth.users.get"])
17
- .action(function (dataFile, options) {
18
- var projectId = needProjectId(options);
19
- var checkRes = validateOptions(options, dataFile);
14
+ .option("--format <format>", "Format of exported data (csv, json). Ignored if <dataFile> has format extension.")
15
+ .before(requirePermissions_1.requirePermissions, ["firebaseauth.users.get"])
16
+ .action((dataFile, options) => {
17
+ const projectId = (0, projectUtils_1.needProjectId)(options);
18
+ const checkRes = (0, accountExporter_1.validateOptions)(options, dataFile);
20
19
  if (!checkRes.format) {
21
20
  return checkRes;
22
21
  }
23
- var exportOptions = checkRes;
24
- var writeStream = fs.createWriteStream(dataFile);
25
- if (exportOptions.format === "json") {
22
+ const writeStream = fs.createWriteStream(dataFile);
23
+ if (checkRes.format === "json") {
26
24
  writeStream.write('{"users": [' + os.EOL);
27
25
  }
28
- exportOptions.writeStream = writeStream;
29
- exportOptions.batchSize = MAX_BATCH_SIZE;
30
- logger.info("Exporting accounts to " + clc.bold(dataFile));
31
- return serialExportUsers(projectId, exportOptions).then(function () {
26
+ const exportOptions = {
27
+ format: checkRes.format,
28
+ writeStream,
29
+ batchSize: MAX_BATCH_SIZE,
30
+ };
31
+ logger_1.logger.info("Exporting accounts to " + clc.bold(dataFile));
32
+ return (0, accountExporter_1.serialExportUsers)(projectId, exportOptions).then(() => {
32
33
  if (exportOptions.format === "json") {
33
34
  writeStream.write("]}");
34
35
  }
35
36
  writeStream.end();
36
- return new Promise(function (resolve, reject) {
37
+ return new Promise((resolve, reject) => {
37
38
  writeStream.on("finish", resolve);
38
39
  writeStream.on("close", resolve);
39
40
  writeStream.on("error", reject);
@@ -1,21 +1,23 @@
1
1
  "use strict";
2
- var csv = require("csv-streamify");
3
- var clc = require("cli-color");
4
- var fs = require("fs");
5
- var jsonStream = require("JSONStream");
6
- var _ = require("lodash");
7
- var { Command } = require("../command");
8
- var accountImporter = require("../accountImporter");
9
- var needProjectId = require("../projectUtils").needProjectId;
10
- const { logger } = require("../logger");
11
- var { requirePermissions } = require("../requirePermissions");
12
- var utils = require("../utils");
13
- var MAX_BATCH_SIZE = 1000;
14
- var validateOptions = accountImporter.validateOptions;
15
- var validateUserJson = accountImporter.validateUserJson;
16
- var transArrayToUser = accountImporter.transArrayToUser;
17
- var serialImportUsers = accountImporter.serialImportUsers;
18
- module.exports = new Command("auth:import [dataFile]")
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const csv_parse_1 = require("csv-parse");
4
+ const Chain = require("stream-chain");
5
+ const clc = require("cli-color");
6
+ const fs = require("fs-extra");
7
+ const Pick = require("stream-json/filters/Pick");
8
+ const StreamArray = require("stream-json/streamers/StreamArray");
9
+ const command_1 = require("../command");
10
+ const error_1 = require("../error");
11
+ const logger_1 = require("../logger");
12
+ const projectUtils_1 = require("../projectUtils");
13
+ const requirePermissions_1 = require("../requirePermissions");
14
+ const accountImporter = require("../accountImporter");
15
+ const MAX_BATCH_SIZE = 1000;
16
+ const validateOptions = accountImporter.validateOptions;
17
+ const validateUserJson = accountImporter.validateUserJson;
18
+ const transArrayToUser = accountImporter.transArrayToUser;
19
+ const serialImportUsers = accountImporter.serialImportUsers;
20
+ module.exports = new command_1.Command("auth:import [dataFile]")
19
21
  .description("import users into your Firebase project from a data file(.csv or .json)")
20
22
  .option("--hash-algo <hashAlgo>", "specify the hash algorithm used in password for these accounts")
21
23
  .option("--hash-key <hashKey>", "specify the key used in hash algorithm")
@@ -27,81 +29,89 @@ module.exports = new Command("auth:import [dataFile]")
27
29
  .option("--dk-len <dkLen>", "specify derived key length for standard scrypt.")
28
30
  .option("--hash-input-order <hashInputOrder>", "specify the order of password and salt. Possible values are SALT_FIRST and PASSWORD_FIRST. " +
29
31
  "MD5, SHA1, SHA256, SHA512, HMAC_MD5, HMAC_SHA1, HMAC_SHA256, HMAC_SHA512 support this flag.")
30
- .before(requirePermissions, ["firebaseauth.users.create", "firebaseauth.users.update"])
31
- .action(function (dataFile, options) {
32
- var projectId = needProjectId(options);
33
- var checkRes = validateOptions(options);
32
+ .before(requirePermissions_1.requirePermissions, ["firebaseauth.users.create", "firebaseauth.users.update"])
33
+ .action(async (dataFile, options) => {
34
+ const projectId = (0, projectUtils_1.needProjectId)(options);
35
+ const checkRes = validateOptions(options);
34
36
  if (!checkRes.valid) {
35
37
  return checkRes;
36
38
  }
37
- var hashOptions = checkRes;
38
- if (!_.endsWith(dataFile, ".csv") && !_.endsWith(dataFile, ".json")) {
39
- return utils.reject("Data file must end with .csv or .json", { exit: 1 });
39
+ const hashOptions = checkRes;
40
+ if (!dataFile.endsWith(".csv") && !dataFile.endsWith(".json")) {
41
+ throw new error_1.FirebaseError("Data file must end with .csv or .json");
40
42
  }
41
- var stats = fs.statSync(dataFile);
42
- var fileSizeInBytes = stats.size;
43
- logger.info("Processing " + clc.bold(dataFile) + " (" + fileSizeInBytes + " bytes)");
44
- var inStream = fs.createReadStream(dataFile);
45
- var batches = [];
46
- var currentBatch = [];
47
- var counter = 0;
48
- return new Promise(function (resolve, reject) {
49
- var parser;
50
- if (dataFile.endsWith(".csv")) {
51
- parser = csv({ objectMode: true });
43
+ const stats = await fs.stat(dataFile);
44
+ const fileSizeInBytes = stats.size;
45
+ logger_1.logger.info(`Processing ${clc.bold(dataFile)} (${fileSizeInBytes} bytes)`);
46
+ const batches = [];
47
+ let currentBatch = [];
48
+ let counter = 0;
49
+ let userListArr = [];
50
+ const inStream = fs.createReadStream(dataFile);
51
+ if (dataFile.endsWith(".csv")) {
52
+ userListArr = await new Promise((resolve, reject) => {
53
+ const parser = (0, csv_parse_1.parse)();
52
54
  parser
53
- .on("data", function (line) {
54
- counter++;
55
- var user = transArrayToUser(line.map(function (str) {
56
- var newStr = str.trim().replace(/^["|'](.*)["|']$/, "$1");
57
- return newStr === "" ? undefined : newStr;
58
- }));
59
- if (user.error) {
60
- return reject("Line " + counter + " (" + line + ") has invalid data format: " + user.error);
61
- }
62
- currentBatch.push(user);
63
- if (currentBatch.length === MAX_BATCH_SIZE) {
64
- batches.push(currentBatch);
65
- currentBatch = [];
55
+ .on("readable", () => {
56
+ let record = [];
57
+ while ((record = parser.read()) !== null) {
58
+ counter++;
59
+ const trimmed = record.map((s) => {
60
+ const str = s.trim().replace(/^["|'](.*)["|']$/, "$1");
61
+ return str === "" ? undefined : str;
62
+ });
63
+ const user = transArrayToUser(trimmed);
64
+ const err = user.error;
65
+ if (err) {
66
+ return reject(new error_1.FirebaseError(`Line ${counter} (${record.join(",")}) has invalid data format: ${err}`));
67
+ }
68
+ currentBatch.push(user);
69
+ if (currentBatch.length === MAX_BATCH_SIZE) {
70
+ batches.push(currentBatch);
71
+ currentBatch = [];
72
+ }
66
73
  }
67
74
  })
68
- .on("end", function () {
75
+ .on("end", () => {
69
76
  if (currentBatch.length) {
70
77
  batches.push(currentBatch);
71
78
  }
72
- return resolve(batches);
79
+ resolve(batches);
73
80
  });
74
81
  inStream.pipe(parser);
75
- }
76
- else {
77
- parser = jsonStream.parse(["users", { emitKey: true }]);
78
- parser
79
- .on("data", function (pair) {
80
- counter++;
81
- var res = validateUserJson(pair.value);
82
- if (res.error) {
83
- return reject(res.error);
84
- }
85
- currentBatch.push(pair.value);
86
- if (currentBatch.length === MAX_BATCH_SIZE) {
87
- batches.push(currentBatch);
88
- currentBatch = [];
89
- }
90
- })
91
- .on("end", function () {
82
+ });
83
+ }
84
+ else {
85
+ userListArr = await new Promise((resolve, reject) => {
86
+ const pipeline = new Chain([
87
+ Pick.withParser({ filter: /^users$/ }),
88
+ StreamArray.streamArray(),
89
+ ({ value }) => {
90
+ counter++;
91
+ const user = validateUserJson(value);
92
+ const err = user.error;
93
+ if (err) {
94
+ throw new error_1.FirebaseError(`Validation Error: ${err}`);
95
+ }
96
+ currentBatch.push(user);
97
+ if (currentBatch.length === MAX_BATCH_SIZE) {
98
+ batches.push(currentBatch);
99
+ currentBatch = [];
100
+ }
101
+ },
102
+ ]);
103
+ pipeline.once("error", reject);
104
+ pipeline.on("finish", () => {
92
105
  if (currentBatch.length) {
93
106
  batches.push(currentBatch);
94
107
  }
95
- return resolve(batches);
108
+ resolve(batches);
96
109
  });
97
- inStream.pipe(parser);
98
- }
99
- }).then(function (userListArr) {
100
- logger.debug("Preparing to import", counter, "user records in", userListArr.length, "batches.");
101
- if (userListArr.length) {
102
- return serialImportUsers(projectId, hashOptions, userListArr, 0);
103
- }
104
- }, function (error) {
105
- return utils.reject(error, { exit: 1 });
106
- });
110
+ inStream.pipe(pipeline);
111
+ });
112
+ }
113
+ logger_1.logger.debug(`Preparing to import ${counter} user records in ${userListArr.length} batches.`);
114
+ if (userListArr.length) {
115
+ return serialImportUsers(projectId, hashOptions, userListArr, 0);
116
+ }
107
117
  });
@@ -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();
@@ -24,9 +24,9 @@ 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
31
  name: "force",
32
32
  default: false,
@@ -29,10 +29,10 @@ 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
37
  name: "force",
38
38
  default: false,
@@ -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));
@@ -28,9 +28,9 @@ 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
35
  name: "force",
36
36
  default: false,
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const _ = require("lodash");
4
4
  const clc = require("cli-color");
5
- const marked = require("marked");
5
+ const { marked } = require("marked");
6
6
  const ora = require("ora");
7
7
  const TerminalRenderer = require("marked-terminal");
8
8
  const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
@@ -28,9 +28,9 @@ exports.default = new command_1.Command("ext:configure <extensionInstanceId>")
28
28
  ])
29
29
  .before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extMinVersion")
30
30
  .action(async (instanceId, options) => {
31
- const spinner = ora.default(`Configuring ${clc.bold(instanceId)}. This usually takes 3 to 5 minutes...`);
31
+ const spinner = ora(`Configuring ${clc.bold(instanceId)}. This usually takes 3 to 5 minutes...`);
32
32
  try {
33
- const projectId = projectUtils_1.needProjectId(options);
33
+ const projectId = (0, projectUtils_1.needProjectId)(options);
34
34
  let existingInstance;
35
35
  try {
36
36
  existingInstance = await extensionsApi.getInstance(projectId, instanceId);