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,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal The lazy forms of offloaded values (#179, design §3.7):
|
|
3
|
+
* {@link OffloadedValue} (an overflow field read lazily) and
|
|
4
|
+
* {@link BlobHandle} (a binary field read lazily), their type ids, guards and
|
|
5
|
+
* constructors. `Offload.ts` re-exports the public parts; the constructors are
|
|
6
|
+
* the read path's (the resolver builds handles that capture the store and
|
|
7
|
+
* compressor registry of the fiber that decoded them).
|
|
8
|
+
*
|
|
9
|
+
* Not part of the public API.
|
|
10
|
+
*/
|
|
11
|
+
import type { BlobStoreError, ValidationError } from "@effect-dynamodb/schema/Errors.js";
|
|
12
|
+
import type { BlobChecksum, BlobRef } from "@effect-dynamodb/schema/internal/BlobPointer.js";
|
|
13
|
+
import { type Duration, type Effect, Equal, Hash, Inspectable, Option, Pipeable, type Stream } from "effect";
|
|
14
|
+
import type { BlobStoreService, ByteRange } from "./BlobStoreContract.js";
|
|
15
|
+
export declare const OffloadedValueTypeId: unique symbol;
|
|
16
|
+
export type OffloadedValueTypeId = typeof OffloadedValueTypeId;
|
|
17
|
+
export declare const BlobHandleTypeId: unique symbol;
|
|
18
|
+
export type BlobHandleTypeId = typeof BlobHandleTypeId;
|
|
19
|
+
/** Where a lazily read value is: in the item (`inline`) or in the blob store (`external`). */
|
|
20
|
+
export type OffloadLocation = "inline" | "external";
|
|
21
|
+
/** Which kind of offloaded field: an overflow (`Packed({ external })`) or binary (`External`) one. */
|
|
22
|
+
export type OffloadKind = "overflow" | "binary";
|
|
23
|
+
/**
|
|
24
|
+
* An overflow field read lazily. An inline value is already resolved, so
|
|
25
|
+
* `read` does no I/O; an external one fetches, verifies, decompresses and
|
|
26
|
+
* schema-decodes on `read`.
|
|
27
|
+
*/
|
|
28
|
+
export interface OffloadedValue<A> extends Pipeable.Pipeable, Inspectable.Inspectable {
|
|
29
|
+
readonly [OffloadedValueTypeId]: OffloadedValueTypeId;
|
|
30
|
+
readonly location: OffloadLocation;
|
|
31
|
+
/** The object version (external only). */
|
|
32
|
+
readonly ref: Option.Option<BlobRef>;
|
|
33
|
+
/** Stored bytes: the attribute's (inline) or the object's (external). */
|
|
34
|
+
readonly size: number;
|
|
35
|
+
/** The content checksum (design §5). */
|
|
36
|
+
readonly checksum: BlobChecksum;
|
|
37
|
+
readonly read: () => Effect.Effect<A, BlobStoreError | ValidationError>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A binary field read lazily. `inline`: a native value stored before the
|
|
41
|
+
* field was `External`. Equal by location and ref (external), or by content
|
|
42
|
+
* checksum and size (inline): `Equal.equals(a, b)` is a cheap "same stored
|
|
43
|
+
* value" test.
|
|
44
|
+
*/
|
|
45
|
+
export interface BlobHandle extends Pipeable.Pipeable, Inspectable.Inspectable, Equal.Equal {
|
|
46
|
+
readonly [BlobHandleTypeId]: BlobHandleTypeId;
|
|
47
|
+
readonly location: OffloadLocation;
|
|
48
|
+
readonly ref: Option.Option<BlobRef>;
|
|
49
|
+
readonly size: number;
|
|
50
|
+
readonly contentType: string;
|
|
51
|
+
readonly checksum: BlobChecksum;
|
|
52
|
+
readonly read: (options?: {
|
|
53
|
+
readonly range?: ByteRange | undefined;
|
|
54
|
+
}) => Effect.Effect<Uint8Array, BlobStoreError>;
|
|
55
|
+
readonly stream: (options?: {
|
|
56
|
+
readonly range?: ByteRange | undefined;
|
|
57
|
+
}) => Stream.Stream<Uint8Array, BlobStoreError>;
|
|
58
|
+
/**
|
|
59
|
+
* A presigned GET URL (default expiry 15 minutes). Fails with
|
|
60
|
+
* `BlobStoreError { reason: "Unsupported" }` on an inline handle or a store
|
|
61
|
+
* without the `presign` capability.
|
|
62
|
+
*/
|
|
63
|
+
readonly presignedUrl: (options?: {
|
|
64
|
+
readonly expiresIn?: Duration.Input | undefined;
|
|
65
|
+
}) => Effect.Effect<string, BlobStoreError>;
|
|
66
|
+
}
|
|
67
|
+
/** True iff `u` is an {@link OffloadedValue}. */
|
|
68
|
+
export declare const isOffloadedValue: (u: unknown) => u is OffloadedValue<unknown>;
|
|
69
|
+
/** True iff `u` is a {@link BlobHandle}. */
|
|
70
|
+
export declare const isBlobHandle: (u: unknown) => u is BlobHandle;
|
|
71
|
+
/** The fields of an {@link OffloadedValue}. */
|
|
72
|
+
export type OffloadedValueFields<A> = Omit<OffloadedValue<A>, OffloadedValueTypeId | keyof Pipeable.Pipeable | keyof Inspectable.Inspectable>;
|
|
73
|
+
/** An {@link OffloadedValue} from its fields (the read path builds them). */
|
|
74
|
+
export declare const makeOffloadedValue: <A>(fields: OffloadedValueFields<A>) => OffloadedValue<A>;
|
|
75
|
+
/** The fields of a {@link BlobHandle}. */
|
|
76
|
+
export type BlobHandleFields = Omit<BlobHandle, BlobHandleTypeId | keyof Pipeable.Pipeable | keyof Inspectable.Inspectable | typeof Equal.symbol | typeof Hash.symbol>;
|
|
77
|
+
/** A {@link BlobHandle} from its fields (the read path builds them). */
|
|
78
|
+
export declare const makeBlobHandle: (fields: BlobHandleFields) => BlobHandle;
|
|
79
|
+
/** Record the store an external handle reads from (the resolver, when it builds one). */
|
|
80
|
+
export declare const registerHandleStore: (handle: BlobHandle, store: BlobStoreService) => BlobHandle;
|
|
81
|
+
/**
|
|
82
|
+
* The store an external handle reads from, when the library built it with
|
|
83
|
+
* one: a write given the handle copies within that store (`copy`) instead of
|
|
84
|
+
* streaming its content through.
|
|
85
|
+
*/
|
|
86
|
+
export declare const handleStoreOf: (handle: BlobHandle) => BlobStoreService | undefined;
|
|
87
|
+
//# sourceMappingURL=OffloadValues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OffloadValues.d.ts","sourceRoot":"","sources":["../../src/internal/OffloadValues.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iDAAiD,CAAA;AAC5F,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,EACL,IAAI,EACJ,WAAW,EACX,MAAM,EACN,QAAQ,EACR,KAAK,MAAM,EACZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAEzE,eAAO,MAAM,oBAAoB,EAAE,OAAO,MAAqD,CAAA;AAC/F,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAA;AAE9D,eAAO,MAAM,gBAAgB,EAAE,OAAO,MAAiD,CAAA;AACvF,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAA;AAEtD,8FAA8F;AAC9F,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,CAAA;AAEnD,sGAAsG;AACtG,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAA;AAE/C;;;;GAIG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,WAAW;IACnF,QAAQ,CAAC,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAA;IACrD,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAA;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC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AE,cAAc,CAAC,CAAA;CAC5C;AAED,iDAAiD;AACjD,eAAO,MAAM,gBAAgB,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,cAAc,CAAC,OAAO,CACP,CAAA;AAElE,4CAA4C;AAC5C,eAAO,MAAM,YAAY,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,UACe,CAAA;AA0C9D,+CAA+C;AAC/C,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,IAAI,CACxC,cAAc,CAAC,CAAC,CAAC,EACjB,oBAAoB,GAAG,MAAM,QAAQ,CAAC,QAAQ,GAAG,MAAM,WAAW,CAAC,WAAW,CAC/E,CAAA;AAeD,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAE,QAAQ,oBAAoB,CAAC,CAAC,CAAC,KAAG,cAAc,CAAC,CAAC,CAWvF,CAAA;AAMD,0CAA0C;AAC1C,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,UAAU,EACR,gBAAgB,GAChB,MAAM,QAAQ,CAAC,QAAQ,GACvB,MAAM,WAAW,CAAC,WAAW,GAC7B,OAAO,KAAK,CAAC,MAAM,GACnB,OAAO,IAAI,CAAC,MAAM,CACrB,CAAA;AAmCD,wEAAwE;AACxE,eAAO,MAAM,cAAc,GAAI,QAAQ,gBAAgB,KAAG,UAczD,CAAA;AAQD,yFAAyF;AACzF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,UAAU,EAAE,OAAO,gBAAgB,KAAG,UAGjF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,UAAU,KAAG,gBAAgB,GAAG,SAC5C,CAAA"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal The lazy forms of offloaded values (#179, design §3.7):
|
|
3
|
+
* {@link OffloadedValue} (an overflow field read lazily) and
|
|
4
|
+
* {@link BlobHandle} (a binary field read lazily), their type ids, guards and
|
|
5
|
+
* constructors. `Offload.ts` re-exports the public parts; the constructors are
|
|
6
|
+
* the read path's (the resolver builds handles that capture the store and
|
|
7
|
+
* compressor registry of the fiber that decoded them).
|
|
8
|
+
*
|
|
9
|
+
* Not part of the public API.
|
|
10
|
+
*/
|
|
11
|
+
import { Equal, Hash, Inspectable, Option, Pipeable, } from "effect";
|
|
12
|
+
export const OffloadedValueTypeId = Symbol.for("effect-dynamodb/OffloadedValue");
|
|
13
|
+
export const BlobHandleTypeId = Symbol.for("effect-dynamodb/BlobHandle");
|
|
14
|
+
/** True iff `u` is an {@link OffloadedValue}. */
|
|
15
|
+
export const isOffloadedValue = (u) => typeof u === "object" && u !== null && OffloadedValueTypeId in u;
|
|
16
|
+
/** True iff `u` is a {@link BlobHandle}. */
|
|
17
|
+
export const isBlobHandle = (u) => typeof u === "object" && u !== null && BlobHandleTypeId in u;
|
|
18
|
+
const hexOf = (bytes) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
19
|
+
const sameBytes = (a, b) => a.length === b.length && a.every((byte, i) => byte === b[i]);
|
|
20
|
+
const copyChecksum = (checksum) => Object.freeze({ algorithm: checksum.algorithm, value: new Uint8Array(checksum.value) });
|
|
21
|
+
const copyRef = (ref) => Option.map(ref, (r) => Object.freeze({ key: r.key, version: r.version }));
|
|
22
|
+
const checkLocation = (what, location, ref) => {
|
|
23
|
+
if (location !== "inline" && location !== "external") {
|
|
24
|
+
throw new Error(`${what}: location must be "inline" or "external"`);
|
|
25
|
+
}
|
|
26
|
+
if ((location === "external") !== Option.isSome(ref)) {
|
|
27
|
+
throw new Error(`${what}: an external value has a ref, an inline one none`);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const describe = (self) => ({
|
|
31
|
+
location: self.location,
|
|
32
|
+
ref: Option.match(self.ref, {
|
|
33
|
+
onNone: () => undefined,
|
|
34
|
+
onSome: (r) => ({ key: r.key, version: r.version }),
|
|
35
|
+
}),
|
|
36
|
+
size: self.size,
|
|
37
|
+
checksum: { algorithm: self.checksum.algorithm, value: hexOf(self.checksum.value) },
|
|
38
|
+
});
|
|
39
|
+
const OffloadedValueProto = Object.assign(Object.create(Inspectable.BaseProto), {
|
|
40
|
+
[OffloadedValueTypeId]: OffloadedValueTypeId,
|
|
41
|
+
pipe() {
|
|
42
|
+
return Pipeable.pipeArguments(this, arguments);
|
|
43
|
+
},
|
|
44
|
+
toJSON() {
|
|
45
|
+
return { _id: "OffloadedValue", ...describe(this) };
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
/** An {@link OffloadedValue} from its fields (the read path builds them). */
|
|
49
|
+
export const makeOffloadedValue = (fields) => {
|
|
50
|
+
checkLocation("OffloadedValue", fields.location, fields.ref);
|
|
51
|
+
return Object.freeze(Object.assign(Object.create(OffloadedValueProto), {
|
|
52
|
+
location: fields.location,
|
|
53
|
+
ref: copyRef(fields.ref),
|
|
54
|
+
size: fields.size,
|
|
55
|
+
checksum: copyChecksum(fields.checksum),
|
|
56
|
+
read: fields.read,
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
const BlobHandleProto = Object.assign(Object.create(Inspectable.BaseProto), {
|
|
60
|
+
[BlobHandleTypeId]: BlobHandleTypeId,
|
|
61
|
+
pipe() {
|
|
62
|
+
return Pipeable.pipeArguments(this, arguments);
|
|
63
|
+
},
|
|
64
|
+
toJSON() {
|
|
65
|
+
return { _id: "BlobHandle", ...describe(this), contentType: this.contentType };
|
|
66
|
+
},
|
|
67
|
+
[Equal.symbol](that) {
|
|
68
|
+
if (!isBlobHandle(that) || that.location !== this.location)
|
|
69
|
+
return false;
|
|
70
|
+
if (Option.isSome(this.ref) && Option.isSome(that.ref)) {
|
|
71
|
+
return (this.ref.value.key === that.ref.value.key &&
|
|
72
|
+
this.ref.value.version === that.ref.value.version);
|
|
73
|
+
}
|
|
74
|
+
return (this.size === that.size &&
|
|
75
|
+
this.checksum.algorithm === that.checksum.algorithm &&
|
|
76
|
+
sameBytes(this.checksum.value, that.checksum.value));
|
|
77
|
+
},
|
|
78
|
+
[Hash.symbol]() {
|
|
79
|
+
return Option.match(this.ref, {
|
|
80
|
+
onNone: () => Hash.string(`inline:${this.size}:${hexOf(this.checksum.value)}`),
|
|
81
|
+
onSome: (r) => Hash.string(`external:${r.key}\u0000${r.version}`),
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
/** A {@link BlobHandle} from its fields (the read path builds them). */
|
|
86
|
+
export const makeBlobHandle = (fields) => {
|
|
87
|
+
checkLocation("BlobHandle", fields.location, fields.ref);
|
|
88
|
+
return Object.freeze(Object.assign(Object.create(BlobHandleProto), {
|
|
89
|
+
location: fields.location,
|
|
90
|
+
ref: copyRef(fields.ref),
|
|
91
|
+
size: fields.size,
|
|
92
|
+
contentType: fields.contentType,
|
|
93
|
+
checksum: copyChecksum(fields.checksum),
|
|
94
|
+
read: fields.read,
|
|
95
|
+
stream: fields.stream,
|
|
96
|
+
presignedUrl: fields.presignedUrl,
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// The store a handle reads from (a write's copy source, design §3.8)
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
const handleStores = new WeakMap();
|
|
103
|
+
/** Record the store an external handle reads from (the resolver, when it builds one). */
|
|
104
|
+
export const registerHandleStore = (handle, store) => {
|
|
105
|
+
handleStores.set(handle, store);
|
|
106
|
+
return handle;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* The store an external handle reads from, when the library built it with
|
|
110
|
+
* one: a write given the handle copies within that store (`copy`) instead of
|
|
111
|
+
* streaming its content through.
|
|
112
|
+
*/
|
|
113
|
+
export const handleStoreOf = (handle) => handleStores.get(handle);
|
|
114
|
+
//# sourceMappingURL=OffloadValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OffloadValues.js","sourceRoot":"","sources":["../../src/internal/OffloadValues.ts"],"names":[],"mappings":"AAAA;;;;;;;;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,CAAA;IACJ,CAAC;CACF,CACF,CAAA;AAED,wEAAwE;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAwB,EAAc,EAAE;IACrE,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAA;IACxD,OAAO,MAAM,CAAC,MAAM,CAClB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAe,EAAE;QAC1D,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC;QACvC,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,YAAY,EAAE,MAAM,CAAC,YAAY;KAClC,CAAC,CACH,CAAA;AACH,CAAC,CAAA;AAED,8EAA8E;AAC9E,qEAAqE;AACrE,8EAA8E;AAE9E,MAAM,YAAY,GAAG,IAAI,OAAO,EAAgC,CAAA;AAEhE,yFAAyF;AACzF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAkB,EAAE,KAAuB,EAAc,EAAE;IAC7F,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC/B,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAkB,EAAgC,EAAE,CAChF,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal The write side of offloaded fields (#179, design §6.1–§6.5,
|
|
3
|
+
* §6.8, §6.13): which values of a row go to the blob store (per-field
|
|
4
|
+
* thresholds, then the item budget), their uploads through the operation's
|
|
5
|
+
* ledger, and the pointers that replace them in the request. (A write's
|
|
6
|
+
* result reads what it stored through `OffloadRead`, its own uploads from the
|
|
7
|
+
* ledger's read cache.)
|
|
8
|
+
*
|
|
9
|
+
* Everything here works on **stored** attribute names, after renames, sparse
|
|
10
|
+
* flattening and packing: an overflow value arrives as its inline stored form
|
|
11
|
+
* (a JSON string, or a v1 header byte + compressed bytes) and leaves as a `B`
|
|
12
|
+
* pointer; a binary value arrives as its bytes and leaves as `~edbp:` text.
|
|
13
|
+
* A binary value given as a stream, a handle or `Offload.source(...)` arrives
|
|
14
|
+
* as its placeholder (`OffloadInput`), which uploads what it stands for.
|
|
15
|
+
*
|
|
16
|
+
* Not part of the public API.
|
|
17
|
+
*/
|
|
18
|
+
import type { AttributeValue } from "@aws-sdk/client-dynamodb";
|
|
19
|
+
import type { ExternalConfig, ExternalPackedConfig } from "@effect-dynamodb/schema/DynamoModel.js";
|
|
20
|
+
import { type BlobStoreError, ValidationError } from "@effect-dynamodb/schema/Errors.js";
|
|
21
|
+
import type { BlobChecksum } from "@effect-dynamodb/schema/internal/BlobPointer.js";
|
|
22
|
+
import { type BlobPointer } from "@effect-dynamodb/schema/internal/BlobPointer.js";
|
|
23
|
+
import { Context, Effect } from "effect";
|
|
24
|
+
import { type KeyAttributeValue } from "./BlobKeys.js";
|
|
25
|
+
import type { BlobStoreService } from "./BlobStoreContract.js";
|
|
26
|
+
/** How one member offloads, keyed by stored attribute name. */
|
|
27
|
+
export interface OffloadInfo {
|
|
28
|
+
readonly entityType: string;
|
|
29
|
+
/** Stored attribute → overflow config (`Packed({ external })`). */
|
|
30
|
+
readonly overflow: Readonly<Record<string, ExternalPackedConfig>>;
|
|
31
|
+
/** Stored attribute → binary config (`External`). */
|
|
32
|
+
readonly binary: Readonly<Record<string, ExternalConfig>>;
|
|
33
|
+
/** Stored attribute → domain field name. */
|
|
34
|
+
readonly fieldOf: Readonly<Record<string, string>>;
|
|
35
|
+
/** `offload.itemBudget`: the whole-item size the router keeps an item under. */
|
|
36
|
+
readonly itemBudget: number | undefined;
|
|
37
|
+
/** `offload.prefix`; the store's prefix when `undefined`. */
|
|
38
|
+
readonly prefix: string | undefined;
|
|
39
|
+
/** The member's rows copy pointers (`retain`, `softDelete`, `timeSeries`). */
|
|
40
|
+
readonly copiesPointers: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** The stored attributes of a member that may hold a pointer. */
|
|
43
|
+
export declare const offloadedAttributes: (info: OffloadInfo) => ReadonlyArray<string>;
|
|
44
|
+
/** True iff `attribute` is one of the member's offloaded attributes. */
|
|
45
|
+
export declare const isOffloaded: (info: OffloadInfo, attribute: string) => boolean;
|
|
46
|
+
/** The row a write's uploads are for. */
|
|
47
|
+
export interface OffloadRow {
|
|
48
|
+
/** The physical table name. */
|
|
49
|
+
readonly table: string;
|
|
50
|
+
readonly pkAttribute: string;
|
|
51
|
+
readonly pk: KeyAttributeValue;
|
|
52
|
+
readonly skAttribute: string;
|
|
53
|
+
/** The item family's sort key: the live SK. */
|
|
54
|
+
readonly sk: KeyAttributeValue;
|
|
55
|
+
/** The row's own sort key, when not the live SK (a time-series event item's). */
|
|
56
|
+
readonly rowSk?: KeyAttributeValue | undefined;
|
|
57
|
+
/** The library operation, e.g. `"Entity.put"`. */
|
|
58
|
+
readonly operation: string;
|
|
59
|
+
/**
|
|
60
|
+
* The member's schema sets `escapeKeys: true`, which offloading requires
|
|
61
|
+
* (design §11.10): object keys are named from the row's key text, so a
|
|
62
|
+
* pointer row must be written only at its final text. {@link route} refuses
|
|
63
|
+
* a row without it (`[EDD-9146]`), before anything is uploaded.
|
|
64
|
+
*/
|
|
65
|
+
readonly escapeKeys: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** A key attribute value of a stored-name item (its composed `S` value, as a rule). */
|
|
68
|
+
export declare const keyValueOf: (value: unknown) => KeyAttributeValue;
|
|
69
|
+
/** The row of a stored-name item whose key attributes are `pkAttribute` / `skAttribute`. */
|
|
70
|
+
export declare const rowOf: (item: Readonly<Record<string, unknown>>, keys: {
|
|
71
|
+
readonly table: string;
|
|
72
|
+
readonly pkAttribute: string;
|
|
73
|
+
readonly skAttribute: string;
|
|
74
|
+
readonly operation: string;
|
|
75
|
+
/** The member's schema's `escapeKeys` (see {@link OffloadRow.escapeKeys}). */
|
|
76
|
+
readonly escapeKeys: boolean;
|
|
77
|
+
}) => OffloadRow;
|
|
78
|
+
/**
|
|
79
|
+
* The `[EDD-9146]` text: a member offloads on a schema without `escapeKeys:
|
|
80
|
+
* true`. `what` names the member and its fields; `where` the bind site or the
|
|
81
|
+
* write.
|
|
82
|
+
*/
|
|
83
|
+
export declare const unescapedKeysText: (where: string, what: string) => string;
|
|
84
|
+
/** The stored form of `pointer` on the attribute: `B` (overflow) or `~edbp:` text (binary). */
|
|
85
|
+
export declare const storedPointer: (pointer: BlobPointer) => string | Uint8Array;
|
|
86
|
+
/**
|
|
87
|
+
* Run `f` over `items` concurrently and fail only once every one has settled
|
|
88
|
+
* (design §6.2): an upload already sent is let finish rather than interrupted
|
|
89
|
+
* by a sibling's failure, so the version it writes is registered with the
|
|
90
|
+
* ledger and rolled back at exit — an interrupted one would leave a version no
|
|
91
|
+
* entry names. Fails with the first failure in `items` order, preferring a
|
|
92
|
+
* failure over an interruption.
|
|
93
|
+
*/
|
|
94
|
+
export declare const forEachSettled: <A, E>(items: Iterable<A>, f: (item: A) => Effect.Effect<void, E>) => Effect.Effect<void, E>;
|
|
95
|
+
/** What {@link route} decided. */
|
|
96
|
+
export interface Routed {
|
|
97
|
+
/** The attributes it uploaded, now holding their pointers. */
|
|
98
|
+
readonly uploaded: ReadonlySet<string>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Route and upload a whole item (design §6.3), in place: every offloaded
|
|
102
|
+
* attribute of `only` (default: all of them) at or above its threshold, every
|
|
103
|
+
* binary one, then — when the member has an `itemBudget` and the item, with
|
|
104
|
+
* those as pointers at their upper bound, is still over it — the remaining
|
|
105
|
+
* overflow attributes by stored size, largest first (ties by name), until it
|
|
106
|
+
* fits. The item may still exceed the budget (DynamoDB's own limit is then
|
|
107
|
+
* diagnosed on failure). Each upload goes through the operation's ledger and
|
|
108
|
+
* its pointer replaces the value. Attributes outside `only` keep what they
|
|
109
|
+
* hold (a read-merge update's untouched pointers). Every upload is built
|
|
110
|
+
* before any starts (a value that cannot be uploaded sends nothing to the
|
|
111
|
+
* store), and a failed one fails the write only once the others have settled
|
|
112
|
+
* ({@link forEachSettled}).
|
|
113
|
+
*
|
|
114
|
+
* Fails with `BlobStoreError { reason: "NotProvided" }` when a value must go
|
|
115
|
+
* to the store and none is in context.
|
|
116
|
+
*/
|
|
117
|
+
export declare const route: (info: OffloadInfo, item: Record<string, unknown>, row: OffloadRow, only?: ReadonlySet<string>) => Effect.Effect<Routed, BlobStoreError | ValidationError>;
|
|
118
|
+
/** One attribute {@link measure} found the write would offload. */
|
|
119
|
+
export interface MeasuredOffload {
|
|
120
|
+
/** The stored attribute name. */
|
|
121
|
+
readonly attribute: string;
|
|
122
|
+
/** The object's bytes: the JSON text, or the compressed payload after its header. */
|
|
123
|
+
readonly objectBytes: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Measure, in place, what {@link route} would do to `item` without uploading
|
|
127
|
+
* anything (design §6.10, `measureAppend` / `measureSnapshot`): each attribute
|
|
128
|
+
* the write would offload is replaced by a placeholder of its pointer's upper
|
|
129
|
+
* bound (§6.3) — so the item measures at most what the write would send — and
|
|
130
|
+
* reported with the bytes its object would hold. Fails as `route` does when a
|
|
131
|
+
* value must go to the store and none is in context (the bound needs its
|
|
132
|
+
* limits).
|
|
133
|
+
*/
|
|
134
|
+
export declare const measure: (info: OffloadInfo, item: Record<string, unknown>, row: OffloadRow) => Effect.Effect<ReadonlyArray<MeasuredOffload>, BlobStoreError | ValidationError>;
|
|
135
|
+
/**
|
|
136
|
+
* @internal Set while a write is only being measured (`measureAppend` builds
|
|
137
|
+
* the transaction `append` would send, its `additionalItems` included):
|
|
138
|
+
* {@link route} then gives each value it would upload a placeholder of its
|
|
139
|
+
* pointer's upper bound, so the item measures at most what the write would
|
|
140
|
+
* send, and uploads nothing.
|
|
141
|
+
*/
|
|
142
|
+
export declare const Measuring: Context.Reference<boolean>;
|
|
143
|
+
/** One offloaded attribute an `UpdateItem` `SET`s: its `:value` token and stored name. */
|
|
144
|
+
export interface OffloadSet {
|
|
145
|
+
readonly valKey: string;
|
|
146
|
+
readonly attr: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Upload, in place, the offloaded values an `UpdateItem` `SET`s (thresholds
|
|
150
|
+
* only — the whole item is not in hand, §6.3): each binary value and each
|
|
151
|
+
* overflow value at or above its threshold becomes, in `values`, the pointer
|
|
152
|
+
* of a fresh upload; anything else stays as given. One {@link route} of all of
|
|
153
|
+
* them, so every upload is built before any starts and a failed one fails the
|
|
154
|
+
* write only once the others have settled.
|
|
155
|
+
*/
|
|
156
|
+
export declare const setValues: (info: OffloadInfo, sets: ReadonlyArray<OffloadSet>, values: Record<string, AttributeValue>, row: OffloadRow) => Effect.Effect<void, BlobStoreError | ValidationError>;
|
|
157
|
+
/** The pointer an offloaded attribute's stored value is, if it is a well-formed one. */
|
|
158
|
+
export declare const pointerOf: (info: OffloadInfo, attribute: string, value: unknown) => BlobPointer | undefined;
|
|
159
|
+
/** A pointer a row held when read, and the content it named as fetched. */
|
|
160
|
+
export interface ReadPointer {
|
|
161
|
+
readonly pointer: BlobPointer;
|
|
162
|
+
/** Its stored form, as the row holds it (`B` bytes, or `~edbp:` text). */
|
|
163
|
+
readonly stored: string | Uint8Array;
|
|
164
|
+
/**
|
|
165
|
+
* The content fetched, snapshotted when the row was read: the value's
|
|
166
|
+
* canonical JSON (overflow, {@link canonicalJson}), or a copy of its bytes
|
|
167
|
+
* (binary). A snapshot, so a fold that mutates the state it was given in
|
|
168
|
+
* place cannot make a changed value compare equal.
|
|
169
|
+
*/
|
|
170
|
+
readonly content: string | Uint8Array;
|
|
171
|
+
}
|
|
172
|
+
/** The pointers a read row held, by stored attribute name. */
|
|
173
|
+
export type ReadPointers = ReadonlyMap<string, ReadPointer>;
|
|
174
|
+
/** A reused pointer the write must be conditioned on (`#f = :P`). */
|
|
175
|
+
export interface Pin {
|
|
176
|
+
readonly attribute: string;
|
|
177
|
+
readonly stored: string | Uint8Array;
|
|
178
|
+
}
|
|
179
|
+
/** No reuse, no pins. */
|
|
180
|
+
export declare const NO_PINS: ReadonlyArray<Pin>;
|
|
181
|
+
/** A JSON value's text with every object's keys sorted: equal iff the values are. */
|
|
182
|
+
export declare const canonicalJson: (value: unknown) => string;
|
|
183
|
+
/**
|
|
184
|
+
* The pointers a stored-name row holds on the member's offloaded attributes,
|
|
185
|
+
* before it is loaded (the load replaces them with their values).
|
|
186
|
+
*/
|
|
187
|
+
export declare const pointersIn: (info: OffloadInfo, row: Readonly<Record<string, unknown>>) => ReadonlyArray<{
|
|
188
|
+
readonly attribute: string;
|
|
189
|
+
readonly pointer: BlobPointer;
|
|
190
|
+
readonly stored: string | Uint8Array;
|
|
191
|
+
}>;
|
|
192
|
+
/**
|
|
193
|
+
* The {@link ReadPointers} of a row whose `pointers` ({@link pointersIn}) were
|
|
194
|
+
* just loaded eagerly: each attribute holds its fetched value — the JSON wire
|
|
195
|
+
* form (overflow) or the bytes (binary) — which is snapshotted.
|
|
196
|
+
*/
|
|
197
|
+
export declare const snapshotPointers: (info: OffloadInfo, pointers: ReturnType<typeof pointersIn>, loaded: Readonly<Record<string, unknown>>) => ReadPointers;
|
|
198
|
+
/**
|
|
199
|
+
* Keep, in place, the read pointer of every offloaded attribute of a packed,
|
|
200
|
+
* stored-name item whose new value has the content that pointer named when
|
|
201
|
+
* the row was read (design §6.11) — content, not checksum: a CRC is no proof
|
|
202
|
+
* of equality. The attribute then holds the pointer, which {@link route}
|
|
203
|
+
* leaves as is, and the returned {@link Pin}s must condition the write on the
|
|
204
|
+
* row still holding each one ({@link withPins}), so a concurrent write of the
|
|
205
|
+
* row fails it. Each reused value goes into the ledger's read cache, so the
|
|
206
|
+
* write's result decodes it without a fetch. A value that differs, or an
|
|
207
|
+
* attribute the item no longer holds, is left to {@link route}.
|
|
208
|
+
*/
|
|
209
|
+
export declare const reuse: (info: OffloadInfo, item: Record<string, unknown>, read: ReadPointers, operation: string) => Effect.Effect<ReadonlyArray<Pin>, ValidationError>;
|
|
210
|
+
/** A compiled condition: expression, names and values. */
|
|
211
|
+
export interface RawCondition {
|
|
212
|
+
readonly expression: string;
|
|
213
|
+
readonly names: Record<string, string>;
|
|
214
|
+
readonly values: Record<string, AttributeValue>;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* `condition` ANDed with `#f = :P` for every pin (design §6.11): the write
|
|
218
|
+
* succeeds only while the row still holds each reused pointer. `condition`
|
|
219
|
+
* itself when there are none.
|
|
220
|
+
*/
|
|
221
|
+
export declare const withPins: <C extends RawCondition | undefined>(condition: C, pins: ReadonlyArray<Pin>) => C | RawCondition;
|
|
222
|
+
/**
|
|
223
|
+
* Whether `content` (a restated value's JSON text, or its bytes) has the
|
|
224
|
+
* pointer's content checksum and size — the fast path of an immutable
|
|
225
|
+
* assertion (design §6.5): a match passes; a mismatch is confirmed by
|
|
226
|
+
* fetching the stored value.
|
|
227
|
+
*/
|
|
228
|
+
export declare const matchesPointer: (pointer: BlobPointer, content: string | Uint8Array) => boolean;
|
|
229
|
+
/** Whether `bytes` (a value stored natively) have `checksum` and `size` (a `BlobHandle`'s). */
|
|
230
|
+
export declare const bytesMatch: (bytes: Uint8Array, checksum: BlobChecksum, size: number) => boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Whether content of `size` bytes with `checksum` (a `BlobHandle`'s,
|
|
233
|
+
* restating an immutable binary field) has the pointer's content checksum
|
|
234
|
+
* and size.
|
|
235
|
+
*/
|
|
236
|
+
export declare const matchesChecksum: (pointer: BlobPointer, checksum: BlobChecksum, size: number) => boolean;
|
|
237
|
+
/** A bound member's offloaded fields, which need a store where it is bound. */
|
|
238
|
+
export interface StoreRequirement {
|
|
239
|
+
/** The member, for the message: `entity "Documents"`, `aggregate "Order" (edge "Line")`. */
|
|
240
|
+
readonly owner: string;
|
|
241
|
+
/** Its offloaded fields (domain names). */
|
|
242
|
+
readonly fields: ReadonlyArray<string>;
|
|
243
|
+
/**
|
|
244
|
+
* Its table's schema sets `escapeKeys: true`, which offloading requires
|
|
245
|
+
* (`[EDD-9146]`); `undefined` when no schema is known yet (a definition on
|
|
246
|
+
* no table), which the binding refuses on its own.
|
|
247
|
+
*/
|
|
248
|
+
readonly escapeKeys: boolean | undefined;
|
|
249
|
+
}
|
|
250
|
+
/** The store requirement of an entity (`entity.offload`), if it offloads anything. */
|
|
251
|
+
export declare const entityStoreRequirements: (owner: string, entity: unknown) => ReadonlyArray<StoreRequirement>;
|
|
252
|
+
/** The store requirements of an aggregate's edge entities (`_offloadByType`). */
|
|
253
|
+
export declare const aggregateStoreRequirements: (owner: string, aggregate: unknown) => ReadonlyArray<StoreRequirement>;
|
|
254
|
+
/**
|
|
255
|
+
* The `[EDD-9146]` configuration error for members that offload on a schema
|
|
256
|
+
* without `escapeKeys: true` (design §11.10), or `undefined` when none does.
|
|
257
|
+
* Checked before the store ({@link missingStoreError}): a store doesn't make
|
|
258
|
+
* the key text right. `where` names the binding.
|
|
259
|
+
*/
|
|
260
|
+
export declare const unescapedKeysError: (where: string, requirements: ReadonlyArray<StoreRequirement>) => Error | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* The `[EDD-9115]` configuration error for members bound with no store
|
|
263
|
+
* resolvable (`store` undefined), or `undefined` when there is one or nothing
|
|
264
|
+
* offloads. `where` names the binding — `DynamoClient.make`, `Entity.bind`, ….
|
|
265
|
+
*/
|
|
266
|
+
export declare const missingStoreError: (where: string, requirements: ReadonlyArray<StoreRequirement>, store: BlobStoreService | undefined) => Error | undefined;
|
|
267
|
+
//# sourceMappingURL=OffloadWrite.d.ts.map
|
|
@@ -0,0 +1 @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