@encore.dev/sdk 2.0.0-beta.15 → 2.0.0-beta.17

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 (235) hide show
  1. package/README.md +111 -101
  2. package/app_meta.ts +56 -54
  3. package/config/config.ts +60 -57
  4. package/config/secrets.ts +45 -52
  5. package/config/value.ts +23 -26
  6. package/cron/mod.ts +28 -29
  7. package/dist/app_meta.d.ts +52 -50
  8. package/dist/app_meta.d.ts.map +1 -1
  9. package/dist/app_meta.js +2 -2
  10. package/dist/app_meta.js.map +1 -1
  11. package/dist/config/config.d.ts +58 -55
  12. package/dist/config/config.d.ts.map +1 -1
  13. package/dist/config/config.js +8 -9
  14. package/dist/config/config.js.map +1 -1
  15. package/dist/config/secrets.d.ts +45 -52
  16. package/dist/config/secrets.d.ts.map +1 -1
  17. package/dist/config/secrets.js +8 -9
  18. package/dist/config/secrets.js.map +1 -1
  19. package/dist/config/value.d.ts +20 -23
  20. package/dist/config/value.d.ts.map +1 -1
  21. package/dist/config/value.js +20 -23
  22. package/dist/config/value.js.map +1 -1
  23. package/dist/cron/mod.d.ts +26 -27
  24. package/dist/cron/mod.d.ts.map +1 -1
  25. package/dist/cron/mod.js +13 -14
  26. package/dist/cron/mod.js.map +1 -1
  27. package/dist/frontends/mod.d.ts +20 -19
  28. package/dist/frontends/mod.d.ts.map +1 -1
  29. package/dist/frontends/mod.js +20 -19
  30. package/dist/frontends/mod.js.map +1 -1
  31. package/dist/gateway/errors.d.ts +28 -30
  32. package/dist/gateway/errors.d.ts.map +1 -1
  33. package/dist/gateway/errors.js +29 -31
  34. package/dist/gateway/errors.js.map +1 -1
  35. package/dist/gateway/match.d.ts +54 -54
  36. package/dist/gateway/match.d.ts.map +1 -1
  37. package/dist/gateway/match.js +56 -56
  38. package/dist/gateway/match.js.map +1 -1
  39. package/dist/gateway/middleware.d.ts +62 -64
  40. package/dist/gateway/middleware.d.ts.map +1 -1
  41. package/dist/gateway/middleware.js +1 -1
  42. package/dist/gateway/middleware.js.map +1 -1
  43. package/dist/gateway/mod.d.ts +64 -67
  44. package/dist/gateway/mod.d.ts.map +1 -1
  45. package/dist/gateway/mod.js +72 -76
  46. package/dist/gateway/mod.js.map +1 -1
  47. package/dist/gateway/request.d.ts +138 -134
  48. package/dist/gateway/request.d.ts.map +1 -1
  49. package/dist/gateway/request.js +117 -108
  50. package/dist/gateway/request.js.map +1 -1
  51. package/dist/gateway/serve.d.ts +29 -34
  52. package/dist/gateway/serve.d.ts.map +1 -1
  53. package/dist/gateway/serve.js +51 -56
  54. package/dist/gateway/serve.js.map +1 -1
  55. package/dist/gateways/mod.d.ts +23 -21
  56. package/dist/gateways/mod.d.ts.map +1 -1
  57. package/dist/gateways/mod.js +25 -23
  58. package/dist/gateways/mod.js.map +1 -1
  59. package/dist/internal/runtime/napi/napi.cjs +1 -1
  60. package/dist/internal/runtime/napi/napi.d.cts +10 -3
  61. package/dist/internal/runtime/shutdown.d.ts +75 -57
  62. package/dist/internal/runtime/shutdown.d.ts.map +1 -1
  63. package/dist/internal/runtime/shutdown.js +88 -84
  64. package/dist/internal/runtime/shutdown.js.map +1 -1
  65. package/dist/log/logger.d.ts +43 -37
  66. package/dist/log/logger.d.ts.map +1 -1
  67. package/dist/log/logger.js +26 -25
  68. package/dist/log/logger.js.map +1 -1
  69. package/dist/metrics/mod.d.ts +133 -114
  70. package/dist/metrics/mod.d.ts.map +1 -1
  71. package/dist/metrics/mod.js +109 -101
  72. package/dist/metrics/mod.js.map +1 -1
  73. package/dist/otel.d.ts +6 -3
  74. package/dist/otel.d.ts.map +1 -1
  75. package/dist/otel.js +6 -3
  76. package/dist/otel.js.map +1 -1
  77. package/dist/pubsub/subscription.d.ts +88 -116
  78. package/dist/pubsub/subscription.d.ts.map +1 -1
  79. package/dist/pubsub/subscription.js +14 -17
  80. package/dist/pubsub/subscription.js.map +1 -1
  81. package/dist/pubsub/topic.d.ts +86 -113
  82. package/dist/pubsub/topic.d.ts.map +1 -1
  83. package/dist/pubsub/topic.js +68 -82
  84. package/dist/pubsub/topic.js.map +1 -1
  85. package/dist/reqctx/mod.d.ts +83 -86
  86. package/dist/reqctx/mod.d.ts.map +1 -1
  87. package/dist/reqctx/mod.js +39 -41
  88. package/dist/reqctx/mod.js.map +1 -1
  89. package/dist/services/index.d.ts +76 -75
  90. package/dist/services/index.d.ts.map +1 -1
  91. package/dist/services/index.js +73 -71
  92. package/dist/services/index.js.map +1 -1
  93. package/dist/shutdown/mod.d.ts +26 -25
  94. package/dist/shutdown/mod.d.ts.map +1 -1
  95. package/dist/shutdown/mod.js +26 -25
  96. package/dist/shutdown/mod.js.map +1 -1
  97. package/dist/storage/clickhouse/database.d.ts +113 -115
  98. package/dist/storage/clickhouse/database.d.ts.map +1 -1
  99. package/dist/storage/clickhouse/database.js +65 -79
  100. package/dist/storage/clickhouse/database.js.map +1 -1
  101. package/dist/storage/clickhouse/errors.d.ts +25 -26
  102. package/dist/storage/clickhouse/errors.d.ts.map +1 -1
  103. package/dist/storage/clickhouse/errors.js +15 -17
  104. package/dist/storage/clickhouse/errors.js.map +1 -1
  105. package/dist/storage/clickhouse/mod.d.ts +10 -10
  106. package/dist/storage/clickhouse/mod.js +10 -10
  107. package/dist/storage/objects/bucket.d.ts +196 -225
  108. package/dist/storage/objects/bucket.d.ts.map +1 -1
  109. package/dist/storage/objects/bucket.js +71 -84
  110. package/dist/storage/objects/bucket.js.map +1 -1
  111. package/dist/storage/objects/error.d.ts +4 -4
  112. package/dist/storage/objects/error.js +4 -4
  113. package/dist/storage/postgres/database.d.ts +124 -149
  114. package/dist/storage/postgres/database.d.ts.map +1 -1
  115. package/dist/storage/postgres/database.js +98 -135
  116. package/dist/storage/postgres/database.js.map +1 -1
  117. package/dist/storage/postgres/errors.d.ts +42 -48
  118. package/dist/storage/postgres/errors.d.ts.map +1 -1
  119. package/dist/storage/postgres/errors.js +44 -51
  120. package/dist/storage/postgres/errors.js.map +1 -1
  121. package/dist/storage/postgres/interval.d.ts +19 -19
  122. package/dist/storage/postgres/interval.d.ts.map +1 -1
  123. package/dist/storage/postgres/interval.js +21 -21
  124. package/dist/storage/postgres/interval.js.map +1 -1
  125. package/dist/storage/redis/bitfield.d.ts +48 -23
  126. package/dist/storage/redis/bitfield.d.ts.map +1 -1
  127. package/dist/storage/redis/bitfield.js +38 -19
  128. package/dist/storage/redis/bitfield.js.map +1 -1
  129. package/dist/storage/redis/command.d.ts +16 -12
  130. package/dist/storage/redis/command.d.ts.map +1 -1
  131. package/dist/storage/redis/command.js +16 -12
  132. package/dist/storage/redis/command.js.map +1 -1
  133. package/dist/storage/redis/commands.d.ts +99 -100
  134. package/dist/storage/redis/commands.d.ts.map +1 -1
  135. package/dist/storage/redis/commands.js +84 -85
  136. package/dist/storage/redis/commands.js.map +1 -1
  137. package/dist/storage/redis/database.d.ts +138 -122
  138. package/dist/storage/redis/database.d.ts.map +1 -1
  139. package/dist/storage/redis/database.js +120 -101
  140. package/dist/storage/redis/database.js.map +1 -1
  141. package/dist/storage/redis/mod.d.ts +52 -48
  142. package/dist/storage/redis/mod.d.ts.map +1 -1
  143. package/dist/storage/redis/mod.js +52 -48
  144. package/dist/storage/redis/mod.js.map +1 -1
  145. package/dist/storage/redis/options.d.ts +26 -24
  146. package/dist/storage/redis/options.d.ts.map +1 -1
  147. package/dist/storage/redis/options.js.map +1 -1
  148. package/dist/storage/redis/pubsub.d.ts +16 -16
  149. package/dist/storage/redis/pubsub.d.ts.map +1 -1
  150. package/dist/storage/redis/pubsub.js +14 -14
  151. package/dist/storage/redis/pubsub.js.map +1 -1
  152. package/dist/storage/redis/reply.d.ts +80 -72
  153. package/dist/storage/redis/reply.d.ts.map +1 -1
  154. package/dist/storage/redis/reply.js +53 -46
  155. package/dist/storage/redis/reply.js.map +1 -1
  156. package/dist/storage/redis/scan.d.ts +4 -4
  157. package/dist/storage/redis/scan.d.ts.map +1 -1
  158. package/dist/storage/redis/scan.js +6 -6
  159. package/dist/storage/redis/scan.js.map +1 -1
  160. package/dist/storage/redis/script.d.ts +28 -21
  161. package/dist/storage/redis/script.d.ts.map +1 -1
  162. package/dist/storage/redis/script.js +29 -22
  163. package/dist/storage/redis/script.js.map +1 -1
  164. package/dist/storage/redis/target.d.ts +17 -1
  165. package/dist/storage/redis/target.d.ts.map +1 -1
  166. package/dist/storage/redis/target.js +30 -1
  167. package/dist/storage/redis/target.js.map +1 -1
  168. package/dist/storage/redis/wire.d.ts +6 -6
  169. package/dist/storage/redis/wire.d.ts.map +1 -1
  170. package/dist/storage/redis/wire.js +6 -6
  171. package/dist/storage/redis/wire.js.map +1 -1
  172. package/dist/testing/mod.d.ts +83 -88
  173. package/dist/testing/mod.d.ts.map +1 -1
  174. package/dist/testing/mod.js +75 -81
  175. package/dist/testing/mod.js.map +1 -1
  176. package/dist/testing/playwright.d.ts +28 -32
  177. package/dist/testing/playwright.d.ts.map +1 -1
  178. package/dist/testing/playwright.js +22 -27
  179. package/dist/testing/playwright.js.map +1 -1
  180. package/dist/testing/puppeteer.d.ts +11 -12
  181. package/dist/testing/puppeteer.d.ts.map +1 -1
  182. package/dist/testing/puppeteer.js +17 -18
  183. package/dist/testing/puppeteer.js.map +1 -1
  184. package/dist/testing/system.d.ts +72 -90
  185. package/dist/testing/system.d.ts.map +1 -1
  186. package/dist/testing/system.js +90 -107
  187. package/dist/testing/system.js.map +1 -1
  188. package/dist/tsconfig.build.tsbuildinfo +1 -1
  189. package/frontends/mod.test.ts +6 -2
  190. package/frontends/mod.ts +20 -19
  191. package/gateway/errors.ts +30 -32
  192. package/gateway/match.ts +61 -57
  193. package/gateway/middleware.ts +62 -64
  194. package/gateway/mod.ts +73 -76
  195. package/gateway/request.ts +143 -140
  196. package/gateway/serve.ts +58 -63
  197. package/gateways/mod.ts +25 -23
  198. package/internal/runtime/napi/napi.cjs +1 -1
  199. package/internal/runtime/napi/napi.d.cts +10 -3
  200. package/internal/runtime/shutdown.ts +113 -101
  201. package/log/logger.test.ts +8 -0
  202. package/log/logger.ts +48 -45
  203. package/metrics/mod.ts +138 -122
  204. package/otel.ts +6 -3
  205. package/package.json +1 -1
  206. package/pubsub/subscription.ts +93 -123
  207. package/pubsub/topic.ts +96 -130
  208. package/reqctx/mod.ts +83 -86
  209. package/services/index.ts +78 -78
  210. package/shutdown/mod.ts +26 -25
  211. package/storage/clickhouse/database.ts +115 -129
  212. package/storage/clickhouse/errors.ts +27 -29
  213. package/storage/clickhouse/mod.ts +10 -10
  214. package/storage/objects/bucket.ts +209 -239
  215. package/storage/objects/error.ts +4 -4
  216. package/storage/postgres/database.ts +131 -164
  217. package/storage/postgres/errors.ts +45 -52
  218. package/storage/postgres/interval.ts +21 -21
  219. package/storage/redis/bitfield.ts +51 -26
  220. package/storage/redis/command.ts +16 -12
  221. package/storage/redis/commands.ts +99 -100
  222. package/storage/redis/database.ts +145 -123
  223. package/storage/redis/mod.ts +52 -48
  224. package/storage/redis/options.ts +26 -24
  225. package/storage/redis/pubsub.ts +14 -14
  226. package/storage/redis/redis.test.ts +17 -2
  227. package/storage/redis/reply.ts +85 -77
  228. package/storage/redis/scan.ts +6 -6
  229. package/storage/redis/script.ts +29 -22
  230. package/storage/redis/target.ts +34 -1
  231. package/storage/redis/wire.ts +8 -8
  232. package/testing/mod.ts +99 -105
  233. package/testing/playwright.ts +32 -37
  234. package/testing/puppeteer.ts +22 -23
  235. package/testing/system.ts +117 -133
