@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
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Where the app's frontends are reached.
2
+ * Look up the URLs where the application's frontends are served.
3
3
  *
4
- * {@link url} is a frontend's URL in the environment the code runs in, as to
5
- * send a user there or to build a link to one of its pages:
4
+ * {@link url} returns a frontend's base URL in the current environment, for
5
+ * example when redirecting a user or constructing links to frontend pages:
6
6
  *
7
7
  * ```ts
8
8
  * import * as frontends from '@encore.dev/sdk/frontends';
@@ -10,26 +10,27 @@
10
10
  * const reset = `${frontends.url('web')}/reset?token=${token}`;
11
11
  * ```
12
12
  *
13
- * Looking a frontend's URL up links the calling service to it. Encore reads
14
- * the link from the code, as it reads which services a service depends on: so
15
- * the name must be a string literal, written as the frontend declares it, the
16
- * function must be called directly rather than passed around, and the call
17
- * must be in a service.
13
+ * Calling `url()` registers a dependency from the calling service to that
14
+ * frontend. Because Encore resolves these references statically, the frontend
15
+ * name must be a string literal matching the frontend's declared name, `url`
16
+ * must be called directly (not aliased or passed around), and the call must
17
+ * appear inside a service.
18
18
  *
19
19
  * @module
20
20
  */
21
21
  /**
22
- * The URL `frontend` is reached at in this environment, without a trailing
23
- * slash: a path goes after it, `` `${url("web")}/reset` ``. It is the first of
24
- * the frontend's origins, as {@link appMeta} lists them.
25
- *
26
- * The name is the one the frontend is declared with, in its
27
- * `encore.frontend.json` or as the service hosting it: `web_app` does not find
28
- * `web-app`.
29
- *
30
- * Throws if the runtime knows no URL for `frontend`: the app has no frontend of
31
- * that name, which Encore's parser reports, or the environment gives it no
32
- * origins.
22
+ * Returns the base URL where `frontend` is served in this environment, without
23
+ * a trailing slash (so paths can be appended directly, e.g.
24
+ * `` `${url("web")}/reset` ``). This is the first origin listed for the
25
+ * frontend in {@link appMeta}.
26
+ *
27
+ * The name must match the frontend's declared name in `encore.frontend.json`
28
+ * (or the hosting service's name): for example, `"web_app"` will not match
29
+ * `"web-app"`.
30
+ *
31
+ * Throws if no URL is available for `frontend` — either because no frontend
32
+ * with that name exists in the app (which Encore's parser reports) or because
33
+ * no origins are configured for it in this environment.
33
34
  *
34
35
  * @example
35
36
  * import {url} from "@encore.dev/sdk/frontends";
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../frontends/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAS5C"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../frontends/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAS5C"}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Where the app's frontends are reached.
2
+ * Look up the URLs where the application's frontends are served.
3
3
  *
4
- * {@link url} is a frontend's URL in the environment the code runs in, as to
5
- * send a user there or to build a link to one of its pages:
4
+ * {@link url} returns a frontend's base URL in the current environment, for
5
+ * example when redirecting a user or constructing links to frontend pages:
6
6
  *
7
7
  * ```ts
8
8
  * import * as frontends from '@encore.dev/sdk/frontends';
@@ -10,27 +10,28 @@
10
10
  * const reset = `${frontends.url('web')}/reset?token=${token}`;
11
11
  * ```
12
12
  *
13
- * Looking a frontend's URL up links the calling service to it. Encore reads
14
- * the link from the code, as it reads which services a service depends on: so
15
- * the name must be a string literal, written as the frontend declares it, the
16
- * function must be called directly rather than passed around, and the call
17
- * must be in a service.
13
+ * Calling `url()` registers a dependency from the calling service to that
14
+ * frontend. Because Encore resolves these references statically, the frontend
15
+ * name must be a string literal matching the frontend's declared name, `url`
16
+ * must be called directly (not aliased or passed around), and the call must
17
+ * appear inside a service.
18
18
  *
19
19
  * @module
20
20
  */
21
21
  import { appMeta } from '../app_meta.js';
