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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/README.md +144 -90
  2. package/app_meta.ts +56 -54
  3. package/config/config.test.ts +47 -13
  4. package/config/config.ts +60 -57
  5. package/config/secrets.ts +47 -50
  6. package/config/value.ts +23 -26
  7. package/cron/mod.test.ts +12 -0
  8. package/cron/mod.ts +37 -22
  9. package/dist/app_meta.d.ts +52 -50
  10. package/dist/app_meta.d.ts.map +1 -1
  11. package/dist/app_meta.js +2 -2
  12. package/dist/app_meta.js.map +1 -1
  13. package/dist/config/config.d.ts +58 -55
  14. package/dist/config/config.d.ts.map +1 -1
  15. package/dist/config/config.js +8 -9
  16. package/dist/config/config.js.map +1 -1
  17. package/dist/config/secrets.d.ts +45 -50
  18. package/dist/config/secrets.d.ts.map +1 -1
  19. package/dist/config/secrets.js +11 -9
  20. package/dist/config/secrets.js.map +1 -1
  21. package/dist/config/value.d.ts +20 -23
  22. package/dist/config/value.d.ts.map +1 -1
  23. package/dist/config/value.js +20 -23
  24. package/dist/config/value.js.map +1 -1
  25. package/dist/cron/mod.d.ts +34 -20
  26. package/dist/cron/mod.d.ts.map +1 -1
  27. package/dist/cron/mod.js +13 -13
  28. package/dist/cron/mod.js.map +1 -1
  29. package/dist/frontends/mod.d.ts +20 -19
  30. package/dist/frontends/mod.d.ts.map +1 -1
  31. package/dist/frontends/mod.js +20 -19
  32. package/dist/frontends/mod.js.map +1 -1
  33. package/dist/gateway/errors.d.ts +28 -30
  34. package/dist/gateway/errors.d.ts.map +1 -1
  35. package/dist/gateway/errors.js +29 -31
  36. package/dist/gateway/errors.js.map +1 -1
  37. package/dist/gateway/match.d.ts +54 -54
  38. package/dist/gateway/match.d.ts.map +1 -1
  39. package/dist/gateway/match.js +56 -56
  40. package/dist/gateway/match.js.map +1 -1
  41. package/dist/gateway/middleware.d.ts +62 -64
  42. package/dist/gateway/middleware.d.ts.map +1 -1
  43. package/dist/gateway/middleware.js +1 -1
  44. package/dist/gateway/middleware.js.map +1 -1
  45. package/dist/gateway/mod.d.ts +64 -67
  46. package/dist/gateway/mod.d.ts.map +1 -1
  47. package/dist/gateway/mod.js +72 -76
  48. package/dist/gateway/mod.js.map +1 -1
  49. package/dist/gateway/request.d.ts +138 -134
  50. package/dist/gateway/request.d.ts.map +1 -1
  51. package/dist/gateway/request.js +117 -108
  52. package/dist/gateway/request.js.map +1 -1
  53. package/dist/gateway/serve.d.ts +29 -34
  54. package/dist/gateway/serve.d.ts.map +1 -1
  55. package/dist/gateway/serve.js +51 -56
  56. package/dist/gateway/serve.js.map +1 -1
  57. package/dist/gateways/mod.d.ts +23 -21
  58. package/dist/gateways/mod.d.ts.map +1 -1
  59. package/dist/gateways/mod.js +25 -23
  60. package/dist/gateways/mod.js.map +1 -1
  61. package/dist/internal/otel/http.d.ts +4 -2
  62. package/dist/internal/otel/http.d.ts.map +1 -1
  63. package/dist/internal/otel/http.js +32 -5
  64. package/dist/internal/otel/http.js.map +1 -1
  65. package/dist/internal/runtime/napi/napi.cjs +6 -5
  66. package/dist/internal/runtime/napi/napi.d.cts +58 -16
  67. package/dist/internal/runtime/shutdown.d.ts +75 -57
  68. package/dist/internal/runtime/shutdown.d.ts.map +1 -1
  69. package/dist/internal/runtime/shutdown.js +88 -84
  70. package/dist/internal/runtime/shutdown.js.map +1 -1
  71. package/dist/log/logger.d.ts +43 -37
  72. package/dist/log/logger.d.ts.map +1 -1
  73. package/dist/log/logger.js +26 -25
  74. package/dist/log/logger.js.map +1 -1
  75. package/dist/metrics/mod.d.ts +133 -114
  76. package/dist/metrics/mod.d.ts.map +1 -1
  77. package/dist/metrics/mod.js +109 -101
  78. package/dist/metrics/mod.js.map +1 -1
  79. package/dist/otel.d.ts +6 -3
  80. package/dist/otel.d.ts.map +1 -1
  81. package/dist/otel.js +6 -3
  82. package/dist/otel.js.map +1 -1
  83. package/dist/pubsub/subscription.d.ts +88 -116
  84. package/dist/pubsub/subscription.d.ts.map +1 -1
  85. package/dist/pubsub/subscription.js +14 -17
  86. package/dist/pubsub/subscription.js.map +1 -1
  87. package/dist/pubsub/topic.d.ts +86 -113
  88. package/dist/pubsub/topic.d.ts.map +1 -1
  89. package/dist/pubsub/topic.js +68 -82
  90. package/dist/pubsub/topic.js.map +1 -1
  91. package/dist/redaction/mod.d.ts +62 -0
  92. package/dist/redaction/mod.d.ts.map +1 -0
  93. package/dist/redaction/mod.js +102 -0
  94. package/dist/redaction/mod.js.map +1 -0
  95. package/dist/reqctx/mod.d.ts +83 -86
  96. package/dist/reqctx/mod.d.ts.map +1 -1
  97. package/dist/reqctx/mod.js +39 -41
  98. package/dist/reqctx/mod.js.map +1 -1
  99. package/dist/services/index.d.ts +76 -75
  100. package/dist/services/index.d.ts.map +1 -1
  101. package/dist/services/index.js +73 -71
  102. package/dist/services/index.js.map +1 -1
  103. package/dist/shutdown/mod.d.ts +26 -25
  104. package/dist/shutdown/mod.d.ts.map +1 -1
  105. package/dist/shutdown/mod.js +26 -25
  106. package/dist/shutdown/mod.js.map +1 -1
  107. package/dist/storage/clickhouse/database.d.ts +113 -115
  108. package/dist/storage/clickhouse/database.d.ts.map +1 -1
  109. package/dist/storage/clickhouse/database.js +65 -79
  110. package/dist/storage/clickhouse/database.js.map +1 -1
  111. package/dist/storage/clickhouse/errors.d.ts +25 -26
  112. package/dist/storage/clickhouse/errors.d.ts.map +1 -1
  113. package/dist/storage/clickhouse/errors.js +15 -17
  114. package/dist/storage/clickhouse/errors.js.map +1 -1
  115. package/dist/storage/clickhouse/mod.d.ts +10 -10
  116. package/dist/storage/clickhouse/mod.js +10 -10
  117. package/dist/storage/objects/bucket.d.ts +230 -203
  118. package/dist/storage/objects/bucket.d.ts.map +1 -1
  119. package/dist/storage/objects/bucket.js +146 -106
  120. package/dist/storage/objects/bucket.js.map +1 -1
  121. package/dist/storage/objects/error.d.ts +4 -4
  122. package/dist/storage/objects/error.js +4 -4
  123. package/dist/storage/objects/mod.d.ts +1 -1
  124. package/dist/storage/objects/mod.d.ts.map +1 -1
  125. package/dist/storage/objects/mod.js.map +1 -1
  126. package/dist/storage/objects/refs.d.ts +2 -5
  127. package/dist/storage/objects/refs.d.ts.map +1 -1
  128. package/dist/storage/objects/refs.js.map +1 -1
  129. package/dist/storage/postgres/database.d.ts +124 -149
  130. package/dist/storage/postgres/database.d.ts.map +1 -1
  131. package/dist/storage/postgres/database.js +98 -135
  132. package/dist/storage/postgres/database.js.map +1 -1
  133. package/dist/storage/postgres/errors.d.ts +42 -48
  134. package/dist/storage/postgres/errors.d.ts.map +1 -1
  135. package/dist/storage/postgres/errors.js +44 -51
  136. package/dist/storage/postgres/errors.js.map +1 -1
  137. package/dist/storage/postgres/interval.d.ts +19 -19
  138. package/dist/storage/postgres/interval.d.ts.map +1 -1
  139. package/dist/storage/postgres/interval.js +21 -21
  140. package/dist/storage/postgres/interval.js.map +1 -1
  141. package/dist/storage/redis/bitfield.d.ts +48 -23
  142. package/dist/storage/redis/bitfield.d.ts.map +1 -1
  143. package/dist/storage/redis/bitfield.js +38 -19
  144. package/dist/storage/redis/bitfield.js.map +1 -1
  145. package/dist/storage/redis/command.d.ts +16 -12
  146. package/dist/storage/redis/command.d.ts.map +1 -1
  147. package/dist/storage/redis/command.js +16 -12
  148. package/dist/storage/redis/command.js.map +1 -1
  149. package/dist/storage/redis/commands.d.ts +99 -100
  150. package/dist/storage/redis/commands.d.ts.map +1 -1
  151. package/dist/storage/redis/commands.js +84 -85
  152. package/dist/storage/redis/commands.js.map +1 -1
  153. package/dist/storage/redis/database.d.ts +138 -122
  154. package/dist/storage/redis/database.d.ts.map +1 -1
  155. package/dist/storage/redis/database.js +120 -101
  156. package/dist/storage/redis/database.js.map +1 -1
  157. package/dist/storage/redis/mod.d.ts +52 -48
  158. package/dist/storage/redis/mod.d.ts.map +1 -1
  159. package/dist/storage/redis/mod.js +52 -48
  160. package/dist/storage/redis/mod.js.map +1 -1
  161. package/dist/storage/redis/options.d.ts +26 -24
  162. package/dist/storage/redis/options.d.ts.map +1 -1
  163. package/dist/storage/redis/options.js.map +1 -1
  164. package/dist/storage/redis/pubsub.d.ts +16 -16
  165. package/dist/storage/redis/pubsub.d.ts.map +1 -1
  166. package/dist/storage/redis/pubsub.js +14 -14
  167. package/dist/storage/redis/pubsub.js.map +1 -1
  168. package/dist/storage/redis/reply.d.ts +80 -72
  169. package/dist/storage/redis/reply.d.ts.map +1 -1
  170. package/dist/storage/redis/reply.js +53 -46
  171. package/dist/storage/redis/reply.js.map +1 -1
  172. package/dist/storage/redis/scan.d.ts +4 -4
  173. package/dist/storage/redis/scan.d.ts.map +1 -1
  174. package/dist/storage/redis/scan.js +6 -6
  175. package/dist/storage/redis/scan.js.map +1 -1
  176. package/dist/storage/redis/script.d.ts +28 -21
  177. package/dist/storage/redis/script.d.ts.map +1 -1
  178. package/dist/storage/redis/script.js +29 -22
  179. package/dist/storage/redis/script.js.map +1 -1
  180. package/dist/storage/redis/target.d.ts +17 -1
  181. package/dist/storage/redis/target.d.ts.map +1 -1
  182. package/dist/storage/redis/target.js +30 -1
  183. package/dist/storage/redis/target.js.map +1 -1
  184. package/dist/storage/redis/wire.d.ts +6 -6
  185. package/dist/storage/redis/wire.d.ts.map +1 -1
  186. package/dist/storage/redis/wire.js +6 -6
  187. package/dist/storage/redis/wire.js.map +1 -1
  188. package/dist/testing/mod.d.ts +83 -88
  189. package/dist/testing/mod.d.ts.map +1 -1
  190. package/dist/testing/mod.js +75 -81
  191. package/dist/testing/mod.js.map +1 -1
  192. package/dist/testing/playwright.d.ts +28 -32
  193. package/dist/testing/playwright.d.ts.map +1 -1
  194. package/dist/testing/playwright.js +22 -27
  195. package/dist/testing/playwright.js.map +1 -1
  196. package/dist/testing/puppeteer.d.ts +11 -12
  197. package/dist/testing/puppeteer.d.ts.map +1 -1
  198. package/dist/testing/puppeteer.js +17 -18
  199. package/dist/testing/puppeteer.js.map +1 -1
  200. package/dist/testing/system.d.ts +72 -90
  201. package/dist/testing/system.d.ts.map +1 -1
  202. package/dist/testing/system.js +90 -107
  203. package/dist/testing/system.js.map +1 -1
  204. package/dist/tracing/http.d.ts +2 -1
  205. package/dist/tracing/http.d.ts.map +1 -1
  206. package/dist/tracing/http.js +2 -1
  207. package/dist/tracing/http.js.map +1 -1
  208. package/dist/tracing/node.d.ts.map +1 -1
  209. package/dist/tracing/node.js +1 -1
  210. package/dist/tracing/node.js.map +1 -1
  211. package/dist/tsconfig.build.tsbuildinfo +1 -1
  212. package/frontends/mod.test.ts +6 -2
  213. package/frontends/mod.ts +20 -19
  214. package/gateway/errors.ts +30 -32
  215. package/gateway/match.ts +61 -57
  216. package/gateway/middleware.ts +62 -64
  217. package/gateway/mod.ts +73 -76
  218. package/gateway/request.ts +143 -140
  219. package/gateway/serve.ts +58 -63
  220. package/gateways/mod.ts +25 -23
  221. package/internal/otel/http.test.ts +50 -0
  222. package/internal/otel/http.ts +40 -5
  223. package/internal/runtime/napi/napi.cjs +6 -5
  224. package/internal/runtime/napi/napi.d.cts +58 -16
  225. package/internal/runtime/shutdown.ts +113 -101
  226. package/log/logger.test.ts +8 -0
  227. package/log/logger.ts +48 -45
  228. package/metrics/mod.ts +138 -122
  229. package/otel.ts +6 -3
  230. package/package.json +6 -1
  231. package/pubsub/subscription.ts +93 -123
  232. package/pubsub/topic.ts +96 -130
  233. package/redaction/bridge.test.ts +99 -0
  234. package/redaction/mod.test.ts +188 -0
  235. package/redaction/mod.ts +226 -0
  236. package/reqctx/mod.ts +83 -86
  237. package/services/index.ts +78 -78
  238. package/shutdown/mod.ts +26 -25
  239. package/storage/clickhouse/database.ts +115 -129
  240. package/storage/clickhouse/errors.ts +27 -29
  241. package/storage/clickhouse/mod.ts +10 -10
  242. package/storage/objects/bucket.test.ts +168 -16
  243. package/storage/objects/bucket.ts +336 -247
  244. package/storage/objects/error.ts +4 -4
  245. package/storage/objects/mod.ts +1 -0
  246. package/storage/objects/refs.ts +2 -5
  247. package/storage/postgres/database.ts +131 -164
  248. package/storage/postgres/errors.ts +45 -52
  249. package/storage/postgres/interval.ts +21 -21
  250. package/storage/redis/bitfield.ts +51 -26
  251. package/storage/redis/command.ts +16 -12
  252. package/storage/redis/commands.ts +99 -100
  253. package/storage/redis/database.ts +145 -123
  254. package/storage/redis/mod.ts +52 -48
  255. package/storage/redis/options.ts +26 -24
  256. package/storage/redis/pubsub.ts +14 -14
  257. package/storage/redis/redis.test.ts +17 -2
  258. package/storage/redis/reply.ts +85 -77
  259. package/storage/redis/scan.ts +6 -6
  260. package/storage/redis/script.ts +29 -22
  261. package/storage/redis/target.ts +34 -1
  262. package/storage/redis/wire.ts +8 -8
  263. package/testing/mod.ts +99 -105
  264. package/testing/playwright.ts +32 -37
  265. package/testing/puppeteer.ts +22 -23
  266. package/testing/system.ts +117 -133
  267. package/tracing/http.ts +2 -1
  268. package/tracing/native.test.ts +158 -8
  269. package/tracing/node.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../../internal/otel/http.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,KAAK,GAIN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAoB,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAE3C,MAAM,UAAU,GAAG,IAAI,aAAa,EAAE,CAAC;AACvC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC;IACtB,SAAS;IACT,QAAQ;IACR,KAAK;IACL,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,KAAK;IACL,OAAO;IACP,OAAO;CACR,CAAC,CAAC;AAEH,MAAM,UAAU,aAAa,CAC3B,OAAgB,EAChB,MAA8B,EAC9B,aAAqB,EACrB,GAAQ;IAER,MAAM,MAAM,G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AAI,MAAM,IAAI,GAAG,EAAE,CAAC;QACnC,IAAI,CAAC,SAAS,CAAC,EAAC,IAAI,EAAE,cAAc,CAAC,KAAK,EAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAClD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAU,EAAE,KAAc;IACxD,IAAI,CAAC,SAAS,CAAC,EAAC,IAAI,EAAE,cAAc,CAAC,KAAK,EAAC,CAAC,CAAC;IAC7C,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC;QACH,IAAI,CAAC,YAAY,CACf,YAAY,EACZ,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,KAAK,CAC9D,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACvE,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC,eAAe,CAAC,6BAA6B,CAAC,CAAC;IACtD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,IAAU;IACnD,IAAI,CAAC,SAAS,CAAC,EAAC,IAAI,EAAE,cAAc,CAAC,KAAK,EAAC,CAAC,CAAC;IAC7C,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC;AACvD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // The version of the runtime this JS bundle was generated for.
