@hocuspocus/provider 2.11.3 → 2.12.1-rc.0
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-provider.cjs.map +1 -1
- package/dist/hocuspocus-provider.esm.js.map +1 -1
- package/dist/packages/extension-redis/src/Redis.d.ts +1 -1
- package/dist/packages/provider/src/HocuspocusProviderWebsocket.d.ts +1 -1
- package/dist/packages/provider/src/types.d.ts +1 -1
- package/dist/packages/server/src/types.d.ts +14 -2
- package/package.json +2 -2
- package/src/HocuspocusProviderWebsocket.ts +1 -1
- package/src/types.ts +1 -1
|
@@ -110,7 +110,7 @@ export declare class Redis implements Extension {
|
|
|
110
110
|
onChange(data: onChangePayload): Promise<any>;
|
|
111
111
|
/**
|
|
112
112
|
* Make sure to *not* listen for further changes, when there’s
|
|
113
|
-
*
|
|
113
|
+
* no one connected anymore.
|
|
114
114
|
*/
|
|
115
115
|
onDisconnect: ({ documentName }: onDisconnectPayload) => Promise<void>;
|
|
116
116
|
beforeBroadcastStateless(data: beforeBroadcastStatelessPayload): Promise<number>;
|
|
@@ -35,7 +35,7 @@ export interface CompleteHocuspocusProviderWebsocketConfiguration {
|
|
|
35
35
|
*/
|
|
36
36
|
delay: number;
|
|
37
37
|
/**
|
|
38
|
-
* The
|
|
38
|
+
* The initialDelay is the amount of time to wait before making the first attempt. This option should typically be 0 since you typically want the first attempt to happen immediately.
|
|
39
39
|
*/
|
|
40
40
|
initialDelay: number;
|
|
41
41
|
/**
|
|
@@ -113,7 +113,7 @@ export type THistoryAction = THistoryDocumentRevertAction | THistoryVersionCreat
|
|
|
113
113
|
export type THistoryDocumentRevertAction = {
|
|
114
114
|
action: 'document.revert';
|
|
115
115
|
/**
|
|
116
|
-
* if changes
|
|
116
|
+
* if changes haven't been persisted to a version yet, we'll create one with the specified name,
|
|
117
117
|
* expect when `false` is passed.
|
|
118
118
|
*/
|
|
119
119
|
currentVersionName?: string | false;
|
|
@@ -38,6 +38,7 @@ export interface Extension {
|
|
|
38
38
|
onConnect?(data: onConnectPayload): Promise<any>;
|
|
39
39
|
connected?(data: connectedPayload): Promise<any>;
|
|
40
40
|
onAuthenticate?(data: onAuthenticatePayload): Promise<any>;
|
|
41
|
+
onCreateDocument?(data: onCreateDocumentPayload): Promise<any>;
|
|
41
42
|
onLoadDocument?(data: onLoadDocumentPayload): Promise<any>;
|
|
42
43
|
afterLoadDocument?(data: afterLoadDocumentPayload): Promise<any>;
|
|
43
44
|
beforeHandleMessage?(data: beforeHandleMessagePayload): Promise<any>;
|
|
@@ -52,7 +53,7 @@ export interface Extension {
|
|
|
52
53
|
afterUnloadDocument?(data: afterUnloadDocumentPayload): Promise<any>;
|
|
53
54
|
onDestroy?(data: onDestroyPayload): Promise<any>;
|
|
54
55
|
}
|
|
55
|
-
export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'afterUnloadDocument' | 'onDestroy';
|
|
56
|
+
export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'afterUnloadDocument' | 'onDestroy';
|
|
56
57
|
export type HookPayloadByName = {
|
|
57
58
|
onConfigure: onConfigurePayload;
|
|
58
59
|
onListen: onListenPayload;
|
|
@@ -60,6 +61,7 @@ export type HookPayloadByName = {
|
|
|
60
61
|
onConnect: onConnectPayload;
|
|
61
62
|
connected: connectedPayload;
|
|
62
63
|
onAuthenticate: onAuthenticatePayload;
|
|
64
|
+
onCreateDocument: onCreateDocumentPayload;
|
|
63
65
|
onLoadDocument: onLoadDocumentPayload;
|
|
64
66
|
afterLoadDocument: afterLoadDocumentPayload;
|
|
65
67
|
beforeHandleMessage: beforeHandleMessagePayload;
|
|
@@ -80,7 +82,7 @@ export interface Configuration extends Extension {
|
|
|
80
82
|
*/
|
|
81
83
|
name: string | null;
|
|
82
84
|
/**
|
|
83
|
-
* A list of hocuspocus
|
|
85
|
+
* A list of hocuspocus extensions.
|
|
84
86
|
*/
|
|
85
87
|
extensions: Array<Extension>;
|
|
86
88
|
/**
|
|
@@ -142,10 +144,20 @@ export interface onAuthenticatePayload {
|
|
|
142
144
|
instance: Hocuspocus;
|
|
143
145
|
requestHeaders: IncomingHttpHeaders;
|
|
144
146
|
requestParameters: URLSearchParams;
|
|
147
|
+
request: IncomingMessage;
|
|
145
148
|
socketId: string;
|
|
146
149
|
token: string;
|
|
147
150
|
connection: ConnectionConfiguration;
|
|
148
151
|
}
|
|
152
|
+
export interface onCreateDocumentPayload {
|
|
153
|
+
context: any;
|
|
154
|
+
documentName: string;
|
|
155
|
+
instance: Hocuspocus;
|
|
156
|
+
requestHeaders: IncomingHttpHeaders;
|
|
157
|
+
requestParameters: URLSearchParams;
|
|
158
|
+
socketId: string;
|
|
159
|
+
connection: ConnectionConfiguration;
|
|
160
|
+
}
|
|
149
161
|
export interface onConnectPayload {
|
|
150
162
|
context: any;
|
|
151
163
|
documentName: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/provider",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.1-rc.0",
|
|
4
4
|
"description": "hocuspocus provider",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@hocuspocus/common": "^2.
|
|
32
|
+
"@hocuspocus/common": "^2.12.1-rc.0",
|
|
33
33
|
"@lifeomic/attempt": "^3.0.2",
|
|
34
34
|
"lib0": "^0.2.87",
|
|
35
35
|
"ws": "^8.14.2"
|
|
@@ -50,7 +50,7 @@ export interface CompleteHocuspocusProviderWebsocketConfiguration {
|
|
|
50
50
|
*/
|
|
51
51
|
delay: number,
|
|
52
52
|
/**
|
|
53
|
-
* The
|
|
53
|
+
* The initialDelay is the amount of time to wait before making the first attempt. This option should typically be 0 since you typically want the first attempt to happen immediately.
|
|
54
54
|
*/
|
|
55
55
|
initialDelay: number,
|
|
56
56
|
/**
|
package/src/types.ts
CHANGED
|
@@ -143,7 +143,7 @@ export type THistoryAction =
|
|
|
143
143
|
export type THistoryDocumentRevertAction = {
|
|
144
144
|
action: 'document.revert';
|
|
145
145
|
/**
|
|
146
|
-
* if changes
|
|
146
|
+
* if changes haven't been persisted to a version yet, we'll create one with the specified name,
|
|
147
147
|
* expect when `false` is passed.
|
|
148
148
|
*/
|
|
149
149
|
currentVersionName?: string | false;
|