@salesforce/source-tracking
Version:
API for tracking local and remote Salesforce metadata changes
46 lines (45 loc) • 3.19 kB
TypeScript
import { FileResponseSuccess, ForceIgnore, MetadataComponent, MetadataMember, RegistryAccess, SourceComponent } from '@salesforce/source-deploy-retrieve';
import { RemoteChangeElement, ChangeResult, ChangeResultWithNameAndType, RemoteSyncInput } from './types';
export declare const getMetadataKey: (metadataType: string, metadataName: string) => string;
export declare const getLegacyMetadataKey: (metadataType: string, metadataName: string) => string;
export declare const getMetadataTypeFromKey: (key: string) => string;
export declare const getMetadataNameFromKey: (key: string) => string;
export declare const getMetadataTypeFromLegacyKey: (key: string) => string;
export declare const getMetadataNameFromLegacyKey: (key: string) => string;
export declare const getKeyFromObject: (element: RemoteChangeElement | ChangeResult) => string;
export declare const supportsPartialDelete: (cmp: SourceComponent) => boolean;
export declare const excludeLwcLocalOnlyTest: (filePath: string) => boolean;
/**
* Verify that a filepath starts exactly with a complete parent path
* ex: '/foo/bar-extra/baz'.startsWith('foo/bar') would be true, but this function understands that they are not in the same folder
*/
export declare const pathIsInFolder: (folder: string) => (filePath: string) => boolean;
/** just like pathIsInFolder but with the parameter order reversed for iterating a single file against an array of folders */
export declare const folderContainsPath: (filePath: string) => (folder: string) => boolean;
export declare const chunkArray: <T>(arr: T[], size: number) => T[][];
export declare const ensureRelative: (projectPath: string) => (filePath: string) => string;
type ParsedCustomLabels = {
CustomLabels: {
labels: Array<{
fullName: string;
}>;
};
};
/**
* A method to help delete custom labels from a file, or the entire file if there are no more labels
*
* @param filename - a path to a custom labels file
* @param customLabels - an array of SourceComponents representing the custom labels to delete
* @returns -json equivalent of the custom labels file's contents OR undefined if the file was deleted/not written
*/
export declare const deleteCustomLabels: (filename: string, customLabels: SourceComponent[]) => Promise<ParsedCustomLabels | undefined>;
/** returns true if forceIgnore denies a path OR if there is no forceIgnore provided */
export declare const forceIgnoreDenies: (forceIgnore?: ForceIgnore) => (filePath: string) => boolean;
export declare const sourceComponentIsCustomLabel: (input: SourceComponent) => boolean;
export declare const sourceComponentHasFullNameAndType: (input: SourceComponent) => boolean;
export declare const getAllFiles: (sc: SourceComponent) => string[];
export declare const remoteChangeToMetadataMember: (cr: ChangeResult) => MetadataMember;
export declare const FileResponseSuccessToRemoteSyncInput: (fr: FileResponseSuccess) => RemoteSyncInput;
export declare const changeResultToMetadataComponent: (registry: RegistryAccess) => (cr: ChangeResultWithNameAndType) => MetadataComponent;
export declare const uniqueArrayConcat: <T>(arr1: T[] | Set<T>, arr2: T[] | Set<T>) => T[];
export {};