@finos/legend-graph
Version:
Legend graph and graph manager
87 lines • 2.69 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 { CORE_HASH_STRUCTURE, hashObjectWithoutSourceInformation, } from '../../../../../../graph/Core_HashUtils.js';
export class V1_EmbeddedData {
}
export class V1_DataElementReference extends V1_EmbeddedData {
dataElement;
get hashCode() {
return hashArray([
CORE_HASH_STRUCTURE.DATA_ELEMENT_REFERENCE,
this.dataElement.path,
]);
}
accept_EmbeddedDataVisitor(visitor) {
return visitor.visit_DataElementReference(this);
}
}
export class V1_ExternalFormatData extends V1_EmbeddedData {
contentType;
data;
get hashCode() {
return hashArray([
CORE_HASH_STRUCTURE.EXTERNAL_FORMAT_DATA,
this.contentType,
this.data,
]);
}
accept_EmbeddedDataVisitor(visitor) {
return visitor.visit_ExternalFormatData(this);
}
}
export class V1_ModelData {
model;
}
export class V1_ModelEmbeddedData extends V1_ModelData {
data;
get hashCode() {
return hashArray([
CORE_HASH_STRUCTURE.MODEL_EMBEDDED_DATA,
this.model,
this.data,
]);
}
}
export class V1_ModelInstanceData extends V1_ModelData {
/**
* Studio does not process value specification, they are left in raw JSON form
* TODO: we may want to build out the instance `objects` once we build out the form
*
* @discrepancy model
*/
instances;
get hashCode() {
return hashArray([
CORE_HASH_STRUCTURE.MODEL_INSTANCE_DATA,
this.model,
hashObjectWithoutSourceInformation(this.instances),
]);
}
}
export class V1_ModelStoreData extends V1_EmbeddedData {
modelData;
get hashCode() {
return hashArray([
CORE_HASH_STRUCTURE.MODEL_STORE_DATA,
this.modelData ? hashArray(this.modelData) : '',
]);
}
accept_EmbeddedDataVisitor(visitor) {
return visitor.visit_ModelStoreData(this);
}
}
//# sourceMappingURL=V1_EmbeddedData.js.map