firebase-tools 10.0.0 → 10.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) 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 +2 -2
  5. package/lib/appdistribution/client.js +1 -1
  6. package/lib/appdistribution/options-parser-util.js +1 -1
  7. package/lib/auth.js +2 -2
  8. package/lib/bin/firebase.js +1 -1
  9. package/lib/command.js +26 -26
  10. package/lib/commands/appdistribution-distribute.js +4 -4
  11. package/lib/commands/appdistribution-testers-add.js +2 -2
  12. package/lib/commands/appdistribution-testers-remove.js +2 -2
  13. package/lib/commands/apps-android-sha-create.js +2 -2
  14. package/lib/commands/apps-android-sha-delete.js +2 -2
  15. package/lib/commands/apps-android-sha-list.js +2 -2
  16. package/lib/commands/apps-create.js +9 -9
  17. package/lib/commands/apps-list.js +3 -3
  18. package/lib/commands/apps-sdkconfig.js +8 -8
  19. package/lib/commands/auth-export.js +26 -25
  20. package/lib/commands/auth-import.js +88 -78
  21. package/lib/commands/database-get.js +1 -1
  22. package/lib/commands/database-instances-create.js +4 -4
  23. package/lib/commands/database-instances-list.js +4 -4
  24. package/lib/commands/database-profile.js +1 -1
  25. package/lib/commands/database-push.js +1 -1
  26. package/lib/commands/database-remove.js +2 -2
  27. package/lib/commands/database-set.js +2 -2
  28. package/lib/commands/database-settings-get.js +1 -1
  29. package/lib/commands/database-settings-set.js +1 -1
  30. package/lib/commands/database-update.js +2 -2
  31. package/lib/commands/ext-configure.js +3 -3
  32. package/lib/commands/ext-dev-deprecate.js +4 -4
  33. package/lib/commands/ext-dev-extension-delete.js +3 -3
  34. package/lib/commands/ext-dev-init.js +4 -4
  35. package/lib/commands/ext-dev-list.js +1 -1
  36. package/lib/commands/ext-dev-publish.js +4 -4
  37. package/lib/commands/ext-dev-register.js +6 -6
  38. package/lib/commands/ext-dev-undeprecate.js +4 -4
  39. package/lib/commands/ext-dev-unpublish.js +3 -3
  40. package/lib/commands/ext-dev-usage.js +145 -0
  41. package/lib/commands/ext-export.js +8 -8
  42. package/lib/commands/ext-info.js +5 -5
  43. package/lib/commands/ext-install.js +27 -23
  44. package/lib/commands/ext-list.js +2 -2
  45. package/lib/commands/ext-sources-create.js +2 -2
  46. package/lib/commands/ext-uninstall.js +4 -4
  47. package/lib/commands/ext-update.js +18 -18
  48. package/lib/commands/ext.js +3 -3
  49. package/lib/commands/firestore-delete.js +1 -1
  50. package/lib/commands/functions-config-clone.js +22 -23
  51. package/lib/commands/functions-config-export.js +11 -11
  52. package/lib/commands/functions-config-get.js +22 -22
  53. package/lib/commands/functions-config-set.js +24 -22
  54. package/lib/commands/functions-config-unset.js +20 -22
  55. package/lib/commands/functions-delete.js +3 -3
  56. package/lib/commands/functions-deletegcfartifacts.js +4 -4
  57. package/lib/commands/functions-list.js +1 -1
  58. package/lib/commands/functions-log.js +1 -1
  59. package/lib/commands/help.js +12 -12
  60. package/lib/commands/hosting-channel-create.js +13 -13
  61. package/lib/commands/hosting-channel-delete.js +10 -10
  62. package/lib/commands/hosting-channel-deploy.js +18 -18
  63. package/lib/commands/hosting-channel-list.js +5 -5
  64. package/lib/commands/hosting-channel-open.js +9 -9
  65. package/lib/commands/hosting-clone.js +16 -16
  66. package/lib/commands/hosting-disable.js +1 -1
  67. package/lib/commands/hosting-sites-create.js +7 -7
  68. package/lib/commands/hosting-sites-delete.js +7 -7
  69. package/lib/commands/hosting-sites-get.js +2 -2
  70. package/lib/commands/hosting-sites-list.js +3 -3
  71. package/lib/commands/index.js +1 -0
  72. package/lib/commands/login-ci.js +10 -10
  73. package/lib/commands/login.js +2 -2
  74. package/lib/commands/logout.js +1 -1
  75. package/lib/commands/open.js +1 -1
  76. package/lib/commands/projects-addfirebase.js +2 -2
  77. package/lib/commands/projects-create.js +2 -2
  78. package/lib/commands/projects-list.js +1 -1
  79. package/lib/commands/remoteconfig-get.js +3 -3
  80. package/lib/commands/remoteconfig-rollback.js +3 -3
  81. package/lib/commands/remoteconfig-versions-list.js +7 -2
  82. package/lib/commands/setup-emulators-database.js +8 -7
  83. package/lib/commands/setup-emulators-firestore.js +8 -7
  84. package/lib/commands/setup-emulators-pubsub.js +5 -4
  85. package/lib/commands/setup-emulators-storage.js +4 -3
  86. package/lib/commands/setup-emulators-ui.js +8 -7
  87. package/lib/commands/target-apply.js +17 -16
  88. package/lib/commands/target-clear.js +11 -10
  89. package/lib/commands/target-remove.js +10 -9
  90. package/lib/commands/target.js +20 -20
  91. package/lib/config.js +6 -6
  92. package/lib/database/api.js +2 -2
  93. package/lib/defaultCredentials.js +3 -3
  94. package/lib/deploy/extensions/deploy.js +4 -4
  95. package/lib/deploy/extensions/deploymentSummary.js +5 -4
  96. package/lib/deploy/extensions/index.js +1 -0
  97. package/lib/deploy/extensions/params.js +1 -1
  98. package/lib/deploy/extensions/planner.js +3 -3
  99. package/lib/deploy/extensions/prepare.js +9 -9
  100. package/lib/deploy/extensions/release.js +1 -1
  101. package/lib/deploy/extensions/secrets.js +7 -7
  102. package/lib/deploy/extensions/validate.js +2 -2
  103. package/lib/deploy/functions/backend.js +6 -4
  104. package/lib/deploy/functions/checkIam.js +7 -7
  105. package/lib/deploy/functions/containerCleaner.js +3 -3
  106. package/lib/deploy/functions/deploy.js +4 -4
  107. package/lib/deploy/functions/ensureCloudBuildEnabled.js +3 -3
  108. package/lib/deploy/functions/index.js +1 -0
  109. package/lib/deploy/functions/prepare.js +27 -21
  110. package/lib/deploy/functions/prompts.js +5 -5
  111. package/lib/deploy/functions/release/executor.js +4 -1
  112. package/lib/deploy/functions/release/fabricator.js +5 -5
  113. package/lib/deploy/functions/release/index.js +2 -2
  114. package/lib/deploy/functions/release/planner.js +6 -6
  115. package/lib/deploy/functions/release/reporter.js +8 -4
  116. package/lib/deploy/functions/runtimes/discovery/index.js +2 -2
  117. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +14 -14
  118. package/lib/deploy/functions/runtimes/golang/index.js +11 -14
  119. package/lib/deploy/functions/runtimes/index.js +6 -10
  120. package/lib/deploy/functions/runtimes/node/index.js +6 -10
  121. package/lib/deploy/functions/runtimes/node/parseTriggers.js +3 -3
  122. package/lib/deploy/functions/runtimes/node/validate.js +2 -1
  123. package/lib/deploy/functions/services/storage.js +1 -1
  124. package/lib/deploy/functions/triggerRegionHelper.js +1 -1
  125. package/lib/deploy/functions/validate.js +4 -3
  126. package/lib/deploy/hosting/deploy.js +7 -7
  127. package/lib/deploy/hosting/uploader.js +1 -1
  128. package/lib/deploy/hosting/validate.js +3 -3
  129. package/lib/deploy/remoteconfig/prepare.js +3 -3
  130. package/lib/deploy/remoteconfig/release.js +3 -3
  131. package/lib/deploy/storage/deploy.js +1 -1
  132. package/lib/deploy/storage/release.js +2 -2
  133. package/lib/detectProjectRoot.js +5 -5
  134. package/lib/emulator/auth/apiSpec.js +13 -7
  135. package/lib/emulator/auth/handlers.js +3 -3
  136. package/lib/emulator/auth/index.js +1 -1
  137. package/lib/emulator/auth/operations.js +256 -248
  138. package/lib/emulator/auth/server.js +11 -8
  139. package/lib/emulator/auth/state.js +12 -12
  140. package/lib/emulator/commandUtils.js +5 -5
  141. package/lib/emulator/controller.js +16 -11
  142. package/lib/emulator/downloadableEmulators.js +10 -9
  143. package/lib/emulator/emulatorLogger.js +1 -1
  144. package/lib/emulator/functionsEmulator.js +107 -74
  145. package/lib/emulator/functionsEmulatorRuntime.js +36 -21
  146. package/lib/emulator/functionsEmulatorShell.js +3 -2
  147. package/lib/emulator/functionsRuntimeWorker.js +1 -1
  148. package/lib/emulator/hubExport.js +2 -2
  149. package/lib/emulator/storage/apis/firebase.js +2 -2
  150. package/lib/emulator/storage/apis/gcloud.js +2 -2
  151. package/lib/emulator/storage/cloudFunctions.js +1 -1
  152. package/lib/emulator/storage/files.js +14 -14
  153. package/lib/emulator/storage/index.js +2 -2
  154. package/lib/emulator/storage/metadata.js +7 -6
  155. package/lib/emulator/storage/rules/runtime.js +10 -9
  156. package/lib/emulator/storage/server.js +2 -2
  157. package/lib/ensureApiEnabled.js +7 -7
  158. package/lib/error.js +3 -3
  159. package/lib/extensions/askUserForConsent.js +3 -4
  160. package/lib/extensions/askUserForParam.js +11 -11
  161. package/lib/extensions/billingMigrationHelper.js +2 -2
  162. package/lib/extensions/changelog.js +4 -4
  163. package/lib/extensions/displayExtensionInfo.js +6 -6
  164. package/lib/extensions/emulator/optionsHelper.js +1 -1
  165. package/lib/extensions/emulator/specHelper.js +1 -1
  166. package/lib/extensions/emulator/triggerHelper.js +1 -1
  167. package/lib/extensions/export.js +6 -6
  168. package/lib/extensions/extensionsApi.js +69 -110
  169. package/lib/extensions/extensionsHelper.js +56 -43
  170. package/lib/extensions/listExtensions.js +1 -1
  171. package/lib/extensions/localHelper.js +1 -1
  172. package/lib/extensions/metricsTypeDef.js +2 -0
  173. package/lib/extensions/metricsUtils.js +98 -0
  174. package/lib/extensions/paramHelper.js +6 -6
  175. package/lib/extensions/provisioningHelper.js +13 -14
  176. package/lib/extensions/resolveSource.js +6 -6
  177. package/lib/extensions/secretsUtils.js +3 -3
  178. package/lib/extensions/updateHelper.js +10 -10
  179. package/lib/extensions/utils.js +1 -1
  180. package/lib/extensions/warnings.js +11 -10
  181. package/lib/fetchWebSetup.js +2 -2
  182. package/lib/filterTargets.js +2 -2
  183. package/lib/firestore/indexes.js +2 -2
  184. package/lib/fsAsync.js +3 -3
  185. package/lib/fsutils.js +2 -2
  186. package/lib/functional.js +2 -1
  187. package/lib/functions/env.js +1 -1
  188. package/lib/functions/runtimeConfigExport.js +4 -4
  189. package/lib/functionsConfig.js +7 -8
  190. package/lib/functionsShellCommandAction.js +4 -3
  191. package/lib/gcp/cloudmonitoring.js +74 -0
  192. package/lib/gcp/cloudscheduler.js +1 -1
  193. package/lib/gcp/iam.js +2 -2
  194. package/lib/gcp/resourceManager.js +2 -2
  195. package/lib/gcp/rules.js +18 -41
  196. package/lib/gcp/secretManager.js +3 -2
  197. package/lib/getDefaultDatabaseInstance.js +1 -1
  198. package/lib/getDefaultHostingSite.js +1 -1
  199. package/lib/getProjectNumber.js +2 -2
  200. package/lib/handlePreviewToggles.js +5 -5
  201. package/lib/hosting/api.js +6 -6
  202. package/lib/hosting/cloudRunProxy.js +6 -6
  203. package/lib/hosting/functionsProxy.js +3 -3
  204. package/lib/hosting/implicitInit.js +2 -2
  205. package/lib/hosting/normalizedHostingConfigs.js +3 -3
  206. package/lib/hosting/proxy.js +2 -2
  207. package/lib/init/features/account.js +7 -7
  208. package/lib/init/features/database.js +9 -9
  209. package/lib/init/features/emulators.js +8 -8
  210. package/lib/init/features/firestore/index.js +3 -3
  211. package/lib/init/features/firestore/indexes.js +2 -2
  212. package/lib/init/features/firestore/rules.js +2 -2
  213. package/lib/init/features/functions/golang.js +4 -4
  214. package/lib/init/features/functions/index.js +4 -4
  215. package/lib/init/features/hosting/github.js +31 -31
  216. package/lib/init/features/project.js +8 -8
  217. package/lib/init/features/remoteconfig.js +2 -2
  218. package/lib/init/features/storage.js +2 -2
  219. package/lib/listFiles.js +1 -1
  220. package/lib/management/apps.js +3 -3
  221. package/lib/management/projects.js +6 -6
  222. package/lib/previews.js +2 -2
  223. package/lib/profiler.js +1 -1
  224. package/lib/projectPath.js +1 -1
  225. package/lib/projectUtils.js +2 -2
  226. package/lib/prompt.js +0 -1
  227. package/lib/rc.js +1 -1
  228. package/lib/remoteconfig/get.js +14 -8
  229. package/lib/remoteconfig/rollback.js +13 -6
  230. package/lib/remoteconfig/versionslist.js +13 -7
  231. package/lib/requireAuth.js +2 -2
  232. package/lib/requireDatabaseInstance.js +1 -1
  233. package/lib/requireHostingSite.js +1 -1
  234. package/lib/requirePermissions.js +4 -4
  235. package/lib/rulesDeploy.js +2 -2
  236. package/lib/serve/functions.js +14 -7
  237. package/lib/serve/hosting.js +7 -7
  238. package/lib/utils.js +3 -2
  239. package/npm-shrinkwrap.json +24095 -0
  240. package/package.json +33 -30
  241. package/templates/init/hosting/index.html +1 -1
  242. package/CHANGELOG.md +0 -5
  243. package/lib/commands/functions-config-legacy.js +0 -45
  244. package/lib/prepareFirebaseRules.js +0 -58
