@hocuspocus/extension-throttle 2.11.3 → 2.12.1-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.
@@ -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
- * noone connected anymore.
113
+ * no one connected anymore.
114
114
  */
115
115
  onDisconnect: ({ documentName }: onDisconnectPayload) => Promise<void>;
116
116
  beforeBroadcastStateless(data: beforeBroadcastStatelessPayload): Promise<number>;
@@ -35,7 +35,7 @@ export interface CompleteHocuspocusProviderWebsocketConfiguration {
35
35
  */
36
36
  delay: number;
37
37
  /**
38
- * The intialDelay 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.
38
+ * 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
39
  */
40
40
  initialDelay: number;
41
41
  /**
@@ -113,7 +113,7 @@ export type THistoryAction = THistoryDocumentRevertAction | THistoryVersionCreat
113
113
  export type THistoryDocumentRevertAction = {
114
114
  action: 'document.revert';
115
115
  /**
116
- * if changes havent been persisted to a version yet, we'll create one with the specified name,
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;
@@ -38,6 +38,7 @@ export interface Extension {
38
38
  onConnect?(data: onConnectPayload): Promise<any>;
39
39
  connected?(data: connectedPayload): Promise<any>;
40
40
  onAuthenticate?(data: onAuthenticatePayload): Promise<any>;
41
+ onCreateDocument?(data: onCreateDocumentPayload): Promise<any>;
41
42
  onLoadDocument?(data: onLoadDocumentPayload): Promise<any>;
42
43
  afterLoadDocument?(data: afterLoadDocumentPayload): Promise<any>;
43
44
  beforeHandleMessage?(data: beforeHandleMessagePayload): Promise<any>;
@@ -52,7 +53,7 @@ export interface Extension {
52
53
  afterUnloadDocument?(data: afterUnloadDocumentPayload): Promise<any>;
53
54
  onDestroy?(data: onDestroyPayload): Promise<any>;
54
55
  }
55
- export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'afterUnloadDocument' | 'onDestroy';
56
+ export type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onConnect' | 'connected' | 'onAuthenticate' | 'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'beforeHandleMessage' | 'beforeBroadcastStateless' | 'onStateless' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'afterUnloadDocument' | 'onDestroy';
56
57
  export type HookPayloadByName = {
57
58
  onConfigure: onConfigurePayload;
58
59
  onListen: onListenPayload;
@@ -60,6 +61,7 @@ export type HookPayloadByName = {
60
61
  onConnect: onConnectPayload;
61
62
  connected: connectedPayload;
62
63
  onAuthenticate: onAuthenticatePayload;
64
+ onCreateDocument: onCreateDocumentPayload;
63
65
  onLoadDocument: onLoadDocumentPayload;
64
66
  afterLoadDocument: afterLoadDocumentPayload;
65
67
  beforeHandleMessage: beforeHandleMessagePayload;
@@ -80,7 +82,7 @@ export interface Configuration extends Extension {
80
82
  */
81
83
  name: string | null;
82
84
  /**
83
- * A list of hocuspocus extenions.
85
+ * A list of hocuspocus extensions.
84
86
  */
85
87
  extensions: Array<Extension>;
86
88
  /**
@@ -142,10 +144,20 @@ export interface onAuthenticatePayload {
142
144
  instance: Hocuspocus;
143
145
  requestHeaders: IncomingHttpHeaders;
144
146
  requestParameters: URLSearchParams;
147
+ request: IncomingMessage;
145
148
  socketId: string;
146
149
  token: string;
147
150
  connection: ConnectionConfiguration;
148
151
  }
152
+ export interface onCreateDocumentPayload {
153
+ context: any;
154
+ documentName: string;
155
+ instance: Hocuspocus;
156
+ requestHeaders: IncomingHttpHeaders;
157
+ requestParameters: URLSearchParams;
158
+ socketId: string;
159
+ connection: ConnectionConfiguration;
160
+ }
149
161
  export interface onConnectPayload {
150
162
  context: any;
151
163
  documentName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-throttle",
3
- "version": "2.11.3",
3
+ "version": "2.12.1-rc.0",
4
4
  "description": "hocuspocus throttle extension",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
@@ -28,7 +28,7 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@hocuspocus/server": "^2.11.3"
31
+ "@hocuspocus/server": "^2.12.1-rc.0"
32
32
  },
33
33
  "gitHead": "b3454a4ca289a84ddfb7fa5607a2d4b8d5c37e9d"
34
34
  }