@hocuspocus/provider
Advanced tools
Comparing version 2.12.0-rc.0 to 2.12.1-rc.0
@@ -1,2 +0,3 @@ | ||
import { type MessageEvent, Event } from 'ws'; | ||
import type { MessageEvent } from 'ws'; | ||
import { Event } from 'ws'; | ||
import EventEmitter from './EventEmitter.js'; | ||
@@ -3,0 +4,0 @@ import { HocuspocusProvider } from './HocuspocusProvider.js'; |
@@ -41,2 +41,3 @@ /// <reference types="node" /> | ||
onAuthenticate?(data: onAuthenticatePayload): Promise<any>; | ||
onCreateDocument?(data: onCreateDocumentPayload): Promise<any>; | ||
onLoadDocument?(data: onLoadDocumentPayload): Promise<any>; | ||
@@ -56,3 +57,3 @@ afterLoadDocument?(data: afterLoadDocumentPayload): Promise<any>; | ||
} | ||
export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'afterUnloadDocument' | 'onDestroy'; | ||
export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'afterUnloadDocument' | 'onDestroy'; | ||
export type HookPayloadByName = { | ||
@@ -65,2 +66,3 @@ onConfigure: onConfigurePayload; | ||
onAuthenticate: onAuthenticatePayload; | ||
onCreateDocument: onCreateDocumentPayload; | ||
onLoadDocument: onLoadDocumentPayload; | ||
@@ -148,2 +150,3 @@ afterLoadDocument: afterLoadDocumentPayload; | ||
requestParameters: URLSearchParams; | ||
request: IncomingMessage; | ||
socketId: string; | ||
@@ -153,2 +156,11 @@ token: string; | ||
} | ||
export interface onCreateDocumentPayload { | ||
context: any; | ||
documentName: string; | ||
instance: Hocuspocus; | ||
requestHeaders: IncomingHttpHeaders; | ||
requestParameters: URLSearchParams; | ||
socketId: string; | ||
connection: ConnectionConfiguration; | ||
} | ||
export interface onConnectPayload { | ||
@@ -155,0 +167,0 @@ context: any; |
{ | ||
"name": "@hocuspocus/provider", | ||
"version": "2.12.0-rc.0", | ||
"version": "2.12.1-rc.0", | ||
"description": "hocuspocus provider", | ||
@@ -32,3 +32,3 @@ "homepage": "https://hocuspocus.dev", | ||
"dependencies": { | ||
"@hocuspocus/common": "^2.12.0-rc.0", | ||
"@hocuspocus/common": "^2.12.1-rc.0", | ||
"@lifeomic/attempt": "^3.0.2", | ||
@@ -35,0 +35,0 @@ "lib0": "^0.2.87", |
@@ -7,3 +7,4 @@ import { | ||
import * as url from 'lib0/url' | ||
import { type MessageEvent, Event } from 'ws' | ||
import type { MessageEvent } from 'ws' | ||
import { Event } from 'ws' | ||
import EventEmitter from './EventEmitter.js' | ||
@@ -352,3 +353,3 @@ import { HocuspocusProvider } from './HocuspocusProvider.js' | ||
// Init the WebSocket connection | ||
const ws = new this.configuration.WebSocketPolyfill(this.url, { followRedirects: true }) | ||
const ws = new this.configuration.WebSocketPolyfill(this.url) | ||
ws.binaryType = 'arraybuffer' | ||
@@ -355,0 +356,0 @@ ws.identifier = this.identifier |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
817474
9335