@dooboostore/simple-boot-http-server 1.0.25 → 1.0.26
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/dist/cjs/SimpleBootHttpServer.js +14 -2
- package/dist/cjs/SimpleBootHttpServer.js.map +2 -2
- package/dist/cjs/bundle-entry.js +34 -24
- package/dist/cjs/bundle-entry.js.map +2 -2
- package/dist/cjs/option/HttpServerOption.js.map +2 -2
- package/dist/cjs/proxy/TopicProtocolApiServiceProxy.js +244 -266
- package/dist/cjs/proxy/TopicProtocolApiServiceProxy.js.map +3 -3
- package/dist/cjs/websocket/WebSocketClient.js +2 -1
- package/dist/cjs/websocket/WebSocketClient.js.map +2 -2
- package/dist/esm/SimpleBootHttpServer.js +14 -2
- package/dist/esm/SimpleBootHttpServer.js.map +2 -2
- package/dist/esm/bundle-entry.js +14 -12
- package/dist/esm/bundle-entry.js.map +2 -2
- package/dist/esm/option/HttpServerOption.js.map +2 -2
- package/dist/esm/proxy/TopicProtocolApiServiceProxy.js +244 -266
- package/dist/esm/proxy/TopicProtocolApiServiceProxy.js.map +3 -3
- package/dist/esm/websocket/WebSocketClient.js +3 -2
- package/dist/esm/websocket/WebSocketClient.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js +19393 -9581
- package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js.map +4 -4
- package/dist/types/SimpleBootHttpServer.d.ts.map +1 -1
- package/dist/types/bundle-entry.d.ts +7 -12
- package/dist/types/bundle-entry.d.ts.map +1 -1
- package/dist/types/option/HttpServerOption.d.ts +6 -2
- package/dist/types/option/HttpServerOption.d.ts.map +1 -1
- package/dist/types/proxy/TopicProtocolApiServiceProxy.d.ts +5 -15
- package/dist/types/proxy/TopicProtocolApiServiceProxy.d.ts.map +1 -1
- package/dist/types/websocket/WebSocketClient.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js +19437 -9631
- package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js.map +4 -4
- package/dist/umd-bundle/websocket-client.umd.js +207 -1477
- package/dist/umd-bundle/websocket-client.umd.js.map +4 -4
- package/package.json +8 -8
- package/src/SimpleBootHttpServer.ts +16 -2
- package/src/bundle-entry.ts +12 -12
- package/src/option/HttpServerOption.ts +4 -2
- package/src/proxy/TopicProtocolApiServiceProxy.ts +260 -275
- package/src/websocket/WebSocketClient.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dooboostore/simple-boot-http-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -67,7 +67,12 @@
|
|
|
67
67
|
"url": "https://github.com/dooboostore-develop/packages"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"reflect-metadata": "^0.2.2"
|
|
70
|
+
"reflect-metadata": "^0.2.2",
|
|
71
|
+
"@dooboostore/core": "1.0.32",
|
|
72
|
+
"@dooboostore/core-node": "1.0.13",
|
|
73
|
+
"@dooboostore/core-web": "1.0.13",
|
|
74
|
+
"@dooboostore/dom-render": "1.0.114",
|
|
75
|
+
"@dooboostore/simple-boot": "1.0.57"
|
|
71
76
|
},
|
|
72
77
|
"devDependencies": {
|
|
73
78
|
"@babel/core": "^7.24.0",
|
|
@@ -91,12 +96,7 @@
|
|
|
91
96
|
"typescript": "^5.9.2",
|
|
92
97
|
"webpack": "^5.93.0",
|
|
93
98
|
"webpack-cli": "^5.1.4",
|
|
94
|
-
"webpack-dev-server": "^5.2.0"
|
|
95
|
-
"@dooboostore/core-node": "1.0.12",
|
|
96
|
-
"@dooboostore/core": "1.0.32",
|
|
97
|
-
"@dooboostore/core-web": "1.0.12",
|
|
98
|
-
"@dooboostore/simple-boot": "1.0.56",
|
|
99
|
-
"@dooboostore/dom-render": "1.0.113"
|
|
99
|
+
"webpack-dev-server": "^5.2.0"
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
102
|
"fast-json-patch": "^3.1.0",
|
|
@@ -48,7 +48,7 @@ export class SimpleBootHttpServer extends SimpleApplication {
|
|
|
48
48
|
otherInstanceSim ??= new Map<ConstructorType<any> | Function | SimConfig | symbol, any>();
|
|
49
49
|
otherInstanceSim.set(SimpleBootHttpServer, this);
|
|
50
50
|
super.run(otherInstanceSim);
|
|
51
|
-
const targets = [...this.option.closeEndPoints ?? [], ...this.option.errorEndPoints ?? [], ...this.option.requestEndPoints ?? [], ...this.option.filters ?? []];
|
|
51
|
+
const targets = [...this.option.closeEndPoints ?? [], ...this.option.errorEndPoints ?? [], ...this.option.requestEndPoints ?? [], ...(this.option.filters ?? []).map(it=>it.filter)];
|
|
52
52
|
Promise.all(targets.map(it => (typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it as ConstructorType<any>}) : it) as OnInit).map(it => it.onInit(this))).then(it => {
|
|
53
53
|
this.startServer();
|
|
54
54
|
});
|
|
@@ -158,8 +158,22 @@ export class SimpleBootHttpServer extends SimpleApplication {
|
|
|
158
158
|
};
|
|
159
159
|
for (let i = 0; this.option.filters && i < this.option.filters.length; i++) {
|
|
160
160
|
const it = this.option.filters[i];
|
|
161
|
-
|
|
161
|
+
|
|
162
|
+
let isSkip = false;
|
|
163
|
+
if (typeof it.isSupport === 'boolean') {
|
|
164
|
+
isSkip = !it.isSupport;
|
|
165
|
+
} else if (typeof it.isSupport === 'object') {
|
|
166
|
+
isSkip = !it.isSupport.test(rr.reqUrlPathName)
|
|
167
|
+
} else if (typeof it.isSupport === 'function') {
|
|
168
|
+
isSkip = !it.isSupport(rr);
|
|
169
|
+
}
|
|
170
|
+
if(isSkip) {
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
|
|
162
174
|
let sw = true;
|
|
175
|
+
const itFilter = it.filter;
|
|
176
|
+
const execute = (typeof itFilter === 'function' ? this.simstanceManager.getOrNewSim({target: itFilter}) : itFilter) as Filter;
|
|
163
177
|
if (execute?.proceedBefore) {
|
|
164
178
|
sw = await execute.proceedBefore({rr, app: this, carrier: filter.carrier});
|
|
165
179
|
filter.filters.push({filter: execute, sw});
|
package/src/bundle-entry.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from './
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
|
|
3
|
+
// simple-boot-http-server itself
|
|
4
|
+
export * from './index';
|
|
5
|
+
|
|
6
|
+
// Re-export peer dependencies so bundle consumers can access them
|
|
7
|
+
// without separately importing each package
|
|
8
|
+
export * as Core from '@dooboostore/core';
|
|
9
|
+
export * as CoreNode from '@dooboostore/core-node';
|
|
10
|
+
export * as CoreWeb from '@dooboostore/core-web';
|
|
11
|
+
export * as DomRender from '@dooboostore/dom-render';
|
|
12
|
+
export * as SimpleBoot from '@dooboostore/simple-boot';
|
|
@@ -33,12 +33,14 @@ export type SessionOption = {
|
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
export type FilterSupportType = { filter: Filter | ConstructorType<Filter>, isSupport: boolean | ((rr: RequestResponse) => boolean) | RegExp };
|
|
37
|
+
|
|
36
38
|
export class HttpServerOption extends SimOption {
|
|
37
39
|
public static readonly DEFAULT_PORT = 8081;
|
|
38
40
|
public static readonly DEFAULT_HOSTNAME = '127.0.0.1';
|
|
39
41
|
public serverOption?: ServerOptions | HttpsServerOption;
|
|
40
42
|
public listen: ListenData;
|
|
41
|
-
public filters?:
|
|
43
|
+
public filters?: FilterSupportType[];
|
|
42
44
|
public fileUploadTempPath?: string;
|
|
43
45
|
public requestEndPoints?: (EndPoint | ConstructorType<EndPoint>)[];
|
|
44
46
|
public webSocketEndPoints?: (WebSocketEndPoint | ConstructorType<WebSocketEndPoint>)[];
|
|
@@ -66,7 +68,7 @@ export class HttpServerOption extends SimOption {
|
|
|
66
68
|
}: {
|
|
67
69
|
serverOption?: ServerOptions | HttpsServerOption;
|
|
68
70
|
listen?: Listen;
|
|
69
|
-
filters?: (
|
|
71
|
+
filters?: (FilterSupportType)[];
|
|
70
72
|
requestEndPoints?: (EndPoint | ConstructorType<EndPoint>)[];
|
|
71
73
|
closeEndPoints?: (EndPoint | ConstructorType<EndPoint>)[];
|
|
72
74
|
errorEndPoints?: (EndPoint | ConstructorType<EndPoint>)[];
|