@ciguru/sfdx-ts-adapter
v1.2.1
Published
Provide TS interfaces to the SFDX CLI as functions instead of executing commands on the command line
Downloads
5
Readme
TypeScript Adapter for SFDX CLI
Provide TS interfaces to the SFDX CLI as functions instead of executing commands on the command line. This adapter imports SFDX plugins directly instead of using the full SFDX CLI Tool. This adapter imitates CLI calls to oclif commands instead of directly calling plugin functions/classes, since only the CLI API is officially supported.
Releases
The plugins used for the released adapter version are the same as in the mentioned sfdx-cli version.
Installation
You can install this by either using npm installer.
Requirements
To get started, you'll need to install node v16 (LTS) or greater. While this can be done using an installer from nodejs.com or via an OS-specific package manager.
Install package
> npm install --global @ciguru/sfdx-ts-adapter
Usage
Import adapter
import SFDX from '@ciguru/sfdx-ts-adapter';
Supported Commands
> sfdx auth:accesstoken:store
(since v1.0.0)
Call function
await SFDX.auth.accessToken.store(alias, instanceUrl, accessToken);
Parameters
Output Data
ToBe Described
> sfdx auth:sfdxurl:store
(since v1.0.0)
Call function
await SFDX.auth.sfdxUrl.store(alias, sfdxUrlFile);
Parameters
Output Data
ToBe Described
> sfdx auth:store
(since v1.0.0)
Call function
await SFDX.auth.list();
Output Data
ToBe Described
> sfdx auth:logout
(since v1.0.0)
Call function
await SFDX.auth.logout(targetUserName);
Parameters
Output Data
ToBe Described
> sfdx force:apex:execute
(since v1.0.0)
Call function
await SFDX.force.apex.execute(targetUserName, apexCodeFile);
Parameters
Output Data
ToBe Described
> sfdx force:apex:test:run
(since v1.0.0)
Call function
await SFDX.force.apex.test.run(targetUserName, outputDir, testLevel);
Parameters
Output Data
ToBe Described
> sfdx force:data:bulk:delete
(since v1.2.0)
Call function
await SFDX.force.data.bulk.delete(
targetUserName,
csvFile,
sObjectType,
allowNoMoreFailedBatches,
allowNoMoreFailedRecords,
);
Parameters
Output Data
ToBe Described
> sfdx force:data:bulk:upsert
(since v1.0.0)
Call function
await SFDX.force.data.bulk.upsert(
targetUserName,
csvFile,
externalId,
sObjectType,
allowNoMoreFailedBatches,
allowNoMoreFailedRecords,
);
Parameters
Output Data
ToBe Described
> sfdx force:data:tree:import
(since v1.0.0)
Call function
await SFDX.force.data.tree.import(targetUserName, planFile);
Parameters
Output Data
ToBe Described
> sfdx force:data:soql:query
(since v1.2.0)
Call function
await SFDX.force.data.soql.queryCsv(targetUserName, csvFile, query, replaceCsvHeader);
Parameters
Output Data
ToBe Described
> sfdx force:mdapi:deploy
(since v1.0.0)
Call function
await SFDX.force.mdApi.deploy(targetUserName, testLevel, isCheckOnly, deployDir, deployZip);
Parameters
Output Data
ToBe Described
> sfdx force:mdapi:deploy:report
(since v1.0.0)
Call function
await SFDX.force.mdApi.deployReport(targetUserName, jobId, waitTimeout);
Parameters
Output Data
ToBe Described
> sfdx force:mdapi:retrieve
(since v1.0.0)
Call function
await SFDX.force.mdApi.retrieve(targetUserName, retrieveTargetDir, manifestFile, packageNames);
Parameters
Output Data
ToBe Described
> sfdx force:org:create
(since v1.0.0)
Call function
await SFDX.force.org.create.scratch(alias, isNoAncestors, definitionFile, devHubUserName, duration, overrideDefinition);
Parameters
Output Data
ToBe Described
> sfdx force:org:delete
(since v1.0.0)
Call function
await SFDX.force.org.delete(targetUsername, devHubUserName);
Parameters
Output Data
ToBe Described
> sfdx force:org:display
(since v1.0.0)
Call function
await SFDX.force.org.display(targetUsername);
Parameters
Output Data
ToBe Described
> sfdx force:package:install
(since v1.0.0)
Call function
await SFDX.force.package.install(targetUserName, packageId);
Parameters
Output Data
ToBe Described
> sfdx force:source:convert
(since v1.1.0)
Call function
await SFDX.force.source.convert(outputDir, sourcePath);
Parameters
Output Data
ToBe Described
> sfdx force:source:push
(since v1.0.0)
Call function
await SFDX.force.source.push(targetUserName, isForceOverwrite);
Parameters
Output Data
ToBe Described