effect-dynamodb 1.42.2 → 1.44.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.
- package/dist/Aggregate.d.ts +157 -20
- package/dist/Aggregate.d.ts.map +1 -1
- package/dist/Aggregate.js +1219 -286
- package/dist/Aggregate.js.map +1 -1
- package/dist/Batch.d.ts +17 -4
- package/dist/Batch.d.ts.map +1 -1
- package/dist/Batch.js +129 -62
- package/dist/Batch.js.map +1 -1
- package/dist/BlobGc.d.ts +243 -0
- package/dist/BlobGc.d.ts.map +1 -0
- package/dist/BlobGc.js +961 -0
- package/dist/BlobGc.js.map +1 -0
- package/dist/BlobStore.d.ts +83 -0
- package/dist/BlobStore.d.ts.map +1 -0
- package/dist/BlobStore.js +70 -0
- package/dist/BlobStore.js.map +1 -0
- package/dist/Collection.d.ts +88 -8
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +22 -26
- package/dist/Collection.js.map +1 -1
- package/dist/Collections.d.ts +0 -7
- package/dist/Collections.d.ts.map +1 -1
- package/dist/Collections.js +0 -16
- package/dist/Collections.js.map +1 -1
- package/dist/DynamoClient.d.ts +68 -35
- package/dist/DynamoClient.d.ts.map +1 -1
- package/dist/DynamoClient.js +58 -12
- package/dist/DynamoClient.js.map +1 -1
- package/dist/Entity.d.ts +403 -104
- package/dist/Entity.d.ts.map +1 -1
- package/dist/Entity.js +1771 -382
- package/dist/Entity.js.map +1 -1
- package/dist/EventStore.d.ts +323 -77
- package/dist/EventStore.d.ts.map +1 -1
- package/dist/EventStore.js +473 -96
- package/dist/EventStore.js.map +1 -1
- package/dist/Offload.d.ts +199 -0
- package/dist/Offload.d.ts.map +1 -0
- package/dist/Offload.js +120 -0
- package/dist/Offload.js.map +1 -0
- package/dist/Query.d.ts +132 -59
- package/dist/Query.d.ts.map +1 -1
- package/dist/Query.js +95 -31
- package/dist/Query.js.map +1 -1
- package/dist/StorageEncoding.d.ts +62 -15
- package/dist/StorageEncoding.d.ts.map +1 -1
- package/dist/StorageEncoding.js +108 -24
- package/dist/StorageEncoding.js.map +1 -1
- package/dist/Table.d.ts +1 -1
- package/dist/Table.d.ts.map +1 -1
- package/dist/Transaction.d.ts +16 -3
- package/dist/Transaction.d.ts.map +1 -1
- package/dist/Transaction.js +28 -9
- package/dist/Transaction.js.map +1 -1
- package/dist/blob/S3BlobStore.d.ts +178 -0
- package/dist/blob/S3BlobStore.d.ts.map +1 -0
- package/dist/blob/S3BlobStore.js +770 -0
- package/dist/blob/S3BlobStore.js.map +1 -0
- package/dist/blob/s3.d.ts +122 -0
- package/dist/blob/s3.d.ts.map +1 -0
- package/dist/blob/s3.js +143 -0
- package/dist/blob/s3.js.map +1 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/AggregateWrite.d.ts +130 -0
- package/dist/internal/AggregateWrite.d.ts.map +1 -0
- package/dist/internal/AggregateWrite.js +341 -0
- package/dist/internal/AggregateWrite.js.map +1 -0
- package/dist/internal/BlobCalls.d.ts +70 -0
- package/dist/internal/BlobCalls.d.ts.map +1 -0
- package/dist/internal/BlobCalls.js +105 -0
- package/dist/internal/BlobCalls.js.map +1 -0
- package/dist/internal/BlobKeys.d.ts +100 -0
- package/dist/internal/BlobKeys.d.ts.map +1 -0
- package/dist/internal/BlobKeys.js +135 -0
- package/dist/internal/BlobKeys.js.map +1 -0
- package/dist/internal/BlobLedger.d.ts +323 -0
- package/dist/internal/BlobLedger.d.ts.map +1 -0
- package/dist/internal/BlobLedger.js +1012 -0
- package/dist/internal/BlobLedger.js.map +1 -0
- package/dist/internal/BlobMetadata.d.ts +109 -0
- package/dist/internal/BlobMetadata.d.ts.map +1 -0
- package/dist/internal/BlobMetadata.js +249 -0
- package/dist/internal/BlobMetadata.js.map +1 -0
- package/dist/internal/BlobResolver.d.ts +146 -0
- package/dist/internal/BlobResolver.d.ts.map +1 -0
- package/dist/internal/BlobResolver.js +417 -0
- package/dist/internal/BlobResolver.js.map +1 -0
- package/dist/internal/BlobStoreContract.d.ts +214 -0
- package/dist/internal/BlobStoreContract.d.ts.map +1 -0
- package/dist/internal/BlobStoreContract.js +181 -0
- package/dist/internal/BlobStoreContract.js.map +1 -0
- package/dist/internal/BoundCrud.d.ts +153 -53
- package/dist/internal/BoundCrud.d.ts.map +1 -1
- package/dist/internal/BoundCrud.js +27 -5
- package/dist/internal/BoundCrud.js.map +1 -1
- package/dist/internal/BoundQuery.d.ts +49 -33
- package/dist/internal/BoundQuery.d.ts.map +1 -1
- package/dist/internal/BoundQuery.js +8 -2
- package/dist/internal/BoundQuery.js.map +1 -1
- package/dist/internal/BoundVectorQuery.d.ts +59 -25
- package/dist/internal/BoundVectorQuery.d.ts.map +1 -1
- package/dist/internal/BoundVectorQuery.js +38 -17
- package/dist/internal/BoundVectorQuery.js.map +1 -1
- package/dist/internal/Capacity.d.ts +17 -2
- package/dist/internal/Capacity.d.ts.map +1 -1
- package/dist/internal/Capacity.js +47 -9
- package/dist/internal/Capacity.js.map +1 -1
- package/dist/internal/ConditionHolds.d.ts.map +1 -1
- package/dist/internal/ConditionHolds.js +2 -8
- package/dist/internal/ConditionHolds.js.map +1 -1
- package/dist/internal/CredentialRefusal.d.ts.map +1 -1
- package/dist/internal/CredentialRefusal.js +4 -0
- package/dist/internal/CredentialRefusal.js.map +1 -1
- package/dist/internal/Digest.d.ts +4 -3
- package/dist/internal/Digest.d.ts.map +1 -1
- package/dist/internal/Digest.js +25 -82
- package/dist/internal/Digest.js.map +1 -1
- package/dist/internal/EntityCombinators.d.ts +93 -45
- package/dist/internal/EntityCombinators.d.ts.map +1 -1
- package/dist/internal/EntityCombinators.js +42 -7
- package/dist/internal/EntityCombinators.js.map +1 -1
- package/dist/internal/EntityOps.d.ts +47 -6
- package/dist/internal/EntityOps.d.ts.map +1 -1
- package/dist/internal/EntityOps.js +30 -10
- package/dist/internal/EntityOps.js.map +1 -1
- package/dist/internal/EventProjection.d.ts +99 -25
- package/dist/internal/EventProjection.d.ts.map +1 -1
- package/dist/internal/EventProjection.js +124 -33
- package/dist/internal/EventProjection.js.map +1 -1
- package/dist/internal/ExpressionLimits.d.ts +22 -3
- package/dist/internal/ExpressionLimits.d.ts.map +1 -1
- package/dist/internal/ExpressionLimits.js +46 -7
- package/dist/internal/ExpressionLimits.js.map +1 -1
- package/dist/internal/GcSupport.d.ts +258 -0
- package/dist/internal/GcSupport.d.ts.map +1 -0
- package/dist/internal/GcSupport.js +284 -0
- package/dist/internal/GcSupport.js.map +1 -0
- package/dist/internal/ItemSize.d.ts +7 -1
- package/dist/internal/ItemSize.d.ts.map +1 -1
- package/dist/internal/ItemSize.js +13 -5
- package/dist/internal/ItemSize.js.map +1 -1
- package/dist/internal/MemoryBlobStore.d.ts +203 -0
- package/dist/internal/MemoryBlobStore.d.ts.map +1 -0
- package/dist/internal/MemoryBlobStore.js +623 -0
- package/dist/internal/MemoryBlobStore.js.map +1 -0
- package/dist/internal/MultiProjection.d.ts +56 -28
- package/dist/internal/MultiProjection.d.ts.map +1 -1
- package/dist/internal/MultiProjection.js +9 -3
- package/dist/internal/MultiProjection.js.map +1 -1
- package/dist/internal/Multipart.d.ts +96 -0
- package/dist/internal/Multipart.d.ts.map +1 -0
- package/dist/internal/Multipart.js +143 -0
- package/dist/internal/Multipart.js.map +1 -0
- package/dist/internal/OffloadChange.d.ts +187 -0
- package/dist/internal/OffloadChange.d.ts.map +1 -0
- package/dist/internal/OffloadChange.js +391 -0
- package/dist/internal/OffloadChange.js.map +1 -0
- package/dist/internal/OffloadInput.d.ts +141 -0
- package/dist/internal/OffloadInput.d.ts.map +1 -0
- package/dist/internal/OffloadInput.js +236 -0
- package/dist/internal/OffloadInput.js.map +1 -0
- package/dist/internal/OffloadRead.d.ts +140 -0
- package/dist/internal/OffloadRead.d.ts.map +1 -0
- package/dist/internal/OffloadRead.js +369 -0
- package/dist/internal/OffloadRead.js.map +1 -0
- package/dist/internal/OffloadTypes.d.ts +182 -0
- package/dist/internal/OffloadTypes.d.ts.map +1 -0
- package/dist/internal/OffloadTypes.js +15 -0
- package/dist/internal/OffloadTypes.js.map +1 -0
- package/dist/internal/OffloadValues.d.ts +87 -0
- package/dist/internal/OffloadValues.d.ts.map +1 -0
- package/dist/internal/OffloadValues.js +114 -0
- package/dist/internal/OffloadValues.js.map +1 -0
- package/dist/internal/OffloadWrite.d.ts +267 -0
- package/dist/internal/OffloadWrite.d.ts.map +1 -0
- package/dist/internal/OffloadWrite.js +766 -0
- package/dist/internal/OffloadWrite.js.map +1 -0
- package/dist/internal/Packed.d.ts +58 -23
- package/dist/internal/Packed.d.ts.map +1 -1
- package/dist/internal/Packed.js +108 -33
- package/dist/internal/Packed.js.map +1 -1
- package/dist/internal/ProjectionEngine.d.ts +28 -3
- package/dist/internal/ProjectionEngine.d.ts.map +1 -1
- package/dist/internal/ProjectionEngine.js +47 -9
- package/dist/internal/ProjectionEngine.js.map +1 -1
- package/dist/internal/RangePlanner.d.ts +3 -6
- package/dist/internal/RangePlanner.d.ts.map +1 -1
- package/dist/internal/RangePlanner.js +3 -29
- package/dist/internal/RangePlanner.js.map +1 -1
- package/dist/internal/Rekey.d.ts +16 -0
- package/dist/internal/Rekey.d.ts.map +1 -1
- package/dist/internal/Rekey.js +31 -2
- package/dist/internal/Rekey.js.map +1 -1
- package/dist/internal/StoredPointer.d.ts +19 -0
- package/dist/internal/StoredPointer.d.ts.map +1 -0
- package/dist/internal/StoredPointer.js +59 -0
- package/dist/internal/StoredPointer.js.map +1 -0
- package/dist/internal/TransactPlan.d.ts +18 -1
- package/dist/internal/TransactPlan.d.ts.map +1 -1
- package/dist/internal/TransactPlan.js +50 -10
- package/dist/internal/TransactPlan.js.map +1 -1
- package/dist/internal/TransactWriteOps.d.ts +33 -12
- package/dist/internal/TransactWriteOps.d.ts.map +1 -1
- package/dist/internal/TransactWriteOps.js +49 -19
- package/dist/internal/TransactWriteOps.js.map +1 -1
- package/dist/internal/TransactableOps.d.ts +58 -11
- package/dist/internal/TransactableOps.d.ts.map +1 -1
- package/dist/internal/TransactableOps.js +95 -19
- package/dist/internal/TransactableOps.js.map +1 -1
- package/dist/internal/Utf8Order.d.ts +21 -0
- package/dist/internal/Utf8Order.d.ts.map +1 -0
- package/dist/internal/Utf8Order.js +44 -0
- package/dist/internal/Utf8Order.js.map +1 -0
- package/dist/internal/WriteDiagnosis.d.ts +7 -1
- package/dist/internal/WriteDiagnosis.d.ts.map +1 -1
- package/dist/internal/WriteDiagnosis.js +12 -16
- package/dist/internal/WriteDiagnosis.js.map +1 -1
- package/package.json +15 -4
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal The read side of offloaded values (#179, design §8): phase two of
|
|
3
|
+
* the two-phase decode.
|
|
4
|
+
*
|
|
5
|
+
* 1. **Unpack** (synchronous, the decoders') replaces each pointer a row holds
|
|
6
|
+
* with a {@link PendingBlob} placeholder naming it.
|
|
7
|
+
* 2. **Resolve** (here, effectful, batched over a page, a batch response, a
|
|
8
|
+
* partition or one item) turns every placeholder into its value per the
|
|
9
|
+
* read's modes ({@link resolveRows}):
|
|
10
|
+
* - **eager** — fetch at the store's `readConcurrency` (within permits
|
|
11
|
+
* shared across an operation's parallel resolutions, when it passes
|
|
12
|
+
* them; failing a read as soon as it runs past the pointer's size),
|
|
13
|
+
* verify the object's size and the CRC-64/NVME of its content (§8.6),
|
|
14
|
+
* decompress, then `JSON.parse` (overflow) or the bytes (binary). What
|
|
15
|
+
* the operation itself uploaded comes from the upload ledger's read
|
|
16
|
+
* cache, unfetched;
|
|
17
|
+
* - **lazy** — an `OffloadedValue` (overflow) or `BlobHandle` (binary): no
|
|
18
|
+
* I/O until `read()` / `stream()`, which fetch, verify and decode each
|
|
19
|
+
* call with the store and compressor registry of the fiber that resolved
|
|
20
|
+
* it (`R = never`).
|
|
21
|
+
* 3. **Schema decode** (the decoders') runs over the resolved row.
|
|
22
|
+
*
|
|
23
|
+
* A row without placeholders resolves with no I/O and no allocation.
|
|
24
|
+
*
|
|
25
|
+
* Failures: a store failure, a missing store (`NotProvided`) and a size or
|
|
26
|
+
* checksum mismatch (`ChecksumMismatch`) are `BlobStoreError`s; a payload that
|
|
27
|
+
* fails decompression or `JSON.parse` after a verified fetch, and a missing
|
|
28
|
+
* compressor, are `ValidationError`s (§14.2). A ranged read cannot verify a
|
|
29
|
+
* whole-object checksum and does not; `stream()` without a range verifies as
|
|
30
|
+
* its last chunk arrives, failing the stream after the bytes were emitted.
|
|
31
|
+
*
|
|
32
|
+
* Not part of the public API.
|
|
33
|
+
*/
|
|
34
|
+
import { ValidationError } from "@effect-dynamodb/schema/Errors.js";
|
|
35
|
+
import { crc64nvme, make as makeCrc64nvme } from "@effect-dynamodb/schema/internal/Crc64Nvme.js";
|
|
36
|
+
import { notRegistered } from "@effect-dynamodb/schema/internal/PackedCodec.js";
|
|
37
|
+
import { Context, Duration, Effect, Option, Semaphore, Stream } from "effect";
|
|
38
|
+
import { BlobStore } from "../BlobStore.js";
|
|
39
|
+
import { blobError, call, callStream } from "./BlobCalls.js";
|
|
40
|
+
import * as BlobLedger from "./BlobLedger.js";
|
|
41
|
+
import { makeBlobHandle, makeOffloadedValue, registerHandleStore, } from "./OffloadValues.js";
|
|
42
|
+
import { registryOf } from "./Packed.js";
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Placeholders
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
export const PendingBlobTypeId = Symbol.for("effect-dynamodb/PendingBlob");
|
|
47
|
+
/** True iff `u` is a {@link PendingBlob}. */
|
|
48
|
+
export const isPendingBlob = (u) => typeof u === "object" && u !== null && PendingBlobTypeId in u;
|
|
49
|
+
/**
|
|
50
|
+
* A placeholder for `pointer`. Dies when the pointer's kind is not the
|
|
51
|
+
* field's (json for an overflow field, bytes for a binary one): the unpack
|
|
52
|
+
* step refuses such a value before it gets here.
|
|
53
|
+
*/
|
|
54
|
+
export const makePendingBlob = (fields) => {
|
|
55
|
+
if ((fields.kind === "overflow") !== (fields.pointer.kind === "json")) {
|
|
56
|
+
throw new Error(`BlobResolver: a ${fields.pointer.kind} pointer cannot stand for the ${fields.kind} ` +
|
|
57
|
+
`attribute "${fields.attribute}". This is a defect in effect-dynamodb.`);
|
|
58
|
+
}
|
|
59
|
+
return Object.freeze({ [PendingBlobTypeId]: PendingBlobTypeId, ...fields });
|
|
60
|
+
};
|
|
61
|
+
/** The defaults (decision 5): overflow eager, binary lazy. */
|
|
62
|
+
export const DEFAULT_MODES = Object.freeze({ overflow: "eager", binary: "lazy" });
|
|
63
|
+
/** Both kinds eager: aggregates, `GeoSearch.nearby`, the projection engine's row read. */
|
|
64
|
+
export const EAGER_MODES = Object.freeze({ overflow: "eager", binary: "eager" });
|
|
65
|
+
/** Both kinds lazy: error payloads and ref hydration, which never do I/O. */
|
|
66
|
+
export const LAZY_MODES = Object.freeze({ overflow: "lazy", binary: "lazy" });
|
|
67
|
+
const environmentOf = (context, ledger) => ({
|
|
68
|
+
store: Context.getOrUndefined(context, BlobStore),
|
|
69
|
+
registry: registryOf(context),
|
|
70
|
+
ledger: ledger === undefined || ledger.closed ? undefined : ledger,
|
|
71
|
+
});
|
|
72
|
+
const fatalDecoder = new TextDecoder("utf-8", { fatal: true });
|
|
73
|
+
const encoder = new TextEncoder();
|
|
74
|
+
const invalid = (ctx, message, cause) => new ValidationError({
|
|
75
|
+
entityType: ctx.entityType,
|
|
76
|
+
operation: ctx.operation,
|
|
77
|
+
cause: cause === undefined
|
|
78
|
+
? new Error(`Offloaded attribute "${ctx.attribute}": ${message}`)
|
|
79
|
+
: new Error(`Offloaded attribute "${ctx.attribute}": ${message}`, { cause }),
|
|
80
|
+
});
|
|
81
|
+
const notProvided = (ctx, action, ref) => blobError(ctx, action, "NotProvided", ref, "no BlobStore is in context: provide one (DynamoClient.make({ blobStore }), BlobStore.layer, " +
|
|
82
|
+
"or the S3 store's layer) where the operation runs or the client is bound");
|
|
83
|
+
const sameBytes = (a, b) => a.length === b.length && a.every((byte, i) => byte === b[i]);
|
|
84
|
+
const concat = (chunks) => {
|
|
85
|
+
if (chunks.length === 1)
|
|
86
|
+
return chunks[0];
|
|
87
|
+
let size = 0;
|
|
88
|
+
for (const chunk of chunks)
|
|
89
|
+
size += chunk.length;
|
|
90
|
+
const out = new Uint8Array(size);
|
|
91
|
+
let at = 0;
|
|
92
|
+
for (const chunk of chunks) {
|
|
93
|
+
out.set(chunk, at);
|
|
94
|
+
at += chunk.length;
|
|
95
|
+
}
|
|
96
|
+
return out;
|
|
97
|
+
};
|
|
98
|
+
const mismatch = (ctx, ref, message) => blobError(ctx, "get", "ChecksumMismatch", ref, message);
|
|
99
|
+
/** The bytes of a ranged read, unverified. */
|
|
100
|
+
const getRange = (store, ref, ctx, range) => Effect.map(Stream.runCollect(callStream(store, "get", ctx, { ref }, () => store.get(ref, { range }))), (chunks) => concat(chunks));
|
|
101
|
+
/**
|
|
102
|
+
* The bytes of the whole object `pointer` names, unverified but bounded: the
|
|
103
|
+
* read fails (`ChecksumMismatch`) as soon as it runs past the pointer's
|
|
104
|
+
* `objectSize`, so an oversized or corrupt object is never buffered whole.
|
|
105
|
+
*/
|
|
106
|
+
const getObject = (store, pointer, ctx) => Effect.suspend(() => {
|
|
107
|
+
const chunks = [];
|
|
108
|
+
let size = 0;
|
|
109
|
+
return callStream(store, "get", ctx, { ref: pointer.ref }, () => store.get(pointer.ref)).pipe(Stream.runForEach((chunk) => {
|
|
110
|
+
size += chunk.length;
|
|
111
|
+
if (size > pointer.objectSize) {
|
|
112
|
+
return Effect.fail(mismatch(ctx, pointer.ref, `the object runs past the ${pointer.objectSize} bytes its pointer says ` +
|
|
113
|
+
`(${size} bytes read)`));
|
|
114
|
+
}
|
|
115
|
+
chunks.push(chunk);
|
|
116
|
+
return Effect.void;
|
|
117
|
+
}), Effect.map(() => concat(chunks)));
|
|
118
|
+
});
|
|
119
|
+
/** True iff `checksum` is the pointer's. */
|
|
120
|
+
const checksumMatches = (pointer, checksum) => pointer.checksum.algorithm === "crc64nvme" && sameBytes(pointer.checksum.value, checksum);
|
|
121
|
+
/**
|
|
122
|
+
* Verify an object against its pointer and return its content: the object's
|
|
123
|
+
* size, then (decompressed, for compressed json) the content's size and
|
|
124
|
+
* CRC-64/NVME.
|
|
125
|
+
*/
|
|
126
|
+
export const verify = (pointer, object, registry, ctx) => {
|
|
127
|
+
const ref = pointer.ref;
|
|
128
|
+
if (object.length !== pointer.objectSize) {
|
|
129
|
+
return mismatch(ctx, ref, `the object is ${object.length} bytes; its pointer says ${pointer.objectSize}`);
|
|
130
|
+
}
|
|
131
|
+
let content = object;
|
|
132
|
+
if (pointer.codec !== "none") {
|
|
133
|
+
const compressor = registry.get(pointer.codec);
|
|
134
|
+
if (compressor === undefined)
|
|
135
|
+
return notRegistered(ctx, ctx.attribute, pointer.codec, "decompress");
|
|
136
|
+
try {
|
|
137
|
+
content = compressor.decompress(object);
|
|
138
|
+
}
|
|
139
|
+
catch (cause) {
|
|
140
|
+
return invalid(ctx, `the "${pointer.codec}" decompressor failed on the object`, cause);
|
|
141
|
+
}
|
|
142
|
+
if (!(content instanceof Uint8Array)) {
|
|
143
|
+
return invalid(ctx, `the "${pointer.codec}" decompressor did not return a Uint8Array`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (content.length !== pointer.contentSize || !checksumMatches(pointer, crc64nvme(content))) {
|
|
147
|
+
return mismatch(ctx, ref, content.length !== pointer.contentSize
|
|
148
|
+
? `the content is ${content.length} bytes; its pointer says ${pointer.contentSize}`
|
|
149
|
+
: "the CRC-64/NVME of the content does not match its pointer's");
|
|
150
|
+
}
|
|
151
|
+
if (pointer.kind === "bytes")
|
|
152
|
+
return { kind: "bytes", bytes: content };
|
|
153
|
+
let text;
|
|
154
|
+
try {
|
|
155
|
+
text = fatalDecoder.decode(content);
|
|
156
|
+
}
|
|
157
|
+
catch (cause) {
|
|
158
|
+
return invalid(ctx, "the offloaded JSON is not valid UTF-8", cause);
|
|
159
|
+
}
|
|
160
|
+
return { kind: "json", text };
|
|
161
|
+
};
|
|
162
|
+
const lift = (value) => value instanceof ValidationError || isBlobStoreError(value)
|
|
163
|
+
? Effect.fail(value)
|
|
164
|
+
: Effect.succeed(value);
|
|
165
|
+
const isBlobStoreError = (value) => typeof value === "object" &&
|
|
166
|
+
value !== null &&
|
|
167
|
+
value._tag === "BlobStoreError";
|
|
168
|
+
/**
|
|
169
|
+
* The verified content `pointer` names: from the ledger's read cache when the
|
|
170
|
+
* operation uploaded it, else fetched from the store — under one of
|
|
171
|
+
* `permits`, when given (a cache hit takes none).
|
|
172
|
+
*/
|
|
173
|
+
const fetchContent = (env, pointer, ctx, permits) => {
|
|
174
|
+
const cached = BlobLedger.cached(env.ledger, pointer.ref);
|
|
175
|
+
if (cached !== undefined) {
|
|
176
|
+
// The cache holds the operation's own input bytes: hand out a copy, never them.
|
|
177
|
+
return Effect.succeed(cached.kind === "bytes" ? { kind: "bytes", bytes: new Uint8Array(cached.bytes) } : cached);
|
|
178
|
+
}
|
|
179
|
+
const store = env.store;
|
|
180
|
+
if (store === undefined)
|
|
181
|
+
return Effect.fail(notProvided(ctx, "get", pointer.ref));
|
|
182
|
+
const fetched = Effect.flatMap(getObject(store, pointer, ctx), (object) => lift(verify(pointer, object, env.registry, ctx)));
|
|
183
|
+
return permits === undefined ? fetched : Semaphore.withPermit(permits, fetched);
|
|
184
|
+
};
|
|
185
|
+
/** Parse JSON content to its wire form. */
|
|
186
|
+
const parse = (text, ctx) => Effect.suspend(() => {
|
|
187
|
+
try {
|
|
188
|
+
return Effect.succeed(JSON.parse(text));
|
|
189
|
+
}
|
|
190
|
+
catch (cause) {
|
|
191
|
+
return Effect.fail(invalid(ctx, "the offloaded value is not valid JSON", cause));
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
/**
|
|
195
|
+
* The eager value of content: the wire form (json), or the bytes — the
|
|
196
|
+
* caller's own, since {@link fetchContent} copies what comes from the cache
|
|
197
|
+
* and a store's chunks are handed over (the `get` contract).
|
|
198
|
+
*/
|
|
199
|
+
const valueOf = (content, ctx) => content.kind === "json" ? parse(content.text, ctx) : Effect.succeed(content.bytes);
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
201
|
+
// Lazy values
|
|
202
|
+
// ---------------------------------------------------------------------------
|
|
203
|
+
/** The default `expiresIn` of a presigned URL: the reaper's default grace (design §3.7). */
|
|
204
|
+
export const DEFAULT_PRESIGN_EXPIRY = Duration.minutes(15);
|
|
205
|
+
const presignedUrl = (store, ref, ctx, expiresIn) => {
|
|
206
|
+
if (store === undefined)
|
|
207
|
+
return Effect.fail(notProvided(ctx, "presign", ref));
|
|
208
|
+
const presign = store.presign;
|
|
209
|
+
if (presign === undefined) {
|
|
210
|
+
return Effect.fail(blobError(ctx, "presign", "Unsupported", ref, `the store ${store.name} cannot presign URLs`));
|
|
211
|
+
}
|
|
212
|
+
const expiry = expiresIn === undefined ? Option.some(DEFAULT_PRESIGN_EXPIRY) : Duration.fromInput(expiresIn);
|
|
213
|
+
if (Option.isNone(expiry) ||
|
|
214
|
+
!Duration.isFinite(expiry.value) ||
|
|
215
|
+
!Duration.isPositive(expiry.value)) {
|
|
216
|
+
return Effect.fail(blobError(ctx, "presign", "Rejected", ref, "expiresIn must be a positive, finite duration"));
|
|
217
|
+
}
|
|
218
|
+
return call(store, "presign", ctx, { ref }, () => presign(ref, { expiresIn: expiry.value }));
|
|
219
|
+
};
|
|
220
|
+
/** A whole-object stream whose end verifies the size and checksum (bytes pointers). */
|
|
221
|
+
const verifiedStream = (store, pointer, ctx) => Stream.suspend(() => {
|
|
222
|
+
const hasher = makeCrc64nvme();
|
|
223
|
+
let size = 0;
|
|
224
|
+
return callStream(store, "get", ctx, { ref: pointer.ref }, () => store.get(pointer.ref)).pipe(Stream.map((chunk) => {
|
|
225
|
+
hasher.update(chunk);
|
|
226
|
+
size += chunk.length;
|
|
227
|
+
return chunk;
|
|
228
|
+
}), Stream.concat(Stream.suspend(() => size !== pointer.objectSize
|
|
229
|
+
? Stream.fail(mismatch(ctx, pointer.ref, `the object is ${size} bytes; its pointer says ${pointer.objectSize}`))
|
|
230
|
+
: !checksumMatches(pointer, hasher.digest())
|
|
231
|
+
? Stream.fail(mismatch(ctx, pointer.ref, "the CRC-64/NVME of the object does not match its pointer's"))
|
|
232
|
+
: Stream.empty)));
|
|
233
|
+
});
|
|
234
|
+
const readContext = (ctx) => ({
|
|
235
|
+
entityType: ctx.entityType,
|
|
236
|
+
attribute: ctx.attribute,
|
|
237
|
+
operation: `${ctx.operation}.read`,
|
|
238
|
+
});
|
|
239
|
+
/** The lazy form of an overflow pointer: fetched, verified and decoded on each `read()`. */
|
|
240
|
+
const lazyOverflow = (env, pending, ctx, decode) => {
|
|
241
|
+
// A handle is a value: it never pins the ledger (or its cached content).
|
|
242
|
+
const later = { store: env.store, registry: env.registry, ledger: undefined };
|
|
243
|
+
const readCtx = readContext(ctx);
|
|
244
|
+
return makeOffloadedValue({
|
|
245
|
+
location: "external",
|
|
246
|
+
ref: Option.some(pending.pointer.ref),
|
|
247
|
+
size: pending.pointer.objectSize,
|
|
248
|
+
checksum: pending.pointer.checksum,
|
|
249
|
+
read: () => fetchContent(later, pending.pointer, readCtx).pipe(Effect.flatMap((content) => valueOf(content, readCtx)), Effect.flatMap((wire) => decode(pending.field, wire))),
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
/** The lazy form of a binary pointer. */
|
|
253
|
+
const lazyBinary = (env, pending, ctx) => {
|
|
254
|
+
const { pointer } = pending;
|
|
255
|
+
const store = env.store;
|
|
256
|
+
const readCtx = readContext(ctx);
|
|
257
|
+
const later = { store, registry: env.registry, ledger: undefined };
|
|
258
|
+
const handle = makeBlobHandle({
|
|
259
|
+
location: "external",
|
|
260
|
+
ref: Option.some(pointer.ref),
|
|
261
|
+
size: pointer.objectSize,
|
|
262
|
+
contentType: Option.getOrElse(pointer.contentType, () => "application/octet-stream"),
|
|
263
|
+
checksum: pointer.checksum,
|
|
264
|
+
read: (options) => {
|
|
265
|
+
const range = options?.range;
|
|
266
|
+
if (range === undefined) {
|
|
267
|
+
return fetchContent(later, pointer, readCtx).pipe(
|
|
268
|
+
// A bytes pointer (the only kind a binary placeholder holds) is never
|
|
269
|
+
// compressed nor decoded as text, so its verification cannot fail
|
|
270
|
+
// with a ValidationError: one would be a defect.
|
|
271
|
+
Effect.catchTag("ValidationError", (error) => Effect.die(error)), Effect.map((content) => content.kind === "bytes" ? content.bytes : encoder.encode(content.text)));
|
|
272
|
+
}
|
|
273
|
+
return store === undefined
|
|
274
|
+
? Effect.fail(notProvided(readCtx, "get", pointer.ref))
|
|
275
|
+
: getRange(store, pointer.ref, readCtx, range);
|
|
276
|
+
},
|
|
277
|
+
stream: (options) => {
|
|
278
|
+
const range = options?.range;
|
|
279
|
+
if (store === undefined)
|
|
280
|
+
return Stream.fail(notProvided(readCtx, "get", pointer.ref));
|
|
281
|
+
return range === undefined
|
|
282
|
+
? verifiedStream(store, pointer, readCtx)
|
|
283
|
+
: callStream(store, "get", readCtx, { ref: pointer.ref }, () => store.get(pointer.ref, { range }));
|
|
284
|
+
},
|
|
285
|
+
presignedUrl: (options) => presignedUrl(store, pointer.ref, readCtx, options?.expiresIn),
|
|
286
|
+
});
|
|
287
|
+
// A write given the handle copies within this store (design §3.8).
|
|
288
|
+
return store === undefined ? handle : registerHandleStore(handle, store);
|
|
289
|
+
};
|
|
290
|
+
// ---------------------------------------------------------------------------
|
|
291
|
+
// Inline values (a lazy read of a value stored in the item)
|
|
292
|
+
// ---------------------------------------------------------------------------
|
|
293
|
+
const checksumOf = (content) => ({
|
|
294
|
+
algorithm: "crc64nvme",
|
|
295
|
+
value: crc64nvme(content),
|
|
296
|
+
});
|
|
297
|
+
/**
|
|
298
|
+
* The lazy form of an overflow value stored inline: `text` is its JSON (the
|
|
299
|
+
* content its checksum covers), `size` the attribute's stored bytes. `read()`
|
|
300
|
+
* parses and decodes it, with no I/O.
|
|
301
|
+
*/
|
|
302
|
+
export const inlineOffloadedValue = (fields) => makeOffloadedValue({
|
|
303
|
+
location: "inline",
|
|
304
|
+
ref: Option.none(),
|
|
305
|
+
size: fields.size,
|
|
306
|
+
checksum: checksumOf(encoder.encode(fields.text)),
|
|
307
|
+
read: () => Effect.flatMap(parse(fields.text, fields.ctx), (wire) => fields.decode(wire)),
|
|
308
|
+
});
|
|
309
|
+
/** `bytes[range]`, or the `Rejected` failure of a range that starts past the end. */
|
|
310
|
+
const sliceRange = (bytes, range, ctx) => {
|
|
311
|
+
if (range === undefined)
|
|
312
|
+
return new Uint8Array(bytes);
|
|
313
|
+
const { offset, length } = range;
|
|
314
|
+
if (!Number.isSafeInteger(offset) ||
|
|
315
|
+
offset < 0 ||
|
|
316
|
+
(length !== undefined && (!Number.isSafeInteger(length) || length < 0))) {
|
|
317
|
+
return blobError(ctx, "get", "Rejected", undefined, "a range is a non-negative offset and length");
|
|
318
|
+
}
|
|
319
|
+
if (offset > bytes.length) {
|
|
320
|
+
return blobError(ctx, "get", "Rejected", undefined, "the range starts past the end of the value");
|
|
321
|
+
}
|
|
322
|
+
return bytes.slice(offset, length === undefined ? bytes.length : offset + length);
|
|
323
|
+
};
|
|
324
|
+
/**
|
|
325
|
+
* The lazy form of a binary value stored inline (a native `B` written before
|
|
326
|
+
* the field was `External`): it serves its bytes with no I/O and cannot be
|
|
327
|
+
* presigned (`Unsupported`).
|
|
328
|
+
*/
|
|
329
|
+
export const inlineBlobHandle = (fields) => {
|
|
330
|
+
const bytes = new Uint8Array(fields.bytes);
|
|
331
|
+
const ctx = readContext(fields.ctx);
|
|
332
|
+
return makeBlobHandle({
|
|
333
|
+
location: "inline",
|
|
334
|
+
ref: Option.none(),
|
|
335
|
+
size: bytes.length,
|
|
336
|
+
contentType: fields.contentType,
|
|
337
|
+
checksum: checksumOf(bytes),
|
|
338
|
+
read: (options) => Effect.suspend(() => {
|
|
339
|
+
const out = sliceRange(bytes, options?.range, ctx);
|
|
340
|
+
return out instanceof Uint8Array ? Effect.succeed(out) : Effect.fail(out);
|
|
341
|
+
}),
|
|
342
|
+
stream: (options) => Stream.suspend(() => {
|
|
343
|
+
const out = sliceRange(bytes, options?.range, ctx);
|
|
344
|
+
return out instanceof Uint8Array ? Stream.succeed(out) : Stream.fail(out);
|
|
345
|
+
}),
|
|
346
|
+
presignedUrl: () => Effect.fail(blobError(ctx, "presign", "Unsupported", undefined, "the value is stored inline in the item, not in the blob store")),
|
|
347
|
+
});
|
|
348
|
+
};
|
|
349
|
+
// ---------------------------------------------------------------------------
|
|
350
|
+
// Resolve
|
|
351
|
+
// ---------------------------------------------------------------------------
|
|
352
|
+
const identity = (_field, wire) => Effect.succeed(wire);
|
|
353
|
+
const contextOf = (options, pending) => ({
|
|
354
|
+
entityType: options.entityType,
|
|
355
|
+
attribute: pending.attribute,
|
|
356
|
+
operation: options.operation,
|
|
357
|
+
committed: options.committed,
|
|
358
|
+
});
|
|
359
|
+
/**
|
|
360
|
+
* Resolve `pendings` per `options.modes`, in order: the eager ones fetched
|
|
361
|
+
* together at the store's `readConcurrency` (the ledger's read cache first;
|
|
362
|
+
* within `options.permits` too, when given), the lazy ones as handles
|
|
363
|
+
* capturing the fiber's store and compressor registry.
|
|
364
|
+
*/
|
|
365
|
+
export const resolveAll = (pendings, options) => Effect.withFiber((fiber) => {
|
|
366
|
+
const env = environmentOf(fiber.context, fiber.getRef(BlobLedger.CurrentLedger));
|
|
367
|
+
const decode = options.decode ?? identity;
|
|
368
|
+
const results = new Array(pendings.length);
|
|
369
|
+
const eager = [];
|
|
370
|
+
for (let i = 0; i < pendings.length; i++) {
|
|
371
|
+
const pending = pendings[i];
|
|
372
|
+
const ctx = contextOf(options, pending);
|
|
373
|
+
if (options.modes[pending.kind] === "eager")
|
|
374
|
+
eager.push(i);
|
|
375
|
+
else
|
|
376
|
+
results[i] =
|
|
377
|
+
pending.kind === "overflow"
|
|
378
|
+
? lazyOverflow(env, pending, ctx, decode)
|
|
379
|
+
: lazyBinary(env, pending, ctx);
|
|
380
|
+
}
|
|
381
|
+
if (eager.length === 0)
|
|
382
|
+
return Effect.succeed(results);
|
|
383
|
+
return Effect.forEach(eager, (i) => {
|
|
384
|
+
const pending = pendings[i];
|
|
385
|
+
const ctx = contextOf(options, pending);
|
|
386
|
+
return fetchContent(env, pending.pointer, ctx, options.permits).pipe(Effect.flatMap((content) => valueOf(content, ctx)), Effect.tap((value) => Effect.sync(() => {
|
|
387
|
+
results[i] = value;
|
|
388
|
+
})));
|
|
389
|
+
}, { concurrency: env.store?.readConcurrency ?? 1, discard: true }).pipe(Effect.as(results));
|
|
390
|
+
});
|
|
391
|
+
/**
|
|
392
|
+
* Resolve, in place, every {@link PendingBlob} the rows hold (as an own
|
|
393
|
+
* attribute). Rows without one cost a scan of their attributes and nothing
|
|
394
|
+
* else.
|
|
395
|
+
*/
|
|
396
|
+
export const resolveRows = (rows, options) => {
|
|
397
|
+
const slots = [];
|
|
398
|
+
const pendings = [];
|
|
399
|
+
for (const row of rows) {
|
|
400
|
+
for (const attribute of Object.keys(row)) {
|
|
401
|
+
const value = row[attribute];
|
|
402
|
+
if (isPendingBlob(value)) {
|
|
403
|
+
slots.push([row, attribute]);
|
|
404
|
+
pendings.push(value);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
if (pendings.length === 0)
|
|
409
|
+
return Effect.void;
|
|
410
|
+
return Effect.map(resolveAll(pendings, options), (values) => {
|
|
411
|
+
for (let i = 0; i < slots.length; i++) {
|
|
412
|
+
const [row, attribute] = slots[i];
|
|
413
|
+
row[attribute] = values[i];
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
};
|
|
417
|
+
//# sourceMappingURL=BlobResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlobResolver.js","sourceRoot":"","sources":["../../src/internal/BlobResolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAIH,OAA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EAAE;QAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,CAAC,CAAE,CAAA;YAClC,GAAG,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal The `BlobStore` contract (#179, design §12.1): what a store
|
|
3
|
+
* implements, what it fails with, and the checks `BlobStore.layer` runs on a
|
|
4
|
+
* store before the library uses it (`[EDD-9116]`). `BlobStore.ts` re-exports
|
|
5
|
+
* the public parts.
|
|
6
|
+
*
|
|
7
|
+
* Not part of the public API.
|
|
8
|
+
*/
|
|
9
|
+
import type { BlobStoreReason } from "@effect-dynamodb/schema/Errors.js";
|
|
10
|
+
import type { BlobChecksum, BlobRef } from "@effect-dynamodb/schema/internal/BlobPointer.js";
|
|
11
|
+
import { Duration, type Effect, Option, type Stream } from "effect";
|
|
12
|
+
/** A byte range of an object: `length` bytes from `offset` (to the end when absent). */
|
|
13
|
+
export interface ByteRange {
|
|
14
|
+
readonly offset: number;
|
|
15
|
+
readonly length?: number | undefined;
|
|
16
|
+
}
|
|
17
|
+
declare const BlobStoreFailure_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
18
|
+
readonly _tag: "BlobStoreFailure";
|
|
19
|
+
} & Readonly<A>;
|
|
20
|
+
/**
|
|
21
|
+
* What a store fails with. The library wraps it into a `BlobStoreError`
|
|
22
|
+
* with the operation's context (entity type, attribute, operation, action).
|
|
23
|
+
*/
|
|
24
|
+
export declare class BlobStoreFailure extends BlobStoreFailure_base<{
|
|
25
|
+
readonly reason: BlobStoreReason;
|
|
26
|
+
/** The object version involved, when there is one. */
|
|
27
|
+
readonly ref?: BlobRef | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* A `put` (or a `copy`) whose multipart upload may have completed although
|
|
30
|
+
* its response was lost (a `CompleteMultipartUpload` that failed without an
|
|
31
|
+
* answer, or whose retry found no upload): a version may exist that no ref
|
|
32
|
+
* names. The library reports the requested key to the observer
|
|
33
|
+
* (`completeLost`) for `gc.sweep`. An interrupted call needs no flag: the
|
|
34
|
+
* library reports every `put` or `copy` that exits interrupted itself
|
|
35
|
+
* (`interrupted`).
|
|
36
|
+
*/
|
|
37
|
+
readonly completeLost?: boolean | undefined;
|
|
38
|
+
/** The store's own error (for the S3 store, the SDK error). */
|
|
39
|
+
readonly cause: unknown;
|
|
40
|
+
}> {
|
|
41
|
+
constructor(fields: {
|
|
42
|
+
readonly reason: BlobStoreReason;
|
|
43
|
+
readonly ref?: BlobRef | undefined;
|
|
44
|
+
readonly completeLost?: boolean | undefined;
|
|
45
|
+
readonly cause: unknown;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* How a source stream fails in a {@link BlobPutRequest}: the library wraps the
|
|
50
|
+
* input `Stream`'s error as a {@link BlobStoreFailure} with reason
|
|
51
|
+
* `"SourceFailed"` (its `cause` the source's own error), so a store lets it
|
|
52
|
+
* through as its own failure.
|
|
53
|
+
*/
|
|
54
|
+
export type BlobSourceFailure = BlobStoreFailure & {
|
|
55
|
+
readonly reason: "SourceFailed";
|
|
56
|
+
};
|
|
57
|
+
/** An upload. */
|
|
58
|
+
export interface BlobPutRequest {
|
|
59
|
+
/**
|
|
60
|
+
* The library-derived key (design §4.5). A key-per-write store may extend
|
|
61
|
+
* it, never move it out of its family prefix.
|
|
62
|
+
*/
|
|
63
|
+
readonly key: string;
|
|
64
|
+
readonly body: Uint8Array | Stream.Stream<Uint8Array, BlobSourceFailure>;
|
|
65
|
+
/** The body's length, when known before it is consumed. */
|
|
66
|
+
readonly contentLength: number | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* CRC-64/NVME of the body bytes; resolves once `body` has been consumed — a
|
|
69
|
+
* store consumes the body before it awaits this (for a `Uint8Array` body it
|
|
70
|
+
* resolves at once).
|
|
71
|
+
*/
|
|
72
|
+
readonly checksum: Effect.Effect<BlobChecksum>;
|
|
73
|
+
readonly contentType: string;
|
|
74
|
+
/** User metadata (design §4.6): US-ASCII, at most 2 KB. */
|
|
75
|
+
readonly metadata: Readonly<Record<string, string>>;
|
|
76
|
+
}
|
|
77
|
+
/** A server-side copy of another version: an upload without a body. */
|
|
78
|
+
export type BlobCopyRequest = Omit<BlobPutRequest, "body" | "checksum">;
|
|
79
|
+
/** What an upload made. */
|
|
80
|
+
export interface BlobPutResult {
|
|
81
|
+
/** An immutable reference: the bytes it names never change. */
|
|
82
|
+
readonly ref: BlobRef;
|
|
83
|
+
/** Bytes of the stored object. */
|
|
84
|
+
readonly size: number;
|
|
85
|
+
}
|
|
86
|
+
/** One version of a listing. */
|
|
87
|
+
export interface BlobListing {
|
|
88
|
+
readonly ref: BlobRef;
|
|
89
|
+
readonly size: number;
|
|
90
|
+
readonly lastModified: Date;
|
|
91
|
+
/** The key's newest version. */
|
|
92
|
+
readonly isLatest: boolean;
|
|
93
|
+
}
|
|
94
|
+
/** Upper bounds the item-budget planner counts a pointer at (design §6.3). */
|
|
95
|
+
export interface BlobStoreLimits {
|
|
96
|
+
/** The longest version id the store returns, in UTF-8 bytes (S3: 1,024). */
|
|
97
|
+
readonly maxVersionBytes: number;
|
|
98
|
+
/** The most bytes a key-per-write store appends to a key (`0` for a versioned store). */
|
|
99
|
+
readonly maxKeySuffixBytes: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Unreferenced-since marks (design §11.4). `get` succeeds with `Option.none()`
|
|
103
|
+
* for a version without a mark and for an absent ref; `set` and `clear` succeed
|
|
104
|
+
* on an absent ref.
|
|
105
|
+
*/
|
|
106
|
+
export interface BlobStoreMarks {
|
|
107
|
+
readonly get: (ref: BlobRef) => Effect.Effect<Option.Option<Date>, BlobStoreFailure>;
|
|
108
|
+
readonly set: (ref: BlobRef, since: Date) => Effect.Effect<void, BlobStoreFailure>;
|
|
109
|
+
readonly clear: (ref: BlobRef) => Effect.Effect<void, BlobStoreFailure>;
|
|
110
|
+
}
|
|
111
|
+
/** Options of a presigned GET URL. */
|
|
112
|
+
export interface BlobPresignOptions {
|
|
113
|
+
readonly expiresIn: Duration.Duration;
|
|
114
|
+
/** A `Content-Type` the response overrides the stored one with. */
|
|
115
|
+
readonly contentType?: string | undefined;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A blob store: the contract the library writes offloaded values through and
|
|
119
|
+
* reads them back from. It has no `R` — an implementation closes over its
|
|
120
|
+
* client.
|
|
121
|
+
*
|
|
122
|
+
* The library computes every checksum and verifies sizes and checksums on
|
|
123
|
+
* read, so a store never has to be trusted for either; it also enforces
|
|
124
|
+
* `maxUploadAge`, which a store only declares. `copy`, `list`, `head`,
|
|
125
|
+
* `marks` and `presign` are optional capabilities: GC states what it needs.
|
|
126
|
+
*/
|
|
127
|
+
export interface BlobStoreService {
|
|
128
|
+
/** For messages, e.g. `"s3://documents-blobs/prod/"`. */
|
|
129
|
+
readonly name: string;
|
|
130
|
+
/** The store prefix; an entity's `offload.prefix` replaces it for that entity. */
|
|
131
|
+
readonly prefix: string;
|
|
132
|
+
readonly limits: BlobStoreLimits;
|
|
133
|
+
/**
|
|
134
|
+
* An upload not committed by this age after it started fails with
|
|
135
|
+
* `Expired`; GC relies on it (design §6.1, §11.4). Every process writing or
|
|
136
|
+
* collecting against one store configures the same value.
|
|
137
|
+
*/
|
|
138
|
+
readonly maxUploadAge: Duration.Duration;
|
|
139
|
+
/**
|
|
140
|
+
* Concurrent reads the library runs against the store per operation (eager
|
|
141
|
+
* resolution): a page, a batch get's group, an aggregate's partition, and
|
|
142
|
+
* all of a `GeoIndex.nearby` search's parallel queries together.
|
|
143
|
+
*/
|
|
144
|
+
readonly readConcurrency: number;
|
|
145
|
+
/** Concurrent uploads the library runs against the store per operation. */
|
|
146
|
+
readonly writeConcurrency: number;
|
|
147
|
+
/** MUST return an immutable reference: the bytes `ref` names never change. */
|
|
148
|
+
readonly put: (request: BlobPutRequest) => Effect.Effect<BlobPutResult, BlobStoreFailure>;
|
|
149
|
+
/**
|
|
150
|
+
* The bytes `ref` names, in chunks. Each chunk is handed over: the store
|
|
151
|
+
* never reuses or changes one it has emitted (the library may return it to
|
|
152
|
+
* the caller as is).
|
|
153
|
+
*/
|
|
154
|
+
readonly get: (ref: BlobRef, options?: {
|
|
155
|
+
readonly range?: ByteRange | undefined;
|
|
156
|
+
}) => Stream.Stream<Uint8Array, BlobStoreFailure>;
|
|
157
|
+
/** Idempotent: deleting an absent ref succeeds. */
|
|
158
|
+
readonly delete: (refs: ReadonlyArray<BlobRef>) => Effect.Effect<void, BlobStoreFailure>;
|
|
159
|
+
readonly copy?: ((source: BlobRef, request: BlobCopyRequest) => Effect.Effect<BlobPutResult, BlobStoreFailure>) | undefined;
|
|
160
|
+
/** Every version under `prefix`, keys ascending (UTF-8 order), versions newest first. */
|
|
161
|
+
readonly list?: ((prefix: string, options?: {
|
|
162
|
+
readonly startAfter?: string | undefined;
|
|
163
|
+
}) => Stream.Stream<BlobListing, BlobStoreFailure>) | undefined;
|
|
164
|
+
/** The metadata the library wrote with the version (design §4.6). */
|
|
165
|
+
readonly head?: ((ref: BlobRef) => Effect.Effect<Readonly<Record<string, string>>, BlobStoreFailure>) | undefined;
|
|
166
|
+
readonly marks?: BlobStoreMarks | undefined;
|
|
167
|
+
readonly presign?: ((ref: BlobRef, options: BlobPresignOptions) => Effect.Effect<string, BlobStoreFailure>) | undefined;
|
|
168
|
+
}
|
|
169
|
+
/** The default `maxUploadAge`: 1 hour. */
|
|
170
|
+
export declare const DEFAULT_MAX_UPLOAD_AGE: Duration.Duration;
|
|
171
|
+
/** The shortest `maxUploadAge` a store's options accept. */
|
|
172
|
+
export declare const MIN_MAX_UPLOAD_AGE: Duration.Duration;
|
|
173
|
+
/** The longest `maxUploadAge` a store's options accept. */
|
|
174
|
+
export declare const MAX_MAX_UPLOAD_AGE: Duration.Duration;
|
|
175
|
+
/** The default `readConcurrency`. */
|
|
176
|
+
export declare const DEFAULT_READ_CONCURRENCY = 16;
|
|
177
|
+
/** The default `writeConcurrency`. */
|
|
178
|
+
export declare const DEFAULT_WRITE_CONCURRENCY = 8;
|
|
179
|
+
/** The longest store prefix, in UTF-8 bytes. */
|
|
180
|
+
export declare const MAX_STORE_PREFIX_BYTES = 256;
|
|
181
|
+
/**
|
|
182
|
+
* The most a key-per-write store may append to a key: what is left of S3's
|
|
183
|
+
* 1,024-byte key after the longest prefix (256 bytes, a store's or an
|
|
184
|
+
* entity's) and the hashed `P/F/O` (98 bytes), so every key fits a pointer.
|
|
185
|
+
*/
|
|
186
|
+
export declare const MAX_KEY_SUFFIX_BYTES: number;
|
|
187
|
+
/** UTF-8 bytes of `text`, or `undefined` when it holds a lone surrogate. */
|
|
188
|
+
export declare const utf8Bytes: (text: string) => number | undefined;
|
|
189
|
+
/** Throw the `[EDD-9116]` defect of `where`. */
|
|
190
|
+
export declare const invalid: (where: string, message: string) => never;
|
|
191
|
+
/** A store prefix: a string of at most 256 UTF-8 bytes, not starting with `/`. */
|
|
192
|
+
export declare const checkPrefix: (where: string, name: string, prefix: unknown) => string;
|
|
193
|
+
/** A concurrency (or other count): a positive safe integer. */
|
|
194
|
+
export declare const checkPositiveInteger: (where: string, name: string, value: unknown) => number;
|
|
195
|
+
/**
|
|
196
|
+
* A `maxUploadAge` option: a `Duration.Input` from 1 minute to 7 days
|
|
197
|
+
* (default 1 hour).
|
|
198
|
+
*/
|
|
199
|
+
export declare const checkMaxUploadAgeOption: (where: string, value: unknown) => Duration.Duration;
|
|
200
|
+
/**
|
|
201
|
+
* Check a store before the library uses it, returning it unchanged.
|
|
202
|
+
*
|
|
203
|
+
* @throws `[EDD-9116]` when `name` is not a non-empty string; `prefix` is not a
|
|
204
|
+
* string of at most 256 UTF-8 bytes that does not start with `/`; `limits`
|
|
205
|
+
* are not non-negative integers (`maxVersionBytes` at most 1,024, the
|
|
206
|
+
* pointer's version limit; `maxKeySuffixBytes` at most
|
|
207
|
+
* {@link MAX_KEY_SUFFIX_BYTES}); `maxUploadAge` is not a positive, finite
|
|
208
|
+
* `Duration`; a concurrency is not a positive integer; `put`, `get` or
|
|
209
|
+
* `delete` is not a function; or an optional capability is present but not
|
|
210
|
+
* a function (`marks`: an object of `get`, `set` and `clear` functions).
|
|
211
|
+
*/
|
|
212
|
+
export declare const validateService: (where: string, service: unknown) => BlobStoreService;
|
|
213
|
+
export {};
|
|
214
|
+
//# sourceMappingURL=BlobStoreContract.d.ts.map
|