@finos/legend-graph 14.0.0 → 14.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/lib/graph/Core_HashUtils.d.ts +1 -0
  2. package/lib/graph/Core_HashUtils.d.ts.map +1 -1
  3. package/lib/graph/Core_HashUtils.js +1 -0
  4. package/lib/graph/Core_HashUtils.js.map +1 -1
  5. package/lib/graph/helpers/DomainHelper.d.ts +4 -0
  6. package/lib/graph/helpers/DomainHelper.d.ts.map +1 -1
  7. package/lib/graph/helpers/DomainHelper.js +9 -1
  8. package/lib/graph/helpers/DomainHelper.js.map +1 -1
  9. package/lib/graph/helpers/ValueSpecificationHelper.d.ts +1 -1
  10. package/lib/graph/helpers/ValueSpecificationHelper.d.ts.map +1 -1
  11. package/lib/graph/helpers/ValueSpecificationHelper.js +4 -2
  12. package/lib/graph/helpers/ValueSpecificationHelper.js.map +1 -1
  13. package/lib/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.js +1 -1
  14. package/lib/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.js.map +1 -1
  15. package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.d.ts +1 -1
  16. package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.d.ts.map +1 -1
  17. package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.js +3 -3
  18. package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.js.map +1 -1
  19. package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.d.ts +2 -2
  20. package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.d.ts.map +1 -1
  21. package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.js +2 -2
  22. package/lib/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.js.map +1 -1
  23. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.d.ts +5 -0
  24. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.d.ts.map +1 -1
  25. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.js +13 -0
  26. package/lib/graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.js.map +1 -1
  27. package/lib/graphManager/AbstractPureGraphManager.d.ts +2 -4
  28. package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
  29. package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
  30. package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.d.ts +2 -1
  31. package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.d.ts.map +1 -1
  32. package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.js +8 -1
  33. package/lib/graphManager/action/changeDetection/StoreRelational_ObserverHelper.js.map +1 -1
  34. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts +2 -4
  35. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  36. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js +8 -11
  37. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  38. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.d.ts +0 -3
  39. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.d.ts.map +1 -1
  40. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.js +1 -12
  41. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.js.map +1 -1
  42. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineHelper.d.ts +0 -3
  43. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineHelper.d.ts.map +1 -1
  44. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineHelper.js +0 -8
  45. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineHelper.js.map +1 -1
  46. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts +0 -3
  47. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
  48. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.js +0 -1
  49. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
  50. package/lib/graphManager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.d.ts +8 -2
  51. package/lib/graphManager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.d.ts.map +1 -1
  52. package/lib/graphManager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.js +18 -6
  53. package/lib/graphManager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.js.map +1 -1
  54. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataDataType.d.ts +1 -1
  55. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataDataType.d.ts.map +1 -1
  56. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataDataType.js +3 -3
  57. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataDataType.js.map +1 -1
  58. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.d.ts +1 -1
  59. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.d.ts.map +1 -1
  60. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.js +1 -1
  61. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.js.map +1 -1
  62. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.d.ts +4 -0
  63. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.d.ts.map +1 -1
  64. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.js +9 -0
  65. package/lib/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.js.map +1 -1
  66. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.d.ts.map +1 -1
  67. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js +7 -2
  68. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js.map +1 -1
  69. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FlatDataStoreBuilderHelper.js +1 -3
  70. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FlatDataStoreBuilderHelper.js.map +1 -1
  71. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.d.ts.map +1 -1
  72. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js +6 -2
  73. package/lib/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js.map +1 -1
  74. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.d.ts.map +1 -1
  75. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js +11 -1
  76. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js.map +1 -1
  77. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.d.ts.map +1 -1
  78. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.js +17 -8
  79. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.js.map +1 -1
  80. package/lib/index.d.ts +0 -1
  81. package/lib/index.d.ts.map +1 -1
  82. package/lib/index.js +0 -1
  83. package/lib/index.js.map +1 -1
  84. package/lib/package.json +1 -1
  85. package/package.json +4 -4
  86. package/src/graph/Core_HashUtils.ts +1 -0
  87. package/src/graph/helpers/DomainHelper.ts +17 -0
  88. package/src/graph/helpers/ValueSpecificationHelper.ts +6 -1
  89. package/src/graph/metamodel/pure/packageableElements/mapping/PropertyMapping.ts +1 -1
  90. package/src/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataDataType.ts +4 -4
  91. package/src/graph/metamodel/pure/packageableElements/store/flatData/model/FlatDataProperty.ts +3 -3
  92. package/src/graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.ts +19 -0
  93. package/src/graphManager/AbstractPureGraphManager.ts +3 -13
  94. package/src/graphManager/action/changeDetection/StoreRelational_ObserverHelper.ts +16 -0
  95. package/src/graphManager/protocol/pure/v1/V1_PureGraphManager.ts +14 -24
  96. package/src/graphManager/protocol/pure/v1/engine/V1_Engine.ts +0 -39
  97. package/src/graphManager/protocol/pure/v1/engine/V1_EngineHelper.ts +0 -26
  98. package/src/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.ts +0 -17
  99. package/src/graphManager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.ts +25 -7
  100. package/src/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataDataType.ts +4 -4
  101. package/src/graphManager/protocol/pure/v1/model/packageableElements/store/flatData/model/V1_FlatDataProperty.ts +2 -2
  102. package/src/graphManager/protocol/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.ts +14 -0
  103. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.ts +8 -0
  104. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_FlatDataStoreBuilderHelper.ts +3 -3
  105. package/src/graphManager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.ts +14 -0
  106. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.ts +22 -0
  107. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_StoreSerializationHelper.ts +30 -12
  108. package/src/index.ts +0 -1
  109. package/tsconfig.json +0 -1
  110. package/lib/graphManager/action/generation/ImportConfigurationDescription.d.ts +0 -26
  111. package/lib/graphManager/action/generation/ImportConfigurationDescription.d.ts.map +0 -1
  112. package/lib/graphManager/action/generation/ImportConfigurationDescription.js +0 -28
  113. package/lib/graphManager/action/generation/ImportConfigurationDescription.js.map +0 -1
  114. package/src/graphManager/action/generation/ImportConfigurationDescription.ts +0 -34
