sfdx-hardis 6.5.5 → 6.6.1-alpha202510111519.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.
@@ -132,13 +132,12 @@
132
132
  "clear:cache:hardis"
133
133
  ]
134
134
  },
135
- "hardis:auth:login": {
135
+ "hardis:config:get": {
136
136
  "aliases": [],
137
137
  "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",
138
+ "description": "\n## Command Behavior\n\n**Retrieves and displays the sfdx-hardis configuration for a specified level.**\n\nThis command allows you to inspect the configuration that is currently in effect for your project, which is useful for debugging and understanding how sfdx-hardis will behave.\n\n- **Configuration levels:** It can retrieve configuration from three different levels:\n - **Project:** The configuration defined in the project's `.sfdx-hardis.yml` file.\n - **Branch:** The configuration defined in a branch-specific configuration file (e.g., `.sfdx-hardis.production.yml`).\n - **User:** The global user-level configuration.\n\n## Technical explanations\n\nThe command's logic is straightforward:\n\n- **`getConfig` function:** It calls the `getConfig` utility function, passing the desired configuration level as an argument.\n- **Configuration loading:** The `getConfig` function is responsible for finding the appropriate configuration file, reading its contents, and parsing it as YAML or JSON.\n- **Output:** The retrieved configuration is then displayed to the user as a JSON string.\n",
139
139
  "examples": [
140
- "$ sf hardis:auth:login",
141
- "CI=true sf hardis:auth:login"
140
+ "$ sf hardis:project:deploy:sources:metadata"
142
141
  ],
143
142
  "flags": {
144
143
  "json": {
@@ -156,28 +155,20 @@
156
155
  "multiple": false,
157
156
  "type": "option"
158
157
  },
159
- "instanceurl": {
160
- "char": "r",
161
- "description": "URL of org instance",
162
- "name": "instanceurl",
158
+ "level": {
159
+ "char": "l",
160
+ "description": "project,branch or user",
161
+ "name": "level",
162
+ "default": "project",
163
163
  "hasDynamicHelp": false,
164
164
  "multiple": false,
165
+ "options": [
166
+ "project",
167
+ "branch",
168
+ "user"
169
+ ],
165
170
  "type": "option"
166
171
  },
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
172
  "debug": {
182
173
  "char": "d",
183
174
  "description": "Activate debug mode (more logs)",
@@ -201,38 +192,39 @@
201
192
  },
202
193
  "hasDynamicHelp": false,
203
194
  "hiddenAliases": [],
204
- "id": "hardis:auth:login",
195
+ "id": "hardis:config:get",
205
196
  "pluginAlias": "sfdx-hardis",
206
197
  "pluginName": "sfdx-hardis",
207
198
  "pluginType": "core",
208
199
  "strict": true,
209
200
  "enableJsonFlag": true,
210
- "title": "Login",
201
+ "title": "Deploy metadata sources to org",
211
202
  "requiresProject": false,
212
203
  "isESM": true,
213
204
  "relativePath": [
214
205
  "lib",
215
206
  "commands",
216
207
  "hardis",
217
- "auth",
218
- "login.js"
208
+ "config",
209
+ "get.js"
219
210
  ],
220
211
  "aliasPermutations": [],
221
212
  "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"
213
+ "hardis:config:get",
214
+ "config:hardis:get",
215
+ "config:get:hardis",
216
+ "hardis:get:config",
217
+ "get:hardis:config",
218
+ "get:config:hardis"
228
219
  ]
229
220
  },
230
- "hardis:config:get": {
221
+ "hardis:auth:login": {
231
222
  "aliases": [],
232
223
  "args": {},
233
- "description": "\n## Command Behavior\n\n**Retrieves and displays the sfdx-hardis configuration for a specified level.**\n\nThis command allows you to inspect the configuration that is currently in effect for your project, which is useful for debugging and understanding how sfdx-hardis will behave.\n\n- **Configuration levels:** It can retrieve configuration from three different levels:\n - **Project:** The configuration defined in the project's `.sfdx-hardis.yml` file.\n - **Branch:** The configuration defined in a branch-specific configuration file (e.g., `.sfdx-hardis.production.yml`).\n - **User:** The global user-level configuration.\n\n## Technical explanations\n\nThe command's logic is straightforward:\n\n- **`getConfig` function:** It calls the `getConfig` utility function, passing the desired configuration level as an argument.\n- **Configuration loading:** The `getConfig` function is responsible for finding the appropriate configuration file, reading its contents, and parsing it as YAML or JSON.\n- **Output:** The retrieved configuration is then displayed to the user as a JSON string.\n",
224
+ "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",
234
225
  "examples": [
235
- "$ sf hardis:project:deploy:sources:metadata"
226
+ "$ sf hardis:auth:login",
227
+ "CI=true sf hardis:auth:login"
236
228
  ],
237
229
  "flags": {
238
230
  "json": {
@@ -250,20 +242,28 @@
250
242
  "multiple": false,
251
243
  "type": "option"
252
244
  },
253
- "level": {
254
- "char": "l",
255
- "description": "project,branch or user",
256
- "name": "level",
257
- "default": "project",
245
+ "instanceurl": {
246
+ "char": "r",
247
+ "description": "URL of org instance",
248
+ "name": "instanceurl",
258
249
  "hasDynamicHelp": false,
259
250
  "multiple": false,
260
- "options": [
261
- "project",
262
- "branch",
263
- "user"
264
- ],
265
251
  "type": "option"
266
252
  },
253
+ "devhub": {
254
+ "char": "h",
255
+ "description": "Also connect associated DevHub",
256
+ "name": "devhub",
257
+ "allowNo": false,
258
+ "type": "boolean"
259
+ },
260
+ "scratchorg": {
261
+ "char": "s",
262
+ "description": "Scratch org",
263
+ "name": "scratchorg",
264
+ "allowNo": false,
265
+ "type": "boolean"
266
+ },
267
267
  "debug": {
268
268
  "char": "d",
269
269
  "description": "Activate debug mode (more logs)",
@@ -287,30 +287,30 @@
287
287
  },
288
288
  "hasDynamicHelp": false,
289
289
  "hiddenAliases": [],
290
- "id": "hardis:config:get",
290
+ "id": "hardis:auth:login",
291
291
  "pluginAlias": "sfdx-hardis",
292
292
  "pluginName": "sfdx-hardis",
293
293
  "pluginType": "core",
294
294
  "strict": true,
295
295
  "enableJsonFlag": true,
296
- "title": "Deploy metadata sources to org",
296
+ "title": "Login",
297
297
  "requiresProject": false,
298
298
  "isESM": true,
299
299
  "relativePath": [
300
300
  "lib",
301
301
  "commands",
302
302
  "hardis",
303
- "config",
304
- "get.js"
303
+ "auth",
304
+ "login.js"
305
305
  ],
306
306
  "aliasPermutations": [],
307
307
  "permutations": [
308
- "hardis:config:get",
309
- "config:hardis:get",
310
- "config:get:hardis",
311
- "hardis:get:config",
312
- "get:hardis:config",
313
- "get:config:hardis"
308
+ "hardis:auth:login",
309
+ "auth:hardis:login",
310
+ "auth:login:hardis",
311
+ "hardis:login:auth",
312
+ "login:hardis:auth",
313
+ "login:auth:hardis"
314
314
  ]
315
315
  },
316
316
  "hardis:doc:fieldusage": {
@@ -4421,6 +4421,135 @@
4421
4421
  "ws:work:hardis"
4422
4422
  ]
4423
4423
  },
4424
+ "hardis:git:pull-requests:extract": {
4425
+ "aliases": [],
4426
+ "args": {},
4427
+ "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",
4428
+ "examples": [
4429
+ "$ sf hardis:git:pull-requests:extract",
4430
+ "$ sf hardis:git:pull-requests:extract --target-branch main --status merged"
4431
+ ],
4432
+ "flags": {
4433
+ "json": {
4434
+ "description": "Format output as json.",
4435
+ "helpGroup": "GLOBAL",
4436
+ "name": "json",
4437
+ "allowNo": false,
4438
+ "type": "boolean"
4439
+ },
4440
+ "flags-dir": {
4441
+ "helpGroup": "GLOBAL",
4442
+ "name": "flags-dir",
4443
+ "summary": "Import flag values from a directory.",
4444
+ "hasDynamicHelp": false,
4445
+ "multiple": false,
4446
+ "type": "option"
4447
+ },
4448
+ "target-branch": {
4449
+ "char": "t",
4450
+ "description": "Target branch of PRs",
4451
+ "name": "target-branch",
4452
+ "hasDynamicHelp": false,
4453
+ "multiple": false,
4454
+ "type": "option"
4455
+ },
4456
+ "status": {
4457
+ "char": "x",
4458
+ "description": "Status of the PR",
4459
+ "name": "status",
4460
+ "hasDynamicHelp": false,
4461
+ "multiple": false,
4462
+ "options": [
4463
+ "open",
4464
+ "merged",
4465
+ "abandoned"
4466
+ ],
4467
+ "type": "option"
4468
+ },
4469
+ "min-date": {
4470
+ "char": "m",
4471
+ "description": "Minimum date for PR",
4472
+ "name": "min-date",
4473
+ "hasDynamicHelp": false,
4474
+ "multiple": false,
4475
+ "type": "option"
4476
+ },
4477
+ "outputfile": {
4478
+ "char": "f",
4479
+ "description": "Force the path and name of output report file. Must end with .csv",
4480
+ "name": "outputfile",
4481
+ "hasDynamicHelp": false,
4482
+ "multiple": false,
4483
+ "type": "option"
4484
+ },
4485
+ "debug": {
4486
+ "char": "d",
4487
+ "description": "Activate debug mode (more logs)",
4488
+ "name": "debug",
4489
+ "allowNo": false,
4490
+ "type": "boolean"
4491
+ },
4492
+ "websocket": {
4493
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
4494
+ "name": "websocket",
4495
+ "hasDynamicHelp": false,
4496
+ "multiple": false,
4497
+ "type": "option"
4498
+ },
4499
+ "skipauth": {
4500
+ "description": "Skip authentication check when a default username is required",
4501
+ "name": "skipauth",
4502
+ "allowNo": false,
4503
+ "type": "boolean"
4504
+ }
4505
+ },
4506
+ "hasDynamicHelp": false,
4507
+ "hiddenAliases": [],
4508
+ "id": "hardis:git:pull-requests:extract",
4509
+ "pluginAlias": "sfdx-hardis",
4510
+ "pluginName": "sfdx-hardis",
4511
+ "pluginType": "core",
4512
+ "strict": true,
4513
+ "enableJsonFlag": true,
4514
+ "title": "Extract pull requests",
4515
+ "requiresProject": true,
4516
+ "isESM": true,
4517
+ "relativePath": [
4518
+ "lib",
4519
+ "commands",
4520
+ "hardis",
4521
+ "git",
4522
+ "pull-requests",
4523
+ "extract.js"
4524
+ ],
4525
+ "aliasPermutations": [],
4526
+ "permutations": [
4527
+ "hardis:git:pull-requests:extract",
4528
+ "git:hardis:pull-requests:extract",
4529
+ "git:pull-requests:hardis:extract",
4530
+ "git:pull-requests:extract:hardis",
4531
+ "hardis:pull-requests:git:extract",
4532
+ "pull-requests:hardis:git:extract",
4533
+ "pull-requests:git:hardis:extract",
4534
+ "pull-requests:git:extract:hardis",
4535
+ "hardis:pull-requests:extract:git",
4536
+ "pull-requests:hardis:extract:git",
4537
+ "pull-requests:extract:hardis:git",
4538
+ "pull-requests:extract:git:hardis",
4539
+ "hardis:git:extract:pull-requests",
4540
+ "git:hardis:extract:pull-requests",
4541
+ "git:extract:hardis:pull-requests",
4542
+ "git:extract:pull-requests:hardis",
4543
+ "hardis:extract:git:pull-requests",
4544
+ "extract:hardis:git:pull-requests",
4545
+ "extract:git:hardis:pull-requests",
4546
+ "extract:git:pull-requests:hardis",
4547
+ "hardis:extract:pull-requests:git",
4548
+ "extract:hardis:pull-requests:git",
4549
+ "extract:pull-requests:hardis:git",
4550
+ "extract:pull-requests:git:hardis"
4551
+ ]
4552
+ },
4424
4553
  "hardis:doc:extract:permsetgroups": {
4425
4554
  "aliases": [],
4426
4555
  "args": {},
@@ -4611,13 +4740,13 @@
4611
4740
  "generate:plugin:doc:hardis"
4612
4741
  ]
4613
4742
  },
4614
- "hardis:git:pull-requests:extract": {
4743
+ "hardis:org:community:update": {
4615
4744
  "aliases": [],
4616
4745
  "args": {},
4617
- "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",
4746
+ "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",
4618
4747
  "examples": [
4619
- "$ sf hardis:git:pull-requests:extract",
4620
- "$ sf hardis:git:pull-requests:extract --target-branch main --status merged"
4748
+ "$ sf hardis:org:community:update --name 'MyNetworkName' --status DownForMaintenance",
4749
+ "$ sf hardis:org:community:update --name 'MyNetworkName,MySecondNetworkName' --status Live"
4621
4750
  ],
4622
4751
  "flags": {
4623
4752
  "json": {
@@ -4635,140 +4764,11 @@
4635
4764
  "multiple": false,
4636
4765
  "type": "option"
4637
4766
  },
4638
- "target-branch": {
4639
- "char": "t",
4640
- "description": "Target branch of PRs",
4641
- "name": "target-branch",
4642
- "hasDynamicHelp": false,
4643
- "multiple": false,
4644
- "type": "option"
4645
- },
4646
- "status": {
4647
- "char": "x",
4648
- "description": "Status of the PR",
4649
- "name": "status",
4650
- "hasDynamicHelp": false,
4651
- "multiple": false,
4652
- "options": [
4653
- "open",
4654
- "merged",
4655
- "abandoned"
4656
- ],
4657
- "type": "option"
4658
- },
4659
- "min-date": {
4660
- "char": "m",
4661
- "description": "Minimum date for PR",
4662
- "name": "min-date",
4663
- "hasDynamicHelp": false,
4664
- "multiple": false,
4665
- "type": "option"
4666
- },
4667
- "outputfile": {
4668
- "char": "f",
4669
- "description": "Force the path and name of output report file. Must end with .csv",
4670
- "name": "outputfile",
4671
- "hasDynamicHelp": false,
4672
- "multiple": false,
4673
- "type": "option"
4674
- },
4675
- "debug": {
4676
- "char": "d",
4677
- "description": "Activate debug mode (more logs)",
4678
- "name": "debug",
4679
- "allowNo": false,
4680
- "type": "boolean"
4681
- },
4682
- "websocket": {
4683
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
4684
- "name": "websocket",
4685
- "hasDynamicHelp": false,
4686
- "multiple": false,
4687
- "type": "option"
4688
- },
4689
- "skipauth": {
4690
- "description": "Skip authentication check when a default username is required",
4691
- "name": "skipauth",
4692
- "allowNo": false,
4693
- "type": "boolean"
4694
- }
4695
- },
4696
- "hasDynamicHelp": false,
4697
- "hiddenAliases": [],
4698
- "id": "hardis:git:pull-requests:extract",
4699
- "pluginAlias": "sfdx-hardis",
4700
- "pluginName": "sfdx-hardis",
4701
- "pluginType": "core",
4702
- "strict": true,
4703
- "enableJsonFlag": true,
4704
- "title": "Extract pull requests",
4705
- "requiresProject": true,
4706
- "isESM": true,
4707
- "relativePath": [
4708
- "lib",
4709
- "commands",
4710
- "hardis",
4711
- "git",
4712
- "pull-requests",
4713
- "extract.js"
4714
- ],
4715
- "aliasPermutations": [],
4716
- "permutations": [
4717
- "hardis:git:pull-requests:extract",
4718
- "git:hardis:pull-requests:extract",
4719
- "git:pull-requests:hardis:extract",
4720
- "git:pull-requests:extract:hardis",
4721
- "hardis:pull-requests:git:extract",
4722
- "pull-requests:hardis:git:extract",
4723
- "pull-requests:git:hardis:extract",
4724
- "pull-requests:git:extract:hardis",
4725
- "hardis:pull-requests:extract:git",
4726
- "pull-requests:hardis:extract:git",
4727
- "pull-requests:extract:hardis:git",
4728
- "pull-requests:extract:git:hardis",
4729
- "hardis:git:extract:pull-requests",
4730
- "git:hardis:extract:pull-requests",
4731
- "git:extract:hardis:pull-requests",
4732
- "git:extract:pull-requests:hardis",
4733
- "hardis:extract:git:pull-requests",
4734
- "extract:hardis:git:pull-requests",
4735
- "extract:git:hardis:pull-requests",
4736
- "extract:git:pull-requests:hardis",
4737
- "hardis:extract:pull-requests:git",
4738
- "extract:hardis:pull-requests:git",
4739
- "extract:pull-requests:hardis:git",
4740
- "extract:pull-requests:git:hardis"
4741
- ]
4742
- },
4743
- "hardis:org:community:update": {
4744
- "aliases": [],
4745
- "args": {},
4746
- "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",
4747
- "examples": [
4748
- "$ sf hardis:org:community:update --name 'MyNetworkName' --status DownForMaintenance",
4749
- "$ sf hardis:org:community:update --name 'MyNetworkName,MySecondNetworkName' --status Live"
4750
- ],
4751
- "flags": {
4752
- "json": {
4753
- "description": "Format output as json.",
4754
- "helpGroup": "GLOBAL",
4755
- "name": "json",
4756
- "allowNo": false,
4757
- "type": "boolean"
4758
- },
4759
- "flags-dir": {
4760
- "helpGroup": "GLOBAL",
4761
- "name": "flags-dir",
4762
- "summary": "Import flag values from a directory.",
4763
- "hasDynamicHelp": false,
4764
- "multiple": false,
4765
- "type": "option"
4766
- },
4767
- "name": {
4768
- "char": "n",
4769
- "description": "List of Networks Names that you want to update, separated by comma",
4770
- "name": "name",
4771
- "required": true,
4767
+ "name": {
4768
+ "char": "n",
4769
+ "description": "List of Networks Names that you want to update, separated by comma",
4770
+ "name": "name",
4771
+ "required": true,
4772
4772
  "hasDynamicHelp": false,
4773
4773
  "multiple": false,
4774
4774
  "type": "option"
@@ -7070,13 +7070,14 @@
7070
7070
  "import:files:org:hardis"
7071
7071
  ]
7072
7072
  },
7073
- "hardis:org:fix:listviewmine": {
7073
+ "hardis:org:generate:packagexmlfull": {
7074
7074
  "aliases": [],
7075
7075
  "args": {},
7076
- "description": "Fix listviews whose scope Mine has been replaced by Everything\n\n[![Invalid scope:Mine, not allowed ? Deploy your ListViews anyway !](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-invalid-scope-mine.jpg)](https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7)\n\nList of ListViews can be:\n\n- read from .sfdx-hardis.yml file in property **listViewsToSetToMine**\n- sent in argument listviews\n\nNote: property **listViewsToSetToMine** can be auto-generated by command hardis:work:save if .sfdx-hardis.yml contains the following configuration\n\n```yaml\nautoCleanTypes:\n - listViewsMine\n```\n\n- Example of sfdx-hardis.yml property `listViewsToSetToMine`:\n\n```yaml\nlistViewsToSetToMine:\n - \"force-app/main/default/objects/Operation__c/listViews/MyCurrentOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Operation__c/listViews/MyFinalizedOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/Default_Opportunity_Pipeline.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MyCurrentSubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MySubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Account/listViews/MyActivePartners.listView-meta.xml\"\n```\n\n- If manually written, this could also be:\n\n```yaml\nlistViewsToSetToMine:\n - \"Operation__c:MyCurrentOperations\"\n - \"Operation__c:MyFinalizedOperations\"\n - \"Opportunity:Default_Opportunity_Pipeline\"\n - \"Opportunity:MyCurrentSubscriptions\"\n - \"Opportunity:MySubscriptions\"\n - \"Account:MyActivePartners\"\n```\n\nTroubleshooting: if you need to run this command from an alpine-linux based docker image, use this workaround in your dockerfile:\n\n```dockerfile\n# Do not use puppeteer embedded chromium\nRUN apk add --update --no-cache chromium\nENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=\"true\"\nENV CHROMIUM_PATH=\"/usr/bin/chromium-browser\"\nENV PUPPETEER_EXECUTABLE_PATH=\"$\\{CHROMIUM_PATH}\" // remove \\ before {\n```\n",
7076
+ "description": "\n## Command Behavior\n\n**Generates a comprehensive `package.xml` file for a Salesforce org, including all metadata components, even managed ones.**\n\nThis command is essential for various Salesforce development and administration tasks, especially when you need a complete snapshot of an org's metadata. It goes beyond typical source tracking by including managed package components, which is crucial for understanding the full metadata footprint of an org.\n\nKey functionalities:\n\n- **Full Org Metadata Retrieval:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a complete list of all metadata types and their members.\n- **Managed Package Inclusion:** Unlike standard source retrieval, this command explicitly includes metadata from managed packages, providing a truly comprehensive `package.xml`.\n- **Customizable Output:** Allows you to specify the output file path for the generated `package.xml`.\n- **Interactive Org Selection:** If no target org is specified, it interactively prompts the user to choose an org. (or use --no-prompt to skip this step)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce Metadata API Interaction:** It leverages the Salesforce Metadata API to list all available metadata types and then retrieve all components for each type.\n- **`buildOrgManifest` Utility:** The core logic for querying the org's metadata and constructing the `package.xml` is encapsulated within the `buildOrgManifest` utility function.\n- **XML Generation:** It dynamically builds the XML structure of the `package.xml` file, including the `types` and `members` elements for all retrieved metadata.\n- **File System Operations:** It writes the generated `package.xml` file to the specified output path.\n- **Interactive Prompts:** Uses `promptOrgUsernameDefault` to guide the user in selecting the target Salesforce org.\n</details>\n",
7077
7077
  "examples": [
7078
- "$ sf hardis:org:fix:listviewmine",
7079
- "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
7078
+ "$ sf hardis:org:generate:packagexmlfull",
7079
+ "$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
7080
+ "$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
7080
7081
  ],
7081
7082
  "flags": {
7082
7083
  "json": {
@@ -7094,10 +7095,9 @@
7094
7095
  "multiple": false,
7095
7096
  "type": "option"
7096
7097
  },
7097
- "listviews": {
7098
- "char": "l",
7099
- "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
7100
- "name": "listviews",
7098
+ "outputfile": {
7099
+ "description": "Output package.xml file",
7100
+ "name": "outputfile",
7101
7101
  "hasDynamicHelp": false,
7102
7102
  "multiple": false,
7103
7103
  "type": "option"
@@ -7109,6 +7109,13 @@
7109
7109
  "allowNo": false,
7110
7110
  "type": "boolean"
7111
7111
  },
7112
+ "no-prompt": {
7113
+ "char": "n",
7114
+ "description": "Do not prompt for org username, use the default one",
7115
+ "name": "no-prompt",
7116
+ "allowNo": false,
7117
+ "type": "boolean"
7118
+ },
7112
7119
  "websocket": {
7113
7120
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7114
7121
  "name": "websocket",
@@ -7140,59 +7147,58 @@
7140
7147
  },
7141
7148
  "hasDynamicHelp": true,
7142
7149
  "hiddenAliases": [],
7143
- "id": "hardis:org:fix:listviewmine",
7150
+ "id": "hardis:org:generate:packagexmlfull",
7144
7151
  "pluginAlias": "sfdx-hardis",
7145
7152
  "pluginName": "sfdx-hardis",
7146
7153
  "pluginType": "core",
7147
7154
  "strict": true,
7148
7155
  "enableJsonFlag": true,
7149
- "title": "Fix listviews with ",
7150
- "requiresProject": true,
7156
+ "title": "Generate Full Org package.xml",
7157
+ "requiresProject": false,
7151
7158
  "isESM": true,
7152
7159
  "relativePath": [
7153
7160
  "lib",
7154
7161
  "commands",
7155
7162
  "hardis",
7156
7163
  "org",
7157
- "fix",
7158
- "listviewmine.js"
7164
+ "generate",
7165
+ "packagexmlfull.js"
7159
7166
  ],
7160
7167
  "aliasPermutations": [],
7161
7168
  "permutations": [
7162
- "hardis:org:fix:listviewmine",
7163
- "org:hardis:fix:listviewmine",
7164
- "org:fix:hardis:listviewmine",
7165
- "org:fix:listviewmine:hardis",
7166
- "hardis:fix:org:listviewmine",
7167
- "fix:hardis:org:listviewmine",
7168
- "fix:org:hardis:listviewmine",
7169
- "fix:org:listviewmine:hardis",
7170
- "hardis:fix:listviewmine:org",
7171
- "fix:hardis:listviewmine:org",
7172
- "fix:listviewmine:hardis:org",
7173
- "fix:listviewmine:org:hardis",
7174
- "hardis:org:listviewmine:fix",
7175
- "org:hardis:listviewmine:fix",
7176
- "org:listviewmine:hardis:fix",
7177
- "org:listviewmine:fix:hardis",
7178
- "hardis:listviewmine:org:fix",
7179
- "listviewmine:hardis:org:fix",
7180
- "listviewmine:org:hardis:fix",
7181
- "listviewmine:org:fix:hardis",
7182
- "hardis:listviewmine:fix:org",
7183
- "listviewmine:hardis:fix:org",
7184
- "listviewmine:fix:hardis:org",
7185
- "listviewmine:fix:org:hardis"
7169
+ "hardis:org:generate:packagexmlfull",
7170
+ "org:hardis:generate:packagexmlfull",
7171
+ "org:generate:hardis:packagexmlfull",
7172
+ "org:generate:packagexmlfull:hardis",
7173
+ "hardis:generate:org:packagexmlfull",
7174
+ "generate:hardis:org:packagexmlfull",
7175
+ "generate:org:hardis:packagexmlfull",
7176
+ "generate:org:packagexmlfull:hardis",
7177
+ "hardis:generate:packagexmlfull:org",
7178
+ "generate:hardis:packagexmlfull:org",
7179
+ "generate:packagexmlfull:hardis:org",
7180
+ "generate:packagexmlfull:org:hardis",
7181
+ "hardis:org:packagexmlfull:generate",
7182
+ "org:hardis:packagexmlfull:generate",
7183
+ "org:packagexmlfull:hardis:generate",
7184
+ "org:packagexmlfull:generate:hardis",
7185
+ "hardis:packagexmlfull:org:generate",
7186
+ "packagexmlfull:hardis:org:generate",
7187
+ "packagexmlfull:org:hardis:generate",
7188
+ "packagexmlfull:org:generate:hardis",
7189
+ "hardis:packagexmlfull:generate:org",
7190
+ "packagexmlfull:hardis:generate:org",
7191
+ "packagexmlfull:generate:hardis:org",
7192
+ "packagexmlfull:generate:org:hardis"
7186
7193
  ]
7187
7194
  },
7188
- "hardis:org:generate:packagexmlfull": {
7195
+ "hardis:org:fix:listviewmine": {
7189
7196
  "aliases": [],
7190
7197
  "args": {},
7191
- "description": "\n## Command Behavior\n\n**Generates a comprehensive `package.xml` file for a Salesforce org, including all metadata components, even managed ones.**\n\nThis command is essential for various Salesforce development and administration tasks, especially when you need a complete snapshot of an org's metadata. It goes beyond typical source tracking by including managed package components, which is crucial for understanding the full metadata footprint of an org.\n\nKey functionalities:\n\n- **Full Org Metadata Retrieval:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a complete list of all metadata types and their members.\n- **Managed Package Inclusion:** Unlike standard source retrieval, this command explicitly includes metadata from managed packages, providing a truly comprehensive `package.xml`.\n- **Customizable Output:** Allows you to specify the output file path for the generated `package.xml`.\n- **Interactive Org Selection:** If no target org is specified, it interactively prompts the user to choose an org. (or use --no-prompt to skip this step)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce Metadata API Interaction:** It leverages the Salesforce Metadata API to list all available metadata types and then retrieve all components for each type.\n- **`buildOrgManifest` Utility:** The core logic for querying the org's metadata and constructing the `package.xml` is encapsulated within the `buildOrgManifest` utility function.\n- **XML Generation:** It dynamically builds the XML structure of the `package.xml` file, including the `types` and `members` elements for all retrieved metadata.\n- **File System Operations:** It writes the generated `package.xml` file to the specified output path.\n- **Interactive Prompts:** Uses `promptOrgUsernameDefault` to guide the user in selecting the target Salesforce org.\n</details>\n",
7198
+ "description": "Fix listviews whose scope Mine has been replaced by Everything\n\n[![Invalid scope:Mine, not allowed ? Deploy your ListViews anyway !](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-invalid-scope-mine.jpg)](https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7)\n\nList of ListViews can be:\n\n- read from .sfdx-hardis.yml file in property **listViewsToSetToMine**\n- sent in argument listviews\n\nNote: property **listViewsToSetToMine** can be auto-generated by command hardis:work:save if .sfdx-hardis.yml contains the following configuration\n\n```yaml\nautoCleanTypes:\n - listViewsMine\n```\n\n- Example of sfdx-hardis.yml property `listViewsToSetToMine`:\n\n```yaml\nlistViewsToSetToMine:\n - \"force-app/main/default/objects/Operation__c/listViews/MyCurrentOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Operation__c/listViews/MyFinalizedOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/Default_Opportunity_Pipeline.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MyCurrentSubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MySubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Account/listViews/MyActivePartners.listView-meta.xml\"\n```\n\n- If manually written, this could also be:\n\n```yaml\nlistViewsToSetToMine:\n - \"Operation__c:MyCurrentOperations\"\n - \"Operation__c:MyFinalizedOperations\"\n - \"Opportunity:Default_Opportunity_Pipeline\"\n - \"Opportunity:MyCurrentSubscriptions\"\n - \"Opportunity:MySubscriptions\"\n - \"Account:MyActivePartners\"\n```\n\nTroubleshooting: if you need to run this command from an alpine-linux based docker image, use this workaround in your dockerfile:\n\n```dockerfile\n# Do not use puppeteer embedded chromium\nRUN apk add --update --no-cache chromium\nENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=\"true\"\nENV CHROMIUM_PATH=\"/usr/bin/chromium-browser\"\nENV PUPPETEER_EXECUTABLE_PATH=\"$\\{CHROMIUM_PATH}\" // remove \\ before {\n```\n",
7192
7199
  "examples": [
7193
- "$ sf hardis:org:generate:packagexmlfull",
7194
- "$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
7195
- "$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
7200
+ "$ sf hardis:org:fix:listviewmine",
7201
+ "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
7196
7202
  ],
7197
7203
  "flags": {
7198
7204
  "json": {
@@ -7210,9 +7216,10 @@
7210
7216
  "multiple": false,
7211
7217
  "type": "option"
7212
7218
  },
7213
- "outputfile": {
7214
- "description": "Output package.xml file",
7215
- "name": "outputfile",
7219
+ "listviews": {
7220
+ "char": "l",
7221
+ "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
7222
+ "name": "listviews",
7216
7223
  "hasDynamicHelp": false,
7217
7224
  "multiple": false,
7218
7225
  "type": "option"
@@ -7224,13 +7231,6 @@
7224
7231
  "allowNo": false,
7225
7232
  "type": "boolean"
7226
7233
  },
7227
- "no-prompt": {
7228
- "char": "n",
7229
- "description": "Do not prompt for org username, use the default one",
7230
- "name": "no-prompt",
7231
- "allowNo": false,
7232
- "type": "boolean"
7233
- },
7234
7234
  "websocket": {
7235
7235
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7236
7236
  "name": "websocket",
@@ -7262,49 +7262,49 @@
7262
7262
  },
7263
7263
  "hasDynamicHelp": true,
7264
7264
  "hiddenAliases": [],
7265
- "id": "hardis:org:generate:packagexmlfull",
7265
+ "id": "hardis:org:fix:listviewmine",
7266
7266
  "pluginAlias": "sfdx-hardis",
7267
7267
  "pluginName": "sfdx-hardis",
7268
7268
  "pluginType": "core",
7269
7269
  "strict": true,
7270
7270
  "enableJsonFlag": true,
7271
- "title": "Generate Full Org package.xml",
7272
- "requiresProject": false,
7271
+ "title": "Fix listviews with ",
7272
+ "requiresProject": true,
7273
7273
  "isESM": true,
7274
7274
  "relativePath": [
7275
7275
  "lib",
7276
7276
  "commands",
7277
7277
  "hardis",
7278
7278
  "org",
7279
- "generate",
7280
- "packagexmlfull.js"
7279
+ "fix",
7280
+ "listviewmine.js"
7281
7281
  ],
7282
7282
  "aliasPermutations": [],
7283
7283
  "permutations": [
7284
- "hardis:org:generate:packagexmlfull",
7285
- "org:hardis:generate:packagexmlfull",
7286
- "org:generate:hardis:packagexmlfull",
7287
- "org:generate:packagexmlfull:hardis",
7288
- "hardis:generate:org:packagexmlfull",
7289
- "generate:hardis:org:packagexmlfull",
7290
- "generate:org:hardis:packagexmlfull",
7291
- "generate:org:packagexmlfull:hardis",
7292
- "hardis:generate:packagexmlfull:org",
7293
- "generate:hardis:packagexmlfull:org",
7294
- "generate:packagexmlfull:hardis:org",
7295
- "generate:packagexmlfull:org:hardis",
7296
- "hardis:org:packagexmlfull:generate",
7297
- "org:hardis:packagexmlfull:generate",
7298
- "org:packagexmlfull:hardis:generate",
7299
- "org:packagexmlfull:generate:hardis",
7300
- "hardis:packagexmlfull:org:generate",
7301
- "packagexmlfull:hardis:org:generate",
7302
- "packagexmlfull:org:hardis:generate",
7303
- "packagexmlfull:org:generate:hardis",
7304
- "hardis:packagexmlfull:generate:org",
7305
- "packagexmlfull:hardis:generate:org",
7306
- "packagexmlfull:generate:hardis:org",
7307
- "packagexmlfull:generate:org:hardis"
7284
+ "hardis:org:fix:listviewmine",
7285
+ "org:hardis:fix:listviewmine",
7286
+ "org:fix:hardis:listviewmine",
7287
+ "org:fix:listviewmine:hardis",
7288
+ "hardis:fix:org:listviewmine",
7289
+ "fix:hardis:org:listviewmine",
7290
+ "fix:org:hardis:listviewmine",
7291
+ "fix:org:listviewmine:hardis",
7292
+ "hardis:fix:listviewmine:org",
7293
+ "fix:hardis:listviewmine:org",
7294
+ "fix:listviewmine:hardis:org",
7295
+ "fix:listviewmine:org:hardis",
7296
+ "hardis:org:listviewmine:fix",
7297
+ "org:hardis:listviewmine:fix",
7298
+ "org:listviewmine:hardis:fix",
7299
+ "org:listviewmine:fix:hardis",
7300
+ "hardis:listviewmine:org:fix",
7301
+ "listviewmine:hardis:org:fix",
7302
+ "listviewmine:org:hardis:fix",
7303
+ "listviewmine:org:fix:hardis",
7304
+ "hardis:listviewmine:fix:org",
7305
+ "listviewmine:hardis:fix:org",
7306
+ "listviewmine:fix:hardis:org",
7307
+ "listviewmine:fix:org:hardis"
7308
7308
  ]
7309
7309
  },
7310
7310
  "hardis:org:monitor:all": {
@@ -7788,16 +7788,13 @@
7788
7788
  "limits:monitor:org:hardis"
7789
7789
  ]
7790
7790
  },
7791
- "hardis:org:refresh:after-refresh": {
7791
+ "hardis:org:purge:apexlog": {
7792
7792
  "aliases": [],
7793
7793
  "args": {},
7794
- "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",
7794
+ "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",
7795
7795
  "examples": [
7796
- "$ sf hardis:org:refresh:after-refresh",
7797
- "$ sf hardis:org:refresh:after-refresh --name \"MyConnectedApp\" // Process specific app, no selection prompt",
7798
- "$ sf hardis:org:refresh:after-refresh --name \"App1,App2,App3\" // Process multiple apps, no selection prompt",
7799
- "$ sf hardis:org:refresh:after-refresh --all // Process all apps, no selection prompt",
7800
- "$ sf hardis:org:refresh:after-refresh --target-org myDevOrg"
7796
+ "$ sf hardis:org:purge:apexlog",
7797
+ "$ sf hardis:org:purge:apexlog --target-org nicolas.vuillamy@gmail.com"
7801
7798
  ],
7802
7799
  "flags": {
7803
7800
  "json": {
@@ -7815,37 +7812,23 @@
7815
7812
  "multiple": false,
7816
7813
  "type": "option"
7817
7814
  },
7818
- "target-org": {
7819
- "char": "o",
7820
- "name": "target-org",
7821
- "noCacheDefault": true,
7822
- "required": true,
7823
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7824
- "hasDynamicHelp": true,
7825
- "multiple": false,
7826
- "type": "option"
7827
- },
7828
- "name": {
7829
- "char": "n",
7830
- "description": "Connected App name(s) to process (bypasses selection prompt). For multiple apps, separate with commas (e.g., \"App1,App2\")",
7831
- "name": "name",
7832
- "summary": "Filter according to Name criteria",
7833
- "hasDynamicHelp": false,
7834
- "multiple": false,
7835
- "type": "option"
7815
+ "prompt": {
7816
+ "char": "z",
7817
+ "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
7818
+ "name": "prompt",
7819
+ "allowNo": true,
7820
+ "type": "boolean"
7836
7821
  },
7837
- "all": {
7838
- "char": "a",
7839
- "description": "If set, all Connected Apps from the local repository will be processed. Takes precedence over --name if both are specified.",
7840
- "name": "all",
7841
- "summary": "Process all Connected Apps without selection prompt",
7822
+ "debug": {
7823
+ "char": "d",
7824
+ "description": "Activate debug mode (more logs)",
7825
+ "name": "debug",
7842
7826
  "allowNo": false,
7843
7827
  "type": "boolean"
7844
7828
  },
7845
7829
  "websocket": {
7846
7830
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7847
7831
  "name": "websocket",
7848
- "summary": "Websocket host:port for VsCode SFDX Hardis UI integration",
7849
7832
  "hasDynamicHelp": false,
7850
7833
  "multiple": false,
7851
7834
  "type": "option"
@@ -7853,68 +7836,80 @@
7853
7836
  "skipauth": {
7854
7837
  "description": "Skip authentication check when a default username is required",
7855
7838
  "name": "skipauth",
7856
- "summary": "Skip authentication check when a default username is required",
7857
7839
  "allowNo": false,
7858
7840
  "type": "boolean"
7841
+ },
7842
+ "target-org": {
7843
+ "aliases": [
7844
+ "targetusername",
7845
+ "u"
7846
+ ],
7847
+ "char": "o",
7848
+ "deprecateAliases": true,
7849
+ "name": "target-org",
7850
+ "noCacheDefault": true,
7851
+ "required": true,
7852
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7853
+ "hasDynamicHelp": true,
7854
+ "multiple": false,
7855
+ "type": "option"
7859
7856
  }
7860
7857
  },
7861
7858
  "hasDynamicHelp": true,
7862
7859
  "hiddenAliases": [],
7863
- "id": "hardis:org:refresh:after-refresh",
7860
+ "id": "hardis:org:purge:apexlog",
7864
7861
  "pluginAlias": "sfdx-hardis",
7865
7862
  "pluginName": "sfdx-hardis",
7866
7863
  "pluginType": "core",
7867
7864
  "strict": true,
7868
7865
  "enableJsonFlag": true,
7869
- "title": "Restore Connected Apps after org refresh",
7870
- "requiresProject": true,
7866
+ "title": "Purge Apex Logs",
7867
+ "requiresProject": false,
7871
7868
  "isESM": true,
7872
7869
  "relativePath": [
7873
7870
  "lib",
7874
7871
  "commands",
7875
7872
  "hardis",
7876
7873
  "org",
7877
- "refresh",
7878
- "after-refresh.js"
7874
+ "purge",
7875
+ "apexlog.js"
7879
7876
  ],
7880
7877
  "aliasPermutations": [],
7881
7878
  "permutations": [
7882
- "hardis:org:refresh:after-refresh",
7883
- "org:hardis:refresh:after-refresh",
7884
- "org:refresh:hardis:after-refresh",
7885
- "org:refresh:after-refresh:hardis",
7886
- "hardis:refresh:org:after-refresh",
7887
- "refresh:hardis:org:after-refresh",
7888
- "refresh:org:hardis:after-refresh",
7889
- "refresh:org:after-refresh:hardis",
7890
- "hardis:refresh:after-refresh:org",
7891
- "refresh:hardis:after-refresh:org",
7892
- "refresh:after-refresh:hardis:org",
7893
- "refresh:after-refresh:org:hardis",
7894
- "hardis:org:after-refresh:refresh",
7895
- "org:hardis:after-refresh:refresh",
7896
- "org:after-refresh:hardis:refresh",
7897
- "org:after-refresh:refresh:hardis",
7898
- "hardis:after-refresh:org:refresh",
7899
- "after-refresh:hardis:org:refresh",
7900
- "after-refresh:org:hardis:refresh",
7901
- "after-refresh:org:refresh:hardis",
7902
- "hardis:after-refresh:refresh:org",
7903
- "after-refresh:hardis:refresh:org",
7904
- "after-refresh:refresh:hardis:org",
7905
- "after-refresh:refresh:org:hardis"
7879
+ "hardis:org:purge:apexlog",
7880
+ "org:hardis:purge:apexlog",
7881
+ "org:purge:hardis:apexlog",
7882
+ "org:purge:apexlog:hardis",
7883
+ "hardis:purge:org:apexlog",
7884
+ "purge:hardis:org:apexlog",
7885
+ "purge:org:hardis:apexlog",
7886
+ "purge:org:apexlog:hardis",
7887
+ "hardis:purge:apexlog:org",
7888
+ "purge:hardis:apexlog:org",
7889
+ "purge:apexlog:hardis:org",
7890
+ "purge:apexlog:org:hardis",
7891
+ "hardis:org:apexlog:purge",
7892
+ "org:hardis:apexlog:purge",
7893
+ "org:apexlog:hardis:purge",
7894
+ "org:apexlog:purge:hardis",
7895
+ "hardis:apexlog:org:purge",
7896
+ "apexlog:hardis:org:purge",
7897
+ "apexlog:org:hardis:purge",
7898
+ "apexlog:org:purge:hardis",
7899
+ "hardis:apexlog:purge:org",
7900
+ "apexlog:hardis:purge:org",
7901
+ "apexlog:purge:hardis:org",
7902
+ "apexlog:purge:org:hardis"
7906
7903
  ]
7907
7904
  },
7908
- "hardis:org:refresh:before-refresh": {
7905
+ "hardis:org:purge:flow": {
7909
7906
  "aliases": [],
7910
7907
  "args": {},
7911
- "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",
7908
+ "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",
7912
7909
  "examples": [
7913
- "$ sf hardis:org:refresh:before-refresh",
7914
- "$ sf hardis:org:refresh:before-refresh --name \"MyConnectedApp\"",
7915
- "$ sf hardis:org:refresh:before-refresh --name \"App1,App2,App3\"",
7916
- "$ sf hardis:org:refresh:before-refresh --all",
7917
- "$ sf hardis:org:refresh:before-refresh --delete"
7910
+ "$ sf hardis:org:purge:flow",
7911
+ "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --no-prompt --delete-flow-interviews",
7912
+ "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --status \"Obsolete,Draft,InvalidDraft\" --name TestFlow"
7918
7913
  ],
7919
7914
  "flags": {
7920
7915
  "json": {
@@ -7932,38 +7927,56 @@
7932
7927
  "multiple": false,
7933
7928
  "type": "option"
7934
7929
  },
7935
- "target-org": {
7936
- "char": "o",
7937
- "name": "target-org",
7938
- "noCacheDefault": true,
7939
- "required": true,
7940
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7941
- "hasDynamicHelp": true,
7930
+ "prompt": {
7931
+ "char": "z",
7932
+ "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
7933
+ "name": "prompt",
7934
+ "allowNo": true,
7935
+ "type": "boolean"
7936
+ },
7937
+ "name": {
7938
+ "char": "n",
7939
+ "description": "Filter according to Name criteria",
7940
+ "name": "name",
7941
+ "hasDynamicHelp": false,
7942
7942
  "multiple": false,
7943
7943
  "type": "option"
7944
7944
  },
7945
- "delete": {
7946
- "char": "d",
7947
- "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.",
7948
- "name": "delete",
7949
- "summary": "Delete Connected Apps from org after saving",
7945
+ "status": {
7946
+ "char": "s",
7947
+ "description": "Filter according to Status criteria",
7948
+ "name": "status",
7949
+ "hasDynamicHelp": false,
7950
+ "multiple": false,
7951
+ "type": "option"
7952
+ },
7953
+ "delete-flow-interviews": {
7954
+ "char": "w",
7955
+ "description": "If the presence of Flow interviews prevent to delete flows versions, delete them before retrying to delete flow versions",
7956
+ "name": "delete-flow-interviews",
7950
7957
  "allowNo": false,
7951
7958
  "type": "boolean"
7952
7959
  },
7953
- "name": {
7954
- "char": "n",
7955
- "description": "Connected App name(s) to process. For multiple apps, separate with commas (e.g., \"App1,App2\")",
7956
- "name": "name",
7957
- "summary": "Filter according to Name criteria",
7960
+ "allowpurgefailure": {
7961
+ "char": "f",
7962
+ "description": "Allows purges to fail without exiting with 1. Use --no-allowpurgefailure to disable",
7963
+ "name": "allowpurgefailure",
7964
+ "allowNo": true,
7965
+ "type": "boolean"
7966
+ },
7967
+ "instanceurl": {
7968
+ "char": "r",
7969
+ "description": "URL of org instance",
7970
+ "name": "instanceurl",
7971
+ "default": "https://login.salesforce.com",
7958
7972
  "hasDynamicHelp": false,
7959
7973
  "multiple": false,
7960
7974
  "type": "option"
7961
7975
  },
7962
- "all": {
7963
- "char": "a",
7964
- "description": "If set, all Connected Apps from the org will be processed. Takes precedence over --name if both are specified.",
7965
- "name": "all",
7966
- "summary": "Process all Connected Apps without selection prompt",
7976
+ "debug": {
7977
+ "char": "d",
7978
+ "description": "Activate debug mode (more logs)",
7979
+ "name": "debug",
7967
7980
  "allowNo": false,
7968
7981
  "type": "boolean"
7969
7982
  },
@@ -7979,61 +7992,80 @@
7979
7992
  "name": "skipauth",
7980
7993
  "allowNo": false,
7981
7994
  "type": "boolean"
7995
+ },
7996
+ "target-org": {
7997
+ "aliases": [
7998
+ "targetusername",
7999
+ "u"
8000
+ ],
8001
+ "char": "o",
8002
+ "deprecateAliases": true,
8003
+ "name": "target-org",
8004
+ "noCacheDefault": true,
8005
+ "required": true,
8006
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8007
+ "hasDynamicHelp": true,
8008
+ "multiple": false,
8009
+ "type": "option"
7982
8010
  }
7983
8011
  },
7984
8012
  "hasDynamicHelp": true,
7985
8013
  "hiddenAliases": [],
7986
- "id": "hardis:org:refresh:before-refresh",
8014
+ "id": "hardis:org:purge:flow",
7987
8015
  "pluginAlias": "sfdx-hardis",
7988
8016
  "pluginName": "sfdx-hardis",
7989
8017
  "pluginType": "core",
7990
8018
  "strict": true,
7991
8019
  "enableJsonFlag": true,
7992
- "requiresProject": true,
8020
+ "title": "Purge Flow versions",
8021
+ "requiresProject": false,
7993
8022
  "isESM": true,
7994
8023
  "relativePath": [
7995
8024
  "lib",
7996
8025
  "commands",
7997
8026
  "hardis",
7998
8027
  "org",
7999
- "refresh",
8000
- "before-refresh.js"
8028
+ "purge",
8029
+ "flow.js"
8001
8030
  ],
8002
8031
  "aliasPermutations": [],
8003
8032
  "permutations": [
8004
- "hardis:org:refresh:before-refresh",
8005
- "org:hardis:refresh:before-refresh",
8006
- "org:refresh:hardis:before-refresh",
8007
- "org:refresh:before-refresh:hardis",
8008
- "hardis:refresh:org:before-refresh",
8009
- "refresh:hardis:org:before-refresh",
8010
- "refresh:org:hardis:before-refresh",
8011
- "refresh:org:before-refresh:hardis",
8012
- "hardis:refresh:before-refresh:org",
8013
- "refresh:hardis:before-refresh:org",
8014
- "refresh:before-refresh:hardis:org",
8015
- "refresh:before-refresh:org:hardis",
8016
- "hardis:org:before-refresh:refresh",
8017
- "org:hardis:before-refresh:refresh",
8018
- "org:before-refresh:hardis:refresh",
8019
- "org:before-refresh:refresh:hardis",
8020
- "hardis:before-refresh:org:refresh",
8021
- "before-refresh:hardis:org:refresh",
8022
- "before-refresh:org:hardis:refresh",
8023
- "before-refresh:org:refresh:hardis",
8024
- "hardis:before-refresh:refresh:org",
8025
- "before-refresh:hardis:refresh:org",
8026
- "before-refresh:refresh:hardis:org",
8027
- "before-refresh:refresh:org:hardis"
8033
+ "hardis:org:purge:flow",
8034
+ "org:hardis:purge:flow",
8035
+ "org:purge:hardis:flow",
8036
+ "org:purge:flow:hardis",
8037
+ "hardis:purge:org:flow",
8038
+ "purge:hardis:org:flow",
8039
+ "purge:org:hardis:flow",
8040
+ "purge:org:flow:hardis",
8041
+ "hardis:purge:flow:org",
8042
+ "purge:hardis:flow:org",
8043
+ "purge:flow:hardis:org",
8044
+ "purge:flow:org:hardis",
8045
+ "hardis:org:flow:purge",
8046
+ "org:hardis:flow:purge",
8047
+ "org:flow:hardis:purge",
8048
+ "org:flow:purge:hardis",
8049
+ "hardis:flow:org:purge",
8050
+ "flow:hardis:org:purge",
8051
+ "flow:org:hardis:purge",
8052
+ "flow:org:purge:hardis",
8053
+ "hardis:flow:purge:org",
8054
+ "flow:hardis:purge:org",
8055
+ "flow:purge:hardis:org",
8056
+ "flow:purge:org:hardis"
8028
8057
  ]
8029
8058
  },
8030
- "hardis:org:retrieve:packageconfig": {
8059
+ "hardis:org:refresh:after-refresh": {
8031
8060
  "aliases": [],
8032
8061
  "args": {},
8033
- "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",
8062
+ "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",
8034
8063
  "examples": [
8035
- "$ sf hardis:org:retrieve:packageconfig",
8036
- "sf hardis:org:retrieve:packageconfig -u myOrg"
8064
+ "$ sf hardis:org:refresh:after-refresh",
8065
+ "$ sf hardis:org:refresh:after-refresh --name \"MyConnectedApp\" // Process specific app, no selection prompt",
8066
+ "$ sf hardis:org:refresh:after-refresh --name \"App1,App2,App3\" // Process multiple apps, no selection prompt",
8067
+ "$ sf hardis:org:refresh:after-refresh --all // Process all apps, no selection prompt",
8068
+ "$ sf hardis:org:refresh:after-refresh --target-org myDevOrg"
8037
8069
  ],
8038
8070
  "flags": {
8039
8071
  "json": {
@@ -8051,16 +8083,37 @@
8051
8083
  "multiple": false,
8052
8084
  "type": "option"
8053
8085
  },
8054
- "debug": {
8055
- "char": "d",
8056
- "description": "Activate debug mode (more logs)",
8057
- "name": "debug",
8086
+ "target-org": {
8087
+ "char": "o",
8088
+ "name": "target-org",
8089
+ "noCacheDefault": true,
8090
+ "required": true,
8091
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8092
+ "hasDynamicHelp": true,
8093
+ "multiple": false,
8094
+ "type": "option"
8095
+ },
8096
+ "name": {
8097
+ "char": "n",
8098
+ "description": "Connected App name(s) to process (bypasses selection prompt). For multiple apps, separate with commas (e.g., \"App1,App2\")",
8099
+ "name": "name",
8100
+ "summary": "Filter according to Name criteria",
8101
+ "hasDynamicHelp": false,
8102
+ "multiple": false,
8103
+ "type": "option"
8104
+ },
8105
+ "all": {
8106
+ "char": "a",
8107
+ "description": "If set, all Connected Apps from the local repository will be processed. Takes precedence over --name if both are specified.",
8108
+ "name": "all",
8109
+ "summary": "Process all Connected Apps without selection prompt",
8058
8110
  "allowNo": false,
8059
8111
  "type": "boolean"
8060
8112
  },
8061
8113
  "websocket": {
8062
8114
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
8063
8115
  "name": "websocket",
8116
+ "summary": "Websocket host:port for VsCode SFDX Hardis UI integration",
8064
8117
  "hasDynamicHelp": false,
8065
8118
  "multiple": false,
8066
8119
  "type": "option"
@@ -8068,79 +8121,68 @@
8068
8121
  "skipauth": {
8069
8122
  "description": "Skip authentication check when a default username is required",
8070
8123
  "name": "skipauth",
8124
+ "summary": "Skip authentication check when a default username is required",
8071
8125
  "allowNo": false,
8072
8126
  "type": "boolean"
8073
- },
8074
- "target-org": {
8075
- "aliases": [
8076
- "targetusername",
8077
- "u"
8078
- ],
8079
- "char": "o",
8080
- "deprecateAliases": true,
8081
- "name": "target-org",
8082
- "noCacheDefault": true,
8083
- "required": true,
8084
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8085
- "hasDynamicHelp": true,
8086
- "multiple": false,
8087
- "type": "option"
8088
8127
  }
8089
8128
  },
8090
8129
  "hasDynamicHelp": true,
8091
8130
  "hiddenAliases": [],
8092
- "id": "hardis:org:retrieve:packageconfig",
8131
+ "id": "hardis:org:refresh:after-refresh",
8093
8132
  "pluginAlias": "sfdx-hardis",
8094
8133
  "pluginName": "sfdx-hardis",
8095
8134
  "pluginType": "core",
8096
8135
  "strict": true,
8097
8136
  "enableJsonFlag": true,
8098
- "title": "Retrieve package configuration from an org",
8099
- "requiresProject": false,
8137
+ "title": "Restore Connected Apps after org refresh",
8138
+ "requiresProject": true,
8100
8139
  "isESM": true,
8101
8140
  "relativePath": [
8102
8141
  "lib",
8103
8142
  "commands",
8104
8143
  "hardis",
8105
8144
  "org",
8106
- "retrieve",
8107
- "packageconfig.js"
8145
+ "refresh",
8146
+ "after-refresh.js"
8108
8147
  ],
8109
8148
  "aliasPermutations": [],
8110
8149
  "permutations": [
8111
- "hardis:org:retrieve:packageconfig",
8112
- "org:hardis:retrieve:packageconfig",
8113
- "org:retrieve:hardis:packageconfig",
8114
- "org:retrieve:packageconfig:hardis",
8115
- "hardis:retrieve:org:packageconfig",
8116
- "retrieve:hardis:org:packageconfig",
8117
- "retrieve:org:hardis:packageconfig",
8118
- "retrieve:org:packageconfig:hardis",
8119
- "hardis:retrieve:packageconfig:org",
8120
- "retrieve:hardis:packageconfig:org",
8121
- "retrieve:packageconfig:hardis:org",
8122
- "retrieve:packageconfig:org:hardis",
8123
- "hardis:org:packageconfig:retrieve",
8124
- "org:hardis:packageconfig:retrieve",
8125
- "org:packageconfig:hardis:retrieve",
8126
- "org:packageconfig:retrieve:hardis",
8127
- "hardis:packageconfig:org:retrieve",
8128
- "packageconfig:hardis:org:retrieve",
8129
- "packageconfig:org:hardis:retrieve",
8130
- "packageconfig:org:retrieve:hardis",
8131
- "hardis:packageconfig:retrieve:org",
8132
- "packageconfig:hardis:retrieve:org",
8133
- "packageconfig:retrieve:hardis:org",
8134
- "packageconfig:retrieve:org:hardis"
8150
+ "hardis:org:refresh:after-refresh",
8151
+ "org:hardis:refresh:after-refresh",
8152
+ "org:refresh:hardis:after-refresh",
8153
+ "org:refresh:after-refresh:hardis",
8154
+ "hardis:refresh:org:after-refresh",
8155
+ "refresh:hardis:org:after-refresh",
8156
+ "refresh:org:hardis:after-refresh",
8157
+ "refresh:org:after-refresh:hardis",
8158
+ "hardis:refresh:after-refresh:org",
8159
+ "refresh:hardis:after-refresh:org",
8160
+ "refresh:after-refresh:hardis:org",
8161
+ "refresh:after-refresh:org:hardis",
8162
+ "hardis:org:after-refresh:refresh",
8163
+ "org:hardis:after-refresh:refresh",
8164
+ "org:after-refresh:hardis:refresh",
8165
+ "org:after-refresh:refresh:hardis",
8166
+ "hardis:after-refresh:org:refresh",
8167
+ "after-refresh:hardis:org:refresh",
8168
+ "after-refresh:org:hardis:refresh",
8169
+ "after-refresh:org:refresh:hardis",
8170
+ "hardis:after-refresh:refresh:org",
8171
+ "after-refresh:hardis:refresh:org",
8172
+ "after-refresh:refresh:hardis:org",
8173
+ "after-refresh:refresh:org:hardis"
8135
8174
  ]
8136
8175
  },
8137
- "hardis:org:purge:apexlog": {
8176
+ "hardis:org:refresh:before-refresh": {
8138
8177
  "aliases": [],
8139
8178
  "args": {},
8140
- "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",
8179
+ "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",
8141
8180
  "examples": [
8142
- "$ sf hardis:org:purge:apexlog",
8143
- "$ sf hardis:org:purge:apexlog --target-org nicolas.vuillamy@gmail.com"
8181
+ "$ sf hardis:org:refresh:before-refresh",
8182
+ "$ sf hardis:org:refresh:before-refresh --name \"MyConnectedApp\"",
8183
+ "$ sf hardis:org:refresh:before-refresh --name \"App1,App2,App3\"",
8184
+ "$ sf hardis:org:refresh:before-refresh --all",
8185
+ "$ sf hardis:org:refresh:before-refresh --delete"
8144
8186
  ],
8145
8187
  "flags": {
8146
8188
  "json": {
@@ -8158,17 +8200,38 @@
8158
8200
  "multiple": false,
8159
8201
  "type": "option"
8160
8202
  },
8161
- "prompt": {
8162
- "char": "z",
8163
- "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
8164
- "name": "prompt",
8165
- "allowNo": true,
8203
+ "target-org": {
8204
+ "char": "o",
8205
+ "name": "target-org",
8206
+ "noCacheDefault": true,
8207
+ "required": true,
8208
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8209
+ "hasDynamicHelp": true,
8210
+ "multiple": false,
8211
+ "type": "option"
8212
+ },
8213
+ "delete": {
8214
+ "char": "d",
8215
+ "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.",
8216
+ "name": "delete",
8217
+ "summary": "Delete Connected Apps from org after saving",
8218
+ "allowNo": false,
8166
8219
  "type": "boolean"
8167
8220
  },
8168
- "debug": {
8169
- "char": "d",
8170
- "description": "Activate debug mode (more logs)",
8171
- "name": "debug",
8221
+ "name": {
8222
+ "char": "n",
8223
+ "description": "Connected App name(s) to process. For multiple apps, separate with commas (e.g., \"App1,App2\")",
8224
+ "name": "name",
8225
+ "summary": "Filter according to Name criteria",
8226
+ "hasDynamicHelp": false,
8227
+ "multiple": false,
8228
+ "type": "option"
8229
+ },
8230
+ "all": {
8231
+ "char": "a",
8232
+ "description": "If set, all Connected Apps from the org will be processed. Takes precedence over --name if both are specified.",
8233
+ "name": "all",
8234
+ "summary": "Process all Connected Apps without selection prompt",
8172
8235
  "allowNo": false,
8173
8236
  "type": "boolean"
8174
8237
  },
@@ -8184,78 +8247,61 @@
8184
8247
  "name": "skipauth",
8185
8248
  "allowNo": false,
8186
8249
  "type": "boolean"
8187
- },
8188
- "target-org": {
8189
- "aliases": [
8190
- "targetusername",
8191
- "u"
8192
- ],
8193
- "char": "o",
8194
- "deprecateAliases": true,
8195
- "name": "target-org",
8196
- "noCacheDefault": true,
8197
- "required": true,
8198
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8199
- "hasDynamicHelp": true,
8200
- "multiple": false,
8201
- "type": "option"
8202
8250
  }
8203
8251
  },
8204
8252
  "hasDynamicHelp": true,
8205
8253
  "hiddenAliases": [],
8206
- "id": "hardis:org:purge:apexlog",
8254
+ "id": "hardis:org:refresh:before-refresh",
8207
8255
  "pluginAlias": "sfdx-hardis",
8208
8256
  "pluginName": "sfdx-hardis",
8209
8257
  "pluginType": "core",
8210
8258
  "strict": true,
8211
8259
  "enableJsonFlag": true,
8212
- "title": "Purge Apex Logs",
8213
- "requiresProject": false,
8260
+ "requiresProject": true,
8214
8261
  "isESM": true,
8215
8262
  "relativePath": [
8216
8263
  "lib",
8217
8264
  "commands",
8218
8265
  "hardis",
8219
8266
  "org",
8220
- "purge",
8221
- "apexlog.js"
8267
+ "refresh",
8268
+ "before-refresh.js"
8222
8269
  ],
8223
8270
  "aliasPermutations": [],
8224
8271
  "permutations": [
8225
- "hardis:org:purge:apexlog",
8226
- "org:hardis:purge:apexlog",
8227
- "org:purge:hardis:apexlog",
8228
- "org:purge:apexlog:hardis",
8229
- "hardis:purge:org:apexlog",
8230
- "purge:hardis:org:apexlog",
8231
- "purge:org:hardis:apexlog",
8232
- "purge:org:apexlog:hardis",
8233
- "hardis:purge:apexlog:org",
8234
- "purge:hardis:apexlog:org",
8235
- "purge:apexlog:hardis:org",
8236
- "purge:apexlog:org:hardis",
8237
- "hardis:org:apexlog:purge",
8238
- "org:hardis:apexlog:purge",
8239
- "org:apexlog:hardis:purge",
8240
- "org:apexlog:purge:hardis",
8241
- "hardis:apexlog:org:purge",
8242
- "apexlog:hardis:org:purge",
8243
- "apexlog:org:hardis:purge",
8244
- "apexlog:org:purge:hardis",
8245
- "hardis:apexlog:purge:org",
8246
- "apexlog:hardis:purge:org",
8247
- "apexlog:purge:hardis:org",
8248
- "apexlog:purge:org:hardis"
8272
+ "hardis:org:refresh:before-refresh",
8273
+ "org:hardis:refresh:before-refresh",
8274
+ "org:refresh:hardis:before-refresh",
8275
+ "org:refresh:before-refresh:hardis",
8276
+ "hardis:refresh:org:before-refresh",
8277
+ "refresh:hardis:org:before-refresh",
8278
+ "refresh:org:hardis:before-refresh",
8279
+ "refresh:org:before-refresh:hardis",
8280
+ "hardis:refresh:before-refresh:org",
8281
+ "refresh:hardis:before-refresh:org",
8282
+ "refresh:before-refresh:hardis:org",
8283
+ "refresh:before-refresh:org:hardis",
8284
+ "hardis:org:before-refresh:refresh",
8285
+ "org:hardis:before-refresh:refresh",
8286
+ "org:before-refresh:hardis:refresh",
8287
+ "org:before-refresh:refresh:hardis",
8288
+ "hardis:before-refresh:org:refresh",
8289
+ "before-refresh:hardis:org:refresh",
8290
+ "before-refresh:org:hardis:refresh",
8291
+ "before-refresh:org:refresh:hardis",
8292
+ "hardis:before-refresh:refresh:org",
8293
+ "before-refresh:hardis:refresh:org",
8294
+ "before-refresh:refresh:hardis:org",
8295
+ "before-refresh:refresh:org:hardis"
8249
8296
  ]
8250
8297
  },
8251
- "hardis:org:purge:flow": {
8298
+ "hardis:org:retrieve:packageconfig": {
8252
8299
  "aliases": [],
8253
8300
  "args": {},
8254
- "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",
8301
+ "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",
8255
8302
  "examples": [
8256
- "$ sf hardis:org:purge:flow",
8257
- "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --no-prompt --delete-flow-interviews",
8258
- "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --status \"Obsolete,Draft,InvalidDraft\" --name TestFlow"
8303
+ "$ sf hardis:org:retrieve:packageconfig",
8304
+ "sf hardis:org:retrieve:packageconfig -u myOrg"
8259
8305
  ],
8260
8306
  "flags": {
8261
8307
  "json": {
@@ -8273,52 +8319,6 @@
8273
8319
  "multiple": false,
8274
8320
  "type": "option"
8275
8321
  },
8276
- "prompt": {
8277
- "char": "z",
8278
- "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
8279
- "name": "prompt",
8280
- "allowNo": true,
8281
- "type": "boolean"
8282
- },
8283
- "name": {
8284
- "char": "n",
8285
- "description": "Filter according to Name criteria",
8286
- "name": "name",
8287
- "hasDynamicHelp": false,
8288
- "multiple": false,
8289
- "type": "option"
8290
- },
8291
- "status": {
8292
- "char": "s",
8293
- "description": "Filter according to Status criteria",
8294
- "name": "status",
8295
- "hasDynamicHelp": false,
8296
- "multiple": false,
8297
- "type": "option"
8298
- },
8299
- "delete-flow-interviews": {
8300
- "char": "w",
8301
- "description": "If the presence of Flow interviews prevent to delete flows versions, delete them before retrying to delete flow versions",
8302
- "name": "delete-flow-interviews",
8303
- "allowNo": false,
8304
- "type": "boolean"
8305
- },
8306
- "allowpurgefailure": {
8307
- "char": "f",
8308
- "description": "Allows purges to fail without exiting with 1. Use --no-allowpurgefailure to disable",
8309
- "name": "allowpurgefailure",
8310
- "allowNo": true,
8311
- "type": "boolean"
8312
- },
8313
- "instanceurl": {
8314
- "char": "r",
8315
- "description": "URL of org instance",
8316
- "name": "instanceurl",
8317
- "default": "https://login.salesforce.com",
8318
- "hasDynamicHelp": false,
8319
- "multiple": false,
8320
- "type": "option"
8321
- },
8322
8322
  "debug": {
8323
8323
  "char": "d",
8324
8324
  "description": "Activate debug mode (more logs)",
@@ -8357,13 +8357,13 @@
8357
8357
  },
8358
8358
  "hasDynamicHelp": true,
8359
8359
  "hiddenAliases": [],
8360
- "id": "hardis:org:purge:flow",
8360
+ "id": "hardis:org:retrieve:packageconfig",
8361
8361
  "pluginAlias": "sfdx-hardis",
8362
8362
  "pluginName": "sfdx-hardis",
8363
8363
  "pluginType": "core",
8364
8364
  "strict": true,
8365
8365
  "enableJsonFlag": true,
8366
- "title": "Purge Flow versions",
8366
+ "title": "Retrieve package configuration from an org",
8367
8367
  "requiresProject": false,
8368
8368
  "isESM": true,
8369
8369
  "relativePath": [
@@ -8371,35 +8371,35 @@
8371
8371
  "commands",
8372
8372
  "hardis",
8373
8373
  "org",
8374
- "purge",
8375
- "flow.js"
8374
+ "retrieve",
8375
+ "packageconfig.js"
8376
8376
  ],
8377
8377
  "aliasPermutations": [],
8378
8378
  "permutations": [
8379
- "hardis:org:purge:flow",
8380
- "org:hardis:purge:flow",
8381
- "org:purge:hardis:flow",
8382
- "org:purge:flow:hardis",
8383
- "hardis:purge:org:flow",
8384
- "purge:hardis:org:flow",
8385
- "purge:org:hardis:flow",
8386
- "purge:org:flow:hardis",
8387
- "hardis:purge:flow:org",
8388
- "purge:hardis:flow:org",
8389
- "purge:flow:hardis:org",
8390
- "purge:flow:org:hardis",
8391
- "hardis:org:flow:purge",
8392
- "org:hardis:flow:purge",
8393
- "org:flow:hardis:purge",
8394
- "org:flow:purge:hardis",
8395
- "hardis:flow:org:purge",
8396
- "flow:hardis:org:purge",
8397
- "flow:org:hardis:purge",
8398
- "flow:org:purge:hardis",
8399
- "hardis:flow:purge:org",
8400
- "flow:hardis:purge:org",
8401
- "flow:purge:hardis:org",
8402
- "flow:purge:org:hardis"
8379
+ "hardis:org:retrieve:packageconfig",
8380
+ "org:hardis:retrieve:packageconfig",
8381
+ "org:retrieve:hardis:packageconfig",
8382
+ "org:retrieve:packageconfig:hardis",
8383
+ "hardis:retrieve:org:packageconfig",
8384
+ "retrieve:hardis:org:packageconfig",
8385
+ "retrieve:org:hardis:packageconfig",
8386
+ "retrieve:org:packageconfig:hardis",
8387
+ "hardis:retrieve:packageconfig:org",
8388
+ "retrieve:hardis:packageconfig:org",
8389
+ "retrieve:packageconfig:hardis:org",
8390
+ "retrieve:packageconfig:org:hardis",
8391
+ "hardis:org:packageconfig:retrieve",
8392
+ "org:hardis:packageconfig:retrieve",
8393
+ "org:packageconfig:hardis:retrieve",
8394
+ "org:packageconfig:retrieve:hardis",
8395
+ "hardis:packageconfig:org:retrieve",
8396
+ "packageconfig:hardis:org:retrieve",
8397
+ "packageconfig:org:hardis:retrieve",
8398
+ "packageconfig:org:retrieve:hardis",
8399
+ "hardis:packageconfig:retrieve:org",
8400
+ "packageconfig:hardis:retrieve:org",
8401
+ "packageconfig:retrieve:hardis:org",
8402
+ "packageconfig:retrieve:org:hardis"
8403
8403
  ]
8404
8404
  },
8405
8405
  "hardis:org:test:apex": {
@@ -13191,6 +13191,97 @@
13191
13191
  "gitdelta:generate:project:hardis"
13192
13192
  ]
13193
13193
  },
13194
+ "hardis:project:metadata:activate-decomposed": {
13195
+ "aliases": [],
13196
+ "args": {},
13197
+ "description": "\n## Command Behavior\n\n**Activate decomposed metadata types in Salesforce DX projects.**\n\nThis command helps manage decomposed metadata types that can be split into multiple files in source format. It automatically decomposes all supported metadata types that exist in your project.\n\nSupported metadata types (Beta):\n- CustomLabels\n- PermissionSet\n- ExternalServiceRegistration\n- SharingRules\n- Workflow\n\nSee [Salesforce documentation on decomposed metadata](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_decomposed_md_types.htm)\n\nKey features:\n- Automatically detects and decomposes all applicable metadata types\n- Decomposes only metadata types that exist in your project\n- Interactive confirmation for decomposition operations\n- Handles all confirmation prompts automatically\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThis command utilizes Salesforce CLI's decomposed metadata feature to split complex metadata types into smaller, more manageable components:\n\n- **CustomLabels**: Each custom label becomes a separate file, making it easier to track changes and manage translations.\n- **PermissionSets**: Permission sets are decomposed into multiple files based on the permissions they contain (field permissions, object permissions, etc.).\n- **ExternalServiceRegistration**: Decomposes external service registrations.\n- **SharingRules**: Decomposes sharing rules into individual components.\n- **Workflow**: Decomposes workflow rules into individual components.\n\nThe command wraps the underlying Salesforce CLI functionality and provides a more user-friendly interface with additional validation and error handling.\n\nNote: All decomposed metadata features are currently in Beta in Salesforce CLI.\n</details>\n",
13198
+ "examples": [
13199
+ "$ sf hardis:project:metadata:activate-decomposed",
13200
+ "$ sf hardis:project:metadata:activate-decomposed --debug"
13201
+ ],
13202
+ "flags": {
13203
+ "json": {
13204
+ "description": "Format output as json.",
13205
+ "helpGroup": "GLOBAL",
13206
+ "name": "json",
13207
+ "allowNo": false,
13208
+ "type": "boolean"
13209
+ },
13210
+ "flags-dir": {
13211
+ "helpGroup": "GLOBAL",
13212
+ "name": "flags-dir",
13213
+ "summary": "Import flag values from a directory.",
13214
+ "hasDynamicHelp": false,
13215
+ "multiple": false,
13216
+ "type": "option"
13217
+ },
13218
+ "debug": {
13219
+ "char": "d",
13220
+ "description": "Run command in debug mode",
13221
+ "name": "debug",
13222
+ "allowNo": false,
13223
+ "type": "boolean"
13224
+ },
13225
+ "websocket": {
13226
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
13227
+ "name": "websocket",
13228
+ "hasDynamicHelp": false,
13229
+ "multiple": false,
13230
+ "type": "option"
13231
+ },
13232
+ "skipauth": {
13233
+ "description": "Skip authentication check when a default username is required",
13234
+ "name": "skipauth",
13235
+ "allowNo": false,
13236
+ "type": "boolean"
13237
+ }
13238
+ },
13239
+ "hasDynamicHelp": false,
13240
+ "hiddenAliases": [],
13241
+ "id": "hardis:project:metadata:activate-decomposed",
13242
+ "pluginAlias": "sfdx-hardis",
13243
+ "pluginName": "sfdx-hardis",
13244
+ "pluginType": "core",
13245
+ "strict": true,
13246
+ "enableJsonFlag": true,
13247
+ "title": "Activate Decomposed Metadata (Beta)",
13248
+ "isESM": true,
13249
+ "relativePath": [
13250
+ "lib",
13251
+ "commands",
13252
+ "hardis",
13253
+ "project",
13254
+ "metadata",
13255
+ "activate-decomposed.js"
13256
+ ],
13257
+ "aliasPermutations": [],
13258
+ "permutations": [
13259
+ "hardis:project:metadata:activate-decomposed",
13260
+ "project:hardis:metadata:activate-decomposed",
13261
+ "project:metadata:hardis:activate-decomposed",
13262
+ "project:metadata:activate-decomposed:hardis",
13263
+ "hardis:metadata:project:activate-decomposed",
13264
+ "metadata:hardis:project:activate-decomposed",
13265
+ "metadata:project:hardis:activate-decomposed",
13266
+ "metadata:project:activate-decomposed:hardis",
13267
+ "hardis:metadata:activate-decomposed:project",
13268
+ "metadata:hardis:activate-decomposed:project",
13269
+ "metadata:activate-decomposed:hardis:project",
13270
+ "metadata:activate-decomposed:project:hardis",
13271
+ "hardis:project:activate-decomposed:metadata",
13272
+ "project:hardis:activate-decomposed:metadata",
13273
+ "project:activate-decomposed:hardis:metadata",
13274
+ "project:activate-decomposed:metadata:hardis",
13275
+ "hardis:activate-decomposed:project:metadata",
13276
+ "activate-decomposed:hardis:project:metadata",
13277
+ "activate-decomposed:project:hardis:metadata",
13278
+ "activate-decomposed:project:metadata:hardis",
13279
+ "hardis:activate-decomposed:metadata:project",
13280
+ "activate-decomposed:hardis:metadata:project",
13281
+ "activate-decomposed:metadata:hardis:project",
13282
+ "activate-decomposed:metadata:project:hardis"
13283
+ ]
13284
+ },
13194
13285
  "hardis:project:metadata:findduplicates": {
13195
13286
  "aliases": [],
13196
13287
  "args": {},
@@ -15278,5 +15369,5 @@
15278
15369
  ]
15279
15370
  }
15280
15371
  },
15281
- "version": "6.5.5"
15372
+ "version": "6.6.1-alpha202510111519.0"
15282
15373
  }