@finos/legend-graph 23.0.0 → 23.0.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/lib/graph/BasicModel.d.ts +5 -5
- package/lib/graph/BasicModel.d.ts.map +1 -1
- package/lib/graph/BasicModel.js +8 -7
- package/lib/graph/BasicModel.js.map +1 -1
- package/lib/graph/DependencyManager.d.ts +2 -2
- package/lib/graph/DependencyManager.d.ts.map +1 -1
- package/lib/graph/DependencyManager.js +5 -4
- package/lib/graph/DependencyManager.js.map +1 -1
- package/lib/graphManager/AbstractPureGraphManager.d.ts +3 -3
- package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
- package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
- package/lib/graphManager/GraphManagerEvent.d.ts +1 -0
- package/lib/graphManager/GraphManagerEvent.d.ts.map +1 -1
- package/lib/graphManager/GraphManagerEvent.js +1 -0
- package/lib/graphManager/GraphManagerEvent.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts +6 -3
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js +35 -18
- package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.d.ts +5 -4
- package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.js +14 -9
- package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts +3 -3
- package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.js +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/compilation/{V1_LambdaReturnTypeResult.d.ts → V1_LambdaReturnType.d.ts} +10 -1
- package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnType.d.ts.map +1 -0
- package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnType.js +32 -0
- package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnType.js.map +1 -0
- package/lib/graphManager/protocol/pure/v1/engine/test/V1_RunTestsInput.d.ts +2 -2
- package/lib/graphManager/protocol/pure/v1/engine/test/V1_RunTestsInput.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/test/V1_RunTestsInput.js +3 -3
- package/lib/graphManager/protocol/pure/v1/engine/test/V1_RunTestsInput.js.map +1 -1
- package/lib/package.json +2 -2
- package/package.json +5 -5
- package/src/graph/BasicModel.ts +9 -7
- package/src/graph/DependencyManager.ts +27 -12
- package/src/graphManager/AbstractPureGraphManager.ts +7 -3
- package/src/graphManager/GraphManagerEvent.ts +1 -1
- package/src/graphManager/protocol/pure/v1/V1_PureGraphManager.ts +72 -44
- package/src/graphManager/protocol/pure/v1/engine/V1_Engine.ts +20 -20
- package/src/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.ts +7 -5
- package/src/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnType.ts +43 -0
- package/src/graphManager/protocol/pure/v1/engine/test/V1_RunTestsInput.ts +5 -4
- package/tsconfig.json +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnTypeResult.d.ts.map +0 -1
- package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnTypeResult.js +0 -17
- package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnTypeResult.js.map +0 -1
- package/src/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnTypeResult.ts +0 -19
|
@@ -200,7 +200,9 @@ import {
|
|
|
200
200
|
import { V1_buildExecutionResult } from './engine/execution/V1_ExecutionHelper.js';
|
|
201
201
|
import {
|
|
202
202
|
type Entity,
|
|
203
|
-
type
|
|
203
|
+
type GraphDataOrigin,
|
|
204
|
+
type EntitiesWithOrigin,
|
|
205
|
+
LegendSDLC,
|
|
204
206
|
ENTITY_PATH_DELIMITER,
|
|
205
207
|
} from '@finos/legend-storage';
|
|
206
208
|
import {
|
|
@@ -272,6 +274,7 @@ import { CompilationWarning } from '../../../action/compilation/CompilationWarni
|
|
|
272
274
|
import { V1_transformParameterValue } from './transformation/pureGraph/from/V1_ServiceTransformer.js';
|
|
273
275
|
import { V1_transformModelUnit } from './transformation/pureGraph/from/V1_DSL_ExternalFormat_Transformer.js';
|
|
274
276
|
import type { ModelUnit } from '../../../../graph/metamodel/pure/packageableElements/externalFormat/store/DSL_ExternalFormat_ModelUnit.js';
|
|
277
|
+
import { V1_LambdaReturnTypeInput } from './engine/compilation/V1_LambdaReturnType.js';
|
|
275
278
|
|
|
276
279
|
class V1_PureModelContextDataIndex {
|
|
277
280
|
elements: V1_PackageableElement[] = [];
|
|
@@ -428,6 +431,7 @@ export const V1_indexPureModelContextData = (
|
|
|
428
431
|
interface V1_PureGraphBuilderInput {
|
|
429
432
|
model: BasicModel;
|
|
430
433
|
data: V1_PureModelContextDataIndex;
|
|
434
|
+
origin?: GraphDataOrigin | undefined;
|
|
431
435
|
}
|
|
432
436
|
|
|
433
437
|
export interface V1_EngineSetupConfig {
|
|
@@ -583,7 +587,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
583
587
|
coreModel: CoreModel,
|
|
584
588
|
systemModel: SystemModel,
|
|
585
589
|
dependencyManager: DependencyManager,
|
|
586
|
-
dependencyEntitiesIndex: Map<string,
|
|
590
|
+
dependencyEntitiesIndex: Map<string, EntitiesWithOrigin>,
|
|
587
591
|
buildState: ActionState,
|
|
588
592
|
options?: GraphBuilderOptions,
|
|
589
593
|
_report?: GraphManagerOperationReport,
|
|
@@ -611,11 +615,11 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
611
615
|
>();
|
|
612
616
|
await Promise.all(
|
|
613
617
|
Array.from(dependencyEntitiesIndex.entries()).map(
|
|
614
|
-
([dependencyKey,
|
|
618
|
+
([dependencyKey, entitiesWithOrigin]) => {
|
|
615
619
|
const projectModelData = new V1_PureModelContextData();
|
|
616
620
|
dependencyGraphDataIndex.set(dependencyKey, projectModelData);
|
|
617
621
|
return V1_entitiesToPureModelContextData(
|
|
618
|
-
entities,
|
|
622
|
+
entitiesWithOrigin.entities,
|
|
619
623
|
projectModelData,
|
|
620
624
|
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
621
625
|
);
|
|
@@ -726,8 +730,8 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
726
730
|
* This sets the SDLC of the graph if there exists a versioned `SDLC` of the graph. This means the graph is immutable and we can easily `refetch`
|
|
727
731
|
* the graph with the provided sdlc pointer
|
|
728
732
|
*/
|
|
729
|
-
if (options?.
|
|
730
|
-
graph.
|
|
733
|
+
if (options?.origin) {
|
|
734
|
+
graph.setOrigin(options.origin);
|
|
731
735
|
}
|
|
732
736
|
|
|
733
737
|
buildState.pass();
|
|
@@ -1739,6 +1743,17 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1739
1743
|
options?: { keepSourceInformation?: boolean },
|
|
1740
1744
|
): Promise<string> {
|
|
1741
1745
|
return this.engine.getLambdaReturnType(
|
|
1746
|
+
this.buildLambdaReturnTypeInput(lambda, graph, options),
|
|
1747
|
+
);
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
private buildLambdaReturnTypeInput(
|
|
1751
|
+
lambda: RawLambda,
|
|
1752
|
+
graph: PureModel,
|
|
1753
|
+
options?: { keepSourceInformation?: boolean },
|
|
1754
|
+
): V1_LambdaReturnTypeInput {
|
|
1755
|
+
return new V1_LambdaReturnTypeInput(
|
|
1756
|
+
this.getFullGraphModelContext(graph),
|
|
1742
1757
|
lambda.accept_RawValueSpecificationVisitor(
|
|
1743
1758
|
new V1_RawValueSpecificationTransformer(
|
|
1744
1759
|
new V1_GraphTransformerContextBuilder(
|
|
@@ -1750,7 +1765,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1750
1765
|
.build(),
|
|
1751
1766
|
),
|
|
1752
1767
|
) as V1_RawLambda,
|
|
1753
|
-
this.getFullGraphModelData(graph),
|
|
1754
1768
|
);
|
|
1755
1769
|
}
|
|
1756
1770
|
|
|
@@ -1823,7 +1837,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1823
1837
|
graph: PureModel,
|
|
1824
1838
|
): Promise<TestResult[]> {
|
|
1825
1839
|
const runTestsInput = new V1_RunTestsInput();
|
|
1826
|
-
runTestsInput.model = this.
|
|
1840
|
+
runTestsInput.model = this.getFullGraphModelContext(graph);
|
|
1827
1841
|
runTestsInput.testables = inputs
|
|
1828
1842
|
.map((input) => {
|
|
1829
1843
|
const testable = guaranteeNonNullable(
|
|
@@ -1922,6 +1936,8 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
1922
1936
|
aStatus.assertion === baseAssertion &&
|
|
1923
1937
|
aStatus instanceof AssertFail,
|
|
1924
1938
|
);
|
|
1939
|
+
} else if (testResult instanceof TestError) {
|
|
1940
|
+
throw new IllegalStateError(testResult.error);
|
|
1925
1941
|
}
|
|
1926
1942
|
return undefined;
|
|
1927
1943
|
})
|
|
@@ -2173,16 +2189,15 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2173
2189
|
);
|
|
2174
2190
|
|
|
2175
2191
|
private buildPureModelSDLCPointer(
|
|
2176
|
-
|
|
2192
|
+
origin: GraphDataOrigin,
|
|
2177
2193
|
): V1_PureModelContextPointer {
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
);
|
|
2194
|
+
if (origin instanceof LegendSDLC) {
|
|
2195
|
+
return new V1_PureModelContextPointer(
|
|
2196
|
+
undefined,
|
|
2197
|
+
new V1_LegendSDLC(origin.groupId, origin.artifactId, origin.versionId),
|
|
2198
|
+
);
|
|
2199
|
+
}
|
|
2200
|
+
throw new UnsupportedOperationError('Unsupported graph origin');
|
|
2186
2201
|
}
|
|
2187
2202
|
|
|
2188
2203
|
private buildExecutionInput = (
|
|
@@ -2194,8 +2209,8 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2194
2209
|
executeInput: V1_ExecuteInput,
|
|
2195
2210
|
parameterValues?: ParameterValue[],
|
|
2196
2211
|
): V1_ExecuteInput => {
|
|
2197
|
-
const pureModelContext = graph.
|
|
2198
|
-
? this.buildPureModelSDLCPointer(graph.
|
|
2212
|
+
const pureModelContext = graph.origin
|
|
2213
|
+
? this.buildPureModelSDLCPointer(graph.origin)
|
|
2199
2214
|
: this.buildExecutionInputGraphData(graph, mapping, runtime);
|
|
2200
2215
|
// NOTE: for execution, we usually will just assume that we send the connections embedded in the runtime value, since we don't want the user to have to create
|
|
2201
2216
|
// packageable runtime and connection just to play with execution.
|
|
@@ -2746,8 +2761,8 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2746
2761
|
const input = new V1_MappingModelCoverageAnalysisInput();
|
|
2747
2762
|
input.clientVersion = V1_PureGraphManager.DEV_PROTOCOL_VERSION;
|
|
2748
2763
|
input.mapping = mapping.path;
|
|
2749
|
-
input.model = graph.
|
|
2750
|
-
? this.buildPureModelSDLCPointer(graph.
|
|
2764
|
+
input.model = graph.origin
|
|
2765
|
+
? this.buildPureModelSDLCPointer(graph.origin)
|
|
2751
2766
|
: this.buildMappingModelCoverageAnalysisInputContextData(graph);
|
|
2752
2767
|
return V1_buildModelCoverageAnalysisResult(
|
|
2753
2768
|
await this.engine.analyzeMappingModelCoverage(input),
|
|
@@ -2836,7 +2851,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2836
2851
|
async indexLightGraph(
|
|
2837
2852
|
graph: PureModel,
|
|
2838
2853
|
entities: Entity[],
|
|
2839
|
-
|
|
2854
|
+
dependencyEntitiesIndex: Map<string, EntitiesWithOrigin>,
|
|
2840
2855
|
entityFilterFn?: ((entity: Entity) => boolean) | undefined,
|
|
2841
2856
|
entityProcessorFn?: ((entity: Entity) => Entity) | undefined,
|
|
2842
2857
|
): Promise<V1_PureGraphBuilderInput[]> {
|
|
@@ -2874,31 +2889,33 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2874
2889
|
];
|
|
2875
2890
|
|
|
2876
2891
|
// build dependencies graph builder input
|
|
2877
|
-
graph.dependencyManager.initialize(
|
|
2892
|
+
graph.dependencyManager.initialize(dependencyEntitiesIndex);
|
|
2878
2893
|
const dependencyGraphDataIndex = new Map<string, V1_PureModelContextData>();
|
|
2879
2894
|
await Promise.all(
|
|
2880
|
-
Array.from(
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
.
|
|
2886
|
-
|
|
2887
|
-
|
|
2895
|
+
Array.from(dependencyEntitiesIndex.entries()).map(
|
|
2896
|
+
([dependencyKey, value]) => {
|
|
2897
|
+
const projectModelData = new V1_PureModelContextData();
|
|
2898
|
+
dependencyGraphDataIndex.set(dependencyKey, projectModelData);
|
|
2899
|
+
return V1_entitiesToPureModelContextData(
|
|
2900
|
+
value.entities
|
|
2901
|
+
.filter((entity) => {
|
|
2902
|
+
// never exclude section index as it could be used for path resolution when building the graph later
|
|
2903
|
+
if (entity.classifierPath === CORE_PURE_PATH.SECTION_INDEX) {
|
|
2904
|
+
return true;
|
|
2905
|
+
}
|
|
2906
|
+
if (entityFilterFn) {
|
|
2907
|
+
return entityFilterFn(entity);
|
|
2908
|
+
}
|
|
2888
2909
|
return true;
|
|
2889
|
-
}
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
projectModelData,
|
|
2899
|
-
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
2900
|
-
);
|
|
2901
|
-
}),
|
|
2910
|
+
})
|
|
2911
|
+
.map((entity) =>
|
|
2912
|
+
entityProcessorFn ? entityProcessorFn(entity) : entity,
|
|
2913
|
+
),
|
|
2914
|
+
projectModelData,
|
|
2915
|
+
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
2916
|
+
);
|
|
2917
|
+
},
|
|
2918
|
+
),
|
|
2902
2919
|
);
|
|
2903
2920
|
const dependencyGraphBuilderInput: V1_PureGraphBuilderInput[] = Array.from(
|
|
2904
2921
|
dependencyGraphDataIndex.entries(),
|
|
@@ -2921,6 +2938,17 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2921
2938
|
return graphBuilderInput;
|
|
2922
2939
|
}
|
|
2923
2940
|
|
|
2941
|
+
private getFullGraphModelContext(
|
|
2942
|
+
graph: PureModel,
|
|
2943
|
+
options?: { keepSourceInformation?: boolean | undefined } | undefined,
|
|
2944
|
+
): V1_PureModelContext {
|
|
2945
|
+
// if options is given we will not use the origin if we want to keep source information
|
|
2946
|
+
if (graph.origin && !options?.keepSourceInformation) {
|
|
2947
|
+
return this.buildPureModelSDLCPointer(graph.origin);
|
|
2948
|
+
}
|
|
2949
|
+
return this.getFullGraphModelData(graph, options);
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2924
2952
|
getFullGraphModelData(
|
|
2925
2953
|
graph: PureModel,
|
|
2926
2954
|
options?: { keepSourceInformation?: boolean | undefined } | undefined,
|
|
@@ -35,13 +35,15 @@ import {
|
|
|
35
35
|
} from '../../../../../graphManager/action/generation/GenerationConfigurationDescription.js';
|
|
36
36
|
import { TEMPORARY__AbstractEngineConfig } from '../../../../../graphManager/action/TEMPORARY__AbstractEngineConfig.js';
|
|
37
37
|
import { V1_EngineServerClient } from './V1_EngineServerClient.js';
|
|
38
|
-
import
|
|
39
|
-
import
|
|
38
|
+
import { V1_PureModelContextData } from '../model/context/V1_PureModelContextData.js';
|
|
39
|
+
import {
|
|
40
|
+
type V1_LambdaReturnTypeResult,
|
|
41
|
+
V1_LambdaReturnTypeInput,
|
|
42
|
+
} from './compilation/V1_LambdaReturnType.js';
|
|
40
43
|
import type { V1_RawLambda } from '../model/rawValueSpecification/V1_RawLambda.js';
|
|
41
44
|
import {
|
|
42
45
|
V1_deserializePureModelContextData,
|
|
43
46
|
V1_serializePureModelContext,
|
|
44
|
-
V1_serializePureModelContextData,
|
|
45
47
|
} from '../transformation/pureProtocol/V1_PureProtocolSerialization.js';
|
|
46
48
|
import { V1_serializeRawValueSpecification } from '../transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.js';
|
|
47
49
|
import { V1_transformRawLambda } from '../transformation/pureGraph/from/V1_RawValueSpecificationTransformer.js';
|
|
@@ -158,16 +160,16 @@ export class V1_Engine {
|
|
|
158
160
|
this.log = log;
|
|
159
161
|
}
|
|
160
162
|
|
|
161
|
-
private
|
|
162
|
-
graph:
|
|
163
|
-
): PlainObject<
|
|
163
|
+
private serializePureModelContext = (
|
|
164
|
+
graph: V1_PureModelContext,
|
|
165
|
+
): PlainObject<V1_PureModelContext> => {
|
|
164
166
|
const startTime = Date.now();
|
|
165
|
-
const serializedGraph =
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
);
|
|
167
|
+
const serializedGraph = V1_serializePureModelContext(graph);
|
|
168
|
+
const logEvent =
|
|
169
|
+
graph instanceof V1_PureModelContextData
|
|
170
|
+
? GRAPH_MANAGER_EVENT.SERIALIZE_GRAPH_PROTOCOL__SUCCESS
|
|
171
|
+
: GRAPH_MANAGER_EVENT.SERIALIZE_GRAPH_CONTEXT_PROTOCOL__SUCCESS;
|
|
172
|
+
this.log.info(LogEvent.create(logEvent), Date.now() - startTime, 'ms');
|
|
171
173
|
return serializedGraph;
|
|
172
174
|
};
|
|
173
175
|
|
|
@@ -203,7 +205,7 @@ export class V1_Engine {
|
|
|
203
205
|
graph: V1_PureModelContextData,
|
|
204
206
|
): Promise<string> {
|
|
205
207
|
return this.engineServerClient.JSONToGrammar_model(
|
|
206
|
-
this.
|
|
208
|
+
this.serializePureModelContext(graph),
|
|
207
209
|
V1_RenderStyle.STANDARD,
|
|
208
210
|
);
|
|
209
211
|
}
|
|
@@ -378,12 +380,12 @@ export class V1_Engine {
|
|
|
378
380
|
// ------------------------------------------- Compile -------------------------------------------
|
|
379
381
|
|
|
380
382
|
async compilePureModelContextData(
|
|
381
|
-
model:
|
|
383
|
+
model: V1_PureModelContext,
|
|
382
384
|
options?: { onError?: (() => void) | undefined } | undefined,
|
|
383
385
|
): Promise<V1_CompilationResult> {
|
|
384
386
|
try {
|
|
385
387
|
const compilationResult = await this.engineServerClient.compile(
|
|
386
|
-
this.
|
|
388
|
+
this.serializePureModelContext(model),
|
|
387
389
|
);
|
|
388
390
|
return {
|
|
389
391
|
warnings: (
|
|
@@ -425,7 +427,7 @@ export class V1_Engine {
|
|
|
425
427
|
});
|
|
426
428
|
const pureModelContextDataJson = compileContext
|
|
427
429
|
? mergeObjects(
|
|
428
|
-
this.
|
|
430
|
+
this.serializePureModelContext(compileContext),
|
|
429
431
|
mainGraph,
|
|
430
432
|
false,
|
|
431
433
|
)
|
|
@@ -469,14 +471,12 @@ export class V1_Engine {
|
|
|
469
471
|
}
|
|
470
472
|
|
|
471
473
|
async getLambdaReturnType(
|
|
472
|
-
|
|
473
|
-
model: V1_PureModelContextData,
|
|
474
|
+
lambdaReturnInput: V1_LambdaReturnTypeInput,
|
|
474
475
|
): Promise<string> {
|
|
475
476
|
try {
|
|
476
477
|
return (
|
|
477
478
|
(await this.engineServerClient.lambdaReturnType(
|
|
478
|
-
|
|
479
|
-
this.serializePureModelContextData(model),
|
|
479
|
+
V1_LambdaReturnTypeInput.serialization.toJson(lambdaReturnInput),
|
|
480
480
|
)) as unknown as V1_LambdaReturnTypeResult
|
|
481
481
|
).returnType;
|
|
482
482
|
} catch (error) {
|
|
@@ -23,7 +23,10 @@ import {
|
|
|
23
23
|
HttpHeader,
|
|
24
24
|
} from '@finos/legend-shared';
|
|
25
25
|
import type { V1_PureModelContextData } from '../model/context/V1_PureModelContextData.js';
|
|
26
|
-
import type {
|
|
26
|
+
import type {
|
|
27
|
+
V1_LambdaReturnTypeInput,
|
|
28
|
+
V1_LambdaReturnTypeResult,
|
|
29
|
+
} from './compilation/V1_LambdaReturnType.js';
|
|
27
30
|
import type { V1_ServiceRegistrationResult } from './service/V1_ServiceRegistrationResult.js';
|
|
28
31
|
import type { V1_ServiceConfigurationInfo } from './service/V1_ServiceConfiguration.js';
|
|
29
32
|
import type { V1_CompileResult } from './compilation/V1_CompileResult.js';
|
|
@@ -411,7 +414,7 @@ export class V1_EngineServerClient extends AbstractServerClient {
|
|
|
411
414
|
// ------------------------------------------- Compile -------------------------------------------
|
|
412
415
|
|
|
413
416
|
compile = (
|
|
414
|
-
model: PlainObject<
|
|
417
|
+
model: PlainObject<V1_PureModelContext>,
|
|
415
418
|
): Promise<PlainObject<V1_CompileResult>> =>
|
|
416
419
|
this.postWithTracing(
|
|
417
420
|
this.getTraceData(CORE_ENGINE_ACTIVITY_TRACE.COMPILE),
|
|
@@ -423,13 +426,12 @@ export class V1_EngineServerClient extends AbstractServerClient {
|
|
|
423
426
|
{ enableCompression: true },
|
|
424
427
|
);
|
|
425
428
|
lambdaReturnType = (
|
|
426
|
-
|
|
427
|
-
model: PlainObject<V1_PureModelContextData>,
|
|
429
|
+
input: PlainObject<V1_LambdaReturnTypeInput>,
|
|
428
430
|
): Promise<PlainObject<V1_LambdaReturnTypeResult>> =>
|
|
429
431
|
this.postWithTracing(
|
|
430
432
|
this.getTraceData(CORE_ENGINE_ACTIVITY_TRACE.GET_LAMBDA_RETURN_TYPE),
|
|
431
433
|
`${this._pure()}/compilation/lambdaReturnType`,
|
|
432
|
-
|
|
434
|
+
input,
|
|
433
435
|
{},
|
|
434
436
|
undefined,
|
|
435
437
|
undefined,
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
|
|
18
|
+
import { createModelSchema } from 'serializr';
|
|
19
|
+
import type { V1_PureModelContext } from '../../model/context/V1_PureModelContext.js';
|
|
20
|
+
import type { V1_RawLambda } from '../../model/rawValueSpecification/V1_RawLambda.js';
|
|
21
|
+
import { V1_rawLambdaModelSchema } from '../../transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.js';
|
|
22
|
+
import { V1_pureModelContextPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization.js';
|
|
23
|
+
|
|
24
|
+
export class V1_LambdaReturnTypeInput {
|
|
25
|
+
model: V1_PureModelContext;
|
|
26
|
+
lambda: V1_RawLambda;
|
|
27
|
+
|
|
28
|
+
constructor(model: V1_PureModelContext, lambda: V1_RawLambda) {
|
|
29
|
+
this.model = model;
|
|
30
|
+
this.lambda = lambda;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static readonly serialization = new SerializationFactory(
|
|
34
|
+
createModelSchema(V1_LambdaReturnTypeInput, {
|
|
35
|
+
lambda: usingModelSchema(V1_rawLambdaModelSchema),
|
|
36
|
+
model: V1_pureModelContextPropSchema,
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface V1_LambdaReturnTypeResult {
|
|
42
|
+
returnType: string;
|
|
43
|
+
}
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { SerializationFactory, usingModelSchema } from '@finos/legend-shared';
|
|
18
|
-
import { createModelSchema,
|
|
19
|
-
import {
|
|
18
|
+
import { createModelSchema, primitive, list } from 'serializr';
|
|
19
|
+
import type { V1_PureModelContext } from '../../model/context/V1_PureModelContext.js';
|
|
20
20
|
import type { V1_UniqueTestId } from '../../model/test/V1_UniqueTestId.js';
|
|
21
21
|
import { V1_uniqueTestIdModelSchema } from '../../transformation/pureProtocol/serializationHelpers/V1_TestSerializationHelper.js';
|
|
22
|
+
import { V1_pureModelContextPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization.js';
|
|
22
23
|
|
|
23
24
|
export class V1_RunTestsTestableInput {
|
|
24
25
|
testable!: string;
|
|
@@ -33,12 +34,12 @@ export class V1_RunTestsTestableInput {
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export class V1_RunTestsInput {
|
|
36
|
-
model!:
|
|
37
|
+
model!: V1_PureModelContext;
|
|
37
38
|
testables: V1_RunTestsTestableInput[] = [];
|
|
38
39
|
|
|
39
40
|
static readonly serialization = new SerializationFactory(
|
|
40
41
|
createModelSchema(V1_RunTestsInput, {
|
|
41
|
-
model:
|
|
42
|
+
model: V1_pureModelContextPropSchema,
|
|
42
43
|
testables: usingModelSchema(
|
|
43
44
|
V1_RunTestsTestableInput.serialization.schema,
|
|
44
45
|
),
|
package/tsconfig.json
CHANGED
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
"./src/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationResult.ts",
|
|
336
336
|
"./src/graphManager/protocol/pure/v1/engine/compilation/V1_CompilationWarning.ts",
|
|
337
337
|
"./src/graphManager/protocol/pure/v1/engine/compilation/V1_CompileResult.ts",
|
|
338
|
-
"./src/graphManager/protocol/pure/v1/engine/compilation/
|
|
338
|
+
"./src/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnType.ts",
|
|
339
339
|
"./src/graphManager/protocol/pure/v1/engine/execution/V1_ExecuteInput.ts",
|
|
340
340
|
"./src/graphManager/protocol/pure/v1/engine/execution/V1_ExecutionError.ts",
|
|
341
341
|
"./src/graphManager/protocol/pure/v1/engine/execution/V1_ExecutionHelper.ts",
|
package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnTypeResult.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"V1_LambdaReturnTypeResult.d.ts","sourceRoot":"","sources":["../../../../../../../src/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnTypeResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=V1_LambdaReturnTypeResult.js.map
|
package/lib/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnTypeResult.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"V1_LambdaReturnTypeResult.js","sourceRoot":"","sources":["../../../../../../../src/graphManager/protocol/pure/v1/engine/compilation/V1_LambdaReturnTypeResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
export interface V1_LambdaReturnTypeResult {
|
|
18
|
-
returnType: string;
|
|
19
|
-
}
|