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
62 lines (61 loc) • 2.9 kB
TypeScript
import { SfCommand } from '@salesforce/sf-plugins-core';
import { AnyJson } from '@salesforce/ts-types';
import { Connection } from '@salesforce/core';
type FieldUsageRow = {
sObjectName: string;
fieldApiName: string;
fieldLabel: string;
fieldCreatedDate: string;
totalRecords: number;
populatedRecords: number;
populatedPercentageNumeric: number;
populatedPercentage: string;
};
type SkippedFieldInfo = {
sObjectName: string;
fieldName: string;
reason: string;
};
type FieldDistributionResult = {
outputString: string;
result: any[];
reportFiles: any[];
totalRecords: number;
};
export default class HardisDocObjectFieldUsage extends SfCommand<any> {
static description: string;
static examples: string[];
static flags: any;
protected identifierRegex: RegExp;
protected compositeBatchSize: number;
protected toolingCustomFieldBatchSize: number;
protected objectsPromptSentinel: string;
protected formatDateOnly(value: any): string;
protected fetchFieldCreatedDates(connection: Connection, sObjectName: string, fieldApiNames: string[]): Promise<Record<string, string>>;
protected validateIdentifier(identifier: string, label: string): void;
protected extractCount(result: any): number;
protected countRecords(connection: Connection, sObjectName: string, useTooling: boolean, fieldName?: string): Promise<number>;
protected countFieldsWithComposite(connection: Connection, sObjectName: string, fields: any[], useTooling: boolean, skippedFields: SkippedFieldInfo[], batchSize?: number): Promise<Record<string, number>>;
protected queryFieldDistribution(connection: Connection, sObjectName: string, fieldName: string, useTooling: boolean): Promise<any>;
protected isInvalidTypeError(error: any): boolean;
protected describeTarget(connection: Connection, sObjectName: string): Promise<{
describeResult: any;
useTooling: boolean;
}>;
protected processSingleFieldAnalysis(connection: Connection, sObjectName: string, fieldDescribe: any, useTooling: boolean): Promise<FieldDistributionResult>;
protected processObjectFieldUsage(connection: Connection, sObjectName: string, eligibleFields: any[], useTooling: boolean): Promise<{
rows: FieldUsageRow[];
totalRecords: number;
skippedFields: SkippedFieldInfo[];
}>;
protected generateFieldUsageCsvReport(rows: FieldUsageRow[], reportName: string, fileTitle: string): Promise<string>;
protected filterDescribeFields(fields: any[]): any[];
protected estimateApiCalls(contexts: Array<{
sObjectName: string;
eligibleFields: any[];
}>, fieldFilters?: string[]): number;
protected confirmApiUsage(plannedCalls: number, objectNames: string[]): Promise<boolean>;
protected injectObjectsPromptSentinel(): void;
run(): Promise<AnyJson>;
}
export {};