sfdx-hardis 6.7.2 → 6.7.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.
@@ -132,13 +132,12 @@
132
132
  "clear:cache:hardis"
133
133
  ]
134
134
  },
135
- "hardis:auth:login": {
135
+ "hardis:config:get": {
136
136
  "aliases": [],
137
137
  "args": {},
138
- "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical flow involves:\n\n- **Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.\n- **Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).\n- **Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.\n- **`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.\n- **Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.\n</details>\n",
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",
139
139
  "examples": [
140
- "$ sf hardis:auth:login",
141
- "CI=true sf hardis:auth:login"
140
+ "$ sf hardis:project:deploy:sources:metadata"
142
141
  ],
143
142
  "flags": {
144
143
  "json": {
@@ -156,28 +155,20 @@
156
155
  "multiple": false,
157
156
  "type": "option"
158
157
  },
159
- "instanceurl": {
160
- "char": "r",
161
- "description": "URL of org instance",
162
- "name": "instanceurl",
158
+ "level": {
159
+ "char": "l",
160
+ "description": "project,branch or user",
161
+ "name": "level",
162
+ "default": "project",
163
163
  "hasDynamicHelp": false,
164
164
  "multiple": false,
165
+ "options": [
166
+ "project",
167
+ "branch",
168
+ "user"
169
+ ],
165
170
  "type": "option"
166
171
  },
167
- "devhub": {
168
- "char": "h",
169
- "description": "Also connect associated DevHub",
170
- "name": "devhub",
171
- "allowNo": false,
172
- "type": "boolean"
173
- },
174
- "scratchorg": {
175
- "char": "s",
176
- "description": "Scratch org",
177
- "name": "scratchorg",
178
- "allowNo": false,
179
- "type": "boolean"
180
- },
181
172
  "debug": {
182
173
  "char": "d",
183
174
  "description": "Activate debug mode (more logs)",
@@ -201,38 +192,39 @@
201
192
  },
202
193
  "hasDynamicHelp": false,
203
194
  "hiddenAliases": [],
204
- "id": "hardis:auth:login",
195
+ "id": "hardis:config:get",
205
196
  "pluginAlias": "sfdx-hardis",
206
197
  "pluginName": "sfdx-hardis",
207
198
  "pluginType": "core",
208
199
  "strict": true,
209
200
  "enableJsonFlag": true,
210
- "title": "Login",
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
- "auth",
218
- "login.js"
208
+ "config",
209
+ "get.js"
219
210
  ],
220
211
  "aliasPermutations": [],
221
212
  "permutations": [
222
- "hardis:auth:login",
223
- "auth:hardis:login",
224
- "auth:login:hardis",
225
- "hardis:login:auth",
226
- "login:hardis:auth",
227
- "login:auth: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": {
@@ -8295,6 +8295,113 @@
8295
8295
  "before-refresh:refresh:org:hardis"
8296
8296
  ]
8297
8297
  },
8298
+ "hardis:org:retrieve:packageconfig": {
8299
+ "aliases": [],
8300
+ "args": {},
8301
+ "description": "\n**Retrieves the installed package configuration from a Salesforce org and optionally updates the local project configuration.**\n\nThis command is useful for maintaining an accurate record of installed packages within your Salesforce project, which is crucial for managing dependencies and ensuring consistent deployments across environments.\n\nKey functionalities:\n\n- **Package Listing:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a list of all installed packages.\n- **Configuration Update:** Offers the option to update your local project's configuration with the retrieved list of installed packages. This can be beneficial for automating package installations during environment setup or CI/CD processes.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Org Connection:** It establishes a connection to the target Salesforce org using the provided or prompted username.\n- **Metadata Retrieval:** It utilizes `MetadataUtils.listInstalledPackages` to query the Salesforce org and obtain details about the installed packages.\n- **Interactive Prompt:** It uses the `prompts` library to ask the user whether they want to update their local project configuration with the retrieved package list.\n- **Configuration Management:** If the user confirms, it calls `managePackageConfig` to update the project's configuration file (likely `.sfdx-hardis.yml`) with the new package information.\n- **User Feedback:** Provides clear messages to the user about the success of the package retrieval and configuration update.\n</details>\n",
8302
+ "examples": [
8303
+ "$ sf hardis:org:retrieve:packageconfig",
8304
+ "sf hardis:org:retrieve:packageconfig -u myOrg"
8305
+ ],
8306
+ "flags": {
8307
+ "json": {
8308
+ "description": "Format output as json.",
8309
+ "helpGroup": "GLOBAL",
8310
+ "name": "json",
8311
+ "allowNo": false,
8312
+ "type": "boolean"
8313
+ },
8314
+ "flags-dir": {
8315
+ "helpGroup": "GLOBAL",
8316
+ "name": "flags-dir",
8317
+ "summary": "Import flag values from a directory.",
8318
+ "hasDynamicHelp": false,
8319
+ "multiple": false,
8320
+ "type": "option"
8321
+ },
8322
+ "debug": {
8323
+ "char": "d",
8324
+ "description": "Activate debug mode (more logs)",
8325
+ "name": "debug",
8326
+ "allowNo": false,
8327
+ "type": "boolean"
8328
+ },
8329
+ "websocket": {
8330
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
8331
+ "name": "websocket",
8332
+ "hasDynamicHelp": false,
8333
+ "multiple": false,
8334
+ "type": "option"
8335
+ },
8336
+ "skipauth": {
8337
+ "description": "Skip authentication check when a default username is required",
8338
+ "name": "skipauth",
8339
+ "allowNo": false,
8340
+ "type": "boolean"
8341
+ },
8342
+ "target-org": {
8343
+ "aliases": [
8344
+ "targetusername",
8345
+ "u"
8346
+ ],
8347
+ "char": "o",
8348
+ "deprecateAliases": true,
8349
+ "name": "target-org",
8350
+ "noCacheDefault": true,
8351
+ "required": true,
8352
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8353
+ "hasDynamicHelp": true,
8354
+ "multiple": false,
8355
+ "type": "option"
8356
+ }
8357
+ },
8358
+ "hasDynamicHelp": true,
8359
+ "hiddenAliases": [],
8360
+ "id": "hardis:org:retrieve:packageconfig",
8361
+ "pluginAlias": "sfdx-hardis",
8362
+ "pluginName": "sfdx-hardis",
8363
+ "pluginType": "core",
8364
+ "strict": true,
8365
+ "enableJsonFlag": true,
8366
+ "title": "Retrieve package configuration from an org",
8367
+ "requiresProject": false,
8368
+ "isESM": true,
8369
+ "relativePath": [
8370
+ "lib",
8371
+ "commands",
8372
+ "hardis",
8373
+ "org",
8374
+ "retrieve",
8375
+ "packageconfig.js"
8376
+ ],
8377
+ "aliasPermutations": [],
8378
+ "permutations": [
8379
+ "hardis:org:retrieve:packageconfig",
8380
+ "org:hardis:retrieve:packageconfig",
8381
+ "org:retrieve:hardis:packageconfig",
8382
+ "org:retrieve:packageconfig:hardis",
8383
+ "hardis:retrieve:org:packageconfig",
8384
+ "retrieve:hardis:org:packageconfig",
8385
+ "retrieve:org:hardis:packageconfig",
8386
+ "retrieve:org:packageconfig:hardis",
8387
+ "hardis:retrieve:packageconfig:org",
8388
+ "retrieve:hardis:packageconfig:org",
8389
+ "retrieve:packageconfig:hardis:org",
8390
+ "retrieve:packageconfig:org:hardis",
8391
+ "hardis:org:packageconfig:retrieve",
8392
+ "org:hardis:packageconfig:retrieve",
8393
+ "org:packageconfig:hardis:retrieve",
8394
+ "org:packageconfig:retrieve:hardis",
8395
+ "hardis:packageconfig:org:retrieve",
8396
+ "packageconfig:hardis:org:retrieve",
8397
+ "packageconfig:org:hardis:retrieve",
8398
+ "packageconfig:org:retrieve:hardis",
8399
+ "hardis:packageconfig:retrieve:org",
8400
+ "packageconfig:hardis:retrieve:org",
8401
+ "packageconfig:retrieve:hardis:org",
8402
+ "packageconfig:retrieve:org:hardis"
8403
+ ]
8404
+ },
8298
8405
  "hardis:org:test:apex": {
8299
8406
  "aliases": [],
8300
8407
  "args": {},
@@ -8415,13 +8522,14 @@
8415
8522
  "apex:test:org:hardis"
8416
8523
  ]
8417
8524
  },
8418
- "hardis:org:retrieve:packageconfig": {
8525
+ "hardis:org:user:activateinvalid": {
8419
8526
  "aliases": [],
8420
8527
  "args": {},
8421
- "description": "\n**Retrieves the installed package configuration from a Salesforce org and optionally updates the local project configuration.**\n\nThis command is useful for maintaining an accurate record of installed packages within your Salesforce project, which is crucial for managing dependencies and ensuring consistent deployments across environments.\n\nKey functionalities:\n\n- **Package Listing:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a list of all installed packages.\n- **Configuration Update:** Offers the option to update your local project's configuration with the retrieved list of installed packages. This can be beneficial for automating package installations during environment setup or CI/CD processes.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Org Connection:** It establishes a connection to the target Salesforce org using the provided or prompted username.\n- **Metadata Retrieval:** It utilizes `MetadataUtils.listInstalledPackages` to query the Salesforce org and obtain details about the installed packages.\n- **Interactive Prompt:** It uses the `prompts` library to ask the user whether they want to update their local project configuration with the retrieved package list.\n- **Configuration Management:** If the user confirms, it calls `managePackageConfig` to update the project's configuration file (likely `.sfdx-hardis.yml`) with the new package information.\n- **User Feedback:** Provides clear messages to the user about the success of the package retrieval and configuration update.\n</details>\n",
8528
+ "description": "Update sandbox users so their email is valid\n\n Example: replaces `toto@company.com.dev.invalid` with `toto@company.com.dev.invalid`\n\nSee article below\n\n[![Reactivate all the sandbox users with .invalid emails in 3 clicks](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-invalid-email.jpg)](https://nicolas.vuillamy.fr/reactivate-all-the-sandbox-users-with-invalid-emails-in-3-clicks-2265af4e3a3d)\n",
8422
8529
  "examples": [
8423
- "$ sf hardis:org:retrieve:packageconfig",
8424
- "sf hardis:org:retrieve:packageconfig -u myOrg"
8530
+ "$ sf hardis:org:user:activateinvalid",
8531
+ "$ sf hardis:org:user:activateinvalid --target-org my-user@myorg.com",
8532
+ "$ sf hardis:org:user:activateinvalid --profiles 'System Administrator,MyCustomProfile' --target-org my-user@myorg.com"
8425
8533
  ],
8426
8534
  "flags": {
8427
8535
  "json": {
@@ -8439,6 +8547,14 @@
8439
8547
  "multiple": false,
8440
8548
  "type": "option"
8441
8549
  },
8550
+ "profiles": {
8551
+ "char": "p",
8552
+ "description": "Comma-separated list of profiles names that you want to reactive users assigned to and with a .invalid email",
8553
+ "name": "profiles",
8554
+ "hasDynamicHelp": false,
8555
+ "multiple": false,
8556
+ "type": "option"
8557
+ },
8442
8558
  "debug": {
8443
8559
  "char": "d",
8444
8560
  "description": "Activate debug mode (more logs)",
@@ -8477,13 +8593,13 @@
8477
8593
  },
8478
8594
  "hasDynamicHelp": true,
8479
8595
  "hiddenAliases": [],
8480
- "id": "hardis:org:retrieve:packageconfig",
8596
+ "id": "hardis:org:user:activateinvalid",
8481
8597
  "pluginAlias": "sfdx-hardis",
8482
8598
  "pluginName": "sfdx-hardis",
8483
8599
  "pluginType": "core",
8484
8600
  "strict": true,
8485
8601
  "enableJsonFlag": true,
8486
- "title": "Retrieve package configuration from an org",
8602
+ "title": "Reactivate sandbox invalid users",
8487
8603
  "requiresProject": false,
8488
8604
  "isESM": true,
8489
8605
  "relativePath": [
@@ -8491,124 +8607,8 @@
8491
8607
  "commands",
8492
8608
  "hardis",
8493
8609
  "org",
8494
- "retrieve",
8495
- "packageconfig.js"
8496
- ],
8497
- "aliasPermutations": [],
8498
- "permutations": [
8499
- "hardis:org:retrieve:packageconfig",
8500
- "org:hardis:retrieve:packageconfig",
8501
- "org:retrieve:hardis:packageconfig",
8502
- "org:retrieve:packageconfig:hardis",
8503
- "hardis:retrieve:org:packageconfig",
8504
- "retrieve:hardis:org:packageconfig",
8505
- "retrieve:org:hardis:packageconfig",
8506
- "retrieve:org:packageconfig:hardis",
8507
- "hardis:retrieve:packageconfig:org",
8508
- "retrieve:hardis:packageconfig:org",
8509
- "retrieve:packageconfig:hardis:org",
8510
- "retrieve:packageconfig:org:hardis",
8511
- "hardis:org:packageconfig:retrieve",
8512
- "org:hardis:packageconfig:retrieve",
8513
- "org:packageconfig:hardis:retrieve",
8514
- "org:packageconfig:retrieve:hardis",
8515
- "hardis:packageconfig:org:retrieve",
8516
- "packageconfig:hardis:org:retrieve",
8517
- "packageconfig:org:hardis:retrieve",
8518
- "packageconfig:org:retrieve:hardis",
8519
- "hardis:packageconfig:retrieve:org",
8520
- "packageconfig:hardis:retrieve:org",
8521
- "packageconfig:retrieve:hardis:org",
8522
- "packageconfig:retrieve:org:hardis"
8523
- ]
8524
- },
8525
- "hardis:org:user:activateinvalid": {
8526
- "aliases": [],
8527
- "args": {},
8528
- "description": "Update sandbox users so their email is valid\n\n Example: replaces `toto@company.com.dev.invalid` with `toto@company.com.dev.invalid`\n\nSee article below\n\n[![Reactivate all the sandbox users with .invalid emails in 3 clicks](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-invalid-email.jpg)](https://nicolas.vuillamy.fr/reactivate-all-the-sandbox-users-with-invalid-emails-in-3-clicks-2265af4e3a3d)\n",
8529
- "examples": [
8530
- "$ sf hardis:org:user:activateinvalid",
8531
- "$ sf hardis:org:user:activateinvalid --target-org my-user@myorg.com",
8532
- "$ sf hardis:org:user:activateinvalid --profiles 'System Administrator,MyCustomProfile' --target-org my-user@myorg.com"
8533
- ],
8534
- "flags": {
8535
- "json": {
8536
- "description": "Format output as json.",
8537
- "helpGroup": "GLOBAL",
8538
- "name": "json",
8539
- "allowNo": false,
8540
- "type": "boolean"
8541
- },
8542
- "flags-dir": {
8543
- "helpGroup": "GLOBAL",
8544
- "name": "flags-dir",
8545
- "summary": "Import flag values from a directory.",
8546
- "hasDynamicHelp": false,
8547
- "multiple": false,
8548
- "type": "option"
8549
- },
8550
- "profiles": {
8551
- "char": "p",
8552
- "description": "Comma-separated list of profiles names that you want to reactive users assigned to and with a .invalid email",
8553
- "name": "profiles",
8554
- "hasDynamicHelp": false,
8555
- "multiple": false,
8556
- "type": "option"
8557
- },
8558
- "debug": {
8559
- "char": "d",
8560
- "description": "Activate debug mode (more logs)",
8561
- "name": "debug",
8562
- "allowNo": false,
8563
- "type": "boolean"
8564
- },
8565
- "websocket": {
8566
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
8567
- "name": "websocket",
8568
- "hasDynamicHelp": false,
8569
- "multiple": false,
8570
- "type": "option"
8571
- },
8572
- "skipauth": {
8573
- "description": "Skip authentication check when a default username is required",
8574
- "name": "skipauth",
8575
- "allowNo": false,
8576
- "type": "boolean"
8577
- },
8578
- "target-org": {
8579
- "aliases": [
8580
- "targetusername",
8581
- "u"
8582
- ],
8583
- "char": "o",
8584
- "deprecateAliases": true,
8585
- "name": "target-org",
8586
- "noCacheDefault": true,
8587
- "required": true,
8588
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8589
- "hasDynamicHelp": true,
8590
- "multiple": false,
8591
- "type": "option"
8592
- }
8593
- },
8594
- "hasDynamicHelp": true,
8595
- "hiddenAliases": [],
8596
- "id": "hardis:org:user:activateinvalid",
8597
- "pluginAlias": "sfdx-hardis",
8598
- "pluginName": "sfdx-hardis",
8599
- "pluginType": "core",
8600
- "strict": true,
8601
- "enableJsonFlag": true,
8602
- "title": "Reactivate sandbox invalid users",
8603
- "requiresProject": false,
8604
- "isESM": true,
8605
- "relativePath": [
8606
- "lib",
8607
- "commands",
8608
- "hardis",
8609
- "org",
8610
- "user",
8611
- "activateinvalid.js"
8610
+ "user",
8611
+ "activateinvalid.js"
8612
8612
  ],
8613
8613
  "aliasPermutations": [],
8614
8614
  "permutations": [
@@ -9689,12 +9689,12 @@
9689
9689
  "remotesites:audit:project:hardis"
9690
9690
  ]
9691
9691
  },
9692
- "hardis:project:clean:emptyitems": {
9692
+ "hardis:project:configure:auth": {
9693
9693
  "aliases": [],
9694
9694
  "args": {},
9695
- "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",
9695
+ "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",
9696
9696
  "examples": [
9697
- "$ sf hardis:project:clean:emptyitems"
9697
+ "$ sf hardis:project:configure:auth"
9698
9698
  ],
9699
9699
  "flags": {
9700
9700
  "json": {
@@ -9712,14 +9712,12 @@
9712
9712
  "multiple": false,
9713
9713
  "type": "option"
9714
9714
  },
9715
- "folder": {
9716
- "char": "f",
9717
- "description": "Root folder",
9718
- "name": "folder",
9719
- "default": "force-app",
9720
- "hasDynamicHelp": false,
9721
- "multiple": false,
9722
- "type": "option"
9715
+ "devhub": {
9716
+ "char": "b",
9717
+ "description": "Configure project DevHub",
9718
+ "name": "devhub",
9719
+ "allowNo": false,
9720
+ "type": "boolean"
9723
9721
  },
9724
9722
  "debug": {
9725
9723
  "char": "d",
@@ -9740,62 +9738,92 @@
9740
9738
  "name": "skipauth",
9741
9739
  "allowNo": false,
9742
9740
  "type": "boolean"
9741
+ },
9742
+ "target-org": {
9743
+ "aliases": [
9744
+ "targetusername",
9745
+ "u"
9746
+ ],
9747
+ "char": "o",
9748
+ "deprecateAliases": true,
9749
+ "name": "target-org",
9750
+ "noCacheDefault": true,
9751
+ "summary": "Username or alias of the target org.",
9752
+ "hasDynamicHelp": true,
9753
+ "multiple": false,
9754
+ "type": "option"
9755
+ },
9756
+ "target-dev-hub": {
9757
+ "aliases": [
9758
+ "targetdevhubusername"
9759
+ ],
9760
+ "char": "v",
9761
+ "deprecateAliases": true,
9762
+ "name": "target-dev-hub",
9763
+ "noCacheDefault": true,
9764
+ "required": false,
9765
+ "summary": "Username or alias of the Dev Hub org.",
9766
+ "hasDynamicHelp": true,
9767
+ "multiple": false,
9768
+ "type": "option"
9743
9769
  }
9744
9770
  },
9745
- "hasDynamicHelp": false,
9771
+ "hasDynamicHelp": true,
9746
9772
  "hiddenAliases": [],
9747
- "id": "hardis:project:clean:emptyitems",
9773
+ "id": "hardis:project:configure:auth",
9748
9774
  "pluginAlias": "sfdx-hardis",
9749
9775
  "pluginName": "sfdx-hardis",
9750
9776
  "pluginType": "core",
9751
9777
  "strict": true,
9752
9778
  "enableJsonFlag": true,
9753
- "title": "Clean retrieved empty items in dx sources",
9754
- "requiresProject": true,
9779
+ "title": "Configure authentication",
9780
+ "requiresProject": false,
9781
+ "requiresDependencies": [
9782
+ "openssl"
9783
+ ],
9755
9784
  "isESM": true,
9756
9785
  "relativePath": [
9757
9786
  "lib",
9758
9787
  "commands",
9759
9788
  "hardis",
9760
9789
  "project",
9761
- "clean",
9762
- "emptyitems.js"
9790
+ "configure",
9791
+ "auth.js"
9763
9792
  ],
9764
9793
  "aliasPermutations": [],
9765
9794
  "permutations": [
9766
- "hardis:project:clean:emptyitems",
9767
- "project:hardis:clean:emptyitems",
9768
- "project:clean:hardis:emptyitems",
9769
- "project:clean:emptyitems:hardis",
9770
- "hardis:clean:project:emptyitems",
9771
- "clean:hardis:project:emptyitems",
9772
- "clean:project:hardis:emptyitems",
9773
- "clean:project:emptyitems:hardis",
9774
- "hardis:clean:emptyitems:project",
9775
- "clean:hardis:emptyitems:project",
9776
- "clean:emptyitems:hardis:project",
9777
- "clean:emptyitems:project:hardis",
9778
- "hardis:project:emptyitems:clean",
9779
- "project:hardis:emptyitems:clean",
9780
- "project:emptyitems:hardis:clean",
9781
- "project:emptyitems:clean:hardis",
9782
- "hardis:emptyitems:project:clean",
9783
- "emptyitems:hardis:project:clean",
9784
- "emptyitems:project:hardis:clean",
9785
- "emptyitems:project:clean:hardis",
9786
- "hardis:emptyitems:clean:project",
9787
- "emptyitems:hardis:clean:project",
9788
- "emptyitems:clean:hardis:project",
9789
- "emptyitems:clean:project:hardis"
9795
+ "hardis:project:configure:auth",
9796
+ "project:hardis:configure:auth",
9797
+ "project:configure:hardis:auth",
9798
+ "project:configure:auth:hardis",
9799
+ "hardis:configure:project:auth",
9800
+ "configure:hardis:project:auth",
9801
+ "configure:project:hardis:auth",
9802
+ "configure:project:auth:hardis",
9803
+ "hardis:configure:auth:project",
9804
+ "configure:hardis:auth:project",
9805
+ "configure:auth:hardis:project",
9806
+ "configure:auth:project:hardis",
9807
+ "hardis:project:auth:configure",
9808
+ "project:hardis:auth:configure",
9809
+ "project:auth:hardis:configure",
9810
+ "project:auth:configure:hardis",
9811
+ "hardis:auth:project:configure",
9812
+ "auth:hardis:project:configure",
9813
+ "auth:project:hardis:configure",
9814
+ "auth:project:configure:hardis",
9815
+ "hardis:auth:configure:project",
9816
+ "auth:hardis:configure:project",
9817
+ "auth:configure:hardis:project",
9818
+ "auth:configure:project:hardis"
9790
9819
  ]
9791
9820
  },
9792
- "hardis:project:clean:filter-xml-content": {
9821
+ "hardis:project:convert:profilestopermsets": {
9793
9822
  "aliases": [],
9794
9823
  "args": {},
9795
- "description": "\n## Command Behavior\n\n**Filters the content of Salesforce metadata XML files to remove specific elements, enabling more granular deployments.**\n\nThis command addresses a common challenge in Salesforce development: deploying only a subset of metadata from an XML file when the target org might not support all elements or when certain elements are not desired. It allows you to define rules in a JSON configuration file to remove unwanted XML nodes.\n\nKey functionalities:\n\n- **Configurable Filtering:** Uses a JSON configuration file (e.g., `filter-config.json`) to define which XML elements to remove. This configuration specifies the XML tags to target and the values within those tags that should trigger removal.\n- **Targeted File Processing:** Processes XML files within a specified input folder (defaults to current directory) and writes the filtered content to an output folder.\n- **Example Use Cases:** Useful for scenarios like:\n - Removing references to features not enabled in the target org.\n - Stripping out specific profile permissions or field-level security settings.\n - Cleaning up metadata that is not relevant to a particular deployment.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Configuration Loading:** Reads the `filter-config.json` file, which contains an array of `filters`. Each filter defines a `name`, `description`, `folders` (where to apply the filter), `file_extensions`, and an `exclude_list`.\n- **File System Operations:** Copies the input folder to an output folder (if different) to avoid modifying original files directly. It then iterates through the files in the output folder that match the specified file extensions.\n- **XML Parsing and Manipulation:** For each matching XML file:\n - It uses `xml2js.Parser` to parse the XML content into a JavaScript object.\n - It recursively traverses the JavaScript object, applying the `filterElement` function.\n - The `filterElement` function checks for `type_tag` and `identifier_tag` defined in the `exclude_list`. If a match is found and the value is in the `excludeDef.values`, the element is removed from the XML structure.\n - After filtering, it uses `writeXmlFile` to write the modified JavaScript object back to the XML file.\n- **Logging:** Provides detailed logs about the filtering process, including which files are being processed and which elements are being filtered.\n- **Summary Reporting:** Tracks and reports on the files that have been updated due to filtering.\n</details>\n",
9824
+ "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",
9796
9825
  "examples": [
9797
- "sf hardis:project:clean:filter-xml-content -i \"./mdapi_output\"",
9798
- "sf hardis:project:clean:filter-xml-content -i \"retrieveUnpackaged\""
9826
+ "$ sf hardis:project:convert:profilestopermsets"
9799
9827
  ],
9800
9828
  "flags": {
9801
9829
  "json": {
@@ -9813,46 +9841,250 @@
9813
9841
  "multiple": false,
9814
9842
  "type": "option"
9815
9843
  },
9816
- "configfile": {
9817
- "char": "c",
9818
- "description": "Config JSON file path",
9819
- "name": "configfile",
9820
- "hasDynamicHelp": false,
9821
- "multiple": false,
9822
- "type": "option"
9823
- },
9824
- "inputfolder": {
9825
- "char": "i",
9826
- "description": "Input folder (default: \".\" )",
9827
- "name": "inputfolder",
9828
- "hasDynamicHelp": false,
9829
- "multiple": false,
9830
- "type": "option"
9831
- },
9832
- "outputfolder": {
9833
- "char": "f",
9834
- "description": "Output folder (default: parentFolder + _xml_content_filtered)",
9835
- "name": "outputfolder",
9844
+ "except": {
9845
+ "char": "e",
9846
+ "description": "List of filters",
9847
+ "name": "except",
9848
+ "default": [],
9836
9849
  "hasDynamicHelp": false,
9837
- "multiple": false,
9850
+ "multiple": true,
9838
9851
  "type": "option"
9839
9852
  },
9840
9853
  "debug": {
9841
- "description": "debug",
9854
+ "char": "d",
9855
+ "description": "Activate debug mode (more logs)",
9842
9856
  "name": "debug",
9843
9857
  "allowNo": false,
9844
9858
  "type": "boolean"
9845
9859
  },
9846
9860
  "websocket": {
9847
- "description": "websocket",
9861
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9848
9862
  "name": "websocket",
9849
9863
  "hasDynamicHelp": false,
9850
9864
  "multiple": false,
9851
9865
  "type": "option"
9852
- }
9853
- },
9854
- "hasDynamicHelp": false,
9855
- "hiddenAliases": [],
9866
+ },
9867
+ "skipauth": {
9868
+ "description": "Skip authentication check when a default username is required",
9869
+ "name": "skipauth",
9870
+ "allowNo": false,
9871
+ "type": "boolean"
9872
+ }
9873
+ },
9874
+ "hasDynamicHelp": false,
9875
+ "hiddenAliases": [],
9876
+ "id": "hardis:project:convert:profilestopermsets",
9877
+ "pluginAlias": "sfdx-hardis",
9878
+ "pluginName": "sfdx-hardis",
9879
+ "pluginType": "core",
9880
+ "strict": true,
9881
+ "enableJsonFlag": true,
9882
+ "title": "Convert Profiles into Permission Sets",
9883
+ "requiresProject": true,
9884
+ "requiresSfdxPlugins": [
9885
+ "shane-sfdx-plugins"
9886
+ ],
9887
+ "isESM": true,
9888
+ "relativePath": [
9889
+ "lib",
9890
+ "commands",
9891
+ "hardis",
9892
+ "project",
9893
+ "convert",
9894
+ "profilestopermsets.js"
9895
+ ],
9896
+ "aliasPermutations": [],
9897
+ "permutations": [
9898
+ "hardis:project:convert:profilestopermsets",
9899
+ "project:hardis:convert:profilestopermsets",
9900
+ "project:convert:hardis:profilestopermsets",
9901
+ "project:convert:profilestopermsets:hardis",
9902
+ "hardis:convert:project:profilestopermsets",
9903
+ "convert:hardis:project:profilestopermsets",
9904
+ "convert:project:hardis:profilestopermsets",
9905
+ "convert:project:profilestopermsets:hardis",
9906
+ "hardis:convert:profilestopermsets:project",
9907
+ "convert:hardis:profilestopermsets:project",
9908
+ "convert:profilestopermsets:hardis:project",
9909
+ "convert:profilestopermsets:project:hardis",
9910
+ "hardis:project:profilestopermsets:convert",
9911
+ "project:hardis:profilestopermsets:convert",
9912
+ "project:profilestopermsets:hardis:convert",
9913
+ "project:profilestopermsets:convert:hardis",
9914
+ "hardis:profilestopermsets:project:convert",
9915
+ "profilestopermsets:hardis:project:convert",
9916
+ "profilestopermsets:project:hardis:convert",
9917
+ "profilestopermsets:project:convert:hardis",
9918
+ "hardis:profilestopermsets:convert:project",
9919
+ "profilestopermsets:hardis:convert:project",
9920
+ "profilestopermsets:convert:hardis:project",
9921
+ "profilestopermsets:convert:project:hardis"
9922
+ ]
9923
+ },
9924
+ "hardis:project:clean:emptyitems": {
9925
+ "aliases": [],
9926
+ "args": {},
9927
+ "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",
9928
+ "examples": [
9929
+ "$ sf hardis:project:clean:emptyitems"
9930
+ ],
9931
+ "flags": {
9932
+ "json": {
9933
+ "description": "Format output as json.",
9934
+ "helpGroup": "GLOBAL",
9935
+ "name": "json",
9936
+ "allowNo": false,
9937
+ "type": "boolean"
9938
+ },
9939
+ "flags-dir": {
9940
+ "helpGroup": "GLOBAL",
9941
+ "name": "flags-dir",
9942
+ "summary": "Import flag values from a directory.",
9943
+ "hasDynamicHelp": false,
9944
+ "multiple": false,
9945
+ "type": "option"
9946
+ },
9947
+ "folder": {
9948
+ "char": "f",
9949
+ "description": "Root folder",
9950
+ "name": "folder",
9951
+ "default": "force-app",
9952
+ "hasDynamicHelp": false,
9953
+ "multiple": false,
9954
+ "type": "option"
9955
+ },
9956
+ "debug": {
9957
+ "char": "d",
9958
+ "description": "Activate debug mode (more logs)",
9959
+ "name": "debug",
9960
+ "allowNo": false,
9961
+ "type": "boolean"
9962
+ },
9963
+ "websocket": {
9964
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9965
+ "name": "websocket",
9966
+ "hasDynamicHelp": false,
9967
+ "multiple": false,
9968
+ "type": "option"
9969
+ },
9970
+ "skipauth": {
9971
+ "description": "Skip authentication check when a default username is required",
9972
+ "name": "skipauth",
9973
+ "allowNo": false,
9974
+ "type": "boolean"
9975
+ }
9976
+ },
9977
+ "hasDynamicHelp": false,
9978
+ "hiddenAliases": [],
9979
+ "id": "hardis:project:clean:emptyitems",
9980
+ "pluginAlias": "sfdx-hardis",
9981
+ "pluginName": "sfdx-hardis",
9982
+ "pluginType": "core",
9983
+ "strict": true,
9984
+ "enableJsonFlag": true,
9985
+ "title": "Clean retrieved empty items in dx sources",
9986
+ "requiresProject": true,
9987
+ "isESM": true,
9988
+ "relativePath": [
9989
+ "lib",
9990
+ "commands",
9991
+ "hardis",
9992
+ "project",
9993
+ "clean",
9994
+ "emptyitems.js"
9995
+ ],
9996
+ "aliasPermutations": [],
9997
+ "permutations": [
9998
+ "hardis:project:clean:emptyitems",
9999
+ "project:hardis:clean:emptyitems",
10000
+ "project:clean:hardis:emptyitems",
10001
+ "project:clean:emptyitems:hardis",
10002
+ "hardis:clean:project:emptyitems",
10003
+ "clean:hardis:project:emptyitems",
10004
+ "clean:project:hardis:emptyitems",
10005
+ "clean:project:emptyitems:hardis",
10006
+ "hardis:clean:emptyitems:project",
10007
+ "clean:hardis:emptyitems:project",
10008
+ "clean:emptyitems:hardis:project",
10009
+ "clean:emptyitems:project:hardis",
10010
+ "hardis:project:emptyitems:clean",
10011
+ "project:hardis:emptyitems:clean",
10012
+ "project:emptyitems:hardis:clean",
10013
+ "project:emptyitems:clean:hardis",
10014
+ "hardis:emptyitems:project:clean",
10015
+ "emptyitems:hardis:project:clean",
10016
+ "emptyitems:project:hardis:clean",
10017
+ "emptyitems:project:clean:hardis",
10018
+ "hardis:emptyitems:clean:project",
10019
+ "emptyitems:hardis:clean:project",
10020
+ "emptyitems:clean:hardis:project",
10021
+ "emptyitems:clean:project:hardis"
10022
+ ]
10023
+ },
10024
+ "hardis:project:clean:filter-xml-content": {
10025
+ "aliases": [],
10026
+ "args": {},
10027
+ "description": "\n## Command Behavior\n\n**Filters the content of Salesforce metadata XML files to remove specific elements, enabling more granular deployments.**\n\nThis command addresses a common challenge in Salesforce development: deploying only a subset of metadata from an XML file when the target org might not support all elements or when certain elements are not desired. It allows you to define rules in a JSON configuration file to remove unwanted XML nodes.\n\nKey functionalities:\n\n- **Configurable Filtering:** Uses a JSON configuration file (e.g., `filter-config.json`) to define which XML elements to remove. This configuration specifies the XML tags to target and the values within those tags that should trigger removal.\n- **Targeted File Processing:** Processes XML files within a specified input folder (defaults to current directory) and writes the filtered content to an output folder.\n- **Example Use Cases:** Useful for scenarios like:\n - Removing references to features not enabled in the target org.\n - Stripping out specific profile permissions or field-level security settings.\n - Cleaning up metadata that is not relevant to a particular deployment.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Configuration Loading:** Reads the `filter-config.json` file, which contains an array of `filters`. Each filter defines a `name`, `description`, `folders` (where to apply the filter), `file_extensions`, and an `exclude_list`.\n- **File System Operations:** Copies the input folder to an output folder (if different) to avoid modifying original files directly. It then iterates through the files in the output folder that match the specified file extensions.\n- **XML Parsing and Manipulation:** For each matching XML file:\n - It uses `xml2js.Parser` to parse the XML content into a JavaScript object.\n - It recursively traverses the JavaScript object, applying the `filterElement` function.\n - The `filterElement` function checks for `type_tag` and `identifier_tag` defined in the `exclude_list`. If a match is found and the value is in the `excludeDef.values`, the element is removed from the XML structure.\n - After filtering, it uses `writeXmlFile` to write the modified JavaScript object back to the XML file.\n- **Logging:** Provides detailed logs about the filtering process, including which files are being processed and which elements are being filtered.\n- **Summary Reporting:** Tracks and reports on the files that have been updated due to filtering.\n</details>\n",
10028
+ "examples": [
10029
+ "sf hardis:project:clean:filter-xml-content -i \"./mdapi_output\"",
10030
+ "sf hardis:project:clean:filter-xml-content -i \"retrieveUnpackaged\""
10031
+ ],
10032
+ "flags": {
10033
+ "json": {
10034
+ "description": "Format output as json.",
10035
+ "helpGroup": "GLOBAL",
10036
+ "name": "json",
10037
+ "allowNo": false,
10038
+ "type": "boolean"
10039
+ },
10040
+ "flags-dir": {
10041
+ "helpGroup": "GLOBAL",
10042
+ "name": "flags-dir",
10043
+ "summary": "Import flag values from a directory.",
10044
+ "hasDynamicHelp": false,
10045
+ "multiple": false,
10046
+ "type": "option"
10047
+ },
10048
+ "configfile": {
10049
+ "char": "c",
10050
+ "description": "Config JSON file path",
10051
+ "name": "configfile",
10052
+ "hasDynamicHelp": false,
10053
+ "multiple": false,
10054
+ "type": "option"
10055
+ },
10056
+ "inputfolder": {
10057
+ "char": "i",
10058
+ "description": "Input folder (default: \".\" )",
10059
+ "name": "inputfolder",
10060
+ "hasDynamicHelp": false,
10061
+ "multiple": false,
10062
+ "type": "option"
10063
+ },
10064
+ "outputfolder": {
10065
+ "char": "f",
10066
+ "description": "Output folder (default: parentFolder + _xml_content_filtered)",
10067
+ "name": "outputfolder",
10068
+ "hasDynamicHelp": false,
10069
+ "multiple": false,
10070
+ "type": "option"
10071
+ },
10072
+ "debug": {
10073
+ "description": "debug",
10074
+ "name": "debug",
10075
+ "allowNo": false,
10076
+ "type": "boolean"
10077
+ },
10078
+ "websocket": {
10079
+ "description": "websocket",
10080
+ "name": "websocket",
10081
+ "hasDynamicHelp": false,
10082
+ "multiple": false,
10083
+ "type": "option"
10084
+ }
10085
+ },
10086
+ "hasDynamicHelp": false,
10087
+ "hiddenAliases": [],
9856
10088
  "id": "hardis:project:clean:filter-xml-content",
9857
10089
  "pluginAlias": "sfdx-hardis",
9858
10090
  "pluginName": "sfdx-hardis",
@@ -11131,494 +11363,47 @@
11131
11363
  "hiddenAliases": [],
11132
11364
  "id": "hardis:project:clean:xml",
11133
11365
  "pluginAlias": "sfdx-hardis",
11134
- "pluginName": "sfdx-hardis",
11135
- "pluginType": "core",
11136
- "strict": true,
11137
- "enableJsonFlag": true,
11138
- "title": "Clean retrieved empty items in dx sources",
11139
- "requiresProject": true,
11140
- "isESM": true,
11141
- "relativePath": [
11142
- "lib",
11143
- "commands",
11144
- "hardis",
11145
- "project",
11146
- "clean",
11147
- "xml.js"
11148
- ],
11149
- "aliasPermutations": [],
11150
- "permutations": [
11151
- "hardis:project:clean:xml",
11152
- "project:hardis:clean:xml",
11153
- "project:clean:hardis:xml",
11154
- "project:clean:xml:hardis",
11155
- "hardis:clean:project:xml",
11156
- "clean:hardis:project:xml",
11157
- "clean:project:hardis:xml",
11158
- "clean:project:xml:hardis",
11159
- "hardis:clean:xml:project",
11160
- "clean:hardis:xml:project",
11161
- "clean:xml:hardis:project",
11162
- "clean:xml:project:hardis",
11163
- "hardis:project:xml:clean",
11164
- "project:hardis:xml:clean",
11165
- "project:xml:hardis:clean",
11166
- "project:xml:clean:hardis",
11167
- "hardis:xml:project:clean",
11168
- "xml:hardis:project:clean",
11169
- "xml:project:hardis:clean",
11170
- "xml:project:clean:hardis",
11171
- "hardis:xml:clean:project",
11172
- "xml:hardis:clean:project",
11173
- "xml:clean:hardis:project",
11174
- "xml:clean:project:hardis"
11175
- ]
11176
- },
11177
- "hardis:project:configure:auth": {
11178
- "aliases": [],
11179
- "args": {},
11180
- "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",
11181
- "examples": [
11182
- "$ sf hardis:project:configure:auth"
11183
- ],
11184
- "flags": {
11185
- "json": {
11186
- "description": "Format output as json.",
11187
- "helpGroup": "GLOBAL",
11188
- "name": "json",
11189
- "allowNo": false,
11190
- "type": "boolean"
11191
- },
11192
- "flags-dir": {
11193
- "helpGroup": "GLOBAL",
11194
- "name": "flags-dir",
11195
- "summary": "Import flag values from a directory.",
11196
- "hasDynamicHelp": false,
11197
- "multiple": false,
11198
- "type": "option"
11199
- },
11200
- "devhub": {
11201
- "char": "b",
11202
- "description": "Configure project DevHub",
11203
- "name": "devhub",
11204
- "allowNo": false,
11205
- "type": "boolean"
11206
- },
11207
- "debug": {
11208
- "char": "d",
11209
- "description": "Activate debug mode (more logs)",
11210
- "name": "debug",
11211
- "allowNo": false,
11212
- "type": "boolean"
11213
- },
11214
- "websocket": {
11215
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11216
- "name": "websocket",
11217
- "hasDynamicHelp": false,
11218
- "multiple": false,
11219
- "type": "option"
11220
- },
11221
- "skipauth": {
11222
- "description": "Skip authentication check when a default username is required",
11223
- "name": "skipauth",
11224
- "allowNo": false,
11225
- "type": "boolean"
11226
- },
11227
- "target-org": {
11228
- "aliases": [
11229
- "targetusername",
11230
- "u"
11231
- ],
11232
- "char": "o",
11233
- "deprecateAliases": true,
11234
- "name": "target-org",
11235
- "noCacheDefault": true,
11236
- "summary": "Username or alias of the target org.",
11237
- "hasDynamicHelp": true,
11238
- "multiple": false,
11239
- "type": "option"
11240
- },
11241
- "target-dev-hub": {
11242
- "aliases": [
11243
- "targetdevhubusername"
11244
- ],
11245
- "char": "v",
11246
- "deprecateAliases": true,
11247
- "name": "target-dev-hub",
11248
- "noCacheDefault": true,
11249
- "required": false,
11250
- "summary": "Username or alias of the Dev Hub org.",
11251
- "hasDynamicHelp": true,
11252
- "multiple": false,
11253
- "type": "option"
11254
- }
11255
- },
11256
- "hasDynamicHelp": true,
11257
- "hiddenAliases": [],
11258
- "id": "hardis:project:configure:auth",
11259
- "pluginAlias": "sfdx-hardis",
11260
- "pluginName": "sfdx-hardis",
11261
- "pluginType": "core",
11262
- "strict": true,
11263
- "enableJsonFlag": true,
11264
- "title": "Configure authentication",
11265
- "requiresProject": false,
11266
- "requiresDependencies": [
11267
- "openssl"
11268
- ],
11269
- "isESM": true,
11270
- "relativePath": [
11271
- "lib",
11272
- "commands",
11273
- "hardis",
11274
- "project",
11275
- "configure",
11276
- "auth.js"
11277
- ],
11278
- "aliasPermutations": [],
11279
- "permutations": [
11280
- "hardis:project:configure:auth",
11281
- "project:hardis:configure:auth",
11282
- "project:configure:hardis:auth",
11283
- "project:configure:auth:hardis",
11284
- "hardis:configure:project:auth",
11285
- "configure:hardis:project:auth",
11286
- "configure:project:hardis:auth",
11287
- "configure:project:auth:hardis",
11288
- "hardis:configure:auth:project",
11289
- "configure:hardis:auth:project",
11290
- "configure:auth:hardis:project",
11291
- "configure:auth:project:hardis",
11292
- "hardis:project:auth:configure",
11293
- "project:hardis:auth:configure",
11294
- "project:auth:hardis:configure",
11295
- "project:auth:configure:hardis",
11296
- "hardis:auth:project:configure",
11297
- "auth:hardis:project:configure",
11298
- "auth:project:hardis:configure",
11299
- "auth:project:configure:hardis",
11300
- "hardis:auth:configure:project",
11301
- "auth:hardis:configure:project",
11302
- "auth:configure:hardis:project",
11303
- "auth:configure:project:hardis"
11304
- ]
11305
- },
11306
- "hardis:project:convert:profilestopermsets": {
11307
- "aliases": [],
11308
- "args": {},
11309
- "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",
11310
- "examples": [
11311
- "$ sf hardis:project:convert:profilestopermsets"
11312
- ],
11313
- "flags": {
11314
- "json": {
11315
- "description": "Format output as json.",
11316
- "helpGroup": "GLOBAL",
11317
- "name": "json",
11318
- "allowNo": false,
11319
- "type": "boolean"
11320
- },
11321
- "flags-dir": {
11322
- "helpGroup": "GLOBAL",
11323
- "name": "flags-dir",
11324
- "summary": "Import flag values from a directory.",
11325
- "hasDynamicHelp": false,
11326
- "multiple": false,
11327
- "type": "option"
11328
- },
11329
- "except": {
11330
- "char": "e",
11331
- "description": "List of filters",
11332
- "name": "except",
11333
- "default": [],
11334
- "hasDynamicHelp": false,
11335
- "multiple": true,
11336
- "type": "option"
11337
- },
11338
- "debug": {
11339
- "char": "d",
11340
- "description": "Activate debug mode (more logs)",
11341
- "name": "debug",
11342
- "allowNo": false,
11343
- "type": "boolean"
11344
- },
11345
- "websocket": {
11346
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11347
- "name": "websocket",
11348
- "hasDynamicHelp": false,
11349
- "multiple": false,
11350
- "type": "option"
11351
- },
11352
- "skipauth": {
11353
- "description": "Skip authentication check when a default username is required",
11354
- "name": "skipauth",
11355
- "allowNo": false,
11356
- "type": "boolean"
11357
- }
11358
- },
11359
- "hasDynamicHelp": false,
11360
- "hiddenAliases": [],
11361
- "id": "hardis:project:convert:profilestopermsets",
11362
- "pluginAlias": "sfdx-hardis",
11363
- "pluginName": "sfdx-hardis",
11364
- "pluginType": "core",
11365
- "strict": true,
11366
- "enableJsonFlag": true,
11367
- "title": "Convert Profiles into Permission Sets",
11368
- "requiresProject": true,
11369
- "requiresSfdxPlugins": [
11370
- "shane-sfdx-plugins"
11371
- ],
11372
- "isESM": true,
11373
- "relativePath": [
11374
- "lib",
11375
- "commands",
11376
- "hardis",
11377
- "project",
11378
- "convert",
11379
- "profilestopermsets.js"
11380
- ],
11381
- "aliasPermutations": [],
11382
- "permutations": [
11383
- "hardis:project:convert:profilestopermsets",
11384
- "project:hardis:convert:profilestopermsets",
11385
- "project:convert:hardis:profilestopermsets",
11386
- "project:convert:profilestopermsets:hardis",
11387
- "hardis:convert:project:profilestopermsets",
11388
- "convert:hardis:project:profilestopermsets",
11389
- "convert:project:hardis:profilestopermsets",
11390
- "convert:project:profilestopermsets:hardis",
11391
- "hardis:convert:profilestopermsets:project",
11392
- "convert:hardis:profilestopermsets:project",
11393
- "convert:profilestopermsets:hardis:project",
11394
- "convert:profilestopermsets:project:hardis",
11395
- "hardis:project:profilestopermsets:convert",
11396
- "project:hardis:profilestopermsets:convert",
11397
- "project:profilestopermsets:hardis:convert",
11398
- "project:profilestopermsets:convert:hardis",
11399
- "hardis:profilestopermsets:project:convert",
11400
- "profilestopermsets:hardis:project:convert",
11401
- "profilestopermsets:project:hardis:convert",
11402
- "profilestopermsets:project:convert:hardis",
11403
- "hardis:profilestopermsets:convert:project",
11404
- "profilestopermsets:hardis:convert:project",
11405
- "profilestopermsets:convert:hardis:project",
11406
- "profilestopermsets:convert:project:hardis"
11407
- ]
11408
- },
11409
- "hardis:project:fix:profiletabs": {
11410
- "aliases": [],
11411
- "args": {},
11412
- "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",
11413
- "examples": [
11414
- "$ sf hardis:project:fix:profiletabs"
11415
- ],
11416
- "flags": {
11417
- "json": {
11418
- "description": "Format output as json.",
11419
- "helpGroup": "GLOBAL",
11420
- "name": "json",
11421
- "allowNo": false,
11422
- "type": "boolean"
11423
- },
11424
- "flags-dir": {
11425
- "helpGroup": "GLOBAL",
11426
- "name": "flags-dir",
11427
- "summary": "Import flag values from a directory.",
11428
- "hasDynamicHelp": false,
11429
- "multiple": false,
11430
- "type": "option"
11431
- },
11432
- "path": {
11433
- "char": "p",
11434
- "description": "Root folder",
11435
- "name": "path",
11436
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
11437
- "hasDynamicHelp": false,
11438
- "multiple": false,
11439
- "type": "option"
11440
- },
11441
- "debug": {
11442
- "char": "d",
11443
- "description": "Activate debug mode (more logs)",
11444
- "name": "debug",
11445
- "allowNo": false,
11446
- "type": "boolean"
11447
- },
11448
- "websocket": {
11449
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11450
- "name": "websocket",
11451
- "hasDynamicHelp": false,
11452
- "multiple": false,
11453
- "type": "option"
11454
- },
11455
- "skipauth": {
11456
- "description": "Skip authentication check when a default username is required",
11457
- "name": "skipauth",
11458
- "allowNo": false,
11459
- "type": "boolean"
11460
- },
11461
- "target-org": {
11462
- "aliases": [
11463
- "targetusername",
11464
- "u"
11465
- ],
11466
- "char": "o",
11467
- "deprecateAliases": true,
11468
- "name": "target-org",
11469
- "noCacheDefault": true,
11470
- "required": true,
11471
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
11472
- "hasDynamicHelp": true,
11473
- "multiple": false,
11474
- "type": "option"
11475
- }
11476
- },
11477
- "hasDynamicHelp": true,
11478
- "hiddenAliases": [],
11479
- "id": "hardis:project:fix:profiletabs",
11480
- "pluginAlias": "sfdx-hardis",
11481
- "pluginName": "sfdx-hardis",
11482
- "pluginType": "core",
11483
- "strict": true,
11484
- "enableJsonFlag": true,
11485
- "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
11486
- "requiresProject": true,
11487
- "isESM": true,
11488
- "relativePath": [
11489
- "lib",
11490
- "commands",
11491
- "hardis",
11492
- "project",
11493
- "fix",
11494
- "profiletabs.js"
11495
- ],
11496
- "aliasPermutations": [],
11497
- "permutations": [
11498
- "hardis:project:fix:profiletabs",
11499
- "project:hardis:fix:profiletabs",
11500
- "project:fix:hardis:profiletabs",
11501
- "project:fix:profiletabs:hardis",
11502
- "hardis:fix:project:profiletabs",
11503
- "fix:hardis:project:profiletabs",
11504
- "fix:project:hardis:profiletabs",
11505
- "fix:project:profiletabs:hardis",
11506
- "hardis:fix:profiletabs:project",
11507
- "fix:hardis:profiletabs:project",
11508
- "fix:profiletabs:hardis:project",
11509
- "fix:profiletabs:project:hardis",
11510
- "hardis:project:profiletabs:fix",
11511
- "project:hardis:profiletabs:fix",
11512
- "project:profiletabs:hardis:fix",
11513
- "project:profiletabs:fix:hardis",
11514
- "hardis:profiletabs:project:fix",
11515
- "profiletabs:hardis:project:fix",
11516
- "profiletabs:project:hardis:fix",
11517
- "profiletabs:project:fix:hardis",
11518
- "hardis:profiletabs:fix:project",
11519
- "profiletabs:hardis:fix:project",
11520
- "profiletabs:fix:hardis:project",
11521
- "profiletabs:fix:project:hardis"
11522
- ]
11523
- },
11524
- "hardis:project:fix:v53flexipages": {
11525
- "aliases": [],
11526
- "args": {},
11527
- "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",
11528
- "examples": [
11529
- "$ sf hardis:project:fix:v53flexipages"
11530
- ],
11531
- "flags": {
11532
- "json": {
11533
- "description": "Format output as json.",
11534
- "helpGroup": "GLOBAL",
11535
- "name": "json",
11536
- "allowNo": false,
11537
- "type": "boolean"
11538
- },
11539
- "flags-dir": {
11540
- "helpGroup": "GLOBAL",
11541
- "name": "flags-dir",
11542
- "summary": "Import flag values from a directory.",
11543
- "hasDynamicHelp": false,
11544
- "multiple": false,
11545
- "type": "option"
11546
- },
11547
- "path": {
11548
- "char": "p",
11549
- "description": "Root folder",
11550
- "name": "path",
11551
- "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
11552
- "hasDynamicHelp": false,
11553
- "multiple": false,
11554
- "type": "option"
11555
- },
11556
- "debug": {
11557
- "char": "d",
11558
- "description": "Activate debug mode (more logs)",
11559
- "name": "debug",
11560
- "allowNo": false,
11561
- "type": "boolean"
11562
- },
11563
- "websocket": {
11564
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11565
- "name": "websocket",
11566
- "hasDynamicHelp": false,
11567
- "multiple": false,
11568
- "type": "option"
11569
- },
11570
- "skipauth": {
11571
- "description": "Skip authentication check when a default username is required",
11572
- "name": "skipauth",
11573
- "allowNo": false,
11574
- "type": "boolean"
11575
- }
11576
- },
11577
- "hasDynamicHelp": false,
11578
- "hiddenAliases": [],
11579
- "id": "hardis:project:fix:v53flexipages",
11580
- "pluginAlias": "sfdx-hardis",
11581
- "pluginName": "sfdx-hardis",
11582
- "pluginType": "core",
11583
- "strict": true,
11584
- "enableJsonFlag": true,
11585
- "title": "Fix flexipages for v53",
11586
- "requiresProject": true,
11587
- "isESM": true,
11588
- "relativePath": [
11589
- "lib",
11590
- "commands",
11591
- "hardis",
11592
- "project",
11593
- "fix",
11594
- "v53flexipages.js"
11595
- ],
11596
- "aliasPermutations": [],
11597
- "permutations": [
11598
- "hardis:project:fix:v53flexipages",
11599
- "project:hardis:fix:v53flexipages",
11600
- "project:fix:hardis:v53flexipages",
11601
- "project:fix:v53flexipages:hardis",
11602
- "hardis:fix:project:v53flexipages",
11603
- "fix:hardis:project:v53flexipages",
11604
- "fix:project:hardis:v53flexipages",
11605
- "fix:project:v53flexipages:hardis",
11606
- "hardis:fix:v53flexipages:project",
11607
- "fix:hardis:v53flexipages:project",
11608
- "fix:v53flexipages:hardis:project",
11609
- "fix:v53flexipages:project:hardis",
11610
- "hardis:project:v53flexipages:fix",
11611
- "project:hardis:v53flexipages:fix",
11612
- "project:v53flexipages:hardis:fix",
11613
- "project:v53flexipages:fix:hardis",
11614
- "hardis:v53flexipages:project:fix",
11615
- "v53flexipages:hardis:project:fix",
11616
- "v53flexipages:project:hardis:fix",
11617
- "v53flexipages:project:fix:hardis",
11618
- "hardis:v53flexipages:fix:project",
11619
- "v53flexipages:hardis:fix:project",
11620
- "v53flexipages:fix:hardis:project",
11621
- "v53flexipages:fix:project:hardis"
11366
+ "pluginName": "sfdx-hardis",
11367
+ "pluginType": "core",
11368
+ "strict": true,
11369
+ "enableJsonFlag": true,
11370
+ "title": "Clean retrieved empty items in dx sources",
11371
+ "requiresProject": true,
11372
+ "isESM": true,
11373
+ "relativePath": [
11374
+ "lib",
11375
+ "commands",
11376
+ "hardis",
11377
+ "project",
11378
+ "clean",
11379
+ "xml.js"
11380
+ ],
11381
+ "aliasPermutations": [],
11382
+ "permutations": [
11383
+ "hardis:project:clean:xml",
11384
+ "project:hardis:clean:xml",
11385
+ "project:clean:hardis:xml",
11386
+ "project:clean:xml:hardis",
11387
+ "hardis:clean:project:xml",
11388
+ "clean:hardis:project:xml",
11389
+ "clean:project:hardis:xml",
11390
+ "clean:project:xml:hardis",
11391
+ "hardis:clean:xml:project",
11392
+ "clean:hardis:xml:project",
11393
+ "clean:xml:hardis:project",
11394
+ "clean:xml:project:hardis",
11395
+ "hardis:project:xml:clean",
11396
+ "project:hardis:xml:clean",
11397
+ "project:xml:hardis:clean",
11398
+ "project:xml:clean:hardis",
11399
+ "hardis:xml:project:clean",
11400
+ "xml:hardis:project:clean",
11401
+ "xml:project:hardis:clean",
11402
+ "xml:project:clean:hardis",
11403
+ "hardis:xml:clean:project",
11404
+ "xml:hardis:clean:project",
11405
+ "xml:clean:hardis:project",
11406
+ "xml:clean:project:hardis"
11622
11407
  ]
11623
11408
  },
11624
11409
  "hardis:project:deploy:notify": {
@@ -12796,6 +12581,221 @@
12796
12581
  "validate:deploy:project:hardis"
12797
12582
  ]
12798
12583
  },
12584
+ "hardis:project:fix:profiletabs": {
12585
+ "aliases": [],
12586
+ "args": {},
12587
+ "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",
12588
+ "examples": [
12589
+ "$ sf hardis:project:fix:profiletabs"
12590
+ ],
12591
+ "flags": {
12592
+ "json": {
12593
+ "description": "Format output as json.",
12594
+ "helpGroup": "GLOBAL",
12595
+ "name": "json",
12596
+ "allowNo": false,
12597
+ "type": "boolean"
12598
+ },
12599
+ "flags-dir": {
12600
+ "helpGroup": "GLOBAL",
12601
+ "name": "flags-dir",
12602
+ "summary": "Import flag values from a directory.",
12603
+ "hasDynamicHelp": false,
12604
+ "multiple": false,
12605
+ "type": "option"
12606
+ },
12607
+ "path": {
12608
+ "char": "p",
12609
+ "description": "Root folder",
12610
+ "name": "path",
12611
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12612
+ "hasDynamicHelp": false,
12613
+ "multiple": false,
12614
+ "type": "option"
12615
+ },
12616
+ "debug": {
12617
+ "char": "d",
12618
+ "description": "Activate debug mode (more logs)",
12619
+ "name": "debug",
12620
+ "allowNo": false,
12621
+ "type": "boolean"
12622
+ },
12623
+ "websocket": {
12624
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12625
+ "name": "websocket",
12626
+ "hasDynamicHelp": false,
12627
+ "multiple": false,
12628
+ "type": "option"
12629
+ },
12630
+ "skipauth": {
12631
+ "description": "Skip authentication check when a default username is required",
12632
+ "name": "skipauth",
12633
+ "allowNo": false,
12634
+ "type": "boolean"
12635
+ },
12636
+ "target-org": {
12637
+ "aliases": [
12638
+ "targetusername",
12639
+ "u"
12640
+ ],
12641
+ "char": "o",
12642
+ "deprecateAliases": true,
12643
+ "name": "target-org",
12644
+ "noCacheDefault": true,
12645
+ "required": true,
12646
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
12647
+ "hasDynamicHelp": true,
12648
+ "multiple": false,
12649
+ "type": "option"
12650
+ }
12651
+ },
12652
+ "hasDynamicHelp": true,
12653
+ "hiddenAliases": [],
12654
+ "id": "hardis:project:fix:profiletabs",
12655
+ "pluginAlias": "sfdx-hardis",
12656
+ "pluginName": "sfdx-hardis",
12657
+ "pluginType": "core",
12658
+ "strict": true,
12659
+ "enableJsonFlag": true,
12660
+ "title": "Fix profiles to add tabs that are not retrieved by SF CLI",
12661
+ "requiresProject": true,
12662
+ "isESM": true,
12663
+ "relativePath": [
12664
+ "lib",
12665
+ "commands",
12666
+ "hardis",
12667
+ "project",
12668
+ "fix",
12669
+ "profiletabs.js"
12670
+ ],
12671
+ "aliasPermutations": [],
12672
+ "permutations": [
12673
+ "hardis:project:fix:profiletabs",
12674
+ "project:hardis:fix:profiletabs",
12675
+ "project:fix:hardis:profiletabs",
12676
+ "project:fix:profiletabs:hardis",
12677
+ "hardis:fix:project:profiletabs",
12678
+ "fix:hardis:project:profiletabs",
12679
+ "fix:project:hardis:profiletabs",
12680
+ "fix:project:profiletabs:hardis",
12681
+ "hardis:fix:profiletabs:project",
12682
+ "fix:hardis:profiletabs:project",
12683
+ "fix:profiletabs:hardis:project",
12684
+ "fix:profiletabs:project:hardis",
12685
+ "hardis:project:profiletabs:fix",
12686
+ "project:hardis:profiletabs:fix",
12687
+ "project:profiletabs:hardis:fix",
12688
+ "project:profiletabs:fix:hardis",
12689
+ "hardis:profiletabs:project:fix",
12690
+ "profiletabs:hardis:project:fix",
12691
+ "profiletabs:project:hardis:fix",
12692
+ "profiletabs:project:fix:hardis",
12693
+ "hardis:profiletabs:fix:project",
12694
+ "profiletabs:hardis:fix:project",
12695
+ "profiletabs:fix:hardis:project",
12696
+ "profiletabs:fix:project:hardis"
12697
+ ]
12698
+ },
12699
+ "hardis:project:fix:v53flexipages": {
12700
+ "aliases": [],
12701
+ "args": {},
12702
+ "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",
12703
+ "examples": [
12704
+ "$ sf hardis:project:fix:v53flexipages"
12705
+ ],
12706
+ "flags": {
12707
+ "json": {
12708
+ "description": "Format output as json.",
12709
+ "helpGroup": "GLOBAL",
12710
+ "name": "json",
12711
+ "allowNo": false,
12712
+ "type": "boolean"
12713
+ },
12714
+ "flags-dir": {
12715
+ "helpGroup": "GLOBAL",
12716
+ "name": "flags-dir",
12717
+ "summary": "Import flag values from a directory.",
12718
+ "hasDynamicHelp": false,
12719
+ "multiple": false,
12720
+ "type": "option"
12721
+ },
12722
+ "path": {
12723
+ "char": "p",
12724
+ "description": "Root folder",
12725
+ "name": "path",
12726
+ "default": "/home/runner/work/sfdx-hardis/sfdx-hardis",
12727
+ "hasDynamicHelp": false,
12728
+ "multiple": false,
12729
+ "type": "option"
12730
+ },
12731
+ "debug": {
12732
+ "char": "d",
12733
+ "description": "Activate debug mode (more logs)",
12734
+ "name": "debug",
12735
+ "allowNo": false,
12736
+ "type": "boolean"
12737
+ },
12738
+ "websocket": {
12739
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
12740
+ "name": "websocket",
12741
+ "hasDynamicHelp": false,
12742
+ "multiple": false,
12743
+ "type": "option"
12744
+ },
12745
+ "skipauth": {
12746
+ "description": "Skip authentication check when a default username is required",
12747
+ "name": "skipauth",
12748
+ "allowNo": false,
12749
+ "type": "boolean"
12750
+ }
12751
+ },
12752
+ "hasDynamicHelp": false,
12753
+ "hiddenAliases": [],
12754
+ "id": "hardis:project:fix:v53flexipages",
12755
+ "pluginAlias": "sfdx-hardis",
12756
+ "pluginName": "sfdx-hardis",
12757
+ "pluginType": "core",
12758
+ "strict": true,
12759
+ "enableJsonFlag": true,
12760
+ "title": "Fix flexipages for v53",
12761
+ "requiresProject": true,
12762
+ "isESM": true,
12763
+ "relativePath": [
12764
+ "lib",
12765
+ "commands",
12766
+ "hardis",
12767
+ "project",
12768
+ "fix",
12769
+ "v53flexipages.js"
12770
+ ],
12771
+ "aliasPermutations": [],
12772
+ "permutations": [
12773
+ "hardis:project:fix:v53flexipages",
12774
+ "project:hardis:fix:v53flexipages",
12775
+ "project:fix:hardis:v53flexipages",
12776
+ "project:fix:v53flexipages:hardis",
12777
+ "hardis:fix:project:v53flexipages",
12778
+ "fix:hardis:project:v53flexipages",
12779
+ "fix:project:hardis:v53flexipages",
12780
+ "fix:project:v53flexipages:hardis",
12781
+ "hardis:fix:v53flexipages:project",
12782
+ "fix:hardis:v53flexipages:project",
12783
+ "fix:v53flexipages:hardis:project",
12784
+ "fix:v53flexipages:project:hardis",
12785
+ "hardis:project:v53flexipages:fix",
12786
+ "project:hardis:v53flexipages:fix",
12787
+ "project:v53flexipages:hardis:fix",
12788
+ "project:v53flexipages:fix:hardis",
12789
+ "hardis:v53flexipages:project:fix",
12790
+ "v53flexipages:hardis:project:fix",
12791
+ "v53flexipages:project:hardis:fix",
12792
+ "v53flexipages:project:fix:hardis",
12793
+ "hardis:v53flexipages:fix:project",
12794
+ "v53flexipages:hardis:fix:project",
12795
+ "v53flexipages:fix:hardis:project",
12796
+ "v53flexipages:fix:project:hardis"
12797
+ ]
12798
+ },
12799
12799
  "hardis:project:generate:bypass": {
12800
12800
  "aliases": [],
12801
12801
  "args": {},
@@ -15369,5 +15369,5 @@
15369
15369
  ]
15370
15370
  }
15371
15371
  },
15372
- "version": "6.7.2"
15372
+ "version": "6.7.3"
15373
15373
  }