sfdx-hardis 6.3.2 → 6.3.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.
@@ -57,12 +57,13 @@
57
57
  "world:hello"
58
58
  ]
59
59
  },
60
- "hardis:cache:clear": {
60
+ "hardis:auth:login": {
61
61
  "aliases": [],
62
62
  "args": {},
63
- "description": "\n## Command Behavior\n\n**Clears the local cache generated by the sfdx-hardis plugin.**\n\nThis command is designed to remove temporary files, stored configurations, and other cached data that sfdx-hardis uses to optimize its operations. Clearing the cache can be beneficial for:\n\n- **Troubleshooting:** Resolving unexpected behavior or inconsistencies.\n- **Disk Space Management:** Freeing up storage on your local machine.\n- **Ensuring Fresh Data:** Guaranteeing that the plugin operates with the most current data and configurations.\n\n## Technical explanations\n\nThe command's technical implementation is straightforward:\n\n- **Direct Function Call:** It directly invokes the `clearCache()` function, which is imported from \buri../../../common/cache/index.js\buri.\n- **Cache Management Logic:** The \buriclearCache()` function encapsulates the logic for identifying and removing the specific files and directories that constitute the sfdx-hardis cache.\n",
63
+ "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
64
64
  "examples": [
65
- "$ sf hardis:cache:clear"
65
+ "$ sf hardis:auth:login",
66
+ "CI=true sf hardis:auth:login"
66
67
  ],
67
68
  "flags": {
68
69
  "json": {
@@ -80,6 +81,28 @@
80
81
  "multiple": false,
81
82
  "type": "option"
82
83
  },
84
+ "instanceurl": {
85
+ "char": "r",
86
+ "description": "URL of org instance",
87
+ "name": "instanceurl",
88
+ "hasDynamicHelp": false,
89
+ "multiple": false,
90
+ "type": "option"
91
+ },
92
+ "devhub": {
93
+ "char": "h",
94
+ "description": "Also connect associated DevHub",
95
+ "name": "devhub",
96
+ "allowNo": false,
97
+ "type": "boolean"
98
+ },
99
+ "scratchorg": {
100
+ "char": "s",
101
+ "description": "Scratch org",
102
+ "name": "scratchorg",
103
+ "allowNo": false,
104
+ "type": "boolean"
105
+ },
83
106
  "debug": {
84
107
  "char": "d",
85
108
  "description": "Activate debug mode (more logs)",
@@ -103,42 +126,38 @@
103
126
  },
104
127
  "hasDynamicHelp": false,
105
128
  "hiddenAliases": [],
106
- "id": "hardis:cache:clear",
129
+ "id": "hardis:auth:login",
107
130
  "pluginAlias": "sfdx-hardis",
108
131
  "pluginName": "sfdx-hardis",
109
132
  "pluginType": "core",
110
133
  "strict": true,
111
134
  "enableJsonFlag": true,
112
- "title": "Clear sfdx-hardis cache",
113
- "uiConfig": {
114
- "hide": true
115
- },
135
+ "title": "Login",
116
136
  "requiresProject": false,
117
137
  "isESM": true,
118
138
  "relativePath": [
119
139
  "lib",
120
140
  "commands",
121
141
  "hardis",
122
- "cache",
123
- "clear.js"
142
+ "auth",
143
+ "login.js"
124
144
  ],
125
145
  "aliasPermutations": [],
126
146
  "permutations": [
127
- "hardis:cache:clear",
128
- "cache:hardis:clear",
129
- "cache:clear:hardis",
130
- "hardis:clear:cache",
131
- "clear:hardis:cache",
132
- "clear:cache:hardis"
147
+ "hardis:auth:login",
148
+ "auth:hardis:login",
149
+ "auth:login:hardis",
150
+ "hardis:login:auth",
151
+ "login:hardis:auth",
152
+ "login:auth:hardis"
133
153
  ]
134
154
  },
135
- "hardis:auth:login": {
155
+ "hardis:cache:clear": {
136
156
  "aliases": [],
137
157
  "args": {},
138
- "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
158
+ "description": "\n## Command Behavior\n\n**Clears the local cache generated by the sfdx-hardis plugin.**\n\nThis command is designed to remove temporary files, stored configurations, and other cached data that sfdx-hardis uses to optimize its operations. Clearing the cache can be beneficial for:\n\n- **Troubleshooting:** Resolving unexpected behavior or inconsistencies.\n- **Disk Space Management:** Freeing up storage on your local machine.\n- **Ensuring Fresh Data:** Guaranteeing that the plugin operates with the most current data and configurations.\n\n## Technical explanations\n\nThe command's technical implementation is straightforward:\n\n- **Direct Function Call:** It directly invokes the `clearCache()` function, which is imported from \buri../../../common/cache/index.js\buri.\n- **Cache Management Logic:** The \buriclearCache()` function encapsulates the logic for identifying and removing the specific files and directories that constitute the sfdx-hardis cache.\n",
139
159
  "examples": [
140
- "$ sf hardis:auth:login",
141
- "CI=true sf hardis:auth:login"
160
+ "$ sf hardis:cache:clear"
142
161
  ],
143
162
  "flags": {
144
163
  "json": {
@@ -156,28 +175,6 @@
156
175
  "multiple": false,
157
176
  "type": "option"
158
177
  },
159
- "instanceurl": {
160
- "char": "r",
161
- "description": "URL of org instance",
162
- "name": "instanceurl",
163
- "hasDynamicHelp": false,
164
- "multiple": false,
165
- "type": "option"
166
- },
167
- "devhub": {
168
- "char": "h",
169
- "description": "Also connect associated DevHub",
170
- "name": "devhub",
171
- "allowNo": false,
172
- "type": "boolean"
173
- },
174
- "scratchorg": {
175
- "char": "s",
176
- "description": "Scratch org",
177
- "name": "scratchorg",
178
- "allowNo": false,
179
- "type": "boolean"
180
- },
181
178
  "debug": {
182
179
  "char": "d",
183
180
  "description": "Activate debug mode (more logs)",
@@ -201,30 +198,33 @@
201
198
  },
202
199
  "hasDynamicHelp": false,
203
200
  "hiddenAliases": [],
204
- "id": "hardis:auth:login",
201
+ "id": "hardis:cache:clear",
205
202
  "pluginAlias": "sfdx-hardis",
206
203
  "pluginName": "sfdx-hardis",
207
204
  "pluginType": "core",
208
205
  "strict": true,
209
206
  "enableJsonFlag": true,
210
- "title": "Login",
207
+ "title": "Clear sfdx-hardis cache",
208
+ "uiConfig": {
209
+ "hide": true
210
+ },
211
211
  "requiresProject": false,
212
212
  "isESM": true,
213
213
  "relativePath": [
214
214
  "lib",
215
215
  "commands",
216
216
  "hardis",
217
- "auth",
218
- "login.js"
217
+ "cache",
218
+ "clear.js"
219
219
  ],
220
220
  "aliasPermutations": [],
221
221
  "permutations": [
222
- "hardis:auth:login",
223
- "auth:hardis:login",
224
- "auth:login:hardis",
225
- "hardis:login:auth",
226
- "login:hardis:auth",
227
- "login:auth:hardis"
222
+ "hardis:cache:clear",
223
+ "cache:hardis:clear",
224
+ "cache:clear:hardis",
225
+ "hardis:clear:cache",
226
+ "clear:hardis:cache",
227
+ "clear:cache:hardis"
228
228
  ]
229
229
  },
230
230
  "hardis:config:get": {
@@ -5800,121 +5800,6 @@
5800
5800
  "import:files:org:hardis"
5801
5801
  ]
5802
5802
  },
5803
- "hardis:org:fix:listviewmine": {
5804
- "aliases": [],
5805
- "args": {},
5806
- "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",
5807
- "examples": [
5808
- "$ sf hardis:org:fix:listviewmine",
5809
- "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
5810
- ],
5811
- "flags": {
5812
- "json": {
5813
- "description": "Format output as json.",
5814
- "helpGroup": "GLOBAL",
5815
- "name": "json",
5816
- "allowNo": false,
5817
- "type": "boolean"
5818
- },
5819
- "flags-dir": {
5820
- "helpGroup": "GLOBAL",
5821
- "name": "flags-dir",
5822
- "summary": "Import flag values from a directory.",
5823
- "hasDynamicHelp": false,
5824
- "multiple": false,
5825
- "type": "option"
5826
- },
5827
- "listviews": {
5828
- "char": "l",
5829
- "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
5830
- "name": "listviews",
5831
- "hasDynamicHelp": false,
5832
- "multiple": false,
5833
- "type": "option"
5834
- },
5835
- "debug": {
5836
- "char": "d",
5837
- "description": "Activate debug mode (more logs)",
5838
- "name": "debug",
5839
- "allowNo": false,
5840
- "type": "boolean"
5841
- },
5842
- "websocket": {
5843
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5844
- "name": "websocket",
5845
- "hasDynamicHelp": false,
5846
- "multiple": false,
5847
- "type": "option"
5848
- },
5849
- "skipauth": {
5850
- "description": "Skip authentication check when a default username is required",
5851
- "name": "skipauth",
5852
- "allowNo": false,
5853
- "type": "boolean"
5854
- },
5855
- "target-org": {
5856
- "aliases": [
5857
- "targetusername",
5858
- "u"
5859
- ],
5860
- "char": "o",
5861
- "deprecateAliases": true,
5862
- "name": "target-org",
5863
- "noCacheDefault": true,
5864
- "required": true,
5865
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5866
- "hasDynamicHelp": true,
5867
- "multiple": false,
5868
- "type": "option"
5869
- }
5870
- },
5871
- "hasDynamicHelp": true,
5872
- "hiddenAliases": [],
5873
- "id": "hardis:org:fix:listviewmine",
5874
- "pluginAlias": "sfdx-hardis",
5875
- "pluginName": "sfdx-hardis",
5876
- "pluginType": "core",
5877
- "strict": true,
5878
- "enableJsonFlag": true,
5879
- "title": "Fix listviews with ",
5880
- "requiresProject": true,
5881
- "isESM": true,
5882
- "relativePath": [
5883
- "lib",
5884
- "commands",
5885
- "hardis",
5886
- "org",
5887
- "fix",
5888
- "listviewmine.js"
5889
- ],
5890
- "aliasPermutations": [],
5891
- "permutations": [
5892
- "hardis:org:fix:listviewmine",
5893
- "org:hardis:fix:listviewmine",
5894
- "org:fix:hardis:listviewmine",
5895
- "org:fix:listviewmine:hardis",
5896
- "hardis:fix:org:listviewmine",
5897
- "fix:hardis:org:listviewmine",
5898
- "fix:org:hardis:listviewmine",
5899
- "fix:org:listviewmine:hardis",
5900
- "hardis:fix:listviewmine:org",
5901
- "fix:hardis:listviewmine:org",
5902
- "fix:listviewmine:hardis:org",
5903
- "fix:listviewmine:org:hardis",
5904
- "hardis:org:listviewmine:fix",
5905
- "org:hardis:listviewmine:fix",
5906
- "org:listviewmine:hardis:fix",
5907
- "org:listviewmine:fix:hardis",
5908
- "hardis:listviewmine:org:fix",
5909
- "listviewmine:hardis:org:fix",
5910
- "listviewmine:org:hardis:fix",
5911
- "listviewmine:org:fix:hardis",
5912
- "hardis:listviewmine:fix:org",
5913
- "listviewmine:hardis:fix:org",
5914
- "listviewmine:fix:hardis:org",
5915
- "listviewmine:fix:org:hardis"
5916
- ]
5917
- },
5918
5803
  "hardis:org:diagnose:audittrail": {
5919
5804
  "aliases": [],
5920
5805
  "args": {},
@@ -6527,7 +6412,7 @@
6527
6412
  "hardis:org:diagnose:unsecure-connected-apps": {
6528
6413
  "aliases": [],
6529
6414
  "args": {},
6530
- "description": "\n## Command Behavior\n\n**Detects unsecured Connected Apps in a Salesforce org and generates detailed reports for security analysis.**\n\nThis command is a critical security diagnostic tool that helps administrators identify Connected Apps that may pose security risks due to improper configuration. It provides comprehensive analysis of OAuth tokens and Connected App security settings to ensure proper access control.\n\nKey functionalities:\n\n- **OAuth Token Analysis:** Queries all OAuth tokens in the org using SOQL to retrieve comprehensive token information including app names, users, authorization status, and usage statistics.\n- **Security Status Assessment:** Evaluates each Connected App's security configuration by checking the `IsUsingAdminAuthorization` flag to determine if admin pre-approval is required.\n- **Unsecured App Detection:** Identifies Connected Apps that allow users to authorize themselves without admin approval, which can pose security risks.\n- **Detailed Reporting:** Generates two comprehensive CSV reports:\n - **OAuth Tokens Report:** Lists all OAuth tokens with security status, user information, and usage data\n - **Connected Apps Summary:** Aggregates unsecured Connected Apps with counts of associated OAuth tokens\n- **Visual Indicators:** Uses status icons (❌ for unsecured, ✅ for secured) to provide immediate visual feedback on security status.\n- **Security Recommendations:** Provides actionable guidance on how to secure Connected Apps through proper configuration.\n- **Notifications:** Sends alerts to configured channels (Grafana, Slack, MS Teams) with security findings and attached reports.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-org-security/) and can output Grafana, Slack and MsTeams Notifications.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Query Execution:** Executes a comprehensive SOQL query on the `OauthToken` object, joining with `AppMenuItem` and `User` objects to gather complete security context.\n- **Security Analysis Logic:** Analyzes the `AppMenuItem.IsUsingAdminAuthorization` field to determine if a Connected App requires admin pre-approval for user authorization.\n- **Data Transformation:** Processes raw SOQL results to add security status indicators and reorganize data for optimal reporting and analysis.\n- **Aggregation Processing:** Groups OAuth tokens by Connected App name to provide summary statistics and identify the most problematic applications.\n- **Report Generation:** Uses `generateCsvFile` to create structured CSV reports with proper formatting and metadata for easy analysis and sharing.\n- **Notification Integration:** Integrates with the `NotifProvider` to send security alerts with detailed metrics, including the number of unsecured Connected Apps and associated OAuth tokens.\n- **File Management:** Generates multiple output formats (CSV, XLSX) and manages file paths using `generateReportPath` for consistent report organization.\n- **Connection Management:** Uses `setConnectionVariables` to ensure proper authentication context for notification providers that require org connection details.\n</details>\n",
6415
+ "description": "\n## Command Behavior\n\n**Detects unsecured Connected Apps in a Salesforce org and generates detailed reports for security analysis.**\n\nThis command is a critical security diagnostic tool that helps administrators identify Connected Apps that may pose security risks due to improper configuration. It provides comprehensive analysis of OAuth tokens and Connected App security settings to ensure proper access control.\n\nKey functionalities:\n\n- **OAuth Token Analysis:** Queries all OAuth tokens in the org using SOQL to retrieve comprehensive token information including app names, users, authorization status, and usage statistics.\n- **Security Status Assessment:** Evaluates each Connected App's security configuration by checking the `IsUsingAdminAuthorization` flag to determine if admin pre-approval is required.\n- **Unsecured App Detection:** Identifies Connected Apps that allow users to authorize themselves without admin approval, which can pose security risks.\n- **Detailed Reporting:** Generates two comprehensive CSV reports:\n - **OAuth Tokens Report:** Lists all OAuth tokens with security status, user information, and usage data\n - **Connected Apps Summary:** Aggregates unsecured Connected Apps with counts of associated OAuth tokens\n- **Visual Indicators:** Uses status icons (❌ for unsecured, ✅ for secured) to provide immediate visual feedback on security status.\n- **Security Recommendations:** Provides actionable guidance on how to secure Connected Apps through proper configuration.\n- **Notifications:** Sends alerts to configured channels (Grafana, Slack, MS Teams) with security findings and attached reports.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-org-security/) and can output Grafana, Slack and MsTeams Notifications.\n\n<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/jHv8yrSK8Dg\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Query Execution:** Executes a comprehensive SOQL query on the `OauthToken` object, joining with `AppMenuItem` and `User` objects to gather complete security context.\n- **Security Analysis Logic:** Analyzes the `AppMenuItem.IsUsingAdminAuthorization` field to determine if a Connected App requires admin pre-approval for user authorization.\n- **Data Transformation:** Processes raw SOQL results to add security status indicators and reorganize data for optimal reporting and analysis.\n- **Aggregation Processing:** Groups OAuth tokens by Connected App name to provide summary statistics and identify the most problematic applications.\n- **Report Generation:** Uses `generateCsvFile` to create structured CSV reports with proper formatting and metadata for easy analysis and sharing.\n- **Notification Integration:** Integrates with the `NotifProvider` to send security alerts with detailed metrics, including the number of unsecured Connected Apps and associated OAuth tokens.\n- **File Management:** Generates multiple output formats (CSV, XLSX) and manages file paths using `generateReportPath` for consistent report organization.\n- **Connection Management:** Uses `setConnectionVariables` to ensure proper authentication context for notification providers that require org connection details.\n</details>\n",
6531
6416
  "examples": [
6532
6417
  "$ sf hardis:org:diagnose:unsecure-connected-apps"
6533
6418
  ],
@@ -7178,14 +7063,13 @@
7178
7063
  "unusedusers:diagnose:org:hardis"
7179
7064
  ]
7180
7065
  },
7181
- "hardis:org:generate:packagexmlfull": {
7066
+ "hardis:org:fix:listviewmine": {
7182
7067
  "aliases": [],
7183
7068
  "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",
7069
+ "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",
7185
7070
  "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"
7071
+ "$ sf hardis:org:fix:listviewmine",
7072
+ "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
7189
7073
  ],
7190
7074
  "flags": {
7191
7075
  "json": {
@@ -7203,9 +7087,10 @@
7203
7087
  "multiple": false,
7204
7088
  "type": "option"
7205
7089
  },
7206
- "outputfile": {
7207
- "description": "Output package.xml file",
7208
- "name": "outputfile",
7090
+ "listviews": {
7091
+ "char": "l",
7092
+ "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
7093
+ "name": "listviews",
7209
7094
  "hasDynamicHelp": false,
7210
7095
  "multiple": false,
7211
7096
  "type": "option"
@@ -7217,13 +7102,6 @@
7217
7102
  "allowNo": false,
7218
7103
  "type": "boolean"
7219
7104
  },
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
7105
  "websocket": {
7228
7106
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7229
7107
  "name": "websocket",
@@ -7255,29 +7133,151 @@
7255
7133
  },
7256
7134
  "hasDynamicHelp": true,
7257
7135
  "hiddenAliases": [],
7258
- "id": "hardis:org:generate:packagexmlfull",
7136
+ "id": "hardis:org:fix:listviewmine",
7259
7137
  "pluginAlias": "sfdx-hardis",
7260
7138
  "pluginName": "sfdx-hardis",
7261
7139
  "pluginType": "core",
7262
7140
  "strict": true,
7263
7141
  "enableJsonFlag": true,
7264
- "title": "Generate Full Org package.xml",
7265
- "requiresProject": false,
7142
+ "title": "Fix listviews with ",
7143
+ "requiresProject": true,
7266
7144
  "isESM": true,
7267
7145
  "relativePath": [
7268
7146
  "lib",
7269
7147
  "commands",
7270
7148
  "hardis",
7271
7149
  "org",
7272
- "generate",
7273
- "packagexmlfull.js"
7150
+ "fix",
7151
+ "listviewmine.js"
7274
7152
  ],
7275
7153
  "aliasPermutations": [],
7276
7154
  "permutations": [
7277
- "hardis:org:generate:packagexmlfull",
7278
- "org:hardis:generate:packagexmlfull",
7279
- "org:generate:hardis:packagexmlfull",
7280
- "org:generate:packagexmlfull:hardis",
7155
+ "hardis:org:fix:listviewmine",
7156
+ "org:hardis:fix:listviewmine",
7157
+ "org:fix:hardis:listviewmine",
7158
+ "org:fix:listviewmine:hardis",
7159
+ "hardis:fix:org:listviewmine",
7160
+ "fix:hardis:org:listviewmine",
7161
+ "fix:org:hardis:listviewmine",
7162
+ "fix:org:listviewmine:hardis",
7163
+ "hardis:fix:listviewmine:org",
7164
+ "fix:hardis:listviewmine:org",
7165
+ "fix:listviewmine:hardis:org",
7166
+ "fix:listviewmine:org:hardis",
7167
+ "hardis:org:listviewmine:fix",
7168
+ "org:hardis:listviewmine:fix",
7169
+ "org:listviewmine:hardis:fix",
7170
+ "org:listviewmine:fix:hardis",
7171
+ "hardis:listviewmine:org:fix",
7172
+ "listviewmine:hardis:org:fix",
7173
+ "listviewmine:org:hardis:fix",
7174
+ "listviewmine:org:fix:hardis",
7175
+ "hardis:listviewmine:fix:org",
7176
+ "listviewmine:hardis:fix:org",
7177
+ "listviewmine:fix:hardis:org",
7178
+ "listviewmine:fix:org:hardis"
7179
+ ]
7180
+ },
7181
+ "hardis:org:generate:packagexmlfull": {
7182
+ "aliases": [],
7183
+ "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",
7185
+ "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"
7189
+ ],
7190
+ "flags": {
7191
+ "json": {
7192
+ "description": "Format output as json.",
7193
+ "helpGroup": "GLOBAL",
7194
+ "name": "json",
7195
+ "allowNo": false,
7196
+ "type": "boolean"
7197
+ },
7198
+ "flags-dir": {
7199
+ "helpGroup": "GLOBAL",
7200
+ "name": "flags-dir",
7201
+ "summary": "Import flag values from a directory.",
7202
+ "hasDynamicHelp": false,
7203
+ "multiple": false,
7204
+ "type": "option"
7205
+ },
7206
+ "outputfile": {
7207
+ "description": "Output package.xml file",
7208
+ "name": "outputfile",
7209
+ "hasDynamicHelp": false,
7210
+ "multiple": false,
7211
+ "type": "option"
7212
+ },
7213
+ "debug": {
7214
+ "char": "d",
7215
+ "description": "Activate debug mode (more logs)",
7216
+ "name": "debug",
7217
+ "allowNo": false,
7218
+ "type": "boolean"
7219
+ },
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
+ "websocket": {
7228
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7229
+ "name": "websocket",
7230
+ "hasDynamicHelp": false,
7231
+ "multiple": false,
7232
+ "type": "option"
7233
+ },
7234
+ "skipauth": {
7235
+ "description": "Skip authentication check when a default username is required",
7236
+ "name": "skipauth",
7237
+ "allowNo": false,
7238
+ "type": "boolean"
7239
+ },
7240
+ "target-org": {
7241
+ "aliases": [
7242
+ "targetusername",
7243
+ "u"
7244
+ ],
7245
+ "char": "o",
7246
+ "deprecateAliases": true,
7247
+ "name": "target-org",
7248
+ "noCacheDefault": true,
7249
+ "required": true,
7250
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7251
+ "hasDynamicHelp": true,
7252
+ "multiple": false,
7253
+ "type": "option"
7254
+ }
7255
+ },
7256
+ "hasDynamicHelp": true,
7257
+ "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
7281
  "hardis:generate:org:packagexmlfull",
7282
7282
  "generate:hardis:org:packagexmlfull",
7283
7283
  "generate:org:hardis:packagexmlfull",
@@ -7303,7 +7303,7 @@
7303
7303
  "hardis:org:monitor:all": {
7304
7304
  "aliases": [],
7305
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| [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| [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) | 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",
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
7307
  "examples": [
7308
7308
  "$ sf hardis:org:monitor:all"
7309
7309
  ],
@@ -7387,6 +7387,12 @@
7387
7387
  "command": "sf hardis:org:monitor:limits",
7388
7388
  "frequency": "daily"
7389
7389
  },
7390
+ {
7391
+ "key": "UNSECURED_CONNECTED_APPS",
7392
+ "title": "Detect unsecured Connected Apps in an org",
7393
+ "command": "sf hardis:org:diagnose:unsecure-connected-apps",
7394
+ "frequency": "daily"
7395
+ },
7390
7396
  {
7391
7397
  "key": "LICENSES",
7392
7398
  "title": "Extract licenses information",
@@ -7447,12 +7453,6 @@
7447
7453
  "command": "sf hardis:org:diagnose:unused-connected-apps",
7448
7454
  "frequency": "weekly"
7449
7455
  },
7450
- {
7451
- "key": "UNSECURED_CONNECTED_APPS",
7452
- "title": "Detect unsecured Connected Apps in an org",
7453
- "command": "sf hardis:org:diagnose:unsecure-connected-apps",
7454
- "frequency": "weekly"
7455
- },
7456
7456
  {
7457
7457
  "key": "METADATA_STATUS",
7458
7458
  "title": "Detect inactive metadata",
@@ -8049,113 +8049,6 @@
8049
8049
  "flow:purge:org:hardis"
8050
8050
  ]
8051
8051
  },
8052
- "hardis:org:retrieve:packageconfig": {
8053
- "aliases": [],
8054
- "args": {},
8055
- "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",
8056
- "examples": [
8057
- "$ sf hardis:org:retrieve:packageconfig",
8058
- "sf hardis:org:retrieve:packageconfig -u myOrg"
8059
- ],
8060
- "flags": {
8061
- "json": {
8062
- "description": "Format output as json.",
8063
- "helpGroup": "GLOBAL",
8064
- "name": "json",
8065
- "allowNo": false,
8066
- "type": "boolean"
8067
- },
8068
- "flags-dir": {
8069
- "helpGroup": "GLOBAL",
8070
- "name": "flags-dir",
8071
- "summary": "Import flag values from a directory.",
8072
- "hasDynamicHelp": false,
8073
- "multiple": false,
8074
- "type": "option"
8075
- },
8076
- "debug": {
8077
- "char": "d",
8078
- "description": "Activate debug mode (more logs)",
8079
- "name": "debug",
8080
- "allowNo": false,
8081
- "type": "boolean"
8082
- },
8083
- "websocket": {
8084
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
8085
- "name": "websocket",
8086
- "hasDynamicHelp": false,
8087
- "multiple": false,
8088
- "type": "option"
8089
- },
8090
- "skipauth": {
8091
- "description": "Skip authentication check when a default username is required",
8092
- "name": "skipauth",
8093
- "allowNo": false,
8094
- "type": "boolean"
8095
- },
8096
- "target-org": {
8097
- "aliases": [
8098
- "targetusername",
8099
- "u"
8100
- ],
8101
- "char": "o",
8102
- "deprecateAliases": true,
8103
- "name": "target-org",
8104
- "noCacheDefault": true,
8105
- "required": true,
8106
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8107
- "hasDynamicHelp": true,
8108
- "multiple": false,
8109
- "type": "option"
8110
- }
8111
- },
8112
- "hasDynamicHelp": true,
8113
- "hiddenAliases": [],
8114
- "id": "hardis:org:retrieve:packageconfig",
8115
- "pluginAlias": "sfdx-hardis",
8116
- "pluginName": "sfdx-hardis",
8117
- "pluginType": "core",
8118
- "strict": true,
8119
- "enableJsonFlag": true,
8120
- "title": "Retrieve package configuration from an org",
8121
- "requiresProject": false,
8122
- "isESM": true,
8123
- "relativePath": [
8124
- "lib",
8125
- "commands",
8126
- "hardis",
8127
- "org",
8128
- "retrieve",
8129
- "packageconfig.js"
8130
- ],
8131
- "aliasPermutations": [],
8132
- "permutations": [
8133
- "hardis:org:retrieve:packageconfig",
8134
- "org:hardis:retrieve:packageconfig",
8135
- "org:retrieve:hardis:packageconfig",
8136
- "org:retrieve:packageconfig:hardis",
8137
- "hardis:retrieve:org:packageconfig",
8138
- "retrieve:hardis:org:packageconfig",
8139
- "retrieve:org:hardis:packageconfig",
8140
- "retrieve:org:packageconfig:hardis",
8141
- "hardis:retrieve:packageconfig:org",
8142
- "retrieve:hardis:packageconfig:org",
8143
- "retrieve:packageconfig:hardis:org",
8144
- "retrieve:packageconfig:org:hardis",
8145
- "hardis:org:packageconfig:retrieve",
8146
- "org:hardis:packageconfig:retrieve",
8147
- "org:packageconfig:hardis:retrieve",
8148
- "org:packageconfig:retrieve:hardis",
8149
- "hardis:packageconfig:org:retrieve",
8150
- "packageconfig:hardis:org:retrieve",
8151
- "packageconfig:org:hardis:retrieve",
8152
- "packageconfig:org:retrieve:hardis",
8153
- "hardis:packageconfig:retrieve:org",
8154
- "packageconfig:hardis:retrieve:org",
8155
- "packageconfig:retrieve:hardis:org",
8156
- "packageconfig:retrieve:org:hardis"
8157
- ]
8158
- },
8159
8052
  "hardis:org:refresh:after-refresh": {
8160
8053
  "aliases": [],
8161
8054
  "args": {},
@@ -8395,12 +8288,13 @@
8395
8288
  "before-refresh:refresh:org:hardis"
8396
8289
  ]
8397
8290
  },
8398
- "hardis:org:test:apex": {
8291
+ "hardis:org:retrieve:packageconfig": {
8399
8292
  "aliases": [],
8400
8293
  "args": {},
8401
- "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 60 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",
8294
+ "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",
8402
8295
  "examples": [
8403
- "$ sf hardis:org:test:apex"
8296
+ "$ sf hardis:org:retrieve:packageconfig",
8297
+ "sf hardis:org:retrieve:packageconfig -u myOrg"
8404
8298
  ],
8405
8299
  "flags": {
8406
8300
  "json": {
@@ -8418,10 +8312,116 @@
8418
8312
  "multiple": false,
8419
8313
  "type": "option"
8420
8314
  },
8421
- "testlevel": {
8422
- "char": "l",
8423
- "description": "Level of tests to apply to validate deployment",
8424
- "name": "testlevel",
8315
+ "debug": {
8316
+ "char": "d",
8317
+ "description": "Activate debug mode (more logs)",
8318
+ "name": "debug",
8319
+ "allowNo": false,
8320
+ "type": "boolean"
8321
+ },
8322
+ "websocket": {
8323
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
8324
+ "name": "websocket",
8325
+ "hasDynamicHelp": false,
8326
+ "multiple": false,
8327
+ "type": "option"
8328
+ },
8329
+ "skipauth": {
8330
+ "description": "Skip authentication check when a default username is required",
8331
+ "name": "skipauth",
8332
+ "allowNo": false,
8333
+ "type": "boolean"
8334
+ },
8335
+ "target-org": {
8336
+ "aliases": [
8337
+ "targetusername",
8338
+ "u"
8339
+ ],
8340
+ "char": "o",
8341
+ "deprecateAliases": true,
8342
+ "name": "target-org",
8343
+ "noCacheDefault": true,
8344
+ "required": true,
8345
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8346
+ "hasDynamicHelp": true,
8347
+ "multiple": false,
8348
+ "type": "option"
8349
+ }
8350
+ },
8351
+ "hasDynamicHelp": true,
8352
+ "hiddenAliases": [],
8353
+ "id": "hardis:org:retrieve:packageconfig",
8354
+ "pluginAlias": "sfdx-hardis",
8355
+ "pluginName": "sfdx-hardis",
8356
+ "pluginType": "core",
8357
+ "strict": true,
8358
+ "enableJsonFlag": true,
8359
+ "title": "Retrieve package configuration from an org",
8360
+ "requiresProject": false,
8361
+ "isESM": true,
8362
+ "relativePath": [
8363
+ "lib",
8364
+ "commands",
8365
+ "hardis",
8366
+ "org",
8367
+ "retrieve",
8368
+ "packageconfig.js"
8369
+ ],
8370
+ "aliasPermutations": [],
8371
+ "permutations": [
8372
+ "hardis:org:retrieve:packageconfig",
8373
+ "org:hardis:retrieve:packageconfig",
8374
+ "org:retrieve:hardis:packageconfig",
8375
+ "org:retrieve:packageconfig:hardis",
8376
+ "hardis:retrieve:org:packageconfig",
8377
+ "retrieve:hardis:org:packageconfig",
8378
+ "retrieve:org:hardis:packageconfig",
8379
+ "retrieve:org:packageconfig:hardis",
8380
+ "hardis:retrieve:packageconfig:org",
8381
+ "retrieve:hardis:packageconfig:org",
8382
+ "retrieve:packageconfig:hardis:org",
8383
+ "retrieve:packageconfig:org:hardis",
8384
+ "hardis:org:packageconfig:retrieve",
8385
+ "org:hardis:packageconfig:retrieve",
8386
+ "org:packageconfig:hardis:retrieve",
8387
+ "org:packageconfig:retrieve:hardis",
8388
+ "hardis:packageconfig:org:retrieve",
8389
+ "packageconfig:hardis:org:retrieve",
8390
+ "packageconfig:org:hardis:retrieve",
8391
+ "packageconfig:org:retrieve:hardis",
8392
+ "hardis:packageconfig:retrieve:org",
8393
+ "packageconfig:hardis:retrieve:org",
8394
+ "packageconfig:retrieve:hardis:org",
8395
+ "packageconfig:retrieve:org:hardis"
8396
+ ]
8397
+ },
8398
+ "hardis:org:test:apex": {
8399
+ "aliases": [],
8400
+ "args": {},
8401
+ "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 60 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",
8402
+ "examples": [
8403
+ "$ sf hardis:org:test:apex"
8404
+ ],
8405
+ "flags": {
8406
+ "json": {
8407
+ "description": "Format output as json.",
8408
+ "helpGroup": "GLOBAL",
8409
+ "name": "json",
8410
+ "allowNo": false,
8411
+ "type": "boolean"
8412
+ },
8413
+ "flags-dir": {
8414
+ "helpGroup": "GLOBAL",
8415
+ "name": "flags-dir",
8416
+ "summary": "Import flag values from a directory.",
8417
+ "hasDynamicHelp": false,
8418
+ "multiple": false,
8419
+ "type": "option"
8420
+ },
8421
+ "testlevel": {
8422
+ "char": "l",
8423
+ "description": "Level of tests to apply to validate deployment",
8424
+ "name": "testlevel",
8425
8425
  "default": "RunLocalTests",
8426
8426
  "hasDynamicHelp": false,
8427
8427
  "multiple": false,
@@ -9682,6 +9682,135 @@
9682
9682
  "remotesites:audit:project:hardis"
9683
9683
  ]
9684
9684
  },
9685
+ "hardis:project:configure:auth": {
9686
+ "aliases": [],
9687
+ "args": {},
9688
+ "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",
9689
+ "examples": [
9690
+ "$ sf hardis:project:configure:auth"
9691
+ ],
9692
+ "flags": {
9693
+ "json": {
9694
+ "description": "Format output as json.",
9695
+ "helpGroup": "GLOBAL",
9696
+ "name": "json",
9697
+ "allowNo": false,
9698
+ "type": "boolean"
9699
+ },
9700
+ "flags-dir": {
9701
+ "helpGroup": "GLOBAL",
9702
+ "name": "flags-dir",
9703
+ "summary": "Import flag values from a directory.",
9704
+ "hasDynamicHelp": false,
9705
+ "multiple": false,
9706
+ "type": "option"
9707
+ },
9708
+ "devhub": {
9709
+ "char": "b",
9710
+ "description": "Configure project DevHub",
9711
+ "name": "devhub",
9712
+ "allowNo": false,
9713
+ "type": "boolean"
9714
+ },
9715
+ "debug": {
9716
+ "char": "d",
9717
+ "description": "Activate debug mode (more logs)",
9718
+ "name": "debug",
9719
+ "allowNo": false,
9720
+ "type": "boolean"
9721
+ },
9722
+ "websocket": {
9723
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9724
+ "name": "websocket",
9725
+ "hasDynamicHelp": false,
9726
+ "multiple": false,
9727
+ "type": "option"
9728
+ },
9729
+ "skipauth": {
9730
+ "description": "Skip authentication check when a default username is required",
9731
+ "name": "skipauth",
9732
+ "allowNo": false,
9733
+ "type": "boolean"
9734
+ },
9735
+ "target-org": {
9736
+ "aliases": [
9737
+ "targetusername",
9738
+ "u"
9739
+ ],
9740
+ "char": "o",
9741
+ "deprecateAliases": true,
9742
+ "name": "target-org",
9743
+ "noCacheDefault": true,
9744
+ "summary": "Username or alias of the target org.",
9745
+ "hasDynamicHelp": true,
9746
+ "multiple": false,
9747
+ "type": "option"
9748
+ },
9749
+ "target-dev-hub": {
9750
+ "aliases": [
9751
+ "targetdevhubusername"
9752
+ ],
9753
+ "char": "v",
9754
+ "deprecateAliases": true,
9755
+ "name": "target-dev-hub",
9756
+ "noCacheDefault": true,
9757
+ "required": false,
9758
+ "summary": "Username or alias of the Dev Hub org.",
9759
+ "hasDynamicHelp": true,
9760
+ "multiple": false,
9761
+ "type": "option"
9762
+ }
9763
+ },
9764
+ "hasDynamicHelp": true,
9765
+ "hiddenAliases": [],
9766
+ "id": "hardis:project:configure:auth",
9767
+ "pluginAlias": "sfdx-hardis",
9768
+ "pluginName": "sfdx-hardis",
9769
+ "pluginType": "core",
9770
+ "strict": true,
9771
+ "enableJsonFlag": true,
9772
+ "title": "Configure authentication",
9773
+ "requiresProject": false,
9774
+ "requiresDependencies": [
9775
+ "openssl"
9776
+ ],
9777
+ "isESM": true,
9778
+ "relativePath": [
9779
+ "lib",
9780
+ "commands",
9781
+ "hardis",
9782
+ "project",
9783
+ "configure",
9784
+ "auth.js"
9785
+ ],
9786
+ "aliasPermutations": [],
9787
+ "permutations": [
9788
+ "hardis:project:configure:auth",
9789
+ "project:hardis:configure:auth",
9790
+ "project:configure:hardis:auth",
9791
+ "project:configure:auth:hardis",
9792
+ "hardis:configure:project:auth",
9793
+ "configure:hardis:project:auth",
9794
+ "configure:project:hardis:auth",
9795
+ "configure:project:auth:hardis",
9796
+ "hardis:configure:auth:project",
9797
+ "configure:hardis:auth:project",
9798
+ "configure:auth:hardis:project",
9799
+ "configure:auth:project:hardis",
9800
+ "hardis:project:auth:configure",
9801
+ "project:hardis:auth:configure",
9802
+ "project:auth:hardis:configure",
9803
+ "project:auth:configure:hardis",
9804
+ "hardis:auth:project:configure",
9805
+ "auth:hardis:project:configure",
9806
+ "auth:project:hardis:configure",
9807
+ "auth:project:configure:hardis",
9808
+ "hardis:auth:configure:project",
9809
+ "auth:hardis:configure:project",
9810
+ "auth:configure:hardis:project",
9811
+ "auth:configure:project:hardis"
9812
+ ]
9813
+ },
9685
9814
  "hardis:project:clean:emptyitems": {
9686
9815
  "aliases": [],
9687
9816
  "args": {},
@@ -11167,12 +11296,12 @@
11167
11296
  "xml:clean:project:hardis"
11168
11297
  ]
11169
11298
  },
11170
- "hardis:project:configure:auth": {
11299
+ "hardis:project:convert:profilestopermsets": {
11171
11300
  "aliases": [],
11172
11301
  "args": {},
11173
- "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",
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",
11174
11303
  "examples": [
11175
- "$ sf hardis:project:configure:auth"
11304
+ "$ sf hardis:project:convert:profilestopermsets"
11176
11305
  ],
11177
11306
  "flags": {
11178
11307
  "json": {
@@ -11190,13 +11319,118 @@
11190
11319
  "multiple": false,
11191
11320
  "type": "option"
11192
11321
  },
11193
- "devhub": {
11194
- "char": "b",
11195
- "description": "Configure project DevHub",
11196
- "name": "devhub",
11322
+ "except": {
11323
+ "char": "e",
11324
+ "description": "List of filters",
11325
+ "name": "except",
11326
+ "default": [],
11327
+ "hasDynamicHelp": false,
11328
+ "multiple": true,
11329
+ "type": "option"
11330
+ },
11331
+ "debug": {
11332
+ "char": "d",
11333
+ "description": "Activate debug mode (more logs)",
11334
+ "name": "debug",
11197
11335
  "allowNo": false,
11198
11336
  "type": "boolean"
11199
11337
  },
11338
+ "websocket": {
11339
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11340
+ "name": "websocket",
11341
+ "hasDynamicHelp": false,
11342
+ "multiple": false,
11343
+ "type": "option"
11344
+ },
11345
+ "skipauth": {
11346
+ "description": "Skip authentication check when a default username is required",
11347
+ "name": "skipauth",
11348
+ "allowNo": false,
11349
+ "type": "boolean"
11350
+ }
11351
+ },
11352
+ "hasDynamicHelp": false,
11353
+ "hiddenAliases": [],
11354
+ "id": "hardis:project:convert:profilestopermsets",
11355
+ "pluginAlias": "sfdx-hardis",
11356
+ "pluginName": "sfdx-hardis",
11357
+ "pluginType": "core",
11358
+ "strict": true,
11359
+ "enableJsonFlag": true,
11360
+ "title": "Convert Profiles into Permission Sets",
11361
+ "requiresProject": true,
11362
+ "requiresSfdxPlugins": [
11363
+ "shane-sfdx-plugins"
11364
+ ],
11365
+ "isESM": true,
11366
+ "relativePath": [
11367
+ "lib",
11368
+ "commands",
11369
+ "hardis",
11370
+ "project",
11371
+ "convert",
11372
+ "profilestopermsets.js"
11373
+ ],
11374
+ "aliasPermutations": [],
11375
+ "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"
11400
+ ]
11401
+ },
11402
+ "hardis:project:fix:profiletabs": {
11403
+ "aliases": [],
11404
+ "args": {},
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",
11406
+ "examples": [
11407
+ "$ sf hardis:project:fix:profiletabs"
11408
+ ],
11409
+ "flags": {
11410
+ "json": {
11411
+ "description": "Format output as json.",
11412
+ "helpGroup": "GLOBAL",
11413
+ "name": "json",
11414
+ "allowNo": false,
11415
+ "type": "boolean"
11416
+ },
11417
+ "flags-dir": {
11418
+ "helpGroup": "GLOBAL",
11419
+ "name": "flags-dir",
11420
+ "summary": "Import flag values from a directory.",
11421
+ "hasDynamicHelp": false,
11422
+ "multiple": false,
11423
+ "type": "option"
11424
+ },
11425
+ "path": {
11426
+ "char": "p",
11427
+ "description": "Root folder",
11428
+ "name": "path",
11429
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
11430
+ "hasDynamicHelp": false,
11431
+ "multiple": false,
11432
+ "type": "option"
11433
+ },
11200
11434
  "debug": {
11201
11435
  "char": "d",
11202
11436
  "description": "Activate debug mode (more logs)",
@@ -11226,21 +11460,8 @@
11226
11460
  "deprecateAliases": true,
11227
11461
  "name": "target-org",
11228
11462
  "noCacheDefault": true,
11229
- "summary": "Username or alias of the target org.",
11230
- "hasDynamicHelp": true,
11231
- "multiple": false,
11232
- "type": "option"
11233
- },
11234
- "target-dev-hub": {
11235
- "aliases": [
11236
- "targetdevhubusername"
11237
- ],
11238
- "char": "v",
11239
- "deprecateAliases": true,
11240
- "name": "target-dev-hub",
11241
- "noCacheDefault": true,
11242
- "required": false,
11243
- "summary": "Username or alias of the Dev Hub org.",
11463
+ "required": true,
11464
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
11244
11465
  "hasDynamicHelp": true,
11245
11466
  "multiple": false,
11246
11467
  "type": "option"
@@ -11248,60 +11469,57 @@
11248
11469
  },
11249
11470
  "hasDynamicHelp": true,
11250
11471
  "hiddenAliases": [],
11251
- "id": "hardis:project:configure:auth",
11472
+ "id": "hardis:project:fix:profiletabs",
11252
11473
  "pluginAlias": "sfdx-hardis",
11253
11474
  "pluginName": "sfdx-hardis",
11254
11475
  "pluginType": "core",
11255
11476
  "strict": true,
11256
11477
  "enableJsonFlag": true,
11257
- "title": "Configure authentication",
11258
- "requiresProject": false,
11259
- "requiresDependencies": [
11260
- "openssl"
11261
- ],
11478
+ "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
11479
+ "requiresProject": true,
11262
11480
  "isESM": true,
11263
11481
  "relativePath": [
11264
11482
  "lib",
11265
11483
  "commands",
11266
11484
  "hardis",
11267
11485
  "project",
11268
- "configure",
11269
- "auth.js"
11486
+ "fix",
11487
+ "profiletabs.js"
11270
11488
  ],
11271
11489
  "aliasPermutations": [],
11272
11490
  "permutations": [
11273
- "hardis:project:configure:auth",
11274
- "project:hardis:configure:auth",
11275
- "project:configure:hardis:auth",
11276
- "project:configure:auth:hardis",
11277
- "hardis:configure:project:auth",
11278
- "configure:hardis:project:auth",
11279
- "configure:project:hardis:auth",
11280
- "configure:project:auth:hardis",
11281
- "hardis:configure:auth:project",
11282
- "configure:hardis:auth:project",
11283
- "configure:auth:hardis:project",
11284
- "configure:auth:project:hardis",
11285
- "hardis:project:auth:configure",
11286
- "project:hardis:auth:configure",
11287
- "project:auth:hardis:configure",
11288
- "project:auth:configure:hardis",
11289
- "hardis:auth:project:configure",
11290
- "auth:hardis:project:configure",
11291
- "auth:project:hardis:configure",
11292
- "auth:project:configure:hardis",
11293
- "hardis:auth:configure:project",
11294
- "auth:hardis:configure:project",
11295
- "auth:configure:hardis:project",
11296
- "auth:configure: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"
11297
11515
  ]
11298
11516
  },
11299
- "hardis:project:convert:profilestopermsets": {
11517
+ "hardis:project:fix:v53flexipages": {
11300
11518
  "aliases": [],
11301
11519
  "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",
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",
11303
11521
  "examples": [
11304
- "$ sf hardis:project:convert:profilestopermsets"
11522
+ "$ sf hardis:project:fix:v53flexipages"
11305
11523
  ],
11306
11524
  "flags": {
11307
11525
  "json": {
@@ -11319,13 +11537,13 @@
11319
11537
  "multiple": false,
11320
11538
  "type": "option"
11321
11539
  },
11322
- "except": {
11323
- "char": "e",
11324
- "description": "List of filters",
11325
- "name": "except",
11326
- "default": [],
11540
+ "path": {
11541
+ "char": "p",
11542
+ "description": "Root folder",
11543
+ "name": "path",
11544
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
11327
11545
  "hasDynamicHelp": false,
11328
- "multiple": true,
11546
+ "multiple": false,
11329
11547
  "type": "option"
11330
11548
  },
11331
11549
  "debug": {
@@ -11351,52 +11569,49 @@
11351
11569
  },
11352
11570
  "hasDynamicHelp": false,
11353
11571
  "hiddenAliases": [],
11354
- "id": "hardis:project:convert:profilestopermsets",
11572
+ "id": "hardis:project:fix:v53flexipages",
11355
11573
  "pluginAlias": "sfdx-hardis",
11356
- "pluginName": "sfdx-hardis",
11357
- "pluginType": "core",
11358
- "strict": true,
11359
- "enableJsonFlag": true,
11360
- "title": "Convert Profiles into Permission Sets",
11361
- "requiresProject": true,
11362
- "requiresSfdxPlugins": [
11363
- "shane-sfdx-plugins"
11364
- ],
11365
- "isESM": true,
11366
- "relativePath": [
11367
- "lib",
11368
- "commands",
11369
- "hardis",
11370
- "project",
11371
- "convert",
11372
- "profilestopermsets.js"
11373
- ],
11374
- "aliasPermutations": [],
11375
- "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"
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,221 +12789,6 @@
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": {
12693
- "aliases": [],
12694
- "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",
12696
- "examples": [
12697
- "$ sf hardis:project:fix:v53flexipages"
12698
- ],
12699
- "flags": {
12700
- "json": {
12701
- "description": "Format output as json.",
12702
- "helpGroup": "GLOBAL",
12703
- "name": "json",
12704
- "allowNo": false,
12705
- "type": "boolean"
12706
- },
12707
- "flags-dir": {
12708
- "helpGroup": "GLOBAL",
12709
- "name": "flags-dir",
12710
- "summary": "Import flag values from a directory.",
12711
- "hasDynamicHelp": false,
12712
- "multiple": false,
12713
- "type": "option"
12714
- },
12715
- "path": {
12716
- "char": "p",
12717
- "description": "Root folder",
12718
- "name": "path",
12719
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12720
- "hasDynamicHelp": false,
12721
- "multiple": false,
12722
- "type": "option"
12723
- },
12724
- "debug": {
12725
- "char": "d",
12726
- "description": "Activate debug mode (more logs)",
12727
- "name": "debug",
12728
- "allowNo": false,
12729
- "type": "boolean"
12730
- },
12731
- "websocket": {
12732
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12733
- "name": "websocket",
12734
- "hasDynamicHelp": false,
12735
- "multiple": false,
12736
- "type": "option"
12737
- },
12738
- "skipauth": {
12739
- "description": "Skip authentication check when a default username is required",
12740
- "name": "skipauth",
12741
- "allowNo": false,
12742
- "type": "boolean"
12743
- }
12744
- },
12745
- "hasDynamicHelp": false,
12746
- "hiddenAliases": [],
12747
- "id": "hardis:project:fix:v53flexipages",
12748
- "pluginAlias": "sfdx-hardis",
12749
- "pluginName": "sfdx-hardis",
12750
- "pluginType": "core",
12751
- "strict": true,
12752
- "enableJsonFlag": true,
12753
- "title": "Fix flexipages for v53",
12754
- "requiresProject": true,
12755
- "isESM": true,
12756
- "relativePath": [
12757
- "lib",
12758
- "commands",
12759
- "hardis",
12760
- "project",
12761
- "fix",
12762
- "v53flexipages.js"
12763
- ],
12764
- "aliasPermutations": [],
12765
- "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"
12790
- ]
12791
- },
12792
12792
  "hardis:project:generate:bypass": {
12793
12793
  "aliases": [],
12794
12794
  "args": {},
@@ -15271,5 +15271,5 @@
15271
15271
  ]
15272
15272
  }
15273
15273
  },
15274
- "version": "6.3.2"
15274
+ "version": "6.3.3"
15275
15275
  }