import * as functions from 'firebase-functions' ; import { CallableContext } from 'firebase-functions/lib/providers/https' ; import { DocumentSnapshot } from './client/firebase-admin' ; import { onCreateGitWebhookRepository , CreateGitWebhookRepositoryInput } from './repository/create-git-webhook-repository' ; import { onCreateRepository } from './repository/create-repository' ; import { onDeleteRepository } from './repository/delete-repository' ; import { getRepositoryInfo , RepositoryInfoInput } from './repository/info' ; import { onResponseGitWebhookRepository } from './repository/response-git-webhook-repository' ; import { onUpdateRepository } from './repository/update-repository' ; import { onCreateUser } from './user/create-user' ; import { getUserEvents , EventsInput } from './user/events' ; import { getUserRepos , ReposInput } from './user/repos' ; import { onUpdateUserStats } from './user/stats' ; import { onUpdateUser } from './user/update-user' ; import { deleteMonitorPings , ping , MonitorInfoInput } from './monitor/monitor' ; import { onDeleteProject } from './project/delete-project' ; import { onUpdateProject } from './project/update-project' ; import { onDeleteGitWebhookRepository , DeleteGitWebhookRepositoryInput } from './repository/delete-git-webhook-repository' ; import { onCreatePings as onCreatePingsStats , onCreateProject as onCreateProjectStats , onCreateUser as onCreateUserStats } from './application/stats' ; import { updateFollowers , updateViews , ProjectInput } from './project/project' ; import { deletePingsAfter30days , runAllMonitors60Mins } from './scheduler/schedule' ; declare type HttpsFunction = functions . HttpsFunction ; declare type CloudFunction < T > = functions . CloudFunction < T > ; declare type Change < T > = functions . Change < T > ; export const findAllUserRepositories = functions . https . onCall ( ( input , context ) => getUserRepos ( input . token , context . auth . uid ) ) ; export const findAllUserEvents = functions . https . onCall ( ( input , context ) => getUserEvents ( input . token , context . auth . uid , input . username ) ) ; export const findRepositoryInfo = functions . https . onCall ( ( input , context ) => getRepositoryInfo ( input . token , input . repository ) ) ; export const createGitWebhookRepository = functions . https . onCall ( ( input , context ) => onCreateGitWebhookRepository ( input . token , input . repositoryUid ) ) ; export const deleteGitWebhookRepository = functions . https . onCall ( ( input , context ) => onDeleteGitWebhookRepository ( input . token , input . data ) ) ; export const responseGitWebhookRepository = onResponseGitWebhookRepository ; export const pingMonitor = functions . https . onCall ( ( input , context ) => ping ( input . projectUid , input . monitorUid , input . type ) ) ; export const deletePingsByMonitor = functions . https . onCall ( ( input , context ) => deleteMonitorPings ( input . projectUid , input . monitorUid ) ) ; export const updateProjectViews = functions . https . onCall ( ( input , context ) => updateViews ( input . projectUid ) ) ; export const updateProjectFollowers = functions . https . onCall ( ( input , context ) => updateFollowers ( input . projectUid , input . increase ) ) ; export const deleteProject = onDeleteProject ; export const updateProject = onUpdateProject ; export const updateRepository = onUpdateRepository ; export const createRepository = onCreateRepository ; export const deleteRepository = onDeleteRepository ; export const updateUserStats = onUpdateUserStats ; export const delete30DaysPings = deletePingsAfter30days ; export const runPings60Mins = runAllMonitors60Mins ; export const createUser = onCreateUser ; export const updateUser = onUpdateUser ; export const createProjectStat = onCreateProjectStats ; export const createPingsStats = onCreatePingsStats ; export const createUserStats = onCreateUserStats ;