@hocuspocus/extension-sqlite 1.0.0-alpha.1 → 1.0.0-alpha.12
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/hocuspocus-sqlite.cjs +29 -20
- package/dist/hocuspocus-sqlite.cjs.map +1 -1
- package/dist/hocuspocus-sqlite.esm.js +26 -20
- package/dist/hocuspocus-sqlite.esm.js.map +1 -1
- package/dist/packages/common/src/CloseEvents.d.ts +23 -0
- package/dist/packages/common/src/awarenessStatesToArray.d.ts +3 -0
- package/dist/packages/common/src/index.d.ts +3 -0
- package/dist/packages/common/src/types.d.ts +10 -0
- package/dist/packages/extension-database/src/Database.d.ts +5 -9
- package/dist/packages/extension-logger/src/Logger.d.ts +5 -0
- package/dist/packages/extension-monitor/src/Collector.d.ts +0 -2
- package/dist/packages/extension-monitor/src/index.d.ts +2 -2
- package/dist/packages/extension-sqlite/src/SQLite.d.ts +4 -4
- package/dist/packages/extension-throttle/src/index.d.ts +6 -2
- package/dist/packages/extension-webhook/src/index.d.ts +1 -2
- package/dist/packages/provider/src/EventEmitter.d.ts +1 -1
- package/dist/packages/provider/src/HocuspocusCloudProvider.d.ts +4 -3
- package/dist/packages/provider/src/HocuspocusProvider.d.ts +24 -26
- package/dist/packages/provider/src/index.d.ts +0 -1
- package/dist/packages/provider/src/types.d.ts +43 -0
- package/dist/packages/server/src/Connection.d.ts +5 -5
- package/dist/packages/server/src/Debugger.d.ts +1 -2
- package/dist/packages/server/src/Document.d.ts +8 -5
- package/dist/packages/server/src/Hocuspocus.d.ts +32 -14
- package/dist/packages/server/src/MessageReceiver.d.ts +8 -5
- package/dist/packages/server/src/OutgoingMessage.d.ts +1 -0
- package/dist/packages/server/src/index.d.ts +7 -0
- package/dist/packages/server/src/types.d.ts +92 -34
- package/dist/tests/extension-logger/onListen.d.ts +1 -0
- package/dist/tests/extension-redis/onLoadDocument.d.ts +1 -0
- package/dist/tests/extension-redis/onSynced.d.ts +1 -0
- package/dist/tests/extension-redis-rewrite/closeConnections.d.ts +1 -0
- package/dist/tests/extension-redis-rewrite/getConnectionCount.d.ts +1 -0
- package/dist/tests/extension-redis-rewrite/getDocumentsCount.d.ts +1 -0
- package/dist/tests/extension-redis-rewrite/onAwarenessChange.d.ts +1 -0
- package/dist/tests/extension-redis-rewrite/onChange.d.ts +1 -0
- package/dist/tests/extension-redis-rewrite/onStoreDocument.d.ts +1 -0
- package/dist/tests/extension-rocksdb/onLoadDocument.d.ts +1 -0
- package/dist/tests/extension-throttle/configuration.d.ts +1 -0
- package/dist/tests/provider/configuration.d.ts +1 -0
- package/dist/tests/provider/observe.d.ts +1 -0
- package/dist/tests/provider/observeDeep.d.ts +1 -0
- package/dist/tests/provider/onAuthenticated.d.ts +1 -0
- package/dist/tests/provider/onAuthenticationFailed.d.ts +1 -0
- package/dist/tests/provider/onAwarenessChange.d.ts +1 -0
- package/dist/tests/provider/onAwarenessUpdate.d.ts +1 -0
- package/dist/tests/provider/onClose.d.ts +1 -0
- package/dist/tests/provider/onConnect.d.ts +1 -0
- package/dist/tests/provider/onDisconnect.d.ts +1 -0
- package/dist/tests/provider/onMessage.d.ts +1 -0
- package/dist/tests/provider/onOpen.d.ts +1 -0
- package/dist/tests/provider/onSynced.d.ts +1 -0
- package/dist/tests/server/address.d.ts +1 -0
- package/dist/tests/server/afterStoreDocument.d.ts +1 -0
- package/dist/tests/server/closeConnections.d.ts +1 -0
- package/dist/tests/server/getConnectionsCount.d.ts +1 -0
- package/dist/tests/server/getDocumentName.d.ts +1 -0
- package/dist/tests/server/getDocumentsCount.d.ts +1 -0
- package/dist/tests/server/getMessageLogs.d.ts +1 -0
- package/dist/tests/server/listen.d.ts +1 -0
- package/dist/tests/server/onAuthenticate.d.ts +1 -0
- package/dist/tests/server/onAwarenessUpdate.d.ts +1 -0
- package/dist/tests/server/onChange.d.ts +1 -0
- package/dist/tests/server/onConfigure.d.ts +1 -0
- package/dist/tests/server/onConnect.d.ts +1 -0
- package/dist/tests/server/onDestroy.d.ts +1 -0
- package/dist/tests/server/onDisconnect.d.ts +1 -0
- package/dist/tests/server/onListen.d.ts +1 -0
- package/dist/tests/server/onLoadDocument.d.ts +1 -0
- package/dist/tests/server/onRequest.d.ts +1 -0
- package/dist/tests/server/onStoreDocument.d.ts +1 -0
- package/dist/tests/server/onUpgrade.d.ts +1 -0
- package/dist/tests/server/requiresAuthentication.d.ts +1 -0
- package/dist/tests/transformer/TiptapTransformer.d.ts +1 -0
- package/dist/tests/utils/createDirectory.d.ts +1 -0
- package/dist/tests/utils/flushRedis.d.ts +1 -0
- package/dist/tests/utils/index.d.ts +7 -0
- package/dist/tests/utils/newHocuspocus.d.ts +2 -0
- package/dist/tests/utils/newHocuspocusProvider.d.ts +3 -0
- package/dist/tests/utils/redisConnectionSettings.d.ts +4 -0
- package/dist/tests/utils/removeDirectory.d.ts +1 -0
- package/dist/tests/utils/sleep.d.ts +1 -0
- package/package.json +5 -5
- package/src/SQLite.ts +29 -21
- package/dist/packages/provider/src/utils/awarenessStatesToArray.d.ts +0 -4
- package/dist/packages/provider/src/utils/index.d.ts +0 -1
- package/dist/packages/server/src/CloseEvents.d.ts +0 -4
|
@@ -3,20 +3,23 @@ import { Awareness } from 'y-protocols/awareness';
|
|
|
3
3
|
import { Doc } from 'yjs';
|
|
4
4
|
import { mutex } from 'lib0/mutex.js';
|
|
5
5
|
import Connection from './Connection';
|
|
6
|
-
import {
|
|
7
|
-
declare class Document extends Doc {
|
|
6
|
+
import { Debugger } from './Debugger';
|
|
7
|
+
export declare class Document extends Doc {
|
|
8
8
|
awareness: Awareness;
|
|
9
9
|
callbacks: {
|
|
10
10
|
onUpdate: (document: Document, connection: Connection, update: Uint8Array) => void;
|
|
11
11
|
};
|
|
12
|
-
connections: Map<
|
|
12
|
+
connections: Map<WebSocket, {
|
|
13
|
+
clients: Set<any>;
|
|
14
|
+
connection: Connection;
|
|
15
|
+
}>;
|
|
13
16
|
name: string;
|
|
14
17
|
mux: mutex;
|
|
15
|
-
|
|
18
|
+
logger: Debugger;
|
|
16
19
|
/**
|
|
17
20
|
* Constructor.
|
|
18
21
|
*/
|
|
19
|
-
constructor(name: string);
|
|
22
|
+
constructor(name: string, logger: Debugger);
|
|
20
23
|
/**
|
|
21
24
|
* Check if the Document is empty
|
|
22
25
|
*/
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import WebSocket, { WebSocketServer } from 'ws';
|
|
2
|
+
import WebSocket, { AddressInfo, WebSocketServer } from 'ws';
|
|
3
3
|
import { IncomingMessage, Server as HTTPServer } from 'http';
|
|
4
4
|
import { Configuration, Hook } from './types';
|
|
5
|
-
import
|
|
5
|
+
import Document from './Document';
|
|
6
|
+
import { Debugger } from './Debugger';
|
|
6
7
|
import { onListenPayload } from '.';
|
|
7
8
|
export declare const defaultConfiguration: {
|
|
8
9
|
name: null;
|
|
9
10
|
port: number;
|
|
10
11
|
timeout: number;
|
|
12
|
+
debounce: number;
|
|
13
|
+
maxDebounce: number;
|
|
11
14
|
quiet: boolean;
|
|
12
15
|
};
|
|
13
16
|
/**
|
|
@@ -15,19 +18,24 @@ export declare const defaultConfiguration: {
|
|
|
15
18
|
*/
|
|
16
19
|
export declare class Hocuspocus {
|
|
17
20
|
configuration: Configuration;
|
|
18
|
-
documents: Map<
|
|
21
|
+
documents: Map<string, Document>;
|
|
19
22
|
httpServer?: HTTPServer;
|
|
20
23
|
webSocketServer?: WebSocketServer;
|
|
21
|
-
debugger:
|
|
24
|
+
debugger: Debugger;
|
|
25
|
+
constructor(configuration?: Partial<Configuration>);
|
|
22
26
|
/**
|
|
23
27
|
* Configure the server
|
|
24
28
|
*/
|
|
25
29
|
configure(configuration: Partial<Configuration>): Hocuspocus;
|
|
26
|
-
get
|
|
30
|
+
get requiresAuthentication(): boolean;
|
|
27
31
|
/**
|
|
28
32
|
* Start the server
|
|
29
33
|
*/
|
|
30
|
-
listen(portOrCallback?: number | ((data: onListenPayload) => Promise<any>) | null, callback?: any): Promise<
|
|
34
|
+
listen(portOrCallback?: number | ((data: onListenPayload) => Promise<any>) | null, callback?: any): Promise<Hocuspocus>;
|
|
35
|
+
get address(): AddressInfo;
|
|
36
|
+
get URL(): string;
|
|
37
|
+
get webSocketURL(): string;
|
|
38
|
+
get httpURL(): string;
|
|
31
39
|
private showStartScreen;
|
|
32
40
|
/**
|
|
33
41
|
* Get the total number of active documents
|
|
@@ -46,37 +54,47 @@ export declare class Hocuspocus {
|
|
|
46
54
|
*/
|
|
47
55
|
destroy(): Promise<any>;
|
|
48
56
|
/**
|
|
49
|
-
*
|
|
57
|
+
* The `handleConnection` method receives incoming WebSocket connections,
|
|
58
|
+
* runs all hooks:
|
|
59
|
+
*
|
|
60
|
+
* - onConnect for all connections
|
|
61
|
+
* - onAuthenticate only if required
|
|
62
|
+
*
|
|
63
|
+
* … and if nothings fails it’ll fully establish the connection and
|
|
64
|
+
* load the Document then.
|
|
50
65
|
*/
|
|
51
66
|
handleConnection(incoming: WebSocket, request: IncomingMessage, documentName: string, context?: any): void;
|
|
52
67
|
/**
|
|
53
68
|
* Handle update of the given document
|
|
54
|
-
* @private
|
|
55
69
|
*/
|
|
56
70
|
private handleDocumentUpdate;
|
|
71
|
+
timers: Map<string, {
|
|
72
|
+
timeout: NodeJS.Timeout;
|
|
73
|
+
start: number;
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* debounce the given function, using the given identifier
|
|
77
|
+
*/
|
|
78
|
+
debounce(id: string, func: Function, immediately?: boolean): void;
|
|
57
79
|
/**
|
|
58
80
|
* Create a new document by the given request
|
|
59
|
-
* @private
|
|
60
81
|
*/
|
|
61
82
|
private createDocument;
|
|
62
83
|
/**
|
|
63
84
|
* Create a new connection by the given request and document
|
|
64
|
-
* @private
|
|
65
85
|
*/
|
|
66
86
|
private createConnection;
|
|
67
87
|
/**
|
|
68
|
-
* Run the given hook on all configured extensions
|
|
69
|
-
* Runs the given callback after each hook
|
|
88
|
+
* Run the given hook on all configured extensions.
|
|
89
|
+
* Runs the given callback after each hook.
|
|
70
90
|
*/
|
|
71
91
|
hooks(name: Hook, payload: any, callback?: Function | null): Promise<any>;
|
|
72
92
|
/**
|
|
73
93
|
* Get parameters by the given request
|
|
74
|
-
* @private
|
|
75
94
|
*/
|
|
76
95
|
private static getParameters;
|
|
77
96
|
/**
|
|
78
97
|
* Get document name by the given request
|
|
79
|
-
* @private
|
|
80
98
|
*/
|
|
81
99
|
private getDocumentNameFromRequest;
|
|
82
100
|
enableDebugging(): void;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { Awareness } from 'y-protocols/awareness';
|
|
1
2
|
import Connection from './Connection';
|
|
2
3
|
import { IncomingMessage } from './IncomingMessage';
|
|
3
|
-
import {
|
|
4
|
+
import { Debugger } from './Debugger';
|
|
5
|
+
import Document from './Document';
|
|
4
6
|
export declare class MessageReceiver {
|
|
5
7
|
message: IncomingMessage;
|
|
6
|
-
|
|
7
|
-
constructor(message: IncomingMessage);
|
|
8
|
-
apply(connection:
|
|
9
|
-
readSyncMessage(message: IncomingMessage, connection:
|
|
8
|
+
logger: Debugger;
|
|
9
|
+
constructor(message: IncomingMessage, logger: Debugger);
|
|
10
|
+
apply(document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): void;
|
|
11
|
+
readSyncMessage(message: IncomingMessage, document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): 0 | 2 | 1;
|
|
12
|
+
applyQueryAwarenessMessage(awareness: Awareness, reply?: (message: Uint8Array) => void): void;
|
|
10
13
|
}
|
|
@@ -8,6 +8,7 @@ export declare class OutgoingMessage {
|
|
|
8
8
|
constructor();
|
|
9
9
|
createSyncMessage(): OutgoingMessage;
|
|
10
10
|
createAwarenessUpdateMessage(awareness: Awareness, changedClients?: Array<any>): OutgoingMessage;
|
|
11
|
+
writeQueryAwareness(): OutgoingMessage;
|
|
11
12
|
writeAuthenticated(): OutgoingMessage;
|
|
12
13
|
writePermissionDenied(reason: string): OutgoingMessage;
|
|
13
14
|
writeFirstSyncStepFor(document: Document): OutgoingMessage;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
export * from './Hocuspocus';
|
|
2
|
+
export * from './Connection';
|
|
3
|
+
export * from './Document';
|
|
4
|
+
export * from './IncomingMessage';
|
|
5
|
+
export * from './OutgoingMessage';
|
|
2
6
|
export * from './types';
|
|
7
|
+
export * from './MessageReceiver';
|
|
8
|
+
export * from './Document';
|
|
9
|
+
export * from './Connection';
|
|
@@ -2,54 +2,53 @@
|
|
|
2
2
|
import { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'http';
|
|
3
3
|
import { URLSearchParams } from 'url';
|
|
4
4
|
import { Socket } from 'net';
|
|
5
|
+
import { Awareness } from 'y-protocols/awareness';
|
|
5
6
|
import Document from './Document';
|
|
6
7
|
import { Hocuspocus } from './Hocuspocus';
|
|
7
8
|
export declare enum MessageType {
|
|
8
9
|
Unknown = -1,
|
|
9
10
|
Sync = 0,
|
|
10
11
|
Awareness = 1,
|
|
11
|
-
Auth = 2
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* State of the WebSocket connection.
|
|
15
|
-
* https://developer.mozilla.org/de/docs/Web/API/WebSocket/readyState
|
|
16
|
-
*/
|
|
17
|
-
export declare enum WsReadyStates {
|
|
18
|
-
Connecting = 0,
|
|
19
|
-
Open = 1,
|
|
20
|
-
Closing = 2,
|
|
21
|
-
Closed = 3
|
|
12
|
+
Auth = 2,
|
|
13
|
+
QueryAwareness = 3
|
|
22
14
|
}
|
|
23
15
|
export interface AwarenessUpdate {
|
|
24
16
|
added: Array<any>;
|
|
25
17
|
updated: Array<any>;
|
|
26
18
|
removed: Array<any>;
|
|
27
19
|
}
|
|
28
|
-
export interface
|
|
20
|
+
export interface ConnectionConfiguration {
|
|
29
21
|
readOnly: boolean;
|
|
22
|
+
requiresAuthentication: boolean;
|
|
30
23
|
isAuthenticated: boolean;
|
|
31
24
|
}
|
|
32
25
|
export interface Extension {
|
|
33
|
-
|
|
34
|
-
onChange?(data: onChangePayload): Promise<any>;
|
|
35
|
-
onConnect?(data: onConnectPayload): Promise<any>;
|
|
26
|
+
priority?: number;
|
|
36
27
|
onConfigure?(data: onConfigurePayload): Promise<any>;
|
|
28
|
+
onListen?(data: onListenPayload): Promise<any>;
|
|
29
|
+
onUpgrade?(data: onUpgradePayload): Promise<any>;
|
|
30
|
+
onConnect?(data: onConnectPayload): Promise<any>;
|
|
31
|
+
connected?(data: connectedPayload): Promise<any>;
|
|
32
|
+
onAuthenticate?(data: onAuthenticatePayload): Promise<any>;
|
|
37
33
|
/**
|
|
38
34
|
* @deprecated onCreateDocument is deprecated, use onLoadDocument instead
|
|
39
35
|
*/
|
|
40
36
|
onCreateDocument?(data: onLoadDocumentPayload): Promise<any>;
|
|
41
37
|
onLoadDocument?(data: onLoadDocumentPayload): Promise<any>;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
afterLoadDocument?(data: onLoadDocumentPayload): Promise<any>;
|
|
39
|
+
onChange?(data: onChangePayload): Promise<any>;
|
|
40
|
+
onStoreDocument?(data: onStoreDocumentPayload): Promise<any>;
|
|
41
|
+
afterStoreDocument?(data: afterStoreDocumentPayload): Promise<any>;
|
|
42
|
+
onAwarenessUpdate?(data: onAwarenessUpdatePayload): Promise<any>;
|
|
45
43
|
onRequest?(data: onRequestPayload): Promise<any>;
|
|
46
|
-
|
|
44
|
+
onDisconnect?(data: onDisconnectPayload): Promise<any>;
|
|
45
|
+
onDestroy?(data: onDestroyPayload): Promise<any>;
|
|
47
46
|
}
|
|
48
|
-
export declare type Hook = '
|
|
47
|
+
export declare type Hook = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' |
|
|
49
48
|
/**
|
|
50
49
|
* @deprecated onCreateDocument is deprecated, use onLoadDocument instead
|
|
51
50
|
*/
|
|
52
|
-
'onCreateDocument' | 'onLoadDocument' | '
|
|
51
|
+
'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'onDestroy';
|
|
53
52
|
export interface Configuration extends Extension {
|
|
54
53
|
/**
|
|
55
54
|
* A name for the instance, used for logging.
|
|
@@ -67,6 +66,15 @@ export interface Configuration extends Extension {
|
|
|
67
66
|
* Defines in which interval the server sends a ping, and closes the connection when no pong is sent back.
|
|
68
67
|
*/
|
|
69
68
|
timeout: number;
|
|
69
|
+
/**
|
|
70
|
+
* Debounces the call of the `onStoreDocument` hook for the given amount of time in ms.
|
|
71
|
+
* Otherwise every single update would be persisted.
|
|
72
|
+
*/
|
|
73
|
+
debounce: number;
|
|
74
|
+
/**
|
|
75
|
+
* Makes sure to call `onStoreDocument` at least in the given amount of time (ms).
|
|
76
|
+
*/
|
|
77
|
+
maxDebounce: number;
|
|
70
78
|
/**
|
|
71
79
|
* By default, the servers show a start screen. If passed false, the server will start quietly.
|
|
72
80
|
*/
|
|
@@ -74,11 +82,12 @@ export interface Configuration extends Extension {
|
|
|
74
82
|
/**
|
|
75
83
|
* Function which returns the (customized) document name based on the request
|
|
76
84
|
*/
|
|
77
|
-
getDocumentName?(data:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
getDocumentName?(data: getDocumentNamePayload): string | Promise<string>;
|
|
86
|
+
}
|
|
87
|
+
export interface getDocumentNamePayload {
|
|
88
|
+
documentName: string;
|
|
89
|
+
request: IncomingMessage;
|
|
90
|
+
requestParameters: URLSearchParams;
|
|
82
91
|
}
|
|
83
92
|
export interface onAuthenticatePayload {
|
|
84
93
|
documentName: string;
|
|
@@ -87,7 +96,7 @@ export interface onAuthenticatePayload {
|
|
|
87
96
|
requestParameters: URLSearchParams;
|
|
88
97
|
socketId: string;
|
|
89
98
|
token: string;
|
|
90
|
-
connection:
|
|
99
|
+
connection: ConnectionConfiguration;
|
|
91
100
|
}
|
|
92
101
|
export interface onConnectPayload {
|
|
93
102
|
documentName: string;
|
|
@@ -96,7 +105,16 @@ export interface onConnectPayload {
|
|
|
96
105
|
requestHeaders: IncomingHttpHeaders;
|
|
97
106
|
requestParameters: URLSearchParams;
|
|
98
107
|
socketId: string;
|
|
99
|
-
connection:
|
|
108
|
+
connection: ConnectionConfiguration;
|
|
109
|
+
}
|
|
110
|
+
export interface connectedPayload {
|
|
111
|
+
documentName: string;
|
|
112
|
+
instance: Hocuspocus;
|
|
113
|
+
request: IncomingMessage;
|
|
114
|
+
requestHeaders: IncomingHttpHeaders;
|
|
115
|
+
requestParameters: URLSearchParams;
|
|
116
|
+
socketId: string;
|
|
117
|
+
connection: ConnectionConfiguration;
|
|
100
118
|
}
|
|
101
119
|
export interface onLoadDocumentPayload {
|
|
102
120
|
context: any;
|
|
@@ -106,7 +124,17 @@ export interface onLoadDocumentPayload {
|
|
|
106
124
|
requestHeaders: IncomingHttpHeaders;
|
|
107
125
|
requestParameters: URLSearchParams;
|
|
108
126
|
socketId: string;
|
|
109
|
-
connection:
|
|
127
|
+
connection: ConnectionConfiguration;
|
|
128
|
+
}
|
|
129
|
+
export interface afterLoadDocumentPayload {
|
|
130
|
+
context: any;
|
|
131
|
+
document: Document;
|
|
132
|
+
documentName: string;
|
|
133
|
+
instance: Hocuspocus;
|
|
134
|
+
requestHeaders: IncomingHttpHeaders;
|
|
135
|
+
requestParameters: URLSearchParams;
|
|
136
|
+
socketId: string;
|
|
137
|
+
connection: ConnectionConfiguration;
|
|
110
138
|
}
|
|
111
139
|
export interface onChangePayload {
|
|
112
140
|
clientsCount: number;
|
|
@@ -119,6 +147,41 @@ export interface onChangePayload {
|
|
|
119
147
|
update: Uint8Array;
|
|
120
148
|
socketId: string;
|
|
121
149
|
}
|
|
150
|
+
export interface onStoreDocumentPayload {
|
|
151
|
+
clientsCount: number;
|
|
152
|
+
context: any;
|
|
153
|
+
document: Document;
|
|
154
|
+
documentName: string;
|
|
155
|
+
instance: Hocuspocus;
|
|
156
|
+
requestHeaders: IncomingHttpHeaders;
|
|
157
|
+
requestParameters: URLSearchParams;
|
|
158
|
+
socketId: string;
|
|
159
|
+
}
|
|
160
|
+
export interface afterStoreDocumentPayload extends onStoreDocumentPayload {
|
|
161
|
+
}
|
|
162
|
+
export interface onAwarenessUpdatePayload {
|
|
163
|
+
clientsCount: number;
|
|
164
|
+
context: any;
|
|
165
|
+
document: Document;
|
|
166
|
+
documentName: string;
|
|
167
|
+
instance: Hocuspocus;
|
|
168
|
+
requestHeaders: IncomingHttpHeaders;
|
|
169
|
+
requestParameters: URLSearchParams;
|
|
170
|
+
update: Uint8Array;
|
|
171
|
+
socketId: string;
|
|
172
|
+
added: number[];
|
|
173
|
+
updated: number[];
|
|
174
|
+
removed: number[];
|
|
175
|
+
awareness: Awareness;
|
|
176
|
+
states: StatesArray;
|
|
177
|
+
}
|
|
178
|
+
export declare type StatesArray = {
|
|
179
|
+
clientId: number;
|
|
180
|
+
[key: string | number]: any;
|
|
181
|
+
}[];
|
|
182
|
+
export interface storePayload extends onStoreDocumentPayload {
|
|
183
|
+
state: Buffer;
|
|
184
|
+
}
|
|
122
185
|
export interface onDisconnectPayload {
|
|
123
186
|
clientsCount: number;
|
|
124
187
|
context: any;
|
|
@@ -149,10 +212,5 @@ export interface onDestroyPayload {
|
|
|
149
212
|
export interface onConfigurePayload {
|
|
150
213
|
configuration: Configuration;
|
|
151
214
|
version: string;
|
|
152
|
-
yjsVersion: string;
|
|
153
215
|
instance: Hocuspocus;
|
|
154
216
|
}
|
|
155
|
-
export interface CloseEvent {
|
|
156
|
-
code: number;
|
|
157
|
-
reason: string;
|
|
158
|
-
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createDirectory: (dir: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const flushRedis: () => Promise<string>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { HocuspocusProvider, HocuspocusProviderConfiguration } from '@hocuspocus/provider';
|
|
2
|
+
import { Hocuspocus } from '@hocuspocus/server';
|
|
3
|
+
export declare const newHocuspocusProvider: (server: Hocuspocus, options?: Partial<Omit<HocuspocusProviderConfiguration, 'url'>>) => HocuspocusProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const removeDirectory: (dir: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sleep: (time: number) => Promise<unknown>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/extension-sqlite",
|
|
3
3
|
"description": "a generic Hocuspocus persistence driver for the sqlite",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.12",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"hocuspocus",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@hocuspocus/extension-database": "^1.0.0-alpha.
|
|
30
|
-
"
|
|
29
|
+
"@hocuspocus/extension-database": "^1.0.0-alpha.12",
|
|
30
|
+
"kleur": "^4.1.4",
|
|
31
31
|
"sqlite3": "^5.0.2"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/sqlite3": "^3.1.
|
|
37
|
+
"@types/sqlite3": "^3.1.8"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "1fc2a6cff1b5fd626b8dd7c486755111965da20d"
|
|
40
40
|
}
|