@finos/legend-graph 32.6.1 → 32.6.3

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 (199) hide show
  1. package/lib/graph/BasicModel.d.ts.map +1 -1
  2. package/lib/graph/BasicModel.js +1 -0
  3. package/lib/graph/BasicModel.js.map +1 -1
  4. package/lib/graph/Core_HashUtils.d.ts +7 -0
  5. package/lib/graph/Core_HashUtils.d.ts.map +1 -1
  6. package/lib/graph/Core_HashUtils.js +7 -0
  7. package/lib/graph/Core_HashUtils.js.map +1 -1
  8. package/lib/graph/MetaModelConst.d.ts +9 -1
  9. package/lib/graph/MetaModelConst.d.ts.map +1 -1
  10. package/lib/graph/MetaModelConst.js +9 -0
  11. package/lib/graph/MetaModelConst.js.map +1 -1
  12. package/lib/graph/metamodel/pure/data/DataResolver.d.ts +32 -0
  13. package/lib/graph/metamodel/pure/data/DataResolver.d.ts.map +1 -0
  14. package/lib/graph/metamodel/pure/data/DataResolver.js +40 -0
  15. package/lib/graph/metamodel/pure/data/DataResolver.js.map +1 -0
  16. package/lib/graph/metamodel/pure/data/EmbeddedData.d.ts +1 -1
  17. package/lib/graph/metamodel/pure/data/EmbeddedData.d.ts.map +1 -1
  18. package/lib/graph/metamodel/pure/data/EmbeddedData.js +2 -2
  19. package/lib/graph/metamodel/pure/data/EmbeddedData.js.map +1 -1
  20. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts +6 -1
  21. package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts.map +1 -1
  22. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js +3 -0
  23. package/lib/graph/metamodel/pure/dataProduct/DataProduct.js.map +1 -1
  24. package/lib/graph/metamodel/pure/dataProduct/test/DataProductAccessPointTest.d.ts +22 -0
  25. package/lib/graph/metamodel/pure/dataProduct/test/DataProductAccessPointTest.d.ts.map +1 -0
  26. package/lib/graph/metamodel/pure/dataProduct/test/DataProductAccessPointTest.js +31 -0
  27. package/lib/graph/metamodel/pure/dataProduct/test/DataProductAccessPointTest.js.map +1 -0
  28. package/lib/graph/metamodel/pure/dataProduct/test/DataProductTestSuite.d.ts +23 -0
  29. package/lib/graph/metamodel/pure/dataProduct/test/DataProductTestSuite.d.ts.map +1 -0
  30. package/lib/graph/metamodel/pure/dataProduct/test/DataProductTestSuite.js +31 -0
  31. package/lib/graph/metamodel/pure/dataProduct/test/DataProductTestSuite.js.map +1 -0
  32. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.d.ts +9 -2
  33. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.d.ts.map +1 -1
  34. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.js +18 -1
  35. package/lib/graph/metamodel/pure/packageableElements/relation/Accessor.js.map +1 -1
  36. package/lib/graph/metamodel/pure/test/assertion/EqualToRelation.d.ts +23 -0
  37. package/lib/graph/metamodel/pure/test/assertion/EqualToRelation.d.ts.map +1 -0
  38. package/lib/graph/metamodel/pure/test/assertion/EqualToRelation.js +32 -0
  39. package/lib/graph/metamodel/pure/test/assertion/EqualToRelation.js.map +1 -0
  40. package/lib/graph/metamodel/pure/test/assertion/TestAssertion.d.ts +2 -0
  41. package/lib/graph/metamodel/pure/test/assertion/TestAssertion.d.ts.map +1 -1
  42. package/lib/graph/metamodel/pure/test/assertion/TestAssertion.js.map +1 -1
  43. package/lib/graph/metamodel/pure/test/assertion/status/EqualToRelationAssertFail.d.ts +21 -0
  44. package/lib/graph/metamodel/pure/test/assertion/status/EqualToRelationAssertFail.d.ts.map +1 -0
  45. package/lib/graph/metamodel/pure/test/assertion/status/EqualToRelationAssertFail.js +21 -0
  46. package/lib/graph/metamodel/pure/test/assertion/status/EqualToRelationAssertFail.js.map +1 -0
  47. package/lib/graph-manager/AbstractPureGraphManager.d.ts +8 -2
  48. package/lib/graph-manager/AbstractPureGraphManager.d.ts.map +1 -1
  49. package/lib/graph-manager/AbstractPureGraphManager.js.map +1 -1
  50. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts +7 -2
  51. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts.map +1 -1
  52. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js +38 -4
  53. package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js.map +1 -1
  54. package/lib/graph-manager/action/changeDetection/PackageableElementObserver.js +1 -1
  55. package/lib/graph-manager/action/changeDetection/PackageableElementObserver.js.map +1 -1
  56. package/lib/graph-manager/action/changeDetection/Testable_ObserverHelper.d.ts +2 -0
  57. package/lib/graph-manager/action/changeDetection/Testable_ObserverHelper.d.ts.map +1 -1
  58. package/lib/graph-manager/action/changeDetection/Testable_ObserverHelper.js +15 -0
  59. package/lib/graph-manager/action/changeDetection/Testable_ObserverHelper.js.map +1 -1
  60. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts +8 -2
  61. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  62. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +58 -5
  63. package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  64. package/lib/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.d.ts +23 -1
  65. package/lib/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.d.ts.map +1 -1
  66. package/lib/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.js +163 -5
  67. package/lib/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.js.map +1 -1
  68. package/lib/graph-manager/protocol/pure/v1/model/data/V1_DataResolver.d.ts +31 -0
  69. package/lib/graph-manager/protocol/pure/v1/model/data/V1_DataResolver.d.ts.map +1 -0
  70. package/lib/graph-manager/protocol/pure/v1/model/data/V1_DataResolver.js +40 -0
  71. package/lib/graph-manager/protocol/pure/v1/model/data/V1_DataResolver.js.map +1 -0
  72. package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.d.ts +1 -1
  73. package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.d.ts.map +1 -1
  74. package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.js +2 -2
  75. package/lib/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.js.map +1 -1
  76. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts +2 -0
  77. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts.map +1 -1
  78. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js +2 -0
  79. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js.map +1 -1
  80. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/test/V1_AccessPointTest.d.ts +22 -0
  81. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/test/V1_AccessPointTest.d.ts.map +1 -0
  82. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/test/V1_AccessPointTest.js +31 -0
  83. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/test/V1_AccessPointTest.js.map +1 -0
  84. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/test/V1_DataProductTestSuite.d.ts +23 -0
  85. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/test/V1_DataProductTestSuite.d.ts.map +1 -0
  86. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/test/V1_DataProductTestSuite.js +31 -0
  87. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/test/V1_DataProductTestSuite.js.map +1 -0
  88. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.d.ts +19 -0
  89. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.d.ts.map +1 -1
  90. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.js +20 -0
  91. package/lib/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.js.map +1 -1
  92. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/V1_EqualToRelation.d.ts +23 -0
  93. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/V1_EqualToRelation.d.ts.map +1 -0
  94. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/V1_EqualToRelation.js +32 -0
  95. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/V1_EqualToRelation.js.map +1 -0
  96. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/V1_TestAssertion.d.ts +2 -0
  97. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/V1_TestAssertion.d.ts.map +1 -1
  98. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/V1_TestAssertion.js.map +1 -1
  99. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/status/V1_EqualToRelationAssertFail.d.ts +23 -0
  100. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/status/V1_EqualToRelationAssertFail.d.ts.map +1 -0
  101. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/status/V1_EqualToRelationAssertFail.js +32 -0
  102. package/lib/graph-manager/protocol/pure/v1/model/test/assertion/status/V1_EqualToRelationAssertFail.js.map +1 -0
  103. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.d.ts +6 -0
  104. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.d.ts.map +1 -1
  105. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js +31 -0
  106. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js.map +1 -1
  107. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataResolverTransformer.d.ts +20 -0
  108. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataResolverTransformer.d.ts.map +1 -0
  109. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataResolverTransformer.js +35 -0
  110. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataResolverTransformer.js.map +1 -0
  111. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_TestTransformer.d.ts.map +1 -1
  112. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_TestTransformer.js +20 -0
  113. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_TestTransformer.js.map +1 -1
  114. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  115. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +4 -1
  116. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  117. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts +3 -0
  118. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts.map +1 -1
  119. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js +29 -0
  120. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js.map +1 -1
  121. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataResolverBuilderHelper.d.ts +20 -0
  122. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataResolverBuilderHelper.d.ts.map +1 -0
  123. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataResolverBuilderHelper.js +34 -0
  124. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataResolverBuilderHelper.js.map +1 -0
  125. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.d.ts.map +1 -1
  126. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.js +21 -1
  127. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.js.map +1 -1
  128. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestResultBuilderHelper.d.ts.map +1 -1
  129. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestResultBuilderHelper.js +23 -1
  130. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestResultBuilderHelper.js.map +1 -1
  131. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -1
  132. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js +17 -3
  133. package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js.map +1 -1
  134. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.js +1 -1
  135. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.js.map +1 -1
  136. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts.map +1 -1
  137. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js +25 -3
  138. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js.map +1 -1
  139. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataResolverSerializationHelper.d.ts +21 -0
  140. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataResolverSerializationHelper.d.ts.map +1 -0
  141. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataResolverSerializationHelper.js +59 -0
  142. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataResolverSerializationHelper.js.map +1 -0
  143. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.d.ts +3 -1
  144. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.d.ts.map +1 -1
  145. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.js +36 -1
  146. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.js.map +1 -1
  147. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.d.ts +4 -1
  148. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.d.ts.map +1 -1
  149. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js +27 -1
  150. package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js.map +1 -1
  151. package/lib/index.d.ts +15 -5
  152. package/lib/index.d.ts.map +1 -1
  153. package/lib/index.js +15 -5
  154. package/lib/index.js.map +1 -1
  155. package/lib/package.json +1 -1
  156. package/package.json +3 -3
  157. package/src/graph/BasicModel.ts +1 -0
  158. package/src/graph/Core_HashUtils.ts +7 -0
  159. package/src/graph/MetaModelConst.ts +10 -0
  160. package/src/graph/metamodel/pure/data/DataResolver.ts +49 -0
  161. package/src/graph/metamodel/pure/data/EmbeddedData.ts +2 -2
  162. package/src/graph/metamodel/pure/dataProduct/DataProduct.ts +7 -1
  163. package/src/graph/metamodel/pure/dataProduct/test/DataProductAccessPointTest.ts +33 -0
  164. package/src/graph/metamodel/pure/dataProduct/test/DataProductTestSuite.ts +34 -0
  165. package/src/graph/metamodel/pure/packageableElements/relation/Accessor.ts +21 -3
  166. package/src/graph/metamodel/pure/test/assertion/EqualToRelation.ts +36 -0
  167. package/src/graph/metamodel/pure/test/assertion/TestAssertion.ts +2 -0
  168. package/src/graph/metamodel/pure/test/assertion/status/EqualToRelationAssertFail.ts +22 -0
  169. package/src/graph-manager/AbstractPureGraphManager.ts +29 -3
  170. package/src/graph-manager/action/changeDetection/DataProductObserveHelper.ts +58 -4
  171. package/src/graph-manager/action/changeDetection/PackageableElementObserver.ts +1 -1
  172. package/src/graph-manager/action/changeDetection/Testable_ObserverHelper.ts +17 -0
  173. package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +104 -5
  174. package/src/graph-manager/protocol/pure/v1/helpers/V1_AccessorHelper.ts +352 -5
  175. package/src/graph-manager/protocol/pure/v1/model/data/V1_DataResolver.ts +51 -0
  176. package/src/graph-manager/protocol/pure/v1/model/data/V1_EmbeddedData.ts +2 -2
  177. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.ts +3 -0
  178. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/test/V1_AccessPointTest.ts +33 -0
  179. package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/test/V1_DataProductTestSuite.ts +34 -0
  180. package/src/graph-manager/protocol/pure/v1/model/packageableElements/ingest/V1_IngestDefinition.ts +24 -0
  181. package/src/graph-manager/protocol/pure/v1/model/test/assertion/V1_EqualToRelation.ts +39 -0
  182. package/src/graph-manager/protocol/pure/v1/model/test/assertion/V1_TestAssertion.ts +2 -0
  183. package/src/graph-manager/protocol/pure/v1/model/test/assertion/status/V1_EqualToRelationAssertFail.ts +37 -0
  184. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.ts +47 -0
  185. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataResolverTransformer.ts +55 -0
  186. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_TestTransformer.ts +25 -0
  187. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +6 -0
  188. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.ts +46 -0
  189. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataResolverBuilderHelper.ts +54 -0
  190. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestBuilderHelper.ts +28 -1
  191. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_TestResultBuilderHelper.ts +40 -1
  192. package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.ts +48 -4
  193. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.ts +1 -1
  194. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.ts +64 -8
  195. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataResolverSerializationHelper.ts +97 -0
  196. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_IngestSerializationHelper.ts +64 -0
  197. package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.ts +35 -1
  198. package/src/index.ts +26 -1
  199. package/tsconfig.json +13 -0
