@pdfbutler/migration-cli 0.0.11 → 0.0.12

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
@@ -7,7 +7,8 @@
7
7
  v0.0.11 updates: <br/>
8
8
 
9
9
  - '-b' flag disables backend export. If specified, the export operation doesn't use a PDF Butler backend process for exporting the configuration. By default, backend export is enabled.
10
- - New '-l --logs' flag. Use this flag to enable a more detailed log of the migration process..
10
+ - New '-l --logs' flag. Use this flag to enable a more detailed log of the migration process.
11
+ - New '-p --partial' flag. Use this flag to ignore invalid document configurations and allow the export of document configuration files with the backend part.
11
12
 
12
13
  ## About
13
14
 
@@ -15,7 +16,7 @@ v0.0.11 updates: <br/>
15
16
 
16
17
  ### Main features of the plugin:
17
18
 
18
- 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.
19
+ Export and import configurations: The plugin enables bulk 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.
19
20
  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.
20
21
 
21
22
  ## Installation
@@ -73,7 +74,7 @@ Export PDF Butler configurations.
73
74
 
74
75
  ```
75
76
  USAGE
76
- $ 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]
77
+ $ sf butler pb export [--target | -t <value>] [--id | -i <value>] [--out | -o <value>] [--stage | -s <value>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [--backend | -b] [--unzip | -u] [-l | --logs] [-p | --partial]
77
78
 
78
79
  FLAGS
79
80
  -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
@@ -86,6 +87,7 @@ FLAGS
86
87
  -u, --unzip Use this flag to unzip the exported configuration. (Optional)
87
88
  -b, --backend Use this flag to disable PDF Butler backend export. (Optional)
88
89
  -l, --logs Use it to get a more detailed log of migration process. (Optional)
90
+ -p, --partial Use this flag to ignore invalid document configurations and allow the export of document configuration files with the backend part.
89
91
 
90
92
  DESCRIPTION
91
93
  Export DocConfigs and related DataSource files from your organization.
@@ -97,29 +99,41 @@ DESCRIPTION
97
99
 
98
100
  To initiate an export, ensure you specify the necessary parameters, including the target org, PDF Butler docuemnt configuration ID,
99
101
  output path, define PDF Butler credentials for backend authentication, specify endpoints and stage.
100
- Additionally, you have the flexibility to enable or disable backend exports, get a more detailed log of migration process and even choose to unzip the exported configuration.
102
+ Additionally, you have the flexibility to enable or disable backend exports, ignore invalid document configurations and allow the export of document configuration files with the backend part, get a more detailed log of migration process and even choose to unzip the exported configuration.
101
103
 
102
104
  EXAMPLES
103
- Run with --unzip and --backend flags
105
+ Run with --backend flag only
104
106
 
105
107
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
106
108
  -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
107
- -a 'pdf_butler_user_name-ADMIN:admin_password' -b -u
109
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -b
110
+
111
+ # Console output:
112
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
108
113
 
109
114
  # Created:
110
115
  Directory 'sfdc/export_folder_name'{
111
- file 'docconfig.json'
116
+ file 'docconfig_id.json'
112
117
  }
113
118
 
114
- Run with --backend flag only
119
+ Run without --backend flag
115
120
 
116
121
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
117
122
  -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
118
- -a 'pdf_butler_user_name-ADMIN:admin_password' -b
123
+ -a 'pdf_butler_user_name-ADMIN:admin_password'
124
+
125
+ # Console output:
126
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
119
127
 
120
128
  # Created:
121
129
  Directory 'sfdc/export_folder_name'{
122
- file 'docconfig.json'
130
+ file 'docconfig_id.json',
131
+ zip file'docconfig_id.zip'{
132
+ Directory 'ConfigTypes',
133
+ Directory 'DataSources',
134
+ file 'doc-config.json',
135
+ file 'TemplateName.docx'
136
+ }
123
137
  }
124
138
 
125
139
  Run with --unzip flag only
@@ -128,10 +142,33 @@ EXAMPLES
128
142
  -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
129
143
  -a 'pdf_butler_user_name-ADMIN:admin_password' -u
130
144
 
145
+ # Console output:
146
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
147
+
131
148
  # Created:
132
149
  Directory 'sfdc/export_folder_name'{
133
- file 'docconfig.json',
134
- Unziped directory 'archive_name'{
150
+ file 'docconfig_id.json',
151
+ Unziped directory 'docconfig_id'{
152
+ Directory 'ConfigTypes',
153
+ Directory 'DataSources',
154
+ file 'doc-config.json',
155
+ file 'TemplateName.docx'
156
+ }
157
+ }
158
+
159
+ Run without --unzip flag
160
+
161
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
162
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
163
+ -a 'pdf_butler_user_name-ADMIN:admin_password'
164
+
165
+ # Console output:
166
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
167
+
168
+ # Created:
169
+ Directory 'sfdc/export_folder_name'{
170
+ file 'docconfig_id.json',
171
+ zip file'docconfig_id.zip'{
135
172
  Directory 'ConfigTypes',
136
173
  Directory 'DataSources',
137
174
  file 'doc-config.json',
@@ -143,7 +180,7 @@ EXAMPLES
143
180
 
144
181
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
145
182
  -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
146
- -a 'pdf_butler_user_name-ADMIN:admin_password' --logs
183
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -l
147
184
 
148
185
  # Console output:
149
186
  Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
@@ -155,8 +192,8 @@ EXAMPLES
155
192
 
156
193
  # Created:
157
194
  Directory 'sfdc/export_folder_name'{
158
- file 'docconfig.json',
159
- zip file'archive_name.zip'{
195
+ file 'docconfig_id.json',
196
+ zip file'docconfig_id.zip'{
160
197
  Directory 'ConfigTypes',
161
198
  Directory 'DataSources',
162
199
  file 'doc-config.json',
@@ -175,8 +212,96 @@ EXAMPLES
175
212
 
176
213
  # Created:
177
214
  Directory 'sfdc/export_folder_name'{
178
- file 'docconfig.json',
179
- zip file'archive_name.zip'{
215
+ file 'docconfig_id.json',
216
+ zip file'docconfig_id.zip'{
217
+ Directory 'ConfigTypes',
218
+ Directory 'DataSources',
219
+ file 'doc-config.json',
220
+ file 'TemplateName.docx'
221
+ }
222
+ }
223
+
224
+ Run with --partial flag only and docconfig with backend part
225
+
226
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
227
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
228
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -p
229
+
230
+ # Console output:
231
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
232
+
233
+ # Created:
234
+ Directory 'sfdc/export_folder_name'{
235
+ file 'docconfig_id.json',
236
+ zip file'docconfig_id.zip'{
237
+ Directory 'ConfigTypes',
238
+ Directory 'DataSources',
239
+ file 'doc-config.json',
240
+ file 'TemplateName.docx'
241
+ }
242
+ }
243
+
244
+ Run with --partial flag only and docconfig without backend part
245
+
246
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id_1, document_configuration_id_2'
247
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
248
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -p
249
+
250
+ # Console output:
251
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
252
+
253
+ # Created:
254
+ Directory 'sfdc/export_folder_name'{
255
+ file 'docconfig_id.json',
256
+ zip file'docconfig_id.zip'{
257
+ Directory 'ConfigTypes',
258
+ Directory 'DataSources',
259
+ file 'doc-config.json',
260
+ file 'TemplateName.docx'
261
+ }
262
+ }
263
+
264
+ Run without --partial flag and docconfig without backend part
265
+
266
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id_1, document_configuration_id_2'
267
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
268
+ -a 'pdf_butler_user_name-ADMIN:admin_password'
269
+
270
+ # Console output:
271
+ Error (1): One or more docConfigs have no backend.
272
+
273
+ Run with --backend flag and other optional flags
274
+
275
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
276
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
277
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -b [-u | -l | -p]
278
+
279
+ # Console output:
280
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
281
+
282
+ # Created:
283
+ Directory 'sfdc/export_folder_name'{
284
+ file 'docconfig_id.json'
285
+ }
286
+
287
+ Run with --unzip and --logs flags
288
+
289
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
290
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
291
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -u -l
292
+
293
+ # Console output:
294
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
295
+ DocConfig exported - 10061
296
+ Exported data from backend - 71940
297
+ Exported data from backend has been archived
298
+ User has read/write permissions
299
+ Archive unzipped and recorded locally
300
+
301
+ # Created:
302
+ Directory 'sfdc/export_folder_name'{
303
+ file 'docconfig_id.json',
304
+ Unziped directory 'docconfig_id'{
180
305
  Directory 'ConfigTypes',
181
306
  Directory 'DataSources',
182
307
  file 'doc-config.json',
@@ -190,10 +315,13 @@ EXAMPLES
190
315
  -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
191
316
  -a 'pdf_butler_user_name-ADMIN:admin_password'
192
317
 
318
+ # Console output:
319
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
320
+
193
321
  # Created:
194
322
  Directory 'sfdc/export_folder_name'{
195
- file 'docconfig.json',
196
- zip file'archive_name.zip'{
323
+ file 'docconfig_id.json',
324
+ zip file'docconfig_id.zip'{
197
325
  Directory 'ConfigTypes',
198
326
  Directory 'DataSources',
199
327
  file 'doc-config.json',
@@ -237,7 +365,10 @@ FLAG DESCRIPTIONS
237
365
  If specified, the exported configuration will be unzipped after the export process is complete.
238
366
 
239
367
  -l, --logs
240
- Use this flag to enable a more detailed log of the migration process.
368
+ Use this flag to get a more detailed log of migration process.
369
+
370
+ -p, --partial
371
+ Use this flag to ignore invalid document configurations and allow the export of document configuration files with the backend part.
241
372
  ```
