@finos/legend-graph 0.2.4 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/lib/GraphManagerStateProvider.d.ts +3 -2
  3. package/lib/GraphManagerStateProvider.d.ts.map +1 -1
  4. package/lib/GraphManagerStateProvider.js +1 -1
  5. package/lib/GraphManagerStateProvider.js.map +1 -1
  6. package/lib/GraphManagerTestUtils.d.ts +3 -2
  7. package/lib/GraphManagerTestUtils.d.ts.map +1 -1
  8. package/lib/GraphManagerTestUtils.js +1 -1
  9. package/lib/GraphManagerTestUtils.js.map +1 -1
  10. package/lib/MetaModelConst.d.ts +8 -0
  11. package/lib/MetaModelConst.d.ts.map +1 -1
  12. package/lib/MetaModelConst.js +9 -0
  13. package/lib/MetaModelConst.js.map +1 -1
  14. package/lib/graph/PureGraphPlugin.d.ts +2 -0
  15. package/lib/graph/PureGraphPlugin.d.ts.map +1 -1
  16. package/lib/graph/PureGraphPlugin.js +3 -0
  17. package/lib/graph/PureGraphPlugin.js.map +1 -1
  18. package/lib/graphManager/AbstractPureGraphManager.d.ts +5 -9
  19. package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
  20. package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
  21. package/lib/graphManager/CorePureGraphManagerPlugin.d.ts +0 -2
  22. package/lib/graphManager/CorePureGraphManagerPlugin.d.ts.map +1 -1
  23. package/lib/graphManager/CorePureGraphManagerPlugin.js +1 -4
  24. package/lib/graphManager/CorePureGraphManagerPlugin.js.map +1 -1
  25. package/lib/graphManager/PureGraphManagerPlugin.d.ts +2 -0
  26. package/lib/graphManager/PureGraphManagerPlugin.d.ts.map +1 -1
  27. package/lib/graphManager/PureGraphManagerPlugin.js +3 -0
  28. package/lib/graphManager/PureGraphManagerPlugin.js.map +1 -1
  29. package/lib/graphManager/action/query/Query.d.ts +11 -0
  30. package/lib/graphManager/action/query/Query.d.ts.map +1 -1
  31. package/lib/graphManager/action/query/Query.js +13 -0
  32. package/lib/graphManager/action/query/Query.js.map +1 -1
  33. package/lib/graphManager/action/query/QuerySearchSpecification.d.ts +29 -0
  34. package/lib/graphManager/action/query/QuerySearchSpecification.d.ts.map +1 -0
  35. package/lib/graphManager/action/query/QuerySearchSpecification.js +28 -0
  36. package/lib/graphManager/action/query/QuerySearchSpecification.js.map +1 -0
  37. package/lib/helpers/DomainHelper.d.ts +20 -0
  38. package/lib/helpers/DomainHelper.d.ts.map +1 -0
  39. package/lib/helpers/DomainHelper.js +37 -0
  40. package/lib/helpers/DomainHelper.js.map +1 -0
  41. package/lib/index.d.ts +3 -1
  42. package/lib/index.d.ts.map +1 -1
  43. package/lib/index.js +3 -1
  44. package/lib/index.js.map +1 -1
  45. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/AuthenticationStrategy.d.ts +10 -0
  46. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/AuthenticationStrategy.d.ts.map +1 -1
  47. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/AuthenticationStrategy.js +36 -0
  48. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/AuthenticationStrategy.js.map +1 -1
  49. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.d.ts +2 -0
  50. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.d.ts.map +1 -1
  51. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.js +7 -0
  52. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.js.map +1 -1
  53. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts +2 -0
  54. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts.map +1 -1
  55. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js +3 -0
  56. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js.map +1 -1
  57. package/lib/models/protocols/pure/v1/V1_Core_SystemModels.json +7 -0
  58. package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts +6 -9
  59. package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  60. package/lib/models/protocols/pure/v1/V1_PureGraphManager.js +5 -5
  61. package/lib/models/protocols/pure/v1/V1_PureGraphManager.js.map +1 -1
  62. package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts +2 -6
  63. package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts.map +1 -1
  64. package/lib/models/protocols/pure/v1/engine/V1_Engine.js +14 -5
  65. package/lib/models/protocols/pure/v1/engine/V1_Engine.js.map +1 -1
  66. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.d.ts +3 -0
  67. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.d.ts.map +1 -1
  68. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.js +62 -2
  69. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.js.map +1 -1
  70. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.d.ts +4 -8
  71. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
  72. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.js +1 -6
  73. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
  74. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.d.ts +1 -1
  75. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.d.ts.map +1 -1
  76. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.js +3 -3
  77. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.js.map +1 -1
  78. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.d.ts +3 -3
  79. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.d.ts.map +1 -1
  80. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.js +2 -2
  81. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.js.map +1 -1
  82. package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.d.ts +1 -1
  83. package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.d.ts.map +1 -1
  84. package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.js +3 -3
  85. package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.js.map +1 -1
  86. package/lib/models/protocols/pure/v1/engine/query/V1_Query.d.ts +7 -3
  87. package/lib/models/protocols/pure/v1/engine/query/V1_Query.d.ts.map +1 -1
  88. package/lib/models/protocols/pure/v1/engine/query/V1_Query.js +9 -4
  89. package/lib/models/protocols/pure/v1/engine/query/V1_Query.js.map +1 -1
  90. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.d.ts +33 -0
  91. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.d.ts.map +1 -0
  92. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.js +43 -0
  93. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.js.map +1 -0
  94. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.d.ts +22 -0
  95. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.d.ts.map +1 -0
  96. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.js +21 -0
  97. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.js.map +1 -0
  98. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.d.ts +6 -0
  99. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.d.ts.map +1 -1
  100. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.js +13 -0
  101. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.js.map +1 -1
  102. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.d.ts +1 -0
  103. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.d.ts.map +1 -1
  104. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.js +2 -0
  105. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.js.map +1 -1
  106. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.d.ts.map +1 -1
  107. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js +10 -2
  108. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js.map +1 -1
  109. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.d.ts.map +1 -1
  110. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.js +25 -3
  111. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.js.map +1 -1
  112. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.d.ts.map +1 -1
  113. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.js +14 -2
  114. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.js.map +1 -1
  115. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.d.ts.map +1 -1
  116. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js +2 -1
  117. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js.map +1 -1
  118. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.d.ts.map +1 -1
  119. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js +10 -2
  120. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js.map +1 -1
  121. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -1
  122. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js +9 -2
  123. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js.map +1 -1
  124. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts +3 -2
  125. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts.map +1 -1
  126. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js +15 -3
  127. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js.map +1 -1
  128. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.d.ts.map +1 -1
  129. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js +14 -1
  130. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js.map +1 -1
  131. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.d.ts.map +1 -1
  132. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js +3 -3
  133. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js.map +1 -1
  134. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.d.ts.map +1 -1
  135. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.js +1 -1
  136. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.js.map +1 -1
  137. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts.map +1 -1
  138. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js +3 -13
  139. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js.map +1 -1
  140. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.d.ts.map +1 -1
  141. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.js +5 -5
  142. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.js.map +1 -1
  143. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.d.ts.map +1 -1
  144. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.js +3 -3
  145. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.js.map +1 -1
  146. package/package.json +8 -8
  147. package/src/GraphManagerStateProvider.tsx +2 -6
  148. package/src/GraphManagerTestUtils.tsx +2 -4
  149. package/src/MetaModelConst.ts +10 -0
  150. package/src/graph/PureGraphPlugin.ts +5 -0
  151. package/src/graphManager/AbstractPureGraphManager.ts +7 -9
  152. package/src/graphManager/CorePureGraphManagerPlugin.ts +1 -6
  153. package/src/graphManager/PureGraphManagerPlugin.ts +5 -0
  154. package/src/graphManager/action/query/Query.ts +15 -0
  155. package/src/graphManager/action/query/QuerySearchSpecification.ts +31 -0
  156. package/src/helpers/DomainHelper.ts +53 -0
  157. package/src/index.ts +3 -4
  158. package/src/models/metamodels/pure/packageableElements/store/relational/connection/AuthenticationStrategy.ts +47 -0
  159. package/src/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.ts +8 -0
  160. package/src/models/protocols/pure/PureProtocolProcessorPlugin.ts +5 -0
  161. package/src/models/protocols/pure/v1/V1_Core_SystemModels.json +7 -0
  162. package/src/models/protocols/pure/v1/V1_PureGraphManager.ts +14 -11
  163. package/src/models/protocols/pure/v1/engine/V1_Engine.ts +25 -12
  164. package/src/models/protocols/pure/v1/engine/V1_EngineHelper.ts +92 -1
  165. package/src/models/protocols/pure/v1/engine/V1_EngineServerClient.ts +9 -14
  166. package/src/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.ts +3 -3
  167. package/src/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.ts +5 -5
  168. package/src/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.ts +3 -4
  169. package/src/models/protocols/pure/v1/engine/query/V1_Query.ts +17 -4
  170. package/src/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.ts +62 -0
  171. package/src/models/protocols/pure/v1/model/context/V1_PureModelContextText.ts +23 -0
  172. package/src/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_AuthenticationStrategy.ts +18 -0
  173. package/src/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.ts +2 -0
  174. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.ts +9 -0
  175. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.ts +37 -4
  176. package/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.ts +22 -3
  177. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.ts +2 -1
  178. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.ts +19 -0
  179. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.ts +14 -1
  180. package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.ts +19 -5
  181. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.ts +25 -0
  182. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.ts +4 -6
  183. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.ts +1 -4
  184. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts +4 -14
  185. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.ts +10 -11
  186. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.ts +4 -4
  187. package/tsconfig.json +4 -0
