@finos/legend-application-studio 20.0.2 → 20.0.4

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 (81) hide show
  1. package/lib/components/editor/edit-panel/FunctionEditor.d.ts.map +1 -1
  2. package/lib/components/editor/edit-panel/FunctionEditor.js +2 -3
  3. package/lib/components/editor/edit-panel/FunctionEditor.js.map +1 -1
  4. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
  5. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js +2 -2
  6. package/lib/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
  7. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.d.ts.map +1 -1
  8. package/lib/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.js.map +1 -1
  9. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
  10. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js +3 -7
  11. package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js.map +1 -1
  12. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.d.ts.map +1 -1
  13. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js +2 -2
  14. package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.js.map +1 -1
  15. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.d.ts.map +1 -1
  16. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js +2 -2
  17. package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js.map +1 -1
  18. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
  19. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.js +2 -2
  20. package/lib/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.js.map +1 -1
  21. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.d.ts.map +1 -1
  22. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +4 -5
  23. package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
  24. package/lib/index.css +1 -1
  25. package/lib/package.json +2 -2
  26. package/lib/stores/EditorGraphState.d.ts +7 -0
  27. package/lib/stores/EditorGraphState.d.ts.map +1 -1
  28. package/lib/stores/EditorGraphState.js +32 -6
  29. package/lib/stores/EditorGraphState.js.map +1 -1
  30. package/lib/stores/editor/NewElementState.d.ts +1 -1
  31. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  32. package/lib/stores/editor/NewElementState.js +3 -3
  33. package/lib/stores/editor/NewElementState.js.map +1 -1
  34. package/lib/stores/editor-state/element-editor-state/RuntimeEditorState.d.ts.map +1 -1
  35. package/lib/stores/editor-state/element-editor-state/RuntimeEditorState.js +3 -3
  36. package/lib/stores/editor-state/element-editor-state/RuntimeEditorState.js.map +1 -1
  37. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
  38. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js +2 -2
  39. package/lib/stores/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  40. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.d.ts.map +1 -1
  41. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js +2 -2
  42. package/lib/stores/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
  43. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.d.ts.map +1 -1
  44. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js +2 -2
  45. package/lib/stores/editor-state/element-editor-state/mapping/MappingTestState.js.map +1 -1
  46. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +2 -2
  47. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
  48. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js +13 -20
  49. package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  50. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
  51. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js +8 -8
  52. package/lib/stores/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
  53. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
  54. package/lib/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
  55. package/lib/stores/shared/MockDataUtils.d.ts +3 -2
  56. package/lib/stores/shared/MockDataUtils.d.ts.map +1 -1
  57. package/lib/stores/shared/MockDataUtils.js.map +1 -1
  58. package/lib/stores/shared/modifier/DSL_Mapping_GraphModifierHelper.d.ts +1 -1
  59. package/lib/stores/shared/modifier/DSL_Mapping_GraphModifierHelper.d.ts.map +1 -1
  60. package/lib/stores/shared/modifier/DSL_Mapping_GraphModifierHelper.js +2 -2
  61. package/lib/stores/shared/modifier/DSL_Mapping_GraphModifierHelper.js.map +1 -1
  62. package/package.json +11 -11
  63. package/src/components/editor/edit-panel/FunctionEditor.tsx +1 -5
  64. package/src/components/editor/edit-panel/connection-editor/RelationalDatabaseConnectionEditor.tsx +17 -11
  65. package/src/components/editor/edit-panel/element-generation-editor/FileGenerationEditor.tsx +9 -14
  66. package/src/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.tsx +3 -12
  67. package/src/components/editor/edit-panel/mapping-editor/InstanceSetImplementationEditor.tsx +2 -4
  68. package/src/components/editor/edit-panel/mapping-editor/NewMappingElementModal.tsx +2 -4
  69. package/src/components/editor/edit-panel/service-editor/testable/ServiceTestsEditor.tsx +2 -4
  70. package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +6 -9
  71. package/src/stores/EditorGraphState.ts +38 -6
  72. package/src/stores/editor/NewElementState.ts +6 -14
  73. package/src/stores/editor-state/element-editor-state/RuntimeEditorState.ts +3 -7
  74. package/src/stores/editor-state/element-editor-state/mapping/MappingEditorState.ts +2 -4
  75. package/src/stores/editor-state/element-editor-state/mapping/MappingExecutionState.ts +2 -3
  76. package/src/stores/editor-state/element-editor-state/mapping/MappingTestState.ts +2 -3
  77. package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +14 -27
  78. package/src/stores/editor-state/element-editor-state/service/ServiceRegistrationState.ts +10 -12
  79. package/src/stores/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +2 -1
  80. package/src/stores/shared/MockDataUtils.ts +4 -8
  81. package/src/stores/shared/modifier/DSL_Mapping_GraphModifierHelper.ts +3 -3