@@ -0,0 +1,33 @@
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 { hashArray, type Hashable } from '@finos/legend-shared';
18
+ import { V1_AtomicTest } from '../../../test/V1_AtomicTest.js';
19
+ import { CORE_HASH_STRUCTURE } from '../../../../../../../../graph/Core_HashUtils.js';
20
+
21
+ export class V1_AccessPointTest extends V1_AtomicTest implements Hashable {
22
+ accessPointId!: string;
23
+
24
+ get hashCode(): string {
25
+ return hashArray([
26
+ CORE_HASH_STRUCTURE.DATA_PRODUCT_ACCESS_POINT_TEST,
27
+ this.id,
28
+ this.doc ?? '',
29
+ this.accessPointId,
30
+ hashArray(this.assertions),
31
+ ]);
32
+ }
33
+ }
@@ -0,0 +1,34 @@
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 { hashArray, type Hashable } from '@finos/legend-shared';
18
+ import { CORE_HASH_STRUCTURE } from '../../../../../../../../graph/Core_HashUtils.js';
19
+ import { V1_TestSuite } from '../../../test/V1_TestSuite.js';
20
+ import type { V1_DataResolver } from '../../../data/V1_DataResolver.js';
21
+
22
+ export class V1_DataProductTestSuite extends V1_TestSuite implements Hashable {
23
+ testData: V1_DataResolver[] | undefined;
24
+
25
+ get hashCode(): string {
26
+ return hashArray([
27
+ CORE_HASH_STRUCTURE.DATA_PRODUCT_TEST_SUITE,
28
+ this.id,
29
+ this.doc ?? '',
30
+ hashArray(this.testData ?? []),
31
+ hashArray(this.tests),
32
+ ]);
33
+ }
34
+ }
@@ -40,12 +40,36 @@ export class V1_IngestDatasetSource {
40
40
  schema!: V1_IngestDatasetSchema;
41
41
  }
