sfdx-hardis 6.4.1 → 6.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/defaults/templates/files/LargeFilesOnly.json +11 -0
  3. package/lib/commands/hardis/git/pull-requests/extract.js +1 -1
  4. package/lib/commands/hardis/git/pull-requests/extract.js.map +1 -1
  5. package/lib/commands/hardis/lint/access.js +1 -1
  6. package/lib/commands/hardis/lint/access.js.map +1 -1
  7. package/lib/commands/hardis/lint/metadatastatus.js +1 -1
  8. package/lib/commands/hardis/lint/metadatastatus.js.map +1 -1
  9. package/lib/commands/hardis/lint/missingattributes.js +1 -1
  10. package/lib/commands/hardis/lint/missingattributes.js.map +1 -1
  11. package/lib/commands/hardis/lint/unusedmetadatas.js +1 -1
  12. package/lib/commands/hardis/lint/unusedmetadatas.js.map +1 -1
  13. package/lib/commands/hardis/misc/servicenow-report.js +1 -1
  14. package/lib/commands/hardis/misc/servicenow-report.js.map +1 -1
  15. package/lib/commands/hardis/org/configure/files.js +2 -0
  16. package/lib/commands/hardis/org/configure/files.js.map +1 -1
  17. package/lib/commands/hardis/org/diagnose/audittrail.js +1 -1
  18. package/lib/commands/hardis/org/diagnose/audittrail.js.map +1 -1
  19. package/lib/commands/hardis/org/diagnose/legacyapi.js +2 -2
  20. package/lib/commands/hardis/org/diagnose/legacyapi.js.map +1 -1
  21. package/lib/commands/hardis/org/diagnose/licenses.js +1 -1
  22. package/lib/commands/hardis/org/diagnose/licenses.js.map +1 -1
  23. package/lib/commands/hardis/org/diagnose/releaseupdates.js +1 -1
  24. package/lib/commands/hardis/org/diagnose/releaseupdates.js.map +1 -1
  25. package/lib/commands/hardis/org/diagnose/unused-apex-classes.js +1 -1
  26. package/lib/commands/hardis/org/diagnose/unused-apex-classes.js.map +1 -1
  27. package/lib/commands/hardis/org/diagnose/unused-connected-apps.js +1 -1
  28. package/lib/commands/hardis/org/diagnose/unused-connected-apps.js.map +1 -1
  29. package/lib/commands/hardis/org/files/export.js +14 -2
  30. package/lib/commands/hardis/org/files/export.js.map +1 -1
  31. package/lib/commands/hardis/org/files/import.js +4 -2
  32. package/lib/commands/hardis/org/files/import.js.map +1 -1
  33. package/lib/commands/hardis/org/monitor/backup.js +1 -1
  34. package/lib/commands/hardis/org/monitor/backup.js.map +1 -1
  35. package/lib/commands/hardis/org/monitor/limits.js +1 -1
  36. package/lib/commands/hardis/org/monitor/limits.js.map +1 -1
  37. package/lib/commands/hardis/org/multi-org-query.js +1 -1
  38. package/lib/commands/hardis/org/multi-org-query.js.map +1 -1
  39. package/lib/commands/hardis/project/audit/callincallout.js +4 -1
  40. package/lib/commands/hardis/project/audit/callincallout.js.map +1 -1
  41. package/lib/commands/hardis/project/audit/remotesites.js +4 -1
  42. package/lib/commands/hardis/project/audit/remotesites.js.map +1 -1
  43. package/lib/commands/hardis/work/save.js +1 -1
  44. package/lib/commands/hardis/work/save.js.map +1 -1
  45. package/lib/common/utils/filesUtils.d.ts +52 -14
  46. package/lib/common/utils/filesUtils.js +456 -101
  47. package/lib/common/utils/filesUtils.js.map +1 -1
  48. package/lib/common/utils/index.d.ts +4 -0
  49. package/lib/common/utils/index.js +9 -0
  50. package/lib/common/utils/index.js.map +1 -1
  51. package/lib/common/websocketClient.d.ts +3 -0
  52. package/lib/common/websocketClient.js +23 -0
  53. package/lib/common/websocketClient.js.map +1 -1
  54. package/oclif.lock +39 -39
  55. package/oclif.manifest.json +497 -497
  56. package/package.json +6 -6
@@ -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 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 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": {
@@ -4948,7 +4948,7 @@
4948
4948
  "hardis:org:configure:files": {
4949
4949
  "aliases": [],
4950
4950
  "args": {},
4951
- "description": "\n## Command Behavior\n\n**Configures a project for exporting file attachments from a Salesforce org.**\n\nThis command streamlines the setup of configurations for mass downloading files (such as Notes, Attachments, or Salesforce Files) associated with Salesforce records. It's particularly useful for data backups, migrations, or integrating Salesforce files with external systems.\n\nKey functionalities:\n\n- **Template-Based Configuration:** Allows you to choose from predefined templates for common file export scenarios or start with a blank configuration. Templates can pre-populate the export settings.\n- **Interactive Setup:** Guides you through defining the export project folder name and other export parameters.\n- **`export.json` Generation:** Creates an `export.json` file within the designated project folder. This file contains the configuration for the file export operation, including:\n - **SOQL Query:** A SOQL query to select the parent records from which files will be exported.\n - **File Types:** Specifies which types of files (e.g., `ContentVersion`, `Attachment`) to include.\n - **Output Folder/File Naming:** Defines how the exported files and their containing folders will be named based on record fields.\n - **Overwrite Options:** Controls whether existing files or parent records should be overwritten during the export.\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- **Template Selection:** It uses `selectTemplate` to present predefined file export templates or a blank option to the user.\n- **Interactive Prompts:** The `promptFilesExportConfiguration` utility is used to gather detailed export settings from the user, such as the SOQL query, file types, and naming conventions.\n- **File System Operations:** Employs `fs-extra` to create the project directory (`files/your-project-name/`) and write the `export.json` configuration file.\n- **PascalCase Conversion:** Uses `pascalcase` to format the files export path consistently.\n- **JSON Serialization:** Serializes the collected export configuration into a JSON string and writes it to `export.json`.\n- **WebSocket Communication:** Uses `WebSocketClient.requestOpenFile` to open the generated `export.json` file in VS Code, facilitating immediate configuration.\n</details>\n",
4951
+ "description": "\n## Command Behavior\n\n**Configures a project for exporting file attachments from a Salesforce org.**\n\nThis command streamlines the setup of configurations for mass downloading files (such as Notes, Attachments, or Salesforce Files) associated with Salesforce records. It's particularly useful for data backups, migrations, or integrating Salesforce files with external systems.\n\nKey functionalities:\n\n- **Template-Based Configuration:** Allows you to choose from predefined templates for common file export scenarios or start with a blank configuration. Templates can pre-populate the export settings.\n- **Interactive Setup:** Guides you through defining the export project folder name and other export parameters.\n- **`export.json` Generation:** Creates an `export.json` file within the designated project folder. This file contains the configuration for the file export operation, including:\n - **SOQL Query:** A SOQL query to select the parent records from which files will be exported.\n - **File Types:** Specifies which types of files (e.g., `ContentVersion`, `Attachment`) to include.\n - **File Size Filtering:** Minimum file size in KB to filter files during export (files smaller than this will be skipped).\n - **Output Folder/File Naming:** Defines how the exported files and their containing folders will be named based on record fields.\n - **Overwrite Options:** Controls whether existing files or parent records should be overwritten during the export.\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- **Template Selection:** It uses `selectTemplate` to present predefined file export templates or a blank option to the user.\n- **Interactive Prompts:** The `promptFilesExportConfiguration` utility is used to gather detailed export settings from the user, such as the SOQL query, file types, and naming conventions.\n- **File System Operations:** Employs `fs-extra` to create the project directory (`files/your-project-name/`) and write the `export.json` configuration file.\n- **PascalCase Conversion:** Uses `pascalcase` to format the files export path consistently.\n- **JSON Serialization:** Serializes the collected export configuration into a JSON string and writes it to `export.json`.\n- **WebSocket Communication:** Uses `WebSocketClient.requestOpenFile` to open the generated `export.json` file in VS Code, facilitating immediate configuration.\n</details>\n",
4952
4952
  "examples": [
4953
4953
  "$ sf hardis:org:configure:files"
4954
4954
  ],
@@ -5541,7 +5541,7 @@
5541
5541
  "hardis:org:files:export": {
5542
5542
  "aliases": [],
5543
5543
  "args": {},
5544
- "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, and output naming conventions.\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.\n- **File Download:** Downloads the actual file content from Salesforce.\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 and `promptFilesExportConfiguration` for customizing export options.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues or API limits.\n</details>\n",
5544
+ "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- **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.\n- **File Download:** Downloads the actual file content from Salesforce.\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 and `promptFilesExportConfiguration` for customizing export options.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues or API limits.\n</details>\n",
5545
5545
  "examples": [
5546
5546
  "$ sf hardis:org:files:export"
5547
5547
  ],
@@ -5915,6 +5915,128 @@
5915
5915
  "listviewmine:fix:org:hardis"
5916
5916
  ]
5917
5917
  },
