@pristine-ts/http 1.0.440 → 2.0.2

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 (40) hide show
  1. package/dist/lib/cjs/commands/file-server.command.js +1 -1
  2. package/dist/lib/cjs/commands/file-server.command.js.map +1 -1
  3. package/dist/lib/cjs/http.configuration-keys.js +24 -0
  4. package/dist/lib/cjs/http.configuration-keys.js.map +1 -0
  5. package/dist/lib/cjs/http.module.js +73 -0
  6. package/dist/lib/cjs/http.module.js.map +1 -1
  7. package/dist/lib/cjs/interceptors/http-error-response-logging.interceptor.js +2 -1
  8. package/dist/lib/cjs/interceptors/http-error-response-logging.interceptor.js.map +1 -1
  9. package/dist/lib/cjs/interceptors/http-request-logging.interceptor.js +2 -1
  10. package/dist/lib/cjs/interceptors/http-request-logging.interceptor.js.map +1 -1
  11. package/dist/lib/cjs/interceptors/http-response-logging.interceptor.js +2 -1
  12. package/dist/lib/cjs/interceptors/http-response-logging.interceptor.js.map +1 -1
  13. package/dist/lib/cjs/servers/kernel.http-server.js +329 -0
  14. package/dist/lib/cjs/servers/kernel.http-server.js.map +1 -0
  15. package/dist/lib/cjs/servers/servers.js +1 -0
  16. package/dist/lib/cjs/servers/servers.js.map +1 -1
  17. package/dist/lib/cjs/tsconfig.cjs.tsbuildinfo +1 -0
  18. package/dist/lib/esm/commands/file-server.command.js +1 -1
  19. package/dist/lib/esm/commands/file-server.command.js.map +1 -1
  20. package/dist/lib/esm/http.configuration-keys.js +21 -0
  21. package/dist/lib/esm/http.configuration-keys.js.map +1 -0
  22. package/dist/lib/esm/http.module.js +73 -0
  23. package/dist/lib/esm/http.module.js.map +1 -1
  24. package/dist/lib/esm/interceptors/http-error-response-logging.interceptor.js +3 -2
  25. package/dist/lib/esm/interceptors/http-error-response-logging.interceptor.js.map +1 -1
  26. package/dist/lib/esm/interceptors/http-request-logging.interceptor.js +3 -2
  27. package/dist/lib/esm/interceptors/http-request-logging.interceptor.js.map +1 -1
  28. package/dist/lib/esm/interceptors/http-response-logging.interceptor.js +3 -2
  29. package/dist/lib/esm/interceptors/http-response-logging.interceptor.js.map +1 -1
  30. package/dist/lib/esm/servers/kernel.http-server.js +323 -0
  31. package/dist/lib/esm/servers/kernel.http-server.js.map +1 -0
  32. package/dist/lib/esm/servers/servers.js +1 -0
  33. package/dist/lib/esm/servers/servers.js.map +1 -1
  34. package/dist/lib/esm/tsconfig.tsbuildinfo +1 -0
  35. package/dist/types/commands/file-server.command.d.ts +1 -1
  36. package/dist/types/http.configuration-keys.d.ts +43 -0
  37. package/dist/types/http.module.d.ts +1 -0
  38. package/dist/types/servers/kernel.http-server.d.ts +104 -0
  39. package/dist/types/servers/servers.d.ts +1 -0
  40. package/package.json +5 -5
