@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
@@ -5,143 +5,139 @@ import * as runtime from '../../internal/runtime/mod.js';
5
5
  import { StringLiteral } from '../../internal/utils/constraints.js';
6
6
  import { BucketPerms, Uploader, SignedUploader, Downloader, SignedDownloader, Attrser, Lister, Remover, PublicUrler, AttrsUpdater, IfMatchUploader, IfMatchRemover } from './refs.js';
7
7
  /**
8
- * How often an object is expected to be read, which the cloud provider
9
- * prices its storage by.
8
+ * Storage tier indicating how frequently an object is accessed, used by cloud
9
+ * providers to price storage and retrieval:
10
10
  *
11
- * - `standard`: read often. No minimum storage duration and no retrieval fee.
12
- * - `infrequent`: read about once a month or less (GCS Nearline, S3
13
- * Standard-IA). Billed for at least 30 days, with a fee per read.
14
- * - `cold`: read about once a quarter or less (GCS Coldline, S3 Glacier
15
- * Instant Retrieval; Standard-IA on Cloudflare R2). Billed for at least
16
- * 90 days, with a higher fee per read.
11
+ * - `standard`: frequent access; no minimum storage duration or retrieval fee.
12
+ * - `infrequent`: accessed roughly once a month or less (GCS Nearline, S3
13
+ * Standard-IA); billed for at least 30 days with a per-read retrieval fee.
14
+ * - `cold`: accessed roughly once a quarter or less (GCS Coldline, S3 Glacier
15
+ * Instant Retrieval; Standard-IA on Cloudflare R2); billed for at least 90
16
+ * days with a higher per-read retrieval fee.
17
17
  *
18
- * Every class can be read immediately.
18
+ * Objects in every class remain immediately readable.
19
19
  */
20
20
  export type StorageClass = 'standard' | 'infrequent' | 'cold';
21
21
  /**
22
- * Configuration options for declaring a Bucket.
23
- *
24
- * Encore reads the configuration when it builds the app, so its values must
25
- * be literals.
22
+ * Configuration options for declaring a {@link Bucket}. Values must be
23
+ * literals so Encore can inspect them at build time.
26
24
  */
27
25
  export interface BucketConfig {
28
26
  /**
29
- * Whether the objects in the bucket should be publicly
30
- * accessible, via CDN. Defaults to false if unset.
27
+ * Whether objects in the bucket are publicly accessible via CDN.
28
+ * Defaults to `false`.
31
29
  */
32
30
  public?: boolean;
33
31
  /**
34
- * Whether to enable versioning of the objects in the bucket.
35
- * Defaults to false if unset.
32
+ * Whether object versioning is enabled on the bucket.
33
+ * Defaults to `false`.
36
34
  */
37
35
  versioned?: boolean;
38
36
  /**
39
- * The storage class of an object uploaded without one.
40
- * Defaults to `"standard"`.
37
+ * Default storage class for newly uploaded objects. Defaults to `"standard"`.
41
38
  *
42
- * `"auto"` lets the provider move each object between classes by how
43
- * often it is read (GCS Autoclass, S3 Intelligent-Tiering). It is a
44
- * bucket's class only: objects in such a bucket can't name a class, and
45
- * lifecycle rules can't move them.
39
+ * Setting `"auto"` delegates class transitions to the provider based on
40
+ * access patterns (GCS Autoclass, S3 Intelligent-Tiering). When `"auto"` is
41
+ * set, individual uploads cannot override `storageClass` and lifecycle rules
42
+ * cannot transition storage classes.
46
43
  */
47
44
  storageClass?: StorageClass | 'auto';
48
45
  /**
49
- * Rules that move objects to colder storage classes, or delete them, as
50
- * they age. Providers apply them asynchronously, usually within a day,
51
- * to the objects already in the bucket too.
46
+ * Lifecycle rules that automatically transition objects to colder storage
47
+ * classes or delete them as they age. Providers evaluate rules
48
+ * asynchronously (typically within a day), including for existing objects.
52
49
  */
53
50
  lifecycle?: LifecycleRule[];
54
51
  /**
55
- * Keep every object for at least this long after it was written: it
56
- * can't be deleted or overwritten sooner.
52
+ * Minimum retention period applied to every object in the bucket; objects
53
+ * cannot be deleted or overwritten before this period elapses.
57
54
  */
58
55
  retention?: Retention;
59
56
  /**
60
- * Whether objects can be given their own retain-until time, with the
61
- * `retainUntil` upload option and `extendRetention`.
62
- * Defaults to false if unset.
57
+ * Whether individual objects can specify their own `retainUntil` timestamp
58
+ * via upload options and {@link Bucket.extendRetention}. Defaults to `false`.
63
59
  */
64
60
  objectRetention?: boolean;
65
61
  /**
66
- * Tags that classify the bucket, for policies to read: written out as
67
- * string literals, as in `{data: "pci"}`. Keys and values are lowercase
68
- * letters, digits, `_` and `-`, at most 63 characters; a key starts with a
69
- * letter, and not with `encore`, which is reserved. At most 32 tags.
62
+ * Static string-literal tags that classify the bucket for policy checks
63
+ * (e.g. `{data: "pci"}`). Keys and values may contain lowercase letters,
64
+ * digits, `_`, and `-`, up to 63 characters. Keys must start with a letter
65
+ * and cannot start with the reserved prefix `encore`. At most 32 tags.
70
66
  */
71
67
  tags?: Record<string, string>;
72
68
  }
