import { Connection, Org } from '@salesforce/core'; import { Duration } from '@salesforce/kit'; import { Nullable } from '@salesforce/ts-types'; import { type PipelineStage, TestLevel } from '../common/index.js'; import AsyncOpStreaming from '../streamer/processors/asyncOpStream.js'; import { AorOutputService } from './outputService/aorOutputService.js'; import { AsyncOperationResult, DeployComponent } from './types.js'; /** * @description validates the following: * - if RunSpecifiedTests is specified, then it needs to indicate tests to run. * - if other than RunSpecifiedTests is specified, then it can't indicate tests to run. * @param testLevel specified test level * @param tests specific tests to run */ export declare function validateTestFlags(testLevel: Nullable, tests: Nullable): void; /** * * Query the target org to get a pipeline stage filtering by project name and branch name. * Also uses the same query to validate that Devops Center is installed in the target org. * * @param targetOrg Org. Target org. * @param projectName string. Name of the project. * @param branchName string. Name of the branch. * @throws if Devops Center is not installed in the target org. * @throws if it cant' find the given project. * @throws if it cant' find the a pipeline stge that matches the given branch. */ export declare function fetchAndValidatePipelineStage(targetOrg: Org, projectName: string, branchName: string): Promise; export declare function fetchAsyncOperationResult(con: Connection, aorId: string): Promise; export declare function getAsyncOperationStreamer(org: Org, waitTime: Duration, idToInspect: string, outputService: AorOutputService): AsyncOpStreaming; /** * * Helper to inspect an array of SF ids to check if it contains the given Id, * independently if it is a 15 or 18 characters long. * * @param idsToInspect array of ids which might contain the given id * @param idToFind id to look for * @returns true is the array contains the given id */ export declare function containsSfId(idsToInspect: string[], idToFind: string): boolean; /** * * Helper to compare to SF Ids independently if they are 15 or 18 characters long. * * @param firstId * @param secondId * @returns true is the Ids match */ export declare function matchesSfId(firstId: string, secondId: string): boolean; /** * Helper to convert an sObject into an array of {key : value} * and format the keys. * * @param sObj sObject to convert. * @returns an array of {key : value} */ export declare function sObjectToArrayOfKeyValue(sObj: object): Array<{ key: string; value: unknown; }>; /** * Helper to remove the prefix, sufix and underscores in a DOCe sObject field name. * * @param fieldName DOCe field name. * @returns formatted field name. */ export declare function formatFieldName(fieldName: string): string; /** * Helper to return a formatted DeployComponent list (Type/Name filled). * * @param con The connection needed for the query * @param asyncOpId The Id of the AsyncOperation * @returns A list of DeployComponent */ export declare function getFormattedDeployComponentsByAyncOpId(con: Connection, asyncOpId: string, isValidateDeploy: boolean): Promise; /** * Helper to sleep thread for ms amount of time * * @param ms Number of miliseconds to sleep thread */ export declare function sleep(ms: number): Promise;