@cohesivesystems/relations 0.1.0-alpha.8 → 0.1.0-alpha.85

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.
@@ -4,6 +4,102 @@ export type GraphId = string;
4
4
 
5
5
  export type ShapeId = string;
6
6
 
7
+ export type TypeRef = {
8
+ readonly $type: 'named';
9
+ } & NamedTypeRef | {
10
+ readonly $type: 'opaque';
11
+ } & OpaqueRuntimeTypeRef | {
12
+ readonly $type: 'scalar';
13
+ } & ScalarTypeRef | {
14
+ readonly $type: 'enum';
15
+ } & EnumTypeRef | {
16
+ readonly $type: 'entityRef';
17
+ } & EntityReferenceTypeRef | {
18
+ readonly $type: 'array';
19
+ } & ArrayTypeRef | {
20
+ readonly $type: 'object';
21
+ } & ObjectTypeRef | {
22
+ readonly $type: 'quantity';
23
+ } & QuantityTypeRef | {
24
+ readonly $type: 'json';
25
+ } & JsonTypeRef;
26
+
27
+ export interface NamedTypeRef {
28
+ typeId: TypeId;
29
+ }
30
+
31
+ export interface OpaqueRuntimeTypeRef {
32
+ runtimeType: string;
33
+ inferenceDiagnostic?: TypeInferenceDiagnostic | null;
34
+ }
35
+
36
+ export interface ScalarTypeRef {
37
+ kind: ScalarTypeKind;
38
+ format: PrimitiveFormat;
39
+ }
40
+
41
+ export interface EnumTypeRef {
42
+ name: string;
43
+ members: string[];
44
+ }
45
+
46
+ export interface EntityReferenceTypeRef {
47
+ entity: EntityTypeName;
48
+ }
49
+
50
+ export interface ArrayTypeRef {
51
+ elementType: TypeRef;
52
+ }
53
+
54
+ export interface ObjectTypeRef {
55
+ fields: ObjectFieldTypeDef[];
56
+ }
57
+
58
+ export interface QuantityTypeRef {
59
+ quantity: string;
60
+ baseKind: ScalarTypeKind;
61
+ }
62
+
63
+ export interface JsonTypeRef {
64
+ kind: JsonTypeKind;
65
+ }
66
+
67
+ export type FieldCardinality = 'Single' | 'Many';
68
+
69
+ export const fieldCardinalities = {
70
+ single: 'Single',
71
+ many: 'Many',
72
+ } as const satisfies Record<string, FieldCardinality>;
73
+
74
+ export const fieldCardinalityLabels: Record<FieldCardinality, string> = {
75
+ Single: 'Single',
76
+ Many: 'Many',
77
+ };
78
+
79
+ export type FieldPresence = 'Required' | 'Optional';
80
+
81
+ export const fieldPresences = {
82
+ required: 'Required',
83
+ optional: 'Optional',
84
+ } as const satisfies Record<string, FieldPresence>;
85
+
86
+ export const fieldPresenceLabels: Record<FieldPresence, string> = {
87
+ Required: 'Required',
88
+ Optional: 'Optional',
89
+ };
90
+
91
+ export type FieldNullability = 'NonNullable' | 'Nullable';
92
+
93
+ export const fieldNullabilities = {
94
+ nonNullable: 'NonNullable',
95
+ nullable: 'Nullable',
96
+ } as const satisfies Record<string, FieldNullability>;
97
+
98
+ export const fieldNullabilityLabels: Record<FieldNullability, string> = {
99
+ NonNullable: 'NonNullable',
100
+ Nullable: 'Nullable',
101
+ };
102
+
7
103
  export type RelationQueryExplainStage = {
8
104
  readonly $stage: 'staticCompilation';
9
105
  } & RelationQueryStaticCompilationExplainStage | {
@@ -371,19 +467,11 @@ export interface RelationDraftDocumentMetadata {
371
467
 
372
468
  export type RelationQueryDefinition = {
373
469
  readonly $definition: 'relation';
374
- } & RelationDefinition | {
470
+ readonly value: unknown;
471
+ } | {
375
472
  readonly $definition: 'query';
376
473
  } & QueryDefinition;
377
474
 
378
- export interface RelationDefinition {
379
- id: RelationId;
380
- name: RelationName;
381
- rootBinding: ValueBindingId;
382
- output: RelationOutputDefinition;
383
- invariants: InvariantDefinition[];
384
- body: LogicalQueryDefinition;
385
- }
386
-
387
475
  export interface QueryDefinition {
388
476
  id: QueryId;
389
477
  name: QueryName;
@@ -431,6 +519,100 @@ export interface RelationshipCatalogDocumentMetadata {
431
519
  annotations: Record<string, AnnotationValue>;
432
520
  }
433
521
 
522
+ export type TypeId = string;
523
+
524
+ export interface TypeInferenceDiagnostic {
525
+ reason: string;
526
+ message?: string | null;
527
+ }
528
+
529
+ export type ScalarTypeKind = 'Bool' | 'Int32' | 'Int64' | 'Decimal' | 'String' | 'Guid' | 'Date' | 'DateTime' | 'Instant' | 'Bytes';
530
+
531
+ export const scalarTypeKinds = {
532
+ bool: 'Bool',
533
+ int32: 'Int32',
534
+ int64: 'Int64',
535
+ decimal: 'Decimal',
536
+ string: 'String',
537
+ guid: 'Guid',
538
+ date: 'Date',
539
+ dateTime: 'DateTime',
540
+ instant: 'Instant',
541
+ bytes: 'Bytes',
542
+ } as const satisfies Record<string, ScalarTypeKind>;
543
+
544
+ export const scalarTypeKindLabels: Record<ScalarTypeKind, string> = {
545
+ Bool: 'Bool',
546
+ Int32: 'Int32',
547
+ Int64: 'Int64',
548
+ Decimal: 'Decimal',
549
+ String: 'String',
550
+ Guid: 'Guid',
551
+ Date: 'Date',
552
+ DateTime: 'DateTime',
553
+ Instant: 'Instant',
554
+ Bytes: 'Bytes',
555
+ };
556
+
557
+ export type PrimitiveFormat = 'None' | 'Uuid' | 'IsoDate' | 'IsoDateTime' | 'IsoInstant' | 'CurrencyCode' | 'CountryCode' | 'Email' | 'Uri' | 'Base64';
558
+
559
+ export const primitiveFormats = {
560
+ none: 'None',
561
+ uuid: 'Uuid',
562
+ isoDate: 'IsoDate',
563
+ isoDateTime: 'IsoDateTime',
564
+ isoInstant: 'IsoInstant',
565
+ currencyCode: 'CurrencyCode',
566
+ countryCode: 'CountryCode',
567
+ email: 'Email',
568
+ uri: 'Uri',
569
+ base64: 'Base64',
570
+ } as const satisfies Record<string, PrimitiveFormat>;
571
+
572
+ export const primitiveFormatLabels: Record<PrimitiveFormat, string> = {
573
+ None: 'None',
574
+ Uuid: 'Uuid',
575
+ IsoDate: 'IsoDate',
576
+ IsoDateTime: 'IsoDateTime',
577
+ IsoInstant: 'IsoInstant',
578
+ CurrencyCode: 'CurrencyCode',
579
+ CountryCode: 'CountryCode',
580
+ Email: 'Email',
581
+ Uri: 'Uri',
582
+ Base64: 'Base64',
583
+ };
584
+
585
+ export type EntityTypeName = string;
586
+
587
+ export interface ObjectFieldTypeDef {
588
+ name: string;
589
+ type: TypeRef;
590
+ cardinality: FieldCardinality;
591
+ presence: FieldPresence;
592
+ nullability: FieldNullability;
593
+ annotations: Record<string, AnnotationValue>;
594
+ }
595
+
596
+ export type JsonTypeKind = 'Any' | 'Object' | 'Array' | 'String' | 'Number' | 'Boolean';
597
+
598
+ export const jsonTypeKinds = {
599
+ any: 'Any',
600
+ object: 'Object',
601
+ array: 'Array',
602
+ string: 'String',
603
+ number: 'Number',
604
+ boolean: 'Boolean',
605
+ } as const satisfies Record<string, JsonTypeKind>;
606
+
607
+ export const jsonTypeKindLabels: Record<JsonTypeKind, string> = {
608
+ Any: 'Any',
609
+ Object: 'Object',
610
+ Array: 'Array',
611
+ String: 'String',
612
+ Number: 'Number',
613
+ Boolean: 'Boolean',
614
+ };
615
+
434
616
  export type RelationQueryExplainStageStatus = 'Complete' | 'Unavailable' | 'Invalid' | 'Incomplete' | 'Failed';
435
617
 
436
618
  export const relationQueryExplainStageStatuses = {
@@ -1180,13 +1362,6 @@ export interface RelationDraftConventionDecision {
1180
1362
  target: FieldPath;
1181
1363
  }
1182
1364
 
1183
- export interface RelationOutputDefinition {
1184
- node: QueryNodeId;
1185
- shape: QualifiedShapeId;
1186
- mode: RelationOutputMode;
1187
- key?: Expr | null;
1188
- }
1189
-
1190
1365
  export type QueryId = string;
1191
1366
 
1192
1367
  export type QueryName = string;
@@ -1387,7 +1562,7 @@ export const relationQueryBoundAssessmentStatusLabels: Record<RelationQueryBound
1387
1562
  Blocked: 'Blocked',
1388
1563
  };
1389
1564
 
1390
- export type RelationQueryLogicalCapabilityKind = 'Source' | 'Filter' | 'RelationshipTraversal' | 'ForwardRelationshipTraversal' | 'InverseRelationshipTraversal' | 'AtMostOneRelationshipTraversal' | 'ManyRelationshipTraversal' | 'RequiredRelationshipTraversal' | 'OptionalRelationshipTraversal' | 'Join' | 'InnerJoin' | 'LeftOuterJoin' | 'RightOuterJoin' | 'FullOuterJoin' | 'TemporalJoin' | 'ExpandCollection' | 'Projection' | 'ProjectionAssignment' | 'DistinctRows' | 'DistinctKeys' | 'Aggregation' | 'AggregateGrouping' | 'AggregateFilter' | 'CountAggregate' | 'SumAggregate' | 'MinimumAggregate' | 'MaximumAggregate' | 'AnyAggregate' | 'AllAggregate' | 'Ordering' | 'AscendingOrdering' | 'DescendingOrdering' | 'NullsFirst' | 'NullsLast' | 'StableTieOrdering' | 'OffsetPaging' | 'KeysetPaging' | 'OnePerRootRelationOutput' | 'ZeroOrOnePerRootRelationOutput' | 'ManyPerRootRelationOutput' | 'SetRelationOutput' | 'RelationOutputIdentity' | 'RelationInvariant' | 'QueryRowsResult' | 'QueryAggregationResult' | 'AlwaysPresentBinding' | 'MayBeAbsentBinding' | 'AverageAggregate';
1565
+ export type RelationQueryLogicalCapabilityKind = 'Source' | 'Filter' | 'RelationshipTraversal' | 'ForwardRelationshipTraversal' | 'InverseRelationshipTraversal' | 'AtMostOneRelationshipTraversal' | 'ManyRelationshipTraversal' | 'RequiredRelationshipTraversal' | 'OptionalRelationshipTraversal' | 'Join' | 'InnerJoin' | 'LeftOuterJoin' | 'RightOuterJoin' | 'FullOuterJoin' | 'TemporalJoin' | 'ExpandCollection' | 'Projection' | 'ProjectionAssignment' | 'DistinctRows' | 'DistinctKeys' | 'Aggregation' | 'AggregateGrouping' | 'AggregateFilter' | 'CountAggregate' | 'SumAggregate' | 'MinimumAggregate' | 'MaximumAggregate' | 'AnyAggregate' | 'AllAggregate' | 'Ordering' | 'AscendingOrdering' | 'DescendingOrdering' | 'NullsFirst' | 'NullsLast' | 'StableTieOrdering' | 'OffsetPaging' | 'KeysetPaging' | 'OnePerRootRelationOutput' | 'ZeroOrOnePerRootRelationOutput' | 'ManyPerRootRelationOutput' | 'SetRelationOutput' | 'RelationOutputIdentity' | 'RelationInvariant' | 'QueryRowsResult' | 'QueryAggregationResult' | 'AlwaysPresentBinding' | 'MayBeAbsentBinding' | 'AverageAggregate' | 'SelectRepresentative';
1391
1566
 
1392
1567
  export const relationQueryLogicalCapabilityKinds = {
1393
1568
  source: 'Source',
@@ -1438,6 +1613,7 @@ export const relationQueryLogicalCapabilityKinds = {
1438
1613
  alwaysPresentBinding: 'AlwaysPresentBinding',
1439
1614
  mayBeAbsentBinding: 'MayBeAbsentBinding',
1440
1615
  averageAggregate: 'AverageAggregate',
1616
+ selectRepresentative: 'SelectRepresentative',
1441
1617
  } as const satisfies Record<string, RelationQueryLogicalCapabilityKind>;
1442
1618
 
1443
1619
  export const relationQueryLogicalCapabilityKindLabels: Record<RelationQueryLogicalCapabilityKind, string> = {
@@ -1489,6 +1665,7 @@ export const relationQueryLogicalCapabilityKindLabels: Record<RelationQueryLogic
1489
1665
  AlwaysPresentBinding: 'AlwaysPresentBinding',
1490
1666
  MayBeAbsentBinding: 'MayBeAbsentBinding',
1491
1667
  AverageAggregate: 'AverageAggregate',
1668
+ SelectRepresentative: 'SelectRepresentative',
1492
1669
  };
1493
1670
 
1494
1671
  export interface ExprCapabilityId {
@@ -1742,6 +1919,8 @@ export type LogicalQueryNode = {
1742
1919
  } & ProjectQueryNode | {
1743
1920
  readonly $node: 'distinct';
1744
1921
  } & DistinctQueryNode | {
1922
+ readonly $node: 'selectRepresentative';
1923
+ } & SelectRepresentativeQueryNode | {
1745
1924
  readonly $node: 'aggregate';
1746
1925
  } & AggregateQueryNode | {
1747
1926
  readonly $node: 'order';
@@ -1794,6 +1973,7 @@ export interface ExpandCollectionQueryNode {
1794
1973
  collection: Expr;
1795
1974
  itemBinding: ValueBindingId;
1796
1975
  itemType: TypeRef;
1976
+ itemShape?: QualifiedShapeId | null;
1797
1977
  id: QueryNodeId;
1798
1978
  }
1799
1979
 
@@ -1811,6 +1991,13 @@ export interface DistinctQueryNode {
1811
1991
  id: QueryNodeId;
1812
1992
  }
1813
1993
 
1994
+ export interface SelectRepresentativeQueryNode {
1995
+ id: QueryNodeId;
1996
+ input: QueryNodeId;
1997
+ keys: Expr[];
1998
+ orderings: QueryOrdering[];
1999
+ }
2000
+
1814
2001
  export interface AggregateQueryNode {
1815
2002
  input: QueryNodeId;
1816
2003
  resultBinding: ValueBindingId;
@@ -1889,66 +2076,6 @@ export const binaryOperatorLabels: Record<BinaryOperator, string> = {
1889
2076
  Div: 'Div',
1890
2077
  };
1891
2078
 
1892
- export type TypeRef = {
1893
- readonly $type: 'named';
1894
- } & NamedTypeRef | {
1895
- readonly $type: 'opaque';
1896
- } & OpaqueRuntimeTypeRef | {
1897
- readonly $type: 'scalar';
1898
- } & ScalarTypeRef | {
1899
- readonly $type: 'enum';
1900
- } & EnumTypeRef | {
1901
- readonly $type: 'entityRef';
1902
- } & EntityReferenceTypeRef | {
1903
- readonly $type: 'array';
1904
- } & ArrayTypeRef | {
1905
- readonly $type: 'object';
1906
- } & ObjectTypeRef | {
1907
- readonly $type: 'quantity';
1908
- } & QuantityTypeRef | {
1909
- readonly $type: 'json';
1910
- } & JsonTypeRef;
1911
-
1912
- export interface NamedTypeRef {
1913
- typeId: TypeId;
1914
- }
1915
-
1916
- export interface OpaqueRuntimeTypeRef {
1917
- runtimeType: string;
1918
- inferenceDiagnostic?: TypeInferenceDiagnostic | null;
1919
- }
1920
-
1921
- export interface ScalarTypeRef {
1922
- kind: ScalarTypeKind;
1923
- format: PrimitiveFormat;
1924
- }
1925
-
1926
- export interface EnumTypeRef {
1927
- name: string;
1928
- members: string[];
1929
- }
1930
-
1931
- export interface EntityReferenceTypeRef {
1932
- entity: EntityTypeName;
1933
- }
1934
-
1935
- export interface ArrayTypeRef {
1936
- elementType: TypeRef;
1937
- }
1938
-
1939
- export interface ObjectTypeRef {
1940
- fields: ObjectFieldTypeDef[];
1941
- }
1942
-
1943
- export interface QuantityTypeRef {
1944
- quantity: string;
1945
- baseKind: ScalarTypeKind;
1946
- }
1947
-
1948
- export interface JsonTypeRef {
1949
- kind: JsonTypeKind;
1950
- }
1951
-
1952
2079
  export type AggregateOperator = 'Count' | 'Sum' | 'Min' | 'Max' | 'Any' | 'All' | 'Average';
1953
2080
 
1954
2081
  export const aggregateOperators = {
@@ -2252,6 +2379,12 @@ export interface ProjectionAssignment {
2252
2379
  value: Expr;
2253
2380
  }
2254
2381
 
2382
+ export interface QueryOrdering {
2383
+ key: Expr;
2384
+ direction: QuerySortDirection;
2385
+ nullPlacement: QueryNullPlacement;
2386
+ }
2387
+
2255
2388
  export interface QueryGrouping {
2256
2389
  id: QueryAssignmentId;
2257
2390
  target: FieldPath;
@@ -2266,12 +2399,6 @@ export interface QueryAggregateAssignment {
2266
2399
  filter?: Expr | null;
2267
2400
  }
2268
2401
 
2269
- export interface QueryOrdering {
2270
- key: Expr;
2271
- direction: QuerySortDirection;
2272
- nullPlacement: QueryNullPlacement;
2273
- }
2274
-
2275
2402
  export type QueryPageDefinition = {
2276
2403
  readonly $page: 'offset';
2277
2404
  } & OffsetPageDefinition | {
@@ -2290,18 +2417,6 @@ export interface KeysetPageDefinition {
2290
2417
 
2291
2418
  export type QueryParameterId = string;
2292
2419
 
2293
- export type FieldPresence = 'Required' | 'Optional';
2294
-
2295
- export const fieldPresences = {
2296
- required: 'Required',
2297
- optional: 'Optional',
2298
- } as const satisfies Record<string, FieldPresence>;
2299
-
2300
- export const fieldPresenceLabels: Record<FieldPresence, string> = {
2301
- Required: 'Required',
2302
- Optional: 'Optional',
2303
- };
2304
-
2305
2420
  export type QueryParameterDefaultKind = 'None' | 'Value';
2306
2421
 
2307
2422
  export const queryParameterDefaultKinds = {
@@ -2343,100 +2458,6 @@ export interface AmbiguousRelationDraftAssignmentResolution {
2343
2458
  candidateIds: RelationDraftCandidateId[];
2344
2459
  }
2345
2460
 
2346
- export type TypeId = string;
2347
-
2348
- export interface TypeInferenceDiagnostic {
2349
- reason: string;
2350
- message?: string | null;
2351
- }
2352
-
2353
- export type ScalarTypeKind = 'Bool' | 'Int32' | 'Int64' | 'Decimal' | 'String' | 'Guid' | 'Date' | 'DateTime' | 'Instant' | 'Bytes';
2354
-
2355
- export const scalarTypeKinds = {
2356
- bool: 'Bool',
2357
- int32: 'Int32',
2358
- int64: 'Int64',
2359
- decimal: 'Decimal',
2360
- string: 'String',
2361
- guid: 'Guid',
2362
- date: 'Date',
2363
- dateTime: 'DateTime',
2364
- instant: 'Instant',
2365
- bytes: 'Bytes',
2366
- } as const satisfies Record<string, ScalarTypeKind>;
2367
-
2368
- export const scalarTypeKindLabels: Record<ScalarTypeKind, string> = {
2369
- Bool: 'Bool',
2370
- Int32: 'Int32',
2371
- Int64: 'Int64',
2372
- Decimal: 'Decimal',
2373
- String: 'String',
2374
- Guid: 'Guid',
2375
- Date: 'Date',
2376
- DateTime: 'DateTime',
2377
- Instant: 'Instant',
2378
- Bytes: 'Bytes',
2379
- };
2380
-
2381
- export type PrimitiveFormat = 'None' | 'Uuid' | 'IsoDate' | 'IsoDateTime' | 'IsoInstant' | 'CurrencyCode' | 'CountryCode' | 'Email' | 'Uri' | 'Base64';
2382
-
2383
- export const primitiveFormats = {
2384
- none: 'None',
2385
- uuid: 'Uuid',
2386
- isoDate: 'IsoDate',
2387
- isoDateTime: 'IsoDateTime',
2388
- isoInstant: 'IsoInstant',
2389
- currencyCode: 'CurrencyCode',
2390
- countryCode: 'CountryCode',
2391
- email: 'Email',
2392
- uri: 'Uri',
2393
- base64: 'Base64',
2394
- } as const satisfies Record<string, PrimitiveFormat>;
2395
-
2396
- export const primitiveFormatLabels: Record<PrimitiveFormat, string> = {
2397
- None: 'None',
2398
- Uuid: 'Uuid',
2399
- IsoDate: 'IsoDate',
2400
- IsoDateTime: 'IsoDateTime',
2401
- IsoInstant: 'IsoInstant',
2402
- CurrencyCode: 'CurrencyCode',
2403
- CountryCode: 'CountryCode',
2404
- Email: 'Email',
2405
- Uri: 'Uri',
2406
- Base64: 'Base64',
2407
- };
2408
-
2409
- export type EntityTypeName = string;
2410
-
2411
- export interface ObjectFieldTypeDef {
2412
- name: string;
2413
- type: TypeRef;
2414
- cardinality: FieldCardinality;
2415
- presence: FieldPresence;
2416
- nullability: FieldNullability;
2417
- annotations: Record<string, AnnotationValue>;
2418
- }
2419
-
2420
- export type JsonTypeKind = 'Any' | 'Object' | 'Array' | 'String' | 'Number' | 'Boolean';
2421
-
2422
- export const jsonTypeKinds = {
2423
- any: 'Any',
2424
- object: 'Object',
2425
- array: 'Array',
2426
- string: 'String',
2427
- number: 'Number',
2428
- boolean: 'Boolean',
2429
- } as const satisfies Record<string, JsonTypeKind>;
2430
-
2431
- export const jsonTypeKindLabels: Record<JsonTypeKind, string> = {
2432
- Any: 'Any',
2433
- Object: 'Object',
2434
- Array: 'Array',
2435
- String: 'String',
2436
- Number: 'Number',
2437
- Boolean: 'Boolean',
2438
- };
2439
-
2440
2461
  export interface RelationQueryLogicalPlanInput {
2441
2462
  canonicalInput: QueryNodeId;
2442
2463
  effectiveInput: QueryNodeId;
@@ -2489,7 +2510,7 @@ export const relationQueryRealizationTraceStepKindLabels: Record<RelationQueryRe
2489
2510
  Terminal: 'Terminal',
2490
2511
  };
2491
2512
 
2492
- export type RelationQueryExpressionSiteKind = 'FilterPredicate' | 'JoinPredicate' | 'ExpandCollection' | 'ProjectionAssignmentValue' | 'DistinctKey' | 'AggregateGroupingKey' | 'AggregateAssignmentValue' | 'AggregateAssignmentFilter' | 'OrderKey' | 'KeysetBoundary' | 'RelationOutputKey' | 'RelationInvariant' | 'TemporalJoinCorrelation' | 'TemporalJoinPoint' | 'TemporalJoinIntervalLowerBound' | 'TemporalJoinIntervalUpperBound';
2513
+ export type RelationQueryExpressionSiteKind = 'FilterPredicate' | 'JoinPredicate' | 'ExpandCollection' | 'ProjectionAssignmentValue' | 'DistinctKey' | 'AggregateGroupingKey' | 'AggregateAssignmentValue' | 'AggregateAssignmentFilter' | 'OrderKey' | 'KeysetBoundary' | 'RelationOutputKey' | 'RelationInvariant' | 'TemporalJoinCorrelation' | 'TemporalJoinPoint' | 'TemporalJoinIntervalLowerBound' | 'TemporalJoinIntervalUpperBound' | 'RepresentativeKey';
2493
2514
 
2494
2515
  export const relationQueryExpressionSiteKinds = {
2495
2516
  filterPredicate: 'FilterPredicate',
@@ -2508,6 +2529,7 @@ export const relationQueryExpressionSiteKinds = {
2508
2529
  temporalJoinPoint: 'TemporalJoinPoint',
2509
2530
  temporalJoinIntervalLowerBound: 'TemporalJoinIntervalLowerBound',
2510
2531
  temporalJoinIntervalUpperBound: 'TemporalJoinIntervalUpperBound',
2532
+ representativeKey: 'RepresentativeKey',
2511
2533
  } as const satisfies Record<string, RelationQueryExpressionSiteKind>;
2512
2534
 
2513
2535
  export const relationQueryExpressionSiteKindLabels: Record<RelationQueryExpressionSiteKind, string> = {
@@ -2527,6 +2549,7 @@ export const relationQueryExpressionSiteKindLabels: Record<RelationQueryExpressi
2527
2549
  TemporalJoinPoint: 'TemporalJoinPoint',
2528
2550
  TemporalJoinIntervalLowerBound: 'TemporalJoinIntervalLowerBound',
2529
2551
  TemporalJoinIntervalUpperBound: 'TemporalJoinIntervalUpperBound',
2552
+ RepresentativeKey: 'RepresentativeKey',
2530
2553
  };
2531
2554
 
2532
2555
  export type ExprSiteId = string;
@@ -2586,30 +2609,6 @@ export const relationDraftUnresolvedReasonLabels: Record<RelationDraftUnresolved
2586
2609
  MultipleCandidates: 'MultipleCandidates',
2587
2610
  };
2588
2611
 
2589
- export type FieldCardinality = 'Single' | 'Many';
2590
-
2591
- export const fieldCardinalities = {
2592
- single: 'Single',
2593
- many: 'Many',
2594
- } as const satisfies Record<string, FieldCardinality>;
2595
-
2596
- export const fieldCardinalityLabels: Record<FieldCardinality, string> = {
2597
- Single: 'Single',
2598
- Many: 'Many',
2599
- };
2600
-
2601
- export type FieldNullability = 'NonNullable' | 'Nullable';
2602
-
2603
- export const fieldNullabilities = {
2604
- nonNullable: 'NonNullable',
2605
- nullable: 'Nullable',
2606
- } as const satisfies Record<string, FieldNullability>;
2607
-
2608
- export const fieldNullabilityLabels: Record<FieldNullability, string> = {
2609
- NonNullable: 'NonNullable',
2610
- Nullable: 'Nullable',
2611
- };
2612
-
2613
2612
  export interface RelationQueryLogicalBypass {
2614
2613
  kind: RelationQueryLogicalBypassKind;
2615
2614
  node: QueryNodeId;
@@ -2705,6 +2704,14 @@ export interface QualifiedShapeId {
2705
2704
  shapeId: ShapeId;
2706
2705
  }
2707
2706
 
2707
+ export interface ValueContract {
2708
+ type?: TypeRef | null;
2709
+ shape?: QualifiedShapeId | null;
2710
+ cardinality: FieldCardinality;
2711
+ presence: FieldPresence;
2712
+ nullability: FieldNullability;
2713
+ }
2714
+
2708
2715
  export interface RelationQueryExplainArtifact {
2709
2716
  schemaVersion: string;
2710
2717
  stages: RelationQueryExplainStage[];