@terafina/tffa-sfdx-plugin 16.0.3 → 17.0.0-rc.10
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 +75 -112
- package/lib/commands/tffa/apexdoc.d.ts +7 -6
- package/lib/commands/tffa/apexdoc.js +10 -9
- package/lib/commands/tffa/apexdoc.js.map +1 -1
- package/lib/commands/tffa/lint.d.ts +10 -9
- package/lib/commands/tffa/lint.js +21 -19
- package/lib/commands/tffa/lint.js.map +1 -1
- package/lib/commands/tffa/meta.d.ts +8 -8
- package/lib/commands/tffa/meta.js +12 -11
- package/lib/commands/tffa/meta.js.map +1 -1
- package/lib/commands/tffa/ping.d.ts +3 -7
- package/lib/commands/tffa/ping.js +4 -6
- package/lib/commands/tffa/ping.js.map +1 -1
- package/lib/commands/tffa/source/apiset.d.ts +5 -6
- package/lib/commands/tffa/source/apiset.js +13 -13
- package/lib/commands/tffa/source/apiset.js.map +1 -1
- package/lib/commands/tffa/source/createfield.d.ts +12 -3
- package/lib/commands/tffa/source/createfield.js +41 -30
- package/lib/commands/tffa/source/createfield.js.map +1 -1
- package/oclif.manifest.json +634 -1
- package/package.json +31 -30
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ $ npm install -g @terafina/tffa-sfdx-plugin
|
|
|
41
41
|
$ sfdx COMMAND
|
|
42
42
|
running command...
|
|
43
43
|
$ sfdx (--version|-v)
|
|
44
|
-
@terafina/tffa-sfdx-plugin/
|
|
44
|
+
@terafina/tffa-sfdx-plugin/17.0.0-rc.10 linux-x64 node-v18.14.0
|
|
45
45
|
$ sfdx --help [COMMAND]
|
|
46
46
|
USAGE
|
|
47
47
|
$ sfdx COMMAND
|
|
@@ -52,27 +52,27 @@ USAGE
|
|
|
52
52
|
# Commands
|
|
53
53
|
|
|
54
54
|
<!-- commands -->
|
|
55
|
-
* [`sfdx help [
|
|
56
|
-
* [`sfdx tffa:apexdoc
|
|
55
|
+
* [`sfdx help [COMMANDS]`](#sfdx-help-commands)
|
|
56
|
+
* [`sfdx tffa:apexdoc`](#sfdx-tffaapexdoc)
|
|
57
57
|
* [`sfdx tffa:data:export -s <array> [-d <string>] [-g <string>] [-o <array>] [-c <array>] [-i] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffadataexport--s-array--d-string--g-string--o-array--c-array--i--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
58
58
|
* [`sfdx tffa:data:import [-f <array>] [-p <string>] [-s <array>] [-i] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-tffadataimport--f-array--p-string--s-array--i--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
59
|
-
* [`sfdx tffa:lint
|
|
60
|
-
* [`sfdx tffa:meta
|
|
61
|
-
* [`sfdx tffa:ping
|
|
62
|
-
* [`sfdx tffa:source:apiset
|
|
63
|
-
* [`sfdx tffa:source:createfield
|
|
59
|
+
* [`sfdx tffa:lint`](#sfdx-tffalint)
|
|
60
|
+
* [`sfdx tffa:meta`](#sfdx-tffameta)
|
|
61
|
+
* [`sfdx tffa:ping`](#sfdx-tffaping)
|
|
62
|
+
* [`sfdx tffa:source:apiset`](#sfdx-tffasourceapiset)
|
|
63
|
+
* [`sfdx tffa:source:createfield`](#sfdx-tffasourcecreatefield)
|
|
64
64
|
* [`sfdx version`](#sfdx-version)
|
|
65
65
|
|
|
66
|
-
## `sfdx help [
|
|
66
|
+
## `sfdx help [COMMANDS]`
|
|
67
67
|
|
|
68
68
|
Display help for sfdx.
|
|
69
69
|
|
|
70
70
|
```
|
|
71
71
|
USAGE
|
|
72
|
-
$ sfdx help [
|
|
72
|
+
$ sfdx help [COMMANDS] [-n]
|
|
73
73
|
|
|
74
74
|
ARGUMENTS
|
|
75
|
-
|
|
75
|
+
COMMANDS Command to show help for.
|
|
76
76
|
|
|
77
77
|
FLAGS
|
|
78
78
|
-n, --nested-commands Include all nested commands in the output.
|
|
@@ -81,24 +81,22 @@ DESCRIPTION
|
|
|
81
81
|
Display help for sfdx.
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.
|
|
84
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.4/src/commands/help.ts)_
|
|
85
85
|
|
|
86
|
-
## `sfdx tffa:apexdoc
|
|
86
|
+
## `sfdx tffa:apexdoc`
|
|
87
87
|
|
|
88
88
|
Command to generate apex documentation similar to javadoc based on the comments in apex classes.
|
|
89
89
|
|
|
90
90
|
```
|
|
91
91
|
USAGE
|
|
92
|
-
$ sfdx tffa:apexdoc [-s <
|
|
93
|
-
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
92
|
+
$ sfdx tffa:apexdoc [--json] [-s <value>] [-d <value>]
|
|
94
93
|
|
|
95
94
|
FLAGS
|
|
96
|
-
-d, --destfolder=<value>
|
|
97
|
-
-s, --sourcefolder=<value>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
--
|
|
101
|
-
this command invocation
|
|
95
|
+
-d, --destfolder=<value> directory to generate the api docs
|
|
96
|
+
-s, --sourcefolder=<value> [default: .] directory containing sfdx project
|
|
97
|
+
|
|
98
|
+
GLOBAL FLAGS
|
|
99
|
+
--json Format output as json.
|
|
102
100
|
|
|
103
101
|
DESCRIPTION
|
|
104
102
|
Command to generate apex documentation similar to javadoc based on the comments in apex classes.
|
|
@@ -111,7 +109,7 @@ EXAMPLES
|
|
|
111
109
|
$ sfdx tffa:apexdoc
|
|
112
110
|
```
|
|
113
111
|
|
|
114
|
-
_See code: [src/commands/tffa/apexdoc.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
112
|
+
_See code: [src/commands/tffa/apexdoc.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v17.0.0-rc.10/src/commands/tffa/apexdoc.ts)_
|
|
115
113
|
|
|
116
114
|
## `sfdx tffa:data:export -s <array> [-d <string>] [-g <string>] [-o <array>] [-c <array>] [-i] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
117
115
|
|
|
@@ -180,7 +178,7 @@ EXAMPLES
|
|
|
180
178
|
Writing 144 records to ./data/configuration/DisclosureMatrix__c.json
|
|
181
179
|
```
|
|
182
180
|
|
|
183
|
-
_See code: [src/commands/tffa/data/export.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
181
|
+
_See code: [src/commands/tffa/data/export.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v17.0.0-rc.10/src/commands/tffa/data/export.ts)_
|
|
184
182
|
|
|
185
183
|
## `sfdx tffa:data:import [-f <array>] [-p <string>] [-s <array>] [-i] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
186
184
|
|
|
@@ -268,28 +266,23 @@ EXAMPLES
|
|
|
268
266
|
Importing record(s) and relationships of tffa__AddOnService__c... done
|
|
269
267
|
```
|
|
270
268
|
|
|
271
|
-
_See code: [src/commands/tffa/data/import.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
269
|
+
_See code: [src/commands/tffa/data/import.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v17.0.0-rc.10/src/commands/tffa/data/import.ts)_
|
|
272
270
|
|
|
273
|
-
## `sfdx tffa:lint
|
|
271
|
+
## `sfdx tffa:lint`
|
|
274
272
|
|
|
275
273
|
Scans a sfdx project and provide a violations report based on defined standards.
|
|
276
274
|
|
|
277
275
|
```
|
|
278
276
|
USAGE
|
|
279
|
-
$ sfdx tffa:lint [-s <
|
|
280
|
-
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
277
|
+
$ sfdx tffa:lint [-j] [-s <value>] [-m <value>] [-r <value>] [-e] [-f]
|
|
281
278
|
|
|
282
279
|
FLAGS
|
|
283
|
-
-e, --eject
|
|
284
|
-
-f, --level
|
|
285
|
-
-j, --json
|
|
286
|
-
-m, --minapi=<value>
|
|
287
|
-
|
|
288
|
-
-
|
|
289
|
-
-s, --sourcefolder=<value> [default: .] directory containing
|
|
290
|
-
sfdx project
|
|
291
|
-
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
292
|
-
this command invocation
|
|
280
|
+
-e, --eject update local pmd ruleset
|
|
281
|
+
-f, --level emit fatal violations only
|
|
282
|
+
-j, --json generate json output
|
|
283
|
+
-m, --minapi=<value> [default: 56] minimum api version to use during quality checks
|
|
284
|
+
-r, --rulesetpath=<value> path to pmd ruleset
|
|
285
|
+
-s, --sourcefolder=<value> [default: .] directory containing sfdx project
|
|
293
286
|
|
|
294
287
|
DESCRIPTION
|
|
295
288
|
Scans a sfdx project and provide a violations report based on defined standards.
|
|
@@ -327,27 +320,26 @@ EXAMPLES
|
|
|
327
320
|
$sfdx tffa:lint
|
|
328
321
|
```
|
|
329
322
|
|
|
330
|
-
_See code: [src/commands/tffa/lint.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
323
|
+
_See code: [src/commands/tffa/lint.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v17.0.0-rc.10/src/commands/tffa/lint.ts)_
|
|
331
324
|
|
|
332
|
-
## `sfdx tffa:meta
|
|
325
|
+
## `sfdx tffa:meta`
|
|
333
326
|
|
|
334
327
|
Scan a sfdx project for generating metadata summary information
|
|
335
328
|
|
|
336
329
|
```
|
|
337
330
|
USAGE
|
|
338
|
-
$ sfdx tffa:meta [-s <
|
|
339
|
-
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
331
|
+
$ sfdx tffa:meta [--json] [-s <value>] [-d <value>] [-c <value>] [-o json|csv|human] [-f]
|
|
340
332
|
|
|
341
333
|
FLAGS
|
|
342
|
-
-c, --clientname=<value>
|
|
343
|
-
-d, --destpath=<value>
|
|
344
|
-
-f, --fields
|
|
345
|
-
-o, --output
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
334
|
+
-c, --clientname=<value> [default: .] name of the client
|
|
335
|
+
-d, --destpath=<value> [default: .] full path output file
|
|
336
|
+
-f, --fields generate field output
|
|
337
|
+
-o, --output=<option> output format json csv human
|
|
338
|
+
<options: json|csv|human>
|
|
339
|
+
-s, --sourcefolder=<value> [default: .] directory containing sfdx project
|
|
340
|
+
|
|
341
|
+
GLOBAL FLAGS
|
|
342
|
+
--json Format output as json.
|
|
351
343
|
|
|
352
344
|
DESCRIPTION
|
|
353
345
|
Scan a sfdx project for generating metadata summary information
|
|
@@ -356,20 +348,18 @@ EXAMPLES
|
|
|
356
348
|
$ sfdx tffa:meta
|
|
357
349
|
```
|
|
358
350
|
|
|
359
|
-
_See code: [src/commands/tffa/meta.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
351
|
+
_See code: [src/commands/tffa/meta.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v17.0.0-rc.10/src/commands/tffa/meta.ts)_
|
|
360
352
|
|
|
361
|
-
## `sfdx tffa:ping
|
|
353
|
+
## `sfdx tffa:ping`
|
|
362
354
|
|
|
363
355
|
Ping and test the plugin
|
|
364
356
|
|
|
365
357
|
```
|
|
366
358
|
USAGE
|
|
367
|
-
$ sfdx tffa:ping [--json]
|
|
359
|
+
$ sfdx tffa:ping [--json]
|
|
368
360
|
|
|
369
|
-
FLAGS
|
|
370
|
-
--json
|
|
371
|
-
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
372
|
-
this command invocation
|
|
361
|
+
GLOBAL FLAGS
|
|
362
|
+
--json Format output as json.
|
|
373
363
|
|
|
374
364
|
DESCRIPTION
|
|
375
365
|
Ping and test the plugin
|
|
@@ -378,26 +368,22 @@ EXAMPLES
|
|
|
378
368
|
$ sfdx tffa:ping
|
|
379
369
|
```
|
|
380
370
|
|
|
381
|
-
_See code: [src/commands/tffa/ping.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
371
|
+
_See code: [src/commands/tffa/ping.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v17.0.0-rc.10/src/commands/tffa/ping.ts)_
|
|
382
372
|
|
|
383
|
-
## `sfdx tffa:source:apiset
|
|
373
|
+
## `sfdx tffa:source:apiset`
|
|
384
374
|
|
|
385
375
|
Upgrades the current project and all metadata to the latest API version
|
|
386
376
|
|
|
387
377
|
```
|
|
388
378
|
USAGE
|
|
389
|
-
$ sfdx tffa:source:apiset [
|
|
390
|
-
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
379
|
+
$ sfdx tffa:source:apiset [--json] [-s <value>] [-a <value>]
|
|
391
380
|
|
|
392
381
|
FLAGS
|
|
393
|
-
-a, --api=<value>
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
--json format output as json
|
|
399
|
-
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
400
|
-
this command invocation
|
|
382
|
+
-a, --api=<value> [default: 56] specify the API version
|
|
383
|
+
-s, --sourcefolder=<value> [default: .] directory containing sfdx project
|
|
384
|
+
|
|
385
|
+
GLOBAL FLAGS
|
|
386
|
+
--json Format output as json.
|
|
401
387
|
|
|
402
388
|
DESCRIPTION
|
|
403
389
|
Upgrades the current project and all metadata to the latest API version
|
|
@@ -406,57 +392,34 @@ EXAMPLES
|
|
|
406
392
|
$ sfdx tffa:source:apiset
|
|
407
393
|
```
|
|
408
394
|
|
|
409
|
-
_See code: [src/commands/tffa/source/apiset.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
395
|
+
_See code: [src/commands/tffa/source/apiset.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v17.0.0-rc.10/src/commands/tffa/source/apiset.ts)_
|
|
410
396
|
|
|
411
|
-
## `sfdx tffa:source:createfield
|
|
397
|
+
## `sfdx tffa:source:createfield`
|
|
412
398
|
|
|
413
399
|
Creates an SObject field from the specified parameters.
|
|
414
400
|
|
|
415
401
|
```
|
|
416
402
|
USAGE
|
|
417
|
-
$ sfdx tffa:source:createfield -s <
|
|
403
|
+
$ sfdx tffa:source:createfield -s <value> -n <value> -t
|
|
418
404
|
checkbox|currency|date|datetime|email|number|percent|phone|picklist|picklist-multi|text|textarea|textarea-long|texta
|
|
419
|
-
rea-rich [-r] [-l <
|
|
420
|
-
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
405
|
+
rea-rich [--json] [-r] [-l <value>] [-d <value>] [-p <value>] [-v <value>]
|
|
421
406
|
|
|
422
407
|
FLAGS
|
|
423
|
-
-d, --description=<value>
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
408
|
+
-d, --description=<value> description of the field
|
|
409
|
+
-l, --length=<value> length of text field or textarea (long|rich) field; defaults to 255 for text field
|
|
410
|
+
and 1024 for textarea field
|
|
411
|
+
-n, --name=<value> (required) the API name of the field
|
|
412
|
+
-p, --permissionsets=<value>... comma-separated list of permission sets to which the field needs to be added;
|
|
413
|
+
defaults to all permission sets in the project
|
|
414
|
+
-r, --required whether field is required; skips addition to permission sets
|
|
415
|
+
-s, --sobjecttype=<value> (required) the API name of the object for which the field needs to be created
|
|
416
|
+
-t, --type=<option> (required) [default: text] type of the field
|
|
417
|
+
<options: checkbox|currency|date|datetime|email|number|percent|phone|picklist|picklis
|
|
418
|
+
t-multi|text|textarea|textarea-long|textarea-rich>
|
|
419
|
+
-v, --valuesetname=<value> name of the global value set if the field is a picklist or multi-select picklist type
|
|
435
420
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
-s, --sobjecttype=<value>
|
|
440
|
-
(required) the API name of the object for which the field needs to be created
|
|
441
|
-
|
|
442
|
-
-t, --type=(checkbox|currency|date|datetime|email|number|percent|phone|picklist|picklist-multi|text|textarea|textarea-
|
|
443
|
-
long|textarea-rich)
|
|
444
|
-
(required) [default: text] type of the field
|
|
445
|
-
|
|
446
|
-
-u, --targetusername=<value>
|
|
447
|
-
username or alias for the target org; overrides default target org
|
|
448
|
-
|
|
449
|
-
-v, --valuesetname=<value>
|
|
450
|
-
name of the global value set if the field is a picklist or multi-select picklist type
|
|
451
|
-
|
|
452
|
-
--apiversion=<value>
|
|
453
|
-
override the api version used for api requests made by this command
|
|
454
|
-
|
|
455
|
-
--json
|
|
456
|
-
format output as json
|
|
457
|
-
|
|
458
|
-
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)
|
|
459
|
-
[default: warn] logging level for this command invocation
|
|
421
|
+
GLOBAL FLAGS
|
|
422
|
+
--json Format output as json.
|
|
460
423
|
|
|
461
424
|
DESCRIPTION
|
|
462
425
|
Creates an SObject field from the specified parameters.
|
|
@@ -493,7 +456,7 @@ EXAMPLES
|
|
|
493
456
|
Creates a long textarea field
|
|
494
457
|
```
|
|
495
458
|
|
|
496
|
-
_See code: [src/commands/tffa/source/createfield.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/
|
|
459
|
+
_See code: [src/commands/tffa/source/createfield.ts](https://github.com/terafina/tffa-sfdx-plugin/blob/v17.0.0-rc.10/src/commands/tffa/source/createfield.ts)_
|
|
497
460
|
|
|
498
461
|
## `sfdx version`
|
|
499
462
|
|
|
@@ -513,5 +476,5 @@ FLAG DESCRIPTIONS
|
|
|
513
476
|
Additionally shows the architecture, node version, operating system, and versions of plugins that the CLI is using.
|
|
514
477
|
```
|
|
515
478
|
|
|
516
|
-
_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v1.1
|
|
479
|
+
_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v1.2.1/src/commands/version.ts)_
|
|
517
480
|
<!-- commandsstop -->
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) NCR Terafina
|
|
3
3
|
**/
|
|
4
|
-
import {
|
|
5
|
-
export default class ApexDoc extends
|
|
4
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
5
|
+
export default class ApexDoc extends SfCommand<void> {
|
|
6
6
|
static description: string;
|
|
7
|
+
private logger;
|
|
7
8
|
static examples: string[];
|
|
8
9
|
private currentFile;
|
|
9
|
-
|
|
10
|
-
sourcefolder:
|
|
11
|
-
destfolder:
|
|
10
|
+
static readonly flags: {
|
|
11
|
+
sourcefolder: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
destfolder: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
13
|
};
|
|
13
|
-
run(): Promise<
|
|
14
|
+
run(): Promise<void>;
|
|
14
15
|
/**
|
|
15
16
|
* Entry point for the program. Called by SFDX on extension activation.
|
|
16
17
|
*
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
**/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
|
-
const command_1 = require("@salesforce/command");
|
|
8
7
|
const Models = tslib_1.__importStar(require("../../services/apexdoc/common/models"));
|
|
9
8
|
const core_1 = require("@salesforce/core");
|
|
10
9
|
const settings_1 = tslib_1.__importStar(require("../../services/apexdoc/common/settings"));
|
|
@@ -14,20 +13,22 @@ const perf_hooks_1 = require("perf_hooks");
|
|
|
14
13
|
const line_reader_1 = tslib_1.__importDefault(require("../../services/apexdoc/common/line-reader"));
|
|
15
14
|
const utils_1 = tslib_1.__importDefault(require("../../services/apexdoc/common/utils"));
|
|
16
15
|
const array_utils_1 = require("../../services/apexdoc/common/array-utils");
|
|
16
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
17
17
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
18
18
|
const messages = core_1.Messages.loadMessages('@terafina/tffa-sfdx-plugin', 'apexdoc');
|
|
19
|
-
class ApexDoc extends
|
|
19
|
+
class ApexDoc extends sf_plugins_core_1.SfCommand {
|
|
20
20
|
async run() {
|
|
21
|
-
|
|
21
|
+
this.logger = core_1.Logger.childFromRoot(this.constructor.name);
|
|
22
|
+
const { flags } = await this.parse(ApexDoc);
|
|
23
|
+
await core_1.SfProject.resolve(flags.sourcefolder);
|
|
22
24
|
try {
|
|
23
|
-
settings_1.default.config = settings_1.default.getConfig(settings_1.Feature.ENGINE,
|
|
25
|
+
settings_1.default.config = settings_1.default.getConfig(settings_1.Feature.ENGINE, flags.sourcefolder, flags.destfolder);
|
|
24
26
|
this.generateDocs(settings_1.default.config);
|
|
25
27
|
}
|
|
26
28
|
catch (e) {
|
|
27
29
|
this.logger.error(e);
|
|
28
|
-
throw new core_1.
|
|
30
|
+
throw new core_1.SfError(e.message, 'XMLNotFoundError');
|
|
29
31
|
}
|
|
30
|
-
return '';
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
34
|
* Entry point for the program. Called by SFDX on extension activation.
|
|
@@ -267,13 +268,13 @@ class ApexDoc extends command_1.SfdxCommand {
|
|
|
267
268
|
exports.default = ApexDoc;
|
|
268
269
|
ApexDoc.description = messages.getMessage('commandDescription');
|
|
269
270
|
ApexDoc.examples = [`$ sfdx tffa:apexdoc`];
|
|
270
|
-
ApexDoc.
|
|
271
|
-
sourcefolder:
|
|
271
|
+
ApexDoc.flags = {
|
|
272
|
+
sourcefolder: sf_plugins_core_1.Flags.directory({
|
|
272
273
|
char: 's',
|
|
273
274
|
description: messages.getMessage('sourceFolderDescription'),
|
|
274
275
|
default: '.'
|
|
275
276
|
}),
|
|
276
|
-
destfolder:
|
|
277
|
+
destfolder: sf_plugins_core_1.Flags.directory({
|
|
277
278
|
char: 'd',
|
|
278
279
|
description: messages.getMessage('destFolderDescription')
|
|
279
280
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apexdoc.js","sourceRoot":"","sources":["../../../src/commands/tffa/apexdoc.ts"],"names":[],"mappings":";AAAA;;IAEI;;;AAEJ,
|
|
1
|
+
{"version":3,"file":"apexdoc.js","sourceRoot":"","sources":["../../../src/commands/tffa/apexdoc.ts"],"names":[],"mappings":";AAAA;;IAEI;;;AAEJ,qFAA+D;AAC/D,2CAAwE;AAExE,2FAA2E;AAC3E,sGAAqE;AACrE,+BAAgC;AAChC,2CAAyC;AACzC,oGAAmE;AACnE,wFAAwD;AACxD,2EAAiE;AACjE,iEAA+D;AAE/D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,4BAA4B,EAAE,SAAS,CAAC,CAAC;AAEhF,MAAqB,OAAQ,SAAQ,2BAAe;IAmB3C,KAAK,CAAC,GAAG;QACd,IAAI,CAAC,MAAM,GAAG,aAAM,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,gBAAS,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC5C,IAAI;YACF,kBAAQ,CAAC,MAAM,GAAG,kBAAQ,CAAC,SAAS,CAAgB,kBAAO,CAAC,MAAM,EAAE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Command } from '@salesforce/sf-plugins-core';
|
|
5
|
+
export default class Lint extends SfCommand<void> {
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
private logger;
|
|
9
|
+
static readonly flags: {
|
|
10
|
+
sourcefolder: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
minapi: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
rulesetpath: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
eject: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
level: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
};
|
|
16
17
|
run(): Promise<any>;
|
|
17
18
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
**/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
|
-
const
|
|
7
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
8
8
|
const core_1 = require("@salesforce/core");
|
|
9
9
|
const apex_class_scan_1 = tslib_1.__importDefault(require("../../services/lint/apex-class-scan"));
|
|
10
10
|
const ignored_files_1 = tslib_1.__importDefault(require("../../utils/ignored-files"));
|
|
@@ -15,30 +15,32 @@ const eslint_scan_1 = tslib_1.__importDefault(require("../../services/lint/eslin
|
|
|
15
15
|
const stylelint_scan_1 = tslib_1.__importDefault(require("../../services/lint/stylelint-scan"));
|
|
16
16
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
17
17
|
const messages = core_1.Messages.loadMessages('@terafina/tffa-sfdx-plugin', 'lint');
|
|
18
|
-
class Lint extends
|
|
18
|
+
class Lint extends sf_plugins_core_1.SfCommand {
|
|
19
19
|
async run() {
|
|
20
|
-
|
|
20
|
+
this.logger = core_1.Logger.childFromRoot(this.constructor.name);
|
|
21
|
+
const { flags } = await this.parse(Lint);
|
|
22
|
+
const project = await core_1.SfProject.resolve(flags.sourcefolder);
|
|
21
23
|
const projectJson = await project.resolveProjectConfig();
|
|
22
24
|
const namespace = projectJson.namespace;
|
|
23
25
|
this.logger.info('namespace: [' + namespace + ']');
|
|
24
|
-
if (
|
|
25
|
-
await new apex_pmd_1.default().eject(
|
|
26
|
+
if (flags.eject) {
|
|
27
|
+
await new apex_pmd_1.default().eject(flags.sourcefolder);
|
|
26
28
|
return;
|
|
27
29
|
}
|
|
28
30
|
const violations = [];
|
|
29
31
|
let mViolations = [];
|
|
30
|
-
await ignored_files_1.default.init(
|
|
31
|
-
mViolations = await new apex_class_scan_1.default().scan(
|
|
32
|
+
await ignored_files_1.default.init(flags.sourcefolder);
|
|
33
|
+
mViolations = await new apex_class_scan_1.default().scan(flags.sourcefolder);
|
|
32
34
|
violations.push(...mViolations);
|
|
33
|
-
mViolations = await new metadata_scan_1.default(namespace).scan(
|
|
35
|
+
mViolations = await new metadata_scan_1.default(namespace).scan(flags.sourcefolder, flags.minapi);
|
|
34
36
|
violations.push(...mViolations);
|
|
35
|
-
mViolations = await new apex_pmd_1.default().scan(
|
|
37
|
+
mViolations = await new apex_pmd_1.default().scan(flags.sourcefolder, flags.rulesetpath);
|
|
36
38
|
violations.push(...mViolations);
|
|
37
|
-
mViolations = await new eslint_scan_1.default().scan(
|
|
39
|
+
mViolations = await new eslint_scan_1.default().scan(flags.sourcefolder);
|
|
38
40
|
violations.push(...mViolations);
|
|
39
|
-
mViolations = await new stylelint_scan_1.default().scan(
|
|
41
|
+
mViolations = await new stylelint_scan_1.default().scan(flags.sourcefolder);
|
|
40
42
|
violations.push(...mViolations);
|
|
41
|
-
this.printViolations(
|
|
43
|
+
this.printViolations(flags.json, violations, flags.level);
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
46
|
* print output
|
|
@@ -62,30 +64,30 @@ class Lint extends command_1.SfdxCommand {
|
|
|
62
64
|
exports.default = Lint;
|
|
63
65
|
Lint.description = messages.getMessage('commandDescription');
|
|
64
66
|
Lint.examples = [`$sfdx tffa:lint`];
|
|
65
|
-
Lint.
|
|
66
|
-
sourcefolder:
|
|
67
|
+
Lint.flags = {
|
|
68
|
+
sourcefolder: sf_plugins_core_1.Flags.directory({
|
|
67
69
|
char: 's',
|
|
68
70
|
description: messages.getMessage('sourceFolderDescription'),
|
|
69
71
|
default: '.'
|
|
70
72
|
}),
|
|
71
|
-
minapi:
|
|
73
|
+
minapi: sf_plugins_core_1.Flags.integer({
|
|
72
74
|
char: 'm',
|
|
73
75
|
description: messages.getMessage('flagApiversionDescription'),
|
|
74
76
|
default: constants_1.Constants.API_VERSION
|
|
75
77
|
}),
|
|
76
|
-
json:
|
|
78
|
+
json: sf_plugins_core_1.Flags.boolean({
|
|
77
79
|
char: 'j',
|
|
78
80
|
description: 'generate json output'
|
|
79
81
|
}),
|
|
80
|
-
rulesetpath:
|
|
82
|
+
rulesetpath: sf_plugins_core_1.Flags.file({
|
|
81
83
|
char: 'r',
|
|
82
84
|
description: 'path to pmd ruleset'
|
|
83
85
|
}),
|
|
84
|
-
eject:
|
|
86
|
+
eject: sf_plugins_core_1.Flags.boolean({
|
|
85
87
|
char: 'e',
|
|
86
88
|
description: 'update local pmd ruleset'
|
|
87
89
|
}),
|
|
88
|
-
level:
|
|
90
|
+
level: sf_plugins_core_1.Flags.boolean({
|
|
89
91
|
char: 'f',
|
|
90
92
|
description: 'emit fatal violations only'
|
|
91
93
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../../src/commands/tffa/lint.ts"],"names":[],"mappings":";AAAA;;IAEI;;;AAEJ,
|
|
1
|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|
* Copyright (c) NCR Terafina
|
|
3
3
|
**/
|
|
4
|
-
import {
|
|
5
|
-
export default class Meta extends
|
|
4
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
5
|
+
export default class Meta extends SfCommand<void> {
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
|
-
|
|
9
|
-
sourcefolder:
|
|
10
|
-
destpath:
|
|
11
|
-
clientname:
|
|
12
|
-
output:
|
|
13
|
-
fields:
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
sourcefolder: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
destpath: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
clientname: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
+
fields: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
};
|
|
15
15
|
run(): Promise<any>;
|
|
16
16
|
}
|