/** * 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 { type DepotServerClient } from '@finos/legend-server-depot'; import type { Entity } from '@finos/legend-storage'; import { type GraphManagerState, IngestDefinition } from '@finos/legend-graph'; /** * Shared helpers for ingest-backed query flows (creator + existing-query * loader). Centralizes how we list / cache / swap ingest definitions in the * graph so both flows stay in lockstep. * * Why these live outside the stores: both * {@link IngestQueryCreatorStore} (deep-link flow) and * {@link ExistingQueryEditorStore} (saved-query flow) need to: * 1. fetch every ingest entity in a project version (cheap, classifier- * scoped depot call) so the source dropdown can list them all, and * 2. build only the active ingest into the graph, swapping it out when the * user picks a different one. * Keeping the logic in one module avoids the two stores drifting apart. */ /** * Fetch every {@link IngestDefinition} entity for a project version via the * classifier-scoped variant of `getVersionEntities`. The endpoint returns * {@link EntityWithOrigin}-shaped payloads (entity wrapped with GAV) rather * than raw entities, so we unwrap explicitly. * * Filters by `classifierPath` defensively in case the server returns extras. */ export declare const fetchIngestEntitiesByClassifier: (depotServerClient: DepotServerClient, groupId: string, artifactId: string, versionId: string) => Promise>; /** * Build the given ingest entity into `graph`. If `currentPath` is provided * and resolves to an existing ingest on the graph, that ingest is removed * first — this is the swap path used when the user picks a different ingest * from the source dropdown. * * The SDLC origin is only set when the graph has none yet, so subsequent * swaps (which run after the initial graph build set the origin) don't * clobber it. */ export declare const swapIngestInGraph: (graphManagerState: GraphManagerState, entity: Entity, options: { currentPath?: string | undefined; groupId: string; artifactId: string; versionId: string; }) => Promise; //# sourceMappingURL=IngestQueryGraphHelper.d.ts.map