@hocuspocus/extension-logger 1.0.0 → 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@hocuspocus/extension-logger",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "hocuspocus logging 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": "^1.0.0"
31
+ "@hocuspocus/server": "^1.0.1"
32
32
  },
33
33
  "gitHead": "b3454a4ca289a84ddfb7fa5607a2d4b8d5c37e9d"
34
34
  }