@gusto/baerly-storage 0.6.0 → 0.7.0

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 (218) hide show
  1. package/README.md +47 -124
  2. package/dist/API.md +161 -512
  3. package/dist/CHANGELOG.md +1137 -378
  4. package/dist/RECIPES.md +398 -80
  5. package/dist/THIRD-PARTY-LICENSES.txt +5 -26
  6. package/dist/{app-config-DyiFK3_k.d.ts → app-config-C6qW7m8S.d.ts} +119 -111
  7. package/dist/app-config.d.ts +31 -1
  8. package/dist/app-config.js +1 -2
  9. package/dist/app-config.js.map +1 -1
  10. package/dist/auth.d.ts +33 -28
  11. package/dist/auth.js +549 -985
  12. package/dist/auth.js.map +1 -1
  13. package/dist/baerly.js +130 -138
  14. package/dist/baerly.js.map +1 -1
  15. package/dist/baerly.spec.json +97 -22
  16. package/dist/capacity-warning-header-BlVopyiI.js +16 -0
  17. package/dist/capacity-warning-header-BlVopyiI.js.map +1 -0
  18. package/dist/{client-ypCm3zjt.d.ts → client-CHQTXpef.d.ts} +121 -36
  19. package/dist/client-react.d.ts +67 -20
  20. package/dist/client-react.js +240 -54
  21. package/dist/client-react.js.map +1 -1
  22. package/dist/client.d.ts +5 -4
  23. package/dist/client.js +51 -16
  24. package/dist/client.js.map +1 -1
  25. package/dist/{cloudflare-wrVYf4bb.js → cloudflare-CKHYXccw.js} +61 -82
  26. package/dist/cloudflare-CKHYXccw.js.map +1 -0
  27. package/dist/cloudflare.d.ts +106 -71
  28. package/dist/cloudflare.js +334 -271
  29. package/dist/cloudflare.js.map +1 -1
  30. package/dist/code-resolution-CL_7L0wS.js +22 -0
  31. package/dist/code-resolution-CL_7L0wS.js.map +1 -0
  32. package/dist/collection-api-DbyhLAY8.d.ts +1001 -0
  33. package/dist/config-DEzInG6M.js +4035 -0
  34. package/dist/config-DEzInG6M.js.map +1 -0
  35. package/dist/constants-D3GSH3tc.js +469 -0
  36. package/dist/constants-D3GSH3tc.js.map +1 -0
  37. package/dist/{context-DRZ3tZ5l.js → context-rlpSnHFA.js} +17 -17
  38. package/dist/context-rlpSnHFA.js.map +1 -0
  39. package/dist/cost-B52llVDx.js +330 -0
  40. package/dist/cost-B52llVDx.js.map +1 -0
  41. package/dist/{current-json-C6nhPOm1.js → current-json-CC6lE4Aj.js} +115 -32
  42. package/dist/current-json-CC6lE4Aj.js.map +1 -0
  43. package/dist/db-plFUNTSF.d.ts +130 -0
  44. package/dist/db-read-seams-BSs0m1z1.js +3261 -0
  45. package/dist/db-read-seams-BSs0m1z1.js.map +1 -0
  46. package/dist/{deploy-Di_Q01qx.js → deploy-Obj4nE-Z.js} +10 -14
  47. package/dist/deploy-Obj4nE-Z.js.map +1 -0
  48. package/dist/{dev-banner-CWHIk8tH.d.ts → dev-banner-B5AUHmu1.d.ts} +1 -4
  49. package/dist/dev-landing-BI5UdmOb.d.ts +32 -0
  50. package/dist/dev-landing-CD-si4dW.js +50 -0
  51. package/dist/dev-landing-CD-si4dW.js.map +1 -0
  52. package/dist/dev-vite.d.ts +9 -14
  53. package/dist/dev-vite.js +11 -10
  54. package/dist/dev-vite.js.map +1 -1
  55. package/dist/dev.d.ts +3 -2
  56. package/dist/dev.js +2 -1
  57. package/dist/doctor-BA0i-YAN.js +270 -0
  58. package/dist/doctor-BA0i-YAN.js.map +1 -0
  59. package/dist/dump-D1vX8ozg.js +133 -0
  60. package/dist/dump-D1vX8ozg.js.map +1 -0
  61. package/dist/errors-7Rk1HGCE.js +160 -0
  62. package/dist/errors-7Rk1HGCE.js.map +1 -0
  63. package/dist/{validate-DtljsCh1.js → export-BVL2EvYE.js} +409 -19
  64. package/dist/export-BVL2EvYE.js.map +1 -0
  65. package/dist/fsck-BWkPgov4.js +145 -0
  66. package/dist/fsck-BWkPgov4.js.map +1 -0
  67. package/dist/{gcs-admin-Bx6xSNJj.d.ts → gcs-admin-Dso1HWQj.d.ts} +18 -14
  68. package/dist/gcs.d.ts +19 -7
  69. package/dist/gcs.js +1 -2
  70. package/dist/{goog4-signer-Z7KnJ1su.js → goog4-signer-CeLIABoE.js} +102 -92
  71. package/dist/goog4-signer-CeLIABoE.js.map +1 -0
  72. package/dist/{http-7zT29K3P.js → http-Z5rZyYMX.js} +898 -271
  73. package/dist/http-Z5rZyYMX.js.map +1 -0
  74. package/dist/http-transport-DNUM8kU-.js +1299 -0
  75. package/dist/http-transport-DNUM8kU-.js.map +1 -0
  76. package/dist/http.d.ts +366 -294
  77. package/dist/http.js +2 -2
  78. package/dist/index-JJrIu1pO.d.ts +135 -0
  79. package/dist/index-LEgHN0qJ.d.ts +50 -0
  80. package/dist/{index-DP3ClvcA.d.ts → index-RiEYj8t0.d.ts} +291 -78
  81. package/dist/index.d.ts +27 -6
  82. package/dist/index.js +3 -5
  83. package/dist/inspect-BTsVYZKd.js +196 -0
  84. package/dist/inspect-BTsVYZKd.js.map +1 -0
  85. package/dist/{key-Di6yyxFu.js → key-C4FPZ9Io.js} +3 -4
  86. package/dist/{key-Di6yyxFu.js.map → key-C4FPZ9Io.js.map} +1 -1
  87. package/dist/ledger-Dj_bGgo0.js +192 -0
  88. package/dist/ledger-Dj_bGgo0.js.map +1 -0
  89. package/dist/legacy-names-DgZBtgOh.js +47 -0
  90. package/dist/legacy-names-DgZBtgOh.js.map +1 -0
  91. package/dist/log-C9W15Dfo.d.ts +94 -0
  92. package/dist/log-tail-DWJbneBF.js +142 -0
  93. package/dist/log-tail-DWJbneBF.js.map +1 -0
  94. package/dist/log-walk-C-vA-WGJ.js +111 -0
  95. package/dist/log-walk-C-vA-WGJ.js.map +1 -0
  96. package/dist/maintenance-Dd-Yakqj.js +1709 -0
  97. package/dist/maintenance-Dd-Yakqj.js.map +1 -0
  98. package/dist/maintenance-DevB6z4e.js +2237 -0
  99. package/dist/maintenance-DevB6z4e.js.map +1 -0
  100. package/dist/maintenance.d.ts +100 -3
  101. package/dist/maintenance.js +1 -3
  102. package/dist/node.d.ts +119 -92
  103. package/dist/node.js +3 -3
  104. package/dist/{observability-Ch-VQJyE.js → observability-C-ISCCLE.js} +1247 -326
  105. package/dist/observability-C-ISCCLE.js.map +1 -0
  106. package/dist/observability.d.ts +27 -3
  107. package/dist/observability.js +3 -3
  108. package/dist/path-segment-DBXG26PW.js +363 -0
  109. package/dist/path-segment-DBXG26PW.js.map +1 -0
  110. package/dist/{plan-C4qgiXSg.js → plan-BvQbaNMe.js} +19 -11
  111. package/dist/plan-BvQbaNMe.js.map +1 -0
  112. package/dist/request-CRWiTrza.js +272 -0
  113. package/dist/request-CRWiTrza.js.map +1 -0
  114. package/dist/restore-U6Im8V1V.js +1467 -0
  115. package/dist/restore-U6Im8V1V.js.map +1 -0
  116. package/dist/retry-OBtLB2GC.js +126 -0
  117. package/dist/retry-OBtLB2GC.js.map +1 -0
  118. package/dist/rolldown-runtime-D3KUYPsf.js +12 -0
  119. package/dist/{runtime-spec--LykAdl1.js → runtime-spec-B5mg3pHF.js} +189 -28
  120. package/dist/runtime-spec-B5mg3pHF.js.map +1 -0
  121. package/dist/{s3-http-DD5gDc7t.d.ts → s3-http-DBC_wiCL.d.ts} +14 -8
  122. package/dist/s3.d.ts +20 -7
  123. package/dist/s3.js +4 -5
  124. package/dist/s3.js.map +1 -1
  125. package/dist/{sha256-CqcKTjw9.js → sha256-4FfGQNPw.js} +9 -9
  126. package/dist/sha256-4FfGQNPw.js.map +1 -0
  127. package/dist/{shared-secret-DgEicd3x.js → shared-secret-Vkur-8r0.js} +27 -15
  128. package/dist/shared-secret-Vkur-8r0.js.map +1 -0
  129. package/dist/{aws4fetch.esm-CXE5ZbAa.js → sigv4-sign-5IUflUD_.js} +143 -96
  130. package/dist/sigv4-sign-5IUflUD_.js.map +1 -0
  131. package/dist/snapshot-CknzkDM0.js +148 -0
  132. package/dist/snapshot-CknzkDM0.js.map +1 -0
  133. package/dist/{src-BMFfDUI2.js → src-Actga-bO.js} +949 -363
  134. package/dist/src-Actga-bO.js.map +1 -0
  135. package/dist/src-D0MQfvOp.js +812 -0
  136. package/dist/src-D0MQfvOp.js.map +1 -0
  137. package/dist/src-Dr9uo3dc.js +501 -0
  138. package/dist/src-Dr9uo3dc.js.map +1 -0
  139. package/dist/{subcommand-BV68pqwJ.js → subcommand-BLoF66dG.js} +89 -16
  140. package/dist/subcommand-BLoF66dG.js.map +1 -0
  141. package/dist/{time-DUqvFMHq.js → time-DRxTP9iv.js} +15 -34
  142. package/dist/time-DRxTP9iv.js.map +1 -0
  143. package/dist/types-suVbsEWS.d.ts +116 -0
  144. package/dist/{usage-BMZR8o6U.js → usage-CPzVhrQr.js} +40 -45
  145. package/dist/usage-CPzVhrQr.js.map +1 -0
  146. package/dist/uuid-BuT_c404.js +333 -0
  147. package/dist/uuid-BuT_c404.js.map +1 -0
  148. package/dist/verifier-Bmlmndzo.d.ts +95 -0
  149. package/dist/{wire-izfGZDvr.js → wire-DndvKU-K.js} +2 -3
  150. package/dist/wire-DndvKU-K.js.map +1 -0
  151. package/package.json +90 -69
  152. package/dist/aws4fetch.esm-CXE5ZbAa.js.map +0 -1
  153. package/dist/bytes-BXdamO3L.js +0 -11
  154. package/dist/bytes-BXdamO3L.js.map +0 -1
  155. package/dist/cloudflare-wrVYf4bb.js.map +0 -1
  156. package/dist/config-B6nTy8e2.js +0 -3095
  157. package/dist/config-B6nTy8e2.js.map +0 -1
  158. package/dist/constants-CfeMWQWk.js +0 -222
  159. package/dist/constants-CfeMWQWk.js.map +0 -1
  160. package/dist/context-DRZ3tZ5l.js.map +0 -1
  161. package/dist/cost-_SE_SVgZ.js +0 -203
  162. package/dist/cost-_SE_SVgZ.js.map +0 -1
  163. package/dist/current-json-C6nhPOm1.js.map +0 -1
  164. package/dist/db-DjjthkTi.d.ts +0 -254
  165. package/dist/deploy-Di_Q01qx.js.map +0 -1
  166. package/dist/doctor-RWVRpvat.js +0 -102
  167. package/dist/doctor-RWVRpvat.js.map +0 -1
  168. package/dist/dump-m2vEYDNY.js +0 -94
  169. package/dist/dump-m2vEYDNY.js.map +0 -1
  170. package/dist/errors-Dfa3p78c.js +0 -78
  171. package/dist/errors-Dfa3p78c.js.map +0 -1
  172. package/dist/export-DenKwEQu.js +0 -401
  173. package/dist/export-DenKwEQu.js.map +0 -1
  174. package/dist/fsck-2Vq-7-e2.js +0 -279
  175. package/dist/fsck-2Vq-7-e2.js.map +0 -1
  176. package/dist/goog4-signer-Z7KnJ1su.js.map +0 -1
  177. package/dist/http-7zT29K3P.js.map +0 -1
  178. package/dist/http-transport-BTgVCY5r.js +0 -1250
  179. package/dist/http-transport-BTgVCY5r.js.map +0 -1
  180. package/dist/index-BHz92Acj.d.ts +0 -162
  181. package/dist/index-CEZKQsKt.d.ts +0 -1113
  182. package/dist/index-uE-w2dgj.d.ts +0 -115
  183. package/dist/indexes-Dn9hbGQG.d.ts +0 -22
  184. package/dist/inspect-BpYbH1DM.js +0 -133
  185. package/dist/inspect-BpYbH1DM.js.map +0 -1
  186. package/dist/log-tail-QWU4wlu-.js +0 -514
  187. package/dist/log-tail-QWU4wlu-.js.map +0 -1
  188. package/dist/maintenance-BGHGt2Yg.d.ts +0 -537
  189. package/dist/maintenance-DULFcpd1.js +0 -2144
  190. package/dist/maintenance-DULFcpd1.js.map +0 -1
  191. package/dist/maintenance-fEi-UZ2o.js +0 -1412
  192. package/dist/maintenance-fEi-UZ2o.js.map +0 -1
  193. package/dist/normalize-rjnZLwS4.js +0 -133
  194. package/dist/normalize-rjnZLwS4.js.map +0 -1
  195. package/dist/observability-Ch-VQJyE.js.map +0 -1
  196. package/dist/plan-C4qgiXSg.js.map +0 -1
  197. package/dist/query-C43r-6ib.js +0 -1773
  198. package/dist/query-C43r-6ib.js.map +0 -1
  199. package/dist/rebuild-index-BH1dc1p6.js +0 -81
  200. package/dist/rebuild-index-BH1dc1p6.js.map +0 -1
  201. package/dist/request-u0M51mhJ.js +0 -72
  202. package/dist/request-u0M51mhJ.js.map +0 -1
  203. package/dist/restore-D0VYWzfP.js +0 -778
  204. package/dist/restore-D0VYWzfP.js.map +0 -1
  205. package/dist/rolldown-runtime-EAsCxrDo.js +0 -14
  206. package/dist/runtime-spec--LykAdl1.js.map +0 -1
  207. package/dist/sha256-CqcKTjw9.js.map +0 -1
  208. package/dist/shared-secret-DgEicd3x.js.map +0 -1
  209. package/dist/src-BMFfDUI2.js.map +0 -1
  210. package/dist/src-DYZ4H1aF.js +0 -392
  211. package/dist/src-DYZ4H1aF.js.map +0 -1
  212. package/dist/src-DvbTEya2.js +0 -536
  213. package/dist/src-DvbTEya2.js.map +0 -1
  214. package/dist/subcommand-BV68pqwJ.js.map +0 -1
  215. package/dist/time-DUqvFMHq.js.map +0 -1
  216. package/dist/usage-BMZR8o6U.js.map +0 -1
  217. package/dist/validate-DtljsCh1.js.map +0 -1
  218. package/dist/wire-izfGZDvr.js.map +0 -1
