firebase-tools 10.0.1 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/lib/api.js +1 -0
  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 +2 -2
  22. package/lib/commands/database-set.js +2 -2
  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 +2 -2
  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 +1 -1
  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 +1 -1
  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 +4 -4
  87. package/lib/deploy/functions/ensureCloudBuildEnabled.js +3 -3
  88. package/lib/deploy/functions/index.js +1 -0
  89. package/lib/deploy/functions/prepare.js +13 -13
  90. package/lib/deploy/functions/prompts.js +5 -5
  91. package/lib/deploy/functions/release/executor.js +4 -1
  92. package/lib/deploy/functions/release/fabricator.js +5 -5
  93. package/lib/deploy/functions/release/index.js +2 -2
  94. package/lib/deploy/functions/release/planner.js +6 -6
  95. package/lib/deploy/functions/release/reporter.js +8 -4
  96. package/lib/deploy/functions/runtimes/discovery/index.js +2 -2
  97. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +14 -14
  98. package/lib/deploy/functions/runtimes/golang/index.js +6 -6
  99. package/lib/deploy/functions/runtimes/node/index.js +3 -3
  100. package/lib/deploy/functions/runtimes/node/parseTriggers.js +3 -3
  101. package/lib/deploy/functions/services/storage.js +1 -1
  102. package/lib/deploy/functions/triggerRegionHelper.js +1 -1
  103. package/lib/deploy/hosting/deploy.js +7 -7
  104. package/lib/deploy/hosting/uploader.js +1 -1
  105. package/lib/deploy/hosting/validate.js +3 -3
  106. package/lib/deploy/remoteconfig/prepare.js +3 -3
  107. package/lib/deploy/remoteconfig/release.js +3 -3
  108. package/lib/deploy/storage/deploy.js +1 -1
  109. package/lib/deploy/storage/release.js +2 -2
  110. package/lib/detectProjectRoot.js +5 -5
  111. package/lib/emulator/auth/apiSpec.js +13 -7
  112. package/lib/emulator/auth/handlers.js +3 -3
  113. package/lib/emulator/auth/index.js +1 -1
  114. package/lib/emulator/auth/operations.js +256 -248
  115. package/lib/emulator/auth/server.js +11 -8
  116. package/lib/emulator/auth/state.js +12 -12
  117. package/lib/emulator/auth/widget_ui.js +1 -1
  118. package/lib/emulator/commandUtils.js +5 -5
  119. package/lib/emulator/controller.js +16 -11
  120. package/lib/emulator/downloadableEmulators.js +2 -2
  121. package/lib/emulator/emulatorLogger.js +1 -1
  122. package/lib/emulator/functionsEmulator.js +101 -74
  123. package/lib/emulator/functionsEmulatorRuntime.js +32 -17
  124. package/lib/emulator/functionsEmulatorShell.js +3 -2
  125. package/lib/emulator/functionsRuntimeWorker.js +1 -1
  126. package/lib/emulator/hubExport.js +2 -2
  127. package/lib/emulator/storage/apis/firebase.js +2 -2
  128. package/lib/emulator/storage/apis/gcloud.js +2 -2
  129. package/lib/emulator/storage/cloudFunctions.js +1 -1
  130. package/lib/emulator/storage/files.js +14 -14
  131. package/lib/emulator/storage/index.js +2 -2
  132. package/lib/emulator/storage/metadata.js +7 -6
  133. package/lib/emulator/storage/rules/runtime.js +5 -5
  134. package/lib/emulator/storage/server.js +2 -2
  135. package/lib/ensureApiEnabled.js +7 -7
  136. package/lib/error.js +3 -3
  137. package/lib/extensions/askUserForConsent.js +2 -3
  138. package/lib/extensions/askUserForParam.js +10 -10
  139. package/lib/extensions/billingMigrationHelper.js +1 -1
  140. package/lib/extensions/changelog.js +3 -3
  141. package/lib/extensions/displayExtensionInfo.js +5 -5
  142. package/lib/extensions/emulator/optionsHelper.js +1 -1
  143. package/lib/extensions/emulator/specHelper.js +1 -1
  144. package/lib/extensions/emulator/triggerHelper.js +1 -1
  145. package/lib/extensions/export.js +6 -6
  146. package/lib/extensions/extensionsApi.js +14 -1
  147. package/lib/extensions/extensionsHelper.js +38 -29
  148. package/lib/extensions/listExtensions.js +1 -1
  149. package/lib/extensions/localHelper.js +1 -1
  150. package/lib/extensions/metricsTypeDef.js +2 -0
  151. package/lib/extensions/metricsUtils.js +98 -0
  152. package/lib/extensions/paramHelper.js +6 -6
  153. package/lib/extensions/provisioningHelper.js +6 -4
  154. package/lib/extensions/resolveSource.js +1 -1
  155. package/lib/extensions/secretsUtils.js +3 -3
  156. package/lib/extensions/updateHelper.js +9 -9
  157. package/lib/extensions/utils.js +1 -1
  158. package/lib/extensions/warnings.js +10 -9
  159. package/lib/fetchWebSetup.js +2 -2
  160. package/lib/filterTargets.js +2 -2
  161. package/lib/firestore/indexes.js +2 -2
  162. package/lib/fsAsync.js +3 -3
  163. package/lib/fsutils.js +2 -2
  164. package/lib/functional.js +2 -1
  165. package/lib/functions/env.js +1 -1
  166. package/lib/functions/runtimeConfigExport.js +4 -4
  167. package/lib/functionsConfig.js +3 -3
  168. package/lib/functionsShellCommandAction.js +4 -3
  169. package/lib/gcp/cloudmonitoring.js +74 -0
  170. package/lib/gcp/cloudscheduler.js +1 -1
  171. package/lib/gcp/iam.js +2 -2
  172. package/lib/gcp/resourceManager.js +2 -2
  173. package/lib/gcp/secretManager.js +3 -2
  174. package/lib/getDefaultDatabaseInstance.js +1 -1
  175. package/lib/getDefaultHostingSite.js +1 -1
  176. package/lib/getProjectNumber.js +2 -2
  177. package/lib/handlePreviewToggles.js +5 -5
  178. package/lib/hosting/api.js +6 -6
  179. package/lib/hosting/cloudRunProxy.js +6 -6
  180. package/lib/hosting/functionsProxy.js +3 -3
  181. package/lib/hosting/implicitInit.js +2 -2
  182. package/lib/hosting/normalizedHostingConfigs.js +3 -3
  183. package/lib/hosting/proxy.js +2 -2
  184. package/lib/init/features/account.js +7 -7
  185. package/lib/init/features/database.js +9 -9
  186. package/lib/init/features/emulators.js +8 -8
  187. package/lib/init/features/firestore/index.js +3 -3
  188. package/lib/init/features/firestore/indexes.js +2 -2
  189. package/lib/init/features/firestore/rules.js +2 -2
  190. package/lib/init/features/functions/golang.js +4 -4
  191. package/lib/init/features/functions/index.js +4 -4
  192. package/lib/init/features/hosting/github.js +31 -31
  193. package/lib/init/features/project.js +8 -8
  194. package/lib/init/features/remoteconfig.js +2 -2
  195. package/lib/init/features/storage.js +2 -2
  196. package/lib/listFiles.js +1 -1
  197. package/lib/management/apps.js +3 -3
  198. package/lib/management/projects.js +6 -6
  199. package/lib/previews.js +2 -2
  200. package/lib/profiler.js +1 -1
  201. package/lib/projectPath.js +1 -1
  202. package/lib/projectUtils.js +1 -1
  203. package/lib/prompt.js +0 -1
  204. package/lib/rc.js +1 -1
  205. package/lib/requireAuth.js +2 -2
  206. package/lib/requireDatabaseInstance.js +1 -1
  207. package/lib/requireHostingSite.js +1 -1
  208. package/lib/requirePermissions.js +4 -4
  209. package/lib/rulesDeploy.js +2 -2
  210. package/lib/serve/functions.js +14 -7
  211. package/lib/serve/hosting.js +7 -7
  212. package/lib/utils.js +3 -2
  213. package/npm-shrinkwrap.json +24926 -0
  214. package/package.json +23 -23
  215. package/standalone/firepit.js +4 -4
  216. package/templates/init/hosting/index.html +1 -1
