sfdx-hardis 5.45.1-beta202508100129.0 → 5.45.1-beta202508100154.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/oclif.manifest.json +383 -383
  2. package/package.json +1 -1
@@ -132,12 +132,13 @@
132
132
  "clear:cache:hardis"
133
133
  ]
134
134
  },
135
- "hardis:config:get": {
135
+ "hardis:auth:login": {
136
136
  "aliases": [],
137
137
  "args": {},
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",
138
+ "description": "\n## Command Behavior\n\n**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**\n\nThis command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.\n\nKey aspects:\n\n- **Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:\n - For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)\n - For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)\n- **Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.\n\nTo obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.\n\n## Technical explanations\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",
139
139
  "examples": [
140
- "$ sf hardis:project:deploy:sources:metadata"
140
+ "$ sf hardis:auth:login",
141
+ "CI=true sf hardis:auth:login"
141
142
  ],
142
143
  "flags": {
143
144
  "json": {
@@ -155,20 +156,28 @@
155
156
  "multiple": false,
156
157
  "type": "option"
157
158
  },
158
- "level": {
159
- "char": "l",
160
- "description": "project,branch or user",
161
- "name": "level",
162
- "default": "project",
159
+ "instanceurl": {
160
+ "char": "r",
161
+ "description": "URL of org instance",
162
+ "name": "instanceurl",
163
163
  "hasDynamicHelp": false,
164
164
  "multiple": false,
165
- "options": [
166
- "project",
167
- "branch",
168
- "user"
169
- ],
170
165
  "type": "option"
171
166
  },
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
+ },
172
181
  "debug": {
173
182
  "char": "d",
174
183
  "description": "Activate debug mode (more logs)",
@@ -192,39 +201,38 @@
192
201
  },
193
202
  "hasDynamicHelp": false,
194
203
  "hiddenAliases": [],
195
- "id": "hardis:config:get",
204
+ "id": "hardis:auth:login",
196
205
  "pluginAlias": "sfdx-hardis",
197
206
  "pluginName": "sfdx-hardis",
198
207
  "pluginType": "core",
199
208
  "strict": true,
200
209
  "enableJsonFlag": true,
201
- "title": "Deploy metadata sources to org",
210
+ "title": "Login",
202
211
  "requiresProject": false,
203
212
  "isESM": true,
204
213
  "relativePath": [
205
214
  "lib",
206
215
  "commands",
207
216
  "hardis",
208
- "config",
209
- "get.js"
217
+ "auth",
218
+ "login.js"
210
219
  ],
211
220
  "aliasPermutations": [],
212
221
  "permutations": [
213
- "hardis:config:get",
214
- "config:hardis:get",
215
- "config:get:hardis",
216
- "hardis:get:config",
217
- "get:hardis:config",
218
- "get:config:hardis"
222
+ "hardis:auth:login",
223
+ "auth:hardis:login",
224
+ "auth:login:hardis",
225
+ "hardis:login:auth",
226
+ "login:hardis:auth",
227
+ "login:auth:hardis"
219
228
  ]
220
229
  },
221
- "hardis:auth:login": {
230
+ "hardis:config:get": {
222
231
  "aliases": [],
223
232
  "args": {},
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## Technical explanations\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",
233
+ "description": "\n## Command Behavior\n\n**Retrieves and displays the sfdx-hardis configuration for a specified level.**\n\nThis command allows you to inspect the configuration that is currently in effect for your project, which is useful for debugging and understanding how sfdx-hardis will behave.\n\n- **Configuration levels:** It can retrieve configuration from three different levels:\n - **Project:** The configuration defined in the project's `.sfdx-hardis.yml` file.\n - **Branch:** The configuration defined in a branch-specific configuration file (e.g., `.sfdx-hardis.production.yml`).\n - **User:** The global user-level configuration.\n\n## Technical explanations\n\nThe command's logic is straightforward:\n\n- **`getConfig` function:** It calls the `getConfig` utility function, passing the desired configuration level as an argument.\n- **Configuration loading:** The `getConfig` function is responsible for finding the appropriate configuration file, reading its contents, and parsing it as YAML or JSON.\n- **Output:** The retrieved configuration is then displayed to the user as a JSON string.\n",
225
234
  "examples": [
226
- "$ sf hardis:auth:login",
227
- "CI=true sf hardis:auth:login"
235
+ "$ sf hardis:project:deploy:sources:metadata"
228
236
  ],
229
237
  "flags": {
230
238
  "json": {
@@ -242,28 +250,20 @@
242
250
  "multiple": false,
243
251
  "type": "option"
244
252
  },
245
- "instanceurl": {
246
- "char": "r",
247
- "description": "URL of org instance",
248
- "name": "instanceurl",
253
+ "level": {
254
+ "char": "l",
255
+ "description": "project,branch or user",
256
+ "name": "level",
257
+ "default": "project",
249
258
  "hasDynamicHelp": false,
250
259
  "multiple": false,
260
+ "options": [
261
+ "project",
262
+ "branch",
263
+ "user"
264
+ ],
251
265
  "type": "option"
252
266
  },
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:auth:login",
290
+ "id": "hardis:config:get",
291
291
  "pluginAlias": "sfdx-hardis",
292
292
  "pluginName": "sfdx-hardis",
293
293
  "pluginType": "core",
294
294
  "strict": true,
295
295
  "enableJsonFlag": true,
296
- "title": "Login",
296
+ "title": "Deploy metadata sources to org",
297
297
  "requiresProject": false,
298
298
  "isESM": true,
299
299
  "relativePath": [
300
300
  "lib",
301
301
  "commands",
302
302
  "hardis",
303
- "auth",
304
- "login.js"
303
+ "config",
304
+ "get.js"
305
305
  ],
306
306
  "aliasPermutations": [],
307
307
  "permutations": [
308
- "hardis:auth:login",
309
- "auth:hardis:login",
310
- "auth:login:hardis",
311
- "hardis:login:auth",
312
- "login:hardis:auth",
313
- "login:auth:hardis"
308
+ "hardis:config:get",
309
+ "config:hardis:get",
310
+ "config:get:hardis",
311
+ "hardis:get:config",
312
+ "get:hardis:config",
313
+ "get:config:hardis"
314
314
  ]
315
315
  },
316
316
  "hardis:doc:fieldusage": {
@@ -5482,12 +5482,13 @@
5482
5482
  "import:data:org:hardis"
5483
5483
  ]
5484
5484
  },
5485
- "hardis:org:files:export": {
5485
+ "hardis:org:fix:listviewmine": {
5486
5486
  "aliases": [],
5487
5487
  "args": {},
5488
- "description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, and output naming conventions.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n## Technical explanations\n\nThe command's technical implementation involves:\n\n- **FilesExporter Class:** The core logic is encapsulated within the `FilesExporter` class, which orchestrates the entire export process.\n- **SOQL Queries (Bulk API):** It uses Salesforce Bulk API queries to efficiently retrieve large volumes of parent record IDs and file metadata.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project and `promptFilesExportConfiguration` for customizing export options.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues or API limits.\n",
5488
+ "description": "Fix listviews whose scope Mine has been replaced by Everything\n\n[![Invalid scope:Mine, not allowed ? Deploy your ListViews anyway !](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-invalid-scope-mine.jpg)](https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7)\n\nList of ListViews can be:\n\n- read from .sfdx-hardis.yml file in property **listViewsToSetToMine**\n- sent in argument listviews\n\nNote: property **listViewsToSetToMine** can be auto-generated by command hardis:work:save if .sfdx-hardis.yml contains the following configuration\n\n```yaml\nautoCleanTypes:\n - listViewsMine\n```\n\n- Example of sfdx-hardis.yml property `listViewsToSetToMine`:\n\n```yaml\nlistViewsToSetToMine:\n - \"force-app/main/default/objects/Operation__c/listViews/MyCurrentOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Operation__c/listViews/MyFinalizedOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/Default_Opportunity_Pipeline.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MyCurrentSubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MySubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Account/listViews/MyActivePartners.listView-meta.xml\"\n```\n\n- If manually written, this could also be:\n\n```yaml\nlistViewsToSetToMine:\n - \"Operation__c:MyCurrentOperations\"\n - \"Operation__c:MyFinalizedOperations\"\n - \"Opportunity:Default_Opportunity_Pipeline\"\n - \"Opportunity:MyCurrentSubscriptions\"\n - \"Opportunity:MySubscriptions\"\n - \"Account:MyActivePartners\"\n```\n\nTroubleshooting: if you need to run this command from an alpine-linux based docker image, use this workaround in your dockerfile:\n\n```dockerfile\n# Do not use puppeteer embedded chromium\nRUN apk add --update --no-cache chromium\nENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=\"true\"\nENV CHROMIUM_PATH=\"/usr/bin/chromium-browser\"\nENV PUPPETEER_EXECUTABLE_PATH=\"$\\{CHROMIUM_PATH}\" // remove \\ before {\n```\n",
5489
5489
  "examples": [
5490
- "$ sf hardis:org:files:export"
5490
+ "$ sf hardis:org:fix:listviewmine",
5491
+ "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
5491
5492
  ],
5492
5493
  "flags": {
5493
5494
  "json": {
@@ -5505,37 +5506,10 @@
5505
5506
  "multiple": false,
5506
5507
  "type": "option"
5507
5508
  },
5508
- "path": {
5509
- "char": "p",
5510
- "description": "Path to the file export project",
5511
- "name": "path",
5512
- "hasDynamicHelp": false,
5513
- "multiple": false,
5514
- "type": "option"
5515
- },
5516
- "chunksize": {
5517
- "char": "c",
5518
- "description": "Number of records to add in a chunk before it is processed",
5519
- "name": "chunksize",
5520
- "default": 1000,
5521
- "hasDynamicHelp": false,
5522
- "multiple": false,
5523
- "type": "option"
5524
- },
5525
- "polltimeout": {
5526
- "char": "t",
5527
- "description": "Timeout in MS for Bulk API calls",
5528
- "name": "polltimeout",
5529
- "default": 300000,
5530
- "hasDynamicHelp": false,
5531
- "multiple": false,
5532
- "type": "option"
5533
- },
5534
- "startchunknumber": {
5535
- "char": "s",
5536
- "description": "Chunk number to start from",
5537
- "name": "startchunknumber",
5538
- "default": 0,
5509
+ "listviews": {
5510
+ "char": "l",
5511
+ "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
5512
+ "name": "listviews",
5539
5513
  "hasDynamicHelp": false,
5540
5514
  "multiple": false,
5541
5515
  "type": "option"
@@ -5578,57 +5552,60 @@
5578
5552
  },
5579
5553
  "hasDynamicHelp": true,
5580
5554
  "hiddenAliases": [],
5581
- "id": "hardis:org:files:export",
5555
+ "id": "hardis:org:fix:listviewmine",
5582
5556
  "pluginAlias": "sfdx-hardis",
5583
5557
  "pluginName": "sfdx-hardis",
5584
5558
  "pluginType": "core",
5585
5559
  "strict": true,
5586
5560
  "enableJsonFlag": true,
5587
- "title": "Export files",
5588
- "requiresProject": false,
5561
+ "title": "Fix listviews with ",
5562
+ "requiresProject": true,
5589
5563
  "isESM": true,
5590
5564
  "relativePath": [
5591
5565
  "lib",
5592
5566
  "commands",
5593
5567
  "hardis",
5594
5568
  "org",
5595
- "files",
5596
- "export.js"
5569
+ "fix",
5570
+ "listviewmine.js"
5597
5571
  ],
5598
5572
  "aliasPermutations": [],
5599
5573
  "permutations": [
5600
- "hardis:org:files:export",
5601
- "org:hardis:files:export",
5602
- "org:files:hardis:export",
5603
- "org:files:export:hardis",
5604
- "hardis:files:org:export",
5605
- "files:hardis:org:export",
5606
- "files:org:hardis:export",
5607
- "files:org:export:hardis",
5608
- "hardis:files:export:org",
5609
- "files:hardis:export:org",
5610
- "files:export:hardis:org",
5611
- "files:export:org:hardis",
5612
- "hardis:org:export:files",
5613
- "org:hardis:export:files",
5614
- "org:export:hardis:files",
5615
- "org:export:files:hardis",
5616
- "hardis:export:org:files",
5617
- "export:hardis:org:files",
5618
- "export:org:hardis:files",
5619
- "export:org:files:hardis",
5620
- "hardis:export:files:org",
5621
- "export:hardis:files:org",
5622
- "export:files:hardis:org",
5623
- "export:files:org:hardis"
5574
+ "hardis:org:fix:listviewmine",
5575
+ "org:hardis:fix:listviewmine",
5576
+ "org:fix:hardis:listviewmine",
5577
+ "org:fix:listviewmine:hardis",
5578
+ "hardis:fix:org:listviewmine",
5579
+ "fix:hardis:org:listviewmine",
5580
+ "fix:org:hardis:listviewmine",
5581
+ "fix:org:listviewmine:hardis",
5582
+ "hardis:fix:listviewmine:org",
5583
+ "fix:hardis:listviewmine:org",
5584
+ "fix:listviewmine:hardis:org",
5585
+ "fix:listviewmine:org:hardis",
5586
+ "hardis:org:listviewmine:fix",
5587
+ "org:hardis:listviewmine:fix",
5588
+ "org:listviewmine:hardis:fix",
5589
+ "org:listviewmine:fix:hardis",
5590
+ "hardis:listviewmine:org:fix",
5591
+ "listviewmine:hardis:org:fix",
5592
+ "listviewmine:org:hardis:fix",
5593
+ "listviewmine:org:fix:hardis",
5594
+ "hardis:listviewmine:fix:org",
5595
+ "listviewmine:hardis:fix:org",
5596
+ "listviewmine:fix:hardis:org",
5597
+ "listviewmine:fix:org:hardis"
5624
5598
  ]
5625
5599
  },
5626
- "hardis:org:files:import": {
5600
+ "hardis:org:diagnose:audittrail": {
5627
5601
  "aliases": [],
5628
5602
  "args": {},
5629
- "description": "\nThis command facilitates the mass upload of files into Salesforce, allowing you to populate records with associated documents, images, or other file types. It's a crucial tool for data migration, content seeding, or synchronizing external file repositories with Salesforce.\n\nKey functionalities:\n\n- **Configuration-Driven Import:** Relies on an `export.json` file within a designated file export project (created using `sf hardis:org:configure:files`) to determine which files to import and how they should be associated with Salesforce records.\n- **Interactive Project Selection:** If the file import project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Overwrite Option:** The `--overwrite` flag allows you to replace existing files in Salesforce with local versions that have the same name. Be aware that this option doubles the number of API calls used.\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for how to export files, which is often a prerequisite for importing:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n## Technical explanations\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",
5603
+ "description": "Export Audit trail into a CSV file with selected criteria, and highlight suspect actions\n\nAlso detects updates of Custom Settings values (disable by defining `SKIP_AUDIT_TRAIL_CUSTOM_SETTINGS=true`)\n\nRegular setup actions performed in major orgs are filtered.\n\n- \"\"\n - createScratchOrg\n - changedsenderemail\n - deleteScratchOrg\n - loginasgrantedtopartnerbt\n- Certificate and Key Management\n - insertCertificate\n- Custom App Licenses\n - addeduserpackagelicense\n - granteduserpackagelicense\n - revokeduserpackagelicense\n- Customer Portal\n - createdcustomersuccessuser\n - CSPUserDisabled\n- Currency\n - updateddatedexchrate\n- Data Management\n - queueMembership\n- Email Administration\n - dkimRotationPreparationSuccessful\n - dkimRotationSuccessful\n- External Objects\n - xdsEncryptedFieldChange\n- Groups\n - groupMembership\n- Holidays\n - holiday_insert\n- Inbox mobile and legacy desktop apps\n - enableSIQUserNonEAC\n - siqUserAcceptedTOS\n- Manage Users\n - activateduser\n - createduser\n - changedcommunitynickname\n - changedemail\n - changedfederationid\n - changedpassword\n - changedinteractionuseroffon\n - changedinteractionuseronoff\n - changedmarketinguseroffon\n - changedmarketinguseronoff\n - changedofflineuseroffon\n - changedprofileforuserstdtostd\n - changedprofileforuser\n - changedprofileforusercusttostd\n - changedprofileforuserstdtocust\n - changedroleforusertonone\n - changedroleforuser\n - changedroleforuserfromnone\n - changedUserAdminVerifiedStatusVerified\n - changedUserEmailVerifiedStatusUnverified\n - changedUserEmailVerifiedStatusVerified\n - changedknowledgeuseroffon\n - changedsfcontentuseroffon\n - changedsupportuseroffon\n - changedusername\n - changedUserPhoneNumber\n - changedUserPhoneVerifiedStatusUnverified\n - changedUserPhoneVerifiedStatusVerified\n - deactivateduser\n - deleteAuthenticatorPairing\n - deleteTwoFactorInfo2\n - deleteTwoFactorTempCode\n - frozeuser\n - insertAuthenticatorPairing\n - insertTwoFactorInfo2\n - insertTwoFactorTempCode\n - lightningloginenroll\n - PermSetAssign\n - PermSetGroupAssign\n - PermSetGroupUnassign\n - PermSetLicenseAssign\n - PermSetUnassign\n - PermSetLicenseUnassign\n - registeredUserPhoneNumber\n - resetpassword\n - suNetworkAdminLogin\n - suNetworkAdminLogout\n - suOrgAdminLogin\n - suOrgAdminLogout\n - unfrozeuser\n - useremailchangesent\n- Mobile Administration\n - assigneduserstomobileconfig\n- Reporting Snapshots\n - createdReportJob\n - deletedReportJob\n- Sandboxes\n - DeleteSandbox\n\nBy default, deployment user defined in .sfdx-hardis.yml targetUsername property will be excluded.\n\nYou can define additional users to exclude in .sfdx-hardis.yml **monitoringExcludeUsernames** property.\n\nYou can also add more sections / actions considered as not suspect using property **monitoringAllowedSectionsActions**\n\nExample:\n\n```yaml\nmonitoringExcludeUsernames:\n - deploymentuser@cloudity.com\n - marketingcloud@cloudity.com\n - integration-user@cloudity.com\n\nmonitoringAllowedSectionsActions:\n \"Some section\": [] // Will ignore all actions from such section\n \"Some other section\": [\"actionType1\",\"actionType2\",\"actionType3\"] // Will ignore only those 3 actions from section \"Some other section\". Other actions in the same section will be considered as suspect.\n```\n\n## Excel output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-excel.jpg)\n\n## Local output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-local.jpg)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-suspect-audit-trail/) and can output Grafana, Slack and MsTeams Notifications.\n",
5630
5604
  "examples": [
5631
- "$ sf hardis:org:files:import"
5605
+ "$ sf hardis:org:diagnose:audittrail",
5606
+ "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
5607
+ "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
5608
+ "$ sf hardis:org:diagnose:audittrail --lastndays 5"
5632
5609
  ],
5633
5610
  "flags": {
5634
5611
  "json": {
@@ -5646,20 +5623,29 @@
5646
5623
  "multiple": false,
5647
5624
  "type": "option"
5648
5625
  },
5649
- "path": {
5650
- "char": "p",
5651
- "description": "Path to the file export project",
5652
- "name": "path",
5626
+ "excludeusers": {
5627
+ "char": "e",
5628
+ "description": "Comma-separated list of usernames to exclude",
5629
+ "name": "excludeusers",
5653
5630
  "hasDynamicHelp": false,
5654
5631
  "multiple": false,
5655
5632
  "type": "option"
5656
5633
  },
5657
- "overwrite": {
5634
+ "lastndays": {
5635
+ "char": "t",
5636
+ "description": "Number of days to extract from today (included)",
5637
+ "name": "lastndays",
5638
+ "hasDynamicHelp": false,
5639
+ "multiple": false,
5640
+ "type": "option"
5641
+ },
5642
+ "outputfile": {
5658
5643
  "char": "f",
5659
- "description": "Override existing files (doubles the number of API calls)",
5660
- "name": "overwrite",
5661
- "allowNo": false,
5662
- "type": "boolean"
5644
+ "description": "Force the path and name of output report file. Must end with .csv",
5645
+ "name": "outputfile",
5646
+ "hasDynamicHelp": false,
5647
+ "multiple": false,
5648
+ "type": "option"
5663
5649
  },
5664
5650
  "debug": {
5665
5651
  "char": "d",
@@ -5699,13 +5685,13 @@
5699
5685
  },
5700
5686
  "hasDynamicHelp": true,
5701
5687
  "hiddenAliases": [],
5702
- "id": "hardis:org:files:import",
5688
+ "id": "hardis:org:diagnose:audittrail",
5703
5689
  "pluginAlias": "sfdx-hardis",
5704
5690
  "pluginName": "sfdx-hardis",
5705
5691
  "pluginType": "core",
5706
5692
  "strict": true,
5707
5693
  "enableJsonFlag": true,
5708
- "title": "Import files",
5694
+ "title": "Diagnose content of Setup Audit Trail",
5709
5695
  "requiresProject": false,
5710
5696
  "isESM": true,
5711
5697
  "relativePath": [
@@ -5713,256 +5699,8 @@
5713
5699
  "commands",
5714
5700
  "hardis",
5715
5701
  "org",
5716
- "files",
5717
- "import.js"
5718
- ],
5719
- "aliasPermutations": [],
5720
- "permutations": [
5721
- "hardis:org:files:import",
5722
- "org:hardis:files:import",
5723
- "org:files:hardis:import",
5724
- "org:files:import:hardis",
5725
- "hardis:files:org:import",
5726
- "files:hardis:org:import",
5727
- "files:org:hardis:import",
5728
- "files:org:import:hardis",
5729
- "hardis:files:import:org",
5730
- "files:hardis:import:org",
5731
- "files:import:hardis:org",
5732
- "files:import:org:hardis",
5733
- "hardis:org:import:files",
5734
- "org:hardis:import:files",
5735
- "org:import:hardis:files",
5736
- "org:import:files:hardis",
5737
- "hardis:import:org:files",
5738
- "import:hardis:org:files",
5739
- "import:org:hardis:files",
5740
- "import:org:files:hardis",
5741
- "hardis:import:files:org",
5742
- "import:hardis:files:org",
5743
- "import:files:hardis:org",
5744
- "import:files:org:hardis"
5745
- ]
5746
- },
5747
- "hardis:org:fix:listviewmine": {
5748
- "aliases": [],
5749
- "args": {},
5750
- "description": "Fix listviews whose scope Mine has been replaced by Everything\n\n[![Invalid scope:Mine, not allowed ? Deploy your ListViews anyway !](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-invalid-scope-mine.jpg)](https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7)\n\nList of ListViews can be:\n\n- read from .sfdx-hardis.yml file in property **listViewsToSetToMine**\n- sent in argument listviews\n\nNote: property **listViewsToSetToMine** can be auto-generated by command hardis:work:save if .sfdx-hardis.yml contains the following configuration\n\n```yaml\nautoCleanTypes:\n - listViewsMine\n```\n\n- Example of sfdx-hardis.yml property `listViewsToSetToMine`:\n\n```yaml\nlistViewsToSetToMine:\n - \"force-app/main/default/objects/Operation__c/listViews/MyCurrentOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Operation__c/listViews/MyFinalizedOperations.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/Default_Opportunity_Pipeline.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MyCurrentSubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Opportunity/listViews/MySubscriptions.listView-meta.xml\"\n - \"force-app/main/default/objects/Account/listViews/MyActivePartners.listView-meta.xml\"\n```\n\n- If manually written, this could also be:\n\n```yaml\nlistViewsToSetToMine:\n - \"Operation__c:MyCurrentOperations\"\n - \"Operation__c:MyFinalizedOperations\"\n - \"Opportunity:Default_Opportunity_Pipeline\"\n - \"Opportunity:MyCurrentSubscriptions\"\n - \"Opportunity:MySubscriptions\"\n - \"Account:MyActivePartners\"\n```\n\nTroubleshooting: if you need to run this command from an alpine-linux based docker image, use this workaround in your dockerfile:\n\n```dockerfile\n# Do not use puppeteer embedded chromium\nRUN apk add --update --no-cache chromium\nENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=\"true\"\nENV CHROMIUM_PATH=\"/usr/bin/chromium-browser\"\nENV PUPPETEER_EXECUTABLE_PATH=\"$\\{CHROMIUM_PATH}\" // remove \\ before {\n```\n",
5751
- "examples": [
5752
- "$ sf hardis:org:fix:listviewmine",
5753
- "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
5754
- ],
5755
- "flags": {
5756
- "json": {
5757
- "description": "Format output as json.",
5758
- "helpGroup": "GLOBAL",
5759
- "name": "json",
5760
- "allowNo": false,
5761
- "type": "boolean"
5762
- },
5763
- "flags-dir": {
5764
- "helpGroup": "GLOBAL",
5765
- "name": "flags-dir",
5766
- "summary": "Import flag values from a directory.",
5767
- "hasDynamicHelp": false,
5768
- "multiple": false,
5769
- "type": "option"
5770
- },
5771
- "listviews": {
5772
- "char": "l",
5773
- "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
5774
- "name": "listviews",
5775
- "hasDynamicHelp": false,
5776
- "multiple": false,
5777
- "type": "option"
5778
- },
5779
- "debug": {
5780
- "char": "d",
5781
- "description": "Activate debug mode (more logs)",
5782
- "name": "debug",
5783
- "allowNo": false,
5784
- "type": "boolean"
5785
- },
5786
- "websocket": {
5787
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5788
- "name": "websocket",
5789
- "hasDynamicHelp": false,
5790
- "multiple": false,
5791
- "type": "option"
5792
- },
5793
- "skipauth": {
5794
- "description": "Skip authentication check when a default username is required",
5795
- "name": "skipauth",
5796
- "allowNo": false,
5797
- "type": "boolean"
5798
- },
5799
- "target-org": {
5800
- "aliases": [
5801
- "targetusername",
5802
- "u"
5803
- ],
5804
- "char": "o",
5805
- "deprecateAliases": true,
5806
- "name": "target-org",
5807
- "noCacheDefault": true,
5808
- "required": true,
5809
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5810
- "hasDynamicHelp": true,
5811
- "multiple": false,
5812
- "type": "option"
5813
- }
5814
- },
5815
- "hasDynamicHelp": true,
5816
- "hiddenAliases": [],
5817
- "id": "hardis:org:fix:listviewmine",
5818
- "pluginAlias": "sfdx-hardis",
5819
- "pluginName": "sfdx-hardis",
5820
- "pluginType": "core",
5821
- "strict": true,
5822
- "enableJsonFlag": true,
5823
- "title": "Fix listviews with ",
5824
- "requiresProject": true,
5825
- "isESM": true,
5826
- "relativePath": [
5827
- "lib",
5828
- "commands",
5829
- "hardis",
5830
- "org",
5831
- "fix",
5832
- "listviewmine.js"
5833
- ],
5834
- "aliasPermutations": [],
5835
- "permutations": [
5836
- "hardis:org:fix:listviewmine",
5837
- "org:hardis:fix:listviewmine",
5838
- "org:fix:hardis:listviewmine",
5839
- "org:fix:listviewmine:hardis",
5840
- "hardis:fix:org:listviewmine",
5841
- "fix:hardis:org:listviewmine",
5842
- "fix:org:hardis:listviewmine",
5843
- "fix:org:listviewmine:hardis",
5844
- "hardis:fix:listviewmine:org",
5845
- "fix:hardis:listviewmine:org",
5846
- "fix:listviewmine:hardis:org",
5847
- "fix:listviewmine:org:hardis",
5848
- "hardis:org:listviewmine:fix",
5849
- "org:hardis:listviewmine:fix",
5850
- "org:listviewmine:hardis:fix",
5851
- "org:listviewmine:fix:hardis",
5852
- "hardis:listviewmine:org:fix",
5853
- "listviewmine:hardis:org:fix",
5854
- "listviewmine:org:hardis:fix",
5855
- "listviewmine:org:fix:hardis",
5856
- "hardis:listviewmine:fix:org",
5857
- "listviewmine:hardis:fix:org",
5858
- "listviewmine:fix:hardis:org",
5859
- "listviewmine:fix:org:hardis"
5860
- ]
5861
- },
5862
- "hardis:org:diagnose:audittrail": {
5863
- "aliases": [],
5864
- "args": {},
5865
- "description": "Export Audit trail into a CSV file with selected criteria, and highlight suspect actions\n\nAlso detects updates of Custom Settings values (disable by defining `SKIP_AUDIT_TRAIL_CUSTOM_SETTINGS=true`)\n\nRegular setup actions performed in major orgs are filtered.\n\n- \"\"\n - createScratchOrg\n - changedsenderemail\n - deleteScratchOrg\n - loginasgrantedtopartnerbt\n- Certificate and Key Management\n - insertCertificate\n- Custom App Licenses\n - addeduserpackagelicense\n - granteduserpackagelicense\n - revokeduserpackagelicense\n- Customer Portal\n - createdcustomersuccessuser\n - CSPUserDisabled\n- Currency\n - updateddatedexchrate\n- Data Management\n - queueMembership\n- Email Administration\n - dkimRotationPreparationSuccessful\n - dkimRotationSuccessful\n- External Objects\n - xdsEncryptedFieldChange\n- Groups\n - groupMembership\n- Holidays\n - holiday_insert\n- Inbox mobile and legacy desktop apps\n - enableSIQUserNonEAC\n - siqUserAcceptedTOS\n- Manage Users\n - activateduser\n - createduser\n - changedcommunitynickname\n - changedemail\n - changedfederationid\n - changedpassword\n - changedinteractionuseroffon\n - changedinteractionuseronoff\n - changedmarketinguseroffon\n - changedmarketinguseronoff\n - changedofflineuseroffon\n - changedprofileforuserstdtostd\n - changedprofileforuser\n - changedprofileforusercusttostd\n - changedprofileforuserstdtocust\n - changedroleforusertonone\n - changedroleforuser\n - changedroleforuserfromnone\n - changedUserAdminVerifiedStatusVerified\n - changedUserEmailVerifiedStatusUnverified\n - changedUserEmailVerifiedStatusVerified\n - changedknowledgeuseroffon\n - changedsfcontentuseroffon\n - changedsupportuseroffon\n - changedusername\n - changedUserPhoneNumber\n - changedUserPhoneVerifiedStatusUnverified\n - changedUserPhoneVerifiedStatusVerified\n - deactivateduser\n - deleteAuthenticatorPairing\n - deleteTwoFactorInfo2\n - deleteTwoFactorTempCode\n - frozeuser\n - insertAuthenticatorPairing\n - insertTwoFactorInfo2\n - insertTwoFactorTempCode\n - lightningloginenroll\n - PermSetAssign\n - PermSetGroupAssign\n - PermSetGroupUnassign\n - PermSetLicenseAssign\n - PermSetUnassign\n - PermSetLicenseUnassign\n - registeredUserPhoneNumber\n - resetpassword\n - suNetworkAdminLogin\n - suNetworkAdminLogout\n - suOrgAdminLogin\n - suOrgAdminLogout\n - unfrozeuser\n - useremailchangesent\n- Mobile Administration\n - assigneduserstomobileconfig\n- Reporting Snapshots\n - createdReportJob\n - deletedReportJob\n- Sandboxes\n - DeleteSandbox\n\nBy default, deployment user defined in .sfdx-hardis.yml targetUsername property will be excluded.\n\nYou can define additional users to exclude in .sfdx-hardis.yml **monitoringExcludeUsernames** property.\n\nYou can also add more sections / actions considered as not suspect using property **monitoringAllowedSectionsActions**\n\nExample:\n\n```yaml\nmonitoringExcludeUsernames:\n - deploymentuser@cloudity.com\n - marketingcloud@cloudity.com\n - integration-user@cloudity.com\n\nmonitoringAllowedSectionsActions:\n \"Some section\": [] // Will ignore all actions from such section\n \"Some other section\": [\"actionType1\",\"actionType2\",\"actionType3\"] // Will ignore only those 3 actions from section \"Some other section\". Other actions in the same section will be considered as suspect.\n```\n\n## Excel output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-excel.jpg)\n\n## Local output example\n\n![](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/screenshot-monitoring-audittrail-local.jpg)\n\nThis command is part of [sfdx-hardis Monitoring](https://sfdx-hardis.cloudity.com/salesforce-monitoring-suspect-audit-trail/) and can output Grafana, Slack and MsTeams Notifications.\n",
5866
- "examples": [
5867
- "$ sf hardis:org:diagnose:audittrail",
5868
- "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com",
5869
- "$ sf hardis:org:diagnose:audittrail --excludeusers baptiste@titi.com,bertrand@titi.com",
5870
- "$ sf hardis:org:diagnose:audittrail --lastndays 5"
5871
- ],
5872
- "flags": {
5873
- "json": {
5874
- "description": "Format output as json.",
5875
- "helpGroup": "GLOBAL",
5876
- "name": "json",
5877
- "allowNo": false,
5878
- "type": "boolean"
5879
- },
5880
- "flags-dir": {
5881
- "helpGroup": "GLOBAL",
5882
- "name": "flags-dir",
5883
- "summary": "Import flag values from a directory.",
5884
- "hasDynamicHelp": false,
5885
- "multiple": false,
5886
- "type": "option"
5887
- },
5888
- "excludeusers": {
5889
- "char": "e",
5890
- "description": "Comma-separated list of usernames to exclude",
5891
- "name": "excludeusers",
5892
- "hasDynamicHelp": false,
5893
- "multiple": false,
5894
- "type": "option"
5895
- },
5896
- "lastndays": {
5897
- "char": "t",
5898
- "description": "Number of days to extract from today (included)",
5899
- "name": "lastndays",
5900
- "hasDynamicHelp": false,
5901
- "multiple": false,
5902
- "type": "option"
5903
- },
5904
- "outputfile": {
5905
- "char": "f",
5906
- "description": "Force the path and name of output report file. Must end with .csv",
5907
- "name": "outputfile",
5908
- "hasDynamicHelp": false,
5909
- "multiple": false,
5910
- "type": "option"
5911
- },
5912
- "debug": {
5913
- "char": "d",
5914
- "description": "Activate debug mode (more logs)",
5915
- "name": "debug",
5916
- "allowNo": false,
5917
- "type": "boolean"
5918
- },
5919
- "websocket": {
5920
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5921
- "name": "websocket",
5922
- "hasDynamicHelp": false,
5923
- "multiple": false,
5924
- "type": "option"
5925
- },
5926
- "skipauth": {
5927
- "description": "Skip authentication check when a default username is required",
5928
- "name": "skipauth",
5929
- "allowNo": false,
5930
- "type": "boolean"
5931
- },
5932
- "target-org": {
5933
- "aliases": [
5934
- "targetusername",
5935
- "u"
5936
- ],
5937
- "char": "o",
5938
- "deprecateAliases": true,
5939
- "name": "target-org",
5940
- "noCacheDefault": true,
5941
- "required": true,
5942
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5943
- "hasDynamicHelp": true,
5944
- "multiple": false,
5945
- "type": "option"
5946
- }
5947
- },
5948
- "hasDynamicHelp": true,
5949
- "hiddenAliases": [],
5950
- "id": "hardis:org:diagnose:audittrail",
5951
- "pluginAlias": "sfdx-hardis",
5952
- "pluginName": "sfdx-hardis",
5953
- "pluginType": "core",
5954
- "strict": true,
5955
- "enableJsonFlag": true,
5956
- "title": "Diagnose content of Setup Audit Trail",
5957
- "requiresProject": false,
5958
- "isESM": true,
5959
- "relativePath": [
5960
- "lib",
5961
- "commands",
5962
- "hardis",
5963
- "org",
5964
- "diagnose",
5965
- "audittrail.js"
5702
+ "diagnose",
5703
+ "audittrail.js"
5966
5704
  ],
5967
5705
  "aliasPermutations": [],
5968
5706
  "permutations": [
@@ -7008,6 +6746,268 @@
7008
6746
  "unusedusers:diagnose:org:hardis"
7009
6747
  ]
7010
6748
  },
6749
+ "hardis:org:files:export": {
6750
+ "aliases": [],
6751
+ "args": {},
6752
+ "description": "\n## Command Behavior\n\n**Exports file attachments (ContentVersion, Attachment) from a Salesforce org based on a predefined configuration.**\n\nThis command enables the mass download of files associated with Salesforce records, providing a robust solution for backing up files, migrating them to other systems, or integrating them with external document management solutions.\n\nKey functionalities:\n\n- **Configuration-Driven Export:** Relies on an `export.json` file within a designated file export project to define the export criteria, including the SOQL query for parent records, file types to export, and output naming conventions.\n- **Interactive Project Selection:** If the file export project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Configurable Export Options:** Allows overriding default export settings such as `chunksize` (number of records processed in a batch), `polltimeout` (timeout for Bulk API calls), and `startchunknumber` (to resume a failed export).\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for a practical example:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n## Technical explanations\n\nThe command's technical implementation involves:\n\n- **FilesExporter Class:** The core logic is encapsulated within the `FilesExporter` class, which orchestrates the entire export process.\n- **SOQL Queries (Bulk API):** It uses Salesforce Bulk API queries to efficiently retrieve large volumes of parent record IDs and file metadata.\n- **File Download:** Downloads the actual file content from Salesforce.\n- **File System Operations:** Writes the downloaded files to the local file system, organizing them into folders based on the configured naming conventions.\n- **Configuration Loading:** Reads the `export.json` file to get the export configuration. It also allows for interactive overriding of these settings.\n- **Interactive Prompts:** Uses `selectFilesWorkspace` to allow the user to choose a file export project and `promptFilesExportConfiguration` for customizing export options.\n- **Error Handling:** Includes mechanisms to handle potential errors during the export process, such as network issues or API limits.\n",
6753
+ "examples": [
6754
+ "$ sf hardis:org:files:export"
6755
+ ],
6756
+ "flags": {
6757
+ "json": {
6758
+ "description": "Format output as json.",
6759
+ "helpGroup": "GLOBAL",
6760
+ "name": "json",
6761
+ "allowNo": false,
6762
+ "type": "boolean"
6763
+ },
6764
+ "flags-dir": {
6765
+ "helpGroup": "GLOBAL",
6766
+ "name": "flags-dir",
6767
+ "summary": "Import flag values from a directory.",
6768
+ "hasDynamicHelp": false,
6769
+ "multiple": false,
6770
+ "type": "option"
6771
+ },
6772
+ "path": {
6773
+ "char": "p",
6774
+ "description": "Path to the file export project",
6775
+ "name": "path",
6776
+ "hasDynamicHelp": false,
6777
+ "multiple": false,
6778
+ "type": "option"
6779
+ },
6780
+ "chunksize": {
6781
+ "char": "c",
6782
+ "description": "Number of records to add in a chunk before it is processed",
6783
+ "name": "chunksize",
6784
+ "default": 1000,
6785
+ "hasDynamicHelp": false,
6786
+ "multiple": false,
6787
+ "type": "option"
6788
+ },
6789
+ "polltimeout": {
6790
+ "char": "t",
6791
+ "description": "Timeout in MS for Bulk API calls",
6792
+ "name": "polltimeout",
6793
+ "default": 300000,
6794
+ "hasDynamicHelp": false,
6795
+ "multiple": false,
6796
+ "type": "option"
6797
+ },
6798
+ "startchunknumber": {
6799
+ "char": "s",
6800
+ "description": "Chunk number to start from",
6801
+ "name": "startchunknumber",
6802
+ "default": 0,
6803
+ "hasDynamicHelp": false,
6804
+ "multiple": false,
6805
+ "type": "option"
6806
+ },
6807
+ "debug": {
6808
+ "char": "d",
6809
+ "description": "Activate debug mode (more logs)",
6810
+ "name": "debug",
6811
+ "allowNo": false,
6812
+ "type": "boolean"
6813
+ },
6814
+ "websocket": {
6815
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
6816
+ "name": "websocket",
6817
+ "hasDynamicHelp": false,
6818
+ "multiple": false,
6819
+ "type": "option"
6820
+ },
6821
+ "skipauth": {
6822
+ "description": "Skip authentication check when a default username is required",
6823
+ "name": "skipauth",
6824
+ "allowNo": false,
6825
+ "type": "boolean"
6826
+ },
6827
+ "target-org": {
6828
+ "aliases": [
6829
+ "targetusername",
6830
+ "u"
6831
+ ],
6832
+ "char": "o",
6833
+ "deprecateAliases": true,
6834
+ "name": "target-org",
6835
+ "noCacheDefault": true,
6836
+ "required": true,
6837
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
6838
+ "hasDynamicHelp": true,
6839
+ "multiple": false,
6840
+ "type": "option"
6841
+ }
6842
+ },
6843
+ "hasDynamicHelp": true,
6844
+ "hiddenAliases": [],
6845
+ "id": "hardis:org:files:export",
6846
+ "pluginAlias": "sfdx-hardis",
6847
+ "pluginName": "sfdx-hardis",
6848
+ "pluginType": "core",
6849
+ "strict": true,
6850
+ "enableJsonFlag": true,
6851
+ "title": "Export files",
6852
+ "requiresProject": false,
6853
+ "isESM": true,
6854
+ "relativePath": [
6855
+ "lib",
6856
+ "commands",
6857
+ "hardis",
6858
+ "org",
6859
+ "files",
6860
+ "export.js"
6861
+ ],
6862
+ "aliasPermutations": [],
6863
+ "permutations": [
6864
+ "hardis:org:files:export",
6865
+ "org:hardis:files:export",
6866
+ "org:files:hardis:export",
6867
+ "org:files:export:hardis",
6868
+ "hardis:files:org:export",
6869
+ "files:hardis:org:export",
6870
+ "files:org:hardis:export",
6871
+ "files:org:export:hardis",
6872
+ "hardis:files:export:org",
6873
+ "files:hardis:export:org",
6874
+ "files:export:hardis:org",
6875
+ "files:export:org:hardis",
6876
+ "hardis:org:export:files",
6877
+ "org:hardis:export:files",
6878
+ "org:export:hardis:files",
6879
+ "org:export:files:hardis",
6880
+ "hardis:export:org:files",
6881
+ "export:hardis:org:files",
6882
+ "export:org:hardis:files",
6883
+ "export:org:files:hardis",
6884
+ "hardis:export:files:org",
6885
+ "export:hardis:files:org",
6886
+ "export:files:hardis:org",
6887
+ "export:files:org:hardis"
6888
+ ]
6889
+ },
6890
+ "hardis:org:files:import": {
6891
+ "aliases": [],
6892
+ "args": {},
6893
+ "description": "\nThis command facilitates the mass upload of files into Salesforce, allowing you to populate records with associated documents, images, or other file types. It's a crucial tool for data migration, content seeding, or synchronizing external file repositories with Salesforce.\n\nKey functionalities:\n\n- **Configuration-Driven Import:** Relies on an `export.json` file within a designated file export project (created using `sf hardis:org:configure:files`) to determine which files to import and how they should be associated with Salesforce records.\n- **Interactive Project Selection:** If the file import project path is not provided via the `--path` flag, it interactively prompts the user to select one.\n- **Overwrite Option:** The `--overwrite` flag allows you to replace existing files in Salesforce with local versions that have the same name. Be aware that this option doubles the number of API calls used.\n- **Support for ContentVersion and Attachment:** Handles both modern Salesforce Files (ContentVersion) and older Attachments.\n\nSee this article for how to export files, which is often a prerequisite for importing:\n\n[![How to mass download notes and attachments files from a Salesforce org](https://github.com/hardisgroupcom/sfdx-hardis/raw/main/docs/assets/images/article-mass-download.jpg)](https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd)\n\n## Technical explanations\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",
6894
+ "examples": [
6895
+ "$ sf hardis:org:files:import"
6896
+ ],
6897
+ "flags": {
6898
+ "json": {
6899
+ "description": "Format output as json.",
6900
+ "helpGroup": "GLOBAL",
6901
+ "name": "json",
6902
+ "allowNo": false,
6903
+ "type": "boolean"
6904
+ },
6905
+ "flags-dir": {
6906
+ "helpGroup": "GLOBAL",
6907
+ "name": "flags-dir",
6908
+ "summary": "Import flag values from a directory.",
6909
+ "hasDynamicHelp": false,
6910
+ "multiple": false,
6911
+ "type": "option"
6912
+ },
6913
+ "path": {
6914
+ "char": "p",
6915
+ "description": "Path to the file export project",
6916
+ "name": "path",
6917
+ "hasDynamicHelp": false,
6918
+ "multiple": false,
6919
+ "type": "option"
6920
+ },
6921
+ "overwrite": {
6922
+ "char": "f",
6923
+ "description": "Override existing files (doubles the number of API calls)",
6924
+ "name": "overwrite",
6925
+ "allowNo": false,
6926
+ "type": "boolean"
6927
+ },
6928
+ "debug": {
6929
+ "char": "d",
6930
+ "description": "Activate debug mode (more logs)",
6931
+ "name": "debug",
6932
+ "allowNo": false,
6933
+ "type": "boolean"
6934
+ },
6935
+ "websocket": {
6936
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
6937
+ "name": "websocket",
6938
+ "hasDynamicHelp": false,
6939
+ "multiple": false,
6940
+ "type": "option"
6941
+ },
6942
+ "skipauth": {
6943
+ "description": "Skip authentication check when a default username is required",
6944
+ "name": "skipauth",
6945
+ "allowNo": false,
6946
+ "type": "boolean"
6947
+ },
6948
+ "target-org": {
6949
+ "aliases": [
6950
+ "targetusername",
6951
+ "u"
6952
+ ],
6953
+ "char": "o",
6954
+ "deprecateAliases": true,
6955
+ "name": "target-org",
6956
+ "noCacheDefault": true,
6957
+ "required": true,
6958
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
6959
+ "hasDynamicHelp": true,
6960
+ "multiple": false,
6961
+ "type": "option"
6962
+ }
6963
+ },
6964
+ "hasDynamicHelp": true,
6965
+ "hiddenAliases": [],
6966
+ "id": "hardis:org:files:import",
6967
+ "pluginAlias": "sfdx-hardis",
6968
+ "pluginName": "sfdx-hardis",
6969
+ "pluginType": "core",
6970
+ "strict": true,
6971
+ "enableJsonFlag": true,
6972
+ "title": "Import files",
6973
+ "requiresProject": false,
6974
+ "isESM": true,
6975
+ "relativePath": [
6976
+ "lib",
6977
+ "commands",
6978
+ "hardis",
6979
+ "org",
6980
+ "files",
6981
+ "import.js"
6982
+ ],
6983
+ "aliasPermutations": [],
6984
+ "permutations": [
6985
+ "hardis:org:files:import",
6986
+ "org:hardis:files:import",
6987
+ "org:files:hardis:import",
6988
+ "org:files:import:hardis",
6989
+ "hardis:files:org:import",
6990
+ "files:hardis:org:import",
6991
+ "files:org:hardis:import",
6992
+ "files:org:import:hardis",
6993
+ "hardis:files:import:org",
6994
+ "files:hardis:import:org",
6995
+ "files:import:hardis:org",
6996
+ "files:import:org:hardis",
6997
+ "hardis:org:import:files",
6998
+ "org:hardis:import:files",
6999
+ "org:import:hardis:files",
7000
+ "org:import:files:hardis",
7001
+ "hardis:import:org:files",
7002
+ "import:hardis:org:files",
7003
+ "import:org:hardis:files",
7004
+ "import:org:files:hardis",
7005
+ "hardis:import:files:org",
7006
+ "import:hardis:files:org",
7007
+ "import:files:hardis:org",
7008
+ "import:files:org:hardis"
7009
+ ]
7010
+ },
7011
7011
  "hardis:org:generate:packagexmlfull": {
7012
7012
  "aliases": [],
7013
7013
  "args": {},
@@ -14849,5 +14849,5 @@
14849
14849
  ]
14850
14850
  }
14851
14851
  },
14852
- "version": "5.45.1-beta202508100129.0"
14852
+ "version": "5.45.1-beta202508100154.0"
14853
14853
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Swiss-army-knife Toolbox for Salesforce.\n Allows you to define a complete CD/CD Pipeline.\n Orchestrate base commands and assist users with interactive wizards",
4
4
  "author": "NicolasVuillamy @nvuillam",
5
5
  "bugs": "https://github.com/hardisgroupcom/sfdx-hardis/issues",
6
- "version": "5.45.1-beta202508100129.0",
6
+ "version": "5.45.1-beta202508100154.0",
7
7
  "dependencies": {
8
8
  "@actions/github": "^6.0.1",
9
9
  "@cparra/apexdocs": "^3.14.0",