@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
@@ -44,7 +44,7 @@ import {subscribe, type Subscription} from './pubsub';
44
44
  import type {Target} from './target';
45
45
  import {Cmd, type Pairs, type RedisArg, type Value} from './wire';
46
46
 
47
- /** A score bound: a number, `"-inf"` or `"+inf"`, or exclusive as `"(1.5"`. */
47
+ /** A sorted set score bound: a number, `"-inf"`, `"+inf"`, or an exclusive bound such as `"(1.5"`. */
48
48
  export type ScoreBound = number | string;
49
49
 
50
50
  /**
@@ -190,56 +190,56 @@ const generic = {
190
190
  * many existed.
191
191
  */
192
192
  unlink: write((...keys: string[]) => cmd('UNLINK').keys(keys), as.number),
193
- /** Has the key expire in `seconds`. `false` if it does not exist. */
193
+ /** Sets the key to expire after `seconds`. Returns `false` if the key does not exist. */
194
194
  expire: write(
195
195
  (key: string, seconds: number) => cmd('EXPIRE').key(key).arg(seconds),
196
196
  as.bool,
197
197
  ),
198
- /** Has the key expire in `milliseconds`. `false` if it does not exist. */
198
+ /** Sets the key to expire after `milliseconds`. Returns `false` if the key does not exist. */
199
199
  pexpire: write(
200
200
  (key: string, milliseconds: number) =>
201
201
  cmd('PEXPIRE').key(key).arg(milliseconds),
202
202
  as.bool,
203
203
  ),
204
204
  /**
205
- * Has the key expire at a Unix time, in seconds. `false` if it does not
206
- * exist.
205
+ * Sets the key to expire at the given Unix timestamp in seconds. Returns
206
+ * `false` if the key does not exist.
207
207
  */
208
208
  expireAt: write(
209
209
  (key: string, timestamp: number) => cmd('EXPIREAT').key(key).arg(timestamp),
210
210
  as.bool,
211
211
  ),
212
- /** Removes the key's expiry. `false` if it had none, or does not exist. */
212
+ /** Removes the key's expiration. Returns `false` if it had none or does not exist. */
213
213
  persist: write((key: string) => cmd('PERSIST').key(key), as.bool),
214
214
  /** Renames the key, replacing `newKey` if it exists. */
215
215
  rename: write(
216
216
  (key: string, newKey: string) => cmd('RENAME').key(key).key(newKey),
217
217
  as.none,
218
218
  ),
219
- /** Renames the key unless `newKey` exists. `false` if it does. */
219
+ /** Renames the key only if `newKey` does not exist. Returns `false` if `newKey` already exists. */
220
220
  renameNx: write(
221
221
  (key: string, newKey: string) => cmd('RENAMENX').key(key).key(newKey),
222
222
  as.bool,
223
223
  ),
224
224
  /**
225
- * Copies the value at `source` to `destination`. `false` if `destination`
226
- * exists.
225
+ * Copies the value at `source` to `destination`. Returns `false` if
226
+ * `destination` already exists.
227
227
  */
228
228
  copy: write(
229
229
  (source: string, destination: string) =>
230
230
  cmd('COPY').key(source).key(destination),
231
231
  as.bool,
232
232
  ),
233
- /** Marks the keys as used just now, returning how many exist. */
233
+ /** Updates the last-access time of the keys and returns how many exist. */
234
234
  touch: write((...keys: string[]) => cmd('TOUCH').keys(keys), as.number),
235
235
  };
236
236
 
