@finos/legend-graph 0.1.3 → 0.2.2

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 (262) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/lib/DSLMapping_Exports.d.ts +2 -0
  3. package/lib/DSLMapping_Exports.d.ts.map +1 -1
  4. package/lib/DSLMapping_Exports.js +1 -0
  5. package/lib/DSLMapping_Exports.js.map +1 -1
  6. package/lib/DSLService_Exports.d.ts +0 -1
  7. package/lib/DSLService_Exports.d.ts.map +1 -1
  8. package/lib/DSLService_Exports.js +0 -1
  9. package/lib/DSLService_Exports.js.map +1 -1
  10. package/lib/GraphManagerState.d.ts +1 -0
  11. package/lib/GraphManagerState.d.ts.map +1 -1
  12. package/lib/GraphManagerState.js +27 -2
  13. package/lib/GraphManagerState.js.map +1 -1
  14. package/lib/GraphManagerTestUtils.d.ts +1 -1
  15. package/lib/GraphManagerTestUtils.d.ts.map +1 -1
  16. package/lib/GraphManagerTestUtils.js +1 -1
  17. package/lib/GraphManagerTestUtils.js.map +1 -1
  18. package/lib/GraphPluginManager.d.ts +1 -1
  19. package/lib/GraphPluginManager.d.ts.map +1 -1
  20. package/lib/MetaModelConst.d.ts +0 -2
  21. package/lib/MetaModelConst.d.ts.map +1 -1
  22. package/lib/MetaModelConst.js +0 -3
  23. package/lib/MetaModelConst.js.map +1 -1
  24. package/lib/graph/BasicModel.d.ts +1 -2
  25. package/lib/graph/BasicModel.d.ts.map +1 -1
  26. package/lib/graph/BasicModel.js +3 -13
  27. package/lib/graph/BasicModel.js.map +1 -1
  28. package/lib/graph/DependencyManager.d.ts +1 -0
  29. package/lib/graph/DependencyManager.d.ts.map +1 -1
  30. package/lib/graph/DependencyManager.js +5 -2
  31. package/lib/graph/DependencyManager.js.map +1 -1
  32. package/lib/graph/PureModel.d.ts +0 -2
  33. package/lib/graph/PureModel.d.ts.map +1 -1
  34. package/lib/graph/PureModel.js +0 -4
  35. package/lib/graph/PureModel.js.map +1 -1
  36. package/lib/graphManager/DSLMapping_PureGraphManagerPlugin_Extension.d.ts +25 -0
  37. package/lib/graphManager/DSLMapping_PureGraphManagerPlugin_Extension.d.ts.map +1 -0
  38. package/lib/{models/protocols/pure/v1/transformation/pureGraph/from/V1_ServiceStoreTransformer.d.ts → graphManager/DSLMapping_PureGraphManagerPlugin_Extension.js} +2 -4
  39. package/lib/graphManager/DSLMapping_PureGraphManagerPlugin_Extension.js.map +1 -0
  40. package/lib/{models/protocols/pure/v1/transformation/pureGraph/from/V1_ServiceStoreTransformer.js → graphManager/action/ExecutionError.d.ts} +6 -9
  41. package/lib/graphManager/action/ExecutionError.d.ts.map +1 -0
  42. package/lib/{models/metamodels/pure/packageableElements/store/relational/model/ServiceStore.d.ts → graphManager/action/ExecutionError.js} +4 -9
  43. package/lib/graphManager/action/ExecutionError.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/PackageableElement.d.ts +0 -2
  51. package/lib/models/metamodels/pure/packageableElements/PackageableElement.d.ts.map +1 -1
  52. package/lib/models/metamodels/pure/packageableElements/PackageableElement.js +0 -1
  53. package/lib/models/metamodels/pure/packageableElements/PackageableElement.js.map +1 -1
  54. package/lib/models/metamodels/pure/packageableElements/domain/Association.js +1 -1
  55. package/lib/models/metamodels/pure/packageableElements/domain/Association.js.map +1 -1
  56. package/lib/models/metamodels/pure/packageableElements/mapping/EnumValueMapping.d.ts.map +1 -1
  57. package/lib/models/metamodels/pure/packageableElements/mapping/EnumValueMapping.js +2 -2
  58. package/lib/models/metamodels/pure/packageableElements/mapping/EnumValueMapping.js.map +1 -1
  59. package/lib/models/metamodels/pure/packageableElements/mapping/SetImplementation.d.ts +2 -0
  60. package/lib/models/metamodels/pure/packageableElements/mapping/SetImplementation.d.ts.map +1 -1
  61. package/lib/models/metamodels/pure/packageableElements/mapping/SetImplementation.js +0 -1
  62. package/lib/models/metamodels/pure/packageableElements/mapping/SetImplementation.js.map +1 -1
  63. package/lib/models/metamodels/pure/packageableElements/store/relational/mapping/RelationalInputData.d.ts +1 -0
  64. package/lib/models/metamodels/pure/packageableElements/store/relational/mapping/RelationalInputData.d.ts.map +1 -1
  65. package/lib/models/metamodels/pure/packageableElements/store/relational/mapping/RelationalInputData.js +4 -0
  66. package/lib/models/metamodels/pure/packageableElements/store/relational/mapping/RelationalInputData.js.map +1 -1
  67. package/lib/models/metamodels/pure/packageableElements/store/relational/model/RelationalOperationElement.d.ts.map +1 -1
  68. package/lib/models/metamodels/pure/packageableElements/store/relational/model/RelationalOperationElement.js +3 -1
  69. package/lib/models/metamodels/pure/packageableElements/store/relational/model/RelationalOperationElement.js.map +1 -1
  70. package/lib/models/metamodels/pure/valueSpecification/SimpleFunctionExpression.d.ts.map +1 -1
  71. package/lib/models/metamodels/pure/valueSpecification/SimpleFunctionExpression.js +1 -0
  72. package/lib/models/metamodels/pure/valueSpecification/SimpleFunctionExpression.js.map +1 -1
  73. package/lib/models/protocols/pure/DSLMapping_PureProtocolProcessorPlugin_Extension.d.ts +15 -2
  74. package/lib/models/protocols/pure/DSLMapping_PureProtocolProcessorPlugin_Extension.d.ts.map +1 -1
  75. package/lib/models/protocols/pure/DSLMapping_PureProtocolProcessorPlugin_Extension.js +1 -3
  76. package/lib/models/protocols/pure/DSLMapping_PureProtocolProcessorPlugin_Extension.js.map +1 -1
  77. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts +2 -2
  78. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts.map +1 -1
  79. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js.map +1 -1
  80. package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  81. package/lib/models/protocols/pure/v1/V1_PureGraphManager.js +3 -15
  82. package/lib/models/protocols/pure/v1/V1_PureGraphManager.js.map +1 -1
  83. package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts.map +1 -1
  84. package/lib/models/protocols/pure/v1/engine/V1_Engine.js +15 -5
  85. package/lib/models/protocols/pure/v1/engine/V1_Engine.js.map +1 -1
  86. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.d.ts +3 -0
  87. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.d.ts.map +1 -1
  88. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.js +7 -0
  89. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.js.map +1 -1
  90. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecutionError.d.ts +22 -0
  91. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecutionError.d.ts.map +1 -0
  92. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecutionError.js +26 -0
  93. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecutionError.js.map +1 -0
  94. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextPointer.d.ts +3 -3
  95. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextPointer.d.ts.map +1 -1
  96. package/lib/models/protocols/pure/v1/model/context/{V1_AlloySdlc.d.ts → V1_SDLC.d.ts} +4 -4
  97. package/lib/models/protocols/pure/v1/model/context/V1_SDLC.d.ts.map +1 -0
  98. package/lib/models/protocols/pure/v1/model/context/{V1_AlloySdlc.js → V1_SDLC.js} +3 -3
  99. package/lib/models/protocols/pure/v1/model/context/V1_SDLC.js.map +1 -0
  100. package/lib/models/protocols/pure/v1/model/packageableElements/V1_PackageableElement.d.ts +0 -2
  101. package/lib/models/protocols/pure/v1/model/packageableElements/V1_PackageableElement.d.ts.map +1 -1
  102. package/lib/models/protocols/pure/v1/model/packageableElements/V1_PackageableElement.js.map +1 -1
  103. package/lib/models/protocols/pure/v1/model/packageableElements/connection/V1_Connection.d.ts.map +1 -1
  104. package/lib/models/protocols/pure/v1/model/packageableElements/connection/V1_Connection.js.map +1 -1
  105. package/lib/models/protocols/pure/v1/model/packageableElements/mapping/V1_ClassMapping.d.ts +1 -0
  106. package/lib/models/protocols/pure/v1/model/packageableElements/mapping/V1_ClassMapping.d.ts.map +1 -1
  107. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_DatabaseTransformer.d.ts.map +1 -1
  108. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_DatabaseTransformer.js +4 -2
  109. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_DatabaseTransformer.js.map +1 -1
  110. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts +2 -0
  111. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.d.ts.map +1 -1
  112. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js +16 -4
  113. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js.map +1 -1
  114. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.d.ts +0 -2
  115. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.d.ts.map +1 -1
  116. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.js +0 -4
  117. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.js.map +1 -1
  118. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js +3 -3
  119. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js.map +1 -1
  120. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ExecutionPlanBuilder.d.ts.map +1 -1
  121. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ExecutionPlanBuilder.js +6 -6
  122. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ExecutionPlanBuilder.js.map +1 -1
  123. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.d.ts.map +1 -1
  124. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js +2 -3
  125. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.js.map +1 -1
  126. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingFirstPassBuilder.d.ts +2 -1
  127. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingFirstPassBuilder.d.ts.map +1 -1
  128. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingFirstPassBuilder.js +10 -0
  129. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingFirstPassBuilder.js.map +1 -1
  130. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingSecondPassBuilder.d.ts +2 -1
  131. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingSecondPassBuilder.d.ts.map +1 -1
  132. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingSecondPassBuilder.js +10 -4
  133. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingSecondPassBuilder.js.map +1 -1
  134. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelConnectionBuilder.js +2 -2
  135. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelConnectionBuilder.js.map +1 -1
  136. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFifthPassBuilder.d.ts +0 -2
  137. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFifthPassBuilder.d.ts.map +1 -1
  138. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFifthPassBuilder.js +0 -3
  139. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFifthPassBuilder.js.map +1 -1
  140. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFirstPassBuilder.d.ts +0 -2
  141. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFirstPassBuilder.d.ts.map +1 -1
  142. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFirstPassBuilder.js +0 -13
  143. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFirstPassBuilder.js.map +1 -1
  144. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFourthPassBuilder.d.ts +0 -2
  145. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFourthPassBuilder.d.ts.map +1 -1
  146. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFourthPassBuilder.js +0 -3
  147. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFourthPassBuilder.js.map +1 -1
  148. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.d.ts +0 -2
  149. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.d.ts.map +1 -1
  150. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.js +0 -6
  151. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.js.map +1 -1
  152. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.d.ts +0 -2
  153. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.d.ts.map +1 -1
  154. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.js +3 -6
  155. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.js.map +1 -1
  156. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.d.ts.map +1 -1
  157. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.js +12 -10
  158. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.js.map +1 -1
  159. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_AssociationMappingHelper.d.ts.map +1 -1
  160. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_AssociationMappingHelper.js +3 -2
  161. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_AssociationMappingHelper.js.map +1 -1
  162. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.d.ts.map +1 -1
  163. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.js +1 -1
  164. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.js.map +1 -1
  165. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.d.ts.map +1 -1
  166. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.js.map +1 -1
  167. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.d.ts +1 -1
  168. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.d.ts.map +1 -1
  169. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.js +6 -4
  170. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.js.map +1 -1
  171. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -1
  172. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js +11 -10
  173. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js.map +1 -1
  174. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.d.ts +0 -2
  175. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.d.ts.map +1 -1
  176. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.js +5 -11
  177. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.js.map +1 -1
  178. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js +8 -8
  179. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js.map +1 -1
  180. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.d.ts.map +1 -1
  181. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js +2 -4
  182. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js.map +1 -1
  183. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts +3 -1
  184. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts.map +1 -1
  185. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js +36 -7
  186. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js.map +1 -1
  187. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.d.ts +0 -3
  188. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.d.ts.map +1 -1
  189. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.js +0 -10
  190. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.js.map +1 -1
  191. package/package.json +10 -9
  192. package/src/DSLMapping_Exports.ts +2 -0
  193. package/src/DSLService_Exports.ts +0 -1
  194. package/src/GraphManagerState.ts +35 -4
  195. package/src/GraphManagerTestUtils.tsx +1 -1
  196. package/src/GraphPluginManager.ts +1 -1
  197. package/src/MetaModelConst.ts +0 -3
  198. package/src/graph/BasicModel.ts +6 -15
  199. package/src/graph/DependencyManager.ts +7 -2
  200. package/src/graph/PureModel.ts +0 -9
  201. package/{lib/models/protocols/pure/v1/model/packageableElements/store/relational/V1_ServiceStore.d.ts → src/graphManager/DSLMapping_PureGraphManagerPlugin_Extension.ts} +14 -8
  202. package/src/graphManager/action/ExecutionError.ts +24 -0
  203. package/src/helpers/MappingResolutionHelper.ts +3 -3
  204. package/src/index.ts +2 -0
  205. package/src/models/metamodels/pure/packageableElements/PackageableElement.ts +0 -3
  206. package/src/models/metamodels/pure/packageableElements/domain/Association.ts +1 -1
  207. package/src/models/metamodels/pure/packageableElements/mapping/EnumValueMapping.ts +7 -2
  208. package/src/models/metamodels/pure/packageableElements/mapping/SetImplementation.ts +2 -1
  209. package/src/models/metamodels/pure/packageableElements/store/relational/mapping/RelationalInputData.ts +5 -0
  210. package/src/models/metamodels/pure/packageableElements/store/relational/model/RelationalOperationElement.ts +3 -1
  211. package/src/models/metamodels/pure/valueSpecification/SimpleFunctionExpression.ts +1 -0
  212. package/src/models/protocols/pure/DSLMapping_PureProtocolProcessorPlugin_Extension.ts +41 -2
  213. package/src/models/protocols/pure/PureProtocolProcessorPlugin.ts +2 -0
  214. package/src/models/protocols/pure/v1/V1_PureGraphManager.ts +3 -14
  215. package/src/models/protocols/pure/v1/engine/V1_Engine.ts +25 -11
  216. package/src/models/protocols/pure/v1/engine/V1_EngineHelper.ts +11 -0
  217. package/src/models/protocols/pure/v1/engine/execution/V1_ExecutionError.ts +30 -0
  218. package/src/models/protocols/pure/v1/model/context/V1_PureModelContextPointer.ts +3 -3
  219. package/src/models/protocols/pure/v1/model/context/{V1_AlloySdlc.ts → V1_SDLC.ts} +3 -3
  220. package/src/models/protocols/pure/v1/model/packageableElements/V1_PackageableElement.ts +0 -3
  221. package/src/models/protocols/pure/v1/model/packageableElements/connection/V1_Connection.ts +0 -1
  222. package/src/models/protocols/pure/v1/model/packageableElements/mapping/V1_ClassMapping.ts +1 -1
  223. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_DatabaseTransformer.ts +4 -2
  224. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts +30 -4
  225. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_PackageableElementTransformer.ts +0 -6
  226. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.ts +3 -3
  227. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ExecutionPlanBuilder.ts +32 -6
  228. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_GraphBuilderContext.ts +2 -2
  229. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingFirstPassBuilder.ts +28 -1
  230. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelClassMappingSecondPassBuilder.ts +23 -4
  231. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelConnectionBuilder.ts +2 -2
  232. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFifthPassBuilder.ts +0 -7
  233. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFirstPassBuilder.ts +0 -27
  234. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphFourthPassBuilder.ts +0 -7
  235. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.ts +0 -13
  236. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.ts +3 -9
  237. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.ts +18 -11
  238. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_AssociationMappingHelper.ts +3 -2
  239. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DatabaseBuilderHelper.ts +13 -4
  240. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_MappingBuilderHelper.ts +3 -1
  241. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ProcessingContext.ts +8 -4
  242. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.ts +18 -12
  243. package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_PackageableElementSerialization.ts +4 -16
  244. package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.ts +5 -5
  245. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.ts +5 -4
  246. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts +86 -32
  247. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.ts +0 -13
  248. package/tsconfig.json +5 -4
  249. package/tsconfig.package.json +1 -0
  250. package/lib/models/metamodels/pure/packageableElements/store/relational/model/ServiceStore.d.ts.map +0 -1
  251. package/lib/models/metamodels/pure/packageableElements/store/relational/model/ServiceStore.js +0 -41
  252. package/lib/models/metamodels/pure/packageableElements/store/relational/model/ServiceStore.js.map +0 -1
  253. package/lib/models/protocols/pure/v1/model/context/V1_AlloySdlc.d.ts.map +0 -1
  254. package/lib/models/protocols/pure/v1/model/context/V1_AlloySdlc.js.map +0 -1
  255. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/V1_ServiceStore.d.ts.map +0 -1
  256. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/V1_ServiceStore.js +0 -33
  257. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/V1_ServiceStore.js.map +0 -1
  258. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ServiceStoreTransformer.d.ts.map +0 -1
  259. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ServiceStoreTransformer.js.map +0 -1
  260. package/src/models/metamodels/pure/packageableElements/store/relational/model/ServiceStore.ts +0 -50
  261. package/src/models/protocols/pure/v1/model/packageableElements/store/relational/V1_ServiceStore.ts +0 -40
  262. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_ServiceStoreTransformer.ts +0 -28
