@pristine-ts/http 1.0.440 → 2.0.1

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
@@ -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,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAKhF,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;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,mCAAmC;IAH/C,GAAG,CAAC,wBAAwB,CAAC,4BAA4B,CAAC;IAC1D,YAAY,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,MAAM,CAAC,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,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAC,YAAY,EAAE,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAK9F,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAGzD;;;;GAIG;AAII,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAC9C,YACkD,UAA+B,EACV,cAAuB;QAD5C,eAAU,GAAV,UAAU,CAAqB;QACV,mBAAc,GAAd,cAAc,CAAS;IAE9F,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,mCAAmC;IAH/C,GAAG,CAAC,wBAAwB,CAAC,4BAA4B,CAAC;IAC1D,YAAY,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,YAAY,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAA;;GAH1C,mCAAmC,CA8B/C"}
@@ -20,7 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  import { inject, injectable } from "tsyringe";
23
- import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
23
+ import { HttpConfigurationKeys } from "../http.configuration-keys";
24
+ import { injectConfig, moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
24
25
  import { HttpModuleKeyname } from "../http.module.keyname";
25
26
  /**
26
27
  * This class is an interceptor to log outgoing http requests.
@@ -57,7 +58,7 @@ HttpRequestLoggingInterceptor = __decorate([
57
58
  moduleScoped(HttpModuleKeyname),
58
59
  injectable(),
59
60
  __param(0, inject("LogHandlerInterface")),
60
- __param(1, inject("%pristine.http.logging-enabled%")),
61
+ __param(1, injectConfig(HttpConfigurationKeys.LoggingEnabled)),
61
62
  __metadata("design:paramtypes", [Object, Boolean])
62
63
  ], HttpRequestLoggingInterceptor);
63
64
  export { HttpRequestLoggingInterceptor };
@@ -1 +1 @@
1
- {"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAIhF,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;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,6BAA6B;IAHzC,GAAG,CAAC,wBAAwB,CAAC,sBAAsB,CAAC;IACpD,YAAY,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,MAAM,CAAC,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,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAC,YAAY,EAAE,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAI9F,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;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,6BAA6B;IAHzC,GAAG,CAAC,wBAAwB,CAAC,sBAAsB,CAAC;IACpD,YAAY,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,YAAY,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAA;;GAH1C,6BAA6B,CAyBzC"}
@@ -20,7 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  import { inject, injectable } from "tsyringe";
23
- import { moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
23
+ import { HttpConfigurationKeys } from "../http.configuration-keys";
24
+ import { injectConfig, moduleScoped, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
24
25
  import { HttpModuleKeyname } from "../http.module.keyname";
25
26
  /**
26
27
  * This class is an interceptor to log incoming http responses.
@@ -60,7 +61,7 @@ HttpResponseLoggingInterceptor = __decorate([
60
61
  moduleScoped(HttpModuleKeyname),
61
62
  injectable(),
62
63
  __param(0, inject("LogHandlerInterface")),
63
- __param(1, inject("%pristine.http.logging-enabled%")),
64
+ __param(1, injectConfig(HttpConfigurationKeys.LoggingEnabled)),
64
65
  __metadata("design:paramtypes", [Object, Boolean])
65
66
  ], HttpResponseLoggingInterceptor);
66
67
  export { HttpResponseLoggingInterceptor };
@@ -1 +1 @@
1
- {"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;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AC/B,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,MAAM,CAAC,iCAAiC,CAAC,CAAA;;GAHjC,8BAA8B,CA8B1C"}
1
+ {"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAC,YAAY,EAAE,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAM9F,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;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,8BAA8B;IAH1C,GAAG,CAAC,wBAAwB,CAAC,uBAAuB,CAAC;IACrD,YAAY,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,YAAY,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAA;;GAH1C,8BAA8B,CA8B1C"}
@@ -0,0 +1,323 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ import { inject, injectable } from "tsyringe";
23
+ import http from "http";
24
+ import https from "https";
25
+ import fs from "fs";
26
+ import { v4 as uuidv4 } from "uuid";
27
+ import { ExecutionContextKeynameEnum, Kernel } from "@pristine-ts/core";
28
+ import { moduleScoped, Request, Response, ServiceDefinitionTagEnum, tag } from "@pristine-ts/common";
29
+ import { HttpModuleKeyname } from "../http.module.keyname";
30
+ /**
31
+ * Wraps Node's `http.Server` (or `https.Server` when TLS config is present) and routes every
32
+ * incoming request through `kernel.handle()`. The kernel dispatches to the existing
33
+ * `RequestEventHandler` from `@pristine-ts/networking`, which finds the matching controller
34
+ * via the `Router` — so all the routing/auth/interceptor logic the consumer already has on
35
+ * their controllers Just Works without any new framework concepts.
36
+ *
37
+ * Designed to be the runtime entry point for `pristine start`. Lifecycle:
38
+ * - `start({port, address, tls?})` creates the underlying server and binds.
39
+ * - `stop()` calls `server.close()`, which lets in-flight requests finish but refuses new
40
+ * connections — exactly what `Kernel.stop()`'s graceful-shutdown contract expects.
41
+ *
42
+ * Multiple `stop()` calls are safe (no-op after the first). `start()` is idempotent in the
43
+ * sense that calling it twice without an intervening `stop()` rejects with a clear error
44
+ * rather than silently leaking the previous server.
45
+ */
46
+ let KernelHttpServer = class KernelHttpServer {
47
+ constructor(defaultAddress, defaultPort, defaultTlsKeyPath, defaultTlsCertPath, logHandler, kernel) {
48
+ this.defaultAddress = defaultAddress;
49
+ this.defaultPort = defaultPort;
50
+ this.defaultTlsKeyPath = defaultTlsKeyPath;
51
+ this.defaultTlsCertPath = defaultTlsCertPath;
52
+ this.logHandler = logHandler;
53
+ this.kernel = kernel;
54
+ /**
55
+ * Identifier reported back via `RuntimeServerInterface.name`. Switches to `"https"` when
56
+ * TLS config is present, mainly so log lines and `pristine info`-style introspection make
57
+ * the protocol obvious without inspecting the server object.
58
+ */
59
+ this.name = "http";
60
+ /**
61
+ * Set of currently-open connections. Tracked so `stop()` can choose to destroy them after
62
+ * a grace period rather than waiting indefinitely for keep-alive sockets to close on their own.
63
+ * @private
64
+ */
65
+ this.connections = new Set();
66
+ }
67
+ /**
68
+ * Binds the server. Resolves once the underlying server is listening; rejects on bind error
69
+ * (port in use, EACCES, etc).
70
+ *
71
+ * The `tls` option, when present and pointing at readable PEM files, switches the server
72
+ * from plain HTTP to HTTPS. When absent, configuration-time `kernel-server.tls.*` values
73
+ * are consulted as a fallback.
74
+ */
75
+ start(options) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ var _a, _b, _c, _d, _e, _f;
78
+ if (this.server !== undefined) {
79
+ throw new Error("[KernelHttpServer] start() called while a server is already running. Call stop() first.");
80
+ }
81
+ const port = (_a = options === null || options === void 0 ? void 0 : options.port) !== null && _a !== void 0 ? _a : this.defaultPort;
82
+ const address = (_b = options === null || options === void 0 ? void 0 : options.address) !== null && _b !== void 0 ? _b : this.defaultAddress;
83
+ 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;
84
+ 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;
85
+ const tlsEnabled = tlsKeyPath !== "" && tlsCertPath !== "";
86
+ const handler = (req, res) => {
87
+ // Don't await — letting requests run concurrently is the whole point of an HTTP server.
88
+ // handleRequest swallows its own errors so an unhandled rejection cannot crash the process.
89
+ void this.handleRequest(req, res);
90
+ };
91
+ if (tlsEnabled) {
92
+ const key = fs.readFileSync(tlsKeyPath);
93
+ const cert = fs.readFileSync(tlsCertPath);
94
+ this.server = https.createServer({ key, cert }, handler);
95
+ this.name = "https";
96
+ }
97
+ else {
98
+ this.server = http.createServer(handler);
99
+ this.name = "http";
100
+ }
101
+ // Track every open connection so stop() can force them closed if they outlive the grace
102
+ // window. Without this, keep-alive sockets pin server.close() open indefinitely.
103
+ this.server.on("connection", (socket) => {
104
+ this.connections.add(socket);
105
+ socket.on("close", () => this.connections.delete(socket));
106
+ });
107
+ return new Promise((resolve, reject) => {
108
+ const onError = (err) => {
109
+ var _a;
110
+ (_a = this.server) === null || _a === void 0 ? void 0 : _a.removeListener("listening", onListening);
111
+ this.server = undefined;
112
+ reject(err);
113
+ };
114
+ const onListening = () => {
115
+ var _a;
116
+ (_a = this.server) === null || _a === void 0 ? void 0 : _a.removeListener("error", onError);
117
+ const scheme = tlsEnabled ? "https" : "http";
118
+ this.logHandler.info(`KernelHttpServer: listening on ${scheme}://${address}:${port}`);
119
+ resolve();
120
+ };
121
+ this.server.once("error", onError);
122
+ this.server.once("listening", onListening);
123
+ this.server.listen(port, address);
124
+ });
125
+ });
126
+ }
127
+ /**
128
+ * Shuts the server down. Calls `server.close()` to refuse new connections, then waits for
129
+ * in-flight requests to drain. Idempotent — calling it without a running server is a no-op.
130
+ */
131
+ stop(options) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ var _a;
134
+ if (this.server === undefined) {
135
+ return;
136
+ }
137
+ const server = this.server;
138
+ this.server = undefined;
139
+ const drainTimeoutMs = (_a = options === null || options === void 0 ? void 0 : options.drainTimeoutMs) !== null && _a !== void 0 ? _a : 10000;
140
+ return new Promise((resolve) => {
141
+ const closeTimer = setTimeout(() => {
142
+ // Drain window expired — force-close remaining sockets so close() can resolve.
143
+ this.logHandler.warning(`KernelHttpServer: drain timeout (${drainTimeoutMs}ms) reached, forcing ${this.connections.size} open connection(s) closed.`);
144
+ for (const socket of this.connections) {
145
+ socket.destroy();
146
+ }
147
+ }, drainTimeoutMs);
148
+ closeTimer.unref();
149
+ server.close(() => {
150
+ clearTimeout(closeTimer);
151
+ this.connections.clear();
152
+ this.logHandler.info("KernelHttpServer: stopped.");
153
+ resolve();
154
+ });
155
+ });
156
+ });
157
+ }
158
+ /**
159
+ * Reads the body, builds a Pristine `Request`, dispatches via the kernel, writes the
160
+ * resulting `Response`. All errors are caught and turned into a 500 response so the
161
+ * caller's request always gets an answer.
162
+ * @private
163
+ */
164
+ handleRequest(req, res) {
165
+ return __awaiter(this, void 0, void 0, function* () {
166
+ var _a;
167
+ const requestId = (_a = req.headers["x-pristine-request-id"]) !== null && _a !== void 0 ? _a : uuidv4();
168
+ try {
169
+ const request = yield this.mapToPristineRequest(req, requestId);
170
+ const result = yield this.kernel.handle(request, {
171
+ keyname: ExecutionContextKeynameEnum.Http,
172
+ context: null,
173
+ });
174
+ this.writeResponse(res, result);
175
+ }
176
+ catch (error) {
177
+ this.logHandler.error("KernelHttpServer: unhandled error while processing request", {
178
+ extra: { error, url: req.url, method: req.method, requestId },
179
+ });
180
+ // Best-effort 500. If headers are already sent the response is partially written and we
181
+ // can only destroy the socket — but most kernel.handle errors propagate before any write.
182
+ if (res.headersSent === false) {
183
+ res.statusCode = 500;
184
+ res.setHeader("content-type", "application/json");
185
+ res.end(JSON.stringify({ error: "Internal Server Error", requestId }));
186
+ }
187
+ else {
188
+ res.destroy();
189
+ }
190
+ }
191
+ });
192
+ }
193
+ /**
194
+ * Reads the request body to completion and constructs a Pristine `Request`. The body is read
195
+ * as a UTF-8 string and JSON-parsed when the content-type is JSON-flavored; otherwise the
196
+ * raw string is kept on `body`. `rawBody` always carries the unparsed string so handlers can
197
+ * re-parse if needed (e.g. signature verification).
198
+ * @private
199
+ */
200
+ mapToPristineRequest(req, requestId) {
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ var _a, _b, _c;
203
+ const url = (_a = req.url) !== null && _a !== void 0 ? _a : "/";
204
+ const method = ((_b = req.method) !== null && _b !== void 0 ? _b : "GET").toUpperCase();
205
+ const groupId = req.headers["x-pristine-event-group-id"];
206
+ const request = new Request(method, url, requestId);
207
+ request.groupId = groupId;
208
+ // The networking Router treats `request.host` as a base URL for `new URL(request.url, host)`,
209
+ // which requires a scheme. Node's `Host` header carries only the authority (host:port), so
210
+ // we prefix the appropriate scheme based on whether the underlying server is TLS-encrypted.
211
+ const hostHeader = req.headers.host;
212
+ if (hostHeader !== undefined) {
213
+ const scheme = req.socket.encrypted === true ? "https" : "http";
214
+ request.host = `${scheme}://${hostHeader}`;
215
+ }
216
+ const headers = {};
217
+ for (const [k, v] of Object.entries(req.headers)) {
218
+ if (Array.isArray(v)) {
219
+ headers[k] = v.join(", ");
220
+ }
221
+ else if (v !== undefined) {
222
+ headers[k] = String(v);
223
+ }
224
+ }
225
+ request.setHeaders(headers);
226
+ if (method !== "GET" && method !== "HEAD") {
227
+ const rawBody = yield this.readBody(req);
228
+ request.rawBody = rawBody;
229
+ const contentType = ((_c = req.headers["content-type"]) !== null && _c !== void 0 ? _c : "").toLowerCase();
230
+ if (rawBody.length > 0 && contentType.includes("application/json")) {
231
+ try {
232
+ request.body = JSON.parse(rawBody);
233
+ }
234
+ catch (_d) {
235
+ // Malformed JSON — keep the raw string on `body` so handlers can decide how to react.
236
+ request.body = rawBody;
237
+ }
238
+ }
239
+ else {
240
+ request.body = rawBody;
241
+ }
242
+ }
243
+ return request;
244
+ });
245
+ }
246
+ /**
247
+ * Drains `req` into a UTF-8 string. Bounded by Node's default request size — the `http`
248
+ * module already enforces `maxHeaderSize` and the consumer can layer on body-size checks
249
+ * via the networking package's interceptors if needed.
250
+ * @private
251
+ */
252
+ readBody(req) {
253
+ return new Promise((resolve, reject) => {
254
+ const chunks = [];
255
+ req.on("data", (chunk) => chunks.push(chunk));
256
+ req.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
257
+ req.on("error", reject);
258
+ });
259
+ }
260
+ /**
261
+ * Writes a Pristine `Response` (or any object — handlers that return raw JSON serialize as-is)
262
+ * back to the underlying `ServerResponse`. Default status is 200, default content-type is
263
+ * `application/json` when the body is non-string.
264
+ * @private
265
+ */
266
+ writeResponse(res, result) {
267
+ var _a, _b;
268
+ const isPristineResponse = result instanceof Response || (result !== null && typeof result === "object" && typeof result.status === "number" && "body" in result);
269
+ const status = isPristineResponse ? ((_a = result.status) !== null && _a !== void 0 ? _a : 200) : 200;
270
+ const headers = isPristineResponse ? ((_b = result.headers) !== null && _b !== void 0 ? _b : {}) : {};
271
+ const body = isPristineResponse ? result.body : result;
272
+ res.statusCode = status;
273
+ let serializedBody;
274
+ if (body === undefined || body === null) {
275
+ serializedBody = "";
276
+ }
277
+ else if (typeof body === "string") {
278
+ serializedBody = body;
279
+ }
280
+ else if (Buffer.isBuffer(body)) {
281
+ // Buffer body: write directly without re-encoding. Don't auto-set content-type — the
282
+ // handler that produced a Buffer is presumed to know what it's sending.
283
+ this.applyHeaders(res, headers);
284
+ res.end(body);
285
+ return;
286
+ }
287
+ else {
288
+ serializedBody = JSON.stringify(body);
289
+ if (this.getHeader(headers, "content-type") === undefined) {
290
+ headers["content-type"] = "application/json";
291
+ }
292
+ }
293
+ this.applyHeaders(res, headers);
294
+ res.end(serializedBody);
295
+ }
296
+ applyHeaders(res, headers) {
297
+ for (const [name, value] of Object.entries(headers)) {
298
+ res.setHeader(name, value);
299
+ }
300
+ }
301
+ getHeader(headers, name) {
302
+ const lower = name.toLowerCase();
303
+ for (const [k, v] of Object.entries(headers)) {
304
+ if (k.toLowerCase() === lower) {
305
+ return v;
306
+ }
307
+ }
308
+ return undefined;
309
+ }
310
+ };
311
+ KernelHttpServer = __decorate([
312
+ tag(ServiceDefinitionTagEnum.RuntimeServer),
313
+ moduleScoped(HttpModuleKeyname),
314
+ injectable(),
315
+ __param(0, inject(`%${HttpModuleKeyname}.kernel-server.address%`)),
316
+ __param(1, inject(`%${HttpModuleKeyname}.kernel-server.port%`)),
317
+ __param(2, inject(`%${HttpModuleKeyname}.kernel-server.tls.key-path%`)),
318
+ __param(3, inject(`%${HttpModuleKeyname}.kernel-server.tls.cert-path%`)),
319
+ __param(4, inject("LogHandlerInterface")),
320
+ __metadata("design:paramtypes", [String, Number, String, String, Object, Kernel])
321
+ ], KernelHttpServer);
322
+ export { KernelHttpServer };
323
+ //# 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,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,IAA+C,MAAM,MAAM,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAClC,OAAO,EAAC,2BAA2B,EAAE,MAAM,EAAyB,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAEnG,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;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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IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACpD,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAEO,SAAS,CAAC,OAAgC,EAAE,IAAY;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,gBAAgB;IAH5B,GAAG,CAAC,wBAAwB,CAAC,aAAa,CAAC;IAC3C,YAAY,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;IAuBR,WAAA,MAAM,CAAC,IAAI,iBAAiB,yBAAyB,CAAC,CAAA;IACtD,WAAA,MAAM,CAAC,IAAI,iBAAiB,sBAAsB,CAAC,CAAA;IACnD,WAAA,MAAM,CAAC,IAAI,iBAAiB,8BAA8B,CAAC,CAAA;IAC3D,WAAA,MAAM,CAAC,IAAI,iBAAiB,+BAA+B,CAAC,CAAA;IAC5D,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;6EACL,MAAM;GA3BtB,gBAAgB,CA0R5B"}
@@ -1,2 +1,3 @@
1
1
  export * from "./file.http-server";
2
+ export * from "./kernel.http-server";
2
3
  //# sourceMappingURL=servers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"servers.js","sourceRoot":"","sources":["../../../../src/servers/servers.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"servers.js","sourceRoot":"","sources":["../../../../src/servers/servers.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}