@hocuspocus/extension-redis
Advanced tools
Comparing version 1.0.0-alpha.27 to 1.0.0-alpha.28
@@ -6,2 +6,10 @@ # Change Log | ||
# [1.0.0-alpha.28](https://github.com/ueberdosis/hocuspocus/compare/@hocuspocus/extension-redis@1.0.0-alpha.27...@hocuspocus/extension-redis@1.0.0-alpha.28) (2021-08-31) | ||
**Note:** Version bump only for package @hocuspocus/extension-redis | ||
# [1.0.0-alpha.27](https://github.com/ueberdosis/hocuspocus/compare/@hocuspocus/extension-redis@1.0.0-alpha.26...@hocuspocus/extension-redis@1.0.0-alpha.27) (2021-08-29) | ||
@@ -8,0 +16,0 @@ |
import { CloseEvent } from './types'; | ||
export declare const Forbidden: CloseEvent; | ||
export declare const ResetConnection: CloseEvent; | ||
export declare const CloseEvents: CloseEvent[]; |
@@ -6,4 +6,6 @@ /// <reference types="node" /> | ||
import Document from './Document'; | ||
import { CloseEvent } from './types'; | ||
import { MessageLogger } from './Debugger'; | ||
declare class Connection { | ||
connection: WebSocket; | ||
webSocket: WebSocket; | ||
context: any; | ||
@@ -19,2 +21,3 @@ document: Document; | ||
readOnly: Boolean; | ||
debugger: MessageLogger; | ||
/** | ||
@@ -33,5 +36,5 @@ * Constructor. | ||
/** | ||
* Close the connection | ||
* Graceful wrapper around the WebSocket close method. | ||
*/ | ||
close(): void; | ||
close(event?: CloseEvent): void; | ||
/** | ||
@@ -54,5 +57,11 @@ * Check if pong was received and close the connection otherwise | ||
* Get the underlying connection instance | ||
* @deprecated | ||
*/ | ||
get instance(): WebSocket; | ||
/** | ||
* Get the underlying connection instance | ||
* @deprecated | ||
*/ | ||
get connection(): WebSocket; | ||
} | ||
export default Connection; |
@@ -6,2 +6,3 @@ import WebSocket from 'ws'; | ||
import Connection from './Connection'; | ||
import { MessageLogger } from './Debugger'; | ||
declare class Document extends Doc { | ||
@@ -15,2 +16,3 @@ awareness: Awareness; | ||
mux: mutex; | ||
debugger: MessageLogger; | ||
/** | ||
@@ -17,0 +19,0 @@ * Constructor. |
@@ -5,2 +5,3 @@ /// <reference types="node" /> | ||
import { Configuration } from './types'; | ||
import { MessageLogger } from './Debugger'; | ||
export declare const defaultConfiguration: { | ||
@@ -17,3 +18,4 @@ port: number; | ||
httpServer?: HTTPServer; | ||
websocketServer?: WebSocket.Server; | ||
webSocketServer?: WebSocket.Server; | ||
debugger: MessageLogger; | ||
/** | ||
@@ -29,2 +31,6 @@ * Configure the server | ||
/** | ||
* Force closes one or more connections | ||
*/ | ||
closeConnections(documentName?: string): void; | ||
/** | ||
* Destroy the server | ||
@@ -68,3 +74,9 @@ */ | ||
private static getDocumentName; | ||
enableDebugging(): void; | ||
enableLogging(): void; | ||
disableLogging(): void; | ||
disableDebugging(): void; | ||
flushMessageLogs(): this; | ||
getMessageLogs(): any[]; | ||
} | ||
export declare const Server: Hocuspocus; |
import Connection from './Connection'; | ||
import { IncomingMessage } from './IncomingMessage'; | ||
import { MessageLogger } from './Debugger'; | ||
export declare class MessageReceiver { | ||
message: IncomingMessage; | ||
debugger: MessageLogger; | ||
constructor(message: IncomingMessage); | ||
@@ -6,0 +8,0 @@ apply(connection: Connection): void; |
@@ -6,2 +6,4 @@ import { Encoder } from 'lib0/encoding'; | ||
encoder: Encoder; | ||
type?: number; | ||
category?: string; | ||
constructor(); | ||
@@ -8,0 +10,0 @@ createSyncMessage(): OutgoingMessage; |
@@ -6,2 +6,3 @@ /// <reference types="node" /> | ||
import Document from './Document'; | ||
import { Hocuspocus } from './Hocuspocus'; | ||
export declare enum MessageType { | ||
@@ -13,3 +14,9 @@ Unknown = -1, | ||
} | ||
/** | ||
* State of the WebSocket connection. | ||
* https://developer.mozilla.org/de/docs/Web/API/WebSocket/readyState | ||
*/ | ||
export declare enum WsReadyStates { | ||
Connecting = 0, | ||
Open = 1, | ||
Closing = 2, | ||
@@ -23,2 +30,6 @@ Closed = 3 | ||
} | ||
export interface ConnectionConfig { | ||
readOnly: boolean; | ||
isAuthenticated: boolean; | ||
} | ||
export interface Extension { | ||
@@ -37,4 +48,13 @@ onAuthenticate?(data: onAuthenticatePayload): Promise<any>; | ||
export interface Configuration extends Extension { | ||
/** | ||
* A list of hocuspocus extenions. | ||
*/ | ||
extensions: Array<Extension>; | ||
/** | ||
* The port which the server listens on. | ||
*/ | ||
port: number | null; | ||
/** | ||
* Defines in which interval the server sends a ping, and closes the connection when no pong is sent back. | ||
*/ | ||
timeout: number; | ||
@@ -44,2 +64,3 @@ } | ||
documentName: string; | ||
instance: Hocuspocus; | ||
requestHeaders: IncomingHttpHeaders; | ||
@@ -49,8 +70,7 @@ requestParameters: URLSearchParams; | ||
token: string; | ||
connection: { | ||
readOnly: boolean; | ||
}; | ||
connection: ConnectionConfig; | ||
} | ||
export interface onConnectPayload { | ||
documentName: string; | ||
instance: Hocuspocus; | ||
request: IncomingMessage; | ||
@@ -60,5 +80,3 @@ requestHeaders: IncomingHttpHeaders; | ||
socketId: string; | ||
connection: { | ||
readOnly: boolean; | ||
}; | ||
connection: ConnectionConfig; | ||
} | ||
@@ -72,2 +90,3 @@ export interface onCreateDocumentPayload { | ||
socketId: string; | ||
connection: ConnectionConfig; | ||
} | ||
@@ -96,2 +115,3 @@ export interface onChangePayload { | ||
response: ServerResponse; | ||
instance: Hocuspocus; | ||
} | ||
@@ -102,2 +122,3 @@ export interface onUpgradePayload { | ||
socket: Socket; | ||
instance: Hocuspocus; | ||
} | ||
@@ -113,2 +134,3 @@ export interface onListenPayload { | ||
yjsVersion: string; | ||
instance: Hocuspocus; | ||
} | ||
@@ -115,0 +137,0 @@ export interface CloseEvent { |
{ | ||
"name": "@hocuspocus/extension-redis", | ||
"version": "1.0.0-alpha.27", | ||
"version": "1.0.0-alpha.28", | ||
"description": "hocuspocus persistence driver for Redis", | ||
@@ -25,7 +25,7 @@ "homepage": "https://hocuspocus.dev", | ||
"dependencies": { | ||
"@hocuspocus/server": "^1.0.0-alpha.65", | ||
"@hocuspocus/server": "^1.0.0-alpha.66", | ||
"y-redis": "^1.0.2", | ||
"yjs": "^13.5.0" | ||
}, | ||
"gitHead": "b0e575f7941fc52e0d11f28c61af5dd024caa981" | ||
"gitHead": "f4b2c62f0322daa4c95f6be2009fc7a9c48557cb" | ||
} |
52416
60
1173