2022-05-10 20:59:38 +00:00
|
|
|
import * as admin from 'firebase-admin'
|
2022-07-24 07:26:38 +00:00
|
|
|
import { onRequest } from 'firebase-functions/v2/https'
|
|
|
|
import { EndpointDefinition } from './api'
|
2022-05-15 17:39:42 +00:00
|
|
|
|
2021-12-11 00:06:17 +00:00
|
|
|
admin.initializeApp()
|
|
|
|
|
2022-06-06 19:34:58 +00:00
|
|
|
// v1
|
2022-08-19 22:02:52 +00:00
|
|
|
export * from './on-create-user'
|
2022-05-01 16:36:54 +00:00
|
|
|
export * from './on-create-bet'
|
2022-07-05 23:18:37 +00:00
|
|
|
export * from './on-create-comment-on-contract'
|
2022-05-01 16:36:54 +00:00
|
|
|
export * from './on-view'
|
2022-06-15 00:38:38 +00:00
|
|
|
export * from './update-metrics'
|
2022-06-26 21:42:42 +00:00
|
|
|
export * from './update-stats'
|
2022-08-22 05:22:49 +00:00
|
|
|
export * from './update-loans'
|
2022-01-24 17:42:08 +00:00
|
|
|
export * from './backup-db'
|
2022-06-10 22:48:28 +00:00
|
|
|
export * from './market-close-notifications'
|
2022-06-01 13:11:25 +00:00
|
|
|
export * from './on-create-answer'
|
|
|
|
export * from './on-update-contract'
|
2022-06-08 14:43:24 +00:00
|
|
|
export * from './on-create-contract'
|
2022-06-06 17:36:59 +00:00
|
|
|
export * from './on-follow-user'
|
2022-06-22 16:05:54 +00:00
|
|
|
export * from './on-unfollow-user'
|
2022-06-10 22:48:28 +00:00
|
|
|
export * from './on-create-liquidity-provision'
|
2022-06-22 16:35:50 +00:00
|
|
|
export * from './on-update-group'
|
|
|
|
export * from './on-create-group'
|
2022-07-01 13:47:19 +00:00
|
|
|
export * from './on-update-user'
|
2022-07-05 23:18:37 +00:00
|
|
|
export * from './on-create-comment-on-group'
|
2022-07-06 19:30:51 +00:00
|
|
|
export * from './on-create-txn'
|
2022-07-14 14:02:54 +00:00
|
|
|
export * from './on-delete-group'
|
2022-07-19 22:29:41 +00:00
|
|
|
export * from './score-contracts'
|
2022-08-19 17:43:57 +00:00
|
|
|
export * from './weekly-markets-emails'
|
2022-08-19 17:10:32 +00:00
|
|
|
export * from './reset-betting-streaks'
|
2022-08-22 22:36:39 +00:00
|
|
|
export * from './reset-weekly-emails-flag'
|
2022-08-24 16:49:53 +00:00
|
|
|
export * from './on-update-contract-follow'
|
2022-06-06 19:34:58 +00:00
|
|
|
|
|
|
|
// v2
|
2022-08-04 18:03:02 +00:00
|
|
|
export * from './health'
|
|
|
|
export * from './transact'
|
|
|
|
export * from './change-user-info'
|
|
|
|
export * from './create-user'
|
|
|
|
export * from './create-answer'
|
|
|
|
export * from './place-bet'
|
|
|
|
export * from './cancel-bet'
|
|
|
|
export * from './sell-bet'
|
|
|
|
export * from './sell-shares'
|
|
|
|
export * from './claim-manalink'
|
2022-08-18 16:03:46 +00:00
|
|
|
export * from './create-market'
|
2022-08-04 18:03:02 +00:00
|
|
|
export * from './add-liquidity'
|
|
|
|
export * from './withdraw-liquidity'
|
|
|
|
export * from './create-group'
|
|
|
|
export * from './resolve-market'
|
|
|
|
export * from './unsubscribe'
|
|
|
|
export * from './stripe'
|
|
|
|
export * from './mana-bonus-email'
|
|
|
|
|
2022-07-24 07:26:38 +00:00
|
|
|
import { health } from './health'
|
|
|
|
import { transact } from './transact'
|
|
|
|
import { changeuserinfo } from './change-user-info'
|
|
|
|
import { createuser } from './create-user'
|
|
|
|
import { createanswer } from './create-answer'
|
|
|
|
import { placebet } from './place-bet'
|
|
|
|
import { cancelbet } from './cancel-bet'
|
|
|
|
import { sellbet } from './sell-bet'
|
|
|
|
import { sellshares } from './sell-shares'
|
|
|
|
import { claimmanalink } from './claim-manalink'
|
2022-08-18 16:03:46 +00:00
|
|
|
import { createmarket } from './create-market'
|
2022-07-24 07:26:38 +00:00
|
|
|
import { addliquidity } from './add-liquidity'
|
|
|
|
import { withdrawliquidity } from './withdraw-liquidity'
|
|
|
|
import { creategroup } from './create-group'
|
|
|
|
import { resolvemarket } from './resolve-market'
|
|
|
|
import { unsubscribe } from './unsubscribe'
|
|
|
|
import { stripewebhook, createcheckoutsession } from './stripe'
|
2022-08-02 07:06:23 +00:00
|
|
|
import { getcurrentuser } from './get-current-user'
|
2022-08-04 21:27:02 +00:00
|
|
|
import { acceptchallenge } from './accept-challenge'
|
2022-08-06 03:49:29 +00:00
|
|
|
import { getcustomtoken } from './get-custom-token'
|
2022-07-24 07:26:38 +00:00
|
|
|
|
|
|
|
const toCloudFunction = ({ opts, handler }: EndpointDefinition) => {
|
|
|
|
return onRequest(opts, handler as any)
|
|
|
|
}
|
|
|
|
const healthFunction = toCloudFunction(health)
|
|
|
|
const transactFunction = toCloudFunction(transact)
|
|
|
|
const changeUserInfoFunction = toCloudFunction(changeuserinfo)
|
|
|
|
const createUserFunction = toCloudFunction(createuser)
|
|
|
|
const createAnswerFunction = toCloudFunction(createanswer)
|
|
|
|
const placeBetFunction = toCloudFunction(placebet)
|
|
|
|
const cancelBetFunction = toCloudFunction(cancelbet)
|
|
|
|
const sellBetFunction = toCloudFunction(sellbet)
|
|
|
|
const sellSharesFunction = toCloudFunction(sellshares)
|
|
|
|
const claimManalinkFunction = toCloudFunction(claimmanalink)
|
|
|
|
const createMarketFunction = toCloudFunction(createmarket)
|
|
|
|
const addLiquidityFunction = toCloudFunction(addliquidity)
|
|
|
|
const withdrawLiquidityFunction = toCloudFunction(withdrawliquidity)
|
|
|
|
const createGroupFunction = toCloudFunction(creategroup)
|
|
|
|
const resolveMarketFunction = toCloudFunction(resolvemarket)
|
|
|
|
const unsubscribeFunction = toCloudFunction(unsubscribe)
|
|
|
|
const stripeWebhookFunction = toCloudFunction(stripewebhook)
|
|
|
|
const createCheckoutSessionFunction = toCloudFunction(createcheckoutsession)
|
2022-08-02 07:06:23 +00:00
|
|
|
const getCurrentUserFunction = toCloudFunction(getcurrentuser)
|
2022-08-04 21:27:02 +00:00
|
|
|
const acceptChallenge = toCloudFunction(acceptchallenge)
|
2022-08-06 03:49:29 +00:00
|
|
|
const getCustomTokenFunction = toCloudFunction(getcustomtoken)
|
2022-07-24 07:26:38 +00:00
|
|
|
|
|
|
|
export {
|
|
|
|
healthFunction as health,
|
|
|
|
transactFunction as transact,
|
|
|
|
changeUserInfoFunction as changeuserinfo,
|
|
|
|
createUserFunction as createuser,
|
|
|
|
createAnswerFunction as createanswer,
|
|
|
|
placeBetFunction as placebet,
|
|
|
|
cancelBetFunction as cancelbet,
|
|
|
|
sellBetFunction as sellbet,
|
|
|
|
sellSharesFunction as sellshares,
|
|
|
|
claimManalinkFunction as claimmanalink,
|
|
|
|
createMarketFunction as createmarket,
|
|
|
|
addLiquidityFunction as addliquidity,
|
|
|
|
withdrawLiquidityFunction as withdrawliquidity,
|
|
|
|
createGroupFunction as creategroup,
|
|
|
|
resolveMarketFunction as resolvemarket,
|
|
|
|
unsubscribeFunction as unsubscribe,
|
|
|
|
stripeWebhookFunction as stripewebhook,
|
|
|
|
createCheckoutSessionFunction as createcheckoutsession,
|
2022-08-02 07:06:23 +00:00
|
|
|
getCurrentUserFunction as getcurrentuser,
|
2022-08-04 21:27:02 +00:00
|
|
|
acceptChallenge as acceptchallenge,
|
2022-08-06 03:49:29 +00:00
|
|
|
getCustomTokenFunction as getcustomtoken,
|
2022-07-24 07:26:38 +00:00
|
|
|
}
|