From fb1b8f3d9e52c6802f3dbb73fa413515cf7fde1f Mon Sep 17 00:00:00 2001 From: Mathew Henson Date: Fri, 15 Apr 2016 18:55:37 +0100 Subject: [PATCH] Updated the users definition --- .../definitions/required/webinate-users.d.ts | 48 +++++++++++-------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/server/src/definitions/required/webinate-users.d.ts b/server/src/definitions/required/webinate-users.d.ts index 68b7951a..bb7cc4f7 100644 --- a/server/src/definitions/required/webinate-users.d.ts +++ b/server/src/definitions/required/webinate-users.d.ts @@ -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 { /* @@ -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; } @@ -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 */ @@ -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; + approvedSocketDomains: Array; } /* @@ -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