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
+5761 -109
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -34,7 +34,8 @@
},
"devDependencies": {
"eslint": "^8.15.0",
"eslint-config-google": "^0.14.0"
"eslint-config-google": "^0.14.0",
"firebase-tools": "^15.28.1"
},
"private": true
}
+1 -1
View File
@@ -10,7 +10,6 @@ const path = require('path')
const { ALERT_TYPE, refList } = require('../index')
const { sendNotification } = require('./notifications')
const bucket = admin.storage().bucket()
const COVER_TEMPLATE = 'MUSICLAND_PLAYBACKER'
const COVER_OPTION_ID = 'musicland-playbacker'
const COVER_SIZE = 1024
@@ -147,6 +146,7 @@ async function buildProfileOverlay(profilePictureURL) {
}
async function uploadCover(buffer, targetPath) {
const bucket = admin.storage().bucket()
const token = crypto.randomUUID()
const file = bucket.file(targetPath)
+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(),
+6 -1
View File
@@ -9,7 +9,12 @@ const {
COIN_PACK_PRODUCTS,
} = require('./constants')
const { parseCoinsPerMonth, formatCoinPack } = require('./shared')
const STRIPE_FUNCTION_OPTIONS = { region: REGION, secrets: [STRIPE_SECRET_KEY] }
const STRIPE_FUNCTION_OPTIONS = {
region: REGION,
cors: true,
invoker: 'public',
secrets: [STRIPE_SECRET_KEY],
}
const formatPlan = (price, priceId) => {
if (!price || typeof price !== 'object') {
+6 -1
View File
@@ -18,7 +18,12 @@ const {
const { refsList, formatCoinPack, getSubscriptionMetaFromPrice } = require('./shared')
const CHECKOUT_UI_MODES = new Set(['hosted', 'embedded'])
const STRIPE_FUNCTION_OPTIONS = { region: REGION, secrets: [STRIPE_SECRET_KEY] }
const STRIPE_FUNCTION_OPTIONS = {
region: REGION,
cors: true,
invoker: 'public',
secrets: [STRIPE_SECRET_KEY],
}
const sanitizePriceId = (value) => {
if (typeof value !== 'string') {
+6 -1
View File
@@ -5,7 +5,12 @@ const { STRIPE_SECRET_KEY } = require('../../config/secrets')
const { REGION } = require('./config')
const { CANCELABLE_SUBSCRIPTION_STATUSES, ACTIVE_SUBSCRIPTION_STATUSES } = require('./constants')
const { refsList, formatSubscriptionForClient, resolveUserContext } = require('./shared')
const STRIPE_FUNCTION_OPTIONS = { region: REGION, secrets: [STRIPE_SECRET_KEY] }
const STRIPE_FUNCTION_OPTIONS = {
region: REGION,
cors: true,
invoker: 'public',
secrets: [STRIPE_SECRET_KEY],
}
const cancelActiveSubscription = onCall(STRIPE_FUNCTION_OPTIONS, async (request) => {
try {