73
69
  /**
74
- * A lifecycle rule: an optional prefix and at least one action. Days are
75
- * whole numbers from 1 to 36500 and count from when an object was written,
76
- * or for the noncurrent fields, from when it was replaced or removed.
70
+ * A lifecycle rule with an optional key prefix and at least one action. Day
71
+ * counts are whole numbers from 1 to 36500 measured from creation time (or
72
+ * from replacement/deletion time for noncurrent version rules).
77
73
  */
78
74
  export interface LifecycleRule {
79
- /** Only objects whose names start with it. Defaults to every object. */
75
+ /** Restrict the rule to objects whose names start with this prefix. Defaults to all objects. */
80
76
  prefix?: string;
81
77
  /**
82
- * Move an object to `infrequent` this many days after it was written.
83
- * At least 30.
78
+ * Transition objects to `infrequent` storage this many days after creation.
79
+ * Must be at least 30.
84
80
  */
85
81
  moveToInfrequentAfterDays?: number;
86
82
  /**
87
- * Move an object to `cold` this many days after it was written. With
88
- * `moveToInfrequentAfterDays`, at least 30 days after it.
83
+ * Transition objects to `cold` storage this many days after creation. When
84
+ * combined with `moveToInfrequentAfterDays`, must be at least 30 days later.
89
85
  */
90
86
  moveToColdAfterDays?: number;
91
87
  /**
92
- * Delete an object this many days after it was written. In a versioned
93
- * bucket it becomes a noncurrent version, as `remove` does.
88
+ * Delete objects this many days after creation. In versioned buckets, the
89
+ * object becomes a noncurrent version (just like {@link Bucket.remove}).
94
90
  */
95
91
  deleteAfterDays?: number;
96
92
  /**
97
- * Versioned buckets: delete a noncurrent version this many days after it
98
- * was replaced or removed.
93
+ * Versioned buckets only: delete noncurrent versions this many days after
94
+ * they were replaced or removed.
99
95
  */
100
96
  deleteNoncurrentAfterDays?: number;
101
97
  /**
102
- * Versioned buckets: never delete the newest this many noncurrent
103
- * versions. On its own, delete the noncurrent versions beyond them.
98
+ * Versioned buckets only: retain at least this many of the newest noncurrent
99
+ * versions (deleting older noncurrent versions beyond this count when used
100
+ * on its own).
104
101
  */
105
102
  keepNoncurrentVersions?: number;
106
103
  }
107
104
  /**
108
- * A bucket's retention period.
105
+ * Bucket-level retention period.
109
106
  */
110
107
  export interface Retention {
111
- /** The days, from 1 to 36500, an object is kept after it was written. */
108
+ /** Number of days (1 to 36500) to retain each object after creation. */
112
109
  days: number;
113
110
  }
114
111
  /**
115
- * Defines a new Object Storage bucket infrastructure resource.
112
+ * Declares an Object Storage bucket infrastructure resource.
116
113
  */
