@dbsp/types 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-B057_WKR.d.ts → adapter-DXjfHEAf.d.ts} +39 -23
- package/dist/adapter-sdk.d.ts +1 -1
- package/dist/{chunk-CKQRFBMA.js → chunk-X5OQYLAK.js} +106 -1
- package/dist/chunk-X5OQYLAK.js.map +1 -0
- package/dist/index.d.ts +56 -4
- package/dist/index.js +7 -1
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +7 -1
- package/dist/internal.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-CKQRFBMA.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as Adapter, b as AdapterCapabilities, c as AdapterLogger, d as AdapterStreamOptions, f as AggOrderByArg, g as AggregateCountIntent, h as AggregateExpressionIntent, i as AggregateFieldIntent, j as AggregateFunction, k as AggregateIntent, m as AggregateWindowIntent, n as AliasIncludedColumnsMode, o as AlterColumnOptions, p as AmbiguityCheckResult, q as ArithmeticExpressionIntent, r as ArrayExpressionIntent, s as ArrayOperator, t as AuthorAttestedNativeDefault, u as AuthorAttester, B as BaseAdapter, v as BatchUpdateIntent, w as BatchValuesJoinPayload, x as CTEDefinition, y as Cardinality, z as CaseExpressionIntent, D as CastExpressionIntent, E as CheckConstraintIR, H as ColumnExpressionIntent, I as ColumnIR, L as ColumnType, M as CommonColumnType, O as ComparisonExpressionIntent, Q as ComparisonOperator, R as CompileOnlyAdapter, S as CompileOptions, T as CompileOptionsBase, U as CompileResultWithIncludes, a as CompiledColumnMetadata, V as CompiledNqlQuery, C as CompiledQuery, W as CompilingAdapter, X as ConnectionAvailability, Y as CreateIndexOptions, Z as CteQueryIntent, _ as CustomFnExpressionIntent, $ as CustomOpExpressionIntent, a1 as DDLFeature, a2 as DDLFeatureElementMap, a3 as DDLFeatureVersionRange, a4 as
|
|
1
|
+
import { bV as RecursiveTraversal, e as AdjacencyTraversal, d1 as WindowFunction, l as AggregateWindowFunction, ba as OffsetWindowFunction, aj as ExpressionIntent, F as CoalesceExpressionIntent, G as ColumnAliasIntent, a0 as CustomTraversal, bB as QueryIntent, bP as RecursiveIntent, aV as MutationIntent, a6 as DeleteIntent, af as EdgeTableTraversal, aA as InsertIntent, bF as RankingWindowFunction, bI as RawExpressionIntent, bX as RelationColumnIntent, c8 as SelectIntent, c5 as SelectAggregateIntent, c6 as SelectAllIntent, c7 as SelectFieldsIntent, c9 as SelectWithExpressionsIntent, cn as SubqueryRefIntent, cC as UpdateIntent, cG as UpsertIntent, cQ as WhereIntent, cI as WhereAndIntent, cJ as WhereAnyIntent, cK as WhereComparisonIntent, cL as WhereExistsIntent, cN as WhereInIntent, cT as WhereLikeIntent, cX as WhereOrIntent, cV as WhereNotIntent, cU as WhereNotExistsIntent, cW as WhereNullIntent, cY as WhereRangeIntent, c$ as WhereRelationFilterIntent, d0 as WhereSubqueryIntent, d2 as WindowIntent, J as ColumnJsReadType, cq as TableIR, aU as ModelIR, K as ColumnListInput, bY as RelationIR, ap as ForeignKeyIR, cb as SemanticArtifactRef, cy as TrustRoot, bd as OperationKindRef, cc as SequenceIR, cs as TableReaddressDeclaration } from './adapter-DXjfHEAf.js';
|
|
2
|
+
export { A as Adapter, b as AdapterCapabilities, c as AdapterLogger, d as AdapterStreamOptions, f as AggOrderByArg, g as AggregateCountIntent, h as AggregateExpressionIntent, i as AggregateFieldIntent, j as AggregateFunction, k as AggregateIntent, m as AggregateWindowIntent, n as AliasIncludedColumnsMode, o as AlterColumnOptions, p as AmbiguityCheckResult, q as ArithmeticExpressionIntent, r as ArrayExpressionIntent, s as ArrayOperator, t as AuthorAttestedNativeDefault, u as AuthorAttester, B as BaseAdapter, v as BatchUpdateIntent, w as BatchValuesJoinPayload, x as CTEDefinition, y as Cardinality, z as CaseExpressionIntent, D as CastExpressionIntent, E as CheckConstraintIR, H as ColumnExpressionIntent, I as ColumnIR, L as ColumnType, M as CommonColumnType, O as ComparisonExpressionIntent, Q as ComparisonOperator, R as CompileOnlyAdapter, S as CompileOptions, T as CompileOptionsBase, U as CompileResultWithIncludes, a as CompiledColumnMetadata, V as CompiledNqlQuery, C as CompiledQuery, W as CompilingAdapter, X as ConnectionAvailability, Y as CreateIndexOptions, Z as CteQueryIntent, _ as CustomFnExpressionIntent, $ as CustomOpExpressionIntent, a1 as DDLFeature, a2 as DDLFeatureElementMap, a3 as DDLFeatureVersionRange, a4 as DbCasing, a5 as DecisionType, a7 as DialectCapabilities, a8 as DialectName, a9 as DiffSummary, aa as DropIndexOptions, ab as DuckDBColumnType, ac as Dump, ad as DumpMeta, ae as DumpSequenceStep, ag as EmitJoinClause, ah as EnumIR, ai as ExecutingAdapter, ak as FeatureBehaviorConfig, al as FeatureTranslator, am as FeatureWarning, an as FieldRef, ao as FilterStrategy, aq as FunctionExpressionIntent, ar as HierarchyIR, as as IncludeIntent, at as IncludeRecursiveOptions, au as IncludeStrategy, av as IndexColumnDef, aw as IndexIR, ax as IndexInfo, ay as IndexMethod, az as InsertFromIntent, aB as IntrospectingAdapter, aC as IntrospectionOptions, aD as IntrospectionResult, aE as IsTypeSupported, aF as JoinDefault, aG as JoinIntent, aH as JsonAggOrderByEntry, aI as JsonContainsIntent, aJ as JsonExistsIntent, aK as JsonExtractIntent, aL as JsonPathExtractIntent, aM as LiteralExpressionIntent, aN as LockIntent, aO as LockStrength, aP as LockWaitPolicy, aQ as LogicalIdentity, aR as LogicalIdentityCarrier, aS as LogicalOperator, aT as MSSQLColumnType, aW as MutationReturningItem, aX as MySQLColumnType, aY as NamedArgExpressionIntent, aZ as NestedOutputReadHandling, a_ as NqlBindingColumnLineage, a$ as NqlBindingColumnTypeInfo, b0 as NqlBindingColumnUntypeableReason, b1 as NqlBindingOutputSchema, b2 as NqlBindingRelationFilterMetadata, N as NqlBindingRelationType, b3 as NqlBindingVirtualRelation, b4 as NqlBindingVirtualRelationHop, b5 as NqlBindingVirtualRelationRecursive, b6 as NqlProgramSequenceStep, b7 as NqlRuntimeBinding, b8 as NullOperator, b9 as NullsPosition, bb as OffsetWindowIntent, bc as OnDeleteAction, be as Optionality, bf as OrderByExpressionIntent, bg as OrderByFieldIntent, bh as OrderByIntent, bi as OutputDescriptor, bj as OutputReadHandling, bk as OutputSource, bl as OutputValueShape, bm as ParamExpressionIntent, bn as ParamIntent, bo as PartitionIR, bp as PinnedConnectionOptions, bq as PlanDecision, br as PlanOptions, P as PlanReport, bs as PlanWarning, bt as PlanWarningCode, bu as PolicyIR, bv as PostgresColumnType, bw as PostgresOnlyColumnType, bx as PredicateOperator, by as PseudoColumnExpressionIntent, bz as PseudoColumnMetadata, bA as PseudoColumnTraversal, bC as RangeOperand, bD as RangeOperator, bE as RangeValue, bG as RankingWindowIntent, bH as RawCteIntent, bJ as RawSqlAdapter, bK as RecursiveAdvancedOptions, bL as RecursiveDedupe, bM as RecursiveDirection, bN as RecursiveEmitOptions, bO as RecursiveExistsOptions, bQ as RecursiveMetadata, bR as RecursiveNodeIdExpr, bS as RecursivePlanOptions, bT as RecursivePlanReport, bU as RecursiveTrackOptions, bW as RefExpressionIntent, bZ as RelationKind, b_ as RelationOperator, b$ as RelationType, c0 as RequiredEnumLabelIR, c1 as ResolvedIncludeStrategy, c2 as SQLiteColumnType, c3 as SchemaChange, c4 as SchemaDiff, ca as SemanticArtifactId, cd as SetOperationIntent, ce as SetOperationType, cf as SimpleCteIntent, cg as SortDirection, ch as StandaloneWhereExpressionIntent, ci as StarExpressionIntent, cj as StreamingAdapter, ck as StringOperator, cl as SubqueryExpressionIntent, cm as SubqueryIncludeInfo, co as SupportedColumnTypes, cp as TableDDLGeneratorAdapter, cr as TableReaddressAddress, ct as TransactionBeginOptions, cu as TransactionOptions, cv as TransactionalAdapter, cw as TranslationContext, cx as TruncateOptions, cz as UnaryExpressionIntent, cA as UnnestCteIntent, cB as UnsupportedFeatureBehavior, cD as UpsertConflictAction, cE as UpsertConflictTarget, cF as UpsertFromIntent, cH as VacuumOptions, cM as WhereExpressionIntent, cO as WhereInSubqueryIntent, cP as WhereInValueIntent, cR as WhereJsonContainsIntent, cS as WhereJsonExistsIntent, cZ as WhereRawExistsIntent, c_ as WhereRawNotExistsIntent, d3 as WindowOrderBy, d4 as getNodeIdAlias, d5 as isFieldRef, d6 as isParamIntent, d7 as resolveOutputReadHandling, d8 as toColumnList } from './adapter-DXjfHEAf.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* NQL-origin SELECT function allowlist.
|
|
@@ -222,6 +222,46 @@ interface LoadedSchema {
|
|
|
222
222
|
*/
|
|
223
223
|
declare function isValidSchema(schema: unknown): schema is LoadedSchema;
|
|
224
224
|
|
|
225
|
+
/** A dialect-neutral address of one declared or derived database name.
|
|
226
|
+
*
|
|
227
|
+
* `name` is always in the model's logical spelling. For derived objects it is
|
|
228
|
+
* the template result from logical parts (for example `pk_<table>`), rather
|
|
229
|
+
* than a database spelling.
|
|
230
|
+
*/
|
|
231
|
+
type LogicalNameAddress = {
|
|
232
|
+
readonly kind: 'table' | 'enum' | 'sequence';
|
|
233
|
+
readonly schema: string;
|
|
234
|
+
readonly name: string;
|
|
235
|
+
} | {
|
|
236
|
+
readonly kind: 'column' | 'index' | 'constraint' | 'policy';
|
|
237
|
+
readonly schema: string;
|
|
238
|
+
readonly table: string;
|
|
239
|
+
readonly name: string;
|
|
240
|
+
};
|
|
241
|
+
interface PhysicalNameEntry {
|
|
242
|
+
readonly logical: LogicalNameAddress;
|
|
243
|
+
readonly physical: string;
|
|
244
|
+
/** Sequence entries distinguish authored declarations from serial/identity predictions. */
|
|
245
|
+
readonly sequenceProvenance?: 'declared' | 'generated';
|
|
246
|
+
}
|
|
247
|
+
declare class PhysicalNameInventoryDuplicateError extends Error {
|
|
248
|
+
readonly scope: 'logical-address' | 'table' | 'column';
|
|
249
|
+
readonly first: PhysicalNameEntry;
|
|
250
|
+
readonly second: PhysicalNameEntry;
|
|
251
|
+
constructor(scope: 'logical-address' | 'table' | 'column', first: PhysicalNameEntry, second: PhysicalNameEntry);
|
|
252
|
+
}
|
|
253
|
+
interface PhysicalNameInventory {
|
|
254
|
+
readonly entries: readonly PhysicalNameEntry[];
|
|
255
|
+
has(address: LogicalNameAddress): boolean;
|
|
256
|
+
get(address: LogicalNameAddress): string;
|
|
257
|
+
}
|
|
258
|
+
/** Creates an immutable, canonical logical-address-to-physical-name inventory. */
|
|
259
|
+
declare function createPhysicalNameInventory(entries: readonly PhysicalNameEntry[]): PhysicalNameInventory;
|
|
260
|
+
declare class PhysicalNameInventoryMissingError extends Error {
|
|
261
|
+
readonly address: LogicalNameAddress;
|
|
262
|
+
constructor(address: LogicalNameAddress);
|
|
263
|
+
}
|
|
264
|
+
|
|
225
265
|
type RelationKeyDirection = 'belongsTo' | 'inverse';
|
|
226
266
|
type RelationKeyForeignKey = Pick<ForeignKeyIR, 'references'> & {
|
|
227
267
|
readonly columns: ColumnListInput;
|
|
@@ -1146,8 +1186,17 @@ interface CascadeCoveredOutcomeClaimPlan extends OutcomeClaimPlanBase {
|
|
|
1146
1186
|
readonly rootClaimId: string;
|
|
1147
1187
|
readonly statementBundle: EmptyClaimStatementBundle;
|
|
1148
1188
|
}
|
|
1189
|
+
/** A caller-supplied transactional application step recorded at a schema address. */
|
|
1190
|
+
interface ApplicationStepOutcomeClaimPlan extends OutcomeClaimPlanBase {
|
|
1191
|
+
readonly claimSpecies: 'application-step';
|
|
1192
|
+
readonly claimKind: 'intent';
|
|
1193
|
+
readonly statementBundle: EmptyClaimStatementBundle;
|
|
1194
|
+
/** `once` may only claim an unknown chain; `assert` may repair its managed chain. */
|
|
1195
|
+
readonly applicationStep: 'once' | 'assert';
|
|
1196
|
+
readonly declared: LedgerPayload;
|
|
1197
|
+
}
|
|
1149
1198
|
/** The fixed plan-time material that becomes one ledger claim. */
|
|
1150
|
-
type OutcomeClaimPlan = SqlBearingOutcomeClaimPlan | AdoptionOutcomeClaimPlan | CascadeCoveredOutcomeClaimPlan;
|
|
1199
|
+
type OutcomeClaimPlan = SqlBearingOutcomeClaimPlan | AdoptionOutcomeClaimPlan | CascadeCoveredOutcomeClaimPlan | ApplicationStepOutcomeClaimPlan;
|
|
1151
1200
|
/** The only successful result of admission, including its single-use token. */
|
|
1152
1201
|
interface AdmittedOutcomeClaim {
|
|
1153
1202
|
readonly kind: 'admitted-outcome-claim';
|
|
@@ -1289,6 +1338,9 @@ interface ManagedStepSelectionRequirement {
|
|
|
1289
1338
|
type ManagedStepLifecycle = {
|
|
1290
1339
|
readonly kind: 'adoption';
|
|
1291
1340
|
readonly shape: TableIR;
|
|
1341
|
+
} | {
|
|
1342
|
+
readonly kind: 'sequence-adoption';
|
|
1343
|
+
readonly shape: SequenceIR;
|
|
1292
1344
|
} | {
|
|
1293
1345
|
readonly kind: 'adoption-refused';
|
|
1294
1346
|
} | {
|
|
@@ -1856,4 +1908,4 @@ interface RefusedDestructiveDecision {
|
|
|
1856
1908
|
}
|
|
1857
1909
|
type DestructiveDecision = PermittedDestructiveDecision | RefusedDestructiveDecision;
|
|
1858
1910
|
|
|
1859
|
-
export { AdjacencyTraversal, type AdmittedOutcomeClaim, type AdmittedPermit, type AdoptionOutcomeClaimPlan, type AdvisoryObservation, type AdvisoryObservationId, AggregateWindowFunction, type ApplicableAssessment, type ApplicableEvaluation, type ApplyGuard, type ApplyPolicy, type ApplyResult, type Assumption, type AssumptionAcceptance, type AssumptionId, type BigintJsReadConversionContext, type BoundBinding, type CapabilityAvailabilityPredicate, type CapabilityDescriptor, type CascadeCoveredOutcomeClaimPlan, type CatalogueIdentity, type CatalogueIdentityDestructiveOutcome, type ClaimBundleStatement, type ClaimConclusion, type ClaimDerivation, type ClaimId, type ClaimSelector, type ClaimStatementBundle, type ClaimToken, CoalesceExpressionIntent, type CollationRef, ColumnAliasIntent, ColumnJsReadType, ColumnListInput, type Comparator, type CompareOutcome, type CompositionFactSatisfactionOwner, type ContainmentClosureDestructiveOutcome, type ContextFact, type ContextMutation, type ControllerIdentity, CustomTraversal, type DeclarableKind, type DeclarableResourceAddress, type DeclarationDestructiveOutcome, type DeclarationSet, DeleteIntent, type DestructiveAction, type DestructiveAuthorityEvidence, type DestructiveAuthorityPermit, type DestructiveDecision, type DurableApplyOutcome, type DurableIntentRecord, EXECUTION_CONTRACT_VERSION, EdgeTableTraversal, type EmptyClaimStatementBundle, type EquivalenceCapability, type EquivalenceContext, type EquivalenceResult, type EvidenceClaimConclusion, type EvidenceClaimResult, type EvidenceId, type EvidenceObservation, type EvidenceObservationFilters, type EvidenceView, type ExclusiveTransitionTarget, type ExecutableAssertion, type ExecutionContract, type ExecutionRequirement, type ExecutionRequirementMode, type ExpressionEquivalenceCategory, ExpressionIntent, type ExpressionValue, type ExternalEffectCoverage, type FingerprintManifest, ForeignKeyIR, type GuardPredicate, type GuardProtocol, type GuardProtocolKind, type GuardedPlan, type GuardedPlanSegment, type GuardedPlanStep, type InapplicableAssessment, InsertIntent, type IssuedObservation, type JsonAggOrderKey, type JsonObject, type JsonValue, LEDGER_EVENT_KINDS, type LedgerAddress, type LedgerChainMember, type LedgerChainProjection, type LedgerClaimKind, type LedgerEventKind, type LedgerHome, type LedgerIdentity, type LedgerLifecycleGrammarColumn, type LedgerLineageDestructiveOutcome, type LedgerMarkerState, type LedgerOpenClaim, type LedgerPayload, type LedgerRefusal, type LedgerReportedState, type LedgerReservationRow, type LedgerShapeMarker, type LedgerStableState, type LoadedSchema, type LockRequirement, type ManagedDeclaration, type ManagedStepClaimMaterial, type ManagedStepClassification, type ManagedStepClosureMember, type ManagedStepLifecycle, type ManagedStepReplayPolicy, type ManagedStepSelectionRequirement, ModelIR, MutationIntent, NQL_SELECT_AGGREGATE_FUNCTIONS, NQL_SELECT_FUNCTION_ALLOWLIST, NQL_SELECT_JSON_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTION_ALLOWLIST, NQL_SELECT_VALUE_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTION_ALLOWLIST, NQL_SELECT_WINDOW_ONLY_FUNCTIONS, type NormalizedManagedStep, type ObservationBooleanClaim, type ObservationContext, type ObservationIssuer, type ObservationPrivilegeMergeResult, type ObservationRequest, type ObservationResult, type ObservationStability, type ObservedOutcomeRecord, OffsetWindowFunction, type OperationEffectAssessment, type OperationEffects, type OperationExecutionOutcome, type OperationExecutionSemantics, OperationKindRef, type OperationRecoverySemantics, type OperationSemantics, type OperatorAcceptanceDestructiveOutcome, type OutcomeCatalogueUnavailable, type OutcomeClaimAdmission, type OutcomeClaimAdmissionInput, type OutcomeClaimPlan, type OutcomeIndeterminateRecoveryEvidence, type OutcomeProtocolRefusal, type OutcomeReason, type OutcomeReasonCode, type OutcomeRecoveryCatalogueRead, type OutcomeRecoveryCatalogueReader, type OutcomeRecoveryClassification, type OutcomeRecoveryEffect, type OutcomeRecoveryInput, type OutcomeRecoveryReadBack, type OutcomeRecoveryResolution, type OutcomeVacancy, type OwnershipDestructiveOutcome, type PermittedDestructiveDecision, type PhysicalOperation, type PlanAssessment, type PortableExpression, type PostgreSqlAuthorityRequirement, type PostgreSqlEngineRequirement, type PostgreSqlNamespaceIdentity, type PostgreSqlObservationTargetIdentity, type PostgreSqlPhysicalTargetRequirement, type PostgreSqlSessionSettingRequirement, type ProjectedLedgerChain, type ProofClaim, type ProofClaimDraft, type ProofEvidenceAccess, type ProofObligation, type Proposition, type ProvenApplyGuard, type ProvenGuardProtocol, type ProvenPlanShape, type ProvenPlanStep, QueryIntent, REFUSAL_VOCABULARY, RankingWindowFunction, RawExpressionIntent, type RecognitionContext, type RecognitionResult, type RecoveryArtefact, type RecoveryOutcome, RecursiveIntent, RecursiveTraversal, type RefusalCode, type RefusedDestructiveDecision, type ReinitializePreflightAdoptionCandidate, type ReinitializePreflightFailureReason, type ReinitializePreflightFailureStep, type ReinitializePreflightRefusalCode, type ReinitializePreflightReport, type ReinitializePreflightScopeOutcome, type ReinitializePreflightScopeReport, RelationColumnIntent, RelationIR, type RelationKeyBuilderOptions, type RelationKeyDirection, type RelationKeyFields, type RelationKeyForeignKey, type ResourceAddress, type ResourceSelector, type RuleEvaluation, type RulePrecedenceFact, type RuleRef, type RuleSelectionRationale, type RuleSupport, type ScopedApprovalSet, SelectAggregateIntent, SelectAllIntent, SelectFieldsIntent, SelectIntent, SelectWithExpressionsIntent, SemanticArtifactRef, type SerializedProvenPlan, type SqlBearingOutcomeClaimPlan, type StepJournal, type StepOutcome, SubqueryRefIntent, TableIR, TableReaddressDeclaration, type TargetBinding, type TransactionalCompletionRecord, type TransitionCandidate, type TransitionCompositionFact, type TransitionFragment, type TransitionFragmentComposition, type TransitionJournalEvent, type TransitionJournalEventName, type TransitionJournalEventRecord, type TransitionLessor, type TransitionQueryClient, type TransitionQueryResult, type TransitionRule, type TransitionRunAuthorization, type TransitionRunJournal, type TransitionRunMetadata, type TransitionSessionClient, TrustRoot, type TypeRef, type UnknownCoverage, type UnknownTransitionRecognition, type UnprojectableChainReason, type UnprojectableLedgerChain, type UnresolvableExpression, type UnsafeNativeFragment, UpdateIntent, UpsertIntent, type VendorValidatedExpression, WhereAndIntent, WhereAnyIntent, WhereComparisonIntent, WhereExistsIntent, WhereInIntent, WhereIntent, WhereLikeIntent, WhereNotExistsIntent, WhereNotIntent, WhereNullIntent, WhereOrIntent, WhereRangeIntent, WhereRelationFilterIntent, WhereSubqueryIntent, WindowFunction, WindowIntent, buildRelationKeyFields, canonicalResourceParent, convertBigintJsReadValue, isAdjacencyTraversal, isAggregateWindowFunction, isCoalesceExpression, isColumnAliasExpression, isCustomTraversal, isDeleteIntent, isEdgeTableTraversal, isInsertIntent, isMutationIntent, isNqlSelectFunctionAllowed, isNqlSelectScalarFunctionAllowed, isNqlSelectWindowFunctionAllowed, isRankingWindowFunction, isRawExpression, isRecursiveIntent, isRelationColumnExpression, isSelectAggregate, isSelectAll, isSelectFields, isSelectWithExpressions, isSubqueryRef, isUpdateIntent, isUpsertIntent, isValidSchema, isWhereAnd, isWhereAny, isWhereComparison, isWhereExists, isWhereIn, isWhereLike, isWhereLogical, isWhereNot, isWhereNotExists, isWhereNull, isWhereOr, isWhereRange, isWhereRelationBased, isWhereRelationFilter, isWhereSubquery, isWindowIntent, ledgerAddressKey, ledgerAddressParentJson, refusalFor, resolveJsonAggOrderKey, sameControllerIdentity, sameLedgerAddress };
|
|
1911
|
+
export { AdjacencyTraversal, type AdmittedOutcomeClaim, type AdmittedPermit, type AdoptionOutcomeClaimPlan, type AdvisoryObservation, type AdvisoryObservationId, AggregateWindowFunction, type ApplicableAssessment, type ApplicableEvaluation, type ApplicationStepOutcomeClaimPlan, type ApplyGuard, type ApplyPolicy, type ApplyResult, type Assumption, type AssumptionAcceptance, type AssumptionId, type BigintJsReadConversionContext, type BoundBinding, type CapabilityAvailabilityPredicate, type CapabilityDescriptor, type CascadeCoveredOutcomeClaimPlan, type CatalogueIdentity, type CatalogueIdentityDestructiveOutcome, type ClaimBundleStatement, type ClaimConclusion, type ClaimDerivation, type ClaimId, type ClaimSelector, type ClaimStatementBundle, type ClaimToken, CoalesceExpressionIntent, type CollationRef, ColumnAliasIntent, ColumnJsReadType, ColumnListInput, type Comparator, type CompareOutcome, type CompositionFactSatisfactionOwner, type ContainmentClosureDestructiveOutcome, type ContextFact, type ContextMutation, type ControllerIdentity, CustomTraversal, type DeclarableKind, type DeclarableResourceAddress, type DeclarationDestructiveOutcome, type DeclarationSet, DeleteIntent, type DestructiveAction, type DestructiveAuthorityEvidence, type DestructiveAuthorityPermit, type DestructiveDecision, type DurableApplyOutcome, type DurableIntentRecord, EXECUTION_CONTRACT_VERSION, EdgeTableTraversal, type EmptyClaimStatementBundle, type EquivalenceCapability, type EquivalenceContext, type EquivalenceResult, type EvidenceClaimConclusion, type EvidenceClaimResult, type EvidenceId, type EvidenceObservation, type EvidenceObservationFilters, type EvidenceView, type ExclusiveTransitionTarget, type ExecutableAssertion, type ExecutionContract, type ExecutionRequirement, type ExecutionRequirementMode, type ExpressionEquivalenceCategory, ExpressionIntent, type ExpressionValue, type ExternalEffectCoverage, type FingerprintManifest, ForeignKeyIR, type GuardPredicate, type GuardProtocol, type GuardProtocolKind, type GuardedPlan, type GuardedPlanSegment, type GuardedPlanStep, type InapplicableAssessment, InsertIntent, type IssuedObservation, type JsonAggOrderKey, type JsonObject, type JsonValue, LEDGER_EVENT_KINDS, type LedgerAddress, type LedgerChainMember, type LedgerChainProjection, type LedgerClaimKind, type LedgerEventKind, type LedgerHome, type LedgerIdentity, type LedgerLifecycleGrammarColumn, type LedgerLineageDestructiveOutcome, type LedgerMarkerState, type LedgerOpenClaim, type LedgerPayload, type LedgerRefusal, type LedgerReportedState, type LedgerReservationRow, type LedgerShapeMarker, type LedgerStableState, type LoadedSchema, type LockRequirement, type LogicalNameAddress, type ManagedDeclaration, type ManagedStepClaimMaterial, type ManagedStepClassification, type ManagedStepClosureMember, type ManagedStepLifecycle, type ManagedStepReplayPolicy, type ManagedStepSelectionRequirement, ModelIR, MutationIntent, NQL_SELECT_AGGREGATE_FUNCTIONS, NQL_SELECT_FUNCTION_ALLOWLIST, NQL_SELECT_JSON_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTION_ALLOWLIST, NQL_SELECT_VALUE_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTION_ALLOWLIST, NQL_SELECT_WINDOW_ONLY_FUNCTIONS, type NormalizedManagedStep, type ObservationBooleanClaim, type ObservationContext, type ObservationIssuer, type ObservationPrivilegeMergeResult, type ObservationRequest, type ObservationResult, type ObservationStability, type ObservedOutcomeRecord, OffsetWindowFunction, type OperationEffectAssessment, type OperationEffects, type OperationExecutionOutcome, type OperationExecutionSemantics, OperationKindRef, type OperationRecoverySemantics, type OperationSemantics, type OperatorAcceptanceDestructiveOutcome, type OutcomeCatalogueUnavailable, type OutcomeClaimAdmission, type OutcomeClaimAdmissionInput, type OutcomeClaimPlan, type OutcomeIndeterminateRecoveryEvidence, type OutcomeProtocolRefusal, type OutcomeReason, type OutcomeReasonCode, type OutcomeRecoveryCatalogueRead, type OutcomeRecoveryCatalogueReader, type OutcomeRecoveryClassification, type OutcomeRecoveryEffect, type OutcomeRecoveryInput, type OutcomeRecoveryReadBack, type OutcomeRecoveryResolution, type OutcomeVacancy, type OwnershipDestructiveOutcome, type PermittedDestructiveDecision, type PhysicalNameEntry, type PhysicalNameInventory, PhysicalNameInventoryDuplicateError, PhysicalNameInventoryMissingError, type PhysicalOperation, type PlanAssessment, type PortableExpression, type PostgreSqlAuthorityRequirement, type PostgreSqlEngineRequirement, type PostgreSqlNamespaceIdentity, type PostgreSqlObservationTargetIdentity, type PostgreSqlPhysicalTargetRequirement, type PostgreSqlSessionSettingRequirement, type ProjectedLedgerChain, type ProofClaim, type ProofClaimDraft, type ProofEvidenceAccess, type ProofObligation, type Proposition, type ProvenApplyGuard, type ProvenGuardProtocol, type ProvenPlanShape, type ProvenPlanStep, QueryIntent, REFUSAL_VOCABULARY, RankingWindowFunction, RawExpressionIntent, type RecognitionContext, type RecognitionResult, type RecoveryArtefact, type RecoveryOutcome, RecursiveIntent, RecursiveTraversal, type RefusalCode, type RefusedDestructiveDecision, type ReinitializePreflightAdoptionCandidate, type ReinitializePreflightFailureReason, type ReinitializePreflightFailureStep, type ReinitializePreflightRefusalCode, type ReinitializePreflightReport, type ReinitializePreflightScopeOutcome, type ReinitializePreflightScopeReport, RelationColumnIntent, RelationIR, type RelationKeyBuilderOptions, type RelationKeyDirection, type RelationKeyFields, type RelationKeyForeignKey, type ResourceAddress, type ResourceSelector, type RuleEvaluation, type RulePrecedenceFact, type RuleRef, type RuleSelectionRationale, type RuleSupport, type ScopedApprovalSet, SelectAggregateIntent, SelectAllIntent, SelectFieldsIntent, SelectIntent, SelectWithExpressionsIntent, SemanticArtifactRef, SequenceIR, type SerializedProvenPlan, type SqlBearingOutcomeClaimPlan, type StepJournal, type StepOutcome, SubqueryRefIntent, TableIR, TableReaddressDeclaration, type TargetBinding, type TransactionalCompletionRecord, type TransitionCandidate, type TransitionCompositionFact, type TransitionFragment, type TransitionFragmentComposition, type TransitionJournalEvent, type TransitionJournalEventName, type TransitionJournalEventRecord, type TransitionLessor, type TransitionQueryClient, type TransitionQueryResult, type TransitionRule, type TransitionRunAuthorization, type TransitionRunJournal, type TransitionRunMetadata, type TransitionSessionClient, TrustRoot, type TypeRef, type UnknownCoverage, type UnknownTransitionRecognition, type UnprojectableChainReason, type UnprojectableLedgerChain, type UnresolvableExpression, type UnsafeNativeFragment, UpdateIntent, UpsertIntent, type VendorValidatedExpression, WhereAndIntent, WhereAnyIntent, WhereComparisonIntent, WhereExistsIntent, WhereInIntent, WhereIntent, WhereLikeIntent, WhereNotExistsIntent, WhereNotIntent, WhereNullIntent, WhereOrIntent, WhereRangeIntent, WhereRelationFilterIntent, WhereSubqueryIntent, WindowFunction, WindowIntent, buildRelationKeyFields, canonicalResourceParent, convertBigintJsReadValue, createPhysicalNameInventory, isAdjacencyTraversal, isAggregateWindowFunction, isCoalesceExpression, isColumnAliasExpression, isCustomTraversal, isDeleteIntent, isEdgeTableTraversal, isInsertIntent, isMutationIntent, isNqlSelectFunctionAllowed, isNqlSelectScalarFunctionAllowed, isNqlSelectWindowFunctionAllowed, isRankingWindowFunction, isRawExpression, isRecursiveIntent, isRelationColumnExpression, isSelectAggregate, isSelectAll, isSelectFields, isSelectWithExpressions, isSubqueryRef, isUpdateIntent, isUpsertIntent, isValidSchema, isWhereAnd, isWhereAny, isWhereComparison, isWhereExists, isWhereIn, isWhereLike, isWhereLogical, isWhereNot, isWhereNotExists, isWhereNull, isWhereOr, isWhereRange, isWhereRelationBased, isWhereRelationFilter, isWhereSubquery, isWindowIntent, ledgerAddressKey, ledgerAddressParentJson, refusalFor, resolveJsonAggOrderKey, sameControllerIdentity, sameLedgerAddress };
|
package/dist/index.js
CHANGED
|
@@ -10,10 +10,13 @@ import {
|
|
|
10
10
|
NQL_SELECT_WINDOW_FUNCTIONS,
|
|
11
11
|
NQL_SELECT_WINDOW_FUNCTION_ALLOWLIST,
|
|
12
12
|
NQL_SELECT_WINDOW_ONLY_FUNCTIONS,
|
|
13
|
+
PhysicalNameInventoryDuplicateError,
|
|
14
|
+
PhysicalNameInventoryMissingError,
|
|
13
15
|
REFUSAL_VOCABULARY,
|
|
14
16
|
buildRelationKeyFields,
|
|
15
17
|
canonicalResourceParent,
|
|
16
18
|
convertBigintJsReadValue,
|
|
19
|
+
createPhysicalNameInventory,
|
|
17
20
|
getNodeIdAlias,
|
|
18
21
|
isAdjacencyTraversal,
|
|
19
22
|
isAggregateWindowFunction,
|
|
@@ -65,7 +68,7 @@ import {
|
|
|
65
68
|
sameControllerIdentity,
|
|
66
69
|
sameLedgerAddress,
|
|
67
70
|
toColumnList
|
|
68
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-X5OQYLAK.js";
|
|
69
72
|
export {
|
|
70
73
|
EXECUTION_CONTRACT_VERSION,
|
|
71
74
|
LEDGER_EVENT_KINDS,
|
|
@@ -78,10 +81,13 @@ export {
|
|
|
78
81
|
NQL_SELECT_WINDOW_FUNCTIONS,
|
|
79
82
|
NQL_SELECT_WINDOW_FUNCTION_ALLOWLIST,
|
|
80
83
|
NQL_SELECT_WINDOW_ONLY_FUNCTIONS,
|
|
84
|
+
PhysicalNameInventoryDuplicateError,
|
|
85
|
+
PhysicalNameInventoryMissingError,
|
|
81
86
|
REFUSAL_VOCABULARY,
|
|
82
87
|
buildRelationKeyFields,
|
|
83
88
|
canonicalResourceParent,
|
|
84
89
|
convertBigintJsReadValue,
|
|
90
|
+
createPhysicalNameInventory,
|
|
85
91
|
getNodeIdAlias,
|
|
86
92
|
isAdjacencyTraversal,
|
|
87
93
|
isAggregateWindowFunction,
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as NqlBindingRelationType } from './adapter-
|
|
2
|
-
export { A as Adapter, b as AdapterCapabilities, c as AdapterLogger, d as AdapterStreamOptions, e as AdjacencyTraversal, f as AggOrderByArg, g as AggregateCountIntent, h as AggregateExpressionIntent, i as AggregateFieldIntent, j as AggregateFunction, k as AggregateIntent, l as AggregateWindowFunction, m as AggregateWindowIntent, n as AliasIncludedColumnsMode, o as AlterColumnOptions, p as AmbiguityCheckResult, q as ArithmeticExpressionIntent, r as ArrayExpressionIntent, s as ArrayOperator, t as AuthorAttestedNativeDefault, u as AuthorAttester, B as BaseAdapter, v as BatchUpdateIntent, w as BatchValuesJoinPayload, x as CTEDefinition, y as Cardinality, z as CaseExpressionIntent, D as CastExpressionIntent, E as CheckConstraintIR, F as CoalesceExpressionIntent, G as ColumnAliasIntent, H as ColumnExpressionIntent, I as ColumnIR, J as ColumnJsReadType, K as ColumnListInput, L as ColumnType, M as CommonColumnType, O as ComparisonExpressionIntent, Q as ComparisonOperator, R as CompileOnlyAdapter, S as CompileOptions, T as CompileOptionsBase, U as CompileResultWithIncludes, a as CompiledColumnMetadata, V as CompiledNqlQuery, C as CompiledQuery, W as CompilingAdapter, X as ConnectionAvailability, Y as CreateIndexOptions, Z as CteQueryIntent, _ as CustomFnExpressionIntent, $ as CustomOpExpressionIntent, a0 as CustomTraversal, a1 as DDLFeature, a2 as DDLFeatureElementMap, a3 as DDLFeatureVersionRange, a4 as
|
|
3
|
-
export { AdmittedOutcomeClaim, AdmittedPermit, AdoptionOutcomeClaimPlan, AdvisoryObservation, AdvisoryObservationId, ApplicableAssessment, ApplicableEvaluation, ApplyGuard, ApplyPolicy, ApplyResult, Assumption, AssumptionAcceptance, AssumptionId, BigintJsReadConversionContext, BoundBinding, CapabilityAvailabilityPredicate, CapabilityDescriptor, CascadeCoveredOutcomeClaimPlan, CatalogueIdentity, CatalogueIdentityDestructiveOutcome, ClaimBundleStatement, ClaimConclusion, ClaimDerivation, ClaimId, ClaimSelector, ClaimStatementBundle, ClaimToken, CollationRef, Comparator, CompareOutcome, CompositionFactSatisfactionOwner, ContainmentClosureDestructiveOutcome, ContextFact, ContextMutation, ControllerIdentity, DeclarableKind, DeclarableResourceAddress, DeclarationDestructiveOutcome, DeclarationSet, DestructiveAction, DestructiveAuthorityEvidence, DestructiveAuthorityPermit, DestructiveDecision, DurableApplyOutcome, DurableIntentRecord, EXECUTION_CONTRACT_VERSION, EmptyClaimStatementBundle, EquivalenceCapability, EquivalenceContext, EquivalenceResult, EvidenceClaimConclusion, EvidenceClaimResult, EvidenceId, EvidenceObservation, EvidenceObservationFilters, EvidenceView, ExclusiveTransitionTarget, ExecutableAssertion, ExecutionContract, ExecutionRequirement, ExecutionRequirementMode, ExpressionEquivalenceCategory, ExpressionValue, ExternalEffectCoverage, FingerprintManifest, GuardPredicate, GuardProtocol, GuardProtocolKind, GuardedPlan, GuardedPlanSegment, GuardedPlanStep, InapplicableAssessment, IssuedObservation, JsonAggOrderKey, JsonObject, JsonValue, LEDGER_EVENT_KINDS, LedgerAddress, LedgerChainMember, LedgerChainProjection, LedgerClaimKind, LedgerEventKind, LedgerHome, LedgerIdentity, LedgerLifecycleGrammarColumn, LedgerLineageDestructiveOutcome, LedgerMarkerState, LedgerOpenClaim, LedgerPayload, LedgerRefusal, LedgerReportedState, LedgerReservationRow, LedgerShapeMarker, LedgerStableState, LoadedSchema, LockRequirement, ManagedDeclaration, ManagedStepClaimMaterial, ManagedStepClassification, ManagedStepClosureMember, ManagedStepLifecycle, ManagedStepReplayPolicy, ManagedStepSelectionRequirement, NQL_SELECT_AGGREGATE_FUNCTIONS, NQL_SELECT_FUNCTION_ALLOWLIST, NQL_SELECT_JSON_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTION_ALLOWLIST, NQL_SELECT_VALUE_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTION_ALLOWLIST, NQL_SELECT_WINDOW_ONLY_FUNCTIONS, NormalizedManagedStep, ObservationBooleanClaim, ObservationContext, ObservationIssuer, ObservationPrivilegeMergeResult, ObservationRequest, ObservationResult, ObservationStability, ObservedOutcomeRecord, OperationEffectAssessment, OperationEffects, OperationExecutionOutcome, OperationExecutionSemantics, OperationRecoverySemantics, OperationSemantics, OperatorAcceptanceDestructiveOutcome, OutcomeCatalogueUnavailable, OutcomeClaimAdmission, OutcomeClaimAdmissionInput, OutcomeClaimPlan, OutcomeIndeterminateRecoveryEvidence, OutcomeProtocolRefusal, OutcomeReason, OutcomeReasonCode, OutcomeRecoveryCatalogueRead, OutcomeRecoveryCatalogueReader, OutcomeRecoveryClassification, OutcomeRecoveryEffect, OutcomeRecoveryInput, OutcomeRecoveryReadBack, OutcomeRecoveryResolution, OutcomeVacancy, OwnershipDestructiveOutcome, PermittedDestructiveDecision, PhysicalOperation, PlanAssessment, PortableExpression, PostgreSqlAuthorityRequirement, PostgreSqlEngineRequirement, PostgreSqlNamespaceIdentity, PostgreSqlObservationTargetIdentity, PostgreSqlPhysicalTargetRequirement, PostgreSqlSessionSettingRequirement, ProjectedLedgerChain, ProofClaim, ProofClaimDraft, ProofEvidenceAccess, ProofObligation, Proposition, ProvenApplyGuard, ProvenGuardProtocol, ProvenPlanShape, ProvenPlanStep, REFUSAL_VOCABULARY, RecognitionContext, RecognitionResult, RecoveryArtefact, RecoveryOutcome, RefusalCode, RefusedDestructiveDecision, ReinitializePreflightAdoptionCandidate, ReinitializePreflightFailureReason, ReinitializePreflightFailureStep, ReinitializePreflightRefusalCode, ReinitializePreflightReport, ReinitializePreflightScopeOutcome, ReinitializePreflightScopeReport, RelationKeyBuilderOptions, RelationKeyDirection, RelationKeyFields, RelationKeyForeignKey, ResourceAddress, ResourceSelector, RuleEvaluation, RulePrecedenceFact, RuleRef, RuleSelectionRationale, RuleSupport, ScopedApprovalSet, SerializedProvenPlan, SqlBearingOutcomeClaimPlan, StepJournal, StepOutcome, TargetBinding, TransactionalCompletionRecord, TransitionCandidate, TransitionCompositionFact, TransitionFragment, TransitionFragmentComposition, TransitionJournalEvent, TransitionJournalEventName, TransitionJournalEventRecord, TransitionLessor, TransitionQueryClient, TransitionQueryResult, TransitionRule, TransitionRunAuthorization, TransitionRunJournal, TransitionRunMetadata, TransitionSessionClient, TypeRef, UnknownCoverage, UnknownTransitionRecognition, UnprojectableChainReason, UnprojectableLedgerChain, UnresolvableExpression, UnsafeNativeFragment, VendorValidatedExpression, buildRelationKeyFields, canonicalResourceParent, convertBigintJsReadValue, isAdjacencyTraversal, isAggregateWindowFunction, isCoalesceExpression, isColumnAliasExpression, isCustomTraversal, isDeleteIntent, isEdgeTableTraversal, isInsertIntent, isMutationIntent, isNqlSelectFunctionAllowed, isNqlSelectScalarFunctionAllowed, isNqlSelectWindowFunctionAllowed, isRankingWindowFunction, isRawExpression, isRecursiveIntent, isRelationColumnExpression, isSelectAggregate, isSelectAll, isSelectFields, isSelectWithExpressions, isSubqueryRef, isUpdateIntent, isUpsertIntent, isValidSchema, isWhereAnd, isWhereAny, isWhereComparison, isWhereExists, isWhereIn, isWhereLike, isWhereLogical, isWhereNot, isWhereNotExists, isWhereNull, isWhereOr, isWhereRange, isWhereRelationBased, isWhereRelationFilter, isWhereSubquery, isWindowIntent, ledgerAddressKey, ledgerAddressParentJson, refusalFor, resolveJsonAggOrderKey, sameControllerIdentity, sameLedgerAddress } from './index.js';
|
|
1
|
+
import { N as NqlBindingRelationType } from './adapter-DXjfHEAf.js';
|
|
2
|
+
export { A as Adapter, b as AdapterCapabilities, c as AdapterLogger, d as AdapterStreamOptions, e as AdjacencyTraversal, f as AggOrderByArg, g as AggregateCountIntent, h as AggregateExpressionIntent, i as AggregateFieldIntent, j as AggregateFunction, k as AggregateIntent, l as AggregateWindowFunction, m as AggregateWindowIntent, n as AliasIncludedColumnsMode, o as AlterColumnOptions, p as AmbiguityCheckResult, q as ArithmeticExpressionIntent, r as ArrayExpressionIntent, s as ArrayOperator, t as AuthorAttestedNativeDefault, u as AuthorAttester, B as BaseAdapter, v as BatchUpdateIntent, w as BatchValuesJoinPayload, x as CTEDefinition, y as Cardinality, z as CaseExpressionIntent, D as CastExpressionIntent, E as CheckConstraintIR, F as CoalesceExpressionIntent, G as ColumnAliasIntent, H as ColumnExpressionIntent, I as ColumnIR, J as ColumnJsReadType, K as ColumnListInput, L as ColumnType, M as CommonColumnType, O as ComparisonExpressionIntent, Q as ComparisonOperator, R as CompileOnlyAdapter, S as CompileOptions, T as CompileOptionsBase, U as CompileResultWithIncludes, a as CompiledColumnMetadata, V as CompiledNqlQuery, C as CompiledQuery, W as CompilingAdapter, X as ConnectionAvailability, Y as CreateIndexOptions, Z as CteQueryIntent, _ as CustomFnExpressionIntent, $ as CustomOpExpressionIntent, a0 as CustomTraversal, a1 as DDLFeature, a2 as DDLFeatureElementMap, a3 as DDLFeatureVersionRange, a4 as DbCasing, a5 as DecisionType, a6 as DeleteIntent, a7 as DialectCapabilities, a8 as DialectName, a9 as DiffSummary, aa as DropIndexOptions, ab as DuckDBColumnType, ac as Dump, ad as DumpMeta, ae as DumpSequenceStep, af as EdgeTableTraversal, ag as EmitJoinClause, ah as EnumIR, ai as ExecutingAdapter, aj as ExpressionIntent, ak as FeatureBehaviorConfig, al as FeatureTranslator, am as FeatureWarning, an as FieldRef, ao as FilterStrategy, ap as ForeignKeyIR, aq as FunctionExpressionIntent, ar as HierarchyIR, as as IncludeIntent, at as IncludeRecursiveOptions, au as IncludeStrategy, av as IndexColumnDef, aw as IndexIR, ax as IndexInfo, ay as IndexMethod, az as InsertFromIntent, aA as InsertIntent, aB as IntrospectingAdapter, aC as IntrospectionOptions, aD as IntrospectionResult, aE as IsTypeSupported, aF as JoinDefault, aG as JoinIntent, aH as JsonAggOrderByEntry, aI as JsonContainsIntent, aJ as JsonExistsIntent, aK as JsonExtractIntent, aL as JsonPathExtractIntent, aM as LiteralExpressionIntent, aN as LockIntent, aO as LockStrength, aP as LockWaitPolicy, aQ as LogicalIdentity, aR as LogicalIdentityCarrier, aS as LogicalOperator, aT as MSSQLColumnType, aU as ModelIR, aV as MutationIntent, aW as MutationReturningItem, aX as MySQLColumnType, aY as NamedArgExpressionIntent, aZ as NestedOutputReadHandling, a_ as NqlBindingColumnLineage, a$ as NqlBindingColumnTypeInfo, b0 as NqlBindingColumnUntypeableReason, b1 as NqlBindingOutputSchema, b2 as NqlBindingRelationFilterMetadata, b3 as NqlBindingVirtualRelation, b4 as NqlBindingVirtualRelationHop, b5 as NqlBindingVirtualRelationRecursive, b6 as NqlProgramSequenceStep, b7 as NqlRuntimeBinding, b8 as NullOperator, b9 as NullsPosition, ba as OffsetWindowFunction, bb as OffsetWindowIntent, bc as OnDeleteAction, bd as OperationKindRef, be as Optionality, bf as OrderByExpressionIntent, bg as OrderByFieldIntent, bh as OrderByIntent, bi as OutputDescriptor, bj as OutputReadHandling, bk as OutputSource, bl as OutputValueShape, bm as ParamExpressionIntent, bn as ParamIntent, bo as PartitionIR, bp as PinnedConnectionOptions, bq as PlanDecision, br as PlanOptions, P as PlanReport, bs as PlanWarning, bt as PlanWarningCode, bu as PolicyIR, bv as PostgresColumnType, bw as PostgresOnlyColumnType, bx as PredicateOperator, by as PseudoColumnExpressionIntent, bz as PseudoColumnMetadata, bA as PseudoColumnTraversal, bB as QueryIntent, bC as RangeOperand, bD as RangeOperator, bE as RangeValue, bF as RankingWindowFunction, bG as RankingWindowIntent, bH as RawCteIntent, bI as RawExpressionIntent, bJ as RawSqlAdapter, bK as RecursiveAdvancedOptions, bL as RecursiveDedupe, bM as RecursiveDirection, bN as RecursiveEmitOptions, bO as RecursiveExistsOptions, bP as RecursiveIntent, bQ as RecursiveMetadata, bR as RecursiveNodeIdExpr, bS as RecursivePlanOptions, bT as RecursivePlanReport, bU as RecursiveTrackOptions, bV as RecursiveTraversal, bW as RefExpressionIntent, bX as RelationColumnIntent, bY as RelationIR, bZ as RelationKind, b_ as RelationOperator, b$ as RelationType, c0 as RequiredEnumLabelIR, c1 as ResolvedIncludeStrategy, c2 as SQLiteColumnType, c3 as SchemaChange, c4 as SchemaDiff, c5 as SelectAggregateIntent, c6 as SelectAllIntent, c7 as SelectFieldsIntent, c8 as SelectIntent, c9 as SelectWithExpressionsIntent, ca as SemanticArtifactId, cb as SemanticArtifactRef, cc as SequenceIR, cd as SetOperationIntent, ce as SetOperationType, cf as SimpleCteIntent, cg as SortDirection, ch as StandaloneWhereExpressionIntent, ci as StarExpressionIntent, cj as StreamingAdapter, ck as StringOperator, cl as SubqueryExpressionIntent, cm as SubqueryIncludeInfo, cn as SubqueryRefIntent, co as SupportedColumnTypes, cp as TableDDLGeneratorAdapter, cq as TableIR, cr as TableReaddressAddress, cs as TableReaddressDeclaration, ct as TransactionBeginOptions, cu as TransactionOptions, cv as TransactionalAdapter, cw as TranslationContext, cx as TruncateOptions, cy as TrustRoot, cz as UnaryExpressionIntent, cA as UnnestCteIntent, cB as UnsupportedFeatureBehavior, cC as UpdateIntent, cD as UpsertConflictAction, cE as UpsertConflictTarget, cF as UpsertFromIntent, cG as UpsertIntent, cH as VacuumOptions, cI as WhereAndIntent, cJ as WhereAnyIntent, cK as WhereComparisonIntent, cL as WhereExistsIntent, cM as WhereExpressionIntent, cN as WhereInIntent, cO as WhereInSubqueryIntent, cP as WhereInValueIntent, cQ as WhereIntent, cR as WhereJsonContainsIntent, cS as WhereJsonExistsIntent, cT as WhereLikeIntent, cU as WhereNotExistsIntent, cV as WhereNotIntent, cW as WhereNullIntent, cX as WhereOrIntent, cY as WhereRangeIntent, cZ as WhereRawExistsIntent, c_ as WhereRawNotExistsIntent, c$ as WhereRelationFilterIntent, d0 as WhereSubqueryIntent, d1 as WindowFunction, d2 as WindowIntent, d3 as WindowOrderBy, d4 as getNodeIdAlias, d5 as isFieldRef, d6 as isParamIntent, d7 as resolveOutputReadHandling, d8 as toColumnList } from './adapter-DXjfHEAf.js';
|
|
3
|
+
export { AdmittedOutcomeClaim, AdmittedPermit, AdoptionOutcomeClaimPlan, AdvisoryObservation, AdvisoryObservationId, ApplicableAssessment, ApplicableEvaluation, ApplicationStepOutcomeClaimPlan, ApplyGuard, ApplyPolicy, ApplyResult, Assumption, AssumptionAcceptance, AssumptionId, BigintJsReadConversionContext, BoundBinding, CapabilityAvailabilityPredicate, CapabilityDescriptor, CascadeCoveredOutcomeClaimPlan, CatalogueIdentity, CatalogueIdentityDestructiveOutcome, ClaimBundleStatement, ClaimConclusion, ClaimDerivation, ClaimId, ClaimSelector, ClaimStatementBundle, ClaimToken, CollationRef, Comparator, CompareOutcome, CompositionFactSatisfactionOwner, ContainmentClosureDestructiveOutcome, ContextFact, ContextMutation, ControllerIdentity, DeclarableKind, DeclarableResourceAddress, DeclarationDestructiveOutcome, DeclarationSet, DestructiveAction, DestructiveAuthorityEvidence, DestructiveAuthorityPermit, DestructiveDecision, DurableApplyOutcome, DurableIntentRecord, EXECUTION_CONTRACT_VERSION, EmptyClaimStatementBundle, EquivalenceCapability, EquivalenceContext, EquivalenceResult, EvidenceClaimConclusion, EvidenceClaimResult, EvidenceId, EvidenceObservation, EvidenceObservationFilters, EvidenceView, ExclusiveTransitionTarget, ExecutableAssertion, ExecutionContract, ExecutionRequirement, ExecutionRequirementMode, ExpressionEquivalenceCategory, ExpressionValue, ExternalEffectCoverage, FingerprintManifest, GuardPredicate, GuardProtocol, GuardProtocolKind, GuardedPlan, GuardedPlanSegment, GuardedPlanStep, InapplicableAssessment, IssuedObservation, JsonAggOrderKey, JsonObject, JsonValue, LEDGER_EVENT_KINDS, LedgerAddress, LedgerChainMember, LedgerChainProjection, LedgerClaimKind, LedgerEventKind, LedgerHome, LedgerIdentity, LedgerLifecycleGrammarColumn, LedgerLineageDestructiveOutcome, LedgerMarkerState, LedgerOpenClaim, LedgerPayload, LedgerRefusal, LedgerReportedState, LedgerReservationRow, LedgerShapeMarker, LedgerStableState, LoadedSchema, LockRequirement, LogicalNameAddress, ManagedDeclaration, ManagedStepClaimMaterial, ManagedStepClassification, ManagedStepClosureMember, ManagedStepLifecycle, ManagedStepReplayPolicy, ManagedStepSelectionRequirement, NQL_SELECT_AGGREGATE_FUNCTIONS, NQL_SELECT_FUNCTION_ALLOWLIST, NQL_SELECT_JSON_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTIONS, NQL_SELECT_SCALAR_FUNCTION_ALLOWLIST, NQL_SELECT_VALUE_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTIONS, NQL_SELECT_WINDOW_FUNCTION_ALLOWLIST, NQL_SELECT_WINDOW_ONLY_FUNCTIONS, NormalizedManagedStep, ObservationBooleanClaim, ObservationContext, ObservationIssuer, ObservationPrivilegeMergeResult, ObservationRequest, ObservationResult, ObservationStability, ObservedOutcomeRecord, OperationEffectAssessment, OperationEffects, OperationExecutionOutcome, OperationExecutionSemantics, OperationRecoverySemantics, OperationSemantics, OperatorAcceptanceDestructiveOutcome, OutcomeCatalogueUnavailable, OutcomeClaimAdmission, OutcomeClaimAdmissionInput, OutcomeClaimPlan, OutcomeIndeterminateRecoveryEvidence, OutcomeProtocolRefusal, OutcomeReason, OutcomeReasonCode, OutcomeRecoveryCatalogueRead, OutcomeRecoveryCatalogueReader, OutcomeRecoveryClassification, OutcomeRecoveryEffect, OutcomeRecoveryInput, OutcomeRecoveryReadBack, OutcomeRecoveryResolution, OutcomeVacancy, OwnershipDestructiveOutcome, PermittedDestructiveDecision, PhysicalNameEntry, PhysicalNameInventory, PhysicalNameInventoryDuplicateError, PhysicalNameInventoryMissingError, PhysicalOperation, PlanAssessment, PortableExpression, PostgreSqlAuthorityRequirement, PostgreSqlEngineRequirement, PostgreSqlNamespaceIdentity, PostgreSqlObservationTargetIdentity, PostgreSqlPhysicalTargetRequirement, PostgreSqlSessionSettingRequirement, ProjectedLedgerChain, ProofClaim, ProofClaimDraft, ProofEvidenceAccess, ProofObligation, Proposition, ProvenApplyGuard, ProvenGuardProtocol, ProvenPlanShape, ProvenPlanStep, REFUSAL_VOCABULARY, RecognitionContext, RecognitionResult, RecoveryArtefact, RecoveryOutcome, RefusalCode, RefusedDestructiveDecision, ReinitializePreflightAdoptionCandidate, ReinitializePreflightFailureReason, ReinitializePreflightFailureStep, ReinitializePreflightRefusalCode, ReinitializePreflightReport, ReinitializePreflightScopeOutcome, ReinitializePreflightScopeReport, RelationKeyBuilderOptions, RelationKeyDirection, RelationKeyFields, RelationKeyForeignKey, ResourceAddress, ResourceSelector, RuleEvaluation, RulePrecedenceFact, RuleRef, RuleSelectionRationale, RuleSupport, ScopedApprovalSet, SerializedProvenPlan, SqlBearingOutcomeClaimPlan, StepJournal, StepOutcome, TargetBinding, TransactionalCompletionRecord, TransitionCandidate, TransitionCompositionFact, TransitionFragment, TransitionFragmentComposition, TransitionJournalEvent, TransitionJournalEventName, TransitionJournalEventRecord, TransitionLessor, TransitionQueryClient, TransitionQueryResult, TransitionRule, TransitionRunAuthorization, TransitionRunJournal, TransitionRunMetadata, TransitionSessionClient, TypeRef, UnknownCoverage, UnknownTransitionRecognition, UnprojectableChainReason, UnprojectableLedgerChain, UnresolvableExpression, UnsafeNativeFragment, VendorValidatedExpression, buildRelationKeyFields, canonicalResourceParent, convertBigintJsReadValue, createPhysicalNameInventory, isAdjacencyTraversal, isAggregateWindowFunction, isCoalesceExpression, isColumnAliasExpression, isCustomTraversal, isDeleteIntent, isEdgeTableTraversal, isInsertIntent, isMutationIntent, isNqlSelectFunctionAllowed, isNqlSelectScalarFunctionAllowed, isNqlSelectWindowFunctionAllowed, isRankingWindowFunction, isRawExpression, isRecursiveIntent, isRelationColumnExpression, isSelectAggregate, isSelectAll, isSelectFields, isSelectWithExpressions, isSubqueryRef, isUpdateIntent, isUpsertIntent, isValidSchema, isWhereAnd, isWhereAny, isWhereComparison, isWhereExists, isWhereIn, isWhereLike, isWhereLogical, isWhereNot, isWhereNotExists, isWhereNull, isWhereOr, isWhereRange, isWhereRelationBased, isWhereRelationFilter, isWhereSubquery, isWindowIntent, ledgerAddressKey, ledgerAddressParentJson, refusalFor, resolveJsonAggOrderKey, sameControllerIdentity, sameLedgerAddress } from './index.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @module builders
|
package/dist/internal.js
CHANGED
|
@@ -10,10 +10,13 @@ import {
|
|
|
10
10
|
NQL_SELECT_WINDOW_FUNCTIONS,
|
|
11
11
|
NQL_SELECT_WINDOW_FUNCTION_ALLOWLIST,
|
|
12
12
|
NQL_SELECT_WINDOW_ONLY_FUNCTIONS,
|
|
13
|
+
PhysicalNameInventoryDuplicateError,
|
|
14
|
+
PhysicalNameInventoryMissingError,
|
|
13
15
|
REFUSAL_VOCABULARY,
|
|
14
16
|
buildRelationKeyFields,
|
|
15
17
|
canonicalResourceParent,
|
|
16
18
|
convertBigintJsReadValue,
|
|
19
|
+
createPhysicalNameInventory,
|
|
17
20
|
getNodeIdAlias,
|
|
18
21
|
isAdjacencyTraversal,
|
|
19
22
|
isAggregateWindowFunction,
|
|
@@ -65,7 +68,7 @@ import {
|
|
|
65
68
|
sameControllerIdentity,
|
|
66
69
|
sameLedgerAddress,
|
|
67
70
|
toColumnList
|
|
68
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-X5OQYLAK.js";
|
|
69
72
|
|
|
70
73
|
// src/internal.ts
|
|
71
74
|
function explainUnsupportedNqlBindingIncludeHop(relationName, relation, include) {
|
|
@@ -245,11 +248,14 @@ export {
|
|
|
245
248
|
NQL_SELECT_WINDOW_FUNCTIONS,
|
|
246
249
|
NQL_SELECT_WINDOW_FUNCTION_ALLOWLIST,
|
|
247
250
|
NQL_SELECT_WINDOW_ONLY_FUNCTIONS,
|
|
251
|
+
PhysicalNameInventoryDuplicateError,
|
|
252
|
+
PhysicalNameInventoryMissingError,
|
|
248
253
|
REFUSAL_VOCABULARY,
|
|
249
254
|
buildRelationKeyFields,
|
|
250
255
|
canonicalResourceParent,
|
|
251
256
|
convertBigintJsReadValue,
|
|
252
257
|
createNqlBindingRef,
|
|
258
|
+
createPhysicalNameInventory,
|
|
253
259
|
explainUnsupportedNqlBindingIncludeHop,
|
|
254
260
|
getNodeIdAlias,
|
|
255
261
|
getNqlBindingRefName,
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal.ts"],"sourcesContent":["/**\n * @dbsp/types/internal - Internal type definitions\n *\n * These types are for internal use by @dbsp package implementations.\n * They are NOT part of the public API and may change without notice.\n *\n * @module @dbsp/types/internal\n * @internal\n */\n\nimport { toColumnList } from './column-list.js';\nimport type { NqlBindingRelationType } from './model-ir.js';\n\n// Internal-only build utilities (NOT part of public API)\nexport type { IntentBuilder, Mutable } from './builders.js';\n\n/** @internal Minimal relation shape needed to validate NQL binding include hops. */\nexport interface NqlBindingIncludeRelationShape {\n\treadonly type?: NqlBindingRelationType | undefined;\n\treadonly foreignKey?: string | readonly string[] | undefined;\n\treadonly source?: string | undefined;\n\treadonly target?: string | undefined;\n\treadonly through?: unknown;\n\treadonly otherKey?: unknown;\n\treadonly throughSourceKey?: unknown;\n\treadonly throughTargetKey?: unknown;\n\treadonly recursive?: unknown;\n}\n\n/** @internal Minimal include-node shape needed to validate NQL binding include hops. */\nexport interface NqlBindingIncludeNodeShape {\n\treadonly relation?: unknown;\n\treadonly include?: readonly NqlBindingIncludeNodeShape[] | undefined;\n\treadonly [key: string]: unknown;\n}\n\n/** @internal */\nexport function explainUnsupportedNqlBindingIncludeHop(\n\trelationName: string,\n\trelation: NqlBindingIncludeRelationShape,\n\tinclude?: NqlBindingIncludeNodeShape,\n): string | undefined {\n\tconst includeReason = include\n\t\t? explainUnsupportedNqlBindingIncludeNode(relationName, include)\n\t\t: undefined;\n\tif (includeReason) return includeReason;\n\tif (\n\t\trelation.type === 'belongsToMany' ||\n\t\trelation.type === 'manyToMany' ||\n\t\trelation.through !== undefined ||\n\t\trelation.otherKey !== undefined ||\n\t\trelation.throughSourceKey !== undefined ||\n\t\trelation.throughTargetKey !== undefined\n\t) {\n\t\treturn `relation '${relationName}' is '${relation.type ?? 'through'}' and needs junction traversal; binding includes for many-to-many/through relations are not supported (ref-#192)`;\n\t}\n\tif (\n\t\trelation.type !== 'belongsTo' &&\n\t\trelation.type !== 'hasOne' &&\n\t\trelation.type !== 'hasMany'\n\t) {\n\t\treturn `relation '${relationName}' is '${relation.type ?? 'unknown'}'; binding includes require a belongsTo/hasOne/hasMany relation (ref-#192)`;\n\t}\n\tconst fkColumns = toColumnList(relation.foreignKey);\n\tif (fkColumns.length === 0 || fkColumns.some((col) => col.length === 0)) {\n\t\treturn `relation '${relationName}' must have at least one non-empty FK column for binding includes (ref-#179)`;\n\t}\n\tif (\n\t\trelation.recursive !== undefined ||\n\t\t(relation.source !== undefined &&\n\t\t\trelation.target !== undefined &&\n\t\t\trelation.source === relation.target)\n\t) {\n\t\treturn `relation '${relationName}' is recursive/self-referential; binding includes for recursive relations require recursive CTE handling and are not supported (ref-#193)`;\n\t}\n\treturn undefined;\n}\n\nconst NQL_BINDING_INCLUDE_NODE_KEYS: ReadonlySet<string> = new Set([\n\t'relation',\n\t'include',\n]);\n\nfunction explainUnsupportedNqlBindingIncludeNode(\n\trelationName: string,\n\tinclude: NqlBindingIncludeNodeShape,\n): string | undefined {\n\tconst keys = Object.keys(include);\n\tconst unsupportedKeys = keys.filter(\n\t\t(key) => !NQL_BINDING_INCLUDE_NODE_KEYS.has(key),\n\t);\n\tif (unsupportedKeys.length > 0) {\n\t\tconst options = unsupportedKeys.map((key) => `'${key}'`).join(', ');\n\t\treturn `relation '${relationName}' include node carries unsupported option${unsupportedKeys.length === 1 ? '' : 's'} ${options}; binding includes only allow 'relation' and nested 'include' (ref-#192)`;\n\t}\n\tif (typeof include.relation !== 'string' || include.relation.length === 0) {\n\t\treturn `relation '${relationName}' include node must name a relation (ref-#192)`;\n\t}\n\tif (include.include !== undefined && !Array.isArray(include.include)) {\n\t\treturn `relation '${relationName}' nested include must be an array (ref-#192)`;\n\t}\n\treturn undefined;\n}\n\n/**\n * @internal Shared compiler-options marker for trusted NQL package internals.\n *\n * Deliberately uses Symbol(), not Symbol.for(), so knowing the description does\n * not let callers forge the marker through the global symbol registry.\n */\nexport const NQL_INTERNAL_COMPILER_OPTIONS: unique symbol = Symbol(\n\t'@dbsp/nql/internalCompilerOptions',\n);\n\nconst NQL_BINDING_REF = Symbol('@dbsp/nql/bindingRef');\nconst NQL_TRUSTED_RELATION_FILTER = Symbol('@dbsp/nql/trustedRelationFilter');\n\n/**\n * @internal Opaque marker for NQL compiler-created binding references.\n *\n * The brand is a module-private Symbol(), so JSON/plain object inputs cannot\n * forge it by shape.\n */\nexport interface NqlBindingRef {\n\treadonly name: string;\n\treadonly [NQL_BINDING_REF]: true;\n}\n\n/** @internal */\nexport function createNqlBindingRef(name: string): NqlBindingRef {\n\tconst ref = { name } as { name: string; [NQL_BINDING_REF]?: true };\n\tObject.defineProperty(ref, NQL_BINDING_REF, {\n\t\tvalue: true,\n\t\tenumerable: false,\n\t});\n\treturn ref as NqlBindingRef;\n}\n\n/** @internal */\nexport function isNqlBindingRef(value: unknown): value is NqlBindingRef {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\tconst record = value as {\n\t\treadonly name?: unknown;\n\t\treadonly [NQL_BINDING_REF]?: unknown;\n\t};\n\treturn (\n\t\tObject.hasOwn(record, NQL_BINDING_REF) &&\n\t\trecord[NQL_BINDING_REF] === true &&\n\t\ttypeof record.name === 'string'\n\t);\n}\n\n/** @internal */\nexport function getNqlBindingRefName(ref: NqlBindingRef): string {\n\treturn ref.name;\n}\n\n/** @internal */\nexport type NqlTrustedRelationFilterRelation = string | readonly string[];\n\n/** @internal */\nexport interface NqlTrustedRelationFilterHop {\n\treadonly target: string;\n\treadonly fkColumn: readonly string[];\n\treadonly joinColumn: readonly string[];\n}\n\n/** @internal */\nexport interface NqlTrustedRelationFilterRecursive {\n\treadonly direction: 'up' | 'down';\n\treadonly maxDepth: number;\n\treadonly selfRefColumn: string;\n\treadonly targetKeyColumn: string;\n}\n\n/** @internal */\nexport interface NqlTrustedRelationFilterFields {\n\treadonly relation: NqlTrustedRelationFilterRelation;\n\treadonly targetTable: string;\n\treadonly sourceColumn: readonly string[];\n\treadonly targetColumn: readonly string[];\n\treadonly hops: readonly NqlTrustedRelationFilterHop[];\n\treadonly through?: string;\n\treadonly throughSourceColumn?: string;\n\treadonly throughTargetColumn?: string;\n\treadonly selectedColumn?: string;\n\treadonly cardinality?: 'one' | 'many';\n\treadonly relationType?: NqlBindingRelationType;\n\treadonly recursive?: NqlTrustedRelationFilterRecursive;\n}\n\n/**\n * @internal Opaque proof for NQL compiler-proven relation filter metadata.\n *\n * The module-private Symbol stores the frozen proven payload. Public\n * targetTable/sourceColumn/targetColumn/relation fields are display metadata only;\n * consumers must read the payload through getTrustedNqlRelationFilterFields().\n */\nexport interface NqlTrustedRelationFilterProof {\n\treadonly [NQL_TRUSTED_RELATION_FILTER]: NqlTrustedRelationFilterFields;\n}\n\nfunction isStringArray(value: unknown): value is readonly string[] {\n\treturn (\n\t\tArray.isArray(value) &&\n\t\tvalue.length > 0 &&\n\t\tvalue.every((item) => typeof item === 'string' && item.length > 0)\n\t);\n}\n\nfunction isRelationType(value: unknown): value is NqlBindingRelationType {\n\treturn (\n\t\tvalue === 'hasOne' ||\n\t\tvalue === 'hasMany' ||\n\t\tvalue === 'belongsTo' ||\n\t\tvalue === 'belongsToMany' ||\n\t\tvalue === 'manyToMany'\n\t);\n}\n\nfunction isTrustedRelationFilterHop(\n\tvalue: unknown,\n): value is NqlTrustedRelationFilterHop {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\tconst record = value as {\n\t\treadonly target?: unknown;\n\t\treadonly fkColumn?: unknown;\n\t\treadonly joinColumn?: unknown;\n\t};\n\treturn (\n\t\ttypeof record.target === 'string' &&\n\t\trecord.target.length > 0 &&\n\t\tisStringArray(record.fkColumn) &&\n\t\tisStringArray(record.joinColumn) &&\n\t\trecord.fkColumn.length === record.joinColumn.length\n\t);\n}\n\nfunction isTrustedRelationFilterRecursive(\n\tvalue: unknown,\n): value is NqlTrustedRelationFilterRecursive {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\tconst record = value as {\n\t\treadonly direction?: unknown;\n\t\treadonly maxDepth?: unknown;\n\t\treadonly selfRefColumn?: unknown;\n\t\treadonly targetKeyColumn?: unknown;\n\t};\n\treturn (\n\t\t(record.direction === 'up' || record.direction === 'down') &&\n\t\ttypeof record.maxDepth === 'number' &&\n\t\tNumber.isSafeInteger(record.maxDepth) &&\n\t\trecord.maxDepth > 0 &&\n\t\ttypeof record.selfRefColumn === 'string' &&\n\t\trecord.selfRefColumn.length > 0 &&\n\t\ttypeof record.targetKeyColumn === 'string' &&\n\t\trecord.targetKeyColumn.length > 0\n\t);\n}\n\nfunction relationHasMultipleHops(\n\trelation: NqlTrustedRelationFilterRelation,\n): boolean {\n\tif (typeof relation !== 'string') return relation.length > 1;\n\treturn relation.split('.').length > 1;\n}\n\nfunction isTrustedRelationFilterPayload(\n\tvalue: unknown,\n): value is NqlTrustedRelationFilterFields {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\tconst record = value as {\n\t\treadonly relation?: unknown;\n\t\treadonly targetTable?: unknown;\n\t\treadonly sourceColumn?: unknown;\n\t\treadonly targetColumn?: unknown;\n\t\treadonly hops?: unknown;\n\t\treadonly through?: unknown;\n\t\treadonly throughSourceColumn?: unknown;\n\t\treadonly throughTargetColumn?: unknown;\n\t\treadonly selectedColumn?: unknown;\n\t\treadonly cardinality?: unknown;\n\t\treadonly relationType?: unknown;\n\t\treadonly recursive?: unknown;\n\t};\n\treturn (\n\t\t(typeof record.relation === 'string' || isStringArray(record.relation)) &&\n\t\ttypeof record.targetTable === 'string' &&\n\t\tisStringArray(record.sourceColumn) &&\n\t\tisStringArray(record.targetColumn) &&\n\t\trecord.sourceColumn.length === record.targetColumn.length &&\n\t\tArray.isArray(record.hops) &&\n\t\trecord.hops.every(isTrustedRelationFilterHop) &&\n\t\t(record.through === undefined ||\n\t\t\t(typeof record.through === 'string' && record.through.length > 0)) &&\n\t\t(record.throughSourceColumn === undefined ||\n\t\t\t(typeof record.throughSourceColumn === 'string' &&\n\t\t\t\trecord.throughSourceColumn.length > 0)) &&\n\t\t(record.throughTargetColumn === undefined ||\n\t\t\t(typeof record.throughTargetColumn === 'string' &&\n\t\t\t\trecord.throughTargetColumn.length > 0)) &&\n\t\t(record.selectedColumn === undefined ||\n\t\t\ttypeof record.selectedColumn === 'string') &&\n\t\t(record.cardinality === undefined ||\n\t\t\trecord.cardinality === 'one' ||\n\t\t\trecord.cardinality === 'many') &&\n\t\t(record.relationType === undefined ||\n\t\t\tisRelationType(record.relationType)) &&\n\t\t(record.recursive === undefined ||\n\t\t\tisTrustedRelationFilterRecursive(record.recursive)) &&\n\t\t!(\n\t\t\trecord.selectedColumn !== undefined &&\n\t\t\trecord.cardinality === 'one' &&\n\t\t\trelationHasMultipleHops(record.relation) &&\n\t\t\trecord.hops.length === 0\n\t\t)\n\t);\n}\n\nfunction freezeTrustedRelationFilterPayload(\n\tfields: NqlTrustedRelationFilterFields,\n): NqlTrustedRelationFilterFields {\n\tconst relation = Array.isArray(fields.relation)\n\t\t? Object.freeze([...fields.relation])\n\t\t: fields.relation;\n\tconst through = fields.through;\n\tconst throughSourceColumn = fields.throughSourceColumn;\n\tconst throughTargetColumn = fields.throughTargetColumn;\n\tconst recursive =\n\t\tfields.recursive === undefined\n\t\t\t? undefined\n\t\t\t: Object.freeze({\n\t\t\t\t\tdirection: fields.recursive.direction,\n\t\t\t\t\tmaxDepth: fields.recursive.maxDepth,\n\t\t\t\t\tselfRefColumn: fields.recursive.selfRefColumn,\n\t\t\t\t\ttargetKeyColumn: fields.recursive.targetKeyColumn,\n\t\t\t\t});\n\tconst hops = Object.freeze(\n\t\tfields.hops.map((hop) =>\n\t\t\tObject.freeze({\n\t\t\t\ttarget: hop.target,\n\t\t\t\tfkColumn: Object.freeze([...hop.fkColumn]),\n\t\t\t\tjoinColumn: Object.freeze([...hop.joinColumn]),\n\t\t\t}),\n\t\t),\n\t);\n\treturn Object.freeze({\n\t\trelation,\n\t\ttargetTable: fields.targetTable,\n\t\tsourceColumn: Object.freeze([...fields.sourceColumn]),\n\t\ttargetColumn: Object.freeze([...fields.targetColumn]),\n\t\thops,\n\t\t...(through !== undefined && {\n\t\t\tthrough,\n\t\t}),\n\t\t...(throughSourceColumn !== undefined && {\n\t\t\tthroughSourceColumn,\n\t\t}),\n\t\t...(throughTargetColumn !== undefined && {\n\t\t\tthroughTargetColumn,\n\t\t}),\n\t\t...(fields.selectedColumn !== undefined && {\n\t\t\tselectedColumn: fields.selectedColumn,\n\t\t}),\n\t\t...(fields.cardinality !== undefined && {\n\t\t\tcardinality: fields.cardinality,\n\t\t}),\n\t\t...(fields.relationType !== undefined && {\n\t\t\trelationType: fields.relationType,\n\t\t}),\n\t\t...(recursive !== undefined && {\n\t\t\trecursive,\n\t\t}),\n\t});\n}\n\n/** @internal */\nexport function markNqlTrustedRelationFilter<T extends object>(\n\tvalue: T,\n\tfields: NqlTrustedRelationFilterFields,\n): T & NqlTrustedRelationFilterProof {\n\tObject.defineProperty(value, NQL_TRUSTED_RELATION_FILTER, {\n\t\tvalue: freezeTrustedRelationFilterPayload(fields),\n\t\tenumerable: false,\n\t});\n\treturn value as T & NqlTrustedRelationFilterProof;\n}\n\n/** @internal */\nexport function hasNqlTrustedRelationFilterProof(\n\tvalue: unknown,\n): value is NqlTrustedRelationFilterProof {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\tconst record = value as {\n\t\treadonly [NQL_TRUSTED_RELATION_FILTER]?: unknown;\n\t};\n\treturn (\n\t\tObject.hasOwn(record, NQL_TRUSTED_RELATION_FILTER) &&\n\t\tisTrustedRelationFilterPayload(record[NQL_TRUSTED_RELATION_FILTER])\n\t);\n}\n\n/** @internal */\nexport function getTrustedNqlRelationFilterFields(\n\tvalue: unknown,\n): NqlTrustedRelationFilterFields | undefined {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn undefined;\n\t}\n\tconst record = value as {\n\t\treadonly [NQL_TRUSTED_RELATION_FILTER]?: unknown;\n\t};\n\tconst payload = record[NQL_TRUSTED_RELATION_FILTER];\n\treturn isTrustedRelationFilterPayload(payload) ? payload : undefined;\n}\n\n// Re-export all public types for convenience\nexport * from './index.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCO,SAAS,uCACf,cACA,UACA,SACqB;AACrB,QAAM,gBAAgB,UACnB,wCAAwC,cAAc,OAAO,IAC7D;AACH,MAAI,cAAe,QAAO;AAC1B,MACC,SAAS,SAAS,mBAClB,SAAS,SAAS,gBAClB,SAAS,YAAY,UACrB,SAAS,aAAa,UACtB,SAAS,qBAAqB,UAC9B,SAAS,qBAAqB,QAC7B;AACD,WAAO,aAAa,YAAY,SAAS,SAAS,QAAQ,SAAS;AAAA,EACpE;AACA,MACC,SAAS,SAAS,eAClB,SAAS,SAAS,YAClB,SAAS,SAAS,WACjB;AACD,WAAO,aAAa,YAAY,SAAS,SAAS,QAAQ,SAAS;AAAA,EACpE;AACA,QAAM,YAAY,aAAa,SAAS,UAAU;AAClD,MAAI,UAAU,WAAW,KAAK,UAAU,KAAK,CAAC,QAAQ,IAAI,WAAW,CAAC,GAAG;AACxE,WAAO,aAAa,YAAY;AAAA,EACjC;AACA,MACC,SAAS,cAAc,UACtB,SAAS,WAAW,UACpB,SAAS,WAAW,UACpB,SAAS,WAAW,SAAS,QAC7B;AACD,WAAO,aAAa,YAAY;AAAA,EACjC;AACA,SAAO;AACR;AAEA,IAAM,gCAAqD,oBAAI,IAAI;AAAA,EAClE;AAAA,EACA;AACD,CAAC;AAED,SAAS,wCACR,cACA,SACqB;AACrB,QAAM,OAAO,OAAO,KAAK,OAAO;AAChC,QAAM,kBAAkB,KAAK;AAAA,IAC5B,CAAC,QAAQ,CAAC,8BAA8B,IAAI,GAAG;AAAA,EAChD;AACA,MAAI,gBAAgB,SAAS,GAAG;AAC/B,UAAM,UAAU,gBAAgB,IAAI,CAAC,QAAQ,IAAI,GA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ACD;AAAA,IACA,GAAI,OAAO,mBAAmB,UAAa;AAAA,MAC1C,gBAAgB,OAAO;AAAA,IACxB;AAAA,IACA,GAAI,OAAO,gBAAgB,UAAa;AAAA,MACvC,aAAa,OAAO;AAAA,IACrB;AAAA,IACA,GAAI,OAAO,iBAAiB,UAAa;AAAA,MACxC,cAAc,OAAO;AAAA,IACtB;AAAA,IACA,GAAI,cAAc,UAAa;AAAA,MAC9B;AAAA,IACD;AAAA,EACD,CAAC;AACF;AAGO,SAAS,6BACf,OACA,QACoC;AACpC,SAAO,eAAe,OAAO,6BAA6B;AAAA,IACzD,OAAO,mCAAmC,MAAM;AAAA,IAChD,YAAY;AAAA,EACb,CAAC;AACD,SAAO;AACR;AAGO,SAAS,iCACf,OACyC;AACzC,MAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAChD,WAAO;AAAA,EACR;AACA,QAAM,SAAS;AAGf,SACC,OAAO,OAAO,QAAQ,2BAA2B,KACjD,+BAA+B,OAAO,2BAA2B,CAAC;AAEpE;AAGO,SAAS,kCACf,OAC6C;AAC7C,MAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAChD,WAAO;AAAA,EACR;AACA,QAAM,SAAS;AAGf,QAAM,UAAU,OAAO,2BAA2B;AAClD,SAAO,+BAA+B,OAAO,IAAI,UAAU;AAC5D;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/internal.ts"],"sourcesContent":["/**\n * @dbsp/types/internal - Internal type definitions\n *\n * These types are for internal use by @dbsp package implementations.\n * They are NOT part of the public API and may change without notice.\n *\n * @module @dbsp/types/internal\n * @internal\n */\n\nimport { toColumnList } from './column-list.js';\nimport type { NqlBindingRelationType } from './model-ir.js';\n\n// Internal-only build utilities (NOT part of public API)\nexport type { IntentBuilder, Mutable } from './builders.js';\n\n/** @internal Minimal relation shape needed to validate NQL binding include hops. */\nexport interface NqlBindingIncludeRelationShape {\n\treadonly type?: NqlBindingRelationType | undefined;\n\treadonly foreignKey?: string | readonly string[] | undefined;\n\treadonly source?: string | undefined;\n\treadonly target?: string | undefined;\n\treadonly through?: unknown;\n\treadonly otherKey?: unknown;\n\treadonly throughSourceKey?: unknown;\n\treadonly throughTargetKey?: unknown;\n\treadonly recursive?: unknown;\n}\n\n/** @internal Minimal include-node shape needed to validate NQL binding include hops. */\nexport interface NqlBindingIncludeNodeShape {\n\treadonly relation?: unknown;\n\treadonly include?: readonly NqlBindingIncludeNodeShape[] | undefined;\n\treadonly [key: string]: unknown;\n}\n\n/** @internal */\nexport function explainUnsupportedNqlBindingIncludeHop(\n\trelationName: string,\n\trelation: NqlBindingIncludeRelationShape,\n\tinclude?: NqlBindingIncludeNodeShape,\n): string | undefined {\n\tconst includeReason = include\n\t\t? explainUnsupportedNqlBindingIncludeNode(relationName, include)\n\t\t: undefined;\n\tif (includeReason) return includeReason;\n\tif (\n\t\trelation.type === 'belongsToMany' ||\n\t\trelation.type === 'manyToMany' ||\n\t\trelation.through !== undefined ||\n\t\trelation.otherKey !== undefined ||\n\t\trelation.throughSourceKey !== undefined ||\n\t\trelation.throughTargetKey !== undefined\n\t) {\n\t\treturn `relation '${relationName}' is '${relation.type ?? 'through'}' and needs junction traversal; binding includes for many-to-many/through relations are not supported (ref-#192)`;\n\t}\n\tif (\n\t\trelation.type !== 'belongsTo' &&\n\t\trelation.type !== 'hasOne' &&\n\t\trelation.type !== 'hasMany'\n\t) {\n\t\treturn `relation '${relationName}' is '${relation.type ?? 'unknown'}'; binding includes require a belongsTo/hasOne/hasMany relation (ref-#192)`;\n\t}\n\tconst fkColumns = toColumnList(relation.foreignKey);\n\tif (fkColumns.length === 0 || fkColumns.some((col) => col.length === 0)) {\n\t\treturn `relation '${relationName}' must have at least one non-empty FK column for binding includes (ref-#179)`;\n\t}\n\tif (\n\t\trelation.recursive !== undefined ||\n\t\t(relation.source !== undefined &&\n\t\t\trelation.target !== undefined &&\n\t\t\trelation.source === relation.target)\n\t) {\n\t\treturn `relation '${relationName}' is recursive/self-referential; binding includes for recursive relations require recursive CTE handling and are not supported (ref-#193)`;\n\t}\n\treturn undefined;\n}\n\nconst NQL_BINDING_INCLUDE_NODE_KEYS: ReadonlySet<string> = new Set([\n\t'relation',\n\t'include',\n]);\n\nfunction explainUnsupportedNqlBindingIncludeNode(\n\trelationName: string,\n\tinclude: NqlBindingIncludeNodeShape,\n): string | undefined {\n\tconst keys = Object.keys(include);\n\tconst unsupportedKeys = keys.filter(\n\t\t(key) => !NQL_BINDING_INCLUDE_NODE_KEYS.has(key),\n\t);\n\tif (unsupportedKeys.length > 0) {\n\t\tconst options = unsupportedKeys.map((key) => `'${key}'`).join(', ');\n\t\treturn `relation '${relationName}' include node carries unsupported option${unsupportedKeys.length === 1 ? '' : 's'} ${options}; binding includes only allow 'relation' and nested 'include' (ref-#192)`;\n\t}\n\tif (typeof include.relation !== 'string' || include.relation.length === 0) {\n\t\treturn `relation '${relationName}' include node must name a relation (ref-#192)`;\n\t}\n\tif (include.include !== undefined && !Array.isArray(include.include)) {\n\t\treturn `relation '${relationName}' nested include must be an array (ref-#192)`;\n\t}\n\treturn undefined;\n}\n\n/**\n * @internal Shared compiler-options marker for trusted NQL package internals.\n *\n * Deliberately uses Symbol(), not Symbol.for(), so knowing the description does\n * not let callers forge the marker through the global symbol registry.\n */\nexport const NQL_INTERNAL_COMPILER_OPTIONS: unique symbol = Symbol(\n\t'@dbsp/nql/internalCompilerOptions',\n);\n\nconst NQL_BINDING_REF = Symbol('@dbsp/nql/bindingRef');\nconst NQL_TRUSTED_RELATION_FILTER = Symbol('@dbsp/nql/trustedRelationFilter');\n\n/**\n * @internal Opaque marker for NQL compiler-created binding references.\n *\n * The brand is a module-private Symbol(), so JSON/plain object inputs cannot\n * forge it by shape.\n */\nexport interface NqlBindingRef {\n\treadonly name: string;\n\treadonly [NQL_BINDING_REF]: true;\n}\n\n/** @internal */\nexport function createNqlBindingRef(name: string): NqlBindingRef {\n\tconst ref = { name } as { name: string; [NQL_BINDING_REF]?: true };\n\tObject.defineProperty(ref, NQL_BINDING_REF, {\n\t\tvalue: true,\n\t\tenumerable: false,\n\t});\n\treturn ref as NqlBindingRef;\n}\n\n/** @internal */\nexport function isNqlBindingRef(value: unknown): value is NqlBindingRef {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\tconst record = value as {\n\t\treadonly name?: unknown;\n\t\treadonly [NQL_BINDING_REF]?: unknown;\n\t};\n\treturn (\n\t\tObject.hasOwn(record, NQL_BINDING_REF) &&\n\t\trecord[NQL_BINDING_REF] === true &&\n\t\ttypeof record.name === 'string'\n\t);\n}\n\n/** @internal */\nexport function getNqlBindingRefName(ref: NqlBindingRef): string {\n\treturn ref.name;\n}\n\n/** @internal */\nexport type NqlTrustedRelationFilterRelation = string | readonly string[];\n\n/** @internal */\nexport interface NqlTrustedRelationFilterHop {\n\treadonly target: string;\n\treadonly fkColumn: readonly string[];\n\treadonly joinColumn: readonly string[];\n}\n\n/** @internal */\nexport interface NqlTrustedRelationFilterRecursive {\n\treadonly direction: 'up' | 'down';\n\treadonly maxDepth: number;\n\treadonly selfRefColumn: string;\n\treadonly targetKeyColumn: string;\n}\n\n/** @internal */\nexport interface NqlTrustedRelationFilterFields {\n\treadonly relation: NqlTrustedRelationFilterRelation;\n\treadonly targetTable: string;\n\treadonly sourceColumn: readonly string[];\n\treadonly targetColumn: readonly string[];\n\treadonly hops: readonly NqlTrustedRelationFilterHop[];\n\treadonly through?: string;\n\treadonly throughSourceColumn?: string;\n\treadonly throughTargetColumn?: string;\n\treadonly selectedColumn?: string;\n\treadonly cardinality?: 'one' | 'many';\n\treadonly relationType?: NqlBindingRelationType;\n\treadonly recursive?: NqlTrustedRelationFilterRecursive;\n}\n\n/**\n * @internal Opaque proof for NQL compiler-proven relation filter metadata.\n *\n * The module-private Symbol stores the frozen proven payload. Public\n * targetTable/sourceColumn/targetColumn/relation fields are display metadata only;\n * consumers must read the payload through getTrustedNqlRelationFilterFields().\n */\nexport interface NqlTrustedRelationFilterProof {\n\treadonly [NQL_TRUSTED_RELATION_FILTER]: NqlTrustedRelationFilterFields;\n}\n\nfunction isStringArray(value: unknown): value is readonly string[] {\n\treturn (\n\t\tArray.isArray(value) &&\n\t\tvalue.length > 0 &&\n\t\tvalue.every((item) => typeof item === 'string' && item.length > 0)\n\t);\n}\n\nfunction isRelationType(value: unknown): value is NqlBindingRelationType {\n\treturn (\n\t\tvalue === 'hasOne' ||\n\t\tvalue === 'hasMany' ||\n\t\tvalue === 'belongsTo' ||\n\t\tvalue === 'belongsToMany' ||\n\t\tvalue === 'manyToMany'\n\t);\n}\n\nfunction isTrustedRelationFilterHop(\n\tvalue: unknown,\n): value is NqlTrustedRelationFilterHop {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\tconst record = value as {\n\t\treadonly target?: unknown;\n\t\treadonly fkColumn?: unknown;\n\t\treadonly joinColumn?: unknown;\n\t};\n\treturn (\n\t\ttypeof record.target === 'string' &&\n\t\trecord.target.length > 0 &&\n\t\tisStringArray(record.fkColumn) &&\n\t\tisStringArray(record.joinColumn) &&\n\t\trecord.fkColumn.length === record.joinColumn.length\n\t);\n}\n\nfunction isTrustedRelationFilterRecursive(\n\tvalue: unknown,\n): value is NqlTrustedRelationFilterRecursive {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\tconst record = value as {\n\t\treadonly direction?: unknown;\n\t\treadonly maxDepth?: unknown;\n\t\treadonly selfRefColumn?: unknown;\n\t\treadonly targetKeyColumn?: unknown;\n\t};\n\treturn (\n\t\t(record.direction === 'up' || record.direction === 'down') &&\n\t\ttypeof record.maxDepth === 'number' &&\n\t\tNumber.isSafeInteger(record.maxDepth) &&\n\t\trecord.maxDepth > 0 &&\n\t\ttypeof record.selfRefColumn === 'string' &&\n\t\trecord.selfRefColumn.length > 0 &&\n\t\ttypeof record.targetKeyColumn === 'string' &&\n\t\trecord.targetKeyColumn.length > 0\n\t);\n}\n\nfunction relationHasMultipleHops(\n\trelation: NqlTrustedRelationFilterRelation,\n): boolean {\n\tif (typeof relation !== 'string') return relation.length > 1;\n\treturn relation.split('.').length > 1;\n}\n\nfunction isTrustedRelationFilterPayload(\n\tvalue: unknown,\n): value is NqlTrustedRelationFilterFields {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\tconst record = value as {\n\t\treadonly relation?: unknown;\n\t\treadonly targetTable?: unknown;\n\t\treadonly sourceColumn?: unknown;\n\t\treadonly targetColumn?: unknown;\n\t\treadonly hops?: unknown;\n\t\treadonly through?: unknown;\n\t\treadonly throughSourceColumn?: unknown;\n\t\treadonly throughTargetColumn?: unknown;\n\t\treadonly selectedColumn?: unknown;\n\t\treadonly cardinality?: unknown;\n\t\treadonly relationType?: unknown;\n\t\treadonly recursive?: unknown;\n\t};\n\treturn (\n\t\t(typeof record.relation === 'string' || isStringArray(record.relation)) &&\n\t\ttypeof record.targetTable === 'string' &&\n\t\tisStringArray(record.sourceColumn) &&\n\t\tisStringArray(record.targetColumn) &&\n\t\trecord.sourceColumn.length === record.targetColumn.length &&\n\t\tArray.isArray(record.hops) &&\n\t\trecord.hops.every(isTrustedRelationFilterHop) &&\n\t\t(record.through === undefined ||\n\t\t\t(typeof record.through === 'string' && record.through.length > 0)) &&\n\t\t(record.throughSourceColumn === undefined ||\n\t\t\t(typeof record.throughSourceColumn === 'string' &&\n\t\t\t\trecord.throughSourceColumn.length > 0)) &&\n\t\t(record.throughTargetColumn === undefined ||\n\t\t\t(typeof record.throughTargetColumn === 'string' &&\n\t\t\t\trecord.throughTargetColumn.length > 0)) &&\n\t\t(record.selectedColumn === undefined ||\n\t\t\ttypeof record.selectedColumn === 'string') &&\n\t\t(record.cardinality === undefined ||\n\t\t\trecord.cardinality === 'one' ||\n\t\t\trecord.cardinality === 'many') &&\n\t\t(record.relationType === undefined ||\n\t\t\tisRelationType(record.relationType)) &&\n\t\t(record.recursive === undefined ||\n\t\t\tisTrustedRelationFilterRecursive(record.recursive)) &&\n\t\t!(\n\t\t\trecord.selectedColumn !== undefined &&\n\t\t\trecord.cardinality === 'one' &&\n\t\t\trelationHasMultipleHops(record.relation) &&\n\t\t\trecord.hops.length === 0\n\t\t)\n\t);\n}\n\nfunction freezeTrustedRelationFilterPayload(\n\tfields: NqlTrustedRelationFilterFields,\n): NqlTrustedRelationFilterFields {\n\tconst relation = Array.isArray(fields.relation)\n\t\t? Object.freeze([...fields.relation])\n\t\t: fields.relation;\n\tconst through = fields.through;\n\tconst throughSourceColumn = fields.throughSourceColumn;\n\tconst throughTargetColumn = fields.throughTargetColumn;\n\tconst recursive =\n\t\tfields.recursive === undefined\n\t\t\t? undefined\n\t\t\t: Object.freeze({\n\t\t\t\t\tdirection: fields.recursive.direction,\n\t\t\t\t\tmaxDepth: fields.recursive.maxDepth,\n\t\t\t\t\tselfRefColumn: fields.recursive.selfRefColumn,\n\t\t\t\t\ttargetKeyColumn: fields.recursive.targetKeyColumn,\n\t\t\t\t});\n\tconst hops = Object.freeze(\n\t\tfields.hops.map((hop) =>\n\t\t\tObject.freeze({\n\t\t\t\ttarget: hop.target,\n\t\t\t\tfkColumn: Object.freeze([...hop.fkColumn]),\n\t\t\t\tjoinColumn: Object.freeze([...hop.joinColumn]),\n\t\t\t}),\n\t\t),\n\t);\n\treturn Object.freeze({\n\t\trelation,\n\t\ttargetTable: fields.targetTable,\n\t\tsourceColumn: Object.freeze([...fields.sourceColumn]),\n\t\ttargetColumn: Object.freeze([...fields.targetColumn]),\n\t\thops,\n\t\t...(through !== undefined && {\n\t\t\tthrough,\n\t\t}),\n\t\t...(throughSourceColumn !== undefined && {\n\t\t\tthroughSourceColumn,\n\t\t}),\n\t\t...(throughTargetColumn !== undefined && {\n\t\t\tthroughTargetColumn,\n\t\t}),\n\t\t...(fields.selectedColumn !== undefined && {\n\t\t\tselectedColumn: fields.selectedColumn,\n\t\t}),\n\t\t...(fields.cardinality !== undefined && {\n\t\t\tcardinality: fields.cardinality,\n\t\t}),\n\t\t...(fields.relationType !== undefined && {\n\t\t\trelationType: fields.relationType,\n\t\t}),\n\t\t...(recursive !== undefined && {\n\t\t\trecursive,\n\t\t}),\n\t});\n}\n\n/** @internal */\nexport function markNqlTrustedRelationFilter<T extends object>(\n\tvalue: T,\n\tfields: NqlTrustedRelationFilterFields,\n): T & NqlTrustedRelationFilterProof {\n\tObject.defineProperty(value, NQL_TRUSTED_RELATION_FILTER, {\n\t\tvalue: freezeTrustedRelationFilterPayload(fields),\n\t\tenumerable: false,\n\t});\n\treturn value as T & NqlTrustedRelationFilterProof;\n}\n\n/** @internal */\nexport function hasNqlTrustedRelationFilterProof(\n\tvalue: unknown,\n): value is NqlTrustedRelationFilterProof {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\tconst record = value as {\n\t\treadonly [NQL_TRUSTED_RELATION_FILTER]?: unknown;\n\t};\n\treturn (\n\t\tObject.hasOwn(record, NQL_TRUSTED_RELATION_FILTER) &&\n\t\tisTrustedRelationFilterPayload(record[NQL_TRUSTED_RELATION_FILTER])\n\t);\n}\n\n/** @internal */\nexport function getTrustedNqlRelationFilterFields(\n\tvalue: unknown,\n): NqlTrustedRelationFilterFields | undefined {\n\tif (value === null || typeof value !== 'object') {\n\t\treturn undefined;\n\t}\n\tconst record = value as {\n\t\treadonly [NQL_TRUSTED_RELATION_FILTER]?: unknown;\n\t};\n\tconst payload = record[NQL_TRUSTED_RELATION_FILTER];\n\treturn isTrustedRelationFilterPayload(payload) ? payload : undefined;\n}\n\n// Re-export all public types for convenience\nexport * from './index.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCO,SAAS,uCACf,cACA,UACA,SACqB;AACrB,QAAM,gBAAgB,UACnB,wCAAwC,cAAc,OAAO,IAC7D;AACH,MAAI,cAAe,QAAO;AAC1B,MACC,SAAS,SAAS,mBAClB,SAAS,SAAS,gBAClB,SAAS,YAAY,UACrB,SAAS,aAAa,UACtB,SAAS,qBAAqB,UA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b,CAAC;AACD,SAAO;AACR;AAGO,SAAS,iCACf,OACyC;AACzC,MAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAChD,WAAO;AAAA,EACR;AACA,QAAM,SAAS;AAGf,SACC,OAAO,OAAO,QAAQ,2BAA2B,KACjD,+BAA+B,OAAO,2BAA2B,CAAC;AAEpE;AAGO,SAAS,kCACf,OAC6C;AAC7C,MAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAChD,WAAO;AAAA,EACR;AACA,QAAM,SAAS;AAGf,QAAM,UAAU,OAAO,2BAA2B;AAClD,SAAO,+BAA+B,OAAO,IAAI,UAAU;AAC5D;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbsp/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Shared type definitions for the db-semantic-planner ecosystem",
|
|
5
5
|
"author": "Olivier Orabona <oorabona@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@types/node": "^26.1.0",
|
|
51
51
|
"typescript": "~6.0.3",
|
|
52
52
|
"tsup": "^8.5.1",
|
|
53
|
-
"vitest": "^
|
|
53
|
+
"vitest": "^5.0.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "tsup",
|