@finos/legend-graph 0.2.1 → 0.3.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 (218) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/lib/GraphManagerState.d.ts +1 -0
  3. package/lib/GraphManagerState.d.ts.map +1 -1
  4. package/lib/GraphManagerState.js +27 -2
  5. package/lib/GraphManagerState.js.map +1 -1
  6. package/lib/GraphManagerStateProvider.js +1 -1
  7. package/lib/GraphManagerStateProvider.js.map +1 -1
  8. package/lib/GraphManagerTestUtils.js +1 -1
  9. package/lib/GraphManagerTestUtils.js.map +1 -1
  10. package/lib/MetaModelConst.d.ts +7 -0
  11. package/lib/MetaModelConst.d.ts.map +1 -1
  12. package/lib/MetaModelConst.js +8 -0
  13. package/lib/MetaModelConst.js.map +1 -1
  14. package/lib/graph/PureGraphPlugin.d.ts +2 -0
  15. package/lib/graph/PureGraphPlugin.d.ts.map +1 -1
  16. package/lib/graph/PureGraphPlugin.js +3 -0
  17. package/lib/graph/PureGraphPlugin.js.map +1 -1
  18. package/lib/graphManager/AbstractPureGraphManager.d.ts +5 -9
  19. package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
  20. package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
  21. package/lib/graphManager/CorePureGraphManagerPlugin.d.ts +0 -2
  22. package/lib/graphManager/CorePureGraphManagerPlugin.d.ts.map +1 -1
  23. package/lib/graphManager/CorePureGraphManagerPlugin.js +1 -4
  24. package/lib/graphManager/CorePureGraphManagerPlugin.js.map +1 -1
  25. package/lib/graphManager/PureGraphManagerPlugin.d.ts +2 -0
  26. package/lib/graphManager/PureGraphManagerPlugin.d.ts.map +1 -1
  27. package/lib/graphManager/PureGraphManagerPlugin.js +3 -0
  28. package/lib/graphManager/PureGraphManagerPlugin.js.map +1 -1
  29. package/lib/graphManager/action/SourceInformationHelper.d.ts.map +1 -1
  30. package/lib/graphManager/action/SourceInformationHelper.js +3 -1
  31. package/lib/graphManager/action/SourceInformationHelper.js.map +1 -1
  32. package/lib/graphManager/action/query/Query.d.ts +11 -0
  33. package/lib/graphManager/action/query/Query.d.ts.map +1 -1
  34. package/lib/graphManager/action/query/Query.js +13 -0
  35. package/lib/graphManager/action/query/Query.js.map +1 -1
  36. package/lib/graphManager/action/query/QuerySearchSpecification.d.ts +29 -0
  37. package/lib/graphManager/action/query/QuerySearchSpecification.d.ts.map +1 -0
  38. package/lib/graphManager/action/query/QuerySearchSpecification.js +28 -0
  39. package/lib/graphManager/action/query/QuerySearchSpecification.js.map +1 -0
  40. package/lib/helpers/DomainHelper.d.ts +20 -0
  41. package/lib/helpers/DomainHelper.d.ts.map +1 -0
  42. package/lib/helpers/DomainHelper.js +37 -0
  43. package/lib/helpers/DomainHelper.js.map +1 -0
  44. package/lib/helpers/MappingResolutionHelper.js +1 -1
  45. package/lib/helpers/MappingResolutionHelper.js.map +1 -1
  46. package/lib/index.d.ts +2 -0
  47. package/lib/index.d.ts.map +1 -1
  48. package/lib/index.js +2 -0
  49. package/lib/index.js.map +1 -1
  50. package/lib/models/metamodels/pure/packageableElements/domain/Association.js +1 -1
  51. package/lib/models/metamodels/pure/packageableElements/domain/Association.js.map +1 -1
  52. package/lib/models/metamodels/pure/packageableElements/mapping/EnumValueMapping.d.ts.map +1 -1
  53. package/lib/models/metamodels/pure/packageableElements/mapping/EnumValueMapping.js +2 -2
  54. package/lib/models/metamodels/pure/packageableElements/mapping/EnumValueMapping.js.map +1 -1
  55. package/lib/models/metamodels/pure/packageableElements/mapping/SetImplementation.d.ts.map +1 -1
  56. package/lib/models/metamodels/pure/packageableElements/mapping/SetImplementation.js +0 -1
  57. package/lib/models/metamodels/pure/packageableElements/mapping/SetImplementation.js.map +1 -1
  58. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.d.ts +2 -0
  59. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.d.ts.map +1 -1
  60. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.js +7 -0
  61. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.js.map +1 -1
  62. package/lib/models/metamodels/pure/packageableElements/store/relational/model/RelationalOperationElement.d.ts.map +1 -1
  63. package/lib/models/metamodels/pure/packageableElements/store/relational/model/RelationalOperationElement.js +3 -1
  64. package/lib/models/metamodels/pure/packageableElements/store/relational/model/RelationalOperationElement.js.map +1 -1
  65. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts +2 -0
  66. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts.map +1 -1
  67. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js +3 -0
  68. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js.map +1 -1
  69. package/lib/models/protocols/pure/v1/V1_Core_SystemModels.json +7 -0
  70. package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts +6 -9
  71. package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  72. package/lib/models/protocols/pure/v1/V1_PureGraphManager.js +8 -8
  73. package/lib/models/protocols/pure/v1/V1_PureGraphManager.js.map +1 -1
  74. package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts +2 -6
  75. package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts.map +1 -1
  76. package/lib/models/protocols/pure/v1/engine/V1_Engine.js +14 -5
  77. package/lib/models/protocols/pure/v1/engine/V1_Engine.js.map +1 -1
  78. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.d.ts +3 -0
  79. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.d.ts.map +1 -1
  80. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.js +62 -2
  81. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.js.map +1 -1
  82. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.d.ts +4 -8
  83. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
  84. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.js +1 -6
  85. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
  86. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.d.ts +3 -3
  87. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.d.ts.map +1 -1
  88. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.js +2 -2
  89. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.js.map +1 -1
  90. package/lib/models/protocols/pure/v1/engine/query/V1_Query.d.ts +4 -0
  91. package/lib/models/protocols/pure/v1/engine/query/V1_Query.d.ts.map +1 -1
  92. package/lib/models/protocols/pure/v1/engine/query/V1_Query.js +7 -2
  93. package/lib/models/protocols/pure/v1/engine/query/V1_Query.js.map +1 -1
  94. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.d.ts +33 -0
  95. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.d.ts.map +1 -0
  96. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.js +43 -0
  97. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.js.map +1 -0
  98. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextPointer.d.ts +3 -3
  99. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextPointer.d.ts.map +1 -1
  100. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.d.ts +22 -0
  101. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.d.ts.map +1 -0
  102. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.js +21 -0
  103. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.js.map +1 -0
  104. package/lib/models/protocols/pure/v1/model/context/{V1_AlloySdlc.d.ts → V1_SDLC.d.ts} +4 -4
  105. package/lib/models/protocols/pure/v1/model/context/V1_SDLC.d.ts.map +1 -0
  106. package/lib/models/protocols/pure/v1/model/context/{V1_AlloySdlc.js → V1_SDLC.js} +3 -3
  107. package/lib/models/protocols/pure/v1/model/context/V1_SDLC.js.map +1 -0
  108. package/lib/models/protocols/pure/v1/model/packageableElements/mapping/V1_ClassMapping.d.ts.map +1 -1
  109. package/lib/models/protocols/pure/v1/model/packageableElements/mapping/V1_ClassMapping.js.map +1 -1
  110. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.d.ts +1 -0
  111. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.d.ts.map +1 -1
  112. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.js +2 -0
  113. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.js.map +1 -1
  114. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.d.ts.map +1 -1
  115. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js +1 -0
  116. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js.map +1 -1
  117. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts.map +1 -1
  118. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js +6 -4
  119. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js.map +1 -1
  120. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.d.ts.map +1 -1
  121. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js +4 -3
  122. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js.map +1 -1
  123. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ExecutionPlanBuilder.d.ts.map +1 -1
  124. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ExecutionPlanBuilder.js +6 -6
  125. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ExecutionPlanBuilder.js.map +1 -1
  126. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts.map +1 -1
  127. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js +2 -2
  128. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js.map +1 -1
  129. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingSecondPassBuilder.d.ts.map +1 -1
  130. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingSecondPassBuilder.js +4 -4
  131. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingSecondPassBuilder.js.map +1 -1
  132. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.d.ts.map +1 -1
  133. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.js +3 -3
  134. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.js.map +1 -1
  135. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.d.ts.map +1 -1
  136. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.js +12 -10
  137. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.js.map +1 -1
  138. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_AssociationMappingHelper.d.ts.map +1 -1
  139. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_AssociationMappingHelper.js +3 -2
  140. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_AssociationMappingHelper.js.map +1 -1
  141. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.d.ts.map +1 -1
  142. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.js +1 -1
  143. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.js.map +1 -1
  144. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.d.ts.map +1 -1
  145. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js +2 -1
  146. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js.map +1 -1
  147. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.d.ts.map +1 -1
  148. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.js.map +1 -1
  149. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.d.ts +1 -1
  150. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.d.ts.map +1 -1
  151. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.js +6 -4
  152. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.js.map +1 -1
  153. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.d.ts.map +1 -1
  154. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js +1 -0
  155. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js.map +1 -1
  156. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -1
  157. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js +20 -12
  158. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js.map +1 -1
  159. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts +4 -1
  160. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts.map +1 -1
  161. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js +24 -8
  162. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js.map +1 -1
  163. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.d.ts.map +1 -1
  164. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js +1 -0
  165. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js.map +1 -1
  166. package/package.json +9 -9
  167. package/src/GraphManagerState.ts +35 -4
  168. package/src/MetaModelConst.ts +9 -0
  169. package/src/graph/PureGraphPlugin.ts +5 -0
  170. package/src/graphManager/AbstractPureGraphManager.ts +7 -9
  171. package/src/graphManager/CorePureGraphManagerPlugin.ts +1 -6
  172. package/src/graphManager/PureGraphManagerPlugin.ts +5 -0
  173. package/src/graphManager/action/SourceInformationHelper.ts +3 -1
  174. package/src/graphManager/action/query/Query.ts +15 -0
  175. package/src/graphManager/action/query/QuerySearchSpecification.ts +31 -0
  176. package/src/helpers/DomainHelper.ts +53 -0
  177. package/src/helpers/MappingResolutionHelper.ts +3 -3
  178. package/src/index.ts +2 -0
  179. package/src/models/metamodels/pure/packageableElements/domain/Association.ts +1 -1
  180. package/src/models/metamodels/pure/packageableElements/mapping/EnumValueMapping.ts +7 -2
  181. package/src/models/metamodels/pure/packageableElements/mapping/SetImplementation.ts +0 -1
  182. package/src/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.ts +8 -0
  183. package/src/models/metamodels/pure/packageableElements/store/relational/model/RelationalOperationElement.ts +3 -1
  184. package/src/models/protocols/pure/PureProtocolProcessorPlugin.ts +5 -0
  185. package/src/models/protocols/pure/v1/V1_Core_SystemModels.json +7 -0
  186. package/src/models/protocols/pure/v1/V1_PureGraphManager.ts +17 -14
  187. package/src/models/protocols/pure/v1/engine/V1_Engine.ts +25 -12
  188. package/src/models/protocols/pure/v1/engine/V1_EngineHelper.ts +92 -1
  189. package/src/models/protocols/pure/v1/engine/V1_EngineServerClient.ts +9 -14
  190. package/src/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.ts +5 -5
  191. package/src/models/protocols/pure/v1/engine/query/V1_Query.ts +12 -2
  192. package/src/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.ts +58 -0
  193. package/src/models/protocols/pure/v1/model/context/V1_PureModelContextPointer.ts +3 -3
  194. package/src/models/protocols/pure/v1/model/context/V1_PureModelContextText.ts +23 -0
  195. package/src/models/protocols/pure/v1/model/context/{V1_AlloySdlc.ts → V1_SDLC.ts} +3 -3
  196. package/src/models/protocols/pure/v1/model/packageableElements/mapping/V1_ClassMapping.ts +0 -1
  197. package/src/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.ts +2 -0
  198. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.ts +1 -0
  199. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts +7 -4
  200. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.ts +4 -3
  201. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ExecutionPlanBuilder.ts +32 -6
  202. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.ts +2 -1
  203. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingSecondPassBuilder.ts +6 -3
  204. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.ts +3 -2
  205. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.ts +18 -11
  206. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_AssociationMappingHelper.ts +3 -2
  207. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.ts +13 -4
  208. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.ts +2 -1
  209. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.ts +3 -1
  210. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.ts +8 -4
  211. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.ts +1 -0
  212. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.ts +32 -13
  213. package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.ts +32 -5
  214. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.ts +1 -0
  215. package/tsconfig.json +6 -1
  216. package/tsconfig.package.json +1 -0
  217. package/lib/models/protocols/pure/v1/model/context/V1_AlloySdlc.d.ts.map +0 -1
  218. package/lib/models/protocols/pure/v1/model/context/V1_AlloySdlc.js.map +0 -1