@@ -73,13 +73,13 @@ export class FlatDataDecimal extends FlatDataNumber implements Hashable {
73
73
  }
74
74
 
75
75
  export class FlatDataDate extends FlatDataDataType implements Hashable {
76
- dateFormat?: string | undefined;
76
+ dateFormat?: string[] | undefined;
77
77
  timeZone?: string | undefined;
78
78
 
79
79
  get hashCode(): string {
80
80
  return hashArray([
81
81
  CORE_HASH_STRUCTURE.FLAT_DATA_DATE,
82
- this.dateFormat ?? '',
82
+ this.dateFormat ? hashArray(this.dateFormat) : '',
83
83
  this.timeZone ?? '',
84
84
  ]);
85
85
  }
@@ -89,7 +89,7 @@ export class FlatDataDateTime extends FlatDataDate implements Hashable {
89
89
  override get hashCode(): string {
90
90
  return hashArray([
91
91
  CORE_HASH_STRUCTURE.FLAT_DATA_DATE_TIME,
92
- this.dateFormat ?? '',
92
+ this.dateFormat ? hashArray(this.dateFormat) : '',
93
93
  this.timeZone ?? '',
94
94
  ]);
95
95
  }
@@ -99,7 +99,7 @@ export class FlatDataStrictDate extends FlatDataDate implements Hashable {
99
99
  override get hashCode(): string {
100
100
  return hashArray([
101
101
  CORE_HASH_STRUCTURE.FLAT_DATA_STRICT_DATE,
102
- this.dateFormat ?? '',
102
+ this.dateFormat ? hashArray(this.dateFormat) : '',
103
103
  this.timeZone ?? '',
104
104
  ]);
105
105
  }
@@ -21,9 +21,9 @@ export type FlatDataPropertyValue = boolean | string | number;
21
21
 
22
22
  export class FlatDataProperty implements Hashable {
23
23
  name: string;
24
- value: FlatDataPropertyValue;
24
+ value: FlatDataPropertyValue[] = [];
25
25
 
26
- constructor(name: string, value: FlatDataPropertyValue) {
26
+ constructor(name: string, value: FlatDataPropertyValue[]) {
27
27
  this.name = name;
28
28
  this.value = value;
29
29
  }
@@ -32,7 +32,7 @@ export class FlatDataProperty implements Hashable {
32
32
  return hashArray([
33
33
  CORE_HASH_STRUCTURE.FLAT_DATA_PROPERTY,
34
34
  this.name,
35
- this.value.toString(),
35
+ hashArray(this.value),
36
36
  ]);
37
37
  }
38
38
  }
@@ -170,3 +170,22 @@ export class UsernamePasswordAuthenticationStrategy
170
170
  ]);
171
171
  }
172
172
  }
173
+
174
+ export class MiddleTierUsernamePasswordAuthenticationStrategy
175
+ extends AuthenticationStrategy
176
+ implements Hashable
177
+ {
178
+ vaultReference: string;
179
+
180
+ constructor(vaultReference: string) {
181
+ super();
182
+ this.vaultReference = vaultReference;
183
+ }
184
+
185
+ get hashCode(): string {
186
+ return hashArray([
187
+ CORE_HASH_STRUCTURE.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,
188
+ this.vaultReference,
189
+ ]);
190
+ }
191
+ }
@@ -20,10 +20,6 @@ import type {
20
20
  } from './action/execution/ExecutionResult.js';