@@ -248,7 +248,8 @@ const isCompatibleDerivedProperty = (
248
248
  ): boolean =>
249
249
  o.name === name &&
250
250
  Array.isArray(o.parameters) &&
251
- o.parameters.length === params.length;
251
+ // We add 1 to account for the `this` parameter in the derived property
252
+ o.parameters.length + 1 === params.length;
252
253
 
253
254
  export const V1_getAppliedProperty = (
254
255
  parentClass: Class,
@@ -33,6 +33,7 @@ import type { AuthenticationStrategy } from '../../../../../../../metamodels/pur
33
33
  import {
34
34
  SnowflakePublicAuthenticationStrategy,
35
35
  GCPApplicationDefaultCredentialsAuthenticationStrategy,
36
+ UsernamePasswordAuthenticationStrategy,
36
37
  OAuthAuthenticationStrategy,
37
38
  DefaultH2AuthenticationStrategy,
38
39
  DelegatedKerberosAuthenticationStrategy,
@@ -58,6 +59,7 @@ import {
58
59
  V1_DelegatedKerberosAuthenticationStrategy,
59
60
  V1_TestDatabaseAuthenticationStrategy,
60
61
  V1_UserPasswordAuthenticationStrategy,
62
+ V1_UsernamePasswordAuthenticationStrategy,
61
63
  } from '../../../../model/packageableElements/store/relational/connection/V1_AuthenticationStrategy';
62
64
  import type { StoreRelational_PureProtocolProcessorPlugin_Extension } from '../../../../../StoreRelational_PureProtocolProcessorPlugin_Extension';
63
65
 
@@ -134,6 +136,7 @@ export const V1_buildDatasourceSpecification = (
134
136
  snowflakeSpec.nonProxyHosts = protocol.nonProxyHosts;
135
137
  snowflakeSpec.organization = protocol.organization;
136
138
  snowflakeSpec.accountType = protocol.accountType;
139
+ snowflakeSpec.role = protocol.role;
137
140
  return snowflakeSpec;
138
141
  } else if (protocol instanceof V1_BigQueryDatasourceSpecification) {
139
142
  assertNonEmptyString(
@@ -248,6 +251,22 @@ export const V1_buildAuthenticationStrategy = (
248
251
  protocol.userName,
249
252
  protocol.passwordVaultReference,
250
253
  );
254
+ } else if (protocol instanceof V1_UsernamePasswordAuthenticationStrategy) {
255
+ assertNonEmptyString(
256
+ protocol.userNameVaultReference,
257
+ `Username password authentication strategy 'userNameVaultReference' field is missing or empty`,
258
+ );
259
+ assertNonEmptyString(
260
+ protocol.passwordVaultReference,
261
+ `Username password authentication strategy 'passwordVaultReference' field is missing or empty`,
262
+ );
263
+
264
+ const metamodel = new UsernamePasswordAuthenticationStrategy(
265
+ protocol.userNameVaultReference,
266
+ protocol.passwordVaultReference,
267
+ );
268
+ metamodel.baseVaultReference = protocol.baseVaultReference;
269
+ return metamodel;
251
270
  }
252
271
  const extraConnectionAuthenticationStrategyBuilders =
253
272
  context.extensions.plugins.flatMap(
@@ -19,6 +19,8 @@ import {
19
19
  guaranteeNonNullable,
20
20
  guaranteeType,
21
21
  UnsupportedOperationError,
22
+ isNonNullable,
23
+ uniq,
22
24
  } from '@finos/legend-shared';
23
25
  import {
24
26
  TYPICAL_MULTIPLICITY_TYPE,
@@ -265,6 +267,17 @@ export class V1_ValueSpecificationBuilder
265
267
  ),
266
268
  );
267
269
  instance.values = transformed;
270
+ // NOTE: Engine applies a more sophisticated `findMostCommon()` algorithm to find the collection's generic type. Here we only handle the case where the collection has one type.
271
+ const typeValues = uniq(
272
+ instance.values
273
+ .map((v) => v.genericType?.value.rawType)
274
+ .filter(isNonNullable),
275
+ );
276
+ if (typeValues.length === 1) {
277
+ instance.genericType = GenericTypeExplicitReference.create(
278
+ new GenericType(guaranteeNonNullable(typeValues[0])),
279
+ );
280
+ }
268
281
  return instance;
269
282
  }
270
283
 
@@ -690,7 +703,7 @@ function buildPropertyGraphFetchTree(
690
703
  ): PropertyGraphFetchTree {
691
704
  let property: AbstractProperty;
692
705
  let pureParameters: ValueSpecification[] = [];
693
- if (!propertyGraphFetchTree.parameters.length) {
706
+ if (propertyGraphFetchTree.parameters.length) {
694
707
  const thisVariable = new V1_Variable();
695
708
  thisVariable.name = 'this';
696
709
  thisVariable.class = parentClass.path;
@@ -23,6 +23,7 @@ import {
23
23
  SKIP,
24
24
  serialize,
25
25
  deserialize,
26
+ object,
26
27
  } from 'serializr';
27
28
  import type { PlainObject } from '@finos/legend-shared';
28
29
  import {
@@ -46,6 +47,7 @@ import { V1_packageableElementPointerDeserializerSchema } from '../../transforma
46
47
  import type { PureProtocolProcessorPlugin } from '../../../PureProtocolProcessorPlugin';
47
48
  import type { Entity } from '@finos/legend-model-storage';
48
49
  import { GraphDataDeserializationError } from '../../../../../../graphManager/GraphManagerUtils';
50
+ import { V1_PureModelContextText } from '../../model/context/V1_PureModelContextText';
49
51
 
50
52
  enum V1_SDLCType {
51
53
  ALLOY = 'alloy',
@@ -55,6 +57,7 @@ export enum V1_PureModelContextType {
55
57
  DATA = 'data',
56
58
  POINTER = 'pointer',
57
59
  COMPOSITE = 'composite',
60
+ TEXT = 'text',
58
61
  }
59
62
 
60
63
  export const V1_entitiesToPureModelContextData = async (
@@ -109,10 +112,13 @@ const alloySDLCSerializationModelSchema = createModelSchema(V1_AlloySDLC, {
109
112
  ),
110
113
  });
111
114
 
112
- export const V1_pureModelContextDataPropSchema = custom(
113
- (value) =>
114
- value === undefined ? SKIP : serialize(V1_PureModelContextData, value),
115
- (value) => deserialize(V1_PureModelContextData, value),
115
+ const V1_pureModelContextTextSchema = createModelSchema(
116
+ V1_PureModelContextText,
117
+ {
118
+ _type: usingConstantValueSchema(V1_PureModelContextType.TEXT),
119
+ serializer: usingModelSchema(V1_Protocol.serialization.schema),
120
+ code: optional(primitive()),
121
+ },
116
122
  );
117
123
 
118
124
  const V1_pureModelContextPointerModelSchema = createModelSchema(
@@ -129,7 +135,7 @@ const V1_pureModelContextCompositeModelSchema = createModelSchema(
129
135
  {
130
136
  _type: usingConstantValueSchema(V1_PureModelContextType.COMPOSITE),
131
137
  serializer: usingModelSchema(V1_Protocol.serialization.schema),
132
- data: V1_pureModelContextDataPropSchema,
138
+ data: object(V1_PureModelContextData),
133
139
  pointer: usingModelSchema(V1_pureModelContextPointerModelSchema),
134
140
  },
135
141
  );
@@ -172,9 +178,17 @@ export const V1_serializePureModelContext = (
172
178
  return V1_serializePureModelContextData(pureModelContext);
173
179
  } else if (pureModelContext instanceof V1_PureModelContextComposite) {
174
180
  return serialize(V1_pureModelContextCompositeModelSchema, pureModelContext);
181
+ } else if (pureModelContext instanceof V1_PureModelContextText) {
182
+ return serialize(V1_pureModelContextTextSchema, pureModelContext);
175
183
  }
176
184
  throw new UnsupportedOperationError(
177
185
  `Can't serialize Pure model context`,
178
186
  pureModelContext,
179
187
  );
180
188
  };
189
+
190
+ export const V1_pureModelContextPropSchema = custom(
191
+ (val: V1_PureModelContext) => V1_serializePureModelContext(val),
192
+ // TODO: we will populate this when we need to `deserialize`
193
+ (val) => SKIP,
194
+ );
@@ -57,6 +57,7 @@ import {
57
57
  V1_DelegatedKerberosAuthenticationStrategy,
58
58
  V1_TestDatabaseAuthenticationStrategy,
59
59
  V1_UserPasswordAuthenticationStrategy,
60
+ V1_UsernamePasswordAuthenticationStrategy,
60
61
  } from '../../../model/packageableElements/store/relational/connection/V1_AuthenticationStrategy';
61
62
  import type { PureProtocolProcessorPlugin } from '../../../../PureProtocolProcessorPlugin';
62
63
  import type { StoreRelational_PureProtocolProcessorPlugin_Extension } from '../../../../StoreRelational_PureProtocolProcessorPlugin_Extension';
@@ -175,6 +176,7 @@ const snowflakeDatasourceSpecificationModelSchema = createModelSchema(
175
176
  proxyPort: optional(primitive()),
176
177
  quotedIdentifiersIgnoreCase: optional(primitive()),
177
178
  region: primitive(),
179
+ role: optional(primitive()),
178
180
  warehouseName: primitive(),
179
181
  },
180
182
  );
@@ -284,6 +286,7 @@ enum V1_AuthenticationStrategyType {
284
286
  TEST = 'test',
285
287
  OAUTH = 'oauth',
286
288
  USER_PASSWORD = 'userPassword',
289
+ USERNAME_PASSWORD = 'userNamePassword',
287
290
  }
288
291
 
289
292
  const V1_delegatedKerberosAuthenticationStrategyModelSchema = createModelSchema(
@@ -336,6 +339,18 @@ const V1_GCPApplicationDefaultCredentialsAuthenticationStrategyModelSchema =
336
339
  ),
337
340
  });
338
341
 
342
+ const V1_UsernamePasswordAuthenticationStrategyModelSchema = createModelSchema(
343
+ V1_UsernamePasswordAuthenticationStrategy,
344
+ {
345
+ _type: usingConstantValueSchema(
346
+ V1_AuthenticationStrategyType.USERNAME_PASSWORD,
347
+ ),
348
+ baseVaultReference: optional(primitive()),
349
+ userNameVaultReference: primitive(),
350
+ passwordVaultReference: primitive(),
351
+ },
352
+ );
353
+
339
354
  const V1_oAuthAuthenticationStrategyModelSchema = createModelSchema(
340
355
  V1_OAuthAuthenticationStrategy,
341
356
  {
@@ -381,6 +396,11 @@ export const V1_serializeAuthenticationStrategy = (
381
396
  V1_userPasswordAuthenticationStrategyModelSchema,
382
397
  protocol,
383
398
  );
399
+ } else if (protocol instanceof V1_UsernamePasswordAuthenticationStrategy) {
400
+ return serialize(
401
+ V1_UsernamePasswordAuthenticationStrategyModelSchema,
402
+ protocol,
403
+ );
384
404
  }
385
405
  const extraConnectionAuthenticationStrategyProtocolSerializers =
386
406
  plugins.flatMap(
@@ -436,6 +456,11 @@ export const V1_deserializeAuthenticationStrategy = (
436
456
  );
437
457
  case V1_AuthenticationStrategyType.OAUTH:
438
458
  return deserialize(V1_oAuthAuthenticationStrategyModelSchema, json);
459
+ case V1_AuthenticationStrategyType.USERNAME_PASSWORD:
460
+ return deserialize(
461
+ V1_UsernamePasswordAuthenticationStrategyModelSchema,
462
+ json,
463
+ );
439
464
  default: {
440
465
  const extraConnectionAuthenticationStrategyProtocolDeserializers =
441
466
  plugins.flatMap(
@@ -21,13 +21,13 @@ import {
21
21
  list,
22
22
  deserialize,
23
23
  serialize,
24
- SKIP,
25
24
  object,
26
25
  alias,
27
26
  optional,
28
27
  } from 'serializr';
29
28
  import type { PlainObject } from '@finos/legend-shared';
30
29
  import {
30
+ optionalCustom,
31
31
  usingConstantValueSchema,
32
32
  deserializeArray,
33
33
  UnsupportedOperationError,
@@ -343,11 +343,9 @@ const V1_elementWithJoinsModelSchema = createModelSchema(V1_ElementWithJoins, {
343
343
  V1_RelationalOperationElementType.ELEMENT_WITH_JOINS,
344
344
  ),
345
345
  joins: list(usingModelSchema(V1_joinPointerModelSchema)),
346
- relationalElement: custom(
347
- (val) =>
348
- val === undefined ? SKIP : V1_serializeRelationalOperationElement(val),
349
- (val) =>
350
- val === undefined ? SKIP : V1_deserializeRelationalOperationElement(val),
346
+ relationalElement: optionalCustom(
347
+ V1_serializeRelationalOperationElement,
348
+ V1_deserializeRelationalOperationElement,
351
349
  ),
352
350
  });
353
351
 
@@ -251,10 +251,7 @@ export const V1_constraintSchema = createModelSchema(V1_Constraint, {
251
251
  enforcementLevel: optional(primitive()),
252
252
  externalId: optional(primitive()),
253
253
  functionDefinition: usingModelSchema(V1_rawLambdaModelSchema),
254
- messageFunction: custom(
255
- (value) => (value ? serialize(V1_rawLambdaModelSchema, value) : SKIP),
256
- (value) => deserialize(V1_rawLambdaModelSchema, value),
257
- ),
254
+ messageFunction: optional(usingModelSchema(V1_rawLambdaModelSchema)),
258
255
  name: primitive(),
259
256
  });
260
257
 
@@ -577,7 +577,7 @@ function V1_serializeClassMapping(
577
577
  } else if (value instanceof V1_AggregationAwareClassMapping) {
578
578
  return serialize(aggregationAwareClassMappingModelSchema, value);
579
579
  }
580
- if (plugins !== undefined) {
580
+ if (plugins) {
581
581
  const extraClassMappingSerializers = plugins.flatMap(
582
582
  (plugin) =>
583
583
  (
@@ -615,7 +615,7 @@ function V1_deserializeClassMapping(
615
615
  case V1_ClassMappingType.AGGREGATION_AWARE:
616
616
  return deserialize(aggregationAwareClassMappingModelSchema, json);
617
617
  default: {
618
- if (plugins !== undefined) {
618
+ if (plugins) {
619
619
  const extraClassMappingDeserializers = plugins.flatMap(
620
620
  (plugin) =>
621
621
  (
@@ -1007,18 +1007,8 @@ export const V1_mappingModelSchema = (
1007
1007
  ),
1008
1008
  classMappings: list(
1009
1009
  custom(
1010
- (val) => {
1011
- if (plugins !== undefined) {
1012
- return V1_serializeClassMapping(val, plugins);
1013
- }
1014
- return V1_serializeClassMapping(val);
1015
- },
1016
- (val) => {
1017
- if (plugins !== undefined) {
1018
- return V1_deserializeClassMapping(val, plugins);
1019
- }
1020
- return V1_deserializeClassMapping(val);
1021
- },
1010
+ (val) => V1_serializeClassMapping(val, plugins),
1011
+ (val) => V1_deserializeClassMapping(val, plugins),
1022
1012
  ),
1023
1013
  ),
1024
1014
  enumerationMappings: list(
@@ -16,16 +16,15 @@
16
16
 
17
17
  import type { PlainObject } from '@finos/legend-shared';
18
18
  import {
19
+ optionalCustom,
19
20
  usingConstantValueSchema,
20
21
  UnsupportedOperationError,
21
22
  } from '@finos/legend-shared';
22
23
  import {
23
24
  createModelSchema,
24
- custom,
25
25
  deserialize,
26
26
  primitive,
27
27
  serialize,
28
- SKIP,
29
28
  } from 'serializr';
30
29
  import { V1_BusinessMilestoning } from '../../../model/packageableElements/store/relational/model/milestoning/V1_BusinessMilestoning';
31
30
  import { V1_BusinessSnapshotMilestoning } from '../../../model/packageableElements/store/relational/model/milestoning/V1_BusinessSnapshotMilestoning';
@@ -49,9 +48,9 @@ const businessMilestoningModelSchema = createModelSchema(
49
48
  {
50
49
  _type: usingConstantValueSchema(V1_MilestoningType.BUSINESS_MILESTONING),
51
50
  from: primitive(),
52
- infinityDate: custom(
53
- (val) => (val ? V1_serializeRawValueSpecification(val) : SKIP),
54
- (val) => (val ? V1_deserializeRawValueSpecification(val) : SKIP),
51
+ infinityDate: optionalCustom(
52
+ V1_serializeRawValueSpecification,
53
+ V1_deserializeRawValueSpecification,
55
54
  ),
56
55
  thru: primitive(),
57
56
  thruIsInclusive: primitive(),
@@ -64,9 +63,9 @@ const businessSnapshotMilestoningModelSchema = createModelSchema(
64
63
  _type: usingConstantValueSchema(
65
64
  V1_MilestoningType.BUSINESS_SNAPSHOT_MILESTONING,
66
65
  ),
67
- infinityDate: custom(
68
- (val) => (val ? V1_serializeRawValueSpecification(val) : SKIP),
69
- (val) => (val ? V1_deserializeRawValueSpecification(val) : SKIP),
66
+ infinityDate: optionalCustom(
67
+ V1_serializeRawValueSpecification,
68
+ V1_deserializeRawValueSpecification,
70
69
  ),
71
70
  snapshotDate: primitive(),
72
71
  },
@@ -77,9 +76,9 @@ const processingMilestoningModelSchema = createModelSchema(
77
76
  {
78
77
  _type: usingConstantValueSchema(V1_MilestoningType.PROCESSING_MILESTONING),
79
78
  in: primitive(),
80
- infinityDate: custom(
81
- (val) => (val ? V1_serializeRawValueSpecification(val) : SKIP),
82
- (val) => (val ? V1_deserializeRawValueSpecification(val) : SKIP),
79
+ infinityDate: optionalCustom(
80
+ V1_serializeRawValueSpecification,
81
+ V1_deserializeRawValueSpecification,
83
82
  ),
84
83
  out: primitive(),
85
84
  outIsInclusive: primitive(),
@@ -22,10 +22,10 @@ import {
22
22
  primitive,
23
23
  list,
24
24
  optional,
25
- SKIP,
26
25
  } from 'serializr';
27
26
  import type { PlainObject } from '@finos/legend-shared';
28
27
  import {
28
+ optionalCustom,
29
29
  deserializeArray,
30
30
  serializeArray,
31
31
  deseralizeMap,
@@ -64,9 +64,9 @@ const dataTypeResultTypeModelSchema = createModelSchema(V1_DataTypeResultType, {
64
64
 
65
65
  const TDSColumnModelSchema = createModelSchema(V1_TDSColumn, {
66
66
  doc: optional(primitive()),
67
- enumMapping: custom(
68
- (val) => (val ? serializeMap(val) : SKIP),
69
- (val) => (val ? deseralizeMap(val) : undefined),
67
+ enumMapping: optionalCustom(
68
+ (val: Map<string, unknown>) => serializeMap(val),
69
+ deseralizeMap,
70
70
  ),
71
71
  name: primitive(),
72
72
  relationalType: optional(primitive()),
package/tsconfig.json CHANGED
@@ -70,10 +70,12 @@
70
70
  "./src/graphManager/action/generation/GenerationOutput.ts",
71
71
  "./src/graphManager/action/generation/ImportConfigurationDescription.ts",
72
72
  "./src/graphManager/action/query/Query.ts",
73
+ "./src/graphManager/action/query/QuerySearchSpecification.ts",
73
74
  "./src/graphManager/action/service/ServiceExecutionMode.ts",
74
75
  "./src/graphManager/action/service/ServiceRegistrationResult.ts",
75
76
  "./src/graphManager/action/service/ServiceTestResult.ts",
76
77
  "./src/helpers/DatabaseHelper.ts",
78
+ "./src/helpers/DomainHelper.ts",
77
79
  "./src/helpers/MappingHelper.ts",
78
80
  "./src/helpers/MappingResolutionHelper.ts",
79
81
  "./src/helpers/ServiceHelper.ts",
@@ -265,6 +267,7 @@
265
267
  "./src/models/protocols/pure/v1/engine/import/V1_ImportConfigurationDescription.ts",
266
268
  "./src/models/protocols/pure/v1/engine/import/V1_PureModelContextGenerationInput.ts",
267
269
  "./src/models/protocols/pure/v1/engine/query/V1_Query.ts",
270
+ "./src/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.ts",
268
271
  "./src/models/protocols/pure/v1/engine/service/V1_ServiceConfiguration.ts",
269
272
  "./src/models/protocols/pure/v1/engine/service/V1_ServiceRegistrationResult.ts",
270
273
  "./src/models/protocols/pure/v1/engine/service/V1_ServiceStorage.ts",
@@ -275,6 +278,7 @@
275
278
  "./src/models/protocols/pure/v1/model/context/V1_PureModelContextComposite.ts",
276
279
  "./src/models/protocols/pure/v1/model/context/V1_PureModelContextData.ts",
277
280
  "./src/models/protocols/pure/v1/model/context/V1_PureModelContextPointer.ts",
281
+ "./src/models/protocols/pure/v1/model/context/V1_PureModelContextText.ts",
278
282
  "./src/models/protocols/pure/v1/model/context/V1_SDLC.ts",
279
283
  "./src/models/protocols/pure/v1/model/executionPlan/V1_ExecutionPlan.ts",
280
284
  "./src/models/protocols/pure/v1/model/executionPlan/V1_SimpleExecutionPlan.ts",