salesforce-alm
Version:
This package contains tools, and APIs, for an improved salesforce.com developer experience.
103 lines (102 loc) • 4.67 kB
TypeScript
import { AsyncCreatable } from '@salesforce/kit';
import { Logger } from '@salesforce/core';
import { AggregateSourceElement } from './aggregateSourceElement';
import { FileProperty } from './metadataTypeFactory';
import { SourcePathStatusManager, SourcePathInfo } from './sourcePathStatusManager';
import { AggregateSourceElements } from './aggregateSourceElements';
import { SourceLocations } from './sourceLocations';
import MetadataRegistry = require('./metadataRegistry');
export declare class SourceWorkspaceAdapter extends AsyncCreatable<SourceWorkspaceAdapter.Options> {
logger: Logger;
wsPath: string;
defaultPackagePath: string;
isStateless: boolean;
spsm: SourcePathStatusManager;
metadataRegistry: MetadataRegistry;
sourceLocations: SourceLocations;
namespace: string;
defaultSrcDir: string;
fromConvert: boolean;
forceIgnore: any;
pendingSourcePathInfos: PendingSourcePathInfos;
pendingDirectories: any[];
changedSourceElementsCache: AggregateSourceElements;
allAggregateSourceElementsCache: AggregateSourceElements;
options: SourceWorkspaceAdapter.Options;
/**
* @ignore
*/
constructor(options: SourceWorkspaceAdapter.Options);
protected init(): Promise<void>;
revertSourcePathInfos(): Promise<void>;
backupSourcePathInfos(): Promise<void>;
updatePendingSourcePathInfos(change: SourcePathInfo): void;
getPendingSourcePathInfos(packageName?: string): SourcePathInfo[];
/**
* Get AggregateSourceElements (ASEs) in the workspace.
*
* To get all ASEs: SourceWorkspaceAdapter.getAggregateSourceElements(false);
* NOTE: This caches all ASEs so that subsequent calls do not incur this perf hit and just return the cache.
*
* To get all changed ASEs: SourceWorkspaceAdapter.getAggregateSourceElements(true);
*
* To get only ASEs from a certain path: SourceWorkspaceAdapter.getAggregateSourceElements(false, undefined, undefined, myPath);
*
* @param changesOnly - If true then return only the updated source elements (changed, new, or deleted)
* @param packageDirectory - the package directory from which to fetch source
* @param updatePendingPathInfos - the pending path infos should only be updated the first time this method is called
* in order to prevent subsequent calls from overwriting its values
* @param sourcePath the directory or file path specified for change-set development
* @returns - Map of aggregate source element key to aggregateSourceElement
* ex. { 'ApexClass__myApexClass' : aggregateSourceElement }
*/
getAggregateSourceElements(changesOnly: boolean, packageDirectory?: string, updatePendingPathInfos?: boolean, sourcePath?: string): Promise<AggregateSourceElements>;
/**
* Commit pending changed file infos
*
* @returns {boolean} - Was the commit successful
*/
commitPendingChanges(packageName: string): Promise<boolean>;
/**
* Update the source stored in the workspace
*/
updateSource(aggregateSourceElements: AggregateSourceElements, manifest?: any, checkForDuplicates?: boolean, unsupportedMimeTypes?: any, forceoverwrite?: boolean): Promise<AggregateSourceElements>;
/**
* Create a source element representation of a metadata change in the local workspace
*/
processMdapiFileProperty(changedSourceElements: AggregateSourceElements, retrieveRoot: string, fileProperty: FileProperty, bundleFileProperties: any): AggregateSourceElement;
/**
* Create a source element representation of a deleted metadata change in the local workspace
*
* @returns {AggregateSourceElement} - A source element or null if metadataType is not supported
*/
handleObsoleteSource(changedSourceElements: AggregateSourceElements, fullName: string, type: string): AggregateSourceElement | null;
private warnUser;
}
/**
* Adapter between scratch org source metadata and a local workspace
*/
export declare namespace SourceWorkspaceAdapter {
/**
* Constructor Options for and Org.
*/
interface Options {
/**
* The org that the source workspace files belong to
*/
org: any;
/**
* The name of the default package path to which new source will be added
*/
defaultPackagePath: string;
metadataRegistryImpl: any;
fromConvert?: boolean;
sourceMode?: number;
sourcePaths?: string[];
}
const modes: {
STATE: number;
STATELESS: number;
};
}
export declare type PendingSourcePathInfos = Map<string, Map<string, SourcePathInfo>>;