sfdx-hardis 6.11.5 → 6.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,13 +57,12 @@
57
57
  "world:hello"
58
58
  ]
59
59
  },
60
- "hardis:auth:login": {
60
+ "hardis:cache:clear": {
61
61
  "aliases": [],
62
62
  "args": {},
63
- "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
63
+ "description": "\n## Command Behavior\n\n**Clears the local cache generated by the sfdx-hardis plugin.**\n\nThis command is designed to remove temporary files, stored configurations, and other cached data that sfdx-hardis uses to optimize its operations. Clearing the cache can be beneficial for:\n\n- **Troubleshooting:** Resolving unexpected behavior or inconsistencies.\n- **Disk Space Management:** Freeing up storage on your local machine.\n- **Ensuring Fresh Data:** Guaranteeing that the plugin operates with the most current data and configurations.\n\n## Technical explanations\n\nThe command's technical implementation is straightforward:\n\n- **Direct Function Call:** It directly invokes the `clearCache()` function, which is imported from \buri../../../common/cache/index.js\buri.\n- **Cache Management Logic:** The \buriclearCache()` function encapsulates the logic for identifying and removing the specific files and directories that constitute the sfdx-hardis cache.\n",
64
64
  "examples": [
65
- "$ sf hardis:auth:login",
66
- "CI=true CI_COMMIT_REF_NAME=monitoring_myclient sf hardis:auth:login"
65
+ "$ sf hardis:cache:clear"
67
66
  ],
68
67
  "flags": {
69
68
  "json": {
@@ -81,28 +80,6 @@
81
80
  "multiple": false,
82
81
  "type": "option"
83
82
  },
84
- "instanceurl": {
85
- "char": "r",
86
- "description": "URL of org instance",
87
- "name": "instanceurl",
88
- "hasDynamicHelp": false,
89
- "multiple": false,
90
- "type": "option"
91
- },
92
- "devhub": {
93
- "char": "h",
94
- "description": "Also connect associated DevHub",
95
- "name": "devhub",
96
- "allowNo": false,
97
- "type": "boolean"
98
- },
99
- "scratchorg": {
100
- "char": "s",
101
- "description": "Scratch org",
102
- "name": "scratchorg",
103
- "allowNo": false,
104
- "type": "boolean"
105
- },
106
83
  "debug": {
107
84
  "char": "d",
108
85
  "description": "Activate debug mode (more logs)",
@@ -126,38 +103,42 @@
126
103
  },
127
104
  "hasDynamicHelp": false,
128
105
  "hiddenAliases": [],
129
- "id": "hardis:auth:login",
106
+ "id": "hardis:cache:clear",
130
107
  "pluginAlias": "sfdx-hardis",
131
108
  "pluginName": "sfdx-hardis",
132
109
  "pluginType": "core",
133
110
  "strict": true,
134
111
  "enableJsonFlag": true,
135
- "title": "Login",
112
+ "title": "Clear sfdx-hardis cache",
113
+ "uiConfig": {
114
+ "hide": true
115
+ },
136
116
  "requiresProject": false,
137
117
  "isESM": true,
138
118
  "relativePath": [
139
119
  "lib",
140
120
  "commands",
141
121
  "hardis",
142
- "auth",
143
- "login.js"
122
+ "cache",
123
+ "clear.js"
144
124
  ],
145
125
  "aliasPermutations": [],
146
126
  "permutations": [
147
- "hardis:auth:login",
148
- "auth:hardis:login",
149
- "auth:login:hardis",
150
- "hardis:login:auth",
151
- "login:hardis:auth",
152
- "login:auth:hardis"
127
+ "hardis:cache:clear",
128
+ "cache:hardis:clear",
129
+ "cache:clear:hardis",
130
+ "hardis:clear:cache",
131
+ "clear:hardis:cache",
132
+ "clear:cache:hardis"
153
133
  ]
154
134
  },
155
- "hardis:cache:clear": {
135
+ "hardis:auth:login": {
156
136
  "aliases": [],
157
137
  "args": {},
158
- "description": "\n## Command Behavior\n\n**Clears the local cache generated by the sfdx-hardis plugin.**\n\nThis command is designed to remove temporary files, stored configurations, and other cached data that sfdx-hardis uses to optimize its operations. Clearing the cache can be beneficial for:\n\n- **Troubleshooting:** Resolving unexpected behavior or inconsistencies.\n- **Disk Space Management:** Freeing up storage on your local machine.\n- **Ensuring Fresh Data:** Guaranteeing that the plugin operates with the most current data and configurations.\n\n## Technical explanations\n\nThe command's technical implementation is straightforward:\n\n- **Direct Function Call:** It directly invokes the `clearCache()` function, which is imported from \buri../../../common/cache/index.js\buri.\n- **Cache Management Logic:** The \buriclearCache()` function encapsulates the logic for identifying and removing the specific files and directories that constitute the sfdx-hardis cache.\n",
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",
159
139
  "examples": [
160
- "$ sf hardis:cache:clear"
140
+ "$ sf hardis:auth:login",
141
+ "CI=true CI_COMMIT_REF_NAME=monitoring_myclient sf hardis:auth:login"
161
142
  ],
162
143
  "flags": {
163
144
  "json": {
@@ -175,6 +156,28 @@
175
156
  "multiple": false,
176
157
  "type": "option"
177
158
  },
159
+ "instanceurl": {
160
+ "char": "r",
161
+ "description": "URL of org instance",
162
+ "name": "instanceurl",
163
+ "hasDynamicHelp": false,
164
+ "multiple": false,
165
+ "type": "option"
166
+ },
167
+ "devhub": {
168
+ "char": "h",
169
+ "description": "Also connect associated DevHub",
170
+ "name": "devhub",
171
+ "allowNo": false,
172
+ "type": "boolean"
173
+ },
174
+ "scratchorg": {
175
+ "char": "s",
176
+ "description": "Scratch org",
177
+ "name": "scratchorg",
178
+ "allowNo": false,
179
+ "type": "boolean"
180
+ },
178
181
  "debug": {
179
182
  "char": "d",
180
183
  "description": "Activate debug mode (more logs)",
@@ -198,33 +201,30 @@
198
201
  },
199
202
  "hasDynamicHelp": false,
200
203
  "hiddenAliases": [],
201
- "id": "hardis:cache:clear",
204
+ "id": "hardis:auth:login",
202
205
  "pluginAlias": "sfdx-hardis",
203
206
  "pluginName": "sfdx-hardis",
204
207
  "pluginType": "core",
205
208
  "strict": true,
206
209
  "enableJsonFlag": true,
207
- "title": "Clear sfdx-hardis cache",
208
- "uiConfig": {
209
- "hide": true
210
- },
210
+ "title": "Login",
211
211
  "requiresProject": false,
212
212
  "isESM": true,
213
213
  "relativePath": [
214
214
  "lib",
215
215
  "commands",
216
216
  "hardis",
217
- "cache",
218
- "clear.js"
217
+ "auth",
218
+ "login.js"
219
219
  ],
220
220
  "aliasPermutations": [],
221
221
  "permutations": [
222
- "hardis:cache:clear",
223
- "cache:hardis:clear",
224
- "cache:clear:hardis",
225
- "hardis:clear:cache",
226
- "clear:hardis:cache",
227
- "clear:cache:hardis"
222
+ "hardis:auth:login",
223
+ "auth:hardis:login",
224
+ "auth:login:hardis",
225
+ "hardis:login:auth",
226
+ "login:hardis:auth",
227
+ "login:auth:hardis"
228
228
  ]
229
229
  },
230
230
  "hardis:config:get": {
@@ -5539,15 +5539,12 @@
5539
5539
  "import:data:org:hardis"
5540
5540
  ]
5541
5541
  },
5542
- "hardis:org:diagnose:audittrail": {
5542
+ "hardis:org:files:export": {
5543
5543
  "aliases": [],
5544
5544
  "args": {},
5545
- "description": "Export Audit trail into a CSV file with selected criteria, and highlight suspect actions\n\nAlso detects updates of Custom Settings values (disable by defining `SKIP_AUDIT_TRAIL_CUSTOM_SETTINGS=true`)\n\nRegular setup actions performed in major orgs are filtered.\n\n- \"\"\n - createScratchOrg\n - changedsenderemail\n - deleteScratchOrg\n - loginasgrantedtopartnerbt\n- Certificate and Key Management\n - insertCertificate\n- Custom App Licenses\n - addeduserpackagelicense\n - granteduserpackagelicense\n - revokeduserpackagelicense\n- Customer Portal\n - createdcustomersuccessuser\n - CSPUserDisabled\n- Currency\n - updateddatedexchrate\n- Data Management\n - queueMembership\n- Email Administration\n - dkimRotationPreparationSuccessful\n - dkimRotationSuccessful\n- External Objects\n - xdsEncryptedFieldChange\n- Groups\n - groupMembership\n- Holidays\n - holiday_insert\n- Inbox mobile and legacy desktop apps\n - enableSIQUserNonEAC\n - siqUserAcceptedTOS\n- Manage Users\n - activateduser\n - createduser\n - changedcommunitynickname\n - changedemail\n - changedfederationid\n - changedpassword\n - changedinteractionuseroffon\n - changedinteractionuseronoff\n - changedmarketinguseroffon\n - changedmarketinguseronoff\n - changedofflineuseroffon\n - changedprofileforuserstdtostd\n - changedprofileforuser\n - changedprofileforusercusttostd\n - changedprofileforuserstdtocust\n - changedroleforusertonone\n - changedroleforuser\n - changedroleforuserfromnone\n - changedUserAdminVerifiedStatusVerified\n - changedUserEmailVerifiedStatusUnverified\n - changedUserEmailVerifiedStatusVerified\n - changedknowledgeuseroffon\n - changedsfcontentuseroffon\n - changedsupportuseroffon\n - changedusername\n - changedUserPhoneNumber\n - changedUserPhoneVerifiedStatusUnverified\n - changedUserPhoneVerifiedStatusVerified\n - deactivateduser\n - deleteAuthenticatorPairing\n - deleteTwoFactorInfo2\n - deleteTwoFactorTempCode\n - frozeuser\n - insertAuthenticatorPairing\n - insertTwoFactorInfo2\n - insertTwoFactorTempCode\n - lightningloginenroll\n - PermSetAssign\n - PermSetGroupAssign\n - PermSetGroupUnassign\n - PermSetLicenseAssign\n - PermSetUnassign\n - PermSetLicenseUnassign\n - registeredUserPhoneNumber\n - resetpassword\n - suNetworkAdminLogin\n - suNetworkAdminLogout\n - suOrgAdminLogin\n - suOrgAdminLogout\n - unfrozeuser\n - useremailchangesent\n- Mobile Administration\n - assigneduserstomobileconfig\n- Reporting Snapshots\n - createdReportJob\n - deletedReportJob\n- Sandboxes\n - DeleteSandbox\n\nBy default, deployment user defined in .sfdx-hardis.yml targetUsername property will be excluded.\n\nYou can define additional users to exclude in .sfdx-hardis.yml **monitoringExcludeUsernames** property.\n\nYou can also add more sections / actions considered as not suspect using property **monitoringAllowedSectionsActions**\n\nExample:\n\n```yaml\nmonitoringExcludeUsernames:\n - deploymentuser@cloudity.com\n - marketingcloud@cloudity.com\n - integration-user@cloudity.com\n\nmonitoringAllowedSectionsActions:\n \"Some section\": [] // Will ignore all actions from such section\n \"Some other section\": [\"actionType1\",\"actionType2\",\"actionType3\"] // Will ignore only those 3 actions from section \"Some other section\". Other actions in the same section will be considered as suspect.\n```\n\n## Excel output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-excel.jpg)\n\n## Local output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-local.jpg)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-suspect-audit-trail/) and can output Grafana, Slack and MsTeams Notifications.\n",
5545
+ "description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, output naming conventions, and file size filtering.\n- **File Size Filtering:** Supports minimum file size filtering via the `fileSizeMin` configuration parameter (in KB). Files smaller than the specified size will be skipped during export.\n- **File Validation:** After downloading each file, validates the integrity by:\n - **Checksum Validation:** For ContentVersion files, compares MD5 checksum with Salesforce's stored checksum\n - **Size Validation:** For both ContentVersion and Attachment files, verifies actual file size matches expected size\n - **Status Tracking:** Files are categorized with specific statuses: `success` (valid files), `failed` (download errors), `skipped` (filtered files), `invalid` (downloaded but failed validation)\n - All validation results are logged in the CSV export log for audit purposes\n- **Resume/Restart Capability:** \n - **Resume Mode:** When `--resume` flag is used (default in CI environments), checks existing downloaded files for validity. Valid files are skipped, invalid files are re-downloaded.\n - **Restart Mode:** When resume is disabled, clears the output folder and starts a fresh export.\n - **Interactive Mode:** When existing files are found and `--resume` is not explicitly specified (non-CI environments), prompts the user to choose between resume or restart.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesExporter Class:** The core logic is encapsulated within the `FilesExporter` class, which orchestrates the entire export process.\n- **SOQL Queries (Bulk API):** It uses Salesforce Bulk API queries to efficiently retrieve large volumes of parent record IDs and file metadata, including checksums and file sizes.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File Validation:** After each successful download, validates file integrity by comparing checksums (ContentVersion) and file sizes (both ContentVersion and Attachment) against Salesforce metadata.\n- **Resume Logic:** In resume mode, checks for existing files before downloading, validates their integrity, and only re-downloads invalid or missing files. This enables efficient recovery from interrupted exports.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project, `promptFilesExportConfiguration` for customizing export options, and prompts for resume/restart choice when existing files are found.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues, API limits, and file validation failures. Each file is assigned a specific status (`success`, `failed`, `skipped`, `invalid`) for comprehensive tracking and troubleshooting.\n</details>\n",
5546
5546
  "examples": [
5547
- "$ sf hardis:org:diagnose:audittrail",
5548
- "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
5549
- "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
5550
- "$ sf hardis:org:diagnose:audittrail --lastndays 5"
5547
+ "$ sf hardis:org:files:export"
5551
5548
  ],
5552
5549
  "flags": {
5553
5550
  "json": {
@@ -5565,30 +5562,48 @@
5565
5562
  "multiple": false,
5566
5563
  "type": "option"
5567
5564
  },
5568
- "excludeusers": {
5569
- "char": "e",
5570
- "description": "Comma-separated list of usernames to exclude",
5571
- "name": "excludeusers",
5565
+ "path": {
5566
+ "char": "p",
5567
+ "description": "Path to the file export project",
5568
+ "name": "path",
5572
5569
  "hasDynamicHelp": false,
5573
5570
  "multiple": false,
5574
5571
  "type": "option"
5575
5572
  },
5576
- "lastndays": {
5573
+ "chunksize": {
5574
+ "char": "c",
5575
+ "description": "Number of records to add in a chunk before it is processed",
5576
+ "name": "chunksize",
5577
+ "default": 1000,
5578
+ "hasDynamicHelp": false,
5579
+ "multiple": false,
5580
+ "type": "option"
5581
+ },
5582
+ "polltimeout": {
5577
5583
  "char": "t",
5578
- "description": "Number of days to extract from today (included)",
5579
- "name": "lastndays",
5584
+ "description": "Timeout in MS for Bulk API calls",
5585
+ "name": "polltimeout",
5586
+ "default": 300000,
5580
5587
  "hasDynamicHelp": false,
5581
5588
  "multiple": false,
5582
5589
  "type": "option"
5583
5590
  },
5584
- "outputfile": {
5585
- "char": "f",
5586
- "description": "Force the path and name of output report file. Must end with .csv",
5587
- "name": "outputfile",
5591
+ "startchunknumber": {
5592
+ "char": "s",
5593
+ "description": "Chunk number to start from",
5594
+ "name": "startchunknumber",
5595
+ "default": 0,
5588
5596
  "hasDynamicHelp": false,
5589
5597
  "multiple": false,
5590
5598
  "type": "option"
5591
5599
  },
5600
+ "resume": {
5601
+ "char": "r",
5602
+ "description": "Resume previous export by checking existing files (default in CI)",
5603
+ "name": "resume",
5604
+ "allowNo": false,
5605
+ "type": "boolean"
5606
+ },
5592
5607
  "debug": {
5593
5608
  "char": "d",
5594
5609
  "description": "Activate debug mode (more logs)",
@@ -5627,13 +5642,13 @@
5627
5642
  },
5628
5643
  "hasDynamicHelp": true,
5629
5644
  "hiddenAliases": [],
5630
- "id": "hardis:org:diagnose:audittrail",
5645
+ "id": "hardis:org:files:export",
5631
5646
  "pluginAlias": "sfdx-hardis",
5632
5647
  "pluginName": "sfdx-hardis",
5633
5648
  "pluginType": "core",
5634
5649
  "strict": true,
5635
5650
  "enableJsonFlag": true,
5636
- "title": "Diagnose content of Setup Audit Trail",
5651
+ "title": "Export files",
5637
5652
  "requiresProject": false,
5638
5653
  "isESM": true,
5639
5654
  "relativePath": [
@@ -5641,43 +5656,43 @@
5641
5656
  "commands",
5642
5657
  "hardis",
5643
5658
  "org",
5644
- "diagnose",
5645
- "audittrail.js"
5659
+ "files",
5660
+ "export.js"
5646
5661
  ],
5647
5662
  "aliasPermutations": [],
5648
5663
  "permutations": [
5649
- "hardis:org:diagnose:audittrail",
5650
- "org:hardis:diagnose:audittrail",
5651
- "org:diagnose:hardis:audittrail",
5652
- "org:diagnose:audittrail:hardis",
5653
- "hardis:diagnose:org:audittrail",
5654
- "diagnose:hardis:org:audittrail",
5655
- "diagnose:org:hardis:audittrail",
5656
- "diagnose:org:audittrail:hardis",
5657
- "hardis:diagnose:audittrail:org",
5658
- "diagnose:hardis:audittrail:org",
5659
- "diagnose:audittrail:hardis:org",
5660
- "diagnose:audittrail:org:hardis",
5661
- "hardis:org:audittrail:diagnose",
5662
- "org:hardis:audittrail:diagnose",
5663
- "org:audittrail:hardis:diagnose",
5664
- "org:audittrail:diagnose:hardis",
5665
- "hardis:audittrail:org:diagnose",
5666
- "audittrail:hardis:org:diagnose",
5667
- "audittrail:org:hardis:diagnose",
5668
- "audittrail:org:diagnose:hardis",
5669
- "hardis:audittrail:diagnose:org",
5670
- "audittrail:hardis:diagnose:org",
5671
- "audittrail:diagnose:hardis:org",
5672
- "audittrail:diagnose:org:hardis"
5664
+ "hardis:org:files:export",
5665
+ "org:hardis:files:export",
5666
+ "org:files:hardis:export",
5667
+ "org:files:export:hardis",
5668
+ "hardis:files:org:export",
5669
+ "files:hardis:org:export",
5670
+ "files:org:hardis:export",
5671
+ "files:org:export:hardis",
5672
+ "hardis:files:export:org",
5673
+ "files:hardis:export:org",
5674
+ "files:export:hardis:org",
5675
+ "files:export:org:hardis",
5676
+ "hardis:org:export:files",
5677
+ "org:hardis:export:files",
5678
+ "org:export:hardis:files",
5679
+ "org:export:files:hardis",
5680
+ "hardis:export:org:files",
5681
+ "export:hardis:org:files",
5682
+ "export:org:hardis:files",
5683
+ "export:org:files:hardis",
5684
+ "hardis:export:files:org",
5685
+ "export:hardis:files:org",
5686
+ "export:files:hardis:org",
5687
+ "export:files:org:hardis"
5673
5688
  ]
5674
5689
  },
5675
- "hardis:org:diagnose:instanceupgrade": {
5690
+ "hardis:org:files:import": {
5676
5691
  "aliases": [],
5677
5692
  "args": {},
5678
- "description": "\n## Command Behavior\n\n**Retrieves and displays the scheduled upgrade date for a Salesforce org's instance.**\n\nThis command provides crucial information about when your Salesforce instance will be upgraded to the next major release (Spring, Summer, or Winter). This is vital for release planning, testing, and ensuring compatibility with upcoming Salesforce features.\n\nKey functionalities:\n\n- **Instance Identification:** Determines the Salesforce instance name of your target org.\n- **Upgrade Date Retrieval:** Fetches the planned start time of the next major core service upgrade for that instance from the Salesforce Status API.\n- **Days Until Upgrade:** Calculates and displays the number of days remaining until the next major upgrade.\n- **Severity-Based Logging:** Adjusts the log severity (info, warning) based on the proximity of the upgrade date, providing a visual cue for urgency.\n- **Notifications:** Sends notifications to configured channels (e.g., Slack, MS Teams, Grafana) with the upgrade information, making it suitable for automated monitoring.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Query:** It first queries the `Organization` object in Salesforce to get the `InstanceName` of the target org.\n- **Salesforce Status API Integration:** It makes an HTTP GET request to the Salesforce Status API (`https://api.status.salesforce.com/v1/instances/{instanceName}/status`) to retrieve detailed information about the instance, including scheduled maintenances.\n- **Data Parsing:** It parses the JSON response from the Status API to extract the relevant major release upgrade information.\n- **Date Calculation:** Uses the `moment` library to calculate the difference in days between the current date and the planned upgrade date.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including the instance name, upgrade date, and days remaining, along with relevant metrics for monitoring dashboards.\n- **User Feedback:** Provides clear messages to the user about the upgrade status and proximity.\n</details>\n",
5693
+ "description": "\nThis command facilitates the mass upload of files into Salesforce, allowing you to populate records with associated documents, images, or other file types. It's a crucial tool for data migration, content seeding, or synchronizing external file repositories with Salesforce.\n\nKey functionalities:\n\n- **Configuration-Driven Import:** Relies on an `export.json` file within a designated file export project (created using `sf hardis:org:configure:files`) to determine which files to import and how they should be associated with Salesforce records.\n- **Interactive Project Selection:** If the file import project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Overwrite Option:** The `--overwrite` flag allows you to replace existing files in Salesforce with local versions that have the same name. Be aware that this option doubles the number of API calls used.\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for how to export files, which is often a prerequisite for importing:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesImporter Class:** The core logic is encapsulated within the `FilesImporter` class, which orchestrates the entire import process.\n- **File System Scan:** Scans the local file system within the configured project directory to identify files for import.\n- **Salesforce API Interaction:** Uses Salesforce APIs (e.g., ContentVersion, Attachment) to upload files and associate them with records.\n- **Configuration Loading:** Reads the `export.json` file to get the import configuration, including SOQL queries to identify parent records for file association.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file import project and `prompts` for confirming the overwrite behavior.\n- **Error Handling:** Includes mechanisms to handle potential errors during the import process, such as API limits or file upload failures.\n</details>\n",
5679
5694
  "examples": [
5680
- "$ sf hardis:org:diagnose:instanceupgrade"
5695
+ "$ sf hardis:org:files:import"
5681
5696
  ],
5682
5697
  "flags": {
5683
5698
  "json": {
@@ -5695,6 +5710,21 @@
5695
5710
  "multiple": false,
5696
5711
  "type": "option"
5697
5712
  },
5713
+ "path": {
5714
+ "char": "p",
5715
+ "description": "Path to the file export project",
5716
+ "name": "path",
5717
+ "hasDynamicHelp": false,
5718
+ "multiple": false,
5719
+ "type": "option"
5720
+ },
5721
+ "overwrite": {
5722
+ "char": "f",
5723
+ "description": "Override existing files (doubles the number of API calls)",
5724
+ "name": "overwrite",
5725
+ "allowNo": false,
5726
+ "type": "boolean"
5727
+ },
5698
5728
  "debug": {
5699
5729
  "char": "d",
5700
5730
  "description": "Activate debug mode (more logs)",
@@ -5733,13 +5763,13 @@
5733
5763
  },
5734
5764
  "hasDynamicHelp": true,
5735
5765
  "hiddenAliases": [],
5736
- "id": "hardis:org:diagnose:instanceupgrade",
5766
+ "id": "hardis:org:files:import",
5737
5767
  "pluginAlias": "sfdx-hardis",
5738
5768
  "pluginName": "sfdx-hardis",
5739
5769
  "pluginType": "core",
5740
5770
  "strict": true,
5741
5771
  "enableJsonFlag": true,
5742
- "title": "Get Instance Upgrade date",
5772
+ "title": "Import files",
5743
5773
  "requiresProject": false,
5744
5774
  "isESM": true,
5745
5775
  "relativePath": [
@@ -5747,46 +5777,46 @@
5747
5777
  "commands",
5748
5778
  "hardis",
5749
5779
  "org",
5750
- "diagnose",
5751
- "instanceupgrade.js"
5780
+ "files",
5781
+ "import.js"
5752
5782
  ],
5753
5783
  "aliasPermutations": [],
5754
5784
  "permutations": [
5755
- "hardis:org:diagnose:instanceupgrade",
5756
- "org:hardis:diagnose:instanceupgrade",
5757
- "org:diagnose:hardis:instanceupgrade",
5758
- "org:diagnose:instanceupgrade:hardis",
5759
- "hardis:diagnose:org:instanceupgrade",
5760
- "diagnose:hardis:org:instanceupgrade",
5761
- "diagnose:org:hardis:instanceupgrade",
5762
- "diagnose:org:instanceupgrade:hardis",
5763
- "hardis:diagnose:instanceupgrade:org",
5764
- "diagnose:hardis:instanceupgrade:org",
5765
- "diagnose:instanceupgrade:hardis:org",
5766
- "diagnose:instanceupgrade:org:hardis",
5767
- "hardis:org:instanceupgrade:diagnose",
5768
- "org:hardis:instanceupgrade:diagnose",
5769
- "org:instanceupgrade:hardis:diagnose",
5770
- "org:instanceupgrade:diagnose:hardis",
5771
- "hardis:instanceupgrade:org:diagnose",
5772
- "instanceupgrade:hardis:org:diagnose",
5773
- "instanceupgrade:org:hardis:diagnose",
5774
- "instanceupgrade:org:diagnose:hardis",
5775
- "hardis:instanceupgrade:diagnose:org",
5776
- "instanceupgrade:hardis:diagnose:org",
5777
- "instanceupgrade:diagnose:hardis:org",
5778
- "instanceupgrade:diagnose:org:hardis"
5785
+ "hardis:org:files:import",
5786
+ "org:hardis:files:import",
5787
+ "org:files:hardis:import",
5788
+ "org:files:import:hardis",
5789
+ "hardis:files:org:import",
5790
+ "files:hardis:org:import",
5791
+ "files:org:hardis:import",
5792
+ "files:org:import:hardis",
5793
+ "hardis:files:import:org",
5794
+ "files:hardis:import:org",
5795
+ "files:import:hardis:org",
5796
+ "files:import:org:hardis",
5797
+ "hardis:org:import:files",
5798
+ "org:hardis:import:files",
5799
+ "org:import:hardis:files",
5800
+ "org:import:files:hardis",
5801
+ "hardis:import:org:files",
5802
+ "import:hardis:org:files",
5803
+ "import:org:hardis:files",
5804
+ "import:org:files:hardis",
5805
+ "hardis:import:files:org",
5806
+ "import:hardis:files:org",
5807
+ "import:files:hardis:org",
5808
+ "import:files:org:hardis"
5779
5809
  ]
5780
5810
  },
5781
- "hardis:org:diagnose:legacyapi": {
5811
+ "hardis:org:diagnose:audittrail": {
5782
5812
  "aliases": [],
5783
5813
  "args": {},
5784
- "description": "Checks if an org uses retired or someday retired API version\n\n\nSee article below\n\n[![Handle Salesforce API versions Deprecation like a pro](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deprecated-api.jpg)](https://nicolas.vuillamy.fr/handle-salesforce-api-versions-deprecation-like-a-pro-335065f52238)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-deprecated-api-calls/) and can output Grafana, Slack and MsTeams Notifications.\n",
5814
+ "description": "Export Audit trail into a CSV file with selected criteria, and highlight suspect actions\n\nAlso detects updates of Custom Settings values (disable by defining `SKIP_AUDIT_TRAIL_CUSTOM_SETTINGS=true`)\n\nRegular setup actions performed in major orgs are filtered.\n\n- \"\"\n - createScratchOrg\n - changedsenderemail\n - deleteScratchOrg\n - loginasgrantedtopartnerbt\n- Certificate and Key Management\n - insertCertificate\n- Custom App Licenses\n - addeduserpackagelicense\n - granteduserpackagelicense\n - revokeduserpackagelicense\n- Customer Portal\n - createdcustomersuccessuser\n - CSPUserDisabled\n- Currency\n - updateddatedexchrate\n- Data Management\n - queueMembership\n- Email Administration\n - dkimRotationPreparationSuccessful\n - dkimRotationSuccessful\n- External Objects\n - xdsEncryptedFieldChange\n- Groups\n - groupMembership\n- Holidays\n - holiday_insert\n- Inbox mobile and legacy desktop apps\n - enableSIQUserNonEAC\n - siqUserAcceptedTOS\n- Manage Users\n - activateduser\n - createduser\n - changedcommunitynickname\n - changedemail\n - changedfederationid\n - changedpassword\n - changedinteractionuseroffon\n - changedinteractionuseronoff\n - changedmarketinguseroffon\n - changedmarketinguseronoff\n - changedofflineuseroffon\n - changedprofileforuserstdtostd\n - changedprofileforuser\n - changedprofileforusercusttostd\n - changedprofileforuserstdtocust\n - changedroleforusertonone\n - changedroleforuser\n - changedroleforuserfromnone\n - changedUserAdminVerifiedStatusVerified\n - changedUserEmailVerifiedStatusUnverified\n - changedUserEmailVerifiedStatusVerified\n - changedknowledgeuseroffon\n - changedsfcontentuseroffon\n - changedsupportuseroffon\n - changedusername\n - changedUserPhoneNumber\n - changedUserPhoneVerifiedStatusUnverified\n - changedUserPhoneVerifiedStatusVerified\n - deactivateduser\n - deleteAuthenticatorPairing\n - deleteTwoFactorInfo2\n - deleteTwoFactorTempCode\n - frozeuser\n - insertAuthenticatorPairing\n - insertTwoFactorInfo2\n - insertTwoFactorTempCode\n - lightningloginenroll\n - PermSetAssign\n - PermSetGroupAssign\n - PermSetGroupUnassign\n - PermSetLicenseAssign\n - PermSetUnassign\n - PermSetLicenseUnassign\n - registeredUserPhoneNumber\n - resetpassword\n - suNetworkAdminLogin\n - suNetworkAdminLogout\n - suOrgAdminLogin\n - suOrgAdminLogout\n - unfrozeuser\n - useremailchangesent\n- Mobile Administration\n - assigneduserstomobileconfig\n- Reporting Snapshots\n - createdReportJob\n - deletedReportJob\n- Sandboxes\n - DeleteSandbox\n\nBy default, deployment user defined in .sfdx-hardis.yml targetUsername property will be excluded.\n\nYou can define additional users to exclude in .sfdx-hardis.yml **monitoringExcludeUsernames** property.\n\nYou can also add more sections / actions considered as not suspect using property **monitoringAllowedSectionsActions**\n\nExample:\n\n```yaml\nmonitoringExcludeUsernames:\n - deploymentuser@cloudity.com\n - marketingcloud@cloudity.com\n - integration-user@cloudity.com\n\nmonitoringAllowedSectionsActions:\n \"Some section\": [] // Will ignore all actions from such section\n \"Some other section\": [\"actionType1\",\"actionType2\",\"actionType3\"] // Will ignore only those 3 actions from section \"Some other section\". Other actions in the same section will be considered as suspect.\n```\n\n## Excel output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-excel.jpg)\n\n## Local output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-local.jpg)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-suspect-audit-trail/) and can output Grafana, Slack and MsTeams Notifications.\n",
5785
5815
  "examples": [
5786
- "$ sf hardis:org:diagnose:legacyapi",
5787
- "$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com",
5788
- "$ sf hardis:org:diagnose:legacyapi --outputfile 'c:/path/to/folder/legacyapi.csv'",
5789
- "$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv"
5816
+ "$ sf hardis:org:diagnose:audittrail",
5817
+ "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
5818
+ "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
5819
+ "$ sf hardis:org:diagnose:audittrail --lastndays 5"
5790
5820
  ],
5791
5821
  "flags": {
5792
5822
  "json": {
@@ -5804,20 +5834,18 @@
5804
5834
  "multiple": false,
5805
5835
  "type": "option"
5806
5836
  },
5807
- "eventtype": {
5837
+ "excludeusers": {
5808
5838
  "char": "e",
5809
- "description": "Type of EventLogFile event to analyze",
5810
- "name": "eventtype",
5811
- "default": "ApiTotalUsage",
5839
+ "description": "Comma-separated list of usernames to exclude",
5840
+ "name": "excludeusers",
5812
5841
  "hasDynamicHelp": false,
5813
5842
  "multiple": false,
5814
5843
  "type": "option"
5815
5844
  },
5816
- "limit": {
5817
- "char": "l",
5818
- "description": "Number of latest EventLogFile events to analyze",
5819
- "name": "limit",
5820
- "default": 999,
5845
+ "lastndays": {
5846
+ "char": "t",
5847
+ "description": "Number of days to extract from today (included)",
5848
+ "name": "lastndays",
5821
5849
  "hasDynamicHelp": false,
5822
5850
  "multiple": false,
5823
5851
  "type": "option"
@@ -5868,13 +5896,13 @@
5868
5896
  },
5869
5897
  "hasDynamicHelp": true,
5870
5898
  "hiddenAliases": [],
5871
- "id": "hardis:org:diagnose:legacyapi",
5899
+ "id": "hardis:org:diagnose:audittrail",
5872
5900
  "pluginAlias": "sfdx-hardis",
5873
5901
  "pluginName": "sfdx-hardis",
5874
5902
  "pluginType": "core",
5875
5903
  "strict": true,
5876
5904
  "enableJsonFlag": true,
5877
- "title": "Check for legacy API use",
5905
+ "title": "Diagnose content of Setup Audit Trail",
5878
5906
  "requiresProject": false,
5879
5907
  "isESM": true,
5880
5908
  "relativePath": [
@@ -5883,42 +5911,42 @@
5883
5911
  "hardis",
5884
5912
  "org",
5885
5913
  "diagnose",
5886
- "legacyapi.js"
5914
+ "audittrail.js"
5887
5915
  ],
5888
5916
  "aliasPermutations": [],
5889
5917
  "permutations": [
5890
- "hardis:org:diagnose:legacyapi",
5891
- "org:hardis:diagnose:legacyapi",
5892
- "org:diagnose:hardis:legacyapi",
5893
- "org:diagnose:legacyapi:hardis",
5894
- "hardis:diagnose:org:legacyapi",
5895
- "diagnose:hardis:org:legacyapi",
5896
- "diagnose:org:hardis:legacyapi",
5897
- "diagnose:org:legacyapi:hardis",
5898
- "hardis:diagnose:legacyapi:org",
5899
- "diagnose:hardis:legacyapi:org",
5900
- "diagnose:legacyapi:hardis:org",
5901
- "diagnose:legacyapi:org:hardis",
5902
- "hardis:org:legacyapi:diagnose",
5903
- "org:hardis:legacyapi:diagnose",
5904
- "org:legacyapi:hardis:diagnose",
5905
- "org:legacyapi:diagnose:hardis",
5906
- "hardis:legacyapi:org:diagnose",
5907
- "legacyapi:hardis:org:diagnose",
5908
- "legacyapi:org:hardis:diagnose",
5909
- "legacyapi:org:diagnose:hardis",
5910
- "hardis:legacyapi:diagnose:org",
5911
- "legacyapi:hardis:diagnose:org",
5912
- "legacyapi:diagnose:hardis:org",
5913
- "legacyapi:diagnose:org:hardis"
5918
+ "hardis:org:diagnose:audittrail",
5919
+ "org:hardis:diagnose:audittrail",
5920
+ "org:diagnose:hardis:audittrail",
5921
+ "org:diagnose:audittrail:hardis",
5922
+ "hardis:diagnose:org:audittrail",
5923
+ "diagnose:hardis:org:audittrail",
5924
+ "diagnose:org:hardis:audittrail",
5925
+ "diagnose:org:audittrail:hardis",
5926
+ "hardis:diagnose:audittrail:org",
5927
+ "diagnose:hardis:audittrail:org",
5928
+ "diagnose:audittrail:hardis:org",
5929
+ "diagnose:audittrail:org:hardis",
5930
+ "hardis:org:audittrail:diagnose",
5931
+ "org:hardis:audittrail:diagnose",
5932
+ "org:audittrail:hardis:diagnose",
5933
+ "org:audittrail:diagnose:hardis",
5934
+ "hardis:audittrail:org:diagnose",
5935
+ "audittrail:hardis:org:diagnose",
5936
+ "audittrail:org:hardis:diagnose",
5937
+ "audittrail:org:diagnose:hardis",
5938
+ "hardis:audittrail:diagnose:org",
5939
+ "audittrail:hardis:diagnose:org",
5940
+ "audittrail:diagnose:hardis:org",
5941
+ "audittrail:diagnose:org:hardis"
5914
5942
  ]
5915
5943
  },
5916
- "hardis:org:diagnose:licenses": {
5944
+ "hardis:org:diagnose:instanceupgrade": {
5917
5945
  "aliases": [],
5918
5946
  "args": {},
5919
- "description": "\n**Lists and analyzes User Licenses and Permission Set Licenses subscribed and used in a Salesforce org.**\n\nThis command provides a comprehensive overview of your Salesforce license consumption. It's particularly useful for:\n\n- **License Management:** Understanding which licenses are active, how many are available, and how many are being used.\n- **Cost Optimization:** Identifying unused or underutilized licenses that could be reallocated or decommissioned.\n- **Compliance:** Ensuring that your organization is compliant with Salesforce licensing agreements.\n- **Monitoring:** Tracking license usage trends over time.\n\nKey functionalities:\n\n- **User License Details:** Retrieves information about standard and custom User Licenses, including `MasterLabel`, `Name`, `TotalLicenses`, and `UsedLicenses`.\n- **Permission Set License Details:** Retrieves information about Permission Set Licenses, including `MasterLabel`, `PermissionSetLicenseKey`, `TotalLicenses`, and `UsedLicenses`.\n- **Used Licenses Filter:** The `--usedonly` flag allows you to filter the report to show only licenses that have at least one `UsedLicenses` count greater than zero.\n- **CSV Report Generation:** Generates a CSV file containing all the retrieved license information, suitable for detailed analysis.\n- **Notifications:** Sends notifications to configured channels (e.g., Grafana, Slack, MS Teams) with a summary of license usage, including lists of active and used licenses.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Queries:** It executes SOQL queries against the `UserLicense` and `PermissionSetLicense` objects in Salesforce to retrieve license data.\n- **Data Transformation:** It processes the query results, reformatting the data to be more readable and consistent for reporting purposes (e.g., removing `Id` and `attributes`, renaming `PermissionSetLicenseKey` to `Name`).\n- **Data Aggregation:** It aggregates license information, creating a `licensesByKey` object for quick lookups and a `usedLicenses` array for a concise list of actively used licenses.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of license data.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **User Feedback:** Provides clear messages to the user about the license extraction process and the used licenses.\n</details>\n",
5947
+ "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",
5920
5948
  "examples": [
5921
- "$ sf hardis:org:diagnose:licenses"
5949
+ "$ sf hardis:org:diagnose:instanceupgrade"
5922
5950
  ],
5923
5951
  "flags": {
5924
5952
  "json": {
@@ -5936,21 +5964,6 @@
5936
5964
  "multiple": false,
5937
5965
  "type": "option"
5938
5966
  },
5939
- "outputfile": {
5940
- "char": "f",
5941
- "description": "Force the path and name of output report file. Must end with .csv",
5942
- "name": "outputfile",
5943
- "hasDynamicHelp": false,
5944
- "multiple": false,
5945
- "type": "option"
5946
- },
5947
- "usedonly": {
5948
- "char": "u",
5949
- "description": "Filter to have only used licenses",
5950
- "name": "usedonly",
5951
- "allowNo": false,
5952
- "type": "boolean"
5953
- },
5954
5967
  "debug": {
5955
5968
  "char": "d",
5956
5969
  "description": "Activate debug mode (more logs)",
@@ -5989,13 +6002,13 @@
5989
6002
  },
5990
6003
  "hasDynamicHelp": true,
5991
6004
  "hiddenAliases": [],
5992
- "id": "hardis:org:diagnose:licenses",
6005
+ "id": "hardis:org:diagnose:instanceupgrade",
5993
6006
  "pluginAlias": "sfdx-hardis",
5994
6007
  "pluginName": "sfdx-hardis",
5995
6008
  "pluginType": "core",
5996
6009
  "strict": true,
5997
6010
  "enableJsonFlag": true,
5998
- "title": "List licenses subscribed and used in a Salesforce org",
6011
+ "title": "Get Instance Upgrade date",
5999
6012
  "requiresProject": false,
6000
6013
  "isESM": true,
6001
6014
  "relativePath": [
@@ -6004,42 +6017,45 @@
6004
6017
  "hardis",
6005
6018
  "org",
6006
6019
  "diagnose",
6007
- "licenses.js"
6020
+ "instanceupgrade.js"
6008
6021
  ],
6009
6022
  "aliasPermutations": [],
6010
6023
  "permutations": [
6011
- "hardis:org:diagnose:licenses",
6012
- "org:hardis:diagnose:licenses",
6013
- "org:diagnose:hardis:licenses",
6014
- "org:diagnose:licenses:hardis",
6015
- "hardis:diagnose:org:licenses",
6016
- "diagnose:hardis:org:licenses",
6017
- "diagnose:org:hardis:licenses",
6018
- "diagnose:org:licenses:hardis",
6019
- "hardis:diagnose:licenses:org",
6020
- "diagnose:hardis:licenses:org",
6021
- "diagnose:licenses:hardis:org",
6022
- "diagnose:licenses:org:hardis",
6023
- "hardis:org:licenses:diagnose",
6024
- "org:hardis:licenses:diagnose",
6025
- "org:licenses:hardis:diagnose",
6026
- "org:licenses:diagnose:hardis",
6027
- "hardis:licenses:org:diagnose",
6028
- "licenses:hardis:org:diagnose",
6029
- "licenses:org:hardis:diagnose",
6030
- "licenses:org:diagnose:hardis",
6031
- "hardis:licenses:diagnose:org",
6032
- "licenses:hardis:diagnose:org",
6033
- "licenses:diagnose:hardis:org",
6034
- "licenses:diagnose:org:hardis"
6024
+ "hardis:org:diagnose:instanceupgrade",
6025
+ "org:hardis:diagnose:instanceupgrade",
6026
+ "org:diagnose:hardis:instanceupgrade",
6027
+ "org:diagnose:instanceupgrade:hardis",
6028
+ "hardis:diagnose:org:instanceupgrade",
6029
+ "diagnose:hardis:org:instanceupgrade",
6030
+ "diagnose:org:hardis:instanceupgrade",
6031
+ "diagnose:org:instanceupgrade:hardis",
6032
+ "hardis:diagnose:instanceupgrade:org",
6033
+ "diagnose:hardis:instanceupgrade:org",
6034
+ "diagnose:instanceupgrade:hardis:org",
6035
+ "diagnose:instanceupgrade:org:hardis",
6036
+ "hardis:org:instanceupgrade:diagnose",
6037
+ "org:hardis:instanceupgrade:diagnose",
6038
+ "org:instanceupgrade:hardis:diagnose",
6039
+ "org:instanceupgrade:diagnose:hardis",
6040
+ "hardis:instanceupgrade:org:diagnose",
6041
+ "instanceupgrade:hardis:org:diagnose",
6042
+ "instanceupgrade:org:hardis:diagnose",
6043
+ "instanceupgrade:org:diagnose:hardis",
6044
+ "hardis:instanceupgrade:diagnose:org",
6045
+ "instanceupgrade:hardis:diagnose:org",
6046
+ "instanceupgrade:diagnose:hardis:org",
6047
+ "instanceupgrade:diagnose:org:hardis"
6035
6048
  ]
6036
6049
  },
6037
- "hardis:org:diagnose:releaseupdates": {
6050
+ "hardis:org:diagnose:legacyapi": {
6038
6051
  "aliases": [],
6039
6052
  "args": {},
6040
- "description": "Export Release Updates into a CSV file with selected criteria, and highlight Release Updates that should be checked.\n\nBefore publishing **Breaking Changes** ❌, Salesforce announce them in the setup menu [**Release Updates**](https://help.salesforce.com/s/articleView?id=sf.release_updates.htm&type=5)\n\n⚠️ Some of them are very important, because if you don't make the related upgrades in time (ex: before Winter 25) , your production org can crash !\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-release-updates/) and can output Grafana, Slack and MsTeams Notifications.\n",
6053
+ "description": "Checks if an org uses retired or someday retired API version\n\n\nSee article below\n\n[![Handle Salesforce API versions Deprecation like a pro](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deprecated-api.jpg)](https://nicolas.vuillamy.fr/handle-salesforce-api-versions-deprecation-like-a-pro-335065f52238)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-deprecated-api-calls/) and can output Grafana, Slack and MsTeams Notifications.\n",
6041
6054
  "examples": [
6042
- "$ sf hardis:org:diagnose:releaseupdates"
6055
+ "$ sf hardis:org:diagnose:legacyapi",
6056
+ "$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com",
6057
+ "$ sf hardis:org:diagnose:legacyapi --outputfile 'c:/path/to/folder/legacyapi.csv'",
6058
+ "$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv"
6043
6059
  ],
6044
6060
  "flags": {
6045
6061
  "json": {
@@ -6057,6 +6073,24 @@
6057
6073
  "multiple": false,
6058
6074
  "type": "option"
6059
6075
  },
6076
+ "eventtype": {
6077
+ "char": "e",
6078
+ "description": "Type of EventLogFile event to analyze",
6079
+ "name": "eventtype",
6080
+ "default": "ApiTotalUsage",
6081
+ "hasDynamicHelp": false,
6082
+ "multiple": false,
6083
+ "type": "option"
6084
+ },
6085
+ "limit": {
6086
+ "char": "l",
6087
+ "description": "Number of latest EventLogFile events to analyze",
6088
+ "name": "limit",
6089
+ "default": 999,
6090
+ "hasDynamicHelp": false,
6091
+ "multiple": false,
6092
+ "type": "option"
6093
+ },
6060
6094
  "outputfile": {
6061
6095
  "char": "f",
6062
6096
  "description": "Force the path and name of output report file. Must end with .csv",
@@ -6103,13 +6137,13 @@
6103
6137
  },
6104
6138
  "hasDynamicHelp": true,
6105
6139
  "hiddenAliases": [],
6106
- "id": "hardis:org:diagnose:releaseupdates",
6140
+ "id": "hardis:org:diagnose:legacyapi",
6107
6141
  "pluginAlias": "sfdx-hardis",
6108
6142
  "pluginName": "sfdx-hardis",
6109
6143
  "pluginType": "core",
6110
6144
  "strict": true,
6111
6145
  "enableJsonFlag": true,
6112
- "title": "Check Release Updates of an org",
6146
+ "title": "Check for legacy API use",
6113
6147
  "requiresProject": false,
6114
6148
  "isESM": true,
6115
6149
  "relativePath": [
@@ -6118,47 +6152,42 @@
6118
6152
  "hardis",
6119
6153
  "org",
6120
6154
  "diagnose",
6121
- "releaseupdates.js"
6155
+ "legacyapi.js"
6122
6156
  ],
6123
6157
  "aliasPermutations": [],
6124
6158
  "permutations": [
6125
- "hardis:org:diagnose:releaseupdates",
6126
- "org:hardis:diagnose:releaseupdates",
6127
- "org:diagnose:hardis:releaseupdates",
6128
- "org:diagnose:releaseupdates:hardis",
6129
- "hardis:diagnose:org:releaseupdates",
6130
- "diagnose:hardis:org:releaseupdates",
6131
- "diagnose:org:hardis:releaseupdates",
6132
- "diagnose:org:releaseupdates:hardis",
6133
- "hardis:diagnose:releaseupdates:org",
6134
- "diagnose:hardis:releaseupdates:org",
6135
- "diagnose:releaseupdates:hardis:org",
6136
- "diagnose:releaseupdates:org:hardis",
6137
- "hardis:org:releaseupdates:diagnose",
6138
- "org:hardis:releaseupdates:diagnose",
6139
- "org:releaseupdates:hardis:diagnose",
6140
- "org:releaseupdates:diagnose:hardis",
6141
- "hardis:releaseupdates:org:diagnose",
6142
- "releaseupdates:hardis:org:diagnose",
6143
- "releaseupdates:org:hardis:diagnose",
6144
- "releaseupdates:org:diagnose:hardis",
6145
- "hardis:releaseupdates:diagnose:org",
6146
- "releaseupdates:hardis:diagnose:org",
6147
- "releaseupdates:diagnose:hardis:org",
6148
- "releaseupdates:diagnose:org:hardis"
6149
- ]
6150
- },
6151
- "hardis:org:diagnose:storage-stats": {
6152
- "aliases": [],
6153
- "args": {},
6154
- "description": "**Extracts and analyzes Data Storage usage for a Salesforce org, providing detailed per-object breakdowns with flexible grouping options.**\n\nThis command provides a comprehensive overview of your Salesforce data storage consumption. It's particularly useful for:\n\n- **Storage Management:** Understanding which SObjects consume the most storage and how usage has evolved over time.\n- **Cost Optimization:** Identifying storage-heavy objects that could be candidates for data archival or cleanup strategies.\n- **Capacity Planning:** Tracking storage trends to predict when additional capacity will be needed.\n- **Compliance & Governance:** Monitoring data growth patterns to ensure alignment with data retention policies.\n\nKey functionalities:\n\n- **Storage Limits Analysis:** Retrieves and displays org data storage limits, including total capacity, used storage, remaining storage, and percentage used. Detects and alerts on over-usage scenarios.\n- **SObject Discovery & Filtering:** Automatically discovers all SObjects in the org and filters them to focus on production/custom objects (excludes metadata types, platform-only objects, and cached empty objects).\n- **Interactive Selection:** Prompts the user to select which SObjects to analyze and choose breakdown fields (date fields, RecordType, custom fields, or relationship fields).\n- **Flexible Breakdown Field:** Supports grouping by any field including:\n - Date/DateTime fields (`CreatedDate`, `LastModifiedDate`, custom date fields)\n - RecordType (`RecordType.Name`)\n - Custom fields (`Status__c`, picklists, text fields)\n - Nested relationship fields (`SBQQ__Quote__r.RecordType.Name`)\n- **Date Granularity Options:** For date/datetime fields, choose between:\n - Year-based grouping (`CALENDAR_YEAR`)\n - Month-based grouping (`CALENDAR_MONTH`)\n - Day-based grouping (exact date)\n- **WHERE Clause Filtering:** Apply SOQL WHERE conditions to filter records before calculating storage (e.g., only active records, records from the last year).\n- **Storage Estimation:** Estimates storage usage for each object using an average record size heuristic (2 KB per record) and calculates the percentage of org quota consumed.\n- **Dual CSV Reports:** Generates two CSV files: a detailed breakdown by selected field and a totals-per-object summary, both suitable for spreadsheet analysis and reporting.\n- **Empty Objects Cache:** Maintains a per-user cache of objects detected with zero records to optimize subsequent runs by skipping empty tables.\n- **Progress Tracking:** Sends WebSocket progress messages for integration with external UIs and monitoring dashboards.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Limits Retrieval:** Calls `conn.limits()` to retrieve the `DataStorageMB` object containing `Max` and `Remaining` values. Handles negative `Remaining` values (over-usage scenarios) by calculating `overUsageMB` and adjusting display values.\n- **SObject Discovery:** Uses `conn.metadata.list([{ type: 'CustomObject' }])` to get custom objects and `conn.describeGlobal()` to get all SObjects. Filters by object capabilities (`layoutable`, `queryable`, `retrieveable`, `createable`, `updateable`, `deletable`) and excludes metadata types (`__mdt` suffix) and cached empty objects.\n- **User Interaction:** Uses `prompts` for interactive multi-select of SObjects, breakdown field selection, granularity choice (for date fields), and optional WHERE conditions. All objects are pre-selected by default for user convenience.\n- **Field Validation:** Recursively validates breakdown fields including nested relationships (e.g., `SBQQ__Quote__r.RecordType.Name`) by traversing the relationship chain and checking field existence on each related object. Automatically handles special cases like `RecordType` -> `RecordTypeId` and `__r` -> `__c` conversions.\n- **Dynamic Query Generation:** Builds SOQL queries based on field type and granularity:\n - For date fields with year granularity: `SELECT CALENDAR_YEAR(<Field>) breakdown, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY CALENDAR_YEAR(<Field>) ORDER BY CALENDAR_YEAR(<Field>)`\n - For date fields with month granularity: `SELECT CALENDAR_YEAR(<Field>) year, CALENDAR_MONTH(<Field>) month, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY CALENDAR_YEAR(<Field>), CALENDAR_MONTH(<Field>) ORDER BY CALENDAR_YEAR(<Field>), CALENDAR_MONTH(<Field>)`\n - For non-date fields: `SELECT <Field> breakdown, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY <Field> ORDER BY <Field>`\n- **WHERE Clause Support:** Accepts user-provided WHERE conditions via flag (`--where`) or interactive prompt. Injects the condition into all SOQL queries for consistent filtering across all objects.\n- **Storage Calculation:** Applies a conservative average record size of 2 KB (2048 bytes) to estimate storage consumption. Calculates both MB usage and percentage of org quota for each object and breakdown value.\n- **Report Generation:** Uses `generateCsvFile` and `generateReportPath` helpers to create two CSV files in the reports directory:\n - Detailed breakdown: includes all statistics per breakdown value per object (e.g., by year, by month, by RecordType)\n - Totals summary: includes only aggregate totals per object\n - File naming includes breakdown field, granularity (for date fields), and `-filtered` suffix when WHERE clause is applied\n- **Caching Mechanism:** Writes a JSON cache file per authenticated username (sanitized) in the reports directory (`<username>_empty_tables_cache.json`) containing an array of empty object names. The cache is updated after each run with newly detected empty objects.\n- **Progress & UX:** Uses `WebSocketClient` to emit start/step/end progress messages for external monitoring. Outputs summary tables with `uxLogTable` and status messages with `uxLog`.\n- **Return Value:** Returns a JSON object containing `tableStorageInfos` (all rows), `tableStorageInfosTotals` (summary rows), `storageLimits` (org limits object), and `outputFiles` (paths to generated CSV/XLSX reports).\n</details>\n\n![](https://sfdx-hardis.cloudity.com/assets/images/storage-usage-year-breakdown.png)\n\n![](https://sfdx-hardis.cloudity.com/assets/images/storage-usage-total.png)\n",
6155
- "examples": [
6156
- "$ sf hardis:org:diagnose:storage-stats",
6157
- "$ sf hardis:org:diagnose:storage-stats --breakdown-field \"CreatedDate\"",
6158
- "$ sf hardis:org:diagnose:storage-stats -b \"RecordType.Name\"",
6159
- "$ sf hardis:org:diagnose:storage-stats --where \"CreatedDate = LAST_N_DAYS:365\"",
6160
- "$ sf hardis:org:diagnose:storage-stats -w \"Status__c = 'Active'\"",
6161
- "$ sf hardis:org:diagnose:storage-stats -b \"LastModifiedDate\" -w \"IsDeleted = false\""
6159
+ "hardis:org:diagnose:legacyapi",
6160
+ "org:hardis:diagnose:legacyapi",
6161
+ "org:diagnose:hardis:legacyapi",
6162
+ "org:diagnose:legacyapi:hardis",
6163
+ "hardis:diagnose:org:legacyapi",
6164
+ "diagnose:hardis:org:legacyapi",
6165
+ "diagnose:org:hardis:legacyapi",
6166
+ "diagnose:org:legacyapi:hardis",
6167
+ "hardis:diagnose:legacyapi:org",
6168
+ "diagnose:hardis:legacyapi:org",
6169
+ "diagnose:legacyapi:hardis:org",
6170
+ "diagnose:legacyapi:org:hardis",
6171
+ "hardis:org:legacyapi:diagnose",
6172
+ "org:hardis:legacyapi:diagnose",
6173
+ "org:legacyapi:hardis:diagnose",
6174
+ "org:legacyapi:diagnose:hardis",
6175
+ "hardis:legacyapi:org:diagnose",
6176
+ "legacyapi:hardis:org:diagnose",
6177
+ "legacyapi:org:hardis:diagnose",
6178
+ "legacyapi:org:diagnose:hardis",
6179
+ "hardis:legacyapi:diagnose:org",
6180
+ "legacyapi:hardis:diagnose:org",
6181
+ "legacyapi:diagnose:hardis:org",
6182
+ "legacyapi:diagnose:org:hardis"
6183
+ ]
6184
+ },
6185
+ "hardis:org:diagnose:licenses": {
6186
+ "aliases": [],
6187
+ "args": {},
6188
+ "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",
6189
+ "examples": [
6190
+ "$ sf hardis:org:diagnose:licenses"
6162
6191
  ],
6163
6192
  "flags": {
6164
6193
  "json": {
@@ -6184,21 +6213,12 @@
6184
6213
  "multiple": false,
6185
6214
  "type": "option"
6186
6215
  },
6187
- "breakdown-field": {
6188
- "char": "b",
6189
- "description": "Field to use for storage stats breakdown. Example: \"CreatedDate\", \"LastModifiedDate\", \"RecordType.Name\", or custom fields like \"Status__c\"",
6190
- "name": "breakdown-field",
6191
- "hasDynamicHelp": false,
6192
- "multiple": false,
6193
- "type": "option"
6194
- },
6195
- "where": {
6196
- "char": "w",
6197
- "description": "WHERE clause to filter records in the query (without the WHERE keyword). Example: \"CreatedDate = LAST_N_DAYS:365\" or \"Status__c = 'Active'\"",
6198
- "name": "where",
6199
- "hasDynamicHelp": false,
6200
- "multiple": false,
6201
- "type": "option"
6216
+ "usedonly": {
6217
+ "char": "u",
6218
+ "description": "Filter to have only used licenses",
6219
+ "name": "usedonly",
6220
+ "allowNo": false,
6221
+ "type": "boolean"
6202
6222
  },
6203
6223
  "debug": {
6204
6224
  "char": "d",
@@ -6238,14 +6258,14 @@
6238
6258
  },
6239
6259
  "hasDynamicHelp": true,
6240
6260
  "hiddenAliases": [],
6241
- "id": "hardis:org:diagnose:storage-stats",
6261
+ "id": "hardis:org:diagnose:licenses",
6242
6262
  "pluginAlias": "sfdx-hardis",
6243
6263
  "pluginName": "sfdx-hardis",
6244
6264
  "pluginType": "core",
6245
6265
  "strict": true,
6246
6266
  "enableJsonFlag": true,
6247
- "title": "Extract Data Storage stats",
6248
- "requiresProject": true,
6267
+ "title": "List licenses subscribed and used in a Salesforce org",
6268
+ "requiresProject": false,
6249
6269
  "isESM": true,
6250
6270
  "relativePath": [
6251
6271
  "lib",
@@ -6253,42 +6273,42 @@
6253
6273
  "hardis",
6254
6274
  "org",
6255
6275
  "diagnose",
6256
- "storage-stats.js"
6276
+ "licenses.js"
6257
6277
  ],
6258
6278
  "aliasPermutations": [],
6259
6279
  "permutations": [
6260
- "hardis:org:diagnose:storage-stats",
6261
- "org:hardis:diagnose:storage-stats",
6262
- "org:diagnose:hardis:storage-stats",
6263
- "org:diagnose:storage-stats:hardis",
6264
- "hardis:diagnose:org:storage-stats",
6265
- "diagnose:hardis:org:storage-stats",
6266
- "diagnose:org:hardis:storage-stats",
6267
- "diagnose:org:storage-stats:hardis",
6268
- "hardis:diagnose:storage-stats:org",
6269
- "diagnose:hardis:storage-stats:org",
6270
- "diagnose:storage-stats:hardis:org",
6271
- "diagnose:storage-stats:org:hardis",
6272
- "hardis:org:storage-stats:diagnose",
6273
- "org:hardis:storage-stats:diagnose",
6274
- "org:storage-stats:hardis:diagnose",
6275
- "org:storage-stats:diagnose:hardis",
6276
- "hardis:storage-stats:org:diagnose",
6277
- "storage-stats:hardis:org:diagnose",
6278
- "storage-stats:org:hardis:diagnose",
6279
- "storage-stats:org:diagnose:hardis",
6280
- "hardis:storage-stats:diagnose:org",
6281
- "storage-stats:hardis:diagnose:org",
6282
- "storage-stats:diagnose:hardis:org",
6283
- "storage-stats:diagnose:org:hardis"
6280
+ "hardis:org:diagnose:licenses",
6281
+ "org:hardis:diagnose:licenses",
6282
+ "org:diagnose:hardis:licenses",
6283
+ "org:diagnose:licenses:hardis",
6284
+ "hardis:diagnose:org:licenses",
6285
+ "diagnose:hardis:org:licenses",
6286
+ "diagnose:org:hardis:licenses",
6287
+ "diagnose:org:licenses:hardis",
6288
+ "hardis:diagnose:licenses:org",
6289
+ "diagnose:hardis:licenses:org",
6290
+ "diagnose:licenses:hardis:org",
6291
+ "diagnose:licenses:org:hardis",
6292
+ "hardis:org:licenses:diagnose",
6293
+ "org:hardis:licenses:diagnose",
6294
+ "org:licenses:hardis:diagnose",
6295
+ "org:licenses:diagnose:hardis",
6296
+ "hardis:licenses:org:diagnose",
6297
+ "licenses:hardis:org:diagnose",
6298
+ "licenses:org:hardis:diagnose",
6299
+ "licenses:org:diagnose:hardis",
6300
+ "hardis:licenses:diagnose:org",
6301
+ "licenses:hardis:diagnose:org",
6302
+ "licenses:diagnose:hardis:org",
6303
+ "licenses:diagnose:org:hardis"
6284
6304
  ]
6285
6305
  },
6286
- "hardis:org:diagnose:unsecure-connected-apps": {
6306
+ "hardis:org:diagnose:releaseupdates": {
6287
6307
  "aliases": [],
6288
6308
  "args": {},
6289
- "description": "\n## Command Behavior\n\n**Detects unsecured Connected Apps in a Salesforce org and generates detailed reports for security analysis.**\n\nThis command is a critical security diagnostic tool that helps administrators identify Connected Apps that may pose security risks due to improper configuration. It provides comprehensive analysis of OAuth tokens and Connected App security settings to ensure proper access control.\n\nKey functionalities:\n\n- **OAuth Token Analysis:** Queries all OAuth tokens in the org using SOQL to retrieve comprehensive token information including app names, users, authorization status, and usage statistics.\n- **Security Status Assessment:** Evaluates each Connected App's security configuration by checking the `IsUsingAdminAuthorization` flag to determine if admin pre-approval is required.\n- **Unsecured App Detection:** Identifies Connected Apps that allow users to authorize themselves without admin approval, which can pose security risks.\n- **Detailed Reporting:** Generates two comprehensive CSV reports:\n - **OAuth Tokens Report:** Lists all OAuth tokens with security status, user information, and usage data\n - **Connected Apps Summary:** Aggregates unsecured Connected Apps with counts of associated OAuth tokens\n- **Visual Indicators:** Uses status icons ( for unsecured, ✅ for secured) to provide immediate visual feedback on security status.\n- **Security Recommendations:** Provides actionable guidance on how to secure Connected Apps through proper configuration.\n- **Notifications:** Sends alerts to configured channels (Grafana, Slack, MS Teams) with security findings and attached reports.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-org-security/) and can output Grafana, Slack and MsTeams Notifications.\n\n<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/jHv8yrSK8Dg\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Query Execution:** Executes a comprehensive SOQL query on the `OauthToken` object, joining with `AppMenuItem` and `User` objects to gather complete security context.\n- **Security Analysis Logic:** Analyzes the `AppMenuItem.IsUsingAdminAuthorization` field to determine if a Connected App requires admin pre-approval for user authorization.\n- **Data Transformation:** Processes raw SOQL results to add security status indicators and reorganize data for optimal reporting and analysis.\n- **Aggregation Processing:** Groups OAuth tokens by Connected App name to provide summary statistics and identify the most problematic applications.\n- **Report Generation:** Uses `generateCsvFile` to create structured CSV reports with proper formatting and metadata for easy analysis and sharing.\n- **Notification Integration:** Integrates with the `NotifProvider` to send security alerts with detailed metrics, including the number of unsecured Connected Apps and associated OAuth tokens.\n- **File Management:** Generates multiple output formats (CSV, XLSX) and manages file paths using `generateReportPath` for consistent report organization.\n- **Connection Management:** Uses `setConnectionVariables` to ensure proper authentication context for notification providers that require org connection details.\n</details>\n",
6309
+ "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",
6290
6310
  "examples": [
6291
- "$ sf hardis:org:diagnose:unsecure-connected-apps"
6311
+ "$ sf hardis:org:diagnose:releaseupdates"
6292
6312
  ],
6293
6313
  "flags": {
6294
6314
  "json": {
@@ -6352,13 +6372,13 @@
6352
6372
  },
6353
6373
  "hasDynamicHelp": true,
6354
6374
  "hiddenAliases": [],
6355
- "id": "hardis:org:diagnose:unsecure-connected-apps",
6375
+ "id": "hardis:org:diagnose:releaseupdates",
6356
6376
  "pluginAlias": "sfdx-hardis",
6357
6377
  "pluginName": "sfdx-hardis",
6358
6378
  "pluginType": "core",
6359
6379
  "strict": true,
6360
6380
  "enableJsonFlag": true,
6361
- "title": "Detect Unsecured Connected Apps",
6381
+ "title": "Check Release Updates of an org",
6362
6382
  "requiresProject": false,
6363
6383
  "isESM": true,
6364
6384
  "relativePath": [
@@ -6367,43 +6387,47 @@
6367
6387
  "hardis",
6368
6388
  "org",
6369
6389
  "diagnose",
6370
- "unsecure-connected-apps.js"
6390
+ "releaseupdates.js"
6371
6391
  ],
6372
6392
  "aliasPermutations": [],
6373
6393
  "permutations": [
6374
- "hardis:org:diagnose:unsecure-connected-apps",
6375
- "org:hardis:diagnose:unsecure-connected-apps",
6376
- "org:diagnose:hardis:unsecure-connected-apps",
6377
- "org:diagnose:unsecure-connected-apps:hardis",
6378
- "hardis:diagnose:org:unsecure-connected-apps",
6379
- "diagnose:hardis:org:unsecure-connected-apps",
6380
- "diagnose:org:hardis:unsecure-connected-apps",
6381
- "diagnose:org:unsecure-connected-apps:hardis",
6382
- "hardis:diagnose:unsecure-connected-apps:org",
6383
- "diagnose:hardis:unsecure-connected-apps:org",
6384
- "diagnose:unsecure-connected-apps:hardis:org",
6385
- "diagnose:unsecure-connected-apps:org:hardis",
6386
- "hardis:org:unsecure-connected-apps:diagnose",
6387
- "org:hardis:unsecure-connected-apps:diagnose",
6388
- "org:unsecure-connected-apps:hardis:diagnose",
6389
- "org:unsecure-connected-apps:diagnose:hardis",
6390
- "hardis:unsecure-connected-apps:org:diagnose",
6391
- "unsecure-connected-apps:hardis:org:diagnose",
6392
- "unsecure-connected-apps:org:hardis:diagnose",
6393
- "unsecure-connected-apps:org:diagnose:hardis",
6394
- "hardis:unsecure-connected-apps:diagnose:org",
6395
- "unsecure-connected-apps:hardis:diagnose:org",
6396
- "unsecure-connected-apps:diagnose:hardis:org",
6397
- "unsecure-connected-apps:diagnose:org:hardis"
6394
+ "hardis:org:diagnose:releaseupdates",
6395
+ "org:hardis:diagnose:releaseupdates",
6396
+ "org:diagnose:hardis:releaseupdates",
6397
+ "org:diagnose:releaseupdates:hardis",
6398
+ "hardis:diagnose:org:releaseupdates",
6399
+ "diagnose:hardis:org:releaseupdates",
6400
+ "diagnose:org:hardis:releaseupdates",
6401
+ "diagnose:org:releaseupdates:hardis",
6402
+ "hardis:diagnose:releaseupdates:org",
6403
+ "diagnose:hardis:releaseupdates:org",
6404
+ "diagnose:releaseupdates:hardis:org",
6405
+ "diagnose:releaseupdates:org:hardis",
6406
+ "hardis:org:releaseupdates:diagnose",
6407
+ "org:hardis:releaseupdates:diagnose",
6408
+ "org:releaseupdates:hardis:diagnose",
6409
+ "org:releaseupdates:diagnose:hardis",
6410
+ "hardis:releaseupdates:org:diagnose",
6411
+ "releaseupdates:hardis:org:diagnose",
6412
+ "releaseupdates:org:hardis:diagnose",
6413
+ "releaseupdates:org:diagnose:hardis",
6414
+ "hardis:releaseupdates:diagnose:org",
6415
+ "releaseupdates:hardis:diagnose:org",
6416
+ "releaseupdates:diagnose:hardis:org",
6417
+ "releaseupdates:diagnose:org:hardis"
6398
6418
  ]
6399
6419
  },
6400
- "hardis:org:diagnose:unused-apex-classes": {
6420
+ "hardis:org:diagnose:storage-stats": {
6401
6421
  "aliases": [],
6402
6422
  "args": {},
6403
- "description": "List all async Apex classes (Batch,Queueable,Schedulable) that has not been called for more than 365 days.\n \nThe result class list probably can be removed from the project, and that will improve your test classes performances 😊\n\nThe number of unused day is overridable using --days option. \n\nThe command uses queries on AsyncApexJob and CronTrigger technical tables to build the result.\n\nApex Classes CreatedBy and CreatedOn fields are calculated from MIN(date from git, date from org)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-apex-classes/) and can output Grafana, Slack and MsTeams Notifications.\n\n![](https://sfdx-hardis.cloudity.com/assets/images/screenshot-monitoring-unused-apex-grafana.jpg)\n",
6423
+ "description": "**Extracts and analyzes Data Storage usage for a Salesforce org, providing detailed per-object breakdowns with flexible grouping options.**\n\nThis command provides a comprehensive overview of your Salesforce data storage consumption. It's particularly useful for:\n\n- **Storage Management:** Understanding which SObjects consume the most storage and how usage has evolved over time.\n- **Cost Optimization:** Identifying storage-heavy objects that could be candidates for data archival or cleanup strategies.\n- **Capacity Planning:** Tracking storage trends to predict when additional capacity will be needed.\n- **Compliance & Governance:** Monitoring data growth patterns to ensure alignment with data retention policies.\n\nKey functionalities:\n\n- **Storage Limits Analysis:** Retrieves and displays org data storage limits, including total capacity, used storage, remaining storage, and percentage used. Detects and alerts on over-usage scenarios.\n- **SObject Discovery & Filtering:** Automatically discovers all SObjects in the org and filters them to focus on production/custom objects (excludes metadata types, platform-only objects, and cached empty objects).\n- **Interactive Selection:** Prompts the user to select which SObjects to analyze and choose breakdown fields (date fields, RecordType, custom fields, or relationship fields).\n- **Flexible Breakdown Field:** Supports grouping by any field including:\n - Date/DateTime fields (`CreatedDate`, `LastModifiedDate`, custom date fields)\n - RecordType (`RecordType.Name`)\n - Custom fields (`Status__c`, picklists, text fields)\n - Nested relationship fields (`SBQQ__Quote__r.RecordType.Name`)\n- **Date Granularity Options:** For date/datetime fields, choose between:\n - Year-based grouping (`CALENDAR_YEAR`)\n - Month-based grouping (`CALENDAR_MONTH`)\n - Day-based grouping (exact date)\n- **WHERE Clause Filtering:** Apply SOQL WHERE conditions to filter records before calculating storage (e.g., only active records, records from the last year).\n- **Storage Estimation:** Estimates storage usage for each object using an average record size heuristic (2 KB per record) and calculates the percentage of org quota consumed.\n- **Dual CSV Reports:** Generates two CSV files: a detailed breakdown by selected field and a totals-per-object summary, both suitable for spreadsheet analysis and reporting.\n- **Empty Objects Cache:** Maintains a per-user cache of objects detected with zero records to optimize subsequent runs by skipping empty tables.\n- **Progress Tracking:** Sends WebSocket progress messages for integration with external UIs and monitoring dashboards.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Limits Retrieval:** Calls `conn.limits()` to retrieve the `DataStorageMB` object containing `Max` and `Remaining` values. Handles negative `Remaining` values (over-usage scenarios) by calculating `overUsageMB` and adjusting display values.\n- **SObject Discovery:** Uses `conn.metadata.list([{ type: 'CustomObject' }])` to get custom objects and `conn.describeGlobal()` to get all SObjects. Filters by object capabilities (`layoutable`, `queryable`, `retrieveable`, `createable`, `updateable`, `deletable`) and excludes metadata types (`__mdt` suffix) and cached empty objects.\n- **User Interaction:** Uses `prompts` for interactive multi-select of SObjects, breakdown field selection, granularity choice (for date fields), and optional WHERE conditions. All objects are pre-selected by default for user convenience.\n- **Field Validation:** Recursively validates breakdown fields including nested relationships (e.g., `SBQQ__Quote__r.RecordType.Name`) by traversing the relationship chain and checking field existence on each related object. Automatically handles special cases like `RecordType` -> `RecordTypeId` and `__r` -> `__c` conversions.\n- **Dynamic Query Generation:** Builds SOQL queries based on field type and granularity:\n - For date fields with year granularity: `SELECT CALENDAR_YEAR(<Field>) breakdown, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY CALENDAR_YEAR(<Field>) ORDER BY CALENDAR_YEAR(<Field>)`\n - For date fields with month granularity: `SELECT CALENDAR_YEAR(<Field>) year, CALENDAR_MONTH(<Field>) month, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY CALENDAR_YEAR(<Field>), CALENDAR_MONTH(<Field>) ORDER BY CALENDAR_YEAR(<Field>), CALENDAR_MONTH(<Field>)`\n - For non-date fields: `SELECT <Field> breakdown, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY <Field> ORDER BY <Field>`\n- **WHERE Clause Support:** Accepts user-provided WHERE conditions via flag (`--where`) or interactive prompt. Injects the condition into all SOQL queries for consistent filtering across all objects.\n- **Storage Calculation:** Applies a conservative average record size of 2 KB (2048 bytes) to estimate storage consumption. Calculates both MB usage and percentage of org quota for each object and breakdown value.\n- **Report Generation:** Uses `generateCsvFile` and `generateReportPath` helpers to create two CSV files in the reports directory:\n - Detailed breakdown: includes all statistics per breakdown value per object (e.g., by year, by month, by RecordType)\n - Totals summary: includes only aggregate totals per object\n - File naming includes breakdown field, granularity (for date fields), and `-filtered` suffix when WHERE clause is applied\n- **Caching Mechanism:** Writes a JSON cache file per authenticated username (sanitized) in the reports directory (`<username>_empty_tables_cache.json`) containing an array of empty object names. The cache is updated after each run with newly detected empty objects.\n- **Progress & UX:** Uses `WebSocketClient` to emit start/step/end progress messages for external monitoring. Outputs summary tables with `uxLogTable` and status messages with `uxLog`.\n- **Return Value:** Returns a JSON object containing `tableStorageInfos` (all rows), `tableStorageInfosTotals` (summary rows), `storageLimits` (org limits object), and `outputFiles` (paths to generated CSV/XLSX reports).\n</details>\n\n![](https://sfdx-hardis.cloudity.com/assets/images/storage-usage-year-breakdown.png)\n\n![](https://sfdx-hardis.cloudity.com/assets/images/storage-usage-total.png)\n",
6404
6424
  "examples": [
6405
- "$ sf hardis:org:diagnose:unused-apex-classes",
6406
- "$ sf hardis:org:diagnose:unused-apex-classes --days 700"
6425
+ "$ sf hardis:org:diagnose:storage-stats",
6426
+ "$ sf hardis:org:diagnose:storage-stats --breakdown-field \"CreatedDate\"",
6427
+ "$ sf hardis:org:diagnose:storage-stats -b \"RecordType.Name\"",
6428
+ "$ sf hardis:org:diagnose:storage-stats --where \"CreatedDate = LAST_N_DAYS:365\"",
6429
+ "$ sf hardis:org:diagnose:storage-stats -w \"Status__c = 'Active'\"",
6430
+ "$ sf hardis:org:diagnose:storage-stats -b \"LastModifiedDate\" -w \"IsDeleted = false\""
6407
6431
  ],
6408
6432
  "flags": {
6409
6433
  "json": {
@@ -6429,10 +6453,18 @@
6429
6453
  "multiple": false,
6430
6454
  "type": "option"
6431
6455
  },
6432
- "days": {
6433
- "char": "t",
6434
- "description": "Extracts the users that have been inactive for the amount of days specified. In CI, default is 180 days",
6435
- "name": "days",
6456
+ "breakdown-field": {
6457
+ "char": "b",
6458
+ "description": "Field to use for storage stats breakdown. Example: \"CreatedDate\", \"LastModifiedDate\", \"RecordType.Name\", or custom fields like \"Status__c\"",
6459
+ "name": "breakdown-field",
6460
+ "hasDynamicHelp": false,
6461
+ "multiple": false,
6462
+ "type": "option"
6463
+ },
6464
+ "where": {
6465
+ "char": "w",
6466
+ "description": "WHERE clause to filter records in the query (without the WHERE keyword). Example: \"CreatedDate = LAST_N_DAYS:365\" or \"Status__c = 'Active'\"",
6467
+ "name": "where",
6436
6468
  "hasDynamicHelp": false,
6437
6469
  "multiple": false,
6438
6470
  "type": "option"
@@ -6475,14 +6507,14 @@
6475
6507
  },
6476
6508
  "hasDynamicHelp": true,
6477
6509
  "hiddenAliases": [],
6478
- "id": "hardis:org:diagnose:unused-apex-classes",
6510
+ "id": "hardis:org:diagnose:storage-stats",
6479
6511
  "pluginAlias": "sfdx-hardis",
6480
6512
  "pluginName": "sfdx-hardis",
6481
6513
  "pluginType": "core",
6482
6514
  "strict": true,
6483
6515
  "enableJsonFlag": true,
6484
- "title": "Detect unused Apex classes in an org",
6485
- "requiresProject": false,
6516
+ "title": "Extract Data Storage stats",
6517
+ "requiresProject": true,
6486
6518
  "isESM": true,
6487
6519
  "relativePath": [
6488
6520
  "lib",
@@ -6490,37 +6522,274 @@
6490
6522
  "hardis",
6491
6523
  "org",
6492
6524
  "diagnose",
6493
- "unused-apex-classes.js"
6525
+ "storage-stats.js"
6494
6526
  ],
6495
6527
  "aliasPermutations": [],
6496
6528
  "permutations": [
6497
- "hardis:org:diagnose:unused-apex-classes",
6498
- "org:hardis:diagnose:unused-apex-classes",
6499
- "org:diagnose:hardis:unused-apex-classes",
6500
- "org:diagnose:unused-apex-classes:hardis",
6501
- "hardis:diagnose:org:unused-apex-classes",
6502
- "diagnose:hardis:org:unused-apex-classes",
6503
- "diagnose:org:hardis:unused-apex-classes",
6504
- "diagnose:org:unused-apex-classes:hardis",
6505
- "hardis:diagnose:unused-apex-classes:org",
6506
- "diagnose:hardis:unused-apex-classes:org",
6507
- "diagnose:unused-apex-classes:hardis:org",
6508
- "diagnose:unused-apex-classes:org:hardis",
6509
- "hardis:org:unused-apex-classes:diagnose",
6510
- "org:hardis:unused-apex-classes:diagnose",
6511
- "org:unused-apex-classes:hardis:diagnose",
6512
- "org:unused-apex-classes:diagnose:hardis",
6513
- "hardis:unused-apex-classes:org:diagnose",
6514
- "unused-apex-classes:hardis:org:diagnose",
6515
- "unused-apex-classes:org:hardis:diagnose",
6516
- "unused-apex-classes:org:diagnose:hardis",
6517
- "hardis:unused-apex-classes:diagnose:org",
6518
- "unused-apex-classes:hardis:diagnose:org",
6519
- "unused-apex-classes:diagnose:hardis:org",
6520
- "unused-apex-classes:diagnose:org:hardis"
6529
+ "hardis:org:diagnose:storage-stats",
6530
+ "org:hardis:diagnose:storage-stats",
6531
+ "org:diagnose:hardis:storage-stats",
6532
+ "org:diagnose:storage-stats:hardis",
6533
+ "hardis:diagnose:org:storage-stats",
6534
+ "diagnose:hardis:org:storage-stats",
6535
+ "diagnose:org:hardis:storage-stats",
6536
+ "diagnose:org:storage-stats:hardis",
6537
+ "hardis:diagnose:storage-stats:org",
6538
+ "diagnose:hardis:storage-stats:org",
6539
+ "diagnose:storage-stats:hardis:org",
6540
+ "diagnose:storage-stats:org:hardis",
6541
+ "hardis:org:storage-stats:diagnose",
6542
+ "org:hardis:storage-stats:diagnose",
6543
+ "org:storage-stats:hardis:diagnose",
6544
+ "org:storage-stats:diagnose:hardis",
6545
+ "hardis:storage-stats:org:diagnose",
6546
+ "storage-stats:hardis:org:diagnose",
6547
+ "storage-stats:org:hardis:diagnose",
6548
+ "storage-stats:org:diagnose:hardis",
6549
+ "hardis:storage-stats:diagnose:org",
6550
+ "storage-stats:hardis:diagnose:org",
6551
+ "storage-stats:diagnose:hardis:org",
6552
+ "storage-stats:diagnose:org:hardis"
6521
6553
  ]
6522
6554
  },
6523
- "hardis:org:diagnose:unused-connected-apps": {
6555
+ "hardis:org:diagnose:unsecure-connected-apps": {
6556
+ "aliases": [],
6557
+ "args": {},
6558
+ "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",
6559
+ "examples": [
6560
+ "$ sf hardis:org:diagnose:unsecure-connected-apps"
6561
+ ],
6562
+ "flags": {
6563
+ "json": {
6564
+ "description": "Format output as json.",
6565
+ "helpGroup": "GLOBAL",
6566
+ "name": "json",
6567
+ "allowNo": false,
6568
+ "type": "boolean"
6569
+ },
6570
+ "flags-dir": {
6571
+ "helpGroup": "GLOBAL",
6572
+ "name": "flags-dir",
6573
+ "summary": "Import flag values from a directory.",
6574
+ "hasDynamicHelp": false,
6575
+ "multiple": false,
6576
+ "type": "option"
6577
+ },
6578
+ "outputfile": {
6579
+ "char": "f",
6580
+ "description": "Force the path and name of output report file. Must end with .csv",
6581
+ "name": "outputfile",
6582
+ "hasDynamicHelp": false,
6583
+ "multiple": false,
6584
+ "type": "option"
6585
+ },
6586
+ "debug": {
6587
+ "char": "d",
6588
+ "description": "Activate debug mode (more logs)",
6589
+ "name": "debug",
6590
+ "allowNo": false,
6591
+ "type": "boolean"
6592
+ },
6593
+ "websocket": {
6594
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
6595
+ "name": "websocket",
6596
+ "hasDynamicHelp": false,
6597
+ "multiple": false,
6598
+ "type": "option"
6599
+ },
6600
+ "skipauth": {
6601
+ "description": "Skip authentication check when a default username is required",
6602
+ "name": "skipauth",
6603
+ "allowNo": false,
6604
+ "type": "boolean"
6605
+ },
6606
+ "target-org": {
6607
+ "aliases": [
6608
+ "targetusername",
6609
+ "u"
6610
+ ],
6611
+ "char": "o",
6612
+ "deprecateAliases": true,
6613
+ "name": "target-org",
6614
+ "noCacheDefault": true,
6615
+ "required": true,
6616
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
6617
+ "hasDynamicHelp": true,
6618
+ "multiple": false,
6619
+ "type": "option"
6620
+ }
6621
+ },
6622
+ "hasDynamicHelp": true,
6623
+ "hiddenAliases": [],
6624
+ "id": "hardis:org:diagnose:unsecure-connected-apps",
6625
+ "pluginAlias": "sfdx-hardis",
6626
+ "pluginName": "sfdx-hardis",
6627
+ "pluginType": "core",
6628
+ "strict": true,
6629
+ "enableJsonFlag": true,
6630
+ "title": "Detect Unsecured Connected Apps",
6631
+ "requiresProject": false,
6632
+ "isESM": true,
6633
+ "relativePath": [
6634
+ "lib",
6635
+ "commands",
6636
+ "hardis",
6637
+ "org",
6638
+ "diagnose",
6639
+ "unsecure-connected-apps.js"
6640
+ ],
6641
+ "aliasPermutations": [],
6642
+ "permutations": [
6643
+ "hardis:org:diagnose:unsecure-connected-apps",
6644
+ "org:hardis:diagnose:unsecure-connected-apps",
6645
+ "org:diagnose:hardis:unsecure-connected-apps",
6646
+ "org:diagnose:unsecure-connected-apps:hardis",
6647
+ "hardis:diagnose:org:unsecure-connected-apps",
6648
+ "diagnose:hardis:org:unsecure-connected-apps",
6649
+ "diagnose:org:hardis:unsecure-connected-apps",
6650
+ "diagnose:org:unsecure-connected-apps:hardis",
6651
+ "hardis:diagnose:unsecure-connected-apps:org",
6652
+ "diagnose:hardis:unsecure-connected-apps:org",
6653
+ "diagnose:unsecure-connected-apps:hardis:org",
6654
+ "diagnose:unsecure-connected-apps:org:hardis",
6655
+ "hardis:org:unsecure-connected-apps:diagnose",
6656
+ "org:hardis:unsecure-connected-apps:diagnose",
6657
+ "org:unsecure-connected-apps:hardis:diagnose",
6658
+ "org:unsecure-connected-apps:diagnose:hardis",
6659
+ "hardis:unsecure-connected-apps:org:diagnose",
6660
+ "unsecure-connected-apps:hardis:org:diagnose",
6661
+ "unsecure-connected-apps:org:hardis:diagnose",
6662
+ "unsecure-connected-apps:org:diagnose:hardis",
6663
+ "hardis:unsecure-connected-apps:diagnose:org",
6664
+ "unsecure-connected-apps:hardis:diagnose:org",
6665
+ "unsecure-connected-apps:diagnose:hardis:org",
6666
+ "unsecure-connected-apps:diagnose:org:hardis"
6667
+ ]
6668
+ },
6669
+ "hardis:org:diagnose:unused-apex-classes": {
6670
+ "aliases": [],
6671
+ "args": {},
6672
+ "description": "List all async Apex classes (Batch,Queueable,Schedulable) that has not been called for more than 365 days.\n \nThe result class list probably can be removed from the project, and that will improve your test classes performances 😊\n\nThe number of unused day is overridable using --days option. \n\nThe command uses queries on AsyncApexJob and CronTrigger technical tables to build the result.\n\nApex Classes CreatedBy and CreatedOn fields are calculated from MIN(date from git, date from org)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-apex-classes/) and can output Grafana, Slack and MsTeams Notifications.\n\n![](https://sfdx-hardis.cloudity.com/assets/images/screenshot-monitoring-unused-apex-grafana.jpg)\n",
6673
+ "examples": [
6674
+ "$ sf hardis:org:diagnose:unused-apex-classes",
6675
+ "$ sf hardis:org:diagnose:unused-apex-classes --days 700"
6676
+ ],
6677
+ "flags": {
6678
+ "json": {
6679
+ "description": "Format output as json.",
6680
+ "helpGroup": "GLOBAL",
6681
+ "name": "json",
6682
+ "allowNo": false,
6683
+ "type": "boolean"
6684
+ },
6685
+ "flags-dir": {
6686
+ "helpGroup": "GLOBAL",
6687
+ "name": "flags-dir",
6688
+ "summary": "Import flag values from a directory.",
6689
+ "hasDynamicHelp": false,
6690
+ "multiple": false,
6691
+ "type": "option"
6692
+ },
6693
+ "outputfile": {
6694
+ "char": "f",
6695
+ "description": "Force the path and name of output report file. Must end with .csv",
6696
+ "name": "outputfile",
6697
+ "hasDynamicHelp": false,
6698
+ "multiple": false,
6699
+ "type": "option"
6700
+ },
6701
+ "days": {
6702
+ "char": "t",
6703
+ "description": "Extracts the users that have been inactive for the amount of days specified. In CI, default is 180 days",
6704
+ "name": "days",
6705
+ "hasDynamicHelp": false,
6706
+ "multiple": false,
6707
+ "type": "option"
6708
+ },
6709
+ "debug": {
6710
+ "char": "d",
6711
+ "description": "Activate debug mode (more logs)",
6712
+ "name": "debug",
6713
+ "allowNo": false,
6714
+ "type": "boolean"
6715
+ },
6716
+ "websocket": {
6717
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
6718
+ "name": "websocket",
6719
+ "hasDynamicHelp": false,
6720
+ "multiple": false,
6721
+ "type": "option"
6722
+ },
6723
+ "skipauth": {
6724
+ "description": "Skip authentication check when a default username is required",
6725
+ "name": "skipauth",
6726
+ "allowNo": false,
6727
+ "type": "boolean"
6728
+ },
6729
+ "target-org": {
6730
+ "aliases": [
6731
+ "targetusername",
6732
+ "u"
6733
+ ],
6734
+ "char": "o",
6735
+ "deprecateAliases": true,
6736
+ "name": "target-org",
6737
+ "noCacheDefault": true,
6738
+ "required": true,
6739
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
6740
+ "hasDynamicHelp": true,
6741
+ "multiple": false,
6742
+ "type": "option"
6743
+ }
6744
+ },
6745
+ "hasDynamicHelp": true,
6746
+ "hiddenAliases": [],
6747
+ "id": "hardis:org:diagnose:unused-apex-classes",
6748
+ "pluginAlias": "sfdx-hardis",
6749
+ "pluginName": "sfdx-hardis",
6750
+ "pluginType": "core",
6751
+ "strict": true,
6752
+ "enableJsonFlag": true,
6753
+ "title": "Detect unused Apex classes in an org",
6754
+ "requiresProject": false,
6755
+ "isESM": true,
6756
+ "relativePath": [
6757
+ "lib",
6758
+ "commands",
6759
+ "hardis",
6760
+ "org",
6761
+ "diagnose",
6762
+ "unused-apex-classes.js"
6763
+ ],
6764
+ "aliasPermutations": [],
6765
+ "permutations": [
6766
+ "hardis:org:diagnose:unused-apex-classes",
6767
+ "org:hardis:diagnose:unused-apex-classes",
6768
+ "org:diagnose:hardis:unused-apex-classes",
6769
+ "org:diagnose:unused-apex-classes:hardis",
6770
+ "hardis:diagnose:org:unused-apex-classes",
6771
+ "diagnose:hardis:org:unused-apex-classes",
6772
+ "diagnose:org:hardis:unused-apex-classes",
6773
+ "diagnose:org:unused-apex-classes:hardis",
6774
+ "hardis:diagnose:unused-apex-classes:org",
6775
+ "diagnose:hardis:unused-apex-classes:org",
6776
+ "diagnose:unused-apex-classes:hardis:org",
6777
+ "diagnose:unused-apex-classes:org:hardis",
6778
+ "hardis:org:unused-apex-classes:diagnose",
6779
+ "org:hardis:unused-apex-classes:diagnose",
6780
+ "org:unused-apex-classes:hardis:diagnose",
6781
+ "org:unused-apex-classes:diagnose:hardis",
6782
+ "hardis:unused-apex-classes:org:diagnose",
6783
+ "unused-apex-classes:hardis:org:diagnose",
6784
+ "unused-apex-classes:org:hardis:diagnose",
6785
+ "unused-apex-classes:org:diagnose:hardis",
6786
+ "hardis:unused-apex-classes:diagnose:org",
6787
+ "unused-apex-classes:hardis:diagnose:org",
6788
+ "unused-apex-classes:diagnose:hardis:org",
6789
+ "unused-apex-classes:diagnose:org:hardis"
6790
+ ]
6791
+ },
6792
+ "hardis:org:diagnose:unused-connected-apps": {
6524
6793
  "aliases": [],
6525
6794
  "args": {},
6526
6795
  "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",
@@ -6937,275 +7206,6 @@
6937
7206
  "unusedusers:diagnose:org:hardis"
6938
7207
  ]
6939
7208
  },
6940
- "hardis:org:files:export": {
6941
- "aliases": [],
6942
- "args": {},
6943
- "description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, output naming conventions, and file size filtering.\n- **File Size Filtering:** Supports minimum file size filtering via the `fileSizeMin` configuration parameter (in KB). Files smaller than the specified size will be skipped during export.\n- **File Validation:** After downloading each file, validates the integrity by:\n - **Checksum Validation:** For ContentVersion files, compares MD5 checksum with Salesforce's stored checksum\n - **Size Validation:** For both ContentVersion and Attachment files, verifies actual file size matches expected size\n - **Status Tracking:** Files are categorized with specific statuses: `success` (valid files), `failed` (download errors), `skipped` (filtered files), `invalid` (downloaded but failed validation)\n - All validation results are logged in the CSV export log for audit purposes\n- **Resume/Restart Capability:** \n - **Resume Mode:** When `--resume` flag is used (default in CI environments), checks existing downloaded files for validity. Valid files are skipped, invalid files are re-downloaded.\n - **Restart Mode:** When resume is disabled, clears the output folder and starts a fresh export.\n - **Interactive Mode:** When existing files are found and `--resume` is not explicitly specified (non-CI environments), prompts the user to choose between resume or restart.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesExporter Class:** The core logic is encapsulated within the `FilesExporter` class, which orchestrates the entire export process.\n- **SOQL Queries (Bulk API):** It uses Salesforce Bulk API queries to efficiently retrieve large volumes of parent record IDs and file metadata, including checksums and file sizes.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File Validation:** After each successful download, validates file integrity by comparing checksums (ContentVersion) and file sizes (both ContentVersion and Attachment) against Salesforce metadata.\n- **Resume Logic:** In resume mode, checks for existing files before downloading, validates their integrity, and only re-downloads invalid or missing files. This enables efficient recovery from interrupted exports.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project, `promptFilesExportConfiguration` for customizing export options, and prompts for resume/restart choice when existing files are found.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues, API limits, and file validation failures. Each file is assigned a specific status (`success`, `failed`, `skipped`, `invalid`) for comprehensive tracking and troubleshooting.\n</details>\n",
6944
- "examples": [
6945
- "$ sf hardis:org:files:export"
6946
- ],
6947
- "flags": {
6948
- "json": {
6949
- "description": "Format output as json.",
6950
- "helpGroup": "GLOBAL",
6951
- "name": "json",
6952
- "allowNo": false,
6953
- "type": "boolean"
6954
- },
6955
- "flags-dir": {
6956
- "helpGroup": "GLOBAL",
6957
- "name": "flags-dir",
6958
- "summary": "Import flag values from a directory.",
6959
- "hasDynamicHelp": false,
6960
- "multiple": false,
6961
- "type": "option"
6962
- },
6963
- "path": {
6964
- "char": "p",
6965
- "description": "Path to the file export project",
6966
- "name": "path",
6967
- "hasDynamicHelp": false,
6968
- "multiple": false,
6969
- "type": "option"
6970
- },
6971
- "chunksize": {
6972
- "char": "c",
6973
- "description": "Number of records to add in a chunk before it is processed",
6974
- "name": "chunksize",
6975
- "default": 1000,
6976
- "hasDynamicHelp": false,
6977
- "multiple": false,
6978
- "type": "option"
6979
- },
6980
- "polltimeout": {
6981
- "char": "t",
6982
- "description": "Timeout in MS for Bulk API calls",
6983
- "name": "polltimeout",
6984
- "default": 300000,
6985
- "hasDynamicHelp": false,
6986
- "multiple": false,
6987
- "type": "option"
6988
- },
6989
- "startchunknumber": {
6990
- "char": "s",
6991
- "description": "Chunk number to start from",
6992
- "name": "startchunknumber",
6993
- "default": 0,
6994
- "hasDynamicHelp": false,
6995
- "multiple": false,
6996
- "type": "option"
6997
- },
6998
- "resume": {
6999
- "char": "r",
7000
- "description": "Resume previous export by checking existing files (default in CI)",
7001
- "name": "resume",
7002
- "allowNo": false,
7003
- "type": "boolean"
7004
- },
7005
- "debug": {
7006
- "char": "d",
7007
- "description": "Activate debug mode (more logs)",
7008
- "name": "debug",
7009
- "allowNo": false,
7010
- "type": "boolean"
7011
- },
7012
- "websocket": {
7013
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7014
- "name": "websocket",
7015
- "hasDynamicHelp": false,
7016
- "multiple": false,
7017
- "type": "option"
7018
- },
7019
- "skipauth": {
7020
- "description": "Skip authentication check when a default username is required",
7021
- "name": "skipauth",
7022
- "allowNo": false,
7023
- "type": "boolean"
7024
- },
7025
- "target-org": {
7026
- "aliases": [
7027
- "targetusername",
7028
- "u"
7029
- ],
7030
- "char": "o",
7031
- "deprecateAliases": true,
7032
- "name": "target-org",
7033
- "noCacheDefault": true,
7034
- "required": true,
7035
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7036
- "hasDynamicHelp": true,
7037
- "multiple": false,
7038
- "type": "option"
7039
- }
7040
- },
7041
- "hasDynamicHelp": true,
7042
- "hiddenAliases": [],
7043
- "id": "hardis:org:files:export",
7044
- "pluginAlias": "sfdx-hardis",
7045
- "pluginName": "sfdx-hardis",
7046
- "pluginType": "core",
7047
- "strict": true,
7048
- "enableJsonFlag": true,
7049
- "title": "Export files",
7050
- "requiresProject": false,
7051
- "isESM": true,
7052
- "relativePath": [
7053
- "lib",
7054
- "commands",
7055
- "hardis",
7056
- "org",
7057
- "files",
7058
- "export.js"
7059
- ],
7060
- "aliasPermutations": [],
7061
- "permutations": [
7062
- "hardis:org:files:export",
7063
- "org:hardis:files:export",
7064
- "org:files:hardis:export",
7065
- "org:files:export:hardis",
7066
- "hardis:files:org:export",
7067
- "files:hardis:org:export",
7068
- "files:org:hardis:export",
7069
- "files:org:export:hardis",
7070
- "hardis:files:export:org",
7071
- "files:hardis:export:org",
7072
- "files:export:hardis:org",
7073
- "files:export:org:hardis",
7074
- "hardis:org:export:files",
7075
- "org:hardis:export:files",
7076
- "org:export:hardis:files",
7077
- "org:export:files:hardis",
7078
- "hardis:export:org:files",
7079
- "export:hardis:org:files",
7080
- "export:org:hardis:files",
7081
- "export:org:files:hardis",
7082
- "hardis:export:files:org",
7083
- "export:hardis:files:org",
7084
- "export:files:hardis:org",
7085
- "export:files:org:hardis"
7086
- ]
7087
- },
7088
- "hardis:org:files:import": {
7089
- "aliases": [],
7090
- "args": {},
7091
- "description": "\nThis command facilitates the mass upload of files into Salesforce, allowing you to populate records with associated documents, images, or other file types. It's a crucial tool for data migration, content seeding, or synchronizing external file repositories with Salesforce.\n\nKey functionalities:\n\n- **Configuration-Driven Import:** Relies on an `export.json` file within a designated file export project (created using `sf hardis:org:configure:files`) to determine which files to import and how they should be associated with Salesforce records.\n- **Interactive Project Selection:** If the file import project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Overwrite Option:** The `--overwrite` flag allows you to replace existing files in Salesforce with local versions that have the same name. Be aware that this option doubles the number of API calls used.\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for how to export files, which is often a prerequisite for importing:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesImporter Class:** The core logic is encapsulated within the `FilesImporter` class, which orchestrates the entire import process.\n- **File System Scan:** Scans the local file system within the configured project directory to identify files for import.\n- **Salesforce API Interaction:** Uses Salesforce APIs (e.g., ContentVersion, Attachment) to upload files and associate them with records.\n- **Configuration Loading:** Reads the `export.json` file to get the import configuration, including SOQL queries to identify parent records for file association.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file import project and `prompts` for confirming the overwrite behavior.\n- **Error Handling:** Includes mechanisms to handle potential errors during the import process, such as API limits or file upload failures.\n</details>\n",
7092
- "examples": [
7093
- "$ sf hardis:org:files:import"
7094
- ],
7095
- "flags": {
7096
- "json": {
7097
- "description": "Format output as json.",
7098
- "helpGroup": "GLOBAL",
7099
- "name": "json",
7100
- "allowNo": false,
7101
- "type": "boolean"
7102
- },
7103
- "flags-dir": {
7104
- "helpGroup": "GLOBAL",
7105
- "name": "flags-dir",
7106
- "summary": "Import flag values from a directory.",
7107
- "hasDynamicHelp": false,
7108
- "multiple": false,
7109
- "type": "option"
7110
- },
7111
- "path": {
7112
- "char": "p",
7113
- "description": "Path to the file export project",
7114
- "name": "path",
7115
- "hasDynamicHelp": false,
7116
- "multiple": false,
7117
- "type": "option"
7118
- },
7119
- "overwrite": {
7120
- "char": "f",
7121
- "description": "Override existing files (doubles the number of API calls)",
7122
- "name": "overwrite",
7123
- "allowNo": false,
7124
- "type": "boolean"
7125
- },
7126
- "debug": {
7127
- "char": "d",
7128
- "description": "Activate debug mode (more logs)",
7129
- "name": "debug",
7130
- "allowNo": false,
7131
- "type": "boolean"
7132
- },
7133
- "websocket": {
7134
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7135
- "name": "websocket",
7136
- "hasDynamicHelp": false,
7137
- "multiple": false,
7138
- "type": "option"
7139
- },
7140
- "skipauth": {
7141
- "description": "Skip authentication check when a default username is required",
7142
- "name": "skipauth",
7143
- "allowNo": false,
7144
- "type": "boolean"
7145
- },
7146
- "target-org": {
7147
- "aliases": [
7148
- "targetusername",
7149
- "u"
7150
- ],
7151
- "char": "o",
7152
- "deprecateAliases": true,
7153
- "name": "target-org",
7154
- "noCacheDefault": true,
7155
- "required": true,
7156
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7157
- "hasDynamicHelp": true,
7158
- "multiple": false,
7159
- "type": "option"
7160
- }
7161
- },
7162
- "hasDynamicHelp": true,
7163
- "hiddenAliases": [],
7164
- "id": "hardis:org:files:import",
7165
- "pluginAlias": "sfdx-hardis",
7166
- "pluginName": "sfdx-hardis",
7167
- "pluginType": "core",
7168
- "strict": true,
7169
- "enableJsonFlag": true,
7170
- "title": "Import files",
7171
- "requiresProject": false,
7172
- "isESM": true,
7173
- "relativePath": [
7174
- "lib",
7175
- "commands",
7176
- "hardis",
7177
- "org",
7178
- "files",
7179
- "import.js"
7180
- ],
7181
- "aliasPermutations": [],
7182
- "permutations": [
7183
- "hardis:org:files:import",
7184
- "org:hardis:files:import",
7185
- "org:files:hardis:import",
7186
- "org:files:import:hardis",
7187
- "hardis:files:org:import",
7188
- "files:hardis:org:import",
7189
- "files:org:hardis:import",
7190
- "files:org:import:hardis",
7191
- "hardis:files:import:org",
7192
- "files:hardis:import:org",
7193
- "files:import:hardis:org",
7194
- "files:import:org:hardis",
7195
- "hardis:org:import:files",
7196
- "org:hardis:import:files",
7197
- "org:import:hardis:files",
7198
- "org:import:files:hardis",
7199
- "hardis:import:org:files",
7200
- "import:hardis:org:files",
7201
- "import:org:hardis:files",
7202
- "import:org:files:hardis",
7203
- "hardis:import:files:org",
7204
- "import:hardis:files:org",
7205
- "import:files:hardis:org",
7206
- "import:files:org:hardis"
7207
- ]
7208
- },
7209
7209
  "hardis:org:fix:listviewmine": {
7210
7210
  "aliases": [],
7211
7211
  "args": {},
@@ -9799,262 +9799,30 @@
9799
9799
  ],
9800
9800
  "aliasPermutations": [],
9801
9801
  "permutations": [
9802
- "hardis:project:audit:remotesites",
9803
- "project:hardis:audit:remotesites",
9804
- "project:audit:hardis:remotesites",
9805
- "project:audit:remotesites:hardis",
9806
- "hardis:audit:project:remotesites",
9807
- "audit:hardis:project:remotesites",
9808
- "audit:project:hardis:remotesites",
9809
- "audit:project:remotesites:hardis",
9810
- "hardis:audit:remotesites:project",
9811
- "audit:hardis:remotesites:project",
9812
- "audit:remotesites:hardis:project",
9813
- "audit:remotesites:project:hardis",
9814
- "hardis:project:remotesites:audit",
9815
- "project:hardis:remotesites:audit",
9816
- "project:remotesites:hardis:audit",
9817
- "project:remotesites:audit:hardis",
9818
- "hardis:remotesites:project:audit",
9819
- "remotesites:hardis:project:audit",
9820
- "remotesites:project:hardis:audit",
9821
- "remotesites:project:audit:hardis",
9822
- "hardis:remotesites:audit:project",
9823
- "remotesites:hardis:audit:project",
9824
- "remotesites:audit:hardis:project",
9825
- "remotesites:audit:project:hardis"
9826
- ]
9827
- },
9828
- "hardis:project:configure:auth": {
9829
- "aliases": [],
9830
- "args": {},
9831
- "description": "\n## Command Behavior\n\n**Configures authentication between a Git branch and a target Salesforce org for CI/CD deployments.**\n\nThis command facilitates the setup of automated CI/CD pipelines, enabling seamless deployments from specific Git branches to designated Salesforce orgs. It supports both standard Salesforce orgs and Dev Hub configurations, catering to various enterprise deployment workflows.\n\nKey functionalities include:\n\n- **Org Selection/Login:** Guides the user to select an existing Salesforce org or log in to a new one.\n- **Git Branch Association:** Allows associating a specific Git branch with the chosen Salesforce org.\n- **Merge Target Definition:** Enables defining target Git branches into which the configured branch can merge, ensuring controlled deployment flows.\n- **Salesforce Username Configuration:** Prompts for the Salesforce username to be used by the CI server for deployments.\n- **SSL Certificate Generation:** Automatically generates an SSL certificate for secure authentication.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's implementation involves several key technical aspects:\n\n- **SF CLI Integration:** Utilizes \n@salesforce/sf-plugins-core\n for command structure and flag parsing.\n- **Interactive Prompts:** Employs the \nprompts\n library for interactive user input, guiding the configuration process.\n- **Git Integration:** Interacts with Git to retrieve branch information using \n`git().branch([\"--list\", \"-r\"])`\n.\n- **Configuration Management:** Leverages internal utilities (`checkConfig`, `getConfig`, `setConfig`, `setInConfigFile`) to read from and write to project-specific configuration files (e.g., `.sfdx-hardis.<branchName>.yml`).\n- **Salesforce CLI Execution:** Executes Salesforce CLI commands programmatically via `execSfdxJson` for org interactions.\n- **SSL Certificate Generation:** Calls `generateSSLCertificate` to create necessary SSL certificates for JWT-based authentication.\n- **WebSocket Communication:** Uses `WebSocketClient` for potential communication with external tools or processes, such as restarting the command in VS Code.\n- **Dependency Check:** Ensures the presence of `openssl` on the system, which is required for SSL certificate generation.\n",
9832
- "examples": [
9833
- "$ sf hardis:project:configure:auth"
9834
- ],
9835
- "flags": {
9836
- "json": {
9837
- "description": "Format output as json.",
9838
- "helpGroup": "GLOBAL",
9839
- "name": "json",
9840
- "allowNo": false,
9841
- "type": "boolean"
9842
- },
9843
- "flags-dir": {
9844
- "helpGroup": "GLOBAL",
9845
- "name": "flags-dir",
9846
- "summary": "Import flag values from a directory.",
9847
- "hasDynamicHelp": false,
9848
- "multiple": false,
9849
- "type": "option"
9850
- },
9851
- "devhub": {
9852
- "char": "b",
9853
- "description": "Configure project DevHub",
9854
- "name": "devhub",
9855
- "allowNo": false,
9856
- "type": "boolean"
9857
- },
9858
- "debug": {
9859
- "char": "d",
9860
- "description": "Activate debug mode (more logs)",
9861
- "name": "debug",
9862
- "allowNo": false,
9863
- "type": "boolean"
9864
- },
9865
- "websocket": {
9866
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9867
- "name": "websocket",
9868
- "hasDynamicHelp": false,
9869
- "multiple": false,
9870
- "type": "option"
9871
- },
9872
- "skipauth": {
9873
- "description": "Skip authentication check when a default username is required",
9874
- "name": "skipauth",
9875
- "allowNo": false,
9876
- "type": "boolean"
9877
- },
9878
- "target-org": {
9879
- "aliases": [
9880
- "targetusername",
9881
- "u"
9882
- ],
9883
- "char": "o",
9884
- "deprecateAliases": true,
9885
- "name": "target-org",
9886
- "noCacheDefault": true,
9887
- "summary": "Username or alias of the target org.",
9888
- "hasDynamicHelp": true,
9889
- "multiple": false,
9890
- "type": "option"
9891
- },
9892
- "target-dev-hub": {
9893
- "aliases": [
9894
- "targetdevhubusername"
9895
- ],
9896
- "char": "v",
9897
- "deprecateAliases": true,
9898
- "name": "target-dev-hub",
9899
- "noCacheDefault": true,
9900
- "required": false,
9901
- "summary": "Username or alias of the Dev Hub org.",
9902
- "hasDynamicHelp": true,
9903
- "multiple": false,
9904
- "type": "option"
9905
- }
9906
- },
9907
- "hasDynamicHelp": true,
9908
- "hiddenAliases": [],
9909
- "id": "hardis:project:configure:auth",
9910
- "pluginAlias": "sfdx-hardis",
9911
- "pluginName": "sfdx-hardis",
9912
- "pluginType": "core",
9913
- "strict": true,
9914
- "enableJsonFlag": true,
9915
- "title": "Configure authentication",
9916
- "requiresProject": false,
9917
- "requiresDependencies": [
9918
- "openssl"
9919
- ],
9920
- "isESM": true,
9921
- "relativePath": [
9922
- "lib",
9923
- "commands",
9924
- "hardis",
9925
- "project",
9926
- "configure",
9927
- "auth.js"
9928
- ],
9929
- "aliasPermutations": [],
9930
- "permutations": [
9931
- "hardis:project:configure:auth",
9932
- "project:hardis:configure:auth",
9933
- "project:configure:hardis:auth",
9934
- "project:configure:auth:hardis",
9935
- "hardis:configure:project:auth",
9936
- "configure:hardis:project:auth",
9937
- "configure:project:hardis:auth",
9938
- "configure:project:auth:hardis",
9939
- "hardis:configure:auth:project",
9940
- "configure:hardis:auth:project",
9941
- "configure:auth:hardis:project",
9942
- "configure:auth:project:hardis",
9943
- "hardis:project:auth:configure",
9944
- "project:hardis:auth:configure",
9945
- "project:auth:hardis:configure",
9946
- "project:auth:configure:hardis",
9947
- "hardis:auth:project:configure",
9948
- "auth:hardis:project:configure",
9949
- "auth:project:hardis:configure",
9950
- "auth:project:configure:hardis",
9951
- "hardis:auth:configure:project",
9952
- "auth:hardis:configure:project",
9953
- "auth:configure:hardis:project",
9954
- "auth:configure:project:hardis"
9955
- ]
9956
- },
9957
- "hardis:project:convert:profilestopermsets": {
9958
- "aliases": [],
9959
- "args": {},
9960
- "description": "\n## Command Behavior\n\n**Converts existing Salesforce Profiles into Permission Sets, facilitating a more granular and recommended security model.**\n\nThis command helps in migrating permissions from Profiles to Permission Sets, which is a best practice for managing user access in Salesforce. It creates a new Permission Set for each specified Profile, adopting a naming convention of `PS_PROFILENAME`.\n\nKey functionalities:\n\n- **Profile to Permission Set Conversion:** Automatically extracts permissions from a Profile and creates a corresponding Permission Set.\n- **Naming Convention:** New Permission Sets are named with a `PS_` prefix followed by the Profile name (e.g., `PS_Standard_User`).\n- **Exclusion Filter:** Allows you to exclude specific Profiles from the conversion process using the `--except` flag.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **External Plugin Integration:** It relies on the `shane-sfdx-plugins` (specifically the `sf shane:profile:convert` command) to perform the actual conversion.\n- **File System Scan:** It reads the contents of the `force-app/main/default/profiles` directory to identify all available Profile metadata files.\n- **Command Execution:** For each identified Profile (that is not excluded), it constructs and executes the `sf shane:profile:convert` command with the appropriate Profile name and desired Permission Set name.\n- **Error Handling:** Includes basic error handling for the external command execution.\n</details>\n",
9961
- "examples": [
9962
- "$ sf hardis:project:convert:profilestopermsets"
9963
- ],
9964
- "flags": {
9965
- "json": {
9966
- "description": "Format output as json.",
9967
- "helpGroup": "GLOBAL",
9968
- "name": "json",
9969
- "allowNo": false,
9970
- "type": "boolean"
9971
- },
9972
- "flags-dir": {
9973
- "helpGroup": "GLOBAL",
9974
- "name": "flags-dir",
9975
- "summary": "Import flag values from a directory.",
9976
- "hasDynamicHelp": false,
9977
- "multiple": false,
9978
- "type": "option"
9979
- },
9980
- "except": {
9981
- "char": "e",
9982
- "description": "List of filters",
9983
- "name": "except",
9984
- "default": [],
9985
- "hasDynamicHelp": false,
9986
- "multiple": true,
9987
- "type": "option"
9988
- },
9989
- "debug": {
9990
- "char": "d",
9991
- "description": "Activate debug mode (more logs)",
9992
- "name": "debug",
9993
- "allowNo": false,
9994
- "type": "boolean"
9995
- },
9996
- "websocket": {
9997
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9998
- "name": "websocket",
9999
- "hasDynamicHelp": false,
10000
- "multiple": false,
10001
- "type": "option"
10002
- },
10003
- "skipauth": {
10004
- "description": "Skip authentication check when a default username is required",
10005
- "name": "skipauth",
10006
- "allowNo": false,
10007
- "type": "boolean"
10008
- }
10009
- },
10010
- "hasDynamicHelp": false,
10011
- "hiddenAliases": [],
10012
- "id": "hardis:project:convert:profilestopermsets",
10013
- "pluginAlias": "sfdx-hardis",
10014
- "pluginName": "sfdx-hardis",
10015
- "pluginType": "core",
10016
- "strict": true,
10017
- "enableJsonFlag": true,
10018
- "title": "Convert Profiles into Permission Sets",
10019
- "requiresProject": true,
10020
- "requiresSfdxPlugins": [
10021
- "shane-sfdx-plugins"
10022
- ],
10023
- "isESM": true,
10024
- "relativePath": [
10025
- "lib",
10026
- "commands",
10027
- "hardis",
10028
- "project",
10029
- "convert",
10030
- "profilestopermsets.js"
10031
- ],
10032
- "aliasPermutations": [],
10033
- "permutations": [
10034
- "hardis:project:convert:profilestopermsets",
10035
- "project:hardis:convert:profilestopermsets",
10036
- "project:convert:hardis:profilestopermsets",
10037
- "project:convert:profilestopermsets:hardis",
10038
- "hardis:convert:project:profilestopermsets",
10039
- "convert:hardis:project:profilestopermsets",
10040
- "convert:project:hardis:profilestopermsets",
10041
- "convert:project:profilestopermsets:hardis",
10042
- "hardis:convert:profilestopermsets:project",
10043
- "convert:hardis:profilestopermsets:project",
10044
- "convert:profilestopermsets:hardis:project",
10045
- "convert:profilestopermsets:project:hardis",
10046
- "hardis:project:profilestopermsets:convert",
10047
- "project:hardis:profilestopermsets:convert",
10048
- "project:profilestopermsets:hardis:convert",
10049
- "project:profilestopermsets:convert:hardis",
10050
- "hardis:profilestopermsets:project:convert",
10051
- "profilestopermsets:hardis:project:convert",
10052
- "profilestopermsets:project:hardis:convert",
10053
- "profilestopermsets:project:convert:hardis",
10054
- "hardis:profilestopermsets:convert:project",
10055
- "profilestopermsets:hardis:convert:project",
10056
- "profilestopermsets:convert:hardis:project",
10057
- "profilestopermsets:convert:project:hardis"
9802
+ "hardis:project:audit:remotesites",
9803
+ "project:hardis:audit:remotesites",
9804
+ "project:audit:hardis:remotesites",
9805
+ "project:audit:remotesites:hardis",
9806
+ "hardis:audit:project:remotesites",
9807
+ "audit:hardis:project:remotesites",
9808
+ "audit:project:hardis:remotesites",
9809
+ "audit:project:remotesites:hardis",
9810
+ "hardis:audit:remotesites:project",
9811
+ "audit:hardis:remotesites:project",
9812
+ "audit:remotesites:hardis:project",
9813
+ "audit:remotesites:project:hardis",
9814
+ "hardis:project:remotesites:audit",
9815
+ "project:hardis:remotesites:audit",
9816
+ "project:remotesites:hardis:audit",
9817
+ "project:remotesites:audit:hardis",
9818
+ "hardis:remotesites:project:audit",
9819
+ "remotesites:hardis:project:audit",
9820
+ "remotesites:project:hardis:audit",
9821
+ "remotesites:project:audit:hardis",
9822
+ "hardis:remotesites:audit:project",
9823
+ "remotesites:hardis:audit:project",
9824
+ "remotesites:audit:hardis:project",
9825
+ "remotesites:audit:project:hardis"
10058
9826
  ]
10059
9827
  },
10060
9828
  "hardis:project:clean:emptyitems": {
@@ -11542,6 +11310,238 @@
11542
11310
  "xml:clean:project:hardis"
11543
11311
  ]
11544
11312
  },
11313
+ "hardis:project:configure:auth": {
11314
+ "aliases": [],
11315
+ "args": {},
11316
+ "description": "\n## Command Behavior\n\n**Configures authentication between a Git branch and a target Salesforce org for CI/CD deployments.**\n\nThis command facilitates the setup of automated CI/CD pipelines, enabling seamless deployments from specific Git branches to designated Salesforce orgs. It supports both standard Salesforce orgs and Dev Hub configurations, catering to various enterprise deployment workflows.\n\nKey functionalities include:\n\n- **Org Selection/Login:** Guides the user to select an existing Salesforce org or log in to a new one.\n- **Git Branch Association:** Allows associating a specific Git branch with the chosen Salesforce org.\n- **Merge Target Definition:** Enables defining target Git branches into which the configured branch can merge, ensuring controlled deployment flows.\n- **Salesforce Username Configuration:** Prompts for the Salesforce username to be used by the CI server for deployments.\n- **SSL Certificate Generation:** Automatically generates an SSL certificate for secure authentication.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's implementation involves several key technical aspects:\n\n- **SF CLI Integration:** Utilizes \n@salesforce/sf-plugins-core\n for command structure and flag parsing.\n- **Interactive Prompts:** Employs the \nprompts\n library for interactive user input, guiding the configuration process.\n- **Git Integration:** Interacts with Git to retrieve branch information using \n`git().branch([\"--list\", \"-r\"])`\n.\n- **Configuration Management:** Leverages internal utilities (`checkConfig`, `getConfig`, `setConfig`, `setInConfigFile`) to read from and write to project-specific configuration files (e.g., `.sfdx-hardis.<branchName>.yml`).\n- **Salesforce CLI Execution:** Executes Salesforce CLI commands programmatically via `execSfdxJson` for org interactions.\n- **SSL Certificate Generation:** Calls `generateSSLCertificate` to create necessary SSL certificates for JWT-based authentication.\n- **WebSocket Communication:** Uses `WebSocketClient` for potential communication with external tools or processes, such as restarting the command in VS Code.\n- **Dependency Check:** Ensures the presence of `openssl` on the system, which is required for SSL certificate generation.\n",
11317
+ "examples": [
11318
+ "$ sf hardis:project:configure:auth"
11319
+ ],
11320
+ "flags": {
11321
+ "json": {
11322
+ "description": "Format output as json.",
11323
+ "helpGroup": "GLOBAL",
11324
+ "name": "json",
11325
+ "allowNo": false,
11326
+ "type": "boolean"
11327
+ },
11328
+ "flags-dir": {
11329
+ "helpGroup": "GLOBAL",
11330
+ "name": "flags-dir",
11331
+ "summary": "Import flag values from a directory.",
11332
+ "hasDynamicHelp": false,
11333
+ "multiple": false,
11334
+ "type": "option"
11335
+ },
11336
+ "devhub": {
11337
+ "char": "b",
11338
+ "description": "Configure project DevHub",
11339
+ "name": "devhub",
11340
+ "allowNo": false,
11341
+ "type": "boolean"
11342
+ },
11343
+ "debug": {
11344
+ "char": "d",
11345
+ "description": "Activate debug mode (more logs)",
11346
+ "name": "debug",
11347
+ "allowNo": false,
11348
+ "type": "boolean"
11349
+ },
11350
+ "websocket": {
11351
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11352
+ "name": "websocket",
11353
+ "hasDynamicHelp": false,
11354
+ "multiple": false,
11355
+ "type": "option"
11356
+ },
11357
+ "skipauth": {
11358
+ "description": "Skip authentication check when a default username is required",
11359
+ "name": "skipauth",
11360
+ "allowNo": false,
11361
+ "type": "boolean"
11362
+ },
11363
+ "target-org": {
11364
+ "aliases": [
11365
+ "targetusername",
11366
+ "u"
11367
+ ],
11368
+ "char": "o",
11369
+ "deprecateAliases": true,
11370
+ "name": "target-org",
11371
+ "noCacheDefault": true,
11372
+ "summary": "Username or alias of the target org.",
11373
+ "hasDynamicHelp": true,
11374
+ "multiple": false,
11375
+ "type": "option"
11376
+ },
11377
+ "target-dev-hub": {
11378
+ "aliases": [
11379
+ "targetdevhubusername"
11380
+ ],
11381
+ "char": "v",
11382
+ "deprecateAliases": true,
11383
+ "name": "target-dev-hub",
11384
+ "noCacheDefault": true,
11385
+ "required": false,
11386
+ "summary": "Username or alias of the Dev Hub org.",
11387
+ "hasDynamicHelp": true,
11388
+ "multiple": false,
11389
+ "type": "option"
11390
+ }
11391
+ },
11392
+ "hasDynamicHelp": true,
11393
+ "hiddenAliases": [],
11394
+ "id": "hardis:project:configure:auth",
11395
+ "pluginAlias": "sfdx-hardis",
11396
+ "pluginName": "sfdx-hardis",
11397
+ "pluginType": "core",
11398
+ "strict": true,
11399
+ "enableJsonFlag": true,
11400
+ "title": "Configure authentication",
11401
+ "requiresProject": false,
11402
+ "requiresDependencies": [
11403
+ "openssl"
11404
+ ],
11405
+ "isESM": true,
11406
+ "relativePath": [
11407
+ "lib",
11408
+ "commands",
11409
+ "hardis",
11410
+ "project",
11411
+ "configure",
11412
+ "auth.js"
11413
+ ],
11414
+ "aliasPermutations": [],
11415
+ "permutations": [
11416
+ "hardis:project:configure:auth",
11417
+ "project:hardis:configure:auth",
11418
+ "project:configure:hardis:auth",
11419
+ "project:configure:auth:hardis",
11420
+ "hardis:configure:project:auth",
11421
+ "configure:hardis:project:auth",
11422
+ "configure:project:hardis:auth",
11423
+ "configure:project:auth:hardis",
11424
+ "hardis:configure:auth:project",
11425
+ "configure:hardis:auth:project",
11426
+ "configure:auth:hardis:project",
11427
+ "configure:auth:project:hardis",
11428
+ "hardis:project:auth:configure",
11429
+ "project:hardis:auth:configure",
11430
+ "project:auth:hardis:configure",
11431
+ "project:auth:configure:hardis",
11432
+ "hardis:auth:project:configure",
11433
+ "auth:hardis:project:configure",
11434
+ "auth:project:hardis:configure",
11435
+ "auth:project:configure:hardis",
11436
+ "hardis:auth:configure:project",
11437
+ "auth:hardis:configure:project",
11438
+ "auth:configure:hardis:project",
11439
+ "auth:configure:project:hardis"
11440
+ ]
11441
+ },
11442
+ "hardis:project:convert:profilestopermsets": {
11443
+ "aliases": [],
11444
+ "args": {},
11445
+ "description": "\n## Command Behavior\n\n**Converts existing Salesforce Profiles into Permission Sets, facilitating a more granular and recommended security model.**\n\nThis command helps in migrating permissions from Profiles to Permission Sets, which is a best practice for managing user access in Salesforce. It creates a new Permission Set for each specified Profile, adopting a naming convention of `PS_PROFILENAME`.\n\nKey functionalities:\n\n- **Profile to Permission Set Conversion:** Automatically extracts permissions from a Profile and creates a corresponding Permission Set.\n- **Naming Convention:** New Permission Sets are named with a `PS_` prefix followed by the Profile name (e.g., `PS_Standard_User`).\n- **Exclusion Filter:** Allows you to exclude specific Profiles from the conversion process using the `--except` flag.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **External Plugin Integration:** It relies on the `shane-sfdx-plugins` (specifically the `sf shane:profile:convert` command) to perform the actual conversion.\n- **File System Scan:** It reads the contents of the `force-app/main/default/profiles` directory to identify all available Profile metadata files.\n- **Command Execution:** For each identified Profile (that is not excluded), it constructs and executes the `sf shane:profile:convert` command with the appropriate Profile name and desired Permission Set name.\n- **Error Handling:** Includes basic error handling for the external command execution.\n</details>\n",
11446
+ "examples": [
11447
+ "$ sf hardis:project:convert:profilestopermsets"
11448
+ ],
11449
+ "flags": {
11450
+ "json": {
11451
+ "description": "Format output as json.",
11452
+ "helpGroup": "GLOBAL",
11453
+ "name": "json",
11454
+ "allowNo": false,
11455
+ "type": "boolean"
11456
+ },
11457
+ "flags-dir": {
11458
+ "helpGroup": "GLOBAL",
11459
+ "name": "flags-dir",
11460
+ "summary": "Import flag values from a directory.",
11461
+ "hasDynamicHelp": false,
11462
+ "multiple": false,
11463
+ "type": "option"
11464
+ },
11465
+ "except": {
11466
+ "char": "e",
11467
+ "description": "List of filters",
11468
+ "name": "except",
11469
+ "default": [],
11470
+ "hasDynamicHelp": false,
11471
+ "multiple": true,
11472
+ "type": "option"
11473
+ },
11474
+ "debug": {
11475
+ "char": "d",
11476
+ "description": "Activate debug mode (more logs)",
11477
+ "name": "debug",
11478
+ "allowNo": false,
11479
+ "type": "boolean"
11480
+ },
11481
+ "websocket": {
11482
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11483
+ "name": "websocket",
11484
+ "hasDynamicHelp": false,
11485
+ "multiple": false,
11486
+ "type": "option"
11487
+ },
11488
+ "skipauth": {
11489
+ "description": "Skip authentication check when a default username is required",
11490
+ "name": "skipauth",
11491
+ "allowNo": false,
11492
+ "type": "boolean"
11493
+ }
11494
+ },
11495
+ "hasDynamicHelp": false,
11496
+ "hiddenAliases": [],
11497
+ "id": "hardis:project:convert:profilestopermsets",
11498
+ "pluginAlias": "sfdx-hardis",
11499
+ "pluginName": "sfdx-hardis",
11500
+ "pluginType": "core",
11501
+ "strict": true,
11502
+ "enableJsonFlag": true,
11503
+ "title": "Convert Profiles into Permission Sets",
11504
+ "requiresProject": true,
11505
+ "requiresSfdxPlugins": [
11506
+ "shane-sfdx-plugins"
11507
+ ],
11508
+ "isESM": true,
11509
+ "relativePath": [
11510
+ "lib",
11511
+ "commands",
11512
+ "hardis",
11513
+ "project",
11514
+ "convert",
11515
+ "profilestopermsets.js"
11516
+ ],
11517
+ "aliasPermutations": [],
11518
+ "permutations": [
11519
+ "hardis:project:convert:profilestopermsets",
11520
+ "project:hardis:convert:profilestopermsets",
11521
+ "project:convert:hardis:profilestopermsets",
11522
+ "project:convert:profilestopermsets:hardis",
11523
+ "hardis:convert:project:profilestopermsets",
11524
+ "convert:hardis:project:profilestopermsets",
11525
+ "convert:project:hardis:profilestopermsets",
11526
+ "convert:project:profilestopermsets:hardis",
11527
+ "hardis:convert:profilestopermsets:project",
11528
+ "convert:hardis:profilestopermsets:project",
11529
+ "convert:profilestopermsets:hardis:project",
11530
+ "convert:profilestopermsets:project:hardis",
11531
+ "hardis:project:profilestopermsets:convert",
11532
+ "project:hardis:profilestopermsets:convert",
11533
+ "project:profilestopermsets:hardis:convert",
11534
+ "project:profilestopermsets:convert:hardis",
11535
+ "hardis:profilestopermsets:project:convert",
11536
+ "profilestopermsets:hardis:project:convert",
11537
+ "profilestopermsets:project:hardis:convert",
11538
+ "profilestopermsets:project:convert:hardis",
11539
+ "hardis:profilestopermsets:convert:project",
11540
+ "profilestopermsets:hardis:convert:project",
11541
+ "profilestopermsets:convert:hardis:project",
11542
+ "profilestopermsets:convert:project:hardis"
11543
+ ]
11544
+ },
11545
11545
  "hardis:project:deploy:notify": {
11546
11546
  "aliases": [],
11547
11547
  "args": {},
@@ -15505,5 +15505,5 @@
15505
15505
  ]
15506
15506
  }
15507
15507
  },
15508
- "version": "6.11.5"
15508
+ "version": "6.12.1"
15509
15509
  }