54 lines
1.9 KiB
JavaScript
54 lines
1.9 KiB
JavaScript
const admin = require("firebase-admin");
|
|
|
|
// Use default credentials/environment provided by Cloud Functions.
|
|
// Avoid bundling a service account key and hardcoding project/bucket.
|
|
admin.initializeApp();
|
|
|
|
const db = admin.firestore();
|
|
const REGION = process.env.FIREBASE_REGION || "europe-west1";
|
|
|
|
exports.db = db;
|
|
exports.REGION = REGION;
|
|
|
|
exports.refList = {
|
|
projects: db.collection("projects"),
|
|
playlists: db.collection("playlists"),
|
|
tasks: db.collection("tasks"),
|
|
notifications: db.collection("notifications"),
|
|
users: db.collection("users"),
|
|
projectStreamStats: db.collection("projectStreamStats"),
|
|
projectStreamStatsMonthlyTotals: db.collection(
|
|
"projectStreamStatsMonthlyTotals",
|
|
),
|
|
monthlyPayoutEntries: db.collection("monthlyPayoutEntries"),
|
|
monthlyPayouts: db.collection("monthlyPayouts"),
|
|
};
|
|
exports.refsList = exports.refList;
|
|
|
|
exports.ALERT_TYPE = {
|
|
NEW_LIKE: "NEW_LIKE",
|
|
NEW_COMMENT: "NEW_COMMENT",
|
|
NEW_FOLLOWER: "NEW_FOLLOWER",
|
|
MUSIC_GENERATION_SUCCESS: "MUSIC_GENERATION_SUCCESS",
|
|
MUSIC_GENERATION_FAILED: "MUSIC_GENERATION_FAILED",
|
|
COVER_GENERATION_SUCCESS: "COVER_GENERATION_SUCCESS",
|
|
COVER_GENERATION_FAILED: "COVER_GENERATION_FAILED",
|
|
PAYOUT_AVAILABLE: "PAYOUT_AVAILABLE",
|
|
};
|
|
|
|
// Exporter toutes les fonctions
|
|
exports.users = require("./src/users");
|
|
exports.music = require("./src/music");
|
|
exports.lyrics = require("./src/lyrics");
|
|
exports.cover = require("./src/cover");
|
|
exports.projects = require("./src/project");
|
|
exports.thumbnail = require("./src/thumbnail");
|
|
exports.upload = require("./src/upload");
|
|
exports.algolia = require("./src/algolia");
|
|
exports.notifications = require("./src/notifications");
|
|
exports.rankings = require("./src/rankings");
|
|
exports.payouts = require("./src/payouts");
|
|
exports.subscription = require("./src/subscription");
|
|
exports.youtube = require("./src/youtube");
|
|
exports.orders = require("./src/orders");
|