@@ -29,6 +29,7 @@ import {
29
29
  UnsupportedOperationError,
30
30
  debounce,
31
31
  guaranteeNonNullable,
32
+ type PlainObject,
32
33
  } from '@finos/legend-shared';
33
34
  import {
34
35
  type TreeNodeContainerProps,
@@ -584,7 +585,7 @@ const GenerationStringPropertyEditor = observer(
584
585
  isReadOnly: boolean;
585
586
  update: (
586
587
  AbstractGenerationProperty: GenerationProperty,
587
- newValue: Record<PropertyKey, unknown>,
588
+ newValue: PlainObject,
588
589
  ) => void;
589
590
  getConfigValue: (name: string) => unknown | undefined;
590
591
  }) => {
@@ -595,10 +596,7 @@ const GenerationStringPropertyEditor = observer(
595
596
  const value =
596
597
  (getConfigValue(property.name) as string | undefined) ?? defaultValue;
597
598
  const changeValue: React.ChangeEventHandler<HTMLInputElement> = (event) =>
598
- update(
599
- property,
600
- event.target.value as unknown as Record<PropertyKey, unknown>,
601
- );
599
+ update(property, event.target.value as unknown as PlainObject);
602
600
  return (
603
601
  <div className="panel__content__form__section">
604
602
  <div className="panel__content__form__section__header__label">
@@ -625,7 +623,7 @@ const GenerationIntegerPropertyEditor = observer(
625
623
  isReadOnly: boolean;
626
624
  update: (
627
625
  AbstractGenerationProperty: GenerationProperty,
628
- newValue: Record<PropertyKey, unknown>,
626
+ newValue: PlainObject,
629
627
  ) => void;
630
628
  getConfigValue: (name: string) => unknown | undefined;
631
629
  }) => {
@@ -636,10 +634,7 @@ const GenerationIntegerPropertyEditor = observer(
636
634
  const value =
637
635
  (getConfigValue(property.name) as number | undefined) ?? defaultValue;
638
636
  const changeValue: React.ChangeEventHandler<HTMLInputElement> = (event) =>
639
- update(
640
- property,
641
- event.target.value as unknown as Record<PropertyKey, unknown>,
642
- );
637
+ update(property, event.target.value as unknown as PlainObject);
643
638
  return (
644
639
  <div className="panel__content__form__section">
645
640
  <div className="panel__content__form__section__header__label">
@@ -667,7 +662,7 @@ const GenerationBooleanPropertyEditor = observer(
667
662
  isReadOnly: boolean;
668
663
  update: (
669
664
  AbstractGenerationProperty: GenerationProperty,
670
- newValue: Record<PropertyKey, unknown>,
665
+ newValue: PlainObject,
671
666
  ) => void;
672
667
  getConfigValue: (name: string) => unknown | undefined;
673
668
  }) => {
@@ -679,7 +674,7 @@ const GenerationBooleanPropertyEditor = observer(
679
674
  (getConfigValue(property.name) as boolean | undefined) ?? defaultValue;
680
675
  const toggle = (): void => {
681
676
  if (!isReadOnly) {
682
- update(property, !value as unknown as Record<PropertyKey, unknown>);
677
+ update(property, !value as unknown as PlainObject);
683
678
  }
684
679
  };
685
680
  return (
@@ -717,7 +712,7 @@ const GenerationEnumPropertyEditor = observer(
717
712
  isReadOnly: boolean;
718
713
  update: (
719
714
  AbstractGenerationProperty: GenerationProperty,
720
- newValue: Record<PropertyKey, unknown>,
715
+ newValue: PlainObject,
721
716
  ) => void;
722
717
  getConfigValue: (name: string) => unknown | undefined;
723
718
  }) => {
@@ -735,7 +730,7 @@ const GenerationEnumPropertyEditor = observer(
735
730
  property.defaultValue;
736
731
  const onChange = (val: { label: string; value: string } | null): void => {
737
732
  if (val !== null && val.value !== value) {
738
- update(property, val.value as unknown as Record<PropertyKey, unknown>);
733
+ update(property, val.value as unknown as PlainObject);
739
734
  }
740
735
  };
741
736
  return (
@@ -54,7 +54,6 @@ import {
54
54
  } from '../../../../stores/editor-state/element-editor-state/mapping/MappingElementDecorator.js';
55
55
  import { useEditorStore } from '../../EditorStoreProvider.js';
56
56
  import {
57
- PRIMITIVE_TYPE,
58
57
  Type,
59
58
  Enum,
60
59
  Enumeration,
@@ -64,6 +63,7 @@ import {
64
63
  type PackageableElementReference,
65
64
  getEnumValueNames,
66
65
  PackageableElementExplicitReference,
66
+ PrimitiveType,
67
67
  } from '@finos/legend-graph';
68
68
  import {
69
69
  enumerationMapping_updateSourceType,
@@ -85,14 +85,7 @@ const EnumerationMappingSourceSelectorModal = observer(
85
85
  }) => {
86
86
  const { enumerationMapping, closeModal, open } = props;
87
87
  const editorStore = useEditorStore();
88
- const options = [
89
- editorStore.graphManagerState.graph.getPrimitiveType(
90
- PRIMITIVE_TYPE.INTEGER,
91
- ),
92
- editorStore.graphManagerState.graph.getPrimitiveType(
93
- PRIMITIVE_TYPE.STRING,
94
- ),
95
- ]
88
+ const options = [PrimitiveType.INTEGER, PrimitiveType.STRING]
96
89
  .map(buildElementOption)
97
90
  .concat(
98
91
  editorStore.graphManagerState.usableEnumerations.map(
@@ -177,8 +170,6 @@ export const SourceValueInput = observer(
177
170
  expectedType,
178
171
  isReadOnly,
179
172
  } = props;
180
- const inputType =
181
- expectedType?.name === PRIMITIVE_TYPE.INTEGER ? 'number' : 'text';
182
173
  const value =
183
174
  sourceValue.value instanceof Enum
184
175
  ? sourceValue.value.name
@@ -248,7 +239,7 @@ export const SourceValueInput = observer(
248
239
  onChange={onChange}
249
240
  onBlur={onBlur}
250
241
  placeholder="Source value"
251
- type={inputType}
242
+ type={expectedType === PrimitiveType.INTEGER ? 'number' : 'text'}
252
243
  />
253
244
  <div className="enumeration-mapping-editor__enum-value__source-value__info">
254
245
  <div className="enumeration-mapping-editor__enum-value__source-value__expected-return-type">
@@ -79,12 +79,12 @@ import {
79
79
  RootFlatDataRecordType,
80
80
  Table,
81
81
  Database,
82
- PRIMITIVE_TYPE,
83
82
  TableAlias,
84
83
  TableExplicitReference,
85
84
  ViewExplicitReference,
86
85
  getAllRecordTypes,
87
86
  getAllClassProperties,
87
+ PrimitiveType,
88
88
  } from '@finos/legend-graph';
89
89
  import type { EditorStore } from '../../../../stores/EditorStore.js';
90
90
  import type { DSL_Mapping_LegendStudioApplicationPlugin_Extension } from '../../../../stores/DSL_Mapping_LegendStudioApplicationPlugin_Extension.js';
@@ -411,9 +411,7 @@ const MappingFilterEditor = observer(
411
411
  forceBackdrop={!!filterState.parserError}
412
412
  forceExpansion={false}
413
413
  lambdaEditorState={filterState}
414
- expectedType={editorStore.graphManagerState.graph.getPrimitiveType(
415
- PRIMITIVE_TYPE.BOOLEAN,
416
- )}
414
+ expectedType={PrimitiveType.BOOLEAN}
417
415
  />
418
416
  </div>
419
417
  </div>
@@ -37,11 +37,11 @@ import {
37
37
  import { useEditorStore } from '../../EditorStoreProvider.js';
38
38
  import {
39
39
  type PackageableElement,
40
- PRIMITIVE_TYPE,
41
40
  fromElementPathToMappingElementId,
42
41
  Class,
43
42
  Enumeration,
44
43
  Association,
44
+ PrimitiveType,
45
45
  } from '@finos/legend-graph';
46
46
  import { BASIC_SET_IMPLEMENTATION_TYPE } from '../../../../stores/shared/ModelClassifierUtils.js';
47
47
  import {
@@ -169,9 +169,7 @@ export const NewMappingElementModal = observer(() => {
169
169
  mapping,
170
170
  id,
171
171
  spec.target,
172
- editorStore.graphManagerState.graph.getPrimitiveType(
173
- PRIMITIVE_TYPE.STRING,
174
- ),
172
+ PrimitiveType.STRING,
175
173
  );
176
174
  } else if (spec.target instanceof Association) {
177
175
  throw new UnsupportedOperationError();
@@ -35,7 +35,7 @@ import {
35
35
  RefreshIcon,
36
36
  TimesIcon,
37
37
  } from '@finos/legend-art';
38
- import { type ValueSpecification, PRIMITIVE_TYPE } from '@finos/legend-graph';
38
+ import { type ValueSpecification, PrimitiveType } from '@finos/legend-graph';
39
39
  import { BasicValueSpecificationEditor } from '@finos/legend-query-builder';
40
40
  import {
41
41
  filterByType,
@@ -242,9 +242,7 @@ const ServiceTestParameterEditor = observer(
242
242
  typeCheckOption={{
243
243
  expectedType:
244
244
  paramState.varExpression.genericType?.value.rawType ??
245
- setupState.editorStore.graphManagerState.graph.getPrimitiveType(
246
- PRIMITIVE_TYPE.STRING,
247
- ),
245
+ PrimitiveType.STRING,
248
246
  }}
249
247
  className="query-builder__parameters__value__editor"
250
248
  resetValue={(): void => {
@@ -69,7 +69,6 @@ import {
69
69
  type Constraint,
70
70
  type Property,
71
71
  type DerivedProperty,
72
- PRIMITIVE_TYPE,
73
72
  MULTIPLICITY_INFINITE,
74
73
  Class,
75
74
  GenericType,
@@ -979,9 +978,7 @@ const ConstraintEditor = observer(
979
978
  }
980
979
  lambdaEditorState={constraintState}
981
980
  forceBackdrop={hasParserError}
982
- expectedType={editorStore.graphManagerState.graph.getPrimitiveType(
983
- PRIMITIVE_TYPE.BOOLEAN,
984
- )}
981
+ expectedType={PrimitiveType.BOOLEAN}
985
982
  onEditorFocus={onLambdaEditorFocus}
986
983
  />
987
984
  </div>
@@ -1556,9 +1553,6 @@ export const ClassFormEditor = observer(
1556
1553
  ); // attempting to read the hashCode of immutable element will throw an error
1557
1554
  const classState = editorState.classState;
1558
1555
  const isReadOnly = editorState.isReadOnly;
1559
- const defaultType = editorStore.graphManagerState.graph.getPrimitiveType(
1560
- PRIMITIVE_TYPE.STRING,
1561
- );
1562
1556
 
1563
1557
  // Tab
1564
1558
  const selectedTab = editorState.selectedTab;
@@ -1621,9 +1615,12 @@ export const ClassFormEditor = observer(
1621
1615
  const add = (): void => {
1622
1616
  if (!isReadOnly) {
1623
1617
  if (selectedTab === UML_EDITOR_TAB.PROPERTIES) {
1624
- class_addProperty(_class, stub_Property(defaultType, _class));
1618
+ class_addProperty(
1619
+ _class,
1620
+ stub_Property(PrimitiveType.STRING, _class),
1621
+ );
1625
1622
  } else if (selectedTab === UML_EDITOR_TAB.DERIVED_PROPERTIES) {
1626
- const dp = stub_DerivedProperty(defaultType, _class);
1623
+ const dp = stub_DerivedProperty(PrimitiveType.STRING, _class);
1627
1624
  class_addDerivedProperty(_class, dp);
1628
1625
  classState.addDerivedPropertyState(dp);
1629
1626
  } else if (selectedTab === UML_EDITOR_TAB.CONSTRAINTS) {
@@ -186,6 +186,28 @@ export class EditorGraphState {
186
186
  return [this.error, ...this.warnings].filter(isNonNullable);
187
187
  }
188
188
 
189
+ /**
190
+ * This function is temporary. There is no good way to detect if a problem not coming from
191
+ * the main graph at the moment. In text mode, we can rely on the fact that the source information
192
+ * has line 0 column 0. But this is not the case for form mode, so this is just temporary
193
+ * to help with text-mode.
194
+ */
195
+ TEMPORARY__removeDependencyProblems(
196
+ problems: Problem[] | CompilationWarning[],
197
+ ): Problem[] | CompilationWarning[] {
198
+ return problems.filter((problem) => {
199
+ if (problem.sourceInformation) {
200
+ return !(
201
+ problem.sourceInformation.startLine === 0 &&
202
+ problem.sourceInformation.startColumn === 0 &&
203
+ problem.sourceInformation.endLine === 0 &&
204
+ problem.sourceInformation.endColumn === 0
205
+ );
206
+ }
207
+ return true;
208
+ });
209
+ }
210
+
189
211
  get areProblemsStale(): boolean {
190
212
  return (
191
213
  (this.editorStore.isInFormMode &&
@@ -550,7 +572,10 @@ export class EditorGraphState {
550
572
  },
551
573
  )) as CompilationResult;
552
574
 
553
- this.warnings = compilationResult.warnings ?? [];
575
+ this.warnings = compilationResult.warnings
576
+ ? this.TEMPORARY__removeDependencyProblems(compilationResult.warnings)
577
+ : [];
578
+
554
579
  this.mostRecentFormModeCompilationGraphHash = currentGraphHash;
555
580
 
556
581
  if (!options?.disableNotificationOnSuccess) {
@@ -688,7 +713,9 @@ export class EditorGraphState {
688
713
 
689
714
  const entities = compilationResult.entities;
690
715
  this.mostRecentTextModeCompilationGraphHash = currentGraphHash;
691
- this.warnings = compilationResult.warnings ?? [];
716
+ this.warnings = compilationResult.warnings
717
+ ? this.TEMPORARY__removeDependencyProblems(compilationResult.warnings)
718
+ : [];
692
719
 
693
720
  if (!options?.disableNotificationOnSuccess) {
694
721
  if (this.warnings.length) {
@@ -759,7 +786,9 @@ export class EditorGraphState {
759
786
  },
760
787
  )) as TextCompilationResult;
761
788
 
762
- this.warnings = compilationResult.warnings ?? [];
789
+ this.warnings = compilationResult.warnings
790
+ ? this.TEMPORARY__removeDependencyProblems(compilationResult.warnings)
791
+ : [];
763
792
  this.editorStore.applicationStore.setBlockingAlert({
764
793
  message: 'Leaving text mode and rebuilding graph...',
765
794
  showLoading: true,
@@ -1222,9 +1251,12 @@ export class EditorGraphState {
1222
1251
  ): Promise<ProjectDependencyCoordinates[]> {
1223
1252
  return Promise.all(
1224
1253
  projectDependencies.map((dep) => {
1225
- // legacyDependencies
1226
- // We do this for backward compatible reasons as we expect current dependency ids to be in the format of {groupId}:{artifactId}.
1227
- // For the legacy dependency we must fetch the corresponding coordinates (group, artifact ids) from the depot server
1254
+ /**
1255
+ * We expect current dependency ids to be in the format of {groupId}:{artifactId}.
1256
+ * For the legacy dependency we must fetch the corresponding coordinates (group, artifact ids) from the depot server
1257
+ *
1258
+ * @backwardCompatibility
1259
+ */
1228
1260
  if (dep.isLegacyDependency) {
1229
1261
  return this.editorStore.depotServerClient
1230
1262
  .getProjectById(dep.projectId)
@@ -41,11 +41,9 @@ import {
41
41
  type PackageableElement,
42
42
  type Runtime,
43
43
  type Store,
44
- type ModelStore,
44
+ ModelStore,
45
45
  type Connection,
46
46
  type PureModelConnection,
47
- PRIMITIVE_TYPE,
48
- TYPICAL_MULTIPLICITY_TYPE,
49
47
  ELEMENT_PATH_DELIMITER,
50
48
  Package,
51
49
  Class,
@@ -74,6 +72,8 @@ import {
74
72
  DataElement,
75
73
  stub_Database,
76
74
  Measure,
75
+ Multiplicity,
76
+ PrimitiveType,
77
77
  } from '@finos/legend-graph';
78
78
  import type { DSL_Mapping_LegendStudioApplicationPlugin_Extension } from '../DSL_Mapping_LegendStudioApplicationPlugin_Extension.js';
79
79
  import {
@@ -414,9 +414,7 @@ export class NewPackageableConnectionDriver extends NewElementDriver<Packageable
414
414
  const connection = new PackageableConnection(name);
415
415
  packageableConnection_setConnectionValue(
416
416
  connection,
417
- this.newConnectionValueDriver.createConnection(
418
- this.store ?? this.editorStore.graphManagerState.graph.modelStore,
419
- ),
417
+ this.newConnectionValueDriver.createConnection(ModelStore.INSTANCE),
420
418
  this.editorStore.changeDetectionState.observerContext,
421
419
  ); // default to model store
422
420
  return connection;
@@ -786,14 +784,8 @@ export class NewElementState {
786
784
  case PACKAGEABLE_ELEMENT_TYPE.FUNCTION: {
787
785
  const fn = new ConcreteFunctionDefinition(
788
786
  name,
789
- PackageableElementExplicitReference.create(
790
- this.editorStore.graphManagerState.graph.getPrimitiveType(
791
- PRIMITIVE_TYPE.STRING,
792
- ),
793
- ),
794
- this.editorStore.graphManagerState.graph.getTypicalMultiplicity(
795
- TYPICAL_MULTIPLICITY_TYPE.ONE,
796
- ),
787
+ PackageableElementExplicitReference.create(PrimitiveType.STRING),
788
+ Multiplicity.ONE,
797
789
  );
798
790
  // default to empty string
799
791
  fn.expressionSequence =
@@ -85,7 +85,7 @@ export const getClassMappingStore = (
85
85
  editorStore.pluginManager.getApplicationPlugins(),
86
86
  );
87
87
  if (sourceElement instanceof Class) {
88
- return editorStore.graphManagerState.graph.modelStore;
88
+ return ModelStore.INSTANCE;
89
89
  } else if (sourceElement instanceof RootFlatDataRecordType) {
90
90
  return sourceElement._OWNER._OWNER;
91
91
  } else if (sourceElement instanceof TableAlias) {
@@ -186,9 +186,7 @@ export const decorateRuntimeWithNewMapping = (
186
186
  new IdentifiedConnection(
187
187
  generateIdentifiedConnectionId(runtimeValue),
188
188
  new JsonModelConnection(
189
- PackageableElementExplicitReference.create(
190
- editorStore.graphManagerState.graph.modelStore,
191
- ),
189
+ PackageableElementExplicitReference.create(ModelStore.INSTANCE),
192
190
  PackageableElementExplicitReference.create(_class),
193
191
  ),
194
192
  ),
@@ -597,9 +595,7 @@ export class IdentifiedConnectionsPerClassEditorTabState extends IdentifiedConne
597
595
 
598
596
  createDefaultConnection(): Connection {
599
597
  return new JsonModelConnection(
600
- PackageableElementExplicitReference.create(
601
- this.editorStore.graphManagerState.graph.modelStore,
602
- ),
598
+ PackageableElementExplicitReference.create(ModelStore.INSTANCE),
603
599
  PackageableElementExplicitReference.create(this.class),
604
600
  );
605
601
  }
@@ -64,7 +64,6 @@ import {
64
64
  type EmbeddedSetImplementation,
65
65
  getAllClassMappings,
66
66
  GRAPH_MANAGER_EVENT,
67
- PRIMITIVE_TYPE,
68
67
  fromElementPathToMappingElementId,
69
68
  extractSourceInformationCoordinates,
70
69
  getAllEnumerationMappings,
@@ -98,6 +97,7 @@ import {
98
97
  InferableMappingElementRootExplicitValue,
99
98
  stub_Class,
100
99
  findPropertyMapping,
100
+ PrimitiveType,
101
101
  } from '@finos/legend-graph';
102
102
  import type {
103
103
  DSL_Mapping_LegendStudioApplicationPlugin_Extension,
@@ -1099,9 +1099,7 @@ export class MappingEditorState extends ElementEditorState {
1099
1099
  this.mapping,
1100
1100
  suggestedId,
1101
1101
  spec.target,
1102
- this.editorStore.graphManagerState.graph.getPrimitiveType(
1103
- PRIMITIVE_TYPE.STRING,
1104
- ),
1102
+ PrimitiveType.STRING,
1105
1103
  );
1106
1104
  }
1107
1105
  // NOTE: we don't support association now, nor do we support this for class
@@ -98,6 +98,7 @@ import {
98
98
  TestData,
99
99
  ConnectionTestData,
100
100
  DEFAULT_TEST_SUITE_PREFIX,
101
+ ModelStore,
101
102
  } from '@finos/legend-graph';
102
103
  import {
103
104
  ActionAlertActionType,
@@ -301,9 +302,7 @@ export class MappingExecutionObjectInputDataState extends MappingExecutionInputD
301
302
  return createRuntimeForExecution(
302
303
  this.mapping,
303
304
  new JsonModelConnection(
304
- PackageableElementExplicitReference.create(
305
- this.editorStore.graphManagerState.graph.modelStore,
306
- ),
305
+ PackageableElementExplicitReference.create(ModelStore.INSTANCE),
307
306
  PackageableElementExplicitReference.create(
308
307
  guaranteeNonNullable(this.inputData.sourceClass.value),
309
308
  ),
@@ -76,6 +76,7 @@ import {
76
76
  stub_Class,
77
77
  generateIdentifiedConnectionId,
78
78
  DEPRECATED__validate_MappingTest,
79
+ ModelStore,
79
80
  } from '@finos/legend-graph';
80
81
  import { ExecutionPlanState, TAB_SIZE } from '@finos/legend-application';
81
82
  import { flatData_setData } from '../../../shared/modifier/STO_FlatData_GraphModifierHelper.js';
@@ -233,9 +234,7 @@ export class MappingTestObjectInputDataState extends MappingTestInputDataState {
233
234
  PackageableElementExplicitReference.create(this.mapping),
234
235
  );
235
236
  const connection = new JsonModelConnection(
236
- PackageableElementExplicitReference.create(
237
- this.editorStore.graphManagerState.graph.modelStore,
238
- ),
237
+ PackageableElementExplicitReference.create(ModelStore.INSTANCE),
239
238
  PackageableElementExplicitReference.create(
240
239
  this.inputData.sourceClass.value,
241
240
  ),
@@ -23,6 +23,7 @@ import {
23
23
  stringifyLosslessJSON,
24
24
  UnsupportedOperationError,
25
25
  filterByType,
26
+ guaranteeNonNullable,
26
27
  } from '@finos/legend-shared';
27
28
  import type { ServiceEditorState } from './ServiceEditorState.js';
28
29
  import {
@@ -60,9 +61,9 @@ import {
60
61
  buildLambdaVariableExpressions,
61
62
  observe_ValueSpecification,
62
63
  VariableExpression,
63
- buildRawLambdaFromLambdaFunction,
64
64
  stub_PackageableRuntime,
65
65
  stub_Mapping,
66
+ ParameterValue,
66
67
  } from '@finos/legend-graph';
67
68
  import { type Entity, parseGACoordinates } from '@finos/legend-storage';
68
69
  import { runtime_addMapping } from '../../../shared/modifier/DSL_Mapping_GraphModifierHelper.js';
@@ -78,7 +79,6 @@ import {
78
79
  service_setExecution,
79
80
  } from '../../../shared/modifier/DSL_Service_GraphModifierHelper.js';
80
81
  import {
81
- buildParametersLetLambdaFunc,
82
82
  LambdaEditorState,
83
83
  LambdaParametersState,
84
84
  LambdaParameterState,
@@ -578,15 +578,15 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
578
578
  }
579
579
  try {
580
580
  this.isRunningQuery = true;
581
- const query = this.getExecutionQuery();
582
581
  const promise =
583
582
  this.editorStore.graphManagerState.graphManager.executeMapping(
584
- query,
583
+ this.queryState.query,
585
584
  this.selectedExecutionContextState.executionContext.mapping.value,
586
585
  this.selectedExecutionContextState.executionContext.runtime,
587
586
  this.editorStore.graphManagerState.graph,
588
587
  {
589
588
  useLosslessParse: true,
589
+ parameterValues: this.buildExecutionParameterValues(),
590
590
  },
591
591
  );
592
592
  this.setQueryRunPromise(promise);
@@ -609,29 +609,16 @@ export abstract class ServicePureExecutionState extends ServiceExecutionState {
609
609
  }
610
610
  }
611
611
 
612
- getExecutionQuery(): RawLambda {
613
- if (this.parameterState.parameterStates.length) {
614
- const letlambdaFunction = buildParametersLetLambdaFunc(
615
- this.editorStore.graphManagerState.graph,
616
- this.parameterState.parameterStates,
617
- );
618
- const letRawLambda = buildRawLambdaFromLambdaFunction(
619
- letlambdaFunction,
620
- this.editorStore.graphManagerState,
621
- );
622
- // reset parameters
623
- if (
624
- Array.isArray(this.queryState.query.body) &&
625
- Array.isArray(letRawLambda.body)
626
- ) {
627
- letRawLambda.body = [
628
- ...(letRawLambda.body as object[]),
629
- ...(this.queryState.query.body as object[]),
630
- ];
631
- return letRawLambda;
632
- }
633
- }
634
- return this.queryState.query;
612
+ buildExecutionParameterValues(): ParameterValue[] {
613
+ return this.parameterState.parameterStates.map((queryParamState) => {
614
+ const paramValue = new ParameterValue();
615
+ paramValue.name = queryParamState.parameter.name;
616
+ paramValue.value =
617
+ this.editorStore.graphManagerState.graphManager.serializeValueSpecification(
618
+ guaranteeNonNullable(queryParamState.value),
619
+ );
620
+ return paramValue;
621
+ });
635
622
  }
636
623
 
637
624
  get serviceExecutionParameters():
@@ -40,9 +40,9 @@ import {
40
40
  ServiceExecutionMode,
41
41
  buildLambdaVariableExpressions,
42
42
  VariableExpression,
43
- TYPICAL_MULTIPLICITY_TYPE,
44
43
  generateMultiplicityString,
45
- multiplicityComparator,
44
+ areMultiplicitiesEqual,
45
+ Multiplicity,
46
46
  } from '@finos/legend-graph';
47
47
  import { ServiceRegistrationEnvironmentConfig } from '../../../../application/LegendStudioApplicationConfig.js';
48
48
  import {
@@ -336,13 +336,11 @@ export class ServiceRegistrationState {
336
336
  }
337
337
 
338
338
  // validate service parameter multiplicities
339
- const supportedServiceParamMultiplicties = [
340
- TYPICAL_MULTIPLICITY_TYPE.ONE,
341
- TYPICAL_MULTIPLICITY_TYPE.ZEROMANY,
342
- TYPICAL_MULTIPLICITY_TYPE.ZEROONE,
343
- ].map((p) =>
344
- this.editorStore.graphManagerState.graph.getTypicalMultiplicity(p),
345
- );
339
+ const SUPPORTED_SERVICE_PARAMETER_MULTIPLICITIES = [
340
+ Multiplicity.ONE,
341
+ Multiplicity.ZERO_MANY,
342
+ Multiplicity.ZERO_ONE,
343
+ ];
346
344
  const invalidParams = buildLambdaVariableExpressions(
347
345
  (this.service.execution as PureExecution).func,
348
346
  this.editorStore.graphManagerState,
@@ -350,8 +348,8 @@ export class ServiceRegistrationState {
350
348
  .filter(filterByType(VariableExpression))
351
349
  .filter(
352
350
  (p) =>
353
- !supportedServiceParamMultiplicties.some((m) =>
354
- multiplicityComparator(m, p.multiplicity),
351
+ !SUPPORTED_SERVICE_PARAMETER_MULTIPLICITIES.some((m) =>
352
+ areMultiplicitiesEqual(m, p.multiplicity),
355
353
  ),
356
354
  );
357
355
  assertTrue(
@@ -362,7 +360,7 @@ export class ServiceRegistrationState {
362
360
  p.multiplicity.lowerBound,
363
361
  p.multiplicity.upperBound,
364
362
  )}]`,
365
- )} has/have unsupported multiplicity. Supported multiplicities include ${supportedServiceParamMultiplicties.map(
363
+ )} has/have unsupported multiplicity. Supported multiplicities include ${SUPPORTED_SERVICE_PARAMETER_MULTIPLICITIES.map(
366
364
  (m) => ` [${generateMultiplicityString(m.lowerBound, m.upperBound)}]`,
367
365
  )}.`,
368
366
  );
@@ -43,6 +43,7 @@ import {
43
43
  isNonNullable,
44
44
  returnUndefOnError,
45
45
  uuid,
46
+ type PlainObject,
46
47
  } from '@finos/legend-shared';
47
48
  import type { EditorStore } from '../../../../EditorStore.js';
48
49
  import { generateVariableExpressionMockValue } from '@finos/legend-query-builder';
@@ -304,7 +305,7 @@ export class ServiceTestSetupState {
304
305
  return paramValues.map((pValue) => {
305
306
  const spec = returnUndefOnError(() =>
306
307
  this.editorStore.graphManagerState.graphManager.buildValueSpecification(
307
- pValue.value as Record<PropertyKey, unknown>,
308
+ pValue.value as PlainObject,
308
309
  this.editorStore.graphManagerState.graph,
309
310
  ),
310
311
  );
@@ -20,6 +20,7 @@ import {
20
20
  formatDate,
21
21
  Randomizer,
22
22
  UnsupportedOperationError,
23
+ type PlainObject,
23
24
  } from '@finos/legend-shared';
24
25
  import type { EditorStore } from '../EditorStore.js';
25
26
  import {
@@ -85,19 +86,14 @@ export const createMockClassInstance = (
85
86
  _class: Class,
86
87
  traverseNonRequiredProperties = false,
87
88
  depth = 0,
88
- ): Record<PropertyKey, unknown> => {
89
+ ): PlainObject => {
89
90
  const properties = traverseNonRequiredProperties
90
91
  ? getAllClassProperties(_class)
91
92
  : getAllClassProperties(_class).filter((p) => p.multiplicity.lowerBound);
92
93
  const mockData: Record<string, object | string | number | boolean> = {};
93
94
  properties.forEach((property) => {
94
95
  const propertyType = property.genericType.value.rawType;
95
- let propertyMockData:
96
- | Record<PropertyKey, unknown>
97
- | string
98
- | number
99
- | boolean
100
- | undefined;
96
+ let propertyMockData: PlainObject | string | number | boolean | undefined;
101
97
  switch (getClassPropertyType(propertyType)) {
102
98
  case CLASS_PROPERTY_TYPE.PRIMITIVE:
103
99
  propertyMockData = createMockPrimitiveProperty(
@@ -163,7 +159,7 @@ export const createMockDataForClass = (
163
159
  element: Class,
164
160
  maxDepth = 100,
165
161
  depthForCycle = 3,
166
- ): Record<PropertyKey, unknown> => {
162
+ ): PlainObject => {
167
163
  const depth = classHasCycle(element, true, new Set<string>())
168
164
  ? Math.max(depthForCycle, 0)
169
165
  : Math.max(maxDepth, 0);