Options
All
  • Public
  • Public/Protected
  • All
Menu

analytics - v0.0.0

Index

Type aliases

QueryFilter

Model Variables

Const Collection

Collection: Model<ICollectionModel> = model<ICollectionModel>('Collection',CollectionSchema)

Const Event

Event: Model<IEventModel> = model<IEventModel>('Event',EventSchema)

Const Project

Project: Model<IProjectModel> = model<IProjectModel>('Project',ProjectSchema)

Other Variables

Const app

app: Express = express()

Router Variables

Const routerApi

routerApi: Router = express.Router()

v1ApiRouter Variables

Const routerAPIv1

routerAPIv1: Router = express.Router()

Const routerEvents

routerEvents: Router = express.Router({ mergeParams: true })

Const routerPojects

routerPojects: Router = express.Router()

Const routerQuery

routerQuery: Router = express.Router({ mergeParams: true })

Config Functions

Const configureExpress

  • configureExpress(app: any): void

Const configureMongoDB

  • configureMongoDB(): Promise<void>

EventService Functions

Const recordEvent

  • recordEvent(params: IEvent, accessKey: string): Promise<object>
  • Parameters

    • params: IEvent

      Event parameters.

    • accessKey: string

      Access key to use to create the event.

    Returns Promise<object>

Middleware Functions

Const errorMiddleware

  • errorMiddleware(app: any): void

Other Functions

Const analyzeCount

  • analyzeCount(key: string, projectId: string, query: IQuery): Promise<object>

Const filtersToMongoQuery

Const requireRootAuth

  • requireRootAuth(req: Request, res: Response, next: NextFunction): void

ProjectService Functions

Const canRead

  • canRead(projectId: string, key: string): Promise<boolean>
  • Check if a read key has permission to read a project

    Parameters

    • projectId: string

      ID of the project to check permissions against

    • key: string

      The read key to use

    Returns Promise<boolean>

Const canWrite

  • canWrite(projectId: string, writeKey: string): Promise<boolean>
  • Check if a write key has permission to write to a project

    Parameters

    • projectId: string

      ID of the project to check permissions against

    • writeKey: string

      The write key to use

    Returns Promise<boolean>

Const createProject

Const getProject

Const getProjects

Const updateProject

Object literals

Const config

config: object

dbUrl

dbUrl: string = env.MONGODB_URI || 'mongodb://localhost:27017/analytics'

environment

environment: string = env.NODE_ENV || 'development'

port

port: number = parseFloat(env.PORT || '3000')

rootKey

rootKey: string = env.ROOT_KEY || 'UNSET'

Generated using TypeDoc