Socket
Socket
Sign inDemoInstall

@hocuspocus/common

Package Overview
Dependencies
Maintainers
4
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hocuspocus/common - npm Package Compare versions

Comparing version 1.0.0-alpha.12 to 1.0.0-beta.2

dist/tests/server/beforeHandleMessage.d.ts

5

dist/packages/provider/src/HocuspocusProvider.d.ts

@@ -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

14

dist/packages/server/src/types.d.ts

@@ -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"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc