sfdx-hardis 6.12.7-beta202511232340.0 → 6.12.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,12 +132,13 @@
132
132
  "clear:cache:hardis"
133
133
  ]
134
134
  },
135
- "hardis:config:get": {
135
+ "hardis:auth:login": {
136
136
  "aliases": [],
137
137
  "args": {},
138
- "description": "\n## Command Behavior\n\n**Retrieves and displays the sfdx-hardis configuration for a specified level.**\n\nThis command allows you to inspect the configuration that is currently in effect for your project, which is useful for debugging and understanding how sfdx-hardis will behave.\n\n- **Configuration levels:** It can retrieve configuration from three different levels:\n - **Project:** The configuration defined in the project's `.sfdx-hardis.yml` file.\n - **Branch:** The configuration defined in a branch-specific configuration file (e.g., `.sfdx-hardis.production.yml`).\n - **User:** The global user-level configuration.\n\n## Technical explanations\n\nThe command's logic is straightforward:\n\n- **`getConfig` function:** It calls the `getConfig` utility function, passing the desired configuration level as an argument.\n- **Configuration loading:** The `getConfig` function is responsible for finding the appropriate configuration file, reading its contents, and parsing it as YAML or JSON.\n- **Output:** The retrieved configuration is then displayed to the user as a JSON string.\n",
138
+ "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
139
139
  "examples": [
140
- "$ sf hardis:project:deploy:sources:metadata"
140
+ "$ sf hardis:auth:login",
141
+ "CI=true CI_COMMIT_REF_NAME=monitoring_myclient sf hardis:auth:login"
141
142
  ],
142
143
  "flags": {
143
144
  "json": {
@@ -155,20 +156,28 @@
155
156
  "multiple": false,
156
157
  "type": "option"
157
158
  },
158
- "level": {
159
- "char": "l",
160
- "description": "project,branch or user",
161
- "name": "level",
162
- "default": "project",
159
+ "instanceurl": {
160
+ "char": "r",
161
+ "description": "URL of org instance",
162
+ "name": "instanceurl",
163
163
  "hasDynamicHelp": false,
164
164
  "multiple": false,
165
- "options": [
166
- "project",
167
- "branch",
168
- "user"
169
- ],
170
165
  "type": "option"
171
166
  },
167
+ "devhub": {
168
+ "char": "h",
169
+ "description": "Also connect associated DevHub",
170
+ "name": "devhub",
171
+ "allowNo": false,
172
+ "type": "boolean"
173
+ },
174
+ "scratchorg": {
175
+ "char": "s",
176
+ "description": "Scratch org",
177
+ "name": "scratchorg",
178
+ "allowNo": false,
179
+ "type": "boolean"
180
+ },
172
181
  "debug": {
173
182
  "char": "d",
174
183
  "description": "Activate debug mode (more logs)",
@@ -192,39 +201,38 @@
192
201
  },
193
202
  "hasDynamicHelp": false,
194
203
  "hiddenAliases": [],
195
- "id": "hardis:config:get",
204
+ "id": "hardis:auth:login",
196
205
  "pluginAlias": "sfdx-hardis",
197
206
  "pluginName": "sfdx-hardis",
198
207
  "pluginType": "core",
199
208
  "strict": true,
200
209
  "enableJsonFlag": true,
201
- "title": "Deploy metadata sources to org",
210
+ "title": "Login",
202
211
  "requiresProject": false,
203
212
  "isESM": true,
204
213
  "relativePath": [
205
214
  "lib",
206
215
  "commands",
207
216
  "hardis",
208
- "config",
209
- "get.js"
217
+ "auth",
218
+ "login.js"
210
219
  ],
211
220
  "aliasPermutations": [],
212
221
  "permutations": [
213
- "hardis:config:get",
214
- "config:hardis:get",
215
- "config:get:hardis",
216
- "hardis:get:config",
217
- "get:hardis:config",
218
- "get:config:hardis"
222
+ "hardis:auth:login",
223
+ "auth:hardis:login",
224
+ "auth:login:hardis",
225
+ "hardis:login:auth",
226
+ "login:hardis:auth",
227
+ "login:auth:hardis"
219
228
  ]
220
229
  },
221
- "hardis:auth:login": {
230
+ "hardis:config:get": {
222
231
  "aliases": [],
223
232
  "args": {},
224
- "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
233
+ "description": "\n## Command Behavior\n\n**Retrieves and displays the sfdx-hardis configuration for a specified level.**\n\nThis command allows you to inspect the configuration that is currently in effect for your project, which is useful for debugging and understanding how sfdx-hardis will behave.\n\n- **Configuration levels:** It can retrieve configuration from three different levels:\n - **Project:** The configuration defined in the project's `.sfdx-hardis.yml` file.\n - **Branch:** The configuration defined in a branch-specific configuration file (e.g., `.sfdx-hardis.production.yml`).\n - **User:** The global user-level configuration.\n\n## Technical explanations\n\nThe command's logic is straightforward:\n\n- **`getConfig` function:** It calls the `getConfig` utility function, passing the desired configuration level as an argument.\n- **Configuration loading:** The `getConfig` function is responsible for finding the appropriate configuration file, reading its contents, and parsing it as YAML or JSON.\n- **Output:** The retrieved configuration is then displayed to the user as a JSON string.\n",
225
234
  "examples": [
226
- "$ sf hardis:auth:login",
227
- "CI=true CI_COMMIT_REF_NAME=monitoring_myclient sf hardis:auth:login"
235
+ "$ sf hardis:project:deploy:sources:metadata"
228
236
  ],
229
237
  "flags": {
230
238
  "json": {
@@ -242,28 +250,20 @@
242
250
  "multiple": false,
243
251
  "type": "option"
244
252
  },
245
- "instanceurl": {
246
- "char": "r",
247
- "description": "URL of org instance",
248
- "name": "instanceurl",
253
+ "level": {
254
+ "char": "l",
255
+ "description": "project,branch or user",
256
+ "name": "level",
257
+ "default": "project",
249
258
  "hasDynamicHelp": false,
250
259
  "multiple": false,
260
+ "options": [
261
+ "project",
262
+ "branch",
263
+ "user"
264
+ ],
251
265
  "type": "option"
252
266
  },
253
- "devhub": {
254
- "char": "h",
255
- "description": "Also connect associated DevHub",
256
- "name": "devhub",
257
- "allowNo": false,
258
- "type": "boolean"
259
- },
260
- "scratchorg": {
261
- "char": "s",
262
- "description": "Scratch org",
263
- "name": "scratchorg",
264
- "allowNo": false,
265
- "type": "boolean"
266
- },
267
267
  "debug": {
268
268
  "char": "d",
269
269
  "description": "Activate debug mode (more logs)",
@@ -287,30 +287,30 @@
287
287
  },
288
288
  "hasDynamicHelp": false,
289
289
  "hiddenAliases": [],
290
- "id": "hardis:auth:login",
290
+ "id": "hardis:config:get",
291
291
  "pluginAlias": "sfdx-hardis",
292
292
  "pluginName": "sfdx-hardis",
293
293
  "pluginType": "core",
294
294
  "strict": true,
295
295
  "enableJsonFlag": true,
296
- "title": "Login",
296
+ "title": "Deploy metadata sources to org",
297
297
  "requiresProject": false,
298
298
  "isESM": true,
299
299
  "relativePath": [
300
300
  "lib",
301
301
  "commands",
302
302
  "hardis",
303
- "auth",
304
- "login.js"
303
+ "config",
304
+ "get.js"
305
305
  ],
306
306
  "aliasPermutations": [],
307
307
  "permutations": [
308
- "hardis:auth:login",
309
- "auth:hardis:login",
310
- "auth:login:hardis",
311
- "hardis:login:auth",
312
- "login:hardis:auth",
313
- "login:auth:hardis"
308
+ "hardis:config:get",
309
+ "config:hardis:get",
310
+ "config:get:hardis",
311
+ "hardis:get:config",
312
+ "get:hardis:config",
313
+ "get:config:hardis"
314
314
  ]
315
315
  },
316
316
  "hardis:doc:fieldusage": {
@@ -4741,6 +4741,117 @@
4741
4741
  "extract:pull-requests:git:hardis"
4742
4742
  ]
4743
4743
  },
4744
+ "hardis:org:community:update": {
4745
+ "aliases": [],
4746
+ "args": {},
4747
+ "description": "\n## Command Behavior\n\n**Updates the status of one or more Salesforce Experience Cloud (Community) networks.**\n\nThis command provides a way to programmatically change the status of your Salesforce Communities, allowing you to manage their availability. This is particularly useful for:\n\n- **Maintenance:** Taking communities offline for planned maintenance (`DownForMaintenance`).\n- **Activation/Deactivation:** Bringing communities online or offline (`Live`, `DownForMaintenance`).\n- **Automation:** Integrating community status changes into CI/CD pipelines or scheduled jobs.\n\nKey functionalities:\n\n- **Network Selection:** You can specify one or more community network names (separated by commas) using the `--name` flag.\n- **Status Update:** You can set the new status for the selected communities using the `--status` flag. Supported values are `Live` and `DownForMaintenance`.\n- **Confirmation Prompt:** In non-CI environments, it provides a confirmation prompt before executing the update, ensuring intentional changes.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Query:** It first queries the Salesforce `Network` object using SOQL to retrieve the `Id`, `Name`, and `Status` of the specified communities. This ensures that only existing communities are targeted.\n- **SObject Update:** It then constructs an array of `Network` sObjects with their `Id` and the new `Status` and performs a DML update operation using `conn.sobject(\"Network\").update()`. The `allOrNone: false` option is used to allow partial success in case some updates fail.\n- **Error Handling and Reporting:** It iterates through the update results, logging success or failure for each community. It also provides a summary of successful and erroneous updates.\n- **User Interaction:** Uses `prompts` to confirm the update action with the user when not running in a CI environment.\n- **Salesforce Connection:** Establishes a connection to the target Salesforce org using the `target-org` flag.\n</details>\n",
4748
+ "examples": [
4749
+ "$ sf hardis:org:community:update --name 'MyNetworkName' --status DownForMaintenance",
4750
+ "$ sf hardis:org:community:update --name 'MyNetworkName,MySecondNetworkName' --status Live"
4751
+ ],
4752
+ "flags": {
4753
+ "json": {
4754
+ "description": "Format output as json.",
4755
+ "helpGroup": "GLOBAL",
4756
+ "name": "json",
4757
+ "allowNo": false,
4758
+ "type": "boolean"
4759
+ },
4760
+ "flags-dir": {
4761
+ "helpGroup": "GLOBAL",
4762
+ "name": "flags-dir",
4763
+ "summary": "Import flag values from a directory.",
4764
+ "hasDynamicHelp": false,
4765
+ "multiple": false,
4766
+ "type": "option"
4767
+ },
4768
+ "name": {
4769
+ "char": "n",
4770
+ "description": "List of Networks Names that you want to update, separated by comma",
4771
+ "name": "name",
4772
+ "required": true,
4773
+ "hasDynamicHelp": false,
4774
+ "multiple": false,
4775
+ "type": "option"
4776
+ },
4777
+ "status": {
4778
+ "char": "s",
4779
+ "description": "New status for the community, available values are: Live, DownForMaintenance",
4780
+ "name": "status",
4781
+ "required": true,
4782
+ "hasDynamicHelp": false,
4783
+ "multiple": false,
4784
+ "type": "option"
4785
+ },
4786
+ "debug": {
4787
+ "char": "d",
4788
+ "description": "Activate debug mode (more logs)",
4789
+ "name": "debug",
4790
+ "allowNo": false,
4791
+ "type": "boolean"
4792
+ },
4793
+ "target-org": {
4794
+ "aliases": [
4795
+ "targetusername",
4796
+ "u"
4797
+ ],
4798
+ "char": "o",
4799
+ "deprecateAliases": true,
4800
+ "name": "target-org",
4801
+ "noCacheDefault": true,
4802
+ "required": true,
4803
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
4804
+ "hasDynamicHelp": true,
4805
+ "multiple": false,
4806
+ "type": "option"
4807
+ }
4808
+ },
4809
+ "hasDynamicHelp": true,
4810
+ "hiddenAliases": [],
4811
+ "id": "hardis:org:community:update",
4812
+ "pluginAlias": "sfdx-hardis",
4813
+ "pluginName": "sfdx-hardis",
4814
+ "pluginType": "core",
4815
+ "strict": true,
4816
+ "summary": "Update a community status.",
4817
+ "enableJsonFlag": true,
4818
+ "isESM": true,
4819
+ "relativePath": [
4820
+ "lib",
4821
+ "commands",
4822
+ "hardis",
4823
+ "org",
4824
+ "community",
4825
+ "update.js"
4826
+ ],
4827
+ "aliasPermutations": [],
4828
+ "permutations": [
4829
+ "hardis:org:community:update",
4830
+ "org:hardis:community:update",
4831
+ "org:community:hardis:update",
4832
+ "org:community:update:hardis",
4833
+ "hardis:community:org:update",
4834
+ "community:hardis:org:update",
4835
+ "community:org:hardis:update",
4836
+ "community:org:update:hardis",
4837
+ "hardis:community:update:org",
4838
+ "community:hardis:update:org",
4839
+ "community:update:hardis:org",
4840
+ "community:update:org:hardis",
4841
+ "hardis:org:update:community",
4842
+ "org:hardis:update:community",
4843
+ "org:update:hardis:community",
4844
+ "org:update:community:hardis",
4845
+ "hardis:update:org:community",
4846
+ "update:hardis:org:community",
4847
+ "update:org:hardis:community",
4848
+ "update:org:community:hardis",
4849
+ "hardis:update:community:org",
4850
+ "update:hardis:community:org",
4851
+ "update:community:hardis:org",
4852
+ "update:community:org:hardis"
4853
+ ]
4854
+ },
4744
4855
  "hardis:org:configure:data": {
4745
4856
  "aliases": [],
4746
4857
  "args": {},
@@ -5042,13 +5153,12 @@
5042
5153
  "monitoring:configure:org:hardis"
5043
5154
  ]
5044
5155
  },
5045
- "hardis:org:community:update": {
5156
+ "hardis:org:data:delete": {
5046
5157
  "aliases": [],
5047
5158
  "args": {},
5048
- "description": "\n## Command Behavior\n\n**Updates the status of one or more Salesforce Experience Cloud (Community) networks.**\n\nThis command provides a way to programmatically change the status of your Salesforce Communities, allowing you to manage their availability. This is particularly useful for:\n\n- **Maintenance:** Taking communities offline for planned maintenance (`DownForMaintenance`).\n- **Activation/Deactivation:** Bringing communities online or offline (`Live`, `DownForMaintenance`).\n- **Automation:** Integrating community status changes into CI/CD pipelines or scheduled jobs.\n\nKey functionalities:\n\n- **Network Selection:** You can specify one or more community network names (separated by commas) using the `--name` flag.\n- **Status Update:** You can set the new status for the selected communities using the `--status` flag. Supported values are `Live` and `DownForMaintenance`.\n- **Confirmation Prompt:** In non-CI environments, it provides a confirmation prompt before executing the update, ensuring intentional changes.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Query:** It first queries the Salesforce `Network` object using SOQL to retrieve the `Id`, `Name`, and `Status` of the specified communities. This ensures that only existing communities are targeted.\n- **SObject Update:** It then constructs an array of `Network` sObjects with their `Id` and the new `Status` and performs a DML update operation using `conn.sobject(\"Network\").update()`. The `allOrNone: false` option is used to allow partial success in case some updates fail.\n- **Error Handling and Reporting:** It iterates through the update results, logging success or failure for each community. It also provides a summary of successful and erroneous updates.\n- **User Interaction:** Uses `prompts` to confirm the update action with the user when not running in a CI environment.\n- **Salesforce Connection:** Establishes a connection to the target Salesforce org using the `target-org` flag.\n</details>\n",
5159
+ "description": "\n## Command Behavior\n\n**Deletes records in multiple Salesforce objects using an SFDMU (Salesforce Data Migration Utility) workspace.**\n\nThis command provides a powerful and controlled way to remove data from your Salesforce orgs based on configurations defined in an SFDMU workspace. It's particularly useful for:\n\n- **Data Cleanup:** Removing test data, obsolete records, or sensitive information.\n- **Environment Reset:** Preparing sandboxes for new development cycles by clearing specific data sets.\n- **Compliance:** Deleting data to meet regulatory requirements.\n\n**Important Considerations for Production Environments:**\n\nIf you intend to run this command in a production environment, you must:\n\n- Set `runnableInProduction` to `true` in your `export.json` file within the SFDMU workspace.\n- Define `sfdmuCanModify: YOUR_INSTANCE_URL` in your branch-specific configuration file (e.g., `config/branches/.sfdx-hardis.YOUR_BRANCH.yml`) to explicitly authorize data modification for that instance.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation relies heavily on the SFDMU plugin:\n\n- **SFDMU Integration:** It leverages the `sfdmu` plugin to perform the actual data deletion operations. The command acts as a wrapper, providing an assisted interface for SFDMU execution.\n- **Workspace Selection:** If the SFDMU workspace path is not provided via the `--path` flag, it interactively prompts the user to select a data workspace using `selectDataWorkspace`.\n- **Org Selection:** It ensures that a target Salesforce org is selected (either via the `--target-org` flag or through an interactive prompt using `promptOrgUsernameDefault`) to specify where the data deletion will occur.\n- **`deleteData` Utility:** The core logic for executing the SFDMU deletion process is encapsulated within the `deleteData` utility function, which takes the SFDMU workspace path and the target username as arguments.\n- **Environment Awareness:** It checks the `isCI` flag to determine whether to run in an interactive mode (prompting for user input) or a non-interactive mode (relying solely on command-line flags).\n- **Required Plugin:** It explicitly lists `sfdmu` as a required plugin, ensuring that the necessary dependency is in place before execution.\n</details>\n",
5049
5160
  "examples": [
5050
- "$ sf hardis:org:community:update --name 'MyNetworkName' --status DownForMaintenance",
5051
- "$ sf hardis:org:community:update --name 'MyNetworkName,MySecondNetworkName' --status Live"
5161
+ "$ sf hardis:org:data:delete"
5052
5162
  ],
5053
5163
  "flags": {
5054
5164
  "json": {
@@ -5066,120 +5176,10 @@
5066
5176
  "multiple": false,
5067
5177
  "type": "option"
5068
5178
  },
5069
- "name": {
5070
- "char": "n",
5071
- "description": "List of Networks Names that you want to update, separated by comma",
5072
- "name": "name",
5073
- "required": true,
5074
- "hasDynamicHelp": false,
5075
- "multiple": false,
5076
- "type": "option"
5077
- },
5078
- "status": {
5079
- "char": "s",
5080
- "description": "New status for the community, available values are: Live, DownForMaintenance",
5081
- "name": "status",
5082
- "required": true,
5083
- "hasDynamicHelp": false,
5084
- "multiple": false,
5085
- "type": "option"
5086
- },
5087
- "debug": {
5088
- "char": "d",
5089
- "description": "Activate debug mode (more logs)",
5090
- "name": "debug",
5091
- "allowNo": false,
5092
- "type": "boolean"
5093
- },
5094
- "target-org": {
5095
- "aliases": [
5096
- "targetusername",
5097
- "u"
5098
- ],
5099
- "char": "o",
5100
- "deprecateAliases": true,
5101
- "name": "target-org",
5102
- "noCacheDefault": true,
5103
- "required": true,
5104
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5105
- "hasDynamicHelp": true,
5106
- "multiple": false,
5107
- "type": "option"
5108
- }
5109
- },
5110
- "hasDynamicHelp": true,
5111
- "hiddenAliases": [],
5112
- "id": "hardis:org:community:update",
5113
- "pluginAlias": "sfdx-hardis",
5114
- "pluginName": "sfdx-hardis",
5115
- "pluginType": "core",
5116
- "strict": true,
5117
- "summary": "Update a community status.",
5118
- "enableJsonFlag": true,
5119
- "isESM": true,
5120
- "relativePath": [
5121
- "lib",
5122
- "commands",
5123
- "hardis",
5124
- "org",
5125
- "community",
5126
- "update.js"
5127
- ],
5128
- "aliasPermutations": [],
5129
- "permutations": [
5130
- "hardis:org:community:update",
5131
- "org:hardis:community:update",
5132
- "org:community:hardis:update",
5133
- "org:community:update:hardis",
5134
- "hardis:community:org:update",
5135
- "community:hardis:org:update",
5136
- "community:org:hardis:update",
5137
- "community:org:update:hardis",
5138
- "hardis:community:update:org",
5139
- "community:hardis:update:org",
5140
- "community:update:hardis:org",
5141
- "community:update:org:hardis",
5142
- "hardis:org:update:community",
5143
- "org:hardis:update:community",
5144
- "org:update:hardis:community",
5145
- "org:update:community:hardis",
5146
- "hardis:update:org:community",
5147
- "update:hardis:org:community",
5148
- "update:org:hardis:community",
5149
- "update:org:community:hardis",
5150
- "hardis:update:community:org",
5151
- "update:hardis:community:org",
5152
- "update:community:hardis:org",
5153
- "update:community:org:hardis"
5154
- ]
5155
- },
5156
- "hardis:org:data:delete": {
5157
- "aliases": [],
5158
- "args": {},
5159
- "description": "\n## Command Behavior\n\n**Deletes records in multiple Salesforce objects using an SFDMU (Salesforce Data Migration Utility) workspace.**\n\nThis command provides a powerful and controlled way to remove data from your Salesforce orgs based on configurations defined in an SFDMU workspace. It's particularly useful for:\n\n- **Data Cleanup:** Removing test data, obsolete records, or sensitive information.\n- **Environment Reset:** Preparing sandboxes for new development cycles by clearing specific data sets.\n- **Compliance:** Deleting data to meet regulatory requirements.\n\n**Important Considerations for Production Environments:**\n\nIf you intend to run this command in a production environment, you must:\n\n- Set `runnableInProduction` to `true` in your `export.json` file within the SFDMU workspace.\n- Define `sfdmuCanModify: YOUR_INSTANCE_URL` in your branch-specific configuration file (e.g., `config/branches/.sfdx-hardis.YOUR_BRANCH.yml`) to explicitly authorize data modification for that instance.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation relies heavily on the SFDMU plugin:\n\n- **SFDMU Integration:** It leverages the `sfdmu` plugin to perform the actual data deletion operations. The command acts as a wrapper, providing an assisted interface for SFDMU execution.\n- **Workspace Selection:** If the SFDMU workspace path is not provided via the `--path` flag, it interactively prompts the user to select a data workspace using `selectDataWorkspace`.\n- **Org Selection:** It ensures that a target Salesforce org is selected (either via the `--target-org` flag or through an interactive prompt using `promptOrgUsernameDefault`) to specify where the data deletion will occur.\n- **`deleteData` Utility:** The core logic for executing the SFDMU deletion process is encapsulated within the `deleteData` utility function, which takes the SFDMU workspace path and the target username as arguments.\n- **Environment Awareness:** It checks the `isCI` flag to determine whether to run in an interactive mode (prompting for user input) or a non-interactive mode (relying solely on command-line flags).\n- **Required Plugin:** It explicitly lists `sfdmu` as a required plugin, ensuring that the necessary dependency is in place before execution.\n</details>\n",
5160
- "examples": [
5161
- "$ sf hardis:org:data:delete"
5162
- ],
5163
- "flags": {
5164
- "json": {
5165
- "description": "Format output as json.",
5166
- "helpGroup": "GLOBAL",
5167
- "name": "json",
5168
- "allowNo": false,
5169
- "type": "boolean"
5170
- },
5171
- "flags-dir": {
5172
- "helpGroup": "GLOBAL",
5173
- "name": "flags-dir",
5174
- "summary": "Import flag values from a directory.",
5175
- "hasDynamicHelp": false,
5176
- "multiple": false,
5177
- "type": "option"
5178
- },
5179
- "path": {
5180
- "char": "p",
5181
- "description": "Path to the sfdmu workspace folder",
5182
- "name": "path",
5179
+ "path": {
5180
+ "char": "p",
5181
+ "description": "Path to the sfdmu workspace folder",
5182
+ "name": "path",
5183
5183
  "hasDynamicHelp": false,
5184
5184
  "multiple": false,
5185
5185
  "type": "option"
@@ -5539,12 +5539,15 @@
5539
5539
  "import:data:org:hardis"
5540
5540
  ]
5541
5541
  },
5542
- "hardis:org:files:export": {
5542
+ "hardis:org:diagnose:audittrail": {
5543
5543
  "aliases": [],
5544
5544
  "args": {},
5545
- "description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, output naming conventions, and file size filtering.\n- **File Size Filtering:** Supports minimum file size filtering via the `fileSizeMin` configuration parameter (in KB). Files smaller than the specified size will be skipped during export.\n- **File Validation:** After downloading each file, validates the integrity by:\n - **Checksum Validation:** For ContentVersion files, compares MD5 checksum with Salesforce's stored checksum\n - **Size Validation:** For both ContentVersion and Attachment files, verifies actual file size matches expected size\n - **Status Tracking:** Files are categorized with specific statuses: `success` (valid files), `failed` (download errors), `skipped` (filtered files), `invalid` (downloaded but failed validation)\n - All validation results are logged in the CSV export log for audit purposes\n- **Resume/Restart Capability:** \n - **Resume Mode:** When `--resume` flag is used (default in CI environments), checks existing downloaded files for validity. Valid files are skipped, invalid files are re-downloaded.\n - **Restart Mode:** When resume is disabled, clears the output folder and starts a fresh export.\n - **Interactive Mode:** When existing files are found and `--resume` is not explicitly specified (non-CI environments), prompts the user to choose between resume or restart.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesExporter Class:** The core logic is encapsulated within the `FilesExporter` class, which orchestrates the entire export process.\n- **SOQL Queries (Bulk API):** It uses Salesforce Bulk API queries to efficiently retrieve large volumes of parent record IDs and file metadata, including checksums and file sizes.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File Validation:** After each successful download, validates file integrity by comparing checksums (ContentVersion) and file sizes (both ContentVersion and Attachment) against Salesforce metadata.\n- **Resume Logic:** In resume mode, checks for existing files before downloading, validates their integrity, and only re-downloads invalid or missing files. This enables efficient recovery from interrupted exports.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project, `promptFilesExportConfiguration` for customizing export options, and prompts for resume/restart choice when existing files are found.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues, API limits, and file validation failures. Each file is assigned a specific status (`success`, `failed`, `skipped`, `invalid`) for comprehensive tracking and troubleshooting.\n</details>\n",
5545
+ "description": "Export Audit trail into a CSV file with selected criteria, and highlight suspect actions\n\nAlso detects updates of Custom Settings values (disable by defining `SKIP_AUDIT_TRAIL_CUSTOM_SETTINGS=true`)\n\nRegular setup actions performed in major orgs are filtered.\n\n- \"\"\n - createScratchOrg\n - changedsenderemail\n - deleteScratchOrg\n - loginasgrantedtopartnerbt\n- Certificate and Key Management\n - insertCertificate\n- Custom App Licenses\n - addeduserpackagelicense\n - granteduserpackagelicense\n - revokeduserpackagelicense\n- Customer Portal\n - createdcustomersuccessuser\n - CSPUserDisabled\n- Currency\n - updateddatedexchrate\n- Data Management\n - queueMembership\n- Email Administration\n - dkimRotationPreparationSuccessful\n - dkimRotationSuccessful\n- External Objects\n - xdsEncryptedFieldChange\n- Groups\n - groupMembership\n- Holidays\n - holiday_insert\n- Inbox mobile and legacy desktop apps\n - enableSIQUserNonEAC\n - siqUserAcceptedTOS\n- Manage Users\n - activateduser\n - createduser\n - changedcommunitynickname\n - changedemail\n - changedfederationid\n - changedpassword\n - changedinteractionuseroffon\n - changedinteractionuseronoff\n - changedmarketinguseroffon\n - changedmarketinguseronoff\n - changedofflineuseroffon\n - changedprofileforuserstdtostd\n - changedprofileforuser\n - changedprofileforusercusttostd\n - changedprofileforuserstdtocust\n - changedroleforusertonone\n - changedroleforuser\n - changedroleforuserfromnone\n - changedUserAdminVerifiedStatusVerified\n - changedUserEmailVerifiedStatusUnverified\n - changedUserEmailVerifiedStatusVerified\n - changedknowledgeuseroffon\n - changedsfcontentuseroffon\n - changedsupportuseroffon\n - changedusername\n - changedUserPhoneNumber\n - changedUserPhoneVerifiedStatusUnverified\n - changedUserPhoneVerifiedStatusVerified\n - deactivateduser\n - deleteAuthenticatorPairing\n - deleteTwoFactorInfo2\n - deleteTwoFactorTempCode\n - frozeuser\n - insertAuthenticatorPairing\n - insertTwoFactorInfo2\n - insertTwoFactorTempCode\n - lightningloginenroll\n - PermSetAssign\n - PermSetGroupAssign\n - PermSetGroupUnassign\n - PermSetLicenseAssign\n - PermSetUnassign\n - PermSetLicenseUnassign\n - registeredUserPhoneNumber\n - resetpassword\n - suNetworkAdminLogin\n - suNetworkAdminLogout\n - suOrgAdminLogin\n - suOrgAdminLogout\n - unfrozeuser\n - useremailchangesent\n- Mobile Administration\n - assigneduserstomobileconfig\n- Reporting Snapshots\n - createdReportJob\n - deletedReportJob\n- Sandboxes\n - DeleteSandbox\n\nBy default, deployment user defined in .sfdx-hardis.yml targetUsername property will be excluded.\n\nYou can define additional users to exclude in .sfdx-hardis.yml **monitoringExcludeUsernames** property.\n\nYou can also add more sections / actions considered as not suspect using property **monitoringAllowedSectionsActions**\n\nExample:\n\n```yaml\nmonitoringExcludeUsernames:\n - deploymentuser@cloudity.com\n - marketingcloud@cloudity.com\n - integration-user@cloudity.com\n\nmonitoringAllowedSectionsActions:\n \"Some section\": [] // Will ignore all actions from such section\n \"Some other section\": [\"actionType1\",\"actionType2\",\"actionType3\"] // Will ignore only those 3 actions from section \"Some other section\". Other actions in the same section will be considered as suspect.\n```\n\n## Excel output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-excel.jpg)\n\n## Local output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-local.jpg)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-suspect-audit-trail/) and can output Grafana, Slack and MsTeams Notifications.\n",
5546
5546
  "examples": [
5547
- "$ sf hardis:org:files:export"
5547
+ "$ sf hardis:org:diagnose:audittrail",
5548
+ "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
5549
+ "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
5550
+ "$ sf hardis:org:diagnose:audittrail --lastndays 5"
5548
5551
  ],
5549
5552
  "flags": {
5550
5553
  "json": {
@@ -5562,48 +5565,30 @@
5562
5565
  "multiple": false,
5563
5566
  "type": "option"
5564
5567
  },
5565
- "path": {
5566
- "char": "p",
5567
- "description": "Path to the file export project",
5568
- "name": "path",
5569
- "hasDynamicHelp": false,
5570
- "multiple": false,
5571
- "type": "option"
5572
- },
5573
- "chunksize": {
5574
- "char": "c",
5575
- "description": "Number of records to add in a chunk before it is processed",
5576
- "name": "chunksize",
5577
- "default": 1000,
5568
+ "excludeusers": {
5569
+ "char": "e",
5570
+ "description": "Comma-separated list of usernames to exclude",
5571
+ "name": "excludeusers",
5578
5572
  "hasDynamicHelp": false,
5579
5573
  "multiple": false,
5580
5574
  "type": "option"
5581
5575
  },
5582
- "polltimeout": {
5576
+ "lastndays": {
5583
5577
  "char": "t",
5584
- "description": "Timeout in MS for Bulk API calls",
5585
- "name": "polltimeout",
5586
- "default": 300000,
5578
+ "description": "Number of days to extract from today (included)",
5579
+ "name": "lastndays",
5587
5580
  "hasDynamicHelp": false,
5588
5581
  "multiple": false,
5589
5582
  "type": "option"
5590
5583
  },
5591
- "startchunknumber": {
5592
- "char": "s",
5593
- "description": "Chunk number to start from",
5594
- "name": "startchunknumber",
5595
- "default": 0,
5584
+ "outputfile": {
5585
+ "char": "f",
5586
+ "description": "Force the path and name of output report file. Must end with .csv",
5587
+ "name": "outputfile",
5596
5588
  "hasDynamicHelp": false,
5597
5589
  "multiple": false,
5598
5590
  "type": "option"
5599
5591
  },
5600
- "resume": {
5601
- "char": "r",
5602
- "description": "Resume previous export by checking existing files (default in CI)",
5603
- "name": "resume",
5604
- "allowNo": false,
5605
- "type": "boolean"
5606
- },
5607
5592
  "debug": {
5608
5593
  "char": "d",
5609
5594
  "description": "Activate debug mode (more logs)",
@@ -5642,13 +5627,13 @@
5642
5627
  },
5643
5628
  "hasDynamicHelp": true,
5644
5629
  "hiddenAliases": [],
5645
- "id": "hardis:org:files:export",
5630
+ "id": "hardis:org:diagnose:audittrail",
5646
5631
  "pluginAlias": "sfdx-hardis",
5647
5632
  "pluginName": "sfdx-hardis",
5648
5633
  "pluginType": "core",
5649
5634
  "strict": true,
5650
5635
  "enableJsonFlag": true,
5651
- "title": "Export files",
5636
+ "title": "Diagnose content of Setup Audit Trail",
5652
5637
  "requiresProject": false,
5653
5638
  "isESM": true,
5654
5639
  "relativePath": [
@@ -5656,43 +5641,43 @@
5656
5641
  "commands",
5657
5642
  "hardis",
5658
5643
  "org",
5659
- "files",
5660
- "export.js"
5644
+ "diagnose",
5645
+ "audittrail.js"
5661
5646
  ],
5662
5647
  "aliasPermutations": [],
5663
5648
  "permutations": [
5664
- "hardis:org:files:export",
5665
- "org:hardis:files:export",
5666
- "org:files:hardis:export",
5667
- "org:files:export:hardis",
5668
- "hardis:files:org:export",
5669
- "files:hardis:org:export",
5670
- "files:org:hardis:export",
5671
- "files:org:export:hardis",
5672
- "hardis:files:export:org",
5673
- "files:hardis:export:org",
5674
- "files:export:hardis:org",
5675
- "files:export:org:hardis",
5676
- "hardis:org:export:files",
5677
- "org:hardis:export:files",
5678
- "org:export:hardis:files",
5679
- "org:export:files:hardis",
5680
- "hardis:export:org:files",
5681
- "export:hardis:org:files",
5682
- "export:org:hardis:files",
5683
- "export:org:files:hardis",
5684
- "hardis:export:files:org",
5685
- "export:hardis:files:org",
5686
- "export:files:hardis:org",
5687
- "export:files:org:hardis"
5649
+ "hardis:org:diagnose:audittrail",
5650
+ "org:hardis:diagnose:audittrail",
5651
+ "org:diagnose:hardis:audittrail",
5652
+ "org:diagnose:audittrail:hardis",
5653
+ "hardis:diagnose:org:audittrail",
5654
+ "diagnose:hardis:org:audittrail",
5655
+ "diagnose:org:hardis:audittrail",
5656
+ "diagnose:org:audittrail:hardis",
5657
+ "hardis:diagnose:audittrail:org",
5658
+ "diagnose:hardis:audittrail:org",
5659
+ "diagnose:audittrail:hardis:org",
5660
+ "diagnose:audittrail:org:hardis",
5661
+ "hardis:org:audittrail:diagnose",
5662
+ "org:hardis:audittrail:diagnose",
5663
+ "org:audittrail:hardis:diagnose",
5664
+ "org:audittrail:diagnose:hardis",
5665
+ "hardis:audittrail:org:diagnose",
5666
+ "audittrail:hardis:org:diagnose",
5667
+ "audittrail:org:hardis:diagnose",
5668
+ "audittrail:org:diagnose:hardis",
5669
+ "hardis:audittrail:diagnose:org",
5670
+ "audittrail:hardis:diagnose:org",
5671
+ "audittrail:diagnose:hardis:org",
5672
+ "audittrail:diagnose:org:hardis"
5688
5673
  ]
5689
5674
  },
5690
- "hardis:org:files:import": {
5675
+ "hardis:org:diagnose:instanceupgrade": {
5691
5676
  "aliases": [],
5692
5677
  "args": {},
5693
- "description": "\nThis command facilitates the mass upload of files into Salesforce, allowing you to populate records with associated documents, images, or other file types. It's a crucial tool for data migration, content seeding, or synchronizing external file repositories with Salesforce.\n\nKey functionalities:\n\n- **Configuration-Driven Import:** Relies on an `export.json` file within a designated file export project (created using `sf hardis:org:configure:files`) to determine which files to import and how they should be associated with Salesforce records.\n- **Interactive Project Selection:** If the file import project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Overwrite Option:** The `--overwrite` flag allows you to replace existing files in Salesforce with local versions that have the same name. Be aware that this option doubles the number of API calls used.\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for how to export files, which is often a prerequisite for importing:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesImporter Class:** The core logic is encapsulated within the `FilesImporter` class, which orchestrates the entire import process.\n- **File System Scan:** Scans the local file system within the configured project directory to identify files for import.\n- **Salesforce API Interaction:** Uses Salesforce APIs (e.g., ContentVersion, Attachment) to upload files and associate them with records.\n- **Configuration Loading:** Reads the `export.json` file to get the import configuration, including SOQL queries to identify parent records for file association.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file import project and `prompts` for confirming the overwrite behavior.\n- **Error Handling:** Includes mechanisms to handle potential errors during the import process, such as API limits or file upload failures.\n</details>\n",
5678
+ "description": "\n## Command Behavior\n\n**Retrieves and displays the scheduled upgrade date for a Salesforce org's instance.**\n\nThis command provides crucial information about when your Salesforce instance will be upgraded to the next major release (Spring, Summer, or Winter). This is vital for release planning, testing, and ensuring compatibility with upcoming Salesforce features.\n\nKey functionalities:\n\n- **Instance Identification:** Determines the Salesforce instance name of your target org.\n- **Upgrade Date Retrieval:** Fetches the planned start time of the next major core service upgrade for that instance from the Salesforce Status API.\n- **Days Until Upgrade:** Calculates and displays the number of days remaining until the next major upgrade.\n- **Severity-Based Logging:** Adjusts the log severity (info, warning) based on the proximity of the upgrade date, providing a visual cue for urgency.\n- **Notifications:** Sends notifications to configured channels (e.g., Slack, MS Teams, Grafana) with the upgrade information, making it suitable for automated monitoring.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Query:** It first queries the `Organization` object in Salesforce to get the `InstanceName` of the target org.\n- **Salesforce Status API Integration:** It makes an HTTP GET request to the Salesforce Status API (`https://api.status.salesforce.com/v1/instances/{instanceName}/status`) to retrieve detailed information about the instance, including scheduled maintenances.\n- **Data Parsing:** It parses the JSON response from the Status API to extract the relevant major release upgrade information.\n- **Date Calculation:** Uses the `moment` library to calculate the difference in days between the current date and the planned upgrade date.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including the instance name, upgrade date, and days remaining, along with relevant metrics for monitoring dashboards.\n- **User Feedback:** Provides clear messages to the user about the upgrade status and proximity.\n</details>\n",
5694
5679
  "examples": [
5695
- "$ sf hardis:org:files:import"
5680
+ "$ sf hardis:org:diagnose:instanceupgrade"
5696
5681
  ],
5697
5682
  "flags": {
5698
5683
  "json": {
@@ -5710,21 +5695,6 @@
5710
5695
  "multiple": false,
5711
5696
  "type": "option"
5712
5697
  },
5713
- "path": {
5714
- "char": "p",
5715
- "description": "Path to the file export project",
5716
- "name": "path",
5717
- "hasDynamicHelp": false,
5718
- "multiple": false,
5719
- "type": "option"
5720
- },
5721
- "overwrite": {
5722
- "char": "f",
5723
- "description": "Override existing files (doubles the number of API calls)",
5724
- "name": "overwrite",
5725
- "allowNo": false,
5726
- "type": "boolean"
5727
- },
5728
5698
  "debug": {
5729
5699
  "char": "d",
5730
5700
  "description": "Activate debug mode (more logs)",
@@ -5763,13 +5733,13 @@
5763
5733
  },
5764
5734
  "hasDynamicHelp": true,
5765
5735
  "hiddenAliases": [],
5766
- "id": "hardis:org:files:import",
5736
+ "id": "hardis:org:diagnose:instanceupgrade",
5767
5737
  "pluginAlias": "sfdx-hardis",
5768
5738
  "pluginName": "sfdx-hardis",
5769
5739
  "pluginType": "core",
5770
5740
  "strict": true,
5771
5741
  "enableJsonFlag": true,
5772
- "title": "Import files",
5742
+ "title": "Get Instance Upgrade date",
5773
5743
  "requiresProject": false,
5774
5744
  "isESM": true,
5775
5745
  "relativePath": [
@@ -5777,44 +5747,46 @@
5777
5747
  "commands",
5778
5748
  "hardis",
5779
5749
  "org",
5780
- "files",
5781
- "import.js"
5750
+ "diagnose",
5751
+ "instanceupgrade.js"
5782
5752
  ],
5783
5753
  "aliasPermutations": [],
5784
5754
  "permutations": [
5785
- "hardis:org:files:import",
5786
- "org:hardis:files:import",
5787
- "org:files:hardis:import",
5788
- "org:files:import:hardis",
5789
- "hardis:files:org:import",
5790
- "files:hardis:org:import",
5791
- "files:org:hardis:import",
5792
- "files:org:import:hardis",
5793
- "hardis:files:import:org",
5794
- "files:hardis:import:org",
5795
- "files:import:hardis:org",
5796
- "files:import:org:hardis",
5797
- "hardis:org:import:files",
5798
- "org:hardis:import:files",
5799
- "org:import:hardis:files",
5800
- "org:import:files:hardis",
5801
- "hardis:import:org:files",
5802
- "import:hardis:org:files",
5803
- "import:org:hardis:files",
5804
- "import:org:files:hardis",
5805
- "hardis:import:files:org",
5806
- "import:hardis:files:org",
5807
- "import:files:hardis:org",
5808
- "import:files:org:hardis"
5809
- ]
5810
- },
5811
- "hardis:org:fix:listviewmine": {
5812
- "aliases": [],
5813
- "args": {},
5814
- "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",
5815
- "examples": [
5816
- "$ sf hardis:org:fix:listviewmine",
5817
- "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
5755
+ "hardis:org:diagnose:instanceupgrade",
5756
+ "org:hardis:diagnose:instanceupgrade",
5757
+ "org:diagnose:hardis:instanceupgrade",
5758
+ "org:diagnose:instanceupgrade:hardis",
5759
+ "hardis:diagnose:org:instanceupgrade",
5760
+ "diagnose:hardis:org:instanceupgrade",
5761
+ "diagnose:org:hardis:instanceupgrade",
5762
+ "diagnose:org:instanceupgrade:hardis",
5763
+ "hardis:diagnose:instanceupgrade:org",
5764
+ "diagnose:hardis:instanceupgrade:org",
5765
+ "diagnose:instanceupgrade:hardis:org",
5766
+ "diagnose:instanceupgrade:org:hardis",
5767
+ "hardis:org:instanceupgrade:diagnose",
5768
+ "org:hardis:instanceupgrade:diagnose",
5769
+ "org:instanceupgrade:hardis:diagnose",
5770
+ "org:instanceupgrade:diagnose:hardis",
5771
+ "hardis:instanceupgrade:org:diagnose",
5772
+ "instanceupgrade:hardis:org:diagnose",
5773
+ "instanceupgrade:org:hardis:diagnose",
5774
+ "instanceupgrade:org:diagnose:hardis",
5775
+ "hardis:instanceupgrade:diagnose:org",
5776
+ "instanceupgrade:hardis:diagnose:org",
5777
+ "instanceupgrade:diagnose:hardis:org",
5778
+ "instanceupgrade:diagnose:org:hardis"
5779
+ ]
5780
+ },
5781
+ "hardis:org:diagnose:legacyapi": {
5782
+ "aliases": [],
5783
+ "args": {},
5784
+ "description": "Checks if an org uses retired or someday retired API version\n\n\nSee article below\n\n[![Handle Salesforce API versions Deprecation like a pro](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deprecated-api.jpg)](https://nicolas.vuillamy.fr/handle-salesforce-api-versions-deprecation-like-a-pro-335065f52238)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-deprecated-api-calls/) and can output Grafana, Slack and MsTeams Notifications.\n",
5785
+ "examples": [
5786
+ "$ sf hardis:org:diagnose:legacyapi",
5787
+ "$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com",
5788
+ "$ sf hardis:org:diagnose:legacyapi --outputfile 'c:/path/to/folder/legacyapi.csv'",
5789
+ "$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv"
5818
5790
  ],
5819
5791
  "flags": {
5820
5792
  "json": {
@@ -5832,10 +5804,28 @@
5832
5804
  "multiple": false,
5833
5805
  "type": "option"
5834
5806
  },
5835
- "listviews": {
5807
+ "eventtype": {
5808
+ "char": "e",
5809
+ "description": "Type of EventLogFile event to analyze",
5810
+ "name": "eventtype",
5811
+ "default": "ApiTotalUsage",
5812
+ "hasDynamicHelp": false,
5813
+ "multiple": false,
5814
+ "type": "option"
5815
+ },
5816
+ "limit": {
5836
5817
  "char": "l",
5837
- "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
5838
- "name": "listviews",
5818
+ "description": "Number of latest EventLogFile events to analyze",
5819
+ "name": "limit",
5820
+ "default": 999,
5821
+ "hasDynamicHelp": false,
5822
+ "multiple": false,
5823
+ "type": "option"
5824
+ },
5825
+ "outputfile": {
5826
+ "char": "f",
5827
+ "description": "Force the path and name of output report file. Must end with .csv",
5828
+ "name": "outputfile",
5839
5829
  "hasDynamicHelp": false,
5840
5830
  "multiple": false,
5841
5831
  "type": "option"
@@ -5878,60 +5868,57 @@
5878
5868
  },
5879
5869
  "hasDynamicHelp": true,
5880
5870
  "hiddenAliases": [],
5881
- "id": "hardis:org:fix:listviewmine",
5871
+ "id": "hardis:org:diagnose:legacyapi",
5882
5872
  "pluginAlias": "sfdx-hardis",
5883
5873
  "pluginName": "sfdx-hardis",
5884
5874
  "pluginType": "core",
5885
5875
  "strict": true,
5886
5876
  "enableJsonFlag": true,
5887
- "title": "Fix listviews with ",
5888
- "requiresProject": true,
5877
+ "title": "Check for legacy API use",
5878
+ "requiresProject": false,
5889
5879
  "isESM": true,
5890
5880
  "relativePath": [
5891
5881
  "lib",
5892
5882
  "commands",
5893
5883
  "hardis",
5894
5884
  "org",
5895
- "fix",
5896
- "listviewmine.js"
5885
+ "diagnose",
5886
+ "legacyapi.js"
5897
5887
  ],
5898
5888
  "aliasPermutations": [],
5899
5889
  "permutations": [
5900
- "hardis:org:fix:listviewmine",
5901
- "org:hardis:fix:listviewmine",
5902
- "org:fix:hardis:listviewmine",
5903
- "org:fix:listviewmine:hardis",
5904
- "hardis:fix:org:listviewmine",
5905
- "fix:hardis:org:listviewmine",
5906
- "fix:org:hardis:listviewmine",
5907
- "fix:org:listviewmine:hardis",
5908
- "hardis:fix:listviewmine:org",
5909
- "fix:hardis:listviewmine:org",
5910
- "fix:listviewmine:hardis:org",
5911
- "fix:listviewmine:org:hardis",
5912
- "hardis:org:listviewmine:fix",
5913
- "org:hardis:listviewmine:fix",
5914
- "org:listviewmine:hardis:fix",
5915
- "org:listviewmine:fix:hardis",
5916
- "hardis:listviewmine:org:fix",
5917
- "listviewmine:hardis:org:fix",
5918
- "listviewmine:org:hardis:fix",
5919
- "listviewmine:org:fix:hardis",
5920
- "hardis:listviewmine:fix:org",
5921
- "listviewmine:hardis:fix:org",
5922
- "listviewmine:fix:hardis:org",
5923
- "listviewmine:fix:org:hardis"
5890
+ "hardis:org:diagnose:legacyapi",
5891
+ "org:hardis:diagnose:legacyapi",
5892
+ "org:diagnose:hardis:legacyapi",
5893
+ "org:diagnose:legacyapi:hardis",
5894
+ "hardis:diagnose:org:legacyapi",
5895
+ "diagnose:hardis:org:legacyapi",
5896
+ "diagnose:org:hardis:legacyapi",
5897
+ "diagnose:org:legacyapi:hardis",
5898
+ "hardis:diagnose:legacyapi:org",
5899
+ "diagnose:hardis:legacyapi:org",
5900
+ "diagnose:legacyapi:hardis:org",
5901
+ "diagnose:legacyapi:org:hardis",
5902
+ "hardis:org:legacyapi:diagnose",
5903
+ "org:hardis:legacyapi:diagnose",
5904
+ "org:legacyapi:hardis:diagnose",
5905
+ "org:legacyapi:diagnose:hardis",
5906
+ "hardis:legacyapi:org:diagnose",
5907
+ "legacyapi:hardis:org:diagnose",
5908
+ "legacyapi:org:hardis:diagnose",
5909
+ "legacyapi:org:diagnose:hardis",
5910
+ "hardis:legacyapi:diagnose:org",
5911
+ "legacyapi:hardis:diagnose:org",
5912
+ "legacyapi:diagnose:hardis:org",
5913
+ "legacyapi:diagnose:org:hardis"
5924
5914
  ]
5925
5915
  },
5926
- "hardis:org:diagnose:audittrail": {
5916
+ "hardis:org:diagnose:licenses": {
5927
5917
  "aliases": [],
5928
5918
  "args": {},
5929
- "description": "Export Audit trail into a CSV file with selected criteria, and highlight suspect actions\n\nAlso detects updates of Custom Settings values (disable by defining `SKIP_AUDIT_TRAIL_CUSTOM_SETTINGS=true`)\n\nRegular setup actions performed in major orgs are filtered.\n\n- \"\"\n - createScratchOrg\n - changedsenderemail\n - deleteScratchOrg\n - loginasgrantedtopartnerbt\n- Certificate and Key Management\n - insertCertificate\n- Custom App Licenses\n - addeduserpackagelicense\n - granteduserpackagelicense\n - revokeduserpackagelicense\n- Customer Portal\n - createdcustomersuccessuser\n - CSPUserDisabled\n- Currency\n - updateddatedexchrate\n- Data Management\n - queueMembership\n- Email Administration\n - dkimRotationPreparationSuccessful\n - dkimRotationSuccessful\n- External Objects\n - xdsEncryptedFieldChange\n- Groups\n - groupMembership\n- Holidays\n - holiday_insert\n- Inbox mobile and legacy desktop apps\n - enableSIQUserNonEAC\n - siqUserAcceptedTOS\n- Manage Users\n - activateduser\n - createduser\n - changedcommunitynickname\n - changedemail\n - changedfederationid\n - changedpassword\n - changedinteractionuseroffon\n - changedinteractionuseronoff\n - changedmarketinguseroffon\n - changedmarketinguseronoff\n - changedofflineuseroffon\n - changedprofileforuserstdtostd\n - changedprofileforuser\n - changedprofileforusercusttostd\n - changedprofileforuserstdtocust\n - changedroleforusertonone\n - changedroleforuser\n - changedroleforuserfromnone\n - changedUserAdminVerifiedStatusVerified\n - changedUserEmailVerifiedStatusUnverified\n - changedUserEmailVerifiedStatusVerified\n - changedknowledgeuseroffon\n - changedsfcontentuseroffon\n - changedsupportuseroffon\n - changedusername\n - changedUserPhoneNumber\n - changedUserPhoneVerifiedStatusUnverified\n - changedUserPhoneVerifiedStatusVerified\n - deactivateduser\n - deleteAuthenticatorPairing\n - deleteTwoFactorInfo2\n - deleteTwoFactorTempCode\n - frozeuser\n - insertAuthenticatorPairing\n - insertTwoFactorInfo2\n - insertTwoFactorTempCode\n - lightningloginenroll\n - PermSetAssign\n - PermSetGroupAssign\n - PermSetGroupUnassign\n - PermSetLicenseAssign\n - PermSetUnassign\n - PermSetLicenseUnassign\n - registeredUserPhoneNumber\n - resetpassword\n - suNetworkAdminLogin\n - suNetworkAdminLogout\n - suOrgAdminLogin\n - suOrgAdminLogout\n - unfrozeuser\n - useremailchangesent\n- Mobile Administration\n - assigneduserstomobileconfig\n- Reporting Snapshots\n - createdReportJob\n - deletedReportJob\n- Sandboxes\n - DeleteSandbox\n\nBy default, deployment user defined in .sfdx-hardis.yml targetUsername property will be excluded.\n\nYou can define additional users to exclude in .sfdx-hardis.yml **monitoringExcludeUsernames** property.\n\nYou can also add more sections / actions considered as not suspect using property **monitoringAllowedSectionsActions**\n\nExample:\n\n```yaml\nmonitoringExcludeUsernames:\n - deploymentuser@cloudity.com\n - marketingcloud@cloudity.com\n - integration-user@cloudity.com\n\nmonitoringAllowedSectionsActions:\n \"Some section\": [] // Will ignore all actions from such section\n \"Some other section\": [\"actionType1\",\"actionType2\",\"actionType3\"] // Will ignore only those 3 actions from section \"Some other section\". Other actions in the same section will be considered as suspect.\n```\n\n## Excel output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-excel.jpg)\n\n## Local output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-local.jpg)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-suspect-audit-trail/) and can output Grafana, Slack and MsTeams Notifications.\n",
5919
+ "description": "\n**Lists and analyzes User Licenses and Permission Set Licenses subscribed and used in a Salesforce org.**\n\nThis command provides a comprehensive overview of your Salesforce license consumption. It's particularly useful for:\n\n- **License Management:** Understanding which licenses are active, how many are available, and how many are being used.\n- **Cost Optimization:** Identifying unused or underutilized licenses that could be reallocated or decommissioned.\n- **Compliance:** Ensuring that your organization is compliant with Salesforce licensing agreements.\n- **Monitoring:** Tracking license usage trends over time.\n\nKey functionalities:\n\n- **User License Details:** Retrieves information about standard and custom User Licenses, including `MasterLabel`, `Name`, `TotalLicenses`, and `UsedLicenses`.\n- **Permission Set License Details:** Retrieves information about Permission Set Licenses, including `MasterLabel`, `PermissionSetLicenseKey`, `TotalLicenses`, and `UsedLicenses`.\n- **Used Licenses Filter:** The `--usedonly` flag allows you to filter the report to show only licenses that have at least one `UsedLicenses` count greater than zero.\n- **CSV Report Generation:** Generates a CSV file containing all the retrieved license information, suitable for detailed analysis.\n- **Notifications:** Sends notifications to configured channels (e.g., Grafana, Slack, MS Teams) with a summary of license usage, including lists of active and used licenses.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Queries:** It executes SOQL queries against the `UserLicense` and `PermissionSetLicense` objects in Salesforce to retrieve license data.\n- **Data Transformation:** It processes the query results, reformatting the data to be more readable and consistent for reporting purposes (e.g., removing `Id` and `attributes`, renaming `PermissionSetLicenseKey` to `Name`).\n- **Data Aggregation:** It aggregates license information, creating a `licensesByKey` object for quick lookups and a `usedLicenses` array for a concise list of actively used licenses.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of license data.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **User Feedback:** Provides clear messages to the user about the license extraction process and the used licenses.\n</details>\n",
5930
5920
  "examples": [
5931
- "$ sf hardis:org:diagnose:audittrail",
5932
- "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
5933
- "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
5934
- "$ sf hardis:org:diagnose:audittrail --lastndays 5"
5921
+ "$ sf hardis:org:diagnose:licenses"
5935
5922
  ],
5936
5923
  "flags": {
5937
5924
  "json": {
@@ -5949,22 +5936,6 @@
5949
5936
  "multiple": false,
5950
5937
  "type": "option"
5951
5938
  },
5952
- "excludeusers": {
5953
- "char": "e",
5954
- "description": "Comma-separated list of usernames to exclude",
5955
- "name": "excludeusers",
5956
- "hasDynamicHelp": false,
5957
- "multiple": false,
5958
- "type": "option"
5959
- },
5960
- "lastndays": {
5961
- "char": "t",
5962
- "description": "Number of days to extract from today (included)",
5963
- "name": "lastndays",
5964
- "hasDynamicHelp": false,
5965
- "multiple": false,
5966
- "type": "option"
5967
- },
5968
5939
  "outputfile": {
5969
5940
  "char": "f",
5970
5941
  "description": "Force the path and name of output report file. Must end with .csv",
@@ -5973,6 +5944,13 @@
5973
5944
  "multiple": false,
5974
5945
  "type": "option"
5975
5946
  },
5947
+ "usedonly": {
5948
+ "char": "u",
5949
+ "description": "Filter to have only used licenses",
5950
+ "name": "usedonly",
5951
+ "allowNo": false,
5952
+ "type": "boolean"
5953
+ },
5976
5954
  "debug": {
5977
5955
  "char": "d",
5978
5956
  "description": "Activate debug mode (more logs)",
@@ -6011,13 +5989,13 @@
6011
5989
  },
6012
5990
  "hasDynamicHelp": true,
6013
5991
  "hiddenAliases": [],
6014
- "id": "hardis:org:diagnose:audittrail",
5992
+ "id": "hardis:org:diagnose:licenses",
6015
5993
  "pluginAlias": "sfdx-hardis",
6016
5994
  "pluginName": "sfdx-hardis",
6017
5995
  "pluginType": "core",
6018
5996
  "strict": true,
6019
5997
  "enableJsonFlag": true,
6020
- "title": "Diagnose content of Setup Audit Trail",
5998
+ "title": "List licenses subscribed and used in a Salesforce org",
6021
5999
  "requiresProject": false,
6022
6000
  "isESM": true,
6023
6001
  "relativePath": [
@@ -6026,42 +6004,42 @@
6026
6004
  "hardis",
6027
6005
  "org",
6028
6006
  "diagnose",
6029
- "audittrail.js"
6007
+ "licenses.js"
6030
6008
  ],
6031
6009
  "aliasPermutations": [],
6032
6010
  "permutations": [
6033
- "hardis:org:diagnose:audittrail",
6034
- "org:hardis:diagnose:audittrail",
6035
- "org:diagnose:hardis:audittrail",
6036
- "org:diagnose:audittrail:hardis",
6037
- "hardis:diagnose:org:audittrail",
6038
- "diagnose:hardis:org:audittrail",
6039
- "diagnose:org:hardis:audittrail",
6040
- "diagnose:org:audittrail:hardis",
6041
- "hardis:diagnose:audittrail:org",
6042
- "diagnose:hardis:audittrail:org",
6043
- "diagnose:audittrail:hardis:org",
6044
- "diagnose:audittrail:org:hardis",
6045
- "hardis:org:audittrail:diagnose",
6046
- "org:hardis:audittrail:diagnose",
6047
- "org:audittrail:hardis:diagnose",
6048
- "org:audittrail:diagnose:hardis",
6049
- "hardis:audittrail:org:diagnose",
6050
- "audittrail:hardis:org:diagnose",
6051
- "audittrail:org:hardis:diagnose",
6052
- "audittrail:org:diagnose:hardis",
6053
- "hardis:audittrail:diagnose:org",
6054
- "audittrail:hardis:diagnose:org",
6055
- "audittrail:diagnose:hardis:org",
6056
- "audittrail:diagnose:org:hardis"
6011
+ "hardis:org:diagnose:licenses",
6012
+ "org:hardis:diagnose:licenses",
6013
+ "org:diagnose:hardis:licenses",
6014
+ "org:diagnose:licenses:hardis",
6015
+ "hardis:diagnose:org:licenses",
6016
+ "diagnose:hardis:org:licenses",
6017
+ "diagnose:org:hardis:licenses",
6018
+ "diagnose:org:licenses:hardis",
6019
+ "hardis:diagnose:licenses:org",
6020
+ "diagnose:hardis:licenses:org",
6021
+ "diagnose:licenses:hardis:org",
6022
+ "diagnose:licenses:org:hardis",
6023
+ "hardis:org:licenses:diagnose",
6024
+ "org:hardis:licenses:diagnose",
6025
+ "org:licenses:hardis:diagnose",
6026
+ "org:licenses:diagnose:hardis",
6027
+ "hardis:licenses:org:diagnose",
6028
+ "licenses:hardis:org:diagnose",
6029
+ "licenses:org:hardis:diagnose",
6030
+ "licenses:org:diagnose:hardis",
6031
+ "hardis:licenses:diagnose:org",
6032
+ "licenses:hardis:diagnose:org",
6033
+ "licenses:diagnose:hardis:org",
6034
+ "licenses:diagnose:org:hardis"
6057
6035
  ]
6058
6036
  },
6059
- "hardis:org:diagnose:instanceupgrade": {
6037
+ "hardis:org:diagnose:releaseupdates": {
6060
6038
  "aliases": [],
6061
6039
  "args": {},
6062
- "description": "\n## Command Behavior\n\n**Retrieves and displays the scheduled upgrade date for a Salesforce org's instance.**\n\nThis command provides crucial information about when your Salesforce instance will be upgraded to the next major release (Spring, Summer, or Winter). This is vital for release planning, testing, and ensuring compatibility with upcoming Salesforce features.\n\nKey functionalities:\n\n- **Instance Identification:** Determines the Salesforce instance name of your target org.\n- **Upgrade Date Retrieval:** Fetches the planned start time of the next major core service upgrade for that instance from the Salesforce Status API.\n- **Days Until Upgrade:** Calculates and displays the number of days remaining until the next major upgrade.\n- **Severity-Based Logging:** Adjusts the log severity (info, warning) based on the proximity of the upgrade date, providing a visual cue for urgency.\n- **Notifications:** Sends notifications to configured channels (e.g., Slack, MS Teams, Grafana) with the upgrade information, making it suitable for automated monitoring.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Query:** It first queries the `Organization` object in Salesforce to get the `InstanceName` of the target org.\n- **Salesforce Status API Integration:** It makes an HTTP GET request to the Salesforce Status API (`https://api.status.salesforce.com/v1/instances/{instanceName}/status`) to retrieve detailed information about the instance, including scheduled maintenances.\n- **Data Parsing:** It parses the JSON response from the Status API to extract the relevant major release upgrade information.\n- **Date Calculation:** Uses the `moment` library to calculate the difference in days between the current date and the planned upgrade date.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including the instance name, upgrade date, and days remaining, along with relevant metrics for monitoring dashboards.\n- **User Feedback:** Provides clear messages to the user about the upgrade status and proximity.\n</details>\n",
6040
+ "description": "Export Release Updates into a CSV file with selected criteria, and highlight Release Updates that should be checked.\n\nBefore publishing **Breaking Changes** ❌, Salesforce announce them in the setup menu [**Release Updates**](https://help.salesforce.com/s/articleView?id=sf.release_updates.htm&type=5)\n\n⚠️ Some of them are very important, because if you don't make the related upgrades in time (ex: before Winter 25) , your production org can crash !\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-release-updates/) and can output Grafana, Slack and MsTeams Notifications.\n",
6063
6041
  "examples": [
6064
- "$ sf hardis:org:diagnose:instanceupgrade"
6042
+ "$ sf hardis:org:diagnose:releaseupdates"
6065
6043
  ],
6066
6044
  "flags": {
6067
6045
  "json": {
@@ -6079,6 +6057,14 @@
6079
6057
  "multiple": false,
6080
6058
  "type": "option"
6081
6059
  },
6060
+ "outputfile": {
6061
+ "char": "f",
6062
+ "description": "Force the path and name of output report file. Must end with .csv",
6063
+ "name": "outputfile",
6064
+ "hasDynamicHelp": false,
6065
+ "multiple": false,
6066
+ "type": "option"
6067
+ },
6082
6068
  "debug": {
6083
6069
  "char": "d",
6084
6070
  "description": "Activate debug mode (more logs)",
@@ -6117,13 +6103,13 @@
6117
6103
  },
6118
6104
  "hasDynamicHelp": true,
6119
6105
  "hiddenAliases": [],
6120
- "id": "hardis:org:diagnose:instanceupgrade",
6106
+ "id": "hardis:org:diagnose:releaseupdates",
6121
6107
  "pluginAlias": "sfdx-hardis",
6122
6108
  "pluginName": "sfdx-hardis",
6123
6109
  "pluginType": "core",
6124
6110
  "strict": true,
6125
6111
  "enableJsonFlag": true,
6126
- "title": "Get Instance Upgrade date",
6112
+ "title": "Check Release Updates of an org",
6127
6113
  "requiresProject": false,
6128
6114
  "isESM": true,
6129
6115
  "relativePath": [
@@ -6132,45 +6118,47 @@
6132
6118
  "hardis",
6133
6119
  "org",
6134
6120
  "diagnose",
6135
- "instanceupgrade.js"
6121
+ "releaseupdates.js"
6136
6122
  ],
6137
6123
  "aliasPermutations": [],
6138
6124
  "permutations": [
6139
- "hardis:org:diagnose:instanceupgrade",
6140
- "org:hardis:diagnose:instanceupgrade",
6141
- "org:diagnose:hardis:instanceupgrade",
6142
- "org:diagnose:instanceupgrade:hardis",
6143
- "hardis:diagnose:org:instanceupgrade",
6144
- "diagnose:hardis:org:instanceupgrade",
6145
- "diagnose:org:hardis:instanceupgrade",
6146
- "diagnose:org:instanceupgrade:hardis",
6147
- "hardis:diagnose:instanceupgrade:org",
6148
- "diagnose:hardis:instanceupgrade:org",
6149
- "diagnose:instanceupgrade:hardis:org",
6150
- "diagnose:instanceupgrade:org:hardis",
6151
- "hardis:org:instanceupgrade:diagnose",
6152
- "org:hardis:instanceupgrade:diagnose",
6153
- "org:instanceupgrade:hardis:diagnose",
6154
- "org:instanceupgrade:diagnose:hardis",
6155
- "hardis:instanceupgrade:org:diagnose",
6156
- "instanceupgrade:hardis:org:diagnose",
6157
- "instanceupgrade:org:hardis:diagnose",
6158
- "instanceupgrade:org:diagnose:hardis",
6159
- "hardis:instanceupgrade:diagnose:org",
6160
- "instanceupgrade:hardis:diagnose:org",
6161
- "instanceupgrade:diagnose:hardis:org",
6162
- "instanceupgrade:diagnose:org:hardis"
6163
- ]
6164
- },
6165
- "hardis:org:diagnose:legacyapi": {
6166
- "aliases": [],
6167
- "args": {},
6168
- "description": "Checks if an org uses retired or someday retired API version\n\n\nSee article below\n\n[![Handle Salesforce API versions Deprecation like a pro](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deprecated-api.jpg)](https://nicolas.vuillamy.fr/handle-salesforce-api-versions-deprecation-like-a-pro-335065f52238)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-deprecated-api-calls/) and can output Grafana, Slack and MsTeams Notifications.\n",
6169
- "examples": [
6170
- "$ sf hardis:org:diagnose:legacyapi",
6171
- "$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com",
6172
- "$ sf hardis:org:diagnose:legacyapi --outputfile 'c:/path/to/folder/legacyapi.csv'",
6173
- "$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv"
6125
+ "hardis:org:diagnose:releaseupdates",
6126
+ "org:hardis:diagnose:releaseupdates",
6127
+ "org:diagnose:hardis:releaseupdates",
6128
+ "org:diagnose:releaseupdates:hardis",
6129
+ "hardis:diagnose:org:releaseupdates",
6130
+ "diagnose:hardis:org:releaseupdates",
6131
+ "diagnose:org:hardis:releaseupdates",
6132
+ "diagnose:org:releaseupdates:hardis",
6133
+ "hardis:diagnose:releaseupdates:org",
6134
+ "diagnose:hardis:releaseupdates:org",
6135
+ "diagnose:releaseupdates:hardis:org",
6136
+ "diagnose:releaseupdates:org:hardis",
6137
+ "hardis:org:releaseupdates:diagnose",
6138
+ "org:hardis:releaseupdates:diagnose",
6139
+ "org:releaseupdates:hardis:diagnose",
6140
+ "org:releaseupdates:diagnose:hardis",
6141
+ "hardis:releaseupdates:org:diagnose",
6142
+ "releaseupdates:hardis:org:diagnose",
6143
+ "releaseupdates:org:hardis:diagnose",
6144
+ "releaseupdates:org:diagnose:hardis",
6145
+ "hardis:releaseupdates:diagnose:org",
6146
+ "releaseupdates:hardis:diagnose:org",
6147
+ "releaseupdates:diagnose:hardis:org",
6148
+ "releaseupdates:diagnose:org:hardis"
6149
+ ]
6150
+ },
6151
+ "hardis:org:diagnose:storage-stats": {
6152
+ "aliases": [],
6153
+ "args": {},
6154
+ "description": "**Extracts and analyzes Data Storage usage for a Salesforce org, providing detailed per-object breakdowns with flexible grouping options.**\n\nThis command provides a comprehensive overview of your Salesforce data storage consumption. It's particularly useful for:\n\n- **Storage Management:** Understanding which SObjects consume the most storage and how usage has evolved over time.\n- **Cost Optimization:** Identifying storage-heavy objects that could be candidates for data archival or cleanup strategies.\n- **Capacity Planning:** Tracking storage trends to predict when additional capacity will be needed.\n- **Compliance & Governance:** Monitoring data growth patterns to ensure alignment with data retention policies.\n\nKey functionalities:\n\n- **Storage Limits Analysis:** Retrieves and displays org data storage limits, including total capacity, used storage, remaining storage, and percentage used. Detects and alerts on over-usage scenarios.\n- **SObject Discovery & Filtering:** Automatically discovers all SObjects in the org and filters them to focus on production/custom objects (excludes metadata types, platform-only objects, and cached empty objects).\n- **Interactive Selection:** Prompts the user to select which SObjects to analyze and choose breakdown fields (date fields, RecordType, custom fields, or relationship fields).\n- **Flexible Breakdown Field:** Supports grouping by any field including:\n - Date/DateTime fields (`CreatedDate`, `LastModifiedDate`, custom date fields)\n - RecordType (`RecordType.Name`)\n - Custom fields (`Status__c`, picklists, text fields)\n - Nested relationship fields (`SBQQ__Quote__r.RecordType.Name`)\n- **Date Granularity Options:** For date/datetime fields, choose between:\n - Year-based grouping (`CALENDAR_YEAR`)\n - Month-based grouping (`CALENDAR_MONTH`)\n - Day-based grouping (exact date)\n- **WHERE Clause Filtering:** Apply SOQL WHERE conditions to filter records before calculating storage (e.g., only active records, records from the last year).\n- **Storage Estimation:** Estimates storage usage for each object using an average record size heuristic (2 KB per record) and calculates the percentage of org quota consumed.\n- **Dual CSV Reports:** Generates two CSV files: a detailed breakdown by selected field and a totals-per-object summary, both suitable for spreadsheet analysis and reporting.\n- **Empty Objects Cache:** Maintains a per-user cache of objects detected with zero records to optimize subsequent runs by skipping empty tables.\n- **Progress Tracking:** Sends WebSocket progress messages for integration with external UIs and monitoring dashboards.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Limits Retrieval:** Calls `conn.limits()` to retrieve the `DataStorageMB` object containing `Max` and `Remaining` values. Handles negative `Remaining` values (over-usage scenarios) by calculating `overUsageMB` and adjusting display values.\n- **SObject Discovery:** Uses `conn.metadata.list([{ type: 'CustomObject' }])` to get custom objects and `conn.describeGlobal()` to get all SObjects. Filters by object capabilities (`layoutable`, `queryable`, `retrieveable`, `createable`, `updateable`, `deletable`) and excludes metadata types (`__mdt` suffix) and cached empty objects.\n- **User Interaction:** Uses `prompts` for interactive multi-select of SObjects, breakdown field selection, granularity choice (for date fields), and optional WHERE conditions. All objects are pre-selected by default for user convenience.\n- **Field Validation:** Recursively validates breakdown fields including nested relationships (e.g., `SBQQ__Quote__r.RecordType.Name`) by traversing the relationship chain and checking field existence on each related object. Automatically handles special cases like `RecordType` -> `RecordTypeId` and `__r` -> `__c` conversions.\n- **Dynamic Query Generation:** Builds SOQL queries based on field type and granularity:\n - For date fields with year granularity: `SELECT CALENDAR_YEAR(<Field>) breakdown, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY CALENDAR_YEAR(<Field>) ORDER BY CALENDAR_YEAR(<Field>)`\n - For date fields with month granularity: `SELECT CALENDAR_YEAR(<Field>) year, CALENDAR_MONTH(<Field>) month, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY CALENDAR_YEAR(<Field>), CALENDAR_MONTH(<Field>) ORDER BY CALENDAR_YEAR(<Field>), CALENDAR_MONTH(<Field>)`\n - For non-date fields: `SELECT <Field> breakdown, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY <Field> ORDER BY <Field>`\n- **WHERE Clause Support:** Accepts user-provided WHERE conditions via flag (`--where`) or interactive prompt. Injects the condition into all SOQL queries for consistent filtering across all objects.\n- **Storage Calculation:** Applies a conservative average record size of 2 KB (2048 bytes) to estimate storage consumption. Calculates both MB usage and percentage of org quota for each object and breakdown value.\n- **Report Generation:** Uses `generateCsvFile` and `generateReportPath` helpers to create two CSV files in the reports directory:\n - Detailed breakdown: includes all statistics per breakdown value per object (e.g., by year, by month, by RecordType)\n - Totals summary: includes only aggregate totals per object\n - File naming includes breakdown field, granularity (for date fields), and `-filtered` suffix when WHERE clause is applied\n- **Caching Mechanism:** Writes a JSON cache file per authenticated username (sanitized) in the reports directory (`<username>_empty_tables_cache.json`) containing an array of empty object names. The cache is updated after each run with newly detected empty objects.\n- **Progress & UX:** Uses `WebSocketClient` to emit start/step/end progress messages for external monitoring. Outputs summary tables with `uxLogTable` and status messages with `uxLog`.\n- **Return Value:** Returns a JSON object containing `tableStorageInfos` (all rows), `tableStorageInfosTotals` (summary rows), `storageLimits` (org limits object), and `outputFiles` (paths to generated CSV/XLSX reports).\n</details>\n\n![](https://sfdx-hardis.cloudity.com/assets/images/storage-usage-year-breakdown.png)\n\n![](https://sfdx-hardis.cloudity.com/assets/images/storage-usage-total.png)\n",
6155
+ "examples": [
6156
+ "$ sf hardis:org:diagnose:storage-stats",
6157
+ "$ sf hardis:org:diagnose:storage-stats --breakdown-field \"CreatedDate\"",
6158
+ "$ sf hardis:org:diagnose:storage-stats -b \"RecordType.Name\"",
6159
+ "$ sf hardis:org:diagnose:storage-stats --where \"CreatedDate = LAST_N_DAYS:365\"",
6160
+ "$ sf hardis:org:diagnose:storage-stats -w \"Status__c = 'Active'\"",
6161
+ "$ sf hardis:org:diagnose:storage-stats -b \"LastModifiedDate\" -w \"IsDeleted = false\""
6174
6162
  ],
6175
6163
  "flags": {
6176
6164
  "json": {
@@ -6188,28 +6176,26 @@
6188
6176
  "multiple": false,
6189
6177
  "type": "option"
6190
6178
  },
6191
- "eventtype": {
6192
- "char": "e",
6193
- "description": "Type of EventLogFile event to analyze",
6194
- "name": "eventtype",
6195
- "default": "ApiTotalUsage",
6179
+ "outputfile": {
6180
+ "char": "f",
6181
+ "description": "Force the path and name of output report file. Must end with .csv",
6182
+ "name": "outputfile",
6196
6183
  "hasDynamicHelp": false,
6197
6184
  "multiple": false,
6198
6185
  "type": "option"
6199
6186
  },
6200
- "limit": {
6201
- "char": "l",
6202
- "description": "Number of latest EventLogFile events to analyze",
6203
- "name": "limit",
6204
- "default": 999,
6187
+ "breakdown-field": {
6188
+ "char": "b",
6189
+ "description": "Field to use for storage stats breakdown. Example: \"CreatedDate\", \"LastModifiedDate\", \"RecordType.Name\", or custom fields like \"Status__c\"",
6190
+ "name": "breakdown-field",
6205
6191
  "hasDynamicHelp": false,
6206
6192
  "multiple": false,
6207
6193
  "type": "option"
6208
6194
  },
6209
- "outputfile": {
6210
- "char": "f",
6211
- "description": "Force the path and name of output report file. Must end with .csv",
6212
- "name": "outputfile",
6195
+ "where": {
6196
+ "char": "w",
6197
+ "description": "WHERE clause to filter records in the query (without the WHERE keyword). Example: \"CreatedDate = LAST_N_DAYS:365\" or \"Status__c = 'Active'\"",
6198
+ "name": "where",
6213
6199
  "hasDynamicHelp": false,
6214
6200
  "multiple": false,
6215
6201
  "type": "option"
@@ -6252,14 +6238,14 @@
6252
6238
  },
6253
6239
  "hasDynamicHelp": true,
6254
6240
  "hiddenAliases": [],
6255
- "id": "hardis:org:diagnose:legacyapi",
6241
+ "id": "hardis:org:diagnose:storage-stats",
6256
6242
  "pluginAlias": "sfdx-hardis",
6257
6243
  "pluginName": "sfdx-hardis",
6258
6244
  "pluginType": "core",
6259
6245
  "strict": true,
6260
6246
  "enableJsonFlag": true,
6261
- "title": "Check for legacy API use",
6262
- "requiresProject": false,
6247
+ "title": "Extract Data Storage stats",
6248
+ "requiresProject": true,
6263
6249
  "isESM": true,
6264
6250
  "relativePath": [
6265
6251
  "lib",
@@ -6267,42 +6253,42 @@
6267
6253
  "hardis",
6268
6254
  "org",
6269
6255
  "diagnose",
6270
- "legacyapi.js"
6256
+ "storage-stats.js"
6271
6257
  ],
6272
6258
  "aliasPermutations": [],
6273
6259
  "permutations": [
6274
- "hardis:org:diagnose:legacyapi",
6275
- "org:hardis:diagnose:legacyapi",
6276
- "org:diagnose:hardis:legacyapi",
6277
- "org:diagnose:legacyapi:hardis",
6278
- "hardis:diagnose:org:legacyapi",
6279
- "diagnose:hardis:org:legacyapi",
6280
- "diagnose:org:hardis:legacyapi",
6281
- "diagnose:org:legacyapi:hardis",
6282
- "hardis:diagnose:legacyapi:org",
6283
- "diagnose:hardis:legacyapi:org",
6284
- "diagnose:legacyapi:hardis:org",
6285
- "diagnose:legacyapi:org:hardis",
6286
- "hardis:org:legacyapi:diagnose",
6287
- "org:hardis:legacyapi:diagnose",
6288
- "org:legacyapi:hardis:diagnose",
6289
- "org:legacyapi:diagnose:hardis",
6290
- "hardis:legacyapi:org:diagnose",
6291
- "legacyapi:hardis:org:diagnose",
6292
- "legacyapi:org:hardis:diagnose",
6293
- "legacyapi:org:diagnose:hardis",
6294
- "hardis:legacyapi:diagnose:org",
6295
- "legacyapi:hardis:diagnose:org",
6296
- "legacyapi:diagnose:hardis:org",
6297
- "legacyapi:diagnose:org:hardis"
6260
+ "hardis:org:diagnose:storage-stats",
6261
+ "org:hardis:diagnose:storage-stats",
6262
+ "org:diagnose:hardis:storage-stats",
6263
+ "org:diagnose:storage-stats:hardis",
6264
+ "hardis:diagnose:org:storage-stats",
6265
+ "diagnose:hardis:org:storage-stats",
6266
+ "diagnose:org:hardis:storage-stats",
6267
+ "diagnose:org:storage-stats:hardis",
6268
+ "hardis:diagnose:storage-stats:org",
6269
+ "diagnose:hardis:storage-stats:org",
6270
+ "diagnose:storage-stats:hardis:org",
6271
+ "diagnose:storage-stats:org:hardis",
6272
+ "hardis:org:storage-stats:diagnose",
6273
+ "org:hardis:storage-stats:diagnose",
6274
+ "org:storage-stats:hardis:diagnose",
6275
+ "org:storage-stats:diagnose:hardis",
6276
+ "hardis:storage-stats:org:diagnose",
6277
+ "storage-stats:hardis:org:diagnose",
6278
+ "storage-stats:org:hardis:diagnose",
6279
+ "storage-stats:org:diagnose:hardis",
6280
+ "hardis:storage-stats:diagnose:org",
6281
+ "storage-stats:hardis:diagnose:org",
6282
+ "storage-stats:diagnose:hardis:org",
6283
+ "storage-stats:diagnose:org:hardis"
6298
6284
  ]
6299
6285
  },
6300
- "hardis:org:diagnose:licenses": {
6286
+ "hardis:org:diagnose:unsecure-connected-apps": {
6301
6287
  "aliases": [],
6302
6288
  "args": {},
6303
- "description": "\n**Lists and analyzes User Licenses and Permission Set Licenses subscribed and used in a Salesforce org.**\n\nThis command provides a comprehensive overview of your Salesforce license consumption. It's particularly useful for:\n\n- **License Management:** Understanding which licenses are active, how many are available, and how many are being used.\n- **Cost Optimization:** Identifying unused or underutilized licenses that could be reallocated or decommissioned.\n- **Compliance:** Ensuring that your organization is compliant with Salesforce licensing agreements.\n- **Monitoring:** Tracking license usage trends over time.\n\nKey functionalities:\n\n- **User License Details:** Retrieves information about standard and custom User Licenses, including `MasterLabel`, `Name`, `TotalLicenses`, and `UsedLicenses`.\n- **Permission Set License Details:** Retrieves information about Permission Set Licenses, including `MasterLabel`, `PermissionSetLicenseKey`, `TotalLicenses`, and `UsedLicenses`.\n- **Used Licenses Filter:** The `--usedonly` flag allows you to filter the report to show only licenses that have at least one `UsedLicenses` count greater than zero.\n- **CSV Report Generation:** Generates a CSV file containing all the retrieved license information, suitable for detailed analysis.\n- **Notifications:** Sends notifications to configured channels (e.g., Grafana, Slack, MS Teams) with a summary of license usage, including lists of active and used licenses.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Queries:** It executes SOQL queries against the `UserLicense` and `PermissionSetLicense` objects in Salesforce to retrieve license data.\n- **Data Transformation:** It processes the query results, reformatting the data to be more readable and consistent for reporting purposes (e.g., removing `Id` and `attributes`, renaming `PermissionSetLicenseKey` to `Name`).\n- **Data Aggregation:** It aggregates license information, creating a `licensesByKey` object for quick lookups and a `usedLicenses` array for a concise list of actively used licenses.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of license data.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **User Feedback:** Provides clear messages to the user about the license extraction process and the used licenses.\n</details>\n",
6289
+ "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",
6304
6290
  "examples": [
6305
- "$ sf hardis:org:diagnose:licenses"
6291
+ "$ sf hardis:org:diagnose:unsecure-connected-apps"
6306
6292
  ],
6307
6293
  "flags": {
6308
6294
  "json": {
@@ -6328,13 +6314,6 @@
6328
6314
  "multiple": false,
6329
6315
  "type": "option"
6330
6316
  },
6331
- "usedonly": {
6332
- "char": "u",
6333
- "description": "Filter to have only used licenses",
6334
- "name": "usedonly",
6335
- "allowNo": false,
6336
- "type": "boolean"
6337
- },
6338
6317
  "debug": {
6339
6318
  "char": "d",
6340
6319
  "description": "Activate debug mode (more logs)",
@@ -6373,13 +6352,13 @@
6373
6352
  },
6374
6353
  "hasDynamicHelp": true,
6375
6354
  "hiddenAliases": [],
6376
- "id": "hardis:org:diagnose:licenses",
6355
+ "id": "hardis:org:diagnose:unsecure-connected-apps",
6377
6356
  "pluginAlias": "sfdx-hardis",
6378
6357
  "pluginName": "sfdx-hardis",
6379
6358
  "pluginType": "core",
6380
6359
  "strict": true,
6381
6360
  "enableJsonFlag": true,
6382
- "title": "List licenses subscribed and used in a Salesforce org",
6361
+ "title": "Detect Unsecured Connected Apps",
6383
6362
  "requiresProject": false,
6384
6363
  "isESM": true,
6385
6364
  "relativePath": [
@@ -6388,42 +6367,43 @@
6388
6367
  "hardis",
6389
6368
  "org",
6390
6369
  "diagnose",
6391
- "licenses.js"
6370
+ "unsecure-connected-apps.js"
6392
6371
  ],
6393
6372
  "aliasPermutations": [],
6394
6373
  "permutations": [
6395
- "hardis:org:diagnose:licenses",
6396
- "org:hardis:diagnose:licenses",
6397
- "org:diagnose:hardis:licenses",
6398
- "org:diagnose:licenses:hardis",
6399
- "hardis:diagnose:org:licenses",
6400
- "diagnose:hardis:org:licenses",
6401
- "diagnose:org:hardis:licenses",
6402
- "diagnose:org:licenses:hardis",
6403
- "hardis:diagnose:licenses:org",
6404
- "diagnose:hardis:licenses:org",
6405
- "diagnose:licenses:hardis:org",
6406
- "diagnose:licenses:org:hardis",
6407
- "hardis:org:licenses:diagnose",
6408
- "org:hardis:licenses:diagnose",
6409
- "org:licenses:hardis:diagnose",
6410
- "org:licenses:diagnose:hardis",
6411
- "hardis:licenses:org:diagnose",
6412
- "licenses:hardis:org:diagnose",
6413
- "licenses:org:hardis:diagnose",
6414
- "licenses:org:diagnose:hardis",
6415
- "hardis:licenses:diagnose:org",
6416
- "licenses:hardis:diagnose:org",
6417
- "licenses:diagnose:hardis:org",
6418
- "licenses:diagnose:org:hardis"
6374
+ "hardis:org:diagnose:unsecure-connected-apps",
6375
+ "org:hardis:diagnose:unsecure-connected-apps",
6376
+ "org:diagnose:hardis:unsecure-connected-apps",
6377
+ "org:diagnose:unsecure-connected-apps:hardis",
6378
+ "hardis:diagnose:org:unsecure-connected-apps",
6379
+ "diagnose:hardis:org:unsecure-connected-apps",
6380
+ "diagnose:org:hardis:unsecure-connected-apps",
6381
+ "diagnose:org:unsecure-connected-apps:hardis",
6382
+ "hardis:diagnose:unsecure-connected-apps:org",
6383
+ "diagnose:hardis:unsecure-connected-apps:org",
6384
+ "diagnose:unsecure-connected-apps:hardis:org",
6385
+ "diagnose:unsecure-connected-apps:org:hardis",
6386
+ "hardis:org:unsecure-connected-apps:diagnose",
6387
+ "org:hardis:unsecure-connected-apps:diagnose",
6388
+ "org:unsecure-connected-apps:hardis:diagnose",
6389
+ "org:unsecure-connected-apps:diagnose:hardis",
6390
+ "hardis:unsecure-connected-apps:org:diagnose",
6391
+ "unsecure-connected-apps:hardis:org:diagnose",
6392
+ "unsecure-connected-apps:org:hardis:diagnose",
6393
+ "unsecure-connected-apps:org:diagnose:hardis",
6394
+ "hardis:unsecure-connected-apps:diagnose:org",
6395
+ "unsecure-connected-apps:hardis:diagnose:org",
6396
+ "unsecure-connected-apps:diagnose:hardis:org",
6397
+ "unsecure-connected-apps:diagnose:org:hardis"
6419
6398
  ]
6420
6399
  },
6421
- "hardis:org:diagnose:releaseupdates": {
6400
+ "hardis:org:diagnose:unused-apex-classes": {
6422
6401
  "aliases": [],
6423
6402
  "args": {},
6424
- "description": "Export Release Updates into a CSV file with selected criteria, and highlight Release Updates that should be checked.\n\nBefore publishing **Breaking Changes** ❌, Salesforce announce them in the setup menu [**Release Updates**](https://help.salesforce.com/s/articleView?id=sf.release_updates.htm&type=5)\n\n⚠️ Some of them are very important, because if you don't make the related upgrades in time (ex: before Winter 25) , your production org can crash !\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-release-updates/) and can output Grafana, Slack and MsTeams Notifications.\n",
6403
+ "description": "List all async Apex classes (Batch,Queueable,Schedulable) that has not been called for more than 365 days.\n \nThe result class list probably can be removed from the project, and that will improve your test classes performances 😊\n\nThe number of unused day is overridable using --days option. \n\nThe command uses queries on AsyncApexJob and CronTrigger technical tables to build the result.\n\nApex Classes CreatedBy and CreatedOn fields are calculated from MIN(date from git, date from org)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-apex-classes/) and can output Grafana, Slack and MsTeams Notifications.\n\n![](https://sfdx-hardis.cloudity.com/assets/images/screenshot-monitoring-unused-apex-grafana.jpg)\n",
6425
6404
  "examples": [
6426
- "$ sf hardis:org:diagnose:releaseupdates"
6405
+ "$ sf hardis:org:diagnose:unused-apex-classes",
6406
+ "$ sf hardis:org:diagnose:unused-apex-classes --days 700"
6427
6407
  ],
6428
6408
  "flags": {
6429
6409
  "json": {
@@ -6449,6 +6429,14 @@
6449
6429
  "multiple": false,
6450
6430
  "type": "option"
6451
6431
  },
6432
+ "days": {
6433
+ "char": "t",
6434
+ "description": "Extracts the users that have been inactive for the amount of days specified. In CI, default is 180 days",
6435
+ "name": "days",
6436
+ "hasDynamicHelp": false,
6437
+ "multiple": false,
6438
+ "type": "option"
6439
+ },
6452
6440
  "debug": {
6453
6441
  "char": "d",
6454
6442
  "description": "Activate debug mode (more logs)",
@@ -6487,13 +6475,13 @@
6487
6475
  },
6488
6476
  "hasDynamicHelp": true,
6489
6477
  "hiddenAliases": [],
6490
- "id": "hardis:org:diagnose:releaseupdates",
6478
+ "id": "hardis:org:diagnose:unused-apex-classes",
6491
6479
  "pluginAlias": "sfdx-hardis",
6492
6480
  "pluginName": "sfdx-hardis",
6493
6481
  "pluginType": "core",
6494
6482
  "strict": true,
6495
6483
  "enableJsonFlag": true,
6496
- "title": "Check Release Updates of an org",
6484
+ "title": "Detect unused Apex classes in an org",
6497
6485
  "requiresProject": false,
6498
6486
  "isESM": true,
6499
6487
  "relativePath": [
@@ -6502,56 +6490,51 @@
6502
6490
  "hardis",
6503
6491
  "org",
6504
6492
  "diagnose",
6505
- "releaseupdates.js"
6493
+ "unused-apex-classes.js"
6506
6494
  ],
6507
6495
  "aliasPermutations": [],
6508
6496
  "permutations": [
6509
- "hardis:org:diagnose:releaseupdates",
6510
- "org:hardis:diagnose:releaseupdates",
6511
- "org:diagnose:hardis:releaseupdates",
6512
- "org:diagnose:releaseupdates:hardis",
6513
- "hardis:diagnose:org:releaseupdates",
6514
- "diagnose:hardis:org:releaseupdates",
6515
- "diagnose:org:hardis:releaseupdates",
6516
- "diagnose:org:releaseupdates:hardis",
6517
- "hardis:diagnose:releaseupdates:org",
6518
- "diagnose:hardis:releaseupdates:org",
6519
- "diagnose:releaseupdates:hardis:org",
6520
- "diagnose:releaseupdates:org:hardis",
6521
- "hardis:org:releaseupdates:diagnose",
6522
- "org:hardis:releaseupdates:diagnose",
6523
- "org:releaseupdates:hardis:diagnose",
6524
- "org:releaseupdates:diagnose:hardis",
6525
- "hardis:releaseupdates:org:diagnose",
6526
- "releaseupdates:hardis:org:diagnose",
6527
- "releaseupdates:org:hardis:diagnose",
6528
- "releaseupdates:org:diagnose:hardis",
6529
- "hardis:releaseupdates:diagnose:org",
6530
- "releaseupdates:hardis:diagnose:org",
6531
- "releaseupdates:diagnose:hardis:org",
6532
- "releaseupdates:diagnose:org:hardis"
6533
- ]
6534
- },
6535
- "hardis:org:diagnose:storage-stats": {
6536
- "aliases": [],
6537
- "args": {},
6538
- "description": "**Extracts and analyzes Data Storage usage for a Salesforce org, providing detailed per-object breakdowns with flexible grouping options.**\n\nThis command provides a comprehensive overview of your Salesforce data storage consumption. It's particularly useful for:\n\n- **Storage Management:** Understanding which SObjects consume the most storage and how usage has evolved over time.\n- **Cost Optimization:** Identifying storage-heavy objects that could be candidates for data archival or cleanup strategies.\n- **Capacity Planning:** Tracking storage trends to predict when additional capacity will be needed.\n- **Compliance & Governance:** Monitoring data growth patterns to ensure alignment with data retention policies.\n\nKey functionalities:\n\n- **Storage Limits Analysis:** Retrieves and displays org data storage limits, including total capacity, used storage, remaining storage, and percentage used. Detects and alerts on over-usage scenarios.\n- **SObject Discovery & Filtering:** Automatically discovers all SObjects in the org and filters them to focus on production/custom objects (excludes metadata types, platform-only objects, and cached empty objects).\n- **Interactive Selection:** Prompts the user to select which SObjects to analyze and choose breakdown fields (date fields, RecordType, custom fields, or relationship fields).\n- **Flexible Breakdown Field:** Supports grouping by any field including:\n - Date/DateTime fields (`CreatedDate`, `LastModifiedDate`, custom date fields)\n - RecordType (`RecordType.Name`)\n - Custom fields (`Status__c`, picklists, text fields)\n - Nested relationship fields (`SBQQ__Quote__r.RecordType.Name`)\n- **Date Granularity Options:** For date/datetime fields, choose between:\n - Year-based grouping (`CALENDAR_YEAR`)\n - Month-based grouping (`CALENDAR_MONTH`)\n - Day-based grouping (exact date)\n- **WHERE Clause Filtering:** Apply SOQL WHERE conditions to filter records before calculating storage (e.g., only active records, records from the last year).\n- **Storage Estimation:** Estimates storage usage for each object using an average record size heuristic (2 KB per record) and calculates the percentage of org quota consumed.\n- **Dual CSV Reports:** Generates two CSV files: a detailed breakdown by selected field and a totals-per-object summary, both suitable for spreadsheet analysis and reporting.\n- **Empty Objects Cache:** Maintains a per-user cache of objects detected with zero records to optimize subsequent runs by skipping empty tables.\n- **Progress Tracking:** Sends WebSocket progress messages for integration with external UIs and monitoring dashboards.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Limits Retrieval:** Calls `conn.limits()` to retrieve the `DataStorageMB` object containing `Max` and `Remaining` values. Handles negative `Remaining` values (over-usage scenarios) by calculating `overUsageMB` and adjusting display values.\n- **SObject Discovery:** Uses `conn.metadata.list([{ type: 'CustomObject' }])` to get custom objects and `conn.describeGlobal()` to get all SObjects. Filters by object capabilities (`layoutable`, `queryable`, `retrieveable`, `createable`, `updateable`, `deletable`) and excludes metadata types (`__mdt` suffix) and cached empty objects.\n- **User Interaction:** Uses `prompts` for interactive multi-select of SObjects, breakdown field selection, granularity choice (for date fields), and optional WHERE conditions. All objects are pre-selected by default for user convenience.\n- **Field Validation:** Recursively validates breakdown fields including nested relationships (e.g., `SBQQ__Quote__r.RecordType.Name`) by traversing the relationship chain and checking field existence on each related object. Automatically handles special cases like `RecordType` -> `RecordTypeId` and `__r` -> `__c` conversions.\n- **Dynamic Query Generation:** Builds SOQL queries based on field type and granularity:\n - For date fields with year granularity: `SELECT CALENDAR_YEAR(<Field>) breakdown, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY CALENDAR_YEAR(<Field>) ORDER BY CALENDAR_YEAR(<Field>)`\n - For date fields with month granularity: `SELECT CALENDAR_YEAR(<Field>) year, CALENDAR_MONTH(<Field>) month, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY CALENDAR_YEAR(<Field>), CALENDAR_MONTH(<Field>) ORDER BY CALENDAR_YEAR(<Field>), CALENDAR_MONTH(<Field>)`\n - For non-date fields: `SELECT <Field> breakdown, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY <Field> ORDER BY <Field>`\n- **WHERE Clause Support:** Accepts user-provided WHERE conditions via flag (`--where`) or interactive prompt. Injects the condition into all SOQL queries for consistent filtering across all objects.\n- **Storage Calculation:** Applies a conservative average record size of 2 KB (2048 bytes) to estimate storage consumption. Calculates both MB usage and percentage of org quota for each object and breakdown value.\n- **Report Generation:** Uses `generateCsvFile` and `generateReportPath` helpers to create two CSV files in the reports directory:\n - Detailed breakdown: includes all statistics per breakdown value per object (e.g., by year, by month, by RecordType)\n - Totals summary: includes only aggregate totals per object\n - File naming includes breakdown field, granularity (for date fields), and `-filtered` suffix when WHERE clause is applied\n- **Caching Mechanism:** Writes a JSON cache file per authenticated username (sanitized) in the reports directory (`<username>_empty_tables_cache.json`) containing an array of empty object names. The cache is updated after each run with newly detected empty objects.\n- **Progress & UX:** Uses `WebSocketClient` to emit start/step/end progress messages for external monitoring. Outputs summary tables with `uxLogTable` and status messages with `uxLog`.\n- **Return Value:** Returns a JSON object containing `tableStorageInfos` (all rows), `tableStorageInfosTotals` (summary rows), `storageLimits` (org limits object), and `outputFiles` (paths to generated CSV/XLSX reports).\n</details>\n\n![](https://sfdx-hardis.cloudity.com/assets/images/storage-usage-year-breakdown.png)\n\n![](https://sfdx-hardis.cloudity.com/assets/images/storage-usage-total.png)\n",
6539
- "examples": [
6540
- "$ sf hardis:org:diagnose:storage-stats",
6541
- "$ sf hardis:org:diagnose:storage-stats --breakdown-field \"CreatedDate\"",
6542
- "$ sf hardis:org:diagnose:storage-stats -b \"RecordType.Name\"",
6543
- "$ sf hardis:org:diagnose:storage-stats --where \"CreatedDate = LAST_N_DAYS:365\"",
6544
- "$ sf hardis:org:diagnose:storage-stats -w \"Status__c = 'Active'\"",
6545
- "$ sf hardis:org:diagnose:storage-stats -b \"LastModifiedDate\" -w \"IsDeleted = false\""
6546
- ],
6547
- "flags": {
6548
- "json": {
6549
- "description": "Format output as json.",
6550
- "helpGroup": "GLOBAL",
6551
- "name": "json",
6552
- "allowNo": false,
6553
- "type": "boolean"
6554
- },
6497
+ "hardis:org:diagnose:unused-apex-classes",
6498
+ "org:hardis:diagnose:unused-apex-classes",
6499
+ "org:diagnose:hardis:unused-apex-classes",
6500
+ "org:diagnose:unused-apex-classes:hardis",
6501
+ "hardis:diagnose:org:unused-apex-classes",
6502
+ "diagnose:hardis:org:unused-apex-classes",
6503
+ "diagnose:org:hardis:unused-apex-classes",
6504
+ "diagnose:org:unused-apex-classes:hardis",
6505
+ "hardis:diagnose:unused-apex-classes:org",
6506
+ "diagnose:hardis:unused-apex-classes:org",
6507
+ "diagnose:unused-apex-classes:hardis:org",
6508
+ "diagnose:unused-apex-classes:org:hardis",
6509
+ "hardis:org:unused-apex-classes:diagnose",
6510
+ "org:hardis:unused-apex-classes:diagnose",
6511
+ "org:unused-apex-classes:hardis:diagnose",
6512
+ "org:unused-apex-classes:diagnose:hardis",
6513
+ "hardis:unused-apex-classes:org:diagnose",
6514
+ "unused-apex-classes:hardis:org:diagnose",
6515
+ "unused-apex-classes:org:hardis:diagnose",
6516
+ "unused-apex-classes:org:diagnose:hardis",
6517
+ "hardis:unused-apex-classes:diagnose:org",
6518
+ "unused-apex-classes:hardis:diagnose:org",
6519
+ "unused-apex-classes:diagnose:hardis:org",
6520
+ "unused-apex-classes:diagnose:org:hardis"
6521
+ ]
6522
+ },
6523
+ "hardis:org:diagnose:unused-connected-apps": {
6524
+ "aliases": [],
6525
+ "args": {},
6526
+ "description": "\n## Command Behavior\n\n**Identifies and reports on potentially unused Connected Apps in a Salesforce org, suggesting candidates for deletion or deactivation.**\n\nThis command helps improve org security and reduce technical debt by pinpointing Connected Apps that are no longer actively used. Connected Apps can pose security risks if left unmonitored, and cleaning them up contributes to a healthier Salesforce environment.\n\nKey functionalities:\n\n- **Connected App Data Collection:** Gathers information about all Connected Apps in the org, including creation and last modified dates, and associated users.\n- **Usage Analysis:** Analyzes `LoginHistory` and `OAuthToken` records to determine the last usage date of each Connected App.\n- **Inactivity Detection:** Flags Connected Apps as potentially unused if they have no recent login history or OAuth token usage.\n- **Accessibility Check:** Examines Connected App metadata to identify if they are accessible (e.g., if they require admin approval and have no profiles or permission sets assigned).\n- **Ignored Apps:** Automatically ignores a predefined list of common Salesforce Connected Apps (e.g., `Salesforce CLI`, `Salesforce Mobile Dashboards`). You can extend this list by defining the `ALLOWED_INACTIVE_CONNECTED_APPS` environment variable.\n- **CSV Report Generation:** Generates a CSV file containing details of all analyzed Connected Apps, including their usage status, last usage date, and reasons for being flagged as potentially unused.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of potentially unused Connected Apps.\n\n**Default Ignored Connected Apps:**\n\n- Ant Migration Tool\n- Chatter Desktop\n- Chatter Mobile for BlackBerry\n- Force.com IDE\n- OIQ_Integration\n- Salesforce CLI\n- Salesforce Files\n- Salesforce Mobile Dashboards\n- Salesforce Touch\n- Salesforce for Outlook\n- SalesforceA\n- SalesforceA for Android\n- SalesforceA for iOS\n- SalesforceDX Namespace Registry\n- SalesforceIQ\n\nYou can add more ignored apps by defining a comma-separated list of names in the `ALLOWED_INACTIVE_CONNECTED_APPS` environment variable.\n\n_Example: \nALLOWED_INACTIVE_CONNECTED_APPS=My App 1,My App 2, My App 3_\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-connected-apps/) 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- **Salesforce SOQL Queries:** It performs SOQL queries against `ConnectedApplication`, `LoginHistory`, and `OAuthToken` objects to gather comprehensive data about Connected Apps and their usage.\n- **Temporary SFDX Project:** It creates a temporary SFDX project to retrieve Connected App metadata, allowing for local parsing and analysis of their XML files.\n- **Metadata Parsing:** It parses the `connectedApp-meta.xml` files to check for `isAdminApproved` and the presence of `profileName` or `permissionsetName` to determine accessibility.\n- **Data Correlation:** It correlates data from various Salesforce objects to build a complete picture of each Connected App's usage and status.\n- **Date Calculation:** Uses `moment` to calculate the time since the last OAuth token usage.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of unused Connected Apps.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **File System Operations:** Uses `fs-extra` for creating and removing temporary directories and files.\n- **Environment Variable Reading:** Reads the `ALLOWED_INACTIVE_CONNECTED_APPS` environment variable to customize the list of ignored Connected Apps.\n</details>\n",
6527
+ "examples": [
6528
+ "$ sf hardis:org:diagnose:unused-connected-apps"
6529
+ ],
6530
+ "flags": {
6531
+ "json": {
6532
+ "description": "Format output as json.",
6533
+ "helpGroup": "GLOBAL",
6534
+ "name": "json",
6535
+ "allowNo": false,
6536
+ "type": "boolean"
6537
+ },
6555
6538
  "flags-dir": {
6556
6539
  "helpGroup": "GLOBAL",
6557
6540
  "name": "flags-dir",
@@ -6568,22 +6551,6 @@
6568
6551
  "multiple": false,
6569
6552
  "type": "option"
6570
6553
  },
6571
- "breakdown-field": {
6572
- "char": "b",
6573
- "description": "Field to use for storage stats breakdown. Example: \"CreatedDate\", \"LastModifiedDate\", \"RecordType.Name\", or custom fields like \"Status__c\"",
6574
- "name": "breakdown-field",
6575
- "hasDynamicHelp": false,
6576
- "multiple": false,
6577
- "type": "option"
6578
- },
6579
- "where": {
6580
- "char": "w",
6581
- "description": "WHERE clause to filter records in the query (without the WHERE keyword). Example: \"CreatedDate = LAST_N_DAYS:365\" or \"Status__c = 'Active'\"",
6582
- "name": "where",
6583
- "hasDynamicHelp": false,
6584
- "multiple": false,
6585
- "type": "option"
6586
- },
6587
6554
  "debug": {
6588
6555
  "char": "d",
6589
6556
  "description": "Activate debug mode (more logs)",
@@ -6622,14 +6589,31 @@
6622
6589
  },
6623
6590
  "hasDynamicHelp": true,
6624
6591
  "hiddenAliases": [],
6625
- "id": "hardis:org:diagnose:storage-stats",
6592
+ "id": "hardis:org:diagnose:unused-connected-apps",
6626
6593
  "pluginAlias": "sfdx-hardis",
6627
6594
  "pluginName": "sfdx-hardis",
6628
6595
  "pluginType": "core",
6629
6596
  "strict": true,
6630
6597
  "enableJsonFlag": true,
6631
- "title": "Extract Data Storage stats",
6632
- "requiresProject": true,
6598
+ "title": "Unused Connected Apps in an org",
6599
+ "allowedInactiveConnectedApps": [
6600
+ "Ant Migration Tool",
6601
+ "Chatter Desktop",
6602
+ "Chatter Mobile for BlackBerry",
6603
+ "Force.com IDE",
6604
+ "OIQ_Integration",
6605
+ "Salesforce CLI",
6606
+ "Salesforce Files",
6607
+ "Salesforce Mobile Dashboards",
6608
+ "Salesforce Touch",
6609
+ "Salesforce for Outlook",
6610
+ "SalesforceA",
6611
+ "SalesforceA for Android",
6612
+ "SalesforceA for iOS",
6613
+ "SalesforceDX Namespace Registry",
6614
+ "SalesforceIQ"
6615
+ ],
6616
+ "requiresProject": false,
6633
6617
  "isESM": true,
6634
6618
  "relativePath": [
6635
6619
  "lib",
@@ -6637,42 +6621,43 @@
6637
6621
  "hardis",
6638
6622
  "org",
6639
6623
  "diagnose",
6640
- "storage-stats.js"
6624
+ "unused-connected-apps.js"
6641
6625
  ],
6642
6626
  "aliasPermutations": [],
6643
6627
  "permutations": [
6644
- "hardis:org:diagnose:storage-stats",
6645
- "org:hardis:diagnose:storage-stats",
6646
- "org:diagnose:hardis:storage-stats",
6647
- "org:diagnose:storage-stats:hardis",
6648
- "hardis:diagnose:org:storage-stats",
6649
- "diagnose:hardis:org:storage-stats",
6650
- "diagnose:org:hardis:storage-stats",
6651
- "diagnose:org:storage-stats:hardis",
6652
- "hardis:diagnose:storage-stats:org",
6653
- "diagnose:hardis:storage-stats:org",
6654
- "diagnose:storage-stats:hardis:org",
6655
- "diagnose:storage-stats:org:hardis",
6656
- "hardis:org:storage-stats:diagnose",
6657
- "org:hardis:storage-stats:diagnose",
6658
- "org:storage-stats:hardis:diagnose",
6659
- "org:storage-stats:diagnose:hardis",
6660
- "hardis:storage-stats:org:diagnose",
6661
- "storage-stats:hardis:org:diagnose",
6662
- "storage-stats:org:hardis:diagnose",
6663
- "storage-stats:org:diagnose:hardis",
6664
- "hardis:storage-stats:diagnose:org",
6665
- "storage-stats:hardis:diagnose:org",
6666
- "storage-stats:diagnose:hardis:org",
6667
- "storage-stats:diagnose:org:hardis"
6628
+ "hardis:org:diagnose:unused-connected-apps",
6629
+ "org:hardis:diagnose:unused-connected-apps",
6630
+ "org:diagnose:hardis:unused-connected-apps",
6631
+ "org:diagnose:unused-connected-apps:hardis",
6632
+ "hardis:diagnose:org:unused-connected-apps",
6633
+ "diagnose:hardis:org:unused-connected-apps",
6634
+ "diagnose:org:hardis:unused-connected-apps",
6635
+ "diagnose:org:unused-connected-apps:hardis",
6636
+ "hardis:diagnose:unused-connected-apps:org",
6637
+ "diagnose:hardis:unused-connected-apps:org",
6638
+ "diagnose:unused-connected-apps:hardis:org",
6639
+ "diagnose:unused-connected-apps:org:hardis",
6640
+ "hardis:org:unused-connected-apps:diagnose",
6641
+ "org:hardis:unused-connected-apps:diagnose",
6642
+ "org:unused-connected-apps:hardis:diagnose",
6643
+ "org:unused-connected-apps:diagnose:hardis",
6644
+ "hardis:unused-connected-apps:org:diagnose",
6645
+ "unused-connected-apps:hardis:org:diagnose",
6646
+ "unused-connected-apps:org:hardis:diagnose",
6647
+ "unused-connected-apps:org:diagnose:hardis",
6648
+ "hardis:unused-connected-apps:diagnose:org",
6649
+ "unused-connected-apps:hardis:diagnose:org",
6650
+ "unused-connected-apps:diagnose:hardis:org",
6651
+ "unused-connected-apps:diagnose:org:hardis"
6668
6652
  ]
6669
6653
  },
6670
- "hardis:org:diagnose:unsecure-connected-apps": {
6654
+ "hardis:org:diagnose:unusedlicenses": {
6671
6655
  "aliases": [],
6672
6656
  "args": {},
6673
- "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",
6657
+ "description": "\n## Command Behavior\n\n**Detects and suggests the deletion of unused Permission Set License Assignments in a Salesforce org.**\n\nWhen a Permission Set (PS) linked to a Permission Set License (PSL) is assigned to a user, a Permission Set License Assignment (PSLA) is automatically created. However, when that PS is unassigned from the user, the PSLA is *not* automatically deleted. This can lead to organizations being charged for unused PSLAs, representing a hidden cost and technical debt.\n\nThis command identifies such useless PSLAs and provides options to delete them, helping to optimize license usage and reduce unnecessary expenses.\n\nKey functionalities:\n\n- **PSLA Detection:** Queries the Salesforce org to find all active PSLAs.\n- **Usage Verification:** Correlates PSLAs with actual Permission Set Assignments and Permission Set Group Assignments to determine if the underlying Permission Sets are still assigned to the user.\n- **Special Case Handling:** Accounts for specific scenarios where profiles might implicitly assign PSLAs (e.g., `Salesforce API Only` profile assigning `SalesforceAPIIntegrationPsl`) and allows for always excluding certain PSLAs from the unused check.\n- **Reporting:** Generates a CSV report of all identified unused PSLAs, including the user and the associated Permission Set License.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of unused PSLAs.\n- **Interactive Deletion:** In non-CI environments, it offers an interactive prompt to bulk delete the identified unused PSLAs.\n\nMany thanks to [Vincent Finet](https://www.linkedin.com/in/vincentfinet/) for the inspiration during his great speaker session at [French Touch Dreamin '23](https://frenchtouchdreamin.com/), and his kind agreement for reusing such inspiration in this command 😊\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-licenses/) 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 extensive querying of Salesforce objects and data correlation:\n\n- **SOQL Queries (Bulk API):** It uses `bulkQuery` and `bulkQueryChunksIn` to efficiently retrieve large volumes of data from `PermissionSetLicenseAssign`, `PermissionSetLicense`, `PermissionSet`, `PermissionSetGroupComponent`, and `PermissionSetAssignment` objects.\n- **Data Correlation:** It meticulously correlates data across these objects to determine if a `PermissionSetLicenseAssign` record has a corresponding active assignment to a Permission Set or Permission Set Group for the same user.\n- **Filtering Logic:** It applies complex filtering logic to exclude PSLAs that are genuinely in use or are part of predefined exceptions (e.g., `alwaysExcludeForActiveUsersPermissionSetLicenses`).\n- **Bulk Deletion:** If the user opts to delete unused PSLAs, it uses `bulkUpdate` with the `delete` operation to efficiently remove multiple records.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of unused PSLAs.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **User Interaction:** Uses `prompts` for interactive confirmation before performing deletion operations.\n</details>\n",
6674
6658
  "examples": [
6675
- "$ sf hardis:org:diagnose:unsecure-connected-apps"
6659
+ "$ sf hardis:org:diagnose:unusedlicenses",
6660
+ "$ sf hardis:org:diagnose:unusedlicenses --fix"
6676
6661
  ],
6677
6662
  "flags": {
6678
6663
  "json": {
@@ -6736,14 +6721,32 @@
6736
6721
  },
6737
6722
  "hasDynamicHelp": true,
6738
6723
  "hiddenAliases": [],
6739
- "id": "hardis:org:diagnose:unsecure-connected-apps",
6724
+ "id": "hardis:org:diagnose:unusedlicenses",
6740
6725
  "pluginAlias": "sfdx-hardis",
6741
6726
  "pluginName": "sfdx-hardis",
6742
6727
  "pluginType": "core",
6743
6728
  "strict": true,
6744
6729
  "enableJsonFlag": true,
6745
- "title": "Detect Unsecured Connected Apps",
6730
+ "title": "Detect unused Permission Set Licenses (beta)",
6746
6731
  "requiresProject": false,
6732
+ "additionalPermissionSetsToAlwaysGet": [
6733
+ "Sales_User"
6734
+ ],
6735
+ "permSetsPermSetLicenses": [
6736
+ {
6737
+ "permSet": "Sales_User",
6738
+ "permSetLicense": "SalesUserPsl"
6739
+ }
6740
+ ],
6741
+ "profilesPermissionSetLicenses": [
6742
+ {
6743
+ "profile": "Salesforce API Only",
6744
+ "permSetLicense": "SalesforceAPIIntegrationPsl"
6745
+ }
6746
+ ],
6747
+ "alwaysExcludeForActiveUsersPermissionSetLicenses": [
6748
+ "IdentityConnect"
6749
+ ],
6747
6750
  "isESM": true,
6748
6751
  "relativePath": [
6749
6752
  "lib",
@@ -6751,43 +6754,46 @@
6751
6754
  "hardis",
6752
6755
  "org",
6753
6756
  "diagnose",
6754
- "unsecure-connected-apps.js"
6757
+ "unusedlicenses.js"
6755
6758
  ],
6756
6759
  "aliasPermutations": [],
6757
6760
  "permutations": [
6758
- "hardis:org:diagnose:unsecure-connected-apps",
6759
- "org:hardis:diagnose:unsecure-connected-apps",
6760
- "org:diagnose:hardis:unsecure-connected-apps",
6761
- "org:diagnose:unsecure-connected-apps:hardis",
6762
- "hardis:diagnose:org:unsecure-connected-apps",
6763
- "diagnose:hardis:org:unsecure-connected-apps",
6764
- "diagnose:org:hardis:unsecure-connected-apps",
6765
- "diagnose:org:unsecure-connected-apps:hardis",
6766
- "hardis:diagnose:unsecure-connected-apps:org",
6767
- "diagnose:hardis:unsecure-connected-apps:org",
6768
- "diagnose:unsecure-connected-apps:hardis:org",
6769
- "diagnose:unsecure-connected-apps:org:hardis",
6770
- "hardis:org:unsecure-connected-apps:diagnose",
6771
- "org:hardis:unsecure-connected-apps:diagnose",
6772
- "org:unsecure-connected-apps:hardis:diagnose",
6773
- "org:unsecure-connected-apps:diagnose:hardis",
6774
- "hardis:unsecure-connected-apps:org:diagnose",
6775
- "unsecure-connected-apps:hardis:org:diagnose",
6776
- "unsecure-connected-apps:org:hardis:diagnose",
6777
- "unsecure-connected-apps:org:diagnose:hardis",
6778
- "hardis:unsecure-connected-apps:diagnose:org",
6779
- "unsecure-connected-apps:hardis:diagnose:org",
6780
- "unsecure-connected-apps:diagnose:hardis:org",
6781
- "unsecure-connected-apps:diagnose:org:hardis"
6761
+ "hardis:org:diagnose:unusedlicenses",
6762
+ "org:hardis:diagnose:unusedlicenses",
6763
+ "org:diagnose:hardis:unusedlicenses",
6764
+ "org:diagnose:unusedlicenses:hardis",
6765
+ "hardis:diagnose:org:unusedlicenses",
6766
+ "diagnose:hardis:org:unusedlicenses",
6767
+ "diagnose:org:hardis:unusedlicenses",
6768
+ "diagnose:org:unusedlicenses:hardis",
6769
+ "hardis:diagnose:unusedlicenses:org",
6770
+ "diagnose:hardis:unusedlicenses:org",
6771
+ "diagnose:unusedlicenses:hardis:org",
6772
+ "diagnose:unusedlicenses:org:hardis",
6773
+ "hardis:org:unusedlicenses:diagnose",
6774
+ "org:hardis:unusedlicenses:diagnose",
6775
+ "org:unusedlicenses:hardis:diagnose",
6776
+ "org:unusedlicenses:diagnose:hardis",
6777
+ "hardis:unusedlicenses:org:diagnose",
6778
+ "unusedlicenses:hardis:org:diagnose",
6779
+ "unusedlicenses:org:hardis:diagnose",
6780
+ "unusedlicenses:org:diagnose:hardis",
6781
+ "hardis:unusedlicenses:diagnose:org",
6782
+ "unusedlicenses:hardis:diagnose:org",
6783
+ "unusedlicenses:diagnose:hardis:org",
6784
+ "unusedlicenses:diagnose:org:hardis"
6782
6785
  ]
6783
6786
  },
6784
- "hardis:org:diagnose:unused-apex-classes": {
6787
+ "hardis:org:diagnose:unusedusers": {
6785
6788
  "aliases": [],
6786
6789
  "args": {},
6787
- "description": "List all async Apex classes (Batch,Queueable,Schedulable) that has not been called for more than 365 days.\n \nThe result class list probably can be removed from the project, and that will improve your test classes performances 😊\n\nThe number of unused day is overridable using --days option. \n\nThe command uses queries on AsyncApexJob and CronTrigger technical tables to build the result.\n\nApex Classes CreatedBy and CreatedOn fields are calculated from MIN(date from git, date from org)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-apex-classes/) and can output Grafana, Slack and MsTeams Notifications.\n\n![](https://sfdx-hardis.cloudity.com/assets/images/screenshot-monitoring-unused-apex-grafana.jpg)\n",
6790
+ "description": "\n## Command Behavior\n\n**Detects and reports on inactive or unused Salesforce user accounts, helping to optimize license usage and enhance security.**\n\nEfficient user management is vital in Salesforce to ensure resources are optimized and costs are controlled. However, inactive or unused user accounts can often go unnoticed, leading to wasted licenses and potential security risks. This tool addresses this challenge by enabling administrators to identify users who haven't logged in within a specified period.\n\nBy analyzing user login activity and last login timestamps, this feature highlights inactive user accounts, allowing administrators to take appropriate action. Whether it's deactivating dormant accounts, freeing up licenses, or ensuring compliance with security policies, this functionality empowers administrators to maintain a lean and secure Salesforce environment.\n\nKey functionalities:\n\n- **Inactivity Detection:** Identifies users who have not logged in for a specified number of days (`--days` flag, default 180 days in CI, 365 days otherwise).\n- **License Type Filtering:** Allows filtering users by license type using `--licensetypes` (e.g., `all-crm`, `all-paying`) or specific license identifiers using `--licenseidentifiers`.\n - `all-crm`: Includes `SFDC`, `AUL`, `AUL1`, `AULL_IGHT` licenses.\n - `all-paying`: Includes `SFDC`, `AUL`, `AUL1`, `AULL_IGHT`, `PID_Customer_Community`, `PID_Customer_Community_Login`, `PID_Partner_Community`, `PID_Partner_Community_Login` licenses.\n - Note: You can see the full list of available license identifiers in [Salesforce Documentation](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/sfdx_cli_reference/sforce_api_objects_userlicense.htm).\n- **Active User Retrieval:** The `--returnactiveusers` flag inverts the command, allowing you to retrieve active users who *have* logged in during the specified period.\n- **CSV Report Generation:** Generates a CSV file containing details of all identified users (inactive or active), including their last login date, profile, and license information.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of inactive or active users.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-inactive-users/) 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 (Bulk API):** It uses `bulkQuery` to efficiently retrieve user records from the Salesforce `User` object. The SOQL query dynamically constructs its WHERE clause based on the `--days`, `--licensetypes`, `--licenseidentifiers`, and `--returnactiveusers` flags.\n- **Interactive Prompts:** Uses `prompts` to interactively ask the user for the number of inactive days and license types if not provided via flags.\n- **License Mapping:** Internally maps common license type aliases (e.g., `all-crm`) to their corresponding Salesforce `LicenseDefinitionKey` values.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of users.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **User Feedback:** Provides a summary of the findings in the console, indicating the number of inactive or active users found.\n</details>",
6788
6791
  "examples": [
6789
- "$ sf hardis:org:diagnose:unused-apex-classes",
6790
- "$ sf hardis:org:diagnose:unused-apex-classes --days 700"
6792
+ "$ sf hardis:org:diagnose:unusedusers",
6793
+ "$ sf hardis:org:diagnose:unusedusers --days 365",
6794
+ "$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm",
6795
+ "$ sf hardis:org:diagnose:unusedusers --days 60 --licenseidentifiers SFDC,AUL,AUL1",
6796
+ "$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm --returnactiveusers"
6791
6797
  ],
6792
6798
  "flags": {
6793
6799
  "json": {
@@ -6821,6 +6827,33 @@
6821
6827
  "multiple": false,
6822
6828
  "type": "option"
6823
6829
  },
6830
+ "licensetypes": {
6831
+ "char": "l",
6832
+ "description": "Type of licenses to check. If set, do not use licenseidentifiers option. In CI, default is all-crm",
6833
+ "name": "licensetypes",
6834
+ "hasDynamicHelp": false,
6835
+ "multiple": false,
6836
+ "options": [
6837
+ "all",
6838
+ "all-crm",
6839
+ "all-paying"
6840
+ ],
6841
+ "type": "option"
6842
+ },
6843
+ "licenseidentifiers": {
6844
+ "char": "i",
6845
+ "description": "Comma-separated list of license identifiers, in case licensetypes is not used.. Identifiers available at https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userlicense.htm",
6846
+ "name": "licenseidentifiers",
6847
+ "hasDynamicHelp": false,
6848
+ "multiple": false,
6849
+ "type": "option"
6850
+ },
6851
+ "returnactiveusers": {
6852
+ "description": "Inverts the command by returning the active users",
6853
+ "name": "returnactiveusers",
6854
+ "allowNo": false,
6855
+ "type": "boolean"
6856
+ },
6824
6857
  "debug": {
6825
6858
  "char": "d",
6826
6859
  "description": "Activate debug mode (more logs)",
@@ -6859,13 +6892,13 @@
6859
6892
  },
6860
6893
  "hasDynamicHelp": true,
6861
6894
  "hiddenAliases": [],
6862
- "id": "hardis:org:diagnose:unused-apex-classes",
6895
+ "id": "hardis:org:diagnose:unusedusers",
6863
6896
  "pluginAlias": "sfdx-hardis",
6864
6897
  "pluginName": "sfdx-hardis",
6865
6898
  "pluginType": "core",
6866
6899
  "strict": true,
6867
6900
  "enableJsonFlag": true,
6868
- "title": "Detect unused Apex classes in an org",
6901
+ "title": "Detect unused Users in Salesforce",
6869
6902
  "requiresProject": false,
6870
6903
  "isESM": true,
6871
6904
  "relativePath": [
@@ -6874,42 +6907,42 @@
6874
6907
  "hardis",
6875
6908
  "org",
6876
6909
  "diagnose",
6877
- "unused-apex-classes.js"
6910
+ "unusedusers.js"
6878
6911
  ],
6879
6912
  "aliasPermutations": [],
6880
6913
  "permutations": [
6881
- "hardis:org:diagnose:unused-apex-classes",
6882
- "org:hardis:diagnose:unused-apex-classes",
6883
- "org:diagnose:hardis:unused-apex-classes",
6884
- "org:diagnose:unused-apex-classes:hardis",
6885
- "hardis:diagnose:org:unused-apex-classes",
6886
- "diagnose:hardis:org:unused-apex-classes",
6887
- "diagnose:org:hardis:unused-apex-classes",
6888
- "diagnose:org:unused-apex-classes:hardis",
6889
- "hardis:diagnose:unused-apex-classes:org",
6890
- "diagnose:hardis:unused-apex-classes:org",
6891
- "diagnose:unused-apex-classes:hardis:org",
6892
- "diagnose:unused-apex-classes:org:hardis",
6893
- "hardis:org:unused-apex-classes:diagnose",
6894
- "org:hardis:unused-apex-classes:diagnose",
6895
- "org:unused-apex-classes:hardis:diagnose",
6896
- "org:unused-apex-classes:diagnose:hardis",
6897
- "hardis:unused-apex-classes:org:diagnose",
6898
- "unused-apex-classes:hardis:org:diagnose",
6899
- "unused-apex-classes:org:hardis:diagnose",
6900
- "unused-apex-classes:org:diagnose:hardis",
6901
- "hardis:unused-apex-classes:diagnose:org",
6902
- "unused-apex-classes:hardis:diagnose:org",
6903
- "unused-apex-classes:diagnose:hardis:org",
6904
- "unused-apex-classes:diagnose:org:hardis"
6914
+ "hardis:org:diagnose:unusedusers",
6915
+ "org:hardis:diagnose:unusedusers",
6916
+ "org:diagnose:hardis:unusedusers",
6917
+ "org:diagnose:unusedusers:hardis",
6918
+ "hardis:diagnose:org:unusedusers",
6919
+ "diagnose:hardis:org:unusedusers",
6920
+ "diagnose:org:hardis:unusedusers",
6921
+ "diagnose:org:unusedusers:hardis",
6922
+ "hardis:diagnose:unusedusers:org",
6923
+ "diagnose:hardis:unusedusers:org",
6924
+ "diagnose:unusedusers:hardis:org",
6925
+ "diagnose:unusedusers:org:hardis",
6926
+ "hardis:org:unusedusers:diagnose",
6927
+ "org:hardis:unusedusers:diagnose",
6928
+ "org:unusedusers:hardis:diagnose",
6929
+ "org:unusedusers:diagnose:hardis",
6930
+ "hardis:unusedusers:org:diagnose",
6931
+ "unusedusers:hardis:org:diagnose",
6932
+ "unusedusers:org:hardis:diagnose",
6933
+ "unusedusers:org:diagnose:hardis",
6934
+ "hardis:unusedusers:diagnose:org",
6935
+ "unusedusers:hardis:diagnose:org",
6936
+ "unusedusers:diagnose:hardis:org",
6937
+ "unusedusers:diagnose:org:hardis"
6905
6938
  ]
6906
6939
  },
6907
- "hardis:org:diagnose:unused-connected-apps": {
6940
+ "hardis:org:files:export": {
6908
6941
  "aliases": [],
6909
6942
  "args": {},
6910
- "description": "\n## Command Behavior\n\n**Identifies and reports on potentially unused Connected Apps in a Salesforce org, suggesting candidates for deletion or deactivation.**\n\nThis command helps improve org security and reduce technical debt by pinpointing Connected Apps that are no longer actively used. Connected Apps can pose security risks if left unmonitored, and cleaning them up contributes to a healthier Salesforce environment.\n\nKey functionalities:\n\n- **Connected App Data Collection:** Gathers information about all Connected Apps in the org, including creation and last modified dates, and associated users.\n- **Usage Analysis:** Analyzes `LoginHistory` and `OAuthToken` records to determine the last usage date of each Connected App.\n- **Inactivity Detection:** Flags Connected Apps as potentially unused if they have no recent login history or OAuth token usage.\n- **Accessibility Check:** Examines Connected App metadata to identify if they are accessible (e.g., if they require admin approval and have no profiles or permission sets assigned).\n- **Ignored Apps:** Automatically ignores a predefined list of common Salesforce Connected Apps (e.g., `Salesforce CLI`, `Salesforce Mobile Dashboards`). You can extend this list by defining the `ALLOWED_INACTIVE_CONNECTED_APPS` environment variable.\n- **CSV Report Generation:** Generates a CSV file containing details of all analyzed Connected Apps, including their usage status, last usage date, and reasons for being flagged as potentially unused.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of potentially unused Connected Apps.\n\n**Default Ignored Connected Apps:**\n\n- Ant Migration Tool\n- Chatter Desktop\n- Chatter Mobile for BlackBerry\n- Force.com IDE\n- OIQ_Integration\n- Salesforce CLI\n- Salesforce Files\n- Salesforce Mobile Dashboards\n- Salesforce Touch\n- Salesforce for Outlook\n- SalesforceA\n- SalesforceA for Android\n- SalesforceA for iOS\n- SalesforceDX Namespace Registry\n- SalesforceIQ\n\nYou can add more ignored apps by defining a comma-separated list of names in the `ALLOWED_INACTIVE_CONNECTED_APPS` environment variable.\n\n_Example: \nALLOWED_INACTIVE_CONNECTED_APPS=My App 1,My App 2, My App 3_\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-connected-apps/) 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- **Salesforce SOQL Queries:** It performs SOQL queries against `ConnectedApplication`, `LoginHistory`, and `OAuthToken` objects to gather comprehensive data about Connected Apps and their usage.\n- **Temporary SFDX Project:** It creates a temporary SFDX project to retrieve Connected App metadata, allowing for local parsing and analysis of their XML files.\n- **Metadata Parsing:** It parses the `connectedApp-meta.xml` files to check for `isAdminApproved` and the presence of `profileName` or `permissionsetName` to determine accessibility.\n- **Data Correlation:** It correlates data from various Salesforce objects to build a complete picture of each Connected App's usage and status.\n- **Date Calculation:** Uses `moment` to calculate the time since the last OAuth token usage.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of unused Connected Apps.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **File System Operations:** Uses `fs-extra` for creating and removing temporary directories and files.\n- **Environment Variable Reading:** Reads the `ALLOWED_INACTIVE_CONNECTED_APPS` environment variable to customize the list of ignored Connected Apps.\n</details>\n",
6943
+ "description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, output naming conventions, and file size filtering.\n- **File Size Filtering:** Supports minimum file size filtering via the `fileSizeMin` configuration parameter (in KB). Files smaller than the specified size will be skipped during export.\n- **File Validation:** After downloading each file, validates the integrity by:\n - **Checksum Validation:** For ContentVersion files, compares MD5 checksum with Salesforce's stored checksum\n - **Size Validation:** For both ContentVersion and Attachment files, verifies actual file size matches expected size\n - **Status Tracking:** Files are categorized with specific statuses: `success` (valid files), `failed` (download errors), `skipped` (filtered files), `invalid` (downloaded but failed validation)\n - All validation results are logged in the CSV export log for audit purposes\n- **Resume/Restart Capability:** \n - **Resume Mode:** When `--resume` flag is used (default in CI environments), checks existing downloaded files for validity. Valid files are skipped, invalid files are re-downloaded.\n - **Restart Mode:** When resume is disabled, clears the output folder and starts a fresh export.\n - **Interactive Mode:** When existing files are found and `--resume` is not explicitly specified (non-CI environments), prompts the user to choose between resume or restart.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesExporter Class:** The core logic is encapsulated within the `FilesExporter` class, which orchestrates the entire export process.\n- **SOQL Queries (Bulk API):** It uses Salesforce Bulk API queries to efficiently retrieve large volumes of parent record IDs and file metadata, including checksums and file sizes.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File Validation:** After each successful download, validates file integrity by comparing checksums (ContentVersion) and file sizes (both ContentVersion and Attachment) against Salesforce metadata.\n- **Resume Logic:** In resume mode, checks for existing files before downloading, validates their integrity, and only re-downloads invalid or missing files. This enables efficient recovery from interrupted exports.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project, `promptFilesExportConfiguration` for customizing export options, and prompts for resume/restart choice when existing files are found.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues, API limits, and file validation failures. Each file is assigned a specific status (`success`, `failed`, `skipped`, `invalid`) for comprehensive tracking and troubleshooting.\n</details>\n",
6911
6944
  "examples": [
6912
- "$ sf hardis:org:diagnose:unused-connected-apps"
6945
+ "$ sf hardis:org:files:export"
6913
6946
  ],
6914
6947
  "flags": {
6915
6948
  "json": {
@@ -6927,14 +6960,48 @@
6927
6960
  "multiple": false,
6928
6961
  "type": "option"
6929
6962
  },
6930
- "outputfile": {
6931
- "char": "f",
6932
- "description": "Force the path and name of output report file. Must end with .csv",
6933
- "name": "outputfile",
6963
+ "path": {
6964
+ "char": "p",
6965
+ "description": "Path to the file export project",
6966
+ "name": "path",
6967
+ "hasDynamicHelp": false,
6968
+ "multiple": false,
6969
+ "type": "option"
6970
+ },
6971
+ "chunksize": {
6972
+ "char": "c",
6973
+ "description": "Number of records to add in a chunk before it is processed",
6974
+ "name": "chunksize",
6975
+ "default": 1000,
6976
+ "hasDynamicHelp": false,
6977
+ "multiple": false,
6978
+ "type": "option"
6979
+ },
6980
+ "polltimeout": {
6981
+ "char": "t",
6982
+ "description": "Timeout in MS for Bulk API calls",
6983
+ "name": "polltimeout",
6984
+ "default": 300000,
6934
6985
  "hasDynamicHelp": false,
6935
6986
  "multiple": false,
6936
6987
  "type": "option"
6937
6988
  },
6989
+ "startchunknumber": {
6990
+ "char": "s",
6991
+ "description": "Chunk number to start from",
6992
+ "name": "startchunknumber",
6993
+ "default": 0,
6994
+ "hasDynamicHelp": false,
6995
+ "multiple": false,
6996
+ "type": "option"
6997
+ },
6998
+ "resume": {
6999
+ "char": "r",
7000
+ "description": "Resume previous export by checking existing files (default in CI)",
7001
+ "name": "resume",
7002
+ "allowNo": false,
7003
+ "type": "boolean"
7004
+ },
6938
7005
  "debug": {
6939
7006
  "char": "d",
6940
7007
  "description": "Activate debug mode (more logs)",
@@ -6973,30 +7040,13 @@
6973
7040
  },
6974
7041
  "hasDynamicHelp": true,
6975
7042
  "hiddenAliases": [],
6976
- "id": "hardis:org:diagnose:unused-connected-apps",
7043
+ "id": "hardis:org:files:export",
6977
7044
  "pluginAlias": "sfdx-hardis",
6978
7045
  "pluginName": "sfdx-hardis",
6979
7046
  "pluginType": "core",
6980
7047
  "strict": true,
6981
7048
  "enableJsonFlag": true,
6982
- "title": "Unused Connected Apps in an org",
6983
- "allowedInactiveConnectedApps": [
6984
- "Ant Migration Tool",
6985
- "Chatter Desktop",
6986
- "Chatter Mobile for BlackBerry",
6987
- "Force.com IDE",
6988
- "OIQ_Integration",
6989
- "Salesforce CLI",
6990
- "Salesforce Files",
6991
- "Salesforce Mobile Dashboards",
6992
- "Salesforce Touch",
6993
- "Salesforce for Outlook",
6994
- "SalesforceA",
6995
- "SalesforceA for Android",
6996
- "SalesforceA for iOS",
6997
- "SalesforceDX Namespace Registry",
6998
- "SalesforceIQ"
6999
- ],
7049
+ "title": "Export files",
7000
7050
  "requiresProject": false,
7001
7051
  "isESM": true,
7002
7052
  "relativePath": [
@@ -7004,44 +7054,43 @@
7004
7054
  "commands",
7005
7055
  "hardis",
7006
7056
  "org",
7007
- "diagnose",
7008
- "unused-connected-apps.js"
7057
+ "files",
7058
+ "export.js"
7009
7059
  ],
7010
7060
  "aliasPermutations": [],
7011
7061
  "permutations": [
7012
- "hardis:org:diagnose:unused-connected-apps",
7013
- "org:hardis:diagnose:unused-connected-apps",
7014
- "org:diagnose:hardis:unused-connected-apps",
7015
- "org:diagnose:unused-connected-apps:hardis",
7016
- "hardis:diagnose:org:unused-connected-apps",
7017
- "diagnose:hardis:org:unused-connected-apps",
7018
- "diagnose:org:hardis:unused-connected-apps",
7019
- "diagnose:org:unused-connected-apps:hardis",
7020
- "hardis:diagnose:unused-connected-apps:org",
7021
- "diagnose:hardis:unused-connected-apps:org",
7022
- "diagnose:unused-connected-apps:hardis:org",
7023
- "diagnose:unused-connected-apps:org:hardis",
7024
- "hardis:org:unused-connected-apps:diagnose",
7025
- "org:hardis:unused-connected-apps:diagnose",
7026
- "org:unused-connected-apps:hardis:diagnose",
7027
- "org:unused-connected-apps:diagnose:hardis",
7028
- "hardis:unused-connected-apps:org:diagnose",
7029
- "unused-connected-apps:hardis:org:diagnose",
7030
- "unused-connected-apps:org:hardis:diagnose",
7031
- "unused-connected-apps:org:diagnose:hardis",
7032
- "hardis:unused-connected-apps:diagnose:org",
7033
- "unused-connected-apps:hardis:diagnose:org",
7034
- "unused-connected-apps:diagnose:hardis:org",
7035
- "unused-connected-apps:diagnose:org:hardis"
7062
+ "hardis:org:files:export",
7063
+ "org:hardis:files:export",
7064
+ "org:files:hardis:export",
7065
+ "org:files:export:hardis",
7066
+ "hardis:files:org:export",
7067
+ "files:hardis:org:export",
7068
+ "files:org:hardis:export",
7069
+ "files:org:export:hardis",
7070
+ "hardis:files:export:org",
7071
+ "files:hardis:export:org",
7072
+ "files:export:hardis:org",
7073
+ "files:export:org:hardis",
7074
+ "hardis:org:export:files",
7075
+ "org:hardis:export:files",
7076
+ "org:export:hardis:files",
7077
+ "org:export:files:hardis",
7078
+ "hardis:export:org:files",
7079
+ "export:hardis:org:files",
7080
+ "export:org:hardis:files",
7081
+ "export:org:files:hardis",
7082
+ "hardis:export:files:org",
7083
+ "export:hardis:files:org",
7084
+ "export:files:hardis:org",
7085
+ "export:files:org:hardis"
7036
7086
  ]
7037
7087
  },
7038
- "hardis:org:diagnose:unusedlicenses": {
7088
+ "hardis:org:files:import": {
7039
7089
  "aliases": [],
7040
7090
  "args": {},
7041
- "description": "\n## Command Behavior\n\n**Detects and suggests the deletion of unused Permission Set License Assignments in a Salesforce org.**\n\nWhen a Permission Set (PS) linked to a Permission Set License (PSL) is assigned to a user, a Permission Set License Assignment (PSLA) is automatically created. However, when that PS is unassigned from the user, the PSLA is *not* automatically deleted. This can lead to organizations being charged for unused PSLAs, representing a hidden cost and technical debt.\n\nThis command identifies such useless PSLAs and provides options to delete them, helping to optimize license usage and reduce unnecessary expenses.\n\nKey functionalities:\n\n- **PSLA Detection:** Queries the Salesforce org to find all active PSLAs.\n- **Usage Verification:** Correlates PSLAs with actual Permission Set Assignments and Permission Set Group Assignments to determine if the underlying Permission Sets are still assigned to the user.\n- **Special Case Handling:** Accounts for specific scenarios where profiles might implicitly assign PSLAs (e.g., `Salesforce API Only` profile assigning `SalesforceAPIIntegrationPsl`) and allows for always excluding certain PSLAs from the unused check.\n- **Reporting:** Generates a CSV report of all identified unused PSLAs, including the user and the associated Permission Set License.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of unused PSLAs.\n- **Interactive Deletion:** In non-CI environments, it offers an interactive prompt to bulk delete the identified unused PSLAs.\n\nMany thanks to [Vincent Finet](https://www.linkedin.com/in/vincentfinet/) for the inspiration during his great speaker session at [French Touch Dreamin '23](https://frenchtouchdreamin.com/), and his kind agreement for reusing such inspiration in this command 😊\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-licenses/) 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 extensive querying of Salesforce objects and data correlation:\n\n- **SOQL Queries (Bulk API):** It uses `bulkQuery` and `bulkQueryChunksIn` to efficiently retrieve large volumes of data from `PermissionSetLicenseAssign`, `PermissionSetLicense`, `PermissionSet`, `PermissionSetGroupComponent`, and `PermissionSetAssignment` objects.\n- **Data Correlation:** It meticulously correlates data across these objects to determine if a `PermissionSetLicenseAssign` record has a corresponding active assignment to a Permission Set or Permission Set Group for the same user.\n- **Filtering Logic:** It applies complex filtering logic to exclude PSLAs that are genuinely in use or are part of predefined exceptions (e.g., `alwaysExcludeForActiveUsersPermissionSetLicenses`).\n- **Bulk Deletion:** If the user opts to delete unused PSLAs, it uses `bulkUpdate` with the `delete` operation to efficiently remove multiple records.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of unused PSLAs.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **User Interaction:** Uses `prompts` for interactive confirmation before performing deletion operations.\n</details>\n",
7091
+ "description": "\nThis command facilitates the mass upload of files into Salesforce, allowing you to populate records with associated documents, images, or other file types. It's a crucial tool for data migration, content seeding, or synchronizing external file repositories with Salesforce.\n\nKey functionalities:\n\n- **Configuration-Driven Import:** Relies on an `export.json` file within a designated file export project (created using `sf hardis:org:configure:files`) to determine which files to import and how they should be associated with Salesforce records.\n- **Interactive Project Selection:** If the file import project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Overwrite Option:** The `--overwrite` flag allows you to replace existing files in Salesforce with local versions that have the same name. Be aware that this option doubles the number of API calls used.\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for how to export files, which is often a prerequisite for importing:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesImporter Class:** The core logic is encapsulated within the `FilesImporter` class, which orchestrates the entire import process.\n- **File System Scan:** Scans the local file system within the configured project directory to identify files for import.\n- **Salesforce API Interaction:** Uses Salesforce APIs (e.g., ContentVersion, Attachment) to upload files and associate them with records.\n- **Configuration Loading:** Reads the `export.json` file to get the import configuration, including SOQL queries to identify parent records for file association.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file import project and `prompts` for confirming the overwrite behavior.\n- **Error Handling:** Includes mechanisms to handle potential errors during the import process, such as API limits or file upload failures.\n</details>\n",
7042
7092
  "examples": [
7043
- "$ sf hardis:org:diagnose:unusedlicenses",
7044
- "$ sf hardis:org:diagnose:unusedlicenses --fix"
7093
+ "$ sf hardis:org:files:import"
7045
7094
  ],
7046
7095
  "flags": {
7047
7096
  "json": {
@@ -7059,14 +7108,21 @@
7059
7108
  "multiple": false,
7060
7109
  "type": "option"
7061
7110
  },
7062
- "outputfile": {
7063
- "char": "f",
7064
- "description": "Force the path and name of output report file. Must end with .csv",
7065
- "name": "outputfile",
7111
+ "path": {
7112
+ "char": "p",
7113
+ "description": "Path to the file export project",
7114
+ "name": "path",
7066
7115
  "hasDynamicHelp": false,
7067
7116
  "multiple": false,
7068
7117
  "type": "option"
7069
7118
  },
7119
+ "overwrite": {
7120
+ "char": "f",
7121
+ "description": "Override existing files (doubles the number of API calls)",
7122
+ "name": "overwrite",
7123
+ "allowNo": false,
7124
+ "type": "boolean"
7125
+ },
7070
7126
  "debug": {
7071
7127
  "char": "d",
7072
7128
  "description": "Activate debug mode (more logs)",
@@ -7105,79 +7161,58 @@
7105
7161
  },
7106
7162
  "hasDynamicHelp": true,
7107
7163
  "hiddenAliases": [],
7108
- "id": "hardis:org:diagnose:unusedlicenses",
7164
+ "id": "hardis:org:files:import",
7109
7165
  "pluginAlias": "sfdx-hardis",
7110
7166
  "pluginName": "sfdx-hardis",
7111
7167
  "pluginType": "core",
7112
7168
  "strict": true,
7113
7169
  "enableJsonFlag": true,
7114
- "title": "Detect unused Permission Set Licenses (beta)",
7170
+ "title": "Import files",
7115
7171
  "requiresProject": false,
7116
- "additionalPermissionSetsToAlwaysGet": [
7117
- "Sales_User"
7118
- ],
7119
- "permSetsPermSetLicenses": [
7120
- {
7121
- "permSet": "Sales_User",
7122
- "permSetLicense": "SalesUserPsl"
7123
- }
7124
- ],
7125
- "profilesPermissionSetLicenses": [
7126
- {
7127
- "profile": "Salesforce API Only",
7128
- "permSetLicense": "SalesforceAPIIntegrationPsl"
7129
- }
7130
- ],
7131
- "alwaysExcludeForActiveUsersPermissionSetLicenses": [
7132
- "IdentityConnect"
7133
- ],
7134
7172
  "isESM": true,
7135
7173
  "relativePath": [
7136
7174
  "lib",
7137
7175
  "commands",
7138
7176
  "hardis",
7139
7177
  "org",
7140
- "diagnose",
7141
- "unusedlicenses.js"
7178
+ "files",
7179
+ "import.js"
7142
7180
  ],
7143
7181
  "aliasPermutations": [],
7144
7182
  "permutations": [
7145
- "hardis:org:diagnose:unusedlicenses",
7146
- "org:hardis:diagnose:unusedlicenses",
7147
- "org:diagnose:hardis:unusedlicenses",
7148
- "org:diagnose:unusedlicenses:hardis",
7149
- "hardis:diagnose:org:unusedlicenses",
7150
- "diagnose:hardis:org:unusedlicenses",
7151
- "diagnose:org:hardis:unusedlicenses",
7152
- "diagnose:org:unusedlicenses:hardis",
7153
- "hardis:diagnose:unusedlicenses:org",
7154
- "diagnose:hardis:unusedlicenses:org",
7155
- "diagnose:unusedlicenses:hardis:org",
7156
- "diagnose:unusedlicenses:org:hardis",
7157
- "hardis:org:unusedlicenses:diagnose",
7158
- "org:hardis:unusedlicenses:diagnose",
7159
- "org:unusedlicenses:hardis:diagnose",
7160
- "org:unusedlicenses:diagnose:hardis",
7161
- "hardis:unusedlicenses:org:diagnose",
7162
- "unusedlicenses:hardis:org:diagnose",
7163
- "unusedlicenses:org:hardis:diagnose",
7164
- "unusedlicenses:org:diagnose:hardis",
7165
- "hardis:unusedlicenses:diagnose:org",
7166
- "unusedlicenses:hardis:diagnose:org",
7167
- "unusedlicenses:diagnose:hardis:org",
7168
- "unusedlicenses:diagnose:org:hardis"
7183
+ "hardis:org:files:import",
7184
+ "org:hardis:files:import",
7185
+ "org:files:hardis:import",
7186
+ "org:files:import:hardis",
7187
+ "hardis:files:org:import",
7188
+ "files:hardis:org:import",
7189
+ "files:org:hardis:import",
7190
+ "files:org:import:hardis",
7191
+ "hardis:files:import:org",
7192
+ "files:hardis:import:org",
7193
+ "files:import:hardis:org",
7194
+ "files:import:org:hardis",
7195
+ "hardis:org:import:files",
7196
+ "org:hardis:import:files",
7197
+ "org:import:hardis:files",
7198
+ "org:import:files:hardis",
7199
+ "hardis:import:org:files",
7200
+ "import:hardis:org:files",
7201
+ "import:org:hardis:files",
7202
+ "import:org:files:hardis",
7203
+ "hardis:import:files:org",
7204
+ "import:hardis:files:org",
7205
+ "import:files:hardis:org",
7206
+ "import:files:org:hardis"
7169
7207
  ]
7170
7208
  },
7171
- "hardis:org:diagnose:unusedusers": {
7209
+ "hardis:org:fix:listviewmine": {
7172
7210
  "aliases": [],
7173
7211
  "args": {},
7174
- "description": "\n## Command Behavior\n\n**Detects and reports on inactive or unused Salesforce user accounts, helping to optimize license usage and enhance security.**\n\nEfficient user management is vital in Salesforce to ensure resources are optimized and costs are controlled. However, inactive or unused user accounts can often go unnoticed, leading to wasted licenses and potential security risks. This tool addresses this challenge by enabling administrators to identify users who haven't logged in within a specified period.\n\nBy analyzing user login activity and last login timestamps, this feature highlights inactive user accounts, allowing administrators to take appropriate action. Whether it's deactivating dormant accounts, freeing up licenses, or ensuring compliance with security policies, this functionality empowers administrators to maintain a lean and secure Salesforce environment.\n\nKey functionalities:\n\n- **Inactivity Detection:** Identifies users who have not logged in for a specified number of days (`--days` flag, default 180 days in CI, 365 days otherwise).\n- **License Type Filtering:** Allows filtering users by license type using `--licensetypes` (e.g., `all-crm`, `all-paying`) or specific license identifiers using `--licenseidentifiers`.\n - `all-crm`: Includes `SFDC`, `AUL`, `AUL1`, `AULL_IGHT` licenses.\n - `all-paying`: Includes `SFDC`, `AUL`, `AUL1`, `AULL_IGHT`, `PID_Customer_Community`, `PID_Customer_Community_Login`, `PID_Partner_Community`, `PID_Partner_Community_Login` licenses.\n - Note: You can see the full list of available license identifiers in [Salesforce Documentation](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/sfdx_cli_reference/sforce_api_objects_userlicense.htm).\n- **Active User Retrieval:** The `--returnactiveusers` flag inverts the command, allowing you to retrieve active users who *have* logged in during the specified period.\n- **CSV Report Generation:** Generates a CSV file containing details of all identified users (inactive or active), including their last login date, profile, and license information.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of inactive or active users.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-inactive-users/) 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 (Bulk API):** It uses `bulkQuery` to efficiently retrieve user records from the Salesforce `User` object. The SOQL query dynamically constructs its WHERE clause based on the `--days`, `--licensetypes`, `--licenseidentifiers`, and `--returnactiveusers` flags.\n- **Interactive Prompts:** Uses `prompts` to interactively ask the user for the number of inactive days and license types if not provided via flags.\n- **License Mapping:** Internally maps common license type aliases (e.g., `all-crm`) to their corresponding Salesforce `LicenseDefinitionKey` values.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of users.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **User Feedback:** Provides a summary of the findings in the console, indicating the number of inactive or active users found.\n</details>",
7212
+ "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",
7175
7213
  "examples": [
7176
- "$ sf hardis:org:diagnose:unusedusers",
7177
- "$ sf hardis:org:diagnose:unusedusers --days 365",
7178
- "$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm",
7179
- "$ sf hardis:org:diagnose:unusedusers --days 60 --licenseidentifiers SFDC,AUL,AUL1",
7180
- "$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm --returnactiveusers"
7214
+ "$ sf hardis:org:fix:listviewmine",
7215
+ "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
7181
7216
  ],
7182
7217
  "flags": {
7183
7218
  "json": {
@@ -7195,49 +7230,14 @@
7195
7230
  "multiple": false,
7196
7231
  "type": "option"
7197
7232
  },
7198
- "outputfile": {
7199
- "char": "f",
7200
- "description": "Force the path and name of output report file. Must end with .csv",
7201
- "name": "outputfile",
7202
- "hasDynamicHelp": false,
7203
- "multiple": false,
7204
- "type": "option"
7205
- },
7206
- "days": {
7207
- "char": "t",
7208
- "description": "Extracts the users that have been inactive for the amount of days specified. In CI, default is 180 days",
7209
- "name": "days",
7210
- "hasDynamicHelp": false,
7211
- "multiple": false,
7212
- "type": "option"
7213
- },
7214
- "licensetypes": {
7233
+ "listviews": {
7215
7234
  "char": "l",
7216
- "description": "Type of licenses to check. If set, do not use licenseidentifiers option. In CI, default is all-crm",
7217
- "name": "licensetypes",
7218
- "hasDynamicHelp": false,
7219
- "multiple": false,
7220
- "options": [
7221
- "all",
7222
- "all-crm",
7223
- "all-paying"
7224
- ],
7225
- "type": "option"
7226
- },
7227
- "licenseidentifiers": {
7228
- "char": "i",
7229
- "description": "Comma-separated list of license identifiers, in case licensetypes is not used.. Identifiers available at https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userlicense.htm",
7230
- "name": "licenseidentifiers",
7235
+ "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
7236
+ "name": "listviews",
7231
7237
  "hasDynamicHelp": false,
7232
7238
  "multiple": false,
7233
7239
  "type": "option"
7234
7240
  },
7235
- "returnactiveusers": {
7236
- "description": "Inverts the command by returning the active users",
7237
- "name": "returnactiveusers",
7238
- "allowNo": false,
7239
- "type": "boolean"
7240
- },
7241
7241
  "debug": {
7242
7242
  "char": "d",
7243
7243
  "description": "Activate debug mode (more logs)",
@@ -7276,49 +7276,49 @@
7276
7276
  },
7277
7277
  "hasDynamicHelp": true,
7278
7278
  "hiddenAliases": [],
7279
- "id": "hardis:org:diagnose:unusedusers",
7279
+ "id": "hardis:org:fix:listviewmine",
7280
7280
  "pluginAlias": "sfdx-hardis",
7281
7281
  "pluginName": "sfdx-hardis",
7282
7282
  "pluginType": "core",
7283
7283
  "strict": true,
7284
7284
  "enableJsonFlag": true,
7285
- "title": "Detect unused Users in Salesforce",
7286
- "requiresProject": false,
7285
+ "title": "Fix listviews with ",
7286
+ "requiresProject": true,
7287
7287
  "isESM": true,
7288
7288
  "relativePath": [
7289
7289
  "lib",
7290
7290
  "commands",
7291
7291
  "hardis",
7292
7292
  "org",
7293
- "diagnose",
7294
- "unusedusers.js"
7293
+ "fix",
7294
+ "listviewmine.js"
7295
7295
  ],
7296
7296
  "aliasPermutations": [],
7297
7297
  "permutations": [
7298
- "hardis:org:diagnose:unusedusers",
7299
- "org:hardis:diagnose:unusedusers",
7300
- "org:diagnose:hardis:unusedusers",
7301
- "org:diagnose:unusedusers:hardis",
7302
- "hardis:diagnose:org:unusedusers",
7303
- "diagnose:hardis:org:unusedusers",
7304
- "diagnose:org:hardis:unusedusers",
7305
- "diagnose:org:unusedusers:hardis",
7306
- "hardis:diagnose:unusedusers:org",
7307
- "diagnose:hardis:unusedusers:org",
7308
- "diagnose:unusedusers:hardis:org",
7309
- "diagnose:unusedusers:org:hardis",
7310
- "hardis:org:unusedusers:diagnose",
7311
- "org:hardis:unusedusers:diagnose",
7312
- "org:unusedusers:hardis:diagnose",
7313
- "org:unusedusers:diagnose:hardis",
7314
- "hardis:unusedusers:org:diagnose",
7315
- "unusedusers:hardis:org:diagnose",
7316
- "unusedusers:org:hardis:diagnose",
7317
- "unusedusers:org:diagnose:hardis",
7318
- "hardis:unusedusers:diagnose:org",
7319
- "unusedusers:hardis:diagnose:org",
7320
- "unusedusers:diagnose:hardis:org",
7321
- "unusedusers:diagnose:org:hardis"
7298
+ "hardis:org:fix:listviewmine",
7299
+ "org:hardis:fix:listviewmine",
7300
+ "org:fix:hardis:listviewmine",
7301
+ "org:fix:listviewmine:hardis",
7302
+ "hardis:fix:org:listviewmine",
7303
+ "fix:hardis:org:listviewmine",
7304
+ "fix:org:hardis:listviewmine",
7305
+ "fix:org:listviewmine:hardis",
7306
+ "hardis:fix:listviewmine:org",
7307
+ "fix:hardis:listviewmine:org",
7308
+ "fix:listviewmine:hardis:org",
7309
+ "fix:listviewmine:org:hardis",
7310
+ "hardis:org:listviewmine:fix",
7311
+ "org:hardis:listviewmine:fix",
7312
+ "org:listviewmine:hardis:fix",
7313
+ "org:listviewmine:fix:hardis",
7314
+ "hardis:listviewmine:org:fix",
7315
+ "listviewmine:hardis:org:fix",
7316
+ "listviewmine:org:hardis:fix",
7317
+ "listviewmine:org:fix:hardis",
7318
+ "hardis:listviewmine:fix:org",
7319
+ "listviewmine:hardis:fix:org",
7320
+ "listviewmine:fix:hardis:org",
7321
+ "listviewmine:fix:org:hardis"
7322
7322
  ]
7323
7323
  },
7324
7324
  "hardis:org:generate:packagexmlfull": {
@@ -9954,109 +9954,6 @@
9954
9954
  "auth:configure:project:hardis"
9955
9955
  ]
9956
9956
  },
9957
- "hardis:project:convert:profilestopermsets": {
9958
- "aliases": [],
9959
- "args": {},
9960
- "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",
9961
- "examples": [
9962
- "$ sf hardis:project:convert:profilestopermsets"
9963
- ],
9964
- "flags": {
9965
- "json": {
9966
- "description": "Format output as json.",
9967
- "helpGroup": "GLOBAL",
9968
- "name": "json",
9969
- "allowNo": false,
9970
- "type": "boolean"
9971
- },
9972
- "flags-dir": {
9973
- "helpGroup": "GLOBAL",
9974
- "name": "flags-dir",
9975
- "summary": "Import flag values from a directory.",
9976
- "hasDynamicHelp": false,
9977
- "multiple": false,
9978
- "type": "option"
9979
- },
9980
- "except": {
9981
- "char": "e",
9982
- "description": "List of filters",
9983
- "name": "except",
9984
- "default": [],
9985
- "hasDynamicHelp": false,
9986
- "multiple": true,
9987
- "type": "option"
9988
- },
9989
- "debug": {
9990
- "char": "d",
9991
- "description": "Activate debug mode (more logs)",
9992
- "name": "debug",
9993
- "allowNo": false,
9994
- "type": "boolean"
9995
- },
9996
- "websocket": {
9997
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9998
- "name": "websocket",
9999
- "hasDynamicHelp": false,
10000
- "multiple": false,
10001
- "type": "option"
10002
- },
10003
- "skipauth": {
10004
- "description": "Skip authentication check when a default username is required",
10005
- "name": "skipauth",
10006
- "allowNo": false,
10007
- "type": "boolean"
10008
- }
10009
- },
10010
- "hasDynamicHelp": false,
10011
- "hiddenAliases": [],
10012
- "id": "hardis:project:convert:profilestopermsets",
10013
- "pluginAlias": "sfdx-hardis",
10014
- "pluginName": "sfdx-hardis",
10015
- "pluginType": "core",
10016
- "strict": true,
10017
- "enableJsonFlag": true,
10018
- "title": "Convert Profiles into Permission Sets",
10019
- "requiresProject": true,
10020
- "requiresSfdxPlugins": [
10021
- "shane-sfdx-plugins"
10022
- ],
10023
- "isESM": true,
10024
- "relativePath": [
10025
- "lib",
10026
- "commands",
10027
- "hardis",
10028
- "project",
10029
- "convert",
10030
- "profilestopermsets.js"
10031
- ],
10032
- "aliasPermutations": [],
10033
- "permutations": [
10034
- "hardis:project:convert:profilestopermsets",
10035
- "project:hardis:convert:profilestopermsets",
10036
- "project:convert:hardis:profilestopermsets",
10037
- "project:convert:profilestopermsets:hardis",
10038
- "hardis:convert:project:profilestopermsets",
10039
- "convert:hardis:project:profilestopermsets",
10040
- "convert:project:hardis:profilestopermsets",
10041
- "convert:project:profilestopermsets:hardis",
10042
- "hardis:convert:profilestopermsets:project",
10043
- "convert:hardis:profilestopermsets:project",
10044
- "convert:profilestopermsets:hardis:project",
10045
- "convert:profilestopermsets:project:hardis",
10046
- "hardis:project:profilestopermsets:convert",
10047
- "project:hardis:profilestopermsets:convert",
10048
- "project:profilestopermsets:hardis:convert",
10049
- "project:profilestopermsets:convert:hardis",
10050
- "hardis:profilestopermsets:project:convert",
10051
- "profilestopermsets:hardis:project:convert",
10052
- "profilestopermsets:project:hardis:convert",
10053
- "profilestopermsets:project:convert:hardis",
10054
- "hardis:profilestopermsets:convert:project",
10055
- "profilestopermsets:hardis:convert:project",
10056
- "profilestopermsets:convert:hardis:project",
10057
- "profilestopermsets:convert:project:hardis"
10058
- ]
10059
- },
10060
9957
  "hardis:project:clean:emptyitems": {
10061
9958
  "aliases": [],
10062
9959
  "args": {},
@@ -11542,6 +11439,109 @@
11542
11439
  "xml:clean:project:hardis"
11543
11440
  ]
11544
11441
  },
11442
+ "hardis:project:convert:profilestopermsets": {
11443
+ "aliases": [],
11444
+ "args": {},
11445
+ "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",
11446
+ "examples": [
11447
+ "$ sf hardis:project:convert:profilestopermsets"
11448
+ ],
11449
+ "flags": {
11450
+ "json": {
11451
+ "description": "Format output as json.",
11452
+ "helpGroup": "GLOBAL",
11453
+ "name": "json",
11454
+ "allowNo": false,
11455
+ "type": "boolean"
11456
+ },
11457
+ "flags-dir": {
11458
+ "helpGroup": "GLOBAL",
11459
+ "name": "flags-dir",
11460
+ "summary": "Import flag values from a directory.",
11461
+ "hasDynamicHelp": false,
11462
+ "multiple": false,
11463
+ "type": "option"
11464
+ },
11465
+ "except": {
11466
+ "char": "e",
11467
+ "description": "List of filters",
11468
+ "name": "except",
11469
+ "default": [],
11470
+ "hasDynamicHelp": false,
11471
+ "multiple": true,
11472
+ "type": "option"
11473
+ },
11474
+ "debug": {
11475
+ "char": "d",
11476
+ "description": "Activate debug mode (more logs)",
11477
+ "name": "debug",
11478
+ "allowNo": false,
11479
+ "type": "boolean"
11480
+ },
11481
+ "websocket": {
11482
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11483
+ "name": "websocket",
11484
+ "hasDynamicHelp": false,
11485
+ "multiple": false,
11486
+ "type": "option"
11487
+ },
11488
+ "skipauth": {
11489
+ "description": "Skip authentication check when a default username is required",
11490
+ "name": "skipauth",
11491
+ "allowNo": false,
11492
+ "type": "boolean"
11493
+ }
11494
+ },
11495
+ "hasDynamicHelp": false,
11496
+ "hiddenAliases": [],
11497
+ "id": "hardis:project:convert:profilestopermsets",
11498
+ "pluginAlias": "sfdx-hardis",
11499
+ "pluginName": "sfdx-hardis",
11500
+ "pluginType": "core",
11501
+ "strict": true,
11502
+ "enableJsonFlag": true,
11503
+ "title": "Convert Profiles into Permission Sets",
11504
+ "requiresProject": true,
11505
+ "requiresSfdxPlugins": [
11506
+ "shane-sfdx-plugins"
11507
+ ],
11508
+ "isESM": true,
11509
+ "relativePath": [
11510
+ "lib",
11511
+ "commands",
11512
+ "hardis",
11513
+ "project",
11514
+ "convert",
11515
+ "profilestopermsets.js"
11516
+ ],
11517
+ "aliasPermutations": [],
11518
+ "permutations": [
11519
+ "hardis:project:convert:profilestopermsets",
11520
+ "project:hardis:convert:profilestopermsets",
11521
+ "project:convert:hardis:profilestopermsets",
11522
+ "project:convert:profilestopermsets:hardis",
11523
+ "hardis:convert:project:profilestopermsets",
11524
+ "convert:hardis:project:profilestopermsets",
11525
+ "convert:project:hardis:profilestopermsets",
11526
+ "convert:project:profilestopermsets:hardis",
11527
+ "hardis:convert:profilestopermsets:project",
11528
+ "convert:hardis:profilestopermsets:project",
11529
+ "convert:profilestopermsets:hardis:project",
11530
+ "convert:profilestopermsets:project:hardis",
11531
+ "hardis:project:profilestopermsets:convert",
11532
+ "project:hardis:profilestopermsets:convert",
11533
+ "project:profilestopermsets:hardis:convert",
11534
+ "project:profilestopermsets:convert:hardis",
11535
+ "hardis:profilestopermsets:project:convert",
11536
+ "profilestopermsets:hardis:project:convert",
11537
+ "profilestopermsets:project:hardis:convert",
11538
+ "profilestopermsets:project:convert:hardis",
11539
+ "hardis:profilestopermsets:convert:project",
11540
+ "profilestopermsets:hardis:convert:project",
11541
+ "profilestopermsets:convert:hardis:project",
11542
+ "profilestopermsets:convert:project:hardis"
11543
+ ]
11544
+ },
11545
11545
  "hardis:project:deploy:notify": {
11546
11546
  "aliases": [],
11547
11547
  "args": {},
@@ -15504,5 +15504,5 @@
15504
15504
  ]
15505
15505
  }
15506
15506
  },
15507
- "version": "6.12.7-beta202511232340.0"
15507
+ "version": "6.12.8"
15508
15508
  }