sfdx-hardis 6.0.7-beta202508231311.0 → 6.1.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.
@@ -57,12 +57,13 @@
57
57
  "world:hello"
58
58
  ]
59
59
  },
60
- "hardis:cache:clear": {
60
+ "hardis:auth:login": {
61
61
  "aliases": [],
62
62
  "args": {},
63
- "description": "\n## Command Behavior\n\n**Clears the local cache generated by the sfdx-hardis plugin.**\n\nThis command is designed to remove temporary files, stored configurations, and other cached data that sfdx-hardis uses to optimize its operations. Clearing the cache can be beneficial for:\n\n- **Troubleshooting:** Resolving unexpected behavior or inconsistencies.\n- **Disk Space Management:** Freeing up storage on your local machine.\n- **Ensuring Fresh Data:** Guaranteeing that the plugin operates with the most current data and configurations.\n\n## Technical explanations\n\nThe command's technical implementation is straightforward:\n\n- **Direct Function Call:** It directly invokes the `clearCache()` function, which is imported from \buri../../../common/cache/index.js\buri.\n- **Cache Management Logic:** The \buriclearCache()` function encapsulates the logic for identifying and removing the specific files and directories that constitute the sfdx-hardis cache.\n",
63
+ "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
64
64
  "examples": [
65
- "$ sf hardis:cache:clear"
65
+ "$ sf hardis:auth:login",
66
+ "CI=true sf hardis:auth:login"
66
67
  ],
67
68
  "flags": {
68
69
  "json": {
@@ -80,6 +81,28 @@
80
81
  "multiple": false,
81
82
  "type": "option"
82
83
  },
84
+ "instanceurl": {
85
+ "char": "r",
86
+ "description": "URL of org instance",
87
+ "name": "instanceurl",
88
+ "hasDynamicHelp": false,
89
+ "multiple": false,
90
+ "type": "option"
91
+ },
92
+ "devhub": {
93
+ "char": "h",
94
+ "description": "Also connect associated DevHub",
95
+ "name": "devhub",
96
+ "allowNo": false,
97
+ "type": "boolean"
98
+ },
99
+ "scratchorg": {
100
+ "char": "s",
101
+ "description": "Scratch org",
102
+ "name": "scratchorg",
103
+ "allowNo": false,
104
+ "type": "boolean"
105
+ },
83
106
  "debug": {
84
107
  "char": "d",
85
108
  "description": "Activate debug mode (more logs)",
@@ -103,42 +126,38 @@
103
126
  },
104
127
  "hasDynamicHelp": false,
105
128
  "hiddenAliases": [],
106
- "id": "hardis:cache:clear",
129
+ "id": "hardis:auth:login",
107
130
  "pluginAlias": "sfdx-hardis",
108
131
  "pluginName": "sfdx-hardis",
109
132
  "pluginType": "core",
110
133
  "strict": true,
111
134
  "enableJsonFlag": true,
112
- "title": "Clear sfdx-hardis cache",
113
- "uiConfig": {
114
- "hide": true
115
- },
135
+ "title": "Login",
116
136
  "requiresProject": false,
117
137
  "isESM": true,
118
138
  "relativePath": [
119
139
  "lib",
120
140
  "commands",
121
141
  "hardis",
122
- "cache",
123
- "clear.js"
142
+ "auth",
143
+ "login.js"
124
144
  ],
125
145
  "aliasPermutations": [],
126
146
  "permutations": [
127
- "hardis:cache:clear",
128
- "cache:hardis:clear",
129
- "cache:clear:hardis",
130
- "hardis:clear:cache",
131
- "clear:hardis:cache",
132
- "clear:cache:hardis"
147
+ "hardis:auth:login",
148
+ "auth:hardis:login",
149
+ "auth:login:hardis",
150
+ "hardis:login:auth",
151
+ "login:hardis:auth",
152
+ "login:auth:hardis"
133
153
  ]
134
154
  },
135
- "hardis:auth:login": {
155
+ "hardis:cache:clear": {
136
156
  "aliases": [],
137
157
  "args": {},
138
- "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
158
+ "description": "\n## Command Behavior\n\n**Clears the local cache generated by the sfdx-hardis plugin.**\n\nThis command is designed to remove temporary files, stored configurations, and other cached data that sfdx-hardis uses to optimize its operations. Clearing the cache can be beneficial for:\n\n- **Troubleshooting:** Resolving unexpected behavior or inconsistencies.\n- **Disk Space Management:** Freeing up storage on your local machine.\n- **Ensuring Fresh Data:** Guaranteeing that the plugin operates with the most current data and configurations.\n\n## Technical explanations\n\nThe command's technical implementation is straightforward:\n\n- **Direct Function Call:** It directly invokes the `clearCache()` function, which is imported from \buri../../../common/cache/index.js\buri.\n- **Cache Management Logic:** The \buriclearCache()` function encapsulates the logic for identifying and removing the specific files and directories that constitute the sfdx-hardis cache.\n",
139
159
  "examples": [
140
- "$ sf hardis:auth:login",
141
- "CI=true sf hardis:auth:login"
160
+ "$ sf hardis:cache:clear"
142
161
  ],
143
162
  "flags": {
144
163
  "json": {
@@ -156,28 +175,6 @@
156
175
  "multiple": false,
157
176
  "type": "option"
158
177
  },
159
- "instanceurl": {
160
- "char": "r",
161
- "description": "URL of org instance",
162
- "name": "instanceurl",
163
- "hasDynamicHelp": false,
164
- "multiple": false,
165
- "type": "option"
166
- },
167
- "devhub": {
168
- "char": "h",
169
- "description": "Also connect associated DevHub",
170
- "name": "devhub",
171
- "allowNo": false,
172
- "type": "boolean"
173
- },
174
- "scratchorg": {
175
- "char": "s",
176
- "description": "Scratch org",
177
- "name": "scratchorg",
178
- "allowNo": false,
179
- "type": "boolean"
180
- },
181
178
  "debug": {
182
179
  "char": "d",
183
180
  "description": "Activate debug mode (more logs)",
@@ -201,30 +198,33 @@
201
198
  },
202
199
  "hasDynamicHelp": false,
203
200
  "hiddenAliases": [],
204
- "id": "hardis:auth:login",
201
+ "id": "hardis:cache:clear",
205
202
  "pluginAlias": "sfdx-hardis",
206
203
  "pluginName": "sfdx-hardis",
207
204
  "pluginType": "core",
208
205
  "strict": true,
209
206
  "enableJsonFlag": true,
210
- "title": "Login",
207
+ "title": "Clear sfdx-hardis cache",
208
+ "uiConfig": {
209
+ "hide": true
210
+ },
211
211
  "requiresProject": false,
212
212
  "isESM": true,
213
213
  "relativePath": [
214
214
  "lib",
215
215
  "commands",
216
216
  "hardis",
217
- "auth",
218
- "login.js"
217
+ "cache",
218
+ "clear.js"
219
219
  ],
220
220
  "aliasPermutations": [],
221
221
  "permutations": [
222
- "hardis:auth:login",
223
- "auth:hardis:login",
224
- "auth:login:hardis",
225
- "hardis:login:auth",
226
- "login:hardis:auth",
227
- "login:auth:hardis"
222
+ "hardis:cache:clear",
223
+ "cache:hardis:clear",
224
+ "cache:clear:hardis",
225
+ "hardis:clear:cache",
226
+ "clear:hardis:cache",
227
+ "clear:cache:hardis"
228
228
  ]
229
229
  },
230
230
  "hardis:config:get": {
@@ -4407,135 +4407,6 @@
4407
4407
  "ws:work:hardis"
4408
4408
  ]
4409
4409
  },
4410
- "hardis:git:pull-requests:extract": {
4411
- "aliases": [],
4412
- "args": {},
4413
- "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",
4414
- "examples": [
4415
- "$ sf hardis:git:pull-requests:extract",
4416
- "$ sf hardis:git:pull-requests:extract --target-branch main --status merged"
4417
- ],
4418
- "flags": {
4419
- "json": {
4420
- "description": "Format output as json.",
4421
- "helpGroup": "GLOBAL",
4422
- "name": "json",
4423
- "allowNo": false,
4424
- "type": "boolean"
4425
- },
4426
- "flags-dir": {
4427
- "helpGroup": "GLOBAL",
4428
- "name": "flags-dir",
4429
- "summary": "Import flag values from a directory.",
4430
- "hasDynamicHelp": false,
4431
- "multiple": false,
4432
- "type": "option"
4433
- },
4434
- "target-branch": {
4435
- "char": "t",
4436
- "description": "Target branch of PRs",
4437
- "name": "target-branch",
4438
- "hasDynamicHelp": false,
4439
- "multiple": false,
4440
- "type": "option"
4441
- },
4442
- "status": {
4443
- "char": "x",
4444
- "description": "Status of the PR",
4445
- "name": "status",
4446
- "hasDynamicHelp": false,
4447
- "multiple": false,
4448
- "options": [
4449
- "open",
4450
- "merged",
4451
- "abandoned"
4452
- ],
4453
- "type": "option"
4454
- },
4455
- "min-date": {
4456
- "char": "m",
4457
- "description": "Minimum date for PR",
4458
- "name": "min-date",
4459
- "hasDynamicHelp": false,
4460
- "multiple": false,
4461
- "type": "option"
4462
- },
4463
- "outputfile": {
4464
- "char": "f",
4465
- "description": "Force the path and name of output report file. Must end with .csv",
4466
- "name": "outputfile",
4467
- "hasDynamicHelp": false,
4468
- "multiple": false,
4469
- "type": "option"
4470
- },
4471
- "debug": {
4472
- "char": "d",
4473
- "description": "Activate debug mode (more logs)",
4474
- "name": "debug",
4475
- "allowNo": false,
4476
- "type": "boolean"
4477
- },
4478
- "websocket": {
4479
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
4480
- "name": "websocket",
4481
- "hasDynamicHelp": false,
4482
- "multiple": false,
4483
- "type": "option"
4484
- },
4485
- "skipauth": {
4486
- "description": "Skip authentication check when a default username is required",
4487
- "name": "skipauth",
4488
- "allowNo": false,
4489
- "type": "boolean"
4490
- }
4491
- },
4492
- "hasDynamicHelp": false,
4493
- "hiddenAliases": [],
4494
- "id": "hardis:git:pull-requests:extract",
4495
- "pluginAlias": "sfdx-hardis",
4496
- "pluginName": "sfdx-hardis",
4497
- "pluginType": "core",
4498
- "strict": true,
4499
- "enableJsonFlag": true,
4500
- "title": "Extract pull requests",
4501
- "requiresProject": true,
4502
- "isESM": true,
4503
- "relativePath": [
4504
- "lib",
4505
- "commands",
4506
- "hardis",
4507
- "git",
4508
- "pull-requests",
4509
- "extract.js"
4510
- ],
4511
- "aliasPermutations": [],
4512
- "permutations": [
4513
- "hardis:git:pull-requests:extract",
4514
- "git:hardis:pull-requests:extract",
4515
- "git:pull-requests:hardis:extract",
4516
- "git:pull-requests:extract:hardis",
4517
- "hardis:pull-requests:git:extract",
4518
- "pull-requests:hardis:git:extract",
4519
- "pull-requests:git:hardis:extract",
4520
- "pull-requests:git:extract:hardis",
4521
- "hardis:pull-requests:extract:git",
4522
- "pull-requests:hardis:extract:git",
4523
- "pull-requests:extract:hardis:git",
4524
- "pull-requests:extract:git:hardis",
4525
- "hardis:git:extract:pull-requests",
4526
- "git:hardis:extract:pull-requests",
4527
- "git:extract:hardis:pull-requests",
4528
- "git:extract:pull-requests:hardis",
4529
- "hardis:extract:git:pull-requests",
4530
- "extract:hardis:git:pull-requests",
4531
- "extract:git:hardis:pull-requests",
4532
- "extract:git:pull-requests:hardis",
4533
- "hardis:extract:pull-requests:git",
4534
- "extract:hardis:pull-requests:git",
4535
- "extract:pull-requests:hardis:git",
4536
- "extract:pull-requests:git:hardis"
4537
- ]
4538
- },
4539
4410
  "hardis:doc:extract:permsetgroups": {
4540
4411
  "aliases": [],
4541
4412
  "args": {},
@@ -4726,13 +4597,13 @@
4726
4597
  "generate:plugin:doc:hardis"
4727
4598
  ]
4728
4599
  },
4729
- "hardis:org:community:update": {
4600
+ "hardis:git:pull-requests:extract": {
4730
4601
  "aliases": [],
4731
4602
  "args": {},
4732
- "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
+ "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",
4733
4604
  "examples": [
4734
- "$ sf hardis:org:community:update --name 'MyNetworkName' --status DownForMaintenance",
4735
- "$ sf hardis:org:community:update --name 'MyNetworkName,MySecondNetworkName' --status Live"
4605
+ "$ sf hardis:git:pull-requests:extract",
4606
+ "$ sf hardis:git:pull-requests:extract --target-branch main --status merged"
4736
4607
  ],
4737
4608
  "flags": {
4738
4609
  "json": {
@@ -4750,23 +4621,152 @@
4750
4621
  "multiple": false,
4751
4622
  "type": "option"
4752
4623
  },
4753
- "name": {
4754
- "char": "n",
4755
- "description": "List of Networks Names that you want to update, separated by comma",
4756
- "name": "name",
4757
- "required": true,
4624
+ "target-branch": {
4625
+ "char": "t",
4626
+ "description": "Target branch of PRs",
4627
+ "name": "target-branch",
4758
4628
  "hasDynamicHelp": false,
4759
4629
  "multiple": false,
4760
4630
  "type": "option"
4761
4631
  },
4762
4632
  "status": {
4763
- "char": "s",
4764
- "description": "New status for the community, available values are: Live, DownForMaintenance",
4633
+ "char": "x",
4634
+ "description": "Status of the PR",
4765
4635
  "name": "status",
4766
- "required": true,
4767
4636
  "hasDynamicHelp": false,
4768
4637
  "multiple": false,
4769
- "type": "option"
4638
+ "options": [
4639
+ "open",
4640
+ "merged",
4641
+ "abandoned"
4642
+ ],
4643
+ "type": "option"
4644
+ },
4645
+ "min-date": {
4646
+ "char": "m",
4647
+ "description": "Minimum date for PR",
4648
+ "name": "min-date",
4649
+ "hasDynamicHelp": false,
4650
+ "multiple": false,
4651
+ "type": "option"
4652
+ },
4653
+ "outputfile": {
4654
+ "char": "f",
4655
+ "description": "Force the path and name of output report file. Must end with .csv",
4656
+ "name": "outputfile",
4657
+ "hasDynamicHelp": false,
4658
+ "multiple": false,
4659
+ "type": "option"
4660
+ },
4661
+ "debug": {
4662
+ "char": "d",
4663
+ "description": "Activate debug mode (more logs)",
4664
+ "name": "debug",
4665
+ "allowNo": false,
4666
+ "type": "boolean"
4667
+ },
4668
+ "websocket": {
4669
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
4670
+ "name": "websocket",
4671
+ "hasDynamicHelp": false,
4672
+ "multiple": false,
4673
+ "type": "option"
4674
+ },
4675
+ "skipauth": {
4676
+ "description": "Skip authentication check when a default username is required",
4677
+ "name": "skipauth",
4678
+ "allowNo": false,
4679
+ "type": "boolean"
4680
+ }
4681
+ },
4682
+ "hasDynamicHelp": false,
4683
+ "hiddenAliases": [],
4684
+ "id": "hardis:git:pull-requests:extract",
4685
+ "pluginAlias": "sfdx-hardis",
4686
+ "pluginName": "sfdx-hardis",
4687
+ "pluginType": "core",
4688
+ "strict": true,
4689
+ "enableJsonFlag": true,
4690
+ "title": "Extract pull requests",
4691
+ "requiresProject": true,
4692
+ "isESM": true,
4693
+ "relativePath": [
4694
+ "lib",
4695
+ "commands",
4696
+ "hardis",
4697
+ "git",
4698
+ "pull-requests",
4699
+ "extract.js"
4700
+ ],
4701
+ "aliasPermutations": [],
4702
+ "permutations": [
4703
+ "hardis:git:pull-requests:extract",
4704
+ "git:hardis:pull-requests:extract",
4705
+ "git:pull-requests:hardis:extract",
4706
+ "git:pull-requests:extract:hardis",
4707
+ "hardis:pull-requests:git:extract",
4708
+ "pull-requests:hardis:git:extract",
4709
+ "pull-requests:git:hardis:extract",
4710
+ "pull-requests:git:extract:hardis",
4711
+ "hardis:pull-requests:extract:git",
4712
+ "pull-requests:hardis:extract:git",
4713
+ "pull-requests:extract:hardis:git",
4714
+ "pull-requests:extract:git:hardis",
4715
+ "hardis:git:extract:pull-requests",
4716
+ "git:hardis:extract:pull-requests",
4717
+ "git:extract:hardis:pull-requests",
4718
+ "git:extract:pull-requests:hardis",
4719
+ "hardis:extract:git:pull-requests",
4720
+ "extract:hardis:git:pull-requests",
4721
+ "extract:git:hardis:pull-requests",
4722
+ "extract:git:pull-requests:hardis",
4723
+ "hardis:extract:pull-requests:git",
4724
+ "extract:hardis:pull-requests:git",
4725
+ "extract:pull-requests:hardis:git",
4726
+ "extract:pull-requests:git:hardis"
4727
+ ]
4728
+ },
4729
+ "hardis:org:community:update": {
4730
+ "aliases": [],
4731
+ "args": {},
4732
+ "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",
4733
+ "examples": [
4734
+ "$ sf hardis:org:community:update --name 'MyNetworkName' --status DownForMaintenance",
4735
+ "$ sf hardis:org:community:update --name 'MyNetworkName,MySecondNetworkName' --status Live"
4736
+ ],
4737
+ "flags": {
4738
+ "json": {
4739
+ "description": "Format output as json.",
4740
+ "helpGroup": "GLOBAL",
4741
+ "name": "json",
4742
+ "allowNo": false,
4743
+ "type": "boolean"
4744
+ },
4745
+ "flags-dir": {
4746
+ "helpGroup": "GLOBAL",
4747
+ "name": "flags-dir",
4748
+ "summary": "Import flag values from a directory.",
4749
+ "hasDynamicHelp": false,
4750
+ "multiple": false,
4751
+ "type": "option"
4752
+ },
4753
+ "name": {
4754
+ "char": "n",
4755
+ "description": "List of Networks Names that you want to update, separated by comma",
4756
+ "name": "name",
4757
+ "required": true,
4758
+ "hasDynamicHelp": false,
4759
+ "multiple": false,
4760
+ "type": "option"
4761
+ },
4762
+ "status": {
4763
+ "char": "s",
4764
+ "description": "New status for the community, available values are: Live, DownForMaintenance",
4765
+ "name": "status",
4766
+ "required": true,
4767
+ "hasDynamicHelp": false,
4768
+ "multiple": false,
4769
+ "type": "option"
4770
4770
  },
4771
4771
  "debug": {
4772
4772
  "char": "d",
@@ -9513,12 +9513,12 @@
9513
9513
  "remotesites:audit:project:hardis"
9514
9514
  ]
9515
9515
  },
9516
- "hardis:project:configure:auth": {
9516
+ "hardis:project:clean:emptyitems": {
9517
9517
  "aliases": [],
9518
9518
  "args": {},
9519
- "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",
9519
+ "description": "\n## Command Behavior\n\n**Removes empty or irrelevant metadata items from your Salesforce DX project sources.**\n\nThis command helps maintain a clean and efficient Salesforce codebase by deleting metadata files that are essentially empty or contain no meaningful configuration. These files can sometimes be generated during retrieval processes or remain after refactoring, contributing to unnecessary clutter in your project.\n\nKey functionalities:\n\n- **Targeted Cleaning:** Specifically targets and removes empty instances of:\n - Global Value Set Translations (`.globalValueSetTranslation-meta.xml`)\n - Standard Value Sets (`.standardValueSet-meta.xml`)\n - Sharing Rules (`.sharingRules-meta.xml`)\n- **Content-Based Deletion:** It checks the XML content of these files for the presence of specific tags (e.g., `valueTranslation` for Global Value Set Translations) to determine if they are truly empty or lack relevant data.\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 files matching predefined patterns for Global Value Set Translations, Standard Value Sets, and Sharing Rules within the specified root folder (defaults to `force-app`).\n- **XML Parsing:** For each matching file, it reads and parses the XML content using `parseXmlFile`.\n- **Content Validation:** It then checks the parsed XML object for the existence of specific nested properties (e.g., `xmlContent.GlobalValueSetTranslation.valueTranslation`). If these properties are missing or empty, the file is considered empty.\n- **File Deletion:** If a file is determined to be empty, it is removed from the file system using `fs.remove`.\n- **Logging:** Provides clear messages about which files are being removed and a summary of the total number of items cleaned.\n</details>\n",
9520
9520
  "examples": [
9521
- "$ sf hardis:project:configure:auth"
9521
+ "$ sf hardis:project:clean:emptyitems"
9522
9522
  ],
9523
9523
  "flags": {
9524
9524
  "json": {
@@ -9536,12 +9536,14 @@
9536
9536
  "multiple": false,
9537
9537
  "type": "option"
9538
9538
  },
9539
- "devhub": {
9540
- "char": "b",
9541
- "description": "Configure project DevHub",
9542
- "name": "devhub",
9543
- "allowNo": false,
9544
- "type": "boolean"
9539
+ "folder": {
9540
+ "char": "f",
9541
+ "description": "Root folder",
9542
+ "name": "folder",
9543
+ "default": "force-app",
9544
+ "hasDynamicHelp": false,
9545
+ "multiple": false,
9546
+ "type": "option"
9545
9547
  },
9546
9548
  "debug": {
9547
9549
  "char": "d",
@@ -9562,296 +9564,62 @@
9562
9564
  "name": "skipauth",
9563
9565
  "allowNo": false,
9564
9566
  "type": "boolean"
9565
- },
9566
- "target-org": {
9567
- "aliases": [
9568
- "targetusername",
9569
- "u"
9570
- ],
9571
- "char": "o",
9572
- "deprecateAliases": true,
9573
- "name": "target-org",
9574
- "noCacheDefault": true,
9575
- "summary": "Username or alias of the target org.",
9576
- "hasDynamicHelp": true,
9577
- "multiple": false,
9578
- "type": "option"
9579
- },
9580
- "target-dev-hub": {
9581
- "aliases": [
9582
- "targetdevhubusername"
9583
- ],
9584
- "char": "v",
9585
- "deprecateAliases": true,
9586
- "name": "target-dev-hub",
9587
- "noCacheDefault": true,
9588
- "required": false,
9589
- "summary": "Username or alias of the Dev Hub org.",
9590
- "hasDynamicHelp": true,
9591
- "multiple": false,
9592
- "type": "option"
9593
9567
  }
9594
9568
  },
9595
- "hasDynamicHelp": true,
9569
+ "hasDynamicHelp": false,
9596
9570
  "hiddenAliases": [],
9597
- "id": "hardis:project:configure:auth",
9571
+ "id": "hardis:project:clean:emptyitems",
9598
9572
  "pluginAlias": "sfdx-hardis",
9599
9573
  "pluginName": "sfdx-hardis",
9600
9574
  "pluginType": "core",
9601
9575
  "strict": true,
9602
9576
  "enableJsonFlag": true,
9603
- "title": "Configure authentication",
9604
- "requiresProject": false,
9605
- "requiresDependencies": [
9606
- "openssl"
9607
- ],
9577
+ "title": "Clean retrieved empty items in dx sources",
9578
+ "requiresProject": true,
9608
9579
  "isESM": true,
9609
9580
  "relativePath": [
9610
9581
  "lib",
9611
9582
  "commands",
9612
9583
  "hardis",
9613
9584
  "project",
9614
- "configure",
9615
- "auth.js"
9585
+ "clean",
9586
+ "emptyitems.js"
9616
9587
  ],
9617
9588
  "aliasPermutations": [],
9618
9589
  "permutations": [
9619
- "hardis:project:configure:auth",
9620
- "project:hardis:configure:auth",
9621
- "project:configure:hardis:auth",
9622
- "project:configure:auth:hardis",
9623
- "hardis:configure:project:auth",
9624
- "configure:hardis:project:auth",
9625
- "configure:project:hardis:auth",
9626
- "configure:project:auth:hardis",
9627
- "hardis:configure:auth:project",
9628
- "configure:hardis:auth:project",
9629
- "configure:auth:hardis:project",
9630
- "configure:auth:project:hardis",
9631
- "hardis:project:auth:configure",
9632
- "project:hardis:auth:configure",
9633
- "project:auth:hardis:configure",
9634
- "project:auth:configure:hardis",
9635
- "hardis:auth:project:configure",
9636
- "auth:hardis:project:configure",
9637
- "auth:project:hardis:configure",
9638
- "auth:project:configure:hardis",
9639
- "hardis:auth:configure:project",
9640
- "auth:hardis:configure:project",
9641
- "auth:configure:hardis:project",
9642
- "auth:configure:project:hardis"
9590
+ "hardis:project:clean:emptyitems",
9591
+ "project:hardis:clean:emptyitems",
9592
+ "project:clean:hardis:emptyitems",
9593
+ "project:clean:emptyitems:hardis",
9594
+ "hardis:clean:project:emptyitems",
9595
+ "clean:hardis:project:emptyitems",
9596
+ "clean:project:hardis:emptyitems",
9597
+ "clean:project:emptyitems:hardis",
9598
+ "hardis:clean:emptyitems:project",
9599
+ "clean:hardis:emptyitems:project",
9600
+ "clean:emptyitems:hardis:project",
9601
+ "clean:emptyitems:project:hardis",
9602
+ "hardis:project:emptyitems:clean",
9603
+ "project:hardis:emptyitems:clean",
9604
+ "project:emptyitems:hardis:clean",
9605
+ "project:emptyitems:clean:hardis",
9606
+ "hardis:emptyitems:project:clean",
9607
+ "emptyitems:hardis:project:clean",
9608
+ "emptyitems:project:hardis:clean",
9609
+ "emptyitems:project:clean:hardis",
9610
+ "hardis:emptyitems:clean:project",
9611
+ "emptyitems:hardis:clean:project",
9612
+ "emptyitems:clean:hardis:project",
9613
+ "emptyitems:clean:project:hardis"
9643
9614
  ]
9644
9615
  },
9645
- "hardis:project:convert:profilestopermsets": {
9616
+ "hardis:project:clean:filter-xml-content": {
9646
9617
  "aliases": [],
9647
9618
  "args": {},
9648
- "description": "\n## Command Behavior\n\n**Converts existing Salesforce Profiles into Permission Sets, facilitating a more granular and recommended security model.**\n\nThis command helps in migrating permissions from Profiles to Permission Sets, which is a best practice for managing user access in Salesforce. It creates a new Permission Set for each specified Profile, adopting a naming convention of `PS_PROFILENAME`.\n\nKey functionalities:\n\n- **Profile to Permission Set Conversion:** Automatically extracts permissions from a Profile and creates a corresponding Permission Set.\n- **Naming Convention:** New Permission Sets are named with a `PS_` prefix followed by the Profile name (e.g., `PS_Standard_User`).\n- **Exclusion Filter:** Allows you to exclude specific Profiles from the conversion process using the `--except` flag.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **External Plugin Integration:** It relies on the `shane-sfdx-plugins` (specifically the `sf shane:profile:convert` command) to perform the actual conversion.\n- **File System Scan:** It reads the contents of the `force-app/main/default/profiles` directory to identify all available Profile metadata files.\n- **Command Execution:** For each identified Profile (that is not excluded), it constructs and executes the `sf shane:profile:convert` command with the appropriate Profile name and desired Permission Set name.\n- **Error Handling:** Includes basic error handling for the external command execution.\n</details>\n",
9619
+ "description": "\n## Command Behavior\n\n**Filters the content of Salesforce metadata XML files to remove specific elements, enabling more granular deployments.**\n\nThis command addresses a common challenge in Salesforce development: deploying only a subset of metadata from an XML file when the target org might not support all elements or when certain elements are not desired. It allows you to define rules in a JSON configuration file to remove unwanted XML nodes.\n\nKey functionalities:\n\n- **Configurable Filtering:** Uses a JSON configuration file (e.g., `filter-config.json`) to define which XML elements to remove. This configuration specifies the XML tags to target and the values within those tags that should trigger removal.\n- **Targeted File Processing:** Processes XML files within a specified input folder (defaults to current directory) and writes the filtered content to an output folder.\n- **Example Use Cases:** Useful for scenarios like:\n - Removing references to features not enabled in the target org.\n - Stripping out specific profile permissions or field-level security settings.\n - Cleaning up metadata that is not relevant to a particular deployment.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Configuration Loading:** Reads the `filter-config.json` file, which contains an array of `filters`. Each filter defines a `name`, `description`, `folders` (where to apply the filter), `file_extensions`, and an `exclude_list`.\n- **File System Operations:** Copies the input folder to an output folder (if different) to avoid modifying original files directly. It then iterates through the files in the output folder that match the specified file extensions.\n- **XML Parsing and Manipulation:** For each matching XML file:\n - It uses `xml2js.Parser` to parse the XML content into a JavaScript object.\n - It recursively traverses the JavaScript object, applying the `filterElement` function.\n - The `filterElement` function checks for `type_tag` and `identifier_tag` defined in the `exclude_list`. If a match is found and the value is in the `excludeDef.values`, the element is removed from the XML structure.\n - After filtering, it uses `writeXmlFile` to write the modified JavaScript object back to the XML file.\n- **Logging:** Provides detailed logs about the filtering process, including which files are being processed and which elements are being filtered.\n- **Summary Reporting:** Tracks and reports on the files that have been updated due to filtering.\n</details>\n",
9649
9620
  "examples": [
9650
- "$ sf hardis:project:convert:profilestopermsets"
9651
- ],
9652
- "flags": {
9653
- "json": {
9654
- "description": "Format output as json.",
9655
- "helpGroup": "GLOBAL",
9656
- "name": "json",
9657
- "allowNo": false,
9658
- "type": "boolean"
9659
- },
9660
- "flags-dir": {
9661
- "helpGroup": "GLOBAL",
9662
- "name": "flags-dir",
9663
- "summary": "Import flag values from a directory.",
9664
- "hasDynamicHelp": false,
9665
- "multiple": false,
9666
- "type": "option"
9667
- },
9668
- "except": {
9669
- "char": "e",
9670
- "description": "List of filters",
9671
- "name": "except",
9672
- "default": [],
9673
- "hasDynamicHelp": false,
9674
- "multiple": true,
9675
- "type": "option"
9676
- },
9677
- "debug": {
9678
- "char": "d",
9679
- "description": "Activate debug mode (more logs)",
9680
- "name": "debug",
9681
- "allowNo": false,
9682
- "type": "boolean"
9683
- },
9684
- "websocket": {
9685
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9686
- "name": "websocket",
9687
- "hasDynamicHelp": false,
9688
- "multiple": false,
9689
- "type": "option"
9690
- },
9691
- "skipauth": {
9692
- "description": "Skip authentication check when a default username is required",
9693
- "name": "skipauth",
9694
- "allowNo": false,
9695
- "type": "boolean"
9696
- }
9697
- },
9698
- "hasDynamicHelp": false,
9699
- "hiddenAliases": [],
9700
- "id": "hardis:project:convert:profilestopermsets",
9701
- "pluginAlias": "sfdx-hardis",
9702
- "pluginName": "sfdx-hardis",
9703
- "pluginType": "core",
9704
- "strict": true,
9705
- "enableJsonFlag": true,
9706
- "title": "Convert Profiles into Permission Sets",
9707
- "requiresProject": true,
9708
- "requiresSfdxPlugins": [
9709
- "shane-sfdx-plugins"
9710
- ],
9711
- "isESM": true,
9712
- "relativePath": [
9713
- "lib",
9714
- "commands",
9715
- "hardis",
9716
- "project",
9717
- "convert",
9718
- "profilestopermsets.js"
9719
- ],
9720
- "aliasPermutations": [],
9721
- "permutations": [
9722
- "hardis:project:convert:profilestopermsets",
9723
- "project:hardis:convert:profilestopermsets",
9724
- "project:convert:hardis:profilestopermsets",
9725
- "project:convert:profilestopermsets:hardis",
9726
- "hardis:convert:project:profilestopermsets",
9727
- "convert:hardis:project:profilestopermsets",
9728
- "convert:project:hardis:profilestopermsets",
9729
- "convert:project:profilestopermsets:hardis",
9730
- "hardis:convert:profilestopermsets:project",
9731
- "convert:hardis:profilestopermsets:project",
9732
- "convert:profilestopermsets:hardis:project",
9733
- "convert:profilestopermsets:project:hardis",
9734
- "hardis:project:profilestopermsets:convert",
9735
- "project:hardis:profilestopermsets:convert",
9736
- "project:profilestopermsets:hardis:convert",
9737
- "project:profilestopermsets:convert:hardis",
9738
- "hardis:profilestopermsets:project:convert",
9739
- "profilestopermsets:hardis:project:convert",
9740
- "profilestopermsets:project:hardis:convert",
9741
- "profilestopermsets:project:convert:hardis",
9742
- "hardis:profilestopermsets:convert:project",
9743
- "profilestopermsets:hardis:convert:project",
9744
- "profilestopermsets:convert:hardis:project",
9745
- "profilestopermsets:convert:project:hardis"
9746
- ]
9747
- },
9748
- "hardis:project:clean:emptyitems": {
9749
- "aliases": [],
9750
- "args": {},
9751
- "description": "\n## Command Behavior\n\n**Removes empty or irrelevant metadata items from your Salesforce DX project sources.**\n\nThis command helps maintain a clean and efficient Salesforce codebase by deleting metadata files that are essentially empty or contain no meaningful configuration. These files can sometimes be generated during retrieval processes or remain after refactoring, contributing to unnecessary clutter in your project.\n\nKey functionalities:\n\n- **Targeted Cleaning:** Specifically targets and removes empty instances of:\n - Global Value Set Translations (`.globalValueSetTranslation-meta.xml`)\n - Standard Value Sets (`.standardValueSet-meta.xml`)\n - Sharing Rules (`.sharingRules-meta.xml`)\n- **Content-Based Deletion:** It checks the XML content of these files for the presence of specific tags (e.g., `valueTranslation` for Global Value Set Translations) to determine if they are truly empty or lack relevant data.\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 files matching predefined patterns for Global Value Set Translations, Standard Value Sets, and Sharing Rules within the specified root folder (defaults to `force-app`).\n- **XML Parsing:** For each matching file, it reads and parses the XML content using `parseXmlFile`.\n- **Content Validation:** It then checks the parsed XML object for the existence of specific nested properties (e.g., `xmlContent.GlobalValueSetTranslation.valueTranslation`). If these properties are missing or empty, the file is considered empty.\n- **File Deletion:** If a file is determined to be empty, it is removed from the file system using `fs.remove`.\n- **Logging:** Provides clear messages about which files are being removed and a summary of the total number of items cleaned.\n</details>\n",
9752
- "examples": [
9753
- "$ sf hardis:project:clean:emptyitems"
9754
- ],
9755
- "flags": {
9756
- "json": {
9757
- "description": "Format output as json.",
9758
- "helpGroup": "GLOBAL",
9759
- "name": "json",
9760
- "allowNo": false,
9761
- "type": "boolean"
9762
- },
9763
- "flags-dir": {
9764
- "helpGroup": "GLOBAL",
9765
- "name": "flags-dir",
9766
- "summary": "Import flag values from a directory.",
9767
- "hasDynamicHelp": false,
9768
- "multiple": false,
9769
- "type": "option"
9770
- },
9771
- "folder": {
9772
- "char": "f",
9773
- "description": "Root folder",
9774
- "name": "folder",
9775
- "default": "force-app",
9776
- "hasDynamicHelp": false,
9777
- "multiple": false,
9778
- "type": "option"
9779
- },
9780
- "debug": {
9781
- "char": "d",
9782
- "description": "Activate debug mode (more logs)",
9783
- "name": "debug",
9784
- "allowNo": false,
9785
- "type": "boolean"
9786
- },
9787
- "websocket": {
9788
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9789
- "name": "websocket",
9790
- "hasDynamicHelp": false,
9791
- "multiple": false,
9792
- "type": "option"
9793
- },
9794
- "skipauth": {
9795
- "description": "Skip authentication check when a default username is required",
9796
- "name": "skipauth",
9797
- "allowNo": false,
9798
- "type": "boolean"
9799
- }
9800
- },
9801
- "hasDynamicHelp": false,
9802
- "hiddenAliases": [],
9803
- "id": "hardis:project:clean:emptyitems",
9804
- "pluginAlias": "sfdx-hardis",
9805
- "pluginName": "sfdx-hardis",
9806
- "pluginType": "core",
9807
- "strict": true,
9808
- "enableJsonFlag": true,
9809
- "title": "Clean retrieved empty items in dx sources",
9810
- "requiresProject": true,
9811
- "isESM": true,
9812
- "relativePath": [
9813
- "lib",
9814
- "commands",
9815
- "hardis",
9816
- "project",
9817
- "clean",
9818
- "emptyitems.js"
9819
- ],
9820
- "aliasPermutations": [],
9821
- "permutations": [
9822
- "hardis:project:clean:emptyitems",
9823
- "project:hardis:clean:emptyitems",
9824
- "project:clean:hardis:emptyitems",
9825
- "project:clean:emptyitems:hardis",
9826
- "hardis:clean:project:emptyitems",
9827
- "clean:hardis:project:emptyitems",
9828
- "clean:project:hardis:emptyitems",
9829
- "clean:project:emptyitems:hardis",
9830
- "hardis:clean:emptyitems:project",
9831
- "clean:hardis:emptyitems:project",
9832
- "clean:emptyitems:hardis:project",
9833
- "clean:emptyitems:project:hardis",
9834
- "hardis:project:emptyitems:clean",
9835
- "project:hardis:emptyitems:clean",
9836
- "project:emptyitems:hardis:clean",
9837
- "project:emptyitems:clean:hardis",
9838
- "hardis:emptyitems:project:clean",
9839
- "emptyitems:hardis:project:clean",
9840
- "emptyitems:project:hardis:clean",
9841
- "emptyitems:project:clean:hardis",
9842
- "hardis:emptyitems:clean:project",
9843
- "emptyitems:hardis:clean:project",
9844
- "emptyitems:clean:hardis:project",
9845
- "emptyitems:clean:project:hardis"
9846
- ]
9847
- },
9848
- "hardis:project:clean:filter-xml-content": {
9849
- "aliases": [],
9850
- "args": {},
9851
- "description": "\n## Command Behavior\n\n**Filters the content of Salesforce metadata XML files to remove specific elements, enabling more granular deployments.**\n\nThis command addresses a common challenge in Salesforce development: deploying only a subset of metadata from an XML file when the target org might not support all elements or when certain elements are not desired. It allows you to define rules in a JSON configuration file to remove unwanted XML nodes.\n\nKey functionalities:\n\n- **Configurable Filtering:** Uses a JSON configuration file (e.g., `filter-config.json`) to define which XML elements to remove. This configuration specifies the XML tags to target and the values within those tags that should trigger removal.\n- **Targeted File Processing:** Processes XML files within a specified input folder (defaults to current directory) and writes the filtered content to an output folder.\n- **Example Use Cases:** Useful for scenarios like:\n - Removing references to features not enabled in the target org.\n - Stripping out specific profile permissions or field-level security settings.\n - Cleaning up metadata that is not relevant to a particular deployment.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Configuration Loading:** Reads the `filter-config.json` file, which contains an array of `filters`. Each filter defines a `name`, `description`, `folders` (where to apply the filter), `file_extensions`, and an `exclude_list`.\n- **File System Operations:** Copies the input folder to an output folder (if different) to avoid modifying original files directly. It then iterates through the files in the output folder that match the specified file extensions.\n- **XML Parsing and Manipulation:** For each matching XML file:\n - It uses `xml2js.Parser` to parse the XML content into a JavaScript object.\n - It recursively traverses the JavaScript object, applying the `filterElement` function.\n - The `filterElement` function checks for `type_tag` and `identifier_tag` defined in the `exclude_list`. If a match is found and the value is in the `excludeDef.values`, the element is removed from the XML structure.\n - After filtering, it uses `writeXmlFile` to write the modified JavaScript object back to the XML file.\n- **Logging:** Provides detailed logs about the filtering process, including which files are being processed and which elements are being filtered.\n- **Summary Reporting:** Tracks and reports on the files that have been updated due to filtering.\n</details>\n",
9852
- "examples": [
9853
- "sf hardis:project:clean:filter-xml-content -i \"./mdapi_output\"",
9854
- "sf hardis:project:clean:filter-xml-content -i \"retrieveUnpackaged\""
9621
+ "sf hardis:project:clean:filter-xml-content -i \"./mdapi_output\"",
9622
+ "sf hardis:project:clean:filter-xml-content -i \"retrieveUnpackaged\""
9855
9623
  ],
9856
9624
  "flags": {
9857
9625
  "json": {
@@ -11230,12 +10998,12 @@
11230
10998
  "xml:clean:project:hardis"
11231
10999
  ]
11232
11000
  },
11233
- "hardis:project:fix:profiletabs": {
11001
+ "hardis:project:configure:auth": {
11234
11002
  "aliases": [],
11235
11003
  "args": {},
11236
- "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",
11004
+ "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",
11237
11005
  "examples": [
11238
- "$ sf hardis:project:fix:profiletabs"
11006
+ "$ sf hardis:project:configure:auth"
11239
11007
  ],
11240
11008
  "flags": {
11241
11009
  "json": {
@@ -11253,14 +11021,12 @@
11253
11021
  "multiple": false,
11254
11022
  "type": "option"
11255
11023
  },
11256
- "path": {
11257
- "char": "p",
11258
- "description": "Root folder",
11259
- "name": "path",
11260
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
11261
- "hasDynamicHelp": false,
11262
- "multiple": false,
11263
- "type": "option"
11024
+ "devhub": {
11025
+ "char": "b",
11026
+ "description": "Configure project DevHub",
11027
+ "name": "devhub",
11028
+ "allowNo": false,
11029
+ "type": "boolean"
11264
11030
  },
11265
11031
  "debug": {
11266
11032
  "char": "d",
@@ -11291,8 +11057,21 @@
11291
11057
  "deprecateAliases": true,
11292
11058
  "name": "target-org",
11293
11059
  "noCacheDefault": true,
11294
- "required": true,
11295
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
11060
+ "summary": "Username or alias of the target org.",
11061
+ "hasDynamicHelp": true,
11062
+ "multiple": false,
11063
+ "type": "option"
11064
+ },
11065
+ "target-dev-hub": {
11066
+ "aliases": [
11067
+ "targetdevhubusername"
11068
+ ],
11069
+ "char": "v",
11070
+ "deprecateAliases": true,
11071
+ "name": "target-dev-hub",
11072
+ "noCacheDefault": true,
11073
+ "required": false,
11074
+ "summary": "Username or alias of the Dev Hub org.",
11296
11075
  "hasDynamicHelp": true,
11297
11076
  "multiple": false,
11298
11077
  "type": "option"
@@ -11300,57 +11079,60 @@
11300
11079
  },
11301
11080
  "hasDynamicHelp": true,
11302
11081
  "hiddenAliases": [],
11303
- "id": "hardis:project:fix:profiletabs",
11082
+ "id": "hardis:project:configure:auth",
11304
11083
  "pluginAlias": "sfdx-hardis",
11305
11084
  "pluginName": "sfdx-hardis",
11306
11085
  "pluginType": "core",
11307
11086
  "strict": true,
11308
11087
  "enableJsonFlag": true,
11309
- "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
11310
- "requiresProject": true,
11088
+ "title": "Configure authentication",
11089
+ "requiresProject": false,
11090
+ "requiresDependencies": [
11091
+ "openssl"
11092
+ ],
11311
11093
  "isESM": true,
11312
11094
  "relativePath": [
11313
11095
  "lib",
11314
11096
  "commands",
11315
11097
  "hardis",
11316
11098
  "project",
11317
- "fix",
11318
- "profiletabs.js"
11099
+ "configure",
11100
+ "auth.js"
11319
11101
  ],
11320
11102
  "aliasPermutations": [],
11321
11103
  "permutations": [
11322
- "hardis:project:fix:profiletabs",
11323
- "project:hardis:fix:profiletabs",
11324
- "project:fix:hardis:profiletabs",
11325
- "project:fix:profiletabs:hardis",
11326
- "hardis:fix:project:profiletabs",
11327
- "fix:hardis:project:profiletabs",
11328
- "fix:project:hardis:profiletabs",
11329
- "fix:project:profiletabs:hardis",
11330
- "hardis:fix:profiletabs:project",
11331
- "fix:hardis:profiletabs:project",
11332
- "fix:profiletabs:hardis:project",
11333
- "fix:profiletabs:project:hardis",
11334
- "hardis:project:profiletabs:fix",
11335
- "project:hardis:profiletabs:fix",
11336
- "project:profiletabs:hardis:fix",
11337
- "project:profiletabs:fix:hardis",
11338
- "hardis:profiletabs:project:fix",
11339
- "profiletabs:hardis:project:fix",
11340
- "profiletabs:project:hardis:fix",
11341
- "profiletabs:project:fix:hardis",
11342
- "hardis:profiletabs:fix:project",
11343
- "profiletabs:hardis:fix:project",
11344
- "profiletabs:fix:hardis:project",
11345
- "profiletabs:fix:project:hardis"
11104
+ "hardis:project:configure:auth",
11105
+ "project:hardis:configure:auth",
11106
+ "project:configure:hardis:auth",
11107
+ "project:configure:auth:hardis",
11108
+ "hardis:configure:project:auth",
11109
+ "configure:hardis:project:auth",
11110
+ "configure:project:hardis:auth",
11111
+ "configure:project:auth:hardis",
11112
+ "hardis:configure:auth:project",
11113
+ "configure:hardis:auth:project",
11114
+ "configure:auth:hardis:project",
11115
+ "configure:auth:project:hardis",
11116
+ "hardis:project:auth:configure",
11117
+ "project:hardis:auth:configure",
11118
+ "project:auth:hardis:configure",
11119
+ "project:auth:configure:hardis",
11120
+ "hardis:auth:project:configure",
11121
+ "auth:hardis:project:configure",
11122
+ "auth:project:hardis:configure",
11123
+ "auth:project:configure:hardis",
11124
+ "hardis:auth:configure:project",
11125
+ "auth:hardis:configure:project",
11126
+ "auth:configure:hardis:project",
11127
+ "auth:configure:project:hardis"
11346
11128
  ]
11347
11129
  },
11348
- "hardis:project:fix:v53flexipages": {
11130
+ "hardis:project:convert:profilestopermsets": {
11349
11131
  "aliases": [],
11350
11132
  "args": {},
11351
- "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",
11133
+ "description": "\n## Command Behavior\n\n**Converts existing Salesforce Profiles into Permission Sets, facilitating a more granular and recommended security model.**\n\nThis command helps in migrating permissions from Profiles to Permission Sets, which is a best practice for managing user access in Salesforce. It creates a new Permission Set for each specified Profile, adopting a naming convention of `PS_PROFILENAME`.\n\nKey functionalities:\n\n- **Profile to Permission Set Conversion:** Automatically extracts permissions from a Profile and creates a corresponding Permission Set.\n- **Naming Convention:** New Permission Sets are named with a `PS_` prefix followed by the Profile name (e.g., `PS_Standard_User`).\n- **Exclusion Filter:** Allows you to exclude specific Profiles from the conversion process using the `--except` flag.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **External Plugin Integration:** It relies on the `shane-sfdx-plugins` (specifically the `sf shane:profile:convert` command) to perform the actual conversion.\n- **File System Scan:** It reads the contents of the `force-app/main/default/profiles` directory to identify all available Profile metadata files.\n- **Command Execution:** For each identified Profile (that is not excluded), it constructs and executes the `sf shane:profile:convert` command with the appropriate Profile name and desired Permission Set name.\n- **Error Handling:** Includes basic error handling for the external command execution.\n</details>\n",
11352
11134
  "examples": [
11353
- "$ sf hardis:project:fix:v53flexipages"
11135
+ "$ sf hardis:project:convert:profilestopermsets"
11354
11136
  ],
11355
11137
  "flags": {
11356
11138
  "json": {
@@ -11368,13 +11150,13 @@
11368
11150
  "multiple": false,
11369
11151
  "type": "option"
11370
11152
  },
11371
- "path": {
11372
- "char": "p",
11373
- "description": "Root folder",
11374
- "name": "path",
11375
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
11153
+ "except": {
11154
+ "char": "e",
11155
+ "description": "List of filters",
11156
+ "name": "except",
11157
+ "default": [],
11376
11158
  "hasDynamicHelp": false,
11377
- "multiple": false,
11159
+ "multiple": true,
11378
11160
  "type": "option"
11379
11161
  },
11380
11162
  "debug": {
@@ -11400,49 +11182,52 @@
11400
11182
  },
11401
11183
  "hasDynamicHelp": false,
11402
11184
  "hiddenAliases": [],
11403
- "id": "hardis:project:fix:v53flexipages",
11185
+ "id": "hardis:project:convert:profilestopermsets",
11404
11186
  "pluginAlias": "sfdx-hardis",
11405
11187
  "pluginName": "sfdx-hardis",
11406
11188
  "pluginType": "core",
11407
11189
  "strict": true,
11408
11190
  "enableJsonFlag": true,
11409
- "title": "Fix flexipages for v53",
11191
+ "title": "Convert Profiles into Permission Sets",
11410
11192
  "requiresProject": true,
11193
+ "requiresSfdxPlugins": [
11194
+ "shane-sfdx-plugins"
11195
+ ],
11411
11196
  "isESM": true,
11412
11197
  "relativePath": [
11413
11198
  "lib",
11414
11199
  "commands",
11415
11200
  "hardis",
11416
11201
  "project",
11417
- "fix",
11418
- "v53flexipages.js"
11202
+ "convert",
11203
+ "profilestopermsets.js"
11419
11204
  ],
11420
11205
  "aliasPermutations": [],
11421
11206
  "permutations": [
11422
- "hardis:project:fix:v53flexipages",
11423
- "project:hardis:fix:v53flexipages",
11424
- "project:fix:hardis:v53flexipages",
11425
- "project:fix:v53flexipages:hardis",
11426
- "hardis:fix:project:v53flexipages",
11427
- "fix:hardis:project:v53flexipages",
11428
- "fix:project:hardis:v53flexipages",
11429
- "fix:project:v53flexipages:hardis",
11430
- "hardis:fix:v53flexipages:project",
11431
- "fix:hardis:v53flexipages:project",
11432
- "fix:v53flexipages:hardis:project",
11433
- "fix:v53flexipages:project:hardis",
11434
- "hardis:project:v53flexipages:fix",
11435
- "project:hardis:v53flexipages:fix",
11436
- "project:v53flexipages:hardis:fix",
11437
- "project:v53flexipages:fix:hardis",
11438
- "hardis:v53flexipages:project:fix",
11439
- "v53flexipages:hardis:project:fix",
11440
- "v53flexipages:project:hardis:fix",
11441
- "v53flexipages:project:fix:hardis",
11442
- "hardis:v53flexipages:fix:project",
11443
- "v53flexipages:hardis:fix:project",
11444
- "v53flexipages:fix:hardis:project",
11445
- "v53flexipages:fix:project:hardis"
11207
+ "hardis:project:convert:profilestopermsets",
11208
+ "project:hardis:convert:profilestopermsets",
11209
+ "project:convert:hardis:profilestopermsets",
11210
+ "project:convert:profilestopermsets:hardis",
11211
+ "hardis:convert:project:profilestopermsets",
11212
+ "convert:hardis:project:profilestopermsets",
11213
+ "convert:project:hardis:profilestopermsets",
11214
+ "convert:project:profilestopermsets:hardis",
11215
+ "hardis:convert:profilestopermsets:project",
11216
+ "convert:hardis:profilestopermsets:project",
11217
+ "convert:profilestopermsets:hardis:project",
11218
+ "convert:profilestopermsets:project:hardis",
11219
+ "hardis:project:profilestopermsets:convert",
11220
+ "project:hardis:profilestopermsets:convert",
11221
+ "project:profilestopermsets:hardis:convert",
11222
+ "project:profilestopermsets:convert:hardis",
11223
+ "hardis:profilestopermsets:project:convert",
11224
+ "profilestopermsets:hardis:project:convert",
11225
+ "profilestopermsets:project:hardis:convert",
11226
+ "profilestopermsets:project:convert:hardis",
11227
+ "hardis:profilestopermsets:convert:project",
11228
+ "profilestopermsets:hardis:convert:project",
11229
+ "profilestopermsets:convert:hardis:project",
11230
+ "profilestopermsets:convert:project:hardis"
11446
11231
  ]
11447
11232
  },
11448
11233
  "hardis:project:deploy:notify": {
@@ -12620,6 +12405,221 @@
12620
12405
  "validate:deploy:project:hardis"
12621
12406
  ]
12622
12407
  },
12408
+ "hardis:project:fix:profiletabs": {
12409
+ "aliases": [],
12410
+ "args": {},
12411
+ "description": "\n## Command Behavior\n\n**Interactively updates tab visibility settings in Salesforce profiles, addressing a common issue where tab visibilities are not correctly retrieved by `sf project retrieve start`.**\n\nThis command provides a user-friendly interface to manage tab settings within your profile XML files, ensuring that your local project accurately reflects the intended tab configurations in your Salesforce org.\n\nKey functionalities:\n\n- **Interactive Tab Selection:** Displays a multi-select menu of all available tabs in your org, allowing you to choose which tabs to update.\n- **Visibility Control:** Lets you set the visibility for the selected tabs to either `DefaultOn` (Visible) or `Hidden`.\n- **Profile Selection:** Presents a multi-select menu of all .profile-meta.xml files in your project, allowing you to apply the tab visibility changes to specific profiles.\n- **XML Updates:** Modifies the <tabVisibilities> section of the selected profile XML files to reflect the chosen tab settings. If a tab visibility setting already exists for a selected tab, it will be updated; otherwise, a new one will be added.\n- **Sorted Output:** The <tabVisibilities> in the updated profile XML files are sorted alphabetically for consistency and readability.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries the `TabDefinition` object using `soqlQueryTooling` to retrieve a list of all available tabs in the target org.\n- **File Discovery:** Uses `glob` to find all .profile-meta.xml files within the specified project path.\n- **Interactive Prompts:** Leverages the `prompts` library to create interactive menus for selecting tabs, visibility settings, and profiles.\n- **XML Parsing and Manipulation:** Uses `parseXmlFile` to read the content of profile XML files and `writeXmlFile` to write the modified content back. It manipulates the `tabVisibilities` array within the parsed XML to add or update tab settings.\n- **Array Sorting:** Employs the `sort-array` library to sort the `tabVisibilities` alphabetically by tab name.\n- **Logging:** Provides feedback to the user about which profiles have been updated and a summary of the changes.\n</details>\n",
12412
+ "examples": [
12413
+ "$ sf hardis:project:fix:profiletabs"
12414
+ ],
12415
+ "flags": {
12416
+ "json": {
12417
+ "description": "Format output as json.",
12418
+ "helpGroup": "GLOBAL",
12419
+ "name": "json",
12420
+ "allowNo": false,
12421
+ "type": "boolean"
12422
+ },
12423
+ "flags-dir": {
12424
+ "helpGroup": "GLOBAL",
12425
+ "name": "flags-dir",
12426
+ "summary": "Import flag values from a directory.",
12427
+ "hasDynamicHelp": false,
12428
+ "multiple": false,
12429
+ "type": "option"
12430
+ },
12431
+ "path": {
12432
+ "char": "p",
12433
+ "description": "Root folder",
12434
+ "name": "path",
12435
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12436
+ "hasDynamicHelp": false,
12437
+ "multiple": false,
12438
+ "type": "option"
12439
+ },
12440
+ "debug": {
12441
+ "char": "d",
12442
+ "description": "Activate debug mode (more logs)",
12443
+ "name": "debug",
12444
+ "allowNo": false,
12445
+ "type": "boolean"
12446
+ },
12447
+ "websocket": {
12448
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12449
+ "name": "websocket",
12450
+ "hasDynamicHelp": false,
12451
+ "multiple": false,
12452
+ "type": "option"
12453
+ },
12454
+ "skipauth": {
12455
+ "description": "Skip authentication check when a default username is required",
12456
+ "name": "skipauth",
12457
+ "allowNo": false,
12458
+ "type": "boolean"
12459
+ },
12460
+ "target-org": {
12461
+ "aliases": [
12462
+ "targetusername",
12463
+ "u"
12464
+ ],
12465
+ "char": "o",
12466
+ "deprecateAliases": true,
12467
+ "name": "target-org",
12468
+ "noCacheDefault": true,
12469
+ "required": true,
12470
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12471
+ "hasDynamicHelp": true,
12472
+ "multiple": false,
12473
+ "type": "option"
12474
+ }
12475
+ },
12476
+ "hasDynamicHelp": true,
12477
+ "hiddenAliases": [],
12478
+ "id": "hardis:project:fix:profiletabs",
12479
+ "pluginAlias": "sfdx-hardis",
12480
+ "pluginName": "sfdx-hardis",
12481
+ "pluginType": "core",
12482
+ "strict": true,
12483
+ "enableJsonFlag": true,
12484
+ "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
12485
+ "requiresProject": true,
12486
+ "isESM": true,
12487
+ "relativePath": [
12488
+ "lib",
12489
+ "commands",
12490
+ "hardis",
12491
+ "project",
12492
+ "fix",
12493
+ "profiletabs.js"
12494
+ ],
12495
+ "aliasPermutations": [],
12496
+ "permutations": [
12497
+ "hardis:project:fix:profiletabs",
12498
+ "project:hardis:fix:profiletabs",
12499
+ "project:fix:hardis:profiletabs",
12500
+ "project:fix:profiletabs:hardis",
12501
+ "hardis:fix:project:profiletabs",
12502
+ "fix:hardis:project:profiletabs",
12503
+ "fix:project:hardis:profiletabs",
12504
+ "fix:project:profiletabs:hardis",
12505
+ "hardis:fix:profiletabs:project",
12506
+ "fix:hardis:profiletabs:project",
12507
+ "fix:profiletabs:hardis:project",
12508
+ "fix:profiletabs:project:hardis",
12509
+ "hardis:project:profiletabs:fix",
12510
+ "project:hardis:profiletabs:fix",
12511
+ "project:profiletabs:hardis:fix",
12512
+ "project:profiletabs:fix:hardis",
12513
+ "hardis:profiletabs:project:fix",
12514
+ "profiletabs:hardis:project:fix",
12515
+ "profiletabs:project:hardis:fix",
12516
+ "profiletabs:project:fix:hardis",
12517
+ "hardis:profiletabs:fix:project",
12518
+ "profiletabs:hardis:fix:project",
12519
+ "profiletabs:fix:hardis:project",
12520
+ "profiletabs:fix:project:hardis"
12521
+ ]
12522
+ },
12523
+ "hardis:project:fix:v53flexipages": {
12524
+ "aliases": [],
12525
+ "args": {},
12526
+ "description": "\n## Command Behavior\n\n**Fixes Salesforce FlexiPages for compatibility with API Version 53.0 (Winter '22 release) by adding missing identifiers to component instances.**\n\nSalesforce introduced a change in API Version 53.0 that requires `identifier` tags within `componentInstance` and `fieldInstance` elements in FlexiPage metadata. If these identifiers are missing, deployments to orgs with API version 53.0 or higher will fail. This command automates the process of adding these missing identifiers, ensuring your FlexiPages remain deployable.\n\nKey functionalities:\n\n- **Targeted FlexiPage Processing:** Scans all .flexipage-meta.xml files within the specified root folder (defaults to current working directory).\n- **Identifier Injection:** Inserts a unique `identifier` tag (e.g., `SFDX_HARDIS_REPLACEMENT_ID`) into `componentInstance` and `fieldInstance` elements that lack one.\n\n**Important Note:** After running this command, ensure you update your `apiVersion` to `53.0` (or higher) in your `package.xml` and `sfdx-project.json` files.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find all .flexipage-meta.xml files.\n- **Content Reading:** Reads the XML content of each FlexiPage file.\n- **Regular Expression Replacement:** Employs a set of regular expressions to identify specific XML patterns (componentName.../componentName.../componentInstance, componentName.../componentName.../visibilityRule, fieldItem.../fieldItem.../fieldInstance) that are missing the `identifier` tag.\n- **Dynamic ID Generation:** For each match, it generates a unique identifier (e.g., `sfdxHardisIdX`) and injects it into the XML structure.\n- **File Writing:** If changes are made, the modified XML content is written back to the FlexiPage file using `fs.writeFile`.\n- **Logging:** Provides messages about which FlexiPages are being processed and a summary of the total number of identifiers added.\n</details>\n",
12527
+ "examples": [
12528
+ "$ sf hardis:project:fix:v53flexipages"
12529
+ ],
12530
+ "flags": {
12531
+ "json": {
12532
+ "description": "Format output as json.",
12533
+ "helpGroup": "GLOBAL",
12534
+ "name": "json",
12535
+ "allowNo": false,
12536
+ "type": "boolean"
12537
+ },
12538
+ "flags-dir": {
12539
+ "helpGroup": "GLOBAL",
12540
+ "name": "flags-dir",
12541
+ "summary": "Import flag values from a directory.",
12542
+ "hasDynamicHelp": false,
12543
+ "multiple": false,
12544
+ "type": "option"
12545
+ },
12546
+ "path": {
12547
+ "char": "p",
12548
+ "description": "Root folder",
12549
+ "name": "path",
12550
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12551
+ "hasDynamicHelp": false,
12552
+ "multiple": false,
12553
+ "type": "option"
12554
+ },
12555
+ "debug": {
12556
+ "char": "d",
12557
+ "description": "Activate debug mode (more logs)",
12558
+ "name": "debug",
12559
+ "allowNo": false,
12560
+ "type": "boolean"
12561
+ },
12562
+ "websocket": {
12563
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12564
+ "name": "websocket",
12565
+ "hasDynamicHelp": false,
12566
+ "multiple": false,
12567
+ "type": "option"
12568
+ },
12569
+ "skipauth": {
12570
+ "description": "Skip authentication check when a default username is required",
12571
+ "name": "skipauth",
12572
+ "allowNo": false,
12573
+ "type": "boolean"
12574
+ }
12575
+ },
12576
+ "hasDynamicHelp": false,
12577
+ "hiddenAliases": [],
12578
+ "id": "hardis:project:fix:v53flexipages",
12579
+ "pluginAlias": "sfdx-hardis",
12580
+ "pluginName": "sfdx-hardis",
12581
+ "pluginType": "core",
12582
+ "strict": true,
12583
+ "enableJsonFlag": true,
12584
+ "title": "Fix flexipages for v53",
12585
+ "requiresProject": true,
12586
+ "isESM": true,
12587
+ "relativePath": [
12588
+ "lib",
12589
+ "commands",
12590
+ "hardis",
12591
+ "project",
12592
+ "fix",
12593
+ "v53flexipages.js"
12594
+ ],
12595
+ "aliasPermutations": [],
12596
+ "permutations": [
12597
+ "hardis:project:fix:v53flexipages",
12598
+ "project:hardis:fix:v53flexipages",
12599
+ "project:fix:hardis:v53flexipages",
12600
+ "project:fix:v53flexipages:hardis",
12601
+ "hardis:fix:project:v53flexipages",
12602
+ "fix:hardis:project:v53flexipages",
12603
+ "fix:project:hardis:v53flexipages",
12604
+ "fix:project:v53flexipages:hardis",
12605
+ "hardis:fix:v53flexipages:project",
12606
+ "fix:hardis:v53flexipages:project",
12607
+ "fix:v53flexipages:hardis:project",
12608
+ "fix:v53flexipages:project:hardis",
12609
+ "hardis:project:v53flexipages:fix",
12610
+ "project:hardis:v53flexipages:fix",
12611
+ "project:v53flexipages:hardis:fix",
12612
+ "project:v53flexipages:fix:hardis",
12613
+ "hardis:v53flexipages:project:fix",
12614
+ "v53flexipages:hardis:project:fix",
12615
+ "v53flexipages:project:hardis:fix",
12616
+ "v53flexipages:project:fix:hardis",
12617
+ "hardis:v53flexipages:fix:project",
12618
+ "v53flexipages:hardis:fix:project",
12619
+ "v53flexipages:fix:hardis:project",
12620
+ "v53flexipages:fix:project:hardis"
12621
+ ]
12622
+ },
12623
12623
  "hardis:project:generate:bypass": {
12624
12624
  "aliases": [],
12625
12625
  "args": {},
@@ -15102,5 +15102,5 @@
15102
15102
  ]
15103
15103
  }
15104
15104
  },
15105
- "version": "6.0.7-beta202508231311.0"
15105
+ "version": "6.1.0"
15106
15106
  }