@pdfbutler/migration-cli 0.0.2 → 0.0.4

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,225 @@
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
+ If you've installed Node.js on your computer, you can use npm to install Salesforce CLI:
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
+ npm install @salesforce/cli --global
28
+ ```
40
29
 
41
- ### Hooks
30
+ For install the plugin run:
31
+ ```
32
+ sf plugins link @pdfbutler/migration-cli
33
+ ```
34
+ To see your installed plugins and their versions, run:
35
+ ```
36
+ sf plugins
37
+ ```
38
+ To see which versions of the core Salesforce-provided plugins are installed on your computer, run:
39
+ ```
40
+ sf plugins --core
41
+ ```
42
42
 
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.
43
+ After the installation is complete, you can call this plugin using its name in the terminal or command prompt. For example:
44
44
 
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.
45
+ ```
46
+ $ sf butler pb export [options]
47
+ $ sf butler pb import [options]
48
+ ```
46
49
 
47
- # Everything past here is only a suggestion as to what should be in your specific plugin's description
50
+ Now you can use this plugin to export and import PDF Butler configurations in Salesforce.
48
51
 
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).
52
+ ## Commands
50
53
 
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.
54
+ ## butler pb export
52
55
 
53
- ## Install
56
+ Export PDF Butler configurations to a file.
54
57
 
55
- ```bash
56
- sf plugins install pdfbutler-migration-cli@x.y.z
57
58
  ```
59
+ USAGE
60
+ $ 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
61
 
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.
62
+ FLAGS
63
+ -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
64
+ -i, --id=<value> The ID of the PDF Butler configuration to export. (Required)
65
+ -o, --out=<value> The output file path for the exported configuration. (Required)
66
+ -s, --stage=<value> The stage or environment for export. (Required)
67
+ -a, --auth-env-var=<value> The environment variable name for authentication. (Required)
68
+ -e, --endpoint=<value> The URL endpoint for export. (Required)
76
69
 
77
- ### CLA
70
+ -u, --unzip Use this flag to unzip the exported configuration. (Optional)
71
+ -b, --backend Use this flag to specify a backend export. (Optional)
78
72
 
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.
73
+ DESCRIPTION
74
+ Export DocConfigs and related DataSource files from your organization.
81
75
 
82
- ### Build
76
+ You must run this command from within a project.
83
77
 
84
- To build the plugin locally, make sure to have yarn installed and run the following commands:
78
+ By default, all your exported data is stored in a zip file.
79
+ To unzip the data to a directory during the export process, use the -u | flag --unzip.
85
80
 
86
- ```bash
87
- # Clone the repository
88
- git clone git@github.com:salesforcecli/pdfbutler-migration-cli
81
+ To initiate an export, ensure you specify the necessary parameters, including the target org, configuration ID,
82
+ output file path, define authentication environment variables, specify endpoints and stage.
83
+ Additionally, you have the flexibility to enable or disable backend exports and even choose to unzip the exported configuration.
89
84
 
90
- # Install the dependencies and compile
91
- yarn && yarn build
85
+ EXAMPLES
86
+ Run with --unzip and --backend flags
87
+
88
+ $ sf butler pb export -t username@sandbox.com -i '61cfcb7b-10f7-****-****-***********'
89
+ -o 'export1/out1' -s 'TEST' -e 'https://www.pdfbutler.com'
90
+ -a 'YOUR_USERNAME + -ADMIN + ':' + YOUR_ADMIN_PASSWORD' -b -u
91
+
92
+ # Created:
93
+ Directory 'sfdc/export1'{
94
+ file 'docconfig.json',
95
+ Unziped directory 'out1'{
96
+ Directory 'ConfigTypes',
97
+ Directory 'DataSources',
98
+ file 'doc-config.json',
99
+ file 'TemplateName.docx'
100
+ }
101
+ }
102
+
103
+ Run with --backend flag only
104
+
105
+ $ sf butler pb export -t username@sandbox.com -i '61cfcb7b-10f7-****-****-***********'
106
+ -o 'export1/out1' -s 'TEST' -e 'https://www.pdfbutler.com'
107
+ -a 'YOUR_USERNAME + -ADMIN + ':' + YOUR_ADMIN_PASSWORD' -b
108
+
109
+ # Created:
110
+ Directory 'sfdc/export1'{
111
+ zip file'out1.zip'{
112
+ Directory 'ConfigTypes',
113
+ Directory 'DataSources',
114
+ file 'doc-config.json',
115
+ file 'TemplateName.docx'
116
+ }
117
+ }
118
+
119
+ Run with --unzip flag only
120
+
121
+ $ sf butler pb export -t username@sandbox.com -i '61cfcb7b-10f7-****-****-***********'
122
+ -o 'export1/out1' -s 'TEST' -e 'https://www.pdfbutler.com'
123
+ -a 'YOUR_USERNAME + -ADMIN + ':' + YOUR_ADMIN_PASSWORD' -u
124
+
125
+ # Created:
126
+ Directory 'sfdc/export1'{
127
+ file 'doc-config.json'
128
+ }
129
+
130
+ Run without optional flags
131
+
132
+ $ sf butler pb export -t username@sandbox.com -i '61cfcb7b-10f7-****-****-***********'
133
+ -o 'export1/out1' -s 'TEST' -e 'https://www.pdfbutler.com'
134
+ -a 'YOUR_USERNAME + -ADMIN + ':' + YOUR_ADMIN_PASSWORD'
135
+
136
+ # Created:
137
+ Directory 'sfdc/export1'{
138
+ zip file 'out1.zip'{
139
+ file 'doc-config.json'
140
+ }
141
+ }
142
+
143
+ FLAG DESCRIPTIONS
144
+ -t, --target <value>
145
+ Specifies the Salesforce org username credentials to connect to the target org where the PDF Butler configurations are stored.
146
+ This flag is required to authenticate and access the PDF Butler configurations.
147
+
148
+ -i, --id <value>
149
+ Specifies the unique ID of the PDF Butler configuration to be exported.
150
+ This ID uniquely identifies the configuration you want to export. It is a required parameter.
151
+
152
+ -o, --out <value>
153
+ Specifies the output file path for the exported configuration.
154
+ This flag is required to determine where the exported configuration will be saved.
155
+
156
+ -s, --stage <value>
157
+ Specifies the stage or environment for the export process.
158
+ This flag helps in categorizing or labeling the exported data according to different stages of your workflow.
159
+ It is a required parameter.
160
+
161
+ -e, --endpoint <value>
162
+ Specifies a URL endpoint for export. It is a required parameter.
163
+
164
+ -a, --auth-env-var <value>
165
+ Specifies the name of the environment variable containing authentication credentials.
166
+ This flag allows you to reference an environment variable that stores authentication information.
167
+ It is a required parameter.
168
+
169
+ -b, --backend
170
+ Enables backend export. If specified, the export operation may use a backend process for exporting the configuration.
171
+
172
+ -u, --unzip
173
+ Use this flag to indicate that the exported configuration should be unzipped.
174
+ If specified, the exported configuration will be unzipped after the export process is complete.
92
175
  ```
93
176
 
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
- ```
177
+ ## butler pb import
100
178
 
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.
179
+ Import PDF Butler configurations and related DataSource files.
102
180
 
103
- ```bash
104
- # Link your plugin to the sf cli
105
- sf plugins link .
106
- # To verify
107
- sf plugins
108
181
  ```
182
+ USAGE
183
+ $ sf butler pb import [--target | -t <value>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [--stage | -s <value>] [--config | -f <value>]
109
184
 
110
- ## Commands
111
-
112
- <!-- commands -->
113
-
114
- - [`sf hello world`](#sf-hello-world)
115
-
116
- ## `sf hello world`
185
+ FLAGS
186
+ -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
187
+ -a, --auth-env-var=<value> The environment variable name for authentication. (Required)
188
+ -e, --endpoint=<value> The URL endpoint for import. (Required)
189
+ -s, --stage=<value> The stage or environment for import. (Required)
190
+ -f, --config=<value> The path to the configuration file or directory containing configurations to import. (Required)
117
191
 
118
- Say hello either to the world or someone you know.
192
+ DESCRIPTION
193
+ Import DocConfigs and related DataSource files into your organization.
119
194
 
120
- ```
121
- USAGE
122
- $ sf hello world [--json] [-n <value>]
195
+ You must run this command from within a project.
123
196
 
124
- FLAGS
125
- -n, --name=<value> [default: World] The name of the person you'd like to say hello to.
197
+ To initiate an import, ensure you specify the necessary parameters, including the target org,
198
+ authentication environment variable, endpoint, stage, and the path to the configuration file or directory.
199
+ All the targets are required parameters.
126
200
 
127
- GLOBAL FLAGS
128
- --json Format output as json.
201
+ EXAMPLE
202
+ Import configurations ot an organization:
129
203
 
130
- DESCRIPTION
131
- Say hello either to the world or someone you know.
204
+ $ sf butler pb import -t username@sandbox.com -f ./sfdc/export1/out1
205
+ -e 'https://www.pdfbutler.com' -a 'YOUR_USERNAME + -ADMIN + ':' + YOUR_ADMIN_PASSWORD' -s 'UAT'
132
206
 
133
- Say hello either to the world or someone you know.
207
+ FLAG DESCRIPTIONS
208
+ -t, --target <value>
209
+ Specifies the Salesforce org username credentials to connect to the target
210
+ org where the PDF Butler configurations will be imported. This flag is required for authentication.
134
211
 
135
- EXAMPLES
136
- Say hello to the world:
212
+ -a, --auth-env-var <value>
213
+ Specifies the name of the environment variable containing authentication credentials.
214
+ This flag allows you to reference an environment variable that stores authentication information.
137
215
 
138
- $ sf hello world
216
+ -e, --endpoint <value>
217
+ Specifies a URL endpoint for import. Use this flag if you need to specify a custom import endpoint.
139
218
 
140
- Say hello to someone you know:
219
+ -s, --stage <value>
220
+ Specifies the stage or environment for the import process. This flag helps categorize or label the imported data.
141
221
 
142
- $ sf hello world --name Astro
222
+ -f, --config <value>
223
+ Specifies the path to the configuration file or directory containing configurations to import.
224
+ This flag is required to determine which configurations to import.
143
225
  ```
144
-
145
- <!-- commandsstop -->
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.2",
2
+ "version": "0.0.4",
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.2",
4
+ "version": "0.0.4",
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",