@finos/legend-graph 31.1.2 → 31.1.4
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/__lib__/GraphManagerEvent.d.ts +2 -1
- package/lib/__lib__/GraphManagerEvent.d.ts.map +1 -1
- package/lib/__lib__/GraphManagerEvent.js +1 -0
- package/lib/__lib__/GraphManagerEvent.js.map +1 -1
- package/lib/graph/metamodel/pure/packageableElements/service/TestGenerationResult.d.ts +21 -0
- package/lib/graph/metamodel/pure/packageableElements/service/TestGenerationResult.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/service/TestGenerationResult.js +22 -0
- package/lib/graph/metamodel/pure/packageableElements/service/TestGenerationResult.js.map +1 -0
- package/lib/graph-manager/AbstractPureGraphManager.d.ts +4 -0
- package/lib/graph-manager/AbstractPureGraphManager.d.ts.map +1 -1
- package/lib/graph-manager/AbstractPureGraphManager.js.map +1 -1
- package/lib/graph-manager/action/execution/ExecutionResult.d.ts +1 -0
- package/lib/graph-manager/action/execution/ExecutionResult.d.ts.map +1 -1
- package/lib/graph-manager/action/execution/ExecutionResult.js +10 -1
- package/lib/graph-manager/action/execution/ExecutionResult.js.map +1 -1
- package/lib/graph-manager/action/relational/RelationalDatabaseTypeConfiguration.d.ts +21 -0
- package/lib/graph-manager/action/relational/RelationalDatabaseTypeConfiguration.d.ts.map +1 -0
- package/lib/graph-manager/action/relational/RelationalDatabaseTypeConfiguration.js +21 -0
- package/lib/graph-manager/action/relational/RelationalDatabaseTypeConfiguration.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts +4 -0
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +46 -1
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/V1_Engine.d.ts +5 -0
- package/lib/graph-manager/protocol/pure/v1/engine/V1_Engine.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/V1_Engine.js +15 -0
- package/lib/graph-manager/protocol/pure/v1/engine/V1_Engine.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts +6 -0
- package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.js +7 -0
- package/lib/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/engine/relational/V1_RelationalConnectionBuilder.d.ts +23 -0
- package/lib/graph-manager/protocol/pure/v1/engine/relational/V1_RelationalConnectionBuilder.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/engine/relational/V1_RelationalConnectionBuilder.js +28 -0
- package/lib/graph-manager/protocol/pure/v1/engine/relational/V1_RelationalConnectionBuilder.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationInput.d.ts +33 -0
- package/lib/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationInput.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationInput.js +40 -0
- package/lib/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationInput.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationResult.d.ts +26 -0
- package/lib/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationResult.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationResult.js +27 -0
- package/lib/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationResult.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/package.json +1 -1
- package/package.json +1 -1
- package/src/__lib__/GraphManagerEvent.ts +1 -0
- package/src/graph/metamodel/pure/packageableElements/service/TestGenerationResult.ts +25 -0
- package/src/graph-manager/AbstractPureGraphManager.ts +15 -0
- package/src/graph-manager/action/execution/ExecutionResult.ts +17 -1
- package/src/graph-manager/action/relational/RelationalDatabaseTypeConfiguration.ts +21 -0
- package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +88 -0
- package/src/graph-manager/protocol/pure/v1/engine/V1_Engine.ts +36 -0
- package/src/graph-manager/protocol/pure/v1/engine/V1_EngineServerClient.ts +25 -0
- package/src/graph-manager/protocol/pure/v1/engine/relational/V1_RelationalConnectionBuilder.ts +32 -0
- package/src/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationInput.ts +46 -0
- package/src/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationResult.ts +50 -0
- package/src/index.ts +3 -0
- package/tsconfig.json +5 -0
|
@@ -98,9 +98,11 @@ import type {
|
|
|
98
98
|
SubtypeInfo,
|
|
99
99
|
} from './action/protocol/ProtocolInfo.js';
|
|
100
100
|
import type { FunctionActivatorConfiguration } from './action/functionActivator/FunctionActivatorConfiguration.js';
|
|
101
|
+
import type { RelationalDatabaseTypeConfiguration } from './action/relational/RelationalDatabaseTypeConfiguration.js';
|
|
101
102
|
import type { FunctionActivator } from '../graph/metamodel/pure/packageableElements/function/FunctionActivator.js';
|
|
102
103
|
import type { RelationalDatabaseConnection } from '../STO_Relational_Exports.js';
|
|
103
104
|
import type { ArtifactGenerationExtensionResult } from './action/generation/ArtifactGenerationExtensionResult.js';
|
|
105
|
+
import type { TestDataGenerationResult } from '../graph/metamodel/pure/packageableElements/service/TestGenerationResult.js';
|
|
104
106
|
|
|
105
107
|
export interface TEMPORARY__EngineSetupConfig {
|
|
106
108
|
env: string;
|
|
@@ -412,6 +414,15 @@ export abstract class AbstractPureGraphManager {
|
|
|
412
414
|
graph: PureModel,
|
|
413
415
|
): Promise<Entity[]>;
|
|
414
416
|
|
|
417
|
+
// --------------------------------------------- Test Data Generation ---------------------------------------------
|
|
418
|
+
|
|
419
|
+
abstract generateTestData(
|
|
420
|
+
query: RawLambda,
|
|
421
|
+
mapping: string,
|
|
422
|
+
runtime: string,
|
|
423
|
+
graph: PureModel,
|
|
424
|
+
): Promise<TestDataGenerationResult>;
|
|
425
|
+
|
|
415
426
|
// ------------------------------------------- External Format ----------------------------------
|
|
416
427
|
|
|
417
428
|
abstract getAvailableExternalFormatsDescriptions(): Promise<
|
|
@@ -581,6 +592,10 @@ export abstract class AbstractPureGraphManager {
|
|
|
581
592
|
graph: PureModel,
|
|
582
593
|
): Promise<Entity[]>;
|
|
583
594
|
|
|
595
|
+
abstract getAvailableRelationalDatabaseTypeConfigurations(): Promise<
|
|
596
|
+
RelationalDatabaseTypeConfiguration[] | undefined
|
|
597
|
+
>;
|
|
598
|
+
|
|
584
599
|
// ------------------------------------------- Service -------------------------------------------
|
|
585
600
|
/**
|
|
586
601
|
* @modularize
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { uuid } from '@finos/legend-shared';
|
|
17
|
+
import { guaranteeNonNullable, uuid } from '@finos/legend-shared';
|
|
18
18
|
|
|
19
19
|
// Core
|
|
20
20
|
export enum BuilderType {
|
|
@@ -138,3 +138,19 @@ export class ClassExecutionResult extends ExecutionResult {
|
|
|
138
138
|
override builder = new ClassBuilder(BuilderType.CLASS_BUILDER);
|
|
139
139
|
objects!: object;
|
|
140
140
|
}
|
|
141
|
+
|
|
142
|
+
export const getTDSRowRankByColumnInAsc = (
|
|
143
|
+
a: TDSRow,
|
|
144
|
+
b: TDSRow,
|
|
145
|
+
colIndex: number,
|
|
146
|
+
): number => {
|
|
147
|
+
const a1 =
|
|
148
|
+
a.values[colIndex] === null || a.values[colIndex] === undefined
|
|
149
|
+
? -Infinity
|
|
150
|
+
: a.values[colIndex];
|
|
151
|
+
const b1 =
|
|
152
|
+
b.values[colIndex] === null || b.values[colIndex] === undefined
|
|
153
|
+
? -Infinity
|
|
154
|
+
: b.values[colIndex];
|
|
155
|
+
return Number(guaranteeNonNullable(a1)) - Number(guaranteeNonNullable(b1));
|
|
156
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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 class RelationalDatabaseTypeConfiguration {
|
|
18
|
+
type!: string;
|
|
19
|
+
compatibleAuthStrategies: string[] = [];
|
|
20
|
+
compatibleDataSources: string[] = [];
|
|
21
|
+
}
|
|
@@ -36,6 +36,8 @@ import {
|
|
|
36
36
|
isNonNullable,
|
|
37
37
|
filterByType,
|
|
38
38
|
isString,
|
|
39
|
+
assertNonEmptyString,
|
|
40
|
+
uniq,
|
|
39
41
|
} from '@finos/legend-shared';
|
|
40
42
|
import type { TEMPORARY__AbstractEngineConfig } from '../../../../graph-manager/action/TEMPORARY__AbstractEngineConfig.js';
|
|
41
43
|
import {
|
|
@@ -304,6 +306,10 @@ import {
|
|
|
304
306
|
V1_buildArtifactsByExtensionElement,
|
|
305
307
|
} from './engine/generation/V1_ArtifactGenerationExtensionApi.js';
|
|
306
308
|
import type { V1_RawValueSpecification } from './model/rawValueSpecification/V1_RawValueSpecification.js';
|
|
309
|
+
import { V1_TestDataGenerationInput } from './engine/service/V1_TestDataGenerationInput.js';
|
|
310
|
+
import type { TestDataGenerationResult } from '../../../../graph/metamodel/pure/packageableElements/service/TestGenerationResult.js';
|
|
311
|
+
import { V1_buildTestDataGenerationResult } from './engine/service/V1_TestDataGenerationResult.js';
|
|
312
|
+
import { RelationalDatabaseTypeConfiguration } from '../../../action/relational/RelationalDatabaseTypeConfiguration.js';
|
|
307
313
|
|
|
308
314
|
class V1_PureModelContextDataIndex {
|
|
309
315
|
elements: V1_PackageableElement[] = [];
|
|
@@ -2060,6 +2066,37 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2060
2066
|
return this.pureModelContextDataToEntities(generatedModel);
|
|
2061
2067
|
}
|
|
2062
2068
|
|
|
2069
|
+
// --------------------------------------------- Test Data Generation ---------------------------------------------
|
|
2070
|
+
|
|
2071
|
+
async generateTestData(
|
|
2072
|
+
query: RawLambda,
|
|
2073
|
+
mapping: string,
|
|
2074
|
+
runtime: string,
|
|
2075
|
+
graph: PureModel,
|
|
2076
|
+
): Promise<TestDataGenerationResult> {
|
|
2077
|
+
const testDataGenerationInput = new V1_TestDataGenerationInput();
|
|
2078
|
+
testDataGenerationInput.query = V1_transformRawLambda(
|
|
2079
|
+
query,
|
|
2080
|
+
new V1_GraphTransformerContextBuilder(
|
|
2081
|
+
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
2082
|
+
).build(),
|
|
2083
|
+
);
|
|
2084
|
+
testDataGenerationInput.mapping = mapping;
|
|
2085
|
+
testDataGenerationInput.runtime = runtime;
|
|
2086
|
+
const graphData = this.getFullGraphModelContext(
|
|
2087
|
+
graph,
|
|
2088
|
+
V1_PureGraphManager.DEV_PROTOCOL_VERSION,
|
|
2089
|
+
);
|
|
2090
|
+
testDataGenerationInput.model = graphData;
|
|
2091
|
+
return V1_buildTestDataGenerationResult(
|
|
2092
|
+
await this.engine.generateTestData(
|
|
2093
|
+
testDataGenerationInput,
|
|
2094
|
+
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
2095
|
+
),
|
|
2096
|
+
this.getBuilderContext(graph, graph, new V1_Mapping()), // use a dummy V1_PackageableElement to generate V1_GraphBuilderContext which is used in V1_buildEmbeddedData()
|
|
2097
|
+
);
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2063
2100
|
// ------------------------------------------- Test -------------------------------------------
|
|
2064
2101
|
|
|
2065
2102
|
async runTests(
|
|
@@ -3021,6 +3058,57 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
3021
3058
|
return this.pureModelContextDataToEntities(generatedModel);
|
|
3022
3059
|
}
|
|
3023
3060
|
|
|
3061
|
+
async getAvailableRelationalDatabaseTypeConfigurations(): Promise<
|
|
3062
|
+
RelationalDatabaseTypeConfiguration[] | undefined
|
|
3063
|
+
> {
|
|
3064
|
+
try {
|
|
3065
|
+
const configs =
|
|
3066
|
+
await this.engine.getAvailableRelationalDatabaseTypeConfigurations();
|
|
3067
|
+
return uniq(configs.map((e) => e.dbType)).map((type) => {
|
|
3068
|
+
assertNonEmptyString(
|
|
3069
|
+
type,
|
|
3070
|
+
'Property dbType missing in database authentication flow',
|
|
3071
|
+
);
|
|
3072
|
+
const compatibles = configs.filter((f) => f.dbType === type);
|
|
3073
|
+
const config = new RelationalDatabaseTypeConfiguration();
|
|
3074
|
+
config.type = type;
|
|
3075
|
+
config.compatibleAuthStrategies = uniq(
|
|
3076
|
+
compatibles
|
|
3077
|
+
.map((aFlow) => aFlow.authStrategy)
|
|
3078
|
+
.flat()
|
|
3079
|
+
.map((e) => {
|
|
3080
|
+
assertNonEmptyString(
|
|
3081
|
+
e,
|
|
3082
|
+
'Property authStrategy missing in database authentication flow',
|
|
3083
|
+
);
|
|
3084
|
+
return e;
|
|
3085
|
+
}),
|
|
3086
|
+
);
|
|
3087
|
+
config.compatibleDataSources = uniq(
|
|
3088
|
+
compatibles
|
|
3089
|
+
.map((aFlow) => aFlow.dataSource)
|
|
3090
|
+
.flat()
|
|
3091
|
+
.map((dataSource) => {
|
|
3092
|
+
assertNonEmptyString(
|
|
3093
|
+
dataSource,
|
|
3094
|
+
'Property dataSource missing in database authentication flow',
|
|
3095
|
+
);
|
|
3096
|
+
return dataSource;
|
|
3097
|
+
}),
|
|
3098
|
+
);
|
|
3099
|
+
return config;
|
|
3100
|
+
});
|
|
3101
|
+
} catch (error) {
|
|
3102
|
+
assertErrorThrown(error);
|
|
3103
|
+
assertErrorThrown(error);
|
|
3104
|
+
this.logService.error(
|
|
3105
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.RELATIONAL_CONNECTION),
|
|
3106
|
+
error,
|
|
3107
|
+
);
|
|
3108
|
+
return undefined;
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
|
|
3024
3112
|
// --------------------------------------------- Service ---------------------------------------------
|
|
3025
3113
|
|
|
3026
3114
|
async registerService(
|
|
@@ -136,6 +136,12 @@ import {
|
|
|
136
136
|
V1_ArtifactGenerationExtensionInput,
|
|
137
137
|
} from './generation/V1_ArtifactGenerationExtensionApi.js';
|
|
138
138
|
import { V1_DatabaseToModelGenerationInput } from './relational/V1_DatabaseToModelGenerationInput.js';
|
|
139
|
+
import { V1_TestDataGenerationInput } from './service/V1_TestDataGenerationInput.js';
|
|
140
|
+
import {
|
|
141
|
+
type V1_TestDataGenerationResult,
|
|
142
|
+
V1_testDataGenerationResultModelSchema,
|
|
143
|
+
} from './service/V1_TestDataGenerationResult.js';
|
|
144
|
+
import { V1_RelationalConnectionBuilder } from './relational/V1_RelationalConnectionBuilder.js';
|
|
139
145
|
|
|
140
146
|
class V1_EngineConfig extends TEMPORARY__AbstractEngineConfig {
|
|
141
147
|
private engine: V1_Engine;
|
|
@@ -719,6 +725,20 @@ export class V1_Engine {
|
|
|
719
725
|
);
|
|
720
726
|
}
|
|
721
727
|
|
|
728
|
+
// --------------------------------------------- Test Data Generation ---------------------------------------------
|
|
729
|
+
|
|
730
|
+
async generateTestData(
|
|
731
|
+
input: V1_TestDataGenerationInput,
|
|
732
|
+
plugins: PureProtocolProcessorPlugin[],
|
|
733
|
+
): Promise<V1_TestDataGenerationResult> {
|
|
734
|
+
return deserialize(
|
|
735
|
+
V1_testDataGenerationResultModelSchema(plugins),
|
|
736
|
+
await this.engineServerClient.generateTestData(
|
|
737
|
+
V1_TestDataGenerationInput.serialization.toJson(input),
|
|
738
|
+
),
|
|
739
|
+
);
|
|
740
|
+
}
|
|
741
|
+
|
|
722
742
|
// ------------------------------------------- File Generation -------------------------------------------
|
|
723
743
|
|
|
724
744
|
async getAvailableGenerationConfigurationDescriptions(): Promise<
|
|
@@ -1041,4 +1061,20 @@ export class V1_Engine {
|
|
|
1041
1061
|
throw error;
|
|
1042
1062
|
}
|
|
1043
1063
|
}
|
|
1064
|
+
|
|
1065
|
+
async getAvailableRelationalDatabaseTypeConfigurations(): Promise<
|
|
1066
|
+
V1_RelationalConnectionBuilder[]
|
|
1067
|
+
> {
|
|
1068
|
+
try {
|
|
1069
|
+
return (
|
|
1070
|
+
await this.engineServerClient.getAvailableRelationalDatabaseTypeConfigurations()
|
|
1071
|
+
).map((dbTypeToDataSourceAndAuthMap) =>
|
|
1072
|
+
V1_RelationalConnectionBuilder.serialization.fromJson(
|
|
1073
|
+
dbTypeToDataSourceAndAuthMap,
|
|
1074
|
+
),
|
|
1075
|
+
);
|
|
1076
|
+
} catch (error) {
|
|
1077
|
+
return [];
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1044
1080
|
}
|
|
@@ -78,12 +78,16 @@ import type {
|
|
|
78
78
|
V1_ArtifactGenerationExtensionOutput,
|
|
79
79
|
} from './generation/V1_ArtifactGenerationExtensionApi.js';
|
|
80
80
|
import type { V1_DatabaseToModelGenerationInput } from './relational/V1_DatabaseToModelGenerationInput.js';
|
|
81
|
+
import type { V1_TestDataGenerationInput } from './service/V1_TestDataGenerationInput.js';
|
|
82
|
+
import type { V1_TestDataGenerationResult } from './service/V1_TestDataGenerationResult.js';
|
|
83
|
+
import type { V1_RelationalConnectionBuilder } from './relational/V1_RelationalConnectionBuilder.js';
|
|
81
84
|
|
|
82
85
|
enum CORE_ENGINE_ACTIVITY_TRACE {
|
|
83
86
|
GRAMMAR_TO_JSON = 'transform Pure code to protocol',
|
|
84
87
|
JSON_TO_GRAMMAR = 'transform protocol to Pure code',
|
|
85
88
|
|
|
86
89
|
DATABASE_TO_MODELS = 'generate models from database',
|
|
90
|
+
TEST_DATA_GENERATION = 'generate test data',
|
|
87
91
|
|
|
88
92
|
EXTERNAL_FORMAT_TO_PROTOCOL = 'transform external format code to protocol',
|
|
89
93
|
GENERATE_FILE = 'generate file',
|
|
@@ -502,6 +506,20 @@ export class V1_EngineServerClient extends AbstractServerClient {
|
|
|
502
506
|
PlainObject<V1_GenerationConfigurationDescription>[]
|
|
503
507
|
> => this.get(`${this._pure()}/schemaGeneration/availableGenerations`);
|
|
504
508
|
|
|
509
|
+
// --------------------------------------------- Test Data Generation ---------------------------------------------
|
|
510
|
+
|
|
511
|
+
_testDataGeneration = (): string => `${this._pure()}/testData/generation`;
|
|
512
|
+
|
|
513
|
+
generateTestData(
|
|
514
|
+
input: PlainObject<V1_TestDataGenerationInput>,
|
|
515
|
+
): Promise<PlainObject<V1_TestDataGenerationResult>> {
|
|
516
|
+
return this.postWithTracing(
|
|
517
|
+
this.getTraceData(CORE_ENGINE_ACTIVITY_TRACE.TEST_DATA_GENERATION),
|
|
518
|
+
`${this._testDataGeneration()}/DONOTUSE_generateTestData`,
|
|
519
|
+
this.debugPayload(input, CORE_ENGINE_ACTIVITY_TRACE.TEST_DATA_GENERATION),
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
|
|
505
523
|
// ------------------------------------------- Compile -------------------------------------------
|
|
506
524
|
|
|
507
525
|
compile = (
|
|
@@ -791,6 +809,13 @@ export class V1_EngineServerClient extends AbstractServerClient {
|
|
|
791
809
|
);
|
|
792
810
|
}
|
|
793
811
|
|
|
812
|
+
getAvailableRelationalDatabaseTypeConfigurations = (): Promise<
|
|
813
|
+
PlainObject<V1_RelationalConnectionBuilder>[]
|
|
814
|
+
> =>
|
|
815
|
+
this.get(
|
|
816
|
+
`${this._relationalElement()}/connection/supportedDbAuthenticationFlows`,
|
|
817
|
+
);
|
|
818
|
+
|
|
794
819
|
// ------------------------------------------- Service -------------------------------------------
|
|
795
820
|
|
|
796
821
|
_service = (serviceServerUrl?: string): string =>
|
package/src/graph-manager/protocol/pure/v1/engine/relational/V1_RelationalConnectionBuilder.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
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 { primitive, createModelSchema } from 'serializr';
|
|
18
|
+
import { SerializationFactory } from '@finos/legend-shared';
|
|
19
|
+
|
|
20
|
+
export class V1_RelationalConnectionBuilder {
|
|
21
|
+
dbType!: string;
|
|
22
|
+
authStrategy!: string;
|
|
23
|
+
dataSource!: string;
|
|
24
|
+
|
|
25
|
+
static readonly serialization = new SerializationFactory(
|
|
26
|
+
createModelSchema(V1_RelationalConnectionBuilder, {
|
|
27
|
+
dbType: primitive(),
|
|
28
|
+
authStrategy: primitive(),
|
|
29
|
+
dataSource: primitive(),
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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, optional, primitive } 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_pureModelContextPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization.js';
|
|
22
|
+
import { V1_rawLambdaModelSchema } from '../../transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.js';
|
|
23
|
+
|
|
24
|
+
export class V1_TestDataGenerationInput {
|
|
25
|
+
clientVersion: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Studio does not process value specification, they are left in raw JSON form
|
|
28
|
+
*
|
|
29
|
+
* Should be optional. For now, it's mandatory.
|
|
30
|
+
* @discrepancy model
|
|
31
|
+
*/
|
|
32
|
+
query!: V1_RawLambda;
|
|
33
|
+
mapping!: string;
|
|
34
|
+
runtime!: string;
|
|
35
|
+
model!: V1_PureModelContext;
|
|
36
|
+
|
|
37
|
+
static readonly serialization = new SerializationFactory(
|
|
38
|
+
createModelSchema(V1_TestDataGenerationInput, {
|
|
39
|
+
clientVersion: optional(primitive()),
|
|
40
|
+
query: usingModelSchema(V1_rawLambdaModelSchema),
|
|
41
|
+
mapping: primitive(),
|
|
42
|
+
model: V1_pureModelContextPropSchema,
|
|
43
|
+
runtime: primitive(),
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { createModelSchema, list, custom, type ModelSchema } from 'serializr';
|
|
18
|
+
import type { V1_EmbeddedData } from '../../model/data/V1_EmbeddedData.js';
|
|
19
|
+
import {
|
|
20
|
+
V1_deserializeEmbeddedDataType,
|
|
21
|
+
V1_serializeEmbeddedDataType,
|
|
22
|
+
} from '../../transformation/pureProtocol/serializationHelpers/V1_DataElementSerializationHelper.js';
|
|
23
|
+
import type { PureProtocolProcessorPlugin } from '../../../PureProtocolProcessorPlugin.js';
|
|
24
|
+
import type { V1_GraphBuilderContext } from '../../transformation/pureGraph/to/V1_GraphBuilderContext.js';
|
|
25
|
+
import { TestDataGenerationResult } from '../../../../../../graph/metamodel/pure/packageableElements/service/TestGenerationResult.js';
|
|
26
|
+
import { V1_buildEmbeddedData } from '../../transformation/pureGraph/to/helpers/V1_DataElementBuilderHelper.js';
|
|
27
|
+
|
|
28
|
+
export class V1_TestDataGenerationResult {
|
|
29
|
+
data: V1_EmbeddedData[] = [];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const V1_testDataGenerationResultModelSchema = (
|
|
33
|
+
plugins: PureProtocolProcessorPlugin[],
|
|
34
|
+
): ModelSchema<V1_TestDataGenerationResult> =>
|
|
35
|
+
createModelSchema(V1_TestDataGenerationResult, {
|
|
36
|
+
data: list(
|
|
37
|
+
custom(
|
|
38
|
+
(val) => V1_serializeEmbeddedDataType(val, plugins),
|
|
39
|
+
(val) => V1_deserializeEmbeddedDataType(val, plugins),
|
|
40
|
+
),
|
|
41
|
+
),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const V1_buildTestDataGenerationResult = (
|
|
45
|
+
protocol: V1_TestDataGenerationResult,
|
|
46
|
+
context: V1_GraphBuilderContext,
|
|
47
|
+
): TestDataGenerationResult =>
|
|
48
|
+
new TestDataGenerationResult(
|
|
49
|
+
protocol.data.map((p) => V1_buildEmbeddedData(p, context)),
|
|
50
|
+
);
|
package/src/index.ts
CHANGED
|
@@ -70,6 +70,7 @@ export {
|
|
|
70
70
|
TagExplicitReference,
|
|
71
71
|
} from './graph/metamodel/pure/packageableElements/domain/TagReference.js';
|
|
72
72
|
export * from './graph/metamodel/pure/packageableElements/service/ExecutionEnvironmentInstance.js';
|
|
73
|
+
export { TestDataGenerationResult } from './graph/metamodel/pure/packageableElements/service/TestGenerationResult.js';
|
|
73
74
|
export { FunctionActivator } from './graph/metamodel/pure/packageableElements/function/FunctionActivator.js';
|
|
74
75
|
export { INTERNAL__UnknownFunctionActivator } from './graph/metamodel/pure/packageableElements/function/INTERNAL__UnknownFunctionActivator.js';
|
|
75
76
|
|
|
@@ -220,6 +221,7 @@ export {
|
|
|
220
221
|
TDSExecutionResult as TDSExecutionResult,
|
|
221
222
|
RawExecutionResult,
|
|
222
223
|
EXECUTION_SERIALIZATION_FORMAT,
|
|
224
|
+
getTDSRowRankByColumnInAsc,
|
|
223
225
|
} from './graph-manager/action/execution/ExecutionResult.js';
|
|
224
226
|
export { ExternalFormatDescription } from './graph-manager/action/externalFormat/ExternalFormatDescription.js';
|
|
225
227
|
export * from './graph-manager/action/generation/ArtifactGenerationExtensionResult.js';
|
|
@@ -247,6 +249,7 @@ export { SourceInformation } from './graph-manager/action/SourceInformation.js';
|
|
|
247
249
|
export * from './graph-manager/protocol/pure/PureProtocolProcessorPlugin.js';
|
|
248
250
|
export * from './graph-manager/protocol/pure/extensions/DSL_ExternalFormat_PureProtocolProcessorPlugin.js';
|
|
249
251
|
export * from './graph-manager/action/functionActivator/FunctionActivatorConfiguration.js';
|
|
252
|
+
export * from './graph-manager/action/relational/RelationalDatabaseTypeConfiguration.js';
|
|
250
253
|
|
|
251
254
|
// --------------------------------------------- TRANSFORMATION --------------------------------------------------
|
|
252
255
|
|
package/tsconfig.json
CHANGED
|
@@ -196,6 +196,7 @@
|
|
|
196
196
|
"./src/graph/metamodel/pure/packageableElements/service/ServiceTest.ts",
|
|
197
197
|
"./src/graph/metamodel/pure/packageableElements/service/ServiceTestData.ts",
|
|
198
198
|
"./src/graph/metamodel/pure/packageableElements/service/ServiceTestSuite.ts",
|
|
199
|
+
"./src/graph/metamodel/pure/packageableElements/service/TestGenerationResult.ts",
|
|
199
200
|
"./src/graph/metamodel/pure/packageableElements/store/INTERNAL__UnknownStore.ts",
|
|
200
201
|
"./src/graph/metamodel/pure/packageableElements/store/Store.ts",
|
|
201
202
|
"./src/graph/metamodel/pure/packageableElements/store/flatData/connection/FlatDataConnection.ts",
|
|
@@ -326,6 +327,7 @@
|
|
|
326
327
|
"./src/graph-manager/action/protocol/ProtocolInfo.ts",
|
|
327
328
|
"./src/graph-manager/action/query/Query.ts",
|
|
328
329
|
"./src/graph-manager/action/query/QuerySearchSpecification.ts",
|
|
330
|
+
"./src/graph-manager/action/relational/RelationalDatabaseTypeConfiguration.ts",
|
|
329
331
|
"./src/graph-manager/action/service/DEPRECATED__ServiceTestResult.ts",
|
|
330
332
|
"./src/graph-manager/action/service/ServiceExecutionMode.ts",
|
|
331
333
|
"./src/graph-manager/action/service/ServiceRegistrationResult.ts",
|
|
@@ -389,10 +391,13 @@
|
|
|
389
391
|
"./src/graph-manager/protocol/pure/v1/engine/query/V1_Query.ts",
|
|
390
392
|
"./src/graph-manager/protocol/pure/v1/engine/query/V1_QuerySearchSpecification.ts",
|
|
391
393
|
"./src/graph-manager/protocol/pure/v1/engine/relational/V1_DatabaseToModelGenerationInput.ts",
|
|
394
|
+
"./src/graph-manager/protocol/pure/v1/engine/relational/V1_RelationalConnectionBuilder.ts",
|
|
392
395
|
"./src/graph-manager/protocol/pure/v1/engine/service/V1_DEPRECATED__ServiceTestResult.ts",
|
|
393
396
|
"./src/graph-manager/protocol/pure/v1/engine/service/V1_ServiceConfiguration.ts",
|
|
394
397
|
"./src/graph-manager/protocol/pure/v1/engine/service/V1_ServiceRegistrationResult.ts",
|
|
395
398
|
"./src/graph-manager/protocol/pure/v1/engine/service/V1_ServiceStorage.ts",
|
|
399
|
+
"./src/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationInput.ts",
|
|
400
|
+
"./src/graph-manager/protocol/pure/v1/engine/service/V1_TestDataGenerationResult.ts",
|
|
396
401
|
"./src/graph-manager/protocol/pure/v1/engine/test/V1_RunTestsInput.ts",
|
|
397
402
|
"./src/graph-manager/protocol/pure/v1/engine/test/V1_RunTestsResult.ts",
|
|
398
403
|
"./src/graph-manager/protocol/pure/v1/helpers/V1_DomainHelper.ts",
|