feat: update onboarding and application flows

This commit is contained in:
Jacques_tirot
2026-08-25 15:55:11 +02:00
parent 4fb8a3e1e0
commit bc7edcf3a7
38 changed files with 7234 additions and 289 deletions
+10 -3
View File
@@ -5,7 +5,7 @@ const { SUNO_API_BASE, SUNO_TIMESTAMPED_LYRICS_PATH } = require('../config/suno'
const { GEMINI_API_KEY, SUNO_API_KEY } = require('../config/secrets')
const axios = require('axios')
const { FieldValue } = require('firebase-admin/firestore')
const { refList } = require('../index')
const { REGION, refList } = require('../index')
// --- CONSTANTES DE STRUCTURE ---
// On garde ces mappings car ils sont utiles pour normaliser l'input utilisateur
@@ -59,6 +59,13 @@ const STRUCTURE_ALIASES = {
soft_transition: 'transition_douce',
}
const LYRICS_FUNCTION_OPTIONS = {
region: REGION,
cors: true,
invoker: 'public',
secrets: [GEMINI_API_KEY],
}
// --- UTILITAIRES ---
const normalizeStructureValue = (value) => {
@@ -137,7 +144,7 @@ const buildModerationBrief = ({
// --- GENERATION DE PAROLES (MAIN) ---
exports.generateLyrics = onCall({ secrets: [GEMINI_API_KEY] }, async ({ auth = {}, data = {} }) => {
exports.generateLyrics = onCall(LYRICS_FUNCTION_OPTIONS, async ({ auth = {}, data = {} }) => {
try {
const {
lang: rawLang,
@@ -357,7 +364,7 @@ const softenModerationDecision = (rawResult = {}) => {
}
}
exports.analyseLyricsToxicity = onCall({ secrets: [GEMINI_API_KEY] }, async ({ data = {} }) => {
exports.analyseLyricsToxicity = onCall(LYRICS_FUNCTION_OPTIONS, async ({ data = {} }) => {
try {
const requestSchema = z.object({
title: z.string().optional(),