sfdx-hardis 6.9.1-alpha202510260151.0 → 6.9.1-alpha202510261312.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.
@@ -5539,275 +5539,6 @@
5539
5539
  "import:data:org:hardis"
5540
5540
  ]
5541
5541
  },
5542
- "hardis:org:files:export": {
5543
- "aliases": [],
5544
- "args": {},
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[![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<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
- "examples": [
5547
- "$ sf hardis:org:files:export"
5548
- ],
5549
- "flags": {
5550
- "json": {
5551
- "description": "Format output as json.",
5552
- "helpGroup": "GLOBAL",
5553
- "name": "json",
5554
- "allowNo": false,
5555
- "type": "boolean"
5556
- },
5557
- "flags-dir": {
5558
- "helpGroup": "GLOBAL",
5559
- "name": "flags-dir",
5560
- "summary": "Import flag values from a directory.",
5561
- "hasDynamicHelp": false,
5562
- "multiple": false,
5563
- "type": "option"
5564
- },
5565
- "path": {
5566
- "char": "p",
5567
- "description": "Path to the file export project",
5568
- "name": "path",
5569
- "hasDynamicHelp": false,
5570
- "multiple": false,
5571
- "type": "option"
5572
- },
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": {
5583
- "char": "t",
5584
- "description": "Timeout in MS for Bulk API calls",
5585
- "name": "polltimeout",
5586
- "default": 300000,
5587
- "hasDynamicHelp": false,
5588
- "multiple": false,
5589
- "type": "option"
5590
- },
5591
- "startchunknumber": {
5592
- "char": "s",
5593
- "description": "Chunk number to start from",
5594
- "name": "startchunknumber",
5595
- "default": 0,
5596
- "hasDynamicHelp": false,
5597
- "multiple": false,
5598
- "type": "option"
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
- },
5607
- "debug": {
5608
- "char": "d",
5609
- "description": "Activate debug mode (more logs)",
5610
- "name": "debug",
5611
- "allowNo": false,
5612
- "type": "boolean"
5613
- },
5614
- "websocket": {
5615
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
5616
- "name": "websocket",
5617
- "hasDynamicHelp": false,
5618
- "multiple": false,
5619
- "type": "option"
5620
- },
5621
- "skipauth": {
5622
- "description": "Skip authentication check when a default username is required",
5623
- "name": "skipauth",
5624
- "allowNo": false,
5625
- "type": "boolean"
5626
- },
5627
- "target-org": {
5628
- "aliases": [
5629
- "targetusername",
5630
- "u"
5631
- ],
5632
- "char": "o",
5633
- "deprecateAliases": true,
5634
- "name": "target-org",
5635
- "noCacheDefault": true,
5636
- "required": true,
5637
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5638
- "hasDynamicHelp": true,
5639
- "multiple": false,
5640
- "type": "option"
5641
- }
5642
- },
5643
- "hasDynamicHelp": true,
5644
- "hiddenAliases": [],
5645
- "id": "hardis:org:files:export",
5646
- "pluginAlias": "sfdx-hardis",
5647
- "pluginName": "sfdx-hardis",
5648
- "pluginType": "core",
5649
- "strict": true,
5650
- "enableJsonFlag": true,
5651
- "title": "Export files",
5652
- "requiresProject": false,
5653
- "isESM": true,
5654
- "relativePath": [
5655
- "lib",
5656
- "commands",
5657
- "hardis",
5658
- "org",
5659
- "files",
5660
- "export.js"
5661
- ],
5662
- "aliasPermutations": [],
5663
- "permutations": [
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"
5688
- ]
5689
- },
5690
- "hardis:org:files:import": {
5691
- "aliases": [],
5692
- "args": {},
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[![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<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",
5694
- "examples": [
5695
- "$ sf hardis:org:files:import"
5696
- ],
5697
- "flags": {
5698
- "json": {
5699
- "description": "Format output as json.",
5700
- "helpGroup": "GLOBAL",
5701
- "name": "json",
5702
- "allowNo": false,
5703
- "type": "boolean"
5704
- },
5705
- "flags-dir": {
5706
- "helpGroup": "GLOBAL",
5707
- "name": "flags-dir",
5708
- "summary": "Import flag values from a directory.",
5709
- "hasDynamicHelp": false,
5710
- "multiple": false,
5711
- "type": "option"
5712
- },
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",
5737
- "name": "websocket",
5738
- "hasDynamicHelp": false,
5739
- "multiple": false,
5740
- "type": "option"
5741
- },
5742
- "skipauth": {
5743
- "description": "Skip authentication check when a default username is required",
5744
- "name": "skipauth",
5745
- "allowNo": false,
5746
- "type": "boolean"
5747
- },
5748
- "target-org": {
5749
- "aliases": [
5750
- "targetusername",
5751
- "u"
5752
- ],
5753
- "char": "o",
5754
- "deprecateAliases": true,
5755
- "name": "target-org",
5756
- "noCacheDefault": true,
5757
- "required": true,
5758
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
5759
- "hasDynamicHelp": true,
5760
- "multiple": false,
5761
- "type": "option"
5762
- }
5763
- },
5764
- "hasDynamicHelp": true,
5765
- "hiddenAliases": [],
5766
- "id": "hardis:org:files:import",
5767
- "pluginAlias": "sfdx-hardis",
5768
- "pluginName": "sfdx-hardis",
5769
- "pluginType": "core",
5770
- "strict": true,
5771
- "enableJsonFlag": true,
5772
- "title": "Import files",
5773
- "requiresProject": false,
5774
- "isESM": true,
5775
- "relativePath": [
5776
- "lib",
5777
- "commands",
5778
- "hardis",
5779
- "org",
5780
- "files",
5781
- "import.js"
5782
- ],
5783
- "aliasPermutations": [],
5784
- "permutations": [
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"
5809
- ]
5810
- },
5811
5542
  "hardis:org:diagnose:audittrail": {
5812
5543
  "aliases": [],
5813
5544
  "args": {},
@@ -6982,11 +6713,126 @@
6982
6713
  "multiple": false,
6983
6714
  "type": "option"
6984
6715
  },
6985
- "returnactiveusers": {
6986
- "description": "Inverts the command by returning the active users",
6987
- "name": "returnactiveusers",
6988
- "allowNo": false,
6989
- "type": "boolean"
6716
+ "returnactiveusers": {
6717
+ "description": "Inverts the command by returning the active users",
6718
+ "name": "returnactiveusers",
6719
+ "allowNo": false,
6720
+ "type": "boolean"
6721
+ },
6722
+ "debug": {
6723
+ "char": "d",
6724
+ "description": "Activate debug mode (more logs)",
6725
+ "name": "debug",
6726
+ "allowNo": false,
6727
+ "type": "boolean"
6728
+ },
6729
+ "websocket": {
6730
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
6731
+ "name": "websocket",
6732
+ "hasDynamicHelp": false,
6733
+ "multiple": false,
6734
+ "type": "option"
6735
+ },
6736
+ "skipauth": {
6737
+ "description": "Skip authentication check when a default username is required",
6738
+ "name": "skipauth",
6739
+ "allowNo": false,
6740
+ "type": "boolean"
6741
+ },
6742
+ "target-org": {
6743
+ "aliases": [
6744
+ "targetusername",
6745
+ "u"
6746
+ ],
6747
+ "char": "o",
6748
+ "deprecateAliases": true,
6749
+ "name": "target-org",
6750
+ "noCacheDefault": true,
6751
+ "required": true,
6752
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
6753
+ "hasDynamicHelp": true,
6754
+ "multiple": false,
6755
+ "type": "option"
6756
+ }
6757
+ },
6758
+ "hasDynamicHelp": true,
6759
+ "hiddenAliases": [],
6760
+ "id": "hardis:org:diagnose:unusedusers",
6761
+ "pluginAlias": "sfdx-hardis",
6762
+ "pluginName": "sfdx-hardis",
6763
+ "pluginType": "core",
6764
+ "strict": true,
6765
+ "enableJsonFlag": true,
6766
+ "title": "Detect unused Users in Salesforce",
6767
+ "requiresProject": false,
6768
+ "isESM": true,
6769
+ "relativePath": [
6770
+ "lib",
6771
+ "commands",
6772
+ "hardis",
6773
+ "org",
6774
+ "diagnose",
6775
+ "unusedusers.js"
6776
+ ],
6777
+ "aliasPermutations": [],
6778
+ "permutations": [
6779
+ "hardis:org:diagnose:unusedusers",
6780
+ "org:hardis:diagnose:unusedusers",
6781
+ "org:diagnose:hardis:unusedusers",
6782
+ "org:diagnose:unusedusers:hardis",
6783
+ "hardis:diagnose:org:unusedusers",
6784
+ "diagnose:hardis:org:unusedusers",
6785
+ "diagnose:org:hardis:unusedusers",
6786
+ "diagnose:org:unusedusers:hardis",
6787
+ "hardis:diagnose:unusedusers:org",
6788
+ "diagnose:hardis:unusedusers:org",
6789
+ "diagnose:unusedusers:hardis:org",
6790
+ "diagnose:unusedusers:org:hardis",
6791
+ "hardis:org:unusedusers:diagnose",
6792
+ "org:hardis:unusedusers:diagnose",
6793
+ "org:unusedusers:hardis:diagnose",
6794
+ "org:unusedusers:diagnose:hardis",
6795
+ "hardis:unusedusers:org:diagnose",
6796
+ "unusedusers:hardis:org:diagnose",
6797
+ "unusedusers:org:hardis:diagnose",
6798
+ "unusedusers:org:diagnose:hardis",
6799
+ "hardis:unusedusers:diagnose:org",
6800
+ "unusedusers:hardis:diagnose:org",
6801
+ "unusedusers:diagnose:hardis:org",
6802
+ "unusedusers:diagnose:org:hardis"
6803
+ ]
6804
+ },
6805
+ "hardis:org:fix:listviewmine": {
6806
+ "aliases": [],
6807
+ "args": {},
6808
+ "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",
6809
+ "examples": [
6810
+ "$ sf hardis:org:fix:listviewmine",
6811
+ "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
6812
+ ],
6813
+ "flags": {
6814
+ "json": {
6815
+ "description": "Format output as json.",
6816
+ "helpGroup": "GLOBAL",
6817
+ "name": "json",
6818
+ "allowNo": false,
6819
+ "type": "boolean"
6820
+ },
6821
+ "flags-dir": {
6822
+ "helpGroup": "GLOBAL",
6823
+ "name": "flags-dir",
6824
+ "summary": "Import flag values from a directory.",
6825
+ "hasDynamicHelp": false,
6826
+ "multiple": false,
6827
+ "type": "option"
6828
+ },
6829
+ "listviews": {
6830
+ "char": "l",
6831
+ "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
6832
+ "name": "listviews",
6833
+ "hasDynamicHelp": false,
6834
+ "multiple": false,
6835
+ "type": "option"
6990
6836
  },
6991
6837
  "debug": {
6992
6838
  "char": "d",
@@ -7026,49 +6872,49 @@
7026
6872
  },
7027
6873
  "hasDynamicHelp": true,
7028
6874
  "hiddenAliases": [],
7029
- "id": "hardis:org:diagnose:unusedusers",
6875
+ "id": "hardis:org:fix:listviewmine",
7030
6876
  "pluginAlias": "sfdx-hardis",
7031
6877
  "pluginName": "sfdx-hardis",
7032
6878
  "pluginType": "core",
7033
6879
  "strict": true,
7034
6880
  "enableJsonFlag": true,
7035
- "title": "Detect unused Users in Salesforce",
7036
- "requiresProject": false,
6881
+ "title": "Fix listviews with ",
6882
+ "requiresProject": true,
7037
6883
  "isESM": true,
7038
6884
  "relativePath": [
7039
6885
  "lib",
7040
6886
  "commands",
7041
6887
  "hardis",
7042
6888
  "org",
7043
- "diagnose",
7044
- "unusedusers.js"
6889
+ "fix",
6890
+ "listviewmine.js"
7045
6891
  ],
7046
6892
  "aliasPermutations": [],
7047
6893
  "permutations": [
7048
- "hardis:org:diagnose:unusedusers",
7049
- "org:hardis:diagnose:unusedusers",
7050
- "org:diagnose:hardis:unusedusers",
7051
- "org:diagnose:unusedusers:hardis",
7052
- "hardis:diagnose:org:unusedusers",
7053
- "diagnose:hardis:org:unusedusers",
7054
- "diagnose:org:hardis:unusedusers",
7055
- "diagnose:org:unusedusers:hardis",
7056
- "hardis:diagnose:unusedusers:org",
7057
- "diagnose:hardis:unusedusers:org",
7058
- "diagnose:unusedusers:hardis:org",
7059
- "diagnose:unusedusers:org:hardis",
7060
- "hardis:org:unusedusers:diagnose",
7061
- "org:hardis:unusedusers:diagnose",
7062
- "org:unusedusers:hardis:diagnose",
7063
- "org:unusedusers:diagnose:hardis",
7064
- "hardis:unusedusers:org:diagnose",
7065
- "unusedusers:hardis:org:diagnose",
7066
- "unusedusers:org:hardis:diagnose",
7067
- "unusedusers:org:diagnose:hardis",
7068
- "hardis:unusedusers:diagnose:org",
7069
- "unusedusers:hardis:diagnose:org",
7070
- "unusedusers:diagnose:hardis:org",
7071
- "unusedusers:diagnose:org:hardis"
6894
+ "hardis:org:fix:listviewmine",
6895
+ "org:hardis:fix:listviewmine",
6896
+ "org:fix:hardis:listviewmine",
6897
+ "org:fix:listviewmine:hardis",
6898
+ "hardis:fix:org:listviewmine",
6899
+ "fix:hardis:org:listviewmine",
6900
+ "fix:org:hardis:listviewmine",
6901
+ "fix:org:listviewmine:hardis",
6902
+ "hardis:fix:listviewmine:org",
6903
+ "fix:hardis:listviewmine:org",
6904
+ "fix:listviewmine:hardis:org",
6905
+ "fix:listviewmine:org:hardis",
6906
+ "hardis:org:listviewmine:fix",
6907
+ "org:hardis:listviewmine:fix",
6908
+ "org:listviewmine:hardis:fix",
6909
+ "org:listviewmine:fix:hardis",
6910
+ "hardis:listviewmine:org:fix",
6911
+ "listviewmine:hardis:org:fix",
6912
+ "listviewmine:org:hardis:fix",
6913
+ "listviewmine:org:fix:hardis",
6914
+ "hardis:listviewmine:fix:org",
6915
+ "listviewmine:hardis:fix:org",
6916
+ "listviewmine:fix:hardis:org",
6917
+ "listviewmine:fix:org:hardis"
7072
6918
  ]
7073
6919
  },
7074
6920
  "hardis:org:generate:packagexmlfull": {
@@ -7193,13 +7039,12 @@
7193
7039
  "packagexmlfull:generate:org:hardis"
7194
7040
  ]
7195
7041
  },
7196
- "hardis:org:fix:listviewmine": {
7042
+ "hardis:org:files:export": {
7197
7043
  "aliases": [],
7198
7044
  "args": {},
7199
- "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",
7045
+ "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[![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<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",
7200
7046
  "examples": [
7201
- "$ sf hardis:org:fix:listviewmine",
7202
- "$ sf hardis:org:fix:listviewmine --listviews Opportunity:MySubscriptions,Account:MyActivePartners"
7047
+ "$ sf hardis:org:files:export"
7203
7048
  ],
7204
7049
  "flags": {
7205
7050
  "json": {
@@ -7217,14 +7062,48 @@
7217
7062
  "multiple": false,
7218
7063
  "type": "option"
7219
7064
  },
7220
- "listviews": {
7221
- "char": "l",
7222
- "description": "Comma-separated list of listviews following format Object:ListViewName\nExample: Contact:MyContacts,Contact:MyActiveContacts,Opportunity:MYClosedOpportunities",
7223
- "name": "listviews",
7065
+ "path": {
7066
+ "char": "p",
7067
+ "description": "Path to the file export project",
7068
+ "name": "path",
7069
+ "hasDynamicHelp": false,
7070
+ "multiple": false,
7071
+ "type": "option"
7072
+ },
7073
+ "chunksize": {
7074
+ "char": "c",
7075
+ "description": "Number of records to add in a chunk before it is processed",
7076
+ "name": "chunksize",
7077
+ "default": 1000,
7078
+ "hasDynamicHelp": false,
7079
+ "multiple": false,
7080
+ "type": "option"
7081
+ },
7082
+ "polltimeout": {
7083
+ "char": "t",
7084
+ "description": "Timeout in MS for Bulk API calls",
7085
+ "name": "polltimeout",
7086
+ "default": 300000,
7087
+ "hasDynamicHelp": false,
7088
+ "multiple": false,
7089
+ "type": "option"
7090
+ },
7091
+ "startchunknumber": {
7092
+ "char": "s",
7093
+ "description": "Chunk number to start from",
7094
+ "name": "startchunknumber",
7095
+ "default": 0,
7224
7096
  "hasDynamicHelp": false,
7225
7097
  "multiple": false,
7226
7098
  "type": "option"
7227
7099
  },
7100
+ "resume": {
7101
+ "char": "r",
7102
+ "description": "Resume previous export by checking existing files (default in CI)",
7103
+ "name": "resume",
7104
+ "allowNo": false,
7105
+ "type": "boolean"
7106
+ },
7228
7107
  "debug": {
7229
7108
  "char": "d",
7230
7109
  "description": "Activate debug mode (more logs)",
@@ -7263,49 +7142,170 @@
7263
7142
  },
7264
7143
  "hasDynamicHelp": true,
7265
7144
  "hiddenAliases": [],
7266
- "id": "hardis:org:fix:listviewmine",
7145
+ "id": "hardis:org:files:export",
7267
7146
  "pluginAlias": "sfdx-hardis",
7268
7147
  "pluginName": "sfdx-hardis",
7269
7148
  "pluginType": "core",
7270
7149
  "strict": true,
7271
7150
  "enableJsonFlag": true,
7272
- "title": "Fix listviews with ",
7273
- "requiresProject": true,
7151
+ "title": "Export files",
7152
+ "requiresProject": false,
7274
7153
  "isESM": true,
7275
7154
  "relativePath": [
7276
7155
  "lib",
7277
7156
  "commands",
7278
7157
  "hardis",
7279
7158
  "org",
7280
- "fix",
7281
- "listviewmine.js"
7159
+ "files",
7160
+ "export.js"
7282
7161
  ],
7283
7162
  "aliasPermutations": [],
7284
7163
  "permutations": [
7285
- "hardis:org:fix:listviewmine",
7286
- "org:hardis:fix:listviewmine",
7287
- "org:fix:hardis:listviewmine",
7288
- "org:fix:listviewmine:hardis",
7289
- "hardis:fix:org:listviewmine",
7290
- "fix:hardis:org:listviewmine",
7291
- "fix:org:hardis:listviewmine",
7292
- "fix:org:listviewmine:hardis",
7293
- "hardis:fix:listviewmine:org",
7294
- "fix:hardis:listviewmine:org",
7295
- "fix:listviewmine:hardis:org",
7296
- "fix:listviewmine:org:hardis",
7297
- "hardis:org:listviewmine:fix",
7298
- "org:hardis:listviewmine:fix",
7299
- "org:listviewmine:hardis:fix",
7300
- "org:listviewmine:fix:hardis",
7301
- "hardis:listviewmine:org:fix",
7302
- "listviewmine:hardis:org:fix",
7303
- "listviewmine:org:hardis:fix",
7304
- "listviewmine:org:fix:hardis",
7305
- "hardis:listviewmine:fix:org",
7306
- "listviewmine:hardis:fix:org",
7307
- "listviewmine:fix:hardis:org",
7308
- "listviewmine:fix:org:hardis"
7164
+ "hardis:org:files:export",
7165
+ "org:hardis:files:export",
7166
+ "org:files:hardis:export",
7167
+ "org:files:export:hardis",
7168
+ "hardis:files:org:export",
7169
+ "files:hardis:org:export",
7170
+ "files:org:hardis:export",
7171
+ "files:org:export:hardis",
7172
+ "hardis:files:export:org",
7173
+ "files:hardis:export:org",
7174
+ "files:export:hardis:org",
7175
+ "files:export:org:hardis",
7176
+ "hardis:org:export:files",
7177
+ "org:hardis:export:files",
7178
+ "org:export:hardis:files",
7179
+ "org:export:files:hardis",
7180
+ "hardis:export:org:files",
7181
+ "export:hardis:org:files",
7182
+ "export:org:hardis:files",
7183
+ "export:org:files:hardis",
7184
+ "hardis:export:files:org",
7185
+ "export:hardis:files:org",
7186
+ "export:files:hardis:org",
7187
+ "export:files:org:hardis"
7188
+ ]
7189
+ },
7190
+ "hardis:org:files:import": {
7191
+ "aliases": [],
7192
+ "args": {},
7193
+ "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<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",
7194
+ "examples": [
7195
+ "$ sf hardis:org:files:import"
7196
+ ],
7197
+ "flags": {
7198
+ "json": {
7199
+ "description": "Format output as json.",
7200
+ "helpGroup": "GLOBAL",
7201
+ "name": "json",
7202
+ "allowNo": false,
7203
+ "type": "boolean"
7204
+ },
7205
+ "flags-dir": {
7206
+ "helpGroup": "GLOBAL",
7207
+ "name": "flags-dir",
7208
+ "summary": "Import flag values from a directory.",
7209
+ "hasDynamicHelp": false,
7210
+ "multiple": false,
7211
+ "type": "option"
7212
+ },
7213
+ "path": {
7214
+ "char": "p",
7215
+ "description": "Path to the file export project",
7216
+ "name": "path",
7217
+ "hasDynamicHelp": false,
7218
+ "multiple": false,
7219
+ "type": "option"
7220
+ },
7221
+ "overwrite": {
7222
+ "char": "f",
7223
+ "description": "Override existing files (doubles the number of API calls)",
7224
+ "name": "overwrite",
7225
+ "allowNo": false,
7226
+ "type": "boolean"
7227
+ },
7228
+ "debug": {
7229
+ "char": "d",
7230
+ "description": "Activate debug mode (more logs)",
7231
+ "name": "debug",
7232
+ "allowNo": false,
7233
+ "type": "boolean"
7234
+ },
7235
+ "websocket": {
7236
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
7237
+ "name": "websocket",
7238
+ "hasDynamicHelp": false,
7239
+ "multiple": false,
7240
+ "type": "option"
7241
+ },
7242
+ "skipauth": {
7243
+ "description": "Skip authentication check when a default username is required",
7244
+ "name": "skipauth",
7245
+ "allowNo": false,
7246
+ "type": "boolean"
7247
+ },
7248
+ "target-org": {
7249
+ "aliases": [
7250
+ "targetusername",
7251
+ "u"
7252
+ ],
7253
+ "char": "o",
7254
+ "deprecateAliases": true,
7255
+ "name": "target-org",
7256
+ "noCacheDefault": true,
7257
+ "required": true,
7258
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
7259
+ "hasDynamicHelp": true,
7260
+ "multiple": false,
7261
+ "type": "option"
7262
+ }
7263
+ },
7264
+ "hasDynamicHelp": true,
7265
+ "hiddenAliases": [],
7266
+ "id": "hardis:org:files:import",
7267
+ "pluginAlias": "sfdx-hardis",
7268
+ "pluginName": "sfdx-hardis",
7269
+ "pluginType": "core",
7270
+ "strict": true,
7271
+ "enableJsonFlag": true,
7272
+ "title": "Import files",
7273
+ "requiresProject": false,
7274
+ "isESM": true,
7275
+ "relativePath": [
7276
+ "lib",
7277
+ "commands",
7278
+ "hardis",
7279
+ "org",
7280
+ "files",
7281
+ "import.js"
7282
+ ],
7283
+ "aliasPermutations": [],
7284
+ "permutations": [
7285
+ "hardis:org:files:import",
7286
+ "org:hardis:files:import",
7287
+ "org:files:hardis:import",
7288
+ "org:files:import:hardis",
7289
+ "hardis:files:org:import",
7290
+ "files:hardis:org:import",
7291
+ "files:org:hardis:import",
7292
+ "files:org:import:hardis",
7293
+ "hardis:files:import:org",
7294
+ "files:hardis:import:org",
7295
+ "files:import:hardis:org",
7296
+ "files:import:org:hardis",
7297
+ "hardis:org:import:files",
7298
+ "org:hardis:import:files",
7299
+ "org:import:hardis:files",
7300
+ "org:import:files:hardis",
7301
+ "hardis:import:org:files",
7302
+ "import:hardis:org:files",
7303
+ "import:org:hardis:files",
7304
+ "import:org:files:hardis",
7305
+ "hardis:import:files:org",
7306
+ "import:hardis:files:org",
7307
+ "import:files:hardis:org",
7308
+ "import:files:org:hardis"
7309
7309
  ]
7310
7310
  },
7311
7311
  "hardis:org:monitor:all": {
@@ -8057,113 +8057,6 @@
8057
8057
  "flow:purge:org:hardis"
8058
8058
  ]
8059
8059
  },
8060
- "hardis:org:retrieve:packageconfig": {
8061
- "aliases": [],
8062
- "args": {},
8063
- "description": "\n**Retrieves the installed package configuration from a Salesforce org and optionally updates the local project configuration.**\n\nThis command is useful for maintaining an accurate record of installed packages within your Salesforce project, which is crucial for managing dependencies and ensuring consistent deployments across environments.\n\nKey functionalities:\n\n- **Package Listing:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a list of all installed packages.\n- **Configuration Update:** Offers the option to update your local project's configuration with the retrieved list of installed packages. This can be beneficial for automating package installations during environment setup or CI/CD processes.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Org Connection:** It establishes a connection to the target Salesforce org using the provided or prompted username.\n- **Metadata Retrieval:** It utilizes `MetadataUtils.listInstalledPackages` to query the Salesforce org and obtain details about the installed packages.\n- **Interactive Prompt:** It uses the `prompts` library to ask the user whether they want to update their local project configuration with the retrieved package list.\n- **Configuration Management:** If the user confirms, it calls `managePackageConfig` to update the project's configuration file (likely `.sfdx-hardis.yml`) with the new package information.\n- **User Feedback:** Provides clear messages to the user about the success of the package retrieval and configuration update.\n</details>\n",
8064
- "examples": [
8065
- "$ sf hardis:org:retrieve:packageconfig",
8066
- "sf hardis:org:retrieve:packageconfig -u myOrg"
8067
- ],
8068
- "flags": {
8069
- "json": {
8070
- "description": "Format output as json.",
8071
- "helpGroup": "GLOBAL",
8072
- "name": "json",
8073
- "allowNo": false,
8074
- "type": "boolean"
8075
- },
8076
- "flags-dir": {
8077
- "helpGroup": "GLOBAL",
8078
- "name": "flags-dir",
8079
- "summary": "Import flag values from a directory.",
8080
- "hasDynamicHelp": false,
8081
- "multiple": false,
8082
- "type": "option"
8083
- },
8084
- "debug": {
8085
- "char": "d",
8086
- "description": "Activate debug mode (more logs)",
8087
- "name": "debug",
8088
- "allowNo": false,
8089
- "type": "boolean"
8090
- },
8091
- "websocket": {
8092
- "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
8093
- "name": "websocket",
8094
- "hasDynamicHelp": false,
8095
- "multiple": false,
8096
- "type": "option"
8097
- },
8098
- "skipauth": {
8099
- "description": "Skip authentication check when a default username is required",
8100
- "name": "skipauth",
8101
- "allowNo": false,
8102
- "type": "boolean"
8103
- },
8104
- "target-org": {
8105
- "aliases": [
8106
- "targetusername",
8107
- "u"
8108
- ],
8109
- "char": "o",
8110
- "deprecateAliases": true,
8111
- "name": "target-org",
8112
- "noCacheDefault": true,
8113
- "required": true,
8114
- "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8115
- "hasDynamicHelp": true,
8116
- "multiple": false,
8117
- "type": "option"
8118
- }
8119
- },
8120
- "hasDynamicHelp": true,
8121
- "hiddenAliases": [],
8122
- "id": "hardis:org:retrieve:packageconfig",
8123
- "pluginAlias": "sfdx-hardis",
8124
- "pluginName": "sfdx-hardis",
8125
- "pluginType": "core",
8126
- "strict": true,
8127
- "enableJsonFlag": true,
8128
- "title": "Retrieve package configuration from an org",
8129
- "requiresProject": false,
8130
- "isESM": true,
8131
- "relativePath": [
8132
- "lib",
8133
- "commands",
8134
- "hardis",
8135
- "org",
8136
- "retrieve",
8137
- "packageconfig.js"
8138
- ],
8139
- "aliasPermutations": [],
8140
- "permutations": [
8141
- "hardis:org:retrieve:packageconfig",
8142
- "org:hardis:retrieve:packageconfig",
8143
- "org:retrieve:hardis:packageconfig",
8144
- "org:retrieve:packageconfig:hardis",
8145
- "hardis:retrieve:org:packageconfig",
8146
- "retrieve:hardis:org:packageconfig",
8147
- "retrieve:org:hardis:packageconfig",
8148
- "retrieve:org:packageconfig:hardis",
8149
- "hardis:retrieve:packageconfig:org",
8150
- "retrieve:hardis:packageconfig:org",
8151
- "retrieve:packageconfig:hardis:org",
8152
- "retrieve:packageconfig:org:hardis",
8153
- "hardis:org:packageconfig:retrieve",
8154
- "org:hardis:packageconfig:retrieve",
8155
- "org:packageconfig:hardis:retrieve",
8156
- "org:packageconfig:retrieve:hardis",
8157
- "hardis:packageconfig:org:retrieve",
8158
- "packageconfig:hardis:org:retrieve",
8159
- "packageconfig:org:hardis:retrieve",
8160
- "packageconfig:org:retrieve:hardis",
8161
- "hardis:packageconfig:retrieve:org",
8162
- "packageconfig:hardis:retrieve:org",
8163
- "packageconfig:retrieve:hardis:org",
8164
- "packageconfig:retrieve:org:hardis"
8165
- ]
8166
- },
8167
8060
  "hardis:org:refresh:after-refresh": {
8168
8061
  "aliases": [],
8169
8062
  "args": {},
@@ -8403,6 +8296,113 @@
8403
8296
  "before-refresh:refresh:org:hardis"
8404
8297
  ]
8405
8298
  },
8299
+ "hardis:org:retrieve:packageconfig": {
8300
+ "aliases": [],
8301
+ "args": {},
8302
+ "description": "\n**Retrieves the installed package configuration from a Salesforce org and optionally updates the local project configuration.**\n\nThis command is useful for maintaining an accurate record of installed packages within your Salesforce project, which is crucial for managing dependencies and ensuring consistent deployments across environments.\n\nKey functionalities:\n\n- **Package Listing:** Connects to a specified Salesforce org (or prompts for one if not provided) and retrieves a list of all installed packages.\n- **Configuration Update:** Offers the option to update your local project's configuration with the retrieved list of installed packages. This can be beneficial for automating package installations during environment setup or CI/CD processes.\n\n<details markdown=\"1\">\n<summary>Technical explanations</summary>\n\nThe command's technical implementation involves:\n\n- **Org Connection:** It establishes a connection to the target Salesforce org using the provided or prompted username.\n- **Metadata Retrieval:** It utilizes `MetadataUtils.listInstalledPackages` to query the Salesforce org and obtain details about the installed packages.\n- **Interactive Prompt:** It uses the `prompts` library to ask the user whether they want to update their local project configuration with the retrieved package list.\n- **Configuration Management:** If the user confirms, it calls `managePackageConfig` to update the project's configuration file (likely `.sfdx-hardis.yml`) with the new package information.\n- **User Feedback:** Provides clear messages to the user about the success of the package retrieval and configuration update.\n</details>\n",
8303
+ "examples": [
8304
+ "$ sf hardis:org:retrieve:packageconfig",
8305
+ "sf hardis:org:retrieve:packageconfig -u myOrg"
8306
+ ],
8307
+ "flags": {
8308
+ "json": {
8309
+ "description": "Format output as json.",
8310
+ "helpGroup": "GLOBAL",
8311
+ "name": "json",
8312
+ "allowNo": false,
8313
+ "type": "boolean"
8314
+ },
8315
+ "flags-dir": {
8316
+ "helpGroup": "GLOBAL",
8317
+ "name": "flags-dir",
8318
+ "summary": "Import flag values from a directory.",
8319
+ "hasDynamicHelp": false,
8320
+ "multiple": false,
8321
+ "type": "option"
8322
+ },
8323
+ "debug": {
8324
+ "char": "d",
8325
+ "description": "Activate debug mode (more logs)",
8326
+ "name": "debug",
8327
+ "allowNo": false,
8328
+ "type": "boolean"
8329
+ },
8330
+ "websocket": {
8331
+ "description": "Websocket host:port for VsCode SFDX Hardis UI integration",
8332
+ "name": "websocket",
8333
+ "hasDynamicHelp": false,
8334
+ "multiple": false,
8335
+ "type": "option"
8336
+ },
8337
+ "skipauth": {
8338
+ "description": "Skip authentication check when a default username is required",
8339
+ "name": "skipauth",
8340
+ "allowNo": false,
8341
+ "type": "boolean"
8342
+ },
8343
+ "target-org": {
8344
+ "aliases": [
8345
+ "targetusername",
8346
+ "u"
8347
+ ],
8348
+ "char": "o",
8349
+ "deprecateAliases": true,
8350
+ "name": "target-org",
8351
+ "noCacheDefault": true,
8352
+ "required": true,
8353
+ "summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
8354
+ "hasDynamicHelp": true,
8355
+ "multiple": false,
8356
+ "type": "option"
8357
+ }
8358
+ },
8359
+ "hasDynamicHelp": true,
8360
+ "hiddenAliases": [],
8361
+ "id": "hardis:org:retrieve:packageconfig",
8362
+ "pluginAlias": "sfdx-hardis",
8363
+ "pluginName": "sfdx-hardis",
8364
+ "pluginType": "core",
8365
+ "strict": true,
8366
+ "enableJsonFlag": true,
8367
+ "title": "Retrieve package configuration from an org",
8368
+ "requiresProject": false,
8369
+ "isESM": true,
8370
+ "relativePath": [
8371
+ "lib",
8372
+ "commands",
8373
+ "hardis",
8374
+ "org",
8375
+ "retrieve",
8376
+ "packageconfig.js"
8377
+ ],
8378
+ "aliasPermutations": [],
8379
+ "permutations": [
8380
+ "hardis:org:retrieve:packageconfig",
8381
+ "org:hardis:retrieve:packageconfig",
8382
+ "org:retrieve:hardis:packageconfig",
8383
+ "org:retrieve:packageconfig:hardis",
8384
+ "hardis:retrieve:org:packageconfig",
8385
+ "retrieve:hardis:org:packageconfig",
8386
+ "retrieve:org:hardis:packageconfig",
8387
+ "retrieve:org:packageconfig:hardis",
8388
+ "hardis:retrieve:packageconfig:org",
8389
+ "retrieve:hardis:packageconfig:org",
8390
+ "retrieve:packageconfig:hardis:org",
8391
+ "retrieve:packageconfig:org:hardis",
8392
+ "hardis:org:packageconfig:retrieve",
8393
+ "org:hardis:packageconfig:retrieve",
8394
+ "org:packageconfig:hardis:retrieve",
8395
+ "org:packageconfig:retrieve:hardis",
8396
+ "hardis:packageconfig:org:retrieve",
8397
+ "packageconfig:hardis:org:retrieve",
8398
+ "packageconfig:org:hardis:retrieve",
8399
+ "packageconfig:org:retrieve:hardis",
8400
+ "hardis:packageconfig:retrieve:org",
8401
+ "packageconfig:hardis:retrieve:org",
8402
+ "packageconfig:retrieve:hardis:org",
8403
+ "packageconfig:retrieve:org:hardis"
8404
+ ]
8405
+ },
8406
8406
  "hardis:org:test:apex": {
8407
8407
  "aliases": [],
8408
8408
  "args": {},
@@ -15370,5 +15370,5 @@
15370
15370
  ]
15371
15371
  }
15372
15372
  },
15373
- "version": "6.9.1-alpha202510260151.0"
15373
+ "version": "6.9.1-alpha202510261312.0"
15374
15374
  }