@hocuspocus/extension-database 3.2.4 → 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.
@@ -1,5 +1,5 @@
1
1
  import type { Extension, Hocuspocus, afterLoadDocumentPayload, afterStoreDocumentPayload, beforeBroadcastStatelessPayload, onAwarenessUpdatePayload, onChangePayload, onConfigurePayload, onDisconnectPayload, onStoreDocumentPayload } from "@hocuspocus/server";
2
- import { Redlock, type ExecutionResult, type Lock } from '@sesamecare-oss/redlock';
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
  */
@@ -1,6 +1,6 @@
1
- import type { Extension, onChangePayload, onConnectPayload, onLoadDocumentPayload, onDisconnectPayload } from "@hocuspocus/server";
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",
@@ -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
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-database",
3
3
  "description": "a generic Hocuspocus persistence driver for the database",
4
- "version": "3.2.4",
4
+ "version": "3.2.5",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
7
7
  "hocuspocus",
@@ -27,7 +27,7 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "@hocuspocus/server": "^3.2.4"
30
+ "@hocuspocus/server": "^3.2.5"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "yjs": "^13.6.8"