From 8ecd5597c33b8561231e641de33eee23ff5eddd7 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Mon, 22 Jun 2026 16:30:45 -0600 Subject: [PATCH 1/2] feat: add --installation-key flag to package version displaydependencies @W-20525733@ Allow users to provide an installation key when querying dependencies of key-protected subscriber package versions. --- command-snapshot.json | 1641 +++++++++++------ .../package_version_displaydependencies.md | 8 + .../package/version/displaydependencies.ts | 5 + 3 files changed, 1076 insertions(+), 578 deletions(-) diff --git a/command-snapshot.json b/command-snapshot.json index 36aa6c30..c63fcae6 100644 --- a/command-snapshot.json +++ b/command-snapshot.json @@ -1,579 +1,1064 @@ [ - { - "alias": ["force:package1:version:create"], - "command": "package1:version:create", - "flagAliases": [ - "apiversion", - "installationkey", - "managedrelease", - "packageid", - "postinstallurl", - "releasenotesurl", - "targetusername", - "u" - ], - "flagChars": ["d", "i", "k", "m", "n", "o", "p", "r", "v", "w"], - "flags": [ - "api-version", - "description", - "flags-dir", - "installation-key", - "json", - "loglevel", - "managed-released", - "name", - "package-id", - "post-install-url", - "release-notes-url", - "target-org", - "version", - "wait" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package1:version:create:get"], - "command": "package1:version:create:get", - "flagAliases": ["apiversion", "requestid", "targetusername", "u"], - "flagChars": ["i", "o"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "request-id", "target-org"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package1:version:display"], - "command": "package1:version:display", - "flagAliases": ["apiversion", "packageversionid", "targetusername", "u"], - "flagChars": ["i", "o"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "package-version-id", "target-org"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package1:version:list"], - "command": "package1:version:list", - "flagAliases": ["apiversion", "packageid", "targetusername", "u"], - "flagChars": ["i", "o"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "package-id", "target-org"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:create", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["d", "n", "v"], - "flags": ["api-version", "description", "flags-dir", "json", "loglevel", "name", "target-dev-hub"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:delete", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["b", "n", "v"], - "flags": ["api-version", "bundle", "flags-dir", "json", "loglevel", "no-prompt", "target-dev-hub"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:install", - "flagAliases": ["apiversion", "targetusername", "u"], - "flagChars": ["b", "d", "o", "w"], - "flags": ["api-version", "bundle", "dev-hub-org", "flags-dir", "json", "loglevel", "target-org", "verbose", "wait"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:install:report", - "flagAliases": ["apiversion", "targetusername", "u"], - "flagChars": ["i", "o"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "package-install-request-id", "target-org", "verbose"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:installed:list", - "flagAliases": ["apiversion", "targetusername", "u"], - "flagChars": ["o"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "target-org"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:list", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["v"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "target-dev-hub", "verbose"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:uninstall", - "flagAliases": ["apiversion", "targetusername", "u"], - "flagChars": ["b", "o", "w"], - "flags": ["api-version", "bundle", "flags-dir", "json", "loglevel", "target-org", "verbose", "wait"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:version:create", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["b", "d", "n", "p", "v", "w"], - "flags": [ - "api-version", - "bundle", - "definition-file", - "description", - "flags-dir", - "json", - "loglevel", - "target-dev-hub", - "verbose", - "version-number", - "wait" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:version:create:list", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["c", "s", "v"], - "flags": [ - "api-version", - "created-last-days", - "flags-dir", - "json", - "loglevel", - "status", - "target-dev-hub", - "verbose" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:version:create:report", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["i", "v"], - "flags": ["api-version", "bundle-version-create-request-id", "flags-dir", "json", "loglevel", "target-dev-hub"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:version:list", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["v"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "target-dev-hub", "verbose"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:bundle:version:report", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["b", "v"], - "flags": ["api-version", "bundle-version", "flags-dir", "json", "loglevel", "target-dev-hub", "verbose"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:convert"], - "command": "package:convert", - "flagAliases": [ - "apiversion", - "buildinstance", - "definitionfile", - "installationkey", - "installationkeybypass", - "patchversion", - "target-hub-org", - "targetdevhubusername" - ], - "flagChars": ["a", "c", "f", "k", "m", "p", "s", "v", "w", "x"], - "flags": [ - "api-version", - "build-instance", - "code-coverage", - "definition-file", - "flags-dir", - "installation-key", - "installation-key-bypass", - "json", - "loglevel", - "package", - "patch-version", - "seed-metadata", - "target-dev-hub", - "verbose", - "wait" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:create"], - "command": "package:create", - "flagAliases": [ - "apiversion", - "errornotificationusername", - "nonamespace", - "orgdependent", - "packagetype", - "target-hub-org", - "targetdevhubusername" - ], - "flagChars": ["d", "e", "n", "o", "r", "t", "v"], - "flags": [ - "api-version", - "description", - "error-notification-username", - "flags-dir", - "json", - "loglevel", - "name", - "no-namespace", - "org-dependent", - "package-type", - "path", - "target-dev-hub" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:delete"], - "command": "package:delete", - "flagAliases": ["apiversion", "noprompt", "target-hub-org", "targetdevhubusername"], - "flagChars": ["n", "p", "v"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "no-prompt", "package", "target-dev-hub", "undelete"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:install"], - "command": "package:install", - "flagAliases": [ - "apexcompile", - "apiversion", - "installationkey", - "noprompt", - "publishwait", - "securitytype", - "targetusername", - "u", - "upgradetype" - ], - "flagChars": ["a", "b", "k", "l", "o", "p", "r", "s", "t", "w"], - "flags": [ - "apex-compile", - "api-version", - "flags-dir", - "installation-key", - "json", - "loglevel", - "no-prompt", - "package", - "publish-wait", - "security-type", - "skip-handlers", - "target-org", - "upgrade-type", - "wait" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:install:report"], - "command": "package:install:report", - "flagAliases": ["apiversion", "requestid", "targetusername", "u"], - "flagChars": ["i", "o"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "request-id", "target-org"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:installed:list"], - "command": "package:installed:list", - "flagAliases": ["apiversion", "targetusername", "u"], - "flagChars": ["o"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "target-org"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:list"], - "command": "package:list", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["v"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "target-dev-hub", "verbose"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:push-upgrade:abort", - "flagAliases": [], - "flagChars": ["i", "v"], - "flags": ["api-version", "flags-dir", "json", "push-request-id", "target-dev-hub"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:push-upgrade:list"], - "command": "package:push-upgrade:list", - "flagAliases": ["apiversion", "scheduledlastdays", "target-hub-org", "targetdevhubusername"], - "flagChars": ["l", "p", "s", "v"], - "flags": [ - "api-version", - "flags-dir", - "json", - "package", - "scheduled-last-days", - "show-push-migrations-only", - "status", - "target-dev-hub" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:push-upgrade:report"], - "command": "package:push-upgrade:report", - "flagAliases": ["apiversion", "pushrequestid", "target-hub-org", "targetdevhubusername"], - "flagChars": ["i", "v"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "push-request-id", "target-dev-hub"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:push-upgrade:schedule", - "flagAliases": ["apiversion"], - "flagChars": ["f", "l", "p", "t", "v"], - "flags": [ - "api-version", - "flags-dir", - "json", - "migrate-to-2gp", - "org-file", - "org-list", - "package", - "start-time", - "target-dev-hub" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:uninstall"], - "command": "package:uninstall", - "flagAliases": ["apiversion", "targetusername", "u"], - "flagChars": ["o", "p", "w"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "package", "target-org", "wait"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:uninstall:report"], - "command": "package:uninstall:report", - "flagAliases": ["apiversion", "requestid", "targetusername", "u"], - "flagChars": ["i", "o"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "request-id", "target-org"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:update"], - "command": "package:update", - "flagAliases": ["apiversion", "errornotificationusername", "target-hub-org", "targetdevhubusername"], - "flagChars": ["d", "n", "o", "p", "r", "v"], - "flags": [ - "api-version", - "description", - "enable-app-analytics", - "error-notification-username", - "flags-dir", - "json", - "loglevel", - "name", - "package", - "recommended-version-id", - "skip-ancestor-check", - "target-dev-hub" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:version:create"], - "command": "package:version:create", - "flagAliases": [ - "apiversion", - "buildinstance", - "codecoverage", - "definitionfile", - "installationkey", - "installationkeybypass", - "postinstallscript", - "postinstallurl", - "releasenotesurl", - "skipancestorcheck", - "skipvalidation", - "target-hub-org", - "targetdevhubusername", - "uninstallscript", - "validateschema", - "versiondescription", - "versionname", - "versionnumber" - ], - "flagChars": ["a", "b", "c", "d", "e", "f", "j", "k", "n", "p", "r", "s", "t", "v", "w", "x"], - "flags": [ - "api-version", - "async-validation", - "branch", - "build-instance", - "code-coverage", - "definition-file", - "flags-dir", - "installation-key", - "installation-key-bypass", - "json", - "language", - "loglevel", - "package", - "path", - "post-install-script", - "post-install-url", - "preserve", - "releasenotes-url", - "skip-ancestor-check", - "skip-validation", - "tag", - "target-dev-hub", - "uninstall-script", - "validate-schema", - "verbose", - "version-description", - "version-name", - "version-number", - "wait", - "generate-pkg-zip" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:version:create:list"], - "command": "package:version:create:list", - "flagAliases": ["apiversion", "createdlastdays", "target-hub-org", "targetdevhubusername"], - "flagChars": ["c", "s", "v"], - "flags": [ - "api-version", - "created-last-days", - "flags-dir", - "json", - "loglevel", - "show-conversions-only", - "status", - "target-dev-hub", - "verbose" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:version:create:report"], - "command": "package:version:create:report", - "flagAliases": ["apiversion", "packagecreaterequestid", "target-hub-org", "targetdevhubusername"], - "flagChars": ["i", "v"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "package-create-request-id", "target-dev-hub"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:version:delete"], - "command": "package:version:delete", - "flagAliases": ["apiversion", "noprompt", "target-hub-org", "targetdevhubusername"], - "flagChars": ["n", "p", "v"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "no-prompt", "package", "target-dev-hub", "undelete"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:version:displayancestry"], - "command": "package:version:displayancestry", - "flagAliases": ["apiversion", "dotcode", "target-hub-org", "targetdevhubusername"], - "flagChars": ["p", "v"], - "flags": ["api-version", "dot-code", "flags-dir", "json", "loglevel", "package", "target-dev-hub", "verbose"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:version:displaydependencies", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["p", "v"], - "flags": ["api-version", "edge-direction", "flags-dir", "json", "loglevel", "package", "target-dev-hub", "verbose"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:version:list"], - "command": "package:version:list", - "flagAliases": [ - "apiversion", - "createdlastdays", - "modifiedlastdays", - "orderby", - "target-hub-org", - "targetdevhubusername" - ], - "flagChars": ["b", "c", "m", "o", "p", "r", "v"], - "flags": [ - "api-version", - "branch", - "concise", - "created-last-days", - "flags-dir", - "json", - "loglevel", - "modified-last-days", - "order-by", - "packages", - "released", - "show-conversions-only", - "target-dev-hub", - "verbose" - ], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:version:promote"], - "command": "package:version:promote", - "flagAliases": ["apiversion", "noprompt", "target-hub-org", "targetdevhubusername"], - "flagChars": ["n", "p", "v"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "no-prompt", "package", "target-dev-hub"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:version:report"], - "command": "package:version:report", - "flagAliases": ["apiversion", "target-hub-org", "targetdevhubusername"], - "flagChars": ["p", "v"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "package", "target-dev-hub", "verbose"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": [], - "command": "package:version:retrieve", - "flagAliases": ["apiversion", "targetdevhubusername"], - "flagChars": ["d", "p", "v"], - "flags": ["api-version", "flags-dir", "json", "loglevel", "output-dir", "package", "target-dev-hub"], - "plugin": "@salesforce/plugin-packaging" - }, - { - "alias": ["force:package:version:update"], - "command": "package:version:update", - "flagAliases": [ - "apiversion", - "installationkey", - "target-hub-org", - "targetdevhubusername", - "versiondescription", - "versionname" - ], - "flagChars": ["a", "b", "e", "k", "p", "t", "v"], - "flags": [ - "api-version", - "branch", - "flags-dir", - "installation-key", - "json", - "loglevel", - "package", - "tag", - "target-dev-hub", - "version-description", - "version-name" - ], - "plugin": "@salesforce/plugin-packaging" - } -] + { + "alias": [ + "force:package1:version:create" + ], + "command": "package1:version:create", + "flagAliases": [ + "apiversion", + "installationkey", + "managedrelease", + "packageid", + "postinstallurl", + "releasenotesurl", + "targetusername", + "u" + ], + "flagChars": [ + "d", + "i", + "k", + "m", + "n", + "o", + "p", + "r", + "v", + "w" + ], + "flags": [ + "api-version", + "description", + "flags-dir", + "installation-key", + "json", + "loglevel", + "managed-released", + "name", + "package-id", + "post-install-url", + "release-notes-url", + "target-org", + "version", + "wait" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package1:version:create:get" + ], + "command": "package1:version:create:get", + "flagAliases": [ + "apiversion", + "requestid", + "targetusername", + "u" + ], + "flagChars": [ + "i", + "o" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "request-id", + "target-org" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package1:version:display" + ], + "command": "package1:version:display", + "flagAliases": [ + "apiversion", + "packageversionid", + "targetusername", + "u" + ], + "flagChars": [ + "i", + "o" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "package-version-id", + "target-org" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package1:version:list" + ], + "command": "package1:version:list", + "flagAliases": [ + "apiversion", + "packageid", + "targetusername", + "u" + ], + "flagChars": [ + "i", + "o" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "package-id", + "target-org" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:bundle:create", + "flagAliases": [ + "apiversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "d", + "n", + "v" + ], + "flags": [ + "api-version", + "description", + "flags-dir", + "json", + "loglevel", + "name", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:bundle:delete", + "flagAliases": [ + "apiversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "b", + "n", + "v" + ], + "flags": [ + "api-version", + "bundle", + "flags-dir", + "json", + "loglevel", + "no-prompt", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:bundle:list", + "flagAliases": [ + "apiversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "target-dev-hub", + "verbose" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:bundle:version:create", + "flagAliases": [ + "apiversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "b", + "d", + "n", + "p", + "v", + "w" + ], + "flags": [ + "api-version", + "bundle", + "definition-file", + "description", + "flags-dir", + "json", + "loglevel", + "target-dev-hub", + "verbose", + "version-number", + "wait" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:bundle:version:create:list", + "flagAliases": [ + "apiversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "c", + "s", + "v" + ], + "flags": [ + "api-version", + "created-last-days", + "flags-dir", + "json", + "loglevel", + "status", + "target-dev-hub", + "verbose" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:bundle:version:create:report", + "flagAliases": [ + "apiversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "i", + "v" + ], + "flags": [ + "api-version", + "bundle-version-create-request-id", + "flags-dir", + "json", + "loglevel", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:bundle:version:list", + "flagAliases": [ + "apiversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "target-dev-hub", + "verbose" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:bundle:version:report", + "flagAliases": [ + "apiversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "b", + "v" + ], + "flags": [ + "api-version", + "bundle-version", + "flags-dir", + "json", + "loglevel", + "target-dev-hub", + "verbose" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:convert" + ], + "command": "package:convert", + "flagAliases": [ + "apiversion", + "buildinstance", + "definitionfile", + "installationkey", + "installationkeybypass", + "patchversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "a", + "c", + "f", + "k", + "m", + "p", + "s", + "v", + "w", + "x" + ], + "flags": [ + "api-version", + "build-instance", + "code-coverage", + "definition-file", + "flags-dir", + "installation-key", + "installation-key-bypass", + "json", + "loglevel", + "package", + "patch-version", + "seed-metadata", + "target-dev-hub", + "verbose", + "wait" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:create" + ], + "command": "package:create", + "flagAliases": [ + "apiversion", + "errornotificationusername", + "nonamespace", + "orgdependent", + "packagetype", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "d", + "e", + "n", + "o", + "r", + "t", + "v" + ], + "flags": [ + "api-version", + "description", + "error-notification-username", + "flags-dir", + "json", + "loglevel", + "name", + "no-namespace", + "org-dependent", + "package-type", + "path", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:delete" + ], + "command": "package:delete", + "flagAliases": [ + "apiversion", + "noprompt", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "n", + "p", + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "no-prompt", + "package", + "target-dev-hub", + "undelete" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:install" + ], + "command": "package:install", + "flagAliases": [ + "apexcompile", + "apiversion", + "installationkey", + "noprompt", + "publishwait", + "securitytype", + "targetusername", + "u", + "upgradetype" + ], + "flagChars": [ + "a", + "b", + "k", + "l", + "o", + "p", + "r", + "s", + "t", + "w" + ], + "flags": [ + "apex-compile", + "api-version", + "flags-dir", + "installation-key", + "json", + "loglevel", + "no-prompt", + "package", + "publish-wait", + "security-type", + "skip-handlers", + "target-org", + "upgrade-type", + "wait" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:install:report" + ], + "command": "package:install:report", + "flagAliases": [ + "apiversion", + "requestid", + "targetusername", + "u" + ], + "flagChars": [ + "i", + "o" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "request-id", + "target-org" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:installed:list" + ], + "command": "package:installed:list", + "flagAliases": [ + "apiversion", + "targetusername", + "u" + ], + "flagChars": [ + "o" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "target-org" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:list" + ], + "command": "package:list", + "flagAliases": [ + "apiversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "target-dev-hub", + "verbose" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:push-upgrade:abort", + "flagAliases": [], + "flagChars": [ + "i", + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "push-request-id", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:push-upgrade:list" + ], + "command": "package:push-upgrade:list", + "flagAliases": [ + "apiversion", + "scheduledlastdays", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "l", + "p", + "s", + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "package", + "scheduled-last-days", + "show-push-migrations-only", + "status", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:push-upgrade:report" + ], + "command": "package:push-upgrade:report", + "flagAliases": [ + "apiversion", + "pushrequestid", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "i", + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "push-request-id", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:push-upgrade:schedule", + "flagAliases": [ + "apiversion" + ], + "flagChars": [ + "f", + "l", + "p", + "t", + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "migrate-to-2gp", + "org-file", + "org-list", + "package", + "start-time", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:uninstall" + ], + "command": "package:uninstall", + "flagAliases": [ + "apiversion", + "targetusername", + "u" + ], + "flagChars": [ + "o", + "p", + "w" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "package", + "target-org", + "wait" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:uninstall:report" + ], + "command": "package:uninstall:report", + "flagAliases": [ + "apiversion", + "requestid", + "targetusername", + "u" + ], + "flagChars": [ + "i", + "o" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "request-id", + "target-org" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:update" + ], + "command": "package:update", + "flagAliases": [ + "apiversion", + "errornotificationusername", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "d", + "n", + "o", + "p", + "r", + "v" + ], + "flags": [ + "api-version", + "description", + "enable-app-analytics", + "error-notification-username", + "flags-dir", + "json", + "loglevel", + "name", + "package", + "recommended-version-id", + "skip-ancestor-check", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:version:create" + ], + "command": "package:version:create", + "flagAliases": [ + "apiversion", + "buildinstance", + "codecoverage", + "definitionfile", + "installationkey", + "installationkeybypass", + "postinstallscript", + "postinstallurl", + "releasenotesurl", + "skipancestorcheck", + "skipvalidation", + "target-hub-org", + "targetdevhubusername", + "uninstallscript", + "validateschema", + "versiondescription", + "versionname", + "versionnumber" + ], + "flagChars": [ + "a", + "b", + "c", + "d", + "e", + "f", + "j", + "k", + "n", + "p", + "r", + "s", + "t", + "v", + "w", + "x" + ], + "flags": [ + "api-version", + "async-validation", + "branch", + "build-instance", + "code-coverage", + "definition-file", + "flags-dir", + "generate-pkg-zip", + "installation-key", + "installation-key-bypass", + "json", + "language", + "loglevel", + "package", + "path", + "post-install-script", + "post-install-url", + "preserve", + "releasenotes-url", + "skip-ancestor-check", + "skip-validation", + "tag", + "target-dev-hub", + "uninstall-script", + "validate-schema", + "verbose", + "version-description", + "version-name", + "version-number", + "wait" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:version:create:list" + ], + "command": "package:version:create:list", + "flagAliases": [ + "apiversion", + "createdlastdays", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "c", + "s", + "v" + ], + "flags": [ + "api-version", + "created-last-days", + "flags-dir", + "json", + "loglevel", + "show-conversions-only", + "status", + "target-dev-hub", + "verbose" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:version:create:report" + ], + "command": "package:version:create:report", + "flagAliases": [ + "apiversion", + "packagecreaterequestid", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "i", + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "package-create-request-id", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:version:delete" + ], + "command": "package:version:delete", + "flagAliases": [ + "apiversion", + "noprompt", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "n", + "p", + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "no-prompt", + "package", + "target-dev-hub", + "undelete" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:version:displayancestry" + ], + "command": "package:version:displayancestry", + "flagAliases": [ + "apiversion", + "dotcode", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "p", + "v" + ], + "flags": [ + "api-version", + "dot-code", + "flags-dir", + "json", + "loglevel", + "package", + "target-dev-hub", + "verbose" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:version:displaydependencies", + "flagAliases": [ + "apiversion", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "k", + "p", + "v" + ], + "flags": [ + "api-version", + "edge-direction", + "flags-dir", + "installation-key", + "json", + "loglevel", + "package", + "target-dev-hub", + "verbose" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:version:list" + ], + "command": "package:version:list", + "flagAliases": [ + "apiversion", + "createdlastdays", + "modifiedlastdays", + "orderby", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "b", + "c", + "m", + "o", + "p", + "r", + "v" + ], + "flags": [ + "api-version", + "branch", + "concise", + "created-last-days", + "flags-dir", + "json", + "loglevel", + "modified-last-days", + "order-by", + "packages", + "released", + "show-conversions-only", + "target-dev-hub", + "verbose" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:version:promote" + ], + "command": "package:version:promote", + "flagAliases": [ + "apiversion", + "noprompt", + "target-hub-org", + "targetdevhubusername" + ], + "flagChars": [ + "n", + "p", + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "no-prompt", + "package", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [], + "command": "package:version:retrieve", + "flagAliases": [ + "apiversion", + "targetdevhubusername" + ], + "flagChars": [ + "d", + "p", + "v" + ], + "flags": [ + "api-version", + "flags-dir", + "json", + "loglevel", + "output-dir", + "package", + "target-dev-hub" + ], + "plugin": "@salesforce/plugin-packaging" + }, + { + "alias": [ + "force:package:version:update" + ], + "command": "package:version:update", + "flagAliases": [ + "apiversion", + "installationkey", + "target-hub-org", + "targetdevhubusername", + "versiondescription", + "versionname" + ], + "flagChars": [ + "a", + "b", + "e", + "k", + "p", + "t", + "v" + ], + "flags": [ + "api-version", + "branch", + "flags-dir", + "installation-key", + "json", + "loglevel", + "package", + "tag", + "target-dev-hub", + "version-description", + "version-name" + ], + "plugin": "@salesforce/plugin-packaging" + } +] \ No newline at end of file diff --git a/messages/package_version_displaydependencies.md b/messages/package_version_displaydependencies.md index 7634d7b2..77e23d1a 100644 --- a/messages/package_version_displaydependencies.md +++ b/messages/package_version_displaydependencies.md @@ -16,6 +16,10 @@ Display the dependency graph for an unlocked or 2GP managed package version. <%= config.bin %> <%= command.id %> --package 08c... +- Display the dependency graph for a key-protected package version: + + <%= config.bin %> <%= command.id %> --package 04t... --installation-key "my installation key" + # flags.package.summary ID or alias of the package version (starts with 04t) or the package version create request (starts with 08c) to display the dependency graph for. @@ -32,6 +36,10 @@ Order (root-first or root-last) in which the dependencies are displayed. A root-first graph declares the root as the package that must be installed last. A root-last graph is the reverse order of root-first. If you specify "--edge-direction root-last", the graph displays the packages in the order they must be installed. The root starts with the farthest leaf of the package dependencies and ends with the base package, which must be installed last. +# flags.installation-key.summary + +Installation key for a key-protected package version (starts with 04t). + # flags.verbose.summary Display both the package version ID (starts with 04t) and the version number (major.minor.patch.build) in each node. diff --git a/src/commands/package/version/displaydependencies.ts b/src/commands/package/version/displaydependencies.ts index ccfd87d8..6d88fd66 100644 --- a/src/commands/package/version/displaydependencies.ts +++ b/src/commands/package/version/displaydependencies.ts @@ -38,6 +38,10 @@ export class PackageVersionDisplayDependenciesCommand extends SfCommand({ options: ['root-first', 'root-last'], })({ @@ -60,6 +64,7 @@ export class PackageVersionDisplayDependenciesCommand extends SfCommand Date: Tue, 23 Jun 2026 08:49:18 -0600 Subject: [PATCH 2/2] test: add unit tests for displaydependencies command Verify installation key is passed through to getDependencyGraph, edge-direction is respected, and output goes to stdout vs JSON result. --- .../package/displayDependencies.test.ts | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 test/commands/package/displayDependencies.test.ts diff --git a/test/commands/package/displayDependencies.test.ts b/test/commands/package/displayDependencies.test.ts new file mode 100644 index 00000000..e72d8caf --- /dev/null +++ b/test/commands/package/displayDependencies.test.ts @@ -0,0 +1,126 @@ +/* + * Copyright 2026, Salesforce, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { MockTestOrgData, TestContext } from '@salesforce/core/testSetup'; +import { Config } from '@oclif/core'; +import { expect } from 'chai'; +import { Package } from '@salesforce/packaging'; +import sinon from 'sinon'; +import { SfCommand } from '@salesforce/sf-plugins-core'; +import { SfProject } from '@salesforce/core'; +import { PackageVersionDisplayDependenciesCommand } from '../../../src/commands/package/version/displaydependencies.js'; + +const DOT_OUTPUT = `strict digraph G { + node_04tXXX [label="Pkg@1.0.0.0" color="green"] + node_04tYYY [label="Dep@2.0.0.1" color="green"] + node_04tXXX -> node_04tYYY +}`; + +describe('package:version:displaydependencies', () => { + const $$ = new TestContext(); + const testOrg = new MockTestOrgData(); + const config = new Config({ root: import.meta.url }); + + let logStub: sinon.SinonStub; + let getDependencyGraphStub: sinon.SinonStub; + + before(async () => { + await $$.stubAuths(testOrg); + await config.load(); + }); + + beforeEach(async () => { + logStub = $$.SANDBOX.stub(SfCommand.prototype, 'log'); + getDependencyGraphStub = $$.SANDBOX.stub(Package, 'getDependencyGraph').resolves({ + getDependencyDotProducer: sinon.stub().resolves({ + produce: sinon.stub().returns(DOT_OUTPUT), + }), + } as never); + }); + + afterEach(() => { + $$.restore(); + $$.SANDBOX.restore(); + }); + + it('should call getDependencyGraph with installation key when provided', async () => { + const command = new PackageVersionDisplayDependenciesCommand( + ['-p', '04tXXXXXXXXXXXXXX0', '-v', testOrg.username, '-k', 'myKey123'], + config + ); + command.project = SfProject.getInstance(); + + await command.run(); + + expect(getDependencyGraphStub.calledOnce).to.be.true; + const callArgs = getDependencyGraphStub.firstCall.args; + expect(callArgs[0]).to.equal('04tXXXXXXXXXXXXXX0'); + expect(callArgs[3]).to.deep.include({ installationKey: 'myKey123' }); + }); + + it('should call getDependencyGraph without installation key when not provided', async () => { + const command = new PackageVersionDisplayDependenciesCommand( + ['-p', '04tXXXXXXXXXXXXXX0', '-v', testOrg.username], + config + ); + command.project = SfProject.getInstance(); + + await command.run(); + + expect(getDependencyGraphStub.calledOnce).to.be.true; + const callArgs = getDependencyGraphStub.firstCall.args; + expect(callArgs[0]).to.equal('04tXXXXXXXXXXXXXX0'); + expect(callArgs[3]).to.deep.include({ installationKey: undefined }); + }); + + it('should output DOT code to stdout when not --json', async () => { + const command = new PackageVersionDisplayDependenciesCommand( + ['-p', '04tXXXXXXXXXXXXXX0', '-v', testOrg.username], + config + ); + command.project = SfProject.getInstance(); + + await command.run(); + + expect(logStub.calledOnce).to.be.true; + expect(logStub.firstCall.args[0]).to.equal(DOT_OUTPUT); + }); + + it('should return DOT code as result when --json', async () => { + const command = new PackageVersionDisplayDependenciesCommand( + ['-p', '04tXXXXXXXXXXXXXX0', '-v', testOrg.username, '--json'], + config + ); + command.project = SfProject.getInstance(); + + const result = await command.run(); + + expect(result).to.equal(DOT_OUTPUT); + expect(logStub.called).to.be.false; + }); + + it('should pass edge-direction option to getDependencyGraph', async () => { + const command = new PackageVersionDisplayDependenciesCommand( + ['-p', '04tXXXXXXXXXXXXXX0', '-v', testOrg.username, '--edge-direction', 'root-last'], + config + ); + command.project = SfProject.getInstance(); + + await command.run(); + + const callArgs = getDependencyGraphStub.firstCall.args; + expect(callArgs[3]).to.deep.include({ edgeDirection: 'root-last' }); + }); +});