@finos/legend-graph 14.0.6 → 14.1.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.
Files changed (56) hide show
  1. package/lib/StoreRelational_Exports.d.ts +2 -1
  2. package/lib/StoreRelational_Exports.d.ts.map +1 -1
  3. package/lib/StoreRelational_Exports.js +2 -1
  4. package/lib/StoreRelational_Exports.js.map +1 -1
  5. package/lib/graph/Core_HashUtils.js +1 -1
  6. package/lib/graph/DependencyManager.d.ts.map +1 -1
  7. package/lib/graph/DependencyManager.js +18 -50
  8. package/lib/graph/DependencyManager.js.map +1 -1
  9. package/lib/graph/MetaModelConst.d.ts +2 -1
  10. package/lib/graph/MetaModelConst.d.ts.map +1 -1
  11. package/lib/graph/MetaModelConst.js +2 -0
  12. package/lib/graph/MetaModelConst.js.map +1 -1
  13. package/lib/graph/helpers/DSLMapping_Helper.d.ts +4 -0
  14. package/lib/graph/helpers/DSLMapping_Helper.d.ts.map +1 -1
  15. package/lib/graph/helpers/DSLMapping_Helper.js +19 -0
  16. package/lib/graph/helpers/DSLMapping_Helper.js.map +1 -1
  17. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/Mapper.d.ts +1 -0
  18. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/Mapper.d.ts.map +1 -1
  19. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/Mapper.js +2 -1
  20. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/Mapper.js.map +1 -1
  21. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/PostProcessor.d.ts +2 -1
  22. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/PostProcessor.d.ts.map +1 -1
  23. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/PostProcessor.js +2 -0
  24. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/PostProcessor.js.map +1 -1
  25. package/lib/graphManager/GraphManagerState.d.ts +33 -0
  26. package/lib/graphManager/GraphManagerState.d.ts.map +1 -1
  27. package/lib/graphManager/GraphManagerState.js +139 -1
  28. package/lib/graphManager/GraphManagerState.js.map +1 -1
  29. package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.d.ts +4 -0
  30. package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.d.ts.map +1 -1
  31. package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.js +49 -3
  32. package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.js.map +1 -1
  33. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_PostProcessorTransformer.js +3 -3
  34. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_PostProcessorBuilderHelper.js +3 -3
  35. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_PostProcessorSerializationHelper.js +6 -6
  36. package/lib/index.d.ts +1 -0
  37. package/lib/index.d.ts.map +1 -1
  38. package/lib/index.js +1 -0
  39. package/lib/index.js.map +1 -1
  40. package/lib/package.json +4 -4
  41. package/package.json +7 -7
  42. package/src/StoreRelational_Exports.ts +8 -1
  43. package/src/graph/Core_HashUtils.ts +1 -1
  44. package/src/graph/DependencyManager.ts +22 -50
  45. package/src/graph/MetaModelConst.ts +3 -0
  46. package/src/graph/helpers/DSLMapping_Helper.ts +42 -0
  47. package/src/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/Mapper.ts +3 -1
  48. package/src/graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/PostProcessor.ts +3 -1
  49. package/src/graphManager/GraphManagerState.ts +176 -1
  50. package/src/graphManager/action/changeDetection/StoreRelational_ObserverHelper.ts +67 -5
  51. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_PostProcessorTransformer.ts +3 -3
  52. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_PostProcessorBuilderHelper.ts +3 -3
  53. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_PostProcessorSerializationHelper.ts +6 -6
  54. package/src/index.ts +2 -0
  55. package/tsconfig.json +1 -1
  56. package/tsconfig.package.json +1 -1
@@ -33,8 +33,15 @@ export {
33
33
  ColumnReference,
34
34
  ColumnExplicitReference,
35
35
  } from './graph/metamodel/pure/packageableElements/store/relational/model/ColumnReference.js';
36
- export { type Mapper } from './graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/Mapper.js';
36
+ export {
37
+ TableNameMapper,
38
+ Mapper,
39
+ SchemaNameMapper,
40
+ } from './graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/Mapper.js';
41
+
37
42
  export { PostProcessor } from './graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/PostProcessor.js';
