@encore.dev/sdk 2.0.0-beta.14 → 2.0.0-beta.16

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 (269) hide show
  1. package/README.md +144 -90
  2. package/app_meta.ts +56 -54
  3. package/config/config.test.ts +47 -13
  4. package/config/config.ts +60 -57
  5. package/config/secrets.ts +47 -50
  6. package/config/value.ts +23 -26
  7. package/cron/mod.test.ts +12 -0
  8. package/cron/mod.ts +37 -22
  9. package/dist/app_meta.d.ts +52 -50
  10. package/dist/app_meta.d.ts.map +1 -1
  11. package/dist/app_meta.js +2 -2
  12. package/dist/app_meta.js.map +1 -1
  13. package/dist/config/config.d.ts +58 -55
  14. package/dist/config/config.d.ts.map +1 -1
  15. package/dist/config/config.js +8 -9
  16. package/dist/config/config.js.map +1 -1
  17. package/dist/config/secrets.d.ts +45 -50
  18. package/dist/config/secrets.d.ts.map +1 -1
  19. package/dist/config/secrets.js +11 -9
  20. package/dist/config/secrets.js.map +1 -1
  21. package/dist/config/value.d.ts +20 -23
  22. package/dist/config/value.d.ts.map +1 -1
  23. package/dist/config/value.js +20 -23
  24. package/dist/config/value.js.map +1 -1
  25. package/dist/cron/mod.d.ts +34 -20
  26. package/dist/cron/mod.d.ts.map +1 -1
  27. package/dist/cron/mod.js +13 -13
  28. package/dist/cron/mod.js.map +1 -1
  29. package/dist/frontends/mod.d.ts +20 -19
  30. package/dist/frontends/mod.d.ts.map +1 -1
  31. package/dist/frontends/mod.js +20 -19
  32. package/dist/frontends/mod.js.map +1 -1
  33. package/dist/gateway/errors.d.ts +28 -30
  34. package/dist/gateway/errors.d.ts.map +1 -1
  35. package/dist/gateway/errors.js +29 -31
  36. package/dist/gateway/errors.js.map +1 -1
  37. package/dist/gateway/match.d.ts +54 -54
  38. package/dist/gateway/match.d.ts.map +1 -1
  39. package/dist/gateway/match.js +56 -56
  40. package/dist/gateway/match.js.map +1 -1
  41. package/dist/gateway/middleware.d.ts +62 -64
  42. package/dist/gateway/middleware.d.ts.map +1 -1
  43. package/dist/gateway/middleware.js +1 -1
  44. package/dist/gateway/middleware.js.map +1 -1
  45. package/dist/gateway/mod.d.ts +64 -67
  46. package/dist/gateway/mod.d.ts.map +1 -1
  47. package/dist/gateway/mod.js +72 -76
  48. package/dist/gateway/mod.js.map +1 -1
  49. package/dist/gateway/request.d.ts +138 -134
  50. package/dist/gateway/request.d.ts.map +1 -1
  51. package/dist/gateway/request.js +117 -108
  52. package/dist/gateway/request.js.map +1 -1
  53. package/dist/gateway/serve.d.ts +29 -34
  54. package/dist/gateway/serve.d.ts.map +1 -1
  55. package/dist/gateway/serve.js +51 -56
  56. package/dist/gateway/serve.js.map +1 -1
  57. package/dist/gateways/mod.d.ts +23 -21
  58. package/dist/gateways/mod.d.ts.map +1 -1
  59. package/dist/gateways/mod.js +25 -23
  60. package/dist/gateways/mod.js.map +1 -1
  61. package/dist/internal/otel/http.d.ts +4 -2
  62. package/dist/internal/otel/http.d.ts.map +1 -1
  63. package/dist/internal/otel/http.js +32 -5
  64. package/dist/internal/otel/http.js.map +1 -1
  65. package/dist/internal/runtime/napi/napi.cjs +6 -5
  66. package/dist/internal/runtime/napi/napi.d.cts +58 -16
  67. package/dist/internal/runtime/shutdown.d.ts +75 -57
  68. package/dist/internal/runtime/shutdown.d.ts.map +1 -1
  69. package/dist/internal/runtime/shutdown.js +88 -84
  70. package/dist/internal/runtime/shutdown.js.map +1 -1
  71. package/dist/log/logger.d.ts +43 -37
  72. package/dist/log/logger.d.ts.map +1 -1
  73. package/dist/log/logger.js +26 -25
  74. package/dist/log/logger.js.map +1 -1
  75. package/dist/metrics/mod.d.ts +133 -114
  76. package/dist/metrics/mod.d.ts.map +1 -1
  77. package/dist/metrics/mod.js +109 -101
  78. package/dist/metrics/mod.js.map +1 -1
  79. package/dist/otel.d.ts +6 -3
  80. package/dist/otel.d.ts.map +1 -1
  81. package/dist/otel.js +6 -3
  82. package/dist/otel.js.map +1 -1
  83. package/dist/pubsub/subscription.d.ts +88 -116
  84. package/dist/pubsub/subscription.d.ts.map +1 -1
  85. package/dist/pubsub/subscription.js +14 -17
  86. package/dist/pubsub/subscription.js.map +1 -1
  87. package/dist/pubsub/topic.d.ts +86 -113
  88. package/dist/pubsub/topic.d.ts.map +1 -1
  89. package/dist/pubsub/topic.js +68 -82
  90. package/dist/pubsub/topic.js.map +1 -1
  91. package/dist/redaction/mod.d.ts +62 -0
  92. package/dist/redaction/mod.d.ts.map +1 -0
  93. package/dist/redaction/mod.js +102 -0
  94. package/dist/redaction/mod.js.map +1 -0
  95. package/dist/reqctx/mod.d.ts +83 -86
  96. package/dist/reqctx/mod.d.ts.map +1 -1
  97. package/dist/reqctx/mod.js +39 -41
  98. package/dist/reqctx/mod.js.map +1 -1
  99. package/dist/services/index.d.ts +76 -75
  100. package/dist/services/index.d.ts.map +1 -1
  101. package/dist/services/index.js +73 -71
  102. package/dist/services/index.js.map +1 -1
  103. package/dist/shutdown/mod.d.ts +26 -25
  104. package/dist/shutdown/mod.d.ts.map +1 -1
  105. package/dist/shutdown/mod.js +26 -25
  106. package/dist/shutdown/mod.js.map +1 -1
  107. package/dist/storage/clickhouse/database.d.ts +113 -115
  108. package/dist/storage/clickhouse/database.d.ts.map +1 -1
  109. package/dist/storage/clickhouse/database.js +65 -79
  110. package/dist/storage/clickhouse/database.js.map +1 -1
  111. package/dist/storage/clickhouse/errors.d.ts +25 -26
  112. package/dist/storage/clickhouse/errors.d.ts.map +1 -1
  113. package/dist/storage/clickhouse/errors.js +15 -17
  114. package/dist/storage/clickhouse/errors.js.map +1 -1
  115. package/dist/storage/clickhouse/mod.d.ts +10 -10
  116. package/dist/storage/clickhouse/mod.js +10 -10
  117. package/dist/storage/objects/bucket.d.ts +230 -203
  118. package/dist/storage/objects/bucket.d.ts.map +1 -1
  119. package/dist/storage/objects/bucket.js +146 -106
  120. package/dist/storage/objects/bucket.js.map +1 -1
  121. package/dist/storage/objects/error.d.ts +4 -4
  122. package/dist/storage/objects/error.js +4 -4
  123. package/dist/storage/objects/mod.d.ts +1 -1
  124. package/dist/storage/objects/mod.d.ts.map +1 -1
  125. package/dist/storage/objects/mod.js.map +1 -1
  126. package/dist/storage/objects/refs.d.ts +2 -5
  127. package/dist/storage/objects/refs.d.ts.map +1 -1
  128. package/dist/storage/objects/refs.js.map +1 -1
  129. package/dist/storage/postgres/database.d.ts +124 -149
  130. package/dist/storage/postgres/database.d.ts.map +1 -1
  131. package/dist/storage/postgres/database.js +98 -135
  132. package/dist/storage/postgres/database.js.map +1 -1
  133. package/dist/storage/postgres/errors.d.ts +42 -48
  134. package/dist/storage/postgres/errors.d.ts.map +1 -1
  135. package/dist/storage/postgres/errors.js +44 -51
  136. package/dist/storage/postgres/errors.js.map +1 -1
  137. package/dist/storage/postgres/interval.d.ts +19 -19
  138. package/dist/storage/postgres/interval.d.ts.map +1 -1
  139. package/dist/storage/postgres/interval.js +21 -21
  140. package/dist/storage/postgres/interval.js.map +1 -1
  141. package/dist/storage/redis/bitfield.d.ts +48 -23
  142. package/dist/storage/redis/bitfield.d.ts.map +1 -1
  143. package/dist/storage/redis/bitfield.js +38 -19
  144. package/dist/storage/redis/bitfield.js.map +1 -1
  145. package/dist/storage/redis/command.d.ts +16 -12
  146. package/dist/storage/redis/command.d.ts.map +1 -1
  147. package/dist/storage/redis/command.js +16 -12
  148. package/dist/storage/redis/command.js.map +1 -1
  149. package/dist/storage/redis/commands.d.ts +99 -100
  150. package/dist/storage/redis/commands.d.ts.map +1 -1
  151. package/dist/storage/redis/commands.js +84 -85
  152. package/dist/storage/redis/commands.js.map +1 -1
  153. package/dist/storage/redis/database.d.ts +138 -122
  154. package/dist/storage/redis/database.d.ts.map +1 -1
  155. package/dist/storage/redis/database.js +120 -101
  156. package/dist/storage/redis/database.js.map +1 -1
  157. package/dist/storage/redis/mod.d.ts +52 -48
  158. package/dist/storage/redis/mod.d.ts.map +1 -1
  159. package/dist/storage/redis/mod.js +52 -48
  160. package/dist/storage/redis/mod.js.map +1 -1
  161. package/dist/storage/redis/options.d.ts +26 -24
  162. package/dist/storage/redis/options.d.ts.map +1 -1
  163. package/dist/storage/redis/options.js.map +1 -1
  164. package/dist/storage/redis/pubsub.d.ts +16 -16
  165. package/dist/storage/redis/pubsub.d.ts.map +1 -1
  166. package/dist/storage/redis/pubsub.js +14 -14
  167. package/dist/storage/redis/pubsub.js.map +1 -1
  168. package/dist/storage/redis/reply.d.ts +80 -72
  169. package/dist/storage/redis/reply.d.ts.map +1 -1
  170. package/dist/storage/redis/reply.js +53 -46
  171. package/dist/storage/redis/reply.js.map +1 -1
  172. package/dist/storage/redis/scan.d.ts +4 -4
  173. package/dist/storage/redis/scan.d.ts.map +1 -1
  174. package/dist/storage/redis/scan.js +6 -6
  175. package/dist/storage/redis/scan.js.map +1 -1
  176. package/dist/storage/redis/script.d.ts +28 -21
  177. package/dist/storage/redis/script.d.ts.map +1 -1
  178. package/dist/storage/redis/script.js +29 -22
  179. package/dist/storage/redis/script.js.map +1 -1
  180. package/dist/storage/redis/target.d.ts +17 -1
  181. package/dist/storage/redis/target.d.ts.map +1 -1
  182. package/dist/storage/redis/target.js +30 -1
  183. package/dist/storage/redis/target.js.map +1 -1
  184. package/dist/storage/redis/wire.d.ts +6 -6
  185. package/dist/storage/redis/wire.d.ts.map +1 -1
  186. package/dist/storage/redis/wire.js +6 -6
  187. package/dist/storage/redis/wire.js.map +1 -1
  188. package/dist/testing/mod.d.ts +83 -88
  189. package/dist/testing/mod.d.ts.map +1 -1
  190. package/dist/testing/mod.js +75 -81
  191. package/dist/testing/mod.js.map +1 -1
  192. package/dist/testing/playwright.d.ts +28 -32
  193. package/dist/testing/playwright.d.ts.map +1 -1
  194. package/dist/testing/playwright.js +22 -27
  195. package/dist/testing/playwright.js.map +1 -1
  196. package/dist/testing/puppeteer.d.ts +11 -12
  197. package/dist/testing/puppeteer.d.ts.map +1 -1
  198. package/dist/testing/puppeteer.js +17 -18
  199. package/dist/testing/puppeteer.js.map +1 -1
  200. package/dist/testing/system.d.ts +72 -90
  201. package/dist/testing/system.d.ts.map +1 -1
  202. package/dist/testing/system.js +90 -107
  203. package/dist/testing/system.js.map +1 -1
  204. package/dist/tracing/http.d.ts +2 -1
  205. package/dist/tracing/http.d.ts.map +1 -1
  206. package/dist/tracing/http.js +2 -1
  207. package/dist/tracing/http.js.map +1 -1
  208. package/dist/tracing/node.d.ts.map +1 -1
  209. package/dist/tracing/node.js +1 -1
  210. package/dist/tracing/node.js.map +1 -1
  211. package/dist/tsconfig.build.tsbuildinfo +1 -1
  212. package/frontends/mod.test.ts +6 -2
  213. package/frontends/mod.ts +20 -19
  214. package/gateway/errors.ts +30 -32
  215. package/gateway/match.ts +61 -57
  216. package/gateway/middleware.ts +62 -64
  217. package/gateway/mod.ts +73 -76
  218. package/gateway/request.ts +143 -140
  219. package/gateway/serve.ts +58 -63
  220. package/gateways/mod.ts +25 -23
  221. package/internal/otel/http.test.ts +50 -0
  222. package/internal/otel/http.ts +40 -5
  223. package/internal/runtime/napi/napi.cjs +6 -5
  224. package/internal/runtime/napi/napi.d.cts +58 -16
  225. package/internal/runtime/shutdown.ts +113 -101
  226. package/log/logger.test.ts +8 -0
  227. package/log/logger.ts +48 -45
  228. package/metrics/mod.ts +138 -122
  229. package/otel.ts +6 -3
  230. package/package.json +6 -1
  231. package/pubsub/subscription.ts +93 -123
  232. package/pubsub/topic.ts +96 -130
  233. package/redaction/bridge.test.ts +99 -0
  234. package/redaction/mod.test.ts +188 -0
  235. package/redaction/mod.ts +226 -0
  236. package/reqctx/mod.ts +83 -86
  237. package/services/index.ts +78 -78
  238. package/shutdown/mod.ts +26 -25
  239. package/storage/clickhouse/database.ts +115 -129
  240. package/storage/clickhouse/errors.ts +27 -29
  241. package/storage/clickhouse/mod.ts +10 -10
  242. package/storage/objects/bucket.test.ts +168 -16
  243. package/storage/objects/bucket.ts +336 -247
  244. package/storage/objects/error.ts +4 -4
  245. package/storage/objects/mod.ts +1 -0
  246. package/storage/objects/refs.ts +2 -5
  247. package/storage/postgres/database.ts +131 -164
  248. package/storage/postgres/errors.ts +45 -52
  249. package/storage/postgres/interval.ts +21 -21
  250. package/storage/redis/bitfield.ts +51 -26
  251. package/storage/redis/command.ts +16 -12
  252. package/storage/redis/commands.ts +99 -100
  253. package/storage/redis/database.ts +145 -123
  254. package/storage/redis/mod.ts +52 -48
  255. package/storage/redis/options.ts +26 -24
  256. package/storage/redis/pubsub.ts +14 -14
  257. package/storage/redis/redis.test.ts +17 -2
  258. package/storage/redis/reply.ts +85 -77
  259. package/storage/redis/scan.ts +6 -6
  260. package/storage/redis/script.ts +29 -22
  261. package/storage/redis/target.ts +34 -1
  262. package/storage/redis/wire.ts +8 -8
  263. package/testing/mod.ts +99 -105
  264. package/testing/playwright.ts +32 -37
  265. package/testing/puppeteer.ts +22 -23
  266. package/testing/system.ts +117 -133
  267. package/tracing/http.ts +2 -1
  268. package/tracing/native.test.ts +158 -8
  269. package/tracing/node.ts +1 -0
