sfdx-hardis 6.1.4 → 6.1.5-beta202508282306.0

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.
@@ -4406,6 +4406,135 @@
4406
4406
  "ws:work:hardis"
4407
4407
  ]
4408
4408
  },
4409
+ "hardis:git:pull-requests:extract": {
4410
+ "aliases": [],
4411
+ "args": {},
4412
+ "description": "\n## Command Behavior\n\n**Extracts pull request information from your Git server based on specified filtering criteria.**\n\nThis command provides a powerful way to query and retrieve details about pull requests (or merge requests, depending on your Git provider) in your repository. It's highly useful for reporting, auditing, and analyzing development workflows.\n\nKey functionalities include:\n\n- **Target Branch Filtering:** You can filter pull requests by their target branch using the `--target-branch` flag. If not specified, the command will prompt you to select one.\n- **Status Filtering:** Filter pull requests by their status: `open`, `merged`, or `abandoned` using the `--status` flag. An interactive prompt is provided if no status is specified.\n- **Minimum Date Filtering:** Use the `--min-date` flag to retrieve pull requests created or updated after a specific date.\n- **CSV Output:** The extracted pull request data is generated into a CSV file, which can be used for further analysis in spreadsheet software.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves interacting with a Git provider's API:\n\n- **Git Provider Abstraction:** It uses the `GitProvider.getInstance(true)` to abstract away the specifics of different Git platforms (e.g., GitHub, GitLab, Azure DevOps). This ensures the command can work across various environments.\n- **API Calls:** The `gitProvider.listPullRequests()` method is called with a `prConstraint` object that encapsulates the filtering criteria (target branch, minimum date, status).\n- **Interactive Prompts:** The `prompts` library is used to interactively gather input from the user for the target branch and pull request status if they are not provided as command-line flags.\n- **Date Handling:** The `moment` library is used to parse and handle date inputs for the `--min-date` flag.\n- **CSV Generation:** The `generateCsvFile` utility is responsible for converting the retrieved pull request data into a CSV format, and `generateReportPath` determines the output file location.\n- **Error Handling:** It includes error handling for cases where a Git provider cannot be identified.\n</details>\n",
4413
+ "examples": [
4414
+ "$ sf hardis:git:pull-requests:extract",
4415
+ "$ sf hardis:git:pull-requests:extract --target-branch main --status merged"
4416
+ ],
4417
+ "flags": {
4418
+ "json": {
4419
+ "description": "Format output as json.",
4420
+ "helpGroup": "GLOBAL",
4421
+ "name": "json",
4422
+ "allowNo": false,
4423
+ "type": "boolean"
4424
+ },
4425
+ "flags-dir": {
4426
+ "helpGroup": "GLOBAL",
4427
+ "name": "flags-dir",
4428
+ "summary": "Import flag values from a directory.",
4429
+ "hasDynamicHelp": false,
4430
+ "multiple": false,
4431
+ "type": "option"
4432
+ },
4433
+ "target-branch": {
4434
+ "char": "t",
4435
+ "description": "Target branch of PRs",
4436
+ "name": "target-branch",
4437
+ "hasDynamicHelp": false,
4438
+ "multiple": false,
4439
+ "type": "option"
4440
+ },
4441
+ "status": {
4442
+ "char": "x",
4443
+ "description": "Status of the PR",
4444
+ "name": "status",
4445
+ "hasDynamicHelp": false,
4446
+ "multiple": false,
4447
+ "options": [
4448
+ "open",
4449
+ "merged",
4450
+ "abandoned"
4451
+ ],
4452
+ "type": "option"
4453
+ },
4454
+ "min-date": {
4455
+ "char": "m",
4456
+ "description": "Minimum date for PR",
4457
+ "name": "min-date",
4458
+ "hasDynamicHelp": false,
4459
+ "multiple": false,
4460
+ "type": "option"
4461
+ },
4462
+ "outputfile": {
4463
+ "char": "f",
4464
+ "description": "Force the path and name of output report file. Must end with .csv",
4465
+ "name": "outputfile",
4466
+ "hasDynamicHelp": false,
4467
+ "multiple": false,
4468
+ "type": "option"
4469
+ },
4470
+ "debug": {
4471
+ "char": "d",
4472
+ "description": "Activate debug mode (more logs)",
4473
+ "name": "debug",
4474
+ "allowNo": false,
4475
+ "type": "boolean"
4476
+ },
4477
+ "websocket": {
4478
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
4479
+ "name": "websocket",
4480
+ "hasDynamicHelp": false,
4481
+ "multiple": false,
4482
+ "type": "option"
4483
+ },
4484
+ "skipauth": {
4485
+ "description": "Skip authentication check when a default username is required",
4486
+ "name": "skipauth",
4487
+ "allowNo": false,
4488
+ "type": "boolean"
4489
+ }
4490
+ },
4491
+ "hasDynamicHelp": false,
4492
+ "hiddenAliases": [],
4493
+ "id": "hardis:git:pull-requests:extract",
4494
+ "pluginAlias": "sfdx-hardis",
4495
+ "pluginName": "sfdx-hardis",
4496
+ "pluginType": "core",
4497
+ "strict": true,
4498
+ "enableJsonFlag": true,
4499
+ "title": "Extract pull requests",
4500
+ "requiresProject": true,
4501
+ "isESM": true,
4502
+ "relativePath": [
4503
+ "lib",
4504
+ "commands",
4505
+ "hardis",
4506
+ "git",
4507
+ "pull-requests",
4508
+ "extract.js"
4509
+ ],
4510
+ "aliasPermutations": [],
4511
+ "permutations": [
4512
+ "hardis:git:pull-requests:extract",
4513
+ "git:hardis:pull-requests:extract",
4514
+ "git:pull-requests:hardis:extract",
4515
+ "git:pull-requests:extract:hardis",
4516
+ "hardis:pull-requests:git:extract",
4517
+ "pull-requests:hardis:git:extract",
4518
+ "pull-requests:git:hardis:extract",
4519
+ "pull-requests:git:extract:hardis",
4520
+ "hardis:pull-requests:extract:git",
4521
+ "pull-requests:hardis:extract:git",
4522
+ "pull-requests:extract:hardis:git",
4523
+ "pull-requests:extract:git:hardis",
4524
+ "hardis:git:extract:pull-requests",
4525
+ "git:hardis:extract:pull-requests",
4526
+ "git:extract:hardis:pull-requests",
4527
+ "git:extract:pull-requests:hardis",
4528
+ "hardis:extract:git:pull-requests",
4529
+ "extract:hardis:git:pull-requests",
4530
+ "extract:git:hardis:pull-requests",
4531
+ "extract:git:pull-requests:hardis",
4532
+ "hardis:extract:pull-requests:git",
4533
+ "extract:hardis:pull-requests:git",
4534
+ "extract:pull-requests:hardis:git",
4535
+ "extract:pull-requests:git:hardis"
4536
+ ]
4537
+ },
4409
4538
  "hardis:doc:extract:permsetgroups": {
4410
4539
  "aliases": [],
4411
4540
  "args": {},
@@ -4596,13 +4725,13 @@
4596
4725
  "generate:plugin:doc:hardis"
4597
4726
  ]
4598
4727
  },
