@hocuspocus/extension-database 1.0.0-beta.7 → 1.0.1
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,16 +1,23 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { Extension, onConnectPayload } from '@hocuspocus/server';
|
|
2
3
|
export interface ThrottleConfiguration {
|
|
3
4
|
throttle: number | null | false;
|
|
5
|
+
consideredSeconds: number;
|
|
4
6
|
banTime: number;
|
|
7
|
+
cleanupInterval: number;
|
|
5
8
|
}
|
|
6
9
|
export declare class Throttle implements Extension {
|
|
7
10
|
configuration: ThrottleConfiguration;
|
|
8
11
|
connectionsByIp: Map<string, Array<number>>;
|
|
9
12
|
bannedIps: Map<string, number>;
|
|
13
|
+
cleanupInterval?: NodeJS.Timer;
|
|
10
14
|
/**
|
|
11
15
|
* Constructor
|
|
12
16
|
*/
|
|
13
17
|
constructor(configuration?: Partial<ThrottleConfiguration>);
|
|
18
|
+
onDestroy(): Promise<void>;
|
|
19
|
+
clearMaps(): void;
|
|
20
|
+
isBanned(ip: string): boolean;
|
|
14
21
|
/**
|
|
15
22
|
* Throttle requests
|
|
16
23
|
* @private
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hocuspocus/extension-database",
|
|
3
3
|
"description": "a generic Hocuspocus persistence driver for the database",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
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/server": "^1.0.
|
|
29
|
+
"@hocuspocus/server": "^1.0.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"yjs": "^13.5.29"
|