42
42
 
43
+ export enum V1_WriteModeType {
44
+ APPEND_ONLY = 'append_only',
45
+ BATCH_MILESTONED = 'batch_milestoned',
46
+ BATCH_MILESTONED_BUSINESS_TEMPORAL = 'batch_milestoned_business_temporal',
47
+ }
48
+
49
+ export class V1_WriteMode {
50
+ _type!: V1_WriteModeType;
51
+ }
52
+
53
+ export class V1_AppendOnly extends V1_WriteMode {
54
+ override _type = V1_WriteModeType.APPEND_ONLY;
55
+ }
56
+
57
+ export class V1_BatchMilestoned extends V1_WriteMode {
58
+ override _type = V1_WriteModeType.BATCH_MILESTONED;
59
+ }
60
+
61
+ export class V1_BatchMilestonedBusinessTemporal extends V1_WriteMode {
62
+ override _type = V1_WriteModeType.BATCH_MILESTONED_BUSINESS_TEMPORAL;
63
+ }
64
+
43
65
  export class V1_IngestDataset {
44
66
  name!: string;
45
67
  primaryKey: string[] = [];
46
68
  source!: V1_IngestDatasetSource;
69
+ writeMode?: V1_WriteMode;
47
70
  }
48
71
 
49
72
  export class V1_IngestDefinitionContent {
50
73
  datasets?: V1_IngestDataset[];
74
+ writeMode?: V1_WriteMode;
51
75
  }
