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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +111 -101
  2. package/app_meta.ts +56 -54
  3. package/config/config.ts +60 -57
  4. package/config/secrets.ts +45 -52
  5. package/config/value.ts +23 -26
  6. package/cron/mod.ts +28 -29
  7. package/dist/app_meta.d.ts +52 -50
  8. package/dist/app_meta.d.ts.map +1 -1
  9. package/dist/app_meta.js +2 -2
  10. package/dist/app_meta.js.map +1 -1
  11. package/dist/config/config.d.ts +58 -55
  12. package/dist/config/config.d.ts.map +1 -1
  13. package/dist/config/config.js +8 -9
  14. package/dist/config/config.js.map +1 -1
  15. package/dist/config/secrets.d.ts +45 -52
  16. package/dist/config/secrets.d.ts.map +1 -1
  17. package/dist/config/secrets.js +8 -9
  18. package/dist/config/secrets.js.map +1 -1
  19. package/dist/config/value.d.ts +20 -23
  20. package/dist/config/value.d.ts.map +1 -1
  21. package/dist/config/value.js +20 -23
  22. package/dist/config/value.js.map +1 -1
  23. package/dist/cron/mod.d.ts +26 -27
  24. package/dist/cron/mod.d.ts.map +1 -1
  25. package/dist/cron/mod.js +13 -14
  26. package/dist/cron/mod.js.map +1 -1
  27. package/dist/frontends/mod.d.ts +20 -19
  28. package/dist/frontends/mod.d.ts.map +1 -1
  29. package/dist/frontends/mod.js +20 -19
  30. package/dist/frontends/mod.js.map +1 -1
  31. package/dist/gateway/errors.d.ts +28 -30
  32. package/dist/gateway/errors.d.ts.map +1 -1
  33. package/dist/gateway/errors.js +29 -31
  34. package/dist/gateway/errors.js.map +1 -1
  35. package/dist/gateway/match.d.ts +54 -54
  36. package/dist/gateway/match.d.ts.map +1 -1
  37. package/dist/gateway/match.js +56 -56
  38. package/dist/gateway/match.js.map +1 -1
  39. package/dist/gateway/middleware.d.ts +62 -64
  40. package/dist/gateway/middleware.d.ts.map +1 -1
  41. package/dist/gateway/middleware.js +1 -1
  42. package/dist/gateway/middleware.js.map +1 -1
  43. package/dist/gateway/mod.d.ts +64 -67
  44. package/dist/gateway/mod.d.ts.map +1 -1
  45. package/dist/gateway/mod.js +72 -76
  46. package/dist/gateway/mod.js.map +1 -1
  47. package/dist/gateway/request.d.ts +138 -134
  48. package/dist/gateway/request.d.ts.map +1 -1
  49. package/dist/gateway/request.js +117 -108
  50. package/dist/gateway/request.js.map +1 -1
  51. package/dist/gateway/serve.d.ts +29 -34
  52. package/dist/gateway/serve.d.ts.map +1 -1
  53. package/dist/gateway/serve.js +51 -56
  54. package/dist/gateway/serve.js.map +1 -1
  55. package/dist/gateways/mod.d.ts +23 -21
  56. package/dist/gateways/mod.d.ts.map +1 -1
  57. package/dist/gateways/mod.js +25 -23
  58. package/dist/gateways/mod.js.map +1 -1
  59. package/dist/internal/runtime/napi/napi.cjs +1 -1
  60. package/dist/internal/runtime/napi/napi.d.cts +10 -3
  61. package/dist/internal/runtime/shutdown.d.ts +75 -57
  62. package/dist/internal/runtime/shutdown.d.ts.map +1 -1
  63. package/dist/internal/runtime/shutdown.js +88 -84
  64. package/dist/internal/runtime/shutdown.js.map +1 -1
  65. package/dist/log/logger.d.ts +43 -37
  66. package/dist/log/logger.d.ts.map +1 -1
  67. package/dist/log/logger.js +26 -25
  68. package/dist/log/logger.js.map +1 -1
  69. package/dist/metrics/mod.d.ts +133 -114
  70. package/dist/metrics/mod.d.ts.map +1 -1
  71. package/dist/metrics/mod.js +109 -101
  72. package/dist/metrics/mod.js.map +1 -1
  73. package/dist/otel.d.ts +6 -3
  74. package/dist/otel.d.ts.map +1 -1
  75. package/dist/otel.js +6 -3
  76. package/dist/otel.js.map +1 -1
  77. package/dist/pubsub/subscription.d.ts +88 -116
  78. package/dist/pubsub/subscription.d.ts.map +1 -1
  79. package/dist/pubsub/subscription.js +14 -17
  80. package/dist/pubsub/subscription.js.map +1 -1
  81. package/dist/pubsub/topic.d.ts +86 -113
  82. package/dist/pubsub/topic.d.ts.map +1 -1
  83. package/dist/pubsub/topic.js +68 -82
  84. package/dist/pubsub/topic.js.map +1 -1
  85. package/dist/reqctx/mod.d.ts +83 -86
  86. package/dist/reqctx/mod.d.ts.map +1 -1
  87. package/dist/reqctx/mod.js +39 -41
  88. package/dist/reqctx/mod.js.map +1 -1
  89. package/dist/services/index.d.ts +76 -75
  90. package/dist/services/index.d.ts.map +1 -1
  91. package/dist/services/index.js +73 -71
  92. package/dist/services/index.js.map +1 -1
  93. package/dist/shutdown/mod.d.ts +26 -25
  94. package/dist/shutdown/mod.d.ts.map +1 -1
  95. package/dist/shutdown/mod.js +26 -25
  96. package/dist/shutdown/mod.js.map +1 -1
  97. package/dist/storage/clickhouse/database.d.ts +113 -115
  98. package/dist/storage/clickhouse/database.d.ts.map +1 -1
  99. package/dist/storage/clickhouse/database.js +65 -79
  100. package/dist/storage/clickhouse/database.js.map +1 -1
  101. package/dist/storage/clickhouse/errors.d.ts +25 -26
  102. package/dist/storage/clickhouse/errors.d.ts.map +1 -1
  103. package/dist/storage/clickhouse/errors.js +15 -17
  104. package/dist/storage/clickhouse/errors.js.map +1 -1
  105. package/dist/storage/clickhouse/mod.d.ts +10 -10
  106. package/dist/storage/clickhouse/mod.js +10 -10
  107. package/dist/storage/objects/bucket.d.ts +196 -225
  108. package/dist/storage/objects/bucket.d.ts.map +1 -1
  109. package/dist/storage/objects/bucket.js +71 -84
  110. package/dist/storage/objects/bucket.js.map +1 -1
  111. package/dist/storage/objects/error.d.ts +4 -4
  112. package/dist/storage/objects/error.js +4 -4
  113. package/dist/storage/postgres/database.d.ts +124 -149
  114. package/dist/storage/postgres/database.d.ts.map +1 -1
  115. package/dist/storage/postgres/database.js +98 -135
  116. package/dist/storage/postgres/database.js.map +1 -1
  117. package/dist/storage/postgres/errors.d.ts +42 -48
  118. package/dist/storage/postgres/errors.d.ts.map +1 -1
  119. package/dist/storage/postgres/errors.js +44 -51
  120. package/dist/storage/postgres/errors.js.map +1 -1
  121. package/dist/storage/postgres/interval.d.ts +19 -19
  122. package/dist/storage/postgres/interval.d.ts.map +1 -1
  123. package/dist/storage/postgres/interval.js +21 -21
  124. package/dist/storage/postgres/interval.js.map +1 -1
  125. package/dist/storage/redis/bitfield.d.ts +48 -23
  126. package/dist/storage/redis/bitfield.d.ts.map +1 -1
  127. package/dist/storage/redis/bitfield.js +38 -19
  128. package/dist/storage/redis/bitfield.js.map +1 -1
  129. package/dist/storage/redis/command.d.ts +16 -12
  130. package/dist/storage/redis/command.d.ts.map +1 -1
  131. package/dist/storage/redis/command.js +16 -12
  132. package/dist/storage/redis/command.js.map +1 -1
  133. package/dist/storage/redis/commands.d.ts +99 -100
  134. package/dist/storage/redis/commands.d.ts.map +1 -1
  135. package/dist/storage/redis/commands.js +84 -85
  136. package/dist/storage/redis/commands.js.map +1 -1
  137. package/dist/storage/redis/database.d.ts +138 -122
  138. package/dist/storage/redis/database.d.ts.map +1 -1
  139. package/dist/storage/redis/database.js +120 -101
  140. package/dist/storage/redis/database.js.map +1 -1
  141. package/dist/storage/redis/mod.d.ts +52 -48
  142. package/dist/storage/redis/mod.d.ts.map +1 -1
  143. package/dist/storage/redis/mod.js +52 -48
  144. package/dist/storage/redis/mod.js.map +1 -1
  145. package/dist/storage/redis/options.d.ts +26 -24
  146. package/dist/storage/redis/options.d.ts.map +1 -1
  147. package/dist/storage/redis/options.js.map +1 -1
  148. package/dist/storage/redis/pubsub.d.ts +16 -16
  149. package/dist/storage/redis/pubsub.d.ts.map +1 -1
  150. package/dist/storage/redis/pubsub.js +14 -14
  151. package/dist/storage/redis/pubsub.js.map +1 -1
  152. package/dist/storage/redis/reply.d.ts +80 -72
  153. package/dist/storage/redis/reply.d.ts.map +1 -1
  154. package/dist/storage/redis/reply.js +53 -46
  155. package/dist/storage/redis/reply.js.map +1 -1
  156. package/dist/storage/redis/scan.d.ts +4 -4
  157. package/dist/storage/redis/scan.d.ts.map +1 -1
  158. package/dist/storage/redis/scan.js +6 -6
  159. package/dist/storage/redis/scan.js.map +1 -1
  160. package/dist/storage/redis/script.d.ts +28 -21
  161. package/dist/storage/redis/script.d.ts.map +1 -1
  162. package/dist/storage/redis/script.js +29 -22
  163. package/dist/storage/redis/script.js.map +1 -1
  164. package/dist/storage/redis/target.d.ts +17 -1
  165. package/dist/storage/redis/target.d.ts.map +1 -1
  166. package/dist/storage/redis/target.js +30 -1
  167. package/dist/storage/redis/target.js.map +1 -1
  168. package/dist/storage/redis/wire.d.ts +6 -6
  169. package/dist/storage/redis/wire.d.ts.map +1 -1
  170. package/dist/storage/redis/wire.js +6 -6
  171. package/dist/storage/redis/wire.js.map +1 -1
  172. package/dist/testing/mod.d.ts +83 -88
  173. package/dist/testing/mod.d.ts.map +1 -1
  174. package/dist/testing/mod.js +75 -81
  175. package/dist/testing/mod.js.map +1 -1
  176. package/dist/testing/playwright.d.ts +28 -32
  177. package/dist/testing/playwright.d.ts.map +1 -1
  178. package/dist/testing/playwright.js +22 -27
  179. package/dist/testing/playwright.js.map +1 -1
  180. package/dist/testing/puppeteer.d.ts +11 -12
  181. package/dist/testing/puppeteer.d.ts.map +1 -1
  182. package/dist/testing/puppeteer.js +17 -18
  183. package/dist/testing/puppeteer.js.map +1 -1
  184. package/dist/testing/system.d.ts +72 -90
  185. package/dist/testing/system.d.ts.map +1 -1
  186. package/dist/testing/system.js +90 -107
  187. package/dist/testing/system.js.map +1 -1
  188. package/dist/tsconfig.build.tsbuildinfo +1 -1
  189. package/frontends/mod.test.ts +6 -2
  190. package/frontends/mod.ts +20 -19
  191. package/gateway/errors.ts +30 -32
  192. package/gateway/match.ts +61 -57
  193. package/gateway/middleware.ts +62 -64
  194. package/gateway/mod.ts +73 -76
  195. package/gateway/request.ts +143 -140
  196. package/gateway/serve.ts +58 -63
  197. package/gateways/mod.ts +25 -23
  198. package/internal/runtime/napi/napi.cjs +1 -1
  199. package/internal/runtime/napi/napi.d.cts +10 -3
  200. package/internal/runtime/shutdown.ts +113 -101
  201. package/log/logger.test.ts +8 -0
  202. package/log/logger.ts +48 -45
  203. package/metrics/mod.ts +138 -122
  204. package/otel.ts +6 -3
  205. package/package.json +1 -1
  206. package/pubsub/subscription.ts +93 -123
  207. package/pubsub/topic.ts +96 -130
  208. package/reqctx/mod.ts +83 -86
  209. package/services/index.ts +78 -78
  210. package/shutdown/mod.ts +26 -25
  211. package/storage/clickhouse/database.ts +115 -129
  212. package/storage/clickhouse/errors.ts +27 -29
  213. package/storage/clickhouse/mod.ts +10 -10
  214. package/storage/objects/bucket.ts +209 -239
  215. package/storage/objects/error.ts +4 -4
  216. package/storage/postgres/database.ts +131 -164
  217. package/storage/postgres/errors.ts +45 -52
  218. package/storage/postgres/interval.ts +21 -21
  219. package/storage/redis/bitfield.ts +51 -26
  220. package/storage/redis/command.ts +16 -12
  221. package/storage/redis/commands.ts +99 -100
  222. package/storage/redis/database.ts +145 -123
  223. package/storage/redis/mod.ts +52 -48
  224. package/storage/redis/options.ts +26 -24
  225. package/storage/redis/pubsub.ts +14 -14
  226. package/storage/redis/redis.test.ts +17 -2
  227. package/storage/redis/reply.ts +85 -77
  228. package/storage/redis/scan.ts +6 -6
  229. package/storage/redis/script.ts +29 -22
  230. package/storage/redis/target.ts +34 -1
  231. package/storage/redis/wire.ts +8 -8
  232. package/testing/mod.ts +99 -105
  233. package/testing/playwright.ts +32 -37
  234. package/testing/puppeteer.ts +22 -23
  235. package/testing/system.ts +117 -133
