@pdfbutler/migration-cli 0.0.11 → 0.0.13

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)
@@ -82,10 +83,16 @@ FLAGS
82
83
  -s, --stage=<value> The CADMUS stage. (Required)
83
84
  -a, --auth-env-var=<value> The PDF Butler credentials for backend authentication. (Required)
84
85
  -e, --endpoint=<value> The URL PDF Butler endpoint for export. (Required)
86
+ Please use the following region-specific URLs on the region in which you registered:
87
+ US: https://us1.pdfbutler.com
88
+ EU: https://eu1.pdfbutler.com
89
+ APAC: https://apac1.pdfbutler.com
90
+ CA: https://ca1.pdfbutler.com
85
91
 
86
92
  -u, --unzip Use this flag to unzip the exported configuration. (Optional)
87
93
  -b, --backend Use this flag to disable PDF Butler backend export. (Optional)
88
94
  -l, --logs Use it to get a more detailed log of migration process. (Optional)
95
+ -p, --partial Use this flag to ignore invalid document configurations and allow the export of document configuration files with the backend part. (Optional)
89
96
 
90
97
  DESCRIPTION
91
98
  Export DocConfigs and related DataSource files from your organization.
@@ -97,41 +104,84 @@ DESCRIPTION
97
104
 
98
105
  To initiate an export, ensure you specify the necessary parameters, including the target org, PDF Butler docuemnt configuration ID,
99
106
  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.
107
+ Additionally, you have the flexibility to enable or disable backend exports,
108
+ ignore invalid document configurations and allow the export of document configuration files with the backend part,
109
+ get a more detailed log of migration process and even choose to unzip the exported configuration.
101
110
 
102
111
  EXAMPLES
103
- Run with --unzip and --backend flags
112
+ Run with --backend flag only
104
113
 
105
114
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
106
- -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
115
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
116
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -b
117
+
118
+ # Console output:
119
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
108
120
 
109
121
  # Created:
