@zyno-io/ts-server-foundation 26.728.2026 → 26.731.113

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 (125) hide show
  1. package/dist/src/app/base.d.ts +2 -1
  2. package/dist/src/app/base.d.ts.map +1 -1
  3. package/dist/src/app/base.js +19 -4
  4. package/dist/src/app/base.js.map +1 -1
  5. package/dist/src/app/index.js +1 -1
  6. package/dist/src/database/query.js +1 -1
  7. package/dist/src/di/module.js +1 -1
  8. package/dist/src/helpers/index.d.ts +1 -0
  9. package/dist/src/helpers/index.d.ts.map +1 -1
  10. package/dist/src/helpers/index.js +1 -0
  11. package/dist/src/helpers/index.js.map +1 -1
  12. package/dist/src/helpers/utils/timer.d.ts +3 -0
  13. package/dist/src/helpers/utils/timer.d.ts.map +1 -0
  14. package/dist/src/helpers/utils/timer.js +12 -0
  15. package/dist/src/helpers/utils/timer.js.map +1 -0
  16. package/dist/src/http/base.js +3 -3
  17. package/dist/src/http/base.js.map +1 -1
  18. package/dist/src/http/decorators.d.ts +12 -0
  19. package/dist/src/http/decorators.d.ts.map +1 -1
  20. package/dist/src/http/decorators.js +24 -1
  21. package/dist/src/http/decorators.js.map +1 -1
  22. package/dist/src/http/index.js +1 -1
  23. package/dist/src/http/response.d.ts.map +1 -1
  24. package/dist/src/http/response.js +10 -3
  25. package/dist/src/http/response.js.map +1 -1
  26. package/dist/src/http/router.d.ts +16 -2
  27. package/dist/src/http/router.d.ts.map +1 -1
  28. package/dist/src/http/router.js +119 -28
  29. package/dist/src/http/router.js.map +1 -1
  30. package/dist/src/http/static-files.d.ts +4 -3
  31. package/dist/src/http/static-files.d.ts.map +1 -1
  32. package/dist/src/http/static-files.js +12 -4
  33. package/dist/src/http/static-files.js.map +1 -1
  34. package/dist/src/index.js +1 -1
  35. package/dist/src/services/index.js +1 -1
  36. package/dist/src/services/logger.js +196 -5
  37. package/dist/src/services/logger.js.map +1 -1
  38. package/dist/src/services/mesh-client/index.d.ts +3 -1
  39. package/dist/src/services/mesh-client/index.d.ts.map +1 -1
  40. package/dist/src/services/mesh-client/index.js +6 -2
  41. package/dist/src/services/mesh-client/index.js.map +1 -1
  42. package/dist/src/services/mesh-client/mesh-client-redis-registry.d.ts +53 -7
  43. package/dist/src/services/mesh-client/mesh-client-redis-registry.d.ts.map +1 -1
  44. package/dist/src/services/mesh-client/mesh-client-redis-registry.js +862 -61
  45. package/dist/src/services/mesh-client/mesh-client-redis-registry.js.map +1 -1
  46. package/dist/src/services/mesh-client/mesh-client-registry.d.ts +17 -6
  47. package/dist/src/services/mesh-client/mesh-client-registry.d.ts.map +1 -1
  48. package/dist/src/services/mesh-client/mesh-client-registry.js +43 -2
  49. package/dist/src/services/mesh-client/mesh-client-registry.js.map +1 -1
  50. package/dist/src/services/mesh-client/mesh-client-service.d.ts +115 -48
  51. package/dist/src/services/mesh-client/mesh-client-service.d.ts.map +1 -1
  52. package/dist/src/services/mesh-client/mesh-client-service.js +790 -101
  53. package/dist/src/services/mesh-client/mesh-client-service.js.map +1 -1
  54. package/dist/src/services/mesh-client/mesh-srpc-link-controller.d.ts +129 -17
  55. package/dist/src/services/mesh-client/mesh-srpc-link-controller.d.ts.map +1 -1
  56. package/dist/src/services/mesh-client/mesh-srpc-link-controller.js +1615 -126
  57. package/dist/src/services/mesh-client/mesh-srpc-link-controller.js.map +1 -1
  58. package/dist/src/services/mesh-client/mesh-srpc-remote-connection.d.ts +38 -6
  59. package/dist/src/services/mesh-client/mesh-srpc-remote-connection.d.ts.map +1 -1
  60. package/dist/src/services/mesh-client/mesh-srpc-remote-connection.js +192 -27
  61. package/dist/src/services/mesh-client/mesh-srpc-remote-connection.js.map +1 -1
  62. package/dist/src/services/mesh-client/mesh-srpc-server.d.ts +57 -8
  63. package/dist/src/services/mesh-client/mesh-srpc-server.d.ts.map +1 -1
  64. package/dist/src/services/mesh-client/mesh-srpc-server.js +479 -131
  65. package/dist/src/services/mesh-client/mesh-srpc-server.js.map +1 -1
  66. package/dist/src/services/mesh-client/types.d.ts +77 -6
  67. package/dist/src/services/mesh-client/types.d.ts.map +1 -1
  68. package/dist/src/services/mesh-client/types.js +1 -1
  69. package/dist/src/services/mesh-client/types.js.map +1 -1
  70. package/dist/src/services/mesh-link/auth.d.ts +36 -2
  71. package/dist/src/services/mesh-link/auth.d.ts.map +1 -1
  72. package/dist/src/services/mesh-link/auth.js +97 -21
  73. package/dist/src/services/mesh-link/auth.js.map +1 -1
  74. package/dist/src/services/mesh-link/index.d.ts +2 -2
  75. package/dist/src/services/mesh-link/index.d.ts.map +1 -1
  76. package/dist/src/services/mesh-link/index.js +5 -2
  77. package/dist/src/services/mesh-link/index.js.map +1 -1
  78. package/dist/src/services/mesh-link/peer.d.ts +26 -1
  79. package/dist/src/services/mesh-link/peer.d.ts.map +1 -1
  80. package/dist/src/services/mesh-link/peer.js +220 -26
  81. package/dist/src/services/mesh-link/peer.js.map +1 -1
  82. package/dist/src/services/mesh-link/protocol.d.ts +16 -3
  83. package/dist/src/services/mesh-link/protocol.d.ts.map +1 -1
  84. package/dist/src/services/mesh-link/protocol.js +8 -4
  85. package/dist/src/services/mesh-link/protocol.js.map +1 -1
  86. package/dist/src/services/mesh-link/runtime.d.ts +57 -4
  87. package/dist/src/services/mesh-link/runtime.d.ts.map +1 -1
  88. package/dist/src/services/mesh-link/runtime.js +557 -67
  89. package/dist/src/services/mesh-link/runtime.js.map +1 -1
  90. package/dist/src/services/mesh.d.ts +72 -28
  91. package/dist/src/services/mesh.d.ts.map +1 -1
  92. package/dist/src/services/mesh.js +587 -278
  93. package/dist/src/services/mesh.js.map +1 -1
  94. package/dist/src/services/worker/queue.d.ts +6 -0
  95. package/dist/src/services/worker/queue.d.ts.map +1 -1
  96. package/dist/src/services/worker/queue.js +41 -3
  97. package/dist/src/services/worker/queue.js.map +1 -1
  98. package/dist/src/services/worker/runner.d.ts +1 -1
  99. package/dist/src/services/worker/runner.d.ts.map +1 -1
  100. package/dist/src/services/worker/runner.js +13 -6
  101. package/dist/src/services/worker/runner.js.map +1 -1
  102. package/dist/src/srpc/SrpcByteStream.d.ts +21 -2
  103. package/dist/src/srpc/SrpcByteStream.d.ts.map +1 -1
  104. package/dist/src/srpc/SrpcByteStream.js +271 -61
  105. package/dist/src/srpc/SrpcByteStream.js.map +1 -1
  106. package/dist/src/srpc/SrpcClient.d.ts +57 -13
  107. package/dist/src/srpc/SrpcClient.d.ts.map +1 -1
  108. package/dist/src/srpc/SrpcClient.js +558 -120
  109. package/dist/src/srpc/SrpcClient.js.map +1 -1
  110. package/dist/src/srpc/SrpcServer.d.ts +59 -4
  111. package/dist/src/srpc/SrpcServer.d.ts.map +1 -1
  112. package/dist/src/srpc/SrpcServer.js +683 -80
  113. package/dist/src/srpc/SrpcServer.js.map +1 -1
  114. package/dist/src/srpc/index.js +1 -1
  115. package/dist/src/srpc/observer.js +1 -1
  116. package/dist/src/srpc/types.d.ts +37 -6
  117. package/dist/src/srpc/types.d.ts.map +1 -1
  118. package/dist/src/srpc/types.js +12 -1
  119. package/dist/src/srpc/types.js.map +1 -1
  120. package/docs/content/getting-started.md +22 -20
  121. package/docs/content/http.md +38 -1
  122. package/docs/content/mesh-client.md +175 -53
  123. package/docs/content/mesh-service.md +64 -229
  124. package/docs/content/srpc.md +33 -10
  125. package/package.json +7 -7
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.__tsfTypeAliases = exports.SrpcStreamClosedError = exports.SrpcBackpressureError = exports.SrpcMeshAuthenticationError = exports.SrpcMeshProtocolError = exports.SrpcIndeterminateDeliveryError = exports.SrpcOwnerUnavailableError = exports.SrpcStaleConnectionError = exports.SrpcClientNotFoundError = exports.SrpcError = void 0;
4
+ exports.serializeSrpcError = serializeSrpcError;
4
5
  exports.isSrpcMessageHandlerClass = isSrpcMessageHandlerClass;
