@finos/legend-graph 0.2.2 → 0.3.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 (177) 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 +2 -2
  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 +7 -0
  11. package/lib/MetaModelConst.d.ts.map +1 -1
  12. package/lib/MetaModelConst.js +8 -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/SourceInformationHelper.d.ts.map +1 -1
  30. package/lib/graphManager/action/SourceInformationHelper.js +3 -1
  31. package/lib/graphManager/action/SourceInformationHelper.js.map +1 -1
  32. package/lib/graphManager/action/query/Query.d.ts +11 -0
  33. package/lib/graphManager/action/query/Query.d.ts.map +1 -1
  34. package/lib/graphManager/action/query/Query.js +13 -0
  35. package/lib/graphManager/action/query/Query.js.map +1 -1
  36. package/lib/graphManager/action/query/QuerySearchSpecification.d.ts +29 -0
  37. package/lib/graphManager/action/query/QuerySearchSpecification.d.ts.map +1 -0
  38. package/lib/graphManager/action/query/QuerySearchSpecification.js +28 -0
  39. package/lib/graphManager/action/query/QuerySearchSpecification.js.map +1 -0
  40. package/lib/helpers/DomainHelper.d.ts +20 -0
  41. package/lib/helpers/DomainHelper.d.ts.map +1 -0
  42. package/lib/helpers/DomainHelper.js +37 -0
  43. package/lib/helpers/DomainHelper.js.map +1 -0
  44. package/lib/index.d.ts +3 -1
  45. package/lib/index.d.ts.map +1 -1
  46. package/lib/index.js +3 -1
  47. package/lib/index.js.map +1 -1
  48. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.d.ts +2 -0
  49. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.d.ts.map +1 -1
  50. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.js +7 -0
  51. package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.js.map +1 -1
  52. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts +2 -0
  53. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts.map +1 -1
  54. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js +3 -0
  55. package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js.map +1 -1
  56. package/lib/models/protocols/pure/v1/V1_Core_SystemModels.json +7 -0
  57. package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts +6 -9
  58. package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  59. package/lib/models/protocols/pure/v1/V1_PureGraphManager.js +5 -5
  60. package/lib/models/protocols/pure/v1/V1_PureGraphManager.js.map +1 -1
  61. package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts +2 -6
  62. package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts.map +1 -1
  63. package/lib/models/protocols/pure/v1/engine/V1_Engine.js +14 -5
  64. package/lib/models/protocols/pure/v1/engine/V1_Engine.js.map +1 -1
  65. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.d.ts +3 -0
  66. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.d.ts.map +1 -1
  67. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.js +62 -2
  68. package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.js.map +1 -1
  69. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.d.ts +4 -8
  70. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
  71. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.js +1 -6
  72. package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
  73. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.d.ts +1 -1
  74. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.d.ts.map +1 -1
  75. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.js +3 -3
  76. package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.js.map +1 -1
  77. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.d.ts +3 -3
  78. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.d.ts.map +1 -1
  79. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.js +2 -2
  80. package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.js.map +1 -1
  81. package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.d.ts +1 -1
  82. package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.d.ts.map +1 -1
  83. package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.js +3 -3
  84. package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.js.map +1 -1
  85. package/lib/models/protocols/pure/v1/engine/query/V1_Query.d.ts +7 -3
  86. package/lib/models/protocols/pure/v1/engine/query/V1_Query.d.ts.map +1 -1
  87. package/lib/models/protocols/pure/v1/engine/query/V1_Query.js +9 -4
  88. package/lib/models/protocols/pure/v1/engine/query/V1_Query.js.map +1 -1
  89. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.d.ts +33 -0
  90. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.d.ts.map +1 -0
  91. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.js +43 -0
  92. package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.js.map +1 -0
  93. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.d.ts +22 -0
  94. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.d.ts.map +1 -0
  95. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.js +21 -0
  96. package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.js.map +1 -0
  97. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.d.ts +1 -0
  98. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.d.ts.map +1 -1
  99. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.js +2 -0
  100. package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.js.map +1 -1
  101. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.d.ts.map +1 -1
  102. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js +1 -0
  103. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js.map +1 -1
  104. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.d.ts.map +1 -1
  105. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js +1 -0
  106. package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js.map +1 -1
  107. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.d.ts.map +1 -1
  108. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js +2 -1
  109. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js.map +1 -1
  110. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.d.ts.map +1 -1
  111. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js +1 -0
  112. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js.map +1 -1
  113. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -1
  114. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js +9 -2
  115. package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js.map +1 -1
  116. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts +3 -2
  117. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts.map +1 -1
  118. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js +15 -3
  119. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js.map +1 -1
  120. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.d.ts.map +1 -1
  121. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js +1 -0
  122. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js.map +1 -1
  123. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.d.ts.map +1 -1
  124. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js +3 -3
  125. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js.map +1 -1
  126. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.d.ts.map +1 -1
  127. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.js +1 -1
  128. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.js.map +1 -1
  129. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts.map +1 -1
  130. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js +3 -13
  131. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js.map +1 -1
  132. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.d.ts.map +1 -1
  133. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.js +5 -5
  134. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.js.map +1 -1
  135. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.d.ts.map +1 -1
  136. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.js +3 -3
  137. package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.js.map +1 -1
  138. package/package.json +8 -8
  139. package/src/GraphManagerStateProvider.tsx +2 -6
  140. package/src/GraphManagerTestUtils.tsx +2 -4
  141. package/src/MetaModelConst.ts +9 -0
  142. package/src/graph/PureGraphPlugin.ts +5 -0
  143. package/src/graphManager/AbstractPureGraphManager.ts +7 -9
  144. package/src/graphManager/CorePureGraphManagerPlugin.ts +1 -6
  145. package/src/graphManager/PureGraphManagerPlugin.ts +5 -0
  146. package/src/graphManager/action/SourceInformationHelper.ts +3 -1
  147. package/src/graphManager/action/query/Query.ts +15 -0
  148. package/src/graphManager/action/query/QuerySearchSpecification.ts +31 -0
  149. package/src/helpers/DomainHelper.ts +53 -0
  150. package/src/index.ts +3 -4
  151. package/src/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.ts +8 -0
  152. package/src/models/protocols/pure/PureProtocolProcessorPlugin.ts +5 -0
  153. package/src/models/protocols/pure/v1/V1_Core_SystemModels.json +7 -0
  154. package/src/models/protocols/pure/v1/V1_PureGraphManager.ts +14 -11
  155. package/src/models/protocols/pure/v1/engine/V1_Engine.ts +25 -12
  156. package/src/models/protocols/pure/v1/engine/V1_EngineHelper.ts +92 -1
  157. package/src/models/protocols/pure/v1/engine/V1_EngineServerClient.ts +9 -14
  158. package/src/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.ts +3 -3
  159. package/src/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.ts +5 -5
  160. package/src/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.ts +3 -4
  161. package/src/models/protocols/pure/v1/engine/query/V1_Query.ts +17 -4
  162. package/src/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.ts +62 -0
  163. package/src/models/protocols/pure/v1/model/context/V1_PureModelContextText.ts +23 -0
  164. package/src/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.ts +2 -0
  165. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.ts +1 -0
  166. package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.ts +1 -0
  167. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.ts +2 -1
  168. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.ts +1 -0
  169. package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.ts +14 -1
  170. package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.ts +19 -5
  171. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.ts +1 -0
  172. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.ts +4 -6
  173. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.ts +1 -4
  174. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts +4 -14
  175. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.ts +10 -11
  176. package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.ts +4 -4
  177. package/tsconfig.json +4 -0
