@pdfbutler/migration-cli 0.0.27 → 0.0.29

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 (61) hide show
  1. package/README.md +332 -45
  2. package/lib/commands/butler/pb/admincredentials.js +37 -37
  3. package/lib/commands/butler/pb/admincredentials.js.map +1 -1
  4. package/lib/commands/butler/pb/adminsettings.d.ts +1 -2
  5. package/lib/commands/butler/pb/adminsettings.js +32 -32
  6. package/lib/commands/butler/pb/adminsettings.js.map +1 -1
  7. package/lib/commands/butler/pb/export.d.ts +12 -4
  8. package/lib/commands/butler/pb/export.js +333 -200
  9. package/lib/commands/butler/pb/export.js.map +1 -1
  10. package/lib/commands/butler/pb/exportdatasource.d.ts +28 -0
  11. package/lib/commands/butler/pb/exportdatasource.js +163 -0
  12. package/lib/commands/butler/pb/exportdatasource.js.map +1 -0
  13. package/lib/commands/butler/pb/exportpack.d.ts +15 -0
  14. package/lib/commands/butler/pb/exportpack.js +282 -68
  15. package/lib/commands/butler/pb/exportpack.js.map +1 -1
  16. package/lib/commands/butler/pb/import.d.ts +17 -3
  17. package/lib/commands/butler/pb/import.js +403 -192
  18. package/lib/commands/butler/pb/import.js.map +1 -1
  19. package/lib/commands/butler/pb/importdatasource.d.ts +31 -0
  20. package/lib/commands/butler/pb/importdatasource.js +252 -0
  21. package/lib/commands/butler/pb/importdatasource.js.map +1 -0
  22. package/lib/commands/butler/pb/importpack.d.ts +23 -0
  23. package/lib/commands/butler/pb/importpack.js +391 -69
  24. package/lib/commands/butler/pb/importpack.js.map +1 -1
  25. package/lib/commands/butler/sb/export/signtemplate.d.ts +23 -0
  26. package/lib/commands/butler/sb/export/signtemplate.js +111 -0
  27. package/lib/commands/butler/sb/export/signtemplate.js.map +1 -0
  28. package/lib/commands/butler/sb/import/signtemplate.d.ts +23 -0
  29. package/lib/commands/butler/sb/import/signtemplate.js +108 -0
  30. package/lib/commands/butler/sb/import/signtemplate.js.map +1 -0
  31. package/lib/utils/authentication.d.ts +3 -1
  32. package/lib/utils/authentication.js +13 -17
  33. package/lib/utils/authentication.js.map +1 -1
  34. package/lib/utils/constants.d.ts +134 -89
  35. package/lib/utils/constants.js +65 -20
  36. package/lib/utils/constants.js.map +1 -1
  37. package/lib/utils/extract-templates.d.ts +1 -0
  38. package/lib/utils/extract-templates.js +89 -0
  39. package/lib/utils/extract-templates.js.map +1 -0
  40. package/lib/utils/id-map.d.ts +1 -0
  41. package/lib/utils/id-map.js +22 -0
  42. package/lib/utils/id-map.js.map +1 -0
  43. package/lib/utils/ids.d.ts +2 -0
  44. package/lib/utils/ids.js +21 -0
  45. package/lib/utils/ids.js.map +1 -0
  46. package/lib/utils/logger.d.ts +2 -1
  47. package/lib/utils/logger.js +15 -7
  48. package/lib/utils/logger.js.map +1 -1
  49. package/lib/utils/pack-docconfigs.d.ts +4 -0
  50. package/lib/utils/pack-docconfigs.js +77 -0
  51. package/lib/utils/pack-docconfigs.js.map +1 -0
  52. package/messages/butler.pb.export.md +4 -0
  53. package/messages/butler.pb.exportdatasource.md +51 -0
  54. package/messages/butler.pb.exportpack.md +24 -0
  55. package/messages/butler.pb.import.md +4 -0
  56. package/messages/butler.pb.importdatasource.md +51 -0
  57. package/messages/butler.pb.importpack.md +24 -0
  58. package/messages/butler.sb.export.signtemplate.md +35 -0
  59. package/messages/butler.sb.import.signtemplate.md +35 -0
  60. package/oclif.manifest.json +437 -46
  61. package/package.json +223 -215
package/README.md CHANGED
@@ -6,38 +6,87 @@
6
6
 
7
7
  v0.0.11 updates: <br/>
