@hocuspocus/provider
Advanced tools
Comparing version 1.0.0-alpha.30 to 1.0.0-alpha.31
export * from './auth'; | ||
export * from './CloseEvents'; | ||
export * from './awarenessStatesToArray'; |
import { Extension, onConnectPayload } from '@hocuspocus/server'; | ||
export interface Configuration { | ||
export interface ThrottleConfiguration { | ||
throttle: number | null | false; | ||
@@ -7,6 +7,10 @@ banTime: number; | ||
export declare class Throttle implements Extension { | ||
configuration: Configuration; | ||
configuration: ThrottleConfiguration; | ||
connectionsByIp: Map<string, Array<number>>; | ||
bannedIps: Map<string, number>; | ||
/** | ||
* Constructor | ||
*/ | ||
constructor(configuration?: Partial<ThrottleConfiguration>); | ||
/** | ||
* Throttle requests | ||
@@ -13,0 +17,0 @@ * @private |
export * from './HocuspocusProvider'; | ||
export * from './HocuspocusCloudProvider'; | ||
export * from './types'; | ||
export * from './utils'; |
@@ -11,4 +11,4 @@ import { Awareness } from 'y-protocols/awareness'; | ||
apply(document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): void; | ||
readSyncMessage(message: IncomingMessage, document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): 0 | 1 | 2; | ||
readSyncMessage(message: IncomingMessage, document: Document, connection?: Connection, reply?: (message: Uint8Array) => void): 0 | 2 | 1; | ||
applyQueryAwarenessMessage(awareness: Awareness, reply?: (message: Uint8Array) => void): void; | ||
} |
@@ -41,2 +41,3 @@ /// <reference types="node" /> | ||
onConnect?(data: onConnectPayload): Promise<any>; | ||
connected?(data: connectedPayload): Promise<any>; | ||
onAuthenticate?(data: onAuthenticatePayload): Promise<any>; | ||
@@ -57,3 +58,3 @@ /** | ||
} | ||
export declare type Hook = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'onAuthenticate' | | ||
export declare type Hook = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | | ||
/** | ||
@@ -121,2 +122,11 @@ * @deprecated onCreateDocument is deprecated, use onLoadDocument instead | ||
} | ||
export interface connectedPayload { | ||
documentName: string; | ||
instance: Hocuspocus; | ||
request: IncomingMessage; | ||
requestHeaders: IncomingHttpHeaders; | ||
requestParameters: URLSearchParams; | ||
socketId: string; | ||
connection: ConnectionConfiguration; | ||
} | ||
export interface onLoadDocumentPayload { | ||
@@ -123,0 +133,0 @@ context: any; |
{ | ||
"name": "@hocuspocus/provider", | ||
"version": "1.0.0-alpha.30", | ||
"version": "1.0.0-alpha.31", | ||
"description": "hocuspocus provider", | ||
@@ -31,3 +31,3 @@ "homepage": "https://hocuspocus.dev", | ||
"dependencies": { | ||
"@hocuspocus/common": "^1.0.0-alpha.5", | ||
"@hocuspocus/common": "^1.0.0-alpha.6", | ||
"@lifeomic/attempt": "^3.0.2", | ||
@@ -38,3 +38,3 @@ "lib0": "^0.2.43", | ||
}, | ||
"gitHead": "125d94dc3520bb5185293c9b316f66ddd9215992" | ||
"gitHead": "05a7eb3d660175613d2fe7b6d9ec030e8e509683" | ||
} |
@@ -9,3 +9,3 @@ import * as Y from 'yjs' | ||
import { retry } from '@lifeomic/attempt' | ||
import { Forbidden, Unauthorized } from '@hocuspocus/common' | ||
import { awarenessStatesToArray, Forbidden, Unauthorized } from '@hocuspocus/common' | ||
import EventEmitter from './EventEmitter' | ||
@@ -22,4 +22,3 @@ import { IncomingMessage } from './IncomingMessage' | ||
import { OutgoingMessage } from './OutgoingMessage' | ||
import awarenessStatesToArray from './utils/awarenessStatesToArray' | ||
import { ConstructableOutgoingMessage, StatesArray } from './types' | ||
import { ConstructableOutgoingMessage } from './types' | ||
import { onAwarenessChangeParameters, onAwarenessUpdateParameters } from '.' | ||
@@ -26,0 +25,0 @@ |
export * from './HocuspocusProvider' | ||
export * from './HocuspocusCloudProvider' | ||
export * from './types' | ||
export * from './utils' |
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
552447
130
6462