@finos/legend-application-marketplace
Version:
Legend Marketplace application core
32 lines • 1.91 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 { V1_AdHocDeploymentDataProductOrigin, V1_SdlcDeploymentDataProductOrigin, } from '@finos/legend-graph';
import { ActionState } from '@finos/legend-shared';
import { resolveVersion, } from '@finos/legend-server-depot';
export const buildGraphForDataProduct = async (entitlementsDataProductDetails, graphManagerState, graphManager, marketplaceBaseStore) => {
if (entitlementsDataProductDetails.origin instanceof
V1_AdHocDeploymentDataProductOrigin) {
const entities = await graphManager.pureCodeToEntities(entitlementsDataProductDetails.origin.definition);
await graphManager.buildGraph(graphManagerState.graph, entities, ActionState.create());
}
else if (entitlementsDataProductDetails.origin instanceof
V1_SdlcDeploymentDataProductOrigin) {
const entitiesResponse = await marketplaceBaseStore.depotServerClient.getDependencyEntities(entitlementsDataProductDetails.origin.group, entitlementsDataProductDetails.origin.artifact, resolveVersion(entitlementsDataProductDetails.origin.version), true, true);
const entities = entitiesResponse.flatMap((versionEntity) => versionEntity.entities);
await graphManager.buildGraph(graphManagerState.graph, entities, ActionState.create());
}
};
//# sourceMappingURL=LakehouseUtils.js.map