sfdx-hardis 6.0.7-beta202508202323.0 → 6.0.7-beta202508231311.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/CHANGELOG.md +3 -0
- package/README.md +2 -8
- package/lib/commands/hardis/org/diagnose/unused-connected-apps.js +2 -2
- package/lib/commands/hardis/org/diagnose/unused-connected-apps.js.map +1 -1
- package/lib/commands/hardis/org/refresh/before-refresh.js +11 -0
- package/lib/commands/hardis/org/refresh/before-refresh.js.map +1 -1
- package/lib/commands/hardis/work/save.js +12 -1
- package/lib/commands/hardis/work/save.js.map +1 -1
- package/oclif.lock +17 -17
- package/oclif.manifest.json +603 -603
- package/package.json +5 -5
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 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 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:doc:fieldusage": {
|
|
@@ -5489,12 +5489,15 @@
|
|
|
5489
5489
|
"import:data:org:hardis"
|
|
5490
5490
|
]
|
|
5491
5491
|
},
|
|
5492
|
-
"hardis:org:
|
|
5492
|
+
"hardis:org:diagnose:audittrail": {
|
|
5493
5493
|
"aliases": [],
|
|
5494
5494
|
"args": {},
|
|
5495
|
-
"description": "
|
|
5495
|
+
"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",
|
|
5496
5496
|
"examples": [
|
|
5497
|
-
"$ sf hardis:org:
|
|
5497
|
+
"$ sf hardis:org:diagnose:audittrail",
|
|
5498
|
+
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
|
|
5499
|
+
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
|
|
5500
|
+
"$ sf hardis:org:diagnose:audittrail --lastndays 5"
|
|
5498
5501
|
],
|
|
5499
5502
|
"flags": {
|
|
5500
5503
|
"json": {
|
|
@@ -5512,37 +5515,26 @@
|
|
|
5512
5515
|
"multiple": false,
|
|
5513
5516
|
"type": "option"
|
|
5514
5517
|
},
|
|
5515
|
-
"
|
|
5516
|
-
"char": "
|
|
5517
|
-
"description": "
|
|
5518
|
-
"name": "
|
|
5519
|
-
"hasDynamicHelp": false,
|
|
5520
|
-
"multiple": false,
|
|
5521
|
-
"type": "option"
|
|
5522
|
-
},
|
|
5523
|
-
"chunksize": {
|
|
5524
|
-
"char": "c",
|
|
5525
|
-
"description": "Number of records to add in a chunk before it is processed",
|
|
5526
|
-
"name": "chunksize",
|
|
5527
|
-
"default": 1000,
|
|
5518
|
+
"excludeusers": {
|
|
5519
|
+
"char": "e",
|
|
5520
|
+
"description": "Comma-separated list of usernames to exclude",
|
|
5521
|
+
"name": "excludeusers",
|
|
5528
5522
|
"hasDynamicHelp": false,
|
|
5529
5523
|
"multiple": false,
|
|
5530
5524
|
"type": "option"
|
|
5531
5525
|
},
|
|
5532
|
-
"
|
|
5526
|
+
"lastndays": {
|
|
5533
5527
|
"char": "t",
|
|
5534
|
-
"description": "
|
|
5535
|
-
"name": "
|
|
5536
|
-
"default": 300000,
|
|
5528
|
+
"description": "Number of days to extract from today (included)",
|
|
5529
|
+
"name": "lastndays",
|
|
5537
5530
|
"hasDynamicHelp": false,
|
|
5538
5531
|
"multiple": false,
|
|
5539
5532
|
"type": "option"
|
|
5540
5533
|
},
|
|
5541
|
-
"
|
|
5542
|
-
"char": "
|
|
5543
|
-
"description": "
|
|
5544
|
-
"name": "
|
|
5545
|
-
"default": 0,
|
|
5534
|
+
"outputfile": {
|
|
5535
|
+
"char": "f",
|
|
5536
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
5537
|
+
"name": "outputfile",
|
|
5546
5538
|
"hasDynamicHelp": false,
|
|
5547
5539
|
"multiple": false,
|
|
5548
5540
|
"type": "option"
|
|
@@ -5585,13 +5577,13 @@
|
|
|
5585
5577
|
},
|
|
5586
5578
|
"hasDynamicHelp": true,
|
|
5587
5579
|
"hiddenAliases": [],
|
|
5588
|
-
"id": "hardis:org:
|
|
5580
|
+
"id": "hardis:org:diagnose:audittrail",
|
|
5589
5581
|
"pluginAlias": "sfdx-hardis",
|
|
5590
5582
|
"pluginName": "sfdx-hardis",
|
|
5591
5583
|
"pluginType": "core",
|
|
5592
5584
|
"strict": true,
|
|
5593
5585
|
"enableJsonFlag": true,
|
|
5594
|
-
"title": "
|
|
5586
|
+
"title": "Diagnose content of Setup Audit Trail",
|
|
5595
5587
|
"requiresProject": false,
|
|
5596
5588
|
"isESM": true,
|
|
5597
5589
|
"relativePath": [
|
|
@@ -5599,43 +5591,43 @@
|
|
|
5599
5591
|
"commands",
|
|
5600
5592
|
"hardis",
|
|
5601
5593
|
"org",
|
|
5602
|
-
"
|
|
5603
|
-
"
|
|
5594
|
+
"diagnose",
|
|
5595
|
+
"audittrail.js"
|
|
5604
5596
|
],
|
|
5605
5597
|
"aliasPermutations": [],
|
|
5606
5598
|
"permutations": [
|
|
5607
|
-
"hardis:org:
|
|
5608
|
-
"org:hardis:
|
|
5609
|
-
"org:
|
|
5610
|
-
"org:
|
|
5611
|
-
"hardis:
|
|
5612
|
-
"
|
|
5613
|
-
"
|
|
5614
|
-
"
|
|
5615
|
-
"hardis:
|
|
5616
|
-
"
|
|
5617
|
-
"
|
|
5618
|
-
"
|
|
5619
|
-
"hardis:org:
|
|
5620
|
-
"org:hardis:
|
|
5621
|
-
"org:
|
|
5622
|
-
"org:
|
|
5623
|
-
"hardis:
|
|
5624
|
-
"
|
|
5625
|
-
"
|
|
5626
|
-
"
|
|
5627
|
-
"hardis:
|
|
5628
|
-
"
|
|
5629
|
-
"
|
|
5630
|
-
"
|
|
5599
|
+
"hardis:org:diagnose:audittrail",
|
|
5600
|
+
"org:hardis:diagnose:audittrail",
|
|
5601
|
+
"org:diagnose:hardis:audittrail",
|
|
5602
|
+
"org:diagnose:audittrail:hardis",
|
|
5603
|
+
"hardis:diagnose:org:audittrail",
|
|
5604
|
+
"diagnose:hardis:org:audittrail",
|
|
5605
|
+
"diagnose:org:hardis:audittrail",
|
|
5606
|
+
"diagnose:org:audittrail:hardis",
|
|
5607
|
+
"hardis:diagnose:audittrail:org",
|
|
5608
|
+
"diagnose:hardis:audittrail:org",
|
|
5609
|
+
"diagnose:audittrail:hardis:org",
|
|
5610
|
+
"diagnose:audittrail:org:hardis",
|
|
5611
|
+
"hardis:org:audittrail:diagnose",
|
|
5612
|
+
"org:hardis:audittrail:diagnose",
|
|
5613
|
+
"org:audittrail:hardis:diagnose",
|
|
5614
|
+
"org:audittrail:diagnose:hardis",
|
|
5615
|
+
"hardis:audittrail:org:diagnose",
|
|
5616
|
+
"audittrail:hardis:org:diagnose",
|
|
5617
|
+
"audittrail:org:hardis:diagnose",
|
|
5618
|
+
"audittrail:org:diagnose:hardis",
|
|
5619
|
+
"hardis:audittrail:diagnose:org",
|
|
5620
|
+
"audittrail:hardis:diagnose:org",
|
|
5621
|
+
"audittrail:diagnose:hardis:org",
|
|
5622
|
+
"audittrail:diagnose:org:hardis"
|
|
5631
5623
|
]
|
|
5632
5624
|
},
|
|
5633
|
-
"hardis:org:
|
|
5625
|
+
"hardis:org:diagnose:instanceupgrade": {
|
|
5634
5626
|
"aliases": [],
|
|
5635
5627
|
"args": {},
|
|
5636
|
-
"description": "\
|
|
5628
|
+
"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",
|
|
5637
5629
|
"examples": [
|
|
5638
|
-
"$ sf hardis:org:
|
|
5630
|
+
"$ sf hardis:org:diagnose:instanceupgrade"
|
|
5639
5631
|
],
|
|
5640
5632
|
"flags": {
|
|
5641
5633
|
"json": {
|
|
@@ -5653,21 +5645,6 @@
|
|
|
5653
5645
|
"multiple": false,
|
|
5654
5646
|
"type": "option"
|
|
5655
5647
|
},
|
|
5656
|
-
"path": {
|
|
5657
|
-
"char": "p",
|
|
5658
|
-
"description": "Path to the file export project",
|
|
5659
|
-
"name": "path",
|
|
5660
|
-
"hasDynamicHelp": false,
|
|
5661
|
-
"multiple": false,
|
|
5662
|
-
"type": "option"
|
|
5663
|
-
},
|
|
5664
|
-
"overwrite": {
|
|
5665
|
-
"char": "f",
|
|
5666
|
-
"description": "Override existing files (doubles the number of API calls)",
|
|
5667
|
-
"name": "overwrite",
|
|
5668
|
-
"allowNo": false,
|
|
5669
|
-
"type": "boolean"
|
|
5670
|
-
},
|
|
5671
5648
|
"debug": {
|
|
5672
5649
|
"char": "d",
|
|
5673
5650
|
"description": "Activate debug mode (more logs)",
|
|
@@ -5706,13 +5683,13 @@
|
|
|
5706
5683
|
},
|
|
5707
5684
|
"hasDynamicHelp": true,
|
|
5708
5685
|
"hiddenAliases": [],
|
|
5709
|
-
"id": "hardis:org:
|
|
5686
|
+
"id": "hardis:org:diagnose:instanceupgrade",
|
|
5710
5687
|
"pluginAlias": "sfdx-hardis",
|
|
5711
5688
|
"pluginName": "sfdx-hardis",
|
|
5712
5689
|
"pluginType": "core",
|
|
5713
5690
|
"strict": true,
|
|
5714
5691
|
"enableJsonFlag": true,
|
|
5715
|
-
"title": "
|
|
5692
|
+
"title": "Get Instance Upgrade date",
|
|
5716
5693
|
"requiresProject": false,
|
|
5717
5694
|
"isESM": true,
|
|
5718
5695
|
"relativePath": [
|
|
@@ -5720,44 +5697,46 @@
|
|
|
5720
5697
|
"commands",
|
|
5721
5698
|
"hardis",
|
|
5722
5699
|
"org",
|
|
5723
|
-
"
|
|
5724
|
-
"
|
|
5700
|
+
"diagnose",
|
|
5701
|
+
"instanceupgrade.js"
|
|
5725
5702
|
],
|
|
5726
5703
|
"aliasPermutations": [],
|
|
5727
5704
|
"permutations": [
|
|
5728
|
-
"hardis:org:
|
|
5729
|
-
"org:hardis:
|
|
5730
|
-
"org:
|
|
5731
|
-
"org:
|
|
5732
|
-
"hardis:
|
|
5733
|
-
"
|
|
5734
|
-
"
|
|
5735
|
-
"
|
|
5736
|
-
"hardis:
|
|
5737
|
-
"
|
|
5738
|
-
"
|
|
5739
|
-
"
|
|
5740
|
-
"hardis:org:
|
|
5741
|
-
"org:hardis:
|
|
5742
|
-
"org:
|
|
5743
|
-
"org:
|
|
5744
|
-
"hardis:
|
|
5745
|
-
"
|
|
5746
|
-
"
|
|
5747
|
-
"
|
|
5748
|
-
"hardis:
|
|
5749
|
-
"
|
|
5750
|
-
"
|
|
5751
|
-
"
|
|
5705
|
+
"hardis:org:diagnose:instanceupgrade",
|
|
5706
|
+
"org:hardis:diagnose:instanceupgrade",
|
|
5707
|
+
"org:diagnose:hardis:instanceupgrade",
|
|
5708
|
+
"org:diagnose:instanceupgrade:hardis",
|
|
5709
|
+
"hardis:diagnose:org:instanceupgrade",
|
|
5710
|
+
"diagnose:hardis:org:instanceupgrade",
|
|
5711
|
+
"diagnose:org:hardis:instanceupgrade",
|
|
5712
|
+
"diagnose:org:instanceupgrade:hardis",
|
|
5713
|
+
"hardis:diagnose:instanceupgrade:org",
|
|
5714
|
+
"diagnose:hardis:instanceupgrade:org",
|
|
5715
|
+
"diagnose:instanceupgrade:hardis:org",
|
|
5716
|
+
"diagnose:instanceupgrade:org:hardis",
|
|
5717
|
+
"hardis:org:instanceupgrade:diagnose",
|
|
5718
|
+
"org:hardis:instanceupgrade:diagnose",
|
|
5719
|
+
"org:instanceupgrade:hardis:diagnose",
|
|
5720
|
+
"org:instanceupgrade:diagnose:hardis",
|
|
5721
|
+
"hardis:instanceupgrade:org:diagnose",
|
|
5722
|
+
"instanceupgrade:hardis:org:diagnose",
|
|
5723
|
+
"instanceupgrade:org:hardis:diagnose",
|
|
5724
|
+
"instanceupgrade:org:diagnose:hardis",
|
|
5725
|
+
"hardis:instanceupgrade:diagnose:org",
|
|
5726
|
+
"instanceupgrade:hardis:diagnose:org",
|
|
5727
|
+
"instanceupgrade:diagnose:hardis:org",
|
|
5728
|
+
"instanceupgrade:diagnose:org:hardis"
|
|
5752
5729
|
]
|
|
5753
5730
|
},
|
|
5754
|
-
"hardis:org:
|
|
5731
|
+
"hardis:org:diagnose:legacyapi": {
|
|
5755
5732
|
"aliases": [],
|
|
5756
5733
|
"args": {},
|
|
5757
|
-
"description": "
|
|
5734
|
+
"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",
|
|
5758
5735
|
"examples": [
|
|
5759
|
-
"$ sf hardis:org:
|
|
5760
|
-
"$ sf hardis:org:
|
|
5736
|
+
"$ sf hardis:org:diagnose:legacyapi",
|
|
5737
|
+
"$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com",
|
|
5738
|
+
"$ sf hardis:org:diagnose:legacyapi --outputfile 'c:/path/to/folder/legacyapi.csv'",
|
|
5739
|
+
"$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv"
|
|
5761
5740
|
],
|
|
5762
5741
|
"flags": {
|
|
5763
5742
|
"json": {
|
|
@@ -5775,10 +5754,28 @@
|
|
|
5775
5754
|
"multiple": false,
|
|
5776
5755
|
"type": "option"
|
|
5777
5756
|
},
|
|
5778
|
-
"
|
|
5757
|
+
"eventtype": {
|
|
5758
|
+
"char": "e",
|
|
5759
|
+
"description": "Type of EventLogFile event to analyze",
|
|
5760
|
+
"name": "eventtype",
|
|
5761
|
+
"default": "ApiTotalUsage",
|
|
5762
|
+
"hasDynamicHelp": false,
|
|
5763
|
+
"multiple": false,
|
|
5764
|
+
"type": "option"
|
|
5765
|
+
},
|
|
5766
|
+
"limit": {
|
|
5779
5767
|
"char": "l",
|
|
5780
|
-
"description": "
|
|
5781
|
-
"name": "
|
|
5768
|
+
"description": "Number of latest EventLogFile events to analyze",
|
|
5769
|
+
"name": "limit",
|
|
5770
|
+
"default": 999,
|
|
5771
|
+
"hasDynamicHelp": false,
|
|
5772
|
+
"multiple": false,
|
|
5773
|
+
"type": "option"
|
|
5774
|
+
},
|
|
5775
|
+
"outputfile": {
|
|
5776
|
+
"char": "f",
|
|
5777
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
5778
|
+
"name": "outputfile",
|
|
5782
5779
|
"hasDynamicHelp": false,
|
|
5783
5780
|
"multiple": false,
|
|
5784
5781
|
"type": "option"
|
|
@@ -5821,60 +5818,57 @@
|
|
|
5821
5818
|
},
|
|
5822
5819
|
"hasDynamicHelp": true,
|
|
5823
5820
|
"hiddenAliases": [],
|
|
5824
|
-
"id": "hardis:org:
|
|
5821
|
+
"id": "hardis:org:diagnose:legacyapi",
|
|
5825
5822
|
"pluginAlias": "sfdx-hardis",
|
|
5826
5823
|
"pluginName": "sfdx-hardis",
|
|
5827
5824
|
"pluginType": "core",
|
|
5828
5825
|
"strict": true,
|
|
5829
5826
|
"enableJsonFlag": true,
|
|
5830
|
-
"title": "
|
|
5831
|
-
"requiresProject":
|
|
5827
|
+
"title": "Check for legacy API use",
|
|
5828
|
+
"requiresProject": false,
|
|
5832
5829
|
"isESM": true,
|
|
5833
5830
|
"relativePath": [
|
|
5834
5831
|
"lib",
|
|
5835
5832
|
"commands",
|
|
5836
5833
|
"hardis",
|
|
5837
5834
|
"org",
|
|
5838
|
-
"
|
|
5839
|
-
"
|
|
5835
|
+
"diagnose",
|
|
5836
|
+
"legacyapi.js"
|
|
5840
5837
|
],
|
|
5841
5838
|
"aliasPermutations": [],
|
|
5842
5839
|
"permutations": [
|
|
5843
|
-
"hardis:org:
|
|
5844
|
-
"org:hardis:
|
|
5845
|
-
"org:
|
|
5846
|
-
"org:
|
|
5847
|
-
"hardis:
|
|
5848
|
-
"
|
|
5849
|
-
"
|
|
5850
|
-
"
|
|
5851
|
-
"hardis:
|
|
5852
|
-
"
|
|
5853
|
-
"
|
|
5854
|
-
"
|
|
5855
|
-
"hardis:org:
|
|
5856
|
-
"org:hardis:
|
|
5857
|
-
"org:
|
|
5858
|
-
"org:
|
|
5859
|
-
"hardis:
|
|
5860
|
-
"
|
|
5861
|
-
"
|
|
5862
|
-
"
|
|
5863
|
-
"hardis:
|
|
5864
|
-
"
|
|
5865
|
-
"
|
|
5866
|
-
"
|
|
5840
|
+
"hardis:org:diagnose:legacyapi",
|
|
5841
|
+
"org:hardis:diagnose:legacyapi",
|
|
5842
|
+
"org:diagnose:hardis:legacyapi",
|
|
5843
|
+
"org:diagnose:legacyapi:hardis",
|
|
5844
|
+
"hardis:diagnose:org:legacyapi",
|
|
5845
|
+
"diagnose:hardis:org:legacyapi",
|
|
5846
|
+
"diagnose:org:hardis:legacyapi",
|
|
5847
|
+
"diagnose:org:legacyapi:hardis",
|
|
5848
|
+
"hardis:diagnose:legacyapi:org",
|
|
5849
|
+
"diagnose:hardis:legacyapi:org",
|
|
5850
|
+
"diagnose:legacyapi:hardis:org",
|
|
5851
|
+
"diagnose:legacyapi:org:hardis",
|
|
5852
|
+
"hardis:org:legacyapi:diagnose",
|
|
5853
|
+
"org:hardis:legacyapi:diagnose",
|
|
5854
|
+
"org:legacyapi:hardis:diagnose",
|
|
5855
|
+
"org:legacyapi:diagnose:hardis",
|
|
5856
|
+
"hardis:legacyapi:org:diagnose",
|
|
5857
|
+
"legacyapi:hardis:org:diagnose",
|
|
5858
|
+
"legacyapi:org:hardis:diagnose",
|
|
5859
|
+
"legacyapi:org:diagnose:hardis",
|
|
5860
|
+
"hardis:legacyapi:diagnose:org",
|
|
5861
|
+
"legacyapi:hardis:diagnose:org",
|
|
5862
|
+
"legacyapi:diagnose:hardis:org",
|
|
5863
|
+
"legacyapi:diagnose:org:hardis"
|
|
5867
5864
|
]
|
|
5868
5865
|
},
|
|
5869
|
-
"hardis:org:diagnose:
|
|
5866
|
+
"hardis:org:diagnose:licenses": {
|
|
5870
5867
|
"aliases": [],
|
|
5871
5868
|
"args": {},
|
|
5872
|
-
"description": "
|
|
5869
|
+
"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",
|
|
5873
5870
|
"examples": [
|
|
5874
|
-
"$ sf hardis:org:diagnose:
|
|
5875
|
-
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
|
|
5876
|
-
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
|
|
5877
|
-
"$ sf hardis:org:diagnose:audittrail --lastndays 5"
|
|
5871
|
+
"$ sf hardis:org:diagnose:licenses"
|
|
5878
5872
|
],
|
|
5879
5873
|
"flags": {
|
|
5880
5874
|
"json": {
|
|
@@ -5892,22 +5886,6 @@
|
|
|
5892
5886
|
"multiple": false,
|
|
5893
5887
|
"type": "option"
|
|
5894
5888
|
},
|
|
5895
|
-
"excludeusers": {
|
|
5896
|
-
"char": "e",
|
|
5897
|
-
"description": "Comma-separated list of usernames to exclude",
|
|
5898
|
-
"name": "excludeusers",
|
|
5899
|
-
"hasDynamicHelp": false,
|
|
5900
|
-
"multiple": false,
|
|
5901
|
-
"type": "option"
|
|
5902
|
-
},
|
|
5903
|
-
"lastndays": {
|
|
5904
|
-
"char": "t",
|
|
5905
|
-
"description": "Number of days to extract from today (included)",
|
|
5906
|
-
"name": "lastndays",
|
|
5907
|
-
"hasDynamicHelp": false,
|
|
5908
|
-
"multiple": false,
|
|
5909
|
-
"type": "option"
|
|
5910
|
-
},
|
|
5911
5889
|
"outputfile": {
|
|
5912
5890
|
"char": "f",
|
|
5913
5891
|
"description": "Force the path and name of output report file. Must end with .csv",
|
|
@@ -5916,6 +5894,13 @@
|
|
|
5916
5894
|
"multiple": false,
|
|
5917
5895
|
"type": "option"
|
|
5918
5896
|
},
|
|
5897
|
+
"usedonly": {
|
|
5898
|
+
"char": "u",
|
|
5899
|
+
"description": "Filter to have only used licenses",
|
|
5900
|
+
"name": "usedonly",
|
|
5901
|
+
"allowNo": false,
|
|
5902
|
+
"type": "boolean"
|
|
5903
|
+
},
|
|
5919
5904
|
"debug": {
|
|
5920
5905
|
"char": "d",
|
|
5921
5906
|
"description": "Activate debug mode (more logs)",
|
|
@@ -5954,13 +5939,13 @@
|
|
|
5954
5939
|
},
|
|
5955
5940
|
"hasDynamicHelp": true,
|
|
5956
5941
|
"hiddenAliases": [],
|
|
5957
|
-
"id": "hardis:org:diagnose:
|
|
5942
|
+
"id": "hardis:org:diagnose:licenses",
|
|
5958
5943
|
"pluginAlias": "sfdx-hardis",
|
|
5959
5944
|
"pluginName": "sfdx-hardis",
|
|
5960
5945
|
"pluginType": "core",
|
|
5961
5946
|
"strict": true,
|
|
5962
5947
|
"enableJsonFlag": true,
|
|
5963
|
-
"title": "
|
|
5948
|
+
"title": "List licenses subscribed and used in a Salesforce org",
|
|
5964
5949
|
"requiresProject": false,
|
|
5965
5950
|
"isESM": true,
|
|
5966
5951
|
"relativePath": [
|
|
@@ -5969,42 +5954,42 @@
|
|
|
5969
5954
|
"hardis",
|
|
5970
5955
|
"org",
|
|
5971
5956
|
"diagnose",
|
|
5972
|
-
"
|
|
5957
|
+
"licenses.js"
|
|
5973
5958
|
],
|
|
5974
5959
|
"aliasPermutations": [],
|
|
5975
5960
|
"permutations": [
|
|
5976
|
-
"hardis:org:diagnose:
|
|
5977
|
-
"org:hardis:diagnose:
|
|
5978
|
-
"org:diagnose:hardis:
|
|
5979
|
-
"org:diagnose:
|
|
5980
|
-
"hardis:diagnose:org:
|
|
5981
|
-
"diagnose:hardis:org:
|
|
5982
|
-
"diagnose:org:hardis:
|
|
5983
|
-
"diagnose:org:
|
|
5984
|
-
"hardis:diagnose:
|
|
5985
|
-
"diagnose:hardis:
|
|
5986
|
-
"diagnose:
|
|
5987
|
-
"diagnose:
|
|
5988
|
-
"hardis:org:
|
|
5989
|
-
"org:hardis:
|
|
5990
|
-
"org:
|
|
5991
|
-
"org:
|
|
5992
|
-
"hardis:
|
|
5993
|
-
"
|
|
5994
|
-
"
|
|
5995
|
-
"
|
|
5996
|
-
"hardis:
|
|
5997
|
-
"
|
|
5998
|
-
"
|
|
5999
|
-
"
|
|
5961
|
+
"hardis:org:diagnose:licenses",
|
|
5962
|
+
"org:hardis:diagnose:licenses",
|
|
5963
|
+
"org:diagnose:hardis:licenses",
|
|
5964
|
+
"org:diagnose:licenses:hardis",
|
|
5965
|
+
"hardis:diagnose:org:licenses",
|
|
5966
|
+
"diagnose:hardis:org:licenses",
|
|
5967
|
+
"diagnose:org:hardis:licenses",
|
|
5968
|
+
"diagnose:org:licenses:hardis",
|
|
5969
|
+
"hardis:diagnose:licenses:org",
|
|
5970
|
+
"diagnose:hardis:licenses:org",
|
|
5971
|
+
"diagnose:licenses:hardis:org",
|
|
5972
|
+
"diagnose:licenses:org:hardis",
|
|
5973
|
+
"hardis:org:licenses:diagnose",
|
|
5974
|
+
"org:hardis:licenses:diagnose",
|
|
5975
|
+
"org:licenses:hardis:diagnose",
|
|
5976
|
+
"org:licenses:diagnose:hardis",
|
|
5977
|
+
"hardis:licenses:org:diagnose",
|
|
5978
|
+
"licenses:hardis:org:diagnose",
|
|
5979
|
+
"licenses:org:hardis:diagnose",
|
|
5980
|
+
"licenses:org:diagnose:hardis",
|
|
5981
|
+
"hardis:licenses:diagnose:org",
|
|
5982
|
+
"licenses:hardis:diagnose:org",
|
|
5983
|
+
"licenses:diagnose:hardis:org",
|
|
5984
|
+
"licenses:diagnose:org:hardis"
|
|
6000
5985
|
]
|
|
6001
5986
|
},
|
|
6002
|
-
"hardis:org:diagnose:
|
|
5987
|
+
"hardis:org:diagnose:releaseupdates": {
|
|
6003
5988
|
"aliases": [],
|
|
6004
5989
|
"args": {},
|
|
6005
|
-
"description": "
|
|
5990
|
+
"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",
|
|
6006
5991
|
"examples": [
|
|
6007
|
-
"$ sf hardis:org:diagnose:
|
|
5992
|
+
"$ sf hardis:org:diagnose:releaseupdates"
|
|
6008
5993
|
],
|
|
6009
5994
|
"flags": {
|
|
6010
5995
|
"json": {
|
|
@@ -6022,6 +6007,14 @@
|
|
|
6022
6007
|
"multiple": false,
|
|
6023
6008
|
"type": "option"
|
|
6024
6009
|
},
|
|
6010
|
+
"outputfile": {
|
|
6011
|
+
"char": "f",
|
|
6012
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
6013
|
+
"name": "outputfile",
|
|
6014
|
+
"hasDynamicHelp": false,
|
|
6015
|
+
"multiple": false,
|
|
6016
|
+
"type": "option"
|
|
6017
|
+
},
|
|
6025
6018
|
"debug": {
|
|
6026
6019
|
"char": "d",
|
|
6027
6020
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6060,13 +6053,13 @@
|
|
|
6060
6053
|
},
|
|
6061
6054
|
"hasDynamicHelp": true,
|
|
6062
6055
|
"hiddenAliases": [],
|
|
6063
|
-
"id": "hardis:org:diagnose:
|
|
6056
|
+
"id": "hardis:org:diagnose:releaseupdates",
|
|
6064
6057
|
"pluginAlias": "sfdx-hardis",
|
|
6065
6058
|
"pluginName": "sfdx-hardis",
|
|
6066
6059
|
"pluginType": "core",
|
|
6067
6060
|
"strict": true,
|
|
6068
6061
|
"enableJsonFlag": true,
|
|
6069
|
-
"title": "
|
|
6062
|
+
"title": "Check Release Updates of an org",
|
|
6070
6063
|
"requiresProject": false,
|
|
6071
6064
|
"isESM": true,
|
|
6072
6065
|
"relativePath": [
|
|
@@ -6075,45 +6068,43 @@
|
|
|
6075
6068
|
"hardis",
|
|
6076
6069
|
"org",
|
|
6077
6070
|
"diagnose",
|
|
6078
|
-
"
|
|
6071
|
+
"releaseupdates.js"
|
|
6079
6072
|
],
|
|
6080
6073
|
"aliasPermutations": [],
|
|
6081
6074
|
"permutations": [
|
|
6082
|
-
"hardis:org:diagnose:
|
|
6083
|
-
"org:hardis:diagnose:
|
|
6084
|
-
"org:diagnose:hardis:
|
|
6085
|
-
"org:diagnose:
|
|
6086
|
-
"hardis:diagnose:org:
|
|
6087
|
-
"diagnose:hardis:org:
|
|
6088
|
-
"diagnose:org:hardis:
|
|
6089
|
-
"diagnose:org:
|
|
6090
|
-
"hardis:diagnose:
|
|
6091
|
-
"diagnose:hardis:
|
|
6092
|
-
"diagnose:
|
|
6093
|
-
"diagnose:
|
|
6094
|
-
"hardis:org:
|
|
6095
|
-
"org:hardis:
|
|
6096
|
-
"org:
|
|
6097
|
-
"org:
|
|
6098
|
-
"hardis:
|
|
6099
|
-
"
|
|
6100
|
-
"
|
|
6101
|
-
"
|
|
6102
|
-
"hardis:
|
|
6103
|
-
"
|
|
6104
|
-
"
|
|
6105
|
-
"
|
|
6106
|
-
]
|
|
6107
|
-
},
|
|
6108
|
-
"hardis:org:diagnose:
|
|
6109
|
-
"aliases": [],
|
|
6110
|
-
"args": {},
|
|
6111
|
-
"description": "
|
|
6075
|
+
"hardis:org:diagnose:releaseupdates",
|
|
6076
|
+
"org:hardis:diagnose:releaseupdates",
|
|
6077
|
+
"org:diagnose:hardis:releaseupdates",
|
|
6078
|
+
"org:diagnose:releaseupdates:hardis",
|
|
6079
|
+
"hardis:diagnose:org:releaseupdates",
|
|
6080
|
+
"diagnose:hardis:org:releaseupdates",
|
|
6081
|
+
"diagnose:org:hardis:releaseupdates",
|
|
6082
|
+
"diagnose:org:releaseupdates:hardis",
|
|
6083
|
+
"hardis:diagnose:releaseupdates:org",
|
|
6084
|
+
"diagnose:hardis:releaseupdates:org",
|
|
6085
|
+
"diagnose:releaseupdates:hardis:org",
|
|
6086
|
+
"diagnose:releaseupdates:org:hardis",
|
|
6087
|
+
"hardis:org:releaseupdates:diagnose",
|
|
6088
|
+
"org:hardis:releaseupdates:diagnose",
|
|
6089
|
+
"org:releaseupdates:hardis:diagnose",
|
|
6090
|
+
"org:releaseupdates:diagnose:hardis",
|
|
6091
|
+
"hardis:releaseupdates:org:diagnose",
|
|
6092
|
+
"releaseupdates:hardis:org:diagnose",
|
|
6093
|
+
"releaseupdates:org:hardis:diagnose",
|
|
6094
|
+
"releaseupdates:org:diagnose:hardis",
|
|
6095
|
+
"hardis:releaseupdates:diagnose:org",
|
|
6096
|
+
"releaseupdates:hardis:diagnose:org",
|
|
6097
|
+
"releaseupdates:diagnose:hardis:org",
|
|
6098
|
+
"releaseupdates:diagnose:org:hardis"
|
|
6099
|
+
]
|
|
6100
|
+
},
|
|
6101
|
+
"hardis:org:diagnose:unused-apex-classes": {
|
|
6102
|
+
"aliases": [],
|
|
6103
|
+
"args": {},
|
|
6104
|
+
"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",
|
|
6112
6105
|
"examples": [
|
|
6113
|
-
"$ sf hardis:org:diagnose:
|
|
6114
|
-
"$ sf hardis:org:diagnose:
|
|
6115
|
-
"$ sf hardis:org:diagnose:legacyapi --outputfile 'c:/path/to/folder/legacyapi.csv'",
|
|
6116
|
-
"$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv"
|
|
6106
|
+
"$ sf hardis:org:diagnose:unused-apex-classes",
|
|
6107
|
+
"$ sf hardis:org:diagnose:unused-apex-classes --days 700"
|
|
6117
6108
|
],
|
|
6118
6109
|
"flags": {
|
|
6119
6110
|
"json": {
|
|
@@ -6131,24 +6122,6 @@
|
|
|
6131
6122
|
"multiple": false,
|
|
6132
6123
|
"type": "option"
|
|
6133
6124
|
},
|
|
6134
|
-
"eventtype": {
|
|
6135
|
-
"char": "e",
|
|
6136
|
-
"description": "Type of EventLogFile event to analyze",
|
|
6137
|
-
"name": "eventtype",
|
|
6138
|
-
"default": "ApiTotalUsage",
|
|
6139
|
-
"hasDynamicHelp": false,
|
|
6140
|
-
"multiple": false,
|
|
6141
|
-
"type": "option"
|
|
6142
|
-
},
|
|
6143
|
-
"limit": {
|
|
6144
|
-
"char": "l",
|
|
6145
|
-
"description": "Number of latest EventLogFile events to analyze",
|
|
6146
|
-
"name": "limit",
|
|
6147
|
-
"default": 999,
|
|
6148
|
-
"hasDynamicHelp": false,
|
|
6149
|
-
"multiple": false,
|
|
6150
|
-
"type": "option"
|
|
6151
|
-
},
|
|
6152
6125
|
"outputfile": {
|
|
6153
6126
|
"char": "f",
|
|
6154
6127
|
"description": "Force the path and name of output report file. Must end with .csv",
|
|
@@ -6157,6 +6130,14 @@
|
|
|
6157
6130
|
"multiple": false,
|
|
6158
6131
|
"type": "option"
|
|
6159
6132
|
},
|
|
6133
|
+
"days": {
|
|
6134
|
+
"char": "t",
|
|
6135
|
+
"description": "Extracts the users that have been inactive for the amount of days specified. In CI, default is 180 days",
|
|
6136
|
+
"name": "days",
|
|
6137
|
+
"hasDynamicHelp": false,
|
|
6138
|
+
"multiple": false,
|
|
6139
|
+
"type": "option"
|
|
6140
|
+
},
|
|
6160
6141
|
"debug": {
|
|
6161
6142
|
"char": "d",
|
|
6162
6143
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6195,13 +6176,13 @@
|
|
|
6195
6176
|
},
|
|
6196
6177
|
"hasDynamicHelp": true,
|
|
6197
6178
|
"hiddenAliases": [],
|
|
6198
|
-
"id": "hardis:org:diagnose:
|
|
6179
|
+
"id": "hardis:org:diagnose:unused-apex-classes",
|
|
6199
6180
|
"pluginAlias": "sfdx-hardis",
|
|
6200
6181
|
"pluginName": "sfdx-hardis",
|
|
6201
6182
|
"pluginType": "core",
|
|
6202
6183
|
"strict": true,
|
|
6203
6184
|
"enableJsonFlag": true,
|
|
6204
|
-
"title": "
|
|
6185
|
+
"title": "Detect unused Apex classes in an org",
|
|
6205
6186
|
"requiresProject": false,
|
|
6206
6187
|
"isESM": true,
|
|
6207
6188
|
"relativePath": [
|
|
@@ -6210,42 +6191,42 @@
|
|
|
6210
6191
|
"hardis",
|
|
6211
6192
|
"org",
|
|
6212
6193
|
"diagnose",
|
|
6213
|
-
"
|
|
6194
|
+
"unused-apex-classes.js"
|
|
6214
6195
|
],
|
|
6215
6196
|
"aliasPermutations": [],
|
|
6216
6197
|
"permutations": [
|
|
6217
|
-
"hardis:org:diagnose:
|
|
6218
|
-
"org:hardis:diagnose:
|
|
6219
|
-
"org:diagnose:hardis:
|
|
6220
|
-
"org:diagnose:
|
|
6221
|
-
"hardis:diagnose:org:
|
|
6222
|
-
"diagnose:hardis:org:
|
|
6223
|
-
"diagnose:org:hardis:
|
|
6224
|
-
"diagnose:org:
|
|
6225
|
-
"hardis:diagnose:
|
|
6226
|
-
"diagnose:hardis:
|
|
6227
|
-
"diagnose:
|
|
6228
|
-
"diagnose:
|
|
6229
|
-
"hardis:org:
|
|
6230
|
-
"org:hardis:
|
|
6231
|
-
"org:
|
|
6232
|
-
"org:
|
|
6233
|
-
"hardis:
|
|
6234
|
-
"
|
|
6235
|
-
"
|
|
6236
|
-
"
|
|
6237
|
-
"hardis:
|
|
6238
|
-
"
|
|
6239
|
-
"
|
|
6240
|
-
"
|
|
6198
|
+
"hardis:org:diagnose:unused-apex-classes",
|
|
6199
|
+
"org:hardis:diagnose:unused-apex-classes",
|
|
6200
|
+
"org:diagnose:hardis:unused-apex-classes",
|
|
6201
|
+
"org:diagnose:unused-apex-classes:hardis",
|
|
6202
|
+
"hardis:diagnose:org:unused-apex-classes",
|
|
6203
|
+
"diagnose:hardis:org:unused-apex-classes",
|
|
6204
|
+
"diagnose:org:hardis:unused-apex-classes",
|
|
6205
|
+
"diagnose:org:unused-apex-classes:hardis",
|
|
6206
|
+
"hardis:diagnose:unused-apex-classes:org",
|
|
6207
|
+
"diagnose:hardis:unused-apex-classes:org",
|
|
6208
|
+
"diagnose:unused-apex-classes:hardis:org",
|
|
6209
|
+
"diagnose:unused-apex-classes:org:hardis",
|
|
6210
|
+
"hardis:org:unused-apex-classes:diagnose",
|
|
6211
|
+
"org:hardis:unused-apex-classes:diagnose",
|
|
6212
|
+
"org:unused-apex-classes:hardis:diagnose",
|
|
6213
|
+
"org:unused-apex-classes:diagnose:hardis",
|
|
6214
|
+
"hardis:unused-apex-classes:org:diagnose",
|
|
6215
|
+
"unused-apex-classes:hardis:org:diagnose",
|
|
6216
|
+
"unused-apex-classes:org:hardis:diagnose",
|
|
6217
|
+
"unused-apex-classes:org:diagnose:hardis",
|
|
6218
|
+
"hardis:unused-apex-classes:diagnose:org",
|
|
6219
|
+
"unused-apex-classes:hardis:diagnose:org",
|
|
6220
|
+
"unused-apex-classes:diagnose:hardis:org",
|
|
6221
|
+
"unused-apex-classes:diagnose:org:hardis"
|
|
6241
6222
|
]
|
|
6242
6223
|
},
|
|
6243
|
-
"hardis:org:diagnose:
|
|
6224
|
+
"hardis:org:diagnose:unused-connected-apps": {
|
|
6244
6225
|
"aliases": [],
|
|
6245
6226
|
"args": {},
|
|
6246
|
-
"description": "\n
|
|
6227
|
+
"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",
|
|
6247
6228
|
"examples": [
|
|
6248
|
-
"$ sf hardis:org:diagnose:
|
|
6229
|
+
"$ sf hardis:org:diagnose:unused-connected-apps"
|
|
6249
6230
|
],
|
|
6250
6231
|
"flags": {
|
|
6251
6232
|
"json": {
|
|
@@ -6271,13 +6252,6 @@
|
|
|
6271
6252
|
"multiple": false,
|
|
6272
6253
|
"type": "option"
|
|
6273
6254
|
},
|
|
6274
|
-
"usedonly": {
|
|
6275
|
-
"char": "u",
|
|
6276
|
-
"description": "Filter to have only used licenses",
|
|
6277
|
-
"name": "usedonly",
|
|
6278
|
-
"allowNo": false,
|
|
6279
|
-
"type": "boolean"
|
|
6280
|
-
},
|
|
6281
6255
|
"debug": {
|
|
6282
6256
|
"char": "d",
|
|
6283
6257
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6316,13 +6290,30 @@
|
|
|
6316
6290
|
},
|
|
6317
6291
|
"hasDynamicHelp": true,
|
|
6318
6292
|
"hiddenAliases": [],
|
|
6319
|
-
"id": "hardis:org:diagnose:
|
|
6293
|
+
"id": "hardis:org:diagnose:unused-connected-apps",
|
|
6320
6294
|
"pluginAlias": "sfdx-hardis",
|
|
6321
6295
|
"pluginName": "sfdx-hardis",
|
|
6322
6296
|
"pluginType": "core",
|
|
6323
6297
|
"strict": true,
|
|
6324
6298
|
"enableJsonFlag": true,
|
|
6325
|
-
"title": "
|
|
6299
|
+
"title": "Unused Connected Apps in an org",
|
|
6300
|
+
"allowedInactiveConnectedApps": [
|
|
6301
|
+
"Ant Migration Tool",
|
|
6302
|
+
"Chatter Desktop",
|
|
6303
|
+
"Chatter Mobile for BlackBerry",
|
|
6304
|
+
"Force.com IDE",
|
|
6305
|
+
"OIQ_Integration",
|
|
6306
|
+
"Salesforce CLI",
|
|
6307
|
+
"Salesforce Files",
|
|
6308
|
+
"Salesforce Mobile Dashboards",
|
|
6309
|
+
"Salesforce Touch",
|
|
6310
|
+
"Salesforce for Outlook",
|
|
6311
|
+
"SalesforceA",
|
|
6312
|
+
"SalesforceA for Android",
|
|
6313
|
+
"SalesforceA for iOS",
|
|
6314
|
+
"SalesforceDX Namespace Registry",
|
|
6315
|
+
"SalesforceIQ"
|
|
6316
|
+
],
|
|
6326
6317
|
"requiresProject": false,
|
|
6327
6318
|
"isESM": true,
|
|
6328
6319
|
"relativePath": [
|
|
@@ -6331,42 +6322,43 @@
|
|
|
6331
6322
|
"hardis",
|
|
6332
6323
|
"org",
|
|
6333
6324
|
"diagnose",
|
|
6334
|
-
"
|
|
6325
|
+
"unused-connected-apps.js"
|
|
6335
6326
|
],
|
|
6336
6327
|
"aliasPermutations": [],
|
|
6337
6328
|
"permutations": [
|
|
6338
|
-
"hardis:org:diagnose:
|
|
6339
|
-
"org:hardis:diagnose:
|
|
6340
|
-
"org:diagnose:hardis:
|
|
6341
|
-
"org:diagnose:
|
|
6342
|
-
"hardis:diagnose:org:
|
|
6343
|
-
"diagnose:hardis:org:
|
|
6344
|
-
"diagnose:org:hardis:
|
|
6345
|
-
"diagnose:org:
|
|
6346
|
-
"hardis:diagnose:
|
|
6347
|
-
"diagnose:hardis:
|
|
6348
|
-
"diagnose:
|
|
6349
|
-
"diagnose:
|
|
6350
|
-
"hardis:org:
|
|
6351
|
-
"org:hardis:
|
|
6352
|
-
"org:
|
|
6353
|
-
"org:
|
|
6354
|
-
"hardis:
|
|
6355
|
-
"
|
|
6356
|
-
"
|
|
6357
|
-
"
|
|
6358
|
-
"hardis:
|
|
6359
|
-
"
|
|
6360
|
-
"
|
|
6361
|
-
"
|
|
6329
|
+
"hardis:org:diagnose:unused-connected-apps",
|
|
6330
|
+
"org:hardis:diagnose:unused-connected-apps",
|
|
6331
|
+
"org:diagnose:hardis:unused-connected-apps",
|
|
6332
|
+
"org:diagnose:unused-connected-apps:hardis",
|
|
6333
|
+
"hardis:diagnose:org:unused-connected-apps",
|
|
6334
|
+
"diagnose:hardis:org:unused-connected-apps",
|
|
6335
|
+
"diagnose:org:hardis:unused-connected-apps",
|
|
6336
|
+
"diagnose:org:unused-connected-apps:hardis",
|
|
6337
|
+
"hardis:diagnose:unused-connected-apps:org",
|
|
6338
|
+
"diagnose:hardis:unused-connected-apps:org",
|
|
6339
|
+
"diagnose:unused-connected-apps:hardis:org",
|
|
6340
|
+
"diagnose:unused-connected-apps:org:hardis",
|
|
6341
|
+
"hardis:org:unused-connected-apps:diagnose",
|
|
6342
|
+
"org:hardis:unused-connected-apps:diagnose",
|
|
6343
|
+
"org:unused-connected-apps:hardis:diagnose",
|
|
6344
|
+
"org:unused-connected-apps:diagnose:hardis",
|
|
6345
|
+
"hardis:unused-connected-apps:org:diagnose",
|
|
6346
|
+
"unused-connected-apps:hardis:org:diagnose",
|
|
6347
|
+
"unused-connected-apps:org:hardis:diagnose",
|
|
6348
|
+
"unused-connected-apps:org:diagnose:hardis",
|
|
6349
|
+
"hardis:unused-connected-apps:diagnose:org",
|
|
6350
|
+
"unused-connected-apps:hardis:diagnose:org",
|
|
6351
|
+
"unused-connected-apps:diagnose:hardis:org",
|
|
6352
|
+
"unused-connected-apps:diagnose:org:hardis"
|
|
6362
6353
|
]
|
|
6363
6354
|
},
|
|
6364
|
-
"hardis:org:diagnose:
|
|
6355
|
+
"hardis:org:diagnose:unusedlicenses": {
|
|
6365
6356
|
"aliases": [],
|
|
6366
6357
|
"args": {},
|
|
6367
|
-
"description": "
|
|
6358
|
+
"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",
|
|
6368
6359
|
"examples": [
|
|
6369
|
-
"$ sf hardis:org:diagnose:
|
|
6360
|
+
"$ sf hardis:org:diagnose:unusedlicenses",
|
|
6361
|
+
"$ sf hardis:org:diagnose:unusedlicenses --fix"
|
|
6370
6362
|
],
|
|
6371
6363
|
"flags": {
|
|
6372
6364
|
"json": {
|
|
@@ -6430,14 +6422,32 @@
|
|
|
6430
6422
|
},
|
|
6431
6423
|
"hasDynamicHelp": true,
|
|
6432
6424
|
"hiddenAliases": [],
|
|
6433
|
-
"id": "hardis:org:diagnose:
|
|
6425
|
+
"id": "hardis:org:diagnose:unusedlicenses",
|
|
6434
6426
|
"pluginAlias": "sfdx-hardis",
|
|
6435
6427
|
"pluginName": "sfdx-hardis",
|
|
6436
6428
|
"pluginType": "core",
|
|
6437
6429
|
"strict": true,
|
|
6438
6430
|
"enableJsonFlag": true,
|
|
6439
|
-
"title": "
|
|
6431
|
+
"title": "Detect unused Permission Set Licenses (beta)",
|
|
6440
6432
|
"requiresProject": false,
|
|
6433
|
+
"additionalPermissionSetsToAlwaysGet": [
|
|
6434
|
+
"Sales_User"
|
|
6435
|
+
],
|
|
6436
|
+
"permSetsPermSetLicenses": [
|
|
6437
|
+
{
|
|
6438
|
+
"permSet": "Sales_User",
|
|
6439
|
+
"permSetLicense": "SalesUserPsl"
|
|
6440
|
+
}
|
|
6441
|
+
],
|
|
6442
|
+
"profilesPermissionSetLicenses": [
|
|
6443
|
+
{
|
|
6444
|
+
"profile": "Salesforce API Only",
|
|
6445
|
+
"permSetLicense": "SalesforceAPIIntegrationPsl"
|
|
6446
|
+
}
|
|
6447
|
+
],
|
|
6448
|
+
"alwaysExcludeForActiveUsersPermissionSetLicenses": [
|
|
6449
|
+
"IdentityConnect"
|
|
6450
|
+
],
|
|
6441
6451
|
"isESM": true,
|
|
6442
6452
|
"relativePath": [
|
|
6443
6453
|
"lib",
|
|
@@ -6445,43 +6455,46 @@
|
|
|
6445
6455
|
"hardis",
|
|
6446
6456
|
"org",
|
|
6447
6457
|
"diagnose",
|
|
6448
|
-
"
|
|
6458
|
+
"unusedlicenses.js"
|
|
6449
6459
|
],
|
|
6450
6460
|
"aliasPermutations": [],
|
|
6451
6461
|
"permutations": [
|
|
6452
|
-
"hardis:org:diagnose:
|
|
6453
|
-
"org:hardis:diagnose:
|
|
6454
|
-
"org:diagnose:hardis:
|
|
6455
|
-
"org:diagnose:
|
|
6456
|
-
"hardis:diagnose:org:
|
|
6457
|
-
"diagnose:hardis:org:
|
|
6458
|
-
"diagnose:org:hardis:
|
|
6459
|
-
"diagnose:org:
|
|
6460
|
-
"hardis:diagnose:
|
|
6461
|
-
"diagnose:hardis:
|
|
6462
|
-
"diagnose:
|
|
6463
|
-
"diagnose:
|
|
6464
|
-
"hardis:org:
|
|
6465
|
-
"org:hardis:
|
|
6466
|
-
"org:
|
|
6467
|
-
"org:
|
|
6468
|
-
"hardis:
|
|
6469
|
-
"
|
|
6470
|
-
"
|
|
6471
|
-
"
|
|
6472
|
-
"hardis:
|
|
6473
|
-
"
|
|
6474
|
-
"
|
|
6475
|
-
"
|
|
6462
|
+
"hardis:org:diagnose:unusedlicenses",
|
|
6463
|
+
"org:hardis:diagnose:unusedlicenses",
|
|
6464
|
+
"org:diagnose:hardis:unusedlicenses",
|
|
6465
|
+
"org:diagnose:unusedlicenses:hardis",
|
|
6466
|
+
"hardis:diagnose:org:unusedlicenses",
|
|
6467
|
+
"diagnose:hardis:org:unusedlicenses",
|
|
6468
|
+
"diagnose:org:hardis:unusedlicenses",
|
|
6469
|
+
"diagnose:org:unusedlicenses:hardis",
|
|
6470
|
+
"hardis:diagnose:unusedlicenses:org",
|
|
6471
|
+
"diagnose:hardis:unusedlicenses:org",
|
|
6472
|
+
"diagnose:unusedlicenses:hardis:org",
|
|
6473
|
+
"diagnose:unusedlicenses:org:hardis",
|
|
6474
|
+
"hardis:org:unusedlicenses:diagnose",
|
|
6475
|
+
"org:hardis:unusedlicenses:diagnose",
|
|
6476
|
+
"org:unusedlicenses:hardis:diagnose",
|
|
6477
|
+
"org:unusedlicenses:diagnose:hardis",
|
|
6478
|
+
"hardis:unusedlicenses:org:diagnose",
|
|
6479
|
+
"unusedlicenses:hardis:org:diagnose",
|
|
6480
|
+
"unusedlicenses:org:hardis:diagnose",
|
|
6481
|
+
"unusedlicenses:org:diagnose:hardis",
|
|
6482
|
+
"hardis:unusedlicenses:diagnose:org",
|
|
6483
|
+
"unusedlicenses:hardis:diagnose:org",
|
|
6484
|
+
"unusedlicenses:diagnose:hardis:org",
|
|
6485
|
+
"unusedlicenses:diagnose:org:hardis"
|
|
6476
6486
|
]
|
|
6477
6487
|
},
|
|
6478
|
-
"hardis:org:diagnose:
|
|
6488
|
+
"hardis:org:diagnose:unusedusers": {
|
|
6479
6489
|
"aliases": [],
|
|
6480
6490
|
"args": {},
|
|
6481
|
-
"description": "
|
|
6491
|
+
"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>",
|
|
6482
6492
|
"examples": [
|
|
6483
|
-
"$ sf hardis:org:diagnose:
|
|
6484
|
-
"$ sf hardis:org:diagnose:
|
|
6493
|
+
"$ sf hardis:org:diagnose:unusedusers",
|
|
6494
|
+
"$ sf hardis:org:diagnose:unusedusers --days 365",
|
|
6495
|
+
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm",
|
|
6496
|
+
"$ sf hardis:org:diagnose:unusedusers --days 60 --licenseidentifiers SFDC,AUL,AUL1",
|
|
6497
|
+
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm --returnactiveusers"
|
|
6485
6498
|
],
|
|
6486
6499
|
"flags": {
|
|
6487
6500
|
"json": {
|
|
@@ -6515,6 +6528,33 @@
|
|
|
6515
6528
|
"multiple": false,
|
|
6516
6529
|
"type": "option"
|
|
6517
6530
|
},
|
|
6531
|
+
"licensetypes": {
|
|
6532
|
+
"char": "l",
|
|
6533
|
+
"description": "Type of licenses to check. If set, do not use licenseidentifiers option. In CI, default is all-crm",
|
|
6534
|
+
"name": "licensetypes",
|
|
6535
|
+
"hasDynamicHelp": false,
|
|
6536
|
+
"multiple": false,
|
|
6537
|
+
"options": [
|
|
6538
|
+
"all",
|
|
6539
|
+
"all-crm",
|
|
6540
|
+
"all-paying"
|
|
6541
|
+
],
|
|
6542
|
+
"type": "option"
|
|
6543
|
+
},
|
|
6544
|
+
"licenseidentifiers": {
|
|
6545
|
+
"char": "i",
|
|
6546
|
+
"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",
|
|
6547
|
+
"name": "licenseidentifiers",
|
|
6548
|
+
"hasDynamicHelp": false,
|
|
6549
|
+
"multiple": false,
|
|
6550
|
+
"type": "option"
|
|
6551
|
+
},
|
|
6552
|
+
"returnactiveusers": {
|
|
6553
|
+
"description": "Inverts the command by returning the active users",
|
|
6554
|
+
"name": "returnactiveusers",
|
|
6555
|
+
"allowNo": false,
|
|
6556
|
+
"type": "boolean"
|
|
6557
|
+
},
|
|
6518
6558
|
"debug": {
|
|
6519
6559
|
"char": "d",
|
|
6520
6560
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6553,13 +6593,13 @@
|
|
|
6553
6593
|
},
|
|
6554
6594
|
"hasDynamicHelp": true,
|
|
6555
6595
|
"hiddenAliases": [],
|
|
6556
|
-
"id": "hardis:org:diagnose:
|
|
6596
|
+
"id": "hardis:org:diagnose:unusedusers",
|
|
6557
6597
|
"pluginAlias": "sfdx-hardis",
|
|
6558
6598
|
"pluginName": "sfdx-hardis",
|
|
6559
6599
|
"pluginType": "core",
|
|
6560
6600
|
"strict": true,
|
|
6561
6601
|
"enableJsonFlag": true,
|
|
6562
|
-
"title": "Detect unused
|
|
6602
|
+
"title": "Detect unused Users in Salesforce",
|
|
6563
6603
|
"requiresProject": false,
|
|
6564
6604
|
"isESM": true,
|
|
6565
6605
|
"relativePath": [
|
|
@@ -6568,42 +6608,42 @@
|
|
|
6568
6608
|
"hardis",
|
|
6569
6609
|
"org",
|
|
6570
6610
|
"diagnose",
|
|
6571
|
-
"
|
|
6611
|
+
"unusedusers.js"
|
|
6572
6612
|
],
|
|
6573
6613
|
"aliasPermutations": [],
|
|
6574
6614
|
"permutations": [
|
|
6575
|
-
"hardis:org:diagnose:
|
|
6576
|
-
"org:hardis:diagnose:
|
|
6577
|
-
"org:diagnose:hardis:
|
|
6578
|
-
"org:diagnose:
|
|
6579
|
-
"hardis:diagnose:org:
|
|
6580
|
-
"diagnose:hardis:org:
|
|
6581
|
-
"diagnose:org:hardis:
|
|
6582
|
-
"diagnose:org:
|
|
6583
|
-
"hardis:diagnose:
|
|
6584
|
-
"diagnose:hardis:
|
|
6585
|
-
"diagnose:
|
|
6586
|
-
"diagnose:
|
|
6587
|
-
"hardis:org:
|
|
6588
|
-
"org:hardis:
|
|
6589
|
-
"org:
|
|
6590
|
-
"org:
|
|
6591
|
-
"hardis:
|
|
6592
|
-
"
|
|
6593
|
-
"
|
|
6594
|
-
"
|
|
6595
|
-
"hardis:
|
|
6596
|
-
"
|
|
6597
|
-
"
|
|
6598
|
-
"
|
|
6615
|
+
"hardis:org:diagnose:unusedusers",
|
|
6616
|
+
"org:hardis:diagnose:unusedusers",
|
|
6617
|
+
"org:diagnose:hardis:unusedusers",
|
|
6618
|
+
"org:diagnose:unusedusers:hardis",
|
|
6619
|
+
"hardis:diagnose:org:unusedusers",
|
|
6620
|
+
"diagnose:hardis:org:unusedusers",
|
|
6621
|
+
"diagnose:org:hardis:unusedusers",
|
|
6622
|
+
"diagnose:org:unusedusers:hardis",
|
|
6623
|
+
"hardis:diagnose:unusedusers:org",
|
|
6624
|
+
"diagnose:hardis:unusedusers:org",
|
|
6625
|
+
"diagnose:unusedusers:hardis:org",
|
|
6626
|
+
"diagnose:unusedusers:org:hardis",
|
|
6627
|
+
"hardis:org:unusedusers:diagnose",
|
|
6628
|
+
"org:hardis:unusedusers:diagnose",
|
|
6629
|
+
"org:unusedusers:hardis:diagnose",
|
|
6630
|
+
"org:unusedusers:diagnose:hardis",
|
|
6631
|
+
"hardis:unusedusers:org:diagnose",
|
|
6632
|
+
"unusedusers:hardis:org:diagnose",
|
|
6633
|
+
"unusedusers:org:hardis:diagnose",
|
|
6634
|
+
"unusedusers:org:diagnose:hardis",
|
|
6635
|
+
"hardis:unusedusers:diagnose:org",
|
|
6636
|
+
"unusedusers:hardis:diagnose:org",
|
|
6637
|
+
"unusedusers:diagnose:hardis:org",
|
|
6638
|
+
"unusedusers:diagnose:org:hardis"
|
|
6599
6639
|
]
|
|
6600
6640
|
},
|
|
6601
|
-
"hardis:org:
|
|
6641
|
+
"hardis:org:files:export": {
|
|
6602
6642
|
"aliases": [],
|
|
6603
6643
|
"args": {},
|
|
6604
|
-
"description": "\n## Command Behavior\n\n**
|
|
6644
|
+
"description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, and output naming conventions.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesExporter Class:** The core logic is encapsulated within the `FilesExporter` class, which orchestrates the entire export process.\n- **SOQL Queries (Bulk API):** It uses Salesforce Bulk API queries to efficiently retrieve large volumes of parent record IDs and file metadata.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project and `promptFilesExportConfiguration` for customizing export options.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues or API limits.\n</details>\n",
|
|
6605
6645
|
"examples": [
|
|
6606
|
-
"$ sf hardis:org:
|
|
6646
|
+
"$ sf hardis:org:files:export"
|
|
6607
6647
|
],
|
|
6608
6648
|
"flags": {
|
|
6609
6649
|
"json": {
|
|
@@ -6621,10 +6661,37 @@
|
|
|
6621
6661
|
"multiple": false,
|
|
6622
6662
|
"type": "option"
|
|
6623
6663
|
},
|
|
6624
|
-
"
|
|
6625
|
-
"char": "
|
|
6626
|
-
"description": "
|
|
6627
|
-
"name": "
|
|
6664
|
+
"path": {
|
|
6665
|
+
"char": "p",
|
|
6666
|
+
"description": "Path to the file export project",
|
|
6667
|
+
"name": "path",
|
|
6668
|
+
"hasDynamicHelp": false,
|
|
6669
|
+
"multiple": false,
|
|
6670
|
+
"type": "option"
|
|
6671
|
+
},
|
|
6672
|
+
"chunksize": {
|
|
6673
|
+
"char": "c",
|
|
6674
|
+
"description": "Number of records to add in a chunk before it is processed",
|
|
6675
|
+
"name": "chunksize",
|
|
6676
|
+
"default": 1000,
|
|
6677
|
+
"hasDynamicHelp": false,
|
|
6678
|
+
"multiple": false,
|
|
6679
|
+
"type": "option"
|
|
6680
|
+
},
|
|
6681
|
+
"polltimeout": {
|
|
6682
|
+
"char": "t",
|
|
6683
|
+
"description": "Timeout in MS for Bulk API calls",
|
|
6684
|
+
"name": "polltimeout",
|
|
6685
|
+
"default": 300000,
|
|
6686
|
+
"hasDynamicHelp": false,
|
|
6687
|
+
"multiple": false,
|
|
6688
|
+
"type": "option"
|
|
6689
|
+
},
|
|
6690
|
+
"startchunknumber": {
|
|
6691
|
+
"char": "s",
|
|
6692
|
+
"description": "Chunk number to start from",
|
|
6693
|
+
"name": "startchunknumber",
|
|
6694
|
+
"default": 0,
|
|
6628
6695
|
"hasDynamicHelp": false,
|
|
6629
6696
|
"multiple": false,
|
|
6630
6697
|
"type": "option"
|
|
@@ -6667,30 +6734,13 @@
|
|
|
6667
6734
|
},
|
|
6668
6735
|
"hasDynamicHelp": true,
|
|
6669
6736
|
"hiddenAliases": [],
|
|
6670
|
-
"id": "hardis:org:
|
|
6737
|
+
"id": "hardis:org:files:export",
|
|
6671
6738
|
"pluginAlias": "sfdx-hardis",
|
|
6672
6739
|
"pluginName": "sfdx-hardis",
|
|
6673
6740
|
"pluginType": "core",
|
|
6674
6741
|
"strict": true,
|
|
6675
6742
|
"enableJsonFlag": true,
|
|
6676
|
-
"title": "
|
|
6677
|
-
"allowedInactiveConnectedApps": [
|
|
6678
|
-
"Ant Migration Tool",
|
|
6679
|
-
"Chatter Desktop",
|
|
6680
|
-
"Chatter Mobile for BlackBerry",
|
|
6681
|
-
"Force.com IDE",
|
|
6682
|
-
"OIQ_Integration",
|
|
6683
|
-
"Salesforce CLI",
|
|
6684
|
-
"Salesforce Files",
|
|
6685
|
-
"Salesforce Mobile Dashboards",
|
|
6686
|
-
"Salesforce Touch",
|
|
6687
|
-
"Salesforce for Outlook",
|
|
6688
|
-
"SalesforceA",
|
|
6689
|
-
"SalesforceA for Android",
|
|
6690
|
-
"SalesforceA for iOS",
|
|
6691
|
-
"SalesforceDX Namespace Registry",
|
|
6692
|
-
"SalesforceIQ"
|
|
6693
|
-
],
|
|
6743
|
+
"title": "Export files",
|
|
6694
6744
|
"requiresProject": false,
|
|
6695
6745
|
"isESM": true,
|
|
6696
6746
|
"relativePath": [
|
|
@@ -6698,44 +6748,43 @@
|
|
|
6698
6748
|
"commands",
|
|
6699
6749
|
"hardis",
|
|
6700
6750
|
"org",
|
|
6701
|
-
"
|
|
6702
|
-
"
|
|
6751
|
+
"files",
|
|
6752
|
+
"export.js"
|
|
6703
6753
|
],
|
|
6704
6754
|
"aliasPermutations": [],
|
|
6705
6755
|
"permutations": [
|
|
6706
|
-
"hardis:org:
|
|
6707
|
-
"org:hardis:
|
|
6708
|
-
"org:
|
|
6709
|
-
"org:
|
|
6710
|
-
"hardis:
|
|
6711
|
-
"
|
|
6712
|
-
"
|
|
6713
|
-
"
|
|
6714
|
-
"hardis:
|
|
6715
|
-
"
|
|
6716
|
-
"
|
|
6717
|
-
"
|
|
6718
|
-
"hardis:org:
|
|
6719
|
-
"org:hardis:
|
|
6720
|
-
"org:
|
|
6721
|
-
"org:
|
|
6722
|
-
"hardis:
|
|
6723
|
-
"
|
|
6724
|
-
"
|
|
6725
|
-
"
|
|
6726
|
-
"hardis:
|
|
6727
|
-
"
|
|
6728
|
-
"
|
|
6729
|
-
"
|
|
6756
|
+
"hardis:org:files:export",
|
|
6757
|
+
"org:hardis:files:export",
|
|
6758
|
+
"org:files:hardis:export",
|
|
6759
|
+
"org:files:export:hardis",
|
|
6760
|
+
"hardis:files:org:export",
|
|
6761
|
+
"files:hardis:org:export",
|
|
6762
|
+
"files:org:hardis:export",
|
|
6763
|
+
"files:org:export:hardis",
|
|
6764
|
+
"hardis:files:export:org",
|
|
6765
|
+
"files:hardis:export:org",
|
|
6766
|
+
"files:export:hardis:org",
|
|
6767
|
+
"files:export:org:hardis",
|
|
6768
|
+
"hardis:org:export:files",
|
|
6769
|
+
"org:hardis:export:files",
|
|
6770
|
+
"org:export:hardis:files",
|
|
6771
|
+
"org:export:files:hardis",
|
|
6772
|
+
"hardis:export:org:files",
|
|
6773
|
+
"export:hardis:org:files",
|
|
6774
|
+
"export:org:hardis:files",
|
|
6775
|
+
"export:org:files:hardis",
|
|
6776
|
+
"hardis:export:files:org",
|
|
6777
|
+
"export:hardis:files:org",
|
|
6778
|
+
"export:files:hardis:org",
|
|
6779
|
+
"export:files:org:hardis"
|
|
6730
6780
|
]
|
|
6731
6781
|
},
|
|
6732
|
-
"hardis:org:
|
|
6782
|
+
"hardis:org:files:import": {
|
|
6733
6783
|
"aliases": [],
|
|
6734
6784
|
"args": {},
|
|
6735
|
-
"description": "\
|
|
6785
|
+
"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",
|
|
6736
6786
|
"examples": [
|
|
6737
|
-
"$ sf hardis:org:
|
|
6738
|
-
"$ sf hardis:org:diagnose:unusedlicenses --fix"
|
|
6787
|
+
"$ sf hardis:org:files:import"
|
|
6739
6788
|
],
|
|
6740
6789
|
"flags": {
|
|
6741
6790
|
"json": {
|
|
@@ -6753,14 +6802,21 @@
|
|
|
6753
6802
|
"multiple": false,
|
|
6754
6803
|
"type": "option"
|
|
6755
6804
|
},
|
|
6756
|
-
"
|
|
6757
|
-
"char": "
|
|
6758
|
-
"description": "
|
|
6759
|
-
"name": "
|
|
6805
|
+
"path": {
|
|
6806
|
+
"char": "p",
|
|
6807
|
+
"description": "Path to the file export project",
|
|
6808
|
+
"name": "path",
|
|
6760
6809
|
"hasDynamicHelp": false,
|
|
6761
6810
|
"multiple": false,
|
|
6762
6811
|
"type": "option"
|
|
6763
6812
|
},
|
|
6813
|
+
"overwrite": {
|
|
6814
|
+
"char": "f",
|
|
6815
|
+
"description": "Override existing files (doubles the number of API calls)",
|
|
6816
|
+
"name": "overwrite",
|
|
6817
|
+
"allowNo": false,
|
|
6818
|
+
"type": "boolean"
|
|
6819
|
+
},
|
|
6764
6820
|
"debug": {
|
|
6765
6821
|
"char": "d",
|
|
6766
6822
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6799,79 +6855,58 @@
|
|
|
6799
6855
|
},
|
|
6800
6856
|
"hasDynamicHelp": true,
|
|
6801
6857
|
"hiddenAliases": [],
|
|
6802
|
-
"id": "hardis:org:
|
|
6858
|
+
"id": "hardis:org:files:import",
|
|
6803
6859
|
"pluginAlias": "sfdx-hardis",
|
|
6804
6860
|
"pluginName": "sfdx-hardis",
|
|
6805
6861
|
"pluginType": "core",
|
|
6806
6862
|
"strict": true,
|
|
6807
6863
|
"enableJsonFlag": true,
|
|
6808
|
-
"title": "
|
|
6864
|
+
"title": "Import files",
|
|
6809
6865
|
"requiresProject": false,
|
|
6810
|
-
"additionalPermissionSetsToAlwaysGet": [
|
|
6811
|
-
"Sales_User"
|
|
6812
|
-
],
|
|
6813
|
-
"permSetsPermSetLicenses": [
|
|
6814
|
-
{
|
|
6815
|
-
"permSet": "Sales_User",
|
|
6816
|
-
"permSetLicense": "SalesUserPsl"
|
|
6817
|
-
}
|
|
6818
|
-
],
|
|
6819
|
-
"profilesPermissionSetLicenses": [
|
|
6820
|
-
{
|
|
6821
|
-
"profile": "Salesforce API Only",
|
|
6822
|
-
"permSetLicense": "SalesforceAPIIntegrationPsl"
|
|
6823
|
-
}
|
|
6824
|
-
],
|
|
6825
|
-
"alwaysExcludeForActiveUsersPermissionSetLicenses": [
|
|
6826
|
-
"IdentityConnect"
|
|
6827
|
-
],
|
|
6828
6866
|
"isESM": true,
|
|
6829
6867
|
"relativePath": [
|
|
6830
6868
|
"lib",
|
|
6831
6869
|
"commands",
|
|
6832
6870
|
"hardis",
|
|
6833
6871
|
"org",
|
|
6834
|
-
"
|
|
6835
|
-
"
|
|
6872
|
+
"files",
|
|
6873
|
+
"import.js"
|
|
6836
6874
|
],
|
|
6837
6875
|
"aliasPermutations": [],
|
|
6838
6876
|
"permutations": [
|
|
6839
|
-
"hardis:org:
|
|
6840
|
-
"org:hardis:
|
|
6841
|
-
"org:
|
|
6842
|
-
"org:
|
|
6843
|
-
"hardis:
|
|
6844
|
-
"
|
|
6845
|
-
"
|
|
6846
|
-
"
|
|
6847
|
-
"hardis:
|
|
6848
|
-
"
|
|
6849
|
-
"
|
|
6850
|
-
"
|
|
6851
|
-
"hardis:org:
|
|
6852
|
-
"org:hardis:
|
|
6853
|
-
"org:
|
|
6854
|
-
"org:
|
|
6855
|
-
"hardis:
|
|
6856
|
-
"
|
|
6857
|
-
"
|
|
6858
|
-
"
|
|
6859
|
-
"hardis:
|
|
6860
|
-
"
|
|
6861
|
-
"
|
|
6862
|
-
"
|
|
6877
|
+
"hardis:org:files:import",
|
|
6878
|
+
"org:hardis:files:import",
|
|
6879
|
+
"org:files:hardis:import",
|
|
6880
|
+
"org:files:import:hardis",
|
|
6881
|
+
"hardis:files:org:import",
|
|
6882
|
+
"files:hardis:org:import",
|
|
6883
|
+
"files:org:hardis:import",
|
|
6884
|
+
"files:org:import:hardis",
|
|
6885
|
+
"hardis:files:import:org",
|
|
6886
|
+
"files:hardis:import:org",
|
|
6887
|
+
"files:import:hardis:org",
|
|
6888
|
+
"files:import:org:hardis",
|
|
6889
|
+
"hardis:org:import:files",
|
|
6890
|
+
"org:hardis:import:files",
|
|
6891
|
+
"org:import:hardis:files",
|
|
6892
|
+
"org:import:files:hardis",
|
|
6893
|
+
"hardis:import:org:files",
|
|
6894
|
+
"import:hardis:org:files",
|
|
6895
|
+
"import:org:hardis:files",
|
|
6896
|
+
"import:org:files:hardis",
|
|
6897
|
+
"hardis:import:files:org",
|
|
6898
|
+
"import:hardis:files:org",
|
|
6899
|
+
"import:files:hardis:org",
|
|
6900
|
+
"import:files:org:hardis"
|
|
6863
6901
|
]
|
|
6864
6902
|
},
|
|
6865
|
-
"hardis:org:
|
|
6903
|
+
"hardis:org:fix:listviewmine": {
|
|
6866
6904
|
"aliases": [],
|
|
6867
6905
|
"args": {},
|
|
6868
|
-
"description": "
|
|
6906
|
+
"description": "Fix listviews whose scope Mine has been replaced by Everything\n\n[](https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7)\n\nList of ListViews can be:\n\n- read from .sfdx-hardis.yml file in property **listViewsToSetToMine**\n- sent in argument listviews\n\nNote: property **listViewsToSetToMine** can be auto-generated by command hardis:work:save if .sfdx-hardis.yml contains the following configuration\n\n```yaml\nautoCleanTypes:\n - listViewsMine\n```\n\n- Example of sfdx-hardis.yml property `listViewsToSetToMine`:\n\n```yaml\nlistViewsToSetToMine:\n - \"force-app/main/default/objects/Operation__c/listViews/MyCurrentOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Operation__c/listViews/MyFinalizedOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/Default_Opportunity_Pipeline.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MyCurrentSubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MySubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Account/listViews/MyActivePartners.listView-meta.xml\"\n```\n\n- If manually written, this could also be:\n\n```yaml\nlistViewsToSetToMine:\n - \"Operation__c:MyCurrentOperations\"\n - \"Operation__c:MyFinalizedOperations\"\n - \"Opportunity:Default_Opportunity_Pipeline\"\n - \"Opportunity:MyCurrentSubscriptions\"\n - \"Opportunity:MySubscriptions\"\n - \"Account:MyActivePartners\"\n```\n\nTroubleshooting: if you need to run this command from an alpine-linux based docker image, use this workaround in your dockerfile:\n\n```dockerfile\n# Do not use puppeteer embedded chromium\nRUN apk add --update --no-cache chromium\nENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=\"true\"\nENV CHROMIUM_PATH=\"/usr/bin/chromium-browser\"\nENV PUPPETEER_EXECUTABLE_PATH=\"$\\{CHROMIUM_PATH}\" // remove \\ before {\n```\n",
|
|
6869
6907
|
"examples": [
|
|
6870
|
-
"$ sf hardis:org:
|
|
6871
|
-
"$ sf hardis:org:
|
|
6872
|
-
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm",
|
|
6873
|
-
"$ sf hardis:org:diagnose:unusedusers --days 60 --licenseidentifiers SFDC,AUL,AUL1",
|
|
6874
|
-
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm --returnactiveusers"
|
|
6908
|
+
"$ sf hardis:org:fix:listviewmine",
|
|
6909
|
+
"$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
|
|
6875
6910
|
],
|
|
6876
6911
|
"flags": {
|
|
6877
6912
|
"json": {
|
|
@@ -6889,49 +6924,14 @@
|
|
|
6889
6924
|
"multiple": false,
|
|
6890
6925
|
"type": "option"
|
|
6891
6926
|
},
|
|
6892
|
-
"
|
|
6893
|
-
"char": "f",
|
|
6894
|
-
"description": "Force the path and name of output report file. Must end with .csv",
|
|
6895
|
-
"name": "outputfile",
|
|
6896
|
-
"hasDynamicHelp": false,
|
|
6897
|
-
"multiple": false,
|
|
6898
|
-
"type": "option"
|
|
6899
|
-
},
|
|
6900
|
-
"days": {
|
|
6901
|
-
"char": "t",
|
|
6902
|
-
"description": "Extracts the users that have been inactive for the amount of days specified. In CI, default is 180 days",
|
|
6903
|
-
"name": "days",
|
|
6904
|
-
"hasDynamicHelp": false,
|
|
6905
|
-
"multiple": false,
|
|
6906
|
-
"type": "option"
|
|
6907
|
-
},
|
|
6908
|
-
"licensetypes": {
|
|
6927
|
+
"listviews": {
|
|
6909
6928
|
"char": "l",
|
|
6910
|
-
"description": "
|
|
6911
|
-
"name": "
|
|
6912
|
-
"hasDynamicHelp": false,
|
|
6913
|
-
"multiple": false,
|
|
6914
|
-
"options": [
|
|
6915
|
-
"all",
|
|
6916
|
-
"all-crm",
|
|
6917
|
-
"all-paying"
|
|
6918
|
-
],
|
|
6919
|
-
"type": "option"
|
|
6920
|
-
},
|
|
6921
|
-
"licenseidentifiers": {
|
|
6922
|
-
"char": "i",
|
|
6923
|
-
"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",
|
|
6924
|
-
"name": "licenseidentifiers",
|
|
6929
|
+
"description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
|
|
6930
|
+
"name": "listviews",
|
|
6925
6931
|
"hasDynamicHelp": false,
|
|
6926
6932
|
"multiple": false,
|
|
6927
6933
|
"type": "option"
|
|
6928
6934
|
},
|
|
6929
|
-
"returnactiveusers": {
|
|
6930
|
-
"description": "Inverts the command by returning the active users",
|
|
6931
|
-
"name": "returnactiveusers",
|
|
6932
|
-
"allowNo": false,
|
|
6933
|
-
"type": "boolean"
|
|
6934
|
-
},
|
|
6935
6935
|
"debug": {
|
|
6936
6936
|
"char": "d",
|
|
6937
6937
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6970,49 +6970,49 @@
|
|
|
6970
6970
|
},
|
|
6971
6971
|
"hasDynamicHelp": true,
|
|
6972
6972
|
"hiddenAliases": [],
|
|
6973
|
-
"id": "hardis:org:
|
|
6973
|
+
"id": "hardis:org:fix:listviewmine",
|
|
6974
6974
|
"pluginAlias": "sfdx-hardis",
|
|
6975
6975
|
"pluginName": "sfdx-hardis",
|
|
6976
6976
|
"pluginType": "core",
|
|
6977
6977
|
"strict": true,
|
|
6978
6978
|
"enableJsonFlag": true,
|
|
6979
|
-
"title": "
|
|
6980
|
-
"requiresProject":
|
|
6979
|
+
"title": "Fix listviews with ",
|
|
6980
|
+
"requiresProject": true,
|
|
6981
6981
|
"isESM": true,
|
|
6982
6982
|
"relativePath": [
|
|
6983
6983
|
"lib",
|
|
6984
6984
|
"commands",
|
|
6985
6985
|
"hardis",
|
|
6986
6986
|
"org",
|
|
6987
|
-
"
|
|
6988
|
-
"
|
|
6987
|
+
"fix",
|
|
6988
|
+
"listviewmine.js"
|
|
6989
6989
|
],
|
|
6990
6990
|
"aliasPermutations": [],
|
|
6991
6991
|
"permutations": [
|
|
6992
|
-
"hardis:org:
|
|
6993
|
-
"org:hardis:
|
|
6994
|
-
"org:
|
|
6995
|
-
"org:
|
|
6996
|
-
"hardis:
|
|
6997
|
-
"
|
|
6998
|
-
"
|
|
6999
|
-
"
|
|
7000
|
-
"hardis:
|
|
7001
|
-
"
|
|
7002
|
-
"
|
|
7003
|
-
"
|
|
7004
|
-
"hardis:org:
|
|
7005
|
-
"org:hardis:
|
|
7006
|
-
"org:
|
|
7007
|
-
"org:
|
|
7008
|
-
"hardis:
|
|
7009
|
-
"
|
|
7010
|
-
"
|
|
7011
|
-
"
|
|
7012
|
-
"hardis:
|
|
7013
|
-
"
|
|
7014
|
-
"
|
|
7015
|
-
"
|
|
6992
|
+
"hardis:org:fix:listviewmine",
|
|
6993
|
+
"org:hardis:fix:listviewmine",
|
|
6994
|
+
"org:fix:hardis:listviewmine",
|
|
6995
|
+
"org:fix:listviewmine:hardis",
|
|
6996
|
+
"hardis:fix:org:listviewmine",
|
|
6997
|
+
"fix:hardis:org:listviewmine",
|
|
6998
|
+
"fix:org:hardis:listviewmine",
|
|
6999
|
+
"fix:org:listviewmine:hardis",
|
|
7000
|
+
"hardis:fix:listviewmine:org",
|
|
7001
|
+
"fix:hardis:listviewmine:org",
|
|
7002
|
+
"fix:listviewmine:hardis:org",
|
|
7003
|
+
"fix:listviewmine:org:hardis",
|
|
7004
|
+
"hardis:org:listviewmine:fix",
|
|
7005
|
+
"org:hardis:listviewmine:fix",
|
|
7006
|
+
"org:listviewmine:hardis:fix",
|
|
7007
|
+
"org:listviewmine:fix:hardis",
|
|
7008
|
+
"hardis:listviewmine:org:fix",
|
|
7009
|
+
"listviewmine:hardis:org:fix",
|
|
7010
|
+
"listviewmine:org:hardis:fix",
|
|
7011
|
+
"listviewmine:org:fix:hardis",
|
|
7012
|
+
"hardis:listviewmine:fix:org",
|
|
7013
|
+
"listviewmine:hardis:fix:org",
|
|
7014
|
+
"listviewmine:fix:hardis:org",
|
|
7015
|
+
"listviewmine:fix:org:hardis"
|
|
7016
7016
|
]
|
|
7017
7017
|
},
|
|
7018
7018
|
"hardis:org:generate:packagexmlfull": {
|
|
@@ -15102,5 +15102,5 @@
|
|
|
15102
15102
|
]
|
|
15103
15103
|
}
|
|
15104
15104
|
},
|
|
15105
|
-
"version": "6.0.7-
|
|
15105
|
+
"version": "6.0.7-beta202508231311.0"
|
|
15106
15106
|
}
|