sfdx-hardis 6.17.2-alpha202512261505.0 → 6.17.2-alpha202512261823.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/hardis/project/deploy/smart.js +1 -1
- package/lib/commands/hardis/project/deploy/smart.js.map +1 -1
- package/lib/common/gitProvider/utilsMarkdown.js +1 -2
- package/lib/common/gitProvider/utilsMarkdown.js.map +1 -1
- package/lib/common/utils/classUtils.d.ts +2 -1
- package/lib/common/utils/classUtils.js +11 -2
- package/lib/common/utils/classUtils.js.map +1 -1
- package/oclif.manifest.json +704 -704
- package/package.json +1 -1
package/oclif.manifest.json
CHANGED
|
@@ -132,12 +132,13 @@
|
|
|
132
132
|
"clear:cache:hardis"
|
|
133
133
|
]
|
|
134
134
|
},
|
|
135
|
-
"hardis:
|
|
135
|
+
"hardis:auth:login": {
|
|
136
136
|
"aliases": [],
|
|
137
137
|
"args": {},
|
|
138
|
-
"description": "\n## Command Behavior\n\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:
|
|
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
|
-
"
|
|
159
|
-
"char": "
|
|
160
|
-
"description": "
|
|
161
|
-
"name": "
|
|
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:
|
|
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": "
|
|
210
|
+
"title": "Login",
|
|
202
211
|
"requiresProject": false,
|
|
203
212
|
"isESM": true,
|
|
204
213
|
"relativePath": [
|
|
205
214
|
"lib",
|
|
206
215
|
"commands",
|
|
207
216
|
"hardis",
|
|
208
|
-
"
|
|
209
|
-
"
|
|
217
|
+
"auth",
|
|
218
|
+
"login.js"
|
|
210
219
|
],
|
|
211
220
|
"aliasPermutations": [],
|
|
212
221
|
"permutations": [
|
|
213
|
-
"hardis:
|
|
214
|
-
"
|
|
215
|
-
"
|
|
216
|
-
"hardis:
|
|
217
|
-
"
|
|
218
|
-
"
|
|
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:
|
|
230
|
+
"hardis:config:get": {
|
|
222
231
|
"aliases": [],
|
|
223
232
|
"args": {},
|
|
224
|
-
"description": "\n## Command Behavior\n\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:
|
|
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
|
-
"
|
|
246
|
-
"char": "
|
|
247
|
-
"description": "
|
|
248
|
-
"name": "
|
|
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:
|
|
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": "
|
|
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
|
-
"
|
|
304
|
-
"
|
|
303
|
+
"config",
|
|
304
|
+
"get.js"
|
|
305
305
|
],
|
|
306
306
|
"aliasPermutations": [],
|
|
307
307
|
"permutations": [
|
|
308
|
-
"hardis:
|
|
309
|
-
"
|
|
310
|
-
"
|
|
311
|
-
"hardis:
|
|
312
|
-
"
|
|
313
|
-
"
|
|
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:datacloud:sql-query": {
|
|
@@ -6039,15 +6039,12 @@
|
|
|
6039
6039
|
"listviewmine:fix:org:hardis"
|
|
6040
6040
|
]
|
|
6041
6041
|
},
|
|
6042
|
-
"hardis:org:
|
|
6042
|
+
"hardis:org:files:export": {
|
|
6043
6043
|
"aliases": [],
|
|
6044
6044
|
"args": {},
|
|
6045
|
-
"description": "
|
|
6045
|
+
"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[](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",
|
|
6046
6046
|
"examples": [
|
|
6047
|
-
"$ sf hardis:org:
|
|
6048
|
-
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
|
|
6049
|
-
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
|
|
6050
|
-
"$ sf hardis:org:diagnose:audittrail --lastndays 5"
|
|
6047
|
+
"$ sf hardis:org:files:export"
|
|
6051
6048
|
],
|
|
6052
6049
|
"flags": {
|
|
6053
6050
|
"json": {
|
|
@@ -6065,30 +6062,48 @@
|
|
|
6065
6062
|
"multiple": false,
|
|
6066
6063
|
"type": "option"
|
|
6067
6064
|
},
|
|
6068
|
-
"
|
|
6069
|
-
"char": "
|
|
6070
|
-
"description": "
|
|
6071
|
-
"name": "
|
|
6065
|
+
"path": {
|
|
6066
|
+
"char": "p",
|
|
6067
|
+
"description": "Path to the file export project",
|
|
6068
|
+
"name": "path",
|
|
6072
6069
|
"hasDynamicHelp": false,
|
|
6073
6070
|
"multiple": false,
|
|
6074
6071
|
"type": "option"
|
|
6075
6072
|
},
|
|
6076
|
-
"
|
|
6073
|
+
"chunksize": {
|
|
6074
|
+
"char": "c",
|
|
6075
|
+
"description": "Number of records to add in a chunk before it is processed",
|
|
6076
|
+
"name": "chunksize",
|
|
6077
|
+
"default": 1000,
|
|
6078
|
+
"hasDynamicHelp": false,
|
|
6079
|
+
"multiple": false,
|
|
6080
|
+
"type": "option"
|
|
6081
|
+
},
|
|
6082
|
+
"polltimeout": {
|
|
6077
6083
|
"char": "t",
|
|
6078
|
-
"description": "
|
|
6079
|
-
"name": "
|
|
6084
|
+
"description": "Timeout in MS for Bulk API calls",
|
|
6085
|
+
"name": "polltimeout",
|
|
6086
|
+
"default": 300000,
|
|
6080
6087
|
"hasDynamicHelp": false,
|
|
6081
6088
|
"multiple": false,
|
|
6082
6089
|
"type": "option"
|
|
6083
6090
|
},
|
|
6084
|
-
"
|
|
6085
|
-
"char": "
|
|
6086
|
-
"description": "
|
|
6087
|
-
"name": "
|
|
6091
|
+
"startchunknumber": {
|
|
6092
|
+
"char": "s",
|
|
6093
|
+
"description": "Chunk number to start from",
|
|
6094
|
+
"name": "startchunknumber",
|
|
6095
|
+
"default": 0,
|
|
6088
6096
|
"hasDynamicHelp": false,
|
|
6089
6097
|
"multiple": false,
|
|
6090
6098
|
"type": "option"
|
|
6091
6099
|
},
|
|
6100
|
+
"resume": {
|
|
6101
|
+
"char": "r",
|
|
6102
|
+
"description": "Resume previous export by checking existing files (default in CI)",
|
|
6103
|
+
"name": "resume",
|
|
6104
|
+
"allowNo": false,
|
|
6105
|
+
"type": "boolean"
|
|
6106
|
+
},
|
|
6092
6107
|
"debug": {
|
|
6093
6108
|
"char": "d",
|
|
6094
6109
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6127,13 +6142,13 @@
|
|
|
6127
6142
|
},
|
|
6128
6143
|
"hasDynamicHelp": true,
|
|
6129
6144
|
"hiddenAliases": [],
|
|
6130
|
-
"id": "hardis:org:
|
|
6145
|
+
"id": "hardis:org:files:export",
|
|
6131
6146
|
"pluginAlias": "sfdx-hardis",
|
|
6132
6147
|
"pluginName": "sfdx-hardis",
|
|
6133
6148
|
"pluginType": "core",
|
|
6134
6149
|
"strict": true,
|
|
6135
6150
|
"enableJsonFlag": true,
|
|
6136
|
-
"title": "
|
|
6151
|
+
"title": "Export files",
|
|
6137
6152
|
"requiresProject": false,
|
|
6138
6153
|
"isESM": true,
|
|
6139
6154
|
"relativePath": [
|
|
@@ -6141,43 +6156,43 @@
|
|
|
6141
6156
|
"commands",
|
|
6142
6157
|
"hardis",
|
|
6143
6158
|
"org",
|
|
6144
|
-
"
|
|
6145
|
-
"
|
|
6159
|
+
"files",
|
|
6160
|
+
"export.js"
|
|
6146
6161
|
],
|
|
6147
6162
|
"aliasPermutations": [],
|
|
6148
6163
|
"permutations": [
|
|
6149
|
-
"hardis:org:
|
|
6150
|
-
"org:hardis:
|
|
6151
|
-
"org:
|
|
6152
|
-
"org:
|
|
6153
|
-
"hardis:
|
|
6154
|
-
"
|
|
6155
|
-
"
|
|
6156
|
-
"
|
|
6157
|
-
"hardis:
|
|
6158
|
-
"
|
|
6159
|
-
"
|
|
6160
|
-
"
|
|
6161
|
-
"hardis:org:
|
|
6162
|
-
"org:hardis:
|
|
6163
|
-
"org:
|
|
6164
|
-
"org:
|
|
6165
|
-
"hardis:
|
|
6166
|
-
"
|
|
6167
|
-
"
|
|
6168
|
-
"
|
|
6169
|
-
"hardis:
|
|
6170
|
-
"
|
|
6171
|
-
"
|
|
6172
|
-
"
|
|
6164
|
+
"hardis:org:files:export",
|
|
6165
|
+
"org:hardis:files:export",
|
|
6166
|
+
"org:files:hardis:export",
|
|
6167
|
+
"org:files:export:hardis",
|
|
6168
|
+
"hardis:files:org:export",
|
|
6169
|
+
"files:hardis:org:export",
|
|
6170
|
+
"files:org:hardis:export",
|
|
6171
|
+
"files:org:export:hardis",
|
|
6172
|
+
"hardis:files:export:org",
|
|
6173
|
+
"files:hardis:export:org",
|
|
6174
|
+
"files:export:hardis:org",
|
|
6175
|
+
"files:export:org:hardis",
|
|
6176
|
+
"hardis:org:export:files",
|
|
6177
|
+
"org:hardis:export:files",
|
|
6178
|
+
"org:export:hardis:files",
|
|
6179
|
+
"org:export:files:hardis",
|
|
6180
|
+
"hardis:export:org:files",
|
|
6181
|
+
"export:hardis:org:files",
|
|
6182
|
+
"export:org:hardis:files",
|
|
6183
|
+
"export:org:files:hardis",
|
|
6184
|
+
"hardis:export:files:org",
|
|
6185
|
+
"export:hardis:files:org",
|
|
6186
|
+
"export:files:hardis:org",
|
|
6187
|
+
"export:files:org:hardis"
|
|
6173
6188
|
]
|
|
6174
6189
|
},
|
|
6175
|
-
"hardis:org:
|
|
6190
|
+
"hardis:org:files:import": {
|
|
6176
6191
|
"aliases": [],
|
|
6177
6192
|
"args": {},
|
|
6178
|
-
"description": "\
|
|
6193
|
+
"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[](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",
|
|
6179
6194
|
"examples": [
|
|
6180
|
-
"$ sf hardis:org:
|
|
6195
|
+
"$ sf hardis:org:files:import"
|
|
6181
6196
|
],
|
|
6182
6197
|
"flags": {
|
|
6183
6198
|
"json": {
|
|
@@ -6195,6 +6210,21 @@
|
|
|
6195
6210
|
"multiple": false,
|
|
6196
6211
|
"type": "option"
|
|
6197
6212
|
},
|
|
6213
|
+
"path": {
|
|
6214
|
+
"char": "p",
|
|
6215
|
+
"description": "Path to the file export project",
|
|
6216
|
+
"name": "path",
|
|
6217
|
+
"hasDynamicHelp": false,
|
|
6218
|
+
"multiple": false,
|
|
6219
|
+
"type": "option"
|
|
6220
|
+
},
|
|
6221
|
+
"overwrite": {
|
|
6222
|
+
"char": "f",
|
|
6223
|
+
"description": "Override existing files (doubles the number of API calls)",
|
|
6224
|
+
"name": "overwrite",
|
|
6225
|
+
"allowNo": false,
|
|
6226
|
+
"type": "boolean"
|
|
6227
|
+
},
|
|
6198
6228
|
"debug": {
|
|
6199
6229
|
"char": "d",
|
|
6200
6230
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6233,13 +6263,13 @@
|
|
|
6233
6263
|
},
|
|
6234
6264
|
"hasDynamicHelp": true,
|
|
6235
6265
|
"hiddenAliases": [],
|
|
6236
|
-
"id": "hardis:org:
|
|
6266
|
+
"id": "hardis:org:files:import",
|
|
6237
6267
|
"pluginAlias": "sfdx-hardis",
|
|
6238
6268
|
"pluginName": "sfdx-hardis",
|
|
6239
6269
|
"pluginType": "core",
|
|
6240
6270
|
"strict": true,
|
|
6241
6271
|
"enableJsonFlag": true,
|
|
6242
|
-
"title": "
|
|
6272
|
+
"title": "Import files",
|
|
6243
6273
|
"requiresProject": false,
|
|
6244
6274
|
"isESM": true,
|
|
6245
6275
|
"relativePath": [
|
|
@@ -6247,46 +6277,45 @@
|
|
|
6247
6277
|
"commands",
|
|
6248
6278
|
"hardis",
|
|
6249
6279
|
"org",
|
|
6250
|
-
"
|
|
6251
|
-
"
|
|
6280
|
+
"files",
|
|
6281
|
+
"import.js"
|
|
6252
6282
|
],
|
|
6253
6283
|
"aliasPermutations": [],
|
|
6254
6284
|
"permutations": [
|
|
6255
|
-
"hardis:org:
|
|
6256
|
-
"org:hardis:
|
|
6257
|
-
"org:
|
|
6258
|
-
"org:
|
|
6259
|
-
"hardis:
|
|
6260
|
-
"
|
|
6261
|
-
"
|
|
6262
|
-
"
|
|
6263
|
-
"hardis:
|
|
6264
|
-
"
|
|
6265
|
-
"
|
|
6266
|
-
"
|
|
6267
|
-
"hardis:org:
|
|
6268
|
-
"org:hardis:
|
|
6269
|
-
"org:
|
|
6270
|
-
"org:
|
|
6271
|
-
"hardis:
|
|
6272
|
-
"
|
|
6273
|
-
"
|
|
6274
|
-
"
|
|
6275
|
-
"hardis:
|
|
6276
|
-
"
|
|
6277
|
-
"
|
|
6278
|
-
"
|
|
6285
|
+
"hardis:org:files:import",
|
|
6286
|
+
"org:hardis:files:import",
|
|
6287
|
+
"org:files:hardis:import",
|
|
6288
|
+
"org:files:import:hardis",
|
|
6289
|
+
"hardis:files:org:import",
|
|
6290
|
+
"files:hardis:org:import",
|
|
6291
|
+
"files:org:hardis:import",
|
|
6292
|
+
"files:org:import:hardis",
|
|
6293
|
+
"hardis:files:import:org",
|
|
6294
|
+
"files:hardis:import:org",
|
|
6295
|
+
"files:import:hardis:org",
|
|
6296
|
+
"files:import:org:hardis",
|
|
6297
|
+
"hardis:org:import:files",
|
|
6298
|
+
"org:hardis:import:files",
|
|
6299
|
+
"org:import:hardis:files",
|
|
6300
|
+
"org:import:files:hardis",
|
|
6301
|
+
"hardis:import:org:files",
|
|
6302
|
+
"import:hardis:org:files",
|
|
6303
|
+
"import:org:hardis:files",
|
|
6304
|
+
"import:org:files:hardis",
|
|
6305
|
+
"hardis:import:files:org",
|
|
6306
|
+
"import:hardis:files:org",
|
|
6307
|
+
"import:files:hardis:org",
|
|
6308
|
+
"import:files:org:hardis"
|
|
6279
6309
|
]
|
|
6280
6310
|
},
|
|
6281
|
-
"hardis:org:
|
|
6311
|
+
"hardis:org:generate:packagexmlfull": {
|
|
6282
6312
|
"aliases": [],
|
|
6283
6313
|
"args": {},
|
|
6284
|
-
"description": "
|
|
6314
|
+
"description": "\n## Command Behavior\n\n**Generates a comprehensive `package.xml` file for a Salesforce org, including all metadata components, even managed ones.**\n\nThis command is essential for various Salesforce development and administration tasks, especially when you need a complete snapshot of an org's metadata. It goes beyond typical source tracking by including managed package components, which is crucial for understanding the full metadata footprint of an org.\n\nKey functionalities:\n\n- **Full Org Metadata Retrieval:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a complete list of all metadata types and their members.\n- **Managed Package Inclusion:** Unlike standard source retrieval, this command explicitly includes metadata from managed packages, providing a truly comprehensive `package.xml`.\n- **Customizable Output:** Allows you to specify the output file path for the generated `package.xml`.\n- **Interactive Org Selection:** If no target org is specified, it interactively prompts the user to choose an org. (or use --no-prompt to skip this step)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce Metadata API Interaction:** It leverages the Salesforce Metadata API to list all available metadata types and then retrieve all components for each type.\n- **`buildOrgManifest` Utility:** The core logic for querying the org's metadata and constructing the `package.xml` is encapsulated within the `buildOrgManifest` utility function.\n- **XML Generation:** It dynamically builds the XML structure of the `package.xml` file, including the `types` and `members` elements for all retrieved metadata.\n- **File System Operations:** It writes the generated `package.xml` file to the specified output path.\n- **Interactive Prompts:** Uses `promptOrgUsernameDefault` to guide the user in selecting the target Salesforce org.\n</details>\n",
|
|
6285
6315
|
"examples": [
|
|
6286
|
-
"$ sf hardis:org:
|
|
6287
|
-
"$ sf hardis:org:
|
|
6288
|
-
"$ sf hardis:org:
|
|
6289
|
-
"$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv"
|
|
6316
|
+
"$ sf hardis:org:generate:packagexmlfull",
|
|
6317
|
+
"$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
|
|
6318
|
+
"$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
|
|
6290
6319
|
],
|
|
6291
6320
|
"flags": {
|
|
6292
6321
|
"json": {
|
|
@@ -6304,27 +6333,8 @@
|
|
|
6304
6333
|
"multiple": false,
|
|
6305
6334
|
"type": "option"
|
|
6306
6335
|
},
|
|
6307
|
-
"eventtype": {
|
|
6308
|
-
"char": "e",
|
|
6309
|
-
"description": "Type of EventLogFile event to analyze",
|
|
6310
|
-
"name": "eventtype",
|
|
6311
|
-
"default": "ApiTotalUsage",
|
|
6312
|
-
"hasDynamicHelp": false,
|
|
6313
|
-
"multiple": false,
|
|
6314
|
-
"type": "option"
|
|
6315
|
-
},
|
|
6316
|
-
"limit": {
|
|
6317
|
-
"char": "l",
|
|
6318
|
-
"description": "Number of latest EventLogFile events to analyze",
|
|
6319
|
-
"name": "limit",
|
|
6320
|
-
"default": 999,
|
|
6321
|
-
"hasDynamicHelp": false,
|
|
6322
|
-
"multiple": false,
|
|
6323
|
-
"type": "option"
|
|
6324
|
-
},
|
|
6325
6336
|
"outputfile": {
|
|
6326
|
-
"
|
|
6327
|
-
"description": "Force the path and name of output report file. Must end with .csv",
|
|
6337
|
+
"description": "Output package.xml file",
|
|
6328
6338
|
"name": "outputfile",
|
|
6329
6339
|
"hasDynamicHelp": false,
|
|
6330
6340
|
"multiple": false,
|
|
@@ -6337,6 +6347,13 @@
|
|
|
6337
6347
|
"allowNo": false,
|
|
6338
6348
|
"type": "boolean"
|
|
6339
6349
|
},
|
|
6350
|
+
"no-prompt": {
|
|
6351
|
+
"char": "n",
|
|
6352
|
+
"description": "Do not prompt for org username, use the default one",
|
|
6353
|
+
"name": "no-prompt",
|
|
6354
|
+
"allowNo": false,
|
|
6355
|
+
"type": "boolean"
|
|
6356
|
+
},
|
|
6340
6357
|
"websocket": {
|
|
6341
6358
|
"description": "Websocket host:port for VsCode SFDX Hardis UI integration",
|
|
6342
6359
|
"name": "websocket",
|
|
@@ -6368,13 +6385,13 @@
|
|
|
6368
6385
|
},
|
|
6369
6386
|
"hasDynamicHelp": true,
|
|
6370
6387
|
"hiddenAliases": [],
|
|
6371
|
-
"id": "hardis:org:
|
|
6388
|
+
"id": "hardis:org:generate:packagexmlfull",
|
|
6372
6389
|
"pluginAlias": "sfdx-hardis",
|
|
6373
6390
|
"pluginName": "sfdx-hardis",
|
|
6374
6391
|
"pluginType": "core",
|
|
6375
6392
|
"strict": true,
|
|
6376
6393
|
"enableJsonFlag": true,
|
|
6377
|
-
"title": "
|
|
6394
|
+
"title": "Generate Full Org package.xml",
|
|
6378
6395
|
"requiresProject": false,
|
|
6379
6396
|
"isESM": true,
|
|
6380
6397
|
"relativePath": [
|
|
@@ -6382,43 +6399,46 @@
|
|
|
6382
6399
|
"commands",
|
|
6383
6400
|
"hardis",
|
|
6384
6401
|
"org",
|
|
6385
|
-
"
|
|
6386
|
-
"
|
|
6402
|
+
"generate",
|
|
6403
|
+
"packagexmlfull.js"
|
|
6387
6404
|
],
|
|
6388
6405
|
"aliasPermutations": [],
|
|
6389
6406
|
"permutations": [
|
|
6390
|
-
"hardis:org:
|
|
6391
|
-
"org:hardis:
|
|
6392
|
-
"org:
|
|
6393
|
-
"org:
|
|
6394
|
-
"hardis:
|
|
6395
|
-
"
|
|
6396
|
-
"
|
|
6397
|
-
"
|
|
6398
|
-
"hardis:
|
|
6399
|
-
"
|
|
6400
|
-
"
|
|
6401
|
-
"
|
|
6402
|
-
"hardis:org:
|
|
6403
|
-
"org:hardis:
|
|
6404
|
-
"org:
|
|
6405
|
-
"org:
|
|
6406
|
-
"hardis:
|
|
6407
|
-
"
|
|
6408
|
-
"
|
|
6409
|
-
"
|
|
6410
|
-
"hardis:
|
|
6411
|
-
"
|
|
6412
|
-
"
|
|
6413
|
-
"
|
|
6407
|
+
"hardis:org:generate:packagexmlfull",
|
|
6408
|
+
"org:hardis:generate:packagexmlfull",
|
|
6409
|
+
"org:generate:hardis:packagexmlfull",
|
|
6410
|
+
"org:generate:packagexmlfull:hardis",
|
|
6411
|
+
"hardis:generate:org:packagexmlfull",
|
|
6412
|
+
"generate:hardis:org:packagexmlfull",
|
|
6413
|
+
"generate:org:hardis:packagexmlfull",
|
|
6414
|
+
"generate:org:packagexmlfull:hardis",
|
|
6415
|
+
"hardis:generate:packagexmlfull:org",
|
|
6416
|
+
"generate:hardis:packagexmlfull:org",
|
|
6417
|
+
"generate:packagexmlfull:hardis:org",
|
|
6418
|
+
"generate:packagexmlfull:org:hardis",
|
|
6419
|
+
"hardis:org:packagexmlfull:generate",
|
|
6420
|
+
"org:hardis:packagexmlfull:generate",
|
|
6421
|
+
"org:packagexmlfull:hardis:generate",
|
|
6422
|
+
"org:packagexmlfull:generate:hardis",
|
|
6423
|
+
"hardis:packagexmlfull:org:generate",
|
|
6424
|
+
"packagexmlfull:hardis:org:generate",
|
|
6425
|
+
"packagexmlfull:org:hardis:generate",
|
|
6426
|
+
"packagexmlfull:org:generate:hardis",
|
|
6427
|
+
"hardis:packagexmlfull:generate:org",
|
|
6428
|
+
"packagexmlfull:hardis:generate:org",
|
|
6429
|
+
"packagexmlfull:generate:hardis:org",
|
|
6430
|
+
"packagexmlfull:generate:org:hardis"
|
|
6414
6431
|
]
|
|
6415
6432
|
},
|
|
6416
|
-
"hardis:org:diagnose:
|
|
6433
|
+
"hardis:org:diagnose:audittrail": {
|
|
6417
6434
|
"aliases": [],
|
|
6418
6435
|
"args": {},
|
|
6419
|
-
"description": "
|
|
6436
|
+
"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\n\n## Local output example\n\n\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",
|
|
6420
6437
|
"examples": [
|
|
6421
|
-
"$ sf hardis:org:diagnose:
|
|
6438
|
+
"$ sf hardis:org:diagnose:audittrail",
|
|
6439
|
+
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
|
|
6440
|
+
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
|
|
6441
|
+
"$ sf hardis:org:diagnose:audittrail --lastndays 5"
|
|
6422
6442
|
],
|
|
6423
6443
|
"flags": {
|
|
6424
6444
|
"json": {
|
|
@@ -6436,6 +6456,22 @@
|
|
|
6436
6456
|
"multiple": false,
|
|
6437
6457
|
"type": "option"
|
|
6438
6458
|
},
|
|
6459
|
+
"excludeusers": {
|
|
6460
|
+
"char": "e",
|
|
6461
|
+
"description": "Comma-separated list of usernames to exclude",
|
|
6462
|
+
"name": "excludeusers",
|
|
6463
|
+
"hasDynamicHelp": false,
|
|
6464
|
+
"multiple": false,
|
|
6465
|
+
"type": "option"
|
|
6466
|
+
},
|
|
6467
|
+
"lastndays": {
|
|
6468
|
+
"char": "t",
|
|
6469
|
+
"description": "Number of days to extract from today (included)",
|
|
6470
|
+
"name": "lastndays",
|
|
6471
|
+
"hasDynamicHelp": false,
|
|
6472
|
+
"multiple": false,
|
|
6473
|
+
"type": "option"
|
|
6474
|
+
},
|
|
6439
6475
|
"outputfile": {
|
|
6440
6476
|
"char": "f",
|
|
6441
6477
|
"description": "Force the path and name of output report file. Must end with .csv",
|
|
@@ -6444,13 +6480,6 @@
|
|
|
6444
6480
|
"multiple": false,
|
|
6445
6481
|
"type": "option"
|
|
6446
6482
|
},
|
|
6447
|
-
"usedonly": {
|
|
6448
|
-
"char": "u",
|
|
6449
|
-
"description": "Filter to have only used licenses",
|
|
6450
|
-
"name": "usedonly",
|
|
6451
|
-
"allowNo": false,
|
|
6452
|
-
"type": "boolean"
|
|
6453
|
-
},
|
|
6454
6483
|
"debug": {
|
|
6455
6484
|
"char": "d",
|
|
6456
6485
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6489,13 +6518,13 @@
|
|
|
6489
6518
|
},
|
|
6490
6519
|
"hasDynamicHelp": true,
|
|
6491
6520
|
"hiddenAliases": [],
|
|
6492
|
-
"id": "hardis:org:diagnose:
|
|
6521
|
+
"id": "hardis:org:diagnose:audittrail",
|
|
6493
6522
|
"pluginAlias": "sfdx-hardis",
|
|
6494
6523
|
"pluginName": "sfdx-hardis",
|
|
6495
6524
|
"pluginType": "core",
|
|
6496
6525
|
"strict": true,
|
|
6497
6526
|
"enableJsonFlag": true,
|
|
6498
|
-
"title": "
|
|
6527
|
+
"title": "Diagnose content of Setup Audit Trail",
|
|
6499
6528
|
"requiresProject": false,
|
|
6500
6529
|
"isESM": true,
|
|
6501
6530
|
"relativePath": [
|
|
@@ -6504,42 +6533,42 @@
|
|
|
6504
6533
|
"hardis",
|
|
6505
6534
|
"org",
|
|
6506
6535
|
"diagnose",
|
|
6507
|
-
"
|
|
6536
|
+
"audittrail.js"
|
|
6508
6537
|
],
|
|
6509
6538
|
"aliasPermutations": [],
|
|
6510
6539
|
"permutations": [
|
|
6511
|
-
"hardis:org:diagnose:
|
|
6512
|
-
"org:hardis:diagnose:
|
|
6513
|
-
"org:diagnose:hardis:
|
|
6514
|
-
"org:diagnose:
|
|
6515
|
-
"hardis:diagnose:org:
|
|
6516
|
-
"diagnose:hardis:org:
|
|
6517
|
-
"diagnose:org:hardis:
|
|
6518
|
-
"diagnose:org:
|
|
6519
|
-
"hardis:diagnose:
|
|
6520
|
-
"diagnose:hardis:
|
|
6521
|
-
"diagnose:
|
|
6522
|
-
"diagnose:
|
|
6523
|
-
"hardis:org:
|
|
6524
|
-
"org:hardis:
|
|
6525
|
-
"org:
|
|
6526
|
-
"org:
|
|
6527
|
-
"hardis:
|
|
6528
|
-
"
|
|
6529
|
-
"
|
|
6530
|
-
"
|
|
6531
|
-
"hardis:
|
|
6532
|
-
"
|
|
6533
|
-
"
|
|
6534
|
-
"
|
|
6540
|
+
"hardis:org:diagnose:audittrail",
|
|
6541
|
+
"org:hardis:diagnose:audittrail",
|
|
6542
|
+
"org:diagnose:hardis:audittrail",
|
|
6543
|
+
"org:diagnose:audittrail:hardis",
|
|
6544
|
+
"hardis:diagnose:org:audittrail",
|
|
6545
|
+
"diagnose:hardis:org:audittrail",
|
|
6546
|
+
"diagnose:org:hardis:audittrail",
|
|
6547
|
+
"diagnose:org:audittrail:hardis",
|
|
6548
|
+
"hardis:diagnose:audittrail:org",
|
|
6549
|
+
"diagnose:hardis:audittrail:org",
|
|
6550
|
+
"diagnose:audittrail:hardis:org",
|
|
6551
|
+
"diagnose:audittrail:org:hardis",
|
|
6552
|
+
"hardis:org:audittrail:diagnose",
|
|
6553
|
+
"org:hardis:audittrail:diagnose",
|
|
6554
|
+
"org:audittrail:hardis:diagnose",
|
|
6555
|
+
"org:audittrail:diagnose:hardis",
|
|
6556
|
+
"hardis:audittrail:org:diagnose",
|
|
6557
|
+
"audittrail:hardis:org:diagnose",
|
|
6558
|
+
"audittrail:org:hardis:diagnose",
|
|
6559
|
+
"audittrail:org:diagnose:hardis",
|
|
6560
|
+
"hardis:audittrail:diagnose:org",
|
|
6561
|
+
"audittrail:hardis:diagnose:org",
|
|
6562
|
+
"audittrail:diagnose:hardis:org",
|
|
6563
|
+
"audittrail:diagnose:org:hardis"
|
|
6535
6564
|
]
|
|
6536
6565
|
},
|
|
6537
|
-
"hardis:org:diagnose:
|
|
6566
|
+
"hardis:org:diagnose:instanceupgrade": {
|
|
6538
6567
|
"aliases": [],
|
|
6539
6568
|
"args": {},
|
|
6540
|
-
"description": "
|
|
6569
|
+
"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",
|
|
6541
6570
|
"examples": [
|
|
6542
|
-
"$ sf hardis:org:diagnose:
|
|
6571
|
+
"$ sf hardis:org:diagnose:instanceupgrade"
|
|
6543
6572
|
],
|
|
6544
6573
|
"flags": {
|
|
6545
6574
|
"json": {
|
|
@@ -6557,14 +6586,6 @@
|
|
|
6557
6586
|
"multiple": false,
|
|
6558
6587
|
"type": "option"
|
|
6559
6588
|
},
|
|
6560
|
-
"outputfile": {
|
|
6561
|
-
"char": "f",
|
|
6562
|
-
"description": "Force the path and name of output report file. Must end with .csv",
|
|
6563
|
-
"name": "outputfile",
|
|
6564
|
-
"hasDynamicHelp": false,
|
|
6565
|
-
"multiple": false,
|
|
6566
|
-
"type": "option"
|
|
6567
|
-
},
|
|
6568
6589
|
"debug": {
|
|
6569
6590
|
"char": "d",
|
|
6570
6591
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6603,13 +6624,13 @@
|
|
|
6603
6624
|
},
|
|
6604
6625
|
"hasDynamicHelp": true,
|
|
6605
6626
|
"hiddenAliases": [],
|
|
6606
|
-
"id": "hardis:org:diagnose:
|
|
6627
|
+
"id": "hardis:org:diagnose:instanceupgrade",
|
|
6607
6628
|
"pluginAlias": "sfdx-hardis",
|
|
6608
6629
|
"pluginName": "sfdx-hardis",
|
|
6609
6630
|
"pluginType": "core",
|
|
6610
6631
|
"strict": true,
|
|
6611
6632
|
"enableJsonFlag": true,
|
|
6612
|
-
"title": "
|
|
6633
|
+
"title": "Get Instance Upgrade date",
|
|
6613
6634
|
"requiresProject": false,
|
|
6614
6635
|
"isESM": true,
|
|
6615
6636
|
"relativePath": [
|
|
@@ -6618,47 +6639,45 @@
|
|
|
6618
6639
|
"hardis",
|
|
6619
6640
|
"org",
|
|
6620
6641
|
"diagnose",
|
|
6621
|
-
"
|
|
6642
|
+
"instanceupgrade.js"
|
|
6622
6643
|
],
|
|
6623
6644
|
"aliasPermutations": [],
|
|
6624
6645
|
"permutations": [
|
|
6625
|
-
"hardis:org:diagnose:
|
|
6626
|
-
"org:hardis:diagnose:
|
|
6627
|
-
"org:diagnose:hardis:
|
|
6628
|
-
"org:diagnose:
|
|
6629
|
-
"hardis:diagnose:org:
|
|
6630
|
-
"diagnose:hardis:org:
|
|
6631
|
-
"diagnose:org:hardis:
|
|
6632
|
-
"diagnose:org:
|
|
6633
|
-
"hardis:diagnose:
|
|
6634
|
-
"diagnose:hardis:
|
|
6635
|
-
"diagnose:
|
|
6636
|
-
"diagnose:
|
|
6637
|
-
"hardis:org:
|
|
6638
|
-
"org:hardis:
|
|
6639
|
-
"org:
|
|
6640
|
-
"org:
|
|
6641
|
-
"hardis:
|
|
6642
|
-
"
|
|
6643
|
-
"
|
|
6644
|
-
"
|
|
6645
|
-
"hardis:
|
|
6646
|
-
"
|
|
6647
|
-
"
|
|
6648
|
-
"
|
|
6646
|
+
"hardis:org:diagnose:instanceupgrade",
|
|
6647
|
+
"org:hardis:diagnose:instanceupgrade",
|
|
6648
|
+
"org:diagnose:hardis:instanceupgrade",
|
|
6649
|
+
"org:diagnose:instanceupgrade:hardis",
|
|
6650
|
+
"hardis:diagnose:org:instanceupgrade",
|
|
6651
|
+
"diagnose:hardis:org:instanceupgrade",
|
|
6652
|
+
"diagnose:org:hardis:instanceupgrade",
|
|
6653
|
+
"diagnose:org:instanceupgrade:hardis",
|
|
6654
|
+
"hardis:diagnose:instanceupgrade:org",
|
|
6655
|
+
"diagnose:hardis:instanceupgrade:org",
|
|
6656
|
+
"diagnose:instanceupgrade:hardis:org",
|
|
6657
|
+
"diagnose:instanceupgrade:org:hardis",
|
|
6658
|
+
"hardis:org:instanceupgrade:diagnose",
|
|
6659
|
+
"org:hardis:instanceupgrade:diagnose",
|
|
6660
|
+
"org:instanceupgrade:hardis:diagnose",
|
|
6661
|
+
"org:instanceupgrade:diagnose:hardis",
|
|
6662
|
+
"hardis:instanceupgrade:org:diagnose",
|
|
6663
|
+
"instanceupgrade:hardis:org:diagnose",
|
|
6664
|
+
"instanceupgrade:org:hardis:diagnose",
|
|
6665
|
+
"instanceupgrade:org:diagnose:hardis",
|
|
6666
|
+
"hardis:instanceupgrade:diagnose:org",
|
|
6667
|
+
"instanceupgrade:hardis:diagnose:org",
|
|
6668
|
+
"instanceupgrade:diagnose:hardis:org",
|
|
6669
|
+
"instanceupgrade:diagnose:org:hardis"
|
|
6649
6670
|
]
|
|
6650
6671
|
},
|
|
6651
|
-
"hardis:org:diagnose:
|
|
6672
|
+
"hardis:org:diagnose:legacyapi": {
|
|
6652
6673
|
"aliases": [],
|
|
6653
6674
|
"args": {},
|
|
6654
|
-
"description": "
|
|
6675
|
+
"description": "Checks if an org uses retired or someday retired API version\n\n\nSee article below\n\n[](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",
|
|
6655
6676
|
"examples": [
|
|
6656
|
-
"$ sf hardis:org:diagnose:
|
|
6657
|
-
"$ sf hardis:org:diagnose:
|
|
6658
|
-
"$ sf hardis:org:diagnose:
|
|
6659
|
-
"$ sf hardis:org:diagnose:
|
|
6660
|
-
"$ sf hardis:org:diagnose:storage-stats -w \"Status__c = 'Active'\"",
|
|
6661
|
-
"$ sf hardis:org:diagnose:storage-stats -b \"LastModifiedDate\" -w \"IsDeleted = false\""
|
|
6677
|
+
"$ sf hardis:org:diagnose:legacyapi",
|
|
6678
|
+
"$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com",
|
|
6679
|
+
"$ sf hardis:org:diagnose:legacyapi --outputfile 'c:/path/to/folder/legacyapi.csv'",
|
|
6680
|
+
"$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv"
|
|
6662
6681
|
],
|
|
6663
6682
|
"flags": {
|
|
6664
6683
|
"json": {
|
|
@@ -6676,26 +6695,28 @@
|
|
|
6676
6695
|
"multiple": false,
|
|
6677
6696
|
"type": "option"
|
|
6678
6697
|
},
|
|
6679
|
-
"
|
|
6680
|
-
"char": "
|
|
6681
|
-
"description": "
|
|
6682
|
-
"name": "
|
|
6698
|
+
"eventtype": {
|
|
6699
|
+
"char": "e",
|
|
6700
|
+
"description": "Type of EventLogFile event to analyze",
|
|
6701
|
+
"name": "eventtype",
|
|
6702
|
+
"default": "ApiTotalUsage",
|
|
6683
6703
|
"hasDynamicHelp": false,
|
|
6684
6704
|
"multiple": false,
|
|
6685
6705
|
"type": "option"
|
|
6686
6706
|
},
|
|
6687
|
-
"
|
|
6688
|
-
"char": "
|
|
6689
|
-
"description": "
|
|
6690
|
-
"name": "
|
|
6707
|
+
"limit": {
|
|
6708
|
+
"char": "l",
|
|
6709
|
+
"description": "Number of latest EventLogFile events to analyze",
|
|
6710
|
+
"name": "limit",
|
|
6711
|
+
"default": 999,
|
|
6691
6712
|
"hasDynamicHelp": false,
|
|
6692
6713
|
"multiple": false,
|
|
6693
6714
|
"type": "option"
|
|
6694
6715
|
},
|
|
6695
|
-
"
|
|
6696
|
-
"char": "
|
|
6697
|
-
"description": "
|
|
6698
|
-
"name": "
|
|
6716
|
+
"outputfile": {
|
|
6717
|
+
"char": "f",
|
|
6718
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
6719
|
+
"name": "outputfile",
|
|
6699
6720
|
"hasDynamicHelp": false,
|
|
6700
6721
|
"multiple": false,
|
|
6701
6722
|
"type": "option"
|
|
@@ -6738,14 +6759,14 @@
|
|
|
6738
6759
|
},
|
|
6739
6760
|
"hasDynamicHelp": true,
|
|
6740
6761
|
"hiddenAliases": [],
|
|
6741
|
-
"id": "hardis:org:diagnose:
|
|
6762
|
+
"id": "hardis:org:diagnose:legacyapi",
|
|
6742
6763
|
"pluginAlias": "sfdx-hardis",
|
|
6743
6764
|
"pluginName": "sfdx-hardis",
|
|
6744
6765
|
"pluginType": "core",
|
|
6745
6766
|
"strict": true,
|
|
6746
6767
|
"enableJsonFlag": true,
|
|
6747
|
-
"title": "
|
|
6748
|
-
"requiresProject":
|
|
6768
|
+
"title": "Check for legacy API use",
|
|
6769
|
+
"requiresProject": false,
|
|
6749
6770
|
"isESM": true,
|
|
6750
6771
|
"relativePath": [
|
|
6751
6772
|
"lib",
|
|
@@ -6753,42 +6774,42 @@
|
|
|
6753
6774
|
"hardis",
|
|
6754
6775
|
"org",
|
|
6755
6776
|
"diagnose",
|
|
6756
|
-
"
|
|
6777
|
+
"legacyapi.js"
|
|
6757
6778
|
],
|
|
6758
6779
|
"aliasPermutations": [],
|
|
6759
6780
|
"permutations": [
|
|
6760
|
-
"hardis:org:diagnose:
|
|
6761
|
-
"org:hardis:diagnose:
|
|
6762
|
-
"org:diagnose:hardis:
|
|
6763
|
-
"org:diagnose:
|
|
6764
|
-
"hardis:diagnose:org:
|
|
6765
|
-
"diagnose:hardis:org:
|
|
6766
|
-
"diagnose:org:hardis:
|
|
6767
|
-
"diagnose:org:
|
|
6768
|
-
"hardis:diagnose:
|
|
6769
|
-
"diagnose:hardis:
|
|
6770
|
-
"diagnose:
|
|
6771
|
-
"diagnose:
|
|
6772
|
-
"hardis:org:
|
|
6773
|
-
"org:hardis:
|
|
6774
|
-
"org:
|
|
6775
|
-
"org:
|
|
6776
|
-
"hardis:
|
|
6777
|
-
"
|
|
6778
|
-
"
|
|
6779
|
-
"
|
|
6780
|
-
"hardis:
|
|
6781
|
-
"
|
|
6782
|
-
"
|
|
6783
|
-
"
|
|
6781
|
+
"hardis:org:diagnose:legacyapi",
|
|
6782
|
+
"org:hardis:diagnose:legacyapi",
|
|
6783
|
+
"org:diagnose:hardis:legacyapi",
|
|
6784
|
+
"org:diagnose:legacyapi:hardis",
|
|
6785
|
+
"hardis:diagnose:org:legacyapi",
|
|
6786
|
+
"diagnose:hardis:org:legacyapi",
|
|
6787
|
+
"diagnose:org:hardis:legacyapi",
|
|
6788
|
+
"diagnose:org:legacyapi:hardis",
|
|
6789
|
+
"hardis:diagnose:legacyapi:org",
|
|
6790
|
+
"diagnose:hardis:legacyapi:org",
|
|
6791
|
+
"diagnose:legacyapi:hardis:org",
|
|
6792
|
+
"diagnose:legacyapi:org:hardis",
|
|
6793
|
+
"hardis:org:legacyapi:diagnose",
|
|
6794
|
+
"org:hardis:legacyapi:diagnose",
|
|
6795
|
+
"org:legacyapi:hardis:diagnose",
|
|
6796
|
+
"org:legacyapi:diagnose:hardis",
|
|
6797
|
+
"hardis:legacyapi:org:diagnose",
|
|
6798
|
+
"legacyapi:hardis:org:diagnose",
|
|
6799
|
+
"legacyapi:org:hardis:diagnose",
|
|
6800
|
+
"legacyapi:org:diagnose:hardis",
|
|
6801
|
+
"hardis:legacyapi:diagnose:org",
|
|
6802
|
+
"legacyapi:hardis:diagnose:org",
|
|
6803
|
+
"legacyapi:diagnose:hardis:org",
|
|
6804
|
+
"legacyapi:diagnose:org:hardis"
|
|
6784
6805
|
]
|
|
6785
6806
|
},
|
|
6786
|
-
"hardis:org:diagnose:
|
|
6807
|
+
"hardis:org:diagnose:licenses": {
|
|
6787
6808
|
"aliases": [],
|
|
6788
6809
|
"args": {},
|
|
6789
|
-
"description": "\n
|
|
6810
|
+
"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",
|
|
6790
6811
|
"examples": [
|
|
6791
|
-
"$ sf hardis:org:diagnose:
|
|
6812
|
+
"$ sf hardis:org:diagnose:licenses"
|
|
6792
6813
|
],
|
|
6793
6814
|
"flags": {
|
|
6794
6815
|
"json": {
|
|
@@ -6814,6 +6835,13 @@
|
|
|
6814
6835
|
"multiple": false,
|
|
6815
6836
|
"type": "option"
|
|
6816
6837
|
},
|
|
6838
|
+
"usedonly": {
|
|
6839
|
+
"char": "u",
|
|
6840
|
+
"description": "Filter to have only used licenses",
|
|
6841
|
+
"name": "usedonly",
|
|
6842
|
+
"allowNo": false,
|
|
6843
|
+
"type": "boolean"
|
|
6844
|
+
},
|
|
6817
6845
|
"debug": {
|
|
6818
6846
|
"char": "d",
|
|
6819
6847
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6852,13 +6880,13 @@
|
|
|
6852
6880
|
},
|
|
6853
6881
|
"hasDynamicHelp": true,
|
|
6854
6882
|
"hiddenAliases": [],
|
|
6855
|
-
"id": "hardis:org:diagnose:
|
|
6883
|
+
"id": "hardis:org:diagnose:licenses",
|
|
6856
6884
|
"pluginAlias": "sfdx-hardis",
|
|
6857
6885
|
"pluginName": "sfdx-hardis",
|
|
6858
6886
|
"pluginType": "core",
|
|
6859
6887
|
"strict": true,
|
|
6860
6888
|
"enableJsonFlag": true,
|
|
6861
|
-
"title": "
|
|
6889
|
+
"title": "List licenses subscribed and used in a Salesforce org",
|
|
6862
6890
|
"requiresProject": false,
|
|
6863
6891
|
"isESM": true,
|
|
6864
6892
|
"relativePath": [
|
|
@@ -6867,43 +6895,42 @@
|
|
|
6867
6895
|
"hardis",
|
|
6868
6896
|
"org",
|
|
6869
6897
|
"diagnose",
|
|
6870
|
-
"
|
|
6898
|
+
"licenses.js"
|
|
6871
6899
|
],
|
|
6872
6900
|
"aliasPermutations": [],
|
|
6873
6901
|
"permutations": [
|
|
6874
|
-
"hardis:org:diagnose:
|
|
6875
|
-
"org:hardis:diagnose:
|
|
6876
|
-
"org:diagnose:hardis:
|
|
6877
|
-
"org:diagnose:
|
|
6878
|
-
"hardis:diagnose:org:
|
|
6879
|
-
"diagnose:hardis:org:
|
|
6880
|
-
"diagnose:org:hardis:
|
|
6881
|
-
"diagnose:org:
|
|
6882
|
-
"hardis:diagnose:
|
|
6883
|
-
"diagnose:hardis:
|
|
6884
|
-
"diagnose:
|
|
6885
|
-
"diagnose:
|
|
6886
|
-
"hardis:org:
|
|
6887
|
-
"org:hardis:
|
|
6888
|
-
"org:
|
|
6889
|
-
"org:
|
|
6890
|
-
"hardis:
|
|
6891
|
-
"
|
|
6892
|
-
"
|
|
6893
|
-
"
|
|
6894
|
-
"hardis:
|
|
6895
|
-
"
|
|
6896
|
-
"
|
|
6897
|
-
"
|
|
6902
|
+
"hardis:org:diagnose:licenses",
|
|
6903
|
+
"org:hardis:diagnose:licenses",
|
|
6904
|
+
"org:diagnose:hardis:licenses",
|
|
6905
|
+
"org:diagnose:licenses:hardis",
|
|
6906
|
+
"hardis:diagnose:org:licenses",
|
|
6907
|
+
"diagnose:hardis:org:licenses",
|
|
6908
|
+
"diagnose:org:hardis:licenses",
|
|
6909
|
+
"diagnose:org:licenses:hardis",
|
|
6910
|
+
"hardis:diagnose:licenses:org",
|
|
6911
|
+
"diagnose:hardis:licenses:org",
|
|
6912
|
+
"diagnose:licenses:hardis:org",
|
|
6913
|
+
"diagnose:licenses:org:hardis",
|
|
6914
|
+
"hardis:org:licenses:diagnose",
|
|
6915
|
+
"org:hardis:licenses:diagnose",
|
|
6916
|
+
"org:licenses:hardis:diagnose",
|
|
6917
|
+
"org:licenses:diagnose:hardis",
|
|
6918
|
+
"hardis:licenses:org:diagnose",
|
|
6919
|
+
"licenses:hardis:org:diagnose",
|
|
6920
|
+
"licenses:org:hardis:diagnose",
|
|
6921
|
+
"licenses:org:diagnose:hardis",
|
|
6922
|
+
"hardis:licenses:diagnose:org",
|
|
6923
|
+
"licenses:hardis:diagnose:org",
|
|
6924
|
+
"licenses:diagnose:hardis:org",
|
|
6925
|
+
"licenses:diagnose:org:hardis"
|
|
6898
6926
|
]
|
|
6899
6927
|
},
|
|
6900
|
-
"hardis:org:diagnose:
|
|
6928
|
+
"hardis:org:diagnose:releaseupdates": {
|
|
6901
6929
|
"aliases": [],
|
|
6902
6930
|
"args": {},
|
|
6903
|
-
"description": "
|
|
6931
|
+
"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",
|
|
6904
6932
|
"examples": [
|
|
6905
|
-
"$ sf hardis:org:diagnose:
|
|
6906
|
-
"$ sf hardis:org:diagnose:unused-apex-classes --days 700"
|
|
6933
|
+
"$ sf hardis:org:diagnose:releaseupdates"
|
|
6907
6934
|
],
|
|
6908
6935
|
"flags": {
|
|
6909
6936
|
"json": {
|
|
@@ -6929,14 +6956,6 @@
|
|
|
6929
6956
|
"multiple": false,
|
|
6930
6957
|
"type": "option"
|
|
6931
6958
|
},
|
|
6932
|
-
"days": {
|
|
6933
|
-
"char": "t",
|
|
6934
|
-
"description": "Extracts the users that have been inactive for the amount of days specified. In CI, default is 180 days",
|
|
6935
|
-
"name": "days",
|
|
6936
|
-
"hasDynamicHelp": false,
|
|
6937
|
-
"multiple": false,
|
|
6938
|
-
"type": "option"
|
|
6939
|
-
},
|
|
6940
6959
|
"debug": {
|
|
6941
6960
|
"char": "d",
|
|
6942
6961
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6975,13 +6994,13 @@
|
|
|
6975
6994
|
},
|
|
6976
6995
|
"hasDynamicHelp": true,
|
|
6977
6996
|
"hiddenAliases": [],
|
|
6978
|
-
"id": "hardis:org:diagnose:
|
|
6997
|
+
"id": "hardis:org:diagnose:releaseupdates",
|
|
6979
6998
|
"pluginAlias": "sfdx-hardis",
|
|
6980
6999
|
"pluginName": "sfdx-hardis",
|
|
6981
7000
|
"pluginType": "core",
|
|
6982
7001
|
"strict": true,
|
|
6983
7002
|
"enableJsonFlag": true,
|
|
6984
|
-
"title": "
|
|
7003
|
+
"title": "Check Release Updates of an org",
|
|
6985
7004
|
"requiresProject": false,
|
|
6986
7005
|
"isESM": true,
|
|
6987
7006
|
"relativePath": [
|
|
@@ -6990,53 +7009,58 @@
|
|
|
6990
7009
|
"hardis",
|
|
6991
7010
|
"org",
|
|
6992
7011
|
"diagnose",
|
|
6993
|
-
"
|
|
7012
|
+
"releaseupdates.js"
|
|
6994
7013
|
],
|
|
6995
7014
|
"aliasPermutations": [],
|
|
6996
7015
|
"permutations": [
|
|
6997
|
-
"hardis:org:diagnose:
|
|
6998
|
-
"org:hardis:diagnose:
|
|
6999
|
-
"org:diagnose:hardis:
|
|
7000
|
-
"org:diagnose:
|
|
7001
|
-
"hardis:diagnose:org:
|
|
7002
|
-
"diagnose:hardis:org:
|
|
7003
|
-
"diagnose:org:hardis:
|
|
7004
|
-
"diagnose:org:
|
|
7005
|
-
"hardis:diagnose:
|
|
7006
|
-
"diagnose:hardis:
|
|
7007
|
-
"diagnose:
|
|
7008
|
-
"diagnose:
|
|
7009
|
-
"hardis:org:
|
|
7010
|
-
"org:hardis:
|
|
7011
|
-
"org:
|
|
7012
|
-
"org:
|
|
7013
|
-
"hardis:
|
|
7014
|
-
"
|
|
7015
|
-
"
|
|
7016
|
-
"
|
|
7017
|
-
"hardis:
|
|
7018
|
-
"
|
|
7019
|
-
"
|
|
7020
|
-
"
|
|
7021
|
-
]
|
|
7022
|
-
},
|
|
7023
|
-
"hardis:org:diagnose:
|
|
7024
|
-
"aliases": [],
|
|
7025
|
-
"args": {},
|
|
7026
|
-
"description": "
|
|
7027
|
-
"examples": [
|
|
7028
|
-
"$ sf hardis:org:diagnose:
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
"
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
"
|
|
7016
|
+
"hardis:org:diagnose:releaseupdates",
|
|
7017
|
+
"org:hardis:diagnose:releaseupdates",
|
|
7018
|
+
"org:diagnose:hardis:releaseupdates",
|
|
7019
|
+
"org:diagnose:releaseupdates:hardis",
|
|
7020
|
+
"hardis:diagnose:org:releaseupdates",
|
|
7021
|
+
"diagnose:hardis:org:releaseupdates",
|
|
7022
|
+
"diagnose:org:hardis:releaseupdates",
|
|
7023
|
+
"diagnose:org:releaseupdates:hardis",
|
|
7024
|
+
"hardis:diagnose:releaseupdates:org",
|
|
7025
|
+
"diagnose:hardis:releaseupdates:org",
|
|
7026
|
+
"diagnose:releaseupdates:hardis:org",
|
|
7027
|
+
"diagnose:releaseupdates:org:hardis",
|
|
7028
|
+
"hardis:org:releaseupdates:diagnose",
|
|
7029
|
+
"org:hardis:releaseupdates:diagnose",
|
|
7030
|
+
"org:releaseupdates:hardis:diagnose",
|
|
7031
|
+
"org:releaseupdates:diagnose:hardis",
|
|
7032
|
+
"hardis:releaseupdates:org:diagnose",
|
|
7033
|
+
"releaseupdates:hardis:org:diagnose",
|
|
7034
|
+
"releaseupdates:org:hardis:diagnose",
|
|
7035
|
+
"releaseupdates:org:diagnose:hardis",
|
|
7036
|
+
"hardis:releaseupdates:diagnose:org",
|
|
7037
|
+
"releaseupdates:hardis:diagnose:org",
|
|
7038
|
+
"releaseupdates:diagnose:hardis:org",
|
|
7039
|
+
"releaseupdates:diagnose:org:hardis"
|
|
7040
|
+
]
|
|
7041
|
+
},
|
|
7042
|
+
"hardis:org:diagnose:storage-stats": {
|
|
7043
|
+
"aliases": [],
|
|
7044
|
+
"args": {},
|
|
7045
|
+
"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\n\n\n",
|
|
7046
|
+
"examples": [
|
|
7047
|
+
"$ sf hardis:org:diagnose:storage-stats",
|
|
7048
|
+
"$ sf hardis:org:diagnose:storage-stats --breakdown-field \"CreatedDate\"",
|
|
7049
|
+
"$ sf hardis:org:diagnose:storage-stats -b \"RecordType.Name\"",
|
|
7050
|
+
"$ sf hardis:org:diagnose:storage-stats --where \"CreatedDate = LAST_N_DAYS:365\"",
|
|
7051
|
+
"$ sf hardis:org:diagnose:storage-stats -w \"Status__c = 'Active'\"",
|
|
7052
|
+
"$ sf hardis:org:diagnose:storage-stats -b \"LastModifiedDate\" -w \"IsDeleted = false\""
|
|
7053
|
+
],
|
|
7054
|
+
"flags": {
|
|
7055
|
+
"json": {
|
|
7056
|
+
"description": "Format output as json.",
|
|
7057
|
+
"helpGroup": "GLOBAL",
|
|
7058
|
+
"name": "json",
|
|
7059
|
+
"allowNo": false,
|
|
7060
|
+
"type": "boolean"
|
|
7061
|
+
},
|
|
7062
|
+
"flags-dir": {
|
|
7063
|
+
"helpGroup": "GLOBAL",
|
|
7040
7064
|
"name": "flags-dir",
|
|
7041
7065
|
"summary": "Import flag values from a directory.",
|
|
7042
7066
|
"hasDynamicHelp": false,
|
|
@@ -7051,6 +7075,22 @@
|
|
|
7051
7075
|
"multiple": false,
|
|
7052
7076
|
"type": "option"
|
|
7053
7077
|
},
|
|
7078
|
+
"breakdown-field": {
|
|
7079
|
+
"char": "b",
|
|
7080
|
+
"description": "Field to use for storage stats breakdown. Example: \"CreatedDate\", \"LastModifiedDate\", \"RecordType.Name\", or custom fields like \"Status__c\"",
|
|
7081
|
+
"name": "breakdown-field",
|
|
7082
|
+
"hasDynamicHelp": false,
|
|
7083
|
+
"multiple": false,
|
|
7084
|
+
"type": "option"
|
|
7085
|
+
},
|
|
7086
|
+
"where": {
|
|
7087
|
+
"char": "w",
|
|
7088
|
+
"description": "WHERE clause to filter records in the query (without the WHERE keyword). Example: \"CreatedDate = LAST_N_DAYS:365\" or \"Status__c = 'Active'\"",
|
|
7089
|
+
"name": "where",
|
|
7090
|
+
"hasDynamicHelp": false,
|
|
7091
|
+
"multiple": false,
|
|
7092
|
+
"type": "option"
|
|
7093
|
+
},
|
|
7054
7094
|
"debug": {
|
|
7055
7095
|
"char": "d",
|
|
7056
7096
|
"description": "Activate debug mode (more logs)",
|
|
@@ -7089,31 +7129,14 @@
|
|
|
7089
7129
|
},
|
|
7090
7130
|
"hasDynamicHelp": true,
|
|
7091
7131
|
"hiddenAliases": [],
|
|
7092
|
-
"id": "hardis:org:diagnose:
|
|
7132
|
+
"id": "hardis:org:diagnose:storage-stats",
|
|
7093
7133
|
"pluginAlias": "sfdx-hardis",
|
|
7094
7134
|
"pluginName": "sfdx-hardis",
|
|
7095
7135
|
"pluginType": "core",
|
|
7096
7136
|
"strict": true,
|
|
7097
7137
|
"enableJsonFlag": true,
|
|
7098
|
-
"title": "
|
|
7099
|
-
"
|
|
7100
|
-
"Ant Migration Tool",
|
|
7101
|
-
"Chatter Desktop",
|
|
7102
|
-
"Chatter Mobile for BlackBerry",
|
|
7103
|
-
"Force.com IDE",
|
|
7104
|
-
"OIQ_Integration",
|
|
7105
|
-
"Salesforce CLI",
|
|
7106
|
-
"Salesforce Files",
|
|
7107
|
-
"Salesforce Mobile Dashboards",
|
|
7108
|
-
"Salesforce Touch",
|
|
7109
|
-
"Salesforce for Outlook",
|
|
7110
|
-
"SalesforceA",
|
|
7111
|
-
"SalesforceA for Android",
|
|
7112
|
-
"SalesforceA for iOS",
|
|
7113
|
-
"SalesforceDX Namespace Registry",
|
|
7114
|
-
"SalesforceIQ"
|
|
7115
|
-
],
|
|
7116
|
-
"requiresProject": false,
|
|
7138
|
+
"title": "Extract Data Storage stats",
|
|
7139
|
+
"requiresProject": true,
|
|
7117
7140
|
"isESM": true,
|
|
7118
7141
|
"relativePath": [
|
|
7119
7142
|
"lib",
|
|
@@ -7121,43 +7144,42 @@
|
|
|
7121
7144
|
"hardis",
|
|
7122
7145
|
"org",
|
|
7123
7146
|
"diagnose",
|
|
7124
|
-
"
|
|
7147
|
+
"storage-stats.js"
|
|
7125
7148
|
],
|
|
7126
7149
|
"aliasPermutations": [],
|
|
7127
7150
|
"permutations": [
|
|
7128
|
-
"hardis:org:diagnose:
|
|
7129
|
-
"org:hardis:diagnose:
|
|
7130
|
-
"org:diagnose:hardis:
|
|
7131
|
-
"org:diagnose:
|
|
7132
|
-
"hardis:diagnose:org:
|
|
7133
|
-
"diagnose:hardis:org:
|
|
7134
|
-
"diagnose:org:hardis:
|
|
7135
|
-
"diagnose:org:
|
|
7136
|
-
"hardis:diagnose:
|
|
7137
|
-
"diagnose:hardis:
|
|
7138
|
-
"diagnose:
|
|
7139
|
-
"diagnose:
|
|
7140
|
-
"hardis:org:
|
|
7141
|
-
"org:hardis:
|
|
7142
|
-
"org:
|
|
7143
|
-
"org:
|
|
7144
|
-
"hardis:
|
|
7145
|
-
"
|
|
7146
|
-
"
|
|
7147
|
-
"
|
|
7148
|
-
"hardis:
|
|
7149
|
-
"
|
|
7150
|
-
"
|
|
7151
|
-
"
|
|
7151
|
+
"hardis:org:diagnose:storage-stats",
|
|
7152
|
+
"org:hardis:diagnose:storage-stats",
|
|
7153
|
+
"org:diagnose:hardis:storage-stats",
|
|
7154
|
+
"org:diagnose:storage-stats:hardis",
|
|
7155
|
+
"hardis:diagnose:org:storage-stats",
|
|
7156
|
+
"diagnose:hardis:org:storage-stats",
|
|
7157
|
+
"diagnose:org:hardis:storage-stats",
|
|
7158
|
+
"diagnose:org:storage-stats:hardis",
|
|
7159
|
+
"hardis:diagnose:storage-stats:org",
|
|
7160
|
+
"diagnose:hardis:storage-stats:org",
|
|
7161
|
+
"diagnose:storage-stats:hardis:org",
|
|
7162
|
+
"diagnose:storage-stats:org:hardis",
|
|
7163
|
+
"hardis:org:storage-stats:diagnose",
|
|
7164
|
+
"org:hardis:storage-stats:diagnose",
|
|
7165
|
+
"org:storage-stats:hardis:diagnose",
|
|
7166
|
+
"org:storage-stats:diagnose:hardis",
|
|
7167
|
+
"hardis:storage-stats:org:diagnose",
|
|
7168
|
+
"storage-stats:hardis:org:diagnose",
|
|
7169
|
+
"storage-stats:org:hardis:diagnose",
|
|
7170
|
+
"storage-stats:org:diagnose:hardis",
|
|
7171
|
+
"hardis:storage-stats:diagnose:org",
|
|
7172
|
+
"storage-stats:hardis:diagnose:org",
|
|
7173
|
+
"storage-stats:diagnose:hardis:org",
|
|
7174
|
+
"storage-stats:diagnose:org:hardis"
|
|
7152
7175
|
]
|
|
7153
7176
|
},
|
|
7154
|
-
"hardis:org:diagnose:
|
|
7177
|
+
"hardis:org:diagnose:unsecure-connected-apps": {
|
|
7155
7178
|
"aliases": [],
|
|
7156
7179
|
"args": {},
|
|
7157
|
-
"description": "\n## Command Behavior\n\n**Detects
|
|
7180
|
+
"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",
|
|
7158
7181
|
"examples": [
|
|
7159
|
-
"$ sf hardis:org:diagnose:
|
|
7160
|
-
"$ sf hardis:org:diagnose:unusedlicenses --fix"
|
|
7182
|
+
"$ sf hardis:org:diagnose:unsecure-connected-apps"
|
|
7161
7183
|
],
|
|
7162
7184
|
"flags": {
|
|
7163
7185
|
"json": {
|
|
@@ -7221,32 +7243,14 @@
|
|
|
7221
7243
|
},
|
|
7222
7244
|
"hasDynamicHelp": true,
|
|
7223
7245
|
"hiddenAliases": [],
|
|
7224
|
-
"id": "hardis:org:diagnose:
|
|
7246
|
+
"id": "hardis:org:diagnose:unsecure-connected-apps",
|
|
7225
7247
|
"pluginAlias": "sfdx-hardis",
|
|
7226
7248
|
"pluginName": "sfdx-hardis",
|
|
7227
7249
|
"pluginType": "core",
|
|
7228
7250
|
"strict": true,
|
|
7229
7251
|
"enableJsonFlag": true,
|
|
7230
|
-
"title": "Detect
|
|
7252
|
+
"title": "Detect Unsecured Connected Apps",
|
|
7231
7253
|
"requiresProject": false,
|
|
7232
|
-
"additionalPermissionSetsToAlwaysGet": [
|
|
7233
|
-
"Sales_User"
|
|
7234
|
-
],
|
|
7235
|
-
"permSetsPermSetLicenses": [
|
|
7236
|
-
{
|
|
7237
|
-
"permSet": "Sales_User",
|
|
7238
|
-
"permSetLicense": "SalesUserPsl"
|
|
7239
|
-
}
|
|
7240
|
-
],
|
|
7241
|
-
"profilesPermissionSetLicenses": [
|
|
7242
|
-
{
|
|
7243
|
-
"profile": "Salesforce API Only",
|
|
7244
|
-
"permSetLicense": "SalesforceAPIIntegrationPsl"
|
|
7245
|
-
}
|
|
7246
|
-
],
|
|
7247
|
-
"alwaysExcludeForActiveUsersPermissionSetLicenses": [
|
|
7248
|
-
"IdentityConnect"
|
|
7249
|
-
],
|
|
7250
7254
|
"isESM": true,
|
|
7251
7255
|
"relativePath": [
|
|
7252
7256
|
"lib",
|
|
@@ -7254,46 +7258,43 @@
|
|
|
7254
7258
|
"hardis",
|
|
7255
7259
|
"org",
|
|
7256
7260
|
"diagnose",
|
|
7257
|
-
"
|
|
7261
|
+
"unsecure-connected-apps.js"
|
|
7258
7262
|
],
|
|
7259
7263
|
"aliasPermutations": [],
|
|
7260
7264
|
"permutations": [
|
|
7261
|
-
"hardis:org:diagnose:
|
|
7262
|
-
"org:hardis:diagnose:
|
|
7263
|
-
"org:diagnose:hardis:
|
|
7264
|
-
"org:diagnose:
|
|
7265
|
-
"hardis:diagnose:org:
|
|
7266
|
-
"diagnose:hardis:org:
|
|
7267
|
-
"diagnose:org:hardis:
|
|
7268
|
-
"diagnose:org:
|
|
7269
|
-
"hardis:diagnose:
|
|
7270
|
-
"diagnose:hardis:
|
|
7271
|
-
"diagnose:
|
|
7272
|
-
"diagnose:
|
|
7273
|
-
"hardis:org:
|
|
7274
|
-
"org:hardis:
|
|
7275
|
-
"org:
|
|
7276
|
-
"org:
|
|
7277
|
-
"hardis:
|
|
7278
|
-
"
|
|
7279
|
-
"
|
|
7280
|
-
"
|
|
7281
|
-
"hardis:
|
|
7282
|
-
"
|
|
7283
|
-
"
|
|
7284
|
-
"
|
|
7265
|
+
"hardis:org:diagnose:unsecure-connected-apps",
|
|
7266
|
+
"org:hardis:diagnose:unsecure-connected-apps",
|
|
7267
|
+
"org:diagnose:hardis:unsecure-connected-apps",
|
|
7268
|
+
"org:diagnose:unsecure-connected-apps:hardis",
|
|
7269
|
+
"hardis:diagnose:org:unsecure-connected-apps",
|
|
7270
|
+
"diagnose:hardis:org:unsecure-connected-apps",
|
|
7271
|
+
"diagnose:org:hardis:unsecure-connected-apps",
|
|
7272
|
+
"diagnose:org:unsecure-connected-apps:hardis",
|
|
7273
|
+
"hardis:diagnose:unsecure-connected-apps:org",
|
|
7274
|
+
"diagnose:hardis:unsecure-connected-apps:org",
|
|
7275
|
+
"diagnose:unsecure-connected-apps:hardis:org",
|
|
7276
|
+
"diagnose:unsecure-connected-apps:org:hardis",
|
|
7277
|
+
"hardis:org:unsecure-connected-apps:diagnose",
|
|
7278
|
+
"org:hardis:unsecure-connected-apps:diagnose",
|
|
7279
|
+
"org:unsecure-connected-apps:hardis:diagnose",
|
|
7280
|
+
"org:unsecure-connected-apps:diagnose:hardis",
|
|
7281
|
+
"hardis:unsecure-connected-apps:org:diagnose",
|
|
7282
|
+
"unsecure-connected-apps:hardis:org:diagnose",
|
|
7283
|
+
"unsecure-connected-apps:org:hardis:diagnose",
|
|
7284
|
+
"unsecure-connected-apps:org:diagnose:hardis",
|
|
7285
|
+
"hardis:unsecure-connected-apps:diagnose:org",
|
|
7286
|
+
"unsecure-connected-apps:hardis:diagnose:org",
|
|
7287
|
+
"unsecure-connected-apps:diagnose:hardis:org",
|
|
7288
|
+
"unsecure-connected-apps:diagnose:org:hardis"
|
|
7285
7289
|
]
|
|
7286
7290
|
},
|
|
7287
|
-
"hardis:org:diagnose:
|
|
7291
|
+
"hardis:org:diagnose:unused-apex-classes": {
|
|
7288
7292
|
"aliases": [],
|
|
7289
7293
|
"args": {},
|
|
7290
|
-
"description": "
|
|
7294
|
+
"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\n",
|
|
7291
7295
|
"examples": [
|
|
7292
|
-
"$ sf hardis:org:diagnose:
|
|
7293
|
-
"$ sf hardis:org:diagnose:
|
|
7294
|
-
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm",
|
|
7295
|
-
"$ sf hardis:org:diagnose:unusedusers --days 60 --licenseidentifiers SFDC,AUL,AUL1",
|
|
7296
|
-
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm --returnactiveusers"
|
|
7296
|
+
"$ sf hardis:org:diagnose:unused-apex-classes",
|
|
7297
|
+
"$ sf hardis:org:diagnose:unused-apex-classes --days 700"
|
|
7297
7298
|
],
|
|
7298
7299
|
"flags": {
|
|
7299
7300
|
"json": {
|
|
@@ -7327,33 +7328,6 @@
|
|
|
7327
7328
|
"multiple": false,
|
|
7328
7329
|
"type": "option"
|
|
7329
7330
|
},
|
|
7330
|
-
"licensetypes": {
|
|
7331
|
-
"char": "l",
|
|
7332
|
-
"description": "Type of licenses to check. If set, do not use licenseidentifiers option. In CI, default is all-crm",
|
|
7333
|
-
"name": "licensetypes",
|
|
7334
|
-
"hasDynamicHelp": false,
|
|
7335
|
-
"multiple": false,
|
|
7336
|
-
"options": [
|
|
7337
|
-
"all",
|
|
7338
|
-
"all-crm",
|
|
7339
|
-
"all-paying"
|
|
7340
|
-
],
|
|
7341
|
-
"type": "option"
|
|
7342
|
-
},
|
|
7343
|
-
"licenseidentifiers": {
|
|
7344
|
-
"char": "i",
|
|
7345
|
-
"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",
|
|
7346
|
-
"name": "licenseidentifiers",
|
|
7347
|
-
"hasDynamicHelp": false,
|
|
7348
|
-
"multiple": false,
|
|
7349
|
-
"type": "option"
|
|
7350
|
-
},
|
|
7351
|
-
"returnactiveusers": {
|
|
7352
|
-
"description": "Inverts the command by returning the active users",
|
|
7353
|
-
"name": "returnactiveusers",
|
|
7354
|
-
"allowNo": false,
|
|
7355
|
-
"type": "boolean"
|
|
7356
|
-
},
|
|
7357
7331
|
"debug": {
|
|
7358
7332
|
"char": "d",
|
|
7359
7333
|
"description": "Activate debug mode (more logs)",
|
|
@@ -7392,13 +7366,13 @@
|
|
|
7392
7366
|
},
|
|
7393
7367
|
"hasDynamicHelp": true,
|
|
7394
7368
|
"hiddenAliases": [],
|
|
7395
|
-
"id": "hardis:org:diagnose:
|
|
7369
|
+
"id": "hardis:org:diagnose:unused-apex-classes",
|
|
7396
7370
|
"pluginAlias": "sfdx-hardis",
|
|
7397
7371
|
"pluginName": "sfdx-hardis",
|
|
7398
7372
|
"pluginType": "core",
|
|
7399
7373
|
"strict": true,
|
|
7400
7374
|
"enableJsonFlag": true,
|
|
7401
|
-
"title": "Detect unused
|
|
7375
|
+
"title": "Detect unused Apex classes in an org",
|
|
7402
7376
|
"requiresProject": false,
|
|
7403
7377
|
"isESM": true,
|
|
7404
7378
|
"relativePath": [
|
|
@@ -7407,42 +7381,42 @@
|
|
|
7407
7381
|
"hardis",
|
|
7408
7382
|
"org",
|
|
7409
7383
|
"diagnose",
|
|
7410
|
-
"
|
|
7384
|
+
"unused-apex-classes.js"
|
|
7411
7385
|
],
|
|
7412
7386
|
"aliasPermutations": [],
|
|
7413
7387
|
"permutations": [
|
|
7414
|
-
"hardis:org:diagnose:
|
|
7415
|
-
"org:hardis:diagnose:
|
|
7416
|
-
"org:diagnose:hardis:
|
|
7417
|
-
"org:diagnose:
|
|
7418
|
-
"hardis:diagnose:org:
|
|
7419
|
-
"diagnose:hardis:org:
|
|
7420
|
-
"diagnose:org:hardis:
|
|
7421
|
-
"diagnose:org:
|
|
7422
|
-
"hardis:diagnose:
|
|
7423
|
-
"diagnose:hardis:
|
|
7424
|
-
"diagnose:
|
|
7425
|
-
"diagnose:
|
|
7426
|
-
"hardis:org:
|
|
7427
|
-
"org:hardis:
|
|
7428
|
-
"org:
|
|
7429
|
-
"org:
|
|
7430
|
-
"hardis:
|
|
7431
|
-
"
|
|
7432
|
-
"
|
|
7433
|
-
"
|
|
7434
|
-
"hardis:
|
|
7435
|
-
"
|
|
7436
|
-
"
|
|
7437
|
-
"
|
|
7388
|
+
"hardis:org:diagnose:unused-apex-classes",
|
|
7389
|
+
"org:hardis:diagnose:unused-apex-classes",
|
|
7390
|
+
"org:diagnose:hardis:unused-apex-classes",
|
|
7391
|
+
"org:diagnose:unused-apex-classes:hardis",
|
|
7392
|
+
"hardis:diagnose:org:unused-apex-classes",
|
|
7393
|
+
"diagnose:hardis:org:unused-apex-classes",
|
|
7394
|
+
"diagnose:org:hardis:unused-apex-classes",
|
|
7395
|
+
"diagnose:org:unused-apex-classes:hardis",
|
|
7396
|
+
"hardis:diagnose:unused-apex-classes:org",
|
|
7397
|
+
"diagnose:hardis:unused-apex-classes:org",
|
|
7398
|
+
"diagnose:unused-apex-classes:hardis:org",
|
|
7399
|
+
"diagnose:unused-apex-classes:org:hardis",
|
|
7400
|
+
"hardis:org:unused-apex-classes:diagnose",
|
|
7401
|
+
"org:hardis:unused-apex-classes:diagnose",
|
|
7402
|
+
"org:unused-apex-classes:hardis:diagnose",
|
|
7403
|
+
"org:unused-apex-classes:diagnose:hardis",
|
|
7404
|
+
"hardis:unused-apex-classes:org:diagnose",
|
|
7405
|
+
"unused-apex-classes:hardis:org:diagnose",
|
|
7406
|
+
"unused-apex-classes:org:hardis:diagnose",
|
|
7407
|
+
"unused-apex-classes:org:diagnose:hardis",
|
|
7408
|
+
"hardis:unused-apex-classes:diagnose:org",
|
|
7409
|
+
"unused-apex-classes:hardis:diagnose:org",
|
|
7410
|
+
"unused-apex-classes:diagnose:hardis:org",
|
|
7411
|
+
"unused-apex-classes:diagnose:org:hardis"
|
|
7438
7412
|
]
|
|
7439
7413
|
},
|
|
7440
|
-
"hardis:org:
|
|
7414
|
+
"hardis:org:diagnose:unused-connected-apps": {
|
|
7441
7415
|
"aliases": [],
|
|
7442
7416
|
"args": {},
|
|
7443
|
-
"description": "\n## Command Behavior\n\n**
|
|
7417
|
+
"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",
|
|
7444
7418
|
"examples": [
|
|
7445
|
-
"$ sf hardis:org:
|
|
7419
|
+
"$ sf hardis:org:diagnose:unused-connected-apps"
|
|
7446
7420
|
],
|
|
7447
7421
|
"flags": {
|
|
7448
7422
|
"json": {
|
|
@@ -7460,48 +7434,14 @@
|
|
|
7460
7434
|
"multiple": false,
|
|
7461
7435
|
"type": "option"
|
|
7462
7436
|
},
|
|
7463
|
-
"
|
|
7464
|
-
"char": "
|
|
7465
|
-
"description": "
|
|
7466
|
-
"name": "
|
|
7467
|
-
"hasDynamicHelp": false,
|
|
7468
|
-
"multiple": false,
|
|
7469
|
-
"type": "option"
|
|
7470
|
-
},
|
|
7471
|
-
"chunksize": {
|
|
7472
|
-
"char": "c",
|
|
7473
|
-
"description": "Number of records to add in a chunk before it is processed",
|
|
7474
|
-
"name": "chunksize",
|
|
7475
|
-
"default": 1000,
|
|
7476
|
-
"hasDynamicHelp": false,
|
|
7477
|
-
"multiple": false,
|
|
7478
|
-
"type": "option"
|
|
7479
|
-
},
|
|
7480
|
-
"polltimeout": {
|
|
7481
|
-
"char": "t",
|
|
7482
|
-
"description": "Timeout in MS for Bulk API calls",
|
|
7483
|
-
"name": "polltimeout",
|
|
7484
|
-
"default": 300000,
|
|
7485
|
-
"hasDynamicHelp": false,
|
|
7486
|
-
"multiple": false,
|
|
7487
|
-
"type": "option"
|
|
7488
|
-
},
|
|
7489
|
-
"startchunknumber": {
|
|
7490
|
-
"char": "s",
|
|
7491
|
-
"description": "Chunk number to start from",
|
|
7492
|
-
"name": "startchunknumber",
|
|
7493
|
-
"default": 0,
|
|
7437
|
+
"outputfile": {
|
|
7438
|
+
"char": "f",
|
|
7439
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
7440
|
+
"name": "outputfile",
|
|
7494
7441
|
"hasDynamicHelp": false,
|
|
7495
7442
|
"multiple": false,
|
|
7496
7443
|
"type": "option"
|
|
7497
7444
|
},
|
|
7498
|
-
"resume": {
|
|
7499
|
-
"char": "r",
|
|
7500
|
-
"description": "Resume previous export by checking existing files (default in CI)",
|
|
7501
|
-
"name": "resume",
|
|
7502
|
-
"allowNo": false,
|
|
7503
|
-
"type": "boolean"
|
|
7504
|
-
},
|
|
7505
7445
|
"debug": {
|
|
7506
7446
|
"char": "d",
|
|
7507
7447
|
"description": "Activate debug mode (more logs)",
|
|
@@ -7540,13 +7480,30 @@
|
|
|
7540
7480
|
},
|
|
7541
7481
|
"hasDynamicHelp": true,
|
|
7542
7482
|
"hiddenAliases": [],
|
|
7543
|
-
"id": "hardis:org:
|
|
7483
|
+
"id": "hardis:org:diagnose:unused-connected-apps",
|
|
7544
7484
|
"pluginAlias": "sfdx-hardis",
|
|
7545
7485
|
"pluginName": "sfdx-hardis",
|
|
7546
7486
|
"pluginType": "core",
|
|
7547
7487
|
"strict": true,
|
|
7548
7488
|
"enableJsonFlag": true,
|
|
7549
|
-
"title": "
|
|
7489
|
+
"title": "Unused Connected Apps in an org",
|
|
7490
|
+
"allowedInactiveConnectedApps": [
|
|
7491
|
+
"Ant Migration Tool",
|
|
7492
|
+
"Chatter Desktop",
|
|
7493
|
+
"Chatter Mobile for BlackBerry",
|
|
7494
|
+
"Force.com IDE",
|
|
7495
|
+
"OIQ_Integration",
|
|
7496
|
+
"Salesforce CLI",
|
|
7497
|
+
"Salesforce Files",
|
|
7498
|
+
"Salesforce Mobile Dashboards",
|
|
7499
|
+
"Salesforce Touch",
|
|
7500
|
+
"Salesforce for Outlook",
|
|
7501
|
+
"SalesforceA",
|
|
7502
|
+
"SalesforceA for Android",
|
|
7503
|
+
"SalesforceA for iOS",
|
|
7504
|
+
"SalesforceDX Namespace Registry",
|
|
7505
|
+
"SalesforceIQ"
|
|
7506
|
+
],
|
|
7550
7507
|
"requiresProject": false,
|
|
7551
7508
|
"isESM": true,
|
|
7552
7509
|
"relativePath": [
|
|
@@ -7554,43 +7511,44 @@
|
|
|
7554
7511
|
"commands",
|
|
7555
7512
|
"hardis",
|
|
7556
7513
|
"org",
|
|
7557
|
-
"
|
|
7558
|
-
"
|
|
7514
|
+
"diagnose",
|
|
7515
|
+
"unused-connected-apps.js"
|
|
7559
7516
|
],
|
|
7560
7517
|
"aliasPermutations": [],
|
|
7561
7518
|
"permutations": [
|
|
7562
|
-
"hardis:org:
|
|
7563
|
-
"org:hardis:
|
|
7564
|
-
"org:
|
|
7565
|
-
"org:
|
|
7566
|
-
"hardis:
|
|
7567
|
-
"
|
|
7568
|
-
"
|
|
7569
|
-
"
|
|
7570
|
-
"hardis:
|
|
7571
|
-
"
|
|
7572
|
-
"
|
|
7573
|
-
"
|
|
7574
|
-
"hardis:org:
|
|
7575
|
-
"org:hardis:
|
|
7576
|
-
"org:
|
|
7577
|
-
"org:
|
|
7578
|
-
"hardis:
|
|
7579
|
-
"
|
|
7580
|
-
"
|
|
7581
|
-
"
|
|
7582
|
-
"hardis:
|
|
7583
|
-
"
|
|
7584
|
-
"
|
|
7585
|
-
"
|
|
7519
|
+
"hardis:org:diagnose:unused-connected-apps",
|
|
7520
|
+
"org:hardis:diagnose:unused-connected-apps",
|
|
7521
|
+
"org:diagnose:hardis:unused-connected-apps",
|
|
7522
|
+
"org:diagnose:unused-connected-apps:hardis",
|
|
7523
|
+
"hardis:diagnose:org:unused-connected-apps",
|
|
7524
|
+
"diagnose:hardis:org:unused-connected-apps",
|
|
7525
|
+
"diagnose:org:hardis:unused-connected-apps",
|
|
7526
|
+
"diagnose:org:unused-connected-apps:hardis",
|
|
7527
|
+
"hardis:diagnose:unused-connected-apps:org",
|
|
7528
|
+
"diagnose:hardis:unused-connected-apps:org",
|
|
7529
|
+
"diagnose:unused-connected-apps:hardis:org",
|
|
7530
|
+
"diagnose:unused-connected-apps:org:hardis",
|
|
7531
|
+
"hardis:org:unused-connected-apps:diagnose",
|
|
7532
|
+
"org:hardis:unused-connected-apps:diagnose",
|
|
7533
|
+
"org:unused-connected-apps:hardis:diagnose",
|
|
7534
|
+
"org:unused-connected-apps:diagnose:hardis",
|
|
7535
|
+
"hardis:unused-connected-apps:org:diagnose",
|
|
7536
|
+
"unused-connected-apps:hardis:org:diagnose",
|
|
7537
|
+
"unused-connected-apps:org:hardis:diagnose",
|
|
7538
|
+
"unused-connected-apps:org:diagnose:hardis",
|
|
7539
|
+
"hardis:unused-connected-apps:diagnose:org",
|
|
7540
|
+
"unused-connected-apps:hardis:diagnose:org",
|
|
7541
|
+
"unused-connected-apps:diagnose:hardis:org",
|
|
7542
|
+
"unused-connected-apps:diagnose:org:hardis"
|
|
7586
7543
|
]
|
|
7587
7544
|
},
|
|
7588
|
-
"hardis:org:
|
|
7545
|
+
"hardis:org:diagnose:unusedlicenses": {
|
|
7589
7546
|
"aliases": [],
|
|
7590
7547
|
"args": {},
|
|
7591
|
-
"description": "\
|
|
7548
|
+
"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",
|
|
7592
7549
|
"examples": [
|
|
7593
|
-
"$ sf hardis:org:
|
|
7550
|
+
"$ sf hardis:org:diagnose:unusedlicenses",
|
|
7551
|
+
"$ sf hardis:org:diagnose:unusedlicenses --fix"
|
|
7594
7552
|
],
|
|
7595
7553
|
"flags": {
|
|
7596
7554
|
"json": {
|
|
@@ -7608,21 +7566,14 @@
|
|
|
7608
7566
|
"multiple": false,
|
|
7609
7567
|
"type": "option"
|
|
7610
7568
|
},
|
|
7611
|
-
"
|
|
7612
|
-
"char": "
|
|
7613
|
-
"description": "
|
|
7614
|
-
"name": "
|
|
7569
|
+
"outputfile": {
|
|
7570
|
+
"char": "f",
|
|
7571
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
7572
|
+
"name": "outputfile",
|
|
7615
7573
|
"hasDynamicHelp": false,
|
|
7616
7574
|
"multiple": false,
|
|
7617
7575
|
"type": "option"
|
|
7618
7576
|
},
|
|
7619
|
-
"overwrite": {
|
|
7620
|
-
"char": "f",
|
|
7621
|
-
"description": "Override existing files (doubles the number of API calls)",
|
|
7622
|
-
"name": "overwrite",
|
|
7623
|
-
"allowNo": false,
|
|
7624
|
-
"type": "boolean"
|
|
7625
|
-
},
|
|
7626
7577
|
"debug": {
|
|
7627
7578
|
"char": "d",
|
|
7628
7579
|
"description": "Activate debug mode (more logs)",
|
|
@@ -7661,59 +7612,79 @@
|
|
|
7661
7612
|
},
|
|
7662
7613
|
"hasDynamicHelp": true,
|
|
7663
7614
|
"hiddenAliases": [],
|
|
7664
|
-
"id": "hardis:org:
|
|
7615
|
+
"id": "hardis:org:diagnose:unusedlicenses",
|
|
7665
7616
|
"pluginAlias": "sfdx-hardis",
|
|
7666
7617
|
"pluginName": "sfdx-hardis",
|
|
7667
7618
|
"pluginType": "core",
|
|
7668
7619
|
"strict": true,
|
|
7669
7620
|
"enableJsonFlag": true,
|
|
7670
|
-
"title": "
|
|
7621
|
+
"title": "Detect unused Permission Set Licenses (beta)",
|
|
7671
7622
|
"requiresProject": false,
|
|
7623
|
+
"additionalPermissionSetsToAlwaysGet": [
|
|
7624
|
+
"Sales_User"
|
|
7625
|
+
],
|
|
7626
|
+
"permSetsPermSetLicenses": [
|
|
7627
|
+
{
|
|
7628
|
+
"permSet": "Sales_User",
|
|
7629
|
+
"permSetLicense": "SalesUserPsl"
|
|
7630
|
+
}
|
|
7631
|
+
],
|
|
7632
|
+
"profilesPermissionSetLicenses": [
|
|
7633
|
+
{
|
|
7634
|
+
"profile": "Salesforce API Only",
|
|
7635
|
+
"permSetLicense": "SalesforceAPIIntegrationPsl"
|
|
7636
|
+
}
|
|
7637
|
+
],
|
|
7638
|
+
"alwaysExcludeForActiveUsersPermissionSetLicenses": [
|
|
7639
|
+
"IdentityConnect"
|
|
7640
|
+
],
|
|
7672
7641
|
"isESM": true,
|
|
7673
7642
|
"relativePath": [
|
|
7674
7643
|
"lib",
|
|
7675
7644
|
"commands",
|
|
7676
7645
|
"hardis",
|
|
7677
7646
|
"org",
|
|
7678
|
-
"
|
|
7679
|
-
"
|
|
7647
|
+
"diagnose",
|
|
7648
|
+
"unusedlicenses.js"
|
|
7680
7649
|
],
|
|
7681
7650
|
"aliasPermutations": [],
|
|
7682
7651
|
"permutations": [
|
|
7683
|
-
"hardis:org:
|
|
7684
|
-
"org:hardis:
|
|
7685
|
-
"org:
|
|
7686
|
-
"org:
|
|
7687
|
-
"hardis:
|
|
7688
|
-
"
|
|
7689
|
-
"
|
|
7690
|
-
"
|
|
7691
|
-
"hardis:
|
|
7692
|
-
"
|
|
7693
|
-
"
|
|
7694
|
-
"
|
|
7695
|
-
"hardis:org:
|
|
7696
|
-
"org:hardis:
|
|
7697
|
-
"org:
|
|
7698
|
-
"org:
|
|
7699
|
-
"hardis:
|
|
7700
|
-
"
|
|
7701
|
-
"
|
|
7702
|
-
"
|
|
7703
|
-
"hardis:
|
|
7704
|
-
"
|
|
7705
|
-
"
|
|
7706
|
-
"
|
|
7652
|
+
"hardis:org:diagnose:unusedlicenses",
|
|
7653
|
+
"org:hardis:diagnose:unusedlicenses",
|
|
7654
|
+
"org:diagnose:hardis:unusedlicenses",
|
|
7655
|
+
"org:diagnose:unusedlicenses:hardis",
|
|
7656
|
+
"hardis:diagnose:org:unusedlicenses",
|
|
7657
|
+
"diagnose:hardis:org:unusedlicenses",
|
|
7658
|
+
"diagnose:org:hardis:unusedlicenses",
|
|
7659
|
+
"diagnose:org:unusedlicenses:hardis",
|
|
7660
|
+
"hardis:diagnose:unusedlicenses:org",
|
|
7661
|
+
"diagnose:hardis:unusedlicenses:org",
|
|
7662
|
+
"diagnose:unusedlicenses:hardis:org",
|
|
7663
|
+
"diagnose:unusedlicenses:org:hardis",
|
|
7664
|
+
"hardis:org:unusedlicenses:diagnose",
|
|
7665
|
+
"org:hardis:unusedlicenses:diagnose",
|
|
7666
|
+
"org:unusedlicenses:hardis:diagnose",
|
|
7667
|
+
"org:unusedlicenses:diagnose:hardis",
|
|
7668
|
+
"hardis:unusedlicenses:org:diagnose",
|
|
7669
|
+
"unusedlicenses:hardis:org:diagnose",
|
|
7670
|
+
"unusedlicenses:org:hardis:diagnose",
|
|
7671
|
+
"unusedlicenses:org:diagnose:hardis",
|
|
7672
|
+
"hardis:unusedlicenses:diagnose:org",
|
|
7673
|
+
"unusedlicenses:hardis:diagnose:org",
|
|
7674
|
+
"unusedlicenses:diagnose:hardis:org",
|
|
7675
|
+
"unusedlicenses:diagnose:org:hardis"
|
|
7707
7676
|
]
|
|
7708
7677
|
},
|
|
7709
|
-
"hardis:org:
|
|
7678
|
+
"hardis:org:diagnose:unusedusers": {
|
|
7710
7679
|
"aliases": [],
|
|
7711
7680
|
"args": {},
|
|
7712
|
-
"description": "\n## Command Behavior\n\n**
|
|
7681
|
+
"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>",
|
|
7713
7682
|
"examples": [
|
|
7714
|
-
"$ sf hardis:org:
|
|
7715
|
-
"$ sf hardis:org:
|
|
7716
|
-
"$ sf hardis:org:
|
|
7683
|
+
"$ sf hardis:org:diagnose:unusedusers",
|
|
7684
|
+
"$ sf hardis:org:diagnose:unusedusers --days 365",
|
|
7685
|
+
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm",
|
|
7686
|
+
"$ sf hardis:org:diagnose:unusedusers --days 60 --licenseidentifiers SFDC,AUL,AUL1",
|
|
7687
|
+
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm --returnactiveusers"
|
|
7717
7688
|
],
|
|
7718
7689
|
"flags": {
|
|
7719
7690
|
"json": {
|
|
@@ -7732,12 +7703,48 @@
|
|
|
7732
7703
|
"type": "option"
|
|
7733
7704
|
},
|
|
7734
7705
|
"outputfile": {
|
|
7735
|
-
"
|
|
7706
|
+
"char": "f",
|
|
7707
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
7736
7708
|
"name": "outputfile",
|
|
7737
7709
|
"hasDynamicHelp": false,
|
|
7738
7710
|
"multiple": false,
|
|
7739
7711
|
"type": "option"
|
|
7740
7712
|
},
|
|
7713
|
+
"days": {
|
|
7714
|
+
"char": "t",
|
|
7715
|
+
"description": "Extracts the users that have been inactive for the amount of days specified. In CI, default is 180 days",
|
|
7716
|
+
"name": "days",
|
|
7717
|
+
"hasDynamicHelp": false,
|
|
7718
|
+
"multiple": false,
|
|
7719
|
+
"type": "option"
|
|
7720
|
+
},
|
|
7721
|
+
"licensetypes": {
|
|
7722
|
+
"char": "l",
|
|
7723
|
+
"description": "Type of licenses to check. If set, do not use licenseidentifiers option. In CI, default is all-crm",
|
|
7724
|
+
"name": "licensetypes",
|
|
7725
|
+
"hasDynamicHelp": false,
|
|
7726
|
+
"multiple": false,
|
|
7727
|
+
"options": [
|
|
7728
|
+
"all",
|
|
7729
|
+
"all-crm",
|
|
7730
|
+
"all-paying"
|
|
7731
|
+
],
|
|
7732
|
+
"type": "option"
|
|
7733
|
+
},
|
|
7734
|
+
"licenseidentifiers": {
|
|
7735
|
+
"char": "i",
|
|
7736
|
+
"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",
|
|
7737
|
+
"name": "licenseidentifiers",
|
|
7738
|
+
"hasDynamicHelp": false,
|
|
7739
|
+
"multiple": false,
|
|
7740
|
+
"type": "option"
|
|
7741
|
+
},
|
|
7742
|
+
"returnactiveusers": {
|
|
7743
|
+
"description": "Inverts the command by returning the active users",
|
|
7744
|
+
"name": "returnactiveusers",
|
|
7745
|
+
"allowNo": false,
|
|
7746
|
+
"type": "boolean"
|
|
7747
|
+
},
|
|
7741
7748
|
"debug": {
|
|
7742
7749
|
"char": "d",
|
|
7743
7750
|
"description": "Activate debug mode (more logs)",
|
|
@@ -7745,13 +7752,6 @@
|
|
|
7745
7752
|
"allowNo": false,
|
|
7746
7753
|
"type": "boolean"
|
|
7747
7754
|
},
|
|
7748
|
-
"no-prompt": {
|
|
7749
|
-
"char": "n",
|
|
7750
|
-
"description": "Do not prompt for org username, use the default one",
|
|
7751
|
-
"name": "no-prompt",
|
|
7752
|
-
"allowNo": false,
|
|
7753
|
-
"type": "boolean"
|
|
7754
|
-
},
|
|
7755
7755
|
"websocket": {
|
|
7756
7756
|
"description": "Websocket host:port for VsCode SFDX Hardis UI integration",
|
|
7757
7757
|
"name": "websocket",
|
|
@@ -7783,13 +7783,13 @@
|
|
|
7783
7783
|
},
|
|
7784
7784
|
"hasDynamicHelp": true,
|
|
7785
7785
|
"hiddenAliases": [],
|
|
7786
|
-
"id": "hardis:org:
|
|
7786
|
+
"id": "hardis:org:diagnose:unusedusers",
|
|
7787
7787
|
"pluginAlias": "sfdx-hardis",
|
|
7788
7788
|
"pluginName": "sfdx-hardis",
|
|
7789
7789
|
"pluginType": "core",
|
|
7790
7790
|
"strict": true,
|
|
7791
7791
|
"enableJsonFlag": true,
|
|
7792
|
-
"title": "
|
|
7792
|
+
"title": "Detect unused Users in Salesforce",
|
|
7793
7793
|
"requiresProject": false,
|
|
7794
7794
|
"isESM": true,
|
|
7795
7795
|
"relativePath": [
|
|
@@ -7797,35 +7797,35 @@
|
|
|
7797
7797
|
"commands",
|
|
7798
7798
|
"hardis",
|
|
7799
7799
|
"org",
|
|
7800
|
-
"
|
|
7801
|
-
"
|
|
7800
|
+
"diagnose",
|
|
7801
|
+
"unusedusers.js"
|
|
7802
7802
|
],
|
|
7803
7803
|
"aliasPermutations": [],
|
|
7804
7804
|
"permutations": [
|
|
7805
|
-
"hardis:org:
|
|
7806
|
-
"org:hardis:
|
|
7807
|
-
"org:
|
|
7808
|
-
"org:
|
|
7809
|
-
"hardis:
|
|
7810
|
-
"
|
|
7811
|
-
"
|
|
7812
|
-
"
|
|
7813
|
-
"hardis:
|
|
7814
|
-
"
|
|
7815
|
-
"
|
|
7816
|
-
"
|
|
7817
|
-
"hardis:org:
|
|
7818
|
-
"org:hardis:
|
|
7819
|
-
"org:
|
|
7820
|
-
"org:
|
|
7821
|
-
"hardis:
|
|
7822
|
-
"
|
|
7823
|
-
"
|
|
7824
|
-
"
|
|
7825
|
-
"hardis:
|
|
7826
|
-
"
|
|
7827
|
-
"
|
|
7828
|
-
"
|
|
7805
|
+
"hardis:org:diagnose:unusedusers",
|
|
7806
|
+
"org:hardis:diagnose:unusedusers",
|
|
7807
|
+
"org:diagnose:hardis:unusedusers",
|
|
7808
|
+
"org:diagnose:unusedusers:hardis",
|
|
7809
|
+
"hardis:diagnose:org:unusedusers",
|
|
7810
|
+
"diagnose:hardis:org:unusedusers",
|
|
7811
|
+
"diagnose:org:hardis:unusedusers",
|
|
7812
|
+
"diagnose:org:unusedusers:hardis",
|
|
7813
|
+
"hardis:diagnose:unusedusers:org",
|
|
7814
|
+
"diagnose:hardis:unusedusers:org",
|
|
7815
|
+
"diagnose:unusedusers:hardis:org",
|
|
7816
|
+
"diagnose:unusedusers:org:hardis",
|
|
7817
|
+
"hardis:org:unusedusers:diagnose",
|
|
7818
|
+
"org:hardis:unusedusers:diagnose",
|
|
7819
|
+
"org:unusedusers:hardis:diagnose",
|
|
7820
|
+
"org:unusedusers:diagnose:hardis",
|
|
7821
|
+
"hardis:unusedusers:org:diagnose",
|
|
7822
|
+
"unusedusers:hardis:org:diagnose",
|
|
7823
|
+
"unusedusers:org:hardis:diagnose",
|
|
7824
|
+
"unusedusers:org:diagnose:hardis",
|
|
7825
|
+
"hardis:unusedusers:diagnose:org",
|
|
7826
|
+
"unusedusers:hardis:diagnose:org",
|
|
7827
|
+
"unusedusers:diagnose:hardis:org",
|
|
7828
|
+
"unusedusers:diagnose:org:hardis"
|
|
7829
7829
|
]
|
|
7830
7830
|
},
|
|
7831
7831
|
"hardis:org:monitor:all": {
|
|
@@ -16104,5 +16104,5 @@
|
|
|
16104
16104
|
]
|
|
16105
16105
|
}
|
|
16106
16106
|
},
|
|
16107
|
-
"version": "6.17.2-
|
|
16107
|
+
"version": "6.17.2-alpha202512261823.0"
|
|
16108
16108
|
}
|