graphddb 0.5.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdc/index.d.ts +2 -2
- package/dist/cdc/index.js +2 -2
- package/dist/{chunk-M6URQOAW.js → chunk-5NXNEW43.js} +1 -1
- package/dist/{chunk-CCIVET5K.js → chunk-F2DI3GTI.js} +88 -0
- package/dist/{chunk-Y7XV5QL2.js → chunk-GFGVDF4W.js} +680 -58
- package/dist/cli.js +161 -7
- package/dist/{from-change-DQK2Jm9R.d.ts → from-change-pnURY-cV.d.ts} +1 -1
- package/dist/{index-CtDBo8Se.d.ts → index-Eg94ChE1.d.ts} +2 -2
- package/dist/index.d.ts +53 -8
- package/dist/index.js +39 -5
- package/dist/linter/index.d.ts +4 -4
- package/dist/{maintenance-view-adapter-D5t9taTE.d.ts → maintenance-view-adapter-BP2CJDdz.d.ts} +2621 -2236
- package/dist/{registry-BD_5Rm5C.d.ts → registry-Cv9nl_3i.d.ts} +1 -1
- package/dist/{relation-depth-DLkhG0xX.d.ts → relation-depth-BR0y7Q1i.d.ts} +1 -1
- package/dist/spec/index.d.ts +3 -3
- package/dist/spec/index.js +2 -2
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +2 -2
- package/dist/transform/index.d.ts +167 -0
- package/dist/transform/index.js +719 -0
- package/docs/design-patterns.md +150 -27
- package/docs/prepared-statements.md +165 -0
- package/package.json +14 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { a as LintResult, L as LintRule, b as Linter, M as MetadataRegistry } from './registry-
|
|
2
|
-
import { aN as SelectableOf, aO as PrimaryKeyOf, aP as RequestContext, aQ as Middleware, aR as ReadRequestKind, aS as CtxModel, aT as ReadParams, aU as ReadRequestCtx, D as DynamoDBOperation, aV as Item, n as Executor, aW as RetryPolicy, am as ExecutionPlanSpec, aX as KeyDefinition, aY as GsiDefinition, aZ as ModelKind, a_ as FieldOptions, a$ as DynamoType, b0 as ProjectionTransform, b1 as MaintainEvent, b2 as MembershipPredicate, b3 as MaintainConsistency, b4 as MaintainUpdateMode, b5 as MembershipPredicateOp, b6 as RelationOptions, b7 as AggregateOptions, b8 as AggregateValue, b9 as SelectBuilderSpec, ba as RawCondition, m as EntityMetadata, N as TransactionSpec, _ as Manifest, bb as RetryOverride, bc as ExecutionPlan, bd as FieldMetadata, be as ResolvedKey, o as ReadExecOptions, p as ExecutorResult, q as BatchGetExecInput, P as PutInput, W as WriteExecOptions, r as WriteResult, s as UpdateInput, t as DeleteInput, u as BatchWriteExecItem, v as BatchExecOptions, T as TransactWriteExecItem, bf as RelationMetadata, aC as TransactionItemSpec, bg as MaintainEffect, M as ModelStatic, w as DDBModel, V as ViewDefinition, A as Param, x as ParamDescriptor, X as DefinitionMap, bh as OperationDefinition, bi as WriteDefinitionOptions, bj as PartialQueryKeyOf, bk as StrictSelectSpec, bl as ReadDefinitionOptions, bm as EntityInput, bn as UniqueQueryKeyOf } from './maintenance-view-adapter-
|
|
3
|
-
export { bo as AggregateMetadata, Z as AnyOperationDefinition, bp as BatchDeleteRequest, bq as BatchGetOptions, br as BatchGetRequest, bs as BatchGetResult, bt as BatchPutRequest, B as BatchResult, bu as BatchWriteRequest, $ as BridgeBundle, bv as CONTRACT_RANGE_FANOUT_CONCURRENCY, C as CdcEmulatorOptions, a as CdcMode, bw as CdcModelRegistry, bx as CdcSubscribeHandlers, by as Change, b as ChangeBatch, c as ChangeEvent, d as ChangeEventName, e as ChangeHandler, f as ClockMode, bz as CollectionEffect, bA as CollectionOptions, bB as Column, bC as ColumnMap, a1 as CommandContractMethodSpec, bD as CommandInputShape, bE as CommandMethod, I as CommandMethodSpec, H as CommandModelContract, bF as CommandPlan, a2 as CommandResolutionTarget, bG as CommandResultKind, bH as CommandSelectShape, L as CommandSpec, a3 as CompiledFragment, a5 as ComposeSpec, g as ConcurrentRecomputeRef, bI as CondSlot, bJ as ConditionCheckInput, z as ConditionInput, a0 as ConditionSpec, bK as Connection, O as ContextSpec, bL as ContractCallSignature, a7 as ContractCardinality, bM as ContractCommandParams, a8 as ContractCommandResult, bN as ContractComposeNode, bO as ContractFromRef, a9 as ContractInputArity, bP as ContractItem, bQ as ContractKeyFieldRef, bR as ContractKeyInput, bS as ContractKeyRef, aa as ContractKeySpec, ab as ContractKind, bT as ContractMethodOp, bU as ContractParamRef, bV as ContractQueryParams, ac as ContractResolution, J as ContractSpec, bW as CounterAggregate, bX as CounterEffect, bY as CtxBase, bZ as DEFAULT_MAX_ATTEMPTS, b_ as DEFAULT_RETRY_POLICY, b$ as DeleteOptions, c0 as DeriveEffect, ae as DerivedEdgeWrite, ak as DerivedUpdate, c1 as DescriptorBinding, c2 as ENTITY_WRITES_MARKER, c3 as EdgeEffect, c4 as EffectPath, c5 as EmbeddedMetadata, c6 as EmitEffect, y as EntityRef, c7 as EntityWritesDefinition, c8 as EntityWritesShape, E as EventLog, c9 as ExecutableCommandContract, ca as ExecutableQueryContract, F as FaultSpec, cb as FilterInput, an as FilterSpec, cc as FragmentInput, cd as GsiDefinitionMarker, ce as GsiOptions, cf as IdempotencyEffect, cg as InProcessWriteDescriptor, ch as
|
|
1
|
+
export { a as LintResult, L as LintRule, b as Linter, M as MetadataRegistry } from './registry-Cv9nl_3i.js';
|
|
2
|
+
import { aN as SelectableOf, aO as PrimaryKeyOf, aP as RequestContext, aQ as Middleware, aR as ReadRequestKind, aS as CtxModel, aT as ReadParams, aU as ReadRequestCtx, D as DynamoDBOperation, aV as Item, n as Executor, aW as RetryPolicy, am as ExecutionPlanSpec, aX as KeyDefinition, aY as GsiDefinition, aZ as ModelKind, a_ as FieldOptions, a$ as DynamoType, b0 as ProjectionTransform, b1 as MaintainEvent, b2 as MembershipPredicate, b3 as MaintainConsistency, b4 as MaintainUpdateMode, b5 as MembershipPredicateOp, b6 as RelationOptions, b7 as AggregateOptions, b8 as AggregateValue, b9 as SelectBuilderSpec, ba as RawCondition, m as EntityMetadata, N as TransactionSpec, _ as Manifest, bb as RetryOverride, bc as ExecutionPlan, bd as FieldMetadata, be as ResolvedKey, o as ReadExecOptions, p as ExecutorResult, q as BatchGetExecInput, P as PutInput, W as WriteExecOptions, r as WriteResult, s as UpdateInput, t as DeleteInput, u as BatchWriteExecItem, v as BatchExecOptions, T as TransactWriteExecItem, bf as RelationMetadata, aC as TransactionItemSpec, bg as MaintainEffect, M as ModelStatic, w as DDBModel, V as ViewDefinition, A as Param, x as ParamDescriptor, X as DefinitionMap, bh as OperationDefinition, bi as WriteDefinitionOptions, bj as PartialQueryKeyOf, bk as StrictSelectSpec, bl as ReadDefinitionOptions, bm as EntityInput, bn as UniqueQueryKeyOf } from './maintenance-view-adapter-BP2CJDdz.js';
|
|
3
|
+
export { bo as AggregateMetadata, Z as AnyOperationDefinition, bp as BatchDeleteRequest, bq as BatchGetOptions, br as BatchGetRequest, bs as BatchGetResult, bt as BatchPutRequest, B as BatchResult, bu as BatchWriteRequest, $ as BridgeBundle, bv as CONTRACT_RANGE_FANOUT_CONCURRENCY, C as CdcEmulatorOptions, a as CdcMode, bw as CdcModelRegistry, bx as CdcSubscribeHandlers, by as Change, b as ChangeBatch, c as ChangeEvent, d as ChangeEventName, e as ChangeHandler, f as ClockMode, bz as CollectionEffect, bA as CollectionOptions, bB as Column, bC as ColumnMap, a1 as CommandContractMethodSpec, bD as CommandInputShape, bE as CommandMethod, I as CommandMethodSpec, H as CommandModelContract, bF as CommandPlan, a2 as CommandResolutionTarget, bG as CommandResultKind, bH as CommandSelectShape, L as CommandSpec, a3 as CompiledFragment, a5 as ComposeSpec, g as ConcurrentRecomputeRef, bI as CondSlot, bJ as ConditionCheckInput, z as ConditionInput, a0 as ConditionSpec, bK as Connection, O as ContextSpec, bL as ContractCallSignature, a7 as ContractCardinality, bM as ContractCommandParams, a8 as ContractCommandResult, bN as ContractComposeNode, bO as ContractFromRef, a9 as ContractInputArity, bP as ContractItem, bQ as ContractKeyFieldRef, bR as ContractKeyInput, bS as ContractKeyRef, aa as ContractKeySpec, ab as ContractKind, bT as ContractMethodOp, bU as ContractParamRef, bV as ContractQueryParams, ac as ContractResolution, J as ContractSpec, bW as CounterAggregate, bX as CounterEffect, bY as CtxBase, bZ as DEFAULT_MAX_ATTEMPTS, b_ as DEFAULT_RETRY_POLICY, b$ as DeleteOptions, c0 as DeriveEffect, ae as DerivedEdgeWrite, ak as DerivedUpdate, c1 as DescriptorBinding, c2 as ENTITY_WRITES_MARKER, c3 as EdgeEffect, c4 as EffectPath, c5 as EmbeddedMetadata, c6 as EmitEffect, y as EntityRef, c7 as EntityWritesDefinition, c8 as EntityWritesShape, E as EventLog, c9 as ExecutableCommandContract, ca as ExecutableQueryContract, F as FaultSpec, cb as FilterInput, an as FilterSpec, cc as FragmentInput, cd as GsiDefinitionMarker, ce as GsiOptions, cf as IdempotencyEffect, cg as InProcessWriteDescriptor, ch as InlineSnapshotSpec, ci as InputArity, cj as KeyDefinitionMarker, ck as KeySegment, cl as KeySlot, cm as KeyStructure, cn as KeyedResult, co as LIFECYCLE_CONTRACT_MARKER, cp as LifecycleContract, cq as LifecycleEffects, cr as LiteralParam, cs as MaintainItem, ct as MaintainTrigger, cu as MaintenanceGraph, ap as ManifestEntity, aq as ManifestField, ar as ManifestFieldType, as as ManifestGsi, at as ManifestKey, au as ManifestRelation, av as ManifestTable, cv as MembershipEffect, cw as ModelRef, cx as MutateMode, cy as MutateOptions, cz as MutateParallelResult, cA as MutateTransactionResult, cB as MutationBody, cC as MutationDescriptorMap, cD as MutationFragment, cE as MutationInputProxy, cF as MutationInputRef, cG as MutationIntent, cH as NumberParam, cI as OperationKind, aw as OperationSpec, Y as OperationsDocument, cJ as PREPARE_CACHE_MAX, cK as ParallelOpResult, cL as ParamKind, ax as ParamSpec, cM as ParamStructure, cN as PersistCtx, cO as PersistOrigin, cP as PlannedCommandMethod, cQ as PreparedBody, cR as PreparedInputProxy, cS as PreparedParamRef, cT as PreparedReadExecOptions, cU as PreparedReadRoute, cV as PreparedReadStatement, cW as PreparedStatement, cX as PreparedWriteExecOptions, cY as PreparedWriteRoute, cZ as PreparedWriteStatement, c_ as ProjectionMap, c$ as ProjectionTransformOp, d0 as PutOptions, ay as QueryContractMethodSpec, d1 as QueryEnvelopeResult, d2 as QueryKeyOf, d3 as QueryMethod, G as QueryMethodSpec, Q as QueryModelContract, d4 as QueryResult, K as QuerySpec, az as RangeConditionSpec, d5 as ReadEnvelope, d6 as ReadOpCtx, d7 as ReadOpKind, aA as ReadOperationType, d8 as ReadRouteDescriptor, d9 as ReadRouteOptions, da as ReadRouteResult, db as RecordedCompose, dc as RelationBuilder, dd as RelationConsistency, de as RelationLimitOptions, df as RelationPattern, dg as RelationProjection, dh as RelationReadOptions, di as RelationSelect, dj as RelationSpec, dk as RelationUpdateMode, dl as RelationWriteOptions, R as ReplayOptions, dm as RequiresEffect, dn as Resolution, dp as RetryInfo, dq as RetryOperationKind, aB as SPEC_VERSION, dr as SegmentSpec, ds as SegmentedKey, dt as SelectBuilder, du as SelectOf, S as ShardId, dv as SnapshotEffect, h as StartingPosition, i as StreamViewType, dw as StringParam, j as SubscribeHandler, k as SubscribeHandlers, dx as TransactionContext, aD as TransactionItemType, dy as UniqueEffect, dz as Updatable, dA as UpdateOptions, dB as ViewSourceSlice, aE as WhenSpec, dC as WriteCtx, dD as WriteDescriptor, dE as WriteEnvelope, dF as WriteInput, dG as WriteKind, dH as WriteLifecyclePhase, dI as WriteMiddleware, aF as WriteOperationType, dJ as WriteRecorder, dK as WriteResultProjection, dL as attachModelClass, dM as buildDeleteInput, dN as buildMaintenanceGraph, dO as buildPutInput, l as buildSubscribeHandler, dP as buildUpdateInput, dQ as collectViewDefinitions, aH as compileFragment, aI as compileMutationPlan, aJ as compileSingleFragmentPlan, dR as cond, dS as contractOfMethodSpec, dT as definePlan, dU as entityWrites, dV as executeBatchGet, dW as executeBatchWrite, dX as executeCommandMethod, dY as executeDelete, dZ as executeKeyedBatchGet, d_ as executePut, d$ as executeQueryMethod, e0 as executeRangeFanout, e1 as executeTransaction, e2 as executeUpdate, e3 as from, e4 as getEntityWrites, e5 as gsi, e6 as identity, e7 as isColumn, e8 as isCommandModelContract, e9 as isCommandPlan, ea as isContractComposeNode, eb as isContractFromRef, ec as isContractKeyFieldRef, ed as isContractKeyRef, ee as isContractParamRef, ef as isEntityWritesDefinition, eg as isKeySegment, eh as isLifecycleContract, ei as isMaintainTrigger, ej as isMutationFragment, ek as isMutationInputRef, el as isParam, em as isPlannedCommandMethod, en as isPreparedParamRef, eo as isQueryModelContract, ep as isRetryableError, eq as isRetryableTransactionCancellation, er as k, es as key, et as lifecyclePhaseForIntent, eu as maintainTrigger, ev as mintContractKeyFieldRef, ew as mintContractParamRef, ex as mutation, ey as param, ez as prepare, eA as preview, eB as publicCommandModel, eC as publicQueryModel, eD as query, aL as resolveLifecycle, eE as wholeKeysSentinel } from './maintenance-view-adapter-BP2CJDdz.js';
|
|
4
4
|
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
|
|
5
5
|
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
|
|
6
|
-
export { C as CdcEmulator, M as MAINT_OUTBOX_PK_PREFIX, a as MaintenanceDrain, b as MaintenanceDrainOptions, c as createCdcEmulator, d as createMaintenanceDrain, e as createMaintenanceDrainHandler, p as parseChange } from './from-change-
|
|
7
|
-
export { c as createDefaultLinter, g as gsiAmbiguityRule, m as missingGsiRule, n as noScanRule, q as queryBoundaryRule, r as relationDepthRule, a as requireLimitRule } from './relation-depth-
|
|
8
|
-
export { A as AnyModelContract, B as BuiltContracts, C as ContextOwnership, a as ContextOwnershipMap, b as ContractBoundaryViolation, c as ContractInputs, d as ContractMap, e as ContractN1Violation, T as TransactionDefinition, f as TransactionParamShape, g as TransactionRef, h as TxConditionCheckOptions, i as TxForEachInstruction, j as TxForEachOptions, k as TxInstruction, l as TxRecorder, m as TxWriteInstruction, n as TxWriteOptions, W as WhenComparison, o as assertBundleSerializable, p as assertContractBoundaries, q as assertContractN1Safe, r as assertJsonSerializable, s as assertSupportedCondition, t as buildBridgeBundle, u as buildContexts, v as buildContracts, w as buildManifest, x as buildOperations, y as buildQuerySpec, z as buildTransactionSpec, D as buildTransactions, E as collectContractBoundaryViolations, F as collectContractN1Violations, G as defineTransaction, H as defineTransactions, I as isTransactionRef, J as when } from './index-
|
|
6
|
+
export { C as CdcEmulator, M as MAINT_OUTBOX_PK_PREFIX, a as MaintenanceDrain, b as MaintenanceDrainOptions, c as createCdcEmulator, d as createMaintenanceDrain, e as createMaintenanceDrainHandler, p as parseChange } from './from-change-pnURY-cV.js';
|
|
7
|
+
export { c as createDefaultLinter, g as gsiAmbiguityRule, m as missingGsiRule, n as noScanRule, q as queryBoundaryRule, r as relationDepthRule, a as requireLimitRule } from './relation-depth-BR0y7Q1i.js';
|
|
8
|
+
export { A as AnyModelContract, B as BuiltContracts, C as ContextOwnership, a as ContextOwnershipMap, b as ContractBoundaryViolation, c as ContractInputs, d as ContractMap, e as ContractN1Violation, T as TransactionDefinition, f as TransactionParamShape, g as TransactionRef, h as TxConditionCheckOptions, i as TxForEachInstruction, j as TxForEachOptions, k as TxInstruction, l as TxRecorder, m as TxWriteInstruction, n as TxWriteOptions, W as WhenComparison, o as assertBundleSerializable, p as assertContractBoundaries, q as assertContractN1Safe, r as assertJsonSerializable, s as assertSupportedCondition, t as buildBridgeBundle, u as buildContexts, v as buildContracts, w as buildManifest, x as buildOperations, y as buildQuerySpec, z as buildTransactionSpec, D as buildTransactions, E as collectContractBoundaryViolations, F as collectContractN1Violations, G as defineTransaction, H as defineTransactions, I as isTransactionRef, J as when } from './index-Eg94ChE1.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Query options with conditional `consistentRead` availability.
|
|
@@ -784,6 +784,48 @@ type HasManyVersionedCallback<Self, Source> = (self: SelfProxy<Self>, source: So
|
|
|
784
784
|
|
|
785
785
|
declare function hasMany(targetFactory: () => new (...args: unknown[]) => unknown, keyBinding: Record<string, string>, options?: RelationOptions): (value: undefined, context: ClassFieldDecoratorContext) => void;
|
|
786
786
|
declare function hasMany<Self = unknown, Source = unknown>(targetFactory: () => new (...args: unknown[]) => unknown, callback: HasManyVersionedCallback<Self, Source>): (value: undefined, context: ClassFieldDecoratorContext) => void;
|
|
787
|
+
/**
|
|
788
|
+
* Options for a `@refs` relation (issue #197, Pattern 2 Embedded Refs read side).
|
|
789
|
+
*
|
|
790
|
+
* A `@refs` relation resolves an **inline id-list** on the parent row into the
|
|
791
|
+
* referenced child bodies in ONE deduped `BatchGetItem`:
|
|
792
|
+
*
|
|
793
|
+
* ```ts
|
|
794
|
+
* @list tagRefs!: { tagId: string }[]; // the stored inline ref list
|
|
795
|
+
* @refs(() => PTagModel, { from: 'tagRefs', key: 'tagId' })
|
|
796
|
+
* tags!: PTagModel[]; // resolved child bodies
|
|
797
|
+
* ```
|
|
798
|
+
*
|
|
799
|
+
* `Model.query(key, { tags: { select: { name: true } } })` then reads the parent,
|
|
800
|
+
* pulls `tagId` off each `tagRefs` element, dedupes, and hydrates the `PTag`
|
|
801
|
+
* bodies in a single BatchGet — the exact physical cost (parent read + 1
|
|
802
|
+
* BatchGet) of the manual two-call form, but declarative and typed.
|
|
803
|
+
*/
|
|
804
|
+
interface RefsOptions extends RelationOptions {
|
|
805
|
+
/** The parent LIST attribute holding the inline reference elements (e.g. `'tagRefs'`). */
|
|
806
|
+
from: string;
|
|
807
|
+
/** The key field to read off EACH list element (e.g. `'tagId'`). */
|
|
808
|
+
key: string;
|
|
809
|
+
/**
|
|
810
|
+
* The TARGET child key field the element key binds to. Defaults to `key` (the
|
|
811
|
+
* common case where the element field name matches the child's key field name,
|
|
812
|
+
* e.g. `tagRefs[].tagId` → `PTag.tagId`). Supply when they differ.
|
|
813
|
+
*/
|
|
814
|
+
to?: string;
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Declares a **`refs`** relation (issue #197): the parent row holds an inline
|
|
818
|
+
* id-list (`from`, a `@list` attribute) whose elements each carry a reference key
|
|
819
|
+
* (`key`); the relation resolves those references to the target child bodies in a
|
|
820
|
+
* single deduped `BatchGetItem` at read time
|
|
821
|
+
* (`Model.query(key, { <prop>: { select: {…} } })`).
|
|
822
|
+
*
|
|
823
|
+
* The decorated property must be declared as an array of the target model
|
|
824
|
+
* (`tags!: PTagModel[]`), so it selects/returns like a bounded collection
|
|
825
|
+
* (`{ items, cursor }`, `cursor` always `null` — a refs list is finite, not
|
|
826
|
+
* paged).
|
|
827
|
+
*/
|
|
828
|
+
declare function refs(targetFactory: () => new (...args: unknown[]) => unknown, options: RefsOptions): (_value: undefined, context: ClassFieldDecoratorContext) => void;
|
|
787
829
|
declare function belongsTo(targetFactory: () => new (...args: unknown[]) => unknown, keyBinding: Record<string, string>, options?: RelationOptions): (_value: undefined, context: ClassFieldDecoratorContext) => void;
|
|
788
830
|
declare function hasOne(targetFactory: () => new (...args: unknown[]) => unknown, keyBinding: Record<string, string>, options?: RelationOptions): (value: undefined, context: ClassFieldDecoratorContext) => void;
|
|
789
831
|
declare function hasOne<Self = unknown, Source = unknown>(targetFactory: () => new (...args: unknown[]) => unknown, callback: HasOneVersionedCallback<Self, Source>): (value: undefined, context: ClassFieldDecoratorContext) => void;
|
|
@@ -1149,7 +1191,10 @@ interface ProjectionResult {
|
|
|
1149
1191
|
*
|
|
1150
1192
|
* Rules:
|
|
1151
1193
|
* - scalar (`true`) → field name added to projection
|
|
1152
|
-
* -
|
|
1194
|
+
* - inline embeddedSnapshot read (`{ inline: true }`, issue #196) → the owner-row
|
|
1195
|
+
* physical attribute is added to the projection like a scalar (the maintained
|
|
1196
|
+
* copy is read straight off the row, NOT traversed to child partitions)
|
|
1197
|
+
* - embedded (object without `select`/`inline`) → nested path e.g. `#p0.#p1`
|
|
1153
1198
|
* - relation (object with `select` property) → excluded from projection
|
|
1154
1199
|
* - additionalFields → added to projection (for implicit key resolution)
|
|
1155
1200
|
*/
|
|
@@ -2055,4 +2100,4 @@ type WriteOnlyDefinitions<D extends DefinitionMap> = {
|
|
|
2055
2100
|
[K in keyof D]: D[K] extends OperationDefinition<infer _T, infer Op, infer _K, infer _S, infer _Ch, infer _P> ? Op extends 'put' | 'update' | 'delete' ? D[K] : OperationDefinition<DDBModel, 'put' | 'update' | 'delete', unknown, unknown, unknown, Record<string, ParamDescriptor>> : never;
|
|
2056
2101
|
};
|
|
2057
2102
|
|
|
2058
|
-
export { AggregateOptions, AggregateValue, BATCH_GET_MAX_KEYS, BATCH_WRITE_MAX_ITEMS, BatchExecOptions, BatchGetExecInput, BatchWriteExecItem, ClientManager, type CollectParams, type ConditionExpressionResult, CtxModel, DDBModel, DefinitionMap, DeleteInput, type DriftReport, DynamoDBOperation, DynamoExecutor, DynamoType, EDGE_WRITES_MARKER, type EdgeLifecycle, type EdgeWriteDeclaration, type EdgeWriteRecorder, type EdgeWritesDefinition, EntityMetadata, ExecutionPlan, Executor, ExecutorResult, type ExplainInput, FieldMetadata, FieldOptions, type FilterExpressionResult, GsiDefinition, type HasManyVersionedCallback, type HasManyVersionedOptions, type HasOneVersionedCallback, type HasOneVersionedOptions, Item, KeyDefinition, type ListInput, type ListOptions, MAX_TRANSACT_ITEMS, MaintainConsistency, MaintainEffect, MaintainEvent, MaintainUpdateMode, type MaintainedFromCallback, type MaintainedFromOptions, type MaintenanceRebuildOptions, MaintenanceRebuilder, Manifest, MembershipPredicate, MembershipPredicateOp, Middleware, type ModelOptions, ModelStatic, OLD_VALUE_NAMESPACE, OperationDefinition, Param, ParamDescriptor, type Parameterize, PartialQueryKeyOf, type PerKeyCursorEnvelope, type PlanInput, PrimaryKeyOf, type ProjectionResult, ProjectionTransform, type ProjectionValue, PutInput, type QueryOptions$1 as QueryOptions, RawCondition, ReadExecOptions, ReadParams, ReadRequestCtx, ReadRequestKind, type RebuildResult, RelationMetadata, RelationOptions, type RelationTraversalOptions, RequestContext, ResolvedKey, RetryOverride, RetryPolicy, RetryingExecutor, SelectableOf, type SelfProxy, type SelfRef, type SourceProxy, type SourceRef, TableMapping, TransactWriteExecItem, TransactionItemSpec, TransactionSpec, UniqueQueryKeyOf, type UpdateExpressionResult, UpdateInput, type VersionedHistoryOptions, type VersionedLatestOptions, ViewDefinition, WriteDefinitionOptions, WriteExecOptions, WriteResult, aggregate, belongsTo, binary, boolean, buildConditionExpression, buildProjection, buildUpdateExpression, cdcProjected, compileFilterExpression, count, createMaintenanceRebuilder, datetime, decodeCursor, decodePerKeyCursor, defineCommands, defineDelete, defineList, definePut, defineQueries, defineQuery, defineUpdate, deriveEdgeWriteItems, deriveEdgeWriteItemsFor, deriveModelEdgeWriteItems, derivePrefix, detectRelationFields, edgeWrites, embedded, encodeCursor, encodePerKeyCursor, evaluateFilter, execute, executeDeclarativeTransaction, executeExplain, executeList, executeQuery, expandTransaction, field, getEdgeWrites, getImplicitKeyFields, hasMany, hasOne, hydrate, isEdgeWritesDefinition, isSelectBuilder, list, literal, maintainedFrom, map, max, model, number, numberSet, plan, resolveKey, resolveRelations, serializeContractKey, serializeFieldValue, string, stringSet, ttl, validateDepth, validateGsiAmbiguity, whenMember };
|
|
2103
|
+
export { AggregateOptions, AggregateValue, BATCH_GET_MAX_KEYS, BATCH_WRITE_MAX_ITEMS, BatchExecOptions, BatchGetExecInput, BatchWriteExecItem, ClientManager, type CollectParams, type ConditionExpressionResult, CtxModel, DDBModel, DefinitionMap, DeleteInput, type DriftReport, DynamoDBOperation, DynamoExecutor, DynamoType, EDGE_WRITES_MARKER, type EdgeLifecycle, type EdgeWriteDeclaration, type EdgeWriteRecorder, type EdgeWritesDefinition, EntityMetadata, ExecutionPlan, Executor, ExecutorResult, type ExplainInput, FieldMetadata, FieldOptions, type FilterExpressionResult, GsiDefinition, type HasManyVersionedCallback, type HasManyVersionedOptions, type HasOneVersionedCallback, type HasOneVersionedOptions, Item, KeyDefinition, type ListInput, type ListOptions, MAX_TRANSACT_ITEMS, MaintainConsistency, MaintainEffect, MaintainEvent, MaintainUpdateMode, type MaintainedFromCallback, type MaintainedFromOptions, type MaintenanceRebuildOptions, MaintenanceRebuilder, Manifest, MembershipPredicate, MembershipPredicateOp, Middleware, type ModelOptions, ModelStatic, OLD_VALUE_NAMESPACE, OperationDefinition, Param, ParamDescriptor, type Parameterize, PartialQueryKeyOf, type PerKeyCursorEnvelope, type PlanInput, PrimaryKeyOf, type ProjectionResult, ProjectionTransform, type ProjectionValue, PutInput, type QueryOptions$1 as QueryOptions, RawCondition, ReadExecOptions, ReadParams, ReadRequestCtx, ReadRequestKind, type RebuildResult, type RefsOptions, RelationMetadata, RelationOptions, type RelationTraversalOptions, RequestContext, ResolvedKey, RetryOverride, RetryPolicy, RetryingExecutor, SelectableOf, type SelfProxy, type SelfRef, type SourceProxy, type SourceRef, TableMapping, TransactWriteExecItem, TransactionItemSpec, TransactionSpec, UniqueQueryKeyOf, type UpdateExpressionResult, UpdateInput, type VersionedHistoryOptions, type VersionedLatestOptions, ViewDefinition, WriteDefinitionOptions, WriteExecOptions, WriteResult, aggregate, belongsTo, binary, boolean, buildConditionExpression, buildProjection, buildUpdateExpression, cdcProjected, compileFilterExpression, count, createMaintenanceRebuilder, datetime, decodeCursor, decodePerKeyCursor, defineCommands, defineDelete, defineList, definePut, defineQueries, defineQuery, defineUpdate, deriveEdgeWriteItems, deriveEdgeWriteItemsFor, deriveModelEdgeWriteItems, derivePrefix, detectRelationFields, edgeWrites, embedded, encodeCursor, encodePerKeyCursor, evaluateFilter, execute, executeDeclarativeTransaction, executeExplain, executeList, executeQuery, expandTransaction, field, getEdgeWrites, getImplicitKeyFields, hasMany, hasOne, hydrate, isEdgeWritesDefinition, isSelectBuilder, list, literal, maintainedFrom, map, max, model, number, numberSet, plan, refs, resolveKey, resolveRelations, serializeContractKey, serializeFieldValue, string, stringSet, ttl, validateDepth, validateGsiAmbiguity, whenMember };
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,9 @@ import {
|
|
|
7
7
|
EDGE_WRITES_MARKER,
|
|
8
8
|
MARKER_ROW_ENTITY,
|
|
9
9
|
OLD_VALUE_NAMESPACE,
|
|
10
|
+
PREPARE_CACHE_MAX,
|
|
11
|
+
PreparedReadStatement,
|
|
12
|
+
PreparedWriteStatement,
|
|
10
13
|
RELATION_TRAVERSAL_CONCURRENCY,
|
|
11
14
|
SPEC_VERSION,
|
|
12
15
|
assertBundleSerializable,
|
|
@@ -39,7 +42,6 @@ import {
|
|
|
39
42
|
deriveEdgeWriteItems,
|
|
40
43
|
deriveEdgeWriteItemsFor,
|
|
41
44
|
deriveModelEdgeWriteItems,
|
|
42
|
-
detectRelationFields,
|
|
43
45
|
edgeWrites,
|
|
44
46
|
encodeCursor,
|
|
45
47
|
evaluateFilter,
|
|
@@ -53,7 +55,6 @@ import {
|
|
|
53
55
|
executeQuery,
|
|
54
56
|
from,
|
|
55
57
|
getEdgeWrites,
|
|
56
|
-
getImplicitKeyFields,
|
|
57
58
|
isCommandModelContract,
|
|
58
59
|
isCommandPlan,
|
|
59
60
|
isContractComposeNode,
|
|
@@ -65,6 +66,7 @@ import {
|
|
|
65
66
|
isMutationFragment,
|
|
66
67
|
isMutationInputRef,
|
|
67
68
|
isPlannedCommandMethod,
|
|
69
|
+
isPreparedParamRef,
|
|
68
70
|
isQueryModelContract,
|
|
69
71
|
isTransactionRef,
|
|
70
72
|
mapWithConcurrency,
|
|
@@ -72,6 +74,7 @@ import {
|
|
|
72
74
|
mintContractParamRef,
|
|
73
75
|
mutation,
|
|
74
76
|
plan,
|
|
77
|
+
prepare,
|
|
75
78
|
publicCommandModel,
|
|
76
79
|
publicQueryModel,
|
|
77
80
|
query,
|
|
@@ -80,7 +83,7 @@ import {
|
|
|
80
83
|
validateDepth,
|
|
81
84
|
when,
|
|
82
85
|
wholeKeysSentinel
|
|
83
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-GFGVDF4W.js";
|
|
84
87
|
import {
|
|
85
88
|
CdcEmulator,
|
|
86
89
|
MAINT_OUTBOX_PK_PREFIX,
|
|
@@ -92,7 +95,7 @@ import {
|
|
|
92
95
|
orderAndTrimCollection,
|
|
93
96
|
pathField,
|
|
94
97
|
projectFrom
|
|
95
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-5NXNEW43.js";
|
|
96
99
|
import {
|
|
97
100
|
BATCH_GET_MAX_KEYS,
|
|
98
101
|
BATCH_WRITE_MAX_ITEMS,
|
|
@@ -119,6 +122,7 @@ import {
|
|
|
119
122
|
collectViewDefinitions,
|
|
120
123
|
commitTransaction,
|
|
121
124
|
cond,
|
|
125
|
+
detectRelationFields,
|
|
122
126
|
entityWrites,
|
|
123
127
|
execItemKeySignature,
|
|
124
128
|
executeDelete,
|
|
@@ -126,6 +130,7 @@ import {
|
|
|
126
130
|
executeTransaction,
|
|
127
131
|
executeUpdate,
|
|
128
132
|
getEntityWrites,
|
|
133
|
+
getImplicitKeyFields,
|
|
129
134
|
gsi,
|
|
130
135
|
hydrate,
|
|
131
136
|
identity,
|
|
@@ -145,7 +150,7 @@ import {
|
|
|
145
150
|
resolveConditionTree,
|
|
146
151
|
resolveModelClass,
|
|
147
152
|
serializeFieldValue
|
|
148
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-F2DI3GTI.js";
|
|
149
154
|
import {
|
|
150
155
|
Linter,
|
|
151
156
|
TableMapping,
|
|
@@ -512,6 +517,29 @@ function hasMany(targetFactory, keyBindingOrCallback, options) {
|
|
|
512
517
|
});
|
|
513
518
|
};
|
|
514
519
|
}
|
|
520
|
+
function refs(targetFactory, options) {
|
|
521
|
+
return function(_value, context) {
|
|
522
|
+
const propertyName = String(context.name);
|
|
523
|
+
assertRelationPropertyNameAllowed(propertyName);
|
|
524
|
+
if (!options || typeof options.from !== "string" || typeof options.key !== "string") {
|
|
525
|
+
throw new Error(
|
|
526
|
+
`@refs relation '${propertyName}': options must supply \`from\` (the parent list attribute, e.g. 'tagRefs') and \`key\` (the ref field on each element, e.g. 'tagId').`
|
|
527
|
+
);
|
|
528
|
+
}
|
|
529
|
+
const { from: from2, key: key2, to, ...relationOptions } = options;
|
|
530
|
+
const targetKeyField = to ?? key2;
|
|
531
|
+
collectRelation({
|
|
532
|
+
type: "refs",
|
|
533
|
+
propertyName,
|
|
534
|
+
targetFactory,
|
|
535
|
+
// Scalar keyBinding: target child key field ← element key name. Per resolved
|
|
536
|
+
// element the existing scalar key-building machinery reuses this unchanged.
|
|
537
|
+
keyBinding: { [targetKeyField]: key2 },
|
|
538
|
+
refs: { from: from2, key: key2 },
|
|
539
|
+
...Object.keys(relationOptions).length > 0 ? { options: relationOptions } : {}
|
|
540
|
+
});
|
|
541
|
+
};
|
|
542
|
+
}
|
|
515
543
|
function belongsTo(targetFactory, keyBinding, options) {
|
|
516
544
|
return function(_value, context) {
|
|
517
545
|
const propertyName = String(context.name);
|
|
@@ -1850,6 +1878,9 @@ export {
|
|
|
1850
1878
|
MaintenanceRebuilder,
|
|
1851
1879
|
MetadataRegistry,
|
|
1852
1880
|
OLD_VALUE_NAMESPACE,
|
|
1881
|
+
PREPARE_CACHE_MAX,
|
|
1882
|
+
PreparedReadStatement,
|
|
1883
|
+
PreparedWriteStatement,
|
|
1853
1884
|
RetryingExecutor,
|
|
1854
1885
|
SPEC_VERSION,
|
|
1855
1886
|
TableMapping,
|
|
@@ -1964,6 +1995,7 @@ export {
|
|
|
1964
1995
|
isMutationInputRef,
|
|
1965
1996
|
isParam,
|
|
1966
1997
|
isPlannedCommandMethod,
|
|
1998
|
+
isPreparedParamRef,
|
|
1967
1999
|
isQueryModelContract,
|
|
1968
2000
|
isRetryableError,
|
|
1969
2001
|
isRetryableTransactionCancellation,
|
|
@@ -1989,11 +2021,13 @@ export {
|
|
|
1989
2021
|
param,
|
|
1990
2022
|
parseChange,
|
|
1991
2023
|
plan,
|
|
2024
|
+
prepare,
|
|
1992
2025
|
preview,
|
|
1993
2026
|
publicCommandModel,
|
|
1994
2027
|
publicQueryModel,
|
|
1995
2028
|
query,
|
|
1996
2029
|
queryBoundaryRule,
|
|
2030
|
+
refs,
|
|
1997
2031
|
relationDepthRule,
|
|
1998
2032
|
requireLimitRule,
|
|
1999
2033
|
resolveKey,
|
package/dist/linter/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { L as LintRule } from '../registry-
|
|
2
|
-
export { a as LintResult, b as Linter } from '../registry-
|
|
3
|
-
export { c as createDefaultLinter, g as gsiAmbiguityRule, m as missingGsiRule, n as noScanRule, q as queryBoundaryRule, r as relationDepthRule, a as requireLimitRule } from '../relation-depth-
|
|
4
|
-
import '../maintenance-view-adapter-
|
|
1
|
+
import { L as LintRule } from '../registry-Cv9nl_3i.js';
|
|
2
|
+
export { a as LintResult, b as Linter } from '../registry-Cv9nl_3i.js';
|
|
3
|
+
export { c as createDefaultLinter, g as gsiAmbiguityRule, m as missingGsiRule, n as noScanRule, q as queryBoundaryRule, r as relationDepthRule, a as requireLimitRule } from '../relation-depth-BR0y7Q1i.js';
|
|
4
|
+
import '../maintenance-view-adapter-BP2CJDdz.js';
|
|
5
5
|
import '@aws-sdk/client-dynamodb';
|
|
6
6
|
|
|
7
7
|
/**
|