@@ -16,7 +16,7 @@ exports.default = new command_1.Command("hosting:disable")
16
16
  .before(requireHostingSite_1.requireHostingSite)
17
17
  .action(async (options) => {
18
18
  const siteToDisable = options.site;
19
- const confirm = await prompt_1.promptOnce({
19
+ const confirm = await (0, prompt_1.promptOnce)({
20
20
  type: "confirm",
21
21
  name: "force",
22
22
  message: `Are you sure you want to disable Firebase Hosting for the site ${clc.underline(siteToDisable)}\n${clc.underline("This will immediately make your site inaccessible!")}`,
@@ -15,13 +15,13 @@ exports.default = new command_1.Command("hosting:sites:create [siteId]")
15
15
  .option("--app <appId>", "specify an existing Firebase Web App ID")
16
16
  .before(requirePermissions_1.requirePermissions, ["firebasehosting.sites.update"])
17
17
  .action(async (siteId, options) => {
18
- const projectId = projectUtils_1.needProjectId(options);
18
+ const projectId = (0, projectUtils_1.needProjectId)(options);
19
19
  const appId = options.app;
20
20
  if (!siteId) {
21
21
  if (options.nonInteractive) {
22
22
  throw new error_1.FirebaseError(`"siteId" argument must be provided in a non-interactive environment`);
23
23
  }
24
- siteId = await prompt_1.promptOnce({
24
+ siteId = await (0, prompt_1.promptOnce)({
25
25
  type: "input",
26
26
  message: "Please provide an unique, URL-friendly id for the site (<id>.web.app):",
27
27
  validate: (s) => s.length > 0,
@@ -32,20 +32,20 @@ exports.default = new command_1.Command("hosting:sites:create [siteId]")
32
32
  }
33
33
  let site;
34
34
  try {
35
- site = await api_1.createSite(projectId, siteId, appId);
35
+ site = await (0, api_1.createSite)(projectId, siteId, appId);
36
36
  }
37
37
  catch (e) {
38
38
  if (e.status === 409) {
39
- throw new error_1.FirebaseError(`Site ${cli_color_1.bold(siteId)} already exists in project ${cli_color_1.bold(projectId)}.`, { original: e });
39
+ throw new error_1.FirebaseError(`Site ${(0, cli_color_1.bold)(siteId)} already exists in project ${(0, cli_color_1.bold)(projectId)}.`, { original: e });
40
40
  }
41
41
  throw e;
42
42
  }
43
43
  logger_1.logger.info();
44
- utils_1.logLabeledSuccess(LOG_TAG, `Site ${cli_color_1.bold(siteId)} has been created in project ${cli_color_1.bold(projectId)}.`);
44
+ (0, utils_1.logLabeledSuccess)(LOG_TAG, `Site ${(0, cli_color_1.bold)(siteId)} has been created in project ${(0, cli_color_1.bold)(projectId)}.`);
45
45
  if (appId) {
46
- utils_1.logLabeledSuccess(LOG_TAG, `Site ${cli_color_1.bold(siteId)} has been linked to web app ${cli_color_1.bold(appId)}`);
46
+ (0, utils_1.logLabeledSuccess)(LOG_TAG, `Site ${(0, cli_color_1.bold)(siteId)} has been linked to web app ${(0, cli_color_1.bold)(appId)}`);
47
47
  }
48
- utils_1.logLabeledSuccess(LOG_TAG, `Site URL: ${site.defaultUrl}`);
48
+ (0, utils_1.logLabeledSuccess)(LOG_TAG, `Site URL: ${site.defaultUrl}`);
49
49
  logger_1.logger.info();
50
50
  logger_1.logger.info(`To deploy to this site, follow the guide at https://firebase.google.com/docs/hosting/multisites.`);
51
51
  return site;
@@ -17,22 +17,22 @@ exports.default = new command_1.Command("hosting:sites:delete <siteId>")
17
17
  .before(requireConfig)
18
18
  .before(requirePermissions_1.requirePermissions, ["firebasehosting.sites.delete"])
19
19
  .action(async (siteId, options) => {
20
- const projectId = projectUtils_1.needProjectId(options);
20
+ const projectId = (0, projectUtils_1.needProjectId)(options);
21
21
  if (!siteId) {
22
22
  throw new error_1.FirebaseError("siteId is required");
23
23
  }
24
- logger_1.logger.info(`Deleting a site is a permanent action. If you delete a site, Firebase doesn't maintain records of deployed files or deployment history, and the site ${cli_color_1.underline(siteId)} cannot be reactivated by you or anyone else.`);
24
+ logger_1.logger.info(`Deleting a site is a permanent action. If you delete a site, Firebase doesn't maintain records of deployed files or deployment history, and the site ${(0, cli_color_1.underline)(siteId)} cannot be reactivated by you or anyone else.`);
25
25
  logger_1.logger.info();
26
- const confirmed = await prompt_1.promptOnce({
26
+ const confirmed = await (0, prompt_1.promptOnce)({
27
27
  name: "force",
28
28
  type: "confirm",
29
- message: `Are you sure you want to delete the Hosting site ${cli_color_1.underline(siteId)} for project ${cli_color_1.underline(projectId)}? `,
29
+ message: `Are you sure you want to delete the Hosting site ${(0, cli_color_1.underline)(siteId)} for project ${(0, cli_color_1.underline)(projectId)}? `,
30
30
  default: false,
31
31
  }, options);
32
32
  if (!confirmed) {
33
33
  return;
34
34
  }
35
- await api_1.getSite(projectId, siteId);
36
- await api_1.deleteSite(projectId, siteId);
37
- utils_1.logLabeledSuccess(LOG_TAG, `Successfully deleted site ${cli_color_1.bold(siteId)} from project ${cli_color_1.bold(projectId)}`);
35
+ await (0, api_1.getSite)(projectId, siteId);
36
+ await (0, api_1.deleteSite)(projectId, siteId);
37
+ (0, utils_1.logLabeledSuccess)(LOG_TAG, `Successfully deleted site ${(0, cli_color_1.bold)(siteId)} from project ${(0, cli_color_1.bold)(projectId)}`);
38
38
  });
@@ -11,11 +11,11 @@ exports.default = new command_1.Command("hosting:sites:get <siteId>")
11
11
  .description("print info about a Firebase Hosting site")
12
12
  .before(requirePermissions_1.requirePermissions, ["firebasehosting.sites.get"])
13
13
  .action(async (siteId, options) => {
14
- const projectId = projectUtils_1.needProjectId(options);
14
+ const projectId = (0, projectUtils_1.needProjectId)(options);
15
15
  if (!siteId) {
16
16
  throw new error_1.FirebaseError("<siteId> must be specified");
17
17
  }
18
- const site = await api_1.getSite(projectId, siteId);
18
+ const site = await (0, api_1.getSite)(projectId, siteId);
19
19
  const table = new Table();
20
20
  table.push(["Site ID:", site.name.split("/").pop()]);
21
21
  table.push(["Default URL:", site.defaultUrl]);
@@ -12,15 +12,15 @@ exports.default = new command_1.Command("hosting:sites:list")
12
12
  .description("list Firebase Hosting sites")
13
13
  .before(requirePermissions_1.requirePermissions, ["firebasehosting.sites.get"])
14
14
  .action(async (options) => {
15
- const projectId = projectUtils_1.needProjectId(options);
16
- const sites = await api_1.listSites(projectId);
15
+ const projectId = (0, projectUtils_1.needProjectId)(options);
16
+ const sites = await (0, api_1.listSites)(projectId);
17
17
  const table = new Table({ head: TABLE_HEAD, style: { head: ["green"] } });
18
18
  for (const site of sites) {
19
19
  const siteId = site.name.split("/").pop();
20
20
  table.push([siteId, site.defaultUrl, site.appId || "--"]);
21
21
  }
22
22
  logger_1.logger.info();
23
- logger_1.logger.info(`Sites for project ${cli_color_1.bold(projectId)}`);
23
+ logger_1.logger.info(`Sites for project ${(0, cli_color_1.bold)(projectId)}`);
24
24
  logger_1.logger.info();
25
25
  logger_1.logger.info(table.toString());
26
26
  return { sites };
@@ -83,6 +83,7 @@ module.exports = function (client) {
83
83
  client.ext.dev.unpublish = loadCommand("ext-dev-unpublish");
84
84
  client.ext.dev.publish = loadCommand("ext-dev-publish");
85
85
  client.ext.dev.delete = loadCommand("ext-dev-extension-delete");
86
+ client.ext.dev.usage = loadCommand("ext-dev-usage");
86
87
  }
87
88
  client.firestore = {};
88
89
  client.firestore.delete = loadCommand("firestore-delete");
@@ -28,7 +28,7 @@ module.exports = new command_1.Command("login")
28
28
  }
29
29
  if (!options.reauth) {
30
30
  utils.logBullet("Firebase optionally collects CLI usage and error reporting information to help improve our products. Data is collected in accordance with Google's privacy policy (https://policies.google.com/privacy) and is not used to identify you.\n");
31
- const collectUsage = await prompt_1.promptOnce({
31
+ const collectUsage = await (0, prompt_1.promptOnce)({
32
32
  type: "confirm",
33
33
  name: "collectUsage",
34
34
  message: "Allow Firebase to collect CLI usage and error reporting information?",
@@ -38,7 +38,7 @@ module.exports = new command_1.Command("login")
38
38
  utils.logBullet("To change your data collection preference at any time, run `firebase logout` and log in again.");
39
39
  }
40
40
  }
41
- const useLocalhost = utils_1.isCloudEnvironment() ? false : options.localhost;
41
+ const useLocalhost = (0, utils_1.isCloudEnvironment)() ? false : options.localhost;
42
42
  const result = await auth.loginGoogle(useLocalhost, _.get(user, "email"));
43
43
  configstore_1.configstore.set("user", result.user);
44
44
  configstore_1.configstore.set("tokens", result.tokens);
@@ -38,7 +38,7 @@ module.exports = new command_1.Command("logout [email]")
38
38
  value: a,
39
39
  };
40
40
  });
41
- newDefaultAccount = await prompt_1.promptOnce({
41
+ newDefaultAccount = await (0, prompt_1.promptOnce)({
42
42
  type: "list",
43
43
  message: "You are logging out of your default account, which account should become the new default?",
44
44
  choices,
@@ -52,7 +52,7 @@ exports.default = new command_1.Command("open [link]")
52
52
  throw new error_1.FirebaseError("Unrecognized link name. Valid links are:\n\n" + _.map(LINKS, "arg").join("\n"));
53
53
  }
54
54
  if (!link) {
55
- const name = await prompt_1.promptOnce({
55
+ const name = await (0, prompt_1.promptOnce)({
56
56
  type: "list",
57
57
  message: "What link would you like to open?",
58
58
  choices: CHOICES,
@@ -9,10 +9,10 @@ module.exports = new command_1.Command("projects:addfirebase [projectId]")
9
9
  .before(requireAuth_1.requireAuth)
10
10
  .action(async (projectId, options) => {
11
11
  if (!options.nonInteractive && !projectId) {
12
- projectId = await projects_1.promptAvailableProjectId();
12
+ projectId = await (0, projects_1.promptAvailableProjectId)();
13
13
  }
14
14
  if (!projectId) {
15
15
  throw new error_1.FirebaseError("Project ID cannot be empty");
16
16
  }
17
- return projects_1.addFirebaseToCloudProjectAndLog(projectId);
17
+ return (0, projects_1.addFirebaseToCloudProjectAndLog)(projectId);
18
18
  });
@@ -17,7 +17,7 @@ module.exports = new command_1.Command("projects:create [projectId]")
17
17
  throw new error_1.FirebaseError("Invalid argument, please provide only one type of project parent (organization or folder)");
18
18
  }
19
19
  if (!options.nonInteractive) {
20
- await prompt_1.prompt(options, projects_1.PROJECTS_CREATE_QUESTIONS);
20
+ await (0, prompt_1.prompt)(options, projects_1.PROJECTS_CREATE_QUESTIONS);
21
21
  }
22
22
  if (!options.projectId) {
23
23
  throw new error_1.FirebaseError("Project ID cannot be empty");
@@ -29,7 +29,7 @@ module.exports = new command_1.Command("projects:create [projectId]")
29
29
  else if (options.folder) {
30
30
  parentResource = { type: projects_1.ProjectParentResourceType.FOLDER, id: options.folder };
31
31
  }
32
- return projects_1.createFirebaseProjectAndLog(options.projectId, {
32
+ return (0, projects_1.createFirebaseProjectAndLog)(options.projectId, {
33
33
  displayName: options.displayName,
34
34
  parentResource,
35
35
  });
@@ -47,7 +47,7 @@ module.exports = new command_1.Command("projects:list")
47
47
  const spinner = ora("Preparing the list of your Firebase projects").start();
48
48
  let projects;
49
49
  try {
50
- projects = await projects_1.listFirebaseProjects();
50
+ projects = await (0, projects_1.listFirebaseProjects)();
51
51
  }
52
52
  catch (err) {
53
53
  spinner.fail();
@@ -28,7 +28,7 @@ module.exports = new command_1.Command("remoteconfig:get")
28
28
  .before(requirePermissions_1.requirePermissions, ["cloudconfig.configs.get"])
29
29
  .action(async (options) => {
30
30
  utils.assertIsStringOrUndefined(options.versionNumber);
31
- const template = await rcGet.getTemplate(projectUtils_1.needProjectId(options), checkValidOptionalNumber(options.versionNumber));
31
+ const template = await rcGet.getTemplate((0, projectUtils_1.needProjectId)(options), checkValidOptionalNumber(options.versionNumber));
32
32
  const table = new Table({ head: tableHead, style: { head: ["green"] } });
33
33
  if (template.conditions) {
34
34
  let updatedConditions = template.conditions
@@ -40,9 +40,9 @@ module.exports = new command_1.Command("remoteconfig:get")
40
40
  }
41
41
  table.push(["conditions", updatedConditions]);
42
42
  }
43
- const updatedParameters = get_1.parseTemplateForTable(template.parameters);
43
+ const updatedParameters = (0, get_1.parseTemplateForTable)(template.parameters);
44
44
  table.push(["parameters", updatedParameters]);
45
- const updatedParameterGroups = get_1.parseTemplateForTable(template.parameterGroups);
45
+ const updatedParameterGroups = (0, get_1.parseTemplateForTable)(template.parameterGroups);
46
46
  table.push(["parameterGroups", updatedParameterGroups]);
47
47
  table.push(["version", util.inspect(template.version, { showHidden: false, depth: null })]);
48
48
  const fileOut = !!options.output;
@@ -16,7 +16,7 @@ module.exports = new command_1.Command("remoteconfig:rollback")
16
16
  .withForce()
17
17
  .action(async (options) => {
18
18
  var _a;
19
- const templateVersion = await versionslist_1.getVersions(projectUtils_1.needProjectId(options), 1);
19
+ const templateVersion = await (0, versionslist_1.getVersions)((0, projectUtils_1.needProjectId)(options), 1);
20
20
  let targetVersion = 0;
21
21
  if (options.versionNumber) {
22
22
  targetVersion = options.versionNumber;
@@ -34,7 +34,7 @@ module.exports = new command_1.Command("remoteconfig:rollback")
34
34
  `. ` +
35
35
  `Invalid Version Number`);
36
36
  }
37
- const confirm = await prompt_1.promptOnce({
37
+ const confirm = await (0, prompt_1.promptOnce)({
38
38
  type: "confirm",
39
39
  name: "force",
40
40
  message: "Proceed to rollback template to version " + targetVersion + "?",
@@ -43,5 +43,5 @@ module.exports = new command_1.Command("remoteconfig:rollback")
43
43
  if (!confirm) {
44
44
  return;
45
45
  }
46
- return rollback_1.rollbackTemplate(projectUtils_1.needProjectId(options), targetVersion);
46
+ return (0, rollback_1.rollbackTemplate)((0, projectUtils_1.needProjectId)(options), targetVersion);
47
47
  });
@@ -18,7 +18,7 @@ module.exports = new command_1.Command("remoteconfig:versions:list")
18
18
  .before(requireAuth_1.requireAuth)
19
19
  .before(requirePermissions_1.requirePermissions, ["cloudconfig.configs.get"])
20
20
  .action(async (options) => {
21
- const versionsList = await rcVersion.getVersions(projectUtils_1.needProjectId(options), options.limit);
21
+ const versionsList = await rcVersion.getVersions((0, projectUtils_1.needProjectId)(options), options.limit);
22
22
  const table = new Table({ head: tableHead, style: { head: ["green"] } });
23
23
  for (let item = 0; item < versionsList.versions.length; item++) {
24
24
  pushTableContents(table, versionsList.versions[item]);
@@ -6,5 +6,5 @@ const EMULATOR_NAME = "storage";
6
6
  module.exports = new command_1.Command(`setup:emulators:${EMULATOR_NAME}`)
7
7
  .description(`downloads the ${EMULATOR_NAME} emulator`)
8
8
  .action(() => {
9
- return download_1.downloadEmulator(EMULATOR_NAME);
9
+ return (0, download_1.downloadEmulator)(EMULATOR_NAME);
10
10
  });
package/lib/config.js CHANGED
@@ -22,7 +22,7 @@ class Config {
22
22
  this.defaults = {};
23
23
  this.notes = {};
24
24
  this.options = options || {};
25
- this.projectDir = options.projectDir || detectProjectRoot_1.detectProjectRoot(options);
25
+ this.projectDir = options.projectDir || (0, detectProjectRoot_1.detectProjectRoot)(options);
26
26
  this._src = src;
27
27
  if (this._src.firebase) {
28
28
  this.defaults.project = this._src.firebase;
@@ -64,7 +64,7 @@ class Config {
64
64
  });
65
65
  }
66
66
  parseFile(target, filePath) {
67
- const fullPath = projectPath_1.resolveProjectPath(this.options, filePath);
67
+ const fullPath = (0, projectPath_1.resolveProjectPath)(this.options, filePath);
68
68
  const ext = path.extname(filePath);
69
69
  if (!fsutils.fileExistsSync(fullPath)) {
70
70
  throw new error_1.FirebaseError("Parse Error: Imported file " + filePath + " does not exist", {
@@ -148,7 +148,7 @@ class Config {
148
148
  const writeTo = this.path(p);
149
149
  let next;
150
150
  if (fsutils.fileExistsSync(writeTo) && !force) {
151
- next = prompt_1.promptOnce({
151
+ next = (0, prompt_1.promptOnce)({
152
152
  type: "confirm",
153
153
  message: "File " + clc.underline(p) + " already exists. Overwrite?",
154
154
  default: false,
@@ -168,17 +168,17 @@ class Config {
168
168
  });
169
169
  }
170
170
  static load(options, allowMissing) {
171
- const pd = detectProjectRoot_1.detectProjectRoot(options);
171
+ const pd = (0, detectProjectRoot_1.detectProjectRoot)(options);
172
172
  const filename = options.configPath || Config.FILENAME;
173
173
  if (pd) {
174
174
  try {
175
175
  const filePath = path.resolve(pd, path.basename(filename));
176
176
  const data = cjson.load(filePath);
177
- const validator = firebaseConfigValidate_1.getValidator();
177
+ const validator = (0, firebaseConfigValidate_1.getValidator)();
178
178
  const valid = validator(data);
179
179
  if (!valid && validator.errors) {
180
180
  for (const e of validator.errors) {
181
- logger_1.logger.debug(firebaseConfigValidate_1.getErrorMessage(e));
181
+ logger_1.logger.debug((0, firebaseConfigValidate_1.getErrorMessage)(e));
182
182
  }
183
183
  }
184
184
  return new Config(data, options);
@@ -4,11 +4,11 @@ exports.realtimeOriginOrCustomUrl = exports.realtimeOriginOrEmulatorOrCustomUrl
4
4
  const utils_1 = require("../utils");
5
5
  const constants_1 = require("../emulator/constants");
6
6
  function realtimeOriginOrEmulatorOrCustomUrl(host) {
7
- return utils_1.envOverride(constants_1.Constants.FIREBASE_DATABASE_EMULATOR_HOST, utils_1.envOverride("FIREBASE_REALTIME_URL", host), addHttpIfRequired);
7
+ return (0, utils_1.envOverride)(constants_1.Constants.FIREBASE_DATABASE_EMULATOR_HOST, (0, utils_1.envOverride)("FIREBASE_REALTIME_URL", host), addHttpIfRequired);
8
8
  }
9
9
  exports.realtimeOriginOrEmulatorOrCustomUrl = realtimeOriginOrEmulatorOrCustomUrl;
10
10
  function realtimeOriginOrCustomUrl(host) {
11
- return utils_1.envOverride("FIREBASE_REALTIME_URL", host);
11
+ return (0, utils_1.envOverride)("FIREBASE_REALTIME_URL", host);
12
12
  }
13
13
  exports.realtimeOriginOrCustomUrl = realtimeOriginOrCustomUrl;
14
14
  function addHttpIfRequired(val) {
@@ -11,14 +11,14 @@ const secrets_1 = require("./secrets");
11
11
  const validate_1 = require("./validate");
12
12
  async function deploy(context, options, payload) {
13
13
  var _a, _b, _c, _d, _e, _f;
14
- const projectId = projectUtils_1.needProjectId(options);
15
- await validate_1.checkBilling(projectId, options.nonInteractive);
16
- await provisioningHelper_1.bulkCheckProductsProvisioned(projectId, [
14
+ const projectId = (0, projectUtils_1.needProjectId)(options);
15
+ await (0, validate_1.checkBilling)(projectId, options.nonInteractive);
16
+ await (0, provisioningHelper_1.bulkCheckProductsProvisioned)(projectId, [
17
17
  ...((_a = payload.instancesToCreate) !== null && _a !== void 0 ? _a : []),
18
18
  ...((_b = payload.instancesToUpdate) !== null && _b !== void 0 ? _b : []),
19
19
  ...((_c = payload.instancesToConfigure) !== null && _c !== void 0 ? _c : []),
20
20
  ]);
21
- await secrets_1.handleSecretParams(payload, context.have, options.nonInteractive);
21
+ await (0, secrets_1.handleSecretParams)(payload, context.have, options.nonInteractive);
22
22
  const errorHandler = new errors_1.ErrorHandler();
23
23
  const validationQueue = new queue_1.default({
24
24
  retries: 5,
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deletesSummary = exports.configuresSummary = exports.updatesSummary = exports.createsSummary = exports.humanReadable = void 0;
4
4
  const clc = require("cli-color");
5
5
  const refs = require("../../extensions/refs");
6
- exports.humanReadable = (dep) => `${clc.bold(dep.instanceId)} (${dep.ref ? `${refs.toExtensionVersionRef(dep.ref)}` : `Installed from local source`})`;
6
+ const humanReadable = (dep) => `${clc.bold(dep.instanceId)} (${dep.ref ? `${refs.toExtensionVersionRef(dep.ref)}` : `Installed from local source`})`;
7
+ exports.humanReadable = humanReadable;
7
8
  const humanReadableUpdate = (from, to) => {
8
9
  var _a, _b, _c, _d, _e;
9
10
  if (((_a = from.ref) === null || _a === void 0 ? void 0 : _a.publisherId) == ((_b = to.ref) === null || _b === void 0 ? void 0 : _b.publisherId) &&
@@ -18,7 +19,7 @@ const humanReadableUpdate = (from, to) => {
18
19
  }
19
20
  };
20
21
  function createsSummary(toCreate) {
21
- const instancesToCreate = toCreate.map((s) => `\t${exports.humanReadable(s)}`).join("\n");
22
+ const instancesToCreate = toCreate.map((s) => `\t${(0, exports.humanReadable)(s)}`).join("\n");
22
23
  return toCreate.length
23
24
  ? `The following extension instances will be created:\n${instancesToCreate}\n`
24
25
  : "";
@@ -37,14 +38,14 @@ function updatesSummary(toUpdate, have) {
37
38
  }
38
39
  exports.updatesSummary = updatesSummary;
39
40
  function configuresSummary(toConfigure) {
40
- const instancesToConfigure = toConfigure.map((s) => `\t${exports.humanReadable(s)}`).join("\n");
41
+ const instancesToConfigure = toConfigure.map((s) => `\t${(0, exports.humanReadable)(s)}`).join("\n");
41
42
  return toConfigure.length
42
43
  ? `The following extension instances will be configured:\n${instancesToConfigure}\n`
43
44
  : "";
44
45
  }
45
46
  exports.configuresSummary = configuresSummary;
46
47
  function deletesSummary(toDelete) {
47
- const instancesToDelete = toDelete.map((s) => `\t${exports.humanReadable(s)}`).join("\n");
48
+ const instancesToDelete = toDelete.map((s) => `\t${(0, exports.humanReadable)(s)}`).join("\n");
48
49
  return toDelete.length
49
50
  ? `The following extension instances are not listed in 'firebase.json':\n${instancesToDelete}\n`
50
51
  : "";
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.release = exports.deploy = exports.prepare = void 0;
3
4
  var prepare_1 = require("./prepare");
4
5
  Object.defineProperty(exports, "prepare", { enumerable: true, get: function () { return prepare_1.prepare; } });
5
6
  var deploy_1 = require("./deploy");
@@ -34,6 +34,6 @@ function readParams(args) {
34
34
  exports.readParams = readParams;
35
35
  function readParamsFile(projectDir, fileName) {
36
36
  const paramPath = path.join(projectDir, ENV_DIRECTORY, fileName);
37
- const params = paramHelper_1.readEnvFile(paramPath);
37
+ const params = (0, paramHelper_1.readEnvFile)(paramPath);
38
38
  return params;
39
39
  }
@@ -52,15 +52,15 @@ async function want(args) {
52
52
  const instanceId = e[0];
53
53
  const ref = refs.parse(e[1]);
54
54
  ref.version = await resolveVersion(ref);
55
- const params = params_1.readParams({
55
+ const params = (0, params_1.readParams)({
56
56
  projectDir: args.projectDir,
57
57
  instanceId,
58
58
  projectId: args.projectId,
59
59
  projectNumber: args.projectNumber,
60
60
  aliases: args.aliases,
61
61
  });
62
- const autoPopulatedParams = await extensionsHelper_1.getFirebaseProjectParams(args.projectId);
63
- const subbedParams = extensionsHelper_1.substituteParams(params, autoPopulatedParams);
62
+ const autoPopulatedParams = await (0, extensionsHelper_1.getFirebaseProjectParams)(args.projectId);
63
+ const subbedParams = (0, extensionsHelper_1.substituteParams)(params, autoPopulatedParams);
64
64
  instanceSpecs.push({
65
65
  instanceId,
66
66
  ref,
@@ -15,11 +15,11 @@ const secrets_1 = require("./secrets");
15
15
  const warnings_1 = require("../../extensions/warnings");
16
16
  async function prepare(context, options, payload) {
17
17
  var _a;
18
- const projectId = projectUtils_1.needProjectId(options);
19
- const projectNumber = await projectUtils_1.needProjectNumber(options);
20
- const aliases = projectUtils_1.getAliases(options, projectId);
21
- await extensionsHelper_1.ensureExtensionsApiEnabled(options);
22
- await requirePermissions_1.requirePermissions(options, ["firebaseextensions.instances.list"]);
18
+ const projectId = (0, projectUtils_1.needProjectId)(options);
19
+ const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
20
+ const aliases = (0, projectUtils_1.getAliases)(options, projectId);
21
+ await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);
22
+ await (0, requirePermissions_1.requirePermissions)(options, ["firebaseextensions.instances.list"]);
23
23
  context.have = await planner.have(projectId);
24
24
  context.want = await planner.want({
25
25
  projectId,
@@ -30,13 +30,13 @@ async function prepare(context, options, payload) {
30
30
  });
31
31
  const usingSecrets = await Promise.all((_a = context.have) === null || _a === void 0 ? void 0 : _a.map(secrets_1.checkSpecForSecrets));
32
32
  if (usingSecrets.some((i) => i)) {
33
- await secretsUtils_1.ensureSecretManagerApiEnabled(options);
33
+ await (0, secretsUtils_1.ensureSecretManagerApiEnabled)(options);
34
34
  }
35
35
  payload.instancesToCreate = context.want.filter((i) => { var _a; return !((_a = context.have) === null || _a === void 0 ? void 0 : _a.some(matchesInstanceId(i))); });
36
36
  payload.instancesToConfigure = context.want.filter((i) => { var _a; return (_a = context.have) === null || _a === void 0 ? void 0 : _a.some(isConfigure(i)); });
37
37
  payload.instancesToUpdate = context.want.filter((i) => { var _a; return (_a = context.have) === null || _a === void 0 ? void 0 : _a.some(isUpdate(i)); });
38
38
  payload.instancesToDelete = context.have.filter((i) => { var _a; return !((_a = context.want) === null || _a === void 0 ? void 0 : _a.some(matchesInstanceId(i))); });
39
- if (await warnings_1.displayWarningsForDeploy(payload.instancesToCreate)) {
39
+ if (await (0, warnings_1.displayWarningsForDeploy)(payload.instancesToCreate)) {
40
40
  if (!options.force && options.nonInteractive) {
41
41
  throw new error_1.FirebaseError("Pass the --force flag to acknowledge these terms in non-interactive mode");
42
42
  }
@@ -50,7 +50,7 @@ async function prepare(context, options, payload) {
50
50
  throw new error_1.FirebaseError("Deployment cancelled");
51
51
  }
52
52
  }
53
- if (await warnings_1.displayWarningsForDeploy(payload.instancesToCreate)) {
53
+ if (await (0, warnings_1.displayWarningsForDeploy)(payload.instancesToCreate)) {
54
54
  if (!options.force && options.nonInteractive) {
55
55
  throw new error_1.FirebaseError("Pass the --force flag to acknowledge these terms in non-interactive mode");
56
56
  }
@@ -97,7 +97,7 @@ async function prepare(context, options, payload) {
97
97
  permissionsNeeded.push("firebaseextensions.instances.delete");
98
98
  }
99
99
  }
100
- await requirePermissions_1.requirePermissions(options, permissionsNeeded);
100
+ await (0, requirePermissions_1.requirePermissions)(options, permissionsNeeded);
101
101
  }
102
102
  exports.prepare = prepare;
103
103
  const matchesInstanceId = (dep) => (test) => {
@@ -8,7 +8,7 @@ const errors_1 = require("./errors");
8
8
  const projectUtils_1 = require("../../projectUtils");
9
9
  async function release(context, options, payload) {
10
10
  var _a, _b, _c, _d;
11
- const projectId = projectUtils_1.needProjectId(options);
11
+ const projectId = (0, projectUtils_1.needProjectId)(options);
12
12
  const errorHandler = new errors_1.ErrorHandler();
13
13
  const deploymentQueue = new queue_1.default({
14
14
  retries: 5,
@@ -14,14 +14,14 @@ async function handleSecretParams(payload, have, nonInteractive) {
14
14
  var _a, _b, _c;
15
15
  for (const i of (_a = payload.instancesToCreate) !== null && _a !== void 0 ? _a : []) {
16
16
  if (await checkSpecForSecrets(i)) {
17
- utils_1.logLabeledBullet("extensions", `Verifying secret params for ${clc.bold(i.instanceId)}`);
17
+ (0, utils_1.logLabeledBullet)("extensions", `Verifying secret params for ${clc.bold(i.instanceId)}`);
18
18
  await handleSecretsCreateInstance(i, nonInteractive);
19
19
  }
20
20
  }
21
21
  const updates = [...((_b = payload.instancesToUpdate) !== null && _b !== void 0 ? _b : []), ...((_c = payload.instancesToConfigure) !== null && _c !== void 0 ? _c : [])];
22
22
  for (const i of updates) {
23
23
  if (await checkSpecForSecrets(i)) {
24
- utils_1.logLabeledBullet("extensions", `Verifying secret params for ${clc.bold(i.instanceId)}`);
24
+ (0, utils_1.logLabeledBullet)("extensions", `Verifying secret params for ${clc.bold(i.instanceId)}`);
25
25
  const previousSpec = have.find((h) => h.instanceId === i.instanceId);
26
26
  await handleSecretsUpdateInstance(i, previousSpec, nonInteractive);
27
27
  }
@@ -29,7 +29,7 @@ async function handleSecretParams(payload, have, nonInteractive) {
29
29
  }
30
30
  exports.handleSecretParams = handleSecretParams;
31
31
  async function checkSpecForSecrets(i) {
32
- const extensionVersion = await planner_1.getExtensionVersion(i);
32
+ const extensionVersion = await (0, planner_1.getExtensionVersion)(i);
33
33
  return secretUtils.usesSecrets(extensionVersion.spec);
34
34
  }
35
35
  exports.checkSpecForSecrets = checkSpecForSecrets;
@@ -37,15 +37,15 @@ const secretsInSpec = (spec) => {
37
37
  return spec.params.filter((p) => p.type === extensionsApi_1.ParamType.SECRET);
38
38
  };
39
39
  async function handleSecretsCreateInstance(i, nonInteractive) {
40
- const extensionVersion = await planner_1.getExtensionVersion(i);
40
+ const extensionVersion = await (0, planner_1.getExtensionVersion)(i);
41
41
  const secretParams = secretsInSpec(extensionVersion.spec);
42
42
  for (const s of secretParams) {
43
43
  await handleSecretParamForCreate(s, i, nonInteractive);
44
44
  }
45
45
  }
46
46
  async function handleSecretsUpdateInstance(i, prevSpec, nonInteractive) {
47
- const extensionVersion = await planner_1.getExtensionVersion(i);
48
- const prevExtensionVersion = await planner_1.getExtensionVersion(prevSpec);
47
+ const extensionVersion = await (0, planner_1.getExtensionVersion)(i);
48
+ const prevExtensionVersion = await (0, planner_1.getExtensionVersion)(prevSpec);
49
49
  const secretParams = secretsInSpec(extensionVersion.spec);
50
50
  for (const s of secretParams) {
51
51
  const prevParam = prevExtensionVersion.spec.params.find((p) => p.param === s.param);
@@ -146,5 +146,5 @@ async function promptForCreateSecret(args) {
146
146
  if (args.nonInteractive) {
147
147
  throw new error_1.FirebaseError(`To create this secret, run this command in interactive mode, or go to ${secretManager.secretManagerConsoleUri(args.projectId)}`);
148
148
  }
149
- return askUserForParam_1.promptCreateSecret(args.projectId, args.instanceId, args.secretParam, args.secretName);
149
+ return (0, askUserForParam_1.promptCreateSecret)(args.projectId, args.instanceId, args.secretParam, args.secretName);
150
150
  }
@@ -5,13 +5,13 @@ const cloudbilling_1 = require("../../gcp/cloudbilling");
5
5
  const checkProjectBilling_1 = require("../../extensions/checkProjectBilling");
6
6
  const error_1 = require("../../error");
7
7
  async function checkBilling(projectId, nonInteractive) {
8
- const enabled = await cloudbilling_1.checkBillingEnabled(projectId);
8
+ const enabled = await (0, cloudbilling_1.checkBillingEnabled)(projectId);
9
9
  if (!enabled && nonInteractive) {
10
10
  throw new error_1.FirebaseError(`Extensions require the Blaze plan, but project ${projectId} is not on the Blaze plan. ` +
11
11
  `Please visit https://console.cloud.google.com/billing/linkedaccount?project=${projectId} to upgrade your project.`);
12
12
  }
13
13
  else if (!enabled) {
14
- await checkProjectBilling_1.enableBilling(projectId);
14
+ await (0, checkProjectBilling_1.enableBilling)(projectId);
15
15
  }
16
16
  }
17
17
  exports.checkBilling = checkBilling;
@@ -200,12 +200,14 @@ function regionalEndpoints(backend, region) {
200
200
  return backend.endpoints[region] ? Object.values(backend.endpoints[region]) : [];
201
201
  }
202
202
  exports.regionalEndpoints = regionalEndpoints;
203
- exports.hasEndpoint = (backend) => (endpoint) => {
204
- return !!backend.endpoints[endpoint.region] && !!backend.endpoints[endpoint.region][endpoint.id];
203
+ const hasEndpoint = (backend) => (endpoint) => {
204
+ return (!!backend.endpoints[endpoint.region] && !!backend.endpoints[endpoint.region][endpoint.id]);
205
205
  };
206
- exports.missingEndpoint = (backend) => (endpoint) => {
207
- return !exports.hasEndpoint(backend)(endpoint);
206
+ exports.hasEndpoint = hasEndpoint;
207
+ const missingEndpoint = (backend) => (endpoint) => {
208
+ return !(0, exports.hasEndpoint)(backend)(endpoint);
208
209
  };
210
+ exports.missingEndpoint = missingEndpoint;
209
211
  function compareFunctions(left, right) {
210
212
  if (left.platform != right.platform) {
211
213
  return right.platform < left.platform ? -1 : 1;