sfdx-hardis 6.9.1-alpha202510262008.0 → 6.9.1-alpha202510262129.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 CI_COMMIT_REF_NAME=monitoring_myclient 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 CI_COMMIT_REF_NAME=monitoring_myclient 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": {
@@ -5808,6 +5808,121 @@
5808
5808
  "import:files:org:hardis"
5809
5809
  ]
5810
5810
  },
5811
+ "hardis:org:fix:listviewmine": {
5812
+ "aliases": [],
5813
+ "args": {},
5814
+ "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",
5815
+ "examples": [
5816
+ "$ sf hardis:org:fix:listviewmine",
5817
+ "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
5818
+ ],
5819
+ "flags": {
5820
+ "json": {
5821
+ "description": "Format output as json.",
5822
+ "helpGroup": "GLOBAL",
5823
+ "name": "json",
5824
+ "allowNo": false,
5825
+ "type": "boolean"
5826
+ },
5827
+ "flags-dir": {
5828
+ "helpGroup": "GLOBAL",
5829
+ "name": "flags-dir",
5830
+ "summary": "Import flag values from a directory.",
5831
+ "hasDynamicHelp": false,
5832
+ "multiple": false,
5833
+ "type": "option"
5834
+ },
5835
+ "listviews": {
5836
+ "char": "l",
5837
+ "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
5838
+ "name": "listviews",
5839
+ "hasDynamicHelp": false,
5840
+ "multiple": false,
5841
+ "type": "option"
5842
+ },
5843
+ "debug": {
5844
+ "char": "d",
5845
+ "description": "Activate debug mode (more logs)",
5846
+ "name": "debug",
5847
+ "allowNo": false,
5848
+ "type": "boolean"
5849
+ },
5850
+ "websocket": {
5851
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5852
+ "name": "websocket",
5853
+ "hasDynamicHelp": false,
5854
+ "multiple": false,
5855
+ "type": "option"
5856
+ },
5857
+ "skipauth": {
5858
+ "description": "Skip authentication check when a default username is required",
5859
+ "name": "skipauth",
5860
+ "allowNo": false,
5861
+ "type": "boolean"
5862
+ },
5863
+ "target-org": {
5864
+ "aliases": [
5865
+ "targetusername",
5866
+ "u"
5867
+ ],
5868
+ "char": "o",
5869
+ "deprecateAliases": true,
5870
+ "name": "target-org",
5871
+ "noCacheDefault": true,
5872
+ "required": true,
5873
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5874
+ "hasDynamicHelp": true,
5875
+ "multiple": false,
5876
+ "type": "option"
5877
+ }
5878
+ },
5879
+ "hasDynamicHelp": true,
5880
+ "hiddenAliases": [],
5881
+ "id": "hardis:org:fix:listviewmine",
5882
+ "pluginAlias": "sfdx-hardis",
5883
+ "pluginName": "sfdx-hardis",
5884
+ "pluginType": "core",
5885
+ "strict": true,
5886
+ "enableJsonFlag": true,
5887
+ "title": "Fix listviews with ",
5888
+ "requiresProject": true,
5889
+ "isESM": true,
5890
+ "relativePath": [
5891
+ "lib",
5892
+ "commands",
5893
+ "hardis",
5894
+ "org",
5895
+ "fix",
5896
+ "listviewmine.js"
5897
+ ],
5898
+ "aliasPermutations": [],
5899
+ "permutations": [
5900
+ "hardis:org:fix:listviewmine",
5901
+ "org:hardis:fix:listviewmine",
5902
+ "org:fix:hardis:listviewmine",
5903
+ "org:fix:listviewmine:hardis",
5904
+ "hardis:fix:org:listviewmine",
5905
+ "fix:hardis:org:listviewmine",
5906
+ "fix:org:hardis:listviewmine",
5907
+ "fix:org:listviewmine:hardis",
5908
+ "hardis:fix:listviewmine:org",
5909
+ "fix:hardis:listviewmine:org",
5910
+ "fix:listviewmine:hardis:org",
5911
+ "fix:listviewmine:org:hardis",
5912
+ "hardis:org:listviewmine:fix",
5913
+ "org:hardis:listviewmine:fix",
5914
+ "org:listviewmine:hardis:fix",
5915
+ "org:listviewmine:fix:hardis",
5916
+ "hardis:listviewmine:org:fix",
5917
+ "listviewmine:hardis:org:fix",
5918
+ "listviewmine:org:hardis:fix",
5919
+ "listviewmine:org:fix:hardis",
5920
+ "hardis:listviewmine:fix:org",
5921
+ "listviewmine:hardis:fix:org",
5922
+ "listviewmine:fix:hardis:org",
5923
+ "listviewmine:fix:org:hardis"
5924
+ ]
5925
+ },
5811
5926
  "hardis:org:diagnose:audittrail": {
5812
5927
  "aliases": [],
5813
5928
  "args": {},
@@ -7071,13 +7186,14 @@
7071
7186
  "unusedusers:diagnose:org:hardis"
7072
7187
  ]
7073
7188
  },
