@opra/http 1.15.0 → 1.15.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/http",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "description": "Opra Http Server Adapter",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -24,7 +24,7 @@
24
24
  "fresh": "^0.5.2",
25
25
  "iconv-lite": "^0.6.3",
26
26
  "mime-types": "^3.0.1",
27
- "node-events-async": "^1.0.0",
27
+ "node-events-async": "^1.1.1",
28
28
  "power-tasks": "^1.11.0",
29
29
  "putil-varhelpers": "^1.6.5",
30
30
  "range-parser": "^1.2.1",
@@ -36,8 +36,8 @@
36
36
  "vary": "^1.1.2"
37
37
  },
38
38
  "peerDependencies": {
39
- "@opra/common": "^1.15.0",
40
- "@opra/core": "^1.15.0"
39
+ "@opra/common": "^1.15.1",
40
+ "@opra/core": "^1.15.1"
41
41
  },
42
42
  "optionalDependencies": {
43
43
  "express": "^4.0.0 || ^5.0.0",
@@ -1,7 +1,21 @@
1
1
  import { HttpApi, OpraSchema } from '@opra/common';
2
2
  import { PlatformAdapter } from '@opra/core';
3
+ import { EventMap } from 'node-events-async';
3
4
  import { HttpContext } from './http-context.js';
4
5
  import { HttpHandler } from './http-handler.js';
6
+ /**
7
+ *
8
+ * @class HttpAdapter
9
+ */
10
+ export declare abstract class HttpAdapter<T extends HttpAdapter.Events = HttpAdapter.Events> extends PlatformAdapter<EventMap<T>> {
11
+ readonly handler: HttpHandler;
12
+ readonly protocol: OpraSchema.Transport;
13
+ readonly basePath: string;
14
+ scope?: string;
15
+ interceptors: (HttpAdapter.InterceptorFunction | HttpAdapter.IHttpInterceptor)[];
16
+ protected constructor(options?: HttpAdapter.Options);
17
+ get api(): HttpApi;
18
+ }
5
19
  export declare namespace HttpAdapter {
6
20
  type NextCallback = () => Promise<void>;
7
21
  /**
@@ -19,17 +33,10 @@ export declare namespace HttpAdapter {
19
33
  interceptors?: (InterceptorFunction | IHttpInterceptor)[];
20
34
  scope?: string | '*';
21
35
  }
22
- }
23
- /**
24
- *
25
- * @class HttpAdapter
26
- */
27
- export declare abstract class HttpAdapter extends PlatformAdapter {
28
- readonly handler: HttpHandler;
29
- readonly protocol: OpraSchema.Transport;
30
- readonly basePath: string;
31
- scope?: string;
32
- interceptors: (HttpAdapter.InterceptorFunction | HttpAdapter.IHttpInterceptor)[];
33
- protected constructor(options?: HttpAdapter.Options);
34
- get api(): HttpApi;
36
+ interface Events {
37
+ createContext: [HttpContext];
38
+ error: [Error, HttpContext];
39
+ request: [HttpContext];
40
+ finish: [HttpContext];
41
+ }
35
42
  }