@pdfbutler/migration-cli 0.0.12 → 0.0.14
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 +102 -55
- package/lib/commands/butler/pb/export.js +8 -10
- package/lib/commands/butler/pb/export.js.map +1 -1
- package/lib/commands/butler/pb/import.d.ts +3 -0
- package/lib/commands/butler/pb/import.js +40 -2
- package/lib/commands/butler/pb/import.js.map +1 -1
- package/messages/butler.pb.import.md +4 -0
- package/oclif.manifest.json +9 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,9 @@ v0.0.11 updates: <br/>
|
|
|
10
10
|
- New '-l --logs' flag. Use this flag to enable a more detailed log of the migration process.
|
|
11
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.
|
|
12
12
|
|
|
13
|
+
v0.0.14 updates: <br/>
|
|
14
|
+
- 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
|
+
|
|
13
16
|
## About
|
|
14
17
|
|
|
15
18
|
@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.
|
|
@@ -83,11 +86,16 @@ FLAGS
|
|
|
83
86
|
-s, --stage=<value> The CADMUS stage. (Required)
|
|
84
87
|
-a, --auth-env-var=<value> The PDF Butler credentials for backend authentication. (Required)
|
|
85
88
|
-e, --endpoint=<value> The URL PDF Butler endpoint for export. (Required)
|
|
89
|
+
Please use the following region-specific URLs on the region in which you registered:
|
|
90
|
+
US: https://us1.pdfbutler.com
|
|
91
|
+
EU: https://eu1.pdfbutler.com
|
|
92
|
+
APAC: https://apac1.pdfbutler.com
|
|
93
|
+
CA: https://ca1.pdfbutler.com
|
|
86
94
|
|
|
87
95
|
-u, --unzip Use this flag to unzip the exported configuration. (Optional)
|
|
88
96
|
-b, --backend Use this flag to disable PDF Butler backend export. (Optional)
|
|
89
97
|
-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.
|
|
98
|
+
-p, --partial Use this flag to ignore invalid document configurations and allow the export of document configuration files with the backend part. (Optional)
|
|
91
99
|
|
|
92
100
|
DESCRIPTION
|
|
93
101
|
Export DocConfigs and related DataSource files from your organization.
|
|
@@ -99,35 +107,39 @@ DESCRIPTION
|
|
|
99
107
|
|
|
100
108
|
To initiate an export, ensure you specify the necessary parameters, including the target org, PDF Butler docuemnt configuration ID,
|
|
101
109
|
output path, define PDF Butler credentials for backend authentication, specify endpoints and stage.
|
|
102
|
-
Additionally, you have the flexibility to enable or disable backend exports,
|
|
110
|
+
Additionally, you have the flexibility to enable or disable backend exports,
|
|
111
|
+
ignore invalid document configurations and allow the export of document configuration files with the backend part,
|
|
112
|
+
get a more detailed log of migration process and even choose to unzip the exported configuration.
|
|
103
113
|
|
|
104
114
|
EXAMPLES
|
|
105
115
|
Run with --backend flag only
|
|
106
116
|
|
|
107
117
|
$ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
|
|
108
|
-
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://
|
|
118
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
109
119
|
-a 'pdf_butler_user_name-ADMIN:admin_password' -b
|
|
110
120
|
|
|
111
121
|
# Console output:
|
|
112
122
|
Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
|
|
113
123
|
|
|
114
124
|
# Created:
|
|
115
|
-
Directory 'sfdc
|
|
125
|
+
Directory 'export_folder_name/archive_or_folder_name/sfdc'{
|
|
116
126
|
file 'docconfig_id.json'
|
|
117
127
|
}
|
|
118
128
|
|
|
119
129
|
Run without --backend flag
|
|
120
130
|
|
|
121
131
|
$ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
|
|
122
|
-
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://
|
|
132
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
123
133
|
-a 'pdf_butler_user_name-ADMIN:admin_password'
|
|
124
134
|
|
|
125
135
|
# Console output:
|
|
126
136
|
Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
|
|
127
137
|
|
|
128
138
|
# Created:
|
|
129
|
-
Directory '
|
|
130
|
-
|
|
139
|
+
Directory 'export_folder_name/archive_or_folder_name'{
|
|
140
|
+
Directory 'sfdc'{
|
|
141
|
+
file 'docconfig_id.json',
|
|
142
|
+
},
|
|
131
143
|
zip file'docconfig_id.zip'{
|
|
132
144
|
Directory 'ConfigTypes',
|
|
133
145
|
Directory 'DataSources',
|
|
@@ -139,15 +151,17 @@ EXAMPLES
|
|
|
139
151
|
Run with --unzip flag only
|
|
140
152
|
|
|
141
153
|
$ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
|
|
142
|
-
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://
|
|
154
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
143
155
|
-a 'pdf_butler_user_name-ADMIN:admin_password' -u
|
|
144
156
|
|
|
145
157
|
# Console output:
|
|
146
158
|
Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
|
|
147
159
|
|
|
148
160
|
# Created:
|
|
149
|
-
Directory '
|
|
150
|
-
|
|
161
|
+
Directory 'export_folder_name/archive_or_folder_name'{
|
|
162
|
+
Directory 'sfdc'{
|
|
163
|
+
file 'docconfig_id.json',
|
|
164
|
+
},
|
|
151
165
|
Unziped directory 'docconfig_id'{
|
|
152
166
|
Directory 'ConfigTypes',
|
|
153
167
|
Directory 'DataSources',
|
|
@@ -159,15 +173,17 @@ EXAMPLES
|
|
|
159
173
|
Run without --unzip flag
|
|
160
174
|
|
|
161
175
|
$ 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://
|
|
176
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
163
177
|
-a 'pdf_butler_user_name-ADMIN:admin_password'
|
|
164
178
|
|
|
165
179
|
# Console output:
|
|
166
180
|
Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
|
|
167
181
|
|
|
168
182
|
# Created:
|
|
169
|
-
Directory '
|
|
170
|
-
|
|
183
|
+
Directory 'export_folder_name/archive_or_folder_name'{
|
|
184
|
+
Directory 'sfdc'{
|
|
185
|
+
file 'docconfig_id.json',
|
|
186
|
+
},
|
|
171
187
|
zip file'docconfig_id.zip'{
|
|
172
188
|
Directory 'ConfigTypes',
|
|
173
189
|
Directory 'DataSources',
|
|
@@ -179,7 +195,7 @@ EXAMPLES
|
|
|
179
195
|
Run with --logs flag only
|
|
180
196
|
|
|
181
197
|
$ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
|
|
182
|
-
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://
|
|
198
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
183
199
|
-a 'pdf_butler_user_name-ADMIN:admin_password' -l
|
|
184
200
|
|
|
185
201
|
# Console output:
|
|
@@ -191,8 +207,10 @@ EXAMPLES
|
|
|
191
207
|
Archive unzipped and recorded locally
|
|
192
208
|
|
|
193
209
|
# Created:
|
|
194
|
-
Directory '
|
|
195
|
-
|
|
210
|
+
Directory 'export_folder_name/archive_or_folder_name'{
|
|
211
|
+
Directory 'sfdc'{
|
|
212
|
+
file 'docconfig_id.json',
|
|
213
|
+
},
|
|
196
214
|
zip file'docconfig_id.zip'{
|
|
197
215
|
Directory 'ConfigTypes',
|
|
198
216
|
Directory 'DataSources',
|
|
@@ -204,15 +222,17 @@ EXAMPLES
|
|
|
204
222
|
Run without --logs flag
|
|
205
223
|
|
|
206
224
|
$ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
|
|
207
|
-
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://
|
|
225
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
208
226
|
-a 'pdf_butler_user_name-ADMIN:admin_password'
|
|
209
227
|
|
|
210
228
|
# Console output:
|
|
211
229
|
Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
|
|
212
230
|
|
|
213
231
|
# Created:
|
|
214
|
-
Directory '
|
|
215
|
-
|
|
232
|
+
Directory 'export_folder_name/archive_or_folder_name'{
|
|
233
|
+
Directory 'sfdc'{
|
|
234
|
+
file 'docconfig_id.json',
|
|
235
|
+
},
|
|
216
236
|
zip file'docconfig_id.zip'{
|
|
217
237
|
Directory 'ConfigTypes',
|
|
218
238
|
Directory 'DataSources',
|
|
@@ -224,15 +244,17 @@ EXAMPLES
|
|
|
224
244
|
Run with --partial flag only and docconfig with backend part
|
|
225
245
|
|
|
226
246
|
$ 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://
|
|
247
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
228
248
|
-a 'pdf_butler_user_name-ADMIN:admin_password' -p
|
|
229
249
|
|
|
230
250
|
# Console output:
|
|
231
251
|
Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
|
|
232
252
|
|
|
233
253
|
# Created:
|
|
234
|
-
Directory '
|
|
235
|
-
|
|
254
|
+
Directory 'export_folder_name/archive_or_folder_name'{
|
|
255
|
+
Directory 'sfdc'{
|
|
256
|
+
file 'docconfig_id.json',
|
|
257
|
+
},
|
|
236
258
|
zip file'docconfig_id.zip'{
|
|
237
259
|
Directory 'ConfigTypes',
|
|
238
260
|
Directory 'DataSources',
|
|
@@ -241,19 +263,21 @@ EXAMPLES
|
|
|
241
263
|
}
|
|
242
264
|
}
|
|
243
265
|
|
|
244
|
-
Run with --partial flag only
|
|
266
|
+
Run with --partial flag only
|
|
245
267
|
|
|
246
|
-
$ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id_1,
|
|
247
|
-
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://
|
|
268
|
+
$ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id_1, invalid_document_configuration_id_2'
|
|
269
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
248
270
|
-a 'pdf_butler_user_name-ADMIN:admin_password' -p
|
|
249
271
|
|
|
250
272
|
# Console output:
|
|
251
273
|
Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
|
|
252
274
|
|
|
253
275
|
# Created:
|
|
254
|
-
Directory '
|
|
255
|
-
|
|
256
|
-
|
|
276
|
+
Directory 'export_folder_name/archive_or_folder_name'{
|
|
277
|
+
Directory 'sfdc'{
|
|
278
|
+
file 'docconfig_id_1.json',
|
|
279
|
+
},
|
|
280
|
+
zip file'docconfig_id_1.zip'{
|
|
257
281
|
Directory 'ConfigTypes',
|
|
258
282
|
Directory 'DataSources',
|
|
259
283
|
file 'doc-config.json',
|
|
@@ -261,10 +285,10 @@ EXAMPLES
|
|
|
261
285
|
}
|
|
262
286
|
}
|
|
263
287
|
|
|
264
|
-
Run without --partial flag
|
|
288
|
+
Run without --partial flag
|
|
265
289
|
|
|
266
|
-
$ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id_1,
|
|
267
|
-
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://
|
|
290
|
+
$ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id_1, invalid_document_configuration_id_2'
|
|
291
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
268
292
|
-a 'pdf_butler_user_name-ADMIN:admin_password'
|
|
269
293
|
|
|
270
294
|
# Console output:
|
|
@@ -273,21 +297,21 @@ EXAMPLES
|
|
|
273
297
|
Run with --backend flag and other optional flags
|
|
274
298
|
|
|
275
299
|
$ 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://
|
|
300
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
277
301
|
-a 'pdf_butler_user_name-ADMIN:admin_password' -b [-u | -l | -p]
|
|
278
302
|
|
|
279
303
|
# Console output:
|
|
280
304
|
Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
|
|
281
305
|
|
|
282
306
|
# Created:
|
|
283
|
-
Directory 'sfdc
|
|
284
|
-
file '
|
|
307
|
+
Directory 'export_folder_name/archive_or_folder_name/sfdc'{
|
|
308
|
+
file 'docconfig_id_1.json'
|
|
285
309
|
}
|
|
286
310
|
|
|
287
311
|
Run with --unzip and --logs flags
|
|
288
312
|
|
|
289
313
|
$ 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://
|
|
314
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
291
315
|
-a 'pdf_butler_user_name-ADMIN:admin_password' -u -l
|
|
292
316
|
|
|
293
317
|
# Console output:
|
|
@@ -299,9 +323,11 @@ EXAMPLES
|
|
|
299
323
|
Archive unzipped and recorded locally
|
|
300
324
|
|
|
301
325
|
# Created:
|
|
302
|
-
Directory '
|
|
303
|
-
|
|
304
|
-
|
|
326
|
+
Directory 'export_folder_name/archive_or_folder_name'{
|
|
327
|
+
Directory 'sfdc'{
|
|
328
|
+
file 'document_configuration_id.json',
|
|
329
|
+
},
|
|
330
|
+
Unziped directory 'document_configuration_id'{
|
|
305
331
|
Directory 'ConfigTypes',
|
|
306
332
|
Directory 'DataSources',
|
|
307
333
|
file 'doc-config.json',
|
|
@@ -312,16 +338,18 @@ EXAMPLES
|
|
|
312
338
|
Run without optional flags
|
|
313
339
|
|
|
314
340
|
$ sf butler pb export -t sfusername@sandbox.com -i 'document_configuration_id'
|
|
315
|
-
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://
|
|
341
|
+
-o 'export_folder_name/archive_or_folder_name' -s 'TEST' -e 'https://eu1.pdfbutler.com'
|
|
316
342
|
-a 'pdf_butler_user_name-ADMIN:admin_password'
|
|
317
343
|
|
|
318
344
|
# Console output:
|
|
319
345
|
Connected to sfusername@sandbox.com (00D06000001aXGkEAM) with API version 58.0
|
|
320
346
|
|
|
321
347
|
# Created:
|
|
322
|
-
Directory '
|
|
323
|
-
|
|
324
|
-
|
|
348
|
+
Directory 'export_folder_name/archive_or_folder_name'{
|
|
349
|
+
Directory 'sfdc'{
|
|
350
|
+
file 'document_configuration_id.json',
|
|
351
|
+
},
|
|
352
|
+
zip file'document_configuration_id.zip'{
|
|
325
353
|
Directory 'ConfigTypes',
|
|
326
354
|
Directory 'DataSources',
|
|
327
355
|
file 'doc-config.json',
|
|
@@ -339,8 +367,8 @@ FLAG DESCRIPTIONS
|
|
|
339
367
|
This ID uniquely identifies the configuration you want to export. It is a required parameter.
|
|
340
368
|
|
|
341
369
|
-o, --out <value>
|
|
342
|
-
Specifies the path to the folder with the exported configuration and the archive or folder name for data sources.
|
|
343
|
-
For example, if the flag is defined with the following values '-o
|
|
370
|
+
Specifies the path to the folder with the exported configuration and the archive or folder name for data sources.
|
|
371
|
+
For example, if the flag is defined with the following values '-o butler/docConfigs', the result will be the following path: ./butler/docConfigs .
|
|
344
372
|
This flag is required to determine where the exported configuration will be saved.
|
|
345
373
|
|
|
346
374
|
-s, --stage <value>
|
|
@@ -349,7 +377,7 @@ FLAG DESCRIPTIONS
|
|
|
349
377
|
It is a required parameter.
|
|
350
378
|
|
|
351
379
|
-e, --endpoint <value>
|
|
352
|
-
Specifies a URL for the PDF Butler endpoint for export. For example: https://
|
|
380
|
+
Specifies a URL for the PDF Butler endpoint for export. For example: https://eu1.pdfbutler.com. It is a required parameter.
|
|
353
381
|
|
|
354
382
|
-a, --auth-env-var <value>
|
|
355
383
|
Specifies the PDF Butler credentials for backend authentication. For authenification should be used PDF butler username and admin password.
|
|
@@ -377,15 +405,22 @@ Import PDF Butler document configurations and related DataSource files.
|
|
|
377
405
|
|
|
378
406
|
```
|
|
379
407
|
USAGE
|
|
380
|
-
$ sf butler pb import [--target | -t <value>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [--stage | -s <value>] [--config | -f <value>]
|
|
408
|
+
$ sf butler pb import [--target | -t <value>] [--id | -i <value>] [--auth-env-var | -a <value>] [--endpoint | -e <value>] [--stage | -s <value>] [--config | -f <value>]
|
|
381
409
|
|
|
382
410
|
FLAGS
|
|
383
411
|
-t, --target=<value> The Salesforce org username credentials to connect to the target org. (Required)
|
|
412
|
+
-i, --id=<value> The ID of the PDF Butler docuemnt configurations to import. (Required)
|
|
384
413
|
-a, --auth-env-var=<value> The PDF Butler credentials for backend authentication. (Required)
|
|
385
414
|
-e, --endpoint=<value> The URL PDF Butler endpoint for import. (Required)
|
|
415
|
+
Please use the following region-specific URLs on the region in which you registered:
|
|
416
|
+
US: https://us1.pdfbutler.com
|
|
417
|
+
EU: https://eu1.pdfbutler.com
|
|
418
|
+
APAC: https://apac1.pdfbutler.com
|
|
419
|
+
CA: https://ca1.pdfbutler.com
|
|
420
|
+
|
|
386
421
|
-s, --stage=<value> The CADMUS stage. (Required)
|
|
387
422
|
-f, --config=<value> The path to the directory containing configurations to import. (Required)
|
|
388
|
-
-l, --logs
|
|
423
|
+
-l, --logs Use it to get a more detailed log of migration process. (Optional)
|
|
389
424
|
|
|
390
425
|
DESCRIPTION
|
|
391
426
|
Import DocConfigs and related DataSource files into your organization.
|
|
@@ -399,13 +434,17 @@ DESCRIPTION
|
|
|
399
434
|
EXAMPLE
|
|
400
435
|
Import configurations to the organization:
|
|
401
436
|
|
|
402
|
-
$ sf butler pb import -t sfusername@sandbox.com -f
|
|
403
|
-
-e 'https://
|
|
437
|
+
$ sf butler pb import -t sfusername@sandbox.com -i 'document_configuration_id' -f .export_folder_name/archive_or_folder_name
|
|
438
|
+
-e 'https://eu1.pdfbutler.com' -a 'pdf_butler_user_name-ADMIN:admin_password' -s 'UAT'
|
|
404
439
|
|
|
405
440
|
FLAG DESCRIPTIONS
|
|
406
441
|
-t, --target <value>
|
|
407
442
|
Specifies the Salesforce org username credentials to connect to the target
|
|
408
443
|
org where the PDF Butler configurations will be imported. This flag is required for authentication.
|
|
444
|
+
|
|
445
|
+
-i, --id <value>
|
|
446
|
+
Specifies the unique ID of the PDF Butler document configuration to be exported.
|
|
447
|
+
This ID uniquely identifies the configuration you want to export. It is a required parameter.
|
|
409
448
|
|
|
410
449
|
-a, --auth-env-var <value>
|
|
411
450
|
Specifies the PDF Butler credentials for backend authentication. For authenification should be used PDF butler username and admin password.
|
|
@@ -437,7 +476,9 @@ Typical errors that may occur when using the plugin and their solutions.
|
|
|
437
476
|
- EPERM operation not permitted, chmod 'path_to_directory_to_export'.
|
|
438
477
|
|
|
439
478
|
```
|
|
440
|
-
SOLUTION: error typically occurs due to insufficient permissions. To resolve it,
|
|
479
|
+
SOLUTION: error typically occurs due to insufficient permissions. To resolve it,
|
|
480
|
+
make sure you have the necessary permissions to write to the specified directory.
|
|
481
|
+
You can use the chmod command to change the directory permissions.
|
|
441
482
|
|
|
442
483
|
```
|
|
443
484
|
|
|
@@ -472,7 +513,9 @@ SOLUTION: Verify that the Doc Config IDs you provided are correct and exist in t
|
|
|
472
513
|
- Error (1): One or more docConfigs have no backend.
|
|
473
514
|
|
|
474
515
|
```
|
|
475
|
-
SOLUTION: This error indicates that some document configurations are missing backend part.
|
|
516
|
+
SOLUTION: This error indicates that some document configurations are missing backend part.
|
|
517
|
+
Review the document configurations and ensure that they are properly configured with the required server modules.
|
|
518
|
+
Or you can add the "-p --partial" flag to enable exporting those docconfigs that have a backend part.
|
|
476
519
|
|
|
477
520
|
```
|
|
478
521
|
|
|
@@ -493,7 +536,8 @@ SOLUTION: When using the --stage flag, make sure to provide a valid CADMUS stage
|
|
|
493
536
|
- Error (1): Flag --auth-env-var expects a value.
|
|
494
537
|
|
|
495
538
|
```
|
|
496
|
-
SOLUTION: When using the --auth-env-var flag, provide the PDF Butler credentials for backend authentication.
|
|
539
|
+
SOLUTION: When using the --auth-env-var flag, provide the PDF Butler credentials for backend authentication.
|
|
540
|
+
Ensure that the PDF Butler credentials is correctly set and contains the required credentials (Username and Admin password).
|
|
497
541
|
|
|
498
542
|
```
|
|
499
543
|
|
|
@@ -507,14 +551,16 @@ SOLUTION: When using the --endpoint flag, specify the correct endpoint URL as th
|
|
|
507
551
|
- Error (1): Response code 401 (Unauthorized).
|
|
508
552
|
|
|
509
553
|
```
|
|
510
|
-
SOLUTION: This error indicates that your request lacks proper authentication. Double-check your credentials like PDF Butler Username or PDF Butler Admin password.
|
|
554
|
+
SOLUTION: This error indicates that your request lacks proper authentication. Double-check your credentials like PDF Butler Username or PDF Butler Admin password.
|
|
555
|
+
Correct example: 'Username-ADMIN:Admin_password'
|
|
511
556
|
|
|
512
557
|
```
|
|
513
558
|
|
|
514
559
|
- Error (1): System.LicenseException: The Apex Class RestImportDocConfig is part of the AppExchange Package PDF Butler, and requires a license to use.
|
|
515
560
|
|
|
516
561
|
```
|
|
517
|
-
SOLUTION: To resolve this error, you need to acquire the required license for the AppExchange Package PDF Butler to use the plugin command.
|
|
562
|
+
SOLUTION: To resolve this error, you need to acquire the required license for the AppExchange Package PDF Butler to use the plugin command.
|
|
563
|
+
Contact your Salesforce administrator or license provider to obtain the necessary license.
|
|
518
564
|
|
|
519
565
|
```
|
|
520
566
|
|
|
@@ -536,7 +582,8 @@ SOLUTION:
|
|
|
536
582
|
- Error (1): Flag --auth-env-var expects a value.
|
|
537
583
|
|
|
538
584
|
```
|
|
539
|
-
SOLUTION: When using the --auth-env-var flag, provide the PDF Butler credentials for backend authentication.
|
|
585
|
+
SOLUTION: When using the --auth-env-var flag, provide the PDF Butler credentials for backend authentication.
|
|
586
|
+
Ensure that the PDF Butler credentials is correctly set and contains the required credentials (Username and Admin password).
|
|
540
587
|
|
|
541
588
|
```
|
|
542
589
|
|
|
@@ -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
|
|
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(
|
|
102
|
+
await fs_1.promises.mkdir(`./${outDir}/sfdc`, { recursive: true });
|
|
105
103
|
if (flags.logs) {
|
|
106
104
|
try {
|
|
107
|
-
await fs_1.promises.access(
|
|
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(
|
|
118
|
-
const filePath =
|
|
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(
|
|
134
|
-
const jsonPromise = fs_1.promises.writeFile(
|
|
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 =
|
|
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;AAC/D,kDAAkD;AAClD,qDAAqD;AACrD,qCAAqC;AACrC,uDAAuD;AACvD,+BAA+B;AAC/B,2BAAoC;AACpC,
|
|
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;AAC/D,kDAAkD;AAClD,qDAAqD;AACrD,qCAAqC;AACrC,uDAAuD;AACvD,+BAA+B;AAC/B,2BAAoC;AACpC,iEAA+D;AAC/D,2CAAkE;AAClE,kCAAmC;AACnC,6BAAsB;AAGtB,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;AAMvF,MAAqB,cAAe,SAAQ,2BAAiB;IA2DjD,MAAM,CAAC,eAAe,CAAC,EAAU;QACrC,MAAM,YAAY,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAE9D,YAAY,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE;gBACf,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;aACvD;QACL,CAAC,CAAC,CAAC;Q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oB,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"}
|
|
@@ -15,7 +15,10 @@ export default class ButlerPbImport extends SfCommand<ButlerPbImportResult> {
|
|
|
15
15
|
stage: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
16
|
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
17
17
|
logs: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
id: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
18
19
|
};
|
|
19
20
|
private static getTargetPath;
|
|
21
|
+
private static getFiles;
|
|
22
|
+
private static getDocConfigIds;
|
|
20
23
|
run(): Promise<ButlerPbImportResult>;
|
|
21
24
|
}
|
|
@@ -27,13 +27,44 @@ class ButlerPbImport extends sf_plugins_core_1.SfCommand {
|
|
|
27
27
|
}
|
|
28
28
|
throw new Error('Unsupported record type');
|
|
29
29
|
}
|
|
30
|
+
static getFiles(dir, docConfigIds, files) {
|
|
31
|
+
const fileList = fs.readdirSync(dir, { withFileTypes: true });
|
|
32
|
+
for (const file of fileList) {
|
|
33
|
+
const name = `${dir}/${file.name}`;
|
|
34
|
+
if (fs.statSync(name).isDirectory() && file.name === 'sfdc') {
|
|
35
|
+
ButlerPbImport.getFiles(name, docConfigIds, files);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
if (!docConfigIds.includes(path.parse(file.name).name))
|
|
39
|
+
continue;
|
|
40
|
+
files.push(name);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (files.length <= 0) {
|
|
44
|
+
throw new Error('No matching files found');
|
|
45
|
+
}
|
|
46
|
+
return files;
|
|
47
|
+
}
|
|
48
|
+
static getDocConfigIds(id) {
|
|
49
|
+
const docConfigIds = id.split(/([\w-]{36})/).filter((n) => n);
|
|
50
|
+
docConfigIds.forEach((docId) => {
|
|
51
|
+
if (!docId.trim()) {
|
|
52
|
+
docConfigIds.splice(docConfigIds.indexOf(docId), 1);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
if (docConfigIds.length <= 0) {
|
|
56
|
+
throw new Error('No matching Doc Configs ids found');
|
|
57
|
+
}
|
|
58
|
+
return docConfigIds;
|
|
59
|
+
}
|
|
30
60
|
async run() {
|
|
31
61
|
const { flags } = await this.parse(ButlerPbImport);
|
|
62
|
+
const docConfigIds = ButlerPbImport.getDocConfigIds(flags.id);
|
|
32
63
|
const zipArray = [];
|
|
33
64
|
const jsonArray = [];
|
|
34
|
-
const files =
|
|
65
|
+
const files = ButlerPbImport.getFiles(flags.config, docConfigIds, []);
|
|
35
66
|
await Promise.all(files.map((fileName) => {
|
|
36
|
-
const fullPath =
|
|
67
|
+
const fullPath = fileName;
|
|
37
68
|
if (fileName.endsWith('.json')) {
|
|
38
69
|
jsonArray.push(fullPath);
|
|
39
70
|
}
|
|
@@ -60,6 +91,8 @@ class ButlerPbImport extends sf_plugins_core_1.SfCommand {
|
|
|
60
91
|
catch (e) {
|
|
61
92
|
throw new Error('Failed to write data to the target Salesforce org');
|
|
62
93
|
}
|
|
94
|
+
if (flags.logs)
|
|
95
|
+
this.log(`zipArray.length - ${zipArray.length}`);
|
|
63
96
|
if (zipArray.length === 0 || !flags.endpoint) {
|
|
64
97
|
return { success: false };
|
|
65
98
|
}
|
|
@@ -158,6 +191,11 @@ ButlerPbImport.flags = {
|
|
|
158
191
|
summary: messages.getMessage('flags.logs.summary'),
|
|
159
192
|
char: 'l',
|
|
160
193
|
}),
|
|
194
|
+
id: sf_plugins_core_1.Flags.string({
|
|
195
|
+
summary: messages.getMessage('flags.id.summary'),
|
|
196
|
+
char: 'i',
|
|
197
|
+
required: true,
|
|
198
|
+
}),
|
|
161
199
|
};
|
|
162
200
|
exports.default = ButlerPbImport;
|
|
163
201
|
//# sourceMappingURL=import.js.map
|
|
@@ -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;
|
|
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;IA6CjE,MAAM,CAAC,aAAa,CAAC,UAAkB;QAC7C,QAAQ,UAAU,EAAE;YAClB,KAAK,OAAO;gBACV,OAAO,0BAA0B,CAAC;YACpC,KAAK,MAAM;gBACT,OAAO,sBAAsB,CAAC;YAChC,KAAK,MAAM;gBACT,OAAO,2BAA2B,CAAC;YACrC,KAAK,KAAK;gBACR,OAAO,0BAA0B,CAAC;YACpC,KAAK,OAAO;gBACV,OAAO,sBAAsB,CAAC;YAChC,KAAK,KAAK;gBACR,OAAO,0BAA0B,CAAC;SAC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1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.14",
|
|
3
3
|
"commands": {
|
|
4
4
|
"butler:pb:export": {
|
|
5
5
|
"id": "butler:pb:export",
|
|
@@ -179,6 +179,14 @@
|
|
|
179
179
|
"char": "l",
|
|
180
180
|
"summary": "Summary for logs.",
|
|
181
181
|
"allowNo": false
|
|
182
|
+
},
|
|
183
|
+
"id": {
|
|
184
|
+
"name": "id",
|
|
185
|
+
"type": "option",
|
|
186
|
+
"char": "i",
|
|
187
|
+
"summary": "Summary for id.",
|
|
188
|
+
"required": true,
|
|
189
|
+
"multiple": false
|
|
182
190
|
}
|
|
183
191
|
},
|
|
184
192
|
"args": {}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.14",
|
|
5
5
|
"script": {
|
|
6
6
|
"postinstall": "sf plugins link @pdfbutler/migration-cli"
|
|
7
7
|
},
|