@finos/legend-graph 21.0.0 → 22.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/lib/graph/Core_HashUtils.d.ts +2 -0
  2. package/lib/graph/Core_HashUtils.d.ts.map +1 -1
  3. package/lib/graph/Core_HashUtils.js +2 -0
  4. package/lib/graph/Core_HashUtils.js.map +1 -1
  5. package/lib/graph/MetaModelConst.d.ts +1 -0
  6. package/lib/graph/MetaModelConst.d.ts.map +1 -1
  7. package/lib/graph/MetaModelConst.js +1 -0
  8. package/lib/graph/MetaModelConst.js.map +1 -1
  9. package/lib/graph/MetaModelUtils.d.ts +1 -0
  10. package/lib/graph/MetaModelUtils.d.ts.map +1 -1
  11. package/lib/graph/MetaModelUtils.js +4 -0
  12. package/lib/graph/MetaModelUtils.js.map +1 -1
  13. package/lib/graph/helpers/ArtifactGenerationExtensionHelper.d.ts.map +1 -1
  14. package/lib/graph/helpers/ArtifactGenerationExtensionHelper.js +5 -6
  15. package/lib/graph/helpers/ArtifactGenerationExtensionHelper.js.map +1 -1
  16. package/lib/graph/metamodel/pure/packageableElements/service/PostValidation.d.ts +25 -0
  17. package/lib/graph/metamodel/pure/packageableElements/service/PostValidation.d.ts.map +1 -0
  18. package/lib/graph/metamodel/pure/packageableElements/service/PostValidation.js +31 -0
  19. package/lib/graph/metamodel/pure/packageableElements/service/PostValidation.js.map +1 -0
  20. package/lib/graph/metamodel/pure/packageableElements/service/PostValidationAssertion.d.ts +23 -0
  21. package/lib/graph/metamodel/pure/packageableElements/service/PostValidationAssertion.d.ts.map +1 -0
  22. package/lib/graph/metamodel/pure/packageableElements/service/PostValidationAssertion.js +29 -0
  23. package/lib/graph/metamodel/pure/packageableElements/service/PostValidationAssertion.js.map +1 -0
  24. package/lib/graph/metamodel/pure/packageableElements/service/Service.d.ts +2 -0
  25. package/lib/graph/metamodel/pure/packageableElements/service/Service.d.ts.map +1 -1
  26. package/lib/graph/metamodel/pure/packageableElements/service/Service.js +2 -0
  27. package/lib/graph/metamodel/pure/packageableElements/service/Service.js.map +1 -1
  28. package/lib/graph/metamodel/pure/packageableElements/service/ServiceExecution.d.ts +3 -3
  29. package/lib/graph/metamodel/pure/packageableElements/service/ServiceExecution.d.ts.map +1 -1
  30. package/lib/graph/metamodel/pure/packageableElements/service/ServiceExecution.js +2 -2
  31. package/lib/graph/metamodel/pure/packageableElements/service/ServiceExecution.js.map +1 -1
  32. package/lib/graphManager/action/changeDetection/DSL_Service_ObserverHelper.d.ts.map +1 -1
  33. package/lib/graphManager/action/changeDetection/DSL_Service_ObserverHelper.js +28 -2
  34. package/lib/graphManager/action/changeDetection/DSL_Service_ObserverHelper.js.map +1 -1
  35. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  36. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js +6 -3
  37. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  38. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidation.d.ts +25 -0
  39. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidation.d.ts.map +1 -0
  40. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidation.js +31 -0
  41. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidation.js.map +1 -0
  42. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidationAssertion.d.ts +23 -0
  43. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidationAssertion.d.ts.map +1 -0
  44. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidationAssertion.js +29 -0
  45. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidationAssertion.js.map +1 -0
  46. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_Service.d.ts +2 -0
  47. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_Service.d.ts.map +1 -1
  48. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_Service.js +2 -0
  49. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_Service.js.map +1 -1
  50. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceExecution.d.ts +2 -2
  51. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceExecution.d.ts.map +1 -1
  52. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceExecution.js +2 -2
  53. package/lib/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceExecution.js.map +1 -1
  54. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.d.ts.map +1 -1
  55. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.js +23 -3
  56. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.js.map +1 -1
  57. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  58. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +5 -1
  59. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  60. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.d.ts +3 -0
  61. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.d.ts.map +1 -1
  62. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.js +19 -1
  63. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.js.map +1 -1
  64. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.d.ts.map +1 -1
  65. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js +19 -2
  66. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.js.map +1 -1
  67. package/lib/package.json +4 -4
  68. package/package.json +7 -7
  69. package/src/graph/Core_HashUtils.ts +2 -0
  70. package/src/graph/MetaModelConst.ts +1 -0
  71. package/src/graph/MetaModelUtils.ts +7 -0
  72. package/src/graph/helpers/ArtifactGenerationExtensionHelper.ts +8 -7
  73. package/src/graph/metamodel/pure/packageableElements/service/PostValidation.ts +35 -0
  74. package/src/graph/metamodel/pure/packageableElements/service/PostValidationAssertion.ts +32 -0
  75. package/src/graph/metamodel/pure/packageableElements/service/Service.ts +3 -0
  76. package/src/graph/metamodel/pure/packageableElements/service/ServiceExecution.ts +6 -6
  77. package/src/graphManager/action/changeDetection/DSL_Service_ObserverHelper.ts +38 -3
  78. package/src/graphManager/protocol/pure/v1/V1_PureGraphManager.ts +9 -6
  79. package/src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidation.ts +35 -0
  80. package/src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidationAssertion.ts +32 -0
  81. package/src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_Service.ts +3 -0
  82. package/src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceExecution.ts +4 -4
  83. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ServiceTransformer.ts +45 -3
  84. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +8 -0
  85. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ServiceBuilderHelper.ts +51 -6
  86. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ServiceSerializationHelper.ts +46 -2
  87. package/tsconfig.json +4 -0
