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.

database-rules-get.js 1.2KB

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.command = void 0;
  4. const command_1 = require("../command");
  5. const logger_1 = require("../logger");
  6. const requireDatabaseInstance_1 = require("../requireDatabaseInstance");
  7. const requirePermissions_1 = require("../requirePermissions");
  8. const metadata = require("../database/metadata");
  9. const types_1 = require("../emulator/types");
  10. const commandUtils_1 = require("../emulator/commandUtils");
  11. exports.command = new command_1.Command("database:rules:get <rulesetId>")
  12. .description("get a realtime database ruleset by id")
  13. .option("--instance <instance>", "use the database <instance>.firebaseio.com (if omitted, uses default database instance)")
  14. .before(requirePermissions_1.requirePermissions, ["firebasedatabase.instances.get"])
  15. .before(requireDatabaseInstance_1.requireDatabaseInstance)
  16. .before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.DATABASE)
  17. .action(async (rulesetId, options) => {
  18. const ruleset = await metadata.getRuleset(options.instance, rulesetId);
  19. logger_1.logger.info(`Ruleset ${ruleset.id} was created at ${ruleset.createdAt}`);
  20. logger_1.logger.info(ruleset.source);
  21. return ruleset;
  22. });