firebase-tools
Version:
Command-Line Interface for Firebase
27 lines (26 loc) • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureGIFApiTos = exports.ensureApis = void 0;
const api = require("../api");
const configstore_1 = require("../configstore");
const ensureApiEnabled_1 = require("../ensureApiEnabled");
const prefix = "dataconnect";
async function ensureApis(projectId, silent = false) {
await Promise.all([
(0, ensureApiEnabled_1.ensure)(projectId, api.dataconnectOrigin(), prefix, silent),
(0, ensureApiEnabled_1.ensure)(projectId, api.cloudSQLAdminOrigin(), prefix, silent),
]);
}
exports.ensureApis = ensureApis;
async function ensureGIFApiTos(projectId) {
if (configstore_1.configstore.get("gemini")) {
await (0, ensureApiEnabled_1.ensure)(projectId, api.cloudAiCompanionOrigin(), "");
}
else {
if (!(await (0, ensureApiEnabled_1.check)(projectId, api.cloudAiCompanionOrigin(), ""))) {
return false;
}
}
return true;
}
exports.ensureGIFApiTos = ensureGIFApiTos;