@salesforce/source-tracking
Version:
API for tracking local and remote Salesforce metadata changes
22 lines (21 loc) • 1.36 kB
TypeScript
import { RegistryAccess } from '@salesforce/source-deploy-retrieve';
import { DetectionFileInfoWithType, StatusRow, StringMap } from './types';
type AddedAndDeletedFilenames = {
added: Set<string>;
deleted: Set<string>;
};
type StringMapsForMatches = {
/** these matches filename=>basename, metadata type/name, and git object hash */
fullMatches: StringMap;
/** these did not match the hash. They *probably* are matches where the "add" is also modified */
deleteOnly: StringMap;
};
/** composed functions to simplified use by the shadowRepo class */
export declare const filenameMatchesToMap: (registry: RegistryAccess) => (projectPath: string) => (gitDir: string) => ({ added, deleted }: AddedAndDeletedFilenames) => Promise<StringMapsForMatches>;
/** compare delete and adds from git.status, matching basenames of the files. returns early when there's nothing to match */
export declare const getMatches: (status: StatusRow[]) => AddedAndDeletedFilenames;
export declare const getLogMessage: (matches: StringMapsForMatches) => string;
/** returns a map of <hash+basename, filepath>. If two items result in the same hash+basename, return that in the ignore bucket */
export declare const buildMap: (info: DetectionFileInfoWithType[]) => StringMap[];
export declare const toKey: (input: DetectionFileInfoWithType) => string;
export {};