@finos/legend-extension-dsl-data-space
Version:
Legend extension for Data Space DSL
166 lines • 5.13 kB
JavaScript
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { hashArray } from '@finos/legend-shared';
import { PackageableElement, ConcreteFunctionDefinition, generateFunctionPrettyName, } from '@finos/legend-graph';
import { DATA_SPACE_HASH_STRUCTURE } from '../../../../../DSL_DataSpace_HashUtils.js';
export class DataSpaceExecutionContext {
name;
title;
description;
mapping;
defaultRuntime;
testData;
get hashCode() {
return hashArray([
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_EXECUTION_CONTEXT,
this.name,
this.title ?? '',
this.description ?? '',
this.mapping.valueForSerialization ?? '',
this.defaultRuntime.valueForSerialization ?? '',
this.testData ?? '',
]);
}
}
export class DataSpaceElementPointer {
element;
exclude;
get hashCode() {
return hashArray([
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_ELEMENT_POINTER,
this.element.valueForSerialization ?? '',
this.exclude ?? '',
]);
}
}
export class DataSpaceExecutable {
id;
executionContextKey;
title;
description;
get hashCode() {
return hashArray([
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_EXECUTABLE,
this.id,
this.title,
this.description ?? '',
this.executionContextKey ?? '',
]);
}
}
export class DataSpacePackageableElementExecutable extends DataSpaceExecutable {
executable;
get hashCode() {
return hashArray([
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_PACKAGEABLE_ELEMENT_EXECUTABLE,
this.id,
this.title,
this.description ?? '',
this.executionContextKey ?? '',
this.executable.value instanceof ConcreteFunctionDefinition
? generateFunctionPrettyName(this.executable.value, {
fullPath: true,
spacing: false,
notIncludeParamName: true,
})
: (this.executable.valueForSerialization ?? ''),
]);
}
}
export class DataSpaceExecutableTemplate extends DataSpaceExecutable {
query;
get hashCode() {
return hashArray([
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_TEMPLATE_EXECUTABLE,
this.id,
this.title,
this.description ?? '',
this.query,
this.executionContextKey ?? '',
]);
}
}
export class DataSpaceDiagram {
title;
description;
diagram;
get hashCode() {
return hashArray([
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_DIAGRAM,
this.title,
this.description ?? '',
this.diagram.valueForSerialization ?? '',
]);
}
}
export class DataSpaceSupportInfo {
documentationUrl;
}
export class DataSpaceSupportEmail extends DataSpaceSupportInfo {
address;
get hashCode() {
return hashArray([
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_SUPPORT_EMAIL,
this.documentationUrl ?? '',
this.address,
]);
}
}
export class DataSpaceSupportCombinedInfo extends DataSpaceSupportInfo {
emails;
website;
faqUrl;
supportUrl;
get hashCode() {
return hashArray([
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE_SUPPORT_COMBINED_INFO,
this.documentationUrl ?? '',
hashArray(this.emails ?? []),
this.website ?? '',
this.faqUrl ?? '',
this.supportUrl ?? '',
]);
}
}
export class DataSpace extends PackageableElement {
title;
description;
executionContexts = [];
defaultExecutionContext;
elements;
executables;
diagrams;
supportInfo;
get _elementHashCode() {
return hashArray([
DATA_SPACE_HASH_STRUCTURE.DATA_SPACE,
hashArray(this.stereotypes.map((stereotype) => stereotype.pointerHashCode)),
hashArray(this.taggedValues),
this.title ?? '',
this.description ?? '',
hashArray(this.executionContexts),
this.defaultExecutionContext.name,
hashArray(this.elements ?? []),
hashArray(this.executables ?? []),
hashArray(this.diagrams ?? []),
this.supportInfo ?? '',
]);
}
accept_PackageableElementVisitor(visitor) {
return visitor.visit_PackageableElement(this);
}
}
//# sourceMappingURL=DSL_DataSpace_DataSpace.js.map