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.
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
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.
Run the test suite locally by building the project first and then running the tests.
$ yarn build
$ yarn test