Skip to content

Commit dae3a59

Browse files
authored
[skip-validate-pr] fix: rename --template-info flag to --document (#120)
* fix: rename --template-info flag to --document for clarity
1 parent 04db6c5 commit dae3a59

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

command-snapshot.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
"alias": [],
7676
"command": "orchestrator:rules:eval",
7777
"flagAliases": [],
78-
"flagChars": ["o", "r", "t", "v"],
79-
"flags": ["api-version", "flags-dir", "json", "rules", "target-org", "template-info", "variables"],
78+
"flagChars": ["d", "o", "r", "v"],
79+
"flags": ["api-version", "document", "flags-dir", "json", "rules", "target-org", "variables"],
8080
"plugin": "@salesforce/plugin-orchestrator"
8181
},
8282
{

messages/orchestrator.rules.eval.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ Override the api version used for api requests made by this command.
2222

2323
API version to use for the transformation request. Defaults to the org's configured API version.
2424

25-
# flags.template-info.summary
25+
# flags.document.summary
2626

27-
Path to Analytics template-info.json file.
27+
Path to JSON document file to transform.
2828

29-
# flags.template-info.description
29+
# flags.document.description
3030

31-
Path to the template-info.json file containing the base JSON document structure that will be transformed.
31+
Path to the JSON document file (dashboard, lens, etc.) that will be transformed by the rules.
3232

3333
# flags.variables.summary
3434

@@ -48,8 +48,8 @@ Path to the rules.json file containing transformation rules and macro definition
4848

4949
# examples
5050

51-
- Test JSON transformation with Analytics template files:
52-
<%= config.bin %> <%= command.id %> --template-info ./template-info.json --variables ./variables.json --rules ./rules.json --target-org myorg
51+
- Test JSON transformation with Analytics files:
52+
<%= config.bin %> <%= command.id %> --document ./dashboard.json --variables ./variables.json --rules ./rules.json --target-org myorg
5353

5454
- Test with specific API version:
55-
<%= config.bin %> <%= command.id %> --template-info ./template-info.json --variables ./variables.json --rules ./rules.json --target-org myorg --api-version 60.0
55+
<%= config.bin %> <%= command.id %> --document ./dashboard.json --variables ./variables.json --rules ./rules.json --target-org myorg --api-version 60.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/plugin-orchestrator",
33
"description": "Plugin for working with SalesForce analytic apps, templates, assets and services.",
4-
"version": "1.0.21",
4+
"version": "1.0.20",
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {

src/commands/orchestrator/rules/eval.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ export default class TemplateEval extends SfCommand<TemplatePreviewResult> {
8585
summary: messages.getMessage('flags.api-version.summary'),
8686
description: messages.getMessage('flags.api-version.description'),
8787
}),
88-
'template-info': Flags.file({
89-
char: 't',
90-
summary: messages.getMessage('flags.template-info.summary'),
91-
description: messages.getMessage('flags.template-info.description'),
88+
document: Flags.file({
89+
char: 'd',
90+
summary: messages.getMessage('flags.document.summary'),
91+
description: messages.getMessage('flags.document.description'),
9292
required: true,
9393
}),
9494
variables: Flags.file({
@@ -159,26 +159,26 @@ export default class TemplateEval extends SfCommand<TemplatePreviewResult> {
159159
}
160160
}
161161

162-
private async getTemplatePayload(flags: { 'template-info': string; variables: string; rules: string }): Promise<{
162+
private async getTemplatePayload(flags: { document: string; variables: string; rules: string }): Promise<{
163163
template: TemplateInfo;
164164
payload: TransformationPayload;
165165
}> {
166-
return this.getDirectFilePayload(flags['template-info'], flags['variables'], flags['rules']);
166+
return this.getDirectFilePayload(flags.document, flags.variables, flags.rules);
167167
}
168168

169169
private async getDirectFilePayload(
170-
templateInfoFile: string,
170+
documentFile: string,
171171
variablesFile: string,
172172
rulesFile: string
173173
): Promise<{
174174
template: TemplateInfo;
175175
payload: TransformationPayload;
176176
}> {
177-
this.log(`Loading template info: ${templateInfoFile}`);
177+
this.log(`Loading document: ${documentFile}`);
178178

179-
// Read and parse the template-info file
180-
const templateInfoContent = await fs.readFile(templateInfoFile, 'utf8');
181-
const document = JSON.parse(templateInfoContent) as unknown;
179+
// Read and parse the document file
180+
const documentContent = await fs.readFile(documentFile, 'utf8');
181+
const document = JSON.parse(documentContent) as unknown;
182182

183183
// Read variables file
184184
this.log(`Loading variables: ${variablesFile}`);
@@ -193,7 +193,7 @@ export default class TemplateEval extends SfCommand<TemplatePreviewResult> {
193193
return {
194194
template: {
195195
name: 'Direct Files',
196-
path: templateInfoFile,
196+
path: documentFile,
197197
source: 'local' as const,
198198
},
199199
payload: {

0 commit comments

Comments
 (0)