@prisma/orm-framework 8.0.0-rc.12-dev.15 → 8.0.0-rc.12-dev.17
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/{hashing-utils-DQgS3nOe.mjs → canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs} +23 -3
- package/dist/canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs.map +1 -0
- 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/contract.d.mts +2 -2
- package/dist/contract.mjs +3 -4
- package/dist/contract__hashing-utils.mjs +1 -2
- package/dist/contract__hashing.d.mts +2 -2
- package/dist/contract__hashing.mjs +2 -2
- package/dist/hashing-BAPc4zoz.d.mts +36 -0
- package/dist/hashing-BAPc4zoz.d.mts.map +1 -0
- package/dist/{hashing-BtIZVNYX.mjs → hashing-CjTNYBuj.mjs} +21 -3
- package/dist/hashing-CjTNYBuj.mjs.map +1 -0
- package/dist/{runtime-Dnv06bEV.d.mts → runtime-CQ9-3czC.d.mts} +52 -2
- package/dist/runtime-CQ9-3czC.d.mts.map +1 -0
- package/dist/{runtime-DXmHIbAr.mjs → runtime-CpojufYS.mjs} +80 -2
- package/dist/{runtime-DXmHIbAr.mjs.map → runtime-CpojufYS.mjs.map} +1 -1
- package/package.json +15 -15
- package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs +0 -25
- package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs.map +0 -1
- package/dist/hashing-BtIZVNYX.mjs.map +0 -1
- package/dist/hashing-WJflm0s1.d.mts +0 -25
- package/dist/hashing-WJflm0s1.d.mts.map +0 -1
- package/dist/hashing-utils-DQgS3nOe.mjs.map +0 -1
- package/dist/runtime-Dnv06bEV.d.mts.map +0 -1
package/dist/{hashing-utils-DQgS3nOe.mjs → canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as isPlainRecord } from "./is-plain-record-CUofyVQ7-DWEzdhIx.mjs";
|
|
2
|
-
//#region ../../../1-framework/0-foundation/contract/dist/
|
|
2
|
+
//#region ../../../1-framework/0-foundation/contract/dist/canonicalization-path-match-D88xLEq6.mjs
|
|
3
3
|
function compareCodeUnits(a, b) {
|
|
4
4
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
5
5
|
}
|
|
@@ -42,7 +42,27 @@ function createStorageSort(targets, compare = compareByNameProperty) {
|
|
|
42
42
|
return result;
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
+
function matchesPathPattern(path, pattern) {
|
|
46
|
+
if (path.length !== pattern.length) return false;
|
|
47
|
+
for (let i = 0; i < pattern.length; i++) {
|
|
48
|
+
const segment = pattern[i];
|
|
49
|
+
const value = path[i];
|
|
50
|
+
if (segment === void 0 || value === void 0) return false;
|
|
51
|
+
if (segment === "*") continue;
|
|
52
|
+
if (typeof segment === "string") {
|
|
53
|
+
if (value !== segment) return false;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (Array.isArray(segment)) {
|
|
57
|
+
if (!segment.includes(value)) return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
function createPreserveEmptyPredicate(patterns) {
|
|
63
|
+
return (path) => patterns.some((pattern) => matchesPathPattern(path, pattern));
|
|
64
|
+
}
|
|
45
65
|
//#endregion
|
|
46
|
-
export { createStorageSort as n, compareByNameProperty as t };
|
|
66
|
+
export { matchesPathPattern as a, createStorageSort as i, compareCodeUnits as n, createPreserveEmptyPredicate as r, compareByNameProperty as t };
|
|
47
67
|
|
|
48
|
-
//# sourceMappingURL=
|
|
68
|
+
//# sourceMappingURL=canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/canonicalization-path-match-D88xLEq6.mjs"],"sourcesContent":["import { t as isPlainRecord } from \"./is-plain-record-CUofyVQ7.mjs\";\n//#region src/canonicalization-storage-sort.ts\nfunction compareCodeUnits(a, b) {\n\treturn a < b ? -1 : a > b ? 1 : 0;\n}\nfunction compareByNameProperty(a, b) {\n\treturn compareCodeUnits(isPlainRecord(a) && typeof a[\"name\"] === \"string\" ? a[\"name\"] : \"\", isPlainRecord(b) && typeof b[\"name\"] === \"string\" ? b[\"name\"] : \"\");\n}\nfunction sortArrayKeysOnRecord(record, arrayKeys, compare) {\n\tconst sorted = { ...record };\n\tfor (const key of arrayKeys) {\n\t\tconst value = record[key];\n\t\tif (Array.isArray(value)) sorted[key] = [...value].sort(compare);\n\t}\n\treturn sorted;\n}\nfunction walkAndSort(node, pathSegments, arrayKeys, compare) {\n\tif (pathSegments.length === 0) {\n\t\tif (!isPlainRecord(node)) return node;\n\t\treturn sortArrayKeysOnRecord(node, arrayKeys, compare);\n\t}\n\tif (!isPlainRecord(node)) return node;\n\tconst [head, ...rest] = pathSegments;\n\tif (head === void 0) return node;\n\tif (head === \"*\") {\n\t\tconst sorted = { ...node };\n\t\tfor (const key of Object.keys(node)) sorted[key] = walkAndSort(node[key], rest, arrayKeys, compare);\n\t\treturn sorted;\n\t}\n\tconst child = node[head];\n\tif (child === void 0) return node;\n\treturn {\n\t\t...node,\n\t\t[head]: walkAndSort(child, rest, arrayKeys, compare)\n\t};\n}\nfunction createStorageSort(targets, compare = compareByNameProperty) {\n\treturn (storage) => {\n\t\tif (!isPlainRecord(storage)) return storage;\n\t\tlet result = storage;\n\t\tfor (const target of targets) result = walkAndSort(result, target.path, target.arrayKeys, compare);\n\t\treturn result;\n\t};\n}\n//#endregion\n//#region src/canonicalization-path-match.ts\nfunction matchesPathPattern(path, pattern) {\n\tif (path.length !== pattern.length) return false;\n\tfor (let i = 0; i < pattern.length; i++) {\n\t\tconst segment = pattern[i];\n\t\tconst value = path[i];\n\t\tif (segment === void 0 || value === void 0) return false;\n\t\tif (segment === \"*\") continue;\n\t\tif (typeof segment === \"string\") {\n\t\t\tif (value !== segment) return false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(segment)) {\n\t\t\tif (!segment.includes(value)) return false;\n\t\t}\n\t}\n\treturn true;\n}\nfunction createPreserveEmptyPredicate(patterns) {\n\treturn (path) => patterns.some((pattern) => matchesPathPattern(path, pattern));\n}\n//#endregion\nexport { createStorageSort as a, compareCodeUnits as i, matchesPathPattern as n, compareByNameProperty as r, createPreserveEmptyPredicate as t };\n\n//# sourceMappingURL=canonicalization-path-match-D88xLEq6.mjs.map"],"mappings":";;AAEA,SAAS,iBAAiB,GAAG,GAAG;CAC/B,OAAO,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI;AACjC;AACA,SAAS,sBAAsB,GAAG,GAAG;CACpC,OAAO,iBAAiB,cAAc,CAAC,KAAK,OAAO,EAAE,YAAY,WAAW,EAAE,UAAU,IAAI,cAAc,CAAC,KAAK,OAAO,EAAE,YAAY,WAAW,EAAE,UAAU,EAAE;AAC/J;AACA,SAAS,sBAAsB,QAAQ,WAAW,SAAS;CAC1D,MAAM,SAAS,EAAE,GAAG,OAAO;CAC3B,KAAK,MAAM,OAAO,WAAW;EAC5B,MAAM,QAAQ,OAAO;EACrB,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,OAAO;CAChE;CACA,OAAO;AACR;AACA,SAAS,YAAY,MAAM,cAAc,WAAW,SAAS;CAC5D,IAAI,aAAa,WAAW,GAAG;EAC9B,IAAI,CAAC,cAAc,IAAI,GAAG,OAAO;EACjC,OAAO,sBAAsB,MAAM,WAAW,OAAO;CACtD;CACA,IAAI,CAAC,cAAc,IAAI,GAAG,OAAO;CACjC,MAAM,CAAC,MAAM,GAAG,QAAQ;CACxB,IAAI,SAAS,KAAK,GAAG,OAAO;CAC5B,IAAI,SAAS,KAAK;EACjB,MAAM,SAAS,EAAE,GAAG,KAAK;EACzB,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI,GAAG,OAAO,OAAO,YAAY,KAAK,MAAM,MAAM,WAAW,OAAO;EAClG,OAAO;CACR;CACA,MAAM,QAAQ,KAAK;CACnB,IAAI,UAAU,KAAK,GAAG,OAAO;CAC7B,OAAO;EACN,GAAG;GACF,OAAO,YAAY,OAAO,MAAM,WAAW,OAAO;CACpD;AACD;AACA,SAAS,kBAAkB,SAAS,UAAU,uBAAuB;CACpE,QAAQ,YAAY;EACnB,IAAI,CAAC,cAAc,OAAO,GAAG,OAAO;EACpC,IAAI,SAAS;EACb,KAAK,MAAM,UAAU,SAAS,SAAS,YAAY,QAAQ,OAAO,MAAM,OAAO,WAAW,OAAO;EACjG,OAAO;CACR;AACD;AAGA,SAAS,mBAAmB,MAAM,SAAS;CAC1C,IAAI,KAAK,WAAW,QAAQ,QAAQ,OAAO;CAC3C,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;EACxC,MAAM,UAAU,QAAQ;EACxB,MAAM,QAAQ,KAAK;EACnB,IAAI,YAAY,KAAK,KAAK,UAAU,KAAK,GAAG,OAAO;EACnD,IAAI,YAAY,KAAK;EACrB,IAAI,OAAO,YAAY,UAAU;GAChC,IAAI,UAAU,SAAS,OAAO;GAC9B;EACD;EACA,IAAI,MAAM,QAAQ,OAAO,GACpB;OAAA,CAAC,QAAQ,SAAS,KAAK,GAAG,OAAO;EAAA;CAEvC;CACA,OAAO;AACR;AACA,SAAS,6BAA6B,UAAU;CAC/C,QAAQ,SAAS,SAAS,MAAM,YAAY,mBAAmB,MAAM,OAAO,CAAC;AAC9E"}
|
package/dist/components.d.mts
CHANGED
|
@@ -16,6 +16,6 @@ import { a as RuntimeDriverDescriptor, c as RuntimeExtensionInstance, d as Runti
|
|
|
16
16
|
import { t as isPlainRecord } from "./is-plain-record-C9BWiqcw.mjs";
|
|
17
17
|
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-CGDgzJPj.mjs";
|
|
18
18
|
import { n as validateExtensionBlock, t as ExtensionBlockRefResolutionContext } from "./psl-ast-Cec7KbOn.mjs";
|
|
19
|
-
import { A as
|
|
19
|
+
import { $ as runExecuteWithMiddleware, A as RuntimeExecuteOptions, B as ValidAnnotations, C as RelationKeys, D as RuntimeCore, E as RuntimeAbortedPhase, F as RuntimeMutationDefaultGenerator, G as checkMiddlewareCompatibility, H as assertAnnotationsApplicable, I as RuntimeStatementStats, J as defineAnnotation, K as collectMutationDefaultGenerators, L as Scalars, M as RuntimeLog, N as RuntimeMiddleware, O as RuntimeCoreOptions, P as RuntimeMiddlewareContext, Q as runBeforeQueryChain, R as Shape, S as RUNTIME_ABORTED, T as ResultType, U as assertMutationDefaultGeneratorsAvailable, V as applyMutationDefaults, W as checkAborted, X as raceAgainstAbort, Y as isRuntimeError, Z as runBeforeExecuteChain, _ as MutationDefaultsOptions, a as AppliedMutationDefault, b as QueryInterceptResult, c as DefineAnnotationOptions, d as GeneratorStability, et as runQueryWithMiddleware, f as LaneMetaBuilder, g as MutationDefaultsOp, h as MutationDefaults, i as AnnotationValue, j as RuntimeExecutor, k as RuntimeErrorEnvelope, l as ExecuteInterceptResult, m as MutationDefaultGeneratorContributor, n as AfterQueryResult, nt as runtimeError, o as AsyncIterableResult, p as MetaBuilder, q as createMetaBuilder, r as AnnotationHandle, s as CrossFamilyMiddleware, t as AfterExecuteResult, tt as runtimeAborted, u as ExecutionPlan, v as OperationKind, w as RelationNamesOf, x as QueryPlan, y as ParamRefMutator, z as ShapeSpec } from "./runtime-CQ9-3czC.mjs";
|
|
20
20
|
import { t as canonicalizeJson } from "./utils-DeWL_zD9.mjs";
|
|
21
|
-
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 AssembledAuthoringContributions, AsyncIterableResult, type AuthoringArgRef, type AuthoringArgumentDescriptor, type AuthoringAttributeSpecContributions, type AuthoringColumnDefaultTemplate, type AuthoringContributions, type AuthoringDataTypeEntry, 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, 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 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, type DataType, type DataTypeAuthoringEntry, type DataTypeId, type DataTypeInvariantInput, type DataTypeLookup, type DataTypeLoweringAuthoringEntry, 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 ExecuteInterceptResult, type ExecutionPlan, type ExecutionStack, type ExecutionStackInstance, type ExpectationFailureReason, type ExtensionBlockRefResolutionContext, type ExtensionDescriptor, type ExtensionInstance, type ExtensionPackRef, type FamilyDescriptor, type FamilyInstance, type FamilyPackRef, type GenerateContractTypesOptions, type IRNode, IRNodeBase, type ImportRequirement, type ImportSpecifierResolver, type IntrospectSchemaResult, type LaneMetaBuilder, type ListCast, type LoweredDefaultResult, type LoweredDefaultValue, 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 MutationDefaultGeneratorDescriptor, 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, ParsePslDocumentInput, ParsePslDocumentResult, type PresetStorageTemplate, PslAttribute, PslAttributeArgument, PslAttributeNamedArgument, PslAttributePositionalArgument, PslAttributeTarget, type PslBlockParam, type PslBlockParamList, type PslBlockParamOption, type PslBlockParamRef, type PslBlockParamValue, PslCompositeType, type PslContractBuildCapable, type PslContractDocument, type PslContractInferCapable, PslDefaultFunctionValue, PslDefaultLiteralValue, PslDefaultValue, PslDiagnostic, type PslDiagnosticCode, PslDocumentAst, type PslExtensionBlock, type PslExtensionBlockAttribute, type PslExtensionBlockAttributeArg, type PslExtensionBlockParamBare, type PslExtensionBlockParamList, type PslExtensionBlockParamOption, type PslExtensionBlockParamRef, type PslExtensionBlockParamScalarValue, type PslExtensionBlockParamValue, type PslExtensionBlockParsedAttribute, 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 RuntimeStatementStats, type RuntimeTargetDescriptor, type RuntimeTargetInstance, 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 SignDatabaseResult, type SingleNamespaceView, type SourceDiagnostic, type SourceSpan, type Storage, type StorageType, TAGGED_LITERAL_MAX_BYTES, TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG, TIMESTAMP_NOW_GENERATOR_ID, type TaggedLiteralCanonicalization, type TaggedLiteralValue, type TargetBoundComponentDescriptor, type TargetDescriptor, type TargetInstance, type TargetMigrationsCapability, type TargetPackRef, 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, assembleAuthoringContributions, assembleAuthoringDataTypes, assembleControlMutationDefaults, assembleDataTypes, assertAnnotationsApplicable, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, assertRuntimeContractRequirementsSatisfied, assertUniqueCodecOwner, buildExtensionLoadOrder, buildNamespacedEntities, buildSingleNamespaceView, canonicalizeJson, canonicalizeTaggedLiteralBody, checkAborted, checkContractComponentRequirements, checkMiddlewareCompatibility, checkUncomposedNamespace, classifyEnumMemberType, collectScalarTypeConstructors, column, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, coordinateKey, createControlStack, createDataTypeLookup, createExecutionStack, createMetaBuilder, dataType, dataTypeId, defineAnnotation, describeTaggedLiteralFailure, diffSchemas, dispositionForCategory, domainElementCoordinates, elementCoordinates, emptyCodecLookup, enforceDataTypeInvariants, entityAt, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, findAuthoringTypeConstructorCall, flatPslCompositeTypes, flatPslModels, flushAuthoringWarnings, freezeNode, getAuthoringFieldPreset, hasMigrations, hasOperationPreview, hasPslContractBuild, hasPslContractInfer, hasRegisteredFieldNamespace, hasSchemaSubjectClassifier, hasSchemaView, hydrateNamespaceEntities, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, instantiateExecutionStack, isAggregateDescriptor, isAnyInputAggregateDescriptor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, isDataTypeLoweringEntry, isLoweringEntryKey, isNoInputAggregateDescriptor, isPlainRecord, isRuntimeError, issueOutcome, keepInternalSpecifiers, loweringEntryKey, makePslNamespace, makePslNamespaceEntries, materializeCodec, mergeAuthoringNamespaces, mergeCapabilityMatrices, namespacePslExtensionBlocks, orderIssuesByDependencies, promoteBuiltinKinds, raceAgainstAbort, renderTsLiteral, resolveAuthoringTemplateValue, resolveCodecDescriptorOrThrow, resolveEnumCodecId, resolvePslBacktickEscapes, resolveRequirementSpecifiers, resolveTemplateTagEscapes, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError, settleAggregateOverloads, storageHashHex, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseTemplate, timestampNowControlDescriptor, validateAuthoringHelperArguments, validateCodecTypeParams, validateExtensionBlock };
|
|
21
|
+
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 AuthoringDataTypeEntry, 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, 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 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, type DataType, type DataTypeAuthoringEntry, type DataTypeId, type DataTypeInvariantInput, type DataTypeLookup, type DataTypeLoweringAuthoringEntry, 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 ExecuteInterceptResult, type ExecutionPlan, type ExecutionStack, type ExecutionStackInstance, type ExpectationFailureReason, type ExtensionBlockRefResolutionContext, type ExtensionDescriptor, type ExtensionInstance, type ExtensionPackRef, type FamilyDescriptor, type FamilyInstance, type FamilyPackRef, type GenerateContractTypesOptions, type GeneratorStability, type IRNode, IRNodeBase, type ImportRequirement, type ImportSpecifierResolver, type IntrospectSchemaResult, type LaneMetaBuilder, type ListCast, type LoweredDefaultResult, type LoweredDefaultValue, 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, ParsePslDocumentInput, ParsePslDocumentResult, type PresetStorageTemplate, PslAttribute, PslAttributeArgument, PslAttributeNamedArgument, PslAttributePositionalArgument, PslAttributeTarget, type PslBlockParam, type PslBlockParamList, type PslBlockParamOption, type PslBlockParamRef, type PslBlockParamValue, PslCompositeType, type PslContractBuildCapable, type PslContractDocument, type PslContractInferCapable, PslDefaultFunctionValue, PslDefaultLiteralValue, PslDefaultValue, PslDiagnostic, type PslDiagnosticCode, PslDocumentAst, type PslExtensionBlock, type PslExtensionBlockAttribute, type PslExtensionBlockAttributeArg, type PslExtensionBlockParamBare, type PslExtensionBlockParamList, type PslExtensionBlockParamOption, type PslExtensionBlockParamRef, type PslExtensionBlockParamScalarValue, type PslExtensionBlockParamValue, type PslExtensionBlockParsedAttribute, 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, 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 SignDatabaseResult, type SingleNamespaceView, type SourceDiagnostic, type SourceSpan, type Storage, type StorageType, TAGGED_LITERAL_MAX_BYTES, TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG, TIMESTAMP_NOW_GENERATOR_ID, type TaggedLiteralCanonicalization, type TaggedLiteralValue, type TargetBoundComponentDescriptor, type TargetDescriptor, type TargetInstance, type TargetMigrationsCapability, type TargetPackRef, 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, buildExtensionLoadOrder, buildNamespacedEntities, buildSingleNamespaceView, canonicalizeJson, canonicalizeTaggedLiteralBody, checkAborted, checkContractComponentRequirements, checkMiddlewareCompatibility, checkUncomposedNamespace, classifyEnumMemberType, collectMutationDefaultGenerators, collectScalarTypeConstructors, column, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, coordinateKey, createControlStack, createDataTypeLookup, createExecutionStack, createMetaBuilder, dataType, dataTypeId, defineAnnotation, describeTaggedLiteralFailure, diffSchemas, dispositionForCategory, domainElementCoordinates, elementCoordinates, emptyCodecLookup, enforceDataTypeInvariants, entityAt, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, findAuthoringTypeConstructorCall, flatPslCompositeTypes, flatPslModels, flushAuthoringWarnings, freezeNode, getAuthoringFieldPreset, hasMigrations, hasOperationPreview, hasPslContractBuild, hasPslContractInfer, hasRegisteredFieldNamespace, hasSchemaSubjectClassifier, hasSchemaView, hydrateNamespaceEntities, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, instantiateExecutionStack, isAggregateDescriptor, isAnyInputAggregateDescriptor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, isDataTypeLoweringEntry, isLoweringEntryKey, isNoInputAggregateDescriptor, isPlainRecord, isRuntimeError, issueOutcome, keepInternalSpecifiers, loweringEntryKey, makePslNamespace, makePslNamespaceEntries, materializeCodec, mergeAuthoringNamespaces, mergeCapabilityMatrices, namespacePslExtensionBlocks, orderIssuesByDependencies, promoteBuiltinKinds, raceAgainstAbort, renderTsLiteral, resolveAuthoringTemplateValue, resolveCodecDescriptorOrThrow, resolveEnumCodecId, resolvePslBacktickEscapes, resolveRequirementSpecifiers, resolveTemplateTagEscapes, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError, settleAggregateOverloads, storageHashHex, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseTemplate, timestampNowControlDescriptor, validateAuthoringHelperArguments, validateCodecTypeParams, validateExtensionBlock };
|
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, l as validateExtensionBlock, 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-DYtFdynZ.mjs";
|
|
17
|
-
import { a as
|
|
18
|
-
export { APP_SPACE_ID, AsyncIterableResult, BUILTIN_PSL_KIND_KEYS, CONTRACT_CODEC_DESCRIPTOR_MISSING, CONTRACT_SNAPSHOTS_DIRNAME, CodecDescriptorImpl, CodecDescriptorTemplateImpl, CodecImpl, IRNodeBase, NamespaceBase, RUNTIME_ABORTED, RelationKeys, RuntimeCore, 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, assembleAuthoringContributions, assembleAuthoringDataTypes, assembleControlMutationDefaults, assembleDataTypes, assertAnnotationsApplicable, assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, assertRuntimeContractRequirementsSatisfied, assertUniqueCodecOwner, buildExtensionLoadOrder, buildNamespacedEntities, buildSingleNamespaceView, canonicalizeJson, canonicalizeTaggedLiteralBody, checkAborted, checkContractComponentRequirements, checkMiddlewareCompatibility, checkUncomposedNamespace, classifyEnumMemberType, collectScalarTypeConstructors, column, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, coordinateKey, createControlStack, createDataTypeLookup, createExecutionStack, createMetaBuilder, dataType, dataTypeId, defineAnnotation, describeTaggedLiteralFailure, diffSchemas, dispositionForCategory, domainElementCoordinates, elementCoordinates, emptyCodecLookup, enforceDataTypeInvariants, entityAt, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, findAuthoringTypeConstructorCall, flatPslCompositeTypes, flatPslModels, flushAuthoringWarnings, freezeNode, getAuthoringFieldPreset, hasMigrations, hasOperationPreview, hasPslContractBuild, hasPslContractInfer, hasRegisteredFieldNamespace, hasSchemaSubjectClassifier, hasSchemaView, hydrateNamespaceEntities, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, instantiateExecutionStack, isAggregateDescriptor, isAnyInputAggregateDescriptor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, isDataTypeLoweringEntry, isLoweringEntryKey, isNoInputAggregateDescriptor, isPlainRecord, isRuntimeError, issueOutcome, keepInternalSpecifiers, loweringEntryKey, makePslNamespace, makePslNamespaceEntries, materializeCodec, mergeAuthoringNamespaces, mergeCapabilityMatrices, namespacePslExtensionBlocks, orderIssuesByDependencies, promoteBuiltinKinds, raceAgainstAbort, renderTsLiteral, resolveAuthoringTemplateValue, resolveCodecDescriptorOrThrow, resolveEnumCodecId, resolvePslBacktickEscapes, resolveRequirementSpecifiers, resolveTemplateTagEscapes, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError, settleAggregateOverloads, storageHashHex, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseTemplate, timestampNowControlDescriptor, validateAuthoringHelperArguments, validateCodecTypeParams, validateExtensionBlock };
|
|
17
|
+
import { _ as runQueryWithMiddleware, a as applyMutationDefaults, c as checkAborted, d as createMetaBuilder, f as defineAnnotation, g as runExecuteWithMiddleware, h as runBeforeQueryChain, i as RuntimeCore, l as checkMiddlewareCompatibility, m as runBeforeExecuteChain, n as RUNTIME_ABORTED, o as assertAnnotationsApplicable, p as raceAgainstAbort, r as RelationKeys, s as assertMutationDefaultGeneratorsAvailable, t as AsyncIterableResult, u as collectMutationDefaultGenerators, v as runtimeAborted } from "./runtime-CpojufYS.mjs";
|
|
18
|
+
export { APP_SPACE_ID, AsyncIterableResult, BUILTIN_PSL_KIND_KEYS, CONTRACT_CODEC_DESCRIPTOR_MISSING, CONTRACT_SNAPSHOTS_DIRNAME, CodecDescriptorImpl, CodecDescriptorTemplateImpl, CodecImpl, IRNodeBase, NamespaceBase, RUNTIME_ABORTED, RelationKeys, RuntimeCore, 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, buildExtensionLoadOrder, buildNamespacedEntities, buildSingleNamespaceView, canonicalizeJson, canonicalizeTaggedLiteralBody, checkAborted, checkContractComponentRequirements, checkMiddlewareCompatibility, checkUncomposedNamespace, classifyEnumMemberType, collectMutationDefaultGenerators, collectScalarTypeConstructors, column, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, coordinateKey, createControlStack, createDataTypeLookup, createExecutionStack, createMetaBuilder, dataType, dataTypeId, defineAnnotation, describeTaggedLiteralFailure, diffSchemas, dispositionForCategory, domainElementCoordinates, elementCoordinates, emptyCodecLookup, enforceDataTypeInvariants, entityAt, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, findAuthoringTypeConstructorCall, flatPslCompositeTypes, flatPslModels, flushAuthoringWarnings, freezeNode, getAuthoringFieldPreset, hasMigrations, hasOperationPreview, hasPslContractBuild, hasPslContractInfer, hasRegisteredFieldNamespace, hasSchemaSubjectClassifier, hasSchemaView, hydrateNamespaceEntities, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, instantiateExecutionStack, isAggregateDescriptor, isAnyInputAggregateDescriptor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, isDataTypeLoweringEntry, isLoweringEntryKey, isNoInputAggregateDescriptor, isPlainRecord, isRuntimeError, issueOutcome, keepInternalSpecifiers, loweringEntryKey, makePslNamespace, makePslNamespaceEntries, materializeCodec, mergeAuthoringNamespaces, mergeCapabilityMatrices, namespacePslExtensionBlocks, orderIssuesByDependencies, promoteBuiltinKinds, raceAgainstAbort, renderTsLiteral, resolveAuthoringTemplateValue, resolveCodecDescriptorOrThrow, resolveEnumCodecId, resolvePslBacktickEscapes, resolveRequirementSpecifiers, resolveTemplateTagEscapes, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError, settleAggregateOverloads, storageHashHex, temporalAuthoringPresets, temporalCodecPreset, temporalPhaseTemplate, timestampNowControlDescriptor, validateAuthoringHelperArguments, validateCodecTypeParams, validateExtensionBlock };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { type AfterExecuteResult, type AfterQueryResult, type AnnotationHandle, type AnnotationValue, AsyncIterableResult, type CrossFamilyMiddleware, type DefineAnnotationOptions, type ExecuteInterceptResult, type ExecutionPlan, type LaneMetaBuilder, type MetaBuilder, 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 RuntimeStatementStats, type Scalars, type Shape, type ShapeSpec, type ValidAnnotations, assertAnnotationsApplicable, checkAborted, checkMiddlewareCompatibility, createMetaBuilder, defineAnnotation, isRuntimeError, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError };
|
|
1
|
+
import { $ as runExecuteWithMiddleware, A as RuntimeExecuteOptions, B as ValidAnnotations, C as RelationKeys, D as RuntimeCore, E as RuntimeAbortedPhase, F as RuntimeMutationDefaultGenerator, G as checkMiddlewareCompatibility, H as assertAnnotationsApplicable, I as RuntimeStatementStats, J as defineAnnotation, K as collectMutationDefaultGenerators, L as Scalars, M as RuntimeLog, N as RuntimeMiddleware, O as RuntimeCoreOptions, P as RuntimeMiddlewareContext, Q as runBeforeQueryChain, R as Shape, S as RUNTIME_ABORTED, T as ResultType, U as assertMutationDefaultGeneratorsAvailable, V as applyMutationDefaults, W as checkAborted, X as raceAgainstAbort, Y as isRuntimeError, Z as runBeforeExecuteChain, _ as MutationDefaultsOptions, a as AppliedMutationDefault, b as QueryInterceptResult, c as DefineAnnotationOptions, d as GeneratorStability, et as runQueryWithMiddleware, f as LaneMetaBuilder, g as MutationDefaultsOp, h as MutationDefaults, i as AnnotationValue, j as RuntimeExecutor, k as RuntimeErrorEnvelope, l as ExecuteInterceptResult, m as MutationDefaultGeneratorContributor, n as AfterQueryResult, nt as runtimeError, o as AsyncIterableResult, p as MetaBuilder, q as createMetaBuilder, r as AnnotationHandle, s as CrossFamilyMiddleware, t as AfterExecuteResult, tt as runtimeAborted, u as ExecutionPlan, v as OperationKind, w as RelationNamesOf, x as QueryPlan, y as ParamRefMutator, z as ShapeSpec } from "./runtime-CQ9-3czC.mjs";
|
|
2
|
+
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 };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as runtimeError, t as isRuntimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
|
|
2
|
-
import { a as
|
|
3
|
-
export { AsyncIterableResult, RUNTIME_ABORTED, RelationKeys, RuntimeCore, assertAnnotationsApplicable, checkAborted, checkMiddlewareCompatibility, createMetaBuilder, defineAnnotation, isRuntimeError, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError };
|
|
2
|
+
import { _ as runQueryWithMiddleware, a as applyMutationDefaults, c as checkAborted, d as createMetaBuilder, f as defineAnnotation, g as runExecuteWithMiddleware, h as runBeforeQueryChain, i as RuntimeCore, l as checkMiddlewareCompatibility, m as runBeforeExecuteChain, n as RUNTIME_ABORTED, o as assertAnnotationsApplicable, p as raceAgainstAbort, r as RelationKeys, s as assertMutationDefaultGeneratorsAvailable, t as AsyncIterableResult, u as collectMutationDefaultGenerators, v as runtimeAborted } from "./runtime-CpojufYS.mjs";
|
|
3
|
+
export { AsyncIterableResult, RUNTIME_ABORTED, RelationKeys, RuntimeCore, applyMutationDefaults, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, createMetaBuilder, defineAnnotation, isRuntimeError, raceAgainstAbort, runBeforeExecuteChain, runBeforeQueryChain, runExecuteWithMiddleware, runQueryWithMiddleware, runtimeAborted, runtimeError };
|
package/dist/contract.d.mts
CHANGED
|
@@ -4,11 +4,11 @@ import { n as soleDomainNamespaceId, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./
|
|
|
4
4
|
import { n as resolveDomainModel, t as ResolvedDomainModel } from "./resolve-domain-model-CBM8n-rX-DYZcbj-r.mjs";
|
|
5
5
|
import { n as domainModelsAtDefaultNamespace, r as domainValueObjectsAtDefaultNamespace, t as ContractExecutionSectionSchema } from "./types-BiXRgK9f.mjs";
|
|
6
6
|
import { a as canonicalizeContract, i as StorageSort, n as PreserveEmptyPredicate, o as canonicalizeContractToObject, r as SerializeContract, t as CanonicalizeContractOptions } from "./canonicalization-BykcD9kZ-DDeZ2c-B.mjs";
|
|
7
|
-
import { n as
|
|
7
|
+
import { i as computeStorageHash, n as computeExecutionHash, r as computeProfileHash, t as buildExecutionSection } from "./hashing-BAPc4zoz.mjs";
|
|
8
8
|
import { t as isPlainRecord } from "./is-plain-record-C9BWiqcw.mjs";
|
|
9
9
|
import { t as applySpecifierDefaultControlPolicy } from "./apply-specifier-default-control-policy-9vsCWnn8.mjs";
|
|
10
10
|
import { n as ContractValidationPhase, t as ContractValidationError } from "./contract-validation-error-R7cMoK04.mjs";
|
|
11
11
|
import { a as EnumValues, c as buildEnumsMapForNamespace, i as EnumMemberNames, l as buildNamespacedEnums, n as EnumAccessor, o as NamespaceEnumAccessors, r as EnumEntriesToAccessors, s as NamespacedEnums, t as ContractEnumAccessor, u as createEnumAccessor } from "./enum-accessor-CCZVzS_f.mjs";
|
|
12
12
|
import { a as compareByNameProperty, c as matchesPathPattern, i as PathSegment$1, n as PathPattern, o as createPreserveEmptyPredicate, r as PathSegment, s as createStorageSort, t as NamedArraySortTarget } from "./hashing-utils-BUU3eFo9.mjs";
|
|
13
13
|
import { n as DomainModelShape, r as validateContractDomain, t as DomainContractShape } from "./validate-domain-DiEWAx3K.mjs";
|
|
14
|
-
export { type $, type ApplicationDomain, type ApplicationDomainNamespace, type Brand, type CanonicalizeContractOptions, type ColumnDefault, type ColumnDefaultLiteralInputValue, type ColumnDefaultLiteralValue, type Contract, type ContractDiscriminator, type ContractEmbedRelation, type ContractEnum, type ContractEnumAccessor, type ContractExecutionSection, ContractExecutionSectionSchema, type ContractField, type ContractFieldType, type ContractManyToManyRelation, type ContractMarkerRecord, type ContractModel, type ContractModelBase, type ContractNonJunctionRelation, type ContractReferenceRelation, type ContractRelation, type ContractRelationOn, type ContractRelationThrough, type ContractToManyRelation, type ContractToOneRelation, ContractValidationError, type ContractValidationPhase, type ContractValueObject, type ContractValueObjectDefinitions, type ContractVariantEntry, type ContractWithDomain, type ControlPolicy, type CrossReference, CrossReferenceSchema, type DocCollection, type DocIndex, type DomainContractShape, type DomainModelShape, type EmbedRelationKeys, type EnumAccessor, type EnumEntriesToAccessors, type EnumMemberNames, type EnumValues, type ExecutionHashBase, type ExecutionMutationDefault, type ExecutionMutationDefaultPhases, type ExecutionMutationDefaultValue, type ExecutionSection, type Expr, type FieldType, type GeneratedValueSpec, type JsonPrimitive, type JsonValue, type LedgerEntryRecord, type ModelStorageBase, type NamedArraySortTarget, type NamespaceEnumAccessors, type NamespaceId, type NamespacedEnums, type PathPattern, type PlanMeta, type PathSegment as PreserveEmptyPathSegment, type PreserveEmptyPredicate, type ProfileHashBase, type ReferenceRelationKeys, type ResolvedDomainModel, type ScalarFieldType, type SerializeContract, type Source, type StorageBase, type StorageEntitySlot, type StorageHashBase, type StorageNamespace, type StorageSort, type PathSegment$1 as StorageSortPathSegment, UNBOUND_DOMAIN_NAMESPACE_ID, type UnionFieldType, type ValueObjectFieldType, type ValueSetRef, applySpecifierDefaultControlPolicy, asNamespaceId, buildEnumsMapForNamespace, buildNamespacedEnums, canonicalizeContract, canonicalizeContractToObject, compareByNameProperty, computeExecutionHash, computeProfileHash, computeStorageHash, coreHash, createEnumAccessor, createPreserveEmptyPredicate, createStorageSort, crossRef, domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace, effectiveControlPolicy, executionHash, isColumnDefault, isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue, isPlainRecord, matchesPathPattern, profileHash, resolveDomainModel, soleDomainNamespaceId, validateContractDomain };
|
|
14
|
+
export { type $, type ApplicationDomain, type ApplicationDomainNamespace, type Brand, type CanonicalizeContractOptions, type ColumnDefault, type ColumnDefaultLiteralInputValue, type ColumnDefaultLiteralValue, type Contract, type ContractDiscriminator, type ContractEmbedRelation, type ContractEnum, type ContractEnumAccessor, type ContractExecutionSection, ContractExecutionSectionSchema, type ContractField, type ContractFieldType, type ContractManyToManyRelation, type ContractMarkerRecord, type ContractModel, type ContractModelBase, type ContractNonJunctionRelation, type ContractReferenceRelation, type ContractRelation, type ContractRelationOn, type ContractRelationThrough, type ContractToManyRelation, type ContractToOneRelation, ContractValidationError, type ContractValidationPhase, type ContractValueObject, type ContractValueObjectDefinitions, type ContractVariantEntry, type ContractWithDomain, type ControlPolicy, type CrossReference, CrossReferenceSchema, type DocCollection, type DocIndex, type DomainContractShape, type DomainModelShape, type EmbedRelationKeys, type EnumAccessor, type EnumEntriesToAccessors, type EnumMemberNames, type EnumValues, type ExecutionHashBase, type ExecutionMutationDefault, type ExecutionMutationDefaultPhases, type ExecutionMutationDefaultValue, type ExecutionSection, type Expr, type FieldType, type GeneratedValueSpec, type JsonPrimitive, type JsonValue, type LedgerEntryRecord, type ModelStorageBase, type NamedArraySortTarget, type NamespaceEnumAccessors, type NamespaceId, type NamespacedEnums, type PathPattern, type PlanMeta, type PathSegment as PreserveEmptyPathSegment, type PreserveEmptyPredicate, type ProfileHashBase, type ReferenceRelationKeys, type ResolvedDomainModel, type ScalarFieldType, type SerializeContract, type Source, type StorageBase, type StorageEntitySlot, type StorageHashBase, type StorageNamespace, type StorageSort, type PathSegment$1 as StorageSortPathSegment, UNBOUND_DOMAIN_NAMESPACE_ID, type UnionFieldType, type ValueObjectFieldType, type ValueSetRef, applySpecifierDefaultControlPolicy, asNamespaceId, buildEnumsMapForNamespace, buildExecutionSection, buildNamespacedEnums, canonicalizeContract, canonicalizeContractToObject, compareByNameProperty, computeExecutionHash, computeProfileHash, computeStorageHash, coreHash, createEnumAccessor, createPreserveEmptyPredicate, createStorageSort, crossRef, domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace, effectiveControlPolicy, executionHash, isColumnDefault, isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue, isPlainRecord, matchesPathPattern, profileHash, resolveDomainModel, soleDomainNamespaceId, validateContractDomain };
|
package/dist/contract.mjs
CHANGED
|
@@ -2,12 +2,11 @@ import { t as applySpecifierDefaultControlPolicy } from "./apply-specifier-defau
|
|
|
2
2
|
import { t as ContractValidationError } from "./contract-validation-error-DEiWp_EI-CRwtUgRw.mjs";
|
|
3
3
|
import { r as soleDomainNamespaceId, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./default-namespace-D4vCwkXg-BEZbN38y.mjs";
|
|
4
4
|
import { n as buildNamespacedEnums, r as createEnumAccessor, t as buildEnumsMapForNamespace } from "./enum-accessor-Db5DaTNX.mjs";
|
|
5
|
-
import { n as matchesPathPattern, t as createPreserveEmptyPredicate } from "./canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs";
|
|
6
5
|
import { t as isPlainRecord } from "./is-plain-record-CUofyVQ7-DWEzdhIx.mjs";
|
|
7
|
-
import { a as
|
|
8
|
-
import { n as
|
|
6
|
+
import { a as matchesPathPattern, i as createStorageSort, r as createPreserveEmptyPredicate, t as compareByNameProperty } from "./canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs";
|
|
7
|
+
import { a as computeProfileHash, i as computeExecutionHash, n as canonicalizeContract, o as computeStorageHash, r as canonicalizeContractToObject, t as buildExecutionSection } from "./hashing-CjTNYBuj.mjs";
|
|
9
8
|
import { t as resolveDomainModel } from "./resolve-domain-model-BovPAsW2-8rwyzjxp.mjs";
|
|
10
9
|
import { t as asNamespaceId } from "./namespace-id-asbWpwMw-3yxn-tRe.mjs";
|
|
11
10
|
import { a as domainModelsAtDefaultNamespace, c as executionHash, d as isExecutionMutationDefaultValue, f as profileHash, i as crossRef, l as isColumnDefault, n as CrossReferenceSchema, o as domainValueObjectsAtDefaultNamespace, r as coreHash, s as effectiveControlPolicy, t as ContractExecutionSectionSchema, u as isColumnDefaultLiteralInputValue } from "./types-QyibIZST.mjs";
|
|
12
11
|
import { t as validateContractDomain } from "./validate-domain-CaT6wlDH.mjs";
|
|
13
|
-
export { ContractExecutionSectionSchema, ContractValidationError, CrossReferenceSchema, UNBOUND_DOMAIN_NAMESPACE_ID, applySpecifierDefaultControlPolicy, asNamespaceId, buildEnumsMapForNamespace, buildNamespacedEnums, canonicalizeContract, canonicalizeContractToObject, compareByNameProperty, computeExecutionHash, computeProfileHash, computeStorageHash, coreHash, createEnumAccessor, createPreserveEmptyPredicate, createStorageSort, crossRef, domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace, effectiveControlPolicy, executionHash, isColumnDefault, isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue, isPlainRecord, matchesPathPattern, profileHash, resolveDomainModel, soleDomainNamespaceId, validateContractDomain };
|
|
12
|
+
export { ContractExecutionSectionSchema, ContractValidationError, CrossReferenceSchema, UNBOUND_DOMAIN_NAMESPACE_ID, applySpecifierDefaultControlPolicy, asNamespaceId, buildEnumsMapForNamespace, buildExecutionSection, buildNamespacedEnums, canonicalizeContract, canonicalizeContractToObject, compareByNameProperty, computeExecutionHash, computeProfileHash, computeStorageHash, coreHash, createEnumAccessor, createPreserveEmptyPredicate, createStorageSort, crossRef, domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace, effectiveControlPolicy, executionHash, isColumnDefault, isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue, isPlainRecord, matchesPathPattern, profileHash, resolveDomainModel, soleDomainNamespaceId, validateContractDomain };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as createStorageSort, t as compareByNameProperty } from "./hashing-utils-DQgS3nOe.mjs";
|
|
1
|
+
import { a as matchesPathPattern, i as createStorageSort, r as createPreserveEmptyPredicate, t as compareByNameProperty } from "./canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs";
|
|
3
2
|
export { compareByNameProperty, createPreserveEmptyPredicate, createStorageSort, matchesPathPattern };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as canonicalizeContract, i as StorageSort, n as PreserveEmptyPredicate, o as canonicalizeContractToObject, r as SerializeContract, t as CanonicalizeContractOptions } from "./canonicalization-BykcD9kZ-DDeZ2c-B.mjs";
|
|
2
|
-
import { n as
|
|
3
|
-
export { type CanonicalizeContractOptions, type PreserveEmptyPredicate, type SerializeContract, type StorageSort, canonicalizeContract, canonicalizeContractToObject, computeExecutionHash, computeProfileHash, computeStorageHash };
|
|
2
|
+
import { i as computeStorageHash, n as computeExecutionHash, r as computeProfileHash, t as buildExecutionSection } from "./hashing-BAPc4zoz.mjs";
|
|
3
|
+
export { type CanonicalizeContractOptions, type PreserveEmptyPredicate, type SerializeContract, type StorageSort, buildExecutionSection, canonicalizeContract, canonicalizeContractToObject, computeExecutionHash, computeProfileHash, computeStorageHash };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { canonicalizeContract, canonicalizeContractToObject, computeExecutionHash, computeProfileHash, computeStorageHash };
|
|
1
|
+
import { a as computeProfileHash, i as computeExecutionHash, n as canonicalizeContract, o as computeStorageHash, r as canonicalizeContractToObject, t as buildExecutionSection } from "./hashing-CjTNYBuj.mjs";
|
|
2
|
+
export { buildExecutionSection, canonicalizeContract, canonicalizeContractToObject, computeExecutionHash, computeProfileHash, computeStorageHash };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { K as ProfileHashBase, M as ExecutionHashBase, N as ExecutionMutationDefault, Q as StorageHashBase } from "./domain-envelope-gHv58hD1-B8mta2A6.mjs";
|
|
2
|
+
import { n as ContractExecutionSection } from "./contract-types-Cdqr65a--BsYwlpQo.mjs";
|
|
3
|
+
import { i as StorageSort, n as PreserveEmptyPredicate } from "./canonicalization-BykcD9kZ-DDeZ2c-B.mjs";
|
|
4
|
+
//#region ../../../1-framework/0-foundation/contract/dist/hashing.d.mts
|
|
5
|
+
//#region src/build-execution-section.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Builds a contract's `execution` section from its mutation defaults: sorted by namespace, entry and field in UTF-16 code-unit order, and hashed for the target. Every authoring path calls this, so they emit the same section and hash for the same defaults.
|
|
8
|
+
*/
|
|
9
|
+
declare function buildExecutionSection(input: {
|
|
10
|
+
readonly target: string;
|
|
11
|
+
readonly targetFamily: string;
|
|
12
|
+
readonly defaults: ReadonlyArray<ExecutionMutationDefault>;
|
|
13
|
+
}): ContractExecutionSection | undefined;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/hashing.d.ts
|
|
16
|
+
type ComputeStorageHashArgs = {
|
|
17
|
+
target: string;
|
|
18
|
+
targetFamily: string;
|
|
19
|
+
storage: Record<string, unknown>;
|
|
20
|
+
readonly shouldPreserveEmpty?: PreserveEmptyPredicate;
|
|
21
|
+
readonly sortStorage?: StorageSort;
|
|
22
|
+
};
|
|
23
|
+
declare function computeStorageHash(args: ComputeStorageHashArgs): StorageHashBase<string>;
|
|
24
|
+
declare function computeExecutionHash(args: {
|
|
25
|
+
target: string;
|
|
26
|
+
targetFamily: string;
|
|
27
|
+
execution: Record<string, unknown>;
|
|
28
|
+
}): ExecutionHashBase<string>;
|
|
29
|
+
declare function computeProfileHash(args: {
|
|
30
|
+
target: string;
|
|
31
|
+
targetFamily: string;
|
|
32
|
+
capabilities: Record<string, Record<string, boolean>>;
|
|
33
|
+
}): ProfileHashBase<string>;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { computeStorageHash as i, computeExecutionHash as n, computeProfileHash as r, buildExecutionSection as t };
|
|
36
|
+
//# sourceMappingURL=hashing-BAPc4zoz.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hashing-BAPc4zoz.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/hashing.d.mts"],"mappings":";;;;;;;;iBAOiB,sBAAsB;WAC5B;WACA;WACA,UAAU,cAAc;IAC/B;;;KAGC;EACH;EACA;EACA,SAAS;WACA,sBAAsB;WACtB,cAAc;;iBAER,mBAAmB,MAAM,yBAAyB;iBAClD,qBAAqB;EACpC;EACA;EACA,WAAW;IACT;iBACa,mBAAmB;EAClC;EACA;EACA,cAAc,eAAe;IAC3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as castAs, t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
2
|
import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
|
|
3
|
-
import { n as matchesPathPattern } from "./canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs";
|
|
4
3
|
import { t as isPlainRecord } from "./is-plain-record-CUofyVQ7-DWEzdhIx.mjs";
|
|
4
|
+
import { a as matchesPathPattern, n as compareCodeUnits } from "./canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs";
|
|
5
5
|
import { t as isArrayEqual } from "./array-equal-28xupwIB.mjs";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
//#region ../../../1-framework/0-foundation/contract/dist/hashing.mjs
|
|
@@ -193,7 +193,25 @@ function computeExecutionHash(args) {
|
|
|
193
193
|
function computeProfileHash(args) {
|
|
194
194
|
return blindCast(sha256(hashContract(args)));
|
|
195
195
|
}
|
|
196
|
+
function compareRefs(a, b) {
|
|
197
|
+
return compareCodeUnits(a.ref.namespace, b.ref.namespace) || compareCodeUnits(a.ref.entry, b.ref.entry) || compareCodeUnits(a.ref.field, b.ref.field);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Builds a contract's `execution` section from its mutation defaults: sorted by namespace, entry and field in UTF-16 code-unit order, and hashed for the target. Every authoring path calls this, so they emit the same section and hash for the same defaults.
|
|
201
|
+
*/
|
|
202
|
+
function buildExecutionSection(input) {
|
|
203
|
+
if (input.defaults.length === 0) return;
|
|
204
|
+
const execution = { mutations: { defaults: [...input.defaults].sort(compareRefs) } };
|
|
205
|
+
return {
|
|
206
|
+
executionHash: computeExecutionHash({
|
|
207
|
+
target: input.target,
|
|
208
|
+
targetFamily: input.targetFamily,
|
|
209
|
+
execution
|
|
210
|
+
}),
|
|
211
|
+
...execution
|
|
212
|
+
};
|
|
213
|
+
}
|
|
196
214
|
//#endregion
|
|
197
|
-
export {
|
|
215
|
+
export { computeProfileHash as a, computeExecutionHash as i, canonicalizeContract as n, computeStorageHash as o, canonicalizeContractToObject as r, buildExecutionSection as t };
|
|
198
216
|
|
|
199
|
-
//# sourceMappingURL=hashing-
|
|
217
|
+
//# sourceMappingURL=hashing-CjTNYBuj.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hashing-CjTNYBuj.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/hashing.mjs"],"sourcesContent":["import { t as isPlainRecord } from \"./is-plain-record-CUofyVQ7.mjs\";\nimport { i as compareCodeUnits, n as matchesPathPattern } from \"./canonicalization-path-match-D88xLEq6.mjs\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { createHash } from \"node:crypto\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\n//#region src/canonicalization.ts\nconst DOMAIN_NAMESPACE_SLOT_PATTERN = [\n\t\"domain\",\n\t\"namespaces\",\n\t\"*\"\n];\nconst DOMAIN_MODELS_CONTAINER_PATTERN = [\n\t\"domain\",\n\t\"namespaces\",\n\t\"*\",\n\t\"models\"\n];\nconst DOMAIN_MODEL_RELATIONS_PATTERN = [\n\t\"domain\",\n\t\"namespaces\",\n\t\"*\",\n\t\"models\",\n\t\"*\",\n\t\"relations\"\n];\nconst DOMAIN_MODEL_STORAGE_PATTERN = [\n\t\"domain\",\n\t\"namespaces\",\n\t\"*\",\n\t\"models\",\n\t\"*\",\n\t\"storage\"\n];\nconst STORAGE_NAMESPACE_ENTRIES_PATTERN = [\n\t\"storage\",\n\t\"namespaces\",\n\t\"*\",\n\t\"entries\"\n];\nconst TOP_LEVEL_ORDER = [\n\t\"schemaVersion\",\n\t\"canonicalVersion\",\n\t\"targetFamily\",\n\t\"target\",\n\t\"profileHash\",\n\t\"roots\",\n\t\"domain\",\n\t\"storage\",\n\t\"execution\",\n\t\"capabilities\",\n\t\"extensions\",\n\t\"defaultControlPolicy\",\n\t\"meta\"\n];\nfunction isDefaultValue(value) {\n\tif (value === false) return true;\n\tif (value === null) return false;\n\tif (Array.isArray(value) && value.length === 0) return true;\n\tif (typeof value === \"object\" && value !== null) return Object.keys(value).length === 0;\n\treturn false;\n}\nfunction omitDefaults(obj, path, shouldPreserveEmpty) {\n\tif (obj === null || typeof obj !== \"object\") return obj;\n\tif (Array.isArray(obj)) return obj.map((item) => omitDefaults(item, path, shouldPreserveEmpty));\n\tconst result = {};\n\tfor (const [key, value] of Object.entries(obj)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (key === \"_generated\") continue;\n\t\tif (key === \"generated\" && value === false) continue;\n\t\tif ((key === \"onDelete\" || key === \"onUpdate\") && value === \"noAction\") continue;\n\t\tif (isDefaultValue(value)) {\n\t\t\tconst isRequiredDomainNamespaces = isArrayEqual(currentPath, [\"domain\", \"namespaces\"]);\n\t\t\tconst isDomainNamespaceSlot = matchesPathPattern(currentPath, DOMAIN_NAMESPACE_SLOT_PATTERN);\n\t\t\tconst isRequiredDomainModels = matchesPathPattern(currentPath, DOMAIN_MODELS_CONTAINER_PATTERN);\n\t\t\tconst isRequiredStorageNamespaces = isArrayEqual(currentPath, [\"storage\", \"namespaces\"]);\n\t\t\tconst isStorageNamespaceEntries = matchesPathPattern(currentPath, STORAGE_NAMESPACE_ENTRIES_PATTERN);\n\t\t\tconst isRequiredRoots = isArrayEqual(currentPath, [\"roots\"]);\n\t\t\tconst isRequiredExtensions = isArrayEqual(currentPath, [\"extensions\"]);\n\t\t\tconst isRequiredCapabilities = isArrayEqual(currentPath, [\"capabilities\"]);\n\t\t\tconst isRequiredMeta = isArrayEqual(currentPath, [\"meta\"]);\n\t\t\tconst isRequiredExecutionDefaults = isArrayEqual(currentPath, [\n\t\t\t\t\"execution\",\n\t\t\t\t\"mutations\",\n\t\t\t\t\"defaults\"\n\t\t\t]);\n\t\t\tconst isExtensionNamespace = currentPath.length === 2 && currentPath[0] === \"extensions\";\n\t\t\tconst isModelRelations = matchesPathPattern(currentPath, DOMAIN_MODEL_RELATIONS_PATTERN);\n\t\t\tconst isModelStorage = matchesPathPattern(currentPath, DOMAIN_MODEL_STORAGE_PATTERN);\n\t\t\tconst isNullableField = key === \"nullable\";\n\t\t\tconst isFamilyPreserved = shouldPreserveEmpty?.(currentPath) ?? false;\n\t\t\tif (!isRequiredDomainNamespaces && !isDomainNamespaceSlot && !isRequiredDomainModels && !isRequiredStorageNamespaces && !isStorageNamespaceEntries && !isRequiredRoots && !isRequiredExtensions && !isRequiredCapabilities && !isRequiredMeta && !isRequiredExecutionDefaults && !isExtensionNamespace && !isModelRelations && !isModelStorage && !isNullableField && !isFamilyPreserved) continue;\n\t\t}\n\t\tresult[key] = omitDefaults(value, currentPath, shouldPreserveEmpty);\n\t}\n\treturn result;\n}\nfunction sortObjectKeys(obj) {\n\tif (obj === null || typeof obj !== \"object\") return obj;\n\tif (Array.isArray(obj)) return obj.map((item) => sortObjectKeys(item));\n\tconst sorted = {};\n\tconst keys = Object.keys(obj).sort();\n\tfor (const key of keys) sorted[key] = sortObjectKeys(obj[key]);\n\treturn sorted;\n}\nfunction orderTopLevel(obj) {\n\tconst ordered = {};\n\tconst remaining = new Set(Object.keys(obj));\n\tfor (const key of TOP_LEVEL_ORDER) if (remaining.has(key)) {\n\t\tordered[key] = obj[key];\n\t\tremaining.delete(key);\n\t}\n\tfor (const key of Array.from(remaining).sort()) ordered[key] = obj[key];\n\treturn ordered;\n}\n/**\n* Object-form variant of {@link canonicalizeContract}. Exported because the\n* emitter writes the canonical contract through a separate JSON-stringify\n* pass and consumes the structured object directly.\n*/\nfunction canonicalizeContractToObject(contract, options) {\n\tconst serialized = options.serializeContract(contract);\n\tconst withDefaultsOmitted = omitDefaults({\n\t\t...ifDefined(\"schemaVersion\", options.schemaVersion),\n\t\ttargetFamily: serialized[\"targetFamily\"],\n\t\ttarget: serialized[\"target\"],\n\t\tprofileHash: serialized[\"profileHash\"],\n\t\troots: serialized[\"roots\"],\n\t\tdomain: serialized[\"domain\"],\n\t\tstorage: serialized[\"storage\"],\n\t\t...ifDefined(\"execution\", serialized[\"execution\"]),\n\t\textensions: serialized[\"extensions\"],\n\t\tcapabilities: serialized[\"capabilities\"],\n\t\t...ifDefined(\"defaultControlPolicy\", serialized[\"defaultControlPolicy\"]),\n\t\tmeta: serialized[\"meta\"]\n\t}, [], options.shouldPreserveEmpty);\n\treturn orderTopLevel(sortObjectKeys(options.sortStorage ? {\n\t\t...withDefaultsOmitted,\n\t\tstorage: options.sortStorage(withDefaultsOmitted[\"storage\"])\n\t} : withDefaultsOmitted));\n}\nfunction canonicalizeContract(contract, options) {\n\treturn JSON.stringify(canonicalizeContractToObject(contract, options), null, 2);\n}\n//#endregion\n//#region src/hashing.ts\nconst SCHEMA_VERSION = \"1\";\nfunction omitNamespaceKindsForHash(storage) {\n\tif (!isPlainRecord(storage)) return storage;\n\tconst namespaces = storage[\"namespaces\"];\n\tif (!isPlainRecord(namespaces)) return storage;\n\tconst stripped = {};\n\tfor (const [nsId, ns] of Object.entries(namespaces)) if (isPlainRecord(ns)) {\n\t\tconst { kind: _kind, ...rest } = ns;\n\t\tstripped[nsId] = rest;\n\t} else stripped[nsId] = ns;\n\treturn {\n\t\t...storage,\n\t\tnamespaces: stripped\n\t};\n}\nfunction sha256(content) {\n\tconst hash = createHash(\"sha256\");\n\thash.update(content);\n\treturn hash.digest(\"hex\");\n}\nfunction hashContract(section) {\n\tconst { shouldPreserveEmpty, sortStorage, ...sectionData } = section;\n\tconst storageForHash = omitNamespaceKindsForHash(sectionData[\"storage\"] ?? {});\n\treturn canonicalizeContract(blindCast({\n\t\ttargetFamily: sectionData[\"targetFamily\"],\n\t\ttarget: sectionData[\"target\"],\n\t\troots: {},\n\t\tdomain: { namespaces: {} },\n\t\texecution: sectionData[\"execution\"],\n\t\textensions: {},\n\t\tcapabilities: sectionData[\"capabilities\"] ?? {},\n\t\tmeta: {},\n\t\tprofileHash: \"\",\n\t\t...sectionData,\n\t\tstorage: storageForHash\n\t}), {\n\t\tschemaVersion: SCHEMA_VERSION,\n\t\tserializeContract: (c) => castAs(JSON.parse(JSON.stringify(c))),\n\t\t...ifDefined(\"shouldPreserveEmpty\", shouldPreserveEmpty),\n\t\t...ifDefined(\"sortStorage\", sortStorage)\n\t});\n}\nfunction computeStorageHash(args) {\n\treturn blindCast(sha256(hashContract(args)));\n}\nfunction computeExecutionHash(args) {\n\treturn blindCast(sha256(hashContract(args)));\n}\nfunction computeProfileHash(args) {\n\treturn blindCast(sha256(hashContract(args)));\n}\n//#endregion\n//#region src/build-execution-section.ts\nfunction compareRefs(a, b) {\n\treturn compareCodeUnits(a.ref.namespace, b.ref.namespace) || compareCodeUnits(a.ref.entry, b.ref.entry) || compareCodeUnits(a.ref.field, b.ref.field);\n}\n/**\n* Builds a contract's `execution` section from its mutation defaults: sorted by namespace, entry and field in UTF-16 code-unit order, and hashed for the target. Every authoring path calls this, so they emit the same section and hash for the same defaults.\n*/\nfunction buildExecutionSection(input) {\n\tif (input.defaults.length === 0) return;\n\tconst execution = { mutations: { defaults: [...input.defaults].sort(compareRefs) } };\n\treturn {\n\t\texecutionHash: computeExecutionHash({\n\t\t\ttarget: input.target,\n\t\t\ttargetFamily: input.targetFamily,\n\t\t\texecution\n\t\t}),\n\t\t...execution\n\t};\n}\n//#endregion\nexport { buildExecutionSection, canonicalizeContract, canonicalizeContractToObject, computeExecutionHash, computeProfileHash, computeStorageHash };\n\n//# sourceMappingURL=hashing.mjs.map"],"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AAE,WAAW,EAAE,UAAU,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,KAAK,WAAW,EAAE,EAAE;CACnF,OAAO;EACN,eAAe,qBAAqB;GACnC,QAAQ,MAAM;GACd,cAAc,MAAM;GACpB;EACD,CAAC;EACD,GAAG;CACJ;AACD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { G as PlanMeta } from "./domain-envelope-gHv58hD1-B8mta2A6.mjs";
|
|
2
|
+
import { n as ContractExecutionSection } from "./contract-types-Cdqr65a--BsYwlpQo.mjs";
|
|
2
3
|
import { a as CodecCallContext } from "./codec-types-C4Bx6jXr-C2MBP0-0.mjs";
|
|
3
4
|
//#region ../../../1-framework/1-core/framework-components/dist/runtime.d.mts
|
|
4
5
|
//#region src/annotations.d.ts
|
|
@@ -721,6 +722,55 @@ declare function runBeforeQueryChain<TExec extends ExecutionPlan, TMutator exten
|
|
|
721
722
|
*/
|
|
722
723
|
declare function runBeforeExecuteChain<TExec extends ExecutionPlan, TMutator extends ParamRefMutator = ParamRefMutator>(plan: TExec, middleware: ReadonlyArray<RuntimeMiddleware<TExec, TMutator>>, ctx: RuntimeMiddlewareContext, paramsMutator?: TMutator): Promise<void>;
|
|
723
724
|
//#endregion
|
|
725
|
+
//#region src/execution/mutation-defaults.d.ts
|
|
726
|
+
/**
|
|
727
|
+
* Scope across which a generator's value is constant.
|
|
728
|
+
*
|
|
729
|
+
* - `'field'` — one value per defaulting site (one field of one record). Cache strategy: no cache; call per defaulting site. Right for per-record identifiers (UUIDs, CUIDs, ULIDs, nanoid, ksuid).
|
|
730
|
+
* - `'row'` — one value across all defaulting sites of one record of one operation. Cache strategy: per-call cache keyed by generator id. Right for correlation ids stamped into several fields of one record.
|
|
731
|
+
* - `'query'` — one value across all records and fields of one ORM operation. Cache strategy: caller-provided cache keyed by generator id. Right for `timestampNow` (a single timestamp per bulk create or update).
|
|
732
|
+
*/
|
|
733
|
+
type GeneratorStability = 'field' | 'row' | 'query';
|
|
734
|
+
interface RuntimeMutationDefaultGenerator {
|
|
735
|
+
readonly id: string;
|
|
736
|
+
readonly generate: (params?: Record<string, unknown>) => unknown;
|
|
737
|
+
/**
|
|
738
|
+
* Scope across which the generator's value is constant. The framework derives the cache strategy from this declaration; generator authors never need to know about cache keys. See `GeneratorStability` for the per-value semantics.
|
|
739
|
+
*/
|
|
740
|
+
readonly stability: GeneratorStability;
|
|
741
|
+
}
|
|
742
|
+
/** A runtime component (target, adapter, or extension) that may contribute generators. */
|
|
743
|
+
interface MutationDefaultGeneratorContributor {
|
|
744
|
+
readonly id: string;
|
|
745
|
+
readonly mutationDefaultGenerators?: () => ReadonlyArray<RuntimeMutationDefaultGenerator>;
|
|
746
|
+
}
|
|
747
|
+
type MutationDefaultsOp = 'create' | 'update';
|
|
748
|
+
interface MutationDefaultsOptions {
|
|
749
|
+
readonly op: MutationDefaultsOp;
|
|
750
|
+
/** Required: refs are namespace-scoped, so only defaults of `(namespace, entry)` apply, which tells same-named entries in different namespaces apart. */
|
|
751
|
+
readonly namespace: string;
|
|
752
|
+
readonly entry: string;
|
|
753
|
+
/** The values the caller writes. A key present here is explicit, whatever its value, and gets no default. */
|
|
754
|
+
readonly values: Readonly<Record<string, unknown>>;
|
|
755
|
+
/** Cache shared by the calls of one ORM operation, for `'query'`-stable generators. */
|
|
756
|
+
readonly defaultValueCache?: Map<string, unknown>;
|
|
757
|
+
}
|
|
758
|
+
interface AppliedMutationDefault {
|
|
759
|
+
readonly field: string;
|
|
760
|
+
readonly value: unknown;
|
|
761
|
+
}
|
|
762
|
+
interface MutationDefaults {
|
|
763
|
+
applyMutationDefaults(options: MutationDefaultsOptions): ReadonlyArray<AppliedMutationDefault>;
|
|
764
|
+
}
|
|
765
|
+
/** Registers every generator the contributors provide, by id. Two contributors providing one id is an error naming both. */
|
|
766
|
+
declare function collectMutationDefaultGenerators(contributors: ReadonlyArray<MutationDefaultGeneratorContributor>): ReadonlyMap<string, RuntimeMutationDefaultGenerator>;
|
|
767
|
+
/** Fails when the contract's mutation defaults name a generator the registry does not hold, listing every missing id. */
|
|
768
|
+
declare function assertMutationDefaultGeneratorsAvailable(execution: ContractExecutionSection | undefined, generatorRegistry: ReadonlyMap<string, RuntimeMutationDefaultGenerator>): void;
|
|
769
|
+
/**
|
|
770
|
+
* 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.
|
|
771
|
+
*/
|
|
772
|
+
declare function applyMutationDefaults(execution: ContractExecutionSection | undefined, generatorRegistry: ReadonlyMap<string, RuntimeMutationDefaultGenerator>, options: MutationDefaultsOptions): ReadonlyArray<AppliedMutationDefault>;
|
|
773
|
+
//#endregion
|
|
724
774
|
//#region src/shared/runtime-error.d.ts
|
|
725
775
|
interface RuntimeErrorEnvelope extends Error {
|
|
726
776
|
readonly code: string;
|
|
@@ -1096,5 +1146,5 @@ interface LaneMetaBuilder<K extends OperationKind> extends MetaBuilder<K> {
|
|
|
1096
1146
|
*/
|
|
1097
1147
|
declare function createMetaBuilder<K extends OperationKind>(kind: K, terminalName: string): LaneMetaBuilder<K>;
|
|
1098
1148
|
//#endregion
|
|
1099
|
-
export {
|
|
1100
|
-
//# sourceMappingURL=runtime-
|
|
1149
|
+
export { runExecuteWithMiddleware as $, RuntimeExecuteOptions as A, ValidAnnotations as B, RelationKeys as C, RuntimeCore as D, RuntimeAbortedPhase as E, RuntimeMutationDefaultGenerator as F, checkMiddlewareCompatibility as G, assertAnnotationsApplicable as H, RuntimeStatementStats as I, defineAnnotation as J, collectMutationDefaultGenerators as K, Scalars as L, RuntimeLog as M, RuntimeMiddleware as N, RuntimeCoreOptions as O, RuntimeMiddlewareContext as P, runBeforeQueryChain as Q, Shape as R, RUNTIME_ABORTED as S, ResultType as T, assertMutationDefaultGeneratorsAvailable as U, applyMutationDefaults as V, checkAborted as W, raceAgainstAbort as X, isRuntimeError as Y, runBeforeExecuteChain as Z, MutationDefaultsOptions as _, AppliedMutationDefault as a, QueryInterceptResult as b, DefineAnnotationOptions as c, GeneratorStability as d, runQueryWithMiddleware as et, LaneMetaBuilder as f, MutationDefaultsOp as g, MutationDefaults as h, AnnotationValue as i, RuntimeExecutor as j, RuntimeErrorEnvelope as k, ExecuteInterceptResult as l, MutationDefaultGeneratorContributor as m, AfterQueryResult as n, runtimeError as nt, AsyncIterableResult as o, MetaBuilder as p, createMetaBuilder as q, AnnotationHandle as r, CrossFamilyMiddleware as s, AfterExecuteResult as t, runtimeAborted as tt, ExecutionPlan as u, OperationKind as v, RelationNamesOf as w, QueryPlan as x, ParamRefMutator as y, ShapeSpec as z };
|
|
1150
|
+
//# sourceMappingURL=runtime-CQ9-3czC.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-CQ9-3czC.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/runtime.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;KAoBK;;;;;;;;;;;;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,UAAU,QAAQ,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;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AAQ,YAAY,QAAQ,eAAe;WACrD,WAAW,aAAa;IAC/B,KAAK,QAAQ,IAAI,QAAQ,QAAQ;KAChC,kBAAkB,GAAG,QAAQ,cAAc,QAAQ;WAC7C,WAAW;IAClB,eAAe,gBAAgB,WAAW;KACzC,WAAW,MAAM,KAAK,gBAAgB,OAAO,KAAK,KAAK;KACvD,SAAS,GAAG,KAAK,sBAAsB,mBAAmB,IAAI,WAAW;KACzE,QAAQ,QAAQ,WAAW,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiC5B,YAAY,UAAU;EAC9B,SAAS,GAAG,cAAc,eAAe,YAAY,UAAU,QAAQ,gBAAgB,GAAG;;;;;;;;;;;;UAYlF,gBAAgB,UAAU,uBAAuB,YAAY;WAC5D,aAAa,oBAAoB,yBAAyB;;;;;;;;;;;iBAWpD,kBAAkB,UAAU,eAAe,MAAM,GAAG,uBAAuB,gBAAgB"}
|
|
@@ -360,6 +360,84 @@ async function runBeforeChain(plan, middleware, ctx, paramsMutator, phase, selec
|
|
|
360
360
|
if (work !== void 0) await raceAgainstAbort(Promise.resolve(work), ctx.signal, phase);
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
+
/** Registers every generator the contributors provide, by id. Two contributors providing one id is an error naming both. */
|
|
364
|
+
function collectMutationDefaultGenerators(contributors) {
|
|
365
|
+
const generators = /* @__PURE__ */ new Map();
|
|
366
|
+
const owners = /* @__PURE__ */ new Map();
|
|
367
|
+
for (const contributor of contributors) {
|
|
368
|
+
const nextGenerators = contributor.mutationDefaultGenerators?.() ?? [];
|
|
369
|
+
for (const generator of nextGenerators) {
|
|
370
|
+
const existingOwner = owners.get(generator.id);
|
|
371
|
+
if (existingOwner !== void 0) throw runtimeError("RUNTIME.DUPLICATE_MUTATION_DEFAULT_GENERATOR", `Duplicate mutation default generator '${generator.id}'.`, {
|
|
372
|
+
id: generator.id,
|
|
373
|
+
existingOwner,
|
|
374
|
+
incomingOwner: contributor.id
|
|
375
|
+
});
|
|
376
|
+
generators.set(generator.id, generator);
|
|
377
|
+
owners.set(generator.id, contributor.id);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return generators;
|
|
381
|
+
}
|
|
382
|
+
/** Fails when the contract's mutation defaults name a generator the registry does not hold, listing every missing id. */
|
|
383
|
+
function assertMutationDefaultGeneratorsAvailable(execution, generatorRegistry) {
|
|
384
|
+
const defaults = execution?.mutations.defaults ?? [];
|
|
385
|
+
if (defaults.length === 0) return;
|
|
386
|
+
const missing = /* @__PURE__ */ new Set();
|
|
387
|
+
for (const mutationDefault of defaults) for (const phase of [mutationDefault.onCreate, mutationDefault.onUpdate]) {
|
|
388
|
+
if (!phase) continue;
|
|
389
|
+
if (phase.kind === "generator" && !generatorRegistry.has(phase.id)) missing.add(phase.id);
|
|
390
|
+
}
|
|
391
|
+
if (missing.size === 0) return;
|
|
392
|
+
const ids = Array.from(missing);
|
|
393
|
+
throw runtimeError("RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING", `Contract requires mutation default generator(s) ${ids.map((id) => `'${id}'`).join(", ")}, but no runtime component provides them.`, { ids });
|
|
394
|
+
}
|
|
395
|
+
function computeExecutionDefaultValue(spec, generatorRegistry) {
|
|
396
|
+
const generator = generatorRegistry.get(spec.id);
|
|
397
|
+
if (!generator) throw runtimeError("RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING", `Contract references mutation default generator '${spec.id}' but no runtime component provides it.`, { id: spec.id });
|
|
398
|
+
return generator.generate(spec.params);
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* 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.
|
|
402
|
+
*/
|
|
403
|
+
function applyMutationDefaults(execution, generatorRegistry, options) {
|
|
404
|
+
const defaults = execution?.mutations.defaults ?? [];
|
|
405
|
+
if (defaults.length === 0) return [];
|
|
406
|
+
const isEmptyUpdate = options.op === "update" && Object.keys(options.values).length === 0;
|
|
407
|
+
const applied = [];
|
|
408
|
+
const appliedFields = /* @__PURE__ */ new Set();
|
|
409
|
+
const rowCache = /* @__PURE__ */ new Map();
|
|
410
|
+
for (const mutationDefault of defaults) {
|
|
411
|
+
if (mutationDefault.ref.entry !== options.entry) continue;
|
|
412
|
+
if (mutationDefault.ref.namespace !== options.namespace) continue;
|
|
413
|
+
const defaultSpec = options.op === "create" ? mutationDefault.onCreate : mutationDefault.onUpdate;
|
|
414
|
+
if (!defaultSpec) continue;
|
|
415
|
+
if (isEmptyUpdate) continue;
|
|
416
|
+
const fieldName = mutationDefault.ref.field;
|
|
417
|
+
if (Object.hasOwn(options.values, fieldName) || appliedFields.has(fieldName)) continue;
|
|
418
|
+
applied.push({
|
|
419
|
+
field: fieldName,
|
|
420
|
+
value: resolveScopedValue(defaultSpec, generatorRegistry, rowCache, options.defaultValueCache)
|
|
421
|
+
});
|
|
422
|
+
appliedFields.add(fieldName);
|
|
423
|
+
}
|
|
424
|
+
return applied;
|
|
425
|
+
}
|
|
426
|
+
function resolveScopedValue(spec, generatorRegistry, rowCache, queryCache) {
|
|
427
|
+
const cache = scopedCache(generatorRegistry.get(spec.id)?.stability, rowCache, queryCache);
|
|
428
|
+
if (!cache) return computeExecutionDefaultValue(spec, generatorRegistry);
|
|
429
|
+
if (cache.has(spec.id)) return cache.get(spec.id);
|
|
430
|
+
const value = computeExecutionDefaultValue(spec, generatorRegistry);
|
|
431
|
+
cache.set(spec.id, value);
|
|
432
|
+
return value;
|
|
433
|
+
}
|
|
434
|
+
function scopedCache(stability, rowCache, queryCache) {
|
|
435
|
+
switch (stability) {
|
|
436
|
+
case "row": return rowCache;
|
|
437
|
+
case "query": return queryCache;
|
|
438
|
+
default: return;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
363
441
|
/**
|
|
364
442
|
* Drives a single query execution of `runDriver()` through the middleware
|
|
365
443
|
* lifecycle's `interceptQuery` + row-source + termination phases.
|
|
@@ -670,6 +748,6 @@ function createMetaBuilder(kind, terminalName) {
|
|
|
670
748
|
return new MetaBuilderImpl(kind, terminalName);
|
|
671
749
|
}
|
|
672
750
|
//#endregion
|
|
673
|
-
export {
|
|
751
|
+
export { runQueryWithMiddleware as _, applyMutationDefaults as a, checkAborted as c, createMetaBuilder as d, defineAnnotation as f, runExecuteWithMiddleware as g, runBeforeQueryChain as h, RuntimeCore as i, checkMiddlewareCompatibility as l, runBeforeExecuteChain as m, RUNTIME_ABORTED as n, assertAnnotationsApplicable as o, raceAgainstAbort as p, RelationKeys as r, assertMutationDefaultGeneratorsAvailable as s, AsyncIterableResult as t, collectMutationDefaultGenerators as u, runtimeAborted as v };
|
|
674
752
|
|
|
675
|
-
//# sourceMappingURL=runtime-
|
|
753
|
+
//# sourceMappingURL=runtime-CpojufYS.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-DXmHIbAr.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/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, assertAnnotationsApplicable, checkAborted, checkMiddlewareCompatibility, createMetaBuilder, defineAnnotation, isRuntimeError, raceAgainstAbort, runBeforeExecuteChain, runBeforeQuery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,qBAAqB,WAAW,SAAS,8CAA8C,gBAAgB,IAAI;EACjR,YAAY,WAAW;EACvB,oBAAoB,WAAW;EAC/B;CACD,CAAC;CACD,IAAI,WAAW,aAAa,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-CpojufYS.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. */\nfunction assertMutationDefaultGeneratorsAvailable(execution, generatorRegistry) {\n\tconst defaults = execution?.mutations.defaults ?? [];\n\tif (defaults.length === 0) return;\n\tconst missing = /* @__PURE__ */ new Set();\n\tfor (const mutationDefault of defaults) for (const phase of [mutationDefault.onCreate, mutationDefault.onUpdate]) {\n\t\tif (!phase) continue;\n\t\tif (phase.kind === \"generator\" && !generatorRegistry.has(phase.id)) missing.add(phase.id);\n\t}\n\tif (missing.size === 0) return;\n\tconst ids = Array.from(missing);\n\tthrow runtimeError(\"RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING\", `Contract requires mutation default generator(s) ${ids.map((id) => `'${id}'`).join(\", \")}, but no runtime component provides them.`, { ids });\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 provides it.`, { 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,CAAC;CACH;AACD;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,4BAA4B,aAAa,MAAM,cAAc;CACrE,KAAK,MAAM,cAAc,aAAa,IAAI,CAAC,WAAW,aAAa,IAAI,IAAI,GAAG,MAAM,aAAa,mCAAmC,eAAe,WAAW,UAAU,0BAA0B,KAAK,2BAA2B,aAAa,8CAA8C,MAAM,KAAK,WAAW,YAAY,CAAC,CAAC,KAAK,MA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K,KAAK,WAAW,aAAa,KAAK,GAAG,MAAM,aAAa,mCAAmC,eAAe,WAAW,KAAK,wBAAwB,WAAW,SAAS,qBAAqB;EAC3N,YAAY,WAAW;EACvB,UAAU,WAAW;CACtB,CAAC;CACD,IAAI,WAAW,aAAa,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;CACD,IAAI,WAAW,aAAa,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-framework",
|
|
3
|
-
"version": "8.0.0-rc.12-dev.
|
|
3
|
+
"version": "8.0.0-rc.12-dev.17",
|
|
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.12-dev.
|
|
20
|
-
"@internal/contract": "8.0.0-rc.12-dev.
|
|
21
|
-
"@internal/contract-authoring": "8.0.0-rc.12-dev.
|
|
22
|
-
"@internal/errors": "8.0.0-rc.12-dev.
|
|
23
|
-
"@internal/framework-components": "8.0.0-rc.12-dev.
|
|
24
|
-
"@internal/ids": "8.0.0-rc.12-dev.
|
|
25
|
-
"@internal/operations": "8.0.0-rc.12-dev.
|
|
26
|
-
"@internal/psl-parser": "8.0.0-rc.12-dev.
|
|
27
|
-
"@internal/psl-printer": "8.0.0-rc.12-dev.
|
|
28
|
-
"@internal/ts-render": "8.0.0-rc.12-dev.
|
|
29
|
-
"@repo/tsconfig": "8.0.0-rc.12-dev.
|
|
30
|
-
"@internal/publish-surface": "8.0.0-rc.12-dev.
|
|
31
|
-
"@repo/tsdown": "8.0.0-rc.12-dev.
|
|
32
|
-
"@internal/utils": "8.0.0-rc.12-dev.
|
|
19
|
+
"@internal/config": "8.0.0-rc.12-dev.17",
|
|
20
|
+
"@internal/contract": "8.0.0-rc.12-dev.17",
|
|
21
|
+
"@internal/contract-authoring": "8.0.0-rc.12-dev.17",
|
|
22
|
+
"@internal/errors": "8.0.0-rc.12-dev.17",
|
|
23
|
+
"@internal/framework-components": "8.0.0-rc.12-dev.17",
|
|
24
|
+
"@internal/ids": "8.0.0-rc.12-dev.17",
|
|
25
|
+
"@internal/operations": "8.0.0-rc.12-dev.17",
|
|
26
|
+
"@internal/psl-parser": "8.0.0-rc.12-dev.17",
|
|
27
|
+
"@internal/psl-printer": "8.0.0-rc.12-dev.17",
|
|
28
|
+
"@internal/ts-render": "8.0.0-rc.12-dev.17",
|
|
29
|
+
"@repo/tsconfig": "8.0.0-rc.12-dev.17",
|
|
30
|
+
"@internal/publish-surface": "8.0.0-rc.12-dev.17",
|
|
31
|
+
"@repo/tsdown": "8.0.0-rc.12-dev.17",
|
|
32
|
+
"@internal/utils": "8.0.0-rc.12-dev.17",
|
|
33
33
|
"tsdown": "0.22.14",
|
|
34
34
|
"typescript": "5.9.3",
|
|
35
35
|
"vitest": "5.0.0-rc.2"
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region ../../../1-framework/0-foundation/contract/dist/canonicalization-path-match-CNgHuwM_.mjs
|
|
2
|
-
function matchesPathPattern(path, pattern) {
|
|
3
|
-
if (path.length !== pattern.length) return false;
|
|
4
|
-
for (let i = 0; i < pattern.length; i++) {
|
|
5
|
-
const segment = pattern[i];
|
|
6
|
-
const value = path[i];
|
|
7
|
-
if (segment === void 0 || value === void 0) return false;
|
|
8
|
-
if (segment === "*") continue;
|
|
9
|
-
if (typeof segment === "string") {
|
|
10
|
-
if (value !== segment) return false;
|
|
11
|
-
continue;
|
|
12
|
-
}
|
|
13
|
-
if (Array.isArray(segment)) {
|
|
14
|
-
if (!segment.includes(value)) return false;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
function createPreserveEmptyPredicate(patterns) {
|
|
20
|
-
return (path) => patterns.some((pattern) => matchesPathPattern(path, pattern));
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { matchesPathPattern as n, createPreserveEmptyPredicate as t };
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/canonicalization-path-match-CNgHuwM_.mjs"],"sourcesContent":["//#region src/canonicalization-path-match.ts\nfunction matchesPathPattern(path, pattern) {\n\tif (path.length !== pattern.length) return false;\n\tfor (let i = 0; i < pattern.length; i++) {\n\t\tconst segment = pattern[i];\n\t\tconst value = path[i];\n\t\tif (segment === void 0 || value === void 0) return false;\n\t\tif (segment === \"*\") continue;\n\t\tif (typeof segment === \"string\") {\n\t\t\tif (value !== segment) return false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(segment)) {\n\t\t\tif (!segment.includes(value)) return false;\n\t\t}\n\t}\n\treturn true;\n}\nfunction createPreserveEmptyPredicate(patterns) {\n\treturn (path) => patterns.some((pattern) => matchesPathPattern(path, pattern));\n}\n//#endregion\nexport { matchesPathPattern as n, createPreserveEmptyPredicate as t };\n\n//# sourceMappingURL=canonicalization-path-match-CNgHuwM_.mjs.map"],"mappings":";AACA,SAAS,mBAAmB,MAAM,SAAS;CAC1C,IAAI,KAAK,WAAW,QAAQ,QAAQ,OAAO;CAC3C,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;EACxC,MAAM,UAAU,QAAQ;EACxB,MAAM,QAAQ,KAAK;EACnB,IAAI,YAAY,KAAK,KAAK,UAAU,KAAK,GAAG,OAAO;EACnD,IAAI,YAAY,KAAK;EACrB,IAAI,OAAO,YAAY,UAAU;GAChC,IAAI,UAAU,SAAS,OAAO;GAC9B;EACD;EACA,IAAI,MAAM,QAAQ,OAAO,GACpB;OAAA,CAAC,QAAQ,SAAS,KAAK,GAAG,OAAO;EAAA;CAEvC;CACA,OAAO;AACR;AACA,SAAS,6BAA6B,UAAU;CAC/C,QAAQ,SAAS,SAAS,MAAM,YAAY,mBAAmB,MAAM,OAAO,CAAC;AAC9E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hashing-BtIZVNYX.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/hashing.mjs"],"sourcesContent":["import { n as matchesPathPattern } from \"./canonicalization-path-match-CNgHuwM_.mjs\";\nimport { t as isPlainRecord } from \"./is-plain-record-CUofyVQ7.mjs\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { createHash } from \"node:crypto\";\n//#region src/canonicalization.ts\nconst DOMAIN_NAMESPACE_SLOT_PATTERN = [\n\t\"domain\",\n\t\"namespaces\",\n\t\"*\"\n];\nconst DOMAIN_MODELS_CONTAINER_PATTERN = [\n\t\"domain\",\n\t\"namespaces\",\n\t\"*\",\n\t\"models\"\n];\nconst DOMAIN_MODEL_RELATIONS_PATTERN = [\n\t\"domain\",\n\t\"namespaces\",\n\t\"*\",\n\t\"models\",\n\t\"*\",\n\t\"relations\"\n];\nconst DOMAIN_MODEL_STORAGE_PATTERN = [\n\t\"domain\",\n\t\"namespaces\",\n\t\"*\",\n\t\"models\",\n\t\"*\",\n\t\"storage\"\n];\nconst STORAGE_NAMESPACE_ENTRIES_PATTERN = [\n\t\"storage\",\n\t\"namespaces\",\n\t\"*\",\n\t\"entries\"\n];\nconst TOP_LEVEL_ORDER = [\n\t\"schemaVersion\",\n\t\"canonicalVersion\",\n\t\"targetFamily\",\n\t\"target\",\n\t\"profileHash\",\n\t\"roots\",\n\t\"domain\",\n\t\"storage\",\n\t\"execution\",\n\t\"capabilities\",\n\t\"extensions\",\n\t\"defaultControlPolicy\",\n\t\"meta\"\n];\nfunction isDefaultValue(value) {\n\tif (value === false) return true;\n\tif (value === null) return false;\n\tif (Array.isArray(value) && value.length === 0) return true;\n\tif (typeof value === \"object\" && value !== null) return Object.keys(value).length === 0;\n\treturn false;\n}\nfunction omitDefaults(obj, path, shouldPreserveEmpty) {\n\tif (obj === null || typeof obj !== \"object\") return obj;\n\tif (Array.isArray(obj)) return obj.map((item) => omitDefaults(item, path, shouldPreserveEmpty));\n\tconst result = {};\n\tfor (const [key, value] of Object.entries(obj)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (key === \"_generated\") continue;\n\t\tif (key === \"generated\" && value === false) continue;\n\t\tif ((key === \"onDelete\" || key === \"onUpdate\") && value === \"noAction\") continue;\n\t\tif (isDefaultValue(value)) {\n\t\t\tconst isRequiredDomainNamespaces = isArrayEqual(currentPath, [\"domain\", \"namespaces\"]);\n\t\t\tconst isDomainNamespaceSlot = matchesPathPattern(currentPath, DOMAIN_NAMESPACE_SLOT_PATTERN);\n\t\t\tconst isRequiredDomainModels = matchesPathPattern(currentPath, DOMAIN_MODELS_CONTAINER_PATTERN);\n\t\t\tconst isRequiredStorageNamespaces = isArrayEqual(currentPath, [\"storage\", \"namespaces\"]);\n\t\t\tconst isStorageNamespaceEntries = matchesPathPattern(currentPath, STORAGE_NAMESPACE_ENTRIES_PATTERN);\n\t\t\tconst isRequiredRoots = isArrayEqual(currentPath, [\"roots\"]);\n\t\t\tconst isRequiredExtensions = isArrayEqual(currentPath, [\"extensions\"]);\n\t\t\tconst isRequiredCapabilities = isArrayEqual(currentPath, [\"capabilities\"]);\n\t\t\tconst isRequiredMeta = isArrayEqual(currentPath, [\"meta\"]);\n\t\t\tconst isRequiredExecutionDefaults = isArrayEqual(currentPath, [\n\t\t\t\t\"execution\",\n\t\t\t\t\"mutations\",\n\t\t\t\t\"defaults\"\n\t\t\t]);\n\t\t\tconst isExtensionNamespace = currentPath.length === 2 && currentPath[0] === \"extensions\";\n\t\t\tconst isModelRelations = matchesPathPattern(currentPath, DOMAIN_MODEL_RELATIONS_PATTERN);\n\t\t\tconst isModelStorage = matchesPathPattern(currentPath, DOMAIN_MODEL_STORAGE_PATTERN);\n\t\t\tconst isNullableField = key === \"nullable\";\n\t\t\tconst isFamilyPreserved = shouldPreserveEmpty?.(currentPath) ?? false;\n\t\t\tif (!isRequiredDomainNamespaces && !isDomainNamespaceSlot && !isRequiredDomainModels && !isRequiredStorageNamespaces && !isStorageNamespaceEntries && !isRequiredRoots && !isRequiredExtensions && !isRequiredCapabilities && !isRequiredMeta && !isRequiredExecutionDefaults && !isExtensionNamespace && !isModelRelations && !isModelStorage && !isNullableField && !isFamilyPreserved) continue;\n\t\t}\n\t\tresult[key] = omitDefaults(value, currentPath, shouldPreserveEmpty);\n\t}\n\treturn result;\n}\nfunction sortObjectKeys(obj) {\n\tif (obj === null || typeof obj !== \"object\") return obj;\n\tif (Array.isArray(obj)) return obj.map((item) => sortObjectKeys(item));\n\tconst sorted = {};\n\tconst keys = Object.keys(obj).sort();\n\tfor (const key of keys) sorted[key] = sortObjectKeys(obj[key]);\n\treturn sorted;\n}\nfunction orderTopLevel(obj) {\n\tconst ordered = {};\n\tconst remaining = new Set(Object.keys(obj));\n\tfor (const key of TOP_LEVEL_ORDER) if (remaining.has(key)) {\n\t\tordered[key] = obj[key];\n\t\tremaining.delete(key);\n\t}\n\tfor (const key of Array.from(remaining).sort()) ordered[key] = obj[key];\n\treturn ordered;\n}\n/**\n* Object-form variant of {@link canonicalizeContract}. Exported because the\n* emitter writes the canonical contract through a separate JSON-stringify\n* pass and consumes the structured object directly.\n*/\nfunction canonicalizeContractToObject(contract, options) {\n\tconst serialized = options.serializeContract(contract);\n\tconst withDefaultsOmitted = omitDefaults({\n\t\t...ifDefined(\"schemaVersion\", options.schemaVersion),\n\t\ttargetFamily: serialized[\"targetFamily\"],\n\t\ttarget: serialized[\"target\"],\n\t\tprofileHash: serialized[\"profileHash\"],\n\t\troots: serialized[\"roots\"],\n\t\tdomain: serialized[\"domain\"],\n\t\tstorage: serialized[\"storage\"],\n\t\t...ifDefined(\"execution\", serialized[\"execution\"]),\n\t\textensions: serialized[\"extensions\"],\n\t\tcapabilities: serialized[\"capabilities\"],\n\t\t...ifDefined(\"defaultControlPolicy\", serialized[\"defaultControlPolicy\"]),\n\t\tmeta: serialized[\"meta\"]\n\t}, [], options.shouldPreserveEmpty);\n\treturn orderTopLevel(sortObjectKeys(options.sortStorage ? {\n\t\t...withDefaultsOmitted,\n\t\tstorage: options.sortStorage(withDefaultsOmitted[\"storage\"])\n\t} : withDefaultsOmitted));\n}\nfunction canonicalizeContract(contract, options) {\n\treturn JSON.stringify(canonicalizeContractToObject(contract, options), null, 2);\n}\n//#endregion\n//#region src/hashing.ts\nconst SCHEMA_VERSION = \"1\";\nfunction omitNamespaceKindsForHash(storage) {\n\tif (!isPlainRecord(storage)) return storage;\n\tconst namespaces = storage[\"namespaces\"];\n\tif (!isPlainRecord(namespaces)) return storage;\n\tconst stripped = {};\n\tfor (const [nsId, ns] of Object.entries(namespaces)) if (isPlainRecord(ns)) {\n\t\tconst { kind: _kind, ...rest } = ns;\n\t\tstripped[nsId] = rest;\n\t} else stripped[nsId] = ns;\n\treturn {\n\t\t...storage,\n\t\tnamespaces: stripped\n\t};\n}\nfunction sha256(content) {\n\tconst hash = createHash(\"sha256\");\n\thash.update(content);\n\treturn hash.digest(\"hex\");\n}\nfunction hashContract(section) {\n\tconst { shouldPreserveEmpty, sortStorage, ...sectionData } = section;\n\tconst storageForHash = omitNamespaceKindsForHash(sectionData[\"storage\"] ?? {});\n\treturn canonicalizeContract(blindCast({\n\t\ttargetFamily: sectionData[\"targetFamily\"],\n\t\ttarget: sectionData[\"target\"],\n\t\troots: {},\n\t\tdomain: { namespaces: {} },\n\t\texecution: sectionData[\"execution\"],\n\t\textensions: {},\n\t\tcapabilities: sectionData[\"capabilities\"] ?? {},\n\t\tmeta: {},\n\t\tprofileHash: \"\",\n\t\t...sectionData,\n\t\tstorage: storageForHash\n\t}), {\n\t\tschemaVersion: SCHEMA_VERSION,\n\t\tserializeContract: (c) => castAs(JSON.parse(JSON.stringify(c))),\n\t\t...ifDefined(\"shouldPreserveEmpty\", shouldPreserveEmpty),\n\t\t...ifDefined(\"sortStorage\", sortStorage)\n\t});\n}\nfunction computeStorageHash(args) {\n\treturn blindCast(sha256(hashContract(args)));\n}\nfunction computeExecutionHash(args) {\n\treturn blindCast(sha256(hashContract(args)));\n}\nfunction computeProfileHash(args) {\n\treturn blindCast(sha256(hashContract(args)));\n}\n//#endregion\nexport { canonicalizeContract, canonicalizeContractToObject, computeExecutionHash, computeProfileHash, computeStorageHash };\n\n//# sourceMappingURL=hashing.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,gCAAgC;CACrC;CACA;CACA;AACD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ACA,SAAS,OAAO,SAAS;CACxB,MAAM,OAAO,WAAW,QAAQ;CAChC,KAAK,OAAO,OAAO;CACnB,OAAO,KAAK,OAAO,KAAK;AACzB;AACA,SAAS,aAAa,SAAS;CAC9B,MAAM,EAAE,qBAAqB,aAAa,GAAG,gBAAgB;CAC7D,MAAM,iBAAiB,0BAA0B,YAAY,cAAc,CAAC,CAAC;CAC7E,OAAO,qBAAqB,UAAU;EACrC,cAAc,YAAY;EAC1B,QAAQ,YAAY;EACpB,OAAO,CAAC;EACR,QAAQ,EAAE,YAAY,CAAC,EAAE;EACzB,WAAW,YAAY;EACvB,YAAY,CAAC;EACb,cAAc,YAAY,mBAAmB,CAAC;EAC9C,MAAM,CAAC;EACP,aAAa;EACb,GAAG;EACH,SAAS;CACV,CAAC,GAAG;EACH,eAAe;EACf,oBAAoB,MAAM,OAAO,KAAK,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC;EAC9D,GAAG,UAAU,uBAAuB,mBAAmB;EACvD,GAAG,UAAU,eAAe,WAAW;CACxC,CAAC;AACF;AACA,SAAS,mBAAmB,MAAM;CACjC,OAAO,UAAU,OAAO,aAAa,IAAI,CAAC,CAAC;AAC5C;AACA,SAAS,qBAAqB,MAAM;CACnC,OAAO,UAAU,OAAO,aAAa,IAAI,CAAC,CAAC;AAC5C;AACA,SAAS,mBAAmB,MAAM;CACjC,OAAO,UAAU,OAAO,aAAa,IAAI,CAAC,CAAC;AAC5C"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { K as ProfileHashBase, M as ExecutionHashBase, Q as StorageHashBase } from "./domain-envelope-gHv58hD1-B8mta2A6.mjs";
|
|
2
|
-
import { i as StorageSort, n as PreserveEmptyPredicate } from "./canonicalization-BykcD9kZ-DDeZ2c-B.mjs";
|
|
3
|
-
//#region ../../../1-framework/0-foundation/contract/dist/hashing.d.mts
|
|
4
|
-
//#region src/hashing.d.ts
|
|
5
|
-
type ComputeStorageHashArgs = {
|
|
6
|
-
target: string;
|
|
7
|
-
targetFamily: string;
|
|
8
|
-
storage: Record<string, unknown>;
|
|
9
|
-
readonly shouldPreserveEmpty?: PreserveEmptyPredicate;
|
|
10
|
-
readonly sortStorage?: StorageSort;
|
|
11
|
-
};
|
|
12
|
-
declare function computeStorageHash(args: ComputeStorageHashArgs): StorageHashBase<string>;
|
|
13
|
-
declare function computeExecutionHash(args: {
|
|
14
|
-
target: string;
|
|
15
|
-
targetFamily: string;
|
|
16
|
-
execution: Record<string, unknown>;
|
|
17
|
-
}): ExecutionHashBase<string>;
|
|
18
|
-
declare function computeProfileHash(args: {
|
|
19
|
-
target: string;
|
|
20
|
-
targetFamily: string;
|
|
21
|
-
capabilities: Record<string, Record<string, boolean>>;
|
|
22
|
-
}): ProfileHashBase<string>;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { computeProfileHash as n, computeStorageHash as r, computeExecutionHash as t };
|
|
25
|
-
//# sourceMappingURL=hashing-WJflm0s1.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hashing-WJflm0s1.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/hashing.d.mts"],"mappings":";;;;KAGK;EACH;EACA;EACA,SAAS;WACA,sBAAsB;WACtB,cAAc;;iBAER,mBAAmB,MAAM,yBAAyB;iBAClD,qBAAqB;EACpC;EACA;EACA,WAAW;IACT;iBACa,mBAAmB;EAClC;EACA;EACA,cAAc,eAAe;IAC3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hashing-utils-DQgS3nOe.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/hashing-utils.mjs"],"sourcesContent":["import { n as matchesPathPattern, t as createPreserveEmptyPredicate } from \"./canonicalization-path-match-CNgHuwM_.mjs\";\nimport { t as isPlainRecord } from \"./is-plain-record-CUofyVQ7.mjs\";\n//#region src/canonicalization-storage-sort.ts\nfunction compareCodeUnits(a, b) {\n\treturn a < b ? -1 : a > b ? 1 : 0;\n}\nfunction compareByNameProperty(a, b) {\n\treturn compareCodeUnits(isPlainRecord(a) && typeof a[\"name\"] === \"string\" ? a[\"name\"] : \"\", isPlainRecord(b) && typeof b[\"name\"] === \"string\" ? b[\"name\"] : \"\");\n}\nfunction sortArrayKeysOnRecord(record, arrayKeys, compare) {\n\tconst sorted = { ...record };\n\tfor (const key of arrayKeys) {\n\t\tconst value = record[key];\n\t\tif (Array.isArray(value)) sorted[key] = [...value].sort(compare);\n\t}\n\treturn sorted;\n}\nfunction walkAndSort(node, pathSegments, arrayKeys, compare) {\n\tif (pathSegments.length === 0) {\n\t\tif (!isPlainRecord(node)) return node;\n\t\treturn sortArrayKeysOnRecord(node, arrayKeys, compare);\n\t}\n\tif (!isPlainRecord(node)) return node;\n\tconst [head, ...rest] = pathSegments;\n\tif (head === void 0) return node;\n\tif (head === \"*\") {\n\t\tconst sorted = { ...node };\n\t\tfor (const key of Object.keys(node)) sorted[key] = walkAndSort(node[key], rest, arrayKeys, compare);\n\t\treturn sorted;\n\t}\n\tconst child = node[head];\n\tif (child === void 0) return node;\n\treturn {\n\t\t...node,\n\t\t[head]: walkAndSort(child, rest, arrayKeys, compare)\n\t};\n}\nfunction createStorageSort(targets, compare = compareByNameProperty) {\n\treturn (storage) => {\n\t\tif (!isPlainRecord(storage)) return storage;\n\t\tlet result = storage;\n\t\tfor (const target of targets) result = walkAndSort(result, target.path, target.arrayKeys, compare);\n\t\treturn result;\n\t};\n}\n//#endregion\nexport { compareByNameProperty, createPreserveEmptyPredicate, createStorageSort, matchesPathPattern };\n\n//# sourceMappingURL=hashing-utils.mjs.map"],"mappings":";;AAGA,SAAS,iBAAiB,GAAG,GAAG;CAC/B,OAAO,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI;AACjC;AACA,SAAS,sBAAsB,GAAG,GAAG;CACpC,OAAO,iBAAiB,cAAc,CAAC,KAAK,OAAO,EAAE,YAAY,WAAW,EAAE,UAAU,IAAI,cAAc,CAAC,KAAK,OAAO,EAAE,Y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