vlocode-project - v1.40.0-beta-4
    Preparing search index...

    Class SalesforcePackageBuilder

    Index

    Constructors

    Properties

    apiVersion: string = SalesforcePackageBuilder.defaultApiVersion
    composedData: Map<string, MetadataObject> = ...
    logger: Logger
    parsedFiles: Set<string> = ...
    plugins: [TokenReplacementPlugin, ...SalesforcePackageBuilderPlugin[]] = ...
    rebuildRequired: boolean = false
    type: SalesforcePackageType = SalesforcePackageType.deploy
    defaultApiVersion: string = '64.0'

    Default API version to use when no version is specified.

    Methods

    • Add file a file to the parsed file set when not already added. Normalizes the file path when required/

      Parameters

      • file: string

        file to add

      Returns boolean

      Returns true when the file is nto yet parsed; returns false when the file is already parsed.

    • Extend the package builder with custom functionality by registering a plugin. Plugins are used to modify package entries during the build process, allowing for custom transformations, as well as filtering or adding new entries.

      The provided SalesforcePackageBuilderPlugin instance is appended to the builder's internal plugin list and will be considered during subsequent package build operations.

      This method does not perform deduplication or validation of the plugin; callers are responsible for avoiding duplicate registrations if that is undesired.

      Parameters

      • plugin: SalesforcePackageBuilderPlugin

        The plugin to register with the package builder.

      Returns void

      void

    • Parameters

      • replacement: ReplacementDetail

      Returns void

      Add the TokenReplacementPlugin using {@link addPlugin} and add replacements to the plugin instead of using this method.

    • Add compressed static resource bundle to the package; compresses all the resources in the folder into a zip file but does not add the meta-data file for the resource folder.

      Parameters

      • folder: string

        Folder name to add and compress

      Returns Promise<void>

    • Compress all files in the specified folder into a single ZIP archive and returns the Buffer to the ZIP archive generated

      Parameters

      • folder: string

        Folder name to add and compress

      Returns Promise<Buffer<ArrayBufferLike>>

    • Gets a SalesforcePackage containing only the changed components using the provided strategy. TODO: Based on the type of metadata a different strategy should be used instead of the generic one. This will allow for more efficient in delta packaging by using a different API for certain metadata types.

      Type Parameters

      Parameters

      • Optionalstrategy: S | (new (...args: any[]) => S)

        The strategy to use for getting the changed components

      • Optionaloptions: Parameters<S["getChangedComponents"]>[1]

        Options that are passed to the strategy

      Returns Promise<SalesforcePackage>

      A SalesforcePackage containing only the changed components

    • Get root Element/Tag name of the specified XML file.

      Parameters

      • file: string

        Path to the XML file from which to get the root element name.

      Returns Promise<undefined | string>

    • Merge the source of the child element into the parent

      Parameters

      • sourceFile: string

        Source file containing the child source

      • fragmentTypeName: string

        XML name of the child element

      • parentType: MetadataType

        Metadata type of the parent/root

      Returns Promise<void>

    • Merge the source file into the existing package metadata when there is an existing metadata file.

      Parameters

      • packagePath: string

        Path of the parent package file in the package

      • fragmentFile: string

        Path of the metedata file on the FS that should be merged into the package

      • metadataType: MetadataType

        Type of the metadata to merge

      Returns Promise<void>

    • Removes unchanged components from the package by executing the provided delta strategy which determines which components have changed.

      Type Parameters

      • S extends DeltaPackageStrategy<T>

        The type of the DeltaPackageStrategy.

      • T extends object

        The type of the object.

      Parameters

      • Optionalstrategy: S | (new (...args: any[]) => S)

        The DeltaPackageStrategy instance or constructor.

      • Optionaloptions: Parameters<S["getChangedComponents"]>[1]

        The options for getting changed components.

      Returns Promise<SalesforcePackageComponent[]>

      An array of removed SalesforcePackageComponent objects.