@encore.dev/sdk 2.0.0-beta.15 → 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 (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 +1 @@
1
- {"version":3,"file":"topic.js","sourceRoot":"","sources":["../../pubsub/topic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,UAAU,EACV,QAAQ,GAET,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAC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,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,WAAW,CAAC;SAChD,CAAC,CAAC;KACN,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,SAAS,cAAc,CAAC,KAAa;IACnC,IAAI,KAAK,GAAG,YAAY,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CACb,0CAA0C,YAAY,kBAAkB,KAAK,EAAE,CAChF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,+FAA+F;AAC/F,KAAK,UAAU,YAAY,CACzB,IAAyB,EACzB,OAAmC,EACnC,MAA0B;IAE1B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1D,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,SAAS,IAAI,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC7D,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAG,CAAC,CAAC;IAClC,CAAC;IACD,MAAM,IAAI,iBAAiB,CACzB,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACf,CAAC,CAAC,EAAE,KAAK,SAAS,IAAI,CAAC,CAAC,EAAE,KAAK,IAAI;QACjC,CAAC,CAAC,EAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAC;QACZ,CAAC,CAAC,EAAC,KAAK,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,2BAA2B,CAAC,EAAC,CAC/D,CACF,CAAC;AACJ,CAAC"}
@@ -1,10 +1,9 @@
1
1
  /**
2
- * Request Context: typed fields that travel with a request to every service
3
- * it reaches, such as the user it is made for.
2
+ * Request Context: typed fields that propagate with a request across every
3
+ * service it reaches, such as the authenticated user.
4
4
  *
5
- * A field is declared once in the app, as a module-level `const`, with a name
6
- * and the type of its value. Encore's parser reads the declaration, so the
7
- * name must be a string literal:
5
+ * Declare each field once in the app as a module-level `const` with a
6
+ * string-literal name and a value type so Encore's parser can inspect it:
8
7
  *
9
8
  * ```ts
10
9
  * import {Field} from '@encore.dev/sdk/reqctx';
@@ -17,157 +16,155 @@
17
16
  * export const currentUser = new Field<User>('user', {pubsub: true});
18
17
  * ```
19
18
  *
20
- * Gateway Middleware sets fields on the requests it lets through, with
21
- * `req.set(currentUser, user)` (`@encore.dev/sdk/gateway`), and a service
22
- * reads them while handling one:
19
+ * Gateway middleware populates fields on incoming requests using
20
+ * `req.set(currentUser, user)` (`@encore.dev/sdk/gateway`), and services read
21
+ * them while handling requests:
23
22
  *
24
23
  * ```ts
25
24
  * const user = currentUser.get();
26
25
  * if (user === undefined) throw new Error('not signed in');
27
26
  * ```
28
27
  *
29
- * A service may set any field, or clear one, for the code it runs and the
28
+ * Services can also set or clear fields for a scoped block and any downstream
30
29
  * calls it makes:
31
30
  *
32
31
  * ```ts
33
32
  * await currentUser.with({id: 'system', email: ''}, () => fetchInvoices());
34
33
  * ```
35
34
  *
36
- * Another service, possibly in another language, binds a field by name, with
37
- * the type of its value: `Field.named<User>('user')`.
35
+ * Other services (including those written in another language) can bind to a
36
+ * field by name with `Field.named<User>('user')`.
38
37
  *
39
- * ## Where fields are
38
+ * ## Propagation
40
39
  *
41
- * The fields are in the OpenTelemetry context, with the trace, so they follow
42
- * the active context across `await`, timers and callbacks. Encore tracks it
43
- * without a global context manager too.
40
+ * Fields are stored in the OpenTelemetry context alongside trace state, so they
41
+ * automatically follow async execution across `await`, timers, and callbacks
42
+ * (even without a global OpenTelemetry context manager).
44
43
  *
45
- * ## Trust
44
+ * ## Security
46
45
  *
47
- * No client can set a field: Encore strips the headers fields travel in
48
- * wherever a request enters the app, and signs them between containers. So a
49
- * service can trust what it reads, as far as it trusts the app's other
50
- * services.
46
+ * External clients cannot forge Request Context fields: Encore strips these
47
+ * headers at application ingress and signs them between services, so services
48
+ * can trust values they read as much as they trust other services in the app.
51
49
  *
52
50
  * ## Receiving and sending fields
53
51
  *
54
- * {@link extract} takes the fields a request a service receives carries into
55
- * a context, and {@link Propagator}, composed into the app's global
56
- * propagator, does it for a server instrumented for tracing. {@link inject}
57
- * sets the fields of a context on a request for another of the app's
58
- * services, and only on those: anything else would be sent who the request is
59
- * made for. A Pub/Sub message carries the fields declared with `pubsub` that
60
- * are set where it is published, into its handler's context.
52
+ * {@link extract} reads Request Context headers from an incoming request into a
53
+ * context, and {@link Propagator} (composed into the global propagator) handles
54
+ * this automatically for instrumented servers. {@link inject} writes context
55
+ * fields onto outgoing request headers — use it only for calls to other Encore
56
+ * services so internal context is never leaked to third parties. Pub/Sub
57
+ * messages automatically carry any set fields declared with `pubsub: true` into
58
+ * subscriber handlers.
61
59
  *
62
- * ## Limits
60
+ * ## Size limits
63
61
  *
64
- * A field travels as the base64url of its value's JSON, in a header of its
65
- * own, so it must be small: its encoding may be at most 4 KiB, and those of
66
- * all of a request's fields at most 8 KiB; a field carried on Pub/Sub
67
- * messages, at most 1 KiB. Setting a value beyond that throws, at the code
68
- * that set it, rather than the request failing some hops later.
62
+ * Each field is serialized as base64url-encoded JSON in its own header and must
63
+ * stay small: at most 4 KiB per field (1 KiB for fields with `pubsub: true`)
64
+ * and 8 KiB across all fields on a request. Exceeding these limits throws
65
+ * immediately when setting the value rather than failing downstream.
69
66
  *
70
67
  * @module
71
68
  */
72
69
  import type { Context } from '@opentelemetry/api';
73
70
  import * as reqfields from '../internal/reqfields.js';
74
71
  export type { HeaderSink, HeaderSource, HeadersLike, } from '../internal/reqfields.js';
75
- /** How a field travels. Read by Encore's parser, so each is written out as
76
- * `true` or `false`. */
72
+ /**
73
+ * Propagation and metadata options for a {@link Field}. Boolean and tag values
74
+ * must be literals so Encore's parser can inspect them statically.
75
+ */
77
76
  export interface FieldConfig {
78
77
  /**
79
- * Also carry the field on the Pub/Sub messages published with it set, into
80
- * the context of the handlers that receive them. Its value may then encode
81
- * to at most 1 KiB, GCP Pub/Sub's limit on an attribute's value.
78
+ * Propagate this field on Pub/Sub messages published while it is set, making
79
+ * it available in subscriber handlers. Limits the encoded value to 1 KiB
80
+ * (matching GCP Pub/Sub attribute limits).
82
81
  */
83
82
  pubsub?: boolean;
84
83
  /**
85
- * Put the value on the spans started with it set, as the attribute
86
- * `encore.ctx.<name>`, holding its JSON: for identifiers worth finding
87
- * traces by, such as a tenant's. Never for secrets.
84
+ * Attach this field's JSON value to spans started while it is set, under the
85
+ * attribute `encore.ctx.<name>`. Useful for searchable identifiers such as
86
+ * tenant IDs — never enable this for secrets.
88
87
  */
89
88
  trace?: boolean;
90
89
  /**
91
- * Tags that classify the field, for policies to read: written out as
92
- * string literals, as in `{data: "pci"}`. Keys and values are lowercase
93
- * letters, digits, `_` and `-`, at most 63 characters; a key starts with a
94
- * letter, and not with `encore`, which is reserved. At most 32 tags.
90
+ * Static string-literal tags that classify the field for policy checks
91
+ * (e.g. `{data: "pci"}`). Keys and values may contain lowercase letters,
92
+ * digits, `_`, and `-`, up to 63 characters. Keys must start with a letter
93
+ * and cannot start with the reserved prefix `encore`. At most 32 tags.
95
94
  */
96
95
  tags?: Record<string, string>;
97
96
  }
98
97
  /**
99
- * A Request Context field holding a JSON value of type `T`.
98
+ * A typed Request Context field holding a JSON-serializable value of type `T`.
100
99
  *
101
- * Declare it as a module-level `const`: `new Field<User>("user")`. The type
102
- * argument is the value's type, which Encore describes, as a config's, and
103
- * checks the bindings of the field by name against. TypeScript has no decoder:
104
- * a value reads as its JSON, which the type describes.
100
+ * Declare fields at module level (`new Field<User>("user")`). Encore extracts a
101
+ * schema from `T` and validates cross-service `Field.named` bindings against
102
+ * it. At runtime, values are decoded directly from JSON without custom
103
+ * deserializers.
105
104
  */
106
105
  export declare class Field<T> {
107
- /** The name the field was declared with. */
106
+ /** The name this field was declared with. */
108
107
  readonly name: string;
109
108
  /**
110
- * Declare a field.
109
+ * Declares a Request Context field.
111
110
  *
112
- * @param name - The field's name, unique within the app, in kebab-case:
113
- * lowercase letters, digits and hyphens, starting with a letter and ending
114
- * with a letter or digit. A string literal, which Encore's parser checks.
115
- * @param cfg - How it travels.
111
+ * @param name - Unique kebab-case field name (lowercase letters, digits, and
112
+ * hyphens, starting with a letter and ending with a letter or digit). Must be
113
+ * a string literal for Encore's parser.
114
+ * @param cfg - Propagation and classification options.
116
115
  */
117
116
  constructor(name: string, cfg?: FieldConfig);
118
117
  /**
119
- * Reference a field declared elsewhere in the app, possibly in another
120
- * language. Give the value's type, which Encore checks against the
121
- * declaration's: `Field.named<User>("user")`. The field travels as its
122
- * declaration says: carried on Pub/Sub messages, and put on spans, as
123
- * declared.
118
+ * Binds to a field declared elsewhere in the app (including in another
119
+ * language). Encore validates `T` against the declaration, and the bound
120
+ * field inherits the declaration's `pubsub` and `trace` settings.
124
121
  */
125
122
  static named<T>(name: string): Field<T>;
126
123
  /**
127
- * The field's value in `ctx`, or in the active context; `undefined` when it
128
- * is not set.
124
+ * Returns this field's value from `ctx` (or the active context if omitted),
125
+ * or `undefined` if unset.
129
126
  *
130
- * Each call decodes the value anew, so the caller may change what it
131
- * returns. A value that is not JSON reads as not set; Encore logs it, once.
127
+ * Each call returns a freshly decoded value that the caller may safely
128
+ * mutate. Invalid JSON values are treated as unset and logged once.
132
129
  */
133
130
  get(ctx?: Context): T | undefined;
134
131
  /**
135
- * Run `fn` with the field set to `value`, for the code it runs and the
136
- * calls it makes. Returns what `fn` returns: a promise for an async `fn`.
132
+ * Runs `fn` with this field set to `value` in the active context and returns
133
+ * its result (or promise for async functions).
137
134
  *
138
- * @throws TypeError - The value has no JSON form: a `bigint`, a cycle, or
139
- * `undefined`.
140
- * @throws RangeError - The value encodes to more than the field may: 4 KiB,
141
- * or 1 KiB for a field declared with `pubsub`, or makes the request's fields
142
- * encode to more than 8 KiB.
135
+ * @throws TypeError If `value` cannot be serialized to JSON (e.g. contains a
136
+ * `bigint`, circular reference, or is `undefined`).
137
+ * @throws RangeError If the encoded value exceeds the per-field limit (4 KiB,
138
+ * or 1 KiB when `pubsub` is enabled) or pushes total request fields past
139
+ * 8 KiB.
143
140
  */
144
141
  with<R>(value: T, fn: () => R): R;
145
- /** Run `fn` with the field cleared, for the code it runs and the calls it
146
- * makes. */
142
+ /** Runs `fn` with this field cleared from the active context. */
147
143
  without<R>(fn: () => R): R;
148
144
  /**
149
- * A copy of `ctx`, or of the active context, with the field set to
150
- * `value`: for code that passes contexts explicitly. Throws as
151
- * {@link Field.with} does.
145
+ * Returns a copy of `ctx` (or the active context) with this field set to
146
+ * `value`, for code passing OpenTelemetry contexts explicitly. Throws the
147
+ * same errors as {@link Field.with}.
152
148
  */
153
149
  context(value: T, ctx?: Context): Context;
154
- /** A copy of `ctx`, or of the active context, without the field. */
150
+ /** Returns a copy of `ctx` (or the active context) with this field removed. */
155
151
  contextWithout(ctx?: Context): Context;
156
- /** `Field("name")`. */
152
+ /** Returns `Field("name")`. */
157
153
  toString(): string;
158
154
  }
159
155
  /**
160
- * A copy of `ctx`, or of the active context, holding the fields a request's
161
- * headers carry, in place of those it held: the first value of each header
162
- * named for a field, in any case. When they carry none, `ctx` itself.
156
+ * Extracts Request Context fields from incoming request `headers` into a copy
157
+ * of `ctx` (or the active context), replacing any previously held fields.
158
+ * Reads the first value of each field header case-insensitively. Returns the
159
+ * base context unchanged if no fields are present.
163
160
  */
164
161
  export declare function extract(headers: reqfields.HeaderSource, ctx?: Context): Context;
165
162
  /**
166
- * Set the fields of `ctx`, or of the active context, on a request's headers,
167
- * in place of any they carried.
163
+ * Writes the Request Context fields from `ctx` (or the active context) onto
164
+ * outgoing request `headers`, replacing any existing field headers.
168
165
  *
169
- * Use it only for requests to the app's own services: anything else is sent
170
- * who the request is made for.
166
+ * Only call this for requests to other Encore services in the same app so
167
+ * internal context is not sent to third parties.
171
168
  */
172
169
  export declare function inject(headers: reqfields.HeaderSink, ctx?: Context): void;
173
170
  export { Propagator } from '../internal/reqfields.js';
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../reqctx/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAGhD,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAEnD,YAAY,EACV,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAE/B;wBACwB;AACxB,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,qBAAa,KAAK,CAAC,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;gBACS,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,WAAW;IAQ3C;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;IASvC;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,SAAS;IAWjC;;;;;;;;;OASG;IACH,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAIjC;gBACY;IACZ,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAI1B;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,CAA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M,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;IASvC;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,SAAS;IAWjC;;;;;;;;;OASG;IACH,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAIjC,iEAAiE;IACjE,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAI1B;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO;IAoBzC,+EAA+E;IAC/E,cAAc,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO;IAItC,+BAA+B;IAC/B,QAAQ,IAAI,MAAM;CAGnB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,OAAO,EAAE,SAAS,CAAC,YAAY,EAC/B,GAAG,CAAC,EAAE,OAAO,GACZ,OAAO,CAMT;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,IAAI,CAEzE;AAED,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC"}
@@ -2,23 +2,23 @@ import log from '../log/index.js';
2
2
  import { activeContext, withContext } from '../internal/otel/context.js';
3
3
  import * as reqfields from '../internal/reqfields.js';
4
4
  /**
5
- * A Request Context field holding a JSON value of type `T`.
5
+ * A typed Request Context field holding a JSON-serializable value of type `T`.
6
6
  *
7
- * Declare it as a module-level `const`: `new Field<User>("user")`. The type
8
- * argument is the value's type, which Encore describes, as a config's, and
9
- * checks the bindings of the field by name against. TypeScript has no decoder:
10
- * a value reads as its JSON, which the type describes.
7
+ * Declare fields at module level (`new Field<User>("user")`). Encore extracts a
8
+ * schema from `T` and validates cross-service `Field.named` bindings against
9
+ * it. At runtime, values are decoded directly from JSON without custom
10
+ * deserializers.
11
11
  */
12
12
  export class Field {
13
- /** The name the field was declared with. */
13
+ /** The name this field was declared with. */
14
14
  name;
15
15
  /**
16
- * Declare a field.
16
+ * Declares a Request Context field.
17
17
  *
18
- * @param name - The field's name, unique within the app, in kebab-case:
19
- * lowercase letters, digits and hyphens, starting with a letter and ending
20
- * with a letter or digit. A string literal, which Encore's parser checks.
21
- * @param cfg - How it travels.
18
+ * @param name - Unique kebab-case field name (lowercase letters, digits, and
19
+ * hyphens, starting with a letter and ending with a letter or digit). Must be
20
+ * a string literal for Encore's parser.
21
+ * @param cfg - Propagation and classification options.
22
22
  */
23
23
  constructor(name, cfg) {
24
24
  this.name = name;
@@ -28,11 +28,9 @@ export class Field {
28
28
  });
29
29
  }
30
30
  /**
31
- * Reference a field declared elsewhere in the app, possibly in another
32
- * language. Give the value's type, which Encore checks against the
33
- * declaration's: `Field.named<User>("user")`. The field travels as its
34
- * declaration says: carried on Pub/Sub messages, and put on spans, as
35
- * declared.
31
+ * Binds to a field declared elsewhere in the app (including in another
32
+ * language). Encore validates `T` against the declaration, and the bound
33
+ * field inherits the declaration's `pubsub` and `trace` settings.
36
34
  */
37
35
  static named(name) {
38
36
  const field = Object.create(Field.prototype);
@@ -43,11 +41,11 @@ export class Field {
43
41
  return field;
44
42
  }
45
43
  /**
46
- * The field's value in `ctx`, or in the active context; `undefined` when it
47
- * is not set.
44
+ * Returns this field's value from `ctx` (or the active context if omitted),
45
+ * or `undefined` if unset.
48
46
  *
49
- * Each call decodes the value anew, so the caller may change what it
50
- * returns. A value that is not JSON reads as not set; Encore logs it, once.
47
+ * Each call returns a freshly decoded value that the caller may safely
48
+ * mutate. Invalid JSON values are treated as unset and logged once.
51
49
  */
52
50
  get(ctx) {
53
51
  const value = reqfields.current(ctx ?? activeContext())[this.name];
@@ -62,27 +60,26 @@ export class Field {
62
60
  }
63
61
  }
64
62
  /**
65
- * Run `fn` with the field set to `value`, for the code it runs and the
66
- * calls it makes. Returns what `fn` returns: a promise for an async `fn`.
63
+ * Runs `fn` with this field set to `value` in the active context and returns
64
+ * its result (or promise for async functions).
67
65
  *
68
- * @throws TypeError - The value has no JSON form: a `bigint`, a cycle, or
69
- * `undefined`.
70
- * @throws RangeError - The value encodes to more than the field may: 4 KiB,
71
- * or 1 KiB for a field declared with `pubsub`, or makes the request's fields
72
- * encode to more than 8 KiB.
66
+ * @throws TypeError If `value` cannot be serialized to JSON (e.g. contains a
67
+ * `bigint`, circular reference, or is `undefined`).
68
+ * @throws RangeError If the encoded value exceeds the per-field limit (4 KiB,
69
+ * or 1 KiB when `pubsub` is enabled) or pushes total request fields past
70
+ * 8 KiB.
73
71
  */
74
72
  with(value, fn) {
75
73
  return withContext(this.context(value), fn);
76
74
  }
77
- /** Run `fn` with the field cleared, for the code it runs and the calls it
78
- * makes. */
75
+ /** Runs `fn` with this field cleared from the active context. */
79
76
  without(fn) {
80
77
  return withContext(this.contextWithout(), fn);
81
78
  }
82
79
  /**
83
- * A copy of `ctx`, or of the active context, with the field set to
84
- * `value`: for code that passes contexts explicitly. Throws as
85
- * {@link Field.with} does.
80
+ * Returns a copy of `ctx` (or the active context) with this field set to
81
+ * `value`, for code passing OpenTelemetry contexts explicitly. Throws the
82
+ * same errors as {@link Field.with}.
86
83
  */
87
84
  context(value, ctx) {
88
85
  let encoded;
@@ -99,19 +96,20 @@ export class Field {
99
96
  throw new RangeError(`reqctx: field ${JSON.stringify(this.name)}: the value ${messageOf(err)}`, { cause: err });
100
97
  }
101
98
  }
102
- /** A copy of `ctx`, or of the active context, without the field. */
99
+ /** Returns a copy of `ctx` (or the active context) with this field removed. */
103
100
  contextWithout(ctx) {
104
101
  return reqfields.without(this.name, ctx ?? activeContext());
105
102
  }
106
- /** `Field("name")`. */
103
+ /** Returns `Field("name")`. */
107
104
  toString() {
108
105
  return `Field(${JSON.stringify(this.name)})`;
109
106
  }
110
107
  }
111
108
  /**
112
- * A copy of `ctx`, or of the active context, holding the fields a request's
113
- * headers carry, in place of those it held: the first value of each header
114
- * named for a field, in any case. When they carry none, `ctx` itself.
109
+ * Extracts Request Context fields from incoming request `headers` into a copy
110
+ * of `ctx` (or the active context), replacing any previously held fields.
111
+ * Reads the first value of each field header case-insensitively. Returns the
112
+ * base context unchanged if no fields are present.
115
113
  */
116
114
  export function extract(headers, ctx) {
117
115
  const base = ctx ?? activeContext();
@@ -121,11 +119,11 @@ export function extract(headers, ctx) {
121
119
  : reqfields.withFields(fields, base);
122
120
  }
123
121
  /**
124
- * Set the fields of `ctx`, or of the active context, on a request's headers,
125
- * in place of any they carried.
122
+ * Writes the Request Context fields from `ctx` (or the active context) onto
123
+ * outgoing request `headers`, replacing any existing field headers.
126
124
  *
127
- * Use it only for requests to the app's own services: anything else is sent
128
- * who the request is made for.
125
+ * Only call this for requests to other Encore services in the same app so
126
+ * internal context is not sent to third parties.
129
127
  */
130
128
  export function inject(headers, ctx) {
131
129
  reqfields.toHeaders(headers, ctx ?? activeContext());
@@ -1 +1 @@
1
- {"version":3,"file":"mod.js","sourceRoot":"","sources":["../../reqctx/mod.ts"],"names":[],"mappings":"AAwEA,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAE,WAAW,EAAC,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AAgCnD;;;;;;;GAOG;AACH,MAAM,OAAO,KAAK;IAChB,4CAA4C;IACnC,IAAI,CAAS;IAEtB;;;;;;;OAOG;IACH,YAAY,IAAY,EAAE,GAAiB;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE;YACtB,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI;YAC5B,KAAK,EAAE,GAAG,EAAE,KAAK,KAAK,IAAI;SAC3B,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,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