117
114
  export declare class Bucket extends BucketPerms implements Uploader, SignedUploader, Downloader, SignedDownloader, Attrser, Lister, Remover, PublicUrler, AttrsUpdater, IfMatchUploader, IfMatchRemover {
118
115
  private readonly bucketName;
119
- /** The runtime's bucket: made on first use in test mode. */
116
+ /** Native runtime bucket, initialized lazily in test mode. */
120
117
  private own?;
121
118
  /**
122
- * Creates a new bucket with the given name and configuration
119
+ * Declares a new bucket with the given name and configuration.
123
120
  */
124
121
  constructor(name: string, cfg?: BucketConfig);
125
- /** The native bucket: in a test, the test's instance of it.
126
- * @internal */
122
+ /** Native bucket handle (resolves to the current test's instance in test mode). @internal */
127
123
  get impl(): runtime.Bucket;
128
124
  /**
129
- * Reference an existing bucket by name.
130
- * To create a new storage bucket, use `new StorageBucket(...)` instead.
125
+ * References an existing bucket by name.
126
+ * To declare a new bucket, use `new Bucket(...)` instead.
131
127
  */
132
128
  static named<name extends string>(name: StringLiteral<name>): Bucket;
133
129
  /**
134
- * Lists the objects in the bucket, sorted by name.
130
+ * Lists objects in the bucket in lexicographical order by name.
135
131
  *
136
- * With a `delimiter`, the names that continue past the `prefix` with the
137
- * delimiter are grouped into one entry per common prefix, with
138
- * `isPrefix` set, as a directory listing does.
132
+ * When `delimiter` is set, keys sharing a common prefix past `options.prefix`
133
+ * up to the delimiter are grouped into a single entry with `isPrefix: true`
134
+ * (similar to a directory listing).
139
135
  */
140
136
  list(options?: ListOptions): AsyncGenerator<ListEntry>;
141
137
  /**
142
- * Lists every stored version of the objects in the bucket, sorted by
143
- * name and then newest first. A removed object has no `latest` version.
144
- * An unversioned bucket lists one latest version per object.
138
+ * Lists all stored object versions in the bucket, sorted by name and then
139
+ * newest first. Deleted objects have no `latest` version. In unversioned
140
+ * buckets, yields one `latest` version per object.
145
141
  */
146
142
  listVersions(options?: ListVersionsOptions): AsyncGenerator<ObjectVersion>;
147
143
  /**
@@ -151,7 +147,7 @@ export declare class Bucket extends BucketPerms implements Uploader, SignedUploa
151
147
  exists(name: string, options?: ExistsOptions): Promise<boolean>;
152
148
  /**
153
149
  * Returns the object's attributes.
154
- * Throws an error if the object does not exist.
150
+ * Throws `ObjectNotFound` if the object does not exist.
155
151
  */
156
152
  attrs(name: string, options?: AttrsOptions): Promise<ObjectAttrs>;
157
153
  /**
@@ -159,101 +155,93 @@ export declare class Bucket extends BucketPerms implements Uploader, SignedUploa
159
155
  */
160
156
  upload(name: string, data: Uint8Array, options?: UploadOptions): Promise<ObjectAttrs>;
161
157
  /**
162
- * Uploads an object to the bucket from a stream of bytes: a Web
163
- * `ReadableStream`, a Node.js `Readable`, or any async iterable of
164
- * `Uint8Array` chunks. The stream is read as fast as the upload takes
165
- * its bytes.
158
+ * Uploads an object from a byte stream — a Web `ReadableStream`, Node.js
159
+ * `Readable`, or any async iterable of `Uint8Array` chunks — pulling chunks
160
+ * as the upload consumes them.
166
161
  *
167
162
  * If the stream errors, the upload is aborted and nothing is stored.
168
163
  */
169
164
  uploadStream(name: string, data: AsyncIterable<Uint8Array> | ReadableStream<Uint8Array>, options?: UploadOptions): Promise<ObjectAttrs>;
170
165
  /**
171
- * Uploads an object only if the bucket still holds the given revision of
172
- * it, as `attrs`, `upload`, `updateAttrs` or a listing returned it, and
173
- * throws `PreconditionFailed` otherwise, also if the object no longer
174
- * exists. This makes read-modify-write safe against concurrent writers.
175
- * A missing revision throws `InvalidArgument`.
176
- *
177
- * `data` is bytes or a stream, as `upload` and `uploadStream` take.
166
+ * Conditionally uploads an object only if the bucket still holds `revision`
167
+ * (returned by `download`, `attrs`, `upload`, `updateAttrs`, or `list`),
168
+ * throwing `PreconditionFailed` if the object changed or was deleted. Throws
169
+ * `InvalidArgument` if `revision` is missing.
178
170
  *
179
- * The match compares the object's contents, not its attributes:
180
- * `updateAttrs` doesn't break it. Google Cloud Storage matches the
181
- * revision's `version`, so a revision without one throws
182
- * `InvalidArgument` there; Amazon S3 and Cloudflare R2 match its `etag`.
171
+ * `data` may be a `Uint8Array` or a stream (as in {@link upload} and
172
+ * {@link uploadStream}). Comparisons check object contents rather than
173
+ * metadata, so {@link updateAttrs} does not invalidate a match. GCS matches
174
+ * on `revision.version` (throwing `InvalidArgument` if absent), while S3 and
175
+ * Cloudflare R2 match on `revision.etag`.
183
176
  *
184
- * On Amazon S3 a conditional write also needs read access to the bucket,
185
- * which Encore grants to the services that call this.
177
+ * On AWS S3, conditional writes also require read permission, which Encore
178
+ * grants automatically to calling services.
186
179
  */
187
180
  uploadIfMatch(name: string, data: Uint8Array | AsyncIterable<Uint8Array> | ReadableStream<Uint8Array>, revision: Revision, options?: UploadIfMatchOptions): Promise<ObjectAttrs>;
188
181
  /**
189
- * Replaces the given attributes of an object and leaves the others as
190
- * they are. An empty string clears an attribute (a cleared content type
191
- * is `application/octet-stream`, as S3 keeps no object without one), and
192
- * `metadata` replaces the whole map.
182
+ * Updates the specified attributes of an object while leaving omitted
183
+ * attributes unchanged. Pass an empty string to clear an attribute (clearing
184
+ * `contentType` resets it to `application/octet-stream`), and pass a new
185
+ * `metadata` object to replace the entire metadata map (`{}` clears it).
193
186
  *
194
- * On S3 this rewrites the object, so a versioned bucket gets a new
195
- * version, and the object's age for lifecycle rules starts over.
187
+ * On AWS S3, updating attributes rewrites the object, creating a new version
188
+ * in versioned buckets and resetting the object's lifecycle age.
196
189
  */
197
190
  updateAttrs(name: string, attrs: UpdateAttrs, options?: UpdateAttrsOptions): Promise<ObjectAttrs>;
198
191
  /**
199
- * Keeps the object until `until` at least. Retention can only be
200
- * extended: a time earlier than the object's current one throws
201
- * `InvalidArgument`. The bucket must be declared with `objectRetention`.
192
+ * Extends the object's retention until at least `until`. Retention can only
193
+ * be extended — passing a time earlier than the current retention throws
194
+ * `InvalidArgument`. Requires `objectRetention: true` on the bucket.
202
195
  */
203
196
  extendRetention(name: string, until: Date, options?: ExtendRetentionOptions): Promise<ObjectAttrs>;
204
197
  /**
205
- * Generate an external URL to allow uploading an object to the bucket.
198
+ * Generates a pre-signed URL allowing anyone with the URL to upload to
199
+ * `name` without additional authentication.
206
200
  *
207
- * Anyone with possession of the URL can write to the given object name
208
- * without any additional auth.
209
- *
210
- * The URL doesn't carry the bucket's storage class: an object uploaded
211
- * through it gets the provider's default class for the bucket.
201
+ * Note: Pre-signed upload URLs do not enforce the bucket's configured
202
+ * `storageClass`; uploaded objects receive the provider's default class.
212
203
  */
213
204
  signedUploadUrl(name: string, options?: UploadUrlOptions): Promise<SignedUploadUrl>;
214
205
  /**
215
- * Generate an external URL to allow downloading an object from the bucket.
216
- *
217
- * Anyone with possession of the URL can download the given object without
218
- * any additional auth.
206
+ * Generates a pre-signed URL allowing anyone with the URL to download `name`
207
+ * without additional authentication.
219
208
  */
220
209
  signedDownloadUrl(name: string, options?: DownloadUrlOptions): Promise<SignedDownloadUrl>;
221
210
  /**
222
- * Downloads an object from the bucket and returns its contents.
223
- */
224
- download(name: string, options?: DownloadOptions): Promise<Buffer>;
225
- /**
226
- * Downloads an object from the bucket as a Web `ReadableStream`, read
227
- * from the provider as the consumer reads it. A missing object throws
228
- * here, before any bytes. Cancelling the stream stops the download.
211
+ * Starts downloading an object from the bucket. Resolves as soon as the
212
+ * provider responds (throwing immediately if the object is missing or the
213
+ * byte range is invalid), returning a {@link Download} with response
214
+ * metadata and one-shot `bytes()` / `stream()` readers.
229
215
  *
230
- * In Node.js, `Readable.fromWeb` converts it to a Node.js stream.
216
+ * ```ts
217
+ * const d = await uploads.download("state.json");
218
+ * const state = JSON.parse((await d.bytes()).toString());
219
+ * // Write only if nobody else updated the object since we read it.
220
+ * await uploads.uploadIfMatch("state.json", next(state), d.revision);
221
+ * ```
231
222
  */
232
- downloadStream(name: string, options?: DownloadOptions): Promise<ReadableStream<Uint8Array>>;
223
+ download(name: string, options?: DownloadOptions): Promise<Download>;
233
224
  /**
234
225
  * Removes an object from the bucket.
235
226
  * Throws an error on network failure.
236
227
  */
237
228
  remove(name: string, options?: DeleteOptions): Promise<void>;
238
229
  /**
239
- * Removes an object only if the bucket still holds the given revision of
240
- * it, as `attrs`, `upload`, `updateAttrs` or a listing returned it, and
241
- * throws `PreconditionFailed` otherwise, also if the object no longer
242
- * exists. It compares the latest version, so there is no `version` to
243
- * remove. A missing revision throws `InvalidArgument`.
230
+ * Conditionally removes an object only if its latest version still matches
231
+ * `revision` (returned by `download`, `attrs`, `upload`, `updateAttrs`, or
232
+ * `list`), throwing `PreconditionFailed` if it changed or no longer exists.
233
+ * Throws `InvalidArgument` if `revision` is missing.
244
234
  *
245
- * The match compares the object's contents, not its attributes:
246
- * `updateAttrs` doesn't break it.
247
- *
248
- * On Amazon S3 a conditional delete also needs read access to the
249
- * bucket, which Encore grants to the services that call this. Cloudflare
250
- * R2 doesn't support conditional deletes: there it throws
235
+ * Comparisons check object contents rather than metadata, so
236
+ * {@link updateAttrs} does not invalidate a match. On AWS S3, conditional
237
+ * deletes require read permission (granted automatically by Encore).
238
+ * Cloudflare R2 does not support conditional deletes and throws
251
239
  * `InvalidArgument`.
252
240
  */
253
241
  removeIfMatch(name: string, revision: Revision): Promise<void>;
254
242
  /**
255
- * Returns the public URL for accessing the object with the given name.
256
- * Throws an error if the bucket is not public.
243
+ * Returns the public CDN URL for accessing the object.
244
+ * Throws an error if the bucket is not declared with `public: true`.
257
245
  */
258
246
  publicUrl(name: string): string;
259
247
  ref<P extends BucketPerms>(): P;
@@ -263,18 +251,18 @@ export declare class Bucket extends BucketPerms implements Uploader, SignedUploa
263
251
  */
264
252
  export interface ListOptions {
265
253
  /**
266
- * Only include objects with this prefix in the listing.
267
- * If unset, all objects are included.
254
+ * Only include objects whose names start with this prefix.
255
+ * Defaults to all objects.
268
256
  */
269
257
  prefix?: string;
270
258
  /**
271
- * Maximum number of entries to return, common prefixes included.
272
- * Defaults to no limit.
259
+ * Maximum number of entries to return (including common prefixes).
260
+ * Unlimited when unset.
273
261
  */
274
262
  limit?: number;
275
263
  /**
276
- * Group the names that continue past the prefix with this delimiter,
277
- * usually `"/"`, into one entry per common prefix.
264
+ * Delimiter (typically `"/"`) used to group object names past `prefix` into
265
+ * single common-prefix entries.
278
266
  */
279
267
  delimiter?: string;
280
268
  }
@@ -283,34 +271,30 @@ export interface ListOptions {
283
271
  */
284
272
  export interface ListVersionsOptions {
285
273
  /**
286
- * Only include objects with this prefix in the listing.
287
- * If unset, all objects are included.
274
+ * Only include objects whose names start with this prefix.
275
+ * Defaults to all objects.
288
276
  */
289
277
  prefix?: string;
290
- /** Maximum number of versions to return. Defaults to no limit. */
278
+ /** Maximum number of versions to return. Unlimited when unset. */
291
279
  limit?: number;
292
280
  }
293
281
  /**
294
- * Options for retrieving the attributes of an object.
282
+ * Options for retrieving an object's attributes.
295
283
  */
296
284
  export interface AttrsOptions {
297
285
  /**
298
- * The object version to retrieve attributes for.
299
- * Defaults to the lastest version if unset.
300
- *
301
- * If bucket versioning is not enabled, this option is ignored.
286
+ * Object version to inspect. Defaults to the latest version.
287
+ * Ignored if bucket versioning is disabled.
302
288
  */
303
289
  version?: string;
304
290
  }
305
291
  /**
306
- * Options for checking the existence of an object.
292
+ * Options for checking whether an object exists.
307
293
  */
308
294
  export interface ExistsOptions {
309
295
  /**
310
- * The object version to check for existence.
311
- * Defaults to the lastest version if unset.
312
- *
313
- * If bucket versioning is not enabled, this option is ignored.
296
+ * Object version to check. Defaults to the latest version.
297
+ * Ignored if bucket versioning is disabled.
314
298
  */
315
299
  version?: string;
316
300
  }
@@ -319,112 +303,154 @@ export interface ExistsOptions {
319
303
  */
320
304
  export interface DeleteOptions {
321
305
  /**
322
- * The object version to delete.
323
- * Defaults to the lastest version if unset.
324
- *
325
- * If bucket versioning is not enabled, this option is ignored.
306
+ * Object version to delete. Defaults to the latest version.
307
+ * Ignored if bucket versioning is disabled.
326
308
  */
327
309
  version?: string;
328
310
  }
329
311
  /**
330
- * A contiguous byte range within an object.
312
+ * A contiguous byte range within an object: either `length` bytes starting at
313
+ * `offset`, or the final `last` bytes of the object.
331
314
  */
332
- export interface ByteRange {
333
- /** The zero-based index of the first byte to read. */
315
+ export type ByteRange = {
316
+ /** Zero-based index of the first byte to read. */
334
317
  offset: number;
335
318
  /**
336
- * The number of bytes to read.
337
- * Defaults to reading to the end of the object if unset.
319
+ * Number of bytes to read. Reads through the end of the object when
320
+ * omitted.
338
321
  */
339
322
  length?: number;
340
- }
323
+ last?: never;
324
+ } | {
325
+ /**
326
+ * Read the final `last` bytes of the object (or the entire object if it
327
+ * is shorter). Check {@link Download.size} for the object's full length.
328
+ */
329
+ last: number;
330
+ offset?: never;
331
+ length?: never;
332
+ };
341
333
  /**
342
334
  * Options for downloading an object from a bucket.
343
335
  */
344
336
  export interface DownloadOptions {
345
337
  /**
346
- * The object version to download.
347
- * Defaults to the lastest version if unset.
348
- *
349
- * If bucket versioning is not enabled, this option is ignored.
338
+ * Object version to download. Defaults to the latest version.
339
+ * Ignored if bucket versioning is disabled.
350
340
  */
351
341
  version?: string;
352
342
  /**
353
- * Download only the given byte range of the object, instead of the whole
354
- * object. The returned Buffer contains just the requested bytes.
343
+ * Optional byte range to download instead of the full object. The body
344
+ * contains only the requested slice while {@link Download.size} still
345
+ * reports the full object size.
355
346
  *
356
- * Throws InvalidArgument if the range is empty or lies beyond the end
357
- * of the object.
347
+ * Throws `InvalidArgument` if the range is empty or starts past the end of
348
+ * the object.
358
349
  */
359
350
  range?: ByteRange;
360
351
  }
361
352
  /**
362
- * One revision of an object: what `uploadIfMatch`, `removeIfMatch` and the
363
- * `ifMatch` precondition of `updateAttrs` compare. `ObjectAttrs` is one, so
364
- * the attributes an operation returned can be passed as they are.
353
+ * An in-progress download returned by {@link Bucket.download}, exposing basic
354
+ * response metadata and one-shot body readers (`bytes()` or `stream()`).
355
+ *
356
+ * Includes only the metadata providers send alongside download responses (use
357
+ * {@link Bucket.attrs} for full metadata). An unread download holds its
358
+ * connection open until garbage collected; call `await d.stream().cancel()` to
359
+ * release it early.
360
+ */
361
+ export interface Download {
362
+ /**
363
+ * Revision of the downloaded contents. Pass to {@link Bucket.uploadIfMatch}
364
+ * or {@link Bucket.removeIfMatch} for optimistic concurrency control.
365
+ */
366
+ readonly revision: Revision;
367
+ /** Full object size in bytes, even when downloading a byte range. */
368
+ readonly size: number;
369
+ readonly contentType?: string;
370
+ /** Last modification timestamp, if reported by the provider. */
371
+ readonly lastModified?: Date;
372
+ /**
373
+ * Buffers and returns the entire download body. Throws `InvalidArgument` if
374
+ * the body has already been consumed.
375
+ */
376
+ bytes(): Promise<Buffer>;
377
+ /**
378
+ * Streams the download body as a Web `ReadableStream`. Canceling the stream
379
+ * aborts the download. Throws `InvalidArgument` if the body has already been
380
+ * consumed.
381
+ *
382
+ * In Node.js, use `Readable.fromWeb` to convert this into a Node stream.
383
+ */
384
+ stream(): ReadableStream<Uint8Array>;
385
+ }
386
+ /**
387
+ * Identifies a specific content revision of an object for conditional
388
+ * operations (`uploadIfMatch`, `removeIfMatch`, and `updateAttrs` `ifMatch`).
389
+ * Both {@link ObjectAttrs} and {@link Download.revision} satisfy `Revision`.
365
390
  */
366
391
  export interface Revision {
367
392
  etag: string;
368
393
  version?: string;
369
394
  }
370
395
  /**
371
- * Conditions on the object an upload writes.
396
+ * Preconditions for an upload.
372
397
  */
373
398
  export interface Preconditions {
374
399
  /**
375
- * Only write the object if it does not exist yet.
376
- * Throws `PreconditionFailed` otherwise.
400
+ * Only write the object if it does not already exist; throws
401
+ * `PreconditionFailed` otherwise.
377
402
  */
378
403
  notExists?: boolean;
379
404
  }
380
405
  /**
381
- * Describes the attributes of an object stored in a bucket.
406
+ * Attributes of an object stored in a bucket.
382
407
  */
383
408
  export interface ObjectAttrs {
384
409
  name: string;
385
410
  size: number;
386
- /** The version of the object, if bucket versioning is enabled. */
411
+ /** Object version identifier, if bucket versioning is enabled. */
387
412
  version?: string;
388
413
  etag: string;
389
414
  contentType?: string;
390
415
  cacheControl?: string;
391
416
  contentDisposition?: string;
392
- /** Custom metadata; empty if the object has none. */
417
+ /** Custom metadata map (empty object if none). */
393
418
  metadata: Record<string, string>;
394
- /** When this version of the object was written. */
419
+ /** Timestamp when this object version was written. */
395
420
  lastModified?: Date;
396
421
  /**
397
- * The object's storage class. Every object in a bucket whose class is
398
- * `"auto"` reads `"auto"`. Undefined for a class Encore doesn't model,
399
- * set outside Encore.
422
+ * Object storage class (`"auto"` for buckets with `storageClass: "auto"`,
423
+ * or `undefined` if a provider-specific class was set outside Encore).
400
424
  */
401
425
  storageClass?: StorageClass | 'auto';
402
- /** The object's own retain-until time, if it has one. */
426
+ /** Per-object retain-until timestamp, if set. */
403
427
  retainUntil?: Date;
404
428
  }
405
429
  /**
406
- * A single entry returned when listing objects in a bucket.
430
+ * A single entry yielded by {@link Bucket.list}.
407
431
  */
408
432
  export interface ListEntry {
409
- /** The object's name, or a common prefix, ending in the delimiter. */
433
+ /** Object key, or common prefix ending with the delimiter. */
410
434
  name: string;
411
435
  size: number;
412
436
  etag: string;
437
+ /** Timestamp when the object was written (unset for common prefixes). */
438
+ lastModified?: Date;
413
439
  /**
414
- * Whether the entry is a common prefix of a listing with a delimiter,
415
- * rather than an object. A prefix has size 0 and an empty etag.
440
+ * `true` when this entry represents a common prefix grouped by a delimiter
441
+ * (with `size: 0` and empty `etag`), rather than an object.
416
442
  */
417
443
  isPrefix: boolean;
418
444
  }
419
445
  /**
420
- * One stored version of an object, as `listVersions` lists it.
446
+ * A single stored object version yielded by {@link Bucket.listVersions}.
421
447
  */
422
448
  export interface ObjectVersion {
423
449
  name: string;
424
450
  version?: string;
425
451
  size: number;
426
452
  etag: string;
427
- /** Whether this is the object's current version. */
453
+ /** Whether this is the object's current (latest) version. */
428
454
  latest: boolean;
429
455
  lastModified?: Date;
430
456
  }
@@ -433,34 +459,35 @@ export interface ObjectVersion {
433
459
  */
434
460
  export interface UploadOptions {
435
461
  contentType?: string;
436
- /** The `Cache-Control` header that downloads of the object get. */
462
+ /** `Cache-Control` header returned when downloading the object. */
437
463
  cacheControl?: string;
438
- /** The `Content-Disposition` header that downloads of the object get. */
464
+ /** `Content-Disposition` header returned when downloading the object. */
439
465
  contentDisposition?: string;
440
466
  /**
441
- * Custom metadata. Keys match `[a-z0-9][a-z0-9_-]*` and values are
442
- * printable ASCII. Keys and values together may take 8 KiB on GCS and
467
+ * Custom key-value metadata. Keys must match `[a-z0-9][a-z0-9_-]*` and
468
+ * values must be printable ASCII. Total size is limited to 8 KiB on GCS and
443
469
  * 2 KiB on S3.
444
470
  */
445
471
  metadata?: Record<string, string>;
446
- /** The object's storage class. Defaults to the bucket's. */
472
+ /** Object storage class. Defaults to the bucket's configured storage class. */
447
473
  storageClass?: StorageClass;
448
474
  /**
449
- * Keep the object until then: it can't be deleted or overwritten
450
- * sooner. The bucket must be declared with `objectRetention`.
475
+ * Prevents the object from being deleted or overwritten until this time.
476
+ * Requires `objectRetention: true` on the bucket.
451
477
  */
452
478
  retainUntil?: Date;
453
479
  preconditions?: Preconditions;
454
480
  }
455
481
  /**
456
- * Options for `uploadIfMatch`: those of `upload`, without preconditions.
482
+ * Options for {@link Bucket.uploadIfMatch} (all {@link UploadOptions} except
483
+ * `preconditions`).
457
484
  */
458
485
  export type UploadIfMatchOptions = Omit<UploadOptions, 'preconditions'>;
459
486
  /**
460
- * The attributes `updateAttrs` replaces. An attribute left out stays as it
461
- * is, and an empty string clears it; a cleared `contentType` is
462
- * `application/octet-stream`. `metadata` replaces the whole map, so `{}`
463
- * clears it.
487
+ * Attributes to update via {@link Bucket.updateAttrs}. Omitted fields remain
488
+ * unchanged; an empty string clears a field (clearing `contentType` resets it
489
+ * to `application/octet-stream`). `metadata` replaces the entire map (`{}`
490
+ * clears it).
464
491
  */
465
492
  export interface UpdateAttrs {
466
493
  contentType?: string;
@@ -472,12 +499,12 @@ export interface UpdateAttrs {
472
499
  * Options for updating an object's attributes.
473
500
  */
474
501
  export interface UpdateAttrsOptions {
475
- /** The object version to update. Defaults to the latest. */
502
+ /** Object version to update. Defaults to the latest version. */
476
503
  version?: string;
477
504
  preconditions?: {
478
505
  /**
479
- * Only update the object if it is still this revision.
480
- * Throws `PreconditionFailed` otherwise.
506
+ * Only update the object if it still matches this revision; throws
507
+ * `PreconditionFailed` otherwise.
481
508
  */
482
509
  ifMatch?: Revision;
483
510
  };
@@ -486,16 +513,16 @@ export interface UpdateAttrsOptions {
486
513
  * Options for extending an object's retention.
487
514
  */
488
515
  export interface ExtendRetentionOptions {
489
- /** The object version to retain. Defaults to the latest. */
516
+ /** Object version to retain. Defaults to the latest version. */
490
517
  version?: string;
491
518
  }
492
519
  /**
493
520
  * Options for generating a signed upload URL.
494
521
  */
495
522
  export interface UploadUrlOptions {
496
- /** The expiration time of the url, in seconds from signing. The maximum
497
- * value is seven days. If no value is given, a default of one hour is
498
- * used. */
523
+ /**
524
+ * URL lifetime in seconds from creation (maximum 7 days; defaults to 1 hour).
525
+ */
499
526
  ttl?: number;
500
527
  }
501
528
  /**
@@ -508,9 +535,9 @@ export interface SignedUploadUrl {
508
535
  * Options for generating a signed download URL.
509
536
  */
510
537
  export interface DownloadUrlOptions {
511
- /** The expiration time of the url, in seconds from signing. The maximum
512
- * value is seven days. If no value is given, a default of one hour is
513
- * used. */
538
+ /**
539
+ * URL lifetime in seconds from creation (maximum 7 days; defaults to 1 hour).
540
+ */
514
541
  ttl?: number;
515
542
  }
516
543
  /**