5
6
  exports.encodeSrpcMessage = encodeSrpcMessage;
6
7
  const tslib_1 = require("tslib");
@@ -19,6 +20,16 @@ class SrpcError extends Error {
19
20
  exports.SrpcError = SrpcError;
20
21
  _SrpcErrorMetadata_1.classType = SrpcError;
21
22
  SrpcError.__tsfType = _SrpcErrorMetadata_1;
23
+ /** Preserve the explicit sRPC error contract without promoting ordinary errors. */
24
+ function serializeSrpcError(error) {
25
+ const isSrpcError = error instanceof SrpcError;
26
+ const message = isSrpcError ? error.message : String(error);
27
+ const userError = isSrpcError && typeof error.isUserError === 'boolean' ? error.isUserError : undefined;
28
+ return {
29
+ error: message,
30
+ ...(userError === undefined ? {} : { userError })
31
+ };
32
+ }
22
33
  let _SrpcClientNotFoundErrorMetadata_1;
23
34
  class SrpcClientNotFoundError extends Error {
24
35
  constructor(clientId) {
@@ -115,5 +126,5 @@ function encodeSrpcMessage(codec, message) {
115
126
  const bytes = 'finish' in encoded ? encoded.finish() : encoded;
116
127
  return Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes);
117
128
  }
118
- exports.__tsfTypeAliases = _a.decodeCompactMetadataV1("[1,{\"BaseMessage\":{\"kind\":18,\"typeName\":\"BaseMessage\",\"types\":[{\"kind\":20,\"name\":\"requestId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"reply\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"error\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"userError\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"trace\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"traceId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"spanId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"traceFlags\",\"type\":{\"kind\":7},\"optional\":false}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"pingPong\",\"type\":{\"kind\":12,\"types\":[{\"kind\":17},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"byteStreamOperation\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"streamId\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"write\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"chunk\",\"type\":{\"kind\":16,\"typeName\":\"Uint8Array\",\"classType\":{\"$tsf\":0}},\"optional\":false}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"finish\",\"type\":{\"kind\":12,\"types\":[{\"kind\":17},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"destroy\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"error\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true}]},\"IQueuedRequest\":{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"resolve\",\"type\":{\"kind\":2,\"typeName\":\"(value: unknown) =\\u003e void\"},\"optional\":false},{\"kind\":20,\"name\":\"reject\",\"type\":{\"kind\":2,\"typeName\":\"(err: unknown) =\\u003e void\"},\"optional\":false}]},\"ISrpcLogger\":{\"kind\":18,\"typeName\":\"ISrpcLogger\",\"types\":[]},\"ISrpcMessageHandler\":{\"kind\":18,\"typeName\":\"ISrpcMessageHandler\",\"types\":[{\"kind\":20,\"name\":\"handle\",\"type\":{\"kind\":2,\"typeName\":\"SrpcMessageHandlerFn\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"},{\"kind\":2,\"typeName\":\"I\"},{\"kind\":2,\"typeName\":\"O\"}]},\"optional\":false}],\"typeParameters\":[\"C\",\"I\",\"O\"]},\"ISrpcServerOptions\":{\"kind\":18,\"typeName\":\"ISrpcServerOptions\",\"types\":[{\"kind\":20,\"name\":\"logger\",\"type\":{\"kind\":18,\"typeName\":\"ISrpcLogger\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"clientMessage\",\"type\":{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"serverMessage\",\"type\":{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"wsPath\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"debug\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"logLevel\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"info\"},{\"kind\":10,\"literal\":\"debug\"},{\"kind\":10,\"literal\":false}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"httpServer\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"Server\",\"classType\":{\"$tsfImport\":[1,\"node:http\",\"Server\"]}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"lateReplyTombstoneTtlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}],\"typeParameters\":[\"TClientOutput\",\"TServerOutput\"]},\"SrpcConnection\":{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"kind\":18,\"typeName\":\"IByteStream\",\"types\":[{\"kind\":20,\"name\":\"parentStreamId\",\"type\":{\"kind\":6},\"optional\":false}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"readonly clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"readonly meta\",\"type\":{\"kind\":2,\"typeName\":\"T\"},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}],\"typeParameters\":[\"T\"]},\"SrpcDisconnectCause\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"disconnect\"},{\"kind\":10,\"literal\":\"conflict\"},{\"kind\":10,\"literal\":\"supersede\"},{\"kind\":10,\"literal\":\"timeout\"},{\"kind\":10,\"literal\":\"badArg\"}],\"typeName\":\"SrpcDisconnectCause\"},\"SrpcMessageFns\":{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[],\"typeParameters\":[\"T\"]},\"SrpcMeta\":{\"kind\":17,\"typeName\":\"SrpcMeta\"},\"SrpcStream\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"kind\":18,\"typeName\":\"IByteStream\",\"types\":[{\"kind\":20,\"name\":\"parentStreamId\",\"type\":{\"kind\":6},\"optional\":false}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":2}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"resolve\",\"type\":{\"kind\":2,\"typeName\":\"(value: unknown) =\\u003e void\"},\"optional\":false},{\"kind\":20,\"name\":\"reject\",\"type\":{\"kind\":2,\"typeName\":\"(err: unknown) =\\u003e void\"},\"optional\":false}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"appVersion\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"configureTs\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"protocolVersion\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":2,\"typeName\":\"T\"},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"isActivated\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"lastPingAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"connected\",\"type\":{\"kind\":8},\"optional\":false}],\"typeParameters\":[\"T\"]}}]", [() => (typeof Uint8Array !== "undefined" ? Uint8Array : (typeof exports !== "undefined" ? exports.Uint8Array : undefined)), require, () => (typeof WebSocket !== "undefined" ? WebSocket : (typeof exports !== "undefined" ? exports.WebSocket : undefined)), () => (typeof Map !== "undefined" ? Map : (typeof exports !== "undefined" ? exports.Map : undefined))], __tsf_metadata_type);
129
+ exports.__tsfTypeAliases = _a.decodeCompactMetadataV1("[1,{\"BaseMessage\":{\"kind\":18,\"typeName\":\"BaseMessage\",\"types\":[{\"kind\":20,\"name\":\"requestId\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"reply\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"error\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"userError\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"trace\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"traceId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"spanId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"traceFlags\",\"type\":{\"kind\":7},\"optional\":false}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"pingPong\",\"type\":{\"kind\":12,\"types\":[{\"kind\":17},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"byteStreamOperation\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"streamId\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"write\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"chunk\",\"type\":{\"kind\":16,\"typeName\":\"Uint8Array\",\"classType\":{\"$tsf\":0}},\"optional\":false}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"finish\",\"type\":{\"kind\":12,\"types\":[{\"kind\":17},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"destroy\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"error\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true}]},{\"kind\":4}]},\"optional\":true}]},\"IQueuedRequest\":{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"resolve\",\"type\":{\"kind\":2,\"typeName\":\"(value: unknown) =\\u003e void\"},\"optional\":false},{\"kind\":20,\"name\":\"reject\",\"type\":{\"kind\":2,\"typeName\":\"(err: unknown) =\\u003e void\"},\"optional\":false}]},\"ISrpcLogger\":{\"kind\":18,\"typeName\":\"ISrpcLogger\",\"types\":[]},\"ISrpcMessageHandler\":{\"kind\":18,\"typeName\":\"ISrpcMessageHandler\",\"types\":[{\"kind\":20,\"name\":\"handle\",\"type\":{\"kind\":2,\"typeName\":\"SrpcMessageHandlerFn\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"},{\"kind\":2,\"typeName\":\"I\"},{\"kind\":2,\"typeName\":\"O\"}]},\"optional\":false}],\"typeParameters\":[\"C\",\"I\",\"O\"]},\"ISrpcServerOptions\":{\"kind\":18,\"typeName\":\"ISrpcServerOptions\",\"types\":[{\"kind\":20,\"name\":\"logger\",\"type\":{\"kind\":18,\"typeName\":\"ISrpcLogger\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"clientMessage\",\"type\":{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"serverMessage\",\"type\":{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[]},\"optional\":false},{\"kind\":20,\"name\":\"wsPath\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"debug\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"logLevel\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"info\"},{\"kind\":10,\"literal\":\"debug\"},{\"kind\":10,\"literal\":false}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"httpServer\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"Server\",\"classType\":{\"$tsfImport\":[1,\"node:http\",\"Server\"]}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"lateReplyTombstoneTtlMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingClientRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingClientRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightClientRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxInFlightClientRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxBufferedBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxMessageBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingServerRequests\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingServerRequestBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxPendingHandshakes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxActiveStreams\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxClientIdBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxClientMetadataBytes\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"maxAuthReplayPrincipals\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"authAudience\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true}],\"typeParameters\":[\"TClientOutput\",\"TServerOutput\"]},\"SrpcConnection\":{\"kind\":18,\"typeName\":\"SrpcConnection\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"kind\":18,\"typeName\":\"IByteStream\",\"types\":[{\"kind\":20,\"name\":\"parentStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"remoteSenderIdParity\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":0},{\"kind\":10,\"literal\":1}]},{\"kind\":4}]},\"optional\":true}]},\"optional\":false},{\"kind\":20,\"name\":\"readonly id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"readonly clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"readonly meta\",\"type\":{\"kind\":2,\"typeName\":\"T\"},\"optional\":false},{\"kind\":20,\"name\":\"readonly connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"readonly connected\",\"type\":{\"kind\":8},\"optional\":false}],\"typeParameters\":[\"T\"]},\"SrpcDisconnectCause\":{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"disconnect\"},{\"kind\":10,\"literal\":\"conflict\"},{\"kind\":10,\"literal\":\"supersede\"},{\"kind\":10,\"literal\":\"timeout\"},{\"kind\":10,\"literal\":\"badArg\"}],\"typeName\":\"SrpcDisconnectCause\"},\"SrpcMessageFns\":{\"kind\":18,\"typeName\":\"SrpcMessageFns\",\"types\":[],\"typeParameters\":[\"T\"]},\"SrpcMeta\":{\"kind\":17,\"typeName\":\"SrpcMeta\"},\"SrpcStream\":{\"kind\":18,\"typeName\":\"SrpcStream\",\"types\":[{\"kind\":20,\"name\":\"byteStream\",\"type\":{\"kind\":18,\"typeName\":\"IByteStream\",\"types\":[{\"kind\":20,\"name\":\"parentStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"remoteSenderIdParity\",\"type\":{\"kind\":12,\"types\":[{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":0},{\"kind\":10,\"literal\":1}]},{\"kind\":4}]},\"optional\":true}]},\"optional\":false},{\"kind\":20,\"name\":\"$ws\",\"type\":{\"kind\":16,\"typeName\":\"WebSocket\",\"classType\":{\"$tsf\":2}},\"optional\":false},{\"kind\":20,\"name\":\"$queue\",\"type\":{\"kind\":16,\"typeName\":\"Map\",\"classType\":{\"$tsf\":3},\"typeArguments\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"IQueuedRequest\",\"types\":[{\"kind\":20,\"name\":\"exp\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"resolve\",\"type\":{\"kind\":2,\"typeName\":\"(value: unknown) =\\u003e void\"},\"optional\":false},{\"kind\":20,\"name\":\"reject\",\"type\":{\"kind\":2,\"typeName\":\"(err: unknown) =\\u003e void\"},\"optional\":false}]}]},\"optional\":false},{\"kind\":20,\"name\":\"id\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientStreamId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"address\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"clientId\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"appVersion\",\"type\":{\"kind\":6},\"optional\":false},{\"kind\":20,\"name\":\"configureTs\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"protocolVersion\",\"type\":{\"kind\":10,\"literal\":2},\"optional\":false},{\"kind\":20,\"name\":\"features\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"ReadonlySet\",\"classType\":{\"$tsf\":4},\"typeArguments\":[{\"kind\":6}]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"supersede\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"meta\",\"type\":{\"kind\":2,\"typeName\":\"T\"},\"optional\":false},{\"kind\":20,\"name\":\"connectedAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"isActivated\",\"type\":{\"kind\":8},\"optional\":false},{\"kind\":20,\"name\":\"lastPingAt\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"connected\",\"type\":{\"kind\":8},\"optional\":false}],\"typeParameters\":[\"T\"]}}]", [() => (typeof Uint8Array !== "undefined" ? Uint8Array : (typeof exports !== "undefined" ? exports.Uint8Array : undefined)), require, () => (typeof WebSocket !== "undefined" ? WebSocket : (typeof exports !== "undefined" ? exports.WebSocket : undefined)), () => (typeof Map !== "undefined" ? Map : (typeof exports !== "undefined" ? exports.Map : undefined)), () => (typeof ReadonlySet !== "undefined" ? ReadonlySet : (typeof exports !== "undefined" ? exports.ReadonlySet : undefined))], __tsf_metadata_type);
119
130
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/srpc/types.ts"],"names":[],"mappings":";;;;;;;;;AAkDA,eAAuB,SAAQ,KAAK;IAGrB,WAAW;IAFtB,YACI,OAAe,EACR,WAAqB;QAE5B,KAAK,CAAC,OAAO,CAAC,CAAC;2BAFR,WAAW;QAGlB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC5B,CAAC;;CACJ;;;;;AA2DD,6BAAqC,SAAQ,KAAK;IAC9C,YAAY,QAAgB;QACxB,KAAK,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IAC1C,CAAC;;CACJ;;;;;AAED,8BAAsC,SAAQ,KAAK;IAC/C,YAAY,QAAgB;QACxB,KAAK,CAAC,oCAAoC,QAAQ,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IAC3C,CAAC;;CACJ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ACJ;;;;AAWD,mCAAmD,OAA8C;IAC7F,OAAO,OAAO,OAAO,KAAK,UAAU,IAAI,OAAQ,OAAgD,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,CAAC;AACtI,CAAC;AAED,2BAAqC,KAAwB,EAAE,OAAU;IACrE,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/D,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/D,CAAC"}
@@ -195,6 +195,7 @@ interface CreateAppOptions<C extends BaseAppConfig = BaseAppConfig> extends Modu
195
195
  cors?: HttpCorsConfig<C>;
