@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.
Files changed (38) hide show
  1. package/dist/cjs/SimpleBootHttpServer.js +14 -2
  2. package/dist/cjs/SimpleBootHttpServer.js.map +2 -2
  3. package/dist/cjs/bundle-entry.js +34 -24
  4. package/dist/cjs/bundle-entry.js.map +2 -2
  5. package/dist/cjs/option/HttpServerOption.js.map +2 -2
  6. package/dist/cjs/proxy/TopicProtocolApiServiceProxy.js +244 -266
  7. package/dist/cjs/proxy/TopicProtocolApiServiceProxy.js.map +3 -3
  8. package/dist/cjs/websocket/WebSocketClient.js +2 -1
  9. package/dist/cjs/websocket/WebSocketClient.js.map +2 -2
  10. package/dist/esm/SimpleBootHttpServer.js +14 -2
  11. package/dist/esm/SimpleBootHttpServer.js.map +2 -2
  12. package/dist/esm/bundle-entry.js +14 -12
  13. package/dist/esm/bundle-entry.js.map +2 -2
  14. package/dist/esm/option/HttpServerOption.js.map +2 -2
  15. package/dist/esm/proxy/TopicProtocolApiServiceProxy.js +244 -266
  16. package/dist/esm/proxy/TopicProtocolApiServiceProxy.js.map +3 -3
  17. package/dist/esm/websocket/WebSocketClient.js +3 -2
  18. package/dist/esm/websocket/WebSocketClient.js.map +2 -2
  19. package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js +19393 -9581
  20. package/dist/esm-bundle/dooboostore-simple-boot-http-server.esm.js.map +4 -4
  21. package/dist/types/SimpleBootHttpServer.d.ts.map +1 -1
  22. package/dist/types/bundle-entry.d.ts +7 -12
  23. package/dist/types/bundle-entry.d.ts.map +1 -1
  24. package/dist/types/option/HttpServerOption.d.ts +6 -2
  25. package/dist/types/option/HttpServerOption.d.ts.map +1 -1
  26. package/dist/types/proxy/TopicProtocolApiServiceProxy.d.ts +5 -15
  27. package/dist/types/proxy/TopicProtocolApiServiceProxy.d.ts.map +1 -1
  28. package/dist/types/websocket/WebSocketClient.d.ts.map +1 -1
  29. package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js +19437 -9631
  30. package/dist/umd-bundle/dooboostore-simple-boot-http-server.umd.js.map +4 -4
  31. package/dist/umd-bundle/websocket-client.umd.js +207 -1477
  32. package/dist/umd-bundle/websocket-client.umd.js.map +4 -4
  33. package/package.json +8 -8
  34. package/src/SimpleBootHttpServer.ts +16 -2
  35. package/src/bundle-entry.ts +12 -12
  36. package/src/option/HttpServerOption.ts +4 -2
  37. package/src/proxy/TopicProtocolApiServiceProxy.ts +260 -275
  38. 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.25",
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
- const execute = (typeof it === 'function' ? this.simstanceManager.getOrNewSim({target: it}) : it) as Filter;
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});
@@ -1,12 +1,12 @@
1
- export * from './codes';
2
- export * from './decorators';
3
- export * from './endpoints';
4
- export * from './errors';
5
- export * from './filters';
6
- export * from './inject';
7
- export * from './lifecycle';
8
- export * from './models';
9
- export * from './option';
10
- export * from './resolvers';
11
- export * from './session';
12
- export * from './SimpleBootHttpServer';
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?: (Filter | ConstructorType<Filter>)[];
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?: (Filter | ConstructorType<Filter>)[];
71
+ filters?: (FilterSupportType)[];
70
72
  requestEndPoints?: (EndPoint | ConstructorType<EndPoint>)[];
71
73
  closeEndPoints?: (EndPoint | ConstructorType<EndPoint>)[];
72
74
  errorEndPoints?: (EndPoint | ConstructorType<EndPoint>)[];