No Description
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.

askUserForConsent.js 2.5KB

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.promptForPublisherTOS = void 0;
  4. const { marked } = require("marked");
  5. const TerminalRenderer = require("marked-terminal");
  6. const error_1 = require("../error");
  7. const extensionsHelper_1 = require("../extensions/extensionsHelper");
  8. const prompt_1 = require("../prompt");
  9. const utils = require("../utils");
  10. marked.setOptions({
  11. renderer: new TerminalRenderer(),
  12. });
  13. async function promptForPublisherTOS() {
  14. const termsOfServiceMsg = "By registering as a publisher, you confirm that you have read the Firebase Extensions Publisher Terms and Conditions (linked below) and you, on behalf of yourself and the organization you represent, agree to comply with it. Here is a brief summary of the highlights of our terms and conditions:\n" +
  15. " - You ensure extensions you publish comply with all laws and regulations; do not include any viruses, spyware, Trojan horses, or other malicious code; and do not violate any person’s rights, including intellectual property, privacy, and security rights.\n" +
  16. " - You will not engage in any activity that interferes with or accesses in an unauthorized manner the properties or services of Google, Google’s affiliates, or any third party.\n" +
  17. " - If you become aware or should be aware of a critical security issue in your extension, you will provide either a resolution or a written resolution plan within 48 hours.\n" +
  18. " - 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" +
  19. " - Google may remove your extension or terminate the agreement, if you violate any terms.";
  20. utils.logLabeledBullet(extensionsHelper_1.logPrefix, marked(termsOfServiceMsg));
  21. const consented = await (0, prompt_1.promptOnce)({
  22. name: "consent",
  23. type: "confirm",
  24. 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)?"),
  25. default: false,
  26. });
  27. if (!consented) {
  28. throw new error_1.FirebaseError("You must agree to the terms of service to register a publisher ID.", {
  29. exit: 1,
  30. });
  31. }
  32. }
  33. exports.promptForPublisherTOS = promptForPublisherTOS;