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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/README.md +144 -90
  2. package/app_meta.ts +56 -54
  3. package/config/config.test.ts +47 -13
  4. package/config/config.ts +60 -57
  5. package/config/secrets.ts +47 -50
  6. package/config/value.ts +23 -26
  7. package/cron/mod.test.ts +12 -0
  8. package/cron/mod.ts +37 -22
  9. package/dist/app_meta.d.ts +52 -50
  10. package/dist/app_meta.d.ts.map +1 -1
  11. package/dist/app_meta.js +2 -2
  12. package/dist/app_meta.js.map +1 -1
  13. package/dist/config/config.d.ts +58 -55
  14. package/dist/config/config.d.ts.map +1 -1
  15. package/dist/config/config.js +8 -9
  16. package/dist/config/config.js.map +1 -1
  17. package/dist/config/secrets.d.ts +45 -50
  18. package/dist/config/secrets.d.ts.map +1 -1
  19. package/dist/config/secrets.js +11 -9
  20. package/dist/config/secrets.js.map +1 -1
  21. package/dist/config/value.d.ts +20 -23
  22. package/dist/config/value.d.ts.map +1 -1
  23. package/dist/config/value.js +20 -23
  24. package/dist/config/value.js.map +1 -1
  25. package/dist/cron/mod.d.ts +34 -20
  26. package/dist/cron/mod.d.ts.map +1 -1
  27. package/dist/cron/mod.js +13 -13
  28. package/dist/cron/mod.js.map +1 -1
  29. package/dist/frontends/mod.d.ts +20 -19
  30. package/dist/frontends/mod.d.ts.map +1 -1
  31. package/dist/frontends/mod.js +20 -19
  32. package/dist/frontends/mod.js.map +1 -1
  33. package/dist/gateway/errors.d.ts +28 -30
  34. package/dist/gateway/errors.d.ts.map +1 -1
  35. package/dist/gateway/errors.js +29 -31
  36. package/dist/gateway/errors.js.map +1 -1
  37. package/dist/gateway/match.d.ts +54 -54
  38. package/dist/gateway/match.d.ts.map +1 -1
  39. package/dist/gateway/match.js +56 -56
  40. package/dist/gateway/match.js.map +1 -1
  41. package/dist/gateway/middleware.d.ts +62 -64
  42. package/dist/gateway/middleware.d.ts.map +1 -1
  43. package/dist/gateway/middleware.js +1 -1
  44. package/dist/gateway/middleware.js.map +1 -1
  45. package/dist/gateway/mod.d.ts +64 -67
  46. package/dist/gateway/mod.d.ts.map +1 -1
  47. package/dist/gateway/mod.js +72 -76
  48. package/dist/gateway/mod.js.map +1 -1
  49. package/dist/gateway/request.d.ts +138 -134
  50. package/dist/gateway/request.d.ts.map +1 -1
  51. package/dist/gateway/request.js +117 -108
  52. package/dist/gateway/request.js.map +1 -1
  53. package/dist/gateway/serve.d.ts +29 -34
  54. package/dist/gateway/serve.d.ts.map +1 -1
  55. package/dist/gateway/serve.js +51 -56
  56. package/dist/gateway/serve.js.map +1 -1
  57. package/dist/gateways/mod.d.ts +23 -21
  58. package/dist/gateways/mod.d.ts.map +1 -1
  59. package/dist/gateways/mod.js +25 -23
  60. package/dist/gateways/mod.js.map +1 -1
  61. package/dist/internal/otel/http.d.ts +4 -2
  62. package/dist/internal/otel/http.d.ts.map +1 -1
  63. package/dist/internal/otel/http.js +32 -5
  64. package/dist/internal/otel/http.js.map +1 -1
  65. package/dist/internal/runtime/napi/napi.cjs +6 -5
  66. package/dist/internal/runtime/napi/napi.d.cts +58 -16
  67. package/dist/internal/runtime/shutdown.d.ts +75 -57
  68. package/dist/internal/runtime/shutdown.d.ts.map +1 -1
  69. package/dist/internal/runtime/shutdown.js +88 -84
  70. package/dist/internal/runtime/shutdown.js.map +1 -1
  71. package/dist/log/logger.d.ts +43 -37
  72. package/dist/log/logger.d.ts.map +1 -1
  73. package/dist/log/logger.js +26 -25
  74. package/dist/log/logger.js.map +1 -1
  75. package/dist/metrics/mod.d.ts +133 -114
  76. package/dist/metrics/mod.d.ts.map +1 -1
  77. package/dist/metrics/mod.js +109 -101
  78. package/dist/metrics/mod.js.map +1 -1
  79. package/dist/otel.d.ts +6 -3
  80. package/dist/otel.d.ts.map +1 -1
  81. package/dist/otel.js +6 -3
  82. package/dist/otel.js.map +1 -1
  83. package/dist/pubsub/subscription.d.ts +88 -116
  84. package/dist/pubsub/subscription.d.ts.map +1 -1
  85. package/dist/pubsub/subscription.js +14 -17
  86. package/dist/pubsub/subscription.js.map +1 -1
  87. package/dist/pubsub/topic.d.ts +86 -113
  88. package/dist/pubsub/topic.d.ts.map +1 -1
  89. package/dist/pubsub/topic.js +68 -82
  90. package/dist/pubsub/topic.js.map +1 -1
  91. package/dist/redaction/mod.d.ts +62 -0
  92. package/dist/redaction/mod.d.ts.map +1 -0
  93. package/dist/redaction/mod.js +102 -0
  94. package/dist/redaction/mod.js.map +1 -0
  95. package/dist/reqctx/mod.d.ts +83 -86
  96. package/dist/reqctx/mod.d.ts.map +1 -1
  97. package/dist/reqctx/mod.js +39 -41
  98. package/dist/reqctx/mod.js.map +1 -1
  99. package/dist/services/index.d.ts +76 -75
  100. package/dist/services/index.d.ts.map +1 -1
  101. package/dist/services/index.js +73 -71
  102. package/dist/services/index.js.map +1 -1
  103. package/dist/shutdown/mod.d.ts +26 -25
  104. package/dist/shutdown/mod.d.ts.map +1 -1
  105. package/dist/shutdown/mod.js +26 -25
  106. package/dist/shutdown/mod.js.map +1 -1
  107. package/dist/storage/clickhouse/database.d.ts +113 -115
  108. package/dist/storage/clickhouse/database.d.ts.map +1 -1
  109. package/dist/storage/clickhouse/database.js +65 -79
  110. package/dist/storage/clickhouse/database.js.map +1 -1
  111. package/dist/storage/clickhouse/errors.d.ts +25 -26
  112. package/dist/storage/clickhouse/errors.d.ts.map +1 -1
  113. package/dist/storage/clickhouse/errors.js +15 -17
  114. package/dist/storage/clickhouse/errors.js.map +1 -1
  115. package/dist/storage/clickhouse/mod.d.ts +10 -10
  116. package/dist/storage/clickhouse/mod.js +10 -10
  117. package/dist/storage/objects/bucket.d.ts +230 -203
  118. package/dist/storage/objects/bucket.d.ts.map +1 -1
  119. package/dist/storage/objects/bucket.js +146 -106
  120. package/dist/storage/objects/bucket.js.map +1 -1
  121. package/dist/storage/objects/error.d.ts +4 -4
  122. package/dist/storage/objects/error.js +4 -4
  123. package/dist/storage/objects/mod.d.ts +1 -1
  124. package/dist/storage/objects/mod.d.ts.map +1 -1
  125. package/dist/storage/objects/mod.js.map +1 -1
  126. package/dist/storage/objects/refs.d.ts +2 -5
  127. package/dist/storage/objects/refs.d.ts.map +1 -1
  128. package/dist/storage/objects/refs.js.map +1 -1
  129. package/dist/storage/postgres/database.d.ts +124 -149
  130. package/dist/storage/postgres/database.d.ts.map +1 -1
  131. package/dist/storage/postgres/database.js +98 -135
  132. package/dist/storage/postgres/database.js.map +1 -1
  133. package/dist/storage/postgres/errors.d.ts +42 -48
  134. package/dist/storage/postgres/errors.d.ts.map +1 -1
  135. package/dist/storage/postgres/errors.js +44 -51
  136. package/dist/storage/postgres/errors.js.map +1 -1
  137. package/dist/storage/postgres/interval.d.ts +19 -19
  138. package/dist/storage/postgres/interval.d.ts.map +1 -1
  139. package/dist/storage/postgres/interval.js +21 -21
  140. package/dist/storage/postgres/interval.js.map +1 -1
  141. package/dist/storage/redis/bitfield.d.ts +48 -23
  142. package/dist/storage/redis/bitfield.d.ts.map +1 -1
  143. package/dist/storage/redis/bitfield.js +38 -19
  144. package/dist/storage/redis/bitfield.js.map +1 -1
  145. package/dist/storage/redis/command.d.ts +16 -12
  146. package/dist/storage/redis/command.d.ts.map +1 -1
  147. package/dist/storage/redis/command.js +16 -12
  148. package/dist/storage/redis/command.js.map +1 -1
  149. package/dist/storage/redis/commands.d.ts +99 -100
  150. package/dist/storage/redis/commands.d.ts.map +1 -1
  151. package/dist/storage/redis/commands.js +84 -85
  152. package/dist/storage/redis/commands.js.map +1 -1
  153. package/dist/storage/redis/database.d.ts +138 -122
  154. package/dist/storage/redis/database.d.ts.map +1 -1
  155. package/dist/storage/redis/database.js +120 -101
  156. package/dist/storage/redis/database.js.map +1 -1
  157. package/dist/storage/redis/mod.d.ts +52 -48
  158. package/dist/storage/redis/mod.d.ts.map +1 -1
  159. package/dist/storage/redis/mod.js +52 -48
  160. package/dist/storage/redis/mod.js.map +1 -1
  161. package/dist/storage/redis/options.d.ts +26 -24
  162. package/dist/storage/redis/options.d.ts.map +1 -1
  163. package/dist/storage/redis/options.js.map +1 -1
  164. package/dist/storage/redis/pubsub.d.ts +16 -16
  165. package/dist/storage/redis/pubsub.d.ts.map +1 -1
  166. package/dist/storage/redis/pubsub.js +14 -14
  167. package/dist/storage/redis/pubsub.js.map +1 -1
  168. package/dist/storage/redis/reply.d.ts +80 -72
  169. package/dist/storage/redis/reply.d.ts.map +1 -1
  170. package/dist/storage/redis/reply.js +53 -46
  171. package/dist/storage/redis/reply.js.map +1 -1
  172. package/dist/storage/redis/scan.d.ts +4 -4
  173. package/dist/storage/redis/scan.d.ts.map +1 -1
  174. package/dist/storage/redis/scan.js +6 -6
  175. package/dist/storage/redis/scan.js.map +1 -1
  176. package/dist/storage/redis/script.d.ts +28 -21
  177. package/dist/storage/redis/script.d.ts.map +1 -1
  178. package/dist/storage/redis/script.js +29 -22
  179. package/dist/storage/redis/script.js.map +1 -1
  180. package/dist/storage/redis/target.d.ts +17 -1
  181. package/dist/storage/redis/target.d.ts.map +1 -1
  182. package/dist/storage/redis/target.js +30 -1
  183. package/dist/storage/redis/target.js.map +1 -1
  184. package/dist/storage/redis/wire.d.ts +6 -6
  185. package/dist/storage/redis/wire.d.ts.map +1 -1
  186. package/dist/storage/redis/wire.js +6 -6
  187. package/dist/storage/redis/wire.js.map +1 -1
  188. package/dist/testing/mod.d.ts +83 -88
  189. package/dist/testing/mod.d.ts.map +1 -1
  190. package/dist/testing/mod.js +75 -81
  191. package/dist/testing/mod.js.map +1 -1
  192. package/dist/testing/playwright.d.ts +28 -32
  193. package/dist/testing/playwright.d.ts.map +1 -1
  194. package/dist/testing/playwright.js +22 -27
  195. package/dist/testing/playwright.js.map +1 -1
  196. package/dist/testing/puppeteer.d.ts +11 -12
  197. package/dist/testing/puppeteer.d.ts.map +1 -1
  198. package/dist/testing/puppeteer.js +17 -18
  199. package/dist/testing/puppeteer.js.map +1 -1
  200. package/dist/testing/system.d.ts +72 -90
  201. package/dist/testing/system.d.ts.map +1 -1
  202. package/dist/testing/system.js +90 -107
  203. package/dist/testing/system.js.map +1 -1
  204. package/dist/tracing/http.d.ts +2 -1
  205. package/dist/tracing/http.d.ts.map +1 -1
  206. package/dist/tracing/http.js +2 -1
  207. package/dist/tracing/http.js.map +1 -1
  208. package/dist/tracing/node.d.ts.map +1 -1
  209. package/dist/tracing/node.js +1 -1
  210. package/dist/tracing/node.js.map +1 -1
  211. package/dist/tsconfig.build.tsbuildinfo +1 -1
  212. package/frontends/mod.test.ts +6 -2
  213. package/frontends/mod.ts +20 -19
  214. package/gateway/errors.ts +30 -32
  215. package/gateway/match.ts +61 -57
  216. package/gateway/middleware.ts +62 -64
  217. package/gateway/mod.ts +73 -76
  218. package/gateway/request.ts +143 -140
  219. package/gateway/serve.ts +58 -63
  220. package/gateways/mod.ts +25 -23
  221. package/internal/otel/http.test.ts +50 -0
  222. package/internal/otel/http.ts +40 -5
  223. package/internal/runtime/napi/napi.cjs +6 -5
  224. package/internal/runtime/napi/napi.d.cts +58 -16
  225. package/internal/runtime/shutdown.ts +113 -101
  226. package/log/logger.test.ts +8 -0
  227. package/log/logger.ts +48 -45
  228. package/metrics/mod.ts +138 -122
  229. package/otel.ts +6 -3
  230. package/package.json +6 -1
  231. package/pubsub/subscription.ts +93 -123
  232. package/pubsub/topic.ts +96 -130
  233. package/redaction/bridge.test.ts +99 -0
  234. package/redaction/mod.test.ts +188 -0
  235. package/redaction/mod.ts +226 -0
  236. package/reqctx/mod.ts +83 -86
  237. package/services/index.ts +78 -78
  238. package/shutdown/mod.ts +26 -25
  239. package/storage/clickhouse/database.ts +115 -129
  240. package/storage/clickhouse/errors.ts +27 -29
  241. package/storage/clickhouse/mod.ts +10 -10
  242. package/storage/objects/bucket.test.ts +168 -16
  243. package/storage/objects/bucket.ts +336 -247
  244. package/storage/objects/error.ts +4 -4
  245. package/storage/objects/mod.ts +1 -0
  246. package/storage/objects/refs.ts +2 -5
  247. package/storage/postgres/database.ts +131 -164
  248. package/storage/postgres/errors.ts +45 -52
  249. package/storage/postgres/interval.ts +21 -21
  250. package/storage/redis/bitfield.ts +51 -26
  251. package/storage/redis/command.ts +16 -12
  252. package/storage/redis/commands.ts +99 -100
  253. package/storage/redis/database.ts +145 -123
  254. package/storage/redis/mod.ts +52 -48
  255. package/storage/redis/options.ts +26 -24
  256. package/storage/redis/pubsub.ts +14 -14
  257. package/storage/redis/redis.test.ts +17 -2
  258. package/storage/redis/reply.ts +85 -77
  259. package/storage/redis/scan.ts +6 -6
  260. package/storage/redis/script.ts +29 -22
  261. package/storage/redis/target.ts +34 -1
  262. package/storage/redis/wire.ts +8 -8
  263. package/testing/mod.ts +99 -105
  264. package/testing/playwright.ts +32 -37
  265. package/testing/puppeteer.ts +22 -23
  266. package/testing/system.ts +117 -133
  267. package/tracing/http.ts +2 -1
  268. package/tracing/native.test.ts +158 -8
  269. package/tracing/node.ts +1 -0
