stitchkit 0.26.0 → 0.28.0

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 (51) hide show
  1. package/dist/browser/client.d.ts.map +1 -1
  2. package/dist/browser/http.d.ts +7 -1
  3. package/dist/browser/http.d.ts.map +1 -1
  4. package/dist/cli.js +2 -2
  5. package/dist/contract/define.d.ts +60 -3
  6. package/dist/contract/define.d.ts.map +1 -1
  7. package/dist/contract/index.js +1 -1
  8. package/dist/{index-bkccbx64.js → index-17jpjnhd.js} +196 -44
  9. package/dist/{index-q5w3cvvp.js → index-4whcb3c3.js} +3 -1
  10. package/dist/{index-dzx781tm.js → index-9g9d6r1h.js} +40 -4
  11. package/dist/{index-tje0q6gp.js → index-czmqks7r.js} +6 -1
  12. package/dist/{index-p6fge9a5.js → index-jvescqgr.js} +1 -1
  13. package/dist/{index-h4y2wg3n.js → index-pmftwk2a.js} +18 -0
  14. package/dist/index.js +20 -8
  15. package/dist/node.d.ts +1 -1
  16. package/dist/node.d.ts.map +1 -1
  17. package/dist/node.js +7 -7
  18. package/dist/observability/context.d.ts +8 -4
  19. package/dist/observability/context.d.ts.map +1 -1
  20. package/dist/observability/index.js +6 -8
  21. package/dist/server/create.d.ts +2 -2
  22. package/dist/server/create.d.ts.map +1 -1
  23. package/dist/server/implement.d.ts.map +1 -1
  24. package/dist/server/index.d.ts +3 -2
  25. package/dist/server/index.d.ts.map +1 -1
  26. package/dist/server/index.js +19 -7
  27. package/dist/server/logger.d.ts +36 -4
  28. package/dist/server/logger.d.ts.map +1 -1
  29. package/dist/server/logging.d.ts +20 -0
  30. package/dist/server/logging.d.ts.map +1 -0
  31. package/dist/server/middleware/cors.d.ts +25 -0
  32. package/dist/server/middleware/cors.d.ts.map +1 -1
  33. package/dist/server/node.d.ts +2 -2
  34. package/dist/server/node.d.ts.map +1 -1
  35. package/dist/server/openapi.d.ts.map +1 -1
  36. package/dist/server/router.d.ts +27 -0
  37. package/dist/server/router.d.ts.map +1 -1
  38. package/dist/server/types.d.ts +116 -4
  39. package/dist/server/types.d.ts.map +1 -1
  40. package/dist/tools/list-names.d.ts +2 -1
  41. package/dist/tools/list-names.d.ts.map +1 -1
  42. package/dist/tools/mount.d.ts.map +1 -1
  43. package/dist/tools/remote.d.ts.map +1 -1
  44. package/dist/tools/tool-logger.d.ts +7 -0
  45. package/dist/tools/tool-logger.d.ts.map +1 -1
  46. package/dist/tools.js +29 -14
  47. package/llms-full.txt +234 -14
  48. package/llms.txt +1 -1
  49. package/package.json +1 -1
  50. package/dist/index-khwedj16.js +0 -40
  51. /package/dist/{index-0d0rb85d.js → index-zza375qp.js} +0 -0
@@ -1,5 +1,6 @@
1
1
  // src/server/middleware/cors.ts
2
2
  var DEFAULT_CORS_ALLOW_HEADERS = "Content-Type, Authorization, X-Trace-Id, traceparent, tracestate";
