@hocuspocus/extension-logger 3.0.0-rc.0 → 3.0.4-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-logger.cjs.map +1 -1
- package/dist/hocuspocus-logger.esm.js.map +1 -1
- package/dist/packages/common/src/auth.d.ts +1 -1
- package/dist/packages/extension-redis/src/Redis.d.ts +8 -2
- package/dist/packages/extension-throttle/src/index.d.ts +1 -0
- package/dist/packages/extension-webhook/src/index.d.ts +1 -0
- package/dist/packages/provider/src/HocuspocusProvider.d.ts +11 -33
- package/dist/packages/provider/src/HocuspocusProviderWebsocket.d.ts +0 -4
- package/dist/packages/provider/src/MessageReceiver.d.ts +0 -2
- package/dist/packages/provider/src/index.d.ts +0 -2
- package/dist/packages/provider/src/types.d.ts +42 -2
- package/dist/packages/server/src/ClientConnection.d.ts +15 -5
- package/dist/packages/server/src/Connection.d.ts +3 -17
- package/dist/packages/server/src/DirectConnection.d.ts +1 -1
- package/dist/packages/server/src/Document.d.ts +1 -5
- package/dist/packages/server/src/Hocuspocus.d.ts +3 -11
- package/dist/packages/server/src/MessageReceiver.d.ts +1 -3
- package/dist/packages/server/src/OutgoingMessage.d.ts +1 -0
- package/dist/packages/server/src/Server.d.ts +3 -2
- package/dist/packages/server/src/index.d.ts +0 -1
- package/dist/packages/server/src/types.d.ts +20 -11
- package/dist/packages/server/src/util/getParameters.d.ts +2 -0
- package/dist/tests/utils/newHocuspocusProvider.d.ts +2 -2
- package/dist/tests/utils/newHocuspocusProviderWebsocket.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/provider/src/TiptapCollabProvider.d.ts +0 -64
- package/dist/packages/provider/src/TiptapCollabProviderWebsocket.d.ts +0 -20
- package/dist/packages/server/src/Debugger.d.ts +0 -14
- package/dist/tests/server/getMessageLogs.d.ts +0 -1
- package/dist/tests/server/requiresAuthentication.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hocuspocus-logger.cjs","sources":["../src/Logger.ts"],"sourcesContent":["import type {\n Extension,\n onChangePayload,\n onConfigurePayload,\n onConnectPayload,\n onLoadDocumentPayload,\n onDestroyPayload,\n onDisconnectPayload,\n onRequestPayload,\n onUpgradePayload,\n} from '@hocuspocus/server'\n\nexport interface LoggerConfiguration {\n /**\n * Prepend all logging message with a string.\n *\n * @deprecated\n */\n prefix: null | string,\n /**\n * Whether to log something for the `onLoadDocument` hook.\n */\n onLoadDocument: boolean,\n /**\n * Whether to log something for the `onChange` hook.\n */\n onChange: boolean,\n /**\n * Whether to log something for the `onStoreDocument` hook.\n */\n onStoreDocument: boolean,\n /**\n * Whether to log something for the `onConnect` hook.\n */\n onConnect: boolean,\n /**\n * Whether to log something for the `onDisconnect` hook.\n */\n onDisconnect: boolean,\n /**\n * Whether to log something for the `onUpgrade` hook.\n */\n onUpgrade: boolean,\n /**\n * Whether to log something for the `onRequest` hook.\n */\n onRequest: boolean,\n /**\n * Whether to log something for the `onDestroy` hook.\n */\n onDestroy: boolean,\n /**\n * Whether to log something for the `onConfigure` hook.\n */\n onConfigure: boolean,\n /**\n * A log function, if none is provided output will go to console\n */\n log: (...args: any[]) => void,\n}\n\nexport class Logger implements Extension {\n name: string | null = null\n\n configuration: LoggerConfiguration = {\n prefix: null,\n onLoadDocument: true,\n onChange: true,\n onStoreDocument: true,\n onConnect: true,\n onDisconnect: true,\n onUpgrade: true,\n onRequest: true,\n onDestroy: true,\n onConfigure: true,\n log: console.log, // eslint-disable-line\n }\n\n /**\n * Constructor\n */\n constructor(configuration?: Partial<LoggerConfiguration>) {\n this.configuration = {\n ...this.configuration,\n ...configuration,\n }\n }\n\n async onConfigure(data: onConfigurePayload) {\n this.name = data.instance.configuration.name\n\n if (!this.configuration.onConfigure) {\n return\n }\n\n if (this.configuration.prefix) {\n console.warn('[hocuspocus warn] The Logger \\'prefix\\' is deprecated. Pass a \\'name\\' to the Hocuspocus configuration instead.')\n }\n }\n\n async onLoadDocument(data: onLoadDocumentPayload) {\n if (this.configuration.onLoadDocument) {\n this.log(`Loaded document \"${data.documentName}\".`)\n }\n }\n\n async onChange(data: onChangePayload) {\n if (this.configuration.onChange) {\n this.log(`Document \"${data.documentName}\" changed.`)\n }\n }\n\n async onStoreDocument(data: onDisconnectPayload) {\n if (this.configuration.onStoreDocument) {\n this.log(`Store \"${data.documentName}\".`)\n }\n }\n\n async onConnect(data: onConnectPayload) {\n if (this.configuration.onConnect) {\n this.log(`New connection to \"${data.documentName}\".`)\n }\n }\n\n async onDisconnect(data: onDisconnectPayload) {\n if (this.configuration.onDisconnect) {\n this.log(`Connection to \"${data.documentName}\" closed.`)\n }\n }\n\n async onUpgrade(data: onUpgradePayload) {\n if (this.configuration.onUpgrade) {\n this.log('Upgrading connection …')\n }\n }\n\n async onRequest(data: onRequestPayload) {\n if (this.configuration.onRequest) {\n this.log(`Incoming HTTP Request to ${data.request.url}`)\n }\n }\n\n async onDestroy(data: onDestroyPayload) {\n if (this.configuration.onDestroy) {\n this.log('Shut down.')\n }\n }\n\n private log(message: string) {\n const date = (new Date()).toISOString()\n let meta = `${date}`\n\n if (this.name) {\n meta = `${this.name} ${meta}`\n }\n\n message = `[${meta}] ${message}`\n\n this.configuration.log(message)\n }\n}\n"],"names":[],"mappings":";;MA6Da,MAAM,CAAA;AAiBjB;;AAEG;AACH,IAAA,WAAA,CAAY,aAA4C,EAAA;QAnBxD,IAAI,CAAA,IAAA,GAAkB,IAAI
|
|
1
|
+
{"version":3,"file":"hocuspocus-logger.cjs","sources":["../src/Logger.ts"],"sourcesContent":["import type {\n Extension,\n onChangePayload,\n onConfigurePayload,\n onConnectPayload,\n onLoadDocumentPayload,\n onDestroyPayload,\n onDisconnectPayload,\n onRequestPayload,\n onUpgradePayload,\n} from '@hocuspocus/server'\n\nexport interface LoggerConfiguration {\n /**\n * Prepend all logging message with a string.\n *\n * @deprecated\n */\n prefix: null | string,\n /**\n * Whether to log something for the `onLoadDocument` hook.\n */\n onLoadDocument: boolean,\n /**\n * Whether to log something for the `onChange` hook.\n */\n onChange: boolean,\n /**\n * Whether to log something for the `onStoreDocument` hook.\n */\n onStoreDocument: boolean,\n /**\n * Whether to log something for the `onConnect` hook.\n */\n onConnect: boolean,\n /**\n * Whether to log something for the `onDisconnect` hook.\n */\n onDisconnect: boolean,\n /**\n * Whether to log something for the `onUpgrade` hook.\n */\n onUpgrade: boolean,\n /**\n * Whether to log something for the `onRequest` hook.\n */\n onRequest: boolean,\n /**\n * Whether to log something for the `onDestroy` hook.\n */\n onDestroy: boolean,\n /**\n * Whether to log something for the `onConfigure` hook.\n */\n onConfigure: boolean,\n /**\n * A log function, if none is provided output will go to console\n */\n log: (...args: any[]) => void,\n}\n\nexport class Logger implements Extension {\n name: string | null = null\n\n configuration: LoggerConfiguration = {\n prefix: null,\n onLoadDocument: true,\n onChange: true,\n onStoreDocument: true,\n onConnect: true,\n onDisconnect: true,\n onUpgrade: true,\n onRequest: true,\n onDestroy: true,\n onConfigure: true,\n log: console.log, // eslint-disable-line\n }\n\n /**\n * Constructor\n */\n constructor(configuration?: Partial<LoggerConfiguration>) {\n this.configuration = {\n ...this.configuration,\n ...configuration,\n }\n }\n\n async onConfigure(data: onConfigurePayload) {\n this.name = data.instance.configuration.name\n\n if (!this.configuration.onConfigure) {\n return\n }\n\n if (this.configuration.prefix) {\n console.warn('[hocuspocus warn] The Logger \\'prefix\\' is deprecated. Pass a \\'name\\' to the Hocuspocus configuration instead.')\n }\n }\n\n async onLoadDocument(data: onLoadDocumentPayload) {\n if (this.configuration.onLoadDocument) {\n this.log(`Loaded document \"${data.documentName}\".`)\n }\n }\n\n async onChange(data: onChangePayload) {\n if (this.configuration.onChange) {\n this.log(`Document \"${data.documentName}\" changed.`)\n }\n }\n\n async onStoreDocument(data: onDisconnectPayload) {\n if (this.configuration.onStoreDocument) {\n this.log(`Store \"${data.documentName}\".`)\n }\n }\n\n async onConnect(data: onConnectPayload) {\n if (this.configuration.onConnect) {\n this.log(`New connection to \"${data.documentName}\".`)\n }\n }\n\n async onDisconnect(data: onDisconnectPayload) {\n if (this.configuration.onDisconnect) {\n this.log(`Connection to \"${data.documentName}\" closed.`)\n }\n }\n\n async onUpgrade(data: onUpgradePayload) {\n if (this.configuration.onUpgrade) {\n this.log('Upgrading connection …')\n }\n }\n\n async onRequest(data: onRequestPayload) {\n if (this.configuration.onRequest) {\n this.log(`Incoming HTTP Request to ${data.request.url}`)\n }\n }\n\n async onDestroy(data: onDestroyPayload) {\n if (this.configuration.onDestroy) {\n this.log('Shut down.')\n }\n }\n\n private log(message: string) {\n const date = (new Date()).toISOString()\n let meta = `${date}`\n\n if (this.name) {\n meta = `${this.name} ${meta}`\n }\n\n message = `[${meta}] ${message}`\n\n this.configuration.log(message)\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hocuspocus-logger.esm.js","sources":["../src/Logger.ts"],"sourcesContent":["import type {\n Extension,\n onChangePayload,\n onConfigurePayload,\n onConnectPayload,\n onLoadDocumentPayload,\n onDestroyPayload,\n onDisconnectPayload,\n onRequestPayload,\n onUpgradePayload,\n} from '@hocuspocus/server'\n\nexport interface LoggerConfiguration {\n /**\n * Prepend all logging message with a string.\n *\n * @deprecated\n */\n prefix: null | string,\n /**\n * Whether to log something for the `onLoadDocument` hook.\n */\n onLoadDocument: boolean,\n /**\n * Whether to log something for the `onChange` hook.\n */\n onChange: boolean,\n /**\n * Whether to log something for the `onStoreDocument` hook.\n */\n onStoreDocument: boolean,\n /**\n * Whether to log something for the `onConnect` hook.\n */\n onConnect: boolean,\n /**\n * Whether to log something for the `onDisconnect` hook.\n */\n onDisconnect: boolean,\n /**\n * Whether to log something for the `onUpgrade` hook.\n */\n onUpgrade: boolean,\n /**\n * Whether to log something for the `onRequest` hook.\n */\n onRequest: boolean,\n /**\n * Whether to log something for the `onDestroy` hook.\n */\n onDestroy: boolean,\n /**\n * Whether to log something for the `onConfigure` hook.\n */\n onConfigure: boolean,\n /**\n * A log function, if none is provided output will go to console\n */\n log: (...args: any[]) => void,\n}\n\nexport class Logger implements Extension {\n name: string | null = null\n\n configuration: LoggerConfiguration = {\n prefix: null,\n onLoadDocument: true,\n onChange: true,\n onStoreDocument: true,\n onConnect: true,\n onDisconnect: true,\n onUpgrade: true,\n onRequest: true,\n onDestroy: true,\n onConfigure: true,\n log: console.log, // eslint-disable-line\n }\n\n /**\n * Constructor\n */\n constructor(configuration?: Partial<LoggerConfiguration>) {\n this.configuration = {\n ...this.configuration,\n ...configuration,\n }\n }\n\n async onConfigure(data: onConfigurePayload) {\n this.name = data.instance.configuration.name\n\n if (!this.configuration.onConfigure) {\n return\n }\n\n if (this.configuration.prefix) {\n console.warn('[hocuspocus warn] The Logger \\'prefix\\' is deprecated. Pass a \\'name\\' to the Hocuspocus configuration instead.')\n }\n }\n\n async onLoadDocument(data: onLoadDocumentPayload) {\n if (this.configuration.onLoadDocument) {\n this.log(`Loaded document \"${data.documentName}\".`)\n }\n }\n\n async onChange(data: onChangePayload) {\n if (this.configuration.onChange) {\n this.log(`Document \"${data.documentName}\" changed.`)\n }\n }\n\n async onStoreDocument(data: onDisconnectPayload) {\n if (this.configuration.onStoreDocument) {\n this.log(`Store \"${data.documentName}\".`)\n }\n }\n\n async onConnect(data: onConnectPayload) {\n if (this.configuration.onConnect) {\n this.log(`New connection to \"${data.documentName}\".`)\n }\n }\n\n async onDisconnect(data: onDisconnectPayload) {\n if (this.configuration.onDisconnect) {\n this.log(`Connection to \"${data.documentName}\" closed.`)\n }\n }\n\n async onUpgrade(data: onUpgradePayload) {\n if (this.configuration.onUpgrade) {\n this.log('Upgrading connection …')\n }\n }\n\n async onRequest(data: onRequestPayload) {\n if (this.configuration.onRequest) {\n this.log(`Incoming HTTP Request to ${data.request.url}`)\n }\n }\n\n async onDestroy(data: onDestroyPayload) {\n if (this.configuration.onDestroy) {\n this.log('Shut down.')\n }\n }\n\n private log(message: string) {\n const date = (new Date()).toISOString()\n let meta = `${date}`\n\n if (this.name) {\n meta = `${this.name} ${meta}`\n }\n\n message = `[${meta}] ${message}`\n\n this.configuration.log(message)\n }\n}\n"],"names":[],"mappings":"MA6Da,MAAM,CAAA;AAiBjB;;AAEG;AACH,IAAA,WAAA,CAAY,aAA4C,EAAA;QAnBxD,IAAI,CAAA,IAAA,GAAkB,IAAI
|
|
1
|
+
{"version":3,"file":"hocuspocus-logger.esm.js","sources":["../src/Logger.ts"],"sourcesContent":["import type {\n Extension,\n onChangePayload,\n onConfigurePayload,\n onConnectPayload,\n onLoadDocumentPayload,\n onDestroyPayload,\n onDisconnectPayload,\n onRequestPayload,\n onUpgradePayload,\n} from '@hocuspocus/server'\n\nexport interface LoggerConfiguration {\n /**\n * Prepend all logging message with a string.\n *\n * @deprecated\n */\n prefix: null | string,\n /**\n * Whether to log something for the `onLoadDocument` hook.\n */\n onLoadDocument: boolean,\n /**\n * Whether to log something for the `onChange` hook.\n */\n onChange: boolean,\n /**\n * Whether to log something for the `onStoreDocument` hook.\n */\n onStoreDocument: boolean,\n /**\n * Whether to log something for the `onConnect` hook.\n */\n onConnect: boolean,\n /**\n * Whether to log something for the `onDisconnect` hook.\n */\n onDisconnect: boolean,\n /**\n * Whether to log something for the `onUpgrade` hook.\n */\n onUpgrade: boolean,\n /**\n * Whether to log something for the `onRequest` hook.\n */\n onRequest: boolean,\n /**\n * Whether to log something for the `onDestroy` hook.\n */\n onDestroy: boolean,\n /**\n * Whether to log something for the `onConfigure` hook.\n */\n onConfigure: boolean,\n /**\n * A log function, if none is provided output will go to console\n */\n log: (...args: any[]) => void,\n}\n\nexport class Logger implements Extension {\n name: string | null = null\n\n configuration: LoggerConfiguration = {\n prefix: null,\n onLoadDocument: true,\n onChange: true,\n onStoreDocument: true,\n onConnect: true,\n onDisconnect: true,\n onUpgrade: true,\n onRequest: true,\n onDestroy: true,\n onConfigure: true,\n log: console.log, // eslint-disable-line\n }\n\n /**\n * Constructor\n */\n constructor(configuration?: Partial<LoggerConfiguration>) {\n this.configuration = {\n ...this.configuration,\n ...configuration,\n }\n }\n\n async onConfigure(data: onConfigurePayload) {\n this.name = data.instance.configuration.name\n\n if (!this.configuration.onConfigure) {\n return\n }\n\n if (this.configuration.prefix) {\n console.warn('[hocuspocus warn] The Logger \\'prefix\\' is deprecated. Pass a \\'name\\' to the Hocuspocus configuration instead.')\n }\n }\n\n async onLoadDocument(data: onLoadDocumentPayload) {\n if (this.configuration.onLoadDocument) {\n this.log(`Loaded document \"${data.documentName}\".`)\n }\n }\n\n async onChange(data: onChangePayload) {\n if (this.configuration.onChange) {\n this.log(`Document \"${data.documentName}\" changed.`)\n }\n }\n\n async onStoreDocument(data: onDisconnectPayload) {\n if (this.configuration.onStoreDocument) {\n this.log(`Store \"${data.documentName}\".`)\n }\n }\n\n async onConnect(data: onConnectPayload) {\n if (this.configuration.onConnect) {\n this.log(`New connection to \"${data.documentName}\".`)\n }\n }\n\n async onDisconnect(data: onDisconnectPayload) {\n if (this.configuration.onDisconnect) {\n this.log(`Connection to \"${data.documentName}\" closed.`)\n }\n }\n\n async onUpgrade(data: onUpgradePayload) {\n if (this.configuration.onUpgrade) {\n this.log('Upgrading connection …')\n }\n }\n\n async onRequest(data: onRequestPayload) {\n if (this.configuration.onRequest) {\n this.log(`Incoming HTTP Request to ${data.request.url}`)\n }\n }\n\n async onDestroy(data: onDestroyPayload) {\n if (this.configuration.onDestroy) {\n this.log('Shut down.')\n }\n }\n\n private log(message: string) {\n const date = (new Date()).toISOString()\n let meta = `${date}`\n\n if (this.name) {\n meta = `${this.name} ${meta}`\n }\n\n message = `[${meta}] ${message}`\n\n this.configuration.log(message)\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -2,5 +2,5 @@ import * as encoding from 'lib0/encoding';
|
|
|
2
2
|
import * as decoding from 'lib0/decoding';
|
|
3
3
|
export declare const writeAuthentication: (encoder: encoding.Encoder, auth: string) => void;
|
|
4
4
|
export declare const writePermissionDenied: (encoder: encoding.Encoder, reason: string) => void;
|
|
5
|
-
export declare const writeAuthenticated: (encoder: encoding.Encoder, scope:
|
|
5
|
+
export declare const writeAuthenticated: (encoder: encoding.Encoder, scope: 'readonly' | 'read-write') => void;
|
|
6
6
|
export declare const readAuthMessage: (decoder: decoding.Decoder, permissionDeniedHandler: (reason: string) => void, authenticatedHandler: (scope: string) => void) => void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
1
3
|
import type { ClusterNode, ClusterOptions, RedisOptions } from 'ioredis';
|
|
2
4
|
import RedisClient from 'ioredis';
|
|
3
5
|
import Redlock from 'redlock';
|
|
4
6
|
import type { Extension, afterLoadDocumentPayload, afterStoreDocumentPayload, onDisconnectPayload, onStoreDocumentPayload, onAwarenessUpdatePayload, onChangePayload, onConfigurePayload, beforeBroadcastStatelessPayload, Hocuspocus } from '@hocuspocus/server';
|
|
5
|
-
import { Debugger } from '@hocuspocus/server';
|
|
6
7
|
export type RedisInstance = RedisClient.Cluster | RedisClient.Redis;
|
|
7
8
|
export interface Configuration {
|
|
8
9
|
/**
|
|
@@ -64,8 +65,13 @@ export declare class Redis implements Extension {
|
|
|
64
65
|
instance: Hocuspocus;
|
|
65
66
|
redlock: Redlock;
|
|
66
67
|
locks: Map<string, Redlock.Lock>;
|
|
67
|
-
logger: Debugger;
|
|
68
68
|
messagePrefix: Buffer;
|
|
69
|
+
/**
|
|
70
|
+
* When we have a high frequency of updates to a document we don't need tons of setTimeouts
|
|
71
|
+
* piling up, so we'll track them to keep it to the most recent per document.
|
|
72
|
+
*/
|
|
73
|
+
private pendingDisconnects;
|
|
74
|
+
private pendingAfterStoreDocumentResolves;
|
|
69
75
|
constructor(configuration: Partial<Configuration>);
|
|
70
76
|
onConfigure({ instance }: onConfigurePayload): Promise<void>;
|
|
71
77
|
private getKey;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { CloseEvent, Event, MessageEvent } from 'ws';
|
|
1
|
+
import type { Event, MessageEvent } from 'ws';
|
|
3
2
|
import { Awareness } from 'y-protocols/awareness';
|
|
4
3
|
import * as Y from 'yjs';
|
|
5
4
|
import EventEmitter from './EventEmitter.js';
|
|
6
5
|
import type { CompleteHocuspocusProviderWebsocketConfiguration } from './HocuspocusProviderWebsocket.js';
|
|
7
6
|
import { HocuspocusProviderWebsocket } from './HocuspocusProviderWebsocket.js';
|
|
8
|
-
import type { ConstructableOutgoingMessage, onAuthenticationFailedParameters, onAwarenessChangeParameters, onAwarenessUpdateParameters, onCloseParameters, onDisconnectParameters, onMessageParameters, onOpenParameters, onOutgoingMessageParameters, onStatelessParameters,
|
|
7
|
+
import type { ConstructableOutgoingMessage, onAuthenticationFailedParameters, onAwarenessChangeParameters, onAwarenessUpdateParameters, onCloseParameters, onDisconnectParameters, onMessageParameters, onOpenParameters, onOutgoingMessageParameters, onStatelessParameters, onSyncedParameters } from './types.js';
|
|
9
8
|
export type HocuspocusProviderConfiguration = Required<Pick<CompleteHocuspocusProviderConfiguration, 'name'>> & Partial<CompleteHocuspocusProviderConfiguration> & (Required<Pick<CompleteHocuspocusProviderWebsocketConfiguration, 'url'>> | Required<Pick<CompleteHocuspocusProviderConfiguration, 'websocketProvider'>>);
|
|
10
9
|
export interface CompleteHocuspocusProviderConfiguration {
|
|
11
10
|
/**
|
|
@@ -16,10 +15,6 @@ export interface CompleteHocuspocusProviderConfiguration {
|
|
|
16
15
|
* The actual Y.js document
|
|
17
16
|
*/
|
|
18
17
|
document: Y.Doc;
|
|
19
|
-
/**
|
|
20
|
-
* Pass false to disable broadcasting between browser tabs.
|
|
21
|
-
*/
|
|
22
|
-
broadcast: boolean;
|
|
23
18
|
/**
|
|
24
19
|
* An Awareness instance to keep the presence state of all clients.
|
|
25
20
|
*
|
|
@@ -33,12 +28,6 @@ export interface CompleteHocuspocusProviderConfiguration {
|
|
|
33
28
|
* A token that’s sent to the backend for authentication purposes.
|
|
34
29
|
*/
|
|
35
30
|
token: string | (() => string) | (() => Promise<string>) | null;
|
|
36
|
-
/**
|
|
37
|
-
* URL parameters that should be added.
|
|
38
|
-
*/
|
|
39
|
-
parameters: {
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
};
|
|
42
31
|
/**
|
|
43
32
|
* Hocuspocus websocket provider
|
|
44
33
|
*/
|
|
@@ -53,7 +42,6 @@ export interface CompleteHocuspocusProviderConfiguration {
|
|
|
53
42
|
onConnect: () => void;
|
|
54
43
|
onMessage: (data: onMessageParameters) => void;
|
|
55
44
|
onOutgoingMessage: (data: onOutgoingMessageParameters) => void;
|
|
56
|
-
onStatus: (data: onStatusParameters) => void;
|
|
57
45
|
onSynced: (data: onSyncedParameters) => void;
|
|
58
46
|
onDisconnect: (data: onDisconnectParameters) => void;
|
|
59
47
|
onClose: (data: onCloseParameters) => void;
|
|
@@ -61,37 +49,26 @@ export interface CompleteHocuspocusProviderConfiguration {
|
|
|
61
49
|
onAwarenessUpdate: (data: onAwarenessUpdateParameters) => void;
|
|
62
50
|
onAwarenessChange: (data: onAwarenessChangeParameters) => void;
|
|
63
51
|
onStateless: (data: onStatelessParameters) => void;
|
|
64
|
-
/**
|
|
65
|
-
* Don’t output any warnings.
|
|
66
|
-
*/
|
|
67
|
-
quiet: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Pass `false` to start the connection manually.
|
|
70
|
-
*/
|
|
71
|
-
connect: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Pass `false` to close the connection manually.
|
|
74
|
-
*/
|
|
75
|
-
preserveConnection: boolean;
|
|
76
52
|
}
|
|
77
53
|
export declare class AwarenessError extends Error {
|
|
78
54
|
code: number;
|
|
79
55
|
}
|
|
80
56
|
export declare class HocuspocusProvider extends EventEmitter {
|
|
81
57
|
configuration: CompleteHocuspocusProviderConfiguration;
|
|
82
|
-
subscribedToBroadcastChannel: boolean;
|
|
83
58
|
isSynced: boolean;
|
|
84
59
|
unsyncedChanges: number;
|
|
85
60
|
isAuthenticated: boolean;
|
|
86
61
|
authorizedScope: string | undefined;
|
|
87
|
-
|
|
62
|
+
manageSocket: boolean;
|
|
63
|
+
private isAttached;
|
|
88
64
|
intervals: any;
|
|
89
65
|
constructor(configuration: HocuspocusProviderConfiguration);
|
|
66
|
+
boundDocumentUpdateHandler: (update: Uint8Array, origin: any) => void;
|
|
67
|
+
boundAwarenessUpdateHandler: ({ added, updated, removed }: any, origin: any) => void;
|
|
90
68
|
boundPageHide: () => void;
|
|
91
69
|
boundOnOpen: (event: Event) => Promise<void>;
|
|
92
|
-
boundOnClose: (
|
|
70
|
+
boundOnClose: () => void;
|
|
93
71
|
forwardConnect: (e: any) => this;
|
|
94
|
-
forwardOpen: (e: any) => this;
|
|
95
72
|
forwardClose: (e: any) => this;
|
|
96
73
|
forwardDisconnect: (e: any) => this;
|
|
97
74
|
forwardDestroy: (e: any) => this;
|
|
@@ -117,16 +94,17 @@ export declare class HocuspocusProvider extends EventEmitter {
|
|
|
117
94
|
get synced(): boolean;
|
|
118
95
|
set synced(state: boolean);
|
|
119
96
|
receiveStateless(payload: string): void;
|
|
120
|
-
get isAuthenticationRequired(): boolean;
|
|
121
97
|
connect(): Promise<void>;
|
|
122
98
|
disconnect(): void;
|
|
123
99
|
onOpen(event: Event): Promise<void>;
|
|
124
100
|
getToken(): Promise<string | null>;
|
|
125
101
|
startSync(): void;
|
|
126
|
-
send(message: ConstructableOutgoingMessage, args: any
|
|
102
|
+
send(message: ConstructableOutgoingMessage, args: any): void;
|
|
127
103
|
onMessage(event: MessageEvent): void;
|
|
128
|
-
onClose(
|
|
104
|
+
onClose(): void;
|
|
129
105
|
destroy(): void;
|
|
106
|
+
detach(): void;
|
|
107
|
+
attach(): void;
|
|
130
108
|
permissionDeniedHandler(reason: string): void;
|
|
131
109
|
authenticatedHandler(scope: string): void;
|
|
132
110
|
setAwarenessField(key: string, value: any): void;
|
|
@@ -72,10 +72,6 @@ export interface CompleteHocuspocusProviderWebsocketConfiguration {
|
|
|
72
72
|
onDestroy: () => void;
|
|
73
73
|
onAwarenessUpdate: (data: onAwarenessUpdateParameters) => void;
|
|
74
74
|
onAwarenessChange: (data: onAwarenessChangeParameters) => void;
|
|
75
|
-
/**
|
|
76
|
-
* Don’t output any warnings.
|
|
77
|
-
*/
|
|
78
|
-
quiet: boolean;
|
|
79
75
|
/**
|
|
80
76
|
* Map of attached providers keyed by documentName.
|
|
81
77
|
*/
|
|
@@ -2,9 +2,7 @@ import type { HocuspocusProvider } from './HocuspocusProvider.js';
|
|
|
2
2
|
import type { IncomingMessage } from './IncomingMessage.js';
|
|
3
3
|
export declare class MessageReceiver {
|
|
4
4
|
message: IncomingMessage;
|
|
5
|
-
broadcasted: boolean;
|
|
6
5
|
constructor(message: IncomingMessage);
|
|
7
|
-
setBroadcasted(value: boolean): this;
|
|
8
6
|
apply(provider: HocuspocusProvider, emitSynced: boolean): void;
|
|
9
7
|
private applySyncMessage;
|
|
10
8
|
applySyncStatusMessage(provider: HocuspocusProvider, applied: boolean): void;
|
|
@@ -88,14 +88,17 @@ export type TCollabThread<Data = any, CommentData = any> = {
|
|
|
88
88
|
id: string;
|
|
89
89
|
createdAt: number;
|
|
90
90
|
updatedAt: number;
|
|
91
|
+
deletedAt: number | null;
|
|
91
92
|
resolvedAt?: string;
|
|
92
93
|
comments: TCollabComment<CommentData>[];
|
|
94
|
+
deletedComments: TCollabComment<CommentData>[];
|
|
93
95
|
data: Data;
|
|
94
96
|
};
|
|
95
97
|
export type TCollabComment<Data = any> = {
|
|
96
98
|
id: string;
|
|
97
|
-
createdAt:
|
|
98
|
-
updatedAt:
|
|
99
|
+
createdAt: string;
|
|
100
|
+
updatedAt: string;
|
|
101
|
+
deletedAt?: string;
|
|
99
102
|
data: Data;
|
|
100
103
|
content: any;
|
|
101
104
|
};
|
|
@@ -144,3 +147,40 @@ export type THistoryDocumentRevertedEvent = {
|
|
|
144
147
|
event: 'document.reverted';
|
|
145
148
|
version: number;
|
|
146
149
|
};
|
|
150
|
+
export type DeleteCommentOptions = {
|
|
151
|
+
/**
|
|
152
|
+
* If `true`, the thread will also be deleted if the deleted comment was the first comment in the thread.
|
|
153
|
+
*/
|
|
154
|
+
deleteThread?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* If `true`, will remove the content of the deleted comment
|
|
157
|
+
*/
|
|
158
|
+
deleteContent?: boolean;
|
|
159
|
+
};
|
|
160
|
+
export type DeleteThreadOptions = {
|
|
161
|
+
/**
|
|
162
|
+
* If `true`, will remove the comments on the thread,
|
|
163
|
+
* otherwise will only mark the thread as deleted
|
|
164
|
+
* and keep the comments
|
|
165
|
+
* @default false
|
|
166
|
+
*/
|
|
167
|
+
deleteComments?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* If `true`, will forcefully remove the thread and all comments,
|
|
170
|
+
* otherwise will only mark the thread as deleted
|
|
171
|
+
* and keep the comments
|
|
172
|
+
* @default false
|
|
173
|
+
*/
|
|
174
|
+
force?: boolean;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* The type of thread
|
|
178
|
+
*/
|
|
179
|
+
export type ThreadType = 'archived' | 'unarchived';
|
|
180
|
+
export type GetThreadsOptions = {
|
|
181
|
+
/**
|
|
182
|
+
* The types of threads to get
|
|
183
|
+
* @default ['unarchived']
|
|
184
|
+
*/
|
|
185
|
+
types?: Array<ThreadType>;
|
|
186
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
1
3
|
import type { IncomingMessage } from 'http';
|
|
4
|
+
import { type CloseEvent } from '@hocuspocus/common';
|
|
2
5
|
import type WebSocket from 'ws';
|
|
3
|
-
import type { Debugger } from './Debugger.js';
|
|
4
6
|
import type Document from './Document.js';
|
|
5
7
|
import type { Hocuspocus } from './Hocuspocus.js';
|
|
6
8
|
import type { onDisconnectPayload } from './types.js';
|
|
@@ -15,7 +17,6 @@ export declare class ClientConnection {
|
|
|
15
17
|
private readonly request;
|
|
16
18
|
private readonly documentProvider;
|
|
17
19
|
private readonly hooks;
|
|
18
|
-
private readonly debuggerTool;
|
|
19
20
|
private readonly opts;
|
|
20
21
|
private readonly defaultContext;
|
|
21
22
|
private readonly documentConnections;
|
|
@@ -23,8 +24,10 @@ export declare class ClientConnection {
|
|
|
23
24
|
private readonly documentConnectionsEstablished;
|
|
24
25
|
private readonly hookPayloads;
|
|
25
26
|
private readonly callbacks;
|
|
26
|
-
private readonly closeIdleConnectionTimeout;
|
|
27
27
|
private readonly socketId;
|
|
28
|
+
timeout: number;
|
|
29
|
+
pingInterval: NodeJS.Timeout;
|
|
30
|
+
pongReceived: boolean;
|
|
28
31
|
/**
|
|
29
32
|
* The `ClientConnection` class receives incoming WebSocket connections,
|
|
30
33
|
* runs all hooks:
|
|
@@ -37,10 +40,17 @@ export declare class ClientConnection {
|
|
|
37
40
|
*/
|
|
38
41
|
constructor(websocket: WebSocket, request: IncomingMessage, documentProvider: {
|
|
39
42
|
createDocument: Hocuspocus['createDocument'];
|
|
40
|
-
}, hooks: Hocuspocus['hooks'],
|
|
41
|
-
requiresAuthentication: boolean;
|
|
43
|
+
}, hooks: Hocuspocus['hooks'], opts: {
|
|
42
44
|
timeout: number;
|
|
43
45
|
}, defaultContext?: any);
|
|
46
|
+
private handleWebsocketClose;
|
|
47
|
+
close(event?: CloseEvent): void;
|
|
48
|
+
handlePong: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Check if pong was received and close the connection otherwise
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
53
|
+
private check;
|
|
44
54
|
/**
|
|
45
55
|
* Set a callback that will be triggered when the connection is closed
|
|
46
56
|
*/
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import type { IncomingMessage as HTTPIncomingMessage } from 'http';
|
|
2
|
-
import AsyncLock from 'async-lock';
|
|
3
3
|
import type WebSocket from 'ws';
|
|
4
|
-
import type
|
|
4
|
+
import { type CloseEvent } from '@hocuspocus/common';
|
|
5
5
|
import type Document from './Document.js';
|
|
6
|
-
import type { Debugger } from './Debugger.js';
|
|
7
6
|
import type { onStatelessPayload } from './types.js';
|
|
8
7
|
export declare class Connection {
|
|
9
8
|
webSocket: WebSocket;
|
|
10
9
|
context: any;
|
|
11
10
|
document: Document;
|
|
12
|
-
pingInterval: NodeJS.Timeout;
|
|
13
|
-
pongReceived: boolean;
|
|
14
11
|
request: HTTPIncomingMessage;
|
|
15
|
-
timeout: number;
|
|
16
12
|
callbacks: any;
|
|
17
13
|
socketId: string;
|
|
18
|
-
lock: AsyncLock;
|
|
19
14
|
readOnly: boolean;
|
|
20
|
-
logger: Debugger;
|
|
21
15
|
/**
|
|
22
16
|
* Constructor.
|
|
23
17
|
*/
|
|
24
|
-
constructor(connection: WebSocket, request: HTTPIncomingMessage, document: Document,
|
|
25
|
-
boundClose: (event?: CloseEvent) => void;
|
|
26
|
-
boundHandlePong: () => void;
|
|
27
|
-
handlePong(): void;
|
|
18
|
+
constructor(connection: WebSocket, request: HTTPIncomingMessage, document: Document, socketId: string, context: any, readOnly?: boolean);
|
|
28
19
|
/**
|
|
29
20
|
* Set a callback that will be triggered when the connection is closed
|
|
30
21
|
*/
|
|
@@ -49,11 +40,6 @@ export declare class Connection {
|
|
|
49
40
|
* Graceful wrapper around the WebSocket close method.
|
|
50
41
|
*/
|
|
51
42
|
close(event?: CloseEvent): void;
|
|
52
|
-
/**
|
|
53
|
-
* Check if pong was received and close the connection otherwise
|
|
54
|
-
* @private
|
|
55
|
-
*/
|
|
56
|
-
private check;
|
|
57
43
|
/**
|
|
58
44
|
* Send the current document awareness to the client, if any
|
|
59
45
|
* @private
|
|
@@ -9,6 +9,6 @@ export declare class DirectConnection implements DirectConnectionInterface {
|
|
|
9
9
|
* Constructor.
|
|
10
10
|
*/
|
|
11
11
|
constructor(document: Document, instance: Hocuspocus, context?: any);
|
|
12
|
-
transact(transaction: (document: Document) => void
|
|
12
|
+
transact(transaction: (document: Document) => void): Promise<void>;
|
|
13
13
|
disconnect(): Promise<void>;
|
|
14
14
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type WebSocket from 'ws';
|
|
2
2
|
import { Awareness } from 'y-protocols/awareness';
|
|
3
3
|
import { Doc } from 'yjs';
|
|
4
|
-
import type { mutex } from 'lib0/mutex.js';
|
|
5
4
|
import type Connection from './Connection.js';
|
|
6
|
-
import type { Debugger } from './Debugger.js';
|
|
7
5
|
export declare class Document extends Doc {
|
|
8
6
|
awareness: Awareness;
|
|
9
7
|
callbacks: {
|
|
@@ -16,14 +14,12 @@ export declare class Document extends Doc {
|
|
|
16
14
|
}>;
|
|
17
15
|
directConnectionsCount: number;
|
|
18
16
|
name: string;
|
|
19
|
-
mux: mutex;
|
|
20
|
-
logger?: Debugger;
|
|
21
17
|
isLoading: boolean;
|
|
22
18
|
isDestroyed: boolean;
|
|
23
19
|
/**
|
|
24
20
|
* Constructor.
|
|
25
21
|
*/
|
|
26
|
-
constructor(name: string,
|
|
22
|
+
constructor(name: string, yDocOptions?: object);
|
|
27
23
|
/**
|
|
28
24
|
* Check if the Document (XMLFragment or Map) is empty
|
|
29
25
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import type { IncomingMessage } from 'http';
|
|
2
3
|
import type WebSocket from 'ws';
|
|
3
4
|
import type { Server } from './Server.js';
|
|
4
|
-
import { Debugger } from './Debugger.js';
|
|
5
5
|
import { DirectConnection } from './DirectConnection.js';
|
|
6
6
|
import Document from './Document.js';
|
|
7
7
|
import type { Configuration, ConnectionConfiguration, HookName, HookPayloadByName, onStoreDocumentPayload } from './types.js';
|
|
@@ -22,7 +22,6 @@ export declare class Hocuspocus {
|
|
|
22
22
|
loadingDocuments: Map<string, Promise<Document>>;
|
|
23
23
|
documents: Map<string, Document>;
|
|
24
24
|
server?: Server;
|
|
25
|
-
debugger: Debugger;
|
|
26
25
|
debouncer: {
|
|
27
26
|
debounce: (id: string, func: Function, debounce: number, maxDebounce: number) => any;
|
|
28
27
|
isDebounced: (id: string) => boolean;
|
|
@@ -33,7 +32,6 @@ export declare class Hocuspocus {
|
|
|
33
32
|
* Configure Hocuspocus
|
|
34
33
|
*/
|
|
35
34
|
configure(configuration: Partial<Configuration>): Hocuspocus;
|
|
36
|
-
get requiresAuthentication(): boolean;
|
|
37
35
|
/**
|
|
38
36
|
* Get the total number of active documents
|
|
39
37
|
*/
|
|
@@ -68,19 +66,13 @@ export declare class Hocuspocus {
|
|
|
68
66
|
* Create a new document by the given request
|
|
69
67
|
*/
|
|
70
68
|
createDocument(documentName: string, request: Partial<Pick<IncomingMessage, 'headers' | 'url'>>, socketId: string, connection: ConnectionConfiguration, context?: any): Promise<Document>;
|
|
71
|
-
loadDocument(documentName: string, request: Partial<Pick<IncomingMessage, 'headers' | 'url'>>, socketId: string,
|
|
69
|
+
loadDocument(documentName: string, request: Partial<Pick<IncomingMessage, 'headers' | 'url'>>, socketId: string, connectionConfig: ConnectionConfiguration, context?: any): Promise<Document>;
|
|
72
70
|
storeDocumentHooks(document: Document, hookPayload: onStoreDocumentPayload, immediately?: boolean): any;
|
|
73
71
|
/**
|
|
74
72
|
* Run the given hook on all configured extensions.
|
|
75
73
|
* Runs the given callback after each hook.
|
|
76
74
|
*/
|
|
77
75
|
hooks<T extends HookName>(name: T, payload: HookPayloadByName[T], callback?: Function | null): Promise<any>;
|
|
78
|
-
unloadDocument(document: Document):
|
|
79
|
-
enableDebugging(): void;
|
|
80
|
-
enableMessageLogging(): void;
|
|
81
|
-
disableLogging(): void;
|
|
82
|
-
disableDebugging(): void;
|
|
83
|
-
flushMessageLogs(): this;
|
|
84
|
-
getMessageLogs(): any[];
|
|
76
|
+
unloadDocument(document: Document): Promise<any>;
|
|
85
77
|
openDirectConnection(documentName: string, context?: any): Promise<DirectConnection>;
|
|
86
78
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type Connection from './Connection.js';
|
|
2
|
-
import type { Debugger } from './Debugger.js';
|
|
3
2
|
import type Document from './Document.js';
|
|
4
3
|
import type { IncomingMessage } from './IncomingMessage.js';
|
|
5
4
|
export declare class MessageReceiver {
|
|
6
5
|
message: IncomingMessage;
|
|
7
|
-
logger: Debugger;
|
|
8
6
|
defaultTransactionOrigin?: string;
|
|
9
|
-
constructor(message: IncomingMessage,
|
|
7
|
+
constructor(message: IncomingMessage, defaultTransactionOrigin?: string);
|
|
10
8
|
apply(document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): void;
|
|
11
9
|
readSyncMessage(message: IncomingMessage, document: Document, connection?: Connection, reply?: (message: Uint8Array) => void, requestFirstSync?: boolean): 0 | 1 | 2;
|
|
12
10
|
applyQueryAwarenessMessage(document: Document, reply?: (message: Uint8Array) => void): void;
|
|
@@ -17,5 +17,6 @@ export declare class OutgoingMessage {
|
|
|
17
17
|
writeStateless(payload: string): OutgoingMessage;
|
|
18
18
|
writeBroadcastStateless(payload: string): OutgoingMessage;
|
|
19
19
|
writeSyncStatus(updateSaved: boolean): OutgoingMessage;
|
|
20
|
+
writeCloseMessage(reason: string): OutgoingMessage;
|
|
20
21
|
toUint8Array(): Uint8Array;
|
|
21
22
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import type { IncomingMessage, Server as HTTPServer, ServerResponse } from 'http';
|
|
2
|
-
import type { AddressInfo } from 'ws';
|
|
3
3
|
import { WebSocketServer } from 'ws';
|
|
4
|
+
import type { AddressInfo, ServerOptions } from 'ws';
|
|
4
5
|
import { Hocuspocus } from './Hocuspocus.js';
|
|
5
6
|
import type { Configuration } from './types';
|
|
6
7
|
export interface ServerConfiguration extends Configuration {
|
|
@@ -18,7 +19,7 @@ export declare class Server {
|
|
|
18
19
|
webSocketServer: WebSocketServer;
|
|
19
20
|
hocuspocus: Hocuspocus;
|
|
20
21
|
configuration: ServerConfiguration;
|
|
21
|
-
constructor(configuration?: Partial<ServerConfiguration
|
|
22
|
+
constructor(configuration?: Partial<ServerConfiguration>, websocketOptions?: ServerOptions);
|
|
22
23
|
setupWebsocketConnection: () => void;
|
|
23
24
|
setupHttpUpgrade: () => void;
|
|
24
25
|
requestHandler: (request: IncomingMessage, response: ServerResponse) => Promise<void>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
1
5
|
import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'http';
|
|
2
6
|
import type { URLSearchParams } from 'url';
|
|
3
7
|
import type { Awareness } from 'y-protocols/awareness';
|
|
@@ -10,7 +14,7 @@ export declare enum MessageType {
|
|
|
10
14
|
Awareness = 1,
|
|
11
15
|
Auth = 2,
|
|
12
16
|
QueryAwareness = 3,
|
|
13
|
-
SyncReply = 4
|
|
17
|
+
SyncReply = 4,
|
|
14
18
|
Stateless = 5,
|
|
15
19
|
BroadcastStateless = 6,
|
|
16
20
|
CLOSE = 7,
|
|
@@ -23,7 +27,6 @@ export interface AwarenessUpdate {
|
|
|
23
27
|
}
|
|
24
28
|
export interface ConnectionConfiguration {
|
|
25
29
|
readOnly: boolean;
|
|
26
|
-
requiresAuthentication: boolean;
|
|
27
30
|
isAuthenticated: boolean;
|
|
28
31
|
}
|
|
29
32
|
export interface Extension {
|
|
@@ -47,10 +50,11 @@ export interface Extension {
|
|
|
47
50
|
onAwarenessUpdate?(data: onAwarenessUpdatePayload): Promise<any>;
|
|
48
51
|
onRequest?(data: onRequestPayload): Promise<any>;
|
|
49
52
|
onDisconnect?(data: onDisconnectPayload): Promise<any>;
|
|
53
|
+
beforeUnloadDocument?(data: beforeUnloadDocumentPayload): Promise<any>;
|
|
50
54
|
afterUnloadDocument?(data: afterUnloadDocumentPayload): Promise<any>;
|
|
51
55
|
onDestroy?(data: onDestroyPayload): Promise<any>;
|
|
52
56
|
}
|
|
53
|
-
export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'afterUnloadDocument' | 'onDestroy';
|
|
57
|
+
export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'beforeUnloadDocument' | 'afterUnloadDocument' | 'onDestroy';
|
|
54
58
|
export type HookPayloadByName = {
|
|
55
59
|
onConfigure: onConfigurePayload;
|
|
56
60
|
onListen: onListenPayload;
|
|
@@ -71,6 +75,7 @@ export type HookPayloadByName = {
|
|
|
71
75
|
onRequest: onRequestPayload;
|
|
72
76
|
onDisconnect: onDisconnectPayload;
|
|
73
77
|
afterUnloadDocument: afterUnloadDocumentPayload;
|
|
78
|
+
beforeUnloadDocument: beforeUnloadDocumentPayload;
|
|
74
79
|
onDestroy: onDestroyPayload;
|
|
75
80
|
};
|
|
76
81
|
export interface Configuration extends Extension {
|
|
@@ -130,7 +135,7 @@ export interface onAuthenticatePayload {
|
|
|
130
135
|
request: IncomingMessage;
|
|
131
136
|
socketId: string;
|
|
132
137
|
token: string;
|
|
133
|
-
|
|
138
|
+
connectionConfig: ConnectionConfiguration;
|
|
134
139
|
}
|
|
135
140
|
export interface onCreateDocumentPayload {
|
|
136
141
|
context: any;
|
|
@@ -139,7 +144,7 @@ export interface onCreateDocumentPayload {
|
|
|
139
144
|
requestHeaders: IncomingHttpHeaders;
|
|
140
145
|
requestParameters: URLSearchParams;
|
|
141
146
|
socketId: string;
|
|
142
|
-
|
|
147
|
+
connectionConfig: ConnectionConfiguration;
|
|
143
148
|
}
|
|
144
149
|
export interface onConnectPayload {
|
|
145
150
|
context: any;
|
|
@@ -149,7 +154,7 @@ export interface onConnectPayload {
|
|
|
149
154
|
requestHeaders: IncomingHttpHeaders;
|
|
150
155
|
requestParameters: URLSearchParams;
|
|
151
156
|
socketId: string;
|
|
152
|
-
|
|
157
|
+
connectionConfig: ConnectionConfiguration;
|
|
153
158
|
}
|
|
154
159
|
export interface connectedPayload {
|
|
155
160
|
context: any;
|
|
@@ -159,8 +164,8 @@ export interface connectedPayload {
|
|
|
159
164
|
requestHeaders: IncomingHttpHeaders;
|
|
160
165
|
requestParameters: URLSearchParams;
|
|
161
166
|
socketId: string;
|
|
162
|
-
|
|
163
|
-
|
|
167
|
+
connectionConfig: ConnectionConfiguration;
|
|
168
|
+
connection: Connection;
|
|
164
169
|
}
|
|
165
170
|
export interface onLoadDocumentPayload {
|
|
166
171
|
context: any;
|
|
@@ -170,7 +175,7 @@ export interface onLoadDocumentPayload {
|
|
|
170
175
|
requestHeaders: IncomingHttpHeaders;
|
|
171
176
|
requestParameters: URLSearchParams;
|
|
172
177
|
socketId: string;
|
|
173
|
-
|
|
178
|
+
connectionConfig: ConnectionConfiguration;
|
|
174
179
|
}
|
|
175
180
|
export interface afterLoadDocumentPayload {
|
|
176
181
|
context: any;
|
|
@@ -180,7 +185,7 @@ export interface afterLoadDocumentPayload {
|
|
|
180
185
|
requestHeaders: IncomingHttpHeaders;
|
|
181
186
|
requestParameters: URLSearchParams;
|
|
182
187
|
socketId: string;
|
|
183
|
-
|
|
188
|
+
connectionConfig: ConnectionConfiguration;
|
|
184
189
|
}
|
|
185
190
|
export interface onChangePayload {
|
|
186
191
|
clientsCount: number;
|
|
@@ -250,7 +255,7 @@ export interface fetchPayload {
|
|
|
250
255
|
requestHeaders: IncomingHttpHeaders;
|
|
251
256
|
requestParameters: URLSearchParams;
|
|
252
257
|
socketId: string;
|
|
253
|
-
|
|
258
|
+
connectionConfig: ConnectionConfiguration;
|
|
254
259
|
}
|
|
255
260
|
export interface storePayload extends onStoreDocumentPayload {
|
|
256
261
|
state: Buffer;
|
|
@@ -293,6 +298,10 @@ export interface afterUnloadDocumentPayload {
|
|
|
293
298
|
instance: Hocuspocus;
|
|
294
299
|
documentName: string;
|
|
295
300
|
}
|
|
301
|
+
export interface beforeUnloadDocumentPayload {
|
|
302
|
+
instance: Hocuspocus;
|
|
303
|
+
documentName: string;
|
|
304
|
+
}
|
|
296
305
|
export interface DirectConnection {
|
|
297
306
|
transact(transaction: (document: Document) => void): Promise<void>;
|
|
298
307
|
disconnect(): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { HocuspocusProvider, type HocuspocusProviderConfiguration, type HocuspocusProviderWebsocketConfiguration } from '@hocuspocus/provider';
|
|
1
|
+
import { HocuspocusProvider, type HocuspocusProviderConfiguration, type HocuspocusProviderWebsocket, type HocuspocusProviderWebsocketConfiguration } from '@hocuspocus/provider';
|
|
2
2
|
import type { Hocuspocus } from '@hocuspocus/server';
|
|
3
|
-
export declare const newHocuspocusProvider: (server: Hocuspocus, options?: Partial<HocuspocusProviderConfiguration>, websocketOptions?: Partial<HocuspocusProviderWebsocketConfiguration
|
|
3
|
+
export declare const newHocuspocusProvider: (server: Hocuspocus, options?: Partial<HocuspocusProviderConfiguration>, websocketOptions?: Partial<HocuspocusProviderWebsocketConfiguration>, websocketProvider?: HocuspocusProviderWebsocket) => HocuspocusProvider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { HocuspocusProviderWebsocketConfiguration } from '@hocuspocus/provider';
|
|
2
2
|
import { HocuspocusProviderWebsocket } from '@hocuspocus/provider';
|
|
3
3
|
import type { Hocuspocus } from '@hocuspocus/server';
|
|
4
|
-
export declare const newHocuspocusProviderWebsocket: (hocuspocus: Hocuspocus, options?: Partial<Omit<HocuspocusProviderWebsocketConfiguration,
|
|
4
|
+
export declare const newHocuspocusProviderWebsocket: (hocuspocus: Hocuspocus, options?: Partial<Omit<HocuspocusProviderWebsocketConfiguration, 'url'>>) => HocuspocusProviderWebsocket;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/extension-logger",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4-rc.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.0.
|
|
32
|
+
"@hocuspocus/server": "^3.0.4-rc.0"
|
|
33
33
|
},
|
|
34
34
|
"gitHead": "b3454a4ca289a84ddfb7fa5607a2d4b8d5c37e9d"
|
|
35
35
|
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { AbstractType, YArrayEvent } from 'yjs';
|
|
2
|
-
import * as Y from 'yjs';
|
|
3
|
-
import type { HocuspocusProviderConfiguration } from './HocuspocusProvider.js';
|
|
4
|
-
import { HocuspocusProvider } from './HocuspocusProvider.js';
|
|
5
|
-
import { TiptapCollabProviderWebsocket } from './TiptapCollabProviderWebsocket.js';
|
|
6
|
-
import type { TCollabComment, TCollabThread, THistoryVersion } from './types.js';
|
|
7
|
-
export type TiptapCollabProviderConfiguration = Required<Pick<HocuspocusProviderConfiguration, 'name'>> & Partial<HocuspocusProviderConfiguration> & (Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'websocketProvider'>> | Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'appId'>> | Required<Pick<AdditionalTiptapCollabProviderConfiguration, 'baseUrl'>>) & Pick<AdditionalTiptapCollabProviderConfiguration, 'user'>;
|
|
8
|
-
export interface AdditionalTiptapCollabProviderConfiguration {
|
|
9
|
-
/**
|
|
10
|
-
* A Hocuspocus Cloud App ID, get one here: https://cloud.tiptap.dev
|
|
11
|
-
*/
|
|
12
|
-
appId?: string;
|
|
13
|
-
/**
|
|
14
|
-
* If you are using the on-premise version of TiptapCollab, put your baseUrl here (e.g. https://collab.yourdomain.com)
|
|
15
|
-
*/
|
|
16
|
-
baseUrl?: string;
|
|
17
|
-
websocketProvider?: TiptapCollabProviderWebsocket;
|
|
18
|
-
user?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare class TiptapCollabProvider extends HocuspocusProvider {
|
|
21
|
-
tiptapCollabConfigurationPrefix: string;
|
|
22
|
-
userData?: Y.PermanentUserData;
|
|
23
|
-
constructor(configuration: TiptapCollabProviderConfiguration);
|
|
24
|
-
/**
|
|
25
|
-
* note: this will only work if your server loaded @hocuspocus-pro/extension-history, or if you are on a Tiptap business plan.
|
|
26
|
-
*/
|
|
27
|
-
createVersion(name?: string): void;
|
|
28
|
-
/**
|
|
29
|
-
* note: this will only work if your server loaded @hocuspocus-pro/extension-history, or if you are on a Tiptap business plan.
|
|
30
|
-
*/
|
|
31
|
-
revertToVersion(targetVersion: number): void;
|
|
32
|
-
/**
|
|
33
|
-
* note: this will only work if your server loaded @hocuspocus-pro/extension-history, or if you are on a Tiptap business plan.
|
|
34
|
-
*
|
|
35
|
-
* The server will reply with a stateless message (THistoryVersionPreviewEvent)
|
|
36
|
-
*/
|
|
37
|
-
previewVersion(targetVersion: number): void;
|
|
38
|
-
/**
|
|
39
|
-
* note: this will only work if your server loaded @hocuspocus-pro/extension-history, or if you are on a Tiptap business plan.
|
|
40
|
-
*/
|
|
41
|
-
getVersions(): THistoryVersion[];
|
|
42
|
-
watchVersions(callback: Parameters<AbstractType<YArrayEvent<THistoryVersion>>['observe']>[0]): void;
|
|
43
|
-
unwatchVersions(callback: Parameters<AbstractType<YArrayEvent<THistoryVersion>>['unobserve']>[0]): void;
|
|
44
|
-
isAutoVersioning(): boolean;
|
|
45
|
-
enableAutoVersioning(): 1;
|
|
46
|
-
disableAutoVersioning(): 0;
|
|
47
|
-
private getYThreads;
|
|
48
|
-
getThreads<Data, CommentData>(): TCollabThread<Data, CommentData>[];
|
|
49
|
-
private getThreadIndex;
|
|
50
|
-
getThread<Data, CommentData>(id: string): TCollabThread<Data, CommentData> | null;
|
|
51
|
-
private getYThread;
|
|
52
|
-
createThread(data: Omit<TCollabThread, 'id' | 'createdAt' | 'updatedAt' | 'comments'>): TCollabThread;
|
|
53
|
-
updateThread(id: TCollabThread['id'], data: Partial<Pick<TCollabThread, 'data'> & {
|
|
54
|
-
resolvedAt: TCollabThread['resolvedAt'] | null;
|
|
55
|
-
}>): TCollabThread;
|
|
56
|
-
deleteThread(id: TCollabThread['id']): void;
|
|
57
|
-
getThreadComments(threadId: TCollabThread['id']): TCollabComment[] | null;
|
|
58
|
-
getThreadComment(threadId: TCollabThread['id'], commentId: TCollabComment['id']): TCollabComment | null;
|
|
59
|
-
addComment(threadId: TCollabThread['id'], data: Omit<TCollabComment, 'id' | 'updatedAt' | 'createdAt'>): TCollabThread;
|
|
60
|
-
updateComment(threadId: TCollabThread['id'], commentId: TCollabComment['id'], data: Partial<Pick<TCollabComment, 'data' | 'content'>>): TCollabThread;
|
|
61
|
-
deleteComment(threadId: TCollabThread['id'], commentId: TCollabComment['id']): TCollabThread | null | undefined;
|
|
62
|
-
watchThreads(callback: () => void): void;
|
|
63
|
-
unwatchThreads(callback: () => void): void;
|
|
64
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { CompleteHocuspocusProviderWebsocketConfiguration } from './HocuspocusProviderWebsocket.js';
|
|
2
|
-
import { HocuspocusProviderWebsocket } from './HocuspocusProviderWebsocket.js';
|
|
3
|
-
export type TiptapCollabProviderWebsocketConfiguration = Partial<CompleteHocuspocusProviderWebsocketConfiguration> & AdditionalTiptapCollabProviderWebsocketConfiguration;
|
|
4
|
-
export interface AdditionalTiptapCollabProviderWebsocketConfiguration {
|
|
5
|
-
/**
|
|
6
|
-
* A Hocuspocus Cloud App ID, get one here: https://cloud.tiptap.dev
|
|
7
|
-
*/
|
|
8
|
-
appId?: string;
|
|
9
|
-
/**
|
|
10
|
-
* If you are using the on-premise version of TiptapCollab, put your baseUrl here (e.g. https://collab.yourdomain.com)
|
|
11
|
-
*/
|
|
12
|
-
baseUrl?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Only fill this if you are using Tiptap Collab HA.
|
|
15
|
-
*/
|
|
16
|
-
shardKey?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare class TiptapCollabProviderWebsocket extends HocuspocusProviderWebsocket {
|
|
19
|
-
constructor(configuration: TiptapCollabProviderWebsocketConfiguration);
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|