Açıklama Yok
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.

internaltesting-functions-discover.js 1.2KB

12345678910111213141516171819202122232425
  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 prepare_1 = require("../deploy/functions/prepare");
  7. const projectConfig_1 = require("../functions/projectConfig");
  8. const adminSdkConfig_1 = require("../emulator/adminSdkConfig");
  9. const projectUtils_1 = require("../projectUtils");
  10. const error_1 = require("../error");
  11. exports.command = new command_1.Command("internaltesting:functions:discover")
  12. .description("discover function triggers defined in the current project directory")
  13. .action(async (options) => {
  14. const projectId = (0, projectUtils_1.needProjectId)(options);
  15. const fnConfig = (0, projectConfig_1.normalizeAndValidate)(options.config.src.functions);
  16. const firebaseConfig = await (0, adminSdkConfig_1.getProjectAdminSdkConfigOrCached)(projectId);
  17. if (!firebaseConfig) {
  18. throw new error_1.FirebaseError("Admin SDK config unexpectedly undefined - have you run firebase init?");
  19. }
  20. const builds = await (0, prepare_1.loadCodebases)(fnConfig, options, firebaseConfig, {
  21. firebase: firebaseConfig,
  22. });
  23. logger_1.logger.info(JSON.stringify(builds, null, 2));
  24. return builds;
  25. });