@finos/legend-graph 19.0.0 → 19.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/lib/graph/BasicModel.d.ts.map +1 -1
  2. package/lib/graph/BasicModel.js +4 -1
  3. package/lib/graph/BasicModel.js.map +1 -1
  4. package/lib/graph/helpers/DomainHelper.d.ts +4 -0
  5. package/lib/graph/helpers/DomainHelper.d.ts.map +1 -1
  6. package/lib/graph/helpers/DomainHelper.js +15 -1
  7. package/lib/graph/helpers/DomainHelper.js.map +1 -1
  8. package/lib/graph/helpers/PureLanguageHelper.d.ts +1 -1
  9. package/lib/graph/helpers/PureLanguageHelper.d.ts.map +1 -1
  10. package/lib/graph/helpers/PureLanguageHelper.js +4 -3
  11. package/lib/graph/helpers/PureLanguageHelper.js.map +1 -1
  12. package/lib/graph/metamodel/pure/packageableElements/mapping/TEMPORARY__UnresolvedSetImplementation.d.ts +2 -3
  13. package/lib/graph/metamodel/pure/packageableElements/mapping/TEMPORARY__UnresolvedSetImplementation.d.ts.map +1 -1
  14. package/lib/graph/metamodel/pure/packageableElements/mapping/TEMPORARY__UnresolvedSetImplementation.js +2 -3
  15. package/lib/graph/metamodel/pure/packageableElements/mapping/TEMPORARY__UnresolvedSetImplementation.js.map +1 -1
  16. package/lib/graphManager/AbstractPureGraphManager.d.ts +11 -2
  17. package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
  18. package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
  19. package/lib/graphManager/GraphManagerTestUtils.d.ts.map +1 -1
  20. package/lib/graphManager/GraphManagerTestUtils.js +6 -6
  21. package/lib/graphManager/GraphManagerTestUtils.js.map +1 -1
  22. package/lib/graphManager/action/EngineError.d.ts +0 -1
  23. package/lib/graphManager/action/EngineError.d.ts.map +1 -1
  24. package/lib/graphManager/action/EngineError.js +0 -1
  25. package/lib/graphManager/action/EngineError.js.map +1 -1
  26. package/lib/graphManager/action/changeDetection/DomainObserverHelper.d.ts.map +1 -1
  27. package/lib/graphManager/action/changeDetection/DomainObserverHelper.js +1 -0
  28. package/lib/graphManager/action/changeDetection/DomainObserverHelper.js.map +1 -1
  29. package/lib/graphManager/action/compilation/CompilationResult.d.ts +24 -0
  30. package/lib/graphManager/action/compilation/CompilationResult.d.ts.map +1 -0
  31. package/lib/graphManager/action/compilation/CompilationResult.js +17 -0
  32. package/lib/graphManager/action/compilation/CompilationResult.js.map +1 -0
  33. package/lib/graphManager/action/compilation/CompilationWarning.d.ts +23 -0
  34. package/lib/graphManager/action/compilation/CompilationWarning.d.ts.map +1 -0
  35. package/lib/graphManager/action/compilation/CompilationWarning.js +26 -0
  36. package/lib/graphManager/action/compilation/CompilationWarning.js.map +1 -0
  37. package/lib/graphManager/action/execution/ExecutionResult.d.ts +5 -5
  38. package/lib/graphManager/action/execution/ExecutionResult.js +4 -4
  39. package/lib/graphManager/action/execution/ExecutionResultHelper.js +2 -2
  40. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts +3 -2
  41. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  42. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js +31 -19
  43. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  44. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.d.ts +4 -2
  45. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.d.ts.map +1 -1
  46. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.js +11 -2
  47. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.js.map +1 -1
  48. package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationResult.d.ts +24 -0
  49. package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationResult.d.ts.map +1 -0
  50. package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationResult.js +17 -0
  51. package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationResult.js.map +1 -0
  52. package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationWarning.d.ts +23 -0
  53. package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationWarning.d.ts.map +1 -0
  54. package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationWarning.js +27 -0
  55. package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationWarning.js.map +1 -0
  56. package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_CompileResult.d.ts +2 -0
  57. package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_CompileResult.d.ts.map +1 -1
  58. package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecutionHelper.js +6 -6
  59. package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecutionResult.d.ts +5 -5
  60. package/lib/graphManager/protocol/pure/v1/engine/execution/V1_ExecutionResult.js +6 -6
  61. package/lib/graphManager/protocol/pure/v1/helpers/V1_DomainHelper.d.ts +1 -1
  62. package/lib/graphManager/protocol/pure/v1/helpers/V1_DomainHelper.d.ts.map +1 -1
  63. package/lib/graphManager/protocol/pure/v1/helpers/V1_DomainHelper.js +13 -8
  64. package/lib/graphManager/protocol/pure/v1/helpers/V1_DomainHelper.js.map +1 -1
  65. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.d.ts +4 -4
  66. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.d.ts.map +1 -1
  67. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/{V1_TdsOlapAggregation.d.ts → V1_TDSOlapAggregation_.d.ts} +3 -3
  68. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/V1_TDSOlapAggregation_.d.ts.map +1 -0
  69. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/{V1_TdsOlapAggregation.js → V1_TDSOlapAggregation_.js} +4 -4
  70. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/V1_TDSOlapAggregation_.js.map +1 -0
  71. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/{V1_TdsOlapRank.d.ts → V1_TDSOlapRank_.d.ts} +3 -3
  72. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/V1_TDSOlapRank_.d.ts.map +1 -0
  73. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/{V1_TdsOlapRank.js → V1_TDSOlapRank_.js} +4 -4
  74. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/V1_TDSOlapRank_.js.map +1 -0
  75. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.d.ts.map +1 -1
  76. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.js +4 -2
  77. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.js.map +1 -1
  78. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.d.ts.map +1 -1
  79. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js +26 -13
  80. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.js.map +1 -1
  81. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.d.ts.map +1 -1
  82. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.js +14 -8
  83. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.js.map +1 -1
  84. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.d.ts.map +1 -1
  85. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.js +29 -19
  86. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.js.map +1 -1
  87. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts +4 -4
  88. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -1
  89. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js +2 -2
  90. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationPathResolver.js +2 -2
  91. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts +1 -1
  92. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts.map +1 -1
  93. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js +23 -2
  94. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js.map +1 -1
  95. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js +6 -6
  96. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js.map +1 -1
  97. package/lib/index.d.ts +3 -1
  98. package/lib/index.d.ts.map +1 -1
  99. package/lib/index.js +3 -1
  100. package/lib/index.js.map +1 -1
  101. package/lib/package.json +4 -4
  102. package/package.json +7 -7
  103. package/src/graph/BasicModel.ts +4 -0
  104. package/src/graph/helpers/DomainHelper.ts +39 -0
  105. package/src/graph/helpers/PureLanguageHelper.ts +7 -3
  106. package/src/graph/metamodel/pure/packageableElements/mapping/TEMPORARY__UnresolvedSetImplementation.ts +2 -3
  107. package/src/graphManager/AbstractPureGraphManager.ts +18 -3
  108. package/src/graphManager/GraphManagerTestUtils.tsx +6 -5
  109. package/src/graphManager/action/EngineError.ts +1 -3
  110. package/src/graphManager/action/changeDetection/DomainObserverHelper.ts +1 -0
  111. package/src/graphManager/action/compilation/CompilationResult.ts +26 -0
  112. package/src/graphManager/action/compilation/CompilationWarning.ts +33 -0
  113. package/src/graphManager/action/execution/ExecutionResult.ts +5 -5
  114. package/src/graphManager/action/execution/ExecutionResultHelper.ts +2 -2
  115. package/src/graphManager/protocol/pure/v1/V1_PureGraphManager.ts +54 -28
  116. package/src/graphManager/protocol/pure/v1/engine/V1_Engine.ts +32 -5
  117. package/src/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationResult.ts +26 -0
  118. package/src/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationWarning.ts +34 -0
  119. package/src/graphManager/protocol/pure/v1/engine/compilation/V1_CompileResult.ts +6 -1
  120. package/src/graphManager/protocol/pure/v1/engine/execution/V1_ExecutionHelper.ts +12 -12
  121. package/src/graphManager/protocol/pure/v1/engine/execution/V1_ExecutionResult.ts +7 -7
  122. package/src/graphManager/protocol/pure/v1/helpers/V1_DomainHelper.ts +16 -10
  123. package/src/graphManager/protocol/pure/v1/model/valueSpecification/V1_ValueSpecification.ts +4 -4
  124. package/src/graphManager/protocol/pure/v1/model/valueSpecification/raw/{V1_TdsOlapAggregation.ts → V1_TDSOlapAggregation_.ts} +3 -3
  125. package/src/graphManager/protocol/pure/v1/model/valueSpecification/raw/{V1_TdsOlapRank.ts → V1_TDSOlapRank_.ts} +3 -3
  126. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementFirstPassBuilder.ts +4 -2
  127. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementSecondPassBuilder.ts +26 -25
  128. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_ElementThirdPassBuilder.ts +14 -16
  129. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/V1_PropertyMappingBuilder.ts +34 -10
  130. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.ts +5 -5
  131. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationPathResolver.ts +4 -4
  132. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.ts +25 -4
  133. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.ts +8 -8
  134. package/src/index.ts +4 -1
  135. package/tsconfig.json +6 -2
  136. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/V1_TdsOlapAggregation.d.ts.map +0 -1
  137. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/V1_TdsOlapAggregation.js.map +0 -1
  138. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/V1_TdsOlapRank.d.ts.map +0 -1
  139. package/lib/graphManager/protocol/pure/v1/model/valueSpecification/raw/V1_TdsOlapRank.js.map +0 -1