110
- Directory 'sfdc/export_folder_name'{
111
- file 'docconfig.json'
122
+ Directory 'export_folder_name/archive_or_folder_name/sfdc'{
123
+ file 'docconfig_id.json'
112
124
  }
113
125
 
114
- Run with --backend flag only
126
+ Run without --backend flag
115
127
 
116
128
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
117
- -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
129
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
130
+ -a 'pdf_butler_user_name-ADMIN:admin_password'
131
+
132
+ # Console output:
133
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
119
134
 
120
135
  # Created:
121
- Directory 'sfdc/export_folder_name'{
122
- file 'docconfig.json'
136
+ Directory 'export_folder_name/archive_or_folder_name'{
137
+ Directory 'sfdc'{
138
+ file 'docconfig_id.json',
139
+ },
140
+ zip file'docconfig_id.zip'{
141
+ Directory 'ConfigTypes',
142
+ Directory 'DataSources',
143
+ file 'doc-config.json',
144
+ file 'TemplateName.docx'
145
+ }
123
146
  }
124
147
 
125
148
  Run with --unzip flag only
126
149
 
127
150
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
128
- -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
151
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
129
152
  -a 'pdf_butler_user_name-ADMIN:admin_password' -u
130
153
 
154
+ # Console output:
155
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
156
+
157
+ # Created:
158
+ Directory 'export_folder_name/archive_or_folder_name'{
159
+ Directory 'sfdc'{
160
+ file 'docconfig_id.json',
161
+ },
162
+ Unziped directory 'docconfig_id'{
163
+ Directory 'ConfigTypes',
164
+ Directory 'DataSources',
165
+ file 'doc-config.json',
166
+ file 'TemplateName.docx'
167
+ }
168
+ }
169
+
170
+ Run without --unzip flag
171
+
172
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
173
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
174
+ -a 'pdf_butler_user_name-ADMIN:admin_password'
175
+
176
+ # Console output:
177
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
178
+
131
179
  # Created:
132
- Directory 'sfdc/export_folder_name'{
133
- file 'docconfig.json',
134
- Unziped directory 'archive_name'{
180
+ Directory 'export_folder_name/archive_or_folder_name'{
181
+ Directory 'sfdc'{
182
+ file 'docconfig_id.json',
183
+ },
184
+ zip file'docconfig_id.zip'{
135
185
  Directory 'ConfigTypes',
136
186
  Directory 'DataSources',
137
187
  file 'doc-config.json',
@@ -142,8 +192,8 @@ EXAMPLES
142
192
  Run with --logs flag only
143
193
 
144
194
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
145
- -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
195
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
196
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -l
147
197
 
148
198
  # Console output:
149
199
  Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
@@ -154,9 +204,11 @@ EXAMPLES
154
204
  Archive unzipped and recorded locally
155
205
 
156
206
  # Created:
157
- Directory 'sfdc/export_folder_name'{
158
- file 'docconfig.json',
159
- zip file'archive_name.zip'{
207
+ Directory 'export_folder_name/archive_or_folder_name'{
208
+ Directory 'sfdc'{
209
+ file 'docconfig_id.json',
210
+ },
211
+ zip file'docconfig_id.zip'{
160
212
  Directory 'ConfigTypes',
161
213
  Directory 'DataSources',
162
214
  file 'doc-config.json',
@@ -167,16 +219,112 @@ EXAMPLES
167
219
  Run without --logs flag
168
220
 
169
221
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
170
- -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
222
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
223
+ -a 'pdf_butler_user_name-ADMIN:admin_password'
224
+
225
+ # Console output:
226
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
227
+
228
+ # Created:
229
+ Directory 'export_folder_name/archive_or_folder_name'{
230
+ Directory 'sfdc'{
231
+ file 'docconfig_id.json',
232
+ },
233
+ zip file'docconfig_id.zip'{
234
+ Directory 'ConfigTypes',
235
+ Directory 'DataSources',
236
+ file 'doc-config.json',
237
+ file 'TemplateName.docx'
238
+ }
239
+ }
240
+
241
+ Run with --partial flag only and docconfig with backend part
242
+
243
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
244
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
245
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -p
246
+
247
+ # Console output:
248
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
249
+
250
+ # Created:
251
+ Directory 'export_folder_name/archive_or_folder_name'{
252
+ Directory 'sfdc'{
253
+ file 'docconfig_id.json',
254
+ },
255
+ zip file'docconfig_id.zip'{
256
+ Directory 'ConfigTypes',
257
+ Directory 'DataSources',
258
+ file 'doc-config.json',
259
+ file 'TemplateName.docx'
260
+ }
261
+ }
262
+
263
+ Run with --partial flag only
264
+
265
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id_1, invalid_document_configuration_id_2'
266
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
267
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -p
268
+
269
+ # Console output:
270
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
271
+
272
+ # Created:
273
+ Directory 'export_folder_name/archive_or_folder_name'{
274
+ Directory 'sfdc'{
275
+ file 'docconfig_id_1.json',
276
+ },
277
+ zip file'docconfig_id_1.zip'{
278
+ Directory 'ConfigTypes',
279
+ Directory 'DataSources',
280
+ file 'doc-config.json',
281
+ file 'TemplateName.docx'
282
+ }
283
+ }
284
+
285
+ Run without --partial flag
286
+
287
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id_1, invalid_document_configuration_id_2'
288
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
171
289
  -a 'pdf_butler_user_name-ADMIN:admin_password'
172
290
 
291
+ # Console output:
292
+ Error (1): One or more docConfigs have no backend.
293
+
294
+ Run with --backend flag and other optional flags
295
+
296
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
297
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
298
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -b [-u | -l | -p]
299
+
300
+ # Console output:
301
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
302
+
303
+ # Created:
304
+ Directory 'export_folder_name/archive_or_folder_name/sfdc'{
305
+ file 'docconfig_id_1.json'
306
+ }
307
+
308
+ Run with --unzip and --logs flags
309
+
310
+ $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
311
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
312
+ -a 'pdf_butler_user_name-ADMIN:admin_password' -u -l
313
+
173
314
  # Console output:
174
315
  Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
316
+ DocConfig exported - 10061
317
+ Exported data from backend - 71940
318
+ Exported data from backend has been archived
319
+ User has read/write permissions
320
+ Archive unzipped and recorded locally
175
321
 
176
322
  # Created:
177
- Directory 'sfdc/export_folder_name'{
178
- file 'docconfig.json',
179
- zip file'archive_name.zip'{
323
+ Directory 'export_folder_name/archive_or_folder_name'{
324
+ Directory 'sfdc'{
325
+ file 'document_configuration_id.json',
326
+ },
327
+ Unziped directory 'document_configuration_id'{
180
328
  Directory 'ConfigTypes',
181
329
  Directory 'DataSources',
182
330
  file 'doc-config.json',
@@ -187,13 +335,18 @@ EXAMPLES
187
335
  Run without optional flags
188
336
 
189
337
  $ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
190
- -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://www.pdfbutler.com'
338
+ -o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
191
339
  -a 'pdf_butler_user_name-ADMIN:admin_password'
192
340
 
341
+ # Console output:
342
+ Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
343
+
193
344
  # Created:
194
- Directory 'sfdc/export_folder_name'{
195
- file 'docconfig.json',
196
- zip file'archive_name.zip'{
345
+ Directory 'export_folder_name/archive_or_folder_name'{
346
+ Directory 'sfdc'{
347
+ file 'document_configuration_id.json',
348
+ },
349
+ zip file'document_configuration_id.zip'{
197
350
  Directory 'ConfigTypes',
198
351
  Directory 'DataSources',
199
352
  file 'doc-config.json',
@@ -211,8 +364,8 @@ FLAG DESCRIPTIONS
211
364
  This ID uniquely identifies the configuration you want to export. It is a required parameter.
212
365
 
213
366
  -o, --out <value>
214
- Specifies the path to the folder with the exported configuration and the archive or folder name for data sources. By default, a sfdc folder is created which will contain folders with exported files.
215
- For example, if the flag is defined with the following values '-o export/out', the result will be the following path: ./sfdc/export/out .
367
+ Specifies the path to the folder with the exported configuration and the archive or folder name for data sources.
368
+ For example, if the flag is defined with the following values '-o butler/docConfigs', the result will be the following path: ./butler/docConfigs .
216
369
  This flag is required to determine where the exported configuration will be saved.
217
370
 
218
371
  -s, --stage <value>
@@ -221,7 +374,7 @@ FLAG DESCRIPTIONS
221
374
  It is a required parameter.
222
375
 
223
376
  -e, --endpoint <value>
224
- Specifies a URL for the PDF Butler endpoint for export. For example: https://www.pdfbutler.com. It is a required parameter.
377
+ Specifies a URL for the PDF Butler endpoint for export. For example: https://eu1.pdfbutler.com. It is a required parameter.
225
378
 
226
379
  -a, --auth-env-var <value>
227
380
  Specifies the PDF Butler credentials for backend authentication. For authenification should be used PDF butler username and admin password.
@@ -237,7 +390,10 @@ FLAG DESCRIPTIONS
237
390
  If specified, the exported configuration will be unzipped after the export process is complete.
238
391
 
239
392
  -l, --logs
240
- Use this flag to enable a more detailed log of the migration process.
393
+ Use this flag to get a more detailed log of migration process.
394
+
395
+ -p, --partial
396
+ Use this flag to ignore invalid document configurations and allow the export of document configuration files with the backend part.
241
397
  ```
242
398
 
243
399
  ## butler pb import
@@ -252,8 +408,15 @@ FLAGS
252
408
  -t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
253
409
  -a, --auth-env-var=<value> The PDF Butler credentials for backend authentication. (Required)
254
410
  -e, --endpoint=<value> The URL PDF Butler endpoint for import. (Required)
411
+ Please use the following region-specific URLs on the region in which you registered:
412
+ US: https://us1.pdfbutler.com
413
+ EU: https://eu1.pdfbutler.com
414
+ APAC: https://apac1.pdfbutler.com
415
+ CA: https://ca1.pdfbutler.com
416
+
255
417
  -s, --stage=<value> The CADMUS stage. (Required)
256
- -f, --config=<value> The path to the configuration file or directory containing configurations to import. (Required)
418
+ -f, --config=<value> The path to the directory containing configurations to import. (Required)
419
+ -l, --logs Use it to get a more detailed log of migration process. (Optional)
257
420
 
258
421
  DESCRIPTION
259
422
  Import DocConfigs and related DataSource files into your organization.
@@ -267,8 +430,8 @@ DESCRIPTION
267
430
  EXAMPLE
268
431
  Import configurations to the organization:
269
432
 
270
- $ sf butler pb import -t sfusername@sandbox.com -f ./sfdc/export_folder_name/archive_or_folder_name
271
- -e 'https://www.pdfbutler.com' -a 'pdf_butler_user_name-ADMIN:admin_password' -s 'UAT'
433
+ $ sf butler pb import -t sfusername@sandbox.com -f .export_folder_name/archive_or_folder_name
434
+ -e 'https://eu1.pdfbutler.com' -a 'pdf_butler_user_name-ADMIN:admin_password' -s 'UAT'
272
435
 
273
436
  FLAG DESCRIPTIONS
274
437
  -t, --target <value>
@@ -291,4 +454,148 @@ FLAG DESCRIPTIONS
291
454
  -f, --config <value>
292
455
  Specifies the path to the configuration file or directory containing configurations to import.
293
456
  This flag is required to determine which configurations to import.
457
+
458
+ -l, --logs
459
+ Use this flag to get a more detailed log of migration process.
460
+ ```
461
+
462
+ ## Typical errors and solutions
463
+
464
+ Typical errors that may occur when using the plugin and their solutions.
465
+
466
+ ### Export
467
+
468
+ - EPERM operation not permitted, chmod 'path_to_directory_to_export'.
469
+
470
+ ```
471
+ SOLUTION: error typically occurs due to insufficient permissions. To resolve it,
472
+ make sure you have the necessary permissions to write to the specified directory.
473
+ You can use the chmod command to change the directory permissions.
474
+
475
+ ```
476
+
477
+ - Error (1): Flag --target expects a value.
478
+
479
+ ```
480
+ SOLUTION: When using the --target flag, make sure to provide a valid Salesforce org username after the flag.
481
+
482
+ ```
483
+
484
+ - Error (1): No authorization information found for sfusername@sandbox.com.
485
+
486
+ ```
487
+ SOLUTION: Ensure that you have provided the correct Salesforce username. Double-check your credentials and ensure that they are properly configured in the plugin.
488
+
489
+ ```
490
+
491
+ - Error (1): Flag --id expects a value.
492
+
493
+ ```
494
+ 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.
495
+
496
+ ```
497
+
498
+ - Error (1): No matching Doc Configs ids found.
499
+
500
+ ```
501
+ SOLUTION: Verify that the Doc Config IDs you provided are correct and exist in the system.
502
+
503
+ ```
504
+
505
+ - Error (1): One or more docConfigs have no backend.
506
+
507
+ ```
508
+ SOLUTION: This error indicates that some document configurations are missing backend part.
509
+ Review the document configurations and ensure that they are properly configured with the required server modules.
510
+ Or you can add the "-p --partial" flag to enable exporting those docconfigs that have a backend part.
511
+
512
+ ```
513
+
514
+ - Error (1): Flag --out expects a value.
515
+
516
+ ```
517
+ SOLUTION: When using the --out flag, ensure that you specify a valid directory path where the output should be saved.
518
+
519
+ ```
520
+
521
+ - Error (1): Flag --stage expects a value.
522
+
523
+ ```
524
+ SOLUTION: When using the --stage flag, make sure to provide a valid CADMUS stage.
525
+
526
+ ```
527
+
528
+ - Error (1): Flag --auth-env-var expects a value.
529
+
530
+ ```
531
+ SOLUTION: When using the --auth-env-var flag, provide the PDF Butler credentials for backend authentication.
532
+ Ensure that the PDF Butler credentials is correctly set and contains the required credentials (Username and Admin password).
533
+
534
+ ```
535
+
536
+ - Error (1): Flag --endpoint expects a value.
537
+
538
+ ```
539
+ SOLUTION: When using the --endpoint flag, specify the correct endpoint URL as the value.
540
+
541
+ ```
542
+
543
+ - Error (1): Response code 401 (Unauthorized).
544
+
545
+ ```
546
+ SOLUTION: This error indicates that your request lacks proper authentication. Double-check your credentials like PDF Butler Username or PDF Butler Admin password.
547
+ Correct example: 'Username-ADMIN:Admin_password'
548
+
549
+ ```
550
+
551
+ - Error (1): System.LicenseException: The Apex Class RestImportDocConfig is part of the AppExchange Package PDF Butler, and requires a license to use.
552
+
553
+ ```
554
+ SOLUTION: To resolve this error, you need to acquire the required license for the AppExchange Package PDF Butler to use the plugin command.
555
+ Contact your Salesforce administrator or license provider to obtain the necessary license.
556
+
557
+ ```
558
+
559
+ ### Import
560
+
561
+ - Error (1): Flag --target expects a value.
562
+
563
+ ```
564
+ SOLUTION: When using the --target flag, make sure to provide a valid Salesforce org username after the flag.
565
+ ```
566
+
567
+ - Error (1): Flag --auth-env-var expects a value.
568
+
569
+ ```
570
+ SOLUTION:
571
+
572
+ ```
573
+
574
+ - Error (1): Flag --auth-env-var expects a value.
575
+
576
+ ```
577
+ SOLUTION: When using the --auth-env-var flag, provide the PDF Butler credentials for backend authentication.
578
+ Ensure that the PDF Butler credentials is correctly set and contains the required credentials (Username and Admin password).
579
+
580
+ ```
581
+
582
+ - Error (1): Flag --endpoint expects a value.
583
+
584
+ ```
585
+ SOLUTION: When using the --endpoint flag, specify the correct endpoint URL as the value.
586
+
587
+ ```
588
+
589
+ - Error (1): Flag --stage expects a value.
590
+
591
+ ```
592
+ SOLUTION: When using the --stage flag, make sure to provide a valid CADMUS stage.
593
+
594
+ ```
595
+
596
+ - Error (1): Flag --config expects a value.
597
+
598
+ ```
599
+ SOLUTION: When using the --config flag, ensure that you specify a valid directory path to docconfigs.
600
+
294
601
  ```
@@ -11,7 +11,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
11
11
  /* eslint-disable @typescript-eslint/no-explicit-any */
12
12
  /* eslint-disable no-console */
13
13
  const fs_1 = require("fs");
14
- const path = require("path");
15
14
  const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
16
15
  const core_1 = require("@salesforce/core");
17
16
  const AdmZip = require("adm-zip");
@@ -56,8 +55,7 @@ class ButlerPbExport extends sf_plugins_core_1.SfCommand {
56
55
  }
57
56
  async run() {
58
57
  const { flags } = await this.parse(ButlerPbExport);
59
- const outFile = flags.out;
60
- const outDir = path.dirname(outFile);
58
+ const outDir = flags.out;
61
59
  let docConfigIds = [];
62
60
  let docConfigResponses = [];
63
61
  try {
@@ -101,10 +99,10 @@ class ButlerPbExport extends sf_plugins_core_1.SfCommand {
101
99
  else {
102
100
  zipMap = new Map();
103
101
  }
104
- await fs_1.promises.mkdir(`./sfdc/${outDir}`, { recursive: true });
102
+ await fs_1.promises.mkdir(`./${outDir}/sfdc`, { recursive: true });
105
103
  if (flags.logs) {
106
104
  try {
107
- await fs_1.promises.access(`./sfdc/${outDir}`, fs_1.promises.constants.R_OK | fs_1.promises.constants.W_OK);
105
+ await fs_1.promises.access(`./${outDir}`, fs_1.promises.constants.R_OK | fs_1.promises.constants.W_OK);
108
106
  this.log('User has read/write permissions');
109
107
  }
110
108
  catch (err) {
@@ -114,8 +112,8 @@ class ButlerPbExport extends sf_plugins_core_1.SfCommand {
114
112
  if (zipMap.size > 0) {
115
113
  if (flags.unzip) {
116
114
  const extractionAndWritePromises = Array.from(zipMap.entries()).map(async ([key, value]) => {
117
- value.extractAllTo(`./sfdc/${outDir}/${key}`, false);
118
- const filePath = `./sfdc/${outDir}/${key}.json`;
115
+ value.extractAllTo(`./${outDir}/${key}`, false);
116
+ const filePath = `./${outDir}/sfdc/${key}.json`;
119
117
  const data = JSON.stringify(docConfigResponses[docConfigIds.indexOf(key)]);
120
118
  await fs_1.promises.writeFile(filePath, data);
121
119
  });
@@ -130,8 +128,8 @@ class ButlerPbExport extends sf_plugins_core_1.SfCommand {
130
128
  zipToExport.addFile(entry.entryName, value.readFile(entry));
131
129
  }
132
130
  zipToExport.addFile('sfdc/docconfig.json', Buffer.from(JSON.stringify(docConfigResponses[docConfigIds.indexOf(key)])));
133
- const zipPromise = fs_1.promises.writeFile(`./sfdc/${outDir}/${key}.zip`, zipToExport.toBuffer());
134
- const jsonPromise = fs_1.promises.writeFile(`./sfdc/${outDir}/${key}.json`, JSON.stringify(docConfigResponses[docConfigIds.indexOf(key)]));
131
+ const zipPromise = fs_1.promises.writeFile(`./${outDir}/${key}.zip`, zipToExport.toBuffer());
132
+ const jsonPromise = fs_1.promises.writeFile(`./${outDir}/sfdc/${key}.json`, JSON.stringify(docConfigResponses[docConfigIds.indexOf(key)]));
135
133
  await Promise.all([zipPromise, jsonPromise]);
136
134
  });
137
135
  await Promise.all(zipAndWritePromises);
@@ -139,7 +137,7 @@ class ButlerPbExport extends sf_plugins_core_1.SfCommand {
139
137
  }
140
138
  else {
141
139
  const writePromises = docConfigIds.map(async (docConfigId) => {
142
- const filePath = `./sfdc/${outDir}/${docConfigId}.json`;
140
+ const filePath = `./${outDir}/sfdc/${docConfigId}.json`;
143
141
  const data = JSON.stringify(docConfigResponses[docConfigIds.indexOf(docConfigId)]);
144
142
  await fs_1.promises.writeFile(filePath, data);
145
143
  });
@@ -1 +1 @@
1
- {"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/commands/butler/pb/export.ts"],"names":[],"mappings":";;AAAA,2DAA2D;AAC3D,0DAA0D;AAC1D,qEAAqE;AACrE,sDAAsD;AACtD,+DAA+D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uBAAK,CAAC,MAAM,CAAC;QAC3B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,4BAA4B,CAAC;QAC1D,IAAI,EAAE,GAAG;KACV,CAAC;IACF,QAAQ,EAAE,uBAAK,CAAC,GAAG,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACtD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,KAAK,EAAE,uBAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,CAAC;QACnD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,KAAK,EAAE,uBAAK,CAAC,OAAO,CAAC;QACnB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,CAAC;QACnD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,OAAO,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,OAAO,EAAE,uBAAK,CAAC,OAAO,CAAC;QACrB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;QACrD,IAAI,EAAE,GAAG;KACV,CAAC;CACH,CAAC;kBAzDiB,cAAc"}
@@ -17,5 +17,6 @@ export default class ButlerPbImport extends SfCommand<ButlerPbImportResult> {
17
17
  logs: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
18
  };
19
19
  private static getTargetPath;
20
+ private static getFiles;
20
21
  run(): Promise<ButlerPbImportResult>;
21
22
  }
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const path = require("path");
4
3
  const fs = require("graceful-fs");
5
4
  const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
6
5
  const core_1 = require("@salesforce/core");
@@ -27,13 +26,26 @@ class ButlerPbImport extends sf_plugins_core_1.SfCommand {
27
26
  }
28
27
  throw new Error('Unsupported record type');
29
28
  }
29
+ static getFiles(dir, files) {
30
+ const fileList = fs.readdirSync(dir, { withFileTypes: true });
31
+ for (const file of fileList) {
32
+ const name = `${dir}/${file.name}`;
33
+ if (fs.statSync(name).isDirectory() && file.name === 'sfdc') {
34
+ ButlerPbImport.getFiles(name, files);
35
+ }
36
+ else {
37
+ files.push(name);
38
+ }
39
+ }
40
+ return files;
41
+ }
30
42
  async run() {
31
43
  const { flags } = await this.parse(ButlerPbImport);
32
44
  const zipArray = [];
33
45
  const jsonArray = [];
34
- const files = fs.readdirSync(`${flags.config}`);
46
+ const files = ButlerPbImport.getFiles(`${flags.config}`, []);
35
47
  await Promise.all(files.map((fileName) => {
36
- const fullPath = path.join(flags.config, fileName);
48
+ const fullPath = fileName;
37
49
  if (fileName.endsWith('.json')) {
38
50
  jsonArray.push(fullPath);
39
51
  }
@@ -60,6 +72,8 @@ class ButlerPbImport extends sf_plugins_core_1.SfCommand {
60
72
  catch (e) {
61
73
  throw new Error('Failed to write data to the target Salesforce org');
62
74
  }
75
+ if (flags.logs)
76
+ this.log(`zipArray.length - ${zipArray.length}`);
63
77
  if (zipArray.length === 0 || !flags.endpoint) {
64
78
  return { success: false };
65
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"import.js","sourceRoot":"","sources":["../../../../src/commands/butler/pb/import.ts"],"names":[],"mappings":";;AAAA,6BAA8B;AAC9B,kCAAmC;AACnC,iEAA+D;AAC/D,2CAAkE;AAClE,sCAAuC;AACvC,kCAAmC;AACnC,6BAAsB;AAEtB,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;AAMvF,MAAqB,cAAe,SAAQ,2BAA+B;IAwCjE,MAAM,CAAC,aAAa,CAAC,UAAkB;QAC7C,QAAQ,UAAU,EAA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CAAC,4BAA4B,CAAC;QAC1D,IAAI,EAAE,GAAG;KACV,CAAC;IACF,QAAQ,EAAE,uBAAK,CAAC,GAAG,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACtD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,KAAK,EAAE,uBAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,qBAAqB,CAAC;QACnD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,MAAM,EAAE,uBAAK,CAAC,MAAM,CAAC;QACnB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;QACpD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,OAAO,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,IAAI,EAAE,GAAG;KACV,CAAC;CACH,CAAC;kBAtCiB,cAAc"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.11",
2
+ "version": "0.0.13",
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.13",
5
5
  "script": {
6
6
  "postinstall": "sf plugins link @pdfbutler/migration-cli"
7
7
  },