@salesforce/plugin-orchestrator 1.0.18 → 1.1.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.
@@ -0,0 +1,32 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export type OrchestratorAppUpgradeResult = {
3
+ appId: string;
4
+ };
5
+ export default class OrchestratorAppUpgrade extends SfCommand<OrchestratorAppUpgradeResult> {
6
+ static readonly summary: string;
7
+ static readonly description: string;
8
+ static readonly examples: string[];
9
+ static readonly state = "preview";
10
+ static readonly flags: {
11
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
12
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'app-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ 'app-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ 'template-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
+ 'template-values': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'runtime-method': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ 'log-level': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ 'chain-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ };
21
+ private static validateRequiredFlags;
22
+ private static validateTemplateMatch;
23
+ private static parseTemplateValues;
24
+ private static buildUpdateOptions;
25
+ private static resolveAppById;
26
+ private static handleUpgradeError;
27
+ run(): Promise<OrchestratorAppUpgradeResult>;
28
+ private resolveApp;
29
+ private resolveAppByName;
30
+ private executeUpgrade;
31
+ private displayUpgradedApp;
32
+ }
@@ -0,0 +1,188 @@
1
+ /*
2
+ * Copyright 2025, 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 { SfCommand, Flags } from '@salesforce/sf-plugins-core';
17
+ import { Messages, SfError } from '@salesforce/core';
18
+ import AppFrameworkApp from '../../../utils/app/appframeworkapp.js';
19
+ import { AppListUtil } from '../../../utils/app/appListUtils.js';
20
+ import { AppDisplayUtil } from '../../../utils/app/appDisplayUtil.js';
21
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
22
+ const messages = Messages.loadMessages('@salesforce/plugin-orchestrator', 'orchestrator.app.upgrade');
23
+ export default class OrchestratorAppUpgrade extends SfCommand {
24
+ static summary = messages.getMessage('summary');
25
+ static description = messages.getMessage('description');
26
+ static examples = messages.getMessages('examples');
27
+ static state = 'preview';
28
+ static flags = {
29
+ 'target-org': Flags.requiredOrg({
30
+ summary: messages.getMessage('flags.target-org.summary'),
31
+ description: messages.getMessage('flags.target-org.description'),
32
+ required: true,
33
+ }),
34
+ 'api-version': Flags.orgApiVersion({
35
+ summary: messages.getMessage('flags.api-version.summary'),
36
+ description: messages.getMessage('flags.api-version.description'),
37
+ }),
38
+ 'app-id': Flags.string({
39
+ char: 'i',
40
+ summary: messages.getMessage('flags.app-id.summary'),
41
+ description: messages.getMessage('flags.app-id.description'),
42
+ exclusive: ['app-name'],
43
+ }),
44
+ 'app-name': Flags.string({
45
+ char: 'n',
46
+ summary: messages.getMessage('flags.app-name.summary'),
47
+ description: messages.getMessage('flags.app-name.description'),
48
+ exclusive: ['app-id'],
49
+ }),
50
+ 'template-id': Flags.string({
51
+ char: 't',
52
+ summary: messages.getMessage('flags.template-id.summary'),
53
+ description: messages.getMessage('flags.template-id.description'),
54
+ required: true,
55
+ }),
56
+ 'template-values': Flags.string({
57
+ char: 'v',
58
+ summary: messages.getMessage('flags.template-values.summary'),
59
+ description: messages.getMessage('flags.template-values.description'),
60
+ }),
61
+ 'runtime-method': Flags.string({
62
+ char: 'r',
63
+ summary: messages.getMessage('flags.runtime-method.summary'),
64
+ description: messages.getMessage('flags.runtime-method.description'),
65
+ options: ['sync', 'async'],
66
+ }),
67
+ 'log-level': Flags.string({
68
+ char: 'l',
69
+ summary: messages.getMessage('flags.log-level.summary'),
70
+ description: messages.getMessage('flags.log-level.description'),
71
+ options: ['debug', 'info', 'warn', 'error'],
72
+ }),
73
+ 'chain-name': Flags.string({
74
+ char: 'c',
75
+ summary: messages.getMessage('flags.chain-name.summary'),
76
+ description: messages.getMessage('flags.chain-name.description'),
77
+ }),
78
+ };
79
+ static validateRequiredFlags(flags) {
80
+ if (!flags['app-id'] && !flags['app-name']) {
81
+ throw new SfError(messages.getMessage('noAppSpecified'), 'AppUpgradeError', messages.getMessages('error.UpgradeError.Actions'));
82
+ }
83
+ }
84
+ static validateTemplateMatch(app, templateId) {
85
+ if (app.templateSourceId !== templateId) {
86
+ throw new SfError(`Template ID mismatch. App is using template '${app.templateSourceId ?? 'unknown'}' but you specified '${templateId}'. You cannot change the underlying template during an upgrade.`, 'AppUpgradeError', messages.getMessages('error.UpgradeError.Actions'));
87
+ }
88
+ }
89
+ static parseTemplateValues(templateValuesString) {
90
+ if (!templateValuesString) {
91
+ return undefined;
92
+ }
93
+ try {
94
+ const parsed = JSON.parse(templateValuesString);
95
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
96
+ throw new SfError('Template values must be a valid JSON object, not an array or primitive value.', 'AppUpgradeError', messages.getMessages('error.UpgradeError.Actions'));
97
+ }
98
+ return parsed;
99
+ }
100
+ catch (error) {
101
+ if (error instanceof SfError) {
102
+ throw error;
103
+ }
104
+ throw new SfError(messages.getMessage('invalidTemplateValues'), 'AppUpgradeError', messages.getMessages('error.UpgradeError.Actions'));
105
+ }
106
+ }
107
+ static buildUpdateOptions(flags, templateValues) {
108
+ const updateOptions = {
109
+ templateSourceId: flags['template-id'],
110
+ templateValues,
111
+ runtimeMethod: flags['runtime-method'],
112
+ logLevel: flags['log-level'],
113
+ };
114
+ if (flags['chain-name']) {
115
+ updateOptions.chainName = flags['chain-name'];
116
+ }
117
+ return updateOptions;
118
+ }
119
+ static async resolveAppById(appId, appFrameworkApp) {
120
+ if (!appId) {
121
+ throw new SfError(messages.getMessage('noAppSpecified'), 'AppUpgradeError', messages.getMessages('error.UpgradeError.Actions'));
122
+ }
123
+ const app = await appFrameworkApp.getApp(appId);
124
+ if (!app) {
125
+ throw new SfError(messages.getMessage('noAppFound'), 'AppUpgradeError', messages.getMessages('error.UpgradeError.Actions'));
126
+ }
127
+ return { appId, app };
128
+ }
129
+ static handleUpgradeError(error) {
130
+ if (error instanceof SfError) {
131
+ throw error;
132
+ }
133
+ throw new SfError(messages.getMessage('error.UpgradeError', [error.message]), 'AppUpgradeError', messages.getMessages('error.UpgradeError.Actions'), undefined, error);
134
+ }
135
+ async run() {
136
+ const { flags } = await this.parse(OrchestratorAppUpgrade);
137
+ OrchestratorAppUpgrade.validateRequiredFlags(flags);
138
+ try {
139
+ const connection = flags['target-org'].getConnection(flags['api-version']);
140
+ const appFrameworkApp = new AppFrameworkApp(connection);
141
+ const { appId, app } = await this.resolveApp(flags, appFrameworkApp);
142
+ OrchestratorAppUpgrade.validateTemplateMatch(app, flags['template-id']);
143
+ const templateValues = OrchestratorAppUpgrade.parseTemplateValues(flags['template-values']);
144
+ const updateOptions = OrchestratorAppUpgrade.buildUpdateOptions(flags, templateValues);
145
+ const upgradedAppId = await this.executeUpgrade(appFrameworkApp, appId, updateOptions);
146
+ await this.displayUpgradedApp(appFrameworkApp, upgradedAppId);
147
+ return { appId: upgradedAppId };
148
+ }
149
+ catch (error) {
150
+ this.spinner.stop();
151
+ OrchestratorAppUpgrade.handleUpgradeError(error);
152
+ }
153
+ }
154
+ async resolveApp(flags, appFrameworkApp) {
155
+ if (flags['app-name']) {
156
+ return this.resolveAppByName(flags['app-name'], appFrameworkApp);
157
+ }
158
+ return OrchestratorAppUpgrade.resolveAppById(flags['app-id'], appFrameworkApp);
159
+ }
160
+ async resolveAppByName(appName, appFrameworkApp) {
161
+ this.spinner.start(messages.getMessage('fetchingApp'));
162
+ const apps = await appFrameworkApp.list();
163
+ const foundApp = apps.find((a) => a.name === appName);
164
+ if (!foundApp?.id) {
165
+ this.spinner.stop();
166
+ throw new SfError(messages.getMessage('noAppFound'), 'AppUpgradeError', messages.getMessages('error.UpgradeError.Actions'));
167
+ }
168
+ this.spinner.stop();
169
+ return { appId: foundApp.id, app: foundApp };
170
+ }
171
+ async executeUpgrade(appFrameworkApp, appId, updateOptions) {
172
+ this.spinner.start(messages.getMessage('upgradingApp'));
173
+ const upgradedAppId = await appFrameworkApp.updateApp(appId, updateOptions);
174
+ this.spinner.stop();
175
+ this.log(messages.getMessage('upgradeSuccess', [upgradedAppId]));
176
+ return upgradedAppId;
177
+ }
178
+ async displayUpgradedApp(appFrameworkApp, upgradedAppId) {
179
+ const upgradedApp = await appFrameworkApp.getApp(upgradedAppId);
180
+ if (upgradedApp) {
181
+ const processedApps = AppListUtil.processApps([upgradedApp]);
182
+ if (processedApps.length > 0) {
183
+ AppDisplayUtil.displayAppDetails(this, processedApps[0]);
184
+ }
185
+ }
186
+ }
187
+ }
188
+ //# sourceMappingURL=upgrade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../../../src/commands/orchestrator/app/upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;A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C/C,CAAC;IAEO,KAAK,CAAC,cAAc,CAC1B,eAAgC,EAChC,KAAa,EACb,aAA4B;QAE5B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;QACxD,MAAM,aAAa,GAAG,MAAM,eAAe,CAAC,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QAC5E,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACpB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACjE,OAAO,aAAa,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAC,eAAgC,EAAE,aAAqB;QACtF,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAChE,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,aAAa,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;YAC7D,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC7B,cAAc,CAAC,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;IACH,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ type TransformationPayload = {
3
+ document: {
4
+ user: {
5
+ firstName: string;
6
+ lastName: string;
7
+ userName: string;
8
+ id: string;
9
+ hello: string;
10
+ };
11
+ company: {
12
+ id: string;
13
+ name: string;
14
+ namespace: string;
15
+ };
16
+ };
17
+ values: {
18
+ Variables: {
19
+ hello: string;
20
+ };
21
+ };
22
+ definition: {
23
+ rules: Array<{
24
+ name: string;
25
+ actions: Array<{
26
+ action: string;
27
+ description: string;
28
+ key: string;
29
+ path: string;
30
+ value: string;
31
+ }>;
32
+ }>;
33
+ };
34
+ };
35
+ type TemplateInfo = {
36
+ name: string;
37
+ path: string;
38
+ source: 'static' | 'local';
39
+ };
40
+ export type TemplatePreviewResult = {
41
+ status: 'success' | 'error';
42
+ template?: TemplateInfo;
43
+ input?: TransformationPayload;
44
+ output?: unknown;
45
+ error?: string;
46
+ executionTime?: string;
47
+ };
48
+ export default class TemplateEval extends SfCommand<TemplatePreviewResult> {
49
+ static readonly summary: string;
50
+ static readonly description: string;
51
+ static readonly examples: string[];
52
+ static readonly flags: {
53
+ 'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
54
+ 'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
55
+ 'document-file': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
56
+ 'values-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
57
+ 'definition-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
58
+ };
59
+ run(): Promise<TemplatePreviewResult>;
60
+ private getTemplatePayload;
61
+ private getDirectFilePayload;
62
+ }
63
+ export {};
@@ -0,0 +1,132 @@
1
+ /*
2
+ * Copyright 2025, 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 * as fs from 'node:fs/promises';
17
+ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
18
+ import { Messages } from '@salesforce/core';
19
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
20
+ const messages = Messages.loadMessages('@salesforce/plugin-orchestrator', 'orchestrator.template.eval');
21
+ export default class TemplateEval extends SfCommand {
22
+ static summary = messages.getMessage('summary');
23
+ static description = messages.getMessage('description');
24
+ static examples = messages.getMessages('examples');
25
+ static flags = {
26
+ 'target-org': Flags.requiredOrg({
27
+ summary: messages.getMessage('flags.target-org.summary'),
28
+ description: messages.getMessage('flags.target-org.description'),
29
+ required: true,
30
+ }),
31
+ 'api-version': Flags.orgApiVersion({
32
+ summary: messages.getMessage('flags.api-version.summary'),
33
+ description: messages.getMessage('flags.api-version.description'),
34
+ }),
35
+ 'document-file': Flags.file({
36
+ char: 'd',
37
+ summary: messages.getMessage('flags.document-file.summary'),
38
+ description: messages.getMessage('flags.document-file.description'),
39
+ required: true,
40
+ }),
41
+ 'values-file': Flags.file({
42
+ char: 'v',
43
+ summary: messages.getMessage('flags.values-file.summary'),
44
+ description: messages.getMessage('flags.values-file.description'),
45
+ dependsOn: ['document-file'],
46
+ }),
47
+ 'definition-file': Flags.file({
48
+ char: 'r',
49
+ summary: messages.getMessage('flags.definition-file.summary'),
50
+ description: messages.getMessage('flags.definition-file.description'),
51
+ dependsOn: ['document-file'],
52
+ }),
53
+ };
54
+ async run() {
55
+ const { flags } = await this.parse(TemplateEval);
56
+ try {
57
+ const connection = flags['target-org'].getConnection(flags['api-version']);
58
+ // Determine template source and payload
59
+ const templateResult = await this.getTemplatePayload(flags);
60
+ this.log(`Testing transformation: ${templateResult.template.name}`);
61
+ this.log(`Source: ${templateResult.template.source}`);
62
+ if (templateResult.template.source === 'local') {
63
+ this.log(`Path: ${templateResult.template.path}`);
64
+ }
65
+ const startTime = Date.now();
66
+ // Make request to jsonxform/transformation endpoint
67
+ const apiPath = `/services/data/v${connection.getApiVersion()}/jsonxform/transformation`;
68
+ const result = await connection.request({
69
+ method: 'POST',
70
+ url: apiPath,
71
+ body: JSON.stringify(templateResult.payload),
72
+ headers: {
73
+ 'Content-Type': 'application/json',
74
+ },
75
+ });
76
+ const executionTime = `${Date.now() - startTime}ms`;
77
+ this.log('Transformation completed successfully!');
78
+ this.log('Results:');
79
+ this.log(JSON.stringify(result, null, 2));
80
+ return {
81
+ status: 'success',
82
+ template: templateResult.template,
83
+ input: templateResult.payload,
84
+ output: result,
85
+ executionTime,
86
+ };
87
+ }
88
+ catch (error) {
89
+ this.log(`Transformation failed: ${error.message}`);
90
+ return {
91
+ status: 'error',
92
+ error: error.message,
93
+ };
94
+ }
95
+ }
96
+ async getTemplatePayload(flags) {
97
+ return this.getDirectFilePayload(flags['document-file'], flags['values-file'], flags['definition-file']);
98
+ }
99
+ async getDirectFilePayload(documentFile, valuesFile, definitionFile) {
100
+ this.log(`Loading document: ${documentFile}`);
101
+ // Read and parse the document file
102
+ const documentContent = await fs.readFile(documentFile, 'utf8');
103
+ const document = JSON.parse(documentContent);
104
+ // Read values file if provided, otherwise use empty object
105
+ let values = { Variables: { hello: 'world' } };
106
+ if (valuesFile) {
107
+ this.log(`Loading values: ${valuesFile}`);
108
+ const valuesContent = await fs.readFile(valuesFile, 'utf8');
109
+ values = JSON.parse(valuesContent);
110
+ }
111
+ // Read definition file if provided, otherwise use empty rules
112
+ let definition = { rules: [] };
113
+ if (definitionFile) {
114
+ this.log(`Loading definition: ${definitionFile}`);
115
+ const definitionContent = await fs.readFile(definitionFile, 'utf8');
116
+ definition = JSON.parse(definitionContent);
117
+ }
118
+ return {
119
+ template: {
120
+ name: 'Direct Files',
121
+ path: documentFile,
122
+ source: 'local',
123
+ },
124
+ payload: {
125
+ document: document,
126
+ values: values,
127
+ definition: definition,
128
+ },
129
+ };
130
+ }
131
+ }
132
+ //# sourceMappingURL=eval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eval.js","sourceRoot":"","sources":["../../../../src/commands/orchestrator/template/eval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM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AmC;QACnC,MAAM,eAAe,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAY,CAAC;QAExD,2DAA2D;QAC3D,IAAI,MAAM,GAAG,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;QAC/C,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,GAAG,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAC;YAC1C,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YAC5D,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAkB,CAAC;QACtD,CAAC;QAED,8DAA8D;QAC9D,IAAI,UAAU,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QAC/B,IAAI,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,uBAAuB,cAAc,EAAE,CAAC,CAAC;YAClD,MAAM,iBAAiB,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;YACpE,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAsB,CAAC;QAClE,CAAC;QAED,OAAO;YACL,QAAQ,EAAE;gBACR,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,YAAY;gBAClB,MAAM,EAAE,OAAgB;aACzB;YACD,OAAO,EAAE;gBACP,QAAQ,EAAE,QAA6C;gBACvD,MAAM,EAAE,MAAyC;gBACjD,UAAU,EAAE,UAAiD;aAC9D;SACF,CAAC;IACJ,CAAC"}
@@ -0,0 +1,141 @@
1
+ # summary
2
+
3
+ Upgrade an orchestrated app.
4
+
5
+ # description
6
+
7
+ Upgrade an existing orchestrated app by running its template's upgrade chains. This command allows you to apply template upgrades, reconfigure the app with new template values, and modify runtime settings while staying within the same template.
8
+
9
+ You can identify the app by either its unique ID or its name. App IDs are guaranteed to be unique, while names should be unique within an org.
10
+
11
+ Use this command to run template-defined upgrade workflows that can update app configurations, apply new template versions, or reconfigure template values. This is different from the update command which only changes basic metadata like label and description.
12
+
13
+ You must have Data Cloud and Tableau Next enabled in your org and the AppFrameworkManageApp user permission to modify apps. The template ID must match the app's current template - you cannot change the underlying template an app is based on.
14
+
15
+ # flags.target-org.summary
16
+
17
+ Login username or alias for the target org.
18
+
19
+ # flags.target-org.description
20
+
21
+ The target org to connect to for upgrading the app.
22
+
23
+ # flags.api-version.summary
24
+
25
+ Override the API version used for API requests.
26
+
27
+ # flags.api-version.description
28
+
29
+ Override the API version used for orchestrator API requests. Use this flag to specify a particular API version when the default version doesn't work with your org's configuration.
30
+
31
+ # flags.app-id.summary
32
+
33
+ ID of the app to upgrade.
34
+
35
+ # flags.app-id.description
36
+
37
+ The unique identifier of the app to upgrade.
38
+
39
+ # flags.app-name.summary
40
+
41
+ Name of the app to upgrade.
42
+
43
+ # flags.app-name.description
44
+
45
+ The name of the app to upgrade.
46
+
47
+ # flags.template-id.summary
48
+
49
+ ID of the template to use for the upgrade.
50
+
51
+ # flags.template-id.description
52
+
53
+ The unique identifier of the template to use for upgrading the app. This must match the app's current template ID. Template upgrades run the template's defined upgrade chains to reconfigure or update the app. Use "sf orchestrator template list" to find available template IDs.
54
+
55
+ # flags.template-values.summary
56
+
57
+ Template-specific configuration values as JSON.
58
+
59
+ # flags.template-values.description
60
+
61
+ A JSON object containing template-specific configuration values to pass to the upgrade chain. The available values depend on the template's variable definitions. For example: '{"dataSource":"mySource","refreshInterval":30}'. These values customize how the template upgrade chain configures the app.
62
+
63
+ # flags.runtime-method.summary
64
+
65
+ Runtime method for the upgrade execution.
66
+
67
+ # flags.runtime-method.description
68
+
69
+ Specifies how the upgrade chain should be executed. Use 'sync' for synchronous execution (wait for completion) or 'async' for asynchronous execution (run in background). This affects how long the command takes to complete and how errors are handled.
70
+
71
+ # flags.log-level.summary
72
+
73
+ Log level for the upgrade execution.
74
+
75
+ # flags.log-level.description
76
+
77
+ Sets the logging level for the upgrade chain execution. Higher levels provide more diagnostic information: 'debug' (most verbose), 'info' (normal), 'warn' (warnings only), or 'error' (errors only). Use 'debug' when troubleshooting upgrade issues.
78
+
79
+ # flags.chain-name.summary
80
+
81
+ Specific chain name to execute for the upgrade.
82
+
83
+ # flags.chain-name.description
84
+
85
+ The name of the specific upgrade chain to execute. If not specified, the template's default upgrade chain will be used. Different chains may perform different types of upgrades or configurations within the same template.
86
+
87
+ # noAppSpecified
88
+
89
+ No app specified for upgrade. You must specify either an app ID with --app-id or an app name with --app-name.
90
+
91
+ # noAppFound
92
+
93
+ No app found with the specified ID or name.
94
+
95
+ # invalidTemplateValues
96
+
97
+ Invalid template values JSON. Please provide a valid JSON object for --template-values.
98
+
99
+ # fetchingApp
100
+
101
+ Fetching app details...
102
+
103
+ # upgradingApp
104
+
105
+ Upgrading app...
106
+
107
+ # upgradeSuccess
108
+
109
+ Successfully upgraded app: %s
110
+
111
+ # error.UpgradeError
112
+
113
+ Failed to upgrade app: %s
114
+
115
+ # error.UpgradeError.Actions
116
+
117
+ - Verify that you have permission to modify apps in the target org
118
+ - Check that the app exists and is accessible
119
+ - Ensure the template ID matches the app's current template
120
+ - Verify the template values are valid JSON and match expected variables
121
+ - Check that Data Cloud and Tableau Next are enabled in your org
122
+ - Try using a different API version with --api-version
123
+ - Verify your authentication and org connection are valid
124
+
125
+ # examples
126
+
127
+ - Upgrade an app with its current template:
128
+
129
+ <%= config.bin %> <%= command.id %> --target-org myOrg --app-id 1zAxx000000000123 --template-id 1zDxx000000001EAA
130
+
131
+ - Upgrade an app with new template values:
132
+
133
+ <%= config.bin %> <%= command.id %> --target-org myOrg --app-name "My App" --template-id 1zDxx000000001EAA --template-values '{"dataSource":"newSource","refreshInterval":60}'
134
+
135
+ - Upgrade an app with async execution:
136
+
137
+ <%= config.bin %> <%= command.id %> --target-org myOrg --app-id 1zAxx000000000123 --template-id 1zDxx000000001EAA --runtime-method async --log-level debug
138
+
139
+ - Upgrade an app using a specific chain:
140
+
141
+ <%= config.bin %> <%= command.id %> --target-org myOrg --app-id 1zAxx000000000123 --template-id 1zDxx000000001EAA --chain-name "UpdateConfiguration"
@@ -0,0 +1,58 @@
1
+ # summary
2
+
3
+ Test JSON transformation rules using the jsonxform/transformation endpoint.
4
+
5
+ # description
6
+
7
+ Preview how transformation rules will modify JSON documents before deploying templates. This command uses a sample transformation to test the jsonxform/transformation endpoint with built-in User and Org context variables.
8
+
9
+ # flags.target-org.summary
10
+
11
+ Username or alias for the target org; overrides default target org.
12
+
13
+ # flags.target-org.description
14
+
15
+ The username or alias of the target org where the jsonxform/transformation endpoint will be called. This org provides the User and Org context variables used in the transformation.
16
+
17
+ # flags.api-version.summary
18
+
19
+ Override the api version used for api requests made by this command.
20
+
21
+ # flags.api-version.description
22
+
23
+ API version to use for the transformation request. Defaults to the org's configured API version.
24
+
25
+ # flags.document-file.summary
26
+
27
+ Path to JSON document file to transform.
28
+
29
+ # flags.document-file.description
30
+
31
+ Path to the JSON document file that will be transformed by the rules.
32
+
33
+ # flags.values-file.summary
34
+
35
+ Path to JSON values file for variables.
36
+
37
+ # flags.values-file.description
38
+
39
+ Path to JSON file containing variables used in transformations.
40
+
41
+ # flags.definition-file.summary
42
+
43
+ Path to JSON rules definition file.
44
+
45
+ # flags.definition-file.description
46
+
47
+ Path to JSON file containing transformation rules and definitions.
48
+
49
+ # examples
50
+
51
+ - Test JSON transformation with document file only:
52
+ <%= config.bin %> <%= command.id %> --document-file ./document.json --target-org myorg
53
+
54
+ - Test with document, values, and rules files:
55
+ <%= config.bin %> <%= command.id %> --document-file ./document.json --values-file ./values.json --definition-file ./rules.json --target-org myorg
56
+
57
+ - Test with specific API version:
58
+ <%= config.bin %> <%= command.id %> --document-file ./document.json --target-org myorg --api-version 60.0