2
- const version = "v2.0.0-beta.14";
2
+ const version = "v2.0.0-beta.16";
3
3
 
4
4
  // Load the native module. ENCORE_RUNTIME_LIB overrides the location; by
5
5
  // default the library is found by walking up from this file (which the
@@ -188,7 +188,7 @@ const {
188
188
  ConfigWatch,
189
189
  Cursor,
190
190
  Decimal,
191
- DownloadStream,
191
+ Download,
192
192
  EnvironmentType,
193
193
  GatewayHeaders,
194
194
  GatewayView,
@@ -247,7 +247,7 @@ module.exports = {
247
247
  ConfigWatch,
248
248
  Cursor,
249
249
  Decimal,
250
- DownloadStream,
250
+ Download,
251
251
  EnvironmentType,
252
252
  GatewayHeaders,
253
253
  GatewayView,
@@ -301,8 +301,9 @@ if (version !== Runtime.version() && installedRuntimeLib) {
301
301
  );
302
302
  }
303
303
  if (version !== Runtime.version()) {
304
- console.warn(`⚠️ WARNING: The version of the Encore runtime this JS bundle was built for (${version}) does not match the version of the Encore runtime it is running in (${Runtime.version()}).
304
+ const runtimeVersion = Runtime.version().replace(/^v/, "");
305
+ console.warn(`⚠️ WARNING: this @encore.dev/sdk was built for the Encore runtime ${version}, but it is running in the Encore runtime ${Runtime.version()}.
305
306
  This may cause unexpected behaviour in your application.
306
307
 
307
- To resolve this, try update your Encore CLI using "encore version update" and then update the dependencies in your package.json file using "npm install @encore.dev/sdk@latest" (and "npm install encore.dev@latest" if you use the API framework).`);
308
+ To resolve this, install the SDK of the runtime's version: "npm install @encore.dev/sdk@${runtimeVersion}" (and "@encore.dev/framework@${runtimeVersion}" if you use the API framework). If the SDK is the newer, upgrade Encore with "encore version upgrade" instead.`);
308
309
  }
@@ -45,9 +45,12 @@ export class BucketObject {
45
45
  extendRetention(until: number, options?: ExtendRetentionOptions | undefined | null, source?: Buffer | undefined | null): Promise<ObjectAttrs | TypedObjectError>
46
46
  signedUploadUrl(options?: UploadUrlOptions | undefined | null, source?: Buffer | undefined | null): Promise<SignedUploadUrl | TypedObjectError>
47
47
  signedDownloadUrl(options?: DownloadUrlOptions | undefined | null, source?: Buffer | undefined | null): Promise<SignedDownloadUrl | TypedObjectError>
48
- downloadAll(options?: DownloadOptions | undefined | null, source?: Buffer | undefined | null): Promise<Buffer | TypedObjectError>
49
- /** Opens a download. A missing object fails here, before any bytes. */
50
- downloadStream(options?: DownloadOptions | undefined | null, source?: Buffer | undefined | null): Promise<DownloadStream | TypedObjectError>
48
+ /**
49
+ * Begins a download: resolves once the provider has answered, with what
50
+ * it says of the object and its bytes still to come. A missing object
51
+ * fails here, before any bytes.
52
+ */
53
+ download(options?: DownloadOptions | undefined | null, source?: Buffer | undefined | null): Promise<Download | TypedObjectError>
51
54
  delete(options?: DeleteOptions | undefined | null, source?: Buffer | undefined | null): Promise<TypedObjectError | null>
52
55
  publicUrl(): string
53
56
  }
@@ -56,9 +59,14 @@ export interface BuildMeta {
56
59
  revision: string
57
60
  }
58
61
 
62
+ /**
63
+ * `length` bytes from `offset` (to the end of the object without a
64
+ * length), or the object's last `last` bytes.
65
+ */
59
66
  export interface ByteRange {
60
- offset: number
67
+ offset?: number
61
68
  length?: number
69
+ last?: number
62
70
  }
63
71
 
64
72
  /** Which of a database's users a call is made as. See [`clickhouse::Access`]. */
@@ -224,22 +232,40 @@ export interface DeployMeta {
224
232
  worker?: string
225
233
  }
226
234
 
227
- export interface DownloadOptions {
228
- version?: string
229
- range?: ByteRange
230
- }
231
-
232
- /** An open download, read one chunk at a time. */
233
- export class DownloadStream {
235
+ /**
236
+ * A download under way: what the provider said of the object, and its
237
+ * bytes, read whole or one chunk at a time.
238
+ */
239
+ export class Download {
240
+ get info(): DownloadInfo
241
+ /** The rest of the download, in one piece. It closes the download. */
242
+ bytes(): Promise<Buffer | TypedObjectError>
234
243
  /**
235
- * The next chunk, or null at the end. The stream closes at the end and
236
- * on an error.
244
+ * The next chunk, or null at the end. The download closes at the end
245
+ * and on an error.
237
246
  */
238
247
  next(): Promise<Buffer | null | TypedObjectError>
239
248
  /** Stops the download, which ends its span. */
240
249
  close(): Promise<void>
241
250
  }
242
251
 
252
+ /** What a download's response says of the object being read. */
253
+ export interface DownloadInfo {
254
+ /** With `version`, the revision the bytes are of. */
255
+ etag: string
256
+ version?: string
257
+ /** The size of the whole object, also when a range of it is read. */
258
+ size: number
259
+ contentType?: string
260
+ /** Milliseconds since the Unix epoch. */
261
+ lastModified?: number
262
+ }
263
+
264
+ export interface DownloadOptions {
265
+ version?: string
266
+ range?: ByteRange
267
+ }
268
+
243
269
  export interface DownloadUrlOptions {
244
270
  ttl?: number
245
271
  }
@@ -407,6 +433,8 @@ export interface ListEntry {
407
433
  name: string
408
434
  size: number
409
435
  etag: string
436
+ /** Milliseconds since the Unix epoch. None for a prefix. */
437
+ lastModified?: number
410
438
  /** A common prefix of a delimited listing rather than an object. */
411
439
  isPrefix: boolean
412
440
  }
@@ -594,6 +622,13 @@ export class RedisConnection {
594
622
  export class RedisDatabase {
595
623
  /** The prefix every key of the database is stored under, if it has one. */
596
624
  keyPrefix(): string | null
625
+ /**
626
+ * The database for a handle that only reads: from the primary if
627
+ * `primary`, and otherwise from a read replica where the database has a
628
+ * read-only pool on one. Its commands that write are refused before they
629
+ * are sent. See [`cache::Client::with_access`].
630
+ */
631
+ reader(primary: boolean): RedisDatabase
597
632
  /**
598
633
  * The URL a client other than this one connects to the database with,
599
634
  * past its key prefix.
@@ -756,12 +791,19 @@ export class Runtime {
756
791
  * a name has one scope across the app.
757
792
  */
758
793
  secret(encoreName: string): Secret | null
794
+ /**
795
+ * Whether a secret [`secret`](Self::secret) has no value of reads as `""`
796
+ * rather than failing: only where the app runs locally, as `encore run`
797
+ * and `encore test` do, where a secret lacks a value until it is set.
798
+ */
799
+ unsetSecretsReadEmpty(): boolean
759
800
  /** The telemetry pipeline's span lifecycle calls. */
760
801
  telemetry(): Pipeline
761
802
  /** The meter provider's instrument calls. */
762
803
  meters(): Meters
763
804
  /** Returns the version of the Encore runtime being used */
764
805
  static version(): string
806
+ redact(spec: string, payload: Buffer): string
765
807
  appMeta(): AppMeta
766
808
  runtimeConfig(): RuntimeConfig
767
809
  }
@@ -915,7 +957,7 @@ export type SQLTransactionOptions = SqlTransactionOptions
915
957
  export class SystemTest {
916
958
  /** The suite the process's tests are of. */
917
959
  get suite(): string
918
- /** The test session's id, as `encore run ls` lists it. */
960
+ /** The test session's id, as `encore run list` lists it. */
919
961
  get session(): string
920
962
  /** The session's service proxy: `/<service>/…` there reaches the service. */
921
963
  get proxyUrl(): string
@@ -1177,7 +1219,7 @@ export class VersionIterator {
1177
1219
 
1178
1220
  /**
1179
1221
  * One log record in the Encore log format, newline included, for the
1180
- * logger to print. Absent, empty, and 0 are none. `level` is the
1222
+ * logger to print. An empty `message` is preserved. `level` is the
1181
1223
  * OpenTelemetry severity number, 1–24; `time_unix_millis` absent is now;
1182
1224
  * `span_ctx` is the span's 25-byte context: trace id, span id, flags;
1183
1225
  * `exception_stacktrace` is in JavaScript's format; `code_*` are the
@@ -1188,7 +1230,7 @@ export class VersionIterator {
1188
1230
  * field when valid, `raw.<key>` otherwise; one named like a key of the
1189
1231
  * record's own fields is `raw.<key>`. Needs no runtime.
1190
1232
  */
1191
- export declare function encodeLog(level: number, timeUnixMillis: number | undefined | null, message: string, logger?: string | undefined | null, spanCtx?: Buffer | undefined | null, exceptionType?: string | undefined | null, exceptionMessage?: string | undefined | null, exceptionStacktrace?: string | undefined | null, codeFunction?: string | undefined | null, codeFile?: string | undefined | null, codeLine?: number | undefined | null, codeColumn?: number | undefined | null, runtimeTarget?: string | undefined | null, attrsJson?: string | undefined | null): Buffer
1233
+ export declare function encodeLog(level: number, timeUnixMillis?: number | undefined | null, message?: string | undefined | null, logger?: string | undefined | null, spanCtx?: Buffer | undefined | null, exceptionType?: string | undefined | null, exceptionMessage?: string | undefined | null, exceptionStacktrace?: string | undefined | null, codeFunction?: string | undefined | null, codeFile?: string | undefined | null, codeLine?: number | undefined | null, codeColumn?: number | undefined | null, runtimeTarget?: string | undefined | null, attrsJson?: string | undefined | null): Buffer
1192
1234
 
1193
1235
  /**
1194
1236
  * Lets the request of the `request` event `eventId` through, with
@@ -2,92 +2,110 @@
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
4
  import type { Runtime } from './napi/napi.cjs';
5
- /** A phase of Encore's shutdown.
5
+ /**
6
+ * Current phase of Encore's graceful shutdown:
6
7
  *
7
8
  * - `not-started`: shutdown has not begun.
8
- * - `started`: Pub/Sub intake has stopped; Encore waits for the message
9
- * handlers in flight, and for the app's holds.
10
- * - `cleanup`: Encore is closing its resources and flushing telemetry.
11
- * - `completed`: cleanup has finished, whatever its result. */
9
+ * - `started`: Pub/Sub intake has stopped; Encore is waiting for in-flight
10
+ * message handlers and application holds to finish.
11
+ * - `cleanup`: Encore is closing managed resources and flushing telemetry.
12
+ * - `completed`: cleanup has finished (whether it succeeded or timed out).
13
+ */
12
14
  export type ShutdownPhase = 'not-started' | 'started' | 'cleanup' | 'completed';
13
- /** How a completed shutdown went: `success` if cleanup finished within the
14
- * shutdown deadline, else `timeout`. A failed cleanup is a
15
- * {@link ShutdownError}. */
15
+ /**
16
+ * Outcome of a completed shutdown: `'success'` if cleanup finished within the
17
+ * shutdown deadline, or `'timeout'` if the deadline expired. A failed cleanup
18
+ * rejects with {@link ShutdownError}.
19
+ */
16
20
  export type ShutdownResult = 'success' | 'timeout';
17
- /** Encore's cleanup failed, or the shutdown was used before it began. */
21
+ /** Thrown when Encore's resource cleanup fails or a shutdown API is called invalidly. */
18
22
  export declare class ShutdownError extends Error {
19
23
  name: string;
20
24
  }
21
- /** Work the shutdown waits for before Encore cleans up: until it is
22
- * released, or the shutdown deadline passes. Releasing it twice is harmless.
23
- * As a `Disposable`, `using` releases it at the end of its scope. */
25
+ /**
26
+ * A hold that delays Encore resource cleanup until {@link release} is called
27
+ * or the shutdown deadline expires. Calling `release()` more than once is a
28
+ * no-op. Implements `Disposable` so `using` releases it automatically at the
29
+ * end of a scope.
30
+ */
24
31
  export interface ShutdownHold extends Disposable {
25
32
  release(): void;
26
33
  }
27
- /** What a shutdown callback is told. */
34
+ /** Context passed to an {@link onShutdown} callback. */
28
35
  export interface ShutdownContext {
29
- /** Aborts when cleanup begins, the callback done or not: the shutdown
30
- * deadline passed, or cleanup was forced. */
36
+ /** Aborts when resource cleanup begins (either because the shutdown deadline
37
+ * expired or because cleanup was forced), even if the callback is still running. */
31
38
  signal: AbortSignal;
32
- /** When the shutdown deadline passes, in milliseconds since the epoch, as
33
- * `Date.now()` counts them. */
39
+ /** Timestamp when the shutdown deadline expires, in milliseconds since the
40
+ * Unix epoch (matching `Date.now()`). */
34
41
  deadline: number;
35
42
  }
36
- /** Called when shutdown begins. Cleanup waits for what it returns to settle. */
43
+ /** Callback invoked when shutdown begins. Resource cleanup waits for any
44
+ * returned promise to settle (up to the shutdown deadline). */
37
45
  export type ShutdownCallback = (ctx: ShutdownContext) => void | Promise<void>;
38
- /** Aborts when shutdown begins: Encore takes no new Pub/Sub messages, and the
39
- * app should stop taking work too. */
46
+ /** Aborts as soon as shutdown begins: Encore stops accepting new Pub/Sub
47
+ * messages, and your application should stop accepting new work as well. */
40
48
  export declare const signal: AbortSignal;
41
- /** Sets the runtime the shutdown runs on. */
49
+ /** Sets the native runtime instance used to coordinate shutdown. */
42
50
  export declare function setShutdownRuntime(rt: Runtime): void;
43
- /** Holds the shutdown back: Encore cleans up once every hold is released, or
44
- * the shutdown deadline passes. A hold taken once the app has drained, or
45
- * cleanup has begun, comes released: cleanup does not wait for it. */
51
+ /**
52
+ * Delays Encore's resource cleanup until the returned hold is released or the
53
+ * shutdown deadline expires. If called after the application has already
54
+ * drained or cleanup has begun, returns an already-released hold and logs a
55
+ * warning.
56
+ */
46
57
  export declare function hold(): ShutdownHold;
47
- /** Holds the shutdown back until `work` settles. A rejection is logged. */
58
+ /** Delays resource cleanup until `work` settles. Any rejection is logged. */
48
59
  export declare function waitUntil(work: PromiseLike<unknown>): void;
49
- /** Calls `callback` when shutdown begins, or at once if it has, holding
50
- * cleanup back until it settles. Disposing of the returned value
51
- * unregisters it. */
60
+ /**
61
+ * Registers `callback` to run when shutdown begins (or immediately if shutdown
62
+ * has already begun), delaying resource cleanup until it settles. Disposing
63
+ * the returned handle unregisters the callback.
64
+ */
52
65
  export declare function onShutdown(callback: ShutdownCallback): Disposable;
53
- /** Registers `callback` as {@link onShutdown} does, as Encore's own: it
54
- * doesn't stop Encore from waiting for an app that handles the signal itself. */
66
+ /** Registers an Encore-internal shutdown callback without disabling automatic
67
+ * detection of application-owned signal handlers. */
55
68
  export declare function onShutdownInternal(callback: ShutdownCallback): Disposable;
56
- /** Begins the shutdown, once: Encore stops taking Pub/Sub messages,
57
- * {@link signal} aborts, and the {@link onShutdown} callbacks run. Encore
58
- * cleans up once every hold is released, or the shutdown deadline passes.
59
- * SIGTERM and SIGINT begin it, outside tests. */
69
+ /**
70
+ * Initiates graceful shutdown (idempotent): stops Pub/Sub intake, aborts
71
+ * {@link signal}, and invokes all registered {@link onShutdown} callbacks.
72
+ * Encore cleans up resources once every hold is released or the shutdown
73
+ * deadline expires. Outside tests, `SIGTERM` and `SIGINT` call this
74
+ * automatically.
75
+ */
60
76
  export declare function begin(): void;
61
- /** The shutdown's phase now. */
77
+ /** Returns the current shutdown phase. */
62
78
  export declare function phase(): ShutdownPhase;
63
- /** Resolves once the shutdown has begun and Pub/Sub intake has stopped.
64
- * Waiting does not keep the process alive. */
79
+ /** Resolves once shutdown has begun and Pub/Sub intake has stopped. Awaiting
80
+ * this promise does not keep the event loop alive. */
65
81
  export declare function started(): Promise<void>;
66
- /** Resolves once cleanup begins: the app drained, the shutdown deadline
67
- * passed, or cleanup was forced. Waiting does not keep the process alive. */
82
+ /** Resolves once resource cleanup begins (because the app drained, the
83
+ * shutdown deadline expired, or cleanup was forced). Awaiting this promise
84
+ * does not keep the event loop alive. */
68
85
  export declare function cleanup(): Promise<void>;
69
- /** Resolves with the shutdown's result once cleanup has completed, after the
70
- * deadline too; rejects with a {@link ShutdownError} if cleanup failed.
71
- * Waiting keeps the process alive once the shutdown has begun. */
86
+ /** Resolves with the shutdown result once cleanup completes (even after the
87
+ * deadline), or rejects with {@link ShutdownError} if cleanup failed. Once
88
+ * shutdown has begun, awaiting this keeps the event loop alive. */
72
89
  export declare function completed(): Promise<ShutdownResult>;
73
- /** Begins cleanup without waiting for the app's holds or the Pub/Sub
74
- * handlers in flight. Work still running may find its resources closed. */
90
+ /** Starts resource cleanup immediately without waiting for application holds
91
+ * or in-flight Pub/Sub handlers. Work still running may encounter closed
92
+ * resources. */
75
93
  export declare function forceCleanup(): void;
76
- /** Begins the shutdown on SIGTERM or SIGINT, or on Windows when the daemon
77
- * asks the process to stop, and exits once it completes:
78
- * with `process.exitCode` (0 unless the app set it) if cleanup finished
79
- * within the shutdown deadline, else 1. A second SIGINT, a second Ctrl-C,
80
- * forces cleanup.
94
+ /**
95
+ * Installs signal listeners for `SIGTERM` and `SIGINT` (and daemon stop
96
+ * requests on Windows) to drive graceful shutdown and exit once cleanup
97
+ * completes. Exits with `process.exitCode` (0 unless set) if cleanup succeeds
98
+ * within the deadline, or 1 otherwise. A second `SIGINT` forces cleanup.
81
99
  *
82
- * An app that listens for the signal itself and holds nothing is waited for
83
- * until it raises the signal again, exits, or has closed everything it had
84
- * open. */
100
+ * If the application registers its own signal listener without using Encore's
101
+ * shutdown hooks, Encore waits until the application re-raises the signal,
102
+ * exits, or drains its event loop.
103
+ */
85
104
  export declare function watchShutdownSignals(): void;
86
- /** Runs `rt` until its shutdown completes, returning the exit code. The
87
- * runtime handles SIGTERM and SIGINT, and on Windows the console closing;
88
- * on them the shutdown begins here too, and cleanup waits for the app's
89
- * holds. */
105
+ /** Runs `r` until shutdown completes and returns the exit code. The native
106
+ * runtime handles `SIGTERM`, `SIGINT`, and Windows console close events,
107
+ * triggers JS shutdown here, and waits for application holds before cleanup. */
90
108
  export declare function runUntilShutdown(r: Runtime): Promise<number>;
91
- /** Has `sig` force cleanup when it comes again, as a second SIGINT does. */
109
+ /** Configures `sig` to force immediate cleanup when received a second time. */
92
110
  export declare function forceCleanupOnRepeat(sig: NodeJS.Signals): void;
93
111
  //# sourceMappingURL=shutdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shutdown.d.ts","sourceRoot":"","sources":["../../../internal/runtime/shutdown.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EAAC,OAAO,E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