@salesforce/packaging
    Preparing search index...

    Provides the ability to get, list, install, and uninstall 2nd generation subscriber package versions.

    Examples

    List all 2GP installed packages in the org:

    const installedPkgs = await SubscriberPackageVersion.installedList(connection);

    Install a 2GP subscriber package version:

    const installStatus = await new SubscriberPackageVersion(options).install(request, options);

    Index
    • Returns an array of RSS and CSP external sites for the package.

      Returns Promise<Optional<string[]>>

      an array of RSS and CSP site URLs, or undefined if the package doesn't have any.

    • Return a field value from the SubscriberPackageVersion SObject using the field name.

      Type Parameters

      • T

      Parameters

      • field: string

      Returns Promise<T>

    • Get the package version ID for this SubscriberPackageVersion.

      Returns Promise<string>

      The SubscriberPackageVersion Id (04t).

    • Get the subscriber package Id (033) for this SubscriberPackageVersion.

      Returns Promise<string>

      The subscriber package Id (033).

    • Is the SubscriberPackageVersion deprecated?

      Returns Promise<boolean>

      True if the SubscriberPackageVersion is deprecated.

    • Is the SubscriberPackageVersion org dependent?

      Returns Promise<boolean>

      True if the SubscriberPackageVersion is org dependent.

    • Is the SubscriberPackageVersion password protected?

      Returns Promise<boolean>

      True if the SubscriberPackageVersion is password protected.

    • Wait for the subscriber package version to be replicated across instances and available to be queried against

      Parameters

      • options: {
            installationKey?: string;
            publishFrequency: Duration;
            publishTimeout: Duration;
        } = ...
        • OptionalinstallationKey?: string

          the installation key for the package version

        • publishFrequency: Duration

          how often to check for the package version to be published

        • publishTimeout: Duration

          how long to wait for the package version to be published

      Returns Promise<void>

    • Resolve fields from a packageDirectories entry to a SubscriberPackageVersionId (04t). Specifically uses the versionNumber and packageId fields, as well as an optional branch field.

      Parameters

      • connection: Connection

        A connection object to the org

      • pkgDescriptor: Partial<PackageDescriptorJson>

        Fields from a packageDirectories entry in sfdx-project.json. The versionNumber and packageId fields are required. Optionally, the branch and package fields can be passed.

      Returns Promise<string>

      the SubscriberPackageVersionId (04t)