sfdx-hardis
Version:
Swiss-army-knife Toolbox for Salesforce. Allows you to define a complete CD/CD Pipeline. Orchestrate base commands and assist users with interactive wizards
119 lines (118 loc) • 4.55 kB
TypeScript
import { Connection } from '@salesforce/core';
export declare const filesFolderRoot: string;
export declare class FilesExporter {
private filesPath;
private conn;
private pollTimeout;
private recordsChunkSize;
private startChunkNumber;
private parentRecordsChunkSize;
private commandThis;
private dtl;
private exportedFilesFolder;
private recordsChunk;
private chunksNumber;
private recordsChunkQueue;
private recordsChunkQueueRunning;
private queueInterval;
private bulkApiRecordsEnded;
private recordChunksNumber;
private totalSoqlRequests;
private totalParentRecords;
private parentRecordsWithFiles;
private recordsIgnored;
private filesDownloaded;
private filesErrors;
private filesIgnoredType;
private filesIgnoredExisting;
private apiUsedBefore;
private apiLimit;
constructor(filesPath: string, conn: Connection, options: {
pollTimeout?: number;
recordsChunkSize?: number;
exportConfig?: any;
startChunkNumber?: number;
}, commandThis: any);
processExport(): Promise<{
totalParentRecords: number;
parentRecordsWithFiles: number;
filesDownloaded: number;
filesErrors: number;
recordsIgnored: number;
filesIgnoredType: number;
filesIgnoredExisting: number;
apiLimit: any;
apiUsedBefore: number;
apiUsedAfter: any;
apiCallsRemaining: number | null;
}>;
private calculateApiConsumption;
private startQueue;
private queueCompleted;
private processParentRecords;
private addToRecordsChunk;
private processRecordsChunk;
private downloadFile;
private downloadAttachmentFile;
private downloadContentVersionFile;
private buildResult;
}
export declare class FilesImporter {
private filesPath;
private conn;
private commandThis;
private dtl;
private exportedFilesFolder;
private handleOverwrite;
constructor(filesPath: string, conn: Connection, options: {
exportConfig?: any;
handleOverwrite?: boolean;
}, commandThis: any);
processImport(): Promise<{
successNb: number;
errorNb: number;
}>;
private calculateApiConsumption;
}
export declare function selectFilesWorkspace(opts?: {
selectFilesLabel: string;
}): Promise<any>;
export declare function getFilesWorkspaceDetail(filesWorkspace: string): Promise<{
full_label: string;
label: any;
description: any;
soqlQuery: any;
fileTypes: any;
outputFolderNameField: any;
outputFileNameFormat: any;
overwriteParentRecords: any;
overwriteFiles: any;
} | null>;
export declare function promptFilesExportConfiguration(filesExportConfig: any, override?: boolean): Promise<any>;
export declare function countLinesInFile(file: string): Promise<unknown>;
/**
* @description This function generates a report path for a given file name prefix.
* It retrieves the report directory and the current branch name.
* If the branch name is not available in the environment variable CI_COMMIT_REF_NAME, it tries to get the current git branch.
* If both are not available, it uses the string "Missing CI_COMMIT_REF_NAME variable".
* It then joins the report directory, file name prefix, and branch name to form the full path of the report.
*
* @param {string} fileNamePrefix - The prefix for the file name.
* @param {string} outputFile - The output file path. If null, a new path is generated.
* @param {Object} [options] - Additional options for generating the report path.
* @param {boolean} [options.withDate=false] - Whether to append a timestamp to the file name.
* @returns {Promise<string>} - A Promise that resolves to the full path of the report.
*/
export declare function generateReportPath(fileNamePrefix: string, outputFile: string, options?: {
withDate: boolean;
}): Promise<string>;
/**
* @description This function generates a CSV file from the provided data and writes it to the specified output path.
* If the operation is successful, it logs a message and requests to open the file.
* If an error occurs during the operation, it logs the error message and stack trace.
*
* @param {any[]} data - The data to be written to the CSV file.
* @param {string} outputPath - The path where the CSV file will be written.
* @returns {Promise<void>} - A Promise that resolves when the operation is complete.
*/
export declare function generateCsvFile(data: any[], outputPath: string): Promise<any>;