@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
@@ -2,94 +2,95 @@
2
2
  /// <reference types="node" />
3
3
  import { Value } from './wire.js';
4
4
  /**
5
- * A reply as plain values: what {@link Reply.value} returns. A string reply is
6
- * text, an integer a `number` (a `bigint` past what a `number` holds exactly),
7
- * a map an object keyed by its keys' text, with no prototype.
5
+ * A Redis reply decoded into plain JavaScript values, as returned by
6
+ * {@link Reply.value}. Strings decode to UTF-8 text, integers decode to
7
+ * `number` (or `bigint` when outside the safe integer range), and maps decode
8
+ * to prototype-less objects keyed by their string keys.
8
9
  */
9
10
  export type RedisValue = null | string | number | bigint | boolean | RedisValue[] | {
10
11
  [key: string]: RedisValue;
11
12
  };
12
- /** A member of a sorted set, with its score. */
13
+ /** A sorted set member along with its score. */
13
14
  export interface ScoredMember {
14
15
  member: string;
15
16
  score: number;
16
17
  }
17
- /** A field of a hash, with its value. */
18
+ /** A hash field along with its value. */
18
19
  export interface FieldValue {
19
20
  field: string;
20
21
  value: string;
21
22
  }
22
- /** An entry of a stream: its id and its fields. */
23
+ /** A stream entry containing its ID and field-value pairs. */
23
24
  export interface StreamEntry {
24
25
  id: string;
25
26
  fields: Record<string, string>;
26
27
  }
27
- /** The entries read from one stream. */
28
+ /** Entries read from a single stream. */
28
29
  export interface Stream {
29
30
  key: string;
30
31
  entries: StreamEntry[];
31
32
  }
32
33
  /**
33
- * The summary of what a consumer group has been given and not acknowledged,
34
- * as `xpending` replies.
34
+ * Summary of pending (unacknowledged) entries for a consumer group, as
35
+ * returned by `xpending`.
35
36
  */
36
37
  export interface StreamPending {
37
- /** How many entries are pending. */
38
+ /** Number of pending entries. */
38
39
  count: number;
39
- /** The lowest pending id: `null` when nothing is pending. */
40
+ /** Lowest pending entry ID, or `null` if no entries are pending. */
40
41
  lowest: string | null;
41
- /** The highest pending id: `null` when nothing is pending. */
42
+ /** Highest pending entry ID, or `null` if no entries are pending. */
42
43
  highest: string | null;
43
- /** The consumers with pending entries, and how many each has. */
44
+ /** Consumers with pending entries and the pending count for each. */
44
45
  consumers: {
45
46
  name: string;
46
47
  pending: number;
47
48
  }[];
48
49
  }
49
- /** What the server knows about a stream, as `xinfoStream` replies. */
50
+ /** Metadata about a stream, as returned by `xinfoStream`. */
50
51
  export interface StreamInfo {
51
52
  length: number;
52
53
  radixTreeKeys: number;
53
54
  radixTreeNodes: number;
54
55
  groups: number;
55
56
  lastGeneratedId: string;
56
- /** `null` for an empty stream. */
57
+ /** The first entry in the stream, or `null` if the stream is empty. */
57
58
  firstEntry: StreamEntry | null;
58
- /** `null` for an empty stream. */
59
+ /** The last entry in the stream, or `null` if the stream is empty. */
59
60
  lastEntry: StreamEntry | null;
60
61
  }
61
- /** What `xautoclaim` replies. */
62
+ /** Result of an `xautoclaim` command. */
62
63
  export interface StreamAutoClaim {
63
64
  /**
64
- * The id to pass as the next call's start, or `"0-0"` when the scan of
65
- * pending entries is done.
65
+ * The cursor ID to pass as the starting point for the next call, or `"0-0"`
66
+ * when the pending entries scan is complete.
66
67
  */
67
68
  next: string;
68
- /** The entries now held by the consumer. */
69
+ /** The entries successfully claimed by the consumer. */
69
70
  claimed: StreamEntry[];
70
- /** The ids of pending entries that no longer exist. */
71
+ /** IDs of pending entries that no longer exist in the stream. */
71
72
  deleted: string[];
72
73
  }
