@hocuspocus/extension-sqlite 1.0.0-alpha.15 → 1.0.0-alpha.16

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.
@@ -1,12 +1,10 @@
1
- import { Extension, onChangePayload, onLoadDocumentPayload, storePayload } from '@hocuspocus/server';
1
+ import { Extension, onChangePayload, onLoadDocumentPayload, storePayload, fetchPayload } from '@hocuspocus/server';
2
2
  export interface DatabaseConfiguration {
3
3
  /**
4
4
  * Pass a Promise to retrieve updates from your database. The Promise should resolve to
5
5
  * an array of items with Y.js-compatible binary data.
6
6
  */
7
- fetch: ({ documentName }: {
8
- documentName: string;
9
- }) => Promise<Uint8Array | null>;
7
+ fetch: (data: fetchPayload) => Promise<Uint8Array | null>;
10
8
  /**
11
9
  * Pass a function to store updates in your database.
12
10
  */
@@ -24,7 +22,7 @@ export declare class Database implements Extension {
24
22
  /**
25
23
  * Get stored data from the database.
26
24
  */
27
- onLoadDocument({ document, documentName }: onLoadDocumentPayload): Promise<any>;
25
+ onLoadDocument(data: onLoadDocumentPayload): Promise<any>;
28
26
  /**
29
27
  * Store new updates in the database.
30
28
  */
@@ -48,7 +48,7 @@ export declare type HookName = 'onConfigure' | 'onListen' | 'onUpgrade' | 'onCon
48
48
  * @deprecated onCreateDocument is deprecated, use onLoadDocument instead
49
49
  */
50
50
  'onCreateDocument' | 'onLoadDocument' | 'afterLoadDocument' | 'onChange' | 'onStoreDocument' | 'afterStoreDocument' | 'onAwarenessUpdate' | 'onRequest' | 'onDisconnect' | 'onDestroy';
51
- export declare type HookPayload = onConfigurePayload | onListenPayload | onUpgradePayload | onConnectPayload | connectedPayload | onAuthenticatePayload | onLoadDocumentPayload | onLoadDocumentPayload | onLoadDocumentPayload | onChangePayload | onStoreDocumentPayload | afterStoreDocumentPayload | onAwarenessUpdatePayload | onRequestPayload | onDisconnectPayload | onDestroyPayload;
51
+ export declare type HookPayload = onConfigurePayload | onListenPayload | onUpgradePayload | onConnectPayload | connectedPayload | onAuthenticatePayload | onLoadDocumentPayload | onChangePayload | onStoreDocumentPayload | afterStoreDocumentPayload | onAwarenessUpdatePayload | onRequestPayload | onDisconnectPayload | onDestroyPayload;
52
52
  export interface Configuration extends Extension {
53
53
  /**
54
54
  * A name for the instance, used for logging.
@@ -179,6 +179,16 @@ export declare type StatesArray = {
179
179
  clientId: number;
180
180
  [key: string | number]: any;
181
181
  }[];
182
+ export interface fetchPayload {
183
+ context: any;
184
+ document: Document;
185
+ documentName: string;
186
+ instance: Hocuspocus;
187
+ requestHeaders: IncomingHttpHeaders;
188
+ requestParameters: URLSearchParams;
189
+ socketId: string;
190
+ connection: ConnectionConfiguration;
191
+ }
182
192
  export interface storePayload extends onStoreDocumentPayload {
183
193
  state: Buffer;
184
194
  }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-sqlite",
3
3
  "description": "a generic Hocuspocus persistence driver for the sqlite",
4
- "version": "1.0.0-alpha.15",
4
+ "version": "1.0.0-alpha.16",
5
5
  "homepage": "https://hocuspocus.dev",
6
6
  "keywords": [
7
7
  "hocuspocus",
@@ -26,7 +26,7 @@
26
26
  "dist"
27
27
  ],
28
28
  "dependencies": {
29
- "@hocuspocus/extension-database": "^1.0.0-alpha.15",
29
+ "@hocuspocus/extension-database": "^1.0.0-alpha.16",
30
30
  "kleur": "^4.1.4",
31
31
  "sqlite3": "^5.0.2"
32
32
  },
@@ -36,5 +36,5 @@
36
36
  "devDependencies": {
37
37
  "@types/sqlite3": "^3.1.8"
38
38
  },
39
- "gitHead": "b0a04ffe8d56cfa6b269a2c8ad7f64c92b108de0"
39
+ "gitHead": "450e12c89b027bc62683f151330a98074cd8e8fb"
40
40
  }