@dooboostore/simple-boot-http-server 1.0.20 → 1.0.21

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.
@@ -3,13 +3,12 @@ import { HttpServerOption } from './option/HttpServerOption';
3
3
  import { ConstructorType } from '@dooboostore/core/types';
4
4
  import { Server as HttpServer } from 'http';
5
5
  import { Server as HttpsServer } from 'https';
6
- import { SimstanceManager } from '@dooboostore/simple-boot/simstance/SimstanceManager';
7
6
  export declare class SimpleBootHttpServer extends SimpleApplication {
8
7
  option: HttpServerOption;
9
8
  server?: HttpServer | HttpsServer;
10
9
  private sessionManager;
11
10
  constructor(option?: HttpServerOption);
12
- run(otherInstanceSim?: Map<ConstructorType<any>, any>): SimstanceManager;
11
+ run(otherInstanceSim?: Map<ConstructorType<any>, any>): this;
13
12
  private startServer;
14
13
  }
15
14
  //# sourceMappingURL=SimpleBootHttpServer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleBootHttpServer.d.ts","sourceRoot":"","sources":["../../src/SimpleBootHttpServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAmB,MAAM,IAAI,UAAU,EAAkB,MAAM,MAAM,CAAA;AAC5E,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,OAAO,CAAC;AAO9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAoBvF,qBAAa,oBAAqB,SAAQ,iBAAiB;IAGpC,MAAM,EAAE,gBAAgB;IAFpC,MAAM,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IACzC,OAAO,CAAC,cAAc,CAAiB;gBACpB,MAAM,GAAE,gBAAyC;IAM7D,GAAG,CAAC,gBAAgB,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IAS5D,OAAO,CAAC,WAAW;CAwRtB"}
1
+ {"version":3,"file":"SimpleBootHttpServer.d.ts","sourceRoot":"","sources":["../../src/SimpleBootHttpServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAmB,MAAM,IAAI,UAAU,EAAkB,MAAM,MAAM,CAAA;AAC5E,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,OAAO,CAAC;AA0B9C,qBAAa,oBAAqB,SAAQ,iBAAiB;IAGpC,MAAM,EAAE,gBAAgB;IAFpC,MAAM,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IACzC,OAAO,CAAC,cAAc,CAAiB;gBACpB,MAAM,GAAE,gBAAyC;IAM7D,GAAG,CAAC,gBAAgB,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IAS5D,OAAO,CAAC,WAAW;CAwRtB"}
@@ -36,9 +36,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
36
36
  ));
37
37
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
38
 
