@cohesivesystems/relations 0.1.0-alpha.1

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/LICENSE ADDED
@@ -0,0 +1,55 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work.
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on or derived from the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link or bind by name to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor grants You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor grants You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to patent claims licensable by such Contributor that are necessarily infringed by their Contribution alone or by combination of their Contribution with the Work to which such Contribution was submitted. If You institute patent litigation against any entity alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. This does not supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort, contract, or otherwise, unless required by applicable law or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages arising as a result of this License or out of the use or inability to use the Work, even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer and charge a fee for acceptance of support, warranty, indemnity, or other liability obligations. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,390 @@
1
+ export interface GraphId {
2
+ Value: string;
3
+ }
4
+ export interface ShapeId {
5
+ Value: string;
6
+ }
7
+ export interface RelationId {
8
+ Value: string;
9
+ }
10
+ export interface RelationName {
11
+ Value: string;
12
+ }
13
+ export interface RelationSource {
14
+ Alias: SourceAlias;
15
+ ShapeId: ShapeId;
16
+ Cardinality: SourceCardinality;
17
+ }
18
+ export interface JoinDefinition {
19
+ Left: SourceAlias;
20
+ Right: SourceAlias;
21
+ Kind: JoinKind;
22
+ On: Expr;
23
+ }
24
+ export type Expr = {
25
+ readonly $expr: 'field';
26
+ } & FieldExpr | {
27
+ readonly $expr: 'currentItem';
28
+ } & CurrentItemExpr | {
29
+ readonly $expr: 'parameter';
30
+ } & ParameterExpr | {
31
+ readonly $expr: 'constant';
32
+ } & ConstantExpr | {
33
+ readonly $expr: 'unary';
34
+ } & UnaryExpr | {
35
+ readonly $expr: 'binary';
36
+ } & BinaryExpr | {
37
+ readonly $expr: 'conditional';
38
+ } & ConditionalExpr | {
39
+ readonly $expr: 'function';
40
+ } & CallExpr | {
41
+ readonly $expr: 'typedFieldRef';
42
+ } & FieldRefExpr | {
43
+ readonly $expr: 'literal';
44
+ } & LiteralExpr | {
45
+ readonly $expr: 'aggregate';
46
+ } & AggregateExpr;
47
+ export interface FieldExpr {
48
+ Path: FieldPath;
49
+ }
50
+ export type CurrentItemExpr = Record<never, never>;
51
+ export interface ParameterExpr {
52
+ Parameter: string;
53
+ }
54
+ export interface ConstantExpr {
55
+ Value: unknown;
56
+ }
57
+ export interface UnaryExpr {
58
+ Operator: UnaryOperator;
59
+ Operand: Expr;
60
+ }
61
+ export interface BinaryExpr {
62
+ Operator: BinaryOperator;
63
+ Left: Expr;
64
+ Right: Expr;
65
+ }
66
+ export interface ConditionalExpr {
67
+ Test: Expr;
68
+ IfTrue: Expr;
69
+ IfFalse: Expr;
70
+ ReturnType: TypeRef;
71
+ }
72
+ export interface CallExpr {
73
+ Function: string;
74
+ Arguments: Expr[];
75
+ ReturnType: TypeRef;
76
+ }
77
+ export interface FieldRefExpr {
78
+ Path: FieldPath;
79
+ Type: TypeRef;
80
+ }
81
+ export interface LiteralExpr {
82
+ Type: TypeRef;
83
+ Value: unknown;
84
+ }
85
+ export interface AggregateExpr {
86
+ Operator: AggregateOperator;
87
+ Source: Expr;
88
+ GroupBy: Expr[];
89
+ ReturnType: TypeRef;
90
+ }
91
+ export interface MappingDefinition {
92
+ Id: MappingId;
93
+ Name: MappingName;
94
+ Kind: MappingKind;
95
+ SourceShapeId?: ShapeId | null;
96
+ TargetShapeId: ShapeId;
97
+ Assignments: FieldAssignment[];
98
+ Predicate?: Expr | null;
99
+ ForEach?: Expr | null;
100
+ Key?: Expr | null;
101
+ Entity?: Expr | null;
102
+ Scope: MappingScope;
103
+ Direction: MappingDirection;
104
+ NestedMappings: NestedMapping[];
105
+ CollectionMappings: CollectionMapping[];
106
+ Metadata: MappingMetadata;
107
+ }
108
+ export interface MaterializationSpec {
109
+ IsEnabled: boolean;
110
+ Strategy: MaterializationStrategy;
111
+ Freshness: FreshnessPolicy;
112
+ AllowCodegen: boolean;
113
+ }
114
+ export interface RelationMetadata {
115
+ AllowCodegen: boolean;
116
+ Deterministic: boolean;
117
+ Hints: ({
118
+ Key: string;
119
+ Value: string;
120
+ })[];
121
+ }
122
+ export interface InvariantDefinition {
123
+ Name: string;
124
+ Expression: Expr;
125
+ Message?: string | null;
126
+ }
127
+ export interface SourceAlias {
128
+ Value: string;
129
+ }
130
+ export type SourceCardinality = 0 | 1;
131
+ export declare const sourceCardinalities: {
132
+ readonly single: 0;
133
+ readonly many: 1;
134
+ };
135
+ export declare const sourceCardinalityLabels: Record<SourceCardinality, string>;
136
+ export type JoinKind = 0 | 1 | 2 | 3;
137
+ export declare const joinKinds: {
138
+ readonly inner: 0;
139
+ readonly left: 1;
140
+ readonly right: 2;
141
+ readonly full: 3;
142
+ };
143
+ export declare const joinKindLabels: Record<JoinKind, string>;
144
+ export interface FieldPath {
145
+ Segments: FieldPathSegment[];
146
+ }
147
+ export type UnaryOperator = 0;
148
+ export declare const unaryOperators: {
149
+ readonly not: 0;
150
+ };
151
+ export declare const unaryOperatorLabels: Record<UnaryOperator, string>;
152
+ export type BinaryOperator = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
153
+ export declare const binaryOperators: {
154
+ readonly eq: 0;
155
+ readonly ne: 1;
156
+ readonly gt: 2;
157
+ readonly ge: 3;
158
+ readonly lt: 4;
159
+ readonly le: 5;
160
+ readonly and: 6;
161
+ readonly or: 7;
162
+ readonly add: 8;
163
+ readonly sub: 9;
164
+ readonly mul: 10;
165
+ readonly div: 11;
166
+ };
167
+ export declare const binaryOperatorLabels: Record<BinaryOperator, string>;
168
+ export type TypeRef = {
169
+ readonly $type: 'named';
170
+ } & NamedTypeRef | {
171
+ readonly $type: 'opaque';
172
+ } & OpaqueRuntimeTypeRef | {
173
+ readonly $type: 'scalar';
174
+ } & ScalarTypeRef | {
175
+ readonly $type: 'enum';
176
+ } & EnumTypeRef | {
177
+ readonly $type: 'entityRef';
178
+ } & EntityReferenceTypeRef | {
179
+ readonly $type: 'array';
180
+ } & ArrayTypeRef | {
181
+ readonly $type: 'object';
182
+ } & ObjectTypeRef | {
183
+ readonly $type: 'quantity';
184
+ } & QuantityTypeRef | {
185
+ readonly $type: 'json';
186
+ } & JsonTypeRef;
187
+ export interface NamedTypeRef {
188
+ TypeId: TypeId;
189
+ }
190
+ export interface OpaqueRuntimeTypeRef {
191
+ RuntimeType: string;
192
+ }
193
+ export interface ScalarTypeRef {
194
+ Kind: ScalarTypeKind;
195
+ Format: PrimitiveFormat;
196
+ }
197
+ export interface EnumTypeRef {
198
+ Name: string;
199
+ Members: string[];
200
+ }
201
+ export interface EntityReferenceTypeRef {
202
+ Entity: EntityTypeName;
203
+ }
204
+ export interface ArrayTypeRef {
205
+ ElementType: TypeRef;
206
+ }
207
+ export interface ObjectTypeRef {
208
+ Fields: ObjectFieldTypeDef[];
209
+ }
210
+ export interface QuantityTypeRef {
211
+ Quantity: string;
212
+ BaseKind: ScalarTypeKind;
213
+ }
214
+ export interface JsonTypeRef {
215
+ Kind: JsonTypeKind;
216
+ }
217
+ export type AggregateOperator = 0 | 1 | 2 | 3 | 4 | 5;
218
+ export declare const aggregateOperators: {
219
+ readonly count: 0;
220
+ readonly sum: 1;
221
+ readonly min: 2;
222
+ readonly max: 3;
223
+ readonly any: 4;
224
+ readonly all: 5;
225
+ };
226
+ export declare const aggregateOperatorLabels: Record<AggregateOperator, string>;
227
+ export interface MappingId {
228
+ Value: string;
229
+ }
230
+ export interface MappingName {
231
+ Value: string;
232
+ }
233
+ export type MappingKind = 0 | 1;
234
+ export declare const mappingKinds: {
235
+ readonly relation: 0;
236
+ readonly object: 1;
237
+ };
238
+ export declare const mappingKindLabels: Record<MappingKind, string>;
239
+ export interface FieldAssignment {
240
+ Id?: string | null;
241
+ TargetField: string;
242
+ Expr: Expr;
243
+ }
244
+ export type MappingScope = 0 | 1;
245
+ export declare const mappingScopes: {
246
+ readonly rooted: 0;
247
+ readonly set: 1;
248
+ };
249
+ export declare const mappingScopeLabels: Record<MappingScope, string>;
250
+ export type MappingDirection = 0 | 1 | 2;
251
+ export declare const mappingDirections: {
252
+ readonly sourceToTarget: 0;
253
+ readonly targetToSource: 1;
254
+ readonly bidirectional: 2;
255
+ };
256
+ export declare const mappingDirectionLabels: Record<MappingDirection, string>;
257
+ export interface NestedMapping {
258
+ Source: FieldPath;
259
+ Target: FieldPath;
260
+ NestedMappingId: MappingId;
261
+ }
262
+ export interface CollectionMapping {
263
+ SourceCollection: FieldPath;
264
+ TargetCollection: FieldPath;
265
+ ItemMappingId: MappingId;
266
+ }
267
+ export interface MappingMetadata {
268
+ AllowCodegen: boolean;
269
+ Deterministic: boolean;
270
+ TransportMapping: boolean;
271
+ ExecutionPreference: MappingExecutionPreference;
272
+ Hints: ({
273
+ Key: string;
274
+ Value: string;
275
+ })[];
276
+ }
277
+ export type MaterializationStrategy = 0 | 1 | 2 | 3;
278
+ export declare const materializationStrategies: {
279
+ readonly onDemand: 0;
280
+ readonly asyncIndex: 1;
281
+ readonly changeFeed: 2;
282
+ readonly snapshot: 3;
283
+ };
284
+ export declare const materializationStrategyLabels: Record<MaterializationStrategy, string>;
285
+ export type FreshnessPolicy = 0 | 1 | 2;
286
+ export declare const freshnessPolicies: {
287
+ readonly strong: 0;
288
+ readonly eventual: 1;
289
+ readonly boundedStaleness: 2;
290
+ };
291
+ export declare const freshnessPolicyLabels: Record<FreshnessPolicy, string>;
292
+ export interface FieldPathSegment {
293
+ Kind: SegmentKind;
294
+ Segment?: string | null;
295
+ }
296
+ export interface TypeId {
297
+ Value: string;
298
+ }
299
+ export type ScalarTypeKind = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
300
+ export declare const scalarTypeKinds: {
301
+ readonly bool: 0;
302
+ readonly int32: 1;
303
+ readonly int64: 2;
304
+ readonly decimal: 3;
305
+ readonly string: 4;
306
+ readonly guid: 5;
307
+ readonly date: 6;
308
+ readonly dateTime: 7;
309
+ readonly instant: 8;
310
+ readonly bytes: 9;
311
+ };
312
+ export declare const scalarTypeKindLabels: Record<ScalarTypeKind, string>;
313
+ export type PrimitiveFormat = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
314
+ export declare const primitiveFormats: {
315
+ readonly none: 0;
316
+ readonly uuid: 1;
317
+ readonly isoDate: 2;
318
+ readonly isoDateTime: 3;
319
+ readonly isoInstant: 4;
320
+ readonly currencyCode: 5;
321
+ readonly countryCode: 6;
322
+ readonly email: 7;
323
+ readonly uri: 8;
324
+ readonly base64: 9;
325
+ };
326
+ export declare const primitiveFormatLabels: Record<PrimitiveFormat, string>;
327
+ export interface EntityTypeName {
328
+ Value: string;
329
+ }
330
+ export interface ObjectFieldTypeDef {
331
+ Name: string;
332
+ Type: TypeRef;
333
+ Presence: FieldPresence;
334
+ Annotations: ({
335
+ Key: AnnotationKey;
336
+ Value: AnnotationValue;
337
+ })[];
338
+ }
339
+ export type JsonTypeKind = 0 | 1 | 2 | 3 | 4 | 5;
340
+ export declare const jsonTypeKinds: {
341
+ readonly any: 0;
342
+ readonly object: 1;
343
+ readonly array: 2;
344
+ readonly string: 3;
345
+ readonly number: 4;
346
+ readonly boolean: 5;
347
+ };
348
+ export declare const jsonTypeKindLabels: Record<JsonTypeKind, string>;
349
+ export type MappingExecutionPreference = 0 | 1 | 2;
350
+ export declare const mappingExecutionPreferences: {
351
+ readonly inMemory: 0;
352
+ readonly materialized: 1;
353
+ readonly codeGenerated: 2;
354
+ };
355
+ export declare const mappingExecutionPreferenceLabels: Record<MappingExecutionPreference, string>;
356
+ export type SegmentKind = 0 | 2;
357
+ export declare const segmentKinds: {
358
+ readonly field: 0;
359
+ readonly element: 2;
360
+ };
361
+ export declare const segmentKindLabels: Record<SegmentKind, string>;
362
+ export type FieldPresence = 0 | 1;
363
+ export declare const fieldPresences: {
364
+ readonly required: 0;
365
+ readonly optional: 1;
366
+ };
367
+ export declare const fieldPresenceLabels: Record<FieldPresence, string>;
368
+ export interface AnnotationKey {
369
+ Value: string;
370
+ }
371
+ export interface AnnotationValue {
372
+ Value?: unknown | null;
373
+ }
374
+ export interface QualifiedShapeId {
375
+ GraphId: GraphId;
376
+ ShapeId: ShapeId;
377
+ }
378
+ export interface RelationDefinition {
379
+ Id: RelationId;
380
+ Name: RelationName;
381
+ Sources: RelationSource[];
382
+ Joins: JoinDefinition[];
383
+ Filter?: Expr | null;
384
+ BaseRowShapeId?: ShapeId | null;
385
+ Mappings: MappingDefinition[];
386
+ Materialization?: MaterializationSpec | null;
387
+ Metadata: RelationMetadata;
388
+ Invariants: InvariantDefinition[];
389
+ }
390
+ //# sourceMappingURL=relations.shapes.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations.shapes.generated.d.ts","sourceRoot":"","sources":["../../src/generated/relations.shapes.generated.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,OAAO;IAC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AAC;IAC9B,eAAe,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC7C,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,EAAE,mBAAmB,EAAE,CAAC;CACnC"}
@@ -0,0 +1,210 @@
1
+ /* <auto-generated/> */
2
+ export const sourceCardinalities = {
3
+ single: 0,
4
+ many: 1,
5
+ };
6
+ export const sourceCardinalityLabels = {
7
+ 0: 'Single',
8
+ 1: 'Many',
9
+ };
10
+ export const joinKinds = {
11
+ inner: 0,
12
+ left: 1,
13
+ right: 2,
14
+ full: 3,
15
+ };
16
+ export const joinKindLabels = {
17
+ 0: 'Inner',
18
+ 1: 'Left',
19
+ 2: 'Right',
20
+ 3: 'Full',
21
+ };
22
+ export const unaryOperators = {
23
+ not: 0,
24
+ };
25
+ export const unaryOperatorLabels = {
26
+ 0: 'Not',
27
+ };
28
+ export const binaryOperators = {
29
+ eq: 0,
30
+ ne: 1,
31
+ gt: 2,
32
+ ge: 3,
33
+ lt: 4,
34
+ le: 5,
35
+ and: 6,
36
+ or: 7,
37
+ add: 8,
38
+ sub: 9,
39
+ mul: 10,
40
+ div: 11,
41
+ };
42
+ export const binaryOperatorLabels = {
43
+ 0: 'Eq',
44
+ 1: 'Ne',
45
+ 2: 'Gt',
46
+ 3: 'Ge',
47
+ 4: 'Lt',
48
+ 5: 'Le',
49
+ 6: 'And',
50
+ 7: 'Or',
51
+ 8: 'Add',
52
+ 9: 'Sub',
53
+ 10: 'Mul',
54
+ 11: 'Div',
55
+ };
56
+ export const aggregateOperators = {
57
+ count: 0,
58
+ sum: 1,
59
+ min: 2,
60
+ max: 3,
61
+ any: 4,
62
+ all: 5,
63
+ };
64
+ export const aggregateOperatorLabels = {
65
+ 0: 'Count',
66
+ 1: 'Sum',
67
+ 2: 'Min',
68
+ 3: 'Max',
69
+ 4: 'Any',
70
+ 5: 'All',
71
+ };
72
+ export const mappingKinds = {
73
+ relation: 0,
74
+ object: 1,
75
+ };
76
+ export const mappingKindLabels = {
77
+ 0: 'Relation',
78
+ 1: 'Object',
79
+ };
80
+ export const mappingScopes = {
81
+ rooted: 0,
82
+ set: 1,
83
+ };
84
+ export const mappingScopeLabels = {
85
+ 0: 'Rooted',
86
+ 1: 'Set',
87
+ };
88
+ export const mappingDirections = {
89
+ sourceToTarget: 0,
90
+ targetToSource: 1,
91
+ bidirectional: 2,
92
+ };
93
+ export const mappingDirectionLabels = {
94
+ 0: 'SourceToTarget',
95
+ 1: 'TargetToSource',
96
+ 2: 'Bidirectional',
97
+ };
98
+ export const materializationStrategies = {
99
+ onDemand: 0,
100
+ asyncIndex: 1,
101
+ changeFeed: 2,
102
+ snapshot: 3,
103
+ };
104
+ export const materializationStrategyLabels = {
105
+ 0: 'OnDemand',
106
+ 1: 'AsyncIndex',
107
+ 2: 'ChangeFeed',
108
+ 3: 'Snapshot',
109
+ };
110
+ export const freshnessPolicies = {
111
+ strong: 0,
112
+ eventual: 1,
113
+ boundedStaleness: 2,
114
+ };
115
+ export const freshnessPolicyLabels = {
116
+ 0: 'Strong',
117
+ 1: 'Eventual',
118
+ 2: 'BoundedStaleness',
119
+ };
120
+ export const scalarTypeKinds = {
121
+ bool: 0,
122
+ int32: 1,
123
+ int64: 2,
124
+ decimal: 3,
125
+ string: 4,
126
+ guid: 5,
127
+ date: 6,
128
+ dateTime: 7,
129
+ instant: 8,
130
+ bytes: 9,
131
+ };
132
+ export const scalarTypeKindLabels = {
133
+ 0: 'Bool',
134
+ 1: 'Int32',
135
+ 2: 'Int64',
136
+ 3: 'Decimal',
137
+ 4: 'String',
138
+ 5: 'Guid',
139
+ 6: 'Date',
140
+ 7: 'DateTime',
141
+ 8: 'Instant',
142
+ 9: 'Bytes',
143
+ };
144
+ export const primitiveFormats = {
145
+ none: 0,
146
+ uuid: 1,
147
+ isoDate: 2,
148
+ isoDateTime: 3,
149
+ isoInstant: 4,
150
+ currencyCode: 5,
151
+ countryCode: 6,
152
+ email: 7,
153
+ uri: 8,
154
+ base64: 9,
155
+ };
156
+ export const primitiveFormatLabels = {
157
+ 0: 'None',
158
+ 1: 'Uuid',
159
+ 2: 'IsoDate',
160
+ 3: 'IsoDateTime',
161
+ 4: 'IsoInstant',
162
+ 5: 'CurrencyCode',
163
+ 6: 'CountryCode',
164
+ 7: 'Email',
165
+ 8: 'Uri',
166
+ 9: 'Base64',
167
+ };
168
+ export const jsonTypeKinds = {
169
+ any: 0,
170
+ object: 1,
171
+ array: 2,
172
+ string: 3,
173
+ number: 4,
174
+ boolean: 5,
175
+ };
176
+ export const jsonTypeKindLabels = {
177
+ 0: 'Any',
178
+ 1: 'Object',
179
+ 2: 'Array',
180
+ 3: 'String',
181
+ 4: 'Number',
182
+ 5: 'Boolean',
183
+ };
184
+ export const mappingExecutionPreferences = {
185
+ inMemory: 0,
186
+ materialized: 1,
187
+ codeGenerated: 2,
188
+ };
189
+ export const mappingExecutionPreferenceLabels = {
190
+ 0: 'InMemory',
191
+ 1: 'Materialized',
192
+ 2: 'CodeGenerated',
193
+ };
194
+ export const segmentKinds = {
195
+ field: 0,
196
+ element: 2,
197
+ };
198
+ export const segmentKindLabels = {
199
+ 0: 'Field',
200
+ 2: 'Element',
201
+ };
202
+ export const fieldPresences = {
203
+ required: 0,
204
+ optional: 1,
205
+ };
206
+ export const fieldPresenceLabels = {
207
+ 0: 'Required',
208
+ 1: 'Optional',
209
+ };
210
+ //# sourceMappingURL=relations.shapes.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations.shapes.generated.js","sourceRoot":"","sources":["../../src/generated/relations.shapes.generated.ts"],"names":[],"mappings":"AAAA,uBAAuB;AA4JvB,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;CAC6C,CAAC;AAEvD,MAAM,CAAC,MAAM,uBAAuB,GAAsC;IACxE,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,MAAM;CACV,CAAC;AAIF,MAAM,CAAC,MAAM,SAAS,GAAG;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AAO;IACV,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,QAAQ;CACZ,CAAC;AAkBF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,CAAC;IACN,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;CACqC,CAAC;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAiC;IAC9D,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,SAAS;CACb,CAAC;AAIF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,QAAQ,EAAE,CAAC;IACX,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;CAC6C,CAAC;AAEhE,MAAM,CAAC,MAAM,gCAAgC,GAA+C;IAC1F,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,cAAc;IACjB,CAAC,EAAE,eAAe;CACnB,CAAC;AAIF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;CACoC,CAAC;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAgC;IAC5D,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,SAAS;CACb,CAAC;AAIF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;CACqC,CAAC;AAEnD,MAAM,CAAC,MAAM,mBAAmB,GAAkC;IAChE,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,UAAU;CACd,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './generated/relations.shapes.generated.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './generated/relations.shapes.generated.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAA"}
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@cohesivesystems/relations",
3
+ "version": "0.1.0-alpha.1",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ },
11
+ "./generated/*": {
12
+ "types": "./dist/generated/*.d.ts",
13
+ "import": "./dist/generated/*.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "src/**/*.ts",
19
+ "src/**/*.tsx",
20
+ "!src/**/*.test.ts",
21
+ "!src/**/*.test.tsx"
22
+ ],
23
+ "devDependencies": {
24
+ "typescript": "~5.9.3",
25
+ "vitest": "^4.1.7"
26
+ },
27
+ "license": "Apache-2.0",
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "description": "TypeScript contracts and helpers for Cohesive relations.",
32
+ "keywords": [
33
+ "cohesive",
34
+ "relations",
35
+ "mapping",
36
+ "typescript"
37
+ ],
38
+ "author": "Cohesive Systems",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/cohesivesystems/cohesive.git",
42
+ "directory": "src/frontend/relations"
43
+ },
44
+ "bugs": {
45
+ "url": "https://github.com/cohesivesystems/cohesive/issues"
46
+ },
47
+ "homepage": "https://github.com/cohesivesystems/cohesive#readme",
48
+ "scripts": {
49
+ "build": "tsc -p tsconfig.json && node ../../../eng/fix-package-js-imports.mjs dist",
50
+ "test": "vitest run --passWithNoTests"
51
+ }
52
+ }
@@ -0,0 +1,574 @@
1
+ /* <auto-generated/> */
2
+
3
+ export interface GraphId {
4
+ Value: string;
5
+ }
6
+
7
+ export interface ShapeId {
8
+ Value: string;
9
+ }
10
+
11
+ export interface RelationId {
12
+ Value: string;
13
+ }
14
+
15
+ export interface RelationName {
16
+ Value: string;
17
+ }
18
+
19
+ export interface RelationSource {
20
+ Alias: SourceAlias;
21
+ ShapeId: ShapeId;
22
+ Cardinality: SourceCardinality;
23
+ }
24
+
25
+ export interface JoinDefinition {
26
+ Left: SourceAlias;
27
+ Right: SourceAlias;
28
+ Kind: JoinKind;
29
+ On: Expr;
30
+ }
31
+
32
+ export type Expr = {
33
+ readonly $expr: 'field';
34
+ } & FieldExpr | {
35
+ readonly $expr: 'currentItem';
36
+ } & CurrentItemExpr | {
37
+ readonly $expr: 'parameter';
38
+ } & ParameterExpr | {
39
+ readonly $expr: 'constant';
40
+ } & ConstantExpr | {
41
+ readonly $expr: 'unary';
42
+ } & UnaryExpr | {
43
+ readonly $expr: 'binary';
44
+ } & BinaryExpr | {
45
+ readonly $expr: 'conditional';
46
+ } & ConditionalExpr | {
47
+ readonly $expr: 'function';
48
+ } & CallExpr | {
49
+ readonly $expr: 'typedFieldRef';
50
+ } & FieldRefExpr | {
51
+ readonly $expr: 'literal';
52
+ } & LiteralExpr | {
53
+ readonly $expr: 'aggregate';
54
+ } & AggregateExpr;
55
+
56
+ export interface FieldExpr {
57
+ Path: FieldPath;
58
+ }
59
+
60
+ export type CurrentItemExpr = Record<never, never>;
61
+
62
+ export interface ParameterExpr {
63
+ Parameter: string;
64
+ }
65
+
66
+ export interface ConstantExpr {
67
+ Value: unknown;
68
+ }
69
+
70
+ export interface UnaryExpr {
71
+ Operator: UnaryOperator;
72
+ Operand: Expr;
73
+ }
74
+
75
+ export interface BinaryExpr {
76
+ Operator: BinaryOperator;
77
+ Left: Expr;
78
+ Right: Expr;
79
+ }
80
+
81
+ export interface ConditionalExpr {
82
+ Test: Expr;
83
+ IfTrue: Expr;
84
+ IfFalse: Expr;
85
+ ReturnType: TypeRef;
86
+ }
87
+
88
+ export interface CallExpr {
89
+ Function: string;
90
+ Arguments: Expr[];
91
+ ReturnType: TypeRef;
92
+ }
93
+
94
+ export interface FieldRefExpr {
95
+ Path: FieldPath;
96
+ Type: TypeRef;
97
+ }
98
+
99
+ export interface LiteralExpr {
100
+ Type: TypeRef;
101
+ Value: unknown;
102
+ }
103
+
104
+ export interface AggregateExpr {
105
+ Operator: AggregateOperator;
106
+ Source: Expr;
107
+ GroupBy: Expr[];
108
+ ReturnType: TypeRef;
109
+ }
110
+
111
+ export interface MappingDefinition {
112
+ Id: MappingId;
113
+ Name: MappingName;
114
+ Kind: MappingKind;
115
+ SourceShapeId?: ShapeId | null;
116
+ TargetShapeId: ShapeId;
117
+ Assignments: FieldAssignment[];
118
+ Predicate?: Expr | null;
119
+ ForEach?: Expr | null;
120
+ Key?: Expr | null;
121
+ Entity?: Expr | null;
122
+ Scope: MappingScope;
123
+ Direction: MappingDirection;
124
+ NestedMappings: NestedMapping[];
125
+ CollectionMappings: CollectionMapping[];
126
+ Metadata: MappingMetadata;
127
+ }
128
+
129
+ export interface MaterializationSpec {
130
+ IsEnabled: boolean;
131
+ Strategy: MaterializationStrategy;
132
+ Freshness: FreshnessPolicy;
133
+ AllowCodegen: boolean;
134
+ }
135
+
136
+ export interface RelationMetadata {
137
+ AllowCodegen: boolean;
138
+ Deterministic: boolean;
139
+ Hints: ({
140
+ Key: string;
141
+ Value: string;
142
+ })[];
143
+ }
144
+
145
+ export interface InvariantDefinition {
146
+ Name: string;
147
+ Expression: Expr;
148
+ Message?: string | null;
149
+ }
150
+
151
+ export interface SourceAlias {
152
+ Value: string;
153
+ }
154
+
155
+ export type SourceCardinality = 0 | 1;
156
+
157
+ export const sourceCardinalities = {
158
+ single: 0,
159
+ many: 1,
160
+ } as const satisfies Record<string, SourceCardinality>;
161
+
162
+ export const sourceCardinalityLabels: Record<SourceCardinality, string> = {
163
+ 0: 'Single',
164
+ 1: 'Many',
165
+ };
166
+
167
+ export type JoinKind = 0 | 1 | 2 | 3;
168
+
169
+ export const joinKinds = {
170
+ inner: 0,
171
+ left: 1,
172
+ right: 2,
173
+ full: 3,
174
+ } as const satisfies Record<string, JoinKind>;
175
+
176
+ export const joinKindLabels: Record<JoinKind, string> = {
177
+ 0: 'Inner',
178
+ 1: 'Left',
179
+ 2: 'Right',
180
+ 3: 'Full',
181
+ };
182
+
183
+ export interface FieldPath {
184
+ Segments: FieldPathSegment[];
185
+ }
186
+
187
+ export type UnaryOperator = 0;
188
+
189
+ export const unaryOperators = {
190
+ not: 0,
191
+ } as const satisfies Record<string, UnaryOperator>;
192
+
193
+ export const unaryOperatorLabels: Record<UnaryOperator, string> = {
194
+ 0: 'Not',
195
+ };
196
+
197
+ export type BinaryOperator = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
198
+
199
+ export const binaryOperators = {
200
+ eq: 0,
201
+ ne: 1,
202
+ gt: 2,
203
+ ge: 3,
204
+ lt: 4,
205
+ le: 5,
206
+ and: 6,
207
+ or: 7,
208
+ add: 8,
209
+ sub: 9,
210
+ mul: 10,
211
+ div: 11,
212
+ } as const satisfies Record<string, BinaryOperator>;
213
+
214
+ export const binaryOperatorLabels: Record<BinaryOperator, string> = {
215
+ 0: 'Eq',
216
+ 1: 'Ne',
217
+ 2: 'Gt',
218
+ 3: 'Ge',
219
+ 4: 'Lt',
220
+ 5: 'Le',
221
+ 6: 'And',
222
+ 7: 'Or',
223
+ 8: 'Add',
224
+ 9: 'Sub',
225
+ 10: 'Mul',
226
+ 11: 'Div',
227
+ };
228
+
229
+ export type TypeRef = {
230
+ readonly $type: 'named';
231
+ } & NamedTypeRef | {
232
+ readonly $type: 'opaque';
233
+ } & OpaqueRuntimeTypeRef | {
234
+ readonly $type: 'scalar';
235
+ } & ScalarTypeRef | {
236
+ readonly $type: 'enum';
237
+ } & EnumTypeRef | {
238
+ readonly $type: 'entityRef';
239
+ } & EntityReferenceTypeRef | {
240
+ readonly $type: 'array';
241
+ } & ArrayTypeRef | {
242
+ readonly $type: 'object';
243
+ } & ObjectTypeRef | {
244
+ readonly $type: 'quantity';
245
+ } & QuantityTypeRef | {
246
+ readonly $type: 'json';
247
+ } & JsonTypeRef;
248
+
249
+ export interface NamedTypeRef {
250
+ TypeId: TypeId;
251
+ }
252
+
253
+ export interface OpaqueRuntimeTypeRef {
254
+ RuntimeType: string;
255
+ }
256
+
257
+ export interface ScalarTypeRef {
258
+ Kind: ScalarTypeKind;
259
+ Format: PrimitiveFormat;
260
+ }
261
+
262
+ export interface EnumTypeRef {
263
+ Name: string;
264
+ Members: string[];
265
+ }
266
+
267
+ export interface EntityReferenceTypeRef {
268
+ Entity: EntityTypeName;
269
+ }
270
+
271
+ export interface ArrayTypeRef {
272
+ ElementType: TypeRef;
273
+ }
274
+
275
+ export interface ObjectTypeRef {
276
+ Fields: ObjectFieldTypeDef[];
277
+ }
278
+
279
+ export interface QuantityTypeRef {
280
+ Quantity: string;
281
+ BaseKind: ScalarTypeKind;
282
+ }
283
+
284
+ export interface JsonTypeRef {
285
+ Kind: JsonTypeKind;
286
+ }
287
+
288
+ export type AggregateOperator = 0 | 1 | 2 | 3 | 4 | 5;
289
+
290
+ export const aggregateOperators = {
291
+ count: 0,
292
+ sum: 1,
293
+ min: 2,
294
+ max: 3,
295
+ any: 4,
296
+ all: 5,
297
+ } as const satisfies Record<string, AggregateOperator>;
298
+
299
+ export const aggregateOperatorLabels: Record<AggregateOperator, string> = {
300
+ 0: 'Count',
301
+ 1: 'Sum',
302
+ 2: 'Min',
303
+ 3: 'Max',
304
+ 4: 'Any',
305
+ 5: 'All',
306
+ };
307
+
308
+ export interface MappingId {
309
+ Value: string;
310
+ }
311
+
312
+ export interface MappingName {
313
+ Value: string;
314
+ }
315
+
316
+ export type MappingKind = 0 | 1;
317
+
318
+ export const mappingKinds = {
319
+ relation: 0,
320
+ object: 1,
321
+ } as const satisfies Record<string, MappingKind>;
322
+
323
+ export const mappingKindLabels: Record<MappingKind, string> = {
324
+ 0: 'Relation',
325
+ 1: 'Object',
326
+ };
327
+
328
+ export interface FieldAssignment {
329
+ Id?: string | null;
330
+ TargetField: string;
331
+ Expr: Expr;
332
+ }
333
+
334
+ export type MappingScope = 0 | 1;
335
+
336
+ export const mappingScopes = {
337
+ rooted: 0,
338
+ set: 1,
339
+ } as const satisfies Record<string, MappingScope>;
340
+
341
+ export const mappingScopeLabels: Record<MappingScope, string> = {
342
+ 0: 'Rooted',
343
+ 1: 'Set',
344
+ };
345
+
346
+ export type MappingDirection = 0 | 1 | 2;
347
+
348
+ export const mappingDirections = {
349
+ sourceToTarget: 0,
350
+ targetToSource: 1,
351
+ bidirectional: 2,
352
+ } as const satisfies Record<string, MappingDirection>;
353
+
354
+ export const mappingDirectionLabels: Record<MappingDirection, string> = {
355
+ 0: 'SourceToTarget',
356
+ 1: 'TargetToSource',
357
+ 2: 'Bidirectional',
358
+ };
359
+
360
+ export interface NestedMapping {
361
+ Source: FieldPath;
362
+ Target: FieldPath;
363
+ NestedMappingId: MappingId;
364
+ }
365
+
366
+ export interface CollectionMapping {
367
+ SourceCollection: FieldPath;
368
+ TargetCollection: FieldPath;
369
+ ItemMappingId: MappingId;
370
+ }
371
+
372
+ export interface MappingMetadata {
373
+ AllowCodegen: boolean;
374
+ Deterministic: boolean;
375
+ TransportMapping: boolean;
376
+ ExecutionPreference: MappingExecutionPreference;
377
+ Hints: ({
378
+ Key: string;
379
+ Value: string;
380
+ })[];
381
+ }
382
+
383
+ export type MaterializationStrategy = 0 | 1 | 2 | 3;
384
+
385
+ export const materializationStrategies = {
386
+ onDemand: 0,
387
+ asyncIndex: 1,
388
+ changeFeed: 2,
389
+ snapshot: 3,
390
+ } as const satisfies Record<string, MaterializationStrategy>;
391
+
392
+ export const materializationStrategyLabels: Record<MaterializationStrategy, string> = {
393
+ 0: 'OnDemand',
394
+ 1: 'AsyncIndex',
395
+ 2: 'ChangeFeed',
396
+ 3: 'Snapshot',
397
+ };
398
+
399
+ export type FreshnessPolicy = 0 | 1 | 2;
400
+
401
+ export const freshnessPolicies = {
402
+ strong: 0,
403
+ eventual: 1,
404
+ boundedStaleness: 2,
405
+ } as const satisfies Record<string, FreshnessPolicy>;
406
+
407
+ export const freshnessPolicyLabels: Record<FreshnessPolicy, string> = {
408
+ 0: 'Strong',
409
+ 1: 'Eventual',
410
+ 2: 'BoundedStaleness',
411
+ };
412
+
413
+ export interface FieldPathSegment {
414
+ Kind: SegmentKind;
415
+ Segment?: string | null;
416
+ }
417
+
418
+ export interface TypeId {
419
+ Value: string;
420
+ }
421
+
422
+ export type ScalarTypeKind = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
423
+
424
+ export const scalarTypeKinds = {
425
+ bool: 0,
426
+ int32: 1,
427
+ int64: 2,
428
+ decimal: 3,
429
+ string: 4,
430
+ guid: 5,
431
+ date: 6,
432
+ dateTime: 7,
433
+ instant: 8,
434
+ bytes: 9,
435
+ } as const satisfies Record<string, ScalarTypeKind>;
436
+
437
+ export const scalarTypeKindLabels: Record<ScalarTypeKind, string> = {
438
+ 0: 'Bool',
439
+ 1: 'Int32',
440
+ 2: 'Int64',
441
+ 3: 'Decimal',
442
+ 4: 'String',
443
+ 5: 'Guid',
444
+ 6: 'Date',
445
+ 7: 'DateTime',
446
+ 8: 'Instant',
447
+ 9: 'Bytes',
448
+ };
449
+
450
+ export type PrimitiveFormat = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
451
+
452
+ export const primitiveFormats = {
453
+ none: 0,
454
+ uuid: 1,
455
+ isoDate: 2,
456
+ isoDateTime: 3,
457
+ isoInstant: 4,
458
+ currencyCode: 5,
459
+ countryCode: 6,
460
+ email: 7,
461
+ uri: 8,
462
+ base64: 9,
463
+ } as const satisfies Record<string, PrimitiveFormat>;
464
+
465
+ export const primitiveFormatLabels: Record<PrimitiveFormat, string> = {
466
+ 0: 'None',
467
+ 1: 'Uuid',
468
+ 2: 'IsoDate',
469
+ 3: 'IsoDateTime',
470
+ 4: 'IsoInstant',
471
+ 5: 'CurrencyCode',
472
+ 6: 'CountryCode',
473
+ 7: 'Email',
474
+ 8: 'Uri',
475
+ 9: 'Base64',
476
+ };
477
+
478
+ export interface EntityTypeName {
479
+ Value: string;
480
+ }
481
+
482
+ export interface ObjectFieldTypeDef {
483
+ Name: string;
484
+ Type: TypeRef;
485
+ Presence: FieldPresence;
486
+ Annotations: ({
487
+ Key: AnnotationKey;
488
+ Value: AnnotationValue;
489
+ })[];
490
+ }
491
+
492
+ export type JsonTypeKind = 0 | 1 | 2 | 3 | 4 | 5;
493
+
494
+ export const jsonTypeKinds = {
495
+ any: 0,
496
+ object: 1,
497
+ array: 2,
498
+ string: 3,
499
+ number: 4,
500
+ boolean: 5,
501
+ } as const satisfies Record<string, JsonTypeKind>;
502
+
503
+ export const jsonTypeKindLabels: Record<JsonTypeKind, string> = {
504
+ 0: 'Any',
505
+ 1: 'Object',
506
+ 2: 'Array',
507
+ 3: 'String',
508
+ 4: 'Number',
509
+ 5: 'Boolean',
510
+ };
511
+
512
+ export type MappingExecutionPreference = 0 | 1 | 2;
513
+
514
+ export const mappingExecutionPreferences = {
515
+ inMemory: 0,
516
+ materialized: 1,
517
+ codeGenerated: 2,
518
+ } as const satisfies Record<string, MappingExecutionPreference>;
519
+
520
+ export const mappingExecutionPreferenceLabels: Record<MappingExecutionPreference, string> = {
521
+ 0: 'InMemory',
522
+ 1: 'Materialized',
523
+ 2: 'CodeGenerated',
524
+ };
525
+
526
+ export type SegmentKind = 0 | 2;
527
+
528
+ export const segmentKinds = {
529
+ field: 0,
530
+ element: 2,
531
+ } as const satisfies Record<string, SegmentKind>;
532
+
533
+ export const segmentKindLabels: Record<SegmentKind, string> = {
534
+ 0: 'Field',
535
+ 2: 'Element',
536
+ };
537
+
538
+ export type FieldPresence = 0 | 1;
539
+
540
+ export const fieldPresences = {
541
+ required: 0,
542
+ optional: 1,
543
+ } as const satisfies Record<string, FieldPresence>;
544
+
545
+ export const fieldPresenceLabels: Record<FieldPresence, string> = {
546
+ 0: 'Required',
547
+ 1: 'Optional',
548
+ };
549
+
550
+ export interface AnnotationKey {
551
+ Value: string;
552
+ }
553
+
554
+ export interface AnnotationValue {
555
+ Value?: unknown | null;
556
+ }
557
+
558
+ export interface QualifiedShapeId {
559
+ GraphId: GraphId;
560
+ ShapeId: ShapeId;
561
+ }
562
+
563
+ export interface RelationDefinition {
564
+ Id: RelationId;
565
+ Name: RelationName;
566
+ Sources: RelationSource[];
567
+ Joins: JoinDefinition[];
568
+ Filter?: Expr | null;
569
+ BaseRowShapeId?: ShapeId | null;
570
+ Mappings: MappingDefinition[];
571
+ Materialization?: MaterializationSpec | null;
572
+ Metadata: RelationMetadata;
573
+ Invariants: InvariantDefinition[];
574
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './generated/relations.shapes.generated'