@simplysf/simply-sobject 1.3.6 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/simply/sobject/history/schema.d.ts +26 -0
- package/lib/commands/simply/sobject/history/schema.js +221 -0
- package/lib/commands/simply/sobject/history/schema.js.map +1 -0
- package/lib/common/fieldHistorySchemaReportTemplate.d.ts +26 -0
- package/lib/common/fieldHistorySchemaReportTemplate.js +126 -0
- package/lib/common/fieldHistorySchemaReportTemplate.js.map +1 -0
- package/messages/simply.sobject.history.schema.md +57 -0
- package/package.json +3 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
/** Where the CSV and HTML reports were written, and how many objects/fields they cover. */
|
|
3
|
+
export type SObjectHistorySchemaResult = {
|
|
4
|
+
trackedObjectCount: number;
|
|
5
|
+
trackedFieldCount: number;
|
|
6
|
+
csvPath: string;
|
|
7
|
+
htmlPath: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Identifies every object with field history tracking enabled, and every tracked field on each,
|
|
11
|
+
* resolving the managed/unlocked package each field belongs to, and writes the results to a
|
|
12
|
+
* timestamped CSV file and a browsable HTML report.
|
|
13
|
+
*/
|
|
14
|
+
export default class SObjectHistorySchema extends SfCommand<SObjectHistorySchemaResult> {
|
|
15
|
+
static readonly summary: string;
|
|
16
|
+
static readonly description: string;
|
|
17
|
+
static readonly examples: string[];
|
|
18
|
+
static readonly flags: {
|
|
19
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
};
|
|
24
|
+
/** @returns The output CSV/HTML paths and the number of tracked objects/fields found. */
|
|
25
|
+
run(): Promise<SObjectHistorySchemaResult>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import fs from 'node:fs';
|
|
17
|
+
import path from 'node:path';
|
|
18
|
+
import { Messages } from '@salesforce/core';
|
|
19
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
20
|
+
import { writeRecordsToCsvFile } from '@simplysf/simply-core';
|
|
21
|
+
import { buildFieldHistorySchemaReportHtml, } from '../../../../common/fieldHistorySchemaReportTemplate.js';
|
|
22
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
23
|
+
const messages = Messages.loadMessages('@simplysf/simply-sobject', 'simply.sobject.history.schema');
|
|
24
|
+
/** Output CSV column order/headers for the exported schema records. */
|
|
25
|
+
const CSV_COLUMNS = [
|
|
26
|
+
'OBJECT_NAME',
|
|
27
|
+
'OBJECT_API_NAME',
|
|
28
|
+
'FIELD_NAME',
|
|
29
|
+
'FIELD_API_NAME',
|
|
30
|
+
'MANAGED_PACKAGE_NAMESPACE',
|
|
31
|
+
'PACKAGE_NAME',
|
|
32
|
+
];
|
|
33
|
+
/** Number of objects to retrieve tracked fields for concurrently. */
|
|
34
|
+
const OBJECT_CONCURRENCY = 5;
|
|
35
|
+
/** Maximum number of field IDs per `WHERE SubjectId IN (...)` chunk for the `Package2Member` query. */
|
|
36
|
+
const ID_CHUNK_SIZE = 200;
|
|
37
|
+
/**
|
|
38
|
+
* Query every object with field history tracking enabled, and every tracked field on each,
|
|
39
|
+
* resolving the managed/unlocked package each field belongs to.
|
|
40
|
+
*
|
|
41
|
+
* @param connection - The org connection to query against.
|
|
42
|
+
* @param entities - The field-history-tracked objects to retrieve tracked fields for.
|
|
43
|
+
* @param onObjectComplete - Called once per object after its fields have been retrieved, used by
|
|
44
|
+
* the caller to report progress.
|
|
45
|
+
* @returns The tracked field entries (without package names for unlocked-package fields resolved
|
|
46
|
+
* yet) and the set of field IDs whose package still needs to be resolved via `Package2Member`.
|
|
47
|
+
*/
|
|
48
|
+
async function retrieveTrackedFields(connection, entities, onObjectComplete) {
|
|
49
|
+
const entries = [];
|
|
50
|
+
const missingPackageIds = new Set();
|
|
51
|
+
for (let i = 0; i < entities.length; i += OBJECT_CONCURRENCY) {
|
|
52
|
+
const chunk = entities.slice(i, i + OBJECT_CONCURRENCY);
|
|
53
|
+
// eslint-disable-next-line no-await-in-loop
|
|
54
|
+
await Promise.all(chunk.map(async (entity) => {
|
|
55
|
+
const fieldResult = await connection.autoFetchQuery(`SELECT DurableId, Label, QualifiedApiName, NamespacePrefix, Publisher.Name FROM FieldDefinition ` +
|
|
56
|
+
`WHERE EntityDefinitionId = '${entity.DurableId}' AND IsFieldHistoryTracked = true`, { tooling: true });
|
|
57
|
+
for (const field of fieldResult.records) {
|
|
58
|
+
const rawPackageName = field.Publisher?.Name ?? 'N/A';
|
|
59
|
+
const packageName = rawPackageName === '<local>' ? 'Local (Unpackaged)' : rawPackageName;
|
|
60
|
+
entries.push({
|
|
61
|
+
objectName: entity.Label,
|
|
62
|
+
objectApiName: entity.QualifiedApiName,
|
|
63
|
+
fieldName: field.Label,
|
|
64
|
+
fieldApiName: field.QualifiedApiName,
|
|
65
|
+
managedPackageNamespace: field.NamespacePrefix ?? 'N/A',
|
|
66
|
+
packageName,
|
|
67
|
+
durableId: field.DurableId,
|
|
68
|
+
});
|
|
69
|
+
// Unlocked (2GP) package fields aren't attributed via Publisher.Name, so their
|
|
70
|
+
// durable ID is queued to be resolved separately via Package2Member.
|
|
71
|
+
if (packageName === 'N/A' ||
|
|
72
|
+
(packageName === 'Local (Unpackaged)' && field.QualifiedApiName.endsWith('__c'))) {
|
|
73
|
+
const fieldId = field.DurableId.split('.')[1];
|
|
74
|
+
if (fieldId) {
|
|
75
|
+
missingPackageIds.add(fieldId);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
onObjectComplete();
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
return { entries, missingPackageIds };
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Resolve unlocked (2GP) package names for the given field IDs via `Package2Member`, and apply
|
|
86
|
+
* them back onto any matching entry still carrying an unresolved package name.
|
|
87
|
+
*
|
|
88
|
+
* @param connection - The org connection to query against.
|
|
89
|
+
* @param entries - The entries to update in place.
|
|
90
|
+
* @param missingPackageIds - The field IDs (15-char) to resolve package names for.
|
|
91
|
+
* @returns The number of package names resolved.
|
|
92
|
+
*/
|
|
93
|
+
async function resolveUnlockedPackageNames(connection, entries, missingPackageIds) {
|
|
94
|
+
const packageMap = new Map();
|
|
95
|
+
const idArray = [...missingPackageIds];
|
|
96
|
+
for (let i = 0; i < idArray.length; i += ID_CHUNK_SIZE) {
|
|
97
|
+
const idChunk = idArray.slice(i, i + ID_CHUNK_SIZE);
|
|
98
|
+
const idsClause = idChunk.map((id) => `'${id}'`).join(',');
|
|
99
|
+
// eslint-disable-next-line no-await-in-loop
|
|
100
|
+
const packageResult = await connection.autoFetchQuery(`SELECT SubjectId, SubscriberPackage.Name FROM Package2Member WHERE SubjectId IN (${idsClause})`, { tooling: true });
|
|
101
|
+
for (const record of packageResult.records) {
|
|
102
|
+
packageMap.set(record.SubjectId.substring(0, 15), record.SubscriberPackage.Name);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
entries.forEach((entry) => {
|
|
106
|
+
if (entry.packageName !== 'N/A' && entry.packageName !== 'Local (Unpackaged)') {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const fieldId = entry.durableId.split('.')[1]?.substring(0, 15);
|
|
110
|
+
const resolvedName = fieldId ? packageMap.get(fieldId) : undefined;
|
|
111
|
+
if (resolvedName) {
|
|
112
|
+
entry.packageName = resolvedName;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return packageMap.size;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Identifies every object with field history tracking enabled, and every tracked field on each,
|
|
119
|
+
* resolving the managed/unlocked package each field belongs to, and writes the results to a
|
|
120
|
+
* timestamped CSV file and a browsable HTML report.
|
|
121
|
+
*/
|
|
122
|
+
export default class SObjectHistorySchema extends SfCommand {
|
|
123
|
+
static summary = messages.getMessage('summary');
|
|
124
|
+
static description = messages.getMessage('description');
|
|
125
|
+
static examples = messages.getMessages('examples');
|
|
126
|
+
static flags = {
|
|
127
|
+
...SfCommand.baseFlags,
|
|
128
|
+
'api-version': Flags.orgApiVersion(),
|
|
129
|
+
'output-dir': Flags.directory({
|
|
130
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
|
131
|
+
description: messages.getMessage('flags.output-dir.description'),
|
|
132
|
+
char: 'd',
|
|
133
|
+
}),
|
|
134
|
+
'target-org': Flags.requiredOrg(),
|
|
135
|
+
};
|
|
136
|
+
/** @returns The output CSV/HTML paths and the number of tracked objects/fields found. */
|
|
137
|
+
async run() {
|
|
138
|
+
const { flags } = await this.parse(SObjectHistorySchema);
|
|
139
|
+
const connection = flags['target-org']?.getConnection(flags['api-version']);
|
|
140
|
+
if (!connection) {
|
|
141
|
+
throw messages.createError('error.targetOrgConnectionFailed');
|
|
142
|
+
}
|
|
143
|
+
const username = connection.getUsername() ?? '';
|
|
144
|
+
this.spinner.start(messages.getMessage('info.identifyingObjects'));
|
|
145
|
+
const objectResult = await connection.autoFetchQuery('SELECT DurableId, QualifiedApiName, Label FROM EntityDefinition WHERE IsFieldHistoryTracked = true', { tooling: true });
|
|
146
|
+
const trackedObjects = objectResult.records;
|
|
147
|
+
this.spinner.stop();
|
|
148
|
+
this.info(messages.getMessage('info.objectsFound', [trackedObjects.length]));
|
|
149
|
+
let objectsProcessed = 0;
|
|
150
|
+
this.spinner.start(messages.getMessage('info.retrievingFields', [objectsProcessed, trackedObjects.length]));
|
|
151
|
+
const { entries, missingPackageIds } = await retrieveTrackedFields(connection, trackedObjects, () => {
|
|
152
|
+
objectsProcessed++;
|
|
153
|
+
this.spinner.status = `${objectsProcessed}/${trackedObjects.length}`;
|
|
154
|
+
});
|
|
155
|
+
this.spinner.stop();
|
|
156
|
+
if (missingPackageIds.size > 0) {
|
|
157
|
+
this.spinner.start(messages.getMessage('info.resolvingPackages', [missingPackageIds.size]));
|
|
158
|
+
const resolvedCount = await resolveUnlockedPackageNames(connection, entries, missingPackageIds);
|
|
159
|
+
this.spinner.stop();
|
|
160
|
+
this.info(messages.getMessage('info.packagesResolved', [resolvedCount]));
|
|
161
|
+
}
|
|
162
|
+
const outputDir = flags['output-dir'] ?? '.';
|
|
163
|
+
if (!fs.existsSync(outputDir)) {
|
|
164
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
165
|
+
}
|
|
166
|
+
const timestamp = buildTimestamp();
|
|
167
|
+
const csvPath = path.join(outputDir, `field_history_schema_${timestamp}.csv`);
|
|
168
|
+
const htmlPath = path.join(outputDir, `field_history_schema_${timestamp}.html`);
|
|
169
|
+
this.spinner.start(messages.getMessage('info.writingCsv'));
|
|
170
|
+
const csvRecords = entries.map((entry) => ({
|
|
171
|
+
OBJECT_NAME: entry.objectName,
|
|
172
|
+
OBJECT_API_NAME: entry.objectApiName,
|
|
173
|
+
FIELD_NAME: entry.fieldName,
|
|
174
|
+
FIELD_API_NAME: entry.fieldApiName,
|
|
175
|
+
MANAGED_PACKAGE_NAMESPACE: entry.managedPackageNamespace,
|
|
176
|
+
PACKAGE_NAME: entry.packageName,
|
|
177
|
+
}));
|
|
178
|
+
const { recordCount } = await writeRecordsToCsvFile(toAsyncIterable(csvRecords), csvPath, CSV_COLUMNS);
|
|
179
|
+
this.spinner.stop();
|
|
180
|
+
this.spinner.start(messages.getMessage('info.generatingHtml'));
|
|
181
|
+
const groupedData = new Map();
|
|
182
|
+
entries.forEach((entry) => {
|
|
183
|
+
if (!groupedData.has(entry.packageName)) {
|
|
184
|
+
groupedData.set(entry.packageName, []);
|
|
185
|
+
}
|
|
186
|
+
groupedData.get(entry.packageName)?.push(entry);
|
|
187
|
+
});
|
|
188
|
+
const html = buildFieldHistorySchemaReportHtml({
|
|
189
|
+
username,
|
|
190
|
+
reportDate: new Date().toLocaleString(),
|
|
191
|
+
groupedData,
|
|
192
|
+
});
|
|
193
|
+
await fs.promises.writeFile(htmlPath, html);
|
|
194
|
+
this.spinner.stop();
|
|
195
|
+
this.info(messages.getMessage('info.complete', [trackedObjects.length, recordCount, csvPath, htmlPath]));
|
|
196
|
+
return {
|
|
197
|
+
trackedObjectCount: trackedObjects.length,
|
|
198
|
+
trackedFieldCount: recordCount,
|
|
199
|
+
csvPath,
|
|
200
|
+
htmlPath,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/** @returns An async iterable that yields every element of `items` in order, for streaming into a CSV writer. */
|
|
205
|
+
function toAsyncIterable(items) {
|
|
206
|
+
return {
|
|
207
|
+
[Symbol.asyncIterator]() {
|
|
208
|
+
const iterator = items[Symbol.iterator]();
|
|
209
|
+
return {
|
|
210
|
+
next: () => Promise.resolve(iterator.next()),
|
|
211
|
+
};
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
/** @returns The current local time as a `YYYYMMDD_HHMMSS` string, for uniquing output filenames. */
|
|
216
|
+
function buildTimestamp() {
|
|
217
|
+
const now = new Date();
|
|
218
|
+
const pad = (n) => n.toString().padStart(2, '0');
|
|
219
|
+
return `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}_${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../src/commands/simply/sobject/history/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAmB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,iCAAiC,GAGlC,MAAM,wDAAwD,CAAC;AAEhE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,+BAA+B,CAAC,CAAC;AAEpG,uEAAuE;AACvE,MAAM,WAAW,GAAG;IAClB,aAAa;IACb,iBAAiB;IACjB,YAAY;IACZ,gBAAgB;IAChB,2BAA2B;IAC3B,cAAc;CACf,CAAC;AAEF,qEAAqE;AACrE,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,uGAAuG;AACvG,MAAM,aAAa,GAAG,GAAG,CAAC;AA6B1B;;;;;;;;;;GAUG;AACH,KAAK,UAAU,qBAAqB,CAClC,UAAsB,EACt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EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEzG,OAAO;YACL,kBAAkB,EAAE,cAAc,CAAC,MAAM;YACzC,iBAAiB,EAAE,WAAW;YAC9B,OAAO;YACP,QAAQ;SACT,CAAC;IACJ,CAAC;;AAGH,iHAAiH;AACjH,SAAS,eAAe,CAAI,KAAU;IACpC,OAAO;QACL,CAAC,MAAM,CAAC,aAAa,CAAC;YACpB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1C,OAAO;gBACL,IAAI,EAAE,GAA+B,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;aACzE,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED,oGAAoG;AACpG,SAAS,cAAc;IACrB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACjE,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,GAAG,CACrG,GAAG,CAAC,UAAU,EAAE,CACjB,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** A single field-history-tracked field, as rendered in the report. */
|
|
2
|
+
export type FieldHistorySchemaEntry = {
|
|
3
|
+
objectName: string;
|
|
4
|
+
objectApiName: string;
|
|
5
|
+
fieldName: string;
|
|
6
|
+
fieldApiName: string;
|
|
7
|
+
managedPackageNamespace: string;
|
|
8
|
+
packageName: string;
|
|
9
|
+
};
|
|
10
|
+
/** Tracked fields, grouped by owning package (namespace/subscriber package name, or `'Local (Unpackaged)'`). */
|
|
11
|
+
export type GroupedFieldHistorySchemaData = Map<string, FieldHistorySchemaEntry[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Render a complete, self-contained HTML report of field-history-tracked objects/fields, grouped
|
|
14
|
+
* by owning package, with each package section collapsible and a client-side search box for
|
|
15
|
+
* filtering objects/fields across all packages.
|
|
16
|
+
*
|
|
17
|
+
* @param options.username - The org username the report was generated against.
|
|
18
|
+
* @param options.reportDate - The report generation date/time, displayed as-is.
|
|
19
|
+
* @param options.groupedData - The tracked fields to render, grouped by package.
|
|
20
|
+
* @returns The rendered HTML document.
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildFieldHistorySchemaReportHtml(options: {
|
|
23
|
+
username: string;
|
|
24
|
+
reportDate: string;
|
|
25
|
+
groupedData: GroupedFieldHistorySchemaData;
|
|
26
|
+
}): string;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, Clay Chipps; Copyright (c) 2026 Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import Handlebars from 'handlebars';
|
|
17
|
+
// Handlebars auto-escapes every `{{expression}}` (unlike `{{{expression}}}`, which is left raw),
|
|
18
|
+
// so the template below doesn't need a hand-rolled escapeHtml() call.
|
|
19
|
+
const handlebars = Handlebars.create();
|
|
20
|
+
const fieldRowSource = `
|
|
21
|
+
<tr class="field-row">
|
|
22
|
+
<td><strong>{{objectName}}</strong><br><small>{{objectApiName}}</small></td>
|
|
23
|
+
<td><strong>{{fieldName}}</strong><br><small>{{fieldApiName}}</small></td>
|
|
24
|
+
<td>
|
|
25
|
+
{{#unless (eq managedPackageNamespace "N/A")}}<span class="badge badge-ns">{{managedPackageNamespace}}</span>{{/unless}}
|
|
26
|
+
<span class="badge">{{packageName}}</span>
|
|
27
|
+
</td>
|
|
28
|
+
</tr>`;
|
|
29
|
+
const packageSectionSource = `
|
|
30
|
+
<div class="package-section" data-package="{{name}}">
|
|
31
|
+
<h2>Package: {{name}}</h2>
|
|
32
|
+
<details>
|
|
33
|
+
<summary>Tracked Fields ({{fields.length}})</summary>
|
|
34
|
+
<div class="content">
|
|
35
|
+
<table>
|
|
36
|
+
<thead><tr><th>Object</th><th>Field</th><th>Details</th></tr></thead>
|
|
37
|
+
<tbody>{{#each fields}}{{> fieldRow}}{{/each}}</tbody>
|
|
38
|
+
</table>
|
|
39
|
+
</div>
|
|
40
|
+
</details>
|
|
41
|
+
</div>`;
|
|
42
|
+
const reportSource = `<!DOCTYPE html>
|
|
43
|
+
<html lang="en">
|
|
44
|
+
<head>
|
|
45
|
+
<meta charset="UTF-8">
|
|
46
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
47
|
+
<title>Field History Tracking Report</title>
|
|
48
|
+
<style>
|
|
49
|
+
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #333; max-width: 1200px; margin: 0 auto; padding: 20px; background-color: #f4f7f6; }
|
|
50
|
+
h1 { color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 10px; }
|
|
51
|
+
.package-section { background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 20px; padding: 15px; }
|
|
52
|
+
details { margin-bottom: 10px; border: 1px solid #ddd; border-radius: 4px; }
|
|
53
|
+
summary { padding: 12px; cursor: pointer; font-weight: bold; background: #eee; outline: none; }
|
|
54
|
+
summary:hover { background: #e0e0e0; }
|
|
55
|
+
.content { padding: 15px; background: white; }
|
|
56
|
+
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.9em; }
|
|
57
|
+
th, td { border: 1px solid #ddd; padding: 10px; text-align: left; }
|
|
58
|
+
th { background-color: #f8f9fa; position: sticky; top: 0; }
|
|
59
|
+
tr:hover { background-color: #f5f5f5; }
|
|
60
|
+
.badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 0.8em; margin-right: 2px; color: white; background-color: #95a5a6; }
|
|
61
|
+
.badge-ns { background-color: #3498db; }
|
|
62
|
+
.search-container { margin-bottom: 20px; position: sticky; top: 10px; z-index: 100; }
|
|
63
|
+
input[type="text"] { padding: 12px; width: 100%; max-width: 400px; border: 2px solid #3498db; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
|
|
64
|
+
</style>
|
|
65
|
+
</head>
|
|
66
|
+
<body>
|
|
67
|
+
<h1>Field History Tracking Report</h1>
|
|
68
|
+
<p>Org: <strong>{{username}}</strong> | Tracked Fields: {{fieldCount}} | Generated: {{reportDate}}</p>
|
|
69
|
+
<div class="search-container">
|
|
70
|
+
<input type="text" id="searchInput" onkeyup="filterFields()" placeholder="Search objects or fields across all packages...">
|
|
71
|
+
</div>
|
|
72
|
+
{{#each packages}}{{> packageSection}}{{/each}}
|
|
73
|
+
<script>
|
|
74
|
+
function filterFields() {
|
|
75
|
+
const input = document.getElementById("searchInput");
|
|
76
|
+
const filter = input.value.toUpperCase();
|
|
77
|
+
const sections = document.querySelectorAll(".package-section");
|
|
78
|
+
sections.forEach(section => {
|
|
79
|
+
let sectionHasVisibleRows = false;
|
|
80
|
+
const rows = section.querySelectorAll(".field-row");
|
|
81
|
+
const details = section.querySelector("details");
|
|
82
|
+
|
|
83
|
+
rows.forEach(row => {
|
|
84
|
+
const text = row.textContent || row.innerText;
|
|
85
|
+
if (text.toUpperCase().indexOf(filter) > -1) {
|
|
86
|
+
row.style.display = "";
|
|
87
|
+
sectionHasVisibleRows = true;
|
|
88
|
+
} else {
|
|
89
|
+
row.style.display = "none";
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
section.style.display = sectionHasVisibleRows ? "" : "none";
|
|
94
|
+
if (filter && sectionHasVisibleRows) {
|
|
95
|
+
details.open = true;
|
|
96
|
+
} else if (!filter) {
|
|
97
|
+
details.open = false;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
</script>
|
|
102
|
+
</body>
|
|
103
|
+
</html>`;
|
|
104
|
+
handlebars.registerHelper('eq', (a, b) => a === b);
|
|
105
|
+
handlebars.registerPartial('fieldRow', fieldRowSource);
|
|
106
|
+
handlebars.registerPartial('packageSection', packageSectionSource);
|
|
107
|
+
const renderReport = handlebars.compile(reportSource);
|
|
108
|
+
/**
|
|
109
|
+
* Render a complete, self-contained HTML report of field-history-tracked objects/fields, grouped
|
|
110
|
+
* by owning package, with each package section collapsible and a client-side search box for
|
|
111
|
+
* filtering objects/fields across all packages.
|
|
112
|
+
*
|
|
113
|
+
* @param options.username - The org username the report was generated against.
|
|
114
|
+
* @param options.reportDate - The report generation date/time, displayed as-is.
|
|
115
|
+
* @param options.groupedData - The tracked fields to render, grouped by package.
|
|
116
|
+
* @returns The rendered HTML document.
|
|
117
|
+
*/
|
|
118
|
+
export function buildFieldHistorySchemaReportHtml(options) {
|
|
119
|
+
const { username, reportDate, groupedData } = options;
|
|
120
|
+
const packages = [...groupedData.keys()]
|
|
121
|
+
.sort()
|
|
122
|
+
.map((name) => ({ name, fields: groupedData.get(name) ?? [] }));
|
|
123
|
+
const fieldCount = packages.reduce((sum, pkg) => sum + pkg.fields.length, 0);
|
|
124
|
+
return renderReport({ username, reportDate, fieldCount, packages });
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=fieldHistorySchemaReportTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldHistorySchemaReportTemplate.js","sourceRoot":"","sources":["../../src/common/fieldHistorySchemaReportTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AAepC,iGAAiG;AACjG,sEAAsE;AACtE,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;AAEvC,MAAM,cAAc,GAAG;;;;;;;;MAQjB,CAAC;AAEP,MAAM,oBAAoB,GAAG;;;;;;;;;;;;OAYtB,CAAC;AAER,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA6Db,CAAC;AAET,UAAU,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAU,EAAE,CAAU,EAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9E,UAAU,CAAC,eAAe,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;AACvD,UAAU,CAAC,eAAe,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;AAEnE,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAQtD;;;;;;;;;GASG;AACH,MAAM,UAAU,iCAAiC,CAAC,OAIjD;IACC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEtD,MAAM,QAAQ,GAAqB,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;SACvD,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAElE,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAE7E,OAAO,YAAY,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Report on which objects and fields have field history tracking enabled.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Identifies every object with field history tracking enabled, and every tracked field on each, resolving the managed/unlocked package each field belongs to, and writes the results to a timestamped CSV file and a browsable HTML report.
|
|
8
|
+
|
|
9
|
+
# flags.output-dir.summary
|
|
10
|
+
|
|
11
|
+
Output directory
|
|
12
|
+
|
|
13
|
+
# flags.output-dir.description
|
|
14
|
+
|
|
15
|
+
The directory to save the generated CSV and HTML report files to. Defaults to the current directory.
|
|
16
|
+
|
|
17
|
+
# examples
|
|
18
|
+
|
|
19
|
+
- <%= config.bin %> <%= command.id %> --target-org myOrg
|
|
20
|
+
|
|
21
|
+
- <%= config.bin %> <%= command.id %> --target-org myOrg --output-dir reports
|
|
22
|
+
|
|
23
|
+
# error.targetOrgConnectionFailed
|
|
24
|
+
|
|
25
|
+
Unable to establish connection to the org.
|
|
26
|
+
|
|
27
|
+
# info.identifyingObjects
|
|
28
|
+
|
|
29
|
+
Identifying objects with field history tracking enabled...
|
|
30
|
+
|
|
31
|
+
# info.objectsFound
|
|
32
|
+
|
|
33
|
+
Found %s object(s) with field history tracking enabled.
|
|
34
|
+
|
|
35
|
+
# info.retrievingFields
|
|
36
|
+
|
|
37
|
+
Retrieving tracked fields for each object (%s/%s)...
|
|
38
|
+
|
|
39
|
+
# info.resolvingPackages
|
|
40
|
+
|
|
41
|
+
Resolving package names for %s potential unlocked package field(s)...
|
|
42
|
+
|
|
43
|
+
# info.packagesResolved
|
|
44
|
+
|
|
45
|
+
Resolved names for %s package(s).
|
|
46
|
+
|
|
47
|
+
# info.writingCsv
|
|
48
|
+
|
|
49
|
+
Writing results to CSV...
|
|
50
|
+
|
|
51
|
+
# info.generatingHtml
|
|
52
|
+
|
|
53
|
+
Generating HTML report...
|
|
54
|
+
|
|
55
|
+
# info.complete
|
|
56
|
+
|
|
57
|
+
Found %s tracked object(s) and %s tracked field(s). CSV written to: %s. HTML report written to: %s
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysf/simply-sobject",
|
|
3
3
|
"description": "Utilities for working with SObjects",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"author": "@ClayChipps",
|
|
6
6
|
"homepage": "https://github.com/SimplySF/simply",
|
|
7
7
|
"bugs": "https://github.com/SimplySF/simply/issues",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"@salesforce/kit": "^3.2.6",
|
|
67
67
|
"@salesforce/sf-plugins-core": "^12.2.16",
|
|
68
68
|
"@simplysf/simply-core": "^1.1.6",
|
|
69
|
+
"handlebars": "^4.7.9",
|
|
69
70
|
"zod": "^4.1.12"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
@@ -212,5 +213,5 @@
|
|
|
212
213
|
"output": []
|
|
213
214
|
}
|
|
214
215
|
},
|
|
215
|
-
"gitHead": "
|
|
216
|
+
"gitHead": "b3425182fe3a16a6b35ce537b4178023b264f143"
|
|
216
217
|
}
|