@@ -92,6 +92,11 @@ import {
92
92
  V1_MappingModelCoverageAnalysisResult,
93
93
  } from './analytics/V1_MappingModelCoverageAnalysis.js';
94
94
  import type { ServiceExecutionMode } from '../../../../action/service/ServiceExecutionMode.js';
95
+ import type {
96
+ V1_CompilationResult,
97
+ V1_TextCompilationResult,
98
+ } from './compilation/V1_CompilationResult.js';
99
+ import { V1_CompilationWarning } from './compilation/V1_CompilationWarning.js';
95
100
 
96
101
  class V1_EngineConfig extends TEMPORARY__AbstractEngineConfig {
97
102
  private engine: V1_Engine;
@@ -365,11 +370,20 @@ export class V1_Engine {
365
370
  async compilePureModelContextData(
366
371
  model: V1_PureModelContextData,
367
372
  options?: { onError?: (() => void) | undefined } | undefined,
368
- ): Promise<void> {
373
+ ): Promise<V1_CompilationResult> {
369
374
  try {
370
- await this.engineServerClient.compile(
375
+ const compilationResult = await this.engineServerClient.compile(
371
376
  this.serializePureModelContextData(model),
372
377
  );
378
+ return {
379
+ warnings: (
380
+ compilationResult.warnings as
381
+ | PlainObject<V1_CompilationWarning>[]
382
+ | undefined
383
+ )?.map((warning) =>
384
+ V1_CompilationWarning.serialization.fromJson(warning),
385
+ ),
386
+ };
373
387
  } catch (error) {
374
388
  assertErrorThrown(error);
375
389
  options?.onError?.();
@@ -390,8 +404,8 @@ export class V1_Engine {
390
404
  async compileText(
391
405
  graphText: string,
392
406
  compileContext?: V1_PureModelContextData,
393
- options?: { onError?: () => void },
394
- ): Promise<V1_PureModelContextData> {
407
+ options?: { onError?: () => void; getCompilationWarnings?: boolean },
408
+ ): Promise<V1_TextCompilationResult> {
395
409
  const mainGraph = await this.pureCodeToPureModelContextDataJSON(graphText, {
396
410
  ...options,
397
411
  // NOTE: we need to return source information here so we can locate the compilation
@@ -407,7 +421,20 @@ export class V1_Engine {
407
421
  : mainGraph;
408
422
  try {
409
423
  await this.engineServerClient.compile(pureModelContextDataJson);
410
- return V1_deserializePureModelContextData(mainGraph);
424
+ const model = V1_deserializePureModelContextData(mainGraph);
425
+ const compilationResult = await this.engineServerClient.compile(
426
+ pureModelContextDataJson,
427
+ );
428
+ return {
429
+ model,
430
+ warnings: (
431
+ compilationResult.warnings as
432
+ | PlainObject<V1_CompilationWarning>[]
433
+ | undefined
434
+ )?.map((warning) =>
435
+ V1_CompilationWarning.serialization.fromJson(warning),
436
+ ),
437
+ };
411
438
  } catch (error) {
412
439
  assertErrorThrown(error);
413
440
  options?.onError?.();
@@ -0,0 +1,26 @@
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 { V1_PureModelContextData } from '../../model/context/V1_PureModelContextData.js';
18
+ import type { V1_CompilationWarning } from './V1_CompilationWarning.js';
19
+
20
+ export interface V1_CompilationResult {
21
+ warnings: V1_CompilationWarning[] | undefined;
22
+ }
23
+
24
+ export interface V1_TextCompilationResult extends V1_CompilationResult {
25
+ model: V1_PureModelContextData;
26
+ }
@@ -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 { createModelSchema, primitive } from 'serializr';
18
+ import { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
19
+ import { V1_sourceInformationSerialization } from '../../transformation/pureProtocol/serializationHelpers/V1_CoreSerializationHelper.js';
20
+ import type { V1_SourceInformation } from '../../model/V1_SourceInformation.js';
21
+
22
+ export class V1_CompilationWarning {
23
+ message = '';
24
+ sourceInformation?: V1_SourceInformation | undefined;
25
+
26
+ static readonly serialization = new SerializationFactory(
27
+ createModelSchema(V1_CompilationWarning, {
28
+ message: primitive(),
29
+ sourceInformation: usingModelSchema(
30
+ V1_sourceInformationSerialization.schema,
31
+ ),
32
+ }),
33
+ );
34
+ }
@@ -14,6 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ import type { V1_CompilationWarning } from './V1_CompilationWarning.js';
18
+
17
19
  /**
18
20
  * NOTE: technically, this endpoint should be returning 204 (No Content), and 400 (Bad Request) when there are
19
21
  * compilation errors but for backward compatibility, we have to resort to return something, i.e. 200 (OK) with
@@ -22,4 +24,7 @@
22
24
  * On the other hand, we might want to keep this around since compilation API might change in the future to return
23
25
  * some state or meaningful results.
24
26
  */
25
- export type V1_CompileResult = { message: string };
27
+ export type V1_CompileResult = {
28
+ message: string;
29
+ warnings?: V1_CompilationWarning[] | undefined;
30
+ };
@@ -20,22 +20,22 @@ import {
20
20
  } from '@finos/legend-shared';
21
21
  import {
22
22
  type ExecutionResult,
23
- TdsRow,
23
+ TDSRow,
24
24
  INTERNAL__UnknownExecutionResult,
25
25
  ClassExecutionResult,
26
26
  JsonExecutionResult,
27
- TdsExecutionResult,
28
- TdsBuilder,
27
+ TDSExecutionResult,
28
+ TDSBuilder,
29
29
  TDSColumn,
30
30
  RawExecutionResult,
31
31
  } from '../../../../../../graphManager/action/execution/ExecutionResult.js';
32
32
  import {
33
33
  type V1_ExecutionResult,
34
- type V1_TdsBuilder,
34
+ type V1_TDSBuilder,
35
35
  V1_ClassExecutionResult,
36
36
  V1_JsonExecutionResult,
37
37
  V1_INTERNAL__UnknownExecutionResult,
38
- V1_TdsExecutionResult,
38
+ V1_TDSExecutionResult,
39
39
  V1_RawExecutionResult,
40
40
  } from './V1_ExecutionResult.js';
41
41
 
@@ -50,8 +50,8 @@ const buildJSONExecutionResult = (
50
50
  return metamodel;
51
51
  };
52
52
 
53
- const buildTDSBuilder = (protocol: V1_TdsBuilder): TdsBuilder => {
54
- const builder = new TdsBuilder();
53
+ const buildTDSBuilder = (protocol: V1_TDSBuilder): TDSBuilder => {
54
+ const builder = new TDSBuilder();
55
55
  builder.columns = protocol.columns.map((_column) => {
56
56
  const column = new TDSColumn();
57
57
  column.name = guaranteeNonNullable(
@@ -67,9 +67,9 @@ const buildTDSBuilder = (protocol: V1_TdsBuilder): TdsBuilder => {
67
67
  };
68
68
 
69
69
  const buildTDSExecutionResult = (
70
- protocol: V1_TdsExecutionResult,
71
- ): TdsExecutionResult => {
72
- const metamodel = new TdsExecutionResult();
70
+ protocol: V1_TDSExecutionResult,
71
+ ): TDSExecutionResult => {
72
+ const metamodel = new TDSExecutionResult();
73
73
  metamodel.builder = buildTDSBuilder(
74
74
  guaranteeNonNullable(
75
75
  protocol.builder,
@@ -87,7 +87,7 @@ const buildTDSExecutionResult = (
87
87
  rows: { values: (string | number)[] }[];
88
88
  }
89
89
  ).rows.map((_row) => {
90
- const row = new TdsRow();
90
+ const row = new TDSRow();
91
91
  row.values = _row.values;
92
92
  return row;
93
93
  });
@@ -111,7 +111,7 @@ export const V1_buildExecutionResult = (
111
111
  ): ExecutionResult => {
112
112
  if (protocol instanceof V1_ClassExecutionResult) {
113
113
  return buildClassExecutionResult(protocol);
114
- } else if (protocol instanceof V1_TdsExecutionResult) {
114
+ } else if (protocol instanceof V1_TDSExecutionResult) {
115
115
  return buildTDSExecutionResult(protocol);
116
116
  } else if (protocol instanceof V1_JsonExecutionResult) {
117
117
  return buildJSONExecutionResult(protocol);
@@ -64,25 +64,25 @@ export class V1_TDSColumn {
64
64
  );
65
65
  }
66
66
 
67
- export class V1_TdsBuilder extends V1_ResultBuilder {
67
+ export class V1_TDSBuilder extends V1_ResultBuilder {
68
68
  columns: V1_TDSColumn[] = [];
69
69
 
70
70
  static readonly serialization = new SerializationFactory(
71
- createModelSchema(V1_TdsBuilder, {
71
+ createModelSchema(V1_TDSBuilder, {
72
72
  _type: primitive(),
73
73
  columns: list(usingModelSchema(V1_TDSColumn.serialization.schema)),
74
74
  }),
75
75
  );
76
76
  }
77
77
 
78
- export class V1_TdsExecutionResult extends V1_ExecutionResult {
79
- declare builder: V1_TdsBuilder;
78
+ export class V1_TDSExecutionResult extends V1_ExecutionResult {
79
+ declare builder: V1_TDSBuilder;
80
80
  result!: object;
81
81
 
82
82
  static readonly serialization = new SerializationFactory(
83
- createModelSchema(V1_TdsExecutionResult, {
83
+ createModelSchema(V1_TDSExecutionResult, {
84
84
  _type: primitive(),
85
- builder: usingModelSchema(V1_TdsBuilder.serialization.schema),
85
+ builder: usingModelSchema(V1_TDSBuilder.serialization.schema),
86
86
  activities: raw(),
87
87
  result: raw(),
88
88
  }),
@@ -130,7 +130,7 @@ export const V1_serializeExecutionResult = (
130
130
  case BuilderType.CLASS_BUILDER:
131
131
  return V1_ClassExecutionResult.serialization.fromJson(value);
132
132
  case BuilderType.TDS_BUILDER:
133
- return V1_TdsExecutionResult.serialization.fromJson(value);
133
+ return V1_TDSExecutionResult.serialization.fromJson(value);
134
134
  case BuilderType.JSON_BUILDER:
135
135
  return V1_JsonExecutionResult.serialization.fromJson(value);
136
136
  default:
@@ -22,7 +22,9 @@ import type { V1_Multiplicity } from '../model/packageableElements/domain/V1_Mul
22
22
  import type { V1_ConcreteFunctionDefinition } from '../model/packageableElements/function/V1_ConcreteFunctionDefinition.js';
23
23
  import type { V1_RawVariable } from '../model/rawValueSpecification/V1_RawVariable.js';
24
24
 
25
- const V1_getMultiplicitySuffix = (multiplicity: V1_Multiplicity): string => {
25
+ const V1_buildFunctionMultiplicitySignature = (
26
+ multiplicity: V1_Multiplicity,
27
+ ): string => {
26
28
  if (multiplicity.lowerBound === multiplicity.upperBound) {
27
29
  return multiplicity.lowerBound.toString();
28
30
  } else if (
@@ -36,16 +38,20 @@ const V1_getMultiplicitySuffix = (multiplicity: V1_Multiplicity): string => {
36
38
  }$`;
37
39
  };
38
40
 
39
- const V1_getVariableSuffix = (variable: V1_RawVariable): string =>
41
+ const V1_buildFunctionParameterSignature = (variable: V1_RawVariable): string =>
40
42
  `${variable.class
41
43
  .split(ELEMENT_PATH_DELIMITER)
42
- .pop()}_${V1_getMultiplicitySuffix(variable.multiplicity)}_`;
44
+ .pop()}_${V1_buildFunctionMultiplicitySignature(variable.multiplicity)}_`;
43
45
 
44
- export const V1_getFunctionSuffix = (
45
- fn: V1_ConcreteFunctionDefinition,
46
- ): string =>
47
- `${fn.parameters
48
- .map((p) => V1_getVariableSuffix(p))
49
- .join('_')}_${fn.returnType
46
+ export const V1_buildFunctionSignature = (
47
+ func: V1_ConcreteFunctionDefinition,
48
+ ): string => {
49
+ const functionSignature = `_${func.parameters
50
+ .map((p) => V1_buildFunctionParameterSignature(p))
51
+ .join('_')}_${func.returnType
50
52
  .split(ELEMENT_PATH_DELIMITER)
51
- .pop()}_${V1_getMultiplicitySuffix(fn.returnMultiplicity)}_`;
53
+ .pop()}_${V1_buildFunctionMultiplicitySignature(func.returnMultiplicity)}_`;
54
+ return func.name.endsWith(functionSignature)
55
+ ? func.name
56
+ : func.name + functionSignature;
57
+ };
@@ -44,8 +44,8 @@ import type { V1_PureList } from '../../model/valueSpecification/raw/V1_PureList
44
44
  import type { V1_TDSAggregateValue } from '../../model/valueSpecification/raw/V1_TDSAggregateValue.js';
45
45
  import type { V1_TDSColumnInformation } from '../../model/valueSpecification/raw/V1_TDSColumnInformation.js';
46
46
  import type { V1_TDSSortInformation } from '../../model/valueSpecification/raw/V1_TDSSortInformation.js';
47
- import type { V1_TdsOlapRank } from '../../model/valueSpecification/raw/V1_TdsOlapRank.js';
48
- import type { V1_TdsOlapAggregation } from '../../model/valueSpecification/raw/V1_TdsOlapAggregation.js';
47
+ import type { V1_TDSOlapRank } from './raw/V1_TDSOlapRank_.js';
48
+ import type { V1_TDSOlapAggregation } from './raw/V1_TDSOlapAggregation_.js';
49
49
  import type { V1_AppliedProperty } from './application/V1_AppliedProperty.js';
50
50
  import type { V1_PackageableElementPtr } from './raw/V1_PackageableElementPtr.js';
51
51
  import type { V1_HackedClass } from './raw/V1_HackedClass.js';
@@ -95,8 +95,8 @@ export interface V1_ValueSpecificationVisitor<T> {
95
95
  visit_TDSAggregateValue(valueSpecification: V1_TDSAggregateValue): T;
96
96
  visit_TDSColumnInformation(valueSpecification: V1_TDSColumnInformation): T;
97
97
  visit_TDSSortInformation(valueSpecification: V1_TDSSortInformation): T;
98
- visit_TdsOlapRank(valueSpecification: V1_TdsOlapRank): T;
99
- visit_TdsOlapAggregation(valueSpecification: V1_TdsOlapAggregation): T;
98
+ visit_TDSOlapRank(valueSpecification: V1_TDSOlapRank): T;
99
+ visit_TDSOlapAggregation(valueSpecification: V1_TDSOlapAggregation): T;
100
100
 
101
101
  visit_INTERNAL__UnknownValueSpecfication(
102
102
  valueSpecification: V1_INTERNAL__UnknownValueSpecification,
@@ -17,16 +17,16 @@
17
17
  import {
18
18
  type V1_ValueSpecificationVisitor,
19
19
  V1_ValueSpecification,
20
- } from '../../../model/valueSpecification/V1_ValueSpecification.js';
20
+ } from '../V1_ValueSpecification.js';
21
21
  import type { V1_Lambda } from './V1_Lambda.js';
22
22
 
23
- export class V1_TdsOlapAggregation extends V1_ValueSpecification {
23
+ export class V1_TDSOlapAggregation extends V1_ValueSpecification {
24
24
  function!: V1_Lambda;
25
25
  columnName!: string;
26
26
 
27
27
  accept_ValueSpecificationVisitor<T>(
28
28
  visitor: V1_ValueSpecificationVisitor<T>,
29
29
  ): T {
30
- return visitor.visit_TdsOlapAggregation(this);
30
+ return visitor.visit_TDSOlapAggregation(this);
31
31
  }
32
32
  }
@@ -17,15 +17,15 @@
17
17
  import {
18
18
  type V1_ValueSpecificationVisitor,
19
19
  V1_ValueSpecification,
20
- } from '../../../model/valueSpecification/V1_ValueSpecification.js';
20
+ } from '../V1_ValueSpecification.js';
21
21
  import type { V1_Lambda } from './V1_Lambda.js';
22
22
 
23
- export class V1_TdsOlapRank extends V1_ValueSpecification {
23
+ export class V1_TDSOlapRank extends V1_ValueSpecification {
24
24
  function!: V1_Lambda;
25
25
 
26
26
  accept_ValueSpecificationVisitor<T>(
27
27
  visitor: V1_ValueSpecificationVisitor<T>,
28
28
  ): T {
29
- return visitor.visit_TdsOlapRank(this);
29
+ return visitor.visit_TDSOlapRank(this);
30
30
  }
31
31
  }
@@ -67,6 +67,7 @@ import { V1_checkDuplicatedElement } from './V1_ElementBuilder.js';
67
67
  import type { Package } from '../../../../../../../graph/metamodel/pure/packageableElements/domain/Package.js';
68
68
  import type { V1_DataElement } from '../../../model/packageableElements/data/V1_DataElement.js';
69
69
  import { DataElement } from '../../../../../../../graph/metamodel/pure/packageableElements/data/DataElement.js';
70
+ import { V1_buildFunctionSignature } from '../../../helpers/V1_DomainHelper.js';
70
71
 
71
72
  export class V1_ElementFirstPassBuilder
72
73
  implements V1_PackageableElementVisitor<PackageableElement>
@@ -243,8 +244,9 @@ export class V1_ElementFirstPassBuilder
243
244
  element.name,
244
245
  `Function 'name' field is missing or empty`,
245
246
  );
247
+ const name = V1_buildFunctionSignature(element);
246
248
  const func = new ConcreteFunctionDefinition(
247
- element.name,
249
+ name,
248
250
  // This is just a stub to fill in when we first create the function
249
251
  PackageableElementImplicitReference.create(
250
252
  this.context.graph.getPrimitiveType(PRIMITIVE_TYPE.STRING),
@@ -254,7 +256,7 @@ export class V1_ElementFirstPassBuilder
254
256
  TYPICAL_MULTIPLICITY_TYPE.ZEROMANY,
255
257
  ),
256
258
  );
257
- const path = V1_buildFullPath(element.package, element.name);
259
+ const path = V1_buildFullPath(element.package, name);
258
260
  V1_checkDuplicatedElement(path, this.context, this.elementPathCache);
259
261
  addElementToPackage(
260
262
  getOrCreateGraphPackage(
@@ -83,6 +83,9 @@ import { V1_buildTestSuite } from './helpers/V1_TestBuilderHelper.js';
83
83
  import { ServiceTestSuite } from '../../../../../../../graph/metamodel/pure/packageableElements/service/ServiceTestSuite.js';
84
84
  import { V1_getIncludedMappingPath } from '../../../helpers/V1_DSL_Mapping_Helper.js';
85
85
  import { V1_DataElementReference } from '../../../model/data/V1_EmbeddedData.js';
86
+ import { V1_buildFunctionSignature } from '../../../helpers/V1_DomainHelper.js';
87
+ import { getFunctionName } from '../../../../../../../graph/helpers/DomainHelper.js';
88
+ import { GraphBuilderError } from '../../../../../../GraphManagerUtils.js';
86
89
 
87
90
  export class V1_ElementSecondPassBuilder
88
91
  implements V1_PackageableElementVisitor<void>
@@ -106,18 +109,17 @@ export class V1_ElementSecondPassBuilder
106
109
  const uniqueStereotypes = new Set<string>();
107
110
  profile.p_stereotypes = element.stereotypes.map((stereotype) => {
108
111
  if (uniqueStereotypes.has(stereotype)) {
112
+ const message = `Found duplicated stereotype '${stereotype}' in profile '${element.path}'`;
109
113
  /**
110
- * This test is skipped because we want to temporarily relax graph building algorithm
111
- * to ease Pure -> Legend migration push.
112
- * See https://github.com/finos/legend-studio/issues/660
114
+ * In strict-mode, graph builder will consider this as an error
115
+ * See https://github.com/finos/legend-studio/issues/941
113
116
  *
114
117
  * @discrepancy graph-building
115
118
  */
116
- this.context.log.warn(
117
- LogEvent.create(
118
- `Found duplicated stereotype '${stereotype}' in profile '${element.path}'`,
119
- ),
120
- );
119
+ if (this.context.options?.strict) {
120
+ throw new GraphBuilderError(message);
121
+ }
122
+ this.context.log.warn(LogEvent.create(message));
121
123
  }
122
124
  uniqueStereotypes.add(stereotype);
123
125
  return new Stereotype(profile, stereotype);
@@ -125,18 +127,17 @@ export class V1_ElementSecondPassBuilder
125
127
  const uniqueTags = new Set<string>();
126
128
  profile.p_tags = element.tags.map((tag) => {
127
129
  if (uniqueTags.has(tag)) {
130
+ const message = `Found duplicated tag '${tag}' in profile '${element.path}'`;
128
131
  /**
129
- * This test is skipped because we want to temporarily relax graph building algorithm
130
- * to ease Pure -> Legend migration push.
131
- * See https://github.com/finos/legend-studio/issues/660
132
+ * In strict-mode, graph builder will consider this as an error
133
+ * See https://github.com/finos/legend-studio/issues/941
132
134
  *
133
135
  * @discrepancy graph-building
134
136
  */
135
- this.context.log.warn(
136
- LogEvent.create(
137
- `Found duplicated tag '${tag}' in profile '${element.path}'`,
138
- ),
139
- );
137
+ if (this.context.options?.strict) {
138
+ throw new GraphBuilderError(message);
139
+ }
140
+ this.context.log.warn(LogEvent.create(message));
140
141
  }
141
142
  uniqueTags.add(tag);
142
143
  return new Tag(profile, tag);
@@ -160,18 +161,17 @@ export class V1_ElementSecondPassBuilder
160
161
  `Enum value 'value' field is missing or empty`,
161
162
  );
162
163
  if (uniqueEnumValues.has(enumValue.value)) {
164
+ const message = `Found duplicated value '${enumValue.value}' in enumeration '${enumeration.path}'`;
163
165
  /**
164
- * This test is skipped because we want to temporarily relax graph building algorithm
165
- * to ease Pure -> Legend migration push.
166
- * See https://github.com/finos/legend-studio/issues/660
166
+ * In strict-mode, graph builder will consider this as an error
167
+ * See https://github.com/finos/legend-studio/issues/941
167
168
  *
168
169
  * @discrepancy graph-building
169
170
  */
170
- this.context.log.warn(
171
- LogEvent.create(
172
- `Found duplicated value '${enumValue.value}' in enumeration '${enumeration.path}'`,
173
- ),
174
- );
171
+ if (this.context.options?.strict) {
172
+ throw new GraphBuilderError(message);
173
+ }
174
+ this.context.log.warn(LogEvent.create(message));
175
175
  }
176
176
  const _enum = new Enum(enumValue.value, enumeration);
177
177
  _enum.stereotypes = enumValue.stereotypes
@@ -234,7 +234,7 @@ export class V1_ElementSecondPassBuilder
234
234
  `Function 'returnMultiplicity' field is missing`,
235
235
  );
236
236
  const func = this.context.currentSubGraph.getOwnFunction(
237
- V1_buildFullPath(protocol.package, protocol.name),
237
+ V1_buildFullPath(protocol.package, V1_buildFunctionSignature(protocol)),
238
238
  );
239
239
  func.returnType = this.context.resolveType(protocol.returnType);
240
240
  func.returnMultiplicity = this.context.graph.getMultiplicity(
@@ -251,6 +251,7 @@ export class V1_ElementSecondPassBuilder
251
251
  V1_buildVariable(param, this.context),
252
252
  );
253
253
  func.expressionSequence = protocol.body;
254
+ func.functionName = getFunctionName(func, func.name);
254
255
  }
255
256
 
256
257
  visit_FlatData(element: V1_FlatData): void {
@@ -118,18 +118,17 @@ export class V1_ElementThirdPassBuilder
118
118
  const uniqueProperties = new Set<string>();
119
119
  element.properties.forEach((property) => {
120
120
  if (uniqueProperties.has(property.name)) {
121
+ const message = `Found duplicated property '${property.name}' in class '${_class.path}'`;
121
122
  /**
122
- * This test is skipped because we want to temporarily relax graph building algorithm
123
- * to ease Pure -> Legend migration push.
124
- * See https://github.com/finos/legend-studio/issues/660
123
+ * In strict-mode, graph builder will consider this as an error
124
+ * See https://github.com/finos/legend-studio/issues/941
125
125
  *
126
126
  * @discrepancy graph-building
127
127
  */
128
- this.context.log.warn(
129
- LogEvent.create(
130
- `Found duplicated property '${property.name}' in class '${_class.path}'`,
131
- ),
132
- );
128
+ if (this.context.options?.strict) {
129
+ throw new GraphBuilderError(message);
130
+ }
131
+ this.context.log.warn(LogEvent.create(message));
133
132
  }
134
133
  _class.properties.push(V1_buildProperty(property, this.context, _class));
135
134
  uniqueProperties.add(property.name);
@@ -148,18 +147,17 @@ export class V1_ElementThirdPassBuilder
148
147
  const first = guaranteeNonNullable(element.properties[0]);
149
148
  const second = guaranteeNonNullable(element.properties[1]);
150
149
  if (first.name === second.name) {
150
+ const message = `Found duplicated property '${element.properties[0]?.name}' in association '${element.path}'`;
151
151
  /**
152
- * This test is skipped because we want to temporarily relax graph building algorithm
153
- * to ease Pure -> Legend migration push.
154
- * See https://github.com/finos/legend-studio/issues/660
152
+ * In strict-mode, graph builder will consider this as an error
153
+ * See https://github.com/finos/legend-studio/issues/941
155
154
  *
156
155
  * @discrepancy graph-building
157
156
  */
158
- this.context.log.warn(
159
- LogEvent.create(
160
- `Found duplicated property '${element.properties[0]?.name}' in association '${element.name}'`,
161
- ),
162
- );
157
+ if (this.context.options?.strict) {
158
+ throw new GraphBuilderError(message);
159
+ }
160
+ this.context.log.warn(LogEvent.create(message));
163
161
  }
164
162
  association.properties = [
165
163
  V1_buildAssociationProperty(first, second, this.context, association),