@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 +181 -101
- package/oclif.manifest.json +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,145 +1,225 @@
|
|
|
1
1
|
# pdfbutler-migration-cli
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/
|
|
3
|
+
[](https://www.npmjs.com/package/@pdfbutler/migration-cli) [](https://www.npmjs.com/package/@pdfbutler/migration-cli) [](https://raw.githubusercontent.com/salesforcecli/pdfbutler-migration-cli/main/LICENSE.txt)
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## About
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
2. Generate your plugin:
|
|
9
|
+
### Main features of the plugin:
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
17
|
-
git add . && git commit -m "chore: initial commit"
|
|
18
|
-
```
|
|
14
|
+
## Installation
|
|
19
15
|
|
|
20
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
23
|
+
If you've installed Node.js on your computer, you can use npm to install Salesforce CLI:
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
45
|
+
```
|
|
46
|
+
$ sf butler pb export [options]
|
|
47
|
+
$ sf butler pb import [options]
|
|
48
|
+
```
|
|
46
49
|
|
|
47
|
-
|
|
50
|
+
Now you can use this plugin to export and import PDF Butler configurations in Salesforce.
|
|
48
51
|
|
|
49
|
-
|
|
52
|
+
## Commands
|
|
50
53
|
|
|
51
|
-
|
|
54
|
+
## butler pb export
|
|
52
55
|
|
|
53
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
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
|
-
|
|
80
|
-
|
|
73
|
+
DESCRIPTION
|
|
74
|
+
Export DocConfigs and related DataSource files from your organization.
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
You must run this command from within a project.
|
|
83
77
|
|
|
84
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
91
|
-
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Run using local run file.
|
|
98
|
-
./bin/dev hello world
|
|
99
|
-
```
|
|
177
|
+
## butler pb import
|
|
100
178
|
|
|
101
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
125
|
-
|
|
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
|
-
|
|
128
|
-
|
|
201
|
+
EXAMPLE
|
|
202
|
+
Import configurations ot an organization:
|
|
129
203
|
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
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
|
-
|
|
136
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 -->
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdfbutler/migration-cli",
|
|
3
3
|
"description": "[](https://www.npmjs.com/package/pdfbutler-migration-cli) [](https://npmjs.org/package/pdfbutler-migration-cli) [](https://raw.githubusercontent.com/salesforcecli/pdfbutler-migration-cli/main/LICENSE.txt)",
|
|
4
|
-
"version": "0.0.
|
|
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",
|