@hocuspocus/common
Advanced tools
Comparing version 1.0.0-alpha.12 to 1.0.0-beta.2
@@ -124,4 +124,5 @@ import * as Y from 'yjs'; | ||
setConfiguration(configuration?: Partial<HocuspocusProviderConfiguration>): void; | ||
boundConnect: () => Promise<void>; | ||
connect(): Promise<void>; | ||
boundConnect: () => Promise<unknown>; | ||
cancelWebsocketRetry?: () => void; | ||
connect(): Promise<unknown>; | ||
createWebSocketConnection(): Promise<unknown>; | ||
@@ -128,0 +129,0 @@ resolveConnectionAttempt(): void; |
@@ -30,2 +30,6 @@ /// <reference types="node" /> | ||
/** | ||
* Set a callback that will be triggered before an message is handled | ||
*/ | ||
beforeHandleMessage(callback: (payload: Document, update: Uint8Array) => Promise<any>): Connection; | ||
/** | ||
* Send the given message | ||
@@ -54,2 +58,9 @@ */ | ||
/** | ||
* Handle a ws instance error, which is required to prevent | ||
* the server from crashing when one happens | ||
* See https://github.com/websockets/ws/issues/1777#issuecomment-660803472 | ||
* @private | ||
*/ | ||
private handleError; | ||
/** | ||
* Get the underlying connection instance | ||
@@ -56,0 +67,0 @@ * @deprecated |
@@ -39,2 +39,3 @@ /// <reference types="node" /> | ||
afterLoadDocument?(data: onLoadDocumentPayload): Promise<any>; | ||
beforeHandleMessage?(data: beforeHandleMessagePayload): Promise<any>; | ||
onChange?(data: onChangePayload): Promise<any>; | ||
@@ -52,3 +53,3 @@ onStoreDocument?(data: onStoreDocumentPayload): Promise<any>; | ||
*/ | ||
'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'onDestroy'; | ||
'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'onDestroy'; | ||
export declare type HookPayload = onConfigurePayload | onListenPayload | onUpgradePayload | onConnectPayload | connectedPayload | onAuthenticatePayload | onLoadDocumentPayload | onChangePayload | onStoreDocumentPayload | afterStoreDocumentPayload | onAwarenessUpdatePayload | onRequestPayload | onDisconnectPayload | onDestroyPayload; | ||
@@ -160,2 +161,13 @@ export interface Configuration extends Extension { | ||
} | ||
export interface beforeHandleMessagePayload { | ||
clientsCount: number; | ||
context: any; | ||
document: Document; | ||
documentName: string; | ||
instance: Hocuspocus; | ||
requestHeaders: IncomingHttpHeaders; | ||
requestParameters: URLSearchParams; | ||
update: Uint8Array; | ||
socketId: string; | ||
} | ||
export interface onStoreDocumentPayload { | ||
@@ -162,0 +174,0 @@ clientsCount: number; |
{ | ||
"name": "@hocuspocus/common", | ||
"description": "shared code for multiple Hocuspocus packages", | ||
"version": "1.0.0-alpha.12", | ||
"version": "1.0.0-beta.2", | ||
"homepage": "https://hocuspocus.dev", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
], | ||
"gitHead": "6865794352a68372a54c579040513e45aac422d1", | ||
"gitHead": "cd788b6a315f608ef531524409abdce1e6790726", | ||
"dependencies": { | ||
@@ -30,0 +30,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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
122
2175
0
176538