22
22
  /**
23
- * The URL `frontend` is reached at in this environment, without a trailing
24
- * slash: a path goes after it, `` `${url("web")}/reset` ``. It is the first of
25
- * the frontend's origins, as {@link appMeta} lists them.
23
+ * Returns the base URL where `frontend` is served in this environment, without
24
+ * a trailing slash (so paths can be appended directly, e.g.
25
+ * `` `${url("web")}/reset` ``). This is the first origin listed for the
26
+ * frontend in {@link appMeta}.
26
27
  *
27
- * The name is the one the frontend is declared with, in its
28
- * `encore.frontend.json` or as the service hosting it: `web_app` does not find
29
- * `web-app`.
28
+ * The name must match the frontend's declared name in `encore.frontend.json`
29
+ * (or the hosting service's name): for example, `"web_app"` will not match
30
+ * `"web-app"`.
30
31
  *
31
- * Throws if the runtime knows no URL for `frontend`: the app has no frontend of
32
- * that name, which Encore's parser reports, or the environment gives it no
33
- * origins.
32
+ * Throws if no URL is available for `frontend` — either because no frontend
33
+ * with that name exists in the app (which Encore's parser reports) or because
34
+ * no origins are configured for it in this environment.
34
35
  *
35
36
  * @example
36
37
  * import {url} from "@encore.dev/sdk/frontends";
@@ -39,8 +40,8 @@ import { appMeta } from '../app_meta.js';
39
40
  export function url(frontend) {
40
41
  const found = appMeta().frontends[frontend]?.origins[0]?.replace(/\/+$/, '');
41
42
  if (!found) {
42
- throw new Error(`encore: no URL is known for frontend ${JSON.stringify(frontend)}: the app has no ` +
43
- 'frontend of that name, or the environment gives it no origins');
43
+ throw new Error(`encore: no URL is known for frontend ${JSON.stringify(frontend)}: ` +
44
+ 'no frontend with that name exists, or no origins are configured for it in this environment');
44
45
  }
45
46
  return found;
46
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"mod.js","sourceRoot":"","sources":["../../frontends/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,GAAG,CAAC,QAAgB;IAClC,MAAM,KAAK,GAAG,OAAO,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7E,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,wCAAwC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,mBAAmB;YACjF,+DAA+D,CAClE,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"mod.js","sourceRoot":"","sources":["../../frontends/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAC;AAEpC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,GAAG,CAAC,QAAgB;IAClC,MAAM,KAAK,GAAG,OAAO,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7E,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,wCAAwC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI;YAClE,4FAA4F,CAC/F,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,7 +1,6 @@
1
1
  /**
2
- * The code of an Encore error, which a {@link reject}ion answers with: what
3
- * went wrong, as Encore's clients read it, and the HTTP status the answer
4
- * has. They are the codes a service's errors answer with.
2
+ * Standard Encore error codes used with {@link reject}, matching the error
3
+ * codes returned by Encore services and their corresponding HTTP status codes.
5
4
  */
