graphddb 0.2.2 → 0.2.4
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/README.md +48 -2
- package/dist/{chunk-3MI43FHU.js → chunk-GCPEUPAA.js} +250 -28
- package/dist/{chunk-CXIAECRS.js → chunk-IQEOJVHI.js} +62 -21
- package/dist/{chunk-27XBTYVK.js → chunk-LNESVUTO.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +105 -12
- package/dist/index.js +13 -3
- package/dist/testing/index.d.ts +5 -5
- package/dist/testing/index.js +9 -6
- package/dist/{types-SKxZQbQO.d.ts → types-BEeQ_nSd.d.ts} +242 -41
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SelectableOf,
|
|
2
|
-
export {
|
|
1
|
+
import { S as SelectableOf, g as PrimaryKeyOf, E as Executor, h as RetryPolicy, i as ExecutionPlanSpec, j as SegmentedKey, k as SelectBuilderSpec, l as RawCondition, m as TransactionSpec, n as Manifest, o as RetryOverride, p as ExecutionPlan, q as ResolvedKey, D as DynamoDBOperation, R as ReadExecOptions, a as ExecutorResult, B as BatchGetExecInput, P as PutInput, W as WriteExecOptions, b as WriteResult, U as UpdateInput, c as DeleteInput, d as BatchWriteExecItem, e as BatchExecOptions, T as TransactWriteExecItem, r as CdcEmulatorOptions, s as ChangeHandler, t as Unsubscribe, F as FaultSpec, u as ConcurrentRecomputeRef, C as ChangeEvent, v as EventLog, w as ReplayOptions, x as ShardId, y as TransactionItemSpec, z as Param, A as ParamDescriptor, G as DefinitionMap, O as OperationDefinition, f as DDBModel, M as ModelStatic, H as WriteDefinitionOptions, I as PartialQueryKeyOf, J as StrictSelectSpec, K as EntityInput, L as UniqueQueryKeyOf, N as EntityRef, Q as ConditionInput, V as QueryModelContract, X as QueryMethodSpec, Y as CommandModelContract, Z as CommandMethodSpec, _ as ContractSpec, $ as QuerySpec, a0 as CommandSpec, a1 as ContextSpec, a2 as OperationsDocument, a3 as AnyOperationDefinition, a4 as BridgeBundle, a5 as ConditionSpec } from './types-BEeQ_nSd.js';
|
|
2
|
+
export { a6 as BatchDeleteRequest, a7 as BatchGetRequest, a8 as BatchGetResult, a9 as BatchPutRequest, aa as BatchResult, ab as BatchWriteRequest, ac as CONTRACT_RANGE_FANOUT_CONCURRENCY, ad as CdcMode, ae as ChangeBatch, af as ChangeEventName, ag as ClockMode, ah as Column, ai as ColumnMap, aj as CommandContractMethodSpec, ak as CommandInputShape, al as CommandMethod, am as CommandPlan, an as CommandResolutionTarget, ao as CommandResultKind, ap as CommandSelectShape, aq as CompiledFragment, ar as ComposeSpec, as as CondSlot, at as ConditionCheckInput, au as Connection, av as ContractCallSignature, aw as ContractCardinality, ax as ContractCommandParams, ay as ContractCommandResult, az as ContractComposeNode, aA as ContractFromRef, aB as ContractInputArity, aC as ContractItem, aD as ContractKeyFieldRef, aE as ContractKeyInput, aF as ContractKeyRef, aG as ContractKeySpec, aH as ContractKind, aI as ContractMethodOp, aJ as ContractParamRef, aK as ContractQueryParams, aL as ContractResolution, aM as DEFAULT_MAX_ATTEMPTS, aN as DEFAULT_RETRY_POLICY, aO as DeleteOptions, aP as DeriveEffect, aQ as DerivedEdgeWrite, aR as DerivedUpdate, aS as DescriptorBinding, aT as ENTITY_WRITES_MARKER, aU as EdgeEffect, aV as EffectPath, aW as EmitEffect, aX as EntityWritesDefinition, aY as EntityWritesShape, aZ as ExecutableCommandContract, a_ as ExecutableQueryContract, a$ as FilterInput, b0 as FilterSpec, b1 as FragmentInput, b2 as GsiDefinitionMarker, b3 as GsiOptions, b4 as IdempotencyEffect, b5 as InProcessWriteDescriptor, b6 as InputArity, b7 as KeyDefinitionMarker, b8 as KeySegment, b9 as KeySlot, ba as KeyStructure, bb as KeyedResult, bc as LIFECYCLE_CONTRACT_MARKER, bd as LifecycleContract, be as LifecycleEffects, bf as LiteralParam, bg as ManifestEntity, bh as ManifestField, bi as ManifestFieldType, bj as ManifestGsi, bk as ManifestKey, bl as ManifestRelation, bm as ManifestTable, bn as ModelRef, bo as MutateMode, bp as MutateOptions, bq as MutateParallelResult, br as MutateTransactionResult, bs as MutationBody, bt as MutationDescriptorMap, bu as MutationFragment, bv as MutationInputProxy, bw as MutationInputRef, bx as MutationIntent, by as NumberParam, bz as OperationKind, bA as OperationSpec, bB as ParallelOpResult, bC as ParamKind, bD as ParamSpec, bE as ParamStructure, bF as PlannedCommandMethod, bG as PutOptions, bH as QueryContractMethodSpec, bI as QueryEnvelopeResult, bJ as QueryKeyOf, bK as QueryMethod, bL as QueryResult, bM as RangeConditionSpec, bN as ReadEnvelope, bO as ReadOperationType, bP as ReadRouteDescriptor, bQ as ReadRouteOptions, bR as ReadRouteResult, bS as RecordedCompose, bT as RelationBuilder, bU as RelationSelect, bV as RelationSpec, bW as RequiresEffect, bX as Resolution, bY as RetryInfo, bZ as RetryOperationKind, b_ as SPEC_VERSION, b$ as SegmentSpec, c0 as SelectBuilder, c1 as SelectOf, c2 as StartingPosition, c3 as StreamViewType, c4 as StringParam, c5 as TransactionContext, c6 as TransactionItemType, c7 as UniqueEffect, c8 as Updatable, c9 as UpdateOptions, ca as WhenSpec, cb as WriteDescriptor, cc as WriteEnvelope, cd as WriteLifecyclePhase, ce as WriteOperationType, cf as WriteRecorder, cg as WriteResultProjection, ch as attachModelClass, ci as buildDeleteInput, cj as buildPutInput, ck as buildUpdateInput, cl as compileFragment, cm as compileMutationPlan, cn as compileSingleFragmentPlan, co as cond, cp as contractOfMethodSpec, cq as definePlan, cr as entityWrites, cs as executeBatchGet, ct as executeBatchWrite, cu as executeCommandMethod, cv as executeDelete, cw as executeKeyedBatchGet, cx as executePut, cy as executeQueryMethod, cz as executeRangeFanout, cA as executeTransaction, cB as executeUpdate, cC as from, cD as getEntityWrites, cE as gsi, cF as isColumn, cG as isCommandModelContract, cH as isCommandPlan, cI as isContractComposeNode, cJ as isContractFromRef, cK as isContractKeyFieldRef, cL as isContractKeyRef, cM as isContractParamRef, cN as isEntityWritesDefinition, cO as isKeySegment, cP as isLifecycleContract, cQ as isMutationFragment, cR as isMutationInputRef, cS as isParam, cT as isPlannedCommandMethod, cU as isQueryModelContract, cV as isRetryableError, cW as isRetryableTransactionCancellation, cX as k, cY as key, cZ as lifecyclePhaseForIntent, c_ as mintContractKeyFieldRef, c$ as mintContractParamRef, d0 as mutation, d1 as param, d2 as publicCommandModel, d3 as publicQueryModel, d4 as query, d5 as resolveLifecycle, d6 as wholeKeysSentinel } from './types-BEeQ_nSd.js';
|
|
3
3
|
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
|
|
4
4
|
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
|
|
5
5
|
|
|
@@ -92,6 +92,13 @@ declare class ClientManager {
|
|
|
92
92
|
*/
|
|
93
93
|
private static executor;
|
|
94
94
|
private static defaultExecutor;
|
|
95
|
+
/**
|
|
96
|
+
* The globally-configured single-op retry policy (issue #111). `null` ⇒ the
|
|
97
|
+
* always-on built-in {@link DEFAULT_RETRY_POLICY} applies (retry is enabled out
|
|
98
|
+
* of the box). Set via {@link DDBModel.setRetryPolicy} / {@link setRetryPolicy};
|
|
99
|
+
* read at call time by the default {@link RetryingExecutor}.
|
|
100
|
+
*/
|
|
101
|
+
private static retryPolicy;
|
|
95
102
|
static setClient(client: DynamoDBClient): void;
|
|
96
103
|
static getClient(): DynamoDBClient;
|
|
97
104
|
static getDocumentClient(): Promise<DynamoDBDocumentClient>;
|
|
@@ -105,10 +112,23 @@ declare class ClientManager {
|
|
|
105
112
|
* executor module graph.
|
|
106
113
|
*/
|
|
107
114
|
static getExecutor(): Executor;
|
|
108
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* Inject a custom executor (test adapter / memory engine). It is used AS-IS —
|
|
117
|
+
* not wrapped in a {@link RetryingExecutor} — so the in-memory adapter (which
|
|
118
|
+
* never throttles) bypasses the retry layer entirely (issue #111).
|
|
119
|
+
*/
|
|
109
120
|
static setExecutor(executor: Executor): void;
|
|
110
|
-
/** Restore the default {@link DynamoExecutor}. */
|
|
121
|
+
/** Restore the default {@link RetryingExecutor}-wrapped {@link DynamoExecutor}. */
|
|
111
122
|
static resetExecutor(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Configure the global single-op retry policy (issue #111). Mirrors
|
|
125
|
+
* {@link setClient} / {@link setTableMapping}: a process-wide setting the default
|
|
126
|
+
* {@link RetryingExecutor} reads. `null` restores the always-on built-in default.
|
|
127
|
+
* A per-call `retry?:` override on an operation option bag takes precedence.
|
|
128
|
+
*/
|
|
129
|
+
static setRetryPolicy(policy: RetryPolicy | null): void;
|
|
130
|
+
/** The globally-configured retry policy, or `null` for the built-in default. */
|
|
131
|
+
static getRetryPolicy(): RetryPolicy | null;
|
|
112
132
|
/** @internal — for testing only */
|
|
113
133
|
static reset(): void;
|
|
114
134
|
}
|
|
@@ -503,6 +523,13 @@ declare function executeDeclarativeTransaction(spec: TransactionSpec, manifest:
|
|
|
503
523
|
interface QueryOptions {
|
|
504
524
|
consistentRead?: boolean;
|
|
505
525
|
maxDepth?: number;
|
|
526
|
+
/**
|
|
527
|
+
* Per-call throttle / transient-error retry override (issue #111), applied to the
|
|
528
|
+
* parent read AND to every relation-fan-out send under it. A {@link RetryPolicy}
|
|
529
|
+
* replaces the global policy for this call; `false` disables retry. Omit to use
|
|
530
|
+
* the configured (or built-in default) policy.
|
|
531
|
+
*/
|
|
532
|
+
retry?: RetryOverride;
|
|
506
533
|
/**
|
|
507
534
|
* When `true`, the returned item carries its resolved base-table key as a
|
|
508
535
|
* non-enumerable Symbol property so it can be passed back to `update()`
|
|
@@ -547,6 +574,12 @@ interface ListInput {
|
|
|
547
574
|
* query.
|
|
548
575
|
*/
|
|
549
576
|
updatable?: boolean;
|
|
577
|
+
/**
|
|
578
|
+
* Per-call throttle / transient-error retry override (issue #111). A
|
|
579
|
+
* {@link RetryPolicy} replaces the global policy for this read; `false` disables
|
|
580
|
+
* retry. Omit to use the configured (or built-in default) policy.
|
|
581
|
+
*/
|
|
582
|
+
retry?: RetryOverride;
|
|
550
583
|
}
|
|
551
584
|
/**
|
|
552
585
|
* Public list result returned by `DDBModel.list()`. Contains exactly the
|
|
@@ -618,10 +651,12 @@ declare function plan(metadata: EntityMetadata, input: PlanInput): ExecutionPlan
|
|
|
618
651
|
*
|
|
619
652
|
* This is the read entry point the planner-driven paths (`query` / `list`) call.
|
|
620
653
|
* It delegates to `ClientManager.getExecutor()`, which is the default
|
|
621
|
-
* {@link import('./
|
|
622
|
-
*
|
|
654
|
+
* {@link import('./retrying-executor.js').RetryingExecutor}-wrapped
|
|
655
|
+
* {@link import('./dynamo-executor.js').DynamoExecutor} unless a test has injected
|
|
656
|
+
* a `MemoryExecutor` via `ClientManager.setExecutor()`. The optional
|
|
657
|
+
* {@link ReadExecOptions} carries a per-call retry override (issue #111).
|
|
623
658
|
*/
|
|
624
|
-
declare function execute(operation: DynamoDBOperation): Promise<ExecutorResult>;
|
|
659
|
+
declare function execute(operation: DynamoDBOperation, options?: ReadExecOptions): Promise<ExecutorResult>;
|
|
625
660
|
|
|
626
661
|
/**
|
|
627
662
|
* The default {@link Executor}: a thin, behavior-preserving move of GraphDDB's
|
|
@@ -630,15 +665,65 @@ declare function execute(operation: DynamoDBOperation): Promise<ExecutorResult>;
|
|
|
630
665
|
* refactor and sends it through `ClientManager.getDocumentClient()`, so the
|
|
631
666
|
* command shapes (and therefore every existing mock-based / integration test)
|
|
632
667
|
* are unchanged.
|
|
668
|
+
*
|
|
669
|
+
* The optional per-call options (`ReadExecOptions` / `BatchExecOptions`) carry a
|
|
670
|
+
* retry override (issue #111) that is meaningful ONLY to {@link RetryingExecutor};
|
|
671
|
+
* here they are accepted to satisfy the {@link Executor} interface and otherwise
|
|
672
|
+
* ignored (this executor performs no app-level error retry of its own).
|
|
633
673
|
*/
|
|
634
674
|
declare class DynamoExecutor implements Executor {
|
|
635
|
-
execute(operation: DynamoDBOperation): Promise<ExecutorResult>;
|
|
636
|
-
batchGet(input: BatchGetExecInput): Promise<ExecutorResult>;
|
|
675
|
+
execute(operation: DynamoDBOperation, _options?: ReadExecOptions): Promise<ExecutorResult>;
|
|
676
|
+
batchGet(input: BatchGetExecInput, _options?: ReadExecOptions): Promise<ExecutorResult>;
|
|
637
677
|
put(input: PutInput, options?: WriteExecOptions): Promise<WriteResult>;
|
|
638
678
|
update(input: UpdateInput, options?: WriteExecOptions): Promise<WriteResult>;
|
|
639
679
|
delete(input: DeleteInput, options?: WriteExecOptions): Promise<WriteResult>;
|
|
640
|
-
batchWrite(tableName: string, items: BatchWriteExecItem[]): Promise<void>;
|
|
641
|
-
transactWrite(items: TransactWriteExecItem[]): Promise<void>;
|
|
680
|
+
batchWrite(tableName: string, items: BatchWriteExecItem[], _options?: BatchExecOptions): Promise<void>;
|
|
681
|
+
transactWrite(items: TransactWriteExecItem[], _options?: BatchExecOptions): Promise<void>;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* {@link RetryingExecutor} — the single-op throttle / transient-error retry layer
|
|
686
|
+
* (issue #111). It DECORATES an inner {@link Executor} (the default
|
|
687
|
+
* {@link DynamoExecutor}), wrapping every single-op send — `execute` (Get/Query),
|
|
688
|
+
* `batchGet` (relation fan-out + planner reads), `put` / `update` / `delete`, and
|
|
689
|
+
* `transactWrite` — in {@link runWithRetry} so a throttle / transient error is
|
|
690
|
+
* retried with exponential backoff + jitter under a bounded attempt cap.
|
|
691
|
+
*
|
|
692
|
+
* This is the (B) ERROR-retry layer; the (A) partial-batch retry
|
|
693
|
+
* (`UnprocessedKeys` / `UnprocessedItems`) lives inside `batchGet` / `batchWrite`
|
|
694
|
+
* and is a SEPARATE concern (see `retry-policy.ts` header). The two share the
|
|
695
|
+
* backoff function but never merge:
|
|
696
|
+
* - `batchGet` here gets an OUTER error-retry wrap (the inner BatchGet still does
|
|
697
|
+
* its own UnprocessedKeys retry; the outer wrap catches a hard throttle REJECT
|
|
698
|
+
* of the whole send).
|
|
699
|
+
* - `batchWrite` is the in-flight bulk path that already owns UnprocessedItems
|
|
700
|
+
* retry per chunk; it is passed through UNWRAPPED here to avoid double-counting
|
|
701
|
+
* a throttle as both an unprocessed-item retry and an error retry. (Its chunks
|
|
702
|
+
* already back off on the shared ramp.)
|
|
703
|
+
*
|
|
704
|
+
* The policy precedence per call: an explicit per-call override (`retry:` on the
|
|
705
|
+
* option bag) wins; otherwise the globally-configured policy
|
|
706
|
+
* (`DDBModel.setRetryPolicy`); otherwise the always-on {@link DEFAULT_RETRY_POLICY}.
|
|
707
|
+
* `retry: false`, or a resolved `maxAttempts <= 1`, disables retry for that call.
|
|
708
|
+
*/
|
|
709
|
+
|
|
710
|
+
declare class RetryingExecutor implements Executor {
|
|
711
|
+
private readonly inner;
|
|
712
|
+
private readonly getGlobalPolicy;
|
|
713
|
+
/**
|
|
714
|
+
* @param inner the wrapped executor (the real {@link DynamoExecutor}).
|
|
715
|
+
* @param getGlobalPolicy reads the globally-configured policy (or `null` for the
|
|
716
|
+
* built-in default) at CALL time, so a `DDBModel.setRetryPolicy(...)` after the
|
|
717
|
+
* executor is constructed still takes effect.
|
|
718
|
+
*/
|
|
719
|
+
constructor(inner: Executor, getGlobalPolicy: () => RetryPolicy | null);
|
|
720
|
+
execute(operation: DynamoDBOperation, options?: ReadExecOptions): Promise<ExecutorResult>;
|
|
721
|
+
batchGet(input: BatchGetExecInput, options?: ReadExecOptions): Promise<ExecutorResult>;
|
|
722
|
+
put(input: PutInput, options?: WriteExecOptions): Promise<WriteResult>;
|
|
723
|
+
update(input: UpdateInput, options?: WriteExecOptions): Promise<WriteResult>;
|
|
724
|
+
delete(input: DeleteInput, options?: WriteExecOptions): Promise<WriteResult>;
|
|
725
|
+
batchWrite(tableName: string, items: BatchWriteExecItem[], options?: BatchExecOptions): Promise<void>;
|
|
726
|
+
transactWrite(items: TransactWriteExecItem[], options?: BatchExecOptions): Promise<void>;
|
|
642
727
|
}
|
|
643
728
|
|
|
644
729
|
/**
|
|
@@ -923,6 +1008,14 @@ interface RelationTraversalOptions {
|
|
|
923
1008
|
* non-enumerable Symbol property so it can be passed back to `update()`.
|
|
924
1009
|
*/
|
|
925
1010
|
updatable?: boolean;
|
|
1011
|
+
/**
|
|
1012
|
+
* Per-call throttle / transient-error retry override (issue #111), threaded from
|
|
1013
|
+
* the read's entry point into every relation-fan-out send (the `BatchGet` for
|
|
1014
|
+
* `belongsTo` / `hasOne`, the `Query` for `hasMany`). A {@link RetryPolicy}
|
|
1015
|
+
* replaces the global policy; `false` disables retry. Threaded unchanged through
|
|
1016
|
+
* every recursion level.
|
|
1017
|
+
*/
|
|
1018
|
+
retry?: RetryOverride;
|
|
926
1019
|
/**
|
|
927
1020
|
* The **declared execution plan** (issue #70c) the traversal HONORS to decide
|
|
928
1021
|
* which sibling relations are independent (a concurrency-eligible stage) and the
|
|
@@ -2033,4 +2126,4 @@ declare function assertBundleSerializable(bundle: BridgeBundle): void;
|
|
|
2033
2126
|
*/
|
|
2034
2127
|
declare function buildBridgeBundle(queries?: DefinitionMap, commands?: DefinitionMap, registry?: typeof MetadataRegistry, transactions?: Record<string, TransactionDefinition>, contractInputs?: ContractInputs): BridgeBundle;
|
|
2035
2128
|
|
|
2036
|
-
export { type AnyModelContract, AnyOperationDefinition, BATCH_GET_MAX_KEYS, BATCH_WRITE_MAX_ITEMS, BatchGetExecInput, BatchWriteExecItem, BridgeBundle, type BuiltContracts, CdcEmulator, CdcEmulatorOptions, ChangeEvent, ChangeHandler, ClientManager, type CollectParams, CommandMethodSpec, CommandModelContract, CommandSpec, ConcurrentRecomputeRef, type ConditionExpressionResult, ConditionInput, ConditionSpec, type ContextOwnership, type ContextOwnershipMap, ContextSpec, type ContractBoundaryViolation, type ContractInputs, type ContractMap, type ContractN1Violation, ContractSpec, DDBModel, DefinitionMap, DeleteInput, DynamoDBOperation, DynamoExecutor, type DynamoType, EDGE_WRITES_MARKER, type EdgeLifecycle, type EdgeWriteDeclaration, type EdgeWriteRecorder, type EdgeWritesDefinition, type EmbeddedMetadata, type EntityMetadata, EntityRef, EventLog, ExecutionPlan, Executor, ExecutorResult, type ExplainInput, FaultSpec, type FieldMetadata, type FieldOptions, type FilterExpressionResult, type GsiDefinition, type KeyDefinition, type LintResult, type LintRule, Linter, type ListInput, type ListOptions, MAX_TRANSACT_ITEMS, Manifest, MetadataRegistry, type ModelOptions, ModelStatic, OLD_VALUE_NAMESPACE, OperationDefinition, OperationsDocument, Param, ParamDescriptor, type Parameterize, PartialQueryKeyOf, type PerKeyCursorEnvelope, type PlanInput, PrimaryKeyOf, type ProjectionResult, PutInput, QueryMethodSpec, QueryModelContract, type QueryOptions$1 as QueryOptions, QuerySpec, RawCondition, type RelationLimitOptions, type RelationMetadata, type RelationOptions, type RelationTraversalOptions, ReplayOptions, ResolvedKey, SegmentedKey, SelectableOf, ShardId, TableMapping, TransactWriteExecItem, type TransactionDefinition, TransactionItemSpec, type TransactionParamShape, type TransactionRef, TransactionSpec, type TxConditionCheckOptions, type TxForEachInstruction, type TxForEachOptions, type TxInstruction, type TxRecorder, type TxWriteInstruction, type TxWriteOptions, UniqueQueryKeyOf, type UpdateExpressionResult, UpdateInput, type WhenComparison, WriteDefinitionOptions, WriteExecOptions, WriteResult, assertBundleSerializable, assertContractBoundaries, assertContractN1Safe, assertJsonSerializable, assertSupportedCondition, belongsTo, binary, boolean, buildBridgeBundle, buildConditionExpression, buildContexts, buildContracts, buildManifest, buildOperations, buildProjection, buildQuerySpec, buildTransactionSpec, buildTransactions, buildUpdateExpression, collectContractBoundaryViolations, collectContractN1Violations, compileFilterExpression, createCdcEmulator, createDefaultLinter, datetime, decodeCursor, decodePerKeyCursor, defineCommands, defineDelete, defineList, definePut, defineQueries, defineQuery, defineTransaction, defineTransactions, defineUpdate, deriveEdgeWriteItems, deriveEdgeWriteItemsFor, deriveModelEdgeWriteItems, derivePrefix, detectRelationFields, edgeWrites, embedded, encodeCursor, encodePerKeyCursor, evaluateFilter, execute, executeDeclarativeTransaction, executeExplain, executeList, executeQuery, expandTransaction, field, getEdgeWrites, getImplicitKeyFields, gsiAmbiguityRule, hasMany, hasOne, hydrate, isEdgeWritesDefinition, isSelectBuilder, isTransactionRef, list, literal, map, missingGsiRule, model, noScanRule, number, numberSet, plan, queryBoundaryRule, relationDepthRule, requireLimitRule, resolveKey, resolveRelations, serializeContractKey, serializeFieldValue, string, stringSet, validateDepth, validateGsiAmbiguity, when };
|
|
2129
|
+
export { type AnyModelContract, AnyOperationDefinition, BATCH_GET_MAX_KEYS, BATCH_WRITE_MAX_ITEMS, BatchExecOptions, BatchGetExecInput, BatchWriteExecItem, BridgeBundle, type BuiltContracts, CdcEmulator, CdcEmulatorOptions, ChangeEvent, ChangeHandler, ClientManager, type CollectParams, CommandMethodSpec, CommandModelContract, CommandSpec, ConcurrentRecomputeRef, type ConditionExpressionResult, ConditionInput, ConditionSpec, type ContextOwnership, type ContextOwnershipMap, ContextSpec, type ContractBoundaryViolation, type ContractInputs, type ContractMap, type ContractN1Violation, ContractSpec, DDBModel, DefinitionMap, DeleteInput, DynamoDBOperation, DynamoExecutor, type DynamoType, EDGE_WRITES_MARKER, type EdgeLifecycle, type EdgeWriteDeclaration, type EdgeWriteRecorder, type EdgeWritesDefinition, type EmbeddedMetadata, type EntityMetadata, EntityRef, EventLog, ExecutionPlan, Executor, ExecutorResult, type ExplainInput, FaultSpec, type FieldMetadata, type FieldOptions, type FilterExpressionResult, type GsiDefinition, type KeyDefinition, type LintResult, type LintRule, Linter, type ListInput, type ListOptions, MAX_TRANSACT_ITEMS, Manifest, MetadataRegistry, type ModelOptions, ModelStatic, OLD_VALUE_NAMESPACE, OperationDefinition, OperationsDocument, Param, ParamDescriptor, type Parameterize, PartialQueryKeyOf, type PerKeyCursorEnvelope, type PlanInput, PrimaryKeyOf, type ProjectionResult, PutInput, QueryMethodSpec, QueryModelContract, type QueryOptions$1 as QueryOptions, QuerySpec, RawCondition, ReadExecOptions, type RelationLimitOptions, type RelationMetadata, type RelationOptions, type RelationTraversalOptions, ReplayOptions, ResolvedKey, RetryOverride, RetryPolicy, RetryingExecutor, SegmentedKey, SelectableOf, ShardId, TableMapping, TransactWriteExecItem, type TransactionDefinition, TransactionItemSpec, type TransactionParamShape, type TransactionRef, TransactionSpec, type TxConditionCheckOptions, type TxForEachInstruction, type TxForEachOptions, type TxInstruction, type TxRecorder, type TxWriteInstruction, type TxWriteOptions, UniqueQueryKeyOf, type UpdateExpressionResult, UpdateInput, type WhenComparison, WriteDefinitionOptions, WriteExecOptions, WriteResult, assertBundleSerializable, assertContractBoundaries, assertContractN1Safe, assertJsonSerializable, assertSupportedCondition, belongsTo, binary, boolean, buildBridgeBundle, buildConditionExpression, buildContexts, buildContracts, buildManifest, buildOperations, buildProjection, buildQuerySpec, buildTransactionSpec, buildTransactions, buildUpdateExpression, collectContractBoundaryViolations, collectContractN1Violations, compileFilterExpression, createCdcEmulator, createDefaultLinter, datetime, decodeCursor, decodePerKeyCursor, defineCommands, defineDelete, defineList, definePut, defineQueries, defineQuery, defineTransaction, defineTransactions, defineUpdate, deriveEdgeWriteItems, deriveEdgeWriteItemsFor, deriveModelEdgeWriteItems, derivePrefix, detectRelationFields, edgeWrites, embedded, encodeCursor, encodePerKeyCursor, evaluateFilter, execute, executeDeclarativeTransaction, executeExplain, executeList, executeQuery, expandTransaction, field, getEdgeWrites, getImplicitKeyFields, gsiAmbiguityRule, hasMany, hasOne, hydrate, isEdgeWritesDefinition, isSelectBuilder, isTransactionRef, list, literal, map, missingGsiRule, model, noScanRule, number, numberSet, plan, queryBoundaryRule, relationDepthRule, requireLimitRule, resolveKey, resolveRelations, serializeContractKey, serializeFieldValue, string, stringSet, validateDepth, validateGsiAmbiguity, when };
|
package/dist/index.js
CHANGED
|
@@ -86,19 +86,22 @@ import {
|
|
|
86
86
|
validateDepth,
|
|
87
87
|
when,
|
|
88
88
|
wholeKeysSentinel
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-IQEOJVHI.js";
|
|
90
90
|
import {
|
|
91
91
|
CdcEmulator,
|
|
92
92
|
createCdcEmulator
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-LNESVUTO.js";
|
|
94
94
|
import {
|
|
95
95
|
BATCH_GET_MAX_KEYS,
|
|
96
96
|
BATCH_WRITE_MAX_ITEMS,
|
|
97
97
|
ClientManager,
|
|
98
|
+
DEFAULT_MAX_ATTEMPTS,
|
|
99
|
+
DEFAULT_RETRY_POLICY,
|
|
98
100
|
DynamoExecutor,
|
|
99
101
|
Linter,
|
|
100
102
|
MAX_TRANSACT_ITEMS,
|
|
101
103
|
MetadataRegistry,
|
|
104
|
+
RetryingExecutor,
|
|
102
105
|
TableMapping,
|
|
103
106
|
TransactionContext,
|
|
104
107
|
attachModelClass,
|
|
@@ -123,6 +126,8 @@ import {
|
|
|
123
126
|
isKeySegment,
|
|
124
127
|
isParam,
|
|
125
128
|
isRawCondition,
|
|
129
|
+
isRetryableError,
|
|
130
|
+
isRetryableTransactionCancellation,
|
|
126
131
|
k,
|
|
127
132
|
key,
|
|
128
133
|
missingGsiRule,
|
|
@@ -134,7 +139,7 @@ import {
|
|
|
134
139
|
resolveKey,
|
|
135
140
|
resolveModelClass,
|
|
136
141
|
serializeFieldValue
|
|
137
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-GCPEUPAA.js";
|
|
138
143
|
|
|
139
144
|
// src/metadata/prefix.ts
|
|
140
145
|
function derivePrefix(customPrefix, className) {
|
|
@@ -1044,6 +1049,8 @@ export {
|
|
|
1044
1049
|
CdcEmulator,
|
|
1045
1050
|
ClientManager,
|
|
1046
1051
|
DDBModel,
|
|
1052
|
+
DEFAULT_MAX_ATTEMPTS,
|
|
1053
|
+
DEFAULT_RETRY_POLICY,
|
|
1047
1054
|
DynamoExecutor,
|
|
1048
1055
|
EDGE_WRITES_MARKER,
|
|
1049
1056
|
ENTITY_WRITES_MARKER,
|
|
@@ -1052,6 +1059,7 @@ export {
|
|
|
1052
1059
|
MAX_TRANSACT_ITEMS,
|
|
1053
1060
|
MetadataRegistry,
|
|
1054
1061
|
OLD_VALUE_NAMESPACE,
|
|
1062
|
+
RetryingExecutor,
|
|
1055
1063
|
SPEC_VERSION,
|
|
1056
1064
|
TableMapping,
|
|
1057
1065
|
TransactionContext,
|
|
@@ -1155,6 +1163,8 @@ export {
|
|
|
1155
1163
|
isParam,
|
|
1156
1164
|
isPlannedCommandMethod,
|
|
1157
1165
|
isQueryModelContract,
|
|
1166
|
+
isRetryableError,
|
|
1167
|
+
isRetryableTransactionCancellation,
|
|
1158
1168
|
isSelectBuilder,
|
|
1159
1169
|
isTransactionRef,
|
|
1160
1170
|
k,
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Executor, D as DynamoDBOperation, a as ExecutorResult, B as BatchGetExecInput, P as PutInput, W as WriteExecOptions, b as WriteResult, U as UpdateInput, c as DeleteInput, d as BatchWriteExecItem, T as TransactWriteExecItem, M as ModelStatic,
|
|
1
|
+
import { E as Executor, D as DynamoDBOperation, R as ReadExecOptions, a as ExecutorResult, B as BatchGetExecInput, P as PutInput, W as WriteExecOptions, b as WriteResult, U as UpdateInput, c as DeleteInput, d as BatchWriteExecItem, e as BatchExecOptions, T as TransactWriteExecItem, M as ModelStatic, f as DDBModel, C as ChangeEvent } from '../types-BEeQ_nSd.js';
|
|
2
2
|
import '@aws-sdk/client-dynamodb';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -71,15 +71,15 @@ declare class MemoryStore {
|
|
|
71
71
|
declare class MemoryExecutor implements Executor {
|
|
72
72
|
private readonly store;
|
|
73
73
|
constructor(store: MemoryStore);
|
|
74
|
-
execute(operation: DynamoDBOperation): Promise<ExecutorResult>;
|
|
75
|
-
batchGet(input: BatchGetExecInput): Promise<ExecutorResult>;
|
|
74
|
+
execute(operation: DynamoDBOperation, _options?: ReadExecOptions): Promise<ExecutorResult>;
|
|
75
|
+
batchGet(input: BatchGetExecInput, _options?: ReadExecOptions): Promise<ExecutorResult>;
|
|
76
76
|
private getItem;
|
|
77
77
|
private query;
|
|
78
78
|
put(input: PutInput, options?: WriteExecOptions): Promise<WriteResult>;
|
|
79
79
|
update(input: UpdateInput, options?: WriteExecOptions): Promise<WriteResult>;
|
|
80
80
|
delete(input: DeleteInput, options?: WriteExecOptions): Promise<WriteResult>;
|
|
81
|
-
batchWrite(tableName: string, items: BatchWriteExecItem[]): Promise<void>;
|
|
82
|
-
transactWrite(items: TransactWriteExecItem[]): Promise<void>;
|
|
81
|
+
batchWrite(tableName: string, items: BatchWriteExecItem[], _options?: BatchExecOptions): Promise<void>;
|
|
82
|
+
transactWrite(items: TransactWriteExecItem[], _options?: BatchExecOptions): Promise<void>;
|
|
83
83
|
private restoreTable;
|
|
84
84
|
/**
|
|
85
85
|
* Evaluate a transaction `ConditionCheck` (issue #81): read the keyed item and
|
package/dist/testing/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCdcEmulator
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-LNESVUTO.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientManager,
|
|
6
6
|
MetadataRegistry,
|
|
7
7
|
TableMapping,
|
|
8
8
|
resolveModelClass
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-GCPEUPAA.js";
|
|
10
10
|
|
|
11
11
|
// src/memory/memory-store.ts
|
|
12
12
|
function deepClone(value) {
|
|
@@ -543,7 +543,10 @@ var MemoryExecutor = class {
|
|
|
543
543
|
}
|
|
544
544
|
store;
|
|
545
545
|
// ── reads ────────────────────────────────────────────────────────────────
|
|
546
|
-
|
|
546
|
+
// The optional per-call options (`ReadExecOptions` / `BatchExecOptions`) carry a
|
|
547
|
+
// retry override (issue #111) that only `RetryingExecutor` acts on; the in-memory
|
|
548
|
+
// adapter never throttles, so it accepts and ignores them.
|
|
549
|
+
async execute(operation, _options) {
|
|
547
550
|
if (operation.type === "GetItem") {
|
|
548
551
|
return this.getItem(operation);
|
|
549
552
|
}
|
|
@@ -552,7 +555,7 @@ var MemoryExecutor = class {
|
|
|
552
555
|
}
|
|
553
556
|
return this.query(operation);
|
|
554
557
|
}
|
|
555
|
-
async batchGet(input) {
|
|
558
|
+
async batchGet(input, _options) {
|
|
556
559
|
const items = [];
|
|
557
560
|
for (const key of input.keys) {
|
|
558
561
|
const found = this.store.getItem(
|
|
@@ -673,7 +676,7 @@ var MemoryExecutor = class {
|
|
|
673
676
|
this.store.deleteItem(input.TableName, pk, sk);
|
|
674
677
|
return options?.returnOldImage && prior ? { oldItem: prior } : {};
|
|
675
678
|
}
|
|
676
|
-
async batchWrite(tableName, items) {
|
|
679
|
+
async batchWrite(tableName, items, _options) {
|
|
677
680
|
for (const item of items) {
|
|
678
681
|
if (item.type === "put") {
|
|
679
682
|
this.store.putItem(tableName, item.item);
|
|
@@ -686,7 +689,7 @@ var MemoryExecutor = class {
|
|
|
686
689
|
}
|
|
687
690
|
}
|
|
688
691
|
}
|
|
689
|
-
async transactWrite(items) {
|
|
692
|
+
async transactWrite(items, _options) {
|
|
690
693
|
if (items.length === 0) return;
|
|
691
694
|
const touchedTables = /* @__PURE__ */ new Set();
|
|
692
695
|
for (const it of items) {
|