@@ -53,6 +53,8 @@ import {
53
53
  observe_AtomicTest,
54
54
  observe_TestAssertion,
55
55
  } from './Testable_ObserverHelper.js';
56
+ import type { PostValidation } from '../../../graph/metamodel/pure/packageableElements/service/PostValidation.js';
57
+ import type { PostValidationAssertion } from '../../../graph/metamodel/pure/packageableElements/service/PostValidationAssertion.js';
56
58
 
57
59
  export const observe_ConnectionTestData = skipObservedWithContext(
58
60
  (
@@ -83,6 +85,34 @@ export const observe_ParameterValue = skipObserved(
83
85
  },
84
86
  );
85
87
 
88
+ const observe_PostValidationAssertion = skipObserved(
89
+ (metamodel: PostValidationAssertion): PostValidationAssertion => {
90
+ makeObservable(metamodel, {
91
+ assertion: observable,
92
+ hashCode: computed,
93
+ id: observable,
94
+ });
95
+
96
+ observe_RawLambda(metamodel.assertion);
97
+ return metamodel;
98
+ },
99
+ );
100
+
101
+ const observe_PostValidation = skipObserved(
102
+ (metamodel: PostValidation): PostValidation => {
103
+ makeObservable(metamodel, {
104
+ assertions: observable,
105
+ description: observable,
106
+ parameters: observable,
107
+ hashCode: computed,
108
+ });
109
+
110
+ metamodel.assertions.forEach(observe_PostValidationAssertion);
111
+ metamodel.parameters.forEach(observe_RawLambda);
112
+ return metamodel;
113
+ },
114
+ );
115
+
86
116
  export const observe_TestData = skipObservedWithContext(
87
117
  (metamodel: TestData, context: ObserverContext): TestData => {
88
118
  makeObservable(metamodel, {
@@ -219,9 +249,12 @@ export const observe_PureSingleExecution = skipObservedWithContext(
219
249
  runtime: observable,
220
250
  hashCode: computed,
221
251
  });
222
-
223
- observe_PackageableElementReference(metamodel.mapping);
224
- observe_Runtime(metamodel.runtime, context);
252
+ if (metamodel.mapping) {
253
+ observe_PackageableElementReference(metamodel.mapping);
254
+ }
255
+ if (metamodel.runtime) {
256
+ observe_Runtime(metamodel.runtime, context);
257
+ }
225
258
 
226
259
  return metamodel;
227
260
  },
@@ -284,6 +317,7 @@ export const observe_Service = skipObservedWithContext(
284
317
  execution: observable,
285
318
  test: observable,
286
319
  tests: observable,
320
+ postValidations: observable,
287
321
  patternParameters: computed,
288
322
  _elementHashCode: override,
289
323
  });
@@ -295,6 +329,7 @@ export const observe_Service = skipObservedWithContext(
295
329
  observe_ServiceTest_Legacy(metamodel.test);
296
330
  }
297
331
  metamodel.tests.forEach((m) => observe_ServiceTestSuite(m, context));
332
+ metamodel.postValidations.forEach((m) => observe_PostValidation(m));
298
333
  return metamodel;
299
334
  },
300
335
  );
