@prisma/orm-framework 8.0.0-rc.14-dev.36 → 8.0.0-rc.14-dev.37
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/components.d.mts +2 -2
- package/dist/components.mjs +2 -2
- package/dist/components__runtime.d.mts +2 -2
- package/dist/components__runtime.mjs +2 -2
- package/dist/{runtime-DhUFoLHx.mjs → runtime-7NCyLoeP.mjs} +109 -5
- package/dist/{runtime-DhUFoLHx.mjs.map → runtime-7NCyLoeP.mjs.map} +1 -1
- package/dist/{runtime-DynmbuWH.d.mts → runtime-NuBiQEuH.d.mts} +44 -2
- package/dist/runtime-NuBiQEuH.d.mts.map +1 -0
- package/package.json +15 -15
- package/dist/runtime-DynmbuWH.d.mts.map +0 -1
package/dist/components.d.mts
CHANGED
|
@@ -18,6 +18,6 @@ import { a as RuntimeDriverDescriptor, c as RuntimeExtensionInstance, d as Runti
|
|
|
18
18
|
import { t as isPlainRecord } from "./is-plain-record-C9BWiqcw.mjs";
|
|
19
19
|
import { S as promoteBuiltinKinds, _ as domainElementCoordinates, a as IRNode, b as freezeNode, c as NamespaceBase, d as Storage, f as StorageType, g as coordinateKey, h as buildSingleNamespaceView, i as EntityKindDescriptor, l as NamespacedEntities, m as buildNamespacedEntities, n as DefaultNamespaceEntries, o as IRNodeBase, p as UNBOUND_NAMESPACE_ID, r as EntityCoordinate, s as Namespace, t as AnyEntityKindDescriptor, u as SingleNamespaceView, v as elementCoordinates, x as hydrateNamespaceEntities, y as entityAt } from "./ir-bkQr_x1E.mjs";
|
|
20
20
|
import "./psl-ast-a1L1ep0a.mjs";
|
|
21
|
-
import { $ as
|
|
21
|
+
import { $ as reportQueryEnding, A as RuntimeCoreOptions, B as ShapeSpec, C as QueryPlan, D as ResultType, E as RelationNamesOf, F as RuntimeMiddlewareContext, G as checkAborted, H as applyMutationDefaults, I as RuntimeMutationDefaultGenerator, J as createMetaBuilder, K as checkMiddlewareCompatibility, L as RuntimeStatementStats, M as RuntimeExecutor, N as RuntimeLog, O as RuntimeAbortedPhase, P as RuntimeMiddleware, Q as reportExecuteEnding, R as Scalars, S as QueryInterceptResult, T as RelationKeys, U as assertAnnotationsApplicable, V as ValidAnnotations, W as assertMutationDefaultGeneratorsAvailable, X as onQueryEndOutsideTransaction, Y as defineAnnotation, Z as raceAgainstAbort, _ as MutationDefaultsOp, a as AnnotationValue, at as runtimeAborted, b as ParamRefMutator, c as CrossFamilyMiddleware, d as ExecutionPlan, et as runAfterTransaction, f as GeneratorStability, g as MutationDefaults, h as MutationDefaultGeneratorContributor, i as AnnotationHandle, it as runQueryWithMiddleware, j as RuntimeExecuteOptions, k as RuntimeCore, l as DefineAnnotationOptions, m as MetaBuilder, n as AfterQueryResult, nt as runBeforeQueryChain, o as AppliedMutationDefault, p as LaneMetaBuilder, q as collectMutationDefaultGenerators, r as AfterTransactionResult, rt as runExecuteWithMiddleware, s as AsyncIterableResult, t as AfterExecuteResult, tt as runBeforeExecuteChain, u as ExecuteInterceptResult, v as MutationDefaultsOptions, w as RUNTIME_ABORTED, x as QueryEnding, y as OperationKind, z as Shape } from "./runtime-NuBiQEuH.mjs";
|
|
22
22
|
import { t as canonicalizeJson } from "./utils-DeWL_zD9.mjs";
|
|
23
|
-
export { APP_SPACE_ID, type AdapterDescriptor, type AdapterInstance, type AdapterPackRef, type AfterExecuteResult, type AfterQueryResult, type AggregateCodecTraits, type AggregateDescriptor, type AggregateInputMatch, type AggregateOutputCodec, type AggregateOverloadAmbiguity, type AggregateOverloadDuplicate, type AggregateResultNullability, type AnnotationHandle, type AnnotationValue, type AnyCodecDescriptor, type AnyCodecDescriptorTemplate, type AnyEntityKindDescriptor, type AnyInputAggregateDescriptor, type AppliedMutationDefault, type AssembledAuthoringContributions, AsyncIterableResult, type AuthoringArgRef, type AuthoringArgumentDescriptor, type AuthoringAttributeSpecContributions, type AuthoringColumnDefaultTemplate, type AuthoringContributions, type AuthoringDiagnosticSink, type AuthoringEntityContext, type AuthoringEntityTypeDescriptor, type AuthoringEntityTypeFactoryOutput, type AuthoringEntityTypeNamespace, type AuthoringEntityTypeTemplateOutput, type AuthoringFieldNamespace, type AuthoringFieldPresetDescriptor, type AuthoringFieldPresetOutput, type AuthoringModelAttributeContext, type AuthoringModelAttributeDescriptor, type AuthoringModelAttributeDescriptorNamespace, type AuthoringModelAttributeEntityOutput, type AuthoringModelAttributeIndexOutput, type AuthoringModelAttributeLoweringOutput, type AuthoringOption, type AuthoringPslBlockDescriptor, type AuthoringPslBlockDescriptorNamespace, type AuthoringSelectRef, type AuthoringStorageTypeTemplate, type AuthoringTemplateValue, type AuthoringTypeConstructorCall, type AuthoringTypeConstructorDescriptor, type AuthoringTypeConstructorEntityRef, type AuthoringTypeConstructorOutput, type AuthoringTypeNamespace, type AuthoringWarning, type AuthoringWarningSink, BUILTIN_PSL_KIND_KEYS, type BigIntRange, CONTRACT_CODEC_DESCRIPTOR_MISSING, CONTRACT_SNAPSHOTS_DIRNAME, type CapabilityMatrix, type Cast, type Codec, type CodecCallContext, type CodecDescriptor, CodecDescriptorImpl, type CodecDescriptorTemplate, CodecDescriptorTemplateImpl, CodecImpl, type CodecInstanceContext, type CodecLookup, type CodecLookupWithDescriptors, type CodecRef, type CodecRegistry, type CodecTrait, type ColumnHelperFor, type ColumnHelperForStrict, type ColumnSpec, type ColumnTypeDescriptor, type ComponentDescriptor, type ComponentMetadata, type ContractComponentRequirementsCheckInput, type ContractComponentRequirementsCheckResult, type ContractSerializer, type ContractSpace, type ContractSpaceHeadRef, type ContributedPslDiagnosticCode, type ControlAdapterDescriptor, type ControlAdapterInstance, type ControlDefaultRegistries, type ControlDriverDescriptor, type ControlDriverInstance, type ControlExtensionDescriptor, type ControlExtensionInstance, type ControlFamilyDescriptor, type ControlFamilyInstance, type ControlMutationDefaultEntry, type ControlMutationDefaultRegistry, type ControlMutationDefaults, type ControlStack, type ControlTargetDescriptor, type ControlTargetInstance, type CoreSchemaView, type CreateControlStackInput, type CrossFamilyMiddleware, DATA_TYPE_ID_PATTERN, type DataType, type DataTypeAuthoringEntry, type DataTypeId, type DataTypeInvariantInput, type DataTypeLookup, type DataTypeSpec, type DataTypeWrittenForm, type DefaultFunctionLoweringContext, type DefaultNamespaceEntries, type DefineAnnotationOptions, type DiffSubjectGranularity, type DiffableNode, type DriverDescriptor, type DriverInstance, type DriverPackRef, type EmissionSpi, type EmitContractResult, type EntityCoordinate, type EntityKindDescriptor, type EnumBlockMember, type ExecuteInterceptResult, type ExecutionPlan, type ExecutionStack, type ExecutionStackInstance, type ExpectationFailureReason, type ExtensionDescriptor, type ExtensionInstance, type ExtensionPackRef, type FamilyDescriptor, type FamilyInstance, type FamilyPackRef, type GenerateContractTypesOptions, type GeneratorStability, INT32_RANGE, INT64_RANGE, type IRNode, IRNodeBase, type ImportRequirement, type ImportSpecifierResolver, type IntegerRange, type IntrospectSchemaResult, type LaneMetaBuilder, type ListCast, type LoweredDefaultResult, type LoweredDefaultValue, type MarkerHashes, type MetaBuilder, type MigratableTargetDescriptor, type MigrationMetadata, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPackage, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanWithAuthoringSurface, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerFailureResult, type MigrationPlannerResult, type MigrationPlannerSuccessResult, type MigrationRunner, type MigrationRunnerExecutionChecks, type MigrationRunnerFailure, type MigrationRunnerPerSpaceOptions, type MigrationRunnerPerSpaceSuccessValue, type MigrationRunnerResult, type MigrationRunnerSuccessValue, type MigrationScaffoldContext, type MutationDefaultGeneratorContributor, type MutationDefaultGeneratorDescriptor, type MutationDefaults, type MutationDefaultsOp, type MutationDefaultsOptions, type NamedAggregateOutput, type Namespace, NamespaceBase, type NamespacedEntities, type NoInputAggregateDescriptor, type OpFactoryCall, type OperationContext, type OperationKind, type OperationPreview, type OperationPreviewCapable, type OperationPreviewStatement, type PackRefBase, type ParamRefMutator, type ParsedPslExtensionBlock, type PresetStorageTemplate, PslAttribute, PslAttributeArgument, PslAttributeNamedArgument, PslAttributePositionalArgument, PslAttributeTarget, PslCompositeType, type PslContractBuildCapable, type PslContractDocument, type PslContractInferCapable, PslDefaultFunctionValue, PslDefaultLiteralValue, PslDefaultValue, PslDiagnostic, type PslDiagnosticCode, PslDocumentAst, type PslExtensionBlock, type PslExtensionBlockAttribute, type PslExtensionBlockAttributeArg, type PslExtensionBlockParsedAttribute, type PslExtensionBlockPrintEntry, PslField, PslFieldAttribute, PslIndexConstraint, PslModel, PslModelAttribute, PslNamedTypeDeclaration, PslNamespace, PslNamespaceEntry, type PslPosition, PslReferentialAction, type PslSourceSettings, type PslSpan, PslTypeConstructorCall, PslTypesBlock, PslUniqueConstraint, type QueryInterceptResult, type QueryPlan, RUNTIME_ABORTED, RelationKeys, type RelationNamesOf, type ResultType, type RuntimeAbortedPhase, type RuntimeAdapterDescriptor, type RuntimeAdapterInstance, RuntimeCore, type RuntimeCoreOptions, type RuntimeDriverDescriptor, type RuntimeDriverInstance, type RuntimeErrorEnvelope, type RuntimeExecuteOptions, type RuntimeExecutor, type RuntimeExtensionDescriptor, type RuntimeExtensionInstance, type RuntimeFamilyDescriptor, type RuntimeFamilyInstance, type RuntimeLog, type RuntimeMiddleware, type RuntimeMiddlewareContext, type RuntimeMutationDefaultGenerator, type RuntimeStatementStats, type RuntimeTargetDescriptor, type RuntimeTargetInstance, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, type ScalarTypeConstructorOutput, type Scalars, SchemaDiff, type SchemaDiffIssue, type SchemaEntityCoordinate, type SchemaNodeRef, type SchemaOwnership, type SchemaSubjectClassifierCapable, SchemaTreeNode, type SchemaTreeNodeOptions, type SchemaTreeVisitor, type SchemaVerifier, type SchemaVerifyOptions, type SchemaVerifyResult, type SchemaViewCapable, type SchemaViewNodeKind, type SelfAggregateOutput, type SettledAggregateOperation, type SettledAggregateOverloads, type Shape, type ShapeSpec, type SingleNamespaceView, type SourceDiagnostic, type SourceSpan, type SpaceMarkerConflict, type SpaceSignature, type SpaceSigned, type SpaceToSign, type Storage, type StorageType, TAGGED_LITERAL_MAX_BYTES, TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG, TIMESTAMP_NOW_GENERATOR_ID, type TaggedLiteralCanonicalization, type TargetBoundComponentDescriptor, type TargetDescriptor, type TargetInstance, type TargetMigrationsCapability, type TargetPackRef, type ToCanonicalForm, type TypedDefaultFunctionCall, type TypesImportSpec, UNBOUND_NAMESPACE_ID, UNBOUND_PSL_NAMESPACE_NAME, UNSPECIFIED_PSL_NAMESPACE_ID, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, type ValidAnnotations, type ValidationContext, type ValueInputAggregateDescriptor, type VerificationStatus, type VerifierIssueCategory, type VerifierOutcome, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult, aggregateDescriptorKey, applyMutationDefaults, assembleAuthoringContributions, assembleAuthoringDataTypes, assembleControlMutationDefaults, assembleDataTypes, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, assertRuntimeContractRequirementsSatisfied, assertUniqueCodecOwner, authoringEntryType, buildExtensionLoadOrder, buildNamespacedEntities, buildSingleNamespaceView, canonicalFormOf, canonicalizeJson, canonicalizeTaggedLiteralBody, checkAborted, checkContractComponentRequirements, checkMiddlewareCompatibility, classifyEnumMemberType, codecForRef, collectMutationDefaultGenerators, collectScalarTypeConstructors, column, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, coordinateKey, createControlStack, createDataTypeLookup, createExecutionStack, createMetaBuilder, dataType, dataTypeId, decodeJsonBoolean, decodeJsonFloat, decodeJsonInteger, decodeJsonIntegerText, decodeJsonMatching, decodeJsonString, defineAnnotation, describeTaggedLiteralFailure, diffSchemas, dispositionForCategory, domainElementCoordinates, elementCoordinates, emptyCodecLookup, encodeJsonFloat, enforceDataTypeInvariants, entityAt, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, fieldPresetSpellings, findAuthoringTypeConstructorCall, flatPslCompositeTypes, flatPslModels, flushAuthoringWarnings, freezeNode, getAuthoringFieldPreset, getAuthoringTypeConstructor, hasMigrations, hasOperationPreview, hasPslContractBuild, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, hydrateNamespaceEntities, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, instantiateExecutionStack, isAggregateDescriptor, isAnyInputAggregateDescriptor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, isIntegerIn, isNoInputAggregateDescriptor, isNonFiniteText, isPlainRecord, isRuntimeError, isTagEntryKey, issueOutcome, keepInternalSpecifiers, makePslNamespace, makePslNamespaceEntries, materializeCodec, mergeAuthoringNamespaces, mergeCapabilityMatrices, namespacePslExtensionBlocks, objectSchemaKeys, orderIssuesByDependencies, printTaggedLiteral, promoteBuiltinKinds, raceAgainstAbort, readEnumBlockMembers, refuseJsonValue, renderTsLiteral, requiredParamKeys, requiredSchemaKeys, resolveAuthoringTemplateValue, resolveCodecDescriptorOrThrow, resolveEnumCodecId, resolvePslBacktickEscapes, resolveRequirementSpecifiers, resolveTemplateTagEscapes, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError, sameMarkerHashes, settleAggregateOverloads, storageHashHex, tagEntryKey, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseTemplate, timestampNowControlDescriptor, validateAuthoringHelperArguments, validateAuthoringTypeParams, validateCodecTypeParams };
|
|
23
|
+
export { APP_SPACE_ID, type AdapterDescriptor, type AdapterInstance, type AdapterPackRef, type AfterExecuteResult, type AfterQueryResult, type AfterTransactionResult, type AggregateCodecTraits, type AggregateDescriptor, type AggregateInputMatch, type AggregateOutputCodec, type AggregateOverloadAmbiguity, type AggregateOverloadDuplicate, type AggregateResultNullability, type AnnotationHandle, type AnnotationValue, type AnyCodecDescriptor, type AnyCodecDescriptorTemplate, type AnyEntityKindDescriptor, type AnyInputAggregateDescriptor, type AppliedMutationDefault, type AssembledAuthoringContributions, AsyncIterableResult, type AuthoringArgRef, type AuthoringArgumentDescriptor, type AuthoringAttributeSpecContributions, type AuthoringColumnDefaultTemplate, type AuthoringContributions, type AuthoringDiagnosticSink, type AuthoringEntityContext, type AuthoringEntityTypeDescriptor, type AuthoringEntityTypeFactoryOutput, type AuthoringEntityTypeNamespace, type AuthoringEntityTypeTemplateOutput, type AuthoringFieldNamespace, type AuthoringFieldPresetDescriptor, type AuthoringFieldPresetOutput, type AuthoringModelAttributeContext, type AuthoringModelAttributeDescriptor, type AuthoringModelAttributeDescriptorNamespace, type AuthoringModelAttributeEntityOutput, type AuthoringModelAttributeIndexOutput, type AuthoringModelAttributeLoweringOutput, type AuthoringOption, type AuthoringPslBlockDescriptor, type AuthoringPslBlockDescriptorNamespace, type AuthoringSelectRef, type AuthoringStorageTypeTemplate, type AuthoringTemplateValue, type AuthoringTypeConstructorCall, type AuthoringTypeConstructorDescriptor, type AuthoringTypeConstructorEntityRef, type AuthoringTypeConstructorOutput, type AuthoringTypeNamespace, type AuthoringWarning, type AuthoringWarningSink, BUILTIN_PSL_KIND_KEYS, type BigIntRange, CONTRACT_CODEC_DESCRIPTOR_MISSING, CONTRACT_SNAPSHOTS_DIRNAME, type CapabilityMatrix, type Cast, type Codec, type CodecCallContext, type CodecDescriptor, CodecDescriptorImpl, type CodecDescriptorTemplate, CodecDescriptorTemplateImpl, CodecImpl, type CodecInstanceContext, type CodecLookup, type CodecLookupWithDescriptors, type CodecRef, type CodecRegistry, type CodecTrait, type ColumnHelperFor, type ColumnHelperForStrict, type ColumnSpec, type ColumnTypeDescriptor, type ComponentDescriptor, type ComponentMetadata, type ContractComponentRequirementsCheckInput, type ContractComponentRequirementsCheckResult, type ContractSerializer, type ContractSpace, type ContractSpaceHeadRef, type ContributedPslDiagnosticCode, type ControlAdapterDescriptor, type ControlAdapterInstance, type ControlDefaultRegistries, type ControlDriverDescriptor, type ControlDriverInstance, type ControlExtensionDescriptor, type ControlExtensionInstance, type ControlFamilyDescriptor, type ControlFamilyInstance, type ControlMutationDefaultEntry, type ControlMutationDefaultRegistry, type ControlMutationDefaults, type ControlStack, type ControlTargetDescriptor, type ControlTargetInstance, type CoreSchemaView, type CreateControlStackInput, type CrossFamilyMiddleware, DATA_TYPE_ID_PATTERN, type DataType, type DataTypeAuthoringEntry, type DataTypeId, type DataTypeInvariantInput, type DataTypeLookup, type DataTypeSpec, type DataTypeWrittenForm, type DefaultFunctionLoweringContext, type DefaultNamespaceEntries, type DefineAnnotationOptions, type DiffSubjectGranularity, type DiffableNode, type DriverDescriptor, type DriverInstance, type DriverPackRef, type EmissionSpi, type EmitContractResult, type EntityCoordinate, type EntityKindDescriptor, type EnumBlockMember, type ExecuteInterceptResult, type ExecutionPlan, type ExecutionStack, type ExecutionStackInstance, type ExpectationFailureReason, type ExtensionDescriptor, type ExtensionInstance, type ExtensionPackRef, type FamilyDescriptor, type FamilyInstance, type FamilyPackRef, type GenerateContractTypesOptions, type GeneratorStability, INT32_RANGE, INT64_RANGE, type IRNode, IRNodeBase, type ImportRequirement, type ImportSpecifierResolver, type IntegerRange, type IntrospectSchemaResult, type LaneMetaBuilder, type ListCast, type LoweredDefaultResult, type LoweredDefaultValue, type MarkerHashes, type MetaBuilder, type MigratableTargetDescriptor, type MigrationMetadata, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPackage, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanWithAuthoringSurface, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerFailureResult, type MigrationPlannerResult, type MigrationPlannerSuccessResult, type MigrationRunner, type MigrationRunnerExecutionChecks, type MigrationRunnerFailure, type MigrationRunnerPerSpaceOptions, type MigrationRunnerPerSpaceSuccessValue, type MigrationRunnerResult, type MigrationRunnerSuccessValue, type MigrationScaffoldContext, type MutationDefaultGeneratorContributor, type MutationDefaultGeneratorDescriptor, type MutationDefaults, type MutationDefaultsOp, type MutationDefaultsOptions, type NamedAggregateOutput, type Namespace, NamespaceBase, type NamespacedEntities, type NoInputAggregateDescriptor, type OpFactoryCall, type OperationContext, type OperationKind, type OperationPreview, type OperationPreviewCapable, type OperationPreviewStatement, type PackRefBase, type ParamRefMutator, type ParsedPslExtensionBlock, type PresetStorageTemplate, PslAttribute, PslAttributeArgument, PslAttributeNamedArgument, PslAttributePositionalArgument, PslAttributeTarget, PslCompositeType, type PslContractBuildCapable, type PslContractDocument, type PslContractInferCapable, PslDefaultFunctionValue, PslDefaultLiteralValue, PslDefaultValue, PslDiagnostic, type PslDiagnosticCode, PslDocumentAst, type PslExtensionBlock, type PslExtensionBlockAttribute, type PslExtensionBlockAttributeArg, type PslExtensionBlockParsedAttribute, type PslExtensionBlockPrintEntry, PslField, PslFieldAttribute, PslIndexConstraint, PslModel, PslModelAttribute, PslNamedTypeDeclaration, PslNamespace, PslNamespaceEntry, type PslPosition, PslReferentialAction, type PslSourceSettings, type PslSpan, PslTypeConstructorCall, PslTypesBlock, PslUniqueConstraint, type QueryEnding, type QueryInterceptResult, type QueryPlan, RUNTIME_ABORTED, RelationKeys, type RelationNamesOf, type ResultType, type RuntimeAbortedPhase, type RuntimeAdapterDescriptor, type RuntimeAdapterInstance, RuntimeCore, type RuntimeCoreOptions, type RuntimeDriverDescriptor, type RuntimeDriverInstance, type RuntimeErrorEnvelope, type RuntimeExecuteOptions, type RuntimeExecutor, type RuntimeExtensionDescriptor, type RuntimeExtensionInstance, type RuntimeFamilyDescriptor, type RuntimeFamilyInstance, type RuntimeLog, type RuntimeMiddleware, type RuntimeMiddlewareContext, type RuntimeMutationDefaultGenerator, type RuntimeStatementStats, type RuntimeTargetDescriptor, type RuntimeTargetInstance, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, type ScalarTypeConstructorOutput, type Scalars, SchemaDiff, type SchemaDiffIssue, type SchemaEntityCoordinate, type SchemaNodeRef, type SchemaOwnership, type SchemaSubjectClassifierCapable, SchemaTreeNode, type SchemaTreeNodeOptions, type SchemaTreeVisitor, type SchemaVerifier, type SchemaVerifyOptions, type SchemaVerifyResult, type SchemaViewCapable, type SchemaViewNodeKind, type SelfAggregateOutput, type SettledAggregateOperation, type SettledAggregateOverloads, type Shape, type ShapeSpec, type SingleNamespaceView, type SourceDiagnostic, type SourceSpan, type SpaceMarkerConflict, type SpaceSignature, type SpaceSigned, type SpaceToSign, type Storage, type StorageType, TAGGED_LITERAL_MAX_BYTES, TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG, TIMESTAMP_NOW_GENERATOR_ID, type TaggedLiteralCanonicalization, type TargetBoundComponentDescriptor, type TargetDescriptor, type TargetInstance, type TargetMigrationsCapability, type TargetPackRef, type ToCanonicalForm, type TypedDefaultFunctionCall, type TypesImportSpec, UNBOUND_NAMESPACE_ID, UNBOUND_PSL_NAMESPACE_NAME, UNSPECIFIED_PSL_NAMESPACE_ID, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, type ValidAnnotations, type ValidationContext, type ValueInputAggregateDescriptor, type VerificationStatus, type VerifierIssueCategory, type VerifierOutcome, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult, aggregateDescriptorKey, applyMutationDefaults, assembleAuthoringContributions, assembleAuthoringDataTypes, assembleControlMutationDefaults, assembleDataTypes, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, assertRuntimeContractRequirementsSatisfied, assertUniqueCodecOwner, authoringEntryType, buildExtensionLoadOrder, buildNamespacedEntities, buildSingleNamespaceView, canonicalFormOf, canonicalizeJson, canonicalizeTaggedLiteralBody, checkAborted, checkContractComponentRequirements, checkMiddlewareCompatibility, classifyEnumMemberType, codecForRef, collectMutationDefaultGenerators, collectScalarTypeConstructors, column, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, coordinateKey, createControlStack, createDataTypeLookup, createExecutionStack, createMetaBuilder, dataType, dataTypeId, decodeJsonBoolean, decodeJsonFloat, decodeJsonInteger, decodeJsonIntegerText, decodeJsonMatching, decodeJsonString, defineAnnotation, describeTaggedLiteralFailure, diffSchemas, dispositionForCategory, domainElementCoordinates, elementCoordinates, emptyCodecLookup, encodeJsonFloat, enforceDataTypeInvariants, entityAt, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, fieldPresetSpellings, findAuthoringTypeConstructorCall, flatPslCompositeTypes, flatPslModels, flushAuthoringWarnings, freezeNode, getAuthoringFieldPreset, getAuthoringTypeConstructor, hasMigrations, hasOperationPreview, hasPslContractBuild, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, hydrateNamespaceEntities, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, instantiateExecutionStack, isAggregateDescriptor, isAnyInputAggregateDescriptor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, isIntegerIn, isNoInputAggregateDescriptor, isNonFiniteText, isPlainRecord, isRuntimeError, isTagEntryKey, issueOutcome, keepInternalSpecifiers, makePslNamespace, makePslNamespaceEntries, materializeCodec, mergeAuthoringNamespaces, mergeCapabilityMatrices, namespacePslExtensionBlocks, objectSchemaKeys, onQueryEndOutsideTransaction, orderIssuesByDependencies, printTaggedLiteral, promoteBuiltinKinds, raceAgainstAbort, readEnumBlockMembers, refuseJsonValue, renderTsLiteral, reportExecuteEnding, reportQueryEnding, requiredParamKeys, requiredSchemaKeys, resolveAuthoringTemplateValue, resolveCodecDescriptorOrThrow, resolveEnumCodecId, resolvePslBacktickEscapes, resolveRequirementSpecifiers, resolveTemplateTagEscapes, runAfterTransaction, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError, sameMarkerHashes, settleAggregateOverloads, storageHashHex, tagEntryKey, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseTemplate, timestampNowControlDescriptor, validateAuthoringHelperArguments, validateAuthoringTypeParams, validateCodecTypeParams };
|
package/dist/components.mjs
CHANGED
|
@@ -14,5 +14,5 @@ import { n as resolveRequirementSpecifiers, t as keepInternalSpecifiers } from "
|
|
|
14
14
|
import { n as createExecutionStack, r as instantiateExecutionStack, t as assertRuntimeContractRequirementsSatisfied } from "./execution-BNwBzmRd.mjs";
|
|
15
15
|
import { a as buildSingleNamespaceView, c as elementCoordinates, d as hydrateNamespaceEntities, f as promoteBuiltinKinds, i as buildNamespacedEntities, l as entityAt, n as NamespaceBase, o as coordinateKey, r as UNBOUND_NAMESPACE_ID, s as domainElementCoordinates, t as IRNodeBase, u as freezeNode } from "./ir-CV5d1FJ0.mjs";
|
|
16
16
|
import { a as flatPslModels, c as namespacePslExtensionBlocks, i as flatPslCompositeTypes, n as UNBOUND_PSL_NAMESPACE_NAME, o as makePslNamespace, r as UNSPECIFIED_PSL_NAMESPACE_ID, s as makePslNamespaceEntries, t as BUILTIN_PSL_KIND_KEYS } from "./psl-ast-CyvE6CR-.mjs";
|
|
17
|
-
import { _ as
|
|
18
|
-
export { APP_SPACE_ID, AsyncIterableResult, BUILTIN_PSL_KIND_KEYS, CONTRACT_CODEC_DESCRIPTOR_MISSING, CONTRACT_SNAPSHOTS_DIRNAME, CodecDescriptorImpl, CodecDescriptorTemplateImpl, CodecImpl, DATA_TYPE_ID_PATTERN, INT32_RANGE, INT64_RANGE, IRNodeBase, NamespaceBase, RUNTIME_ABORTED, RelationKeys, RuntimeCore, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, SchemaDiff, SchemaTreeNode, TAGGED_LITERAL_MAX_BYTES, TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG, TIMESTAMP_NOW_GENERATOR_ID, UNBOUND_NAMESPACE_ID, UNBOUND_PSL_NAMESPACE_NAME, UNSPECIFIED_PSL_NAMESPACE_ID, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, aggregateDescriptorKey, applyMutationDefaults, assembleAuthoringContributions, assembleAuthoringDataTypes, assembleControlMutationDefaults, assembleDataTypes, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, assertRuntimeContractRequirementsSatisfied, assertUniqueCodecOwner, authoringEntryType, buildExtensionLoadOrder, buildNamespacedEntities, buildSingleNamespaceView, canonicalFormOf, canonicalizeJson, canonicalizeTaggedLiteralBody, checkAborted, checkContractComponentRequirements, checkMiddlewareCompatibility, classifyEnumMemberType, codecForRef, collectMutationDefaultGenerators, collectScalarTypeConstructors, column, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, coordinateKey, createControlStack, createDataTypeLookup, createExecutionStack, createMetaBuilder, dataType, dataTypeId, decodeJsonBoolean, decodeJsonFloat, decodeJsonInteger, decodeJsonIntegerText, decodeJsonMatching, decodeJsonString, defineAnnotation, describeTaggedLiteralFailure, diffSchemas, dispositionForCategory, domainElementCoordinates, elementCoordinates, emptyCodecLookup, encodeJsonFloat, enforceDataTypeInvariants, entityAt, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, fieldPresetSpellings, findAuthoringTypeConstructorCall, flatPslCompositeTypes, flatPslModels, flushAuthoringWarnings, freezeNode, getAuthoringFieldPreset, getAuthoringTypeConstructor, hasMigrations, hasOperationPreview, hasPslContractBuild, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, hydrateNamespaceEntities, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, instantiateExecutionStack, isAggregateDescriptor, isAnyInputAggregateDescriptor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, isIntegerIn, isNoInputAggregateDescriptor, isNonFiniteText, isPlainRecord, isRuntimeError, isTagEntryKey, issueOutcome, keepInternalSpecifiers, makePslNamespace, makePslNamespaceEntries, materializeCodec, mergeAuthoringNamespaces, mergeCapabilityMatrices, namespacePslExtensionBlocks, objectSchemaKeys, orderIssuesByDependencies, printTaggedLiteral, promoteBuiltinKinds, raceAgainstAbort, readEnumBlockMembers, refuseJsonValue, renderTsLiteral, requiredParamKeys, requiredSchemaKeys, resolveAuthoringTemplateValue, resolveCodecDescriptorOrThrow, resolveEnumCodecId, resolvePslBacktickEscapes, resolveRequirementSpecifiers, resolveTemplateTagEscapes, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError, sameMarkerHashes, settleAggregateOverloads, storageHashHex, tagEntryKey, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseTemplate, timestampNowControlDescriptor, validateAuthoringHelperArguments, validateAuthoringTypeParams, validateCodecTypeParams };
|
|
17
|
+
import { S as runtimeAborted, _ as runAfterTransaction, a as applyMutationDefaults, b as runExecuteWithMiddleware, c as checkAborted, d as createMetaBuilder, f as defineAnnotation, g as reportQueryEnding, h as reportExecuteEnding, i as RuntimeCore, l as checkMiddlewareCompatibility, m as raceAgainstAbort, n as RUNTIME_ABORTED, o as assertAnnotationsApplicable, p as onQueryEndOutsideTransaction, r as RelationKeys, s as assertMutationDefaultGeneratorsAvailable, t as AsyncIterableResult, u as collectMutationDefaultGenerators, v as runBeforeExecuteChain, x as runQueryWithMiddleware, y as runBeforeQueryChain } from "./runtime-7NCyLoeP.mjs";
|
|
18
|
+
export { APP_SPACE_ID, AsyncIterableResult, BUILTIN_PSL_KIND_KEYS, CONTRACT_CODEC_DESCRIPTOR_MISSING, CONTRACT_SNAPSHOTS_DIRNAME, CodecDescriptorImpl, CodecDescriptorTemplateImpl, CodecImpl, DATA_TYPE_ID_PATTERN, INT32_RANGE, INT64_RANGE, IRNodeBase, NamespaceBase, RUNTIME_ABORTED, RelationKeys, RuntimeCore, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, SchemaDiff, SchemaTreeNode, TAGGED_LITERAL_MAX_BYTES, TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG, TIMESTAMP_NOW_GENERATOR_ID, UNBOUND_NAMESPACE_ID, UNBOUND_PSL_NAMESPACE_NAME, UNSPECIFIED_PSL_NAMESPACE_ID, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, aggregateDescriptorKey, applyMutationDefaults, assembleAuthoringContributions, assembleAuthoringDataTypes, assembleControlMutationDefaults, assembleDataTypes, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, assertRuntimeContractRequirementsSatisfied, assertUniqueCodecOwner, authoringEntryType, buildExtensionLoadOrder, buildNamespacedEntities, buildSingleNamespaceView, canonicalFormOf, canonicalizeJson, canonicalizeTaggedLiteralBody, checkAborted, checkContractComponentRequirements, checkMiddlewareCompatibility, classifyEnumMemberType, codecForRef, collectMutationDefaultGenerators, collectScalarTypeConstructors, column, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, coordinateKey, createControlStack, createDataTypeLookup, createExecutionStack, createMetaBuilder, dataType, dataTypeId, decodeJsonBoolean, decodeJsonFloat, decodeJsonInteger, decodeJsonIntegerText, decodeJsonMatching, decodeJsonString, defineAnnotation, describeTaggedLiteralFailure, diffSchemas, dispositionForCategory, domainElementCoordinates, elementCoordinates, emptyCodecLookup, encodeJsonFloat, enforceDataTypeInvariants, entityAt, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, fieldPresetSpellings, findAuthoringTypeConstructorCall, flatPslCompositeTypes, flatPslModels, flushAuthoringWarnings, freezeNode, getAuthoringFieldPreset, getAuthoringTypeConstructor, hasMigrations, hasOperationPreview, hasPslContractBuild, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, hydrateNamespaceEntities, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, instantiateExecutionStack, isAggregateDescriptor, isAnyInputAggregateDescriptor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, isIntegerIn, isNoInputAggregateDescriptor, isNonFiniteText, isPlainRecord, isRuntimeError, isTagEntryKey, issueOutcome, keepInternalSpecifiers, makePslNamespace, makePslNamespaceEntries, materializeCodec, mergeAuthoringNamespaces, mergeCapabilityMatrices, namespacePslExtensionBlocks, objectSchemaKeys, onQueryEndOutsideTransaction, orderIssuesByDependencies, printTaggedLiteral, promoteBuiltinKinds, raceAgainstAbort, readEnumBlockMembers, refuseJsonValue, renderTsLiteral, reportExecuteEnding, reportQueryEnding, requiredParamKeys, requiredSchemaKeys, resolveAuthoringTemplateValue, resolveCodecDescriptorOrThrow, resolveEnumCodecId, resolvePslBacktickEscapes, resolveRequirementSpecifiers, resolveTemplateTagEscapes, runAfterTransaction, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError, sameMarkerHashes, settleAggregateOverloads, storageHashHex, tagEntryKey, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseTemplate, timestampNowControlDescriptor, validateAuthoringHelperArguments, validateAuthoringTypeParams, validateCodecTypeParams };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as isRuntimeError, r as runtimeError, t as RuntimeErrorEnvelope } from "./runtime-error-CO4MA3Px-YW5SCUcH.mjs";
|
|
2
|
-
import { $ as
|
|
3
|
-
export { type AfterExecuteResult, type AfterQueryResult, type AnnotationHandle, type AnnotationValue, type AppliedMutationDefault, AsyncIterableResult, type CrossFamilyMiddleware, type DefineAnnotationOptions, type ExecuteInterceptResult, type ExecutionPlan, type GeneratorStability, type LaneMetaBuilder, type MetaBuilder, type MutationDefaultGeneratorContributor, type MutationDefaults, type MutationDefaultsOp, type MutationDefaultsOptions, type OperationKind, type ParamRefMutator, type QueryInterceptResult, type QueryPlan, RUNTIME_ABORTED, RelationKeys, type RelationNamesOf, type ResultType, type RuntimeAbortedPhase, RuntimeCore, type RuntimeCoreOptions, type RuntimeErrorEnvelope, type RuntimeExecuteOptions, type RuntimeExecutor, type RuntimeLog, type RuntimeMiddleware, type RuntimeMiddlewareContext, type RuntimeMutationDefaultGenerator, type RuntimeStatementStats, type Scalars, type Shape, type ShapeSpec, type ValidAnnotations, applyMutationDefaults, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, createMetaBuilder, defineAnnotation, isRuntimeError, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError };
|
|
2
|
+
import { $ as reportQueryEnding, A as RuntimeCoreOptions, B as ShapeSpec, C as QueryPlan, D as ResultType, E as RelationNamesOf, F as RuntimeMiddlewareContext, G as checkAborted, H as applyMutationDefaults, I as RuntimeMutationDefaultGenerator, J as createMetaBuilder, K as checkMiddlewareCompatibility, L as RuntimeStatementStats, M as RuntimeExecutor, N as RuntimeLog, O as RuntimeAbortedPhase, P as RuntimeMiddleware, Q as reportExecuteEnding, R as Scalars, S as QueryInterceptResult, T as RelationKeys, U as assertAnnotationsApplicable, V as ValidAnnotations, W as assertMutationDefaultGeneratorsAvailable, X as onQueryEndOutsideTransaction, Y as defineAnnotation, Z as raceAgainstAbort, _ as MutationDefaultsOp, a as AnnotationValue, at as runtimeAborted, b as ParamRefMutator, c as CrossFamilyMiddleware, d as ExecutionPlan, et as runAfterTransaction, f as GeneratorStability, g as MutationDefaults, h as MutationDefaultGeneratorContributor, i as AnnotationHandle, it as runQueryWithMiddleware, j as RuntimeExecuteOptions, k as RuntimeCore, l as DefineAnnotationOptions, m as MetaBuilder, n as AfterQueryResult, nt as runBeforeQueryChain, o as AppliedMutationDefault, p as LaneMetaBuilder, q as collectMutationDefaultGenerators, r as AfterTransactionResult, rt as runExecuteWithMiddleware, s as AsyncIterableResult, t as AfterExecuteResult, tt as runBeforeExecuteChain, u as ExecuteInterceptResult, v as MutationDefaultsOptions, w as RUNTIME_ABORTED, x as QueryEnding, y as OperationKind, z as Shape } from "./runtime-NuBiQEuH.mjs";
|
|
3
|
+
export { type AfterExecuteResult, type AfterQueryResult, type AfterTransactionResult, type AnnotationHandle, type AnnotationValue, type AppliedMutationDefault, AsyncIterableResult, type CrossFamilyMiddleware, type DefineAnnotationOptions, type ExecuteInterceptResult, type ExecutionPlan, type GeneratorStability, type LaneMetaBuilder, type MetaBuilder, type MutationDefaultGeneratorContributor, type MutationDefaults, type MutationDefaultsOp, type MutationDefaultsOptions, type OperationKind, type ParamRefMutator, type QueryEnding, type QueryInterceptResult, type QueryPlan, RUNTIME_ABORTED, RelationKeys, type RelationNamesOf, type ResultType, type RuntimeAbortedPhase, RuntimeCore, type RuntimeCoreOptions, type RuntimeErrorEnvelope, type RuntimeExecuteOptions, type RuntimeExecutor, type RuntimeLog, type RuntimeMiddleware, type RuntimeMiddlewareContext, type RuntimeMutationDefaultGenerator, type RuntimeStatementStats, type Scalars, type Shape, type ShapeSpec, type ValidAnnotations, applyMutationDefaults, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, createMetaBuilder, defineAnnotation, isRuntimeError, onQueryEndOutsideTransaction, raceAgainstAbort, reportExecuteEnding, reportQueryEnding, runAfterTransaction, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as runtimeError, t as isRuntimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
|
|
2
|
-
import { _ as
|
|
3
|
-
export { AsyncIterableResult, RUNTIME_ABORTED, RelationKeys, RuntimeCore, applyMutationDefaults, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, createMetaBuilder, defineAnnotation, isRuntimeError, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError };
|
|
2
|
+
import { S as runtimeAborted, _ as runAfterTransaction, a as applyMutationDefaults, b as runExecuteWithMiddleware, c as checkAborted, d as createMetaBuilder, f as defineAnnotation, g as reportQueryEnding, h as reportExecuteEnding, i as RuntimeCore, l as checkMiddlewareCompatibility, m as raceAgainstAbort, n as RUNTIME_ABORTED, o as assertAnnotationsApplicable, p as onQueryEndOutsideTransaction, r as RelationKeys, s as assertMutationDefaultGeneratorsAvailable, t as AsyncIterableResult, u as collectMutationDefaultGenerators, v as runBeforeExecuteChain, x as runQueryWithMiddleware, y as runBeforeQueryChain } from "./runtime-7NCyLoeP.mjs";
|
|
3
|
+
export { AsyncIterableResult, RUNTIME_ABORTED, RelationKeys, RuntimeCore, applyMutationDefaults, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, createMetaBuilder, defineAnnotation, isRuntimeError, onQueryEndOutsideTransaction, raceAgainstAbort, reportExecuteEnding, reportQueryEnding, runAfterTransaction, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError };
|
|
@@ -621,6 +621,94 @@ async function runExecuteWithMiddleware(exec, middleware, ctx, runDriver) {
|
|
|
621
621
|
}, ctx);
|
|
622
622
|
return stats;
|
|
623
623
|
}
|
|
624
|
+
/**
|
|
625
|
+
* Calls each middleware's `afterTransaction` hook in registration order. A
|
|
626
|
+
* thrown error is passed to `ctx.log.error` and swallowed, and later
|
|
627
|
+
* middleware still run. Never rejects, so a query's result or a resolved
|
|
628
|
+
* commit is never replaced by a hook's failure.
|
|
629
|
+
*/
|
|
630
|
+
async function runAfterTransaction(exec, middleware, result, ctx) {
|
|
631
|
+
for (const mw of middleware) {
|
|
632
|
+
if (!mw.afterTransaction) continue;
|
|
633
|
+
try {
|
|
634
|
+
await mw.afterTransaction(exec, result, ctx);
|
|
635
|
+
} catch (error) {
|
|
636
|
+
try {
|
|
637
|
+
ctx.log.error({
|
|
638
|
+
event: "middleware.afterTransaction.error",
|
|
639
|
+
middleware: mw.name,
|
|
640
|
+
error
|
|
641
|
+
});
|
|
642
|
+
} catch {}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Returns what a query outside a transaction calls when it ends: it runs `runStage` with `committed` when the query completed and `unknown` otherwise. Returns `undefined` when `runStage` is `undefined`.
|
|
648
|
+
*/
|
|
649
|
+
function onQueryEndOutsideTransaction(runStage) {
|
|
650
|
+
if (runStage === void 0) return void 0;
|
|
651
|
+
return (ending) => runStage({ outcome: ending === "completed" ? "committed" : "unknown" });
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Streams `rows()` and then calls `onQueryEnd` exactly once with how the query ended: `completed` when the stream completes, `failed` when an error comes out of it, and `stopped` when the caller stops reading, calls `return()` or throws into the iterator, before or after the first row. Returns `rows()` itself when `onQueryEnd` is `undefined`.
|
|
655
|
+
*/
|
|
656
|
+
function reportQueryEnding(onQueryEnd, rows) {
|
|
657
|
+
return onQueryEnd === void 0 ? rows() : rowsThenQueryEnd(onQueryEnd, rows);
|
|
658
|
+
}
|
|
659
|
+
function rowsThenQueryEnd(onQueryEnd, rows) {
|
|
660
|
+
return { [Symbol.asyncIterator]() {
|
|
661
|
+
let thrownByCaller;
|
|
662
|
+
const generator = streamThenQueryEnd(onQueryEnd, rows, (error) => thrownByCaller !== void 0 && thrownByCaller.error === error);
|
|
663
|
+
let started = false;
|
|
664
|
+
const reportStoppedBeforeStart = async () => {
|
|
665
|
+
if (started) return;
|
|
666
|
+
started = true;
|
|
667
|
+
await onQueryEnd("stopped");
|
|
668
|
+
};
|
|
669
|
+
return {
|
|
670
|
+
next: () => {
|
|
671
|
+
started = true;
|
|
672
|
+
return generator.next();
|
|
673
|
+
},
|
|
674
|
+
return: async () => {
|
|
675
|
+
await reportStoppedBeforeStart();
|
|
676
|
+
return generator.return(void 0);
|
|
677
|
+
},
|
|
678
|
+
throw: async (error) => {
|
|
679
|
+
thrownByCaller = { error };
|
|
680
|
+
await reportStoppedBeforeStart();
|
|
681
|
+
return generator.throw(error);
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
} };
|
|
685
|
+
}
|
|
686
|
+
async function* streamThenQueryEnd(onQueryEnd, rows, isThrownByCaller) {
|
|
687
|
+
let ending = "stopped";
|
|
688
|
+
try {
|
|
689
|
+
yield* rows();
|
|
690
|
+
ending = "completed";
|
|
691
|
+
} catch (error) {
|
|
692
|
+
if (!isThrownByCaller(error)) ending = "failed";
|
|
693
|
+
throw error;
|
|
694
|
+
} finally {
|
|
695
|
+
await onQueryEnd(ending);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Runs `execute()` and then calls `onQueryEnd` exactly once: with `completed` when it resolves, and with `failed` when it rejects.
|
|
700
|
+
*/
|
|
701
|
+
async function reportExecuteEnding(onQueryEnd, execute) {
|
|
702
|
+
if (onQueryEnd === void 0) return execute();
|
|
703
|
+
let ending = "failed";
|
|
704
|
+
try {
|
|
705
|
+
const result = await execute();
|
|
706
|
+
ending = "completed";
|
|
707
|
+
return result;
|
|
708
|
+
} finally {
|
|
709
|
+
await onQueryEnd(ending);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
624
712
|
async function notifyQueryCompletion(middleware, exec, ctx, result, swallowErrors) {
|
|
625
713
|
for (const mw of middleware) {
|
|
626
714
|
if (!mw.afterQuery) continue;
|
|
@@ -646,6 +734,13 @@ async function notifyQueryCompletion(middleware, exec, ctx, result, swallowError
|
|
|
646
734
|
* 4. The matching runner processes `interceptQuery` or `interceptExecute`
|
|
647
735
|
* before invoking the driver. Queries then fire `onRow` and `afterQuery`;
|
|
648
736
|
* statements fire `afterExecute`.
|
|
737
|
+
* 5. Every operation whose lowering (which encodes parameters) and before-hooks
|
|
738
|
+
* succeeded fires `afterTransaction` once, as its last hook: `committed`
|
|
739
|
+
* when it completed, `unknown` when it threw or the caller stopped reading
|
|
740
|
+
* its rows. `reportQueryEnding` and `reportExecuteEnding` report how the
|
|
741
|
+
* operation ended, and `onQueryEndOutsideTransaction` turns that into the
|
|
742
|
+
* outcome; family runtimes that override `query` or `execute` call them
|
|
743
|
+
* too, with {@link afterTransactionStageFor}.
|
|
649
744
|
*
|
|
650
745
|
* Concrete subclasses must implement `lower`, `runDriver`, `runExecute`, and
|
|
651
746
|
* `close`.
|
|
@@ -661,9 +756,18 @@ async function notifyQueryCompletion(middleware, exec, ctx, result, swallowError
|
|
|
661
756
|
var RuntimeCore = class {
|
|
662
757
|
middleware;
|
|
663
758
|
ctx;
|
|
759
|
+
anyMiddlewareDeclaresAfterTransaction;
|
|
664
760
|
constructor(options) {
|
|
665
|
-
this.middleware = options.middleware;
|
|
761
|
+
this.middleware = [...options.middleware];
|
|
666
762
|
this.ctx = options.ctx;
|
|
763
|
+
this.anyMiddlewareDeclaresAfterTransaction = this.middleware.some((mw) => mw.afterTransaction !== void 0);
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Returns the function that runs every middleware's `afterTransaction` hook for one operation with a given result, or `undefined` when no middleware declared the hook when the runtime was created.
|
|
767
|
+
*/
|
|
768
|
+
afterTransactionStageFor(exec, ctx) {
|
|
769
|
+
if (!this.anyMiddlewareDeclaresAfterTransaction) return void 0;
|
|
770
|
+
return (result) => runAfterTransaction(exec, this.middleware, result, ctx);
|
|
667
771
|
}
|
|
668
772
|
/**
|
|
669
773
|
* Pre-lowering hook for plan rewriting. Defaults to identity. Subclasses
|
|
@@ -688,7 +792,7 @@ var RuntimeCore = class {
|
|
|
688
792
|
const compiled = await self.runBeforeCompile(plan);
|
|
689
793
|
const exec = await self.lower(compiled, codecCtx);
|
|
690
794
|
await runBeforeQueryChain(exec, self.middleware, execCtx);
|
|
691
|
-
yield* runQueryWithMiddleware(exec, self.middleware, execCtx, () => self.runDriver(exec));
|
|
795
|
+
yield* reportQueryEnding(onQueryEndOutsideTransaction(self.afterTransactionStageFor(exec, execCtx)), () => runQueryWithMiddleware(exec, self.middleware, execCtx, () => blindCast(self.runDriver(exec))));
|
|
692
796
|
}
|
|
693
797
|
return new AsyncIterableResult(generator());
|
|
694
798
|
}
|
|
@@ -705,7 +809,7 @@ var RuntimeCore = class {
|
|
|
705
809
|
const compiled = await this.runBeforeCompile(plan);
|
|
706
810
|
const exec = await this.lower(compiled, codecCtx);
|
|
707
811
|
await runBeforeExecuteChain(exec, this.middleware, execCtx);
|
|
708
|
-
return runExecuteWithMiddleware(exec, this.middleware, execCtx, () => this.runExecute(exec));
|
|
812
|
+
return reportExecuteEnding(onQueryEndOutsideTransaction(this.afterTransactionStageFor(exec, execCtx)), () => runExecuteWithMiddleware(exec, this.middleware, execCtx, () => this.runExecute(exec)));
|
|
709
813
|
}
|
|
710
814
|
};
|
|
711
815
|
function checkMiddlewareCompatibility(middleware, runtimeFamilyId, runtimeTargetId) {
|
|
@@ -760,6 +864,6 @@ function createMetaBuilder(kind, terminalName) {
|
|
|
760
864
|
return new MetaBuilderImpl(kind, terminalName);
|
|
761
865
|
}
|
|
762
866
|
//#endregion
|
|
763
|
-
export {
|
|
867
|
+
export { runtimeAborted as S, runAfterTransaction as _, applyMutationDefaults as a, runExecuteWithMiddleware as b, checkAborted as c, createMetaBuilder as d, defineAnnotation as f, reportQueryEnding as g, reportExecuteEnding as h, RuntimeCore as i, checkMiddlewareCompatibility as l, raceAgainstAbort as m, RUNTIME_ABORTED as n, assertAnnotationsApplicable as o, onQueryEndOutsideTransaction as p, RelationKeys as r, assertMutationDefaultGeneratorsAvailable as s, AsyncIterableResult as t, collectMutationDefaultGenerators as u, runBeforeExecuteChain as v, runQueryWithMiddleware as x, runBeforeQueryChain as y };
|
|
764
868
|
|
|
765
|
-
//# sourceMappingURL=runtime-
|
|
869
|
+
//# sourceMappingURL=runtime-7NCyLoeP.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-DhUFoLHx.mjs","names":["#kind","#terminalName","#annotations"],"sources":["../../../../1-framework/1-core/framework-components/dist/runtime.mjs"],"sourcesContent":["import { n as runtimeError, t as isRuntimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/execution/runtime-error.ts\n/**\n* Stable code emitted by the runtime when an in-flight `execute()`\n* is cancelled via the per-query `AbortSignal`. The envelope's\n* `details.phase` distinguishes where the abort was observed:\n*\n* - `'encode'` — abort fired during `encodeParams` (SQL) or\n* `resolveValue` (Mongo).\n* - `'decode'` — abort fired during `decodeRow` / `decodeField`.\n* - `'stream'` — abort fired between rows or before any codec call\n* (already-aborted at entry).\n* - `'beforeQuery'` / `'beforeExecute'` / `'afterQuery'` /\n* `'afterExecute'` / `'onRow'` — abort fired on entry to or during\n* the corresponding middleware phase\n* (cooperative cancellation per the param-transform seam).\n*/\nconst RUNTIME_ABORTED = \"RUNTIME.ABORTED\";\n/**\n* Construct a `RUNTIME.ABORTED` envelope. Phase distinguishes where the\n* abort was observed — codec call sites (`encode` / `decode` / `stream`)\n* or operation-specific middleware seams, as\n* enumerated on {@link RuntimeAbortedPhase}. Cause carries\n* `signal.reason` verbatim from the platform — native abort produces a\n* `DOMException`, explicit `controller.abort(reason)` produces whatever\n* the caller passed. No synthesis happens here.\n*/\nfunction runtimeAborted(phase, cause) {\n\tconst envelope = runtimeError(RUNTIME_ABORTED, `Operation aborted during ${phase}`, { phase });\n\treturn Object.assign(envelope, { cause });\n}\n//#endregion\n//#region src/annotations.ts\n/**\n* Defines a typed annotation handle.\n*\n* Two-step call form. The first step takes the `Payload` type argument\n* (TypeScript cannot infer `Payload` from anything in the options, so it\n* must be supplied explicitly); the second step takes the runtime options\n* and infers `Kinds` from the `applicableTo` array via a `const` type\n* parameter, so the operation kinds appear exactly once at the call site.\n*\n* @example\n* ```typescript\n* // Read-only annotation. Lane terminals like `db.User.first(...)` accept\n* // it; `db.User.create(...)` rejects it at the type level.\n* const cacheAnnotation = defineAnnotation<{ ttl?: number; skip?: boolean }>()({\n* namespace: 'cache',\n* applicableTo: ['read'],\n* }); // Kinds inferred as 'read'\n*\n* // Write-only annotation. Mirror image.\n* const auditAnnotation = defineAnnotation<{ actor: string }>()({\n* namespace: 'audit',\n* applicableTo: ['write'],\n* }); // Kinds inferred as 'write'\n*\n* // Annotation applicable to both kinds (e.g. tracing).\n* const otelAnnotation = defineAnnotation<{ traceId: string }>()({\n* namespace: 'otel',\n* applicableTo: ['read', 'write'],\n* }); // Kinds inferred as 'read' | 'write'\n* ```\n*\n* **Reserved namespaces.** See `DefineAnnotationOptions.namespace` for the\n* list of framework-internal namespaces (`codecs`, target-specific keys).\n* `defineAnnotation` does not structurally prevent a user from naming a\n* reserved namespace, but the framework makes no compatibility guarantee\n* about handles that do.\n*/\nfunction defineAnnotation() {\n\treturn (options) => {\n\t\tconst namespace = options.namespace;\n\t\tconst applicableTo = Object.freeze(new Set(options.applicableTo));\n\t\tfunction handle(value) {\n\t\t\treturn Object.freeze({\n\t\t\t\t__annotation: true,\n\t\t\t\tnamespace,\n\t\t\t\tvalue,\n\t\t\t\tapplicableTo\n\t\t\t});\n\t\t}\n\t\tfunction read(plan) {\n\t\t\tconst stored = plan.meta.annotations?.[namespace];\n\t\t\tif (!isAnnotationValue(stored)) return;\n\t\t\tif (stored.namespace !== namespace) return;\n\t\t\treturn stored.value;\n\t\t}\n\t\treturn Object.freeze(Object.assign(handle, {\n\t\t\tnamespace,\n\t\t\tapplicableTo,\n\t\t\tread\n\t\t}));\n\t};\n}\n/**\n* Runtime applicability gate. Throws `RUNTIME.ANNOTATION_INAPPLICABLE` if\n* any annotation in `annotations` declares an `applicableTo` set that does\n* not include `kind`. Used by lane terminals (SQL DSL builders' `.build()`,\n* ORM `Collection` terminals) to fail closed when the type-level\n* `ValidAnnotations` gate is bypassed via cast / `any` / dynamic\n* invocation.\n*\n* Passes silently on:\n* - empty arrays\n* - annotations whose `applicableTo` includes `kind`\n*\n* Throws on:\n* - any annotation whose `applicableTo` does not include `kind`. The\n* error names the offending annotation's `namespace` and the\n* `terminalName` so users can locate the misuse.\n*\n* @example\n* ```typescript\n* // Inside an ORM read terminal:\n* assertAnnotationsApplicable(annotations, 'read', 'first');\n* ```\n*/\nfunction assertAnnotationsApplicable(annotations, kind, terminalName) {\n\tfor (const annotation of annotations) if (!annotation.applicableTo.has(kind)) throw runtimeError(\"RUNTIME.ANNOTATION_INAPPLICABLE\", `Annotation '${annotation.namespace}' is not applicable to '${kind}' operations (terminal: '${terminalName}'). The annotation declares applicableTo = [${Array.from(annotation.applicableTo).map((k) => `'${k}'`).join(\", \")}].`, {\n\t\tnamespace: annotation.namespace,\n\t\tterminalName,\n\t\tkind,\n\t\tapplicableTo: Array.from(annotation.applicableTo)\n\t});\n}\n/**\n* Type guard for branded annotation values stored in `plan.meta.annotations`.\n*\n* Internal — used by `AnnotationHandle.read` to distinguish user\n* annotations (created by calling a handle returned from\n* `defineAnnotation(...)`) from framework-internal metadata that may\n* happen to live under the same namespace key.\n*/\nfunction isAnnotationValue(value) {\n\tif (value === null || typeof value !== \"object\") return false;\n\treturn value.__annotation === true;\n}\n//#endregion\n//#region src/execution/async-iterable-result.ts\nvar AsyncIterableResult = class {\n\tgenerator;\n\tconsumed = false;\n\tconsumedBy;\n\tbufferedArrayPromise;\n\tconstructor(generator) {\n\t\tthis.generator = generator;\n\t}\n\t[Symbol.asyncIterator]() {\n\t\tif (this.consumed) throw runtimeError(\"RUNTIME.ITERATOR_CONSUMED\", `AsyncIterableResult iterator has already been consumed via ${this.consumedBy === \"bufferedArray\" ? \"toArray()/then()\" : \"for-await loop\"}. Each AsyncIterableResult can only be iterated once.`, {\n\t\t\tconsumedBy: this.consumedBy,\n\t\t\tsuggestion: this.consumedBy === \"bufferedArray\" ? \"If you need to iterate multiple times, store the results from toArray() in a variable and reuse that.\" : \"If you need to iterate multiple times, use toArray() to collect all results first.\"\n\t\t});\n\t\tthis.consumed = true;\n\t\tthis.consumedBy = \"iterator\";\n\t\treturn this.generator;\n\t}\n\ttoArray() {\n\t\tif (this.consumedBy === \"iterator\") return Promise.reject(runtimeError(\"RUNTIME.ITERATOR_CONSUMED\", \"AsyncIterableResult iterator has already been consumed via for-await loop. Each AsyncIterableResult can only be iterated once.\", {\n\t\t\tconsumedBy: this.consumedBy,\n\t\t\tsuggestion: \"The iterator was already consumed by a for-await loop. Use toArray() or await the result before iterating.\"\n\t\t}));\n\t\tif (this.bufferedArrayPromise) return this.bufferedArrayPromise;\n\t\tthis.consumed = true;\n\t\tthis.consumedBy = \"bufferedArray\";\n\t\tthis.bufferedArrayPromise = (async () => {\n\t\t\tconst out = [];\n\t\t\tfor await (const item of this.generator) out.push(item);\n\t\t\treturn out;\n\t\t})();\n\t\treturn this.bufferedArrayPromise;\n\t}\n\tasync first() {\n\t\treturn (await this.toArray())[0] ?? null;\n\t}\n\tasync firstOrThrow() {\n\t\tconst row = await this.first();\n\t\tif (row === null) throw runtimeError(\"RUNTIME.NO_ROWS\", \"Expected at least one row, but none were returned\", {});\n\t\treturn row;\n\t}\n\tthen(onfulfilled, onrejected) {\n\t\treturn this.toArray().then(onfulfilled, onrejected);\n\t}\n};\n//#endregion\n//#region src/execution/race-against-abort.ts\n/**\n* Throw a phase-tagged `RUNTIME.ABORTED` envelope if the supplied\n* context is already aborted at the precheck site. Centralises the\n* `if (ctx.signal?.aborted) throw runtimeAborted(...)` pattern that\n* every codec dispatch site (and the `beforeExecute` middleware phase)\n* repeats. Accepts both the framework `CodecCallContext` and the\n* `RuntimeMiddlewareContext`; both expose `signal?: AbortSignal`.\n*/\nfunction checkAborted(ctx, phase) {\n\tif (ctx.signal?.aborted) throw runtimeAborted(phase, ctx.signal.reason);\n}\n/**\n* Race a per-cell `Promise.all` (or any other in-flight work promise) against\n* the supplied abort signal so the runtime returns `RUNTIME.ABORTED` promptly\n* even when codec bodies ignore the signal. In-flight bodies that ignore the\n* signal are abandoned and run to completion in the background — the\n* cooperative-cancellation contract documented in ADR 204.\n*\n* Call sites still SHOULD pre-check `signal.aborted` and short-circuit with\n* a phase-tagged `RUNTIME.ABORTED` envelope before invoking this helper —\n* that path is the canonical \"aborted at entry\" surface and avoids\n* scheduling the work promise. As a defensive belt-and-braces, this helper\n* also handles the already-aborted case internally: `AbortSignal` does not\n* replay past abort events to listeners registered after the abort, so we\n* inspect `signal.aborted` synchronously and reject with the sentinel\n* before installing the listener. The rejection is still attributed to the\n* abort path via the sentinel-identity check.\n*\n* Distinguishing the rejection source is load-bearing for AC-ERR4\n* (`RUNTIME.ENCODE_FAILED` / `RUNTIME.DECODE_FAILED` pass through unchanged).\n* The semantically equivalent `abortable(signal)` helper in\n* `@internal/utils` rejects with `signal.reason ?? new DOMException(...)`,\n* which is not stably distinguishable from a codec-thrown error by identity\n* alone (a fresh fallback DOMException is allocated per call). We instead\n* track abort attribution with a unique sentinel: only the `onAbort` listener\n* installed here ever rejects with the sentinel, so an `error === sentinel`\n* identity check after the race is unambiguous.\n*\n* Lives in `framework-components` (rather than the SQL family, where it\n* originated in m2) so every family runtime that needs cooperative\n* cancellation around a codec-dispatch `Promise.all` (SQL encode + decode\n* today, Mongo encode in m3) shares the same attribution logic.\n*/\nasync function raceAgainstAbort(work, signal, phase) {\n\tif (signal === void 0) return await work;\n\tconst sentinel = { reason: void 0 };\n\tlet onAbort;\n\tconst abortPromise = new Promise((_, reject) => {\n\t\tif (signal.aborted) {\n\t\t\tsentinel.reason = signal.reason;\n\t\t\treject(sentinel);\n\t\t\treturn;\n\t\t}\n\t\tonAbort = () => {\n\t\t\tsentinel.reason = signal.reason;\n\t\t\treject(sentinel);\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\ttry {\n\t\treturn await Promise.race([work, abortPromise]);\n\t} catch (error) {\n\t\tif (error === sentinel) throw runtimeAborted(phase, sentinel.reason);\n\t\tthrow error;\n\t} finally {\n\t\tif (onAbort) signal.removeEventListener(\"abort\", onAbort);\n\t}\n}\n//#endregion\n//#region src/execution/before-execute-chain.ts\n/**\n* Runs every middleware's `beforeQuery` hook in registration order,\n* threading through the (optional) family-specific `paramsMutator`.\n*\n* Why this lives outside {@link runQueryWithMiddleware}: middleware that\n* mutates parameter values (e.g. cipherstash's bulk-encrypt SDK\n* round-trip) must run *before* the family runtime encodes those\n* parameters to driver wire format. Family runtimes call\n* `runBeforeQueryChain` between the AST → plan lowering step and\n* the parameter encode step; the encode then observes the mutator's\n* `currentParams()` view. `runQueryWithMiddleware` retains the rest of\n* the query lifecycle (`interceptQuery`, driver/row source loop, `onRow`,\n* `afterQuery`) but no longer fires `beforeQuery` itself.\n*\n* Lifecycle within this helper:\n*\n* 1. For each middleware in registration order, if `beforeQuery`\n* is implemented:\n* - `checkAborted(ctx, 'beforeQuery')` short-circuits if the\n* caller already aborted at entry.\n* - The hook is invoked with `(plan, ctx, paramsMutator)`. A\n* middleware body that ignores the mutator stays compatible —\n* JavaScript allows extra positional arguments.\n* - If the hook returns a Promise, it is raced against\n* `ctx.signal` via {@link raceAgainstAbort} so cooperative\n* cancellation surfaces a `RUNTIME.ABORTED { phase:\n* 'beforeQuery' }` envelope even when the body itself\n* ignores the signal.\n*\n* Error propagation: any error thrown by a `beforeQuery` body\n* (or surfaced by the abort race) propagates out of this helper\n* unchanged. Family runtime entry points await this helper before invoking\n* `runQueryWithMiddleware`, so a rejection prevents the runner and its\n* `afterQuery` hook from running.\n*\n* Relationship to {@link runQueryWithMiddleware}: the framework's\n* `RuntimeCore.query` template calls this helper between\n* `lower(plan)` and `runQueryWithMiddleware(...)`. Family runtimes that\n* override query preparation (e.g. SQL, which inlines lower + encode for\n* direct mutator threading) call this helper themselves at the\n* equivalent point — between the family's AST → draft-plan\n* lowering and the parameter-encode step.\n*\n* Intercept ordering: this helper fires unconditionally before\n* `runQueryWithMiddleware`. `interceptQuery` (inside\n* `runQueryWithMiddleware`) therefore observes the post-`beforeQuery`\n* plan — mutator mutations are visible in the params interceptors see.\n* The trade-off is documented on `RuntimeMiddleware.interceptQuery`.\n*/\nfunction runBeforeQueryChain(plan, middleware, ctx, paramsMutator) {\n\treturn runBeforeChain(plan, middleware, ctx, paramsMutator, \"beforeQuery\", (mw) => mw.beforeQuery);\n}\n/**\n* Runs every middleware's `beforeExecute` hook in registration order,\n* threading through the (optional) family-specific `paramsMutator`.\n*\n* Why this lives outside {@link runExecuteWithMiddleware}: middleware that\n* mutates parameter values (e.g. cipherstash's bulk-encrypt SDK\n* round-trip) must run *before* the family runtime encodes those\n* parameters to driver wire format. Family runtimes call\n* `runBeforeExecuteChain` between the AST → plan lowering step and\n* the parameter encode step; the encode then observes the mutator's\n* `currentParams()` view. `runExecuteWithMiddleware` retains the rest of\n* the execute lifecycle (`interceptExecute`, driver statistics execution,\n* `afterExecute`) but no longer fires `beforeExecute` itself.\n*\n* Lifecycle within this helper:\n*\n* 1. For each middleware in registration order, if `beforeExecute`\n* is implemented:\n* - `checkAborted(ctx, 'beforeExecute')` short-circuits if the\n* caller already aborted at entry.\n* - The hook is invoked with `(plan, ctx, paramsMutator)`. A\n* middleware body that ignores the mutator stays compatible —\n* JavaScript allows extra positional arguments.\n* - If the hook returns a Promise, it is raced against\n* `ctx.signal` via {@link raceAgainstAbort} so cooperative\n* cancellation surfaces a `RUNTIME.ABORTED { phase:\n* 'beforeExecute' }` envelope even when the body itself\n* ignores the signal.\n*\n* Error propagation: any error thrown by a `beforeExecute` body\n* (or surfaced by the abort race) propagates out of this helper\n* unchanged. Family runtime entry points await this helper before invoking\n* `runExecuteWithMiddleware`, so a rejection prevents the runner and its\n* `afterExecute` hook from running.\n*\n* Relationship to {@link runExecuteWithMiddleware}: the framework's\n* `RuntimeCore.execute` template calls this helper between\n* `lower(plan)` and `runExecuteWithMiddleware(...)`. Family runtimes that\n* override execute (e.g. SQL, which inlines lower + encode for\n* direct mutator threading) call this helper themselves at the\n* equivalent point — between the family's AST → draft-plan\n* lowering and the parameter-encode step.\n*\n* Intercept ordering: this helper fires unconditionally before\n* `runExecuteWithMiddleware`. `interceptExecute` (inside\n* `runExecuteWithMiddleware`) therefore observes the post-`beforeExecute`\n* plan — mutator mutations are visible in the params interceptors see.\n* The trade-off is documented on `RuntimeMiddleware.interceptExecute`.\n*/\nfunction runBeforeExecuteChain(plan, middleware, ctx, paramsMutator) {\n\treturn runBeforeChain(plan, middleware, ctx, paramsMutator, \"beforeExecute\", (mw) => mw.beforeExecute);\n}\nasync function runBeforeChain(plan, middleware, ctx, paramsMutator, phase, selectHook) {\n\tfor (const mw of middleware) {\n\t\tconst hook = selectHook(mw);\n\t\tif (hook === void 0) continue;\n\t\tcheckAborted(ctx, phase);\n\t\tconst work = hook(plan, ctx, paramsMutator);\n\t\tif (work !== void 0) await raceAgainstAbort(Promise.resolve(work), ctx.signal, phase);\n\t}\n}\n//#endregion\n//#region src/execution/mutation-defaults.ts\n/** Registers every generator the contributors provide, by id. Two contributors providing one id is an error naming both. */\nfunction collectMutationDefaultGenerators(contributors) {\n\tconst generators = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const contributor of contributors) {\n\t\tconst nextGenerators = contributor.mutationDefaultGenerators?.() ?? [];\n\t\tfor (const generator of nextGenerators) {\n\t\t\tconst existingOwner = owners.get(generator.id);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"RUNTIME.DUPLICATE_MUTATION_DEFAULT_GENERATOR\", `Duplicate mutation default generator '${generator.id}'.`, {\n\t\t\t\tid: generator.id,\n\t\t\t\texistingOwner,\n\t\t\t\tincomingOwner: contributor.id\n\t\t\t});\n\t\t\tgenerators.set(generator.id, generator);\n\t\t\towners.set(generator.id, contributor.id);\n\t\t}\n\t}\n\treturn generators;\n}\n/** Fails when the contract's mutation defaults name a generator the registry does not hold, listing every missing id and the fields that need it. */\nfunction assertMutationDefaultGeneratorsAvailable(execution, generatorRegistry) {\n\tconst defaults = execution?.mutations.defaults ?? [];\n\tif (defaults.length === 0) return;\n\tconst fieldsById = /* @__PURE__ */ new Map();\n\tfor (const mutationDefault of defaults) {\n\t\tconst phaseIds = new Set([mutationDefault.onCreate, mutationDefault.onUpdate].flatMap((phase) => phase?.kind === \"generator\" && !generatorRegistry.has(phase.id) ? [phase.id] : []));\n\t\tfor (const id of phaseIds) {\n\t\t\tconst fields = fieldsById.get(id) ?? [];\n\t\t\tfields.push(`${mutationDefault.ref.entry}.${mutationDefault.ref.field}`);\n\t\t\tfieldsById.set(id, fields);\n\t\t}\n\t}\n\tif (fieldsById.size === 0) return;\n\tconst ids = [...fieldsById.keys()];\n\tconst needs = [...fieldsById].map(([id, fields]) => `'${id}' for ${listInProse(fields)}`);\n\tthrow runtimeError(\"RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING\", `${ids.length === 1 ? `Contract requires mutation default generator ${needs[0]}, but no runtime component in the execution stack provides it.` : `Contract requires mutation default generators ${listInProse(needs)}, but no runtime component in the execution stack provides them.`} ${WHERE_GENERATORS_COME_FROM}`, {\n\t\tids,\n\t\tfields: [...fieldsById.values()].flat()\n\t});\n}\nconst WHERE_GENERATORS_COME_FROM = \"Built-in generators such as 'timestampNow' come from the database adapter's runtime descriptor, and others from the extension pack that defines them; include that component in the execution stack.\";\nfunction listInProse(items) {\n\treturn items.length > 1 ? `${items.slice(0, -1).join(\", \")} and ${items.at(-1)}` : items.join(\"\");\n}\nfunction computeExecutionDefaultValue(spec, generatorRegistry) {\n\tconst generator = generatorRegistry.get(spec.id);\n\tif (!generator) throw runtimeError(\"RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING\", `Contract references mutation default generator '${spec.id}' but no runtime component in the execution stack provides it. ${WHERE_GENERATORS_COME_FROM}`, { id: spec.id });\n\treturn generator.generate(spec.params);\n}\n/**\n* The defaults to write for one record: for each mutation default of the entry and namespace whose phase matches `op`, the generated value of every field the values do not carry. An update with no keys gets none.\n*/\nfunction applyMutationDefaults(execution, generatorRegistry, options) {\n\tconst defaults = execution?.mutations.defaults ?? [];\n\tif (defaults.length === 0) return [];\n\tconst isEmptyUpdate = options.op === \"update\" && Object.keys(options.values).length === 0;\n\tconst applied = [];\n\tconst appliedFields = /* @__PURE__ */ new Set();\n\tconst rowCache = /* @__PURE__ */ new Map();\n\tfor (const mutationDefault of defaults) {\n\t\tif (mutationDefault.ref.entry !== options.entry) continue;\n\t\tif (mutationDefault.ref.namespace !== options.namespace) continue;\n\t\tconst defaultSpec = options.op === \"create\" ? mutationDefault.onCreate : mutationDefault.onUpdate;\n\t\tif (!defaultSpec) continue;\n\t\tif (isEmptyUpdate) continue;\n\t\tconst fieldName = mutationDefault.ref.field;\n\t\tif (Object.hasOwn(options.values, fieldName) || appliedFields.has(fieldName)) continue;\n\t\tapplied.push({\n\t\t\tfield: fieldName,\n\t\t\tvalue: resolveScopedValue(defaultSpec, generatorRegistry, rowCache, options.defaultValueCache)\n\t\t});\n\t\tappliedFields.add(fieldName);\n\t}\n\treturn applied;\n}\nfunction resolveScopedValue(spec, generatorRegistry, rowCache, queryCache) {\n\tconst cache = scopedCache(generatorRegistry.get(spec.id)?.stability, rowCache, queryCache);\n\tif (!cache) return computeExecutionDefaultValue(spec, generatorRegistry);\n\tif (cache.has(spec.id)) return cache.get(spec.id);\n\tconst value = computeExecutionDefaultValue(spec, generatorRegistry);\n\tcache.set(spec.id, value);\n\treturn value;\n}\nfunction scopedCache(stability, rowCache, queryCache) {\n\tswitch (stability) {\n\t\tcase \"row\": return rowCache;\n\t\tcase \"query\": return queryCache;\n\t\tdefault: return;\n\t}\n}\n//#endregion\n//#region src/execution/run-with-middleware.ts\n/**\n* Drives a single query execution of `runDriver()` through the middleware\n* lifecycle's `interceptQuery` + row-source + termination phases.\n*\n* Lifecycle, in order:\n* 1. For each middleware in registration order: `interceptQuery(exec, ctx)`.\n* The first non-`undefined` result wins; subsequent middleware's\n* `interceptQuery` does not fire. On a hit, the runtime emits a\n* `middleware.interceptQuery` debug event naming the winning middleware,\n* switches the row source to the intercepted rows, and proceeds with\n* `source: 'middleware'`. On all-passthrough (every `interceptQuery`\n* returns `undefined` or is omitted), `source: 'driver'` is used and the\n* row source is `runDriver()`.\n* 2. Iterate the row source. On the driver path, for each row, for each\n* middleware in registration order: `onRow(row, exec, ctx)`; then yield\n* the row. On the intercepted hit path, `onRow` is skipped — intercepted\n* rows did not originate from a driver row stream — but rows are still\n* yielded to the consumer in order.\n* 3. On successful completion: for each middleware in registration order:\n* `afterQuery(exec, { rowCount, latencyMs, completed: true, source },\n* ctx)`.\n* 4. On any error thrown during steps 1–2: for each middleware in\n* registration order: `afterQuery(exec, { rowCount, latencyMs,\n* completed: false, source }, ctx)`. Errors thrown by `afterQuery`\n* during the error path are swallowed so they do not mask the original\n* error. The original error is then rethrown.\n*\n* `beforeQuery` is **not** fired here — see\n* {@link runBeforeQueryChain} in `before-execute-chain.ts`. Family runtimes\n* call that helper between the AST → plan lowering step and the parameter\n* encode step so middleware that mutates ParamRef values can have its\n* mutations visible to encode. `runQueryWithMiddleware` operates on the\n* fully-encoded plan; interceptors therefore observe a fully-mutated,\n* encoded plan.\n*\n* The `source` field on `AfterQueryResult` lets observers (telemetry, lints,\n* budgets) distinguish driver-served from middleware-served executions\n* without needing their own out-of-band signal.\n*\n* This helper is the single canonical implementation of the\n* intercept-and-row-source loop; family runtimes should not reimplement it.\n*/\nfunction runQueryWithMiddleware(exec, middleware, ctx, runDriver) {\n\tconst iterator = async function* () {\n\t\tconst startedAt = Date.now();\n\t\tlet rowCount = 0;\n\t\tlet completed = false;\n\t\tlet source = \"driver\";\n\t\tlet rowSource;\n\t\ttry {\n\t\t\tfor (const mw of middleware) {\n\t\t\t\tif (!mw.interceptQuery) continue;\n\t\t\t\tsource = \"middleware\";\n\t\t\t\tconst result = await mw.interceptQuery(exec, ctx);\n\t\t\t\tif (result === void 0) {\n\t\t\t\t\tsource = \"driver\";\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tctx.log.debug?.({\n\t\t\t\t\tevent: \"middleware.interceptQuery\",\n\t\t\t\t\tmiddleware: mw.name\n\t\t\t\t});\n\t\t\t\trowSource = blindCast(result.rows);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (source === \"driver\") rowSource = runDriver();\n\t\t\tfor await (const row of rowSource) {\n\t\t\t\tif (source === \"driver\") {\n\t\t\t\t\tfor (const mw of middleware) if (mw.onRow) await mw.onRow(row, exec, ctx);\n\t\t\t\t}\n\t\t\t\trowCount++;\n\t\t\t\tyield row;\n\t\t\t}\n\t\t\tcompleted = true;\n\t\t} catch (error) {\n\t\t\tawait notifyQueryCompletion(middleware, exec, ctx, {\n\t\t\t\trowCount,\n\t\t\t\tlatencyMs: Date.now() - startedAt,\n\t\t\t\tcompleted,\n\t\t\t\tsource\n\t\t\t}, true);\n\t\t\tthrow error;\n\t\t}\n\t\tawait notifyQueryCompletion(middleware, exec, ctx, {\n\t\t\trowCount,\n\t\t\tlatencyMs: Date.now() - startedAt,\n\t\t\tcompleted,\n\t\t\tsource\n\t\t}, false);\n\t};\n\treturn new AsyncIterableResult(iterator());\n}\n/**\n* Drives a single execute operation through the middleware\n* `interceptExecute` + statistics + termination phases.\n*\n* Lifecycle, in order:\n* 1. For each middleware in registration order: `interceptExecute(exec, ctx)`.\n* The first non-`undefined` result wins; subsequent middleware's\n* `interceptExecute` does not fire. On a hit, the runtime emits a\n* `middleware.interceptExecute` debug event naming the winning middleware,\n* uses the returned `stats`, and proceeds with `source: 'middleware'`.\n* On all-passthrough (every `interceptExecute` returns `undefined` or is\n* omitted), `source: 'driver'` is used and `runDriver()` supplies the\n* statistics.\n* 2. Execute operations return eager statistics. There is no row stream and\n* `onRow` does not fire.\n* 3. On successful completion: for each middleware in registration order:\n* `afterExecute(exec, { stats, latencyMs, completed: true, source }, ctx)`.\n* 4. On any error thrown during steps 1–2: for each middleware in\n* registration order: `afterExecute(exec, { latencyMs, completed: false,\n* source }, ctx)`. Errors thrown by `afterExecute` during the error path\n* are swallowed so they do not mask the original error. The original\n* error is then rethrown.\n*\n* `beforeExecute` is **not** fired here — see\n* {@link runBeforeExecuteChain} in `before-execute-chain.ts`. Family runtimes\n* call that helper between the AST → plan lowering step and the parameter\n* encode step so middleware that mutates ParamRef values can have its\n* mutations visible to encode. `runExecuteWithMiddleware` operates on the\n* fully-encoded plan; interceptors therefore observe a fully-mutated,\n* encoded plan.\n*\n* The `source` field on `AfterExecuteResult` lets observers (telemetry, lints,\n* budgets) distinguish driver-served from middleware-served executions\n* without needing their own out-of-band signal.\n*/\nasync function runExecuteWithMiddleware(exec, middleware, ctx, runDriver) {\n\tconst startedAt = Date.now();\n\tlet source = \"driver\";\n\tlet stats;\n\ttry {\n\t\tfor (const mw of middleware) {\n\t\t\tif (!mw.interceptExecute) continue;\n\t\t\tsource = \"middleware\";\n\t\t\tconst result = await mw.interceptExecute(exec, ctx);\n\t\t\tif (result === void 0) {\n\t\t\t\tsource = \"driver\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tctx.log.debug?.({\n\t\t\t\tevent: \"middleware.interceptExecute\",\n\t\t\t\tmiddleware: mw.name\n\t\t\t});\n\t\t\tstats = result.stats;\n\t\t\tbreak;\n\t\t}\n\t\tif (stats === void 0) stats = await runDriver();\n\t} catch (error) {\n\t\tconst latencyMs = Date.now() - startedAt;\n\t\tfor (const mw of middleware) {\n\t\t\tif (!mw.afterExecute) continue;\n\t\t\ttry {\n\t\t\t\tawait mw.afterExecute(exec, {\n\t\t\t\t\tlatencyMs,\n\t\t\t\t\tcompleted: false,\n\t\t\t\t\tsource\n\t\t\t\t}, ctx);\n\t\t\t} catch {}\n\t\t}\n\t\tthrow error;\n\t}\n\tconst latencyMs = Date.now() - startedAt;\n\tfor (const mw of middleware) if (mw.afterExecute) await mw.afterExecute(exec, {\n\t\tstats,\n\t\tlatencyMs,\n\t\tcompleted: true,\n\t\tsource\n\t}, ctx);\n\treturn stats;\n}\nasync function notifyQueryCompletion(middleware, exec, ctx, result, swallowErrors) {\n\tfor (const mw of middleware) {\n\t\tif (!mw.afterQuery) continue;\n\t\tif (swallowErrors) try {\n\t\t\tawait mw.afterQuery(exec, result, ctx);\n\t\t} catch {}\n\t\telse await mw.afterQuery(exec, result, ctx);\n\t}\n}\n//#endregion\n//#region src/execution/runtime-core.ts\n/**\n* Family-agnostic abstract runtime base.\n*\n* Defines the shared operation-specific middleware lifecycles:\n*\n* 1. `runBeforeCompile(plan)` — concrete; defaults to identity. SQL overrides\n* this to run its shared `beforeCompile` middleware-hook chain.\n* 2. `lower(plan)` — abstract. Each family produces its `*ExecutionPlan`\n* (SQL via `lowerSqlPlan`, Mongo via `adapter.lower`).\n* 3. Queries run `beforeQuery`; statements run `beforeExecute`. Both chains\n* run after lowering and before their matching driver terminal. Family\n* runtimes that expose a params mutator to downstream encoding override\n* the operation and call the matching helper at the pre-encode point.\n* 4. The matching runner processes `interceptQuery` or `interceptExecute`\n* before invoking the driver. Queries then fire `onRow` and `afterQuery`;\n* statements fire `afterExecute`.\n*\n* Concrete subclasses must implement `lower`, `runDriver`, `runExecute`, and\n* `close`.\n*\n* The class is generic over:\n* - `TPlan` — the family's pre-lowering plan type.\n* - `TExec` — the family's post-lowering (executable) plan type.\n* - `TMiddleware` — the family's middleware type. Constrained to\n* `RuntimeMiddleware<TExec>` because the operation-specific runners invoke\n* hooks with the lowered `TExec`. Middleware therefore sees the\n* post-lowering plan.\n*/\nvar RuntimeCore = class {\n\tmiddleware;\n\tctx;\n\tconstructor(options) {\n\t\tthis.middleware = options.middleware;\n\t\tthis.ctx = options.ctx;\n\t}\n\t/**\n\t* Pre-lowering hook for plan rewriting. Defaults to identity. Subclasses\n\t* may override to run a `beforeCompile` middleware chain (SQL does this\n\t* to support typed AST rewrites — see `before-compile-chain.ts`).\n\t*/\n\trunBeforeCompile(plan) {\n\t\treturn plan;\n\t}\n\tquery(plan, options) {\n\t\tconst self = this;\n\t\tconst signal = options?.signal;\n\t\tconst codecCtx = signal === void 0 ? {} : { signal };\n\t\tconst execCtx = {\n\t\t\t...self.ctx,\n\t\t\t...codecCtx,\n\t\t\tscope: options?.scope ?? self.ctx.scope,\n\t\t\tplanExecutionId: crypto.randomUUID()\n\t\t};\n\t\tasync function* generator() {\n\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\tconst compiled = await self.runBeforeCompile(plan);\n\t\t\tconst exec = await self.lower(compiled, codecCtx);\n\t\t\tawait runBeforeQueryChain(exec, self.middleware, execCtx);\n\t\t\tyield* runQueryWithMiddleware(exec, self.middleware, execCtx, () => self.runDriver(exec));\n\t\t}\n\t\treturn new AsyncIterableResult(generator());\n\t}\n\tasync execute(plan, options) {\n\t\tconst signal = options?.signal;\n\t\tconst codecCtx = signal === void 0 ? {} : { signal };\n\t\tconst execCtx = {\n\t\t\t...this.ctx,\n\t\t\t...codecCtx,\n\t\t\tscope: options?.scope ?? this.ctx.scope,\n\t\t\tplanExecutionId: crypto.randomUUID()\n\t\t};\n\t\tcheckAborted(codecCtx, \"stream\");\n\t\tconst compiled = await this.runBeforeCompile(plan);\n\t\tconst exec = await this.lower(compiled, codecCtx);\n\t\tawait runBeforeExecuteChain(exec, this.middleware, execCtx);\n\t\treturn runExecuteWithMiddleware(exec, this.middleware, execCtx, () => this.runExecute(exec));\n\t}\n};\n//#endregion\n//#region src/execution/runtime-middleware.ts\nfunction checkMiddlewareCompatibility(middleware, runtimeFamilyId, runtimeTargetId) {\n\tif (middleware.targetId !== void 0 && middleware.familyId === void 0) throw runtimeError(\"RUNTIME.MIDDLEWARE_INCOMPATIBLE\", `Middleware '${middleware.name}' specifies targetId '${middleware.targetId}' without familyId`, {\n\t\tmiddleware: middleware.name,\n\t\ttargetId: middleware.targetId\n\t});\n\tif (middleware.familyId !== void 0 && middleware.familyId !== runtimeFamilyId) throw runtimeError(\"RUNTIME.MIDDLEWARE_FAMILY_MISMATCH\", `Middleware '${middleware.name}' requires family '${middleware.familyId}' but the runtime is configured for family '${runtimeFamilyId}'`, {\n\t\tmiddleware: middleware.name,\n\t\tmiddlewareFamilyId: middleware.familyId,\n\t\truntimeFamilyId\n\t});\n\tif (middleware.targetId !== void 0 && middleware.targetId !== runtimeTargetId) throw runtimeError(\"RUNTIME.MIDDLEWARE_TARGET_MISMATCH\", `Middleware '${middleware.name}' requires target '${middleware.targetId}' but the runtime is configured for target '${runtimeTargetId}'`, {\n\t\tmiddleware: middleware.name,\n\t\tmiddlewareTargetId: middleware.targetId,\n\t\truntimeTargetId\n\t});\n}\n//#endregion\n//#region src/execution/shape.ts\n/**\n* Phantom key an emitted model type carries to name its relation properties.\n* Never present at runtime; `Scalars` and `Shape` read it to tell relations from fields.\n*/\nconst RelationKeys = Symbol(\"RelationKeys\");\n//#endregion\n//#region src/meta-builder.ts\nvar MetaBuilderImpl = class {\n\t#kind;\n\t#terminalName;\n\t#annotations = /* @__PURE__ */ new Map();\n\tconstructor(kind, terminalName) {\n\t\tthis.#kind = kind;\n\t\tthis.#terminalName = terminalName;\n\t}\n\tget annotations() {\n\t\treturn this.#annotations;\n\t}\n\tannotate(annotation) {\n\t\tconst value = annotation;\n\t\tassertAnnotationsApplicable([value], this.#kind, this.#terminalName);\n\t\tthis.#annotations.set(value.namespace, value);\n\t\treturn this;\n\t}\n};\n/**\n* Construct a lane-side meta builder for a terminal of operation kind `K`.\n*\n* Lane terminals call this with their `kind` (`'read'` or `'write'`) and a\n* `terminalName` for error messages, hand the resulting builder to the\n* user-supplied configurator callback (typed as `MetaBuilder<K>`, the\n* narrower public view), and read `meta.annotations` afterwards to thread\n* the recorded values into `plan.meta.annotations`.\n*/\nfunction createMetaBuilder(kind, terminalName) {\n\treturn new MetaBuilderImpl(kind, terminalName);\n}\n//#endregion\nexport { AsyncIterableResult, RUNTIME_ABORTED, RelationKeys, RuntimeCore, applyMutationDefaults, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, createMetaBuilder, defineAnnotation, isRuntimeError, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,kBAAkB;;;;;;;;;;AAUxB,SAAS,eAAe,OAAO,OAAO;CACrC,MAAM,WAAW,aAAa,iBAAiB,4BAA4B,SAAS,EAAE,MAAM,CAAC;CAC7F,OAAO,OAAO,OAAO,UAAU,EAAE,MAAM,CAAC;AACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,mBAAmB;CAC3B,QAAQ,YAAY;EACnB,MAAM,YAAY,QAAQ;EAC1B,MAAM,eAAe,OAAO,OAAO,IAAI,IAAI,QAAQ,YAAY,CAAC;EAChE,SAAS,OAAO,OAAO;GACtB,OAAO,OAAO,OAAO;IACpB,cAAc;IACd;IACA;IACA;GACD,CAAC;EACF;EACA,SAAS,KAAK,MAAM;GACnB,MAAM,SAAS,KAAK,KAAK,cAAc;GACvC,IAAI,CAAC,kBAAkB,MAAM,GAAG;GAChC,IAAI,OAAO,cAAc,WAAW;GACpC,OAAO,OAAO;EACf;EACA,OAAO,OAAO,OAAO,OAAO,OAAO,QAAQ;GAC1C;GACA;GACA;EACD,CAAC,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AAa,KAAK,KAAK,WAAW,aAAa,iBAAiB,MAAM,aAAa,sCAAsC,eAAe,WAAW,KAAK,qBAAqB,WAAW,SAAS,8CAA8C,gBAAgB,IAAI;EACjR,YAAY,WAAW;EACvB,oBAAoB,WAAW;EAC/B;CACD,CAAC;AACF;;;;;AAOA,MAAM,eAAe,OAAO,cAAc;AAG1C,IAAI,kBAAkB,MAAM;CAC3B;CACA;CACA,+BAA+B,IAAI,IAAI;CACvC,YAAY,MAAM,cAAc;EAC/B,KAAKA,QAAQ;EACb,KAAKC,gBAAgB;CACtB;CACA,IAAI,cAAc;EACjB,OAAO,KAAKC;CACb;CACA,SAAS,YAAY;EACpB,MAAM,QAAQ;EACd,4BAA4B,CAAC,KAAK,GAAG,KAAKF,OAAO,KAAKC,aAAa;EACnE,KAAKC,aAAa,IAAI,MAAM,WAAW,KAAK;EAC5C,OAAO;CACR;AACD;;;;;;;;;;AAUA,SAAS,kBAAkB,MAAM,cAAc;CAC9C,OAAO,IAAI,gBAAgB,MAAM,YAAY;AAC9C"}
|
|
1
|
+
{"version":3,"file":"runtime-7NCyLoeP.mjs","names":["#kind","#terminalName","#annotations"],"sources":["../../../../1-framework/1-core/framework-components/dist/runtime.mjs"],"sourcesContent":["import { n as runtimeError, t as isRuntimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/execution/runtime-error.ts\n/**\n* Stable code emitted by the runtime when an in-flight `execute()`\n* is cancelled via the per-query `AbortSignal`. The envelope's\n* `details.phase` distinguishes where the abort was observed:\n*\n* - `'encode'` — abort fired during `encodeParams` (SQL) or\n* `resolveValue` (Mongo).\n* - `'decode'` — abort fired during `decodeRow` / `decodeField`.\n* - `'stream'` — abort fired between rows or before any codec call\n* (already-aborted at entry).\n* - `'beforeQuery'` / `'beforeExecute'` / `'afterQuery'` /\n* `'afterExecute'` / `'onRow'` — abort fired on entry to or during\n* the corresponding middleware phase\n* (cooperative cancellation per the param-transform seam).\n*/\nconst RUNTIME_ABORTED = \"RUNTIME.ABORTED\";\n/**\n* Construct a `RUNTIME.ABORTED` envelope. Phase distinguishes where the\n* abort was observed — codec call sites (`encode` / `decode` / `stream`)\n* or operation-specific middleware seams, as\n* enumerated on {@link RuntimeAbortedPhase}. Cause carries\n* `signal.reason` verbatim from the platform — native abort produces a\n* `DOMException`, explicit `controller.abort(reason)` produces whatever\n* the caller passed. No synthesis happens here.\n*/\nfunction runtimeAborted(phase, cause) {\n\tconst envelope = runtimeError(RUNTIME_ABORTED, `Operation aborted during ${phase}`, { phase });\n\treturn Object.assign(envelope, { cause });\n}\n//#endregion\n//#region src/annotations.ts\n/**\n* Defines a typed annotation handle.\n*\n* Two-step call form. The first step takes the `Payload` type argument\n* (TypeScript cannot infer `Payload` from anything in the options, so it\n* must be supplied explicitly); the second step takes the runtime options\n* and infers `Kinds` from the `applicableTo` array via a `const` type\n* parameter, so the operation kinds appear exactly once at the call site.\n*\n* @example\n* ```typescript\n* // Read-only annotation. Lane terminals like `db.User.first(...)` accept\n* // it; `db.User.create(...)` rejects it at the type level.\n* const cacheAnnotation = defineAnnotation<{ ttl?: number; skip?: boolean }>()({\n* namespace: 'cache',\n* applicableTo: ['read'],\n* }); // Kinds inferred as 'read'\n*\n* // Write-only annotation. Mirror image.\n* const auditAnnotation = defineAnnotation<{ actor: string }>()({\n* namespace: 'audit',\n* applicableTo: ['write'],\n* }); // Kinds inferred as 'write'\n*\n* // Annotation applicable to both kinds (e.g. tracing).\n* const otelAnnotation = defineAnnotation<{ traceId: string }>()({\n* namespace: 'otel',\n* applicableTo: ['read', 'write'],\n* }); // Kinds inferred as 'read' | 'write'\n* ```\n*\n* **Reserved namespaces.** See `DefineAnnotationOptions.namespace` for the\n* list of framework-internal namespaces (`codecs`, target-specific keys).\n* `defineAnnotation` does not structurally prevent a user from naming a\n* reserved namespace, but the framework makes no compatibility guarantee\n* about handles that do.\n*/\nfunction defineAnnotation() {\n\treturn (options) => {\n\t\tconst namespace = options.namespace;\n\t\tconst applicableTo = Object.freeze(new Set(options.applicableTo));\n\t\tfunction handle(value) {\n\t\t\treturn Object.freeze({\n\t\t\t\t__annotation: true,\n\t\t\t\tnamespace,\n\t\t\t\tvalue,\n\t\t\t\tapplicableTo\n\t\t\t});\n\t\t}\n\t\tfunction read(plan) {\n\t\t\tconst stored = plan.meta.annotations?.[namespace];\n\t\t\tif (!isAnnotationValue(stored)) return;\n\t\t\tif (stored.namespace !== namespace) return;\n\t\t\treturn stored.value;\n\t\t}\n\t\treturn Object.freeze(Object.assign(handle, {\n\t\t\tnamespace,\n\t\t\tapplicableTo,\n\t\t\tread\n\t\t}));\n\t};\n}\n/**\n* Runtime applicability gate. Throws `RUNTIME.ANNOTATION_INAPPLICABLE` if\n* any annotation in `annotations` declares an `applicableTo` set that does\n* not include `kind`. Used by lane terminals (SQL DSL builders' `.build()`,\n* ORM `Collection` terminals) to fail closed when the type-level\n* `ValidAnnotations` gate is bypassed via cast / `any` / dynamic\n* invocation.\n*\n* Passes silently on:\n* - empty arrays\n* - annotations whose `applicableTo` includes `kind`\n*\n* Throws on:\n* - any annotation whose `applicableTo` does not include `kind`. The\n* error names the offending annotation's `namespace` and the\n* `terminalName` so users can locate the misuse.\n*\n* @example\n* ```typescript\n* // Inside an ORM read terminal:\n* assertAnnotationsApplicable(annotations, 'read', 'first');\n* ```\n*/\nfunction assertAnnotationsApplicable(annotations, kind, terminalName) {\n\tfor (const annotation of annotations) if (!annotation.applicableTo.has(kind)) throw runtimeError(\"RUNTIME.ANNOTATION_INAPPLICABLE\", `Annotation '${annotation.namespace}' is not applicable to '${kind}' operations (terminal: '${terminalName}'). The annotation declares applicableTo = [${Array.from(annotation.applicableTo).map((k) => `'${k}'`).join(\", \")}].`, {\n\t\tnamespace: annotation.namespace,\n\t\tterminalName,\n\t\tkind,\n\t\tapplicableTo: Array.from(annotation.applicableTo)\n\t});\n}\n/**\n* Type guard for branded annotation values stored in `plan.meta.annotations`.\n*\n* Internal — used by `AnnotationHandle.read` to distinguish user\n* annotations (created by calling a handle returned from\n* `defineAnnotation(...)`) from framework-internal metadata that may\n* happen to live under the same namespace key.\n*/\nfunction isAnnotationValue(value) {\n\tif (value === null || typeof value !== \"object\") return false;\n\treturn value.__annotation === true;\n}\n//#endregion\n//#region src/execution/async-iterable-result.ts\nvar AsyncIterableResult = class {\n\tgenerator;\n\tconsumed = false;\n\tconsumedBy;\n\tbufferedArrayPromise;\n\tconstructor(generator) {\n\t\tthis.generator = generator;\n\t}\n\t[Symbol.asyncIterator]() {\n\t\tif (this.consumed) throw runtimeError(\"RUNTIME.ITERATOR_CONSUMED\", `AsyncIterableResult iterator has already been consumed via ${this.consumedBy === \"bufferedArray\" ? \"toArray()/then()\" : \"for-await loop\"}. Each AsyncIterableResult can only be iterated once.`, {\n\t\t\tconsumedBy: this.consumedBy,\n\t\t\tsuggestion: this.consumedBy === \"bufferedArray\" ? \"If you need to iterate multiple times, store the results from toArray() in a variable and reuse that.\" : \"If you need to iterate multiple times, use toArray() to collect all results first.\"\n\t\t});\n\t\tthis.consumed = true;\n\t\tthis.consumedBy = \"iterator\";\n\t\treturn this.generator;\n\t}\n\ttoArray() {\n\t\tif (this.consumedBy === \"iterator\") return Promise.reject(runtimeError(\"RUNTIME.ITERATOR_CONSUMED\", \"AsyncIterableResult iterator has already been consumed via for-await loop. Each AsyncIterableResult can only be iterated once.\", {\n\t\t\tconsumedBy: this.consumedBy,\n\t\t\tsuggestion: \"The iterator was already consumed by a for-await loop. Use toArray() or await the result before iterating.\"\n\t\t}));\n\t\tif (this.bufferedArrayPromise) return this.bufferedArrayPromise;\n\t\tthis.consumed = true;\n\t\tthis.consumedBy = \"bufferedArray\";\n\t\tthis.bufferedArrayPromise = (async () => {\n\t\t\tconst out = [];\n\t\t\tfor await (const item of this.generator) out.push(item);\n\t\t\treturn out;\n\t\t})();\n\t\treturn this.bufferedArrayPromise;\n\t}\n\tasync first() {\n\t\treturn (await this.toArray())[0] ?? null;\n\t}\n\tasync firstOrThrow() {\n\t\tconst row = await this.first();\n\t\tif (row === null) throw runtimeError(\"RUNTIME.NO_ROWS\", \"Expected at least one row, but none were returned\", {});\n\t\treturn row;\n\t}\n\tthen(onfulfilled, onrejected) {\n\t\treturn this.toArray().then(onfulfilled, onrejected);\n\t}\n};\n//#endregion\n//#region src/execution/race-against-abort.ts\n/**\n* Throw a phase-tagged `RUNTIME.ABORTED` envelope if the supplied\n* context is already aborted at the precheck site. Centralises the\n* `if (ctx.signal?.aborted) throw runtimeAborted(...)` pattern that\n* every codec dispatch site (and the `beforeExecute` middleware phase)\n* repeats. Accepts both the framework `CodecCallContext` and the\n* `RuntimeMiddlewareContext`; both expose `signal?: AbortSignal`.\n*/\nfunction checkAborted(ctx, phase) {\n\tif (ctx.signal?.aborted) throw runtimeAborted(phase, ctx.signal.reason);\n}\n/**\n* Race a per-cell `Promise.all` (or any other in-flight work promise) against\n* the supplied abort signal so the runtime returns `RUNTIME.ABORTED` promptly\n* even when codec bodies ignore the signal. In-flight bodies that ignore the\n* signal are abandoned and run to completion in the background — the\n* cooperative-cancellation contract documented in ADR 204.\n*\n* Call sites still SHOULD pre-check `signal.aborted` and short-circuit with\n* a phase-tagged `RUNTIME.ABORTED` envelope before invoking this helper —\n* that path is the canonical \"aborted at entry\" surface and avoids\n* scheduling the work promise. As a defensive belt-and-braces, this helper\n* also handles the already-aborted case internally: `AbortSignal` does not\n* replay past abort events to listeners registered after the abort, so we\n* inspect `signal.aborted` synchronously and reject with the sentinel\n* before installing the listener. The rejection is still attributed to the\n* abort path via the sentinel-identity check.\n*\n* Distinguishing the rejection source is load-bearing for AC-ERR4\n* (`RUNTIME.ENCODE_FAILED` / `RUNTIME.DECODE_FAILED` pass through unchanged).\n* The semantically equivalent `abortable(signal)` helper in\n* `@internal/utils` rejects with `signal.reason ?? new DOMException(...)`,\n* which is not stably distinguishable from a codec-thrown error by identity\n* alone (a fresh fallback DOMException is allocated per call). We instead\n* track abort attribution with a unique sentinel: only the `onAbort` listener\n* installed here ever rejects with the sentinel, so an `error === sentinel`\n* identity check after the race is unambiguous.\n*\n* Lives in `framework-components` (rather than the SQL family, where it\n* originated in m2) so every family runtime that needs cooperative\n* cancellation around a codec-dispatch `Promise.all` (SQL encode + decode\n* today, Mongo encode in m3) shares the same attribution logic.\n*/\nasync function raceAgainstAbort(work, signal, phase) {\n\tif (signal === void 0) return await work;\n\tconst sentinel = { reason: void 0 };\n\tlet onAbort;\n\tconst abortPromise = new Promise((_, reject) => {\n\t\tif (signal.aborted) {\n\t\t\tsentinel.reason = signal.reason;\n\t\t\treject(sentinel);\n\t\t\treturn;\n\t\t}\n\t\tonAbort = () => {\n\t\t\tsentinel.reason = signal.reason;\n\t\t\treject(sentinel);\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\ttry {\n\t\treturn await Promise.race([work, abortPromise]);\n\t} catch (error) {\n\t\tif (error === sentinel) throw runtimeAborted(phase, sentinel.reason);\n\t\tthrow error;\n\t} finally {\n\t\tif (onAbort) signal.removeEventListener(\"abort\", onAbort);\n\t}\n}\n//#endregion\n//#region src/execution/before-execute-chain.ts\n/**\n* Runs every middleware's `beforeQuery` hook in registration order,\n* threading through the (optional) family-specific `paramsMutator`.\n*\n* Why this lives outside {@link runQueryWithMiddleware}: middleware that\n* mutates parameter values (e.g. cipherstash's bulk-encrypt SDK\n* round-trip) must run *before* the family runtime encodes those\n* parameters to driver wire format. Family runtimes call\n* `runBeforeQueryChain` between the AST → plan lowering step and\n* the parameter encode step; the encode then observes the mutator's\n* `currentParams()` view. `runQueryWithMiddleware` retains the rest of\n* the query lifecycle (`interceptQuery`, driver/row source loop, `onRow`,\n* `afterQuery`) but no longer fires `beforeQuery` itself.\n*\n* Lifecycle within this helper:\n*\n* 1. For each middleware in registration order, if `beforeQuery`\n* is implemented:\n* - `checkAborted(ctx, 'beforeQuery')` short-circuits if the\n* caller already aborted at entry.\n* - The hook is invoked with `(plan, ctx, paramsMutator)`. A\n* middleware body that ignores the mutator stays compatible —\n* JavaScript allows extra positional arguments.\n* - If the hook returns a Promise, it is raced against\n* `ctx.signal` via {@link raceAgainstAbort} so cooperative\n* cancellation surfaces a `RUNTIME.ABORTED { phase:\n* 'beforeQuery' }` envelope even when the body itself\n* ignores the signal.\n*\n* Error propagation: any error thrown by a `beforeQuery` body\n* (or surfaced by the abort race) propagates out of this helper\n* unchanged. Family runtime entry points await this helper before invoking\n* `runQueryWithMiddleware`, so a rejection prevents the runner and its\n* `afterQuery` hook from running.\n*\n* Relationship to {@link runQueryWithMiddleware}: the framework's\n* `RuntimeCore.query` template calls this helper between\n* `lower(plan)` and `runQueryWithMiddleware(...)`. Family runtimes that\n* override query preparation (e.g. SQL, which inlines lower + encode for\n* direct mutator threading) call this helper themselves at the\n* equivalent point — between the family's AST → draft-plan\n* lowering and the parameter-encode step.\n*\n* Intercept ordering: this helper fires unconditionally before\n* `runQueryWithMiddleware`. `interceptQuery` (inside\n* `runQueryWithMiddleware`) therefore observes the post-`beforeQuery`\n* plan — mutator mutations are visible in the params interceptors see.\n* The trade-off is documented on `RuntimeMiddleware.interceptQuery`.\n*/\nfunction runBeforeQueryChain(plan, middleware, ctx, paramsMutator) {\n\treturn runBeforeChain(plan, middleware, ctx, paramsMutator, \"beforeQuery\", (mw) => mw.beforeQuery);\n}\n/**\n* Runs every middleware's `beforeExecute` hook in registration order,\n* threading through the (optional) family-specific `paramsMutator`.\n*\n* Why this lives outside {@link runExecuteWithMiddleware}: middleware that\n* mutates parameter values (e.g. cipherstash's bulk-encrypt SDK\n* round-trip) must run *before* the family runtime encodes those\n* parameters to driver wire format. Family runtimes call\n* `runBeforeExecuteChain` between the AST → plan lowering step and\n* the parameter encode step; the encode then observes the mutator's\n* `currentParams()` view. `runExecuteWithMiddleware` retains the rest of\n* the execute lifecycle (`interceptExecute`, driver statistics execution,\n* `afterExecute`) but no longer fires `beforeExecute` itself.\n*\n* Lifecycle within this helper:\n*\n* 1. For each middleware in registration order, if `beforeExecute`\n* is implemented:\n* - `checkAborted(ctx, 'beforeExecute')` short-circuits if the\n* caller already aborted at entry.\n* - The hook is invoked with `(plan, ctx, paramsMutator)`. A\n* middleware body that ignores the mutator stays compatible —\n* JavaScript allows extra positional arguments.\n* - If the hook returns a Promise, it is raced against\n* `ctx.signal` via {@link raceAgainstAbort} so cooperative\n* cancellation surfaces a `RUNTIME.ABORTED { phase:\n* 'beforeExecute' }` envelope even when the body itself\n* ignores the signal.\n*\n* Error propagation: any error thrown by a `beforeExecute` body\n* (or surfaced by the abort race) propagates out of this helper\n* unchanged. Family runtime entry points await this helper before invoking\n* `runExecuteWithMiddleware`, so a rejection prevents the runner and its\n* `afterExecute` hook from running.\n*\n* Relationship to {@link runExecuteWithMiddleware}: the framework's\n* `RuntimeCore.execute` template calls this helper between\n* `lower(plan)` and `runExecuteWithMiddleware(...)`. Family runtimes that\n* override execute (e.g. SQL, which inlines lower + encode for\n* direct mutator threading) call this helper themselves at the\n* equivalent point — between the family's AST → draft-plan\n* lowering and the parameter-encode step.\n*\n* Intercept ordering: this helper fires unconditionally before\n* `runExecuteWithMiddleware`. `interceptExecute` (inside\n* `runExecuteWithMiddleware`) therefore observes the post-`beforeExecute`\n* plan — mutator mutations are visible in the params interceptors see.\n* The trade-off is documented on `RuntimeMiddleware.interceptExecute`.\n*/\nfunction runBeforeExecuteChain(plan, middleware, ctx, paramsMutator) {\n\treturn runBeforeChain(plan, middleware, ctx, paramsMutator, \"beforeExecute\", (mw) => mw.beforeExecute);\n}\nasync function runBeforeChain(plan, middleware, ctx, paramsMutator, phase, selectHook) {\n\tfor (const mw of middleware) {\n\t\tconst hook = selectHook(mw);\n\t\tif (hook === void 0) continue;\n\t\tcheckAborted(ctx, phase);\n\t\tconst work = hook(plan, ctx, paramsMutator);\n\t\tif (work !== void 0) await raceAgainstAbort(Promise.resolve(work), ctx.signal, phase);\n\t}\n}\n//#endregion\n//#region src/execution/mutation-defaults.ts\n/** Registers every generator the contributors provide, by id. Two contributors providing one id is an error naming both. */\nfunction collectMutationDefaultGenerators(contributors) {\n\tconst generators = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const contributor of contributors) {\n\t\tconst nextGenerators = contributor.mutationDefaultGenerators?.() ?? [];\n\t\tfor (const generator of nextGenerators) {\n\t\t\tconst existingOwner = owners.get(generator.id);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"RUNTIME.DUPLICATE_MUTATION_DEFAULT_GENERATOR\", `Duplicate mutation default generator '${generator.id}'.`, {\n\t\t\t\tid: generator.id,\n\t\t\t\texistingOwner,\n\t\t\t\tincomingOwner: contributor.id\n\t\t\t});\n\t\t\tgenerators.set(generator.id, generator);\n\t\t\towners.set(generator.id, contributor.id);\n\t\t}\n\t}\n\treturn generators;\n}\n/** Fails when the contract's mutation defaults name a generator the registry does not hold, listing every missing id and the fields that need it. */\nfunction assertMutationDefaultGeneratorsAvailable(execution, generatorRegistry) {\n\tconst defaults = execution?.mutations.defaults ?? [];\n\tif (defaults.length === 0) return;\n\tconst fieldsById = /* @__PURE__ */ new Map();\n\tfor (const mutationDefault of defaults) {\n\t\tconst phaseIds = new Set([mutationDefault.onCreate, mutationDefault.onUpdate].flatMap((phase) => phase?.kind === \"generator\" && !generatorRegistry.has(phase.id) ? [phase.id] : []));\n\t\tfor (const id of phaseIds) {\n\t\t\tconst fields = fieldsById.get(id) ?? [];\n\t\t\tfields.push(`${mutationDefault.ref.entry}.${mutationDefault.ref.field}`);\n\t\t\tfieldsById.set(id, fields);\n\t\t}\n\t}\n\tif (fieldsById.size === 0) return;\n\tconst ids = [...fieldsById.keys()];\n\tconst needs = [...fieldsById].map(([id, fields]) => `'${id}' for ${listInProse(fields)}`);\n\tthrow runtimeError(\"RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING\", `${ids.length === 1 ? `Contract requires mutation default generator ${needs[0]}, but no runtime component in the execution stack provides it.` : `Contract requires mutation default generators ${listInProse(needs)}, but no runtime component in the execution stack provides them.`} ${WHERE_GENERATORS_COME_FROM}`, {\n\t\tids,\n\t\tfields: [...fieldsById.values()].flat()\n\t});\n}\nconst WHERE_GENERATORS_COME_FROM = \"Built-in generators such as 'timestampNow' come from the database adapter's runtime descriptor, and others from the extension pack that defines them; include that component in the execution stack.\";\nfunction listInProse(items) {\n\treturn items.length > 1 ? `${items.slice(0, -1).join(\", \")} and ${items.at(-1)}` : items.join(\"\");\n}\nfunction computeExecutionDefaultValue(spec, generatorRegistry) {\n\tconst generator = generatorRegistry.get(spec.id);\n\tif (!generator) throw runtimeError(\"RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING\", `Contract references mutation default generator '${spec.id}' but no runtime component in the execution stack provides it. ${WHERE_GENERATORS_COME_FROM}`, { id: spec.id });\n\treturn generator.generate(spec.params);\n}\n/**\n* The defaults to write for one record: for each mutation default of the entry and namespace whose phase matches `op`, the generated value of every field the values do not carry. An update with no keys gets none.\n*/\nfunction applyMutationDefaults(execution, generatorRegistry, options) {\n\tconst defaults = execution?.mutations.defaults ?? [];\n\tif (defaults.length === 0) return [];\n\tconst isEmptyUpdate = options.op === \"update\" && Object.keys(options.values).length === 0;\n\tconst applied = [];\n\tconst appliedFields = /* @__PURE__ */ new Set();\n\tconst rowCache = /* @__PURE__ */ new Map();\n\tfor (const mutationDefault of defaults) {\n\t\tif (mutationDefault.ref.entry !== options.entry) continue;\n\t\tif (mutationDefault.ref.namespace !== options.namespace) continue;\n\t\tconst defaultSpec = options.op === \"create\" ? mutationDefault.onCreate : mutationDefault.onUpdate;\n\t\tif (!defaultSpec) continue;\n\t\tif (isEmptyUpdate) continue;\n\t\tconst fieldName = mutationDefault.ref.field;\n\t\tif (Object.hasOwn(options.values, fieldName) || appliedFields.has(fieldName)) continue;\n\t\tapplied.push({\n\t\t\tfield: fieldName,\n\t\t\tvalue: resolveScopedValue(defaultSpec, generatorRegistry, rowCache, options.defaultValueCache)\n\t\t});\n\t\tappliedFields.add(fieldName);\n\t}\n\treturn applied;\n}\nfunction resolveScopedValue(spec, generatorRegistry, rowCache, queryCache) {\n\tconst cache = scopedCache(generatorRegistry.get(spec.id)?.stability, rowCache, queryCache);\n\tif (!cache) return computeExecutionDefaultValue(spec, generatorRegistry);\n\tif (cache.has(spec.id)) return cache.get(spec.id);\n\tconst value = computeExecutionDefaultValue(spec, generatorRegistry);\n\tcache.set(spec.id, value);\n\treturn value;\n}\nfunction scopedCache(stability, rowCache, queryCache) {\n\tswitch (stability) {\n\t\tcase \"row\": return rowCache;\n\t\tcase \"query\": return queryCache;\n\t\tdefault: return;\n\t}\n}\n//#endregion\n//#region src/execution/run-with-middleware.ts\n/**\n* Drives a single query execution of `runDriver()` through the middleware\n* lifecycle's `interceptQuery` + row-source + termination phases.\n*\n* Lifecycle, in order:\n* 1. For each middleware in registration order: `interceptQuery(exec, ctx)`.\n* The first non-`undefined` result wins; subsequent middleware's\n* `interceptQuery` does not fire. On a hit, the runtime emits a\n* `middleware.interceptQuery` debug event naming the winning middleware,\n* switches the row source to the intercepted rows, and proceeds with\n* `source: 'middleware'`. On all-passthrough (every `interceptQuery`\n* returns `undefined` or is omitted), `source: 'driver'` is used and the\n* row source is `runDriver()`.\n* 2. Iterate the row source. On the driver path, for each row, for each\n* middleware in registration order: `onRow(row, exec, ctx)`; then yield\n* the row. On the intercepted hit path, `onRow` is skipped — intercepted\n* rows did not originate from a driver row stream — but rows are still\n* yielded to the consumer in order.\n* 3. On successful completion: for each middleware in registration order:\n* `afterQuery(exec, { rowCount, latencyMs, completed: true, source },\n* ctx)`.\n* 4. On any error thrown during steps 1–2: for each middleware in\n* registration order: `afterQuery(exec, { rowCount, latencyMs,\n* completed: false, source }, ctx)`. Errors thrown by `afterQuery`\n* during the error path are swallowed so they do not mask the original\n* error. The original error is then rethrown.\n*\n* `beforeQuery` is **not** fired here — see\n* {@link runBeforeQueryChain} in `before-execute-chain.ts`. Family runtimes\n* call that helper between the AST → plan lowering step and the parameter\n* encode step so middleware that mutates ParamRef values can have its\n* mutations visible to encode. `runQueryWithMiddleware` operates on the\n* fully-encoded plan; interceptors therefore observe a fully-mutated,\n* encoded plan.\n*\n* The `source` field on `AfterQueryResult` lets observers (telemetry, lints,\n* budgets) distinguish driver-served from middleware-served executions\n* without needing their own out-of-band signal.\n*\n* This helper is the single canonical implementation of the\n* intercept-and-row-source loop; family runtimes should not reimplement it.\n*/\nfunction runQueryWithMiddleware(exec, middleware, ctx, runDriver) {\n\tconst iterator = async function* () {\n\t\tconst startedAt = Date.now();\n\t\tlet rowCount = 0;\n\t\tlet completed = false;\n\t\tlet source = \"driver\";\n\t\tlet rowSource;\n\t\ttry {\n\t\t\tfor (const mw of middleware) {\n\t\t\t\tif (!mw.interceptQuery) continue;\n\t\t\t\tsource = \"middleware\";\n\t\t\t\tconst result = await mw.interceptQuery(exec, ctx);\n\t\t\t\tif (result === void 0) {\n\t\t\t\t\tsource = \"driver\";\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tctx.log.debug?.({\n\t\t\t\t\tevent: \"middleware.interceptQuery\",\n\t\t\t\t\tmiddleware: mw.name\n\t\t\t\t});\n\t\t\t\trowSource = blindCast(result.rows);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (source === \"driver\") rowSource = runDriver();\n\t\t\tfor await (const row of rowSource) {\n\t\t\t\tif (source === \"driver\") {\n\t\t\t\t\tfor (const mw of middleware) if (mw.onRow) await mw.onRow(row, exec, ctx);\n\t\t\t\t}\n\t\t\t\trowCount++;\n\t\t\t\tyield row;\n\t\t\t}\n\t\t\tcompleted = true;\n\t\t} catch (error) {\n\t\t\tawait notifyQueryCompletion(middleware, exec, ctx, {\n\t\t\t\trowCount,\n\t\t\t\tlatencyMs: Date.now() - startedAt,\n\t\t\t\tcompleted,\n\t\t\t\tsource\n\t\t\t}, true);\n\t\t\tthrow error;\n\t\t}\n\t\tawait notifyQueryCompletion(middleware, exec, ctx, {\n\t\t\trowCount,\n\t\t\tlatencyMs: Date.now() - startedAt,\n\t\t\tcompleted,\n\t\t\tsource\n\t\t}, false);\n\t};\n\treturn new AsyncIterableResult(iterator());\n}\n/**\n* Drives a single execute operation through the middleware\n* `interceptExecute` + statistics + termination phases.\n*\n* Lifecycle, in order:\n* 1. For each middleware in registration order: `interceptExecute(exec, ctx)`.\n* The first non-`undefined` result wins; subsequent middleware's\n* `interceptExecute` does not fire. On a hit, the runtime emits a\n* `middleware.interceptExecute` debug event naming the winning middleware,\n* uses the returned `stats`, and proceeds with `source: 'middleware'`.\n* On all-passthrough (every `interceptExecute` returns `undefined` or is\n* omitted), `source: 'driver'` is used and `runDriver()` supplies the\n* statistics.\n* 2. Execute operations return eager statistics. There is no row stream and\n* `onRow` does not fire.\n* 3. On successful completion: for each middleware in registration order:\n* `afterExecute(exec, { stats, latencyMs, completed: true, source }, ctx)`.\n* 4. On any error thrown during steps 1–2: for each middleware in\n* registration order: `afterExecute(exec, { latencyMs, completed: false,\n* source }, ctx)`. Errors thrown by `afterExecute` during the error path\n* are swallowed so they do not mask the original error. The original\n* error is then rethrown.\n*\n* `beforeExecute` is **not** fired here — see\n* {@link runBeforeExecuteChain} in `before-execute-chain.ts`. Family runtimes\n* call that helper between the AST → plan lowering step and the parameter\n* encode step so middleware that mutates ParamRef values can have its\n* mutations visible to encode. `runExecuteWithMiddleware` operates on the\n* fully-encoded plan; interceptors therefore observe a fully-mutated,\n* encoded plan.\n*\n* The `source` field on `AfterExecuteResult` lets observers (telemetry, lints,\n* budgets) distinguish driver-served from middleware-served executions\n* without needing their own out-of-band signal.\n*/\nasync function runExecuteWithMiddleware(exec, middleware, ctx, runDriver) {\n\tconst startedAt = Date.now();\n\tlet source = \"driver\";\n\tlet stats;\n\ttry {\n\t\tfor (const mw of middleware) {\n\t\t\tif (!mw.interceptExecute) continue;\n\t\t\tsource = \"middleware\";\n\t\t\tconst result = await mw.interceptExecute(exec, ctx);\n\t\t\tif (result === void 0) {\n\t\t\t\tsource = \"driver\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tctx.log.debug?.({\n\t\t\t\tevent: \"middleware.interceptExecute\",\n\t\t\t\tmiddleware: mw.name\n\t\t\t});\n\t\t\tstats = result.stats;\n\t\t\tbreak;\n\t\t}\n\t\tif (stats === void 0) stats = await runDriver();\n\t} catch (error) {\n\t\tconst latencyMs = Date.now() - startedAt;\n\t\tfor (const mw of middleware) {\n\t\t\tif (!mw.afterExecute) continue;\n\t\t\ttry {\n\t\t\t\tawait mw.afterExecute(exec, {\n\t\t\t\t\tlatencyMs,\n\t\t\t\t\tcompleted: false,\n\t\t\t\t\tsource\n\t\t\t\t}, ctx);\n\t\t\t} catch {}\n\t\t}\n\t\tthrow error;\n\t}\n\tconst latencyMs = Date.now() - startedAt;\n\tfor (const mw of middleware) if (mw.afterExecute) await mw.afterExecute(exec, {\n\t\tstats,\n\t\tlatencyMs,\n\t\tcompleted: true,\n\t\tsource\n\t}, ctx);\n\treturn stats;\n}\n/**\n* Calls each middleware's `afterTransaction` hook in registration order. A\n* thrown error is passed to `ctx.log.error` and swallowed, and later\n* middleware still run. Never rejects, so a query's result or a resolved\n* commit is never replaced by a hook's failure.\n*/\nasync function runAfterTransaction(exec, middleware, result, ctx) {\n\tfor (const mw of middleware) {\n\t\tif (!mw.afterTransaction) continue;\n\t\ttry {\n\t\t\tawait mw.afterTransaction(exec, result, ctx);\n\t\t} catch (error) {\n\t\t\ttry {\n\t\t\t\tctx.log.error({\n\t\t\t\t\tevent: \"middleware.afterTransaction.error\",\n\t\t\t\t\tmiddleware: mw.name,\n\t\t\t\t\terror\n\t\t\t\t});\n\t\t\t} catch {}\n\t\t}\n\t}\n}\n/**\n* Returns what a query outside a transaction calls when it ends: it runs `runStage` with `committed` when the query completed and `unknown` otherwise. Returns `undefined` when `runStage` is `undefined`.\n*/\nfunction onQueryEndOutsideTransaction(runStage) {\n\tif (runStage === void 0) return void 0;\n\treturn (ending) => runStage({ outcome: ending === \"completed\" ? \"committed\" : \"unknown\" });\n}\n/**\n* Streams `rows()` and then calls `onQueryEnd` exactly once with how the query ended: `completed` when the stream completes, `failed` when an error comes out of it, and `stopped` when the caller stops reading, calls `return()` or throws into the iterator, before or after the first row. Returns `rows()` itself when `onQueryEnd` is `undefined`.\n*/\nfunction reportQueryEnding(onQueryEnd, rows) {\n\treturn onQueryEnd === void 0 ? rows() : rowsThenQueryEnd(onQueryEnd, rows);\n}\nfunction rowsThenQueryEnd(onQueryEnd, rows) {\n\treturn { [Symbol.asyncIterator]() {\n\t\tlet thrownByCaller;\n\t\tconst generator = streamThenQueryEnd(onQueryEnd, rows, (error) => thrownByCaller !== void 0 && thrownByCaller.error === error);\n\t\tlet started = false;\n\t\tconst reportStoppedBeforeStart = async () => {\n\t\t\tif (started) return;\n\t\t\tstarted = true;\n\t\t\tawait onQueryEnd(\"stopped\");\n\t\t};\n\t\treturn {\n\t\t\tnext: () => {\n\t\t\t\tstarted = true;\n\t\t\t\treturn generator.next();\n\t\t\t},\n\t\t\treturn: async () => {\n\t\t\t\tawait reportStoppedBeforeStart();\n\t\t\t\treturn generator.return(void 0);\n\t\t\t},\n\t\t\tthrow: async (error) => {\n\t\t\t\tthrownByCaller = { error };\n\t\t\t\tawait reportStoppedBeforeStart();\n\t\t\t\treturn generator.throw(error);\n\t\t\t}\n\t\t};\n\t} };\n}\nasync function* streamThenQueryEnd(onQueryEnd, rows, isThrownByCaller) {\n\tlet ending = \"stopped\";\n\ttry {\n\t\tyield* rows();\n\t\tending = \"completed\";\n\t} catch (error) {\n\t\tif (!isThrownByCaller(error)) ending = \"failed\";\n\t\tthrow error;\n\t} finally {\n\t\tawait onQueryEnd(ending);\n\t}\n}\n/**\n* Runs `execute()` and then calls `onQueryEnd` exactly once: with `completed` when it resolves, and with `failed` when it rejects.\n*/\nasync function reportExecuteEnding(onQueryEnd, execute) {\n\tif (onQueryEnd === void 0) return execute();\n\tlet ending = \"failed\";\n\ttry {\n\t\tconst result = await execute();\n\t\tending = \"completed\";\n\t\treturn result;\n\t} finally {\n\t\tawait onQueryEnd(ending);\n\t}\n}\nasync function notifyQueryCompletion(middleware, exec, ctx, result, swallowErrors) {\n\tfor (const mw of middleware) {\n\t\tif (!mw.afterQuery) continue;\n\t\tif (swallowErrors) try {\n\t\t\tawait mw.afterQuery(exec, result, ctx);\n\t\t} catch {}\n\t\telse await mw.afterQuery(exec, result, ctx);\n\t}\n}\n//#endregion\n//#region src/execution/runtime-core.ts\n/**\n* Family-agnostic abstract runtime base.\n*\n* Defines the shared operation-specific middleware lifecycles:\n*\n* 1. `runBeforeCompile(plan)` — concrete; defaults to identity. SQL overrides\n* this to run its shared `beforeCompile` middleware-hook chain.\n* 2. `lower(plan)` — abstract. Each family produces its `*ExecutionPlan`\n* (SQL via `lowerSqlPlan`, Mongo via `adapter.lower`).\n* 3. Queries run `beforeQuery`; statements run `beforeExecute`. Both chains\n* run after lowering and before their matching driver terminal. Family\n* runtimes that expose a params mutator to downstream encoding override\n* the operation and call the matching helper at the pre-encode point.\n* 4. The matching runner processes `interceptQuery` or `interceptExecute`\n* before invoking the driver. Queries then fire `onRow` and `afterQuery`;\n* statements fire `afterExecute`.\n* 5. Every operation whose lowering (which encodes parameters) and before-hooks\n* succeeded fires `afterTransaction` once, as its last hook: `committed`\n* when it completed, `unknown` when it threw or the caller stopped reading\n* its rows. `reportQueryEnding` and `reportExecuteEnding` report how the\n* operation ended, and `onQueryEndOutsideTransaction` turns that into the\n* outcome; family runtimes that override `query` or `execute` call them\n* too, with {@link afterTransactionStageFor}.\n*\n* Concrete subclasses must implement `lower`, `runDriver`, `runExecute`, and\n* `close`.\n*\n* The class is generic over:\n* - `TPlan` — the family's pre-lowering plan type.\n* - `TExec` — the family's post-lowering (executable) plan type.\n* - `TMiddleware` — the family's middleware type. Constrained to\n* `RuntimeMiddleware<TExec>` because the operation-specific runners invoke\n* hooks with the lowered `TExec`. Middleware therefore sees the\n* post-lowering plan.\n*/\nvar RuntimeCore = class {\n\tmiddleware;\n\tctx;\n\tanyMiddlewareDeclaresAfterTransaction;\n\tconstructor(options) {\n\t\tthis.middleware = [...options.middleware];\n\t\tthis.ctx = options.ctx;\n\t\tthis.anyMiddlewareDeclaresAfterTransaction = this.middleware.some((mw) => mw.afterTransaction !== void 0);\n\t}\n\t/**\n\t* Returns the function that runs every middleware's `afterTransaction` hook for one operation with a given result, or `undefined` when no middleware declared the hook when the runtime was created.\n\t*/\n\tafterTransactionStageFor(exec, ctx) {\n\t\tif (!this.anyMiddlewareDeclaresAfterTransaction) return void 0;\n\t\treturn (result) => runAfterTransaction(exec, this.middleware, result, ctx);\n\t}\n\t/**\n\t* Pre-lowering hook for plan rewriting. Defaults to identity. Subclasses\n\t* may override to run a `beforeCompile` middleware chain (SQL does this\n\t* to support typed AST rewrites — see `before-compile-chain.ts`).\n\t*/\n\trunBeforeCompile(plan) {\n\t\treturn plan;\n\t}\n\tquery(plan, options) {\n\t\tconst self = this;\n\t\tconst signal = options?.signal;\n\t\tconst codecCtx = signal === void 0 ? {} : { signal };\n\t\tconst execCtx = {\n\t\t\t...self.ctx,\n\t\t\t...codecCtx,\n\t\t\tscope: options?.scope ?? self.ctx.scope,\n\t\t\tplanExecutionId: crypto.randomUUID()\n\t\t};\n\t\tasync function* generator() {\n\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\tconst compiled = await self.runBeforeCompile(plan);\n\t\t\tconst exec = await self.lower(compiled, codecCtx);\n\t\t\tawait runBeforeQueryChain(exec, self.middleware, execCtx);\n\t\t\tyield* reportQueryEnding(onQueryEndOutsideTransaction(self.afterTransactionStageFor(exec, execCtx)), () => runQueryWithMiddleware(exec, self.middleware, execCtx, () => blindCast(self.runDriver(exec))));\n\t\t}\n\t\treturn new AsyncIterableResult(generator());\n\t}\n\tasync execute(plan, options) {\n\t\tconst signal = options?.signal;\n\t\tconst codecCtx = signal === void 0 ? {} : { signal };\n\t\tconst execCtx = {\n\t\t\t...this.ctx,\n\t\t\t...codecCtx,\n\t\t\tscope: options?.scope ?? this.ctx.scope,\n\t\t\tplanExecutionId: crypto.randomUUID()\n\t\t};\n\t\tcheckAborted(codecCtx, \"stream\");\n\t\tconst compiled = await this.runBeforeCompile(plan);\n\t\tconst exec = await this.lower(compiled, codecCtx);\n\t\tawait runBeforeExecuteChain(exec, this.middleware, execCtx);\n\t\treturn reportExecuteEnding(onQueryEndOutsideTransaction(this.afterTransactionStageFor(exec, execCtx)), () => runExecuteWithMiddleware(exec, this.middleware, execCtx, () => this.runExecute(exec)));\n\t}\n};\n//#endregion\n//#region src/execution/runtime-middleware.ts\nfunction checkMiddlewareCompatibility(middleware, runtimeFamilyId, runtimeTargetId) {\n\tif (middleware.targetId !== void 0 && middleware.familyId === void 0) throw runtimeError(\"RUNTIME.MIDDLEWARE_INCOMPATIBLE\", `Middleware '${middleware.name}' specifies targetId '${middleware.targetId}' without familyId`, {\n\t\tmiddleware: middleware.name,\n\t\ttargetId: middleware.targetId\n\t});\n\tif (middleware.familyId !== void 0 && middleware.familyId !== runtimeFamilyId) throw runtimeError(\"RUNTIME.MIDDLEWARE_FAMILY_MISMATCH\", `Middleware '${middleware.name}' requires family '${middleware.familyId}' but the runtime is configured for family '${runtimeFamilyId}'`, {\n\t\tmiddleware: middleware.name,\n\t\tmiddlewareFamilyId: middleware.familyId,\n\t\truntimeFamilyId\n\t});\n\tif (middleware.targetId !== void 0 && middleware.targetId !== runtimeTargetId) throw runtimeError(\"RUNTIME.MIDDLEWARE_TARGET_MISMATCH\", `Middleware '${middleware.name}' requires target '${middleware.targetId}' but the runtime is configured for target '${runtimeTargetId}'`, {\n\t\tmiddleware: middleware.name,\n\t\tmiddlewareTargetId: middleware.targetId,\n\t\truntimeTargetId\n\t});\n}\n//#endregion\n//#region src/execution/shape.ts\n/**\n* Phantom key an emitted model type carries to name its relation properties.\n* Never present at runtime; `Scalars` and `Shape` read it to tell relations from fields.\n*/\nconst RelationKeys = Symbol(\"RelationKeys\");\n//#endregion\n//#region src/meta-builder.ts\nvar MetaBuilderImpl = class {\n\t#kind;\n\t#terminalName;\n\t#annotations = /* @__PURE__ */ new Map();\n\tconstructor(kind, terminalName) {\n\t\tthis.#kind = kind;\n\t\tthis.#terminalName = terminalName;\n\t}\n\tget annotations() {\n\t\treturn this.#annotations;\n\t}\n\tannotate(annotation) {\n\t\tconst value = annotation;\n\t\tassertAnnotationsApplicable([value], this.#kind, this.#terminalName);\n\t\tthis.#annotations.set(value.namespace, value);\n\t\treturn this;\n\t}\n};\n/**\n* Construct a lane-side meta builder for a terminal of operation kind `K`.\n*\n* Lane terminals call this with their `kind` (`'read'` or `'write'`) and a\n* `terminalName` for error messages, hand the resulting builder to the\n* user-supplied configurator callback (typed as `MetaBuilder<K>`, the\n* narrower public view), and read `meta.annotations` afterwards to thread\n* the recorded values into `plan.meta.annotations`.\n*/\nfunction createMetaBuilder(kind, terminalName) {\n\treturn new MetaBuilderImpl(kind, terminalName);\n}\n//#endregion\nexport { AsyncIterableResult, RUNTIME_ABORTED, RelationKeys, RuntimeCore, applyMutationDefaults, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, createMetaBuilder, defineAnnotation, isRuntimeError, onQueryEndOutsideTransaction, raceAgainstAbort, reportExecuteEnding, reportQueryEnding, runAfterTransaction, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,kBAAkB;;;;;;;;;;AAUxB,SAAS,eAAe,OAAO,OAAO;CACrC,MAAM,WAAW,aAAa,iBAAiB,4BAA4B,SAAS,EAAE,MAAM,CAAC;CAC7F,OAAO,OAAO,OAAO,UAAU,EAAE,MAAM,CAAC;AACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,mBAAmB;CAC3B,QAAQ,YAAY;EACnB,MAAM,YAAY,QAAQ;EAC1B,MAAM,eAAe,OAAO,OAAO,IAAI,IAAI,QAAQ,YAA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;CAC3B;CACA;CACA,+BAA+B,IAAI,IAAI;CACvC,YAAY,MAAM,cAAc;EAC/B,KAAKA,QAAQ;EACb,KAAKC,gBAAgB;CACtB;CACA,IAAI,cAAc;EACjB,OAAO,KAAKC;CACb;CACA,SAAS,YAAY;EACpB,MAAM,QAAQ;EACd,4BAA4B,CAAC,KAAK,GAAG,KAAKF,OAAO,KAAKC,aAAa;EACnE,KAAKC,aAAa,IAAI,MAAM,WAAW,KAAK;EAC5C,OAAO;CACR;AACD;;;;;;;;;;AAUA,SAAS,kBAAkB,MAAM,cAAc;CAC9C,OAAO,IAAI,gBAAgB,MAAM,YAAY;AAC9C"}
|
|
@@ -413,6 +413,9 @@ type AfterExecuteResult = AfterResultBase & ({
|
|
|
413
413
|
} | {
|
|
414
414
|
readonly completed: false;
|
|
415
415
|
});
|
|
416
|
+
interface AfterTransactionResult {
|
|
417
|
+
readonly outcome: 'committed' | 'rolled-back' | 'unknown';
|
|
418
|
+
}
|
|
416
419
|
interface QueryInterceptResult {
|
|
417
420
|
readonly rows: AsyncIterable<Record<string, unknown>> | Iterable<Record<string, unknown>>;
|
|
418
421
|
}
|
|
@@ -563,6 +566,12 @@ interface RuntimeMiddleware<TPlan extends QueryPlan = QueryPlan, TMutator extend
|
|
|
563
566
|
*/
|
|
564
567
|
interceptExecute?(plan: TPlan, ctx: RuntimeMiddlewareContext): Promise<ExecuteInterceptResult | undefined>;
|
|
565
568
|
afterExecute?(plan: TPlan, result: AfterExecuteResult, ctx: RuntimeMiddlewareContext): Promise<void>;
|
|
569
|
+
/**
|
|
570
|
+
* The query's last hook. Fires exactly once for every query whose before-hooks and parameter encoding succeeded, when the transaction enclosing the query has ended, with its outcome. Outside a transaction it fires when the query ends: `committed` when it completed, `unknown` when it failed or the caller stopped reading its rows. A query is inside a transaction when it is sent on the transaction or on its connection after the transaction has begun and before its `commit()` or `rollback()` is called. A query sent on the connection while the transaction is still beginning counts as outside, although the database may run it inside. Inside a transaction, a resolved commit reports `unknown` when one of the transaction's queries failed. When the transaction ends while the query still runs, this fires at the end, before the query's after-hook, with the transaction's outcome, which may not be the query's: the query may reach the database after the transaction ends and run outside it, and its own failure is not counted. Receives the same plan and context as `afterQuery` or `afterExecute`. The runner logs and swallows thrown errors.
|
|
571
|
+
*
|
|
572
|
+
* Inside a transaction the hooks run one after another while its connection is still checked out, so their time adds to how long it is held. The hook must not use the connection, and must not wait on a connection from the same pool, for example by awaiting a query through the same runtime. A write it sends through the same runtime gets its own `afterTransaction`.
|
|
573
|
+
*/
|
|
574
|
+
afterTransaction?(plan: TPlan, result: AfterTransactionResult, ctx: RuntimeMiddlewareContext): Promise<void>;
|
|
566
575
|
}
|
|
567
576
|
/**
|
|
568
577
|
* Cross-family middleware — one that doesn't constrain `familyId` or
|
|
@@ -928,6 +937,27 @@ declare function runQueryWithMiddleware<TExec extends ExecutionPlan, Row>(exec:
|
|
|
928
937
|
* without needing their own out-of-band signal.
|
|
929
938
|
*/
|
|
930
939
|
declare function runExecuteWithMiddleware<TExec extends ExecutionPlan>(exec: TExec, middleware: ReadonlyArray<RuntimeMiddleware<TExec>>, ctx: RuntimeMiddlewareContext, runDriver: () => Promise<RuntimeStatementStats>): Promise<RuntimeStatementStats>;
|
|
940
|
+
/**
|
|
941
|
+
* Calls each middleware's `afterTransaction` hook in registration order. A
|
|
942
|
+
* thrown error is passed to `ctx.log.error` and swallowed, and later
|
|
943
|
+
* middleware still run. Never rejects, so a query's result or a resolved
|
|
944
|
+
* commit is never replaced by a hook's failure.
|
|
945
|
+
*/
|
|
946
|
+
declare function runAfterTransaction<TExec extends ExecutionPlan>(exec: TExec, middleware: ReadonlyArray<RuntimeMiddleware<TExec>>, result: AfterTransactionResult, ctx: RuntimeMiddlewareContext): Promise<void>;
|
|
947
|
+
/** How a query ended: its rows or statistics all arrived, an error came out of it, or the caller stopped reading its rows. */
|
|
948
|
+
type QueryEnding = 'completed' | 'failed' | 'stopped';
|
|
949
|
+
/**
|
|
950
|
+
* Returns what a query outside a transaction calls when it ends: it runs `runStage` with `committed` when the query completed and `unknown` otherwise. Returns `undefined` when `runStage` is `undefined`.
|
|
951
|
+
*/
|
|
952
|
+
declare function onQueryEndOutsideTransaction(runStage: ((result: AfterTransactionResult) => Promise<void>) | undefined): ((ending: QueryEnding) => Promise<void>) | undefined;
|
|
953
|
+
/**
|
|
954
|
+
* Streams `rows()` and then calls `onQueryEnd` exactly once with how the query ended: `completed` when the stream completes, `failed` when an error comes out of it, and `stopped` when the caller stops reading, calls `return()` or throws into the iterator, before or after the first row. Returns `rows()` itself when `onQueryEnd` is `undefined`.
|
|
955
|
+
*/
|
|
956
|
+
declare function reportQueryEnding<Row>(onQueryEnd: ((ending: QueryEnding) => Promise<void>) | undefined, rows: () => AsyncIterable<Row>): AsyncIterable<Row>;
|
|
957
|
+
/**
|
|
958
|
+
* Runs `execute()` and then calls `onQueryEnd` exactly once: with `completed` when it resolves, and with `failed` when it rejects.
|
|
959
|
+
*/
|
|
960
|
+
declare function reportExecuteEnding<T>(onQueryEnd: ((ending: QueryEnding) => Promise<void>) | undefined, execute: () => Promise<T>): Promise<T>;
|
|
931
961
|
//#endregion
|
|
932
962
|
//#region src/execution/runtime-core.d.ts
|
|
933
963
|
/**
|
|
@@ -957,6 +987,13 @@ interface RuntimeCoreOptions<TMiddleware extends RuntimeMiddleware<ExecutionPlan
|
|
|
957
987
|
* 4. The matching runner processes `interceptQuery` or `interceptExecute`
|
|
958
988
|
* before invoking the driver. Queries then fire `onRow` and `afterQuery`;
|
|
959
989
|
* statements fire `afterExecute`.
|
|
990
|
+
* 5. Every operation whose lowering (which encodes parameters) and before-hooks
|
|
991
|
+
* succeeded fires `afterTransaction` once, as its last hook: `committed`
|
|
992
|
+
* when it completed, `unknown` when it threw or the caller stopped reading
|
|
993
|
+
* its rows. `reportQueryEnding` and `reportExecuteEnding` report how the
|
|
994
|
+
* operation ended, and `onQueryEndOutsideTransaction` turns that into the
|
|
995
|
+
* outcome; family runtimes that override `query` or `execute` call them
|
|
996
|
+
* too, with {@link afterTransactionStageFor}.
|
|
960
997
|
*
|
|
961
998
|
* Concrete subclasses must implement `lower`, `runDriver`, `runExecute`, and
|
|
962
999
|
* `close`.
|
|
@@ -972,7 +1009,12 @@ interface RuntimeCoreOptions<TMiddleware extends RuntimeMiddleware<ExecutionPlan
|
|
|
972
1009
|
declare abstract class RuntimeCore<TPlan extends QueryPlan, TExec extends ExecutionPlan, TMiddleware extends RuntimeMiddleware<TExec>> implements RuntimeExecutor<TPlan> {
|
|
973
1010
|
protected readonly middleware: ReadonlyArray<TMiddleware>;
|
|
974
1011
|
protected readonly ctx: RuntimeMiddlewareContext;
|
|
1012
|
+
protected readonly anyMiddlewareDeclaresAfterTransaction: boolean;
|
|
975
1013
|
constructor(options: RuntimeCoreOptions<TMiddleware>);
|
|
1014
|
+
/**
|
|
1015
|
+
* Returns the function that runs every middleware's `afterTransaction` hook for one operation with a given result, or `undefined` when no middleware declared the hook when the runtime was created.
|
|
1016
|
+
*/
|
|
1017
|
+
protected afterTransactionStageFor(exec: TExec, ctx: RuntimeMiddlewareContext): ((result: AfterTransactionResult) => Promise<void>) | undefined;
|
|
976
1018
|
/**
|
|
977
1019
|
* Pre-lowering hook for plan rewriting. Defaults to identity. Subclasses
|
|
978
1020
|
* may override to run a `beforeCompile` middleware chain (SQL does this
|
|
@@ -1131,5 +1173,5 @@ interface LaneMetaBuilder<K extends OperationKind> extends MetaBuilder<K> {
|
|
|
1131
1173
|
*/
|
|
1132
1174
|
declare function createMetaBuilder<K extends OperationKind>(kind: K, terminalName: string): LaneMetaBuilder<K>;
|
|
1133
1175
|
//#endregion
|
|
1134
|
-
export {
|
|
1135
|
-
//# sourceMappingURL=runtime-
|
|
1176
|
+
export { reportQueryEnding as $, RuntimeCoreOptions as A, ShapeSpec as B, QueryPlan as C, ResultType as D, RelationNamesOf as E, RuntimeMiddlewareContext as F, checkAborted as G, applyMutationDefaults as H, RuntimeMutationDefaultGenerator as I, createMetaBuilder as J, checkMiddlewareCompatibility as K, RuntimeStatementStats as L, RuntimeExecutor as M, RuntimeLog as N, RuntimeAbortedPhase as O, RuntimeMiddleware as P, reportExecuteEnding as Q, Scalars as R, QueryInterceptResult as S, RelationKeys as T, assertAnnotationsApplicable as U, ValidAnnotations as V, assertMutationDefaultGeneratorsAvailable as W, onQueryEndOutsideTransaction as X, defineAnnotation as Y, raceAgainstAbort as Z, MutationDefaultsOp as _, AnnotationValue as a, runtimeAborted as at, ParamRefMutator as b, CrossFamilyMiddleware as c, ExecutionPlan as d, runAfterTransaction as et, GeneratorStability as f, MutationDefaults as g, MutationDefaultGeneratorContributor as h, AnnotationHandle as i, runQueryWithMiddleware as it, RuntimeExecuteOptions as j, RuntimeCore as k, DefineAnnotationOptions as l, MetaBuilder as m, AfterQueryResult as n, runBeforeQueryChain as nt, AppliedMutationDefault as o, LaneMetaBuilder as p, collectMutationDefaultGenerators as q, AfterTransactionResult as r, runExecuteWithMiddleware as rt, AsyncIterableResult as s, AfterExecuteResult as t, runBeforeExecuteChain as tt, ExecuteInterceptResult as u, MutationDefaultsOptions as v, RUNTIME_ABORTED as w, QueryEnding as x, OperationKind as y, Shape as z };
|
|
1177
|
+
//# sourceMappingURL=runtime-NuBiQEuH.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-NuBiQEuH.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/runtime.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;KAqBK;;;;;;;;;;;;UAYK,gBAAgB,SAAS,cAAc;WACtC;WACA;WACA,OAAO;WACP,cAAc,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2C3B,iBAAiB,SAAS,cAAc;GAC/C,OAAO,UAAU,gBAAgB,SAAS;WAClC;WACA,cAAc,YAAY;EACnC,KAAK;aACM;eACE,cAAc;;MAEvB;;;;;;;;;;;;;;;;;;;;;;;;UAwBI,wBAAwB,cAAc;WACrC;WACA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BAWpD,kBAAkB,UAAU,eAAe,MAAM,GAAG,uBAAuB,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-framework",
|
|
3
|
-
"version": "8.0.0-rc.14-dev.
|
|
3
|
+
"version": "8.0.0-rc.14-dev.37",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
"uniku": "^0.5.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@internal/config": "8.0.0-rc.14-dev.
|
|
20
|
-
"@internal/contract": "8.0.0-rc.14-dev.
|
|
21
|
-
"@internal/contract-authoring": "8.0.0-rc.14-dev.
|
|
22
|
-
"@internal/errors": "8.0.0-rc.14-dev.
|
|
23
|
-
"@internal/framework-components": "8.0.0-rc.14-dev.
|
|
24
|
-
"@internal/ids": "8.0.0-rc.14-dev.
|
|
25
|
-
"@internal/operations": "8.0.0-rc.14-dev.
|
|
26
|
-
"@internal/psl-parser": "8.0.0-rc.14-dev.
|
|
27
|
-
"@internal/psl-printer": "8.0.0-rc.14-dev.
|
|
28
|
-
"@internal/ts-render": "8.0.0-rc.14-dev.
|
|
29
|
-
"@repo/tsconfig": "8.0.0-rc.14-dev.
|
|
30
|
-
"@internal/publish-surface": "8.0.0-rc.14-dev.
|
|
31
|
-
"@repo/tsdown": "8.0.0-rc.14-dev.
|
|
32
|
-
"@internal/utils": "8.0.0-rc.14-dev.
|
|
19
|
+
"@internal/config": "8.0.0-rc.14-dev.37",
|
|
20
|
+
"@internal/contract": "8.0.0-rc.14-dev.37",
|
|
21
|
+
"@internal/contract-authoring": "8.0.0-rc.14-dev.37",
|
|
22
|
+
"@internal/errors": "8.0.0-rc.14-dev.37",
|
|
23
|
+
"@internal/framework-components": "8.0.0-rc.14-dev.37",
|
|
24
|
+
"@internal/ids": "8.0.0-rc.14-dev.37",
|
|
25
|
+
"@internal/operations": "8.0.0-rc.14-dev.37",
|
|
26
|
+
"@internal/psl-parser": "8.0.0-rc.14-dev.37",
|
|
27
|
+
"@internal/psl-printer": "8.0.0-rc.14-dev.37",
|
|
28
|
+
"@internal/ts-render": "8.0.0-rc.14-dev.37",
|
|
29
|
+
"@repo/tsconfig": "8.0.0-rc.14-dev.37",
|
|
30
|
+
"@internal/publish-surface": "8.0.0-rc.14-dev.37",
|
|
31
|
+
"@repo/tsdown": "8.0.0-rc.14-dev.37",
|
|
32
|
+
"@internal/utils": "8.0.0-rc.14-dev.37",
|
|
33
33
|
"tsdown": "0.22.14",
|
|
34
34
|
"typescript": "5.9.3",
|
|
35
35
|
"vitest": "5.0.0-rc.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-DynmbuWH.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/runtime.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;KAqBK;;;;;;;;;;;;UAYK,gBAAgB,SAAS,cAAc;WACtC;WACA;WACA,OAAO;WACP,cAAc,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2C3B,iBAAiB,SAAS,cAAc;GAC/C,OAAO,UAAU,gBAAgB,SAAS;WAClC;WACA,cAAc,YAAY;EACnC,KAAK;aACM;eACE,cAAc;;MAEvB;;;;;;;;;;;;;;;;;;;;;;;;UAwBI,wBAAwB,cAAc;WACrC;WACA,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCjB,iBAAiB,mBAAmB,cAAc,eAAe,SAAS,wBAAwB,WAAW,iBAAiB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsDnJ,iBAAiB,UAAU,eAAe,oBAAoB,yBAAyB,gCAAgC,WAAW,KAAK,GAAG,WAAW,sBAAsB,SAAS,SAAS,UA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