sfdx-hardis 6.1.2 → 6.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,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 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,41 @@
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:config:get": {
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**Retrieves and displays the sfdx-hardis configuration for a specified level.**\n\nThis command allows you to inspect the configuration that is currently in effect for your project, which is useful for debugging and understanding how sfdx-hardis will behave.\n\n- **Configuration levels:** It can retrieve configuration from three different levels:\n - **Project:** The configuration defined in the project's `.sfdx-hardis.yml` file.\n - **Branch:** The configuration defined in a branch-specific configuration file (e.g., `.sfdx-hardis.production.yml`).\n - **User:** The global user-level configuration.\n\n## Technical explanations\n\nThe command's logic is straightforward:\n\n- **`getConfig` function:** It calls the `getConfig` utility function, passing the desired configuration level as an argument.\n- **Configuration loading:** The `getConfig` function is responsible for finding the appropriate configuration file, reading its contents, and parsing it as YAML or JSON.\n- **Output:** The retrieved configuration is then displayed to the user as a JSON string.\n",
159
139
  "examples": [
160
- "$ sf hardis:cache:clear"
140
+ "$ sf hardis:project:deploy:sources:metadata"
161
141
  ],
162
142
  "flags": {
163
143
  "json": {
@@ -175,6 +155,20 @@
175
155
  "multiple": false,
176
156
  "type": "option"
177
157
  },
158
+ "level": {
159
+ "char": "l",
160
+ "description": "project,branch or user",
161
+ "name": "level",
162
+ "default": "project",
163
+ "hasDynamicHelp": false,
164
+ "multiple": false,
165
+ "options": [
166
+ "project",
167
+ "branch",
168
+ "user"
169
+ ],
170
+ "type": "option"
171
+ },
178
172
  "debug": {
179
173
  "char": "d",
180
174
  "description": "Activate debug mode (more logs)",
@@ -198,41 +192,39 @@
198
192
  },
199
193
  "hasDynamicHelp": false,
200
194
  "hiddenAliases": [],
201
- "id": "hardis:cache:clear",
195
+ "id": "hardis:config:get",
202
196
  "pluginAlias": "sfdx-hardis",
203
197
  "pluginName": "sfdx-hardis",
204
198
  "pluginType": "core",
205
199
  "strict": true,
206
200
  "enableJsonFlag": true,
207
- "title": "Clear sfdx-hardis cache",
208
- "uiConfig": {
209
- "hide": true
210
- },
201
+ "title": "Deploy metadata sources to org",
211
202
  "requiresProject": false,
212
203
  "isESM": true,
213
204
  "relativePath": [
214
205
  "lib",
215
206
  "commands",
216
207
  "hardis",
217
- "cache",
218
- "clear.js"
208
+ "config",
209
+ "get.js"
219
210
  ],
220
211
  "aliasPermutations": [],
221
212
  "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"
213
+ "hardis:config:get",
214
+ "config:hardis:get",
215
+ "config:get:hardis",
216
+ "hardis:get:config",
217
+ "get:hardis:config",
218
+ "get:config:hardis"
228
219
  ]
229
220
  },
