@salesforce/source-deploy-retrieve
Version:
JavaScript library to run Salesforce metadata deploys and retrieves
78 lines (77 loc) • 3.07 kB
TypeScript
import { SourcePath } from '../../common/types';
import { SourceComponent } from '../sourceComponent';
import { MetadataXml } from '../types';
import { BundleSourceAdapter } from './bundleSourceAdapter';
/**
* Source Adapter for DigitalExperience metadata types. This metadata type is a bundled type of the format
*
* __Example Structure__:
*
*```text
* site/
* ├── foos/
* | ├── sfdc_cms__appPage/
* | | ├── mainAppPage/
* | | | ├── _meta.json
* | | | ├── content.json
* | ├── sfdc_cms__view/
* | | ├── view1/
* | | | ├── _meta.json
* | | | ├── content.json
* | | | ├── fr.json
* | | | ├── en.json
* | | ├── view2/
* | | | ├── _meta.json
* | | | ├── content.json
* | | | ├── ar.json
* | | ├── view3/
* | | | ├── _meta.json
* | | | ├── content.json
* | | | ├── mobile/
* | | | | ├──mobile.json
* | | | ├── tablet/
* | | | | ├──tablet.json
* | ├── foos.digitalExperience-meta.xml
* content/
* ├── bars/
* | ├── bars.digitalExperience-meta.xml
* web_app/
* ├── zenith/
* | ├── css/
* | | ├── header/
* | | | ├── header.css
* | | ├── home.css
* | ├── js/
* | | ├── home.js
* | ├── html/
* | | ├── home.html
* | ├── images/
* | | ├── logos/
* | | | ├── logo.png
* ```
*
* In the above structure the metadata xml file ending with "digitalExperience-meta.xml" belongs to DigitalExperienceBundle MD type.
* The "_meta.json" files are child metadata files of DigitalExperienceBundle belonging to DigitalExperience MD type. The rest of the files in the
* corresponding folder are the contents to the DigitalExperience metadata. So, incase of DigitalExperience the metadata file is a JSON file
* and not an XML file.
*
* For web_app base type, the bundle is identified by directory structure alone without metadata XML files.
*/
export declare class DigitalExperienceSourceAdapter extends BundleSourceAdapter {
getComponent(path: SourcePath, isResolvingSource?: boolean): SourceComponent | undefined;
protected parseAsRootMetadataXml(path: string): MetadataXml | undefined;
protected getRootMetadataXmlPath(trigger: string): string;
protected trimPathToContent(path: string): string;
protected populate(trigger: string, component?: SourceComponent): SourceComponent;
protected parseMetadataXml(path: SourcePath): MetadataXml | undefined;
private populateWebAppBundle;
private getBundleName;
private getBundleMetadataXmlPath;
private isBundleType;
}
/**
* Checks if the given path belongs to the web_app base type.
* web_app base type has a simpler structure without ContentType folders.
* Structure: digitalExperiences/web_app/spaceApiName/...files...
*/
export declare const isWebAppBaseType: (path: string) => boolean;