@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.
- package/CHANGELOG.md +34 -0
- package/lib/GraphManagerStateProvider.d.ts +3 -2
- package/lib/GraphManagerStateProvider.d.ts.map +1 -1
- package/lib/GraphManagerStateProvider.js +2 -2
- package/lib/GraphManagerStateProvider.js.map +1 -1
- package/lib/GraphManagerTestUtils.d.ts +3 -2
- package/lib/GraphManagerTestUtils.d.ts.map +1 -1
- package/lib/GraphManagerTestUtils.js +1 -1
- package/lib/GraphManagerTestUtils.js.map +1 -1
- package/lib/MetaModelConst.d.ts +7 -0
- package/lib/MetaModelConst.d.ts.map +1 -1
- package/lib/MetaModelConst.js +8 -0
- package/lib/MetaModelConst.js.map +1 -1
- package/lib/graph/PureGraphPlugin.d.ts +2 -0
- package/lib/graph/PureGraphPlugin.d.ts.map +1 -1
- package/lib/graph/PureGraphPlugin.js +3 -0
- package/lib/graph/PureGraphPlugin.js.map +1 -1
- package/lib/graphManager/AbstractPureGraphManager.d.ts +5 -9
- package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
- package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
- package/lib/graphManager/CorePureGraphManagerPlugin.d.ts +0 -2
- package/lib/graphManager/CorePureGraphManagerPlugin.d.ts.map +1 -1
- package/lib/graphManager/CorePureGraphManagerPlugin.js +1 -4
- package/lib/graphManager/CorePureGraphManagerPlugin.js.map +1 -1
- package/lib/graphManager/PureGraphManagerPlugin.d.ts +2 -0
- package/lib/graphManager/PureGraphManagerPlugin.d.ts.map +1 -1
- package/lib/graphManager/PureGraphManagerPlugin.js +3 -0
- package/lib/graphManager/PureGraphManagerPlugin.js.map +1 -1
- package/lib/graphManager/action/SourceInformationHelper.d.ts.map +1 -1
- package/lib/graphManager/action/SourceInformationHelper.js +3 -1
- package/lib/graphManager/action/SourceInformationHelper.js.map +1 -1
- package/lib/graphManager/action/query/Query.d.ts +11 -0
- package/lib/graphManager/action/query/Query.d.ts.map +1 -1
- package/lib/graphManager/action/query/Query.js +13 -0
- package/lib/graphManager/action/query/Query.js.map +1 -1
- package/lib/graphManager/action/query/QuerySearchSpecification.d.ts +29 -0
- package/lib/graphManager/action/query/QuerySearchSpecification.d.ts.map +1 -0
- package/lib/graphManager/action/query/QuerySearchSpecification.js +28 -0
- package/lib/graphManager/action/query/QuerySearchSpecification.js.map +1 -0
- package/lib/helpers/DomainHelper.d.ts +20 -0
- package/lib/helpers/DomainHelper.d.ts.map +1 -0
- package/lib/helpers/DomainHelper.js +37 -0
- package/lib/helpers/DomainHelper.js.map +1 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.d.ts +2 -0
- package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.d.ts.map +1 -1
- package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.js +7 -0
- package/lib/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.js.map +1 -1
- package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts +2 -0
- package/lib/models/protocols/pure/PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js +3 -0
- package/lib/models/protocols/pure/PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/models/protocols/pure/v1/V1_Core_SystemModels.json +7 -0
- package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts +6 -9
- package/lib/models/protocols/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/V1_PureGraphManager.js +5 -5
- package/lib/models/protocols/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts +2 -6
- package/lib/models/protocols/pure/v1/engine/V1_Engine.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/engine/V1_Engine.js +14 -5
- package/lib/models/protocols/pure/v1/engine/V1_Engine.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.d.ts +3 -0
- package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.js +62 -2
- package/lib/models/protocols/pure/v1/engine/V1_EngineHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.d.ts +4 -8
- package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.js +1 -6
- package/lib/models/protocols/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.d.ts +1 -1
- package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.js +3 -3
- package/lib/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.d.ts +3 -3
- package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.js +2 -2
- package/lib/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.d.ts +1 -1
- package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.js +3 -3
- package/lib/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/query/V1_Query.d.ts +7 -3
- package/lib/models/protocols/pure/v1/engine/query/V1_Query.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/engine/query/V1_Query.js +9 -4
- package/lib/models/protocols/pure/v1/engine/query/V1_Query.js.map +1 -1
- package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.d.ts +33 -0
- package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.js +43 -0
- package/lib/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.d.ts +22 -0
- package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.d.ts.map +1 -0
- package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.js +21 -0
- package/lib/models/protocols/pure/v1/model/context/V1_PureModelContextText.js.map +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.d.ts +1 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.js +2 -0
- package/lib/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js +2 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js +9 -2
- package/lib/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts +3 -2
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js +15 -3
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js +1 -0
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js +3 -3
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.js +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js +3 -13
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.js +5 -5
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.js.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.d.ts.map +1 -1
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.js +3 -3
- package/lib/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.js.map +1 -1
- package/package.json +8 -8
- package/src/GraphManagerStateProvider.tsx +2 -6
- package/src/GraphManagerTestUtils.tsx +2 -4
- package/src/MetaModelConst.ts +9 -0
- package/src/graph/PureGraphPlugin.ts +5 -0
- package/src/graphManager/AbstractPureGraphManager.ts +7 -9
- package/src/graphManager/CorePureGraphManagerPlugin.ts +1 -6
- package/src/graphManager/PureGraphManagerPlugin.ts +5 -0
- package/src/graphManager/action/SourceInformationHelper.ts +3 -1
- package/src/graphManager/action/query/Query.ts +15 -0
- package/src/graphManager/action/query/QuerySearchSpecification.ts +31 -0
- package/src/helpers/DomainHelper.ts +53 -0
- package/src/index.ts +3 -4
- package/src/models/metamodels/pure/packageableElements/store/relational/connection/DatasourceSpecification.ts +8 -0
- package/src/models/protocols/pure/PureProtocolProcessorPlugin.ts +5 -0
- package/src/models/protocols/pure/v1/V1_Core_SystemModels.json +7 -0
- package/src/models/protocols/pure/v1/V1_PureGraphManager.ts +14 -11
- package/src/models/protocols/pure/v1/engine/V1_Engine.ts +25 -12
- package/src/models/protocols/pure/v1/engine/V1_EngineHelper.ts +92 -1
- package/src/models/protocols/pure/v1/engine/V1_EngineServerClient.ts +9 -14
- package/src/models/protocols/pure/v1/engine/execution/V1_ExecuteInput.ts +3 -3
- package/src/models/protocols/pure/v1/engine/generation/V1_FileGenerationInput.ts +5 -5
- package/src/models/protocols/pure/v1/engine/grammar/V1_JsonToGrammarInput.ts +3 -4
- package/src/models/protocols/pure/v1/engine/query/V1_Query.ts +17 -4
- package/src/models/protocols/pure/v1/engine/query/V1_QuerySearchSpecification.ts +62 -0
- package/src/models/protocols/pure/v1/model/context/V1_PureModelContextText.ts +23 -0
- package/src/models/protocols/pure/v1/model/packageableElements/store/relational/connection/V1_DatasourceSpecification.ts +2 -0
- package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_ConnectionTransformer.ts +1 -0
- package/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_ValueSpecificationTransformer.ts +1 -0
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_DomainBuilderHelper.ts +2 -1
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalConnectionBuilderHelper.ts +1 -0
- package/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_ValueSpecificationBuilderHelper.ts +14 -1
- package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization.ts +19 -5
- package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ConnectionSerializationHelper.ts +1 -0
- package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DatabaseSerializationHelper.ts +4 -6
- package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DomainSerializationHelper.ts +1 -4
- package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MappingSerializationHelper.ts +4 -14
- package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/V1_MilestoningSerializationHelper.ts +10 -11
- package/src/models/protocols/pure/v1/transformation/pureProtocol/serializationHelpers/executionPlan/V1_ExecutionPlanSerializationHelper.ts +4 -4
- package/tsconfig.json +4 -0
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
import { assertTrue } from '@finos/legend-shared';
|
|
18
18
|
import type { SourceInformation } from './SourceInformation';
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
// NOTE: @ is chosen because it is not part of identifier token in Pure grammar
|
|
21
|
+
// TODO: handle the case of quote identifier e.g. model::something::'I have an @ in me'
|
|
22
|
+
const COORDINATE_DELIMITER = '@';
|
|
21
23
|
|
|
22
24
|
export const extractSourceInformationCoordinates = (
|
|
23
25
|
sourceInformation: SourceInformation | undefined,
|
|
@@ -18,6 +18,17 @@ import type { Mapping } from '../../../models/metamodels/pure/packageableElement
|
|
|
18
18
|
import type { PackageableElementReference } from '../../../models/metamodels/pure/packageableElements/PackageableElementReference';
|
|
19
19
|
import type { PackageableRuntime } from '../../../models/metamodels/pure/packageableElements/runtime/PackageableRuntime';
|
|
20
20
|
|
|
21
|
+
export class QueryTaggedValue {
|
|
22
|
+
profile!: string;
|
|
23
|
+
tag!: string;
|
|
24
|
+
value!: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class QueryStereotype {
|
|
28
|
+
profile!: string;
|
|
29
|
+
stereotype!: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
21
32
|
export class Query {
|
|
22
33
|
name!: string;
|
|
23
34
|
id!: string;
|
|
@@ -30,6 +41,10 @@ export class Query {
|
|
|
30
41
|
// if not owner is specified, any user can own the query
|
|
31
42
|
// NOTE: the owner is managed automatically by the backend
|
|
32
43
|
owner?: string | undefined;
|
|
44
|
+
// NOTE: these are different from metamodel tagged values and stereotypes
|
|
45
|
+
// because we don't process them
|
|
46
|
+
taggedValues?: QueryTaggedValue[] | undefined;
|
|
47
|
+
stereotypes?: QueryStereotype[] | undefined;
|
|
33
48
|
// Store query in text to be more compact and stable
|
|
34
49
|
content!: string;
|
|
35
50
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { QueryStereotype, QueryTaggedValue } from './Query';
|
|
18
|
+
|
|
19
|
+
export class QueryProjectCoordinates {
|
|
20
|
+
groupId!: string;
|
|
21
|
+
artifactId!: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class QuerySearchSpecification {
|
|
25
|
+
searchTerm?: string | undefined;
|
|
26
|
+
projectCoordinates?: QueryProjectCoordinates[] | undefined;
|
|
27
|
+
taggedValues?: QueryTaggedValue[] | undefined;
|
|
28
|
+
stereotypes?: QueryStereotype[] | undefined;
|
|
29
|
+
limit?: number | undefined;
|
|
30
|
+
showCurrentUserQueriesOnly?: boolean | undefined;
|
|
31
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { PureModel } from '../graph/PureModel';
|
|
18
|
+
import { Class } from '../models/metamodels/pure/packageableElements/domain/Class';
|
|
19
|
+
import { CORE_ELEMENT_PATH, MILESTONING_STEROTYPES } from '../MetaModelConst';
|
|
20
|
+
|
|
21
|
+
export const getMilestoneTemporalStereotype = (
|
|
22
|
+
val: Class,
|
|
23
|
+
graph: PureModel,
|
|
24
|
+
): MILESTONING_STEROTYPES | undefined => {
|
|
25
|
+
const milestonedProfile = graph.getProfile(
|
|
26
|
+
CORE_ELEMENT_PATH.PROFILE_TEMPORAL,
|
|
27
|
+
);
|
|
28
|
+
let stereotype;
|
|
29
|
+
const profile = val.stereotypes.find(
|
|
30
|
+
(e) => e.ownerReference.value === milestonedProfile,
|
|
31
|
+
);
|
|
32
|
+
stereotype = Object.values(MILESTONING_STEROTYPES).find(
|
|
33
|
+
(e) => e === profile?.value.value,
|
|
34
|
+
);
|
|
35
|
+
if (stereotype !== undefined) {
|
|
36
|
+
return stereotype;
|
|
37
|
+
}
|
|
38
|
+
val.generalizations.forEach((e) => {
|
|
39
|
+
const superType = e.value.rawType;
|
|
40
|
+
if (superType instanceof Class) {
|
|
41
|
+
const milestonedStereotype = getMilestoneTemporalStereotype(
|
|
42
|
+
superType,
|
|
43
|
+
graph,
|
|
44
|
+
);
|
|
45
|
+
if (milestonedStereotype !== undefined) {
|
|
46
|
+
stereotype = Object.values(MILESTONING_STEROTYPES).find(
|
|
47
|
+
(e) => e === milestonedStereotype,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return stereotype;
|
|
53
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -145,6 +145,7 @@ export * from './helpers/MappingHelper';
|
|
|
145
145
|
export * from './helpers/MappingResolutionHelper';
|
|
146
146
|
export * from './helpers/ValidationHelper';
|
|
147
147
|
export * from './helpers/Stubable'; // TODO: to be removed
|
|
148
|
+
export * from './helpers/DomainHelper';
|
|
148
149
|
|
|
149
150
|
// --------------------------------------------- GRAPH --------------------------------------------------
|
|
150
151
|
|
|
@@ -179,6 +180,7 @@ export {
|
|
|
179
180
|
export * from './graphManager/action/execution/ExecutionResultHelper';
|
|
180
181
|
export * from './graphManager/PureGraphManagerPlugin';
|
|
181
182
|
export * from './graphManager/action/query/Query';
|
|
183
|
+
export * from './graphManager/action/query/QuerySearchSpecification';
|
|
182
184
|
export * from './graphManager/action/EngineError';
|
|
183
185
|
export * from './graphManager/action/SourceInformationHelper';
|
|
184
186
|
export * from './graphManager/action/generation/ImportConfigurationDescription';
|
|
@@ -217,10 +219,7 @@ export { V1_rawLambdaModelSchema } from './models/protocols/pure/v1/transformati
|
|
|
217
219
|
export { V1_transformPropertyReference } from './models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer';
|
|
218
220
|
export { V1_EngineServerClient } from './models/protocols/pure/v1/engine/V1_EngineServerClient';
|
|
219
221
|
export { V1_Engine } from './models/protocols/pure/v1/engine/V1_Engine';
|
|
220
|
-
export {
|
|
221
|
-
V1_pureModelContextDataPropSchema,
|
|
222
|
-
V1_deserializePureModelContextData as V1_jsonToPureModelContextData,
|
|
223
|
-
} from './models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization';
|
|
222
|
+
export { V1_deserializePureModelContextData as V1_jsonToPureModelContextData } from './models/protocols/pure/v1/transformation/pureProtocol/V1_PureProtocolSerialization';
|
|
224
223
|
export {
|
|
225
224
|
V1_propertyPointerModelSchema,
|
|
226
225
|
V1_stereotypePtrSchema,
|
|
@@ -174,6 +174,7 @@ export class SnowflakeDatasourceSpecification
|
|
|
174
174
|
nonProxyHosts?: string | undefined;
|
|
175
175
|
organization?: string | undefined;
|
|
176
176
|
accountType?: string | undefined;
|
|
177
|
+
role?: string | undefined;
|
|
177
178
|
|
|
178
179
|
constructor(
|
|
179
180
|
accountName: string,
|
|
@@ -195,6 +196,7 @@ export class SnowflakeDatasourceSpecification
|
|
|
195
196
|
nonProxyHosts: observable,
|
|
196
197
|
organization: observable,
|
|
197
198
|
accountType: observable,
|
|
199
|
+
role: observable,
|
|
198
200
|
hashCode: computed,
|
|
199
201
|
setAccountName: action,
|
|
200
202
|
setRegion: action,
|
|
@@ -206,6 +208,7 @@ export class SnowflakeDatasourceSpecification
|
|
|
206
208
|
setNonProxyHosts: action,
|
|
207
209
|
setOrganization: action,
|
|
208
210
|
setAccountType: action,
|
|
211
|
+
setRole: action,
|
|
209
212
|
setQuotedIdentifiersIgnoreCase: action,
|
|
210
213
|
});
|
|
211
214
|
|
|
@@ -259,6 +262,10 @@ export class SnowflakeDatasourceSpecification
|
|
|
259
262
|
this.accountType = val;
|
|
260
263
|
}
|
|
261
264
|
|
|
265
|
+
setRole(val: string | undefined): void {
|
|
266
|
+
this.role = val;
|
|
267
|
+
}
|
|
268
|
+
|
|
262
269
|
get hashCode(): string {
|
|
263
270
|
return hashArray([
|
|
264
271
|
CORE_HASH_STRUCTURE.SNOWFLAKE_DATASOURCE_SPECIFICATION,
|
|
@@ -272,6 +279,7 @@ export class SnowflakeDatasourceSpecification
|
|
|
272
279
|
this.nonProxyHosts ?? '',
|
|
273
280
|
this.organization ?? '',
|
|
274
281
|
this.accountType ?? '',
|
|
282
|
+
this.role ?? '',
|
|
275
283
|
this.quotedIdentifiersIgnoreCase?.toString() ?? '',
|
|
276
284
|
]);
|
|
277
285
|
}
|
|
@@ -29,6 +29,7 @@ import type { V1_GraphBuilderContext } from './v1/transformation/pureGraph/to/V1
|
|
|
29
29
|
import type { V1_ProcessingContext } from './v1/transformation/pureGraph/to/helpers/V1_ProcessingContext';
|
|
30
30
|
import type { SimpleFunctionExpression } from '../../metamodels/pure/valueSpecification/SimpleFunctionExpression';
|
|
31
31
|
import type { ValueSpecification } from '../../metamodels/pure/valueSpecification/ValueSpecification';
|
|
32
|
+
import type { GraphPluginManager } from '../../../GraphPluginManager';
|
|
32
33
|
|
|
33
34
|
export type V1_ElementProtocolClassifierPathGetter = (
|
|
34
35
|
protocol: V1_PackageableElement,
|
|
@@ -76,6 +77,10 @@ export type V1_ExecutionInputGetter = (
|
|
|
76
77
|
export abstract class PureProtocolProcessorPlugin extends AbstractPlugin {
|
|
77
78
|
private readonly _$nominalTypeBrand!: 'PureProtocolProcessorPlugin';
|
|
78
79
|
|
|
80
|
+
install(pluginManager: GraphPluginManager): void {
|
|
81
|
+
pluginManager.registerPureProtocolProcessorPlugin(this);
|
|
82
|
+
}
|
|
83
|
+
|
|
79
84
|
/**
|
|
80
85
|
* Get the list of supported system element models.
|
|
81
86
|
*
|
|
@@ -19,6 +19,13 @@
|
|
|
19
19
|
"name": "doc",
|
|
20
20
|
"tags": ["doc", "todo"]
|
|
21
21
|
},
|
|
22
|
+
{
|
|
23
|
+
"stereotypes": ["bitemporal", "businesstemporal", "processingtemporal"],
|
|
24
|
+
"package": "meta::pure::profiles",
|
|
25
|
+
"_type": "profile",
|
|
26
|
+
"name": "temporal",
|
|
27
|
+
"tags": []
|
|
28
|
+
},
|
|
22
29
|
{
|
|
23
30
|
"package": "meta::pure::metamodel::type",
|
|
24
31
|
"_type": "class",
|
|
@@ -28,9 +28,9 @@ import type {
|
|
|
28
28
|
Log,
|
|
29
29
|
PlainObject,
|
|
30
30
|
ServerClientConfig,
|
|
31
|
-
TracerServicePlugin,
|
|
32
31
|
} from '@finos/legend-shared';
|
|
33
32
|
import {
|
|
33
|
+
TracerService,
|
|
34
34
|
LogEvent,
|
|
35
35
|
getClass,
|
|
36
36
|
guaranteeNonNullable,
|
|
@@ -192,6 +192,7 @@ import {
|
|
|
192
192
|
V1_transformQuery,
|
|
193
193
|
V1_buildGenerationOutput,
|
|
194
194
|
V1_buildLightQuery,
|
|
195
|
+
V1_transformQuerySearchSpecification,
|
|
195
196
|
} from './engine/V1_EngineHelper';
|
|
196
197
|
import { V1_buildExecutionResult } from './engine/V1_ExecutionHelper';
|
|
197
198
|
import type { Entity } from '@finos/legend-model-storage';
|
|
@@ -203,6 +204,7 @@ import {
|
|
|
203
204
|
} from '../../../../graphManager/GraphManagerUtils';
|
|
204
205
|
import { PackageableElementReference } from '../../../metamodels/pure/packageableElements/PackageableElementReference';
|
|
205
206
|
import type { GraphPluginManager } from '../../../../GraphPluginManager';
|
|
207
|
+
import type { QuerySearchSpecification } from '../../../../graphManager/action/query/QuerySearchSpecification';
|
|
206
208
|
|
|
207
209
|
const V1_FUNCTION_SUFFIX_MULTIPLICITY_INFINITE = 'MANY';
|
|
208
210
|
|
|
@@ -407,14 +409,14 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
407
409
|
|
|
408
410
|
*initialize(
|
|
409
411
|
config: TEMP__EngineSetupConfig,
|
|
410
|
-
options
|
|
411
|
-
|
|
412
|
+
options?: {
|
|
413
|
+
tracerService?: TracerService | undefined;
|
|
412
414
|
},
|
|
413
415
|
): GeneratorFn<void> {
|
|
414
416
|
this.engine = new V1_Engine(config.clientConfig, this.log);
|
|
415
417
|
this.engine
|
|
416
418
|
.getEngineServerClient()
|
|
417
|
-
.
|
|
419
|
+
.setTracerService(options?.tracerService ?? new TracerService());
|
|
418
420
|
yield this.engine.setup(config);
|
|
419
421
|
}
|
|
420
422
|
|
|
@@ -2039,13 +2041,14 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2039
2041
|
|
|
2040
2042
|
// --------------------------------------------- Query ---------------------------------------------
|
|
2041
2043
|
|
|
2042
|
-
async
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2044
|
+
async searchQueries(
|
|
2045
|
+
searchSpecification: QuerySearchSpecification,
|
|
2046
|
+
): Promise<LightQuery[]> {
|
|
2047
|
+
return (
|
|
2048
|
+
await this.engine.searchQueries(
|
|
2049
|
+
V1_transformQuerySearchSpecification(searchSpecification),
|
|
2050
|
+
)
|
|
2051
|
+
).map((protocol) =>
|
|
2049
2052
|
V1_buildLightQuery(
|
|
2050
2053
|
protocol,
|
|
2051
2054
|
this.engine.getEngineServerClient().currentUserId,
|
|
@@ -84,6 +84,8 @@ import type { V1_PureModelContext } from '../model/context/V1_PureModelContext';
|
|
|
84
84
|
import { ServiceExecutionMode } from '../../../../../graphManager/action/service/ServiceExecutionMode';
|
|
85
85
|
import { serialize } from 'serializr';
|
|
86
86
|
import { V1_ExecutionError } from './execution/V1_ExecutionError';
|
|
87
|
+
import { V1_PureModelContextText } from '../model/context/V1_PureModelContextText';
|
|
88
|
+
import { V1_QuerySearchSpecification } from './query/V1_QuerySearchSpecification';
|
|
87
89
|
|
|
88
90
|
class V1_EngineConfig extends TEMP__AbstractEngineConfig {
|
|
89
91
|
private engine: V1_Engine;
|
|
@@ -471,12 +473,19 @@ export class V1_Engine {
|
|
|
471
473
|
generationMode: GenerationMode,
|
|
472
474
|
model: V1_PureModelContextData,
|
|
473
475
|
): Promise<V1_GenerationOutput[]> {
|
|
476
|
+
// NOTE: here instead of sending PureModelContextData, we send PureModelContextText so
|
|
477
|
+
// engine can convert that back to PureModelContextData to obtain source information
|
|
478
|
+
// as some generator uses that info. Sending PureModelContextData with source information
|
|
479
|
+
// from the front end to engine would take up a lot of bandwidth.
|
|
480
|
+
const textModel = new V1_PureModelContextText();
|
|
481
|
+
textModel.serializer = model.serializer;
|
|
482
|
+
textModel.code = await this.pureModelContextDataToPureCode(model);
|
|
474
483
|
return (
|
|
475
484
|
await this.engineServerClient.generateFile(
|
|
476
485
|
generationMode,
|
|
477
486
|
type,
|
|
478
487
|
V1_GenerateFileInput.serialization.toJson(
|
|
479
|
-
new V1_GenerateFileInput(
|
|
488
|
+
new V1_GenerateFileInput(textModel, configs),
|
|
480
489
|
),
|
|
481
490
|
)
|
|
482
491
|
).map((output) => V1_GenerationOutput.serialization.fromJson(output));
|
|
@@ -573,15 +582,14 @@ export class V1_Engine {
|
|
|
573
582
|
|
|
574
583
|
// ------------------------------------------- Query -------------------------------------------
|
|
575
584
|
|
|
576
|
-
async
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
);
|
|
585
|
+
async searchQueries(
|
|
586
|
+
searchSpecification: V1_QuerySearchSpecification,
|
|
587
|
+
): Promise<V1_LightQuery[]> {
|
|
588
|
+
return (
|
|
589
|
+
await this.engineServerClient.searchQueries(
|
|
590
|
+
V1_QuerySearchSpecification.serialization.toJson(searchSpecification),
|
|
591
|
+
)
|
|
592
|
+
).map((query) => V1_LightQuery.serialization.fromJson(query));
|
|
585
593
|
}
|
|
586
594
|
|
|
587
595
|
async getQuery(queryId: string): Promise<V1_Query> {
|
|
@@ -592,13 +600,18 @@ export class V1_Engine {
|
|
|
592
600
|
|
|
593
601
|
async createQuery(query: V1_Query): Promise<V1_Query> {
|
|
594
602
|
return V1_Query.serialization.fromJson(
|
|
595
|
-
await this.engineServerClient.createQuery(
|
|
603
|
+
await this.engineServerClient.createQuery(
|
|
604
|
+
V1_Query.serialization.toJson(query),
|
|
605
|
+
),
|
|
596
606
|
);
|
|
597
607
|
}
|
|
598
608
|
|
|
599
609
|
async updateQuery(query: V1_Query): Promise<V1_Query> {
|
|
600
610
|
return V1_Query.serialization.fromJson(
|
|
601
|
-
await this.engineServerClient.updateQuery(
|
|
611
|
+
await this.engineServerClient.updateQuery(
|
|
612
|
+
query.id,
|
|
613
|
+
V1_Query.serialization.toJson(query),
|
|
614
|
+
),
|
|
602
615
|
);
|
|
603
616
|
}
|
|
604
617
|
|
|
@@ -14,10 +14,15 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
guaranteeNonEmptyString,
|
|
19
|
+
guaranteeNonNullable,
|
|
20
|
+
} from '@finos/legend-shared';
|
|
18
21
|
import {
|
|
19
22
|
LightQuery,
|
|
20
23
|
Query,
|
|
24
|
+
QueryStereotype,
|
|
25
|
+
QueryTaggedValue,
|
|
21
26
|
} from '../../../../../graphManager/action/query/Query';
|
|
22
27
|
import type { V1_LightQuery } from './query/V1_Query';
|
|
23
28
|
import { V1_Query } from './query/V1_Query';
|
|
@@ -52,6 +57,14 @@ import type { V1_SourceInformation } from '../model/V1_SourceInformation';
|
|
|
52
57
|
import { SourceInformation } from '../../../../../graphManager/action/SourceInformation';
|
|
53
58
|
import { ExecutionError } from '../../../../../graphManager/action/ExecutionError';
|
|
54
59
|
import type { V1_ExecutionError } from './execution/V1_ExecutionError';
|
|
60
|
+
import type { QuerySearchSpecification } from '../../../../../graphManager/action/query/QuerySearchSpecification';
|
|
61
|
+
import {
|
|
62
|
+
V1_QueryProjectCoordinates,
|
|
63
|
+
V1_QuerySearchSpecification,
|
|
64
|
+
} from './query/V1_QuerySearchSpecification';
|
|
65
|
+
import { V1_TaggedValue } from '../model/packageableElements/domain/V1_TaggedValue';
|
|
66
|
+
import { V1_TagPtr } from '../model/packageableElements/domain/V1_TagPtr';
|
|
67
|
+
import { V1_StereotypePtr } from '../model/packageableElements/domain/V1_StereotypePtr';
|
|
55
68
|
|
|
56
69
|
export const V1_buildLightQuery = (
|
|
57
70
|
protocol: V1_LightQuery,
|
|
@@ -133,6 +146,38 @@ export const V1_buildQuery = (
|
|
|
133
146
|
metamodel.owner = protocol.owner;
|
|
134
147
|
metamodel.isCurrentUserQuery =
|
|
135
148
|
currentUserId !== undefined && protocol.owner === currentUserId;
|
|
149
|
+
|
|
150
|
+
// NOTE: we don't properly process tagged values and stereotypes for query
|
|
151
|
+
// because these profiles/tags/stereotypes can come from external systems.
|
|
152
|
+
metamodel.taggedValues = protocol.taggedValues?.map((taggedValueProtocol) => {
|
|
153
|
+
const taggedValue = new QueryTaggedValue();
|
|
154
|
+
taggedValue.profile = guaranteeNonEmptyString(
|
|
155
|
+
taggedValueProtocol.tag.profile,
|
|
156
|
+
`Tagged value 'tag.profile' field is missing or empty`,
|
|
157
|
+
);
|
|
158
|
+
taggedValue.tag = guaranteeNonEmptyString(
|
|
159
|
+
taggedValueProtocol.tag.value,
|
|
160
|
+
`Tagged value 'tag.value' field is missing or empty`,
|
|
161
|
+
);
|
|
162
|
+
taggedValue.value = guaranteeNonEmptyString(
|
|
163
|
+
taggedValueProtocol.value,
|
|
164
|
+
`Tagged value 'value' field is missing or empty`,
|
|
165
|
+
);
|
|
166
|
+
return taggedValue;
|
|
167
|
+
});
|
|
168
|
+
metamodel.stereotypes = protocol.stereotypes?.map((stereotypeProtocol) => {
|
|
169
|
+
const stereotype = new QueryStereotype();
|
|
170
|
+
stereotype.profile = guaranteeNonEmptyString(
|
|
171
|
+
stereotypeProtocol.profile,
|
|
172
|
+
`Stereotype pointer 'profile' field is missing or empty`,
|
|
173
|
+
);
|
|
174
|
+
stereotype.stereotype = guaranteeNonEmptyString(
|
|
175
|
+
stereotypeProtocol.value,
|
|
176
|
+
`Stereotype pointer 'value' field is missing or empty`,
|
|
177
|
+
);
|
|
178
|
+
return stereotype;
|
|
179
|
+
});
|
|
180
|
+
|
|
136
181
|
return metamodel;
|
|
137
182
|
};
|
|
138
183
|
|
|
@@ -148,6 +193,52 @@ export const V1_transformQuery = (metamodel: Query): V1_Query => {
|
|
|
148
193
|
protocol.runtime = metamodel.runtime.valueForSerialization ?? '';
|
|
149
194
|
protocol.content = metamodel.content;
|
|
150
195
|
protocol.owner = metamodel.owner;
|
|
196
|
+
protocol.taggedValues = metamodel.taggedValues?.map((_taggedValue) => {
|
|
197
|
+
const taggedValue = new V1_TaggedValue();
|
|
198
|
+
taggedValue.tag = new V1_TagPtr();
|
|
199
|
+
taggedValue.tag.profile = _taggedValue.profile;
|
|
200
|
+
taggedValue.tag.value = _taggedValue.tag;
|
|
201
|
+
taggedValue.value = _taggedValue.value;
|
|
202
|
+
return taggedValue;
|
|
203
|
+
});
|
|
204
|
+
protocol.stereotypes = metamodel.stereotypes?.map((_stereotype) => {
|
|
205
|
+
const stereotype = new V1_StereotypePtr();
|
|
206
|
+
stereotype.profile = _stereotype.profile;
|
|
207
|
+
stereotype.value = _stereotype.stereotype;
|
|
208
|
+
return stereotype;
|
|
209
|
+
});
|
|
210
|
+
return protocol;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export const V1_transformQuerySearchSpecification = (
|
|
214
|
+
metamodel: QuerySearchSpecification,
|
|
215
|
+
): V1_QuerySearchSpecification => {
|
|
216
|
+
const protocol = new V1_QuerySearchSpecification();
|
|
217
|
+
protocol.searchTerm = metamodel.searchTerm;
|
|
218
|
+
protocol.limit = metamodel.limit;
|
|
219
|
+
protocol.showCurrentUserQueriesOnly = metamodel.showCurrentUserQueriesOnly;
|
|
220
|
+
protocol.projectCoordinates = metamodel.projectCoordinates?.map(
|
|
221
|
+
(_projectCoordinate) => {
|
|
222
|
+
const projectCoordinate = new V1_QueryProjectCoordinates();
|
|
223
|
+
projectCoordinate.groupId = _projectCoordinate.groupId;
|
|
224
|
+
projectCoordinate.artifactId = _projectCoordinate.artifactId;
|
|
225
|
+
return projectCoordinate;
|
|
226
|
+
},
|
|
227
|
+
);
|
|
228
|
+
protocol.taggedValues = metamodel.taggedValues?.map((_taggedValue) => {
|
|
229
|
+
const taggedValue = new V1_TaggedValue();
|
|
230
|
+
taggedValue.tag = new V1_TagPtr();
|
|
231
|
+
taggedValue.tag.profile = _taggedValue.profile;
|
|
232
|
+
taggedValue.tag.value = _taggedValue.tag;
|
|
233
|
+
taggedValue.value = _taggedValue.value;
|
|
234
|
+
return taggedValue;
|
|
235
|
+
});
|
|
236
|
+
protocol.stereotypes = metamodel.stereotypes?.map((_stereotype) => {
|
|
237
|
+
const stereotype = new V1_StereotypePtr();
|
|
238
|
+
stereotype.profile = _stereotype.profile;
|
|
239
|
+
stereotype.value = _stereotype.stereotype;
|
|
240
|
+
return stereotype;
|
|
241
|
+
});
|
|
151
242
|
return protocol;
|
|
152
243
|
};
|
|
153
244
|
|
|
@@ -45,6 +45,7 @@ import type { V1_ExecutionPlan } from '../model/executionPlan/V1_ExecutionPlan';
|
|
|
45
45
|
import type { V1_LightQuery, V1_Query } from './query/V1_Query';
|
|
46
46
|
import type { V1_ServiceStorage } from './service/V1_ServiceStorage';
|
|
47
47
|
import type { GenerationMode } from '../../../../../graphManager/action/generation/GenerationConfigurationDescription';
|
|
48
|
+
import type { V1_QuerySearchSpecification } from './query/V1_QuerySearchSpecification';
|
|
48
49
|
|
|
49
50
|
enum CORE_ENGINE_TRACER_SPAN {
|
|
50
51
|
GRAMMAR_TO_JSON = 'transform Pure code to protocol',
|
|
@@ -393,21 +394,15 @@ export class V1_EngineServerClient extends AbstractServerClient {
|
|
|
393
394
|
`${this.queryBaseUrl ?? this.networkClient.baseUrl}/pure/v1/query${
|
|
394
395
|
queryId ? `/${encodeURIComponent(queryId)}` : ''
|
|
395
396
|
}`;
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
limit?: number | undefined;
|
|
401
|
-
}): Promise<PlainObject<V1_LightQuery>[]> =>
|
|
402
|
-
this.get(this._query(), undefined, undefined, {
|
|
403
|
-
search: options?.search,
|
|
404
|
-
projectCoordinates: options?.projectCoordinates,
|
|
405
|
-
showCurrentUserQueriesOnly: options?.showCurrentUserQueriesOnly,
|
|
406
|
-
limit: options?.limit,
|
|
407
|
-
});
|
|
397
|
+
searchQueries = (
|
|
398
|
+
searchSpecification: PlainObject<V1_QuerySearchSpecification>,
|
|
399
|
+
): Promise<PlainObject<V1_LightQuery>[]> =>
|
|
400
|
+
this.post(`${this._query()}/search`, searchSpecification, undefined);
|
|
408
401
|
getQuery = (queryId: string): Promise<PlainObject<V1_Query>> =>
|
|
409
402
|
this.get(this._query(queryId));
|
|
410
|
-
createQuery = (
|
|
403
|
+
createQuery = (
|
|
404
|
+
query: PlainObject<V1_Query>,
|
|
405
|
+
): Promise<PlainObject<V1_Query>> =>
|
|
411
406
|
this.postWithTracing(
|
|
412
407
|
this.getTraceData(CORE_ENGINE_TRACER_SPAN.CREATE_QUERY),
|
|
413
408
|
this._query(),
|
|
@@ -415,7 +410,7 @@ export class V1_EngineServerClient extends AbstractServerClient {
|
|
|
415
410
|
);
|
|
416
411
|
updateQuery = (
|
|
417
412
|
queryId: string,
|
|
418
|
-
query: V1_Query
|
|
413
|
+
query: PlainObject<V1_Query>,
|
|
419
414
|
): Promise<PlainObject<V1_Query>> =>
|
|
420
415
|
this.putWithTracing(
|
|
421
416
|
this.getTraceData(CORE_ENGINE_TRACER_SPAN.UPDATE_QUERY),
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
import {
|
|
18
18
|
createModelSchema,
|
|
19
19
|
custom,
|
|
20
|
+
object,
|
|
20
21
|
optional,
|
|
21
22
|
primitive,
|
|
22
23
|
SKIP,
|
|
23
24
|
} from 'serializr';
|
|
24
25
|
import { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
|
|
25
|
-
import
|
|
26
|
+
import { V1_PureModelContextData } from '../../model/context/V1_PureModelContextData';
|
|
26
27
|
import type { V1_Runtime } from '../../model/packageableElements/runtime/V1_Runtime';
|
|
27
28
|
import type { V1_RawExecutionContext } from '../../model/rawValueSpecification/V1_RawExecutionContext';
|
|
28
29
|
import type { V1_RawLambda } from '../../model/rawValueSpecification/V1_RawLambda';
|
|
29
|
-
import { V1_pureModelContextDataPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization';
|
|
30
30
|
import { V1_serializeRuntime } from '../../transformation/pureProtocol/serializationHelpers/V1_RuntimeSerializationHelper';
|
|
31
31
|
import {
|
|
32
32
|
V1_rawBaseExecutionContextModelSchema,
|
|
@@ -46,7 +46,7 @@ export class V1_ExecuteInput {
|
|
|
46
46
|
clientVersion: optional(primitive()),
|
|
47
47
|
function: usingModelSchema(V1_rawLambdaModelSchema),
|
|
48
48
|
mapping: primitive(),
|
|
49
|
-
model:
|
|
49
|
+
model: object(V1_PureModelContextData),
|
|
50
50
|
runtime: custom(
|
|
51
51
|
(val) => V1_serializeRuntime(val),
|
|
52
52
|
() => SKIP,
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
|
|
17
17
|
import { createModelSchema, optional, primitive, raw } from 'serializr';
|
|
18
18
|
import { SerializationFactory } from '@finos/legend-shared';
|
|
19
|
-
import
|
|
20
|
-
import { V1_pureModelContextDataPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization';
|
|
19
|
+
import { V1_pureModelContextPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization';
|
|
21
20
|
import { PureClientVersion } from '../../../../../../graphManager/GraphManagerUtils';
|
|
21
|
+
import type { V1_PureModelContext } from '../../model/context/V1_PureModelContext';
|
|
22
22
|
|
|
23
23
|
export class V1_GenerateFileInput {
|
|
24
24
|
clientVersion?: string | undefined;
|
|
25
|
-
model:
|
|
25
|
+
model: V1_PureModelContext;
|
|
26
26
|
config?: Record<PropertyKey, unknown> | undefined;
|
|
27
27
|
|
|
28
28
|
constructor(
|
|
29
|
-
model:
|
|
29
|
+
model: V1_PureModelContext,
|
|
30
30
|
config?: Record<PropertyKey, unknown>,
|
|
31
31
|
) {
|
|
32
32
|
this.clientVersion = PureClientVersion.V1_0_0;
|
|
@@ -37,7 +37,7 @@ export class V1_GenerateFileInput {
|
|
|
37
37
|
static readonly serialization = new SerializationFactory(
|
|
38
38
|
createModelSchema(V1_GenerateFileInput, {
|
|
39
39
|
clientVersion: optional(primitive()),
|
|
40
|
-
model:
|
|
40
|
+
model: V1_pureModelContextPropSchema,
|
|
41
41
|
config: raw(),
|
|
42
42
|
}),
|
|
43
43
|
);
|
|
@@ -14,12 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { createModelSchema, optional, primitive } from 'serializr';
|
|
17
|
+
import { createModelSchema, object, optional, primitive } from 'serializr';
|
|
18
18
|
import { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
|
|
19
19
|
import { V1_ParserError } from '../../engine/grammar/V1_ParserError';
|
|
20
20
|
import { V1_LambdaInput } from './V1_LambdaInput';
|
|
21
|
-
import
|
|
22
|
-
import { V1_pureModelContextDataPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization';
|
|
21
|
+
import { V1_PureModelContextData } from '../../model/context/V1_PureModelContextData';
|
|
23
22
|
|
|
24
23
|
export enum V1_RenderStyle {
|
|
25
24
|
STANDARD = 'STANDARD',
|
|
@@ -35,7 +34,7 @@ export class V1_JsonToGrammarInput {
|
|
|
35
34
|
|
|
36
35
|
static readonly serialization = new SerializationFactory(
|
|
37
36
|
createModelSchema(V1_JsonToGrammarInput, {
|
|
38
|
-
modelDataContext:
|
|
37
|
+
modelDataContext: optional(object(V1_PureModelContextData)),
|
|
39
38
|
isolatedLambdas: usingModelSchema(V1_LambdaInput.serialization.schema),
|
|
40
39
|
renderStyle: optional(primitive()),
|
|
41
40
|
codeError: usingModelSchema(V1_ParserError.serialization.schema),
|