@@ -4,66 +4,59 @@ import { DurationString } from '../types/mod.js';
4
4
  import { OrderedTopic, Topic } from './topic.js';
5
5
  import { type Scope } from '../internal/testing/scope.js';
6
6
  /**
7
- * A delivered payload with its original bytes and provider metadata.
7
+ * A delivered Pub/Sub message along with its raw bytes and broker metadata.
8
8
  *
9
- * The handler runs in the message's context: its spans and calls continue
10
- * the trace the message was published in, and the Request Context fields it
11
- * carries are set (`@encore.dev/sdk/reqctx`).
9
+ * The subscription handler runs inside the message's context: any spans or
10
+ * downstream calls continue the publisher's trace, and propagated Request
11
+ * Context fields (`@encore.dev/sdk/reqctx`) are available via `field.get()`.
12
12
  */
13
13
  export interface Message<T = unknown> {
14
- /** The payload, decoded as the subscription says. */
14
+ /** Decoded payload according to the subscription's `encoding` and `decode` options. */
15
15
  data: T;
16
- /** The payload as it was published. */
16
+ /** Original payload bytes as published. */
17
17
  rawData: Buffer;
18
- /**
19
- * The unique id of the message: the one `publish` returned. It stays the
20
- * same across delivery attempts.
21
- */
18
+ /** Unique message ID returned by `publish`; remains stable across redelivery attempts. */
22
19
  id: string;
23
20
  /**
24
- * The attributes it was published with, without the `encore-ctx-*` ones
25
- * carrying Request Context fields, which the handler reads from its
26
- * context.
21
+ * Message attributes set by the publisher, excluding internal `encore-ctx-*`
22
+ * attributes used to propagate Request Context fields.
27
23
  */
28
24
  attributes: Record<string, string>;
29
- /** The delivery attempt, starting at 1. */
25
+ /** 1-based delivery attempt counter. */
30
26
  deliveryAttempt: number;
31
- /** When it was published. */
27
+ /** Timestamp when the message was published. */
32
28
  publishTime: Date;
33
- /** The key it was published with on an ordered topic; `null` on an
34
- * unordered one. */
29
+ /** Ordering key for ordered topics, or `null` for unordered topics. */
35
30
  orderingKey: string | null;
36
31
  }