@@ -99,7 +99,7 @@ class StorageLayer {
99
99
  }
100
100
  reset() {
101
101
  this._files = new Map();
102
- this._persistence = new Persistence(`${os_1.tmpdir()}/firebase/storage/blobs`);
102
+ this._persistence = new Persistence(`${(0, os_1.tmpdir)()}/firebase/storage/blobs`);
103
103
  this._uploads = new Map();
104
104
  this._buckets = new Map();
105
105
  }
@@ -135,7 +135,7 @@ class StorageLayer {
135
135
  this._files = value;
136
136
  }
137
137
  startUpload(bucket, object, contentType, metadata) {
138
- const uploadId = uuid_1.v4();
138
+ const uploadId = (0, uuid_1.v4)();
139
139
  const upload = new ResumableUpload(bucket, object, uploadId, contentType, metadata);
140
140
  this._uploads.set(uploadId, upload);
141
141
  return upload;
@@ -428,8 +428,8 @@ exports.StorageLayer = StorageLayer;
428
428
  class Persistence {
429
429
  constructor(dirPath) {
430
430
  this._dirPath = dirPath;
431
- if (!fs_1.existsSync(dirPath)) {
432
- fs_1.mkdirSync(dirPath, {
431
+ if (!(0, fs_1.existsSync)(dirPath)) {
432
+ (0, fs_1.mkdirSync)(dirPath, {
433
433
  recursive: true,
434
434
  });
435
435
  }
@@ -441,8 +441,8 @@ class Persistence {
441
441
  const filepath = this.getDiskPath(fileName);
442
442
  const encodedSlashIndex = filepath.toLowerCase().lastIndexOf("%2f");
443
443
  const dirPath = encodedSlashIndex >= 0 ? filepath.substring(0, encodedSlashIndex) : path.dirname(filepath);
444
- if (!fs_1.existsSync(dirPath)) {
445
- fs_1.mkdirSync(dirPath, {
444
+ if (!(0, fs_1.existsSync)(dirPath)) {
445
+ (0, fs_1.mkdirSync)(dirPath, {
446
446
  recursive: true,
447
447
  });
448
448
  }
@@ -453,7 +453,7 @@ class Persistence {
453
453
  }
454
454
  finally {
455
455
  if (fd) {
456
- fs_1.closeSync(fd);
456
+ (0, fs_1.closeSync)(fd);
457
457
  }
458
458
  }
459
459
  }
@@ -461,21 +461,21 @@ class Persistence {
461
461
  const path = this.getDiskPath(fileName);
462
462
  let fd;
463
463
  try {
464
- fd = fs_1.openSync(path, "r");
464
+ fd = (0, fs_1.openSync)(path, "r");
465
465
  const buf = Buffer.alloc(size);
466
466
  const offset = fileOffset && fileOffset > 0 ? fileOffset : 0;
467
- fs_1.readSync(fd, buf, 0, size, offset);
467
+ (0, fs_1.readSync)(fd, buf, 0, size, offset);
468
468
  return buf;
469
469
  }
470
470
  finally {
471
471
  if (fd) {
472
- fs_1.closeSync(fd);
472
+ (0, fs_1.closeSync)(fd);
473
473
  }
474
474
  }
475
475
  }
476
476
  deleteFile(fileName, failSilently = false) {
477
477
  try {
478
- fs_1.unlinkSync(this.getDiskPath(fileName));
478
+ (0, fs_1.unlinkSync)(this.getDiskPath(fileName));
479
479
  }
480
480
  catch (err) {
481
481
  if (!failSilently) {
@@ -497,12 +497,12 @@ class Persistence {
497
497
  }
498
498
  renameFile(oldName, newName) {
499
499
  const dirPath = this.getDiskPath(path.dirname(newName));
500
- if (!fs_1.existsSync(dirPath)) {
501
- fs_1.mkdirSync(dirPath, {
500
+ if (!(0, fs_1.existsSync)(dirPath)) {
501
+ (0, fs_1.mkdirSync)(dirPath, {
502
502
  recursive: true,
503
503
  });
504
504
  }
505
- fs_1.renameSync(this.getDiskPath(oldName), this.getDiskPath(newName));
505
+ (0, fs_1.renameSync)(this.getDiskPath(oldName), this.getDiskPath(newName));
506
506
  }
507
507
  getDiskPath(fileName) {
508
508
  return path.join(this._dirPath, fileName);
@@ -16,7 +16,7 @@ class StorageEmulator {
16
16
  constructor(args) {
17
17
  this.args = args;
18
18
  this._logger = emulatorLogger_1.EmulatorLogger.forEmulator(types_1.Emulators.STORAGE);
19
- const downloadDetails = downloadableEmulators_1.getDownloadDetails(types_1.Emulators.STORAGE);
19
+ const downloadDetails = (0, downloadableEmulators_1.getDownloadDetails)(types_1.Emulators.STORAGE);
20
20
  this._rulesRuntime = new runtime_1.StorageRulesRuntime();
21
21
  this._storageLayer = new files_1.StorageLayer(args.projectId);
22
22
  }
@@ -32,7 +32,7 @@ class StorageEmulator {
32
32
  async start() {
33
33
  const { host, port } = this.getInfo();
34
34
  await this._rulesRuntime.start(this.args.auto_download);
35
- this._app = await server_1.createApp(this.args.projectId, this);
35
+ this._app = await (0, server_1.createApp)(this.args.projectId, this);
36
36
  if (typeof this.args.rules == "string") {
37
37
  const rulesFile = this.args.rules;
38
38
  this.updateRulesSource(rulesFile);
@@ -28,7 +28,7 @@ class StoredFileMetadata {
28
28
  if (bytes) {
29
29
  this.size = bytes.byteLength;
30
30
  this.md5Hash = generateMd5Hash(bytes);
31
- this.crc32c = `${crc_1.crc32c(bytes)}`;
31
+ this.crc32c = `${(0, crc_1.crc32c)(bytes)}`;
32
32
  }
33
33
  else if (opts.size !== undefined && opts.md5Hash && opts.crc32c) {
34
34
  this.size = opts.size;
@@ -268,16 +268,17 @@ class CloudStorageObjectMetadata {
268
268
  }
269
269
  exports.CloudStorageObjectMetadata = CloudStorageObjectMetadata;
270
270
  function toSerializedDate(d) {
271
- const day = `${d.getFullYear()}-${(d.getMonth() + 1)
271
+ const day = `${d.getFullYear()}-${(d.getMonth() + 1).toString().padStart(2, "0")}-${d
272
+ .getDate()
272
273
  .toString()
273
- .padStart(2, "0")}-${d.getDate().toString().padStart(2, "0")}`;
274
+ .padStart(2, "0")}`;
274
275
  const time = `${d.getHours().toString().padStart(2, "0")}:${d
275
276
  .getMinutes()
276
277
  .toString()
277
- .padStart(2, "0")}:${d
278
- .getSeconds()
278
+ .padStart(2, "0")}:${d.getSeconds().toString().padStart(2, "0")}.${d
279
+ .getMilliseconds()
279
280
  .toString()
280
- .padStart(2, "0")}.${d.getMilliseconds().toString().padStart(3, "0")}`;
281
+ .padStart(3, "0")}`;
281
282
  return `${day}T${time}Z`;
282
283
  }
283
284
  exports.toSerializedDate = toSerializedDate;
@@ -62,6 +62,7 @@ class StorageRulesRuntime {
62
62
  return this._alive;
63
63
  }
64
64
  async start(auto_download = true) {
65
+ var _a, _b;
65
66
  const downloadDetails = downloadableEmulators_1.DownloadDetails[types_2.Emulators.STORAGE];
66
67
  const hasEmulator = fs.existsSync(downloadDetails.downloadPath);
67
68
  if (!hasEmulator) {
@@ -69,7 +70,7 @@ class StorageRulesRuntime {
69
70
  if (process.env.CI) {
70
71
  utils.logWarning(`It appears you are running in a CI environment. You can avoid downloading the ${constants_1.Constants.description(types_2.Emulators.STORAGE)} repeatedly by caching the ${downloadDetails.opts.cacheDir} directory.`);
71
72
  }
72
- await download_1.downloadEmulator(types_2.Emulators.STORAGE);
73
+ await (0, download_1.downloadEmulator)(types_2.Emulators.STORAGE);
73
74
  }
74
75
  else {
75
76
  utils.logWarning("Setup required, please run: firebase setup:emulators:storage");
@@ -77,8 +78,8 @@ class StorageRulesRuntime {
77
78
  }
78
79
  }
79
80
  this._alive = true;
80
- const command = downloadableEmulators_1._getCommand(types_2.Emulators.STORAGE, {});
81
- this._childprocess = cross_spawn_1.spawn(command.binary, command.args, {
81
+ const command = (0, downloadableEmulators_1._getCommand)(types_2.Emulators.STORAGE, {});
82
+ this._childprocess = (0, cross_spawn_1.spawn)(command.binary, command.args, {
82
83
  stdio: ["pipe", "pipe", "pipe"],
83
84
  });
84
85
  this._childprocess.on("exit", (code) => {
@@ -97,9 +98,9 @@ class StorageRulesRuntime {
97
98
  };
98
99
  });
99
100
  this._childprocess.on("error", (err) => {
100
- downloadableEmulators_1.handleEmulatorProcessError(types_2.Emulators.STORAGE, err);
101
+ (0, downloadableEmulators_1.handleEmulatorProcessError)(types_2.Emulators.STORAGE, err);
101
102
  });
102
- this._childprocess.stderr.on("data", (buf) => {
103
+ (_a = this._childprocess.stderr) === null || _a === void 0 ? void 0 : _a.on("data", (buf) => {
103
104
  const error = buf.toString();
104
105
  if (error.includes("jarfile")) {
105
106
  throw new error_1.FirebaseError("There was an issue starting the rules emulator, please run 'firebase setup:emulators:storage` again");
@@ -108,7 +109,7 @@ class StorageRulesRuntime {
108
109
  emulatorLogger_1.EmulatorLogger.forEmulator(types_2.Emulators.STORAGE).log("WARN", `Unexpected rules runtime error: ${buf.toString()}`);
109
110
  }
110
111
  });
111
- this._childprocess.stdout.on("data", (buf) => {
112
+ (_b = this._childprocess.stdout) === null || _b === void 0 ? void 0 : _b.on("data", (buf) => {
112
113
  const serializedRuntimeActionResponse = buf.toString("UTF8").trim();
113
114
  if (serializedRuntimeActionResponse != "") {
114
115
  let rap;
@@ -148,13 +149,13 @@ class StorageRulesRuntime {
148
149
  throw new error_1.FirebaseError("Attempted to send Cloud Storage rules request with stale id");
149
150
  }
150
151
  return new Promise((resolve) => {
151
- var _a;
152
+ var _a, _b;
152
153
  this._requests[runtimeActionRequest.id] = {
153
154
  request: runtimeActionRequest,
154
155
  handler: resolve,
155
156
  };
156
157
  const serializedRequest = JSON.stringify(runtimeActionRequest);
157
- (_a = this._childprocess) === null || _a === void 0 ? void 0 : _a.stdin.write(serializedRequest + "\n");
158
+ (_b = (_a = this._childprocess) === null || _a === void 0 ? void 0 : _a.stdin) === null || _b === void 0 ? void 0 : _b.write(serializedRequest + "\n");
158
159
  });
159
160
  }
160
161
  async loadRuleset(source) {
@@ -232,7 +233,7 @@ function toExpressionValue(obj) {
232
233
  }
233
234
  if (obj instanceof Date) {
234
235
  return {
235
- timestamp_value: metadata_1.toSerializedDate(obj),
236
+ timestamp_value: (0, metadata_1.toSerializedDate)(obj),
236
237
  };
237
238
  }
238
239
  if (Array.isArray(obj)) {
@@ -73,8 +73,8 @@ function createApp(defaultProjectId, emulator) {
73
73
  storageLayer.reset();
74
74
  res.sendStatus(200);
75
75
  });
76
- app.use("/v0", firebase_1.createFirebaseEndpoints(emulator));
77
- app.use("/", gcloud_1.createCloudEndpoints(emulator));
76
+ app.use("/v0", (0, firebase_1.createFirebaseEndpoints)(emulator));
77
+ app.use("/", (0, gcloud_1.createCloudEndpoints)(emulator));
78
78
  return Promise.resolve(app);
79
79
  }
80
80
  exports.createApp = createApp;
@@ -19,7 +19,7 @@ async function check(projectId, apiName, prefix, silent = false) {
19
19
  const res = await apiClient.get(`/projects/${projectId}/services/${apiName}`);
20
20
  const isEnabled = res.body.state === "ENABLED";
21
21
  if (isEnabled && !silent) {
22
- utils.logLabeledSuccess(prefix, `required API ${cli_color_1.bold(apiName)} is enabled`);
22
+ utils.logLabeledSuccess(prefix, `required API ${(0, cli_color_1.bold)(apiName)} is enabled`);
23
23
  }
24
24
  return isEnabled;
25
25
  }
@@ -29,8 +29,8 @@ async function enable(projectId, apiName) {
29
29
  await apiClient.post(`/projects/${projectId}/services/${apiName}:enable`);
30
30
  }
31
31
  catch (err) {
32
- if (error_1.isBillingError(err)) {
33
- throw new error_1.FirebaseError(`Your project ${cli_color_1.bold(projectId)} must be on the Blaze (pay-as-you-go) plan to complete this command. Required API ${cli_color_1.bold(apiName)} can't be enabled until the upgrade is complete. To upgrade, visit the following URL:
32
+ if ((0, error_1.isBillingError)(err)) {
33
+ throw new error_1.FirebaseError(`Your project ${(0, cli_color_1.bold)(projectId)} must be on the Blaze (pay-as-you-go) plan to complete this command. Required API ${(0, cli_color_1.bold)(apiName)} can't be enabled until the upgrade is complete. To upgrade, visit the following URL:
34
34
 
35
35
  https://console.firebase.google.com/project/${projectId}/usage/details`);
36
36
  }
@@ -50,27 +50,27 @@ async function pollCheckEnabled(projectId, apiName, prefix, silent, enablementRe
50
50
  return;
51
51
  }
52
52
  if (!silent) {
53
- utils.logLabeledBullet(prefix, `waiting for API ${cli_color_1.bold(apiName)} to activate...`);
53
+ utils.logLabeledBullet(prefix, `waiting for API ${(0, cli_color_1.bold)(apiName)} to activate...`);
54
54
  }
55
55
  return pollCheckEnabled(projectId, apiName, prefix, silent, enablementRetries, pollRetries + 1);
56
56
  }
57
57
  async function enableApiWithRetries(projectId, apiName, prefix, silent, enablementRetries = 0) {
58
58
  if (enablementRetries > 1) {
59
- throw new error_1.FirebaseError(`Timed out waiting for API ${cli_color_1.bold(apiName)} to enable. Please try again in a few minutes.`);
59
+ throw new error_1.FirebaseError(`Timed out waiting for API ${(0, cli_color_1.bold)(apiName)} to enable. Please try again in a few minutes.`);
60
60
  }
61
61
  await enable(projectId, apiName);
62
62
  return pollCheckEnabled(projectId, apiName, prefix, silent, enablementRetries);
63
63
  }
64
64
  async function ensure(projectId, apiName, prefix, silent = false) {
65
65
  if (!silent) {
66
- utils.logLabeledBullet(prefix, `ensuring required API ${cli_color_1.bold(apiName)} is enabled...`);
66
+ utils.logLabeledBullet(prefix, `ensuring required API ${(0, cli_color_1.bold)(apiName)} is enabled...`);
67
67
  }
68
68
  const isEnabled = await check(projectId, apiName, prefix, silent);
69
69
  if (isEnabled) {
70
70
  return;
71
71
  }
72
72
  if (!silent) {
73
- utils.logLabeledWarning(prefix, `missing required API ${cli_color_1.bold(apiName)}. Enabling now...`);
73
+ utils.logLabeledWarning(prefix, `missing required API ${(0, cli_color_1.bold)(apiName)}. Enabling now...`);
74
74
  }
75
75
  return enableApiWithRetries(projectId, apiName, prefix, silent);
76
76
  }
package/lib/error.js CHANGED
@@ -9,12 +9,12 @@ class FirebaseError extends Error {
9
9
  constructor(message, options = {}) {
10
10
  super();
11
11
  this.name = "FirebaseError";
12
- this.children = lodash_1.defaultTo(options.children, DEFAULT_CHILDREN);
12
+ this.children = (0, lodash_1.defaultTo)(options.children, DEFAULT_CHILDREN);
13
13
  this.context = options.context;
14
- this.exit = lodash_1.defaultTo(options.exit, DEFAULT_EXIT);
14
+ this.exit = (0, lodash_1.defaultTo)(options.exit, DEFAULT_EXIT);
15
15
  this.message = message;
16
16
  this.original = options.original;
17
- this.status = lodash_1.defaultTo(options.status, DEFAULT_STATUS);
17
+ this.status = (0, lodash_1.defaultTo)(options.status, DEFAULT_STATUS);
18
18
  }
19
19
  }
20
20
  exports.FirebaseError = FirebaseError;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.promptForPublisherTOS = exports.displayApis = exports.displayRoles = exports.retrieveRoleInfo = exports.formatDescription = void 0;
4
4
  const _ = require("lodash");
5
5
  const clc = require("cli-color");
6
- const marked = require("marked");
6
+ const { marked } = require("marked");
7
7
  const TerminalRenderer = require("marked-terminal");
8
8
  const error_1 = require("../error");
9
9
  const extensionsHelper_1 = require("../extensions/extensionsHelper");
@@ -56,13 +56,12 @@ async function promptForPublisherTOS() {
56
56
  " - If Google requests a critical security matter to be patched for your extension, you will respond to Google within 48 hours with either a resolution or a written resolution plan.\n" +
57
57
  " - Google may remove your extension or terminate the agreement, if you violate any terms.";
58
58
  utils.logLabeledBullet(extensionsHelper_1.logPrefix, marked(termsOfServiceMsg));
59
- const question = {
59
+ const consented = await (0, prompt_1.promptOnce)({
60
60
  name: "consent",
61
61
  type: "confirm",
62
62
  message: marked("Do you accept the [Firebase Extensions Publisher Terms and Conditions](https://firebase.google.com/docs/extensions/alpha/terms-of-service) and acknowledge that your information will be used in accordance with [Google's Privacy Policy](https://policies.google.com/privacy?hl=en)?"),
63
63
  default: false,
64
- };
65
- const consented = await prompt_1.promptOnce(question);
64
+ });
66
65
  if (!consented) {
67
66
  throw new error_1.FirebaseError("You must agree to the terms of service to register a publisher ID.", {
68
67
  exit: 1,
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ask = exports.getInquirerDefault = exports.promptCreateSecret = exports.askForParam = exports.checkResponse = void 0;
4
4
  const _ = require("lodash");
5
5
  const clc = require("cli-color");
6
- const marked = require("marked");
6
+ const { marked } = require("marked");
7
7
  const extensionsApi_1 = require("./extensionsApi");
8
8
  const secretManagerApi = require("../gcp/secretManager");
9
9
  const secretsUtils = require("./secretsUtils");
@@ -64,7 +64,7 @@ async function askForParam(projectId, instanceId, paramSpec, reconfiguring) {
64
64
  while (!valid) {
65
65
  switch (paramSpec.type) {
66
66
  case extensionsApi_1.ParamType.SELECT:
67
- response = await prompt_1.promptOnce({
67
+ response = await (0, prompt_1.promptOnce)({
68
68
  name: "input",
69
69
  type: "list",
70
70
  default: () => {
@@ -75,12 +75,12 @@ async function askForParam(projectId, instanceId, paramSpec, reconfiguring) {
75
75
  message: "Which option do you want enabled for this parameter? " +
76
76
  "Select an option with the arrow keys, and use Enter to confirm your choice. " +
77
77
  "You may only select one option.",
78
- choices: utils_1.convertExtensionOptionToLabeledList(paramSpec.options),
78
+ choices: (0, utils_1.convertExtensionOptionToLabeledList)(paramSpec.options),
79
79
  });
80
80
  valid = checkResponse(response, paramSpec);
81
81
  break;
82
82
  case extensionsApi_1.ParamType.MULTISELECT:
83
- response = await utils_1.onceWithJoin({
83
+ response = await (0, utils_1.onceWithJoin)({
84
84
  name: "input",
85
85
  type: "checkbox",
86
86
  default: () => {
@@ -94,7 +94,7 @@ async function askForParam(projectId, instanceId, paramSpec, reconfiguring) {
94
94
  message: "Which options do you want enabled for this parameter? " +
95
95
  "Press Space to select, then Enter to confirm your choices. " +
96
96
  "You may select multiple options.",
97
- choices: utils_1.convertExtensionOptionToLabeledList(paramSpec.options),
97
+ choices: (0, utils_1.convertExtensionOptionToLabeledList)(paramSpec.options),
98
98
  });
99
99
  valid = checkResponse(response, paramSpec);
100
100
  break;
@@ -105,7 +105,7 @@ async function askForParam(projectId, instanceId, paramSpec, reconfiguring) {
105
105
  valid = true;
106
106
  break;
107
107
  default:
108
- response = await prompt_1.promptOnce({
108
+ response = await (0, prompt_1.promptOnce)({
109
109
  name: paramSpec.param,
110
110
  type: "input",
111
111
  default: paramSpec.default,
@@ -118,7 +118,7 @@ async function askForParam(projectId, instanceId, paramSpec, reconfiguring) {
118
118
  }
119
119
  exports.askForParam = askForParam;
120
120
  async function promptReconfigureSecret(projectId, instanceId, paramSpec) {
121
- const action = await prompt_1.promptOnce({
121
+ const action = await (0, prompt_1.promptOnce)({
122
122
  type: "list",
123
123
  message: `Choose what you would like to do with this secret:`,
124
124
  choices: [
@@ -137,7 +137,7 @@ async function promptReconfigureSecret(projectId, instanceId, paramSpec) {
137
137
  else {
138
138
  secretName = await generateSecretName(projectId, instanceId, paramSpec.param);
139
139
  }
140
- const secretValue = await prompt_1.promptOnce({
140
+ const secretValue = await (0, prompt_1.promptOnce)({
141
141
  name: paramSpec.param,
142
142
  type: "password",
143
143
  message: `This secret will be stored in Cloud Secret Manager as ${secretName}.\nEnter new value for ${paramSpec.label.trim()}:`,
@@ -167,7 +167,7 @@ async function promptReconfigureSecret(projectId, instanceId, paramSpec) {
167
167
  }
168
168
  async function promptCreateSecret(projectId, instanceId, paramSpec, secretName) {
169
169
  const name = secretName !== null && secretName !== void 0 ? secretName : (await generateSecretName(projectId, instanceId, paramSpec.param));
170
- const secretValue = await prompt_1.promptOnce({
170
+ const secretValue = await (0, prompt_1.promptOnce)({
171
171
  name: paramSpec.param,
172
172
  type: "password",
173
173
  default: paramSpec.default,
@@ -194,7 +194,7 @@ exports.promptCreateSecret = promptCreateSecret;
194
194
  async function generateSecretName(projectId, instanceId, paramName) {
195
195
  let secretName = `ext-${instanceId}-${paramName}`;
196
196
  while (await secretManagerApi.secretExists(projectId, secretName)) {
197
- secretName += `-${utils_1.getRandomString(3)}`;
197
+ secretName += `-${(0, utils_1.getRandomString)(3)}`;
198
198
  }
199
199
  return secretName;
200
200
  }
@@ -216,7 +216,7 @@ async function ask(projectId, instanceId, paramSpecs, firebaseProjectParams, rec
216
216
  return {};
217
217
  }
218
218
  utils.logLabeledBullet(extensionsHelper_1.logPrefix, "answer the questions below to configure your extension:");
219
- const substituted = extensionsHelper_1.substituteParams(paramSpecs, firebaseProjectParams);
219
+ const substituted = (0, extensionsHelper_1.substituteParams)(paramSpecs, firebaseProjectParams);
220
220
  const result = {};
221
221
  const promises = _.map(substituted, (paramSpec) => {
222
222
  return async () => {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.displayNode10CreateBillingNotice = exports.displayNode10UpdateBillingNotice = void 0;
4
- const marked = require("marked");
4
+ const { marked } = require("marked");
5
5
  const TerminalRenderer = require("marked-terminal");
6
6
  const error_1 = require("../error");
7
7
  const extensionsHelper_1 = require("./extensionsHelper");
@@ -46,7 +46,7 @@ async function displayNode10CreateBillingNotice(spec, prompt) {
46
46
  if (hasRuntime(spec, "nodejs10")) {
47
47
  utils.logLabeledWarning(extensionsHelper_1.logPrefix, marked(billingMsgCreate));
48
48
  if (prompt) {
49
- const continueUpdate = await prompt_1.promptOnce({
49
+ const continueUpdate = await (0, prompt_1.promptOnce)({
50
50
  type: "confirm",
51
51
  message: "Do you wish to continue?",
52
52
  default: true,
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseChangelog = exports.getLocalChangelog = exports.breakingChangesInUpdate = exports.displayReleaseNotes = exports.getReleaseNotesForUpdate = void 0;
4
4
  const clc = require("cli-color");
5
- const marked = require("marked");
5
+ const { marked } = require("marked");
6
6
  const path = require("path");
7
7
  const semver = require("semver");
8
8
  const TerminalRenderer = require("marked-terminal");
@@ -20,7 +20,7 @@ const VERSION_LINE_REGEX = /##.*(\d+\.\d+\.\d+).*/;
20
20
  async function getReleaseNotesForUpdate(args) {
21
21
  const releaseNotes = {};
22
22
  const filter = `id<="${args.toVersion}" AND id>"${args.fromVersion}"`;
23
- const extensionVersions = await extensionsApi_1.listExtensionVersions(args.extensionRef, filter);
23
+ const extensionVersions = await (0, extensionsApi_1.listExtensionVersions)(args.extensionRef, filter);
24
24
  extensionVersions.sort((ev1, ev2) => {
25
25
  return -semver.compare(ev1.spec.version, ev2.spec.version);
26
26
  });
@@ -47,7 +47,7 @@ function displayReleaseNotes(releaseNotes, fromVersion) {
47
47
  }
48
48
  logger_1.logger.info(clc.bold("What's new with this update:"));
49
49
  if (breakingVersions.length) {
50
- utils_1.logLabeledWarning("warning", "This is a major version update, which means it may contain breaking changes." +
50
+ (0, utils_1.logLabeledWarning)("warning", "This is a major version update, which means it may contain breaking changes." +
51
51
  " Read the release notes carefully before continuing with this update.");
52
52
  }
53
53
  logger_1.logger.info(table.toString());
@@ -67,7 +67,7 @@ function breakingChangesInUpdate(versionsInUpdate) {
67
67
  }
68
68
  exports.breakingChangesInUpdate = breakingChangesInUpdate;
69
69
  function getLocalChangelog(directory) {
70
- const rawChangelog = localHelper_1.readFile(path.resolve(directory, EXTENSIONS_CHANGELOG));
70
+ const rawChangelog = (0, localHelper_1.readFile)(path.resolve(directory, EXTENSIONS_CHANGELOG));
71
71
  return parseChangelog(rawChangelog);
72
72
  }
73
73
  exports.getLocalChangelog = getLocalChangelog;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.printSourceDownloadLink = exports.displayUpdateChangesRequiringConfirmation = exports.displayUpdateChangesNoInput = exports.displayExtInfo = void 0;
4
4
  const _ = require("lodash");
5
5
  const clc = require("cli-color");
6
- const marked = require("marked");
6
+ const { marked } = require("marked");
7
7
  const TerminalRenderer = require("marked-terminal");
8
8
  const utils = require("../utils");
9
9
  const extensionsHelper_1 = require("./extensionsHelper");
@@ -78,7 +78,7 @@ async function displayUpdateChangesRequiringConfirmation(args) {
78
78
  deletionColor(args.spec.license ? `- ${args.spec.license}\n` : "- None\n") +
79
79
  additionColor(args.newSpec.license ? `+ ${args.newSpec.license}\n` : "+ None\n");
80
80
  logger_1.logger.info(message);
81
- if (!(await extensionsHelper_1.confirm({ nonInteractive: args.nonInteractive, force: args.force, default: true }))) {
81
+ if (!(await (0, extensionsHelper_1.confirm)({ nonInteractive: args.nonInteractive, force: args.force, default: true }))) {
82
82
  throw new error_1.FirebaseError("Unable to update this extension instance without explicit consent for the change to 'License'.");
83
83
  }
84
84
  }
@@ -93,7 +93,7 @@ async function displayUpdateChangesRequiringConfirmation(args) {
93
93
  message += additionColor(`+ ${api.apiName} (${api.reason})\n`);
94
94
  });
95
95
  logger_1.logger.info(message);
96
- if (!(await extensionsHelper_1.confirm({ nonInteractive: args.nonInteractive, force: args.force, default: true }))) {
96
+ if (!(await (0, extensionsHelper_1.confirm)({ nonInteractive: args.nonInteractive, force: args.force, default: true }))) {
97
97
  throw new error_1.FirebaseError("Unable to update this extension instance without explicit consent for the change to 'APIs'.");
98
98
  }
99
99
  }
@@ -108,7 +108,7 @@ async function displayUpdateChangesRequiringConfirmation(args) {
108
108
  message += additionColor(`+ ${getResourceReadableName(resource)}`);
109
109
  });
110
110
  logger_1.logger.info(message);
111
- if (!(await extensionsHelper_1.confirm({ nonInteractive: args.nonInteractive, force: args.force, default: true }))) {
111
+ if (!(await (0, extensionsHelper_1.confirm)({ nonInteractive: args.nonInteractive, force: args.force, default: true }))) {
112
112
  throw new error_1.FirebaseError("Unable to update this extension instance without explicit consent for the change to 'Resources'.");
113
113
  }
114
114
  }
@@ -123,13 +123,13 @@ async function displayUpdateChangesRequiringConfirmation(args) {
123
123
  message += additionColor(`+ ${role.role} (${role.reason})\n`);
124
124
  });
125
125
  logger_1.logger.info(message);
126
- if (!(await extensionsHelper_1.confirm({ nonInteractive: args.nonInteractive, force: args.force, default: true }))) {
126
+ if (!(await (0, extensionsHelper_1.confirm)({ nonInteractive: args.nonInteractive, force: args.force, default: true }))) {
127
127
  throw new error_1.FirebaseError("Unable to update this extension instance without explicit consent for the change to 'Permissions'.");
128
128
  }
129
129
  }
130
130
  if (!args.spec.billingRequired && args.newSpec.billingRequired) {
131
131
  logger_1.logger.info("Billing is now required for the new version of this extension.");
132
- if (!(await extensionsHelper_1.confirm({ nonInteractive: args.nonInteractive, force: args.force, default: true }))) {
132
+ if (!(await (0, extensionsHelper_1.confirm)({ nonInteractive: args.nonInteractive, force: args.force, default: true }))) {
133
133
  throw new error_1.FirebaseError("Unable to update this extension instance without explicit consent for the change to 'BillingRequired'.");
134
134
  }
135
135
  }
@@ -36,7 +36,7 @@ async function buildOptions(options) {
36
36
  }
37
37
  exports.buildOptions = buildOptions;
38
38
  function getParams(options, extensionSpec) {
39
- const projectId = projectUtils_1.needProjectId(options);
39
+ const projectId = (0, projectUtils_1.needProjectId)(options);
40
40
  const userParams = paramHelper.readEnvFile(options.testParams);
41
41
  const autoParams = {
42
42
  PROJECT_ID: projectId,
@@ -54,7 +54,7 @@ function readFileFromDirectory(directory, file) {
54
54
  exports.readFileFromDirectory = readFileFromDirectory;
55
55
  function getFunctionResourcesWithParamSubstitution(extensionSpec, params) {
56
56
  const rawResources = extensionSpec.resources.filter((resource) => validFunctionTypes.includes(resource.type));
57
- return extensionsHelper_1.substituteParams(rawResources, params);
57
+ return (0, extensionsHelper_1.substituteParams)(rawResources, params);
58
58
  }
59
59
  exports.getFunctionResourcesWithParamSubstitution = getFunctionResourcesWithParamSubstitution;
60
60
  function getFunctionProperties(resources) {
@@ -25,7 +25,7 @@ function functionResourceToEmulatedTriggerDefintion(resource) {
25
25
  etd.httpsTrigger = properties.httpsTrigger;
26
26
  }
27
27
  else if (properties.eventTrigger) {
28
- properties.eventTrigger.service = functionsEmulatorShared_1.getServiceFromEventType(properties.eventTrigger.eventType);
28
+ properties.eventTrigger.service = (0, functionsEmulatorShared_1.getServiceFromEventType)(properties.eventTrigger.eventType);
29
29
  etd.eventTrigger = properties.eventTrigger;
30
30
  }
31
31
  else {
@@ -25,13 +25,13 @@ function parameterizeProject(projectId, projectNumber, spec) {
25
25
  exports.parameterizeProject = parameterizeProject;
26
26
  async function setSecretParamsToLatest(spec) {
27
27
  const newParams = Object.assign({}, spec.params);
28
- const extensionVersion = await planner_1.getExtensionVersion(spec);
29
- const activeSecrets = secretsUtils_1.getActiveSecrets(extensionVersion.spec, newParams);
28
+ const extensionVersion = await (0, planner_1.getExtensionVersion)(spec);
29
+ const activeSecrets = (0, secretsUtils_1.getActiveSecrets)(extensionVersion.spec, newParams);
30
30
  for (const [key, val] of Object.entries(newParams)) {
31
31
  if (activeSecrets.includes(val)) {
32
- const parsed = secretManager_1.parseSecretVersionResourceName(val);
32
+ const parsed = (0, secretManager_1.parseSecretVersionResourceName)(val);
33
33
  parsed.versionId = "latest";
34
- newParams[key] = secretManager_1.toSecretVersionResourceName(parsed);
34
+ newParams[key] = (0, secretManager_1.toSecretVersionResourceName)(parsed);
35
35
  }
36
36
  }
37
37
  return Object.assign(Object.assign({}, spec), { params: newParams });
@@ -52,7 +52,7 @@ exports.displayExportInfo = displayExportInfo;
52
52
  function displaySpecs(specs) {
53
53
  for (let i = 0; i < specs.length; i++) {
54
54
  const spec = specs[i];
55
- logger_1.logger.info(`${i + 1}. ${deploymentSummary_1.humanReadable(spec)}`);
55
+ logger_1.logger.info(`${i + 1}. ${(0, deploymentSummary_1.humanReadable)(spec)}`);
56
56
  logger_1.logger.info(`Configuration will be written to 'extensions/${spec.instanceId}.env'`);
57
57
  for (const p of Object.entries(spec.params)) {
58
58
  logger_1.logger.info(`\t${p[0]}=${p[1]}`);
@@ -87,7 +87,7 @@ async function writeFiles(have, options) {
87
87
  const currentExtensions = Object.entries(existingConfig.get("extensions"))
88
88
  .map((i) => `${i[0]}: ${i[1]}`)
89
89
  .join("\n\t");
90
- const overwrite = await prompt_1.promptOnce({
90
+ const overwrite = await (0, prompt_1.promptOnce)({
91
91
  type: "list",
92
92
  message: `firebase.json already contains extensions:\n${currentExtensions}\nWould you like to overwrite or merge?`,
93
93
  choices: [