@opra/http 1.19.4 → 1.19.5
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/cjs/express-adapter.js +4 -8
- package/esm/express-adapter.js +4 -8
- package/package.json +10 -10
- package/types/express-adapter.d.ts +1 -2
package/cjs/express-adapter.js
CHANGED
|
@@ -10,17 +10,10 @@ const http_context_js_1 = require("./http-context.js");
|
|
|
10
10
|
const http_incoming_interface_js_1 = require("./interfaces/http-incoming.interface.js");
|
|
11
11
|
const http_outgoing_interface_js_1 = require("./interfaces/http-outgoing.interface.js");
|
|
12
12
|
class ExpressAdapter extends http_adapter_js_1.HttpAdapter {
|
|
13
|
-
constructor(app, options) {
|
|
13
|
+
constructor(app, document, options) {
|
|
14
14
|
super(options);
|
|
15
15
|
this._controllerInstances = new Map();
|
|
16
16
|
this.app = app;
|
|
17
|
-
}
|
|
18
|
-
get platform() {
|
|
19
|
-
return 'express';
|
|
20
|
-
}
|
|
21
|
-
initialize(document) {
|
|
22
|
-
if (this._document)
|
|
23
|
-
throw new TypeError(`${this.constructor.name} already initialized.`);
|
|
24
17
|
if (!(document.api instanceof common_1.HttpApi))
|
|
25
18
|
throw new TypeError(`The document does not expose an HTTP Api`);
|
|
26
19
|
this._document = document;
|
|
@@ -28,6 +21,9 @@ class ExpressAdapter extends http_adapter_js_1.HttpAdapter {
|
|
|
28
21
|
this._createControllers(c);
|
|
29
22
|
this._initRouter();
|
|
30
23
|
}
|
|
24
|
+
get platform() {
|
|
25
|
+
return 'express';
|
|
26
|
+
}
|
|
31
27
|
async close() {
|
|
32
28
|
const processInstance = async (controller) => {
|
|
33
29
|
if (controller.controllers.size) {
|
package/esm/express-adapter.js
CHANGED
|
@@ -6,17 +6,10 @@ import { HttpContext } from './http-context.js';
|
|
|
6
6
|
import { HttpIncoming } from './interfaces/http-incoming.interface.js';
|
|
7
7
|
import { HttpOutgoing } from './interfaces/http-outgoing.interface.js';
|
|
8
8
|
export class ExpressAdapter extends HttpAdapter {
|
|
9
|
-
constructor(app, options) {
|
|
9
|
+
constructor(app, document, options) {
|
|
10
10
|
super(options);
|
|
11
11
|
this._controllerInstances = new Map();
|
|
12
12
|
this.app = app;
|
|
13
|
-
}
|
|
14
|
-
get platform() {
|
|
15
|
-
return 'express';
|
|
16
|
-
}
|
|
17
|
-
initialize(document) {
|
|
18
|
-
if (this._document)
|
|
19
|
-
throw new TypeError(`${this.constructor.name} already initialized.`);
|
|
20
13
|
if (!(document.api instanceof HttpApi))
|
|
21
14
|
throw new TypeError(`The document does not expose an HTTP Api`);
|
|
22
15
|
this._document = document;
|
|
@@ -24,6 +17,9 @@ export class ExpressAdapter extends HttpAdapter {
|
|
|
24
17
|
this._createControllers(c);
|
|
25
18
|
this._initRouter();
|
|
26
19
|
}
|
|
20
|
+
get platform() {
|
|
21
|
+
return 'express';
|
|
22
|
+
}
|
|
27
23
|
async close() {
|
|
28
24
|
const processInstance = async (controller) => {
|
|
29
25
|
if (controller.controllers.size) {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/http",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.5",
|
|
4
4
|
"description": "Opra Http Server Adapter",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@browsery/antlr4": "^4.13.3-r4",
|
|
9
|
-
"@browsery/http-parser": "^0.5.
|
|
10
|
-
"@browsery/type-is": "^
|
|
11
|
-
"@jsopen/objects": "^2.0.
|
|
9
|
+
"@browsery/http-parser": "^0.5.10-r2",
|
|
10
|
+
"@browsery/type-is": "^2.0.1",
|
|
11
|
+
"@jsopen/objects": "^2.0.2",
|
|
12
12
|
"accepts": "^1.3.8",
|
|
13
13
|
"base64-stream": "^1.0.0",
|
|
14
14
|
"busboy": "^1.6.0",
|
|
@@ -18,25 +18,25 @@
|
|
|
18
18
|
"cookie": "^1.0.2",
|
|
19
19
|
"cookie-signature": "^1.2.2",
|
|
20
20
|
"encodeurl": "^2.0.0",
|
|
21
|
-
"expect": "^30.0
|
|
21
|
+
"expect": "^30.2.0",
|
|
22
22
|
"fast-tokenizer": "^1.7.0",
|
|
23
23
|
"fresh": "^0.5.2",
|
|
24
|
-
"iconv-lite": "^0.
|
|
24
|
+
"iconv-lite": "^0.7.0",
|
|
25
25
|
"mime-types": "^3.0.1",
|
|
26
26
|
"node-events-async": "^1.2.0",
|
|
27
27
|
"power-tasks": "^1.11.1",
|
|
28
28
|
"putil-varhelpers": "^1.6.5",
|
|
29
29
|
"range-parser": "^1.2.1",
|
|
30
|
-
"raw-body": "^3.0.
|
|
30
|
+
"raw-body": "^3.0.1",
|
|
31
31
|
"reflect-metadata": "^0.2.2",
|
|
32
32
|
"super-fast-md5": "^1.0.3",
|
|
33
33
|
"tslib": "^2.8.1",
|
|
34
|
-
"valgen": "^5.18.
|
|
34
|
+
"valgen": "^5.18.2",
|
|
35
35
|
"vary": "^1.1.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@opra/common": "^1.19.
|
|
39
|
-
"@opra/core": "^1.19.
|
|
38
|
+
"@opra/common": "^1.19.5",
|
|
39
|
+
"@opra/core": "^1.19.5"
|
|
40
40
|
},
|
|
41
41
|
"optionalDependencies": {
|
|
42
42
|
"express": "^4.0.0 || ^5.0.0",
|
|
@@ -4,9 +4,8 @@ import { HttpAdapter } from './http-adapter.js';
|
|
|
4
4
|
export declare class ExpressAdapter extends HttpAdapter {
|
|
5
5
|
readonly app: Application;
|
|
6
6
|
protected _controllerInstances: Map<HttpController, any>;
|
|
7
|
-
constructor(app: Application, options?: HttpAdapter.Options);
|
|
7
|
+
constructor(app: Application, document: ApiDocument, options?: HttpAdapter.Options);
|
|
8
8
|
get platform(): string;
|
|
9
|
-
initialize(document: ApiDocument): void;
|
|
10
9
|
close(): Promise<void>;
|
|
11
10
|
getControllerInstance<T>(controllerPath: string): T | undefined;
|
|
12
11
|
protected _initRouter(): void;
|