37
32
  export declare class Subscription<Msg> {
38
33
  private readonly topic;
39
- /** The subscription's name, unique to its topic. */
34
+ /** Subscription name, unique within its topic. */
40
35
  readonly name: string;
41
36
  private readonly impl?;
42
- /** Runs the handler on a message, as it is delivered. */
37
+ /** Dispatches a delivered message to the configured handler. */
43
38
  private readonly dispatch;
44
39
  constructor(topic: Topic<Msg> | OrderedTopic<Msg>, name: string, cfg: SubscriptionConfig<Msg>);
45
40
  private startSubscribing;
46
41
  /**
47
- * Runs the handler on each message the test `scope` published to the
48
- * topic that the subscription has not handled and its filter matches, in
49
- * order, returning how many it handled. Stops at the first the handler
50
- * fails, rejecting with its error: that message is handed over again next
51
- * time, as its next attempt.
42
+ * Delivers pending matching messages from `scope` to this subscription in
43
+ * order and returns the number of messages handled. Rejects on the first
44
+ * handler error so that message remains pending for the next attempt.
52
45
  *
53
46
  * @internal
54
47
  */
55
48
  static deliverIn(sub: Subscription<unknown>, scope: Scope, maxDeliveries: number): Promise<number>;
56
49
  }
57
50
  /**
58
- * SubscriptionConfig is used when creating a subscription: its
59
- * {@link SubscriptionOptions}, and how its messages are decoded.
51
+ * Configuration for creating a {@link Subscription}, combining
52
+ * {@link SubscriptionOptions} with payload decoding settings.
60
53
  *
61
- * Decode JSON by default; byte subscriptions must select `encoding: "raw"`.
62
- * `decode` optionally validates/transforms JSON, or decodes a custom raw format.
54
+ * Messages are JSON-decoded by default; byte subscriptions must specify
55
+ * `encoding: "raw"`. Provide `decode` to validate or transform parsed JSON, or
56
+ * to decode a custom binary format.
63
57
  *
64
- * The values given here may be clamped to the supported values by
65
- * the target cloud. (i.e. ack deadline may be brought within the supported range
66
- * by the target cloud pubsub implementation).
58
+ * Cloud providers may clamp configuration values (such as `ackDeadline`) to
59
+ * their supported ranges.
67
60
  */
