@salesforce/plugin-orchestrator 1.0.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/LICENSE +28 -0
- package/LICENSE.txt +12 -0
- package/README.md +145 -0
- package/lib/commands/orchestrator/create/app.d.ts +19 -0
- package/lib/commands/orchestrator/create/app.js +144 -0
- package/lib/commands/orchestrator/create/app.js.map +1 -0
- package/lib/commands/orchestrator/create/template.d.ts +17 -0
- package/lib/commands/orchestrator/create/template.js +96 -0
- package/lib/commands/orchestrator/create/template.js.map +1 -0
- package/lib/commands/orchestrator/decouple/app.d.ts +14 -0
- package/lib/commands/orchestrator/decouple/app.js +106 -0
- package/lib/commands/orchestrator/decouple/app.js.map +1 -0
- package/lib/commands/orchestrator/delete/app.d.ts +15 -0
- package/lib/commands/orchestrator/delete/app.js +102 -0
- package/lib/commands/orchestrator/delete/app.js.map +1 -0
- package/lib/commands/orchestrator/delete/template.d.ts +15 -0
- package/lib/commands/orchestrator/delete/template.js +108 -0
- package/lib/commands/orchestrator/delete/template.js.map +1 -0
- package/lib/commands/orchestrator/display/app.d.ts +15 -0
- package/lib/commands/orchestrator/display/app.js +85 -0
- package/lib/commands/orchestrator/display/app.js.map +1 -0
- package/lib/commands/orchestrator/display/template.d.ts +15 -0
- package/lib/commands/orchestrator/display/template.js +105 -0
- package/lib/commands/orchestrator/display/template.js.map +1 -0
- package/lib/commands/orchestrator/list/app.d.ts +13 -0
- package/lib/commands/orchestrator/list/app.js +62 -0
- package/lib/commands/orchestrator/list/app.js.map +1 -0
- package/lib/commands/orchestrator/list/template.d.ts +14 -0
- package/lib/commands/orchestrator/list/template.js +64 -0
- package/lib/commands/orchestrator/list/template.js.map +1 -0
- package/lib/commands/orchestrator/template/create.d.ts +17 -0
- package/lib/commands/orchestrator/template/create.js +96 -0
- package/lib/commands/orchestrator/template/create.js.map +1 -0
- package/lib/commands/orchestrator/template/delete.d.ts +15 -0
- package/lib/commands/orchestrator/template/delete.js +108 -0
- package/lib/commands/orchestrator/template/delete.js.map +1 -0
- package/lib/commands/orchestrator/template/display.d.ts +15 -0
- package/lib/commands/orchestrator/template/display.js +105 -0
- package/lib/commands/orchestrator/template/display.js.map +1 -0
- package/lib/commands/orchestrator/template/list.d.ts +13 -0
- package/lib/commands/orchestrator/template/list.js +62 -0
- package/lib/commands/orchestrator/template/list.js.map +1 -0
- package/lib/commands/orchestrator/template/update.d.ts +17 -0
- package/lib/commands/orchestrator/template/update.js +107 -0
- package/lib/commands/orchestrator/template/update.js.map +1 -0
- package/lib/commands/orchestrator/update/app.d.ts +20 -0
- package/lib/commands/orchestrator/update/app.js +145 -0
- package/lib/commands/orchestrator/update/app.js.map +1 -0
- package/lib/commands/orchestrator/update/template.d.ts +17 -0
- package/lib/commands/orchestrator/update/template.js +107 -0
- package/lib/commands/orchestrator/update/template.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/app/appDisplayUtil.d.ts +26 -0
- package/lib/utils/app/appDisplayUtil.js +153 -0
- package/lib/utils/app/appDisplayUtil.js.map +1 -0
- package/lib/utils/app/appListUtils.d.ts +34 -0
- package/lib/utils/app/appListUtils.js +81 -0
- package/lib/utils/app/appListUtils.js.map +1 -0
- package/lib/utils/app/appTypes.d.ts +44 -0
- package/lib/utils/app/appTypes.js +8 -0
- package/lib/utils/app/appTypes.js.map +1 -0
- package/lib/utils/app/appframeworkapp.d.ts +64 -0
- package/lib/utils/app/appframeworkapp.js +175 -0
- package/lib/utils/app/appframeworkapp.js.map +1 -0
- package/lib/utils/display/displayUtil.d.ts +27 -0
- package/lib/utils/display/displayUtil.js +80 -0
- package/lib/utils/display/displayUtil.js.map +1 -0
- package/lib/utils/request.d.ts +15 -0
- package/lib/utils/request.js +18 -0
- package/lib/utils/request.js.map +1 -0
- package/lib/utils/template/appframeworktemplate.d.ts +67 -0
- package/lib/utils/template/appframeworktemplate.js +114 -0
- package/lib/utils/template/appframeworktemplate.js.map +1 -0
- package/lib/utils/template/templateDisplayUtil.d.ts +42 -0
- package/lib/utils/template/templateDisplayUtil.js +142 -0
- package/lib/utils/template/templateDisplayUtil.js.map +1 -0
- package/lib/utils/template/templateHighlighter.d.ts +23 -0
- package/lib/utils/template/templateHighlighter.js +68 -0
- package/lib/utils/template/templateHighlighter.js.map +1 -0
- package/lib/utils/template/templateListUtils.d.ts +40 -0
- package/lib/utils/template/templateListUtils.js +126 -0
- package/lib/utils/template/templateListUtils.js.map +1 -0
- package/lib/utils/template/templateTypes.d.ts +114 -0
- package/lib/utils/template/templateTypes.js +15 -0
- package/lib/utils/template/templateTypes.js.map +1 -0
- package/lib/utils/utils.d.ts +21 -0
- package/lib/utils/utils.js +49 -0
- package/lib/utils/utils.js.map +1 -0
- package/messages/appframework.create.app.md +124 -0
- package/messages/appframework.create.template.md +82 -0
- package/messages/appframework.decouple.app.md +82 -0
- package/messages/appframework.delete.app.md +94 -0
- package/messages/appframework.delete.template.md +162 -0
- package/messages/appframework.display.app.md +70 -0
- package/messages/appframework.display.template.md +101 -0
- package/messages/appframework.list.app.md +126 -0
- package/messages/appframework.list.template.md +78 -0
- package/messages/appframework.template.create.md +82 -0
- package/messages/appframework.template.delete.md +162 -0
- package/messages/appframework.template.display.md +101 -0
- package/messages/appframework.template.list.md +78 -0
- package/messages/appframework.template.update.md +78 -0
- package/messages/appframework.update.app.md +142 -0
- package/messages/appframework.update.template.md +78 -0
- package/npm-shrinkwrap.json +14309 -0
- package/oclif.lock +7751 -0
- package/oclif.manifest.json +1731 -0
- package/package.json +226 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
8
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
9
|
+
import AppFrameworkTemplate from '../../../utils/template/appframeworktemplate.js';
|
|
10
|
+
import { TemplateListUtil } from '../../../utils/template/templateListUtils.js';
|
|
11
|
+
import { TemplateDisplayUtil } from '../../../utils/template/templateDisplayUtil.js';
|
|
12
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
13
|
+
const messages = Messages.loadMessages('@salesforce/plugin-orchestrator', 'appframework.list.template');
|
|
14
|
+
export default class ListTemplate extends SfCommand {
|
|
15
|
+
static summary = messages.getMessage('summary');
|
|
16
|
+
static description = messages.getMessage('description');
|
|
17
|
+
static examples = messages.getMessages('examples');
|
|
18
|
+
static state = 'preview';
|
|
19
|
+
// Add alias for backward compatibility
|
|
20
|
+
static aliases = ['orchestrator template list'];
|
|
21
|
+
static flags = {
|
|
22
|
+
'target-org': Flags.requiredOrg({
|
|
23
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
24
|
+
description: messages.getMessage('flags.target-org.description'),
|
|
25
|
+
required: true,
|
|
26
|
+
}),
|
|
27
|
+
'api-version': Flags.orgApiVersion({
|
|
28
|
+
summary: messages.getMessage('flags.api-version.summary'),
|
|
29
|
+
description: messages.getMessage('flags.api-version.description'),
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
const { flags } = await this.parse(ListTemplate);
|
|
34
|
+
try {
|
|
35
|
+
this.spinner.start(messages.getMessage('fetchingTemplates'));
|
|
36
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
37
|
+
const appFrameworkTemplate = new AppFrameworkTemplate(connection);
|
|
38
|
+
const rawTemplates = await appFrameworkTemplate.list();
|
|
39
|
+
this.spinner.stop();
|
|
40
|
+
const templates = TemplateListUtil.processTemplates(rawTemplates);
|
|
41
|
+
if (templates.length > 0) {
|
|
42
|
+
TemplateDisplayUtil.displayTemplateList(this, templates);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.log(messages.getMessage('noResultsFound'));
|
|
46
|
+
}
|
|
47
|
+
return templates;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
this.spinner.stop();
|
|
51
|
+
const errorMsg = error.message;
|
|
52
|
+
if (errorMsg.includes('certificate') || errorMsg.includes('altnames')) {
|
|
53
|
+
throw new SfError(messages.getMessage('error.CertificateError'), 'TemplateListError', messages.getMessages('error.CertificateError.Actions'));
|
|
54
|
+
}
|
|
55
|
+
else if (errorMsg.includes('Unauthorized') || errorMsg.includes('401')) {
|
|
56
|
+
throw new SfError(messages.getMessage('error.AuthenticationError'), 'TemplateListError', messages.getMessages('error.AuthenticationError.Actions'));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
throw new SfError(messages.getMessage('error.GenericError', [errorMsg]), 'TemplateListError', messages.getMessages('error.GenericError.Actions'));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/commands/orchestrator/list/template.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAC;AAEjE,OAAO,oBAAoB,MAAM,iDAAiD,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAErF,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,iCAAiC,EAAE,4BAA4B,CAAC,CAAC;AAExG,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AC;YACJ,CAAC;QACH,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export default class Create extends SfCommand<string> {
|
|
3
|
+
static readonly summary: string;
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly state = "preview";
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
type: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
subtype: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
label: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<string>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
8
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
9
|
+
import AppFrameworkTemplate from '../../../utils/template/appframeworktemplate.js';
|
|
10
|
+
import { TemplateDisplayUtil } from '../../../utils/template/templateDisplayUtil.js';
|
|
11
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
12
|
+
const messages = Messages.loadMessages('@salesforce/plugin-orchestrator', 'appframework.template.create');
|
|
13
|
+
export default class Create extends SfCommand {
|
|
14
|
+
static summary = messages.getMessage('summary');
|
|
15
|
+
static description = messages.getMessage('description');
|
|
16
|
+
static examples = messages.getMessages('examples');
|
|
17
|
+
static state = 'preview';
|
|
18
|
+
static flags = {
|
|
19
|
+
'target-org': Flags.requiredOrg({
|
|
20
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
21
|
+
description: messages.getMessage('flags.target-org.description'),
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
'api-version': Flags.orgApiVersion({
|
|
25
|
+
summary: messages.getMessage('flags.api-version.summary'),
|
|
26
|
+
description: messages.getMessage('flags.api-version.description'),
|
|
27
|
+
}),
|
|
28
|
+
name: Flags.string({
|
|
29
|
+
char: 'n',
|
|
30
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
31
|
+
description: messages.getMessage('flags.name.description'),
|
|
32
|
+
required: true,
|
|
33
|
+
}),
|
|
34
|
+
type: Flags.string({
|
|
35
|
+
char: 't',
|
|
36
|
+
summary: messages.getMessage('flags.type.summary'),
|
|
37
|
+
description: messages.getMessage('flags.type.description'),
|
|
38
|
+
default: 'app',
|
|
39
|
+
options: ['app', 'component', 'dashboard', 'lens'],
|
|
40
|
+
}),
|
|
41
|
+
subtype: Flags.string({
|
|
42
|
+
char: 's',
|
|
43
|
+
summary: messages.getMessage('flags.subtype.summary'),
|
|
44
|
+
description: messages.getMessage('flags.subtype.description'),
|
|
45
|
+
}),
|
|
46
|
+
label: Flags.string({
|
|
47
|
+
char: 'l',
|
|
48
|
+
summary: messages.getMessage('flags.label.summary'),
|
|
49
|
+
description: messages.getMessage('flags.label.description'),
|
|
50
|
+
}),
|
|
51
|
+
description: Flags.string({
|
|
52
|
+
char: 'd',
|
|
53
|
+
summary: messages.getMessage('flags.description.summary'),
|
|
54
|
+
description: messages.getMessage('flags.description.description'),
|
|
55
|
+
}),
|
|
56
|
+
};
|
|
57
|
+
async run() {
|
|
58
|
+
const { flags } = await this.parse(Create);
|
|
59
|
+
this.spinner.start(messages.getMessage('creatingTemplate'));
|
|
60
|
+
try {
|
|
61
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
62
|
+
const appFrameworkTemplate = new AppFrameworkTemplate(connection);
|
|
63
|
+
const templateId = await appFrameworkTemplate.create({
|
|
64
|
+
name: flags.name,
|
|
65
|
+
templateType: flags.type,
|
|
66
|
+
templateSubtype: flags.subtype,
|
|
67
|
+
label: flags.label,
|
|
68
|
+
description: flags.description,
|
|
69
|
+
});
|
|
70
|
+
this.spinner.stop();
|
|
71
|
+
this.log(messages.getMessage('createSuccess', [templateId]));
|
|
72
|
+
try {
|
|
73
|
+
const template = await appFrameworkTemplate.getTemplate(templateId);
|
|
74
|
+
if (template) {
|
|
75
|
+
const displayTemplate = {
|
|
76
|
+
...template,
|
|
77
|
+
};
|
|
78
|
+
TemplateDisplayUtil.displayTemplateDetail(this, displayTemplate);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
this.debug(`Error fetching template details: ${error.message}`);
|
|
83
|
+
}
|
|
84
|
+
return templateId;
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
this.spinner.stop();
|
|
88
|
+
throw new SfError(`Error creating AppFramework template: ${error.message}`, 'TemplateCreationError', [
|
|
89
|
+
'Verify that you have permission to create templates',
|
|
90
|
+
'Ensure you are connected to the correct org',
|
|
91
|
+
'Check your API version compatibility',
|
|
92
|
+
]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/orchestrator/template/create.ts"],"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CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export default class Delete extends SfCommand<void> {
|
|
3
|
+
static readonly summary: string;
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly state = "preview";
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'template-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'template-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'no-prompt': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
8
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
9
|
+
import AppFrameworkTemplate from '../../../utils/template/appframeworktemplate.js';
|
|
10
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
11
|
+
const messages = Messages.loadMessages('@salesforce/plugin-orchestrator', 'appframework.template.delete');
|
|
12
|
+
export default class Delete extends SfCommand {
|
|
13
|
+
static summary = messages.getMessage('summary');
|
|
14
|
+
static description = messages.getMessage('description');
|
|
15
|
+
static examples = messages.getMessages('examples');
|
|
16
|
+
static state = 'preview';
|
|
17
|
+
static flags = {
|
|
18
|
+
'target-org': Flags.requiredOrg({
|
|
19
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
20
|
+
description: messages.getMessage('flags.target-org.description'),
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
'api-version': Flags.orgApiVersion({
|
|
24
|
+
summary: messages.getMessage('flags.api-version.summary'),
|
|
25
|
+
description: messages.getMessage('flags.api-version.description'),
|
|
26
|
+
}),
|
|
27
|
+
'template-id': Flags.string({
|
|
28
|
+
char: 'i',
|
|
29
|
+
summary: messages.getMessage('flags.template-id.summary'),
|
|
30
|
+
description: messages.getMessage('flags.template-id.description'),
|
|
31
|
+
exclusive: ['template-name'],
|
|
32
|
+
}),
|
|
33
|
+
'template-name': Flags.string({
|
|
34
|
+
char: 'n',
|
|
35
|
+
summary: messages.getMessage('flags.template-name.summary'),
|
|
36
|
+
description: messages.getMessage('flags.template-name.description'),
|
|
37
|
+
exclusive: ['template-id'],
|
|
38
|
+
}),
|
|
39
|
+
'no-prompt': Flags.boolean({
|
|
40
|
+
char: 'p',
|
|
41
|
+
summary: messages.getMessage('flags.no-prompt.summary'),
|
|
42
|
+
description: messages.getMessage('flags.no-prompt.description'),
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
// we'll add this after template app delete is in place
|
|
46
|
+
// 'force-delete': Flags.boolean({
|
|
47
|
+
// char: 'f',
|
|
48
|
+
// summary: messages.getMessage('flags.force-delete.summary'),
|
|
49
|
+
// description: messages.getMessage('flags.force-delete.description'),
|
|
50
|
+
// }),
|
|
51
|
+
async run() {
|
|
52
|
+
const { flags } = await this.parse(Delete);
|
|
53
|
+
if (!flags['template-id'] && !flags['template-name']) {
|
|
54
|
+
throw new SfError(messages.getMessage('error.MissingRequiredFlag'), 'MissingRequiredFlag', messages.getMessages('error.MissingRequiredFlag.Actions'));
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
58
|
+
const appFrameworkTemplate = new AppFrameworkTemplate(connection);
|
|
59
|
+
const identifier = flags['template-id'] ?? flags['template-name'] ?? '';
|
|
60
|
+
this.spinner.start(messages.getMessage('fetchingTemplate'));
|
|
61
|
+
const template = await appFrameworkTemplate.getTemplate(String(identifier));
|
|
62
|
+
this.spinner.stop();
|
|
63
|
+
if (!template) {
|
|
64
|
+
throw new SfError(messages.getMessage('error.TemplateNotFound', [String(identifier)]), 'TemplateNotFound', messages.getMessages('error.TemplateNotFound.Actions'));
|
|
65
|
+
}
|
|
66
|
+
let shouldDelete = flags['no-prompt'];
|
|
67
|
+
if (!shouldDelete) {
|
|
68
|
+
shouldDelete = await this.confirm({
|
|
69
|
+
message: 'confirmDeleteYesNo',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (!shouldDelete) {
|
|
73
|
+
this.log(messages.getMessage('deletionCancelled'));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// if (flags['force-delete']) {
|
|
77
|
+
// this.spinner.start(messages.getMessage('deletingApps'));
|
|
78
|
+
// // TODO: This is a placeholder. In a full implementation, we would:
|
|
79
|
+
// // 1. Find all apps created from this template
|
|
80
|
+
// // 2. Delete each app
|
|
81
|
+
// this.spinner.stop();
|
|
82
|
+
// this.log('Force delete of apps is not currently implemented. Only the template will be deleted.');
|
|
83
|
+
// }
|
|
84
|
+
this.spinner.start(messages.getMessage('deletingTemplate'));
|
|
85
|
+
await appFrameworkTemplate.deleteTemplate(template.id);
|
|
86
|
+
this.spinner.stop();
|
|
87
|
+
this.log(messages.getMessage('deleteTemplateSuccess', [template.id]));
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
this.spinner.stop();
|
|
91
|
+
const errorMsg = error.message;
|
|
92
|
+
if (errorMsg.includes('certificate') || errorMsg.includes('altnames')) {
|
|
93
|
+
throw new SfError(messages.getMessage('error.CertificateError'), 'TemplateDeletionError', messages.getMessages('error.CertificateError.Actions'));
|
|
94
|
+
}
|
|
95
|
+
else if (errorMsg.includes('Unauthorized') || errorMsg.includes('401')) {
|
|
96
|
+
throw new SfError(messages.getMessage('error.AuthenticationError'), 'TemplateDeletionError', messages.getMessages('error.AuthenticationError.Actions'));
|
|
97
|
+
}
|
|
98
|
+
else if (errorMsg.includes('Not Found') || errorMsg.includes('404')) {
|
|
99
|
+
const identifier = String(flags['template-id'] ?? flags['template-name'] ?? '');
|
|
100
|
+
throw new SfError(messages.getMessage('error.TemplateNotFound', [identifier]), 'TemplateDeletionError', messages.getMessages('error.TemplateNotFound.Actions'));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
throw new SfError(messages.getMessage('error.GenericError', [errorMsg]), 'TemplateDeletionError', messages.getMessages('error.GenericError.Actions'));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/orchestrator/template/delete.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAC;AAEjE,OAAO,oBAAoB,MAAM,iDAAiD,CAAC;AAEnF,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,iCAAiC,EAAE,8BAA8B,CAAC,CAAC;AAE1G,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAe;IAC1C,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ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;gBACzE,MAAM,IAAI,OAAO,CACf,QAAQ,CAAC,UAAU,CAAC,2BAA2B,CAAC,EAChD,uBAAuB,EACvB,QAAQ,CAAC,WAAW,CAAC,mCAAmC,CAAC,CAC1D,CAAC;YACJ,CAAC;iBAAM,IAAI,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBACtE,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;gBAChF,MAAM,IAAI,OAAO,CACf,QAAQ,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC,UAAU,CAAC,CAAC,EAC3D,uBAAuB,EACvB,QAAQ,CAAC,WAAW,CAAC,gCAAgC,CAAC,CACvD,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,OAAO,CACf,QAAQ,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,CAAC,EACrD,uBAAuB,EACvB,QAAQ,CAAC,WAAW,CAAC,4BAA4B,CAAC,CACnD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { TemplateData } from '../../../utils/template/templateTypes.js';
|
|
3
|
+
export default class Display extends SfCommand<TemplateData> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly state = "preview";
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'template-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'template-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<TemplateData>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
8
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
9
|
+
import AppFrameworkTemplate from '../../../utils/template/appframeworktemplate.js';
|
|
10
|
+
import { TemplateDisplayUtil } from '../../../utils/template/templateDisplayUtil.js';
|
|
11
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
12
|
+
const messages = Messages.loadMessages('@salesforce/plugin-orchestrator', 'appframework.template.display');
|
|
13
|
+
export default class Display extends SfCommand {
|
|
14
|
+
static summary = messages.getMessage('summary');
|
|
15
|
+
static description = messages.getMessage('description');
|
|
16
|
+
static examples = messages.getMessages('examples');
|
|
17
|
+
static state = 'preview';
|
|
18
|
+
static flags = {
|
|
19
|
+
'target-org': Flags.requiredOrg({
|
|
20
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
21
|
+
description: messages.getMessage('flags.target-org.description'),
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
'api-version': Flags.orgApiVersion({
|
|
25
|
+
summary: messages.getMessage('flags.api-version.summary'),
|
|
26
|
+
description: messages.getMessage('flags.api-version.description'),
|
|
27
|
+
}),
|
|
28
|
+
'template-id': Flags.string({
|
|
29
|
+
char: 'i',
|
|
30
|
+
summary: messages.getMessage('flags.template-id.summary'),
|
|
31
|
+
description: messages.getMessage('flags.template-id.description'),
|
|
32
|
+
exclusive: ['template-name'],
|
|
33
|
+
}),
|
|
34
|
+
'template-name': Flags.string({
|
|
35
|
+
char: 'n',
|
|
36
|
+
summary: messages.getMessage('flags.template-name.summary'),
|
|
37
|
+
description: messages.getMessage('flags.template-name.description'),
|
|
38
|
+
exclusive: ['template-id'],
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
41
|
+
async run() {
|
|
42
|
+
const { flags } = await this.parse(Display);
|
|
43
|
+
if (!flags['template-id'] && !flags['template-name']) {
|
|
44
|
+
throw new SfError(messages.getMessage('error.MissingRequiredFlag'), 'MissingRequiredFlag', messages.getMessages('error.MissingRequiredFlag.Actions'));
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
this.spinner.start(messages.getMessage('fetchingTemplate'));
|
|
48
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
49
|
+
const appFrameworkTemplate = new AppFrameworkTemplate(connection);
|
|
50
|
+
const identifier = flags['template-id'] ?? flags['template-name'];
|
|
51
|
+
const rawTemplate = await appFrameworkTemplate.getTemplate(identifier);
|
|
52
|
+
if (!rawTemplate) {
|
|
53
|
+
throw new SfError(`Template ${String(identifier)} not found, 'TemplateNotFound'`);
|
|
54
|
+
}
|
|
55
|
+
const template = {
|
|
56
|
+
id: rawTemplate.id,
|
|
57
|
+
name: rawTemplate.name,
|
|
58
|
+
label: rawTemplate.label,
|
|
59
|
+
description: rawTemplate.description,
|
|
60
|
+
templateType: rawTemplate.templateType,
|
|
61
|
+
templateSubtype: rawTemplate.templateSubtype,
|
|
62
|
+
templateId: rawTemplate.templateId,
|
|
63
|
+
folderId: rawTemplate.folderId,
|
|
64
|
+
namespace: rawTemplate.namespace,
|
|
65
|
+
templateVersion: rawTemplate.releaseInfo?.templateVersion,
|
|
66
|
+
assetVersion: rawTemplate.assetVersion,
|
|
67
|
+
maxAppCount: rawTemplate.maxAppCount,
|
|
68
|
+
variableDefinition: rawTemplate.variableDefinition,
|
|
69
|
+
layoutDefinition: rawTemplate.layoutDefinition,
|
|
70
|
+
rules: rawTemplate.rules,
|
|
71
|
+
created: rawTemplate.createdDate ? new Date(rawTemplate.createdDate).toLocaleString() : 'n/a',
|
|
72
|
+
modified: rawTemplate.lastModifiedDate ? new Date(rawTemplate.lastModifiedDate).toLocaleString() : 'n/a',
|
|
73
|
+
industries: rawTemplate.tags?.industries?.join(', ') ?? 'n/a',
|
|
74
|
+
audience: rawTemplate.tags?.targetAudience?.join(', ') ?? 'n/a',
|
|
75
|
+
icons: rawTemplate.icons,
|
|
76
|
+
chainDefinitions: rawTemplate.chainDefinitions,
|
|
77
|
+
applicationSourceId: rawTemplate.applicationSourceId,
|
|
78
|
+
url: rawTemplate.url,
|
|
79
|
+
configurationUrl: rawTemplate.configurationUrl,
|
|
80
|
+
readinessUrl: rawTemplate.readinessUrl,
|
|
81
|
+
};
|
|
82
|
+
this.spinner.stop();
|
|
83
|
+
TemplateDisplayUtil.displayTemplateDetail(this, template);
|
|
84
|
+
return template;
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
this.spinner.stop();
|
|
88
|
+
const errorMsg = error.message;
|
|
89
|
+
if (errorMsg.includes('certificate') || errorMsg.includes('altnames')) {
|
|
90
|
+
throw new SfError(messages.getMessage('error.CertificateError'), 'TemplateDisplayError', messages.getMessages('error.CertificateError.Actions'));
|
|
91
|
+
}
|
|
92
|
+
else if (errorMsg.includes('Unauthorized') || errorMsg.includes('401')) {
|
|
93
|
+
throw new SfError(messages.getMessage('error.AuthenticationError'), 'TemplateDisplayError', messages.getMessages('error.AuthenticationError.Actions'));
|
|
94
|
+
}
|
|
95
|
+
else if (errorMsg.includes('Not Found') || errorMsg.includes('404')) {
|
|
96
|
+
const identifier = String(flags['template-id'] ?? flags['template-name'] ?? '');
|
|
97
|
+
throw new SfError(messages.getMessage('error.TemplateNotFound', [identifier]), 'TemplateDisplayError', messages.getMessages('error.TemplateNotFound.Actions'));
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
throw new SfError(messages.getMessage('error.GenericError', [errorMsg]), 'TemplateDisplayError', messages.getMessages('error.GenericError.Actions'));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../../src/commands/orchestrator/template/display.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAC;AAEjE,OAAO,oBAAoB,MAAM,iDAAiD,CAAC;AAEnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAErF,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,iCAAiC,EAAE,+BAA+B,CAAC,CAAC;AAE3G,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,SAAuB;IACnD,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,KAAK,GAAG,SAAS,CAAC;IAElC,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC;YAC9B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;YACxD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CA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W,CAAC,mCAAmC,CAAC,CAC1D,CAAC;YACJ,CAAC;iBAAM,IAAI,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBACtE,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;gBAChF,MAAM,IAAI,OAAO,CACf,QAAQ,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC,UAAU,CAAC,CAAC,EAC3D,sBAAsB,EACtB,QAAQ,CAAC,WAAW,CAAC,gCAAgC,CAAC,CACvD,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,OAAO,CACf,QAAQ,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,CAAC,EACrD,sBAAsB,EACtB,QAAQ,CAAC,WAAW,CAAC,4BAA4B,CAAC,CACnD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { TemplateData } from '../../../utils/template/templateTypes.js';
|
|
3
|
+
export default class List extends SfCommand<TemplateData[]> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly state = "preview";
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<TemplateData[]>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
8
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
9
|
+
import AppFrameworkTemplate from '../../../utils/template/appframeworktemplate.js';
|
|
10
|
+
import { TemplateListUtil } from '../../../utils/template/templateListUtils.js';
|
|
11
|
+
import { TemplateDisplayUtil } from '../../../utils/template/templateDisplayUtil.js';
|
|
12
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
13
|
+
const messages = Messages.loadMessages('@salesforce/plugin-orchestrator', 'appframework.template.list');
|
|
14
|
+
export default class List extends SfCommand {
|
|
15
|
+
static summary = messages.getMessage('summary');
|
|
16
|
+
static description = messages.getMessage('description');
|
|
17
|
+
static examples = messages.getMessages('examples');
|
|
18
|
+
static state = 'preview';
|
|
19
|
+
static flags = {
|
|
20
|
+
'target-org': Flags.requiredOrg({
|
|
21
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
22
|
+
description: messages.getMessage('flags.target-org.description'),
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
'api-version': Flags.orgApiVersion({
|
|
26
|
+
summary: messages.getMessage('flags.api-version.summary'),
|
|
27
|
+
description: messages.getMessage('flags.api-version.description'),
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
async run() {
|
|
31
|
+
const { flags } = await this.parse(List);
|
|
32
|
+
try {
|
|
33
|
+
this.spinner.start(messages.getMessage('fetchingTemplates'));
|
|
34
|
+
const connection = flags['target-org'].getConnection(flags['api-version']);
|
|
35
|
+
const appFrameworkTemplate = new AppFrameworkTemplate(connection);
|
|
36
|
+
const rawTemplates = await appFrameworkTemplate.list();
|
|
37
|
+
this.spinner.stop();
|
|
38
|
+
const templates = TemplateListUtil.processTemplates(rawTemplates);
|
|
39
|
+
if (templates.length > 0) {
|
|
40
|
+
TemplateDisplayUtil.displayTemplateList(this, templates);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.log(messages.getMessage('noResultsFound'));
|
|
44
|
+
}
|
|
45
|
+
return templates;
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
this.spinner.stop();
|
|
49
|
+
const errorMsg = error.message;
|
|
50
|
+
if (errorMsg.includes('certificate') || errorMsg.includes('altnames')) {
|
|
51
|
+
throw new SfError(messages.getMessage('error.CertificateError'), 'TemplateListError', messages.getMessages('error.CertificateError.Actions'));
|
|
52
|
+
}
|
|
53
|
+
else if (errorMsg.includes('Unauthorized') || errorMsg.includes('401')) {
|
|
54
|
+
throw new SfError(messages.getMessage('error.AuthenticationError'), 'TemplateListError', messages.getMessages('error.AuthenticationError.Actions'));
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
throw new SfError(messages.getMessage('error.GenericError', [errorMsg]), 'TemplateListError', messages.getMessages('error.GenericError.Actions'));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/orchestrator/template/list.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAc,MAAM,kBAAkB,CAAC;AAEjE,OAAO,oBAAoB,MAAM,iDAAiD,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAErF,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAA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AW,CAAC,4BAA4B,CAAC,CACnD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { TemplateData } from '../../../utils/template/templateTypes.js';
|
|
3
|
+
export default class Update extends SfCommand<TemplateData> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly state = "preview";
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'template-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'template-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
label: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<TemplateData>;
|
|
17
|
+
}
|