sfdx-hardis 6.9.1-alpha202510261844.0 → 6.9.1-alpha202510262008.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,12 +132,13 @@
132
132
  "clear:cache:hardis"
133
133
  ]
134
134
  },
135
- "hardis:config:get": {
135
+ "hardis:auth:login": {
136
136
  "aliases": [],
137
137
  "args": {},
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",
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",
139
139
  "examples": [
140
- "$ sf hardis:project:deploy:sources:metadata"
140
+ "$ sf hardis:auth:login",
141
+ "CI=true CI_COMMIT_REF_NAME=monitoring_myclient sf hardis:auth:login"
141
142
  ],
142
143
  "flags": {
143
144
  "json": {
@@ -155,20 +156,28 @@
155
156
  "multiple": false,
156
157
  "type": "option"
157
158
  },
158
- "level": {
159
- "char": "l",
160
- "description": "project,branch or user",
161
- "name": "level",
162
- "default": "project",
159
+ "instanceurl": {
160
+ "char": "r",
161
+ "description": "URL of org instance",
162
+ "name": "instanceurl",
163
163
  "hasDynamicHelp": false,
164
164
  "multiple": false,
165
- "options": [
166
- "project",
167
- "branch",
168
- "user"
169
- ],
170
165
  "type": "option"
171
166
  },
167
+ "devhub": {
168
+ "char": "h",
169
+ "description": "Also connect associated DevHub",
170
+ "name": "devhub",
171
+ "allowNo": false,
172
+ "type": "boolean"
173
+ },
174
+ "scratchorg": {
175
+ "char": "s",
176
+ "description": "Scratch org",
177
+ "name": "scratchorg",
178
+ "allowNo": false,
179
+ "type": "boolean"
180
+ },
172
181
  "debug": {
173
182
  "char": "d",
174
183
  "description": "Activate debug mode (more logs)",
@@ -192,39 +201,38 @@
192
201
  },
193
202
  "hasDynamicHelp": false,
194
203
  "hiddenAliases": [],
195
- "id": "hardis:config:get",
204
+ "id": "hardis:auth:login",
196
205
  "pluginAlias": "sfdx-hardis",
197
206
  "pluginName": "sfdx-hardis",
198
207
  "pluginType": "core",
199
208
  "strict": true,
200
209
  "enableJsonFlag": true,
201
- "title": "Deploy metadata sources to org",
210
+ "title": "Login",
202
211
  "requiresProject": false,
203
212
  "isESM": true,
204
213
  "relativePath": [
205
214
  "lib",
206
215
  "commands",
207
216
  "hardis",
208
- "config",
209
- "get.js"
217
+ "auth",
218
+ "login.js"
210
219
  ],
211
220
  "aliasPermutations": [],
212
221
  "permutations": [
213
- "hardis:config:get",
214
- "config:hardis:get",
215
- "config:get:hardis",
216
- "hardis:get:config",
217
- "get:hardis:config",
218
- "get:config:hardis"
222
+ "hardis:auth:login",
223
+ "auth:hardis:login",
224
+ "auth:login:hardis",
225
+ "hardis:login:auth",
226
+ "login:hardis:auth",
227
+ "login:auth:hardis"
219
228
  ]
220
229
  },
221
- "hardis:auth:login": {
230
+ "hardis:config:get": {
222
231
  "aliases": [],
223
232
  "args": {},
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",
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",
225
234
  "examples": [
226
- "$ sf hardis:auth:login",
227
- "CI=true CI_COMMIT_REF_NAME=monitoring_myclient sf hardis:auth:login"
235
+ "$ sf hardis:project:deploy:sources:metadata"
228
236
  ],
229
237
  "flags": {
230
238
  "json": {
@@ -242,28 +250,20 @@
242
250
  "multiple": false,
243
251
  "type": "option"
244
252
  },
245
- "instanceurl": {
246
- "char": "r",
247
- "description": "URL of org instance",
248
- "name": "instanceurl",
253
+ "level": {
254
+ "char": "l",
255
+ "description": "project,branch or user",
256
+ "name": "level",
257
+ "default": "project",
249
258
  "hasDynamicHelp": false,
250
259
  "multiple": false,
260
+ "options": [
261
+ "project",
262
+ "branch",
263
+ "user"
264
+ ],
251
265
  "type": "option"
252
266
  },
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:auth:login",
290
+ "id": "hardis:config:get",
291
291
  "pluginAlias": "sfdx-hardis",
292
292
  "pluginName": "sfdx-hardis",
293
293
  "pluginType": "core",
294
294
  "strict": true,
295
295
  "enableJsonFlag": true,
296
- "title": "Login",
296
+ "title": "Deploy metadata sources to org",
297
297
  "requiresProject": false,
298
298
  "isESM": true,
299
299
  "relativePath": [
300
300
  "lib",
301
301
  "commands",
302
302
  "hardis",
303
- "auth",
304
- "login.js"
303
+ "config",
304
+ "get.js"
305
305
  ],
306
306
  "aliasPermutations": [],
307
307
  "permutations": [
308
- "hardis:auth:login",
309
- "auth:hardis:login",
310
- "auth:login:hardis",
311
- "hardis:login:auth",
312
- "login:hardis:auth",
313
- "login:auth:hardis"
308
+ "hardis:config:get",
309
+ "config:hardis:get",
310
+ "config:get:hardis",
311
+ "hardis:get:config",
312
+ "get:hardis:config",
313
+ "get:config:hardis"
314
314
  ]
315
315
  },
316
316
  "hardis:doc:fieldusage": {
@@ -5539,15 +5539,12 @@
5539
5539
  "import:data:org:hardis"
5540
5540
  ]
5541
5541
  },
5542
- "hardis:org:diagnose:audittrail": {
5542
+ "hardis:org:files:export": {
5543
5543
  "aliases": [],
5544
5544
  "args": {},
5545
- "description": "Export Audit trail into a CSV file with selected criteria, and highlight suspect actions\n\nAlso detects updates of Custom Settings values (disable by defining `SKIP_AUDIT_TRAIL_CUSTOM_SETTINGS=true`)\n\nRegular setup actions performed in major orgs are filtered.\n\n- \"\"\n - createScratchOrg\n - changedsenderemail\n - deleteScratchOrg\n - loginasgrantedtopartnerbt\n- Certificate and Key Management\n - insertCertificate\n- Custom App Licenses\n - addeduserpackagelicense\n - granteduserpackagelicense\n - revokeduserpackagelicense\n- Customer Portal\n - createdcustomersuccessuser\n - CSPUserDisabled\n- Currency\n - updateddatedexchrate\n- Data Management\n - queueMembership\n- Email Administration\n - dkimRotationPreparationSuccessful\n - dkimRotationSuccessful\n- External Objects\n - xdsEncryptedFieldChange\n- Groups\n - groupMembership\n- Holidays\n - holiday_insert\n- Inbox mobile and legacy desktop apps\n - enableSIQUserNonEAC\n - siqUserAcceptedTOS\n- Manage Users\n - activateduser\n - createduser\n - changedcommunitynickname\n - changedemail\n - changedfederationid\n - changedpassword\n - changedinteractionuseroffon\n - changedinteractionuseronoff\n - changedmarketinguseroffon\n - changedmarketinguseronoff\n - changedofflineuseroffon\n - changedprofileforuserstdtostd\n - changedprofileforuser\n - changedprofileforusercusttostd\n - changedprofileforuserstdtocust\n - changedroleforusertonone\n - changedroleforuser\n - changedroleforuserfromnone\n - changedUserAdminVerifiedStatusVerified\n - changedUserEmailVerifiedStatusUnverified\n - changedUserEmailVerifiedStatusVerified\n - changedknowledgeuseroffon\n - changedsfcontentuseroffon\n - changedsupportuseroffon\n - changedusername\n - changedUserPhoneNumber\n - changedUserPhoneVerifiedStatusUnverified\n - changedUserPhoneVerifiedStatusVerified\n - deactivateduser\n - deleteAuthenticatorPairing\n - deleteTwoFactorInfo2\n - deleteTwoFactorTempCode\n - frozeuser\n - insertAuthenticatorPairing\n - insertTwoFactorInfo2\n - insertTwoFactorTempCode\n - lightningloginenroll\n - PermSetAssign\n - PermSetGroupAssign\n - PermSetGroupUnassign\n - PermSetLicenseAssign\n - PermSetUnassign\n - PermSetLicenseUnassign\n - registeredUserPhoneNumber\n - resetpassword\n - suNetworkAdminLogin\n - suNetworkAdminLogout\n - suOrgAdminLogin\n - suOrgAdminLogout\n - unfrozeuser\n - useremailchangesent\n- Mobile Administration\n - assigneduserstomobileconfig\n- Reporting Snapshots\n - createdReportJob\n - deletedReportJob\n- Sandboxes\n - DeleteSandbox\n\nBy default, deployment user defined in .sfdx-hardis.yml targetUsername property will be excluded.\n\nYou can define additional users to exclude in .sfdx-hardis.yml **monitoringExcludeUsernames** property.\n\nYou can also add more sections / actions considered as not suspect using property **monitoringAllowedSectionsActions**\n\nExample:\n\n```yaml\nmonitoringExcludeUsernames:\n - deploymentuser@cloudity.com\n - marketingcloud@cloudity.com\n - integration-user@cloudity.com\n\nmonitoringAllowedSectionsActions:\n \"Some section\": [] // Will ignore all actions from such section\n \"Some other section\": [\"actionType1\",\"actionType2\",\"actionType3\"] // Will ignore only those 3 actions from section \"Some other section\". Other actions in the same section will be considered as suspect.\n```\n\n## Excel output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-excel.jpg)\n\n## Local output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-local.jpg)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-suspect-audit-trail/) and can output Grafana, Slack and MsTeams Notifications.\n",
5545
+ "description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, output naming conventions, and file size filtering.\n- **File Size Filtering:** Supports minimum file size filtering via the `fileSizeMin` configuration parameter (in KB). Files smaller than the specified size will be skipped during export.\n- **File Validation:** After downloading each file, validates the integrity by:\n - **Checksum Validation:** For ContentVersion files, compares MD5 checksum with Salesforce's stored checksum\n - **Size Validation:** For both ContentVersion and Attachment files, verifies actual file size matches expected size\n - **Status Tracking:** Files are categorized with specific statuses: `success` (valid files), `failed` (download errors), `skipped` (filtered files), `invalid` (downloaded but failed validation)\n - All validation results are logged in the CSV export log for audit purposes\n- **Resume/Restart Capability:** \n - **Resume Mode:** When `--resume` flag is used (default in CI environments), checks existing downloaded files for validity. Valid files are skipped, invalid files are re-downloaded.\n - **Restart Mode:** When resume is disabled, clears the output folder and starts a fresh export.\n - **Interactive Mode:** When existing files are found and `--resume` is not explicitly specified (non-CI environments), prompts the user to choose between resume or restart.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesExporter Class:** The core logic is encapsulated within the `FilesExporter` class, which orchestrates the entire export process.\n- **SOQL Queries (Bulk API):** It uses Salesforce Bulk API queries to efficiently retrieve large volumes of parent record IDs and file metadata, including checksums and file sizes.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File Validation:** After each successful download, validates file integrity by comparing checksums (ContentVersion) and file sizes (both ContentVersion and Attachment) against Salesforce metadata.\n- **Resume Logic:** In resume mode, checks for existing files before downloading, validates their integrity, and only re-downloads invalid or missing files. This enables efficient recovery from interrupted exports.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project, `promptFilesExportConfiguration` for customizing export options, and prompts for resume/restart choice when existing files are found.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues, API limits, and file validation failures. Each file is assigned a specific status (`success`, `failed`, `skipped`, `invalid`) for comprehensive tracking and troubleshooting.\n</details>\n",
5546
5546
  "examples": [
5547
- "$ sf hardis:org:diagnose:audittrail",
5548
- "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
5549
- "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
5550
- "$ sf hardis:org:diagnose:audittrail --lastndays 5"
5547
+ "$ sf hardis:org:files:export"
5551
5548
  ],
5552
5549
  "flags": {
5553
5550
  "json": {
@@ -5565,30 +5562,48 @@
5565
5562
  "multiple": false,
5566
5563
  "type": "option"
5567
5564
  },
5568
- "excludeusers": {
5569
- "char": "e",
5570
- "description": "Comma-separated list of usernames to exclude",
5571
- "name": "excludeusers",
5565
+ "path": {
5566
+ "char": "p",
5567
+ "description": "Path to the file export project",
5568
+ "name": "path",
5572
5569
  "hasDynamicHelp": false,
5573
5570
  "multiple": false,
5574
5571
  "type": "option"
5575
5572
  },
5576
- "lastndays": {
5573
+ "chunksize": {
5574
+ "char": "c",
5575
+ "description": "Number of records to add in a chunk before it is processed",
5576
+ "name": "chunksize",
5577
+ "default": 1000,
5578
+ "hasDynamicHelp": false,
5579
+ "multiple": false,
5580
+ "type": "option"
5581
+ },
5582
+ "polltimeout": {
5577
5583
  "char": "t",
5578
- "description": "Number of days to extract from today (included)",
5579
- "name": "lastndays",
5584
+ "description": "Timeout in MS for Bulk API calls",
5585
+ "name": "polltimeout",
5586
+ "default": 300000,
5580
5587
  "hasDynamicHelp": false,
5581
5588
  "multiple": false,
5582
5589
  "type": "option"
5583
5590
  },
5584
- "outputfile": {
5585
- "char": "f",
5586
- "description": "Force the path and name of output report file. Must end with .csv",
5587
- "name": "outputfile",
5591
+ "startchunknumber": {
5592
+ "char": "s",
5593
+ "description": "Chunk number to start from",
5594
+ "name": "startchunknumber",
5595
+ "default": 0,
5588
5596
  "hasDynamicHelp": false,
5589
5597
  "multiple": false,
5590
5598
  "type": "option"
5591
5599
  },
5600
+ "resume": {
5601
+ "char": "r",
5602
+ "description": "Resume previous export by checking existing files (default in CI)",
5603
+ "name": "resume",
5604
+ "allowNo": false,
5605
+ "type": "boolean"
5606
+ },
5592
5607
  "debug": {
5593
5608
  "char": "d",
5594
5609
  "description": "Activate debug mode (more logs)",
@@ -5627,13 +5642,13 @@
5627
5642
  },
5628
5643
  "hasDynamicHelp": true,
5629
5644
  "hiddenAliases": [],
5630
- "id": "hardis:org:diagnose:audittrail",
5645
+ "id": "hardis:org:files:export",
5631
5646
  "pluginAlias": "sfdx-hardis",
5632
5647
  "pluginName": "sfdx-hardis",
5633
5648
  "pluginType": "core",
5634
5649
  "strict": true,
5635
5650
  "enableJsonFlag": true,
5636
- "title": "Diagnose content of Setup Audit Trail",
5651
+ "title": "Export files",
5637
5652
  "requiresProject": false,
5638
5653
  "isESM": true,
5639
5654
  "relativePath": [
@@ -5641,43 +5656,43 @@
5641
5656
  "commands",
5642
5657
  "hardis",
5643
5658
  "org",
5644
- "diagnose",
5645
- "audittrail.js"
5659
+ "files",
5660
+ "export.js"
5646
5661
  ],
5647
5662
  "aliasPermutations": [],
5648
5663
  "permutations": [
5649
- "hardis:org:diagnose:audittrail",
5650
- "org:hardis:diagnose:audittrail",
5651
- "org:diagnose:hardis:audittrail",
5652
- "org:diagnose:audittrail:hardis",
5653
- "hardis:diagnose:org:audittrail",
5654
- "diagnose:hardis:org:audittrail",
5655
- "diagnose:org:hardis:audittrail",
5656
- "diagnose:org:audittrail:hardis",
5657
- "hardis:diagnose:audittrail:org",
5658
- "diagnose:hardis:audittrail:org",
5659
- "diagnose:audittrail:hardis:org",
5660
- "diagnose:audittrail:org:hardis",
5661
- "hardis:org:audittrail:diagnose",
5662
- "org:hardis:audittrail:diagnose",
5663
- "org:audittrail:hardis:diagnose",
5664
- "org:audittrail:diagnose:hardis",
5665
- "hardis:audittrail:org:diagnose",
5666
- "audittrail:hardis:org:diagnose",
5667
- "audittrail:org:hardis:diagnose",
5668
- "audittrail:org:diagnose:hardis",
5669
- "hardis:audittrail:diagnose:org",
5670
- "audittrail:hardis:diagnose:org",
5671
- "audittrail:diagnose:hardis:org",
5672
- "audittrail:diagnose:org:hardis"
5664
+ "hardis:org:files:export",
5665
+ "org:hardis:files:export",
5666
+ "org:files:hardis:export",
5667
+ "org:files:export:hardis",
5668
+ "hardis:files:org:export",
5669
+ "files:hardis:org:export",
5670
+ "files:org:hardis:export",
5671
+ "files:org:export:hardis",
5672
+ "hardis:files:export:org",
5673
+ "files:hardis:export:org",
5674
+ "files:export:hardis:org",
5675
+ "files:export:org:hardis",
5676
+ "hardis:org:export:files",
5677
+ "org:hardis:export:files",
5678
+ "org:export:hardis:files",
5679
+ "org:export:files:hardis",
5680
+ "hardis:export:org:files",
5681
+ "export:hardis:org:files",
5682
+ "export:org:hardis:files",
5683
+ "export:org:files:hardis",
5684
+ "hardis:export:files:org",
5685
+ "export:hardis:files:org",
5686
+ "export:files:hardis:org",
5687
+ "export:files:org:hardis"
5673
5688
  ]
5674
5689
  },
5675
- "hardis:org:diagnose:instanceupgrade": {
5690
+ "hardis:org:files:import": {
5676
5691
  "aliases": [],
5677
5692
  "args": {},
5678
- "description": "\n## Command Behavior\n\n**Retrieves and displays the scheduled upgrade date for a Salesforce org's instance.**\n\nThis command provides crucial information about when your Salesforce instance will be upgraded to the next major release (Spring, Summer, or Winter). This is vital for release planning, testing, and ensuring compatibility with upcoming Salesforce features.\n\nKey functionalities:\n\n- **Instance Identification:** Determines the Salesforce instance name of your target org.\n- **Upgrade Date Retrieval:** Fetches the planned start time of the next major core service upgrade for that instance from the Salesforce Status API.\n- **Days Until Upgrade:** Calculates and displays the number of days remaining until the next major upgrade.\n- **Severity-Based Logging:** Adjusts the log severity (info, warning) based on the proximity of the upgrade date, providing a visual cue for urgency.\n- **Notifications:** Sends notifications to configured channels (e.g., Slack, MS Teams, Grafana) with the upgrade information, making it suitable for automated monitoring.\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 `Organization` object in Salesforce to get the `InstanceName` of the target org.\n- **Salesforce Status API Integration:** It makes an HTTP GET request to the Salesforce Status API (`https://api.status.salesforce.com/v1/instances/{instanceName}/status`) to retrieve detailed information about the instance, including scheduled maintenances.\n- **Data Parsing:** It parses the JSON response from the Status API to extract the relevant major release upgrade information.\n- **Date Calculation:** Uses the `moment` library to calculate the difference in days between the current date and the planned upgrade date.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including the instance name, upgrade date, and days remaining, along with relevant metrics for monitoring dashboards.\n- **User Feedback:** Provides clear messages to the user about the upgrade status and proximity.\n</details>\n",
5693
+ "description": "\nThis command facilitates the mass upload of files into Salesforce, allowing you to populate records with associated documents, images, or other file types. It's a crucial tool for data migration, content seeding, or synchronizing external file repositories with Salesforce.\n\nKey functionalities:\n\n- **Configuration-Driven Import:** Relies on an `export.json` file within a designated file export project (created using `sf hardis:org:configure:files`) to determine which files to import and how they should be associated with Salesforce records.\n- **Interactive Project Selection:** If the file import project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Overwrite Option:** The `--overwrite` flag allows you to replace existing files in Salesforce with local versions that have the same name. Be aware that this option doubles the number of API calls used.\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for how to export files, which is often a prerequisite for importing:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesImporter Class:** The core logic is encapsulated within the `FilesImporter` class, which orchestrates the entire import process.\n- **File System Scan:** Scans the local file system within the configured project directory to identify files for import.\n- **Salesforce API Interaction:** Uses Salesforce APIs (e.g., ContentVersion, Attachment) to upload files and associate them with records.\n- **Configuration Loading:** Reads the `export.json` file to get the import configuration, including SOQL queries to identify parent records for file association.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file import project and `prompts` for confirming the overwrite behavior.\n- **Error Handling:** Includes mechanisms to handle potential errors during the import process, such as API limits or file upload failures.\n</details>\n",
5679
5694
  "examples": [
5680
- "$ sf hardis:org:diagnose:instanceupgrade"
5695
+ "$ sf hardis:org:files:import"
5681
5696
  ],
5682
5697
  "flags": {
5683
5698
  "json": {
@@ -5695,6 +5710,21 @@
5695
5710
  "multiple": false,
5696
5711
  "type": "option"
5697
5712
  },
5713
+ "path": {
5714
+ "char": "p",
5715
+ "description": "Path to the file export project",
5716
+ "name": "path",
5717
+ "hasDynamicHelp": false,
5718
+ "multiple": false,
5719
+ "type": "option"
5720
+ },
5721
+ "overwrite": {
5722
+ "char": "f",
5723
+ "description": "Override existing files (doubles the number of API calls)",
5724
+ "name": "overwrite",
5725
+ "allowNo": false,
5726
+ "type": "boolean"
5727
+ },
5698
5728
  "debug": {
5699
5729
  "char": "d",
5700
5730
  "description": "Activate debug mode (more logs)",
@@ -5733,13 +5763,13 @@
5733
5763
  },
5734
5764
  "hasDynamicHelp": true,
5735
5765
  "hiddenAliases": [],
5736
- "id": "hardis:org:diagnose:instanceupgrade",
5766
+ "id": "hardis:org:files:import",
5737
5767
  "pluginAlias": "sfdx-hardis",
5738
5768
  "pluginName": "sfdx-hardis",
5739
5769
  "pluginType": "core",
5740
5770
  "strict": true,
5741
5771
  "enableJsonFlag": true,
5742
- "title": "Get Instance Upgrade date",
5772
+ "title": "Import files",
5743
5773
  "requiresProject": false,
5744
5774
  "isESM": true,
5745
5775
  "relativePath": [
@@ -5747,23 +5777,262 @@
5747
5777
  "commands",
5748
5778
  "hardis",
5749
5779
  "org",
5750
- "diagnose",
5751
- "instanceupgrade.js"
5780
+ "files",
5781
+ "import.js"
5752
5782
  ],
5753
5783
  "aliasPermutations": [],
5754
5784
  "permutations": [
5755
- "hardis:org:diagnose:instanceupgrade",
5756
- "org:hardis:diagnose:instanceupgrade",
5757
- "org:diagnose:hardis:instanceupgrade",
5758
- "org:diagnose:instanceupgrade:hardis",
5759
- "hardis:diagnose:org:instanceupgrade",
5760
- "diagnose:hardis:org:instanceupgrade",
5761
- "diagnose:org:hardis:instanceupgrade",
5762
- "diagnose:org:instanceupgrade:hardis",
5763
- "hardis:diagnose:instanceupgrade:org",
5764
- "diagnose:hardis:instanceupgrade:org",
5765
- "diagnose:instanceupgrade:hardis:org",
5766
- "diagnose:instanceupgrade:org:hardis",
5785
+ "hardis:org:files:import",
5786
+ "org:hardis:files:import",
5787
+ "org:files:hardis:import",
5788
+ "org:files:import:hardis",
5789
+ "hardis:files:org:import",
5790
+ "files:hardis:org:import",
5791
+ "files:org:hardis:import",
5792
+ "files:org:import:hardis",
5793
+ "hardis:files:import:org",
5794
+ "files:hardis:import:org",
5795
+ "files:import:hardis:org",
5796
+ "files:import:org:hardis",
5797
+ "hardis:org:import:files",
5798
+ "org:hardis:import:files",
5799
+ "org:import:hardis:files",
5800
+ "org:import:files:hardis",
5801
+ "hardis:import:org:files",
5802
+ "import:hardis:org:files",
5803
+ "import:org:hardis:files",
5804
+ "import:org:files:hardis",
5805
+ "hardis:import:files:org",
5806
+ "import:hardis:files:org",
5807
+ "import:files:hardis:org",
5808
+ "import:files:org:hardis"
5809
+ ]
5810
+ },
5811
+ "hardis:org:diagnose:audittrail": {
5812
+ "aliases": [],
5813
+ "args": {},
5814
+ "description": "Export Audit trail into a CSV file with selected criteria, and highlight suspect actions\n\nAlso detects updates of Custom Settings values (disable by defining `SKIP_AUDIT_TRAIL_CUSTOM_SETTINGS=true`)\n\nRegular setup actions performed in major orgs are filtered.\n\n- \"\"\n - createScratchOrg\n - changedsenderemail\n - deleteScratchOrg\n - loginasgrantedtopartnerbt\n- Certificate and Key Management\n - insertCertificate\n- Custom App Licenses\n - addeduserpackagelicense\n - granteduserpackagelicense\n - revokeduserpackagelicense\n- Customer Portal\n - createdcustomersuccessuser\n - CSPUserDisabled\n- Currency\n - updateddatedexchrate\n- Data Management\n - queueMembership\n- Email Administration\n - dkimRotationPreparationSuccessful\n - dkimRotationSuccessful\n- External Objects\n - xdsEncryptedFieldChange\n- Groups\n - groupMembership\n- Holidays\n - holiday_insert\n- Inbox mobile and legacy desktop apps\n - enableSIQUserNonEAC\n - siqUserAcceptedTOS\n- Manage Users\n - activateduser\n - createduser\n - changedcommunitynickname\n - changedemail\n - changedfederationid\n - changedpassword\n - changedinteractionuseroffon\n - changedinteractionuseronoff\n - changedmarketinguseroffon\n - changedmarketinguseronoff\n - changedofflineuseroffon\n - changedprofileforuserstdtostd\n - changedprofileforuser\n - changedprofileforusercusttostd\n - changedprofileforuserstdtocust\n - changedroleforusertonone\n - changedroleforuser\n - changedroleforuserfromnone\n - changedUserAdminVerifiedStatusVerified\n - changedUserEmailVerifiedStatusUnverified\n - changedUserEmailVerifiedStatusVerified\n - changedknowledgeuseroffon\n - changedsfcontentuseroffon\n - changedsupportuseroffon\n - changedusername\n - changedUserPhoneNumber\n - changedUserPhoneVerifiedStatusUnverified\n - changedUserPhoneVerifiedStatusVerified\n - deactivateduser\n - deleteAuthenticatorPairing\n - deleteTwoFactorInfo2\n - deleteTwoFactorTempCode\n - frozeuser\n - insertAuthenticatorPairing\n - insertTwoFactorInfo2\n - insertTwoFactorTempCode\n - lightningloginenroll\n - PermSetAssign\n - PermSetGroupAssign\n - PermSetGroupUnassign\n - PermSetLicenseAssign\n - PermSetUnassign\n - PermSetLicenseUnassign\n - registeredUserPhoneNumber\n - resetpassword\n - suNetworkAdminLogin\n - suNetworkAdminLogout\n - suOrgAdminLogin\n - suOrgAdminLogout\n - unfrozeuser\n - useremailchangesent\n- Mobile Administration\n - assigneduserstomobileconfig\n- Reporting Snapshots\n - createdReportJob\n - deletedReportJob\n- Sandboxes\n - DeleteSandbox\n\nBy default, deployment user defined in .sfdx-hardis.yml targetUsername property will be excluded.\n\nYou can define additional users to exclude in .sfdx-hardis.yml **monitoringExcludeUsernames** property.\n\nYou can also add more sections / actions considered as not suspect using property **monitoringAllowedSectionsActions**\n\nExample:\n\n```yaml\nmonitoringExcludeUsernames:\n - deploymentuser@cloudity.com\n - marketingcloud@cloudity.com\n - integration-user@cloudity.com\n\nmonitoringAllowedSectionsActions:\n \"Some section\": [] // Will ignore all actions from such section\n \"Some other section\": [\"actionType1\",\"actionType2\",\"actionType3\"] // Will ignore only those 3 actions from section \"Some other section\". Other actions in the same section will be considered as suspect.\n```\n\n## Excel output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-excel.jpg)\n\n## Local output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-local.jpg)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-suspect-audit-trail/) and can output Grafana, Slack and MsTeams Notifications.\n",
5815
+ "examples": [
5816
+ "$ sf hardis:org:diagnose:audittrail",
5817
+ "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
5818
+ "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
5819
+ "$ sf hardis:org:diagnose:audittrail --lastndays 5"
5820
+ ],
5821
+ "flags": {
5822
+ "json": {
5823
+ "description": "Format output as json.",
5824
+ "helpGroup": "GLOBAL",
5825
+ "name": "json",
5826
+ "allowNo": false,
5827
+ "type": "boolean"
5828
+ },
5829
+ "flags-dir": {
5830
+ "helpGroup": "GLOBAL",
5831
+ "name": "flags-dir",
5832
+ "summary": "Import flag values from a directory.",
5833
+ "hasDynamicHelp": false,
5834
+ "multiple": false,
5835
+ "type": "option"
5836
+ },
5837
+ "excludeusers": {
5838
+ "char": "e",
5839
+ "description": "Comma-separated list of usernames to exclude",
5840
+ "name": "excludeusers",
5841
+ "hasDynamicHelp": false,
5842
+ "multiple": false,
5843
+ "type": "option"
5844
+ },
5845
+ "lastndays": {
5846
+ "char": "t",
5847
+ "description": "Number of days to extract from today (included)",
5848
+ "name": "lastndays",
5849
+ "hasDynamicHelp": false,
5850
+ "multiple": false,
5851
+ "type": "option"
5852
+ },
5853
+ "outputfile": {
5854
+ "char": "f",
5855
+ "description": "Force the path and name of output report file. Must end with .csv",
5856
+ "name": "outputfile",
5857
+ "hasDynamicHelp": false,
5858
+ "multiple": false,
5859
+ "type": "option"
5860
+ },
5861
+ "debug": {
5862
+ "char": "d",
5863
+ "description": "Activate debug mode (more logs)",
5864
+ "name": "debug",
5865
+ "allowNo": false,
5866
+ "type": "boolean"
5867
+ },
5868
+ "websocket": {
5869
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5870
+ "name": "websocket",
5871
+ "hasDynamicHelp": false,
5872
+ "multiple": false,
5873
+ "type": "option"
5874
+ },
5875
+ "skipauth": {
5876
+ "description": "Skip authentication check when a default username is required",
5877
+ "name": "skipauth",
5878
+ "allowNo": false,
5879
+ "type": "boolean"
5880
+ },
5881
+ "target-org": {
5882
+ "aliases": [
5883
+ "targetusername",
5884
+ "u"
5885
+ ],
5886
+ "char": "o",
5887
+ "deprecateAliases": true,
5888
+ "name": "target-org",
5889
+ "noCacheDefault": true,
5890
+ "required": true,
5891
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5892
+ "hasDynamicHelp": true,
5893
+ "multiple": false,
5894
+ "type": "option"
5895
+ }
5896
+ },
5897
+ "hasDynamicHelp": true,
5898
+ "hiddenAliases": [],
5899
+ "id": "hardis:org:diagnose:audittrail",
5900
+ "pluginAlias": "sfdx-hardis",
5901
+ "pluginName": "sfdx-hardis",
5902
+ "pluginType": "core",
5903
+ "strict": true,
5904
+ "enableJsonFlag": true,
5905
+ "title": "Diagnose content of Setup Audit Trail",
5906
+ "requiresProject": false,
5907
+ "isESM": true,
5908
+ "relativePath": [
5909
+ "lib",
5910
+ "commands",
5911
+ "hardis",
5912
+ "org",
5913
+ "diagnose",
5914
+ "audittrail.js"
5915
+ ],
5916
+ "aliasPermutations": [],
5917
+ "permutations": [
5918
+ "hardis:org:diagnose:audittrail",
5919
+ "org:hardis:diagnose:audittrail",
5920
+ "org:diagnose:hardis:audittrail",
5921
+ "org:diagnose:audittrail:hardis",
5922
+ "hardis:diagnose:org:audittrail",
5923
+ "diagnose:hardis:org:audittrail",
5924
+ "diagnose:org:hardis:audittrail",
5925
+ "diagnose:org:audittrail:hardis",
5926
+ "hardis:diagnose:audittrail:org",
5927
+ "diagnose:hardis:audittrail:org",
5928
+ "diagnose:audittrail:hardis:org",
5929
+ "diagnose:audittrail:org:hardis",
5930
+ "hardis:org:audittrail:diagnose",
5931
+ "org:hardis:audittrail:diagnose",
5932
+ "org:audittrail:hardis:diagnose",
5933
+ "org:audittrail:diagnose:hardis",
5934
+ "hardis:audittrail:org:diagnose",
5935
+ "audittrail:hardis:org:diagnose",
5936
+ "audittrail:org:hardis:diagnose",
5937
+ "audittrail:org:diagnose:hardis",
5938
+ "hardis:audittrail:diagnose:org",
5939
+ "audittrail:hardis:diagnose:org",
5940
+ "audittrail:diagnose:hardis:org",
5941
+ "audittrail:diagnose:org:hardis"
5942
+ ]
5943
+ },
5944
+ "hardis:org:diagnose:instanceupgrade": {
5945
+ "aliases": [],
5946
+ "args": {},
5947
+ "description": "\n## Command Behavior\n\n**Retrieves and displays the scheduled upgrade date for a Salesforce org's instance.**\n\nThis command provides crucial information about when your Salesforce instance will be upgraded to the next major release (Spring, Summer, or Winter). This is vital for release planning, testing, and ensuring compatibility with upcoming Salesforce features.\n\nKey functionalities:\n\n- **Instance Identification:** Determines the Salesforce instance name of your target org.\n- **Upgrade Date Retrieval:** Fetches the planned start time of the next major core service upgrade for that instance from the Salesforce Status API.\n- **Days Until Upgrade:** Calculates and displays the number of days remaining until the next major upgrade.\n- **Severity-Based Logging:** Adjusts the log severity (info, warning) based on the proximity of the upgrade date, providing a visual cue for urgency.\n- **Notifications:** Sends notifications to configured channels (e.g., Slack, MS Teams, Grafana) with the upgrade information, making it suitable for automated monitoring.\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 `Organization` object in Salesforce to get the `InstanceName` of the target org.\n- **Salesforce Status API Integration:** It makes an HTTP GET request to the Salesforce Status API (`https://api.status.salesforce.com/v1/instances/{instanceName}/status`) to retrieve detailed information about the instance, including scheduled maintenances.\n- **Data Parsing:** It parses the JSON response from the Status API to extract the relevant major release upgrade information.\n- **Date Calculation:** Uses the `moment` library to calculate the difference in days between the current date and the planned upgrade date.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including the instance name, upgrade date, and days remaining, along with relevant metrics for monitoring dashboards.\n- **User Feedback:** Provides clear messages to the user about the upgrade status and proximity.\n</details>\n",
5948
+ "examples": [
5949
+ "$ sf hardis:org:diagnose:instanceupgrade"
5950
+ ],
5951
+ "flags": {
5952
+ "json": {
5953
+ "description": "Format output as json.",
5954
+ "helpGroup": "GLOBAL",
5955
+ "name": "json",
5956
+ "allowNo": false,
5957
+ "type": "boolean"
5958
+ },
5959
+ "flags-dir": {
5960
+ "helpGroup": "GLOBAL",
5961
+ "name": "flags-dir",
5962
+ "summary": "Import flag values from a directory.",
5963
+ "hasDynamicHelp": false,
5964
+ "multiple": false,
5965
+ "type": "option"
5966
+ },
5967
+ "debug": {
5968
+ "char": "d",
5969
+ "description": "Activate debug mode (more logs)",
5970
+ "name": "debug",
5971
+ "allowNo": false,
5972
+ "type": "boolean"
5973
+ },
5974
+ "websocket": {
5975
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5976
+ "name": "websocket",
5977
+ "hasDynamicHelp": false,
5978
+ "multiple": false,
5979
+ "type": "option"
5980
+ },
5981
+ "skipauth": {
5982
+ "description": "Skip authentication check when a default username is required",
5983
+ "name": "skipauth",
5984
+ "allowNo": false,
5985
+ "type": "boolean"
5986
+ },
5987
+ "target-org": {
5988
+ "aliases": [
5989
+ "targetusername",
5990
+ "u"
5991
+ ],
5992
+ "char": "o",
5993
+ "deprecateAliases": true,
5994
+ "name": "target-org",
5995
+ "noCacheDefault": true,
5996
+ "required": true,
5997
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5998
+ "hasDynamicHelp": true,
5999
+ "multiple": false,
6000
+ "type": "option"
6001
+ }
6002
+ },
6003
+ "hasDynamicHelp": true,
6004
+ "hiddenAliases": [],
6005
+ "id": "hardis:org:diagnose:instanceupgrade",
6006
+ "pluginAlias": "sfdx-hardis",
6007
+ "pluginName": "sfdx-hardis",
6008
+ "pluginType": "core",
6009
+ "strict": true,
6010
+ "enableJsonFlag": true,
6011
+ "title": "Get Instance Upgrade date",
6012
+ "requiresProject": false,
6013
+ "isESM": true,
6014
+ "relativePath": [
6015
+ "lib",
6016
+ "commands",
6017
+ "hardis",
6018
+ "org",
6019
+ "diagnose",
6020
+ "instanceupgrade.js"
6021
+ ],
6022
+ "aliasPermutations": [],
6023
+ "permutations": [
6024
+ "hardis:org:diagnose:instanceupgrade",
6025
+ "org:hardis:diagnose:instanceupgrade",
6026
+ "org:diagnose:hardis:instanceupgrade",
6027
+ "org:diagnose:instanceupgrade:hardis",
6028
+ "hardis:diagnose:org:instanceupgrade",
6029
+ "diagnose:hardis:org:instanceupgrade",
6030
+ "diagnose:org:hardis:instanceupgrade",
6031
+ "diagnose:org:instanceupgrade:hardis",
6032
+ "hardis:diagnose:instanceupgrade:org",
6033
+ "diagnose:hardis:instanceupgrade:org",
6034
+ "diagnose:instanceupgrade:hardis:org",
6035
+ "diagnose:instanceupgrade:org:hardis",
5767
6036
  "hardis:org:instanceupgrade:diagnose",
5768
6037
  "org:hardis:instanceupgrade:diagnose",
5769
6038
  "org:instanceupgrade:hardis:diagnose",
@@ -6802,12 +7071,13 @@
6802
7071
  "unusedusers:diagnose:org:hardis"
6803
7072
  ]
6804
7073
  },
6805
- "hardis:org:files:export": {
7074
+ "hardis:org:fix:listviewmine": {
6806
7075
  "aliases": [],
6807
7076
  "args": {},
6808
- "description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, output naming conventions, and file size filtering.\n- **File Size Filtering:** Supports minimum file size filtering via the `fileSizeMin` configuration parameter (in KB). Files smaller than the specified size will be skipped during export.\n- **File Validation:** After downloading each file, validates the integrity by:\n - **Checksum Validation:** For ContentVersion files, compares MD5 checksum with Salesforce's stored checksum\n - **Size Validation:** For both ContentVersion and Attachment files, verifies actual file size matches expected size\n - **Status Tracking:** Files are categorized with specific statuses: `success` (valid files), `failed` (download errors), `skipped` (filtered files), `invalid` (downloaded but failed validation)\n - All validation results are logged in the CSV export log for audit purposes\n- **Resume/Restart Capability:** \n - **Resume Mode:** When `--resume` flag is used (default in CI environments), checks existing downloaded files for validity. Valid files are skipped, invalid files are re-downloaded.\n - **Restart Mode:** When resume is disabled, clears the output folder and starts a fresh export.\n - **Interactive Mode:** When existing files are found and `--resume` is not explicitly specified (non-CI environments), prompts the user to choose between resume or restart.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesExporter Class:** The core logic is encapsulated within the `FilesExporter` class, which orchestrates the entire export process.\n- **SOQL Queries (Bulk API):** It uses Salesforce Bulk API queries to efficiently retrieve large volumes of parent record IDs and file metadata, including checksums and file sizes.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File Validation:** After each successful download, validates file integrity by comparing checksums (ContentVersion) and file sizes (both ContentVersion and Attachment) against Salesforce metadata.\n- **Resume Logic:** In resume mode, checks for existing files before downloading, validates their integrity, and only re-downloads invalid or missing files. This enables efficient recovery from interrupted exports.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project, `promptFilesExportConfiguration` for customizing export options, and prompts for resume/restart choice when existing files are found.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues, API limits, and file validation failures. Each file is assigned a specific status (`success`, `failed`, `skipped`, `invalid`) for comprehensive tracking and troubleshooting.\n</details>\n",
7077
+ "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",
6809
7078
  "examples": [
6810
- "$ sf hardis:org:files:export"
7079
+ "$ sf hardis:org:fix:listviewmine",
7080
+ "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
6811
7081
  ],
6812
7082
  "flags": {
6813
7083
  "json": {
@@ -6825,48 +7095,14 @@
6825
7095
  "multiple": false,
6826
7096
  "type": "option"
6827
7097
  },
6828
- "path": {
6829
- "char": "p",
6830
- "description": "Path to the file export project",
6831
- "name": "path",
6832
- "hasDynamicHelp": false,
6833
- "multiple": false,
6834
- "type": "option"
6835
- },
6836
- "chunksize": {
6837
- "char": "c",
6838
- "description": "Number of records to add in a chunk before it is processed",
6839
- "name": "chunksize",
6840
- "default": 1000,
6841
- "hasDynamicHelp": false,
6842
- "multiple": false,
6843
- "type": "option"
6844
- },
6845
- "polltimeout": {
6846
- "char": "t",
6847
- "description": "Timeout in MS for Bulk API calls",
6848
- "name": "polltimeout",
6849
- "default": 300000,
6850
- "hasDynamicHelp": false,
6851
- "multiple": false,
6852
- "type": "option"
6853
- },
6854
- "startchunknumber": {
6855
- "char": "s",
6856
- "description": "Chunk number to start from",
6857
- "name": "startchunknumber",
6858
- "default": 0,
7098
+ "listviews": {
7099
+ "char": "l",
7100
+ "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
7101
+ "name": "listviews",
6859
7102
  "hasDynamicHelp": false,
6860
7103
  "multiple": false,
6861
7104
  "type": "option"
6862
7105
  },
6863
- "resume": {
6864
- "char": "r",
6865
- "description": "Resume previous export by checking existing files (default in CI)",
6866
- "name": "resume",
6867
- "allowNo": false,
6868
- "type": "boolean"
6869
- },
6870
7106
  "debug": {
6871
7107
  "char": "d",
6872
7108
  "description": "Activate debug mode (more logs)",
@@ -6905,57 +7141,59 @@
6905
7141
  },
6906
7142
  "hasDynamicHelp": true,
6907
7143
  "hiddenAliases": [],
6908
- "id": "hardis:org:files:export",
7144
+ "id": "hardis:org:fix:listviewmine",
6909
7145
  "pluginAlias": "sfdx-hardis",
6910
7146
  "pluginName": "sfdx-hardis",
6911
7147
  "pluginType": "core",
6912
7148
  "strict": true,
6913
7149
  "enableJsonFlag": true,
6914
- "title": "Export files",
6915
- "requiresProject": false,
7150
+ "title": "Fix listviews with ",
7151
+ "requiresProject": true,
6916
7152
  "isESM": true,
6917
7153
  "relativePath": [
6918
7154
  "lib",
6919
7155
  "commands",
6920
7156
  "hardis",
6921
7157
  "org",
6922
- "files",
6923
- "export.js"
7158
+ "fix",
7159
+ "listviewmine.js"
6924
7160
  ],
6925
7161
  "aliasPermutations": [],
6926
7162
  "permutations": [
6927
- "hardis:org:files:export",
6928
- "org:hardis:files:export",
6929
- "org:files:hardis:export",
6930
- "org:files:export:hardis",
6931
- "hardis:files:org:export",
6932
- "files:hardis:org:export",
6933
- "files:org:hardis:export",
6934
- "files:org:export:hardis",
6935
- "hardis:files:export:org",
6936
- "files:hardis:export:org",
6937
- "files:export:hardis:org",
6938
- "files:export:org:hardis",
6939
- "hardis:org:export:files",
6940
- "org:hardis:export:files",
6941
- "org:export:hardis:files",
6942
- "org:export:files:hardis",
6943
- "hardis:export:org:files",
6944
- "export:hardis:org:files",
6945
- "export:org:hardis:files",
6946
- "export:org:files:hardis",
6947
- "hardis:export:files:org",
6948
- "export:hardis:files:org",
6949
- "export:files:hardis:org",
6950
- "export:files:org:hardis"
7163
+ "hardis:org:fix:listviewmine",
7164
+ "org:hardis:fix:listviewmine",
7165
+ "org:fix:hardis:listviewmine",
7166
+ "org:fix:listviewmine:hardis",
7167
+ "hardis:fix:org:listviewmine",
7168
+ "fix:hardis:org:listviewmine",
7169
+ "fix:org:hardis:listviewmine",
7170
+ "fix:org:listviewmine:hardis",
7171
+ "hardis:fix:listviewmine:org",
7172
+ "fix:hardis:listviewmine:org",
7173
+ "fix:listviewmine:hardis:org",
7174
+ "fix:listviewmine:org:hardis",
7175
+ "hardis:org:listviewmine:fix",
7176
+ "org:hardis:listviewmine:fix",
7177
+ "org:listviewmine:hardis:fix",
7178
+ "org:listviewmine:fix:hardis",
7179
+ "hardis:listviewmine:org:fix",
7180
+ "listviewmine:hardis:org:fix",
7181
+ "listviewmine:org:hardis:fix",
7182
+ "listviewmine:org:fix:hardis",
7183
+ "hardis:listviewmine:fix:org",
7184
+ "listviewmine:hardis:fix:org",
7185
+ "listviewmine:fix:hardis:org",
7186
+ "listviewmine:fix:org:hardis"
6951
7187
  ]
6952
7188
  },
6953
- "hardis:org:files:import": {
7189
+ "hardis:org:generate:packagexmlfull": {
6954
7190
  "aliases": [],
6955
7191
  "args": {},
6956
- "description": "\nThis command facilitates the mass upload of files into Salesforce, allowing you to populate records with associated documents, images, or other file types. It's a crucial tool for data migration, content seeding, or synchronizing external file repositories with Salesforce.\n\nKey functionalities:\n\n- **Configuration-Driven Import:** Relies on an `export.json` file within a designated file export project (created using `sf hardis:org:configure:files`) to determine which files to import and how they should be associated with Salesforce records.\n- **Interactive Project Selection:** If the file import project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Overwrite Option:** The `--overwrite` flag allows you to replace existing files in Salesforce with local versions that have the same name. Be aware that this option doubles the number of API calls used.\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for how to export files, which is often a prerequisite for importing:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesImporter Class:** The core logic is encapsulated within the `FilesImporter` class, which orchestrates the entire import process.\n- **File System Scan:** Scans the local file system within the configured project directory to identify files for import.\n- **Salesforce API Interaction:** Uses Salesforce APIs (e.g., ContentVersion, Attachment) to upload files and associate them with records.\n- **Configuration Loading:** Reads the `export.json` file to get the import configuration, including SOQL queries to identify parent records for file association.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file import project and `prompts` for confirming the overwrite behavior.\n- **Error Handling:** Includes mechanisms to handle potential errors during the import process, such as API limits or file upload failures.\n</details>\n",
7192
+ "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",
6957
7193
  "examples": [
6958
- "$ sf hardis:org:files:import"
7194
+ "$ sf hardis:org:generate:packagexmlfull",
7195
+ "$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
7196
+ "$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
6959
7197
  ],
6960
7198
  "flags": {
6961
7199
  "json": {
@@ -6973,21 +7211,13 @@
6973
7211
  "multiple": false,
6974
7212
  "type": "option"
6975
7213
  },
6976
- "path": {
6977
- "char": "p",
6978
- "description": "Path to the file export project",
6979
- "name": "path",
7214
+ "outputfile": {
7215
+ "description": "Output package.xml file",
7216
+ "name": "outputfile",
6980
7217
  "hasDynamicHelp": false,
6981
7218
  "multiple": false,
6982
7219
  "type": "option"
6983
7220
  },
6984
- "overwrite": {
6985
- "char": "f",
6986
- "description": "Override existing files (doubles the number of API calls)",
6987
- "name": "overwrite",
6988
- "allowNo": false,
6989
- "type": "boolean"
6990
- },
6991
7221
  "debug": {
6992
7222
  "char": "d",
6993
7223
  "description": "Activate debug mode (more logs)",
@@ -6995,6 +7225,13 @@
6995
7225
  "allowNo": false,
6996
7226
  "type": "boolean"
6997
7227
  },
7228
+ "no-prompt": {
7229
+ "char": "n",
7230
+ "description": "Do not prompt for org username, use the default one",
7231
+ "name": "no-prompt",
7232
+ "allowNo": false,
7233
+ "type": "boolean"
7234
+ },
6998
7235
  "websocket": {
6999
7236
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7000
7237
  "name": "websocket",
@@ -7026,13 +7263,13 @@
7026
7263
  },
7027
7264
  "hasDynamicHelp": true,
7028
7265
  "hiddenAliases": [],
7029
- "id": "hardis:org:files:import",
7266
+ "id": "hardis:org:generate:packagexmlfull",
7030
7267
  "pluginAlias": "sfdx-hardis",
7031
7268
  "pluginName": "sfdx-hardis",
7032
7269
  "pluginType": "core",
7033
7270
  "strict": true,
7034
7271
  "enableJsonFlag": true,
7035
- "title": "Import files",
7272
+ "title": "Generate Full Org package.xml",
7036
7273
  "requiresProject": false,
7037
7274
  "isESM": true,
7038
7275
  "relativePath": [
@@ -7040,44 +7277,43 @@
7040
7277
  "commands",
7041
7278
  "hardis",
7042
7279
  "org",
7043
- "files",
7044
- "import.js"
7280
+ "generate",
7281
+ "packagexmlfull.js"
7045
7282
  ],
7046
7283
  "aliasPermutations": [],
7047
7284
  "permutations": [
7048
- "hardis:org:files:import",
7049
- "org:hardis:files:import",
7050
- "org:files:hardis:import",
7051
- "org:files:import:hardis",
7052
- "hardis:files:org:import",
7053
- "files:hardis:org:import",
7054
- "files:org:hardis:import",
7055
- "files:org:import:hardis",
7056
- "hardis:files:import:org",
7057
- "files:hardis:import:org",
7058
- "files:import:hardis:org",
7059
- "files:import:org:hardis",
7060
- "hardis:org:import:files",
7061
- "org:hardis:import:files",
7062
- "org:import:hardis:files",
7063
- "org:import:files:hardis",
7064
- "hardis:import:org:files",
7065
- "import:hardis:org:files",
7066
- "import:org:hardis:files",
7067
- "import:org:files:hardis",
7068
- "hardis:import:files:org",
7069
- "import:hardis:files:org",
7070
- "import:files:hardis:org",
7071
- "import:files:org:hardis"
7285
+ "hardis:org:generate:packagexmlfull",
7286
+ "org:hardis:generate:packagexmlfull",
7287
+ "org:generate:hardis:packagexmlfull",
7288
+ "org:generate:packagexmlfull:hardis",
7289
+ "hardis:generate:org:packagexmlfull",
7290
+ "generate:hardis:org:packagexmlfull",
7291
+ "generate:org:hardis:packagexmlfull",
7292
+ "generate:org:packagexmlfull:hardis",
7293
+ "hardis:generate:packagexmlfull:org",
7294
+ "generate:hardis:packagexmlfull:org",
7295
+ "generate:packagexmlfull:hardis:org",
7296
+ "generate:packagexmlfull:org:hardis",
7297
+ "hardis:org:packagexmlfull:generate",
7298
+ "org:hardis:packagexmlfull:generate",
7299
+ "org:packagexmlfull:hardis:generate",
7300
+ "org:packagexmlfull:generate:hardis",
7301
+ "hardis:packagexmlfull:org:generate",
7302
+ "packagexmlfull:hardis:org:generate",
7303
+ "packagexmlfull:org:hardis:generate",
7304
+ "packagexmlfull:org:generate:hardis",
7305
+ "hardis:packagexmlfull:generate:org",
7306
+ "packagexmlfull:hardis:generate:org",
7307
+ "packagexmlfull:generate:hardis:org",
7308
+ "packagexmlfull:generate:org:hardis"
7072
7309
  ]
7073
7310
  },
7074
- "hardis:org:fix:listviewmine": {
7311
+ "hardis:org:monitor:all": {
7075
7312
  "aliases": [],
7076
7313
  "args": {},
7077
- "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",
7314
+ "description": "Monitor org, generate reports and sends notifications\n\nYou can disable some commands defining either a **monitoringDisable** property in `.sfdx-hardis.yml`, or a comma separated list in env variable **MONITORING_DISABLE**\n\nExample in .sfdx-hardis.yml:\n \n```yaml\nmonitoringDisable:\n - METADATA_STATUS\n - MISSING_ATTRIBUTES\n - UNUSED_METADATAS\n```\n \nExample in env var:\n\n```sh\nMONITORING_DISABLE=METADATA_STATUS,MISSING_ATTRIBUTES,UNUSED_METADATAS\n```\n\nA [default list of monitoring commands](https://sfdx-hardis.cloudity.com/salesforce-monitoring-home/#monitoring-commands) is used, if you want to override it you can define property **monitoringCommands** in your .sfdx-hardis.yml file\n\nExample:\n\n```yaml\nmonitoringCommands:\n - title: My Custom command\n command: sf my:custom:command\n - title: My Custom command 2\n command: sf my:other:custom:command\n```\n\nYou can force the daily run of all commands by defining env var `MONITORING_IGNORE_FREQUENCY=true`\n\nThe default list of commands is the following:\n\n| Key | Description | Command | Frequency |\n| :---: | :---- | :---- | :-----: |\n| [AUDIT_TRAIL](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | Detect suspect setup actions in major org | [sf hardis:org:diagnose:audittrail](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | daily |\n| [LEGACY_API](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | Detect calls to deprecated API versions | [sf hardis:org:diagnose:legacyapi](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | daily |\n| [ORG_LIMITS](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | Detect if org limits are close to be reached | [sf hardis:org:monitor:limits](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | daily |\n| [UNSECURED_CONNECTED_APPS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unsecure-connected-apps) | Detect unsecured Connected Apps in an org | [sf hardis:org:diagnose:unsecure-connected-apps](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unsecure-connected-apps) | daily |\n| [LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | Extract licenses information | [sf hardis:org:diagnose:licenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | weekly |\n| [LINT_ACCESS](https://sfdx-hardis.cloudity.com/hardis/lint/access) | Detect custom elements with no access rights defined in permission sets | [sf hardis:lint:access](https://sfdx-hardis.cloudity.com/hardis/lint/access) | weekly |\n| [UNUSED_LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | Detect permission set licenses that are assigned to users that do not need them | [sf hardis:org:diagnose:unusedlicenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | weekly |\n| [UNUSED_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users without recent logins | [sf hardis:org:diagnose:unusedusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ACTIVE_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users with recent logins | [sf hardis:org:diagnose:unusedusers --returnactiveusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ORG_INFO](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | Get org info + SF instance info + next major upgrade date | [sf hardis:org:diagnose:instanceupgrade](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | weekly |\n| [RELEASE_UPDATES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | Gather warnings about incoming and overdue Release Updates | [sf hardis:org:diagnose:releaseupdates](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | weekly |\n| [UNUSED_METADATAS](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | Detect custom labels and custom permissions that are not in use | [sf hardis:lint:unusedmetadatas](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | weekly |\n| [UNUSED_APEX_CLASSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | Detect unused Apex classes in an org | [sf hardis:org:diagnose:unused-apex-classes](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | weekly |\n| [CONNECTED_APPS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | Detect unused Connected Apps in an org | [sf hardis:org:diagnose:unused-connected-apps](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | weekly |\n| [METADATA_STATUS](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | Detect inactive metadata | [sf hardis:lint:metadatastatus](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | weekly |\n| [MISSING_ATTRIBUTES](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | Detect missing description on custom field | [sf hardis:lint:missingattributes](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | weekly |\n\n",
7078
7315
  "examples": [
7079
- "$ sf hardis:org:fix:listviewmine",
7080
- "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
7316
+ "$ sf hardis:org:monitor:all"
7081
7317
  ],
7082
7318
  "flags": {
7083
7319
  "json": {
@@ -7095,14 +7331,6 @@
7095
7331
  "multiple": false,
7096
7332
  "type": "option"
7097
7333
  },
7098
- "listviews": {
7099
- "char": "l",
7100
- "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
7101
- "name": "listviews",
7102
- "hasDynamicHelp": false,
7103
- "multiple": false,
7104
- "type": "option"
7105
- },
7106
7334
  "debug": {
7107
7335
  "char": "d",
7108
7336
  "description": "Activate debug mode (more logs)",
@@ -7141,235 +7369,7 @@
7141
7369
  },
7142
7370
  "hasDynamicHelp": true,
7143
7371
  "hiddenAliases": [],
7144
- "id": "hardis:org:fix:listviewmine",
7145
- "pluginAlias": "sfdx-hardis",
7146
- "pluginName": "sfdx-hardis",
7147
- "pluginType": "core",
7148
- "strict": true,
7149
- "enableJsonFlag": true,
7150
- "title": "Fix listviews with ",
7151
- "requiresProject": true,
7152
- "isESM": true,
7153
- "relativePath": [
7154
- "lib",
7155
- "commands",
7156
- "hardis",
7157
- "org",
7158
- "fix",
7159
- "listviewmine.js"
7160
- ],
7161
- "aliasPermutations": [],
7162
- "permutations": [
7163
- "hardis:org:fix:listviewmine",
7164
- "org:hardis:fix:listviewmine",
7165
- "org:fix:hardis:listviewmine",
7166
- "org:fix:listviewmine:hardis",
7167
- "hardis:fix:org:listviewmine",
7168
- "fix:hardis:org:listviewmine",
7169
- "fix:org:hardis:listviewmine",
7170
- "fix:org:listviewmine:hardis",
7171
- "hardis:fix:listviewmine:org",
7172
- "fix:hardis:listviewmine:org",
7173
- "fix:listviewmine:hardis:org",
7174
- "fix:listviewmine:org:hardis",
7175
- "hardis:org:listviewmine:fix",
7176
- "org:hardis:listviewmine:fix",
7177
- "org:listviewmine:hardis:fix",
7178
- "org:listviewmine:fix:hardis",
7179
- "hardis:listviewmine:org:fix",
7180
- "listviewmine:hardis:org:fix",
7181
- "listviewmine:org:hardis:fix",
7182
- "listviewmine:org:fix:hardis",
7183
- "hardis:listviewmine:fix:org",
7184
- "listviewmine:hardis:fix:org",
7185
- "listviewmine:fix:hardis:org",
7186
- "listviewmine:fix:org:hardis"
7187
- ]
7188
- },
7189
- "hardis:org:generate:packagexmlfull": {
7190
- "aliases": [],
7191
- "args": {},
7192
- "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",
7193
- "examples": [
7194
- "$ sf hardis:org:generate:packagexmlfull",
7195
- "$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
7196
- "$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
7197
- ],
7198
- "flags": {
7199
- "json": {
7200
- "description": "Format output as json.",
7201
- "helpGroup": "GLOBAL",
7202
- "name": "json",
7203
- "allowNo": false,
7204
- "type": "boolean"
7205
- },
7206
- "flags-dir": {
7207
- "helpGroup": "GLOBAL",
7208
- "name": "flags-dir",
7209
- "summary": "Import flag values from a directory.",
7210
- "hasDynamicHelp": false,
7211
- "multiple": false,
7212
- "type": "option"
7213
- },
7214
- "outputfile": {
7215
- "description": "Output package.xml file",
7216
- "name": "outputfile",
7217
- "hasDynamicHelp": false,
7218
- "multiple": false,
7219
- "type": "option"
7220
- },
7221
- "debug": {
7222
- "char": "d",
7223
- "description": "Activate debug mode (more logs)",
7224
- "name": "debug",
7225
- "allowNo": false,
7226
- "type": "boolean"
7227
- },
7228
- "no-prompt": {
7229
- "char": "n",
7230
- "description": "Do not prompt for org username, use the default one",
7231
- "name": "no-prompt",
7232
- "allowNo": false,
7233
- "type": "boolean"
7234
- },
7235
- "websocket": {
7236
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7237
- "name": "websocket",
7238
- "hasDynamicHelp": false,
7239
- "multiple": false,
7240
- "type": "option"
7241
- },
7242
- "skipauth": {
7243
- "description": "Skip authentication check when a default username is required",
7244
- "name": "skipauth",
7245
- "allowNo": false,
7246
- "type": "boolean"
7247
- },
7248
- "target-org": {
7249
- "aliases": [
7250
- "targetusername",
7251
- "u"
7252
- ],
7253
- "char": "o",
7254
- "deprecateAliases": true,
7255
- "name": "target-org",
7256
- "noCacheDefault": true,
7257
- "required": true,
7258
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7259
- "hasDynamicHelp": true,
7260
- "multiple": false,
7261
- "type": "option"
7262
- }
7263
- },
7264
- "hasDynamicHelp": true,
7265
- "hiddenAliases": [],
7266
- "id": "hardis:org:generate:packagexmlfull",
7267
- "pluginAlias": "sfdx-hardis",
7268
- "pluginName": "sfdx-hardis",
7269
- "pluginType": "core",
7270
- "strict": true,
7271
- "enableJsonFlag": true,
7272
- "title": "Generate Full Org package.xml",
7273
- "requiresProject": false,
7274
- "isESM": true,
7275
- "relativePath": [
7276
- "lib",
7277
- "commands",
7278
- "hardis",
7279
- "org",
7280
- "generate",
7281
- "packagexmlfull.js"
7282
- ],
7283
- "aliasPermutations": [],
7284
- "permutations": [
7285
- "hardis:org:generate:packagexmlfull",
7286
- "org:hardis:generate:packagexmlfull",
7287
- "org:generate:hardis:packagexmlfull",
7288
- "org:generate:packagexmlfull:hardis",
7289
- "hardis:generate:org:packagexmlfull",
7290
- "generate:hardis:org:packagexmlfull",
7291
- "generate:org:hardis:packagexmlfull",
7292
- "generate:org:packagexmlfull:hardis",
7293
- "hardis:generate:packagexmlfull:org",
7294
- "generate:hardis:packagexmlfull:org",
7295
- "generate:packagexmlfull:hardis:org",
7296
- "generate:packagexmlfull:org:hardis",
7297
- "hardis:org:packagexmlfull:generate",
7298
- "org:hardis:packagexmlfull:generate",
7299
- "org:packagexmlfull:hardis:generate",
7300
- "org:packagexmlfull:generate:hardis",
7301
- "hardis:packagexmlfull:org:generate",
7302
- "packagexmlfull:hardis:org:generate",
7303
- "packagexmlfull:org:hardis:generate",
7304
- "packagexmlfull:org:generate:hardis",
7305
- "hardis:packagexmlfull:generate:org",
7306
- "packagexmlfull:hardis:generate:org",
7307
- "packagexmlfull:generate:hardis:org",
7308
- "packagexmlfull:generate:org:hardis"
7309
- ]
7310
- },
7311
- "hardis:org:monitor:all": {
7312
- "aliases": [],
7313
- "args": {},
7314
- "description": "Monitor org, generate reports and sends notifications\n\nYou can disable some commands defining either a **monitoringDisable** property in `.sfdx-hardis.yml`, or a comma separated list in env variable **MONITORING_DISABLE**\n\nExample in .sfdx-hardis.yml:\n \n```yaml\nmonitoringDisable:\n - METADATA_STATUS\n - MISSING_ATTRIBUTES\n - UNUSED_METADATAS\n```\n \nExample in env var:\n\n```sh\nMONITORING_DISABLE=METADATA_STATUS,MISSING_ATTRIBUTES,UNUSED_METADATAS\n```\n\nA [default list of monitoring commands](https://sfdx-hardis.cloudity.com/salesforce-monitoring-home/#monitoring-commands) is used, if you want to override it you can define property **monitoringCommands** in your .sfdx-hardis.yml file\n\nExample:\n\n```yaml\nmonitoringCommands:\n - title: My Custom command\n command: sf my:custom:command\n - title: My Custom command 2\n command: sf my:other:custom:command\n```\n\nYou can force the daily run of all commands by defining env var `MONITORING_IGNORE_FREQUENCY=true`\n\nThe default list of commands is the following:\n\n| Key | Description | Command | Frequency |\n| :---: | :---- | :---- | :-----: |\n| [AUDIT_TRAIL](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | Detect suspect setup actions in major org | [sf hardis:org:diagnose:audittrail](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | daily |\n| [LEGACY_API](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | Detect calls to deprecated API versions | [sf hardis:org:diagnose:legacyapi](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | daily |\n| [ORG_LIMITS](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | Detect if org limits are close to be reached | [sf hardis:org:monitor:limits](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | daily |\n| [UNSECURED_CONNECTED_APPS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unsecure-connected-apps) | Detect unsecured Connected Apps in an org | [sf hardis:org:diagnose:unsecure-connected-apps](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unsecure-connected-apps) | daily |\n| [LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | Extract licenses information | [sf hardis:org:diagnose:licenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | weekly |\n| [LINT_ACCESS](https://sfdx-hardis.cloudity.com/hardis/lint/access) | Detect custom elements with no access rights defined in permission sets | [sf hardis:lint:access](https://sfdx-hardis.cloudity.com/hardis/lint/access) | weekly |\n| [UNUSED_LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | Detect permission set licenses that are assigned to users that do not need them | [sf hardis:org:diagnose:unusedlicenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | weekly |\n| [UNUSED_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users without recent logins | [sf hardis:org:diagnose:unusedusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ACTIVE_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users with recent logins | [sf hardis:org:diagnose:unusedusers --returnactiveusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ORG_INFO](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | Get org info + SF instance info + next major upgrade date | [sf hardis:org:diagnose:instanceupgrade](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | weekly |\n| [RELEASE_UPDATES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | Gather warnings about incoming and overdue Release Updates | [sf hardis:org:diagnose:releaseupdates](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | weekly |\n| [UNUSED_METADATAS](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | Detect custom labels and custom permissions that are not in use | [sf hardis:lint:unusedmetadatas](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | weekly |\n| [UNUSED_APEX_CLASSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | Detect unused Apex classes in an org | [sf hardis:org:diagnose:unused-apex-classes](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | weekly |\n| [CONNECTED_APPS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | Detect unused Connected Apps in an org | [sf hardis:org:diagnose:unused-connected-apps](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | weekly |\n| [METADATA_STATUS](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | Detect inactive metadata | [sf hardis:lint:metadatastatus](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | weekly |\n| [MISSING_ATTRIBUTES](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | Detect missing description on custom field | [sf hardis:lint:missingattributes](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | weekly |\n\n",
7315
- "examples": [
7316
- "$ sf hardis:org:monitor:all"
7317
- ],
7318
- "flags": {
7319
- "json": {
7320
- "description": "Format output as json.",
7321
- "helpGroup": "GLOBAL",
7322
- "name": "json",
7323
- "allowNo": false,
7324
- "type": "boolean"
7325
- },
7326
- "flags-dir": {
7327
- "helpGroup": "GLOBAL",
7328
- "name": "flags-dir",
7329
- "summary": "Import flag values from a directory.",
7330
- "hasDynamicHelp": false,
7331
- "multiple": false,
7332
- "type": "option"
7333
- },
7334
- "debug": {
7335
- "char": "d",
7336
- "description": "Activate debug mode (more logs)",
7337
- "name": "debug",
7338
- "allowNo": false,
7339
- "type": "boolean"
7340
- },
7341
- "websocket": {
7342
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7343
- "name": "websocket",
7344
- "hasDynamicHelp": false,
7345
- "multiple": false,
7346
- "type": "option"
7347
- },
7348
- "skipauth": {
7349
- "description": "Skip authentication check when a default username is required",
7350
- "name": "skipauth",
7351
- "allowNo": false,
7352
- "type": "boolean"
7353
- },
7354
- "target-org": {
7355
- "aliases": [
7356
- "targetusername",
7357
- "u"
7358
- ],
7359
- "char": "o",
7360
- "deprecateAliases": true,
7361
- "name": "target-org",
7362
- "noCacheDefault": true,
7363
- "required": true,
7364
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7365
- "hasDynamicHelp": true,
7366
- "multiple": false,
7367
- "type": "option"
7368
- }
7369
- },
7370
- "hasDynamicHelp": true,
7371
- "hiddenAliases": [],
7372
- "id": "hardis:org:monitor:all",
7372
+ "id": "hardis:org:monitor:all",
7373
7373
  "pluginAlias": "sfdx-hardis",
7374
7374
  "pluginName": "sfdx-hardis",
7375
7375
  "pluginType": "core",
@@ -7771,290 +7771,22 @@
7771
7771
  "monitor:hardis:org:limits",
7772
7772
  "monitor:org:hardis:limits",
7773
7773
  "monitor:org:limits:hardis",
7774
- "hardis:monitor:limits:org",
7775
- "monitor:hardis:limits:org",
7776
- "monitor:limits:hardis:org",
7777
- "monitor:limits:org:hardis",
7778
- "hardis:org:limits:monitor",
7779
- "org:hardis:limits:monitor",
7780
- "org:limits:hardis:monitor",
7781
- "org:limits:monitor:hardis",
7782
- "hardis:limits:org:monitor",
7783
- "limits:hardis:org:monitor",
7784
- "limits:org:hardis:monitor",
7785
- "limits:org:monitor:hardis",
7786
- "hardis:limits:monitor:org",
7787
- "limits:hardis:monitor:org",
7788
- "limits:monitor:hardis:org",
7789
- "limits:monitor:org:hardis"
7790
- ]
7791
- },
7792
- "hardis:org:purge:apexlog": {
7793
- "aliases": [],
7794
- "args": {},
7795
- "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",
7796
- "examples": [
7797
- "$ sf hardis:org:purge:apexlog",
7798
- "$ sf hardis:org:purge:apexlog --target-org nicolas.vuillamy@gmail.com"
7799
- ],
7800
- "flags": {
7801
- "json": {
7802
- "description": "Format output as json.",
7803
- "helpGroup": "GLOBAL",
7804
- "name": "json",
7805
- "allowNo": false,
7806
- "type": "boolean"
7807
- },
7808
- "flags-dir": {
7809
- "helpGroup": "GLOBAL",
7810
- "name": "flags-dir",
7811
- "summary": "Import flag values from a directory.",
7812
- "hasDynamicHelp": false,
7813
- "multiple": false,
7814
- "type": "option"
7815
- },
7816
- "prompt": {
7817
- "char": "z",
7818
- "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
7819
- "name": "prompt",
7820
- "allowNo": true,
7821
- "type": "boolean"
7822
- },
7823
- "debug": {
7824
- "char": "d",
7825
- "description": "Activate debug mode (more logs)",
7826
- "name": "debug",
7827
- "allowNo": false,
7828
- "type": "boolean"
7829
- },
7830
- "websocket": {
7831
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7832
- "name": "websocket",
7833
- "hasDynamicHelp": false,
7834
- "multiple": false,
7835
- "type": "option"
7836
- },
7837
- "skipauth": {
7838
- "description": "Skip authentication check when a default username is required",
7839
- "name": "skipauth",
7840
- "allowNo": false,
7841
- "type": "boolean"
7842
- },
7843
- "target-org": {
7844
- "aliases": [
7845
- "targetusername",
7846
- "u"
7847
- ],
7848
- "char": "o",
7849
- "deprecateAliases": true,
7850
- "name": "target-org",
7851
- "noCacheDefault": true,
7852
- "required": true,
7853
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7854
- "hasDynamicHelp": true,
7855
- "multiple": false,
7856
- "type": "option"
7857
- }
7858
- },
7859
- "hasDynamicHelp": true,
7860
- "hiddenAliases": [],
7861
- "id": "hardis:org:purge:apexlog",
7862
- "pluginAlias": "sfdx-hardis",
7863
- "pluginName": "sfdx-hardis",
7864
- "pluginType": "core",
7865
- "strict": true,
7866
- "enableJsonFlag": true,
7867
- "title": "Purge Apex Logs",
7868
- "requiresProject": false,
7869
- "isESM": true,
7870
- "relativePath": [
7871
- "lib",
7872
- "commands",
7873
- "hardis",
7874
- "org",
7875
- "purge",
7876
- "apexlog.js"
7877
- ],
7878
- "aliasPermutations": [],
7879
- "permutations": [
7880
- "hardis:org:purge:apexlog",
7881
- "org:hardis:purge:apexlog",
7882
- "org:purge:hardis:apexlog",
7883
- "org:purge:apexlog:hardis",
7884
- "hardis:purge:org:apexlog",
7885
- "purge:hardis:org:apexlog",
7886
- "purge:org:hardis:apexlog",
7887
- "purge:org:apexlog:hardis",
7888
- "hardis:purge:apexlog:org",
7889
- "purge:hardis:apexlog:org",
7890
- "purge:apexlog:hardis:org",
7891
- "purge:apexlog:org:hardis",
7892
- "hardis:org:apexlog:purge",
7893
- "org:hardis:apexlog:purge",
7894
- "org:apexlog:hardis:purge",
7895
- "org:apexlog:purge:hardis",
7896
- "hardis:apexlog:org:purge",
7897
- "apexlog:hardis:org:purge",
7898
- "apexlog:org:hardis:purge",
7899
- "apexlog:org:purge:hardis",
7900
- "hardis:apexlog:purge:org",
7901
- "apexlog:hardis:purge:org",
7902
- "apexlog:purge:hardis:org",
7903
- "apexlog:purge:org:hardis"
7904
- ]
7905
- },
7906
- "hardis:org:purge:flow": {
7907
- "aliases": [],
7908
- "args": {},
7909
- "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",
7910
- "examples": [
7911
- "$ sf hardis:org:purge:flow",
7912
- "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --no-prompt --delete-flow-interviews",
7913
- "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --status \"Obsolete,Draft,InvalidDraft\" --name TestFlow"
7914
- ],
7915
- "flags": {
7916
- "json": {
7917
- "description": "Format output as json.",
7918
- "helpGroup": "GLOBAL",
7919
- "name": "json",
7920
- "allowNo": false,
7921
- "type": "boolean"
7922
- },
7923
- "flags-dir": {
7924
- "helpGroup": "GLOBAL",
7925
- "name": "flags-dir",
7926
- "summary": "Import flag values from a directory.",
7927
- "hasDynamicHelp": false,
7928
- "multiple": false,
7929
- "type": "option"
7930
- },
7931
- "prompt": {
7932
- "char": "z",
7933
- "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
7934
- "name": "prompt",
7935
- "allowNo": true,
7936
- "type": "boolean"
7937
- },
7938
- "name": {
7939
- "char": "n",
7940
- "description": "Filter according to Name criteria",
7941
- "name": "name",
7942
- "hasDynamicHelp": false,
7943
- "multiple": false,
7944
- "type": "option"
7945
- },
7946
- "status": {
7947
- "char": "s",
7948
- "description": "Filter according to Status criteria",
7949
- "name": "status",
7950
- "hasDynamicHelp": false,
7951
- "multiple": false,
7952
- "type": "option"
7953
- },
7954
- "delete-flow-interviews": {
7955
- "char": "w",
7956
- "description": "If the presence of Flow interviews prevent to delete flows versions, delete them before retrying to delete flow versions",
7957
- "name": "delete-flow-interviews",
7958
- "allowNo": false,
7959
- "type": "boolean"
7960
- },
7961
- "allowpurgefailure": {
7962
- "char": "f",
7963
- "description": "Allows purges to fail without exiting with 1. Use --no-allowpurgefailure to disable",
7964
- "name": "allowpurgefailure",
7965
- "allowNo": true,
7966
- "type": "boolean"
7967
- },
7968
- "instanceurl": {
7969
- "char": "r",
7970
- "description": "URL of org instance",
7971
- "name": "instanceurl",
7972
- "default": "https://login.salesforce.com",
7973
- "hasDynamicHelp": false,
7974
- "multiple": false,
7975
- "type": "option"
7976
- },
7977
- "debug": {
7978
- "char": "d",
7979
- "description": "Activate debug mode (more logs)",
7980
- "name": "debug",
7981
- "allowNo": false,
7982
- "type": "boolean"
7983
- },
7984
- "websocket": {
7985
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7986
- "name": "websocket",
7987
- "hasDynamicHelp": false,
7988
- "multiple": false,
7989
- "type": "option"
7990
- },
7991
- "skipauth": {
7992
- "description": "Skip authentication check when a default username is required",
7993
- "name": "skipauth",
7994
- "allowNo": false,
7995
- "type": "boolean"
7996
- },
7997
- "target-org": {
7998
- "aliases": [
7999
- "targetusername",
8000
- "u"
8001
- ],
8002
- "char": "o",
8003
- "deprecateAliases": true,
8004
- "name": "target-org",
8005
- "noCacheDefault": true,
8006
- "required": true,
8007
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8008
- "hasDynamicHelp": true,
8009
- "multiple": false,
8010
- "type": "option"
8011
- }
8012
- },
8013
- "hasDynamicHelp": true,
8014
- "hiddenAliases": [],
8015
- "id": "hardis:org:purge:flow",
8016
- "pluginAlias": "sfdx-hardis",
8017
- "pluginName": "sfdx-hardis",
8018
- "pluginType": "core",
8019
- "strict": true,
8020
- "enableJsonFlag": true,
8021
- "title": "Purge Flow versions",
8022
- "requiresProject": false,
8023
- "isESM": true,
8024
- "relativePath": [
8025
- "lib",
8026
- "commands",
8027
- "hardis",
8028
- "org",
8029
- "purge",
8030
- "flow.js"
8031
- ],
8032
- "aliasPermutations": [],
8033
- "permutations": [
8034
- "hardis:org:purge:flow",
8035
- "org:hardis:purge:flow",
8036
- "org:purge:hardis:flow",
8037
- "org:purge:flow:hardis",
8038
- "hardis:purge:org:flow",
8039
- "purge:hardis:org:flow",
8040
- "purge:org:hardis:flow",
8041
- "purge:org:flow:hardis",
8042
- "hardis:purge:flow:org",
8043
- "purge:hardis:flow:org",
8044
- "purge:flow:hardis:org",
8045
- "purge:flow:org:hardis",
8046
- "hardis:org:flow:purge",
8047
- "org:hardis:flow:purge",
8048
- "org:flow:hardis:purge",
8049
- "org:flow:purge:hardis",
8050
- "hardis:flow:org:purge",
8051
- "flow:hardis:org:purge",
8052
- "flow:org:hardis:purge",
8053
- "flow:org:purge:hardis",
8054
- "hardis:flow:purge:org",
8055
- "flow:hardis:purge:org",
8056
- "flow:purge:hardis:org",
8057
- "flow:purge:org:hardis"
7774
+ "hardis:monitor:limits:org",
7775
+ "monitor:hardis:limits:org",
7776
+ "monitor:limits:hardis:org",
7777
+ "monitor:limits:org:hardis",
7778
+ "hardis:org:limits:monitor",
7779
+ "org:hardis:limits:monitor",
7780
+ "org:limits:hardis:monitor",
7781
+ "org:limits:monitor:hardis",
7782
+ "hardis:limits:org:monitor",
7783
+ "limits:hardis:org:monitor",
7784
+ "limits:org:hardis:monitor",
7785
+ "limits:org:monitor:hardis",
7786
+ "hardis:limits:monitor:org",
7787
+ "limits:hardis:monitor:org",
7788
+ "limits:monitor:hardis:org",
7789
+ "limits:monitor:org:hardis"
8058
7790
  ]
8059
7791
  },
8060
7792
  "hardis:org:refresh:after-refresh": {
@@ -8296,13 +8028,13 @@
8296
8028
  "before-refresh:refresh:org:hardis"
8297
8029
  ]
8298
8030
  },
8299
- "hardis:org:retrieve:packageconfig": {
8031
+ "hardis:org:purge:apexlog": {
8300
8032
  "aliases": [],
8301
8033
  "args": {},
8302
- "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",
8034
+ "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",
8303
8035
  "examples": [
8304
- "$ sf hardis:org:retrieve:packageconfig",
8305
- "sf hardis:org:retrieve:packageconfig -u myOrg"
8036
+ "$ sf hardis:org:purge:apexlog",
8037
+ "$ sf hardis:org:purge:apexlog --target-org nicolas.vuillamy@gmail.com"
8306
8038
  ],
8307
8039
  "flags": {
8308
8040
  "json": {
@@ -8320,6 +8052,13 @@
8320
8052
  "multiple": false,
8321
8053
  "type": "option"
8322
8054
  },
8055
+ "prompt": {
8056
+ "char": "z",
8057
+ "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
8058
+ "name": "prompt",
8059
+ "allowNo": true,
8060
+ "type": "boolean"
8061
+ },
8323
8062
  "debug": {
8324
8063
  "char": "d",
8325
8064
  "description": "Activate debug mode (more logs)",
@@ -8358,13 +8097,13 @@
8358
8097
  },
8359
8098
  "hasDynamicHelp": true,
8360
8099
  "hiddenAliases": [],
8361
- "id": "hardis:org:retrieve:packageconfig",
8100
+ "id": "hardis:org:purge:apexlog",
8362
8101
  "pluginAlias": "sfdx-hardis",
8363
8102
  "pluginName": "sfdx-hardis",
8364
8103
  "pluginType": "core",
8365
8104
  "strict": true,
8366
8105
  "enableJsonFlag": true,
8367
- "title": "Retrieve package configuration from an org",
8106
+ "title": "Purge Apex Logs",
8368
8107
  "requiresProject": false,
8369
8108
  "isESM": true,
8370
8109
  "relativePath": [
@@ -8372,43 +8111,45 @@
8372
8111
  "commands",
8373
8112
  "hardis",
8374
8113
  "org",
8375
- "retrieve",
8376
- "packageconfig.js"
8114
+ "purge",
8115
+ "apexlog.js"
8377
8116
  ],
8378
8117
  "aliasPermutations": [],
8379
8118
  "permutations": [
8380
- "hardis:org:retrieve:packageconfig",
8381
- "org:hardis:retrieve:packageconfig",
8382
- "org:retrieve:hardis:packageconfig",
8383
- "org:retrieve:packageconfig:hardis",
8384
- "hardis:retrieve:org:packageconfig",
8385
- "retrieve:hardis:org:packageconfig",
8386
- "retrieve:org:hardis:packageconfig",
8387
- "retrieve:org:packageconfig:hardis",
8388
- "hardis:retrieve:packageconfig:org",
8389
- "retrieve:hardis:packageconfig:org",
8390
- "retrieve:packageconfig:hardis:org",
8391
- "retrieve:packageconfig:org:hardis",
8392
- "hardis:org:packageconfig:retrieve",
8393
- "org:hardis:packageconfig:retrieve",
8394
- "org:packageconfig:hardis:retrieve",
8395
- "org:packageconfig:retrieve:hardis",
8396
- "hardis:packageconfig:org:retrieve",
8397
- "packageconfig:hardis:org:retrieve",
8398
- "packageconfig:org:hardis:retrieve",
8399
- "packageconfig:org:retrieve:hardis",
8400
- "hardis:packageconfig:retrieve:org",
8401
- "packageconfig:hardis:retrieve:org",
8402
- "packageconfig:retrieve:hardis:org",
8403
- "packageconfig:retrieve:org:hardis"
8119
+ "hardis:org:purge:apexlog",
8120
+ "org:hardis:purge:apexlog",
8121
+ "org:purge:hardis:apexlog",
8122
+ "org:purge:apexlog:hardis",
8123
+ "hardis:purge:org:apexlog",
8124
+ "purge:hardis:org:apexlog",
8125
+ "purge:org:hardis:apexlog",
8126
+ "purge:org:apexlog:hardis",
8127
+ "hardis:purge:apexlog:org",
8128
+ "purge:hardis:apexlog:org",
8129
+ "purge:apexlog:hardis:org",
8130
+ "purge:apexlog:org:hardis",
8131
+ "hardis:org:apexlog:purge",
8132
+ "org:hardis:apexlog:purge",
8133
+ "org:apexlog:hardis:purge",
8134
+ "org:apexlog:purge:hardis",
8135
+ "hardis:apexlog:org:purge",
8136
+ "apexlog:hardis:org:purge",
8137
+ "apexlog:org:hardis:purge",
8138
+ "apexlog:org:purge:hardis",
8139
+ "hardis:apexlog:purge:org",
8140
+ "apexlog:hardis:purge:org",
8141
+ "apexlog:purge:hardis:org",
8142
+ "apexlog:purge:org:hardis"
8404
8143
  ]
8405
8144
  },
8406
- "hardis:org:test:apex": {
8145
+ "hardis:org:purge:flow": {
8407
8146
  "aliases": [],
8408
8147
  "args": {},
8409
- "description": "Run apex tests in Salesforce org\n\nIf following configuration is defined, it will fail if apex coverage target is not reached:\n\n- Env `APEX_TESTS_MIN_COVERAGE_ORG_WIDE` or `.sfdx-hardis` property `apexTestsMinCoverageOrgWide`\n- Env `APEX_TESTS_MIN_COVERAGE_ORG_WIDE` or `.sfdx-hardis` property `apexTestsMinCoverageOrgWide`\n\nYou can override env var SFDX_TEST_WAIT_MINUTES to wait more than 120 minutes.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-apex-tests/) and can output Grafana, Slack and MsTeams Notifications.\n",
8148
+ "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",
8410
8149
  "examples": [
8411
- "$ sf hardis:org:test:apex"
8150
+ "$ sf hardis:org:purge:flow",
8151
+ "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --no-prompt --delete-flow-interviews",
8152
+ "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --status \"Obsolete,Draft,InvalidDraft\" --name TestFlow"
8412
8153
  ],
8413
8154
  "flags": {
8414
8155
  "json": {
@@ -8426,19 +8167,157 @@
8426
8167
  "multiple": false,
8427
8168
  "type": "option"
8428
8169
  },
8429
- "testlevel": {
8430
- "char": "l",
8431
- "description": "Level of tests to apply to validate deployment",
8432
- "name": "testlevel",
8433
- "default": "RunLocalTests",
8170
+ "prompt": {
8171
+ "char": "z",
8172
+ "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
8173
+ "name": "prompt",
8174
+ "allowNo": true,
8175
+ "type": "boolean"
8176
+ },
8177
+ "name": {
8178
+ "char": "n",
8179
+ "description": "Filter according to Name criteria",
8180
+ "name": "name",
8434
8181
  "hasDynamicHelp": false,
8435
8182
  "multiple": false,
8436
- "options": [
8437
- "NoTestRun",
8438
- "RunSpecifiedTests",
8439
- "RunLocalTests",
8440
- "RunAllTestsInOrg"
8183
+ "type": "option"
8184
+ },
8185
+ "status": {
8186
+ "char": "s",
8187
+ "description": "Filter according to Status criteria",
8188
+ "name": "status",
8189
+ "hasDynamicHelp": false,
8190
+ "multiple": false,
8191
+ "type": "option"
8192
+ },
8193
+ "delete-flow-interviews": {
8194
+ "char": "w",
8195
+ "description": "If the presence of Flow interviews prevent to delete flows versions, delete them before retrying to delete flow versions",
8196
+ "name": "delete-flow-interviews",
8197
+ "allowNo": false,
8198
+ "type": "boolean"
8199
+ },
8200
+ "allowpurgefailure": {
8201
+ "char": "f",
8202
+ "description": "Allows purges to fail without exiting with 1. Use --no-allowpurgefailure to disable",
8203
+ "name": "allowpurgefailure",
8204
+ "allowNo": true,
8205
+ "type": "boolean"
8206
+ },
8207
+ "instanceurl": {
8208
+ "char": "r",
8209
+ "description": "URL of org instance",
8210
+ "name": "instanceurl",
8211
+ "default": "https://login.salesforce.com",
8212
+ "hasDynamicHelp": false,
8213
+ "multiple": false,
8214
+ "type": "option"
8215
+ },
8216
+ "debug": {
8217
+ "char": "d",
8218
+ "description": "Activate debug mode (more logs)",
8219
+ "name": "debug",
8220
+ "allowNo": false,
8221
+ "type": "boolean"
8222
+ },
8223
+ "websocket": {
8224
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
8225
+ "name": "websocket",
8226
+ "hasDynamicHelp": false,
8227
+ "multiple": false,
8228
+ "type": "option"
8229
+ },
8230
+ "skipauth": {
8231
+ "description": "Skip authentication check when a default username is required",
8232
+ "name": "skipauth",
8233
+ "allowNo": false,
8234
+ "type": "boolean"
8235
+ },
8236
+ "target-org": {
8237
+ "aliases": [
8238
+ "targetusername",
8239
+ "u"
8441
8240
  ],
8241
+ "char": "o",
8242
+ "deprecateAliases": true,
8243
+ "name": "target-org",
8244
+ "noCacheDefault": true,
8245
+ "required": true,
8246
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8247
+ "hasDynamicHelp": true,
8248
+ "multiple": false,
8249
+ "type": "option"
8250
+ }
8251
+ },
8252
+ "hasDynamicHelp": true,
8253
+ "hiddenAliases": [],
8254
+ "id": "hardis:org:purge:flow",
8255
+ "pluginAlias": "sfdx-hardis",
8256
+ "pluginName": "sfdx-hardis",
8257
+ "pluginType": "core",
8258
+ "strict": true,
8259
+ "enableJsonFlag": true,
8260
+ "title": "Purge Flow versions",
8261
+ "requiresProject": false,
8262
+ "isESM": true,
8263
+ "relativePath": [
8264
+ "lib",
8265
+ "commands",
8266
+ "hardis",
8267
+ "org",
8268
+ "purge",
8269
+ "flow.js"
8270
+ ],
8271
+ "aliasPermutations": [],
8272
+ "permutations": [
8273
+ "hardis:org:purge:flow",
8274
+ "org:hardis:purge:flow",
8275
+ "org:purge:hardis:flow",
8276
+ "org:purge:flow:hardis",
8277
+ "hardis:purge:org:flow",
8278
+ "purge:hardis:org:flow",
8279
+ "purge:org:hardis:flow",
8280
+ "purge:org:flow:hardis",
8281
+ "hardis:purge:flow:org",
8282
+ "purge:hardis:flow:org",
8283
+ "purge:flow:hardis:org",
8284
+ "purge:flow:org:hardis",
8285
+ "hardis:org:flow:purge",
8286
+ "org:hardis:flow:purge",
8287
+ "org:flow:hardis:purge",
8288
+ "org:flow:purge:hardis",
8289
+ "hardis:flow:org:purge",
8290
+ "flow:hardis:org:purge",
8291
+ "flow:org:hardis:purge",
8292
+ "flow:org:purge:hardis",
8293
+ "hardis:flow:purge:org",
8294
+ "flow:hardis:purge:org",
8295
+ "flow:purge:hardis:org",
8296
+ "flow:purge:org:hardis"
8297
+ ]
8298
+ },
8299
+ "hardis:org:retrieve:packageconfig": {
8300
+ "aliases": [],
8301
+ "args": {},
8302
+ "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",
8303
+ "examples": [
8304
+ "$ sf hardis:org:retrieve:packageconfig",
8305
+ "sf hardis:org:retrieve:packageconfig -u myOrg"
8306
+ ],
8307
+ "flags": {
8308
+ "json": {
8309
+ "description": "Format output as json.",
8310
+ "helpGroup": "GLOBAL",
8311
+ "name": "json",
8312
+ "allowNo": false,
8313
+ "type": "boolean"
8314
+ },
8315
+ "flags-dir": {
8316
+ "helpGroup": "GLOBAL",
8317
+ "name": "flags-dir",
8318
+ "summary": "Import flag values from a directory.",
8319
+ "hasDynamicHelp": false,
8320
+ "multiple": false,
8442
8321
  "type": "option"
8443
8322
  },
8444
8323
  "debug": {
@@ -8479,48 +8358,49 @@
8479
8358
  },
8480
8359
  "hasDynamicHelp": true,
8481
8360
  "hiddenAliases": [],
8482
- "id": "hardis:org:test:apex",
8361
+ "id": "hardis:org:retrieve:packageconfig",
8483
8362
  "pluginAlias": "sfdx-hardis",
8484
8363
  "pluginName": "sfdx-hardis",
8485
8364
  "pluginType": "core",
8486
8365
  "strict": true,
8487
8366
  "enableJsonFlag": true,
8488
- "title": "Run apex tests",
8367
+ "title": "Retrieve package configuration from an org",
8368
+ "requiresProject": false,
8489
8369
  "isESM": true,
8490
8370
  "relativePath": [
8491
8371
  "lib",
8492
8372
  "commands",
8493
8373
  "hardis",
8494
8374
  "org",
8495
- "test",
8496
- "apex.js"
8375
+ "retrieve",
8376
+ "packageconfig.js"
8497
8377
  ],
8498
8378
  "aliasPermutations": [],
8499
8379
  "permutations": [
8500
- "hardis:org:test:apex",
8501
- "org:hardis:test:apex",
8502
- "org:test:hardis:apex",
8503
- "org:test:apex:hardis",
8504
- "hardis:test:org:apex",
8505
- "test:hardis:org:apex",
8506
- "test:org:hardis:apex",
8507
- "test:org:apex:hardis",
8508
- "hardis:test:apex:org",
8509
- "test:hardis:apex:org",
8510
- "test:apex:hardis:org",
8511
- "test:apex:org:hardis",
8512
- "hardis:org:apex:test",
8513
- "org:hardis:apex:test",
8514
- "org:apex:hardis:test",
8515
- "org:apex:test:hardis",
8516
- "hardis:apex:org:test",
8517
- "apex:hardis:org:test",
8518
- "apex:org:hardis:test",
8519
- "apex:org:test:hardis",
8520
- "hardis:apex:test:org",
8521
- "apex:hardis:test:org",
8522
- "apex:test:hardis:org",
8523
- "apex:test:org:hardis"
8380
+ "hardis:org:retrieve:packageconfig",
8381
+ "org:hardis:retrieve:packageconfig",
8382
+ "org:retrieve:hardis:packageconfig",
8383
+ "org:retrieve:packageconfig:hardis",
8384
+ "hardis:retrieve:org:packageconfig",
8385
+ "retrieve:hardis:org:packageconfig",
8386
+ "retrieve:org:hardis:packageconfig",
8387
+ "retrieve:org:packageconfig:hardis",
8388
+ "hardis:retrieve:packageconfig:org",
8389
+ "retrieve:hardis:packageconfig:org",
8390
+ "retrieve:packageconfig:hardis:org",
8391
+ "retrieve:packageconfig:org:hardis",
8392
+ "hardis:org:packageconfig:retrieve",
8393
+ "org:hardis:packageconfig:retrieve",
8394
+ "org:packageconfig:hardis:retrieve",
8395
+ "org:packageconfig:retrieve:hardis",
8396
+ "hardis:packageconfig:org:retrieve",
8397
+ "packageconfig:hardis:org:retrieve",
8398
+ "packageconfig:org:hardis:retrieve",
8399
+ "packageconfig:org:retrieve:hardis",
8400
+ "hardis:packageconfig:retrieve:org",
8401
+ "packageconfig:hardis:retrieve:org",
8402
+ "packageconfig:retrieve:hardis:org",
8403
+ "packageconfig:retrieve:org:hardis"
8524
8404
  ]
8525
8405
  },
8526
8406
  "hardis:org:user:activateinvalid": {
@@ -8923,6 +8803,126 @@
8923
8803
  "unfreeze:user:org:hardis"
8924
8804
  ]
8925
8805
  },
8806
+ "hardis:org:test:apex": {
8807
+ "aliases": [],
8808
+ "args": {},
8809
+ "description": "Run apex tests in Salesforce org\n\nIf following configuration is defined, it will fail if apex coverage target is not reached:\n\n- Env `APEX_TESTS_MIN_COVERAGE_ORG_WIDE` or `.sfdx-hardis` property `apexTestsMinCoverageOrgWide`\n- Env `APEX_TESTS_MIN_COVERAGE_ORG_WIDE` or `.sfdx-hardis` property `apexTestsMinCoverageOrgWide`\n\nYou can override env var SFDX_TEST_WAIT_MINUTES to wait more than 120 minutes.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-apex-tests/) and can output Grafana, Slack and MsTeams Notifications.\n",
8810
+ "examples": [
8811
+ "$ sf hardis:org:test:apex"
8812
+ ],
8813
+ "flags": {
8814
+ "json": {
8815
+ "description": "Format output as json.",
8816
+ "helpGroup": "GLOBAL",
8817
+ "name": "json",
8818
+ "allowNo": false,
8819
+ "type": "boolean"
8820
+ },
8821
+ "flags-dir": {
8822
+ "helpGroup": "GLOBAL",
8823
+ "name": "flags-dir",
8824
+ "summary": "Import flag values from a directory.",
8825
+ "hasDynamicHelp": false,
8826
+ "multiple": false,
8827
+ "type": "option"
8828
+ },
8829
+ "testlevel": {
8830
+ "char": "l",
8831
+ "description": "Level of tests to apply to validate deployment",
8832
+ "name": "testlevel",
8833
+ "default": "RunLocalTests",
8834
+ "hasDynamicHelp": false,
8835
+ "multiple": false,
8836
+ "options": [
8837
+ "NoTestRun",
8838
+ "RunSpecifiedTests",
8839
+ "RunLocalTests",
8840
+ "RunAllTestsInOrg"
8841
+ ],
8842
+ "type": "option"
8843
+ },
8844
+ "debug": {
8845
+ "char": "d",
8846
+ "description": "Activate debug mode (more logs)",
8847
+ "name": "debug",
8848
+ "allowNo": false,
8849
+ "type": "boolean"
8850
+ },
8851
+ "websocket": {
8852
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
8853
+ "name": "websocket",
8854
+ "hasDynamicHelp": false,
8855
+ "multiple": false,
8856
+ "type": "option"
8857
+ },
8858
+ "skipauth": {
8859
+ "description": "Skip authentication check when a default username is required",
8860
+ "name": "skipauth",
8861
+ "allowNo": false,
8862
+ "type": "boolean"
8863
+ },
8864
+ "target-org": {
8865
+ "aliases": [
8866
+ "targetusername",
8867
+ "u"
8868
+ ],
8869
+ "char": "o",
8870
+ "deprecateAliases": true,
8871
+ "name": "target-org",
8872
+ "noCacheDefault": true,
8873
+ "required": true,
8874
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8875
+ "hasDynamicHelp": true,
8876
+ "multiple": false,
8877
+ "type": "option"
8878
+ }
8879
+ },
8880
+ "hasDynamicHelp": true,
8881
+ "hiddenAliases": [],
8882
+ "id": "hardis:org:test:apex",
8883
+ "pluginAlias": "sfdx-hardis",
8884
+ "pluginName": "sfdx-hardis",
8885
+ "pluginType": "core",
8886
+ "strict": true,
8887
+ "enableJsonFlag": true,
8888
+ "title": "Run apex tests",
8889
+ "isESM": true,
8890
+ "relativePath": [
8891
+ "lib",
8892
+ "commands",
8893
+ "hardis",
8894
+ "org",
8895
+ "test",
8896
+ "apex.js"
8897
+ ],
8898
+ "aliasPermutations": [],
8899
+ "permutations": [
8900
+ "hardis:org:test:apex",
8901
+ "org:hardis:test:apex",
8902
+ "org:test:hardis:apex",
8903
+ "org:test:apex:hardis",
8904
+ "hardis:test:org:apex",
8905
+ "test:hardis:org:apex",
8906
+ "test:org:hardis:apex",
8907
+ "test:org:apex:hardis",
8908
+ "hardis:test:apex:org",
8909
+ "test:hardis:apex:org",
8910
+ "test:apex:hardis:org",
8911
+ "test:apex:org:hardis",
8912
+ "hardis:org:apex:test",
8913
+ "org:hardis:apex:test",
8914
+ "org:apex:hardis:test",
8915
+ "org:apex:test:hardis",
8916
+ "hardis:apex:org:test",
8917
+ "apex:hardis:org:test",
8918
+ "apex:org:hardis:test",
8919
+ "apex:org:test:hardis",
8920
+ "hardis:apex:test:org",
8921
+ "apex:hardis:test:org",
8922
+ "apex:test:hardis:org",
8923
+ "apex:test:org:hardis"
8924
+ ]
8925
+ },
8926
8926
  "hardis:package:version:create": {
8927
8927
  "aliases": [],
8928
8928
  "args": {},
@@ -9164,13 +9164,125 @@
9164
9164
  "list:version:package:hardis"
9165
9165
  ]
9166
9166
  },
9167
- "hardis:package:version:promote": {
9167
+ "hardis:package:version:promote": {
9168
+ "aliases": [],
9169
+ "args": {},
9170
+ "description": "\n## Command Behavior\n\n**Promotes a Salesforce package version from beta to released status in your Dev Hub.**\n\nThis command is a critical step in the package development lifecycle, marking a package version as stable and ready for production use. Once promoted, a package version can be installed in production organizations.\n\nKey functionalities:\n\n- **Package Version Selection:** Allows you to select a specific package version to promote. If the `--auto` flag is used, it automatically identifies package versions that are not yet released and promotes them.\n- **Automated Promotion:** When `--auto` is enabled, it queries for all unreleased package versions and promotes them without further user interaction.\n- **Dev Hub Integration:** Interacts with your connected Dev Hub to change the status of the package version.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Package Alias Retrieval:** It retrieves package aliases from your `sfdx-project.json` to identify available packages.\n- **Automated Promotion Logic:** If `--auto` is used, it executes `sf package version list --released` to get a list of already released packages and then filters the available package aliases to find those that are not yet released.\n- **Interactive Prompts:** If not in auto mode, it uses the `prompts` library to allow the user to select a package version to promote.\n- **Salesforce CLI Integration:** It constructs and executes the `sf package version promote` command, passing the package version ID.\n- **`execSfdxJson`:** This utility is used to execute the Salesforce CLI command and capture its JSON output.\n- **Error Handling:** It handles cases where a package version might already be promoted or if other errors occur during the promotion process.\n</details>\n",
9171
+ "examples": [
9172
+ "$ sf hardis:package:version:promote",
9173
+ "$ sf hardis:package:version:promote --auto"
9174
+ ],
9175
+ "flags": {
9176
+ "json": {
9177
+ "description": "Format output as json.",
9178
+ "helpGroup": "GLOBAL",
9179
+ "name": "json",
9180
+ "allowNo": false,
9181
+ "type": "boolean"
9182
+ },
9183
+ "flags-dir": {
9184
+ "helpGroup": "GLOBAL",
9185
+ "name": "flags-dir",
9186
+ "summary": "Import flag values from a directory.",
9187
+ "hasDynamicHelp": false,
9188
+ "multiple": false,
9189
+ "type": "option"
9190
+ },
9191
+ "auto": {
9192
+ "char": "f",
9193
+ "description": "Auto-detect which versions of which packages need to be promoted",
9194
+ "name": "auto",
9195
+ "allowNo": false,
9196
+ "type": "boolean"
9197
+ },
9198
+ "debug": {
9199
+ "char": "d",
9200
+ "description": "Activate debug mode (more logs)",
9201
+ "name": "debug",
9202
+ "allowNo": false,
9203
+ "type": "boolean"
9204
+ },
9205
+ "websocket": {
9206
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9207
+ "name": "websocket",
9208
+ "hasDynamicHelp": false,
9209
+ "multiple": false,
9210
+ "type": "option"
9211
+ },
9212
+ "skipauth": {
9213
+ "description": "Skip authentication check when a default username is required",
9214
+ "name": "skipauth",
9215
+ "allowNo": false,
9216
+ "type": "boolean"
9217
+ },
9218
+ "target-dev-hub": {
9219
+ "aliases": [
9220
+ "targetdevhubusername"
9221
+ ],
9222
+ "char": "v",
9223
+ "deprecateAliases": true,
9224
+ "name": "target-dev-hub",
9225
+ "noCacheDefault": true,
9226
+ "required": true,
9227
+ "summary": "Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.",
9228
+ "hasDynamicHelp": true,
9229
+ "multiple": false,
9230
+ "type": "option"
9231
+ }
9232
+ },
9233
+ "hasDynamicHelp": true,
9234
+ "hiddenAliases": [],
9235
+ "id": "hardis:package:version:promote",
9236
+ "pluginAlias": "sfdx-hardis",
9237
+ "pluginName": "sfdx-hardis",
9238
+ "pluginType": "core",
9239
+ "strict": true,
9240
+ "enableJsonFlag": true,
9241
+ "title": "Promote new versions of package(s)",
9242
+ "requiresProject": true,
9243
+ "isESM": true,
9244
+ "relativePath": [
9245
+ "lib",
9246
+ "commands",
9247
+ "hardis",
9248
+ "package",
9249
+ "version",
9250
+ "promote.js"
9251
+ ],
9252
+ "aliasPermutations": [],
9253
+ "permutations": [
9254
+ "hardis:package:version:promote",
9255
+ "package:hardis:version:promote",
9256
+ "package:version:hardis:promote",
9257
+ "package:version:promote:hardis",
9258
+ "hardis:version:package:promote",
9259
+ "version:hardis:package:promote",
9260
+ "version:package:hardis:promote",
9261
+ "version:package:promote:hardis",
9262
+ "hardis:version:promote:package",
9263
+ "version:hardis:promote:package",
9264
+ "version:promote:hardis:package",
9265
+ "version:promote:package:hardis",
9266
+ "hardis:package:promote:version",
9267
+ "package:hardis:promote:version",
9268
+ "package:promote:hardis:version",
9269
+ "package:promote:version:hardis",
9270
+ "hardis:promote:package:version",
9271
+ "promote:hardis:package:version",
9272
+ "promote:package:hardis:version",
9273
+ "promote:package:version:hardis",
9274
+ "hardis:promote:version:package",
9275
+ "promote:hardis:version:package",
9276
+ "promote:version:hardis:package",
9277
+ "promote:version:package:hardis"
9278
+ ]
9279
+ },
9280
+ "hardis:project:configure:auth": {
9168
9281
  "aliases": [],
9169
9282
  "args": {},
9170
- "description": "\n## Command Behavior\n\n**Promotes a Salesforce package version from beta to released status in your Dev Hub.**\n\nThis command is a critical step in the package development lifecycle, marking a package version as stable and ready for production use. Once promoted, a package version can be installed in production organizations.\n\nKey functionalities:\n\n- **Package Version Selection:** Allows you to select a specific package version to promote. If the `--auto` flag is used, it automatically identifies package versions that are not yet released and promotes them.\n- **Automated Promotion:** When `--auto` is enabled, it queries for all unreleased package versions and promotes them without further user interaction.\n- **Dev Hub Integration:** Interacts with your connected Dev Hub to change the status of the package version.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Package Alias Retrieval:** It retrieves package aliases from your `sfdx-project.json` to identify available packages.\n- **Automated Promotion Logic:** If `--auto` is used, it executes `sf package version list --released` to get a list of already released packages and then filters the available package aliases to find those that are not yet released.\n- **Interactive Prompts:** If not in auto mode, it uses the `prompts` library to allow the user to select a package version to promote.\n- **Salesforce CLI Integration:** It constructs and executes the `sf package version promote` command, passing the package version ID.\n- **`execSfdxJson`:** This utility is used to execute the Salesforce CLI command and capture its JSON output.\n- **Error Handling:** It handles cases where a package version might already be promoted or if other errors occur during the promotion process.\n</details>\n",
9283
+ "description": "\n## Command Behavior\n\n**Configures authentication between a Git branch and a target Salesforce org for CI/CD deployments.**\n\nThis command facilitates the setup of automated CI/CD pipelines, enabling seamless deployments from specific Git branches to designated Salesforce orgs. It supports both standard Salesforce orgs and Dev Hub configurations, catering to various enterprise deployment workflows.\n\nKey functionalities include:\n\n- **Org Selection/Login:** Guides the user to select an existing Salesforce org or log in to a new one.\n- **Git Branch Association:** Allows associating a specific Git branch with the chosen Salesforce org.\n- **Merge Target Definition:** Enables defining target Git branches into which the configured branch can merge, ensuring controlled deployment flows.\n- **Salesforce Username Configuration:** Prompts for the Salesforce username to be used by the CI server for deployments.\n- **SSL Certificate Generation:** Automatically generates an SSL certificate for secure authentication.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's implementation involves several key technical aspects:\n\n- **SF CLI Integration:** Utilizes \n@salesforce/sf-plugins-core\n for command structure and flag parsing.\n- **Interactive Prompts:** Employs the \nprompts\n library for interactive user input, guiding the configuration process.\n- **Git Integration:** Interacts with Git to retrieve branch information using \n`git().branch([\"--list\", \"-r\"])`\n.\n- **Configuration Management:** Leverages internal utilities (`checkConfig`, `getConfig`, `setConfig`, `setInConfigFile`) to read from and write to project-specific configuration files (e.g., `.sfdx-hardis.<branchName>.yml`).\n- **Salesforce CLI Execution:** Executes Salesforce CLI commands programmatically via `execSfdxJson` for org interactions.\n- **SSL Certificate Generation:** Calls `generateSSLCertificate` to create necessary SSL certificates for JWT-based authentication.\n- **WebSocket Communication:** Uses `WebSocketClient` for potential communication with external tools or processes, such as restarting the command in VS Code.\n- **Dependency Check:** Ensures the presence of `openssl` on the system, which is required for SSL certificate generation.\n",
9171
9284
  "examples": [
9172
- "$ sf hardis:package:version:promote",
9173
- "$ sf hardis:package:version:promote --auto"
9285
+ "$ sf hardis:project:configure:auth"
9174
9286
  ],
9175
9287
  "flags": {
9176
9288
  "json": {
@@ -9188,10 +9300,10 @@
9188
9300
  "multiple": false,
9189
9301
  "type": "option"
9190
9302
  },
9191
- "auto": {
9192
- "char": "f",
9193
- "description": "Auto-detect which versions of which packages need to be promoted",
9194
- "name": "auto",
9303
+ "devhub": {
9304
+ "char": "b",
9305
+ "description": "Configure project DevHub",
9306
+ "name": "devhub",
9195
9307
  "allowNo": false,
9196
9308
  "type": "boolean"
9197
9309
  },
@@ -9215,6 +9327,20 @@
9215
9327
  "allowNo": false,
9216
9328
  "type": "boolean"
9217
9329
  },
9330
+ "target-org": {
9331
+ "aliases": [
9332
+ "targetusername",
9333
+ "u"
9334
+ ],
9335
+ "char": "o",
9336
+ "deprecateAliases": true,
9337
+ "name": "target-org",
9338
+ "noCacheDefault": true,
9339
+ "summary": "Username or alias of the target org.",
9340
+ "hasDynamicHelp": true,
9341
+ "multiple": false,
9342
+ "type": "option"
9343
+ },
9218
9344
  "target-dev-hub": {
9219
9345
  "aliases": [
9220
9346
  "targetdevhubusername"
@@ -9223,8 +9349,8 @@
9223
9349
  "deprecateAliases": true,
9224
9350
  "name": "target-dev-hub",
9225
9351
  "noCacheDefault": true,
9226
- "required": true,
9227
- "summary": "Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.",
9352
+ "required": false,
9353
+ "summary": "Username or alias of the Dev Hub org.",
9228
9354
  "hasDynamicHelp": true,
9229
9355
  "multiple": false,
9230
9356
  "type": "option"
@@ -9232,49 +9358,52 @@
9232
9358
  },
9233
9359
  "hasDynamicHelp": true,
9234
9360
  "hiddenAliases": [],
9235
- "id": "hardis:package:version:promote",
9361
+ "id": "hardis:project:configure:auth",
9236
9362
  "pluginAlias": "sfdx-hardis",
9237
9363
  "pluginName": "sfdx-hardis",
9238
9364
  "pluginType": "core",
9239
9365
  "strict": true,
9240
9366
  "enableJsonFlag": true,
9241
- "title": "Promote new versions of package(s)",
9242
- "requiresProject": true,
9367
+ "title": "Configure authentication",
9368
+ "requiresProject": false,
9369
+ "requiresDependencies": [
9370
+ "openssl"
9371
+ ],
9243
9372
  "isESM": true,
9244
9373
  "relativePath": [
9245
9374
  "lib",
9246
9375
  "commands",
9247
9376
  "hardis",
9248
- "package",
9249
- "version",
9250
- "promote.js"
9377
+ "project",
9378
+ "configure",
9379
+ "auth.js"
9251
9380
  ],
9252
9381
  "aliasPermutations": [],
9253
9382
  "permutations": [
9254
- "hardis:package:version:promote",
9255
- "package:hardis:version:promote",
9256
- "package:version:hardis:promote",
9257
- "package:version:promote:hardis",
9258
- "hardis:version:package:promote",
9259
- "version:hardis:package:promote",
9260
- "version:package:hardis:promote",
9261
- "version:package:promote:hardis",
9262
- "hardis:version:promote:package",
9263
- "version:hardis:promote:package",
9264
- "version:promote:hardis:package",
9265
- "version:promote:package:hardis",
9266
- "hardis:package:promote:version",
9267
- "package:hardis:promote:version",
9268
- "package:promote:hardis:version",
9269
- "package:promote:version:hardis",
9270
- "hardis:promote:package:version",
9271
- "promote:hardis:package:version",
9272
- "promote:package:hardis:version",
9273
- "promote:package:version:hardis",
9274
- "hardis:promote:version:package",
9275
- "promote:hardis:version:package",
9276
- "promote:version:hardis:package",
9277
- "promote:version:package:hardis"
9383
+ "hardis:project:configure:auth",
9384
+ "project:hardis:configure:auth",
9385
+ "project:configure:hardis:auth",
9386
+ "project:configure:auth:hardis",
9387
+ "hardis:configure:project:auth",
9388
+ "configure:hardis:project:auth",
9389
+ "configure:project:hardis:auth",
9390
+ "configure:project:auth:hardis",
9391
+ "hardis:configure:auth:project",
9392
+ "configure:hardis:auth:project",
9393
+ "configure:auth:hardis:project",
9394
+ "configure:auth:project:hardis",
9395
+ "hardis:project:auth:configure",
9396
+ "project:hardis:auth:configure",
9397
+ "project:auth:hardis:configure",
9398
+ "project:auth:configure:hardis",
9399
+ "hardis:auth:project:configure",
9400
+ "auth:hardis:project:configure",
9401
+ "auth:project:hardis:configure",
9402
+ "auth:project:configure:hardis",
9403
+ "hardis:auth:configure:project",
9404
+ "auth:hardis:configure:project",
9405
+ "auth:configure:hardis:project",
9406
+ "auth:configure:project:hardis"
9278
9407
  ]
9279
9408
  },
9280
9409
  "hardis:project:audit:apiversion": {
@@ -9793,135 +9922,6 @@
9793
9922
  "profilestopermsets:convert:project:hardis"
9794
9923
  ]
9795
9924
  },
9796
- "hardis:project:configure:auth": {
9797
- "aliases": [],
9798
- "args": {},
9799
- "description": "\n## Command Behavior\n\n**Configures authentication between a Git branch and a target Salesforce org for CI/CD deployments.**\n\nThis command facilitates the setup of automated CI/CD pipelines, enabling seamless deployments from specific Git branches to designated Salesforce orgs. It supports both standard Salesforce orgs and Dev Hub configurations, catering to various enterprise deployment workflows.\n\nKey functionalities include:\n\n- **Org Selection/Login:** Guides the user to select an existing Salesforce org or log in to a new one.\n- **Git Branch Association:** Allows associating a specific Git branch with the chosen Salesforce org.\n- **Merge Target Definition:** Enables defining target Git branches into which the configured branch can merge, ensuring controlled deployment flows.\n- **Salesforce Username Configuration:** Prompts for the Salesforce username to be used by the CI server for deployments.\n- **SSL Certificate Generation:** Automatically generates an SSL certificate for secure authentication.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's implementation involves several key technical aspects:\n\n- **SF CLI Integration:** Utilizes \n@salesforce/sf-plugins-core\n for command structure and flag parsing.\n- **Interactive Prompts:** Employs the \nprompts\n library for interactive user input, guiding the configuration process.\n- **Git Integration:** Interacts with Git to retrieve branch information using \n`git().branch([\"--list\", \"-r\"])`\n.\n- **Configuration Management:** Leverages internal utilities (`checkConfig`, `getConfig`, `setConfig`, `setInConfigFile`) to read from and write to project-specific configuration files (e.g., `.sfdx-hardis.<branchName>.yml`).\n- **Salesforce CLI Execution:** Executes Salesforce CLI commands programmatically via `execSfdxJson` for org interactions.\n- **SSL Certificate Generation:** Calls `generateSSLCertificate` to create necessary SSL certificates for JWT-based authentication.\n- **WebSocket Communication:** Uses `WebSocketClient` for potential communication with external tools or processes, such as restarting the command in VS Code.\n- **Dependency Check:** Ensures the presence of `openssl` on the system, which is required for SSL certificate generation.\n",
9800
- "examples": [
9801
- "$ sf hardis:project:configure:auth"
9802
- ],
9803
- "flags": {
9804
- "json": {
9805
- "description": "Format output as json.",
9806
- "helpGroup": "GLOBAL",
9807
- "name": "json",
9808
- "allowNo": false,
9809
- "type": "boolean"
9810
- },
9811
- "flags-dir": {
9812
- "helpGroup": "GLOBAL",
9813
- "name": "flags-dir",
9814
- "summary": "Import flag values from a directory.",
9815
- "hasDynamicHelp": false,
9816
- "multiple": false,
9817
- "type": "option"
9818
- },
9819
- "devhub": {
9820
- "char": "b",
9821
- "description": "Configure project DevHub",
9822
- "name": "devhub",
9823
- "allowNo": false,
9824
- "type": "boolean"
9825
- },
9826
- "debug": {
9827
- "char": "d",
9828
- "description": "Activate debug mode (more logs)",
9829
- "name": "debug",
9830
- "allowNo": false,
9831
- "type": "boolean"
9832
- },
9833
- "websocket": {
9834
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9835
- "name": "websocket",
9836
- "hasDynamicHelp": false,
9837
- "multiple": false,
9838
- "type": "option"
9839
- },
9840
- "skipauth": {
9841
- "description": "Skip authentication check when a default username is required",
9842
- "name": "skipauth",
9843
- "allowNo": false,
9844
- "type": "boolean"
9845
- },
9846
- "target-org": {
9847
- "aliases": [
9848
- "targetusername",
9849
- "u"
9850
- ],
9851
- "char": "o",
9852
- "deprecateAliases": true,
9853
- "name": "target-org",
9854
- "noCacheDefault": true,
9855
- "summary": "Username or alias of the target org.",
9856
- "hasDynamicHelp": true,
9857
- "multiple": false,
9858
- "type": "option"
9859
- },
9860
- "target-dev-hub": {
9861
- "aliases": [
9862
- "targetdevhubusername"
9863
- ],
9864
- "char": "v",
9865
- "deprecateAliases": true,
9866
- "name": "target-dev-hub",
9867
- "noCacheDefault": true,
9868
- "required": false,
9869
- "summary": "Username or alias of the Dev Hub org.",
9870
- "hasDynamicHelp": true,
9871
- "multiple": false,
9872
- "type": "option"
9873
- }
9874
- },
9875
- "hasDynamicHelp": true,
9876
- "hiddenAliases": [],
9877
- "id": "hardis:project:configure:auth",
9878
- "pluginAlias": "sfdx-hardis",
9879
- "pluginName": "sfdx-hardis",
9880
- "pluginType": "core",
9881
- "strict": true,
9882
- "enableJsonFlag": true,
9883
- "title": "Configure authentication",
9884
- "requiresProject": false,
9885
- "requiresDependencies": [
9886
- "openssl"
9887
- ],
9888
- "isESM": true,
9889
- "relativePath": [
9890
- "lib",
9891
- "commands",
9892
- "hardis",
9893
- "project",
9894
- "configure",
9895
- "auth.js"
9896
- ],
9897
- "aliasPermutations": [],
9898
- "permutations": [
9899
- "hardis:project:configure:auth",
9900
- "project:hardis:configure:auth",
9901
- "project:configure:hardis:auth",
9902
- "project:configure:auth:hardis",
9903
- "hardis:configure:project:auth",
9904
- "configure:hardis:project:auth",
9905
- "configure:project:hardis:auth",
9906
- "configure:project:auth:hardis",
9907
- "hardis:configure:auth:project",
9908
- "configure:hardis:auth:project",
9909
- "configure:auth:hardis:project",
9910
- "configure:auth:project:hardis",
9911
- "hardis:project:auth:configure",
9912
- "project:hardis:auth:configure",
9913
- "project:auth:hardis:configure",
9914
- "project:auth:configure:hardis",
9915
- "hardis:auth:project:configure",
9916
- "auth:hardis:project:configure",
9917
- "auth:project:hardis:configure",
9918
- "auth:project:configure:hardis",
9919
- "hardis:auth:configure:project",
9920
- "auth:hardis:configure:project",
9921
- "auth:configure:hardis:project",
9922
- "auth:configure:project:hardis"
9923
- ]
9924
- },
9925
9925
  "hardis:project:clean:emptyitems": {
9926
9926
  "aliases": [],
9927
9927
  "args": {},
@@ -15370,5 +15370,5 @@
15370
15370
  ]
15371
15371
  }
15372
15372
  },
15373
- "version": "6.9.1-alpha202510261844.0"
15373
+ "version": "6.9.1-alpha202510262008.0"
15374
15374
  }