@pdfbutler/migration-cli 0.0.1 → 0.0.3

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/README.md CHANGED
@@ -1,145 +1,230 @@
1
1
  # pdfbutler-migration-cli
2
2
 
3
- [![NPM](https://img.shields.io/npm/v/pdfbutler-migration-cli.svg?label=pdfbutler-migration-cli)](https://www.npmjs.com/package/pdfbutler-migration-cli) [![Downloads/week](https://img.shields.io/npm/dw/pdfbutler-migration-cli.svg)](https://npmjs.org/package/pdfbutler-migration-cli) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/pdfbutler-migration-cli/main/LICENSE.txt)
3
+ [![NPM](https://img.shields.io/npm/v/pdfbutler-migration-cli.svg?label=pdfbutler-migration-cli)](https://www.npmjs.com/package/@pdfbutler/migration-cli) [![Downloads/week](https://img.shields.io/npm/dw/pdfbutler-migration-cli.svg)](https://www.npmjs.com/package/@pdfbutler/migration-cli) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/pdfbutler-migration-cli/main/LICENSE.txt)
4
4
 
5
- ## Using the template
5
+ ## About
6
6
 
7
- This repository provides a template for creating a plugin for the Salesforce CLI. To convert this template to a working plugin:
7
+ @pdfbutler/migration-cli is a Salesforce plugin designed to simplify and automate the process of migrating configurations within the PDF Butler system in the Salesforce environment. PDF Butler is a powerful tool for generating and automating documents in the Salesforce platform, and the use of this CLI plugin allows users to easily manage configurations and transfer them between different Salesforce instances or projects.
8
8
 
9
- 1. Please get in touch with the Platform CLI team. We want to help you develop your plugin.
10
- 2. Generate your plugin:
9
+ ### Main features of the plugin:
11
10
 
12
- ```
13
- sf plugins install dev
14
- sf dev generate plugin
11
+ Export and import configurations: The plugin enables easy export and import of PDF Butler configurations. This is particularly useful for moving settings between different Salesforce environments or projects, ensuring consistency and ease of management.
12
+ Migration customization: The plugin provides users with the ability to customize the migration process using various flags and parameters to meet individual needs. With this plugin, you can specify the target Salesforce account, use environment variables for authentication, define custom URLs for import or export, and other parameters of your choice.
15
13
 
16
- git init -b main
17
- git add . && git commit -m "chore: initial commit"
18
- ```
14
+ ## Installation
19
15
 
20
- 3. Create your plugin's repo in the salesforcecli github org
21
- 4. When you're ready, replace the contents of this README with the information you want.
16
+ To install this plugin, make sure you have Node.js and npm (Node Package Manager) installed on your computer. If you don't have them, you can download Node.js from the official website, and npm will be installed along with it.
22
17
 
23
- ## Learn about `sf` plugins
24
-
25
- Salesforce CLI plugins are based on the [oclif plugin framework](<(https://oclif.io/docs/introduction.html)>). 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.
26
-
27
- 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.
28
-
29
- Additionally, there are some additional 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.
18
+ ```
19
+ npm install
20
+ yarn install
21
+ ```
30
22
 
31
- ### Tooling
23
+ Install an Salesforce namespase using this commands:
32
24
 
33
- - [@salesforce/core](https://github.com/forcedotcom/sfdx-core)
34
- - [@salesforce/kit](https://github.com/forcedotcom/kit)
35
- - [@salesforce/sf-plugins-core](https://github.com/salesforcecli/sf-plugins-core)
36
- - [@salesforce/ts-types](https://github.com/forcedotcom/ts-types)
37
- - [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon)
38
- - [@salesforce/dev-config](https://github.com/forcedotcom/dev-config)
39
- - [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts)
25
+ ```
26
+ #Windows
27
+ sf plugins install dev
28
+ #Linux
29
+ sudo apt-get install sfdx
30
+ ```
40
31
 
41
- ### Hooks
32
+ Once you have Node.js and npm installed, you can install this plugin using the npm command. Here's how to do it:
33
+ Open your terminal or command prompt on your computer.
34
+ Use the npm command to install this plugin by specifying its name from npm. For example:
35
+ For install the plugin run:
36
+ ```
37
+ sf plugins link @pdfbutler/migration-cli
38
+ ```
39
+ To see your installed plugins and their versions, run:
40
+ ```
41
+ sf plugins
42
+ ```
43
+ To see which versions of the core Salesforce-provided plugins are installed on your computer, run:
44
+ ```
45
+ sf plugins --core
46
+ ```
42
47
 
43
- For cross clouds commands, e.g. `sf env list`, we utilize [oclif hooks](https://oclif.io/docs/hooks) to get the relevant information from installed plugins.
48
+ After the installation is complete, you can call this plugin using its name in the terminal or command prompt. For example:
44
49
 
45
- This plugin includes sample hooks in the [src/hooks directory](src/hooks). You'll just need to add the appropriate logic. You can also delete any of the hooks if they aren't required for your plugin.
50
+ ```
51
+ $ sf butler pb export [options]
52
+ $ sf butler pb import [options]
53
+ ```
46
54
 
47
- # Everything past here is only a suggestion as to what should be in your specific plugin's description
55
+ Now you can use this plugin to export and import PDF Butler configurations in Salesforce.
48
56
 
49
- 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).
57
+ ## Commands
50
58
 
51
- 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.
59
+ ## butler pb export
52
60
 
53
- ## Install
61
+ Export PDF Butler configurations to a file.
54
62
 
55
- ```bash
56
- sf plugins install pdfbutler-migration-cli@x.y.z
57
63
  ```
64
+ USAGE
65
+ $ sf butler pb export [--target | -t <value>] [--id | -i <value>] [--out | -o <value>] [--stage | -s <value>] [--backend | -b] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [--unzip | -u]
58
66
 
59
- ## Issues
60
-
61
- Please report any issues at https://github.com/forcedotcom/cli/issues
62
-
63
- ## Contributing
64
-
65
- 1. Please read our [Code of Conduct](CODE_OF_CONDUCT.md)
66
- 2. Create a new issue before starting your project so that we can keep track of
67
- what you are trying to add/fix. That way, we can also offer suggestions or
68
- let you know if there is already an effort in progress.
69
- 3. Fork this repository.
70
- 4. [Build the plugin locally](#build)
71
- 5. Create a _topic_ branch in your fork. Note, this step is recommended but technically not required if contributing using a fork.
72
- 6. Edit the code in your fork.
73
- 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.
74
- 8. Sign CLA (see [CLA](#cla) below).
75
- 9. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in.
67
+ FLAGS
68
+ -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
69
+ -i, --id=<value> The ID of the PDF Butler configuration to export. (Required)
70
+ -o, --out=<value> The output file path for the exported configuration. (Required)
71
+ -s, --stage=<value> The stage or environment for export. (Required)
72
+ -a, --auth-env-var=<value> The environment variable name for authentication. (Required)
73
+ -e, --endpoint=<value> The URL endpoint for export. (Required)
76
74
 
77
- ### CLA
75
+ -u, --unzip Use this flag to unzip the exported configuration. (Optional)
76
+ -b, --backend Use this flag to specify a backend export. (Optional)
78
77
 
79
- External contributors will be required to sign a Contributor's License
80
- Agreement. You can do so by going to https://cla.salesforce.com/sign-cla.
78
+ DESCRIPTION
79
+ Export DocConfigs and related DataSource files from your organization.
81
80
 
82
- ### Build
81
+ You must run this command from within a project.
83
82
 
84
- To build the plugin locally, make sure to have yarn installed and run the following commands:
83
+ By default, all your exported data is stored in a zip file.
84
+ To unzip the data to a directory during the export process, use the -u | flag --unzip.
85
85
 
86
- ```bash
87
- # Clone the repository
88
- git clone git@github.com:salesforcecli/pdfbutler-migration-cli
86
+ To initiate an export, ensure you specify the necessary parameters, including the target org, configuration ID,
87
+ output file path, define authentication environment variables, specify endpoints and stage.
88
+ Additionally, you have the flexibility to enable or disable backend exports and even choose to unzip the exported configuration.
89
89
 
90
- # Install the dependencies and compile
91
- yarn && yarn build
90
+ EXAMPLES
91
+ Run with --unzip and --backend flags
92
+
93
+ $ sf butler pb export -t username@sandbox.com -i '61cfcb7b-10f7-****-****-***********'
94
+ -o 'export1/out1' -s 'TEST' -e 'https://www.pdfbutler.com'
95
+ -a 'YOUR_USERNAME + -ADMIN + ':' + YOUR_ADMIN_PASSWORD' -b -u
96
+
97
+ # Created:
98
+ Directory 'sfdc/export1'{
99
+ file 'docconfig.json',
100
+ Unziped directory 'out1'{
101
+ Directory 'ConfigTypes',
102
+ Directory 'DataSources',
103
+ file 'doc-config.json',
104
+ file 'TemplateName.docx'
105
+ }
106
+ }
107
+
108
+ Run with --backend flag only
109
+
110
+ $ sf butler pb export -t username@sandbox.com -i '61cfcb7b-10f7-****-****-***********'
111
+ -o 'export1/out1' -s 'TEST' -e 'https://www.pdfbutler.com'
112
+ -a 'YOUR_USERNAME + -ADMIN + ':' + YOUR_ADMIN_PASSWORD' -b
113
+
114
+ # Created:
115
+ Directory 'sfdc/export1'{
116
+ zip file'out1.zip'{
117
+ Directory 'ConfigTypes',
118
+ Directory 'DataSources',
119
+ file 'doc-config.json',
120
+ file 'TemplateName.docx'
121
+ }
122
+ }
123
+
124
+ Run with --unzip flag only
125
+
126
+ $ sf butler pb export -t username@sandbox.com -i '61cfcb7b-10f7-****-****-***********'
127
+ -o 'export1/out1' -s 'TEST' -e 'https://www.pdfbutler.com'
128
+ -a 'YOUR_USERNAME + -ADMIN + ':' + YOUR_ADMIN_PASSWORD' -u
129
+
130
+ # Created:
131
+ Directory 'sfdc/export1'{
132
+ file 'doc-config.json'
133
+ }
134
+
135
+ Run without optional flags
136
+
137
+ $ sf butler pb export -t username@sandbox.com -i '61cfcb7b-10f7-****-****-***********'
138
+ -o 'export1/out1' -s 'TEST' -e 'https://www.pdfbutler.com'
139
+ -a 'YOUR_USERNAME + -ADMIN + ':' + YOUR_ADMIN_PASSWORD'
140
+
141
+ # Created:
142
+ Directory 'sfdc/export1'{
143
+ zip file 'out1.zip'{
144
+ file 'doc-config.json'
145
+ }
146
+ }
147
+
148
+ FLAG DESCRIPTIONS
149
+ -t, --target <value>
150
+ Specifies the Salesforce org username credentials to connect to the target org where the PDF Butler configurations are stored.
151
+ This flag is required to authenticate and access the PDF Butler configurations.
152
+
153
+ -i, --id <value>
154
+ Specifies the unique ID of the PDF Butler configuration to be exported.
155
+ This ID uniquely identifies the configuration you want to export. It is a required parameter.
156
+
157
+ -o, --out <value>
158
+ Specifies the output file path for the exported configuration.
159
+ This flag is required to determine where the exported configuration will be saved.
160
+
161
+ -s, --stage <value>
162
+ Specifies the stage or environment for the export process.
163
+ This flag helps in categorizing or labeling the exported data according to different stages of your workflow.
164
+ It is a required parameter.
165
+
166
+ -e, --endpoint <value>
167
+ Specifies a URL endpoint for export. It is a required parameter.
168
+
169
+ -a, --auth-env-var <value>
170
+ Specifies the name of the environment variable containing authentication credentials.
171
+ This flag allows you to reference an environment variable that stores authentication information.
172
+ It is a required parameter.
173
+
174
+ -b, --backend
175
+ Enables backend export. If specified, the export operation may use a backend process for exporting the configuration.
176
+
177
+ -u, --unzip
178
+ Use this flag to indicate that the exported configuration should be unzipped.
179
+ If specified, the exported configuration will be unzipped after the export process is complete.
92
180
  ```
93
181
 
94
- To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file.
95
-
96
- ```bash
97
- # Run using local run file.
98
- ./bin/dev hello world
99
- ```
182
+ ## butler pb import
100
183
 
101
- There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.
184
+ Import PDF Butler configurations and related DataSource files.
102
185
 
103
- ```bash
104
- # Link your plugin to the sf cli
105
- sf plugins link .
106
- # To verify
107
- sf plugins
108
186
  ```
187
+ USAGE
188
+ $ sf butler pb import [--target | -t <value>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [--stage | -s <value>] [--config | -f <value>]
109
189
 
110
- ## Commands
111
-
112
- <!-- commands -->
113
-
114
- - [`sf hello world`](#sf-hello-world)
115
-
116
- ## `sf hello world`
190
+ FLAGS
191
+ -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
192
+ -a, --auth-env-var=<value> The environment variable name for authentication. (Required)
193
+ -e, --endpoint=<value> The URL endpoint for import. (Required)
194
+ -s, --stage=<value> The stage or environment for import. (Required)
195
+ -f, --config=<value> The path to the configuration file or directory containing configurations to import. (Required)
117
196
 
118
- Say hello either to the world or someone you know.
197
+ DESCRIPTION
198
+ Import DocConfigs and related DataSource files into your organization.
119
199
 
120
- ```
121
- USAGE
122
- $ sf hello world [--json] [-n <value>]
200
+ You must run this command from within a project.
123
201
 
124
- FLAGS
125
- -n, --name=<value> [default: World] The name of the person you'd like to say hello to.
202
+ To initiate an import, ensure you specify the necessary parameters, including the target org,
203
+ authentication environment variable, endpoint, stage, and the path to the configuration file or directory.
204
+ All the targets are required parameters.
126
205
 
127
- GLOBAL FLAGS
128
- --json Format output as json.
206
+ EXAMPLE
207
+ Import configurations ot an organization:
129
208
 
130
- DESCRIPTION
131
- Say hello either to the world or someone you know.
209
+ $ sf butler pb import -t username@sandbox.com -f ./sfdc/export1/out1
210
+ -e 'https://www.pdfbutler.com' -a 'YOUR_USERNAME + -ADMIN + ':' + YOUR_ADMIN_PASSWORD' -s 'UAT'
132
211
 
133
- Say hello either to the world or someone you know.
212
+ FLAG DESCRIPTIONS
213
+ -t, --target <value>
214
+ Specifies the Salesforce org username credentials to connect to the target
215
+ org where the PDF Butler configurations will be imported. This flag is required for authentication.
134
216
 
135
- EXAMPLES
136
- Say hello to the world:
217
+ -a, --auth-env-var <value>
218
+ Specifies the name of the environment variable containing authentication credentials.
219
+ This flag allows you to reference an environment variable that stores authentication information.
137
220
 
138
- $ sf hello world
221
+ -e, --endpoint <value>
222
+ Specifies a URL endpoint for import. Use this flag if you need to specify a custom import endpoint.
139
223
 
140
- Say hello to someone you know:
224
+ -s, --stage <value>
225
+ Specifies the stage or environment for the import process. This flag helps categorize or label the imported data.
141
226
 
142
- $ sf hello world --name Astro
227
+ -f, --config <value>
228
+ Specifies the path to the configuration file or directory containing configurations to import.
229
+ This flag is required to determine which configurations to import.
143
230
  ```
144
-
145
- <!-- commandsstop -->
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.1",
2
+ "version": "0.0.3",
3
3
  "commands": {
4
4
  "butler:pb:export": {
5
5
  "id": "butler:pb:export",
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@pdfbutler/migration-cli",
3
3
  "description": "[![NPM](https://img.shields.io/npm/v/pdfbutler-migration-cli.svg?label=pdfbutler-migration-cli)](https://www.npmjs.com/package/pdfbutler-migration-cli) [![Downloads/week](https://img.shields.io/npm/dw/pdfbutler-migration-cli.svg)](https://npmjs.org/package/pdfbutler-migration-cli) [![License](https://img.shields.io/badge/License-BSD%203--Clause-brightgreen.svg)](https://raw.githubusercontent.com/salesforcecli/pdfbutler-migration-cli/main/LICENSE.txt)",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
+ "script": {
6
+ "postinstall": "sf plugins link @pdfbutler/migration-cli"
7
+ },
5
8
  "dependencies": {
6
9
  "@oclif/core": "^2.11.8",
7
10
  "@salesforce/core": "^5.2.0",
@@ -90,7 +93,6 @@
90
93
  "docs": "sf-docs",
91
94
  "format": "wireit",
92
95
  "lint": "wireit",
93
- "postinstall": "yarn husky install",
94
96
  "postpack": "shx rm -f oclif.manifest.json",
95
97
  "prepack": "sf-prepack",
96
98
  "test": "wireit",