@salesforce/packaging
    Preparing search index...

    Class Package

    Provides the ability to list, create, update, delete, convert, and get version ancestry for a 2nd generation package.

    Examples

    Create a new instance and get the ID (0Ho):

    const id = new Package({connection, project, packageOrAliasId}).getId();

    Create a new package in the org:

    const myPkg = await Package.create(connection, project, options);

    List all packages in the org:

    const pkgList = await Package.list(connection);

    Index
    • Deletes the package.

      Returns Promise<SaveResult>

    • Returns the package ID of the package.

      Returns string

      package ID (0Ho)

    • Returns the package data for the package.

      Parameters

      • force: boolean = false

        force a refresh of the package data

      Returns Promise<Package2 | undefined>

    • Un-Deletes the package.

      Returns Promise<SaveResult>

    • Create a new package.

      Parameters

      • connection: Connection

        instance of Connection

      • project: SfProject

        instance of SfProject

      • options: PackageCreateOptions

        options for creating a package - see PackageCreateOptions

      Returns Promise<{ Id: string }>

      Package

    • create a PackageAncestry instance

      Parameters

      • packageId: string

        to get version information for

      • project: SfProject | undefined

        SfProject instance

      • connection: Connection

        Hub Org Connection

      Returns Promise<PackageAncestry>

    • create a PackageVersionDependency instance

      Parameters

      • packageVersionId: string

        to get version information for

      • project: SfProject | undefined

        SfProject instance

      • connection: Connection

        Hub Org Connection

      • Optionaloptions: {
            edgeDirection?: "root-first" | "root-last";
            installationKey?: string;
            verbose?: boolean;
        }

        flags for the command line

      Returns Promise<PackageVersionDependency>

    • Returns all the packages that are available in the org, up to 10,000. If more records are needed use the SF_ORG_MAX_QUERY_LIMIT env var.

      Parameters

      • connection: Connection

      Returns Promise<Package2[]>