@salesforce/plugin-orchestrator 1.0.23 → 1.0.25
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/orchestrator/rules/eval.d.ts +2 -6
- package/lib/commands/orchestrator/rules/eval.js +10 -11
- package/lib/commands/orchestrator/rules/eval.js.map +1 -1
- package/messages/orchestrator.rules.eval.md +6 -6
- package/npm-shrinkwrap.json +159 -159
- package/oclif.lock +187 -187
- package/oclif.manifest.json +102 -102
- package/package.json +5 -5
|
@@ -14,11 +14,7 @@ type TransformationPayload = {
|
|
|
14
14
|
namespace: string;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
values:
|
|
18
|
-
Variables: {
|
|
19
|
-
hello: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
17
|
+
values: Record<string, unknown>;
|
|
22
18
|
definition: {
|
|
23
19
|
rules: Array<{
|
|
24
20
|
name: string;
|
|
@@ -53,7 +49,7 @@ export default class TemplateEval extends SfCommand<TemplatePreviewResult> {
|
|
|
53
49
|
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
54
50
|
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
55
51
|
document: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
56
|
-
|
|
52
|
+
values: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
57
53
|
rules: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
58
54
|
};
|
|
59
55
|
run(): Promise<TemplatePreviewResult>;
|
|
@@ -38,10 +38,10 @@ export default class TemplateEval extends SfCommand {
|
|
|
38
38
|
description: messages.getMessage('flags.document.description'),
|
|
39
39
|
required: true,
|
|
40
40
|
}),
|
|
41
|
-
|
|
41
|
+
values: Flags.file({
|
|
42
42
|
char: 'v',
|
|
43
|
-
summary: messages.getMessage('flags.
|
|
44
|
-
description: messages.getMessage('flags.
|
|
43
|
+
summary: messages.getMessage('flags.values.summary'),
|
|
44
|
+
description: messages.getMessage('flags.values.description'),
|
|
45
45
|
required: true,
|
|
46
46
|
}),
|
|
47
47
|
rules: Flags.file({
|
|
@@ -94,18 +94,17 @@ export default class TemplateEval extends SfCommand {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
async getTemplatePayload(flags) {
|
|
97
|
-
return this.getDirectFilePayload(flags.document, flags.
|
|
97
|
+
return this.getDirectFilePayload(flags.document, flags.values, flags.rules);
|
|
98
98
|
}
|
|
99
|
-
async getDirectFilePayload(documentFile,
|
|
99
|
+
async getDirectFilePayload(documentFile, valuesFile, rulesFile) {
|
|
100
100
|
this.log(`Loading document: ${documentFile}`);
|
|
101
101
|
// Read and parse the document file
|
|
102
102
|
const documentContent = await fs.readFile(documentFile, 'utf8');
|
|
103
103
|
const document = JSON.parse(documentContent);
|
|
104
|
-
// Read
|
|
105
|
-
this.log(`Loading
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
const values = { Variables: variablesData };
|
|
104
|
+
// Read values file
|
|
105
|
+
this.log(`Loading values: ${valuesFile}`);
|
|
106
|
+
const valuesContent = await fs.readFile(valuesFile, 'utf8');
|
|
107
|
+
const values = JSON.parse(valuesContent);
|
|
109
108
|
// Read rules file
|
|
110
109
|
this.log(`Loading rules: ${rulesFile}`);
|
|
111
110
|
const rulesContent = await fs.readFile(rulesFile, 'utf8');
|
|
@@ -118,7 +117,7 @@ export default class TemplateEval extends SfCommand {
|
|
|
118
117
|
},
|
|
119
118
|
payload: {
|
|
120
119
|
document: document,
|
|
121
|
-
values
|
|
120
|
+
values,
|
|
122
121
|
definition: definition,
|
|
123
122
|
},
|
|
124
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval.js","sourceRoot":"","sources":["../../../../src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,EAAE;gBACP,QAAQ,EAAE,QAA6C;gBACvD,MAAM;gBACN,UAAU,EAAE,UAAiD;aAC9D;SACF,CAAC;IACJ,CAAC"}
|
|
@@ -30,13 +30,13 @@ Path to JSON document file to transform.
|
|
|
30
30
|
|
|
31
31
|
Path to the JSON document file (dashboard, lens, etc.) that will be transformed by the rules.
|
|
32
32
|
|
|
33
|
-
# flags.
|
|
33
|
+
# flags.values.summary
|
|
34
34
|
|
|
35
|
-
Path to
|
|
35
|
+
Path to values JSON file.
|
|
36
36
|
|
|
37
|
-
# flags.
|
|
37
|
+
# flags.values.description
|
|
38
38
|
|
|
39
|
-
Path to the
|
|
39
|
+
Path to the JSON file containing values used in transformations. Can contain any JSON structure that matches your transformation rules.
|
|
40
40
|
|
|
41
41
|
# flags.rules.summary
|
|
42
42
|
|
|
@@ -49,7 +49,7 @@ Path to the rules.json file containing transformation rules and macro definition
|
|
|
49
49
|
# examples
|
|
50
50
|
|
|
51
51
|
- Test JSON transformation with Analytics files:
|
|
52
|
-
<%= config.bin %> <%= command.id %> --document ./dashboard.json --
|
|
52
|
+
<%= config.bin %> <%= command.id %> --document ./dashboard.json --values ./values.json --rules ./rules.json --target-org myorg
|
|
53
53
|
|
|
54
54
|
- Test with specific API version:
|
|
55
|
-
<%= config.bin %> <%= command.id %> --document ./dashboard.json --
|
|
55
|
+
<%= config.bin %> <%= command.id %> --document ./dashboard.json --values ./values.json --rules ./rules.json --target-org myorg --api-version 60.0
|