3
+ var DEFAULT_CORS_EXPOSE_HEADERS = "Content-Disposition, Content-Length, Content-Range, Accept-Ranges, ETag, Last-Modified, X-Request-Id";
3
4
  function assertCorsConfig(config) {
4
5
  if (config.credentials && (config.origin === undefined || config.origin === "*")) {
5
6
  throw new Error("[stitchkit] cors: `credentials: true` cannot be combined with a wildcard origin. " + "Set `origin` to an explicit string or list.");
@@ -23,6 +24,10 @@ function corsHeaders(config, requestOrigin) {
23
24
  "Access-Control-Allow-Methods": config.methods ?? "GET, POST, PUT, PATCH, DELETE, OPTIONS",
24
25
  "Access-Control-Allow-Headers": config.headers ?? DEFAULT_CORS_ALLOW_HEADERS
25
26
  };
27
+ const expose = Array.isArray(config.exposeHeaders) ? config.exposeHeaders.join(", ") : config.exposeHeaders ?? DEFAULT_CORS_EXPOSE_HEADERS;
28
+ if (expose !== "") {
29
+ headers["Access-Control-Expose-Headers"] = expose;
30
+ }
26
31
  if (allowOrigin !== undefined) {
27
32
  headers["Access-Control-Allow-Origin"] = allowOrigin;
28
33
  if (config.credentials) {
@@ -41,4 +46,4 @@ function corsPreflightResponse(config, req) {
41
46
  });
42
47
  }
43
48
 
44
- export { DEFAULT_CORS_ALLOW_HEADERS, assertCorsConfig, corsHeaders, corsPreflightResponse };
49
+ export { DEFAULT_CORS_ALLOW_HEADERS, DEFAULT_CORS_EXPOSE_HEADERS, assertCorsConfig, corsHeaders, corsPreflightResponse };
@@ -3,7 +3,7 @@ import {
3
3
  bytesToBase64Url,
4
4
  forbidden,
5
5
  unauthorized
6
- } from "./index-0d0rb85d.js";
6
+ } from "./index-zza375qp.js";
7
7
  import {
8
8
  isRecord,
9
9
  isUnsafeKey,
@@ -10,6 +10,8 @@ function defineContract(meta, endpoints) {
10
10
  if (ep.desc.trim() === "") {
11
11
  throw new Error(`Contract "${meta.prefix}": endpoint "${key}" has an empty desc`);
12
12
  }
13
+ if (ep.rawResponse)
14
+ assertRawEndpoint(meta.prefix, key, ep);
13
15
  if (!("toolName" in ep) || !ep.toolName)
14
16
  continue;
15
17
  const transports = new Set(ep.expose ? ep.expose.filter((t) => t !== "HTTP") : ["MCP", "AGENT"]);
@@ -30,6 +32,22 @@ function defineContract(meta, endpoints) {
30
32
  }
31
33
  return { meta, endpoints };
32
34
  }
35
+ function assertRawEndpoint(prefix, key, ep) {
36
+ const where = `Contract "${prefix}": raw endpoint "${key}"`;
37
+ if (ep.output)
38
+ throw new Error(`${where} cannot declare an output schema`);
39
+ if ("toolName" in ep && ep.toolName)
40
+ throw new Error(`${where} cannot set a toolName`);
41
+ if ("ui" in ep && ep.ui)
42
+ throw new Error(`${where} cannot set MCP ui metadata`);
43
+ if ("annotations" in ep && ep.annotations) {
44
+ throw new Error(`${where} cannot set MCP annotations`);
45
+ }
46
+ const nonHttp = (ep.expose ?? []).filter((t) => t !== "HTTP");
47
+ if (nonHttp.length > 0) {
48
+ throw new Error(`${where} is HTTP-only — remove ${nonHttp.join(", ")} from expose`);
49
+ }
50
+ }
33
51
  // src/contract/errors.ts
34
52
  var APP_ERROR_BRAND = Symbol.for("stitchkit.AppError");
35
53
 
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  paginatedSchema,
17
17
  rateLimited,
18
18
  unauthorized
19
- } from "./index-h4y2wg3n.js";
19
+ } from "./index-pmftwk2a.js";
20
20
  import {
21
21
  isRecord,
22
22
  mapObject,
@@ -207,6 +207,9 @@ function createHttpClient(config) {
207
207
  if (options.responseType === "blob") {
208
208
  return client[method](url, kyOptions).blob();
209
209
  }
210
+ if (options.responseType === "response") {
211
+ return await client[method](url, kyOptions);
212
+ }
210
213
  const response = await client[method](url, kyOptions);
211
214
  if (response.status === 204 || response.headers.get("content-length") === "0") {
212
215
  return;
@@ -248,10 +251,15 @@ function createHttpClient(config) {
248
251
  }
249
252
 
250
253
  // src/browser/client.ts
251
- function withTimeout(options, timeout) {
252
- if (timeout === undefined)
254
+ function withTimeout(options, endpoint) {
255
+ const responseType = endpoint.rawResponse ? "response" : undefined;
256
+ if (endpoint.timeout === undefined && responseType === undefined)
253
257
  return options;
254
- return { ...options, timeout };
258
+ return {
259
+ ...options,
260
+ ...endpoint.timeout !== undefined && { timeout: endpoint.timeout },
261
+ ...responseType && { responseType }
262
+ };
255
263
  }
256
264
  function withOutput(endpoint, result) {
257
265
  const schema = endpoint.output;
@@ -331,15 +339,15 @@ function createHttpMethod(endpoint, prefix, client, config) {
331
339
  const formData = new FormData;
332
340
  appendMultipartFile(formData, endpoint.multipart, file);
333
341
  appendFormFields(formData, firstArg, new Set([...prefixKeys, endpoint.multipart]));
334
- return withOutput(endpoint, client[httpMethod](url, formData, withTimeout(undefined, endpoint.timeout)));
342
+ return withOutput(endpoint, client[httpMethod](url, formData, withTimeout(undefined, endpoint)));
335
343
  }
336
344
  if (isGet) {
337
345
  const params = collectQueryParams(firstArg, prefixKeys, endpoint);
338
- return withOutput(endpoint, client.get(url, withTimeout(params ? { params } : undefined, endpoint.timeout)));
346
+ return withOutput(endpoint, client.get(url, withTimeout(params ? { params } : undefined, endpoint)));
339
347
  }
340
348
  if (httpMethod === "delete") {
341
349
  const params = collectQueryParams(firstArg, prefixKeys, endpoint);
342
- return withOutput(endpoint, client.delete(url, withTimeout(params ? { params } : undefined, endpoint.timeout)));
350
+ return withOutput(endpoint, client.delete(url, withTimeout(params ? { params } : undefined, endpoint)));
343
351
  }
344
352
  const payload = {};
345
353
  for (const [key, value] of Object.entries(firstArg)) {
@@ -347,7 +355,7 @@ function createHttpMethod(endpoint, prefix, client, config) {
347
355
  payload[key] = value;
348
356
  }
349
357
  }
350
- return withOutput(endpoint, client[httpMethod](url, Object.keys(payload).length > 0 ? payload : undefined, withTimeout(undefined, endpoint.timeout)));
358
+ return withOutput(endpoint, client[httpMethod](url, Object.keys(payload).length > 0 ? payload : undefined, withTimeout(undefined, endpoint)));
351
359
  };
352
360
  }
353
361
  function createFetchMethod(endpoint, prefix, config, contractConfig) {
@@ -403,6 +411,8 @@ function createFetchMethod(endpoint, prefix, config, contractConfig) {
403
411
  if (!res2.ok) {
404
412
  await throwForErrorResponse(res2, config, null);
405
413
  }
414
+ if (endpoint.rawResponse)
415
+ return res2;
406
416
  if (res2.status === 204)
407
417
  return;
408
418
  const json2 = await res2.json();
@@ -420,6 +430,8 @@ function createFetchMethod(endpoint, prefix, config, contractConfig) {
420
430
  if (!res.ok) {
421
431
  await throwForErrorResponse(res, config, { error: res.statusText });
422
432
  }
433
+ if (endpoint.rawResponse)
434
+ return res;
423
435
  if (res.status === 204)
424
436
  return;
425
437
  const json = await res.json();
package/dist/node.d.ts CHANGED
@@ -9,5 +9,5 @@ export { createHandler } from './server/create';
9
9
  export { createImplement, implement } from './server/implement';
10
10
  export { type NodeServerConfig, type NodeServerHandle, serveNode } from './server/node';
11
11
  export { createSocketIOServer, type SocketIOServerConfig, type SocketIOServerHandle, } from './server/socket-io';
12
- export type { HandlerConfig, RawRoute, RawRouteContext, ServiceDef, } from './server/types';
12
+ export type { FetchComposition, FetchHandler, HandlerConfig, LoggingConfig, LogOutcome, RawRoute, RawRouteContext, ServiceDef, } from './server/types';
13
13
  //# sourceMappingURL=node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,aAAa,EACb,QAAQ,EACR,eAAe,EACf,UAAU,GACX,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,UAAU,EACV,QAAQ,EACR,eAAe,EACf,UAAU,GACX,MAAM,gBAAgB,CAAC"}
package/dist/node.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  createImplement,
4
4
  createSocketIOServer,
5
5
  implement
6
- } from "./index-bkccbx64.js";
7
- import"./index-tje0q6gp.js";
6
+ } from "./index-17jpjnhd.js";
7
+ import"./index-czmqks7r.js";
8
8
  import {
9
9
  AppError,
10
10
  appError,
@@ -14,16 +14,16 @@ import {
14
14
  notFound,
15
15
  rateLimited,
16
16
  unauthorized
17
- } from "./index-0d0rb85d.js";
18
- import"./index-dzx781tm.js";
19
- import"./index-khwedj16.js";
17
+ } from "./index-zza375qp.js";
18
+ import"./index-9g9d6r1h.js";
20
19
  import"./index-c7nyw0yt.js";
21
20
  // src/server/node.ts
22
21
  import { serve } from "srvx";
23
22
  async function serveNode(config) {
24
- const { port = 3000, hostname, socket, ...handlerConfig } = config;
23
+ const { port = 3000, hostname, socket, wrapFetch, ...handlerConfig } = config;
25
24
  const handler = createHandler(handlerConfig);
26
- const server = serve({ port, hostname, fetch: handler });
25
+ const fetch = wrapFetch ? wrapFetch(handler) : handler;
26
+ const server = serve({ port, hostname, fetch });
27
27
  await server.ready();
28
28
  if (socket) {
29
29
  const nodeServer = server.node?.server;
@@ -97,10 +97,14 @@ export interface WrapRequestContextOptions {
97
97
  * (the inbound `traceparent` continued, or freshly minted), timing and client
98
98
  * info.
99
99
  *
100
- * Compose it as the OUTERMOST wrapper of the server's fetch handler. To make
101
- * the framework router reuse this trace id (so request logs and application
102
- * logs share one id), pass `traceId: getTraceId` to `createServer` /
103
- * `createHandler`.
100
+ * Compose it as the OUTERMOST wrapper of the server's fetch handler — with raw
101
+ * `Bun.serve`, or through `wrapFetch` on `createServer` / `serveNode`, which own
102
+ * their own `fetch`.
103
+ *
104
+ * To make the framework router reuse this trace id (so request logs and
105
+ * application logs share one id), pass `traceId: getTraceId` to `createServer` /
106
+ * `createHandler`: outside an active context it yields `undefined` and the
107
+ * framework falls back to its own resolver.
104
108
  */
105
109
  export declare function wrapInRequestContext<S>(handler: (req: Request, server: S) => Promise<Response>, options?: WrapRequestContextOptions): (req: Request, server: S) => Promise<Response>;
106
110
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/observability/context.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAEjE,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,KAAK,EAAE,YAAY,CAAC;IACpB,4CAA4C;IAC5C,MAAM,EAAE,eAAe,CAAC;IACxB,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;8EAC0E;IAC1E,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAChE;AAID,yDAAyD;AACzD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAE5E;AAED,sEAAsE;AACtE,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,SAAS,CAE9D;AAED,mEAAmE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CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAG7E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAGP;AAED,0CAA0C;AAC1C,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,EACvD,OAAO,GAAE,yBAA8B,GACtC,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,CAiBhD"}
@@ -1,21 +1,19 @@
1
1
  import {
2
+ childSpan,
3
+ createTraceContext,
4
+ formatTraceparent,
2
5
  getRequestContext,
3
6
  getTraceId,
4
7
  getUserId,
8
+ parseTraceparent,
9
+ resolveTraceContext,
5
10
  runWithRequestContext,
6
11
  setRequestDimensions,
7
12
  setRequestEndpoint,
8
13
  setRequestError,
9
14
  setRequestUser,
10
15
  wrapInRequestContext
11
- } from "../index-dzx781tm.js";
12
- import {
13
- childSpan,
14
- createTraceContext,
15
- formatTraceparent,
16
- parseTraceparent,
17
- resolveTraceContext
18
- } from "../index-khwedj16.js";
16
+ } from "../index-9g9d6r1h.js";
19
17
  import {
20
18
  isRecord,
21
19
  isUnsafeKey
@@ -1,4 +1,4 @@
1
- import type { BunServerConfig, HandlerConfig } from './types';
2
- export declare function createHandler(config: HandlerConfig): (req: Request) => Promise<Response>;
1
+ import type { BunServerConfig, FetchHandler, HandlerConfig } from './types';
2
+ export declare function createHandler(config: HandlerConfig): FetchHandler;
3
3
  export declare function createServer(config: BunServerConfig): Bun.Server<unknown>;
4
4
  //# sourceMappingURL=create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/server/create.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAEV,eAAe,EACf,aAAa,EAGd,MAAM,SAAS,CAAC;AAEjB,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CA0OxF;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,uBAsBnD"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/server/create.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACZ,aAAa,EAGd,MAAM,SAAS,CAAC;AAEjB,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAoVjE;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,uBAuBnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"implement.d.ts","sourceRoot":"","sources":["../../src/server/implement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG5E,OAAO,KAAK,EAAE,QAAQ,EAAa,UAAU,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACrC,IAAI,SAAS,cAAc,GAAG,cAAc,EAC5C,QAAQ,EAAE,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU,CAgD3E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,SAAS,cAAc,MACjD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAC3C,UAAU,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EAChC,UAAU,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,KAC1B,UAAU,CACd"}
1
+ {"version":3,"file":"implement.d.ts","sourceRoot":"","sources":["../../src/server/implement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG5E,OAAO,KAAK,EAAE,QAAQ,EAAa,UAAU,EAAE,MAAM,SAAS,CAAC;AAK/D;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACrC,IAAI,SAAS,cAAc,GAAG,cAAc,EAC5C,QAAQ,EAAE,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU,CAyD3E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,SAAS,cAAc,MACjD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAC3C,UAAU,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EAChC,UAAU,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,KAC1B,UAAU,CACd"}
@@ -1,5 +1,6 @@
1
1
  export { AppError, appError, badRequest, conflict, forbidden, isStitchErrorCode, notFound, rateLimited, STITCH_ERROR_STATUS, type StitchErrorCode, unauthorized, } from '../contract';
2
2
  export { errorCode, formatZodError, normalizeError, type ZodIssueSummary, zodIssues, } from '../internal/errors';
3
+ export { isWithinDir } from '../internal/within-dir';
3
4
  export { cacheHeaders, createCache } from './cache';
4
5
  export { createHandler, createServer } from './create';
5
6
  export { createErrorHook, type ErrorHookConfig, type ResolvedError, } from './error-hook';
@@ -8,7 +9,7 @@ export { type ByteRange, parseByteRange, type ServeFileOptions, serveFile, weakE
8
9
  export { createImplement, implement } from './implement';
9
10
  export { type AuthHook, type AuthHookConfig, type AuthRule, type BearerResolverConfig, createAuthHook, createBearerResolver, extractToken, type JwtPayload, type SignJwtOptions, signJwt, verifyJwt, } from './middleware/auth';
10
11
  export { type CookieDef, type CookieOptions, defineCookie, parseCookies, serializeCookie, } from './middleware/cookies';
11
- export { type CorsConfig, corsHeaders, corsPreflightResponse, DEFAULT_CORS_ALLOW_HEADERS, } from './middleware/cors';
12
+ export { type CorsConfig, corsHeaders, corsPreflightResponse, DEFAULT_CORS_ALLOW_HEADERS, DEFAULT_CORS_EXPOSE_HEADERS, } from './middleware/cors';
12
13
  export { deriveCodeChallenge, type PkceMethod, verifyPkce } from './middleware/pkce';
13
14
  export { parseMultipart } from './multipart';
14
15
  export { generateOpenApiDocument, type OpenApiConfig, type OpenApiDocument, type OpenApiInfo, type OpenApiServer, openApiRoute, } from './openapi';
@@ -19,6 +20,6 @@ export { staticRoute } from './router';
19
20
  export type { SocketIOServerConfig, SocketIOServerHandle } from './socket-io';
20
21
  export { createSocketIOServer, socketIoLane } from './socket-io';
21
22
  export { type ParseSSEOptions, parseSSE, streamSSE } from './stream';
22
- export type { BunServer, BunServerConfig, HandlerConfig, Handlers, LifecycleHooks, MethodDef, RawRoute, RawRouteContext, RouteGroup, ServerPassthrough, ServiceDef, StitchLogger, } from './types';
23
+ export type { BunServer, BunServerConfig, FetchComposition, FetchHandler, HandlerConfig, Handlers, LifecycleHooks, LoggingConfig, LogOutcome, MethodDef, RawRoute, RawRouteContext, RouteGroup, ServerPassthrough, ServiceDef, StitchLogger, } from './types';
23
24
  export { type ComposedLane, composeWebSocketHandlers, type WebSocketComposeConfig, type WebSocketLane, webSocketLane, } from './websocket';
24
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,UAAU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AuB,EACvB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EACpB,SAAS,EACT,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,KAAK,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrE,YAAY,EACV,SAAS,EACT,eAAe,EACf,aAAa,EACb,QAAQ,EACR,cAAc,EACd,SAAS,EACT,QAAQ,EACR,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,YAAY,EACjB,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,aAAa,GACd,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,KAAK,eAAe,EACpB,YAAY,GACb,MAAM,aAAa,CAAC;AAIrB,OAAO,EACL,SAAS,EACT,cAAc,EACd,cAAc,EACd,KAAK,eAAe,EACpB,SAAS,GACV,MA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,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EACpB,SAAS,EACT,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,KAAK,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrE,YAAY,EACV,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,aAAa,EACb,UAAU,EACV,SAAS,EACT,QAAQ,EACR,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,YAAY,EACjB,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,aAAa,GACd,MAAM,aAAa,CAAC"}
@@ -10,7 +10,7 @@ import {
10
10
  socketIoLane,
11
11
  staticRoute,
12
12
  webSocketLane
13
- } from "../index-bkccbx64.js";
13
+ } from "../index-17jpjnhd.js";
14
14
  import {
15
15
  createAuthHook,
16
16
  createBearerResolver,
@@ -23,12 +23,13 @@ import {
23
23
  signJwt,
24
24
  verifyJwt,
25
25
  verifyPkce
26
- } from "../index-p6fge9a5.js";
26
+ } from "../index-jvescqgr.js";
27
27
  import {
28
28
  DEFAULT_CORS_ALLOW_HEADERS,
29
+ DEFAULT_CORS_EXPOSE_HEADERS,
29
30
  corsHeaders,
30
31
  corsPreflightResponse
31
- } from "../index-tje0q6gp.js";
32
+ } from "../index-czmqks7r.js";
32
33
  import {
33
34
  jsonSchemaFields,
34
35
  toJsonSchema
@@ -43,12 +44,13 @@ import {
43
44
  forbidden,
44
45
  formatZodError,
45
46
  isStitchErrorCode,
47
+ isWithinDir,
46
48
  normalizeError,
47
49
  notFound,
48
50
  rateLimited,
49
51
  unauthorized,
50
52
  zodIssues
51
- } from "../index-0d0rb85d.js";
53
+ } from "../index-zza375qp.js";
52
54
  import {
53
55
  extractIp,
54
56
  generateTraceId,
@@ -56,8 +58,7 @@ import {
56
58
  getTraceId,
57
59
  resolveSocketIp,
58
60
  resolveTraceId
59
- } from "../index-dzx781tm.js";
60
- import"../index-khwedj16.js";
61
+ } from "../index-9g9d6r1h.js";
61
62
  import {
62
63
  isRecord
63
64
  } from "../index-c7nyw0yt.js";
@@ -425,7 +426,16 @@ function generateOpenApiDocument(config) {
425
426
  }
426
427
  }
427
428
  const responses = { ...errorResponses(method.scope) };
428
- if (method.outputSchema) {
429
+ if (method.rawResponse) {
430
+ responses["200"] = {
431
+ description: "Success",
432
+ content: {
433
+ [method.contentType ?? "application/octet-stream"]: {
434
+ schema: { type: "string", format: "binary" }
435
+ }
436
+ }
437
+ };
438
+ } else if (method.outputSchema) {
429
439
  responses["200"] = {
430
440
  description: "Success",
431
441
  content: { "application/json": { schema: safeJson(method.outputSchema, "output") } }
@@ -645,6 +655,7 @@ export {
645
655
  openApiRoute,
646
656
  notFound,
647
657
  normalizeError,
658
+ isWithinDir,
648
659
  isStitchErrorCode,
649
660
  implement,
650
661
  getClientInfo,
@@ -676,6 +687,7 @@ export {
676
687
  badRequest,
677
688
  appError,
678
689
  STITCH_ERROR_STATUS,
690
+ DEFAULT_CORS_EXPOSE_HEADERS,
679
691
  DEFAULT_CORS_ALLOW_HEADERS,
680
692
  AppError
681
693
  };
@@ -2,14 +2,19 @@
2
2
  export declare function elapsedMs(startTime: number): number;
3
3
  /** Map an HTTP status to a log level. */
4
4
  export declare function levelForStatus(status: number): 'error' | 'warn' | 'info';
5
- /** The structured fields shared by every completed-request log line. */
5
+ /**
6
+ * The structured fields shared by every completed-request log line. `errorCode`
7
+ * is always present, `undefined` on success — a conditional key would let an
8
+ * `enrich` value survive on a 200, and these fields must always win the merge.
9
+ * `JSON.stringify` drops the undefined, so the production line is unchanged.
10
+ */
6
11
  export declare function buildLogFields(method: string, path: string, status: number, durationMs: number, traceId: string, errorCode?: string): {
7
12
  traceId: string;
8
13
  method: string;
9
14
  path: string;
10
15
  status: number;
11
16
  durationMs: number;
12
- errorCode?: string;
17
+ errorCode: string | undefined;
13
18
  };
14
19
  export interface RequestLog {
15
20
  traceId: string;
@@ -18,6 +23,33 @@ export interface RequestLog {
18
23
  export declare function shouldLog(pathname: string, method: string): boolean;
19
24
  /** Open the timing window for a request. Development prints a `→` line. */
20
25
  export declare function logIncoming(req: Request, pathname: string, traceId: string, ipAddress?: string): RequestLog;
21
- /** Close a request. Development: `←` line. Production: one structured JSON line. */
22
- export declare function logOutgoing(req: Request, pathname: string, status: number, log: RequestLog, ipAddress?: string, errorCode?: string): void;
26
+ /**
27
+ * Serialise one structured line: consumer fields under the framework's own. A
28
+ * value `JSON.stringify` refuses (a cycle, a `BigInt`) costs the consumer
29
+ * fields for that line — never the record, which is re-emitted alone.
30
+ */
31
+ export declare function structuredLine(own: Record<string, unknown>, extra?: Record<string, unknown>): string;
32
+ /** One finished request, as the formatter needs it. */
33
+ export interface CompletedRequest {
34
+ req: Request;
35
+ pathname: string;
36
+ status: number;
37
+ log: RequestLog;
38
+ ipAddress?: string;
39
+ errorCode?: string;
40
+ /** Duration the caller already measured — the one `enrich` was shown. */
41
+ durationMs: number;
42
+ /**
43
+ * Consumer-supplied fields for the structured line — request-context
44
+ * identity and whatever `enrich` returned. Spread *first* so the framework's
45
+ * own fields overwrite anything that collides with them.
46
+ */
47
+ extra?: Record<string, unknown>;
48
+ }
49
+ /**
50
+ * Close a request. Development: `←` line — deliberately unchanged by `extra`,
51
+ * it is a line to read, not a record to query. Production: one structured JSON
52
+ * line, enriched.
53
+ */
54
+ export declare function logOutgoing(entry: CompletedRequest): void;
23
55
  //# sourceMappingURL=logger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/server/logger.ts"],"names":[],"mappings":"AAwCA,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnD;AAoBD,yCAAyC;AACzC,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACjB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAEA;AA0BD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAGnE;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CACzB,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACjB,UAAU,CASZ;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CACzB,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,UAAU,EACf,SAAS,CAAC,EAAE,MAAM,EAClB,S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;IAC/B,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,UAAU,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAwBzD"}
@@ -0,0 +1,20 @@
1
+ import type { LoggingConfig, LogOutcome } from './types';
2
+ /**
3
+ * Normalise `logging` into either a config or `null` (off). `true` is shorthand
4
+ * for `{}`: any object turns logging on, and `logger` decides which sink writes.
5
+ */
6
+ export declare function resolveLoggingConfig(logging: boolean | LoggingConfig): LoggingConfig | null;
7
+ /** Consult the consumer's noise filter. A throw means "do not skip". */
8
+ export declare function shouldSkipLog(config: LoggingConfig, req: Request, url: URL): boolean;
9
+ /**
10
+ * The fields a completion line carries beyond the framework's own — the active
11
+ * request context first (free identity: who, which operation, which tenant),
12
+ * then whatever `enrich` returns, which may override it. Both are merged
13
+ * *under* the framework fields by the caller, so neither can corrupt the record.
14
+ *
15
+ * Returns an empty object when no context is active and no `enrich` is set —
16
+ * the cost of observability that was never wired is one `AsyncLocalStorage`
17
+ * lookup.
18
+ */
19
+ export declare function collectExtraLogFields(config: LoggingConfig, req: Request, url: URL, outcome: LogOutcome): Record<string, unknown>;
20
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/server/logging.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAmBzD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,GAAG,aAAa,GAAG,IAAI,CAU3F;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAQpF;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,UAAU,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAyBzB"}
@@ -3,6 +3,12 @@ export interface CorsConfig {
3
3
  credentials?: boolean;
4
4
  methods?: string;
5
5
  headers?: string;
6
+ /**
7
+ * Response headers a cross-origin caller is allowed to *read*
8
+ * (`Access-Control-Expose-Headers`). Defaults to
9
+ * {@link DEFAULT_CORS_EXPOSE_HEADERS}; pass `[]` to emit none.
10
+ */
11
+ exposeHeaders?: string | string[];
6
12
  }
7
13
  /**
8
14
  * The default `Access-Control-Allow-Headers` — the request headers stitchkit's
@@ -17,6 +23,25 @@ export interface CorsConfig {
17
23
  * feature dies on the cross-origin preflight.
18
24
  */
19
25
  export declare const DEFAULT_CORS_ALLOW_HEADERS = "Content-Type, Authorization, X-Trace-Id, traceparent, tracestate";
26
+ /**
27
+ * The default `Access-Control-Expose-Headers`. Without it a cross-origin
28
+ * `fetch` can read only the CORS-safelisted response headers, so a browser
29
+ * downloading a file cannot recover its name (`Content-Disposition`), and a
30
+ * client cannot revalidate (`ETag`) or resume (`Content-Range`) — the very
31
+ * headers `serveFile` exists to emit.
32
+ *
33
+ * An explicit list rather than `*`, because the wildcard is ignored whenever
34
+ * the request carries credentials — exactly the authenticated download case.
35
+ * These are headers the server already chose to send; exposing them reveals
36
+ * nothing new. Opt out with `exposeHeaders: []`.
37
+ *
38
+ * `X-Request-Id` is the trace id every response carries — the id a browser
39
+ * client needs to quote in a bug report and the one a reverse proxy logs.
40
+ * Note the deliberate asymmetry with {@link DEFAULT_CORS_ALLOW_HEADERS}:
41
+ * inbound the id may arrive as `X-Trace-Id`, outbound it is always
42
+ * `X-Request-Id` — one name on the wire out, no alias.
43
+ */
44
+ export declare const DEFAULT_CORS_EXPOSE_HEADERS = "Content-Disposition, Content-Length, Content-Range, Accept-Ranges, ETag, Last-Modified, X-Request-Id";
20
45
  /**
21
46
  * Reject an unsafe CORS config at construction. `credentials: true` with a
22
47
  * wildcard origin would reflect *any* caller's `Origin` with
@@ -1 +1 @@
1
- {"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../../src/server/middleware/cors.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,qEAC6B,CAAC;AAErE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAOzD;AAoBD,wBAAgB,WAAW,CACzB,MAAM,EAAE,UAAU,EAClB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBxB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,GAAG,QAAQ,CAKhF"}
1
+ {"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../../src/server/middleware/cors.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACnC;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,qEAC6B,CAAC;AAErE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,2BAA2B,yGACgE,CAAC;AAEzG;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAOzD;AAoBD,wBAAgB,WAAW,CACzB,MAAM,EAAE,UAAU,EAClB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2BxB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,GAAG,QAAQ,CAKhF"}
@@ -1,6 +1,6 @@
1
1
  import type { Server as HttpServer } from 'node:http';
2
- import type { HandlerConfig } from './types';
3
- export interface NodeServerConfig extends HandlerConfig {
2
+ import type { FetchComposition, HandlerConfig } from './types';
3
+ export interface NodeServerConfig extends HandlerConfig, FetchComposition {
4
4
  port?: number;
5
5
  hostname?: string;
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/server/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC;AAGtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAA;KAAE,CAAC;CAC/C;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA6BnF"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/server/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,aAAa,EAAE,gBAAgB;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAA;KAAE,CAAC;CAC/C;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA8BnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/server/openapi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,W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,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;IACxB,iFAAiF;IACjF,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC,CAAC;IAChE,oCAAoC;IACpC,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,KAAK,OAAO,CAAC;CAC1D;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAChD;AAsED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe,CAmI9E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,QAAQ,CAM9E"}
@@ -27,6 +27,33 @@ export declare function matchRoute(routeMap: RouteMap, httpMethod: string, pathn
27
27
  export declare function allowedMethods(routeMap: RouteMap, pathname: string): string[];
28
28
  /** Startup guard — throws when two routes collapse to the same shape. */
29
29
  export declare function validateRoutes(routeMap: RouteMap): void;
30
+ /** One contract route that a raw route matches first, so the contract route is dead. */
31
+ export interface ShadowedRoute {
32
+ /** The contract route pattern, e.g. `GET /documents/:id/pdf`. */
33
+ pattern: string;
34
+ /** `serviceName.key` of the endpoint that will never run. */
35
+ endpoint: string;
36
+ /** The raw route that wins, e.g. `GET /documents/:id/pdf` or `ALL /files/*`. */
37
+ rawRoute: string;
38
+ /** The shadowed endpoint's scope — the auth gate the raw route bypasses. */
39
+ scope?: string;
40
+ }
41
+ /**
42
+ * Startup diagnostic — raw routes are matched **before** contract routes, so a
43
+ * raw route covering a contract path silently wins and the endpoint never runs.
44
+ *
45
+ * This matters most for the migration raw-response endpoints exist to enable
46
+ * (→ ADR 0038): move a download out of `rawRoutes` into the contract to gain the
47
+ * auth gate, forget to delete the old raw route, and the bytes keep being served
48
+ * ungated — with no error anywhere. Reported, not thrown: an overlapping
49
+ * wildcard (a SPA fallback) can be deliberate, and refusing to boot a working
50
+ * app would be the worse failure.
51
+ *
52
+ * Detection runs the **real** `matchRawRoute` against a concrete probe path
53
+ * built from each contract route, so it can never disagree with what the
54
+ * dispatcher actually does.
55
+ */
56
+ export declare function findShadowedRoutes(routeMap: RouteMap, rawRoutes: RawRoute[] | undefined): ShadowedRoute[];
30
57
  export declare function matchRawRoute(rawRoutes: RawRoute[], httpMethod: string, pathname: string): {
31
58
  route: RawRoute;
32
59
  params: Record<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/server/router.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE/E,4EAA4E;AAC5E,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,UAAU,UAAU;IAClB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED,+EAA+E;AAC/E,MAAM,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