@@ -1691,6 +1691,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
1691
1691
  this.pluginManager.getPureGraphManagerPlugins(),
1692
1692
  ),
1693
1693
  );
1694
+ runTestableInput.unitTestIds = [unitAtomicTest];
1694
1695
  runTestsInput.testables = [runTestableInput];
1695
1696
  const parent = test.__parent;
1696
1697
  unitAtomicTest.testSuiteId =
@@ -2183,12 +2184,14 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
2183
2184
  // and not embedded.
2184
2185
  const execution = service.execution;
2185
2186
  if (execution instanceof PureSingleExecution) {
2186
- sdlcInfo.packageableElementPointers = [
2187
- new V1_PackageableElementPointer(
2188
- PackageableElementPointerType.MAPPING,
2189
- execution.mapping.value.path,
2190
- ),
2191
- ];
2187
+ if (execution.mapping) {
2188
+ sdlcInfo.packageableElementPointers = [
2189
+ new V1_PackageableElementPointer(
2190
+ PackageableElementPointerType.MAPPING,
2191
+ execution.mapping.value.path,
2192
+ ),
2193
+ ];
2194
+ }
2192
2195
  } else if (execution instanceof PureMultiExecution) {
2193
2196
  sdlcInfo.packageableElementPointers =
2194
2197
  execution.executionParameters.map(
@@ -0,0 +1,35 @@
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 { type Hashable, hashArray } from '@finos/legend-shared';
18
+ import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
19
+ import type { V1_RawLambda } from '../../rawValueSpecification/V1_RawLambda.js';
20
+ import type { V1_PostValidationAssertion } from './V1_PostValidationAssertion.js';
21
+
22
+ export class V1_PostValidation implements Hashable {
23
+ description!: string;
24
+ parameters: V1_RawLambda[] = [];
25
+ assertions: V1_PostValidationAssertion[] = [];
26
+
27
+ get hashCode(): string {
28
+ return hashArray([
29
+ CORE_HASH_STRUCTURE.SERVICE_POST_VALIDATION,
30
+ this.description,
31
+ hashArray(this.parameters),
32
+ hashArray(this.assertions),
33
+ ]);
34
+ }
35
+ }
@@ -0,0 +1,32 @@
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 { type Hashable, hashArray } from '@finos/legend-shared';
18
+ import { CORE_HASH_STRUCTURE } from '../../../../../../../graph/Core_HashUtils.js';
19
+ import type { V1_RawLambda } from '../../rawValueSpecification/V1_RawLambda.js';
20
+
21
+ export class V1_PostValidationAssertion implements Hashable {
22
+ id!: string;
23
+ assertion!: V1_RawLambda;
24
+
25
+ get hashCode(): string {
26
+ return hashArray([
27
+ CORE_HASH_STRUCTURE.SERVICE_POST_VALIDATION_ASSERTION,
28
+ this.id,
29
+ this.assertion,
30
+ ]);
31
+ }
32
+ }
@@ -25,6 +25,7 @@ import type { V1_StereotypePtr } from '../../../model/packageableElements/domain
25
25
  import type { V1_TaggedValue } from '../../../model/packageableElements/domain/V1_TaggedValue.js';
26
26
  import type { V1_DEPRECATED__ServiceTest } from './V1_DEPRECATED__ServiceTest.js';
27
27
  import type { V1_TestSuite } from '../../test/V1_TestSuite.js';
28
+ import type { V1_PostValidation } from './V1_PostValidation.js';
28
29
 
29
30
  export class V1_Service extends V1_PackageableElement implements Hashable {
30
31
  stereotypes: V1_StereotypePtr[] = [];
@@ -36,6 +37,7 @@ export class V1_Service extends V1_PackageableElement implements Hashable {
36
37
  execution!: V1_ServiceExecution;
37
38
  test?: V1_DEPRECATED__ServiceTest | undefined;
38
39
  testSuites: V1_TestSuite[] = [];
40
+ postValidations: V1_PostValidation[] = [];
39
41
 
40
42
  override get hashCode(): string {
41
43
  return hashArray([
@@ -50,6 +52,7 @@ export class V1_Service extends V1_PackageableElement implements Hashable {
50
52
  this.execution,
51
53
  this.test ?? '',
52
54
  hashArray(this.testSuites),
55
+ hashArray(this.postValidations),
53
56
  ]);
54
57
  }
55
58
 
@@ -43,15 +43,15 @@ export class V1_PureSingleExecution
43
43
  extends V1_PureExecution
44
44
  implements Hashable
45
45
  {
46
- mapping!: string;
47
- runtime!: V1_Runtime;
46
+ mapping: string | undefined;
47
+ runtime: V1_Runtime | undefined;
48
48
 
49
49
  override get hashCode(): string {
50
50
  return hashArray([
51
51
  CORE_HASH_STRUCTURE.SERVICE_PURE_SINGLE_EXECUTION,
52
52
  super.hashCode,
53
- this.mapping,
54
- this.runtime,
53
+ this.mapping ?? '',
54
+ this.runtime ?? '',
55
55
  ]);
56
56
  }
57
57
  }
@@ -32,7 +32,10 @@ import {
32
32
  V1_KeyedExecutionParameter,
33
33
  } from '../../../model/packageableElements/service/V1_ServiceExecution.js';
34
34
  import { V1_ServiceTest } from '../../../model/packageableElements/service/V1_ServiceTest.js';
35
- import { V1_RawValueSpecificationTransformer } from './V1_RawValueSpecificationTransformer.js';
35
+ import {
36
+ V1_RawValueSpecificationTransformer,
37
+ V1_transformRawLambda,
38
+ } from './V1_RawValueSpecificationTransformer.js';
36
39
  import type { V1_RawLambda } from '../../../model/rawValueSpecification/V1_RawLambda.js';
37
40
  import { V1_transformRuntime } from './V1_RuntimeTransformer.js';
38
41
  import type { V1_GraphTransformerContext } from './V1_GraphTransformerContext.js';
@@ -68,6 +71,10 @@ import {
68
71
  V1_transformTestAssertion,
69
72
  V1_transformTestSuite,
70
73
  } from './V1_TestTransformer.js';
74
+ import type { PostValidation } from '../../../../../../../graph/metamodel/pure/packageableElements/service/PostValidation.js';
75
+ import { V1_PostValidation } from '../../../model/packageableElements/service/V1_PostValidation.js';
76
+ import type { PostValidationAssertion } from '../../../../../../../graph/metamodel/pure/packageableElements/service/PostValidationAssertion.js';
77
+ import { V1_PostValidationAssertion } from '../../../model/packageableElements/service/V1_PostValidationAssertion.js';
71
78
 
72
79
  const transformConnectionTestData = (
73
80
  element: ConnectionTestData,
@@ -88,6 +95,34 @@ export const V1_transformParameterValue = (
88
95
  return parameterValue;
89
96
  };
90
97
 
98
+ const V1_transformPostValidationAssertion = (
99
+ element: PostValidationAssertion,
100
+ context: V1_GraphTransformerContext,
101
+ ): V1_PostValidationAssertion => {
102
+ const postValidationAssertion = new V1_PostValidationAssertion();
103
+ postValidationAssertion.id = element.id;
104
+ postValidationAssertion.assertion = V1_transformRawLambda(
105
+ element.assertion,
106
+ context,
107
+ );
108
+ return postValidationAssertion;
109
+ };
110
+
111
+ const V1_transformPostValidation = (
112
+ element: PostValidation,
113
+ context: V1_GraphTransformerContext,
114
+ ): V1_PostValidation => {
115
+ const postValidation = new V1_PostValidation();
116
+ postValidation.description = element.description;
117
+ postValidation.parameters = element.parameters.map((p) =>
118
+ V1_transformRawLambda(p, context),
119
+ );
120
+ postValidation.assertions = element.assertions.map((a) =>
121
+ V1_transformPostValidationAssertion(a, context),
122
+ );
123
+ return postValidation;
124
+ };
125
+
91
126
  const transformTestData = (
92
127
  element: TestData,
93
128
  context: V1_GraphTransformerContext,
@@ -137,8 +172,12 @@ const transformSingleExecution = (
137
172
  execution.func = element.func.accept_RawValueSpecificationVisitor(
138
173
  new V1_RawValueSpecificationTransformer(context),
139
174
  ) as V1_RawLambda;
140
- execution.mapping = element.mapping.valueForSerialization ?? '';
141
- execution.runtime = V1_transformRuntime(element.runtime, context);
175
+ if (element.mapping) {
176
+ execution.mapping = element.mapping.valueForSerialization ?? '';
177
+ }
178
+ if (element.runtime) {
179
+ execution.runtime = V1_transformRuntime(element.runtime, context);
180
+ }
142
181
  return execution;
143
182
  };
144
183
 
@@ -262,5 +301,8 @@ export const V1_transformService = (
262
301
  service.testSuites = element.tests.map((testSuite) =>
263
302
  V1_transformTestSuite(testSuite, context),
264
303
  );
304
+ service.postValidations = element.postValidations.map((postValidation) =>
305
+ V1_transformPostValidation(postValidation, context),
306
+ );
265
307
  return service;
266
308
  };
@@ -53,6 +53,7 @@ import {
53
53
  import {
54
54
  V1_buildServiceExecution,
55
55
  V1_buildLegacyServiceTest,
56
+ V1_buildPostValidation,
56
57
  } from './helpers/V1_ServiceBuilderHelper.js';
57
58
  import {
58
59
  V1_buildEnumerationMapping,
@@ -85,6 +86,7 @@ import { V1_DataElementReference } from '../../../model/data/V1_EmbeddedData.js'
85
86
  import { V1_buildFunctionSignature } from '../../../helpers/V1_DomainHelper.js';
86
87
  import { getFunctionName } from '../../../../../../../graph/helpers/DomainHelper.js';
87
88
  import { GraphBuilderError } from '../../../../../../GraphManagerUtils.js';
89
+ import { PostValidation } from '../../../../../../../graph/metamodel/pure/packageableElements/service/PostValidation.js';
88
90
 
89
91
  export class V1_ElementSecondPassBuilder
90
92
  implements V1_PackageableElementVisitor<void>
@@ -332,6 +334,12 @@ export class V1_ElementSecondPassBuilder
332
334
  service.tests = element.testSuites
333
335
  .map((testSuite) => V1_buildTestSuite(service, testSuite, this.context))
334
336
  .map((e) => guaranteeType(e, ServiceTestSuite));
337
+
338
+ service.postValidations = element.postValidations
339
+ .map((postValidation) =>
340
+ V1_buildPostValidation(postValidation, this.context),
341
+ )
342
+ .map((e) => guaranteeType(e, PostValidation));
335
343
  }
336
344
 
337
345
  visit_SectionIndex(element: V1_SectionIndex): void {
@@ -78,6 +78,10 @@ import {
78
78
  DEPRECATED__MultiExecutionTest,
79
79
  } from '../../../../../../../../graph/metamodel/pure/packageableElements/service/DEPRECATED__ServiceTest.js';
80
80
  import { V1_buildEmbeddedData } from './V1_DataElementBuilderHelper.js';
81
+ import type { V1_PostValidation } from '../../../../model/packageableElements/service/V1_PostValidation.js';
82
+ import { PostValidation } from '../../../../../../../../graph/metamodel/pure/packageableElements/service/PostValidation.js';
83
+ import type { V1_PostValidationAssertion } from '../../../../model/packageableElements/service/V1_PostValidationAssertion.js';
84
+ import { PostValidationAssertion } from '../../../../../../../../graph/metamodel/pure/packageableElements/service/PostValidationAssertion.js';
81
85
 
82
86
  const buildConnectionTestData = (
83
87
  element: V1_ConnectionTestData,
@@ -96,6 +100,35 @@ const buildParameterValue = (element: V1_ParameterValue): ParameterValue => {
96
100
  return parameterValue;
97
101
  };
98
102
 
103
+ const buildPostValidationAssertion = (
104
+ element: V1_PostValidationAssertion,
105
+ context: V1_GraphBuilderContext,
106
+ ): PostValidationAssertion => {
107
+ const postValidationAssertion = new PostValidationAssertion();
108
+ postValidationAssertion.id = element.id;
109
+ postValidationAssertion.assertion = V1_buildRawLambdaWithResolvedPaths(
110
+ element.assertion.parameters,
111
+ element.assertion.body,
112
+ context,
113
+ );
114
+ return postValidationAssertion;
115
+ };
116
+
117
+ export const V1_buildPostValidation = (
118
+ element: V1_PostValidation,
119
+ context: V1_GraphBuilderContext,
120
+ ): PostValidation => {
121
+ const postValidation = new PostValidation();
122
+ postValidation.description = element.description;
123
+ postValidation.assertions = element.assertions.map((a) =>
124
+ buildPostValidationAssertion(a, context),
125
+ );
126
+ postValidation.parameters = element.parameters.map((rq) =>
127
+ V1_buildRawLambdaWithResolvedPaths(rq.parameters, rq.body, context),
128
+ );
129
+ return postValidation;
130
+ };
131
+
99
132
  const buildTestData = (
100
133
  element: V1_TestData,
101
134
  context: V1_GraphBuilderContext,
@@ -331,6 +364,22 @@ export const V1_buildServiceExecution = (
331
364
  serviceExecution.func,
332
365
  `Service Pure execution 'func' field is missing`,
333
366
  );
367
+ if (serviceExecution.mapping && serviceExecution.runtime) {
368
+ return new PureSingleExecution(
369
+ V1_buildRawLambdaWithResolvedPaths(
370
+ serviceExecution.func.parameters,
371
+ serviceExecution.func.body,
372
+ context,
373
+ ),
374
+ parentService,
375
+ context.resolveMapping(serviceExecution.mapping),
376
+ buildServiceExecutionRuntime(
377
+ serviceExecution.runtime,
378
+ serviceExecution.mapping,
379
+ context,
380
+ ),
381
+ );
382
+ }
334
383
  return new PureSingleExecution(
335
384
  V1_buildRawLambdaWithResolvedPaths(
336
385
  serviceExecution.func.parameters,
@@ -338,12 +387,8 @@ export const V1_buildServiceExecution = (
338
387
  context,
339
388
  ),
340
389
  parentService,
341
- context.resolveMapping(serviceExecution.mapping),
342
- buildServiceExecutionRuntime(
343
- serviceExecution.runtime,
344
- serviceExecution.mapping,
345
- context,
346
- ),
390
+ undefined,
391
+ undefined,
347
392
  );
348
393
  } else if (serviceExecution instanceof V1_PureMultiExecution) {
349
394
  if (!serviceExecution.executionParameters.length) {
@@ -84,6 +84,8 @@ import {
84
84
  import type { PureProtocolProcessorPlugin } from '../../../../PureProtocolProcessorPlugin.js';
85
85
  import type { V1_TestSuite } from '../../../model/test/V1_TestSuite.js';
86
86
  import { ATOMIC_TEST_TYPE } from '../../../../../../../graph/MetaModelConst.js';
87
+ import { V1_PostValidation } from '../../../model/packageableElements/service/V1_PostValidation.js';
88
+ import { V1_PostValidationAssertion } from '../../../model/packageableElements/service/V1_PostValidationAssertion.js';
87
89
 
88
90
  export const V1_SERVICE_ELEMENT_PROTOCOL_TYPE = 'service';
89
91
 
@@ -116,6 +118,28 @@ export const V1_parameterValueModelSchema = createModelSchema(
116
118
  },
117
119
  );
118
120
 
121
+ const V1_servicePostValidationAssertionModelSchema = createModelSchema(
122
+ V1_PostValidationAssertion,
123
+ {
124
+ assertion: usingModelSchema(V1_rawLambdaModelSchema),
125
+ id: primitive(),
126
+ },
127
+ );
128
+
129
+ const V1_servicePostValidationModelSchema = createModelSchema(
130
+ V1_PostValidation,
131
+ {
132
+ assertions: list(
133
+ custom(
134
+ (val) => serialize(V1_servicePostValidationAssertionModelSchema, val),
135
+ (val) => deserialize(V1_servicePostValidationAssertionModelSchema, val),
136
+ ),
137
+ ),
138
+ description: primitive(),
139
+ parameters: list(usingModelSchema(V1_rawLambdaModelSchema)),
140
+ },
141
+ );
142
+
119
143
  export const V1_testDataModelSchema = (
120
144
  plugins: PureProtocolProcessorPlugin[],
121
145
  ): ModelSchema<V1_TestData> =>
@@ -212,8 +236,8 @@ const pureSingleExecutionModelSchema = createModelSchema(
212
236
  V1_ServiceExecutionType.PURE_SINGLE_EXECUTION,
213
237
  ),
214
238
  func: usingModelSchema(V1_rawLambdaModelSchema),
215
- mapping: primitive(),
216
- runtime: custom(
239
+ mapping: optional(primitive()),
240
+ runtime: optionalCustom(
217
241
  (val) => V1_serializeRuntimeValue(val),
218
242
  (val) => V1_deserializeRuntimeValue(val),
219
243
  ),
@@ -408,4 +432,24 @@ export const V1_serviceModelSchema = (
408
432
  skipIfEmpty: false,
409
433
  }),
410
434
  ),
435
+ postValidations: custom(
436
+ (values) =>
437
+ serializeArray(
438
+ values,
439
+ (value: V1_PostValidation) =>
440
+ serialize(V1_servicePostValidationModelSchema, value),
441
+ {
442
+ skipIfEmpty: true,
443
+ INTERNAL__forceReturnEmptyInTest: true,
444
+ },
445
+ ),
446
+ (values) =>
447
+ deserializeArray(
448
+ values,
449
+ (v) => deserialize(V1_servicePostValidationModelSchema, v),
450
+ {
451
+ skipIfEmpty: false,
452
+ },
453
+ ),
454
+ ),
411
455
  });
package/tsconfig.json CHANGED
@@ -169,6 +169,8 @@
169
169
  "./src/graph/metamodel/pure/packageableElements/service/DEPRECATED__ServiceTest.ts",
170
170
  "./src/graph/metamodel/pure/packageableElements/service/MultiExecutionServiceTestResult.ts",
171
171
  "./src/graph/metamodel/pure/packageableElements/service/ParameterValue.ts",
172
+ "./src/graph/metamodel/pure/packageableElements/service/PostValidation.ts",
173
+ "./src/graph/metamodel/pure/packageableElements/service/PostValidationAssertion.ts",
172
174
  "./src/graph/metamodel/pure/packageableElements/service/Service.ts",
173
175
  "./src/graph/metamodel/pure/packageableElements/service/ServiceExecution.ts",
174
176
  "./src/graph/metamodel/pure/packageableElements/service/ServiceTest.ts",
@@ -441,6 +443,8 @@
441
443
  "./src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_DEPRECATED__ServiceTest.ts",
442
444
  "./src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_MultiExecutionServiceTestResult.ts",
443
445
  "./src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ParameterValue.ts",
446
+ "./src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidation.ts",
447
+ "./src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_PostValidationAssertion.ts",
444
448
  "./src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_Service.ts",
445
449
  "./src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceExecution.ts",
446
450
  "./src/graphManager/protocol/pure/v1/model/packageableElements/service/V1_ServiceTest.ts",