242
373
 
243
374
  ## butler pb import
@@ -253,7 +384,8 @@ FLAGS
253
384
  -a, --auth-env-var=<value> The PDF Butler credentials for backend authentication. (Required)
254
385
  -e, --endpoint=<value> The URL PDF Butler endpoint for import. (Required)
255
386
  -s, --stage=<value> The CADMUS stage. (Required)
256
- -f, --config=<value> The path to the configuration file or directory containing configurations to import. (Required)
387
+ -f, --config=<value> The path to the directory containing configurations to import. (Required)
388
+ -l, --logs Use it to get a more detailed log of migration process. (Optional)
257
389
 
258
390
  DESCRIPTION
259
391
  Import DocConfigs and related DataSource files into your organization.
@@ -291,4 +423,140 @@ FLAG DESCRIPTIONS
291
423
  -f, --config <value>
292
424
  Specifies the path to the configuration file or directory containing configurations to import.
293
425
  This flag is required to determine which configurations to import.
426
+
427
+ -l, --logs
428
+ Use this flag to get a more detailed log of migration process.
429
+ ```
430
+
431
+ ## Typical errors and solutions
432
+
433
+ Typical errors that may occur when using the plugin and their solutions.
434
+
435
+ ### Export
436
+
437
+ - EPERM operation not permitted, chmod 'path_to_directory_to_export'.
438
+
439
+ ```
440
+ SOLUTION: error typically occurs due to insufficient permissions. To resolve it, make sure you have the necessary permissions to write to the specified directory. You can use the chmod command to change the directory permissions.
441
+
442
+ ```
443
+
444
+ - Error (1): Flag --target expects a value.
445
+
446
+ ```
447
+ SOLUTION: When using the --target flag, make sure to provide a valid Salesforce org username after the flag.
448
+
449
+ ```
450
+
451
+ - Error (1): No authorization information found for sfusername@sandbox.com.
452
+
453
+ ```
454
+ SOLUTION: Ensure that you have provided the correct Salesforce username. Double-check your credentials and ensure that they are properly configured in the plugin.
455
+
456
+ ```
457
+
458
+ - Error (1): Flag --id expects a value.
459
+
460
+ ```
461
+ SOLUTION: When using the --id flag, make sure to provide a valid value after the flag. It should specify the ID or identifiers required for the export.
462
+
463
+ ```
464
+
465
+ - Error (1): No matching Doc Configs ids found.
466
+
467
+ ```
468
+ SOLUTION: Verify that the Doc Config IDs you provided are correct and exist in the system.
469
+
470
+ ```
471
+
472
+ - Error (1): One or more docConfigs have no backend.
473
+
474
+ ```
475
+ SOLUTION: This error indicates that some document configurations are missing backend part. Review the document configurations and ensure that they are properly configured with the required server modules. Or you can add the "-p --partial" flag to enable exporting those docconfigs that have a backend part.
476
+
477
+ ```
478
+
479
+ - Error (1): Flag --out expects a value.
480
+
481
+ ```
482
+ SOLUTION: When using the --out flag, ensure that you specify a valid directory path where the output should be saved.
483
+
484
+ ```
485
+
486
+ - Error (1): Flag --stage expects a value.
487
+
488
+ ```
489
+ SOLUTION: When using the --stage flag, make sure to provide a valid CADMUS stage.
490
+
491
+ ```
492
+
493
+ - Error (1): Flag --auth-env-var expects a value.
494
+
495
+ ```
496
+ SOLUTION: When using the --auth-env-var flag, provide the PDF Butler credentials for backend authentication. Ensure that the PDF Butler credentials is correctly set and contains the required credentials (Username and Admin password).
497
+
498
+ ```
499
+
500
+ - Error (1): Flag --endpoint expects a value.
501
+
502
+ ```
503
+ SOLUTION: When using the --endpoint flag, specify the correct endpoint URL as the value.
504
+
505
+ ```
506
+
507
+ - Error (1): Response code 401 (Unauthorized).
508
+
509
+ ```
510
+ SOLUTION: This error indicates that your request lacks proper authentication. Double-check your credentials like PDF Butler Username or PDF Butler Admin password. Correct example: 'Username-ADMIN:Admin_password'
511
+
512
+ ```
513
+
514
+ - Error (1): System.LicenseException: The Apex Class RestImportDocConfig is part of the AppExchange Package PDF Butler, and requires a license to use.
515
+
516
+ ```
517
+ SOLUTION: To resolve this error, you need to acquire the required license for the AppExchange Package PDF Butler to use the plugin command. Contact your Salesforce administrator or license provider to obtain the necessary license.
518
+
519
+ ```
520
+
521
+ ### Import
522
+
523
+ - Error (1): Flag --target expects a value.
524
+
525
+ ```
526
+ SOLUTION: When using the --target flag, make sure to provide a valid Salesforce org username after the flag.
527
+ ```
528
+
529
+ - Error (1): Flag --auth-env-var expects a value.
530
+
531
+ ```
532
+ SOLUTION:
533
+
534
+ ```
535
+
536
+ - Error (1): Flag --auth-env-var expects a value.
537
+
538
+ ```
539
+ SOLUTION: When using the --auth-env-var flag, provide the PDF Butler credentials for backend authentication. Ensure that the PDF Butler credentials is correctly set and contains the required credentials (Username and Admin password).
540
+
541
+ ```
542
+
543
+ - Error (1): Flag --endpoint expects a value.
544
+
545
+ ```
546
+ SOLUTION: When using the --endpoint flag, specify the correct endpoint URL as the value.
547
+
548
+ ```
549
+
550
+ - Error (1): Flag --stage expects a value.
551
+
552
+ ```
553
+ SOLUTION: When using the --stage flag, make sure to provide a valid CADMUS stage.
554
+
555
+ ```
556
+
557
+ - Error (1): Flag --config expects a value.
558
+
559
+ ```
560
+ SOLUTION: When using the --config flag, ensure that you specify a valid directory path to docconfigs.
561
+
294
562
  ```
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.11",
2
+ "version": "0.0.12",
3
3
  "commands": {
4
4
  "butler:pb:export": {
5
5
  "id": "butler:pb:export",
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.11",
4
+ "version": "0.0.12",
5
5
  "script": {
6
6
  "postinstall": "sf plugins link @pdfbutler/migration-cli"
7
7
  },