@@ -4,9 +4,10 @@ import { parseTraceparent } from '../internal/otel/propagator.js';
4
4
  import * as reqfields from '../internal/reqfields.js';
5
5
  import { Field } from '../reqctx/mod.js';
6
6
  /**
7
- * A set of a Middleware's later hooks, which {@link Request.skip} narrows,
8
- * combined with `|`: `Hook.Response | Hook.Complete`. `onRequest` is not
9
- * among them: it is the hook that skips.
7
+ * Bitmask flags identifying later middleware hooks that can be skipped with
8
+ * {@link Request.skip}, combined with `|` (e.g.
9
+ * `Hook.Response | Hook.Complete`). `onRequest` is omitted because it is the
10
+ * hook that calls `skip`.
10
11
  */
11
12
  export const Hook = {
12
13
  /** `onRequestBody`. */
@@ -22,9 +23,8 @@ const SET = 0;
22
23
  const ADD = 1;
23
24
  const REMOVE = 2;
24
25
  /**
25
- * Whether a Middleware may not edit the header `name`, lowercase: Encore's
26
- * headers, the trace context's, those framing the message, and CORS's. The
27
- * gateway refuses the same edits.
26
+ * Reports whether a lowercase header name is reserved by Encore (internal
27
+ * `x-encore-*` headers, trace context, HTTP framing, and CORS headers).
28
28
  * @internal
29
29
  */
30
30
  export function isProtected(name) {
@@ -54,24 +54,26 @@ function overridden(overrides, op, name, value, current) {
54
54
  out.set(name, []);
55
55
  return out;
56
56
  }
57
- /** The timed hook the code running now is part of, following its `await`s,
58
- * timers and callbacks: so that what a timed-out hook goes on doing cannot
59
- * change the state its later hooks are shown. @internal */
57
+ /**
58
+ * Tracks the currently running timed hook across async continuations so a
59
+ * timed-out hook cannot mutate `Request.state` after the gateway has moved on.
60
+ * @internal
61
+ */
60
62
  export const hookRuns = new AsyncLocalStorage();
61
- /** Never aborts: the signal of a hook without a timeout. */
63
+ /** Never aborts; used as the signal for untimed hooks. */
62
64
  const NEVER = new AbortController().signal;
63
65
  /**
64
- * A public request the gateway serves, as a Middleware is shown it. Made by
65
- * Encore: the same object is passed to each of one Middleware's hooks for
66
- * one request.
66
+ * Represents an incoming public request passed to a middleware's hooks. The
67
+ * same instance is reused across all hooks of a single middleware for a given
68
+ * request.
67
69
  *
68
- * It reads the request's headers, query parameters and cookies as the hook
69
- * asks for them, as the Middleware before this one left them, and with this
70
- * one's edits. Encore's own headers, `x-encore-*`, are never shown. Edits
71
- * are only allowed in `onRequest`; elsewhere they throw.
70
+ * Headers, query parameters, and cookies are read lazily and reflect edits
71
+ * made by earlier middleware as well as this middleware. Internal `x-encore-*`
72
+ * headers are never exposed. Mutating methods are only permitted inside
73
+ * `onRequest` and throw if called elsewhere.
72
74
  */
73
75
  export class Request {
74
- /** Identifies the request among those in flight; unique while it is. */
76
+ /** Identifier unique among currently in-flight requests. */
75
77
  id;
76
78
  /** @internal */ middleware;
77
79
  /** @internal */ view;
@@ -79,16 +81,14 @@ export class Request {
79
81
  /** @internal */ overrides;
80
82
  /** @internal */ deciding = false;
81
83
  /** @internal */ edits = [];
82
- /** @internal The request's Request Context fields, encoded, with this
83
- * Middleware's changes: changed in place, as the context its hooks run in
84
- * holds this record. */
84
+ /** @internal Encoded Request Context fields, mutated in place so active hook contexts see updates immediately. */
85
85
  fields = {};
86
- /** @internal The changes `set` and `unset` made, for the gateway. */
86
+ /** @internal Field mutations queued for the native gateway. */
87
87
  fieldEdits = [];
88
88
  /** @internal */ attributes = [];
89
89
  /** @internal */ skipped = 0;
90
90
  /** @internal */ hookSignal = NEVER;
91
- /** @internal Made by Encore. */
91
+ /** @internal Created by Encore. */
92
92
  constructor(middleware, id, view, lane) {
93
93
  this.middleware = middleware;
94
94
  this.id = id;
@@ -99,53 +99,53 @@ export class Request {
99
99
  this.fields[name] = value;
100
100
  }
101
101
  }
102
- /** The HTTP method, upper case. */
102
+ /** Uppercase HTTP method (e.g. `"GET"`). */
103
103
  get method() {
104
104
  return this.view?.method ?? '';
105
105
  }
106
- /** The host the client addressed, from its Host header, if any. */
106
+ /** Value of the client's `Host` header, if present. */
107
107
  get host() {
108
108
  return this.view?.host ?? undefined;
109
109
  }
110
- /** The path, as the client sent it: not percent-decoded, without the
111
- * query. */
110
+ /** Raw request path as sent by the client (not percent-decoded, without query string). */
112
111
  get path() {
113
112
  return this.view?.path ?? '';
114
113
  }
115
- /** The service the gateway routes the request to. */
114
+ /** Target service name that the gateway routes this request to. */
116
115
  get service() {
117
116
  return this.view?.service ?? '';
118
117
  }
119
- /** The route template it matched, such as `/users/{id}`. */
118
+ /** Matched route template (e.g. `/users/{id}`). */
120
119
  get route() {
121
120
  return this.view?.route ?? '';
122
121
  }
123
- /** The address of the client the gateway took the request from, if
124
- * known. */
122
+ /** Client IP address observed by the gateway, if known. */
125
123
  get clientIp() {
126
124
  return this.view?.clientIp ?? undefined;
127
125
  }
128
126
  /**
129
- * Aborts when the hook running now runs out of time: `onRequest` and
130
- * `onResponse` have their Middleware's timeout, and the gateway goes on
131
- * without them then. Pass it to what the hook awaits, as `fetch`, so the
132
- * work stops too. It never aborts in the other hooks.
127
+ * Aborts when the current hook exceeds its timeout (`onRequest` and
128
+ * `onResponse` only). Pass this signal to async operations such as `fetch`
129
+ * so they cancel cleanly if the gateway moves on. Never aborts in other hooks.
133
130
  */
134
131
  get signal() {
135
132
  return this.hookSignal;
136
133
  }
137
- /** The value of the path parameter `name` of the matched route, as it was
138
- * sent, not percent-decoded; undefined when the route has none of that
139
- * name. */
134
+ /**
135
+ * Returns the raw (non-percent-decoded) value of path parameter `name`, or
136
+ * `undefined` if the matched route has no parameter with that name.
137
+ */
140
138
  pathParam(name) {
141
139
  return this.view?.pathParam(name) ?? undefined;
142
140
  }
143
- /** The first value of the request header `name`, as earlier Middleware
144
- * left it; undefined when it is not sent. Any case. */
141
+ /**
142
+ * Returns the first value of request header `name` (case-insensitive), or
143
+ * `undefined` if absent. Reflects edits by earlier middleware and this hook.
144
+ */
145
145
  header(name) {
146
146
  return this.headerValues(name)[0];
147
147
  }
148
- /** Every value of the request header `name`, in order. Any case. */
148
+ /** Returns all values of request header `name` (case-insensitive) in order. */
149
149
  headerValues(name) {
150
150
  const lower = name.toLowerCase();
151
151
  const edited = this.overrides?.get(lower);
@@ -153,24 +153,28 @@ export class Request {
153
153
  return [...edited];
154
154
  return this.view?.headerValues(lower) ?? [];
155
155
  }
156
- /** The first value of the query parameter `name`, percent-decoded;
157
- * undefined when it is not sent. */
156
+ /**
157
+ * Returns the first percent-decoded value of query parameter `name`, or
158
+ * `undefined` if absent.
159
+ */
158
160
  query(name) {
159
161
  return this.queryValues(name)[0];
160
162
  }
161
- /** Every value of the query parameter `name`, percent-decoded, in
162
- * order. */
163
+ /** Returns all percent-decoded values of query parameter `name` in order. */
163
164
  queryValues(name) {
164
165
  return this.view?.queryValues(name) ?? [];
165
166
  }
166
- /** The value of the cookie `name`, from the `Cookie` headers as the
167
- * Middleware before this one left them; undefined when it is not sent. */
167
+ /**
168
+ * Returns the value of cookie `name` from the current `Cookie` headers, or
169
+ * `undefined` if absent.
170
+ */
168
171
  cookie(name) {
169
172
  return this.view?.cookie(name) ?? undefined;
170
173
  }
171
- /** The context of the request's span at the gateway, which the spans its
172
- * hooks start are children of; undefined when the request is not
173
- * traced. */
174
+ /**
175
+ * Span context for this request at the gateway (parent of spans started by
176
+ * hooks), or `undefined` if the request is not traced.
177
+ */
174
178
  get spanContext() {
175
179
  const tp = this.view?.traceparent;
176
180
  if (!tp)
@@ -198,27 +202,32 @@ export class Request {
198
202
  this.overrides = overridden(this.overrides, op, lower, value, current);
199
203
  }
200
204
  /**
201
- * Sets the request header `name` to `value`, replacing any values, for the
202
- * Middleware after this one and the service. Only in `onRequest`. Not for
203
- * Encore's headers (`x-encore-*`, the trace context), those framing the
204
- * message (`content-length` and the like) and CORS's: those throw.
205
+ * Sets request header `name` to `value`, replacing any existing values, for
206
+ * downstream middleware and the target service. Only valid in `onRequest`.
207
+ * Throws if `name` is reserved by Encore (`x-encore-*`, trace context,
208
+ * HTTP framing, or CORS headers).
205
209
  */
206
210
  setHeader(name, value) {
207
211
  this.edit('setHeader', SET, name, String(value));
208
212
  }
209
- /** Adds `value` to the request header `name`, keeping its values. As
210
- * {@link Request.setHeader}. */
213
+ /**
214
+ * Appends `value` to request header `name` without removing existing values.
215
+ * Only valid in `onRequest`; see {@link Request.setHeader}.
216
+ */
211
217
  addHeader(name, value) {
212
218
  this.edit('addHeader', ADD, name, String(value));
213
219
  }
214
- /** Removes the request header `name`. As {@link Request.setHeader}. */
220
+ /**
221
+ * Removes request header `name`. Only valid in `onRequest`; see
222
+ * {@link Request.setHeader}.
223
+ */
215
224
  delHeader(name) {
216
225
  this.edit('delHeader', REMOVE, name, '');
217
226
  }
218
227
  /**
219
- * Sets attributes of the request's span at the gateway, as a user or
220
- * tenant id to find its trace by. Never secrets. Only in `onRequest`. An
221
- * integer number is recorded as an integer, another as a float.
228
+ * Attaches attributes to the gateway's request span (for example, a user or
229
+ * tenant ID for trace search — never secrets). Only valid in `onRequest`.
230
+ * Safe integers are recorded as integers; other numbers are recorded as floats.
222
231
  */
223
232
  setAttributes(attributes) {
224
233
  this.mustDecide('setAttributes');
@@ -236,38 +245,37 @@ export class Request {
236
245
  });
237
246
  break;
238
247
  default:
239
- throw new TypeError(`span attribute ${JSON.stringify(key)} is a ${typeof value}; ` +
240
- 'a span attribute is a string, boolean or number');
248
+ throw new TypeError(`span attribute ${JSON.stringify(key)} has type ${typeof value}; ` +
249
+ 'expected a string, boolean, or number');
241
250
  }
242
251
  }
243
252
  }
244
- /** Skips this Middleware's later `hooks` for this request, as an
245
- * `onResponse` a request without a session has no use for:
246
- * `req.skip(Hook.Response | Hook.Complete)`. Only in `onRequest`. */
253
+ /**
254
+ * Skips the specified later `hooks` of this middleware for this request
255
+ * (e.g. `req.skip(Hook.Response | Hook.Complete)`). Only valid in `onRequest`.
256
+ */
247
257
  skip(hooks) {
248
258
  this.mustDecide('skip');
249
259
  if (!Number.isInteger(hooks) || hooks < 0 || hooks > 0xff) {
250
- throw new TypeError('skip takes Hook flags, as Hook.Response | Hook.Complete');
260
+ throw new TypeError('skip expects Hook flags (e.g. Hook.Response | Hook.Complete)');
251
261
  }
252
262
  this.skipped |= hooks & ~1;
253
263
  }
254
264
  /**
255
- * The Request Context field's value for the request; undefined when it is
256
- * not set: as the Middleware before this one set it, or this one did. In
257
- * a hook, `field.get()` reads the same, as hooks run in their request's
258
- * context; in `onComplete`, as the request was forwarded. A value that is
259
- * not JSON reads as not set, as it does to `field.get()`.
265
+ * Returns the current value of Request Context `field` for this request, or
266
+ * `undefined` if unset. Hooks can equivalently call `field.get()`. In
267
+ * `onComplete`, reflects the value as forwarded. Invalid JSON values are
268
+ * treated as unset.
260
269
  */
261
270
  get(field) {
262
271
  checkField('get', field);
263
272
  return field.get(reqfields.withLiveFields(this.fields, ROOT_CONTEXT));
264
273
  }
265
274
  /**
266
- * Sets the Request Context field to `value` for the request. The
267
- * Middleware after this one, the service the request reaches, and every
268
- * service it calls in turn with the request's context read it, with
269
- * `field.get()`; so do the calls this hook makes from then on. It is how a
270
- * Middleware that authenticates says who the request is for:
275
+ * Sets Request Context `field` to `value` for this request. Subsequent
276
+ * middleware, the target service, downstream services called with the
277
+ * request's context, and calls made by this hook afterward will read it via
278
+ * `field.get()`.
271
279
  *
272
280
  * ```ts
273
281
  * export const currentUser = new Field<User>('user');
@@ -283,14 +291,14 @@ export class Request {
283
291
  * }
284
292
  * ```
285
293
  *
286
- * Only in `onRequest`. The request takes the fields once the hook
287
- * returns: none when it fails or answers the request.
294
+ * Only valid in `onRequest`. Changes are applied only if `onRequest` lets
295
+ * the request through; they are discarded if the hook fails or rejects.
288
296
  *
289
- * @throws TypeError - The value has no JSON form, or `field` is not a
290
- * {@link Field}.
291
- * @throws RangeError - The value encodes to more than a field may: 4 KiB,
292
- * or 1 KiB for a field declared with `pubsub`; or it makes the request's
293
- * fields encode to more than 8 KiB.
297
+ * @throws TypeError If `value` cannot be serialized to JSON or `field` is
298
+ * not a {@link Field}.
299
+ * @throws RangeError If the encoded value exceeds the per-field limit (4 KiB,
300
+ * or 1 KiB for fields with `pubsub` enabled) or pushes total request fields
301
+ * past 8 KiB.
294
302
  */
295
303
  set(field, value) {
296
304
  this.mustDecide('set');
@@ -300,8 +308,10 @@ export class Request {
300
308
  this.fields[field.name] = encoded;
301
309
  this.fieldEdits.push({ name: field.name, value: encoded });
302
310
  }
303
- /** Clears the Request Context field for the request, as one the
304
- * Middleware before this one set. As {@link Request.set} sets it. */
311
+ /**
312
+ * Clears Request Context `field` for this request (including values set by
313
+ * earlier middleware). Only valid in `onRequest`.
314
+ */
305
315
  unset(field) {
306
316
  this.mustDecide('unset');
307
317
  checkField('unset', field);
@@ -309,24 +319,22 @@ export class Request {
309
319
  this.fieldEdits.push({ name: field.name, value: null });
310
320
  }
311
321
  /**
312
- * What this Middleware kept for the request, for its later hooks: the
313
- * user `onRequest` found, for `onComplete` to bill. Undefined until set.
314
- * Encore drops it when the request is done.
322
+ * Per-request state private to this middleware, shared across its hooks
323
+ * (for example, saving an authenticated user in `onRequest` for `onComplete`
324
+ * to record). Starts as `undefined` and is dropped when the request finishes.
315
325
  *
316
- * When `onRequest` or `onResponse` fails or times out, `state` goes back
317
- * to the object it was before the hook; what the hook changed inside that
318
- * object stays, since Encore does not copy it. A hook that may fail after
319
- * changing it should set a new object, as `req.state = {...req.state,
320
- * billed: true}`, rather than change the one it has. A hook that goes on
321
- * after it timed out may no longer set it: that throws.
326
+ * If `onRequest` or `onResponse` fails or times out, `state` reverts to its
327
+ * reference before the hook ran. Because Encore does not deep-copy `state`,
328
+ * assign a new object (e.g. `req.state = {...req.state, billed: true}`)
329
+ * rather than mutating in place if the hook might fail later. Setting `state`
330
+ * after a hook has timed out throws an error.
322
331
  */
323
332
  get state() {
324
333
  return this.lane.state;
325
334
  }
326
335
  set state(value) {
327
336
  if (hookRuns.getStore()?.expired) {
328
- throw new Error(`middleware ${JSON.stringify(this.middleware)}: Request.state is not set by a hook ` +
329
- 'that timed out: the gateway went on without it');
337
+ throw new Error(`middleware ${JSON.stringify(this.middleware)}: cannot set Request.state after the hook timed out`);
330
338
  }
331
339
  this.lane.state = value;
332
340
  }
@@ -342,29 +350,28 @@ function checkField(method, field) {
342
350
  }
343
351
  }
344
352
  /**
345
- * A response to a request the gateway served, in `onResponse`. Made by
346
- * Encore. It reads the response's headers as the hook asks for them, as the
347
- * Middleware after this one left them, and with this one's edits.
353
+ * Represents the HTTP response passed to `onResponse`. Headers are read lazily
354
+ * and reflect edits made by downstream middleware as well as this middleware.
348
355
  */
349
356
  export class Response {
350
- /** The HTTP status. */
357
+ /** The HTTP status code. */
351
358
  status;
352
359
  /** @internal */ middleware;
353
360
  /** @internal */ headers;
354
361
  /** @internal */ overrides;
355
362
  /** @internal */ editing = false;
356
363
  /** @internal */ edits = [];
357
- /** @internal Made by Encore. */
364
+ /** @internal Created by Encore. */
358
365
  constructor(middleware, status, headers) {
359
366
  this.middleware = middleware;
360
367
  this.status = status;
361
368
  this.headers = headers;
362
369
  }
363
- /** The first value of the response header `name`, if any. Any case. */
370
+ /** Returns the first value of response header `name` (case-insensitive), or `undefined` if absent. */
364
371
  header(name) {
365
372
  return this.headerValues(name)[0];
366
373
  }
367
- /** Every value of the response header `name`, in order. Any case. */
374
+ /** Returns all values of response header `name` (case-insensitive) in order. */
368
375
  headerValues(name) {
369
376
  const lower = name.toLowerCase();
370
377
  const edited = this.overrides?.get(lower);
@@ -385,17 +392,19 @@ export class Response {
385
392
  this.edits.push({ op, name, value });
386
393
  this.overrides = overridden(this.overrides, op, lower, value, current);
387
394
  }
388
- /** Sets the response header `name` to `value`, replacing any values,
389
- * before it is written to the client. Not for the headers
390
- * {@link Request.setHeader} may not set. */
395
+ /**
396
+ * Sets response header `name` to `value`, replacing any existing values,
397
+ * before the response is sent to the client. Rejects the same reserved
398
+ * headers as {@link Request.setHeader}.
399
+ */
391
400
  setHeader(name, value) {
392
401
  this.edit('setHeader', SET, name, String(value));
393
402
  }
394
- /** Adds `value` to the response header `name`. */
403
+ /** Appends `value` to response header `name`. */
395
404
  addHeader(name, value) {
396
405
  this.edit('addHeader', ADD, name, String(value));
397
406
  }
398
- /** Removes the response header `name`. */
407
+ /** Removes response header `name`. */
399
408
  delHeader(name) {
400
409
  this.edit('delHeader', REMOVE, name, '');
401
410
  }
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../gateway/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,KAAK,EAAC,MA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O,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,IAAY,EAAE,KAAa;QACnC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,iDAAiD;IACjD,SAAS,CAAC,IAAY,EAAE,KAAa;QACnC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,sCAAsC;IACtC,SAAS,CAAC,IAAY;QACpB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAC3C,CAAC;CACF"}
@@ -1,19 +1,17 @@
1
1
  /**
2
- * Serving the gateway, and handing the events of its hooks to the
3
- * Middleware.
2
+ * Gateway registration and hook event dispatcher.
4
3
  *
5
- * The Middleware are registered with the runtime's gateway variant, whose
6
- * thread hands the events of their hooks to the event loop in batches. Each
7
- * Middleware's events for one request run in a lane: one at a time, in the
8
- * order the host queued them; lanes run concurrently. A `request` or
9
- * `response` event the host awaits an answer to is answered once its hook
4
+ * Middleware are registered with the native gateway runtime, which delivers
5
+ * hook events to the JS event loop in batches. Events for a given
6
+ * `(middleware, request)` pair run sequentially in a lane; separate lanes run
7
+ * concurrently. Blocking `request` and `response` events resolve once the hook
10
8
  * returns, throws, or times out.
11
9
  */
12
10
  /// <reference types="node" />
13
11
  /// <reference types="node" />
14
12
  import { type ErrorPolicy, type HookName, type Middleware } from './middleware.js';
15
13
  import { type HeaderEdit, type NativeAttribute, type NativeField, type NativeHeaders, type NativeView } from './request.js';
16
- /** The runtime's gateway functions, of its gateway variant. @internal */
14
+ /** Native gateway runtime bindings. @internal */
17
15
  export interface GatewayNative {
18
16
  gatewayRegister(specJson: string): number;
19
17
  gatewayServe(runtime: unknown, onEvents: (events: RawEvent[] | null) => void): string;
@@ -27,12 +25,12 @@ export interface GatewayNative {
27
25
  gatewayWaited(eventId: number): number | null;
28
26
  gatewayDropped(): number;
29
27
  }
30
- /** A hook event as the native runtime hands it on. @internal */
28
+ /** Hook event delivered by the native runtime. @internal */
31
29
  export interface RawEvent {
32
30
  kind: 'request' | 'requestBody' | 'response' | 'responseBody' | 'complete' | 'finish';
33
31
  middleware: number;
34
32
  request: number;
35
- /** What an answer names; 0 when none is awaited. */
33
+ /** Event ID to reply to, or 0 when no reply is expected. */
36
34
  eventId: number;
37
35
  view?: NativeView;
38
36
  chunk?: Uint8Array;
@@ -43,7 +41,7 @@ export interface RawEvent {
43
41
  }
44
42
  /** @internal */
45
43
  export interface RawCompleted {
46
- /** 0 when none was written. */
44
+ /** 0 when no status was written. */
47
45
  status: number;
48
46
  rejectedBy?: string | null;
49
47
  error?: string | null;
@@ -53,9 +51,9 @@ export interface RawCompleted {
53
51
  requestBodySize: number;
54
52
  responseBodySize: number;
55
53
  }
56
- /** `RateLimit` as `rate-limit`, `JWTAuth` as `jwt-auth`. @internal */
54
+ /** Converts a class name to kebab-case (e.g. `RateLimit` -> `rate-limit`, `JWTAuth` -> `jwt-auth`). @internal */
57
55
  export declare function kebab(className: string): string;
58
- /** A Middleware as the dispatcher calls it. @internal */
56
+ /** Validated middleware entry used by the dispatcher. @internal */
59
57
  export interface Registered {
60
58
  mw: Middleware;
61
59
  name: string;
@@ -64,51 +62,48 @@ export interface Registered {
64
62
  onError: ErrorPolicy;
65
63
  }
66
64
  /**
67
- * The Middleware `serve` is given, checked as far as JavaScript can tell;
68
- * the gateway checks the rest when it is served.
65
+ * Validates middleware passed to `serve` before registering them with the
66
+ * native gateway.
69
67
  * @internal
70
68
  */
71
69
  export declare function check(middleware: readonly unknown[]): Registered[];
72
- /** `reg` as the gateway core registers it, as JSON: its name, Interest and
73
- * limits. @internal */
70
+ /** Serializes a validated middleware registration to JSON for the gateway core. @internal */
74
71
  export declare function spec(reg: Registered): string;
75
- /** Hands the host's hook events to the Middleware. @internal */
72
+ /** Dispatches native gateway hook events to registered middleware. @internal */
76
73
  export declare class Dispatcher {
77
74
  private readonly native;
78
75
  private readonly mws;
79
76
  private readonly lanes;
80
77
  private readonly running;
81
78
  private markClosed;
82
- /** Resolves once the host has said no events will come. */
79
+ /** Resolves once the host indicates no further events will arrive. */
83
80
  readonly closed: Promise<void>;
84
81
  constructor(native: GatewayNative, mws: ReadonlyMap<number, Registered>);
85
- /** Takes a batch, or null once the host has closed. */
82
+ /** Enqueues a batch of events, or `null` when the host closes the stream. */
86
83
  deliver(events: RawEvent[] | null): void;
87
- /** Waits for every lane to have handled its events. */
84
+ /** Waits until all active lanes finish processing their queued events. */
88
85
  drained(): Promise<void>;
89
86
  private run;
90
87
  private handle;
91
- /** The request of `lane`, or one known only by its id, should its request
92
- * event not have reached the lane. */
88
+ /** Returns the lane's `Request`, creating a minimal stub if no `request` event arrived. */
93
89
  private request;
94
- /** What is left of the hook's timeout, in milliseconds: the gateway times
95
- * it from when it queued the hook, so a hook that waited has less.
96
- * Undefined when the gateway no longer waits for it: the timeout passed,
97
- * and the gateway went on without it. */
90
+ /**
91
+ * Returns the remaining timeout budget in milliseconds, or `undefined` if
92
+ * the gateway is no longer waiting for this event.
93
+ */
98
94
  private remaining;
99
95
  private timedOut;
100
96
  private onRequest;
101
97
  private onResponse;
102
98
  private respond;
103
- /** Answers a hook: whether the gateway took the answer, false when it no
104
- * longer waited for one. */
99
+ /** Replies to a hook, returning `false` if the gateway is no longer waiting. */
105
100
  private answer;
106
- /** Calls a hook nothing awaits the answer of, logging what it throws. */
101
+ /** Runs a fire-and-forget hook and logs any error it throws. */
107
102
  private guard;
108
- /** Calls `hook` with the request's trace and Request Context as the
109
- * current ones, so the spans it starts and the calls it makes are part of
110
- * the trace, and carry the fields. The context holds the request's fields
111
- * themselves, so the calls carry those the hook sets as it sets them. */
103
+ /**
104
+ * Runs `hook` with the request's active trace context and live Request
105
+ * Context fields so spans and downstream service calls inherit both.
106
+ */
112
107
  private traced;
113
108
  }
114
109
  //# sourceMappingURL=serve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../gateway/serve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;;AAQH,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAKL,KAAK,UAAU,EAGf,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AAEnB,yEAAyE;AACzE,MAAM,WAAW,aAAa;IAC5B,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1C,YAAY,CACV,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,KAAK,IAAI,GAC5C,MAAM,CAAC;IACV,eAAe,CACb,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,UAAU,EAAE,EACzB,OAAO,EAAE,WAAW,EAAE,EACtB,UAAU,EAAE,eAAe,EAAE,EAC7B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;IACX,cAAc,CACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC,EAC7C,IAAI,EAAE,MAAM,GAAG,IAAI,GAClB,OAAO,CAAC;IACX,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC1E,WAAW,CACT,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MA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