8
8
 
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
- - '-l --logs' flag. Use this flag to enable a more detailed log of the migration process.
11
- - '-p --partial' flag. Use this flag to ignore invalid document configurations and allow the export of document configuration files with the backend part.
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
+ - `-l | --logs` flag. Use this flag to enable a more detailed log of the migration process.
11
+ - `-p | --partial` flag. Use this flag to ignore invalid document configurations and allow the export of document configuration files with the backend part.
12
12
 
13
13
  v0.0.14 updates: <br/>
14
14
 
15
- - The '-i --id' flag has been added to the import command to specify the IDs of the PDF Butler document configurations that require importing. This is a required flag.
15
+ - The `-i | --id` flag has been added to the import command to specify the IDs of the PDF Butler document configurations that require importing. This is a required flag.
16
16
 
17
17
  v0.0.17 updates: <br/>
18
18
 
19
- - The '-c' or '--clone' flag has been added to the import command. Use '-c' or '--clone' to allow inserting new DocConfigs instead of updating existing ones.
19
+ - The `-c | --clone` flag has been added to the import command. Use `-c | --clone` to allow inserting new DocConfigs instead of updating existing ones.
20
20
 
21
- v.0.0.18 updates: <br/>
21
+ v0.0.18 updates: <br/>
22
22
  This release introduces several new commands to enhance the management and deployment of PDFButler Packs and administrative settings in your org. Here’s a breakdown of the new commands and their functionality:
23
23
 
24
- - 'exportpack'. Allows you to export a PDFButler Pack from the org to an external file.
25
- - 'importpack'. Facilitates importing a previously exported PDFButler Pack into your org.
26
- - 'adminsettings'. Allows you to configure critical PDFButler settings such as the service URL, region, and stage.
27
- - 'admincredentials'. Enables you to securely provide or update the PDFButler admin credentials.
24
+ - `exportpack` Allows you to export a PDFButler Pack from the org to an external file.
25
+ - `importpack` Facilitates importing a previously exported PDFButler Pack into your org.
26
+ - `adminsettings` Allows you to configure critical PDFButler settings such as the service URL, region, and stage.
27
+ - `admincredentials` Enables you to securely provide or update the PDFButler admin credentials.
28
28
 
29
- v.0.0.20 updates <br/>
29
+ v0.0.20 updates: <br/>
30
30
  This release introduces an alternative authentication method to enhance flexibility when connecting to Salesforce. The new functionality includes support for session-based authentication, allowing users to connect without relying solely on username.
31
31
  Additionally, two new optional flags, --session and --instance, have been added to all commands to support this authentication method:
32
32
 
33
- - '--session'. Allows you to provide a Salesforce Session Id for authentication.
34
- - '--instance'. Specifies the Salesforce Instance URL for authentication.
33
+ - `--session` Allows you to provide a Salesforce Session Id for authentication.
34
+ - `--instance` Specifies the Salesforce Instance URL for authentication.
35
+
36
+ v.0.0.24 updates: <br/>
37
+ This release introduces enhancements to filename handling, improving compatibility and usability when working with zipped files, particularly in Windows environments.
38
+
39
+ - `--cut` — Trim filenames to a maximum of 150 characters to prevent issues when extracting a zipped file on Windows, as Windows Explorer cannot support file paths longer than 255 characters.
40
+ - `--shortpaths` — The filename is just the DC name (drop the Stage and long DC Id in the filename).
41
+
42
+ v0.0.28 updates: <br/>
43
+ DocConfigs with Templates — Export & Import Support
44
+
45
+ - Export and import operations now support DocConfigs together with their associated template DocConfigs.
46
+ - Use `-m | --templates` to include templates during both export and import.
47
+
48
+ DataSource — Export & Import Support
49
+
50
+ - DataSource import requires PDF Butler package version v1.505 or higher.
51
+ - `exportdatasource` — Exports PDF Butler DataSources from the org.
52
+ - `importdatasource` — Imports PDF Butler DataSources into the org from JSON
53
+
54
+ SB Sign Request Template — Export & Import Support
55
+
56
+ - `butler:sb:export:signtemplate` — Exports Sign Request Templates from the org and saves them as JSON files for backup or migration.
57
+ - `butler:sb:import:signtemplate` — Imports Sign Request Templates into the org from previously exported JSON files
58
+
59
+ v0.0.29 updates: <br/>
60
+ Export Pack — DocConfig Export Modes
61
+ - `exportpack` now supports DocConfig export modes via `-d | --docconfig`:
62
+ - `none` (default) or without flag: export only pack JSON.
63
+ - `lead`: export only leading DocConfig (without pack JSON).
64
+ - `pack`: export only pack DocConfigs (without leading and without pack JSON).
65
+ - `full`: export both pack JSON and all related DocConfigs.
66
+
67
+ Export Pack — Backend Bundle Support
68
+ - `exportpack` now supports backend bundle export for DocConfigs with:
69
+ - `-a | --auth-env-var`, `-e | --endpoint`, `-s | --stage`
70
+ - `-u | --unzip` to extract backend files instead of writing zip archives
71
+ - `-m | --templates` to recursively export template DocConfigs
72
+
73
+ Import Pack — DocConfig Import Modes
74
+ - `importpack` now supports selective DocConfig import mode via `-d | --docconfig`:
75
+ - `pack`: import only pack DocConfigs.
76
+ - `lead`: import only leading DocConfig.
77
+ - `full` (default): import DocConfigs and then import the pack.
78
+
79
+ Import Pack — Backend Bundle Support
80
+ - `importpack` backend/template import enhancements:
81
+ - `-a | --auth-env-var`, `-e | --endpoint`, `-s | --stage` for backend upload.
82
+ - `-m | --templates` to include template dependency DocConfigs.
83
+ - `-c | --clone` to insert new DocConfigs instead of updating existing ones.
84
+
85
+ Backend Export Modes
86
+ - `-b | --backend` now supports modes: `full` (default, export SFDC + backend), `only` (backend only), and `none` (SFDC only).
87
+ - Backward compatibility: using `-b` without a value is interpreted as `--backend none`.
35
88
 
