UNPKG

@finos/legend-graph

Version:
98 lines 3.02 kB
/** * 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, } from '../packageableElements/PackageableElement.js'; import { CORE_HASH_STRUCTURE, hashObjectWithoutSourceInformation, } from '../../../Core_HashUtils.js'; export class AccessPoint { id; description; constructor(id) { this.id = id; } get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.DATA_PRODUCT_ACCESS_POINT, this.id, this.description ?? '', ]); } } export var LakehouseTargetEnv; (function (LakehouseTargetEnv) { LakehouseTargetEnv["Snowflake"] = "Snowflake"; LakehouseTargetEnv["Databricks"] = "Databricks"; LakehouseTargetEnv["BigQuery"] = "BigQuery"; LakehouseTargetEnv["DuckDb"] = "DuckDb"; })(LakehouseTargetEnv || (LakehouseTargetEnv = {})); export class LakehouseAccessPoint extends AccessPoint { targetEnvironment; func; reproducible; constructor(id, targetEnv, func) { super(id); this.targetEnvironment = targetEnv; this.func = func; } get hashCode() { return hashArray([ super.hashCode, CORE_HASH_STRUCTURE.LAKEHOUSE_ACCESS_POINT, this.targetEnvironment, this.func, this.reproducible ?? '', ]); } } export class UnknownAccessPoint extends AccessPoint { content; get hashCode() { return hashArray([ super.hashCode, CORE_HASH_STRUCTURE.UNKNOWN_ACCESS_POINT, hashObjectWithoutSourceInformation(this.content), ]); } } export class AccessPointGroup { id; description; accessPoints = []; get hashCode() { return hashArray([ CORE_HASH_STRUCTURE.DATA_PRODUCT_ACCESS_POINT_GROUP, this.id, this.description ?? '', hashArray(this.accessPoints), ]); } } export class DataProduct extends PackageableElement { title; description; accessPointGroups = []; accept_PackageableElementVisitor(visitor) { return visitor.visit_DataProduct(this); } get _elementHashCode() { return hashArray([ CORE_HASH_STRUCTURE.DATA_PRODUCT, hashArray(this.accessPointGroups), this.title ?? '', this.description ?? '', ]); } } //# sourceMappingURL=DataProduct.js.map