237
237
  const string = {
238
- /** The value at the key: nil if it does not exist. */
238
+ /** Returns the value at the key, or nil if it does not exist. */
239
239
  get: read((key: string) => cmd('GET').key(key), as.reply),
240
240
  /**
241
- * The values at the keys, in order, each missing one as nil: read it with
242
- * {@link Reply.optionalTexts}.
241
+ * Returns the values for the keys in order, with missing keys as nil.
242
+ * Decode with {@link Reply.optionalTexts}.
243
243
  */
244
244
  mget: read((...keys: string[]) => cmd('MGET').keys(keys), as.reply),
245
245
  /** The length of the value at the key, in bytes. */
@@ -265,14 +265,14 @@ const string = {
265
265
  cmd('SETEX').key(key).arg(seconds).arg(value),
266
266
  as.none,
267
267
  ),
268
- /** Sets the key to the value unless the key exists. `false` if it does. */
268
+ /** Sets the key to the value only if it does not exist. Returns `false` if it already exists. */
269
269
  setNx: write(
270
270
  (key: string, value: RedisArg) => cmd('SETNX').key(key).arg(value),
271
271
  as.bool,
272
272
  ),
273
273
  /**
274
- * Sets the key to the value as `options` say: only if it exists or does
275
- * not, with an expiry, replying the old value.
274
+ * Sets the key to the value using `options` (existence condition,
275
+ * expiration, and optionally returning the previous value).
276
276
  */
277
277
  setOptions: write(
278
278
  (key: string, value: RedisArg, options: SetOptions) =>
@@ -282,16 +282,16 @@ const string = {
282
282
  /** Sets each key to its value, all at once. */
283
283
  mset: write((items: Pairs<RedisArg>) => cmd('MSET').pairs(items), as.none),
284
284
  /**
285
- * Sets each key to its value unless any of the keys exists. `false` if one
286
- * does, in which case none is set.
285
+ * Sets each key to its value only if none of the keys exist. Returns `false`
286
+ * if any key already exists, leaving all keys unchanged.
287
287
  */
288
288
  msetNx: write(
289
289
  (items: Pairs<RedisArg>) => cmd('MSETNX').pairs(items),
290
290
  as.bool,
291
291
  ),
292
- /** The value at the key, which is deleted. */
292
+ /** Returns the value at the key and deletes the key. */
293
293
  getDel: write((key: string) => cmd('GETDEL').key(key), as.reply),
294
- /** The value at the key, whose expiry is set as `expiry` says. */
294
+ /** Returns the value at the key and updates its expiration according to `expiry`. */
295
295
  getEx: write(
296
296
  (key: string, expiry: Expiry) =>
297
297
  cmd('GETEX').key(key).argsOf(expiryArgs(expiry)),
@@ -351,7 +351,7 @@ const bitmap = {
351
351
  as.number,
352
352
  ),
353
353
 
354
- /** Sets the bit at `offset`, returning what it was. */
354
+ /** Sets the bit at `offset` and returns its previous value. */
355
355
  setbit: write(
356
356
  (key: string, offset: number, value: boolean) =>
357
357
  cmd('SETBIT').key(key).arg(offset).arg(bitArg(value)),
@@ -394,15 +394,15 @@ const bitmap = {
394
394
  as.number,
395
395
  ),
396
396
  /**
397
- * Integers of any width up to 64 bits, read and written at any bit offset of
398
- * the string: add the operations, then {@link Bitfield.invoke}.
397
+ * Reads and writes arbitrary-width integers (up to 64 bits) at any bit
398
+ * offset in the string. Chain operations, then call {@link Bitfield.invoke}.
399
399
  */
400
400
  bitfield: writeBuilder(
401
401
  (key: string) => cmd('BITFIELD').key(key),
402
402
  (t, c) => new Bitfield(t, c),
403
403
  (queue, c) => new QueuedBitfield(queue, c),
404
404
  ),
405
- /** {@link Bitfield} that only reads (`BITFIELD_RO`). */
405
+ /** Read-only variant of {@link Bitfield} (`BITFIELD_RO`). */
406
406
  bitfieldRo: readBuilder(
407
407
  (key: string) => cmd('BITFIELD_RO').key(key),
408
408
  (t, c) => new BitfieldRo(t, c),
@@ -417,8 +417,8 @@ const hash = {
417
417
  as.reply,
418
418
  ),
419
419
  /**
420
- * The values of the fields, in order, each missing one as nil: read it with
421
- * {@link Reply.optionalTexts}.
420
+ * Returns the values of the fields in order, with missing fields as nil.
421
+ * Decode with {@link Reply.optionalTexts}.
422
422
  */
423
423
  hmget: read(
424
424
  (key: string, ...fields: RedisArg[]) =>
@@ -456,7 +456,7 @@ const hash = {
456
456
  (key: string, items: Pairs<RedisArg>) => cmd('HSET').key(key).fields(items),
457
457
  as.number,
458
458
  ),
459
- /** Sets a field unless it exists. `false` if it does. */
459
+ /** Sets a field only if it does not exist. Returns `false` if it already exists. */
460
460
  hsetNx: write(
461
461
  (key: string, field: RedisArg, value: RedisArg) =>
462
462
  cmd('HSETNX').key(key).arg(field).arg(value),
@@ -529,8 +529,8 @@ const list = {
529
529
  as.number,
530
530
  ),
531
531
  /**
532
- * Removes and returns the first element, or with a `count`, that many, as a
533
- * list.
532
+ * Removes and returns the first element, or up to `count` elements as an
533
+ * array when `count` is specified.
534
534
  */
535
535
  lpop: write(
536
536
  (key: string, count?: number) =>
@@ -540,8 +540,8 @@ const list = {
540
540
  as.reply,
541
541
  ),
542
542
  /**
543
- * Removes and returns the last element, or with a `count`, that many, as a
544
- * list.
543
+ * Removes and returns the last element, or up to `count` elements as an
544
+ * array when `count` is specified.
545
545
  */
546
546
  rpop: write(
547
547
  (key: string, count?: number) =>
@@ -581,8 +581,9 @@ const list = {
581
581
  as.number,
582
582
  ),
583
583
  /**
584
- * Removes elements equal to `value`: the first `count` of them, the last
585
- * `-count` if it is negative, or all if it is 0. Returns how many.
584
+ * Removes elements equal to `value`: the first `count` matches when positive,
585
+ * the last `-count` matches when negative, or all matches when 0. Returns the
586
+ * number of removed elements.
586
587
  */
587
588
  lrem: write(
588
589
  (key: string, count: number, value: RedisArg) =>
@@ -604,24 +605,24 @@ const list = {
604
605
  ),
605
606
 
606
607
  /**
607
- * Removes and returns the first element of the first of `keys` that has
608
- * one, with its key, waiting up to `timeout` seconds for one to be pushed:
609
- * 0 waits for ever. `null` once the timeout passes.
608
+ * Removes and returns the first element (along with its key) from the first
609
+ * non-empty list in `keys`, waiting up to `timeout` seconds (`0` waits
610
+ * forever). Returns `null` on timeout.
610
611
  */
611
612
  blpop: writeBlocking(
612
613
  (keys: string | string[], timeout: number) =>
613
614
  cmd('BLPOP').keys(keyList(keys)).arg(timeout),
614
615
  as.popped,
615
616
  ),
616
- /** `blpop`, from the end of the list. */
617
+ /** Like `blpop`, but pops from the tail of the list. */
617
618
  brpop: writeBlocking(
618
619
  (keys: string | string[], timeout: number) =>
619
620
  cmd('BRPOP').keys(keyList(keys)).arg(timeout),
620
621
  as.popped,
621
622
  ),
622
623
  /**
623
- * `lmove`, waiting up to `timeout` seconds for `source`
624
- * to have an element: 0 waits for ever. A nil reply once the timeout passes.
624
+ * Like `lmove`, waiting up to `timeout` seconds for `source` to have an
625
+ * element (`0` waits forever). Returns nil on timeout.
625
626
  */
626
627
  blmove: writeBlocking(
627
628
  (
@@ -640,9 +641,9 @@ const list = {
640
641
  as.reply,
641
642
  ),
642
643
  /**
643
- * Removes and returns up to `count` elements from one end of the first of
644
- * `keys` that has any, with its key, waiting up to `timeout` seconds for
645
- * one: 0 waits for ever. `null` once the timeout passes.
644
+ * Removes and returns up to `count` elements (along with their key) from the
645
+ * first non-empty list in `keys`, waiting up to `timeout` seconds (`0` waits
646
+ * forever). Returns `null` on timeout.
646
647
  */
647
648
  blmpop: writeBlocking(
648
649
  (keys: string[], from: Direction, count: number, timeout: number) =>
@@ -746,7 +747,7 @@ const sortedSet = {
746
747
  as.reply,
747
748
  ),
748
749
  /**
749
- * `zrange`, each member with its score: read it with
750
+ * Like `zrange`, including each member's score. Decode with
750
751
  * {@link Reply.scoredMembers}.
751
752
  */
752
753
  zrangeWithscores: read(
@@ -761,7 +762,7 @@ const sortedSet = {
761
762
  as.reply,
762
763
  ),
763
764
  /**
764
- * `zrevrange`, each member with its score: read it with
765
+ * Like `zrevrange`, including each member's score. Decode with
765
766
  * {@link Reply.scoredMembers}.
766
767
  */
767
768
  zrevrangeWithscores: read(
@@ -776,7 +777,7 @@ const sortedSet = {
776
777
  as.reply,
777
778
  ),
778
779
  /**
779
- * `zrangebyscore`, each member with its score: read it with
780
+ * Like `zrangebyscore`, including each member's score. Decode with
780
781
  * {@link Reply.scoredMembers}.
781
782
  */
782
783
  zrangebyscoreWithscores: read(
@@ -897,26 +898,26 @@ const sortedSet = {
897
898
  ),
898
899
 
899
900
  /**
900
- * Removes and returns the lowest scored member of the first of `keys` that
901
- * has one, with its key and score, waiting up to `timeout` seconds for one
902
- * to be added: 0 waits for ever. `null` once the timeout passes.
901
+ * Removes and returns the lowest-scoring member (along with its key and
902
+ * score) from the first non-empty sorted set in `keys`, waiting up to
903
+ * `timeout` seconds (`0` waits forever). Returns `null` on timeout.
903
904
  */
904
905
  bzpopmin: writeBlocking(
905
906
  (keys: string | string[], timeout: number) =>
906
907
  cmd('BZPOPMIN').keys(keyList(keys)).arg(timeout),
907
908
  as.poppedScored,
908
909
  ),
909
- /** `bzpopmin`, the highest scored member. */
910
+ /** Like `bzpopmin`, but pops the highest-scoring member. */
910
911
  bzpopmax: writeBlocking(
911
912
  (keys: string | string[], timeout: number) =>
912
913
  cmd('BZPOPMAX').keys(keyList(keys)).arg(timeout),
913
914
  as.poppedScored,
914
915
  ),
915
916
  /**
916
- * Removes and returns up to `count` of the lowest (`'min'`) or highest
917
- * (`'max'`) scored members of the first of `keys` that has any, with its
918
- * key and their scores, waiting up to `timeout` seconds for one: 0 waits
919
- * for ever. `null` once the timeout passes.
917
+ * Removes and returns up to `count` lowest-scoring (`'min'`) or
918
+ * highest-scoring (`'max'`) members (along with their key and scores) from
919
+ * the first non-empty sorted set in `keys`, waiting up to `timeout` seconds
920
+ * (`0` waits forever). Returns `null` on timeout.
920
921
  */
921
922
  bzmpop: writeBlocking(
922
923
  (keys: string[], which: 'min' | 'max', count: number, timeout: number) =>
@@ -932,8 +933,8 @@ const sortedSet = {
932
933
 
933
934
  const geo = {
934
935
  /**
935
- * The positions of the members, each missing one as nil: read it with
936
- * {@link Reply.geoPositions}.
936
+ * Returns the positions of the members, with missing members as nil. Decode
937
+ * with {@link Reply.geoPositions}.
937
938
  */
938
939
  geoPos: read(
939
940
  (key: string, ...members: RedisArg[]) =>
@@ -1035,9 +1036,8 @@ const stream = {
1035
1036
  /** How many entries the stream has. */
1036
1037
  xlen: read((key: string) => cmd('XLEN').key(key), as.number),
1037
1038
  /**
1038
- * The entries after an id in each of the streams, `ids` giving the id for
1039
- * each of `keys` in order. Returns at once with what is there. Read it with
1040
- * {@link Reply.streams}.
1039
+ * Reads entries after the given IDs across `keys` (`ids` corresponds to
1040
+ * `keys` in order) without blocking. Decode with {@link Reply.streams}.
1041
1041
  */
1042
1042
  xread: read(
1043
1043
  (keys: string[], ids: string[]) =>
@@ -1045,16 +1045,15 @@ const stream = {
1045
1045
  as.reply,
1046
1046
  ),
1047
1047
  /**
1048
- * A summary of the entries a consumer group has been given and not
1049
- * acknowledged: read it with {@link Reply.streamPending}.
1048
+ * Returns a summary of pending (unacknowledged) entries for a consumer
1049
+ * group. Decode with {@link Reply.streamPending}.
1050
1050
  */
1051
1051
  xpending: read(
1052
1052
  (key: string, group: string) => cmd('XPENDING').key(key).arg(group),
1053
1053
  as.reply,
1054
1054
  ),
1055
1055
  /**
1056
- * What the server knows about the stream: read it with
1057
- * {@link Reply.streamInfo}.
1056
+ * Returns metadata about the stream. Decode with {@link Reply.streamInfo}.
1058
1057
  */
1059
1058
  xinfoStream: read(
1060
1059
  (key: string) => cmd('XINFO').arg('STREAM').key(key),
@@ -1062,15 +1061,15 @@ const stream = {
1062
1061
  ),
1063
1062
 
1064
1063
  /**
1065
- * Appends an entry with the given fields, replying its id. Pass `"*"` as
1066
- * the id to have the server choose it.
1064
+ * Appends an entry with the given fields and returns its ID. Pass `"*"` as
1065
+ * the ID to let Redis generate one.
1067
1066
  */
1068
1067
  xadd: write(
1069
1068
  (key: string, id: string, fields: Pairs<RedisArg>) =>
1070
1069
  cmd('XADD').key(key).arg(id).fields(fields),
1071
1070
  as.reply,
1072
1071
  ),
1073
- /** `xadd`, trimming the stream to a maximum length. */
1072
+ /** Like `xadd`, while trimming the stream to a maximum length. */
1074
1073
  xaddMaxlen: write(
1075
1074
  (key: string, maxlen: StreamMaxlen, id: string, fields: Pairs<RedisArg>) =>
1076
1075
  cmd('XADD').key(key).argsOf(maxlenArgs(maxlen)).arg(id).fields(fields),
@@ -1099,23 +1098,23 @@ const stream = {
1099
1098
  cmd('XGROUP').arg('CREATE').key(key).arg(group).arg(id),
1100
1099
  as.none,
1101
1100
  ),
1102
- /** `xgroupCreate`, creating the stream if it does not exist. */
1101
+ /** Like `xgroupCreate`, creating the stream if it does not already exist. */
1103
1102
  xgroupCreateMkstream: write(
1104
1103
  (key: string, group: string, id: string) =>
1105
1104
  cmd('XGROUP').arg('CREATE').key(key).arg(group).arg(id).arg('MKSTREAM'),
1106
1105
  as.none,
1107
1106
  ),
1108
- /** Deletes a consumer group. `false` if there was none. */
1107
+ /** Deletes a consumer group. Returns `false` if the group did not exist. */
1109
1108
  xgroupDestroy: write(
1110
1109
  (key: string, group: string) =>
1111
1110
  cmd('XGROUP').arg('DESTROY').key(key).arg(group),
1112
1111
  as.bool,
1113
1112
  ),
1114
1113
  /**
1115
- * Reads entries as `consumer` of a group: `">"` as the id for the ones no
1116
- * consumer has been given yet. With a `count`, at most that many per
1117
- * stream. A write: it records them as given to the consumer. Read it with
1118
- * {@link Reply.streams}.
1114
+ * Reads entries as `consumer` in a consumer group (pass `">"` as the ID to
1115
+ * read undelivered entries). When `count` is provided, reads at most `count`
1116
+ * entries per stream. Treated as a write because Redis records delivery to
1117
+ * the consumer. Decode with {@link Reply.streams}.
1119
1118
  */
1120
1119
  xreadGroup: write(
1121
1120
  (
@@ -1136,8 +1135,8 @@ const stream = {
1136
1135
  as.reply,
1137
1136
  ),
1138
1137
  /**
1139
- * Acknowledges entries a consumer group was given, returning how many were
1140
- * pending.
1138
+ * Acknowledges entries delivered to a consumer group and returns how many
1139
+ * were pending.
1141
1140
  */
1142
1141
  xack: write(
1143
1142
  (key: string, group: string, ...ids: string[]) =>
@@ -1145,8 +1144,8 @@ const stream = {
1145
1144
  as.number,
1146
1145
  ),
1147
1146
  /**
1148
- * Takes over pending entries that have been idle for `minIdleMs`, for
1149
- * `consumer`: read it with {@link Reply.streamEntries}.
1147
+ * Claims pending entries that have been idle for at least `minIdleMs` for
1148
+ * `consumer`. Decode with {@link Reply.streamEntries}.
1150
1149
  */
1151
1150
  xclaim: write(
1152
1151
  (
@@ -1165,8 +1164,9 @@ const stream = {
1165
1164
  as.reply,
1166
1165
  ),
1167
1166
  /**
1168
- * Takes over the pending entries from id `start` that have been idle for
1169
- * `minIdleMs`, for `consumer`: read it with {@link Reply.streamAutoClaim}.
1167
+ * Claims pending entries starting from `start` that have been idle for at
1168
+ * least `minIdleMs` for `consumer`. Decode with
1169
+ * {@link Reply.streamAutoClaim}.
1170
1170
  */
1171
1171
  xautoclaim: write(
1172
1172
  (
@@ -1186,9 +1186,9 @@ const stream = {
1186
1186
  ),
1187
1187
 
1188
1188
  /**
1189
- * `xread`, waiting up to `blockMs` milliseconds for an
1190
- * entry if there is none yet: 0 waits for ever. With a `count`, at most that
1191
- * many per stream. A nil reply once the wait passes.
1189
+ * Like `xread`, waiting up to `blockMs` milliseconds if no entries are
1190
+ * immediately available (`0` waits forever). When `count` is provided, reads
1191
+ * at most `count` entries per stream. Returns nil on timeout.
1192
1192
  */
1193
1193
  xreadBlock: readBlocking(
1194
1194
  (keys: string[], ids: string[], blockMs: number, count?: number) =>
@@ -1202,9 +1202,8 @@ const stream = {
1202
1202
  as.reply,
1203
1203
  ),
1204
1204
  /**
1205
- * `xreadGroup`, waiting up to `blockMs` milliseconds
1206
- * for an entry if there is none yet: 0 waits for ever. A nil reply once the
1207
- * wait passes.
1205
+ * Like `xreadGroup`, waiting up to `blockMs` milliseconds if no entries are
1206
+ * immediately available (`0` waits forever). Returns nil on timeout.
1208
1207
  */
1209
1208
  xreadGroupBlock: writeBlocking(
1210
1209
  (
@@ -1251,14 +1250,14 @@ const hyperloglog = {
1251
1250
  };
1252
1251
 
1253
1252
  const pubsub = {
1254
- /** Subscribes to one or more channels, on a connection of its own. */
1253
+ /** Subscribes to one or more channels on a dedicated connection. */
1255
1254
  subscribe: readRun(
1256
1255
  (t: Target, ...channels: string[]): Promise<Subscription> =>
1257
1256
  subscribe(t, channels, []),
1258
1257
  ),
1259
1258
  /**
1260
- * Subscribes to the channels matching one or more glob-style patterns, on a
1261
- * connection of its own.
1259
+ * Subscribes to channels matching one or more glob-style patterns on a
1260
+ * dedicated connection.
1262
1261
  */
1263
1262
  psubscribe: readRun(
1264
1263
  (t: Target, ...patterns: string[]): Promise<Subscription> =>
@@ -1304,10 +1303,10 @@ type RunForm<D> =
1304
1303
  ? (...args: A) => R
1305
1304
  : never;
1306
1305
 
1307
- /** A command group's commands, run as they are called. */
1306
+ /** Immediate-execution methods for a command group. */
1308
1307
  export type Commands<G> = {readonly [K in keyof G]: RunForm<G[K]>};
1309
1308
 
1310
- /** A command group's commands that only read. */
1309
+ /** Read-only immediate-execution methods for a command group. */
1311
1310
  export type ReadCommands<G> = {
1312
1311
  readonly [K in keyof G as G[K] extends {write: false} ? K : never]: RunForm<
1313
1312
  G[K]
@@ -1315,8 +1314,8 @@ export type ReadCommands<G> = {
1315
1314
  };
1316
1315
 
1317
1316
  /**
1318
- * A command group's commands, queued on a pipeline or a transaction. What
1319
- * each replies is read from `exec`, in the order queued.
1317
+ * Queued methods for a command group on a pipeline or transaction. Replies
1318
+ * are returned by `exec()` in the order queued.
1320
1319
  */
1321
1320
  export type Queue<G> = {
1322
1321
  readonly [
@@ -1331,38 +1330,38 @@ export type Queue<G> = {
1331
1330
  : never;
1332
1331
  };
1333
1332
 
1334
- /** Commands that work on a key of any type: expiry, deletion, renaming. */
1333
+ /** Commands that operate on keys of any type (expiration, deletion, renaming). */
1335
1334
  export type GenericCommands = Commands<Groups['generic']>;
1336
- /** Commands on strings, which is what a plain value is. */
1335
+ /** Commands on Redis string values. */
1337
1336
  export type StringCommands = Commands<Groups['string']>;
1338
- /** Commands on the bits of a string. */
1337
+ /** Bit-level commands on Redis string values. */
1339
1338
  export type BitmapCommands = Commands<Groups['bitmap']>;
1340
- /** Commands on hashes: a key holding fields, each with a value. */
1339
+ /** Commands on Redis hashes (field-value maps). */
1341
1340
  export type HashCommands = Commands<Groups['hash']>;
1342
1341
  /** Commands on lists. */
1343
1342
  export type ListCommands = Commands<Groups['list']>;
1344
1343
  /** Commands on sets. */
1345
1344
  export type SetCommands = Commands<Groups['set']>;
1346
- /** Commands on sorted sets: members ordered by a score. */
1345
+ /** Commands on Redis sorted sets (members ordered by score). */
1347
1346
  export type SortedSetCommands = Commands<Groups['sortedSet']>;
1348
1347
  /** Commands on geospatial indexes. */
1349
1348
  export type GeoCommands = Commands<Groups['geo']>;
1350
1349
  /** Commands on streams. */
1351
1350
  export type StreamCommands = Commands<Groups['stream']>;
1352
- /** Commands on HyperLogLogs: estimates of how many distinct elements were added. */
1351
+ /** Commands on Redis HyperLogLogs (approximate cardinality counters). */
1353
1352
  export type HyperLogLogCommands = Commands<Groups['hyperloglog']>;
1354
- /** Publishing to channels, and subscribing to them. */
1353
+ /** Commands for Redis pub/sub channels. */
1355
1354
  export type PubsubCommands = Commands<Groups['pubsub']>;
1356
1355
 
1357
- /** The command groups of a database, a writing handle and a connection. */
1356
+ /** Command groups available on a database, read-write handle, and connection. */
1358
1357
  export type CommandGroups = {
1359
1358
  readonly [G in keyof Groups]: Commands<Groups[G]>;
1360
1359
  };
1361
- /** The command groups of a handle that can only read. */
1360
+ /** Read-only command groups available on a read-only database handle. */
1362
1361
  export type ReadCommandGroups = {
1363
1362
  readonly [G in keyof Groups]: ReadCommands<Groups[G]>;
1364
1363
  };
1365
- /** The command groups of a pipeline or a transaction. */
1364
+ /** Queued command groups available on a pipeline or transaction. */
1366
1365
  export type QueueGroups = {readonly [G in keyof Groups]: Queue<Groups[G]>};
1367
1366
 
1368
1367
  /** `setEx` as a trace names it, after the Rust SDK: `set_ex`. */