Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
28 lines
797 B
TypeScript
28 lines
797 B
TypeScript
import * as admin from 'firebase-admin'
|
|
|
|
import { initAdmin } from 'shared/init-admin'
|
|
import { getAllPrivateUsers, isProd } from 'shared/utils'
|
|
import { getDefaultNotificationPreferences } from 'common/user-notification-preferences'
|
|
initAdmin()
|
|
|
|
const firestore = admin.firestore()
|
|
|
|
async function main() {
|
|
const privateUsers = await getAllPrivateUsers()
|
|
const disableEmails = !isProd()
|
|
await Promise.all(
|
|
privateUsers.map((privateUser) => {
|
|
if (!privateUser.id) return Promise.resolve()
|
|
return firestore
|
|
.collection('private-users')
|
|
.doc(privateUser.id)
|
|
.update({
|
|
notificationPreferences:
|
|
getDefaultNotificationPreferences(disableEmails),
|
|
})
|
|
})
|
|
)
|
|
}
|
|
|
|
if (require.main === module) main().then(() => process.exit())
|