@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
@@ -16,26 +16,22 @@ function batchReplies(values) {
16
16
  // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
17
17
  export class ReadOnlyDatabaseRef {
18
18
  t;
19
- primary;
20
19
  /** @internal */
21
- constructor(t, groups,
22
- /**
23
- * The runtime gives a database one pool for now, on the primary, which
24
- * every handle shares.
25
- */
26
- primary) {
20
+ constructor(t, groups) {
27
21
  this.t = t;
28
- this.primary = primary;
29
22
  Object.assign(this, groups);
30
23
  }
31
- /** A call to `script`, which must be one made by {@link Script.readOnly}. */
24
+ /**
25
+ * Prepares an invocation of `script`, which must have been created with
26
+ * {@link Script.readOnly}.
27
+ */
32
28
  script(script) {
33
29
  return new Invocation(this.t, script, true);
34
30
  }
35
31
  /**
36
- * A command the command groups lack, by its name, as
37
- * {@link DatabaseRef.command} sends one. Only a command Redis says doesn't
38
- * write is sent.
32
+ * Prepares an arbitrary Redis command that is not covered by the typed
33
+ * command groups, as described in {@link DatabaseRef.command}. Only commands
34
+ * that Redis marks as read-only are allowed.
39
35
  */
40
36
  command(name) {
41
37
  return new CommandInvocation(this.t, rawCommand(name, true));
@@ -56,9 +52,9 @@ export class DatabaseRef {
56
52
  Object.assign(this, groups);
57
53
  }
58
54
  /**
59
- * A batch of commands sent in one round trip. Not a transaction: other
60
- * clients' commands may run between them, and one failing does not stop
61
- * the rest.
55
+ * Creates a pipeline that sends a batch of commands in a single round trip.
56
+ * A pipeline is not a transaction: commands from other clients may run
57
+ * between queued commands, and one failing command does not stop the rest.
62
58
  *
63
59
  * ```ts
64
60
  * const pipe = SESSIONS.pipeline();
@@ -71,11 +67,11 @@ export class DatabaseRef {
71
67
  return new Pipeline(this.t);
72
68
  }
73
69
  /**
74
- * A transaction (`MULTI`/`EXEC`): the commands queued on it run together,
75
- * with no other client's in between.
70
+ * Creates a transaction (`MULTI`/`EXEC`) whose queued commands run together
71
+ * without commands from other clients interleaving between them.
76
72
  *
77
- * Nothing is sent until {@link Transaction.exec}, so a transaction is never
78
- * left open while the code waits on something else.
73
+ * Nothing is sent until {@link Transaction.exec} is called, so a transaction
74
+ * is never held open while your code awaits other work.
79
75
  *
80
76
  * ```ts
81
77
  * const tx = LEDGER.transaction();
@@ -88,19 +84,19 @@ export class DatabaseRef {
88
84
  return new Transaction(this.t);
89
85
  }
90
86
  /**
91
- * Takes a connection out of the pool, for what must run on one connection:
92
- * watching keys, then a transaction that depends on them. Return it with
93
- * {@link Connection.close}, or declare it with `await using`.
87
+ * Acquires a dedicated connection from the pool for operations that must run
88
+ * on the same connection, such as watching keys before a transaction. Return
89
+ * it with {@link Connection.close}, or manage it with `await using`.
94
90
  */
95
91
  async acquire() {
96
92
  const impl = await this.t.database().acquire(activeCtxBytes());
97
93
  return new Connection(impl, this.t);
98
94
  }
99
95
  /**
100
- * Runs `body` as an optimistic transaction on `keys`: `body` reads what it
101
- * needs through the connection and queues its changes on the transaction,
102
- * and the changes are applied only if none of `keys` changed in between. If
103
- * one did, `body` runs again.
96
+ * Runs `body` as an optimistic transaction watching `keys`. `body` reads
97
+ * values through the connection and queues writes on the transaction; the
98
+ * transaction commits only if none of `keys` changed in the meantime. If a
99
+ * watched key changes, `body` is retried.
104
100
  *
105
101
  * ```ts
106
102
  * const left = await LEDGER.watch(["balance"], async (conn, tx) => {
@@ -123,50 +119,57 @@ export class DatabaseRef {
123
119
  if ((await tx.exec()) !== null)
124
120
  return out;
125
121
  }
126
- throw new Error(`redis: the watched keys kept changing: gave up after ${attempts} attempts`);
122
+ throw new Error(`redis: watched keys kept changing; gave up after ${attempts} attempts`);
127
123
  }
128
124
  finally {
129
125
  await conn.close();
130
126
  }
131
127
  }
132
- /** A call to `script`, to give its keys and arguments and then invoke. */
128
+ /**
129
+ * Prepares an invocation of `script` so you can attach its keys and
130
+ * arguments and then invoke it.
131
+ */
133
132
  script(script) {
134
133
  return new Invocation(this.t, script, false);
135
134
  }
136
135
  /**
137
- * A command the command groups lack, by its name, which must be a string
138
- * literal: give its arguments in order, marking the keys, then invoke it.
136
+ * Prepares an arbitrary Redis command that is not covered by the typed
137
+ * command groups. Pass the command name as a string literal, add its
138
+ * arguments in order (marking keys with `key()`), and then call `invoke()`.
139
139
  *
140
140
  * ```ts
141
141
  * const freq = await SESSIONS.command("OBJECT").arg("FREQ").key("hot").invoke().number();
142
142
  * ```
143
143
  *
144
- * Encore reads the name to grant the access the command needs. Before it is
145
- * sent, the runtime checks it against Redis's command table, and fails it
146
- * with a `TypeError` if a key it takes isn't passed with `key`, which gives
147
- * it the database's prefix, or if it is one that would reach past the
148
- * database, change a connection other calls share, or has a call of its own
149
- * here (`MULTI`, `SUBSCRIBE`, `EVAL`, `SCAN`, `FLUSHALL`, …). A command the
150
- * table doesn't know, such as a module's, is sent with its keys as marked.
144
+ * Encore reads the command name statically to grant the required access.
145
+ * Before sending the command, the runtime checks it against Redis's command
146
+ * table and throws a `TypeError` if a required key argument was not passed
147
+ * with `key()` (which applies the database's key prefix), or if the command
148
+ * reaches outside the database, modifies a shared connection, or already has
149
+ * a dedicated API (`MULTI`, `SUBSCRIBE`, `EVAL`, `SCAN`, `FLUSHALL`, …).
150
+ * Unknown commands, such as module commands, are sent with their keys as
151
+ * marked.
151
152
  */
152
153
  command(name) {
153
154
  return new CommandInvocation(this.t, rawCommand(name, false));
154
155
  }
155
156
  /**
156
- * The connection string to connect to this database with, for a client
157
- * other than this SDK.
157
+ * The connection string for connecting to this database from an external
158
+ * client.
158
159
  *
159
- * It connects past the database's key prefix: what that client stores under
160
- * a name is not what this SDK reads under it.
160
+ * Note that external clients connect without the database's key prefix, so
161
+ * keys stored by an external client will not match keys read by this SDK
162
+ * under the same names.
161
163
  */
162
164
  get connectionString() {
163
165
  return this.t.database().connectionUrl();
164
166
  }
165
167
  }
166
168
  /**
167
- * A Redis database, backed by a connection pool built on first use.
169
+ * A Redis database backed by a connection pool created on first use.
168
170
  *
169
- * Declare it at module scope; its commands are in its command groups:
171
+ * Declare databases at module scope and run commands through their command
172
+ * groups:
170
173
  *
171
174
  * ```ts
172
175
  * import { Database } from "@encore.dev/sdk/storage/redis";
@@ -178,15 +181,16 @@ export class DatabaseRef {
178
181
  * ```
179
182
  */
180
183
  export class Database extends DatabaseRef {
181
- readGroups;
184
+ reader;
185
+ primaryReader;
182
186
  /**
183
187
  * Declares a Redis database.
184
188
  *
185
- * Encore reads the name and the configuration from the declaration, so both
186
- * must be literals, and the database must be declared at module scope.
189
+ * Encore reads the name and configuration statically from the declaration, so
190
+ * both must be literals and the database must be declared at module scope.
187
191
  *
188
- * The name must be unique within the Encore application, and be kebab-case.
189
- * Once deployed, never change it: a new database would be created under the
192
+ * The name must be unique within the Encore application and use kebab-case.
193
+ * Once deployed, never rename it — doing so creates a new database under the
190
194
  * new name.
191
195
  */
192
196
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -198,36 +202,38 @@ export class Database extends DatabaseRef {
198
202
  * References an existing database by name. To declare a new database, use
199
203
  * `new Database(...)` instead.
200
204
  *
201
- * The name must be a string literal, so Encore can resolve it statically. A
202
- * named database takes no configuration: it is configured where it is
205
+ * The name must be a string literal so Encore can resolve it statically. A
206
+ * referenced database takes no configuration; it is configured where it is
203
207
  * declared.
204
208
  */
205
209
  static named(name) {
206
210
  return new Database(name);
207
211
  }
208
- /** A handle to the database that can read and write. */
212
+ /** Returns a read-write handle to the database. */
209
213
  write() {
210
214
  return new DatabaseRef(this.t, this.groups);
211
215
  }
212
216
  /**
213
- * A handle to the database that can only read, which may connect to a read
214
- * replica. To always read from the primary server, use
215
- * {@link Database.readPrimary}.
217
+ * Returns a read-only handle to the database. Reads from a read replica when
218
+ * a read-only connection pool is configured, and from the primary server
219
+ * otherwise. Write commands are rejected before being sent. To always read
220
+ * from the primary server, use {@link Database.readPrimary}.
216
221
  */
217
222
  read() {
218
- return new ReadOnlyDatabaseRef(this.t, this.readOnlyGroups(), false);
223
+ return (this.reader ??= readOnlyRef(this.t.reader(false)));
219
224
  }
220
225
  /**
221
- * A handle to the database that can only read, and connects to the primary
222
- * server even if there are read replicas available.
226
+ * Returns a read-only handle to the database that always reads from the
227
+ * primary server, even when read replicas are available. Write commands are
228
+ * rejected before being sent.
223
229
  */
224
230
  readPrimary() {
225
- return new ReadOnlyDatabaseRef(this.t, this.readOnlyGroups(), true);
226
- }
227
- readOnlyGroups() {
228
- return (this.readGroups ??= readCommandGroups(this.t));
231
+ return (this.primaryReader ??= readOnlyRef(this.t.reader(true)));
229
232
  }
230
233
  }
234
+ function readOnlyRef(t) {
235
+ return new ReadOnlyDatabaseRef(t, readCommandGroups(t));
236
+ }
231
237
  // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
232
238
  export class Pipeline {
233
239
  t;
@@ -237,27 +243,29 @@ export class Pipeline {
237
243
  this.t = t;
238
244
  Object.assign(this, queueGroups(this.queued));
239
245
  }
240
- /** How many commands are queued. */
246
+ /** The number of commands currently queued. */
241
247
  get length() {
242
248
  return this.queued.length;
243
249
  }
244
- /** Queues a call to `script`. Finish it with {@link QueuedInvocation.queue}. */
250
+ /**
251
+ * Prepares a call to `script` to be queued on this pipeline. Call
252
+ * {@link QueuedInvocation.queue} to append it.
253
+ */
245
254
  script(script) {
246
255
  return new QueuedInvocation(this.queued, script);
247
256
  }
248
257
  /**
249
- * Queues a command the command groups lack, by its name: see
250
- * {@link DatabaseRef.command}. Finish it with
251
- * {@link QueuedCommandInvocation.queue}. A command that blocks can't be
252
- * queued: the batch fails.
258
+ * Prepares an arbitrary Redis command (see {@link DatabaseRef.command}) to
259
+ * be queued on this pipeline. Call {@link QueuedCommandInvocation.queue} to
260
+ * append it. Blocking commands cannot be queued and will fail the batch.
253
261
  */
254
262
  command(name) {
255
263
  return new QueuedCommandInvocation(this.queued, rawCommand(name, false));
256
264
  }
257
265
  /**
258
- * Sends the queued commands and returns their replies, in order. If the
259
- * server rejected any, fails with a {@link BatchError} holding them all.
260
- * The pipeline is empty afterwards.
266
+ * Sends all queued commands and returns their replies in order. If the server
267
+ * rejects any command, throws a {@link BatchError} containing all replies.
268
+ * Clears the pipeline afterwards.
261
269
  */
262
270
  async exec() {
263
271
  const values = await this.t.runAll(this.queued.splice(0), false);
@@ -273,35 +281,38 @@ export class Transaction {
273
281
  this.t = t;
274
282
  Object.assign(this, queueGroups(this.queued));
275
283
  }
276
- /** How many commands are queued. */
284
+ /** The number of commands currently queued. */
277
285
  get length() {
278
286
  return this.queued.length;
279
287
  }
280
- /** Queues a call to `script`. Finish it with {@link QueuedInvocation.queue}. */
288
+ /**
289
+ * Prepares a call to `script` to be queued on this transaction. Call
290
+ * {@link QueuedInvocation.queue} to append it.
291
+ */
281
292
  script(script) {
282
293
  return new QueuedInvocation(this.queued, script);
283
294
  }
284
295
  /**
285
- * Queues a command the command groups lack, by its name: see
286
- * {@link DatabaseRef.command}. Finish it with
287
- * {@link QueuedCommandInvocation.queue}. A command that blocks can't be
288
- * queued: the batch fails.
296
+ * Prepares an arbitrary Redis command (see {@link DatabaseRef.command}) to
297
+ * be queued on this transaction. Call {@link QueuedCommandInvocation.queue}
298
+ * to append it. Blocking commands cannot be queued and will fail the batch.
289
299
  */
290
300
  command(name) {
291
301
  return new QueuedCommandInvocation(this.queued, rawCommand(name, false));
292
302
  }
293
303
  /**
294
- * Runs the queued commands as one transaction and returns their replies, as
295
- * {@link Pipeline.exec} does. A command the server rejects when it runs does
296
- * not stop the others: Redis has no rollback.
304
+ * Runs all queued commands as a single transaction and returns their replies,
305
+ * matching {@link Pipeline.exec}. If the server rejects a command during
306
+ * execution, the remaining commands still run — Redis does not support
307
+ * rollbacks.
297
308
  */
298
309
  async exec() {
299
310
  const values = await this.t.runAll(this.queued.splice(0), true);
300
311
  return batchReplies(values ?? []);
301
312
  }
302
313
  /**
303
- * Abandons the transaction. Nothing was sent, so there is nothing to undo:
304
- * this empties the queue.
314
+ * Discards the transaction by clearing its queue. Because nothing has been
315
+ * sent yet, there is nothing to undo on the server.
305
316
  */
306
317
  discard() {
307
318
  this.queued.splice(0);
@@ -316,28 +327,30 @@ export class WatchedTransaction {
316
327
  this.t = t;
317
328
  Object.assign(this, queueGroups(this.queued));
318
329
  }
319
- /** How many commands are queued. */
330
+ /** The number of commands currently queued. */
320
331
  get length() {
321
332
  return this.queued.length;
322
333
  }
323
- /** Queues a call to `script`. Finish it with {@link QueuedInvocation.queue}. */
334
+ /**
335
+ * Prepares a call to `script` to be queued on this transaction. Call
336
+ * {@link QueuedInvocation.queue} to append it.
337
+ */
324
338
  script(script) {
325
339
  return new QueuedInvocation(this.queued, script);
326
340
  }
327
341
  /**
328
- * Queues a command the command groups lack, by its name: see
329
- * {@link DatabaseRef.command}. Finish it with
330
- * {@link QueuedCommandInvocation.queue}. A command that blocks can't be
331
- * queued: the batch fails.
342
+ * Prepares an arbitrary Redis command (see {@link DatabaseRef.command}) to
343
+ * be queued on this transaction. Call {@link QueuedCommandInvocation.queue}
344
+ * to append it. Blocking commands cannot be queued and will fail the batch.
332
345
  */
333
346
  command(name) {
334
347
  return new QueuedCommandInvocation(this.queued, rawCommand(name, false));
335
348
  }
336
349
  /**
337
- * Runs the queued commands as one transaction and returns their replies, as
338
- * {@link Transaction.exec} does, or `null` if a watched key changed, in
339
- * which case none of them ran. Either way the connection watches nothing
340
- * afterwards.
350
+ * Runs all queued commands as a single transaction and returns their replies
351
+ * (as in {@link Transaction.exec}), or `null` if a watched key changed (in
352
+ * which case none of the commands ran). Either way, all watches on the
353
+ * connection are cleared afterwards.
341
354
  */
342
355
  async exec() {
343
356
  const values = await this.t.runAll(this.queued.splice(0), true);
@@ -355,38 +368,44 @@ export class Connection {
355
368
  Object.assign(this, commandGroups(this.t));
356
369
  }
357
370
  /**
358
- * Watches `keys`: a {@link Connection.transaction} then does nothing if any
359
- * of them has changed by the time it is run.
371
+ * Watches `keys` for changes. A subsequent {@link Connection.transaction}
372
+ * will abort without running if any watched key changes before `exec()`.
360
373
  */
361
374
  async watch(...keys) {
362
375
  await this.impl.watch(encodeList(keys), activeCtxBytes());
363
376
  }
364
- /** Stops watching every key. */
377
+ /** Stops watching all keys on this connection. */
365
378
  async unwatch() {
366
379
  await this.impl.unwatch(activeCtxBytes());
367
380
  }
368
- /** A transaction on this connection, which depends on the keys it watches. */
381
+ /**
382
+ * Creates a transaction on this connection that depends on its watched keys.
383
+ */
369
384
  transaction() {
370
385
  return new WatchedTransaction(this.t);
371
386
  }
372
- /** A batch of commands sent in one round trip on this connection. */
387
+ /**
388
+ * Creates a pipeline that sends a batch of commands in a single round trip
389
+ * on this connection.
390
+ */
373
391
  pipeline() {
374
392
  return new Pipeline(this.t);
375
393
  }
376
- /** A call to `script` on this connection. */
394
+ /** Prepares an invocation of `script` on this connection. */
377
395
  script(script) {
378
396
  return new Invocation(this.t, script, false);
379
397
  }
380
398
  /**
381
- * A command the command groups lack, on this connection: see
382
- * {@link DatabaseRef.command}. One that blocks is refused here.
399
+ * Prepares an arbitrary Redis command on this connection (see
400
+ * {@link DatabaseRef.command}). Blocking commands are not allowed on an
401
+ * acquired connection.
383
402
  */
384
403
  command(name) {
385
404
  return new CommandInvocation(this.t, rawCommand(name, false));
386
405
  }
387
406
  /**
388
- * Returns the connection to its pool. Keys it still watches are unwatched
389
- * first.
407
+ * Returns the connection to its pool, automatically unwatching any keys that
408
+ * are still watched.
390
409
  */
391
410
  async close() {
392
411
  await this.impl.release();
@@ -1 +1 @@
1
- {"version":3,"file":"database.js","sourceRoot":"","sources":["../../../storage/redis/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EACL,aAAa,EACb,WAAW,EACX,iBAAiB,GAIlB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,UAAU,GACX,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,UAAU,EAAE,KAAK,EAAC,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAS,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAE,UAAU,EAAc,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAC,UAAU,EAAuB,MAAM,QAAQ,CAAC;AAsBxD,6EAA6E;AAC7E,SAAS,YAAY,CAAC,MAAe;IACnC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,MAAM;QAAE,MAAM,IAAI,UAAU,C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CAAC;QACpC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAK,CAAC,GAAG,IAAc;QAC3B,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,kDAAkD;IAClD,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACH,QAAQ;QACN,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,6DAA6D;IAC7D,MAAM,CAAC,MAAc;QACnB,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACH,OAAO,CAAmB,IAAsB;QAC9C,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QACzB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Redis databases. A database is declared at module scope; its connection pool
3
- * is built on first use and reused thereafter.
2
+ * Redis databases. Declare a database at module scope; its connection pool
3
+ * is created on first use and reused thereafter.
4
4
  *
5
5
  * ```ts
6
6
  * import { Database } from "@encore.dev/sdk/storage/redis";
@@ -13,22 +13,22 @@
13
13
  * }
14
14
  * ```
15
15
  *
16
- * A database is a resource of its own: there is no cluster to put it in, and
17
- * no keyspaces to declare in it. Its keys are whatever the code passes.
16
+ * Each database is a standalone resource with no clusters or keyspaces to
17
+ * declare; keys are arbitrary strings passed by your code.
18
18
  *
19
19
  * ## Commands
20
20
  *
21
- * Commands are grouped by the data type they work on, each group a property of
22
- * the database: `string`, `hash`, `list`, `set`, `sortedSet`, `stream`, `geo`,
23
- * `bitmap`, `hyperloglog`, `pubsub`, and `generic` for the ones that work on
24
- * any key. Within a
25
- * group a command is named after the Redis command it runs — `get`, `hset`,
26
- * `zadd`, `xadd` — with words of its own for its variants: `setEx`,
27
- * `zrangeWithscores`.
21
+ * Commands are grouped by data type as properties on the database: `string`,
22
+ * `hash`, `list`, `set`, `sortedSet`, `stream`, `geo`, `bitmap`,
23
+ * `hyperloglog`, `pubsub`, and `generic` (for commands that work on any key).
24
+ * Within each group, methods are named after the underlying Redis command —
25
+ * `get`, `hset`, `zadd`, `xadd` — with descriptive names for variants such as
26
+ * `setEx` and `zrangeWithscores`.
28
27
  *
29
- * A command whose reply has one shape returns it: `strlen` a number,
30
- * `sismember` a boolean. One whose reply is the caller's to read returns a
31
- * {@link ReplyPromise}, read as what it holds:
28
+ * Commands with a fixed reply type return it directly (`strlen` returns a
29
+ * number; `sismember` returns a boolean). Commands whose reply format depends
30
+ * on the caller return a {@link ReplyPromise}, which you can decode into the
31
+ * desired type:
32
32
  *
33
33
  * ```ts
34
34
  * const name = await SESSIONS.string.get("name:1").text();
@@ -36,45 +36,47 @@
36
36
  * const fields = await SESSIONS.hash.hgetall("user:1").textMap();
37
37
  * ```
38
38
  *
39
- * A missing key reads as `null`.
39
+ * A missing key decodes as `null`.
40
40
  *
41
- * A command is called in the same expression that names its group. That is
42
- * what lets Encore grant each service exactly the access it uses: the command
43
- * is visible at the call, so Encore's parser can read it. A group that is
44
- * stored or passed on instead says nothing about what it will be used for, and
45
- * is reported as an error — to do that, start from a handle.
41
+ * Always call a command in the same expression that accesses its group. This
42
+ * makes the command visible at the call site so Encore's parser can statically
43
+ * grant each service only the access it uses. Storing or passing a command
44
+ * group obscures how it will be used and results in a compile error — to pass
45
+ * database access around, create a handle instead.
46
46
  *
47
- * A command that waits for something to pop — `list.blpop`,
48
- * `sortedSet.bzpopmin`, `stream.xreadBlock` and the like — runs on a
49
- * connection of its own, so it holds up no other call. A timeout resolves to
50
- * `null`. These can't be queued, and don't run on an acquired connection.
47
+ * Blocking commands — such as `list.blpop`, `sortedSet.bzpopmin`, and
48
+ * `stream.xreadBlock` — run on a dedicated connection so they do not block
49
+ * other calls. A timeout resolves to `null`. Blocking commands cannot be
50
+ * queued in pipelines or transactions, and cannot run on an acquired
51
+ * connection.
51
52
  *
52
53
  * ## Any command
53
54
  *
54
- * {@link DatabaseRef.command} sends a command the groups lack, by its name,
55
- * with the arguments that are keys marked:
55
+ * {@link DatabaseRef.command} sends a command that is not covered by the typed
56
+ * command groups, by specifying its name and marking any key arguments:
56
57
  *
57
58
  * ```ts
58
59
  * const freq = await SESSIONS.command("OBJECT").arg("FREQ").key("hot").invoke().number();
59
60
  * ```
60
61
  *
61
- * The name must be a string literal, which Encore reads to grant the access
62
- * the command needs. Before it is sent, the runtime checks it against Redis's
63
- * command table: each key it takes must be passed with `key`, and the commands
64
- * that would reach past the database, change a connection other calls share,
65
- * or have a call of their own here (`MULTI`, `SUBSCRIBE`, `EVAL`, `SCAN`,
66
- * `FLUSHALL`, …) fail with a `TypeError`. A handle that can only read sends
67
- * only the commands Redis says don't write.
62
+ * The command name must be a string literal so Encore can statically grant the
63
+ * required access. Before sending the command, the runtime validates it against
64
+ * Redis's command table: every key argument must be passed with `key()`, and
65
+ * commands that reach outside the database, alter a shared connection, or
66
+ * already have dedicated APIs (`MULTI`, `SUBSCRIBE`, `EVAL`, `SCAN`,
67
+ * `FLUSHALL`, …) fail with a `TypeError`. A read-only handle only allows
68
+ * commands that Redis marks as read-only.
68
69
  *
69
70
  * ## Handles
70
71
  *
71
- * A database cannot be passed around as a value. To hand it to other code,
72
- * make a handle with the access that code needs — {@link Database.write},
73
- * {@link Database.read} or {@link Database.readPrimary} — which the service is
74
- * then granted in full:
72
+ * A {@link Database} instance cannot be passed around as a value. To pass
73
+ * database access to other code, create a handle with the permissions that
74
+ * code needs — {@link Database.write}, {@link Database.read}, or
75
+ * {@link Database.readPrimary}. Creating a handle grants the calling service
76
+ * full access at that permission level:
75
77
  *
76
78
  * ```ts
77
- * // Library code takes a handle, and can only do what the handle allows.
79
+ * // Library code takes a handle and can only perform the operations it allows.
78
80
  * function nameOf(db: ReadOnlyDatabaseRef, user: string) {
79
81
  * return db.string.get(`name:${user}`).text();
80
82
  * }
@@ -86,16 +88,18 @@
86
88
  *
87
89
  * ## Keys
88
90
  *
89
- * Every key is stored under a prefix of the database's own, which is what
90
- * keeps databases sharing a server apart. It is applied to every key a command
91
- * takes and removed from every key a command returns, so code never sees it.
92
- * Two things follow:
93
- *
94
- * - a {@link Script}'s `KEYS` are prefixed, but nothing else in it is: a key
95
- * it names in its source or its `ARGV` is reached unprefixed, outside the
96
- * database's isolation, so a script must take its keys through `KEYS`;
97
- * - {@link DatabaseRef.connectionString} connects past the prefix, so a client
98
- * using it does not see the keys this SDK writes under the same names.
91
+ * Every key is automatically stored under a database-specific prefix to isolate
92
+ * databases sharing a server. The SDK applies the prefix to every key passed to
93
+ * a command and strips it from every key returned, so application code never
94
+ * sees it. Keep two caveats in mind:
95
+ *
96
+ * - A {@link Script}'s `KEYS` are prefixed automatically, but nothing else in
97
+ * the script is. Any key referenced directly in script source or `ARGV` is
98
+ * accessed unprefixed, outside the database's isolation, so always pass keys
99
+ * through `KEYS`.
100
+ * - {@link DatabaseRef.connectionString} connects without key prefixing, so
101
+ * external clients will not see keys written by this SDK under the same
102
+ * names.
99
103
  *
100
104
  * @module
101
105
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../storage/redis/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoGG;AAEH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,YAAY,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAC/C,YAAY,EACV,cAAc,EACd,aAAa,EACb,QAAQ,EACR,eAAe,EACf,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,SAAS,EACT,MAAM,EACN,aAAa,EACb,WAAW,EACX,SAAS,EACT,UAAU,EACV,YAAY,EACZ,IAAI,GACL,MAAM,WAAW,CAAC;AACnB,OAAO,EAAC,UAAU,EAAE,KAAK,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACxD,YAAY,EACV,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,YAAY,EACZ,MAAM,EACN,eAAe,EACf,WAAW,EACX,UAAU,EACV,aAAa,EACb,MAAM,EACN,UAAU,EACV,YAAY,EACZ,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAC,iBAAiB,EAAE,uBAAuB,EAAC,MAAM,WAAW,CAAC;AACrE,OAAO,EACL,QAAQ,EACR,UAAU,EACV,cAAc,EACd,gBAAgB,GACjB,MAAM,YAAY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