@@ -1,22 +1,29 @@
1
1
  import type { Target } from './target.js';
2
2
  import { Cmd } from './wire.js';
3
- /** A bitfield integer's type: signed or unsigned, and its width: `"u8"`, `"i5"`. */
3
+ /**
4
+ * A bitfield integer type consisting of a signedness prefix (`"i"` or `"u"`)
5
+ * and a bit width, such as `"u8"` or `"i5"`.
6
+ */
4
7
  export type BitfieldType = `${'i' | 'u'}${number}`;
5
8
  /**
6
- * Where a bitfield integer starts: at a bit, or at a multiple of its type's
7
- * width (`"#2"` of a `u8` is bit 16).
9
+ * The starting position of a bitfield integer: either a bit index, or a
10
+ * multiple of the integer type's width (for example, `"#2"` for a `u8` is
11
+ * bit 16).
8
12
  */
9
13
  export type BitOffset = number | `#${number}`;
10
14
  /**
11
- * What a `set` or `incrBy` that leaves its type's range does, from the
12
- * `overflow` that says so on: wrap around (the default), stop at the type's
13
- * smallest or largest value, or fail, leaving the value as it was and replying
14
- * `null`.
15
+ * Controls how subsequent `set` and `incrBy` operations handle values that
16
+ * overflow their integer type's range:
17
+ *
18
+ * - `"wrap"`: wrap around (default)
19
+ * - `"sat"`: saturate at the type's minimum or maximum value
20
+ * - `"fail"`: leave the value unchanged and return `null`
15
21
  */
