feat: new secrets

This commit is contained in:
2026-07-20 15:23:16 +02:00
parent 5a6833c1a2
commit 3fff09ba81
18 changed files with 121 additions and 109 deletions
+4 -4
View File
@@ -2,7 +2,7 @@ const { onCall, HttpsError } = require('firebase-functions/v2/https')
const { z } = require('genkit')
const { generateAI, analyseLyrics } = require('../helpers/gemini')
const { SUNO_API_BASE, SUNO_TIMESTAMPED_LYRICS_PATH } = require('../config/suno')
const { SUNO_API_KEY } = require('../config/keys')
const { GEMINI_API_KEY, SUNO_API_KEY } = require('../config/secrets')
const axios = require('axios')
const { FieldValue } = require('firebase-admin/firestore')
const { refList } = require('../index')
@@ -137,7 +137,7 @@ const buildModerationBrief = ({
// --- GENERATION DE PAROLES (MAIN) ---
exports.generateLyrics = onCall({}, async ({ auth = {}, data = {} }) => {
exports.generateLyrics = onCall({ secrets: [GEMINI_API_KEY] }, async ({ auth = {}, data = {} }) => {
try {
const {
objective = '',
@@ -344,7 +344,7 @@ const softenModerationDecision = (rawResult = {}) => {
}
}
exports.analyseLyricsToxicity = onCall({}, async ({ data = {} }) => {
exports.analyseLyricsToxicity = onCall({ secrets: [GEMINI_API_KEY] }, async ({ data = {} }) => {
try {
const requestSchema = z.object({
title: z.string().optional(),
@@ -420,7 +420,7 @@ async function getSunoTimestamps(projectId) {
{
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${SUNO_API_KEY}`,
Authorization: `Bearer ${SUNO_API_KEY.value()}`,
},
timeout: 30000,
}