Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

AuthTokenSet: { accessToken?: string; refreshToken?: string }

Type declaration

  • Optional accessToken?: string
  • Optional refreshToken?: string
HttpMethod: "GET" | "HEAD" | "PATCH" | "POST" | "DELETE"

HTTP methods supported by the Salesforce REST API.

SalesforceRestApiQueryResponse<T>: { done: boolean; records: T[]; totalSize: number }

Salesforce REST API response type for requests to the Query or QueryAll endpoints, for executing SOQL queries.

Type parameters

Type declaration

  • done: boolean
  • records: T[]
  • totalSize: number
SalesforceRestApiResult<T>: { data?: T; status: number }

Return type of executeApiRequest.

Type parameters

  • T = unknown

    A type that defines the expected response data.

Type declaration

  • Optional data?: T

    Response data.

  • status: number

    Response HTTP status code.

SalesforceRestApiSObject<T>: { Id: string; attributes: SalesforceRestApiSObjectAttributes } & T

Salesforce REST API object record type, used throughout the API including as a response for GET requests to the sObject Rows endpoint when retrieving individual records.

Use this type when defining types for objects in your Salesforce org, for example:

type Contact = SalesforceRestApiSObject<{
FirstName: string,
LastName: string,
Name: string,
Salutation: null,
}>;

Type parameters

  • T = unknown

    A type that defines the object’s fields.

SalesforceRestApiSObjectAttributes: { type: string; url: string }

Attributes type for the SalesforceRestApiSObject type.

Type declaration

  • type: string
  • url: string
SalesforceRestApiSObjectBasicInfoObjectDescribe: { activateable: boolean; associateEntityType: string | null; associateParentEntity: string | null; createable: boolean; custom: boolean; customSetting: boolean; deepCloneable: boolean; deletable: boolean; deprecatedAndHidden: boolean; feedEnabled: boolean; hasSubtypes: boolean; isInterface: boolean; isSubtype: boolean; keyPrefix: string; label: string; labelPlural: string; layoutable: boolean; mergeable: boolean; mruEnabled: boolean; name: string; queryable: boolean; replicateable: boolean; retrieveable: boolean; searchable: boolean; triggerable: boolean; undeletable: boolean; updateable: boolean; urls: SalesforceRestApiSObjectBasicInfoObjectDescribeUrls }

Object describe type for the SalesforceRestApiSObjectBasicInfoResponse type.

Type declaration

  • activateable: boolean
  • associateEntityType: string | null
  • associateParentEntity: string | null
  • createable: boolean
  • custom: boolean
  • customSetting: boolean
  • deepCloneable: boolean
  • deletable: boolean
  • deprecatedAndHidden: boolean
  • feedEnabled: boolean
  • hasSubtypes: boolean
  • isInterface: boolean
  • isSubtype: boolean
  • keyPrefix: string
  • label: string
  • labelPlural: string
  • layoutable: boolean
  • mergeable: boolean
  • mruEnabled: boolean
  • name: string
  • queryable: boolean
  • replicateable: boolean
  • retrieveable: boolean
  • searchable: boolean
  • triggerable: boolean
  • undeletable: boolean
  • updateable: boolean
  • urls: SalesforceRestApiSObjectBasicInfoObjectDescribeUrls
SalesforceRestApiSObjectBasicInfoObjectDescribeUrls: { approvalLayouts: string; compactLayouts: string; describe: string; layouts: string; listviews: string; quickActions: string; rowTemplate: string; sobject: string }

Type declaration

  • approvalLayouts: string
  • compactLayouts: string
  • describe: string
  • layouts: string
  • listviews: string
  • quickActions: string
  • rowTemplate: string
  • sobject: string
SalesforceRestApiSObjectBasicInfoResponse<T>: { objectDescribe: SalesforceRestApiSObjectBasicInfoObjectDescribe; recentItems: T[] }

Salesforce REST API response type for GET requests to the sObject Basic Information endpoint, for retrieving individual metadata for an object.

Type parameters

Type declaration

SalesforceRestApiSObjectCreateResponse: { errors: any[]; id: string; success: boolean }

Salesforce REST API response type for POST requests to the sObject Basic Information endpoint, for creating a new record for a given object.

Type declaration

  • errors: any[]
  • id: string
  • success: boolean
SalesforceRestApiSearchResponse<T>: { searchRecords: T[] }

Salesforce REST API response type for requests to the Search or Parameterized Search endpoints, for executing searches.

Type parameters

Type declaration

  • searchRecords: T[]

Functions

  • connect(salesforceOrgBaseUri: string, consumerKey: string, isSandbox?: boolean): Promise<SalesforceConnection>
  • Establishes a connection with a Salesforce org. Requires that a Connected App has been registered with the Salesforce org.

    In order for the user to authorize the app, a window is opened to the auth endpoint of the Salesforce org. The user logs in and then authorizes the app to access their Salesforce data, at which point the promise resolves with a connection object.

    If an existing connection exists that is still valid, that connection will be returned without the user having to re-auth.

    If the authorization process is not completed successfully for any reason, or if a connection cannot be established to the Salesforce org, an error will be thrown.

    throws

    AuthorizationError Thrown if the authorization process does not complete successfully.

    throws

    ConnectionError Thrown if a connection cannot be established to the Salesforce org after authorization.

    throws

    ParameterError Thrown if invalid function parameter values are detected.

    Parameters

    • salesforceOrgBaseUri: string

      The base URI of the Salesforce org to connect to, which should be in the form: https://MyDomainName.my.salesforce.com.

    • consumerKey: string

      The Consumer Key of the Connected App to use for authorization.

    • isSandbox: boolean = false

      Set to true if the Salesforce org is a sandbox.

    Returns Promise<SalesforceConnection>

    A connection which can be used to retrieve data and execute requests against the Salesforce org.

  • disableLogging(): void
  • Disables module logging if it has been enabled by a call to enableLogging.

    This function is registered globally so you can disable logging at any time by calling:

    window.fin.Integrations.Salesforce.disableLogging();
    

    Returns void

  • enableLogging(): void
  • Enables module logging to the console for debugging/troubleshooting purposes. This is off by default.

    This function is registered globally so you can enable logging at any time by calling:

    window.fin.Integrations.Salesforce.enableLogging();
    

    Returns void

  • getConnection(salesforceOrgBaseUri: string, consumerKey: string): Promise<null | SalesforceConnection>
  • Retrieves an existing connection with a Salesforce org, created using the connect function.

    The same org URL and consumer key values must be specified as was used when the connection was established, otherwise the connection will not be found.

    Parameters

    • salesforceOrgBaseUri: string

      The base URI of the connected Salesforce org, which should be in the form: https://MyDomainName.my.salesforce.com.

    • consumerKey: string

      The consumer key of the Connected App used to connect.

    Returns Promise<null | SalesforceConnection>

    The existing connection object, or null if no existing connection is found.

Generated using TypeDoc