16
22
  export type Overflow = 'wrap' | 'sat' | 'fail';
17
23
  /**
18
- * A string's bitfield integers, read only (`BITFIELD_RO`), made by
19
- * `bitmap.bitfieldRo`: add the reads, then {@link BitfieldRo.invoke}.
24
+ * Builder for read-only bitfield operations (`BITFIELD_RO`), created by
25
+ * `bitmap.bitfieldRo`. Add reads with {@link BitfieldRo.get} and run them with
26
+ * {@link BitfieldRo.invoke}.
20
27
  */
21
28
  export declare class BitfieldRo {
22
29
  protected readonly t: Target;
@@ -26,25 +33,35 @@ export declare class BitfieldRo {
26
33
  /** Reads the integer of type `type` at `offset`. */
27
34
  get(type: BitfieldType, offset: BitOffset): this;
28
35
  /**
29
- * Runs the operations, replying one value per `get`, `set` and `incrBy`, in
30
- * order: `null` for one an `overflow('fail')` stopped. Throws a
31
- * `RangeError` for a value a `number` can't hold exactly.
36
+ * Executes the operations and returns one result per `get`, `set`, and
37
+ * `incrBy` in order (`null` for any operation aborted by
38
+ * `overflow('fail')`). Throws a `RangeError` if a returned value cannot be
39
+ * represented accurately as a JavaScript `number`.
32
40
  */
33
41
  invoke(): Promise<(number | null)[]>;
34
42
  }
35
43
  /**
36
- * A string's bitfield integers, made by `bitmap.bitfield`: add the
37
- * operations, which run in order as one command, then {@link Bitfield.invoke}.
44
+ * Builder for bitfield operations (`BITFIELD`), created by `bitmap.bitfield`.
45
+ * Add operations in order and execute them as a single command with
46
+ * {@link Bitfield.invoke}.
38
47
  */
39
48
  export declare class Bitfield extends BitfieldRo {
40
- /** Sets the integer of type `type` at `offset`, replying what it was. */
49
+ /**
50
+ * Sets the integer of type `type` at `offset` to `value` and returns its
51
+ * previous value.
52
+ */
41
53
  set(type: BitfieldType, offset: BitOffset, value: number | bigint): this;
42
- /** Adds `increment` to the integer at `offset`, replying what it is then. */
54
+ /**
55
+ * Adds `increment` to the integer of type `type` at `offset` and returns the
56
+ * new value.
57
+ */
43
58
  incrBy(type: BitfieldType, offset: BitOffset, increment: number | bigint): this;
44
- /** What the `set`s and `incrBy`s after this do when they leave their range. */
59
+ /**
60
+ * Sets the overflow behavior for subsequent `set` and `incrBy` operations.
61
+ */
45
62
  overflow(mode: Overflow): this;
46
63
  }
47
- /** A {@link BitfieldRo} being queued on a pipeline or a transaction. */
64
+ /** A {@link BitfieldRo} builder being queued on a pipeline or transaction. */
48
65
  export declare class QueuedBitfieldRo {
49
66
  protected readonly queued: Cmd[];
50
67
  protected readonly c: Cmd;
@@ -52,16 +69,24 @@ export declare class QueuedBitfieldRo {
52
69
  constructor(queued: Cmd[], c: Cmd);
53
70
  /** Reads the integer of type `type` at `offset`. */
54
71
  get(type: BitfieldType, offset: BitOffset): this;
55
- /** Queues the operations, as one command. */
72
+ /** Queues the accumulated operations as a single command. */
56
73
  queue(): void;
57
74
  }
58
- /** A {@link Bitfield} being queued on a pipeline or a transaction. */
75
+ /** A {@link Bitfield} builder being queued on a pipeline or transaction. */
59
76
  export declare class QueuedBitfield extends QueuedBitfieldRo {
60
- /** Sets the integer of type `type` at `offset`, replying what it was. */
77
+ /**
78
+ * Sets the integer of type `type` at `offset` to `value` and returns its
79
+ * previous value.
80
+ */
61
81
  set(type: BitfieldType, offset: BitOffset, value: number | bigint): this;
62
- /** Adds `increment` to the integer at `offset`, replying what it is then. */
82
+ /**
83
+ * Adds `increment` to the integer of type `type` at `offset` and returns the
84
+ * new value.
85
+ */
63
86
  incrBy(type: BitfieldType, offset: BitOffset, increment: number | bigint): this;
64
- /** What the `set`s and `incrBy`s after this do when they leave their range. */
87
+ /**
88
+ * Sets the overflow behavior for subsequent `set` and `incrBy` operations.
89
+ */
65
90
  overflow(mode: Overflow): this;
66
91
  }
67
92
  //# sourceMappingURL=bitfield.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bitfield.d.ts","sourceRoot":"","sources":["../../../storage/redis/bitfield.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AACrC,OAAO,EAAC,GAAG,EAA0B,MAAM,QAAQ,CAAC;AAEpD,oFAAoF;AACpF,MAAM,MAAM,YAAY,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,EAAE,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AA4C/C;;;GAGG;AACH,qBAAa,UAAU;IAGnB,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM;IAC5B,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG;IAH3B,gBAAgB;gBAEK,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,GAAG;IAG3B,oDAAoD;IACpD,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI;IAKhD;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CAG3C;AAED;;;GAGG;AACH,qBAAa,QAAS,SAAQ,UAAU;IACtC,yEAAyE;IACzE,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAKxE,6EAA6E;IAC7E,MAAM,CACJ,IAAI,EAAE,YAAY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ACH,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAKxE;;;OAGG;IACH,MAAM,CACJ,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,MAAM,GAAG,MAAM,GACzB,IAAI;IAKP;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;CAI/B"}
@@ -12,24 +12,25 @@ function incrBy(c, type, offset, increment) {
12
12
  function overflow(c, mode) {
13
13
  c.arg('OVERFLOW').arg(mode.toUpperCase());
14
14
  }
15
- /** A bitfield's replies, one per `get`, `set` and `incrBy`. */
15
+ /** A bitfield's replies, one per `get`, `set`, and `incrBy`. */
16
16
  function replies(v) {
17
17
  if (v instanceof ServerError)
18
18
  throw v;
19
19
  if (!Array.isArray(v))
20
- throw new TypeError('redis: BITFIELD replied no array');
20
+ throw new TypeError('redis: BITFIELD did not return an array');
21
21
  return v.map(item => {
22
22
  if (item === null)
23
23
  return null;
24
24
  if (typeof item === 'bigint' && !Number.isSafeInteger(Number(item))) {
25
- throw new RangeError(`redis: the bitfield integer ${item} does not fit a number`);
25
+ throw new RangeError(`redis: bitfield integer ${item} does not fit in a safe JavaScript number`);
26
26
  }
27
27
  return numberOf(item);
28
28
  });
29
29
  }
30
30
  /**
31
- * A string's bitfield integers, read only (`BITFIELD_RO`), made by
32
- * `bitmap.bitfieldRo`: add the reads, then {@link BitfieldRo.invoke}.
31
+ * Builder for read-only bitfield operations (`BITFIELD_RO`), created by
32
+ * `bitmap.bitfieldRo`. Add reads with {@link BitfieldRo.get} and run them with
33
+ * {@link BitfieldRo.invoke}.
33
34
  */
34
35
  export class BitfieldRo {
35
36
  t;
@@ -45,36 +46,46 @@ export class BitfieldRo {
45
46
  return this;
46
47
  }
47
48
  /**
48
- * Runs the operations, replying one value per `get`, `set` and `incrBy`, in
49
- * order: `null` for one an `overflow('fail')` stopped. Throws a
50
- * `RangeError` for a value a `number` can't hold exactly.
49
+ * Executes the operations and returns one result per `get`, `set`, and
50
+ * `incrBy` in order (`null` for any operation aborted by
51
+ * `overflow('fail')`). Throws a `RangeError` if a returned value cannot be
52
+ * represented accurately as a JavaScript `number`.
51
53
  */
52
54
  async invoke() {
53
55
  return replies(await this.t.run(this.c));
54
56
  }
55
57
  }
56
58
  /**
57
- * A string's bitfield integers, made by `bitmap.bitfield`: add the
58
- * operations, which run in order as one command, then {@link Bitfield.invoke}.
59
+ * Builder for bitfield operations (`BITFIELD`), created by `bitmap.bitfield`.
60
+ * Add operations in order and execute them as a single command with
61
+ * {@link Bitfield.invoke}.
59
62
  */
60
63
  export class Bitfield extends BitfieldRo {
61
- /** Sets the integer of type `type` at `offset`, replying what it was. */
64
+ /**
65
+ * Sets the integer of type `type` at `offset` to `value` and returns its
66
+ * previous value.
67
+ */
62
68
  set(type, offset, value) {
63
69
  set(this.c, type, offset, value);
64
70
  return this;
65
71
  }
66
- /** Adds `increment` to the integer at `offset`, replying what it is then. */
72
+ /**
73
+ * Adds `increment` to the integer of type `type` at `offset` and returns the
74
+ * new value.
75
+ */
67
76
  incrBy(type, offset, increment) {
68
77
  incrBy(this.c, type, offset, increment);
69
78
  return this;
70
79
  }
71
- /** What the `set`s and `incrBy`s after this do when they leave their range. */
80
+ /**
81
+ * Sets the overflow behavior for subsequent `set` and `incrBy` operations.
82
+ */
72
83
  overflow(mode) {
73
84
  overflow(this.c, mode);
74
85
  return this;
75
86
  }
76
87
  }
77
- /** A {@link BitfieldRo} being queued on a pipeline or a transaction. */
88
+ /** A {@link BitfieldRo} builder being queued on a pipeline or transaction. */
78
89
  export class QueuedBitfieldRo {
79
90
  queued;
80
91
  c;
@@ -88,24 +99,32 @@ export class QueuedBitfieldRo {
88
99
  get(this.c, type, offset);
89
100
  return this;
90
101
  }
91
- /** Queues the operations, as one command. */
102
+ /** Queues the accumulated operations as a single command. */
92
103
  queue() {
93
104
  this.queued.push(this.c);
94
105
  }
95
106
  }
96
- /** A {@link Bitfield} being queued on a pipeline or a transaction. */
107
+ /** A {@link Bitfield} builder being queued on a pipeline or transaction. */
97
108
  export class QueuedBitfield extends QueuedBitfieldRo {
98
- /** Sets the integer of type `type` at `offset`, replying what it was. */
109
+ /**
110
+ * Sets the integer of type `type` at `offset` to `value` and returns its
111
+ * previous value.
112
+ */
99
113
  set(type, offset, value) {
100
114
  set(this.c, type, offset, value);
101
115
  return this;
102
116
  }
103
- /** Adds `increment` to the integer at `offset`, replying what it is then. */
117
+ /**
118
+ * Adds `increment` to the integer of type `type` at `offset` and returns the
119
+ * new value.
120
+ */
104
121
  incrBy(type, offset, increment) {
105
122
  incrBy(this.c, type, offset, increment);
106
123
  return this;
107
124
  }
108
- /** What the `set`s and `incrBy`s after this do when they leave their range. */
125
+ /**
126
+ * Sets the overflow behavior for subsequent `set` and `incrBy` operations.
127
+ */
109
128
  overflow(mode) {
110
129
  overflow(this.c, mode);
111
130
  return this;
@@ -1 +1 @@
1
- {"version":3,"file":"bitfield.js","sourceRoot":"","sources":["../../../storage/redis/bitfield.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAM,WAAW,EAAa,MAAM,QAAQ,CAAC;AAmBpD,SAAS,GAAG,CAAC,CAAM,EAAE,IAAkB,EAAE,MAAiB;IACxD,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,GAAG,CACV,CAAM,EACN,IAAkB,EAClB,MAAiB,EACjB,KAAsB;IAEtB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,MAAM,CACb,CAAM,EACN,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EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,MAAM,CACJ,IAAkB,EAClB,MAAiB,EACjB,SAA0B;QAE1B,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,IAAc;QACrB,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -9,37 +9,41 @@ import { Cmd, type RedisArg } from './wire.js';
9
9
  */
10
10
  export declare function rawCommand(name: string, readOnly: boolean): Cmd;
11
11
  /**
12
- * A command the command groups lack, made by `command()`: give its arguments
13
- * in order with {@link CommandInvocation.key} and {@link CommandInvocation.arg},
14
- * then {@link CommandInvocation.invoke}.
12
+ * Builder for an arbitrary Redis command not covered by the typed command
13
+ * groups, created by `command()`. Pass arguments in order with
14
+ * {@link CommandInvocation.key} and {@link CommandInvocation.arg}, then execute
15
+ * with {@link CommandInvocation.invoke}.
15
16
  */
16
17
  export declare class CommandInvocation {
17
18
  private readonly t;
18
19
  private readonly c;
19
20
  /** @internal */
20
21
  constructor(t: Target, c: Cmd);
21
- /** The next argument, which is a key: it gets the database's prefix. */
22
+ /** Appends a key argument, automatically applying the database's key prefix. */
22
23
  key(key: string): this;
23
- /** The next argument, which is not a key: it is sent as it is. */
24
+ /** Appends a non-key argument as-is. */
24
25
  arg(arg: RedisArg): this;
25
26
  /**
26
- * Sends the command, replying what the server did, but for the keys the
27
- * pops and stream reads reply with, which lose the database's prefix. A
28
- * command the runtime refuses fails with a `TypeError` saying why.
27
+ * Sends the command and returns the server's reply. Note that keys returned
28
+ * by pop and stream-read commands have the database's key prefix stripped.
29
+ * Throws a `TypeError` with an explanation if the runtime rejects the
30
+ * command.
29
31
  */
30
32
  invoke(): ReplyPromise;
31
33
  }
32
- /** A command the command groups lack being queued on a pipeline or a transaction. */
34
+ /**
35
+ * Builder for queueing an arbitrary Redis command on a pipeline or transaction.
36
+ */
33
37
  export declare class QueuedCommandInvocation {
34
38
  private readonly queued;
35
39
  private readonly c;
36
40
  /** @internal */
37
41
  constructor(queued: Cmd[], c: Cmd);
38
- /** The next argument, which is a key: it gets the database's prefix. */
42
+ /** Appends a key argument, automatically applying the database's key prefix. */
39
43
  key(key: string): this;
40
- /** The next argument, which is not a key: it is sent as it is. */
44
+ /** Appends a non-key argument as-is. */
41
45
  arg(arg: RedisArg): this;
42
- /** Queues the command. */
46
+ /** Appends the command to the pipeline or transaction queue. */
43
47
  queue(): void;
44
48
  }
45
49
  //# sourceMappingURL=command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../storage/redis/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,YAAY,EAAC,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AACrC,OAAO,EAAC,GAAG,EAAE,KAAK,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,GAAG,CAK/D;AAED;;;;GAIG;AACH,qBAAa,iBAAiB;IAG1B,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClB,OAAO,CAAC,QAAQ,CAAC,CAAC;IAHpB,gBAAgB;gBAEG,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,GAAG;IAGzB,wEAAwE;IACxE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKtB,kEAAkE;IAClE,GAAG,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAKxB;;;;OAIG;IACH,MAAM,IAAI,YAAY;CAWvB;AAED,qFAAqF;AACrF,qBAAa,uBAAu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AG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKtB,wCAAwC;IACxC,GAAG,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAKxB,gEAAgE;IAChE,KAAK,IAAI,IAAI;CAGd"}
@@ -13,9 +13,10 @@ export function rawCommand(name, readOnly) {
13
13
  return c;
14
14
  }
15
15
  /**
16
- * A command the command groups lack, made by `command()`: give its arguments
17
- * in order with {@link CommandInvocation.key} and {@link CommandInvocation.arg},
18
- * then {@link CommandInvocation.invoke}.
16
+ * Builder for an arbitrary Redis command not covered by the typed command
17
+ * groups, created by `command()`. Pass arguments in order with
18
+ * {@link CommandInvocation.key} and {@link CommandInvocation.arg}, then execute
19
+ * with {@link CommandInvocation.invoke}.
19
20
  */
20
21
  export class CommandInvocation {
21
22
  t;
@@ -25,20 +26,21 @@ export class CommandInvocation {
25
26
  this.t = t;
26
27
  this.c = c;
27
28
  }
28
- /** The next argument, which is a key: it gets the database's prefix. */
29
+ /** Appends a key argument, automatically applying the database's key prefix. */
29
30
  key(key) {
30
31
  this.c.key(key);
31
32
  return this;
32
33
  }
33
- /** The next argument, which is not a key: it is sent as it is. */
34
+ /** Appends a non-key argument as-is. */
34
35
  arg(arg) {
35
36
  this.c.arg(arg);
36
37
  return this;
37
38
  }
38
39
  /**
39
- * Sends the command, replying what the server did, but for the keys the
40
- * pops and stream reads reply with, which lose the database's prefix. A
41
- * command the runtime refuses fails with a `TypeError` saying why.
40
+ * Sends the command and returns the server's reply. Note that keys returned
41
+ * by pop and stream-read commands have the database's key prefix stripped.
42
+ * Throws a `TypeError` with an explanation if the runtime rejects the
43
+ * command.
42
44
  */
43
45
  invoke() {
44
46
  return new ReplyPromise((async () => {
@@ -51,7 +53,9 @@ export class CommandInvocation {
51
53
  })());
52
54
  }
53
55
  }
54
- /** A command the command groups lack being queued on a pipeline or a transaction. */
56
+ /**
57
+ * Builder for queueing an arbitrary Redis command on a pipeline or transaction.
58
+ */
55
59
  export class QueuedCommandInvocation {
56
60
  queued;
57
61
  c;
@@ -60,17 +64,17 @@ export class QueuedCommandInvocation {
60
64
  this.queued = queued;
61
65
  this.c = c;
62
66
  }
63
- /** The next argument, which is a key: it gets the database's prefix. */
67
+ /** Appends a key argument, automatically applying the database's key prefix. */
64
68
  key(key) {
65
69
  this.c.key(key);
66
70
  return this;
67
71
  }
68
- /** The next argument, which is not a key: it is sent as it is. */
72
+ /** Appends a non-key argument as-is. */
69
73
  arg(arg) {
70
74
  this.c.arg(arg);
71
75
  return this;
72
76
  }
73
- /** Queues the command. */
77
+ /** Appends the command to the pipeline or transaction queue. */
74
78
  queue() {
75
79
  this.queued.push(this.c);
76
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../storage/redis/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAC,GAAG,EAAgB,MAAM,QAAQ,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,QAAiB;IACxD,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC;IACb,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACtB,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,iBAAiB;IAGT;IACA;IAHnB,gBAAgB;IAChB,YACmB,CAAS,EACT,CAAM;QADN,MAAC,GAAD,CAAC,CAAQ;QACT,MAAC,GAAD,CAAC,CAAK;IACtB,CAAC;IAEJ,wEAAwE;IACxE,GAAG,CAAC,GAAW;QACb,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,kEAAkE;IAClE,GAAG,CAAC,GAAa;QACf,IAAI,C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