@budibase/server 2.5.6-alpha.5 → 2.5.6-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/websocket.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClientAppSocket = exports.initialise = void 0;
4
- const socket_io_1 = require("socket.io");
5
- class Websocket {
6
- constructor(server, path) {
7
- this.socketServer = new socket_io_1.Server(server, {
8
- path,
9
- });
10
- }
11
- // Emit an event to all sockets
12
- emit(event, payload) {
13
- this.socketServer.sockets.emit(event, payload);
14
- }
15
- }
16
- // Likely to be more socket instances in future
17
- let ClientAppSocket;
18
- exports.ClientAppSocket = ClientAppSocket;
19
- const initialise = (server) => {
20
- exports.ClientAppSocket = ClientAppSocket = new Websocket(server, "/socket/client");
21
- };
22
- exports.initialise = initialise;
package/src/websocket.ts DELETED
@@ -1,26 +0,0 @@
1
- import { Server } from "socket.io"
2
- import http from "http"
3
-
4
- class Websocket {
5
- socketServer: Server
6
-
7
- constructor(server: http.Server, path: string) {
8
- this.socketServer = new Server(server, {
9
- path,
10
- })
11
- }
12
-
13
- // Emit an event to all sockets
14
- emit(event: string, payload: any) {
15
- this.socketServer.sockets.emit(event, payload)
16
- }
17
- }
18
-
19
- // Likely to be more socket instances in future
20
- let ClientAppSocket: Websocket
21
-
22
- export const initialise = (server: http.Server) => {
23
- ClientAppSocket = new Websocket(server, "/socket/client")
24
- }
25
-
26
- export { ClientAppSocket }