Skip to content

klewis-sfdc/salesforcedx-apex

 
 

Repository files navigation

Salesforce Apex Library

CircleCI npm (scoped) License Commitizen friendly

Introduction

Typescript library to support the Apex plugin and Salesforce Extensions for VS Code.

Note: This library is in beta and has been released early so we can collect feedback. It may contain bugs, undergo major changes, or be discontinued. Please report any issues via the Issues tab.


Building the Library

Clone the project and cd into it:

$ git clone [email protected]:forcedotcom/salesforcedx-apex.git
$ cd salesforcedx-apex

Ensure that you have Yarn installed, then run:

$ yarn install
$ yarn build

Using the Library

Install the library locally by adding this information to your project's package.json:

"@salesforce/apex-node": "file://path/to/salesforcedx-apex/packages/apex-node"

Using the library directly requires access to a Salesforce Connection. Create an instance of the specific Apex service to get access to the required methods. For example, to get a list of logs:

$ const authInfo = await AuthInfo.create({ username: myAdminUsername });
$ const connection = await Connection.create({ authInfo });

$ const logService = new LogService(connection);
$ const logList = await logService.getLogRecords();

You can use the same pattern for the Test Service and Execute Service as well.

Running the Test Suite

Run the test suite locally by building the project first and then running the tests.

$ yarn build
$ yarn test

About

Salesforce CLI Plugin that hosts the Apex commands

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 95.7%
  • Apex 2.5%
  • JavaScript 1.8%