@salesforce/source-deploy-retrieve
    Preparing search index...

    Class SourceComponent

    Representation of a MetadataComponent in a file tree.

    Implements

    Index
    content?: string
    name: string
    parentType?: MetadataType
    pathContentMap: Map<string, string> = ...
    replacements?: Record<string, MarkedReplacement[]>
    xml?: string
    • get isAddressable(): boolean

      Returns whether this component type is supported by the Metadata API and therefore should have an entry added to the manifest.

      This is defined on the type in the registry. The type is required to be in the registry for proper classification and for possible use in decomposition/recomposition.

      Default value is true, so the only way to return false is to explicitly set it in the registry as false.

      E.g., CustomFieldTranslation.

      Returns boolean

    • get metaFilePath(): string | undefined

      Gets the metafile path of this component. Not all the types have an XML metafile, e.g., DigitalExperience has a JSON metafile (_meta.json).

      Returns string | undefined

      The metafile path

      This function should not be used, use "xml" property instead.

    • returns the children of a parent SourceComponent

      Ensures that the children of SourceComponent are valid child types. Invalid child types can occur when projects are structured in an atypical way such as having ApexClasses or Layouts within a CustomObject folder.

      Returns SourceComponent[]

      SourceComponent[] containing valid children

    • As a performance enhancement, use the already parsed parent xml source to return the child section of xml source. This is useful for non-decomposed transformers where all child source components reference the parent's xml file to prevent re-reading the same file multiple times.

      Type Parameters

      • T = JsonMap

      Parameters

      • parentXml: T

        parsed parent XMl source as an object

      Returns T

      child section of the parent's xml

    • Type Parameters

      • T extends JsonMap

      Parameters

      • OptionalxmlFilePath: string

      Returns Promise<T>

    • Type Parameters

      • T extends JsonMap

      Parameters

      • OptionalxmlFilePath: string

      Returns T