Няма описание
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.command = void 0;
  4. const command_1 = require("../command");
  5. const utils = require("../utils");
  6. const requireAuth_1 = require("../requireAuth");
  7. const error_1 = require("../error");
  8. const client_1 = require("../appdistribution/client");
  9. const options_parser_util_1 = require("../appdistribution/options-parser-util");
  10. const logger_1 = require("../logger");
  11. exports.command = new command_1.Command("appdistribution:testers:remove [emails...]")
  12. .description("remove testers from a project")
  13. .option("--file <file>", "a path to a file containing a list of tester emails to be removed")
  14. .before(requireAuth_1.requireAuth)
  15. .action(async (emails, options) => {
  16. const projectName = await (0, options_parser_util_1.getProjectName)(options);
  17. const appDistroClient = new client_1.AppDistributionClient();
  18. const emailsArr = (0, options_parser_util_1.getEmails)(emails, options.file);
  19. let deleteResponse;
  20. try {
  21. utils.logBullet(`Deleting ${emailsArr.length} testers from project`);
  22. deleteResponse = await appDistroClient.removeTesters(projectName, emailsArr);
  23. }
  24. catch (err) {
  25. throw new error_1.FirebaseError(`Failed to remove testers ${err}`);
  26. }
  27. if (!deleteResponse.emails) {
  28. utils.logSuccess(`Testers did not exist`);
  29. return;
  30. }
  31. logger_1.logger.debug(`Testers: ${deleteResponse.emails}, have been successfully deleted`);
  32. utils.logSuccess(`${deleteResponse.emails.length} testers have successfully been deleted`);
  33. });