@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.
Files changed (110) hide show
  1. package/LICENSE +28 -0
  2. package/LICENSE.txt +12 -0
  3. package/README.md +145 -0
  4. package/lib/commands/orchestrator/create/app.d.ts +19 -0
  5. package/lib/commands/orchestrator/create/app.js +144 -0
  6. package/lib/commands/orchestrator/create/app.js.map +1 -0
  7. package/lib/commands/orchestrator/create/template.d.ts +17 -0
  8. package/lib/commands/orchestrator/create/template.js +96 -0
  9. package/lib/commands/orchestrator/create/template.js.map +1 -0
  10. package/lib/commands/orchestrator/decouple/app.d.ts +14 -0
  11. package/lib/commands/orchestrator/decouple/app.js +106 -0
  12. package/lib/commands/orchestrator/decouple/app.js.map +1 -0
  13. package/lib/commands/orchestrator/delete/app.d.ts +15 -0
  14. package/lib/commands/orchestrator/delete/app.js +102 -0
  15. package/lib/commands/orchestrator/delete/app.js.map +1 -0
  16. package/lib/commands/orchestrator/delete/template.d.ts +15 -0
  17. package/lib/commands/orchestrator/delete/template.js +108 -0
  18. package/lib/commands/orchestrator/delete/template.js.map +1 -0
  19. package/lib/commands/orchestrator/display/app.d.ts +15 -0
  20. package/lib/commands/orchestrator/display/app.js +85 -0
  21. package/lib/commands/orchestrator/display/app.js.map +1 -0
  22. package/lib/commands/orchestrator/display/template.d.ts +15 -0
  23. package/lib/commands/orchestrator/display/template.js +105 -0
  24. package/lib/commands/orchestrator/display/template.js.map +1 -0
  25. package/lib/commands/orchestrator/list/app.d.ts +13 -0
  26. package/lib/commands/orchestrator/list/app.js +62 -0
  27. package/lib/commands/orchestrator/list/app.js.map +1 -0
  28. package/lib/commands/orchestrator/list/template.d.ts +14 -0
  29. package/lib/commands/orchestrator/list/template.js +64 -0
  30. package/lib/commands/orchestrator/list/template.js.map +1 -0
  31. package/lib/commands/orchestrator/template/create.d.ts +17 -0
  32. package/lib/commands/orchestrator/template/create.js +96 -0
  33. package/lib/commands/orchestrator/template/create.js.map +1 -0
  34. package/lib/commands/orchestrator/template/delete.d.ts +15 -0
  35. package/lib/commands/orchestrator/template/delete.js +108 -0
  36. package/lib/commands/orchestrator/template/delete.js.map +1 -0
  37. package/lib/commands/orchestrator/template/display.d.ts +15 -0
  38. package/lib/commands/orchestrator/template/display.js +105 -0
  39. package/lib/commands/orchestrator/template/display.js.map +1 -0
  40. package/lib/commands/orchestrator/template/list.d.ts +13 -0
  41. package/lib/commands/orchestrator/template/list.js +62 -0
  42. package/lib/commands/orchestrator/template/list.js.map +1 -0
  43. package/lib/commands/orchestrator/template/update.d.ts +17 -0
  44. package/lib/commands/orchestrator/template/update.js +107 -0
  45. package/lib/commands/orchestrator/template/update.js.map +1 -0
  46. package/lib/commands/orchestrator/update/app.d.ts +20 -0
  47. package/lib/commands/orchestrator/update/app.js +145 -0
  48. package/lib/commands/orchestrator/update/app.js.map +1 -0
  49. package/lib/commands/orchestrator/update/template.d.ts +17 -0
  50. package/lib/commands/orchestrator/update/template.js +107 -0
  51. package/lib/commands/orchestrator/update/template.js.map +1 -0
  52. package/lib/index.d.ts +2 -0
  53. package/lib/index.js +8 -0
  54. package/lib/index.js.map +1 -0
  55. package/lib/utils/app/appDisplayUtil.d.ts +26 -0
  56. package/lib/utils/app/appDisplayUtil.js +153 -0
  57. package/lib/utils/app/appDisplayUtil.js.map +1 -0
  58. package/lib/utils/app/appListUtils.d.ts +34 -0
  59. package/lib/utils/app/appListUtils.js +81 -0
  60. package/lib/utils/app/appListUtils.js.map +1 -0
  61. package/lib/utils/app/appTypes.d.ts +44 -0
  62. package/lib/utils/app/appTypes.js +8 -0
  63. package/lib/utils/app/appTypes.js.map +1 -0
  64. package/lib/utils/app/appframeworkapp.d.ts +64 -0
  65. package/lib/utils/app/appframeworkapp.js +175 -0
  66. package/lib/utils/app/appframeworkapp.js.map +1 -0
  67. package/lib/utils/display/displayUtil.d.ts +27 -0
  68. package/lib/utils/display/displayUtil.js +80 -0
  69. package/lib/utils/display/displayUtil.js.map +1 -0
  70. package/lib/utils/request.d.ts +15 -0
  71. package/lib/utils/request.js +18 -0
  72. package/lib/utils/request.js.map +1 -0
  73. package/lib/utils/template/appframeworktemplate.d.ts +67 -0
  74. package/lib/utils/template/appframeworktemplate.js +114 -0
  75. package/lib/utils/template/appframeworktemplate.js.map +1 -0
  76. package/lib/utils/template/templateDisplayUtil.d.ts +42 -0
  77. package/lib/utils/template/templateDisplayUtil.js +142 -0
  78. package/lib/utils/template/templateDisplayUtil.js.map +1 -0
  79. package/lib/utils/template/templateHighlighter.d.ts +23 -0
  80. package/lib/utils/template/templateHighlighter.js +68 -0
  81. package/lib/utils/template/templateHighlighter.js.map +1 -0
  82. package/lib/utils/template/templateListUtils.d.ts +40 -0
  83. package/lib/utils/template/templateListUtils.js +126 -0
  84. package/lib/utils/template/templateListUtils.js.map +1 -0
  85. package/lib/utils/template/templateTypes.d.ts +114 -0
  86. package/lib/utils/template/templateTypes.js +15 -0
  87. package/lib/utils/template/templateTypes.js.map +1 -0
  88. package/lib/utils/utils.d.ts +21 -0
  89. package/lib/utils/utils.js +49 -0
  90. package/lib/utils/utils.js.map +1 -0
  91. package/messages/appframework.create.app.md +124 -0
  92. package/messages/appframework.create.template.md +82 -0
  93. package/messages/appframework.decouple.app.md +82 -0
  94. package/messages/appframework.delete.app.md +94 -0
  95. package/messages/appframework.delete.template.md +162 -0
  96. package/messages/appframework.display.app.md +70 -0
  97. package/messages/appframework.display.template.md +101 -0
  98. package/messages/appframework.list.app.md +126 -0
  99. package/messages/appframework.list.template.md +78 -0
  100. package/messages/appframework.template.create.md +82 -0
  101. package/messages/appframework.template.delete.md +162 -0
  102. package/messages/appframework.template.display.md +101 -0
  103. package/messages/appframework.template.list.md +78 -0
  104. package/messages/appframework.template.update.md +78 -0
  105. package/messages/appframework.update.app.md +142 -0
  106. package/messages/appframework.update.template.md +78 -0
  107. package/npm-shrinkwrap.json +14309 -0
  108. package/oclif.lock +7751 -0
  109. package/oclif.manifest.json +1731 -0
  110. package/package.json +226 -0
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Salesforce CLI
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/LICENSE.txt ADDED
@@ -0,0 +1,12 @@
1
+ Copyright (c) 2025, Salesforce.com, Inc.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+
8
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
+
10
+ * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,145 @@
1
+ **NOTE: This template for sf plugins is not yet official. Please consult with the Platform CLI team before using this template.**
2
+
3
+ # Salesforce Orchestrator Plugin
4
+
5
+ [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/plugin-orchestrator/main/LICENSE.txt)
6
+
7
+ A Salesforce CLI plugin for working with AppFramework apps, templates, assets, and services.
8
+
9
+ ## Installation
10
+
11
+ If you want to contribute to the plugin or run it from source:
12
+
13
+ ```bash
14
+ # Clone the repository
15
+ git clone https://github.com/salesforcecli/plugin-orchestrator.git
16
+ cd plugin-orchestrator
17
+
18
+ # Install dependencies
19
+ yarn install
20
+
21
+ # Build the plugin
22
+ yarn build
23
+
24
+ # Link to your local SF CLI
25
+ sf plugins link .
26
+ ```
27
+
28
+ ## Running Locally for Development
29
+
30
+ When developing the plugin, you can run it in several ways:
31
+
32
+ ### Using the linked plugin
33
+
34
+ After linking the plugin with `sf plugins link .`, you can run commands normally:
35
+
36
+ ```bash
37
+ sf orchestrator template list --help
38
+ ```
39
+
40
+ ### Using the local run file
41
+
42
+ ```bash
43
+ # Run a command using the local development script
44
+ ./bin/dev.js orchestrator template list --help
45
+ ```
46
+
47
+ ### Running Tests
48
+
49
+ ```bash
50
+ # Run all tests
51
+ yarn test
52
+
53
+ # Run unit tests only
54
+ yarn test:only
55
+
56
+ # Run NUTs (Node Unit Tests)
57
+ yarn test:nuts
58
+ ```
59
+
60
+ ## Commands
61
+
62
+ The plugin provides commands for working with AppFramework templates and applications.
63
+
64
+ ### Template Commands
65
+
66
+ ```bash
67
+ # List templates in an org
68
+ sf orchestrator template list -o <target-org>
69
+
70
+ # Display details of a specific template
71
+ sf orchestrator template display -o <target-org> --template-id <id>
72
+
73
+ # Create a new template
74
+ sf orchestrator template create -o <target-org> --name <template-name> [--label <label>] [--type <type>]
75
+
76
+ # Update an existing template
77
+ sf orchestrator template update -o <target-org> --template-id <id> [--label <new-label>] [--description <text>]
78
+
79
+ # Delete a template
80
+ sf orchestrator template delete -o <target-org> --template-id <id>
81
+ ```
82
+
83
+ ### App Commands
84
+
85
+ ```bash
86
+ # List apps in an org
87
+ sf orchestrator list app -o <target-org>
88
+
89
+ # Display details of a specific app
90
+ sf orchestrator display app -o <target-org> --app-id <id>
91
+
92
+ # Create a new app
93
+ sf orchestrator create app -o <target-org> --name <app-name> [--label <label>] [--template-id <template-id>]
94
+
95
+ # Update an existing app
96
+ sf orchestrator update app -o <target-org> --app-id <id> [--label <new-label>] [--description <text>]
97
+
98
+ # Delete an app
99
+ sf orchestrator delete app -o <target-org> --app-id <id>
100
+ ```
101
+
102
+ ## Issues
103
+
104
+ Please report any issues at https://github.com/salesforcecli/plugin-orchestrator/issues
105
+
106
+ ## Contributing
107
+
108
+ 1. Please read our [Code of Conduct](CODE_OF_CONDUCT.md)
109
+ 2. Create a new issue before starting your project so that we can keep track of
110
+ what you are trying to add/fix. That way, we can also offer suggestions or
111
+ let you know if there is already an effort in progress.
112
+ 3. Fork this repository.
113
+ 4. [Build the plugin locally](#installation)
114
+ 5. Create a _topic_ branch in your fork. Note, this step is recommended but technically not required if contributing using a fork.
115
+ 6. Edit the code in your fork.
116
+ 7. Write appropriate tests for your changes. Try to achieve at least 95% code coverage on any new code. No pull request will be accepted without unit tests.
117
+ 8. Sign CLA (see [CLA](#cla) below).
118
+ 9. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in.
119
+
120
+ ### CLA
121
+
122
+ External contributors will be required to sign a Contributor's License
123
+ Agreement. You can do so by going to https://cla.salesforce.com/sign-cla.
124
+
125
+ ## Learn about `sf` plugins
126
+
127
+ Salesforce CLI plugins are based on the [oclif plugin framework](https://oclif.io/docs/introduction). Read the [plugin developer guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_architecture_sf_cli.htm) to learn about Salesforce CLI plugin development.
128
+
129
+ This repository contains a lot of additional scripts and tools to help with general Salesforce node development and enforce coding standards. You should familiarize yourself with some of the [node developer packages](#tooling) used by Salesforce.
130
+
131
+ Additionally, there are some tests that the Salesforce CLI will enforce if this plugin is ever bundled with the CLI. These test are included by default under the `posttest` script and it is required to keep these tests active in your plugin if you plan to have it bundled.
132
+
133
+ ### Tooling
134
+
135
+ - [@salesforce/core](https://github.com/forcedotcom/sfdx-core)
136
+ - [@salesforce/kit](https://github.com/forcedotcom/kit)
137
+ - [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core)
138
+ - [@salesforce/ts-types](https://github.com/forcedotcom/ts-types)
139
+ - [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon)
140
+ - [@salesforce/dev-config](https://github.com/forcedotcom/dev-config)
141
+ - [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts)
142
+
143
+ This plugin is bundled with the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). For more information on the CLI, read the [getting started guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).
144
+
145
+ We always recommend using the latest version of these commands bundled with the CLI, however, you can install a specific version or tag if needed.
@@ -0,0 +1,19 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export default class CreateApp 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
+ label: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'template-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ 'template-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ 'runtime-method': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ 'log-level': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ };
18
+ run(): Promise<string>;
19
+ }
@@ -0,0 +1,144 @@
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 AppFrameworkApp from '../../../utils/app/appframeworkapp.js';
10
+ import AppFrameworkTemplate from '../../../utils/template/appframeworktemplate.js';
11
+ import { AppDisplayUtil } from '../../../utils/app/appDisplayUtil.js';
12
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
13
+ const messages = Messages.loadMessages('@salesforce/plugin-orchestrator', 'appframework.create.app');
14
+ export default class CreateApp 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
+ name: Flags.string({
30
+ char: 'n',
31
+ summary: messages.getMessage('flags.name.summary'),
32
+ description: messages.getMessage('flags.name.description'),
33
+ required: true,
34
+ }),
35
+ label: Flags.string({
36
+ char: 'l',
37
+ summary: messages.getMessage('flags.label.summary'),
38
+ description: messages.getMessage('flags.label.description'),
39
+ }),
40
+ description: Flags.string({
41
+ char: 'd',
42
+ summary: messages.getMessage('flags.description.summary'),
43
+ description: messages.getMessage('flags.description.description'),
44
+ }),
45
+ 'template-id': Flags.string({
46
+ char: 'i',
47
+ summary: messages.getMessage('flags.template-id.summary'),
48
+ description: messages.getMessage('flags.template-id.description'),
49
+ exclusive: ['template-name'],
50
+ }),
51
+ 'template-name': Flags.string({
52
+ char: 't',
53
+ summary: messages.getMessage('flags.template-name.summary'),
54
+ description: messages.getMessage('flags.template-name.description'),
55
+ exclusive: ['template-id'],
56
+ }),
57
+ 'runtime-method': Flags.string({
58
+ char: 'r',
59
+ summary: messages.getMessage('flags.runtime-method.summary'),
60
+ description: messages.getMessage('flags.runtime-method.description'),
61
+ options: ['sync', 'async'],
62
+ }),
63
+ 'log-level': Flags.string({
64
+ char: 'g',
65
+ summary: messages.getMessage('flags.log-level.summary'),
66
+ description: messages.getMessage('flags.log-level.description'),
67
+ options: ['debug', 'info', 'warn', 'error'],
68
+ }),
69
+ };
70
+ async run() {
71
+ const { flags } = await this.parse(CreateApp);
72
+ // Check that at least one of template-id or template-name is provided
73
+ if (!flags['template-id'] && !flags['template-name']) {
74
+ throw new SfError(messages.getMessage('noTemplateSpecified'), 'AppCreationError', messages.getMessages('error.AppCreationError.Actions'));
75
+ }
76
+ try {
77
+ const connection = flags['target-org'].getConnection(flags['api-version']);
78
+ const appFrameworkApp = new AppFrameworkApp(connection);
79
+ const appFrameworkTemplate = new AppFrameworkTemplate(connection);
80
+ let templateId = flags['template-id'];
81
+ // If template name is provided instead of ID, look up the ID
82
+ if (flags['template-name']) {
83
+ this.spinner.start(messages.getMessage('fetchingTemplate'));
84
+ const templates = await appFrameworkTemplate.list();
85
+ const template = templates.find((t) => t.name === flags['template-name']);
86
+ if (!template) {
87
+ this.spinner.stop();
88
+ throw new SfError(messages.getMessage('error.TemplateNotFound'), 'TemplateNotFound', messages.getMessages('error.TemplateNotFound.Actions'));
89
+ }
90
+ templateId = template.id;
91
+ this.spinner.stop();
92
+ }
93
+ this.spinner.start(messages.getMessage('creatingApp'));
94
+ const appId = await appFrameworkApp.create({
95
+ name: flags.name,
96
+ label: flags.label,
97
+ description: flags.description,
98
+ templateSourceId: templateId,
99
+ runtimeMethod: flags['runtime-method'],
100
+ logLevel: flags['log-level'],
101
+ });
102
+ this.spinner.stop();
103
+ this.log(messages.getMessage('createSuccess', [appId]));
104
+ try {
105
+ // Fetch the created app and display its details
106
+ const app = await appFrameworkApp.getApp(appId);
107
+ if (app) {
108
+ const displayApp = {
109
+ id: app.id,
110
+ name: app.name,
111
+ label: app.label,
112
+ description: app.description,
113
+ templateSourceId: app.templateSourceId,
114
+ templateType: app.templateType,
115
+ templateSubtype: app.templateSubtype,
116
+ templateVersion: app.templateVersion,
117
+ namespace: app.namespace,
118
+ created: app.createdDate ? new Date(app.createdDate).toLocaleDateString() : undefined,
119
+ modified: app.lastModifiedDate ? new Date(app.lastModifiedDate).toLocaleDateString() : undefined,
120
+ runtimeMethod: app.runtimeMethod,
121
+ logLevel: app.logLevel,
122
+ status: app.status,
123
+ url: app.url,
124
+ configurationUrl: app.configurationUrl,
125
+ readinessUrl: app.readinessUrl,
126
+ };
127
+ AppDisplayUtil.displayAppDetails(this, displayApp);
128
+ }
129
+ }
130
+ catch (error) {
131
+ this.debug(`Error fetching app details: ${error.message}`);
132
+ }
133
+ return appId;
134
+ }
135
+ catch (error) {
136
+ this.spinner.stop();
137
+ if (error.name === 'TemplateNotFound') {
138
+ throw error;
139
+ }
140
+ throw new SfError(messages.getMessage('error.AppCreationError', [error.message]), 'AppCreationError', messages.getMessages('error.AppCreationError.Actions'));
141
+ }
142
+ }
143
+ }
144
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/commands/orchestrator/create/app.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,eAAe,MAAM,uCAAuC,CAAC;AACpE,OAAO,oBAAoB,MAAM,iDAAiD,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,Q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C,CAAC,SAAS;wBACrF,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,SAAS;wBAChG,aAAa,EAAE,GAAG,CAAC,aAAa;wBAChC,QAAQ,EAAE,GAAG,CAAC,QAAQ;wBACtB,MAAM,EAAE,GAAG,CAAC,MAAM;wBAClB,GAAG,EAAE,GAAG,CAAC,GAAG;wBACZ,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;wBACtC,YAAY,EAAE,GAAG,CAAC,YAAY;qBAC/B,CAAC;oBACF,cAAc,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,+BAAgC,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;YACxE,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAEpB,IAAK,KAAiB,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;gBACnD,MAAM,KAAK,CAAC;YACd,CAAC;YAED,MAAM,IAAI,OAAO,CACf,QAAQ,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAE,KAAe,CAAC,OAAO,CAAC,CAAC,EACzE,kBAAkB,EAClB,QAAQ,CAAC,WAAW,CAAC,gCAAgC,CAAC,CACvD,CAAC;QACJ,CAAC;IACH,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export default class CreateTemplate 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.create.template');
13
+ export default class CreateTemplate 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(CreateTemplate);
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=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/commands/orchestrator/create/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,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,8BAA8B,CAAC,CAAC;AAE1G,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAAiB;IACpD,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,CAAC;YAChE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC;YACjC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,2BAA2B,CAAC;YACzD,WAAW,EA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MAAM,IAAI,OAAO,CAAC,yCAA0C,KAAe,CAAC,OAAO,EAAE,EAAE,uBAAuB,EAAE;gBAC9G,qDAAqD;gBACrD,6CAA6C;gBAC7C,sCAAsC;aACvC,CAAC,CAAC;QACL,CAAC;IACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export default class DecoupleApp 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
+ 'app-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'app-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<string>;
14
+ }
@@ -0,0 +1,106 @@
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 AppFrameworkApp from '../../../utils/app/appframeworkapp.js';
10
+ import { AppListUtil } from '../../../utils/app/appListUtils.js';
11
+ import { AppDisplayUtil } from '../../../utils/app/appDisplayUtil.js';
12
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
13
+ const messages = Messages.loadMessages('@salesforce/plugin-orchestrator', 'appframework.decouple.app');
14
+ export default class DecoupleApp 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
+ 'app-id': Flags.string({
30
+ char: 'i',
31
+ summary: messages.getMessage('flags.app-id.summary'),
32
+ description: messages.getMessage('flags.app-id.description'),
33
+ exclusive: ['app-name'],
34
+ }),
35
+ 'app-name': Flags.string({
36
+ char: 'n',
37
+ summary: messages.getMessage('flags.app-name.summary'),
38
+ description: messages.getMessage('flags.app-name.description'),
39
+ exclusive: ['app-id'],
40
+ }),
41
+ };
42
+ async run() {
43
+ const { flags } = await this.parse(DecoupleApp);
44
+ // Check that at least one of app-id or app-name is provided
45
+ if (!flags['app-id'] && !flags['app-name']) {
46
+ throw new SfError(messages.getMessage('noAppSpecified'), 'AppDecoupleError', messages.getMessages('error.DecoupleError.Actions'));
47
+ }
48
+ try {
49
+ const connection = flags['target-org'].getConnection(flags['api-version']);
50
+ const appFrameworkApp = new AppFrameworkApp(connection);
51
+ let appId = '';
52
+ // Get app ID if app name was provided
53
+ if (flags['app-name']) {
54
+ this.spinner.start(messages.getMessage('fetchingApp'));
55
+ const apps = await appFrameworkApp.list();
56
+ const app = apps.find((a) => a.name === flags['app-name']);
57
+ if (!app) {
58
+ this.spinner.stop();
59
+ throw new SfError(messages.getMessage('noAppFound'), 'AppDecoupleError', messages.getMessages('error.DecoupleError.Actions'));
60
+ }
61
+ appId = app.id ?? '';
62
+ this.spinner.stop();
63
+ }
64
+ else {
65
+ appId = flags['app-id'] ?? '';
66
+ }
67
+ // Get the app to retrieve its template
68
+ this.spinner.start(messages.getMessage('fetchingApp'));
69
+ const app = await appFrameworkApp.getApp(appId);
70
+ if (!app) {
71
+ this.spinner.stop();
72
+ throw new SfError(messages.getMessage('noAppFound'), 'AppDecoupleError', messages.getMessages('error.DecoupleError.Actions'));
73
+ }
74
+ if (!app.templateSourceId) {
75
+ this.spinner.stop();
76
+ throw new SfError(messages.getMessage('noTemplateFound'), 'AppDecoupleError', messages.getMessages('error.DecoupleError.Actions'));
77
+ }
78
+ const templateId = app.templateSourceId;
79
+ this.spinner.stop();
80
+ // Decouple the app
81
+ this.spinner.start(messages.getMessage('decouplingApp'));
82
+ const decoupledAppId = await appFrameworkApp.decoupleApp(appId, templateId);
83
+ this.spinner.stop();
84
+ this.log(messages.getMessage('decoupleSuccess', [decoupledAppId]));
85
+ try {
86
+ // Fetch the updated app and display its details
87
+ const updatedApp = await appFrameworkApp.getApp(decoupledAppId);
88
+ if (updatedApp) {
89
+ const processedApps = AppListUtil.processApps([updatedApp]);
90
+ if (processedApps.length > 0) {
91
+ AppDisplayUtil.displayAppDetails(this, processedApps[0]);
92
+ }
93
+ }
94
+ }
95
+ catch (error) {
96
+ this.debug(`Error fetching decoupled app details: ${error.message}`);
97
+ }
98
+ return decoupledAppId;
99
+ }
100
+ catch (error) {
101
+ this.spinner.stop();
102
+ throw new SfError(messages.getMessage('error.DecoupleError', [error.message]), 'AppDecoupleError', messages.getMessages('error.DecoupleError.Actions'));
103
+ }
104
+ }
105
+ }
106
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/commands/orchestrator/decouple/app.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,eAAe,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,QAAQ,CAAC,kCAAkC,CA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E,CAAC;YAEpB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;YAEnE,IAAI,CAAC;gBACH,gDAAgD;gBAChD,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;gBAChE,IAAI,UAAU,EAAE,CAAC;oBACf,MAAM,aAAa,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;oBAC5D,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBAC7B,cAAc,CAAC,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC3D,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,yCAA0C,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;YAClF,CAAC;YAED,OAAO,cAAc,CAAC;QACxB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAEpB,MAAM,IAAI,OAAO,CACf,QAAQ,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAE,KAAe,CAAC,OAAO,CAAC,CAAC,EACtE,kBAAkB,EAClB,QAAQ,CAAC,WAAW,CAAC,6BAA6B,CAAC,CACpD,CAAC;QACJ,CAAC;IACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export default class DeleteApp 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
+ 'app-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'app-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
+ }