package/dist/http.js CHANGED
@@ -1,3 +1,3 @@
1
- import { u as errorEnvelope } from "./observability-Ch-VQJyE.js";
2
- import { a as longPollSince, i as listEventsSince, n as createRouter, r as mapError, t as MAX_BODY_BYTES } from "./http-7zT29K3P.js";
1
+ import { a as longPollSince, i as listEventsSince, n as createRouter, r as mapError, t as MAX_BODY_BYTES } from "./http-Z5rZyYMX.js";
2
+ import { m as errorEnvelope } from "./observability-C-ISCCLE.js";
3
3
  export { MAX_BODY_BYTES, createRouter, errorEnvelope, listEventsSince, longPollSince, mapError };
@@ -0,0 +1,135 @@
1
+ import { a as StoragePutOptions, i as StorageListEntry, n as StorageGetOptions, o as StoragePutResult, r as StorageGetResult, t as Storage } from "./types-suVbsEWS.js";
2
+ /**
3
+ * Optional pre-warm: idempotently create the `current.json` manifest
4
+ * for a single `(app, tenant, collection)` triple. The kernel auto-creates
5
+ * this manifest on the first commit anyway (see `Db.create` and
6
+ * `Writer.commit`), so calling `ensureTable` is **not required** for
7
+ * correctness — it's a one-Class-A-PUT optimization for callers that
8
+ * want the manifest in place before the first request lands (seed
9
+ * scripts, deploy-time provisioning, CI fixtures that snapshot the
10
+ * bucket between phases, etc.).
11
+ *
12
+ * Wraps {@link createCurrentJson} with the canonical key shape
13
+ * (`app/<app>/tenant/<tenant>/manifests/<collection>/current.json`) and
14
+ * swallows `BaerlyError{code:"WriteConflict"}` so re-runs are safe. The
15
+ * three names follow the same rule as `Db.create` / `db.collection`
16
+ * (including Unicode Normalization Form C), refused with
17
+ * `BaerlyError{code:"InvalidConfig"}` before any write. An
18
+ * existing manifest is preserved verbatim — this function never
19
+ * overwrites a populated manifest. The seed shape matches the kernel's
20
+ * auto-create, with one deliberate exception: `generation` is a fresh
21
+ * nonce, so a pre-warm and an auto-provision are equivalent rather than
22
+ * byte-identical. Only one of them can win the `If-None-Match` create,
23
+ * and a generation is only ever compared against a cursor minted from
24
+ * it, so the difference is unobservable.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * import { LocalFsStorage, ensureTable } from "@gusto/baerly-storage/dev";
29
+ *
30
+ * const storage = new LocalFsStorage({ root: "./.baerly-data" });
31
+ * // Pre-warm so the first request doesn't pay the bootstrap PUT.
32
+ * await ensureTable(storage, { app: "helpdesk", tenant: "demo", collection: "tickets" });
33
+ * // …then `baerlyNode({ config, storage, verifier })`.
34
+ * ```
35
+ */
36
+ declare const ensureTable: (storage: Storage, args: {
37
+ app: string;
38
+ tenant: string;
39
+ collection: string;
40
+ }) => Promise<void>;
41
+ interface LocalFsStorageOptions {
42
+ /** Root directory; treated as "the bucket". */
43
+ root: string;
44
+ }
45
+ /**
46
+ * `Storage` backed by a directory tree. Keys may contain `/` and map
47
+ * to nested directories on disk so `ls`/`cat` work as expected.
48
+ *
49
+ * Keys are byte-exact, as on S3 and R2: keys that differ only by case or
50
+ * Unicode normalization are distinct objects even on a filesystem that
51
+ * folds both (default macOS APFS). Each segment is escaped into a
52
+ * fold-invariant alphabet on disk — `A` is stored as `%41`, NFC `é` as
53
+ * `%c3%a9` — while kernel-written segments (lowercase ids, base-32 index
54
+ * values, `current.json`) are stored verbatim. See
55
+ * `local-fs-key-codec.ts`.
56
+ *
57
+ * The root carries a `.baerly-localfs.json` marker naming that encoding.
58
+ * A directory written by an older release, before keys were escaped, is
59
+ * adopted as-is when every name in it already reads the same under the
60
+ * encoding; otherwise every operation refuses with `InvalidConfig`.
61
+ * Such a directory is dev data: move it aside or delete it. Collections
62
+ * worth keeping can be dumped with the older release (`baerly admin
63
+ * dump`, rows only) and restored into a fresh directory (`baerly admin
64
+ * restore`). Data a folding filesystem has already merged is not
65
+ * recoverable.
66
+ *
67
+ * ETags are content-addressed: `"<sha-256-hex>"` (the surrounding
68
+ * double-quotes match S3's wire format for non-multipart objects).
69
+ * Identical bodies share an ETag across runs — the property that
70
+ * makes this adapter useful for fixture-based tests.
71
+ *
72
+ * Writes are atomic via `writeFile(temp) + rename(final)`; readers
73
+ * never see a partially-written file. The temp is always a sibling of
74
+ * its destination — `rename(2)`/`link(2)` fail with `EXDEV` across
75
+ * filesystems, and the bucket root is routinely on a different volume
76
+ * from `os.tmpdir()` (see `tempPathFor`).
77
+ *
78
+ * `ifNoneMatch:"*"` uses `link(2)` (atomic exclusive create; `EEXIST` ⇒
79
+ * key exists) so concurrent creates have exactly one winner. temp+`link`
80
+ * over `open(…,"wx")` keeps a partially-written new key invisible to a
81
+ * concurrent reader.
82
+ *
83
+ * `ifMatch` is a read-compare-write, so it is made atomic by serializing
84
+ * every mutation of a key against every other — see `#lockKey`.
85
+ *
86
+ * Scope of that guarantee, precisely: **one loaded copy of this module**.
87
+ * Within it, concurrent CAS on one key admits exactly one winner and the
88
+ * losers get `WriteConflict`, across any number of `LocalFsStorage` instances
89
+ * whose roots resolve — through symlinks — to the same directory. That is
90
+ * one process in every normal setup, but the lock lives in a module-level
91
+ * map, so a process that somehow loads both this source and the bundled
92
+ * copy has two of them.
93
+ *
94
+ * Across processes it guarantees nothing: two `baerly` CLI runs, or two
95
+ * servers, sharing a directory can both win, because nothing in POSIX
96
+ * makes read-compare-write atomic without a lock file or a lease. That is
97
+ * why this adapter is for single-process dev and self-hosting;
98
+ * horizontally-scaled deploys need S3 / R2, whose server-side conditional
99
+ * write is what the no-lease maintenance fold actually relies on.
100
+ *
101
+ * Node-only — imports `node:fs`, `node:path`, `node:crypto`. Lives in
102
+ * `@baerly/dev` because the protocol kernel is pure-modules / no I/O
103
+ * and must remain Worker-bundleable.
104
+ *
105
+ * ⚠️ **Hard termination and temp files.**
106
+ *
107
+ * Writes stage a sibling `.baerly-tmp-*` file before atomic rename/link.
108
+ * Normal failures clean up the temp in `finally`, but hard termination
109
+ * (`SIGKILL`, OOM, power loss) can strand a temp inside the root directory.
110
+ *
111
+ * These files are hidden from `list`, `gc`, `fsck`, and usage reporting
112
+ * by design—the temp filter applies at every depth.
113
+ *
114
+ * **Manual cleanup procedure:**
115
+ * 1. Stop all writers using the root
116
+ * 2. Run: `find <root> -name '.baerly-tmp-*' -delete`
117
+ *
118
+ * Do not clean while writes are in progress—races with in-flight PUTs
119
+ * can delete a file that a concurrent operation is about to rename.
120
+ */
121
+ declare class LocalFsStorage implements Storage {
122
+ #private;
123
+ constructor(opts: LocalFsStorageOptions);
124
+ get(key: string, opts?: StorageGetOptions): Promise<StorageGetResult | null>;
125
+ put(key: string, body: Uint8Array, opts?: StoragePutOptions): Promise<StoragePutResult>;
126
+ delete(key: string, opts?: {
127
+ signal?: AbortSignal;
128
+ }): Promise<void>;
129
+ list(prefix: string, opts?: {
130
+ startAfter?: string;
131
+ maxKeys?: number;
132
+ signal?: AbortSignal;
133
+ }): AsyncIterable<StorageListEntry>;
134
+ }
135
+ export { LocalFsStorageOptions as n, ensureTable as r, LocalFsStorage as t };
@@ -0,0 +1,50 @@
1
+ import { a as StoragePutOptions, i as StorageListEntry, n as StorageGetOptions, o as StoragePutResult, r as StorageGetResult, t as Storage } from "./types-suVbsEWS.js";
2
+ /** Options for {@link MemoryStorage}. */
3
+ interface MemoryStorageOptions {
4
+ /**
5
+ * Acknowledge the store is intentionally ephemeral — required to
6
+ * construct in a detected deployment ({@link isDeployedEnv}); ignored in
7
+ * dev/test. Env equivalent: `BAERLY_ALLOW_EPHEMERAL_STORAGE=true`.
8
+ */
9
+ ephemeral?: boolean;
10
+ }
11
+ /**
12
+ * In-memory `Storage`. The randomized property test runs against
13
+ * this; it must be deterministic — no clocks beyond the caller's,
14
+ * no randomness, no I/O.
15
+ *
16
+ * ETags are a monotonically increasing hex counter formatted in the
17
+ * `"<hex>"` shape S3 returns (the surrounding double-quotes are part
18
+ * of the ETag header value). Keys are stored verbatim.
19
+ *
20
+ * **Test-confidence caveat:** every method resolves on the microtask
21
+ * queue with no real concurrency, so `put` reads `existing` and writes
22
+ * back with no interleaving. MemoryStorage therefore CANNOT exercise the
23
+ * compare-and-swap race the writer-fence model depends on — two writers
24
+ * contending on one `current.json` always serialize here, so a green run
25
+ * is necessary but not sufficient. That race is covered only by the
26
+ * randomized integration tests against real S3 / Minio
27
+ * (`tests/integration/randomized.test.ts`, `node-minio` variant).
28
+ * Relatedly, `serverDate` returns the local clock, not an independent
29
+ * server clock (see the `put` return below).
30
+ */
31
+ declare class MemoryStorage implements Storage {
32
+ #private;
33
+ constructor(opts?: MemoryStorageOptions);
34
+ get(key: string, opts?: StorageGetOptions): Promise<StorageGetResult | null>;
35
+ put(key: string, body: Uint8Array, opts?: StoragePutOptions): Promise<StoragePutResult>;
36
+ delete(key: string, opts?: {
37
+ signal?: AbortSignal;
38
+ }): Promise<void>;
39
+ list(prefix: string, opts?: {
40
+ startAfter?: string;
41
+ maxKeys?: number;
42
+ signal?: AbortSignal;
43
+ }): AsyncIterable<StorageListEntry>;
44
+ /**
45
+ * Test-only: drop all objects.
46
+ * @internal
47
+ */
48
+ _clear(): void;
49
+ }
50
+ export { MemoryStorage as t };