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
50 lines (49 loc) • 2.46 kB
TypeScript
import { SfCommand } from '@salesforce/sf-plugins-core';
import { AnyJson } from '@salesforce/ts-types';
export default class LintMetadataStatus extends SfCommand<any> {
static title: string;
static description: string;
static examples: string[];
static flags: any;
protected static supportsDevhubUsername: boolean;
static requiresProject: boolean;
private flowFilePattern;
private validationRuleFilePattern;
private ignorePatterns;
protected inactiveItems: any[];
protected outputFile: string;
protected outputFilesRes: any;
run(): Promise<AnyJson>;
/**
* This function verifies the status of flows by checking each flow file.
* It reads each flow file and checks if the flow is in 'Draft' status.
* If the flow is in 'Draft' status, it extracts the file name and adds it to the list of draft files.
*
* @returns {Promise<string[]>} - A Promise that resolves to an array of draft files. Each entry in the array is the name of a draft file.
*/
private verifyFlows;
/**
* This function verifies the validation rules by checking each rule file for inactive rules.
* It reads each validation rule file and checks if the rule is active or not.
* If the rule is inactive, it extracts the rule name and the object name and adds them to the list of inactive rules.
*
* @returns {Promise<string[]>} - A Promise that resolves to an array of inactive rules. Each entry in the array is a string in the format 'ObjectName - RuleName'.
*/
private verifyValidationRules;
private verifyRecordTypes;
private verifyApprovalProcesses;
private verifyForecastingTypes;
private verifyWorkflowRules;
private verifyAssignmentRules;
private verifyAutoResponseRules;
private verifyEscalationRules;
/**
* This function builds a CSV file from arrays of draft flows and inactive validation rules.
* It first ensures that the output file path is generated.
* It then maps the draft flows and inactive validation rules into an array of objects, each with a 'type' property set to either "Draft Flow" or "Inactive VR" and a 'name' property set to the file or rule name.
* Finally, it generates a CSV file from this array and writes it to the output file.
*
* @returns {Promise<void>} - A Promise that resolves when the CSV file has been successfully generated.
*/
private buildCsvFile;
}