sfdx-hardis 6.9.1-alpha202510262255.0 → 6.9.1-alpha202510270024.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.
@@ -6045,13 +6045,12 @@
6045
6045
  "packagexmlfull:generate:org:hardis"
6046
6046
  ]
6047
6047
  },
6048
- "hardis:org:purge:apexlog": {
6048
+ "hardis:org:monitor:all": {
6049
6049
  "aliases": [],
6050
6050
  "args": {},
6051
- "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",
6051
+ "description": "Monitor org, generate reports and sends notifications\n\nYou can disable some commands defining either a **monitoringDisable** property in `.sfdx-hardis.yml`, or a comma separated list in env variable **MONITORING_DISABLE**\n\nExample in .sfdx-hardis.yml:\n \n```yaml\nmonitoringDisable:\n - METADATA_STATUS\n - MISSING_ATTRIBUTES\n - UNUSED_METADATAS\n```\n \nExample in env var:\n\n```sh\nMONITORING_DISABLE=METADATA_STATUS,MISSING_ATTRIBUTES,UNUSED_METADATAS\n```\n\nA [default list of monitoring commands](https://sfdx-hardis.cloudity.com/salesforce-monitoring-home/#monitoring-commands) is used, if you want to override it you can define property **monitoringCommands** in your .sfdx-hardis.yml file\n\nExample:\n\n```yaml\nmonitoringCommands:\n - title: My Custom command\n command: sf my:custom:command\n - title: My Custom command 2\n command: sf my:other:custom:command\n```\n\nYou can force the daily run of all commands by defining env var `MONITORING_IGNORE_FREQUENCY=true`\n\nThe default list of commands is the following:\n\n| Key | Description | Command | Frequency |\n| :---: | :---- | :---- | :-----: |\n| [AUDIT_TRAIL](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | Detect suspect setup actions in major org | [sf hardis:org:diagnose:audittrail](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | daily |\n| [LEGACY_API](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | Detect calls to deprecated API versions | [sf hardis:org:diagnose:legacyapi](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | daily |\n| [ORG_LIMITS](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | Detect if org limits are close to be reached | [sf hardis:org:monitor:limits](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | daily |\n| [UNSECURED_CONNECTED_APPS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unsecure-connected-apps) | Detect unsecured Connected Apps in an org | [sf hardis:org:diagnose:unsecure-connected-apps](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unsecure-connected-apps) | daily |\n| [LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | Extract licenses information | [sf hardis:org:diagnose:licenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | weekly |\n| [LINT_ACCESS](https://sfdx-hardis.cloudity.com/hardis/lint/access) | Detect custom elements with no access rights defined in permission sets | [sf hardis:lint:access](https://sfdx-hardis.cloudity.com/hardis/lint/access) | weekly |\n| [UNUSED_LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | Detect permission set licenses that are assigned to users that do not need them | [sf hardis:org:diagnose:unusedlicenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | weekly |\n| [UNUSED_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users without recent logins | [sf hardis:org:diagnose:unusedusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ACTIVE_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users with recent logins | [sf hardis:org:diagnose:unusedusers --returnactiveusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ORG_INFO](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | Get org info + SF instance info + next major upgrade date | [sf hardis:org:diagnose:instanceupgrade](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | weekly |\n| [RELEASE_UPDATES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | Gather warnings about incoming and overdue Release Updates | [sf hardis:org:diagnose:releaseupdates](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | weekly |\n| [UNUSED_METADATAS](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | Detect custom labels and custom permissions that are not in use | [sf hardis:lint:unusedmetadatas](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | weekly |\n| [UNUSED_APEX_CLASSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | Detect unused Apex classes in an org | [sf hardis:org:diagnose:unused-apex-classes](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | weekly |\n| [CONNECTED_APPS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | Detect unused Connected Apps in an org | [sf hardis:org:diagnose:unused-connected-apps](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | weekly |\n| [METADATA_STATUS](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | Detect inactive metadata | [sf hardis:lint:metadatastatus](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | weekly |\n| [MISSING_ATTRIBUTES](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | Detect missing description on custom field | [sf hardis:lint:missingattributes](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | weekly |\n\n",
6052
6052
  "examples": [
6053
- "$ sf hardis:org:purge:apexlog",
6054
- "$ sf hardis:org:purge:apexlog --target-org nicolas.vuillamy@gmail.com"
6053
+ "$ sf hardis:org:monitor:all"
6055
6054
  ],
6056
6055
  "flags": {
6057
6056
  "json": {
@@ -6069,13 +6068,6 @@
6069
6068
  "multiple": false,
6070
6069
  "type": "option"
6071
6070
  },
6072
- "prompt": {
6073
- "char": "z",
6074
- "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
6075
- "name": "prompt",
6076
- "allowNo": true,
6077
- "type": "boolean"
6078
- },
6079
6071
  "debug": {
6080
6072
  "char": "d",
6081
6073
  "description": "Activate debug mode (more logs)",
@@ -6114,59 +6106,159 @@
6114
6106
  },
6115
6107
  "hasDynamicHelp": true,
6116
6108
  "hiddenAliases": [],
6117
- "id": "hardis:org:purge:apexlog",
6109
+ "id": "hardis:org:monitor:all",
6118
6110
  "pluginAlias": "sfdx-hardis",
6119
6111
  "pluginName": "sfdx-hardis",
6120
6112
  "pluginType": "core",
6121
6113
  "strict": true,
6122
6114
  "enableJsonFlag": true,
6123
- "title": "Purge Apex Logs",
6124
- "requiresProject": false,
6115
+ "title": "Monitor org",
6116
+ "monitoringCommandsDefault": [
6117
+ {
6118
+ "key": "AUDIT_TRAIL",
6119
+ "title": "Detect suspect setup actions in major org",
6120
+ "command": "sf hardis:org:diagnose:audittrail",
6121
+ "frequency": "daily"
6122
+ },
6123
+ {
6124
+ "key": "LEGACY_API",
6125
+ "title": "Detect calls to deprecated API versions",
6126
+ "command": "sf hardis:org:diagnose:legacyapi",
6127
+ "frequency": "daily"
6128
+ },
6129
+ {
6130
+ "key": "ORG_LIMITS",
6131
+ "title": "Detect if org limits are close to be reached",
6132
+ "command": "sf hardis:org:monitor:limits",
6133
+ "frequency": "daily"
6134
+ },
6135
+ {
6136
+ "key": "UNSECURED_CONNECTED_APPS",
6137
+ "title": "Detect unsecured Connected Apps in an org",
6138
+ "command": "sf hardis:org:diagnose:unsecure-connected-apps",
6139
+ "frequency": "daily"
6140
+ },
6141
+ {
6142
+ "key": "LICENSES",
6143
+ "title": "Extract licenses information",
6144
+ "command": "sf hardis:org:diagnose:licenses",
6145
+ "frequency": "weekly"
6146
+ },
6147
+ {
6148
+ "key": "LINT_ACCESS",
6149
+ "title": "Detect custom elements with no access rights defined in permission sets",
6150
+ "command": "sf hardis:lint:access",
6151
+ "frequency": "weekly"
6152
+ },
6153
+ {
6154
+ "key": "UNUSED_LICENSES",
6155
+ "title": "Detect permission set licenses that are assigned to users that do not need them",
6156
+ "command": "sf hardis:org:diagnose:unusedlicenses",
6157
+ "frequency": "weekly"
6158
+ },
6159
+ {
6160
+ "key": "UNUSED_USERS",
6161
+ "title": "Detect active users without recent logins",
6162
+ "command": "sf hardis:org:diagnose:unusedusers",
6163
+ "frequency": "weekly"
6164
+ },
6165
+ {
6166
+ "key": "ACTIVE_USERS",
6167
+ "title": "Detect active users with recent logins",
6168
+ "command": "sf hardis:org:diagnose:unusedusers --returnactiveusers",
6169
+ "frequency": "weekly"
6170
+ },
6171
+ {
6172
+ "key": "ORG_INFO",
6173
+ "title": "Get org info + SF instance info + next major upgrade date",
6174
+ "command": "sf hardis:org:diagnose:instanceupgrade",
6175
+ "frequency": "weekly"
6176
+ },
6177
+ {
6178
+ "key": "RELEASE_UPDATES",
6179
+ "title": "Gather warnings about incoming and overdue Release Updates",
6180
+ "command": "sf hardis:org:diagnose:releaseupdates",
6181
+ "frequency": "weekly"
6182
+ },
6183
+ {
6184
+ "key": "UNUSED_METADATAS",
6185
+ "title": "Detect custom labels and custom permissions that are not in use",
6186
+ "command": "sf hardis:lint:unusedmetadatas",
6187
+ "frequency": "weekly"
6188
+ },
6189
+ {
6190
+ "key": "UNUSED_APEX_CLASSES",
6191
+ "title": "Detect unused Apex classes in an org",
6192
+ "command": "sf hardis:org:diagnose:unused-apex-classes",
6193
+ "frequency": "weekly"
6194
+ },
6195
+ {
6196
+ "key": "CONNECTED_APPS",
6197
+ "title": "Detect unused Connected Apps in an org",
6198
+ "command": "sf hardis:org:diagnose:unused-connected-apps",
6199
+ "frequency": "weekly"
6200
+ },
6201
+ {
6202
+ "key": "METADATA_STATUS",
6203
+ "title": "Detect inactive metadata",
6204
+ "command": "sf hardis:lint:metadatastatus",
6205
+ "frequency": "weekly"
6206
+ },
6207
+ {
6208
+ "key": "MISSING_ATTRIBUTES",
6209
+ "title": "Detect missing description on custom field",
6210
+ "command": "sf hardis:lint:missingattributes",
6211
+ "frequency": "weekly"
6212
+ }
6213
+ ],
6214
+ "requiresProject": true,
6215
+ "triggerNotification": true,
6125
6216
  "isESM": true,
6126
6217
  "relativePath": [
6127
6218
  "lib",
6128
6219
  "commands",
6129
6220
  "hardis",
6130
6221
  "org",
6131
- "purge",
6132
- "apexlog.js"
6222
+ "monitor",
6223
+ "all.js"
6133
6224
  ],
6134
6225
  "aliasPermutations": [],
6135
6226
  "permutations": [
6136
- "hardis:org:purge:apexlog",
6137
- "org:hardis:purge:apexlog",
6138
- "org:purge:hardis:apexlog",
6139
- "org:purge:apexlog:hardis",
6140
- "hardis:purge:org:apexlog",
6141
- "purge:hardis:org:apexlog",
6142
- "purge:org:hardis:apexlog",
6143
- "purge:org:apexlog:hardis",
6144
- "hardis:purge:apexlog:org",
6145
- "purge:hardis:apexlog:org",
6146
- "purge:apexlog:hardis:org",
6147
- "purge:apexlog:org:hardis",
6148
- "hardis:org:apexlog:purge",
6149
- "org:hardis:apexlog:purge",
6150
- "org:apexlog:hardis:purge",
6151
- "org:apexlog:purge:hardis",
6152
- "hardis:apexlog:org:purge",
6153
- "apexlog:hardis:org:purge",
6154
- "apexlog:org:hardis:purge",
6155
- "apexlog:org:purge:hardis",
6156
- "hardis:apexlog:purge:org",
6157
- "apexlog:hardis:purge:org",
6158
- "apexlog:purge:hardis:org",
6159
- "apexlog:purge:org:hardis"
6227
+ "hardis:org:monitor:all",
6228
+ "org:hardis:monitor:all",
6229
+ "org:monitor:hardis:all",
6230
+ "org:monitor:all:hardis",
6231
+ "hardis:monitor:org:all",
6232
+ "monitor:hardis:org:all",
6233
+ "monitor:org:hardis:all",
6234
+ "monitor:org:all:hardis",
6235
+ "hardis:monitor:all:org",
6236
+ "monitor:hardis:all:org",
6237
+ "monitor:all:hardis:org",
6238
+ "monitor:all:org:hardis",
6239
+ "hardis:org:all:monitor",
6240
+ "org:hardis:all:monitor",
6241
+ "org:all:hardis:monitor",
6242
+ "org:all:monitor:hardis",
6243
+ "hardis:all:org:monitor",
6244
+ "all:hardis:org:monitor",
6245
+ "all:org:hardis:monitor",
6246
+ "all:org:monitor:hardis",
6247
+ "hardis:all:monitor:org",
6248
+ "all:hardis:monitor:org",
6249
+ "all:monitor:hardis:org",
6250
+ "all:monitor:org:hardis"
6160
6251
  ]
6161
6252
  },
6162
- "hardis:org:purge:flow": {
6253
+ "hardis:org:monitor:backup": {
6163
6254
  "aliases": [],
6164
6255
  "args": {},
6165
- "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",
6256
+ "description": "Retrieve sfdx sources in the context of a monitoring backup\n\nThe command exists in 2 modes: filtered(default & recommended) and full.\n\n## Filtered mode (default, better performances)\n\nAutomatically skips metadatas from installed packages with namespace. \n\nYou can remove more metadata types from backup, especially in case you have too many metadatas and that provokes a crash, using:\n\n- Manual update of `manifest/package-skip-items.xml` config file (then commit & push in the same branch)\n\n - Works with full wildcard (`<members>*</members>`) , named metadata (`<members>Account.Name</members>`) or partial wildcards names (`<members>pi__*</members>` , `<members>*__dlm</members>` , or `<members>prefix*suffix</members>`)\n\n- Environment variable MONITORING_BACKUP_SKIP_METADATA_TYPES (example: `MONITORING_BACKUP_SKIP_METADATA_TYPES=CustomLabel,StaticResource,Translation`): that will be applied to all monitoring branches.\n\n## Full mode\n\nActivate it with **--full** parameter, or variable MONITORING_BACKUP_MODE_FULL=true\n\nIgnores filters (namespaces items & manifest/package-skip-items.xml) to retrieve ALL metadatas, including those you might not care about (reports, translations...)\n\nAs we can retrieve only 10000 files by call, the list of all metadatas will be chunked to make multiple calls (and take more time than filtered mode)\n\n- if you use `--full-apply-filters` , manifest/package-skip-items.xml and MONITORING_BACKUP_SKIP_METADATA_TYPES filters will be applied anyway\n- if you use `--exclude-namespaces` , namespaced items will be ignored\n\n_With those both options, it's like if you are not using --full, but with chunked metadata download_\n\n## In CI/CD\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-metadata-backup/) and can output Grafana, Slack and MsTeams Notifications.\n\n## Troubleshooting\n\nIf you have unknown errors (it happens !), you can investigate using the full command with smaller chunks.\n\nExample: `sf hardis:org:monitor:backup --full --exclude-namespaces --full-apply-filters --max-by-chunk 500`\n\nIt will allow you the identify the responsible metadata and ignore it using package-skip-items.xml or MONITORING_BACKUP_SKIP_METADATA_TYPES env variable.\n\n## Documentation\n\n[Doc generation (including visual flows)](https://sfdx-hardis.cloudity.com/hardis/doc/project2markdown/) is triggered at the end of the command.\n\nIf you want to also upload HTML Documentation on your Salesforce Org as static resource, use variable **SFDX_HARDIS_DOC_DEPLOY_TO_ORG=\"true\"**\n\nIf you want to also upload HTML Documentation on Cloudflare, use variable **SFDX_HARDIS_DOC_DEPLOY_TO_CLOUDFLARE=\"true\"**\n\n- If you want to generate the documentation in multiple languages, define variable SFDX_DOC_LANGUAGES (ex: SFDX_DOC_LANGUAGES=en,fr,de)\n- You can define one Cloudflare site by language, for example with the following variables:\n - CLOUDFLARE_PROJECT_NAME_EN=cloudity-demo-english\n - CLOUDFLARE_PROJECT_NAME_FR=cloudity-demo-french\n - CLOUDFLARE_PROJECT_NAME_DE=cloudity-demo-german\n\nIf Flow history doc always display a single state, you probably need to update your workflow configuration:\n\n- on Gitlab: Env variable [`GIT_FETCH_EXTRA_FLAGS: --depth 10000`](https://github.com/hardisgroupcom/sfdx-hardis/blob/main/defaults/monitoring/.gitlab-ci.yml#L11)\n- on GitHub: [`fetch-depth: 0`](https://github.com/hardisgroupcom/sfdx-hardis/blob/main/defaults/monitoring/.github/workflows/org-monitoring.yml#L58)\n- on Azure: [`fetchDepth: \"0\"`](https://github.com/hardisgroupcom/sfdx-hardis/blob/main/defaults/monitoring/azure-pipelines.yml#L39)\n- on Bitbucket: [`step: clone: depth: full`](https://github.com/hardisgroupcom/sfdx-hardis/blob/main/defaults/monitoring/bitbucket-pipelines.yml#L18)\n",
6166
6257
  "examples": [
6167
- "$ sf hardis:org:purge:flow",
6168
- "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --no-prompt --delete-flow-interviews",
6169
- "$ sf hardis:org:purge:flow --target-org nicolas.vuillamy@gmail.com --status \"Obsolete,Draft,InvalidDraft\" --name TestFlow"
6258
+ "$ sf hardis:org:monitor:backup",
6259
+ "$ sf hardis:org:monitor:backup --full",
6260
+ "$ sf hardis:org:monitor:backup --full --exclude-namespaces",
6261
+ "$ sf hardis:org:monitor:backup --full --exclude-namespaces --full-apply-filters"
6170
6262
  ],
6171
6263
  "flags": {
6172
6264
  "json": {
@@ -6184,48 +6276,53 @@
6184
6276
  "multiple": false,
6185
6277
  "type": "option"
6186
6278
  },
6187
- "prompt": {
6188
- "char": "z",
6189
- "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
6190
- "name": "prompt",
6191
- "allowNo": true,
6279
+ "full": {
6280
+ "description": "Dot not take in account filtering using package-skip-items.xml and MONITORING_BACKUP_SKIP_METADATA_TYPES. Efficient but much much slower !",
6281
+ "name": "full",
6282
+ "allowNo": false,
6192
6283
  "type": "boolean"
6193
6284
  },
6194
- "name": {
6195
- "char": "n",
6196
- "description": "Filter according to Name criteria",
6197
- "name": "name",
6285
+ "max-by-chunk": {
6286
+ "char": "m",
6287
+ "description": "If mode --full is activated, maximum number of metadatas in a package.xml chunk",
6288
+ "name": "max-by-chunk",
6289
+ "default": 3000,
6198
6290
  "hasDynamicHelp": false,
6199
6291
  "multiple": false,
6200
6292
  "type": "option"
6201
6293
  },
6202
- "status": {
6203
- "char": "s",
6204
- "description": "Filter according to Status criteria",
6205
- "name": "status",
6294
+ "exclude-namespaces": {
6295
+ "char": "e",
6296
+ "description": "If mode --full is activated, exclude namespaced metadatas",
6297
+ "name": "exclude-namespaces",
6298
+ "allowNo": false,
6299
+ "type": "boolean"
6300
+ },
6301
+ "full-apply-filters": {
6302
+ "char": "z",
6303
+ "description": "If mode --full is activated, apply filters of manifest/package-skip-items.xml and MONITORING_BACKUP_SKIP_METADATA_TYPES anyway",
6304
+ "name": "full-apply-filters",
6305
+ "allowNo": false,
6306
+ "type": "boolean"
6307
+ },
6308
+ "start-chunk": {
6309
+ "description": "Use this parameter to troubleshoot a specific chunk. It will be used as the first chunk to retrieve",
6310
+ "name": "start-chunk",
6311
+ "default": 1,
6206
6312
  "hasDynamicHelp": false,
6207
6313
  "multiple": false,
6208
6314
  "type": "option"
6209
6315
  },
6210
- "delete-flow-interviews": {
6211
- "char": "w",
6212
- "description": "If the presence of Flow interviews prevent to delete flows versions, delete them before retrying to delete flow versions",
6213
- "name": "delete-flow-interviews",
6316
+ "skip-doc": {
6317
+ "description": "Skip the generation of project documentation at the end of the command",
6318
+ "name": "skip-doc",
6214
6319
  "allowNo": false,
6215
6320
  "type": "boolean"
6216
6321
  },
6217
- "allowpurgefailure": {
6322
+ "outputfile": {
6218
6323
  "char": "f",
6219
- "description": "Allows purges to fail without exiting with 1. Use --no-allowpurgefailure to disable",
6220
- "name": "allowpurgefailure",
6221
- "allowNo": true,
6222
- "type": "boolean"
6223
- },
6224
- "instanceurl": {
6225
- "char": "r",
6226
- "description": "URL of org instance",
6227
- "name": "instanceurl",
6228
- "default": "https://login.salesforce.com",
6324
+ "description": "Force the path and name of output report file. Must end with .csv",
6325
+ "name": "outputfile",
6229
6326
  "hasDynamicHelp": false,
6230
6327
  "multiple": false,
6231
6328
  "type": "option"
@@ -6268,49 +6365,165 @@
6268
6365
  },
6269
6366
  "hasDynamicHelp": true,
6270
6367
  "hiddenAliases": [],
6271
- "id": "hardis:org:purge:flow",
6368
+ "id": "hardis:org:monitor:backup",
6272
6369
  "pluginAlias": "sfdx-hardis",
6273
6370
  "pluginName": "sfdx-hardis",
6274
6371
  "pluginType": "core",
6275
6372
  "strict": true,
6276
6373
  "enableJsonFlag": true,
6277
- "title": "Purge Flow versions",
6278
- "requiresProject": false,
6374
+ "title": "Backup DX sources",
6375
+ "requiresProject": true,
6376
+ "triggerNotification": true,
6279
6377
  "isESM": true,
6280
6378
  "relativePath": [
6281
6379
  "lib",
6282
6380
  "commands",
6283
6381
  "hardis",
6284
6382
  "org",
6285
- "purge",
6286
- "flow.js"
6383
+ "monitor",
6384
+ "backup.js"
6287
6385
  ],
6288
6386
  "aliasPermutations": [],
6289
6387
  "permutations": [
6290
- "hardis:org:purge:flow",
6291
- "org:hardis:purge:flow",
6292
- "org:purge:hardis:flow",
6293
- "org:purge:flow:hardis",
6294
- "hardis:purge:org:flow",
6295
- "purge:hardis:org:flow",
6296
- "purge:org:hardis:flow",
6297
- "purge:org:flow:hardis",
6298
- "hardis:purge:flow:org",
6299
- "purge:hardis:flow:org",
6300
- "purge:flow:hardis:org",
6301
- "purge:flow:org:hardis",
6302
- "hardis:org:flow:purge",
6303
- "org:hardis:flow:purge",
6304
- "org:flow:hardis:purge",
6305
- "org:flow:purge:hardis",
6306
- "hardis:flow:org:purge",
6307
- "flow:hardis:org:purge",
6308
- "flow:org:hardis:purge",
6309
- "flow:org:purge:hardis",
6310
- "hardis:flow:purge:org",
6311
- "flow:hardis:purge:org",
6312
- "flow:purge:hardis:org",
6313
- "flow:purge:org:hardis"
6388
+ "hardis:org:monitor:backup",
6389
+ "org:hardis:monitor:backup",
6390
+ "org:monitor:hardis:backup",
6391
+ "org:monitor:backup:hardis",
6392
+ "hardis:monitor:org:backup",
6393
+ "monitor:hardis:org:backup",
6394
+ "monitor:org:hardis:backup",
6395
+ "monitor:org:backup:hardis",
6396
+ "hardis:monitor:backup:org",
6397
+ "monitor:hardis:backup:org",
6398
+ "monitor:backup:hardis:org",
6399
+ "monitor:backup:org:hardis",
6400
+ "hardis:org:backup:monitor",
6401
+ "org:hardis:backup:monitor",
6402
+ "org:backup:hardis:monitor",
6403
+ "org:backup:monitor:hardis",
6404
+ "hardis:backup:org:monitor",
6405
+ "backup:hardis:org:monitor",
6406
+ "backup:org:hardis:monitor",
6407
+ "backup:org:monitor:hardis",
6408
+ "hardis:backup:monitor:org",
6409
+ "backup:hardis:monitor:org",
6410
+ "backup:monitor:hardis:org",
6411
+ "backup:monitor:org:hardis"
6412
+ ]
6413
+ },
6414
+ "hardis:org:monitor:limits": {
6415
+ "aliases": [],
6416
+ "args": {},
6417
+ "description": "\n## Command Behavior\n\n**Checks the current usage of various Salesforce org limits and sends notifications if thresholds are exceeded.**\n\nThis command is a critical component of proactive Salesforce org management, helping administrators and developers monitor resource consumption and prevent hitting critical limits that could impact performance or functionality. It provides early warnings when limits are approaching their capacity.\n\nKey functionalities:\n\n- **Limit Retrieval:** Fetches a comprehensive list of all Salesforce org limits using the Salesforce CLI.\n- **Usage Calculation:** Calculates the percentage of each limit that is currently being used.\n- **Threshold-Based Alerting:** Assigns a severity (success, warning, or error) to each limit based on configurable thresholds:\n - **Warning:** If usage exceeds 50% (configurable via `LIMIT_THRESHOLD_WARNING` environment variable).\n - **Error:** If usage exceeds 75% (configurable via `LIMIT_THRESHOLD_ERROR` environment variable).\n- **CSV Report Generation:** Generates a CSV file containing all org limits, their current usage, maximum allowed, and calculated percentage used, along with the assigned severity.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of limits that have exceeded the warning or error thresholds.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-org-limits/) and can output Grafana, Slack and MsTeams Notifications.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce CLI Integration:** It executes the `sf org limits list` command to retrieve the current org limits. It parses the JSON output of this command.\n- **Data Processing:** It iterates through the retrieved limits, calculates the `used` and `percentUsed` values, and assigns a `severity` (success, warning, error) based on the configured thresholds.\n- **Environment Variable Configuration:** Reads `LIMIT_THRESHOLD_WARNING` and `LIMIT_THRESHOLD_ERROR` environment variables to set the warning and error thresholds for limit usage.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of org limits.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and detailed metrics for each limit, which can be consumed by monitoring dashboards like Grafana.\n- **Exit Code Management:** Sets the process exit code to 1 if any limit is in an 'error' state, indicating a critical issue.\n</details>\n",
6418
+ "examples": [
6419
+ "$ sf hardis:org:monitor:limits"
6420
+ ],
6421
+ "flags": {
6422
+ "json": {
6423
+ "description": "Format output as json.",
6424
+ "helpGroup": "GLOBAL",
6425
+ "name": "json",
6426
+ "allowNo": false,
6427
+ "type": "boolean"
6428
+ },
6429
+ "flags-dir": {
6430
+ "helpGroup": "GLOBAL",
6431
+ "name": "flags-dir",
6432
+ "summary": "Import flag values from a directory.",
6433
+ "hasDynamicHelp": false,
6434
+ "multiple": false,
6435
+ "type": "option"
6436
+ },
6437
+ "outputfile": {
6438
+ "char": "f",
6439
+ "description": "Force the path and name of output report file. Must end with .csv",
6440
+ "name": "outputfile",
6441
+ "hasDynamicHelp": false,
6442
+ "multiple": false,
6443
+ "type": "option"
6444
+ },
6445
+ "debug": {
6446
+ "char": "d",
6447
+ "description": "Activate debug mode (more logs)",
6448
+ "name": "debug",
6449
+ "allowNo": false,
6450
+ "type": "boolean"
6451
+ },
6452
+ "websocket": {
6453
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
6454
+ "name": "websocket",
6455
+ "hasDynamicHelp": false,
6456
+ "multiple": false,
6457
+ "type": "option"
6458
+ },
6459
+ "skipauth": {
6460
+ "description": "Skip authentication check when a default username is required",
6461
+ "name": "skipauth",
6462
+ "allowNo": false,
6463
+ "type": "boolean"
6464
+ },
6465
+ "target-org": {
6466
+ "aliases": [
6467
+ "targetusername",
6468
+ "u"
6469
+ ],
6470
+ "char": "o",
6471
+ "deprecateAliases": true,
6472
+ "name": "target-org",
6473
+ "noCacheDefault": true,
6474
+ "required": true,
6475
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
6476
+ "hasDynamicHelp": true,
6477
+ "multiple": false,
6478
+ "type": "option"
6479
+ }
6480
+ },
6481
+ "hasDynamicHelp": true,
6482
+ "hiddenAliases": [],
6483
+ "id": "hardis:org:monitor:limits",
6484
+ "pluginAlias": "sfdx-hardis",
6485
+ "pluginName": "sfdx-hardis",
6486
+ "pluginType": "core",
6487
+ "strict": true,
6488
+ "enableJsonFlag": true,
6489
+ "title": "Check org limits",
6490
+ "requiresProject": true,
6491
+ "triggerNotification": true,
6492
+ "isESM": true,
6493
+ "relativePath": [
6494
+ "lib",
6495
+ "commands",
6496
+ "hardis",
6497
+ "org",
6498
+ "monitor",
6499
+ "limits.js"
6500
+ ],
6501
+ "aliasPermutations": [],
6502
+ "permutations": [
6503
+ "hardis:org:monitor:limits",
6504
+ "org:hardis:monitor:limits",
6505
+ "org:monitor:hardis:limits",
6506
+ "org:monitor:limits:hardis",
6507
+ "hardis:monitor:org:limits",
6508
+ "monitor:hardis:org:limits",
6509
+ "monitor:org:hardis:limits",
6510
+ "monitor:org:limits:hardis",
6511
+ "hardis:monitor:limits:org",
6512
+ "monitor:hardis:limits:org",
6513
+ "monitor:limits:hardis:org",
6514
+ "monitor:limits:org:hardis",
6515
+ "hardis:org:limits:monitor",
6516
+ "org:hardis:limits:monitor",
6517
+ "org:limits:hardis:monitor",
6518
+ "org:limits:monitor:hardis",
6519
+ "hardis:limits:org:monitor",
6520
+ "limits:hardis:org:monitor",
6521
+ "limits:org:hardis:monitor",
6522
+ "limits:org:monitor:hardis",
6523
+ "hardis:limits:monitor:org",
6524
+ "limits:hardis:monitor:org",
6525
+ "limits:monitor:hardis:org",
6526
+ "limits:monitor:org:hardis"
6314
6527
  ]
6315
6528
  },
6316
6529
  "hardis:org:diagnose:audittrail": {
@@ -7576,12 +7789,13 @@
7576
7789
  "unusedusers:diagnose:org:hardis"
7577
7790
  ]
7578
7791
  },
7579
- "hardis:org:monitor:all": {
7792
+ "hardis:org:purge:apexlog": {
7580
7793
  "aliases": [],
7581
7794
  "args": {},
7582
- "description": "Monitor org, generate reports and sends notifications\n\nYou can disable some commands defining either a **monitoringDisable** property in `.sfdx-hardis.yml`, or a comma separated list in env variable **MONITORING_DISABLE**\n\nExample in .sfdx-hardis.yml:\n \n```yaml\nmonitoringDisable:\n - METADATA_STATUS\n - MISSING_ATTRIBUTES\n - UNUSED_METADATAS\n```\n \nExample in env var:\n\n```sh\nMONITORING_DISABLE=METADATA_STATUS,MISSING_ATTRIBUTES,UNUSED_METADATAS\n```\n\nA [default list of monitoring commands](https://sfdx-hardis.cloudity.com/salesforce-monitoring-home/#monitoring-commands) is used, if you want to override it you can define property **monitoringCommands** in your .sfdx-hardis.yml file\n\nExample:\n\n```yaml\nmonitoringCommands:\n - title: My Custom command\n command: sf my:custom:command\n - title: My Custom command 2\n command: sf my:other:custom:command\n```\n\nYou can force the daily run of all commands by defining env var `MONITORING_IGNORE_FREQUENCY=true`\n\nThe default list of commands is the following:\n\n| Key | Description | Command | Frequency |\n| :---: | :---- | :---- | :-----: |\n| [AUDIT_TRAIL](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | Detect suspect setup actions in major org | [sf hardis:org:diagnose:audittrail](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/audittrail) | daily |\n| [LEGACY_API](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | Detect calls to deprecated API versions | [sf hardis:org:diagnose:legacyapi](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/legacyapi) | daily |\n| [ORG_LIMITS](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | Detect if org limits are close to be reached | [sf hardis:org:monitor:limits](https://sfdx-hardis.cloudity.com/hardis/org/monitor/limits) | daily |\n| [UNSECURED_CONNECTED_APPS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unsecure-connected-apps) | Detect unsecured Connected Apps in an org | [sf hardis:org:diagnose:unsecure-connected-apps](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unsecure-connected-apps) | daily |\n| [LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | Extract licenses information | [sf hardis:org:diagnose:licenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/licenses) | weekly |\n| [LINT_ACCESS](https://sfdx-hardis.cloudity.com/hardis/lint/access) | Detect custom elements with no access rights defined in permission sets | [sf hardis:lint:access](https://sfdx-hardis.cloudity.com/hardis/lint/access) | weekly |\n| [UNUSED_LICENSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | Detect permission set licenses that are assigned to users that do not need them | [sf hardis:org:diagnose:unusedlicenses](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedlicenses) | weekly |\n| [UNUSED_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users without recent logins | [sf hardis:org:diagnose:unusedusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ACTIVE_USERS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | Detect active users with recent logins | [sf hardis:org:diagnose:unusedusers --returnactiveusers](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unusedusers) | weekly |\n| [ORG_INFO](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | Get org info + SF instance info + next major upgrade date | [sf hardis:org:diagnose:instanceupgrade](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/instanceupgrade) | weekly |\n| [RELEASE_UPDATES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | Gather warnings about incoming and overdue Release Updates | [sf hardis:org:diagnose:releaseupdates](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/releaseupdates) | weekly |\n| [UNUSED_METADATAS](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | Detect custom labels and custom permissions that are not in use | [sf hardis:lint:unusedmetadatas](https://sfdx-hardis.cloudity.com/hardis/lint/unusedmetadatas) | weekly |\n| [UNUSED_APEX_CLASSES](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | Detect unused Apex classes in an org | [sf hardis:org:diagnose:unused-apex-classes](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-apex-classes) | weekly |\n| [CONNECTED_APPS](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | Detect unused Connected Apps in an org | [sf hardis:org:diagnose:unused-connected-apps](https://sfdx-hardis.cloudity.com/hardis/org/diagnose/unused-connected-apps) | weekly |\n| [METADATA_STATUS](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | Detect inactive metadata | [sf hardis:lint:metadatastatus](https://sfdx-hardis.cloudity.com/hardis/lint/metadatastatus) | weekly |\n| [MISSING_ATTRIBUTES](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | Detect missing description on custom field | [sf hardis:lint:missingattributes](https://sfdx-hardis.cloudity.com/hardis/lint/missingattributes) | weekly |\n\n",
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",
7583
7796
  "examples": [
7584
- "$ sf hardis:org:monitor:all"
7797
+ "$ sf hardis:org:purge:apexlog",
7798
+ "$ sf hardis:org:purge:apexlog --target-org nicolas.vuillamy@gmail.com"
7585
7799
  ],
7586
7800
  "flags": {
7587
7801
  "json": {
@@ -7599,6 +7813,13 @@
7599
7813
  "multiple": false,
7600
7814
  "type": "option"
7601
7815
  },
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"
7822
+ },
7602
7823
  "debug": {
7603
7824
  "char": "d",
7604
7825
  "description": "Activate debug mode (more logs)",
@@ -7637,338 +7858,118 @@
7637
7858
  },
7638
7859
  "hasDynamicHelp": true,
7639
7860
  "hiddenAliases": [],
7640
- "id": "hardis:org:monitor:all",
7861
+ "id": "hardis:org:purge:apexlog",
7641
7862
  "pluginAlias": "sfdx-hardis",
7642
7863
  "pluginName": "sfdx-hardis",
7643
7864
  "pluginType": "core",
7644
7865
  "strict": true,
7645
7866
  "enableJsonFlag": true,
7646
- "title": "Monitor org",
7647
- "monitoringCommandsDefault": [
7648
- {
7649
- "key": "AUDIT_TRAIL",
7650
- "title": "Detect suspect setup actions in major org",
7651
- "command": "sf hardis:org:diagnose:audittrail",
7652
- "frequency": "daily"
7867
+ "title": "Purge Apex Logs",
7868
+ "requiresProject": false,
7869
+ "isESM": true,
7870
+ "relativePath": [
7871
+ "lib",
7872
+ "commands",
7873
+ "hardis",
7874
+ "org",
7875
+ "purge",
7876
+ "apexlog.js"
7877
+ ],
7878
+ "aliasPermutations": [],
7879
+ "permutations": [
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"
7904
+ ]
7905
+ },
7906
+ "hardis:org:purge:flow": {
7907
+ "aliases": [],
7908
+ "args": {},
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",
7910
+ "examples": [
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"
7914
+ ],
7915
+ "flags": {
7916
+ "json": {
7917
+ "description": "Format output as json.",
7918
+ "helpGroup": "GLOBAL",
7919
+ "name": "json",
7920
+ "allowNo": false,
7921
+ "type": "boolean"
7653
7922
  },
7654
- {
7655
- "key": "LEGACY_API",
7656
- "title": "Detect calls to deprecated API versions",
7657
- "command": "sf hardis:org:diagnose:legacyapi",
7658
- "frequency": "daily"
7923
+ "flags-dir": {
7924
+ "helpGroup": "GLOBAL",
7925
+ "name": "flags-dir",
7926
+ "summary": "Import flag values from a directory.",
7927
+ "hasDynamicHelp": false,
7928
+ "multiple": false,
7929
+ "type": "option"
7659
7930
  },
7660
- {
7661
- "key": "ORG_LIMITS",
7662
- "title": "Detect if org limits are close to be reached",
7663
- "command": "sf hardis:org:monitor:limits",
7664
- "frequency": "daily"
7665
- },
7666
- {
7667
- "key": "UNSECURED_CONNECTED_APPS",
7668
- "title": "Detect unsecured Connected Apps in an org",
7669
- "command": "sf hardis:org:diagnose:unsecure-connected-apps",
7670
- "frequency": "daily"
7671
- },
7672
- {
7673
- "key": "LICENSES",
7674
- "title": "Extract licenses information",
7675
- "command": "sf hardis:org:diagnose:licenses",
7676
- "frequency": "weekly"
7677
- },
7678
- {
7679
- "key": "LINT_ACCESS",
7680
- "title": "Detect custom elements with no access rights defined in permission sets",
7681
- "command": "sf hardis:lint:access",
7682
- "frequency": "weekly"
7683
- },
7684
- {
7685
- "key": "UNUSED_LICENSES",
7686
- "title": "Detect permission set licenses that are assigned to users that do not need them",
7687
- "command": "sf hardis:org:diagnose:unusedlicenses",
7688
- "frequency": "weekly"
7689
- },
7690
- {
7691
- "key": "UNUSED_USERS",
7692
- "title": "Detect active users without recent logins",
7693
- "command": "sf hardis:org:diagnose:unusedusers",
7694
- "frequency": "weekly"
7695
- },
7696
- {
7697
- "key": "ACTIVE_USERS",
7698
- "title": "Detect active users with recent logins",
7699
- "command": "sf hardis:org:diagnose:unusedusers --returnactiveusers",
7700
- "frequency": "weekly"
7701
- },
7702
- {
7703
- "key": "ORG_INFO",
7704
- "title": "Get org info + SF instance info + next major upgrade date",
7705
- "command": "sf hardis:org:diagnose:instanceupgrade",
7706
- "frequency": "weekly"
7707
- },
7708
- {
7709
- "key": "RELEASE_UPDATES",
7710
- "title": "Gather warnings about incoming and overdue Release Updates",
7711
- "command": "sf hardis:org:diagnose:releaseupdates",
7712
- "frequency": "weekly"
7713
- },
7714
- {
7715
- "key": "UNUSED_METADATAS",
7716
- "title": "Detect custom labels and custom permissions that are not in use",
7717
- "command": "sf hardis:lint:unusedmetadatas",
7718
- "frequency": "weekly"
7719
- },
7720
- {
7721
- "key": "UNUSED_APEX_CLASSES",
7722
- "title": "Detect unused Apex classes in an org",
7723
- "command": "sf hardis:org:diagnose:unused-apex-classes",
7724
- "frequency": "weekly"
7725
- },
7726
- {
7727
- "key": "CONNECTED_APPS",
7728
- "title": "Detect unused Connected Apps in an org",
7729
- "command": "sf hardis:org:diagnose:unused-connected-apps",
7730
- "frequency": "weekly"
7731
- },
7732
- {
7733
- "key": "METADATA_STATUS",
7734
- "title": "Detect inactive metadata",
7735
- "command": "sf hardis:lint:metadatastatus",
7736
- "frequency": "weekly"
7737
- },
7738
- {
7739
- "key": "MISSING_ATTRIBUTES",
7740
- "title": "Detect missing description on custom field",
7741
- "command": "sf hardis:lint:missingattributes",
7742
- "frequency": "weekly"
7743
- }
7744
- ],
7745
- "requiresProject": true,
7746
- "triggerNotification": true,
7747
- "isESM": true,
7748
- "relativePath": [
7749
- "lib",
7750
- "commands",
7751
- "hardis",
7752
- "org",
7753
- "monitor",
7754
- "all.js"
7755
- ],
7756
- "aliasPermutations": [],
7757
- "permutations": [
7758
- "hardis:org:monitor:all",
7759
- "org:hardis:monitor:all",
7760
- "org:monitor:hardis:all",
7761
- "org:monitor:all:hardis",
7762
- "hardis:monitor:org:all",
7763
- "monitor:hardis:org:all",
7764
- "monitor:org:hardis:all",
7765
- "monitor:org:all:hardis",
7766
- "hardis:monitor:all:org",
7767
- "monitor:hardis:all:org",
7768
- "monitor:all:hardis:org",
7769
- "monitor:all:org:hardis",
7770
- "hardis:org:all:monitor",
7771
- "org:hardis:all:monitor",
7772
- "org:all:hardis:monitor",
7773
- "org:all:monitor:hardis",
7774
- "hardis:all:org:monitor",
7775
- "all:hardis:org:monitor",
7776
- "all:org:hardis:monitor",
7777
- "all:org:monitor:hardis",
7778
- "hardis:all:monitor:org",
7779
- "all:hardis:monitor:org",
7780
- "all:monitor:hardis:org",
7781
- "all:monitor:org:hardis"
7782
- ]
7783
- },
7784
- "hardis:org:monitor:backup": {
7785
- "aliases": [],
7786
- "args": {},
7787
- "description": "Retrieve sfdx sources in the context of a monitoring backup\n\nThe command exists in 2 modes: filtered(default & recommended) and full.\n\n## Filtered mode (default, better performances)\n\nAutomatically skips metadatas from installed packages with namespace. \n\nYou can remove more metadata types from backup, especially in case you have too many metadatas and that provokes a crash, using:\n\n- Manual update of `manifest/package-skip-items.xml` config file (then commit & push in the same branch)\n\n - Works with full wildcard (`<members>*</members>`) , named metadata (`<members>Account.Name</members>`) or partial wildcards names (`<members>pi__*</members>` , `<members>*__dlm</members>` , or `<members>prefix*suffix</members>`)\n\n- Environment variable MONITORING_BACKUP_SKIP_METADATA_TYPES (example: `MONITORING_BACKUP_SKIP_METADATA_TYPES=CustomLabel,StaticResource,Translation`): that will be applied to all monitoring branches.\n\n## Full mode\n\nActivate it with **--full** parameter, or variable MONITORING_BACKUP_MODE_FULL=true\n\nIgnores filters (namespaces items & manifest/package-skip-items.xml) to retrieve ALL metadatas, including those you might not care about (reports, translations...)\n\nAs we can retrieve only 10000 files by call, the list of all metadatas will be chunked to make multiple calls (and take more time than filtered mode)\n\n- if you use `--full-apply-filters` , manifest/package-skip-items.xml and MONITORING_BACKUP_SKIP_METADATA_TYPES filters will be applied anyway\n- if you use `--exclude-namespaces` , namespaced items will be ignored\n\n_With those both options, it's like if you are not using --full, but with chunked metadata download_\n\n## In CI/CD\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-metadata-backup/) and can output Grafana, Slack and MsTeams Notifications.\n\n## Troubleshooting\n\nIf you have unknown errors (it happens !), you can investigate using the full command with smaller chunks.\n\nExample: `sf hardis:org:monitor:backup --full --exclude-namespaces --full-apply-filters --max-by-chunk 500`\n\nIt will allow you the identify the responsible metadata and ignore it using package-skip-items.xml or MONITORING_BACKUP_SKIP_METADATA_TYPES env variable.\n\n## Documentation\n\n[Doc generation (including visual flows)](https://sfdx-hardis.cloudity.com/hardis/doc/project2markdown/) is triggered at the end of the command.\n\nIf you want to also upload HTML Documentation on your Salesforce Org as static resource, use variable **SFDX_HARDIS_DOC_DEPLOY_TO_ORG=\"true\"**\n\nIf you want to also upload HTML Documentation on Cloudflare, use variable **SFDX_HARDIS_DOC_DEPLOY_TO_CLOUDFLARE=\"true\"**\n\n- If you want to generate the documentation in multiple languages, define variable SFDX_DOC_LANGUAGES (ex: SFDX_DOC_LANGUAGES=en,fr,de)\n- You can define one Cloudflare site by language, for example with the following variables:\n - CLOUDFLARE_PROJECT_NAME_EN=cloudity-demo-english\n - CLOUDFLARE_PROJECT_NAME_FR=cloudity-demo-french\n - CLOUDFLARE_PROJECT_NAME_DE=cloudity-demo-german\n\nIf Flow history doc always display a single state, you probably need to update your workflow configuration:\n\n- on Gitlab: Env variable [`GIT_FETCH_EXTRA_FLAGS: --depth 10000`](https://github.com/hardisgroupcom/sfdx-hardis/blob/main/defaults/monitoring/.gitlab-ci.yml#L11)\n- on GitHub: [`fetch-depth: 0`](https://github.com/hardisgroupcom/sfdx-hardis/blob/main/defaults/monitoring/.github/workflows/org-monitoring.yml#L58)\n- on Azure: [`fetchDepth: \"0\"`](https://github.com/hardisgroupcom/sfdx-hardis/blob/main/defaults/monitoring/azure-pipelines.yml#L39)\n- on Bitbucket: [`step: clone: depth: full`](https://github.com/hardisgroupcom/sfdx-hardis/blob/main/defaults/monitoring/bitbucket-pipelines.yml#L18)\n",
7788
- "examples": [
7789
- "$ sf hardis:org:monitor:backup",
7790
- "$ sf hardis:org:monitor:backup --full",
7791
- "$ sf hardis:org:monitor:backup --full --exclude-namespaces",
7792
- "$ sf hardis:org:monitor:backup --full --exclude-namespaces --full-apply-filters"
7793
- ],
7794
- "flags": {
7795
- "json": {
7796
- "description": "Format output as json.",
7797
- "helpGroup": "GLOBAL",
7798
- "name": "json",
7799
- "allowNo": false,
7800
- "type": "boolean"
7801
- },
7802
- "flags-dir": {
7803
- "helpGroup": "GLOBAL",
7804
- "name": "flags-dir",
7805
- "summary": "Import flag values from a directory.",
7806
- "hasDynamicHelp": false,
7807
- "multiple": false,
7808
- "type": "option"
7809
- },
7810
- "full": {
7811
- "description": "Dot not take in account filtering using package-skip-items.xml and MONITORING_BACKUP_SKIP_METADATA_TYPES. Efficient but much much slower !",
7812
- "name": "full",
7813
- "allowNo": false,
7814
- "type": "boolean"
7815
- },
7816
- "max-by-chunk": {
7817
- "char": "m",
7818
- "description": "If mode --full is activated, maximum number of metadatas in a package.xml chunk",
7819
- "name": "max-by-chunk",
7820
- "default": 3000,
7821
- "hasDynamicHelp": false,
7822
- "multiple": false,
7823
- "type": "option"
7824
- },
7825
- "exclude-namespaces": {
7826
- "char": "e",
7827
- "description": "If mode --full is activated, exclude namespaced metadatas",
7828
- "name": "exclude-namespaces",
7829
- "allowNo": false,
7830
- "type": "boolean"
7831
- },
7832
- "full-apply-filters": {
7931
+ "prompt": {
7833
7932
  "char": "z",
7834
- "description": "If mode --full is activated, apply filters of manifest/package-skip-items.xml and MONITORING_BACKUP_SKIP_METADATA_TYPES anyway",
7835
- "name": "full-apply-filters",
7836
- "allowNo": false,
7837
- "type": "boolean"
7838
- },
7839
- "start-chunk": {
7840
- "description": "Use this parameter to troubleshoot a specific chunk. It will be used as the first chunk to retrieve",
7841
- "name": "start-chunk",
7842
- "default": 1,
7843
- "hasDynamicHelp": false,
7844
- "multiple": false,
7845
- "type": "option"
7846
- },
7847
- "skip-doc": {
7848
- "description": "Skip the generation of project documentation at the end of the command",
7849
- "name": "skip-doc",
7850
- "allowNo": false,
7933
+ "description": "Prompt for confirmation (true by default, use --no-prompt to skip)",
7934
+ "name": "prompt",
7935
+ "allowNo": true,
7851
7936
  "type": "boolean"
7852
7937
  },
7853
- "outputfile": {
7854
- "char": "f",
7855
- "description": "Force the path and name of output report file. Must end with .csv",
7856
- "name": "outputfile",
7938
+ "name": {
7939
+ "char": "n",
7940
+ "description": "Filter according to Name criteria",
7941
+ "name": "name",
7857
7942
  "hasDynamicHelp": false,
7858
7943
  "multiple": false,
7859
7944
  "type": "option"
7860
7945
  },
7861
- "debug": {
7862
- "char": "d",
7863
- "description": "Activate debug mode (more logs)",
7864
- "name": "debug",
7865
- "allowNo": false,
7866
- "type": "boolean"
7867
- },
7868
- "websocket": {
7869
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7870
- "name": "websocket",
7946
+ "status": {
7947
+ "char": "s",
7948
+ "description": "Filter according to Status criteria",
7949
+ "name": "status",
7871
7950
  "hasDynamicHelp": false,
7872
7951
  "multiple": false,
7873
7952
  "type": "option"
7874
7953
  },
7875
- "skipauth": {
7876
- "description": "Skip authentication check when a default username is required",
7877
- "name": "skipauth",
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",
7878
7958
  "allowNo": false,
7879
7959
  "type": "boolean"
7880
7960
  },
7881
- "target-org": {
7882
- "aliases": [
7883
- "targetusername",
7884
- "u"
7885
- ],
7886
- "char": "o",
7887
- "deprecateAliases": true,
7888
- "name": "target-org",
7889
- "noCacheDefault": true,
7890
- "required": true,
7891
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7892
- "hasDynamicHelp": true,
7893
- "multiple": false,
7894
- "type": "option"
7895
- }
7896
- },
7897
- "hasDynamicHelp": true,
7898
- "hiddenAliases": [],
7899
- "id": "hardis:org:monitor:backup",
7900
- "pluginAlias": "sfdx-hardis",
7901
- "pluginName": "sfdx-hardis",
7902
- "pluginType": "core",
7903
- "strict": true,
7904
- "enableJsonFlag": true,
7905
- "title": "Backup DX sources",
7906
- "requiresProject": true,
7907
- "triggerNotification": true,
7908
- "isESM": true,
7909
- "relativePath": [
7910
- "lib",
7911
- "commands",
7912
- "hardis",
7913
- "org",
7914
- "monitor",
7915
- "backup.js"
7916
- ],
7917
- "aliasPermutations": [],
7918
- "permutations": [
7919
- "hardis:org:monitor:backup",
7920
- "org:hardis:monitor:backup",
7921
- "org:monitor:hardis:backup",
7922
- "org:monitor:backup:hardis",
7923
- "hardis:monitor:org:backup",
7924
- "monitor:hardis:org:backup",
7925
- "monitor:org:hardis:backup",
7926
- "monitor:org:backup:hardis",
7927
- "hardis:monitor:backup:org",
7928
- "monitor:hardis:backup:org",
7929
- "monitor:backup:hardis:org",
7930
- "monitor:backup:org:hardis",
7931
- "hardis:org:backup:monitor",
7932
- "org:hardis:backup:monitor",
7933
- "org:backup:hardis:monitor",
7934
- "org:backup:monitor:hardis",
7935
- "hardis:backup:org:monitor",
7936
- "backup:hardis:org:monitor",
7937
- "backup:org:hardis:monitor",
7938
- "backup:org:monitor:hardis",
7939
- "hardis:backup:monitor:org",
7940
- "backup:hardis:monitor:org",
7941
- "backup:monitor:hardis:org",
7942
- "backup:monitor:org:hardis"
7943
- ]
7944
- },
7945
- "hardis:org:monitor:limits": {
7946
- "aliases": [],
7947
- "args": {},
7948
- "description": "\n## Command Behavior\n\n**Checks the current usage of various Salesforce org limits and sends notifications if thresholds are exceeded.**\n\nThis command is a critical component of proactive Salesforce org management, helping administrators and developers monitor resource consumption and prevent hitting critical limits that could impact performance or functionality. It provides early warnings when limits are approaching their capacity.\n\nKey functionalities:\n\n- **Limit Retrieval:** Fetches a comprehensive list of all Salesforce org limits using the Salesforce CLI.\n- **Usage Calculation:** Calculates the percentage of each limit that is currently being used.\n- **Threshold-Based Alerting:** Assigns a severity (success, warning, or error) to each limit based on configurable thresholds:\n - **Warning:** If usage exceeds 50% (configurable via `LIMIT_THRESHOLD_WARNING` environment variable).\n - **Error:** If usage exceeds 75% (configurable via `LIMIT_THRESHOLD_ERROR` environment variable).\n- **CSV Report Generation:** Generates a CSV file containing all org limits, their current usage, maximum allowed, and calculated percentage used, along with the assigned severity.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of limits that have exceeded the warning or error thresholds.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-org-limits/) and can output Grafana, Slack and MsTeams Notifications.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce CLI Integration:** It executes the `sf org limits list` command to retrieve the current org limits. It parses the JSON output of this command.\n- **Data Processing:** It iterates through the retrieved limits, calculates the `used` and `percentUsed` values, and assigns a `severity` (success, warning, error) based on the configured thresholds.\n- **Environment Variable Configuration:** Reads `LIMIT_THRESHOLD_WARNING` and `LIMIT_THRESHOLD_ERROR` environment variables to set the warning and error thresholds for limit usage.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of org limits.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and detailed metrics for each limit, which can be consumed by monitoring dashboards like Grafana.\n- **Exit Code Management:** Sets the process exit code to 1 if any limit is in an 'error' state, indicating a critical issue.\n</details>\n",
7949
- "examples": [
7950
- "$ sf hardis:org:monitor:limits"
7951
- ],
7952
- "flags": {
7953
- "json": {
7954
- "description": "Format output as json.",
7955
- "helpGroup": "GLOBAL",
7956
- "name": "json",
7957
- "allowNo": false,
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,
7958
7966
  "type": "boolean"
7959
7967
  },
7960
- "flags-dir": {
7961
- "helpGroup": "GLOBAL",
7962
- "name": "flags-dir",
7963
- "summary": "Import flag values from a directory.",
7964
- "hasDynamicHelp": false,
7965
- "multiple": false,
7966
- "type": "option"
7967
- },
7968
- "outputfile": {
7969
- "char": "f",
7970
- "description": "Force the path and name of output report file. Must end with .csv",
7971
- "name": "outputfile",
7968
+ "instanceurl": {
7969
+ "char": "r",
7970
+ "description": "URL of org instance",
7971
+ "name": "instanceurl",
7972
+ "default": "https://login.salesforce.com",
7972
7973
  "hasDynamicHelp": false,
7973
7974
  "multiple": false,
7974
7975
  "type": "option"
@@ -8011,50 +8012,49 @@
8011
8012
  },
8012
8013
  "hasDynamicHelp": true,
8013
8014
  "hiddenAliases": [],
8014
- "id": "hardis:org:monitor:limits",
8015
+ "id": "hardis:org:purge:flow",
8015
8016
  "pluginAlias": "sfdx-hardis",
8016
8017
  "pluginName": "sfdx-hardis",
8017
8018
  "pluginType": "core",
8018
8019
  "strict": true,
8019
8020
  "enableJsonFlag": true,
8020
- "title": "Check org limits",
8021
- "requiresProject": true,
8022
- "triggerNotification": true,
8021
+ "title": "Purge Flow versions",
8022
+ "requiresProject": false,
8023
8023
  "isESM": true,
8024
8024
  "relativePath": [
8025
8025
  "lib",
8026
8026
  "commands",
8027
8027
  "hardis",
8028
8028
  "org",
8029
- "monitor",
8030
- "limits.js"
8029
+ "purge",
8030
+ "flow.js"
8031
8031
  ],
8032
8032
  "aliasPermutations": [],
8033
8033
  "permutations": [
8034
- "hardis:org:monitor:limits",
8035
- "org:hardis:monitor:limits",
8036
- "org:monitor:hardis:limits",
8037
- "org:monitor:limits:hardis",
8038
- "hardis:monitor:org:limits",
8039
- "monitor:hardis:org:limits",
8040
- "monitor:org:hardis:limits",
8041
- "monitor:org:limits:hardis",
8042
- "hardis:monitor:limits:org",
8043
- "monitor:hardis:limits:org",
8044
- "monitor:limits:hardis:org",
8045
- "monitor:limits:org:hardis",
8046
- "hardis:org:limits:monitor",
8047
- "org:hardis:limits:monitor",
8048
- "org:limits:hardis:monitor",
8049
- "org:limits:monitor:hardis",
8050
- "hardis:limits:org:monitor",
8051
- "limits:hardis:org:monitor",
8052
- "limits:org:hardis:monitor",
8053
- "limits:org:monitor:hardis",
8054
- "hardis:limits:monitor:org",
8055
- "limits:hardis:monitor:org",
8056
- "limits:monitor:hardis:org",
8057
- "limits:monitor: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"
8058
8058
  ]
8059
8059
  },
8060
8060
  "hardis:org:refresh:after-refresh": {
@@ -9819,6 +9819,109 @@
9819
9819
  "auth:configure:project:hardis"
9820
9820
  ]
9821
9821
  },
9822
+ "hardis:project:convert:profilestopermsets": {
9823
+ "aliases": [],
9824
+ "args": {},
9825
+ "description": "\n## Command Behavior\n\n**Converts existing Salesforce Profiles into Permission Sets, facilitating a more granular and recommended security model.**\n\nThis command helps in migrating permissions from Profiles to Permission Sets, which is a best practice for managing user access in Salesforce. It creates a new Permission Set for each specified Profile, adopting a naming convention of `PS_PROFILENAME`.\n\nKey functionalities:\n\n- **Profile to Permission Set Conversion:** Automatically extracts permissions from a Profile and creates a corresponding Permission Set.\n- **Naming Convention:** New Permission Sets are named with a `PS_` prefix followed by the Profile name (e.g., `PS_Standard_User`).\n- **Exclusion Filter:** Allows you to exclude specific Profiles from the conversion process using the `--except` flag.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **External Plugin Integration:** It relies on the `shane-sfdx-plugins` (specifically the `sf shane:profile:convert` command) to perform the actual conversion.\n- **File System Scan:** It reads the contents of the `force-app/main/default/profiles` directory to identify all available Profile metadata files.\n- **Command Execution:** For each identified Profile (that is not excluded), it constructs and executes the `sf shane:profile:convert` command with the appropriate Profile name and desired Permission Set name.\n- **Error Handling:** Includes basic error handling for the external command execution.\n</details>\n",
9826
+ "examples": [
9827
+ "$ sf hardis:project:convert:profilestopermsets"
9828
+ ],
9829
+ "flags": {
9830
+ "json": {
9831
+ "description": "Format output as json.",
9832
+ "helpGroup": "GLOBAL",
9833
+ "name": "json",
9834
+ "allowNo": false,
9835
+ "type": "boolean"
9836
+ },
9837
+ "flags-dir": {
9838
+ "helpGroup": "GLOBAL",
9839
+ "name": "flags-dir",
9840
+ "summary": "Import flag values from a directory.",
9841
+ "hasDynamicHelp": false,
9842
+ "multiple": false,
9843
+ "type": "option"
9844
+ },
9845
+ "except": {
9846
+ "char": "e",
9847
+ "description": "List of filters",
9848
+ "name": "except",
9849
+ "default": [],
9850
+ "hasDynamicHelp": false,
9851
+ "multiple": true,
9852
+ "type": "option"
9853
+ },
9854
+ "debug": {
9855
+ "char": "d",
9856
+ "description": "Activate debug mode (more logs)",
9857
+ "name": "debug",
9858
+ "allowNo": false,
9859
+ "type": "boolean"
9860
+ },
9861
+ "websocket": {
9862
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
9863
+ "name": "websocket",
9864
+ "hasDynamicHelp": false,
9865
+ "multiple": false,
9866
+ "type": "option"
9867
+ },
9868
+ "skipauth": {
9869
+ "description": "Skip authentication check when a default username is required",
9870
+ "name": "skipauth",
9871
+ "allowNo": false,
9872
+ "type": "boolean"
9873
+ }
9874
+ },
9875
+ "hasDynamicHelp": false,
9876
+ "hiddenAliases": [],
9877
+ "id": "hardis:project:convert:profilestopermsets",
9878
+ "pluginAlias": "sfdx-hardis",
9879
+ "pluginName": "sfdx-hardis",
9880
+ "pluginType": "core",
9881
+ "strict": true,
9882
+ "enableJsonFlag": true,
9883
+ "title": "Convert Profiles into Permission Sets",
9884
+ "requiresProject": true,
9885
+ "requiresSfdxPlugins": [
9886
+ "shane-sfdx-plugins"
9887
+ ],
9888
+ "isESM": true,
9889
+ "relativePath": [
9890
+ "lib",
9891
+ "commands",
9892
+ "hardis",
9893
+ "project",
9894
+ "convert",
9895
+ "profilestopermsets.js"
9896
+ ],
9897
+ "aliasPermutations": [],
9898
+ "permutations": [
9899
+ "hardis:project:convert:profilestopermsets",
9900
+ "project:hardis:convert:profilestopermsets",
9901
+ "project:convert:hardis:profilestopermsets",
9902
+ "project:convert:profilestopermsets:hardis",
9903
+ "hardis:convert:project:profilestopermsets",
9904
+ "convert:hardis:project:profilestopermsets",
9905
+ "convert:project:hardis:profilestopermsets",
9906
+ "convert:project:profilestopermsets:hardis",
9907
+ "hardis:convert:profilestopermsets:project",
9908
+ "convert:hardis:profilestopermsets:project",
9909
+ "convert:profilestopermsets:hardis:project",
9910
+ "convert:profilestopermsets:project:hardis",
9911
+ "hardis:project:profilestopermsets:convert",
9912
+ "project:hardis:profilestopermsets:convert",
9913
+ "project:profilestopermsets:hardis:convert",
9914
+ "project:profilestopermsets:convert:hardis",
9915
+ "hardis:profilestopermsets:project:convert",
9916
+ "profilestopermsets:hardis:project:convert",
9917
+ "profilestopermsets:project:hardis:convert",
9918
+ "profilestopermsets:project:convert:hardis",
9919
+ "hardis:profilestopermsets:convert:project",
9920
+ "profilestopermsets:hardis:convert:project",
9921
+ "profilestopermsets:convert:hardis:project",
9922
+ "profilestopermsets:convert:project:hardis"
9923
+ ]
9924
+ },
9822
9925
  "hardis:project:clean:emptyitems": {
9823
9926
  "aliases": [],
9824
9927
  "args": {},
@@ -11304,109 +11407,6 @@
11304
11407
  "xml:clean:project:hardis"
11305
11408
  ]
11306
11409
  },
11307
- "hardis:project:convert:profilestopermsets": {
11308
- "aliases": [],
11309
- "args": {},
11310
- "description": "\n## Command Behavior\n\n**Converts existing Salesforce Profiles into Permission Sets, facilitating a more granular and recommended security model.**\n\nThis command helps in migrating permissions from Profiles to Permission Sets, which is a best practice for managing user access in Salesforce. It creates a new Permission Set for each specified Profile, adopting a naming convention of `PS_PROFILENAME`.\n\nKey functionalities:\n\n- **Profile to Permission Set Conversion:** Automatically extracts permissions from a Profile and creates a corresponding Permission Set.\n- **Naming Convention:** New Permission Sets are named with a `PS_` prefix followed by the Profile name (e.g., `PS_Standard_User`).\n- **Exclusion Filter:** Allows you to exclude specific Profiles from the conversion process using the `--except` flag.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **External Plugin Integration:** It relies on the `shane-sfdx-plugins` (specifically the `sf shane:profile:convert` command) to perform the actual conversion.\n- **File System Scan:** It reads the contents of the `force-app/main/default/profiles` directory to identify all available Profile metadata files.\n- **Command Execution:** For each identified Profile (that is not excluded), it constructs and executes the `sf shane:profile:convert` command with the appropriate Profile name and desired Permission Set name.\n- **Error Handling:** Includes basic error handling for the external command execution.\n</details>\n",
11311
- "examples": [
11312
- "$ sf hardis:project:convert:profilestopermsets"
11313
- ],
11314
- "flags": {
11315
- "json": {
11316
- "description": "Format output as json.",
11317
- "helpGroup": "GLOBAL",
11318
- "name": "json",
11319
- "allowNo": false,
11320
- "type": "boolean"
11321
- },
11322
- "flags-dir": {
11323
- "helpGroup": "GLOBAL",
11324
- "name": "flags-dir",
11325
- "summary": "Import flag values from a directory.",
11326
- "hasDynamicHelp": false,
11327
- "multiple": false,
11328
- "type": "option"
11329
- },
11330
- "except": {
11331
- "char": "e",
11332
- "description": "List of filters",
11333
- "name": "except",
11334
- "default": [],
11335
- "hasDynamicHelp": false,
11336
- "multiple": true,
11337
- "type": "option"
11338
- },
11339
- "debug": {
11340
- "char": "d",
11341
- "description": "Activate debug mode (more logs)",
11342
- "name": "debug",
11343
- "allowNo": false,
11344
- "type": "boolean"
11345
- },
11346
- "websocket": {
11347
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
11348
- "name": "websocket",
11349
- "hasDynamicHelp": false,
11350
- "multiple": false,
11351
- "type": "option"
11352
- },
11353
- "skipauth": {
11354
- "description": "Skip authentication check when a default username is required",
11355
- "name": "skipauth",
11356
- "allowNo": false,
11357
- "type": "boolean"
11358
- }
11359
- },
11360
- "hasDynamicHelp": false,
11361
- "hiddenAliases": [],
11362
- "id": "hardis:project:convert:profilestopermsets",
11363
- "pluginAlias": "sfdx-hardis",
11364
- "pluginName": "sfdx-hardis",
11365
- "pluginType": "core",
11366
- "strict": true,
11367
- "enableJsonFlag": true,
11368
- "title": "Convert Profiles into Permission Sets",
11369
- "requiresProject": true,
11370
- "requiresSfdxPlugins": [
11371
- "shane-sfdx-plugins"
11372
- ],
11373
- "isESM": true,
11374
- "relativePath": [
11375
- "lib",
11376
- "commands",
11377
- "hardis",
11378
- "project",
11379
- "convert",
11380
- "profilestopermsets.js"
11381
- ],
11382
- "aliasPermutations": [],
11383
- "permutations": [
11384
- "hardis:project:convert:profilestopermsets",
11385
- "project:hardis:convert:profilestopermsets",
11386
- "project:convert:hardis:profilestopermsets",
11387
- "project:convert:profilestopermsets:hardis",
11388
- "hardis:convert:project:profilestopermsets",
11389
- "convert:hardis:project:profilestopermsets",
11390
- "convert:project:hardis:profilestopermsets",
11391
- "convert:project:profilestopermsets:hardis",
11392
- "hardis:convert:profilestopermsets:project",
11393
- "convert:hardis:profilestopermsets:project",
11394
- "convert:profilestopermsets:hardis:project",
11395
- "convert:profilestopermsets:project:hardis",
11396
- "hardis:project:profilestopermsets:convert",
11397
- "project:hardis:profilestopermsets:convert",
11398
- "project:profilestopermsets:hardis:convert",
11399
- "project:profilestopermsets:convert:hardis",
11400
- "hardis:profilestopermsets:project:convert",
11401
- "profilestopermsets:hardis:project:convert",
11402
- "profilestopermsets:project:hardis:convert",
11403
- "profilestopermsets:project:convert:hardis",
11404
- "hardis:profilestopermsets:convert:project",
11405
- "profilestopermsets:hardis:convert:project",
11406
- "profilestopermsets:convert:hardis:project",
11407
- "profilestopermsets:convert:project:hardis"
11408
- ]
11409
- },
11410
11410
  "hardis:project:deploy:notify": {
11411
11411
  "aliases": [],
11412
11412
  "args": {},
@@ -15370,5 +15370,5 @@
15370
15370
  ]
15371
15371
  }
15372
15372
  },
15373
- "version": "6.9.1-alpha202510262255.0"
15373
+ "version": "6.9.1-alpha202510270024.0"
15374
15374
  }