21
21
  import type { ServiceRegistrationResult } from './action/service/ServiceRegistrationResult.js';
22
22
  import type { Service } from '../graph/metamodel/pure/packageableElements/service/Service.js';
23
- import type {
24
- ImportConfigurationDescription,
25
- ImportMode,
26
- } from './action/generation/ImportConfigurationDescription.js';
27
23
  import type { FileGenerationSpecification } from '../graph/metamodel/pure/packageableElements/fileGeneration/FileGenerationSpecification.js';
28
24
  import type { GenerationOutput } from './action/generation/GenerationOutput.js';
29
25
  import type { PackageableElement } from '../graph/metamodel/pure/packageableElements/PackageableElement.js';
@@ -71,6 +67,7 @@ import type {
71
67
  MappingModelCoverageAnalysisResult,
72
68
  RawMappingModelCoverageAnalysisResult,
73
69
  } from './action/analytics/MappingModelCoverageAnalysis.js';
70
+ import type { SchemaSet } from '../graph/metamodel/pure/packageableElements/externalFormat/schemaSet/DSLExternalFormat_SchemaSet.js';
74
71
 
75
72
  export interface TEMPORARY__EngineSetupConfig {
76
73
  env: string;
@@ -311,20 +308,13 @@ export abstract class AbstractPureGraphManager {
311
308
  >;
312
309
 
313
310
  abstract generateModelFromExternalFormat(
311
+ schemaSet: SchemaSet,
312
+ targetBinding: string | undefined,
314
313
  configs: ConfigurationProperty[],
315
314
  graph: PureModel,
316
315
  ): Promise<string>;
317
316
 
318
317
  // ------------------------------------------- Import -------------------------------------------
319
-
320
- abstract getAvailableImportConfigurationDescriptions(): Promise<
321
- ImportConfigurationDescription[]
322
- >;
323
- abstract externalFormatTextToEntities(
324
- code: string,
325
- type: string,
326
- mode: ImportMode,
327
- ): Promise<Entity[]>;
328
318
  abstract getExamplePureProtocolText(): string;
329
319
  abstract getExampleExternalFormatImportText(): string;
330
320
  abstract entitiesToPureProtocolText(entities: Entity[]): Promise<string>;
@@ -25,6 +25,7 @@ import {
25
25
  SnowflakePublicAuthenticationStrategy,
26
26
  UsernamePasswordAuthenticationStrategy,
27
27
  GCPWorkloadIdentityFederationAuthenticationStrategy,
28
+ MiddleTierUsernamePasswordAuthenticationStrategy,
28
29
  } from '../../../graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.js';
29
30
  import {
30
31
  type DatasourceSpecification,
@@ -938,6 +939,17 @@ export const observe_GCPWorkloadIdentityFederationAuthenticationStrategy =
938
939
  }),
939
940
  );
940
941
 
