sashiko 0.12.2 → 0.13.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 (74) hide show
  1. package/dist/core/app/core.d.ts +23 -0
  2. package/dist/core/app/core.d.ts.map +1 -0
  3. package/dist/core/app/core.js +2 -0
  4. package/dist/core/app/core.js.map +1 -0
  5. package/dist/core/app/options.d.ts +109 -0
  6. package/dist/core/app/options.d.ts.map +1 -0
  7. package/dist/core/app/options.js +2 -0
  8. package/dist/core/app/options.js.map +1 -0
  9. package/dist/core/app.d.ts +20 -177
  10. package/dist/core/app.d.ts.map +1 -1
  11. package/dist/core/app.js +63 -510
  12. package/dist/core/app.js.map +1 -1
  13. package/dist/core/body-parser.d.ts +6 -3
  14. package/dist/core/body-parser.d.ts.map +1 -1
  15. package/dist/core/body-parser.js +8 -6
  16. package/dist/core/body-parser.js.map +1 -1
  17. package/dist/core/compose.d.ts +7 -0
  18. package/dist/core/compose.d.ts.map +1 -1
  19. package/dist/core/compose.js +25 -0
  20. package/dist/core/compose.js.map +1 -1
  21. package/dist/core/context.d.ts +31 -45
  22. package/dist/core/context.d.ts.map +1 -1
  23. package/dist/core/context.js +99 -159
  24. package/dist/core/context.js.map +1 -1
  25. package/dist/core/health.js +1 -1
  26. package/dist/core/index.d.ts +1 -1
  27. package/dist/core/index.d.ts.map +1 -1
  28. package/dist/core/logger.d.ts.map +1 -1
  29. package/dist/core/logger.js +41 -14
  30. package/dist/core/logger.js.map +1 -1
  31. package/dist/core/registry/framework-routes.d.ts +28 -0
  32. package/dist/core/registry/framework-routes.d.ts.map +1 -0
  33. package/dist/core/registry/framework-routes.js +83 -0
  34. package/dist/core/registry/framework-routes.js.map +1 -0
  35. package/dist/core/registry/registry.d.ts +53 -0
  36. package/dist/core/registry/registry.d.ts.map +1 -0
  37. package/dist/core/registry/registry.js +156 -0
  38. package/dist/core/registry/registry.js.map +1 -0
  39. package/dist/core/registry/route-program.d.ts +14 -0
  40. package/dist/core/registry/route-program.d.ts.map +1 -0
  41. package/dist/core/registry/route-program.js +29 -0
  42. package/dist/core/registry/route-program.js.map +1 -0
  43. package/dist/core/response/pipeline.d.ts +51 -0
  44. package/dist/core/response/pipeline.d.ts.map +1 -0
  45. package/dist/core/response/pipeline.js +171 -0
  46. package/dist/core/response/pipeline.js.map +1 -0
  47. package/dist/core/route-table.d.ts +5 -1
  48. package/dist/core/route-table.d.ts.map +1 -1
  49. package/dist/core/route-table.js +1 -1
  50. package/dist/core/route-table.js.map +1 -1
  51. package/dist/core/runtime/request-handler.d.ts +42 -0
  52. package/dist/core/runtime/request-handler.d.ts.map +1 -0
  53. package/dist/core/runtime/request-handler.js +187 -0
  54. package/dist/core/runtime/request-handler.js.map +1 -0
  55. package/dist/core/runtime/server.d.ts +41 -0
  56. package/dist/core/runtime/server.d.ts.map +1 -0
  57. package/dist/core/runtime/server.js +155 -0
  58. package/dist/core/runtime/server.js.map +1 -0
  59. package/dist/core/streaming/sse.d.ts +35 -0
  60. package/dist/core/streaming/sse.d.ts.map +1 -0
  61. package/dist/core/streaming/sse.js +121 -0
  62. package/dist/core/streaming/sse.js.map +1 -0
  63. package/dist/core/symbols.d.ts +14 -0
  64. package/dist/core/symbols.d.ts.map +1 -0
  65. package/dist/core/symbols.js +14 -0
  66. package/dist/core/symbols.js.map +1 -0
  67. package/dist/server/static.d.ts +1 -1
  68. package/dist/server/static.d.ts.map +1 -1
  69. package/dist/server/static.js +1 -1
  70. package/dist/server/static.js.map +1 -1
  71. package/dist/utils/content-type.d.ts.map +1 -1
  72. package/dist/utils/content-type.js +26 -6
  73. package/dist/utils/content-type.js.map +1 -1
  74. package/package.json +1 -1
