JSPM

@salesforce/source-deploy-retrieve

5.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 277920
  • Score
    100M100P100Q189614F
  • License BSD-3-Clause

JavaScript library to run Salesforce metadata deploys and retrieves

Package Exports

  • @salesforce/source-deploy-retrieve
  • @salesforce/source-deploy-retrieve/lib/src/client/types
  • @salesforce/source-deploy-retrieve/lib/src/common
  • @salesforce/source-deploy-retrieve/lib/src/resolve
  • @salesforce/source-deploy-retrieve/lib/src/utils

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

CircleCI License npm (scoped) Commitizen friendly

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. See the API documentation for details on how to effectively use and integrate SDR.

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.

Publishing

SDR publishes when changes are merged into main. The version is bumped per the rules of the release orb and standard-version.