5918
+ "hardis:org:generate:packagexmlfull": {
5919
+ "aliases": [],
5920
+ "args": {},
5921
+ "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",
5922
+ "examples": [
5923
+ "$ sf hardis:org:generate:packagexmlfull",
5924
+ "$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
5925
+ "$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
5926
+ ],
5927
+ "flags": {
5928
+ "json": {
5929
+ "description": "Format output as json.",
5930
+ "helpGroup": "GLOBAL",
5931
+ "name": "json",
5932
+ "allowNo": false,
5933
+ "type": "boolean"
5934
+ },
5935
+ "flags-dir": {
5936
+ "helpGroup": "GLOBAL",
5937
+ "name": "flags-dir",
5938
+ "summary": "Import flag values from a directory.",
5939
+ "hasDynamicHelp": false,
5940
+ "multiple": false,
5941
+ "type": "option"
5942
+ },
5943
+ "outputfile": {
5944
+ "description": "Output package.xml file",
5945
+ "name": "outputfile",
5946
+ "hasDynamicHelp": false,
5947
+ "multiple": false,
5948
+ "type": "option"
5949
+ },
5950
+ "debug": {
5951
+ "char": "d",
5952
+ "description": "Activate debug mode (more logs)",
5953
+ "name": "debug",
5954
+ "allowNo": false,
5955
+ "type": "boolean"
5956
+ },
5957
+ "no-prompt": {
5958
+ "char": "n",
5959
+ "description": "Do not prompt for org username, use the default one",
5960
+ "name": "no-prompt",
5961
+ "allowNo": false,
5962
+ "type": "boolean"
5963
+ },
5964
+ "websocket": {
5965
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5966
+ "name": "websocket",
5967
+ "hasDynamicHelp": false,
5968
+ "multiple": false,
5969
+ "type": "option"
5970
+ },
5971
+ "skipauth": {
5972
+ "description": "Skip authentication check when a default username is required",
5973
+ "name": "skipauth",
5974
+ "allowNo": false,
5975
+ "type": "boolean"
5976
+ },
5977
+ "target-org": {
5978
+ "aliases": [
5979
+ "targetusername",
5980
+ "u"
5981
+ ],
5982
+ "char": "o",
5983
+ "deprecateAliases": true,
5984
+ "name": "target-org",
5985
+ "noCacheDefault": true,
5986
+ "required": true,
5987
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5988
+ "hasDynamicHelp": true,
5989
+ "multiple": false,
5990
+ "type": "option"
5991
+ }
5992
+ },
5993
+ "hasDynamicHelp": true,
5994
+ "hiddenAliases": [],
5995
+ "id": "hardis:org:generate:packagexmlfull",
5996
+ "pluginAlias": "sfdx-hardis",
5997
+ "pluginName": "sfdx-hardis",
5998
+ "pluginType": "core",
5999
+ "strict": true,
6000
+ "enableJsonFlag": true,
6001
+ "title": "Generate Full Org package.xml",
6002
+ "requiresProject": false,
6003
+ "isESM": true,
6004
+ "relativePath": [
6005
+ "lib",
6006
+ "commands",
6007
+ "hardis",
6008
+ "org",
6009
+ "generate",
6010
+ "packagexmlfull.js"
6011
+ ],
6012
+ "aliasPermutations": [],
6013
+ "permutations": [
6014
+ "hardis:org:generate:packagexmlfull",
6015
+ "org:hardis:generate:packagexmlfull",
6016
+ "org:generate:hardis:packagexmlfull",
6017
+ "org:generate:packagexmlfull:hardis",
6018
+ "hardis:generate:org:packagexmlfull",
6019
+ "generate:hardis:org:packagexmlfull",
6020
+ "generate:org:hardis:packagexmlfull",
6021
+ "generate:org:packagexmlfull:hardis",
6022
+ "hardis:generate:packagexmlfull:org",
6023
+ "generate:hardis:packagexmlfull:org",
6024
+ "generate:packagexmlfull:hardis:org",
6025
+ "generate:packagexmlfull:org:hardis",
6026
+ "hardis:org:packagexmlfull:generate",
6027
+ "org:hardis:packagexmlfull:generate",
6028
+ "org:packagexmlfull:hardis:generate",
6029
+ "org:packagexmlfull:generate:hardis",
6030
+ "hardis:packagexmlfull:org:generate",
6031
+ "packagexmlfull:hardis:org:generate",
6032
+ "packagexmlfull:org:hardis:generate",
6033
+ "packagexmlfull:org:generate:hardis",
6034
+ "hardis:packagexmlfull:generate:org",
6035
+ "packagexmlfull:hardis:generate:org",
6036
+ "packagexmlfull:generate:hardis:org",
6037
+ "packagexmlfull:generate:org:hardis"
6038
+ ]
6039
+ },
5918
6040
  "hardis:org:diagnose:audittrail": {
5919
6041
  "aliases": [],
5920
6042
  "args": {},
@@ -7178,14 +7300,12 @@
7178
7300
  "unusedusers:diagnose:org:hardis"
7179
7301
  ]
7180
7302
  },
