Code Generation
While some aspects of ts-force
can be used without it, the real power of this library comes from generated classes. The code generation command has been split out to the ts-force-gen
package so that it can easily be excluded from production builds.
Configuration
Generation is controlled via a json config file. A default file can be initialized by running ts-force-gen --init
Authorization
Several methods are provided to handle authorization. The recommended approach is to use the sfdx-cli
connected orgs (as shown above).
SObject Config
The sObjects
array can accept either a string
of the API name or an object with additional configuration.
Naming Conflicts
If two fields or SObjects sanitize to the same name, the latter one processed with be appended with a number:
Custom field mappings can be defined on an individual "SObject Config" to better control conflicts:
Handling Namespaces
TODO
Generating Picklist
TODO
Generation
To generate code, run the following command:
You can optionally specify the path to the configuration file with the -j
param.
Last updated
Was this helpful?