@@ -0,0 +1,23 @@
1
+ import type http from 'node:http';
2
+ import type { Middleware } from '../compose.ts';
3
+ import type { Context, OnSendHook } from '../context.ts';
4
+ import type { Logger } from '../logger.ts';
5
+ import type { Serializer } from '../response/pipeline.ts';
6
+ import type { AppOptions, OnCloseHook, OnResponseHook } from './options.ts';
7
+ /**
8
+ * Estado compartilhado do app entre a fachada (`SashikoApp`) e os componentes internos (registro,
9
+ * servidor, pipeline da requisição). Só configuração e listas de hooks; nada por requisição.
10
+ */
11
+ export interface AppCore {
12
+ readonly opts: AppOptions;
13
+ readonly log: Logger;
14
+ readonly middlewares: Middleware[];
15
+ readonly errorHandlers: ((err: unknown, ctx: Context) => void | Promise<void>)[];
16
+ readonly onSendHooks: OnSendHook[];
17
+ readonly onResponseHooks: OnResponseHook[];
18
+ readonly onCloseHooks: OnCloseHook[];
19
+ readonly serializers: ReadonlyMap<string, Serializer>;
20
+ readonly allowedHosts: ((hostname: string, host: string) => boolean) | undefined;
21
+ readonly applySecurityHeaders: ((res: http.ServerResponse) => void) | undefined;
22
+ }
23
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/core/app/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IACjF,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,cAAc,EAAE,CAAC;IAC3C,QAAQ,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtD,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAAC;IACjF,QAAQ,CAAC,oBAAoB,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACjF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/core/app/core.ts"],"names":[],"mappings":""}
@@ -0,0 +1,109 @@
1
+ import type { Context } from '../context.ts';
2
+ import type { ErrorFormatter } from '../errors.ts';
3
+ import type { Logger } from '../logger.ts';
4
+ import type { Serializer } from '../response/pipeline.ts';
5
+ import type { ShutdownOptions } from '../shutdown.ts';
6
+ import type { TlsOptions } from '../../server/tls.ts';
7
+ import type { ProtoPoisoning } from '../../utils/safe-json.ts';
8
+ import type { SecurityHeadersOptions, SecurityPreset } from '../../middlewares/security-headers.ts';
9
+ /** Depois do envio da resposta (F-04). */
10
+ export type OnResponseHook = (ctx: Context, info: {
11
+ status: number;
12
+ ms: number;
13
+ }) => void | Promise<void>;
14
+ /** No `close()` do app (F-04). */
15
+ export type OnCloseHook = () => void | Promise<void>;
16
+ export interface ListenOptions {
17
+ /** Padrão: 3000. Use 0 para uma porta livre aleatória. */
18
+ port?: number;
19
+ /** Padrão: `127.0.0.1`. Use `0.0.0.0` para aceitar conexões externas (ex.: em containers). */
20
+ host?: string;
21
+ /**
22
+ * Sobe em HTTPS, com os mesmos timeouts, encerramento gracioso e `close()` do HTTP. Atrás de um
23
+ * proxy que termina o TLS (Caddy, Nginx, load balancer), não use: fique em HTTP com `trustProxy`.
24
+ */
25
+ tls?: TlsOptions;
26
+ }
27
+ export interface ServerTimeouts {
28
+ /** Tempo máximo para receber a requisição inteira. Padrão: 30s. */
29
+ requestTimeout?: number;
30
+ /** Tempo máximo para receber os headers (mitiga Slowloris). Padrão: 10s. */
31
+ headersTimeout?: number;
32
+ /** Tempo de conexão keep-alive ociosa. Padrão: 5s. */
33
+ keepAliveTimeout?: number;
34
+ }
35
+ export interface AppOptions {
36
+ /** Tamanho máximo do body JSON em bytes. Padrão: 1 MiB. */
37
+ bodyLimit?: number;
38
+ /**
39
+ * Headers de segurança aplicados a toda resposta (S-04). Padrão: `'api'`.
40
+ * `'web'` libera recursos do próprio site (CSP `'self'`) para quem serve páginas; `false` desliga.
41
+ */
42
+ securityHeaders?: SecurityHeadersOptions | SecurityPreset | false;
43
+ /**
44
+ * Serializadores por content type, para responder em outros formatos (F-31):
45
+ * `{ 'application/yaml': (data) => YAML.stringify(data) }`. JSON e valores crus já são nativos.
46
+ */
47
+ serializers?: Record<string, Serializer>;
48
+ /** Timeouts do servidor HTTP (S-06). */
49
+ timeouts?: ServerTimeouts;
50
+ /**
51
+ * Modo estrito (S-07): exige schema de `body` em POST/PUT/PATCH e schema de `response`
52
+ * em toda rota, falhando no `app.mount()`. Padrão: `false`.
53
+ */
54
+ requireSchemas?: boolean;
55
+ /**
56
+ * Body JSON com `__proto__` ou `constructor.prototype` (S-08): `'error'` responde 400
57
+ * (`PROTO_POISONING`); `'remove'` descarta as chaves e segue. Padrão: `'error'`.
58
+ */
59
+ protoPoisoning?: ProtoPoisoning;
60
+ /** Máximo de pares chave/valor lidos da query string. Padrão: 1000 (S-06). */
61
+ queryMaxKeys?: number;
62
+ /** Logger compatível com pino. Padrão: `consoleLogger()`; `false` desliga (F-06). */
63
+ logger?: Logger | false;
64
+ /** Loga cada requisição concluída (método, path, status, duração) em nível `info`. Padrão: `false`. */
65
+ logRequests?: boolean;
66
+ /** Request id (F-06). */
67
+ requestId?: RequestIdOptions;
68
+ /**
69
+ * Encerramento gracioso nos sinais do processo, ativado pelo `listen()` (F-07).
70
+ * Ligado por padrão (SIGINT/SIGTERM, 10s); `false` desliga.
71
+ */
72
+ shutdown?: ShutdownOptions | false;
73
+ /**
74
+ * Confia nos headers `X-Forwarded-For`, `-Host` e `-Proto` para `ctx.ip`, `ctx.host` e `ctx.protocol`
75
+ * (S-09). Padrão: `false`. Use `true` para confiar em toda a cadeia, ou o número de proxies à frente
76
+ * do app (ex.: `1` para um load balancer). Só ligue atrás de um proxy que reescreve esses headers.
77
+ */
78
+ trustProxy?: boolean | number;
79
+ /**
80
+ * Hosts aceitos (S-09). Requisições com outro `Host` (ou `X-Forwarded-Host` confiável) recebem 400.
81
+ * Protege contra host header injection e DNS rebinding. Padrão: qualquer host válido.
82
+ * - `'api.exemplo.com'` casa com o hostname (qualquer porta); `'api.exemplo.com:8443'` exige a porta;
83
+ * - `'*.exemplo.dev'` aceita só subdomínios;
84
+ * - uma RegExp precisa casar o hostname **inteiro** (como se tivesse `^…$`).
85
+ */
86
+ allowedHosts?: readonly (string | RegExp)[];
87
+ /**
88
+ * Rotas com `host` (virtual hosts) fora do `allowedHosts` nunca são alcançadas (F-35). `'error'` (padrão)
89
+ * falha no registro; `'warn'` só registra um aviso no log; `'off'` não confere.
90
+ */
91
+ unreachableHosts?: 'error' | 'warn' | 'off';
92
+ /**
93
+ * Personaliza o corpo de todos os erros do framework e dos `HttpError` (F-15). Padrão: Problem
94
+ * Details (RFC 9457) em `application/problem+json`. O retorno é enviado como `application/json`.
95
+ */
96
+ formatError?: ErrorFormatter;
97
+ }
98
+ export interface RequestIdOptions {
99
+ /** Header lido da requisição e devolvido na resposta. Padrão: `x-request-id`. `false` não envia. */
100
+ header?: string | false;
101
+ /**
102
+ * Reaproveita o id recebido no header (útil atrás de um gateway). Padrão: `true`.
103
+ * O valor só é aceito se tiver até 128 caracteres de `[A-Za-z0-9._:-]`, para evitar log injection.
104
+ */
105
+ trustIncoming?: boolean;
106
+ /** Gerador de ids. Padrão: `crypto.randomUUID()`. */
107
+ generate?: () => string;
108
+ }
109
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/core/app/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEpG,0CAA0C;AAC1C,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1G,kCAAkC;AAClC,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC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;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;CACzB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/core/app/options.ts"],"names":[],"mappings":""}
@@ -1,150 +1,29 @@
1
- import http from 'node:http';
2
- import https from 'node:https';
3
- import { type TlsOptions } from '../server/tls.ts';
1
+ import type http from 'node:http';
2
+ import type https from 'node:https';
3
+ import '../shims/symbol-metadata.ts';
4
+ import type { TlsOptions } from '../server/tls.ts';
4
5
  import { type GroupOptions, type MountOptions, type RouteScope, type RouterRef } from './compiler.ts';