7181
- "hardis:org:generate:packagexmlfull": {
7303
+ "hardis:org:monitor:all": {
7182
7304
  "aliases": [],
7183
7305
  "args": {},
7184
- "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",
7306
+ "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",
7185
7307
  "examples": [
7186
- "$ sf hardis:org:generate:packagexmlfull",
7187
- "$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
7188
- "$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
7308
+ "$ sf hardis:org:monitor:all"
7189
7309
  ],
7190
7310
  "flags": {
7191
7311
  "json": {
@@ -7203,13 +7323,6 @@
7203
7323
  "multiple": false,
7204
7324
  "type": "option"
7205
7325
  },
7206
- "outputfile": {
7207
- "description": "Output package.xml file",
7208
- "name": "outputfile",
7209
- "hasDynamicHelp": false,
7210
- "multiple": false,
7211
- "type": "option"
7212
- },
7213
7326
  "debug": {
7214
7327
  "char": "d",
7215
7328
  "description": "Activate debug mode (more logs)",
@@ -7217,13 +7330,6 @@
7217
7330
  "allowNo": false,
7218
7331
  "type": "boolean"
7219
7332
  },
7220
- "no-prompt": {
7221
- "char": "n",
7222
- "description": "Do not prompt for org username, use the default one",
7223
- "name": "no-prompt",
7224
- "allowNo": false,
7225
- "type": "boolean"
7226
- },
7227
7333
  "websocket": {
7228
7334
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7229
7335
  "name": "websocket",
@@ -7255,113 +7361,7 @@
7255
7361
  },
7256
7362
  "hasDynamicHelp": true,
7257
7363
  "hiddenAliases": [],
7258
- "id": "hardis:org:generate:packagexmlfull",
7259
- "pluginAlias": "sfdx-hardis",
7260
- "pluginName": "sfdx-hardis",
7261
- "pluginType": "core",
7262
- "strict": true,
7263
- "enableJsonFlag": true,
7264
- "title": "Generate Full Org package.xml",
7265
- "requiresProject": false,
7266
- "isESM": true,
7267
- "relativePath": [
7268
- "lib",
7269
- "commands",
7270
- "hardis",
7271
- "org",
7272
- "generate",
7273
- "packagexmlfull.js"
7274
- ],
7275
- "aliasPermutations": [],
7276
- "permutations": [
7277
- "hardis:org:generate:packagexmlfull",
7278
- "org:hardis:generate:packagexmlfull",
7279
- "org:generate:hardis:packagexmlfull",
7280
- "org:generate:packagexmlfull:hardis",
7281
- "hardis:generate:org:packagexmlfull",
7282
- "generate:hardis:org:packagexmlfull",
7283
- "generate:org:hardis:packagexmlfull",
7284
- "generate:org:packagexmlfull:hardis",
7285
- "hardis:generate:packagexmlfull:org",
7286
- "generate:hardis:packagexmlfull:org",
7287
- "generate:packagexmlfull:hardis:org",
7288
- "generate:packagexmlfull:org:hardis",
7289
- "hardis:org:packagexmlfull:generate",
7290
- "org:hardis:packagexmlfull:generate",
7291
- "org:packagexmlfull:hardis:generate",
7292
- "org:packagexmlfull:generate:hardis",
7293
- "hardis:packagexmlfull:org:generate",
7294
- "packagexmlfull:hardis:org:generate",
7295
- "packagexmlfull:org:hardis:generate",
7296
- "packagexmlfull:org:generate:hardis",
7297
- "hardis:packagexmlfull:generate:org",
7298
- "packagexmlfull:hardis:generate:org",
7299
- "packagexmlfull:generate:hardis:org",
7300
- "packagexmlfull:generate:org:hardis"
7301
- ]
7302
- },
7303
- "hardis:org:monitor:all": {
7304
- "aliases": [],
7305
- "args": {},
7306
- "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",
7307
- "examples": [
7308
- "$ sf hardis:org:monitor:all"
7309
- ],
7310
- "flags": {
7311
- "json": {
7312
- "description": "Format output as json.",
7313
- "helpGroup": "GLOBAL",
7314
- "name": "json",
7315
- "allowNo": false,
7316
- "type": "boolean"
7317
- },
7318
- "flags-dir": {
7319
- "helpGroup": "GLOBAL",
7320
- "name": "flags-dir",
7321
- "summary": "Import flag values from a directory.",
7322
- "hasDynamicHelp": false,
7323
- "multiple": false,
7324
- "type": "option"
7325
- },
7326
- "debug": {
7327
- "char": "d",
7328
- "description": "Activate debug mode (more logs)",
7329
- "name": "debug",
7330
- "allowNo": false,
7331
- "type": "boolean"
7332
- },
7333
- "websocket": {
7334
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7335
- "name": "websocket",
7336
- "hasDynamicHelp": false,
7337
- "multiple": false,
7338
- "type": "option"
7339
- },
7340
- "skipauth": {
7341
- "description": "Skip authentication check when a default username is required",
7342
- "name": "skipauth",
7343
- "allowNo": false,
7344
- "type": "boolean"
7345
- },
7346
- "target-org": {
7347
- "aliases": [
7348
- "targetusername",
7349
- "u"
7350
- ],
7351
- "char": "o",
7352
- "deprecateAliases": true,
7353
- "name": "target-org",
7354
- "noCacheDefault": true,
7355
- "required": true,
7356
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7357
- "hasDynamicHelp": true,
7358
- "multiple": false,
7359
- "type": "option"
7360
- }
7361
- },
7362
- "hasDynamicHelp": true,
7363
- "hiddenAliases": [],
7364
- "id": "hardis:org:monitor:all",
7364
+ "id": "hardis:org:monitor:all",
7365
7365
  "pluginAlias": "sfdx-hardis",
7366
7366
  "pluginName": "sfdx-hardis",
7367
7367
  "pluginType": "core",
@@ -9811,6 +9811,109 @@
9811
9811
  "auth:configure:project:hardis"
9812
9812
  ]
9813
9813
  },
9814
+ "hardis:project:convert:profilestopermsets": {
9815
+ "aliases": [],
9816
+ "args": {},
9817
+ "description": "\n## Command Behavior\n\n**Converts existing Salesforce Profiles into Permission Sets, facilitating a more granular and recommended security model.**\n\nThis command helps in migrating permissions from Profiles to Permission Sets, which is a best practice for managing user access in Salesforce. It creates a new Permission Set for each specified Profile, adopting a naming convention of `PS_PROFILENAME`.\n\nKey functionalities:\n\n- **Profile to Permission Set Conversion:** Automatically extracts permissions from a Profile and creates a corresponding Permission Set.\n- **Naming Convention:** New Permission Sets are named with a `PS_` prefix followed by the Profile name (e.g., `PS_Standard_User`).\n- **Exclusion Filter:** Allows you to exclude specific Profiles from the conversion process using the `--except` flag.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **External Plugin Integration:** It relies on the `shane-sfdx-plugins` (specifically the `sf shane:profile:convert` command) to perform the actual conversion.\n- **File System Scan:** It reads the contents of the `force-app/main/default/profiles` directory to identify all available Profile metadata files.\n- **Command Execution:** For each identified Profile (that is not excluded), it constructs and executes the `sf shane:profile:convert` command with the appropriate Profile name and desired Permission Set name.\n- **Error Handling:** Includes basic error handling for the external command execution.\n</details>\n",
9818
+ "examples": [
9819
+ "$ sf hardis:project:convert:profilestopermsets"
9820
+ ],
9821
+ "flags": {
9822
+ "json": {
9823
+ "description": "Format output as json.",
9824
+ "helpGroup": "GLOBAL",
9825
+ "name": "json",
9826
+ "allowNo": false,
9827
+ "type": "boolean"
9828
+ },
9829
+ "flags-dir": {
9830
+ "helpGroup": "GLOBAL",
9831
+ "name": "flags-dir",
9832
+ "summary": "Import flag values from a directory.",
9833
+ "hasDynamicHelp": false,
9834
+ "multiple": false,
9835
+ "type": "option"
9836
+ },
9837
+ "except": {
9838
+ "char": "e",
9839
+ "description": "List of filters",
9840
+ "name": "except",
9841
+ "default": [],
9842
+ "hasDynamicHelp": false,
9843
+ "multiple": true,
9844
+ "type": "option"
9845
+ },
9846
+ "debug": {
9847
+ "char": "d",
9848
+ "description": "Activate debug mode (more logs)",
9849
+ "name": "debug",
9850
+ "allowNo": false,
9851
+ "type": "boolean"
9852
+ },
9853
+ "websocket": {
9854
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9855
+ "name": "websocket",
9856
+ "hasDynamicHelp": false,
9857
+ "multiple": false,
9858
+ "type": "option"
9859
+ },
9860
+ "skipauth": {
9861
+ "description": "Skip authentication check when a default username is required",
9862
+ "name": "skipauth",
9863
+ "allowNo": false,
9864
+ "type": "boolean"
9865
+ }
9866
+ },
9867
+ "hasDynamicHelp": false,
9868
+ "hiddenAliases": [],
9869
+ "id": "hardis:project:convert:profilestopermsets",
9870
+ "pluginAlias": "sfdx-hardis",
9871
+ "pluginName": "sfdx-hardis",
9872
+ "pluginType": "core",
9873
+ "strict": true,
9874
+ "enableJsonFlag": true,
9875
+ "title": "Convert Profiles into Permission Sets",
9876
+ "requiresProject": true,
9877
+ "requiresSfdxPlugins": [
9878
+ "shane-sfdx-plugins"
9879
+ ],
9880
+ "isESM": true,
9881
+ "relativePath": [
9882
+ "lib",
9883
+ "commands",
9884
+ "hardis",
9885
+ "project",
9886
+ "convert",
9887
+ "profilestopermsets.js"
9888
+ ],
9889
+ "aliasPermutations": [],
9890
+ "permutations": [
9891
+ "hardis:project:convert:profilestopermsets",
9892
+ "project:hardis:convert:profilestopermsets",
9893
+ "project:convert:hardis:profilestopermsets",
9894
+ "project:convert:profilestopermsets:hardis",
9895
+ "hardis:convert:project:profilestopermsets",
9896
+ "convert:hardis:project:profilestopermsets",
9897
+ "convert:project:hardis:profilestopermsets",
9898
+ "convert:project:profilestopermsets:hardis",
9899
+ "hardis:convert:profilestopermsets:project",
9900
+ "convert:hardis:profilestopermsets:project",
9901
+ "convert:profilestopermsets:hardis:project",
9902
+ "convert:profilestopermsets:project:hardis",
9903
+ "hardis:project:profilestopermsets:convert",
9904
+ "project:hardis:profilestopermsets:convert",
9905
+ "project:profilestopermsets:hardis:convert",
9906
+ "project:profilestopermsets:convert:hardis",
9907
+ "hardis:profilestopermsets:project:convert",
9908
+ "profilestopermsets:hardis:project:convert",
9909
+ "profilestopermsets:project:hardis:convert",
9910
+ "profilestopermsets:project:convert:hardis",
9911
+ "hardis:profilestopermsets:convert:project",
9912
+ "profilestopermsets:hardis:convert:project",
9913
+ "profilestopermsets:convert:hardis:project",
9914
+ "profilestopermsets:convert:project:hardis"
9915
+ ]
9916
+ },
9814
9917
  "hardis:project:clean:emptyitems": {
9815
9918
  "aliases": [],
9816
9919
  "args": {},
@@ -11296,12 +11399,12 @@
11296
11399
  "xml:clean:project:hardis"
11297
11400
  ]
11298
11401
  },