942
+ export const observe_MiddleTierUsernamePasswordAuthenticationStrategy =
943
+ skipObserved(
944
+ (
945
+ metamodel: MiddleTierUsernamePasswordAuthenticationStrategy,
946
+ ): MiddleTierUsernamePasswordAuthenticationStrategy =>
947
+ makeObservable(metamodel, {
948
+ hashCode: computed,
949
+ vaultReference: observable,
950
+ }),
951
+ );
952
+
941
953
  export const observe_AuthenticationStrategy = (
942
954
  metamodel: AuthenticationStrategy,
943
955
  context: ObserverContext,
@@ -966,6 +978,10 @@ export const observe_AuthenticationStrategy = (
966
978
  return observe_GCPWorkloadIdentityFederationAuthenticationStrategy(
967
979
  metamodel,
968
980
  );
981
+ } else if (
982
+ metamodel instanceof MiddleTierUsernamePasswordAuthenticationStrategy
983
+ ) {
984
+ return observe_MiddleTierUsernamePasswordAuthenticationStrategy(metamodel);
969
985
  }
970
986
  const extraObservers = context.plugins.flatMap(
971
987
  (plugin) =>
@@ -49,10 +49,6 @@ import {
49
49
  } from '../../../../graphManager/AbstractPureGraphManager.js';
50
50
  import type { Mapping } from '../../../../graph/metamodel/pure/packageableElements/mapping/Mapping.js';
51
51
  import type { Runtime } from '../../../../graph/metamodel/pure/packageableElements/runtime/Runtime.js';
52
- import type {
53
- ImportConfigurationDescription,
54
- ImportMode,
55
- } from '../../../../graphManager/action/generation/ImportConfigurationDescription.js';
56
52
  import type { PackageableElement } from '../../../../graph/metamodel/pure/packageableElements/PackageableElement.js';
57
53
  import {
58
54
  type SystemModel,
@@ -254,6 +250,7 @@ import type {
254
250
  } from '../../../../graphManager/action/analytics/MappingModelCoverageAnalysis.js';
255
251
  import { deserialize } from 'serializr';
256
252
  import { V1_getFunctionSuffix } from './helpers/V1_DomainHelper.js';
253
+ import type { SchemaSet } from '../../../../graph/metamodel/pure/packageableElements/externalFormat/schemaSet/DSLExternalFormat_SchemaSet.js';
257
254
 
258
255
  class V1_PureModelContextDataIndex {
259
256
  elements: V1_PackageableElement[] = [];
@@ -1821,6 +1818,8 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
1821
1818
  }
1822
1819
 
1823
1820
  generateModelFromExternalFormat(
1821
+ schemaSet: SchemaSet,
1822
+ targetBinding: string | undefined,
1824
1823
  configurationProperties: ConfigurationProperty[],
1825
1824
  graph: PureModel,
1826
1825
  ): Promise<string> {
@@ -1829,31 +1828,22 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
1829
1828
  config[property.name] = property.value as Record<PropertyKey, unknown>;
1830
1829
  });
1831
1830
  const model = this.getFullGraphModelData(graph);
1832
- const input = new V1_ExternalFormatModelGenerationInput();
1833
- input.clientVersion = V1_PureGraphManager.TARGET_PROTOCOL_VERSION;
1834
- input.model = model;
1835
- input.config = config;
1831
+ const input = new V1_ExternalFormatModelGenerationInput(
1832
+ schemaSet.path,
1833
+ model,
1834
+ config,
1835
+ );
1836
+ if (targetBinding) {
1837
+ input.generateBinding = true;
1838
+ input.targetBindingPath = targetBinding;
1839
+ }
1840
+ // TODO: once api defaults to latest prod pure client version
1841
+ input.clientVersion = PureClientVersion.VX_X_X;
1836
1842
  return this.engine.generateModel(input);
1837
1843
  }
1838
1844
 
1839
1845
  // ------------------------------------------- Import -------------------------------------------
1840
1846
 
1841
- getAvailableImportConfigurationDescriptions(): Promise<
1842
- ImportConfigurationDescription[]
1843
- > {
1844
- return this.engine.getAvailableImportConfigurationDescriptions();
1845
- }
1846
-
1847
- async externalFormatTextToEntities(
1848
- code: string,
1849
- type: string,
1850
- mode: ImportMode,
1851
- ): Promise<Entity[]> {
1852
- return this.pureModelContextDataToEntities(
1853
- await this.engine.transformExternalFormatToProtocol(code, type, mode),
1854
- );
1855
- }
1856
-
1857
1847
  getExamplePureProtocolText(): string {
1858
1848
  return JSON.stringify(
1859
1849
  new V1_PureModelContextData(),
@@ -27,10 +27,6 @@ import {
27
27
  returnUndefOnError,
28
28
  deserializeMap,
29
29
  } from '@finos/legend-shared';
30
- import {
31
- type ImportConfigurationDescription,
32
- ImportMode,
33
- } from '../../../../../graphManager/action/generation/ImportConfigurationDescription.js';
34
30
  import type { RawLambda } from '../../../../../graph/metamodel/pure/rawValueSpecification/RawLambda.js';
35
31
  import {
36
32
  GenerationMode,
@@ -49,7 +45,6 @@ import {
49
45
  import { V1_serializeRawValueSpecification } from '../transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.js';
50
46
  import { V1_transformRawLambda } from '../transformation/pureGraph/from/V1_RawValueSpecificationTransformer.js';
51
47
  import { V1_GenerateFileInput } from '../engine/generation/V1_FileGenerationInput.js';
52
- import { V1_ImportConfigurationDescription } from '../engine/import/V1_ImportConfigurationDescription.js';
53
48
  import { V1_GenerationConfigurationDescription } from '../engine/generation/V1_GenerationConfigurationDescription.js';
54
49
  import { V1_GenerationOutput } from '../engine/generation/V1_GenerationOutput.js';
55
50
  import { V1_ParserError } from '../engine/grammar/V1_ParserError.js';
@@ -63,7 +58,6 @@ import {
63
58
  V1_buildExecutionError,
64
59
  V1_buildExternalFormatDescription,
65
60
  V1_buildGenerationConfigurationDescription,
66
- V1_buildImportConfigurationDescription,
67
61
  V1_buildParserError,
68
62
  } from './V1_EngineHelper.js';
69
63
  import { V1_LightQuery, V1_Query } from './query/V1_Query.js';
@@ -603,39 +597,6 @@ export class V1_Engine {
603
597
  return pureCode;
604
598
  }
605
599
 
606
- // ------------------------------------------- Schema Import -------------------------------------------
607
-
608
- async transformExternalFormatToProtocol(
609
- externalFormat: string,
610
- type: string,
611
- mode: ImportMode,
612
- ): Promise<V1_PureModelContextData> {
613
- return V1_deserializePureModelContextData(
614
- await this.engineServerClient.transformExternalFormatToProtocol(
615
- JSON.parse(externalFormat),
616
- type,
617
- mode,
618
- ),
619
- );
620
- }
621
-
622
- async getAvailableImportConfigurationDescriptions(): Promise<
623
- ImportConfigurationDescription[]
624
- > {
625
- const schemaImportDescriptions = (
626
- await this.engineServerClient.getAvailableSchemaImportDescriptions()
627
- ).map((gen) => ({ ...gen, modelImportMode: ImportMode.SCHEMA_IMPORT }));
628
- const codeImportDescriptions = (
629
- await this.engineServerClient.getAvailableCodeImportDescriptions()
630
- ).map((gen) => ({ ...gen, modelImportMode: ImportMode.CODE_IMPORT }));
631
- return [...schemaImportDescriptions, ...codeImportDescriptions].map(
632
- (description) =>
633
- V1_buildImportConfigurationDescription(
634
- V1_ImportConfigurationDescription.serialization.fromJson(description),
635
- ),
636
- );
637
- }
638
-
639
600
  // ------------------------------------------- Service -------------------------------------------
640
601
 
641
602
  async getServerServiceInfo(): Promise<V1_ServiceConfigurationInfo> {
@@ -32,11 +32,6 @@ import { DEPRECATED__ServiceTestResult } from '../../../../../graphManager/actio
32
32
  import type { V1_DEPRECATED__ServiceTestResult } from './service/V1_DEPRECATED__ServiceTestResult.js';
33
33
  import type { V1_ServiceRegistrationResult } from './service/V1_ServiceRegistrationResult.js';
34
34
  import { ServiceRegistrationResult } from '../../../../../graphManager/action/service/ServiceRegistrationResult.js';
35
- import {
36
- getImportMode,
37
- ImportConfigurationDescription,
38
- } from '../../../../../graphManager/action/generation/ImportConfigurationDescription.js';
39
- import type { V1_ImportConfigurationDescription } from './import/V1_ImportConfigurationDescription.js';
40
35
  import { GenerationOutput } from '../../../../../graphManager/action/generation/GenerationOutput.js';
41
36
  import type { V1_GenerationOutput } from './generation/V1_GenerationOutput.js';
42
37
  import {
@@ -284,27 +279,6 @@ export const V1_buildServiceRegistrationResult = (
284
279
  );
285
280
  };
286
281
 
287
- export const V1_buildImportConfigurationDescription = (
288
- protocol: V1_ImportConfigurationDescription,
289
- ): ImportConfigurationDescription => {
290
- const metamodel = new ImportConfigurationDescription();
291
- metamodel.key = guaranteeNonNullable(
292
- protocol.key,
293
- `Import configuration description 'key' field is missing`,
294
- );
295
- metamodel.label = guaranteeNonNullable(
296
- protocol.label,
297
- `Import configuration description 'label' field is missing`,
298
- );
299
- metamodel.modelImportMode = getImportMode(
300
- guaranteeNonNullable(
301
- protocol.modelImportMode,
302
- `Import configuration description 'modelImportMode' field is missing`,
303
- ),
304
- );
305
- return metamodel;
306
- };
307
-
308
282
  export const V1_buildGenerationProperty = (
309
283
  protocol: V1_GenerationProperty,
310
284
  ): GenerationProperty => {
@@ -22,14 +22,12 @@ import {
22
22
  type TraceData,
23
23
  HttpHeader,
24
24
  } from '@finos/legend-shared';
25
- import type { ImportMode } from '../../../../../graphManager/action/generation/ImportConfigurationDescription.js';
26
25
  import type { V1_PureModelContextData } from '../model/context/V1_PureModelContextData.js';
27
26
  import type { V1_LambdaReturnTypeResult } from './compilation/V1_LambdaReturnTypeResult.js';
28
27
  import type { V1_ServiceRegistrationResult } from './service/V1_ServiceRegistrationResult.js';
29
28
  import type { V1_ServiceConfigurationInfo } from './service/V1_ServiceConfiguration.js';
30
29
  import type { V1_CompileResult } from './compilation/V1_CompileResult.js';
31
30
  import type { V1_RawLambda } from '../model/rawValueSpecification/V1_RawLambda.js';
32
- import type { V1_PureModelContextGenerationInput } from './import/V1_PureModelContextGenerationInput.js';
33
31
  import type { V1_GenerateFileInput } from './generation/V1_FileGenerationInput.js';
34
32
  import type { V1_ExecutionResult } from './execution/V1_ExecutionResult.js';
35
33
  import type { V1_ImportConfigurationDescription } from './import/V1_ImportConfigurationDescription.js';
@@ -369,21 +367,6 @@ export class V1_EngineServerClient extends AbstractServerClient {
369
367
  getAvailableSchemaImportDescriptions = (): Promise<
370
368
  PlainObject<V1_ImportConfigurationDescription>[]
371
369
  > => this.get(`${this._pure()}/schemaImport/availableImports`);
372
- transformExternalFormatToProtocol = (
373
- input: PlainObject<V1_PureModelContextGenerationInput>,
374
- type: string,
375
- mode: ImportMode,
376
- ): Promise<PlainObject<V1_PureModelContextData>> =>
377
- this.postWithTracing(
378
- this.getTraceData(CORE_ENGINE_ACTIVITY_TRACE.EXTERNAL_FORMAT_TO_PROTOCOL),
379
- `${this._pure()}/${mode}/${type}`,
380
- input,
381
- {},
382
- undefined,
383
- undefined,
384
- { enableCompression: true },
385
- );
386
-
387
370
  // ------------------------------------------- Code Generation -------------------------------------------
388
371
 
389
372
  getAvailableCodeGenerationDescriptions = (): Promise<
@@ -14,19 +14,37 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { createModelSchema, object, primitive, raw } from 'serializr';
17
+ import { createModelSchema, optional, primitive, raw } from 'serializr';
18
18
  import { SerializationFactory } from '@finos/legend-shared';
19
- import { V1_GenerationInput } from '../generation/V1_GenerationInput.js';
20
- import { V1_PureModelContextData } from '../../model/context/V1_PureModelContextData.js';
19
+ import type { V1_PureModelContext } from '../../model/context/V1_PureModelContext.js';
20
+ import { V1_pureModelContextPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization.js';
21
21
 
22
- export class V1_ExternalFormatModelGenerationInput extends V1_GenerationInput {
22
+ export class V1_ExternalFormatModelGenerationInput {
23
+ clientVersion?: string | undefined;
24
+ sourceSchemaSet: string;
25
+ model: V1_PureModelContext;
23
26
  config?: Record<PropertyKey, unknown> | undefined;
27
+ generateBinding: boolean | undefined;
28
+ targetBindingPath: string | undefined;
24
29
 
25
- static override readonly serialization = new SerializationFactory(
30
+ constructor(
31
+ sourceSchemaSet: string,
32
+ model: V1_PureModelContext,
33
+ config?: Record<PropertyKey, unknown>,
34
+ ) {
35
+ this.model = model;
36
+ this.sourceSchemaSet = sourceSchemaSet;
37
+ this.config = config;
38
+ }
39
+
40
+ static readonly serialization = new SerializationFactory(
26
41
  createModelSchema(V1_ExternalFormatModelGenerationInput, {
27
- clientVersion: primitive(),
28
- model: object(V1_PureModelContextData),
42
+ clientVersion: optional(primitive()),
29
43
  config: raw(),
44
+ model: V1_pureModelContextPropSchema,
45
+ generateBinding: optional(primitive()),
46
+ targetBindingPath: optional(primitive()),
47
+ sourceSchemaSet: primitive(),
30
48
  }),
31
49
  );
32
50
  }
@@ -68,13 +68,13 @@ export class V1_FlatDataDecimal extends V1_FlatDataNumber implements Hashable {
68
68
  }
69
69
 
70
70
  export class V1_FlatDataDate extends V1_FlatDataDataType implements Hashable {
71
- dateFormat?: string | undefined;
71
+ dateFormat?: string[] | undefined;
72
72
  timeZone?: string | undefined;
73
73
 
74
74
  get hashCode(): string {
75
75
  return hashArray([
76
76
  CORE_HASH_STRUCTURE.FLAT_DATA_DATE,
77
- this.dateFormat ?? '',
77
+ this.dateFormat ? hashArray(this.dateFormat) : '',
78
78
  this.timeZone ?? '',
79
79
  ]);
80
80
  }
@@ -84,7 +84,7 @@ export class V1_FlatDataDateTime extends V1_FlatDataDate implements Hashable {
84
84
  override get hashCode(): string {
85
85
  return hashArray([
86
86
  CORE_HASH_STRUCTURE.FLAT_DATA_DATE_TIME,
87
- this.dateFormat ?? '',
87
+ this.dateFormat ? hashArray(this.dateFormat) : '',
88
88
  this.timeZone ?? '',
89
89
  ]);
90
90
  }
@@ -94,7 +94,7 @@ export class V1_FlatDataStrictDate extends V1_FlatDataDate implements Hashable {
94
94
  override get hashCode(): string {
95
95
  return hashArray([
96
96
  CORE_HASH_STRUCTURE.FLAT_DATA_STRICT_DATE,
97
- this.dateFormat ?? '',
97
+ this.dateFormat ? hashArray(this.dateFormat) : '',
98
98
  this.timeZone ?? '',
99
99
  ]);
100
100
  }
@@ -21,13 +21,13 @@ type V1_FlatDataPropertyValue = boolean | string | number;
21
21
 
22
22
  export class V1_FlatDataProperty implements Hashable {
23
23
  name!: string;
24
- value!: V1_FlatDataPropertyValue;
24
+ value!: V1_FlatDataPropertyValue[];
25
25
 
26
26
  get hashCode(): string {
27
27
  return hashArray([
28
28
  CORE_HASH_STRUCTURE.FLAT_DATA_PROPERTY,
29
29
  this.name,
30
- this.value.toString(),
30
+ hashArray(this.value),
31
31
  ]);
32
32
  }
33
33
  }
@@ -135,3 +135,17 @@ export class V1_UsernamePasswordAuthenticationStrategy
135
135
  ]);
136
136
  }
137
137
  }
138
+
139
+ export class V1_MiddleTierUsernamePasswordAuthenticationStrategy
140
+ extends V1_AuthenticationStrategy
141
+ implements Hashable
142
+ {
143
+ vaultReference!: string;
144
+
145
+ get hashCode(): string {
146
+ return hashArray([
147
+ CORE_HASH_STRUCTURE.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,
148
+ this.vaultReference,
149
+ ]);
150
+ }
151
+ }
@@ -38,6 +38,7 @@ import {
38
38
  OAuthAuthenticationStrategy,
39
39
  UsernamePasswordAuthenticationStrategy,
40
40
  GCPWorkloadIdentityFederationAuthenticationStrategy,
41
+ MiddleTierUsernamePasswordAuthenticationStrategy,
41
42
  } from '../../../../../../../graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.js';
42
43
  import {
43
44
  type DatasourceSpecification,
@@ -72,6 +73,7 @@ import {
72
73
  V1_DelegatedKerberosAuthenticationStrategy,
73
74
  V1_OAuthAuthenticationStrategy,
74
75
  V1_GCPWorkloadIdentityFederationAuthenticationStrategy,
76
+ V1_MiddleTierUsernamePasswordAuthenticationStrategy,
75
77
  } from '../../../model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.js';
76
78
  import type { V1_Connection } from '../../../model/packageableElements/connection/V1_Connection.js';
77
79
  import {
@@ -253,6 +255,12 @@ const transformAuthenticationStrategy = (
253
255
  auth.userNameVaultReference = metamodel.userNameVaultReference;
254
256
  auth.passwordVaultReference = metamodel.passwordVaultReference;
255
257
  return auth;
258
+ } else if (
259
+ metamodel instanceof MiddleTierUsernamePasswordAuthenticationStrategy
260
+ ) {
261
+ const auth = new V1_MiddleTierUsernamePasswordAuthenticationStrategy();
262
+ auth.vaultReference = metamodel.vaultReference;
263
+ return auth;
256
264
  }
257
265
  const extraConnectionAuthenticationStrategyTransformers =
258
266
  context.plugins.flatMap(
@@ -169,9 +169,9 @@ const buildFlatDataProperty = (
169
169
  `Flat-data property 'value' field is missing`,
170
170
  );
171
171
  assertTrue(
172
- isString(property.value) ||
173
- isNumber(property.value) ||
174
- isBoolean(property.value),
172
+ property.value.every(
173
+ (value) => isString(value) || isNumber(value) || isBoolean(value),
174
+ ),
175
175
  `Flat-data property value must be either a string, a boolean, or a number`,
176
176
  );
177
177
  return new FlatDataProperty(property.name, property.value);
@@ -40,6 +40,7 @@ import {
40
40
  DefaultH2AuthenticationStrategy,
41
41
  DelegatedKerberosAuthenticationStrategy,
42
42
  GCPWorkloadIdentityFederationAuthenticationStrategy,
43
+ MiddleTierUsernamePasswordAuthenticationStrategy,
43
44
  } from '../../../../../../../../graph/metamodel/pure/packageableElements/store/relational/connection/AuthenticationStrategy.js';
44
45
  import type { V1_GraphBuilderContext } from '../../../../transformation/pureGraph/to/V1_GraphBuilderContext.js';
45
46
  import {
@@ -62,6 +63,7 @@ import {
62
63
  V1_DelegatedKerberosAuthenticationStrategy,
63
64
  V1_UsernamePasswordAuthenticationStrategy,
64
65
  V1_GCPWorkloadIdentityFederationAuthenticationStrategy,
66
+ V1_MiddleTierUsernamePasswordAuthenticationStrategy,
65
67
  } from '../../../../model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.js';
66
68
  import type { StoreRelational_PureProtocolProcessorPlugin_Extension } from '../../../../../StoreRelational_PureProtocolProcessorPlugin_Extension.js';
67
69
 
@@ -308,7 +310,19 @@ export const V1_buildAuthenticationStrategy = (
308
310
  );
309
311
  metamodel.baseVaultReference = protocol.baseVaultReference;
310
312
  return metamodel;
313
+ } else if (
314
+ protocol instanceof V1_MiddleTierUsernamePasswordAuthenticationStrategy
315
+ ) {
316
+ assertNonEmptyString(
317
+ protocol.vaultReference,
318
+ `Middle Tier Username password authentication strategy 'vaultReference' field is missing or empty`,
319
+ );
320
+
321
+ return new MiddleTierUsernamePasswordAuthenticationStrategy(
322
+ protocol.vaultReference,
323
+ );
311
324
  }
325
+
312
326
  const extraConnectionAuthenticationStrategyBuilders =
313
327
  context.extensions.plugins.flatMap(
314
328
  (plugin) =>
@@ -63,6 +63,7 @@ import {
63
63
  V1_DelegatedKerberosAuthenticationStrategy,
64
64
  V1_UsernamePasswordAuthenticationStrategy,
65
65
  V1_GCPWorkloadIdentityFederationAuthenticationStrategy,
66
+ V1_MiddleTierUsernamePasswordAuthenticationStrategy,
66
67
  } from '../../../model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.js';
67
68
  import type { PureProtocolProcessorPlugin } from '../../../../PureProtocolProcessorPlugin.js';
68
69
  import type { StoreRelational_PureProtocolProcessorPlugin_Extension } from '../../../../StoreRelational_PureProtocolProcessorPlugin_Extension.js';
@@ -346,6 +347,7 @@ enum V1_AuthenticationStrategyType {
346
347
  OAUTH = 'oauth',
347
348
  USERNAME_PASSWORD = 'userNamePassword',
348
349
  GCP_WORKLOAD_IDENTITY_FEDERATION = 'gcpWorkloadIdentityFederation',
350
+ MIDDLE_TIER_USERNAME_PASSWORD = 'middleTierUserNamePassword',
349
351
  }
350
352
 
351
353
  const V1_delegatedKerberosAuthenticationStrategyModelSchema = createModelSchema(
@@ -390,6 +392,14 @@ const V1_GCPApplicationDefaultCredentialsAuthenticationStrategyModelSchema =
390
392
  ),
391
393
  });
392
394
 
395
+ const V1_MiddleTierUsernamePasswordAuthenticationStrategyModelSchema =
396
+ createModelSchema(V1_MiddleTierUsernamePasswordAuthenticationStrategy, {
397
+ _type: usingConstantValueSchema(
398
+ V1_AuthenticationStrategyType.MIDDLE_TIER_USERNAME_PASSWORD,
399
+ ),
400
+ vaultReference: primitive(),
401
+ });
402
+
393
403
  const V1_GCPWorkloadIdentityFederationAuthenticationStrategyModelSchema =
394
404
  createModelSchema(V1_GCPWorkloadIdentityFederationAuthenticationStrategy, {
395
405
  _type: usingConstantValueSchema(
@@ -460,6 +470,13 @@ export const V1_serializeAuthenticationStrategy = (
460
470
  V1_UsernamePasswordAuthenticationStrategyModelSchema,
461
471
  protocol,
462
472
  );
473
+ } else if (
474
+ protocol instanceof V1_MiddleTierUsernamePasswordAuthenticationStrategy
475
+ ) {
476
+ return serialize(
477
+ V1_MiddleTierUsernamePasswordAuthenticationStrategyModelSchema,
478
+ protocol,
479
+ );
463
480
  }
464
481
  const extraConnectionAuthenticationStrategyProtocolSerializers =
465
482
  plugins.flatMap(
@@ -517,6 +534,11 @@ export const V1_deserializeAuthenticationStrategy = (
517
534
  V1_UsernamePasswordAuthenticationStrategyModelSchema,
518
535
  json,
519
536
  );
537
+ case V1_AuthenticationStrategyType.MIDDLE_TIER_USERNAME_PASSWORD:
538
+ return deserialize(
539
+ V1_MiddleTierUsernamePasswordAuthenticationStrategyModelSchema,
540
+ json,
541
+ );
520
542
  default: {
521
543
  const extraConnectionAuthenticationStrategyProtocolDeserializers =
522
544
  plugins.flatMap(