Package Exports
- @salesforce/source-deploy-retrieve
- @salesforce/source-deploy-retrieve/lib/src/client/types
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@salesforce/source-deploy-retrieve) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Salesforce source-deploy-retrieve
Introduction
A JavaScript toolkit for working with Salesforce metadata. Built to support the SFDX deploy and retrieve experience in the Salesforce VS Code Extensions, CLI plugins, and other tools working with metadata.
Features
- Resolve Salesforce metadata files into JavaScript objects
- Parse and generate manifest files
- Convert source files between SFDX File Formats
- Generate metadata packages with the option to automatically create a zip file
- Deploy and retrieve metadata with an org
- An index to reference available metadata types.
- Utilize promises with
async/await
syntax
Usage
Install the package:
npm install @salesforce/source-deploy-retrieve
Examples:
const { ComponentSet } = require('@salesforce/source-deploy-retrieve');
// Deploy a local set of Apex classes to an org
const deployResult = await ComponentSet
.fromSource('/dev/MyProject/force-app/main/default/classes')
.deploy({ usernameOrConnection: 'user@example.com' })
.start();
// Retrieve metadata defined in a manifest file
const retrieveResult = await ComponentSet
.fromManifest('/dev/my-project/manifest/package.xml')
.retrieve({
usernameOrConnection: 'user@example.com'
output: '/dev/retrieve-result'
})
.start();
// Search for a particular CustomObject
const myObject = ComponentSet
.fromSource([
'/dev/my-project/force-app',
'/dev/my-project/force-app-2'
])
.find(component => {
return component.fullName === 'MyObject__c' && component.type.name === 'CustomObject')
});
See the examples folder for more code samples and guides.
Contributing
See CONTRIBUTING.md for details on how to contribute to the library.
See developing.md for details on building and testing the library locally.