@hocuspocus/provider
Advanced tools
Comparing version 2.0.6 to 2.1.0-alpha.0
@@ -1,5 +0,4 @@ | ||
import RedisClient, { ClusterNode, ClusterOptions, RedisOptions } from 'ioredis'; | ||
import Redlock from 'redlock'; | ||
import { Extension, afterLoadDocumentPayload, afterStoreDocumentPayload, onDisconnectPayload, onStoreDocumentPayload, onAwarenessUpdatePayload, onChangePayload, Debugger, onConfigurePayload, onListenPayload, beforeBroadcastStatelessPayload, Hocuspocus } from '@hocuspocus/server'; | ||
export type RedisInstance = RedisClient.Cluster | RedisClient.Redis; | ||
import RedisClient, { ClusterNode, ClusterOptions, RedisOptions, Cluster as RedisClusterClient } from 'ioredis'; | ||
import { Extension, afterLoadDocumentPayload, onDisconnectPayload, onAwarenessUpdatePayload, onChangePayload, Debugger, onConfigurePayload, beforeBroadcastStatelessPayload, Hocuspocus } from '@hocuspocus/server'; | ||
export type RedisInstance = RedisClient | RedisClusterClient; | ||
export interface Configuration { | ||
@@ -42,6 +41,2 @@ /** | ||
/** | ||
* The maximum time for the Redis lock in ms (in case it can’t be released). | ||
*/ | ||
lockTimeout: number; | ||
/** | ||
* A delay before onDisconnect is executed. This allows last minute updates' | ||
@@ -63,12 +58,8 @@ * sync messages to be received by the subscription before it's closed. | ||
instance: Hocuspocus; | ||
redlock: Redlock; | ||
locks: Map<string, Redlock.Lock>; | ||
logger: Debugger; | ||
constructor(configuration: Partial<Configuration>); | ||
onConfigure({ instance }: onConfigurePayload): Promise<void>; | ||
onListen({ configuration }: onListenPayload): Promise<void>; | ||
private getKey; | ||
private pubKey; | ||
private subKey; | ||
private lockKey; | ||
/** | ||
@@ -87,11 +78,2 @@ * Once a document is laoded, subscribe to the channel in Redis. | ||
/** | ||
* Before the document is stored, make sure to set a lock in Redis. | ||
* That’s meant to avoid conflicts with other instances trying to store the document. | ||
*/ | ||
onStoreDocument({ documentName }: onStoreDocumentPayload): Promise<unknown>; | ||
/** | ||
* Release the Redis lock, so other instances can store documents. | ||
*/ | ||
afterStoreDocument({ documentName }: afterStoreDocumentPayload): Promise<void>; | ||
/** | ||
* Handle awareness update messages received directly by this Hocuspocus instance. | ||
@@ -116,6 +98,2 @@ */ | ||
beforeBroadcastStateless(data: beforeBroadcastStatelessPayload): Promise<number>; | ||
/** | ||
* Kill the Redlock connection immediately. | ||
*/ | ||
onDestroy(): Promise<void>; | ||
} |
{ | ||
"name": "@hocuspocus/provider", | ||
"version": "2.0.6", | ||
"version": "2.1.0-alpha.0", | ||
"description": "hocuspocus provider", | ||
@@ -31,3 +31,3 @@ "homepage": "https://hocuspocus.dev", | ||
"dependencies": { | ||
"@hocuspocus/common": "^2.0.6", | ||
"@hocuspocus/common": "^2.1.0-alpha.0", | ||
"@lifeomic/attempt": "^3.0.2", | ||
@@ -34,0 +34,0 @@ "lib0": "^0.2.47", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
677283
7721
1