196
196
  staticFiles?: boolean | StaticFilesOptions;
197
197
  httpResolvers?: RouteParameterResolverRegistry;
198
+ fallbackController?: ClassType<HttpFallbackController>;
198
199
  enableHealthcheck?: boolean;
199
200
  enableWorker?: boolean;
200
201
  enableDkRpc?: boolean;
@@ -203,26 +204,27 @@ interface CreateAppOptions<C extends BaseAppConfig = BaseAppConfig> extends Modu
203
204
 
204
205
  Common fields:
205
206
 
206
- | Option | Description |
207
- | ------------------- | --------------------------------------------------------------------------------------------- |
208
- | `config` | Config class. Defaults to `BaseAppConfig`. |
209
- | `defaultConfig` | Default values applied before env files and `Env`. |
210
- | `envPassthrough` | Patterns for dynamic resolved config keys that should be copied into `process.env`. |
211
- | `db` | Database class from `createDatabase`, `createMySQLDatabase`, or `createPostgresDatabase`. |
212
- | `controllers` | HTTP controllers registered with the owned router. |
213
- | `providers` | DI providers. Classes, `useValue`, `useClass`, `useExisting`, and `useFactory` are supported. |
214
- | `imports` | Imported modules. Exported providers from imported modules become globally injectable. |
215
- | `exports` | Providers exported by this module for global injection. |
216
- | `listeners` | Lifecycle/event listener classes. |
217
- | `commands` | Classes decorated with `@cli.command()` or `@cli.controller()`. |
218
- | `frameworkConfig` | HTTP runtime options; `port` overrides `config.PORT`. |
219
- | `serverConfig` | Secondary HTTP runtime options; `frameworkConfig` takes precedence for `port`. |
220
- | `cors` | Static CORS options or a config-driven factory. |
221
- | `staticFiles` | Static-file options, or `true` for the default `static/` directory with SPA fallback. |
222
- | `httpResolvers` | App-wide custom HTTP parameter resolvers keyed by reflected class name. |
223
- | `enableHealthcheck` | Set to `false` to skip the default `/healthz` endpoint. |
224
- | `enableWorker` | Registers worker services and job runners. |
225
- | `enableDkRpc` | Legacy compatibility flag; the current runtime does not act on it. |
207
+ | Option | Description |
208
+ | -------------------- | --------------------------------------------------------------------------------------------------- |
209
+ | `config` | Config class. Defaults to `BaseAppConfig`. |
210
+ | `defaultConfig` | Default values applied before env files and `Env`. |
211
+ | `envPassthrough` | Patterns for dynamic resolved config keys that should be copied into `process.env`. |
212
+ | `db` | Database class from `createDatabase`, `createMySQLDatabase`, or `createPostgresDatabase`. |
213
+ | `controllers` | HTTP controllers registered with the owned router. |
214
+ | `providers` | DI providers. Classes, `useValue`, `useClass`, `useExisting`, and `useFactory` are supported. |
215
+ | `imports` | Imported modules. Exported providers from imported modules become globally injectable. |
216
+ | `exports` | Providers exported by this module for global injection. |
217
+ | `listeners` | Lifecycle/event listener classes. |
218
+ | `commands` | Classes decorated with `@cli.command()` or `@cli.controller()`. |
219
+ | `frameworkConfig` | HTTP runtime options; `port` overrides `config.PORT`. |
220
+ | `serverConfig` | Secondary HTTP runtime options; `frameworkConfig` takes precedence for `port`. |
221
+ | `cors` | Static CORS options or a config-driven factory. |
222
+ | `staticFiles` | Static-file options, or `true` for the default `static/` directory with SPA fallback. |
223
+ | `httpResolvers` | App-wide custom HTTP parameter resolvers keyed by reflected class name. |
224
+ | `fallbackController` | Request-scoped controller for unmatched `GET` and `HEAD` requests, such as a frontend SSR renderer. |
225
+ | `enableHealthcheck` | Set to `false` to skip the default `/healthz` endpoint. |
226
+ | `enableWorker` | Registers worker services and job runners. |
227
+ | `enableDkRpc` | Legacy compatibility flag; the current runtime does not act on it. |
226
228
 