@@ -45,6 +45,7 @@ import type { V1_ExecutionPlan } from '../model/executionPlan/V1_ExecutionPlan';
45
45
  import type { V1_LightQuery, V1_Query } from './query/V1_Query';
46
46
  import type { V1_ServiceStorage } from './service/V1_ServiceStorage';
47
47
  import type { GenerationMode } from '../../../../../graphManager/action/generation/GenerationConfigurationDescription';
48
+ import type { V1_QuerySearchSpecification } from './query/V1_QuerySearchSpecification';
48
49
 
49
50
  enum CORE_ENGINE_TRACER_SPAN {
50
51
  GRAMMAR_TO_JSON = 'transform Pure code to protocol',
@@ -393,21 +394,15 @@ export class V1_EngineServerClient extends AbstractServerClient {
393
394
  `${this.queryBaseUrl ?? this.networkClient.baseUrl}/pure/v1/query${
394
395
  queryId ? `/${encodeURIComponent(queryId)}` : ''
395
396
  }`;
396
- getQueries = (options?: {
397
- search?: string | undefined;
398
- projectCoordinates?: string[] | undefined;
399
- showCurrentUserQueriesOnly?: boolean | undefined;
400
- limit?: number | undefined;
401
- }): Promise<PlainObject<V1_LightQuery>[]> =>
402
- this.get(this._query(), undefined, undefined, {
403
- search: options?.search,
404
- projectCoordinates: options?.projectCoordinates,
405
- showCurrentUserQueriesOnly: options?.showCurrentUserQueriesOnly,
406
- limit: options?.limit,
407
- });
397
+ searchQueries = (
398
+ searchSpecification: PlainObject<V1_QuerySearchSpecification>,
399
+ ): Promise<PlainObject<V1_LightQuery>[]> =>
400
+ this.post(`${this._query()}/search`, searchSpecification, undefined);
408
401
  getQuery = (queryId: string): Promise<PlainObject<V1_Query>> =>
409
402
  this.get(this._query(queryId));
410
- createQuery = (query: V1_Query): Promise<PlainObject<V1_Query>> =>
403
+ createQuery = (
404
+ query: PlainObject<V1_Query>,
405
+ ): Promise<PlainObject<V1_Query>> =>
411
406
  this.postWithTracing(
412
407
  this.getTraceData(CORE_ENGINE_TRACER_SPAN.CREATE_QUERY),
413
408
  this._query(),
@@ -415,7 +410,7 @@ export class V1_EngineServerClient extends AbstractServerClient {
415
410
  );
416
411
  updateQuery = (
417
412
  queryId: string,
418
- query: V1_Query,
413
+ query: PlainObject<V1_Query>,
419
414
  ): Promise<PlainObject<V1_Query>> =>
420
415
  this.putWithTracing(
421
416
  this.getTraceData(CORE_ENGINE_TRACER_SPAN.UPDATE_QUERY),
@@ -16,17 +16,17 @@
16
16
 
17
17
  import { createModelSchema, optional, primitive, raw } from 'serializr';
18
18
  import { SerializationFactory } from '@finos/legend-shared';
19
- import type { V1_PureModelContextData } from '../../model/context/V1_PureModelContextData';
20
- import { V1_pureModelContextDataPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization';
19
+ import { V1_pureModelContextPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization';
21
20
  import { PureClientVersion } from '../../../../../../graphManager/GraphManagerUtils';
21
+ import type { V1_PureModelContext } from '../../model/context/V1_PureModelContext';
22
22
 
23
23
  export class V1_GenerateFileInput {
24
24
  clientVersion?: string | undefined;
25
- model: V1_PureModelContextData;
25
+ model: V1_PureModelContext;
26
26
  config?: Record<PropertyKey, unknown> | undefined;
27
27
 
28
28
  constructor(
29
- model: V1_PureModelContextData,
29
+ model: V1_PureModelContext,
30
30
  config?: Record<PropertyKey, unknown>,
31
31
  ) {
32
32
  this.clientVersion = PureClientVersion.V1_0_0;
@@ -37,7 +37,7 @@ export class V1_GenerateFileInput {
37
37
  static readonly serialization = new SerializationFactory(
38
38
  createModelSchema(V1_GenerateFileInput, {
39
39
  clientVersion: optional(primitive()),
40
- model: V1_pureModelContextDataPropSchema,
40
+ model: V1_pureModelContextPropSchema,
41
41
  config: raw(),
42
42
  }),
43
43
  );
@@ -14,8 +14,14 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { SerializationFactory } from '@finos/legend-shared';
18
- import { createModelSchema, optional, primitive } from 'serializr';
17
+ import { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
18
+ import { createModelSchema, list, optional, primitive } from 'serializr';
19
+ import type { V1_StereotypePtr } from '../../model/packageableElements/domain/V1_StereotypePtr';
20
+ import type { V1_TaggedValue } from '../../model/packageableElements/domain/V1_TaggedValue';
21
+ import {
22
+ V1_stereotypePtrSchema,
23
+ V1_taggedValueSchema,
24
+ } from '../../transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper';
19
25
 
20
26
  export class V1_Query {
21
27
  name!: string;
@@ -27,6 +33,8 @@ export class V1_Query {
27
33
  runtime!: string;
28
34
  content!: string;
29
35
  owner?: string | undefined;
36
+ taggedValues?: V1_TaggedValue[] | undefined;
37
+ stereotypes?: V1_StereotypePtr[] | undefined;
30
38
 
31
39
  static readonly serialization = new SerializationFactory(
32
40
  createModelSchema(V1_Query, {
@@ -38,6 +46,8 @@ export class V1_Query {
38
46
  name: primitive(),
39
47
  owner: optional(primitive()),
40
48
  runtime: primitive(),
49
+ stereotypes: optional(list(usingModelSchema(V1_stereotypePtrSchema))),
50
+ taggedValues: optional(list(usingModelSchema(V1_taggedValueSchema))),
41
51
  versionId: primitive(),
42
52
  }),
43
53
  );
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
18
+ import { createModelSchema, list, optional, primitive } from 'serializr';
19
+ import type { V1_StereotypePtr } from '../../model/packageableElements/domain/V1_StereotypePtr';
20
+ import type { V1_TaggedValue } from '../../model/packageableElements/domain/V1_TaggedValue';
21
+ import {
22
+ V1_stereotypePtrSchema,
23
+ V1_taggedValueSchema,
24
+ } from '../../transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper';
25
+
26
+ export class V1_QueryProjectCoordinates {
27
+ groupId!: string;
28
+ artifactId!: string;
29
+
30
+ static readonly serialization = new SerializationFactory(
31
+ createModelSchema(V1_QueryProjectCoordinates, {
32
+ artifactId: primitive(),
33
+ groupId: primitive(),
34
+ }),
35
+ );
36
+ }
37
+
38
+ export class V1_QuerySearchSpecification {
39
+ searchTerm?: string | undefined;
40
+ projectCoordinates?: V1_QueryProjectCoordinates[] | undefined;
41
+ taggedValues?: V1_TaggedValue[] | undefined;
42
+ stereotypes?: V1_StereotypePtr[] | undefined;
43
+ limit?: number | undefined;
44
+ showCurrentUserQueriesOnly?: boolean | undefined;
45
+
46
+ static readonly serialization = new SerializationFactory(
47
+ createModelSchema(V1_QuerySearchSpecification, {
48
+ limit: optional(primitive()),
49
+ projectCoordinates: optional(
50
+ list(usingModelSchema(V1_QueryProjectCoordinates.serialization.schema)),
51
+ ),
52
+ searchTerm: optional(primitive()),
53
+ showCurrentUserQueriesOnly: optional(primitive()),
54
+ stereotypes: optional(list(usingModelSchema(V1_stereotypePtrSchema))),
55
+ taggedValues: optional(list(usingModelSchema(V1_taggedValueSchema))),
56
+ }),
57
+ );
58
+ }
@@ -14,15 +14,15 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import type { V1_Sdlc } from '../../model/context/V1_AlloySdlc';
17
+ import type { V1_SDLC } from './V1_SDLC';
18
18
  import type { V1_Protocol } from '../../model/V1_Protocol';
19
19
  import { V1_PureModelContext } from './V1_PureModelContext';
20
20
 
21
21
  export class V1_PureModelContextPointer extends V1_PureModelContext {
22
22
  serializer: V1_Protocol;
23
- sdlcInfo?: V1_Sdlc | undefined;
23
+ sdlcInfo?: V1_SDLC | undefined;
24
24
 
25
- constructor(protocol: V1_Protocol, sdlc?: V1_Sdlc) {
25
+ constructor(protocol: V1_Protocol, sdlc?: V1_SDLC) {
26
26
  super();
27
27
  this.serializer = protocol;
28
28
  this.sdlcInfo = sdlc;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { V1_PureModelContext } from '../../model/context/V1_PureModelContext';
18
+ import type { V1_Protocol } from '../../model/V1_Protocol';
19
+
20
+ export class V1_PureModelContextText extends V1_PureModelContext {
21
+ serializer?: V1_Protocol | undefined;
22
+ code?: string | undefined;
23
+ }
@@ -14,9 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import type { V1_PackageableElementPointer } from '../../model/packageableElements/V1_PackageableElement';
17
+ import type { V1_PackageableElementPointer } from '../packageableElements/V1_PackageableElement';
18
18
 
19
- export abstract class V1_Sdlc {
19
+ export abstract class V1_SDLC {
20
20
  baseVersion = 'latest';
21
21
  version: string;
22
22
  packageableElementPointers: V1_PackageableElementPointer[] = [];
@@ -26,7 +26,7 @@ export abstract class V1_Sdlc {
26
26
  }
27
27
  }
28
28
 
29
- export class V1_AlloySdlc extends V1_Sdlc {
29
+ export class V1_AlloySDLC extends V1_SDLC {
30
30
  groupId: string;
31
31
  artifactId: string;
32
32
 
@@ -25,7 +25,6 @@ import type { V1_OperationClassMapping } from './V1_OperationClassMapping';
25
25
  import type { V1_PureInstanceClassMapping } from '../../../model/packageableElements/store/modelToModel/mapping/V1_PureInstanceClassMapping';
26
26
  import type { V1_RootFlatDataClassMapping } from '../../../model/packageableElements/store/flatData/mapping/V1_RootFlatDataClassMapping';
27
27
 
28
- /* @MARKER: NEW CLASS MAPPING TYPE SUPPORT --- consider adding class mapping type handler here whenever support for a new one is added to the app */
29
28
  export interface V1_ClassMappingVisitor<T> {
30
29
  visit_ClassMapping(classMapping: V1_ClassMapping): T;
31
30
  visit_OperationClassMapping(classMapping: V1_OperationClassMapping): T;
@@ -84,6 +84,7 @@ export class V1_SnowflakeDatasourceSpecification
84
84
  nonProxyHosts?: string | undefined;
85
85
  organization?: string | undefined;
86
86
  accountType?: string | undefined;
87
+ role?: string | undefined;
87
88
 
88
89
  get hashCode(): string {
89
90
  return hashArray([
@@ -98,6 +99,7 @@ export class V1_SnowflakeDatasourceSpecification
98
99
  this.nonProxyHosts ?? '',
99
100
  this.organization ?? '',
100
101
  this.accountType ?? '',
102
+ this.role ?? '',
101
103
  this.quotedIdentifiersIgnoreCase?.toString() ?? '',
102
104
  ]);
103
105
  }
@@ -120,6 +120,7 @@ const transformSnowflakeDatasourceSpecification = (
120
120
  source.nonProxyHosts = metamodel.nonProxyHosts;
121
121
  source.organization = metamodel.organization;
122
122
  source.accountType = metamodel.accountType;
123
+ source.role = metamodel.role;
123
124
  return source;
124
125
  };
125
126
 
@@ -141,6 +141,7 @@ import type { V1_GraphTransformerContext } from './V1_GraphTransformerContext';
141
141
  import { toJS } from 'mobx';
142
142
  import type { DSLMapping_PureProtocolProcessorPlugin_Extension } from '../../../../DSLMapping_PureProtocolProcessorPlugin_Extension';
143
143
  import type { InstanceSetImplementation } from '../../../../../../metamodels/pure/packageableElements/mapping/InstanceSetImplementation';
144
+ import type { SubstituteStore } from '../../../../../../metamodels/pure/packageableElements/mapping/SubstituteStore';
144
145
 
145
146
  export const V1_transformPropertyReference = (
146
147
  element: PropertyReference,
@@ -308,7 +309,7 @@ const transformMappingTest = (
308
309
  return test;
309
310
  };
310
311
 
311
- // Include V1_Mapping
312
+ // Include Mapping
312
313
 
313
314
  const transformMappingInclude = (
314
315
  element: MappingInclude,
@@ -316,15 +317,17 @@ const transformMappingInclude = (
316
317
  const mappingInclude = new V1_MappingInclude();
317
318
  mappingInclude.includedMapping = element.included.valueForSerialization ?? '';
318
319
  mappingInclude.sourceDatabasePath = element.storeSubstitutions.length
319
- ? element.storeSubstitutions[0].original.valueForSerialization ?? ''
320
+ ? (element.storeSubstitutions[0] as SubstituteStore).original
321
+ .valueForSerialization ?? ''
320
322
  : undefined;
321
323
  mappingInclude.targetDatabasePath = element.storeSubstitutions.length
322
- ? element.storeSubstitutions[0].substitute.valueForSerialization ?? ''
324
+ ? (element.storeSubstitutions[0] as SubstituteStore).substitute
325
+ .valueForSerialization ?? ''
323
326
  : undefined;
324
327
  return mappingInclude;
325
328
  };
326
329
 
327
- // Class V1_Mapping
330
+ // Class Mapping
328
331
 
329
332
  const transformOptionalPropertyMappingTransformer = (
330
333
  value: EnumerationMapping | undefined,
@@ -112,7 +112,7 @@ class V1_ValueSpecificationTransformer
112
112
  valueSpecification: RootGraphFetchTreeInstanceValue,
113
113
  ): V1_ValueSpecification {
114
114
  return V1_transformGraphFetchTree(
115
- valueSpecification.values[0],
115
+ guaranteeNonNullable(valueSpecification.values[0]),
116
116
  this.inScope,
117
117
  this.open,
118
118
  this.isParameter,
@@ -124,7 +124,7 @@ class V1_ValueSpecificationTransformer
124
124
  valueSpecification: PropertyGraphFetchTreeInstanceValue,
125
125
  ): V1_ValueSpecification {
126
126
  return V1_transformGraphFetchTree(
127
- valueSpecification.values[0],
127
+ guaranteeNonNullable(valueSpecification.values[0]),
128
128
  this.inScope,
129
129
  this.open,
130
130
  this.isParameter,
@@ -200,6 +200,7 @@ class V1_ValueSpecificationTransformer
200
200
  }
201
201
  case PRIMITIVE_TYPE.LATESTDATE: {
202
202
  const cPrimitiveType = new V1_CLatestDate();
203
+ cPrimitiveType.multiplicity = multiplicity;
203
204
  return cPrimitiveType;
204
205
  }
205
206
  default:
@@ -252,7 +253,7 @@ class V1_ValueSpecificationTransformer
252
253
  valueSpecification: EnumValueInstanceValue,
253
254
  ): V1_ValueSpecification {
254
255
  const _enumValue = new V1_EnumValue();
255
- const _enum = valueSpecification.values[0].value;
256
+ const _enum = guaranteeNonNullable(valueSpecification.values[0]).value;
256
257
  _enumValue.value = _enum.name;
257
258
  _enumValue.fullPath = _enum.owner.path;
258
259
  return _enumValue;
@@ -96,19 +96,45 @@ const parseDataType = (val: string): RelationalDataType => {
96
96
  return new Other();
97
97
  default: {
98
98
  if (val.match(/^VARCHAR\(\d+\)$/)) {
99
- return new VarChar(getTypeParams(val)[0]);
99
+ return new VarChar(
100
+ guaranteeNonNullable(
101
+ getTypeParams(val)[0],
102
+ `VARCHAR type size is missing`,
103
+ ),
104
+ );
100
105
  } else if (val.match(/^CHAR\(\d+\)$/)) {
101
- return new Char(getTypeParams(val)[0]);
106
+ return new Char(
107
+ guaranteeNonNullable(
108
+ getTypeParams(val)[0],
109
+ `VAR type size is missing`,
110
+ ),
111
+ );
102
112
  } else if (val.match(/^VARBINARY\(\d+\)$/)) {
103
- return new VarBinary(getTypeParams(val)[0]);
113
+ return new VarBinary(
114
+ guaranteeNonNullable(
115
+ getTypeParams(val)[0],
116
+ `VARBINARY type size is missing`,
117
+ ),
118
+ );
104
119
  } else if (val.match(/^BINARY\(\d+\)$/)) {
105
- return new Binary(getTypeParams(val)[0]);
120
+ return new Binary(
121
+ guaranteeNonNullable(
122
+ getTypeParams(val)[0],
123
+ `BINARY type size is missing`,
124
+ ),
125
+ );
106
126
  } else if (val.match(/^DECIMAL\(\d+\)$/)) {
107
127
  const params = getTypeParams(val);
108
- return new Decimal(params[0], params[1]);
128
+ return new Decimal(
129
+ guaranteeNonNullable(params[0], `Decimal type precision is missing`),
130
+ guaranteeNonNullable(params[1], `Decimal type scale is missing`),
131
+ );
109
132
  } else if (val.match(/^NUMERIC\(\d+\)$/)) {
110
133
  const params = getTypeParams(val);
111
- return new Numeric(params[0], params[1]);
134
+ return new Numeric(
135
+ guaranteeNonNullable(params[0], `Decimal type precision is missing`),
136
+ guaranteeNonNullable(params[1], `Decimal type scale is missing`),
137
+ );
112
138
  }
113
139
  throw new UnsupportedOperationError(`Can't parse data type '${val}'`);
114
140
  }
@@ -21,6 +21,7 @@ import {
21
21
  import type { Log } from '@finos/legend-shared';
22
22
  import {
23
23
  uniq,
24
+ guaranteeNonNullable,
24
25
  assertNonEmptyString,
25
26
  guaranteeType,
26
27
  } from '@finos/legend-shared';
@@ -161,7 +162,7 @@ export class V1_GraphBuilderContext {
161
162
  isFullPath: true,
162
163
  };
163
164
  case 1:
164
- return Array.from(results.values())[0];
165
+ return guaranteeNonNullable(Array.from(results.values())[0]);
165
166
  default:
166
167
  throw new GraphBuilderError(
167
168
  undefined,
@@ -22,6 +22,7 @@ import {
22
22
  guaranteeType,
23
23
  assertNonEmptyString,
24
24
  assertTrue,
25
+ guaranteeNonNullable,
25
26
  } from '@finos/legend-shared';
26
27
  import { GRAPH_MANAGER_LOG_EVENT } from '../../../../../../../graphManager/GraphManagerLogEvent';
27
28
  import type { Mapping } from '../../../../../../metamodels/pure/packageableElements/mapping/Mapping';
@@ -154,7 +155,7 @@ export class V1_ProtocolToMetaModelClassMappingSecondPassBuilder
154
155
  this.context,
155
156
  pureInstanceSetImplementation,
156
157
  pureInstanceSetImplementation,
157
- this.parent.enumerationMappings,
158
+ getAllEnumerationMappings(this.parent),
158
159
  ),
159
160
  ),
160
161
  ) as PurePropertyMapping[];
@@ -270,7 +271,9 @@ export class V1_ProtocolToMetaModelClassMappingSecondPassBuilder
270
271
  );
271
272
  mainTableAlias = new TableAlias();
272
273
  mainTableAlias.name = '';
273
- mainTableAlias.relation = Array.from(tables.values())[0];
274
+ mainTableAlias.relation = guaranteeNonNullable(
275
+ Array.from(tables.values())[0],
276
+ );
274
277
  mainTableAlias.database = Array.from(dbs.values())[0];
275
278
  rootRelationalInstanceSetImplementation.mainTableAlias = mainTableAlias;
276
279
  }
@@ -315,7 +318,7 @@ export class V1_ProtocolToMetaModelClassMappingSecondPassBuilder
315
318
  this.context,
316
319
  aggragetionAwareInstanceSetImplementation,
317
320
  aggragetionAwareInstanceSetImplementation,
318
- this.parent.enumerationMappings,
321
+ getAllEnumerationMappings(this.parent),
319
322
  new Map<string, TableAlias>(),
320
323
  [
321
324
  ...getAllClassMappings(mapping),
@@ -19,6 +19,7 @@ import {
19
19
  assertTrue,
20
20
  isNonNullable,
21
21
  assertErrorThrown,
22
+ guaranteeNonNullable,
22
23
  } from '@finos/legend-shared';
23
24
  import { CORE_ELEMENT_PATH } from '../../../../../../../MetaModelConst';
24
25
  import { Class } from '../../../../../../metamodels/pure/packageableElements/domain/Class';
@@ -117,8 +118,8 @@ export class V1_ProtocolToMetaModelGraphThirdPassBuilder
117
118
  const association = this.context.graph.getAssociation(
118
119
  this.context.graph.buildPath(element.package, element.name),
119
120
  );
120
- const first = element.properties[0];
121
- const second = element.properties[1];
121
+ const first = guaranteeNonNullable(element.properties[0]);
122
+ const second = guaranteeNonNullable(element.properties[1]);
122
123
  association.setProperties([
123
124
  V1_buildAssociationProperty(first, second, this.context, association),
124
125
  V1_buildAssociationProperty(second, first, this.context, association),
@@ -40,10 +40,7 @@ import { InferableMappingElementIdExplicitValue } from '../../../../../../metamo
40
40
  import type { PackageableElementReference } from '../../../../../../metamodels/pure/packageableElements/PackageableElementReference';
41
41
  import { PackageableElementImplicitReference } from '../../../../../../metamodels/pure/packageableElements/PackageableElementReference';
42
42
  import type { PropertyReference } from '../../../../../../metamodels/pure/packageableElements/domain/PropertyReference';
43
- import {
44
- PropertyImplicitReference,
45
- PropertyExplicitReference,
46
- } from '../../../../../../metamodels/pure/packageableElements/domain/PropertyReference';
43
+ import { PropertyImplicitReference } from '../../../../../../metamodels/pure/packageableElements/domain/PropertyReference';
47
44
  import { RootRelationalInstanceSetImplementation } from '../../../../../../metamodels/pure/packageableElements/store/relational/mapping/RootRelationalInstanceSetImplementation';
48
45
  import { OtherwiseEmbeddedRelationalInstanceSetImplementation } from '../../../../../../metamodels/pure/packageableElements/store/relational/mapping/OtherwiseEmbeddedRelationalInstanceSetImplementation';
49
46
  import { EmbeddedRelationalInstanceSetImplementation } from '../../../../../../metamodels/pure/packageableElements/store/relational/mapping/EmbeddedRelationalInstanceSetImplementation';
@@ -80,6 +77,7 @@ import {
80
77
  import { V1_transformRelationalOperationElement } from '../from/V1_DatabaseTransformer';
81
78
  import { V1_GraphTransformerContextBuilder } from '../from/V1_GraphTransformerContext';
82
79
  import {
80
+ getAllEnumerationMappings,
83
81
  getClassMappingById,
84
82
  getClassMappingsByClass,
85
83
  } from '../../../../../../../helpers/MappingHelper';
@@ -638,7 +636,9 @@ export class V1_ProtocolToMetaModelPropertyMappingBuilder
638
636
  this.context,
639
637
  embedded,
640
638
  this.topParent,
641
- this.topParent?.parent.enumerationMappings ?? [],
639
+ this.topParent?.parent
640
+ ? getAllEnumerationMappings(this.topParent.parent)
641
+ : [],
642
642
  this.tableAliasMap,
643
643
  ),
644
644
  ),
@@ -696,7 +696,9 @@ export class V1_ProtocolToMetaModelPropertyMappingBuilder
696
696
  this.context,
697
697
  otherwiseEmbedded,
698
698
  this.topParent,
699
- this.topParent?.parent.enumerationMappings ?? [],
699
+ this.topParent?.parent
700
+ ? getAllEnumerationMappings(this.topParent.parent)
701
+ : [],
700
702
  this.tableAliasMap,
701
703
  ),
702
704
  ),
@@ -707,7 +709,9 @@ export class V1_ProtocolToMetaModelPropertyMappingBuilder
707
709
  this.context,
708
710
  otherwiseEmbedded,
709
711
  this.topParent,
710
- this.topParent?.parent.enumerationMappings ?? [],
712
+ this.topParent?.parent
713
+ ? getAllEnumerationMappings(this.topParent.parent)
714
+ : [],
711
715
  this.tableAliasMap,
712
716
  ),
713
717
  ),
@@ -750,10 +754,13 @@ export class V1_ProtocolToMetaModelPropertyMappingBuilder
750
754
  );
751
755
  const xStorePropertyMapping = new XStorePropertyMapping(
752
756
  xStoreParent,
753
- // NOTE: this should be `implicit` because this comes from an association
754
- // that we should have inferred. But we need to test the impact of changing it to `implicit`.
755
- // This might cause bugs in the future.
756
- PropertyExplicitReference.create(property),
757
+ PropertyImplicitReference.create(
758
+ PackageableElementImplicitReference.create(
759
+ _association,
760
+ protocol.property.class,
761
+ ),
762
+ property,
763
+ ),
757
764
  guaranteeNonNullable(sourceSetImplementation),
758
765
  targetSetImplementation,
759
766
  );
@@ -27,6 +27,7 @@ import { V1_ProtocolToMetaModelPropertyMappingBuilder } from '../../../../transf
27
27
  import type { V1_AssociationMapping } from '../../../../model/packageableElements/mapping/V1_AssociationMapping';
28
28
  import { V1_XStoreAssociationMapping } from '../../../../model/packageableElements/mapping/xStore/V1_XStoreAssociationMapping';
29
29
  import { XStoreAssociationImplementation } from '../../../../../../../metamodels/pure/packageableElements/mapping/xStore/XStoreAssociationImplementation';
30
+ import { getAllEnumerationMappings } from '../../../../../../../../helpers/MappingHelper';
30
31
 
31
32
  const getInferredAssociationMappingId = (
32
33
  _association: Association,
@@ -63,7 +64,7 @@ const buildRelationalAssociationMapping = (
63
64
  context,
64
65
  relationalAssociationImplementation,
65
66
  undefined,
66
- parentMapping.enumerationMappings,
67
+ getAllEnumerationMappings(parentMapping),
67
68
  undefined,
68
69
  allClassMappings,
69
70
  ),
@@ -96,7 +97,7 @@ const buildXStoreAssociationMapping = (
96
97
  context,
97
98
  xStoreAssociationImplementation,
98
99
  undefined,
99
- parentMapping.enumerationMappings,
100
+ getAllEnumerationMappings(parentMapping),
100
101
  undefined,
101
102
  allClassMappings,
102
103
  xStoreAssociationImplementation,
@@ -218,7 +218,10 @@ const buildJoinTreeNode = (
218
218
  joins: { joinReference: JoinReference; joinType?: JoinType | undefined }[],
219
219
  context: V1_GraphBuilderContext,
220
220
  ): JoinTreeNode => {
221
- const joinWithJoinType = joins[0];
221
+ const joinWithJoinType = guaranteeNonNullable(
222
+ joins[0],
223
+ `Can't build join tree node: at least one child node is expected`,
224
+ );
222
225
  const res = new JoinTreeNode(
223
226
  joinWithJoinType.joinReference,
224
227
  joinWithJoinType.joinType,
@@ -599,7 +602,7 @@ export const V1_buildDatabaseJoin = (
599
602
  selfJoinTargets.length !== 0,
600
603
  `Can't build join of 1 table, unless it is a self-join. Please use the '{target}' notation in order to define a directed self-join`,
601
604
  );
602
- const existingAlias = aliases[0];
605
+ const existingAlias = aliases[0] as TableAlias;
603
606
  const existingAliasName = existingAlias.name;
604
607
  const existingRelationalElement = existingAlias.relation;
605
608
  const tableAlias = new TableAlias();
@@ -628,8 +631,14 @@ export const V1_buildDatabaseJoin = (
628
631
  });
629
632
  }
630
633
  join.aliases = [
631
- new Pair<TableAlias, TableAlias>(aliases[0], aliases[1]),
632
- new Pair<TableAlias, TableAlias>(aliases[1], aliases[0]),
634
+ new Pair<TableAlias, TableAlias>(
635
+ aliases[0] as TableAlias,
636
+ aliases[1] as TableAlias,
637
+ ),
638
+ new Pair<TableAlias, TableAlias>(
639
+ aliases[1] as TableAlias,
640
+ aliases[0] as TableAlias,
641
+ ),
633
642
  ];
634
643
  join.owner = database;
635
644
  return join;
@@ -248,7 +248,8 @@ const isCompatibleDerivedProperty = (
248
248
  ): boolean =>
249
249
  o.name === name &&
250
250
  Array.isArray(o.parameters) &&
251
- o.parameters.length === params.length;
251
+ // We add 1 to account for the `this` parameter in the derived property
252
+ o.parameters.length + 1 === params.length;
252
253
 
253
254
  export const V1_getAppliedProperty = (
254
255
  parentClass: Class,
@@ -303,7 +303,9 @@ export const V1_resolveClassMappingRoot = (mapping: Mapping): void => {
303
303
  Array.from(classToSetImplMap.entries()).forEach((entries) => {
304
304
  const _classMappings = entries[1];
305
305
  if (_classMappings.size === 1) {
306
- const classMapping = Array.from(_classMappings.values())[0];
306
+ const classMapping = Array.from(
307
+ _classMappings.values(),
308
+ )[0] as SetImplementation;
307
309
  // ensure you are only altering current mapping
308
310
  if (
309
311
  classMapping.root.value === false &&