11299
- "hardis:project:convert:profilestopermsets": {
11402
+ "hardis:project:fix:profiletabs": {
11300
11403
  "aliases": [],
11301
11404
  "args": {},
11302
- "description": "\n## Command Behavior\n\n**Converts existing Salesforce Profiles into Permission Sets, facilitating a more granular and recommended security model.**\n\nThis command helps in migrating permissions from Profiles to Permission Sets, which is a best practice for managing user access in Salesforce. It creates a new Permission Set for each specified Profile, adopting a naming convention of `PS_PROFILENAME`.\n\nKey functionalities:\n\n- **Profile to Permission Set Conversion:** Automatically extracts permissions from a Profile and creates a corresponding Permission Set.\n- **Naming Convention:** New Permission Sets are named with a `PS_` prefix followed by the Profile name (e.g., `PS_Standard_User`).\n- **Exclusion Filter:** Allows you to exclude specific Profiles from the conversion process using the `--except` flag.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **External Plugin Integration:** It relies on the `shane-sfdx-plugins` (specifically the `sf shane:profile:convert` command) to perform the actual conversion.\n- **File System Scan:** It reads the contents of the `force-app/main/default/profiles` directory to identify all available Profile metadata files.\n- **Command Execution:** For each identified Profile (that is not excluded), it constructs and executes the `sf shane:profile:convert` command with the appropriate Profile name and desired Permission Set name.\n- **Error Handling:** Includes basic error handling for the external command execution.\n</details>\n",
11405
+ "description": "\n## Command Behavior\n\n**Interactively updates tab visibility settings in Salesforce profiles, addressing a common issue where tab visibilities are not correctly retrieved by `sf project retrieve start`.**\n\nThis command provides a user-friendly interface to manage tab settings within your profile XML files, ensuring that your local project accurately reflects the intended tab configurations in your Salesforce org.\n\nKey functionalities:\n\n- **Interactive Tab Selection:** Displays a multi-select menu of all available tabs in your org, allowing you to choose which tabs to update.\n- **Visibility Control:** Lets you set the visibility for the selected tabs to either `DefaultOn` (Visible) or `Hidden`.\n- **Profile Selection:** Presents a multi-select menu of all .profile-meta.xml files in your project, allowing you to apply the tab visibility changes to specific profiles.\n- **XML Updates:** Modifies the <tabVisibilities> section of the selected profile XML files to reflect the chosen tab settings. If a tab visibility setting already exists for a selected tab, it will be updated; otherwise, a new one will be added.\n- **Sorted Output:** The <tabVisibilities> in the updated profile XML files are sorted alphabetically for consistency and readability.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries the `TabDefinition` object using `soqlQueryTooling` to retrieve a list of all available tabs in the target org.\n- **File Discovery:** Uses `glob` to find all .profile-meta.xml files within the specified project path.\n- **Interactive Prompts:** Leverages the `prompts` library to create interactive menus for selecting tabs, visibility settings, and profiles.\n- **XML Parsing and Manipulation:** Uses `parseXmlFile` to read the content of profile XML files and `writeXmlFile` to write the modified content back. It manipulates the `tabVisibilities` array within the parsed XML to add or update tab settings.\n- **Array Sorting:** Employs the `sort-array` library to sort the `tabVisibilities` alphabetically by tab name.\n- **Logging:** Provides feedback to the user about which profiles have been updated and a summary of the changes.\n</details>\n",
11303
11406
  "examples": [
11304
- "$ sf hardis:project:convert:profilestopermsets"
11407
+ "$ sf hardis:project:fix:profiletabs"
11305
11408
  ],
11306
11409
  "flags": {
11307
11410
  "json": {
@@ -11319,13 +11422,13 @@
11319
11422
  "multiple": false,
11320
11423
  "type": "option"
11321
11424
  },
11322
- "except": {
11323
- "char": "e",
11324
- "description": "List of filters",
11325
- "name": "except",
11326
- "default": [],
11425
+ "path": {
11426
+ "char": "p",
11427
+ "description": "Root folder",
11428
+ "name": "path",
11429
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
11327
11430
  "hasDynamicHelp": false,
11328
- "multiple": true,
11431
+ "multiple": false,
11329
11432
  "type": "option"
11330
11433
  },
11331
11434
  "debug": {
@@ -11347,56 +11450,168 @@
11347
11450
  "name": "skipauth",
11348
11451
  "allowNo": false,
11349
11452
  "type": "boolean"
11453
+ },
11454
+ "target-org": {
11455
+ "aliases": [
11456
+ "targetusername",
11457
+ "u"
11458
+ ],
11459
+ "char": "o",
11460
+ "deprecateAliases": true,
11461
+ "name": "target-org",
11462
+ "noCacheDefault": true,
11463
+ "required": true,
11464
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
11465
+ "hasDynamicHelp": true,
11466
+ "multiple": false,
11467
+ "type": "option"
11350
11468
  }
11351
11469
  },
11352
- "hasDynamicHelp": false,
11470
+ "hasDynamicHelp": true,
11353
11471
  "hiddenAliases": [],
11354
- "id": "hardis:project:convert:profilestopermsets",
11472
+ "id": "hardis:project:fix:profiletabs",
11355
11473
  "pluginAlias": "sfdx-hardis",
11356
11474
  "pluginName": "sfdx-hardis",
11357
11475
  "pluginType": "core",
11358
11476
  "strict": true,
11359
11477
  "enableJsonFlag": true,
11360
- "title": "Convert Profiles into Permission Sets",
11478
+ "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
11361
11479
  "requiresProject": true,
11362
- "requiresSfdxPlugins": [
11363
- "shane-sfdx-plugins"
11364
- ],
11365
11480
  "isESM": true,
11366
11481
  "relativePath": [
11367
11482
  "lib",
11368
11483
  "commands",
11369
11484
  "hardis",
11370
11485
  "project",
11371
- "convert",
11372
- "profilestopermsets.js"
11486
+ "fix",
11487
+ "profiletabs.js"
11373
11488
  ],
11374
11489
  "aliasPermutations": [],
11375
11490
  "permutations": [
11376
- "hardis:project:convert:profilestopermsets",
11377
- "project:hardis:convert:profilestopermsets",
11378
- "project:convert:hardis:profilestopermsets",
11379
- "project:convert:profilestopermsets:hardis",
11380
- "hardis:convert:project:profilestopermsets",
11381
- "convert:hardis:project:profilestopermsets",
11382
- "convert:project:hardis:profilestopermsets",
11383
- "convert:project:profilestopermsets:hardis",
11384
- "hardis:convert:profilestopermsets:project",
11385
- "convert:hardis:profilestopermsets:project",
11386
- "convert:profilestopermsets:hardis:project",
11387
- "convert:profilestopermsets:project:hardis",
11388
- "hardis:project:profilestopermsets:convert",
11389
- "project:hardis:profilestopermsets:convert",
11390
- "project:profilestopermsets:hardis:convert",
11391
- "project:profilestopermsets:convert:hardis",
11392
- "hardis:profilestopermsets:project:convert",
11393
- "profilestopermsets:hardis:project:convert",
11394
- "profilestopermsets:project:hardis:convert",
11395
- "profilestopermsets:project:convert:hardis",
11396
- "hardis:profilestopermsets:convert:project",
11397
- "profilestopermsets:hardis:convert:project",
11398
- "profilestopermsets:convert:hardis:project",
11399
- "profilestopermsets:convert:project:hardis"
11491
+ "hardis:project:fix:profiletabs",
11492
+ "project:hardis:fix:profiletabs",
11493
+ "project:fix:hardis:profiletabs",
11494
+ "project:fix:profiletabs:hardis",
11495
+ "hardis:fix:project:profiletabs",
11496
+ "fix:hardis:project:profiletabs",
11497
+ "fix:project:hardis:profiletabs",
11498
+ "fix:project:profiletabs:hardis",
11499
+ "hardis:fix:profiletabs:project",
11500
+ "fix:hardis:profiletabs:project",
11501
+ "fix:profiletabs:hardis:project",
11502
+ "fix:profiletabs:project:hardis",
11503
+ "hardis:project:profiletabs:fix",
11504
+ "project:hardis:profiletabs:fix",
11505
+ "project:profiletabs:hardis:fix",
11506
+ "project:profiletabs:fix:hardis",
11507
+ "hardis:profiletabs:project:fix",
11508
+ "profiletabs:hardis:project:fix",
11509
+ "profiletabs:project:hardis:fix",
11510
+ "profiletabs:project:fix:hardis",
11511
+ "hardis:profiletabs:fix:project",
11512
+ "profiletabs:hardis:fix:project",
11513
+ "profiletabs:fix:hardis:project",
11514
+ "profiletabs:fix:project:hardis"
11515
+ ]
11516
+ },
11517
+ "hardis:project:fix:v53flexipages": {
11518
+ "aliases": [],
11519
+ "args": {},
11520
+ "description": "\n## Command Behavior\n\n**Fixes Salesforce FlexiPages for compatibility with API Version 53.0 (Winter '22 release) by adding missing identifiers to component instances.**\n\nSalesforce introduced a change in API Version 53.0 that requires `identifier` tags within `componentInstance` and `fieldInstance` elements in FlexiPage metadata. If these identifiers are missing, deployments to orgs with API version 53.0 or higher will fail. This command automates the process of adding these missing identifiers, ensuring your FlexiPages remain deployable.\n\nKey functionalities:\n\n- **Targeted FlexiPage Processing:** Scans all .flexipage-meta.xml files within the specified root folder (defaults to current working directory).\n- **Identifier Injection:** Inserts a unique `identifier` tag (e.g., `SFDX_HARDIS_REPLACEMENT_ID`) into `componentInstance` and `fieldInstance` elements that lack one.\n\n**Important Note:** After running this command, ensure you update your `apiVersion` to `53.0` (or higher) in your `package.xml` and `sfdx-project.json` files.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find all .flexipage-meta.xml files.\n- **Content Reading:** Reads the XML content of each FlexiPage file.\n- **Regular Expression Replacement:** Employs a set of regular expressions to identify specific XML patterns (componentName.../componentName.../componentInstance, componentName.../componentName.../visibilityRule, fieldItem.../fieldItem.../fieldInstance) that are missing the `identifier` tag.\n- **Dynamic ID Generation:** For each match, it generates a unique identifier (e.g., `sfdxHardisIdX`) and injects it into the XML structure.\n- **File Writing:** If changes are made, the modified XML content is written back to the FlexiPage file using `fs.writeFile`.\n- **Logging:** Provides messages about which FlexiPages are being processed and a summary of the total number of identifiers added.\n</details>\n",
11521
+ "examples": [
11522
+ "$ sf hardis:project:fix:v53flexipages"
11523
+ ],
11524
+ "flags": {
11525
+ "json": {
11526
+ "description": "Format output as json.",
11527
+ "helpGroup": "GLOBAL",
11528
+ "name": "json",
11529
+ "allowNo": false,
11530
+ "type": "boolean"
11531
+ },
11532
+ "flags-dir": {
11533
+ "helpGroup": "GLOBAL",
11534
+ "name": "flags-dir",
11535
+ "summary": "Import flag values from a directory.",
11536
+ "hasDynamicHelp": false,
11537
+ "multiple": false,
11538
+ "type": "option"
11539
+ },
11540
+ "path": {
11541
+ "char": "p",
11542
+ "description": "Root folder",
11543
+ "name": "path",
11544
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
11545
+ "hasDynamicHelp": false,
11546
+ "multiple": false,
11547
+ "type": "option"
11548
+ },
11549
+ "debug": {
11550
+ "char": "d",
11551
+ "description": "Activate debug mode (more logs)",
11552
+ "name": "debug",
11553
+ "allowNo": false,
11554
+ "type": "boolean"
11555
+ },
11556
+ "websocket": {
11557
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11558
+ "name": "websocket",
11559
+ "hasDynamicHelp": false,
11560
+ "multiple": false,
11561
+ "type": "option"
11562
+ },
11563
+ "skipauth": {
11564
+ "description": "Skip authentication check when a default username is required",
11565
+ "name": "skipauth",
11566
+ "allowNo": false,
11567
+ "type": "boolean"
11568
+ }
11569
+ },
11570
+ "hasDynamicHelp": false,
11571
+ "hiddenAliases": [],
11572
+ "id": "hardis:project:fix:v53flexipages",
11573
+ "pluginAlias": "sfdx-hardis",
11574
+ "pluginName": "sfdx-hardis",
11575
+ "pluginType": "core",
11576
+ "strict": true,
11577
+ "enableJsonFlag": true,
11578
+ "title": "Fix flexipages for v53",
11579
+ "requiresProject": true,
11580
+ "isESM": true,
11581
+ "relativePath": [
11582
+ "lib",
11583
+ "commands",
11584
+ "hardis",
11585
+ "project",
11586
+ "fix",
11587
+ "v53flexipages.js"
11588
+ ],
11589
+ "aliasPermutations": [],
11590
+ "permutations": [
11591
+ "hardis:project:fix:v53flexipages",
11592
+ "project:hardis:fix:v53flexipages",
11593
+ "project:fix:hardis:v53flexipages",
11594
+ "project:fix:v53flexipages:hardis",
11595
+ "hardis:fix:project:v53flexipages",
11596
+ "fix:hardis:project:v53flexipages",
11597
+ "fix:project:hardis:v53flexipages",
11598
+ "fix:project:v53flexipages:hardis",
11599
+ "hardis:fix:v53flexipages:project",
11600
+ "fix:hardis:v53flexipages:project",
11601
+ "fix:v53flexipages:hardis:project",
11602
+ "fix:v53flexipages:project:hardis",
11603
+ "hardis:project:v53flexipages:fix",
11604
+ "project:hardis:v53flexipages:fix",
11605
+ "project:v53flexipages:hardis:fix",
11606
+ "project:v53flexipages:fix:hardis",
11607
+ "hardis:v53flexipages:project:fix",
11608
+ "v53flexipages:hardis:project:fix",
11609
+ "v53flexipages:project:hardis:fix",
11610
+ "v53flexipages:project:fix:hardis",
11611
+ "hardis:v53flexipages:fix:project",
11612
+ "v53flexipages:hardis:fix:project",
11613
+ "v53flexipages:fix:hardis:project",
11614
+ "v53flexipages:fix:project:hardis"
11400
11615
  ]
11401
11616
  },
11402
11617
  "hardis:project:deploy:notify": {
@@ -12574,127 +12789,14 @@
12574
12789
  "validate:deploy:project:hardis"
12575
12790
  ]
12576
12791
  },
12577
- "hardis:project:fix:profiletabs": {
12578
- "aliases": [],
12579
- "args": {},
12580
- "description": "\n## Command Behavior\n\n**Interactively updates tab visibility settings in Salesforce profiles, addressing a common issue where tab visibilities are not correctly retrieved by `sf project retrieve start`.**\n\nThis command provides a user-friendly interface to manage tab settings within your profile XML files, ensuring that your local project accurately reflects the intended tab configurations in your Salesforce org.\n\nKey functionalities:\n\n- **Interactive Tab Selection:** Displays a multi-select menu of all available tabs in your org, allowing you to choose which tabs to update.\n- **Visibility Control:** Lets you set the visibility for the selected tabs to either `DefaultOn` (Visible) or `Hidden`.\n- **Profile Selection:** Presents a multi-select menu of all .profile-meta.xml files in your project, allowing you to apply the tab visibility changes to specific profiles.\n- **XML Updates:** Modifies the <tabVisibilities> section of the selected profile XML files to reflect the chosen tab settings. If a tab visibility setting already exists for a selected tab, it will be updated; otherwise, a new one will be added.\n- **Sorted Output:** The <tabVisibilities> in the updated profile XML files are sorted alphabetically for consistency and readability.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries the `TabDefinition` object using `soqlQueryTooling` to retrieve a list of all available tabs in the target org.\n- **File Discovery:** Uses `glob` to find all .profile-meta.xml files within the specified project path.\n- **Interactive Prompts:** Leverages the `prompts` library to create interactive menus for selecting tabs, visibility settings, and profiles.\n- **XML Parsing and Manipulation:** Uses `parseXmlFile` to read the content of profile XML files and `writeXmlFile` to write the modified content back. It manipulates the `tabVisibilities` array within the parsed XML to add or update tab settings.\n- **Array Sorting:** Employs the `sort-array` library to sort the `tabVisibilities` alphabetically by tab name.\n- **Logging:** Provides feedback to the user about which profiles have been updated and a summary of the changes.\n</details>\n",
12581
- "examples": [
12582
- "$ sf hardis:project:fix:profiletabs"
12583
- ],
12584
- "flags": {
12585
- "json": {
12586
- "description": "Format output as json.",
12587
- "helpGroup": "GLOBAL",
12588
- "name": "json",
12589
- "allowNo": false,
12590
- "type": "boolean"
12591
- },
12592
- "flags-dir": {
12593
- "helpGroup": "GLOBAL",
12594
- "name": "flags-dir",
12595
- "summary": "Import flag values from a directory.",
12596
- "hasDynamicHelp": false,
12597
- "multiple": false,
12598
- "type": "option"
12599
- },
12600
- "path": {
12601
- "char": "p",
12602
- "description": "Root folder",
12603
- "name": "path",
12604
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12605
- "hasDynamicHelp": false,
12606
- "multiple": false,
12607
- "type": "option"
12608
- },
12609
- "debug": {
12610
- "char": "d",
12611
- "description": "Activate debug mode (more logs)",
12612
- "name": "debug",
12613
- "allowNo": false,
12614
- "type": "boolean"
12615
- },
12616
- "websocket": {
12617
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12618
- "name": "websocket",
12619
- "hasDynamicHelp": false,
12620
- "multiple": false,
12621
- "type": "option"
12622
- },
12623
- "skipauth": {
12624
- "description": "Skip authentication check when a default username is required",
12625
- "name": "skipauth",
12626
- "allowNo": false,
12627
- "type": "boolean"
12628
- },
12629
- "target-org": {
12630
- "aliases": [
12631
- "targetusername",
12632
- "u"
12633
- ],
12634
- "char": "o",
12635
- "deprecateAliases": true,
12636
- "name": "target-org",
12637
- "noCacheDefault": true,
12638
- "required": true,
12639
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12640
- "hasDynamicHelp": true,
12641
- "multiple": false,
12642
- "type": "option"
12643
- }
12644
- },
12645
- "hasDynamicHelp": true,
12646
- "hiddenAliases": [],
12647
- "id": "hardis:project:fix:profiletabs",
12648
- "pluginAlias": "sfdx-hardis",
12649
- "pluginName": "sfdx-hardis",
12650
- "pluginType": "core",
12651
- "strict": true,
12652
- "enableJsonFlag": true,
12653
- "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
12654
- "requiresProject": true,
12655
- "isESM": true,
12656
- "relativePath": [
12657
- "lib",
12658
- "commands",
12659
- "hardis",
12660
- "project",
12661
- "fix",
12662
- "profiletabs.js"
12663
- ],
12664
- "aliasPermutations": [],
12665
- "permutations": [
12666
- "hardis:project:fix:profiletabs",
12667
- "project:hardis:fix:profiletabs",
12668
- "project:fix:hardis:profiletabs",
12669
- "project:fix:profiletabs:hardis",
12670
- "hardis:fix:project:profiletabs",
12671
- "fix:hardis:project:profiletabs",
12672
- "fix:project:hardis:profiletabs",
12673
- "fix:project:profiletabs:hardis",
12674
- "hardis:fix:profiletabs:project",
12675
- "fix:hardis:profiletabs:project",
12676
- "fix:profiletabs:hardis:project",
12677
- "fix:profiletabs:project:hardis",
12678
- "hardis:project:profiletabs:fix",
12679
- "project:hardis:profiletabs:fix",
12680
- "project:profiletabs:hardis:fix",
12681
- "project:profiletabs:fix:hardis",
12682
- "hardis:profiletabs:project:fix",
12683
- "profiletabs:hardis:project:fix",
12684
- "profiletabs:project:hardis:fix",
12685
- "profiletabs:project:fix:hardis",
12686
- "hardis:profiletabs:fix:project",
12687
- "profiletabs:hardis:fix:project",
12688
- "profiletabs:fix:hardis:project",
12689
- "profiletabs:fix:project:hardis"
12690
- ]
12691
- },
12692
- "hardis:project:fix:v53flexipages": {
12792
+ "hardis:project:metadata:findduplicates": {
12693
12793
  "aliases": [],
12694
12794
  "args": {},
12695
- "description": "\n## Command Behavior\n\n**Fixes Salesforce FlexiPages for compatibility with API Version 53.0 (Winter '22 release) by adding missing identifiers to component instances.**\n\nSalesforce introduced a change in API Version 53.0 that requires `identifier` tags within `componentInstance` and `fieldInstance` elements in FlexiPage metadata. If these identifiers are missing, deployments to orgs with API version 53.0 or higher will fail. This command automates the process of adding these missing identifiers, ensuring your FlexiPages remain deployable.\n\nKey functionalities:\n\n- **Targeted FlexiPage Processing:** Scans all .flexipage-meta.xml files within the specified root folder (defaults to current working directory).\n- **Identifier Injection:** Inserts a unique `identifier` tag (e.g., `SFDX_HARDIS_REPLACEMENT_ID`) into `componentInstance` and `fieldInstance` elements that lack one.\n\n**Important Note:** After running this command, ensure you update your `apiVersion` to `53.0` (or higher) in your `package.xml` and `sfdx-project.json` files.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find all .flexipage-meta.xml files.\n- **Content Reading:** Reads the XML content of each FlexiPage file.\n- **Regular Expression Replacement:** Employs a set of regular expressions to identify specific XML patterns (componentName.../componentName.../componentInstance, componentName.../componentName.../visibilityRule, fieldItem.../fieldItem.../fieldInstance) that are missing the `identifier` tag.\n- **Dynamic ID Generation:** For each match, it generates a unique identifier (e.g., `sfdxHardisIdX`) and injects it into the XML structure.\n- **File Writing:** If changes are made, the modified XML content is written back to the FlexiPage file using `fs.writeFile`.\n- **Logging:** Provides messages about which FlexiPages are being processed and a summary of the total number of identifiers added.\n</details>\n",
12795
+ "description": "find duplicate values in XML file(s).\n Find duplicate values in XML file(s). Keys to be checked can be configured in `config/sfdx-hardis.yml` using property metadataDuplicateFindKeys.\n\nDefault config :\nmetadataDuplicateFindKeys :\n[object Object]\n",
12696
12796
  "examples": [
12697
- "$ sf hardis:project:fix:v53flexipages"
12797
+ "\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Layout xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n <layoutSections>\n ...\n <layoutColumns>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n </layoutColumns>\n </layoutSections>\n</Layout>\n",
12798
+ "\n$ sf hardis:project:metadata:findduplicates --file layout.layout-meta.xml\n[sfdx-hardis] Duplicate values in layout.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : Name\n",
12799
+ "\n$ sf hardis:project.metadata:findduplicates -f \"force-app/main/default/**/*.xml\"\n[sfdx-hardis] hardis:project:metadata:findduplicates execution time 0:00:00.397\n[sfdx-hardis] Duplicate values in layout1.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : CreatedById\n\n[sfdx-hardis] Duplicate values in layout2.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : LastModifiedById, Name\n"
12698
12800
  ],
12699
12801
  "flags": {
12700
12802
  "json": {
@@ -12712,22 +12814,14 @@
12712
12814
  "multiple": false,
12713
12815
  "type": "option"
12714
12816
  },
12715
- "path": {
12716
- "char": "p",
12717
- "description": "Root folder",
12718
- "name": "path",
12719
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12817
+ "files": {
12818
+ "char": "f",
12819
+ "description": "XML metadata files path",
12820
+ "name": "files",
12720
12821
  "hasDynamicHelp": false,
12721
- "multiple": false,
12822
+ "multiple": true,
12722
12823
  "type": "option"
12723
12824
  },
12724
- "debug": {
12725
- "char": "d",
12726
- "description": "Activate debug mode (more logs)",
12727
- "name": "debug",
12728
- "allowNo": false,
12729
- "type": "boolean"
12730
- },
12731
12825
  "websocket": {
12732
12826
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12733
12827
  "name": "websocket",
@@ -12744,13 +12838,32 @@
12744
12838
  },
12745
12839
  "hasDynamicHelp": false,
12746
12840
  "hiddenAliases": [],
12747
- "id": "hardis:project:fix:v53flexipages",
12841
+ "id": "hardis:project:metadata:findduplicates",
12748
12842
  "pluginAlias": "sfdx-hardis",
12749
12843
  "pluginName": "sfdx-hardis",
12750
12844
  "pluginType": "core",
12751
12845
  "strict": true,
12752
12846
  "enableJsonFlag": true,
12753
- "title": "Fix flexipages for v53",
12847
+ "metadataDuplicateFindKeys": {
12848
+ "layout": [
12849
+ "Layout.layoutSections.layoutColumns.layoutItems.field",
12850
+ "Layout.quickActionListItems.quickActionName"
12851
+ ],
12852
+ "profile": [
12853
+ "Profile.fieldPermissions.field",
12854
+ "Profile.objectPermissions.object",
12855
+ "Profile.classAccesses.apexClass"
12856
+ ],
12857
+ "labels": [
12858
+ "CustomLabels.labels.fullName"
12859
+ ],
12860
+ "permissionset": [
12861
+ "PermissionSet.fieldPermissions.field",
12862
+ "PermissionSet.objectPermissions.object",
12863
+ "PermissionSet.classAccesses.apexClass"
12864
+ ]
12865
+ },
12866
+ "title": "XML duplicate values finder",
12754
12867
  "requiresProject": true,
12755
12868
  "isESM": true,
12756
12869
  "relativePath": [
@@ -12758,35 +12871,35 @@
12758
12871
  "commands",
12759
12872
  "hardis",
12760
12873
  "project",
12761
- "fix",
12762
- "v53flexipages.js"
12874
+ "metadata",
12875
+ "findduplicates.js"
12763
12876
  ],
12764
12877
  "aliasPermutations": [],
12765
12878
  "permutations": [
12766
- "hardis:project:fix:v53flexipages",
12767
- "project:hardis:fix:v53flexipages",
12768
- "project:fix:hardis:v53flexipages",
12769
- "project:fix:v53flexipages:hardis",
12770
- "hardis:fix:project:v53flexipages",
12771
- "fix:hardis:project:v53flexipages",
12772
- "fix:project:hardis:v53flexipages",
12773
- "fix:project:v53flexipages:hardis",
12774
- "hardis:fix:v53flexipages:project",
12775
- "fix:hardis:v53flexipages:project",
12776
- "fix:v53flexipages:hardis:project",
12777
- "fix:v53flexipages:project:hardis",
12778
- "hardis:project:v53flexipages:fix",
12779
- "project:hardis:v53flexipages:fix",
12780
- "project:v53flexipages:hardis:fix",
12781
- "project:v53flexipages:fix:hardis",
12782
- "hardis:v53flexipages:project:fix",
12783
- "v53flexipages:hardis:project:fix",
12784
- "v53flexipages:project:hardis:fix",
12785
- "v53flexipages:project:fix:hardis",
12786
- "hardis:v53flexipages:fix:project",
12787
- "v53flexipages:hardis:fix:project",
12788
- "v53flexipages:fix:hardis:project",
12789
- "v53flexipages:fix:project:hardis"
12879
+ "hardis:project:metadata:findduplicates",
12880
+ "project:hardis:metadata:findduplicates",
12881
+ "project:metadata:hardis:findduplicates",
12882
+ "project:metadata:findduplicates:hardis",
12883
+ "hardis:metadata:project:findduplicates",
12884
+ "metadata:hardis:project:findduplicates",
12885
+ "metadata:project:hardis:findduplicates",
12886
+ "metadata:project:findduplicates:hardis",
12887
+ "hardis:metadata:findduplicates:project",
12888
+ "metadata:hardis:findduplicates:project",
12889
+ "metadata:findduplicates:hardis:project",
12890
+ "metadata:findduplicates:project:hardis",
12891
+ "hardis:project:findduplicates:metadata",
12892
+ "project:hardis:findduplicates:metadata",
12893
+ "project:findduplicates:hardis:metadata",
12894
+ "project:findduplicates:metadata:hardis",
12895
+ "hardis:findduplicates:project:metadata",
12896
+ "findduplicates:hardis:project:metadata",
12897
+ "findduplicates:project:hardis:metadata",
12898
+ "findduplicates:project:metadata:hardis",
12899
+ "hardis:findduplicates:metadata:project",
12900
+ "findduplicates:hardis:metadata:project",
12901
+ "findduplicates:metadata:hardis:project",
12902
+ "findduplicates:metadata:project:hardis"
12790
12903
  ]
12791
12904
  },
12792
12905
  "hardis:project:generate:bypass": {
@@ -13184,119 +13297,6 @@
13184
13297
  "gitdelta:generate:project:hardis"
13185
13298
  ]
13186
13299
  },
13187
- "hardis:project:metadata:findduplicates": {
13188
- "aliases": [],
13189
- "args": {},
13190
- "description": "find duplicate values in XML file(s).\n Find duplicate values in XML file(s). Keys to be checked can be configured in `config/sfdx-hardis.yml` using property metadataDuplicateFindKeys.\n\nDefault config :\nmetadataDuplicateFindKeys :\n[object Object]\n",
13191
- "examples": [
13192
- "\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Layout xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n <layoutSections>\n ...\n <layoutColumns>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n </layoutColumns>\n </layoutSections>\n</Layout>\n",
13193
- "\n$ sf hardis:project:metadata:findduplicates --file layout.layout-meta.xml\n[sfdx-hardis] Duplicate values in layout.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : Name\n",
13194
- "\n$ sf hardis:project.metadata:findduplicates -f \"force-app/main/default/**/*.xml\"\n[sfdx-hardis] hardis:project:metadata:findduplicates execution time 0:00:00.397\n[sfdx-hardis] Duplicate values in layout1.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : CreatedById\n\n[sfdx-hardis] Duplicate values in layout2.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : LastModifiedById, Name\n"
13195
- ],
13196
- "flags": {
13197
- "json": {
13198
- "description": "Format output as json.",
13199
- "helpGroup": "GLOBAL",
13200
- "name": "json",
13201
- "allowNo": false,
13202
- "type": "boolean"
13203
- },
13204
- "flags-dir": {
13205
- "helpGroup": "GLOBAL",
13206
- "name": "flags-dir",
13207
- "summary": "Import flag values from a directory.",
13208
- "hasDynamicHelp": false,
13209
- "multiple": false,
13210
- "type": "option"
13211
- },
13212
- "files": {
13213
- "char": "f",
13214
- "description": "XML metadata files path",
13215
- "name": "files",
13216
- "hasDynamicHelp": false,
13217
- "multiple": true,
13218
- "type": "option"
13219
- },
13220
- "websocket": {
13221
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
13222
- "name": "websocket",
13223
- "hasDynamicHelp": false,
13224
- "multiple": false,
13225
- "type": "option"
13226
- },
13227
- "skipauth": {
13228
- "description": "Skip authentication check when a default username is required",
13229
- "name": "skipauth",
13230
- "allowNo": false,
13231
- "type": "boolean"
13232
- }
13233
- },
13234
- "hasDynamicHelp": false,
13235
- "hiddenAliases": [],
13236
- "id": "hardis:project:metadata:findduplicates",
13237
- "pluginAlias": "sfdx-hardis",
13238
- "pluginName": "sfdx-hardis",
13239
- "pluginType": "core",
13240
- "strict": true,
13241
- "enableJsonFlag": true,
13242
- "metadataDuplicateFindKeys": {
13243
- "layout": [
13244
- "Layout.layoutSections.layoutColumns.layoutItems.field",
13245
- "Layout.quickActionListItems.quickActionName"
13246
- ],
13247
- "profile": [
13248
- "Profile.fieldPermissions.field",
13249
- "Profile.objectPermissions.object",
13250
- "Profile.classAccesses.apexClass"
13251
- ],
13252
- "labels": [
13253
- "CustomLabels.labels.fullName"
13254
- ],
13255
- "permissionset": [
13256
- "PermissionSet.fieldPermissions.field",
13257
- "PermissionSet.objectPermissions.object",
13258
- "PermissionSet.classAccesses.apexClass"
13259
- ]
13260
- },
13261
- "title": "XML duplicate values finder",
13262
- "requiresProject": true,
13263
- "isESM": true,
13264
- "relativePath": [
13265
- "lib",
13266
- "commands",
13267
- "hardis",
13268
- "project",
13269
- "metadata",
13270
- "findduplicates.js"
13271
- ],
13272
- "aliasPermutations": [],
13273
- "permutations": [
13274
- "hardis:project:metadata:findduplicates",
13275
- "project:hardis:metadata:findduplicates",
13276
- "project:metadata:hardis:findduplicates",
13277
- "project:metadata:findduplicates:hardis",
13278
- "hardis:metadata:project:findduplicates",
13279
- "metadata:hardis:project:findduplicates",
13280
- "metadata:project:hardis:findduplicates",
13281
- "metadata:project:findduplicates:hardis",
13282
- "hardis:metadata:findduplicates:project",
13283
- "metadata:hardis:findduplicates:project",
13284
- "metadata:findduplicates:hardis:project",
13285
- "metadata:findduplicates:project:hardis",
13286
- "hardis:project:findduplicates:metadata",
13287
- "project:hardis:findduplicates:metadata",
13288
- "project:findduplicates:hardis:metadata",
13289
- "project:findduplicates:metadata:hardis",
13290
- "hardis:findduplicates:project:metadata",
13291
- "findduplicates:hardis:project:metadata",
13292
- "findduplicates:project:hardis:metadata",
13293
- "findduplicates:project:metadata:hardis",
13294
- "hardis:findduplicates:metadata:project",
13295
- "findduplicates:hardis:metadata:project",
13296
- "findduplicates:metadata:hardis:project",
13297
- "findduplicates:metadata:project:hardis"
13298
- ]
13299
- },
13300
13300
  "hardis:scratch:pool:create": {
13301
13301
  "aliases": [],
13302
13302
  "args": {},
@@ -15271,5 +15271,5 @@
15271
15271
  ]
15272
15272
  }
15273
15273
  },
15274
- "version": "6.4.1"
15274
+ "version": "6.4.3"
15275
15275
  }