227
229
  ## Application And HTTP Runtime
228
230
 
@@ -33,7 +33,7 @@ Controller and method paths are joined with one `/`; leading, repeated, and fina
33
33
 
34
34
  Methods match exactly. A `GET` route does not implicitly handle `HEAD`; declare `@http.HEAD()` when the endpoint supports it. Matching also follows declaration and registration order rather than preferring literal paths over parameters, so place `/fixed` before `/:id` when both can match the same request. Controllers exported by imported modules join the same route table and retain module-local DI resolution. If no exact route matches, the router runs `onRouteNotFound` and then returns the normalized `404` response unless a listener has completed the response.
35
35
 
36
- When the app listens outside `APP_ENV=test`, startup output includes the registered HTTP route count, routes grouped by controller, the bound URL, and a final started line. This makes silent server starts easier to diagnose.
36
+ When the app listens outside `APP_ENV=test`, startup output includes the registered HTTP route count, routes grouped by controller, the bound URL, and a final started line. This makes silent server starts easier to diagnose. A configured fallback controller is intentionally not included in that route count because it runs only after normal route matching fails.
37
37
 
38
38
  ## HTTP Runtime
39
39
 
@@ -75,6 +75,7 @@ The request pipeline is:
75
75
  CORS preflight short circuit
76
76
  -> prepare CORS response headers
