import * as grpc from '@grpc/grpc-js'; import { DepiClient } from './pbs/depi_grpc_pb'; import { ResourcePattern, Resource, ResourceRef, ResourceGroup, ResourceLinkRef, ResourceLink, LinkPattern, ResourceChange, ResourceGroupRef } from './@types/depi'; export interface DepiSession { client: DepiClient; sessionId: string; branchName: string; token: string; user: string; watchers: { [key: string]: grpc.ClientReadableStream; }; } export declare function logInDepiClient(url: string, userName: string, password: string, cert?: string, opts?: object): Promise; export declare function logInDepiClientWithToken(url: string, token: string, cert?: string, opts?: object): Promise; export declare function ping(depiSession: DepiSession): Promise<{ token: string; }>; export declare function logOut(depiSession: DepiSession): Promise; export declare function closeDepiClient(client: DepiClient): void; /** * Set the branch on the server for the current session. If the branch does not exist, will return null. * @param depiSession * @param branchName * @returns {Promise} */ export declare function setBranch(depiSession: DepiSession, branchName: string): Promise; export declare function createBranch(depiSession: DepiSession, branchName: string, fromBranch: string): Promise; export declare function createTag(depiSession: DepiSession, tagName: string, fromBranch: string): Promise; export declare function getBranchesAndTags(depiSession: DepiSession): Promise<{ branches: string[]; tags: string[]; }>; export declare function getResourceGroups(depiSession: DepiSession): Promise; export declare function getResources(depiSession: DepiSession, resourcePatterns: ResourcePattern[]): Promise; export declare function getResourcesStreamed(depiSession: DepiSession, resourcePatterns: ResourcePattern[]): Promise; export declare function getLinks(depiSession: DepiSession, linkPatterns: LinkPattern[]): Promise; export declare function getLinksStreamed(depiSession: DepiSession, linkPatterns: LinkPattern[]): Promise; export declare function getAllLinksStreamed(depiSession: DepiSession, includeDeleted?: boolean): Promise; export declare function getDirtyLinks(depiSession: DepiSession, resourceGroup: ResourceGroup): Promise; export declare function getDepiModel(depiSession: DepiSession, activeResourceGroups: ResourceGroupRef[]): Promise<{ resourceGroups: ResourceGroup[]; resources: Resource[]; links: ResourceLink[]; }>; export declare function getBlackboardModel(depiSession: DepiSession): Promise<{ resources: Resource[]; links: ResourceLink[]; }>; /** * Returns all dependencies, including implicit ones, of the provided resource-ref. * If the resource is not in depi - the call succeeds but resource in the result will be null. * @param depiSession * @param resourceRef * @param reverse - If true will return dependants of the resource instead of dependencies. * @returns */ export declare function getDependencyGraph(depiSession: DepiSession, resourceRef: ResourceRef, reverse?: boolean): Promise<{ resource: Resource | null; links: ResourceLink[]; }>; /** * Returns all direct dependencies of the resource. * If the resource is not in depi - the call succeeds but resource in the result will be null. * @param depiSession * @param resourceRef * @param reverse - If true will return dependants of the resource instead of dependencies. * @returns */ export declare function getDependencies(depiSession: DepiSession, resourceRef: ResourceRef, reverse?: boolean): Promise<{ resource: Resource | null; links: ResourceLink[]; }>; export declare function addResourcesToBlackboard(depiSession: DepiSession, resources: Resource[]): Promise; export declare function addLinkToBlackboard(depiSession: DepiSession, source: Resource, target: Resource): Promise; export declare function saveBlackboard(depiSession: DepiSession): Promise; export declare function clearBlackboard(depiSession: DepiSession): Promise; export declare function removeEntriesFromBlackboard(depiSession: DepiSession, entries: { links: ResourceLink[]; resources: Resource[]; }): Promise; export declare function deleteEntriesFromDepi(depiSession: DepiSession, entries: { links: ResourceLink[]; resources: Resource[]; }): Promise; export declare function markLinksClean(depiSession: DepiSession, links: ResourceLinkRef[], propagate: boolean | undefined): Promise; export declare function markInferredDirtinessClean(depiSession: DepiSession, link: ResourceLinkRef, dirtinessSource: ResourceRef, propagate: boolean | undefined): Promise; export declare function updateResourceGroup(depiSession: DepiSession, toolId: string, resourceGroupName: string, resourceGroupUrl: string, newVersion: string, resourceChanges: ResourceChange[]): Promise; export declare function editResourceGroupProperties(depiSession: DepiSession, resourceGroupRef: ResourceGroupRef, newName: string, newToolId: string, newUrl: string, newVersion: string): Promise; export declare function removeResourceGroup(depiSession: DepiSession, resourceGroupRef: ResourceGroupRef): Promise; export declare function markAllClean(depiSession: DepiSession, links: ResourceLink[], log: Function): Promise; export declare function watchBlackboard(depiSession: DepiSession, onData: (data: any) => void, onError: (data: any) => void): Promise; export declare function unwatchBlackboard(depiSession: DepiSession, watcherId: string): Promise; export declare function watchDepi(depiSession: DepiSession, onData: (data: any) => void, onError: (data: any) => void): Promise; export declare function unwatchDepi(depiSession: DepiSession, watcherId: string): Promise; export declare function isSameResource(r1?: ResourceRef, r2?: ResourceRef): boolean; export declare function isSameResourceGroup(r1?: ResourceGroupRef, r2?: ResourceGroupRef): boolean; export declare function isSameResourceLink(link1?: ResourceLinkRef, link2?: ResourceLinkRef): boolean; declare const methods: { logInDepiClient: typeof logInDepiClient; logInDepiClientWithToken: typeof logInDepiClientWithToken; logOut: typeof logOut; ping: typeof ping; setBranch: typeof setBranch; createBranch: typeof createBranch; createTag: typeof createTag; getBranchesAndTags: typeof getBranchesAndTags; getResourceGroups: typeof getResourceGroups; getResources: typeof getResources; getResourcesStreamed: typeof getResourcesStreamed; getLinks: typeof getLinks; getLinksStreamed: typeof getLinksStreamed; getAllLinksStreamed: typeof getAllLinksStreamed; getDirtyLinks: typeof getDirtyLinks; getDepiModel: typeof getDepiModel; getBlackboardModel: typeof getBlackboardModel; getDependencyGraph: typeof getDependencyGraph; getDependencies: typeof getDependencies; addResourcesToBlackboard: typeof addResourcesToBlackboard; addLinkToBlackboard: typeof addLinkToBlackboard; saveBlackboard: typeof saveBlackboard; clearBlackboard: typeof clearBlackboard; removeEntriesFromBlackboard: typeof removeEntriesFromBlackboard; deleteEntriesFromDepi: typeof deleteEntriesFromDepi; markLinksClean: typeof markLinksClean; markInferredDirtinessClean: typeof markInferredDirtinessClean; markAllClean: typeof markAllClean; updateResourceGroup: typeof updateResourceGroup; editResourceGroupProperties: typeof editResourceGroupProperties; removeResourceGroup: typeof removeResourceGroup; isSameResource: typeof isSameResource; isSameResourceGroup: typeof isSameResourceGroup; isSameResourceLink: typeof isSameResourceLink; watchBlackboard: typeof watchBlackboard; unwatchBlackboard: typeof unwatchBlackboard; watchDepi: typeof watchDepi; unwatchDepi: typeof unwatchDepi; }; export default methods;