73
74
  /**
74
- * What a blocking pop of one element replies: the key it came from, without
75
- * the database's prefix, and the element.
75
+ * Result of a blocking pop of a single element: the source key (with the
76
+ * database's prefix stripped) and the popped element.
76
77
  */
77
78
  export interface Popped {
78
79
  key: string;
79
80
  value: Reply;
80
81
  }
81
- /** What a blocking pop of several elements replies, in the order popped. */
82
+ /** Result of a blocking pop of multiple elements, in the order they were popped. */
82
83
  export interface PoppedMany {
83
84
  key: string;
84
85
  values: Reply[];
85
86
  }
86
- /** What a blocking pop of a sorted set's member replies. */
87
+ /** Result of a blocking pop of a single sorted set member. */
87
88
  export interface PoppedScored {
88
89
  key: string;
89
90
  member: Reply;
90
91
  score: number;
91
92
  }
92
- /** What a blocking pop of several of a sorted set's members replies. */
93
+ /** Result of a blocking pop of multiple sorted set members. */
93
94
  export interface PoppedScoredMany {
94
95
  key: string;
95
96
  members: {
@@ -97,19 +98,19 @@ export interface PoppedScoredMany {
97
98
  score: number;
98
99
  }[];
99
100
  }
100
- /** A position on Earth. */
101
+ /** Geographic coordinates (longitude and latitude). */
101
102
  export interface GeoPosition {
102
103
  longitude: number;
103
104
  latitude: number;
104
105
  }
105
- /** A member found by a radius search, with what the search asked for of it. */
106
+ /** A member matched by a geo radius search, with any requested metadata. */
106
107
  export interface GeoRadiusResult {
107
108
  name: string;
108
- /** The distance from the center, with `withDist`. */
109
+ /** Distance from the search center (present when `withDist` is enabled). */
109
110
  dist?: number;
110
- /** The member's geohash as an integer, with `withHash`. */
111
+ /** Geohash integer of the member (present when `withHash` is enabled). */
111
112
  hash?: bigint;
112
- /** The member's position, with `withCoord`. */
113
+ /** Coordinates of the member (present when `withCoord` is enabled). */
113
114
  coord?: GeoPosition;
114
115
  }
115
116
  export declare function textOf(v: Value): string;
@@ -119,10 +120,10 @@ export declare function arrayOf(v: Value): Value[];
119
120
  /** The members of a sorted set with their scores, nested in pairs or flat. */
120
121
  export declare function scoredMembersOf(items: Value[]): ScoredMember[];
121
122
  /**
122
- * What Redis replied to a command, or the error the command failed with. Read
123
- * it as what it holds: {@link Reply.text}, {@link Reply.number},
124
- * {@link Reply.textMap}, …; each throws the command's error if it failed, and
125
- * reads a nil reply as `null`.
123
+ * A Redis command reply, or the error the command failed with. Decode it into
124
+ * the expected type using methods such as {@link Reply.text},
125
+ * {@link Reply.number}, or {@link Reply.textMap}. Every accessor throws if the
126
+ * command failed and returns `null` for a nil reply.
126
127
  */
127
128
  export declare class Reply {
128
129
  private readonly reply;
@@ -131,86 +132,92 @@ export declare class Reply {
131
132
  constructor(reply: Value, err?: Error | undefined);
132
133
  /** @internal A reply for a command that could not be sent. */
133
134
  static failed(err: unknown): Reply;
134
- /** The error the command failed with, if it did. A nil reply is not one. */
135
+ /** The error the command failed with, if any. A nil reply is not an error. */
135
136
  get error(): Error | undefined;
136
- /** Whether the command succeeded and replied nil. */
137
+ /** Returns `true` if the command succeeded and returned nil. */
137
138
  isNull(): boolean;
138
139
  /** The reply, or the error it failed with, thrown. */
139
140
  private get v();
140
- /** The reply as plain values. */
141
+ /** Decodes the reply as plain JavaScript values. */
141
142
  value(): RedisValue;
142
- /** The reply as text: a string's bytes as UTF-8, or a number's digits. */
143
+ /** Decodes the reply as UTF-8 text (or stringified digits for a number). */
143
144
  text(): string | null;
144
- /** The reply as bytes. */
145
+ /** Returns the reply as raw bytes. */
145
146
  bytes(): Buffer | null;
146
147
  /**
147
- * The reply as a number, parsing a string that holds one. An integer past
148
- * what a `number` holds exactly is rounded: read it with
149
- * {@link Reply.bigint}.
148
+ * Decodes the reply as a number, parsing numeric strings if necessary.
149
+ * Integers outside the safe integer range lose precision; use
150
+ * {@link Reply.bigint} for exact 64-bit integers.
150
151
  */
151
152
  number(): number | null;
152
- /** The reply as an integer, parsing a string that holds one. */
153
+ /** Decodes the reply as a `bigint`, parsing numeric strings if necessary. */
153
154
  bigint(): bigint | null;
154
- /** The reply as a boolean: an integer is true unless 0, and `OK` is true. */
155
+ /** Decodes the reply as a boolean (non-zero integers and `"OK"` are `true`). */
155
156
  bool(): boolean | null;
156
- /** The reply's text, parsed as JSON. */
157
+ /** Decodes the reply as UTF-8 text and parses it as JSON. */
157
158
  json<T = unknown>(): T | null;
158
- /** An array reply as each of its elements, to read each as what it holds. */
159
+ /** Decodes an array reply as an array of {@link Reply} instances. */
159
160
  replies(): Reply[];
160
161
  /**
161
- * An array reply as text. A nil element throws; to tell missing elements
162
- * apart, use {@link Reply.optionalTexts}.
162
+ * Decodes an array reply as strings. Throws if any element is nil; use
163
+ * {@link Reply.optionalTexts} to preserve missing elements as `null`.
163
164
  */
164
165
  texts(): string[];
165
166
  /**
166
- * An array reply as text, a nil element as `null`: what `mget` and `hmget`
167
- * reply for a missing key or field.
167
+ * Decodes an array reply as strings, mapping nil elements to `null` (as
168
+ * returned by `mget` and `hmget` for missing keys or fields).
168
169
  */
169
170
  optionalTexts(): (string | null)[];
170
- /** An array reply as numbers. */
171
+ /** Decodes an array reply as numbers. */
171
172
  numbers(): number[];
172
- /** An array reply as booleans. */
173
+ /** Decodes an array reply as booleans. */
173
174
  bools(): boolean[];
174
175
  /**
175
- * A map reply, or an array of keys and values in turn, as an object: what
176
- * `hgetall` replies. The object has no prototype, so each field is its own
177
- * key, `__proto__` too.
176
+ * Decodes a map reply (or flat array of key-value pairs, as returned by
177
+ * `hgetall`) into a prototype-less object so keys like `__proto__` are
178
+ * handled safely.
178
179
  */
179
180
  textMap(): Record<string, string>;
180
181
  /**
181
- * The members of a sorted set with their scores, as `zrangeWithscores` and
182
- * `zpopmin` reply.
182
+ * Decodes sorted set members with their scores, as returned by
183
+ * `zrangeWithscores` and `zpopmin`.
183
184
  */
184
185
  scoredMembers(): ScoredMember[];
185
186
  /**
186
- * The entries of a stream, as `xrange`, `xrevrange` and `xclaim` reply.
187
+ * Decodes stream entries, as returned by `xrange`, `xrevrange`, and
188
+ * `xclaim`.
187
189
  */
188
190
  streamEntries(): StreamEntry[];
189
191
  /**
190
- * The entries read from each stream, as `xread` and `xreadGroup` reply. A
191
- * read that found nothing is no streams.
192
+ * Decodes entries grouped by stream, as returned by `xread` and
193
+ * `xreadGroup`. Returns an empty array if no entries were read.
192
194
  */
193
195
  streams(): Stream[];
194
- /** The reply of `xpending`. */
196
+ /** Decodes a pending-entries summary returned by `xpending`. */
195
197
  streamPending(): StreamPending;
196
- /** The reply of `xinfoStream`. */
198
+ /** Decodes stream metadata returned by `xinfoStream`. */
197
199
  streamInfo(): StreamInfo;
198
- /** The reply of `xautoclaim`. */
200
+ /** Decodes an `xautoclaim` reply. */
199
201
  streamAutoClaim(): StreamAutoClaim;
200
- /** The position of each member, a missing one as `null`, as `geoPos` replies. */
202
+ /**
203
+ * Decodes member positions returned by `geoPos`, with `null` for missing
204
+ * members.
205
+ */
201
206
  geoPositions(): (GeoPosition | null)[];
202
- /** The members a radius search found, as `geoRadius` replies. */
207
+ /** Decodes members matched by a `geoRadius` search. */
203
208
  geoRadius(): GeoRadiusResult[];
204
209
  }
205
210
  /**
206
- * A command's reply, on its way. Await it for the {@link Reply}, which
207
- * rejects if the command failed; or read it as what it holds straight away:
211
+ * A pending command reply. Await it directly to get the {@link Reply} (which
212
+ * rejects if the command fails), or chain a decoder method to read the value
213
+ * directly:
208
214
  *
209
215
  * ```ts
210
216
  * const name = await SESSIONS.string.get("name:1").text();
211
217
  * ```
212
218
  *
213
- * The command is sent when it is called, whether or not this is awaited.
219
+ * The command is sent immediately when called, whether or not the returned
220
+ * promise is awaited.
214
221
  */
215
222
  export declare class ReplyPromise implements PromiseLike<Reply> {
216
223
  private readonly reply;
@@ -263,11 +270,12 @@ export declare class ReplyPromise implements PromiseLike<Reply> {
263
270
  geoRadius(): Promise<GeoRadiusResult[]>;
264
271
  }
265
272
  /**
266
- * The error a pipeline or a transaction fails with when the server rejected
267
- * some of its commands. The others ran: Redis has no rollback.
273
+ * Error thrown by a pipeline or transaction when the server rejects one or
274
+ * more queued commands. The remaining commands still executed, as Redis does
275
+ * not support rollbacks.
268
276
  */
269
277
  export declare class BatchError extends Error {
270
- /** Every command's reply, in the order queued, each holding its own error. */
278
+ /** Replies for every queued command in order, including each command's error. */
271
279
  readonly replies: Reply[];
272
280
  /** @internal */
273
281
  constructor(replies: Reply[], first: Error);
@@ -1 +1 @@
1
- {"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../../storage/redis/reply.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAgC,KAAK,EAAC,MAAM,QAAQ,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,IAAI,GACJ,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,UAAU,EAAE,GACZ;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAC,CAAC;AAEhC,gDAAgD;AAChD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,yCAAyC;AACzC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,mDAAmD;AACnD,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,wCAAwC;AACxC,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IAC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O,CAAC,YAAY,EAAE,CAAC;IAIxC,uCAAuC;IACvC,aAAa,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAIvC,iCAAiC;IACjC,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAI5B,uCAAuC;IACvC,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC;IAIvC,oCAAoC;IACpC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC;IAIjC,yCAAyC;IACzC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC;IAI3C,sCAAsC;IACtC,YAAY,IAAI,OAAO,CAAC,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC;IAI/C,mCAAmC;IACnC,SAAS,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;CAGxC;AAED;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAE1B,gBAAgB;gBACJ,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK;CAU3C;AAED,6DAA6D;AAC7D,eAAO,MAAM,EAAE;IACb,yCAAyC;eAC9B,KAAK,KAAG,KAAK;cACd,KAAK,KAAG,IAAI;gBAGV,KAAK,KAAG,MAAM;wBACN,KAAK,KAAG,MAAM,GAAG,IAAI;cAE/B,KAAK,KAAG,OAAO;cACf,KAAK,KAAG,MAAM;eACb,KAAK,KAAG,OAAO,EAAE;gBAChB,KAAK,KAAG,MAAM,GAAG,IAAI;oBAIjB,KAAK,KAAG,UAAU,GAAG,IAAI;sBASvB,KAAK,KAAG,YAAY,GAAG,IAAI;0BAUvB,KAAK,KAAG,gBAAgB,GAAG,IAAI;CAYtD,CAAC"}
@@ -139,7 +139,7 @@ function dict() {
139
139
  function textMapOf(v) {
140
140
  const items = arrayOf(v);
141
141
  if (items.length % 2 !== 0) {
142
- throw new TypeError(`redis: an array of ${items.length} elements is not pairs`);
142
+ throw new TypeError(`redis: expected an even number of elements for key-value pairs, got ${items.length}`);
143
143
  }
144
144
  const out = dict();
145
145
  for (let i = 0; i < items.length; i += 2) {
@@ -159,7 +159,7 @@ export function scoredMembersOf(items) {
159
159
  });
160
160
  }
161
161
  if (items.length % 2 !== 0) {
162
- throw new TypeError(`redis: an array of ${items.length} elements is not members and scores`);
162
+ throw new TypeError(`redis: expected an even number of elements for members and scores, got ${items.length}`);
163
163
  }
164
164
  const out = [];
165
165
  for (let i = 0; i < items.length; i += 2) {
@@ -180,10 +180,10 @@ function geoPositionOf(v) {
180
180
  return { longitude: numberOf(parts[0]), latitude: numberOf(parts[1]) };
181
181
  }
182
182
  /**
183
- * What Redis replied to a command, or the error the command failed with. Read
184
- * it as what it holds: {@link Reply.text}, {@link Reply.number},
185
- * {@link Reply.textMap}, …; each throws the command's error if it failed, and
186
- * reads a nil reply as `null`.
183
+ * A Redis command reply, or the error the command failed with. Decode it into
184
+ * the expected type using methods such as {@link Reply.text},
185
+ * {@link Reply.number}, or {@link Reply.textMap}. Every accessor throws if the
186
+ * command failed and returns `null` for a nil reply.
187
187
  */
188
188
  export class Reply {
189
189
  reply;
@@ -197,11 +197,11 @@ export class Reply {
197
197
  static failed(err) {
198
198
  return new Reply(null, err instanceof Error ? err : new Error(String(err)));
199
199
  }
200
- /** The error the command failed with, if it did. A nil reply is not one. */
200
+ /** The error the command failed with, if any. A nil reply is not an error. */
201
201
  get error() {
202
202
  return (this.err ?? (this.reply instanceof ServerError ? this.reply : undefined));
203
203
  }
204
- /** Whether the command succeeded and replied nil. */
204
+ /** Returns `true` if the command succeeded and returned nil. */
205
205
  isNull() {
206
206
  return !this.err && this.reply === null;
207
207
  }
@@ -211,15 +211,15 @@ export class Reply {
211
211
  throw this.err;
212
212
  return this.reply;
213
213
  }
214
- /** The reply as plain values. */
214
+ /** Decodes the reply as plain JavaScript values. */
215
215
  value() {
216
216
  return plain(this.v);
217
217
  }
218
- /** The reply as text: a string's bytes as UTF-8, or a number's digits. */
218
+ /** Decodes the reply as UTF-8 text (or stringified digits for a number). */
219
219
  text() {
220
220
  return this.v === null ? null : textOf(this.v);
221
221
  }
222
- /** The reply as bytes. */
222
+ /** Returns the reply as raw bytes. */
223
223
  bytes() {
224
224
  const v = ok(this.v);
225
225
  if (v === null)
@@ -227,80 +227,81 @@ export class Reply {
227
227
  return Buffer.isBuffer(v) ? v : Buffer.from(textOf(v), 'utf8');
228
228
  }
229
229
  /**
230
- * The reply as a number, parsing a string that holds one. An integer past
231
- * what a `number` holds exactly is rounded: read it with
232
- * {@link Reply.bigint}.
230
+ * Decodes the reply as a number, parsing numeric strings if necessary.
231
+ * Integers outside the safe integer range lose precision; use
232
+ * {@link Reply.bigint} for exact 64-bit integers.
233
233
  */
234
234
  number() {
235
235
  return this.v === null ? null : numberOf(this.v);
236
236
  }
237
- /** The reply as an integer, parsing a string that holds one. */
237
+ /** Decodes the reply as a `bigint`, parsing numeric strings if necessary. */
238
238
  bigint() {
239
239
  return this.v === null ? null : bigintOf(this.v);
240
240
  }
241
- /** The reply as a boolean: an integer is true unless 0, and `OK` is true. */
241
+ /** Decodes the reply as a boolean (non-zero integers and `"OK"` are `true`). */
242
242
  bool() {
243
243
  return this.v === null ? null : boolOf(this.v);
244
244
  }
245
- /** The reply's text, parsed as JSON. */
245
+ /** Decodes the reply as UTF-8 text and parses it as JSON. */
246
246
  json() {
247
247
  const text = this.text();
248
248
  return text === null ? null : JSON.parse(text);
249
249
  }
250
- /** An array reply as each of its elements, to read each as what it holds. */
250
+ /** Decodes an array reply as an array of {@link Reply} instances. */
251
251
  replies() {
252
252
  return arrayOf(this.v).map(item => new Reply(item));
253
253
  }
254
254
  /**
255
- * An array reply as text. A nil element throws; to tell missing elements
256
- * apart, use {@link Reply.optionalTexts}.
255
+ * Decodes an array reply as strings. Throws if any element is nil; use
256
+ * {@link Reply.optionalTexts} to preserve missing elements as `null`.
257
257
  */
258
258
  texts() {
259
259
  return arrayOf(this.v).map(item => {
260
260
  if (item === null)
261
- throw new TypeError('redis: a nil element is not text');
261
+ throw new TypeError('redis: cannot read a nil element as text');
262
262
  return textOf(item);
263
263
  });
264
264
  }
265
265
  /**
266
- * An array reply as text, a nil element as `null`: what `mget` and `hmget`
267
- * reply for a missing key or field.
266
+ * Decodes an array reply as strings, mapping nil elements to `null` (as
267
+ * returned by `mget` and `hmget` for missing keys or fields).
268
268
  */
269
269
  optionalTexts() {
270
270
  return arrayOf(this.v).map(item => (item === null ? null : textOf(item)));
271
271
  }
272
- /** An array reply as numbers. */
272
+ /** Decodes an array reply as numbers. */
273
273
  numbers() {
274
274
  return arrayOf(this.v).map(numberOf);
275
275
  }
276
- /** An array reply as booleans. */
276
+ /** Decodes an array reply as booleans. */
277
277
  bools() {
278
278
  return arrayOf(this.v).map(boolOf);
279
279
  }
280
280
  /**
281
- * A map reply, or an array of keys and values in turn, as an object: what
282
- * `hgetall` replies. The object has no prototype, so each field is its own
283
- * key, `__proto__` too.
281
+ * Decodes a map reply (or flat array of key-value pairs, as returned by
282
+ * `hgetall`) into a prototype-less object so keys like `__proto__` are
283
+ * handled safely.
284
284
  */
285
285
  textMap() {
286
286
  return textMapOf(this.v);
287
287
  }
288
288
  /**
289
- * The members of a sorted set with their scores, as `zrangeWithscores` and
290
- * `zpopmin` reply.
289
+ * Decodes sorted set members with their scores, as returned by
290
+ * `zrangeWithscores` and `zpopmin`.
291
291
  */
292
292
  scoredMembers() {
293
293
  return scoredMembersOf(arrayOf(this.v));
294
294
  }
295
295
  /**
296
- * The entries of a stream, as `xrange`, `xrevrange` and `xclaim` reply.
296
+ * Decodes stream entries, as returned by `xrange`, `xrevrange`, and
297
+ * `xclaim`.
297
298
  */
298
299
  streamEntries() {
299
300
  return arrayOf(this.v).map(streamEntryOf);
300
301
  }
301
302
  /**
302
- * The entries read from each stream, as `xread` and `xreadGroup` reply. A
303
- * read that found nothing is no streams.
303
+ * Decodes entries grouped by stream, as returned by `xread` and
304
+ * `xreadGroup`. Returns an empty array if no entries were read.
304
305
  */
305
306
  streams() {
306
307
  const v = ok(this.v);
@@ -319,7 +320,7 @@ export class Reply {
319
320
  entries: arrayOf(entries).map(streamEntryOf),
320
321
  }));
321
322
  }
322
- /** The reply of `xpending`. */
323
+ /** Decodes a pending-entries summary returned by `xpending`. */
323
324
  streamPending() {
324
325
  const parts = arrayOf(this.v);
325
326
  if (parts.length !== 4)
@@ -339,7 +340,7 @@ export class Reply {
339
340
  }),
340
341
  };
341
342
  }
342
- /** The reply of `xinfoStream`. */
343
+ /** Decodes stream metadata returned by `xinfoStream`. */
343
344
  streamInfo() {
344
345
  const items = arrayOf(this.v);
345
346
  const out = {
@@ -379,7 +380,7 @@ export class Reply {
379
380
  }
380
381
  return out;
381
382
  }
382
- /** The reply of `xautoclaim`. */
383
+ /** Decodes an `xautoclaim` reply. */
383
384
  streamAutoClaim() {
384
385
  const parts = arrayOf(this.v);
385
386
  if (parts.length < 2)
@@ -390,11 +391,14 @@ export class Reply {
390
391
  deleted: parts.length > 2 ? arrayOf(parts[2]).map(textOf) : [],
391
392
  };
392
393
  }
393
- /** The position of each member, a missing one as `null`, as `geoPos` replies. */
394
+ /**
395
+ * Decodes member positions returned by `geoPos`, with `null` for missing
396
+ * members.
397
+ */
394
398
  geoPositions() {
395
399
  return arrayOf(this.v).map(item => item === null ? null : geoPositionOf(item));
396
400
  }
397
- /** The members a radius search found, as `geoRadius` replies. */
401
+ /** Decodes members matched by a `geoRadius` search. */
398
402
  geoRadius() {
399
403
  return arrayOf(this.v).map(item => {
400
404
  // A plain name without any of withDist, withHash and withCoord;
@@ -419,14 +423,16 @@ export class Reply {
419
423
  }
420
424
  }
421
425
  /**
422
- * A command's reply, on its way. Await it for the {@link Reply}, which
423
- * rejects if the command failed; or read it as what it holds straight away:
426
+ * A pending command reply. Await it directly to get the {@link Reply} (which
427
+ * rejects if the command fails), or chain a decoder method to read the value
428
+ * directly:
424
429
  *
425
430
  * ```ts
426
431
  * const name = await SESSIONS.string.get("name:1").text();
427
432
  * ```
428
433
  *
429
- * The command is sent when it is called, whether or not this is awaited.
434
+ * The command is sent immediately when called, whether or not the returned
435
+ * promise is awaited.
430
436
  */
431
437
  export class ReplyPromise {
432
438
  reply;
@@ -535,11 +541,12 @@ export class ReplyPromise {
535
541
  }
536
542
  }
537
543
  /**
538
- * The error a pipeline or a transaction fails with when the server rejected
539
- * some of its commands. The others ran: Redis has no rollback.
544
+ * Error thrown by a pipeline or transaction when the server rejects one or
545
+ * more queued commands. The remaining commands still executed, as Redis does
546
+ * not support rollbacks.
540
547
  */
541
548
  export class BatchError extends Error {
542
- /** Every command's reply, in the order queued, each holding its own error. */
549
+ /** Replies for every queued command in order, including each command's error. */
543
550
  replies;
544
551
  /** @internal */
545
552
  constructor(replies, first) {
@@ -601,11 +608,11 @@ function popParts(v, n) {
601
608
  return null;
602
609
  const parts = arrayOf(v);
603
610
  if (parts.length !== n) {
604
- throw new TypeError(`redis: a pop replied ${parts.length} values, not ${n}`);
611
+ throw new TypeError(`redis: expected ${n} values in pop reply, got ${parts.length}`);
605
612
  }
606
613
  return parts;
607
614
  }
608
615
  function nilErr() {
609
- throw new TypeError('redis: the command replied nil');
616
+ throw new TypeError('redis: command returned an unexpected nil reply');
610
617
  }
611
618
  //# sourceMappingURL=reply.js.map