36
- v.0.0.24 updates <br/>
37
- This release introduces enhancements to filename handling, improving compatibility and usability when working with zipped files, particularly in Windows environments.
38
89
 
39
- - '--cut'. Trim filenames to a maximum of 150 characters to prevent issues when extracting a zipped file on Windows, as Windows Explorer cannot support file paths longer than 255 characters.
40
- - '--shortpaths'. The filename is just the DC name (drop the Stage and long DC Id in the filename).
41
90
  ## About
42
91
 
43
92
  @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.
@@ -62,7 +111,7 @@ If you've installed Node.js on your computer, you can use npm to install Salesfo
62
111
  npm install @salesforce/cli --global
63
112
  ```
64
113
 
65
- For install the plugin run:
114
+ For installation the plugin runs:
66
115
 
67
116
  ```
68
117
  sf plugins install @pdfbutler/migration-cli
@@ -105,6 +154,9 @@ $ sf butler pb exportpack [options]
105
154
  $ sf butler pb importpack [options]
106
155
  $ sf butler pb adminsettings [options]
107
156
  $ sf butler pb admincredentials [options]
157
+
158
+ $ sf butler sb export signtemplate [options]
159
+ $ sf butler sb import signtemplate [options]
108
160
  ```
109
161
 
110
162
  ## Recommended CLI Shell:
@@ -119,13 +171,59 @@ One of the common errors in Windows Command Prompt is incorrectly parsing comman
119
171
 
120
172
  ## Commands
121
173
 
174
+ ## butler sb export signtemplate
175
+
176
+ Export Sign Request Template records from your organization.
177
+
178
+ ```
179
+ USAGE
180
+ $ sf butler sb export signtemplate -i <value> -f <value> [--json] [-t <value>] [-l] [--session <value>] [--instance <value>]
181
+
182
+ FLAGS
183
+ -t, --target=<value> The Salesforce org username credentials to connect to the target org.
184
+ -i, --id=<value> The Customer Template ID to export. For bulk export, enter multiple IDs separated by whitespaces. (Required)
185
+ -f, --folder=<value> The output root folder path. Files will be saved to the signRequestTemplates subfolder. (Required)
186
+ -l, --logs Enable detailed logs for the export process.
187
+ --session=<value> Salesforce Session ID for authentication.
188
+ --instance=<value> Salesforce Instance URL for authentication.
189
+
190
+ DESCRIPTION
191
+ Export Sign Request Template records from your organization.
192
+
193
+ EXAMPLES
194
+ $ sf butler:sb:export:signtemplate -t my-org -i "a0Bxx0000000011 a0Bxx0000000012" -f "./export/sb"
195
+ ```
196
+
197
+ ## butler sb import signtemplate
198
+
199
+ Import Sign Request Template records into your organization.
200
+
201
+ ```
202
+ USAGE
203
+ $ sf butler sb import signtemplate -i <value> -f <value> [--json] [-t <value>] [-l] [--session <value>] [--instance <value>]
204
+
205
+ FLAGS
206
+ -t, --target=<value> The Salesforce org username credentials to connect to the target org.
207
+ -i, --id=<value> The Customer Template ID to import. For bulk import, enter multiple IDs separated by whitespaces. (Required)
208
+ -f, --folder=<value> The export root folder path that contains the signRequestTemplates subfolder. (Required)
209
+ -l, --logs Enable detailed logs for the import process.
210
+ --session=<value> Salesforce Session ID for authentication.
211
+ --instance=<value> Salesforce Instance URL for authentication.
212
+
213
+ DESCRIPTION
214
+ Import Sign Request Template records into your organization.
215
+
216
+ EXAMPLES
217
+ $ sf butler:sb:import:signtemplate -t my-org -i "a0Bxx0000000011" -f "./export/sb"
218
+ ```
219
+
122
220
  ## butler pb export
123
221
 
124
222
  Export PDF Butler configurations.
125
223
 
126
224
  ```