@@ -105,7 +105,7 @@ export class Association
105
105
  idx !== -1,
106
106
  `Can't find property '${property.name}' in association '${this.path}'`,
107
107
  );
108
- return this.properties[(idx + 1) % 2];
108
+ return guaranteeNonNullable(this.properties[(idx + 1) % 2]);
109
109
  };
110
110
  getPropertyAssociatedClass = (property: AbstractProperty): Class => {
111
111
  if (property instanceof Property) {
@@ -15,7 +15,12 @@
15
15
  */
16
16
 
17
17
  import { observable, action, computed, makeObservable } from 'mobx';
18
- import { uuid, isNumber, hashArray } from '@finos/legend-shared';
18
+ import {
19
+ uuid,
20
+ isNumber,
21
+ hashArray,
22
+ guaranteeNonNullable,
23
+ } from '@finos/legend-shared';
19
24
  import {
20
25
  CORE_HASH_STRUCTURE,
21
26
  PRIMITIVE_TYPE,
@@ -82,7 +87,7 @@ export class EnumValueMapping implements Hashable, Stubable {
82
87
  val: Enum | string | undefined,
83
88
  sourceType: Type | undefined,
84
89
  ): void {
85
- const sourceValue = this.sourceValues[idx];
90
+ const sourceValue = guaranteeNonNullable(this.sourceValues[idx]);
86
91
  // If the source type is an enumeration but the value does NOT match an enum value (most likely user is mid typing an enum value)
87
92
  // we move on to update the source value with the string value
88
93
  if (
@@ -33,8 +33,10 @@ import type { RootRelationalInstanceSetImplementation } from '../store/relationa
33
33
  import type { InferableMappingElementIdValue } from './InferableMappingElementId';
34
34
  import type { InferableMappingElementRoot } from './InferableMappingElementRoot';
35
35
  import type { AggregationAwareSetImplementation } from './aggregationAware/AggregationAwareSetImplementation';
36
+ import type { InstanceSetImplementation } from './InstanceSetImplementation';
36
37
 
37
38
  export interface SetImplementationVisitor<T> {
39
+ visit_SetImplementation(setImplementation: InstanceSetImplementation): T;
38
40
  visit_OperationSetImplementation(
39
41
  setImplementation: OperationSetImplementation,
40
42
  ): T;
@@ -133,7 +135,6 @@ export enum BASIC_SET_IMPLEMENTATION_TYPE {
133
135
  INSTANCE = 'instance',
134
136
  }
135
137
 
136
- /* @MARKER: NEW CLASS MAPPING TYPE SUPPORT --- consider adding class mapping type handler here whenever support for a new one is added to the app */
137
138
  export enum SET_IMPLEMENTATION_TYPE {
138
139
  OPERATION = 'operation',
139
140
  PUREINSTANCE = 'pureInstance',
@@ -58,6 +58,7 @@ export class RelationalInputData extends InputData implements Hashable {
58
58
  data: observable,
59
59
  inputType: observable,
60
60
  setData: action,
61
+ setInputType: action,
61
62
  validationResult: computed,
62
63
  hashCode: computed,
63
64
  });
@@ -71,6 +72,10 @@ export class RelationalInputData extends InputData implements Hashable {
71
72
  this.data = value;
72
73
  }
73
74
 
75
+ setInputType(value: string): void {
76
+ this.inputType = getRelationalInputType(value);
77
+ }
78
+
74
79
  get validationResult(): ValidationIssue | undefined {
75
80
  if (this.database.value.isStub) {
76
81
  return createValidationError([
@@ -167,7 +167,9 @@ export class JoinTreeNode {
167
167
  */
168
168
  export const extractLine = (joinTreeNode: JoinTreeNode): JoinTreeNode[] =>
169
169
  [joinTreeNode].concat(
170
- joinTreeNode.children.length ? extractLine(joinTreeNode.children[0]) : [],
170
+ joinTreeNode.children.length
171
+ ? extractLine(joinTreeNode.children[0] as JoinTreeNode)
172
+ : [],
171
173
  );
172
174
 
173
175
  export class RelationalOperationElementWithJoin extends RelationalOperationElement {
@@ -62,6 +62,7 @@ export class FunctionExpression extends Expression {
62
62
  }
63
63
 
64
64
  export class SimpleFunctionExpression extends FunctionExpression {
65
+ // eslint-disable-next-line @typescript-eslint/ban-types
65
66
  func?: PackageableElementReference<Function> | undefined;
66
67
 
67
68
  override accept_ValueSpecificationVisitor<T>(
@@ -16,13 +16,41 @@
16
16
 
17
17
  import type { PlainObject } from '@finos/legend-shared';
18
18
  import type { Connection } from '../../metamodels/pure/packageableElements/connection/Connection';
19
- import { PureProtocolProcessorPlugin } from './PureProtocolProcessorPlugin';
19
+ import type { Mapping } from '../../metamodels/pure/packageableElements/mapping/Mapping';
20
+ import type { InstanceSetImplementation } from '../../metamodels/pure/packageableElements/mapping/InstanceSetImplementation';
21
+ import type { PureProtocolProcessorPlugin } from './PureProtocolProcessorPlugin';
20
22
  import type { V1_Connection } from '../pure/v1/model/packageableElements/connection/V1_Connection';
21
23
  import type { V1_GraphTransformerContext } from './v1/transformation/pureGraph/from/V1_GraphTransformerContext';
24
+ import type { V1_ClassMapping } from '../pure/v1/model/packageableElements/mapping/V1_ClassMapping';
22
25
  import type { V1_GraphBuilderContext } from './v1/transformation/pureGraph/to/V1_GraphBuilderContext';
23
26
  import type { Store } from '../../metamodels/pure/packageableElements/store/Store';
24
27
  import type { PackageableElementReference } from '../../metamodels/pure/packageableElements/PackageableElementReference';
25
28
 
29
+ export type V1_ClassMappingFirstPassBuilder = (
30
+ classMapping: V1_ClassMapping,
31
+ context: V1_GraphBuilderContext,
32
+ parent: Mapping,
33
+ ) => InstanceSetImplementation | undefined;
34
+
35
+ export type V1_ClassMappingSecondPassBuilder = (
36
+ classMapping: V1_ClassMapping,
37
+ context: V1_GraphBuilderContext,
38
+ parent: Mapping,
39
+ ) => void;
40
+
41
+ export type V1_ClassMappingTransformer = (
42
+ setImplementation: InstanceSetImplementation,
43
+ context: V1_GraphTransformerContext,
44
+ ) => V1_ClassMapping | undefined;
45
+
46
+ export type V1_ClassMappingSerializer = (
47
+ value: V1_ClassMapping,
48
+ ) => V1_ClassMapping | undefined;
49
+
50
+ export type V1_ClassMappingDeserializer = (
51
+ json: PlainObject<V1_ClassMapping>,
52
+ ) => V1_ClassMapping | undefined;
53
+
26
54
  export type V1_ConnectionBuilder = (
27
55
  connection: V1_Connection,
28
56
  context: V1_GraphBuilderContext,
@@ -42,7 +70,18 @@ export type V1_ConnectionProtocolDeserializer = (
42
70
  json: PlainObject<V1_Connection>,
43
71
  ) => V1_Connection | undefined;
44
72
 
45
- export abstract class DSLMapping_PureProtocolProcessorPlugin_Extension extends PureProtocolProcessorPlugin {
73
+ export interface DSLMapping_PureProtocolProcessorPlugin_Extension
74
+ extends PureProtocolProcessorPlugin {
75
+ V1_getExtraClassMappingFirstPassBuilders?(): V1_ClassMappingFirstPassBuilder[];
76
+
77
+ V1_getExtraClassMappingSecondPassBuilders?(): V1_ClassMappingSecondPassBuilder[];
78
+
79
+ V1_getExtraClassMappingTransformers?(): V1_ClassMappingTransformer[];
80
+
81
+ V1_getExtraClassMappingSerializers?(): V1_ClassMappingSerializer[];
82
+
83
+ V1_getExtraClassMappingDeserializers?(): V1_ClassMappingDeserializer[];
84
+
46
85
  V1_getExtraConnectionBuilders?(): V1_ConnectionBuilder[];
47
86
 
48
87
  V1_getExtraConnectionTransformers?(): V1_ConnectionTransformer[];
@@ -41,10 +41,12 @@ export type V1_ElementTransformer = (
41
41
 
42
42
  export type V1_ElementProtocolSerializer = (
43
43
  protocol: V1_PackageableElement,
44
+ plugins: PureProtocolProcessorPlugin[],
44
45
  ) => PlainObject<V1_PackageableElement> | undefined;
45
46
 
46
47
  export type V1_ElementProtocolDeserializer = (
47
48
  protocol: PlainObject<V1_PackageableElement>,
49
+ plugins: PureProtocolProcessorPlugin[],
48
50
  ) => V1_PackageableElement | undefined;
49
51
 
50
52
  export type V1_FunctionExpressionBuilder = (
@@ -135,7 +135,7 @@ import { V1_GenerationSpecification } from './model/packageableElements/generati
135
135
  import { V1_Mapping } from './model/packageableElements/mapping/V1_Mapping';
136
136
  import { V1_ConcreteFunctionDefinition } from './model/packageableElements/function/V1_ConcreteFunctionDefinition';
137
137
  import { V1_PureModelContextComposite } from './model/context/V1_PureModelContextComposite';
138
- import { V1_AlloySdlc } from './model/context/V1_AlloySdlc';
138
+ import { V1_AlloySDLC } from './model/context/V1_SDLC';
139
139
  import { V1_Protocol } from './model/V1_Protocol';
140
140
  import type { V1_PureModelContext } from './model/context/V1_PureModelContext';
141
141
  import type { V1_ElementBuilder } from './transformation/pureGraph/to/V1_ElementBuilder';
@@ -154,7 +154,6 @@ import {
154
154
  import { V1_transformRelationalDatabaseConnection } from './transformation/pureGraph/from/V1_ConnectionTransformer';
155
155
  import { V1_FlatData } from './model/packageableElements/store/flatData/model/V1_FlatData';
156
156
  import { V1_Database } from './model/packageableElements/store/relational/model/V1_Database';
157
- import { V1_ServiceStore } from './model/packageableElements/store/relational/V1_ServiceStore';
158
157
  import type { V1_Multiplicity } from './model/packageableElements/domain/V1_Multiplicity';
159
158
  import type { V1_RawVariable } from './model/rawValueSpecification/V1_RawVariable';
160
159
  import { V1_setupDatabaseSerialization } from './transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper';
@@ -421,7 +420,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
421
420
 
422
421
  // --------------------------------------------- Graph Builder ---------------------------------------------
423
422
 
424
- /* @MARKER: NEW ELEMENT TYPE SUPPORT --- consider adding new element type handler here whenever support for a new element type is added to the app */
425
423
  *buildSystem(
426
424
  coreModel: CoreModel,
427
425
  systemModel: SystemModel,
@@ -495,7 +493,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
495
493
  }
496
494
  }
497
495
 
498
- /* @MARKER: NEW ELEMENT TYPE SUPPORT --- consider adding new element type handler here whenever support for a new element type is added to the app */
499
496
  *buildDependencies(
500
497
  coreModel: CoreModel,
501
498
  systemModel: SystemModel,
@@ -605,7 +602,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
605
602
  }
606
603
  }
607
604
 
608
- /* @MARKER: NEW ELEMENT TYPE SUPPORT --- consider adding new element type handler here whenever support for a new element type is added to the app */
609
605
  *buildGraph(
610
606
  graph: PureModel,
611
607
  entities: Entity[],
@@ -1794,7 +1790,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
1794
1790
  *
1795
1791
  */
1796
1792
  const graphData = this.getFullGraphModelData(graph);
1797
- /* @MARKER: NEW ELEMENT TYPE SUPPORT --- consider adding new element type handler here whenever support for a new element type is added to the app */
1798
1793
  const prunedGraphData = new V1_PureModelContextData();
1799
1794
  const extraExecutionElements = this.pluginManager
1800
1795
  .getPureProtocolProcessorPlugins()
@@ -1970,7 +1965,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
1970
1965
  break;
1971
1966
  }
1972
1967
  case ServiceExecutionMode.SEMI_INTERACTIVE: {
1973
- const sdlcInfo = new V1_AlloySdlc(groupdId, artifactId, version);
1968
+ const sdlcInfo = new V1_AlloySDLC(groupdId, artifactId, version);
1974
1969
  const pointer = new V1_PureModelContextPointer(protocol, sdlcInfo);
1975
1970
  // data
1976
1971
  const data = new V1_PureModelContextData();
@@ -1996,7 +1991,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
1996
1991
  break;
1997
1992
  }
1998
1993
  case ServiceExecutionMode.PROD: {
1999
- const sdlcInfo = new V1_AlloySdlc(groupdId, artifactId, version);
1994
+ const sdlcInfo = new V1_AlloySDLC(groupdId, artifactId, version);
2000
1995
  const pointer = new V1_PureModelContextPointer(protocol, sdlcInfo);
2001
1996
  sdlcInfo.packageableElementPointers = [
2002
1997
  new V1_PackageableElementPointer(
@@ -2034,7 +2029,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
2034
2029
  service: Service,
2035
2030
  ): V1_PureModelContextData => {
2036
2031
  const graphData = this.getFullGraphModelData(graph);
2037
- /* @MARKER: NEW ELEMENT TYPE SUPPORT --- consider adding new element type handler here whenever support for a new element type is added to the app */
2038
2032
  const prunedGraphData = new V1_PureModelContextData();
2039
2033
  prunedGraphData.elements = graphData.elements.filter(
2040
2034
  (element) => !(element instanceof V1_Service),
@@ -2258,7 +2252,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
2258
2252
  return `${elementProtocol.package}${ENTITY_PATH_DELIMITER}${name}`;
2259
2253
  };
2260
2254
 
2261
- /* @MARKER: NEW ELEMENT TYPE SUPPORT --- consider adding new element type handler here whenever support for a new element type is added to the app */
2262
2255
  private getElementClassiferPath = (
2263
2256
  protocol: V1_PackageableElement,
2264
2257
  ): string => {
@@ -2286,8 +2279,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
2286
2279
  return CORE_ELEMENT_PATH.FLAT_DATA;
2287
2280
  } else if (protocol instanceof V1_Database) {
2288
2281
  return CORE_ELEMENT_PATH.DATABASE;
2289
- } else if (protocol instanceof V1_ServiceStore) {
2290
- return CORE_ELEMENT_PATH.SERVICE_STORE;
2291
2282
  } else if (protocol instanceof V1_Service) {
2292
2283
  return CORE_ELEMENT_PATH.SERVICE;
2293
2284
  } else if (protocol instanceof V1_FileGenerationSpecification) {
@@ -2311,7 +2302,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
2311
2302
  );
2312
2303
  };
2313
2304
 
2314
- /* @MARKER: NEW ELEMENT TYPE SUPPORT --- consider adding new element type handler here whenever support for a new element type is added to the app */
2315
2305
  private graphToPureModelContextData = (
2316
2306
  graph: PureModel,
2317
2307
  options?: { keepSourceInformation?: boolean | undefined } | undefined,
@@ -2333,7 +2323,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
2333
2323
  return graphData;
2334
2324
  };
2335
2325
 
2336
- /* @MARKER: NEW ELEMENT TYPE SUPPORT --- consider adding new element type handler here whenever support for a new element type is added to the app */
2337
2326
  private getGraphCompileContext = (
2338
2327
  graph: PureModel,
2339
2328
  ): V1_PureModelContextData => {
@@ -66,6 +66,7 @@ import { V1_GraphTransformerContextBuilder } from '../transformation/pureGraph/f
66
66
  import type { PureProtocolProcessorPlugin } from '../../PureProtocolProcessorPlugin';
67
67
  import {
68
68
  V1_buildCompilationError,
69
+ V1_buildExecutionError,
69
70
  V1_buildGenerationConfigurationDescription,
70
71
  V1_buildImportConfigurationDescription,
71
72
  V1_buildParserError,
@@ -82,6 +83,7 @@ import { V1_ServiceRegistrationResult } from './service/V1_ServiceRegistrationRe
82
83
  import type { V1_PureModelContext } from '../model/context/V1_PureModelContext';
83
84
  import { ServiceExecutionMode } from '../../../../../graphManager/action/service/ServiceExecutionMode';
84
85
  import { serialize } from 'serializr';
86
+ import { V1_ExecutionError } from './execution/V1_ExecutionError';
85
87
 
86
88
  class V1_EngineConfig extends TEMP__AbstractEngineConfig {
87
89
  private engine: V1_Engine;
@@ -397,17 +399,29 @@ export class V1_Engine {
397
399
  input: V1_ExecuteInput,
398
400
  useLosslessParse: boolean,
399
401
  ): Promise<V1_ExecutionResult> {
400
- const executionResultInText = await (
401
- (await this.engineServerClient.execute(
402
- V1_ExecuteInput.serialization.toJson(input),
403
- true,
404
- )) as Response
405
- ).text();
406
- return V1_serializeExecutionResult(
407
- useLosslessParse
408
- ? losslessParse(executionResultInText)
409
- : JSON.parse(executionResultInText),
410
- );
402
+ try {
403
+ const executionResultInText = await (
404
+ (await this.engineServerClient.execute(
405
+ V1_ExecuteInput.serialization.toJson(input),
406
+ true,
407
+ )) as Response
408
+ ).text();
409
+ return V1_serializeExecutionResult(
410
+ useLosslessParse
411
+ ? losslessParse(executionResultInText)
412
+ : JSON.parse(executionResultInText),
413
+ );
414
+ } catch (error) {
415
+ assertErrorThrown(error);
416
+ if (error instanceof NetworkClientError) {
417
+ throw V1_buildExecutionError(
418
+ V1_ExecutionError.serialization.fromJson(
419
+ error.payload as PlainObject<V1_ExecutionError>,
420
+ ),
421
+ );
422
+ }
423
+ throw error;
424
+ }
411
425
  }
412
426
 
413
427
  generateExecutionPlan(
@@ -50,6 +50,8 @@ import {
50
50
  } from '../../../../../graphManager/action/EngineError';
51
51
  import type { V1_SourceInformation } from '../model/V1_SourceInformation';
52
52
  import { SourceInformation } from '../../../../../graphManager/action/SourceInformation';
53
+ import { ExecutionError } from '../../../../../graphManager/action/ExecutionError';
54
+ import type { V1_ExecutionError } from './execution/V1_ExecutionError';
53
55
 
54
56
  export const V1_buildLightQuery = (
55
57
  protocol: V1_LightQuery,
@@ -317,3 +319,12 @@ export const V1_buildParserError = (protocol: V1_ParserError): ParserError => {
317
319
  : undefined;
318
320
  return metamodel;
319
321
  };
322
+
323
+ export const V1_buildExecutionError = (
324
+ protocol: V1_ExecutionError,
325
+ ): ExecutionError => {
326
+ const executionError = new ExecutionError();
327
+ executionError.message = protocol.message;
328
+ executionError.stack = protocol.trace;
329
+ return executionError;
330
+ };
@@ -0,0 +1,30 @@
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 { createModelSchema, primitive } from 'serializr';
18
+ import { SerializationFactory } from '@finos/legend-shared';
19
+
20
+ export class V1_ExecutionError {
21
+ message!: string;
22
+ trace!: string;
23
+
24
+ static readonly serialization = new SerializationFactory(
25
+ createModelSchema(V1_ExecutionError, {
26
+ message: primitive(),
27
+ trace: primitive(),
28
+ }),
29
+ );
30
+ }
@@ -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;
@@ -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
 
@@ -35,9 +35,7 @@ import type { V1_FileGenerationSpecification } from './fileGeneration/V1_FileGen
35
35
  import type { V1_GenerationSpecification } from './generationSpecification/V1_GenerationSpecification';
36
36
  import type { V1_Measure } from './domain/V1_Measure';
37
37
  import type { V1_SectionIndex } from './section/V1_SectionIndex';
38
- import type { V1_ServiceStore } from './store/relational/V1_ServiceStore';
39
38
 
40
- /* @MARKER: NEW ELEMENT TYPE SUPPORT --- consider adding new element type handler here whenever support for a new element type is added to the app */
41
39
  export interface V1_PackageableElementVisitor<T> {
42
40
  visit_PackageableElement(element: V1_PackageableElement): T;
43
41
  visit_SectionIndex(element: V1_SectionIndex): T;
@@ -53,7 +51,6 @@ export interface V1_PackageableElementVisitor<T> {
53
51
 
54
52
  visit_FlatData(element: V1_FlatData): T;
55
53
  visit_Database(element: V1_Database): T;
56
- visit_ServiceStore(element: V1_ServiceStore): T;
57
54
  visit_Service(element: V1_Service): T;
58
55
  visit_GenerationSpecification(element: V1_GenerationSpecification): T;
59
56
  visit_FileGeneration(element: V1_FileGenerationSpecification): T;
@@ -32,7 +32,6 @@ export enum V1_ConnectionType {
32
32
  RELATIONAL_DATABASE_CONNECTION = 'RelationalDatabaseConnection',
33
33
  }
34
34
 
35
- /* @MARKER: NEW CONNECTION TYPE SUPPORT --- consider adding connection type handler here whenever support for a new one is added to the app */
36
35
  export interface V1_ConnectionVisitor<T> {
37
36
  visit_Connection(connection: V1_Connection): T;
38
37
  visit_ConnectionPointer(connection: V1_ConnectionPointer): T;
@@ -25,8 +25,8 @@ 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> {
29
+ visit_ClassMapping(classMapping: V1_ClassMapping): T;
30
30
  visit_OperationClassMapping(classMapping: V1_OperationClassMapping): T;
31
31
  visit_PureInstanceClassMapping(classMapping: V1_PureInstanceClassMapping): T;
32
32
  visit_RootFlatDataClassMapping(classMapping: V1_RootFlatDataClassMapping): T;
@@ -174,7 +174,8 @@ export const V1_transformTableAliasToTablePointer = (
174
174
  tablePtr.database = options?.TEMPORARY__resolveToFullPath
175
175
  ? tableAlias.relation.ownerReference.value.path
176
176
  : tableAlias.relation.ownerReference.valueForSerialization ?? '';
177
- /* @MARKER: GRAMMAR ROUNDTRIP --- omit this information during protocol transformation as it can be interpreted while building the graph */
177
+ // FIXME: Sometimes, we interpret this, so to maintain roundtrip stability, we need to handle this differrently
178
+ // See https://github.com/finos/legend-studio/issues/295
178
179
  tablePtr.mainTableDb = tablePtr.database;
179
180
  tablePtr.schema = tableAlias.isSelfJoinTarget
180
181
  ? SELF_JOIN_SCHEMA_NAME
@@ -188,7 +189,8 @@ export const V1_transformTableAliasToTablePointer = (
188
189
  export const V1_transformTableToTablePointer = (table: Table): V1_TablePtr => {
189
190
  const tablePtr = new V1_TablePtr();
190
191
  tablePtr.database = table.schema.owner.path;
191
- /* @MARKER: GRAMMAR ROUNDTRIP --- omit this information during protocol transformation as it can be interpreted while building the graph */
192
+ // FIXME: Sometimes, we interpret this, so to maintain roundtrip stability, we need to handle this differrently
193
+ // See https://github.com/finos/legend-studio/issues/295
192
194
  tablePtr.mainTableDb = tablePtr.database;
193
195
  tablePtr.schema = table.schema.name;
194
196
  tablePtr.table = table.name;
@@ -139,6 +139,9 @@ import { V1_RelationalInputData } from '../../../model/packageableElements/store
139
139
  import { SOURCE_INFORMATION_KEY } from '../../../../../../../MetaModelConst';
140
140
  import type { V1_GraphTransformerContext } from './V1_GraphTransformerContext';
141
141
  import { toJS } from 'mobx';
142
+ import type { DSLMapping_PureProtocolProcessorPlugin_Extension } from '../../../../DSLMapping_PureProtocolProcessorPlugin_Extension';
143
+ import type { InstanceSetImplementation } from '../../../../../../metamodels/pure/packageableElements/mapping/InstanceSetImplementation';
144
+ import type { SubstituteStore } from '../../../../../../metamodels/pure/packageableElements/mapping/SubstituteStore';
142
145
 
143
146
  export const V1_transformPropertyReference = (
144
147
  element: PropertyReference,
@@ -306,7 +309,7 @@ const transformMappingTest = (
306
309
  return test;
307
310
  };
308
311
 
309
- // Include V1_Mapping
312
+ // Include Mapping
310
313
 
311
314
  const transformMappingInclude = (
312
315
  element: MappingInclude,
@@ -314,15 +317,17 @@ const transformMappingInclude = (
314
317
  const mappingInclude = new V1_MappingInclude();
315
318
  mappingInclude.includedMapping = element.included.valueForSerialization ?? '';
316
319
  mappingInclude.sourceDatabasePath = element.storeSubstitutions.length
317
- ? element.storeSubstitutions[0].original.valueForSerialization ?? ''
320
+ ? (element.storeSubstitutions[0] as SubstituteStore).original
321
+ .valueForSerialization ?? ''
318
322
  : undefined;
319
323
  mappingInclude.targetDatabasePath = element.storeSubstitutions.length
320
- ? element.storeSubstitutions[0].substitute.valueForSerialization ?? ''
324
+ ? (element.storeSubstitutions[0] as SubstituteStore).substitute
325
+ .valueForSerialization ?? ''
321
326
  : undefined;
322
327
  return mappingInclude;
323
328
  };
324
329
 
325
- // Class V1_Mapping
330
+ // Class Mapping
326
331
 
327
332
  const transformOptionalPropertyMappingTransformer = (
328
333
  value: EnumerationMapping | undefined,
@@ -1008,6 +1013,27 @@ export class V1_SetImplementationTransformer
1008
1013
  this.context = context;
1009
1014
  }
1010
1015
 
1016
+ visit_SetImplementation(
1017
+ setImplementation: InstanceSetImplementation,
1018
+ ): V1_ClassMapping | undefined {
1019
+ const extraClassMappingTransformers = this.context.plugins.flatMap(
1020
+ (plugin) =>
1021
+ (
1022
+ plugin as DSLMapping_PureProtocolProcessorPlugin_Extension
1023
+ ).V1_getExtraClassMappingTransformers?.() ?? [],
1024
+ );
1025
+ for (const transformer of extraClassMappingTransformers) {
1026
+ const classMapping = transformer(setImplementation, this.context);
1027
+ if (classMapping) {
1028
+ return classMapping;
1029
+ }
1030
+ }
1031
+ throw new UnsupportedOperationError(
1032
+ `Can't transform class mapping: no compatible transformer available from plugins`,
1033
+ setImplementation,
1034
+ );
1035
+ }
1036
+
1011
1037
  visit_OperationSetImplementation(
1012
1038
  setImplementation: OperationSetImplementation,
1013
1039
  ): V1_ClassMapping | undefined {
@@ -27,7 +27,6 @@ import type { Association } from '../../../../../../metamodels/pure/packageableE
27
27
  import type { ConcreteFunctionDefinition } from '../../../../../../metamodels/pure/packageableElements/domain/ConcreteFunctionDefinition';
28
28
  import type { FlatData } from '../../../../../../metamodels/pure/packageableElements/store/flatData/model/FlatData';
29
29
  import type { Database } from '../../../../../../metamodels/pure/packageableElements/store/relational/model/Database';
30
- import type { ServiceStore } from '../../../../../../metamodels/pure/packageableElements/store/relational/model/ServiceStore';
31
30
  import type { Mapping } from '../../../../../../metamodels/pure/packageableElements/mapping/Mapping';
32
31
  import type { Service } from '../../../../../../metamodels/pure/packageableElements/service/Service';
33
32
  import type { PackageableRuntime } from '../../../../../../metamodels/pure/packageableElements/runtime/PackageableRuntime';
@@ -52,7 +51,6 @@ import {
52
51
  V1_transformGenerationSpecification,
53
52
  } from './V1_GenerationSpecificationTransformer';
54
53
  import { V1_transformFlatData } from './V1_FlatDataTransformer';
55
- import { V1_transformServiceStore } from './V1_ServiceStoreTransformer';
56
54
  import { V1_transformDatabase } from './V1_DatabaseTransformer';
57
55
  import { V1_transformMapping } from './V1_MappingTransformer';
58
56
  import { V1_transformService } from './V1_ServiceTransformer';
@@ -143,10 +141,6 @@ export class V1_PackageableElementTransformer
143
141
  return V1_transformDatabase(element, this.context);
144
142
  }
145
143
 
146
- visit_ServiceStore(element: ServiceStore): V1_PackageableElement {
147
- return V1_transformServiceStore(element);
148
- }
149
-
150
144
  visit_Mapping(element: Mapping): V1_PackageableElement {
151
145
  return V1_transformMapping(element, this.context);
152
146
  }
@@ -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,
@@ -252,7 +252,7 @@ class V1_ValueSpecificationTransformer
252
252
  valueSpecification: EnumValueInstanceValue,
253
253
  ): V1_ValueSpecification {
254
254
  const _enumValue = new V1_EnumValue();
255
- const _enum = valueSpecification.values[0].value;
255
+ const _enum = guaranteeNonNullable(valueSpecification.values[0]).value;
256
256
  _enumValue.value = _enum.name;
257
257
  _enumValue.fullPath = _enum.owner.path;
258
258
  return _enumValue;