6
5
  export declare enum ErrCode {
7
6
  /** 499. */
@@ -37,45 +36,43 @@ export declare enum ErrCode {
37
36
  /** 401. */
38
37
  Unauthenticated = "unauthenticated"
39
38
  }
40
- /** The HTTP status an answer with `code` has: 401 for
41
- * {@link ErrCode.Unauthenticated}, 404 for {@link ErrCode.NotFound}, and so
42
- * on. */
39
+ /**
40
+ * Returns the HTTP status code corresponding to `code` (e.g. 401 for
41
+ * {@link ErrCode.Unauthenticated}, 404 for {@link ErrCode.NotFound}).
42
+ */
43
43
  export declare function httpStatus(code: ErrCode): number;
44
- /** Response headers: a record, or pairs for a header sent more than once. */
44
+ /** Response headers, either as a record or as name-value pairs for repeated headers. */
45
45
  export type Headers = Record<string, string> | ReadonlyArray<[string, string]>;
46
46
  /**
47
- * A Middleware's answer to a request it does not let through: `onRequest`
48
- * returns or throws one, and the gateway writes it to the client, with the
49
- * gateway's CORS headers, rather than forwarding the request.
47
+ * A middleware response that short-circuits a request in `onRequest`. Return
48
+ * or throw a `Rejection` to have the gateway respond directly to the client
49
+ * (including the gateway's CORS headers) without forwarding the request.
50
50
  *
51
- * {@link reject} answers as a service answers with an Encore error, which
52
- * Encore's clients read as one; {@link respond} answers with any response,
53
- * such as a redirect.
51
+ * Create one with {@link reject} for a standard Encore error response, or
52
+ * {@link respond} for a custom HTTP response such as a redirect.
54
53
  */
55
54
  export declare class Rejection extends Error {
56
55
  name: string;
57
- /** The HTTP status the request is answered with. */
56
+ /** The HTTP status code sent to the client. */
58
57
  readonly status: number;
59
- /** The Encore error code, for a {@link reject}; undefined for a
60
- * {@link respond}. */
58
+ /** The Encore error code (set for {@link reject}, undefined for {@link respond}). */
61
59
  readonly code: ErrCode | undefined;
62
- /** What went wrong, for a {@link reject}; empty for a {@link respond}. */
60
+ /** The error message (set for {@link reject}, empty for {@link respond}). */
63
61
  readonly errorMessage: string;
64
- /** The response's headers, as name and value pairs. */
62
+ /** The response headers as `[name, value]` pairs. */
65
63
  readonly headers: Array<[string, string]>;
66
- /** The response's body, for a {@link respond}. */
64
+ /** The raw response body (set for {@link respond}). */
67
65
  readonly body: Uint8Array | undefined;
68
- /** @internal Made by {@link reject} and {@link respond}. */
66
+ /** @internal Created by {@link reject} and {@link respond}. */
69
67
  constructor(status: number, code: ErrCode | undefined, message: string, headers: Array<[string, string]>, body: Uint8Array | undefined);
70
- /** Adds a header to the response, as `Retry-After` to a 429, and returns
71
- * the rejection. */
68
+ /** Appends a header (such as `Retry-After` on a 429) and returns `this`. */
72
69
  withHeader(name: string, value: string): this;
73
70
  }
74
71
  /**
75
- * Answers a request with an Encore error with `code` and `message`, and the
76
- * HTTP status of the code: 401 for {@link ErrCode.Unauthenticated}, 403 for
77
- * {@link ErrCode.PermissionDenied}, 429 for
78
- * {@link ErrCode.ResourceExhausted}, and so on.
72
+ * Creates a {@link Rejection} that responds with a standard Encore error
73
+ * containing `code` and `message`, using the HTTP status mapped from `code`
74
+ * (e.g. 401 for {@link ErrCode.Unauthenticated}, 403 for
75
+ * {@link ErrCode.PermissionDenied}, 429 for {@link ErrCode.ResourceExhausted}).
79
76
  *
80
77
  * ```typescript
81
78
  * return gateway.reject(ErrCode.Unauthenticated, "missing token");
@@ -83,8 +80,8 @@ export declare class Rejection extends Error {
83
80
  */
84
81
  export declare function reject(code: ErrCode, message: string): Rejection;
85
82
  /**
86
- * Answers a request with `status`, `headers` and `body` as they are, as a
87
- * redirect to sign in:
83
+ * Creates a {@link Rejection} that responds directly with `status`, `headers`,
84
+ * and `body`, for example to issue a redirect:
88
85
  *
89
86
  * ```typescript
90
87
  * return gateway.respond(302, { location: "/login" });
@@ -92,8 +89,9 @@ export declare function reject(code: ErrCode, message: string): Rejection;
92
89
  */
93
90
  export declare function respond(status: number, headers?: Headers, body?: Uint8Array | string): Rejection;
94
91
  /**
95
- * The gateway cannot be served: a Middleware is invalid, the process is not
96
- * a gateway program Encore runs, or the gateway is already served.
92
+ * Thrown when the gateway cannot be started — for example, when a middleware
93
+ * definition is invalid, the process is not running as an Encore gateway, or
94
+ * `serve` has already been called.
97
95
  */
98
96
  export declare class GatewayError extends Error {
99
97
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../gateway/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,OAAO;IACjB,WAAW;IACX,QAAQ,aAAa;IACrB,WAAW;IACX,OAAO,YAAY;IACnB,WAAW;IACX,eAAe,qBAAqB;IACpC,WAAW;IACX,gBAAgB,sBAAsB;IACtC,WAAW;IACX,QAAQ,cAAc;IACtB,WAAW;IACX,aAAa,mBAAmB;IAChC,WAAW;IACX,gBAAgB,sBAAsB;IACtC,WAAW;IACX,iBAAiB,uBAAuB;IACxC,WAAW;IACX,kBAAkB,wBAAwB;IAC1C,WAAW;IACX,OAAO,YAAY;IACnB,WAAW;IACX,UAAU,iBAAiB;IAC3B,WAAW;IACX,aAAa,kBAAkB;IAC/B,WAAW;IACX,QAAQ,a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B,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1C,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAEtC,+DAA+D;gBAE7D,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAChC,IAAI,EAAE,UAAU,GAAG,SAAS;IAa9B,4EAA4E;IAC5E,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAI9C;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAKhE;AAMD;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,OAAY,EACrB,IAAI,GAAE,UAAU,GAAG,MAAyB,GAC3C,SAAS,CAUX;AAED;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,KAAK;IAC5B,IAAI,SAAkB;CAChC"}
@@ -1,7 +1,6 @@
1
1
  /**
2
- * The code of an Encore error, which a {@link reject}ion answers with: what
3
- * went wrong, as Encore's clients read it, and the HTTP status the answer
4
- * has. They are the codes a service's errors answer with.
2
+ * Standard Encore error codes used with {@link reject}, matching the error
3
+ * codes returned by Encore services and their corresponding HTTP status codes.
5
4
  */
6
5
  export var ErrCode;
7
6
  (function (ErrCode) {
@@ -56,35 +55,34 @@ const STATUS = {
56
55
  [ErrCode.DataLoss]: 500,
57
56
  [ErrCode.Unauthenticated]: 401,
58
57
  };
59
- /** The HTTP status an answer with `code` has: 401 for
60
- * {@link ErrCode.Unauthenticated}, 404 for {@link ErrCode.NotFound}, and so
61
- * on. */
58
+ /**
59
+ * Returns the HTTP status code corresponding to `code` (e.g. 401 for
60
+ * {@link ErrCode.Unauthenticated}, 404 for {@link ErrCode.NotFound}).
61
+ */
62
62
  export function httpStatus(code) {
63
63
  return STATUS[code];
64
64
  }
65
65
  /**
66
- * A Middleware's answer to a request it does not let through: `onRequest`
67
- * returns or throws one, and the gateway writes it to the client, with the
68
- * gateway's CORS headers, rather than forwarding the request.
66
+ * A middleware response that short-circuits a request in `onRequest`. Return
67
+ * or throw a `Rejection` to have the gateway respond directly to the client
68
+ * (including the gateway's CORS headers) without forwarding the request.
69
69
  *
70
- * {@link reject} answers as a service answers with an Encore error, which
71
- * Encore's clients read as one; {@link respond} answers with any response,
72
- * such as a redirect.
70
+ * Create one with {@link reject} for a standard Encore error response, or
71
+ * {@link respond} for a custom HTTP response such as a redirect.
73
72
  */
74
73
  export class Rejection extends Error {
75
74
  name = 'Rejection';
76
- /** The HTTP status the request is answered with. */
75
+ /** The HTTP status code sent to the client. */
77
76
  status;
78
- /** The Encore error code, for a {@link reject}; undefined for a
79
- * {@link respond}. */
77
+ /** The Encore error code (set for {@link reject}, undefined for {@link respond}). */
80
78
  code;
81
- /** What went wrong, for a {@link reject}; empty for a {@link respond}. */
79
+ /** The error message (set for {@link reject}, empty for {@link respond}). */
82
80
  errorMessage;
83
- /** The response's headers, as name and value pairs. */
81
+ /** The response headers as `[name, value]` pairs. */
84
82
  headers;
85
- /** The response's body, for a {@link respond}. */
83
+ /** The raw response body (set for {@link respond}). */
86
84
  body;
87
- /** @internal Made by {@link reject} and {@link respond}. */
85
+ /** @internal Created by {@link reject} and {@link respond}. */
88
86
  constructor(status, code, message, headers, body) {
89
87
  super(`rejected with ${status}` +
90
88
  (code !== undefined ? ` ${code}: ${message}` : ''));
@@ -94,18 +92,17 @@ export class Rejection extends Error {
94
92
  this.headers = headers;
95
93
  this.body = body;
96
94
  }
97
- /** Adds a header to the response, as `Retry-After` to a 429, and returns
98
- * the rejection. */
95
+ /** Appends a header (such as `Retry-After` on a 429) and returns `this`. */
99
96
  withHeader(name, value) {
100
97
  this.headers.push([name, value]);
101
98
  return this;
102
99
  }
103
100
  }
104
101
  /**
105
- * Answers a request with an Encore error with `code` and `message`, and the
106
- * HTTP status of the code: 401 for {@link ErrCode.Unauthenticated}, 403 for
107
- * {@link ErrCode.PermissionDenied}, 429 for
108
- * {@link ErrCode.ResourceExhausted}, and so on.
102
+ * Creates a {@link Rejection} that responds with a standard Encore error
103
+ * containing `code` and `message`, using the HTTP status mapped from `code`
104
+ * (e.g. 401 for {@link ErrCode.Unauthenticated}, 403 for
105
+ * {@link ErrCode.PermissionDenied}, 429 for {@link ErrCode.ResourceExhausted}).
109
106
  *
110
107
  * ```typescript
111
108
  * return gateway.reject(ErrCode.Unauthenticated, "missing token");
@@ -113,14 +110,14 @@ export class Rejection extends Error {
113
110
  */
114
111
  export function reject(code, message) {
115
112
  if (!(code in REVERSE)) {
116
- throw new TypeError(`${String(code)} is not an ErrCode`);
113
+ throw new TypeError(`${String(code)} is not a valid ErrCode`);
117
114
  }
118
115
  return new Rejection(STATUS[code], code, message, [], undefined);
119
116
  }
120
117
  const REVERSE = Object.fromEntries(Object.values(ErrCode).map(c => [c, true]));
121
118
  /**
122
- * Answers a request with `status`, `headers` and `body` as they are, as a
123
- * redirect to sign in:
119
+ * Creates a {@link Rejection} that responds directly with `status`, `headers`,
120
+ * and `body`, for example to issue a redirect:
124
121
  *
125
122
  * ```typescript
126
123
  * return gateway.respond(302, { location: "/login" });
@@ -128,7 +125,7 @@ const REVERSE = Object.fromEntries(Object.values(ErrCode).map(c => [c, true]));
128
125
  */
129
126
  export function respond(status, headers = [], body = new Uint8Array()) {
130
127
  if (!Number.isInteger(status) || status < 100 || status > 599) {
131
- throw new RangeError(`status ${status} is not an HTTP status`);
128
+ throw new RangeError(`status ${status} is not a valid HTTP status code`);
132
129
  }
133
130
  const pairs = Array.isArray(headers)
134
131
  ? headers.map(([n, v]) => [n, v])
@@ -137,8 +134,9 @@ export function respond(status, headers = [], body = new Uint8Array()) {
137
134
  return new Rejection(status, undefined, '', pairs, bytes);
138
135
  }
139
136
  /**
140
- * The gateway cannot be served: a Middleware is invalid, the process is not
141
- * a gateway program Encore runs, or the gateway is already served.
137
+ * Thrown when the gateway cannot be started — for example, when a middleware
138
+ * definition is invalid, the process is not running as an Encore gateway, or
139
+ * `serve` has already been called.
142
140
  */
143
141
  export class GatewayError extends Error {
144
142
  name = 'GatewayError';
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../gateway/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,OAiCX;AAjCD,WAAY,OAAO;IACjB,WAAW;IACX,gCAAqB,CAAA;IACrB,WAAW;IACX,8BAAmB,CAAA;IACnB,WAAW;IACX,+CAAoC,CAAA;IACpC,WAAW;IACX,iDAAsC,CAAA;IACtC,WAAW;IACX,iCAAsB,CAAA;IACtB,WAAW;IACX,2CAAgC,CAAA;IAChC,WAAW;IACX,iDAAsC,CAAA;IACtC,WAAW;IACX,mDAAwC,CAAA;IACxC,WAAW;IACX,qDAA0C,CAAA;IAC1C,WAAW;IACX,8BAAmB,CAAA;IACnB,WAAW;IACX,sCAA2B,CAAA;IAC3B,WAAW;IACX,0CAA+B,CAAA;IAC/B,WAAW;IACX,gCAAqB,CAAA;IACrB,WAAW;IACX,sCAA2B,CAAA;IAC3B,WAAW;IACX,iCAAsB,CAAA;IACtB,WAAW;IACX,8CAAmC,CAAA;AACrC,CAAC,EAjCW,OAAO,KAAP,OAAO,QAiClB;AAED,MAAM,MAAM,GAA4B;IACtC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG;IACvB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG;IACtB,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,GAAG;IAC9B,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,GAAG;IAC/B,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG;I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AAM,GAAG,GAAG,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC;QAC9D,MAAM,IAAI,UAAU,CAAC,UAAU,MAAM,kCAAkC,CAAC,CAAC;IAC3E,CAAC;IACD,MAAM,KAAK,GAA4B,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAC3D,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACjC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAiC,CAAC,CAAC;IACtD,MAAM,KAAK,GACT,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B,IAAI,GAAG,cAAc,CAAC;CAChC"}
@@ -1,14 +1,14 @@
1
1
  /**
2
- * Which requests a Middleware is called for.
2
+ * Matchers that select which requests trigger a middleware.
3
3
  *
4
- * A {@link Matcher} is checked by Encore before a request reaches
5
- * JavaScript: a request no Middleware matches costs the program nothing.
6
- * Matching sees the request as the client sent it, so the header edits of an
7
- * earlier Middleware do not change which later ones are called, and a
8
- * Middleware need not read what it matches on.
4
+ * Encore evaluates every {@link Matcher} natively before a request reaches
5
+ * JavaScript, so unmatched requests incur no JS overhead. Matchers inspect the
6
+ * original client request — header edits by earlier middleware do not affect
7
+ * which later middleware run — and a middleware does not need to read a field
8
+ * in order to match on it.
9
9
  *
10
- * Matchers combine with `.and()`, `.or()` and `.not()`, or {@link allOf},
11
- * {@link anyOf} and {@link not}:
10
+ * Combine matchers with `.and()`, `.or()`, and `.not()`, or with {@link allOf},
11
+ * {@link anyOf}, and {@link not}:
12
12
  *
13
13
  * ```typescript
14
14
  * import { match } from "@encore.dev/sdk/gateway";
@@ -20,107 +20,107 @@
20
20
  *
21
21
  * @module
22
22
  */
23
- /** A matcher or condition as the gateway core's JSON spells it. */
23
+ /** Serialized matcher or condition JSON consumed by the gateway core. */
24
24
  type Expr = Record<string, unknown>;
25
25
  /**
26
- * A condition on a request: on its service, route, method, path, headers,
27
- * query parameters or cookies. Made by this module's functions.
26
+ * A predicate over incoming requests (by service, route, method, path,
27
+ * headers, query parameters, or cookies). Construct matchers using the
28
+ * functions in this module.
28
29
  */
29
30
  export declare class Matcher {
30
31
  /** @internal */
31
32
  readonly expr: Expr;
32
33
  /** @internal */
33
34
  constructor(expr: Expr);
34
- /** Matches the requests both match. */
35
+ /** Matches requests that satisfy both this matcher and `other`. */
35
36
  and(other: Matcher): Matcher;
36
- /** Matches the requests either matches. */
37
+ /** Matches requests that satisfy either this matcher or `other`. */
37
38
  or(other: Matcher): Matcher;
38
- /** Matches the requests this does not. */
39
+ /** Matches requests that do not satisfy this matcher. */
39
40
  not(): Matcher;
40
- /** The matcher as the gateway core's JSON spells it. */
41
+ /** Serializes the matcher to the gateway core's JSON format. */
41
42
  toJSON(): Expr;
42
43
  }
43
44
  /**
44
- * What a header, query parameter or cookie must be, for {@link header},
45
- * {@link query} and {@link cookie}. One sent more than once satisfies a
46
- * condition, other than {@link absent}, when any of its values does. Made by
47
- * this module's functions.
45
+ * A value condition for {@link header}, {@link query}, or {@link cookie}.
46
+ * When a field appears multiple times, any condition other than {@link absent}
47
+ * matches if at least one value satisfies it. Construct conditions using the
48
+ * functions in this module.
48
49
  */
49
50
  export declare class Cond {
50
51
  /** @internal */
51
52
  readonly expr: Expr;
52
53
  /** @internal */
53
54
  constructor(expr: Expr);
54
- /** The condition as the gateway core's JSON spells it. */
55
+ /** Serializes the condition to the gateway core's JSON format. */
55
56
  toJSON(): Expr;
56
57
  }
57
- /** Matches the requests every one of `ms` matches: every request when there
58
- * are none. */
58
+ /** Matches requests that satisfy every matcher in `ms` (matches all requests when empty). */
59
59
  export declare function allOf(...ms: Matcher[]): Matcher;
60
- /** Matches the requests any of `ms` matches: none when there are none. */
60
+ /** Matches requests that satisfy at least one matcher in `ms` (matches no requests when empty). */
61
61
  export declare function anyOf(...ms: Matcher[]): Matcher;
62
- /** Matches the requests `m` does not, as `m.not()`. */
62
+ /** Matches requests that do not satisfy `m` (equivalent to `m.not()`). */
63
63
  export declare function not(m: Matcher): Matcher;
64
- /** Matches the requests the gateway routes to any of `services`. */
64
+ /** Matches requests routed to any of the given `services`. */
65
65
  export declare function service(...services: string[]): Matcher;
66
66
  /**
67
- * Matches the requests routed by the gateway's route with `template`, such
68
- * as `/users/{id}`, answering `method`, or any method when it is undefined.
69
- * The names of the template's parameters do not matter, as they do not to
70
- * the router: `/users/{userId}` names the same route.
67
+ * Matches requests routed to the route matching `template` (e.g.
68
+ * `/users/{id}`) and `method` (or any HTTP method if `method` is `undefined`).
69
+ * Path parameter names are ignored, matching router behavior (`/users/{userId}`
70
+ * matches the same route).
71
71
  */
72
72
  export declare function route(method: string | undefined, template: string): Matcher;
73
- /** Matches the requests with any of `methods`, such as `"POST"`. */
73
+ /** Matches requests using any of the given HTTP `methods` (e.g. `"POST"`). */
74
74
  export declare function method(...methods: string[]): Matcher;
75
75
  /**
76
- * Matches the requests for exactly `path`, as the client sent it, not
77
- * percent-decoded. A trailing slash does not matter, as it does not to the
78
- * router.
76
+ * Matches requests whose raw (non-percent-decoded) path equals `path`.
77
+ * Trailing slashes are ignored, matching router behavior.
79
78
  */
80
79
  export declare function path(path: string): Matcher;
81
80
  /**
82
- * Matches the requests whose path starts with `prefix`, by whole segments:
83
- * `/admin` matches `/admin` and `/admin/users`, not `/administrators`.
81
+ * Matches requests whose path starts with `prefix` on whole-segment boundaries
82
+ * (for example, `/admin` matches `/admin` and `/admin/users`, but not
83
+ * `/administrators`).
84
84
  */
85
85
  export declare function pathPrefix(prefix: string): Matcher;
86
86
  /**
87
- * Matches the requests whose path the glob matches: a `*` segment matches
88
- * any one segment, and a `**` segment any number of them, none included.
89
- * `/users/*` matches `/users/1`, and `/users/**` matches `/users` and
90
- * `/users/1/posts/2`.
87
+ * Matches requests whose path matches `glob`, where `*` matches a single path
88
+ * segment and `**` matches zero or more segments (e.g. `/users/*` matches
89
+ * `/users/1`, and `/users/**` matches `/users` and `/users/1/posts/2`).
91
90
  */
92
91
  export declare function pathGlob(glob: string): Matcher;
93
92
  /**
94
- * Matches the requests whose header `name` satisfies `cond`, or is sent,
95
- * without one. Header names are case-insensitive; values are compared as
93
+ * Matches requests whose header `name` satisfies `cond`, or is present when
94
+ * `cond` is omitted. Header names are case-insensitive; values are compared as
96
95
  * sent.
97
96
  */
98
97
  export declare function header(name: string, cond?: Cond): Matcher;
99
98
  /**
100
- * Matches the requests whose query parameter `name` satisfies `cond`, or is
101
- * sent, without one. Names are case-sensitive; values are percent-decoded
102
- * before they are compared.
99
+ * Matches requests whose query parameter `name` satisfies `cond`, or is
100
+ * present when `cond` is omitted. Parameter names are case-sensitive; values
101
+ * are percent-decoded before comparison.
103
102
  */
104
103
  export declare function query(name: string, cond?: Cond): Matcher;
105
104
  /**
106
- * Matches the requests whose cookie `name` satisfies `cond`, or is sent,
107
- * without one. Names are case-sensitive; values are compared as sent.
105
+ * Matches requests whose cookie `name` satisfies `cond`, or is present when
106
+ * `cond` is omitted. Cookie names are case-sensitive; values are compared as
107
+ * sent.
108
108
  */
109
109
  export declare function cookie(name: string, cond?: Cond): Matcher;
110
- /** Holds when the field is sent. */
110
+ /** Matches when the field is present. */
111
111
  export declare function present(): Cond;
112
- /** Holds when the field is not sent. */
112
+ /** Matches when the field is absent. */
113
113
  export declare function absent(): Cond;
114
- /** Holds when the field's value is `value`. */
114
+ /** Matches when the field equals `value`. */
115
115
  export declare function equals(value: string): Cond;
116
- /** Holds when the field's value starts with `prefix`, as `"Bearer "`. */
116
+ /** Matches when the field starts with `prefix` (e.g. `"Bearer "`). */
117
117
  export declare function prefix(prefix: string): Cond;
118
- /** Holds when the field's value is one of `values`. */
118
+ /** Matches when the field equals one of `values`. */
119
119
  export declare function oneOf(...values: string[]): Cond;
120
120
  /**
121
- * Holds when the regular expression matches the field's whole value. In RE2
122
- * syntax, not JavaScript's: Encore checks it before a request reaches
123
- * JavaScript. An invalid one makes `serve` fail.
121
+ * Matches when `pattern` matches the field's entire value. Uses RE2 syntax
122
+ * (not JavaScript RegExp syntax) because Encore evaluates it natively. An
123
+ * invalid pattern causes `serve` to reject.
124
124
  */
125
125
  export declare function regex(pattern: string): Cond;
126
126
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../gateway/match.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,mEAAmE;AACnE,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpC;;;GAGG;AACH,qBAAa,OAAO;IAClB,gBAAgB;IAChB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAEpB,gBAAgB;gBACJ,IAAI,EAAE,IAAI;IAItB,uCAAuC;IACvC,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAI5B,2CAA2C;IAC3C,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAI3B,0CAA0C;IAC1C,GAAG,IAAI,OAAO;IAId,wDAAwD;IACxD,MAAM,IAAI,IAAI;CAGf;AAED;;;;;GAKG;AACH,qBAAa,IAAI;IACf,gBAAgB;IAChB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAEpB,gBAAgB;gBACJ,IAAI,EAAE,IAAI;IAItB,0DAA0D;IAC1D,MAAM,IAAI,IAAI;CAGf;AA4BD;eACe;AACf,wBAAgB,KAAK,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,OAAO,CAE/C;AAED,0EAA0E;AAC1E,wBAAgB,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