127
225
  USAGE
128
- $ 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] [--session <value>] [--instance <value>]
226
+ $ 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 <value>] [--unzip | -u] [-l | --logs] [-p | --partial] [-m | --templates] [--session <value>] [--instance <value>]
129
227
 
130
228
  FLAGS
131
229
  -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
@@ -142,9 +240,10 @@ FLAGS
142
240
  CA: https://ca1.pdfbutler.com
143
241
 
144
242
  -u, --unzip Use this flag to unzip the exported configuration. (Optional)
145
- -b, --backend Use this flag to disable PDF Butler backend export. (Optional)
243
+ -b, --backend=<value> Backend export mode: full | only | none. (Optional, default: full)
146
244
  -l, --logs Use it to get a more detailed log of migration process. (Optional)
147
245
  -p, --partial Use this flag to ignore invalid document configurations and allow the export of document configuration files with the backend part. (Optional)
246
+ -m, --templates Include template DocConfigs in the export. (Optional)
148
247
  --session=<value> This flag is used to provide a Salesforce Session ID for authentication.
149
248
  --instance=<value> This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
150
249
 
@@ -163,34 +262,39 @@ DESCRIPTION
163
262
  get a more detailed log of migration process and even choose to unzip the exported configuration.
164
263
 
165
264
  EXAMPLES
166
- Run with --backend flag
265
+ Run with --backend full (default)
167
266
 
168
267
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
169
268
  -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
170
- -a 'pdf_butler_user_name-ADMIN:admin_password' -b
269
+ -a 'pdf_butler_user_name-ADMIN:admin_password' --backend full
171
270
 
172
271
  # Console output:
173
272
  Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
174
273
 
175
274
  # Created:
176
- Directory 'export_folder_name/archive_or_folder_name/sfdc'{
177
- file 'docconfig_id.json'
275
+ Directory 'export_folder_name/archive_or_folder_name'{
276
+ Directory 'sfdc'{
277
+ file 'docconfig_id.json',
278
+ },
279
+ zip file'docconfig_id.zip'{
280
+ Directory 'ConfigTypes',
281
+ Directory 'DataSources',
282
+ file 'doc-config.json',
283
+ file 'TemplateName.docx'
284
+ }
178
285
  }
179
286
 
180
- Run without --backend flag
287
+ Run with --backend only
181
288
 
182
289
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
183
290
  -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
184
- -a 'pdf_butler_user_name-ADMIN:admin_password'
291
+ -a 'pdf_butler_user_name-ADMIN:admin_password' --backend only
185
292
 
186
293
  # Console output:
187
294
  Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
188
295
 
189
296
  # Created:
190
297
  Directory 'export_folder_name/archive_or_folder_name'{
191
- Directory 'sfdc'{
192
- file 'docconfig_id.json',
193
- },
194
298
  zip file'docconfig_id.zip'{
195
299
  Directory 'ConfigTypes',
196
300
  Directory 'DataSources',
@@ -199,6 +303,20 @@ EXAMPLES
199
303
  }
200
304
  }
201
305
 
306
+ Run with --backend none
307
+
308
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
309
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST'
310
+ --backend none
311
+
312
+ # Console output:
313
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
314
+
315
+ # Created:
316
+ Directory 'export_folder_name/archive_or_folder_name/sfdc'{
317
+ file 'docconfig_id.json'
318
+ }
319
+
202
320
  Run with --unzip flag
203
321
 
204
322
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
@@ -211,7 +329,7 @@ EXAMPLES
211
329
  # Created:
212
330
  Directory 'export_folder_name/archive_or_folder_name'{
213
331
  Directory 'sfdc'{
214
- file 'docconfig_id.json',
332
+ file 'docconfig_id.json'
215
333
  },
216
334
  Unziped directory 'docconfig_id'{
217
335
  Directory 'ConfigTypes',
@@ -352,8 +470,8 @@ FLAG DESCRIPTIONS
352
470
  It is a required parameter.
353
471
 
354
472
  -b, --backend
355
- Disables backend export. If specified, the export operation doesn't use a PDF Butler backend process for exporting the configuration.
356
- By default, backend export is enabled.
473
+ Controls what to export: full (SFDC + backend), only (backend only), none (SFDC only).
474
+ Default value is full. For backward compatibility, using -b without a value is treated as --backend none.
357
475
 
358
476
  -u, --unzip
359
477
  Use this flag to indicate that the exported configuration should be unzipped.
@@ -365,9 +483,12 @@ FLAG DESCRIPTIONS
365
483
  -p, --partial
366
484
  Use this flag to ignore invalid document configurations and allow the export of document configuration files with the backend part.
367
485
 
486
+ -m, --templates
487
+ Include template DocConfigs in the export.
488
+
368
489
  --session
369
490
  This flag is used to provide a Salesforce Session ID for authentication.
370
-
491
+
371
492
  --instance
372
493
  This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
373
494
  ```
@@ -378,7 +499,7 @@ Import PDF Butler document configurations and related DataSource files.
378
499
 
379
500
  ```
380
501
  USAGE
381
- $ sf butler pb import [--target | -t <value>] [--id | -i <value>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [--stage | -s <value>] [--config | -f <value>] [-c | --clone] [--session <value>] [--instance <value>]
502
+ $ sf butler pb import [--target | -t <value>] [--id | -i <value>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [--stage | -s <value>] [--config | -f <value>] [-c | --clone] [-m | --templates] [--session <value>] [--instance <value>]
382
503
 
383
504
  FLAGS
384
505
  -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
@@ -396,6 +517,7 @@ FLAGS
396
517
  -f, --config=<value> The path to the directory containing configurations to import. (Required)
397
518
  -l, --logs Use it to get a more detailed log of migration process. (Optional)
398
519
  -c, --clone Use this flag to disables the update of existing docconfigs and allows to create new ones. (Optional)
520
+ -m, --templates Include template DocConfigs in the import. (Optional)
399
521
  --session=<value> This flag is used to provide a Salesforce Session ID for authentication.
400
522
  --instance=<value> This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
401
523
 
@@ -412,7 +534,7 @@ EXAMPLE
412
534
  Import configurations with --clone flag to the organization:
413
535
 
414
536
  $ sf butler pb import -t sfusername@sandbox.com -i 'document_configuration_id' -f .export_folder_name/archive_or_folder_name
415
- -e 'https://eu1.pdfbutler.com' -a 'pdf_butler_user_name-ADMIN:admin_password' -s 'UAT' -c
537
+ -e 'https://eu1.pdfbutler.com' -a 'pdf_butler_user_name-ADMIN:admin_password' -s 'UAT' -c -m
416
538
 
417
539
  #Imported:
418
540
  Insert a new Doc config with a unique 'customerDocumentConfigId'.
@@ -465,13 +587,96 @@ FLAG DESCRIPTIONS
465
587
  -c, --clone
466
588
  Use this flag to disables the update of existing docconfigs and allows to create new ones. (Optional)
467
589
 
590
+ -m, --templates
591
+ Include template DocConfigs in the import.
592
+
468
593
  --session
469
594
  This flag is used to provide a Salesforce Session ID for authentication.
470
-
595
+
471
596
  --instance
472
597
  This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
473
598
  ```
474
599
 
600
+ ## butler pb exportdatasource
601
+
602
+ Export PDF Butler DataSource files.
603
+
604
+ ```
605
+ USAGE
606
+ $ sf butler pb exportdatasource [--target | -t <value>] [--id | -i <value>] [--folder | -f <value>] [--stage | -s <value>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [-l | --logs] [-p | --parents] [--session <value>] [--instance <value>]
607
+
608
+ FLAGS
609
+ -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Optional)
610
+ -i, --id=<value> The DataSource ID(s) to export. For bulk export, enter multiple IDs separated by commas or spaces. (Required)
611
+ -f, --folder=<value> The output folder where DataSource JSON files will be saved. (Required)
612
+ -s, --stage=<value> The CADMUS stage. (Required)
613
+ -a, --auth-env-var=<value> The PDF Butler credentials for backend authentication. (Optional)
614
+ -e, --endpoint=<value> The URL PDF Butler endpoint for export. (Optional)
615
+ -l, --logs Use it to get a more detailed log of migration process. (Optional)
616
+ -p, --parents Automatically export parent DataSources recursively when detected. (Optional)
617
+ --session=<value> This flag is used to provide a Salesforce Session ID for authentication.
618
+ --instance=<value> This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
619
+
620
+ DESCRIPTION
621
+ Export DataSources from your organization into JSON files.
622
+
623
+ The command writes files into:
624
+ ./<folder>/sfdc/<DataSourceId>.json
625
+
626
+ EXAMPLES
627
+ Export a single DataSource:
628
+
629
+ $ sf butler pb exportdatasource -t sfusername@sandbox.com -i '00Dxxxxxxxxxxxx' -f 'export' -s 'TEST'
630
+
631
+ Export multiple DataSources:
632
+
633
+ $ sf butler pb exportdatasource -t sfusername@sandbox.com -i '00Dxxx, 00Dyyy' -f 'export' -s 'TEST' -l
634
+
635
+ Export with parent DataSources:
636
+
637
+ $ sf butler pb exportdatasource -t sfusername@sandbox.com -i '00Dxxx' -f 'export' -s 'TEST' -p
638
+ ```
639
+
640
+ ## butler pb importdatasource
641
+
642
+ Import PDF Butler DataSource files.
643
+
644
+ ```
645
+ USAGE
646
+ $ sf butler pb importdatasource [--target | -t <value>] [--id | -i <value>] [--folder | -f <value>] [--stage | -s <value>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [-l | --logs] [-p | --parents] [--session <value>] [--instance <value>]
647
+
648
+ FLAGS
649
+ -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Optional)
650
+ -i, --id=<value> The DataSource ID(s) to import. For bulk import, enter multiple IDs separated by commas or spaces. (Required)
651
+ -f, --folder=<value> The folder that contains exported DataSource JSON files. (Required)
652
+ -s, --stage=<value> The CADMUS stage. (Optional)
653
+ -a, --auth-env-var=<value> The PDF Butler credentials for backend authentication. (Optional)
654
+ -e, --endpoint=<value> The URL PDF Butler endpoint for import. (Optional)
655
+ -l, --logs Use it to get a more detailed log of migration process. (Optional)
656
+ -p, --parents Resolve and import parent DataSources first, then child DataSources. (Optional)
657
+ --session=<value> This flag is used to provide a Salesforce Session ID for authentication.
658
+ --instance=<value> This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
659
+
660
+ DESCRIPTION
661
+ Import DataSources from JSON files into your organization.
662
+
663
+ The command reads files from:
664
+ ./<folder>/sfdc/<DataSourceId>.json
665
+
666
+ EXAMPLES
667
+ Import a single DataSource:
668
+
669
+ $ sf butler pb importdatasource -t sfusername@sandbox.com -i '00Dxxxxxxxxxxxx' -f 'export' -s 'TEST'
670
+
671
+ Import multiple DataSources:
672
+
673
+ $ sf butler pb importdatasource -t sfusername@sandbox.com -i '00Dxxx, 00Dyyy' -f 'export' -s 'TEST' -l
674
+
675
+ Import with parent DataSources first:
676
+
677
+ $ sf butler pb importdatasource -t sfusername@sandbox.com -i '00Dxxx' -f 'export' -s 'TEST' -p
678
+ ```
679
+
475
680
  ## butler pb exportpack
476
681
 
477
682
  <span style="color: red;">Important!</span> Make sure you have installed PDF Butler version equal or higher than v1.440. <br/>
@@ -480,7 +685,7 @@ Export PDF Butler Pack.
480
685
 
481
686
  ```
482
687
  USAGE
483
- $ sf butler pb exportpack [--target | -t <value>] [--pack | -p <value>] [--out | -o <value>] [--logs | -l] [--session <value>] [--instance <value>]
688
+ $ sf butler pb exportpack [--target | -t <value>] [--pack | -p <value>] [--out | -o <value>] [--logs | -l] [--docconfig | -d <none|pack|lead|full>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [--stage | -s <value>] [--unzip | -u] [--templates | -m] [--session <value>] [--instance <value>]
484
689
 
485
690
  FLAGS
486
691
  -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
@@ -488,6 +693,13 @@ FLAGS
488
693
  For bulk export, enter multiple Customer Pack Ids separated by commas. (Required)
489
694
  -o, --out=<value> The value specifies the path to the folder with the exported configuration and archive name. (Required)
490
695
  -l, --logs Use it to get a more detailed log of migration process. (Optional)
696
+ -d, --docconfig=<none|pack|lead|full>
697
+ Export mode for related DocConfigs. (Optional, default: none)
698
+ -a, --auth-env-var=<value> The PDF Butler credentials for backend authentication. (Optional)
699
+ -e, --endpoint=<value> The URL PDF Butler endpoint for backend export. (Optional)
700
+ -s, --stage=<value> The CADMUS stage for backend export. (Optional)
701
+ -u, --unzip Unzip backend export instead of saving DocConfig archives as zip files. (Optional)
702
+ -m, --templates Include template DocConfigs for recursive export. (Optional)
491
703
  --session=<value> This flag is used to provide a Salesforce Session ID for authentication.
492
704
  --instance=<value> This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
493
705
 
@@ -523,7 +735,7 @@ EXAMPLES
523
735
  Directory 'export_folder_name/folder_name/sfdc'{
524
736
  file 'customer_pack_id.json'
525
737
  }
526
-
738
+
527
739
  Export multiple packs:
528
740
 
529
741
  $ sf butler pb exportpack -t sfusername@sandbox.com -p 'customer_pack_id1, customer_pack_id2'
@@ -554,6 +766,49 @@ EXAMPLES
554
766
  file 'customer_pack_id2.json'
555
767
  }
556
768
 
769
+ Export only leading DocConfig (without pack JSON):
770
+
771
+ $ sf butler pb exportpack -p customer_pack_id
772
+ -t sfusername@sandbox.com -a pdf_butler_user-ADMIN:admin_password
773
+ -e https://eu1.pdfbutler.com -s TEST -o ./export/pack -l
774
+ --session <session_id> --instance <instance_url> -u -m -d lead
775
+
776
+ # Created:
777
+ Directory './export/pack/sfdc'{
778
+ file 'leading_docconfig_id.json'
779
+ }
780
+
781
+ Export only pack DocConfigs (without leading and without pack JSON):
782
+
783
+ $ sf butler pb exportpack -p customer_pack_id
784
+ -t sfusername@sandbox.com -a pdf_butler_user-ADMIN:admin_password
785
+ -e https://eu1.pdfbutler.com -s TEST -o ./export/pack -l
786
+ --session <session_id> --instance <instance_url> -u -m -d pack
787
+
788
+ # Created:
789
+ Directory './export/pack/sfdc'{
790
+ file 'pack_docconfig_id_1.json'
791
+ file 'pack_docconfig_id_2.json'
792
+ }
793
+
794
+ Export full content (pack JSON + DocConfigs + backend zips):
795
+
796
+ $ bin\dev butler:pb:exportpack -p customer_pack_id
797
+ -t sfusername@sandbox.com -a pdf_butler_user-ADMIN:admin_password
798
+ -e https://eu1.pdfbutler.com -s TEST -o ./export/pack -l
799
+ --session <session_id> --instance <instance_url> -u -m -d full
800
+
801
+ # Created:
802
+ Directory './export/pack'{
803
+ Directory 'sfdc'{
804
+ file 'customer_pack_id.json'
805
+ file 'docconfig_id.json'
806
+ file 'template_docconfig_id.json'
807
+ },
808
+ file 'docconfig_id.zip'
809
+ file 'template_docconfig_id.zip'
810
+ }
811
+
557
812
  FLAG DESCRIPTIONS
558
813
  -t, --target <value>
559
814
  Specifies the Salesforce org username credentials to connect to the target
@@ -571,7 +826,7 @@ FLAG DESCRIPTIONS
571
826
 
572
827
  --session
573
828
  This flag is used to provide a Salesforce Session ID for authentication.
574
-
829
+
575
830
  --instance
576
831
  This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
577
832
  ```
@@ -584,7 +839,7 @@ Import PDF Butler Pack.
584
839
 
585
840
  ```
586
841
  USAGE
587
- $ sf butler pb importpack [--target | -t <value>] [--pack | -p <value>] [--folder | -f <value>] [-logs | -l] [--session <value>] [--instance <value>]
842
+ $ sf butler pb importpack [--target | -t <value>] [--pack | -p <value>] [--folder | -f <value>] [-logs | -l] [--docconfig | -d <pack|lead|full>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [--stage | -s <value>] [--templates | -m] [--clone | -c] [--session <value>] [--instance <value>]
588
843
 
589
844
  FLAGS
590
845
  -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
@@ -592,6 +847,14 @@ FLAGS
592
847
  For bulk export, enter multiple Customer Pack Ids separated by commas. (Required)
593
848
  -f, --folder=<value> The value specifies the path to the folder with the exported packs. (Required)
594
849
  -l, --logs Use it to get a more detailed log of migration process. (Optional)
850
+ -d, --docconfig=<pack|lead|full>
851
+ Import mode for related DocConfigs. (Optional, default: full)
852
+ Note: if mode is not full, only DocConfigs are imported and pack import is skipped.
853
+ -a, --auth-env-var=<value> The PDF Butler credentials for backend upload. (Optional)
854
+ -e, --endpoint=<value> The URL PDF Butler endpoint for backend upload. (Optional)
855
+ -s, --stage=<value> The CADMUS stage for backend upload. (Optional)
856
+ -m, --templates Include template dependency DocConfigs during import. (Optional)
857
+ -c, --clone Insert new DocConfigs instead of updating existing ones. (Optional)
595
858
  --session=<value> This flag is used to provide a Salesforce Session ID for authentication.
596
859
  --instance=<value> This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
597
860
 
@@ -617,7 +880,7 @@ EXAMPLES
617
880
  [INFO] Retrieving items from the directory
618
881
  [INFO] Files found in folder: 1
619
882
  [INFO] Successfully imported export_folder_name/folder_name/sfdc/customer_pack_id1.json
620
-
883
+
621
884
  Import multiple packs:
622
885
 
623
886
  $ sf butler pb importpack -t sfusername@sandbox.com -p 'customer_pack_id1, customer_pack_id2'
@@ -634,6 +897,23 @@ EXAMPLES
634
897
  [INFO] Successfully imported export_folder_name/folder_name/sfdc/customer_pack_id1.json
635
898
  [INFO] Successfully imported export_folder_name/folder_name/sfdc/customer_pack_id2.json
636
899
 
900
+ Import only pack DocConfigs (skip pack import):
901
+
902
+ $ bin\dev butler:pb:importpack -p customer_pack_id
903
+ -f ./export/pack -t sfusername@sandbox.com -l -d pack
904
+
905
+ Import only leading DocConfig (skip pack import):
906
+
907
+ $ bin\dev butler:pb:importpack -p customer_pack_id
908
+ -f ./export/pack -t sfusername@sandbox.com -l -d lead
909
+
910
+ Import full content with templates and clone mode:
911
+
912
+ $ bin\dev butler:pb:importpack -p customer_pack_id -f ./export/pack
913
+ -t sfusername@sandbox.com -a pdf_butler_user-ADMIN:admin_password
914
+ -e https://eu1.pdfbutler.com -s TEST -l --session <session_id>
915
+ --instance <instance_url> -m -c -d full
916
+
637
917
  FLAG DESCRIPTIONS
638
918
  -t, --target <value>
639
919
  Specifies the Salesforce org username credentials to connect to the target
@@ -652,7 +932,7 @@ FLAG DESCRIPTIONS
652
932
 
653
933
  --session
654
934
  This flag is used to provide a Salesforce Session ID for authentication.
655
-
935
+
656
936
  --instance
657
937
  This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
658
938
  ```
@@ -713,7 +993,7 @@ FLAG DESCRIPTIONS
713
993
 
714
994
  --session
715
995
  This flag is used to provide a Salesforce Session ID for authentication.
716
-
996
+
717
997
  --instance
718
998
  This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
719
999
  ```
@@ -744,7 +1024,7 @@ DESCRIPTION
744
1024
  EXAMPLES
745
1025
  Set settings:
746
1026
 
747
- $ sf butler pb admincredentials -t sfusername@sandbox.com -u 'username'
1027
+ $ sf butler pb admincredentials -t sfusername@sandbox.com -u 'username'
748
1028
  -p 'ADMIN_password' --user-password 'USER_password' -l
749
1029
 
750
1030
  # Console output:
@@ -773,7 +1053,7 @@ FLAG DESCRIPTIONS
773
1053
 
774
1054
  --session
775
1055
  This flag is used to provide a Salesforce Session ID for authentication.
776
-
1056
+
777
1057
  --instance
778
1058
  This flag specifies the Salesforce Instance URL. The Instance URL corresponds to the specific Salesforce environment (e.g., production, sandbox) you are connecting to.
779
1059
  ```
@@ -919,3 +1199,10 @@ SOLUTION: When using the --stage flag, make sure to provide a valid CADMUS stage
919
1199
  SOLUTION: When using the --config flag, ensure that you specify a valid directory path to docconfigs.
920
1200
 
921
1201
  ```
1202
+
1203
+ - Error (1): DataSource import failed. Check the JSON and try again.
1204
+
1205
+ ```
1206
+ SOLUTION: Ensure PDF Butler package version is at least v1.505 and validate the DataSource JSON files.
1207
+
1208
+ ```