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);

Constructors

Methods

  • 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<undefined | Package2>

  • Un-Deletes the package.

    Returns Promise<SaveResult>

  • Create a new package.

    Parameters

    • connection: Connection<Schema>

      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: undefined | SfProject

      SfProject instance

    • connection: Connection<Schema>

      Hub Org Connection

    Returns Promise<PackageAncestry>

  • 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<Schema>

    Returns Promise<Package2[]>