5
- import { RouteGroupScope } from './mounted-group.ts';
6
- import { MountedGroup } from './mounted-group.ts';
7
- import { type Middleware } from './compose.ts';
8
- import { Context, type OnSendHook } from './context.ts';
6
+ import { MountedGroup, RouteGroupScope } from './mounted-group.ts';
7
+ import type { Middleware } from './compose.ts';
8
+ import type { Context, OnSendHook } from './context.ts';
9
9
  import { type StaticOptions } from '../server/static.ts';
10
10
  import { type OpenAPIOptions } from '../openapi/generate.ts';
11
11
  import { type HealthOptions } from './health.ts';
12
- import '../shims/symbol-metadata.ts';
13
- import type { ProtoPoisoning } from '../utils/safe-json.ts';
14
- import { type Serializer } from './response.ts';
15
- import type { ErrorFormatter } from './errors.ts';
16
12
  import { type InjectOptions, type InjectResponse } from './inject.ts';
17
- import { type ShutdownOptions } from './shutdown.ts';
18
13
  import { type Logger } from './logger.ts';
19
- import { type SecurityHeadersOptions, type SecurityPreset } from '../middlewares/security-headers.ts';
20
- /** Depois do envio da resposta (F-04). */
21
- export type OnResponseHook = (ctx: Context, info: {
22
- status: number;
23
- ms: number;
24
- }) => void | Promise<void>;
25
- /** No `close()` do app (F-04). */
26
- export type OnCloseHook = () => void | Promise<void>;
27
- export interface ListenOptions {
28
- /** Padrão: 3000. Use 0 para uma porta livre aleatória. */
29
- port?: number;
30
- /** Padrão: `127.0.0.1`. Use `0.0.0.0` para aceitar conexões externas (ex.: em containers). */
31
- host?: string;
32
- /**
33
- * Sobe em HTTPS, com os mesmos timeouts, encerramento gracioso e `close()` do HTTP. Atrás de um
34
- * proxy que termina o TLS (Caddy, Nginx, load balancer), não use: fique em HTTP com `trustProxy`.
35
- */
36
- tls?: TlsOptions;
37
- }
38
- export interface ServerTimeouts {
39
- /** Tempo máximo para receber a requisição inteira. Padrão: 30s. */
40
- requestTimeout?: number;
41
- /** Tempo máximo para receber os headers (mitiga Slowloris). Padrão: 10s. */
42
- headersTimeout?: number;
43
- /** Tempo de conexão keep-alive ociosa. Padrão: 5s. */
44
- keepAliveTimeout?: number;
45
- }
46
- export interface AppOptions {
47
- /** Tamanho máximo do body JSON em bytes. Padrão: 1 MiB. */
48
- bodyLimit?: number;
49
- /**
50
- * Headers de segurança aplicados a toda resposta (S-04). Padrão: `'api'`.
51
- * `'web'` libera recursos do próprio site (CSP `'self'`) para quem serve páginas; `false` desliga.
52
- */
53
- securityHeaders?: SecurityHeadersOptions | SecurityPreset | false;
54
- /**
55
- * Serializadores por content type, para responder em outros formatos (F-31):
56
- * `{ 'application/yaml': (data) => YAML.stringify(data) }`. JSON e valores crus já são nativos.
57
- */
58
- serializers?: Record<string, Serializer>;
59
- /** Timeouts do servidor HTTP (S-06). */
60
- timeouts?: ServerTimeouts;
61
- /**
62
- * Modo estrito (S-07): exige schema de `body` em POST/PUT/PATCH e schema de `response`
63
- * em toda rota, falhando no `app.mount()`. Padrão: `false`.
64
- */
65
- requireSchemas?: boolean;
66
- /**
67
- * Body JSON com `__proto__` ou `constructor.prototype` (S-08): `'error'` responde 400
68
- * (`PROTO_POISONING`); `'remove'` descarta as chaves e segue. Padrão: `'error'`.
69
- */
70
- protoPoisoning?: ProtoPoisoning;
71
- /** Máximo de pares chave/valor lidos da query string. Padrão: 1000 (S-06). */
72
- queryMaxKeys?: number;
73
- /** Logger compatível com pino. Padrão: `consoleLogger()`; `false` desliga (F-06). */
74
- logger?: Logger | false;
75
- /** Loga cada requisição concluída (método, path, status, duração) em nível `info`. Padrão: `false`. */
76
- logRequests?: boolean;
77
- /** Request id (F-06). */
78
- requestId?: RequestIdOptions;
79
- /**
80
- * Encerramento gracioso nos sinais do processo, ativado pelo `listen()` (F-07).
81
- * Ligado por padrão (SIGINT/SIGTERM, 10s); `false` desliga.
82
- */
83
- shutdown?: ShutdownOptions | false;
84
- /**
85
- * Confia nos headers `X-Forwarded-For`, `-Host` e `-Proto` para `ctx.ip`, `ctx.host` e `ctx.protocol`
86
- * (S-09). Padrão: `false`. Use `true` para confiar em toda a cadeia, ou o número de proxies à frente
87
- * do app (ex.: `1` para um load balancer). Só ligue atrás de um proxy que reescreve esses headers.
88
- */
89
- trustProxy?: boolean | number;
90
- /**
91
- * Hosts aceitos (S-09). Requisições com outro `Host` (ou `X-Forwarded-Host` confiável) recebem 400.
92
- * Protege contra host header injection e DNS rebinding. Padrão: qualquer host válido.
93
- * - `'api.exemplo.com'` casa com o hostname (qualquer porta); `'api.exemplo.com:8443'` exige a porta;
94
- * - `'*.exemplo.dev'` aceita só subdomínios;
95
- * - uma RegExp precisa casar o hostname **inteiro** (como se tivesse `^…$`).
96
- */
97
- allowedHosts?: readonly (string | RegExp)[];
98
- /**
99
- * Rotas com `host` (virtual hosts) fora do `allowedHosts` nunca são alcançadas (F-35). `'error'` (padrão)
100
- * falha no registro; `'warn'` só registra um aviso no log; `'off'` não confere.
101
- */
102
- unreachableHosts?: 'error' | 'warn' | 'off';
103
- /**
104
- * Personaliza o corpo de todos os erros do framework e dos `HttpError` (F-15). Padrão: Problem
105
- * Details (RFC 9457) em `application/problem+json`. O retorno é enviado como `application/json`.
106
- */
107
- formatError?: ErrorFormatter;
108
- }
109
- export interface RequestIdOptions {
110
- /** Header lido da requisição e devolvido na resposta. Padrão: `x-request-id`. `false` não envia. */
111
- header?: string | false;
112
- /**
113
- * Reaproveita o id recebido no header (útil atrás de um gateway). Padrão: `true`.
114
- * O valor só é aceito se tiver até 128 caracteres de `[A-Za-z0-9._:-]`, para evitar log injection.
115
- */
116
- trustIncoming?: boolean;
117
- /** Gerador de ids. Padrão: `crypto.randomUUID()`. */
118
- generate?: () => string;
119
- }
14
+ import type { AppOptions, ListenOptions, OnCloseHook, OnResponseHook } from './app/options.ts';
15
+ export type { AppOptions, ListenOptions, OnCloseHook, OnResponseHook, RequestIdOptions, ServerTimeouts } from './app/options.ts';
16
+ /**
17
+ * O app. É uma fachada (Facade) sobre o registro de rotas, as rotas do próprio framework (health, OpenAPI),
18
+ * o servidor e o pipeline da requisição: a API pública fica aqui, e o trabalho fica nesses componentes.
19
+ */
120
20
  export declare class SashikoApp {
121
- private middlewares;
122
- private router;
123
- private errorHandlers;
124
- private readonly onSendHooks;
125
- private readonly onResponseHooks;
126
- private readonly onCloseHooks;
127
- private readonly routes;
128
- /** Registros pendentes de um `group()` em andamento (duas fases). */
129
- private pending;
130
- private readonly warnedHosts;
131
- private draining;
132
- private healthConfig;
133
- private openapiConfig;
134
- private closeHooksPending;
135
- private applySecurityHeaders;
136
- private readonly opts;
137
- private readonly allowedHosts;
138
- private readonly serializers;
139
- private server;
140
- private tlsState;
141
- /** Respostas em andamento, para o encerramento gracioso não travar em conexões keep-alive. */
142
- private readonly inflight;
143
- /** Contexto de cada resposta em andamento, para o shutdown encerrar os streams (F-13). */
144
- private readonly contexts;
145
- private closing;
146
- /** Logger do app (F-06). Use para logs fora de uma requisição. */
147
21
  readonly log: Logger;
22
+ private readonly core;
23
+ private readonly registry;
24
+ private readonly framework;
25
+ private readonly runtime;
26
+ private readonly requests;
148
27
  constructor(opts?: AppOptions);
149
28
  use(mw: Middleware): this;
150
29
  onError(h: (err: unknown, ctx: Context) => void | Promise<void>): this;
@@ -222,52 +101,20 @@ export declare class SashikoApp {
222
101
  * consumir rate limit); use `guards`/`middlewares` aqui para restringir.
223
102
  */
224
103
  health(opts?: HealthOptions): this;
225
- /** Paths servidos pelo próprio app (`health()`, `openapi()`), que encobririam uma rota GET do usuário. */
226
- private reservedPaths;
227
- /** Um path do framework não pode coincidir com uma rota GET/HEAD registrada nem com outro do framework. */
228
- private assertFreePaths;
229
104
  /**
230
105
  * Documento OpenAPI 3.1 das rotas registradas até agora, para gravar em arquivo ou testar (F-16).
231
106
  * Com virtual hosts, é por host (F-35): `{ host: 'api.exemplo.com' }` traz as rotas desse host e as sem
232
107
  * host; sem `host`, só as sem host. Domínios diferentes nunca se misturam num mesmo documento.
233
108
  */
234
109
  openapiDocument(opts?: OpenAPIOptions): Record<string, unknown>;
235
- /**
236
- * Rotas que o roteador **executaria** num host (F-35): para cada método e path, só a vencedora pela mesma
237
- * prioridade do roteador (exato → curinga mais específico → RegExp → sem host). Assim o OpenAPI documenta
238
- * exatamente o handler que responde. Sem `hostname`, só as rotas sem host.
239
- */
240
- private routesFor;
241
- /** Se a requisição é para `/openapi.json` ou `/docs` (quando ligados), responde e devolve `true`. */
242
- private serveOpenAPI;
243
- /**
244
- * Primeira fase: valida as rotas (schemas obrigatórios, hosts alcançáveis, conflitos com o roteador e
245
- * dentro do próprio lote). Dentro de um `group()`, acumula; fora, efetiva na hora.
246
- */
247
- private stage;
248
- /**
249
- * Segunda fase: registra o lote no roteador. Se algo ainda falhar (um conflito que o `has()` não prevê),
250
- * desfaz o que já entrou, e nenhuma rota do lote fica registrada.
251
- */
252
- private commit;
253
- /**
254
- * Um host de rota sem interseção com o `allowedHosts` nunca seria alcançado: o app responde 400 antes do
255
- * roteamento (F-35). Comprovado: erro (ou aviso, com `unreachableHosts: 'warn'`). Sem como provar
256
- * (RegExp em algum dos lados): aviso.
257
- */
258
- private checkReachableHosts;
110
+ /** Executa o pipeline completo para um contexto já criado. */
259
111
  handle(ctx: Context): Promise<void>;
260
- /**
261
- * Executa os `onError` do usuário. Se um deles lançar, o erro é logado e seguimos
262
- * para a resposta padrão com o erro **original** — nunca deixamos a Promise rejeitar (B-08).
263
- */
264
- private runErrorHandlers;
265
112
  /**
266
113
  * Listener `(req, res)` do app, para usar com qualquer servidor do Node:
267
114
  * `https.createServer(opts, app.callback())`, `http2` em modo compat, testes etc. (F-09).
268
115
  */
269
116
  callback(): (req: http.IncomingMessage, res: http.ServerResponse) => void;
270
- /** Sobe o servidor HTTP e resolve quando ele está aceitando conexões (F-09). */
117
+ /** Sobe o servidor HTTP (ou HTTPS, com `tls`) e resolve quando ele está aceitando conexões (F-09, F-33). */
271
118
  listen(options: ListenOptions & {
272
119
  tls: TlsOptions;
273
120
  }): Promise<https.Server>;
@@ -277,15 +124,11 @@ export declare class SashikoApp {
277
124
  * usam os novos; as abertas seguem com os antigos. Um certificado inválido lança erro e mantém os atuais.
278
125
  */
279
126
  reloadTLS(tls: TlsOptions): void;
280
- /** Ponte entre este app e o coordenador de sinais (F-07). */
281
- private readonly shutdownTarget;
282
127
  /**
283
128
  * Para de aceitar conexões, encerra as ociosas e espera as requisições em andamento terminarem.
284
129
  * Depois de `graceMs`, força o fechamento das restantes.
285
130
  */
286
131
  close(graceMs?: number): Promise<void>;
287
- /** `onClose` uma vez por ciclo (até o próximo `listen`); todos rodam mesmo se algum falhar (F-04). */
288
- private runCloseHooks;
289
132
  /** Executa uma requisição em memória, sem rede. Ideal para testes (F-09). */
290
133
  inject(opts: InjectOptions | string): Promise<InjectResponse>;
291
134
  }
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/core/app.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO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