Skip to content

Commit 976986b

Browse files
committed
feat: update for InstalledPackages type change
1 parent abb82e0 commit 976986b

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

  • src/commands/package/installed

src/commands/package/installed/list.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,11 @@ export class PackageInstalledListCommand extends SfCommand<PackageInstalledComma
6060

6161
// Calculate Version Settings from the data already in the result
6262
if (r.SubscriberPackageVersion) {
63-
// Access fields that are now included in the query but may not be in the type definition yet
64-
const subPkgVersion = r.SubscriberPackageVersion as {
65-
IsManaged?: boolean;
66-
Package2ContainerOptions?: string;
67-
};
68-
const isManaged = subPkgVersion.IsManaged;
69-
const package2ContainerOptions = subPkgVersion.Package2ContainerOptions;
63+
const isManaged = r.SubscriberPackageVersion.IsManaged;
64+
const package2ContainerOptions = r.SubscriberPackageVersion.Package2ContainerOptions;
7065

71-
// What does UI do for non-managed packages? Follow the same pattern. Then can probably simplify this logic
72-
// If IsManaged is true AND Package2ContainerOptions is blank, use "namespace"; otherwise use "packageId"
66+
// Use namespace for 1GP managed packages. For 2GP managed packages use packageId. For anything else,
67+
// Version Settings is not applicable, so leave it empty.
7368
if (isManaged && !package2ContainerOptions) {
7469
transformed.VersionSettings = 'namespace';
7570
} else if (package2ContainerOptions === 'Managed') {

0 commit comments

Comments
 (0)