39
- // ../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json
39
+ // ../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json
40
40
  var require_db = __commonJS({
41
- "../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json"(exports, module) {
41
+ "../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/db.json"(exports, module) {
42
42
  module.exports = {
43
43
  "application/1d-interleaved-parityfec": {
44
44
  source: "iana"
@@ -8561,16 +8561,16 @@ var dooboostoreSimpleBootHttpServer = (() => {
8561
8561
  }
8562
8562
  });
8563
8563
 
8564
- // ../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js
8564
+ // ../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js
8565
8565
  var require_mime_db = __commonJS({
8566
- "../../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js"(exports, module) {
8566
+ "../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js"(exports, module) {
8567
8567
  module.exports = require_db();
8568
8568
  }
8569
8569
  });
8570
8570
 
8571
- // ../../../node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js
8571
+ // ../../node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js
8572
8572
  var require_mime_types = __commonJS({
8573
- "../../../node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js"(exports) {
8573
+ "../../node_modules/.pnpm/mime-types@2.1.35/node_modules/mime-types/index.js"(exports) {
8574
8574
  "use strict";
8575
8575
  var db = require_mime_db();
8576
8576
  var extname = __require("path").extname;
@@ -8658,9 +8658,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
8658
8658
  }
8659
8659
  });
8660
8660
 
8661
- // ../../../node_modules/.pnpm/node-gzip@1.1.2/node_modules/node-gzip/dist/index.js
8661
+ // ../../node_modules/.pnpm/node-gzip@1.1.2/node_modules/node-gzip/dist/index.js
8662
8662
  var require_dist = __commonJS({
8663
- "../../../node_modules/.pnpm/node-gzip@1.1.2/node_modules/node-gzip/dist/index.js"(exports, module) {
8663
+ "../../node_modules/.pnpm/node-gzip@1.1.2/node_modules/node-gzip/dist/index.js"(exports, module) {
8664
8664
  "use strict";
8665
8665
  var zlib = __require("zlib");
8666
8666
  module.exports = {
@@ -8686,9 +8686,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
8686
8686
  }
8687
8687
  });
8688
8688
 
8689
- // ../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/helpers.js
8689
+ // ../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/helpers.js
8690
8690
  var require_helpers = __commonJS({
8691
- "../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/helpers.js"(exports) {
8691
+ "../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/helpers.js"(exports) {
8692
8692
  var __extends = exports && exports.__extends || /* @__PURE__ */ function() {
8693
8693
  var extendStatics = function(d, b) {
8694
8694
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
@@ -8854,9 +8854,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
8854
8854
  }
8855
8855
  });
8856
8856
 
8857
- // ../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/core.js
8857
+ // ../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/core.js
8858
8858
  var require_core = __commonJS({
8859
- "../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/core.js"(exports) {
8859
+ "../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/core.js"(exports) {
8860
8860
  Object.defineProperty(exports, "__esModule", { value: true });
8861
8861
  var helpers_js_1 = require_helpers();
8862
8862
  exports.JsonPatchError = helpers_js_1.PatchError;
@@ -9187,9 +9187,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
9187
9187
  }
9188
9188
  });
9189
9189
 
9190
- // ../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/duplex.js
9190
+ // ../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/duplex.js
9191
9191
  var require_duplex = __commonJS({
9192
- "../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/duplex.js"(exports) {
9192
+ "../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/commonjs/duplex.js"(exports) {
9193
9193
  Object.defineProperty(exports, "__esModule", { value: true });
9194
9194
  var helpers_js_1 = require_helpers();
9195
9195
  var core_js_1 = require_core();
@@ -9361,9 +9361,9 @@ var dooboostoreSimpleBootHttpServer = (() => {
9361
9361
  }
9362
9362
  });
9363
9363
 
9364
- // ../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/index.js
9364
+ // ../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/index.js
9365
9365
  var require_fast_json_patch = __commonJS({
9366
- "../../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/index.js"(exports) {
9366
+ "../../node_modules/.pnpm/fast-json-patch@3.1.1/node_modules/fast-json-patch/index.js"(exports) {
9367
9367
  var core = require_core();
9368
9368
  Object.assign(exports, core);
9369
9369
  var duplex = require_duplex();
@@ -13832,7 +13832,6 @@ var dooboostoreSimpleBootHttpServer = (() => {
13832
13832
  this.setStoreSet(option.constructor, option);
13833
13833
  this.setStoreSet(SimOption, option);
13834
13834
  this.simProxyHandler = new SimProxyHandler(this.simpleApplication, this, option);
13835
- console.log("simstanceManager constructor", this.name);
13836
13835
  }
13837
13836
  get storage() {
13838
13837
  return this._storage;
@@ -14543,7 +14542,7 @@ var dooboostoreSimpleBootHttpServer = (() => {
14543
14542
  get observable() {
14544
14543
  return this.subject.asObservable();
14545
14544
  }
14546
- routingMap(prefix = "", option) {
14545
+ routingMap(option) {
14547
14546
  const targetRouter = option?.router ?? this.simOption.rootRouter;
14548
14547
  if (!targetRouter) {
14549
14548
  throw new Error("no router");
@@ -14555,7 +14554,7 @@ var dooboostoreSimpleBootHttpServer = (() => {
14555
14554
  const routerAtomic = new SimAtomic({ targetKeyType: targetType, originalType: targetType, value: targetValue }, this.simstanceManager);
14556
14555
  const routerData = routerAtomic.getConfig(RouterMetadataKey);
14557
14556
  if (routerData) {
14558
- const currentPrefix = prefix + routerData.path;
14557
+ const currentPrefix = (option?.prefix ?? "") + routerData.path;
14559
14558
  if (routerData.route && routerData.route[""]) {
14560
14559
  map[currentPrefix] = routerData.route[""];
14561
14560
  }
@@ -14565,7 +14564,7 @@ var dooboostoreSimpleBootHttpServer = (() => {
14565
14564
  });
14566
14565
  }
14567
14566
  routerData.routers?.forEach((it) => {
14568
- Object.assign(map, this.routingMap(currentPrefix, { ...option, router: it }));
14567
+ Object.assign(map, this.routingMap({ ...option, router: it, prefix: currentPrefix }));
14569
14568
  });
14570
14569
  }
14571
14570
  }
@@ -14998,7 +14997,7 @@ var dooboostoreSimpleBootHttpServer = (() => {
14998
14997
  }
14999
14998
  run(otherInstanceSim) {
15000
14999
  this.simstanceManager.run(otherInstanceSim);
15001
- return this.simstanceManager;
15000
+ return this;
15002
15001
  }
15003
15002
  simAtomic(type) {
15004
15003
  if (typeof type === "symbol") {
@@ -15120,12 +15119,12 @@ var dooboostoreSimpleBootHttpServer = (() => {
15120
15119
  this.sessionManager = new SessionManager(this.option);
15121
15120
  }
15122
15121
  run(otherInstanceSim) {
15123
- const simstanceManager = super.run(otherInstanceSim);
15122
+ super.run(otherInstanceSim);
15124
15123
  const targets = [...this.option.closeEndPoints ?? [], ...this.option.errorEndPoints ?? [], ...this.option.requestEndPoints ?? [], ...this.option.filters ?? []];
15125
15124
  Promise.all(targets.map((it) => typeof it === "function" ? this.simstanceManager.getOrNewSim({ target: it }) : it).map((it) => it.onInit(this))).then((it) => {
15126
15125
  this.startServer();
15127
15126
  });
15128
- return simstanceManager;
15127
+ return this;
15129
15128
  }
15130
15129
  startServer() {
15131
15130
  if (this.option.serverOption && "key" in this.option.serverOption && "cert" in this.option.serverOption) {