@@ -0,0 +1,39 @@
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 { hashArray } from '@finos/legend-shared';
18
+ import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
19
+ import type { V1_RelationElement } from '../../data/V1_EmbeddedData.js';
20
+ import {
21
+ type V1_TestAssertionVisitor,
22
+ V1_TestAssertion,
23
+ } from './V1_TestAssertion.js';
24
+
25
+ export class V1_EqualToRelation extends V1_TestAssertion {
26
+ expected!: V1_RelationElement;
27
+
28
+ get hashCode(): string {
29
+ return hashArray([
30
+ CORE_HASH_STRUCTURE.EQUAL_TO_RELATION,
31
+ this.id,
32
+ this.expected,
33
+ ]);
34
+ }
35
+
36
+ accept_TestAssertionVisitor<T>(visitor: V1_TestAssertionVisitor<T>): T {
37
+ return visitor.visit_EqualToRelation(this);
38
+ }
39
+ }
@@ -17,6 +17,7 @@
17
17
  import type { Hashable } from '@finos/legend-shared';
18
18
  import type { V1_EqualTo } from './V1_EqualTo.js';
19
19
  import type { V1_EqualToJson } from './V1_EqualToJson.js';
20
+ import type { V1_EqualToRelation } from './V1_EqualToRelation.js';
20
21
  import type { V1_EqualToTDS } from './V1_EqualToTDS.js';
21
22
 
