@hocuspocus/extension-redis 1.0.0-alpha.55 → 1.0.0-alpha.56
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/packages/common/src/awarenessStatesToArray.d.ts +3 -0
- package/dist/packages/common/src/index.d.ts +1 -0
- package/dist/packages/extension-throttle/src/index.d.ts +6 -2
- package/dist/packages/provider/src/index.d.ts +0 -1
- package/dist/packages/server/src/MessageReceiver.d.ts +1 -1
- package/dist/packages/server/src/types.d.ts +11 -1
- package/dist/tests/extension-throttle/configuration.d.ts +1 -0
- package/dist/tests/provider/observeDeep.d.ts +1 -0
- package/package.json +3 -3
- package/dist/packages/provider/src/utils/awarenessStatesToArray.d.ts +0 -4
- package/dist/packages/provider/src/utils/index.d.ts +0 -1
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { Extension, onConnectPayload } from '@hocuspocus/server';
|
|
2
|
-
export interface
|
|
2
|
+
export interface ThrottleConfiguration {
|
|
3
3
|
throttle: number | null | false;
|
|
4
4
|
banTime: number;
|
|
5
5
|
}
|
|
6
6
|
export declare class Throttle implements Extension {
|
|
7
|
-
configuration:
|
|
7
|
+
configuration: ThrottleConfiguration;
|
|
8
8
|
connectionsByIp: Map<string, Array<number>>;
|
|
9
9
|
bannedIps: Map<string, number>;
|
|
10
|
+
/**
|
|
11
|
+
* Constructor
|
|
12
|
+
*/
|
|
13
|
+
constructor(configuration?: Partial<ThrottleConfiguration>);
|
|
10
14
|
/**
|
|
11
15
|
* Throttle requests
|
|
12
16
|
* @private
|
|
@@ -8,6 +8,6 @@ export declare class MessageReceiver {
|
|
|
8
8
|
logger: Debugger;
|
|
9
9
|
constructor(message: IncomingMessage, logger: Debugger);
|
|
10
10
|
apply(document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): void;
|
|
11
|
-
readSyncMessage(message: IncomingMessage, document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): 0 |
|
|
11
|
+
readSyncMessage(message: IncomingMessage, document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): 0 | 2 | 1;
|
|
12
12
|
applyQueryAwarenessMessage(awareness: Awareness, reply?: (message: Uint8Array) => void): void;
|
|
13
13
|
}
|
|
@@ -38,6 +38,7 @@ export interface Extension {
|
|
|
38
38
|
onListen?(data: onListenPayload): Promise<any>;
|
|
39
39
|
onUpgrade?(data: onUpgradePayload): Promise<any>;
|
|
40
40
|
onConnect?(data: onConnectPayload): Promise<any>;
|
|
41
|
+
connected?(data: connectedPayload): Promise<any>;
|
|
41
42
|
onAuthenticate?(data: onAuthenticatePayload): Promise<any>;
|
|
42
43
|
/**
|
|
43
44
|
* @deprecated onCreateDocument is deprecated, use onLoadDocument instead
|
|
@@ -53,7 +54,7 @@ export interface Extension {
|
|
|
53
54
|
onDisconnect?(data: onDisconnectPayload): Promise<any>;
|
|
54
55
|
onDestroy?(data: onDestroyPayload): Promise<any>;
|
|
55
56
|
}
|
|
56
|
-
export declare type Hook = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'onAuthenticate' |
|
|
57
|
+
export declare type Hook = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' |
|
|
57
58
|
/**
|
|
58
59
|
* @deprecated onCreateDocument is deprecated, use onLoadDocument instead
|
|
59
60
|
*/
|
|
@@ -116,6 +117,15 @@ export interface onConnectPayload {
|
|
|
116
117
|
socketId: string;
|
|
117
118
|
connection: ConnectionConfiguration;
|
|
118
119
|
}
|
|
120
|
+
export interface connectedPayload {
|
|
121
|
+
documentName: string;
|
|
122
|
+
instance: Hocuspocus;
|
|
123
|
+
request: IncomingMessage;
|
|
124
|
+
requestHeaders: IncomingHttpHeaders;
|
|
125
|
+
requestParameters: URLSearchParams;
|
|
126
|
+
socketId: string;
|
|
127
|
+
connection: ConnectionConfiguration;
|
|
128
|
+
}
|
|
119
129
|
export interface onLoadDocumentPayload {
|
|
120
130
|
context: any;
|
|
121
131
|
document: Document;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/extension-redis",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.56",
|
|
4
4
|
"description": "hocuspocus persistence driver for Redis",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@hocuspocus/server": "^1.0.0-alpha.
|
|
30
|
+
"@hocuspocus/server": "^1.0.0-alpha.93",
|
|
31
31
|
"y-redis": "^1.0.3",
|
|
32
32
|
"yjs": "^13.5.24"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "05a7eb3d660175613d2fe7b6d9ec030e8e509683"
|
|
35
35
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as awarenessStatesToArray } from './awarenessStatesToArray';
|