@@ -30,7 +30,7 @@ let FileServerCommand = class FileServerCommand {
30
30
  constructor(consoleManager, fileHttpServer) {
31
31
  this.consoleManager = consoleManager;
32
32
  this.fileHttpServer = fileHttpServer;
33
- this.optionsType = new file_server_command_options_1.FileServerCommandOptions();
33
+ this.optionsType = file_server_command_options_1.FileServerCommandOptions;
34
34
  this.name = "file-server:start";
35
35
  }
36
36
  run(args) {
@@ -1 +1 @@
1
- {"version":3,"file":"file-server.command.js","sourceRoot":"","sources":["../../../../src/commands/file-server.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,4BAAyB;AACzB,gDAAgF;AAChF,gEAAyD;AACzD,uCAAoC;AACpC,0CAAgF;AAChF,kEAA2D;AAC3D,+EAAuE;AAKhE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAI5B,YACmB,cAA8B,EAC9B,cAA8B;QAD9B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,mBAAc,GAAd,cAAc,CAAgB;QALjD,gBAAW,GAA6B,IAAI,sDAAwB,EAAE,CAAA;QACtE,SAAI,GAAG,mBAAmB,CAAC;IAK3B,CAAC;IAEK,GAAG,CAAC,IAA8B;;;YACtC,MAAM,cAAc,GAAgC,EA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I,IAAI,GAAG,CAAC,CAAC;YAChG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;gBACT,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,qBAAqB,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;YAChE,CAAC,EACD,cAAc,CAAC,CAAC;YAElB,OAAO,kBAAY,CAAC,OAAO,CAAC;QAC9B,CAAC;KAAA;CACF,CAAA;AA/BY,8CAAiB;4BAAjB,iBAAiB;IAH7B,IAAA,YAAG,EAAC,iCAAwB,CAAC,OAAO,CAAC;IACrC,IAAA,qBAAY,EAAC,uCAAiB,CAAC;IAC/B,IAAA,qBAAU,GAAE;qCAMwB,oBAAc;QACd,iCAAc;GANtC,iBAAiB,CA+B7B"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpConfigurationKeys = void 0;
4
+ /**
5
+ * Typed configuration keys for `@pristine-ts/http`. Use these constants with `@injectConfig`
6
+ * for autocomplete + rename safety, instead of typing the parameter name as a string.
7
+ *
8
+ * ```ts
9
+ * import {injectConfig} from "@pristine-ts/common";
10
+ * import {HttpConfigurationKeys} from "@pristine-ts/http";
11
+ *
12
+ * constructor(@injectConfig(HttpConfigurationKeys.LoggingEnabled) value: ...) {}
13
+ * ```
14
+ */
15
+ exports.HttpConfigurationKeys = {
16
+ LoggingEnabled: "pristine.http.logging-enabled",
17
+ HttpServerFileAddress: "pristine.http.http-server.file.address",
18
+ HttpServerFilePort: "pristine.http.http-server.file.port",
19
+ KernelServerAddress: "pristine.http.kernel-server.address",
20
+ KernelServerPort: "pristine.http.kernel-server.port",
21
+ KernelServerTlsKeyPath: "pristine.http.kernel-server.tls.key-path",
22
+ KernelServerTlsCertPath: "pristine.http.kernel-server.tls.cert-path",
23
+ };
24
+ //# sourceMappingURL=http.configuration-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.configuration-keys.js","sourceRoot":"","sources":["../../../src/http.configuration-keys.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACU,QAAA,qBAAqB,GAAG;IACnC,cAAc,EAAE,+BAA+B;IAC/C,qBAAqB,EAAE,wCAAwC;IAC/D,kBAAkB,EAAE,qCAAqC;IACzD,mBAAmB,EAAE,qCAAqC;IAC1D,gBAAgB,EAAE,kCAAkC;IACpD,sBAAsB,EAAE,0CAA0C;IAClE,uBAAuB,EAAE,2CAA2C;CAC5D,CAAC"}
@@ -13,12 +13,22 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
16
25
  Object.defineProperty(exports, "__esModule", { value: true });
17
26
  exports.HttpModule = void 0;
18
27
  const http_module_keyname_1 = require("./http.module.keyname");
19
28
  const logging_1 = require("@pristine-ts/logging");
20
29
  const configuration_1 = require("@pristine-ts/configuration");
21
30
  const cli_1 = require("@pristine-ts/cli");
31
+ const kernel_http_server_1 = require("./servers/kernel.http-server");
22
32
  __exportStar(require("./http.module.keyname"), exports);
23
33
  __exportStar(require("./commands/commands"), exports);
24
34
  __exportStar(require("./clients/clients"), exports);
@@ -30,6 +40,7 @@ __exportStar(require("./options/options"), exports);
30
40
  __exportStar(require("./servers/servers"), exports);
31
41
  __exportStar(require("./utils/utils"), exports);
32
42
  __exportStar(require("./wrappers/wrappers"), exports);
43
+ __exportStar(require("./http.configuration-keys"), exports);
33
44
  exports.HttpModule = {
34
45
  keyname: http_module_keyname_1.HttpModuleKeyname,
35
46
  importModules: [logging_1.LoggingModule, cli_1.CliModule],
@@ -58,6 +69,68 @@ exports.HttpModule = {
58
69
  new configuration_1.NumberResolver(new configuration_1.EnvironmentVariableResolver("PRISTINE_HTTP_SERVER_FILE_PORT")),
59
70
  ]
60
71
  },
72
+ /**
73
+ * Address the kernel-routed HTTP server (started by `pristine start`) binds to. Defaults
74
+ * to `0.0.0.0` so the server is reachable from outside the container — typical for prod.
75
+ * Set to `127.0.0.1` for local-only.
76
+ */
77
+ {
78
+ parameterName: `${http_module_keyname_1.HttpModuleKeyname}.kernel-server.address`,
79
+ defaultValue: "0.0.0.0",
80
+ isRequired: false,
81
+ defaultResolvers: [
82
+ new configuration_1.EnvironmentVariableResolver("PRISTINE_HTTP_KERNEL_SERVER_ADDRESS"),
83
+ ]
84
+ },
85
+ /**
86
+ * Port the kernel-routed HTTP server listens on. Defaults to 3000 (matches the convention
87
+ * used by Express, Nest, and most Node frameworks).
88
+ */
89
+ {
90
+ parameterName: `${http_module_keyname_1.HttpModuleKeyname}.kernel-server.port`,
91
+ defaultValue: 3000,
92
+ isRequired: false,
93
+ defaultResolvers: [
94
+ new configuration_1.NumberResolver(new configuration_1.EnvironmentVariableResolver("PRISTINE_HTTP_KERNEL_SERVER_PORT")),
95
+ ]
96
+ },
97
+ /**
98
+ * Path to the TLS private key (PEM). Setting this AND `tls.cert-path` switches the kernel
99
+ * server from `http.Server` to `https.Server`. Empty string (the default) means "no TLS".
100
+ */
101
+ {
102
+ parameterName: `${http_module_keyname_1.HttpModuleKeyname}.kernel-server.tls.key-path`,
103
+ defaultValue: "",
104
+ isRequired: false,
105
+ defaultResolvers: [
106
+ new configuration_1.EnvironmentVariableResolver("PRISTINE_HTTP_KERNEL_SERVER_TLS_KEY_PATH"),
107
+ ]
108
+ },
109
+ /**
110
+ * Path to the TLS certificate (PEM). See `tls.key-path` — both must be set together.
111
+ */
112
+ {
113
+ parameterName: `${http_module_keyname_1.HttpModuleKeyname}.kernel-server.tls.cert-path`,
114
+ defaultValue: "",
115
+ isRequired: false,
116
+ defaultResolvers: [
117
+ new configuration_1.EnvironmentVariableResolver("PRISTINE_HTTP_KERNEL_SERVER_TLS_CERT_PATH"),
118
+ ]
119
+ },
61
120
  ],
121
+ onShutdown: (container) => __awaiter(void 0, void 0, void 0, function* () {
122
+ // The KernelHttpServer self-tracks whether `start()` was actually called: if pristine start
123
+ // never resolved it (e.g. an HTTP-less command like `pristine p:list` ran), stop() is a
124
+ // no-op. So we can resolve unconditionally without worrying about creating a stray server.
125
+ try {
126
+ const server = container.resolve(kernel_http_server_1.KernelHttpServer);
127
+ yield server.stop();
128
+ }
129
+ catch (_a) {
130
+ // KernelHttpServer's deps (the address/port config values) might not be resolvable if
131
+ // the container is in a degraded state during shutdown. Swallow — there's nothing useful
132
+ // we can do, and other modules' onShutdown should still run.
133
+ }
134
+ }),
62
135
  };
63
136
  //# sourceMappingURL=http.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../src/http.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,+DAAwD;AACxD,kDAAmD;AACnD,8DAAwG;AACxG,0CAA2C;AAE3C,wDAAsC;AACtC,sDAAoC;AACpC,oDAAkC;AAClC,gDAA8B;AAC9B,kDAAgC;AAChC,8DAA2C;AAC3C,0DAAuC;AACvC,oDAAkC;AAClC,oDAAkC;AAClC,gDAA8B;AAC9B,sDAAoC;AAEvB,QAAA,UAAU,GAAoB;IACzC,OAAO,EAAE,uCAAiB;IAC1B,aAAa,EAAE,CAAC,uBAAa,EAAE,eAAS,CAAC;IACzC,wBAAwB,EAAE;QACxB;YACE,aAAa,EAAE,GAAG,uCAAiB,kBAAkB;YACrD,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,gBAAgB,EAAE;gBAChB,IAAI,+BAAe,CAAC,IAAI,2CAA2B,CAAC,uBAAuB,CAAC,CAAC;aAC9E;SACF;QACD;YACE,aAAa,EAAE,GAAG,uCAAiB,2BAA2B;YAC9D,YAAY,EAAE,WAAW;YACzB,UAAU,EAAE,KAAK;YACjB,gBAAgB,EAAE;gBAChB,IAAI,2CAA2B,CAAC,mCAAmC,CAAC;aACrE;SACF;QACD;YACE,aAAa,EAAE,GAAG,uCAAiB,wBAAwB;YAC3D,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,gBAAgB,EAAE;gBAChB,IAAI,8BAAc,CAAC,IAAI,2CAA2B,CAAC,gCAAgC,CAAC,CAAC;aACtF;SACF;KACF;CACF,CAAA"}
1
+ {"version":3,"file":"http.module.js","sourceRoot":"","sources":["../../../src/http.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+DAAwD;AACxD,kDAAmD;AACnD,8DAAwG;AACxG,0CAA2C;AAC3C,qEAA8D;AAE9D,wDAAsC;AACtC,sDAAoC;AACpC,oDAAkC;AAClC,gDAA8B;AAC9B,kDAAgC;AAChC,8DAA2C;AAC3C,0DAAuC;AACvC,oDAAkC;AAClC,oDAAkC;AAClC,gDAA8B;AAC9B,sDAAoC;AAEpC,4DAA0C;AAC7B,QAAA,UAAU,GAAoB;IACzC,OAAO,EAAE,uCAAiB;IAC1B,aAAa,EAAE,CAAC,uBAAa,EAAE,eAAS,CAAC;IACzC,wBAAwB,EAAE;QACxB;YACE,aAAa,EAAE,GAAG,uCAAiB,kBAAkB;YACrD,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,gBAAgB,EAAE;gBAChB,IAAI,+BAAe,CAAC,IAAI,2CAA2B,CAAC,uBAAuB,CAAC,CAAC;aAC9E;SACF;QACD;YACE,aAAa,EAAE,GAAG,uCAAiB,2BAA2B;YAC9D,YAAY,EAAE,WAAW;YACzB,UAAU,EAAE,KAAK;Y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ACtB,CAAC;QAAC,WAAM,CAAC;YACP,sFAAsF;YACtF,yFAAyF;YACzF,6DAA6D;QAC/D,CAAC;IACH,CAAC,CAAA;CACF,CAAA"}
@@ -23,6 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.HttpErrorResponseLoggingInterceptor = void 0;
25
25
  const tsyringe_1 = require("tsyringe");
26
+ const http_configuration_keys_1 = require("../http.configuration-keys");
26
27
  const common_1 = require("@pristine-ts/common");
27
28
  const http_module_keyname_1 = require("../http.module.keyname");
28
29
  /**
@@ -64,7 +65,7 @@ exports.HttpErrorResponseLoggingInterceptor = HttpErrorResponseLoggingIntercepto
64
65
  (0, common_1.moduleScoped)(http_module_keyname_1.HttpModuleKeyname),
65
66
  (0, tsyringe_1.injectable)(),
66
67
  __param(0, (0, tsyringe_1.inject)("LogHandlerInterface")),
67
- __param(1, (0, tsyringe_1.inject)("%pristine.http.logging-enabled%")),
68
+ __param(1, (0, common_1.injectConfig)(http_configuration_keys_1.HttpConfigurationKeys.LoggingEnabled)),
68
69
  __metadata("design:paramtypes", [Object, Boolean])
69
70
  ], HttpErrorResponseLoggingInterceptor);
70
71
  //# sourceMappingURL=http-error-response-logging.interceptor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-error-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-error-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,gDAAgF;AAKhF,gEAAyD;AAGzD;;;;GAIG;AAII,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAC9C,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;;OAKG;IACG,sBAAsB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YACtH,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;gBAEtG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,QAAQ,EAAE,EAAE;oBACpG,UAAU,EAAE;wBACV,WAAW,EAAE,OAAO,CAAC,IAAI;wBACzB,cAAc,EAAE,OAAO,CAAC,OAAO;wBAC/B,YAAY,EAAE,QAAQ,CAAC,IAAI;wBAC3B,eAAe,EAAE,QAAQ,CAAC,OAAO;qBAClC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC;iBACxD,CAAC,CAAC;YACL,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CAEF,CAAA;AA9BY,kFAAmC;8CAAnC,mCAAmC;IAH/C,IAAA,YAAG,EAAC,iCAAwB,CAAC,4BAA4B,CAAC;IAC1D,IAAA,qBAAY,EAAC,uCAAiB,CAAC;IAC/B,IAAA,qBAAU,GAAE;IAGR,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,iCAAiC,CAAC,CAAA;;GAHjC,mCAAmC,CA8B/C"}
1
+ {"version":3,"file":"http-error-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-error-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,wEAAiE;AACjE,gDAA8F;AAK9F,gEAAyD;AAGzD;;;;GAIG;AAII,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAC9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ge
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.HttpRequestLoggingInterceptor = void 0;
25
25
  const tsyringe_1 = require("tsyringe");
26
+ const http_configuration_keys_1 = require("../http.configuration-keys");
26
27
  const common_1 = require("@pristine-ts/common");
27
28
  const http_module_keyname_1 = require("../http.module.keyname");
28
29
  /**
@@ -61,7 +62,7 @@ exports.HttpRequestLoggingInterceptor = HttpRequestLoggingInterceptor = __decora
61
62
  (0, common_1.moduleScoped)(http_module_keyname_1.HttpModuleKeyname),
62
63
  (0, tsyringe_1.injectable)(),
63
64
  __param(0, (0, tsyringe_1.inject)("LogHandlerInterface")),
64
- __param(1, (0, tsyringe_1.inject)("%pristine.http.logging-enabled%")),
65
+ __param(1, (0, common_1.injectConfig)(http_configuration_keys_1.HttpConfigurationKeys.LoggingEnabled)),
65
66
  __metadata("design:paramtypes", [Object, Boolean])
66
67
  ], HttpRequestLoggingInterceptor);
67
68
  //# sourceMappingURL=http-request-logging.interceptor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAE5C,gDAAgF;AAIhF,gEAAyD;AAEzD;;;;GAIG;AAII,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACxC,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;OAIG;IACG,gBAAgB,CAAC,OAA6B,EAAE,OAA2B;;YAC/E,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,6GAA6G;gBAC7G,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,0BAA0B,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE;oBACnF,UAAU,EAAE;wBACV,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,OAAO,EAAE,OAAO,CAAC,OAAO;qBACzB,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC;iBACvD,CAAC,CAAC;YACL,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;CACF,CAAA;AAzBY,sEAA6B;wCAA7B,6BAA6B;IAHzC,IAAA,YAAG,EAAC,iCAAwB,CAAC,sBAAsB,CAAC;IACpD,IAAA,qBAAY,EAAC,uCAAiB,CAAC;IAC/B,IAAA,qBAAU,GAAE;IAGR,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,iCAAiC,CAAC,CAAA;;GAHjC,6BAA6B,CAyBzC"}
1
+ {"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,wEAAiE;AAEjE,gDAA8F;AAI9F,gEAAyD;AAEzD;;;;GAIG;AAII,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACxC,YACkD,UAA+B,EACV,cAAuB;QAD5C,eAAU,GAAV,UAAU,CAAqB;QACV,mBAAc,GAAd,cAAc,CAAS;IAE9F,CAAC;IAED;;;;OAIG;IACG,gBAAgB,CAAC,OAA6B,EAAE,OAA2B;;YAC/E,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,6GAA6G;gBAC7G,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,0BAA0B,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE;oBACnF,UAAU,EAAE;wBACV,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,OAAO,EAAE,OAAO,CAAC,OAAO;qBACzB,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC;iBACvD,CAAC,CAAC;YACL,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;CACF,CAAA;AAzBY,sEAA6B;wCAA7B,6BAA6B;IAHzC,IAAA,YAAG,EAAC,iCAAwB,CAAC,sBAAsB,CAAC;IACpD,IAAA,qBAAY,EAAC,uCAAiB,CAAC;IAC/B,IAAA,qBAAU,GAAE;IAGR,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,qBAAY,EAAC,+CAAqB,CAAC,cAAc,CAAC,CAAA;;GAH1C,6BAA6B,CAyBzC"}
@@ -23,6 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.HttpResponseLoggingInterceptor = void 0;
25
25
  const tsyringe_1 = require("tsyringe");
26
+ const http_configuration_keys_1 = require("../http.configuration-keys");
26
27
  const common_1 = require("@pristine-ts/common");
27
28
  const http_module_keyname_1 = require("../http.module.keyname");
28
29
  /**
@@ -64,7 +65,7 @@ exports.HttpResponseLoggingInterceptor = HttpResponseLoggingInterceptor = __deco
64
65
  (0, common_1.moduleScoped)(http_module_keyname_1.HttpModuleKeyname),
65
66
  (0, tsyringe_1.injectable)(),
66
67
  __param(0, (0, tsyringe_1.inject)("LogHandlerInterface")),
67
- __param(1, (0, tsyringe_1.inject)("%pristine.http.logging-enabled%")),
68
+ __param(1, (0, common_1.injectConfig)(http_configuration_keys_1.HttpConfigurationKeys.LoggingEnabled)),
68
69
  __metadata("design:paramtypes", [Object, Boolean])
69
70
  ], HttpResponseLoggingInterceptor);
70
71
  //# sourceMappingURL=http-response-logging.interceptor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4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C,8BAA8B,CA8B1C"}
1
+ {"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,wEAAiE;AACjE,gDAA8F;AAM9F,gEAAyD;AAEzD;;;;GAIG;AAII,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YACkD,UAA+B,EACV,cAAuB;QAD5C,eAAU,GAAV,UAAU,CAAqB;QACV,mBAAc,GAAd,cAAc,CAAS;IAE9F,CAAC;IAED;;;;;OAKG;IACG,iBAAiB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YACjH,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;gBAEtG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,QAAQ,EAAE,EAAE;oBACpG,UAAU,EAAE;wBACV,WAAW,EAAE,OAAO,CAAC,IAAI;wBACzB,cAAc,EAAE,OAAO,CAAC,OAAO;wBAC/B,YAAY,EAAE,QAAQ,CAAC,IAAI;wBAC3B,eAAe,EAAE,QAAQ,CAAC,OAAO;qBAClC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC;iBACxD,CAAC,CAAC;YACL,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CAEF,CAAA;AA9BY,wEAA8B;yCAA9B,8BAA8B;IAH1C,IAAA,YAAG,EAAC,iCAAwB,CAAC,uBAAuB,CAAC;IACrD,IAAA,qBAAY,EAAC,uCAAiB,CAAC;IAC/B,IAAA,qBAAU,GAAE;IAGR,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,qBAAY,EAAC,+CAAqB,CAAC,cAAc,CAAC,CAAA;;GAH1C,8BAA8B,CA8B1C"}
@@ -0,0 +1,329 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ var __importDefault = (this && this.__importDefault) || function (mod) {
24
+ return (mod && mod.__esModule) ? mod : { "default": mod };
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.KernelHttpServer = void 0;
28
+ const tsyringe_1 = require("tsyringe");
29
+ const http_1 = __importDefault(require("http"));
30
+ const https_1 = __importDefault(require("https"));
31
+ const fs_1 = __importDefault(require("fs"));
32
+ const uuid_1 = require("uuid");
33
+ const core_1 = require("@pristine-ts/core");
34
+ const common_1 = require("@pristine-ts/common");
35
+ const http_module_keyname_1 = require("../http.module.keyname");
36
+ /**
37
+ * Wraps Node's `http.Server` (or `https.Server` when TLS config is present) and routes every
38
+ * incoming request through `kernel.handle()`. The kernel dispatches to the existing
39
+ * `RequestEventHandler` from `@pristine-ts/networking`, which finds the matching controller
40
+ * via the `Router` — so all the routing/auth/interceptor logic the consumer already has on
41
+ * their controllers Just Works without any new framework concepts.
42
+ *
43
+ * Designed to be the runtime entry point for `pristine start`. Lifecycle:
44
+ * - `start({port, address, tls?})` creates the underlying server and binds.
45
+ * - `stop()` calls `server.close()`, which lets in-flight requests finish but refuses new
46
+ * connections — exactly what `Kernel.stop()`'s graceful-shutdown contract expects.
47
+ *
48
+ * Multiple `stop()` calls are safe (no-op after the first). `start()` is idempotent in the
49
+ * sense that calling it twice without an intervening `stop()` rejects with a clear error
50
+ * rather than silently leaking the previous server.
51
+ */
52
+ let KernelHttpServer = class KernelHttpServer {
53
+ constructor(defaultAddress, defaultPort, defaultTlsKeyPath, defaultTlsCertPath, logHandler, kernel) {
54
+ this.defaultAddress = defaultAddress;
55
+ this.defaultPort = defaultPort;
56
+ this.defaultTlsKeyPath = defaultTlsKeyPath;
57
+ this.defaultTlsCertPath = defaultTlsCertPath;
58
+ this.logHandler = logHandler;
59
+ this.kernel = kernel;
60
+ /**
61
+ * Identifier reported back via `RuntimeServerInterface.name`. Switches to `"https"` when
62
+ * TLS config is present, mainly so log lines and `pristine info`-style introspection make
63
+ * the protocol obvious without inspecting the server object.
64
+ */
65
+ this.name = "http";
66
+ /**
67
+ * Set of currently-open connections. Tracked so `stop()` can choose to destroy them after
68
+ * a grace period rather than waiting indefinitely for keep-alive sockets to close on their own.
69
+ * @private
70
+ */
71
+ this.connections = new Set();
72
+ }
73
+ /**
74
+ * Binds the server. Resolves once the underlying server is listening; rejects on bind error
75
+ * (port in use, EACCES, etc).
76
+ *
77
+ * The `tls` option, when present and pointing at readable PEM files, switches the server
78
+ * from plain HTTP to HTTPS. When absent, configuration-time `kernel-server.tls.*` values
79
+ * are consulted as a fallback.
80
+ */
81
+ start(options) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ var _a, _b, _c, _d, _e, _f;
84
+ if (this.server !== undefined) {
85
+ throw new Error("[KernelHttpServer] start() called while a server is already running. Call stop() first.");
86
+ }
87
+ const port = (_a = options === null || options === void 0 ? void 0 : options.port) !== null && _a !== void 0 ? _a : this.defaultPort;
88
+ const address = (_b = options === null || options === void 0 ? void 0 : options.address) !== null && _b !== void 0 ? _b : this.defaultAddress;
89
+ const tlsKeyPath = (_d = (_c = options === null || options === void 0 ? void 0 : options.tls) === null || _c === void 0 ? void 0 : _c.keyPath) !== null && _d !== void 0 ? _d : this.defaultTlsKeyPath;
90
+ const tlsCertPath = (_f = (_e = options === null || options === void 0 ? void 0 : options.tls) === null || _e === void 0 ? void 0 : _e.certPath) !== null && _f !== void 0 ? _f : this.defaultTlsCertPath;
91
+ const tlsEnabled = tlsKeyPath !== "" && tlsCertPath !== "";
92
+ const handler = (req, res) => {
93
+ // Don't await — letting requests run concurrently is the whole point of an HTTP server.
94
+ // handleRequest swallows its own errors so an unhandled rejection cannot crash the process.
95
+ void this.handleRequest(req, res);
96
+ };
97
+ if (tlsEnabled) {
98
+ const key = fs_1.default.readFileSync(tlsKeyPath);
99
+ const cert = fs_1.default.readFileSync(tlsCertPath);
100
+ this.server = https_1.default.createServer({ key, cert }, handler);
101
+ this.name = "https";
102
+ }
103
+ else {
104
+ this.server = http_1.default.createServer(handler);
105
+ this.name = "http";
106
+ }
107
+ // Track every open connection so stop() can force them closed if they outlive the grace
108
+ // window. Without this, keep-alive sockets pin server.close() open indefinitely.
109
+ this.server.on("connection", (socket) => {
110
+ this.connections.add(socket);
111
+ socket.on("close", () => this.connections.delete(socket));
112
+ });
113
+ return new Promise((resolve, reject) => {
114
+ const onError = (err) => {
115
+ var _a;
116
+ (_a = this.server) === null || _a === void 0 ? void 0 : _a.removeListener("listening", onListening);
117
+ this.server = undefined;
118
+ reject(err);
119
+ };
120
+ const onListening = () => {
121
+ var _a;
122
+ (_a = this.server) === null || _a === void 0 ? void 0 : _a.removeListener("error", onError);
123
+ const scheme = tlsEnabled ? "https" : "http";
124
+ this.logHandler.info(`KernelHttpServer: listening on ${scheme}://${address}:${port}`);
125
+ resolve();
126
+ };
127
+ this.server.once("error", onError);
128
+ this.server.once("listening", onListening);
129
+ this.server.listen(port, address);
130
+ });
131
+ });
132
+ }
133
+ /**
134
+ * Shuts the server down. Calls `server.close()` to refuse new connections, then waits for
135
+ * in-flight requests to drain. Idempotent — calling it without a running server is a no-op.
136
+ */
137
+ stop(options) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ var _a;
140
+ if (this.server === undefined) {
141
+ return;
142
+ }
143
+ const server = this.server;
144
+ this.server = undefined;
145
+ const drainTimeoutMs = (_a = options === null || options === void 0 ? void 0 : options.drainTimeoutMs) !== null && _a !== void 0 ? _a : 10000;
146
+ return new Promise((resolve) => {
147
+ const closeTimer = setTimeout(() => {
148
+ // Drain window expired — force-close remaining sockets so close() can resolve.
149
+ this.logHandler.warning(`KernelHttpServer: drain timeout (${drainTimeoutMs}ms) reached, forcing ${this.connections.size} open connection(s) closed.`);
150
+ for (const socket of this.connections) {
151
+ socket.destroy();
152
+ }
153
+ }, drainTimeoutMs);
154
+ closeTimer.unref();
155
+ server.close(() => {
156
+ clearTimeout(closeTimer);
157
+ this.connections.clear();
158
+ this.logHandler.info("KernelHttpServer: stopped.");
159
+ resolve();
160
+ });
161
+ });
162
+ });
163
+ }
164
+ /**
165
+ * Reads the body, builds a Pristine `Request`, dispatches via the kernel, writes the
166
+ * resulting `Response`. All errors are caught and turned into a 500 response so the
167
+ * caller's request always gets an answer.
168
+ * @private
169
+ */
170
+ handleRequest(req, res) {
171
+ return __awaiter(this, void 0, void 0, function* () {
172
+ var _a;
173
+ const requestId = (_a = req.headers["x-pristine-request-id"]) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)();
174
+ try {
175
+ const request = yield this.mapToPristineRequest(req, requestId);
176
+ const result = yield this.kernel.handle(request, {
177
+ keyname: core_1.ExecutionContextKeynameEnum.Http,
178
+ context: null,
179
+ });
180
+ this.writeResponse(res, result);
181
+ }
182
+ catch (error) {
183
+ this.logHandler.error("KernelHttpServer: unhandled error while processing request", {
184
+ extra: { error, url: req.url, method: req.method, requestId },
185
+ });
186
+ // Best-effort 500. If headers are already sent the response is partially written and we
187
+ // can only destroy the socket — but most kernel.handle errors propagate before any write.
188
+ if (res.headersSent === false) {
189
+ res.statusCode = 500;
190
+ res.setHeader("content-type", "application/json");
191
+ res.end(JSON.stringify({ error: "Internal Server Error", requestId }));
192
+ }
193
+ else {
194
+ res.destroy();
195
+ }
196
+ }
197
+ });
198
+ }
199
+ /**
200
+ * Reads the request body to completion and constructs a Pristine `Request`. The body is read
201
+ * as a UTF-8 string and JSON-parsed when the content-type is JSON-flavored; otherwise the
202
+ * raw string is kept on `body`. `rawBody` always carries the unparsed string so handlers can
203
+ * re-parse if needed (e.g. signature verification).
204
+ * @private
205
+ */
206
+ mapToPristineRequest(req, requestId) {
207
+ return __awaiter(this, void 0, void 0, function* () {
208
+ var _a, _b, _c;
209
+ const url = (_a = req.url) !== null && _a !== void 0 ? _a : "/";
210
+ const method = ((_b = req.method) !== null && _b !== void 0 ? _b : "GET").toUpperCase();
211
+ const groupId = req.headers["x-pristine-event-group-id"];
212
+ const request = new common_1.Request(method, url, requestId);
213
+ request.groupId = groupId;
214
+ // The networking Router treats `request.host` as a base URL for `new URL(request.url, host)`,
215
+ // which requires a scheme. Node's `Host` header carries only the authority (host:port), so
216
+ // we prefix the appropriate scheme based on whether the underlying server is TLS-encrypted.
217
+ const hostHeader = req.headers.host;
218
+ if (hostHeader !== undefined) {
219
+ const scheme = req.socket.encrypted === true ? "https" : "http";
220
+ request.host = `${scheme}://${hostHeader}`;
221
+ }
222
+ const headers = {};
223
+ for (const [k, v] of Object.entries(req.headers)) {
224
+ if (Array.isArray(v)) {
225
+ headers[k] = v.join(", ");
226
+ }
227
+ else if (v !== undefined) {
228
+ headers[k] = String(v);
229
+ }
230
+ }
231
+ request.setHeaders(headers);
232
+ if (method !== "GET" && method !== "HEAD") {
233
+ const rawBody = yield this.readBody(req);
234
+ request.rawBody = rawBody;
235
+ const contentType = ((_c = req.headers["content-type"]) !== null && _c !== void 0 ? _c : "").toLowerCase();
236
+ if (rawBody.length > 0 && contentType.includes("application/json")) {
237
+ try {
238
+ request.body = JSON.parse(rawBody);
239
+ }
240
+ catch (_d) {
241
+ // Malformed JSON — keep the raw string on `body` so handlers can decide how to react.
242
+ request.body = rawBody;
243
+ }
244
+ }
245
+ else {
246
+ request.body = rawBody;
247
+ }
248
+ }
249
+ return request;
250
+ });
251
+ }
252
+ /**
253
+ * Drains `req` into a UTF-8 string. Bounded by Node's default request size — the `http`
254
+ * module already enforces `maxHeaderSize` and the consumer can layer on body-size checks
255
+ * via the networking package's interceptors if needed.
256
+ * @private
257
+ */
258
+ readBody(req) {
259
+ return new Promise((resolve, reject) => {
260
+ const chunks = [];
261
+ req.on("data", (chunk) => chunks.push(chunk));
262
+ req.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
263
+ req.on("error", reject);
264
+ });
265
+ }
266
+ /**
267
+ * Writes a Pristine `Response` (or any object — handlers that return raw JSON serialize as-is)
268
+ * back to the underlying `ServerResponse`. Default status is 200, default content-type is
269
+ * `application/json` when the body is non-string.
270
+ * @private
271
+ */
272
+ writeResponse(res, result) {
273
+ var _a, _b;
274
+ const isPristineResponse = result instanceof common_1.Response || (result !== null && typeof result === "object" && typeof result.status === "number" && "body" in result);
275
+ const status = isPristineResponse ? ((_a = result.status) !== null && _a !== void 0 ? _a : 200) : 200;
276
+ const headers = isPristineResponse ? ((_b = result.headers) !== null && _b !== void 0 ? _b : {}) : {};
277
+ const body = isPristineResponse ? result.body : result;
278
+ res.statusCode = status;
279
+ let serializedBody;
280
+ if (body === undefined || body === null) {
281
+ serializedBody = "";
282
+ }
283
+ else if (typeof body === "string") {
284
+ serializedBody = body;
285
+ }
286
+ else if (Buffer.isBuffer(body)) {
287
+ // Buffer body: write directly without re-encoding. Don't auto-set content-type — the
288
+ // handler that produced a Buffer is presumed to know what it's sending.
289
+ this.applyHeaders(res, headers);
290
+ res.end(body);
291
+ return;
292
+ }
293
+ else {
294
+ serializedBody = JSON.stringify(body);
295
+ if (this.getHeader(headers, "content-type") === undefined) {
296
+ headers["content-type"] = "application/json";
297
+ }
298
+ }
299
+ this.applyHeaders(res, headers);
300
+ res.end(serializedBody);
301
+ }
302
+ applyHeaders(res, headers) {
303
+ for (const [name, value] of Object.entries(headers)) {
304
+ res.setHeader(name, value);
305
+ }
306
+ }
307
+ getHeader(headers, name) {
308
+ const lower = name.toLowerCase();
309
+ for (const [k, v] of Object.entries(headers)) {
310
+ if (k.toLowerCase() === lower) {
311
+ return v;
312
+ }
313
+ }
314
+ return undefined;
315
+ }
316
+ };
317
+ exports.KernelHttpServer = KernelHttpServer;
318
+ exports.KernelHttpServer = KernelHttpServer = __decorate([
319
+ (0, common_1.tag)(common_1.ServiceDefinitionTagEnum.RuntimeServer),
320
+ (0, common_1.moduleScoped)(http_module_keyname_1.HttpModuleKeyname),
321
+ (0, tsyringe_1.injectable)(),
322
+ __param(0, (0, tsyringe_1.inject)(`%${http_module_keyname_1.HttpModuleKeyname}.kernel-server.address%`)),
323
+ __param(1, (0, tsyringe_1.inject)(`%${http_module_keyname_1.HttpModuleKeyname}.kernel-server.port%`)),
324
+ __param(2, (0, tsyringe_1.inject)(`%${http_module_keyname_1.HttpModuleKeyname}.kernel-server.tls.key-path%`)),
325
+ __param(3, (0, tsyringe_1.inject)(`%${http_module_keyname_1.HttpModuleKeyname}.kernel-server.tls.cert-path%`)),
326
+ __param(4, (0, tsyringe_1.inject)("LogHandlerInterface")),
327
+ __metadata("design:paramtypes", [String, Number, String, String, Object, core_1.Kernel])
328
+ ], KernelHttpServer);
329
+ //# sourceMappingURL=kernel.http-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel.http-server.js","sourceRoot":"","sources":["../../../../src/servers/kernel.http-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,gDAAmE;AACnE,kDAA0B;AAC1B,4CAAoB;AAEpB,+BAAkC;AAClC,4CAA8F;AAC9F,gDAAmG;AAEnG,gEAAyD;AAgBzD;;;;;;;;;;;;;;;GAeG;AAII,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAqB3B,YAC0D,cAAuC,EAC1C,WAAoC,EAC5B,iBAA0C,EACzC,kBAA2C,EAC1E,UAAgD,EAC9D,MAAc;QAL0C,mBAAc,GAAd,cAAc,CAAQ;QACzB,gBAAW,GAAX,WAAW,CAAQ;QACX,sBAAiB,GAAjB,iBAAiB,CAAQ;QACxB,uBAAkB,GAAlB,kBAAkB,CAAQ;QACzD,eAAU,GAAV,UAAU,CAAqB;QAC9D,WAAM,GAAN,MAAM,CAAQ;QA1BjC;;;;WAIG;QACI,SAAI,GAAW,MAAM,CAAC;QAQ7B;;;;WAIG;QACc,gBAAW,GAA8B,IAAI,GAAG,EAAE,CAAC;IAUpE,CAAC;IAED;;;;;;;OAOG;IACG,KAAK,CAAC,OAAsC;;;YAChD,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,yFAAyF,CAAC,CAAC;YAC7G,CAAC;YAED,MAAM,IAAI,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,mCAAI,IAAI,CAAC,WAAW,CAAC;YAC/C,MAAM,OAAO,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,O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QAC9D,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACjC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;gBAC9B,OAAO,CAAC,CAAC;YACX,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF,CAAA;AA1RY,4CAAgB;2BAAhB,gBAAgB;IAH5B,IAAA,YAAG,EAAC,iCAAwB,CAAC,aAAa,CAAC;IAC3C,IAAA,qBAAY,EAAC,uCAAiB,CAAC;IAC/B,IAAA,qBAAU,GAAE;IAuBR,WAAA,IAAA,iBAAM,EAAC,IAAI,uCAAiB,yBAAyB,CAAC,CAAA;IACtD,WAAA,IAAA,iBAAM,EAAC,IAAI,uCAAiB,sBAAsB,CAAC,CAAA;IACnD,WAAA,IAAA,iBAAM,EAAC,IAAI,uCAAiB,8BAA8B,CAAC,CAAA;IAC3D,WAAA,IAAA,iBAAM,EAAC,IAAI,uCAAiB,+BAA+B,CAAC,CAAA;IAC5D,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;6EACL,aAAM;GA3BtB,gBAAgB,CA0R5B"}
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./file.http-server"), exports);
18
+ __exportStar(require("./kernel.http-server"), exports);
18
19
  //# sourceMappingURL=servers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"servers.js","sourceRoot":"","sources":["../../../../src/servers/servers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
1
+ {"version":3,"file":"servers.js","sourceRoot":"","sources":["../../../../src/servers/servers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,uDAAqC"}