@dynau/sf-utils
v2.0.4
Published
SDK-style typescript wrappers for working with Salesforce REST APIs
Readme
@dynau/sf-utils
SDK-style typescript wrappers for working with Salesforce REST APIs
For assistance reach out to author - Anton Dynau.
Get Started
1. Install:
npm install @dynau/sf-utils2. Generate types for your org:
import { SalesforceTypeGenerator } from "@dynau/sf-utils";
await SalesforceTypeGenerator.generateTypesForOrg({
orgName: "my org",
alias: "my-sf-cli-alias", // will be used for authentication via SF CLI
includeSObjects: ["Account", "Contact", "ContentVersion"],
path: "./src/generated",
});
src/generated/my-org
├─ sobjects
│ ├─ Account.ts
│ ├─ Contact.ts
│ └─ ContentVersion.ts
└─ my-org.ts3. Use:
import { MY_ORG } from "./generated/my-org/my-org.js";
await MY_ORG.apex.executeAnonymous("System.debug('Hello World');");What's included:
- Apex
- execute Anonymous Apex
- call Apex REST Service
- Bulk API v2
- Ingest
- Query
- Salesforce CSV
- Parser
- Writer
- DML (one/many), including working with binary fields
- Limits
- Network
- Org information & authentication (uses SF CLI)
- HTTP client for requests to org (uses Axios)
- SObject
- Describes Service
- get counts per SObject type
- get binary field
- Native JS implementations of SObject/Schema functionality for runtime
- SOQL
- Execute typed and untyped queries
- Date literals (TODAY, NEXT_WEEK, NEXT_N_YEARS:n etc.)
- Native type-safe typescript query model with autocomplete
- Type Generator
