@finos/legend-graph 32.1.67 → 32.2.0
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/Core_HashUtils.d.ts +1 -0
- package/lib/graph/Core_HashUtils.d.ts.map +1 -1
- package/lib/graph/Core_HashUtils.js +1 -0
- package/lib/graph/Core_HashUtils.js.map +1 -1
- package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts +10 -5
- package/lib/graph/metamodel/pure/dataProduct/DataProduct.d.ts.map +1 -1
- package/lib/graph/metamodel/pure/dataProduct/DataProduct.js +24 -10
- package/lib/graph/metamodel/pure/dataProduct/DataProduct.js.map +1 -1
- package/lib/graph-manager/AbstractPureGraphManager.d.ts +5 -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/changeDetection/DataProductObserveHelper.d.ts +2 -1
- package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.d.ts.map +1 -1
- package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js +24 -1
- package/lib/graph-manager/action/changeDetection/DataProductObserveHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts +3 -2
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js +62 -12
- package/lib/graph-manager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_EntitlementsDataProduct.d.ts +1 -1
- package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_EntitlementsDataProduct.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_EntitlementsDataProduct.js +1 -1
- package/lib/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_EntitlementsDataProduct.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts +8 -4
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js +17 -7
- package/lib/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js +25 -11
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts +2 -2
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js +9 -6
- package/lib/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts +10 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js +27 -20
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.d.ts +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js +2 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/src/graph/Core_HashUtils.ts +1 -0
- package/src/graph/metamodel/pure/dataProduct/DataProduct.ts +38 -12
- package/src/graph-manager/AbstractPureGraphManager.ts +5 -0
- package/src/graph-manager/action/changeDetection/DataProductObserveHelper.ts +31 -3
- package/src/graph-manager/protocol/pure/v1/V1_PureGraphManager.ts +86 -26
- package/src/graph-manager/protocol/pure/v1/lakehouse/entitlements/V1_EntitlementsDataProduct.ts +1 -1
- package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.ts +28 -9
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataProductTransformer.ts +47 -21
- package/src/graph-manager/protocol/pure/v1/transformation/pureGraph/to/helpers/V1_DataProductBuilder.ts +21 -17
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.ts +42 -33
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_EntitlementSerializationHelper.ts +1 -1
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_ValueSpecificationSerializer.ts +2 -0
- package/src/index.ts +20 -12
|
@@ -2694,7 +2694,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2694
2694
|
lambda: RawLambda,
|
|
2695
2695
|
runtime: Runtime | undefined,
|
|
2696
2696
|
clientVersion: string | undefined,
|
|
2697
|
-
|
|
2697
|
+
options?: ExecutionOptions,
|
|
2698
2698
|
): V1_ExecuteInput =>
|
|
2699
2699
|
this.createExecutionInputWithPureModelContext(
|
|
2700
2700
|
graph.origin
|
|
@@ -2705,7 +2705,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2705
2705
|
runtime,
|
|
2706
2706
|
clientVersion,
|
|
2707
2707
|
new V1_ExecuteInput(),
|
|
2708
|
-
|
|
2708
|
+
options,
|
|
2709
2709
|
);
|
|
2710
2710
|
|
|
2711
2711
|
public createLineageInput = (
|
|
@@ -2714,7 +2714,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2714
2714
|
lambda: RawLambda,
|
|
2715
2715
|
runtime: Runtime | undefined,
|
|
2716
2716
|
clientVersion: string | undefined,
|
|
2717
|
-
parameterValues?: ParameterValue[],
|
|
2718
2717
|
): V1_LineageInput => {
|
|
2719
2718
|
const executionInput = this.createExecutionInput(
|
|
2720
2719
|
graph,
|
|
@@ -2722,7 +2721,6 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2722
2721
|
lambda,
|
|
2723
2722
|
runtime,
|
|
2724
2723
|
clientVersion,
|
|
2725
|
-
parameterValues,
|
|
2726
2724
|
);
|
|
2727
2725
|
|
|
2728
2726
|
const lineageInput = new V1_LineageInput();
|
|
@@ -2741,31 +2739,93 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2741
2739
|
runtime: Runtime | undefined,
|
|
2742
2740
|
clientVersion: string | undefined,
|
|
2743
2741
|
executeInput: V1_ExecuteInput,
|
|
2744
|
-
|
|
2742
|
+
options?: ExecutionOptions | undefined,
|
|
2745
2743
|
): V1_ExecuteInput => {
|
|
2744
|
+
let mappingPath = mapping?.path;
|
|
2745
|
+
const lambdaToExecute = V1_transformRawLambda(
|
|
2746
|
+
lambda,
|
|
2747
|
+
new V1_GraphTransformerContextBuilder(
|
|
2748
|
+
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
2749
|
+
).build(),
|
|
2750
|
+
);
|
|
2751
|
+
let runtimeToExecute = runtime
|
|
2752
|
+
? V1_transformRuntime(
|
|
2753
|
+
runtime,
|
|
2754
|
+
new V1_GraphTransformerContextBuilder(
|
|
2755
|
+
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
2756
|
+
).build(),
|
|
2757
|
+
)
|
|
2758
|
+
: undefined;
|
|
2759
|
+
if (options?.forceFromExpression) {
|
|
2760
|
+
if (runtimeToExecute instanceof V1_RuntimePointer) {
|
|
2761
|
+
const runtimePath = runtimeToExecute.runtime;
|
|
2762
|
+
const body = lambdaToExecute.body;
|
|
2763
|
+
if (body && runtimePath.length) {
|
|
2764
|
+
// handles multi expression lambda (i.e let statement executions)
|
|
2765
|
+
if (Array.isArray(body)) {
|
|
2766
|
+
const expressions = body as object[];
|
|
2767
|
+
if (expressions.length) {
|
|
2768
|
+
const lastIdx = expressions.length - 1;
|
|
2769
|
+
const lastBody = expressions[lastIdx];
|
|
2770
|
+
if (lastBody) {
|
|
2771
|
+
const fromExpression = this.__fromExpression(
|
|
2772
|
+
mappingPath,
|
|
2773
|
+
runtimePath,
|
|
2774
|
+
lastBody,
|
|
2775
|
+
);
|
|
2776
|
+
expressions[lastIdx] = fromExpression;
|
|
2777
|
+
mappingPath = undefined;
|
|
2778
|
+
runtimeToExecute = undefined;
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
} else {
|
|
2782
|
+
const fromExpression = this.__fromExpression(
|
|
2783
|
+
mappingPath,
|
|
2784
|
+
runtimePath,
|
|
2785
|
+
body,
|
|
2786
|
+
);
|
|
2787
|
+
lambdaToExecute.body = fromExpression;
|
|
2788
|
+
mappingPath = undefined;
|
|
2789
|
+
runtimeToExecute = undefined;
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2746
2794
|
return this.createExecutionInputWithPureModelContextWithV1(
|
|
2747
2795
|
data,
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
new V1_GraphTransformerContextBuilder(
|
|
2752
|
-
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
2753
|
-
).build(),
|
|
2754
|
-
),
|
|
2755
|
-
runtime
|
|
2756
|
-
? V1_transformRuntime(
|
|
2757
|
-
runtime,
|
|
2758
|
-
new V1_GraphTransformerContextBuilder(
|
|
2759
|
-
this.pluginManager.getPureProtocolProcessorPlugins(),
|
|
2760
|
-
).build(),
|
|
2761
|
-
)
|
|
2762
|
-
: undefined,
|
|
2796
|
+
mappingPath,
|
|
2797
|
+
lambdaToExecute,
|
|
2798
|
+
runtimeToExecute,
|
|
2763
2799
|
clientVersion,
|
|
2764
2800
|
executeInput,
|
|
2765
|
-
parameterValues,
|
|
2801
|
+
options?.parameterValues,
|
|
2766
2802
|
);
|
|
2767
2803
|
};
|
|
2768
2804
|
|
|
2805
|
+
__fromExpression = (
|
|
2806
|
+
mapping: string | undefined,
|
|
2807
|
+
runtime: string,
|
|
2808
|
+
body: object,
|
|
2809
|
+
): object => {
|
|
2810
|
+
return {
|
|
2811
|
+
_type: 'func',
|
|
2812
|
+
function: 'from',
|
|
2813
|
+
parameters: [
|
|
2814
|
+
body,
|
|
2815
|
+
mapping
|
|
2816
|
+
? {
|
|
2817
|
+
_type: 'packageableElementPtr',
|
|
2818
|
+
fullPath: mapping,
|
|
2819
|
+
}
|
|
2820
|
+
: undefined,
|
|
2821
|
+
{
|
|
2822
|
+
_type: 'packageableElementPtr',
|
|
2823
|
+
fullPath: runtime,
|
|
2824
|
+
},
|
|
2825
|
+
].filter(isNonNullable),
|
|
2826
|
+
};
|
|
2827
|
+
};
|
|
2828
|
+
|
|
2769
2829
|
private createExecutionInputWithPureModelContextWithV1 = (
|
|
2770
2830
|
data: V1_PureModelContext,
|
|
2771
2831
|
mapping: string | undefined,
|
|
@@ -2857,7 +2917,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2857
2917
|
this.engine.config.useDevClientProtocol
|
|
2858
2918
|
? V1_PureGraphManager.DEV_PROTOCOL_VERSION
|
|
2859
2919
|
: V1_PureGraphManager.PROD_PROTOCOL_VERSION,
|
|
2860
|
-
options
|
|
2920
|
+
options,
|
|
2861
2921
|
),
|
|
2862
2922
|
options,
|
|
2863
2923
|
_report,
|
|
@@ -2915,7 +2975,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2915
2975
|
this.engine.config.useDevClientProtocol
|
|
2916
2976
|
? V1_PureGraphManager.DEV_PROTOCOL_VERSION
|
|
2917
2977
|
: V1_PureGraphManager.PROD_PROTOCOL_VERSION,
|
|
2918
|
-
options
|
|
2978
|
+
options,
|
|
2919
2979
|
);
|
|
2920
2980
|
stopWatch.record(GRAPH_MANAGER_EVENT.V1_ENGINE_OPERATION_INPUT__SUCCESS);
|
|
2921
2981
|
const stream = await this.engine.exportData(input, options, contentType);
|
|
@@ -2984,7 +3044,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
2984
3044
|
testInfo.runtime,
|
|
2985
3045
|
V1_PureGraphManager.PROD_PROTOCOL_VERSION,
|
|
2986
3046
|
new V1_ExecuteInput(),
|
|
2987
|
-
options
|
|
3047
|
+
options,
|
|
2988
3048
|
);
|
|
2989
3049
|
const result = V1_buildExecutionResult(
|
|
2990
3050
|
(await this.engine.runQuery(input, options)).executionResult,
|
|
@@ -3096,7 +3156,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
3096
3156
|
runtime,
|
|
3097
3157
|
V1_PureGraphManager.DEV_PROTOCOL_VERSION,
|
|
3098
3158
|
testDataGenerationExecuteInput,
|
|
3099
|
-
options
|
|
3159
|
+
options,
|
|
3100
3160
|
);
|
|
3101
3161
|
testDataGenerationExecuteInput.parameters = parameters;
|
|
3102
3162
|
testDataGenerationExecuteInput.hashStrings = Boolean(
|
|
@@ -3144,7 +3204,7 @@ export class V1_PureGraphManager extends AbstractPureGraphManager {
|
|
|
3144
3204
|
runtime,
|
|
3145
3205
|
V1_PureGraphManager.DEV_PROTOCOL_VERSION,
|
|
3146
3206
|
testDataGenerationExecuteWithSeedInput,
|
|
3147
|
-
options
|
|
3207
|
+
options,
|
|
3148
3208
|
);
|
|
3149
3209
|
testDataGenerationExecuteWithSeedInput.hashStrings = Boolean(
|
|
3150
3210
|
options?.anonymizeGeneratedData,
|
package/src/graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.ts
CHANGED
|
@@ -222,13 +222,29 @@ export abstract class V1_DataProductIcon implements Hashable {
|
|
|
222
222
|
abstract get hashCode(): string;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
export class
|
|
225
|
+
export class V1_DataProductLibraryIcon
|
|
226
|
+
extends V1_DataProductIcon
|
|
227
|
+
implements Hashable
|
|
228
|
+
{
|
|
229
|
+
libraryId!: string;
|
|
230
|
+
iconId!: string;
|
|
231
|
+
|
|
232
|
+
override get hashCode(): string {
|
|
233
|
+
return hashArray([
|
|
234
|
+
CORE_HASH_STRUCTURE.DATA_PRODUCT_ICON_LIBRARY,
|
|
235
|
+
this.libraryId,
|
|
236
|
+
this.iconId,
|
|
237
|
+
]);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export class V1_DataProductEmbeddedImageIcon
|
|
226
242
|
extends V1_DataProductIcon
|
|
227
243
|
implements Hashable
|
|
228
244
|
{
|
|
229
245
|
imageUrl!: string; // base64 encoded image content
|
|
230
246
|
|
|
231
|
-
get hashCode(): string {
|
|
247
|
+
override get hashCode(): string {
|
|
232
248
|
return hashArray([
|
|
233
249
|
CORE_HASH_STRUCTURE.DATA_PRODUCT_ICON_EMBEDDED_IMAGE,
|
|
234
250
|
this.imageUrl,
|
|
@@ -236,14 +252,17 @@ export class V1_EmbeddedImageIcon
|
|
|
236
252
|
}
|
|
237
253
|
}
|
|
238
254
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
255
|
+
// handle incoming icons not yet modeled
|
|
256
|
+
export class V1_UnknownDataProductIcon
|
|
257
|
+
extends V1_DataProductIcon
|
|
258
|
+
implements Hashable
|
|
259
|
+
{
|
|
260
|
+
content!: PlainObject;
|
|
261
|
+
|
|
262
|
+
override get hashCode(): string {
|
|
243
263
|
return hashArray([
|
|
244
|
-
CORE_HASH_STRUCTURE.
|
|
245
|
-
this.
|
|
246
|
-
this.iconId,
|
|
264
|
+
CORE_HASH_STRUCTURE.INTERNAL__UNKNOWN_DATA_PRODUCT_ICON,
|
|
265
|
+
hashObjectWithoutSourceInformation(this.content),
|
|
247
266
|
]);
|
|
248
267
|
}
|
|
249
268
|
}
|
|
@@ -17,29 +17,33 @@
|
|
|
17
17
|
import { UnsupportedOperationError } from '@finos/legend-shared';
|
|
18
18
|
import {
|
|
19
19
|
type AccessPoint,
|
|
20
|
-
LakehouseAccessPoint,
|
|
21
|
-
UnknownAccessPoint,
|
|
22
20
|
type DataProduct,
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
type DataProductIcon,
|
|
22
|
+
DataProductEmbeddedImageIcon,
|
|
23
|
+
DataProductLibraryIcon,
|
|
24
|
+
LakehouseAccessPoint,
|
|
25
25
|
ModelAccessPointGroup,
|
|
26
|
+
UnknownAccessPoint,
|
|
27
|
+
UnknownDataProductIcon,
|
|
26
28
|
} from '../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
|
|
27
29
|
import {
|
|
28
30
|
type V1_AccessPoint,
|
|
31
|
+
type V1_DataProductIcon,
|
|
32
|
+
type V1_DataProductRegion,
|
|
33
|
+
type V1_DeliveryFrequency,
|
|
29
34
|
V1_AccessPointGroup,
|
|
30
35
|
V1_DataProduct,
|
|
31
|
-
|
|
36
|
+
V1_DataProductDiagram,
|
|
37
|
+
V1_DataProductEmbeddedImageIcon,
|
|
38
|
+
V1_DataProductLibraryIcon,
|
|
39
|
+
V1_DataProductRuntimeInfo,
|
|
40
|
+
V1_ElementScope,
|
|
32
41
|
V1_Email,
|
|
33
|
-
V1_EmbeddedImageIcon,
|
|
34
42
|
V1_LakehouseAccessPoint,
|
|
35
|
-
|
|
43
|
+
V1_ModelAccessPointGroup,
|
|
36
44
|
V1_SupportInfo,
|
|
37
45
|
V1_UnknownAccessPoint,
|
|
38
|
-
|
|
39
|
-
V1_ModelAccessPointGroup,
|
|
40
|
-
V1_DataProductRuntimeInfo,
|
|
41
|
-
V1_ElementScope,
|
|
42
|
-
V1_DataProductDiagram,
|
|
46
|
+
V1_UnknownDataProductIcon,
|
|
43
47
|
} from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
|
|
44
48
|
import { V1_initPackageableElement } from './V1_CoreTransformerHelper.js';
|
|
45
49
|
import { V1_transformRawLambda } from './V1_RawValueSpecificationTransformer.js';
|
|
@@ -74,6 +78,28 @@ const transformAccessPoint = (
|
|
|
74
78
|
);
|
|
75
79
|
};
|
|
76
80
|
|
|
81
|
+
const transformDataProductIcon = (
|
|
82
|
+
icon: DataProductIcon,
|
|
83
|
+
): V1_DataProductIcon => {
|
|
84
|
+
if (icon instanceof DataProductLibraryIcon) {
|
|
85
|
+
const dataProductLibraryIcon = new V1_DataProductLibraryIcon();
|
|
86
|
+
dataProductLibraryIcon.libraryId = icon.libraryId;
|
|
87
|
+
dataProductLibraryIcon.iconId = icon.iconId;
|
|
88
|
+
return dataProductLibraryIcon;
|
|
89
|
+
} else if (icon instanceof DataProductEmbeddedImageIcon) {
|
|
90
|
+
const dataProductEmbeddedImageIcon = new V1_DataProductEmbeddedImageIcon();
|
|
91
|
+
dataProductEmbeddedImageIcon.imageUrl = icon.imageUrl;
|
|
92
|
+
return dataProductEmbeddedImageIcon;
|
|
93
|
+
} else if (icon instanceof UnknownDataProductIcon) {
|
|
94
|
+
const unknownDataProductIcon = new V1_UnknownDataProductIcon();
|
|
95
|
+
unknownDataProductIcon.content = icon.content;
|
|
96
|
+
return unknownDataProductIcon;
|
|
97
|
+
}
|
|
98
|
+
throw new UnsupportedOperationError(
|
|
99
|
+
`Can't transform data product icon type: ${icon}`,
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
|
|
77
103
|
export const V1_transformDataProduct = (
|
|
78
104
|
element: DataProduct,
|
|
79
105
|
context: V1_GraphTransformerContext,
|
|
@@ -88,16 +114,13 @@ export const V1_transformDataProduct = (
|
|
|
88
114
|
product.coverageRegions = element.coverageRegions as
|
|
89
115
|
| V1_DataProductRegion[]
|
|
90
116
|
| undefined;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
product.icon =
|
|
96
|
-
} else if (element.icon instanceof EmbeddedImageIcon) {
|
|
97
|
-
const embeddedIcon = new V1_EmbeddedImageIcon();
|
|
98
|
-
embeddedIcon.imageUrl = element.icon.imageUrl;
|
|
99
|
-
product.icon = embeddedIcon;
|
|
117
|
+
|
|
118
|
+
if (!element.icon) {
|
|
119
|
+
product.icon = undefined;
|
|
120
|
+
} else {
|
|
121
|
+
product.icon = transformDataProductIcon(element.icon);
|
|
100
122
|
}
|
|
123
|
+
|
|
101
124
|
if (!element.supportInfo) {
|
|
102
125
|
product.supportInfo = undefined;
|
|
103
126
|
} else {
|
|
@@ -114,6 +137,7 @@ export const V1_transformDataProduct = (
|
|
|
114
137
|
});
|
|
115
138
|
product.supportInfo = supportInfo;
|
|
116
139
|
}
|
|
140
|
+
|
|
117
141
|
product.accessPointGroups = element.accessPointGroups.map(
|
|
118
142
|
(metamodelGroup) => {
|
|
119
143
|
if (metamodelGroup instanceof ModelAccessPointGroup) {
|
|
@@ -181,9 +205,11 @@ export const V1_transformDataProduct = (
|
|
|
181
205
|
return group;
|
|
182
206
|
},
|
|
183
207
|
);
|
|
208
|
+
|
|
184
209
|
product.stereotypes = element.stereotypes.map(V1_transformStereotype);
|
|
185
210
|
product.taggedValues = element.taggedValues.map((taggedValue) =>
|
|
186
211
|
V1_transformTaggedValue(taggedValue),
|
|
187
212
|
);
|
|
213
|
+
|
|
188
214
|
return product;
|
|
189
215
|
};
|
|
@@ -20,35 +20,37 @@ import {
|
|
|
20
20
|
UnsupportedOperationError,
|
|
21
21
|
} from '@finos/legend-shared';
|
|
22
22
|
import {
|
|
23
|
-
LakehouseAccessPoint,
|
|
24
23
|
type AccessPoint,
|
|
25
|
-
UnknownAccessPoint,
|
|
26
|
-
DataProductLink,
|
|
27
|
-
AccessPointGroup,
|
|
28
|
-
ModelAccessPointGroup,
|
|
29
|
-
DataProductRuntimeInfo,
|
|
30
|
-
DataProductElementScope,
|
|
31
24
|
type DataProductElement,
|
|
32
25
|
type DataProductIcon,
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
AccessPointGroup,
|
|
27
|
+
DataProductElementScope,
|
|
28
|
+
DataProductEmbeddedImageIcon,
|
|
29
|
+
DataProductLibraryIcon,
|
|
30
|
+
DataProductLink,
|
|
31
|
+
DataProductRuntimeInfo,
|
|
32
|
+
LakehouseAccessPoint,
|
|
33
|
+
ModelAccessPointGroup,
|
|
34
|
+
UnknownAccessPoint,
|
|
35
|
+
UnknownDataProductIcon,
|
|
35
36
|
} from '../../../../../../../../graph/metamodel/pure/dataProduct/DataProduct.js';
|
|
36
37
|
import {
|
|
38
|
+
type V1_AccessPoint,
|
|
37
39
|
type V1_AccessPointGroup,
|
|
38
40
|
type V1_DataProductIcon,
|
|
39
41
|
type V1_DataProductLink,
|
|
40
|
-
|
|
42
|
+
V1_DataProductEmbeddedImageIcon,
|
|
43
|
+
V1_DataProductLibraryIcon,
|
|
41
44
|
V1_LakehouseAccessPoint,
|
|
42
|
-
V1_LibraryIcon,
|
|
43
45
|
V1_ModelAccessPointGroup,
|
|
44
46
|
V1_UnknownAccessPoint,
|
|
45
|
-
|
|
47
|
+
V1_UnknownDataProductIcon,
|
|
46
48
|
} from '../../../../model/packageableElements/dataProduct/V1_DataProduct.js';
|
|
47
49
|
import type { V1_GraphBuilderContext } from '../V1_GraphBuilderContext.js';
|
|
48
50
|
import { V1_buildRawLambdaWithResolvedPaths } from './V1_ValueSpecificationPathResolver.js';
|
|
49
51
|
import {
|
|
50
|
-
PackageableElementExplicitReference,
|
|
51
52
|
type PackageableElementReference,
|
|
53
|
+
PackageableElementExplicitReference,
|
|
52
54
|
} from '../../../../../../../../graph/metamodel/pure/packageableElements/PackageableElementReference.js';
|
|
53
55
|
import { Package } from '../../../../../../../../graph/metamodel/pure/packageableElements/domain/Package.js';
|
|
54
56
|
import { Class } from '../../../../../../../../graph/metamodel/pure/packageableElements/domain/Class.js';
|
|
@@ -92,10 +94,12 @@ export const V1_buildAccessPoint = (
|
|
|
92
94
|
export const V1_buildDataProductIcon = (
|
|
93
95
|
icon: V1_DataProductIcon,
|
|
94
96
|
): DataProductIcon => {
|
|
95
|
-
if (icon instanceof
|
|
96
|
-
return new
|
|
97
|
-
} else if (icon instanceof
|
|
98
|
-
return new
|
|
97
|
+
if (icon instanceof V1_DataProductLibraryIcon) {
|
|
98
|
+
return new DataProductLibraryIcon(icon.libraryId, icon.iconId);
|
|
99
|
+
} else if (icon instanceof V1_DataProductEmbeddedImageIcon) {
|
|
100
|
+
return new DataProductEmbeddedImageIcon(icon.imageUrl);
|
|
101
|
+
} else if (icon instanceof V1_UnknownDataProductIcon) {
|
|
102
|
+
return new UnknownDataProductIcon(icon.content);
|
|
99
103
|
}
|
|
100
104
|
throw new UnsupportedOperationError(
|
|
101
105
|
`Unsupported data product icon type ${icon}`,
|
|
@@ -23,21 +23,22 @@ import {
|
|
|
23
23
|
} from 'serializr';
|
|
24
24
|
import {
|
|
25
25
|
type V1_AccessPoint,
|
|
26
|
+
type V1_DataProductIcon,
|
|
27
|
+
V1_AccessPointGroup,
|
|
26
28
|
V1_DATA_PRODUCT_ELEMENT_PROTOCOL_TYPE,
|
|
27
29
|
V1_DataProduct,
|
|
30
|
+
V1_DataProductDiagram,
|
|
31
|
+
V1_DataProductEmbeddedImageIcon,
|
|
32
|
+
V1_DataProductLibraryIcon,
|
|
33
|
+
V1_DataProductLink,
|
|
34
|
+
V1_DataProductRuntimeInfo,
|
|
35
|
+
V1_ElementScope,
|
|
28
36
|
V1_Email,
|
|
29
|
-
V1_SupportInfo,
|
|
30
37
|
V1_LakehouseAccessPoint,
|
|
31
|
-
V1_UnknownAccessPoint,
|
|
32
|
-
V1_AccessPointGroup,
|
|
33
38
|
V1_ModelAccessPointGroup,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
V1_EmbeddedImageIcon,
|
|
38
|
-
V1_LibraryIcon,
|
|
39
|
-
type V1_DataProductIcon,
|
|
40
|
-
V1_DataProductLink,
|
|
39
|
+
V1_SupportInfo,
|
|
40
|
+
V1_UnknownAccessPoint,
|
|
41
|
+
V1_UnknownDataProductIcon,
|
|
41
42
|
} from '../../../model/packageableElements/dataProduct/V1_DataProduct.js';
|
|
42
43
|
import {
|
|
43
44
|
UnsupportedOperationError,
|
|
@@ -68,6 +69,15 @@ export enum V1_AccessPointGrouptype {
|
|
|
68
69
|
MODEL_ACCESS_POINT_GROUP = 'modelAccessPointGroup',
|
|
69
70
|
}
|
|
70
71
|
|
|
72
|
+
export enum V1_DataProductIconType {
|
|
73
|
+
LIBRARY_ICON = 'libraryIcon',
|
|
74
|
+
EMBEDDED_IMAGE_ICON = 'embeddedImageIcon',
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export enum V1_DataProductIconLibraryId {
|
|
78
|
+
REACT_ICONS = 'react-icons',
|
|
79
|
+
}
|
|
80
|
+
|
|
71
81
|
export const V1_lakehouseAccessPointModelSchema = createModelSchema(
|
|
72
82
|
V1_LakehouseAccessPoint,
|
|
73
83
|
{
|
|
@@ -192,47 +202,46 @@ const V1_deserializeAccessPointGroup = (
|
|
|
192
202
|
}
|
|
193
203
|
};
|
|
194
204
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
205
|
+
export const V1_DataProductLibraryIconModelSchema = createModelSchema(
|
|
206
|
+
V1_DataProductLibraryIcon,
|
|
207
|
+
{
|
|
208
|
+
_type: usingConstantValueSchema(V1_DataProductIconType.LIBRARY_ICON),
|
|
209
|
+
iconId: primitive(),
|
|
210
|
+
libraryId: primitive(),
|
|
211
|
+
},
|
|
212
|
+
);
|
|
199
213
|
|
|
200
|
-
const
|
|
201
|
-
|
|
214
|
+
export const V1_DataProductEmbeddedImageIconModelSchema = createModelSchema(
|
|
215
|
+
V1_DataProductEmbeddedImageIcon,
|
|
202
216
|
{
|
|
203
217
|
_type: usingConstantValueSchema(V1_DataProductIconType.EMBEDDED_IMAGE_ICON),
|
|
204
218
|
imageUrl: primitive(),
|
|
205
219
|
},
|
|
206
220
|
);
|
|
207
221
|
|
|
208
|
-
const V1_LibraryIconModelSchema = createModelSchema(V1_LibraryIcon, {
|
|
209
|
-
_type: usingConstantValueSchema(V1_DataProductIconType.LIBRARY_ICON),
|
|
210
|
-
iconId: primitive(),
|
|
211
|
-
libraryId: primitive(),
|
|
212
|
-
});
|
|
213
|
-
|
|
214
222
|
const V1_deserializeDataProductIcon = (
|
|
215
223
|
json: PlainObject<V1_DataProductIcon>,
|
|
216
224
|
): V1_DataProductIcon => {
|
|
217
225
|
switch (json._type) {
|
|
218
|
-
case V1_DataProductIconType.EMBEDDED_IMAGE_ICON:
|
|
219
|
-
return deserialize(V1_EmbeddedImageIconModelSchema, json);
|
|
220
226
|
case V1_DataProductIconType.LIBRARY_ICON:
|
|
221
|
-
return deserialize(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
);
|
|
227
|
+
return deserialize(V1_DataProductLibraryIconModelSchema, json);
|
|
228
|
+
case V1_DataProductIconType.EMBEDDED_IMAGE_ICON:
|
|
229
|
+
return deserialize(V1_DataProductEmbeddedImageIconModelSchema, json);
|
|
230
|
+
default: {
|
|
231
|
+
const unknown = new V1_UnknownDataProductIcon();
|
|
232
|
+
unknown.content = json;
|
|
233
|
+
return unknown;
|
|
234
|
+
}
|
|
226
235
|
}
|
|
227
236
|
};
|
|
228
237
|
|
|
229
238
|
const V1_serializeDataProductIcon = (
|
|
230
239
|
protocol: V1_DataProductIcon,
|
|
231
240
|
): PlainObject<V1_DataProductIcon> => {
|
|
232
|
-
if (protocol instanceof
|
|
233
|
-
return serialize(
|
|
234
|
-
} else if (protocol instanceof
|
|
235
|
-
return serialize(
|
|
241
|
+
if (protocol instanceof V1_DataProductLibraryIcon) {
|
|
242
|
+
return serialize(V1_DataProductLibraryIconModelSchema, protocol);
|
|
243
|
+
} else if (protocol instanceof V1_DataProductEmbeddedImageIcon) {
|
|
244
|
+
return serialize(V1_DataProductEmbeddedImageIconModelSchema, protocol);
|
|
236
245
|
}
|
|
237
246
|
throw new UnsupportedOperationError(
|
|
238
247
|
`Can't serialize data product icon type`,
|
|
@@ -520,7 +520,7 @@ export const V1_entitlementsDataProductDetailsResponseToDataProductDetails = (
|
|
|
520
520
|
V1_EntitlementsDataProductDetailsResponseModelSchema,
|
|
521
521
|
json,
|
|
522
522
|
);
|
|
523
|
-
return response.dataProducts;
|
|
523
|
+
return response.dataProducts ?? [];
|
|
524
524
|
};
|
|
525
525
|
|
|
526
526
|
export const V1_DataContractApprovedUsersResponseModelSchema =
|
|
@@ -125,6 +125,7 @@ export enum V1_ClassInstanceType {
|
|
|
125
125
|
COL_SPEC_ARRAY = 'colSpecArray',
|
|
126
126
|
RELATION_STORE_ACCESSOR = '>',
|
|
127
127
|
INGEST_ACCESSOR = 'I',
|
|
128
|
+
DATA_PRODUCT_ACCESSOR = 'P',
|
|
128
129
|
|
|
129
130
|
TDS_AGGREGATE_VALUE = 'tdsAggregateValue',
|
|
130
131
|
TDS_COLUMN_INFORMATION = 'tdsColumnInformation',
|
|
@@ -838,6 +839,7 @@ export function V1_deserializeClassInstanceValue(
|
|
|
838
839
|
case V1_ClassInstanceType.COL_SPEC_ARRAY:
|
|
839
840
|
return deserialize(colSpecArrayModelSchema(plugins), json);
|
|
840
841
|
case V1_ClassInstanceType.RELATION_STORE_ACCESSOR:
|
|
842
|
+
case V1_ClassInstanceType.INGEST_ACCESSOR:
|
|
841
843
|
return deserialize(relationStoreAccessorModelSchema, json);
|
|
842
844
|
default: {
|
|
843
845
|
const deserializers = plugins.flatMap(
|
package/src/index.ts
CHANGED
|
@@ -185,16 +185,17 @@ export { V1_ExternalFormatDescription } from './graph-manager/protocol/pure/v1/e
|
|
|
185
185
|
export { V1_ExternalFormatModelGenerationInput } from './graph-manager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.js';
|
|
186
186
|
export { V1_GenerateSchemaInput } from './graph-manager/protocol/pure/v1/engine/externalFormat/V1_GenerateSchemaInput.js';
|
|
187
187
|
export {
|
|
188
|
-
V1_DataProduct,
|
|
189
|
-
V1_SupportInfo,
|
|
190
|
-
V1_Email,
|
|
191
|
-
V1_LakehouseAccessPoint,
|
|
192
188
|
V1_AccessPoint,
|
|
193
189
|
V1_AccessPointGroup,
|
|
194
|
-
|
|
190
|
+
V1_DataProduct,
|
|
195
191
|
V1_DataProductDiagram,
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
V1_DataProductEmbeddedImageIcon,
|
|
193
|
+
V1_DataProductIcon,
|
|
194
|
+
V1_DataProductLibraryIcon,
|
|
195
|
+
V1_Email,
|
|
196
|
+
V1_LakehouseAccessPoint,
|
|
197
|
+
V1_SupportInfo,
|
|
198
|
+
V1_UnknownDataProductIcon,
|
|
198
199
|
} from './graph-manager/protocol/pure/v1/model/packageableElements/dataProduct/V1_DataProduct.js';
|
|
199
200
|
export {
|
|
200
201
|
V1_ExecuteInput,
|
|
@@ -601,7 +602,10 @@ export {
|
|
|
601
602
|
V1_RawValueSpecificationType,
|
|
602
603
|
V1_deserializeRawValueSpecificationType,
|
|
603
604
|
} from './graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.js';
|
|
604
|
-
export {
|
|
605
|
+
export {
|
|
606
|
+
V1_DataProductIconLibraryId,
|
|
607
|
+
V1_dataProductModelSchema,
|
|
608
|
+
} from './graph-manager/protocol/pure/v1/transformation/pureProtocol/serializationHelpers/V1_DataProductSerializationHelper.js';
|
|
605
609
|
export { V1_transformPropertyReference } from './graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.js';
|
|
606
610
|
export * from './graph-manager/protocol/pure/v1/transformation/pureGraph/from/V1_DataElementTransformer.js';
|
|
607
611
|
export {
|
|
@@ -710,14 +714,18 @@ export * from './graph-manager/action/changeDetection/DSL_FunctionActivatorObser
|
|
|
710
714
|
// ------------------------------------- Data Product --------------------------------------------
|
|
711
715
|
|
|
712
716
|
export {
|
|
717
|
+
AccessPoint,
|
|
718
|
+
AccessPointGroup,
|
|
713
719
|
DataProduct,
|
|
714
|
-
|
|
720
|
+
DataProductEmbeddedImageIcon,
|
|
721
|
+
DataProductIcon,
|
|
722
|
+
DataProductLibraryIcon,
|
|
723
|
+
DataProductLink,
|
|
715
724
|
Email,
|
|
716
725
|
LakehouseAccessPoint,
|
|
717
726
|
LakehouseTargetEnv,
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
DataProductLink,
|
|
727
|
+
SupportInfo,
|
|
728
|
+
UnknownDataProductIcon,
|
|
721
729
|
} from './graph/metamodel/pure/dataProduct/DataProduct.js';
|
|
722
730
|
export * from './graph-manager/action/changeDetection/DataProductObserveHelper.js';
|
|
723
731
|
|