aboutsummaryrefslogtreecommitdiff
path: root/lib/client.ts
blob: eafdda590638352a452d0750de95d1f9cba31c0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { Schema } from 'mongoose';
import Connection from './connection';
import createEventModel, { EventModel } from './event.model';
import createLogModel, { LogModel } from './log.model';


class Client<Context> {
  public connection: Connection;
  public Event: EventModel<Context>;
  public Log: LogModel;

  constructor(connection: Connection, contextSchema: Schema) {
    this.connection = connection;
    this.Log = createLogModel(connection);
    this.Event = createEventModel<Context>(connection, contextSchema);
  }
}


export default Client;