2026-06-17 01:25:51 -05:00
|
|
|
import * as functions from 'firebase-functions'
|
2026-06-17 20:26:24 -05:00
|
|
|
import * as admin from 'firebase-admin'
|
|
|
|
|
|
|
|
|
|
// Initialize the Admin SDK once for every function in this codebase.
|
|
|
|
|
// Handlers call admin.firestore()/messaging() lazily at invocation time, so a
|
|
|
|
|
// single idempotent init here is sufficient and avoids "already exists" errors.
|
|
|
|
|
if (admin.apps.length === 0) {
|
|
|
|
|
admin.initializeApp()
|
|
|
|
|
}
|
2026-06-17 01:25:51 -05:00
|
|
|
|
|
|
|
|
export { revenueCatWebhook } from './billing/revenueCatWebhook'
|
|
|
|
|
export { syncEntitlement } from './billing/syncEntitlement'
|
2026-06-17 01:30:04 -05:00
|
|
|
export {
|
|
|
|
|
sendDailyQuestionReminder,
|
|
|
|
|
sendPartnerAnsweredNotification,
|
|
|
|
|
} from './notifications/reminders'
|
2026-06-19 23:47:01 -05:00
|
|
|
export { sendGentleReminderCallable } from './notifications/sendGentleReminderCallable'
|
2026-06-19 02:23:52 -05:00
|
|
|
export {
|
|
|
|
|
sendChallengeDayReminders,
|
|
|
|
|
unlockDueMemoryCapsules,
|
|
|
|
|
} from './notifications/gameRetention'
|
2026-06-17 19:37:19 -05:00
|
|
|
export { checkDeviceIntegrity } from './security/checkDeviceIntegrity'
|
2026-06-17 20:26:24 -05:00
|
|
|
export { createDateMatchOnMutualLove } from './dates/createDateMatch'
|
2026-06-18 00:18:05 -05:00
|
|
|
export {
|
|
|
|
|
assignDailyQuestion,
|
|
|
|
|
assignDailyQuestionCallable,
|
|
|
|
|
} from './questions/assignDailyQuestion'
|
|
|
|
|
export { onAnswerWritten } from './questions/onAnswerWritten'
|
2026-06-20 18:25:05 -05:00
|
|
|
export { onMessageWritten } from './questions/onMessageWritten'
|
2026-06-18 00:25:52 -05:00
|
|
|
export { onCoupleLeave } from './couples/onCoupleLeave'
|
2026-06-19 20:04:18 -05:00
|
|
|
export { leaveCoupleCallable } from './couples/leaveCoupleCallable'
|
2026-06-19 21:46:12 -05:00
|
|
|
export { acceptInviteCallable } from './couples/acceptInviteCallable'
|
2026-06-19 20:04:18 -05:00
|
|
|
export { onUserDelete } from './users/onUserDelete'
|
2026-06-18 00:56:21 -05:00
|
|
|
export { onGameSessionUpdate } from './games/onGameSessionUpdate'
|
2026-06-17 01:25:51 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Basic health check callable.
|
|
|
|
|
* Useful for verifying function deployment and firebase-tools wiring.
|
|
|
|
|
*/
|
|
|
|
|
export const health = functions.https.onRequest((req, res) => {
|
|
|
|
|
res.status(200).json({ status: 'ok' })
|
|
|
|
|
})
|