@hocuspocus/extension-redis 1.0.0-alpha.43 → 1.0.0-alpha.48

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.
@@ -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
- private hooks;
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 static getDocumentName;
78
+ private getDocumentNameFromRequest;
80
79
  enableDebugging(): void;
81
80
  enableMessageLogging(): void;
82
81
  disableLogging(): void;
@@ -67,6 +67,14 @@ export interface Configuration extends Extension {
67
67
  * Defines in which interval the server sends a ping, and closes the connection when no pong is sent back.
68
68
  */
69
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 | Promise<string>;
70
78
  }
71
79
  export interface onAuthenticatePayload {
72
80
  documentName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-redis",
3
- "version": "1.0.0-alpha.43",
3
+ "version": "1.0.0-alpha.48",
4
4
  "description": "hocuspocus persistence driver for Redis",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
@@ -14,7 +14,7 @@
14
14
  "module": "dist/hocuspocus-redis.esm.js",
15
15
  "types": "dist/packages/extension-redis/src/index.d.ts",
16
16
  "exports": {
17
- "development": {
17
+ "source": {
18
18
  "import": "./src"
19
19
  },
20
20
  "default": {
@@ -27,9 +27,9 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "@hocuspocus/server": "^1.0.0-alpha.80",
30
+ "@hocuspocus/server": "^1.0.0-alpha.85",
31
31
  "y-redis": "^1.0.2",
32
32
  "yjs": "^13.5.0"
33
33
  },
34
- "gitHead": "f85955a7cca23b23044b0579e96fc8d17c107a4c"
34
+ "gitHead": "63a50dd02286693b5025ac385c3fb4afd6b29050"
35
35
  }