@webtypen/webframez-core 0.0.59 → 0.0.60
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/lib/Router/Response.d.ts +11 -3
- package/lib/Router/Response.js +14 -3
- package/lib/Router/Router.js +3 -1
- package/package.json +1 -1
- package/src/Router/Response.ts +15 -3
- package/src/Router/Router.ts +3 -1
package/lib/Router/Response.d.ts
CHANGED
|
@@ -8,22 +8,29 @@ export declare class Response {
|
|
|
8
8
|
[key: string]: any;
|
|
9
9
|
};
|
|
10
10
|
events: any;
|
|
11
|
+
autoEnd: boolean;
|
|
11
12
|
/**
|
|
12
13
|
* Mode
|
|
13
14
|
*/
|
|
14
15
|
mode: any | null;
|
|
15
16
|
constructor(options?: any | null | undefined);
|
|
17
|
+
/**
|
|
18
|
+
* Set Response-Auto-End
|
|
19
|
+
* @param status
|
|
20
|
+
* @returns Response
|
|
21
|
+
*/
|
|
22
|
+
setAutoEnd(status: boolean): this;
|
|
16
23
|
/**
|
|
17
24
|
* Sets the ServerResponse (res) Object (nodejs/http module)
|
|
18
25
|
* @param res
|
|
19
|
-
* @returns
|
|
26
|
+
* @returns Response
|
|
20
27
|
*/
|
|
21
28
|
setServerResponse(res: ServerResponse): this;
|
|
22
29
|
/**
|
|
23
30
|
* Set the http-status-code
|
|
24
31
|
*
|
|
25
32
|
* @param status
|
|
26
|
-
* @returns
|
|
33
|
+
* @returns Response
|
|
27
34
|
*/
|
|
28
35
|
status(status: number): Response;
|
|
29
36
|
/**
|
|
@@ -31,7 +38,7 @@ export declare class Response {
|
|
|
31
38
|
*
|
|
32
39
|
* @param type
|
|
33
40
|
* @param value
|
|
34
|
-
* @returns
|
|
41
|
+
* @returns Response
|
|
35
42
|
*/
|
|
36
43
|
header(type: string, value: string): this;
|
|
37
44
|
/**
|
|
@@ -39,6 +46,7 @@ export declare class Response {
|
|
|
39
46
|
* Any objects will be stringified to JSON
|
|
40
47
|
*
|
|
41
48
|
* @param content
|
|
49
|
+
* @returns Response
|
|
42
50
|
*/
|
|
43
51
|
send(content: any): this;
|
|
44
52
|
registerEvent(eventKey: string, func: any): Promise<void>;
|
package/lib/Router/Response.js
CHANGED
|
@@ -15,16 +15,26 @@ class Response {
|
|
|
15
15
|
this.statusCode = 200;
|
|
16
16
|
this.headers = {};
|
|
17
17
|
this.events = { after: [] };
|
|
18
|
+
this.autoEnd = true;
|
|
18
19
|
/**
|
|
19
20
|
* Mode
|
|
20
21
|
*/
|
|
21
22
|
this.mode = null;
|
|
22
23
|
this.mode = options && options.mode ? options.mode : null;
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Set Response-Auto-End
|
|
27
|
+
* @param status
|
|
28
|
+
* @returns Response
|
|
29
|
+
*/
|
|
30
|
+
setAutoEnd(status) {
|
|
31
|
+
this.autoEnd = status;
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
24
34
|
/**
|
|
25
35
|
* Sets the ServerResponse (res) Object (nodejs/http module)
|
|
26
36
|
* @param res
|
|
27
|
-
* @returns
|
|
37
|
+
* @returns Response
|
|
28
38
|
*/
|
|
29
39
|
setServerResponse(res) {
|
|
30
40
|
this.res = res;
|
|
@@ -34,7 +44,7 @@ class Response {
|
|
|
34
44
|
* Set the http-status-code
|
|
35
45
|
*
|
|
36
46
|
* @param status
|
|
37
|
-
* @returns
|
|
47
|
+
* @returns Response
|
|
38
48
|
*/
|
|
39
49
|
status(status) {
|
|
40
50
|
this.statusCode = status;
|
|
@@ -49,7 +59,7 @@ class Response {
|
|
|
49
59
|
*
|
|
50
60
|
* @param type
|
|
51
61
|
* @param value
|
|
52
|
-
* @returns
|
|
62
|
+
* @returns Response
|
|
53
63
|
*/
|
|
54
64
|
header(type, value) {
|
|
55
65
|
this.headers[type] = value;
|
|
@@ -64,6 +74,7 @@ class Response {
|
|
|
64
74
|
* Any objects will be stringified to JSON
|
|
65
75
|
*
|
|
66
76
|
* @param content
|
|
77
|
+
* @returns Response
|
|
67
78
|
*/
|
|
68
79
|
send(content) {
|
|
69
80
|
var _a, _b, _c;
|
package/lib/Router/Router.js
CHANGED
package/package.json
CHANGED
package/src/Router/Response.ts
CHANGED
|
@@ -6,6 +6,7 @@ export class Response {
|
|
|
6
6
|
content?: any | null | undefined;
|
|
7
7
|
headers: { [key: string]: any } = {};
|
|
8
8
|
events: any = { after: [] };
|
|
9
|
+
autoEnd: boolean = true;
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Mode
|
|
@@ -16,10 +17,20 @@ export class Response {
|
|
|
16
17
|
this.mode = options && options.mode ? options.mode : null;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Set Response-Auto-End
|
|
22
|
+
* @param status
|
|
23
|
+
* @returns Response
|
|
24
|
+
*/
|
|
25
|
+
setAutoEnd(status: boolean) {
|
|
26
|
+
this.autoEnd = status;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
/**
|
|
20
31
|
* Sets the ServerResponse (res) Object (nodejs/http module)
|
|
21
32
|
* @param res
|
|
22
|
-
* @returns
|
|
33
|
+
* @returns Response
|
|
23
34
|
*/
|
|
24
35
|
setServerResponse(res: ServerResponse) {
|
|
25
36
|
this.res = res;
|
|
@@ -30,7 +41,7 @@ export class Response {
|
|
|
30
41
|
* Set the http-status-code
|
|
31
42
|
*
|
|
32
43
|
* @param status
|
|
33
|
-
* @returns
|
|
44
|
+
* @returns Response
|
|
34
45
|
*/
|
|
35
46
|
status(status: number): Response {
|
|
36
47
|
this.statusCode = status;
|
|
@@ -48,7 +59,7 @@ export class Response {
|
|
|
48
59
|
*
|
|
49
60
|
* @param type
|
|
50
61
|
* @param value
|
|
51
|
-
* @returns
|
|
62
|
+
* @returns Response
|
|
52
63
|
*/
|
|
53
64
|
header(type: string, value: string) {
|
|
54
65
|
this.headers[type] = value;
|
|
@@ -66,6 +77,7 @@ export class Response {
|
|
|
66
77
|
* Any objects will be stringified to JSON
|
|
67
78
|
*
|
|
68
79
|
* @param content
|
|
80
|
+
* @returns Response
|
|
69
81
|
*/
|
|
70
82
|
send(content: any) {
|
|
71
83
|
this.content = content;
|
package/src/Router/Router.ts
CHANGED