sfdx-hardis 6.1.1 → 6.1.3

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.
@@ -3101,8 +3101,7 @@
3101
3101
  "title": "Create and initialize scratch org",
3102
3102
  "requiresProject": true,
3103
3103
  "requiresSfdxPlugins": [
3104
- "sfdmu",
3105
- "texei-sfdx-plugin"
3104
+ "sfdmu"
3106
3105
  ],
3107
3106
  "isESM": true,
3108
3107
  "relativePath": [
@@ -9642,109 +9641,6 @@
9642
9641
  "auth:configure:project:hardis"
9643
9642
  ]
9644
9643
  },
9645
- "hardis:project:convert:profilestopermsets": {
9646
- "aliases": [],
9647
- "args": {},
9648
- "description": "\n## Command Behavior\n\n**Converts existing Salesforce Profiles into Permission Sets, facilitating a more granular and recommended security model.**\n\nThis command helps in migrating permissions from Profiles to Permission Sets, which is a best practice for managing user access in Salesforce. It creates a new Permission Set for each specified Profile, adopting a naming convention of `PS_PROFILENAME`.\n\nKey functionalities:\n\n- **Profile to Permission Set Conversion:** Automatically extracts permissions from a Profile and creates a corresponding Permission Set.\n- **Naming Convention:** New Permission Sets are named with a `PS_` prefix followed by the Profile name (e.g., `PS_Standard_User`).\n- **Exclusion Filter:** Allows you to exclude specific Profiles from the conversion process using the `--except` flag.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **External Plugin Integration:** It relies on the `shane-sfdx-plugins` (specifically the `sf shane:profile:convert` command) to perform the actual conversion.\n- **File System Scan:** It reads the contents of the `force-app/main/default/profiles` directory to identify all available Profile metadata files.\n- **Command Execution:** For each identified Profile (that is not excluded), it constructs and executes the `sf shane:profile:convert` command with the appropriate Profile name and desired Permission Set name.\n- **Error Handling:** Includes basic error handling for the external command execution.\n</details>\n",
9649
- "examples": [
9650
- "$ sf hardis:project:convert:profilestopermsets"
9651
- ],
9652
- "flags": {
9653
- "json": {
9654
- "description": "Format output as json.",
9655
- "helpGroup": "GLOBAL",
9656
- "name": "json",
9657
- "allowNo": false,
9658
- "type": "boolean"
9659
- },
9660
- "flags-dir": {
9661
- "helpGroup": "GLOBAL",
9662
- "name": "flags-dir",
9663
- "summary": "Import flag values from a directory.",
9664
- "hasDynamicHelp": false,
9665
- "multiple": false,
9666
- "type": "option"
9667
- },
9668
- "except": {
9669
- "char": "e",
9670
- "description": "List of filters",
9671
- "name": "except",
9672
- "default": [],
9673
- "hasDynamicHelp": false,
9674
- "multiple": true,
9675
- "type": "option"
9676
- },
9677
- "debug": {
9678
- "char": "d",
9679
- "description": "Activate debug mode (more logs)",
9680
- "name": "debug",
9681
- "allowNo": false,
9682
- "type": "boolean"
9683
- },
9684
- "websocket": {
9685
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9686
- "name": "websocket",
9687
- "hasDynamicHelp": false,
9688
- "multiple": false,
9689
- "type": "option"
9690
- },
9691
- "skipauth": {
9692
- "description": "Skip authentication check when a default username is required",
9693
- "name": "skipauth",
9694
- "allowNo": false,
9695
- "type": "boolean"
9696
- }
9697
- },
9698
- "hasDynamicHelp": false,
9699
- "hiddenAliases": [],
9700
- "id": "hardis:project:convert:profilestopermsets",
9701
- "pluginAlias": "sfdx-hardis",
9702
- "pluginName": "sfdx-hardis",
9703
- "pluginType": "core",
9704
- "strict": true,
9705
- "enableJsonFlag": true,
9706
- "title": "Convert Profiles into Permission Sets",
9707
- "requiresProject": true,
9708
- "requiresSfdxPlugins": [
9709
- "shane-sfdx-plugins"
9710
- ],
9711
- "isESM": true,
9712
- "relativePath": [
9713
- "lib",
9714
- "commands",
9715
- "hardis",
9716
- "project",
9717
- "convert",
9718
- "profilestopermsets.js"
9719
- ],
9720
- "aliasPermutations": [],
9721
- "permutations": [
9722
- "hardis:project:convert:profilestopermsets",
9723
- "project:hardis:convert:profilestopermsets",
9724
- "project:convert:hardis:profilestopermsets",
9725
- "project:convert:profilestopermsets:hardis",
9726
- "hardis:convert:project:profilestopermsets",
9727
- "convert:hardis:project:profilestopermsets",
9728
- "convert:project:hardis:profilestopermsets",
9729
- "convert:project:profilestopermsets:hardis",
9730
- "hardis:convert:profilestopermsets:project",
9731
- "convert:hardis:profilestopermsets:project",
9732
- "convert:profilestopermsets:hardis:project",
9733
- "convert:profilestopermsets:project:hardis",
9734
- "hardis:project:profilestopermsets:convert",
9735
- "project:hardis:profilestopermsets:convert",
9736
- "project:profilestopermsets:hardis:convert",
9737
- "project:profilestopermsets:convert:hardis",
9738
- "hardis:profilestopermsets:project:convert",
9739
- "profilestopermsets:hardis:project:convert",
9740
- "profilestopermsets:project:hardis:convert",
9741
- "profilestopermsets:project:convert:hardis",
9742
- "hardis:profilestopermsets:convert:project",
9743
- "profilestopermsets:hardis:convert:project",
9744
- "profilestopermsets:convert:hardis:project",
9745
- "profilestopermsets:convert:project:hardis"
9746
- ]
9747
- },
9748
9644
  "hardis:project:clean:emptyitems": {
9749
9645
  "aliases": [],
9750
9646
  "args": {},
@@ -12405,12 +12301,19 @@
12405
12301
  "validate:deploy:project:hardis"
12406
12302
  ]
12407
12303
  },
