@hocuspocus/provider 4.0.0-rc.1 → 4.0.0-rc.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hocuspocus/provider",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.3",
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": "^4.0.0-rc.1",
32
+ "@hocuspocus/common": "^4.0.0-rc.3",
33
33
  "@lifeomic/attempt": "^3.0.2",
34
34
  "lib0": "^0.2.87",
35
35
  "ws": "^8.17.1"
@@ -38,7 +38,7 @@
38
38
  "y-protocols": "^1.0.6",
39
39
  "yjs": "^13.6.8"
40
40
  },
41
- "gitHead": "730ac02724fcc44bbbfcc5849df4b0cafb996450",
41
+ "gitHead": "842287de4e4b9ccd87a70942d6b7bfcd4e6ffde7",
42
42
  "repository": {
43
43
  "url": "https://github.com/ueberdosis/hocuspocus"
44
44
  },
@@ -12,22 +12,22 @@ import { AwarenessMessage } from "./OutgoingMessages/AwarenessMessage.ts";
12
12
  import { StatelessMessage } from "./OutgoingMessages/StatelessMessage.ts";
13
13
  import { SyncStepOneMessage } from "./OutgoingMessages/SyncStepOneMessage.ts";
14
14
  import { UpdateMessage } from "./OutgoingMessages/UpdateMessage.ts";
15
- import {
16
- type AuthorizedScope,
17
- type ConstructableOutgoingMessage,
18
- type onAuthenticatedParameters,
19
- type onAuthenticationFailedParameters,
20
- type onAwarenessChangeParameters,
21
- type onAwarenessUpdateParameters,
22
- type onCloseParameters,
23
- type onDisconnectParameters,
24
- type onMessageParameters,
25
- type onOpenParameters,
26
- type onOutgoingMessageParameters,
27
- type onStatelessParameters,
28
- type onStatusParameters,
29
- type onSyncedParameters,
30
- type onUnsyncedChangesParameters,
15
+ import type {
16
+ AuthorizedScope,
17
+ ConstructableOutgoingMessage,
18
+ onAuthenticatedParameters,
19
+ onAuthenticationFailedParameters,
20
+ onAwarenessChangeParameters,
21
+ onAwarenessUpdateParameters,
22
+ onCloseParameters,
23
+ onDisconnectParameters,
24
+ onMessageParameters,
25
+ onOpenParameters,
26
+ onOutgoingMessageParameters,
27
+ onStatelessParameters,
28
+ onStatusParameters,
29
+ onSyncedParameters,
30
+ onUnsyncedChangesParameters,
31
31
  } from "./types.ts";
32
32
 
33
33
  export type HocuspocusProviderConfiguration = Required<
@@ -118,12 +118,12 @@ export class AwarenessError extends Error {
118
118
  export class HocuspocusProvider extends EventEmitter {
119
119
  public configuration: CompleteHocuspocusProviderConfiguration = {
120
120
  name: "",
121
- // @ts-ignore
121
+ // @ts-expect-error
122
122
  document: undefined,
123
- // @ts-ignore
123
+ // @ts-expect-error
124
124
  awareness: undefined,
125
125
  token: null,
126
- sessionAwareness: true,
126
+ sessionAwareness: false,
127
127
  forceSyncInterval: false,
128
128
  onAuthenticated: () => null,
129
129
  onAuthenticationFailed: () => null,
@@ -48,7 +48,7 @@ export class MessageReceiver {
48
48
  );
49
49
  break;
50
50
 
51
- case MessageType.CLOSE:
51
+ case MessageType.CLOSE: {
52
52
  // eslint-disable-next-line no-case-declarations
53
53
  const event: CloseEvent = {
54
54
  code: 1000,
@@ -58,6 +58,7 @@ export class MessageReceiver {
58
58
  provider.configuration.onClose({ event });
59
59
  provider.forwardClose({ event });
60
60
  break;
61
+ }
61
62
 
62
63
  default:
63
64
  console.error(`Can’t apply message of unknown type: ${type}`);
@@ -66,7 +67,7 @@ export class MessageReceiver {
66
67
  // Reply
67
68
  if (message.length() > emptyMessageLength + 1) {
68
69
  // length of documentName (considered in emptyMessageLength plus length of yjs sync type, set in applySyncMessage)
69
- // @ts-ignore
70
+ // @ts-expect-error
70
71
  provider.send(OutgoingMessage, { encoder: message.encoder });
71
72
  }
72
73
  }
package/src/version.ts CHANGED
@@ -1,4 +1,4 @@
1
- // @ts-ignore - __HOCUSPOCUS_VERSION__ is replaced at build time by rolldown
1
+ // @ts-expect-error - __HOCUSPOCUS_VERSION__ is replaced at build time by rolldown
2
2
  // eslint-disable-next-line
3
3
  export const version: string = typeof __HOCUSPOCUS_VERSION__ !== 'undefined'
4
4
  ? __HOCUSPOCUS_VERSION__