@@ -14,8 +14,17 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { SerializationFactory } from '@finos/legend-shared';
18
- import { createModelSchema, optional, primitive } from 'serializr';
17
+ import {
18
+ NullphobicSerializationFactory,
19
+ usingModelSchema,
20
+ } from '@finos/legend-shared';
21
+ import { createModelSchema, list, optional, primitive } from 'serializr';
22
+ import type { V1_StereotypePtr } from '../../model/packageableElements/domain/V1_StereotypePtr';
23
+ import type { V1_TaggedValue } from '../../model/packageableElements/domain/V1_TaggedValue';
24
+ import {
25
+ V1_stereotypePtrSchema,
26
+ V1_taggedValueSchema,
27
+ } from '../../transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper';
19
28
 
20
29
  export class V1_Query {
21
30
  name!: string;
@@ -27,8 +36,10 @@ export class V1_Query {
27
36
  runtime!: string;
28
37
  content!: string;
29
38
  owner?: string | undefined;
39
+ taggedValues?: V1_TaggedValue[] | undefined;
40
+ stereotypes?: V1_StereotypePtr[] | undefined;
30
41
 
31
- static readonly serialization = new SerializationFactory(
42
+ static readonly serialization = new NullphobicSerializationFactory(
32
43
  createModelSchema(V1_Query, {
33
44
  artifactId: primitive(),
34
45
  content: primitive(),
@@ -38,6 +49,8 @@ export class V1_Query {
38
49
  name: primitive(),
39
50
  owner: optional(primitive()),
40
51
  runtime: primitive(),
52
+ stereotypes: optional(list(usingModelSchema(V1_stereotypePtrSchema))),
53
+ taggedValues: optional(list(usingModelSchema(V1_taggedValueSchema))),
41
54
  versionId: primitive(),
42
55
  }),
43
56
  );
@@ -51,7 +64,7 @@ export class V1_LightQuery {
51
64
  artifactId!: string;
52
65
  versionId!: string;
53
66
 
54
- static readonly serialization = new SerializationFactory(
67
+ static readonly serialization = new NullphobicSerializationFactory(
55
68
  createModelSchema(V1_Query, {
56
69
  artifactId: primitive(),
57
70
  id: primitive(),
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import {
18
+ NullphobicSerializationFactory,
19
+ SerializationFactory,
20
+ usingModelSchema,
21
+ } from '@finos/legend-shared';
22
+ import { createModelSchema, list, optional, primitive } from 'serializr';
23
+ import type { V1_StereotypePtr } from '../../model/packageableElements/domain/V1_StereotypePtr';
24
+ import type { V1_TaggedValue } from '../../model/packageableElements/domain/V1_TaggedValue';
25
+ import {
26
+ V1_stereotypePtrSchema,
27
+ V1_taggedValueSchema,
28
+ } from '../../transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper';
29
+
30
+ export class V1_QueryProjectCoordinates {
31
+ groupId!: string;
32
+ artifactId!: string;
33
+
34
+ static readonly serialization = new SerializationFactory(
35
+ createModelSchema(V1_QueryProjectCoordinates, {
36
+ artifactId: primitive(),
37
+ groupId: primitive(),
38
+ }),
39
+ );
40
+ }
41
+
42
+ export class V1_QuerySearchSpecification {
43
+ searchTerm?: string | undefined;
44
+ projectCoordinates?: V1_QueryProjectCoordinates[] | undefined;
45
+ taggedValues?: V1_TaggedValue[] | undefined;
46
+ stereotypes?: V1_StereotypePtr[] | undefined;
47
+ limit?: number | undefined;
48
+ showCurrentUserQueriesOnly?: boolean | undefined;
49
+
50
+ static readonly serialization = new NullphobicSerializationFactory(
51
+ createModelSchema(V1_QuerySearchSpecification, {
52
+ limit: optional(primitive()),
53
+ projectCoordinates: optional(
54
+ list(usingModelSchema(V1_QueryProjectCoordinates.serialization.schema)),
55
+ ),
56
+ searchTerm: optional(primitive()),
57
+ showCurrentUserQueriesOnly: optional(primitive()),
58
+ stereotypes: optional(list(usingModelSchema(V1_stereotypePtrSchema))),
59
+ taggedValues: optional(list(usingModelSchema(V1_taggedValueSchema))),
60
+ }),
61
+ );
62
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { V1_PureModelContext } from '../../model/context/V1_PureModelContext';
18
+ import type { V1_Protocol } from '../../model/V1_Protocol';
19
+
20
+ export class V1_PureModelContextText extends V1_PureModelContext {
21
+ serializer?: V1_Protocol | undefined;
22
+ code?: string | undefined;
23
+ }
@@ -84,6 +84,7 @@ export class V1_SnowflakeDatasourceSpecification
84
84
  nonProxyHosts?: string | undefined;
85
85
  organization?: string | undefined;
86
86
  accountType?: string | undefined;
87
+ role?: string | undefined;
87
88
 
88
89
  get hashCode(): string {
89
90
  return hashArray([
@@ -98,6 +99,7 @@ export class V1_SnowflakeDatasourceSpecification
98
99
  this.nonProxyHosts ?? '',
99
100
  this.organization ?? '',
100
101
  this.accountType ?? '',
102
+ this.role ?? '',
101
103
  this.quotedIdentifiersIgnoreCase?.toString() ?? '',
102
104
  ]);
103
105
  }
@@ -120,6 +120,7 @@ const transformSnowflakeDatasourceSpecification = (
120
120
  source.nonProxyHosts = metamodel.nonProxyHosts;
121
121
  source.organization = metamodel.organization;
122
122
  source.accountType = metamodel.accountType;
123
+ source.role = metamodel.role;
123
124
  return source;
124
125
  };
125
126
 
@@ -200,6 +200,7 @@ class V1_ValueSpecificationTransformer
200
200
  }
201
201
  case PRIMITIVE_TYPE.LATESTDATE: {
202
202
  const cPrimitiveType = new V1_CLatestDate();
203
+ cPrimitiveType.multiplicity = multiplicity;
203
204
  return cPrimitiveType;
204
205
  }
205
206
  default:
@@ -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,
@@ -134,6 +134,7 @@ export const V1_buildDatasourceSpecification = (
134
134
  snowflakeSpec.nonProxyHosts = protocol.nonProxyHosts;
135
135
  snowflakeSpec.organization = protocol.organization;
136
136
  snowflakeSpec.accountType = protocol.accountType;
137
+ snowflakeSpec.role = protocol.role;
137
138
  return snowflakeSpec;
138
139
  } else if (protocol instanceof V1_BigQueryDatasourceSpecification) {
139
140
  assertNonEmptyString(
@@ -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
+ );
@@ -175,6 +175,7 @@ const snowflakeDatasourceSpecificationModelSchema = createModelSchema(
175
175
  proxyPort: optional(primitive()),
176
176
  quotedIdentifiersIgnoreCase: optional(primitive()),
177
177
  region: primitive(),
178
+ role: optional(primitive()),
178
179
  warehouseName: primitive(),
179
180
  },
180
181
  );
@@ -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",