43
+ export { MapperPostProcessor } from './graph/metamodel/pure/packageableElements/store/relational/connection/postprocessor/MapperPostProcessor.js';
44
+
38
45
  export { Milestoning } from './graph/metamodel/pure/packageableElements/store/relational/model/milestoning/Milestoning.js';
39
46
  export * from './graph/metamodel/pure/packageableElements/store/relational/model/RelationalDataType.js';
40
47
  export * from './graph/metamodel/pure/packageableElements/store/relational/model/RelationalOperationElement.js';
@@ -157,7 +157,7 @@ export enum CORE_HASH_STRUCTURE {
157
157
  OAUTH_AUTHENTICATION_STRATEGY = 'OAUTH_AUTHENTICATION_STRATEGY',
158
158
  GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY = 'GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY',
159
159
  MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY = 'MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY',
160
- // relational database connection post processors
160
+ // relational database connection post-processors
161
161
  MAPPER_POST_PROCESSOR = 'MAPPER_POST_PROCESSOR',
162
162
  SCHEMA_MAPPER = 'SCHEMA_MAPPER',
163
163
  TABLE_MAPPER = 'TABLE_MAPPER',
@@ -179,93 +179,65 @@ export class DependencyManager {
179
179
  }
180
180
 
181
181
  get sectionIndices(): SectionIndex[] {
182
- return this.dependencyGraphs
183
- .map((dep) => Array.from(dep.ownSectionIndices))
184
- .flat();
182
+ return this.dependencyGraphs.flatMap((dep) => dep.ownSectionIndices);
185
183
  }
186
184
  get profiles(): Profile[] {
187
- return this.dependencyGraphs
188
- .map((dep) => Array.from(dep.ownProfiles))
189
- .flat();
185
+ return this.dependencyGraphs.flatMap((dep) => dep.ownProfiles);
190
186
  }
191
187
  get enumerations(): Enumeration[] {
192
- return this.dependencyGraphs
193
- .map((dep) => Array.from(dep.ownEnumerations))
194
- .flat();
188
+ return this.dependencyGraphs.flatMap((dep) => dep.ownEnumerations);
195
189
  }
196
190
  get measures(): Measure[] {
197
- return this.dependencyGraphs
198
- .map((dep) => Array.from(dep.ownMeasures))
199
- .flat();
191
+ return this.dependencyGraphs.flatMap((dep) => dep.ownMeasures);
200
192
  }
201
193
  get classes(): Class[] {
202
- return this.dependencyGraphs
203
- .map((dep) => Array.from(dep.ownClasses))
204
- .flat();
194
+ return this.dependencyGraphs.flatMap((dep) => dep.ownClasses);
205
195
  }
206
196
  get types(): Type[] {
207
- return this.dependencyGraphs.map((dep) => Array.from(dep.ownTypes)).flat();
197
+ return this.dependencyGraphs.flatMap((dep) => dep.ownTypes);
208
198
  }
209
199
  get associations(): Association[] {
210
- return this.dependencyGraphs
211
- .map((dep) => Array.from(dep.ownAssociations))
212
- .flat();
200
+ return this.dependencyGraphs.flatMap((dep) => dep.ownAssociations);
213
201
  }
214
202
  get functions(): ConcreteFunctionDefinition[] {
215
- return this.dependencyGraphs
216
- .map((dep) => Array.from(dep.ownFunctions))
217
- .flat();
203
+ return this.dependencyGraphs.flatMap((dep) => dep.ownFunctions);
218
204
  }
219
205
  get stores(): Store[] {
220
- return this.dependencyGraphs.map((dep) => Array.from(dep.ownStores)).flat();
206
+ return this.dependencyGraphs.flatMap((dep) => dep.ownStores);
221
207
  }
222
208
  get databases(): Database[] {
223
- return this.dependencyGraphs
224
- .map((dep) => Array.from(dep.ownDatabases))
225
- .flat();
209
+ return this.dependencyGraphs.flatMap((dep) => dep.ownDatabases);
226
210
  }
227
211
  get mappings(): Mapping[] {
228
- return this.dependencyGraphs
229
- .map((dep) => Array.from(dep.ownMappings))
230
- .flat();
212
+ return this.dependencyGraphs.flatMap((dep) => dep.ownMappings);
231
213
  }
232
214
  get services(): Service[] {
233
- return this.dependencyGraphs
234
- .map((dep) => Array.from(dep.ownServices))
235
- .flat();
215
+ return this.dependencyGraphs.flatMap((dep) => dep.ownServices);
236
216
  }
237
217
  get runtimes(): PackageableRuntime[] {
238
- return this.dependencyGraphs
239
- .map((dep) => Array.from(dep.ownRuntimes))
240
- .flat();
218
+ return this.dependencyGraphs.flatMap((dep) => dep.ownRuntimes);
241
219
  }
242
220
  get connections(): PackageableConnection[] {
243
- return this.dependencyGraphs
244
- .map((dep) => Array.from(dep.ownConnections))
245
- .flat();
221
+ return this.dependencyGraphs.flatMap((dep) => dep.ownConnections);
246
222
  }
247
223
  get dataElements(): DataElement[] {
248
- return this.dependencyGraphs
249
- .map((dep) => Array.from(dep.ownDataElements))
250
- .flat();
224
+ return this.dependencyGraphs.flatMap((dep) => dep.ownDataElements);
251
225
  }
252
226
  get generationSpecifications(): GenerationSpecification[] {
253
- return this.dependencyGraphs
254
- .map((dep) => Array.from(dep.ownGenerationSpecifications))
255
- .flat();
227
+ return this.dependencyGraphs.flatMap(
228
+ (dep) => dep.ownGenerationSpecifications,
229
+ );
256
230
  }
257
231
  get fileGenerations(): FileGenerationSpecification[] {
258
- return this.dependencyGraphs
259
- .map((dep) => Array.from(dep.ownFileGenerations))
260
- .flat();
232
+ return this.dependencyGraphs.flatMap((dep) => dep.ownFileGenerations);
261
233
  }
262
234
 
263
235
  getExtensionElements<T extends PackageableElement>(
264
236
  extensionElementClass: Clazz<T>,
265
237
  ): T[] {
266
- return this.dependencyGraphs
267
- .map((dep) => dep.getExtensionElements(extensionElementClass))
268
- .flat();
238
+ return this.dependencyGraphs.flatMap((dep) =>
239
+ dep.getExtensionElements(extensionElementClass),
240
+ );
269
241
  }
270
242
 
271
243
  getModel(projectId: string): BasicModel {
@@ -125,6 +125,9 @@ export enum CORE_PURE_PATH {
125
125
  GENERATION_SPECIFICATION = 'meta::pure::generation::metamodel::GenerationSpecification',
126
126
  SECTION_INDEX = 'meta::pure::metamodel::section::SectionIndex',
127
127
  DATA_ELEMENT = 'meta::pure::data::DataElement',
128
+
129
+ // TDS
130
+ TDS_ROW = 'meta::pure::tds::TDSRow',
128
131
  }
129
132
 
130
133
  export const PURE_DEPRECATED_STEREOTYPE = 'deprecated';
@@ -38,6 +38,7 @@ import type {
38
38
  } from '../metamodel/pure/packageableElements/runtime/Runtime.js';
39
39
  import { OperationSetImplementation } from '../metamodel/pure/packageableElements/mapping/OperationSetImplementation.js';
40
40
  import { ObjectInputType } from '../metamodel/pure/packageableElements/store/modelToModel/mapping/ObjectInputData.js';
41
+ import type { PackageableRuntime } from '../../DSLMapping_Exports.js';
41
42
 
42
43
  // ----------------------------------------- Mapping -----------------------------------------
43
44
 
@@ -272,6 +273,32 @@ export const getObjectInputType = (type: string): ObjectInputType => {
272
273
  }
273
274
  };
274
275
 
276
+ export const getMappingCompatibleClasses = (
277
+ mapping: Mapping,
278
+ classes: Class[],
279
+ ): Class[] => {
280
+ const mappedClasses = new Set<Class>();
281
+ getAllClassMappings(mapping).forEach((cm) =>
282
+ mappedClasses.add(cm.class.value),
283
+ );
284
+ return classes.filter((c) => mappedClasses.has(c));
285
+ };
286
+
287
+ export const getClassCompatibleMappings = (
288
+ _class: Class,
289
+ mappings: Mapping[],
290
+ ): Mapping[] => {
291
+ const mappingsWithClassMapped = mappings.filter((mapping) =>
292
+ mapping.classMappings.some((cm) => cm.class.value === _class),
293
+ );
294
+ const resolvedMappingIncludes = mappings.filter((mapping) =>
295
+ getAllIncludedMappings(mapping).some((e) =>
296
+ mappingsWithClassMapped.includes(e),
297
+ ),
298
+ );
299
+ return uniq([...mappingsWithClassMapped, ...resolvedMappingIncludes]);
300
+ };
301
+
275
302
  // ----------------------------------------- Runtime -----------------------------------------
276
303
 
277
304
  export const getAllIdentifiedConnections = (
@@ -298,3 +325,18 @@ export const generateIdentifiedConnectionId = (
298
325
  );
299
326
  return generatedId;
300
327
  };
328
+
329
+ export const getMappingCompatibleRuntimes = (
330
+ mapping: Mapping,
331
+ runtimes: PackageableRuntime[],
332
+ ): PackageableRuntime[] =>
333
+ // If the runtime claims to cover some mappings which include the specified mapping,
334
+ // then we deem the runtime to be compatible with the such mapping
335
+ runtimes.filter((runtime) =>
336
+ runtime.runtimeValue.mappings
337
+ .flatMap((mappingReference) => [
338
+ mappingReference.value,
339
+ ...getAllIncludedMappings(mappingReference.value),
340
+ ])
341
+ .includes(mapping),
342
+ );
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { CORE_HASH_STRUCTURE } from '../../../../../../../../graph/Core_HashUtils.js';
18
- import { type Hashable, hashArray } from '@finos/legend-shared';
18
+ import { type Hashable, hashArray, uuid } from '@finos/legend-shared';
19
19
 
20
20
  export class PostProcessorParameter {}
21
21
 
@@ -23,6 +23,8 @@ export abstract class Mapper
23
23
  extends PostProcessorParameter
24
24
  implements Hashable
25
25
  {
26
+ readonly _UUID = uuid();
27
+
26
28
  from: string;
27
29
  to: string;
28
30
 
@@ -14,8 +14,10 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import type { Hashable } from '@finos/legend-shared';
17
+ import { type Hashable, uuid } from '@finos/legend-shared';
18
18
 
19
19
  export abstract class PostProcessor implements Hashable {
20
+ readonly _UUID = uuid();
21
+
20
22
  abstract get hashCode(): string;
21
23
  }
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import { type Log, ActionState, assertErrorThrown } from '@finos/legend-shared';
18
- import { action, makeObservable, observable } from 'mobx';
18
+ import { action, computed, makeObservable, observable } from 'mobx';
19
19
  import { DependencyManager } from '../graph/DependencyManager.js';
20
20
  import {
21
21
  CoreModel,
@@ -36,6 +36,23 @@ import { EmbeddedFlatDataPropertyMapping } from '../graph/metamodel/pure/package
36
36
  import { EmbeddedRelationalInstanceSetImplementation } from '../graph/metamodel/pure/packageableElements/store/relational/mapping/EmbeddedRelationalInstanceSetImplementation.js';
37
37
  import { buildPureGraphManager } from '../graphManager/protocol/pure/PureGraphManagerBuilder.js';
38
38
  import type { AssociationImplementation } from '../graph/metamodel/pure/packageableElements/mapping/AssociationImplementation.js';
39
+ import type { Profile } from '../graph/metamodel/pure/packageableElements/domain/Profile.js';
40
+ import type { Enumeration } from '../graph/metamodel/pure/packageableElements/domain/Enumeration.js';
41
+ import type { Measure } from '../graph/metamodel/pure/packageableElements/domain/Measure.js';
42
+ import type { Class } from '../graph/metamodel/pure/packageableElements/domain/Class.js';
43
+ import type { Association } from '../graph/metamodel/pure/packageableElements/domain/Association.js';
44
+ import type { ConcreteFunctionDefinition } from '../graph/metamodel/pure/packageableElements/domain/ConcreteFunctionDefinition.js';
45
+ import type { Store } from '../graph/metamodel/pure/packageableElements/store/Store.js';
46
+ import type { Database } from '../graph/metamodel/pure/packageableElements/store/relational/model/Database.js';
47
+ import type { Mapping } from '../graph/metamodel/pure/packageableElements/mapping/Mapping.js';
48
+ import type { Service } from '../graph/metamodel/pure/packageableElements/service/Service.js';
49
+ import type { PackageableRuntime } from '../graph/metamodel/pure/packageableElements/runtime/PackageableRuntime.js';
50
+ import type { PackageableConnection } from '../graph/metamodel/pure/packageableElements/connection/PackageableConnection.js';
51
+ import type { DataElement } from '../graph/metamodel/pure/packageableElements/data/DataElement.js';
52
+ import type { FileGenerationSpecification } from '../graph/metamodel/pure/packageableElements/fileGeneration/FileGenerationSpecification.js';
53
+ import type { GenerationSpecification } from '../graph/metamodel/pure/packageableElements/generationSpecification/GenerationSpecification.js';
54
+ import { PRIMITIVE_TYPE } from '../graph/MetaModelConst.js';
55
+ import type { Type } from '../graph/metamodel/pure/packageableElements/domain/Type.js';
39
56
 
40
57
  export class BasicGraphManagerState {
41
58
  pluginManager: GraphManagerPluginManager;
@@ -107,6 +124,26 @@ export class GraphManagerState extends BasicGraphManagerState {
107
124
 
108
125
  makeObservable(this, {
109
126
  graph: observable,
127
+
128
+ usableClassPropertyTypes: computed,
129
+
130
+ usableProfiles: computed,
131
+ usableEnumerations: computed,
132
+ usableMeasures: computed,
133
+ usableClasses: computed,
134
+ usableAssociations: computed,
135
+ usableFunctions: computed,
136
+ usableStores: computed,
137
+ usableDatabases: computed,
138
+ usableMappings: computed,
139
+ usableServices: computed,
140
+ usableRuntimes: computed,
141
+ usableConnections: computed,
142
+ usableDataElements: computed,
143
+ usableGenerationSpecifications: computed,
144
+ usableFileGenerations: computed,
145
+ usableElements: computed,
146
+
110
147
  resetGraph: action,
111
148
  });
112
149
 
@@ -187,4 +224,142 @@ export class GraphManagerState extends BasicGraphManagerState {
187
224
  ),
188
225
  );
189
226
  }
227
+
228
+ get usableClassPropertyTypes(): Type[] {
229
+ return [
230
+ ...this.graph.primitiveTypes.filter(
231
+ (type) => type.path !== PRIMITIVE_TYPE.LATESTDATE,
232
+ ),
233
+ ...this.graph.ownTypes,
234
+ ...this.collectExposedSystemElements(this.graph.systemModel.ownTypes),
235
+ ...this.graph.dependencyManager.types,
236
+ ];
237
+ }
238
+
239
+ get usableProfiles(): Profile[] {
240
+ return [
241
+ ...this.collectExposedSystemElements(this.graph.systemModel.ownProfiles),
242
+ ...this.graph.dependencyManager.profiles,
243
+ ...this.graph.ownProfiles,
244
+ ];
245
+ }
246
+ get usableEnumerations(): Enumeration[] {
247
+ return [
248
+ ...this.collectExposedSystemElements(
249
+ this.graph.systemModel.ownEnumerations,
250
+ ),
251
+ ...this.graph.dependencyManager.enumerations,
252
+ ...this.graph.ownEnumerations,
253
+ ];
254
+ }
255
+ get usableMeasures(): Measure[] {
256
+ return [
257
+ ...this.collectExposedSystemElements(this.graph.systemModel.ownMeasures),
258
+ ...this.graph.dependencyManager.measures,
259
+ ...this.graph.ownMeasures,
260
+ ];
261
+ }
262
+ get usableClasses(): Class[] {
263
+ return [
264
+ ...this.collectExposedSystemElements(this.graph.systemModel.ownClasses),
265
+ ...this.graph.dependencyManager.classes,
266
+ ...this.graph.ownClasses,
267
+ ];
268
+ }
269
+ get usableAssociations(): Association[] {
270
+ return [
271
+ ...this.collectExposedSystemElements(
272
+ this.graph.systemModel.ownAssociations,
273
+ ),
274
+ ...this.graph.dependencyManager.associations,
275
+ ...this.graph.ownAssociations,
276
+ ];
277
+ }
278
+ get usableFunctions(): ConcreteFunctionDefinition[] {
279
+ return [
280
+ ...this.collectExposedSystemElements(this.graph.systemModel.ownFunctions),
281
+ ...this.graph.dependencyManager.functions,
282
+ ...this.graph.ownFunctions,
283
+ ];
284
+ }
285
+ get usableStores(): Store[] {
286
+ return [
287
+ ...this.collectExposedSystemElements(this.graph.systemModel.ownStores),
288
+ ...this.graph.dependencyManager.stores,
289
+ ...this.graph.ownStores,
290
+ ];
291
+ }
292
+ get usableDatabases(): Database[] {
293
+ return [
294
+ ...this.collectExposedSystemElements(this.graph.systemModel.ownDatabases),
295
+ ...this.graph.dependencyManager.databases,
296
+ ...this.graph.ownDatabases,
297
+ ];
298
+ }
299
+ get usableMappings(): Mapping[] {
300
+ return [
301
+ ...this.collectExposedSystemElements(this.graph.systemModel.ownMappings),
302
+ ...this.graph.dependencyManager.mappings,
303
+ ...this.graph.ownMappings,
304
+ ];
305
+ }
306
+ get usableServices(): Service[] {
307
+ return [
308
+ ...this.collectExposedSystemElements(this.graph.systemModel.ownServices),
309
+ ...this.graph.dependencyManager.services,
310
+ ...this.graph.ownServices,
311
+ ];
312
+ }
313
+ get usableRuntimes(): PackageableRuntime[] {
314
+ return [
315
+ ...this.collectExposedSystemElements(this.graph.systemModel.ownRuntimes),
316
+ ...this.graph.dependencyManager.runtimes,
317
+ ...this.graph.ownRuntimes,
318
+ ];
319
+ }
320
+ get usableConnections(): PackageableConnection[] {
321
+ return [
322
+ ...this.collectExposedSystemElements(
323
+ this.graph.systemModel.ownConnections,
324
+ ),
325
+ ...this.graph.dependencyManager.connections,
326
+ ...this.graph.ownConnections,
327
+ ];
328
+ }
329
+ get usableDataElements(): DataElement[] {
330
+ return [
331
+ ...this.collectExposedSystemElements(
332
+ this.graph.systemModel.ownDataElements,
333
+ ),
334
+ ...this.graph.dependencyManager.dataElements,
335
+ ...this.graph.ownDataElements,
336
+ ];
337
+ }
338
+ get usableGenerationSpecifications(): GenerationSpecification[] {
339
+ return [
340
+ ...this.collectExposedSystemElements(
341
+ this.graph.systemModel.ownGenerationSpecifications,
342
+ ),
343
+ ...this.graph.dependencyManager.generationSpecifications,
344
+ ...this.graph.ownGenerationSpecifications,
345
+ ];
346
+ }
347
+ get usableFileGenerations(): FileGenerationSpecification[] {
348
+ return [
349
+ ...this.collectExposedSystemElements(
350
+ this.graph.systemModel.ownFileGenerations,
351
+ ),
352
+ ...this.graph.dependencyManager.fileGenerations,
353
+ ...this.graph.ownFileGenerations,
354
+ ];
355
+ }
356
+ get usableElements(): PackageableElement[] {
357
+ return [
358
+ ...this.collectExposedSystemElements(
359
+ this.graph.systemModel.allOwnElements,
360
+ ),
361
+ ...this.graph.dependencyManager.allOwnElements,
362
+ ...this.graph.ownMeasures,
363
+ ];
364
+ }
190
365
  }
@@ -103,6 +103,11 @@ import {
103
103
  } from '../../../graph/metamodel/pure/packageableElements/store/relational/model/TableReference.js';
104
104
  import type { View } from '../../../graph/metamodel/pure/packageableElements/store/relational/model/View.js';
105
105
  import { ViewReference } from '../../../graph/metamodel/pure/packageableElements/store/relational/model/ViewReference.js';
106
+ import {
107
+ type Mapper,
108
+ SchemaNameMapper,
109
+ TableNameMapper,
110
+ } from '../../../StoreRelational_Exports.js';
106
111
  import type { StoreRelational_PureGraphManagerPlugin_Extension } from '../../StoreRelational_PureGraphManagerPlugin_Extension.js';
107
112
  import {
108
113
  type ObserverContext,
@@ -998,13 +1003,69 @@ export const observe_AuthenticationStrategy = (
998
1003
  return metamodel;
999
1004
  };
1000
1005
 
1006
+ const observe_Abstract_Mapper = (metamodel: Mapper): void => {
1007
+ makeObservable(metamodel, {
1008
+ from: observable,
1009
+ to: observable,
1010
+ hashCode: computed,
1011
+ });
1012
+ };
1013
+
1014
+ export const observe_SchemaNameMapper = skipObserved(
1015
+ (metamodel: SchemaNameMapper): SchemaNameMapper => {
1016
+ observe_Abstract_Mapper(metamodel);
1017
+
1018
+ return metamodel;
1019
+ },
1020
+ );
1021
+
1022
+ export const observe_TableNameMapper = skipObserved(
1023
+ (metamodel: TableNameMapper): TableNameMapper => {
1024
+ observe_Abstract_Mapper(metamodel);
1025
+
1026
+ makeObservable(metamodel, {
1027
+ schema: observable,
1028
+ });
1029
+ observe_SchemaNameMapper(metamodel.schema);
1030
+ return metamodel;
1031
+ },
1032
+ );
1033
+
1034
+ export const observe_Mapper = (metamodel: Mapper): Mapper => {
1035
+ if (metamodel instanceof SchemaNameMapper) {
1036
+ return observe_SchemaNameMapper(metamodel);
1037
+ } else if (metamodel instanceof TableNameMapper) {
1038
+ return observe_TableNameMapper(metamodel);
1039
+ }
1040
+ return metamodel;
1041
+ };
1042
+
1043
+ const observe_Abstract_PostProcessor = (metamodel: PostProcessor): void => {
1044
+ makeObservable(metamodel, {
1045
+ hashCode: computed,
1046
+ });
1047
+ };
1048
+
1049
+ const observe_MapperPostProcessor = (
1050
+ metamodel: MapperPostProcessor,
1051
+ ): MapperPostProcessor => {
1052
+ observe_Abstract_PostProcessor(metamodel);
1053
+
1054
+ makeObservable(metamodel, {
1055
+ mappers: observable,
1056
+ });
1057
+ metamodel.mappers.forEach((mapper) => {
1058
+ observe_Mapper(mapper);
1059
+ });
1060
+ return metamodel;
1061
+ };
1062
+
1001
1063
  export const observe_PostProcessor = (
1002
1064
  metamodel: PostProcessor,
1003
1065
  context: ObserverContext,
1004
1066
  ): PostProcessor => {
1005
1067
  if (metamodel instanceof MapperPostProcessor) {
1006
- // TODO
1007
- return metamodel;
1068
+ return observe_MapperPostProcessor(metamodel);
1008
1069
  }
1009
1070
  const extraObservers = context.plugins.flatMap(
1010
1071
  (plugin) =>
@@ -1043,14 +1104,15 @@ export const observe_RelationalDatabaseConnection = skipObservedWithContext(
1043
1104
  makeObservable(metamodel, {
1044
1105
  datasourceSpecification: observable,
1045
1106
  authenticationStrategy: observable,
1107
+ postProcessors: observable,
1046
1108
  hashCode: computed,
1047
1109
  });
1048
1110
 
1049
1111
  observe_DatasourceSpecification(metamodel.datasourceSpecification, context);
1050
1112
  observe_AuthenticationStrategy(metamodel.authenticationStrategy, context);
1051
- metamodel.postProcessors.forEach((postProcessor) =>
1052
- observe_PostProcessor(postProcessor, context),
1053
- );
1113
+ metamodel.postProcessors.forEach((postProcessor) => {
1114
+ observe_PostProcessor(postProcessor, context);
1115
+ });
1054
1116
 
1055
1117
  return metamodel;
1056
1118
  },
@@ -86,9 +86,9 @@ export const V1_transformPostProcessor = (
86
86
  ).V1_getExtraConnectionPostProcessorTransformers?.() ?? [],
87
87
  );
88
88
  for (const transformer of extraConnectionPostProcessorTransformers) {
89
- const postprocessorProtocol = transformer(postProcessor, context);
90
- if (postprocessorProtocol) {
91
- return postprocessorProtocol;
89
+ const postProcessorProtocol = transformer(postProcessor, context);
90
+ if (postProcessorProtocol) {
91
+ return postProcessorProtocol;
92
92
  }
93
93
  }
94
94
  throw new UnsupportedOperationError(
@@ -61,9 +61,9 @@ export const V1_buildPostProcessor = (
61
61
  ).V1_getExtraConnectionPostProcessorBuilders?.() ?? [],
62
62
  );
63
63
  for (const builder of extraPostProcessorBuilders) {
64
- const postprocessor = builder(protocol, context);
65
- if (postprocessor) {
66
- return postprocessor;
64
+ const postProcessor = builder(protocol, context);
65
+ if (postProcessor) {
66
+ return postProcessor;
67
67
  }
68
68
  }
69
69
  throw new UnsupportedOperationError(
@@ -113,9 +113,9 @@ export const V1_serializePostProcessor = (
113
113
  ).V1_getExtraConnectionPostProcessorProtocolSerializers?.() ?? [],
114
114
  );
115
115
  for (const serializer of extraPostprocessorProtocolSerializers) {
116
- const postprocessorProtocolJson = serializer(value);
117
- if (postprocessorProtocolJson) {
118
- return postprocessorProtocolJson;
116
+ const postProcessorProtocolJson = serializer(value);
117
+ if (postProcessorProtocolJson) {
118
+ return postProcessorProtocolJson;
119
119
  }
120
120
  }
121
121
  throw new UnsupportedOperationError(
@@ -139,9 +139,9 @@ export const V1_deserializePostProcessor = (
139
139
  ).V1_getExtraConnectionPostProcessorProtocolDeserializers?.() ?? [],
140
140
  );
141
141
  for (const deserializer of extraPostprocessorProtocolDeserializers) {
142
- const postprocessorProtocol = deserializer(value);
143
- if (postprocessorProtocol) {
144
- return postprocessorProtocol;
142
+ const postProcessorProtocol = deserializer(value);
143
+ if (postProcessorProtocol) {
144
+ return postProcessorProtocol;
145
145
  }
146
146
  }
147
147
  throw new UnsupportedOperationError(
package/src/index.ts CHANGED
@@ -23,6 +23,8 @@ export * from './graph/metamodel/pure/packageableElements/PackageableElementRefe
23
23
  export * from './graph/metamodel/pure/packageableElements/mapping/SetImplementationReference.js';
24
24
  export { SectionIndex } from './graph/metamodel/pure/packageableElements/section/SectionIndex.js';
25
25
 
26
+ export { createExplicitRelationReference } from './graph/metamodel/pure/packageableElements/store/relational/model/RelationReference.js';
27
+
26
28
  export { Multiplicity } from './graph/metamodel/pure/packageableElements/domain/Multiplicity.js';
27
29
  export { Type } from './graph/metamodel/pure/packageableElements/domain/Type.js';
28
30
  export { DataType } from './graph/metamodel/pure/packageableElements/domain/DataType.js';
package/tsconfig.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "noImplicitOverride": true,
22
22
  "noUncheckedIndexedAccess": true,
23
23
  "exactOptionalPropertyTypes": true,
24
- "forceConsistentCasingInFileNames": false,
24
+ "forceConsistentCasingInFileNames": true,
25
25
  "outDir": "./lib",
26
26
  "tsBuildInfoFile": "./build/prod.tsbuildinfo",
27
27
  "rootDir": "./src",
@@ -21,7 +21,7 @@
21
21
  "noImplicitOverride": true,
22
22
  "noUncheckedIndexedAccess": true,
23
23
  "exactOptionalPropertyTypes": true,
24
- "forceConsistentCasingInFileNames": false,
24
+ "forceConsistentCasingInFileNames": true,
25
25
  "outDir": "./lib",
26
26
  "tsBuildInfoFile": "./build/package.tsbuildinfo",
27
27
  "rootDir": "./"