@hocuspocus/extension-logger 1.0.0-alpha.53 → 1.0.0-alpha.58
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.
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './auth';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import WebSocket, { WebSocketServer } from 'ws';
|
|
3
3
|
import { IncomingMessage, Server as HTTPServer } from 'http';
|
|
4
|
-
import { Configuration } from './types';
|
|
4
|
+
import { Configuration, Hook } from './types';
|
|
5
5
|
import { MessageLogger } from './Debugger';
|
|
6
6
|
export declare const defaultConfiguration: {
|
|
7
7
|
name: null;
|
|
@@ -64,9 +64,8 @@ export declare class Hocuspocus {
|
|
|
64
64
|
/**
|
|
65
65
|
* Run the given hook on all configured extensions
|
|
66
66
|
* Runs the given callback after each hook
|
|
67
|
-
* @private
|
|
68
67
|
*/
|
|
69
|
-
|
|
68
|
+
hooks(name: Hook, payload: any, callback?: Function | null): Promise<any>;
|
|
70
69
|
/**
|
|
71
70
|
* Get parameters by the given request
|
|
72
71
|
* @private
|
|
@@ -76,7 +75,7 @@ export declare class Hocuspocus {
|
|
|
76
75
|
* Get document name by the given request
|
|
77
76
|
* @private
|
|
78
77
|
*/
|
|
79
|
-
private
|
|
78
|
+
private getDocumentNameFromRequest;
|
|
80
79
|
enableDebugging(): void;
|
|
81
80
|
enableMessageLogging(): void;
|
|
82
81
|
disableLogging(): void;
|
|
@@ -45,6 +45,11 @@ export interface Extension {
|
|
|
45
45
|
onRequest?(data: onRequestPayload): Promise<any>;
|
|
46
46
|
onUpgrade?(data: onUpgradePayload): Promise<any>;
|
|
47
47
|
}
|
|
48
|
+
export declare type Hook = 'onAuthenticate' | 'onChange' | 'onConnect' | 'onConfigure' |
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated onCreateDocument is deprecated, use onLoadDocument instead
|
|
51
|
+
*/
|
|
52
|
+
'onCreateDocument' | 'onLoadDocument' | 'onDestroy' | 'onDisconnect' | 'onListen' | 'onRequest' | 'onUpgrade';
|
|
48
53
|
export interface Configuration extends Extension {
|
|
49
54
|
/**
|
|
50
55
|
* A name for the instance, used for logging.
|
|
@@ -62,6 +67,14 @@ export interface Configuration extends Extension {
|
|
|
62
67
|
* Defines in which interval the server sends a ping, and closes the connection when no pong is sent back.
|
|
63
68
|
*/
|
|
64
69
|
timeout: number;
|
|
70
|
+
/**
|
|
71
|
+
* Function which returns the (customized) document name based on the request
|
|
72
|
+
*/
|
|
73
|
+
getDocumentName?(data: {
|
|
74
|
+
documentName: string;
|
|
75
|
+
request: IncomingMessage;
|
|
76
|
+
requestParameters: URLSearchParams;
|
|
77
|
+
}): string;
|
|
65
78
|
}
|
|
66
79
|
export interface onAuthenticatePayload {
|
|
67
80
|
documentName: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/extension-logger",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.58",
|
|
4
4
|
"description": "hocuspocus logging extension",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"module": "dist/hocuspocus-logger.esm.js",
|
|
16
16
|
"types": "dist/packages/extension-logger/src/index.d.ts",
|
|
17
17
|
"exports": {
|
|
18
|
-
"
|
|
18
|
+
"source": {
|
|
19
19
|
"import": "./src"
|
|
20
20
|
},
|
|
21
21
|
"default": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@hocuspocus/server": "^1.0.0-alpha.
|
|
31
|
+
"@hocuspocus/server": "^1.0.0-alpha.84"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "fa947e4cb14426c27c53f7b0a77dcd73d1714cda"
|
|
34
34
|
}
|