@hocuspocus/extension-logger 3.0.8-rc.0 → 3.1.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/node_modules/@tiptap/pm/model/index.d.ts +1 -0
- package/dist/node_modules/@tiptap/pm/state/index.d.ts +1 -0
- package/dist/node_modules/@tiptap/pm/transform/index.d.ts +1 -0
- package/dist/node_modules/@tiptap/pm/view/index.d.ts +1 -0
- package/dist/packages/extension-redis/src/Redis.d.ts +8 -9
- package/dist/packages/provider/src/HocuspocusProviderWebsocket.d.ts +6 -16
- package/dist/packages/provider/src/MessageSender.d.ts +2 -3
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'prosemirror-model';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'prosemirror-state';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'prosemirror-transform';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'prosemirror-view';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import Redlock from
|
|
4
|
-
import type { Extension, afterLoadDocumentPayload, afterStoreDocumentPayload, onDisconnectPayload, onStoreDocumentPayload, onAwarenessUpdatePayload, onChangePayload, onConfigurePayload, beforeBroadcastStatelessPayload, Hocuspocus } from '@hocuspocus/server';
|
|
1
|
+
import type { Extension, Hocuspocus, afterLoadDocumentPayload, afterStoreDocumentPayload, beforeBroadcastStatelessPayload, onAwarenessUpdatePayload, onChangePayload, onConfigurePayload, onDisconnectPayload, onStoreDocumentPayload } from "@hocuspocus/server";
|
|
2
|
+
import type { ClusterNode, ClusterOptions, RedisOptions } from "ioredis";
|
|
3
|
+
import Redlock from "redlock";
|
|
5
4
|
export type RedisInstance = RedisClient.Cluster | RedisClient.Redis;
|
|
6
5
|
export interface Configuration {
|
|
7
6
|
/**
|
|
@@ -81,7 +80,7 @@ export declare class Redis implements Extension {
|
|
|
81
80
|
/**
|
|
82
81
|
* Once a document is loaded, subscribe to the channel in Redis.
|
|
83
82
|
*/
|
|
84
|
-
afterLoadDocument({ documentName, document }: afterLoadDocumentPayload): Promise<unknown>;
|
|
83
|
+
afterLoadDocument({ documentName, document, }: afterLoadDocumentPayload): Promise<unknown>;
|
|
85
84
|
/**
|
|
86
85
|
* Publish the first sync step through Redis.
|
|
87
86
|
*/
|
|
@@ -98,16 +97,16 @@ export declare class Redis implements Extension {
|
|
|
98
97
|
/**
|
|
99
98
|
* Release the Redis lock, so other instances can store documents.
|
|
100
99
|
*/
|
|
101
|
-
afterStoreDocument({ documentName, socketId }: afterStoreDocumentPayload): Promise<void>;
|
|
100
|
+
afterStoreDocument({ documentName, socketId, }: afterStoreDocumentPayload): Promise<void>;
|
|
102
101
|
/**
|
|
103
102
|
* Handle awareness update messages received directly by this Hocuspocus instance.
|
|
104
103
|
*/
|
|
105
|
-
onAwarenessUpdate({ documentName, awareness, added, updated, removed, }: onAwarenessUpdatePayload): Promise<
|
|
104
|
+
onAwarenessUpdate({ documentName, awareness, added, updated, removed, }: onAwarenessUpdatePayload): Promise<any>;
|
|
106
105
|
/**
|
|
107
106
|
* Handle incoming messages published on subscribed document channels.
|
|
108
107
|
* Note that this will also include messages from ourselves as it is not possible
|
|
109
108
|
* in Redis to filter these.
|
|
110
|
-
|
|
109
|
+
*/
|
|
111
110
|
private handleIncomingMessage;
|
|
112
111
|
/**
|
|
113
112
|
* if the ydoc changed, we'll need to inform other Hocuspocus servers about it.
|
|
@@ -118,7 +117,7 @@ export declare class Redis implements Extension {
|
|
|
118
117
|
* no one connected anymore.
|
|
119
118
|
*/
|
|
120
119
|
onDisconnect: ({ documentName }: onDisconnectPayload) => Promise<void>;
|
|
121
|
-
beforeBroadcastStateless(data: beforeBroadcastStatelessPayload): Promise<
|
|
120
|
+
beforeBroadcastStateless(data: beforeBroadcastStatelessPayload): Promise<any>;
|
|
122
121
|
/**
|
|
123
122
|
* Kill the Redlock connection immediately.
|
|
124
123
|
*/
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import EventEmitter from
|
|
3
|
-
import type { HocuspocusProvider } from
|
|
4
|
-
import type { onAwarenessChangeParameters, onAwarenessUpdateParameters, onCloseParameters, onDisconnectParameters, onMessageParameters, onOpenParameters, onOutgoingMessageParameters, onStatusParameters } from
|
|
5
|
-
import { WebSocketStatus } from
|
|
1
|
+
import type { Event, MessageEvent } from "ws";
|
|
2
|
+
import EventEmitter from "./EventEmitter.ts";
|
|
3
|
+
import type { HocuspocusProvider } from "./HocuspocusProvider.ts";
|
|
4
|
+
import type { onAwarenessChangeParameters, onAwarenessUpdateParameters, onCloseParameters, onDisconnectParameters, onMessageParameters, onOpenParameters, onOutgoingMessageParameters, onStatusParameters } from "./types.ts";
|
|
5
|
+
import { WebSocketStatus } from "./types.ts";
|
|
6
6
|
export type HocusPocusWebSocket = WebSocket & {
|
|
7
7
|
identifier: string;
|
|
8
8
|
};
|
|
9
|
-
export type HocuspocusProviderWebsocketConfiguration = Required<Pick<CompleteHocuspocusProviderWebsocketConfiguration,
|
|
9
|
+
export type HocuspocusProviderWebsocketConfiguration = Required<Pick<CompleteHocuspocusProviderWebsocketConfiguration, "url">> & Partial<CompleteHocuspocusProviderWebsocketConfiguration>;
|
|
10
10
|
export interface CompleteHocuspocusProviderWebsocketConfiguration {
|
|
11
11
|
/**
|
|
12
12
|
* URL of your @hocuspocus/server instance
|
|
13
13
|
*/
|
|
14
14
|
url: string;
|
|
15
|
-
/**
|
|
16
|
-
* Pass `false` to start the connection manually.
|
|
17
|
-
*/
|
|
18
|
-
connect: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* URL parameters that should be added.
|
|
21
|
-
*/
|
|
22
|
-
parameters: {
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
};
|
|
25
15
|
/**
|
|
26
16
|
* An optional WebSocket polyfill, for example for Node.js
|
|
27
17
|
*/
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { Encoder } from
|
|
2
|
-
import type { ConstructableOutgoingMessage } from
|
|
1
|
+
import type { Encoder } from "lib0/encoding";
|
|
2
|
+
import type { ConstructableOutgoingMessage } from "./types.ts";
|
|
3
3
|
export declare class MessageSender {
|
|
4
4
|
encoder: Encoder;
|
|
5
5
|
message: any;
|
|
6
6
|
constructor(Message: ConstructableOutgoingMessage, args?: any);
|
|
7
7
|
create(): Uint8Array<ArrayBufferLike>;
|
|
8
8
|
send(webSocket: any): void;
|
|
9
|
-
broadcast(channel: string): void;
|
|
10
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/extension-logger",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "hocuspocus logging extension",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@hocuspocus/server": "^3.
|
|
32
|
+
"@hocuspocus/server": "^3.1.0"
|
|
33
33
|
},
|
|
34
34
|
"gitHead": "b3454a4ca289a84ddfb7fa5607a2d4b8d5c37e9d"
|
|
35
35
|
}
|