7074
- "hardis:org:fix:listviewmine": {
7189
+ "hardis:org:generate:packagexmlfull": {
7075
7190
  "aliases": [],
7076
7191
  "args": {},
7077
- "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",
7192
+ "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",
7078
7193
  "examples": [
7079
- "$ sf hardis:org:fix:listviewmine",
7080
- "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
7194
+ "$ sf hardis:org:generate:packagexmlfull",
7195
+ "$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
7196
+ "$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
7081
7197
  ],
7082
7198
  "flags": {
7083
7199
  "json": {
@@ -7095,10 +7211,9 @@
7095
7211
  "multiple": false,
7096
7212
  "type": "option"
7097
7213
  },
7098
- "listviews": {
7099
- "char": "l",
7100
- "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
7101
- "name": "listviews",
7214
+ "outputfile": {
7215
+ "description": "Output package.xml file",
7216
+ "name": "outputfile",
7102
7217
  "hasDynamicHelp": false,
7103
7218
  "multiple": false,
7104
7219
  "type": "option"
@@ -7110,6 +7225,13 @@
7110
7225
  "allowNo": false,
7111
7226
  "type": "boolean"
7112
7227
  },
7228
+ "no-prompt": {
7229
+ "char": "n",
7230
+ "description": "Do not prompt for org username, use the default one",
7231
+ "name": "no-prompt",
7232
+ "allowNo": false,
7233
+ "type": "boolean"
7234
+ },
7113
7235
  "websocket": {
7114
7236
  "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7115
7237
  "name": "websocket",
@@ -7141,136 +7263,14 @@
7141
7263
  },
7142
7264
  "hasDynamicHelp": true,
7143
7265
  "hiddenAliases": [],
7144
- "id": "hardis:org:fix:listviewmine",
7266
+ "id": "hardis:org:generate:packagexmlfull",
7145
7267
  "pluginAlias": "sfdx-hardis",
7146
7268
  "pluginName": "sfdx-hardis",
7147
7269
  "pluginType": "core",
7148
7270
  "strict": true,
7149
7271
  "enableJsonFlag": true,
7150
- "title": "Fix listviews with ",
7151
- "requiresProject": true,
7152
- "isESM": true,
7153
- "relativePath": [
7154
- "lib",
7155
- "commands",
7156
- "hardis",
7157
- "org",
7158
- "fix",
7159
- "listviewmine.js"
7160
- ],
7161
- "aliasPermutations": [],
7162
- "permutations": [
7163
- "hardis:org:fix:listviewmine",
7164
- "org:hardis:fix:listviewmine",
7165
- "org:fix:hardis:listviewmine",
7166
- "org:fix:listviewmine:hardis",
7167
- "hardis:fix:org:listviewmine",
7168
- "fix:hardis:org:listviewmine",
7169
- "fix:org:hardis:listviewmine",
7170
- "fix:org:listviewmine:hardis",
7171
- "hardis:fix:listviewmine:org",
7172
- "fix:hardis:listviewmine:org",
7173
- "fix:listviewmine:hardis:org",
7174
- "fix:listviewmine:org:hardis",
7175
- "hardis:org:listviewmine:fix",
7176
- "org:hardis:listviewmine:fix",
7177
- "org:listviewmine:hardis:fix",
7178
- "org:listviewmine:fix:hardis",
7179
- "hardis:listviewmine:org:fix",
7180
- "listviewmine:hardis:org:fix",
7181
- "listviewmine:org:hardis:fix",
7182
- "listviewmine:org:fix:hardis",
7183
- "hardis:listviewmine:fix:org",
7184
- "listviewmine:hardis:fix:org",
7185
- "listviewmine:fix:hardis:org",
7186
- "listviewmine:fix:org:hardis"
7187
- ]
7188
- },
7189
- "hardis:org:generate:packagexmlfull": {
7190
- "aliases": [],
7191
- "args": {},
7192
- "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",
7193
- "examples": [
7194
- "$ sf hardis:org:generate:packagexmlfull",
7195
- "$ sf hardis:org:generate:packagexmlfull --outputfile /tmp/packagexmlfull.xml",
7196
- "$ sf hardis:org:generate:packagexmlfull --target-org nico@example.com"
7197
- ],
7198
- "flags": {
7199
- "json": {
7200
- "description": "Format output as json.",
7201
- "helpGroup": "GLOBAL",
7202
- "name": "json",
7203
- "allowNo": false,
7204
- "type": "boolean"
7205
- },
7206
- "flags-dir": {
7207
- "helpGroup": "GLOBAL",
7208
- "name": "flags-dir",
7209
- "summary": "Import flag values from a directory.",
7210
- "hasDynamicHelp": false,
7211
- "multiple": false,
7212
- "type": "option"
7213
- },
7214
- "outputfile": {
7215
- "description": "Output package.xml file",
7216
- "name": "outputfile",
7217
- "hasDynamicHelp": false,
7218
- "multiple": false,
7219
- "type": "option"
7220
- },
7221
- "debug": {
7222
- "char": "d",
7223
- "description": "Activate debug mode (more logs)",
7224
- "name": "debug",
7225
- "allowNo": false,
7226
- "type": "boolean"
7227
- },
7228
- "no-prompt": {
7229
- "char": "n",
7230
- "description": "Do not prompt for org username, use the default one",
7231
- "name": "no-prompt",
7232
- "allowNo": false,
7233
- "type": "boolean"
7234
- },
7235
- "websocket": {
7236
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7237
- "name": "websocket",
7238
- "hasDynamicHelp": false,
7239
- "multiple": false,
7240
- "type": "option"
7241
- },
7242
- "skipauth": {
7243
- "description": "Skip authentication check when a default username is required",
7244
- "name": "skipauth",
7245
- "allowNo": false,
7246
- "type": "boolean"
7247
- },
7248
- "target-org": {
7249
- "aliases": [
7250
- "targetusername",
7251
- "u"
7252
- ],
7253
- "char": "o",
7254
- "deprecateAliases": true,
7255
- "name": "target-org",
7256
- "noCacheDefault": true,
7257
- "required": true,
7258
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7259
- "hasDynamicHelp": true,
7260
- "multiple": false,
7261
- "type": "option"
7262
- }
7263
- },
7264
- "hasDynamicHelp": true,
7265
- "hiddenAliases": [],
7266
- "id": "hardis:org:generate:packagexmlfull",
7267
- "pluginAlias": "sfdx-hardis",
7268
- "pluginName": "sfdx-hardis",
7269
- "pluginType": "core",
7270
- "strict": true,
7271
- "enableJsonFlag": true,
7272
- "title": "Generate Full Org package.xml",
7273
- "requiresProject": false,
7272
+ "title": "Generate Full Org package.xml",
7273
+ "requiresProject": false,
7274
7274
  "isESM": true,
7275
7275
  "relativePath": [
7276
7276
  "lib",
@@ -7789,16 +7789,13 @@
7789
7789
  "limits:monitor:org:hardis"
7790
7790
  ]
7791
7791
  },
7792
- "hardis:org:refresh:after-refresh": {
7792
+ "hardis:org:purge:apexlog": {
7793
7793
  "aliases": [],
7794
7794
  "args": {},
7795
- "description": "\n## Command Behavior\n\n**Restores all previously backed-up Connected Apps (including Consumer Secrets), certificates, custom settings, records and other metadata to a Salesforce org after a sandbox refresh.**\n\nThis command is the second step in the sandbox refresh process. It scans the backup folder created before the refresh, allows interactive or flag-driven selection of items to restore, and automates cleanup and redeployment to the refreshed org while preserving credentials and configuration.\n\nKey functionalities:\n\n- **Choose a backup to restore:** Lets you pick the saved sandbox project that contains the artifacts to restore.\n- **Select which items to restore:** Finds Connected App XMLs, certificates, custom settings and other artifacts and lets you pick what to restore (or restore all).\n- **Safety checks and validation:** Confirms files exist and prompts before making changes to the target org.\n- **Prepare org for restore:** Optionally cleans up existing Connected Apps so saved apps can be re-deployed without conflict.\n- **Redeploy saved artifacts:** Restores Connected Apps (with saved secrets), certificates, SAML SSO configs, custom settings and other metadata.\n- **Handle SAML configs:** Cleans and updates SAML XML files and helps you choose certificates to wire into restored configs.\n- **Restore records:** Optionally runs data import from selected SFDMU workspaces to restore record data.\n- **Reporting & persistence:** Sends restore reports and can update project config to record what was restored.\n\nThis command is part of [sfdx-hardis Sandbox Refresh](https://sfdx-hardis.cloudity.com/salesforce-sandbox-refresh/) and is intended to be run after a sandbox refresh to re-apply saved metadata, credentials and data.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\n- **Backup Folder Handling:** Reads the immediate subfolders of `scripts/sandbox-refresh/` and validates the chosen project contains the expected `manifest/` and `force-app` layout.\n- **Metadata & Deployment APIs:** Uses `sf project deploy start --manifest` for package-based deploys, `sf project deploy start --metadata-dir` for MDAPI artifacts (certificates), and utility functions for Connected App deployment that preserve consumer secrets.\n- **SAML Handling:** Queries active certificates via tooling API, updates SAML XML files, and deploys using `sf project deploy start -m SamlSsoConfig`.\n- **Records Handling:** Uses interactive selection of SFDMU workspaces and runs data import utilities to restore records.\n- **Error Handling & Summary:** Aggregates results, logs success/warnings/errors, and returns a structured result indicating which items were restored and any failures.\n\n</details>\n",
7795
+ "description": "\n**Purges Apex debug logs from a Salesforce org.**\n\nThis command provides a quick and efficient way to clear out accumulated Apex debug logs from your Salesforce environment. This is particularly useful for:\n\n- **Storage Management:** Freeing up valuable data storage space in your Salesforce org.\n- **Performance Optimization:** Reducing the overhead associated with large volumes of debug logs.\n- **Troubleshooting:** Ensuring that new debug logs are generated cleanly without interference from old, irrelevant logs.\n\nKey functionalities:\n\n- **Log Identification:** Queries the `ApexLog` object to identify all existing debug logs.\n- **Confirmation Prompt:** Before deletion, it prompts for user confirmation, displaying the number of Apex logs that will be deleted.\n- **Bulk Deletion:** Uses the Salesforce Bulk API to efficiently delete a large number of Apex logs.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Query:** It executes a SOQL query (`SELECT Id FROM ApexLog LIMIT 50000`) to retrieve the IDs of Apex logs to be deleted. The limit is set to 50,000 to handle large volumes of logs.\n- **CSV Export:** The retrieved log IDs are temporarily exported to a CSV file (`ApexLogsToDelete_*.csv`) in the `./tmp` directory.\n- **User Confirmation:** It uses the `prompts` library to ask for user confirmation before proceeding with the deletion, displaying the count of logs to be purged.\n- **Bulk API Deletion:** It then uses the Salesforce CLI's `sf data delete bulk` command, pointing to the generated CSV file, to perform the mass deletion of Apex logs.\n- **File System Operations:** It uses `fs-extra` to create the temporary directory and manage the CSV file.\n- **Error Handling:** Includes error handling for the query and deletion operations.\n</details>\n",
7796
7796
  "examples": [
7797
- "$ sf hardis:org:refresh:after-refresh",
7798
- "$ sf hardis:org:refresh:after-refresh --name \"MyConnectedApp\" // Process specific app, no selection prompt",
7799
- "$ sf hardis:org:refresh:after-refresh --name \"App1,App2,App3\" // Process multiple apps, no selection prompt",
7800
- "$ sf hardis:org:refresh:after-refresh --all // Process all apps, no selection prompt",
7801
- "$ sf hardis:org:refresh:after-refresh --target-org myDevOrg"
7797
+ "$ sf hardis:org:purge:apexlog",
7798
+ "$ sf hardis:org:purge:apexlog --target-org nicolas.vuillamy@gmail.com"
7802
7799
  ],
7803
7800
  "flags": {
7804
7801
  "json": {
@@ -7816,37 +7813,23 @@
7816
7813
  "multiple": false,
7817
7814
  "type": "option"
7818
7815
  },
7819
- "target-org": {
7820
- "char": "o",
7821
- "name": "target-org",
7822
- "noCacheDefault": true,
7823
- "required": true,
7824
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7825
- "hasDynamicHelp": true,
7826
- "multiple": false,
7827
- "type": "option"
7828
- },
7829
- "name": {
7830
- "char": "n",
7831
- "description": "Connected App name(s) to process (bypasses selection prompt). For multiple apps, separate with commas (e.g., \"App1,App2\")",
7832
- "name": "name",
7833
- "summary": "Filter according to Name criteria",
7834
- "hasDynamicHelp": false,
7835
- "multiple": false,
7836
- "type": "option"
7816
+ "prompt": {
7817
+ "char": "z",
7818
+ "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
7819
+ "name": "prompt",
7820
+ "allowNo": true,
7821
+ "type": "boolean"
7837
7822
  },
7838
- "all": {
7839
- "char": "a",
7840
- "description": "If set, all Connected Apps from the local repository will be processed. Takes precedence over --name if both are specified.",
7841
- "name": "all",
7842
- "summary": "Process all Connected Apps without selection prompt",
7823
+ "debug": {
7824
+ "char": "d",
7825
+ "description": "Activate debug mode (more logs)",
7826
+ "name": "debug",
7843
7827
  "allowNo": false,
7844
7828
  "type": "boolean"
7845
7829
  },
7846
7830
  "websocket": {
7847
- "description": "WebSocket host:port for VS Code SFDX Hardis UI integration",
7831
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7848
7832
  "name": "websocket",
7849
- "summary": "Websocket host:port for VsCode SFDX Hardis UI integration",
7850
7833
  "hasDynamicHelp": false,
7851
7834
  "multiple": false,
7852
7835
  "type": "option"
@@ -7854,68 +7837,80 @@
7854
7837
  "skipauth": {
7855
7838
  "description": "Skip authentication check when a default username is required",
7856
7839
  "name": "skipauth",
7857
- "summary": "Skip authentication check when a default username is required",
7858
7840
  "allowNo": false,
7859
7841
  "type": "boolean"
7842
+ },
7843
+ "target-org": {
7844
+ "aliases": [
7845
+ "targetusername",
7846
+ "u"
7847
+ ],
7848
+ "char": "o",
7849
+ "deprecateAliases": true,
7850
+ "name": "target-org",
7851
+ "noCacheDefault": true,
7852
+ "required": true,
7853
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7854
+ "hasDynamicHelp": true,
7855
+ "multiple": false,
7856
+ "type": "option"
7860
7857
  }
7861
7858
  },
7862
7859
  "hasDynamicHelp": true,
7863
7860
  "hiddenAliases": [],
7864
- "id": "hardis:org:refresh:after-refresh",
7861
+ "id": "hardis:org:purge:apexlog",
7865
7862
  "pluginAlias": "sfdx-hardis",
7866
7863
  "pluginName": "sfdx-hardis",
7867
7864
  "pluginType": "core",
7868
7865
  "strict": true,
7869
7866
  "enableJsonFlag": true,
7870
- "title": "Restore Connected Apps after org refresh",
7871
- "requiresProject": true,
7867
+ "title": "Purge Apex Logs",
7868
+ "requiresProject": false,
7872
7869
  "isESM": true,
7873
7870
  "relativePath": [
7874
7871
  "lib",
7875
7872
  "commands",
7876
7873
  "hardis",
7877
7874
  "org",
7878
- "refresh",
7879
- "after-refresh.js"
7875
+ "purge",
7876
+ "apexlog.js"
7880
7877
  ],
7881
7878
  "aliasPermutations": [],
7882
7879
  "permutations": [
7883
- "hardis:org:refresh:after-refresh",
7884
- "org:hardis:refresh:after-refresh",
7885
- "org:refresh:hardis:after-refresh",
7886
- "org:refresh:after-refresh:hardis",
7887
- "hardis:refresh:org:after-refresh",
7888
- "refresh:hardis:org:after-refresh",
7889
- "refresh:org:hardis:after-refresh",
7890
- "refresh:org:after-refresh:hardis",
7891
- "hardis:refresh:after-refresh:org",
7892
- "refresh:hardis:after-refresh:org",
7893
- "refresh:after-refresh:hardis:org",
7894
- "refresh:after-refresh:org:hardis",
7895
- "hardis:org:after-refresh:refresh",
7896
- "org:hardis:after-refresh:refresh",
7897
- "org:after-refresh:hardis:refresh",
7898
- "org:after-refresh:refresh:hardis",
7899
- "hardis:after-refresh:org:refresh",
7900
- "after-refresh:hardis:org:refresh",
7901
- "after-refresh:org:hardis:refresh",
7902
- "after-refresh:org:refresh:hardis",
7903
- "hardis:after-refresh:refresh:org",
7904
- "after-refresh:hardis:refresh:org",
7905
- "after-refresh:refresh:hardis:org",
7906
- "after-refresh:refresh:org:hardis"
7880
+ "hardis:org:purge:apexlog",
7881
+ "org:hardis:purge:apexlog",
7882
+ "org:purge:hardis:apexlog",
7883
+ "org:purge:apexlog:hardis",
7884
+ "hardis:purge:org:apexlog",
7885
+ "purge:hardis:org:apexlog",
7886
+ "purge:org:hardis:apexlog",
7887
+ "purge:org:apexlog:hardis",
7888
+ "hardis:purge:apexlog:org",
7889
+ "purge:hardis:apexlog:org",
7890
+ "purge:apexlog:hardis:org",
7891
+ "purge:apexlog:org:hardis",
7892
+ "hardis:org:apexlog:purge",
7893
+ "org:hardis:apexlog:purge",
7894
+ "org:apexlog:hardis:purge",
7895
+ "org:apexlog:purge:hardis",
7896
+ "hardis:apexlog:org:purge",
7897
+ "apexlog:hardis:org:purge",
7898
+ "apexlog:org:hardis:purge",
7899
+ "apexlog:org:purge:hardis",
7900
+ "hardis:apexlog:purge:org",
7901
+ "apexlog:hardis:purge:org",
7902
+ "apexlog:purge:hardis:org",
7903
+ "apexlog:purge:org:hardis"
7907
7904
  ]
7908
7905
  },
7909
- "hardis:org:refresh:before-refresh": {
7906
+ "hardis:org:purge:flow": {
7910
7907
  "aliases": [],
7911
7908
  "args": {},
7912
- "description": "\n## Command Behavior\n\n**Backs up all Connected Apps (including Consumer Secrets), certificates, custom settings, records and other metadata from a Salesforce org before a sandbox refresh, enabling full restoration after the refresh.**\n\nThis command prepares a complete backup prior to a sandbox refresh. It creates a dedicated project under `scripts/sandbox-refresh/<sandbox-folder>`, retrieves metadata and data, attempts to capture Connected App consumer secrets, and can optionally delete the apps so they can be reuploaded after the refresh.\n\nKey functionalities:\n\n- **Create a save project:** Generates a dedicated project folder to store all artifacts for the sandbox backup.\n- **Find and select Connected Apps:** Lists Connected Apps in the org and lets you pick specific apps, use a name filter, or process all apps.\n- **Save metadata for restore:** Builds a manifest and retrieves the metadata types you choose so they can be restored after the refresh.\n- **Capture Consumer Secrets:** Attempts to capture Connected App consumer secrets automatically (opens a browser session when possible) and falls back to a short manual prompt when needed.\n- **Collect certificates:** Saves certificate files and their definitions so they can be redeployed later.\n- **Export custom settings & records:** Lets you pick custom settings to export as JSON and optionally export records using configured data workspaces.\n- **Persist choices & report:** Stores your backup choices in project config and sends report files for traceability.\n- **Optional cleanup:** Can delete backed-up Connected Apps from the org so they can be re-uploaded cleanly after the refresh.\n- **Interactive safety checks:** Prompts you to confirm package contents and other potentially destructive actions; sensible defaults are chosen where appropriate.\n\nThis command is part of [sfdx-hardis Sandbox Refresh](https://sfdx-hardis.cloudity.com/salesforce-sandbox-refresh/) and is intended to be run before a sandbox refresh so that all credentials, certificates, metadata and data can be restored afterwards.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\n- **Salesforce CLI Integration:** Uses `sf org list metadata`, `sf project retrieve start`, `sf project generate`, `sf project deploy start`, and `sf data tree export`/`import` where applicable.\n- **Metadata Handling:** Writes and reads package XML files under the generated project (`manifest/`), copies MDAPI certificate artifacts into `force-app/main/default/certs`, and produces `package-metadata-to-restore.xml` for post-refresh deployment.\n- **Consumer Secret Handling:** Uses `puppeteer-core` with an executable path from `getChromeExecutablePath()` (env var `PUPPETEER_EXECUTABLE_PATH` may be required). Falls back to manual prompt when browser automation cannot be used.\n- **Data & Records:** Exports custom settings to JSON and supports exporting records through SFDMU workspaces chosen interactively.\n- **Config & Reporting:** Updates project/user config under `config/.sfdx-hardis.yml#refreshSandboxConfig` and reports artifacts to the WebSocket client.\n- **Error Handling:** Provides clear error messages and a summary response object indicating success/failure and which secrets were captured.\n\n</details>\n",
7909
+ "description": "\n**Purges old or unwanted Flow versions from a Salesforce org, with an option to delete related Flow Interviews.**\n\nThis command helps maintain a clean and performant Salesforce org by removing obsolete Flow versions. Over time, multiple versions of Flows can accumulate, consuming storage and potentially impacting performance. This tool provides a controlled way to clean up these versions.\n\nKey functionalities:\n\n- **Targeted Flow Selection:** Allows you to filter Flow versions to delete by name (`--name`) and status (`--status`, e.g., `Obsolete`, `Draft`, `Inactive`).\n- **Flow Interview Deletion:** If a Flow version cannot be deleted due to active Flow Interviews, the `--delete-flow-interviews` flag (or interactive prompt) allows you to delete these interviews first, then retry the Flow version deletion.\n- **Confirmation Prompt:** In interactive mode, it prompts for confirmation before proceeding with the deletion of Flow versions and Flow Interviews.\n- **Partial Success Handling:** The `--allowpurgefailure` flag (default `true`) allows the command to continue even if some deletions fail, reporting the errors.\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 `Flow` object (using the Tooling API) to list Flow versions based on the provided filters (name, status, manageable state).\n- **Bulk Deletion (Tooling API):** It uses `bulkDeleteTooling` to perform mass deletions of Flow versions. If deletion fails due to active interviews, it extracts the interview IDs.\n- **Flow Interview Management:** If `delete-flow-interviews` is enabled, it queries `FlowInterview` objects, performs bulk deletion of the identified interviews using `bulkDelete`, and then retries the Flow version deletion.\n- **Interactive Prompts:** Uses the `prompts` library to interact with the user for selecting Flows, statuses, and confirming deletion actions.\n- **Error Reporting:** Logs detailed error messages for failed deletions, including the specific reasons.\n- **Command-Line Execution:** Uses `execSfdxJson` to execute Salesforce CLI commands for querying Flow data.\n</details>\n",
7913
7910
  "examples": [
7914
- "$ sf hardis:org:refresh:before-refresh",
7915
- "$ sf hardis:org:refresh:before-refresh --name \"MyConnectedApp\"",
7916
- "$ sf hardis:org:refresh:before-refresh --name \"App1,App2,App3\"",
7917
- "$ sf hardis:org:refresh:before-refresh --all",
7918
- "$ sf hardis:org:refresh:before-refresh --delete"
7911
+ "$ sf hardis:org:purge:flow",
7912
+ "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --no-prompt --delete-flow-interviews",
7913
+ "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --status \"Obsolete,Draft,InvalidDraft\" --name TestFlow"
7919
7914
  ],
7920
7915
  "flags": {
7921
7916
  "json": {
@@ -7933,38 +7928,56 @@
7933
7928
  "multiple": false,
7934
7929
  "type": "option"
7935
7930
  },
7936
- "target-org": {
7937
- "char": "o",
7938
- "name": "target-org",
7939
- "noCacheDefault": true,
7940
- "required": true,
7941
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7942
- "hasDynamicHelp": true,
7931
+ "prompt": {
7932
+ "char": "z",
7933
+ "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
7934
+ "name": "prompt",
7935
+ "allowNo": true,
7936
+ "type": "boolean"
7937
+ },
7938
+ "name": {
7939
+ "char": "n",
7940
+ "description": "Filter according to Name criteria",
7941
+ "name": "name",
7942
+ "hasDynamicHelp": false,
7943
7943
  "multiple": false,
7944
7944
  "type": "option"
7945
7945
  },
7946
- "delete": {
7947
- "char": "d",
7948
- "description": "By default, Connected Apps are not deleted from the org after saving. Set this flag to force their deletion so they will be able to be reuploaded again after refreshing the org.",
7949
- "name": "delete",
7950
- "summary": "Delete Connected Apps from org after saving",
7946
+ "status": {
7947
+ "char": "s",
7948
+ "description": "Filter according to Status criteria",
7949
+ "name": "status",
7950
+ "hasDynamicHelp": false,
7951
+ "multiple": false,
7952
+ "type": "option"
7953
+ },
7954
+ "delete-flow-interviews": {
7955
+ "char": "w",
7956
+ "description": "If the presence of Flow interviews prevent to delete flows versions, delete them before retrying to delete flow versions",
7957
+ "name": "delete-flow-interviews",
7951
7958
  "allowNo": false,
7952
7959
  "type": "boolean"
7953
7960
  },
7954
- "name": {
7955
- "char": "n",
7956
- "description": "Connected App name(s) to process. For multiple apps, separate with commas (e.g., \"App1,App2\")",
7957
- "name": "name",
7958
- "summary": "Filter according to Name criteria",
7961
+ "allowpurgefailure": {
7962
+ "char": "f",
7963
+ "description": "Allows purges to fail without exiting with 1. Use --no-allowpurgefailure to disable",
7964
+ "name": "allowpurgefailure",
7965
+ "allowNo": true,
7966
+ "type": "boolean"
7967
+ },
7968
+ "instanceurl": {
7969
+ "char": "r",
7970
+ "description": "URL of org instance",
7971
+ "name": "instanceurl",
7972
+ "default": "https://login.salesforce.com",
7959
7973
  "hasDynamicHelp": false,
7960
7974
  "multiple": false,
7961
7975
  "type": "option"
7962
7976
  },
7963
- "all": {
7964
- "char": "a",
7965
- "description": "If set, all Connected Apps from the org will be processed. Takes precedence over --name if both are specified.",
7966
- "name": "all",
7967
- "summary": "Process all Connected Apps without selection prompt",
7977
+ "debug": {
7978
+ "char": "d",
7979
+ "description": "Activate debug mode (more logs)",
7980
+ "name": "debug",
7968
7981
  "allowNo": false,
7969
7982
  "type": "boolean"
7970
7983
  },
@@ -7980,61 +7993,80 @@
7980
7993
  "name": "skipauth",
7981
7994
  "allowNo": false,
7982
7995
  "type": "boolean"
7996
+ },
7997
+ "target-org": {
7998
+ "aliases": [
7999
+ "targetusername",
8000
+ "u"
8001
+ ],
8002
+ "char": "o",
8003
+ "deprecateAliases": true,
8004
+ "name": "target-org",
8005
+ "noCacheDefault": true,
8006
+ "required": true,
8007
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8008
+ "hasDynamicHelp": true,
8009
+ "multiple": false,
8010
+ "type": "option"
7983
8011
  }
7984
8012
  },
7985
8013
  "hasDynamicHelp": true,
7986
8014
  "hiddenAliases": [],
7987
- "id": "hardis:org:refresh:before-refresh",
8015
+ "id": "hardis:org:purge:flow",
7988
8016
  "pluginAlias": "sfdx-hardis",
7989
8017
  "pluginName": "sfdx-hardis",
7990
8018
  "pluginType": "core",
7991
8019
  "strict": true,
7992
8020
  "enableJsonFlag": true,
7993
- "requiresProject": true,
8021
+ "title": "Purge Flow versions",
8022
+ "requiresProject": false,
7994
8023
  "isESM": true,
7995
8024
  "relativePath": [
7996
8025
  "lib",
7997
8026
  "commands",
7998
8027
  "hardis",
7999
8028
  "org",
8000
- "refresh",
8001
- "before-refresh.js"
8029
+ "purge",
8030
+ "flow.js"
8002
8031
  ],
8003
8032
  "aliasPermutations": [],
8004
8033
  "permutations": [
8005
- "hardis:org:refresh:before-refresh",
8006
- "org:hardis:refresh:before-refresh",
8007
- "org:refresh:hardis:before-refresh",
8008
- "org:refresh:before-refresh:hardis",
8009
- "hardis:refresh:org:before-refresh",
8010
- "refresh:hardis:org:before-refresh",
8011
- "refresh:org:hardis:before-refresh",
8012
- "refresh:org:before-refresh:hardis",
8013
- "hardis:refresh:before-refresh:org",
8014
- "refresh:hardis:before-refresh:org",
8015
- "refresh:before-refresh:hardis:org",
8016
- "refresh:before-refresh:org:hardis",
8017
- "hardis:org:before-refresh:refresh",
8018
- "org:hardis:before-refresh:refresh",
8019
- "org:before-refresh:hardis:refresh",
8020
- "org:before-refresh:refresh:hardis",
8021
- "hardis:before-refresh:org:refresh",
8022
- "before-refresh:hardis:org:refresh",
8023
- "before-refresh:org:hardis:refresh",
8024
- "before-refresh:org:refresh:hardis",
8025
- "hardis:before-refresh:refresh:org",
8026
- "before-refresh:hardis:refresh:org",
8027
- "before-refresh:refresh:hardis:org",
8028
- "before-refresh:refresh:org:hardis"
8034
+ "hardis:org:purge:flow",
8035
+ "org:hardis:purge:flow",
8036
+ "org:purge:hardis:flow",
8037
+ "org:purge:flow:hardis",
8038
+ "hardis:purge:org:flow",
8039
+ "purge:hardis:org:flow",
8040
+ "purge:org:hardis:flow",
8041
+ "purge:org:flow:hardis",
8042
+ "hardis:purge:flow:org",
8043
+ "purge:hardis:flow:org",
8044
+ "purge:flow:hardis:org",
8045
+ "purge:flow:org:hardis",
8046
+ "hardis:org:flow:purge",
8047
+ "org:hardis:flow:purge",
8048
+ "org:flow:hardis:purge",
8049
+ "org:flow:purge:hardis",
8050
+ "hardis:flow:org:purge",
8051
+ "flow:hardis:org:purge",
8052
+ "flow:org:hardis:purge",
8053
+ "flow:org:purge:hardis",
8054
+ "hardis:flow:purge:org",
8055
+ "flow:hardis:purge:org",
8056
+ "flow:purge:hardis:org",
8057
+ "flow:purge:org:hardis"
8029
8058
  ]
8030
8059
  },
8031
- "hardis:org:purge:apexlog": {
8060
+ "hardis:org:refresh:after-refresh": {
8032
8061
  "aliases": [],
8033
8062
  "args": {},
8034
- "description": "\n**Purges Apex debug logs from a Salesforce org.**\n\nThis command provides a quick and efficient way to clear out accumulated Apex debug logs from your Salesforce environment. This is particularly useful for:\n\n- **Storage Management:** Freeing up valuable data storage space in your Salesforce org.\n- **Performance Optimization:** Reducing the overhead associated with large volumes of debug logs.\n- **Troubleshooting:** Ensuring that new debug logs are generated cleanly without interference from old, irrelevant logs.\n\nKey functionalities:\n\n- **Log Identification:** Queries the `ApexLog` object to identify all existing debug logs.\n- **Confirmation Prompt:** Before deletion, it prompts for user confirmation, displaying the number of Apex logs that will be deleted.\n- **Bulk Deletion:** Uses the Salesforce Bulk API to efficiently delete a large number of Apex logs.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Query:** It executes a SOQL query (`SELECT Id FROM ApexLog LIMIT 50000`) to retrieve the IDs of Apex logs to be deleted. The limit is set to 50,000 to handle large volumes of logs.\n- **CSV Export:** The retrieved log IDs are temporarily exported to a CSV file (`ApexLogsToDelete_*.csv`) in the `./tmp` directory.\n- **User Confirmation:** It uses the `prompts` library to ask for user confirmation before proceeding with the deletion, displaying the count of logs to be purged.\n- **Bulk API Deletion:** It then uses the Salesforce CLI's `sf data delete bulk` command, pointing to the generated CSV file, to perform the mass deletion of Apex logs.\n- **File System Operations:** It uses `fs-extra` to create the temporary directory and manage the CSV file.\n- **Error Handling:** Includes error handling for the query and deletion operations.\n</details>\n",
8063
+ "description": "\n## Command Behavior\n\n**Restores all previously backed-up Connected Apps (including Consumer Secrets), certificates, custom settings, records and other metadata to a Salesforce org after a sandbox refresh.**\n\nThis command is the second step in the sandbox refresh process. It scans the backup folder created before the refresh, allows interactive or flag-driven selection of items to restore, and automates cleanup and redeployment to the refreshed org while preserving credentials and configuration.\n\nKey functionalities:\n\n- **Choose a backup to restore:** Lets you pick the saved sandbox project that contains the artifacts to restore.\n- **Select which items to restore:** Finds Connected App XMLs, certificates, custom settings and other artifacts and lets you pick what to restore (or restore all).\n- **Safety checks and validation:** Confirms files exist and prompts before making changes to the target org.\n- **Prepare org for restore:** Optionally cleans up existing Connected Apps so saved apps can be re-deployed without conflict.\n- **Redeploy saved artifacts:** Restores Connected Apps (with saved secrets), certificates, SAML SSO configs, custom settings and other metadata.\n- **Handle SAML configs:** Cleans and updates SAML XML files and helps you choose certificates to wire into restored configs.\n- **Restore records:** Optionally runs data import from selected SFDMU workspaces to restore record data.\n- **Reporting & persistence:** Sends restore reports and can update project config to record what was restored.\n\nThis command is part of [sfdx-hardis Sandbox Refresh](https://sfdx-hardis.cloudity.com/salesforce-sandbox-refresh/) and is intended to be run after a sandbox refresh to re-apply saved metadata, credentials and data.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\n- **Backup Folder Handling:** Reads the immediate subfolders of `scripts/sandbox-refresh/` and validates the chosen project contains the expected `manifest/` and `force-app` layout.\n- **Metadata & Deployment APIs:** Uses `sf project deploy start --manifest` for package-based deploys, `sf project deploy start --metadata-dir` for MDAPI artifacts (certificates), and utility functions for Connected App deployment that preserve consumer secrets.\n- **SAML Handling:** Queries active certificates via tooling API, updates SAML XML files, and deploys using `sf project deploy start -m SamlSsoConfig`.\n- **Records Handling:** Uses interactive selection of SFDMU workspaces and runs data import utilities to restore records.\n- **Error Handling & Summary:** Aggregates results, logs success/warnings/errors, and returns a structured result indicating which items were restored and any failures.\n\n</details>\n",
8035
8064
  "examples": [
8036
- "$ sf hardis:org:purge:apexlog",
8037
- "$ sf hardis:org:purge:apexlog --target-org nicolas.vuillamy@gmail.com"
8065
+ "$ sf hardis:org:refresh:after-refresh",
8066
+ "$ sf hardis:org:refresh:after-refresh --name \"MyConnectedApp\" // Process specific app, no selection prompt",
8067
+ "$ sf hardis:org:refresh:after-refresh --name \"App1,App2,App3\" // Process multiple apps, no selection prompt",
8068
+ "$ sf hardis:org:refresh:after-refresh --all // Process all apps, no selection prompt",
8069
+ "$ sf hardis:org:refresh:after-refresh --target-org myDevOrg"
8038
8070
  ],
8039
8071
  "flags": {
8040
8072
  "json": {
@@ -8052,23 +8084,37 @@
8052
8084
  "multiple": false,
8053
8085
  "type": "option"
8054
8086
  },
8055
- "prompt": {
8056
- "char": "z",
8057
- "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
8058
- "name": "prompt",
8059
- "allowNo": true,
8060
- "type": "boolean"
8087
+ "target-org": {
8088
+ "char": "o",
8089
+ "name": "target-org",
8090
+ "noCacheDefault": true,
8091
+ "required": true,
8092
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8093
+ "hasDynamicHelp": true,
8094
+ "multiple": false,
8095
+ "type": "option"
8061
8096
  },
8062
- "debug": {
8063
- "char": "d",
8064
- "description": "Activate debug mode (more logs)",
8065
- "name": "debug",
8097
+ "name": {
8098
+ "char": "n",
8099
+ "description": "Connected App name(s) to process (bypasses selection prompt). For multiple apps, separate with commas (e.g., \"App1,App2\")",
8100
+ "name": "name",
8101
+ "summary": "Filter according to Name criteria",
8102
+ "hasDynamicHelp": false,
8103
+ "multiple": false,
8104
+ "type": "option"
8105
+ },
8106
+ "all": {
8107
+ "char": "a",
8108
+ "description": "If set, all Connected Apps from the local repository will be processed. Takes precedence over --name if both are specified.",
8109
+ "name": "all",
8110
+ "summary": "Process all Connected Apps without selection prompt",
8066
8111
  "allowNo": false,
8067
8112
  "type": "boolean"
8068
8113
  },
8069
8114
  "websocket": {
8070
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
8115
+ "description": "WebSocket host:port for VS Code SFDX Hardis UI integration",
8071
8116
  "name": "websocket",
8117
+ "summary": "Websocket host:port for VsCode SFDX Hardis UI integration",
8072
8118
  "hasDynamicHelp": false,
8073
8119
  "multiple": false,
8074
8120
  "type": "option"
@@ -8076,80 +8122,68 @@
8076
8122
  "skipauth": {
8077
8123
  "description": "Skip authentication check when a default username is required",
8078
8124
  "name": "skipauth",
8125
+ "summary": "Skip authentication check when a default username is required",
8079
8126
  "allowNo": false,
8080
8127
  "type": "boolean"
8081
- },
8082
- "target-org": {
8083
- "aliases": [
8084
- "targetusername",
8085
- "u"
8086
- ],
8087
- "char": "o",
8088
- "deprecateAliases": true,
8089
- "name": "target-org",
8090
- "noCacheDefault": true,
8091
- "required": true,
8092
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8093
- "hasDynamicHelp": true,
8094
- "multiple": false,
8095
- "type": "option"
8096
8128
  }
8097
8129
  },
8098
8130
  "hasDynamicHelp": true,
8099
8131
  "hiddenAliases": [],
8100
- "id": "hardis:org:purge:apexlog",
8132
+ "id": "hardis:org:refresh:after-refresh",
8101
8133
  "pluginAlias": "sfdx-hardis",
8102
8134
  "pluginName": "sfdx-hardis",
8103
8135
  "pluginType": "core",
8104
8136
  "strict": true,
8105
8137
  "enableJsonFlag": true,
8106
- "title": "Purge Apex Logs",
8107
- "requiresProject": false,
8138
+ "title": "Restore Connected Apps after org refresh",
8139
+ "requiresProject": true,
8108
8140
  "isESM": true,
8109
8141
  "relativePath": [
8110
8142
  "lib",
8111
8143
  "commands",
8112
8144
  "hardis",
8113
8145
  "org",
8114
- "purge",
8115
- "apexlog.js"
8146
+ "refresh",
8147
+ "after-refresh.js"
8116
8148
  ],
8117
8149
  "aliasPermutations": [],
8118
8150
  "permutations": [
8119
- "hardis:org:purge:apexlog",
8120
- "org:hardis:purge:apexlog",
8121
- "org:purge:hardis:apexlog",
8122
- "org:purge:apexlog:hardis",
8123
- "hardis:purge:org:apexlog",
8124
- "purge:hardis:org:apexlog",
8125
- "purge:org:hardis:apexlog",
8126
- "purge:org:apexlog:hardis",
8127
- "hardis:purge:apexlog:org",
8128
- "purge:hardis:apexlog:org",
8129
- "purge:apexlog:hardis:org",
8130
- "purge:apexlog:org:hardis",
8131
- "hardis:org:apexlog:purge",
8132
- "org:hardis:apexlog:purge",
8133
- "org:apexlog:hardis:purge",
8134
- "org:apexlog:purge:hardis",
8135
- "hardis:apexlog:org:purge",
8136
- "apexlog:hardis:org:purge",
8137
- "apexlog:org:hardis:purge",
8138
- "apexlog:org:purge:hardis",
8139
- "hardis:apexlog:purge:org",
8140
- "apexlog:hardis:purge:org",
8141
- "apexlog:purge:hardis:org",
8142
- "apexlog:purge:org:hardis"
8151
+ "hardis:org:refresh:after-refresh",
8152
+ "org:hardis:refresh:after-refresh",
8153
+ "org:refresh:hardis:after-refresh",
8154
+ "org:refresh:after-refresh:hardis",
8155
+ "hardis:refresh:org:after-refresh",
8156
+ "refresh:hardis:org:after-refresh",
8157
+ "refresh:org:hardis:after-refresh",
8158
+ "refresh:org:after-refresh:hardis",
8159
+ "hardis:refresh:after-refresh:org",
8160
+ "refresh:hardis:after-refresh:org",
8161
+ "refresh:after-refresh:hardis:org",
8162
+ "refresh:after-refresh:org:hardis",
8163
+ "hardis:org:after-refresh:refresh",
8164
+ "org:hardis:after-refresh:refresh",
8165
+ "org:after-refresh:hardis:refresh",
8166
+ "org:after-refresh:refresh:hardis",
8167
+ "hardis:after-refresh:org:refresh",
8168
+ "after-refresh:hardis:org:refresh",
8169
+ "after-refresh:org:hardis:refresh",
8170
+ "after-refresh:org:refresh:hardis",
8171
+ "hardis:after-refresh:refresh:org",
8172
+ "after-refresh:hardis:refresh:org",
8173
+ "after-refresh:refresh:hardis:org",
8174
+ "after-refresh:refresh:org:hardis"
8143
8175
  ]
8144
8176
  },
8145
- "hardis:org:purge:flow": {
8177
+ "hardis:org:refresh:before-refresh": {
8146
8178
  "aliases": [],
8147
8179
  "args": {},
8148
- "description": "\n**Purges old or unwanted Flow versions from a Salesforce org, with an option to delete related Flow Interviews.**\n\nThis command helps maintain a clean and performant Salesforce org by removing obsolete Flow versions. Over time, multiple versions of Flows can accumulate, consuming storage and potentially impacting performance. This tool provides a controlled way to clean up these versions.\n\nKey functionalities:\n\n- **Targeted Flow Selection:** Allows you to filter Flow versions to delete by name (`--name`) and status (`--status`, e.g., `Obsolete`, `Draft`, `Inactive`).\n- **Flow Interview Deletion:** If a Flow version cannot be deleted due to active Flow Interviews, the `--delete-flow-interviews` flag (or interactive prompt) allows you to delete these interviews first, then retry the Flow version deletion.\n- **Confirmation Prompt:** In interactive mode, it prompts for confirmation before proceeding with the deletion of Flow versions and Flow Interviews.\n- **Partial Success Handling:** The `--allowpurgefailure` flag (default `true`) allows the command to continue even if some deletions fail, reporting the errors.\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 `Flow` object (using the Tooling API) to list Flow versions based on the provided filters (name, status, manageable state).\n- **Bulk Deletion (Tooling API):** It uses `bulkDeleteTooling` to perform mass deletions of Flow versions. If deletion fails due to active interviews, it extracts the interview IDs.\n- **Flow Interview Management:** If `delete-flow-interviews` is enabled, it queries `FlowInterview` objects, performs bulk deletion of the identified interviews using `bulkDelete`, and then retries the Flow version deletion.\n- **Interactive Prompts:** Uses the `prompts` library to interact with the user for selecting Flows, statuses, and confirming deletion actions.\n- **Error Reporting:** Logs detailed error messages for failed deletions, including the specific reasons.\n- **Command-Line Execution:** Uses `execSfdxJson` to execute Salesforce CLI commands for querying Flow data.\n</details>\n",
8180
+ "description": "\n## Command Behavior\n\n**Backs up all Connected Apps (including Consumer Secrets), certificates, custom settings, records and other metadata from a Salesforce org before a sandbox refresh, enabling full restoration after the refresh.**\n\nThis command prepares a complete backup prior to a sandbox refresh. It creates a dedicated project under `scripts/sandbox-refresh/<sandbox-folder>`, retrieves metadata and data, attempts to capture Connected App consumer secrets, and can optionally delete the apps so they can be reuploaded after the refresh.\n\nKey functionalities:\n\n- **Create a save project:** Generates a dedicated project folder to store all artifacts for the sandbox backup.\n- **Find and select Connected Apps:** Lists Connected Apps in the org and lets you pick specific apps, use a name filter, or process all apps.\n- **Save metadata for restore:** Builds a manifest and retrieves the metadata types you choose so they can be restored after the refresh.\n- **Capture Consumer Secrets:** Attempts to capture Connected App consumer secrets automatically (opens a browser session when possible) and falls back to a short manual prompt when needed.\n- **Collect certificates:** Saves certificate files and their definitions so they can be redeployed later.\n- **Export custom settings & records:** Lets you pick custom settings to export as JSON and optionally export records using configured data workspaces.\n- **Persist choices & report:** Stores your backup choices in project config and sends report files for traceability.\n- **Optional cleanup:** Can delete backed-up Connected Apps from the org so they can be re-uploaded cleanly after the refresh.\n- **Interactive safety checks:** Prompts you to confirm package contents and other potentially destructive actions; sensible defaults are chosen where appropriate.\n\nThis command is part of [sfdx-hardis Sandbox Refresh](https://sfdx-hardis.cloudity.com/salesforce-sandbox-refresh/) and is intended to be run before a sandbox refresh so that all credentials, certificates, metadata and data can be restored afterwards.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\n- **Salesforce CLI Integration:** Uses `sf org list metadata`, `sf project retrieve start`, `sf project generate`, `sf project deploy start`, and `sf data tree export`/`import` where applicable.\n- **Metadata Handling:** Writes and reads package XML files under the generated project (`manifest/`), copies MDAPI certificate artifacts into `force-app/main/default/certs`, and produces `package-metadata-to-restore.xml` for post-refresh deployment.\n- **Consumer Secret Handling:** Uses `puppeteer-core` with an executable path from `getChromeExecutablePath()` (env var `PUPPETEER_EXECUTABLE_PATH` may be required). Falls back to manual prompt when browser automation cannot be used.\n- **Data & Records:** Exports custom settings to JSON and supports exporting records through SFDMU workspaces chosen interactively.\n- **Config & Reporting:** Updates project/user config under `config/.sfdx-hardis.yml#refreshSandboxConfig` and reports artifacts to the WebSocket client.\n- **Error Handling:** Provides clear error messages and a summary response object indicating success/failure and which secrets were captured.\n\n</details>\n",
8149
8181
  "examples": [
8150
- "$ sf hardis:org:purge:flow",
8151
- "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --no-prompt --delete-flow-interviews",
8152
- "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --status \"Obsolete,Draft,InvalidDraft\" --name TestFlow"
8182
+ "$ sf hardis:org:refresh:before-refresh",
8183
+ "$ sf hardis:org:refresh:before-refresh --name \"MyConnectedApp\"",
8184
+ "$ sf hardis:org:refresh:before-refresh --name \"App1,App2,App3\"",
8185
+ "$ sf hardis:org:refresh:before-refresh --all",
8186
+ "$ sf hardis:org:refresh:before-refresh --delete"
8153
8187
  ],
8154
8188
  "flags": {
8155
8189
  "json": {
@@ -8167,56 +8201,38 @@
8167
8201
  "multiple": false,
8168
8202
  "type": "option"
8169
8203
  },
8170
- "prompt": {
8171
- "char": "z",
8172
- "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
8173
- "name": "prompt",
8174
- "allowNo": true,
8175
- "type": "boolean"
8176
- },
8177
- "name": {
8178
- "char": "n",
8179
- "description": "Filter according to Name criteria",
8180
- "name": "name",
8181
- "hasDynamicHelp": false,
8182
- "multiple": false,
8183
- "type": "option"
8184
- },
8185
- "status": {
8186
- "char": "s",
8187
- "description": "Filter according to Status criteria",
8188
- "name": "status",
8189
- "hasDynamicHelp": false,
8204
+ "target-org": {
8205
+ "char": "o",
8206
+ "name": "target-org",
8207
+ "noCacheDefault": true,
8208
+ "required": true,
8209
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8210
+ "hasDynamicHelp": true,
8190
8211
  "multiple": false,
8191
8212
  "type": "option"
8192
8213
  },
8193
- "delete-flow-interviews": {
8194
- "char": "w",
8195
- "description": "If the presence of Flow interviews prevent to delete flows versions, delete them before retrying to delete flow versions",
8196
- "name": "delete-flow-interviews",
8214
+ "delete": {
8215
+ "char": "d",
8216
+ "description": "By default, Connected Apps are not deleted from the org after saving. Set this flag to force their deletion so they will be able to be reuploaded again after refreshing the org.",
8217
+ "name": "delete",
8218
+ "summary": "Delete Connected Apps from org after saving",
8197
8219
  "allowNo": false,
8198
8220
  "type": "boolean"
8199
8221
  },
8200
- "allowpurgefailure": {
8201
- "char": "f",
8202
- "description": "Allows purges to fail without exiting with 1. Use --no-allowpurgefailure to disable",
8203
- "name": "allowpurgefailure",
8204
- "allowNo": true,
8205
- "type": "boolean"
8206
- },
8207
- "instanceurl": {
8208
- "char": "r",
8209
- "description": "URL of org instance",
8210
- "name": "instanceurl",
8211
- "default": "https://login.salesforce.com",
8222
+ "name": {
8223
+ "char": "n",
8224
+ "description": "Connected App name(s) to process. For multiple apps, separate with commas (e.g., \"App1,App2\")",
8225
+ "name": "name",
8226
+ "summary": "Filter according to Name criteria",
8212
8227
  "hasDynamicHelp": false,
8213
8228
  "multiple": false,
8214
8229
  "type": "option"
8215
8230
  },
8216
- "debug": {
8217
- "char": "d",
8218
- "description": "Activate debug mode (more logs)",
8219
- "name": "debug",
8231
+ "all": {
8232
+ "char": "a",
8233
+ "description": "If set, all Connected Apps from the org will be processed. Takes precedence over --name if both are specified.",
8234
+ "name": "all",
8235
+ "summary": "Process all Connected Apps without selection prompt",
8220
8236
  "allowNo": false,
8221
8237
  "type": "boolean"
8222
8238
  },
@@ -8232,68 +8248,52 @@
8232
8248
  "name": "skipauth",
8233
8249
  "allowNo": false,
8234
8250
  "type": "boolean"
8235
- },
8236
- "target-org": {
8237
- "aliases": [
8238
- "targetusername",
8239
- "u"
8240
- ],
8241
- "char": "o",
8242
- "deprecateAliases": true,
8243
- "name": "target-org",
8244
- "noCacheDefault": true,
8245
- "required": true,
8246
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8247
- "hasDynamicHelp": true,
8248
- "multiple": false,
8249
- "type": "option"
8250
8251
  }
8251
8252
  },
8252
8253
  "hasDynamicHelp": true,
8253
8254
  "hiddenAliases": [],
8254
- "id": "hardis:org:purge:flow",
8255
+ "id": "hardis:org:refresh:before-refresh",
8255
8256
  "pluginAlias": "sfdx-hardis",
8256
8257
  "pluginName": "sfdx-hardis",
8257
8258
  "pluginType": "core",
8258
8259
  "strict": true,
8259
8260
  "enableJsonFlag": true,
8260
- "title": "Purge Flow versions",
8261
- "requiresProject": false,
8261
+ "requiresProject": true,
8262
8262
  "isESM": true,
8263
8263
  "relativePath": [
8264
8264
  "lib",
8265
8265
  "commands",
8266
8266
  "hardis",
8267
8267
  "org",
8268
- "purge",
8269
- "flow.js"
8268
+ "refresh",
8269
+ "before-refresh.js"
8270
8270
  ],
8271
8271
  "aliasPermutations": [],
8272
8272
  "permutations": [
8273
- "hardis:org:purge:flow",
8274
- "org:hardis:purge:flow",
8275
- "org:purge:hardis:flow",
8276
- "org:purge:flow:hardis",
8277
- "hardis:purge:org:flow",
8278
- "purge:hardis:org:flow",
8279
- "purge:org:hardis:flow",
8280
- "purge:org:flow:hardis",
8281
- "hardis:purge:flow:org",
8282
- "purge:hardis:flow:org",
8283
- "purge:flow:hardis:org",
8284
- "purge:flow:org:hardis",
8285
- "hardis:org:flow:purge",
8286
- "org:hardis:flow:purge",
8287
- "org:flow:hardis:purge",
8288
- "org:flow:purge:hardis",
8289
- "hardis:flow:org:purge",
8290
- "flow:hardis:org:purge",
8291
- "flow:org:hardis:purge",
8292
- "flow:org:purge:hardis",
8293
- "hardis:flow:purge:org",
8294
- "flow:hardis:purge:org",
8295
- "flow:purge:hardis:org",
8296
- "flow:purge:org:hardis"
8273
+ "hardis:org:refresh:before-refresh",
8274
+ "org:hardis:refresh:before-refresh",
8275
+ "org:refresh:hardis:before-refresh",
8276
+ "org:refresh:before-refresh:hardis",
8277
+ "hardis:refresh:org:before-refresh",
8278
+ "refresh:hardis:org:before-refresh",
8279
+ "refresh:org:hardis:before-refresh",
8280
+ "refresh:org:before-refresh:hardis",
8281
+ "hardis:refresh:before-refresh:org",
8282
+ "refresh:hardis:before-refresh:org",
8283
+ "refresh:before-refresh:hardis:org",
8284
+ "refresh:before-refresh:org:hardis",
8285
+ "hardis:org:before-refresh:refresh",
8286
+ "org:hardis:before-refresh:refresh",
8287
+ "org:before-refresh:hardis:refresh",
8288
+ "org:before-refresh:refresh:hardis",
8289
+ "hardis:before-refresh:org:refresh",
8290
+ "before-refresh:hardis:org:refresh",
8291
+ "before-refresh:org:hardis:refresh",
8292
+ "before-refresh:org:refresh:hardis",
8293
+ "hardis:before-refresh:refresh:org",
8294
+ "before-refresh:hardis:refresh:org",
8295
+ "before-refresh:refresh:hardis:org",
8296
+ "before-refresh:refresh:org:hardis"
8297
8297
  ]
8298
8298
  },
8299
8299
  "hardis:org:retrieve:packageconfig": {
@@ -8403,14 +8403,12 @@
8403
8403
  "packageconfig:retrieve:org:hardis"
8404
8404
  ]
8405
8405
  },
8406
- "hardis:org:user:activateinvalid": {
8406
+ "hardis:org:test:apex": {
8407
8407
  "aliases": [],
8408
8408
  "args": {},
8409
- "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",
8409
+ "description": "Run apex tests in Salesforce org\n\nIf following configuration is defined, it will fail if apex coverage target is not reached:\n\n- Env `APEX_TESTS_MIN_COVERAGE_ORG_WIDE` or `.sfdx-hardis` property `apexTestsMinCoverageOrgWide`\n- Env `APEX_TESTS_MIN_COVERAGE_ORG_WIDE` or `.sfdx-hardis` property `apexTestsMinCoverageOrgWide`\n\nYou can override env var SFDX_TEST_WAIT_MINUTES to wait more than 120 minutes.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-apex-tests/) and can output Grafana, Slack and MsTeams Notifications.\n",
8410
8410
  "examples": [
8411
- "$ sf hardis:org:user:activateinvalid",
8412
- "$ sf hardis:org:user:activateinvalid --target-org my-user@myorg.com",
8413
- "$ sf hardis:org:user:activateinvalid --profiles 'System Administrator,MyCustomProfile' --target-org my-user@myorg.com"
8411
+ "$ sf hardis:org:test:apex"
8414
8412
  ],
8415
8413
  "flags": {
8416
8414
  "json": {
@@ -8428,12 +8426,19 @@
8428
8426
  "multiple": false,
8429
8427
  "type": "option"
8430
8428
  },
8431
- "profiles": {
8432
- "char": "p",
8433
- "description": "Comma-separated list of profiles names that you want to reactive users assigned to and with a .invalid email",
8434
- "name": "profiles",
8429
+ "testlevel": {
8430
+ "char": "l",
8431
+ "description": "Level of tests to apply to validate deployment",
8432
+ "name": "testlevel",
8433
+ "default": "RunLocalTests",
8435
8434
  "hasDynamicHelp": false,
8436
8435
  "multiple": false,
8436
+ "options": [
8437
+ "NoTestRun",
8438
+ "RunSpecifiedTests",
8439
+ "RunLocalTests",
8440
+ "RunAllTestsInOrg"
8441
+ ],
8437
8442
  "type": "option"
8438
8443
  },
8439
8444
  "debug": {
@@ -8474,60 +8479,58 @@
8474
8479
  },
8475
8480
  "hasDynamicHelp": true,
8476
8481
  "hiddenAliases": [],
8477
- "id": "hardis:org:user:activateinvalid",
8482
+ "id": "hardis:org:test:apex",
8478
8483
  "pluginAlias": "sfdx-hardis",
8479
8484
  "pluginName": "sfdx-hardis",
8480
8485
  "pluginType": "core",
8481
8486
  "strict": true,
8482
8487
  "enableJsonFlag": true,
8483
- "title": "Reactivate sandbox invalid users",
8484
- "requiresProject": false,
8488
+ "title": "Run apex tests",
8485
8489
  "isESM": true,
8486
8490
  "relativePath": [
8487
8491
  "lib",
8488
8492
  "commands",
8489
8493
  "hardis",
8490
8494
  "org",
8491
- "user",
8492
- "activateinvalid.js"
8495
+ "test",
8496
+ "apex.js"
8493
8497
  ],
8494
8498
  "aliasPermutations": [],
8495
8499
  "permutations": [
8496
- "hardis:org:user:activateinvalid",
8497
- "org:hardis:user:activateinvalid",
8498
- "org:user:hardis:activateinvalid",
8499
- "org:user:activateinvalid:hardis",
8500
- "hardis:user:org:activateinvalid",
8501
- "user:hardis:org:activateinvalid",
8502
- "user:org:hardis:activateinvalid",
8503
- "user:org:activateinvalid:hardis",
8504
- "hardis:user:activateinvalid:org",
8505
- "user:hardis:activateinvalid:org",
8506
- "user:activateinvalid:hardis:org",
8507
- "user:activateinvalid:org:hardis",
8508
- "hardis:org:activateinvalid:user",
8509
- "org:hardis:activateinvalid:user",
8510
- "org:activateinvalid:hardis:user",
8511
- "org:activateinvalid:user:hardis",
8512
- "hardis:activateinvalid:org:user",
8513
- "activateinvalid:hardis:org:user",
8514
- "activateinvalid:org:hardis:user",
8515
- "activateinvalid:org:user:hardis",
8516
- "hardis:activateinvalid:user:org",
8517
- "activateinvalid:hardis:user:org",
8518
- "activateinvalid:user:hardis:org",
8519
- "activateinvalid:user:org:hardis"
8500
+ "hardis:org:test:apex",
8501
+ "org:hardis:test:apex",
8502
+ "org:test:hardis:apex",
8503
+ "org:test:apex:hardis",
8504
+ "hardis:test:org:apex",
8505
+ "test:hardis:org:apex",
8506
+ "test:org:hardis:apex",
8507
+ "test:org:apex:hardis",
8508
+ "hardis:test:apex:org",
8509
+ "test:hardis:apex:org",
8510
+ "test:apex:hardis:org",
8511
+ "test:apex:org:hardis",
8512
+ "hardis:org:apex:test",
8513
+ "org:hardis:apex:test",
8514
+ "org:apex:hardis:test",
8515
+ "org:apex:test:hardis",
8516
+ "hardis:apex:org:test",
8517
+ "apex:hardis:org:test",
8518
+ "apex:org:hardis:test",
8519
+ "apex:org:test:hardis",
8520
+ "hardis:apex:test:org",
8521
+ "apex:hardis:test:org",
8522
+ "apex:test:hardis:org",
8523
+ "apex:test:org:hardis"
8520
8524
  ]
8521
8525
  },
8522
- "hardis:org:user:freeze": {
8526
+ "hardis:org:user:activateinvalid": {
8523
8527
  "aliases": [],
8524
8528
  "args": {},
8525
- "description": "\n## Command Behavior\n\n**Freezes Salesforce user logins, temporarily revoking access for selected users.**\n\nThis command allows administrators to freeze Salesforce user logins. It provides a controlled way to temporarily revoke user access without deactivating the user record itself. This is useful for managing user access during leaves, security incidents, or when a user's access needs to be temporarily suspended.\n\nKey functionalities:\n\n- **User Selection:** You can select users to freeze based on their assigned profiles.\n - `--includeprofiles`: Freeze users belonging to a comma-separated list of specified profiles.\n - `--excludeprofiles`: Freeze users belonging to all profiles *except* those specified in a comma-separated list.\n - If no profile flags are provided, an interactive menu will allow you to select profiles.\n- **Interactive Confirmation:** In non-CI environments, it prompts for confirmation before freezing the selected users.\n- **Bulk Freezing:** Efficiently freezes multiple user logins using Salesforce's Bulk API.\n- **Reporting:** Generates CSV and XLSX reports of the users that are about to be frozen.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Bulk API):** It executes SOQL queries against the `User` and `Profile` objects to identify active users based on the provided profile filters. It then queries the `UserLogin` object to find active login sessions for these users.\n- **Interactive Prompts:** Uses the `prompts` library to guide the user through profile selection and to confirm the freezing operation.\n- **Bulk Update:** It constructs an array of `UserLogin` records with their `Id` and `IsFrozen` set to `true`, then uses `bulkUpdate` to perform the mass update operation on the Salesforce org.\n- **Reporting:** It uses `generateReports` to create CSV and XLSX files containing details of the users to be frozen.\n- **Logging:** Provides clear messages about the number of users found and the success of the freezing process.\n</details>\n",
8529
+ "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",
8526
8530
  "examples": [
8527
- "$ sf hardis:org:user:freeze",
8528
- "$ sf hardis:org:user:freeze --target-org my-user@myorg.com",
8529
- "$ sf hardis:org:user:freeze --includeprofiles 'Standard'",
8530
- "$ sf hardis:org:user:freeze --excludeprofiles 'System Administrator,Some Other Profile'"
8531
+ "$ sf hardis:org:user:activateinvalid",
8532
+ "$ sf hardis:org:user:activateinvalid --target-org my-user@myorg.com",
8533
+ "$ sf hardis:org:user:activateinvalid --profiles 'System Administrator,MyCustomProfile' --target-org my-user@myorg.com"
8531
8534
  ],
8532
8535
  "flags": {
8533
8536
  "json": {
@@ -8545,35 +8548,10 @@
8545
8548
  "multiple": false,
8546
8549
  "type": "option"
8547
8550
  },
8548
- "name": {
8549
- "char": "n",
8550
- "description": "Filter according to Name criteria",
8551
- "name": "name",
8552
- "hasDynamicHelp": false,
8553
- "multiple": false,
8554
- "type": "option"
8555
- },
8556
- "includeprofiles": {
8551
+ "profiles": {
8557
8552
  "char": "p",
8558
- "description": "List of profiles that you want to freeze, separated by commas",
8559
- "name": "includeprofiles",
8560
- "hasDynamicHelp": false,
8561
- "multiple": false,
8562
- "type": "option"
8563
- },
8564
- "excludeprofiles": {
8565
- "char": "e",
8566
- "description": "List of profiles that you want to NOT freeze, separated by commas",
8567
- "name": "excludeprofiles",
8568
- "hasDynamicHelp": false,
8569
- "multiple": false,
8570
- "type": "option"
8571
- },
8572
- "maxuserdisplay": {
8573
- "char": "m",
8574
- "description": "Maximum users to display in logs",
8575
- "name": "maxuserdisplay",
8576
- "default": 100,
8553
+ "description": "Comma-separated list of profiles names that you want to reactive users assigned to and with a .invalid email",
8554
+ "name": "profiles",
8577
8555
  "hasDynamicHelp": false,
8578
8556
  "multiple": false,
8579
8557
  "type": "option"
@@ -8616,13 +8594,13 @@
8616
8594
  },
8617
8595
  "hasDynamicHelp": true,
8618
8596
  "hiddenAliases": [],
8619
- "id": "hardis:org:user:freeze",
8597
+ "id": "hardis:org:user:activateinvalid",
8620
8598
  "pluginAlias": "sfdx-hardis",
8621
8599
  "pluginName": "sfdx-hardis",
8622
8600
  "pluginType": "core",
8623
8601
  "strict": true,
8624
8602
  "enableJsonFlag": true,
8625
- "title": "Freeze user logins",
8603
+ "title": "Reactivate sandbox invalid users",
8626
8604
  "requiresProject": false,
8627
8605
  "isESM": true,
8628
8606
  "relativePath": [
@@ -8631,45 +8609,45 @@
8631
8609
  "hardis",
8632
8610
  "org",
8633
8611
  "user",
8634
- "freeze.js"
8612
+ "activateinvalid.js"
8635
8613
  ],
8636
8614
  "aliasPermutations": [],
8637
8615
  "permutations": [
8638
- "hardis:org:user:freeze",
8639
- "org:hardis:user:freeze",
8640
- "org:user:hardis:freeze",
8641
- "org:user:freeze:hardis",
8642
- "hardis:user:org:freeze",
8643
- "user:hardis:org:freeze",
8644
- "user:org:hardis:freeze",
8645
- "user:org:freeze:hardis",
8646
- "hardis:user:freeze:org",
8647
- "user:hardis:freeze:org",
8648
- "user:freeze:hardis:org",
8649
- "user:freeze:org:hardis",
8650
- "hardis:org:freeze:user",
8651
- "org:hardis:freeze:user",
8652
- "org:freeze:hardis:user",
8653
- "org:freeze:user:hardis",
8654
- "hardis:freeze:org:user",
8655
- "freeze:hardis:org:user",
8656
- "freeze:org:hardis:user",
8657
- "freeze:org:user:hardis",
8658
- "hardis:freeze:user:org",
8659
- "freeze:hardis:user:org",
8660
- "freeze:user:hardis:org",
8661
- "freeze:user:org:hardis"
8616
+ "hardis:org:user:activateinvalid",
8617
+ "org:hardis:user:activateinvalid",
8618
+ "org:user:hardis:activateinvalid",
8619
+ "org:user:activateinvalid:hardis",
8620
+ "hardis:user:org:activateinvalid",
8621
+ "user:hardis:org:activateinvalid",
8622
+ "user:org:hardis:activateinvalid",
8623
+ "user:org:activateinvalid:hardis",
8624
+ "hardis:user:activateinvalid:org",
8625
+ "user:hardis:activateinvalid:org",
8626
+ "user:activateinvalid:hardis:org",
8627
+ "user:activateinvalid:org:hardis",
8628
+ "hardis:org:activateinvalid:user",
8629
+ "org:hardis:activateinvalid:user",
8630
+ "org:activateinvalid:hardis:user",
8631
+ "org:activateinvalid:user:hardis",
8632
+ "hardis:activateinvalid:org:user",
8633
+ "activateinvalid:hardis:org:user",
8634
+ "activateinvalid:org:hardis:user",
8635
+ "activateinvalid:org:user:hardis",
8636
+ "hardis:activateinvalid:user:org",
8637
+ "activateinvalid:hardis:user:org",
8638
+ "activateinvalid:user:hardis:org",
8639
+ "activateinvalid:user:org:hardis"
8662
8640
  ]
8663
8641
  },
8664
- "hardis:org:user:unfreeze": {
8642
+ "hardis:org:user:freeze": {
8665
8643
  "aliases": [],
8666
8644
  "args": {},
8667
- "description": "\n## Command Behavior\n\n**Unfreezes Salesforce user logins, restoring access for selected users.**\n\nThis command allows administrators to unfreeze Salesforce user logins, reactivating their access to the Salesforce org. This is the counterpart to the `freeze` command and is used to restore access after a temporary suspension.\n\nKey functionalities:\n\n- **User Selection:** You can select users to unfreeze based on their assigned profiles.\n - `--includeprofiles`: Unfreeze users belonging to a comma-separated list of specified profiles.\n - `--excludeprofiles`: Unfreeze users belonging to all profiles *except* those specified in a comma-separated list.\n - If no profile flags are provided, an interactive menu will allow you to select profiles.\n- **Interactive Confirmation:** In non-CI environments, it prompts for confirmation before unfreezing the selected users.\n- **Bulk Unfreezing:** Efficiently unfreezes multiple user logins using Salesforce's Bulk API.\n- **Reporting:** Generates CSV and XLSX reports of the users that are about to be unfrozen.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Bulk API):** It executes SOQL queries against the `User` and `Profile` objects to identify active users based on the provided profile filters. It then queries the `UserLogin` object to find frozen login sessions for these users.\n- **Interactive Prompts:** Uses the `prompts` library to guide the user through profile selection and to confirm the unfreezing operation.\n- **Bulk Update:** It constructs an array of `UserLogin` records with their `Id` and `IsFrozen` set to `false`, then uses `bulkUpdate` to perform the mass update operation on the Salesforce org.\n- **Reporting:** It uses `generateReports` to create CSV and XLSX files containing details of the users to be unfrozen.\n- **Logging:** Provides clear messages about the number of users found and the success of the unfreezing process.\n</details>\n",
8645
+ "description": "\n## Command Behavior\n\n**Freezes Salesforce user logins, temporarily revoking access for selected users.**\n\nThis command allows administrators to freeze Salesforce user logins. It provides a controlled way to temporarily revoke user access without deactivating the user record itself. This is useful for managing user access during leaves, security incidents, or when a user's access needs to be temporarily suspended.\n\nKey functionalities:\n\n- **User Selection:** You can select users to freeze based on their assigned profiles.\n - `--includeprofiles`: Freeze users belonging to a comma-separated list of specified profiles.\n - `--excludeprofiles`: Freeze users belonging to all profiles *except* those specified in a comma-separated list.\n - If no profile flags are provided, an interactive menu will allow you to select profiles.\n- **Interactive Confirmation:** In non-CI environments, it prompts for confirmation before freezing the selected users.\n- **Bulk Freezing:** Efficiently freezes multiple user logins using Salesforce's Bulk API.\n- **Reporting:** Generates CSV and XLSX reports of the users that are about to be frozen.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Bulk API):** It executes SOQL queries against the `User` and `Profile` objects to identify active users based on the provided profile filters. It then queries the `UserLogin` object to find active login sessions for these users.\n- **Interactive Prompts:** Uses the `prompts` library to guide the user through profile selection and to confirm the freezing operation.\n- **Bulk Update:** It constructs an array of `UserLogin` records with their `Id` and `IsFrozen` set to `true`, then uses `bulkUpdate` to perform the mass update operation on the Salesforce org.\n- **Reporting:** It uses `generateReports` to create CSV and XLSX files containing details of the users to be frozen.\n- **Logging:** Provides clear messages about the number of users found and the success of the freezing process.\n</details>\n",
8668
8646
  "examples": [
8669
- "$ sf hardis:org:user:unfreeze",
8670
- "$ sf hardis:org:user:unfreeze --target-org my-user@myorg.com",
8671
- "$ sf hardis:org:user:unfreeze --includeprofiles 'Standard'",
8672
- "$ sf hardis:org:user:unfreeze --excludeprofiles 'System Administrator,Some Other Profile'"
8647
+ "$ sf hardis:org:user:freeze",
8648
+ "$ sf hardis:org:user:freeze --target-org my-user@myorg.com",
8649
+ "$ sf hardis:org:user:freeze --includeprofiles 'Standard'",
8650
+ "$ sf hardis:org:user:freeze --excludeprofiles 'System Administrator,Some Other Profile'"
8673
8651
  ],
8674
8652
  "flags": {
8675
8653
  "json": {
@@ -8697,7 +8675,7 @@
8697
8675
  },
8698
8676
  "includeprofiles": {
8699
8677
  "char": "p",
8700
- "description": "List of profiles that you want to unfreeze, separated by commas",
8678
+ "description": "List of profiles that you want to freeze, separated by commas",
8701
8679
  "name": "includeprofiles",
8702
8680
  "hasDynamicHelp": false,
8703
8681
  "multiple": false,
@@ -8705,7 +8683,7 @@
8705
8683
  },
8706
8684
  "excludeprofiles": {
8707
8685
  "char": "e",
8708
- "description": "List of profiles that you want to NOT unfreeze, separated by commas",
8686
+ "description": "List of profiles that you want to NOT freeze, separated by commas",
8709
8687
  "name": "excludeprofiles",
8710
8688
  "hasDynamicHelp": false,
8711
8689
  "multiple": false,
@@ -8758,13 +8736,13 @@
8758
8736
  },
8759
8737
  "hasDynamicHelp": true,
8760
8738
  "hiddenAliases": [],
8761
- "id": "hardis:org:user:unfreeze",
8739
+ "id": "hardis:org:user:freeze",
8762
8740
  "pluginAlias": "sfdx-hardis",
8763
8741
  "pluginName": "sfdx-hardis",
8764
8742
  "pluginType": "core",
8765
8743
  "strict": true,
8766
8744
  "enableJsonFlag": true,
8767
- "title": "Unfreeze user logins",
8745
+ "title": "Freeze user logins",
8768
8746
  "requiresProject": false,
8769
8747
  "isESM": true,
8770
8748
  "relativePath": [
@@ -8773,42 +8751,45 @@
8773
8751
  "hardis",
8774
8752
  "org",
8775
8753
  "user",
8776
- "unfreeze.js"
8754
+ "freeze.js"
8777
8755
  ],
8778
8756
  "aliasPermutations": [],
8779
8757
  "permutations": [
8780
- "hardis:org:user:unfreeze",
8781
- "org:hardis:user:unfreeze",
8782
- "org:user:hardis:unfreeze",
8783
- "org:user:unfreeze:hardis",
8784
- "hardis:user:org:unfreeze",
8785
- "user:hardis:org:unfreeze",
8786
- "user:org:hardis:unfreeze",
8787
- "user:org:unfreeze:hardis",
8788
- "hardis:user:unfreeze:org",
8789
- "user:hardis:unfreeze:org",
8790
- "user:unfreeze:hardis:org",
8791
- "user:unfreeze:org:hardis",
8792
- "hardis:org:unfreeze:user",
8793
- "org:hardis:unfreeze:user",
8794
- "org:unfreeze:hardis:user",
8795
- "org:unfreeze:user:hardis",
8796
- "hardis:unfreeze:org:user",
8797
- "unfreeze:hardis:org:user",
8798
- "unfreeze:org:hardis:user",
8799
- "unfreeze:org:user:hardis",
8800
- "hardis:unfreeze:user:org",
8801
- "unfreeze:hardis:user:org",
8802
- "unfreeze:user:hardis:org",
8803
- "unfreeze:user:org:hardis"
8758
+ "hardis:org:user:freeze",
8759
+ "org:hardis:user:freeze",
8760
+ "org:user:hardis:freeze",
8761
+ "org:user:freeze:hardis",
8762
+ "hardis:user:org:freeze",
8763
+ "user:hardis:org:freeze",
8764
+ "user:org:hardis:freeze",
8765
+ "user:org:freeze:hardis",
8766
+ "hardis:user:freeze:org",
8767
+ "user:hardis:freeze:org",
8768
+ "user:freeze:hardis:org",
8769
+ "user:freeze:org:hardis",
8770
+ "hardis:org:freeze:user",
8771
+ "org:hardis:freeze:user",
8772
+ "org:freeze:hardis:user",
8773
+ "org:freeze:user:hardis",
8774
+ "hardis:freeze:org:user",
8775
+ "freeze:hardis:org:user",
8776
+ "freeze:org:hardis:user",
8777
+ "freeze:org:user:hardis",
8778
+ "hardis:freeze:user:org",
8779
+ "freeze:hardis:user:org",
8780
+ "freeze:user:hardis:org",
8781
+ "freeze:user:org:hardis"
8804
8782
  ]
8805
8783
  },
8806
- "hardis:org:test:apex": {
8784
+ "hardis:org:user:unfreeze": {
8807
8785
  "aliases": [],
8808
8786
  "args": {},
8809
- "description": "Run apex tests in Salesforce org\n\nIf following configuration is defined, it will fail if apex coverage target is not reached:\n\n- Env `APEX_TESTS_MIN_COVERAGE_ORG_WIDE` or `.sfdx-hardis` property `apexTestsMinCoverageOrgWide`\n- Env `APEX_TESTS_MIN_COVERAGE_ORG_WIDE` or `.sfdx-hardis` property `apexTestsMinCoverageOrgWide`\n\nYou can override env var SFDX_TEST_WAIT_MINUTES to wait more than 120 minutes.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-apex-tests/) and can output Grafana, Slack and MsTeams Notifications.\n",
8787
+ "description": "\n## Command Behavior\n\n**Unfreezes Salesforce user logins, restoring access for selected users.**\n\nThis command allows administrators to unfreeze Salesforce user logins, reactivating their access to the Salesforce org. This is the counterpart to the `freeze` command and is used to restore access after a temporary suspension.\n\nKey functionalities:\n\n- **User Selection:** You can select users to unfreeze based on their assigned profiles.\n - `--includeprofiles`: Unfreeze users belonging to a comma-separated list of specified profiles.\n - `--excludeprofiles`: Unfreeze users belonging to all profiles *except* those specified in a comma-separated list.\n - If no profile flags are provided, an interactive menu will allow you to select profiles.\n- **Interactive Confirmation:** In non-CI environments, it prompts for confirmation before unfreezing the selected users.\n- **Bulk Unfreezing:** Efficiently unfreezes multiple user logins using Salesforce's Bulk API.\n- **Reporting:** Generates CSV and XLSX reports of the users that are about to be unfrozen.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Queries (Bulk API):** It executes SOQL queries against the `User` and `Profile` objects to identify active users based on the provided profile filters. It then queries the `UserLogin` object to find frozen login sessions for these users.\n- **Interactive Prompts:** Uses the `prompts` library to guide the user through profile selection and to confirm the unfreezing operation.\n- **Bulk Update:** It constructs an array of `UserLogin` records with their `Id` and `IsFrozen` set to `false`, then uses `bulkUpdate` to perform the mass update operation on the Salesforce org.\n- **Reporting:** It uses `generateReports` to create CSV and XLSX files containing details of the users to be unfrozen.\n- **Logging:** Provides clear messages about the number of users found and the success of the unfreezing process.\n</details>\n",
8810
8788
  "examples": [
8811
- "$ sf hardis:org:test:apex"
8789
+ "$ sf hardis:org:user:unfreeze",
8790
+ "$ sf hardis:org:user:unfreeze --target-org my-user@myorg.com",
8791
+ "$ sf hardis:org:user:unfreeze --includeprofiles 'Standard'",
8792
+ "$ sf hardis:org:user:unfreeze --excludeprofiles 'System Administrator,Some Other Profile'"
8812
8793
  ],
8813
8794
  "flags": {
8814
8795
  "json": {
@@ -8826,19 +8807,37 @@
8826
8807
  "multiple": false,
8827
8808
  "type": "option"
8828
8809
  },
8829
- "testlevel": {
8830
- "char": "l",
8831
- "description": "Level of tests to apply to validate deployment",
8832
- "name": "testlevel",
8833
- "default": "RunLocalTests",
8810
+ "name": {
8811
+ "char": "n",
8812
+ "description": "Filter according to Name criteria",
8813
+ "name": "name",
8814
+ "hasDynamicHelp": false,
8815
+ "multiple": false,
8816
+ "type": "option"
8817
+ },
8818
+ "includeprofiles": {
8819
+ "char": "p",
8820
+ "description": "List of profiles that you want to unfreeze, separated by commas",
8821
+ "name": "includeprofiles",
8822
+ "hasDynamicHelp": false,
8823
+ "multiple": false,
8824
+ "type": "option"
8825
+ },
8826
+ "excludeprofiles": {
8827
+ "char": "e",
8828
+ "description": "List of profiles that you want to NOT unfreeze, separated by commas",
8829
+ "name": "excludeprofiles",
8830
+ "hasDynamicHelp": false,
8831
+ "multiple": false,
8832
+ "type": "option"
8833
+ },
8834
+ "maxuserdisplay": {
8835
+ "char": "m",
8836
+ "description": "Maximum users to display in logs",
8837
+ "name": "maxuserdisplay",
8838
+ "default": 100,
8834
8839
  "hasDynamicHelp": false,
8835
8840
  "multiple": false,
8836
- "options": [
8837
- "NoTestRun",
8838
- "RunSpecifiedTests",
8839
- "RunLocalTests",
8840
- "RunAllTestsInOrg"
8841
- ],
8842
8841
  "type": "option"
8843
8842
  },
8844
8843
  "debug": {
@@ -8879,48 +8878,49 @@
8879
8878
  },
8880
8879
  "hasDynamicHelp": true,
8881
8880
  "hiddenAliases": [],
8882
- "id": "hardis:org:test:apex",
8881
+ "id": "hardis:org:user:unfreeze",
8883
8882
  "pluginAlias": "sfdx-hardis",
8884
8883
  "pluginName": "sfdx-hardis",
8885
8884
  "pluginType": "core",
8886
8885
  "strict": true,
8887
8886
  "enableJsonFlag": true,
8888
- "title": "Run apex tests",
8887
+ "title": "Unfreeze user logins",
8888
+ "requiresProject": false,
8889
8889
  "isESM": true,
8890
8890
  "relativePath": [
8891
8891
  "lib",
8892
8892
  "commands",
8893
8893
  "hardis",
8894
8894
  "org",
8895
- "test",
8896
- "apex.js"
8895
+ "user",
8896
+ "unfreeze.js"
8897
8897
  ],
8898
8898
  "aliasPermutations": [],
8899
8899
  "permutations": [
8900
- "hardis:org:test:apex",
8901
- "org:hardis:test:apex",
8902
- "org:test:hardis:apex",
8903
- "org:test:apex:hardis",
8904
- "hardis:test:org:apex",
8905
- "test:hardis:org:apex",
8906
- "test:org:hardis:apex",
8907
- "test:org:apex:hardis",
8908
- "hardis:test:apex:org",
8909
- "test:hardis:apex:org",
8910
- "test:apex:hardis:org",
8911
- "test:apex:org:hardis",
8912
- "hardis:org:apex:test",
8913
- "org:hardis:apex:test",
8914
- "org:apex:hardis:test",
8915
- "org:apex:test:hardis",
8916
- "hardis:apex:org:test",
8917
- "apex:hardis:org:test",
8918
- "apex:org:hardis:test",
8919
- "apex:org:test:hardis",
8920
- "hardis:apex:test:org",
8921
- "apex:hardis:test:org",
8922
- "apex:test:hardis:org",
8923
- "apex:test:org:hardis"
8900
+ "hardis:org:user:unfreeze",
8901
+ "org:hardis:user:unfreeze",
8902
+ "org:user:hardis:unfreeze",
8903
+ "org:user:unfreeze:hardis",
8904
+ "hardis:user:org:unfreeze",
8905
+ "user:hardis:org:unfreeze",
8906
+ "user:org:hardis:unfreeze",
8907
+ "user:org:unfreeze:hardis",
8908
+ "hardis:user:unfreeze:org",
8909
+ "user:hardis:unfreeze:org",
8910
+ "user:unfreeze:hardis:org",
8911
+ "user:unfreeze:org:hardis",
8912
+ "hardis:org:unfreeze:user",
8913
+ "org:hardis:unfreeze:user",
8914
+ "org:unfreeze:hardis:user",
8915
+ "org:unfreeze:user:hardis",
8916
+ "hardis:unfreeze:org:user",
8917
+ "unfreeze:hardis:org:user",
8918
+ "unfreeze:org:hardis:user",
8919
+ "unfreeze:org:user:hardis",
8920
+ "hardis:unfreeze:user:org",
8921
+ "unfreeze:hardis:user:org",
8922
+ "unfreeze:user:hardis:org",
8923
+ "unfreeze:user:org:hardis"
8924
8924
  ]
8925
8925
  },
8926
8926
  "hardis:package:version:create": {
@@ -9131,158 +9131,46 @@
9131
9131
  "relativePath": [
9132
9132
  "lib",
9133
9133
  "commands",
9134
- "hardis",
9135
- "package",
9136
- "version",
9137
- "list.js"
9138
- ],
9139
- "aliasPermutations": [],
9140
- "permutations": [
9141
- "hardis:package:version:list",
9142
- "package:hardis:version:list",
9143
- "package:version:hardis:list",
9144
- "package:version:list:hardis",
9145
- "hardis:version:package:list",
9146
- "version:hardis:package:list",
9147
- "version:package:hardis:list",
9148
- "version:package:list:hardis",
9149
- "hardis:version:list:package",
9150
- "version:hardis:list:package",
9151
- "version:list:hardis:package",
9152
- "version:list:package:hardis",
9153
- "hardis:package:list:version",
9154
- "package:hardis:list:version",
9155
- "package:list:hardis:version",
9156
- "package:list:version:hardis",
9157
- "hardis:list:package:version",
9158
- "list:hardis:package:version",
9159
- "list:package:hardis:version",
9160
- "list:package:version:hardis",
9161
- "hardis:list:version:package",
9162
- "list:hardis:version:package",
9163
- "list:version:hardis:package",
9164
- "list:version:package:hardis"
9165
- ]
9166
- },
9167
- "hardis:package:version:promote": {
9168
- "aliases": [],
9169
- "args": {},
9170
- "description": "\n## Command Behavior\n\n**Promotes a Salesforce package version from beta to released status in your Dev Hub.**\n\nThis command is a critical step in the package development lifecycle, marking a package version as stable and ready for production use. Once promoted, a package version can be installed in production organizations.\n\nKey functionalities:\n\n- **Package Version Selection:** Allows you to select a specific package version to promote. If the `--auto` flag is used, it automatically identifies package versions that are not yet released and promotes them.\n- **Automated Promotion:** When `--auto` is enabled, it queries for all unreleased package versions and promotes them without further user interaction.\n- **Dev Hub Integration:** Interacts with your connected Dev Hub to change the status of the package version.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Package Alias Retrieval:** It retrieves package aliases from your `sfdx-project.json` to identify available packages.\n- **Automated Promotion Logic:** If `--auto` is used, it executes `sf package version list --released` to get a list of already released packages and then filters the available package aliases to find those that are not yet released.\n- **Interactive Prompts:** If not in auto mode, it uses the `prompts` library to allow the user to select a package version to promote.\n- **Salesforce CLI Integration:** It constructs and executes the `sf package version promote` command, passing the package version ID.\n- **`execSfdxJson`:** This utility is used to execute the Salesforce CLI command and capture its JSON output.\n- **Error Handling:** It handles cases where a package version might already be promoted or if other errors occur during the promotion process.\n</details>\n",
9171
- "examples": [
9172
- "$ sf hardis:package:version:promote",
9173
- "$ sf hardis:package:version:promote --auto"
9174
- ],
9175
- "flags": {
9176
- "json": {
9177
- "description": "Format output as json.",
9178
- "helpGroup": "GLOBAL",
9179
- "name": "json",
9180
- "allowNo": false,
9181
- "type": "boolean"
9182
- },
9183
- "flags-dir": {
9184
- "helpGroup": "GLOBAL",
9185
- "name": "flags-dir",
9186
- "summary": "Import flag values from a directory.",
9187
- "hasDynamicHelp": false,
9188
- "multiple": false,
9189
- "type": "option"
9190
- },
9191
- "auto": {
9192
- "char": "f",
9193
- "description": "Auto-detect which versions of which packages need to be promoted",
9194
- "name": "auto",
9195
- "allowNo": false,
9196
- "type": "boolean"
9197
- },
9198
- "debug": {
9199
- "char": "d",
9200
- "description": "Activate debug mode (more logs)",
9201
- "name": "debug",
9202
- "allowNo": false,
9203
- "type": "boolean"
9204
- },
9205
- "websocket": {
9206
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9207
- "name": "websocket",
9208
- "hasDynamicHelp": false,
9209
- "multiple": false,
9210
- "type": "option"
9211
- },
9212
- "skipauth": {
9213
- "description": "Skip authentication check when a default username is required",
9214
- "name": "skipauth",
9215
- "allowNo": false,
9216
- "type": "boolean"
9217
- },
9218
- "target-dev-hub": {
9219
- "aliases": [
9220
- "targetdevhubusername"
9221
- ],
9222
- "char": "v",
9223
- "deprecateAliases": true,
9224
- "name": "target-dev-hub",
9225
- "noCacheDefault": true,
9226
- "required": true,
9227
- "summary": "Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.",
9228
- "hasDynamicHelp": true,
9229
- "multiple": false,
9230
- "type": "option"
9231
- }
9232
- },
9233
- "hasDynamicHelp": true,
9234
- "hiddenAliases": [],
9235
- "id": "hardis:package:version:promote",
9236
- "pluginAlias": "sfdx-hardis",
9237
- "pluginName": "sfdx-hardis",
9238
- "pluginType": "core",
9239
- "strict": true,
9240
- "enableJsonFlag": true,
9241
- "title": "Promote new versions of package(s)",
9242
- "requiresProject": true,
9243
- "isESM": true,
9244
- "relativePath": [
9245
- "lib",
9246
- "commands",
9247
- "hardis",
9248
- "package",
9249
- "version",
9250
- "promote.js"
9251
- ],
9252
- "aliasPermutations": [],
9253
- "permutations": [
9254
- "hardis:package:version:promote",
9255
- "package:hardis:version:promote",
9256
- "package:version:hardis:promote",
9257
- "package:version:promote:hardis",
9258
- "hardis:version:package:promote",
9259
- "version:hardis:package:promote",
9260
- "version:package:hardis:promote",
9261
- "version:package:promote:hardis",
9262
- "hardis:version:promote:package",
9263
- "version:hardis:promote:package",
9264
- "version:promote:hardis:package",
9265
- "version:promote:package:hardis",
9266
- "hardis:package:promote:version",
9267
- "package:hardis:promote:version",
9268
- "package:promote:hardis:version",
9269
- "package:promote:version:hardis",
9270
- "hardis:promote:package:version",
9271
- "promote:hardis:package:version",
9272
- "promote:package:hardis:version",
9273
- "promote:package:version:hardis",
9274
- "hardis:promote:version:package",
9275
- "promote:hardis:version:package",
9276
- "promote:version:hardis:package",
9277
- "promote:version:package:hardis"
9134
+ "hardis",
9135
+ "package",
9136
+ "version",
9137
+ "list.js"
9138
+ ],
9139
+ "aliasPermutations": [],
9140
+ "permutations": [
9141
+ "hardis:package:version:list",
9142
+ "package:hardis:version:list",
9143
+ "package:version:hardis:list",
9144
+ "package:version:list:hardis",
9145
+ "hardis:version:package:list",
9146
+ "version:hardis:package:list",
9147
+ "version:package:hardis:list",
9148
+ "version:package:list:hardis",
9149
+ "hardis:version:list:package",
9150
+ "version:hardis:list:package",
9151
+ "version:list:hardis:package",
9152
+ "version:list:package:hardis",
9153
+ "hardis:package:list:version",
9154
+ "package:hardis:list:version",
9155
+ "package:list:hardis:version",
9156
+ "package:list:version:hardis",
9157
+ "hardis:list:package:version",
9158
+ "list:hardis:package:version",
9159
+ "list:package:hardis:version",
9160
+ "list:package:version:hardis",
9161
+ "hardis:list:version:package",
9162
+ "list:hardis:version:package",
9163
+ "list:version:hardis:package",
9164
+ "list:version:package:hardis"
9278
9165
  ]
9279
9166
  },
9280
- "hardis:project:configure:auth": {
9167
+ "hardis:package:version:promote": {
9281
9168
  "aliases": [],
9282
9169
  "args": {},
9283
- "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",
9170
+ "description": "\n## Command Behavior\n\n**Promotes a Salesforce package version from beta to released status in your Dev Hub.**\n\nThis command is a critical step in the package development lifecycle, marking a package version as stable and ready for production use. Once promoted, a package version can be installed in production organizations.\n\nKey functionalities:\n\n- **Package Version Selection:** Allows you to select a specific package version to promote. If the `--auto` flag is used, it automatically identifies package versions that are not yet released and promotes them.\n- **Automated Promotion:** When `--auto` is enabled, it queries for all unreleased package versions and promotes them without further user interaction.\n- **Dev Hub Integration:** Interacts with your connected Dev Hub to change the status of the package version.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Package Alias Retrieval:** It retrieves package aliases from your `sfdx-project.json` to identify available packages.\n- **Automated Promotion Logic:** If `--auto` is used, it executes `sf package version list --released` to get a list of already released packages and then filters the available package aliases to find those that are not yet released.\n- **Interactive Prompts:** If not in auto mode, it uses the `prompts` library to allow the user to select a package version to promote.\n- **Salesforce CLI Integration:** It constructs and executes the `sf package version promote` command, passing the package version ID.\n- **`execSfdxJson`:** This utility is used to execute the Salesforce CLI command and capture its JSON output.\n- **Error Handling:** It handles cases where a package version might already be promoted or if other errors occur during the promotion process.\n</details>\n",
9284
9171
  "examples": [
9285
- "$ sf hardis:project:configure:auth"
9172
+ "$ sf hardis:package:version:promote",
9173
+ "$ sf hardis:package:version:promote --auto"
9286
9174
  ],
9287
9175
  "flags": {
9288
9176
  "json": {
@@ -9300,10 +9188,10 @@
9300
9188
  "multiple": false,
9301
9189
  "type": "option"
9302
9190
  },
9303
- "devhub": {
9304
- "char": "b",
9305
- "description": "Configure project DevHub",
9306
- "name": "devhub",
9191
+ "auto": {
9192
+ "char": "f",
9193
+ "description": "Auto-detect which versions of which packages need to be promoted",
9194
+ "name": "auto",
9307
9195
  "allowNo": false,
9308
9196
  "type": "boolean"
9309
9197
  },
@@ -9327,20 +9215,6 @@
9327
9215
  "allowNo": false,
9328
9216
  "type": "boolean"
9329
9217
  },
9330
- "target-org": {
9331
- "aliases": [
9332
- "targetusername",
9333
- "u"
9334
- ],
9335
- "char": "o",
9336
- "deprecateAliases": true,
9337
- "name": "target-org",
9338
- "noCacheDefault": true,
9339
- "summary": "Username or alias of the target org.",
9340
- "hasDynamicHelp": true,
9341
- "multiple": false,
9342
- "type": "option"
9343
- },
9344
9218
  "target-dev-hub": {
9345
9219
  "aliases": [
9346
9220
  "targetdevhubusername"
@@ -9349,8 +9223,8 @@
9349
9223
  "deprecateAliases": true,
9350
9224
  "name": "target-dev-hub",
9351
9225
  "noCacheDefault": true,
9352
- "required": false,
9353
- "summary": "Username or alias of the Dev Hub org.",
9226
+ "required": true,
9227
+ "summary": "Username or alias of the Dev Hub org. Not required if the `target-dev-hub` configuration variable is already set.",
9354
9228
  "hasDynamicHelp": true,
9355
9229
  "multiple": false,
9356
9230
  "type": "option"
@@ -9358,52 +9232,49 @@
9358
9232
  },
9359
9233
  "hasDynamicHelp": true,
9360
9234
  "hiddenAliases": [],
9361
- "id": "hardis:project:configure:auth",
9235
+ "id": "hardis:package:version:promote",
9362
9236
  "pluginAlias": "sfdx-hardis",
9363
9237
  "pluginName": "sfdx-hardis",
9364
9238
  "pluginType": "core",
9365
9239
  "strict": true,
9366
9240
  "enableJsonFlag": true,
9367
- "title": "Configure authentication",
9368
- "requiresProject": false,
9369
- "requiresDependencies": [
9370
- "openssl"
9371
- ],
9241
+ "title": "Promote new versions of package(s)",
9242
+ "requiresProject": true,
9372
9243
  "isESM": true,
9373
9244
  "relativePath": [
9374
9245
  "lib",
9375
9246
  "commands",
9376
9247
  "hardis",
9377
- "project",
9378
- "configure",
9379
- "auth.js"
9248
+ "package",
9249
+ "version",
9250
+ "promote.js"
9380
9251
  ],
9381
9252
  "aliasPermutations": [],
9382
9253
  "permutations": [
9383
- "hardis:project:configure:auth",
9384
- "project:hardis:configure:auth",
9385
- "project:configure:hardis:auth",
9386
- "project:configure:auth:hardis",
9387
- "hardis:configure:project:auth",
9388
- "configure:hardis:project:auth",
9389
- "configure:project:hardis:auth",
9390
- "configure:project:auth:hardis",
9391
- "hardis:configure:auth:project",
9392
- "configure:hardis:auth:project",
9393
- "configure:auth:hardis:project",
9394
- "configure:auth:project:hardis",
9395
- "hardis:project:auth:configure",
9396
- "project:hardis:auth:configure",
9397
- "project:auth:hardis:configure",
9398
- "project:auth:configure:hardis",
9399
- "hardis:auth:project:configure",
9400
- "auth:hardis:project:configure",
9401
- "auth:project:hardis:configure",
9402
- "auth:project:configure:hardis",
9403
- "hardis:auth:configure:project",
9404
- "auth:hardis:configure:project",
9405
- "auth:configure:hardis:project",
9406
- "auth:configure:project:hardis"
9254
+ "hardis:package:version:promote",
9255
+ "package:hardis:version:promote",
9256
+ "package:version:hardis:promote",
9257
+ "package:version:promote:hardis",
9258
+ "hardis:version:package:promote",
9259
+ "version:hardis:package:promote",
9260
+ "version:package:hardis:promote",
9261
+ "version:package:promote:hardis",
9262
+ "hardis:version:promote:package",
9263
+ "version:hardis:promote:package",
9264
+ "version:promote:hardis:package",
9265
+ "version:promote:package:hardis",
9266
+ "hardis:package:promote:version",
9267
+ "package:hardis:promote:version",
9268
+ "package:promote:hardis:version",
9269
+ "package:promote:version:hardis",
9270
+ "hardis:promote:package:version",
9271
+ "promote:hardis:package:version",
9272
+ "promote:package:hardis:version",
9273
+ "promote:package:version:hardis",
9274
+ "hardis:promote:version:package",
9275
+ "promote:hardis:version:package",
9276
+ "promote:version:hardis:package",
9277
+ "promote:version:package:hardis"
9407
9278
  ]
9408
9279
  },
9409
9280
  "hardis:project:audit:apiversion": {
@@ -9819,6 +9690,135 @@
9819
9690
  "remotesites:audit:project:hardis"
9820
9691
  ]
9821
9692
  },
9693
+ "hardis:project:configure:auth": {
9694
+ "aliases": [],
9695
+ "args": {},
9696
+ "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",
9697
+ "examples": [
9698
+ "$ sf hardis:project:configure:auth"
9699
+ ],
9700
+ "flags": {
9701
+ "json": {
9702
+ "description": "Format output as json.",
9703
+ "helpGroup": "GLOBAL",
9704
+ "name": "json",
9705
+ "allowNo": false,
9706
+ "type": "boolean"
9707
+ },
9708
+ "flags-dir": {
9709
+ "helpGroup": "GLOBAL",
9710
+ "name": "flags-dir",
9711
+ "summary": "Import flag values from a directory.",
9712
+ "hasDynamicHelp": false,
9713
+ "multiple": false,
9714
+ "type": "option"
9715
+ },
9716
+ "devhub": {
9717
+ "char": "b",
9718
+ "description": "Configure project DevHub",
9719
+ "name": "devhub",
9720
+ "allowNo": false,
9721
+ "type": "boolean"
9722
+ },
9723
+ "debug": {
9724
+ "char": "d",
9725
+ "description": "Activate debug mode (more logs)",
9726
+ "name": "debug",
9727
+ "allowNo": false,
9728
+ "type": "boolean"
9729
+ },
9730
+ "websocket": {
9731
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9732
+ "name": "websocket",
9733
+ "hasDynamicHelp": false,
9734
+ "multiple": false,
9735
+ "type": "option"
9736
+ },
9737
+ "skipauth": {
9738
+ "description": "Skip authentication check when a default username is required",
9739
+ "name": "skipauth",
9740
+ "allowNo": false,
9741
+ "type": "boolean"
9742
+ },
9743
+ "target-org": {
9744
+ "aliases": [
9745
+ "targetusername",
9746
+ "u"
9747
+ ],
9748
+ "char": "o",
9749
+ "deprecateAliases": true,
9750
+ "name": "target-org",
9751
+ "noCacheDefault": true,
9752
+ "summary": "Username or alias of the target org.",
9753
+ "hasDynamicHelp": true,
9754
+ "multiple": false,
9755
+ "type": "option"
9756
+ },
9757
+ "target-dev-hub": {
9758
+ "aliases": [
9759
+ "targetdevhubusername"
9760
+ ],
9761
+ "char": "v",
9762
+ "deprecateAliases": true,
9763
+ "name": "target-dev-hub",
9764
+ "noCacheDefault": true,
9765
+ "required": false,
9766
+ "summary": "Username or alias of the Dev Hub org.",
9767
+ "hasDynamicHelp": true,
9768
+ "multiple": false,
9769
+ "type": "option"
9770
+ }
9771
+ },
9772
+ "hasDynamicHelp": true,
9773
+ "hiddenAliases": [],
9774
+ "id": "hardis:project:configure:auth",
9775
+ "pluginAlias": "sfdx-hardis",
9776
+ "pluginName": "sfdx-hardis",
9777
+ "pluginType": "core",
9778
+ "strict": true,
9779
+ "enableJsonFlag": true,
9780
+ "title": "Configure authentication",
9781
+ "requiresProject": false,
9782
+ "requiresDependencies": [
9783
+ "openssl"
9784
+ ],
9785
+ "isESM": true,
9786
+ "relativePath": [
9787
+ "lib",
9788
+ "commands",
9789
+ "hardis",
9790
+ "project",
9791
+ "configure",
9792
+ "auth.js"
9793
+ ],
9794
+ "aliasPermutations": [],
9795
+ "permutations": [
9796
+ "hardis:project:configure:auth",
9797
+ "project:hardis:configure:auth",
9798
+ "project:configure:hardis:auth",
9799
+ "project:configure:auth:hardis",
9800
+ "hardis:configure:project:auth",
9801
+ "configure:hardis:project:auth",
9802
+ "configure:project:hardis:auth",
9803
+ "configure:project:auth:hardis",
9804
+ "hardis:configure:auth:project",
9805
+ "configure:hardis:auth:project",
9806
+ "configure:auth:hardis:project",
9807
+ "configure:auth:project:hardis",
9808
+ "hardis:project:auth:configure",
9809
+ "project:hardis:auth:configure",
9810
+ "project:auth:hardis:configure",
9811
+ "project:auth:configure:hardis",
9812
+ "hardis:auth:project:configure",
9813
+ "auth:hardis:project:configure",
9814
+ "auth:project:hardis:configure",
9815
+ "auth:project:configure:hardis",
9816
+ "hardis:auth:configure:project",
9817
+ "auth:hardis:configure:project",
9818
+ "auth:configure:hardis:project",
9819
+ "auth:configure:project:hardis"
9820
+ ]
9821
+ },
9822
9822
  "hardis:project:convert:profilestopermsets": {
9823
9823
  "aliases": [],
9824
9824
  "args": {},
@@ -15370,5 +15370,5 @@
15370
15370
  ]
15371
15371
  }
15372
15372
  },
15373
- "version": "6.9.1-alpha202510262008.0"
15373
+ "version": "6.9.1-alpha202510262129.0"
15374
15374
  }