summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/app/common/scripts')
-rw-r--r--src/web/app/common/scripts/streaming/channel.ts (renamed from src/web/app/common/scripts/streaming/channel-stream.ts)0
-rw-r--r--src/web/app/common/scripts/streaming/drive-stream-manager.ts20
-rw-r--r--src/web/app/common/scripts/streaming/drive-stream.ts12
-rw-r--r--src/web/app/common/scripts/streaming/drive.ts31
-rw-r--r--src/web/app/common/scripts/streaming/home-stream-manager.ts23
-rw-r--r--src/web/app/common/scripts/streaming/home.ts (renamed from src/web/app/common/scripts/streaming/home-stream.ts)23
-rw-r--r--src/web/app/common/scripts/streaming/messaging-index-stream-manager.ts20
-rw-r--r--src/web/app/common/scripts/streaming/messaging-index-stream.ts12
-rw-r--r--src/web/app/common/scripts/streaming/messaging-index.ts31
-rw-r--r--src/web/app/common/scripts/streaming/messaging.ts (renamed from src/web/app/common/scripts/streaming/messaging-stream.ts)2
-rw-r--r--src/web/app/common/scripts/streaming/othello-game.ts10
-rw-r--r--src/web/app/common/scripts/streaming/othello.ts28
-rw-r--r--src/web/app/common/scripts/streaming/requests-stream-manager.ts12
-rw-r--r--src/web/app/common/scripts/streaming/requests-stream.ts10
-rw-r--r--src/web/app/common/scripts/streaming/requests.ts21
-rw-r--r--src/web/app/common/scripts/streaming/server-stream-manager.ts12
-rw-r--r--src/web/app/common/scripts/streaming/server-stream.ts10
-rw-r--r--src/web/app/common/scripts/streaming/server.ts21
18 files changed, 165 insertions, 133 deletions
diff --git a/src/web/app/common/scripts/streaming/channel-stream.ts b/src/web/app/common/scripts/streaming/channel.ts
index 434b108b9e..434b108b9e 100644
--- a/src/web/app/common/scripts/streaming/channel-stream.ts
+++ b/src/web/app/common/scripts/streaming/channel.ts
diff --git a/src/web/app/common/scripts/streaming/drive-stream-manager.ts b/src/web/app/common/scripts/streaming/drive-stream-manager.ts
deleted file mode 100644
index 8acdd7cbba..0000000000
--- a/src/web/app/common/scripts/streaming/drive-stream-manager.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import StreamManager from './stream-manager';
-import Connection from './drive-stream';
-
-export default class DriveStreamManager extends StreamManager<Connection> {
- private me;
-
- constructor(me) {
- super();
-
- this.me = me;
- }
-
- public getConnection() {
- if (this.connection == null) {
- this.connection = new Connection(this.me);
- }
-
- return this.connection;
- }
-}
diff --git a/src/web/app/common/scripts/streaming/drive-stream.ts b/src/web/app/common/scripts/streaming/drive-stream.ts
deleted file mode 100644
index 0da3f12554..0000000000
--- a/src/web/app/common/scripts/streaming/drive-stream.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import Stream from './stream';
-
-/**
- * Drive stream connection
- */
-export default class Connection extends Stream {
- constructor(me) {
- super('drive', {
- i: me.token
- });
- }
-}
diff --git a/src/web/app/common/scripts/streaming/drive.ts b/src/web/app/common/scripts/streaming/drive.ts
new file mode 100644
index 0000000000..5805e58033
--- /dev/null
+++ b/src/web/app/common/scripts/streaming/drive.ts
@@ -0,0 +1,31 @@
+import Stream from './stream';
+import StreamManager from './stream-manager';
+
+/**
+ * Drive stream connection
+ */
+export class DriveStream extends Stream {
+ constructor(me) {
+ super('drive', {
+ i: me.token
+ });
+ }
+}
+
+export class DriveStreamManager extends StreamManager<DriveStream> {
+ private me;
+
+ constructor(me) {
+ super();
+
+ this.me = me;
+ }
+
+ public getConnection() {
+ if (this.connection == null) {
+ this.connection = new DriveStream(this.me);
+ }
+
+ return this.connection;
+ }
+}
diff --git a/src/web/app/common/scripts/streaming/home-stream-manager.ts b/src/web/app/common/scripts/streaming/home-stream-manager.ts
deleted file mode 100644
index ab56d5a73a..0000000000
--- a/src/web/app/common/scripts/streaming/home-stream-manager.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import StreamManager from './stream-manager';
-import Connection from './home-stream';
-import MiOS from '../../mios';
-
-export default class HomeStreamManager extends StreamManager<Connection> {
- private me;
- private os: MiOS;
-
- constructor(os: MiOS, me) {
- super();
-
- this.me = me;
- this.os = os;
- }
-
- public getConnection() {
- if (this.connection == null) {
- this.connection = new Connection(this.os, this.me);
- }
-
- return this.connection;
- }
-}
diff --git a/src/web/app/common/scripts/streaming/home-stream.ts b/src/web/app/common/scripts/streaming/home.ts
index 3516705e22..1f110bfd3b 100644
--- a/src/web/app/common/scripts/streaming/home-stream.ts
+++ b/src/web/app/common/scripts/streaming/home.ts
@@ -1,12 +1,13 @@
import * as merge from 'object-assign-deep';
import Stream from './stream';
+import StreamManager from './stream-manager';
import MiOS from '../../mios';
/**
* Home stream connection
*/
-export default class Connection extends Stream {
+export class HomeStream extends Stream {
constructor(os: MiOS, me) {
super('', {
i: me.token
@@ -34,3 +35,23 @@ export default class Connection extends Stream {
});
}
}
+
+export class HomeStreamManager extends StreamManager<HomeStream> {
+ private me;
+ private os: MiOS;
+
+ constructor(os: MiOS, me) {
+ super();
+
+ this.me = me;
+ this.os = os;
+ }
+
+ public getConnection() {
+ if (this.connection == null) {
+ this.connection = new HomeStream(this.os, this.me);
+ }
+
+ return this.connection;
+ }
+}
diff --git a/src/web/app/common/scripts/streaming/messaging-index-stream-manager.ts b/src/web/app/common/scripts/streaming/messaging-index-stream-manager.ts
deleted file mode 100644
index 0f08b01481..0000000000
--- a/src/web/app/common/scripts/streaming/messaging-index-stream-manager.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import StreamManager from './stream-manager';
-import Connection from './messaging-index-stream';
-
-export default class MessagingIndexStreamManager extends StreamManager<Connection> {
- private me;
-
- constructor(me) {
- super();
-
- this.me = me;
- }
-
- public getConnection() {
- if (this.connection == null) {
- this.connection = new Connection(this.me);
- }
-
- return this.connection;
- }
-}
diff --git a/src/web/app/common/scripts/streaming/messaging-index-stream.ts b/src/web/app/common/scripts/streaming/messaging-index-stream.ts
deleted file mode 100644
index 8015c840b4..0000000000
--- a/src/web/app/common/scripts/streaming/messaging-index-stream.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import Stream from './stream';
-
-/**
- * Messaging index stream connection
- */
-export default class Connection extends Stream {
- constructor(me) {
- super('messaging-index', {
- i: me.token
- });
- }
-}
diff --git a/src/web/app/common/scripts/streaming/messaging-index.ts b/src/web/app/common/scripts/streaming/messaging-index.ts
new file mode 100644
index 0000000000..69758416dc
--- /dev/null
+++ b/src/web/app/common/scripts/streaming/messaging-index.ts
@@ -0,0 +1,31 @@
+import Stream from './stream';
+import StreamManager from './stream-manager';
+
+/**
+ * Messaging index stream connection
+ */
+export class MessagingIndexStream extends Stream {
+ constructor(me) {
+ super('messaging-index', {
+ i: me.token
+ });
+ }
+}
+
+export class MessagingIndexStreamManager extends StreamManager<MessagingIndexStream> {
+ private me;
+
+ constructor(me) {
+ super();
+
+ this.me = me;
+ }
+
+ public getConnection() {
+ if (this.connection == null) {
+ this.connection = new MessagingIndexStream(this.me);
+ }
+
+ return this.connection;
+ }
+}
diff --git a/src/web/app/common/scripts/streaming/messaging-stream.ts b/src/web/app/common/scripts/streaming/messaging.ts
index 68dfc5ec09..1fff2286b3 100644
--- a/src/web/app/common/scripts/streaming/messaging-stream.ts
+++ b/src/web/app/common/scripts/streaming/messaging.ts
@@ -3,7 +3,7 @@ import Stream from './stream';
/**
* Messaging stream connection
*/
-export default class Connection extends Stream {
+export class MessagingStream extends Stream {
constructor(me, otherparty) {
super('messaging', {
i: me.token,
diff --git a/src/web/app/common/scripts/streaming/othello-game.ts b/src/web/app/common/scripts/streaming/othello-game.ts
new file mode 100644
index 0000000000..51a435541a
--- /dev/null
+++ b/src/web/app/common/scripts/streaming/othello-game.ts
@@ -0,0 +1,10 @@
+import Stream from './stream';
+
+export class OthelloGameStream extends Stream {
+ constructor(me, game) {
+ super('othello-game', {
+ i: me.token,
+ game: game.id
+ });
+ }
+}
diff --git a/src/web/app/common/scripts/streaming/othello.ts b/src/web/app/common/scripts/streaming/othello.ts
new file mode 100644
index 0000000000..febc5d498a
--- /dev/null
+++ b/src/web/app/common/scripts/streaming/othello.ts
@@ -0,0 +1,28 @@
+import StreamManager from './stream-manager';
+import Stream from './stream';
+
+export class OthelloStream extends Stream {
+ constructor(me) {
+ super('othello', {
+ i: me.token
+ });
+ }
+}
+
+export class OthelloStreamManager extends StreamManager<OthelloStream> {
+ private me;
+
+ constructor(me) {
+ super();
+
+ this.me = me;
+ }
+
+ public getConnection() {
+ if (this.connection == null) {
+ this.connection = new OthelloStream(this.me);
+ }
+
+ return this.connection;
+ }
+}
diff --git a/src/web/app/common/scripts/streaming/requests-stream-manager.ts b/src/web/app/common/scripts/streaming/requests-stream-manager.ts
deleted file mode 100644
index 44db913e78..0000000000
--- a/src/web/app/common/scripts/streaming/requests-stream-manager.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import StreamManager from './stream-manager';
-import Connection from './requests-stream';
-
-export default class RequestsStreamManager extends StreamManager<Connection> {
- public getConnection() {
- if (this.connection == null) {
- this.connection = new Connection();
- }
-
- return this.connection;
- }
-}
diff --git a/src/web/app/common/scripts/streaming/requests-stream.ts b/src/web/app/common/scripts/streaming/requests-stream.ts
deleted file mode 100644
index 22ecea6c07..0000000000
--- a/src/web/app/common/scripts/streaming/requests-stream.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import Stream from './stream';
-
-/**
- * Requests stream connection
- */
-export default class Connection extends Stream {
- constructor() {
- super('requests');
- }
-}
diff --git a/src/web/app/common/scripts/streaming/requests.ts b/src/web/app/common/scripts/streaming/requests.ts
new file mode 100644
index 0000000000..5d199a0742
--- /dev/null
+++ b/src/web/app/common/scripts/streaming/requests.ts
@@ -0,0 +1,21 @@
+import Stream from './stream';
+import StreamManager from './stream-manager';
+
+/**
+ * Requests stream connection
+ */
+export class RequestsStream extends Stream {
+ constructor() {
+ super('requests');
+ }
+}
+
+export class RequestsStreamManager extends StreamManager<RequestsStream> {
+ public getConnection() {
+ if (this.connection == null) {
+ this.connection = new RequestsStream();
+ }
+
+ return this.connection;
+ }
+}
diff --git a/src/web/app/common/scripts/streaming/server-stream-manager.ts b/src/web/app/common/scripts/streaming/server-stream-manager.ts
deleted file mode 100644
index a170daebb9..0000000000
--- a/src/web/app/common/scripts/streaming/server-stream-manager.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import StreamManager from './stream-manager';
-import Connection from './server-stream';
-
-export default class ServerStreamManager extends StreamManager<Connection> {
- public getConnection() {
- if (this.connection == null) {
- this.connection = new Connection();
- }
-
- return this.connection;
- }
-}
diff --git a/src/web/app/common/scripts/streaming/server-stream.ts b/src/web/app/common/scripts/streaming/server-stream.ts
deleted file mode 100644
index b9e0684465..0000000000
--- a/src/web/app/common/scripts/streaming/server-stream.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import Stream from './stream';
-
-/**
- * Server stream connection
- */
-export default class Connection extends Stream {
- constructor() {
- super('server');
- }
-}
diff --git a/src/web/app/common/scripts/streaming/server.ts b/src/web/app/common/scripts/streaming/server.ts
new file mode 100644
index 0000000000..b12198d2fd
--- /dev/null
+++ b/src/web/app/common/scripts/streaming/server.ts
@@ -0,0 +1,21 @@
+import Stream from './stream';
+import StreamManager from './stream-manager';
+
+/**
+ * Server stream connection
+ */
+export class ServerStream extends Stream {
+ constructor() {
+ super('server');
+ }
+}
+
+export class ServerStreamManager extends StreamManager<ServerStream> {
+ public getConnection() {
+ if (this.connection == null) {
+ this.connection = new ServerStream();
+ }
+
+ return this.connection;
+ }
+}