@hocuspocus/extension-throttle 3.2.3 → 3.2.5
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/packages/extension-redis/src/Redis.d.ts +2 -2
- package/dist/packages/extension-s3/src/S3.d.ts +44 -0
- package/dist/packages/extension-s3/src/index.d.ts +1 -0
- package/dist/packages/extension-webhook/src/index.d.ts +3 -3
- package/dist/packages/provider/src/HocuspocusProvider.d.ts +7 -5
- package/dist/packages/server/src/Document.d.ts +2 -0
- package/dist/playground/backend/src/s3-redis.d.ts +1 -0
- package/dist/playground/backend/src/s3.d.ts +1 -0
- package/dist/tests/extension-s3/fetch.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Extension, Hocuspocus, afterLoadDocumentPayload, afterStoreDocumentPayload, beforeBroadcastStatelessPayload, onAwarenessUpdatePayload, onChangePayload, onConfigurePayload, onDisconnectPayload, onStoreDocumentPayload } from "@hocuspocus/server";
|
|
2
|
-
import {
|
|
2
|
+
import { type ExecutionResult, type Lock, Redlock } from "@sesamecare-oss/redlock";
|
|
3
3
|
import type { Cluster, ClusterNode, ClusterOptions, RedisOptions } from "ioredis";
|
|
4
4
|
import RedisClient from "ioredis";
|
|
5
5
|
export type RedisInstance = RedisClient | Cluster;
|
|
@@ -101,7 +101,7 @@ export declare class Redis implements Extension {
|
|
|
101
101
|
/**
|
|
102
102
|
* Release the Redis lock, so other instances can store documents.
|
|
103
103
|
*/
|
|
104
|
-
afterStoreDocument({ documentName, socketId }: afterStoreDocumentPayload): Promise<void>;
|
|
104
|
+
afterStoreDocument({ documentName, socketId, }: afterStoreDocumentPayload): Promise<void>;
|
|
105
105
|
/**
|
|
106
106
|
* Handle awareness update messages received directly by this Hocuspocus instance.
|
|
107
107
|
*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { DatabaseConfiguration } from "@hocuspocus/extension-database";
|
|
2
|
+
import { Database } from "@hocuspocus/extension-database";
|
|
3
|
+
import { S3Client } from "@aws-sdk/client-s3";
|
|
4
|
+
export interface S3Configuration extends DatabaseConfiguration {
|
|
5
|
+
/**
|
|
6
|
+
* AWS S3 region
|
|
7
|
+
*/
|
|
8
|
+
region?: string;
|
|
9
|
+
/**
|
|
10
|
+
* S3 bucket name
|
|
11
|
+
*/
|
|
12
|
+
bucket: string;
|
|
13
|
+
/**
|
|
14
|
+
* S3 key prefix for documents (optional)
|
|
15
|
+
*/
|
|
16
|
+
prefix?: string;
|
|
17
|
+
/**
|
|
18
|
+
* AWS credentials
|
|
19
|
+
*/
|
|
20
|
+
credentials?: {
|
|
21
|
+
accessKeyId: string;
|
|
22
|
+
secretAccessKey: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* S3 endpoint URL (for S3-compatible services like MinIO)
|
|
26
|
+
*/
|
|
27
|
+
endpoint?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Force path style URLs (required for MinIO)
|
|
30
|
+
*/
|
|
31
|
+
forcePathStyle?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Custom S3 client
|
|
34
|
+
*/
|
|
35
|
+
s3Client?: S3Client;
|
|
36
|
+
}
|
|
37
|
+
export declare class S3 extends Database {
|
|
38
|
+
private s3Client?;
|
|
39
|
+
configuration: S3Configuration;
|
|
40
|
+
constructor(configuration: Partial<S3Configuration>);
|
|
41
|
+
private getObjectKey;
|
|
42
|
+
onConfigure(): Promise<void>;
|
|
43
|
+
onListen(): Promise<void>;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./S3.ts";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Extension, onChangePayload, onConnectPayload,
|
|
2
|
-
import type { Doc } from "yjs";
|
|
1
|
+
import type { Extension, onChangePayload, onConnectPayload, onDisconnectPayload, onLoadDocumentPayload } from "@hocuspocus/server";
|
|
3
2
|
import type { Transformer } from "@hocuspocus/transformer";
|
|
3
|
+
import type { Doc } from "yjs";
|
|
4
4
|
export declare enum Events {
|
|
5
5
|
onChange = "change",
|
|
6
6
|
onConnect = "connect",
|
|
@@ -39,7 +39,7 @@ export declare class Webhook implements Extension {
|
|
|
39
39
|
/**
|
|
40
40
|
* Send a request to the given url containing the given data
|
|
41
41
|
*/
|
|
42
|
-
sendRequest(event: Events, payload: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
42
|
+
sendRequest(event: Events, payload: any): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
43
43
|
/**
|
|
44
44
|
* onChange hook
|
|
45
45
|
*/
|
|
@@ -4,7 +4,7 @@ import * as Y from "yjs";
|
|
|
4
4
|
import EventEmitter from "./EventEmitter.ts";
|
|
5
5
|
import type { CompleteHocuspocusProviderWebsocketConfiguration } from "./HocuspocusProviderWebsocket.ts";
|
|
6
6
|
import { HocuspocusProviderWebsocket } from "./HocuspocusProviderWebsocket.ts";
|
|
7
|
-
import type { ConstructableOutgoingMessage, onAuthenticatedParameters, onAuthenticationFailedParameters, onAwarenessChangeParameters, onAwarenessUpdateParameters, onCloseParameters, onDisconnectParameters, onMessageParameters, onOpenParameters, onOutgoingMessageParameters, onStatelessParameters, onSyncedParameters, onUnsyncedChangesParameters } from "./types.ts";
|
|
7
|
+
import type { ConstructableOutgoingMessage, onAuthenticatedParameters, onAuthenticationFailedParameters, onAwarenessChangeParameters, onAwarenessUpdateParameters, onCloseParameters, onDisconnectParameters, onMessageParameters, onOpenParameters, onOutgoingMessageParameters, onStatelessParameters, onStatusParameters, onSyncedParameters, onUnsyncedChangesParameters } from "./types.ts";
|
|
8
8
|
export type HocuspocusProviderConfiguration = Required<Pick<CompleteHocuspocusProviderConfiguration, "name">> & Partial<CompleteHocuspocusProviderConfiguration> & (Required<Pick<CompleteHocuspocusProviderWebsocketConfiguration, "url">> | Required<Pick<CompleteHocuspocusProviderConfiguration, "websocketProvider">>);
|
|
9
9
|
export interface CompleteHocuspocusProviderConfiguration {
|
|
10
10
|
/**
|
|
@@ -40,6 +40,7 @@ export interface CompleteHocuspocusProviderConfiguration {
|
|
|
40
40
|
onAuthenticationFailed: (data: onAuthenticationFailedParameters) => void;
|
|
41
41
|
onOpen: (data: onOpenParameters) => void;
|
|
42
42
|
onConnect: () => void;
|
|
43
|
+
onStatus: (data: onStatusParameters) => void;
|
|
43
44
|
onMessage: (data: onMessageParameters) => void;
|
|
44
45
|
onOutgoingMessage: (data: onOutgoingMessageParameters) => void;
|
|
45
46
|
onSynced: (data: onSyncedParameters) => void;
|
|
@@ -69,10 +70,11 @@ export declare class HocuspocusProvider extends EventEmitter {
|
|
|
69
70
|
boundPageHide: () => void;
|
|
70
71
|
boundOnOpen: (event: Event) => Promise<void>;
|
|
71
72
|
boundOnClose: () => void;
|
|
72
|
-
forwardConnect: (
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
forwardConnect: () => this;
|
|
74
|
+
forwardStatus: (e: onStatusParameters) => this;
|
|
75
|
+
forwardClose: (e: onCloseParameters) => this;
|
|
76
|
+
forwardDisconnect: (e: onDisconnectParameters) => this;
|
|
77
|
+
forwardDestroy: () => this;
|
|
76
78
|
setConfiguration(configuration?: Partial<HocuspocusProviderConfiguration>): void;
|
|
77
79
|
get document(): Y.Doc;
|
|
78
80
|
get isAttached(): boolean;
|
|
@@ -2,6 +2,7 @@ import type WebSocket from "ws";
|
|
|
2
2
|
import { Awareness } from "y-protocols/awareness";
|
|
3
3
|
import { Doc } from "yjs";
|
|
4
4
|
import type Connection from "./Connection.ts";
|
|
5
|
+
import { Mutex } from "async-mutex";
|
|
5
6
|
export declare class Document extends Doc {
|
|
6
7
|
awareness: Awareness;
|
|
7
8
|
callbacks: {
|
|
@@ -16,6 +17,7 @@ export declare class Document extends Doc {
|
|
|
16
17
|
name: string;
|
|
17
18
|
isLoading: boolean;
|
|
18
19
|
isDestroyed: boolean;
|
|
20
|
+
saveMutex: Mutex;
|
|
19
21
|
/**
|
|
20
22
|
* Constructor.
|
|
21
23
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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-throttle",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.5",
|
|
4
4
|
"description": "hocuspocus throttle extension",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@hocuspocus/server": "^3.2.
|
|
31
|
+
"@hocuspocus/server": "^3.2.5"
|
|
32
32
|
},
|
|
33
33
|
"gitHead": "b3454a4ca289a84ddfb7fa5607a2d4b8d5c37e9d"
|
|
34
34
|
}
|