sfdx-hardis 6.12.8 → 6.12.10
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.
- package/CHANGELOG.md +8 -0
- package/oclif.lock +76 -142
- package/oclif.manifest.json +863 -863
- package/package.json +2 -2
package/oclif.manifest.json
CHANGED
|
@@ -132,13 +132,12 @@
|
|
|
132
132
|
"clear:cache:hardis"
|
|
133
133
|
]
|
|
134
134
|
},
|
|
135
|
-
"hardis:
|
|
135
|
+
"hardis:config:get": {
|
|
136
136
|
"aliases": [],
|
|
137
137
|
"args": {},
|
|
138
|
-
"description": "\n## Command Behavior\n\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:
|
|
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
|
-
"
|
|
160
|
-
"char": "
|
|
161
|
-
"description": "
|
|
162
|
-
"name": "
|
|
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:
|
|
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": "
|
|
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
|
-
"
|
|
218
|
-
"
|
|
208
|
+
"config",
|
|
209
|
+
"get.js"
|
|
219
210
|
],
|
|
220
211
|
"aliasPermutations": [],
|
|
221
212
|
"permutations": [
|
|
222
|
-
"hardis:
|
|
223
|
-
"
|
|
224
|
-
"
|
|
225
|
-
"hardis:
|
|
226
|
-
"
|
|
227
|
-
"
|
|
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:
|
|
221
|
+
"hardis:auth:login": {
|
|
231
222
|
"aliases": [],
|
|
232
223
|
"args": {},
|
|
233
|
-
"description": "\n## Command Behavior\n\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:
|
|
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
|
-
"
|
|
254
|
-
"char": "
|
|
255
|
-
"description": "
|
|
256
|
-
"name": "
|
|
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:
|
|
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": "
|
|
296
|
+
"title": "Login",
|
|
297
297
|
"requiresProject": false,
|
|
298
298
|
"isESM": true,
|
|
299
299
|
"relativePath": [
|
|
300
300
|
"lib",
|
|
301
301
|
"commands",
|
|
302
302
|
"hardis",
|
|
303
|
-
"
|
|
304
|
-
"
|
|
303
|
+
"auth",
|
|
304
|
+
"login.js"
|
|
305
305
|
],
|
|
306
306
|
"aliasPermutations": [],
|
|
307
307
|
"permutations": [
|
|
308
|
-
"hardis:
|
|
309
|
-
"
|
|
310
|
-
"
|
|
311
|
-
"hardis:
|
|
312
|
-
"
|
|
313
|
-
"
|
|
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": {
|
|
@@ -2692,12 +2692,12 @@
|
|
|
2692
2692
|
"mergexml:package:hardis"
|
|
2693
2693
|
]
|
|
2694
2694
|
},
|
|
2695
|
-
"hardis:
|
|
2695
|
+
"hardis:project:create": {
|
|
2696
2696
|
"aliases": [],
|
|
2697
2697
|
"args": {},
|
|
2698
|
-
"description": "
|
|
2698
|
+
"description": "Create a new SFDX Project",
|
|
2699
2699
|
"examples": [
|
|
2700
|
-
"$ sf hardis
|
|
2700
|
+
"$ sf hardis:project:create"
|
|
2701
2701
|
],
|
|
2702
2702
|
"flags": {
|
|
2703
2703
|
"json": {
|
|
@@ -2715,70 +2715,62 @@
|
|
|
2715
2715
|
"multiple": false,
|
|
2716
2716
|
"type": "option"
|
|
2717
2717
|
},
|
|
2718
|
-
"packagexmls": {
|
|
2719
|
-
"char": "p",
|
|
2720
|
-
"description": "package.xml files path (separated by commas)",
|
|
2721
|
-
"name": "packagexmls",
|
|
2722
|
-
"required": true,
|
|
2723
|
-
"hasDynamicHelp": false,
|
|
2724
|
-
"multiple": false,
|
|
2725
|
-
"type": "option"
|
|
2726
|
-
},
|
|
2727
|
-
"outputfile": {
|
|
2728
|
-
"char": "f",
|
|
2729
|
-
"description": "package.xml output file",
|
|
2730
|
-
"name": "outputfile",
|
|
2731
|
-
"required": true,
|
|
2732
|
-
"hasDynamicHelp": false,
|
|
2733
|
-
"multiple": false,
|
|
2734
|
-
"type": "option"
|
|
2735
|
-
},
|
|
2736
2718
|
"debug": {
|
|
2737
|
-
"
|
|
2719
|
+
"char": "d",
|
|
2720
|
+
"description": "Activate debug mode (more logs)",
|
|
2738
2721
|
"name": "debug",
|
|
2739
2722
|
"allowNo": false,
|
|
2740
2723
|
"type": "boolean"
|
|
2741
2724
|
},
|
|
2742
2725
|
"websocket": {
|
|
2743
|
-
"description": "
|
|
2726
|
+
"description": "Websocket host:port for VsCode SFDX Hardis UI integration",
|
|
2744
2727
|
"name": "websocket",
|
|
2745
2728
|
"hasDynamicHelp": false,
|
|
2746
2729
|
"multiple": false,
|
|
2747
2730
|
"type": "option"
|
|
2731
|
+
},
|
|
2732
|
+
"skipauth": {
|
|
2733
|
+
"description": "Skip authentication check when a default username is required",
|
|
2734
|
+
"name": "skipauth",
|
|
2735
|
+
"allowNo": false,
|
|
2736
|
+
"type": "boolean"
|
|
2748
2737
|
}
|
|
2749
2738
|
},
|
|
2750
2739
|
"hasDynamicHelp": false,
|
|
2751
2740
|
"hiddenAliases": [],
|
|
2752
|
-
"id": "hardis:
|
|
2741
|
+
"id": "hardis:project:create",
|
|
2753
2742
|
"pluginAlias": "sfdx-hardis",
|
|
2754
2743
|
"pluginName": "sfdx-hardis",
|
|
2755
2744
|
"pluginType": "core",
|
|
2756
2745
|
"strict": true,
|
|
2757
2746
|
"enableJsonFlag": true,
|
|
2747
|
+
"title": "Login",
|
|
2748
|
+
"requiresProject": false,
|
|
2758
2749
|
"isESM": true,
|
|
2759
2750
|
"relativePath": [
|
|
2760
2751
|
"lib",
|
|
2761
2752
|
"commands",
|
|
2762
2753
|
"hardis",
|
|
2763
|
-
"
|
|
2764
|
-
"
|
|
2754
|
+
"project",
|
|
2755
|
+
"create.js"
|
|
2765
2756
|
],
|
|
2766
2757
|
"aliasPermutations": [],
|
|
2767
2758
|
"permutations": [
|
|
2768
|
-
"hardis:
|
|
2769
|
-
"
|
|
2770
|
-
"
|
|
2771
|
-
"hardis:
|
|
2772
|
-
"
|
|
2773
|
-
"
|
|
2759
|
+
"hardis:project:create",
|
|
2760
|
+
"project:hardis:create",
|
|
2761
|
+
"project:create:hardis",
|
|
2762
|
+
"hardis:create:project",
|
|
2763
|
+
"create:hardis:project",
|
|
2764
|
+
"create:project:hardis"
|
|
2774
2765
|
]
|
|
2775
2766
|
},
|
|
2776
|
-
"hardis:
|
|
2767
|
+
"hardis:project:lint": {
|
|
2777
2768
|
"aliases": [],
|
|
2778
2769
|
"args": {},
|
|
2779
|
-
"description": "
|
|
2770
|
+
"description": "## Command Behavior\n\n**Applies syntactic analysis (linting) to your repository sources using Mega-Linter, ensuring code quality and adherence to coding standards.**\n\nThis command integrates Mega-Linter, a comprehensive linter orchestrator, into your Salesforce DX project. It helps identify and fix code style violations, potential bugs, and other issues across various file types relevant to Salesforce development.\n\nKey functionalities:\n\n- **Automated Linting:** Runs a suite of linters configured for Salesforce projects.\n- **Fixing Issues (`--fix` flag):** Automatically attempts to fix detected linting issues, saving manual effort.\n- **Configuration Management:** If `.mega-linter.yml` is not found, it guides you through the initial setup of Mega-Linter, prompting for the Salesforce flavor.\n- **CI/CD Integration:** Designed to be used in CI/CD pipelines to enforce code quality gates.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Mega-Linter Integration:** It leverages the `mega-linter-runner` library to execute Mega-Linter.\n- **Configuration Check:** Before running, it checks for the presence of `.mega-linter.yml`. If not found and not in a CI environment, it initiates an interactive setup process using `MegaLinterRunner().run({ install: true })`.\n- **Linter Execution:** It calls `MegaLinterRunner().run(megaLinterOptions)` with the `salesforce` flavor and the `fix` flag (if provided).\n- **Exit Code Handling:** The `process.exitCode` is set based on the Mega-Linter's exit status, allowing CI/CD pipelines to react to linting failures.\n- **User Feedback:** Provides clear messages about the success or failure of the linting process.\n</details>\n",
|
|
2780
2771
|
"examples": [
|
|
2781
|
-
"$ sf hardis
|
|
2772
|
+
"$ sf hardis:project:lint",
|
|
2773
|
+
"$ sf hardis:project:lint --fix"
|
|
2782
2774
|
],
|
|
2783
2775
|
"flags": {
|
|
2784
2776
|
"json": {
|
|
@@ -2796,85 +2788,82 @@
|
|
|
2796
2788
|
"multiple": false,
|
|
2797
2789
|
"type": "option"
|
|
2798
2790
|
},
|
|
2799
|
-
"
|
|
2800
|
-
"char": "
|
|
2801
|
-
"description": "
|
|
2802
|
-
"name": "
|
|
2803
|
-
"hasDynamicHelp": false,
|
|
2804
|
-
"multiple": false,
|
|
2805
|
-
"type": "option"
|
|
2806
|
-
},
|
|
2807
|
-
"removepackagexml": {
|
|
2808
|
-
"char": "r",
|
|
2809
|
-
"description": "package.xml file to use to filter input package.xml",
|
|
2810
|
-
"name": "removepackagexml",
|
|
2811
|
-
"hasDynamicHelp": false,
|
|
2812
|
-
"multiple": false,
|
|
2813
|
-
"type": "option"
|
|
2814
|
-
},
|
|
2815
|
-
"removedonly": {
|
|
2816
|
-
"char": "z",
|
|
2817
|
-
"description": "Use this flag to generate a package.xml with only removed items",
|
|
2818
|
-
"name": "removedonly",
|
|
2791
|
+
"fix": {
|
|
2792
|
+
"char": "f",
|
|
2793
|
+
"description": "Apply linters fixes",
|
|
2794
|
+
"name": "fix",
|
|
2819
2795
|
"allowNo": false,
|
|
2820
2796
|
"type": "boolean"
|
|
2821
2797
|
},
|
|
2822
|
-
"outputfile": {
|
|
2823
|
-
"char": "f",
|
|
2824
|
-
"description": "package.xml output file",
|
|
2825
|
-
"name": "outputfile",
|
|
2826
|
-
"required": true,
|
|
2827
|
-
"hasDynamicHelp": false,
|
|
2828
|
-
"multiple": false,
|
|
2829
|
-
"type": "option"
|
|
2830
|
-
},
|
|
2831
2798
|
"debug": {
|
|
2832
|
-
"
|
|
2799
|
+
"char": "d",
|
|
2800
|
+
"description": "Activate debug mode (more logs)",
|
|
2833
2801
|
"name": "debug",
|
|
2834
2802
|
"allowNo": false,
|
|
2835
2803
|
"type": "boolean"
|
|
2836
2804
|
},
|
|
2837
2805
|
"websocket": {
|
|
2838
|
-
"description": "
|
|
2806
|
+
"description": "Websocket host:port for VsCode SFDX Hardis UI integration",
|
|
2839
2807
|
"name": "websocket",
|
|
2840
2808
|
"hasDynamicHelp": false,
|
|
2841
2809
|
"multiple": false,
|
|
2842
2810
|
"type": "option"
|
|
2811
|
+
},
|
|
2812
|
+
"skipauth": {
|
|
2813
|
+
"description": "Skip authentication check when a default username is required",
|
|
2814
|
+
"name": "skipauth",
|
|
2815
|
+
"allowNo": false,
|
|
2816
|
+
"type": "boolean"
|
|
2817
|
+
},
|
|
2818
|
+
"target-org": {
|
|
2819
|
+
"aliases": [
|
|
2820
|
+
"targetusername",
|
|
2821
|
+
"u"
|
|
2822
|
+
],
|
|
2823
|
+
"char": "o",
|
|
2824
|
+
"deprecateAliases": true,
|
|
2825
|
+
"name": "target-org",
|
|
2826
|
+
"noCacheDefault": true,
|
|
2827
|
+
"summary": "Username or alias of the target org.",
|
|
2828
|
+
"hasDynamicHelp": true,
|
|
2829
|
+
"multiple": false,
|
|
2830
|
+
"type": "option"
|
|
2843
2831
|
}
|
|
2844
2832
|
},
|
|
2845
|
-
"hasDynamicHelp":
|
|
2833
|
+
"hasDynamicHelp": true,
|
|
2846
2834
|
"hiddenAliases": [],
|
|
2847
|
-
"id": "hardis:
|
|
2835
|
+
"id": "hardis:project:lint",
|
|
2848
2836
|
"pluginAlias": "sfdx-hardis",
|
|
2849
2837
|
"pluginName": "sfdx-hardis",
|
|
2850
2838
|
"pluginType": "core",
|
|
2851
2839
|
"strict": true,
|
|
2852
2840
|
"enableJsonFlag": true,
|
|
2841
|
+
"title": "Lint",
|
|
2853
2842
|
"requiresProject": false,
|
|
2854
2843
|
"isESM": true,
|
|
2855
2844
|
"relativePath": [
|
|
2856
2845
|
"lib",
|
|
2857
2846
|
"commands",
|
|
2858
2847
|
"hardis",
|
|
2859
|
-
"
|
|
2860
|
-
"
|
|
2848
|
+
"project",
|
|
2849
|
+
"lint.js"
|
|
2861
2850
|
],
|
|
2862
2851
|
"aliasPermutations": [],
|
|
2863
2852
|
"permutations": [
|
|
2864
|
-
"hardis:
|
|
2865
|
-
"
|
|
2866
|
-
"
|
|
2867
|
-
"hardis:
|
|
2868
|
-
"
|
|
2869
|
-
"
|
|
2853
|
+
"hardis:project:lint",
|
|
2854
|
+
"project:hardis:lint",
|
|
2855
|
+
"project:lint:hardis",
|
|
2856
|
+
"hardis:lint:project",
|
|
2857
|
+
"lint:hardis:project",
|
|
2858
|
+
"lint:project:hardis"
|
|
2870
2859
|
]
|
|
2871
2860
|
},
|
|
2872
|
-
"hardis:
|
|
2861
|
+
"hardis:packagexml:append": {
|
|
2873
2862
|
"aliases": [],
|
|
2874
2863
|
"args": {},
|
|
2875
|
-
"description": "
|
|
2864
|
+
"description": "\n## Command Behavior\n\n**Appends the content of one or more Salesforce `package.xml` files into a single target `package.xml` file.**\n\nThis command is useful for consolidating metadata definitions from various sources into a single manifest. For instance, you might have separate `package.xml` files for different features or metadata types, and this command allows you to combine them into one comprehensive file for deployment or retrieval.\n\nKey functionalities:\n\n- **Multiple Input Files:** Takes a comma-separated list of `package.xml` file paths as input.\n- **Single Output File:** Merges the content of all input files into a specified output `package.xml` file.\n- **Metadata Consolidation:** Combines the `<types>` and `<members>` elements from all input files, ensuring that all unique metadata components are included in the resulting file.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Parsing:** It reads and parses the XML content of each input `package.xml` file.\n- **Content Merging:** It iterates through the parsed XML structures, merging the `types` and `members` arrays. If a metadata type exists in multiple input files, its members are combined (duplicates are typically handled by the underlying XML utility).\n- **XML Building:** After consolidating the metadata, it rebuilds the XML structure for the output `package.xml` file.\n- **File Writing:** The newly constructed XML content is then written to the specified output file.\n- **`appendPackageXmlFilesContent` Utility:** The core logic for this operation is encapsulated within the `appendPackageXmlFilesContent` utility function, which handles the parsing, merging, and writing of the `package.xml` files.\n</details>\n",
|
|
2876
2865
|
"examples": [
|
|
2877
|
-
"$ sf hardis
|
|
2866
|
+
"$ sf hardis packagexml append -p package1.xml,package2.xml -o package3.xml"
|
|
2878
2867
|
],
|
|
2879
2868
|
"flags": {
|
|
2880
2869
|
"json": {
|
|
@@ -2892,62 +2881,70 @@
|
|
|
2892
2881
|
"multiple": false,
|
|
2893
2882
|
"type": "option"
|
|
2894
2883
|
},
|
|
2884
|
+
"packagexmls": {
|
|
2885
|
+
"char": "p",
|
|
2886
|
+
"description": "package.xml files path (separated by commas)",
|
|
2887
|
+
"name": "packagexmls",
|
|
2888
|
+
"required": true,
|
|
2889
|
+
"hasDynamicHelp": false,
|
|
2890
|
+
"multiple": false,
|
|
2891
|
+
"type": "option"
|
|
2892
|
+
},
|
|
2893
|
+
"outputfile": {
|
|
2894
|
+
"char": "f",
|
|
2895
|
+
"description": "package.xml output file",
|
|
2896
|
+
"name": "outputfile",
|
|
2897
|
+
"required": true,
|
|
2898
|
+
"hasDynamicHelp": false,
|
|
2899
|
+
"multiple": false,
|
|
2900
|
+
"type": "option"
|
|
2901
|
+
},
|
|
2895
2902
|
"debug": {
|
|
2896
|
-
"
|
|
2897
|
-
"description": "Activate debug mode (more logs)",
|
|
2903
|
+
"description": "debug",
|
|
2898
2904
|
"name": "debug",
|
|
2899
2905
|
"allowNo": false,
|
|
2900
2906
|
"type": "boolean"
|
|
2901
2907
|
},
|
|
2902
2908
|
"websocket": {
|
|
2903
|
-
"description": "
|
|
2909
|
+
"description": "websocket",
|
|
2904
2910
|
"name": "websocket",
|
|
2905
2911
|
"hasDynamicHelp": false,
|
|
2906
2912
|
"multiple": false,
|
|
2907
2913
|
"type": "option"
|
|
2908
|
-
},
|
|
2909
|
-
"skipauth": {
|
|
2910
|
-
"description": "Skip authentication check when a default username is required",
|
|
2911
|
-
"name": "skipauth",
|
|
2912
|
-
"allowNo": false,
|
|
2913
|
-
"type": "boolean"
|
|
2914
2914
|
}
|
|
2915
2915
|
},
|
|
2916
2916
|
"hasDynamicHelp": false,
|
|
2917
2917
|
"hiddenAliases": [],
|
|
2918
|
-
"id": "hardis:
|
|
2918
|
+
"id": "hardis:packagexml:append",
|
|
2919
2919
|
"pluginAlias": "sfdx-hardis",
|
|
2920
2920
|
"pluginName": "sfdx-hardis",
|
|
2921
2921
|
"pluginType": "core",
|
|
2922
2922
|
"strict": true,
|
|
2923
2923
|
"enableJsonFlag": true,
|
|
2924
|
-
"title": "Login",
|
|
2925
|
-
"requiresProject": false,
|
|
2926
2924
|
"isESM": true,
|
|
2927
2925
|
"relativePath": [
|
|
2928
2926
|
"lib",
|
|
2929
2927
|
"commands",
|
|
2930
2928
|
"hardis",
|
|
2931
|
-
"
|
|
2932
|
-
"
|
|
2929
|
+
"packagexml",
|
|
2930
|
+
"append.js"
|
|
2933
2931
|
],
|
|
2934
2932
|
"aliasPermutations": [],
|
|
2935
2933
|
"permutations": [
|
|
2936
|
-
"hardis:
|
|
2937
|
-
"
|
|
2938
|
-
"
|
|
2939
|
-
"hardis:
|
|
2940
|
-
"
|
|
2941
|
-
"
|
|
2934
|
+
"hardis:packagexml:append",
|
|
2935
|
+
"packagexml:hardis:append",
|
|
2936
|
+
"packagexml:append:hardis",
|
|
2937
|
+
"hardis:append:packagexml",
|
|
2938
|
+
"append:hardis:packagexml",
|
|
2939
|
+
"append:packagexml:hardis"
|
|
2942
2940
|
]
|
|
2943
2941
|
},
|
|
2944
|
-
"hardis:
|
|
2942
|
+
"hardis:packagexml:remove": {
|
|
2945
2943
|
"aliases": [],
|
|
2946
2944
|
"args": {},
|
|
2947
|
-
"description": "## Command Behavior\n\n**
|
|
2945
|
+
"description": "\n## Command Behavior\n\n**Removes metadata components from a `package.xml` file that are also present in another `package.xml` file (e.g., a `destructiveChanges.xml`).**\n\nThis command is useful for refining your `package.xml` manifests by excluding components that are being deleted or are otherwise irrelevant for a specific deployment or retrieval. For example, you can use it to create a `package.xml` that only contains additions and modifications, by removing items listed in a `destructiveChanges.xml`.\n\nKey functionalities:\n\n- **Source `package.xml`:** The main `package.xml` file from which components will be removed (specified by `--packagexml`). Defaults to `package.xml`.\n- **Filter `package.xml`:** The `package.xml` file containing the components to be removed from the source (specified by `--removepackagexml`). Defaults to `destructiveChanges.xml`.\n- **Output File:** The path to the new `package.xml` file that will contain the filtered content (specified by `--outputfile`).\n- **Removed Only Output:** The `--removedonly` flag allows you to generate a `package.xml` that contains *only* the items that were removed from the source `package.xml`.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **File Parsing:** It reads and parses the XML content of both the source `package.xml` and the filter `package.xml`.\n- **Content Comparison and Filtering:** It compares the metadata types and members defined in both files. Components found in the filter `package.xml` are excluded from the output.\n- **XML Building:** After filtering, it rebuilds the XML structure for the new `package.xml` file.\n- **File Writing:** The newly constructed XML content is then written to the specified output file.\n- **`removePackageXmlFilesContent` Utility:** The core logic for this operation is encapsulated within the `removePackageXmlFilesContent` utility function, which handles the parsing, filtering, and writing of the `package.xml` files.\n</details>\n",
|
|
2948
2946
|
"examples": [
|
|
2949
|
-
"$ sf hardis:
|
|
2950
|
-
"$ sf hardis:project:lint --fix"
|
|
2947
|
+
"$ sf hardis packagexml:remove -p package.xml -r destructiveChanges.xml -o my-reduced-package.xml"
|
|
2951
2948
|
],
|
|
2952
2949
|
"flags": {
|
|
2953
2950
|
"json": {
|
|
@@ -2965,74 +2962,77 @@
|
|
|
2965
2962
|
"multiple": false,
|
|
2966
2963
|
"type": "option"
|
|
2967
2964
|
},
|
|
2968
|
-
"
|
|
2969
|
-
"char": "
|
|
2970
|
-
"description": "
|
|
2971
|
-
"name": "
|
|
2972
|
-
"
|
|
2973
|
-
"
|
|
2965
|
+
"packagexml": {
|
|
2966
|
+
"char": "p",
|
|
2967
|
+
"description": "package.xml file to reduce",
|
|
2968
|
+
"name": "packagexml",
|
|
2969
|
+
"hasDynamicHelp": false,
|
|
2970
|
+
"multiple": false,
|
|
2971
|
+
"type": "option"
|
|
2974
2972
|
},
|
|
2975
|
-
"
|
|
2976
|
-
"char": "
|
|
2977
|
-
"description": "
|
|
2978
|
-
"name": "
|
|
2973
|
+
"removepackagexml": {
|
|
2974
|
+
"char": "r",
|
|
2975
|
+
"description": "package.xml file to use to filter input package.xml",
|
|
2976
|
+
"name": "removepackagexml",
|
|
2977
|
+
"hasDynamicHelp": false,
|
|
2978
|
+
"multiple": false,
|
|
2979
|
+
"type": "option"
|
|
2980
|
+
},
|
|
2981
|
+
"removedonly": {
|
|
2982
|
+
"char": "z",
|
|
2983
|
+
"description": "Use this flag to generate a package.xml with only removed items",
|
|
2984
|
+
"name": "removedonly",
|
|
2979
2985
|
"allowNo": false,
|
|
2980
2986
|
"type": "boolean"
|
|
2981
2987
|
},
|
|
2982
|
-
"
|
|
2983
|
-
"
|
|
2984
|
-
"
|
|
2988
|
+
"outputfile": {
|
|
2989
|
+
"char": "f",
|
|
2990
|
+
"description": "package.xml output file",
|
|
2991
|
+
"name": "outputfile",
|
|
2992
|
+
"required": true,
|
|
2985
2993
|
"hasDynamicHelp": false,
|
|
2986
2994
|
"multiple": false,
|
|
2987
2995
|
"type": "option"
|
|
2988
2996
|
},
|
|
2989
|
-
"
|
|
2990
|
-
"description": "
|
|
2991
|
-
"name": "
|
|
2997
|
+
"debug": {
|
|
2998
|
+
"description": "debug",
|
|
2999
|
+
"name": "debug",
|
|
2992
3000
|
"allowNo": false,
|
|
2993
3001
|
"type": "boolean"
|
|
2994
3002
|
},
|
|
2995
|
-
"
|
|
2996
|
-
"
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
],
|
|
3000
|
-
"char": "o",
|
|
3001
|
-
"deprecateAliases": true,
|
|
3002
|
-
"name": "target-org",
|
|
3003
|
-
"noCacheDefault": true,
|
|
3004
|
-
"summary": "Username or alias of the target org.",
|
|
3005
|
-
"hasDynamicHelp": true,
|
|
3003
|
+
"websocket": {
|
|
3004
|
+
"description": "websocket",
|
|
3005
|
+
"name": "websocket",
|
|
3006
|
+
"hasDynamicHelp": false,
|
|
3006
3007
|
"multiple": false,
|
|
3007
3008
|
"type": "option"
|
|
3008
3009
|
}
|
|
3009
3010
|
},
|
|
3010
|
-
"hasDynamicHelp":
|
|
3011
|
+
"hasDynamicHelp": false,
|
|
3011
3012
|
"hiddenAliases": [],
|
|
3012
|
-
"id": "hardis:
|
|
3013
|
+
"id": "hardis:packagexml:remove",
|
|
3013
3014
|
"pluginAlias": "sfdx-hardis",
|
|
3014
3015
|
"pluginName": "sfdx-hardis",
|
|
3015
3016
|
"pluginType": "core",
|
|
3016
3017
|
"strict": true,
|
|
3017
3018
|
"enableJsonFlag": true,
|
|
3018
|
-
"title": "Lint",
|
|
3019
3019
|
"requiresProject": false,
|
|
3020
3020
|
"isESM": true,
|
|
3021
3021
|
"relativePath": [
|
|
3022
3022
|
"lib",
|
|
3023
3023
|
"commands",
|
|
3024
3024
|
"hardis",
|
|
3025
|
-
"
|
|
3026
|
-
"
|
|
3025
|
+
"packagexml",
|
|
3026
|
+
"remove.js"
|
|
3027
3027
|
],
|
|
3028
3028
|
"aliasPermutations": [],
|
|
3029
3029
|
"permutations": [
|
|
3030
|
-
"hardis:
|
|
3031
|
-
"
|
|
3032
|
-
"
|
|
3033
|
-
"hardis:
|
|
3034
|
-
"
|
|
3035
|
-
"
|
|
3030
|
+
"hardis:packagexml:remove",
|
|
3031
|
+
"packagexml:hardis:remove",
|
|
3032
|
+
"packagexml:remove:hardis",
|
|
3033
|
+
"hardis:remove:packagexml",
|
|
3034
|
+
"remove:hardis:packagexml",
|
|
3035
|
+
"remove:packagexml:hardis"
|
|
3036
3036
|
]
|
|
3037
3037
|
},
|
|
3038
3038
|
"hardis:scratch:create": {
|
|
@@ -5539,15 +5539,12 @@
|
|
|
5539
5539
|
"import:data:org:hardis"
|
|
5540
5540
|
]
|
|
5541
5541
|
},
|
|
5542
|
-
"hardis:org:
|
|
5542
|
+
"hardis:org:files:export": {
|
|
5543
5543
|
"aliases": [],
|
|
5544
5544
|
"args": {},
|
|
5545
|
-
"description": "
|
|
5545
|
+
"description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, output naming conventions, and file size filtering.\n- **File Size Filtering:** Supports minimum file size filtering via the `fileSizeMin` configuration parameter (in KB). Files smaller than the specified size will be skipped during export.\n- **File Validation:** After downloading each file, validates the integrity by:\n - **Checksum Validation:** For ContentVersion files, compares MD5 checksum with Salesforce's stored checksum\n - **Size Validation:** For both ContentVersion and Attachment files, verifies actual file size matches expected size\n - **Status Tracking:** Files are categorized with specific statuses: `success` (valid files), `failed` (download errors), `skipped` (filtered files), `invalid` (downloaded but failed validation)\n - All validation results are logged in the CSV export log for audit purposes\n- **Resume/Restart Capability:** \n - **Resume Mode:** When `--resume` flag is used (default in CI environments), checks existing downloaded files for validity. Valid files are skipped, invalid files are re-downloaded.\n - **Restart Mode:** When resume is disabled, clears the output folder and starts a fresh export.\n - **Interactive Mode:** When existing files are found and `--resume` is not explicitly specified (non-CI environments), prompts the user to choose between resume or restart.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesExporter Class:** The core logic is encapsulated within the `FilesExporter` class, which orchestrates the entire export process.\n- **SOQL Queries (Bulk API):** It uses Salesforce Bulk API queries to efficiently retrieve large volumes of parent record IDs and file metadata, including checksums and file sizes.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File Validation:** After each successful download, validates file integrity by comparing checksums (ContentVersion) and file sizes (both ContentVersion and Attachment) against Salesforce metadata.\n- **Resume Logic:** In resume mode, checks for existing files before downloading, validates their integrity, and only re-downloads invalid or missing files. This enables efficient recovery from interrupted exports.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project, `promptFilesExportConfiguration` for customizing export options, and prompts for resume/restart choice when existing files are found.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues, API limits, and file validation failures. Each file is assigned a specific status (`success`, `failed`, `skipped`, `invalid`) for comprehensive tracking and troubleshooting.\n</details>\n",
|
|
5546
5546
|
"examples": [
|
|
5547
|
-
"$ sf hardis:org:
|
|
5548
|
-
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
|
|
5549
|
-
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
|
|
5550
|
-
"$ sf hardis:org:diagnose:audittrail --lastndays 5"
|
|
5547
|
+
"$ sf hardis:org:files:export"
|
|
5551
5548
|
],
|
|
5552
5549
|
"flags": {
|
|
5553
5550
|
"json": {
|
|
@@ -5565,30 +5562,48 @@
|
|
|
5565
5562
|
"multiple": false,
|
|
5566
5563
|
"type": "option"
|
|
5567
5564
|
},
|
|
5568
|
-
"
|
|
5569
|
-
"char": "
|
|
5570
|
-
"description": "
|
|
5571
|
-
"name": "
|
|
5565
|
+
"path": {
|
|
5566
|
+
"char": "p",
|
|
5567
|
+
"description": "Path to the file export project",
|
|
5568
|
+
"name": "path",
|
|
5572
5569
|
"hasDynamicHelp": false,
|
|
5573
5570
|
"multiple": false,
|
|
5574
5571
|
"type": "option"
|
|
5575
5572
|
},
|
|
5576
|
-
"
|
|
5573
|
+
"chunksize": {
|
|
5574
|
+
"char": "c",
|
|
5575
|
+
"description": "Number of records to add in a chunk before it is processed",
|
|
5576
|
+
"name": "chunksize",
|
|
5577
|
+
"default": 1000,
|
|
5578
|
+
"hasDynamicHelp": false,
|
|
5579
|
+
"multiple": false,
|
|
5580
|
+
"type": "option"
|
|
5581
|
+
},
|
|
5582
|
+
"polltimeout": {
|
|
5577
5583
|
"char": "t",
|
|
5578
|
-
"description": "
|
|
5579
|
-
"name": "
|
|
5584
|
+
"description": "Timeout in MS for Bulk API calls",
|
|
5585
|
+
"name": "polltimeout",
|
|
5586
|
+
"default": 300000,
|
|
5580
5587
|
"hasDynamicHelp": false,
|
|
5581
5588
|
"multiple": false,
|
|
5582
5589
|
"type": "option"
|
|
5583
5590
|
},
|
|
5584
|
-
"
|
|
5585
|
-
"char": "
|
|
5586
|
-
"description": "
|
|
5587
|
-
"name": "
|
|
5591
|
+
"startchunknumber": {
|
|
5592
|
+
"char": "s",
|
|
5593
|
+
"description": "Chunk number to start from",
|
|
5594
|
+
"name": "startchunknumber",
|
|
5595
|
+
"default": 0,
|
|
5588
5596
|
"hasDynamicHelp": false,
|
|
5589
5597
|
"multiple": false,
|
|
5590
5598
|
"type": "option"
|
|
5591
5599
|
},
|
|
5600
|
+
"resume": {
|
|
5601
|
+
"char": "r",
|
|
5602
|
+
"description": "Resume previous export by checking existing files (default in CI)",
|
|
5603
|
+
"name": "resume",
|
|
5604
|
+
"allowNo": false,
|
|
5605
|
+
"type": "boolean"
|
|
5606
|
+
},
|
|
5592
5607
|
"debug": {
|
|
5593
5608
|
"char": "d",
|
|
5594
5609
|
"description": "Activate debug mode (more logs)",
|
|
@@ -5627,13 +5642,13 @@
|
|
|
5627
5642
|
},
|
|
5628
5643
|
"hasDynamicHelp": true,
|
|
5629
5644
|
"hiddenAliases": [],
|
|
5630
|
-
"id": "hardis:org:
|
|
5645
|
+
"id": "hardis:org:files:export",
|
|
5631
5646
|
"pluginAlias": "sfdx-hardis",
|
|
5632
5647
|
"pluginName": "sfdx-hardis",
|
|
5633
5648
|
"pluginType": "core",
|
|
5634
5649
|
"strict": true,
|
|
5635
5650
|
"enableJsonFlag": true,
|
|
5636
|
-
"title": "
|
|
5651
|
+
"title": "Export files",
|
|
5637
5652
|
"requiresProject": false,
|
|
5638
5653
|
"isESM": true,
|
|
5639
5654
|
"relativePath": [
|
|
@@ -5641,43 +5656,43 @@
|
|
|
5641
5656
|
"commands",
|
|
5642
5657
|
"hardis",
|
|
5643
5658
|
"org",
|
|
5644
|
-
"
|
|
5645
|
-
"
|
|
5659
|
+
"files",
|
|
5660
|
+
"export.js"
|
|
5646
5661
|
],
|
|
5647
5662
|
"aliasPermutations": [],
|
|
5648
5663
|
"permutations": [
|
|
5649
|
-
"hardis:org:
|
|
5650
|
-
"org:hardis:
|
|
5651
|
-
"org:
|
|
5652
|
-
"org:
|
|
5653
|
-
"hardis:
|
|
5654
|
-
"
|
|
5655
|
-
"
|
|
5656
|
-
"
|
|
5657
|
-
"hardis:
|
|
5658
|
-
"
|
|
5659
|
-
"
|
|
5660
|
-
"
|
|
5661
|
-
"hardis:org:
|
|
5662
|
-
"org:hardis:
|
|
5663
|
-
"org:
|
|
5664
|
-
"org:
|
|
5665
|
-
"hardis:
|
|
5666
|
-
"
|
|
5667
|
-
"
|
|
5668
|
-
"
|
|
5669
|
-
"hardis:
|
|
5670
|
-
"
|
|
5671
|
-
"
|
|
5672
|
-
"
|
|
5664
|
+
"hardis:org:files:export",
|
|
5665
|
+
"org:hardis:files:export",
|
|
5666
|
+
"org:files:hardis:export",
|
|
5667
|
+
"org:files:export:hardis",
|
|
5668
|
+
"hardis:files:org:export",
|
|
5669
|
+
"files:hardis:org:export",
|
|
5670
|
+
"files:org:hardis:export",
|
|
5671
|
+
"files:org:export:hardis",
|
|
5672
|
+
"hardis:files:export:org",
|
|
5673
|
+
"files:hardis:export:org",
|
|
5674
|
+
"files:export:hardis:org",
|
|
5675
|
+
"files:export:org:hardis",
|
|
5676
|
+
"hardis:org:export:files",
|
|
5677
|
+
"org:hardis:export:files",
|
|
5678
|
+
"org:export:hardis:files",
|
|
5679
|
+
"org:export:files:hardis",
|
|
5680
|
+
"hardis:export:org:files",
|
|
5681
|
+
"export:hardis:org:files",
|
|
5682
|
+
"export:org:hardis:files",
|
|
5683
|
+
"export:org:files:hardis",
|
|
5684
|
+
"hardis:export:files:org",
|
|
5685
|
+
"export:hardis:files:org",
|
|
5686
|
+
"export:files:hardis:org",
|
|
5687
|
+
"export:files:org:hardis"
|
|
5673
5688
|
]
|
|
5674
5689
|
},
|
|
5675
|
-
"hardis:org:
|
|
5690
|
+
"hardis:org:files:import": {
|
|
5676
5691
|
"aliases": [],
|
|
5677
5692
|
"args": {},
|
|
5678
|
-
"description": "\
|
|
5693
|
+
"description": "\nThis command facilitates the mass upload of files into Salesforce, allowing you to populate records with associated documents, images, or other file types. It's a crucial tool for data migration, content seeding, or synchronizing external file repositories with Salesforce.\n\nKey functionalities:\n\n- **Configuration-Driven Import:** Relies on an `export.json` file within a designated file export project (created using `sf hardis:org:configure:files`) to determine which files to import and how they should be associated with Salesforce records.\n- **Interactive Project Selection:** If the file import project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Overwrite Option:** The `--overwrite` flag allows you to replace existing files in Salesforce with local versions that have the same name. Be aware that this option doubles the number of API calls used.\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for how to export files, which is often a prerequisite for importing:\n\n[](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **FilesImporter Class:** The core logic is encapsulated within the `FilesImporter` class, which orchestrates the entire import process.\n- **File System Scan:** Scans the local file system within the configured project directory to identify files for import.\n- **Salesforce API Interaction:** Uses Salesforce APIs (e.g., ContentVersion, Attachment) to upload files and associate them with records.\n- **Configuration Loading:** Reads the `export.json` file to get the import configuration, including SOQL queries to identify parent records for file association.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file import project and `prompts` for confirming the overwrite behavior.\n- **Error Handling:** Includes mechanisms to handle potential errors during the import process, such as API limits or file upload failures.\n</details>\n",
|
|
5679
5694
|
"examples": [
|
|
5680
|
-
"$ sf hardis:org:
|
|
5695
|
+
"$ sf hardis:org:files:import"
|
|
5681
5696
|
],
|
|
5682
5697
|
"flags": {
|
|
5683
5698
|
"json": {
|
|
@@ -5695,15 +5710,30 @@
|
|
|
5695
5710
|
"multiple": false,
|
|
5696
5711
|
"type": "option"
|
|
5697
5712
|
},
|
|
5698
|
-
"
|
|
5699
|
-
"char": "
|
|
5700
|
-
"description": "
|
|
5701
|
-
"name": "
|
|
5702
|
-
"
|
|
5703
|
-
"
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5713
|
+
"path": {
|
|
5714
|
+
"char": "p",
|
|
5715
|
+
"description": "Path to the file export project",
|
|
5716
|
+
"name": "path",
|
|
5717
|
+
"hasDynamicHelp": false,
|
|
5718
|
+
"multiple": false,
|
|
5719
|
+
"type": "option"
|
|
5720
|
+
},
|
|
5721
|
+
"overwrite": {
|
|
5722
|
+
"char": "f",
|
|
5723
|
+
"description": "Override existing files (doubles the number of API calls)",
|
|
5724
|
+
"name": "overwrite",
|
|
5725
|
+
"allowNo": false,
|
|
5726
|
+
"type": "boolean"
|
|
5727
|
+
},
|
|
5728
|
+
"debug": {
|
|
5729
|
+
"char": "d",
|
|
5730
|
+
"description": "Activate debug mode (more logs)",
|
|
5731
|
+
"name": "debug",
|
|
5732
|
+
"allowNo": false,
|
|
5733
|
+
"type": "boolean"
|
|
5734
|
+
},
|
|
5735
|
+
"websocket": {
|
|
5736
|
+
"description": "Websocket host:port for VsCode SFDX Hardis UI integration",
|
|
5707
5737
|
"name": "websocket",
|
|
5708
5738
|
"hasDynamicHelp": false,
|
|
5709
5739
|
"multiple": false,
|
|
@@ -5733,13 +5763,13 @@
|
|
|
5733
5763
|
},
|
|
5734
5764
|
"hasDynamicHelp": true,
|
|
5735
5765
|
"hiddenAliases": [],
|
|
5736
|
-
"id": "hardis:org:
|
|
5766
|
+
"id": "hardis:org:files:import",
|
|
5737
5767
|
"pluginAlias": "sfdx-hardis",
|
|
5738
5768
|
"pluginName": "sfdx-hardis",
|
|
5739
5769
|
"pluginType": "core",
|
|
5740
5770
|
"strict": true,
|
|
5741
5771
|
"enableJsonFlag": true,
|
|
5742
|
-
"title": "
|
|
5772
|
+
"title": "Import files",
|
|
5743
5773
|
"requiresProject": false,
|
|
5744
5774
|
"isESM": true,
|
|
5745
5775
|
"relativePath": [
|
|
@@ -5747,46 +5777,44 @@
|
|
|
5747
5777
|
"commands",
|
|
5748
5778
|
"hardis",
|
|
5749
5779
|
"org",
|
|
5750
|
-
"
|
|
5751
|
-
"
|
|
5780
|
+
"files",
|
|
5781
|
+
"import.js"
|
|
5752
5782
|
],
|
|
5753
5783
|
"aliasPermutations": [],
|
|
5754
5784
|
"permutations": [
|
|
5755
|
-
"hardis:org:
|
|
5756
|
-
"org:hardis:
|
|
5757
|
-
"org:
|
|
5758
|
-
"org:
|
|
5759
|
-
"hardis:
|
|
5760
|
-
"
|
|
5761
|
-
"
|
|
5762
|
-
"
|
|
5763
|
-
"hardis:
|
|
5764
|
-
"
|
|
5765
|
-
"
|
|
5766
|
-
"
|
|
5767
|
-
"hardis:org:
|
|
5768
|
-
"org:hardis:
|
|
5769
|
-
"org:
|
|
5770
|
-
"org:
|
|
5771
|
-
"hardis:
|
|
5772
|
-
"
|
|
5773
|
-
"
|
|
5774
|
-
"
|
|
5775
|
-
"hardis:
|
|
5776
|
-
"
|
|
5777
|
-
"
|
|
5778
|
-
"
|
|
5785
|
+
"hardis:org:files:import",
|
|
5786
|
+
"org:hardis:files:import",
|
|
5787
|
+
"org:files:hardis:import",
|
|
5788
|
+
"org:files:import:hardis",
|
|
5789
|
+
"hardis:files:org:import",
|
|
5790
|
+
"files:hardis:org:import",
|
|
5791
|
+
"files:org:hardis:import",
|
|
5792
|
+
"files:org:import:hardis",
|
|
5793
|
+
"hardis:files:import:org",
|
|
5794
|
+
"files:hardis:import:org",
|
|
5795
|
+
"files:import:hardis:org",
|
|
5796
|
+
"files:import:org:hardis",
|
|
5797
|
+
"hardis:org:import:files",
|
|
5798
|
+
"org:hardis:import:files",
|
|
5799
|
+
"org:import:hardis:files",
|
|
5800
|
+
"org:import:files:hardis",
|
|
5801
|
+
"hardis:import:org:files",
|
|
5802
|
+
"import:hardis:org:files",
|
|
5803
|
+
"import:org:hardis:files",
|
|
5804
|
+
"import:org:files:hardis",
|
|
5805
|
+
"hardis:import:files:org",
|
|
5806
|
+
"import:hardis:files:org",
|
|
5807
|
+
"import:files:hardis:org",
|
|
5808
|
+
"import:files:org:hardis"
|
|
5779
5809
|
]
|
|
5780
5810
|
},
|
|
5781
|
-
"hardis:org:
|
|
5811
|
+
"hardis:org:fix:listviewmine": {
|
|
5782
5812
|
"aliases": [],
|
|
5783
5813
|
"args": {},
|
|
5784
|
-
"description": "
|
|
5814
|
+
"description": "Fix listviews whose scope Mine has been replaced by Everything\n\n[](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",
|
|
5785
5815
|
"examples": [
|
|
5786
|
-
"$ sf hardis:org:
|
|
5787
|
-
"$ sf hardis:org:
|
|
5788
|
-
"$ sf hardis:org:diagnose:legacyapi --outputfile 'c:/path/to/folder/legacyapi.csv'",
|
|
5789
|
-
"$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv"
|
|
5816
|
+
"$ sf hardis:org:fix:listviewmine",
|
|
5817
|
+
"$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
|
|
5790
5818
|
],
|
|
5791
5819
|
"flags": {
|
|
5792
5820
|
"json": {
|
|
@@ -5804,28 +5832,10 @@
|
|
|
5804
5832
|
"multiple": false,
|
|
5805
5833
|
"type": "option"
|
|
5806
5834
|
},
|
|
5807
|
-
"
|
|
5808
|
-
"char": "e",
|
|
5809
|
-
"description": "Type of EventLogFile event to analyze",
|
|
5810
|
-
"name": "eventtype",
|
|
5811
|
-
"default": "ApiTotalUsage",
|
|
5812
|
-
"hasDynamicHelp": false,
|
|
5813
|
-
"multiple": false,
|
|
5814
|
-
"type": "option"
|
|
5815
|
-
},
|
|
5816
|
-
"limit": {
|
|
5835
|
+
"listviews": {
|
|
5817
5836
|
"char": "l",
|
|
5818
|
-
"description": "
|
|
5819
|
-
"name": "
|
|
5820
|
-
"default": 999,
|
|
5821
|
-
"hasDynamicHelp": false,
|
|
5822
|
-
"multiple": false,
|
|
5823
|
-
"type": "option"
|
|
5824
|
-
},
|
|
5825
|
-
"outputfile": {
|
|
5826
|
-
"char": "f",
|
|
5827
|
-
"description": "Force the path and name of output report file. Must end with .csv",
|
|
5828
|
-
"name": "outputfile",
|
|
5837
|
+
"description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
|
|
5838
|
+
"name": "listviews",
|
|
5829
5839
|
"hasDynamicHelp": false,
|
|
5830
5840
|
"multiple": false,
|
|
5831
5841
|
"type": "option"
|
|
@@ -5868,57 +5878,60 @@
|
|
|
5868
5878
|
},
|
|
5869
5879
|
"hasDynamicHelp": true,
|
|
5870
5880
|
"hiddenAliases": [],
|
|
5871
|
-
"id": "hardis:org:
|
|
5881
|
+
"id": "hardis:org:fix:listviewmine",
|
|
5872
5882
|
"pluginAlias": "sfdx-hardis",
|
|
5873
5883
|
"pluginName": "sfdx-hardis",
|
|
5874
5884
|
"pluginType": "core",
|
|
5875
5885
|
"strict": true,
|
|
5876
5886
|
"enableJsonFlag": true,
|
|
5877
|
-
"title": "
|
|
5878
|
-
"requiresProject":
|
|
5887
|
+
"title": "Fix listviews with ",
|
|
5888
|
+
"requiresProject": true,
|
|
5879
5889
|
"isESM": true,
|
|
5880
5890
|
"relativePath": [
|
|
5881
5891
|
"lib",
|
|
5882
5892
|
"commands",
|
|
5883
5893
|
"hardis",
|
|
5884
5894
|
"org",
|
|
5885
|
-
"
|
|
5886
|
-
"
|
|
5895
|
+
"fix",
|
|
5896
|
+
"listviewmine.js"
|
|
5887
5897
|
],
|
|
5888
5898
|
"aliasPermutations": [],
|
|
5889
5899
|
"permutations": [
|
|
5890
|
-
"hardis:org:
|
|
5891
|
-
"org:hardis:
|
|
5892
|
-
"org:
|
|
5893
|
-
"org:
|
|
5894
|
-
"hardis:
|
|
5895
|
-
"
|
|
5896
|
-
"
|
|
5897
|
-
"
|
|
5898
|
-
"hardis:
|
|
5899
|
-
"
|
|
5900
|
-
"
|
|
5901
|
-
"
|
|
5902
|
-
"hardis:org:
|
|
5903
|
-
"org:hardis:
|
|
5904
|
-
"org:
|
|
5905
|
-
"org:
|
|
5906
|
-
"hardis:
|
|
5907
|
-
"
|
|
5908
|
-
"
|
|
5909
|
-
"
|
|
5910
|
-
"hardis:
|
|
5911
|
-
"
|
|
5912
|
-
"
|
|
5913
|
-
"
|
|
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"
|
|
5914
5924
|
]
|
|
5915
5925
|
},
|
|
5916
|
-
"hardis:org:diagnose:
|
|
5926
|
+
"hardis:org:diagnose:audittrail": {
|
|
5917
5927
|
"aliases": [],
|
|
5918
5928
|
"args": {},
|
|
5919
|
-
"description": "
|
|
5929
|
+
"description": "Export Audit trail into a CSV file with selected criteria, and highlight suspect actions\n\nAlso detects updates of Custom Settings values (disable by defining `SKIP_AUDIT_TRAIL_CUSTOM_SETTINGS=true`)\n\nRegular setup actions performed in major orgs are filtered.\n\n- \"\"\n - createScratchOrg\n - changedsenderemail\n - deleteScratchOrg\n - loginasgrantedtopartnerbt\n- Certificate and Key Management\n - insertCertificate\n- Custom App Licenses\n - addeduserpackagelicense\n - granteduserpackagelicense\n - revokeduserpackagelicense\n- Customer Portal\n - createdcustomersuccessuser\n - CSPUserDisabled\n- Currency\n - updateddatedexchrate\n- Data Management\n - queueMembership\n- Email Administration\n - dkimRotationPreparationSuccessful\n - dkimRotationSuccessful\n- External Objects\n - xdsEncryptedFieldChange\n- Groups\n - groupMembership\n- Holidays\n - holiday_insert\n- Inbox mobile and legacy desktop apps\n - enableSIQUserNonEAC\n - siqUserAcceptedTOS\n- Manage Users\n - activateduser\n - createduser\n - changedcommunitynickname\n - changedemail\n - changedfederationid\n - changedpassword\n - changedinteractionuseroffon\n - changedinteractionuseronoff\n - changedmarketinguseroffon\n - changedmarketinguseronoff\n - changedofflineuseroffon\n - changedprofileforuserstdtostd\n - changedprofileforuser\n - changedprofileforusercusttostd\n - changedprofileforuserstdtocust\n - changedroleforusertonone\n - changedroleforuser\n - changedroleforuserfromnone\n - changedUserAdminVerifiedStatusVerified\n - changedUserEmailVerifiedStatusUnverified\n - changedUserEmailVerifiedStatusVerified\n - changedknowledgeuseroffon\n - changedsfcontentuseroffon\n - changedsupportuseroffon\n - changedusername\n - changedUserPhoneNumber\n - changedUserPhoneVerifiedStatusUnverified\n - changedUserPhoneVerifiedStatusVerified\n - deactivateduser\n - deleteAuthenticatorPairing\n - deleteTwoFactorInfo2\n - deleteTwoFactorTempCode\n - frozeuser\n - insertAuthenticatorPairing\n - insertTwoFactorInfo2\n - insertTwoFactorTempCode\n - lightningloginenroll\n - PermSetAssign\n - PermSetGroupAssign\n - PermSetGroupUnassign\n - PermSetLicenseAssign\n - PermSetUnassign\n - PermSetLicenseUnassign\n - registeredUserPhoneNumber\n - resetpassword\n - suNetworkAdminLogin\n - suNetworkAdminLogout\n - suOrgAdminLogin\n - suOrgAdminLogout\n - unfrozeuser\n - useremailchangesent\n- Mobile Administration\n - assigneduserstomobileconfig\n- Reporting Snapshots\n - createdReportJob\n - deletedReportJob\n- Sandboxes\n - DeleteSandbox\n\nBy default, deployment user defined in .sfdx-hardis.yml targetUsername property will be excluded.\n\nYou can define additional users to exclude in .sfdx-hardis.yml **monitoringExcludeUsernames** property.\n\nYou can also add more sections / actions considered as not suspect using property **monitoringAllowedSectionsActions**\n\nExample:\n\n```yaml\nmonitoringExcludeUsernames:\n - deploymentuser@cloudity.com\n - marketingcloud@cloudity.com\n - integration-user@cloudity.com\n\nmonitoringAllowedSectionsActions:\n \"Some section\": [] // Will ignore all actions from such section\n \"Some other section\": [\"actionType1\",\"actionType2\",\"actionType3\"] // Will ignore only those 3 actions from section \"Some other section\". Other actions in the same section will be considered as suspect.\n```\n\n## Excel output example\n\n\n\n## Local output example\n\n\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-suspect-audit-trail/) and can output Grafana, Slack and MsTeams Notifications.\n",
|
|
5920
5930
|
"examples": [
|
|
5921
|
-
"$ sf hardis:org:diagnose:
|
|
5931
|
+
"$ sf hardis:org:diagnose:audittrail",
|
|
5932
|
+
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
|
|
5933
|
+
"$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
|
|
5934
|
+
"$ sf hardis:org:diagnose:audittrail --lastndays 5"
|
|
5922
5935
|
],
|
|
5923
5936
|
"flags": {
|
|
5924
5937
|
"json": {
|
|
@@ -5936,6 +5949,22 @@
|
|
|
5936
5949
|
"multiple": false,
|
|
5937
5950
|
"type": "option"
|
|
5938
5951
|
},
|
|
5952
|
+
"excludeusers": {
|
|
5953
|
+
"char": "e",
|
|
5954
|
+
"description": "Comma-separated list of usernames to exclude",
|
|
5955
|
+
"name": "excludeusers",
|
|
5956
|
+
"hasDynamicHelp": false,
|
|
5957
|
+
"multiple": false,
|
|
5958
|
+
"type": "option"
|
|
5959
|
+
},
|
|
5960
|
+
"lastndays": {
|
|
5961
|
+
"char": "t",
|
|
5962
|
+
"description": "Number of days to extract from today (included)",
|
|
5963
|
+
"name": "lastndays",
|
|
5964
|
+
"hasDynamicHelp": false,
|
|
5965
|
+
"multiple": false,
|
|
5966
|
+
"type": "option"
|
|
5967
|
+
},
|
|
5939
5968
|
"outputfile": {
|
|
5940
5969
|
"char": "f",
|
|
5941
5970
|
"description": "Force the path and name of output report file. Must end with .csv",
|
|
@@ -5944,13 +5973,6 @@
|
|
|
5944
5973
|
"multiple": false,
|
|
5945
5974
|
"type": "option"
|
|
5946
5975
|
},
|
|
5947
|
-
"usedonly": {
|
|
5948
|
-
"char": "u",
|
|
5949
|
-
"description": "Filter to have only used licenses",
|
|
5950
|
-
"name": "usedonly",
|
|
5951
|
-
"allowNo": false,
|
|
5952
|
-
"type": "boolean"
|
|
5953
|
-
},
|
|
5954
5976
|
"debug": {
|
|
5955
5977
|
"char": "d",
|
|
5956
5978
|
"description": "Activate debug mode (more logs)",
|
|
@@ -5989,13 +6011,13 @@
|
|
|
5989
6011
|
},
|
|
5990
6012
|
"hasDynamicHelp": true,
|
|
5991
6013
|
"hiddenAliases": [],
|
|
5992
|
-
"id": "hardis:org:diagnose:
|
|
6014
|
+
"id": "hardis:org:diagnose:audittrail",
|
|
5993
6015
|
"pluginAlias": "sfdx-hardis",
|
|
5994
6016
|
"pluginName": "sfdx-hardis",
|
|
5995
6017
|
"pluginType": "core",
|
|
5996
6018
|
"strict": true,
|
|
5997
6019
|
"enableJsonFlag": true,
|
|
5998
|
-
"title": "
|
|
6020
|
+
"title": "Diagnose content of Setup Audit Trail",
|
|
5999
6021
|
"requiresProject": false,
|
|
6000
6022
|
"isESM": true,
|
|
6001
6023
|
"relativePath": [
|
|
@@ -6004,63 +6026,55 @@
|
|
|
6004
6026
|
"hardis",
|
|
6005
6027
|
"org",
|
|
6006
6028
|
"diagnose",
|
|
6007
|
-
"
|
|
6029
|
+
"audittrail.js"
|
|
6008
6030
|
],
|
|
6009
6031
|
"aliasPermutations": [],
|
|
6010
6032
|
"permutations": [
|
|
6011
|
-
"hardis:org:diagnose:
|
|
6012
|
-
"org:hardis:diagnose:
|
|
6013
|
-
"org:diagnose:hardis:
|
|
6014
|
-
"org:diagnose:
|
|
6015
|
-
"hardis:diagnose:org:
|
|
6016
|
-
"diagnose:hardis:org:
|
|
6017
|
-
"diagnose:org:hardis:
|
|
6018
|
-
"diagnose:org:
|
|
6019
|
-
"hardis:diagnose:
|
|
6020
|
-
"diagnose:hardis:
|
|
6021
|
-
"diagnose:
|
|
6022
|
-
"diagnose:
|
|
6023
|
-
"hardis:org:
|
|
6024
|
-
"org:hardis:
|
|
6025
|
-
"org:
|
|
6026
|
-
"org:
|
|
6027
|
-
"hardis:
|
|
6028
|
-
"
|
|
6029
|
-
"
|
|
6030
|
-
"
|
|
6031
|
-
"hardis:
|
|
6032
|
-
"
|
|
6033
|
-
"
|
|
6034
|
-
"
|
|
6035
|
-
]
|
|
6036
|
-
},
|
|
6037
|
-
"hardis:org:diagnose:
|
|
6038
|
-
"aliases": [],
|
|
6039
|
-
"args": {},
|
|
6040
|
-
"description": "
|
|
6041
|
-
"examples": [
|
|
6042
|
-
"$ sf hardis:org:diagnose:
|
|
6043
|
-
],
|
|
6044
|
-
"flags": {
|
|
6045
|
-
"json": {
|
|
6046
|
-
"description": "Format output as json.",
|
|
6047
|
-
"helpGroup": "GLOBAL",
|
|
6048
|
-
"name": "json",
|
|
6049
|
-
"allowNo": false,
|
|
6050
|
-
"type": "boolean"
|
|
6051
|
-
},
|
|
6052
|
-
"flags-dir": {
|
|
6053
|
-
"helpGroup": "GLOBAL",
|
|
6054
|
-
"name": "flags-dir",
|
|
6055
|
-
"summary": "Import flag values from a directory.",
|
|
6056
|
-
"hasDynamicHelp": false,
|
|
6057
|
-
"multiple": false,
|
|
6058
|
-
"type": "option"
|
|
6033
|
+
"hardis:org:diagnose:audittrail",
|
|
6034
|
+
"org:hardis:diagnose:audittrail",
|
|
6035
|
+
"org:diagnose:hardis:audittrail",
|
|
6036
|
+
"org:diagnose:audittrail:hardis",
|
|
6037
|
+
"hardis:diagnose:org:audittrail",
|
|
6038
|
+
"diagnose:hardis:org:audittrail",
|
|
6039
|
+
"diagnose:org:hardis:audittrail",
|
|
6040
|
+
"diagnose:org:audittrail:hardis",
|
|
6041
|
+
"hardis:diagnose:audittrail:org",
|
|
6042
|
+
"diagnose:hardis:audittrail:org",
|
|
6043
|
+
"diagnose:audittrail:hardis:org",
|
|
6044
|
+
"diagnose:audittrail:org:hardis",
|
|
6045
|
+
"hardis:org:audittrail:diagnose",
|
|
6046
|
+
"org:hardis:audittrail:diagnose",
|
|
6047
|
+
"org:audittrail:hardis:diagnose",
|
|
6048
|
+
"org:audittrail:diagnose:hardis",
|
|
6049
|
+
"hardis:audittrail:org:diagnose",
|
|
6050
|
+
"audittrail:hardis:org:diagnose",
|
|
6051
|
+
"audittrail:org:hardis:diagnose",
|
|
6052
|
+
"audittrail:org:diagnose:hardis",
|
|
6053
|
+
"hardis:audittrail:diagnose:org",
|
|
6054
|
+
"audittrail:hardis:diagnose:org",
|
|
6055
|
+
"audittrail:diagnose:hardis:org",
|
|
6056
|
+
"audittrail:diagnose:org:hardis"
|
|
6057
|
+
]
|
|
6058
|
+
},
|
|
6059
|
+
"hardis:org:diagnose:instanceupgrade": {
|
|
6060
|
+
"aliases": [],
|
|
6061
|
+
"args": {},
|
|
6062
|
+
"description": "\n## Command Behavior\n\n**Retrieves and displays the scheduled upgrade date for a Salesforce org's instance.**\n\nThis command provides crucial information about when your Salesforce instance will be upgraded to the next major release (Spring, Summer, or Winter). This is vital for release planning, testing, and ensuring compatibility with upcoming Salesforce features.\n\nKey functionalities:\n\n- **Instance Identification:** Determines the Salesforce instance name of your target org.\n- **Upgrade Date Retrieval:** Fetches the planned start time of the next major core service upgrade for that instance from the Salesforce Status API.\n- **Days Until Upgrade:** Calculates and displays the number of days remaining until the next major upgrade.\n- **Severity-Based Logging:** Adjusts the log severity (info, warning) based on the proximity of the upgrade date, providing a visual cue for urgency.\n- **Notifications:** Sends notifications to configured channels (e.g., Slack, MS Teams, Grafana) with the upgrade information, making it suitable for automated monitoring.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Query:** It first queries the `Organization` object in Salesforce to get the `InstanceName` of the target org.\n- **Salesforce Status API Integration:** It makes an HTTP GET request to the Salesforce Status API (`https://api.status.salesforce.com/v1/instances/{instanceName}/status`) to retrieve detailed information about the instance, including scheduled maintenances.\n- **Data Parsing:** It parses the JSON response from the Status API to extract the relevant major release upgrade information.\n- **Date Calculation:** Uses the `moment` library to calculate the difference in days between the current date and the planned upgrade date.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including the instance name, upgrade date, and days remaining, along with relevant metrics for monitoring dashboards.\n- **User Feedback:** Provides clear messages to the user about the upgrade status and proximity.\n</details>\n",
|
|
6063
|
+
"examples": [
|
|
6064
|
+
"$ sf hardis:org:diagnose:instanceupgrade"
|
|
6065
|
+
],
|
|
6066
|
+
"flags": {
|
|
6067
|
+
"json": {
|
|
6068
|
+
"description": "Format output as json.",
|
|
6069
|
+
"helpGroup": "GLOBAL",
|
|
6070
|
+
"name": "json",
|
|
6071
|
+
"allowNo": false,
|
|
6072
|
+
"type": "boolean"
|
|
6059
6073
|
},
|
|
6060
|
-
"
|
|
6061
|
-
"
|
|
6062
|
-
"
|
|
6063
|
-
"
|
|
6074
|
+
"flags-dir": {
|
|
6075
|
+
"helpGroup": "GLOBAL",
|
|
6076
|
+
"name": "flags-dir",
|
|
6077
|
+
"summary": "Import flag values from a directory.",
|
|
6064
6078
|
"hasDynamicHelp": false,
|
|
6065
6079
|
"multiple": false,
|
|
6066
6080
|
"type": "option"
|
|
@@ -6103,13 +6117,13 @@
|
|
|
6103
6117
|
},
|
|
6104
6118
|
"hasDynamicHelp": true,
|
|
6105
6119
|
"hiddenAliases": [],
|
|
6106
|
-
"id": "hardis:org:diagnose:
|
|
6120
|
+
"id": "hardis:org:diagnose:instanceupgrade",
|
|
6107
6121
|
"pluginAlias": "sfdx-hardis",
|
|
6108
6122
|
"pluginName": "sfdx-hardis",
|
|
6109
6123
|
"pluginType": "core",
|
|
6110
6124
|
"strict": true,
|
|
6111
6125
|
"enableJsonFlag": true,
|
|
6112
|
-
"title": "
|
|
6126
|
+
"title": "Get Instance Upgrade date",
|
|
6113
6127
|
"requiresProject": false,
|
|
6114
6128
|
"isESM": true,
|
|
6115
6129
|
"relativePath": [
|
|
@@ -6118,47 +6132,45 @@
|
|
|
6118
6132
|
"hardis",
|
|
6119
6133
|
"org",
|
|
6120
6134
|
"diagnose",
|
|
6121
|
-
"
|
|
6135
|
+
"instanceupgrade.js"
|
|
6122
6136
|
],
|
|
6123
6137
|
"aliasPermutations": [],
|
|
6124
6138
|
"permutations": [
|
|
6125
|
-
"hardis:org:diagnose:
|
|
6126
|
-
"org:hardis:diagnose:
|
|
6127
|
-
"org:diagnose:hardis:
|
|
6128
|
-
"org:diagnose:
|
|
6129
|
-
"hardis:diagnose:org:
|
|
6130
|
-
"diagnose:hardis:org:
|
|
6131
|
-
"diagnose:org:hardis:
|
|
6132
|
-
"diagnose:org:
|
|
6133
|
-
"hardis:diagnose:
|
|
6134
|
-
"diagnose:hardis:
|
|
6135
|
-
"diagnose:
|
|
6136
|
-
"diagnose:
|
|
6137
|
-
"hardis:org:
|
|
6138
|
-
"org:hardis:
|
|
6139
|
-
"org:
|
|
6140
|
-
"org:
|
|
6141
|
-
"hardis:
|
|
6142
|
-
"
|
|
6143
|
-
"
|
|
6144
|
-
"
|
|
6145
|
-
"hardis:
|
|
6146
|
-
"
|
|
6147
|
-
"
|
|
6148
|
-
"
|
|
6139
|
+
"hardis:org:diagnose:instanceupgrade",
|
|
6140
|
+
"org:hardis:diagnose:instanceupgrade",
|
|
6141
|
+
"org:diagnose:hardis:instanceupgrade",
|
|
6142
|
+
"org:diagnose:instanceupgrade:hardis",
|
|
6143
|
+
"hardis:diagnose:org:instanceupgrade",
|
|
6144
|
+
"diagnose:hardis:org:instanceupgrade",
|
|
6145
|
+
"diagnose:org:hardis:instanceupgrade",
|
|
6146
|
+
"diagnose:org:instanceupgrade:hardis",
|
|
6147
|
+
"hardis:diagnose:instanceupgrade:org",
|
|
6148
|
+
"diagnose:hardis:instanceupgrade:org",
|
|
6149
|
+
"diagnose:instanceupgrade:hardis:org",
|
|
6150
|
+
"diagnose:instanceupgrade:org:hardis",
|
|
6151
|
+
"hardis:org:instanceupgrade:diagnose",
|
|
6152
|
+
"org:hardis:instanceupgrade:diagnose",
|
|
6153
|
+
"org:instanceupgrade:hardis:diagnose",
|
|
6154
|
+
"org:instanceupgrade:diagnose:hardis",
|
|
6155
|
+
"hardis:instanceupgrade:org:diagnose",
|
|
6156
|
+
"instanceupgrade:hardis:org:diagnose",
|
|
6157
|
+
"instanceupgrade:org:hardis:diagnose",
|
|
6158
|
+
"instanceupgrade:org:diagnose:hardis",
|
|
6159
|
+
"hardis:instanceupgrade:diagnose:org",
|
|
6160
|
+
"instanceupgrade:hardis:diagnose:org",
|
|
6161
|
+
"instanceupgrade:diagnose:hardis:org",
|
|
6162
|
+
"instanceupgrade:diagnose:org:hardis"
|
|
6149
6163
|
]
|
|
6150
6164
|
},
|
|
6151
|
-
"hardis:org:diagnose:
|
|
6165
|
+
"hardis:org:diagnose:legacyapi": {
|
|
6152
6166
|
"aliases": [],
|
|
6153
6167
|
"args": {},
|
|
6154
|
-
"description": "
|
|
6168
|
+
"description": "Checks if an org uses retired or someday retired API version\n\n\nSee article below\n\n[](https://nicolas.vuillamy.fr/handle-salesforce-api-versions-deprecation-like-a-pro-335065f52238)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-deprecated-api-calls/) and can output Grafana, Slack and MsTeams Notifications.\n",
|
|
6155
6169
|
"examples": [
|
|
6156
|
-
"$ sf hardis:org:diagnose:
|
|
6157
|
-
"$ sf hardis:org:diagnose:
|
|
6158
|
-
"$ sf hardis:org:diagnose:
|
|
6159
|
-
"$ sf hardis:org:diagnose:
|
|
6160
|
-
"$ sf hardis:org:diagnose:storage-stats -w \"Status__c = 'Active'\"",
|
|
6161
|
-
"$ sf hardis:org:diagnose:storage-stats -b \"LastModifiedDate\" -w \"IsDeleted = false\""
|
|
6170
|
+
"$ sf hardis:org:diagnose:legacyapi",
|
|
6171
|
+
"$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com",
|
|
6172
|
+
"$ sf hardis:org:diagnose:legacyapi --outputfile 'c:/path/to/folder/legacyapi.csv'",
|
|
6173
|
+
"$ sf hardis:org:diagnose:legacyapi -u hardis@myclient.com --outputfile ./tmp/legacyapi.csv"
|
|
6162
6174
|
],
|
|
6163
6175
|
"flags": {
|
|
6164
6176
|
"json": {
|
|
@@ -6176,26 +6188,28 @@
|
|
|
6176
6188
|
"multiple": false,
|
|
6177
6189
|
"type": "option"
|
|
6178
6190
|
},
|
|
6179
|
-
"
|
|
6180
|
-
"char": "
|
|
6181
|
-
"description": "
|
|
6182
|
-
"name": "
|
|
6191
|
+
"eventtype": {
|
|
6192
|
+
"char": "e",
|
|
6193
|
+
"description": "Type of EventLogFile event to analyze",
|
|
6194
|
+
"name": "eventtype",
|
|
6195
|
+
"default": "ApiTotalUsage",
|
|
6183
6196
|
"hasDynamicHelp": false,
|
|
6184
6197
|
"multiple": false,
|
|
6185
6198
|
"type": "option"
|
|
6186
6199
|
},
|
|
6187
|
-
"
|
|
6188
|
-
"char": "
|
|
6189
|
-
"description": "
|
|
6190
|
-
"name": "
|
|
6200
|
+
"limit": {
|
|
6201
|
+
"char": "l",
|
|
6202
|
+
"description": "Number of latest EventLogFile events to analyze",
|
|
6203
|
+
"name": "limit",
|
|
6204
|
+
"default": 999,
|
|
6191
6205
|
"hasDynamicHelp": false,
|
|
6192
6206
|
"multiple": false,
|
|
6193
6207
|
"type": "option"
|
|
6194
6208
|
},
|
|
6195
|
-
"
|
|
6196
|
-
"char": "
|
|
6197
|
-
"description": "
|
|
6198
|
-
"name": "
|
|
6209
|
+
"outputfile": {
|
|
6210
|
+
"char": "f",
|
|
6211
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
6212
|
+
"name": "outputfile",
|
|
6199
6213
|
"hasDynamicHelp": false,
|
|
6200
6214
|
"multiple": false,
|
|
6201
6215
|
"type": "option"
|
|
@@ -6238,14 +6252,14 @@
|
|
|
6238
6252
|
},
|
|
6239
6253
|
"hasDynamicHelp": true,
|
|
6240
6254
|
"hiddenAliases": [],
|
|
6241
|
-
"id": "hardis:org:diagnose:
|
|
6255
|
+
"id": "hardis:org:diagnose:legacyapi",
|
|
6242
6256
|
"pluginAlias": "sfdx-hardis",
|
|
6243
6257
|
"pluginName": "sfdx-hardis",
|
|
6244
6258
|
"pluginType": "core",
|
|
6245
6259
|
"strict": true,
|
|
6246
6260
|
"enableJsonFlag": true,
|
|
6247
|
-
"title": "
|
|
6248
|
-
"requiresProject":
|
|
6261
|
+
"title": "Check for legacy API use",
|
|
6262
|
+
"requiresProject": false,
|
|
6249
6263
|
"isESM": true,
|
|
6250
6264
|
"relativePath": [
|
|
6251
6265
|
"lib",
|
|
@@ -6253,42 +6267,42 @@
|
|
|
6253
6267
|
"hardis",
|
|
6254
6268
|
"org",
|
|
6255
6269
|
"diagnose",
|
|
6256
|
-
"
|
|
6270
|
+
"legacyapi.js"
|
|
6257
6271
|
],
|
|
6258
6272
|
"aliasPermutations": [],
|
|
6259
6273
|
"permutations": [
|
|
6260
|
-
"hardis:org:diagnose:
|
|
6261
|
-
"org:hardis:diagnose:
|
|
6262
|
-
"org:diagnose:hardis:
|
|
6263
|
-
"org:diagnose:
|
|
6264
|
-
"hardis:diagnose:org:
|
|
6265
|
-
"diagnose:hardis:org:
|
|
6266
|
-
"diagnose:org:hardis:
|
|
6267
|
-
"diagnose:org:
|
|
6268
|
-
"hardis:diagnose:
|
|
6269
|
-
"diagnose:hardis:
|
|
6270
|
-
"diagnose:
|
|
6271
|
-
"diagnose:
|
|
6272
|
-
"hardis:org:
|
|
6273
|
-
"org:hardis:
|
|
6274
|
-
"org:
|
|
6275
|
-
"org:
|
|
6276
|
-
"hardis:
|
|
6277
|
-
"
|
|
6278
|
-
"
|
|
6279
|
-
"
|
|
6280
|
-
"hardis:
|
|
6281
|
-
"
|
|
6282
|
-
"
|
|
6283
|
-
"
|
|
6274
|
+
"hardis:org:diagnose:legacyapi",
|
|
6275
|
+
"org:hardis:diagnose:legacyapi",
|
|
6276
|
+
"org:diagnose:hardis:legacyapi",
|
|
6277
|
+
"org:diagnose:legacyapi:hardis",
|
|
6278
|
+
"hardis:diagnose:org:legacyapi",
|
|
6279
|
+
"diagnose:hardis:org:legacyapi",
|
|
6280
|
+
"diagnose:org:hardis:legacyapi",
|
|
6281
|
+
"diagnose:org:legacyapi:hardis",
|
|
6282
|
+
"hardis:diagnose:legacyapi:org",
|
|
6283
|
+
"diagnose:hardis:legacyapi:org",
|
|
6284
|
+
"diagnose:legacyapi:hardis:org",
|
|
6285
|
+
"diagnose:legacyapi:org:hardis",
|
|
6286
|
+
"hardis:org:legacyapi:diagnose",
|
|
6287
|
+
"org:hardis:legacyapi:diagnose",
|
|
6288
|
+
"org:legacyapi:hardis:diagnose",
|
|
6289
|
+
"org:legacyapi:diagnose:hardis",
|
|
6290
|
+
"hardis:legacyapi:org:diagnose",
|
|
6291
|
+
"legacyapi:hardis:org:diagnose",
|
|
6292
|
+
"legacyapi:org:hardis:diagnose",
|
|
6293
|
+
"legacyapi:org:diagnose:hardis",
|
|
6294
|
+
"hardis:legacyapi:diagnose:org",
|
|
6295
|
+
"legacyapi:hardis:diagnose:org",
|
|
6296
|
+
"legacyapi:diagnose:hardis:org",
|
|
6297
|
+
"legacyapi:diagnose:org:hardis"
|
|
6284
6298
|
]
|
|
6285
6299
|
},
|
|
6286
|
-
"hardis:org:diagnose:
|
|
6300
|
+
"hardis:org:diagnose:licenses": {
|
|
6287
6301
|
"aliases": [],
|
|
6288
6302
|
"args": {},
|
|
6289
|
-
"description": "\n
|
|
6303
|
+
"description": "\n**Lists and analyzes User Licenses and Permission Set Licenses subscribed and used in a Salesforce org.**\n\nThis command provides a comprehensive overview of your Salesforce license consumption. It's particularly useful for:\n\n- **License Management:** Understanding which licenses are active, how many are available, and how many are being used.\n- **Cost Optimization:** Identifying unused or underutilized licenses that could be reallocated or decommissioned.\n- **Compliance:** Ensuring that your organization is compliant with Salesforce licensing agreements.\n- **Monitoring:** Tracking license usage trends over time.\n\nKey functionalities:\n\n- **User License Details:** Retrieves information about standard and custom User Licenses, including `MasterLabel`, `Name`, `TotalLicenses`, and `UsedLicenses`.\n- **Permission Set License Details:** Retrieves information about Permission Set Licenses, including `MasterLabel`, `PermissionSetLicenseKey`, `TotalLicenses`, and `UsedLicenses`.\n- **Used Licenses Filter:** The `--usedonly` flag allows you to filter the report to show only licenses that have at least one `UsedLicenses` count greater than zero.\n- **CSV Report Generation:** Generates a CSV file containing all the retrieved license information, suitable for detailed analysis.\n- **Notifications:** Sends notifications to configured channels (e.g., Grafana, Slack, MS Teams) with a summary of license usage, including lists of active and used licenses.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Queries:** It executes SOQL queries against the `UserLicense` and `PermissionSetLicense` objects in Salesforce to retrieve license data.\n- **Data Transformation:** It processes the query results, reformatting the data to be more readable and consistent for reporting purposes (e.g., removing `Id` and `attributes`, renaming `PermissionSetLicenseKey` to `Name`).\n- **Data Aggregation:** It aggregates license information, creating a `licensesByKey` object for quick lookups and a `usedLicenses` array for a concise list of actively used licenses.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of license data.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **User Feedback:** Provides clear messages to the user about the license extraction process and the used licenses.\n</details>\n",
|
|
6290
6304
|
"examples": [
|
|
6291
|
-
"$ sf hardis:org:diagnose:
|
|
6305
|
+
"$ sf hardis:org:diagnose:licenses"
|
|
6292
6306
|
],
|
|
6293
6307
|
"flags": {
|
|
6294
6308
|
"json": {
|
|
@@ -6314,6 +6328,13 @@
|
|
|
6314
6328
|
"multiple": false,
|
|
6315
6329
|
"type": "option"
|
|
6316
6330
|
},
|
|
6331
|
+
"usedonly": {
|
|
6332
|
+
"char": "u",
|
|
6333
|
+
"description": "Filter to have only used licenses",
|
|
6334
|
+
"name": "usedonly",
|
|
6335
|
+
"allowNo": false,
|
|
6336
|
+
"type": "boolean"
|
|
6337
|
+
},
|
|
6317
6338
|
"debug": {
|
|
6318
6339
|
"char": "d",
|
|
6319
6340
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6352,13 +6373,13 @@
|
|
|
6352
6373
|
},
|
|
6353
6374
|
"hasDynamicHelp": true,
|
|
6354
6375
|
"hiddenAliases": [],
|
|
6355
|
-
"id": "hardis:org:diagnose:
|
|
6376
|
+
"id": "hardis:org:diagnose:licenses",
|
|
6356
6377
|
"pluginAlias": "sfdx-hardis",
|
|
6357
6378
|
"pluginName": "sfdx-hardis",
|
|
6358
6379
|
"pluginType": "core",
|
|
6359
6380
|
"strict": true,
|
|
6360
6381
|
"enableJsonFlag": true,
|
|
6361
|
-
"title": "
|
|
6382
|
+
"title": "List licenses subscribed and used in a Salesforce org",
|
|
6362
6383
|
"requiresProject": false,
|
|
6363
6384
|
"isESM": true,
|
|
6364
6385
|
"relativePath": [
|
|
@@ -6367,47 +6388,46 @@
|
|
|
6367
6388
|
"hardis",
|
|
6368
6389
|
"org",
|
|
6369
6390
|
"diagnose",
|
|
6370
|
-
"
|
|
6391
|
+
"licenses.js"
|
|
6371
6392
|
],
|
|
6372
6393
|
"aliasPermutations": [],
|
|
6373
6394
|
"permutations": [
|
|
6374
|
-
"hardis:org:diagnose:
|
|
6375
|
-
"org:hardis:diagnose:
|
|
6376
|
-
"org:diagnose:hardis:
|
|
6377
|
-
"org:diagnose:
|
|
6378
|
-
"hardis:diagnose:org:
|
|
6379
|
-
"diagnose:hardis:org:
|
|
6380
|
-
"diagnose:org:hardis:
|
|
6381
|
-
"diagnose:org:
|
|
6382
|
-
"hardis:diagnose:
|
|
6383
|
-
"diagnose:hardis:
|
|
6384
|
-
"diagnose:
|
|
6385
|
-
"diagnose:
|
|
6386
|
-
"hardis:org:
|
|
6387
|
-
"org:hardis:
|
|
6388
|
-
"org:
|
|
6389
|
-
"org:
|
|
6390
|
-
"hardis:
|
|
6391
|
-
"
|
|
6392
|
-
"
|
|
6393
|
-
"
|
|
6394
|
-
"hardis:
|
|
6395
|
-
"
|
|
6396
|
-
"
|
|
6397
|
-
"
|
|
6398
|
-
]
|
|
6399
|
-
},
|
|
6400
|
-
"hardis:org:diagnose:
|
|
6401
|
-
"aliases": [],
|
|
6402
|
-
"args": {},
|
|
6403
|
-
"description": "
|
|
6404
|
-
"examples": [
|
|
6405
|
-
"$ sf hardis:org:diagnose:
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
"description": "Format output as json.",
|
|
6395
|
+
"hardis:org:diagnose:licenses",
|
|
6396
|
+
"org:hardis:diagnose:licenses",
|
|
6397
|
+
"org:diagnose:hardis:licenses",
|
|
6398
|
+
"org:diagnose:licenses:hardis",
|
|
6399
|
+
"hardis:diagnose:org:licenses",
|
|
6400
|
+
"diagnose:hardis:org:licenses",
|
|
6401
|
+
"diagnose:org:hardis:licenses",
|
|
6402
|
+
"diagnose:org:licenses:hardis",
|
|
6403
|
+
"hardis:diagnose:licenses:org",
|
|
6404
|
+
"diagnose:hardis:licenses:org",
|
|
6405
|
+
"diagnose:licenses:hardis:org",
|
|
6406
|
+
"diagnose:licenses:org:hardis",
|
|
6407
|
+
"hardis:org:licenses:diagnose",
|
|
6408
|
+
"org:hardis:licenses:diagnose",
|
|
6409
|
+
"org:licenses:hardis:diagnose",
|
|
6410
|
+
"org:licenses:diagnose:hardis",
|
|
6411
|
+
"hardis:licenses:org:diagnose",
|
|
6412
|
+
"licenses:hardis:org:diagnose",
|
|
6413
|
+
"licenses:org:hardis:diagnose",
|
|
6414
|
+
"licenses:org:diagnose:hardis",
|
|
6415
|
+
"hardis:licenses:diagnose:org",
|
|
6416
|
+
"licenses:hardis:diagnose:org",
|
|
6417
|
+
"licenses:diagnose:hardis:org",
|
|
6418
|
+
"licenses:diagnose:org:hardis"
|
|
6419
|
+
]
|
|
6420
|
+
},
|
|
6421
|
+
"hardis:org:diagnose:releaseupdates": {
|
|
6422
|
+
"aliases": [],
|
|
6423
|
+
"args": {},
|
|
6424
|
+
"description": "Export Release Updates into a CSV file with selected criteria, and highlight Release Updates that should be checked.\n\nBefore publishing **Breaking Changes** ❌, Salesforce announce them in the setup menu [**Release Updates**](https://help.salesforce.com/s/articleView?id=sf.release_updates.htm&type=5)\n\n⚠️ Some of them are very important, because if you don't make the related upgrades in time (ex: before Winter 25) , your production org can crash !\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-release-updates/) and can output Grafana, Slack and MsTeams Notifications.\n",
|
|
6425
|
+
"examples": [
|
|
6426
|
+
"$ sf hardis:org:diagnose:releaseupdates"
|
|
6427
|
+
],
|
|
6428
|
+
"flags": {
|
|
6429
|
+
"json": {
|
|
6430
|
+
"description": "Format output as json.",
|
|
6411
6431
|
"helpGroup": "GLOBAL",
|
|
6412
6432
|
"name": "json",
|
|
6413
6433
|
"allowNo": false,
|
|
@@ -6429,14 +6449,6 @@
|
|
|
6429
6449
|
"multiple": false,
|
|
6430
6450
|
"type": "option"
|
|
6431
6451
|
},
|
|
6432
|
-
"days": {
|
|
6433
|
-
"char": "t",
|
|
6434
|
-
"description": "Extracts the users that have been inactive for the amount of days specified. In CI, default is 180 days",
|
|
6435
|
-
"name": "days",
|
|
6436
|
-
"hasDynamicHelp": false,
|
|
6437
|
-
"multiple": false,
|
|
6438
|
-
"type": "option"
|
|
6439
|
-
},
|
|
6440
6452
|
"debug": {
|
|
6441
6453
|
"char": "d",
|
|
6442
6454
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6475,13 +6487,13 @@
|
|
|
6475
6487
|
},
|
|
6476
6488
|
"hasDynamicHelp": true,
|
|
6477
6489
|
"hiddenAliases": [],
|
|
6478
|
-
"id": "hardis:org:diagnose:
|
|
6490
|
+
"id": "hardis:org:diagnose:releaseupdates",
|
|
6479
6491
|
"pluginAlias": "sfdx-hardis",
|
|
6480
6492
|
"pluginName": "sfdx-hardis",
|
|
6481
6493
|
"pluginType": "core",
|
|
6482
6494
|
"strict": true,
|
|
6483
6495
|
"enableJsonFlag": true,
|
|
6484
|
-
"title": "
|
|
6496
|
+
"title": "Check Release Updates of an org",
|
|
6485
6497
|
"requiresProject": false,
|
|
6486
6498
|
"isESM": true,
|
|
6487
6499
|
"relativePath": [
|
|
@@ -6490,42 +6502,47 @@
|
|
|
6490
6502
|
"hardis",
|
|
6491
6503
|
"org",
|
|
6492
6504
|
"diagnose",
|
|
6493
|
-
"
|
|
6505
|
+
"releaseupdates.js"
|
|
6494
6506
|
],
|
|
6495
6507
|
"aliasPermutations": [],
|
|
6496
6508
|
"permutations": [
|
|
6497
|
-
"hardis:org:diagnose:
|
|
6498
|
-
"org:hardis:diagnose:
|
|
6499
|
-
"org:diagnose:hardis:
|
|
6500
|
-
"org:diagnose:
|
|
6501
|
-
"hardis:diagnose:org:
|
|
6502
|
-
"diagnose:hardis:org:
|
|
6503
|
-
"diagnose:org:hardis:
|
|
6504
|
-
"diagnose:org:
|
|
6505
|
-
"hardis:diagnose:
|
|
6506
|
-
"diagnose:hardis:
|
|
6507
|
-
"diagnose:
|
|
6508
|
-
"diagnose:
|
|
6509
|
-
"hardis:org:
|
|
6510
|
-
"org:hardis:
|
|
6511
|
-
"org:
|
|
6512
|
-
"org:
|
|
6513
|
-
"hardis:
|
|
6514
|
-
"
|
|
6515
|
-
"
|
|
6516
|
-
"
|
|
6517
|
-
"hardis:
|
|
6518
|
-
"
|
|
6519
|
-
"
|
|
6520
|
-
"
|
|
6509
|
+
"hardis:org:diagnose:releaseupdates",
|
|
6510
|
+
"org:hardis:diagnose:releaseupdates",
|
|
6511
|
+
"org:diagnose:hardis:releaseupdates",
|
|
6512
|
+
"org:diagnose:releaseupdates:hardis",
|
|
6513
|
+
"hardis:diagnose:org:releaseupdates",
|
|
6514
|
+
"diagnose:hardis:org:releaseupdates",
|
|
6515
|
+
"diagnose:org:hardis:releaseupdates",
|
|
6516
|
+
"diagnose:org:releaseupdates:hardis",
|
|
6517
|
+
"hardis:diagnose:releaseupdates:org",
|
|
6518
|
+
"diagnose:hardis:releaseupdates:org",
|
|
6519
|
+
"diagnose:releaseupdates:hardis:org",
|
|
6520
|
+
"diagnose:releaseupdates:org:hardis",
|
|
6521
|
+
"hardis:org:releaseupdates:diagnose",
|
|
6522
|
+
"org:hardis:releaseupdates:diagnose",
|
|
6523
|
+
"org:releaseupdates:hardis:diagnose",
|
|
6524
|
+
"org:releaseupdates:diagnose:hardis",
|
|
6525
|
+
"hardis:releaseupdates:org:diagnose",
|
|
6526
|
+
"releaseupdates:hardis:org:diagnose",
|
|
6527
|
+
"releaseupdates:org:hardis:diagnose",
|
|
6528
|
+
"releaseupdates:org:diagnose:hardis",
|
|
6529
|
+
"hardis:releaseupdates:diagnose:org",
|
|
6530
|
+
"releaseupdates:hardis:diagnose:org",
|
|
6531
|
+
"releaseupdates:diagnose:hardis:org",
|
|
6532
|
+
"releaseupdates:diagnose:org:hardis"
|
|
6521
6533
|
]
|
|
6522
6534
|
},
|
|
6523
|
-
"hardis:org:diagnose:
|
|
6535
|
+
"hardis:org:diagnose:storage-stats": {
|
|
6524
6536
|
"aliases": [],
|
|
6525
6537
|
"args": {},
|
|
6526
|
-
"description": "
|
|
6538
|
+
"description": "**Extracts and analyzes Data Storage usage for a Salesforce org, providing detailed per-object breakdowns with flexible grouping options.**\n\nThis command provides a comprehensive overview of your Salesforce data storage consumption. It's particularly useful for:\n\n- **Storage Management:** Understanding which SObjects consume the most storage and how usage has evolved over time.\n- **Cost Optimization:** Identifying storage-heavy objects that could be candidates for data archival or cleanup strategies.\n- **Capacity Planning:** Tracking storage trends to predict when additional capacity will be needed.\n- **Compliance & Governance:** Monitoring data growth patterns to ensure alignment with data retention policies.\n\nKey functionalities:\n\n- **Storage Limits Analysis:** Retrieves and displays org data storage limits, including total capacity, used storage, remaining storage, and percentage used. Detects and alerts on over-usage scenarios.\n- **SObject Discovery & Filtering:** Automatically discovers all SObjects in the org and filters them to focus on production/custom objects (excludes metadata types, platform-only objects, and cached empty objects).\n- **Interactive Selection:** Prompts the user to select which SObjects to analyze and choose breakdown fields (date fields, RecordType, custom fields, or relationship fields).\n- **Flexible Breakdown Field:** Supports grouping by any field including:\n - Date/DateTime fields (`CreatedDate`, `LastModifiedDate`, custom date fields)\n - RecordType (`RecordType.Name`)\n - Custom fields (`Status__c`, picklists, text fields)\n - Nested relationship fields (`SBQQ__Quote__r.RecordType.Name`)\n- **Date Granularity Options:** For date/datetime fields, choose between:\n - Year-based grouping (`CALENDAR_YEAR`)\n - Month-based grouping (`CALENDAR_MONTH`)\n - Day-based grouping (exact date)\n- **WHERE Clause Filtering:** Apply SOQL WHERE conditions to filter records before calculating storage (e.g., only active records, records from the last year).\n- **Storage Estimation:** Estimates storage usage for each object using an average record size heuristic (2 KB per record) and calculates the percentage of org quota consumed.\n- **Dual CSV Reports:** Generates two CSV files: a detailed breakdown by selected field and a totals-per-object summary, both suitable for spreadsheet analysis and reporting.\n- **Empty Objects Cache:** Maintains a per-user cache of objects detected with zero records to optimize subsequent runs by skipping empty tables.\n- **Progress Tracking:** Sends WebSocket progress messages for integration with external UIs and monitoring dashboards.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Limits Retrieval:** Calls `conn.limits()` to retrieve the `DataStorageMB` object containing `Max` and `Remaining` values. Handles negative `Remaining` values (over-usage scenarios) by calculating `overUsageMB` and adjusting display values.\n- **SObject Discovery:** Uses `conn.metadata.list([{ type: 'CustomObject' }])` to get custom objects and `conn.describeGlobal()` to get all SObjects. Filters by object capabilities (`layoutable`, `queryable`, `retrieveable`, `createable`, `updateable`, `deletable`) and excludes metadata types (`__mdt` suffix) and cached empty objects.\n- **User Interaction:** Uses `prompts` for interactive multi-select of SObjects, breakdown field selection, granularity choice (for date fields), and optional WHERE conditions. All objects are pre-selected by default for user convenience.\n- **Field Validation:** Recursively validates breakdown fields including nested relationships (e.g., `SBQQ__Quote__r.RecordType.Name`) by traversing the relationship chain and checking field existence on each related object. Automatically handles special cases like `RecordType` -> `RecordTypeId` and `__r` -> `__c` conversions.\n- **Dynamic Query Generation:** Builds SOQL queries based on field type and granularity:\n - For date fields with year granularity: `SELECT CALENDAR_YEAR(<Field>) breakdown, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY CALENDAR_YEAR(<Field>) ORDER BY CALENDAR_YEAR(<Field>)`\n - For date fields with month granularity: `SELECT CALENDAR_YEAR(<Field>) year, CALENDAR_MONTH(<Field>) month, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY CALENDAR_YEAR(<Field>), CALENDAR_MONTH(<Field>) ORDER BY CALENDAR_YEAR(<Field>), CALENDAR_MONTH(<Field>)`\n - For non-date fields: `SELECT <Field> breakdown, COUNT(Id) total FROM <SObject> [WHERE ...] GROUP BY <Field> ORDER BY <Field>`\n- **WHERE Clause Support:** Accepts user-provided WHERE conditions via flag (`--where`) or interactive prompt. Injects the condition into all SOQL queries for consistent filtering across all objects.\n- **Storage Calculation:** Applies a conservative average record size of 2 KB (2048 bytes) to estimate storage consumption. Calculates both MB usage and percentage of org quota for each object and breakdown value.\n- **Report Generation:** Uses `generateCsvFile` and `generateReportPath` helpers to create two CSV files in the reports directory:\n - Detailed breakdown: includes all statistics per breakdown value per object (e.g., by year, by month, by RecordType)\n - Totals summary: includes only aggregate totals per object\n - File naming includes breakdown field, granularity (for date fields), and `-filtered` suffix when WHERE clause is applied\n- **Caching Mechanism:** Writes a JSON cache file per authenticated username (sanitized) in the reports directory (`<username>_empty_tables_cache.json`) containing an array of empty object names. The cache is updated after each run with newly detected empty objects.\n- **Progress & UX:** Uses `WebSocketClient` to emit start/step/end progress messages for external monitoring. Outputs summary tables with `uxLogTable` and status messages with `uxLog`.\n- **Return Value:** Returns a JSON object containing `tableStorageInfos` (all rows), `tableStorageInfosTotals` (summary rows), `storageLimits` (org limits object), and `outputFiles` (paths to generated CSV/XLSX reports).\n</details>\n\n\n\n\n",
|
|
6527
6539
|
"examples": [
|
|
6528
|
-
"$ sf hardis:org:diagnose:
|
|
6540
|
+
"$ sf hardis:org:diagnose:storage-stats",
|
|
6541
|
+
"$ sf hardis:org:diagnose:storage-stats --breakdown-field \"CreatedDate\"",
|
|
6542
|
+
"$ sf hardis:org:diagnose:storage-stats -b \"RecordType.Name\"",
|
|
6543
|
+
"$ sf hardis:org:diagnose:storage-stats --where \"CreatedDate = LAST_N_DAYS:365\"",
|
|
6544
|
+
"$ sf hardis:org:diagnose:storage-stats -w \"Status__c = 'Active'\"",
|
|
6545
|
+
"$ sf hardis:org:diagnose:storage-stats -b \"LastModifiedDate\" -w \"IsDeleted = false\""
|
|
6529
6546
|
],
|
|
6530
6547
|
"flags": {
|
|
6531
6548
|
"json": {
|
|
@@ -6551,6 +6568,22 @@
|
|
|
6551
6568
|
"multiple": false,
|
|
6552
6569
|
"type": "option"
|
|
6553
6570
|
},
|
|
6571
|
+
"breakdown-field": {
|
|
6572
|
+
"char": "b",
|
|
6573
|
+
"description": "Field to use for storage stats breakdown. Example: \"CreatedDate\", \"LastModifiedDate\", \"RecordType.Name\", or custom fields like \"Status__c\"",
|
|
6574
|
+
"name": "breakdown-field",
|
|
6575
|
+
"hasDynamicHelp": false,
|
|
6576
|
+
"multiple": false,
|
|
6577
|
+
"type": "option"
|
|
6578
|
+
},
|
|
6579
|
+
"where": {
|
|
6580
|
+
"char": "w",
|
|
6581
|
+
"description": "WHERE clause to filter records in the query (without the WHERE keyword). Example: \"CreatedDate = LAST_N_DAYS:365\" or \"Status__c = 'Active'\"",
|
|
6582
|
+
"name": "where",
|
|
6583
|
+
"hasDynamicHelp": false,
|
|
6584
|
+
"multiple": false,
|
|
6585
|
+
"type": "option"
|
|
6586
|
+
},
|
|
6554
6587
|
"debug": {
|
|
6555
6588
|
"char": "d",
|
|
6556
6589
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6589,31 +6622,14 @@
|
|
|
6589
6622
|
},
|
|
6590
6623
|
"hasDynamicHelp": true,
|
|
6591
6624
|
"hiddenAliases": [],
|
|
6592
|
-
"id": "hardis:org:diagnose:
|
|
6625
|
+
"id": "hardis:org:diagnose:storage-stats",
|
|
6593
6626
|
"pluginAlias": "sfdx-hardis",
|
|
6594
6627
|
"pluginName": "sfdx-hardis",
|
|
6595
6628
|
"pluginType": "core",
|
|
6596
6629
|
"strict": true,
|
|
6597
6630
|
"enableJsonFlag": true,
|
|
6598
|
-
"title": "
|
|
6599
|
-
"
|
|
6600
|
-
"Ant Migration Tool",
|
|
6601
|
-
"Chatter Desktop",
|
|
6602
|
-
"Chatter Mobile for BlackBerry",
|
|
6603
|
-
"Force.com IDE",
|
|
6604
|
-
"OIQ_Integration",
|
|
6605
|
-
"Salesforce CLI",
|
|
6606
|
-
"Salesforce Files",
|
|
6607
|
-
"Salesforce Mobile Dashboards",
|
|
6608
|
-
"Salesforce Touch",
|
|
6609
|
-
"Salesforce for Outlook",
|
|
6610
|
-
"SalesforceA",
|
|
6611
|
-
"SalesforceA for Android",
|
|
6612
|
-
"SalesforceA for iOS",
|
|
6613
|
-
"SalesforceDX Namespace Registry",
|
|
6614
|
-
"SalesforceIQ"
|
|
6615
|
-
],
|
|
6616
|
-
"requiresProject": false,
|
|
6631
|
+
"title": "Extract Data Storage stats",
|
|
6632
|
+
"requiresProject": true,
|
|
6617
6633
|
"isESM": true,
|
|
6618
6634
|
"relativePath": [
|
|
6619
6635
|
"lib",
|
|
@@ -6621,43 +6637,42 @@
|
|
|
6621
6637
|
"hardis",
|
|
6622
6638
|
"org",
|
|
6623
6639
|
"diagnose",
|
|
6624
|
-
"
|
|
6640
|
+
"storage-stats.js"
|
|
6625
6641
|
],
|
|
6626
6642
|
"aliasPermutations": [],
|
|
6627
6643
|
"permutations": [
|
|
6628
|
-
"hardis:org:diagnose:
|
|
6629
|
-
"org:hardis:diagnose:
|
|
6630
|
-
"org:diagnose:hardis:
|
|
6631
|
-
"org:diagnose:
|
|
6632
|
-
"hardis:diagnose:org:
|
|
6633
|
-
"diagnose:hardis:org:
|
|
6634
|
-
"diagnose:org:hardis:
|
|
6635
|
-
"diagnose:org:
|
|
6636
|
-
"hardis:diagnose:
|
|
6637
|
-
"diagnose:hardis:
|
|
6638
|
-
"diagnose:
|
|
6639
|
-
"diagnose:
|
|
6640
|
-
"hardis:org:
|
|
6641
|
-
"org:hardis:
|
|
6642
|
-
"org:
|
|
6643
|
-
"org:
|
|
6644
|
-
"hardis:
|
|
6645
|
-
"
|
|
6646
|
-
"
|
|
6647
|
-
"
|
|
6648
|
-
"hardis:
|
|
6649
|
-
"
|
|
6650
|
-
"
|
|
6651
|
-
"
|
|
6644
|
+
"hardis:org:diagnose:storage-stats",
|
|
6645
|
+
"org:hardis:diagnose:storage-stats",
|
|
6646
|
+
"org:diagnose:hardis:storage-stats",
|
|
6647
|
+
"org:diagnose:storage-stats:hardis",
|
|
6648
|
+
"hardis:diagnose:org:storage-stats",
|
|
6649
|
+
"diagnose:hardis:org:storage-stats",
|
|
6650
|
+
"diagnose:org:hardis:storage-stats",
|
|
6651
|
+
"diagnose:org:storage-stats:hardis",
|
|
6652
|
+
"hardis:diagnose:storage-stats:org",
|
|
6653
|
+
"diagnose:hardis:storage-stats:org",
|
|
6654
|
+
"diagnose:storage-stats:hardis:org",
|
|
6655
|
+
"diagnose:storage-stats:org:hardis",
|
|
6656
|
+
"hardis:org:storage-stats:diagnose",
|
|
6657
|
+
"org:hardis:storage-stats:diagnose",
|
|
6658
|
+
"org:storage-stats:hardis:diagnose",
|
|
6659
|
+
"org:storage-stats:diagnose:hardis",
|
|
6660
|
+
"hardis:storage-stats:org:diagnose",
|
|
6661
|
+
"storage-stats:hardis:org:diagnose",
|
|
6662
|
+
"storage-stats:org:hardis:diagnose",
|
|
6663
|
+
"storage-stats:org:diagnose:hardis",
|
|
6664
|
+
"hardis:storage-stats:diagnose:org",
|
|
6665
|
+
"storage-stats:hardis:diagnose:org",
|
|
6666
|
+
"storage-stats:diagnose:hardis:org",
|
|
6667
|
+
"storage-stats:diagnose:org:hardis"
|
|
6652
6668
|
]
|
|
6653
6669
|
},
|
|
6654
|
-
"hardis:org:diagnose:
|
|
6670
|
+
"hardis:org:diagnose:unsecure-connected-apps": {
|
|
6655
6671
|
"aliases": [],
|
|
6656
6672
|
"args": {},
|
|
6657
|
-
"description": "\n## Command Behavior\n\n**Detects
|
|
6673
|
+
"description": "\n## Command Behavior\n\n**Detects unsecured Connected Apps in a Salesforce org and generates detailed reports for security analysis.**\n\nThis command is a critical security diagnostic tool that helps administrators identify Connected Apps that may pose security risks due to improper configuration. It provides comprehensive analysis of OAuth tokens and Connected App security settings to ensure proper access control.\n\nKey functionalities:\n\n- **OAuth Token Analysis:** Queries all OAuth tokens in the org using SOQL to retrieve comprehensive token information including app names, users, authorization status, and usage statistics.\n- **Security Status Assessment:** Evaluates each Connected App's security configuration by checking the `IsUsingAdminAuthorization` flag to determine if admin pre-approval is required.\n- **Unsecured App Detection:** Identifies Connected Apps that allow users to authorize themselves without admin approval, which can pose security risks.\n- **Detailed Reporting:** Generates two comprehensive CSV reports:\n - **OAuth Tokens Report:** Lists all OAuth tokens with security status, user information, and usage data\n - **Connected Apps Summary:** Aggregates unsecured Connected Apps with counts of associated OAuth tokens\n- **Visual Indicators:** Uses status icons (❌ for unsecured, ✅ for secured) to provide immediate visual feedback on security status.\n- **Security Recommendations:** Provides actionable guidance on how to secure Connected Apps through proper configuration.\n- **Notifications:** Sends alerts to configured channels (Grafana, Slack, MS Teams) with security findings and attached reports.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-org-security/) and can output Grafana, Slack and MsTeams Notifications.\n\n<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/jHv8yrSK8Dg\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **SOQL Query Execution:** Executes a comprehensive SOQL query on the `OauthToken` object, joining with `AppMenuItem` and `User` objects to gather complete security context.\n- **Security Analysis Logic:** Analyzes the `AppMenuItem.IsUsingAdminAuthorization` field to determine if a Connected App requires admin pre-approval for user authorization.\n- **Data Transformation:** Processes raw SOQL results to add security status indicators and reorganize data for optimal reporting and analysis.\n- **Aggregation Processing:** Groups OAuth tokens by Connected App name to provide summary statistics and identify the most problematic applications.\n- **Report Generation:** Uses `generateCsvFile` to create structured CSV reports with proper formatting and metadata for easy analysis and sharing.\n- **Notification Integration:** Integrates with the `NotifProvider` to send security alerts with detailed metrics, including the number of unsecured Connected Apps and associated OAuth tokens.\n- **File Management:** Generates multiple output formats (CSV, XLSX) and manages file paths using `generateReportPath` for consistent report organization.\n- **Connection Management:** Uses `setConnectionVariables` to ensure proper authentication context for notification providers that require org connection details.\n</details>\n",
|
|
6658
6674
|
"examples": [
|
|
6659
|
-
"$ sf hardis:org:diagnose:
|
|
6660
|
-
"$ sf hardis:org:diagnose:unusedlicenses --fix"
|
|
6675
|
+
"$ sf hardis:org:diagnose:unsecure-connected-apps"
|
|
6661
6676
|
],
|
|
6662
6677
|
"flags": {
|
|
6663
6678
|
"json": {
|
|
@@ -6721,32 +6736,14 @@
|
|
|
6721
6736
|
},
|
|
6722
6737
|
"hasDynamicHelp": true,
|
|
6723
6738
|
"hiddenAliases": [],
|
|
6724
|
-
"id": "hardis:org:diagnose:
|
|
6739
|
+
"id": "hardis:org:diagnose:unsecure-connected-apps",
|
|
6725
6740
|
"pluginAlias": "sfdx-hardis",
|
|
6726
6741
|
"pluginName": "sfdx-hardis",
|
|
6727
6742
|
"pluginType": "core",
|
|
6728
6743
|
"strict": true,
|
|
6729
6744
|
"enableJsonFlag": true,
|
|
6730
|
-
"title": "Detect
|
|
6745
|
+
"title": "Detect Unsecured Connected Apps",
|
|
6731
6746
|
"requiresProject": false,
|
|
6732
|
-
"additionalPermissionSetsToAlwaysGet": [
|
|
6733
|
-
"Sales_User"
|
|
6734
|
-
],
|
|
6735
|
-
"permSetsPermSetLicenses": [
|
|
6736
|
-
{
|
|
6737
|
-
"permSet": "Sales_User",
|
|
6738
|
-
"permSetLicense": "SalesUserPsl"
|
|
6739
|
-
}
|
|
6740
|
-
],
|
|
6741
|
-
"profilesPermissionSetLicenses": [
|
|
6742
|
-
{
|
|
6743
|
-
"profile": "Salesforce API Only",
|
|
6744
|
-
"permSetLicense": "SalesforceAPIIntegrationPsl"
|
|
6745
|
-
}
|
|
6746
|
-
],
|
|
6747
|
-
"alwaysExcludeForActiveUsersPermissionSetLicenses": [
|
|
6748
|
-
"IdentityConnect"
|
|
6749
|
-
],
|
|
6750
6747
|
"isESM": true,
|
|
6751
6748
|
"relativePath": [
|
|
6752
6749
|
"lib",
|
|
@@ -6754,46 +6751,43 @@
|
|
|
6754
6751
|
"hardis",
|
|
6755
6752
|
"org",
|
|
6756
6753
|
"diagnose",
|
|
6757
|
-
"
|
|
6754
|
+
"unsecure-connected-apps.js"
|
|
6758
6755
|
],
|
|
6759
6756
|
"aliasPermutations": [],
|
|
6760
6757
|
"permutations": [
|
|
6761
|
-
"hardis:org:diagnose:
|
|
6762
|
-
"org:hardis:diagnose:
|
|
6763
|
-
"org:diagnose:hardis:
|
|
6764
|
-
"org:diagnose:
|
|
6765
|
-
"hardis:diagnose:org:
|
|
6766
|
-
"diagnose:hardis:org:
|
|
6767
|
-
"diagnose:org:hardis:
|
|
6768
|
-
"diagnose:org:
|
|
6769
|
-
"hardis:diagnose:
|
|
6770
|
-
"diagnose:hardis:
|
|
6771
|
-
"diagnose:
|
|
6772
|
-
"diagnose:
|
|
6773
|
-
"hardis:org:
|
|
6774
|
-
"org:hardis:
|
|
6775
|
-
"org:
|
|
6776
|
-
"org:
|
|
6777
|
-
"hardis:
|
|
6778
|
-
"
|
|
6779
|
-
"
|
|
6780
|
-
"
|
|
6781
|
-
"hardis:
|
|
6782
|
-
"
|
|
6783
|
-
"
|
|
6784
|
-
"
|
|
6785
|
-
]
|
|
6786
|
-
},
|
|
6787
|
-
"hardis:org:diagnose:
|
|
6758
|
+
"hardis:org:diagnose:unsecure-connected-apps",
|
|
6759
|
+
"org:hardis:diagnose:unsecure-connected-apps",
|
|
6760
|
+
"org:diagnose:hardis:unsecure-connected-apps",
|
|
6761
|
+
"org:diagnose:unsecure-connected-apps:hardis",
|
|
6762
|
+
"hardis:diagnose:org:unsecure-connected-apps",
|
|
6763
|
+
"diagnose:hardis:org:unsecure-connected-apps",
|
|
6764
|
+
"diagnose:org:hardis:unsecure-connected-apps",
|
|
6765
|
+
"diagnose:org:unsecure-connected-apps:hardis",
|
|
6766
|
+
"hardis:diagnose:unsecure-connected-apps:org",
|
|
6767
|
+
"diagnose:hardis:unsecure-connected-apps:org",
|
|
6768
|
+
"diagnose:unsecure-connected-apps:hardis:org",
|
|
6769
|
+
"diagnose:unsecure-connected-apps:org:hardis",
|
|
6770
|
+
"hardis:org:unsecure-connected-apps:diagnose",
|
|
6771
|
+
"org:hardis:unsecure-connected-apps:diagnose",
|
|
6772
|
+
"org:unsecure-connected-apps:hardis:diagnose",
|
|
6773
|
+
"org:unsecure-connected-apps:diagnose:hardis",
|
|
6774
|
+
"hardis:unsecure-connected-apps:org:diagnose",
|
|
6775
|
+
"unsecure-connected-apps:hardis:org:diagnose",
|
|
6776
|
+
"unsecure-connected-apps:org:hardis:diagnose",
|
|
6777
|
+
"unsecure-connected-apps:org:diagnose:hardis",
|
|
6778
|
+
"hardis:unsecure-connected-apps:diagnose:org",
|
|
6779
|
+
"unsecure-connected-apps:hardis:diagnose:org",
|
|
6780
|
+
"unsecure-connected-apps:diagnose:hardis:org",
|
|
6781
|
+
"unsecure-connected-apps:diagnose:org:hardis"
|
|
6782
|
+
]
|
|
6783
|
+
},
|
|
6784
|
+
"hardis:org:diagnose:unused-apex-classes": {
|
|
6788
6785
|
"aliases": [],
|
|
6789
6786
|
"args": {},
|
|
6790
|
-
"description": "
|
|
6787
|
+
"description": "List all async Apex classes (Batch,Queueable,Schedulable) that has not been called for more than 365 days.\n \nThe result class list probably can be removed from the project, and that will improve your test classes performances 😊\n\nThe number of unused day is overridable using --days option. \n\nThe command uses queries on AsyncApexJob and CronTrigger technical tables to build the result.\n\nApex Classes CreatedBy and CreatedOn fields are calculated from MIN(date from git, date from org)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-apex-classes/) and can output Grafana, Slack and MsTeams Notifications.\n\n\n",
|
|
6791
6788
|
"examples": [
|
|
6792
|
-
"$ sf hardis:org:diagnose:
|
|
6793
|
-
"$ sf hardis:org:diagnose:
|
|
6794
|
-
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm",
|
|
6795
|
-
"$ sf hardis:org:diagnose:unusedusers --days 60 --licenseidentifiers SFDC,AUL,AUL1",
|
|
6796
|
-
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm --returnactiveusers"
|
|
6789
|
+
"$ sf hardis:org:diagnose:unused-apex-classes",
|
|
6790
|
+
"$ sf hardis:org:diagnose:unused-apex-classes --days 700"
|
|
6797
6791
|
],
|
|
6798
6792
|
"flags": {
|
|
6799
6793
|
"json": {
|
|
@@ -6827,33 +6821,6 @@
|
|
|
6827
6821
|
"multiple": false,
|
|
6828
6822
|
"type": "option"
|
|
6829
6823
|
},
|
|
6830
|
-
"licensetypes": {
|
|
6831
|
-
"char": "l",
|
|
6832
|
-
"description": "Type of licenses to check. If set, do not use licenseidentifiers option. In CI, default is all-crm",
|
|
6833
|
-
"name": "licensetypes",
|
|
6834
|
-
"hasDynamicHelp": false,
|
|
6835
|
-
"multiple": false,
|
|
6836
|
-
"options": [
|
|
6837
|
-
"all",
|
|
6838
|
-
"all-crm",
|
|
6839
|
-
"all-paying"
|
|
6840
|
-
],
|
|
6841
|
-
"type": "option"
|
|
6842
|
-
},
|
|
6843
|
-
"licenseidentifiers": {
|
|
6844
|
-
"char": "i",
|
|
6845
|
-
"description": "Comma-separated list of license identifiers, in case licensetypes is not used.. Identifiers available at https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userlicense.htm",
|
|
6846
|
-
"name": "licenseidentifiers",
|
|
6847
|
-
"hasDynamicHelp": false,
|
|
6848
|
-
"multiple": false,
|
|
6849
|
-
"type": "option"
|
|
6850
|
-
},
|
|
6851
|
-
"returnactiveusers": {
|
|
6852
|
-
"description": "Inverts the command by returning the active users",
|
|
6853
|
-
"name": "returnactiveusers",
|
|
6854
|
-
"allowNo": false,
|
|
6855
|
-
"type": "boolean"
|
|
6856
|
-
},
|
|
6857
6824
|
"debug": {
|
|
6858
6825
|
"char": "d",
|
|
6859
6826
|
"description": "Activate debug mode (more logs)",
|
|
@@ -6892,13 +6859,13 @@
|
|
|
6892
6859
|
},
|
|
6893
6860
|
"hasDynamicHelp": true,
|
|
6894
6861
|
"hiddenAliases": [],
|
|
6895
|
-
"id": "hardis:org:diagnose:
|
|
6862
|
+
"id": "hardis:org:diagnose:unused-apex-classes",
|
|
6896
6863
|
"pluginAlias": "sfdx-hardis",
|
|
6897
6864
|
"pluginName": "sfdx-hardis",
|
|
6898
6865
|
"pluginType": "core",
|
|
6899
6866
|
"strict": true,
|
|
6900
6867
|
"enableJsonFlag": true,
|
|
6901
|
-
"title": "Detect unused
|
|
6868
|
+
"title": "Detect unused Apex classes in an org",
|
|
6902
6869
|
"requiresProject": false,
|
|
6903
6870
|
"isESM": true,
|
|
6904
6871
|
"relativePath": [
|
|
@@ -6907,42 +6874,42 @@
|
|
|
6907
6874
|
"hardis",
|
|
6908
6875
|
"org",
|
|
6909
6876
|
"diagnose",
|
|
6910
|
-
"
|
|
6877
|
+
"unused-apex-classes.js"
|
|
6911
6878
|
],
|
|
6912
6879
|
"aliasPermutations": [],
|
|
6913
6880
|
"permutations": [
|
|
6914
|
-
"hardis:org:diagnose:
|
|
6915
|
-
"org:hardis:diagnose:
|
|
6916
|
-
"org:diagnose:hardis:
|
|
6917
|
-
"org:diagnose:
|
|
6918
|
-
"hardis:diagnose:org:
|
|
6919
|
-
"diagnose:hardis:org:
|
|
6920
|
-
"diagnose:org:hardis:
|
|
6921
|
-
"diagnose:org:
|
|
6922
|
-
"hardis:diagnose:
|
|
6923
|
-
"diagnose:hardis:
|
|
6924
|
-
"diagnose:
|
|
6925
|
-
"diagnose:
|
|
6926
|
-
"hardis:org:
|
|
6927
|
-
"org:hardis:
|
|
6928
|
-
"org:
|
|
6929
|
-
"org:
|
|
6930
|
-
"hardis:
|
|
6931
|
-
"
|
|
6932
|
-
"
|
|
6933
|
-
"
|
|
6934
|
-
"hardis:
|
|
6935
|
-
"
|
|
6936
|
-
"
|
|
6937
|
-
"
|
|
6881
|
+
"hardis:org:diagnose:unused-apex-classes",
|
|
6882
|
+
"org:hardis:diagnose:unused-apex-classes",
|
|
6883
|
+
"org:diagnose:hardis:unused-apex-classes",
|
|
6884
|
+
"org:diagnose:unused-apex-classes:hardis",
|
|
6885
|
+
"hardis:diagnose:org:unused-apex-classes",
|
|
6886
|
+
"diagnose:hardis:org:unused-apex-classes",
|
|
6887
|
+
"diagnose:org:hardis:unused-apex-classes",
|
|
6888
|
+
"diagnose:org:unused-apex-classes:hardis",
|
|
6889
|
+
"hardis:diagnose:unused-apex-classes:org",
|
|
6890
|
+
"diagnose:hardis:unused-apex-classes:org",
|
|
6891
|
+
"diagnose:unused-apex-classes:hardis:org",
|
|
6892
|
+
"diagnose:unused-apex-classes:org:hardis",
|
|
6893
|
+
"hardis:org:unused-apex-classes:diagnose",
|
|
6894
|
+
"org:hardis:unused-apex-classes:diagnose",
|
|
6895
|
+
"org:unused-apex-classes:hardis:diagnose",
|
|
6896
|
+
"org:unused-apex-classes:diagnose:hardis",
|
|
6897
|
+
"hardis:unused-apex-classes:org:diagnose",
|
|
6898
|
+
"unused-apex-classes:hardis:org:diagnose",
|
|
6899
|
+
"unused-apex-classes:org:hardis:diagnose",
|
|
6900
|
+
"unused-apex-classes:org:diagnose:hardis",
|
|
6901
|
+
"hardis:unused-apex-classes:diagnose:org",
|
|
6902
|
+
"unused-apex-classes:hardis:diagnose:org",
|
|
6903
|
+
"unused-apex-classes:diagnose:hardis:org",
|
|
6904
|
+
"unused-apex-classes:diagnose:org:hardis"
|
|
6938
6905
|
]
|
|
6939
6906
|
},
|
|
6940
|
-
"hardis:org:
|
|
6907
|
+
"hardis:org:diagnose:unused-connected-apps": {
|
|
6941
6908
|
"aliases": [],
|
|
6942
6909
|
"args": {},
|
|
6943
|
-
"description": "\n## Command Behavior\n\n**
|
|
6910
|
+
"description": "\n## Command Behavior\n\n**Identifies and reports on potentially unused Connected Apps in a Salesforce org, suggesting candidates for deletion or deactivation.**\n\nThis command helps improve org security and reduce technical debt by pinpointing Connected Apps that are no longer actively used. Connected Apps can pose security risks if left unmonitored, and cleaning them up contributes to a healthier Salesforce environment.\n\nKey functionalities:\n\n- **Connected App Data Collection:** Gathers information about all Connected Apps in the org, including creation and last modified dates, and associated users.\n- **Usage Analysis:** Analyzes `LoginHistory` and `OAuthToken` records to determine the last usage date of each Connected App.\n- **Inactivity Detection:** Flags Connected Apps as potentially unused if they have no recent login history or OAuth token usage.\n- **Accessibility Check:** Examines Connected App metadata to identify if they are accessible (e.g., if they require admin approval and have no profiles or permission sets assigned).\n- **Ignored Apps:** Automatically ignores a predefined list of common Salesforce Connected Apps (e.g., `Salesforce CLI`, `Salesforce Mobile Dashboards`). You can extend this list by defining the `ALLOWED_INACTIVE_CONNECTED_APPS` environment variable.\n- **CSV Report Generation:** Generates a CSV file containing details of all analyzed Connected Apps, including their usage status, last usage date, and reasons for being flagged as potentially unused.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of potentially unused Connected Apps.\n\n**Default Ignored Connected Apps:**\n\n- Ant Migration Tool\n- Chatter Desktop\n- Chatter Mobile for BlackBerry\n- Force.com IDE\n- OIQ_Integration\n- Salesforce CLI\n- Salesforce Files\n- Salesforce Mobile Dashboards\n- Salesforce Touch\n- Salesforce for Outlook\n- SalesforceA\n- SalesforceA for Android\n- SalesforceA for iOS\n- SalesforceDX Namespace Registry\n- SalesforceIQ\n\nYou can add more ignored apps by defining a comma-separated list of names in the `ALLOWED_INACTIVE_CONNECTED_APPS` environment variable.\n\n_Example: \nALLOWED_INACTIVE_CONNECTED_APPS=My App 1,My App 2, My App 3_\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-connected-apps/) and can output Grafana, Slack and MsTeams Notifications.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Salesforce SOQL Queries:** It performs SOQL queries against `ConnectedApplication`, `LoginHistory`, and `OAuthToken` objects to gather comprehensive data about Connected Apps and their usage.\n- **Temporary SFDX Project:** It creates a temporary SFDX project to retrieve Connected App metadata, allowing for local parsing and analysis of their XML files.\n- **Metadata Parsing:** It parses the `connectedApp-meta.xml` files to check for `isAdminApproved` and the presence of `profileName` or `permissionsetName` to determine accessibility.\n- **Data Correlation:** It correlates data from various Salesforce objects to build a complete picture of each Connected App's usage and status.\n- **Date Calculation:** Uses `moment` to calculate the time since the last OAuth token usage.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of unused Connected Apps.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **File System Operations:** Uses `fs-extra` for creating and removing temporary directories and files.\n- **Environment Variable Reading:** Reads the `ALLOWED_INACTIVE_CONNECTED_APPS` environment variable to customize the list of ignored Connected Apps.\n</details>\n",
|
|
6944
6911
|
"examples": [
|
|
6945
|
-
"$ sf hardis:org:
|
|
6912
|
+
"$ sf hardis:org:diagnose:unused-connected-apps"
|
|
6946
6913
|
],
|
|
6947
6914
|
"flags": {
|
|
6948
6915
|
"json": {
|
|
@@ -6960,48 +6927,14 @@
|
|
|
6960
6927
|
"multiple": false,
|
|
6961
6928
|
"type": "option"
|
|
6962
6929
|
},
|
|
6963
|
-
"
|
|
6964
|
-
"char": "
|
|
6965
|
-
"description": "
|
|
6966
|
-
"name": "
|
|
6967
|
-
"hasDynamicHelp": false,
|
|
6968
|
-
"multiple": false,
|
|
6969
|
-
"type": "option"
|
|
6970
|
-
},
|
|
6971
|
-
"chunksize": {
|
|
6972
|
-
"char": "c",
|
|
6973
|
-
"description": "Number of records to add in a chunk before it is processed",
|
|
6974
|
-
"name": "chunksize",
|
|
6975
|
-
"default": 1000,
|
|
6976
|
-
"hasDynamicHelp": false,
|
|
6977
|
-
"multiple": false,
|
|
6978
|
-
"type": "option"
|
|
6979
|
-
},
|
|
6980
|
-
"polltimeout": {
|
|
6981
|
-
"char": "t",
|
|
6982
|
-
"description": "Timeout in MS for Bulk API calls",
|
|
6983
|
-
"name": "polltimeout",
|
|
6984
|
-
"default": 300000,
|
|
6985
|
-
"hasDynamicHelp": false,
|
|
6986
|
-
"multiple": false,
|
|
6987
|
-
"type": "option"
|
|
6988
|
-
},
|
|
6989
|
-
"startchunknumber": {
|
|
6990
|
-
"char": "s",
|
|
6991
|
-
"description": "Chunk number to start from",
|
|
6992
|
-
"name": "startchunknumber",
|
|
6993
|
-
"default": 0,
|
|
6930
|
+
"outputfile": {
|
|
6931
|
+
"char": "f",
|
|
6932
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
6933
|
+
"name": "outputfile",
|
|
6994
6934
|
"hasDynamicHelp": false,
|
|
6995
6935
|
"multiple": false,
|
|
6996
6936
|
"type": "option"
|
|
6997
6937
|
},
|
|
6998
|
-
"resume": {
|
|
6999
|
-
"char": "r",
|
|
7000
|
-
"description": "Resume previous export by checking existing files (default in CI)",
|
|
7001
|
-
"name": "resume",
|
|
7002
|
-
"allowNo": false,
|
|
7003
|
-
"type": "boolean"
|
|
7004
|
-
},
|
|
7005
6938
|
"debug": {
|
|
7006
6939
|
"char": "d",
|
|
7007
6940
|
"description": "Activate debug mode (more logs)",
|
|
@@ -7040,13 +6973,30 @@
|
|
|
7040
6973
|
},
|
|
7041
6974
|
"hasDynamicHelp": true,
|
|
7042
6975
|
"hiddenAliases": [],
|
|
7043
|
-
"id": "hardis:org:
|
|
6976
|
+
"id": "hardis:org:diagnose:unused-connected-apps",
|
|
7044
6977
|
"pluginAlias": "sfdx-hardis",
|
|
7045
6978
|
"pluginName": "sfdx-hardis",
|
|
7046
6979
|
"pluginType": "core",
|
|
7047
6980
|
"strict": true,
|
|
7048
6981
|
"enableJsonFlag": true,
|
|
7049
|
-
"title": "
|
|
6982
|
+
"title": "Unused Connected Apps in an org",
|
|
6983
|
+
"allowedInactiveConnectedApps": [
|
|
6984
|
+
"Ant Migration Tool",
|
|
6985
|
+
"Chatter Desktop",
|
|
6986
|
+
"Chatter Mobile for BlackBerry",
|
|
6987
|
+
"Force.com IDE",
|
|
6988
|
+
"OIQ_Integration",
|
|
6989
|
+
"Salesforce CLI",
|
|
6990
|
+
"Salesforce Files",
|
|
6991
|
+
"Salesforce Mobile Dashboards",
|
|
6992
|
+
"Salesforce Touch",
|
|
6993
|
+
"Salesforce for Outlook",
|
|
6994
|
+
"SalesforceA",
|
|
6995
|
+
"SalesforceA for Android",
|
|
6996
|
+
"SalesforceA for iOS",
|
|
6997
|
+
"SalesforceDX Namespace Registry",
|
|
6998
|
+
"SalesforceIQ"
|
|
6999
|
+
],
|
|
7050
7000
|
"requiresProject": false,
|
|
7051
7001
|
"isESM": true,
|
|
7052
7002
|
"relativePath": [
|
|
@@ -7054,43 +7004,44 @@
|
|
|
7054
7004
|
"commands",
|
|
7055
7005
|
"hardis",
|
|
7056
7006
|
"org",
|
|
7057
|
-
"
|
|
7058
|
-
"
|
|
7007
|
+
"diagnose",
|
|
7008
|
+
"unused-connected-apps.js"
|
|
7059
7009
|
],
|
|
7060
7010
|
"aliasPermutations": [],
|
|
7061
7011
|
"permutations": [
|
|
7062
|
-
"hardis:org:
|
|
7063
|
-
"org:hardis:
|
|
7064
|
-
"org:
|
|
7065
|
-
"org:
|
|
7066
|
-
"hardis:
|
|
7067
|
-
"
|
|
7068
|
-
"
|
|
7069
|
-
"
|
|
7070
|
-
"hardis:
|
|
7071
|
-
"
|
|
7072
|
-
"
|
|
7073
|
-
"
|
|
7074
|
-
"hardis:org:
|
|
7075
|
-
"org:hardis:
|
|
7076
|
-
"org:
|
|
7077
|
-
"org:
|
|
7078
|
-
"hardis:
|
|
7079
|
-
"
|
|
7080
|
-
"
|
|
7081
|
-
"
|
|
7082
|
-
"hardis:
|
|
7083
|
-
"
|
|
7084
|
-
"
|
|
7085
|
-
"
|
|
7012
|
+
"hardis:org:diagnose:unused-connected-apps",
|
|
7013
|
+
"org:hardis:diagnose:unused-connected-apps",
|
|
7014
|
+
"org:diagnose:hardis:unused-connected-apps",
|
|
7015
|
+
"org:diagnose:unused-connected-apps:hardis",
|
|
7016
|
+
"hardis:diagnose:org:unused-connected-apps",
|
|
7017
|
+
"diagnose:hardis:org:unused-connected-apps",
|
|
7018
|
+
"diagnose:org:hardis:unused-connected-apps",
|
|
7019
|
+
"diagnose:org:unused-connected-apps:hardis",
|
|
7020
|
+
"hardis:diagnose:unused-connected-apps:org",
|
|
7021
|
+
"diagnose:hardis:unused-connected-apps:org",
|
|
7022
|
+
"diagnose:unused-connected-apps:hardis:org",
|
|
7023
|
+
"diagnose:unused-connected-apps:org:hardis",
|
|
7024
|
+
"hardis:org:unused-connected-apps:diagnose",
|
|
7025
|
+
"org:hardis:unused-connected-apps:diagnose",
|
|
7026
|
+
"org:unused-connected-apps:hardis:diagnose",
|
|
7027
|
+
"org:unused-connected-apps:diagnose:hardis",
|
|
7028
|
+
"hardis:unused-connected-apps:org:diagnose",
|
|
7029
|
+
"unused-connected-apps:hardis:org:diagnose",
|
|
7030
|
+
"unused-connected-apps:org:hardis:diagnose",
|
|
7031
|
+
"unused-connected-apps:org:diagnose:hardis",
|
|
7032
|
+
"hardis:unused-connected-apps:diagnose:org",
|
|
7033
|
+
"unused-connected-apps:hardis:diagnose:org",
|
|
7034
|
+
"unused-connected-apps:diagnose:hardis:org",
|
|
7035
|
+
"unused-connected-apps:diagnose:org:hardis"
|
|
7086
7036
|
]
|
|
7087
7037
|
},
|
|
7088
|
-
"hardis:org:
|
|
7038
|
+
"hardis:org:diagnose:unusedlicenses": {
|
|
7089
7039
|
"aliases": [],
|
|
7090
7040
|
"args": {},
|
|
7091
|
-
"description": "\
|
|
7041
|
+
"description": "\n## Command Behavior\n\n**Detects and suggests the deletion of unused Permission Set License Assignments in a Salesforce org.**\n\nWhen a Permission Set (PS) linked to a Permission Set License (PSL) is assigned to a user, a Permission Set License Assignment (PSLA) is automatically created. However, when that PS is unassigned from the user, the PSLA is *not* automatically deleted. This can lead to organizations being charged for unused PSLAs, representing a hidden cost and technical debt.\n\nThis command identifies such useless PSLAs and provides options to delete them, helping to optimize license usage and reduce unnecessary expenses.\n\nKey functionalities:\n\n- **PSLA Detection:** Queries the Salesforce org to find all active PSLAs.\n- **Usage Verification:** Correlates PSLAs with actual Permission Set Assignments and Permission Set Group Assignments to determine if the underlying Permission Sets are still assigned to the user.\n- **Special Case Handling:** Accounts for specific scenarios where profiles might implicitly assign PSLAs (e.g., `Salesforce API Only` profile assigning `SalesforceAPIIntegrationPsl`) and allows for always excluding certain PSLAs from the unused check.\n- **Reporting:** Generates a CSV report of all identified unused PSLAs, including the user and the associated Permission Set License.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of unused PSLAs.\n- **Interactive Deletion:** In non-CI environments, it offers an interactive prompt to bulk delete the identified unused PSLAs.\n\nMany thanks to [Vincent Finet](https://www.linkedin.com/in/vincentfinet/) for the inspiration during his great speaker session at [French Touch Dreamin '23](https://frenchtouchdreamin.com/), and his kind agreement for reusing such inspiration in this command 😊\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-unused-licenses/) 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 extensive querying of Salesforce objects and data correlation:\n\n- **SOQL Queries (Bulk API):** It uses `bulkQuery` and `bulkQueryChunksIn` to efficiently retrieve large volumes of data from `PermissionSetLicenseAssign`, `PermissionSetLicense`, `PermissionSet`, `PermissionSetGroupComponent`, and `PermissionSetAssignment` objects.\n- **Data Correlation:** It meticulously correlates data across these objects to determine if a `PermissionSetLicenseAssign` record has a corresponding active assignment to a Permission Set or Permission Set Group for the same user.\n- **Filtering Logic:** It applies complex filtering logic to exclude PSLAs that are genuinely in use or are part of predefined exceptions (e.g., `alwaysExcludeForActiveUsersPermissionSetLicenses`).\n- **Bulk Deletion:** If the user opts to delete unused PSLAs, it uses `bulkUpdate` with the `delete` operation to efficiently remove multiple records.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of unused PSLAs.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **User Interaction:** Uses `prompts` for interactive confirmation before performing deletion operations.\n</details>\n",
|
|
7092
7042
|
"examples": [
|
|
7093
|
-
"$ sf hardis:org:
|
|
7043
|
+
"$ sf hardis:org:diagnose:unusedlicenses",
|
|
7044
|
+
"$ sf hardis:org:diagnose:unusedlicenses --fix"
|
|
7094
7045
|
],
|
|
7095
7046
|
"flags": {
|
|
7096
7047
|
"json": {
|
|
@@ -7108,21 +7059,14 @@
|
|
|
7108
7059
|
"multiple": false,
|
|
7109
7060
|
"type": "option"
|
|
7110
7061
|
},
|
|
7111
|
-
"
|
|
7112
|
-
"char": "
|
|
7113
|
-
"description": "
|
|
7114
|
-
"name": "
|
|
7062
|
+
"outputfile": {
|
|
7063
|
+
"char": "f",
|
|
7064
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
7065
|
+
"name": "outputfile",
|
|
7115
7066
|
"hasDynamicHelp": false,
|
|
7116
7067
|
"multiple": false,
|
|
7117
7068
|
"type": "option"
|
|
7118
7069
|
},
|
|
7119
|
-
"overwrite": {
|
|
7120
|
-
"char": "f",
|
|
7121
|
-
"description": "Override existing files (doubles the number of API calls)",
|
|
7122
|
-
"name": "overwrite",
|
|
7123
|
-
"allowNo": false,
|
|
7124
|
-
"type": "boolean"
|
|
7125
|
-
},
|
|
7126
7070
|
"debug": {
|
|
7127
7071
|
"char": "d",
|
|
7128
7072
|
"description": "Activate debug mode (more logs)",
|
|
@@ -7161,58 +7105,79 @@
|
|
|
7161
7105
|
},
|
|
7162
7106
|
"hasDynamicHelp": true,
|
|
7163
7107
|
"hiddenAliases": [],
|
|
7164
|
-
"id": "hardis:org:
|
|
7108
|
+
"id": "hardis:org:diagnose:unusedlicenses",
|
|
7165
7109
|
"pluginAlias": "sfdx-hardis",
|
|
7166
7110
|
"pluginName": "sfdx-hardis",
|
|
7167
7111
|
"pluginType": "core",
|
|
7168
7112
|
"strict": true,
|
|
7169
7113
|
"enableJsonFlag": true,
|
|
7170
|
-
"title": "
|
|
7114
|
+
"title": "Detect unused Permission Set Licenses (beta)",
|
|
7171
7115
|
"requiresProject": false,
|
|
7116
|
+
"additionalPermissionSetsToAlwaysGet": [
|
|
7117
|
+
"Sales_User"
|
|
7118
|
+
],
|
|
7119
|
+
"permSetsPermSetLicenses": [
|
|
7120
|
+
{
|
|
7121
|
+
"permSet": "Sales_User",
|
|
7122
|
+
"permSetLicense": "SalesUserPsl"
|
|
7123
|
+
}
|
|
7124
|
+
],
|
|
7125
|
+
"profilesPermissionSetLicenses": [
|
|
7126
|
+
{
|
|
7127
|
+
"profile": "Salesforce API Only",
|
|
7128
|
+
"permSetLicense": "SalesforceAPIIntegrationPsl"
|
|
7129
|
+
}
|
|
7130
|
+
],
|
|
7131
|
+
"alwaysExcludeForActiveUsersPermissionSetLicenses": [
|
|
7132
|
+
"IdentityConnect"
|
|
7133
|
+
],
|
|
7172
7134
|
"isESM": true,
|
|
7173
7135
|
"relativePath": [
|
|
7174
7136
|
"lib",
|
|
7175
7137
|
"commands",
|
|
7176
7138
|
"hardis",
|
|
7177
7139
|
"org",
|
|
7178
|
-
"
|
|
7179
|
-
"
|
|
7140
|
+
"diagnose",
|
|
7141
|
+
"unusedlicenses.js"
|
|
7180
7142
|
],
|
|
7181
7143
|
"aliasPermutations": [],
|
|
7182
7144
|
"permutations": [
|
|
7183
|
-
"hardis:org:
|
|
7184
|
-
"org:hardis:
|
|
7185
|
-
"org:
|
|
7186
|
-
"org:
|
|
7187
|
-
"hardis:
|
|
7188
|
-
"
|
|
7189
|
-
"
|
|
7190
|
-
"
|
|
7191
|
-
"hardis:
|
|
7192
|
-
"
|
|
7193
|
-
"
|
|
7194
|
-
"
|
|
7195
|
-
"hardis:org:
|
|
7196
|
-
"org:hardis:
|
|
7197
|
-
"org:
|
|
7198
|
-
"org:
|
|
7199
|
-
"hardis:
|
|
7200
|
-
"
|
|
7201
|
-
"
|
|
7202
|
-
"
|
|
7203
|
-
"hardis:
|
|
7204
|
-
"
|
|
7205
|
-
"
|
|
7206
|
-
"
|
|
7145
|
+
"hardis:org:diagnose:unusedlicenses",
|
|
7146
|
+
"org:hardis:diagnose:unusedlicenses",
|
|
7147
|
+
"org:diagnose:hardis:unusedlicenses",
|
|
7148
|
+
"org:diagnose:unusedlicenses:hardis",
|
|
7149
|
+
"hardis:diagnose:org:unusedlicenses",
|
|
7150
|
+
"diagnose:hardis:org:unusedlicenses",
|
|
7151
|
+
"diagnose:org:hardis:unusedlicenses",
|
|
7152
|
+
"diagnose:org:unusedlicenses:hardis",
|
|
7153
|
+
"hardis:diagnose:unusedlicenses:org",
|
|
7154
|
+
"diagnose:hardis:unusedlicenses:org",
|
|
7155
|
+
"diagnose:unusedlicenses:hardis:org",
|
|
7156
|
+
"diagnose:unusedlicenses:org:hardis",
|
|
7157
|
+
"hardis:org:unusedlicenses:diagnose",
|
|
7158
|
+
"org:hardis:unusedlicenses:diagnose",
|
|
7159
|
+
"org:unusedlicenses:hardis:diagnose",
|
|
7160
|
+
"org:unusedlicenses:diagnose:hardis",
|
|
7161
|
+
"hardis:unusedlicenses:org:diagnose",
|
|
7162
|
+
"unusedlicenses:hardis:org:diagnose",
|
|
7163
|
+
"unusedlicenses:org:hardis:diagnose",
|
|
7164
|
+
"unusedlicenses:org:diagnose:hardis",
|
|
7165
|
+
"hardis:unusedlicenses:diagnose:org",
|
|
7166
|
+
"unusedlicenses:hardis:diagnose:org",
|
|
7167
|
+
"unusedlicenses:diagnose:hardis:org",
|
|
7168
|
+
"unusedlicenses:diagnose:org:hardis"
|
|
7207
7169
|
]
|
|
7208
7170
|
},
|
|
7209
|
-
"hardis:org:
|
|
7171
|
+
"hardis:org:diagnose:unusedusers": {
|
|
7210
7172
|
"aliases": [],
|
|
7211
7173
|
"args": {},
|
|
7212
|
-
"description": "
|
|
7174
|
+
"description": "\n## Command Behavior\n\n**Detects and reports on inactive or unused Salesforce user accounts, helping to optimize license usage and enhance security.**\n\nEfficient user management is vital in Salesforce to ensure resources are optimized and costs are controlled. However, inactive or unused user accounts can often go unnoticed, leading to wasted licenses and potential security risks. This tool addresses this challenge by enabling administrators to identify users who haven't logged in within a specified period.\n\nBy analyzing user login activity and last login timestamps, this feature highlights inactive user accounts, allowing administrators to take appropriate action. Whether it's deactivating dormant accounts, freeing up licenses, or ensuring compliance with security policies, this functionality empowers administrators to maintain a lean and secure Salesforce environment.\n\nKey functionalities:\n\n- **Inactivity Detection:** Identifies users who have not logged in for a specified number of days (`--days` flag, default 180 days in CI, 365 days otherwise).\n- **License Type Filtering:** Allows filtering users by license type using `--licensetypes` (e.g., `all-crm`, `all-paying`) or specific license identifiers using `--licenseidentifiers`.\n - `all-crm`: Includes `SFDC`, `AUL`, `AUL1`, `AULL_IGHT` licenses.\n - `all-paying`: Includes `SFDC`, `AUL`, `AUL1`, `AULL_IGHT`, `PID_Customer_Community`, `PID_Customer_Community_Login`, `PID_Partner_Community`, `PID_Partner_Community_Login` licenses.\n - Note: You can see the full list of available license identifiers in [Salesforce Documentation](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/sfdx_cli_reference/sforce_api_objects_userlicense.htm).\n- **Active User Retrieval:** The `--returnactiveusers` flag inverts the command, allowing you to retrieve active users who *have* logged in during the specified period.\n- **CSV Report Generation:** Generates a CSV file containing details of all identified users (inactive or active), including their last login date, profile, and license information.\n- **Notifications:** Sends notifications to configured channels (Grafana, Slack, MS Teams) with a summary of inactive or active users.\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-inactive-users/) 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- **SOQL Query (Bulk API):** It uses `bulkQuery` to efficiently retrieve user records from the Salesforce `User` object. The SOQL query dynamically constructs its WHERE clause based on the `--days`, `--licensetypes`, `--licenseidentifiers`, and `--returnactiveusers` flags.\n- **Interactive Prompts:** Uses `prompts` to interactively ask the user for the number of inactive days and license types if not provided via flags.\n- **License Mapping:** Internally maps common license type aliases (e.g., `all-crm`) to their corresponding Salesforce `LicenseDefinitionKey` values.\n- **Report Generation:** It uses `generateCsvFile` to create the CSV report of users.\n- **Notification Integration:** It integrates with the `NotifProvider` to send notifications, including attachments of the generated CSV report and metrics for monitoring dashboards.\n- **User Feedback:** Provides a summary of the findings in the console, indicating the number of inactive or active users found.\n</details>",
|
|
7213
7175
|
"examples": [
|
|
7214
|
-
"$ sf hardis:org:
|
|
7215
|
-
"$ sf hardis:org:
|
|
7176
|
+
"$ sf hardis:org:diagnose:unusedusers",
|
|
7177
|
+
"$ sf hardis:org:diagnose:unusedusers --days 365",
|
|
7178
|
+
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm",
|
|
7179
|
+
"$ sf hardis:org:diagnose:unusedusers --days 60 --licenseidentifiers SFDC,AUL,AUL1",
|
|
7180
|
+
"$ sf hardis:org:diagnose:unusedusers --days 60 --licensetypes all-crm --returnactiveusers"
|
|
7216
7181
|
],
|
|
7217
7182
|
"flags": {
|
|
7218
7183
|
"json": {
|
|
@@ -7230,14 +7195,49 @@
|
|
|
7230
7195
|
"multiple": false,
|
|
7231
7196
|
"type": "option"
|
|
7232
7197
|
},
|
|
7233
|
-
"
|
|
7198
|
+
"outputfile": {
|
|
7199
|
+
"char": "f",
|
|
7200
|
+
"description": "Force the path and name of output report file. Must end with .csv",
|
|
7201
|
+
"name": "outputfile",
|
|
7202
|
+
"hasDynamicHelp": false,
|
|
7203
|
+
"multiple": false,
|
|
7204
|
+
"type": "option"
|
|
7205
|
+
},
|
|
7206
|
+
"days": {
|
|
7207
|
+
"char": "t",
|
|
7208
|
+
"description": "Extracts the users that have been inactive for the amount of days specified. In CI, default is 180 days",
|
|
7209
|
+
"name": "days",
|
|
7210
|
+
"hasDynamicHelp": false,
|
|
7211
|
+
"multiple": false,
|
|
7212
|
+
"type": "option"
|
|
7213
|
+
},
|
|
7214
|
+
"licensetypes": {
|
|
7234
7215
|
"char": "l",
|
|
7235
|
-
"description": "
|
|
7236
|
-
"name": "
|
|
7216
|
+
"description": "Type of licenses to check. If set, do not use licenseidentifiers option. In CI, default is all-crm",
|
|
7217
|
+
"name": "licensetypes",
|
|
7218
|
+
"hasDynamicHelp": false,
|
|
7219
|
+
"multiple": false,
|
|
7220
|
+
"options": [
|
|
7221
|
+
"all",
|
|
7222
|
+
"all-crm",
|
|
7223
|
+
"all-paying"
|
|
7224
|
+
],
|
|
7225
|
+
"type": "option"
|
|
7226
|
+
},
|
|
7227
|
+
"licenseidentifiers": {
|
|
7228
|
+
"char": "i",
|
|
7229
|
+
"description": "Comma-separated list of license identifiers, in case licensetypes is not used.. Identifiers available at https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userlicense.htm",
|
|
7230
|
+
"name": "licenseidentifiers",
|
|
7237
7231
|
"hasDynamicHelp": false,
|
|
7238
7232
|
"multiple": false,
|
|
7239
7233
|
"type": "option"
|
|
7240
7234
|
},
|
|
7235
|
+
"returnactiveusers": {
|
|
7236
|
+
"description": "Inverts the command by returning the active users",
|
|
7237
|
+
"name": "returnactiveusers",
|
|
7238
|
+
"allowNo": false,
|
|
7239
|
+
"type": "boolean"
|
|
7240
|
+
},
|
|
7241
7241
|
"debug": {
|
|
7242
7242
|
"char": "d",
|
|
7243
7243
|
"description": "Activate debug mode (more logs)",
|
|
@@ -7276,49 +7276,49 @@
|
|
|
7276
7276
|
},
|
|
7277
7277
|
"hasDynamicHelp": true,
|
|
7278
7278
|
"hiddenAliases": [],
|
|
7279
|
-
"id": "hardis:org:
|
|
7279
|
+
"id": "hardis:org:diagnose:unusedusers",
|
|
7280
7280
|
"pluginAlias": "sfdx-hardis",
|
|
7281
7281
|
"pluginName": "sfdx-hardis",
|
|
7282
7282
|
"pluginType": "core",
|
|
7283
7283
|
"strict": true,
|
|
7284
7284
|
"enableJsonFlag": true,
|
|
7285
|
-
"title": "
|
|
7286
|
-
"requiresProject":
|
|
7285
|
+
"title": "Detect unused Users in Salesforce",
|
|
7286
|
+
"requiresProject": false,
|
|
7287
7287
|
"isESM": true,
|
|
7288
7288
|
"relativePath": [
|
|
7289
7289
|
"lib",
|
|
7290
7290
|
"commands",
|
|
7291
7291
|
"hardis",
|
|
7292
7292
|
"org",
|
|
7293
|
-
"
|
|
7294
|
-
"
|
|
7293
|
+
"diagnose",
|
|
7294
|
+
"unusedusers.js"
|
|
7295
7295
|
],
|
|
7296
7296
|
"aliasPermutations": [],
|
|
7297
7297
|
"permutations": [
|
|
7298
|
-
"hardis:org:
|
|
7299
|
-
"org:hardis:
|
|
7300
|
-
"org:
|
|
7301
|
-
"org:
|
|
7302
|
-
"hardis:
|
|
7303
|
-
"
|
|
7304
|
-
"
|
|
7305
|
-
"
|
|
7306
|
-
"hardis:
|
|
7307
|
-
"
|
|
7308
|
-
"
|
|
7309
|
-
"
|
|
7310
|
-
"hardis:org:
|
|
7311
|
-
"org:hardis:
|
|
7312
|
-
"org:
|
|
7313
|
-
"org:
|
|
7314
|
-
"hardis:
|
|
7315
|
-
"
|
|
7316
|
-
"
|
|
7317
|
-
"
|
|
7318
|
-
"hardis:
|
|
7319
|
-
"
|
|
7320
|
-
"
|
|
7321
|
-
"
|
|
7298
|
+
"hardis:org:diagnose:unusedusers",
|
|
7299
|
+
"org:hardis:diagnose:unusedusers",
|
|
7300
|
+
"org:diagnose:hardis:unusedusers",
|
|
7301
|
+
"org:diagnose:unusedusers:hardis",
|
|
7302
|
+
"hardis:diagnose:org:unusedusers",
|
|
7303
|
+
"diagnose:hardis:org:unusedusers",
|
|
7304
|
+
"diagnose:org:hardis:unusedusers",
|
|
7305
|
+
"diagnose:org:unusedusers:hardis",
|
|
7306
|
+
"hardis:diagnose:unusedusers:org",
|
|
7307
|
+
"diagnose:hardis:unusedusers:org",
|
|
7308
|
+
"diagnose:unusedusers:hardis:org",
|
|
7309
|
+
"diagnose:unusedusers:org:hardis",
|
|
7310
|
+
"hardis:org:unusedusers:diagnose",
|
|
7311
|
+
"org:hardis:unusedusers:diagnose",
|
|
7312
|
+
"org:unusedusers:hardis:diagnose",
|
|
7313
|
+
"org:unusedusers:diagnose:hardis",
|
|
7314
|
+
"hardis:unusedusers:org:diagnose",
|
|
7315
|
+
"unusedusers:hardis:org:diagnose",
|
|
7316
|
+
"unusedusers:org:hardis:diagnose",
|
|
7317
|
+
"unusedusers:org:diagnose:hardis",
|
|
7318
|
+
"hardis:unusedusers:diagnose:org",
|
|
7319
|
+
"unusedusers:hardis:diagnose:org",
|
|
7320
|
+
"unusedusers:diagnose:hardis:org",
|
|
7321
|
+
"unusedusers:diagnose:org:hardis"
|
|
7322
7322
|
]
|
|
7323
7323
|
},
|
|
7324
7324
|
"hardis:org:generate:packagexmlfull": {
|
|
@@ -15504,5 +15504,5 @@
|
|
|
15504
15504
|
]
|
|
15505
15505
|
}
|
|
15506
15506
|
},
|
|
15507
|
-
"version": "6.12.
|
|
15507
|
+
"version": "6.12.10"
|
|
15508
15508
|
}
|