@@ -4,8 +4,8 @@ import { AsyncLocalStorage } from 'node:async_hooks';
4
4
  import type { SpanContext } from '@opentelemetry/api';
5
5
  import { Field } from '../reqctx/mod.js';
6
6
  /**
7
- * A request as the native runtime keeps it: its headers, query parameters
8
- * and cookies are handed to JavaScript only as a hook reads them.
7
+ * Native request view whose headers, query parameters, and cookies are loaded
8
+ * into JavaScript lazily on read.
9
9
  * @internal
10
10
  */
11
11
  export interface NativeView {
@@ -18,21 +18,22 @@ export interface NativeView {
18
18
  readonly clientIp?: string | null;
19
19
  readonly traceparent?: string | null;
20
20
  readonly tracestate?: string | null;
21
- /** The Request Context fields earlier Middleware set, encoded. */
21
+ /** Encoded Request Context fields set by earlier middleware. */
22
22
  readonly context?: readonly NativeField[] | null;
23
23
  pathParam(name: string): string | null | undefined;
24
24
  headerValues(name: string): string[];
25
25
  queryValues(name: string): string[];
26
26
  cookie(name: string): string | null | undefined;
27
27
  }
28
- /** A response's headers as the native runtime keeps them. @internal */
28
+ /** Native response header view. @internal */
29
29
  export interface NativeHeaders {
30
30
  values(name: string): string[];
31
31
  }
32
32
  /**
33
- * A set of a Middleware's later hooks, which {@link Request.skip} narrows,
34
- * combined with `|`: `Hook.Response | Hook.Complete`. `onRequest` is not
35
- * among them: it is the hook that skips.
33
+ * Bitmask flags identifying later middleware hooks that can be skipped with
34
+ * {@link Request.skip}, combined with `|` (e.g.
35
+ * `Hook.Response | Hook.Complete`). `onRequest` is omitted because it is the
36
+ * hook that calls `skip`.
36
37
  */
37
38
  export declare const Hook: {
38
39
  /** `onRequestBody`. */
@@ -44,64 +45,61 @@ export declare const Hook: {
44
45
  /** `onComplete`. */
45
46
  readonly Complete: number;
46
47
  };
47
- /** A value of {@link Hook}, or several combined with `|`. */
48
+ /** A {@link Hook} flag or bitwise-OR combination of flags. */
48
49
  export type Hooks = number;
49
- /** The value of an attribute of a request's span. */
50
+ /** Allowed value type for request span attributes. */
50
51
  export type AttributeValue = string | boolean | number;
51
- /** An edit to headers: op 0 sets, 1 adds, 2 removes. @internal */
52
+ /** Header mutation sent to the native gateway (op 0 = set, 1 = add, 2 = remove). @internal */
52
53
  export interface HeaderEdit {
53
54
  op: number;
54
55
  name: string;
55
56
  value: string;
56
57
  }
57
- /** A Request Context field, encoded, as the native runtime shows and takes
58
- * it: a null value clears it. @internal */
58
+ /** Encoded Request Context field passed across the native boundary (`null` clears it). @internal */
59
59
  export interface NativeField {
60
60
  name: string;
61
61
  value?: string | null;
62
62
  }
63
- /** An attribute as the native runtime takes it. @internal */
63
+ /** Span attribute passed across the native boundary. @internal */
64
64
  export interface NativeAttribute {
65
65
  key: string;
66
66
  value: AttributeValue;
67
67
  integer: boolean;
68
68
  }
69
69
  /**
70
- * Whether a Middleware may not edit the header `name`, lowercase: Encore's
71
- * headers, the trace context's, those framing the message, and CORS's. The
72
- * gateway refuses the same edits.
70
+ * Reports whether a lowercase header name is reserved by Encore (internal
71
+ * `x-encore-*` headers, trace context, HTTP framing, and CORS headers).
73
72
  * @internal
74
73
  */
75
74
  export declare function isProtected(name: string): boolean;
76
- /** Header values edited by a Middleware, by lowercase name, as they read
77
- * now. */
75
+ /** Header values edited by a middleware, keyed by lowercase name. */
78
76
  type Overrides = Map<string, string[]>;
79
- /** One Middleware's state for one request, shared by the Requests its hooks
80
- * are shown. @internal */
77
+ /** Per-middleware, per-request state shared across hooks. @internal */
81
78
  export interface Lane {
82
79
  state: unknown;
83
80
  }
84
- /** One run of a timed hook, `onRequest` or `onResponse`: expired once it
85
- * has timed out and the gateway went on without it. @internal */
81
+ /** Tracks whether an active timed hook (`onRequest` or `onResponse`) has expired. @internal */
86
82
  export interface HookRun {
87
83
  expired: boolean;
88
84
  }
89
- /** The timed hook the code running now is part of, following its `await`s,
90
- * timers and callbacks: so that what a timed-out hook goes on doing cannot
91
- * change the state its later hooks are shown. @internal */
85
+ /**
86
+ * Tracks the currently running timed hook across async continuations so a
87
+ * timed-out hook cannot mutate `Request.state` after the gateway has moved on.
88
+ * @internal
89
+ */
92
90
  export declare const hookRuns: AsyncLocalStorage<HookRun>;
93
91
  /**
94
- * A public request the gateway serves, as a Middleware is shown it. Made by
95
- * Encore: the same object is passed to each of one Middleware's hooks for
96
- * one request.
92
+ * Represents an incoming public request passed to a middleware's hooks. The
93
+ * same instance is reused across all hooks of a single middleware for a given
94
+ * request.
97
95
  *
98
- * It reads the request's headers, query parameters and cookies as the hook
99
- * asks for them, as the Middleware before this one left them, and with this
100
- * one's edits. Encore's own headers, `x-encore-*`, are never shown. Edits
101
- * are only allowed in `onRequest`; elsewhere they throw.
96
+ * Headers, query parameters, and cookies are read lazily and reflect edits
97
+ * made by earlier middleware as well as this middleware. Internal `x-encore-*`
98
+ * headers are never exposed. Mutating methods are only permitted inside
99
+ * `onRequest` and throw if called elsewhere.
102
100
  */
103
101
  export declare class Request {
104
- /** Identifies the request among those in flight; unique while it is. */
102
+ /** Identifier unique among currently in-flight requests. */
105
103
  readonly id: number;
106
104
  /** @internal */ readonly middleware: string;
107
105
  /** @internal */ readonly view: NativeView | undefined;
@@ -109,98 +107,104 @@ export declare class Request {
109
107
  /** @internal */ overrides: Overrides | undefined;
110
108
  /** @internal */ deciding: boolean;
111
109
  /** @internal */ edits: HeaderEdit[];
112
- /** @internal The request's Request Context fields, encoded, with this
113
- * Middleware's changes: changed in place, as the context its hooks run in
114
- * holds this record. */
110
+ /** @internal Encoded Request Context fields, mutated in place so active hook contexts see updates immediately. */
115
111
  readonly fields: Record<string, string>;
116
- /** @internal The changes `set` and `unset` made, for the gateway. */
112
+ /** @internal Field mutations queued for the native gateway. */
117
113
  fieldEdits: NativeField[];
118
114
  /** @internal */ attributes: NativeAttribute[];
119
115
  /** @internal */ skipped: number;
120
116
  /** @internal */ hookSignal: AbortSignal;
121
- /** @internal Made by Encore. */
117
+ /** @internal Created by Encore. */
122
118
  constructor(middleware: string, id: number, view: NativeView | undefined, lane: Lane);
123
- /** The HTTP method, upper case. */
119
+ /** Uppercase HTTP method (e.g. `"GET"`). */
124
120
  get method(): string;
125
- /** The host the client addressed, from its Host header, if any. */
121
+ /** Value of the client's `Host` header, if present. */
126
122
  get host(): string | undefined;
127
- /** The path, as the client sent it: not percent-decoded, without the
128
- * query. */
123
+ /** Raw request path as sent by the client (not percent-decoded, without query string). */
129
124
  get path(): string;
130
- /** The service the gateway routes the request to. */
125
+ /** Target service name that the gateway routes this request to. */
131
126
  get service(): string;
132
- /** The route template it matched, such as `/users/{id}`. */
127
+ /** Matched route template (e.g. `/users/{id}`). */
133
128
  get route(): string;
134
- /** The address of the client the gateway took the request from, if
135
- * known. */
129
+ /** Client IP address observed by the gateway, if known. */
136
130
  get clientIp(): string | undefined;
137
131
  /**
138
- * Aborts when the hook running now runs out of time: `onRequest` and
139
- * `onResponse` have their Middleware's timeout, and the gateway goes on
140
- * without them then. Pass it to what the hook awaits, as `fetch`, so the
141
- * work stops too. It never aborts in the other hooks.
132
+ * Aborts when the current hook exceeds its timeout (`onRequest` and
133
+ * `onResponse` only). Pass this signal to async operations such as `fetch`
134
+ * so they cancel cleanly if the gateway moves on. Never aborts in other hooks.
142
135
  */
143
136
  get signal(): AbortSignal;
144
- /** The value of the path parameter `name` of the matched route, as it was
145
- * sent, not percent-decoded; undefined when the route has none of that
146
- * name. */
137
+ /**
138
+ * Returns the raw (non-percent-decoded) value of path parameter `name`, or
139
+ * `undefined` if the matched route has no parameter with that name.
140
+ */
147
141
  pathParam(name: string): string | undefined;
148
- /** The first value of the request header `name`, as earlier Middleware
149
- * left it; undefined when it is not sent. Any case. */
142
+ /**
143
+ * Returns the first value of request header `name` (case-insensitive), or
144
+ * `undefined` if absent. Reflects edits by earlier middleware and this hook.
145
+ */
150
146
  header(name: string): string | undefined;
151
- /** Every value of the request header `name`, in order. Any case. */
147
+ /** Returns all values of request header `name` (case-insensitive) in order. */
152
148
  headerValues(name: string): string[];
153
- /** The first value of the query parameter `name`, percent-decoded;
154
- * undefined when it is not sent. */
149
+ /**
150
+ * Returns the first percent-decoded value of query parameter `name`, or
151
+ * `undefined` if absent.
152
+ */
155
153
  query(name: string): string | undefined;
156
- /** Every value of the query parameter `name`, percent-decoded, in
157
- * order. */
154
+ /** Returns all percent-decoded values of query parameter `name` in order. */
158
155
  queryValues(name: string): string[];
159
- /** The value of the cookie `name`, from the `Cookie` headers as the
160
- * Middleware before this one left them; undefined when it is not sent. */
156
+ /**
157
+ * Returns the value of cookie `name` from the current `Cookie` headers, or
158
+ * `undefined` if absent.
159
+ */
161
160
  cookie(name: string): string | undefined;
162
- /** The context of the request's span at the gateway, which the spans its
163
- * hooks start are children of; undefined when the request is not
164
- * traced. */
161
+ /**
162
+ * Span context for this request at the gateway (parent of spans started by
163
+ * hooks), or `undefined` if the request is not traced.
164
+ */
165
165
  get spanContext(): SpanContext | undefined;
166
166
  private mustDecide;
167
167
  private edit;
168
168
  /**
169
- * Sets the request header `name` to `value`, replacing any values, for the
170
- * Middleware after this one and the service. Only in `onRequest`. Not for
171
- * Encore's headers (`x-encore-*`, the trace context), those framing the
172
- * message (`content-length` and the like) and CORS's: those throw.
169
+ * Sets request header `name` to `value`, replacing any existing values, for
170
+ * downstream middleware and the target service. Only valid in `onRequest`.
171
+ * Throws if `name` is reserved by Encore (`x-encore-*`, trace context,
172
+ * HTTP framing, or CORS headers).
173
173
  */
174
174
  setHeader(name: string, value: string): void;
175
- /** Adds `value` to the request header `name`, keeping its values. As
176
- * {@link Request.setHeader}. */
175
+ /**
176
+ * Appends `value` to request header `name` without removing existing values.
177
+ * Only valid in `onRequest`; see {@link Request.setHeader}.
178
+ */
177
179
  addHeader(name: string, value: string): void;
178
- /** Removes the request header `name`. As {@link Request.setHeader}. */
180
+ /**
181
+ * Removes request header `name`. Only valid in `onRequest`; see
182
+ * {@link Request.setHeader}.
183
+ */
179
184
  delHeader(name: string): void;
180
185
  /**
181
- * Sets attributes of the request's span at the gateway, as a user or
182
- * tenant id to find its trace by. Never secrets. Only in `onRequest`. An
183
- * integer number is recorded as an integer, another as a float.
186
+ * Attaches attributes to the gateway's request span (for example, a user or
187
+ * tenant ID for trace search — never secrets). Only valid in `onRequest`.
188
+ * Safe integers are recorded as integers; other numbers are recorded as floats.
184
189
  */
185
190
  setAttributes(attributes: Record<string, AttributeValue>): void;
186
- /** Skips this Middleware's later `hooks` for this request, as an
187
- * `onResponse` a request without a session has no use for:
188
- * `req.skip(Hook.Response | Hook.Complete)`. Only in `onRequest`. */
191
+ /**
192
+ * Skips the specified later `hooks` of this middleware for this request
193
+ * (e.g. `req.skip(Hook.Response | Hook.Complete)`). Only valid in `onRequest`.
194
+ */
189
195
  skip(hooks: Hooks): void;
190
196
  /**
191
- * The Request Context field's value for the request; undefined when it is
192
- * not set: as the Middleware before this one set it, or this one did. In
193
- * a hook, `field.get()` reads the same, as hooks run in their request's
194
- * context; in `onComplete`, as the request was forwarded. A value that is
195
- * not JSON reads as not set, as it does to `field.get()`.
197
+ * Returns the current value of Request Context `field` for this request, or
198
+ * `undefined` if unset. Hooks can equivalently call `field.get()`. In
199
+ * `onComplete`, reflects the value as forwarded. Invalid JSON values are
200
+ * treated as unset.
196
201
  */
197
202
  get<T>(field: Field<T>): T | undefined;
198
203
  /**
199
- * Sets the Request Context field to `value` for the request. The
200
- * Middleware after this one, the service the request reaches, and every
201
- * service it calls in turn with the request's context read it, with
202
- * `field.get()`; so do the calls this hook makes from then on. It is how a
203
- * Middleware that authenticates says who the request is for:
204
+ * Sets Request Context `field` to `value` for this request. Subsequent
205
+ * middleware, the target service, downstream services called with the
206
+ * request's context, and calls made by this hook afterward will read it via
207
+ * `field.get()`.
204
208
  *
205
209
  * ```ts
206
210
  * export const currentUser = new Field<User>('user');
@@ -216,88 +220,88 @@ export declare class Request {
216
220
  * }
217
221
  * ```
218
222
  *
219
- * Only in `onRequest`. The request takes the fields once the hook
220
- * returns: none when it fails or answers the request.
223
+ * Only valid in `onRequest`. Changes are applied only if `onRequest` lets
224
+ * the request through; they are discarded if the hook fails or rejects.
221
225
  *
222
- * @throws TypeError - The value has no JSON form, or `field` is not a
223
- * {@link Field}.
224
- * @throws RangeError - The value encodes to more than a field may: 4 KiB,
225
- * or 1 KiB for a field declared with `pubsub`; or it makes the request's
226
- * fields encode to more than 8 KiB.
226
+ * @throws TypeError If `value` cannot be serialized to JSON or `field` is
227
+ * not a {@link Field}.
228
+ * @throws RangeError If the encoded value exceeds the per-field limit (4 KiB,
229
+ * or 1 KiB for fields with `pubsub` enabled) or pushes total request fields
230
+ * past 8 KiB.
227
231
  */
228
232
  set<T>(field: Field<T>, value: T): void;
229
- /** Clears the Request Context field for the request, as one the
230
- * Middleware before this one set. As {@link Request.set} sets it. */
233
+ /**
234
+ * Clears Request Context `field` for this request (including values set by
235
+ * earlier middleware). Only valid in `onRequest`.
236
+ */
231
237
  unset(field: Field<unknown>): void;
232
238
  /**
233
- * What this Middleware kept for the request, for its later hooks: the
234
- * user `onRequest` found, for `onComplete` to bill. Undefined until set.
235
- * Encore drops it when the request is done.
239
+ * Per-request state private to this middleware, shared across its hooks
240
+ * (for example, saving an authenticated user in `onRequest` for `onComplete`
241
+ * to record). Starts as `undefined` and is dropped when the request finishes.
236
242
  *
237
- * When `onRequest` or `onResponse` fails or times out, `state` goes back
238
- * to the object it was before the hook; what the hook changed inside that
239
- * object stays, since Encore does not copy it. A hook that may fail after
240
- * changing it should set a new object, as `req.state = {...req.state,
241
- * billed: true}`, rather than change the one it has. A hook that goes on
242
- * after it timed out may no longer set it: that throws.
243
+ * If `onRequest` or `onResponse` fails or times out, `state` reverts to its
244
+ * reference before the hook ran. Because Encore does not deep-copy `state`,
245
+ * assign a new object (e.g. `req.state = {...req.state, billed: true}`)
246
+ * rather than mutating in place if the hook might fail later. Setting `state`
247
+ * after a hook has timed out throws an error.
243
248
  */
244
249
  get state(): unknown;
245
250
  set state(value: unknown);
246
251
  }
247
252
  /**
248
- * A response to a request the gateway served, in `onResponse`. Made by
249
- * Encore. It reads the response's headers as the hook asks for them, as the
250
- * Middleware after this one left them, and with this one's edits.
253
+ * Represents the HTTP response passed to `onResponse`. Headers are read lazily
254
+ * and reflect edits made by downstream middleware as well as this middleware.
251
255
  */
252
256
  export declare class Response {
253
- /** The HTTP status. */
257
+ /** The HTTP status code. */
254
258
  readonly status: number;
255
259
  /** @internal */ readonly middleware: string;
256
260
  /** @internal */ readonly headers: NativeHeaders | undefined;
257
261
  /** @internal */ overrides: Overrides | undefined;
258
262
  /** @internal */ editing: boolean;
259
263
  /** @internal */ edits: HeaderEdit[];
260
- /** @internal Made by Encore. */
264
+ /** @internal Created by Encore. */
261
265
  constructor(middleware: string, status: number, headers: NativeHeaders | undefined);
262
- /** The first value of the response header `name`, if any. Any case. */
266
+ /** Returns the first value of response header `name` (case-insensitive), or `undefined` if absent. */
263
267
  header(name: string): string | undefined;
264
- /** Every value of the response header `name`, in order. Any case. */
268
+ /** Returns all values of response header `name` (case-insensitive) in order. */
265
269
  headerValues(name: string): string[];
266
270
  private edit;
267
- /** Sets the response header `name` to `value`, replacing any values,
268
- * before it is written to the client. Not for the headers
269
- * {@link Request.setHeader} may not set. */
271
+ /**
272
+ * Sets response header `name` to `value`, replacing any existing values,
273
+ * before the response is sent to the client. Rejects the same reserved
274
+ * headers as {@link Request.setHeader}.
275
+ */
270
276
  setHeader(name: string, value: string): void;
271
- /** Adds `value` to the response header `name`. */
277
+ /** Appends `value` to response header `name`. */
272
278
  addHeader(name: string, value: string): void;
273
- /** Removes the response header `name`. */
279
+ /** Removes response header `name`. */
274
280
  delHeader(name: string): void;
275
281
  }
276
- /** A request the gateway is done with, for `onComplete`. */
282
+ /** Summary of a completed request passed to `onComplete`. */
277
283
  export interface Completed {
278
- /** The request, with the headers as they were forwarded, and the state
279
- * its earlier hooks kept. */
284
+ /** The request with its forwarded headers and the `state` stored by earlier hooks. */
280
285
  readonly request: Request;
281
- /** The status the client was answered with; undefined when it was never
282
- * answered, as when it disconnected first. */
286
+ /** HTTP status code sent to the client, or `undefined` if no response was sent (e.g. client disconnected). */
283
287
  readonly status: number | undefined;
284
- /** The name of the Middleware that answered the request, or `"gateway"`
285
- * when the gateway did, as for a route it does not expose; undefined when
286
- * the service answered. */
288
+ /**
289
+ * Name of the middleware that rejected the request, `"gateway"` if the
290
+ * gateway rejected it (e.g. unexposed route), or `undefined` if the service
291
+ * handled it.
292
+ */
287
293
  readonly rejectedBy: string | undefined;
288
- /** Why the request failed, if it did: a hook that failed, or a service
289
- * that could not be reached. */
294
+ /** Error message if the request failed due to a hook error or unreachable service. */
290
295
  readonly error: string | undefined;
291
- /** When the gateway received the request. */
296
+ /** Timestamp when the gateway received the request. */
292
297
  readonly received: Date;
293
- /** How long the gateway took to answer it, in milliseconds. */
298
+ /** Total time spent by the gateway handling the request, in milliseconds. */
294
299
  readonly durationMs: number;
295
- /** How long the service took, in milliseconds, if the request was
296
- * forwarded. */
300
+ /** Time spent waiting for the upstream service, in milliseconds (if forwarded). */
297
301
  readonly upstreamDurationMs: number | undefined;
298
- /** The bytes of the request's body. */
302
+ /** Size of the request body in bytes. */
299
303
  readonly requestBodySize: number;
300
- /** The bytes of the response's body. */
304
+ /** Size of the response body in bytes. */
301
305
  readonly responseBodySize: number;
302
306
  }
303
307
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../gateway/request.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAIpD,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,kEAAkE;IAClE,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,WAAW,EAAE,GAAG,IAAI,CAAC;IACjD,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnD,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACrC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACpC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD;AAED,uEAAuE;AACvE,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,IA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