77
77
  -> static GET handling when no registered route matches
78
+ -> onRouteNotFound workflow and GET/HEAD fallback controller when no route or static file handled the request
78
79
  -> onRoute workflow
79
80
  -> multipart guard, or raw-stream bypass
80
81
  -> controller middleware, then route middleware
@@ -452,3 +453,39 @@ const app = createApp({
452
453
  ```
453
454
 
454
455
  `staticFiles: true` uses the default `static/` directory. `directory` defaults to `static`, `index` to `index.html`, and `spaFallback` to the selected index. A custom fallback is served when no concrete file exists. Static handling is GET-only and never shadows a registered route; unsafe decoded paths return `400`.
456
+
457
+ Set `spaFallback: false` to serve only concrete files and leave a missing path to the normal router `404` flow.
458
+
459
+ ## Fallback Controllers And SSR
460
+
461
+ An app can register one request-scoped fallback controller for frontend SSR or another default HTML response. It receives every unmatched `GET` or `HEAD` request, including nested paths, without declaring a route for each frontend page:
462
+
463
+ ```typescript
464
+ import { HttpRequest, HttpResponse, createApp, http, rawResponse } from '@zyno-io/ts-server-foundation';
465
+
466
+ @http.fallback()
467
+ class WebController {
468
+ constructor(private readonly renderer: WebRenderer) {}
469
+
470
+ async handle(request: HttpRequest, _response: HttpResponse) {
471
+ const page = await this.renderer.render(request.url);
472
+ return rawResponse(page.html, {
473
+ statusCode: page.status,
474
+ contentType: 'text/html; charset=utf-8',
475
+ headers: page.headers
476
+ });
477
+ }
478
+ }
479
+
480
+ const app = createApp({
481
+ controllers: [ApiController],
482
+ fallbackController: WebController,
483
+ staticFiles: { directory: 'dist/client' }
484
+ });
485
+ ```
486
+
487
+ Concrete controller routes always win. If `staticFiles` is configured, real files such as Vite assets are served before the fallback controller. The controller is then responsible for routing `/`, `/products/a`, and other frontend URLs through its React or Vue SSR bundle. It can return a `404` response when the frontend router has no matching page. `HEAD` runs the same handler, while the runtime suppresses the response body.
488
+
489
+ `fallbackController` implicitly disables static `index.html` and SPA-fallback handling so Vite's browser entrypoint cannot bypass SSR. Supplying `staticFiles.spaFallback` together with `fallbackController` fails startup because both would answer the same unmatched request. Existing `onRouteNotFound` workflow listeners run first and can end the response before the fallback controller runs.
490
+
491
+ The framework does not depend on React, Vue, or Vite. Build the browser bundle into `dist/client`, load the framework-specific SSR bundle from the fallback controller, and hydrate it with the matching browser entrypoint. Render data should be intentionally public and safely serialized before it is embedded into the HTML.