68
61
  export type SubscriptionConfig<Msg> = SubscriptionOptions<Msg> & ([Msg] extends [Uint8Array] ? {
69
62
  encoding: 'raw';
@@ -75,149 +68,128 @@ export type SubscriptionConfig<Msg> = SubscriptionOptions<Msg> & ([Msg] extends
75
68
  encoding: 'raw';
76
69
  decode: (data: unknown) => Msg;
77
70
  });
78
- /** A subscription's options, other than how its messages are decoded. */
71
+ /** Subscription options other than payload decoding. */
79
72
  export interface SubscriptionOptions<Msg> {
80
73
  /**
81
- * Handler is the function which will be called to process a message
82
- * sent on the topic.
74
+ * Function invoked to process each message published to the topic.
83
75
  *
84
- * It receives a {@link Message} with decoded `data` and original `rawData`.
85
- * TypeScript types do not validate JSON; use `decode` for runtime validation.
76
+ * Receives a {@link Message} containing the decoded `data` and raw bytes in
77
+ * `rawData`. TypeScript types are not checked at runtime; use `decode` for
78
+ * runtime validation.
86
79
  *
87
- * When this function returns an error the message will be
88
- * negatively acknowledged (nacked), which will cause a redelivery
89
- * attempt to be made (unless the retry policy's MaxRetries has been reached).
80
+ * Throwing or rejecting negatively acknowledges (nacks) the message,
81
+ * triggering redelivery until {@link RetryPolicy.maxRetries} is exhausted.
90
82
  */
91
83
  handler: (msg: Message<Msg>) => Promise<unknown>;
92
84
  /**
93
- * MaxConcurrency is the maximum number of messages which will be processed
94
- * simultaneously per instance of the service for this subscription.
95
- *
96
- * Note that this is per instance of the service, so if your service has
97
- * scaled to 10 instances and this is set to 10, then 100 messages could be
98
- * processed simultaneously.
99
- *
100
- * If the value is negative, then there will be no limit on the number
101
- * of messages processed simultaneously.
85
+ * Maximum number of messages processed concurrently per service instance.
102
86
  *
103
- * Note: This is not supported by all cloud providers; specifically on GCP
104
- * when using Cloud Run instances on an unordered topic the subscription will
105
- * be configured as a Push Subscription and will have an adaptive concurrency
106
- * See [GCP Push Delivery Rate](https://cloud.google.com/pubsub/docs/push#push_delivery_rate).
87
+ * For example, setting `maxConcurrency: 10` across 10 service instances
88
+ * allows up to 100 concurrent messages. Negative values disable the limit.
107
89
  *
108
- * This setting also has no effect on Encore Cloud environments.
109
- * If not set, it uses a reasonable default based on the cloud provider.
90
+ * Note: Not supported on all providers — on GCP Cloud Run with unordered
91
+ * topics, subscriptions use Push Delivery with adaptive concurrency (see
92
+ * [GCP Push Delivery Rate](https://cloud.google.com/pubsub/docs/push#push_delivery_rate)).
93
+ * Also has no effect in Encore Cloud environments. Defaults to a
94
+ * provider-specific value when omitted.
110
95
  */
111
96
  maxConcurrency?: number;
112
97
  /**
113
- * AckDeadline is how long a message is kept for its handler before
114
- * it's delivered again. While the handler runs, a pulled message's
115
- * lease is extended for an hour, or for the ack deadline when that is
116
- * longer; a message pushed to the service (a GCP push subscription)
117
- * has the ack deadline.
98
+ * Maximum time the broker waits for acknowledgment before redelivering a
99
+ * message. For pulled subscriptions, Encore automatically extends the lease
100
+ * while the handler runs (up to 1 hour, or `ackDeadline` if longer); GCP push
101
+ * subscriptions are bounded by `ackDeadline`.
118
102
  *
119
- * Default is 30 seconds, however the ack deadline must be at least
120
- * 1 second.
103
+ * Defaults to 30 seconds; must be at least 1 second.
121
104
  */
122
105
  ackDeadline?: DurationString;
123
106
  /**
124
- * MessageRetention is how long an undelivered message is kept
125
- * on the topic before it's purged.
126
- *
127
- * Default is 7 days.
107
+ * How long undelivered messages are retained before being purged.
108
+ * Defaults to 7 days.
128
109
  */
129
110
  messageRetention?: DurationString;
130
111
  /**
131
- * RetryPolicy defines how a message should be retried when
132
- * the subscriber returns an error
112
+ * Retry policy controlling redelivery backoff and dead-lettering when the
113
+ * handler fails.
133
114
  */
134
115
  retryPolicy?: RetryPolicy;
135
116
  /**
136
- * Which of the topic's messages the subscription receives: those whose
137
- * attributes this condition matches. Messages it does not match are never
138
- * delivered to the subscription. By default it receives them all.
117
+ * Optional attribute filter expression selecting which messages this
118
+ * subscription receives. Unmatched messages are never delivered. Receives all
119
+ * messages when omitted.
139
120
  *
140
- * It is written in a subset of the [expr language](https://expr-lang.org),
141
- * which every cloud Encore deploys to can filter on:
121
+ * Written in a cloud-portable subset of [expr](https://expr-lang.org):
142
122
  *
143
123
  * ```ts
144
124
  * filter: `attrs.region in ["eu-west-1", "eu-north-1"] and not (attrs.kind startsWith "test-")`
145
125
  * ```
146
126
  *
127
+ * Supported operators:
147
128
  * - `attrs.region == "eu"`, `!=`, `in [...]`, `not in [...]`, and
148
- * `startsWith "eu-"`; `attrs["iana.org-lang"]` for a name with other
149
- * characters than letters, digits and `_`.
150
- * - `"region" in attrs` and `"region" not in attrs`: whether a message has
151
- * the attribute. A test of a value does not hold for a message without
152
- * the attribute, and a negated one does.
153
- * - `and` (`&&`), `or` (`||`), `not (...)` (`!(...)`) and parentheses.
154
- *
155
- * Encore reads it from the source, so it is a string written out, and
156
- * checks it fits the clouds' limits.
129
+ * `startsWith "eu-"` (use `attrs["iana.org-lang"]` for attribute names
130
+ * containing characters outside letters, digits, and `_`).
131
+ * - `"region" in attrs` and `"region" not in attrs` to check attribute
132
+ * presence. Value checks evaluate to `false` when an attribute is missing,
133
+ * while negated checks evaluate to `true`.
134
+ * - `and` (`&&`), `or` (`||`), `not (...)` (`!(...)`), and parentheses.
135
+ *
136
+ * Must be a string literal so Encore can validate it statically against cloud
137
+ * provider limits.
157
138
  */
158
139
  filter?: string;
159
140
  /**
160
- * The Worker of the service that consumes the subscription: a long-running
161
- * process of the service that serves no requests, declared in the `workers`
162
- * section of its `encore.service.json`. Only that process takes its
163
- * messages; another process of the service that creates the subscription
164
- * takes none. By default the service's main process consumes it.
165
- *
166
- * Encore reads it from the source, so it is a string written out.
141
+ * Name of a worker declared in `encore.service.json` under `workers` that
142
+ * should consume this subscription instead of the service's main process.
143
+ * Only that worker processes messages for this subscription. Must be a string
144
+ * literal.
167
145
  */
168
146
  worker?: string;
169
147
  /**
170
- * Tags that classify the subscription, for policies to read: written out as
171
- * string literals, as in `{data: "pci"}`. Keys and values are lowercase
172
- * letters, digits, `_` and `-`, at most 63 characters; a key starts with a
173
- * letter, and not with `encore`, which is reserved. At most 32 tags.
148
+ * Static string-literal tags that classify the subscription for policy checks
149
+ * (e.g. `{data: "pci"}`). Keys and values may contain lowercase letters,
150
+ * digits, `_`, and `-`, up to 63 characters. Keys must start with a letter
151
+ * and cannot start with the reserved prefix `encore`. At most 32 tags.
174
152
  */
175
153
  tags?: Record<string, string>;
176
154
  }
177
155
  /**
178
- * RetryPolicy defines how a subscription should handle retries
179
- * after errors either delivering the message or processing the message.
180
- *
181
- * The values given to this structure are parsed at compile time, such that
182
- * the correct Cloud resources can be provisioned to support the queue.
156
+ * Retry and dead-letter configuration for failed deliveries or handler errors.
183
157
  *
184
- * As such the values given here may be clamped to the supported values by
185
- * the target cloud. (i.e. min/max values brought within the supported range
186
- * by the target cloud).
158
+ * Values are parsed statically at compile time to provision cloud resources,
159
+ * and may be clamped to each cloud provider's supported ranges.
187
160
  */
188
161
  export interface RetryPolicy {
189
162
  /**
190
- * The minimum time to wait between retries. Defaults to 10 seconds.
163
+ * Minimum backoff delay between retry attempts. Defaults to 10 seconds.
191
164
  */
192
165
  minBackoff?: DurationString;
193
166
  /**
194
- * The maximum time to wait between retries. Defaults to 10 minutes.
167
+ * Maximum backoff delay between retry attempts. Defaults to 10 minutes.
195
168
  */
196
169
  maxBackoff?: DurationString;
197
170
  /**
198
- * How many times a message is retried after its handler fails before it is
199
- * forwarded to the dead-letter queue. Defaults to 100.
171
+ * Maximum number of retries after a handler failure before forwarding the
172
+ * message to the dead-letter queue. Defaults to 100.
200
173
  *
201
- * - `n >= 0`: retried up to `n` times. `0` retries it not at all: it is
202
- * dead-lettered as soon as its handler fails once.
203
- * - `-1`, {@link InfiniteRetries}: retried for as long as it fails, never
204
- * dead-lettered.
205
- * - `-2`, {@link NoRetries}: not retried, as `0`.
174
+ * - `n >= 0`: retry up to `n` times (`0` disables retries and dead-letters on
175
+ * the first failure).
176
+ * - `-1` ({@link InfiniteRetries}): retry indefinitely without dead-lettering.
177
+ * - `-2` ({@link NoRetries}): do not retry (equivalent to `0`).
206
178
  *
207
- * Anything below `-2` is rejected. Encore reads it from the source, so it
208
- * is a number written out, or one of the two constants imported from
209
- * `@encore.dev/sdk/pubsub`.
179
+ * Values below `-2` are rejected. Must be a numeric literal or one of the
180
+ * exported constants (`NoRetries`, `InfiniteRetries`) so Encore can parse it
181
+ * statically.
210
182
  */
211
183
  maxRetries?: number;
212
184
  }
213
185
  /**
214
- * The `maxRetries` that retries a message not at all: it is forwarded to the
215
- * dead-letter queue as soon as its handler fails once.
186
+ * `maxRetries` value that disables retries and immediately forwards failed
187
+ * messages to the dead-letter queue.
216
188
  */
217
189
  export declare const NoRetries = -2;
218
190
  /**
219
- * The `maxRetries` that retries a message for as long as its handler fails:
220
- * it is never forwarded to the dead-letter queue.
191
+ * `maxRetries` value that retries failed messages indefinitely without
192
+ * dead-lettering.
221
193
  */
222
194
  export declare const InfiniteRetries = -1;
223
195
  //# sourceMappingURL=subscription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../pubsub/subscription.ts"],"names":[],"mappings":";;AASA,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAE,KAAK,EAAC,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAW,KAAK,KAAK,EAAC,MAAM,2BAA2B,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,WAAW,OAAO,CAAC,CAAC,GAAG,OAAO;IAClC,qDAAqD;IACrD,IAAI,EAAE,CAAC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import * as runtime from '../internal/runtime/mod.js';
6
6
  import { testMode } from '../internal/testing/scope.js';
7
7
  export class Subscription {
8
8
  topic;
9
- /** The subscription's name, unique to its topic. */
9
+ /** Subscription name, unique within its topic. */
10
10
  name;
11
11
  impl;
12
- /** Runs the handler on a message, as it is delivered. */
12
+ /** Dispatches a delivered message to the configured handler. */
13
13
  dispatch;
14
14
  constructor(topic, name, cfg) {
15
15
  this.topic = topic;
@@ -49,11 +49,9 @@ export class Subscription {
49
49
  });
50
50
  }
51
51
  /**
52
- * Runs the handler on each message the test `scope` published to the
53
- * topic that the subscription has not handled and its filter matches, in
54
- * order, returning how many it handled. Stops at the first the handler
55
- * fails, rejecting with its error: that message is handed over again next
56
- * time, as its next attempt.
52
+ * Delivers pending matching messages from `scope` to this subscription in
53
+ * order and returns the number of messages handled. Rejects on the first
54
+ * handler error so that message remains pending for the next attempt.
57
55
  *
58
56
  * @internal
59
57
  */
@@ -65,9 +63,9 @@ export class Subscription {
65
63
  if (delivery === null)
66
64
  return handled;
67
65
  if (handled === maxDeliveries) {
68
- throw new Error(`subscription ${JSON.stringify(sub.name)} handled ${maxDeliveries} messages in one ` +
69
- `delivery and was still handed more: does its handler publish to its own topic ` +
70
- `${JSON.stringify(topic)} every time?`);
66
+ throw new Error(`subscription ${JSON.stringify(sub.name)} handled ${maxDeliveries} messages in a ` +
67
+ `single deliver() call and still has more pending — check whether its handler ` +
68
+ `unconditionally publishes back to topic ${JSON.stringify(topic)}`);
71
69
  }
72
70
  const msg = delivery.message;
73
71
  try {
@@ -90,9 +88,8 @@ export class Subscription {
90
88
  }
91
89
  }
92
90
  /**
93
- * The context a message's handler runs in: its delivery span's, so the
94
- * handler's spans and calls continue the trace and carry Encore's propagation
95
- * mark, with the Request Context fields the message carries.
91
+ * Builds the OpenTelemetry context for a subscription handler, attaching the
92
+ * delivery span context and any propagated Request Context fields.
96
93
  */
97
94
  function handlerContext(msg, fields) {
98
95
  let ctx = ROOT_CONTEXT;
@@ -109,13 +106,13 @@ function handlerContext(msg, fields) {
109
106
  return Object.keys(fields).length === 0 ? ctx : withFields(fields, ctx);
110
107
  }
111
108
  /**
112
- * The `maxRetries` that retries a message not at all: it is forwarded to the
113
- * dead-letter queue as soon as its handler fails once.
109
+ * `maxRetries` value that disables retries and immediately forwards failed
110
+ * messages to the dead-letter queue.
114
111
  */
115
112
  export const NoRetries = -2;
116
113
  /**
117
- * The `maxRetries` that retries a message for as long as its handler fails:
118
- * it is never forwarded to the dead-letter queue.
114
+ * `maxRetries` value that retries failed messages indefinitely without
115
+ * dead-lettering.
119
116
  */
120
117
  export const InfiniteRetries = -1;
121
118
  //# sourceMappingURL=subscription.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../pubsub/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,KAAK,GAEN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAC,qBAAqB,EAAE,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAGxE,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAa,MAAM,2BAA2B,CAAC;AAkC/D,MAAM,OAAO,YAAY;IACN,KAAK,CAAiC;IACvD,oDAAoD;IAC3C,IAAI,CAAS;IACL,IAAI,CAA8B;IACnD,yDAAyD;IACxC,QAAQ,CAAoC;IAE7D,YACE,KAAqC,EACrC,IAAY,EACZ,GAA4B;QAE5B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAc,EAAE,EAAE;YACjC,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,C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