22
23
  export interface V1_TestAssertionVisitor<T> {
@@ -24,6 +25,7 @@ export interface V1_TestAssertionVisitor<T> {
24
25
  visit_EqualToTDS(testAssertion: V1_EqualToTDS): T;
25
26
  visit_EqualTo(testAssertion: V1_EqualTo): T;
26
27
  visit_EqualToJSON(testAssertion: V1_EqualToJson): T;
28
+ visit_EqualToRelation(testAssertion: V1_EqualToRelation): T;
27
29
  }
28
30
 
29
31
  export abstract class V1_TestAssertion implements Hashable {
@@ -0,0 +1,37 @@
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 { hashArray, type Hashable } from '@finos/legend-shared';
18
+ import { CORE_HASH_STRUCTURE } from '../../../../../../../../graph/Core_HashUtils.js';
19
+ import { V1_AssertFail } from './V1_AssertFail.js';
20
+
21
+ export class V1_EqualToRelationAssertFail
22
+ extends V1_AssertFail
23
+ implements Hashable
24
+ {
25
+ expected!: string;
26
+ actual!: string;
27
+
28
+ override get hashCode(): string {
29
+ return hashArray([
30
+ CORE_HASH_STRUCTURE.EQUAL_TO_RELATION_ASSERT_FAIL,
31
+ this.id,
32
+ this.message,
33
+ this.expected,
34
+ this.actual,
35
+ ]);
36
+ }
37
+ }
@@ -72,6 +72,12 @@ import { V1_transformEmbeddedData } from './V1_DataElementTransformer.js';
72
72
  import { ConcreteFunctionDefinition } from '../../../../../../../graph/metamodel/pure/packageableElements/function/ConcreteFunctionDefinition.js';
73
73
  import { generateFunctionPrettyName } from '../../../../../../../graph/helpers/PureLanguageHelper.js';
74
74
  import { V1_AppDirNode } from '../../../lakehouse/entitlements/V1_CoreEntitlements.js';
75
+ import { DataProductAccessPointTest } from '../../../../../../../graph/metamodel/pure/dataProduct/test/DataProductAccessPointTest.js';
76
+ import type { DataProductTestSuite } from '../../../../../../../graph/metamodel/pure/dataProduct/test/DataProductTestSuite.js';
77
+ import { V1_AccessPointTest } from '../../../model/packageableElements/dataProduct/test/V1_AccessPointTest.js';
78
+ import { V1_DataProductTestSuite } from '../../../model/packageableElements/dataProduct/test/V1_DataProductTestSuite.js';
79
+ import { V1_transformDataResolver } from './V1_DataResolverTransformer.js';
80
+ import { V1_transformTestAssertion } from './V1_TestTransformer.js';
75
81
 
76
82
  const transformAccessPoint = (
77
83
  ap: AccessPoint,
@@ -131,6 +137,42 @@ const transformDataProductIcon = (
131
137
  );
132
138
  };
133
139
 
140
+ export const V1_transformDataProductAccessPointTest = (
141
+ element: DataProductAccessPointTest,
142
+ ): V1_AccessPointTest => {
143
+ const accessPointTest = new V1_AccessPointTest();
144
+ accessPointTest.id = element.id;
145
+ accessPointTest.doc = element.doc;
146
+ accessPointTest.accessPointId = element.accessPointId;
147
+ accessPointTest.assertions = element.assertions.map(
148
+ V1_transformTestAssertion,
149
+ );
150
+ return accessPointTest;
151
+ };
152
+
153
+ export const V1_transformDataProductTestSuite = (
154
+ element: DataProductTestSuite,
155
+ context: V1_GraphTransformerContext,
156
+ ): V1_DataProductTestSuite => {
157
+ const testSuite = new V1_DataProductTestSuite();
158
+ testSuite.id = element.id;
159
+ testSuite.doc = element.doc;
160
+ if (element.testData?.length) {
161
+ testSuite.testData = element.testData.map((dataResolver) =>
162
+ V1_transformDataResolver(dataResolver, context),
163
+ );
164
+ }
165
+ testSuite.tests = element.tests.map((test) => {
166
+ if (test instanceof DataProductAccessPointTest) {
167
+ return V1_transformDataProductAccessPointTest(test);
168
+ }
169
+ throw new UnsupportedOperationError(
170
+ 'Unsupported data product test to transform',
171
+ );
172
+ });
173
+ return testSuite;
174
+ };
175
+
134
176
  export const V1_transformDataProduct = (
135
177
  element: DataProduct,
136
178
  context: V1_GraphTransformerContext,
@@ -345,6 +387,11 @@ export const V1_transformDataProduct = (
345
387
  product.taggedValues = element.taggedValues.map((taggedValue) =>
346
388
  V1_transformTaggedValue(taggedValue),
347
389
  );
390
+ if (element.tests.length) {
391
+ product.testSuites = element.tests.map((testSuite) =>
392
+ V1_transformDataProductTestSuite(testSuite, context),
393
+ );
394
+ }
348
395
 
349
396
  if (element.owner instanceof AppDirOwner) {
350
397
  const v1Owner = new V1_AppDirOwner();
@@ -0,0 +1,55 @@
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 { UnsupportedOperationError } from '@finos/legend-shared';
18
+ import {
19
+ type DataResolver,
20
+ BaseDataResolver,
21
+ ReferenceDataResolver,
22
+ } from '../../../../../../../graph/metamodel/pure/data/DataResolver.js';
23
+ import {
24
+ V1_BaseDataResolver,
25
+ V1_ReferenceDataResolver,
26
+ type V1_DataResolver,
27
+ } from '../../../model/data/V1_DataResolver.js';
28
+ import { V1_transformElementReferencePointer } from './V1_CoreTransformerHelper.js';
29
+ import { V1_transformEmbeddedData } from './V1_DataElementTransformer.js';
30
+ import type { V1_GraphTransformerContext } from './V1_GraphTransformerContext.js';
31
+
32
+ export const V1_transformDataResolver = (
33
+ dataResolver: DataResolver,
34
+ context: V1_GraphTransformerContext,
35
+ ): V1_DataResolver => {
36
+ if (dataResolver instanceof BaseDataResolver) {
37
+ const protocol = new V1_BaseDataResolver();
38
+ protocol.elementPointer = V1_transformElementReferencePointer(
39
+ undefined,
40
+ dataResolver.element,
41
+ );
42
+ protocol.data = V1_transformEmbeddedData(dataResolver.data, context);
43
+ return protocol;
44
+ } else if (dataResolver instanceof ReferenceDataResolver) {
45
+ const protocol = new V1_ReferenceDataResolver();
46
+ protocol.elementPointer = V1_transformElementReferencePointer(
47
+ undefined,
48
+ dataResolver.element,
49
+ );
50
+ return protocol;
51
+ }
52
+ throw new UnsupportedOperationError(
53
+ `Unable to transform data resolver of type '${dataResolver.constructor.name}'`,
54
+ );
55
+ };
@@ -17,8 +17,10 @@
17
17
  import { UnsupportedOperationError } from '@finos/legend-shared';
18
18
  import { V1_EqualTo } from '../../../model/test/assertion/V1_EqualTo.js';
19
19
  import { V1_EqualToJson } from '../../../model/test/assertion/V1_EqualToJson.js';
20
+ import { V1_EqualToRelation } from '../../../model/test/assertion/V1_EqualToRelation.js';
20
21
  import { EqualTo } from '../../../../../../../graph/metamodel/pure/test/assertion/EqualTo.js';
21
22
  import { EqualToJson } from '../../../../../../../graph/metamodel/pure/test/assertion/EqualToJson.js';
23
+ import { EqualToRelation } from '../../../../../../../graph/metamodel/pure/test/assertion/EqualToRelation.js';
22
24
  import { V1_transformExternalFormatData } from './V1_DataElementTransformer.js';
23
25
  import type { V1_AtomicTest } from '../../../model/test/V1_AtomicTest.js';
24
26
  import { ServiceTest } from '../../../../../../../graph/metamodel/pure/packageableElements/service/ServiceTest.js';
@@ -37,6 +39,10 @@ import type {
37
39
  } from '../../../../../../../graph/metamodel/pure/test/Test.js';
38
40
  import { EqualToTDS } from '../../../../../../../graph/metamodel/pure/test/assertion/EqualToTDS.js';
39
41
  import { V1_EqualToTDS } from '../../../model/test/assertion/V1_EqualToTDS.js';
42
+ import {
43
+ V1_RelationElement,
44
+ V1_RelationRowTestData,
45
+ } from '../../../model/data/V1_EmbeddedData.js';
40
46
  import type { Testable_PureProtocolProcessorPlugin_Extension } from '../../../../extensions/Testable_PureProtocolProcessorPlugin_Extension.js';
41
47
  import {
42
48
  V1_transformMappingTest,
@@ -66,6 +72,23 @@ const transformEqualToTDS = (element: EqualToTDS): V1_EqualToTDS => {
66
72
  return equalToTDS;
67
73
  };
68
74
 
75
+ const transformEqualToRelation = (
76
+ element: EqualToRelation,
77
+ ): V1_EqualToRelation => {
78
+ const v1 = new V1_EqualToRelation();
79
+ v1.id = element.id;
80
+ const rel = new V1_RelationElement();
81
+ rel.columns = element.expected.columns;
82
+ rel.paths = element.expected.paths;
83
+ rel.rows = element.expected.rows.map((row) => {
84
+ const r = new V1_RelationRowTestData();
85
+ r.values = row.values;
86
+ return r;
87
+ });
88
+ v1.expected = rel;
89
+ return v1;
90
+ };
91
+
69
92
  export const V1_transformAtomicTest = (
70
93
  value: AtomicTest,
71
94
  context: V1_GraphTransformerContext,
@@ -103,6 +126,8 @@ export const V1_transformTestAssertion = (
103
126
  return transformEqualToJson(value);
104
127
  } else if (value instanceof EqualToTDS) {
105
128
  return transformEqualToTDS(value);
129
+ } else if (value instanceof EqualToRelation) {
130
+ return transformEqualToRelation(value);
106
131
  }
107
132
  throw new UnsupportedOperationError(`Can't transform test assertion`, value);
108
133
  };
@@ -143,6 +143,7 @@ import {
143
143
  V1_buildDataProductIcon,
144
144
  V1_buildDataProductLink,
145
145
  V1_buildDataProductOperationalMetadata,
146
+ V1_buildDataProductTestSuite,
146
147
  V1_buildNativeModelAccess,
147
148
  V1_buildDataProductOwner,
148
149
  } from './helpers/V1_DataProductBuilder.js';
@@ -798,6 +799,11 @@ export class V1_ElementSecondPassBuilder
798
799
  dataProduct.sampleValues = element.sampleValues?.map((data) =>
799
800
  V1_buildEmbeddedData(data, this.context),
800
801
  );
802
+ if (element.testSuites?.length) {
803
+ dataProduct.tests = element.testSuites.map((testSuite) =>
804
+ V1_buildDataProductTestSuite(testSuite, this.context),
805
+ );
806
+ }
801
807
  if (element.operationalMetadata) {
802
808
  dataProduct.operationalMetadata = V1_buildDataProductOperationalMetadata(
803
809
  element.operationalMetadata,
@@ -80,6 +80,13 @@ import { Class } from '../../../../../../../../graph/metamodel/pure/packageableE
80
80
  import { Enumeration } from '../../../../../../../../graph/metamodel/pure/packageableElements/domain/Enumeration.js';
81
81
  import { Association } from '../../../../../../../../graph/metamodel/pure/packageableElements/domain/Association.js';
82
82
  import { generateFunctionPrettyName } from '../../../../../../../../graph/helpers/PureLanguageHelper.js';
83
+ import { DataProductAccessPointTest } from '../../../../../../../../graph/metamodel/pure/dataProduct/test/DataProductAccessPointTest.js';
84
+ import { DataProductTestSuite } from '../../../../../../../../graph/metamodel/pure/dataProduct/test/DataProductTestSuite.js';
85
+ import { V1_AccessPointTest } from '../../../../model/packageableElements/dataProduct/test/V1_AccessPointTest.js';
86
+ import type { V1_DataProductTestSuite } from '../../../../model/packageableElements/dataProduct/test/V1_DataProductTestSuite.js';
87
+ import { V1_buildDataResolver } from './V1_DataResolverBuilderHelper.js';
88
+ import { V1_buildTestAssertion } from './V1_TestBuilderHelper.js';
89
+ import type { TestSuite } from '../../../../../../../../graph/metamodel/pure/test/Test.js';
83
90
 
84
91
  export const V1_buildDataProductLink = (
85
92
  link: V1_DataProductLink,
@@ -420,3 +427,42 @@ export const V1_buildDataProductOwner = (
420
427
  v1Owner,
421
428
  );
422
429
  };
430
+
431
+ const V1_buildDataProductAccessPointTest = (
432
+ element: V1_AccessPointTest,
433
+ parentSuite: TestSuite,
434
+ context: V1_GraphBuilderContext,
435
+ ): DataProductAccessPointTest => {
436
+ const accessPointTest = new DataProductAccessPointTest();
437
+ accessPointTest.id = element.id;
438
+ accessPointTest.__parent = parentSuite;
439
+ accessPointTest.doc = element.doc;
440
+ accessPointTest.accessPointId = element.accessPointId;
441
+ accessPointTest.assertions = element.assertions.map((assertion) =>
442
+ V1_buildTestAssertion(assertion, accessPointTest, context),
443
+ );
444
+ return accessPointTest;
445
+ };
446
+
447
+ export const V1_buildDataProductTestSuite = (
448
+ element: V1_DataProductTestSuite,
449
+ context: V1_GraphBuilderContext,
450
+ ): DataProductTestSuite => {
451
+ const testSuite = new DataProductTestSuite();
452
+ testSuite.id = element.id;
453
+ testSuite.doc = element.doc;
454
+ if (element.testData?.length) {
455
+ testSuite.testData = element.testData.map((dataResolver) =>
456
+ V1_buildDataResolver(dataResolver, context),
457
+ );
458
+ }
459
+ testSuite.tests = element.tests.map((test) => {
460
+ if (test instanceof V1_AccessPointTest) {
461
+ return V1_buildDataProductAccessPointTest(test, testSuite, context);
462
+ }
463
+ throw new UnsupportedOperationError(
464
+ 'Unable to build data product test: Unsupported data product test type',
465
+ );
466
+ });
467
+ return testSuite;
468
+ };
@@ -0,0 +1,54 @@
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 { UnsupportedOperationError } from '@finos/legend-shared';
18
+ import {
19
+ BaseDataResolver,
20
+ ReferenceDataResolver,
21
+ type DataResolver,
22
+ } from '../../../../../../../../graph/metamodel/pure/data/DataResolver.js';
23
+ import {
24
+ V1_BaseDataResolver,
25
+ V1_ReferenceDataResolver,
26
+ type V1_DataResolver,
27
+ } from '../../../../model/data/V1_DataResolver.js';
28
+ import type { V1_GraphBuilderContext } from '../V1_GraphBuilderContext.js';
29
+ import { V1_buildEmbeddedData } from './V1_DataElementBuilderHelper.js';
30
+
31
+ export const V1_buildDataResolver = (
32
+ protocol: V1_DataResolver,
33
+ context: V1_GraphBuilderContext,
34
+ ): DataResolver => {
35
+ if (protocol instanceof V1_BaseDataResolver) {
36
+ const resolver = new BaseDataResolver();
37
+ resolver.element = context.resolveElement(
38
+ protocol.elementPointer.path,
39
+ false,
40
+ );
41
+ resolver.data = V1_buildEmbeddedData(protocol.data, context);
42
+ return resolver;
43
+ } else if (protocol instanceof V1_ReferenceDataResolver) {
44
+ const resolver = new ReferenceDataResolver();
45
+ resolver.element = context.resolveElement(
46
+ protocol.elementPointer.path,
47
+ false,
48
+ );
49
+ return resolver;
50
+ }
51
+ throw new UnsupportedOperationError(
52
+ `Unable to build data resolver of type '${protocol.constructor.name}'`,
53
+ );
54
+ };
@@ -15,9 +15,14 @@
15
15
  */
16
16
 
17
17
  import { guaranteeType, UnsupportedOperationError } from '@finos/legend-shared';
18
- import { ExternalFormatData } from '../../../../../../../../graph/metamodel/pure/data/EmbeddedData.js';
18
+ import {
19
+ ExternalFormatData,
20
+ RelationElement,
21
+ RelationRowTestData,
22
+ } from '../../../../../../../../graph/metamodel/pure/data/EmbeddedData.js';
19
23
  import { EqualTo } from '../../../../../../../../graph/metamodel/pure/test/assertion/EqualTo.js';
20
24
  import { EqualToJson } from '../../../../../../../../graph/metamodel/pure/test/assertion/EqualToJson.js';
25
+ import { EqualToRelation } from '../../../../../../../../graph/metamodel/pure/test/assertion/EqualToRelation.js';
21
26
  import { EqualToTDS } from '../../../../../../../../graph/metamodel/pure/test/assertion/EqualToTDS.js';
22
27
  import type { TestAssertion } from '../../../../../../../../graph/metamodel/pure/test/assertion/TestAssertion.js';
23
28
  import type {
@@ -29,6 +34,7 @@ import { V1_MappingTestSuite } from '../../../../model/packageableElements/mappi
29
34
  import { V1_ServiceTestSuite } from '../../../../model/packageableElements/service/V1_ServiceTestSuite.js';
30
35
  import { V1_EqualTo } from '../../../../model/test/assertion/V1_EqualTo.js';
31
36
  import { V1_EqualToJson } from '../../../../model/test/assertion/V1_EqualToJson.js';
37
+ import { V1_EqualToRelation } from '../../../../model/test/assertion/V1_EqualToRelation.js';
32
38
  import { V1_EqualToTDS } from '../../../../model/test/assertion/V1_EqualToTDS.js';
33
39
  import type { V1_TestAssertion } from '../../../../model/test/assertion/V1_TestAssertion.js';
34
40
  import type { V1_TestSuite } from '../../../../model/test/V1_TestSuite.js';
@@ -80,6 +86,25 @@ const buildEqualToTDS = (
80
86
  return equalToTDS;
81
87
  };
82
88
 
89
+ const buildEqualToRelation = (
90
+ element: V1_EqualToRelation,
91
+ parentTest: AtomicTest | undefined,
92
+ ): EqualToRelation => {
93
+ const equalToRelation = new EqualToRelation();
94
+ equalToRelation.id = element.id;
95
+ equalToRelation.parentTest = parentTest;
96
+ const rel = new RelationElement();
97
+ rel.columns = element.expected.columns;
98
+ rel.paths = element.expected.paths;
99
+ rel.rows = element.expected.rows.map((row) => {
100
+ const r = new RelationRowTestData();
101
+ r.values = row.values;
102
+ return r;
103
+ });
104
+ equalToRelation.expected = rel;
105
+ return equalToRelation;
106
+ };
107
+
83
108
  export const V1_buildTestAssertion = (
84
109
  value: V1_TestAssertion,
85
110
  parentTest: AtomicTest | undefined,
@@ -91,6 +116,8 @@ export const V1_buildTestAssertion = (
91
116
  return V1_buildEqualToJson(value, parentTest, context);
92
117
  } else if (value instanceof V1_EqualToTDS) {
93
118
  return buildEqualToTDS(value, parentTest, context);
119
+ } else if (value instanceof V1_EqualToRelation) {
120
+ return buildEqualToRelation(value, parentTest);
94
121
  }
95
122
  throw new UnsupportedOperationError(`Can't build test assertion`, value);
96
123
  };
@@ -25,6 +25,7 @@ import { AssertFail } from '../../../../../../../../graph/metamodel/pure/test/as
25
25
  import type { AssertionStatus } from '../../../../../../../../graph/metamodel/pure/test/assertion/status/AssertionStatus.js';
26
26
  import { AssertPass } from '../../../../../../../../graph/metamodel/pure/test/assertion/status/AssertPass.js';
27
27
  import { EqualToJsonAssertFail } from '../../../../../../../../graph/metamodel/pure/test/assertion/status/EqualToJsonAssertFail.js';
28
+ import { EqualToRelationAssertFail } from '../../../../../../../../graph/metamodel/pure/test/assertion/status/EqualToRelationAssertFail.js';
28
29
  import {
29
30
  type TestResult,
30
31
  TestError,
@@ -40,6 +41,7 @@ import { V1_AssertFail } from '../../../../model/test/assertion/status/V1_Assert
40
41
  import type { V1_AssertionStatus } from '../../../../model/test/assertion/status/V1_AssertionStatus.js';
41
42
  import { V1_AssertPass } from '../../../../model/test/assertion/status/V1_AssertPass.js';
42
43
  import { V1_EqualToJsonAssertFail } from '../../../../model/test/assertion/status/V1_EqualToJsonAssertFail.js';
44
+ import { V1_EqualToRelationAssertFail } from '../../../../model/test/assertion/status/V1_EqualToRelationAssertFail.js';
43
45
  import {
44
46
  type V1_TestResult,
45
47
  V1_TestExecuted,
@@ -176,12 +178,49 @@ const buildEqualToJsonAssertFail = (
176
178
  );
177
179
  };
178
180
 
181
+ const buildEqualToRelationAssertFail = (
182
+ element: V1_EqualToRelationAssertFail,
183
+ atomicTest: AtomicTest,
184
+ plugins: PureProtocolProcessorPlugin[],
185
+ ): EqualToRelationAssertFail => {
186
+ let assertion = atomicTest.assertions.find((a) => a.id === element.id);
187
+ const extraAssertionBuilder = plugins.flatMap(
188
+ (plugin) =>
189
+ (
190
+ plugin as Testable_PureProtocolProcessorPlugin_Extension
191
+ ).V1_getExtraTestableAssertionBuilders?.() ?? [],
192
+ );
193
+
194
+ for (const builder of extraAssertionBuilder) {
195
+ const assertionBuilder = builder(atomicTest, element);
196
+ if (assertionBuilder) {
197
+ assertion = assertionBuilder;
198
+ }
199
+ }
200
+
201
+ if (assertion) {
202
+ const equalToRelationAssertFail = new EqualToRelationAssertFail(
203
+ assertion,
204
+ element.message,
205
+ );
206
+ equalToRelationAssertFail.expected = element.expected;
207
+ equalToRelationAssertFail.actual = element.actual;
208
+ return equalToRelationAssertFail;
209
+ }
210
+ throw new UnsupportedOperationError(
211
+ `Can't build EqualToRelationAssertFail: no compatible builder available from plugins`,
212
+ element,
213
+ );
214
+ };
215
+
179
216
  const buildAssertionStatus = (
180
217
  value: V1_AssertionStatus,
181
218
  atomicTest: AtomicTest,
182
219
  plugins: PureProtocolProcessorPlugin[],
183
220
  ): AssertionStatus => {
184
- if (value instanceof V1_EqualToJsonAssertFail) {
221
+ if (value instanceof V1_EqualToRelationAssertFail) {
222
+ return buildEqualToRelationAssertFail(value, atomicTest, plugins);
223
+ } else if (value instanceof V1_EqualToJsonAssertFail) {
185
224
  return buildEqualToJsonAssertFail(value, atomicTest, plugins);
186
225
  } else if (value instanceof V1_AssertFail) {
187
226
  return buildAssertFail(value, atomicTest, plugins);