interface SObject{
id: string;
name: string;
// everything else optional
}
interface ServiceFactory<T extends SObject> {
newService(connection: Auth): SObjectService<T>
}
interface SObjectService<T extends SObject> {
buildSOQL: (func: (fieldResolver : FieldResolver<T> => SOQLQueryParams)): SOQLQuery
query(qry: SOQLQuery<T> | string)
create(obj: T): T
update(obj: T): T
delete(id: string)
}
interface Mapper<T extend SObject> {
toSalesforceObject(obj: T)
fromSalesforceObject(sfObj: any): T
}
Last active
February 13, 2020 23:01
-
-
Save ChuckJonas/73b7e1113c70bcdc49eccbe22f3109f2 to your computer and use it in GitHub Desktop.
ts-force redesign
- Operates on serializable POJO
- Immutable
- better/more standard exception handling
- more functional
- Mapping of API names to standard javascript notation
- typed query building (FieldResolver)
- transforms values to make it easier to work with -- Maps picklists to string[] -- Maps Date (only) strings object {d: integer, m: integer, y: integer}
- Abstracts complexities of working with API -- Composite, CompositeCollection, CompositeBatch, Invokable, Custom endpoints, etc
- Ability to use mapping with custom endpoints
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment