-
Sorry if this is not the right place to post this - but it's something I have come up against when doing some custom sf cli plugin development. Are there any Salesforce or community efforts to create typescript types for Salesforce metadata? I came across this - https://github.com/amphro/salesforce-to-types - but this would be used to generate something like a type for an Account object. What I am looking for, is types for the metadata itself - eg. sobject, custom field, profile etc - to be used in a sf cli plugin that interacts with metadata. For example, a type for custom field would include things like; If there isn't anything existing, are there any sensible ways to generate these programatically? I've tried calling the Tooling API to describe the CustomField and FieldDefinition objects, but the fields in the response are different to the fields listed on the pages linked above. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yeah! We started that pretty recently. Currently, we're starting to use it like they're also mostly correct in the newer Tooling API !== metadataAPI, schema wise. The tooling API is also One of our next big tasks in consolidating jsforce to use the |
Beta Was this translation helpful? Give feedback.
Yeah! We started that pretty recently. Currently,
@salesforce/types
is generated from the WSDL. A lot of that was initiated/contributed by Andrés Catalán.we're starting to use it like
https://github.com/salesforcecli/plugin-sobject/blob/a8289d74cd0ba9c209b8b15e5dca34cc784300c4/src/shared/types.ts#L8
https://github.com/salesforcecli/plugin-sobject/blob/a8289d74cd0ba9c209b8b15e5dca34cc784300c4/src/shared/prompts/nameField.ts#L12
etc.
they're also mostly correct in the newer
jsforce
(v3) and (recommended for cli-plugins)@jsforce/jsforce-node
packages but somewhat out of date. For long-standing things that haven't changed much (ex: CustomObject) you might find it workable.Tooling API !== m…