12408
- "hardis:project:fix:profiletabs": {
12304
+ "hardis:project:generate:bypass": {
12409
12305
  "aliases": [],
12410
12306
  "args": {},
12411
- "description": "\n## Command Behavior\n\n**Interactively updates tab visibility settings in Salesforce profiles, addressing a common issue where tab visibilities are not correctly retrieved by `sf project retrieve start`.**\n\nThis command provides a user-friendly interface to manage tab settings within your profile XML files, ensuring that your local project accurately reflects the intended tab configurations in your Salesforce org.\n\nKey functionalities:\n\n- **Interactive Tab Selection:** Displays a multi-select menu of all available tabs in your org, allowing you to choose which tabs to update.\n- **Visibility Control:** Lets you set the visibility for the selected tabs to either `DefaultOn` (Visible) or `Hidden`.\n- **Profile Selection:** Presents a multi-select menu of all .profile-meta.xml files in your project, allowing you to apply the tab visibility changes to specific profiles.\n- **XML Updates:** Modifies the <tabVisibilities> section of the selected profile XML files to reflect the chosen tab settings. If a tab visibility setting already exists for a selected tab, it will be updated; otherwise, a new one will be added.\n- **Sorted Output:** The <tabVisibilities> in the updated profile XML files are sorted alphabetically for consistency and readability.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries the `TabDefinition` object using `soqlQueryTooling` to retrieve a list of all available tabs in the target org.\n- **File Discovery:** Uses `glob` to find all .profile-meta.xml files within the specified project path.\n- **Interactive Prompts:** Leverages the `prompts` library to create interactive menus for selecting tabs, visibility settings, and profiles.\n- **XML Parsing and Manipulation:** Uses `parseXmlFile` to read the content of profile XML files and `writeXmlFile` to write the modified content back. It manipulates the `tabVisibilities` array within the parsed XML to add or update tab settings.\n- **Array Sorting:** Employs the `sort-array` library to sort the `tabVisibilities` alphabetically by tab name.\n- **Logging:** Provides feedback to the user about which profiles have been updated and a summary of the changes.\n</details>\n",
12307
+ "description": "\n## Command Behavior\n\n**Generates custom permissions and permission sets to bypass specified Salesforce automations (Flows, Triggers, and Validation Rules) for specific sObjects.**\n\nThis command provides a controlled mechanism to temporarily or permanently disable automations for certain sObjects, which is invaluable for:\n\n- **Data Loading:** Bypassing validation rules or triggers during large data imports.\n- **Troubleshooting:** Isolating automation issues by temporarily disabling them.\n- **Development:** Allowing developers to work on specific sObjects without triggering complex automations.\n\nKey functionalities:\n\n- **sObject Selection:** You can specify a comma-separated list of sObjects to bypass (e.g., `Account,Contact`). If omitted, an interactive prompt will allow you to select from available sObjects.\n- **Automation Type Selection:** Choose which types of automations to bypass: `Flow`, `Trigger`, or `VR` (Validation Rules). If omitted, an interactive prompt will guide your selection.\n- **Automatic Bypass Application:** Optionally, the command can automatically inject bypass logic into Validation Rules and Triggers. This involves modifying the Apex code for Triggers and the XML for Validation Rules.\n- **Metadata Source:** You can choose to retrieve the metadata elements (Validation Rules, Triggers) from the org (`--metadata-source org`) or use local files (`--metadata-source local`). Retrieving from the org is recommended for accuracy.\n- **Custom Permission and Permission Set Generation:** For each selected sObject and automation type, it generates:\n - A **Custom Permission** (e.g., `BypassAccountFlows`) that acts as the bypass switch.\n - A **Permission Set** (e.g., `BypassAccountFlows`) that grants the generated Custom Permission.\n- **Credits Inclusion:** By default, generated XML files include a comment indicating they were generated by sfdx-hardis. This can be skipped using `--skip-credits`.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries `EntityDefinition` to list customizable sObjects and `ValidationRule` and `ApexTrigger` to find existing automations.\n- **Interactive Prompts:** Uses the `prompts` library to guide the user through selecting sObjects, automation types, and bypass application options.\n- **XML Generation:** Dynamically generates XML content for Custom Permissions and Permission Sets, including descriptions and labels that clearly indicate their purpose.\n- **File System Operations:** Uses `fs-extra` to create directories and write the generated Custom Permission and Permission Set XML files.\n- **Metadata Retrieval (for Bypass Application):** If `apply-to-vrs` or `apply-to-triggers` is used and `metadata-source` is `org`, it retrieves the relevant Validation Rule or Apex Trigger metadata from the org using `sf project retrieve start`.\n- **XML/Apex Code Modification:**\n - For Validation Rules, it modifies the `errorConditionFormula` in the XML to include a check for the bypass Custom Permission.\n - For Apex Triggers, it injects an `if` statement at the beginning of the trigger body to check for the bypass Custom Permission.\n- **`parseXmlFile` and `writeXmlFile`:** Used for reading and writing XML metadata files.\n- **`execCommand`:** Used for executing Salesforce CLI commands, particularly for metadata retrieval.\n- **Error Handling:** Includes checks for invalid sObject or automation selections and provides informative error messages.\n</details>\n",
12412
12308
  "examples": [
12413
- "$ sf hardis:project:fix:profiletabs"
12309
+ "$ sf hardis:project:generate:bypass",
12310
+ "$ sf hardis:project:generate:bypass --sObjects Account,Contact,Opportunity",
12311
+ "$ sf hardis:project:generate:bypass --automations Flow,Trigger,VR",
12312
+ "$ sf hardis:project:generate:bypass --sObjects Account,Opportunity --automations Flow,Trigger",
12313
+ "$ sf hardis:project:generate:bypass --skipCredits",
12314
+ "$ sf hardis:project:generate:bypass --apply-to-vrs",
12315
+ "$ sf hardis:project:generate:bypass --apply-to-triggers",
12316
+ "$ sf hardis:project:generate:bypass --metadata-source org"
12414
12317
  ],
12415
12318
  "flags": {
12416
12319
  "json": {
@@ -12428,21 +12331,41 @@
12428
12331
  "multiple": false,
12429
12332
  "type": "option"
12430
12333
  },
12431
- "path": {
12432
- "char": "p",
12433
- "description": "Root folder",
12434
- "name": "path",
12435
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12334
+ "target-org": {
12335
+ "aliases": [
12336
+ "targetusername",
12337
+ "u"
12338
+ ],
12339
+ "char": "o",
12340
+ "deprecateAliases": true,
12341
+ "name": "target-org",
12342
+ "noCacheDefault": true,
12343
+ "required": true,
12344
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12345
+ "hasDynamicHelp": true,
12346
+ "multiple": false,
12347
+ "type": "option"
12348
+ },
12349
+ "objects": {
12350
+ "aliases": [
12351
+ "sObjects"
12352
+ ],
12353
+ "char": "s",
12354
+ "description": "Comma-separated list of sObjects to bypass (e.g., Account,Contact,Opportunity). If omitted, you will be prompted to select.",
12355
+ "name": "objects",
12356
+ "required": false,
12436
12357
  "hasDynamicHelp": false,
12437
12358
  "multiple": false,
12438
12359
  "type": "option"
12439
12360
  },
12440
- "debug": {
12441
- "char": "d",
12442
- "description": "Activate debug mode (more logs)",
12443
- "name": "debug",
12444
- "allowNo": false,
12445
- "type": "boolean"
12361
+ "automations": {
12362
+ "char": "a",
12363
+ "description": "Comma-separated automations to bypass: Flow, Trigger, VR",
12364
+ "name": "automations",
12365
+ "required": false,
12366
+ "hasDynamicHelp": false,
12367
+ "multiple": false,
12368
+ "type": "option"
12446
12369
  },
12447
12370
  "websocket": {
12448
12371
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
@@ -12457,308 +12380,66 @@
12457
12380
  "allowNo": false,
12458
12381
  "type": "boolean"
12459
12382
  },
12460
- "target-org": {
12383
+ "skip-credits": {
12461
12384
  "aliases": [
12462
- "targetusername",
12463
- "u"
12385
+ "skipCredits"
12464
12386
  ],
12465
- "char": "o",
12466
- "deprecateAliases": true,
12467
- "name": "target-org",
12468
- "noCacheDefault": true,
12469
- "required": true,
12470
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12471
- "hasDynamicHelp": true,
12387
+ "char": "k",
12388
+ "description": "Omit the \"Generated by\" line in the XML files",
12389
+ "name": "skip-credits",
12390
+ "required": false,
12391
+ "allowNo": false,
12392
+ "type": "boolean"
12393
+ },
12394
+ "apply-to-vrs": {
12395
+ "aliases": [
12396
+ "applyToVrs"
12397
+ ],
12398
+ "description": "Apply bypass to Validation Rules",
12399
+ "name": "apply-to-vrs",
12400
+ "required": false,
12401
+ "allowNo": false,
12402
+ "type": "boolean"
12403
+ },
12404
+ "apply-to-triggers": {
12405
+ "aliases": [
12406
+ "applyToTriggers"
12407
+ ],
12408
+ "description": "Apply bypass to Triggers",
12409
+ "name": "apply-to-triggers",
12410
+ "required": false,
12411
+ "allowNo": false,
12412
+ "type": "boolean"
12413
+ },
12414
+ "metadata-source": {
12415
+ "aliases": [
12416
+ "metadataSource"
12417
+ ],
12418
+ "char": "r",
12419
+ "description": "Source of metadata elements to apply bypass to. Options: 'org' or 'local'.",
12420
+ "name": "metadata-source",
12421
+ "required": false,
12422
+ "hasDynamicHelp": false,
12472
12423
  "multiple": false,
12473
12424
  "type": "option"
12474
12425
  }
12475
12426
  },
12476
12427
  "hasDynamicHelp": true,
12477
12428
  "hiddenAliases": [],
12478
- "id": "hardis:project:fix:profiletabs",
12429
+ "id": "hardis:project:generate:bypass",
12479
12430
  "pluginAlias": "sfdx-hardis",
12480
12431
  "pluginName": "sfdx-hardis",
12481
12432
  "pluginType": "core",
12482
12433
  "strict": true,
12483
12434
  "enableJsonFlag": true,
12484
- "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
12485
- "requiresProject": true,
12486
12435
  "isESM": true,
12487
12436
  "relativePath": [
12488
12437
  "lib",
12489
12438
  "commands",
12490
12439
  "hardis",
12491
12440
  "project",
12492
- "fix",
12493
- "profiletabs.js"
12494
- ],
12495
- "aliasPermutations": [],
12496
- "permutations": [
12497
- "hardis:project:fix:profiletabs",
12498
- "project:hardis:fix:profiletabs",
12499
- "project:fix:hardis:profiletabs",
12500
- "project:fix:profiletabs:hardis",
12501
- "hardis:fix:project:profiletabs",
12502
- "fix:hardis:project:profiletabs",
12503
- "fix:project:hardis:profiletabs",
12504
- "fix:project:profiletabs:hardis",
12505
- "hardis:fix:profiletabs:project",
12506
- "fix:hardis:profiletabs:project",
12507
- "fix:profiletabs:hardis:project",
12508
- "fix:profiletabs:project:hardis",
12509
- "hardis:project:profiletabs:fix",
12510
- "project:hardis:profiletabs:fix",
12511
- "project:profiletabs:hardis:fix",
12512
- "project:profiletabs:fix:hardis",
12513
- "hardis:profiletabs:project:fix",
12514
- "profiletabs:hardis:project:fix",
12515
- "profiletabs:project:hardis:fix",
12516
- "profiletabs:project:fix:hardis",
12517
- "hardis:profiletabs:fix:project",
12518
- "profiletabs:hardis:fix:project",
12519
- "profiletabs:fix:hardis:project",
12520
- "profiletabs:fix:project:hardis"
12521
- ]
12522
- },
12523
- "hardis:project:fix:v53flexipages": {
12524
- "aliases": [],
12525
- "args": {},
12526
- "description": "\n## Command Behavior\n\n**Fixes Salesforce FlexiPages for compatibility with API Version 53.0 (Winter '22 release) by adding missing identifiers to component instances.**\n\nSalesforce introduced a change in API Version 53.0 that requires `identifier` tags within `componentInstance` and `fieldInstance` elements in FlexiPage metadata. If these identifiers are missing, deployments to orgs with API version 53.0 or higher will fail. This command automates the process of adding these missing identifiers, ensuring your FlexiPages remain deployable.\n\nKey functionalities:\n\n- **Targeted FlexiPage Processing:** Scans all .flexipage-meta.xml files within the specified root folder (defaults to current working directory).\n- **Identifier Injection:** Inserts a unique `identifier` tag (e.g., `SFDX_HARDIS_REPLACEMENT_ID`) into `componentInstance` and `fieldInstance` elements that lack one.\n\n**Important Note:** After running this command, ensure you update your `apiVersion` to `53.0` (or higher) in your `package.xml` and `sfdx-project.json` files.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find all .flexipage-meta.xml files.\n- **Content Reading:** Reads the XML content of each FlexiPage file.\n- **Regular Expression Replacement:** Employs a set of regular expressions to identify specific XML patterns (componentName.../componentName.../componentInstance, componentName.../componentName.../visibilityRule, fieldItem.../fieldItem.../fieldInstance) that are missing the `identifier` tag.\n- **Dynamic ID Generation:** For each match, it generates a unique identifier (e.g., `sfdxHardisIdX`) and injects it into the XML structure.\n- **File Writing:** If changes are made, the modified XML content is written back to the FlexiPage file using `fs.writeFile`.\n- **Logging:** Provides messages about which FlexiPages are being processed and a summary of the total number of identifiers added.\n</details>\n",
12527
- "examples": [
12528
- "$ sf hardis:project:fix:v53flexipages"
12529
- ],
12530
- "flags": {
12531
- "json": {
12532
- "description": "Format output as json.",
12533
- "helpGroup": "GLOBAL",
12534
- "name": "json",
12535
- "allowNo": false,
12536
- "type": "boolean"
12537
- },
12538
- "flags-dir": {
12539
- "helpGroup": "GLOBAL",
12540
- "name": "flags-dir",
12541
- "summary": "Import flag values from a directory.",
12542
- "hasDynamicHelp": false,
12543
- "multiple": false,
12544
- "type": "option"
12545
- },
12546
- "path": {
12547
- "char": "p",
12548
- "description": "Root folder",
12549
- "name": "path",
12550
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12551
- "hasDynamicHelp": false,
12552
- "multiple": false,
12553
- "type": "option"
12554
- },
12555
- "debug": {
12556
- "char": "d",
12557
- "description": "Activate debug mode (more logs)",
12558
- "name": "debug",
12559
- "allowNo": false,
12560
- "type": "boolean"
12561
- },
12562
- "websocket": {
12563
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12564
- "name": "websocket",
12565
- "hasDynamicHelp": false,
12566
- "multiple": false,
12567
- "type": "option"
12568
- },
12569
- "skipauth": {
12570
- "description": "Skip authentication check when a default username is required",
12571
- "name": "skipauth",
12572
- "allowNo": false,
12573
- "type": "boolean"
12574
- }
12575
- },
12576
- "hasDynamicHelp": false,
12577
- "hiddenAliases": [],
12578
- "id": "hardis:project:fix:v53flexipages",
12579
- "pluginAlias": "sfdx-hardis",
12580
- "pluginName": "sfdx-hardis",
12581
- "pluginType": "core",
12582
- "strict": true,
12583
- "enableJsonFlag": true,
12584
- "title": "Fix flexipages for v53",
12585
- "requiresProject": true,
12586
- "isESM": true,
12587
- "relativePath": [
12588
- "lib",
12589
- "commands",
12590
- "hardis",
12591
- "project",
12592
- "fix",
12593
- "v53flexipages.js"
12594
- ],
12595
- "aliasPermutations": [],
12596
- "permutations": [
12597
- "hardis:project:fix:v53flexipages",
12598
- "project:hardis:fix:v53flexipages",
12599
- "project:fix:hardis:v53flexipages",
12600
- "project:fix:v53flexipages:hardis",
12601
- "hardis:fix:project:v53flexipages",
12602
- "fix:hardis:project:v53flexipages",
12603
- "fix:project:hardis:v53flexipages",
12604
- "fix:project:v53flexipages:hardis",
12605
- "hardis:fix:v53flexipages:project",
12606
- "fix:hardis:v53flexipages:project",
12607
- "fix:v53flexipages:hardis:project",
12608
- "fix:v53flexipages:project:hardis",
12609
- "hardis:project:v53flexipages:fix",
12610
- "project:hardis:v53flexipages:fix",
12611
- "project:v53flexipages:hardis:fix",
12612
- "project:v53flexipages:fix:hardis",
12613
- "hardis:v53flexipages:project:fix",
12614
- "v53flexipages:hardis:project:fix",
12615
- "v53flexipages:project:hardis:fix",
12616
- "v53flexipages:project:fix:hardis",
12617
- "hardis:v53flexipages:fix:project",
12618
- "v53flexipages:hardis:fix:project",
12619
- "v53flexipages:fix:hardis:project",
12620
- "v53flexipages:fix:project:hardis"
12621
- ]
12622
- },
12623
- "hardis:project:generate:bypass": {
12624
- "aliases": [],
12625
- "args": {},
12626
- "description": "\n## Command Behavior\n\n**Generates custom permissions and permission sets to bypass specified Salesforce automations (Flows, Triggers, and Validation Rules) for specific sObjects.**\n\nThis command provides a controlled mechanism to temporarily or permanently disable automations for certain sObjects, which is invaluable for:\n\n- **Data Loading:** Bypassing validation rules or triggers during large data imports.\n- **Troubleshooting:** Isolating automation issues by temporarily disabling them.\n- **Development:** Allowing developers to work on specific sObjects without triggering complex automations.\n\nKey functionalities:\n\n- **sObject Selection:** You can specify a comma-separated list of sObjects to bypass (e.g., `Account,Contact`). If omitted, an interactive prompt will allow you to select from available sObjects.\n- **Automation Type Selection:** Choose which types of automations to bypass: `Flow`, `Trigger`, or `VR` (Validation Rules). If omitted, an interactive prompt will guide your selection.\n- **Automatic Bypass Application:** Optionally, the command can automatically inject bypass logic into Validation Rules and Triggers. This involves modifying the Apex code for Triggers and the XML for Validation Rules.\n- **Metadata Source:** You can choose to retrieve the metadata elements (Validation Rules, Triggers) from the org (`--metadata-source org`) or use local files (`--metadata-source local`). Retrieving from the org is recommended for accuracy.\n- **Custom Permission and Permission Set Generation:** For each selected sObject and automation type, it generates:\n - A **Custom Permission** (e.g., `BypassAccountFlows`) that acts as the bypass switch.\n - A **Permission Set** (e.g., `BypassAccountFlows`) that grants the generated Custom Permission.\n- **Credits Inclusion:** By default, generated XML files include a comment indicating they were generated by sfdx-hardis. This can be skipped using `--skip-credits`.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries `EntityDefinition` to list customizable sObjects and `ValidationRule` and `ApexTrigger` to find existing automations.\n- **Interactive Prompts:** Uses the `prompts` library to guide the user through selecting sObjects, automation types, and bypass application options.\n- **XML Generation:** Dynamically generates XML content for Custom Permissions and Permission Sets, including descriptions and labels that clearly indicate their purpose.\n- **File System Operations:** Uses `fs-extra` to create directories and write the generated Custom Permission and Permission Set XML files.\n- **Metadata Retrieval (for Bypass Application):** If `apply-to-vrs` or `apply-to-triggers` is used and `metadata-source` is `org`, it retrieves the relevant Validation Rule or Apex Trigger metadata from the org using `sf project retrieve start`.\n- **XML/Apex Code Modification:**\n - For Validation Rules, it modifies the `errorConditionFormula` in the XML to include a check for the bypass Custom Permission.\n - For Apex Triggers, it injects an `if` statement at the beginning of the trigger body to check for the bypass Custom Permission.\n- **`parseXmlFile` and `writeXmlFile`:** Used for reading and writing XML metadata files.\n- **`execCommand`:** Used for executing Salesforce CLI commands, particularly for metadata retrieval.\n- **Error Handling:** Includes checks for invalid sObject or automation selections and provides informative error messages.\n</details>\n",
12627
- "examples": [
12628
- "$ sf hardis:project:generate:bypass",
12629
- "$ sf hardis:project:generate:bypass --sObjects Account,Contact,Opportunity",
12630
- "$ sf hardis:project:generate:bypass --automations Flow,Trigger,VR",
12631
- "$ sf hardis:project:generate:bypass --sObjects Account,Opportunity --automations Flow,Trigger",
12632
- "$ sf hardis:project:generate:bypass --skipCredits",
12633
- "$ sf hardis:project:generate:bypass --apply-to-vrs",
12634
- "$ sf hardis:project:generate:bypass --apply-to-triggers",
12635
- "$ sf hardis:project:generate:bypass --metadata-source org"
12636
- ],
12637
- "flags": {
12638
- "json": {
12639
- "description": "Format output as json.",
12640
- "helpGroup": "GLOBAL",
12641
- "name": "json",
12642
- "allowNo": false,
12643
- "type": "boolean"
12644
- },
12645
- "flags-dir": {
12646
- "helpGroup": "GLOBAL",
12647
- "name": "flags-dir",
12648
- "summary": "Import flag values from a directory.",
12649
- "hasDynamicHelp": false,
12650
- "multiple": false,
12651
- "type": "option"
12652
- },
12653
- "target-org": {
12654
- "aliases": [
12655
- "targetusername",
12656
- "u"
12657
- ],
12658
- "char": "o",
12659
- "deprecateAliases": true,
12660
- "name": "target-org",
12661
- "noCacheDefault": true,
12662
- "required": true,
12663
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12664
- "hasDynamicHelp": true,
12665
- "multiple": false,
12666
- "type": "option"
12667
- },
12668
- "objects": {
12669
- "aliases": [
12670
- "sObjects"
12671
- ],
12672
- "char": "s",
12673
- "description": "Comma-separated list of sObjects to bypass (e.g., Account,Contact,Opportunity). If omitted, you will be prompted to select.",
12674
- "name": "objects",
12675
- "required": false,
12676
- "hasDynamicHelp": false,
12677
- "multiple": false,
12678
- "type": "option"
12679
- },
12680
- "automations": {
12681
- "char": "a",
12682
- "description": "Comma-separated automations to bypass: Flow, Trigger, VR",
12683
- "name": "automations",
12684
- "required": false,
12685
- "hasDynamicHelp": false,
12686
- "multiple": false,
12687
- "type": "option"
12688
- },
12689
- "websocket": {
12690
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12691
- "name": "websocket",
12692
- "hasDynamicHelp": false,
12693
- "multiple": false,
12694
- "type": "option"
12695
- },
12696
- "skipauth": {
12697
- "description": "Skip authentication check when a default username is required",
12698
- "name": "skipauth",
12699
- "allowNo": false,
12700
- "type": "boolean"
12701
- },
12702
- "skip-credits": {
12703
- "aliases": [
12704
- "skipCredits"
12705
- ],
12706
- "char": "k",
12707
- "description": "Omit the \"Generated by\" line in the XML files",
12708
- "name": "skip-credits",
12709
- "required": false,
12710
- "allowNo": false,
12711
- "type": "boolean"
12712
- },
12713
- "apply-to-vrs": {
12714
- "aliases": [
12715
- "applyToVrs"
12716
- ],
12717
- "description": "Apply bypass to Validation Rules",
12718
- "name": "apply-to-vrs",
12719
- "required": false,
12720
- "allowNo": false,
12721
- "type": "boolean"
12722
- },
12723
- "apply-to-triggers": {
12724
- "aliases": [
12725
- "applyToTriggers"
12726
- ],
12727
- "description": "Apply bypass to Triggers",
12728
- "name": "apply-to-triggers",
12729
- "required": false,
12730
- "allowNo": false,
12731
- "type": "boolean"
12732
- },
12733
- "metadata-source": {
12734
- "aliases": [
12735
- "metadataSource"
12736
- ],
12737
- "char": "r",
12738
- "description": "Source of metadata elements to apply bypass to. Options: 'org' or 'local'.",
12739
- "name": "metadata-source",
12740
- "required": false,
12741
- "hasDynamicHelp": false,
12742
- "multiple": false,
12743
- "type": "option"
12744
- }
12745
- },
12746
- "hasDynamicHelp": true,
12747
- "hiddenAliases": [],
12748
- "id": "hardis:project:generate:bypass",
12749
- "pluginAlias": "sfdx-hardis",
12750
- "pluginName": "sfdx-hardis",
12751
- "pluginType": "core",
12752
- "strict": true,
12753
- "enableJsonFlag": true,
12754
- "isESM": true,
12755
- "relativePath": [
12756
- "lib",
12757
- "commands",
12758
- "hardis",
12759
- "project",
12760
- "generate",
12761
- "bypass.js"
12441
+ "generate",
12442
+ "bypass.js"
12762
12443
  ],
12763
12444
  "aliasPermutations": [],
12764
12445
  "permutations": [
@@ -13015,14 +12696,12 @@
13015
12696
  "gitdelta:generate:project:hardis"
13016
12697
  ]
13017
12698
  },
13018
- "hardis:project:metadata:findduplicates": {
12699
+ "hardis:project:fix:profiletabs": {
13019
12700
  "aliases": [],
13020
12701
  "args": {},
13021
- "description": "find duplicate values in XML file(s).\n Find duplicate values in XML file(s). Keys to be checked can be configured in `config/sfdx-hardis.yml` using property metadataDuplicateFindKeys.\n\nDefault config :\nmetadataDuplicateFindKeys :\n[object Object]\n",
12702
+ "description": "\n## Command Behavior\n\n**Interactively updates tab visibility settings in Salesforce profiles, addressing a common issue where tab visibilities are not correctly retrieved by `sf project retrieve start`.**\n\nThis command provides a user-friendly interface to manage tab settings within your profile XML files, ensuring that your local project accurately reflects the intended tab configurations in your Salesforce org.\n\nKey functionalities:\n\n- **Interactive Tab Selection:** Displays a multi-select menu of all available tabs in your org, allowing you to choose which tabs to update.\n- **Visibility Control:** Lets you set the visibility for the selected tabs to either `DefaultOn` (Visible) or `Hidden`.\n- **Profile Selection:** Presents a multi-select menu of all .profile-meta.xml files in your project, allowing you to apply the tab visibility changes to specific profiles.\n- **XML Updates:** Modifies the <tabVisibilities> section of the selected profile XML files to reflect the chosen tab settings. If a tab visibility setting already exists for a selected tab, it will be updated; otherwise, a new one will be added.\n- **Sorted Output:** The <tabVisibilities> in the updated profile XML files are sorted alphabetically for consistency and readability.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries the `TabDefinition` object using `soqlQueryTooling` to retrieve a list of all available tabs in the target org.\n- **File Discovery:** Uses `glob` to find all .profile-meta.xml files within the specified project path.\n- **Interactive Prompts:** Leverages the `prompts` library to create interactive menus for selecting tabs, visibility settings, and profiles.\n- **XML Parsing and Manipulation:** Uses `parseXmlFile` to read the content of profile XML files and `writeXmlFile` to write the modified content back. It manipulates the `tabVisibilities` array within the parsed XML to add or update tab settings.\n- **Array Sorting:** Employs the `sort-array` library to sort the `tabVisibilities` alphabetically by tab name.\n- **Logging:** Provides feedback to the user about which profiles have been updated and a summary of the changes.\n</details>\n",
13022
12703
  "examples": [
13023
- "\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Layout xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n <layoutSections>\n ...\n <layoutColumns>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n </layoutColumns>\n </layoutSections>\n</Layout>\n",
13024
- "\n$ sf hardis:project:metadata:findduplicates --file layout.layout-meta.xml\n[sfdx-hardis] Duplicate values in layout.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : Name\n",
13025
- "\n$ sf hardis:project.metadata:findduplicates -f \"force-app/main/default/**/*.xml\"\n[sfdx-hardis] hardis:project:metadata:findduplicates execution time 0:00:00.397\n[sfdx-hardis] Duplicate values in layout1.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : CreatedById\n\n[sfdx-hardis] Duplicate values in layout2.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : LastModifiedById, Name\n"
12704
+ "$ sf hardis:project:fix:profiletabs"
13026
12705
  ],
13027
12706
  "flags": {
13028
12707
  "json": {
@@ -13040,14 +12719,22 @@
13040
12719
  "multiple": false,
13041
12720
  "type": "option"
13042
12721
  },
13043
- "files": {
13044
- "char": "f",
13045
- "description": "XML metadata files path",
13046
- "name": "files",
12722
+ "path": {
12723
+ "char": "p",
12724
+ "description": "Root folder",
12725
+ "name": "path",
12726
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
13047
12727
  "hasDynamicHelp": false,
13048
- "multiple": true,
12728
+ "multiple": false,
13049
12729
  "type": "option"
13050
12730
  },
12731
+ "debug": {
12732
+ "char": "d",
12733
+ "description": "Activate debug mode (more logs)",
12734
+ "name": "debug",
12735
+ "allowNo": false,
12736
+ "type": "boolean"
12737
+ },
13051
12738
  "websocket": {
13052
12739
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
13053
12740
  "name": "websocket",
@@ -13060,9 +12747,218 @@
13060
12747
  "name": "skipauth",
13061
12748
  "allowNo": false,
13062
12749
  "type": "boolean"
13063
- }
13064
- },
13065
- "hasDynamicHelp": false,
12750
+ },
12751
+ "target-org": {
12752
+ "aliases": [
12753
+ "targetusername",
12754
+ "u"
12755
+ ],
12756
+ "char": "o",
12757
+ "deprecateAliases": true,
12758
+ "name": "target-org",
12759
+ "noCacheDefault": true,
12760
+ "required": true,
12761
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12762
+ "hasDynamicHelp": true,
12763
+ "multiple": false,
12764
+ "type": "option"
12765
+ }
12766
+ },
12767
+ "hasDynamicHelp": true,
12768
+ "hiddenAliases": [],
12769
+ "id": "hardis:project:fix:profiletabs",
12770
+ "pluginAlias": "sfdx-hardis",
12771
+ "pluginName": "sfdx-hardis",
12772
+ "pluginType": "core",
12773
+ "strict": true,
12774
+ "enableJsonFlag": true,
12775
+ "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
12776
+ "requiresProject": true,
12777
+ "isESM": true,
12778
+ "relativePath": [
12779
+ "lib",
12780
+ "commands",
12781
+ "hardis",
12782
+ "project",
12783
+ "fix",
12784
+ "profiletabs.js"
12785
+ ],
12786
+ "aliasPermutations": [],
12787
+ "permutations": [
12788
+ "hardis:project:fix:profiletabs",
12789
+ "project:hardis:fix:profiletabs",
12790
+ "project:fix:hardis:profiletabs",
12791
+ "project:fix:profiletabs:hardis",
12792
+ "hardis:fix:project:profiletabs",
12793
+ "fix:hardis:project:profiletabs",
12794
+ "fix:project:hardis:profiletabs",
12795
+ "fix:project:profiletabs:hardis",
12796
+ "hardis:fix:profiletabs:project",
12797
+ "fix:hardis:profiletabs:project",
12798
+ "fix:profiletabs:hardis:project",
12799
+ "fix:profiletabs:project:hardis",
12800
+ "hardis:project:profiletabs:fix",
12801
+ "project:hardis:profiletabs:fix",
12802
+ "project:profiletabs:hardis:fix",
12803
+ "project:profiletabs:fix:hardis",
12804
+ "hardis:profiletabs:project:fix",
12805
+ "profiletabs:hardis:project:fix",
12806
+ "profiletabs:project:hardis:fix",
12807
+ "profiletabs:project:fix:hardis",
12808
+ "hardis:profiletabs:fix:project",
12809
+ "profiletabs:hardis:fix:project",
12810
+ "profiletabs:fix:hardis:project",
12811
+ "profiletabs:fix:project:hardis"
12812
+ ]
12813
+ },
12814
+ "hardis:project:fix:v53flexipages": {
12815
+ "aliases": [],
12816
+ "args": {},
12817
+ "description": "\n## Command Behavior\n\n**Fixes Salesforce FlexiPages for compatibility with API Version 53.0 (Winter '22 release) by adding missing identifiers to component instances.**\n\nSalesforce introduced a change in API Version 53.0 that requires `identifier` tags within `componentInstance` and `fieldInstance` elements in FlexiPage metadata. If these identifiers are missing, deployments to orgs with API version 53.0 or higher will fail. This command automates the process of adding these missing identifiers, ensuring your FlexiPages remain deployable.\n\nKey functionalities:\n\n- **Targeted FlexiPage Processing:** Scans all .flexipage-meta.xml files within the specified root folder (defaults to current working directory).\n- **Identifier Injection:** Inserts a unique `identifier` tag (e.g., `SFDX_HARDIS_REPLACEMENT_ID`) into `componentInstance` and `fieldInstance` elements that lack one.\n\n**Important Note:** After running this command, ensure you update your `apiVersion` to `53.0` (or higher) in your `package.xml` and `sfdx-project.json` files.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find all .flexipage-meta.xml files.\n- **Content Reading:** Reads the XML content of each FlexiPage file.\n- **Regular Expression Replacement:** Employs a set of regular expressions to identify specific XML patterns (componentName.../componentName.../componentInstance, componentName.../componentName.../visibilityRule, fieldItem.../fieldItem.../fieldInstance) that are missing the `identifier` tag.\n- **Dynamic ID Generation:** For each match, it generates a unique identifier (e.g., `sfdxHardisIdX`) and injects it into the XML structure.\n- **File Writing:** If changes are made, the modified XML content is written back to the FlexiPage file using `fs.writeFile`.\n- **Logging:** Provides messages about which FlexiPages are being processed and a summary of the total number of identifiers added.\n</details>\n",
12818
+ "examples": [
12819
+ "$ sf hardis:project:fix:v53flexipages"
12820
+ ],
12821
+ "flags": {
12822
+ "json": {
12823
+ "description": "Format output as json.",
12824
+ "helpGroup": "GLOBAL",
12825
+ "name": "json",
12826
+ "allowNo": false,
12827
+ "type": "boolean"
12828
+ },
12829
+ "flags-dir": {
12830
+ "helpGroup": "GLOBAL",
12831
+ "name": "flags-dir",
12832
+ "summary": "Import flag values from a directory.",
12833
+ "hasDynamicHelp": false,
12834
+ "multiple": false,
12835
+ "type": "option"
12836
+ },
12837
+ "path": {
12838
+ "char": "p",
12839
+ "description": "Root folder",
12840
+ "name": "path",
12841
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12842
+ "hasDynamicHelp": false,
12843
+ "multiple": false,
12844
+ "type": "option"
12845
+ },
12846
+ "debug": {
12847
+ "char": "d",
12848
+ "description": "Activate debug mode (more logs)",
12849
+ "name": "debug",
12850
+ "allowNo": false,
12851
+ "type": "boolean"
12852
+ },
12853
+ "websocket": {
12854
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12855
+ "name": "websocket",
12856
+ "hasDynamicHelp": false,
12857
+ "multiple": false,
12858
+ "type": "option"
12859
+ },
12860
+ "skipauth": {
12861
+ "description": "Skip authentication check when a default username is required",
12862
+ "name": "skipauth",
12863
+ "allowNo": false,
12864
+ "type": "boolean"
12865
+ }
12866
+ },
12867
+ "hasDynamicHelp": false,
12868
+ "hiddenAliases": [],
12869
+ "id": "hardis:project:fix:v53flexipages",
12870
+ "pluginAlias": "sfdx-hardis",
12871
+ "pluginName": "sfdx-hardis",
12872
+ "pluginType": "core",
12873
+ "strict": true,
12874
+ "enableJsonFlag": true,
12875
+ "title": "Fix flexipages for v53",
12876
+ "requiresProject": true,
12877
+ "isESM": true,
12878
+ "relativePath": [
12879
+ "lib",
12880
+ "commands",
12881
+ "hardis",
12882
+ "project",
12883
+ "fix",
12884
+ "v53flexipages.js"
12885
+ ],
12886
+ "aliasPermutations": [],
12887
+ "permutations": [
12888
+ "hardis:project:fix:v53flexipages",
12889
+ "project:hardis:fix:v53flexipages",
12890
+ "project:fix:hardis:v53flexipages",
12891
+ "project:fix:v53flexipages:hardis",
12892
+ "hardis:fix:project:v53flexipages",
12893
+ "fix:hardis:project:v53flexipages",
12894
+ "fix:project:hardis:v53flexipages",
12895
+ "fix:project:v53flexipages:hardis",
12896
+ "hardis:fix:v53flexipages:project",
12897
+ "fix:hardis:v53flexipages:project",
12898
+ "fix:v53flexipages:hardis:project",
12899
+ "fix:v53flexipages:project:hardis",
12900
+ "hardis:project:v53flexipages:fix",
12901
+ "project:hardis:v53flexipages:fix",
12902
+ "project:v53flexipages:hardis:fix",
12903
+ "project:v53flexipages:fix:hardis",
12904
+ "hardis:v53flexipages:project:fix",
12905
+ "v53flexipages:hardis:project:fix",
12906
+ "v53flexipages:project:hardis:fix",
12907
+ "v53flexipages:project:fix:hardis",
12908
+ "hardis:v53flexipages:fix:project",
12909
+ "v53flexipages:hardis:fix:project",
12910
+ "v53flexipages:fix:hardis:project",
12911
+ "v53flexipages:fix:project:hardis"
12912
+ ]
12913
+ },
12914
+ "hardis:project:metadata:findduplicates": {
12915
+ "aliases": [],
12916
+ "args": {},
12917
+ "description": "find duplicate values in XML file(s).\n Find duplicate values in XML file(s). Keys to be checked can be configured in `config/sfdx-hardis.yml` using property metadataDuplicateFindKeys.\n\nDefault config :\nmetadataDuplicateFindKeys :\n[object Object]\n",
12918
+ "examples": [
12919
+ "\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Layout xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n <layoutSections>\n ...\n <layoutColumns>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n </layoutColumns>\n </layoutSections>\n</Layout>\n",
12920
+ "\n$ sf hardis:project:metadata:findduplicates --file layout.layout-meta.xml\n[sfdx-hardis] Duplicate values in layout.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : Name\n",
12921
+ "\n$ sf hardis:project.metadata:findduplicates -f \"force-app/main/default/**/*.xml\"\n[sfdx-hardis] hardis:project:metadata:findduplicates execution time 0:00:00.397\n[sfdx-hardis] Duplicate values in layout1.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : CreatedById\n\n[sfdx-hardis] Duplicate values in layout2.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : LastModifiedById, Name\n"
12922
+ ],
12923
+ "flags": {
12924
+ "json": {
12925
+ "description": "Format output as json.",
12926
+ "helpGroup": "GLOBAL",
12927
+ "name": "json",
12928
+ "allowNo": false,
12929
+ "type": "boolean"
12930
+ },
12931
+ "flags-dir": {
12932
+ "helpGroup": "GLOBAL",
12933
+ "name": "flags-dir",
12934
+ "summary": "Import flag values from a directory.",
12935
+ "hasDynamicHelp": false,
12936
+ "multiple": false,
12937
+ "type": "option"
12938
+ },
12939
+ "files": {
12940
+ "char": "f",
12941
+ "description": "XML metadata files path",
12942
+ "name": "files",
12943
+ "hasDynamicHelp": false,
12944
+ "multiple": true,
12945
+ "type": "option"
12946
+ },
12947
+ "websocket": {
12948
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12949
+ "name": "websocket",
12950
+ "hasDynamicHelp": false,
12951
+ "multiple": false,
12952
+ "type": "option"
12953
+ },
12954
+ "skipauth": {
12955
+ "description": "Skip authentication check when a default username is required",
12956
+ "name": "skipauth",
12957
+ "allowNo": false,
12958
+ "type": "boolean"
12959
+ }
12960
+ },
12961
+ "hasDynamicHelp": false,
13066
12962
  "hiddenAliases": [],
13067
12963
  "id": "hardis:project:metadata:findduplicates",
13068
12964
  "pluginAlias": "sfdx-hardis",
@@ -13128,6 +13024,109 @@
13128
13024
  "findduplicates:metadata:project:hardis"
13129
13025
  ]
13130
13026
  },
13027
+ "hardis:project:convert:profilestopermsets": {
13028
+ "aliases": [],
13029
+ "args": {},
13030
+ "description": "\n## Command Behavior\n\n**Converts existing Salesforce Profiles into Permission Sets, facilitating a more granular and recommended security model.**\n\nThis command helps in migrating permissions from Profiles to Permission Sets, which is a best practice for managing user access in Salesforce. It creates a new Permission Set for each specified Profile, adopting a naming convention of `PS_PROFILENAME`.\n\nKey functionalities:\n\n- **Profile to Permission Set Conversion:** Automatically extracts permissions from a Profile and creates a corresponding Permission Set.\n- **Naming Convention:** New Permission Sets are named with a `PS_` prefix followed by the Profile name (e.g., `PS_Standard_User`).\n- **Exclusion Filter:** Allows you to exclude specific Profiles from the conversion process using the `--except` flag.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **External Plugin Integration:** It relies on the `shane-sfdx-plugins` (specifically the `sf shane:profile:convert` command) to perform the actual conversion.\n- **File System Scan:** It reads the contents of the `force-app/main/default/profiles` directory to identify all available Profile metadata files.\n- **Command Execution:** For each identified Profile (that is not excluded), it constructs and executes the `sf shane:profile:convert` command with the appropriate Profile name and desired Permission Set name.\n- **Error Handling:** Includes basic error handling for the external command execution.\n</details>\n",
13031
+ "examples": [
13032
+ "$ sf hardis:project:convert:profilestopermsets"
13033
+ ],
13034
+ "flags": {
13035
+ "json": {
13036
+ "description": "Format output as json.",
13037
+ "helpGroup": "GLOBAL",
13038
+ "name": "json",
13039
+ "allowNo": false,
13040
+ "type": "boolean"
13041
+ },
13042
+ "flags-dir": {
13043
+ "helpGroup": "GLOBAL",
13044
+ "name": "flags-dir",
13045
+ "summary": "Import flag values from a directory.",
13046
+ "hasDynamicHelp": false,
13047
+ "multiple": false,
13048
+ "type": "option"
13049
+ },
13050
+ "except": {
13051
+ "char": "e",
13052
+ "description": "List of filters",
13053
+ "name": "except",
13054
+ "default": [],
13055
+ "hasDynamicHelp": false,
13056
+ "multiple": true,
13057
+ "type": "option"
13058
+ },
13059
+ "debug": {
13060
+ "char": "d",
13061
+ "description": "Activate debug mode (more logs)",
13062
+ "name": "debug",
13063
+ "allowNo": false,
13064
+ "type": "boolean"
13065
+ },
13066
+ "websocket": {
13067
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
13068
+ "name": "websocket",
13069
+ "hasDynamicHelp": false,
13070
+ "multiple": false,
13071
+ "type": "option"
13072
+ },
13073
+ "skipauth": {
13074
+ "description": "Skip authentication check when a default username is required",
13075
+ "name": "skipauth",
13076
+ "allowNo": false,
13077
+ "type": "boolean"
13078
+ }
13079
+ },
13080
+ "hasDynamicHelp": false,
13081
+ "hiddenAliases": [],
13082
+ "id": "hardis:project:convert:profilestopermsets",
13083
+ "pluginAlias": "sfdx-hardis",
13084
+ "pluginName": "sfdx-hardis",
13085
+ "pluginType": "core",
13086
+ "strict": true,
13087
+ "enableJsonFlag": true,
13088
+ "title": "Convert Profiles into Permission Sets",
13089
+ "requiresProject": true,
13090
+ "requiresSfdxPlugins": [
13091
+ "shane-sfdx-plugins"
13092
+ ],
13093
+ "isESM": true,
13094
+ "relativePath": [
13095
+ "lib",
13096
+ "commands",
13097
+ "hardis",
13098
+ "project",
13099
+ "convert",
13100
+ "profilestopermsets.js"
13101
+ ],
13102
+ "aliasPermutations": [],
13103
+ "permutations": [
13104
+ "hardis:project:convert:profilestopermsets",
13105
+ "project:hardis:convert:profilestopermsets",
13106
+ "project:convert:hardis:profilestopermsets",
13107
+ "project:convert:profilestopermsets:hardis",
13108
+ "hardis:convert:project:profilestopermsets",
13109
+ "convert:hardis:project:profilestopermsets",
13110
+ "convert:project:hardis:profilestopermsets",
13111
+ "convert:project:profilestopermsets:hardis",
13112
+ "hardis:convert:profilestopermsets:project",
13113
+ "convert:hardis:profilestopermsets:project",
13114
+ "convert:profilestopermsets:hardis:project",
13115
+ "convert:profilestopermsets:project:hardis",
13116
+ "hardis:project:profilestopermsets:convert",
13117
+ "project:hardis:profilestopermsets:convert",
13118
+ "project:profilestopermsets:hardis:convert",
13119
+ "project:profilestopermsets:convert:hardis",
13120
+ "hardis:profilestopermsets:project:convert",
13121
+ "profilestopermsets:hardis:project:convert",
13122
+ "profilestopermsets:project:hardis:convert",
13123
+ "profilestopermsets:project:convert:hardis",
13124
+ "hardis:profilestopermsets:convert:project",
13125
+ "profilestopermsets:hardis:convert:project",
13126
+ "profilestopermsets:convert:hardis:project",
13127
+ "profilestopermsets:convert:project:hardis"
13128
+ ]
13129
+ },
13131
13130
  "hardis:scratch:pool:create": {
13132
13131
  "aliases": [],
13133
13132
  "args": {},
@@ -15102,5 +15101,5 @@
15102
15101
  ]
15103
15102
  }
15104
15103
  },
15105
- "version": "6.1.1"
15104
+ "version": "6.1.3"
15106
15105
  }