sfdx-hardis 7.17.0 → 7.19.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/defaults/ci/.github/workflows/check-deploy.yml +1 -1
- package/defaults/ci/.github/workflows/process-deploy.yml +1 -1
- package/defaults/ci/azure-pipelines-checks.yml +1 -1
- package/defaults/ci/azure-pipelines-deployment.yml +1 -1
- package/lib/commands/hardis/doc/data-dictionary.d.ts +8 -0
- package/lib/commands/hardis/doc/data-dictionary.js +183 -0
- package/lib/commands/hardis/doc/data-dictionary.js.map +1 -0
- package/lib/commands/hardis/mdapi/read.d.ts +11 -0
- package/lib/commands/hardis/mdapi/read.js +190 -0
- package/lib/commands/hardis/mdapi/read.js.map +1 -0
- package/lib/commands/hardis/mdapi/upsert.d.ts +11 -0
- package/lib/commands/hardis/mdapi/upsert.js +177 -0
- package/lib/commands/hardis/mdapi/upsert.js.map +1 -0
- package/lib/commands/hardis/org/monitor/errors.js +2 -2
- package/lib/commands/hardis/org/retrieve/sources/retrofit.js +2 -1
- package/lib/commands/hardis/org/retrieve/sources/retrofit.js.map +1 -1
- package/lib/commands/hardis/work/new.js +7 -9
- package/lib/commands/hardis/work/new.js.map +1 -1
- package/lib/common/metadata-utils/crudMetadataApi.d.ts +65 -0
- package/lib/common/metadata-utils/crudMetadataApi.js +354 -0
- package/lib/common/metadata-utils/crudMetadataApi.js.map +1 -0
- package/lib/common/utils/dataDictionaryUtils.d.ts +17 -0
- package/lib/common/utils/dataDictionaryUtils.js +442 -0
- package/lib/common/utils/dataDictionaryUtils.js.map +1 -0
- package/lib/common/utils/filesUtils.d.ts +7 -0
- package/lib/common/utils/filesUtils.js +111 -12
- package/lib/common/utils/filesUtils.js.map +1 -1
- package/lib/common/utils/gitUtils.js +14 -2
- package/lib/common/utils/gitUtils.js.map +1 -1
- package/lib/common/utils/index.d.ts +19 -0
- package/lib/common/utils/index.js +117 -1
- package/lib/common/utils/index.js.map +1 -1
- package/lib/i18n/de.json +35 -0
- package/lib/i18n/en.json +35 -0
- package/lib/i18n/es.json +35 -0
- package/lib/i18n/fr.json +35 -0
- package/lib/i18n/it.json +35 -0
- package/lib/i18n/ja.json +35 -0
- package/lib/i18n/nl.json +35 -0
- package/lib/i18n/pl.json +35 -0
- package/lib/i18n/pt-BR.json +35 -0
- package/oclif.lock +23 -23
- package/oclif.manifest.json +3871 -3487
- package/package.json +7 -4
|
@@ -81,7 +81,7 @@ jobs:
|
|
|
81
81
|
JIRA_HOST: ${{ secrets.JIRA_HOST }}
|
|
82
82
|
JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
|
|
83
83
|
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
|
|
84
|
-
JIRA_PAT: ${{ secrets.
|
|
84
|
+
JIRA_PAT: ${{ secrets.JIRA_PAT }}
|
|
85
85
|
JIRA_TICKET_REGEX: ${{ secrets.JIRA_TICKET_REGEX }}
|
|
86
86
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
87
87
|
# Uncomment to provide API keys for coding agent auto-fix of deployment errors
|
|
@@ -82,7 +82,7 @@ jobs:
|
|
|
82
82
|
JIRA_HOST: ${{ secrets.JIRA_HOST }}
|
|
83
83
|
JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
|
|
84
84
|
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
|
|
85
|
-
JIRA_PAT: ${{ secrets.
|
|
85
|
+
JIRA_PAT: ${{ secrets.JIRA_PAT }}
|
|
86
86
|
# Uncomment to provide API keys for coding agent auto-fix of deployment errors
|
|
87
87
|
# ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
88
88
|
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
@@ -98,7 +98,7 @@ jobs:
|
|
|
98
98
|
JIRA_HOST: $(JIRA_HOST)
|
|
99
99
|
JIRA_EMAIL: $(JIRA_EMAIL)
|
|
100
100
|
JIRA_TOKEN: $(JIRA_TOKEN)
|
|
101
|
-
JIRA_PAT: $(
|
|
101
|
+
JIRA_PAT: $(JIRA_PAT)
|
|
102
102
|
JIRA_TICKET_REGEX: $(JIRA_TICKET_REGEX)
|
|
103
103
|
OPENAI_API_KEY: $(OPENAI_API_KEY)
|
|
104
104
|
# Uncomment to provide API keys for coding agent auto-fix of deployment errors
|
|
@@ -90,7 +90,7 @@ jobs:
|
|
|
90
90
|
JIRA_HOST: $(JIRA_HOST)
|
|
91
91
|
JIRA_EMAIL: $(JIRA_EMAIL)
|
|
92
92
|
JIRA_TOKEN: $(JIRA_TOKEN)
|
|
93
|
-
JIRA_PAT: $(
|
|
93
|
+
JIRA_PAT: $(JIRA_PAT)
|
|
94
94
|
JIRA_TICKET_REGEX: $(JIRA_TICKET_REGEX)
|
|
95
95
|
SFDX_DEPLOY_WAIT_MINUTES: $(SFDX_DEPLOY_WAIT_MINUTES)
|
|
96
96
|
SFDX_AUTH_URL_TECHNICAL_ORG: $(SFDX_AUTH_URL_TECHNICAL_ORG)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { AnyJson } from '@salesforce/ts-types';
|
|
3
|
+
export default class HardisDocDataDictionary extends SfCommand<any> {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: any;
|
|
7
|
+
run(): Promise<AnyJson>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { Flags, SfCommand, requiredOrgFlagWithDeprecations } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { Messages } from '@salesforce/core';
|
|
3
|
+
import c from 'chalk';
|
|
4
|
+
import { isCI, uxLog } from '../../../common/utils/index.js';
|
|
5
|
+
import { prompts } from '../../../common/utils/prompts.js';
|
|
6
|
+
import { WebSocketClient } from '../../../common/websocketClient.js';
|
|
7
|
+
import { listOrgSObjects } from '../../../common/utils/orgUtils.js';
|
|
8
|
+
import { t } from '../../../common/utils/i18n.js';
|
|
9
|
+
import { collectObjectDictionary, fetchRecordTypes, fetchValidationRules, hasLocalCustomizations, writeDataDictionaryReports, } from '../../../common/utils/dataDictionaryUtils.js';
|
|
10
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
11
|
+
const messages = Messages.loadMessages("sfdx-hardis", "org");
|
|
12
|
+
export default class HardisDocDataDictionary extends SfCommand {
|
|
13
|
+
static description = `
|
|
14
|
+
## Command Behavior
|
|
15
|
+
|
|
16
|
+
**Generates an Excel (.xlsx) data dictionary for one or more Salesforce objects, read live from the target org.**
|
|
17
|
+
|
|
18
|
+
This command describes the selected objects and exports their definitions into a single multi-sheet workbook, useful for documentation, audits, and onboarding.
|
|
19
|
+
|
|
20
|
+
The \`Index\` sheet lists every documented object with its field, validation rule and record type counts, and links to each object sheet.
|
|
21
|
+
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
Each object sheet details its fields (type, required, unique, reference target, picklist values, and more).
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+
|
|
28
|
+
- **Target Org:** Use \`--target-org\` to pick the org connection context.
|
|
29
|
+
- **Object selection:** Provide one or more API names via \`--objects\` (comma-separated, e.g. \`Account,Contact,MyObject__c\`). If omitted in interactive mode, a prompt lists available objects.
|
|
30
|
+
- **Customized objects only:** Use \`--customizedonly\` to exclude objects that have no local customizations. This drops standard objects without custom fields and managed package objects without local custom fields, while keeping local custom objects and any object that has at least one local custom field. In interactive mode, a prompt offers the same filter.
|
|
31
|
+
- **Workbook structure:** One \`Index\` sheet listing the objects, one fields sheet per object, plus consolidated \`Validation Rules\` and \`Record Types\` sheets.
|
|
32
|
+
- **Navigation:** The \`Index\` sheet links to each object, Validation Rules and Record Types sheet, and every other sheet has a "Back to Index" link below its data.
|
|
33
|
+
- **Fields detail:** API name, label, type, required, unique, external id, length/precision, reference target, picklist values, default value, formula, help text, description, and custom flag. Fields are sorted alphabetically by API name.
|
|
34
|
+
- **Output:** The XLSX is generated alongside the intermediate CSV files in the report directory. Use \`--outputfile\` to force the consolidated report path.
|
|
35
|
+
|
|
36
|
+
<details markdown="1">
|
|
37
|
+
<summary>Technical explanations</summary>
|
|
38
|
+
|
|
39
|
+
- **Fields:** Retrieved with \`connection.describe(objectName)\`, then sorted alphabetically by API name. Field types are mapped to their Salesforce names (e.g. \`reference\` becomes \`Lookup\` or \`MasterDetail\`, \`int\`/\`double\` become \`Number\`), and formula / roll-up summary fields are tagged. Required is derived from \`nillable === false\`; picklist values are the active values, capped at 50 with an overflow note.
|
|
40
|
+
- **Validation Rules:** Retrieved via the Metadata API (\`metadata.list\` then \`metadata.read\` in batches of 10) to include the error condition formula, which is not exposed by describe.
|
|
41
|
+
- **Record Types:** Retrieved with a single SOQL query on \`RecordType\` filtered by \`SobjectType\`.
|
|
42
|
+
- **Reporting:** Each sheet is first written as a CSV, then consolidated into one XLSX via \`createXlsxFromCsvFiles\`, with explicit worksheet names.
|
|
43
|
+
- **Resilience:** Objects that cannot be described, and validation rule / record type retrieval failures, are logged as warnings and skipped without aborting the run.
|
|
44
|
+
</details>
|
|
45
|
+
|
|
46
|
+
### Agent Mode
|
|
47
|
+
|
|
48
|
+
Supports non-interactive execution with \`--agent\`:
|
|
49
|
+
|
|
50
|
+
\`\`\`sh
|
|
51
|
+
sf hardis:doc:data-dictionary --agent --objects Account,Contact
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
In agent mode:
|
|
55
|
+
- The \`--objects\` flag is **required** (no interactive prompt for object selection).
|
|
56
|
+
- No other prompt is displayed; the workbook is generated directly.
|
|
57
|
+
- Pass \`--customizedonly\` to restrict the workbook to objects that have local customizations (the prompt is skipped).
|
|
58
|
+
`;
|
|
59
|
+
static examples = [
|
|
60
|
+
'$ sf hardis:doc:data-dictionary',
|
|
61
|
+
'$ sf hardis:doc:data-dictionary --objects Account,Contact',
|
|
62
|
+
'$ sf hardis:doc:data-dictionary --target-org myOrgAlias --objects CustomObject__c',
|
|
63
|
+
'$ sf hardis:doc:data-dictionary --customizedonly',
|
|
64
|
+
'$ sf hardis:doc:data-dictionary --agent --objects Account,Contact --customizedonly',
|
|
65
|
+
];
|
|
66
|
+
static flags = {
|
|
67
|
+
'target-org': requiredOrgFlagWithDeprecations,
|
|
68
|
+
objects: Flags.string({
|
|
69
|
+
char: 'o',
|
|
70
|
+
description: 'Comma-separated API names of the objects to document (e.g. Account,Contact,CustomObject__c). If omitted, an interactive prompt lists available objects.',
|
|
71
|
+
required: false,
|
|
72
|
+
}),
|
|
73
|
+
outputfile: Flags.string({
|
|
74
|
+
char: 'f',
|
|
75
|
+
description: 'Force the path and name of the consolidated output report file (the XLSX is generated alongside)',
|
|
76
|
+
required: false,
|
|
77
|
+
}),
|
|
78
|
+
customizedonly: Flags.boolean({
|
|
79
|
+
default: false,
|
|
80
|
+
description: 'Exclude objects that have no local customizations (standard objects without custom fields and managed package objects without local custom fields). Local custom objects and objects with at least one local custom field are kept.',
|
|
81
|
+
}),
|
|
82
|
+
agent: Flags.boolean({
|
|
83
|
+
default: false,
|
|
84
|
+
description: 'Run in non-interactive mode for agents and automation',
|
|
85
|
+
}),
|
|
86
|
+
websocket: Flags.string({
|
|
87
|
+
description: messages.getMessage("websocket"),
|
|
88
|
+
}),
|
|
89
|
+
skipauth: Flags.boolean({
|
|
90
|
+
description: "Skip authentication check when a default username is required",
|
|
91
|
+
}),
|
|
92
|
+
};
|
|
93
|
+
async run() {
|
|
94
|
+
const { flags } = await this.parse(HardisDocDataDictionary);
|
|
95
|
+
const conn = flags['target-org'].getConnection();
|
|
96
|
+
const agentMode = flags.agent === true;
|
|
97
|
+
const outputFile = flags.outputfile || null;
|
|
98
|
+
let customizedOnly = flags.customizedonly === true;
|
|
99
|
+
let objectNames = (flags.objects || '')
|
|
100
|
+
.split(',')
|
|
101
|
+
.map((name) => name.trim())
|
|
102
|
+
.filter((name) => name.length > 0);
|
|
103
|
+
if (objectNames.length === 0) {
|
|
104
|
+
if (!isCI && !agentMode) {
|
|
105
|
+
const availableSObjects = await listOrgSObjects(conn);
|
|
106
|
+
const sObjectApiNames = (availableSObjects?.records || [])
|
|
107
|
+
.map((record) => record?.QualifiedApiName)
|
|
108
|
+
.filter((apiName) => typeof apiName === 'string' && apiName.length > 0)
|
|
109
|
+
.filter((apiName) => !apiName.endsWith('__Share') && !apiName.endsWith('__ChangeEvent'))
|
|
110
|
+
.sort();
|
|
111
|
+
const promptObjectsRes = await prompts({
|
|
112
|
+
type: 'multiselect',
|
|
113
|
+
name: 'value',
|
|
114
|
+
message: t('selectTheSobjectsToAnalyze'),
|
|
115
|
+
description: t('excludeObjectsYouDontWantToAnalyze'),
|
|
116
|
+
choices: sObjectApiNames.map((apiName) => ({ title: apiName, value: apiName })),
|
|
117
|
+
});
|
|
118
|
+
objectNames = promptObjectsRes.value || [];
|
|
119
|
+
if (objectNames.length === 0) {
|
|
120
|
+
uxLog("warning", this, c.yellow(t('noObjectsSelectedAborting')));
|
|
121
|
+
return { outputString: 'No objects selected; aborting.', cancelled: true };
|
|
122
|
+
}
|
|
123
|
+
uxLog("log", this, t('sObjectsSelectedForAnalysis', { count: objectNames.length }));
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
const outputString = t('objectsFlagRequiredInAgentMode');
|
|
127
|
+
uxLog("error", this, c.red(outputString));
|
|
128
|
+
return { outputString, cancelled: true };
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
objectNames = Array.from(new Set(objectNames)).sort();
|
|
132
|
+
// Offer the "customized objects only" filter interactively when it was not requested via the flag.
|
|
133
|
+
if (!customizedOnly && !isCI && !agentMode) {
|
|
134
|
+
const customizedPromptRes = await prompts({
|
|
135
|
+
type: 'confirm',
|
|
136
|
+
name: 'value',
|
|
137
|
+
initial: false,
|
|
138
|
+
message: t('excludeUncustomizedObjects'),
|
|
139
|
+
description: t('excludeUncustomizedObjectsDesc'),
|
|
140
|
+
});
|
|
141
|
+
customizedOnly = customizedPromptRes.value === true;
|
|
142
|
+
}
|
|
143
|
+
WebSocketClient.sendProgressStartMessage(t('describingObjects', { count: objectNames.length }));
|
|
144
|
+
const objectDicts = [];
|
|
145
|
+
let counter = 0;
|
|
146
|
+
for (const objectName of objectNames) {
|
|
147
|
+
const dict = await collectObjectDictionary(conn, objectName, this);
|
|
148
|
+
if (dict) {
|
|
149
|
+
objectDicts.push(dict);
|
|
150
|
+
}
|
|
151
|
+
WebSocketClient.sendProgressStepMessage(++counter, objectNames.length);
|
|
152
|
+
}
|
|
153
|
+
WebSocketClient.sendProgressEndMessage(objectNames.length);
|
|
154
|
+
if (objectDicts.length === 0) {
|
|
155
|
+
uxLog("warning", this, c.yellow(t('noObjectsSelectedAborting')));
|
|
156
|
+
return { outputString: 'No objects could be described; aborting.', cancelled: true };
|
|
157
|
+
}
|
|
158
|
+
let dictsToReport = objectDicts;
|
|
159
|
+
if (customizedOnly) {
|
|
160
|
+
dictsToReport = objectDicts.filter((dict) => hasLocalCustomizations(dict));
|
|
161
|
+
const excludedCount = objectDicts.length - dictsToReport.length;
|
|
162
|
+
if (excludedCount > 0) {
|
|
163
|
+
uxLog("log", this, t('excludedUncustomizedObjects', { count: excludedCount }));
|
|
164
|
+
}
|
|
165
|
+
if (dictsToReport.length === 0) {
|
|
166
|
+
uxLog("warning", this, c.yellow(t('noObjectsWithLocalCustomizations')));
|
|
167
|
+
return { outputString: 'No objects with local customizations found; aborting.', cancelled: true };
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const describedObjectNames = dictsToReport.map((dict) => dict.apiName);
|
|
171
|
+
const validationRules = await fetchValidationRules(conn, describedObjectNames, this);
|
|
172
|
+
const recordTypes = await fetchRecordTypes(conn, describedObjectNames, this);
|
|
173
|
+
uxLog("action", this, c.cyan(t('generatingDataDictionaryForObjects', { count: dictsToReport.length })));
|
|
174
|
+
const reportFiles = await writeDataDictionaryReports(this, dictsToReport, validationRules, recordTypes, outputFile);
|
|
175
|
+
uxLog("success", this, c.green(t('dataDictionaryGeneratedForObjects', { count: dictsToReport.length })));
|
|
176
|
+
return {
|
|
177
|
+
outputString: `Data dictionary generated for ${dictsToReport.length} objects.`,
|
|
178
|
+
reportFiles,
|
|
179
|
+
objects: describedObjectNames,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=data-dictionary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-dictionary.js","sourceRoot":"","sources":["../../../../src/commands/hardis/doc/data-dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAEhG,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,CAAC,MAAM,OAAO,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,+BAA+B,CAAC;AAClD,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EAEtB,0BAA0B,GAC3B,MAAM,8CAA8C,CAAC;AAEtD,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,SAAc;IAC1D,MAAM,CAAC,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C7B,CAAC;IAEO,MAAM,CAAC,QAAQ,GAAG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AI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC;gBACxE,OAAO,EAAE,YAAY,EAAE,uDAAuD,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;YACpG,CAAC;QACH,CAAC;QAED,MAAM,oBAAoB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvE,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC;QACrF,MAAM,WAAW,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC;QAE7E,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oCAAoC,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;QACxG,MAAM,WAAW,GAAG,MAAM,0BAA0B,CAAC,IAAI,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEpH,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,mCAAmC,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;QAEzG,OAAO;YACL,YAAY,EAAE,iCAAiC,aAAa,CAAC,MAAM,WAAW;YAC9E,WAAW;YACX,OAAO,EAAE,oBAAoB;SAC9B,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { AnyJson } from '@salesforce/ts-types';
|
|
3
|
+
export default class MdapiRead extends SfCommand<any> {
|
|
4
|
+
static title: string;
|
|
5
|
+
static description: string;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
static flags: any;
|
|
8
|
+
static requiresProject: boolean;
|
|
9
|
+
run(): Promise<AnyJson>;
|
|
10
|
+
private displaySummary;
|
|
11
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { SfCommand, Flags, requiredOrgFlagWithDeprecations } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { SfError } from '@salesforce/core';
|
|
3
|
+
import c from 'chalk';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { isCI, uxLog, uxLogTable } from '../../../common/utils/index.js';
|
|
6
|
+
import { prompts } from '../../../common/utils/prompts.js';
|
|
7
|
+
import { t } from '../../../common/utils/i18n.js';
|
|
8
|
+
import { WebSocketClient } from '../../../common/websocketClient.js';
|
|
9
|
+
import { buildTargetComponentSet, crudReadMetadatas, isOutcomeFailed, splitMetadataEntries, validateChunkSizeOverride, } from '../../../common/metadata-utils/crudMetadataApi.js';
|
|
10
|
+
export default class MdapiRead extends SfCommand {
|
|
11
|
+
static title = 'Read metadata using the CRUD-based Metadata API';
|
|
12
|
+
static description = `
|
|
13
|
+
## Command Behavior
|
|
14
|
+
|
|
15
|
+
**Retrieves metadata from an org using the CRUD-based Metadata API (\`readMetadata\`), writing complete source files.**
|
|
16
|
+
|
|
17
|
+
This is a standalone, manually invoked alternative to the file-based retrieve (\`sf hardis:org:retrieve:sources:metadata\`). It exists for metadata types that file-based retrieve returns **incomplete** when source tracking is not used, most notably \`Profile\` and \`PermissionSet\`: \`readMetadata\` returns the whole component (every object/field permission, Apex-class access, tab visibility), not just the parts tied to other components in the same package.
|
|
18
|
+
|
|
19
|
+
Key functionalities:
|
|
20
|
+
|
|
21
|
+
- **Component selection:** Choose what to read with \`--metadata\` (e.g. \`Profile:Admin\`, or a bare type like \`Profile\` to read every component of that type), \`--manifest\` (a \`package.xml\`), or \`--source-dir\` (refresh the types/names already present in a local folder).
|
|
22
|
+
- **Complete components:** Each component is read whole and written to standard source format, so a \`git diff\` shows exactly what file-based retrieve had been dropping.
|
|
23
|
+
- **Chunking:** Reads are batched to respect the CRUD Metadata API limit (10 components per call, 200 for \`CustomMetadata\` and \`CustomApplication\`).
|
|
24
|
+
- **Supported types are adapter-gated:** Compatibility is decided by the metadata type's @salesforce/source-deploy-retrieve registry adapter (\`strategies.adapter\`). Only pure-XML types round-trip through the CRUD Metadata API; types whose source carries non-XML content (code, binaries, multi-file bundles) are reported as skipped with a warning. The incompatible adapters are \`bundle\` (LWC, Aura), \`matchingContentFile\` (Apex classes/triggers/pages/components, Visualforce), \`mixedContent\` (\`StaticResource\`, \`Document\`), and \`digitalExperience\` (\`DigitalExperienceBundle\`). Retrieve those with file-based retrieve (\`sf project retrieve start\`).
|
|
25
|
+
|
|
26
|
+
The write counterpart is \`sf hardis:mdapi:upsert\`.
|
|
27
|
+
|
|
28
|
+
<details markdown="1">
|
|
29
|
+
<summary>Technical explanations</summary>
|
|
30
|
+
|
|
31
|
+
- **Input resolution:** \`ComponentSetBuilder\` resolves \`--metadata\` / \`--manifest\` / \`--source-dir\`. Bare types and wildcards are expanded against the org via \`listMetadata\`.
|
|
32
|
+
- **Read:** Components are grouped by type, chunked, and read with jsforce \`connection.metadata.read\`.
|
|
33
|
+
- **Conversion:** Read results are serialized to metadata-format XML (\`fast-xml-parser\`), then converted to source format with \`@salesforce/source-deploy-retrieve\`'s public converter, which handles per-type decomposition (e.g. CustomObject into \`fields/\` and \`recordTypes/\`).
|
|
34
|
+
- **Adapter rule:** \`partitionCrudCompatibility\` resolves each type to its SDR adapter via \`RegistryAccess.getTypeByName(name).strategies.adapter\`. Types with adapter \`bundle\`, \`matchingContentFile\`, \`mixedContent\`, or \`digitalExperience\` are set aside as skipped; types with \`decomposed\`, \`default\`, or no adapter (e.g. \`CustomObject\`, \`Profile\`, \`PermissionSet\`, \`Layout\`, \`CustomMetadata\`, \`CustomApplication\`) are processed. Unknown type names are treated as compatible so the API call (not the guard) surfaces the real error.
|
|
35
|
+
- **Limitations:** Folder-based types (Report, Dashboard, EmailTemplate) require explicit \`Folder/Name\` members; bare-type expansion does not enumerate folders yet.
|
|
36
|
+
</details>
|
|
37
|
+
|
|
38
|
+
### Agent Mode
|
|
39
|
+
|
|
40
|
+
Supports non-interactive execution with \`--agent\`:
|
|
41
|
+
|
|
42
|
+
\`\`\`sh
|
|
43
|
+
sf hardis:mdapi:read --metadata Profile,PermissionSet --agent
|
|
44
|
+
\`\`\`
|
|
45
|
+
|
|
46
|
+
In agent mode (and in CI), interactive prompts are skipped. You must pass at least one of \`--metadata\`, \`--manifest\`, or \`--source-dir\`; the command never prompts for what to read.
|
|
47
|
+
`;
|
|
48
|
+
static examples = [
|
|
49
|
+
'$ sf hardis:mdapi:read --metadata Profile',
|
|
50
|
+
'$ sf hardis:mdapi:read --source-dir force-app/main/default/profiles',
|
|
51
|
+
'$ sf hardis:mdapi:read --metadata "Profile:Admin" --metadata PermissionSet',
|
|
52
|
+
'$ sf hardis:mdapi:read --manifest manifest/package.xml',
|
|
53
|
+
'$ sf hardis:mdapi:read --metadata Profile,PermissionSet --agent',
|
|
54
|
+
];
|
|
55
|
+
static flags = {
|
|
56
|
+
metadata: Flags.string({
|
|
57
|
+
char: 'm',
|
|
58
|
+
multiple: true,
|
|
59
|
+
description: 'Metadata to read, as Type or Type:Name (e.g. Profile, "Profile:Admin"). Repeatable.',
|
|
60
|
+
}),
|
|
61
|
+
manifest: Flags.string({
|
|
62
|
+
char: 'x',
|
|
63
|
+
description: 'Path to a package.xml listing the metadata to read',
|
|
64
|
+
}),
|
|
65
|
+
'source-dir': Flags.string({
|
|
66
|
+
multiple: true,
|
|
67
|
+
description: 'Local source path whose components should be re-read from the org',
|
|
68
|
+
}),
|
|
69
|
+
'output-dir': Flags.string({
|
|
70
|
+
description: 'Directory where source files are written. When set, all files are written here instead of being refreshed in place in the project package directories (default: the project default package directory)',
|
|
71
|
+
}),
|
|
72
|
+
/* jscpd:ignore-start */
|
|
73
|
+
'chunk-size': Flags.integer({
|
|
74
|
+
description: 'Components read per API call (max 10, or 200 for CustomMetadata/CustomApplication)',
|
|
75
|
+
}),
|
|
76
|
+
'ignore-errors': Flags.boolean({
|
|
77
|
+
default: false,
|
|
78
|
+
description: 'Report component failures but exit with code 0',
|
|
79
|
+
}),
|
|
80
|
+
agent: Flags.boolean({
|
|
81
|
+
default: false,
|
|
82
|
+
description: 'Run in non-interactive mode for agents and automation',
|
|
83
|
+
}),
|
|
84
|
+
debug: Flags.boolean({
|
|
85
|
+
char: 'd',
|
|
86
|
+
default: false,
|
|
87
|
+
description: 'Activate debug mode (more logs)',
|
|
88
|
+
}),
|
|
89
|
+
websocket: Flags.string({
|
|
90
|
+
description: 'Websocket host:port for VsCode SFDX Hardis UI integration',
|
|
91
|
+
}),
|
|
92
|
+
skipauth: Flags.boolean({
|
|
93
|
+
description: 'Skip authentication check when a default username is required',
|
|
94
|
+
}),
|
|
95
|
+
'target-org': requiredOrgFlagWithDeprecations,
|
|
96
|
+
/* jscpd:ignore-end */
|
|
97
|
+
};
|
|
98
|
+
static requiresProject = true;
|
|
99
|
+
async run() {
|
|
100
|
+
const { flags } = await this.parse(MdapiRead);
|
|
101
|
+
const agentMode = flags.agent === true;
|
|
102
|
+
const debugMode = flags.debug || false;
|
|
103
|
+
const ignoreErrors = flags['ignore-errors'] || false;
|
|
104
|
+
let metadataEntries = splitMetadataEntries(flags.metadata);
|
|
105
|
+
const manifestPath = flags.manifest || undefined;
|
|
106
|
+
const sourceDirs = flags['source-dir'] || undefined;
|
|
107
|
+
// Prompt for metadata when nothing was provided and we can interact.
|
|
108
|
+
if (!metadataEntries.length && !manifestPath && !sourceDirs?.length) {
|
|
109
|
+
if (isCI || agentMode) {
|
|
110
|
+
throw new SfError(t('crudNoInputProvided'));
|
|
111
|
+
}
|
|
112
|
+
const promptResult = await prompts({
|
|
113
|
+
type: 'text',
|
|
114
|
+
name: 'value',
|
|
115
|
+
message: t('crudPromptMetadataToRetrieve'),
|
|
116
|
+
description: t('crudPromptMetadataToRetrieveDesc'),
|
|
117
|
+
placeholder: 'Profile, PermissionSet:Admin',
|
|
118
|
+
});
|
|
119
|
+
metadataEntries = (promptResult.value || '')
|
|
120
|
+
.split(',')
|
|
121
|
+
.map((e) => e.trim())
|
|
122
|
+
.filter(Boolean);
|
|
123
|
+
if (!metadataEntries.length) {
|
|
124
|
+
throw new SfError(t('crudNoInputProvided'));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (flags['chunk-size'] != null) {
|
|
128
|
+
validateChunkSizeOverride(flags['chunk-size']);
|
|
129
|
+
}
|
|
130
|
+
const packageDirs = (this.project?.getPackageDirectories() || []).map((dir) => dir.fullPath);
|
|
131
|
+
const defaultPackageDir = (this.project?.getPackageDirectories() || []).find((dir) => dir.default)?.fullPath ||
|
|
132
|
+
packageDirs[0] ||
|
|
133
|
+
process.cwd();
|
|
134
|
+
const outputDirExplicit = Boolean(flags['output-dir']);
|
|
135
|
+
const outputDir = outputDirExplicit ? path.resolve(flags['output-dir']) : defaultPackageDir;
|
|
136
|
+
const conn = flags['target-org'].getConnection();
|
|
137
|
+
uxLog('action', this, c.cyan(t('crudReadingMetadata')));
|
|
138
|
+
const componentSet = await buildTargetComponentSet({
|
|
139
|
+
metadataEntries,
|
|
140
|
+
manifestPath,
|
|
141
|
+
sourceDirs,
|
|
142
|
+
packageDirs,
|
|
143
|
+
username: flags['target-org'].getUsername(),
|
|
144
|
+
resolveFromOrg: true,
|
|
145
|
+
});
|
|
146
|
+
if (componentSet.size === 0) {
|
|
147
|
+
uxLog('warning', this, c.yellow(t('crudNothingToRetrieve')));
|
|
148
|
+
return { successes: [], failures: [], skipped: [], outputDir };
|
|
149
|
+
}
|
|
150
|
+
const outcome = await crudReadMetadatas({
|
|
151
|
+
conn,
|
|
152
|
+
componentSet,
|
|
153
|
+
outputDir,
|
|
154
|
+
// packageDirs is used only to merge (overwrite in place) with existing source. When the user
|
|
155
|
+
// explicitly sets --output-dir, merge within that directory so every file lands there instead
|
|
156
|
+
// of being written back to wherever it already lives in the project package directories.
|
|
157
|
+
packageDirs: outputDirExplicit ? [outputDir] : packageDirs,
|
|
158
|
+
chunkSizeOverride: flags['chunk-size'],
|
|
159
|
+
commandThis: this,
|
|
160
|
+
debug: debugMode,
|
|
161
|
+
});
|
|
162
|
+
this.displaySummary(outcome.successes, outcome.failures, outcome.skipped, outputDir);
|
|
163
|
+
WebSocketClient.sendRefreshCommandsMessage();
|
|
164
|
+
if (isOutcomeFailed(outcome, ignoreErrors)) {
|
|
165
|
+
throw new SfError(t('crudReadFailedSummary', { count: String(outcome.failures.length) }));
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
successes: outcome.successes,
|
|
169
|
+
failures: outcome.failures,
|
|
170
|
+
skipped: outcome.skipped,
|
|
171
|
+
outputDir,
|
|
172
|
+
orgId: flags['target-org'].getOrgId(),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
displaySummary(successes, failures, skipped, outputDir) {
|
|
176
|
+
if (successes.length > 0) {
|
|
177
|
+
uxLog('success', this, c.green(t('crudReadSuccessCount', { count: String(successes.length), outputDir })));
|
|
178
|
+
uxLogTable(this, successes.map((s) => ({ type: s.type, fullName: s.fullName, status: 'OK' })), ['type', 'fullName', 'status']);
|
|
179
|
+
}
|
|
180
|
+
if (failures.length > 0) {
|
|
181
|
+
uxLog('warning', this, c.yellow(t('crudReadFailureCount', { count: String(failures.length) })));
|
|
182
|
+
uxLogTable(this, failures.map((f) => ({ type: f.type, fullName: f.fullName, error: f.error })), ['type', 'fullName', 'error']);
|
|
183
|
+
}
|
|
184
|
+
if (skipped.length > 0) {
|
|
185
|
+
uxLog('warning', this, c.yellow(t('crudSkippedReadCount', { count: String(skipped.length) })));
|
|
186
|
+
uxLogTable(this, skipped.map((s) => ({ type: s.type, fullName: s.fullName })), ['type', 'fullName']);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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@salesforce/ts-types';
|
|
3
|
+
export default class MdapiUpsert extends SfCommand<any> {
|
|
4
|
+
static title: string;
|
|
5
|
+
static description: string;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
static flags: any;
|
|
8
|
+
static requiresProject: boolean;
|
|
9
|
+
run(): Promise<AnyJson>;
|
|
10
|
+
private displaySummary;
|
|
11
|
+
}
|