Skip to content

Commit

Permalink
Updated the users definition
Browse files Browse the repository at this point in the history
  • Loading branch information
MKHenson committed Apr 15, 2016
1 parent 6c8a07d commit fb1b8f3
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions server/src/definitions/required/webinate-users.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ declare module UsersInterface
dbEntry: IUserEntry;
}

/*
* Describes the different types of event interfaces we can use to interact with the system via web sockets
*/
export module SocketEvents
{
/*
Expand All @@ -15,12 +18,33 @@ declare module UsersInterface
eventType: number;
}

/*
* A very simple echo event. This simply pings the server with a message, which then returns with the same message
* either to the client or, if broadcast is true, to all clients.
*/
export interface IEchoEvent extends IEvent
{
message: string;
broadcast?: boolean;
}

/*
* Describes a get/set Meta request, which can fetch or set meta data for a given user
* if you provide a property value, then only that specific meta property is edited.
* If not provided, then the entire meta data is set.
*/
export interface IMetaEvent extends IEvent
{
username?: string;
property: string;
val: any;
}

/*
* The socket user event
*/
export interface IUserEvent extends IEvent
{
eventType: number;
username: string;
}

Expand Down Expand Up @@ -147,16 +171,6 @@ declare module UsersInterface
expiration: number;
}


/*
* Describes the type of client listening communicating to the web sockets
*/
export interface IWebsocketClient
{
/*Where is the client origin expected from*/
origin: string;
}

/*
* Users stores data on an external cloud bucket with Google
*/
Expand All @@ -171,12 +185,13 @@ declare module UsersInterface


/**
* An array of expected clients
* An array of safe origins for socket communication
* [
* { origin: "webinate.net", eventListeners: [1,4,5,6] }
* "webinate.net",
* "localhost"
* ]
*/
clients: Array<IWebsocketClient>;
approvedSocketDomains: Array<string>;
}

/*
Expand Down Expand Up @@ -365,11 +380,6 @@ declare module UsersInterface
*/
apiPrefix: string;

/**
* A secret string to identify authenticated servers
*/
secret: string;

/**
* The URL to redirect to after the user attempts to activate their account.
* User's can activate their account via the "/activate-account" URL, and after its validation the server will redirect to this URL
Expand Down

0 comments on commit fb1b8f3

Please sign in to comment.