@hocuspocus/provider 2.11.2 → 2.12.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hocuspocus-provider.cjs +1 -1
- package/dist/hocuspocus-provider.cjs.map +1 -1
- package/dist/hocuspocus-provider.esm.js +1 -1
- package/dist/hocuspocus-provider.esm.js.map +1 -1
- package/dist/packages/extension-redis/src/Redis.d.ts +1 -1
- package/dist/packages/provider/src/HocuspocusProviderWebsocket.d.ts +2 -3
- package/dist/packages/provider/src/types.d.ts +1 -1
- package/dist/packages/server/src/types.d.ts +1 -1
- package/package.json +2 -2
- package/src/HocuspocusProviderWebsocket.ts +3 -4
- package/src/types.ts +1 -1
|
@@ -110,7 +110,7 @@ export declare class Redis implements Extension {
|
|
|
110
110
|
onChange(data: onChangePayload): Promise<any>;
|
|
111
111
|
/**
|
|
112
112
|
* Make sure to *not* listen for further changes, when there’s
|
|
113
|
-
*
|
|
113
|
+
* no one connected anymore.
|
|
114
114
|
*/
|
|
115
115
|
onDisconnect: ({ documentName }: onDisconnectPayload) => Promise<void>;
|
|
116
116
|
beforeBroadcastStateless(data: beforeBroadcastStatelessPayload): Promise<number>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { Event } from 'ws';
|
|
1
|
+
import { type MessageEvent, Event } from 'ws';
|
|
3
2
|
import EventEmitter from './EventEmitter.js';
|
|
4
3
|
import { HocuspocusProvider } from './HocuspocusProvider.js';
|
|
5
4
|
import { WebSocketStatus, onAwarenessChangeParameters, onAwarenessUpdateParameters, onCloseParameters, onDisconnectParameters, onMessageParameters, onOpenParameters, onOutgoingMessageParameters, onStatusParameters } from './types.js';
|
|
@@ -35,7 +34,7 @@ export interface CompleteHocuspocusProviderWebsocketConfiguration {
|
|
|
35
34
|
*/
|
|
36
35
|
delay: number;
|
|
37
36
|
/**
|
|
38
|
-
* The
|
|
37
|
+
* The initialDelay is the amount of time to wait before making the first attempt. This option should typically be 0 since you typically want the first attempt to happen immediately.
|
|
39
38
|
*/
|
|
40
39
|
initialDelay: number;
|
|
41
40
|
/**
|
|
@@ -113,7 +113,7 @@ export type THistoryAction = THistoryDocumentRevertAction | THistoryVersionCreat
|
|
|
113
113
|
export type THistoryDocumentRevertAction = {
|
|
114
114
|
action: 'document.revert';
|
|
115
115
|
/**
|
|
116
|
-
* if changes
|
|
116
|
+
* if changes haven't been persisted to a version yet, we'll create one with the specified name,
|
|
117
117
|
* expect when `false` is passed.
|
|
118
118
|
*/
|
|
119
119
|
currentVersionName?: string | false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/provider",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0-rc.0",
|
|
4
4
|
"description": "hocuspocus provider",
|
|
5
5
|
"homepage": "https://hocuspocus.dev",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@hocuspocus/common": "^2.
|
|
32
|
+
"@hocuspocus/common": "^2.12.0-rc.0",
|
|
33
33
|
"@lifeomic/attempt": "^3.0.2",
|
|
34
34
|
"lib0": "^0.2.87",
|
|
35
35
|
"ws": "^8.14.2"
|
|
@@ -4,8 +4,7 @@ import {
|
|
|
4
4
|
import { retry } from '@lifeomic/attempt'
|
|
5
5
|
import * as time from 'lib0/time'
|
|
6
6
|
import * as url from 'lib0/url'
|
|
7
|
-
import type
|
|
8
|
-
import { Event } from 'ws'
|
|
7
|
+
import { type MessageEvent, Event } from 'ws'
|
|
9
8
|
import EventEmitter from './EventEmitter.js'
|
|
10
9
|
import { HocuspocusProvider } from './HocuspocusProvider.js'
|
|
11
10
|
import {
|
|
@@ -50,7 +49,7 @@ export interface CompleteHocuspocusProviderWebsocketConfiguration {
|
|
|
50
49
|
*/
|
|
51
50
|
delay: number,
|
|
52
51
|
/**
|
|
53
|
-
* The
|
|
52
|
+
* The initialDelay is the amount of time to wait before making the first attempt. This option should typically be 0 since you typically want the first attempt to happen immediately.
|
|
54
53
|
*/
|
|
55
54
|
initialDelay: number,
|
|
56
55
|
/**
|
|
@@ -349,7 +348,7 @@ export class HocuspocusProviderWebsocket extends EventEmitter {
|
|
|
349
348
|
this.identifier += 1
|
|
350
349
|
|
|
351
350
|
// Init the WebSocket connection
|
|
352
|
-
const ws = new this.configuration.WebSocketPolyfill(this.url)
|
|
351
|
+
const ws = new this.configuration.WebSocketPolyfill(this.url, { followRedirects: true })
|
|
353
352
|
ws.binaryType = 'arraybuffer'
|
|
354
353
|
ws.identifier = this.identifier
|
|
355
354
|
|
package/src/types.ts
CHANGED
|
@@ -143,7 +143,7 @@ export type THistoryAction =
|
|
|
143
143
|
export type THistoryDocumentRevertAction = {
|
|
144
144
|
action: 'document.revert';
|
|
145
145
|
/**
|
|
146
|
-
* if changes
|
|
146
|
+
* if changes haven't been persisted to a version yet, we'll create one with the specified name,
|
|
147
147
|
* expect when `false` is passed.
|
|
148
148
|
*/
|
|
149
149
|
currentVersionName?: string | false;
|