@salesforce/packaging
    Preparing search index...

    Provides the ability to create, update, delete, and promote 2nd generation package versions.

    Examples

    Create a new instance and get the ID (05i):

    const id = new PackageVersion({connection, project, idOrAlias}).getId();

    Create a new package version in the org:

    const myPkgVersion = await PackageVersion.create(options, pollingOptions);

    Promote a package version:

    new PackageVersion({connection, project, idOrAlias}).promote();

    Index
    • Get the package version ID for this PackageVersion.

      Returns Promise<string | undefined>

      The PackageVersionId (05i).

    • Get the package Id for this PackageVersion.

      Returns Promise<string | undefined>

      The PackageId (0Ho).

    • Get the subscriber package version ID for this PackageVersion.

      Returns Promise<string | undefined>

      The SubscriberPackageVersionId (04t).

    • Promotes this PackageVersion to released state.

      Returns Promise<SaveResult>

    • Convenience function that will wait for a package version to be created.

      This function emits LifeCycle events, "enqueued", "in-progress", "success", "error" and "timed-out" to progress and current status. Events also carry a payload of type PackageVersionCreateRequestResult.

      Parameters

      • createPackageVersionRequestId: string
      • connection: Connection

        Connection to the org

      • project: SfProject

        SfProject to read/write aliases from

      • polling: { frequency: Duration; timeout: Duration }

        frequency and timeout Durations to be used in polling

      Returns Promise<PackageVersionCreateRequestResult>

    • Query the Package2Version SObject and return data with the provided type.

      NOTE: There is a limit of 2000 records that can be returned, otherwise a GACK might be thrown. If more than 2000 records are desired you should filter the query by date and aggregate all results.

      Parameters

      Returns Promise<(Package2Version | undefined)[]>

      Results from querying the Package2Version SObject.

    • Convenience function that will wait for a package version to be created.

      This function emits LifeCycle events, "enqueued", "in-progress", "success", "error" and "timed-out" to progress and current status. Events also carry a payload of type PackageVersionCreateRequestResult.

      Parameters

      • createPackageVersionRequestId: string
      • project: SfProject
      • connection: Connection
      • polling: { frequency: Duration; timeout: Duration }

        frequency and timeout Durations to be used in polling

      Returns Promise<PackageVersionCreateRequestResult>