4599
- "hardis:git:pull-requests:extract": {
4728
+ "hardis:org:community:update": {
4600
4729
  "aliases": [],
4601
4730
  "args": {},
4602
- "description": "\n## Command Behavior\n\n**Extracts pull request information from your Git server based on specified filtering criteria.**\n\nThis command provides a powerful way to query and retrieve details about pull requests (or merge requests, depending on your Git provider) in your repository. It's highly useful for reporting, auditing, and analyzing development workflows.\n\nKey functionalities include:\n\n- **Target Branch Filtering:** You can filter pull requests by their target branch using the `--target-branch` flag. If not specified, the command will prompt you to select one.\n- **Status Filtering:** Filter pull requests by their status: `open`, `merged`, or `abandoned` using the `--status` flag. An interactive prompt is provided if no status is specified.\n- **Minimum Date Filtering:** Use the `--min-date` flag to retrieve pull requests created or updated after a specific date.\n- **CSV Output:** The extracted pull request data is generated into a CSV file, which can be used for further analysis in spreadsheet software.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves interacting with a Git provider's API:\n\n- **Git Provider Abstraction:** It uses the `GitProvider.getInstance(true)` to abstract away the specifics of different Git platforms (e.g., GitHub, GitLab, Azure DevOps). This ensures the command can work across various environments.\n- **API Calls:** The `gitProvider.listPullRequests()` method is called with a `prConstraint` object that encapsulates the filtering criteria (target branch, minimum date, status).\n- **Interactive Prompts:** The `prompts` library is used to interactively gather input from the user for the target branch and pull request status if they are not provided as command-line flags.\n- **Date Handling:** The `moment` library is used to parse and handle date inputs for the `--min-date` flag.\n- **CSV Generation:** The `generateCsvFile` utility is responsible for converting the retrieved pull request data into a CSV format, and `generateReportPath` determines the output file location.\n- **Error Handling:** It includes error handling for cases where a Git provider cannot be identified.\n</details>\n",
4731
+ "description": "\n## Command Behavior\n\n**Updates the status of one or more Salesforce Experience Cloud (Community) networks.**\n\nThis command provides a way to programmatically change the status of your Salesforce Communities, allowing you to manage their availability. This is particularly useful for:\n\n- **Maintenance:** Taking communities offline for planned maintenance (`DownForMaintenance`).\n- **Activation/Deactivation:** Bringing communities online or offline (`Live`, `DownForMaintenance`).\n- **Automation:** Integrating community status changes into CI/CD pipelines or scheduled jobs.\n\nKey functionalities:\n\n- **Network Selection:** You can specify one or more community network names (separated by commas) using the `--name` flag.\n- **Status Update:** You can set the new status for the selected communities using the `--status` flag. Supported values are `Live` and `DownForMaintenance`.\n- **Confirmation Prompt:** In non-CI environments, it provides a confirmation prompt before executing the update, ensuring intentional changes.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Query:** It first queries the Salesforce `Network` object using SOQL to retrieve the `Id`, `Name`, and `Status` of the specified communities. This ensures that only existing communities are targeted.\n- **SObject Update:** It then constructs an array of `Network` sObjects with their `Id` and the new `Status` and performs a DML update operation using `conn.sobject(\"Network\").update()`. The `allOrNone: false` option is used to allow partial success in case some updates fail.\n- **Error Handling and Reporting:** It iterates through the update results, logging success or failure for each community. It also provides a summary of successful and erroneous updates.\n- **User Interaction:** Uses `prompts` to confirm the update action with the user when not running in a CI environment.\n- **Salesforce Connection:** Establishes a connection to the target Salesforce org using the `target-org` flag.\n</details>\n",
4603
4732
  "examples": [
4604
- "$ sf hardis:git:pull-requests:extract",
4605
- "$ sf hardis:git:pull-requests:extract --target-branch main --status merged"
4733
+ "$ sf hardis:org:community:update --name 'MyNetworkName' --status DownForMaintenance",
4734
+ "$ sf hardis:org:community:update --name 'MyNetworkName,MySecondNetworkName' --status Live"
4606
4735
  ],
4607
4736
  "flags": {
4608
4737
  "json": {
@@ -4620,39 +4749,112 @@
4620
4749
  "multiple": false,
4621
4750
  "type": "option"
4622
4751
  },
4623
- "target-branch": {
4624
- "char": "t",
4625
- "description": "Target branch of PRs",
4626
- "name": "target-branch",
4752
+ "name": {
4753
+ "char": "n",
4754
+ "description": "List of Networks Names that you want to update, separated by comma",
4755
+ "name": "name",
4756
+ "required": true,
4627
4757
  "hasDynamicHelp": false,
4628
4758
  "multiple": false,
4629
4759
  "type": "option"
4630
4760
  },
4631
4761
  "status": {
4632
- "char": "x",
4633
- "description": "Status of the PR",
4762
+ "char": "s",
4763
+ "description": "New status for the community, available values are: Live, DownForMaintenance",
4634
4764
  "name": "status",
4765
+ "required": true,
4635
4766
  "hasDynamicHelp": false,
4636
4767
  "multiple": false,
4637
- "options": [
4638
- "open",
4639
- "merged",
4640
- "abandoned"
4641
- ],
4642
4768
  "type": "option"
4643
4769
  },
4644
- "min-date": {
4645
- "char": "m",
4646
- "description": "Minimum date for PR",
4647
- "name": "min-date",
4648
- "hasDynamicHelp": false,
4770
+ "debug": {
4771
+ "char": "d",
4772
+ "description": "Activate debug mode (more logs)",
4773
+ "name": "debug",
4774
+ "allowNo": false,
4775
+ "type": "boolean"
4776
+ },
4777
+ "target-org": {
4778
+ "aliases": [
4779
+ "targetusername",
4780
+ "u"
4781
+ ],
4782
+ "char": "o",
4783
+ "deprecateAliases": true,
4784
+ "name": "target-org",
4785
+ "noCacheDefault": true,
4786
+ "required": true,
4787
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
4788
+ "hasDynamicHelp": true,
4649
4789
  "multiple": false,
4650
4790
  "type": "option"
4791
+ }
4792
+ },
4793
+ "hasDynamicHelp": true,
4794
+ "hiddenAliases": [],
4795
+ "id": "hardis:org:community:update",
4796
+ "pluginAlias": "sfdx-hardis",
4797
+ "pluginName": "sfdx-hardis",
4798
+ "pluginType": "core",
4799
+ "strict": true,
4800
+ "summary": "Update a community status.",
4801
+ "enableJsonFlag": true,
4802
+ "isESM": true,
4803
+ "relativePath": [
4804
+ "lib",
4805
+ "commands",
4806
+ "hardis",
4807
+ "org",
4808
+ "community",
4809
+ "update.js"
4810
+ ],
4811
+ "aliasPermutations": [],
4812
+ "permutations": [
4813
+ "hardis:org:community:update",
4814
+ "org:hardis:community:update",
4815
+ "org:community:hardis:update",
4816
+ "org:community:update:hardis",
4817
+ "hardis:community:org:update",
4818
+ "community:hardis:org:update",
4819
+ "community:org:hardis:update",
4820
+ "community:org:update:hardis",
4821
+ "hardis:community:update:org",
4822
+ "community:hardis:update:org",
4823
+ "community:update:hardis:org",
4824
+ "community:update:org:hardis",
4825
+ "hardis:org:update:community",
4826
+ "org:hardis:update:community",
4827
+ "org:update:hardis:community",
4828
+ "org:update:community:hardis",
4829
+ "hardis:update:org:community",
4830
+ "update:hardis:org:community",
4831
+ "update:org:hardis:community",
4832
+ "update:org:community:hardis",
4833
+ "hardis:update:community:org",
4834
+ "update:hardis:community:org",
4835
+ "update:community:hardis:org",
4836
+ "update:community:org:hardis"
4837
+ ]
4838
+ },
4839
+ "hardis:org:configure:data": {
4840
+ "aliases": [],
4841
+ "args": {},
4842
+ "description": "\n## Command Behavior\n\n**Configures a Salesforce Data Migration Utility (SFDMU) project for data export and import operations.**\n\nThis command assists in setting up SFDMU workspaces, which are essential for managing data within your Salesforce environments. It streamlines the creation of `export.json` files and related configurations, enabling efficient data seeding, migration, and synchronization.\n\nKey functionalities:\n\n- **Template-Based Configuration:** Allows you to choose from predefined SFDMU templates or start with a blank configuration. Templates can pre-populate `export.json` with common data migration scenarios.\n- **Interactive Setup:** Guides you through the process of defining the SFDMU project folder name, label, and description.\n- **`export.json` Generation:** Creates the `export.json` file, which is the core configuration file for SFDMU, defining objects to export/import, queries, and operations.\n- **Additional File Generation:** Can generate additional configuration files, such as a `badwords.json` file for data filtering scenarios.\n- **Scratch Org Integration:** Offers to automatically configure the SFDMU project to be used for data import when initializing a new scratch org, ensuring consistent test data across development environments.\n\nSee this article for a practical example:\n\n[![How to detect bad words in Salesforce records using SFDX Data Loader and sfdx-hardis](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-badwords.jpg)](https://nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SFDMU Integration:** It acts as a setup wizard for SFDMU, generating the necessary configuration files that the `sfdmu` plugin consumes.\n- **Interactive Prompts:** Uses the `prompts` library to gather user input for various configuration parameters, such as the data path, label, and description.\n- **File System Operations:** Employs `fs-extra` to create directories (e.g., `data/your-project-name/`) and write the `export.json` and any additional configuration files.\n- **JSON Manipulation:** Constructs the `export.json` content dynamically based on user input and selected templates, including defining objects, queries, and operations.\n- **PascalCase Conversion:** Uses `pascalcase` to format the SFDMU folder name consistently.\n- **Configuration Persistence:** Updates the project's `sfdx-hardis.yml` file (via `setConfig`) to include the newly configured data package if it's intended for scratch org initialization.\n- **WebSocket Communication:** Uses `WebSocketClient.requestOpenFile` to open the generated `export.json` file in VS Code, facilitating immediate configuration.\n- **Required Plugin Check:** Explicitly lists `sfdmu` as a required plugin, ensuring the necessary dependency is present.\n</details>\n",
4843
+ "examples": [
4844
+ "$ sf hardis:org:configure:data"
4845
+ ],
4846
+ "flags": {
4847
+ "json": {
4848
+ "description": "Format output as json.",
4849
+ "helpGroup": "GLOBAL",
4850
+ "name": "json",
4851
+ "allowNo": false,
4852
+ "type": "boolean"
4651
4853
  },
4652
- "outputfile": {
4653
- "char": "f",
4654
- "description": "Force the path and name of output report file. Must end with .csv",
4655
- "name": "outputfile",
4854
+ "flags-dir": {
4855
+ "helpGroup": "GLOBAL",
4856
+ "name": "flags-dir",
4857
+ "summary": "Import flag values from a directory.",
4656
4858
  "hasDynamicHelp": false,
4657
4859
  "multiple": false,
4658
4860
  "type": "option"
@@ -4680,209 +4882,7 @@
4680
4882
  },
4681
4883
  "hasDynamicHelp": false,
4682
4884
  "hiddenAliases": [],
4683
- "id": "hardis:git:pull-requests:extract",
4684
- "pluginAlias": "sfdx-hardis",
4685
- "pluginName": "sfdx-hardis",
4686
- "pluginType": "core",
4687
- "strict": true,
4688
- "enableJsonFlag": true,
4689
- "title": "Extract pull requests",
4690
- "requiresProject": true,
4691
- "isESM": true,
4692
- "relativePath": [
4693
- "lib",
4694
- "commands",
4695
- "hardis",
4696
- "git",
4697
- "pull-requests",
4698
- "extract.js"
4699
- ],
4700
- "aliasPermutations": [],
4701
- "permutations": [
4702
- "hardis:git:pull-requests:extract",
4703
- "git:hardis:pull-requests:extract",
4704
- "git:pull-requests:hardis:extract",
4705
- "git:pull-requests:extract:hardis",
4706
- "hardis:pull-requests:git:extract",
4707
- "pull-requests:hardis:git:extract",
4708
- "pull-requests:git:hardis:extract",
4709
- "pull-requests:git:extract:hardis",
4710
- "hardis:pull-requests:extract:git",
4711
- "pull-requests:hardis:extract:git",
4712
- "pull-requests:extract:hardis:git",
4713
- "pull-requests:extract:git:hardis",
4714
- "hardis:git:extract:pull-requests",
4715
- "git:hardis:extract:pull-requests",
4716
- "git:extract:hardis:pull-requests",
4717
- "git:extract:pull-requests:hardis",
4718
- "hardis:extract:git:pull-requests",
4719
- "extract:hardis:git:pull-requests",
4720
- "extract:git:hardis:pull-requests",
4721
- "extract:git:pull-requests:hardis",
4722
- "hardis:extract:pull-requests:git",
4723
- "extract:hardis:pull-requests:git",
4724
- "extract:pull-requests:hardis:git",
4725
- "extract:pull-requests:git:hardis"
4726
- ]
4727
- },
4728
- "hardis:org:community:update": {
4729
- "aliases": [],
4730
- "args": {},
4731
- "description": "\n## Command Behavior\n\n**Updates the status of one or more Salesforce Experience Cloud (Community) networks.**\n\nThis command provides a way to programmatically change the status of your Salesforce Communities, allowing you to manage their availability. This is particularly useful for:\n\n- **Maintenance:** Taking communities offline for planned maintenance (`DownForMaintenance`).\n- **Activation/Deactivation:** Bringing communities online or offline (`Live`, `DownForMaintenance`).\n- **Automation:** Integrating community status changes into CI/CD pipelines or scheduled jobs.\n\nKey functionalities:\n\n- **Network Selection:** You can specify one or more community network names (separated by commas) using the `--name` flag.\n- **Status Update:** You can set the new status for the selected communities using the `--status` flag. Supported values are `Live` and `DownForMaintenance`.\n- **Confirmation Prompt:** In non-CI environments, it provides a confirmation prompt before executing the update, ensuring intentional changes.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Query:** It first queries the Salesforce `Network` object using SOQL to retrieve the `Id`, `Name`, and `Status` of the specified communities. This ensures that only existing communities are targeted.\n- **SObject Update:** It then constructs an array of `Network` sObjects with their `Id` and the new `Status` and performs a DML update operation using `conn.sobject(\"Network\").update()`. The `allOrNone: false` option is used to allow partial success in case some updates fail.\n- **Error Handling and Reporting:** It iterates through the update results, logging success or failure for each community. It also provides a summary of successful and erroneous updates.\n- **User Interaction:** Uses `prompts` to confirm the update action with the user when not running in a CI environment.\n- **Salesforce Connection:** Establishes a connection to the target Salesforce org using the `target-org` flag.\n</details>\n",
4732
- "examples": [
4733
- "$ sf hardis:org:community:update --name 'MyNetworkName' --status DownForMaintenance",
4734
- "$ sf hardis:org:community:update --name 'MyNetworkName,MySecondNetworkName' --status Live"
4735
- ],
4736
- "flags": {
4737
- "json": {
4738
- "description": "Format output as json.",
4739
- "helpGroup": "GLOBAL",
4740
- "name": "json",
4741
- "allowNo": false,
4742
- "type": "boolean"
4743
- },
4744
- "flags-dir": {
4745
- "helpGroup": "GLOBAL",
4746
- "name": "flags-dir",
4747
- "summary": "Import flag values from a directory.",
4748
- "hasDynamicHelp": false,
4749
- "multiple": false,
4750
- "type": "option"
4751
- },
4752
- "name": {
4753
- "char": "n",
4754
- "description": "List of Networks Names that you want to update, separated by comma",
4755
- "name": "name",
4756
- "required": true,
4757
- "hasDynamicHelp": false,
4758
- "multiple": false,
4759
- "type": "option"
4760
- },
4761
- "status": {
4762
- "char": "s",
4763
- "description": "New status for the community, available values are: Live, DownForMaintenance",
4764
- "name": "status",
4765
- "required": true,
4766
- "hasDynamicHelp": false,
4767
- "multiple": false,
4768
- "type": "option"
4769
- },
4770
- "debug": {
4771
- "char": "d",
4772
- "description": "Activate debug mode (more logs)",
4773
- "name": "debug",
4774
- "allowNo": false,
4775
- "type": "boolean"
4776
- },
4777
- "target-org": {
4778
- "aliases": [
4779
- "targetusername",
4780
- "u"
4781
- ],
4782
- "char": "o",
4783
- "deprecateAliases": true,
4784
- "name": "target-org",
4785
- "noCacheDefault": true,
4786
- "required": true,
4787
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
4788
- "hasDynamicHelp": true,
4789
- "multiple": false,
4790
- "type": "option"
4791
- }
4792
- },
4793
- "hasDynamicHelp": true,
4794
- "hiddenAliases": [],
4795
- "id": "hardis:org:community:update",
4796
- "pluginAlias": "sfdx-hardis",
4797
- "pluginName": "sfdx-hardis",
4798
- "pluginType": "core",
4799
- "strict": true,
4800
- "summary": "Update a community status.",
4801
- "enableJsonFlag": true,
4802
- "isESM": true,
4803
- "relativePath": [
4804
- "lib",
4805
- "commands",
4806
- "hardis",
4807
- "org",
4808
- "community",
4809
- "update.js"
4810
- ],
4811
- "aliasPermutations": [],
4812
- "permutations": [
4813
- "hardis:org:community:update",
4814
- "org:hardis:community:update",
4815
- "org:community:hardis:update",
4816
- "org:community:update:hardis",
4817
- "hardis:community:org:update",
4818
- "community:hardis:org:update",
4819
- "community:org:hardis:update",
4820
- "community:org:update:hardis",
4821
- "hardis:community:update:org",
4822
- "community:hardis:update:org",
4823
- "community:update:hardis:org",
4824
- "community:update:org:hardis",
4825
- "hardis:org:update:community",
4826
- "org:hardis:update:community",
4827
- "org:update:hardis:community",
4828
- "org:update:community:hardis",
4829
- "hardis:update:org:community",
4830
- "update:hardis:org:community",
4831
- "update:org:hardis:community",
4832
- "update:org:community:hardis",
4833
- "hardis:update:community:org",
4834
- "update:hardis:community:org",
4835
- "update:community:hardis:org",
4836
- "update:community:org:hardis"
4837
- ]
4838
- },
4839
- "hardis:org:configure:data": {
4840
- "aliases": [],
4841
- "args": {},
4842
- "description": "\n## Command Behavior\n\n**Configures a Salesforce Data Migration Utility (SFDMU) project for data export and import operations.**\n\nThis command assists in setting up SFDMU workspaces, which are essential for managing data within your Salesforce environments. It streamlines the creation of `export.json` files and related configurations, enabling efficient data seeding, migration, and synchronization.\n\nKey functionalities:\n\n- **Template-Based Configuration:** Allows you to choose from predefined SFDMU templates or start with a blank configuration. Templates can pre-populate `export.json` with common data migration scenarios.\n- **Interactive Setup:** Guides you through the process of defining the SFDMU project folder name, label, and description.\n- **`export.json` Generation:** Creates the `export.json` file, which is the core configuration file for SFDMU, defining objects to export/import, queries, and operations.\n- **Additional File Generation:** Can generate additional configuration files, such as a `badwords.json` file for data filtering scenarios.\n- **Scratch Org Integration:** Offers to automatically configure the SFDMU project to be used for data import when initializing a new scratch org, ensuring consistent test data across development environments.\n\nSee this article for a practical example:\n\n[![How to detect bad words in Salesforce records using SFDX Data Loader and sfdx-hardis](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-badwords.jpg)](https://nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SFDMU Integration:** It acts as a setup wizard for SFDMU, generating the necessary configuration files that the `sfdmu` plugin consumes.\n- **Interactive Prompts:** Uses the `prompts` library to gather user input for various configuration parameters, such as the data path, label, and description.\n- **File System Operations:** Employs `fs-extra` to create directories (e.g., `data/your-project-name/`) and write the `export.json` and any additional configuration files.\n- **JSON Manipulation:** Constructs the `export.json` content dynamically based on user input and selected templates, including defining objects, queries, and operations.\n- **PascalCase Conversion:** Uses `pascalcase` to format the SFDMU folder name consistently.\n- **Configuration Persistence:** Updates the project's `sfdx-hardis.yml` file (via `setConfig`) to include the newly configured data package if it's intended for scratch org initialization.\n- **WebSocket Communication:** Uses `WebSocketClient.requestOpenFile` to open the generated `export.json` file in VS Code, facilitating immediate configuration.\n- **Required Plugin Check:** Explicitly lists `sfdmu` as a required plugin, ensuring the necessary dependency is present.\n</details>\n",
4843
- "examples": [
4844
- "$ sf hardis:org:configure:data"
4845
- ],
4846
- "flags": {
4847
- "json": {
4848
- "description": "Format output as json.",
4849
- "helpGroup": "GLOBAL",
4850
- "name": "json",
4851
- "allowNo": false,
4852
- "type": "boolean"
4853
- },
4854
- "flags-dir": {
4855
- "helpGroup": "GLOBAL",
4856
- "name": "flags-dir",
4857
- "summary": "Import flag values from a directory.",
4858
- "hasDynamicHelp": false,
4859
- "multiple": false,
4860
- "type": "option"
4861
- },
4862
- "debug": {
4863
- "char": "d",
4864
- "description": "Activate debug mode (more logs)",
4865
- "name": "debug",
4866
- "allowNo": false,
4867
- "type": "boolean"
4868
- },
4869
- "websocket": {
4870
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
4871
- "name": "websocket",
4872
- "hasDynamicHelp": false,
4873
- "multiple": false,
4874
- "type": "option"
4875
- },
4876
- "skipauth": {
4877
- "description": "Skip authentication check when a default username is required",
4878
- "name": "skipauth",
4879
- "allowNo": false,
4880
- "type": "boolean"
4881
- }
4882
- },
4883
- "hasDynamicHelp": false,
4884
- "hiddenAliases": [],
4885
- "id": "hardis:org:configure:data",
4885
+ "id": "hardis:org:configure:data",
4886
4886
  "pluginAlias": "sfdx-hardis",
4887
4887
  "pluginName": "sfdx-hardis",
4888
4888
  "pluginType": "core",
@@ -5259,7 +5259,9 @@
5259
5259
  "args": {},
5260
5260
  "description": "\n## Command Behavior\n\n**Exports data from a Salesforce org using an SFDMU (Salesforce Data Migration Utility) project.**\n\nThis command facilitates the extraction of data from your Salesforce environments based on configurations defined in an SFDMU workspace. It's a powerful tool for various data-related tasks, including:\n\n- **Data Backup:** Creating snapshots of your Salesforce data.\n- **Data Migration:** Extracting data for transfer to another Salesforce org or external system.\n- **Reporting and Analysis:** Exporting specific datasets for detailed analysis outside of Salesforce.\n- **Data Seeding:** Preparing data for import into other environments.\n\nKey functionalities:\n\n- **SFDMU Workspace Integration:** Leverages an existing SFDMU workspace (defined by an `export.json` file) to determine which objects and records to export, along with any filtering or transformation rules.\n- **Interactive Workspace Selection:** If the SFDMU workspace path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Org Selection:** Ensures that a target Salesforce org is selected (either via the `--target-org` flag or through an interactive prompt) to specify the source of the data export.\n\nSee this article for a practical example:\n\n[![How to detect bad words in Salesforce records using SFDX Data Loader and sfdx-hardis](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-badwords.jpg)](https://nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation relies heavily on the SFDMU plugin:\n\n- **SFDMU Integration:** It acts as a wrapper around the `sfdmu` plugin, which performs the actual data export operations. The command provides an assisted interface for SFDMU execution.\n- **`exportData` Utility:** The core logic for executing the SFDMU export process is encapsulated within the `exportData` utility function, which takes the SFDMU workspace path and the source username as arguments.\n- **Interactive Prompts:** Uses `selectDataWorkspace` to allow the user to choose an SFDMU project and `promptOrgUsernameDefault` for selecting the source Salesforce org when not running in a CI environment.\n- **Environment Awareness:** Checks the `isCI` flag to determine whether to run in an interactive mode (prompting for user input) or a non-interactive mode (relying solely on command-line flags).\n- **Required Plugin:** It explicitly lists `sfdmu` as a required plugin, ensuring that the necessary dependency is in place before execution.\n</details>\n",
5261
5261
  "examples": [
5262
- "$ sf hardis:org:data:export"
5262
+ "$ sf hardis:org:data:export",
5263
+ "$ sf hardis:org:data:export --project-name MyDataProject --target-org my-org@example.com",
5264
+ "$ sf hardis:org:data:export --path ./scripts/data/MyDataProject --no-prompt --target-org my-org@example.com"
5263
5265
  ],
5264
5266
  "flags": {
5265
5267
  "json": {
@@ -5277,6 +5279,14 @@
5277
5279
  "multiple": false,
5278
5280
  "type": "option"
5279
5281
  },
5282
+ "project-name": {
5283
+ "char": "n",
5284
+ "description": "Name of the sfdmu project to use (if not defined, you will be prompted to select one)",
5285
+ "name": "project-name",
5286
+ "hasDynamicHelp": false,
5287
+ "multiple": false,
5288
+ "type": "option"
5289
+ },
5280
5290
  "path": {
5281
5291
  "char": "p",
5282
5292
  "description": "Path to the sfdmu workspace folder",
@@ -5285,6 +5295,13 @@
5285
5295
  "multiple": false,
5286
5296
  "type": "option"
5287
5297
  },
5298
+ "no-prompt": {
5299
+ "char": "r",
5300
+ "description": "Do not prompt for Org, use default org",
5301
+ "name": "no-prompt",
5302
+ "allowNo": false,
5303
+ "type": "boolean"
5304
+ },
5288
5305
  "debug": {
5289
5306
  "char": "d",
5290
5307
  "description": "Activate debug mode (more logs)",
@@ -5376,7 +5393,10 @@
5376
5393
  "args": {},
5377
5394
  "description": "Import/Load data in an org using a [SFDX Data Loader](https://help.sfdmu.com/) Project\n\nIf you need to run this command in a production org, you need to either:\n\n- Define **sfdmuCanModify** in your .sfdx-hardis.yml config file. (Example: `sfdmuCanModify: prod-instance.my.salesforce.com`)\n- Define an environment variable SFDMU_CAN_MODIFY. (Example: `SFDMU_CAN_MODIFY=prod-instance.my.salesforce.com`)\n\nSee article:\n\n[![How to detect bad words in Salesforce records using SFDX Data Loader and sfdx-hardis](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-badwords.jpg)](https://nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac)\n",
5378
5395
  "examples": [
5379
- "$ sf hardis:org:data:import"
5396
+ "$ sf hardis:org:data:import",
5397
+ "$ sf hardis:org:data:import --project-name MyDataProject --target-org my-org@example.com",
5398
+ "$ sf hardis:org:data:import --path ./scripts/data/MyDataProject --no-prompt --target-org my-org@example.com",
5399
+ "$ SFDMU_CAN_MODIFY=prod-instance.my.salesforce.com sf hardis:org:data:import --project-name MyDataProject --target-org prod@example.com"
5380
5400
  ],
5381
5401
  "flags": {
5382
5402
  "json": {
@@ -5394,6 +5414,14 @@
5394
5414
  "multiple": false,
5395
5415
  "type": "option"
5396
5416
  },
5417
+ "project-name": {
5418
+ "char": "n",
5419
+ "description": "Name of the sfdmu project to use (if not defined, you will be prompted to select one)",
5420
+ "name": "project-name",
5421
+ "hasDynamicHelp": false,
5422
+ "multiple": false,
5423
+ "type": "option"
5424
+ },
5397
5425
  "path": {
5398
5426
  "char": "p",
5399
5427
  "description": "Path to the sfdmu workspace folder",
@@ -5402,6 +5430,13 @@
5402
5430
  "multiple": false,
5403
5431
  "type": "option"
5404
5432
  },
5433
+ "no-prompt": {
5434
+ "char": "r",
5435
+ "description": "Do not prompt for Org, use default org",
5436
+ "name": "no-prompt",
5437
+ "allowNo": false,
5438
+ "type": "boolean"
5439
+ },
5405
5440
  "debug": {
5406
5441
  "char": "d",
5407
5442
  "description": "Activate debug mode (more logs)",
@@ -7611,16 +7646,13 @@
7611
7646
  "limits:monitor:org:hardis"
7612
7647
  ]
7613
7648
  },
7614
- "hardis:org:refresh:after-refresh": {
7649
+ "hardis:org:purge:apexlog": {
7615
7650
  "aliases": [],
7616
7651
  "args": {},
7617
- "description": "\n## Command Behavior\n\n**Restores all previously backed-up Connected Apps (including Consumer Secrets) to a Salesforce org after a sandbox refresh.**\n\nThis command is the second step in the sandbox refresh process. It scans the backup folder created before the refresh, allows selection of which Connected Apps to restore, and automates their deletion and redeployment to the refreshed org, ensuring all credentials and configuration are preserved.\n\nKey functionalities:\n\n- **Backup Folder Selection:** Prompts the user to select the correct backup folder for the sandbox instance.\n- **Connected App Discovery:** Scans the backup for all Connected App metadata files.\n- **User Selection:** Allows interactive or flag-based selection of which Connected Apps to restore.\n- **Validation:** Ensures all selected apps exist in the backup and validates user input.\n- **Org Cleanup:** Deletes existing Connected Apps from the refreshed org to allow clean redeployment.\n- **Deployment:** Deploys the selected Connected Apps (with secrets) to the org.\n- **Summary and Reporting:** Provides a summary of restored apps and their status.\n\nThis command is part of [sfdx-hardis Sandbox Refresh](https://sfdx-hardis.cloudity.com/salesforce-sandbox-refresh/) and is designed to be run after a sandbox refresh, using the backup created by the before-refresh command.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\n- **Backup Folder Handling:** Prompts for and validates the backup folder under `scripts/sandbox-refresh/`.\n- **Metadata Scanning:** Uses glob patterns to find all `*.connectedApp - meta.xml` files in the backup.\n- **Selection Logic:** Supports `--all`, `--name`, and interactive selection of apps to restore.\n- **Validation:** Checks that all requested apps exist in the backup and provides clear errors if not.\n- **Org Operations:** Deletes existing Connected Apps from the org before redeployment to avoid conflicts.\n- **Deployment:** Uses utility functions to deploy Connected Apps and their secrets to the org.\n- **Error Handling:** Handles and reports errors at each step, including parsing and deployment issues.\n\n</details>\n",
7652
+ "description": "\n**Purges Apex debug logs from a Salesforce org.**\n\nThis command provides a quick and efficient way to clear out accumulated Apex debug logs from your Salesforce environment. This is particularly useful for:\n\n- **Storage Management:** Freeing up valuable data storage space in your Salesforce org.\n- **Performance Optimization:** Reducing the overhead associated with large volumes of debug logs.\n- **Troubleshooting:** Ensuring that new debug logs are generated cleanly without interference from old, irrelevant logs.\n\nKey functionalities:\n\n- **Log Identification:** Queries the `ApexLog` object to identify all existing debug logs.\n- **Confirmation Prompt:** Before deletion, it prompts for user confirmation, displaying the number of Apex logs that will be deleted.\n- **Bulk Deletion:** Uses the Salesforce Bulk API to efficiently delete a large number of Apex logs.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Query:** It executes a SOQL query (`SELECT Id FROM ApexLog LIMIT 50000`) to retrieve the IDs of Apex logs to be deleted. The limit is set to 50,000 to handle large volumes of logs.\n- **CSV Export:** The retrieved log IDs are temporarily exported to a CSV file (`ApexLogsToDelete_*.csv`) in the `./tmp` directory.\n- **User Confirmation:** It uses the `prompts` library to ask for user confirmation before proceeding with the deletion, displaying the count of logs to be purged.\n- **Bulk API Deletion:** It then uses the Salesforce CLI's `sf data delete bulk` command, pointing to the generated CSV file, to perform the mass deletion of Apex logs.\n- **File System Operations:** It uses `fs-extra` to create the temporary directory and manage the CSV file.\n- **Error Handling:** Includes error handling for the query and deletion operations.\n</details>\n",
7618
7653
  "examples": [
7619
- "$ sf hardis:org:refresh:after-refresh",
7620
- "$ sf hardis:org:refresh:after-refresh --name \"MyConnectedApp\" // Process specific app, no selection prompt",
7621
- "$ sf hardis:org:refresh:after-refresh --name \"App1,App2,App3\" // Process multiple apps, no selection prompt",
7622
- "$ sf hardis:org:refresh:after-refresh --all // Process all apps, no selection prompt",
7623
- "$ sf hardis:org:refresh:after-refresh --target-org myDevOrg"
7654
+ "$ sf hardis:org:purge:apexlog",
7655
+ "$ sf hardis:org:purge:apexlog --target-org nicolas.vuillamy@gmail.com"
7624
7656
  ],
7625
7657
  "flags": {
7626
7658
  "json": {
@@ -7638,106 +7670,104 @@
7638
7670
  "multiple": false,
7639
7671
  "type": "option"
7640
7672
  },
7641
- "target-org": {
7642
- "char": "o",
7643
- "name": "target-org",
7644
- "noCacheDefault": true,
7645
- "required": true,
7646
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7647
- "hasDynamicHelp": true,
7648
- "multiple": false,
7649
- "type": "option"
7650
- },
7651
- "name": {
7652
- "char": "n",
7653
- "description": "Connected App name(s) to process (bypasses selection prompt). For multiple apps, separate with commas (e.g., \"App1,App2\")",
7654
- "name": "name",
7655
- "summary": "Filter according to Name criteria",
7656
- "hasDynamicHelp": false,
7657
- "multiple": false,
7658
- "type": "option"
7659
- },
7660
- "all": {
7661
- "char": "a",
7662
- "description": "If set, all Connected Apps from the local repository will be processed. Takes precedence over --name if both are specified.",
7663
- "name": "all",
7664
- "summary": "Process all Connected Apps without selection prompt",
7665
- "allowNo": false,
7666
- "type": "boolean"
7667
- },
7668
- "websocket": {
7669
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7670
- "name": "websocket",
7671
- "summary": "Websocket host:port for VsCode SFDX Hardis UI integration",
7672
- "hasDynamicHelp": false,
7673
+ "prompt": {
7674
+ "char": "z",
7675
+ "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
7676
+ "name": "prompt",
7677
+ "allowNo": true,
7678
+ "type": "boolean"
7679
+ },
7680
+ "debug": {
7681
+ "char": "d",
7682
+ "description": "Activate debug mode (more logs)",
7683
+ "name": "debug",
7684
+ "allowNo": false,
7685
+ "type": "boolean"
7686
+ },
7687
+ "websocket": {
7688
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7689
+ "name": "websocket",
7690
+ "hasDynamicHelp": false,
7673
7691
  "multiple": false,
7674
7692
  "type": "option"
7675
7693
  },
7676
7694
  "skipauth": {
7677
7695
  "description": "Skip authentication check when a default username is required",
7678
7696
  "name": "skipauth",
7679
- "summary": "Skip authentication check when a default username is required",
7680
7697
  "allowNo": false,
7681
7698
  "type": "boolean"
7699
+ },
7700
+ "target-org": {
7701
+ "aliases": [
7702
+ "targetusername",
7703
+ "u"
7704
+ ],
7705
+ "char": "o",
7706
+ "deprecateAliases": true,
7707
+ "name": "target-org",
7708
+ "noCacheDefault": true,
7709
+ "required": true,
7710
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7711
+ "hasDynamicHelp": true,
7712
+ "multiple": false,
7713
+ "type": "option"
7682
7714
  }
7683
7715
  },
7684
7716
  "hasDynamicHelp": true,
7685
7717
  "hiddenAliases": [],
7686
- "id": "hardis:org:refresh:after-refresh",
7718
+ "id": "hardis:org:purge:apexlog",
7687
7719
  "pluginAlias": "sfdx-hardis",
7688
7720
  "pluginName": "sfdx-hardis",
7689
7721
  "pluginType": "core",
7690
7722
  "strict": true,
7691
7723
  "enableJsonFlag": true,
7692
- "title": "Restore Connected Apps after org refresh",
7693
- "requiresProject": true,
7724
+ "title": "Purge Apex Logs",
7725
+ "requiresProject": false,
7694
7726
  "isESM": true,
7695
7727
  "relativePath": [
7696
7728
  "lib",
7697
7729
  "commands",
7698
7730
  "hardis",
7699
7731
  "org",
7700
- "refresh",
7701
- "after-refresh.js"
7732
+ "purge",
7733
+ "apexlog.js"
7702
7734
  ],
7703
7735
  "aliasPermutations": [],
7704
7736
  "permutations": [
7705
- "hardis:org:refresh:after-refresh",
7706
- "org:hardis:refresh:after-refresh",
7707
- "org:refresh:hardis:after-refresh",
7708
- "org:refresh:after-refresh:hardis",
7709
- "hardis:refresh:org:after-refresh",
7710
- "refresh:hardis:org:after-refresh",
7711
- "refresh:org:hardis:after-refresh",
7712
- "refresh:org:after-refresh:hardis",
7713
- "hardis:refresh:after-refresh:org",
7714
- "refresh:hardis:after-refresh:org",
7715
- "refresh:after-refresh:hardis:org",
7716
- "refresh:after-refresh:org:hardis",
7717
- "hardis:org:after-refresh:refresh",
7718
- "org:hardis:after-refresh:refresh",
7719
- "org:after-refresh:hardis:refresh",
7720
- "org:after-refresh:refresh:hardis",
7721
- "hardis:after-refresh:org:refresh",
7722
- "after-refresh:hardis:org:refresh",
7723
- "after-refresh:org:hardis:refresh",
7724
- "after-refresh:org:refresh:hardis",
7725
- "hardis:after-refresh:refresh:org",
7726
- "after-refresh:hardis:refresh:org",
7727
- "after-refresh:refresh:hardis:org",
7728
- "after-refresh:refresh:org:hardis"
7737
+ "hardis:org:purge:apexlog",
7738
+ "org:hardis:purge:apexlog",
7739
+ "org:purge:hardis:apexlog",
7740
+ "org:purge:apexlog:hardis",
7741
+ "hardis:purge:org:apexlog",
7742
+ "purge:hardis:org:apexlog",
7743
+ "purge:org:hardis:apexlog",
7744
+ "purge:org:apexlog:hardis",
7745
+ "hardis:purge:apexlog:org",
7746
+ "purge:hardis:apexlog:org",
7747
+ "purge:apexlog:hardis:org",
7748
+ "purge:apexlog:org:hardis",
7749
+ "hardis:org:apexlog:purge",
7750
+ "org:hardis:apexlog:purge",
7751
+ "org:apexlog:hardis:purge",
7752
+ "org:apexlog:purge:hardis",
7753
+ "hardis:apexlog:org:purge",
7754
+ "apexlog:hardis:org:purge",
7755
+ "apexlog:org:hardis:purge",
7756
+ "apexlog:org:purge:hardis",
7757
+ "hardis:apexlog:purge:org",
7758
+ "apexlog:hardis:purge:org",
7759
+ "apexlog:purge:hardis:org",
7760
+ "apexlog:purge:org:hardis"
7729
7761
  ]
7730
7762
  },
7731
- "hardis:org:refresh:before-refresh": {
7763
+ "hardis:org:purge:flow": {
7732
7764
  "aliases": [],
7733
7765
  "args": {},
7734
- "description": "\n## Command Behavior\n\n**Backs up all Connected Apps, their secrets, certificates, and custom settings from a Salesforce org before a sandbox refresh, enabling full restoration after the refresh.**\n\nThis command is essential for Salesforce sandbox refresh operations where Connected Apps (and their Consumer Secrets), certificates, and custom settings would otherwise be lost. It automates the extraction, secure storage, and (optionally) deletion of Connected Apps, ensuring that all credentials and configuration can be restored post-refresh.\n\nKey functionalities:\n\n- **Connected App Discovery:** Lists all Connected Apps in the org, with options to filter by name, process all, or interactively select.\n- **User Selection:** Allows interactive or flag-based selection of which Connected Apps to back up.\n- **Metadata Retrieval:** Retrieves Connected App metadata and saves it in a dedicated project folder for the sandbox instance.\n- **Consumer Secret Extraction:** Attempts to extract Consumer Secrets automatically using browser automation (Puppeteer), or prompts for manual entry if automation fails.\n- **Config Persistence:** Stores the list of selected apps in the project config for use during restoration.\n- **Optional Deletion:** Can delete the Connected Apps from the org after backup, as required for re-upload after refresh.\n- **Certificate Backup:** Retrieves all org certificates and their definitions, saving them for later restoration.\n- **Custom Settings Backup:** Lists all custom settings in the org, allows user selection, and exports their data to JSON files for backup.\n- **Summary and Reporting:** Provides a summary of actions, including which apps, certificates, and custom settings were saved and whether secrets were captured.\n\nThis command is part of [sfdx-hardis Sandbox Refresh](https://sfdx-hardis.cloudity.com/salesforce-sandbox-refresh/) and is designed to be run before a sandbox refresh. It ensures that all Connected Apps, secrets, certificates, and custom settings are safely stored for later restoration.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\n- **Salesforce CLI Integration:** Uses `sf org list metadata`, `sf project retrieve start`, and other CLI commands to discover and retrieve Connected Apps, certificates, and custom settings.\n- **Metadata Handling:** Saves Connected App XML files and certificate files in a dedicated folder under `scripts/sandbox-refresh/<sandbox-folder>`.\n- **Consumer Secret Handling:** Uses Puppeteer to automate browser login and extraction of Consumer Secrets, falling back to manual prompts if needed.\n- **Custom Settings Handling:** Lists all custom settings, allows user selection, and exports their data using `sf data tree export` to JSON files.\n- **Config Management:** Updates `config/.sfdx-hardis.yml` with the list of selected apps for later use.\n- **Deletion Logic:** Optionally deletes Connected Apps from the org (required for re-upload after refresh), with user confirmation unless running in CI or with `--delete` flag.\n- **Error Handling:** Provides detailed error messages and guidance if retrieval or extraction fails.\n- **Reporting:** Sends summary and configuration files to the WebSocket client for reporting and traceability.\n\n</details>\n",
7766
+ "description": "\n**Purges old or unwanted Flow versions from a Salesforce org, with an option to delete related Flow Interviews.**\n\nThis command helps maintain a clean and performant Salesforce org by removing obsolete Flow versions. Over time, multiple versions of Flows can accumulate, consuming storage and potentially impacting performance. This tool provides a controlled way to clean up these versions.\n\nKey functionalities:\n\n- **Targeted Flow Selection:** Allows you to filter Flow versions to delete by name (`--name`) and status (`--status`, e.g., `Obsolete`, `Draft`, `Inactive`).\n- **Flow Interview Deletion:** If a Flow version cannot be deleted due to active Flow Interviews, the `--delete-flow-interviews` flag (or interactive prompt) allows you to delete these interviews first, then retry the Flow version deletion.\n- **Confirmation Prompt:** In interactive mode, it prompts for confirmation before proceeding with the deletion of Flow versions and Flow Interviews.\n- **Partial Success Handling:** The `--allowpurgefailure` flag (default `true`) allows the command to continue even if some deletions fail, reporting the errors.\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 `Flow` object (using the Tooling API) to list Flow versions based on the provided filters (name, status, manageable state).\n- **Bulk Deletion (Tooling API):** It uses `bulkDeleteTooling` to perform mass deletions of Flow versions. If deletion fails due to active interviews, it extracts the interview IDs.\n- **Flow Interview Management:** If `delete-flow-interviews` is enabled, it queries `FlowInterview` objects, performs bulk deletion of the identified interviews using `bulkDelete`, and then retries the Flow version deletion.\n- **Interactive Prompts:** Uses the `prompts` library to interact with the user for selecting Flows, statuses, and confirming deletion actions.\n- **Error Reporting:** Logs detailed error messages for failed deletions, including the specific reasons.\n- **Command-Line Execution:** Uses `execSfdxJson` to execute Salesforce CLI commands for querying Flow data.\n</details>\n",
7735
7767
  "examples": [
7736
- "$ sf hardis:org:refresh:before-refresh",
7737
- "$ sf hardis:org:refresh:before-refresh --name \"MyConnectedApp\"",
7738
- "$ sf hardis:org:refresh:before-refresh --name \"App1,App2,App3\"",
7739
- "$ sf hardis:org:refresh:before-refresh --all",
7740
- "$ sf hardis:org:refresh:before-refresh --delete"
7768
+ "$ sf hardis:org:purge:flow",
7769
+ "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --no-prompt --delete-flow-interviews",
7770
+ "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --status \"Obsolete,Draft,InvalidDraft\" --name TestFlow"
7741
7771
  ],
7742
7772
  "flags": {
7743
7773
  "json": {
@@ -7755,38 +7785,56 @@
7755
7785
  "multiple": false,
7756
7786
  "type": "option"
7757
7787
  },
7758
- "target-org": {
7759
- "char": "o",
7760
- "name": "target-org",
7761
- "noCacheDefault": true,
7762
- "required": true,
7763
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7764
- "hasDynamicHelp": true,
7788
+ "prompt": {
7789
+ "char": "z",
7790
+ "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
7791
+ "name": "prompt",
7792
+ "allowNo": true,
7793
+ "type": "boolean"
7794
+ },
7795
+ "name": {
7796
+ "char": "n",
7797
+ "description": "Filter according to Name criteria",
7798
+ "name": "name",
7799
+ "hasDynamicHelp": false,
7765
7800
  "multiple": false,
7766
7801
  "type": "option"
7767
7802
  },
7768
- "delete": {
7769
- "char": "d",
7770
- "description": "By default, Connected Apps are not deleted from the org after saving. Set this flag to force their deletion so they will be able to be reuploaded again after refreshing the org.",
7771
- "name": "delete",
7772
- "summary": "Delete Connected Apps from org after saving",
7803
+ "status": {
7804
+ "char": "s",
7805
+ "description": "Filter according to Status criteria",
7806
+ "name": "status",
7807
+ "hasDynamicHelp": false,
7808
+ "multiple": false,
7809
+ "type": "option"
7810
+ },
7811
+ "delete-flow-interviews": {
7812
+ "char": "w",
7813
+ "description": "If the presence of Flow interviews prevent to delete flows versions, delete them before retrying to delete flow versions",
7814
+ "name": "delete-flow-interviews",
7773
7815
  "allowNo": false,
7774
7816
  "type": "boolean"
7775
7817
  },
7776
- "name": {
7777
- "char": "n",
7778
- "description": "Connected App name(s) to process. For multiple apps, separate with commas (e.g., \"App1,App2\")",
7779
- "name": "name",
7780
- "summary": "Filter according to Name criteria",
7818
+ "allowpurgefailure": {
7819
+ "char": "f",
7820
+ "description": "Allows purges to fail without exiting with 1. Use --no-allowpurgefailure to disable",
7821
+ "name": "allowpurgefailure",
7822
+ "allowNo": true,
7823
+ "type": "boolean"
7824
+ },
7825
+ "instanceurl": {
7826
+ "char": "r",
7827
+ "description": "URL of org instance",
7828
+ "name": "instanceurl",
7829
+ "default": "https://login.salesforce.com",
7781
7830
  "hasDynamicHelp": false,
7782
7831
  "multiple": false,
7783
7832
  "type": "option"
7784
7833
  },
7785
- "all": {
7786
- "char": "a",
7787
- "description": "If set, all Connected Apps from the org will be processed. Takes precedence over --name if both are specified.",
7788
- "name": "all",
7789
- "summary": "Process all Connected Apps without selection prompt",
7834
+ "debug": {
7835
+ "char": "d",
7836
+ "description": "Activate debug mode (more logs)",
7837
+ "name": "debug",
7790
7838
  "allowNo": false,
7791
7839
  "type": "boolean"
7792
7840
  },
@@ -7802,61 +7850,80 @@
7802
7850
  "name": "skipauth",
7803
7851
  "allowNo": false,
7804
7852
  "type": "boolean"
7853
+ },
7854
+ "target-org": {
7855
+ "aliases": [
7856
+ "targetusername",
7857
+ "u"
7858
+ ],
7859
+ "char": "o",
7860
+ "deprecateAliases": true,
7861
+ "name": "target-org",
7862
+ "noCacheDefault": true,
7863
+ "required": true,
7864
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7865
+ "hasDynamicHelp": true,
7866
+ "multiple": false,
7867
+ "type": "option"
7805
7868
  }
7806
7869
  },
7807
7870
  "hasDynamicHelp": true,
7808
7871
  "hiddenAliases": [],
7809
- "id": "hardis:org:refresh:before-refresh",
7872
+ "id": "hardis:org:purge:flow",
7810
7873
  "pluginAlias": "sfdx-hardis",
7811
7874
  "pluginName": "sfdx-hardis",
7812
7875
  "pluginType": "core",
7813
7876
  "strict": true,
7814
7877
  "enableJsonFlag": true,
7815
- "requiresProject": true,
7878
+ "title": "Purge Flow versions",
7879
+ "requiresProject": false,
7816
7880
  "isESM": true,
7817
7881
  "relativePath": [
7818
7882
  "lib",
7819
7883
  "commands",
7820
7884
  "hardis",
7821
7885
  "org",
7822
- "refresh",
7823
- "before-refresh.js"
7886
+ "purge",
7887
+ "flow.js"
7824
7888
  ],
7825
7889
  "aliasPermutations": [],
7826
7890
  "permutations": [
7827
- "hardis:org:refresh:before-refresh",
7828
- "org:hardis:refresh:before-refresh",
7829
- "org:refresh:hardis:before-refresh",
7830
- "org:refresh:before-refresh:hardis",
7831
- "hardis:refresh:org:before-refresh",
7832
- "refresh:hardis:org:before-refresh",
7833
- "refresh:org:hardis:before-refresh",
7834
- "refresh:org:before-refresh:hardis",
7835
- "hardis:refresh:before-refresh:org",
7836
- "refresh:hardis:before-refresh:org",
7837
- "refresh:before-refresh:hardis:org",
7838
- "refresh:before-refresh:org:hardis",
7839
- "hardis:org:before-refresh:refresh",
7840
- "org:hardis:before-refresh:refresh",
7841
- "org:before-refresh:hardis:refresh",
7842
- "org:before-refresh:refresh:hardis",
7843
- "hardis:before-refresh:org:refresh",
7844
- "before-refresh:hardis:org:refresh",
7845
- "before-refresh:org:hardis:refresh",
7846
- "before-refresh:org:refresh:hardis",
7847
- "hardis:before-refresh:refresh:org",
7848
- "before-refresh:hardis:refresh:org",
7849
- "before-refresh:refresh:hardis:org",
7850
- "before-refresh:refresh:org:hardis"
7891
+ "hardis:org:purge:flow",
7892
+ "org:hardis:purge:flow",
7893
+ "org:purge:hardis:flow",
7894
+ "org:purge:flow:hardis",
7895
+ "hardis:purge:org:flow",
7896
+ "purge:hardis:org:flow",
7897
+ "purge:org:hardis:flow",
7898
+ "purge:org:flow:hardis",
7899
+ "hardis:purge:flow:org",
7900
+ "purge:hardis:flow:org",
7901
+ "purge:flow:hardis:org",
7902
+ "purge:flow:org:hardis",
7903
+ "hardis:org:flow:purge",
7904
+ "org:hardis:flow:purge",
7905
+ "org:flow:hardis:purge",
7906
+ "org:flow:purge:hardis",
7907
+ "hardis:flow:org:purge",
7908
+ "flow:hardis:org:purge",
7909
+ "flow:org:hardis:purge",
7910
+ "flow:org:purge:hardis",
7911
+ "hardis:flow:purge:org",
7912
+ "flow:hardis:purge:org",
7913
+ "flow:purge:hardis:org",
7914
+ "flow:purge:org:hardis"
7851
7915
  ]
7852
7916
  },
7853
- "hardis:org:retrieve:packageconfig": {
7917
+ "hardis:org:refresh:after-refresh": {
7854
7918
  "aliases": [],
7855
7919
  "args": {},
7856
- "description": "\n**Retrieves the installed package configuration from a Salesforce org and optionally updates the local project configuration.**\n\nThis command is useful for maintaining an accurate record of installed packages within your Salesforce project, which is crucial for managing dependencies and ensuring consistent deployments across environments.\n\nKey functionalities:\n\n- **Package Listing:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a list of all installed packages.\n- **Configuration Update:** Offers the option to update your local project's configuration with the retrieved list of installed packages. This can be beneficial for automating package installations during environment setup or CI/CD processes.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Org Connection:** It establishes a connection to the target Salesforce org using the provided or prompted username.\n- **Metadata Retrieval:** It utilizes `MetadataUtils.listInstalledPackages` to query the Salesforce org and obtain details about the installed packages.\n- **Interactive Prompt:** It uses the `prompts` library to ask the user whether they want to update their local project configuration with the retrieved package list.\n- **Configuration Management:** If the user confirms, it calls `managePackageConfig` to update the project's configuration file (likely `.sfdx-hardis.yml`) with the new package information.\n- **User Feedback:** Provides clear messages to the user about the success of the package retrieval and configuration update.\n</details>\n",
7920
+ "description": "\n## Command Behavior\n\n**Restores all previously backed-up Connected Apps (including Consumer Secrets), certificates, custom settings, records and other metadata to a Salesforce org after a sandbox refresh.**\n\nThis command is the second step in the sandbox refresh process. It scans the backup folder created before the refresh, allows interactive or flag-driven selection of items to restore, and automates cleanup and redeployment to the refreshed org while preserving credentials and configuration.\n\nKey functionalities:\n\n- **Choose a backup to restore:** Lets you pick the saved sandbox project that contains the artifacts to restore.\n- **Select which items to restore:** Finds Connected App XMLs, certificates, custom settings and other artifacts and lets you pick what to restore (or restore all).\n- **Safety checks and validation:** Confirms files exist and prompts before making changes to the target org.\n- **Prepare org for restore:** Optionally cleans up existing Connected Apps so saved apps can be re-deployed without conflict.\n- **Redeploy saved artifacts:** Restores Connected Apps (with saved secrets), certificates, SAML SSO configs, custom settings and other metadata.\n- **Handle SAML configs:** Cleans and updates SAML XML files and helps you choose certificates to wire into restored configs.\n- **Restore records:** Optionally runs data import from selected SFDMU workspaces to restore record data.\n- **Reporting & persistence:** Sends restore reports and can update project config to record what was restored.\n\nThis command is part of [sfdx-hardis Sandbox Refresh](https://sfdx-hardis.cloudity.com/salesforce-sandbox-refresh/) and is intended to be run after a sandbox refresh to re-apply saved metadata, credentials and data.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\n- **Backup Folder Handling:** Reads the immediate subfolders of `scripts/sandbox-refresh/` and validates the chosen project contains the expected `manifest/` and `force-app` layout.\n- **Metadata & Deployment APIs:** Uses `sf project deploy start --manifest` for package-based deploys, `sf project deploy start --metadata-dir` for MDAPI artifacts (certificates), and utility functions for Connected App deployment that preserve consumer secrets.\n- **SAML Handling:** Queries active certificates via tooling API, updates SAML XML files, and deploys using `sf project deploy start -m SamlSsoConfig`.\n- **Records Handling:** Uses interactive selection of SFDMU workspaces and runs data import utilities to restore records.\n- **Error Handling & Summary:** Aggregates results, logs success/warnings/errors, and returns a structured result indicating which items were restored and any failures.\n\n</details>\n",
7857
7921
  "examples": [
7858
- "$ sf hardis:org:retrieve:packageconfig",
7859
- "sf hardis:org:retrieve:packageconfig -u myOrg"
7922
+ "$ sf hardis:org:refresh:after-refresh",
7923
+ "$ sf hardis:org:refresh:after-refresh --name \"MyConnectedApp\" // Process specific app, no selection prompt",
7924
+ "$ sf hardis:org:refresh:after-refresh --name \"App1,App2,App3\" // Process multiple apps, no selection prompt",
7925
+ "$ sf hardis:org:refresh:after-refresh --all // Process all apps, no selection prompt",
7926
+ "$ sf hardis:org:refresh:after-refresh --target-org myDevOrg"
7860
7927
  ],
7861
7928
  "flags": {
7862
7929
  "json": {
@@ -7874,16 +7941,37 @@
7874
7941
  "multiple": false,
7875
7942
  "type": "option"
7876
7943
  },
7877
- "debug": {
7878
- "char": "d",
7879
- "description": "Activate debug mode (more logs)",
7880
- "name": "debug",
7944
+ "target-org": {
7945
+ "char": "o",
7946
+ "name": "target-org",
7947
+ "noCacheDefault": true,
7948
+ "required": true,
7949
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7950
+ "hasDynamicHelp": true,
7951
+ "multiple": false,
7952
+ "type": "option"
7953
+ },
7954
+ "name": {
7955
+ "char": "n",
7956
+ "description": "Connected App name(s) to process (bypasses selection prompt). For multiple apps, separate with commas (e.g., \"App1,App2\")",
7957
+ "name": "name",
7958
+ "summary": "Filter according to Name criteria",
7959
+ "hasDynamicHelp": false,
7960
+ "multiple": false,
7961
+ "type": "option"
7962
+ },
7963
+ "all": {
7964
+ "char": "a",
7965
+ "description": "If set, all Connected Apps from the local repository will be processed. Takes precedence over --name if both are specified.",
7966
+ "name": "all",
7967
+ "summary": "Process all Connected Apps without selection prompt",
7881
7968
  "allowNo": false,
7882
7969
  "type": "boolean"
7883
7970
  },
7884
7971
  "websocket": {
7885
7972
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7886
7973
  "name": "websocket",
7974
+ "summary": "Websocket host:port for VsCode SFDX Hardis UI integration",
7887
7975
  "hasDynamicHelp": false,
7888
7976
  "multiple": false,
7889
7977
  "type": "option"
@@ -7891,79 +7979,68 @@
7891
7979
  "skipauth": {
7892
7980
  "description": "Skip authentication check when a default username is required",
7893
7981
  "name": "skipauth",
7982
+ "summary": "Skip authentication check when a default username is required",
7894
7983
  "allowNo": false,
7895
7984
  "type": "boolean"
7896
- },
7897
- "target-org": {
7898
- "aliases": [
7899
- "targetusername",
7900
- "u"
7901
- ],
7902
- "char": "o",
7903
- "deprecateAliases": true,
7904
- "name": "target-org",
7905
- "noCacheDefault": true,
7906
- "required": true,
7907
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7908
- "hasDynamicHelp": true,
7909
- "multiple": false,
7910
- "type": "option"
7911
7985
  }
7912
7986
  },
7913
7987
  "hasDynamicHelp": true,
7914
7988
  "hiddenAliases": [],
7915
- "id": "hardis:org:retrieve:packageconfig",
7989
+ "id": "hardis:org:refresh:after-refresh",
7916
7990
  "pluginAlias": "sfdx-hardis",
7917
7991
  "pluginName": "sfdx-hardis",
7918
7992
  "pluginType": "core",
7919
7993
  "strict": true,
7920
7994
  "enableJsonFlag": true,
7921
- "title": "Retrieve package configuration from an org",
7922
- "requiresProject": false,
7995
+ "title": "Restore Connected Apps after org refresh",
7996
+ "requiresProject": true,
7923
7997
  "isESM": true,
7924
7998
  "relativePath": [
7925
7999
  "lib",
7926
8000
  "commands",
7927
8001
  "hardis",
7928
8002
  "org",
7929
- "retrieve",
7930
- "packageconfig.js"
8003
+ "refresh",
8004
+ "after-refresh.js"
7931
8005
  ],
7932
8006
  "aliasPermutations": [],
7933
8007
  "permutations": [
7934
- "hardis:org:retrieve:packageconfig",
7935
- "org:hardis:retrieve:packageconfig",
7936
- "org:retrieve:hardis:packageconfig",
7937
- "org:retrieve:packageconfig:hardis",
7938
- "hardis:retrieve:org:packageconfig",
7939
- "retrieve:hardis:org:packageconfig",
7940
- "retrieve:org:hardis:packageconfig",
7941
- "retrieve:org:packageconfig:hardis",
7942
- "hardis:retrieve:packageconfig:org",
7943
- "retrieve:hardis:packageconfig:org",
7944
- "retrieve:packageconfig:hardis:org",
7945
- "retrieve:packageconfig:org:hardis",
7946
- "hardis:org:packageconfig:retrieve",
7947
- "org:hardis:packageconfig:retrieve",
7948
- "org:packageconfig:hardis:retrieve",
7949
- "org:packageconfig:retrieve:hardis",
7950
- "hardis:packageconfig:org:retrieve",
7951
- "packageconfig:hardis:org:retrieve",
7952
- "packageconfig:org:hardis:retrieve",
7953
- "packageconfig:org:retrieve:hardis",
7954
- "hardis:packageconfig:retrieve:org",
7955
- "packageconfig:hardis:retrieve:org",
7956
- "packageconfig:retrieve:hardis:org",
7957
- "packageconfig:retrieve:org:hardis"
8008
+ "hardis:org:refresh:after-refresh",
8009
+ "org:hardis:refresh:after-refresh",
8010
+ "org:refresh:hardis:after-refresh",
8011
+ "org:refresh:after-refresh:hardis",
8012
+ "hardis:refresh:org:after-refresh",
8013
+ "refresh:hardis:org:after-refresh",
8014
+ "refresh:org:hardis:after-refresh",
8015
+ "refresh:org:after-refresh:hardis",
8016
+ "hardis:refresh:after-refresh:org",
8017
+ "refresh:hardis:after-refresh:org",
8018
+ "refresh:after-refresh:hardis:org",
8019
+ "refresh:after-refresh:org:hardis",
8020
+ "hardis:org:after-refresh:refresh",
8021
+ "org:hardis:after-refresh:refresh",
8022
+ "org:after-refresh:hardis:refresh",
8023
+ "org:after-refresh:refresh:hardis",
8024
+ "hardis:after-refresh:org:refresh",
8025
+ "after-refresh:hardis:org:refresh",
8026
+ "after-refresh:org:hardis:refresh",
8027
+ "after-refresh:org:refresh:hardis",
8028
+ "hardis:after-refresh:refresh:org",
8029
+ "after-refresh:hardis:refresh:org",
8030
+ "after-refresh:refresh:hardis:org",
8031
+ "after-refresh:refresh:org:hardis"
7958
8032
  ]
7959
8033
  },
7960
- "hardis:org:purge:apexlog": {
8034
+ "hardis:org:refresh:before-refresh": {
7961
8035
  "aliases": [],
7962
8036
  "args": {},
7963
- "description": "\n**Purges Apex debug logs from a Salesforce org.**\n\nThis command provides a quick and efficient way to clear out accumulated Apex debug logs from your Salesforce environment. This is particularly useful for:\n\n- **Storage Management:** Freeing up valuable data storage space in your Salesforce org.\n- **Performance Optimization:** Reducing the overhead associated with large volumes of debug logs.\n- **Troubleshooting:** Ensuring that new debug logs are generated cleanly without interference from old, irrelevant logs.\n\nKey functionalities:\n\n- **Log Identification:** Queries the `ApexLog` object to identify all existing debug logs.\n- **Confirmation Prompt:** Before deletion, it prompts for user confirmation, displaying the number of Apex logs that will be deleted.\n- **Bulk Deletion:** Uses the Salesforce Bulk API to efficiently delete a large number of Apex logs.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Query:** It executes a SOQL query (`SELECT Id FROM ApexLog LIMIT 50000`) to retrieve the IDs of Apex logs to be deleted. The limit is set to 50,000 to handle large volumes of logs.\n- **CSV Export:** The retrieved log IDs are temporarily exported to a CSV file (`ApexLogsToDelete_*.csv`) in the `./tmp` directory.\n- **User Confirmation:** It uses the `prompts` library to ask for user confirmation before proceeding with the deletion, displaying the count of logs to be purged.\n- **Bulk API Deletion:** It then uses the Salesforce CLI's `sf data delete bulk` command, pointing to the generated CSV file, to perform the mass deletion of Apex logs.\n- **File System Operations:** It uses `fs-extra` to create the temporary directory and manage the CSV file.\n- **Error Handling:** Includes error handling for the query and deletion operations.\n</details>\n",
8037
+ "description": "\n## Command Behavior\n\n**Backs up all Connected Apps (including Consumer Secrets), certificates, custom settings, records and other metadata from a Salesforce org before a sandbox refresh, enabling full restoration after the refresh.**\n\nThis command prepares a complete backup prior to a sandbox refresh. It creates a dedicated project under `scripts/sandbox-refresh/<sandbox-folder>`, retrieves metadata and data, attempts to capture Connected App consumer secrets, and can optionally delete the apps so they can be reuploaded after the refresh.\n\nKey functionalities:\n\n- **Create a save project:** Generates a dedicated project folder to store all artifacts for the sandbox backup.\n- **Find and select Connected Apps:** Lists Connected Apps in the org and lets you pick specific apps, use a name filter, or process all apps.\n- **Save metadata for restore:** Builds a manifest and retrieves the metadata types you choose so they can be restored after the refresh.\n- **Capture Consumer Secrets:** Attempts to capture Connected App consumer secrets automatically (opens a browser session when possible) and falls back to a short manual prompt when needed.\n- **Collect certificates:** Saves certificate files and their definitions so they can be redeployed later.\n- **Export custom settings & records:** Lets you pick custom settings to export as JSON and optionally export records using configured data workspaces.\n- **Persist choices & report:** Stores your backup choices in project config and sends report files for traceability.\n- **Optional cleanup:** Can delete backed-up Connected Apps from the org so they can be re-uploaded cleanly after the refresh.\n- **Interactive safety checks:** Prompts you to confirm package contents and other potentially destructive actions; sensible defaults are chosen where appropriate.\n\nThis command is part of [sfdx-hardis Sandbox Refresh](https://sfdx-hardis.cloudity.com/salesforce-sandbox-refresh/) and is intended to be run before a sandbox refresh so that all credentials, certificates, metadata and data can be restored afterwards.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\n- **Salesforce CLI Integration:** Uses `sf org list metadata`, `sf project retrieve start`, `sf project generate`, `sf project deploy start`, and `sf data tree export`/`import` where applicable.\n- **Metadata Handling:** Writes and reads package XML files under the generated project (`manifest/`), copies MDAPI certificate artifacts into `force-app/main/default/certs`, and produces `package-metadata-to-restore.xml` for post-refresh deployment.\n- **Consumer Secret Handling:** Uses `puppeteer-core` with an executable path from `getChromeExecutablePath()` (env var `PUPPETEER_EXECUTABLE_PATH` may be required). Falls back to manual prompt when browser automation cannot be used.\n- **Data & Records:** Exports custom settings to JSON and supports exporting records through SFDMU workspaces chosen interactively.\n- **Config & Reporting:** Updates project/user config under `config/.sfdx-hardis.yml#refreshSandboxConfig` and reports artifacts to the WebSocket client.\n- **Error Handling:** Provides clear error messages and a summary response object indicating success/failure and which secrets were captured.\n\n</details>\n",
7964
8038
  "examples": [
7965
- "$ sf hardis:org:purge:apexlog",
7966
- "$ sf hardis:org:purge:apexlog --target-org nicolas.vuillamy@gmail.com"
8039
+ "$ sf hardis:org:refresh:before-refresh",
8040
+ "$ sf hardis:org:refresh:before-refresh --name \"MyConnectedApp\"",
8041
+ "$ sf hardis:org:refresh:before-refresh --name \"App1,App2,App3\"",
8042
+ "$ sf hardis:org:refresh:before-refresh --all",
8043
+ "$ sf hardis:org:refresh:before-refresh --delete"
7967
8044
  ],
7968
8045
  "flags": {
7969
8046
  "json": {
@@ -7981,17 +8058,38 @@
7981
8058
  "multiple": false,
7982
8059
  "type": "option"
7983
8060
  },
7984
- "prompt": {
7985
- "char": "z",
7986
- "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
7987
- "name": "prompt",
7988
- "allowNo": true,
7989
- "type": "boolean"
8061
+ "target-org": {
8062
+ "char": "o",
8063
+ "name": "target-org",
8064
+ "noCacheDefault": true,
8065
+ "required": true,
8066
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8067
+ "hasDynamicHelp": true,
8068
+ "multiple": false,
8069
+ "type": "option"
7990
8070
  },
7991
- "debug": {
8071
+ "delete": {
7992
8072
  "char": "d",
7993
- "description": "Activate debug mode (more logs)",
7994
- "name": "debug",
8073
+ "description": "By default, Connected Apps are not deleted from the org after saving. Set this flag to force their deletion so they will be able to be reuploaded again after refreshing the org.",
8074
+ "name": "delete",
8075
+ "summary": "Delete Connected Apps from org after saving",
8076
+ "allowNo": false,
8077
+ "type": "boolean"
8078
+ },
8079
+ "name": {
8080
+ "char": "n",
8081
+ "description": "Connected App name(s) to process. For multiple apps, separate with commas (e.g., \"App1,App2\")",
8082
+ "name": "name",
8083
+ "summary": "Filter according to Name criteria",
8084
+ "hasDynamicHelp": false,
8085
+ "multiple": false,
8086
+ "type": "option"
8087
+ },
8088
+ "all": {
8089
+ "char": "a",
8090
+ "description": "If set, all Connected Apps from the org will be processed. Takes precedence over --name if both are specified.",
8091
+ "name": "all",
8092
+ "summary": "Process all Connected Apps without selection prompt",
7995
8093
  "allowNo": false,
7996
8094
  "type": "boolean"
7997
8095
  },
@@ -8007,78 +8105,61 @@
8007
8105
  "name": "skipauth",
8008
8106
  "allowNo": false,
8009
8107
  "type": "boolean"
8010
- },
8011
- "target-org": {
8012
- "aliases": [
8013
- "targetusername",
8014
- "u"
8015
- ],
8016
- "char": "o",
8017
- "deprecateAliases": true,
8018
- "name": "target-org",
8019
- "noCacheDefault": true,
8020
- "required": true,
8021
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8022
- "hasDynamicHelp": true,
8023
- "multiple": false,
8024
- "type": "option"
8025
8108
  }
8026
8109
  },
8027
8110
  "hasDynamicHelp": true,
8028
8111
  "hiddenAliases": [],
8029
- "id": "hardis:org:purge:apexlog",
8112
+ "id": "hardis:org:refresh:before-refresh",
8030
8113
  "pluginAlias": "sfdx-hardis",
8031
8114
  "pluginName": "sfdx-hardis",
8032
8115
  "pluginType": "core",
8033
8116
  "strict": true,
8034
8117
  "enableJsonFlag": true,
8035
- "title": "Purge Apex Logs",
8036
- "requiresProject": false,
8118
+ "requiresProject": true,
8037
8119
  "isESM": true,
8038
8120
  "relativePath": [
8039
8121
  "lib",
8040
8122
  "commands",
8041
8123
  "hardis",
8042
8124
  "org",
8043
- "purge",
8044
- "apexlog.js"
8125
+ "refresh",
8126
+ "before-refresh.js"
8045
8127
  ],
8046
8128
  "aliasPermutations": [],
8047
8129
  "permutations": [
8048
- "hardis:org:purge:apexlog",
8049
- "org:hardis:purge:apexlog",
8050
- "org:purge:hardis:apexlog",
8051
- "org:purge:apexlog:hardis",
8052
- "hardis:purge:org:apexlog",
8053
- "purge:hardis:org:apexlog",
8054
- "purge:org:hardis:apexlog",
8055
- "purge:org:apexlog:hardis",
8056
- "hardis:purge:apexlog:org",
8057
- "purge:hardis:apexlog:org",
8058
- "purge:apexlog:hardis:org",
8059
- "purge:apexlog:org:hardis",
8060
- "hardis:org:apexlog:purge",
8061
- "org:hardis:apexlog:purge",
8062
- "org:apexlog:hardis:purge",
8063
- "org:apexlog:purge:hardis",
8064
- "hardis:apexlog:org:purge",
8065
- "apexlog:hardis:org:purge",
8066
- "apexlog:org:hardis:purge",
8067
- "apexlog:org:purge:hardis",
8068
- "hardis:apexlog:purge:org",
8069
- "apexlog:hardis:purge:org",
8070
- "apexlog:purge:hardis:org",
8071
- "apexlog:purge:org:hardis"
8130
+ "hardis:org:refresh:before-refresh",
8131
+ "org:hardis:refresh:before-refresh",
8132
+ "org:refresh:hardis:before-refresh",
8133
+ "org:refresh:before-refresh:hardis",
8134
+ "hardis:refresh:org:before-refresh",
8135
+ "refresh:hardis:org:before-refresh",
8136
+ "refresh:org:hardis:before-refresh",
8137
+ "refresh:org:before-refresh:hardis",
8138
+ "hardis:refresh:before-refresh:org",
8139
+ "refresh:hardis:before-refresh:org",
8140
+ "refresh:before-refresh:hardis:org",
8141
+ "refresh:before-refresh:org:hardis",
8142
+ "hardis:org:before-refresh:refresh",
8143
+ "org:hardis:before-refresh:refresh",
8144
+ "org:before-refresh:hardis:refresh",
8145
+ "org:before-refresh:refresh:hardis",
8146
+ "hardis:before-refresh:org:refresh",
8147
+ "before-refresh:hardis:org:refresh",
8148
+ "before-refresh:org:hardis:refresh",
8149
+ "before-refresh:org:refresh:hardis",
8150
+ "hardis:before-refresh:refresh:org",
8151
+ "before-refresh:hardis:refresh:org",
8152
+ "before-refresh:refresh:hardis:org",
8153
+ "before-refresh:refresh:org:hardis"
8072
8154
  ]
8073
8155
  },
8074
- "hardis:org:purge:flow": {
8156
+ "hardis:org:retrieve:packageconfig": {
8075
8157
  "aliases": [],
8076
8158
  "args": {},
8077
- "description": "\n**Purges old or unwanted Flow versions from a Salesforce org, with an option to delete related Flow Interviews.**\n\nThis command helps maintain a clean and performant Salesforce org by removing obsolete Flow versions. Over time, multiple versions of Flows can accumulate, consuming storage and potentially impacting performance. This tool provides a controlled way to clean up these versions.\n\nKey functionalities:\n\n- **Targeted Flow Selection:** Allows you to filter Flow versions to delete by name (`--name`) and status (`--status`, e.g., `Obsolete`, `Draft`, `Inactive`).\n- **Flow Interview Deletion:** If a Flow version cannot be deleted due to active Flow Interviews, the `--delete-flow-interviews` flag (or interactive prompt) allows you to delete these interviews first, then retry the Flow version deletion.\n- **Confirmation Prompt:** In interactive mode, it prompts for confirmation before proceeding with the deletion of Flow versions and Flow Interviews.\n- **Partial Success Handling:** The `--allowpurgefailure` flag (default `true`) allows the command to continue even if some deletions fail, reporting the errors.\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 `Flow` object (using the Tooling API) to list Flow versions based on the provided filters (name, status, manageable state).\n- **Bulk Deletion (Tooling API):** It uses `bulkDeleteTooling` to perform mass deletions of Flow versions. If deletion fails due to active interviews, it extracts the interview IDs.\n- **Flow Interview Management:** If `delete-flow-interviews` is enabled, it queries `FlowInterview` objects, performs bulk deletion of the identified interviews using `bulkDelete`, and then retries the Flow version deletion.\n- **Interactive Prompts:** Uses the `prompts` library to interact with the user for selecting Flows, statuses, and confirming deletion actions.\n- **Error Reporting:** Logs detailed error messages for failed deletions, including the specific reasons.\n- **Command-Line Execution:** Uses `execSfdxJson` to execute Salesforce CLI commands for querying Flow data.\n</details>\n",
8159
+ "description": "\n**Retrieves the installed package configuration from a Salesforce org and optionally updates the local project configuration.**\n\nThis command is useful for maintaining an accurate record of installed packages within your Salesforce project, which is crucial for managing dependencies and ensuring consistent deployments across environments.\n\nKey functionalities:\n\n- **Package Listing:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a list of all installed packages.\n- **Configuration Update:** Offers the option to update your local project's configuration with the retrieved list of installed packages. This can be beneficial for automating package installations during environment setup or CI/CD processes.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Org Connection:** It establishes a connection to the target Salesforce org using the provided or prompted username.\n- **Metadata Retrieval:** It utilizes `MetadataUtils.listInstalledPackages` to query the Salesforce org and obtain details about the installed packages.\n- **Interactive Prompt:** It uses the `prompts` library to ask the user whether they want to update their local project configuration with the retrieved package list.\n- **Configuration Management:** If the user confirms, it calls `managePackageConfig` to update the project's configuration file (likely `.sfdx-hardis.yml`) with the new package information.\n- **User Feedback:** Provides clear messages to the user about the success of the package retrieval and configuration update.\n</details>\n",
8078
8160
  "examples": [
8079
- "$ sf hardis:org:purge:flow",
8080
- "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --no-prompt --delete-flow-interviews",
8081
- "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --status \"Obsolete,Draft,InvalidDraft\" --name TestFlow"
8161
+ "$ sf hardis:org:retrieve:packageconfig",
8162
+ "sf hardis:org:retrieve:packageconfig -u myOrg"
8082
8163
  ],
8083
8164
  "flags": {
8084
8165
  "json": {
@@ -8096,52 +8177,6 @@
8096
8177
  "multiple": false,
8097
8178
  "type": "option"
8098
8179
  },
8099
- "prompt": {
8100
- "char": "z",
8101
- "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
8102
- "name": "prompt",
8103
- "allowNo": true,
8104
- "type": "boolean"
8105
- },
8106
- "name": {
8107
- "char": "n",
8108
- "description": "Filter according to Name criteria",
8109
- "name": "name",
8110
- "hasDynamicHelp": false,
8111
- "multiple": false,
8112
- "type": "option"
8113
- },
8114
- "status": {
8115
- "char": "s",
8116
- "description": "Filter according to Status criteria",
8117
- "name": "status",
8118
- "hasDynamicHelp": false,
8119
- "multiple": false,
8120
- "type": "option"
8121
- },
8122
- "delete-flow-interviews": {
8123
- "char": "w",
8124
- "description": "If the presence of Flow interviews prevent to delete flows versions, delete them before retrying to delete flow versions",
8125
- "name": "delete-flow-interviews",
8126
- "allowNo": false,
8127
- "type": "boolean"
8128
- },
8129
- "allowpurgefailure": {
8130
- "char": "f",
8131
- "description": "Allows purges to fail without exiting with 1. Use --no-allowpurgefailure to disable",
8132
- "name": "allowpurgefailure",
8133
- "allowNo": true,
8134
- "type": "boolean"
8135
- },
8136
- "instanceurl": {
8137
- "char": "r",
8138
- "description": "URL of org instance",
8139
- "name": "instanceurl",
8140
- "default": "https://login.salesforce.com",
8141
- "hasDynamicHelp": false,
8142
- "multiple": false,
8143
- "type": "option"
8144
- },
8145
8180
  "debug": {
8146
8181
  "char": "d",
8147
8182
  "description": "Activate debug mode (more logs)",
@@ -8180,13 +8215,13 @@
8180
8215
  },
8181
8216
  "hasDynamicHelp": true,
8182
8217
  "hiddenAliases": [],
8183
- "id": "hardis:org:purge:flow",
8218
+ "id": "hardis:org:retrieve:packageconfig",
8184
8219
  "pluginAlias": "sfdx-hardis",
8185
8220
  "pluginName": "sfdx-hardis",
8186
8221
  "pluginType": "core",
8187
8222
  "strict": true,
8188
8223
  "enableJsonFlag": true,
8189
- "title": "Purge Flow versions",
8224
+ "title": "Retrieve package configuration from an org",
8190
8225
  "requiresProject": false,
8191
8226
  "isESM": true,
8192
8227
  "relativePath": [
@@ -8194,35 +8229,35 @@
8194
8229
  "commands",
8195
8230
  "hardis",
8196
8231
  "org",
8197
- "purge",
8198
- "flow.js"
8232
+ "retrieve",
8233
+ "packageconfig.js"
8199
8234
  ],
8200
8235
  "aliasPermutations": [],
8201
8236
  "permutations": [
8202
- "hardis:org:purge:flow",
8203
- "org:hardis:purge:flow",
8204
- "org:purge:hardis:flow",
8205
- "org:purge:flow:hardis",
8206
- "hardis:purge:org:flow",
8207
- "purge:hardis:org:flow",
8208
- "purge:org:hardis:flow",
8209
- "purge:org:flow:hardis",
8210
- "hardis:purge:flow:org",
8211
- "purge:hardis:flow:org",
8212
- "purge:flow:hardis:org",
8213
- "purge:flow:org:hardis",
8214
- "hardis:org:flow:purge",
8215
- "org:hardis:flow:purge",
8216
- "org:flow:hardis:purge",
8217
- "org:flow:purge:hardis",
8218
- "hardis:flow:org:purge",
8219
- "flow:hardis:org:purge",
8220
- "flow:org:hardis:purge",
8221
- "flow:org:purge:hardis",
8222
- "hardis:flow:purge:org",
8223
- "flow:hardis:purge:org",
8224
- "flow:purge:hardis:org",
8225
- "flow:purge:org:hardis"
8237
+ "hardis:org:retrieve:packageconfig",
8238
+ "org:hardis:retrieve:packageconfig",
8239
+ "org:retrieve:hardis:packageconfig",
8240
+ "org:retrieve:packageconfig:hardis",
8241
+ "hardis:retrieve:org:packageconfig",
8242
+ "retrieve:hardis:org:packageconfig",
8243
+ "retrieve:org:hardis:packageconfig",
8244
+ "retrieve:org:packageconfig:hardis",
8245
+ "hardis:retrieve:packageconfig:org",
8246
+ "retrieve:hardis:packageconfig:org",
8247
+ "retrieve:packageconfig:hardis:org",
8248
+ "retrieve:packageconfig:org:hardis",
8249
+ "hardis:org:packageconfig:retrieve",
8250
+ "org:hardis:packageconfig:retrieve",
8251
+ "org:packageconfig:hardis:retrieve",
8252
+ "org:packageconfig:retrieve:hardis",
8253
+ "hardis:packageconfig:org:retrieve",
8254
+ "packageconfig:hardis:org:retrieve",
8255
+ "packageconfig:org:hardis:retrieve",
8256
+ "packageconfig:org:retrieve:hardis",
8257
+ "hardis:packageconfig:retrieve:org",
8258
+ "packageconfig:hardis:retrieve:org",
8259
+ "packageconfig:retrieve:hardis:org",
8260
+ "packageconfig:retrieve:org:hardis"
8226
8261
  ]
8227
8262
  },
8228
8263
  "hardis:org:test:apex": {
@@ -9465,51 +9500,180 @@
9465
9500
  "type": "boolean"
9466
9501
  }
9467
9502
  },
9468
- "hasDynamicHelp": false,
9503
+ "hasDynamicHelp": false,
9504
+ "hiddenAliases": [],
9505
+ "id": "hardis:project:audit:remotesites",
9506
+ "pluginAlias": "sfdx-hardis",
9507
+ "pluginName": "sfdx-hardis",
9508
+ "pluginType": "core",
9509
+ "strict": true,
9510
+ "enableJsonFlag": true,
9511
+ "title": "Audit Remote Sites",
9512
+ "requiresProject": true,
9513
+ "isESM": true,
9514
+ "relativePath": [
9515
+ "lib",
9516
+ "commands",
9517
+ "hardis",
9518
+ "project",
9519
+ "audit",
9520
+ "remotesites.js"
9521
+ ],
9522
+ "aliasPermutations": [],
9523
+ "permutations": [
9524
+ "hardis:project:audit:remotesites",
9525
+ "project:hardis:audit:remotesites",
9526
+ "project:audit:hardis:remotesites",
9527
+ "project:audit:remotesites:hardis",
9528
+ "hardis:audit:project:remotesites",
9529
+ "audit:hardis:project:remotesites",
9530
+ "audit:project:hardis:remotesites",
9531
+ "audit:project:remotesites:hardis",
9532
+ "hardis:audit:remotesites:project",
9533
+ "audit:hardis:remotesites:project",
9534
+ "audit:remotesites:hardis:project",
9535
+ "audit:remotesites:project:hardis",
9536
+ "hardis:project:remotesites:audit",
9537
+ "project:hardis:remotesites:audit",
9538
+ "project:remotesites:hardis:audit",
9539
+ "project:remotesites:audit:hardis",
9540
+ "hardis:remotesites:project:audit",
9541
+ "remotesites:hardis:project:audit",
9542
+ "remotesites:project:hardis:audit",
9543
+ "remotesites:project:audit:hardis",
9544
+ "hardis:remotesites:audit:project",
9545
+ "remotesites:hardis:audit:project",
9546
+ "remotesites:audit:hardis:project",
9547
+ "remotesites:audit:project:hardis"
9548
+ ]
9549
+ },
9550
+ "hardis:project:configure:auth": {
9551
+ "aliases": [],
9552
+ "args": {},
9553
+ "description": "\n## Command Behavior\n\n**Configures authentication between a Git branch and a target Salesforce org for CI/CD deployments.**\n\nThis command facilitates the setup of automated CI/CD pipelines, enabling seamless deployments from specific Git branches to designated Salesforce orgs. It supports both standard Salesforce orgs and Dev Hub configurations, catering to various enterprise deployment workflows.\n\nKey functionalities include:\n\n- **Org Selection/Login:** Guides the user to select an existing Salesforce org or log in to a new one.\n- **Git Branch Association:** Allows associating a specific Git branch with the chosen Salesforce org.\n- **Merge Target Definition:** Enables defining target Git branches into which the configured branch can merge, ensuring controlled deployment flows.\n- **Salesforce Username Configuration:** Prompts for the Salesforce username to be used by the CI server for deployments.\n- **SSL Certificate Generation:** Automatically generates an SSL certificate for secure authentication.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's implementation involves several key technical aspects:\n\n- **SF CLI Integration:** Utilizes \n@salesforce/sf-plugins-core\n for command structure and flag parsing.\n- **Interactive Prompts:** Employs the \nprompts\n library for interactive user input, guiding the configuration process.\n- **Git Integration:** Interacts with Git to retrieve branch information using \n`git().branch([\"--list\", \"-r\"])`\n.\n- **Configuration Management:** Leverages internal utilities (`checkConfig`, `getConfig`, `setConfig`, `setInConfigFile`) to read from and write to project-specific configuration files (e.g., `.sfdx-hardis.<branchName>.yml`).\n- **Salesforce CLI Execution:** Executes Salesforce CLI commands programmatically via `execSfdxJson` for org interactions.\n- **SSL Certificate Generation:** Calls `generateSSLCertificate` to create necessary SSL certificates for JWT-based authentication.\n- **WebSocket Communication:** Uses `WebSocketClient` for potential communication with external tools or processes, such as restarting the command in VS Code.\n- **Dependency Check:** Ensures the presence of `openssl` on the system, which is required for SSL certificate generation.\n",
9554
+ "examples": [
9555
+ "$ sf hardis:project:configure:auth"
9556
+ ],
9557
+ "flags": {
9558
+ "json": {
9559
+ "description": "Format output as json.",
9560
+ "helpGroup": "GLOBAL",
9561
+ "name": "json",
9562
+ "allowNo": false,
9563
+ "type": "boolean"
9564
+ },
9565
+ "flags-dir": {
9566
+ "helpGroup": "GLOBAL",
9567
+ "name": "flags-dir",
9568
+ "summary": "Import flag values from a directory.",
9569
+ "hasDynamicHelp": false,
9570
+ "multiple": false,
9571
+ "type": "option"
9572
+ },
9573
+ "devhub": {
9574
+ "char": "b",
9575
+ "description": "Configure project DevHub",
9576
+ "name": "devhub",
9577
+ "allowNo": false,
9578
+ "type": "boolean"
9579
+ },
9580
+ "debug": {
9581
+ "char": "d",
9582
+ "description": "Activate debug mode (more logs)",
9583
+ "name": "debug",
9584
+ "allowNo": false,
9585
+ "type": "boolean"
9586
+ },
9587
+ "websocket": {
9588
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9589
+ "name": "websocket",
9590
+ "hasDynamicHelp": false,
9591
+ "multiple": false,
9592
+ "type": "option"
9593
+ },
9594
+ "skipauth": {
9595
+ "description": "Skip authentication check when a default username is required",
9596
+ "name": "skipauth",
9597
+ "allowNo": false,
9598
+ "type": "boolean"
9599
+ },
9600
+ "target-org": {
9601
+ "aliases": [
9602
+ "targetusername",
9603
+ "u"
9604
+ ],
9605
+ "char": "o",
9606
+ "deprecateAliases": true,
9607
+ "name": "target-org",
9608
+ "noCacheDefault": true,
9609
+ "summary": "Username or alias of the target org.",
9610
+ "hasDynamicHelp": true,
9611
+ "multiple": false,
9612
+ "type": "option"
9613
+ },
9614
+ "target-dev-hub": {
9615
+ "aliases": [
9616
+ "targetdevhubusername"
9617
+ ],
9618
+ "char": "v",
9619
+ "deprecateAliases": true,
9620
+ "name": "target-dev-hub",
9621
+ "noCacheDefault": true,
9622
+ "required": false,
9623
+ "summary": "Username or alias of the Dev Hub org.",
9624
+ "hasDynamicHelp": true,
9625
+ "multiple": false,
9626
+ "type": "option"
9627
+ }
9628
+ },
9629
+ "hasDynamicHelp": true,
9469
9630
  "hiddenAliases": [],
9470
- "id": "hardis:project:audit:remotesites",
9631
+ "id": "hardis:project:configure:auth",
9471
9632
  "pluginAlias": "sfdx-hardis",
9472
9633
  "pluginName": "sfdx-hardis",
9473
9634
  "pluginType": "core",
9474
9635
  "strict": true,
9475
9636
  "enableJsonFlag": true,
9476
- "title": "Audit Remote Sites",
9477
- "requiresProject": true,
9637
+ "title": "Configure authentication",
9638
+ "requiresProject": false,
9639
+ "requiresDependencies": [
9640
+ "openssl"
9641
+ ],
9478
9642
  "isESM": true,
9479
9643
  "relativePath": [
9480
9644
  "lib",
9481
9645
  "commands",
9482
9646
  "hardis",
9483
9647
  "project",
9484
- "audit",
9485
- "remotesites.js"
9648
+ "configure",
9649
+ "auth.js"
9486
9650
  ],
9487
9651
  "aliasPermutations": [],
9488
9652
  "permutations": [
9489
- "hardis:project:audit:remotesites",
9490
- "project:hardis:audit:remotesites",
9491
- "project:audit:hardis:remotesites",
9492
- "project:audit:remotesites:hardis",
9493
- "hardis:audit:project:remotesites",
9494
- "audit:hardis:project:remotesites",
9495
- "audit:project:hardis:remotesites",
9496
- "audit:project:remotesites:hardis",
9497
- "hardis:audit:remotesites:project",
9498
- "audit:hardis:remotesites:project",
9499
- "audit:remotesites:hardis:project",
9500
- "audit:remotesites:project:hardis",
9501
- "hardis:project:remotesites:audit",
9502
- "project:hardis:remotesites:audit",
9503
- "project:remotesites:hardis:audit",
9504
- "project:remotesites:audit:hardis",
9505
- "hardis:remotesites:project:audit",
9506
- "remotesites:hardis:project:audit",
9507
- "remotesites:project:hardis:audit",
9508
- "remotesites:project:audit:hardis",
9509
- "hardis:remotesites:audit:project",
9510
- "remotesites:hardis:audit:project",
9511
- "remotesites:audit:hardis:project",
9512
- "remotesites:audit:project:hardis"
9653
+ "hardis:project:configure:auth",
9654
+ "project:hardis:configure:auth",
9655
+ "project:configure:hardis:auth",
9656
+ "project:configure:auth:hardis",
9657
+ "hardis:configure:project:auth",
9658
+ "configure:hardis:project:auth",
9659
+ "configure:project:hardis:auth",
9660
+ "configure:project:auth:hardis",
9661
+ "hardis:configure:auth:project",
9662
+ "configure:hardis:auth:project",
9663
+ "configure:auth:hardis:project",
9664
+ "configure:auth:project:hardis",
9665
+ "hardis:project:auth:configure",
9666
+ "project:hardis:auth:configure",
9667
+ "project:auth:hardis:configure",
9668
+ "project:auth:configure:hardis",
9669
+ "hardis:auth:project:configure",
9670
+ "auth:hardis:project:configure",
9671
+ "auth:project:hardis:configure",
9672
+ "auth:project:configure:hardis",
9673
+ "hardis:auth:configure:project",
9674
+ "auth:hardis:configure:project",
9675
+ "auth:configure:hardis:project",
9676
+ "auth:configure:project:hardis"
9513
9677
  ]
9514
9678
  },
9515
9679
  "hardis:project:clean:emptyitems": {
@@ -11100,12 +11264,12 @@
11100
11264
  "profilestopermsets:convert:project:hardis"
11101
11265
  ]
11102
11266
  },
11103
- "hardis:project:configure:auth": {
11267
+ "hardis:project:fix:profiletabs": {
11104
11268
  "aliases": [],
11105
11269
  "args": {},
11106
- "description": "\n## Command Behavior\n\n**Configures authentication between a Git branch and a target Salesforce org for CI/CD deployments.**\n\nThis command facilitates the setup of automated CI/CD pipelines, enabling seamless deployments from specific Git branches to designated Salesforce orgs. It supports both standard Salesforce orgs and Dev Hub configurations, catering to various enterprise deployment workflows.\n\nKey functionalities include:\n\n- **Org Selection/Login:** Guides the user to select an existing Salesforce org or log in to a new one.\n- **Git Branch Association:** Allows associating a specific Git branch with the chosen Salesforce org.\n- **Merge Target Definition:** Enables defining target Git branches into which the configured branch can merge, ensuring controlled deployment flows.\n- **Salesforce Username Configuration:** Prompts for the Salesforce username to be used by the CI server for deployments.\n- **SSL Certificate Generation:** Automatically generates an SSL certificate for secure authentication.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's implementation involves several key technical aspects:\n\n- **SF CLI Integration:** Utilizes \n@salesforce/sf-plugins-core\n for command structure and flag parsing.\n- **Interactive Prompts:** Employs the \nprompts\n library for interactive user input, guiding the configuration process.\n- **Git Integration:** Interacts with Git to retrieve branch information using \n`git().branch([\"--list\", \"-r\"])`\n.\n- **Configuration Management:** Leverages internal utilities (`checkConfig`, `getConfig`, `setConfig`, `setInConfigFile`) to read from and write to project-specific configuration files (e.g., `.sfdx-hardis.<branchName>.yml`).\n- **Salesforce CLI Execution:** Executes Salesforce CLI commands programmatically via `execSfdxJson` for org interactions.\n- **SSL Certificate Generation:** Calls `generateSSLCertificate` to create necessary SSL certificates for JWT-based authentication.\n- **WebSocket Communication:** Uses `WebSocketClient` for potential communication with external tools or processes, such as restarting the command in VS Code.\n- **Dependency Check:** Ensures the presence of `openssl` on the system, which is required for SSL certificate generation.\n",
11270
+ "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",
11107
11271
  "examples": [
11108
- "$ sf hardis:project:configure:auth"
11272
+ "$ sf hardis:project:fix:profiletabs"
11109
11273
  ],
11110
11274
  "flags": {
11111
11275
  "json": {
@@ -11123,12 +11287,14 @@
11123
11287
  "multiple": false,
11124
11288
  "type": "option"
11125
11289
  },
11126
- "devhub": {
11127
- "char": "b",
11128
- "description": "Configure project DevHub",
11129
- "name": "devhub",
11130
- "allowNo": false,
11131
- "type": "boolean"
11290
+ "path": {
11291
+ "char": "p",
11292
+ "description": "Root folder",
11293
+ "name": "path",
11294
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
11295
+ "hasDynamicHelp": false,
11296
+ "multiple": false,
11297
+ "type": "option"
11132
11298
  },
11133
11299
  "debug": {
11134
11300
  "char": "d",
@@ -11159,21 +11325,8 @@
11159
11325
  "deprecateAliases": true,
11160
11326
  "name": "target-org",
11161
11327
  "noCacheDefault": true,
11162
- "summary": "Username or alias of the target org.",
11163
- "hasDynamicHelp": true,
11164
- "multiple": false,
11165
- "type": "option"
11166
- },
11167
- "target-dev-hub": {
11168
- "aliases": [
11169
- "targetdevhubusername"
11170
- ],
11171
- "char": "v",
11172
- "deprecateAliases": true,
11173
- "name": "target-dev-hub",
11174
- "noCacheDefault": true,
11175
- "required": false,
11176
- "summary": "Username or alias of the Dev Hub org.",
11328
+ "required": true,
11329
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
11177
11330
  "hasDynamicHelp": true,
11178
11331
  "multiple": false,
11179
11332
  "type": "option"
@@ -11181,52 +11334,149 @@
11181
11334
  },
11182
11335
  "hasDynamicHelp": true,
11183
11336
  "hiddenAliases": [],
11184
- "id": "hardis:project:configure:auth",
11337
+ "id": "hardis:project:fix:profiletabs",
11185
11338
  "pluginAlias": "sfdx-hardis",
11186
11339
  "pluginName": "sfdx-hardis",
11187
11340
  "pluginType": "core",
11188
11341
  "strict": true,
11189
11342
  "enableJsonFlag": true,
11190
- "title": "Configure authentication",
11191
- "requiresProject": false,
11192
- "requiresDependencies": [
11193
- "openssl"
11194
- ],
11343
+ "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
11344
+ "requiresProject": true,
11195
11345
  "isESM": true,
11196
11346
  "relativePath": [
11197
11347
  "lib",
11198
11348
  "commands",
11199
11349
  "hardis",
11200
11350
  "project",
11201
- "configure",
11202
- "auth.js"
11351
+ "fix",
11352
+ "profiletabs.js"
11203
11353
  ],
11204
11354
  "aliasPermutations": [],
11205
11355
  "permutations": [
11206
- "hardis:project:configure:auth",
11207
- "project:hardis:configure:auth",
11208
- "project:configure:hardis:auth",
11209
- "project:configure:auth:hardis",
11210
- "hardis:configure:project:auth",
11211
- "configure:hardis:project:auth",
11212
- "configure:project:hardis:auth",
11213
- "configure:project:auth:hardis",
11214
- "hardis:configure:auth:project",
11215
- "configure:hardis:auth:project",
11216
- "configure:auth:hardis:project",
11217
- "configure:auth:project:hardis",
11218
- "hardis:project:auth:configure",
11219
- "project:hardis:auth:configure",
11220
- "project:auth:hardis:configure",
11221
- "project:auth:configure:hardis",
11222
- "hardis:auth:project:configure",
11223
- "auth:hardis:project:configure",
11224
- "auth:project:hardis:configure",
11225
- "auth:project:configure:hardis",
11226
- "hardis:auth:configure:project",
11227
- "auth:hardis:configure:project",
11228
- "auth:configure:hardis:project",
11229
- "auth:configure:project:hardis"
11356
+ "hardis:project:fix:profiletabs",
11357
+ "project:hardis:fix:profiletabs",
11358
+ "project:fix:hardis:profiletabs",
11359
+ "project:fix:profiletabs:hardis",
11360
+ "hardis:fix:project:profiletabs",
11361
+ "fix:hardis:project:profiletabs",
11362
+ "fix:project:hardis:profiletabs",
11363
+ "fix:project:profiletabs:hardis",
11364
+ "hardis:fix:profiletabs:project",
11365
+ "fix:hardis:profiletabs:project",
11366
+ "fix:profiletabs:hardis:project",
11367
+ "fix:profiletabs:project:hardis",
11368
+ "hardis:project:profiletabs:fix",
11369
+ "project:hardis:profiletabs:fix",
11370
+ "project:profiletabs:hardis:fix",
11371
+ "project:profiletabs:fix:hardis",
11372
+ "hardis:profiletabs:project:fix",
11373
+ "profiletabs:hardis:project:fix",
11374
+ "profiletabs:project:hardis:fix",
11375
+ "profiletabs:project:fix:hardis",
11376
+ "hardis:profiletabs:fix:project",
11377
+ "profiletabs:hardis:fix:project",
11378
+ "profiletabs:fix:hardis:project",
11379
+ "profiletabs:fix:project:hardis"
11380
+ ]
11381
+ },
11382
+ "hardis:project:fix:v53flexipages": {
11383
+ "aliases": [],
11384
+ "args": {},
11385
+ "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",
11386
+ "examples": [
11387
+ "$ sf hardis:project:fix:v53flexipages"
11388
+ ],
11389
+ "flags": {
11390
+ "json": {
11391
+ "description": "Format output as json.",
11392
+ "helpGroup": "GLOBAL",
11393
+ "name": "json",
11394
+ "allowNo": false,
11395
+ "type": "boolean"
11396
+ },
11397
+ "flags-dir": {
11398
+ "helpGroup": "GLOBAL",
11399
+ "name": "flags-dir",
11400
+ "summary": "Import flag values from a directory.",
11401
+ "hasDynamicHelp": false,
11402
+ "multiple": false,
11403
+ "type": "option"
11404
+ },
11405
+ "path": {
11406
+ "char": "p",
11407
+ "description": "Root folder",
11408
+ "name": "path",
11409
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
11410
+ "hasDynamicHelp": false,
11411
+ "multiple": false,
11412
+ "type": "option"
11413
+ },
11414
+ "debug": {
11415
+ "char": "d",
11416
+ "description": "Activate debug mode (more logs)",
11417
+ "name": "debug",
11418
+ "allowNo": false,
11419
+ "type": "boolean"
11420
+ },
11421
+ "websocket": {
11422
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11423
+ "name": "websocket",
11424
+ "hasDynamicHelp": false,
11425
+ "multiple": false,
11426
+ "type": "option"
11427
+ },
11428
+ "skipauth": {
11429
+ "description": "Skip authentication check when a default username is required",
11430
+ "name": "skipauth",
11431
+ "allowNo": false,
11432
+ "type": "boolean"
11433
+ }
11434
+ },
11435
+ "hasDynamicHelp": false,
11436
+ "hiddenAliases": [],
11437
+ "id": "hardis:project:fix:v53flexipages",
11438
+ "pluginAlias": "sfdx-hardis",
11439
+ "pluginName": "sfdx-hardis",
11440
+ "pluginType": "core",
11441
+ "strict": true,
11442
+ "enableJsonFlag": true,
11443
+ "title": "Fix flexipages for v53",
11444
+ "requiresProject": true,
11445
+ "isESM": true,
11446
+ "relativePath": [
11447
+ "lib",
11448
+ "commands",
11449
+ "hardis",
11450
+ "project",
11451
+ "fix",
11452
+ "v53flexipages.js"
11453
+ ],
11454
+ "aliasPermutations": [],
11455
+ "permutations": [
11456
+ "hardis:project:fix:v53flexipages",
11457
+ "project:hardis:fix:v53flexipages",
11458
+ "project:fix:hardis:v53flexipages",
11459
+ "project:fix:v53flexipages:hardis",
11460
+ "hardis:fix:project:v53flexipages",
11461
+ "fix:hardis:project:v53flexipages",
11462
+ "fix:project:hardis:v53flexipages",
11463
+ "fix:project:v53flexipages:hardis",
11464
+ "hardis:fix:v53flexipages:project",
11465
+ "fix:hardis:v53flexipages:project",
11466
+ "fix:v53flexipages:hardis:project",
11467
+ "fix:v53flexipages:project:hardis",
11468
+ "hardis:project:v53flexipages:fix",
11469
+ "project:hardis:v53flexipages:fix",
11470
+ "project:v53flexipages:hardis:fix",
11471
+ "project:v53flexipages:fix:hardis",
11472
+ "hardis:v53flexipages:project:fix",
11473
+ "v53flexipages:hardis:project:fix",
11474
+ "v53flexipages:project:hardis:fix",
11475
+ "v53flexipages:project:fix:hardis",
11476
+ "hardis:v53flexipages:fix:project",
11477
+ "v53flexipages:hardis:fix:project",
11478
+ "v53flexipages:fix:hardis:project",
11479
+ "v53flexipages:fix:project:hardis"
11230
11480
  ]
11231
11481
  },
11232
11482
  "hardis:project:deploy:notify": {
@@ -12404,221 +12654,6 @@
12404
12654
  "validate:deploy:project:hardis"
12405
12655
  ]
12406
12656
  },
12407
- "hardis:project:fix:profiletabs": {
12408
- "aliases": [],
12409
- "args": {},
12410
- "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",
12411
- "examples": [
12412
- "$ sf hardis:project:fix:profiletabs"
12413
- ],
12414
- "flags": {
12415
- "json": {
12416
- "description": "Format output as json.",
12417
- "helpGroup": "GLOBAL",
12418
- "name": "json",
12419
- "allowNo": false,
12420
- "type": "boolean"
12421
- },
12422
- "flags-dir": {
12423
- "helpGroup": "GLOBAL",
12424
- "name": "flags-dir",
12425
- "summary": "Import flag values from a directory.",
12426
- "hasDynamicHelp": false,
12427
- "multiple": false,
12428
- "type": "option"
12429
- },
12430
- "path": {
12431
- "char": "p",
12432
- "description": "Root folder",
12433
- "name": "path",
12434
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12435
- "hasDynamicHelp": false,
12436
- "multiple": false,
12437
- "type": "option"
12438
- },
12439
- "debug": {
12440
- "char": "d",
12441
- "description": "Activate debug mode (more logs)",
12442
- "name": "debug",
12443
- "allowNo": false,
12444
- "type": "boolean"
12445
- },
12446
- "websocket": {
12447
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12448
- "name": "websocket",
12449
- "hasDynamicHelp": false,
12450
- "multiple": false,
12451
- "type": "option"
12452
- },
12453
- "skipauth": {
12454
- "description": "Skip authentication check when a default username is required",
12455
- "name": "skipauth",
12456
- "allowNo": false,
12457
- "type": "boolean"
12458
- },
12459
- "target-org": {
12460
- "aliases": [
12461
- "targetusername",
12462
- "u"
12463
- ],
12464
- "char": "o",
12465
- "deprecateAliases": true,
12466
- "name": "target-org",
12467
- "noCacheDefault": true,
12468
- "required": true,
12469
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12470
- "hasDynamicHelp": true,
12471
- "multiple": false,
12472
- "type": "option"
12473
- }
12474
- },
12475
- "hasDynamicHelp": true,
12476
- "hiddenAliases": [],
12477
- "id": "hardis:project:fix:profiletabs",
12478
- "pluginAlias": "sfdx-hardis",
12479
- "pluginName": "sfdx-hardis",
12480
- "pluginType": "core",
12481
- "strict": true,
12482
- "enableJsonFlag": true,
12483
- "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
12484
- "requiresProject": true,
12485
- "isESM": true,
12486
- "relativePath": [
12487
- "lib",
12488
- "commands",
12489
- "hardis",
12490
- "project",
12491
- "fix",
12492
- "profiletabs.js"
12493
- ],
12494
- "aliasPermutations": [],
12495
- "permutations": [
12496
- "hardis:project:fix:profiletabs",
12497
- "project:hardis:fix:profiletabs",
12498
- "project:fix:hardis:profiletabs",
12499
- "project:fix:profiletabs:hardis",
12500
- "hardis:fix:project:profiletabs",
12501
- "fix:hardis:project:profiletabs",
12502
- "fix:project:hardis:profiletabs",
12503
- "fix:project:profiletabs:hardis",
12504
- "hardis:fix:profiletabs:project",
12505
- "fix:hardis:profiletabs:project",
12506
- "fix:profiletabs:hardis:project",
12507
- "fix:profiletabs:project:hardis",
12508
- "hardis:project:profiletabs:fix",
12509
- "project:hardis:profiletabs:fix",
12510
- "project:profiletabs:hardis:fix",
12511
- "project:profiletabs:fix:hardis",
12512
- "hardis:profiletabs:project:fix",
12513
- "profiletabs:hardis:project:fix",
12514
- "profiletabs:project:hardis:fix",
12515
- "profiletabs:project:fix:hardis",
12516
- "hardis:profiletabs:fix:project",
12517
- "profiletabs:hardis:fix:project",
12518
- "profiletabs:fix:hardis:project",
12519
- "profiletabs:fix:project:hardis"
12520
- ]
12521
- },
12522
- "hardis:project:fix:v53flexipages": {
12523
- "aliases": [],
12524
- "args": {},
12525
- "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",
12526
- "examples": [
12527
- "$ sf hardis:project:fix:v53flexipages"
12528
- ],
12529
- "flags": {
12530
- "json": {
12531
- "description": "Format output as json.",
12532
- "helpGroup": "GLOBAL",
12533
- "name": "json",
12534
- "allowNo": false,
12535
- "type": "boolean"
12536
- },
12537
- "flags-dir": {
12538
- "helpGroup": "GLOBAL",
12539
- "name": "flags-dir",
12540
- "summary": "Import flag values from a directory.",
12541
- "hasDynamicHelp": false,
12542
- "multiple": false,
12543
- "type": "option"
12544
- },
12545
- "path": {
12546
- "char": "p",
12547
- "description": "Root folder",
12548
- "name": "path",
12549
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12550
- "hasDynamicHelp": false,
12551
- "multiple": false,
12552
- "type": "option"
12553
- },
12554
- "debug": {
12555
- "char": "d",
12556
- "description": "Activate debug mode (more logs)",
12557
- "name": "debug",
12558
- "allowNo": false,
12559
- "type": "boolean"
12560
- },
12561
- "websocket": {
12562
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12563
- "name": "websocket",
12564
- "hasDynamicHelp": false,
12565
- "multiple": false,
12566
- "type": "option"
12567
- },
12568
- "skipauth": {
12569
- "description": "Skip authentication check when a default username is required",
12570
- "name": "skipauth",
12571
- "allowNo": false,
12572
- "type": "boolean"
12573
- }
12574
- },
12575
- "hasDynamicHelp": false,
12576
- "hiddenAliases": [],
12577
- "id": "hardis:project:fix:v53flexipages",
12578
- "pluginAlias": "sfdx-hardis",
12579
- "pluginName": "sfdx-hardis",
12580
- "pluginType": "core",
12581
- "strict": true,
12582
- "enableJsonFlag": true,
12583
- "title": "Fix flexipages for v53",
12584
- "requiresProject": true,
12585
- "isESM": true,
12586
- "relativePath": [
12587
- "lib",
12588
- "commands",
12589
- "hardis",
12590
- "project",
12591
- "fix",
12592
- "v53flexipages.js"
12593
- ],
12594
- "aliasPermutations": [],
12595
- "permutations": [
12596
- "hardis:project:fix:v53flexipages",
12597
- "project:hardis:fix:v53flexipages",
12598
- "project:fix:hardis:v53flexipages",
12599
- "project:fix:v53flexipages:hardis",
12600
- "hardis:fix:project:v53flexipages",
12601
- "fix:hardis:project:v53flexipages",
12602
- "fix:project:hardis:v53flexipages",
12603
- "fix:project:v53flexipages:hardis",
12604
- "hardis:fix:v53flexipages:project",
12605
- "fix:hardis:v53flexipages:project",
12606
- "fix:v53flexipages:hardis:project",
12607
- "fix:v53flexipages:project:hardis",
12608
- "hardis:project:v53flexipages:fix",
12609
- "project:hardis:v53flexipages:fix",
12610
- "project:v53flexipages:hardis:fix",
12611
- "project:v53flexipages:fix:hardis",
12612
- "hardis:v53flexipages:project:fix",
12613
- "v53flexipages:hardis:project:fix",
12614
- "v53flexipages:project:hardis:fix",
12615
- "v53flexipages:project:fix:hardis",
12616
- "hardis:v53flexipages:fix:project",
12617
- "v53flexipages:hardis:fix:project",
12618
- "v53flexipages:fix:hardis:project",
12619
- "v53flexipages:fix:project:hardis"
12620
- ]
12621
- },
12622
12657
  "hardis:project:generate:bypass": {
12623
12658
  "aliases": [],
12624
12659
  "args": {},
@@ -15101,5 +15136,5 @@
15101
15136
  ]
15102
15137
  }
15103
15138
  },
15104
- "version": "6.1.4"
15139
+ "version": "6.1.5-beta202508282306.0"
15105
15140
  }