@hocuspocus/extension-webhook 1.0.0-alpha.69 → 1.0.0-alpha.71
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.
|
@@ -26,6 +26,10 @@ export declare class Connection {
|
|
|
26
26
|
* Set a callback that will be triggered when the connection is closed
|
|
27
27
|
*/
|
|
28
28
|
onClose(callback: (document: Document) => void): Connection;
|
|
29
|
+
/**
|
|
30
|
+
* Set a callback that will be triggered before an message is handled
|
|
31
|
+
*/
|
|
32
|
+
beforeHandleMessage(callback: (payload: Document, update: Uint8Array) => Promise<any>): Connection;
|
|
29
33
|
/**
|
|
30
34
|
* Send the given message
|
|
31
35
|
*/
|
|
@@ -49,6 +53,13 @@ export declare class Connection {
|
|
|
49
53
|
* @private
|
|
50
54
|
*/
|
|
51
55
|
private handleMessage;
|
|
56
|
+
/**
|
|
57
|
+
* Handle a ws instance error, which is required to prevent
|
|
58
|
+
* the server from crashing when one happens
|
|
59
|
+
* See https://github.com/websockets/ws/issues/1777#issuecomment-660803472
|
|
60
|
+
* @private
|
|
61
|
+
*/
|
|
62
|
+
private handleError;
|
|
52
63
|
/**
|
|
53
64
|
* Get the underlying connection instance
|
|
54
65
|
* @deprecated
|
|
@@ -36,6 +36,7 @@ export interface Extension {
|
|
|
36
36
|
onCreateDocument?(data: onLoadDocumentPayload): Promise<any>;
|
|
37
37
|
onLoadDocument?(data: onLoadDocumentPayload): Promise<any>;
|
|
38
38
|
afterLoadDocument?(data: onLoadDocumentPayload): Promise<any>;
|
|
39
|
+
beforeHandleMessage?(data: beforeHandleMessagePayload): Promise<any>;
|
|
39
40
|
onChange?(data: onChangePayload): Promise<any>;
|
|
40
41
|
onStoreDocument?(data: onStoreDocumentPayload): Promise<any>;
|
|
41
42
|
afterStoreDocument?(data: afterStoreDocumentPayload): Promise<any>;
|
|
@@ -48,7 +49,7 @@ export declare type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onCon
|
|
|
48
49
|
/**
|
|
49
50
|
* @deprecated onCreateDocument is deprecated, use onLoadDocument instead
|
|
50
51
|
*/
|
|
51
|
-
'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'onDestroy';
|
|
52
|
+
'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'onDestroy';
|
|
52
53
|
export declare type HookPayload = onConfigurePayload | onListenPayload | onUpgradePayload | onConnectPayload | connectedPayload | onAuthenticatePayload | onLoadDocumentPayload | onChangePayload | onStoreDocumentPayload | afterStoreDocumentPayload | onAwarenessUpdatePayload | onRequestPayload | onDisconnectPayload | onDestroyPayload;
|
|
53
54
|
export interface Configuration extends Extension {
|
|
54
55
|
/**
|
|
@@ -155,6 +156,17 @@ export interface onChangePayload {
|
|
|
155
156
|
update: Uint8Array;
|
|
156
157
|
socketId: string;
|
|
157
158
|
}
|
|
159
|
+
export interface beforeHandleMessagePayload {
|
|
160
|
+
clientsCount: number;
|
|
161
|
+
context: any;
|
|
162
|
+
document: Document;
|
|
163
|
+
documentName: string;
|
|
164
|
+
instance: Hocuspocus;
|
|
165
|
+
requestHeaders: IncomingHttpHeaders;
|
|
166
|
+
requestParameters: URLSearchParams;
|
|
167
|
+
update: Uint8Array;
|
|
168
|
+
socketId: string;
|
|
169
|
+
}
|
|
158
170
|
export interface onStoreDocumentPayload {
|
|
159
171
|
clientsCount: number;
|
|
160
172
|
context: any;
|
|
@@ -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-webhook",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.71",
|
|
4
4
|
"description": "hocuspocus webhook extension",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@hocuspocus/server": "^1.0.0-alpha.
|
|
32
|
+
"@hocuspocus/server": "^1.0.0-alpha.107",
|
|
33
33
|
"@hocuspocus/transformer": "^1.0.0-alpha.23",
|
|
34
|
-
"axios": "^0.
|
|
34
|
+
"axios": "^0.27.2",
|
|
35
35
|
"yjs": "^13.5.29"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "3dc62aedd8d19d4a9c346188885657ea814271c0"
|
|
38
38
|
}
|