230
- "hardis:config:get": {
221
+ "hardis:auth:login": {
231
222
  "aliases": [],
232
223
  "args": {},
233
- "description": "\n## Command Behavior\n\n**Retrieves and displays the sfdx-hardis configuration for a specified level.**\n\nThis command allows you to inspect the configuration that is currently in effect for your project, which is useful for debugging and understanding how sfdx-hardis will behave.\n\n- **Configuration levels:** It can retrieve configuration from three different levels:\n - **Project:** The configuration defined in the project's `.sfdx-hardis.yml` file.\n - **Branch:** The configuration defined in a branch-specific configuration file (e.g., `.sfdx-hardis.production.yml`).\n - **User:** The global user-level configuration.\n\n## Technical explanations\n\nThe command's logic is straightforward:\n\n- **`getConfig` function:** It calls the `getConfig` utility function, passing the desired configuration level as an argument.\n- **Configuration loading:** The `getConfig` function is responsible for finding the appropriate configuration file, reading its contents, and parsing it as YAML or JSON.\n- **Output:** The retrieved configuration is then displayed to the user as a JSON string.\n",
224
+ "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
234
225
  "examples": [
235
- "$ sf hardis:project:deploy:sources:metadata"
226
+ "$ sf hardis:auth:login",
227
+ "CI=true sf hardis:auth:login"
236
228
  ],
237
229
  "flags": {
238
230
  "json": {
@@ -250,20 +242,28 @@
250
242
  "multiple": false,
251
243
  "type": "option"
252
244
  },
253
- "level": {
254
- "char": "l",
255
- "description": "project,branch or user",
256
- "name": "level",
257
- "default": "project",
245
+ "instanceurl": {
246
+ "char": "r",
247
+ "description": "URL of org instance",
248
+ "name": "instanceurl",
258
249
  "hasDynamicHelp": false,
259
250
  "multiple": false,
260
- "options": [
261
- "project",
262
- "branch",
263
- "user"
264
- ],
265
251
  "type": "option"
266
252
  },
253
+ "devhub": {
254
+ "char": "h",
255
+ "description": "Also connect associated DevHub",
256
+ "name": "devhub",
257
+ "allowNo": false,
258
+ "type": "boolean"
259
+ },
260
+ "scratchorg": {
261
+ "char": "s",
262
+ "description": "Scratch org",
263
+ "name": "scratchorg",
264
+ "allowNo": false,
265
+ "type": "boolean"
266
+ },
267
267
  "debug": {
268
268
  "char": "d",
269
269
  "description": "Activate debug mode (more logs)",
@@ -287,30 +287,30 @@
287
287
  },
288
288
  "hasDynamicHelp": false,
289
289
  "hiddenAliases": [],
290
- "id": "hardis:config:get",
290
+ "id": "hardis:auth:login",
291
291
  "pluginAlias": "sfdx-hardis",
292
292
  "pluginName": "sfdx-hardis",
293
293
  "pluginType": "core",
294
294
  "strict": true,
295
295
  "enableJsonFlag": true,
296
- "title": "Deploy metadata sources to org",
296
+ "title": "Login",
297
297
  "requiresProject": false,
298
298
  "isESM": true,
299
299
  "relativePath": [
300
300
  "lib",
301
301
  "commands",
302
302
  "hardis",
303
- "config",
304
- "get.js"
303
+ "auth",
304
+ "login.js"
305
305
  ],
306
306
  "aliasPermutations": [],
307
307
  "permutations": [
308
- "hardis:config:get",
309
- "config:hardis:get",
310
- "config:get:hardis",
311
- "hardis:get:config",
312
- "get:hardis:config",
313
- "get:config:hardis"
308
+ "hardis:auth:login",
309
+ "auth:hardis:login",
310
+ "auth:login:hardis",
311
+ "hardis:login:auth",
312
+ "login:hardis:auth",
313
+ "login:auth:hardis"
314
314
  ]
315
315
  },
316
316
  "hardis:doc:fieldusage": {
@@ -5488,15 +5488,12 @@
5488
5488
  "import:data:org:hardis"
5489
5489
  ]
5490
5490
  },
5491
- "hardis:org:diagnose:audittrail": {
5491
+ "hardis:org:files:export": {
5492
5492
  "aliases": [],
5493
5493
  "args": {},
5494
- "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",
5494
+ "description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, and output naming conventions.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[![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.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project and `promptFilesExportConfiguration` for customizing export options.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues or API limits.\n</details>\n",
5495
5495
  "examples": [
5496
- "$ sf hardis:org:diagnose:audittrail",
5497
- "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
5498
- "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
5499
- "$ sf hardis:org:diagnose:audittrail --lastndays 5"
5496
+ "$ sf hardis:org:files:export"
5500
5497
  ],
5501
5498
  "flags": {
5502
5499
  "json": {
@@ -5514,26 +5511,37 @@
5514
5511
  "multiple": false,
5515
5512
  "type": "option"
5516
5513
  },
5517
- "excludeusers": {
5518
- "char": "e",
5519
- "description": "Comma-separated list of usernames to exclude",
5520
- "name": "excludeusers",
5514
+ "path": {
5515
+ "char": "p",
5516
+ "description": "Path to the file export project",
5517
+ "name": "path",
5521
5518
  "hasDynamicHelp": false,
5522
5519
  "multiple": false,
5523
5520
  "type": "option"
5524
5521
  },
5525
- "lastndays": {
5522
+ "chunksize": {
5523
+ "char": "c",
5524
+ "description": "Number of records to add in a chunk before it is processed",
5525
+ "name": "chunksize",
5526
+ "default": 1000,
5527
+ "hasDynamicHelp": false,
5528
+ "multiple": false,
5529
+ "type": "option"
5530
+ },
5531
+ "polltimeout": {
5526
5532
  "char": "t",
5527
- "description": "Number of days to extract from today (included)",
5528
- "name": "lastndays",
5533
+ "description": "Timeout in MS for Bulk API calls",
5534
+ "name": "polltimeout",
5535
+ "default": 300000,
5529
5536
  "hasDynamicHelp": false,
5530
5537
  "multiple": false,
5531
5538
  "type": "option"
5532
5539
  },
5533
- "outputfile": {
5534
- "char": "f",
5535
- "description": "Force the path and name of output report file. Must end with .csv",
5536
- "name": "outputfile",
5540
+ "startchunknumber": {
5541
+ "char": "s",
5542
+ "description": "Chunk number to start from",
5543
+ "name": "startchunknumber",
5544
+ "default": 0,
5537
5545
  "hasDynamicHelp": false,
5538
5546
  "multiple": false,
5539
5547
  "type": "option"
@@ -5576,13 +5584,13 @@
5576
5584
  },
5577
5585
  "hasDynamicHelp": true,
5578
5586
  "hiddenAliases": [],
5579
- "id": "hardis:org:diagnose:audittrail",
5587
+ "id": "hardis:org:files:export",
5580
5588
  "pluginAlias": "sfdx-hardis",
5581
5589
  "pluginName": "sfdx-hardis",
5582
5590
  "pluginType": "core",
5583
5591
  "strict": true,
5584
5592
  "enableJsonFlag": true,
5585
- "title": "Diagnose content of Setup Audit Trail",
5593
+ "title": "Export files",
5586
5594
  "requiresProject": false,
5587
5595
  "isESM": true,
5588
5596
  "relativePath": [
@@ -5590,43 +5598,43 @@
5590
5598
  "commands",
5591
5599
  "hardis",
5592
5600
  "org",
5593
- "diagnose",
5594
- "audittrail.js"
5601
+ "files",
5602
+ "export.js"
5595
5603
  ],
5596
5604
  "aliasPermutations": [],
5597
5605
  "permutations": [
5598
- "hardis:org:diagnose:audittrail",
5599
- "org:hardis:diagnose:audittrail",
5600
- "org:diagnose:hardis:audittrail",
5601
- "org:diagnose:audittrail:hardis",
5602
- "hardis:diagnose:org:audittrail",
5603
- "diagnose:hardis:org:audittrail",
5604
- "diagnose:org:hardis:audittrail",
5605
- "diagnose:org:audittrail:hardis",
5606
- "hardis:diagnose:audittrail:org",
5607
- "diagnose:hardis:audittrail:org",
5608
- "diagnose:audittrail:hardis:org",
5609
- "diagnose:audittrail:org:hardis",
5610
- "hardis:org:audittrail:diagnose",
5611
- "org:hardis:audittrail:diagnose",
5612
- "org:audittrail:hardis:diagnose",
5613
- "org:audittrail:diagnose:hardis",
5614
- "hardis:audittrail:org:diagnose",
5615
- "audittrail:hardis:org:diagnose",
5616
- "audittrail:org:hardis:diagnose",
5617
- "audittrail:org:diagnose:hardis",
5618
- "hardis:audittrail:diagnose:org",
5619
- "audittrail:hardis:diagnose:org",
5620
- "audittrail:diagnose:hardis:org",
5621
- "audittrail:diagnose:org:hardis"
5606
+ "hardis:org:files:export",
5607
+ "org:hardis:files:export",
5608
+ "org:files:hardis:export",
5609
+ "org:files:export:hardis",
5610
+ "hardis:files:org:export",
5611
+ "files:hardis:org:export",
5612
+ "files:org:hardis:export",
5613
+ "files:org:export:hardis",
5614
+ "hardis:files:export:org",
5615
+ "files:hardis:export:org",
5616
+ "files:export:hardis:org",
5617
+ "files:export:org:hardis",
5618
+ "hardis:org:export:files",
5619
+ "org:hardis:export:files",
5620
+ "org:export:hardis:files",
5621
+ "org:export:files:hardis",
5622
+ "hardis:export:org:files",
5623
+ "export:hardis:org:files",
5624
+ "export:org:hardis:files",
5625
+ "export:org:files:hardis",
5626
+ "hardis:export:files:org",
5627
+ "export:hardis:files:org",
5628
+ "export:files:hardis:org",
5629
+ "export:files:org:hardis"
5622
5630
  ]
5623
5631
  },
5624
- "hardis:org:diagnose:instanceupgrade": {
5632
+ "hardis:org:files:import": {
5625
5633
  "aliases": [],
5626
5634
  "args": {},
5627
- "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",
5635
+ "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",
5628
5636
  "examples": [
5629
- "$ sf hardis:org:diagnose:instanceupgrade"
5637
+ "$ sf hardis:org:files:import"
5630
5638
  ],
5631
5639
  "flags": {
5632
5640
  "json": {
@@ -5644,8 +5652,262 @@
5644
5652
  "multiple": false,
5645
5653
  "type": "option"
5646
5654
  },
5647
- "debug": {
5648
- "char": "d",
5655
+ "path": {
5656
+ "char": "p",
5657
+ "description": "Path to the file export project",
5658
+ "name": "path",
5659
+ "hasDynamicHelp": false,
5660
+ "multiple": false,
5661
+ "type": "option"
5662
+ },
5663
+ "overwrite": {
5664
+ "char": "f",
5665
+ "description": "Override existing files (doubles the number of API calls)",
5666
+ "name": "overwrite",
5667
+ "allowNo": false,
5668
+ "type": "boolean"
5669
+ },
5670
+ "debug": {
5671
+ "char": "d",
5672
+ "description": "Activate debug mode (more logs)",
5673
+ "name": "debug",
5674
+ "allowNo": false,
5675
+ "type": "boolean"
5676
+ },
5677
+ "websocket": {
5678
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5679
+ "name": "websocket",
5680
+ "hasDynamicHelp": false,
5681
+ "multiple": false,
5682
+ "type": "option"
5683
+ },
5684
+ "skipauth": {
5685
+ "description": "Skip authentication check when a default username is required",
5686
+ "name": "skipauth",
5687
+ "allowNo": false,
5688
+ "type": "boolean"
5689
+ },
5690
+ "target-org": {
5691
+ "aliases": [
5692
+ "targetusername",
5693
+ "u"
5694
+ ],
5695
+ "char": "o",
5696
+ "deprecateAliases": true,
5697
+ "name": "target-org",
5698
+ "noCacheDefault": true,
5699
+ "required": true,
5700
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5701
+ "hasDynamicHelp": true,
5702
+ "multiple": false,
5703
+ "type": "option"
5704
+ }
5705
+ },
5706
+ "hasDynamicHelp": true,
5707
+ "hiddenAliases": [],
5708
+ "id": "hardis:org:files:import",
5709
+ "pluginAlias": "sfdx-hardis",
5710
+ "pluginName": "sfdx-hardis",
5711
+ "pluginType": "core",
5712
+ "strict": true,
5713
+ "enableJsonFlag": true,
5714
+ "title": "Import files",
5715
+ "requiresProject": false,
5716
+ "isESM": true,
5717
+ "relativePath": [
5718
+ "lib",
5719
+ "commands",
5720
+ "hardis",
5721
+ "org",
5722
+ "files",
5723
+ "import.js"
5724
+ ],
5725
+ "aliasPermutations": [],
5726
+ "permutations": [
5727
+ "hardis:org:files:import",
5728
+ "org:hardis:files:import",
5729
+ "org:files:hardis:import",
5730
+ "org:files:import:hardis",
5731
+ "hardis:files:org:import",
5732
+ "files:hardis:org:import",
5733
+ "files:org:hardis:import",
5734
+ "files:org:import:hardis",
5735
+ "hardis:files:import:org",
5736
+ "files:hardis:import:org",
5737
+ "files:import:hardis:org",
5738
+ "files:import:org:hardis",
5739
+ "hardis:org:import:files",
5740
+ "org:hardis:import:files",
5741
+ "org:import:hardis:files",
5742
+ "org:import:files:hardis",
5743
+ "hardis:import:org:files",
5744
+ "import:hardis:org:files",
5745
+ "import:org:hardis:files",
5746
+ "import:org:files:hardis",
5747
+ "hardis:import:files:org",
5748
+ "import:hardis:files:org",
5749
+ "import:files:hardis:org",
5750
+ "import:files:org:hardis"
5751
+ ]
5752
+ },
5753
+ "hardis:org:diagnose:audittrail": {
5754
+ "aliases": [],
5755
+ "args": {},
5756
+ "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",
5757
+ "examples": [
5758
+ "$ sf hardis:org:diagnose:audittrail",
5759
+ "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
5760
+ "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
5761
+ "$ sf hardis:org:diagnose:audittrail --lastndays 5"
5762
+ ],
5763
+ "flags": {
5764
+ "json": {
5765
+ "description": "Format output as json.",
5766
+ "helpGroup": "GLOBAL",
5767
+ "name": "json",
5768
+ "allowNo": false,
5769
+ "type": "boolean"
5770
+ },
5771
+ "flags-dir": {
5772
+ "helpGroup": "GLOBAL",
5773
+ "name": "flags-dir",
5774
+ "summary": "Import flag values from a directory.",
5775
+ "hasDynamicHelp": false,
5776
+ "multiple": false,
5777
+ "type": "option"
5778
+ },
5779
+ "excludeusers": {
5780
+ "char": "e",
5781
+ "description": "Comma-separated list of usernames to exclude",
5782
+ "name": "excludeusers",
5783
+ "hasDynamicHelp": false,
5784
+ "multiple": false,
5785
+ "type": "option"
5786
+ },
5787
+ "lastndays": {
5788
+ "char": "t",
5789
+ "description": "Number of days to extract from today (included)",
5790
+ "name": "lastndays",
5791
+ "hasDynamicHelp": false,
5792
+ "multiple": false,
5793
+ "type": "option"
5794
+ },
5795
+ "outputfile": {
5796
+ "char": "f",
5797
+ "description": "Force the path and name of output report file. Must end with .csv",
5798
+ "name": "outputfile",
5799
+ "hasDynamicHelp": false,
5800
+ "multiple": false,
5801
+ "type": "option"
5802
+ },
5803
+ "debug": {
5804
+ "char": "d",
5805
+ "description": "Activate debug mode (more logs)",
5806
+ "name": "debug",
5807
+ "allowNo": false,
5808
+ "type": "boolean"
5809
+ },
5810
+ "websocket": {
5811
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5812
+ "name": "websocket",
5813
+ "hasDynamicHelp": false,
5814
+ "multiple": false,
5815
+ "type": "option"
5816
+ },
5817
+ "skipauth": {
5818
+ "description": "Skip authentication check when a default username is required",
5819
+ "name": "skipauth",
5820
+ "allowNo": false,
5821
+ "type": "boolean"
5822
+ },
5823
+ "target-org": {
5824
+ "aliases": [
5825
+ "targetusername",
5826
+ "u"
5827
+ ],
5828
+ "char": "o",
5829
+ "deprecateAliases": true,
5830
+ "name": "target-org",
5831
+ "noCacheDefault": true,
5832
+ "required": true,
5833
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5834
+ "hasDynamicHelp": true,
5835
+ "multiple": false,
5836
+ "type": "option"
5837
+ }
5838
+ },
5839
+ "hasDynamicHelp": true,
5840
+ "hiddenAliases": [],
5841
+ "id": "hardis:org:diagnose:audittrail",
5842
+ "pluginAlias": "sfdx-hardis",
5843
+ "pluginName": "sfdx-hardis",
5844
+ "pluginType": "core",
5845
+ "strict": true,
5846
+ "enableJsonFlag": true,
5847
+ "title": "Diagnose content of Setup Audit Trail",
5848
+ "requiresProject": false,
5849
+ "isESM": true,
5850
+ "relativePath": [
5851
+ "lib",
5852
+ "commands",
5853
+ "hardis",
5854
+ "org",
5855
+ "diagnose",
5856
+ "audittrail.js"
5857
+ ],
5858
+ "aliasPermutations": [],
5859
+ "permutations": [
5860
+ "hardis:org:diagnose:audittrail",
5861
+ "org:hardis:diagnose:audittrail",
5862
+ "org:diagnose:hardis:audittrail",
5863
+ "org:diagnose:audittrail:hardis",
5864
+ "hardis:diagnose:org:audittrail",
5865
+ "diagnose:hardis:org:audittrail",
5866
+ "diagnose:org:hardis:audittrail",
5867
+ "diagnose:org:audittrail:hardis",
5868
+ "hardis:diagnose:audittrail:org",
5869
+ "diagnose:hardis:audittrail:org",
5870
+ "diagnose:audittrail:hardis:org",
5871
+ "diagnose:audittrail:org:hardis",
5872
+ "hardis:org:audittrail:diagnose",
5873
+ "org:hardis:audittrail:diagnose",
5874
+ "org:audittrail:hardis:diagnose",
5875
+ "org:audittrail:diagnose:hardis",
5876
+ "hardis:audittrail:org:diagnose",
5877
+ "audittrail:hardis:org:diagnose",
5878
+ "audittrail:org:hardis:diagnose",
5879
+ "audittrail:org:diagnose:hardis",
5880
+ "hardis:audittrail:diagnose:org",
5881
+ "audittrail:hardis:diagnose:org",
5882
+ "audittrail:diagnose:hardis:org",
5883
+ "audittrail:diagnose:org:hardis"
5884
+ ]
5885
+ },
5886
+ "hardis:org:diagnose:instanceupgrade": {
5887
+ "aliases": [],
5888
+ "args": {},
5889
+ "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",
5890
+ "examples": [
5891
+ "$ sf hardis:org:diagnose:instanceupgrade"
5892
+ ],
5893
+ "flags": {
5894
+ "json": {
5895
+ "description": "Format output as json.",
5896
+ "helpGroup": "GLOBAL",
5897
+ "name": "json",
5898
+ "allowNo": false,
5899
+ "type": "boolean"
5900
+ },
5901
+ "flags-dir": {
5902
+ "helpGroup": "GLOBAL",
5903
+ "name": "flags-dir",
5904
+ "summary": "Import flag values from a directory.",
5905
+ "hasDynamicHelp": false,
5906
+ "multiple": false,
5907
+ "type": "option"
5908
+ },
5909
+ "debug": {
5910
+ "char": "d",
5649
5911
  "description": "Activate debug mode (more logs)",
5650
5912
  "name": "debug",
5651
5913
  "allowNo": false,
@@ -6637,12 +6899,13 @@
6637
6899
  "unusedusers:diagnose:org:hardis"
6638
6900
  ]
6639
6901
  },
6640
- "hardis:org:files:export": {
6902
+ "hardis:org:fix:listviewmine": {
6641
6903
  "aliases": [],
6642
6904
  "args": {},
6643
- "description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, and output naming conventions.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[![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.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project and `promptFilesExportConfiguration` for customizing export options.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues or API limits.\n</details>\n",
6905
+ "description": "Fix listviews whose scope Mine has been replaced by Everything\n\n[![Invalid scope:Mine, not allowed ? Deploy your ListViews anyway !](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-invalid-scope-mine.jpg)](https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7)\n\nList of ListViews can be:\n\n- read from .sfdx-hardis.yml file in property **listViewsToSetToMine**\n- sent in argument listviews\n\nNote: property **listViewsToSetToMine** can be auto-generated by command hardis:work:save if .sfdx-hardis.yml contains the following configuration\n\n```yaml\nautoCleanTypes:\n - listViewsMine\n```\n\n- Example of sfdx-hardis.yml property `listViewsToSetToMine`:\n\n```yaml\nlistViewsToSetToMine:\n - \"force-app/main/default/objects/Operation__c/listViews/MyCurrentOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Operation__c/listViews/MyFinalizedOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/Default_Opportunity_Pipeline.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MyCurrentSubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MySubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Account/listViews/MyActivePartners.listView-meta.xml\"\n```\n\n- If manually written, this could also be:\n\n```yaml\nlistViewsToSetToMine:\n - \"Operation__c:MyCurrentOperations\"\n - \"Operation__c:MyFinalizedOperations\"\n - \"Opportunity:Default_Opportunity_Pipeline\"\n - \"Opportunity:MyCurrentSubscriptions\"\n - \"Opportunity:MySubscriptions\"\n - \"Account:MyActivePartners\"\n```\n\nTroubleshooting: if you need to run this command from an alpine-linux based docker image, use this workaround in your dockerfile:\n\n```dockerfile\n# Do not use puppeteer embedded chromium\nRUN apk add --update --no-cache chromium\nENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=\"true\"\nENV CHROMIUM_PATH=\"/usr/bin/chromium-browser\"\nENV PUPPETEER_EXECUTABLE_PATH=\"$\\{CHROMIUM_PATH}\" // remove \\ before {\n```\n",
6644
6906
  "examples": [
6645
- "$ sf hardis:org:files:export"
6907
+ "$ sf hardis:org:fix:listviewmine",
6908
+ "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
6646
6909
  ],
6647
6910
  "flags": {
6648
6911
  "json": {
@@ -6660,37 +6923,10 @@
6660
6923
  "multiple": false,
6661
6924
  "type": "option"
6662
6925
  },
6663
- "path": {
6664
- "char": "p",
6665
- "description": "Path to the file export project",
6666
- "name": "path",
6667
- "hasDynamicHelp": false,
6668
- "multiple": false,
6669
- "type": "option"
6670
- },
6671
- "chunksize": {
6672
- "char": "c",
6673
- "description": "Number of records to add in a chunk before it is processed",
6674
- "name": "chunksize",
6675
- "default": 1000,
6676
- "hasDynamicHelp": false,
6677
- "multiple": false,
6678
- "type": "option"
6679
- },
6680
- "polltimeout": {
6681
- "char": "t",
6682
- "description": "Timeout in MS for Bulk API calls",
6683
- "name": "polltimeout",
6684
- "default": 300000,
6685
- "hasDynamicHelp": false,
6686
- "multiple": false,
6687
- "type": "option"
6688
- },
6689
- "startchunknumber": {
6690
- "char": "s",
6691
- "description": "Chunk number to start from",
6692
- "name": "startchunknumber",
6693
- "default": 0,
6926
+ "listviews": {
6927
+ "char": "l",
6928
+ "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
6929
+ "name": "listviews",
6694
6930
  "hasDynamicHelp": false,
6695
6931
  "multiple": false,
6696
6932
  "type": "option"
@@ -6733,57 +6969,59 @@
6733
6969
  },
6734
6970
  "hasDynamicHelp": true,
6735
6971
  "hiddenAliases": [],
6736
- "id": "hardis:org:files:export",
6972
+ "id": "hardis:org:fix:listviewmine",
6737
6973
  "pluginAlias": "sfdx-hardis",
6738
6974
  "pluginName": "sfdx-hardis",
6739
6975
  "pluginType": "core",
6740
6976
  "strict": true,
6741
6977
  "enableJsonFlag": true,
6742
- "title": "Export files",
6743
- "requiresProject": false,
6978
+ "title": "Fix listviews with ",
6979
+ "requiresProject": true,
6744
6980
  "isESM": true,
6745
6981
  "relativePath": [
6746
6982
  "lib",
6747
6983
  "commands",
6748
6984
  "hardis",
6749
6985
  "org",
6750
- "files",
6751
- "export.js"
6986
+ "fix",
6987
+ "listviewmine.js"
6752
6988
  ],
6753
6989
  "aliasPermutations": [],
6754
6990
  "permutations": [
6755
- "hardis:org:files:export",
6756
- "org:hardis:files:export",
6757
- "org:files:hardis:export",
6758
- "org:files:export:hardis",
6759
- "hardis:files:org:export",
6760
- "files:hardis:org:export",
6761
- "files:org:hardis:export",
6762
- "files:org:export:hardis",
6763
- "hardis:files:export:org",
6764
- "files:hardis:export:org",
6765
- "files:export:hardis:org",
6766
- "files:export:org:hardis",
6767
- "hardis:org:export:files",
6768
- "org:hardis:export:files",
6769
- "org:export:hardis:files",
6770
- "org:export:files:hardis",
6771
- "hardis:export:org:files",
6772
- "export:hardis:org:files",
6773
- "export:org:hardis:files",
6774
- "export:org:files:hardis",
6775
- "hardis:export:files:org",
6776
- "export:hardis:files:org",
6777
- "export:files:hardis:org",
6778
- "export:files:org:hardis"
6991
+ "hardis:org:fix:listviewmine",
6992
+ "org:hardis:fix:listviewmine",
6993
+ "org:fix:hardis:listviewmine",
6994
+ "org:fix:listviewmine:hardis",
6995
+ "hardis:fix:org:listviewmine",
6996
+ "fix:hardis:org:listviewmine",
6997
+ "fix:org:hardis:listviewmine",
6998
+ "fix:org:listviewmine:hardis",
6999
+ "hardis:fix:listviewmine:org",
7000
+ "fix:hardis:listviewmine:org",
7001
+ "fix:listviewmine:hardis:org",
7002
+ "fix:listviewmine:org:hardis",
7003
+ "hardis:org:listviewmine:fix",
7004
+ "org:hardis:listviewmine:fix",
7005
+ "org:listviewmine:hardis:fix",
7006
+ "org:listviewmine:fix:hardis",
7007
+ "hardis:listviewmine:org:fix",
7008
+ "listviewmine:hardis:org:fix",
7009
+ "listviewmine:org:hardis:fix",
7010
+ "listviewmine:org:fix:hardis",
7011
+ "hardis:listviewmine:fix:org",
7012
+ "listviewmine:hardis:fix:org",
7013
+ "listviewmine:fix:hardis:org",
7014
+ "listviewmine:fix:org:hardis"
6779
7015
  ]
6780
7016
  },
6781
- "hardis:org:files:import": {
7017
+ "hardis:org:generate:packagexmlfull": {
6782
7018
  "aliases": [],
6783
7019
  "args": {},
6784
- "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",
7020
+ "description": "\n## Command Behavior\n\n**Generates a comprehensive `package.xml` file for a Salesforce org, including all metadata components, even managed ones.**\n\nThis command is essential for various Salesforce development and administration tasks, especially when you need a complete snapshot of an org's metadata. It goes beyond typical source tracking by including managed package components, which is crucial for understanding the full metadata footprint of an org.\n\nKey functionalities:\n\n- **Full Org Metadata Retrieval:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a complete list of all metadata types and their members.\n- **Managed Package Inclusion:** Unlike standard source retrieval, this command explicitly includes metadata from managed packages, providing a truly comprehensive `package.xml`.\n- **Customizable Output:** Allows you to specify the output file path for the generated `package.xml`.\n- **Interactive Org Selection:** If no target org is specified, it interactively prompts the user to choose an org. (or use --no-prompt to skip this step)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce Metadata API Interaction:** It leverages the Salesforce Metadata API to list all available metadata types and then retrieve all components for each type.\n- **`buildOrgManifest` Utility:** The core logic for querying the org's metadata and constructing the `package.xml` is encapsulated within the `buildOrgManifest` utility function.\n- **XML Generation:** It dynamically builds the XML structure of the `package.xml` file, including the `types` and `members` elements for all retrieved metadata.\n- **File System Operations:** It writes the generated `package.xml` file to the specified output path.\n- **Interactive Prompts:** Uses `promptOrgUsernameDefault` to guide the user in selecting the target Salesforce org.\n</details>\n",
6785
7021
  "examples": [
6786
- "$ sf hardis:org:files:import"
7022
+ "$ sf hardis:org:generate:packagexmlfull",
7023
+ "$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
7024
+ "$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
6787
7025
  ],
6788
7026
  "flags": {
6789
7027
  "json": {
@@ -6801,21 +7039,13 @@
6801
7039
  "multiple": false,
6802
7040
  "type": "option"
6803
7041
  },
6804
- "path": {
6805
- "char": "p",
6806
- "description": "Path to the file export project",
6807
- "name": "path",
7042
+ "outputfile": {
7043
+ "description": "Output package.xml file",
7044
+ "name": "outputfile",
6808
7045
  "hasDynamicHelp": false,
6809
7046
  "multiple": false,
6810
7047
  "type": "option"
6811
7048
  },
6812
- "overwrite": {
6813
- "char": "f",
6814
- "description": "Override existing files (doubles the number of API calls)",
6815
- "name": "overwrite",
6816
- "allowNo": false,
6817
- "type": "boolean"
6818
- },
6819
7049
  "debug": {
6820
7050
  "char": "d",
6821
7051
  "description": "Activate debug mode (more logs)",
@@ -6823,6 +7053,13 @@
6823
7053
  "allowNo": false,
6824
7054
  "type": "boolean"
6825
7055
  },
7056
+ "no-prompt": {
7057
+ "char": "n",
7058
+ "description": "Do not prompt for org username, use the default one",
7059
+ "name": "no-prompt",
7060
+ "allowNo": false,
7061
+ "type": "boolean"
7062
+ },
6826
7063
  "websocket": {
6827
7064
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
6828
7065
  "name": "websocket",
@@ -6854,13 +7091,13 @@
6854
7091
  },
6855
7092
  "hasDynamicHelp": true,
6856
7093
  "hiddenAliases": [],
6857
- "id": "hardis:org:files:import",
7094
+ "id": "hardis:org:generate:packagexmlfull",
6858
7095
  "pluginAlias": "sfdx-hardis",
6859
7096
  "pluginName": "sfdx-hardis",
6860
7097
  "pluginType": "core",
6861
7098
  "strict": true,
6862
7099
  "enableJsonFlag": true,
6863
- "title": "Import files",
7100
+ "title": "Generate Full Org package.xml",
6864
7101
  "requiresProject": false,
6865
7102
  "isESM": true,
6866
7103
  "relativePath": [
@@ -6868,44 +7105,43 @@
6868
7105
  "commands",
6869
7106
  "hardis",
6870
7107
  "org",
6871
- "files",
6872
- "import.js"
7108
+ "generate",
7109
+ "packagexmlfull.js"
6873
7110
  ],
6874
7111
  "aliasPermutations": [],
6875
7112
  "permutations": [
6876
- "hardis:org:files:import",
6877
- "org:hardis:files:import",
6878
- "org:files:hardis:import",
6879
- "org:files:import:hardis",
6880
- "hardis:files:org:import",
6881
- "files:hardis:org:import",
6882
- "files:org:hardis:import",
6883
- "files:org:import:hardis",
6884
- "hardis:files:import:org",
6885
- "files:hardis:import:org",
6886
- "files:import:hardis:org",
6887
- "files:import:org:hardis",
6888
- "hardis:org:import:files",
6889
- "org:hardis:import:files",
6890
- "org:import:hardis:files",
6891
- "org:import:files:hardis",
6892
- "hardis:import:org:files",
6893
- "import:hardis:org:files",
6894
- "import:org:hardis:files",
6895
- "import:org:files:hardis",
6896
- "hardis:import:files:org",
6897
- "import:hardis:files:org",
6898
- "import:files:hardis:org",
6899
- "import:files:org:hardis"
7113
+ "hardis:org:generate:packagexmlfull",
7114
+ "org:hardis:generate:packagexmlfull",
7115
+ "org:generate:hardis:packagexmlfull",
7116
+ "org:generate:packagexmlfull:hardis",
7117
+ "hardis:generate:org:packagexmlfull",
7118
+ "generate:hardis:org:packagexmlfull",
7119
+ "generate:org:hardis:packagexmlfull",
7120
+ "generate:org:packagexmlfull:hardis",
7121
+ "hardis:generate:packagexmlfull:org",
7122
+ "generate:hardis:packagexmlfull:org",
7123
+ "generate:packagexmlfull:hardis:org",
7124
+ "generate:packagexmlfull:org:hardis",
7125
+ "hardis:org:packagexmlfull:generate",
7126
+ "org:hardis:packagexmlfull:generate",
7127
+ "org:packagexmlfull:hardis:generate",
7128
+ "org:packagexmlfull:generate:hardis",
7129
+ "hardis:packagexmlfull:org:generate",
7130
+ "packagexmlfull:hardis:org:generate",
7131
+ "packagexmlfull:org:hardis:generate",
7132
+ "packagexmlfull:org:generate:hardis",
7133
+ "hardis:packagexmlfull:generate:org",
7134
+ "packagexmlfull:hardis:generate:org",
7135
+ "packagexmlfull:generate:hardis:org",
7136
+ "packagexmlfull:generate:org:hardis"
6900
7137
  ]
6901
7138
  },
6902
- "hardis:org:fix:listviewmine": {
7139
+ "hardis:org:monitor:all": {
6903
7140
  "aliases": [],
6904
7141
  "args": {},
6905
- "description": "Fix listviews whose scope Mine has been replaced by Everything\n\n[![Invalid scope:Mine, not allowed ? Deploy your ListViews anyway !](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-invalid-scope-mine.jpg)](https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7)\n\nList of ListViews can be:\n\n- read from .sfdx-hardis.yml file in property **listViewsToSetToMine**\n- sent in argument listviews\n\nNote: property **listViewsToSetToMine** can be auto-generated by command hardis:work:save if .sfdx-hardis.yml contains the following configuration\n\n```yaml\nautoCleanTypes:\n - listViewsMine\n```\n\n- Example of sfdx-hardis.yml property `listViewsToSetToMine`:\n\n```yaml\nlistViewsToSetToMine:\n - \"force-app/main/default/objects/Operation__c/listViews/MyCurrentOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Operation__c/listViews/MyFinalizedOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/Default_Opportunity_Pipeline.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MyCurrentSubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MySubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Account/listViews/MyActivePartners.listView-meta.xml\"\n```\n\n- If manually written, this could also be:\n\n```yaml\nlistViewsToSetToMine:\n - \"Operation__c:MyCurrentOperations\"\n - \"Operation__c:MyFinalizedOperations\"\n - \"Opportunity:Default_Opportunity_Pipeline\"\n - \"Opportunity:MyCurrentSubscriptions\"\n - \"Opportunity:MySubscriptions\"\n - \"Account:MyActivePartners\"\n```\n\nTroubleshooting: if you need to run this command from an alpine-linux based docker image, use this workaround in your dockerfile:\n\n```dockerfile\n# Do not use puppeteer embedded chromium\nRUN apk add --update --no-cache chromium\nENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=\"true\"\nENV CHROMIUM_PATH=\"/usr/bin/chromium-browser\"\nENV PUPPETEER_EXECUTABLE_PATH=\"$\\{CHROMIUM_PATH}\" // remove \\ before {\n```\n",
7142
+ "description": "Monitor org, generate reports and sends notifications\n\nYou can disable some commands defining either a **monitoringDisable** property in `.sfdx-hardis.yml`, or a comma separated list in env variable **MONITORING_DISABLE**\n\nExample in .sfdx-hardis.yml:\n \n```yaml\nmonitoringDisable:\n - METADATA_STATUS\n - MISSING_ATTRIBUTES\n - UNUSED_METADATAS\n```\n \nExample in env var:\n\n```sh\nMONITORING_DISABLE=METADATA_STATUS,MISSING_ATTRIBUTES,UNUSED_METADATAS\n```\n\nA [default list of monitoring commands](https://sfdx-hardis.cloudity.com/salesforce-monitoring-home/#monitoring-commands) is used, if you want to override it you can define property **monitoringCommands** in your .sfdx-hardis.yml file\n\nExample:\n\n```yaml\nmonitoringCommands:\n - title: My Custom command\n command: sf my:custom:command\n - title: My Custom command 2\n command: sf my:other:custom:command\n```\n\nYou can force the daily run of all commands by defining env var `MONITORING_IGNORE_FREQUENCY=true`\n\nThe default list of commands is the following:\n\n| Key | Description | Command | Frequency |\n| :---: | :---- | :---- | :-----: |\n| [AUDIT_TRAIL](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | Detect suspect setup actions in major org | [sf hardis:org:diagnose:audittrail](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | daily |\n| [LEGACY_API](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | Detect calls to deprecated API versions | [sf hardis:org:diagnose:legacyapi](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | daily |\n| [ORG_LIMITS](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | Detect if org limits are close to be reached | [sf hardis:org:monitor:limits](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | daily |\n| [LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | Extract licenses information | [sf hardis:org:diagnose:licenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | weekly |\n| [LINT_ACCESS](https://sfdx-hardis.cloudity.com/hardis/lint/access) | Detect custom elements with no access rights defined in permission sets | [sf hardis:lint:access](https://sfdx-hardis.cloudity.com/hardis/lint/access) | weekly |\n| [UNUSED_LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | Detect permission set licenses that are assigned to users that do not need them | [sf hardis:org:diagnose:unusedlicenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | weekly |\n| [UNUSED_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users without recent logins | [sf hardis:org:diagnose:unusedusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ACTIVE_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users with recent logins | [sf hardis:org:diagnose:unusedusers --returnactiveusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ORG_INFO](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | Get org info + SF instance info + next major upgrade date | [sf hardis:org:diagnose:instanceupgrade](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | weekly |\n| [RELEASE_UPDATES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | Gather warnings about incoming and overdue Release Updates | [sf hardis:org:diagnose:releaseupdates](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | weekly |\n| [UNUSED_METADATAS](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | Detect custom labels and custom permissions that are not in use | [sf hardis:lint:unusedmetadatas](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | weekly |\n| [UNUSED_APEX_CLASSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | Detect unused Apex classes in an org | [sf hardis:org:diagnose:unused-apex-classes](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | weekly |\n| [CONNECTED_APPS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | Detect unused Connected Apps in an org | [sf hardis:org:diagnose:unused-connected-apps](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | weekly |\n| [METADATA_STATUS](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | Detect inactive metadata | [sf hardis:lint:metadatastatus](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | weekly |\n| [MISSING_ATTRIBUTES](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | Detect missing description on custom field | [sf hardis:lint:missingattributes](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | weekly |\n\n",
6906
7143
  "examples": [
6907
- "$ sf hardis:org:fix:listviewmine",
6908
- "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
7144
+ "$ sf hardis:org:monitor:all"
6909
7145
  ],
6910
7146
  "flags": {
6911
7147
  "json": {
@@ -6923,14 +7159,6 @@
6923
7159
  "multiple": false,
6924
7160
  "type": "option"
6925
7161
  },
6926
- "listviews": {
6927
- "char": "l",
6928
- "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
6929
- "name": "listviews",
6930
- "hasDynamicHelp": false,
6931
- "multiple": false,
6932
- "type": "option"
6933
- },
6934
7162
  "debug": {
6935
7163
  "char": "d",
6936
7164
  "description": "Activate debug mode (more logs)",
@@ -6969,235 +7197,7 @@
6969
7197
  },
6970
7198
  "hasDynamicHelp": true,
6971
7199
  "hiddenAliases": [],
6972
- "id": "hardis:org:fix:listviewmine",
6973
- "pluginAlias": "sfdx-hardis",
6974
- "pluginName": "sfdx-hardis",
6975
- "pluginType": "core",
6976
- "strict": true,
6977
- "enableJsonFlag": true,
6978
- "title": "Fix listviews with ",
6979
- "requiresProject": true,
6980
- "isESM": true,
6981
- "relativePath": [
6982
- "lib",
6983
- "commands",
6984
- "hardis",
6985
- "org",
6986
- "fix",
6987
- "listviewmine.js"
6988
- ],
6989
- "aliasPermutations": [],
6990
- "permutations": [
6991
- "hardis:org:fix:listviewmine",
6992
- "org:hardis:fix:listviewmine",
6993
- "org:fix:hardis:listviewmine",
6994
- "org:fix:listviewmine:hardis",
6995
- "hardis:fix:org:listviewmine",
6996
- "fix:hardis:org:listviewmine",
6997
- "fix:org:hardis:listviewmine",
6998
- "fix:org:listviewmine:hardis",
6999
- "hardis:fix:listviewmine:org",
7000
- "fix:hardis:listviewmine:org",
7001
- "fix:listviewmine:hardis:org",
7002
- "fix:listviewmine:org:hardis",
7003
- "hardis:org:listviewmine:fix",
7004
- "org:hardis:listviewmine:fix",
7005
- "org:listviewmine:hardis:fix",
7006
- "org:listviewmine:fix:hardis",
7007
- "hardis:listviewmine:org:fix",
7008
- "listviewmine:hardis:org:fix",
7009
- "listviewmine:org:hardis:fix",
7010
- "listviewmine:org:fix:hardis",
7011
- "hardis:listviewmine:fix:org",
7012
- "listviewmine:hardis:fix:org",
7013
- "listviewmine:fix:hardis:org",
7014
- "listviewmine:fix:org:hardis"
7015
- ]
7016
- },
7017
- "hardis:org:generate:packagexmlfull": {
7018
- "aliases": [],
7019
- "args": {},
7020
- "description": "\n## Command Behavior\n\n**Generates a comprehensive `package.xml` file for a Salesforce org, including all metadata components, even managed ones.**\n\nThis command is essential for various Salesforce development and administration tasks, especially when you need a complete snapshot of an org's metadata. It goes beyond typical source tracking by including managed package components, which is crucial for understanding the full metadata footprint of an org.\n\nKey functionalities:\n\n- **Full Org Metadata Retrieval:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a complete list of all metadata types and their members.\n- **Managed Package Inclusion:** Unlike standard source retrieval, this command explicitly includes metadata from managed packages, providing a truly comprehensive `package.xml`.\n- **Customizable Output:** Allows you to specify the output file path for the generated `package.xml`.\n- **Interactive Org Selection:** If no target org is specified, it interactively prompts the user to choose an org. (or use --no-prompt to skip this step)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce Metadata API Interaction:** It leverages the Salesforce Metadata API to list all available metadata types and then retrieve all components for each type.\n- **`buildOrgManifest` Utility:** The core logic for querying the org's metadata and constructing the `package.xml` is encapsulated within the `buildOrgManifest` utility function.\n- **XML Generation:** It dynamically builds the XML structure of the `package.xml` file, including the `types` and `members` elements for all retrieved metadata.\n- **File System Operations:** It writes the generated `package.xml` file to the specified output path.\n- **Interactive Prompts:** Uses `promptOrgUsernameDefault` to guide the user in selecting the target Salesforce org.\n</details>\n",
7021
- "examples": [
7022
- "$ sf hardis:org:generate:packagexmlfull",
7023
- "$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
7024
- "$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
7025
- ],
7026
- "flags": {
7027
- "json": {
7028
- "description": "Format output as json.",
7029
- "helpGroup": "GLOBAL",
7030
- "name": "json",
7031
- "allowNo": false,
7032
- "type": "boolean"
7033
- },
7034
- "flags-dir": {
7035
- "helpGroup": "GLOBAL",
7036
- "name": "flags-dir",
7037
- "summary": "Import flag values from a directory.",
7038
- "hasDynamicHelp": false,
7039
- "multiple": false,
7040
- "type": "option"
7041
- },
7042
- "outputfile": {
7043
- "description": "Output package.xml file",
7044
- "name": "outputfile",
7045
- "hasDynamicHelp": false,
7046
- "multiple": false,
7047
- "type": "option"
7048
- },
7049
- "debug": {
7050
- "char": "d",
7051
- "description": "Activate debug mode (more logs)",
7052
- "name": "debug",
7053
- "allowNo": false,
7054
- "type": "boolean"
7055
- },
7056
- "no-prompt": {
7057
- "char": "n",
7058
- "description": "Do not prompt for org username, use the default one",
7059
- "name": "no-prompt",
7060
- "allowNo": false,
7061
- "type": "boolean"
7062
- },
7063
- "websocket": {
7064
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7065
- "name": "websocket",
7066
- "hasDynamicHelp": false,
7067
- "multiple": false,
7068
- "type": "option"
7069
- },
7070
- "skipauth": {
7071
- "description": "Skip authentication check when a default username is required",
7072
- "name": "skipauth",
7073
- "allowNo": false,
7074
- "type": "boolean"
7075
- },
7076
- "target-org": {
7077
- "aliases": [
7078
- "targetusername",
7079
- "u"
7080
- ],
7081
- "char": "o",
7082
- "deprecateAliases": true,
7083
- "name": "target-org",
7084
- "noCacheDefault": true,
7085
- "required": true,
7086
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7087
- "hasDynamicHelp": true,
7088
- "multiple": false,
7089
- "type": "option"
7090
- }
7091
- },
7092
- "hasDynamicHelp": true,
7093
- "hiddenAliases": [],
7094
- "id": "hardis:org:generate:packagexmlfull",
7095
- "pluginAlias": "sfdx-hardis",
7096
- "pluginName": "sfdx-hardis",
7097
- "pluginType": "core",
7098
- "strict": true,
7099
- "enableJsonFlag": true,
7100
- "title": "Generate Full Org package.xml",
7101
- "requiresProject": false,
7102
- "isESM": true,
7103
- "relativePath": [
7104
- "lib",
7105
- "commands",
7106
- "hardis",
7107
- "org",
7108
- "generate",
7109
- "packagexmlfull.js"
7110
- ],
7111
- "aliasPermutations": [],
7112
- "permutations": [
7113
- "hardis:org:generate:packagexmlfull",
7114
- "org:hardis:generate:packagexmlfull",
7115
- "org:generate:hardis:packagexmlfull",
7116
- "org:generate:packagexmlfull:hardis",
7117
- "hardis:generate:org:packagexmlfull",
7118
- "generate:hardis:org:packagexmlfull",
7119
- "generate:org:hardis:packagexmlfull",
7120
- "generate:org:packagexmlfull:hardis",
7121
- "hardis:generate:packagexmlfull:org",
7122
- "generate:hardis:packagexmlfull:org",
7123
- "generate:packagexmlfull:hardis:org",
7124
- "generate:packagexmlfull:org:hardis",
7125
- "hardis:org:packagexmlfull:generate",
7126
- "org:hardis:packagexmlfull:generate",
7127
- "org:packagexmlfull:hardis:generate",
7128
- "org:packagexmlfull:generate:hardis",
7129
- "hardis:packagexmlfull:org:generate",
7130
- "packagexmlfull:hardis:org:generate",
7131
- "packagexmlfull:org:hardis:generate",
7132
- "packagexmlfull:org:generate:hardis",
7133
- "hardis:packagexmlfull:generate:org",
7134
- "packagexmlfull:hardis:generate:org",
7135
- "packagexmlfull:generate:hardis:org",
7136
- "packagexmlfull:generate:org:hardis"
7137
- ]
7138
- },
7139
- "hardis:org:monitor:all": {
7140
- "aliases": [],
7141
- "args": {},
7142
- "description": "Monitor org, generate reports and sends notifications\n\nYou can disable some commands defining either a **monitoringDisable** property in `.sfdx-hardis.yml`, or a comma separated list in env variable **MONITORING_DISABLE**\n\nExample in .sfdx-hardis.yml:\n \n```yaml\nmonitoringDisable:\n - METADATA_STATUS\n - MISSING_ATTRIBUTES\n - UNUSED_METADATAS\n```\n \nExample in env var:\n\n```sh\nMONITORING_DISABLE=METADATA_STATUS,MISSING_ATTRIBUTES,UNUSED_METADATAS\n```\n\nA [default list of monitoring commands](https://sfdx-hardis.cloudity.com/salesforce-monitoring-home/#monitoring-commands) is used, if you want to override it you can define property **monitoringCommands** in your .sfdx-hardis.yml file\n\nExample:\n\n```yaml\nmonitoringCommands:\n - title: My Custom command\n command: sf my:custom:command\n - title: My Custom command 2\n command: sf my:other:custom:command\n```\n\nYou can force the daily run of all commands by defining env var `MONITORING_IGNORE_FREQUENCY=true`\n\nThe default list of commands is the following:\n\n| Key | Description | Command | Frequency |\n| :---: | :---- | :---- | :-----: |\n| [AUDIT_TRAIL](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | Detect suspect setup actions in major org | [sf hardis:org:diagnose:audittrail](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | daily |\n| [LEGACY_API](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | Detect calls to deprecated API versions | [sf hardis:org:diagnose:legacyapi](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | daily |\n| [ORG_LIMITS](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | Detect if org limits are close to be reached | [sf hardis:org:monitor:limits](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | daily |\n| [LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | Extract licenses information | [sf hardis:org:diagnose:licenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | weekly |\n| [LINT_ACCESS](https://sfdx-hardis.cloudity.com/hardis/lint/access) | Detect custom elements with no access rights defined in permission sets | [sf hardis:lint:access](https://sfdx-hardis.cloudity.com/hardis/lint/access) | weekly |\n| [UNUSED_LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | Detect permission set licenses that are assigned to users that do not need them | [sf hardis:org:diagnose:unusedlicenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | weekly |\n| [UNUSED_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users without recent logins | [sf hardis:org:diagnose:unusedusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ACTIVE_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users with recent logins | [sf hardis:org:diagnose:unusedusers --returnactiveusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ORG_INFO](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | Get org info + SF instance info + next major upgrade date | [sf hardis:org:diagnose:instanceupgrade](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | weekly |\n| [RELEASE_UPDATES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | Gather warnings about incoming and overdue Release Updates | [sf hardis:org:diagnose:releaseupdates](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | weekly |\n| [UNUSED_METADATAS](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | Detect custom labels and custom permissions that are not in use | [sf hardis:lint:unusedmetadatas](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | weekly |\n| [UNUSED_APEX_CLASSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | Detect unused Apex classes in an org | [sf hardis:org:diagnose:unused-apex-classes](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | weekly |\n| [CONNECTED_APPS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | Detect unused Connected Apps in an org | [sf hardis:org:diagnose:unused-connected-apps](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | weekly |\n| [METADATA_STATUS](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | Detect inactive metadata | [sf hardis:lint:metadatastatus](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | weekly |\n| [MISSING_ATTRIBUTES](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | Detect missing description on custom field | [sf hardis:lint:missingattributes](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | weekly |\n\n",
7143
- "examples": [
7144
- "$ sf hardis:org:monitor:all"
7145
- ],
7146
- "flags": {
7147
- "json": {
7148
- "description": "Format output as json.",
7149
- "helpGroup": "GLOBAL",
7150
- "name": "json",
7151
- "allowNo": false,
7152
- "type": "boolean"
7153
- },
7154
- "flags-dir": {
7155
- "helpGroup": "GLOBAL",
7156
- "name": "flags-dir",
7157
- "summary": "Import flag values from a directory.",
7158
- "hasDynamicHelp": false,
7159
- "multiple": false,
7160
- "type": "option"
7161
- },
7162
- "debug": {
7163
- "char": "d",
7164
- "description": "Activate debug mode (more logs)",
7165
- "name": "debug",
7166
- "allowNo": false,
7167
- "type": "boolean"
7168
- },
7169
- "websocket": {
7170
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7171
- "name": "websocket",
7172
- "hasDynamicHelp": false,
7173
- "multiple": false,
7174
- "type": "option"
7175
- },
7176
- "skipauth": {
7177
- "description": "Skip authentication check when a default username is required",
7178
- "name": "skipauth",
7179
- "allowNo": false,
7180
- "type": "boolean"
7181
- },
7182
- "target-org": {
7183
- "aliases": [
7184
- "targetusername",
7185
- "u"
7186
- ],
7187
- "char": "o",
7188
- "deprecateAliases": true,
7189
- "name": "target-org",
7190
- "noCacheDefault": true,
7191
- "required": true,
7192
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7193
- "hasDynamicHelp": true,
7194
- "multiple": false,
7195
- "type": "option"
7196
- }
7197
- },
7198
- "hasDynamicHelp": true,
7199
- "hiddenAliases": [],
7200
- "id": "hardis:org:monitor:all",
7200
+ "id": "hardis:org:monitor:all",
7201
7201
  "pluginAlias": "sfdx-hardis",
7202
7202
  "pluginName": "sfdx-hardis",
7203
7203
  "pluginType": "core",
@@ -9512,12 +9512,12 @@
9512
9512
  "remotesites:audit:project:hardis"
9513
9513
  ]
9514
9514
  },
9515
- "hardis:project:clean:emptyitems": {
9515
+ "hardis:project:configure:auth": {
9516
9516
  "aliases": [],
9517
9517
  "args": {},
9518
- "description": "\n## Command Behavior\n\n**Removes empty or irrelevant metadata items from your Salesforce DX project sources.**\n\nThis command helps maintain a clean and efficient Salesforce codebase by deleting metadata files that are essentially empty or contain no meaningful configuration. These files can sometimes be generated during retrieval processes or remain after refactoring, contributing to unnecessary clutter in your project.\n\nKey functionalities:\n\n- **Targeted Cleaning:** Specifically targets and removes empty instances of:\n - Global Value Set Translations (`.globalValueSetTranslation-meta.xml`)\n - Standard Value Sets (`.standardValueSet-meta.xml`)\n - Sharing Rules (`.sharingRules-meta.xml`)\n- **Content-Based Deletion:** It checks the XML content of these files for the presence of specific tags (e.g., `valueTranslation` for Global Value Set Translations) to determine if they are truly empty or lack relevant data.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find files matching predefined patterns for Global Value Set Translations, Standard Value Sets, and Sharing Rules within the specified root folder (defaults to `force-app`).\n- **XML Parsing:** For each matching file, it reads and parses the XML content using `parseXmlFile`.\n- **Content Validation:** It then checks the parsed XML object for the existence of specific nested properties (e.g., `xmlContent.GlobalValueSetTranslation.valueTranslation`). If these properties are missing or empty, the file is considered empty.\n- **File Deletion:** If a file is determined to be empty, it is removed from the file system using `fs.remove`.\n- **Logging:** Provides clear messages about which files are being removed and a summary of the total number of items cleaned.\n</details>\n",
9518
+ "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",
9519
9519
  "examples": [
9520
- "$ sf hardis:project:clean:emptyitems"
9520
+ "$ sf hardis:project:configure:auth"
9521
9521
  ],
9522
9522
  "flags": {
9523
9523
  "json": {
@@ -9535,14 +9535,12 @@
9535
9535
  "multiple": false,
9536
9536
  "type": "option"
9537
9537
  },
9538
- "folder": {
9539
- "char": "f",
9540
- "description": "Root folder",
9541
- "name": "folder",
9542
- "default": "force-app",
9543
- "hasDynamicHelp": false,
9544
- "multiple": false,
9545
- "type": "option"
9538
+ "devhub": {
9539
+ "char": "b",
9540
+ "description": "Configure project DevHub",
9541
+ "name": "devhub",
9542
+ "allowNo": false,
9543
+ "type": "boolean"
9546
9544
  },
9547
9545
  "debug": {
9548
9546
  "char": "d",
@@ -9563,48 +9561,179 @@
9563
9561
  "name": "skipauth",
9564
9562
  "allowNo": false,
9565
9563
  "type": "boolean"
9564
+ },
9565
+ "target-org": {
9566
+ "aliases": [
9567
+ "targetusername",
9568
+ "u"
9569
+ ],
9570
+ "char": "o",
9571
+ "deprecateAliases": true,
9572
+ "name": "target-org",
9573
+ "noCacheDefault": true,
9574
+ "summary": "Username or alias of the target org.",
9575
+ "hasDynamicHelp": true,
9576
+ "multiple": false,
9577
+ "type": "option"
9578
+ },
9579
+ "target-dev-hub": {
9580
+ "aliases": [
9581
+ "targetdevhubusername"
9582
+ ],
9583
+ "char": "v",
9584
+ "deprecateAliases": true,
9585
+ "name": "target-dev-hub",
9586
+ "noCacheDefault": true,
9587
+ "required": false,
9588
+ "summary": "Username or alias of the Dev Hub org.",
9589
+ "hasDynamicHelp": true,
9590
+ "multiple": false,
9591
+ "type": "option"
9566
9592
  }
9567
9593
  },
9568
- "hasDynamicHelp": false,
9594
+ "hasDynamicHelp": true,
9569
9595
  "hiddenAliases": [],
9570
- "id": "hardis:project:clean:emptyitems",
9596
+ "id": "hardis:project:configure:auth",
9571
9597
  "pluginAlias": "sfdx-hardis",
9572
9598
  "pluginName": "sfdx-hardis",
9573
9599
  "pluginType": "core",
9574
9600
  "strict": true,
9575
9601
  "enableJsonFlag": true,
9576
- "title": "Clean retrieved empty items in dx sources",
9577
- "requiresProject": true,
9602
+ "title": "Configure authentication",
9603
+ "requiresProject": false,
9604
+ "requiresDependencies": [
9605
+ "openssl"
9606
+ ],
9578
9607
  "isESM": true,
9579
9608
  "relativePath": [
9580
9609
  "lib",
9581
9610
  "commands",
9582
9611
  "hardis",
9583
9612
  "project",
9584
- "clean",
9585
- "emptyitems.js"
9613
+ "configure",
9614
+ "auth.js"
9586
9615
  ],
9587
9616
  "aliasPermutations": [],
9588
9617
  "permutations": [
9589
- "hardis:project:clean:emptyitems",
9590
- "project:hardis:clean:emptyitems",
9591
- "project:clean:hardis:emptyitems",
9592
- "project:clean:emptyitems:hardis",
9593
- "hardis:clean:project:emptyitems",
9594
- "clean:hardis:project:emptyitems",
9595
- "clean:project:hardis:emptyitems",
9596
- "clean:project:emptyitems:hardis",
9597
- "hardis:clean:emptyitems:project",
9598
- "clean:hardis:emptyitems:project",
9599
- "clean:emptyitems:hardis:project",
9600
- "clean:emptyitems:project:hardis",
9601
- "hardis:project:emptyitems:clean",
9602
- "project:hardis:emptyitems:clean",
9603
- "project:emptyitems:hardis:clean",
9604
- "project:emptyitems:clean:hardis",
9605
- "hardis:emptyitems:project:clean",
9606
- "emptyitems:hardis:project:clean",
9607
- "emptyitems:project:hardis:clean",
9618
+ "hardis:project:configure:auth",
9619
+ "project:hardis:configure:auth",
9620
+ "project:configure:hardis:auth",
9621
+ "project:configure:auth:hardis",
9622
+ "hardis:configure:project:auth",
9623
+ "configure:hardis:project:auth",
9624
+ "configure:project:hardis:auth",
9625
+ "configure:project:auth:hardis",
9626
+ "hardis:configure:auth:project",
9627
+ "configure:hardis:auth:project",
9628
+ "configure:auth:hardis:project",
9629
+ "configure:auth:project:hardis",
9630
+ "hardis:project:auth:configure",
9631
+ "project:hardis:auth:configure",
9632
+ "project:auth:hardis:configure",
9633
+ "project:auth:configure:hardis",
9634
+ "hardis:auth:project:configure",
9635
+ "auth:hardis:project:configure",
9636
+ "auth:project:hardis:configure",
9637
+ "auth:project:configure:hardis",
9638
+ "hardis:auth:configure:project",
9639
+ "auth:hardis:configure:project",
9640
+ "auth:configure:hardis:project",
9641
+ "auth:configure:project:hardis"
9642
+ ]
9643
+ },
9644
+ "hardis:project:clean:emptyitems": {
9645
+ "aliases": [],
9646
+ "args": {},
9647
+ "description": "\n## Command Behavior\n\n**Removes empty or irrelevant metadata items from your Salesforce DX project sources.**\n\nThis command helps maintain a clean and efficient Salesforce codebase by deleting metadata files that are essentially empty or contain no meaningful configuration. These files can sometimes be generated during retrieval processes or remain after refactoring, contributing to unnecessary clutter in your project.\n\nKey functionalities:\n\n- **Targeted Cleaning:** Specifically targets and removes empty instances of:\n - Global Value Set Translations (`.globalValueSetTranslation-meta.xml`)\n - Standard Value Sets (`.standardValueSet-meta.xml`)\n - Sharing Rules (`.sharingRules-meta.xml`)\n- **Content-Based Deletion:** It checks the XML content of these files for the presence of specific tags (e.g., `valueTranslation` for Global Value Set Translations) to determine if they are truly empty or lack relevant data.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find files matching predefined patterns for Global Value Set Translations, Standard Value Sets, and Sharing Rules within the specified root folder (defaults to `force-app`).\n- **XML Parsing:** For each matching file, it reads and parses the XML content using `parseXmlFile`.\n- **Content Validation:** It then checks the parsed XML object for the existence of specific nested properties (e.g., `xmlContent.GlobalValueSetTranslation.valueTranslation`). If these properties are missing or empty, the file is considered empty.\n- **File Deletion:** If a file is determined to be empty, it is removed from the file system using `fs.remove`.\n- **Logging:** Provides clear messages about which files are being removed and a summary of the total number of items cleaned.\n</details>\n",
9648
+ "examples": [
9649
+ "$ sf hardis:project:clean:emptyitems"
9650
+ ],
9651
+ "flags": {
9652
+ "json": {
9653
+ "description": "Format output as json.",
9654
+ "helpGroup": "GLOBAL",
9655
+ "name": "json",
9656
+ "allowNo": false,
9657
+ "type": "boolean"
9658
+ },
9659
+ "flags-dir": {
9660
+ "helpGroup": "GLOBAL",
9661
+ "name": "flags-dir",
9662
+ "summary": "Import flag values from a directory.",
9663
+ "hasDynamicHelp": false,
9664
+ "multiple": false,
9665
+ "type": "option"
9666
+ },
9667
+ "folder": {
9668
+ "char": "f",
9669
+ "description": "Root folder",
9670
+ "name": "folder",
9671
+ "default": "force-app",
9672
+ "hasDynamicHelp": false,
9673
+ "multiple": false,
9674
+ "type": "option"
9675
+ },
9676
+ "debug": {
9677
+ "char": "d",
9678
+ "description": "Activate debug mode (more logs)",
9679
+ "name": "debug",
9680
+ "allowNo": false,
9681
+ "type": "boolean"
9682
+ },
9683
+ "websocket": {
9684
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9685
+ "name": "websocket",
9686
+ "hasDynamicHelp": false,
9687
+ "multiple": false,
9688
+ "type": "option"
9689
+ },
9690
+ "skipauth": {
9691
+ "description": "Skip authentication check when a default username is required",
9692
+ "name": "skipauth",
9693
+ "allowNo": false,
9694
+ "type": "boolean"
9695
+ }
9696
+ },
9697
+ "hasDynamicHelp": false,
9698
+ "hiddenAliases": [],
9699
+ "id": "hardis:project:clean:emptyitems",
9700
+ "pluginAlias": "sfdx-hardis",
9701
+ "pluginName": "sfdx-hardis",
9702
+ "pluginType": "core",
9703
+ "strict": true,
9704
+ "enableJsonFlag": true,
9705
+ "title": "Clean retrieved empty items in dx sources",
9706
+ "requiresProject": true,
9707
+ "isESM": true,
9708
+ "relativePath": [
9709
+ "lib",
9710
+ "commands",
9711
+ "hardis",
9712
+ "project",
9713
+ "clean",
9714
+ "emptyitems.js"
9715
+ ],
9716
+ "aliasPermutations": [],
9717
+ "permutations": [
9718
+ "hardis:project:clean:emptyitems",
9719
+ "project:hardis:clean:emptyitems",
9720
+ "project:clean:hardis:emptyitems",
9721
+ "project:clean:emptyitems:hardis",
9722
+ "hardis:clean:project:emptyitems",
9723
+ "clean:hardis:project:emptyitems",
9724
+ "clean:project:hardis:emptyitems",
9725
+ "clean:project:emptyitems:hardis",
9726
+ "hardis:clean:emptyitems:project",
9727
+ "clean:hardis:emptyitems:project",
9728
+ "clean:emptyitems:hardis:project",
9729
+ "clean:emptyitems:project:hardis",
9730
+ "hardis:project:emptyitems:clean",
9731
+ "project:hardis:emptyitems:clean",
9732
+ "project:emptyitems:hardis:clean",
9733
+ "project:emptyitems:clean:hardis",
9734
+ "hardis:emptyitems:project:clean",
9735
+ "emptyitems:hardis:project:clean",
9736
+ "emptyitems:project:hardis:clean",
9608
9737
  "emptyitems:project:clean:hardis",
9609
9738
  "hardis:emptyitems:clean:project",
9610
9739
  "emptyitems:hardis:clean:project",
@@ -10997,12 +11126,14 @@
10997
11126
  "xml:clean:project:hardis"
10998
11127
  ]
10999
11128
  },
11000
- "hardis:project:configure:auth": {
11129
+ "hardis:project:deploy:notify": {
11001
11130
  "aliases": [],
11002
11131
  "args": {},
11003
- "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",
11132
+ "description": "Post notifications related to:\n\n- **Deployment simulation** _(use with --check-only)_\n\n- **Deployment process** _(to call only if your deployment is successful)_\n\n### Integrations\n\nAccording to the [integrations you configured](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integrations-home/), notifications can contain deployment information and [Flow Visual Git Diff](https://sfdx-hardis.cloudity.com/salesforce-deployment-assistant-home/#flow-visual-git-diff)\n\n - GitHub, Gitlab, Azure DevOps, Bitbucket comments on Pull Requests (including Flows Visual Git Diff)\n\n - Slack, Microsoft Teams, Email deployment summary after a successful deployment\n\n - JIRA tags and comments on tickets that just has been deployed\n\n![](https://sfdx-hardis.cloudity.com/assets/images/screenshot-jira-gitlab.jpg)\n\n![](https://sfdx-hardis.cloudity.com/assets/images/screenshot-jira-slack.jpg)\n\n### Flows Visual Git Diff\n\n- Visually show you the differences on a diagram\n\n- Display the update details without having to open any XML !\n\n🟩 = added\n\n🟥 = removed\n\n🟧 = updated\n\n![](https://sfdx-hardis.cloudity.com/assets/images/flow-visual-git-diff.jpg)\n\n![](https://sfdx-hardis.cloudity.com/assets/images/flow-visual-git-diff-2.jpg)\n\n### In custom CI/CD workflow\n\nExample of usage in a custom CI/CD pipeline:\n\n```bash\n# Disable exit-on-error temporarily\nset +e\n\n# Run the deploy command\nsf project deploy start [....]\nRET_CODE=$?\n\n# Re-enable exit-on-error\nset -e\n\n# Determine MYSTATUS based on return code\nif [ $RET_CODE -eq 0 ]; then\n MYSTATUS=\"valid\"\nelse\n MYSTATUS=\"invalid\"\nfi\n\n# Run the notify command with MYSTATUS\nsf hardis:project:deploy:notify --check-only --deploy-status \"$MYSTATUS\"\n```\n\n### Other usages\n\nThis command is for custom SF Cli pipelines, if you are a sfdx-hardis user, it is already embedded in sf hardis:deploy:smart.\n\nYou can also use [sfdx-hardis wrapper commands of SF deployment commands](https://sfdx-hardis.cloudity.com/salesforce-deployment-assistant-setup/#using-custom-cicd-pipeline)\n",
11004
11133
  "examples": [
11005
- "$ sf hardis:project:configure:auth"
11134
+ "$ sf hardis:project:deploy:notify --check-only --deploy-status valid --message \"This deployment check is valid\\n\\nYahooo !!\"",
11135
+ "$ sf hardis:project:deploy:notify --check-only --deploy-status invalid --message \"This deployment check has failed !\\n\\Oh no !!\"",
11136
+ "$ sf hardis:project:deploy:notify --deploy-status valid --message \"This deployment has been processed !\\n\\nYahooo !!\""
11006
11137
  ],
11007
11138
  "flags": {
11008
11139
  "json": {
@@ -11020,13 +11151,36 @@
11020
11151
  "multiple": false,
11021
11152
  "type": "option"
11022
11153
  },
11023
- "devhub": {
11024
- "char": "b",
11025
- "description": "Configure project DevHub",
11026
- "name": "devhub",
11154
+ "check-only": {
11155
+ "char": "c",
11156
+ "description": "Use this option to send notifications from a Deployment simulation job",
11157
+ "name": "check-only",
11027
11158
  "allowNo": false,
11028
11159
  "type": "boolean"
11029
11160
  },
11161
+ "deploy-status": {
11162
+ "char": "s",
11163
+ "description": "Send success, failure or unknown (default) to indicate if the deployment or deployment simulation is in success or not",
11164
+ "name": "deploy-status",
11165
+ "default": "unknown",
11166
+ "hasDynamicHelp": false,
11167
+ "multiple": false,
11168
+ "options": [
11169
+ "valid",
11170
+ "invalid",
11171
+ "unknown"
11172
+ ],
11173
+ "type": "option"
11174
+ },
11175
+ "message": {
11176
+ "char": "m",
11177
+ "description": "Custom message that you want to be added in notifications (string or markdown format)",
11178
+ "name": "message",
11179
+ "default": "",
11180
+ "hasDynamicHelp": false,
11181
+ "multiple": false,
11182
+ "type": "option"
11183
+ },
11030
11184
  "debug": {
11031
11185
  "char": "d",
11032
11186
  "description": "Activate debug mode (more logs)",
@@ -11056,21 +11210,8 @@
11056
11210
  "deprecateAliases": true,
11057
11211
  "name": "target-org",
11058
11212
  "noCacheDefault": true,
11059
- "summary": "Username or alias of the target org.",
11060
- "hasDynamicHelp": true,
11061
- "multiple": false,
11062
- "type": "option"
11063
- },
11064
- "target-dev-hub": {
11065
- "aliases": [
11066
- "targetdevhubusername"
11067
- ],
11068
- "char": "v",
11069
- "deprecateAliases": true,
11070
- "name": "target-dev-hub",
11071
- "noCacheDefault": true,
11072
- "required": false,
11073
- "summary": "Username or alias of the Dev Hub org.",
11213
+ "required": true,
11214
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
11074
11215
  "hasDynamicHelp": true,
11075
11216
  "multiple": false,
11076
11217
  "type": "option"
@@ -11078,61 +11219,57 @@
11078
11219
  },
11079
11220
  "hasDynamicHelp": true,
11080
11221
  "hiddenAliases": [],
11081
- "id": "hardis:project:configure:auth",
11222
+ "id": "hardis:project:deploy:notify",
11082
11223
  "pluginAlias": "sfdx-hardis",
11083
11224
  "pluginName": "sfdx-hardis",
11084
11225
  "pluginType": "core",
11085
11226
  "strict": true,
11086
11227
  "enableJsonFlag": true,
11087
- "title": "Configure authentication",
11088
- "requiresProject": false,
11089
- "requiresDependencies": [
11090
- "openssl"
11091
- ],
11228
+ "title": "Deployment Notifications",
11229
+ "requiresProject": true,
11092
11230
  "isESM": true,
11093
11231
  "relativePath": [
11094
11232
  "lib",
11095
11233
  "commands",
11096
11234
  "hardis",
11097
11235
  "project",
11098
- "configure",
11099
- "auth.js"
11236
+ "deploy",
11237
+ "notify.js"
11100
11238
  ],
11101
11239
  "aliasPermutations": [],
11102
11240
  "permutations": [
11103
- "hardis:project:configure:auth",
11104
- "project:hardis:configure:auth",
11105
- "project:configure:hardis:auth",
11106
- "project:configure:auth:hardis",
11107
- "hardis:configure:project:auth",
11108
- "configure:hardis:project:auth",
11109
- "configure:project:hardis:auth",
11110
- "configure:project:auth:hardis",
11111
- "hardis:configure:auth:project",
11112
- "configure:hardis:auth:project",
11113
- "configure:auth:hardis:project",
11114
- "configure:auth:project:hardis",
11115
- "hardis:project:auth:configure",
11116
- "project:hardis:auth:configure",
11117
- "project:auth:hardis:configure",
11118
- "project:auth:configure:hardis",
11119
- "hardis:auth:project:configure",
11120
- "auth:hardis:project:configure",
11121
- "auth:project:hardis:configure",
11122
- "auth:project:configure:hardis",
11123
- "hardis:auth:configure:project",
11124
- "auth:hardis:configure:project",
11125
- "auth:configure:hardis:project",
11126
- "auth:configure:project:hardis"
11241
+ "hardis:project:deploy:notify",
11242
+ "project:hardis:deploy:notify",
11243
+ "project:deploy:hardis:notify",
11244
+ "project:deploy:notify:hardis",
11245
+ "hardis:deploy:project:notify",
11246
+ "deploy:hardis:project:notify",
11247
+ "deploy:project:hardis:notify",
11248
+ "deploy:project:notify:hardis",
11249
+ "hardis:deploy:notify:project",
11250
+ "deploy:hardis:notify:project",
11251
+ "deploy:notify:hardis:project",
11252
+ "deploy:notify:project:hardis",
11253
+ "hardis:project:notify:deploy",
11254
+ "project:hardis:notify:deploy",
11255
+ "project:notify:hardis:deploy",
11256
+ "project:notify:deploy:hardis",
11257
+ "hardis:notify:project:deploy",
11258
+ "notify:hardis:project:deploy",
11259
+ "notify:project:hardis:deploy",
11260
+ "notify:project:deploy:hardis",
11261
+ "hardis:notify:deploy:project",
11262
+ "notify:hardis:deploy:project",
11263
+ "notify:deploy:hardis:project",
11264
+ "notify:deploy:project:hardis"
11127
11265
  ]
11128
11266
  },
11129
- "hardis:project:convert:profilestopermsets": {
11130
- "aliases": [],
11131
- "args": {},
11132
- "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",
11133
- "examples": [
11134
- "$ sf hardis:project:convert:profilestopermsets"
11267
+ "hardis:project:deploy:quick": {
11268
+ "aliases": [
11269
+ "hardis:deploy:quick"
11135
11270
  ],
11271
+ "args": {},
11272
+ "description": "sfdx-hardis wrapper for **sf project deploy quick** that displays tips to solve deployment errors.\n\nNote: Use **--json** argument to have better results\n\n[![Assisted solving of Salesforce deployments errors](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deployment-errors.jpg)](https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0)\n\n[See documentation of Salesforce command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_project_commands_unified.htm#cli_reference_project_deploy_quick_unified)\n\n### Deployment pre or post commands\n\nYou can define command lines to run before or after a deployment, with parameters:\n\n- **id**: Unique Id for the command\n- **label**: Human readable label for the command\n- **skipIfError**: If defined to \"true\", the post-command won't be run if there is a deployment failure\n- **context**: Defines the context where the command will be run. Can be **all** (default), **check-deployment-only** or **process-deployment-only**\n- **runOnlyOnceByOrg**: If set to true, the command will be run only one time per org. A record of SfdxHardisTrace__c is stored to make that possible (it needs to be existing in target org)\n\nIf the commands are not the same depending on the target org, you can define them into **config/branches/.sfdx-hardis-BRANCHNAME.yml** instead of root **config/.sfdx-hardis.yml**\n\nExample:\n\n```yaml\ncommandsPreDeploy:\n - id: knowledgeUnassign\n label: Remove KnowledgeUser right to the user who has it\n command: sf data update record --sobject User --where \"UserPermissionsKnowledgeUser='true'\" --values \"UserPermissionsKnowledgeUser='false'\" --json\n - id: knowledgeAssign\n label: Assign Knowledge user to the deployment user\n command: sf data update record --sobject User --where \"Username='deploy.github@myclient.com'\" --values \"UserPermissionsKnowledgeUser='true'\" --json\n\ncommandsPostDeploy:\n - id: knowledgeUnassign\n label: Remove KnowledgeUser right to the user who has it\n command: sf data update record --sobject User --where \"UserPermissionsKnowledgeUser='true'\" --values \"UserPermissionsKnowledgeUser='false'\" --json\n - id: knowledgeAssign\n label: Assign Knowledge user to desired username\n command: sf data update record --sobject User --where \"Username='admin-yser@myclient.com'\" --values \"UserPermissionsKnowledgeUser='true'\" --json\n - id: someActionToRunJustOneTime\n label: And to run only if deployment is success\n command: sf sfdmu:run ...\n skipIfError: true\n context: process-deployment-only\n runOnlyOnceByOrg: true\n```\n",
11136
11273
  "flags": {
11137
11274
  "json": {
11138
11275
  "description": "Format output as json.",
@@ -11149,250 +11286,10 @@
11149
11286
  "multiple": false,
11150
11287
  "type": "option"
11151
11288
  },
11152
- "except": {
11153
- "char": "e",
11154
- "description": "List of filters",
11155
- "name": "except",
11156
- "default": [],
11157
- "hasDynamicHelp": false,
11158
- "multiple": true,
11159
- "type": "option"
11160
- },
11161
- "debug": {
11162
- "char": "d",
11163
- "description": "Activate debug mode (more logs)",
11164
- "name": "debug",
11165
- "allowNo": false,
11166
- "type": "boolean"
11167
- },
11168
- "websocket": {
11169
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11170
- "name": "websocket",
11171
- "hasDynamicHelp": false,
11172
- "multiple": false,
11173
- "type": "option"
11174
- },
11175
- "skipauth": {
11176
- "description": "Skip authentication check when a default username is required",
11177
- "name": "skipauth",
11178
- "allowNo": false,
11179
- "type": "boolean"
11180
- }
11181
- },
11182
- "hasDynamicHelp": false,
11183
- "hiddenAliases": [],
11184
- "id": "hardis:project:convert:profilestopermsets",
11185
- "pluginAlias": "sfdx-hardis",
11186
- "pluginName": "sfdx-hardis",
11187
- "pluginType": "core",
11188
- "strict": true,
11189
- "enableJsonFlag": true,
11190
- "title": "Convert Profiles into Permission Sets",
11191
- "requiresProject": true,
11192
- "requiresSfdxPlugins": [
11193
- "shane-sfdx-plugins"
11194
- ],
11195
- "isESM": true,
11196
- "relativePath": [
11197
- "lib",
11198
- "commands",
11199
- "hardis",
11200
- "project",
11201
- "convert",
11202
- "profilestopermsets.js"
11203
- ],
11204
- "aliasPermutations": [],
11205
- "permutations": [
11206
- "hardis:project:convert:profilestopermsets",
11207
- "project:hardis:convert:profilestopermsets",
11208
- "project:convert:hardis:profilestopermsets",
11209
- "project:convert:profilestopermsets:hardis",
11210
- "hardis:convert:project:profilestopermsets",
11211
- "convert:hardis:project:profilestopermsets",
11212
- "convert:project:hardis:profilestopermsets",
11213
- "convert:project:profilestopermsets:hardis",
11214
- "hardis:convert:profilestopermsets:project",
11215
- "convert:hardis:profilestopermsets:project",
11216
- "convert:profilestopermsets:hardis:project",
11217
- "convert:profilestopermsets:project:hardis",
11218
- "hardis:project:profilestopermsets:convert",
11219
- "project:hardis:profilestopermsets:convert",
11220
- "project:profilestopermsets:hardis:convert",
11221
- "project:profilestopermsets:convert:hardis",
11222
- "hardis:profilestopermsets:project:convert",
11223
- "profilestopermsets:hardis:project:convert",
11224
- "profilestopermsets:project:hardis:convert",
11225
- "profilestopermsets:project:convert:hardis",
11226
- "hardis:profilestopermsets:convert:project",
11227
- "profilestopermsets:hardis:convert:project",
11228
- "profilestopermsets:convert:hardis:project",
11229
- "profilestopermsets:convert:project:hardis"
11230
- ]
11231
- },
11232
- "hardis:project:deploy:notify": {
11233
- "aliases": [],
11234
- "args": {},
11235
- "description": "Post notifications related to:\n\n- **Deployment simulation** _(use with --check-only)_\n\n- **Deployment process** _(to call only if your deployment is successful)_\n\n### Integrations\n\nAccording to the [integrations you configured](https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integrations-home/), notifications can contain deployment information and [Flow Visual Git Diff](https://sfdx-hardis.cloudity.com/salesforce-deployment-assistant-home/#flow-visual-git-diff)\n\n - GitHub, Gitlab, Azure DevOps, Bitbucket comments on Pull Requests (including Flows Visual Git Diff)\n\n - Slack, Microsoft Teams, Email deployment summary after a successful deployment\n\n - JIRA tags and comments on tickets that just has been deployed\n\n![](https://sfdx-hardis.cloudity.com/assets/images/screenshot-jira-gitlab.jpg)\n\n![](https://sfdx-hardis.cloudity.com/assets/images/screenshot-jira-slack.jpg)\n\n### Flows Visual Git Diff\n\n- Visually show you the differences on a diagram\n\n- Display the update details without having to open any XML !\n\n🟩 = added\n\n🟥 = removed\n\n🟧 = updated\n\n![](https://sfdx-hardis.cloudity.com/assets/images/flow-visual-git-diff.jpg)\n\n![](https://sfdx-hardis.cloudity.com/assets/images/flow-visual-git-diff-2.jpg)\n\n### In custom CI/CD workflow\n\nExample of usage in a custom CI/CD pipeline:\n\n```bash\n# Disable exit-on-error temporarily\nset +e\n\n# Run the deploy command\nsf project deploy start [....]\nRET_CODE=$?\n\n# Re-enable exit-on-error\nset -e\n\n# Determine MYSTATUS based on return code\nif [ $RET_CODE -eq 0 ]; then\n MYSTATUS=\"valid\"\nelse\n MYSTATUS=\"invalid\"\nfi\n\n# Run the notify command with MYSTATUS\nsf hardis:project:deploy:notify --check-only --deploy-status \"$MYSTATUS\"\n```\n\n### Other usages\n\nThis command is for custom SF Cli pipelines, if you are a sfdx-hardis user, it is already embedded in sf hardis:deploy:smart.\n\nYou can also use [sfdx-hardis wrapper commands of SF deployment commands](https://sfdx-hardis.cloudity.com/salesforce-deployment-assistant-setup/#using-custom-cicd-pipeline)\n",
11236
- "examples": [
11237
- "$ sf hardis:project:deploy:notify --check-only --deploy-status valid --message \"This deployment check is valid\\n\\nYahooo !!\"",
11238
- "$ sf hardis:project:deploy:notify --check-only --deploy-status invalid --message \"This deployment check has failed !\\n\\Oh no !!\"",
11239
- "$ sf hardis:project:deploy:notify --deploy-status valid --message \"This deployment has been processed !\\n\\nYahooo !!\""
11240
- ],
11241
- "flags": {
11242
- "json": {
11243
- "description": "Format output as json.",
11244
- "helpGroup": "GLOBAL",
11245
- "name": "json",
11246
- "allowNo": false,
11247
- "type": "boolean"
11248
- },
11249
- "flags-dir": {
11250
- "helpGroup": "GLOBAL",
11251
- "name": "flags-dir",
11252
- "summary": "Import flag values from a directory.",
11253
- "hasDynamicHelp": false,
11254
- "multiple": false,
11255
- "type": "option"
11256
- },
11257
- "check-only": {
11258
- "char": "c",
11259
- "description": "Use this option to send notifications from a Deployment simulation job",
11260
- "name": "check-only",
11261
- "allowNo": false,
11262
- "type": "boolean"
11263
- },
11264
- "deploy-status": {
11265
- "char": "s",
11266
- "description": "Send success, failure or unknown (default) to indicate if the deployment or deployment simulation is in success or not",
11267
- "name": "deploy-status",
11268
- "default": "unknown",
11269
- "hasDynamicHelp": false,
11270
- "multiple": false,
11271
- "options": [
11272
- "valid",
11273
- "invalid",
11274
- "unknown"
11275
- ],
11276
- "type": "option"
11277
- },
11278
- "message": {
11279
- "char": "m",
11280
- "description": "Custom message that you want to be added in notifications (string or markdown format)",
11281
- "name": "message",
11282
- "default": "",
11283
- "hasDynamicHelp": false,
11284
- "multiple": false,
11285
- "type": "option"
11286
- },
11287
- "debug": {
11288
- "char": "d",
11289
- "description": "Activate debug mode (more logs)",
11290
- "name": "debug",
11291
- "allowNo": false,
11292
- "type": "boolean"
11293
- },
11294
- "websocket": {
11295
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11296
- "name": "websocket",
11297
- "hasDynamicHelp": false,
11298
- "multiple": false,
11299
- "type": "option"
11300
- },
11301
- "skipauth": {
11302
- "description": "Skip authentication check when a default username is required",
11303
- "name": "skipauth",
11304
- "allowNo": false,
11305
- "type": "boolean"
11306
- },
11307
- "target-org": {
11308
- "aliases": [
11309
- "targetusername",
11310
- "u"
11311
- ],
11312
- "char": "o",
11313
- "deprecateAliases": true,
11314
- "name": "target-org",
11315
- "noCacheDefault": true,
11316
- "required": true,
11317
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
11318
- "hasDynamicHelp": true,
11319
- "multiple": false,
11320
- "type": "option"
11321
- }
11322
- },
11323
- "hasDynamicHelp": true,
11324
- "hiddenAliases": [],
11325
- "id": "hardis:project:deploy:notify",
11326
- "pluginAlias": "sfdx-hardis",
11327
- "pluginName": "sfdx-hardis",
11328
- "pluginType": "core",
11329
- "strict": true,
11330
- "enableJsonFlag": true,
11331
- "title": "Deployment Notifications",
11332
- "requiresProject": true,
11333
- "isESM": true,
11334
- "relativePath": [
11335
- "lib",
11336
- "commands",
11337
- "hardis",
11338
- "project",
11339
- "deploy",
11340
- "notify.js"
11341
- ],
11342
- "aliasPermutations": [],
11343
- "permutations": [
11344
- "hardis:project:deploy:notify",
11345
- "project:hardis:deploy:notify",
11346
- "project:deploy:hardis:notify",
11347
- "project:deploy:notify:hardis",
11348
- "hardis:deploy:project:notify",
11349
- "deploy:hardis:project:notify",
11350
- "deploy:project:hardis:notify",
11351
- "deploy:project:notify:hardis",
11352
- "hardis:deploy:notify:project",
11353
- "deploy:hardis:notify:project",
11354
- "deploy:notify:hardis:project",
11355
- "deploy:notify:project:hardis",
11356
- "hardis:project:notify:deploy",
11357
- "project:hardis:notify:deploy",
11358
- "project:notify:hardis:deploy",
11359
- "project:notify:deploy:hardis",
11360
- "hardis:notify:project:deploy",
11361
- "notify:hardis:project:deploy",
11362
- "notify:project:hardis:deploy",
11363
- "notify:project:deploy:hardis",
11364
- "hardis:notify:deploy:project",
11365
- "notify:hardis:deploy:project",
11366
- "notify:deploy:hardis:project",
11367
- "notify:deploy:project:hardis"
11368
- ]
11369
- },
11370
- "hardis:project:deploy:quick": {
11371
- "aliases": [
11372
- "hardis:deploy:quick"
11373
- ],
11374
- "args": {},
11375
- "description": "sfdx-hardis wrapper for **sf project deploy quick** that displays tips to solve deployment errors.\n\nNote: Use **--json** argument to have better results\n\n[![Assisted solving of Salesforce deployments errors](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-deployment-errors.jpg)](https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0)\n\n[See documentation of Salesforce command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_project_commands_unified.htm#cli_reference_project_deploy_quick_unified)\n\n### Deployment pre or post commands\n\nYou can define command lines to run before or after a deployment, with parameters:\n\n- **id**: Unique Id for the command\n- **label**: Human readable label for the command\n- **skipIfError**: If defined to \"true\", the post-command won't be run if there is a deployment failure\n- **context**: Defines the context where the command will be run. Can be **all** (default), **check-deployment-only** or **process-deployment-only**\n- **runOnlyOnceByOrg**: If set to true, the command will be run only one time per org. A record of SfdxHardisTrace__c is stored to make that possible (it needs to be existing in target org)\n\nIf the commands are not the same depending on the target org, you can define them into **config/branches/.sfdx-hardis-BRANCHNAME.yml** instead of root **config/.sfdx-hardis.yml**\n\nExample:\n\n```yaml\ncommandsPreDeploy:\n - id: knowledgeUnassign\n label: Remove KnowledgeUser right to the user who has it\n command: sf data update record --sobject User --where \"UserPermissionsKnowledgeUser='true'\" --values \"UserPermissionsKnowledgeUser='false'\" --json\n - id: knowledgeAssign\n label: Assign Knowledge user to the deployment user\n command: sf data update record --sobject User --where \"Username='deploy.github@myclient.com'\" --values \"UserPermissionsKnowledgeUser='true'\" --json\n\ncommandsPostDeploy:\n - id: knowledgeUnassign\n label: Remove KnowledgeUser right to the user who has it\n command: sf data update record --sobject User --where \"UserPermissionsKnowledgeUser='true'\" --values \"UserPermissionsKnowledgeUser='false'\" --json\n - id: knowledgeAssign\n label: Assign Knowledge user to desired username\n command: sf data update record --sobject User --where \"Username='admin-yser@myclient.com'\" --values \"UserPermissionsKnowledgeUser='true'\" --json\n - id: someActionToRunJustOneTime\n label: And to run only if deployment is success\n command: sf sfdmu:run ...\n skipIfError: true\n context: process-deployment-only\n runOnlyOnceByOrg: true\n```\n",
11376
- "flags": {
11377
- "json": {
11378
- "description": "Format output as json.",
11379
- "helpGroup": "GLOBAL",
11380
- "name": "json",
11381
- "allowNo": false,
11382
- "type": "boolean"
11383
- },
11384
- "flags-dir": {
11385
- "helpGroup": "GLOBAL",
11386
- "name": "flags-dir",
11387
- "summary": "Import flag values from a directory.",
11388
- "hasDynamicHelp": false,
11389
- "multiple": false,
11390
- "type": "option"
11391
- },
11392
- "api-version": {
11393
- "char": "a",
11394
- "description": "api-version",
11395
- "name": "api-version",
11289
+ "api-version": {
11290
+ "char": "a",
11291
+ "description": "api-version",
11292
+ "name": "api-version",
11396
11293
  "hasDynamicHelp": false,
11397
11294
  "multiple": false,
11398
11295
  "type": "option"
@@ -12404,234 +12301,19 @@
12404
12301
  "validate:deploy:project:hardis"
12405
12302
  ]
12406
12303
  },
12407
- "hardis:project:fix:profiletabs": {
12304
+ "hardis:project:generate:bypass": {
12408
12305
  "aliases": [],
12409
12306
  "args": {},
12410
- "description": "\n## Command Behavior\n\n**Interactively updates tab visibility settings in Salesforce profiles, addressing a common issue where tab visibilities are not correctly retrieved by `sf project retrieve start`.**\n\nThis command provides a user-friendly interface to manage tab settings within your profile XML files, ensuring that your local project accurately reflects the intended tab configurations in your Salesforce org.\n\nKey functionalities:\n\n- **Interactive Tab Selection:** Displays a multi-select menu of all available tabs in your org, allowing you to choose which tabs to update.\n- **Visibility Control:** Lets you set the visibility for the selected tabs to either `DefaultOn` (Visible) or `Hidden`.\n- **Profile Selection:** Presents a multi-select menu of all .profile-meta.xml files in your project, allowing you to apply the tab visibility changes to specific profiles.\n- **XML Updates:** Modifies the <tabVisibilities> section of the selected profile XML files to reflect the chosen tab settings. If a tab visibility setting already exists for a selected tab, it will be updated; otherwise, a new one will be added.\n- **Sorted Output:** The <tabVisibilities> in the updated profile XML files are sorted alphabetically for consistency and readability.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries the `TabDefinition` object using `soqlQueryTooling` to retrieve a list of all available tabs in the target org.\n- **File Discovery:** Uses `glob` to find all .profile-meta.xml files within the specified project path.\n- **Interactive Prompts:** Leverages the `prompts` library to create interactive menus for selecting tabs, visibility settings, and profiles.\n- **XML Parsing and Manipulation:** Uses `parseXmlFile` to read the content of profile XML files and `writeXmlFile` to write the modified content back. It manipulates the `tabVisibilities` array within the parsed XML to add or update tab settings.\n- **Array Sorting:** Employs the `sort-array` library to sort the `tabVisibilities` alphabetically by tab name.\n- **Logging:** Provides feedback to the user about which profiles have been updated and a summary of the changes.\n</details>\n",
12307
+ "description": "\n## Command Behavior\n\n**Generates custom permissions and permission sets to bypass specified Salesforce automations (Flows, Triggers, and Validation Rules) for specific sObjects.**\n\nThis command provides a controlled mechanism to temporarily or permanently disable automations for certain sObjects, which is invaluable for:\n\n- **Data Loading:** Bypassing validation rules or triggers during large data imports.\n- **Troubleshooting:** Isolating automation issues by temporarily disabling them.\n- **Development:** Allowing developers to work on specific sObjects without triggering complex automations.\n\nKey functionalities:\n\n- **sObject Selection:** You can specify a comma-separated list of sObjects to bypass (e.g., `Account,Contact`). If omitted, an interactive prompt will allow you to select from available sObjects.\n- **Automation Type Selection:** Choose which types of automations to bypass: `Flow`, `Trigger`, or `VR` (Validation Rules). If omitted, an interactive prompt will guide your selection.\n- **Automatic Bypass Application:** Optionally, the command can automatically inject bypass logic into Validation Rules and Triggers. This involves modifying the Apex code for Triggers and the XML for Validation Rules.\n- **Metadata Source:** You can choose to retrieve the metadata elements (Validation Rules, Triggers) from the org (`--metadata-source org`) or use local files (`--metadata-source local`). Retrieving from the org is recommended for accuracy.\n- **Custom Permission and Permission Set Generation:** For each selected sObject and automation type, it generates:\n - A **Custom Permission** (e.g., `BypassAccountFlows`) that acts as the bypass switch.\n - A **Permission Set** (e.g., `BypassAccountFlows`) that grants the generated Custom Permission.\n- **Credits Inclusion:** By default, generated XML files include a comment indicating they were generated by sfdx-hardis. This can be skipped using `--skip-credits`.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries `EntityDefinition` to list customizable sObjects and `ValidationRule` and `ApexTrigger` to find existing automations.\n- **Interactive Prompts:** Uses the `prompts` library to guide the user through selecting sObjects, automation types, and bypass application options.\n- **XML Generation:** Dynamically generates XML content for Custom Permissions and Permission Sets, including descriptions and labels that clearly indicate their purpose.\n- **File System Operations:** Uses `fs-extra` to create directories and write the generated Custom Permission and Permission Set XML files.\n- **Metadata Retrieval (for Bypass Application):** If `apply-to-vrs` or `apply-to-triggers` is used and `metadata-source` is `org`, it retrieves the relevant Validation Rule or Apex Trigger metadata from the org using `sf project retrieve start`.\n- **XML/Apex Code Modification:**\n - For Validation Rules, it modifies the `errorConditionFormula` in the XML to include a check for the bypass Custom Permission.\n - For Apex Triggers, it injects an `if` statement at the beginning of the trigger body to check for the bypass Custom Permission.\n- **`parseXmlFile` and `writeXmlFile`:** Used for reading and writing XML metadata files.\n- **`execCommand`:** Used for executing Salesforce CLI commands, particularly for metadata retrieval.\n- **Error Handling:** Includes checks for invalid sObject or automation selections and provides informative error messages.\n</details>\n",
12411
12308
  "examples": [
12412
- "$ sf hardis:project:fix:profiletabs"
12413
- ],
12414
- "flags": {
12415
- "json": {
12416
- "description": "Format output as json.",
12417
- "helpGroup": "GLOBAL",
12418
- "name": "json",
12419
- "allowNo": false,
12420
- "type": "boolean"
12421
- },
12422
- "flags-dir": {
12423
- "helpGroup": "GLOBAL",
12424
- "name": "flags-dir",
12425
- "summary": "Import flag values from a directory.",
12426
- "hasDynamicHelp": false,
12427
- "multiple": false,
12428
- "type": "option"
12429
- },
12430
- "path": {
12431
- "char": "p",
12432
- "description": "Root folder",
12433
- "name": "path",
12434
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12435
- "hasDynamicHelp": false,
12436
- "multiple": false,
12437
- "type": "option"
12438
- },
12439
- "debug": {
12440
- "char": "d",
12441
- "description": "Activate debug mode (more logs)",
12442
- "name": "debug",
12443
- "allowNo": false,
12444
- "type": "boolean"
12445
- },
12446
- "websocket": {
12447
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12448
- "name": "websocket",
12449
- "hasDynamicHelp": false,
12450
- "multiple": false,
12451
- "type": "option"
12452
- },
12453
- "skipauth": {
12454
- "description": "Skip authentication check when a default username is required",
12455
- "name": "skipauth",
12456
- "allowNo": false,
12457
- "type": "boolean"
12458
- },
12459
- "target-org": {
12460
- "aliases": [
12461
- "targetusername",
12462
- "u"
12463
- ],
12464
- "char": "o",
12465
- "deprecateAliases": true,
12466
- "name": "target-org",
12467
- "noCacheDefault": true,
12468
- "required": true,
12469
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12470
- "hasDynamicHelp": true,
12471
- "multiple": false,
12472
- "type": "option"
12473
- }
12474
- },
12475
- "hasDynamicHelp": true,
12476
- "hiddenAliases": [],
12477
- "id": "hardis:project:fix:profiletabs",
12478
- "pluginAlias": "sfdx-hardis",
12479
- "pluginName": "sfdx-hardis",
12480
- "pluginType": "core",
12481
- "strict": true,
12482
- "enableJsonFlag": true,
12483
- "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
12484
- "requiresProject": true,
12485
- "isESM": true,
12486
- "relativePath": [
12487
- "lib",
12488
- "commands",
12489
- "hardis",
12490
- "project",
12491
- "fix",
12492
- "profiletabs.js"
12493
- ],
12494
- "aliasPermutations": [],
12495
- "permutations": [
12496
- "hardis:project:fix:profiletabs",
12497
- "project:hardis:fix:profiletabs",
12498
- "project:fix:hardis:profiletabs",
12499
- "project:fix:profiletabs:hardis",
12500
- "hardis:fix:project:profiletabs",
12501
- "fix:hardis:project:profiletabs",
12502
- "fix:project:hardis:profiletabs",
12503
- "fix:project:profiletabs:hardis",
12504
- "hardis:fix:profiletabs:project",
12505
- "fix:hardis:profiletabs:project",
12506
- "fix:profiletabs:hardis:project",
12507
- "fix:profiletabs:project:hardis",
12508
- "hardis:project:profiletabs:fix",
12509
- "project:hardis:profiletabs:fix",
12510
- "project:profiletabs:hardis:fix",
12511
- "project:profiletabs:fix:hardis",
12512
- "hardis:profiletabs:project:fix",
12513
- "profiletabs:hardis:project:fix",
12514
- "profiletabs:project:hardis:fix",
12515
- "profiletabs:project:fix:hardis",
12516
- "hardis:profiletabs:fix:project",
12517
- "profiletabs:hardis:fix:project",
12518
- "profiletabs:fix:hardis:project",
12519
- "profiletabs:fix:project:hardis"
12520
- ]
12521
- },
12522
- "hardis:project:fix:v53flexipages": {
12523
- "aliases": [],
12524
- "args": {},
12525
- "description": "\n## Command Behavior\n\n**Fixes Salesforce FlexiPages for compatibility with API Version 53.0 (Winter '22 release) by adding missing identifiers to component instances.**\n\nSalesforce introduced a change in API Version 53.0 that requires `identifier` tags within `componentInstance` and `fieldInstance` elements in FlexiPage metadata. If these identifiers are missing, deployments to orgs with API version 53.0 or higher will fail. This command automates the process of adding these missing identifiers, ensuring your FlexiPages remain deployable.\n\nKey functionalities:\n\n- **Targeted FlexiPage Processing:** Scans all .flexipage-meta.xml files within the specified root folder (defaults to current working directory).\n- **Identifier Injection:** Inserts a unique `identifier` tag (e.g., `SFDX_HARDIS_REPLACEMENT_ID`) into `componentInstance` and `fieldInstance` elements that lack one.\n\n**Important Note:** After running this command, ensure you update your `apiVersion` to `53.0` (or higher) in your `package.xml` and `sfdx-project.json` files.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find all .flexipage-meta.xml files.\n- **Content Reading:** Reads the XML content of each FlexiPage file.\n- **Regular Expression Replacement:** Employs a set of regular expressions to identify specific XML patterns (componentName.../componentName.../componentInstance, componentName.../componentName.../visibilityRule, fieldItem.../fieldItem.../fieldInstance) that are missing the `identifier` tag.\n- **Dynamic ID Generation:** For each match, it generates a unique identifier (e.g., `sfdxHardisIdX`) and injects it into the XML structure.\n- **File Writing:** If changes are made, the modified XML content is written back to the FlexiPage file using `fs.writeFile`.\n- **Logging:** Provides messages about which FlexiPages are being processed and a summary of the total number of identifiers added.\n</details>\n",
12526
- "examples": [
12527
- "$ sf hardis:project:fix:v53flexipages"
12528
- ],
12529
- "flags": {
12530
- "json": {
12531
- "description": "Format output as json.",
12532
- "helpGroup": "GLOBAL",
12533
- "name": "json",
12534
- "allowNo": false,
12535
- "type": "boolean"
12536
- },
12537
- "flags-dir": {
12538
- "helpGroup": "GLOBAL",
12539
- "name": "flags-dir",
12540
- "summary": "Import flag values from a directory.",
12541
- "hasDynamicHelp": false,
12542
- "multiple": false,
12543
- "type": "option"
12544
- },
12545
- "path": {
12546
- "char": "p",
12547
- "description": "Root folder",
12548
- "name": "path",
12549
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12550
- "hasDynamicHelp": false,
12551
- "multiple": false,
12552
- "type": "option"
12553
- },
12554
- "debug": {
12555
- "char": "d",
12556
- "description": "Activate debug mode (more logs)",
12557
- "name": "debug",
12558
- "allowNo": false,
12559
- "type": "boolean"
12560
- },
12561
- "websocket": {
12562
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12563
- "name": "websocket",
12564
- "hasDynamicHelp": false,
12565
- "multiple": false,
12566
- "type": "option"
12567
- },
12568
- "skipauth": {
12569
- "description": "Skip authentication check when a default username is required",
12570
- "name": "skipauth",
12571
- "allowNo": false,
12572
- "type": "boolean"
12573
- }
12574
- },
12575
- "hasDynamicHelp": false,
12576
- "hiddenAliases": [],
12577
- "id": "hardis:project:fix:v53flexipages",
12578
- "pluginAlias": "sfdx-hardis",
12579
- "pluginName": "sfdx-hardis",
12580
- "pluginType": "core",
12581
- "strict": true,
12582
- "enableJsonFlag": true,
12583
- "title": "Fix flexipages for v53",
12584
- "requiresProject": true,
12585
- "isESM": true,
12586
- "relativePath": [
12587
- "lib",
12588
- "commands",
12589
- "hardis",
12590
- "project",
12591
- "fix",
12592
- "v53flexipages.js"
12593
- ],
12594
- "aliasPermutations": [],
12595
- "permutations": [
12596
- "hardis:project:fix:v53flexipages",
12597
- "project:hardis:fix:v53flexipages",
12598
- "project:fix:hardis:v53flexipages",
12599
- "project:fix:v53flexipages:hardis",
12600
- "hardis:fix:project:v53flexipages",
12601
- "fix:hardis:project:v53flexipages",
12602
- "fix:project:hardis:v53flexipages",
12603
- "fix:project:v53flexipages:hardis",
12604
- "hardis:fix:v53flexipages:project",
12605
- "fix:hardis:v53flexipages:project",
12606
- "fix:v53flexipages:hardis:project",
12607
- "fix:v53flexipages:project:hardis",
12608
- "hardis:project:v53flexipages:fix",
12609
- "project:hardis:v53flexipages:fix",
12610
- "project:v53flexipages:hardis:fix",
12611
- "project:v53flexipages:fix:hardis",
12612
- "hardis:v53flexipages:project:fix",
12613
- "v53flexipages:hardis:project:fix",
12614
- "v53flexipages:project:hardis:fix",
12615
- "v53flexipages:project:fix:hardis",
12616
- "hardis:v53flexipages:fix:project",
12617
- "v53flexipages:hardis:fix:project",
12618
- "v53flexipages:fix:hardis:project",
12619
- "v53flexipages:fix:project:hardis"
12620
- ]
12621
- },
12622
- "hardis:project:generate:bypass": {
12623
- "aliases": [],
12624
- "args": {},
12625
- "description": "\n## Command Behavior\n\n**Generates custom permissions and permission sets to bypass specified Salesforce automations (Flows, Triggers, and Validation Rules) for specific sObjects.**\n\nThis command provides a controlled mechanism to temporarily or permanently disable automations for certain sObjects, which is invaluable for:\n\n- **Data Loading:** Bypassing validation rules or triggers during large data imports.\n- **Troubleshooting:** Isolating automation issues by temporarily disabling them.\n- **Development:** Allowing developers to work on specific sObjects without triggering complex automations.\n\nKey functionalities:\n\n- **sObject Selection:** You can specify a comma-separated list of sObjects to bypass (e.g., `Account,Contact`). If omitted, an interactive prompt will allow you to select from available sObjects.\n- **Automation Type Selection:** Choose which types of automations to bypass: `Flow`, `Trigger`, or `VR` (Validation Rules). If omitted, an interactive prompt will guide your selection.\n- **Automatic Bypass Application:** Optionally, the command can automatically inject bypass logic into Validation Rules and Triggers. This involves modifying the Apex code for Triggers and the XML for Validation Rules.\n- **Metadata Source:** You can choose to retrieve the metadata elements (Validation Rules, Triggers) from the org (`--metadata-source org`) or use local files (`--metadata-source local`). Retrieving from the org is recommended for accuracy.\n- **Custom Permission and Permission Set Generation:** For each selected sObject and automation type, it generates:\n - A **Custom Permission** (e.g., `BypassAccountFlows`) that acts as the bypass switch.\n - A **Permission Set** (e.g., `BypassAccountFlows`) that grants the generated Custom Permission.\n- **Credits Inclusion:** By default, generated XML files include a comment indicating they were generated by sfdx-hardis. This can be skipped using `--skip-credits`.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries `EntityDefinition` to list customizable sObjects and `ValidationRule` and `ApexTrigger` to find existing automations.\n- **Interactive Prompts:** Uses the `prompts` library to guide the user through selecting sObjects, automation types, and bypass application options.\n- **XML Generation:** Dynamically generates XML content for Custom Permissions and Permission Sets, including descriptions and labels that clearly indicate their purpose.\n- **File System Operations:** Uses `fs-extra` to create directories and write the generated Custom Permission and Permission Set XML files.\n- **Metadata Retrieval (for Bypass Application):** If `apply-to-vrs` or `apply-to-triggers` is used and `metadata-source` is `org`, it retrieves the relevant Validation Rule or Apex Trigger metadata from the org using `sf project retrieve start`.\n- **XML/Apex Code Modification:**\n - For Validation Rules, it modifies the `errorConditionFormula` in the XML to include a check for the bypass Custom Permission.\n - For Apex Triggers, it injects an `if` statement at the beginning of the trigger body to check for the bypass Custom Permission.\n- **`parseXmlFile` and `writeXmlFile`:** Used for reading and writing XML metadata files.\n- **`execCommand`:** Used for executing Salesforce CLI commands, particularly for metadata retrieval.\n- **Error Handling:** Includes checks for invalid sObject or automation selections and provides informative error messages.\n</details>\n",
12626
- "examples": [
12627
- "$ sf hardis:project:generate:bypass",
12628
- "$ sf hardis:project:generate:bypass --sObjects Account,Contact,Opportunity",
12629
- "$ sf hardis:project:generate:bypass --automations Flow,Trigger,VR",
12630
- "$ sf hardis:project:generate:bypass --sObjects Account,Opportunity --automations Flow,Trigger",
12631
- "$ sf hardis:project:generate:bypass --skipCredits",
12632
- "$ sf hardis:project:generate:bypass --apply-to-vrs",
12633
- "$ sf hardis:project:generate:bypass --apply-to-triggers",
12634
- "$ sf hardis:project:generate:bypass --metadata-source org"
12309
+ "$ sf hardis:project:generate:bypass",
12310
+ "$ sf hardis:project:generate:bypass --sObjects Account,Contact,Opportunity",
12311
+ "$ sf hardis:project:generate:bypass --automations Flow,Trigger,VR",
12312
+ "$ sf hardis:project:generate:bypass --sObjects Account,Opportunity --automations Flow,Trigger",
12313
+ "$ sf hardis:project:generate:bypass --skipCredits",
12314
+ "$ sf hardis:project:generate:bypass --apply-to-vrs",
12315
+ "$ sf hardis:project:generate:bypass --apply-to-triggers",
12316
+ "$ sf hardis:project:generate:bypass --metadata-source org"
12635
12317
  ],
12636
12318
  "flags": {
12637
12319
  "json": {
@@ -13014,14 +12696,12 @@
13014
12696
  "gitdelta:generate:project:hardis"
13015
12697
  ]
13016
12698
  },
13017
- "hardis:project:metadata:findduplicates": {
12699
+ "hardis:project:fix:profiletabs": {
13018
12700
  "aliases": [],
13019
12701
  "args": {},
13020
- "description": "find duplicate values in XML file(s).\n Find duplicate values in XML file(s). Keys to be checked can be configured in `config/sfdx-hardis.yml` using property metadataDuplicateFindKeys.\n\nDefault config :\nmetadataDuplicateFindKeys :\n[object Object]\n",
12702
+ "description": "\n## Command Behavior\n\n**Interactively updates tab visibility settings in Salesforce profiles, addressing a common issue where tab visibilities are not correctly retrieved by `sf project retrieve start`.**\n\nThis command provides a user-friendly interface to manage tab settings within your profile XML files, ensuring that your local project accurately reflects the intended tab configurations in your Salesforce org.\n\nKey functionalities:\n\n- **Interactive Tab Selection:** Displays a multi-select menu of all available tabs in your org, allowing you to choose which tabs to update.\n- **Visibility Control:** Lets you set the visibility for the selected tabs to either `DefaultOn` (Visible) or `Hidden`.\n- **Profile Selection:** Presents a multi-select menu of all .profile-meta.xml files in your project, allowing you to apply the tab visibility changes to specific profiles.\n- **XML Updates:** Modifies the <tabVisibilities> section of the selected profile XML files to reflect the chosen tab settings. If a tab visibility setting already exists for a selected tab, it will be updated; otherwise, a new one will be added.\n- **Sorted Output:** The <tabVisibilities> in the updated profile XML files are sorted alphabetically for consistency and readability.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Tooling API):** It queries the `TabDefinition` object using `soqlQueryTooling` to retrieve a list of all available tabs in the target org.\n- **File Discovery:** Uses `glob` to find all .profile-meta.xml files within the specified project path.\n- **Interactive Prompts:** Leverages the `prompts` library to create interactive menus for selecting tabs, visibility settings, and profiles.\n- **XML Parsing and Manipulation:** Uses `parseXmlFile` to read the content of profile XML files and `writeXmlFile` to write the modified content back. It manipulates the `tabVisibilities` array within the parsed XML to add or update tab settings.\n- **Array Sorting:** Employs the `sort-array` library to sort the `tabVisibilities` alphabetically by tab name.\n- **Logging:** Provides feedback to the user about which profiles have been updated and a summary of the changes.\n</details>\n",
13021
12703
  "examples": [
13022
- "\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Layout xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n <layoutSections>\n ...\n <layoutColumns>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n </layoutColumns>\n </layoutSections>\n</Layout>\n",
13023
- "\n$ sf hardis:project:metadata:findduplicates --file layout.layout-meta.xml\n[sfdx-hardis] Duplicate values in layout.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : Name\n",
13024
- "\n$ sf hardis:project.metadata:findduplicates -f \"force-app/main/default/**/*.xml\"\n[sfdx-hardis] hardis:project:metadata:findduplicates execution time 0:00:00.397\n[sfdx-hardis] Duplicate values in layout1.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : CreatedById\n\n[sfdx-hardis] Duplicate values in layout2.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : LastModifiedById, Name\n"
12704
+ "$ sf hardis:project:fix:profiletabs"
13025
12705
  ],
13026
12706
  "flags": {
13027
12707
  "json": {
@@ -13039,14 +12719,22 @@
13039
12719
  "multiple": false,
13040
12720
  "type": "option"
13041
12721
  },
13042
- "files": {
13043
- "char": "f",
13044
- "description": "XML metadata files path",
13045
- "name": "files",
12722
+ "path": {
12723
+ "char": "p",
12724
+ "description": "Root folder",
12725
+ "name": "path",
12726
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
13046
12727
  "hasDynamicHelp": false,
13047
- "multiple": true,
12728
+ "multiple": false,
13048
12729
  "type": "option"
13049
12730
  },
12731
+ "debug": {
12732
+ "char": "d",
12733
+ "description": "Activate debug mode (more logs)",
12734
+ "name": "debug",
12735
+ "allowNo": false,
12736
+ "type": "boolean"
12737
+ },
13050
12738
  "websocket": {
13051
12739
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
13052
12740
  "name": "websocket",
@@ -13059,18 +12747,227 @@
13059
12747
  "name": "skipauth",
13060
12748
  "allowNo": false,
13061
12749
  "type": "boolean"
13062
- }
13063
- },
13064
- "hasDynamicHelp": false,
13065
- "hiddenAliases": [],
13066
- "id": "hardis:project:metadata:findduplicates",
13067
- "pluginAlias": "sfdx-hardis",
13068
- "pluginName": "sfdx-hardis",
13069
- "pluginType": "core",
13070
- "strict": true,
13071
- "enableJsonFlag": true,
13072
- "metadataDuplicateFindKeys": {
13073
- "layout": [
12750
+ },
12751
+ "target-org": {
12752
+ "aliases": [
12753
+ "targetusername",
12754
+ "u"
12755
+ ],
12756
+ "char": "o",
12757
+ "deprecateAliases": true,
12758
+ "name": "target-org",
12759
+ "noCacheDefault": true,
12760
+ "required": true,
12761
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12762
+ "hasDynamicHelp": true,
12763
+ "multiple": false,
12764
+ "type": "option"
12765
+ }
12766
+ },
12767
+ "hasDynamicHelp": true,
12768
+ "hiddenAliases": [],
12769
+ "id": "hardis:project:fix:profiletabs",
12770
+ "pluginAlias": "sfdx-hardis",
12771
+ "pluginName": "sfdx-hardis",
12772
+ "pluginType": "core",
12773
+ "strict": true,
12774
+ "enableJsonFlag": true,
12775
+ "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
12776
+ "requiresProject": true,
12777
+ "isESM": true,
12778
+ "relativePath": [
12779
+ "lib",
12780
+ "commands",
12781
+ "hardis",
12782
+ "project",
12783
+ "fix",
12784
+ "profiletabs.js"
12785
+ ],
12786
+ "aliasPermutations": [],
12787
+ "permutations": [
12788
+ "hardis:project:fix:profiletabs",
12789
+ "project:hardis:fix:profiletabs",
12790
+ "project:fix:hardis:profiletabs",
12791
+ "project:fix:profiletabs:hardis",
12792
+ "hardis:fix:project:profiletabs",
12793
+ "fix:hardis:project:profiletabs",
12794
+ "fix:project:hardis:profiletabs",
12795
+ "fix:project:profiletabs:hardis",
12796
+ "hardis:fix:profiletabs:project",
12797
+ "fix:hardis:profiletabs:project",
12798
+ "fix:profiletabs:hardis:project",
12799
+ "fix:profiletabs:project:hardis",
12800
+ "hardis:project:profiletabs:fix",
12801
+ "project:hardis:profiletabs:fix",
12802
+ "project:profiletabs:hardis:fix",
12803
+ "project:profiletabs:fix:hardis",
12804
+ "hardis:profiletabs:project:fix",
12805
+ "profiletabs:hardis:project:fix",
12806
+ "profiletabs:project:hardis:fix",
12807
+ "profiletabs:project:fix:hardis",
12808
+ "hardis:profiletabs:fix:project",
12809
+ "profiletabs:hardis:fix:project",
12810
+ "profiletabs:fix:hardis:project",
12811
+ "profiletabs:fix:project:hardis"
12812
+ ]
12813
+ },
12814
+ "hardis:project:fix:v53flexipages": {
12815
+ "aliases": [],
12816
+ "args": {},
12817
+ "description": "\n## Command Behavior\n\n**Fixes Salesforce FlexiPages for compatibility with API Version 53.0 (Winter '22 release) by adding missing identifiers to component instances.**\n\nSalesforce introduced a change in API Version 53.0 that requires `identifier` tags within `componentInstance` and `fieldInstance` elements in FlexiPage metadata. If these identifiers are missing, deployments to orgs with API version 53.0 or higher will fail. This command automates the process of adding these missing identifiers, ensuring your FlexiPages remain deployable.\n\nKey functionalities:\n\n- **Targeted FlexiPage Processing:** Scans all .flexipage-meta.xml files within the specified root folder (defaults to current working directory).\n- **Identifier Injection:** Inserts a unique `identifier` tag (e.g., `SFDX_HARDIS_REPLACEMENT_ID`) into `componentInstance` and `fieldInstance` elements that lack one.\n\n**Important Note:** After running this command, ensure you update your `apiVersion` to `53.0` (or higher) in your `package.xml` and `sfdx-project.json` files.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Discovery:** Uses `glob` to find all .flexipage-meta.xml files.\n- **Content Reading:** Reads the XML content of each FlexiPage file.\n- **Regular Expression Replacement:** Employs a set of regular expressions to identify specific XML patterns (componentName.../componentName.../componentInstance, componentName.../componentName.../visibilityRule, fieldItem.../fieldItem.../fieldInstance) that are missing the `identifier` tag.\n- **Dynamic ID Generation:** For each match, it generates a unique identifier (e.g., `sfdxHardisIdX`) and injects it into the XML structure.\n- **File Writing:** If changes are made, the modified XML content is written back to the FlexiPage file using `fs.writeFile`.\n- **Logging:** Provides messages about which FlexiPages are being processed and a summary of the total number of identifiers added.\n</details>\n",
12818
+ "examples": [
12819
+ "$ sf hardis:project:fix:v53flexipages"
12820
+ ],
12821
+ "flags": {
12822
+ "json": {
12823
+ "description": "Format output as json.",
12824
+ "helpGroup": "GLOBAL",
12825
+ "name": "json",
12826
+ "allowNo": false,
12827
+ "type": "boolean"
12828
+ },
12829
+ "flags-dir": {
12830
+ "helpGroup": "GLOBAL",
12831
+ "name": "flags-dir",
12832
+ "summary": "Import flag values from a directory.",
12833
+ "hasDynamicHelp": false,
12834
+ "multiple": false,
12835
+ "type": "option"
12836
+ },
12837
+ "path": {
12838
+ "char": "p",
12839
+ "description": "Root folder",
12840
+ "name": "path",
12841
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12842
+ "hasDynamicHelp": false,
12843
+ "multiple": false,
12844
+ "type": "option"
12845
+ },
12846
+ "debug": {
12847
+ "char": "d",
12848
+ "description": "Activate debug mode (more logs)",
12849
+ "name": "debug",
12850
+ "allowNo": false,
12851
+ "type": "boolean"
12852
+ },
12853
+ "websocket": {
12854
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12855
+ "name": "websocket",
12856
+ "hasDynamicHelp": false,
12857
+ "multiple": false,
12858
+ "type": "option"
12859
+ },
12860
+ "skipauth": {
12861
+ "description": "Skip authentication check when a default username is required",
12862
+ "name": "skipauth",
12863
+ "allowNo": false,
12864
+ "type": "boolean"
12865
+ }
12866
+ },
12867
+ "hasDynamicHelp": false,
12868
+ "hiddenAliases": [],
12869
+ "id": "hardis:project:fix:v53flexipages",
12870
+ "pluginAlias": "sfdx-hardis",
12871
+ "pluginName": "sfdx-hardis",
12872
+ "pluginType": "core",
12873
+ "strict": true,
12874
+ "enableJsonFlag": true,
12875
+ "title": "Fix flexipages for v53",
12876
+ "requiresProject": true,
12877
+ "isESM": true,
12878
+ "relativePath": [
12879
+ "lib",
12880
+ "commands",
12881
+ "hardis",
12882
+ "project",
12883
+ "fix",
12884
+ "v53flexipages.js"
12885
+ ],
12886
+ "aliasPermutations": [],
12887
+ "permutations": [
12888
+ "hardis:project:fix:v53flexipages",
12889
+ "project:hardis:fix:v53flexipages",
12890
+ "project:fix:hardis:v53flexipages",
12891
+ "project:fix:v53flexipages:hardis",
12892
+ "hardis:fix:project:v53flexipages",
12893
+ "fix:hardis:project:v53flexipages",
12894
+ "fix:project:hardis:v53flexipages",
12895
+ "fix:project:v53flexipages:hardis",
12896
+ "hardis:fix:v53flexipages:project",
12897
+ "fix:hardis:v53flexipages:project",
12898
+ "fix:v53flexipages:hardis:project",
12899
+ "fix:v53flexipages:project:hardis",
12900
+ "hardis:project:v53flexipages:fix",
12901
+ "project:hardis:v53flexipages:fix",
12902
+ "project:v53flexipages:hardis:fix",
12903
+ "project:v53flexipages:fix:hardis",
12904
+ "hardis:v53flexipages:project:fix",
12905
+ "v53flexipages:hardis:project:fix",
12906
+ "v53flexipages:project:hardis:fix",
12907
+ "v53flexipages:project:fix:hardis",
12908
+ "hardis:v53flexipages:fix:project",
12909
+ "v53flexipages:hardis:fix:project",
12910
+ "v53flexipages:fix:hardis:project",
12911
+ "v53flexipages:fix:project:hardis"
12912
+ ]
12913
+ },
12914
+ "hardis:project:metadata:findduplicates": {
12915
+ "aliases": [],
12916
+ "args": {},
12917
+ "description": "find duplicate values in XML file(s).\n Find duplicate values in XML file(s). Keys to be checked can be configured in `config/sfdx-hardis.yml` using property metadataDuplicateFindKeys.\n\nDefault config :\nmetadataDuplicateFindKeys :\n[object Object]\n",
12918
+ "examples": [
12919
+ "\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Layout xmlns=\"http://soap.sforce.com/2006/04/metadata\">\n <layoutSections>\n ...\n <layoutColumns>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n <layoutItems>\n <behavior>Required</behavior>\n <field>Name</field>\n </layoutItems>\n </layoutColumns>\n </layoutSections>\n</Layout>\n",
12920
+ "\n$ sf hardis:project:metadata:findduplicates --file layout.layout-meta.xml\n[sfdx-hardis] Duplicate values in layout.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : Name\n",
12921
+ "\n$ sf hardis:project.metadata:findduplicates -f \"force-app/main/default/**/*.xml\"\n[sfdx-hardis] hardis:project:metadata:findduplicates execution time 0:00:00.397\n[sfdx-hardis] Duplicate values in layout1.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : CreatedById\n\n[sfdx-hardis] Duplicate values in layout2.layout-meta.xml\n - Key : Layout.layoutSections.layoutColumns.layoutItems.field\n - Values : LastModifiedById, Name\n"
12922
+ ],
12923
+ "flags": {
12924
+ "json": {
12925
+ "description": "Format output as json.",
12926
+ "helpGroup": "GLOBAL",
12927
+ "name": "json",
12928
+ "allowNo": false,
12929
+ "type": "boolean"
12930
+ },
12931
+ "flags-dir": {
12932
+ "helpGroup": "GLOBAL",
12933
+ "name": "flags-dir",
12934
+ "summary": "Import flag values from a directory.",
12935
+ "hasDynamicHelp": false,
12936
+ "multiple": false,
12937
+ "type": "option"
12938
+ },
12939
+ "files": {
12940
+ "char": "f",
12941
+ "description": "XML metadata files path",
12942
+ "name": "files",
12943
+ "hasDynamicHelp": false,
12944
+ "multiple": true,
12945
+ "type": "option"
12946
+ },
12947
+ "websocket": {
12948
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12949
+ "name": "websocket",
12950
+ "hasDynamicHelp": false,
12951
+ "multiple": false,
12952
+ "type": "option"
12953
+ },
12954
+ "skipauth": {
12955
+ "description": "Skip authentication check when a default username is required",
12956
+ "name": "skipauth",
12957
+ "allowNo": false,
12958
+ "type": "boolean"
12959
+ }
12960
+ },
12961
+ "hasDynamicHelp": false,
12962
+ "hiddenAliases": [],
12963
+ "id": "hardis:project:metadata:findduplicates",
12964
+ "pluginAlias": "sfdx-hardis",
12965
+ "pluginName": "sfdx-hardis",
12966
+ "pluginType": "core",
12967
+ "strict": true,
12968
+ "enableJsonFlag": true,
12969
+ "metadataDuplicateFindKeys": {
12970
+ "layout": [
13074
12971
  "Layout.layoutSections.layoutColumns.layoutItems.field",
13075
12972
  "Layout.quickActionListItems.quickActionName"
13076
12973
  ],
@@ -13127,6 +13024,109 @@
13127
13024
  "findduplicates:metadata:project:hardis"
13128
13025
  ]
13129
13026
  },
13027
+ "hardis:project:convert:profilestopermsets": {
13028
+ "aliases": [],
13029
+ "args": {},
13030
+ "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",
13031
+ "examples": [
13032
+ "$ sf hardis:project:convert:profilestopermsets"
13033
+ ],
13034
+ "flags": {
13035
+ "json": {
13036
+ "description": "Format output as json.",
13037
+ "helpGroup": "GLOBAL",
13038
+ "name": "json",
13039
+ "allowNo": false,
13040
+ "type": "boolean"
13041
+ },
13042
+ "flags-dir": {
13043
+ "helpGroup": "GLOBAL",
13044
+ "name": "flags-dir",
13045
+ "summary": "Import flag values from a directory.",
13046
+ "hasDynamicHelp": false,
13047
+ "multiple": false,
13048
+ "type": "option"
13049
+ },
13050
+ "except": {
13051
+ "char": "e",
13052
+ "description": "List of filters",
13053
+ "name": "except",
13054
+ "default": [],
13055
+ "hasDynamicHelp": false,
13056
+ "multiple": true,
13057
+ "type": "option"
13058
+ },
13059
+ "debug": {
13060
+ "char": "d",
13061
+ "description": "Activate debug mode (more logs)",
13062
+ "name": "debug",
13063
+ "allowNo": false,
13064
+ "type": "boolean"
13065
+ },
13066
+ "websocket": {
13067
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
13068
+ "name": "websocket",
13069
+ "hasDynamicHelp": false,
13070
+ "multiple": false,
13071
+ "type": "option"
13072
+ },
13073
+ "skipauth": {
13074
+ "description": "Skip authentication check when a default username is required",
13075
+ "name": "skipauth",
13076
+ "allowNo": false,
13077
+ "type": "boolean"
13078
+ }
13079
+ },
13080
+ "hasDynamicHelp": false,
13081
+ "hiddenAliases": [],
13082
+ "id": "hardis:project:convert:profilestopermsets",
13083
+ "pluginAlias": "sfdx-hardis",
13084
+ "pluginName": "sfdx-hardis",
13085
+ "pluginType": "core",
13086
+ "strict": true,
13087
+ "enableJsonFlag": true,
13088
+ "title": "Convert Profiles into Permission Sets",
13089
+ "requiresProject": true,
13090
+ "requiresSfdxPlugins": [
13091
+ "shane-sfdx-plugins"
13092
+ ],
13093
+ "isESM": true,
13094
+ "relativePath": [
13095
+ "lib",
13096
+ "commands",
13097
+ "hardis",
13098
+ "project",
13099
+ "convert",
13100
+ "profilestopermsets.js"
13101
+ ],
13102
+ "aliasPermutations": [],
13103
+ "permutations": [
13104
+ "hardis:project:convert:profilestopermsets",
13105
+ "project:hardis:convert:profilestopermsets",
13106
+ "project:convert:hardis:profilestopermsets",
13107
+ "project:convert:profilestopermsets:hardis",
13108
+ "hardis:convert:project:profilestopermsets",
13109
+ "convert:hardis:project:profilestopermsets",
13110
+ "convert:project:hardis:profilestopermsets",
13111
+ "convert:project:profilestopermsets:hardis",
13112
+ "hardis:convert:profilestopermsets:project",
13113
+ "convert:hardis:profilestopermsets:project",
13114
+ "convert:profilestopermsets:hardis:project",
13115
+ "convert:profilestopermsets:project:hardis",
13116
+ "hardis:project:profilestopermsets:convert",
13117
+ "project:hardis:profilestopermsets:convert",
13118
+ "project:profilestopermsets:hardis:convert",
13119
+ "project:profilestopermsets:convert:hardis",
13120
+ "hardis:profilestopermsets:project:convert",
13121
+ "profilestopermsets:hardis:project:convert",
13122
+ "profilestopermsets:project:hardis:convert",
13123
+ "profilestopermsets:project:convert:hardis",
13124
+ "hardis:profilestopermsets:convert:project",
13125
+ "profilestopermsets:hardis:convert:project",
13126
+ "profilestopermsets:convert:hardis:project",
13127
+ "profilestopermsets:convert:project:hardis"
13128
+ ]
13129
+ },
13130
13130
  "hardis:scratch:pool:create": {
13131
13131
  "aliases": [],
13132
13132
  "args": {},
@@ -15101,5 +15101,5 @@
15101
15101
  ]
15102
15102
  }
15103
15103
  },
15104
- "version": "6.1.2"
15104
+ "version": "6.1.3"
15105
15105
  }