Options
All
  • Public
  • Public/Protected
  • All
Menu

Account Proxy SDK is to interact with Vlocity Account SDK functionality hosted in node server.

The Account Proxy SDK is a JavaScript library that act as Proxy between UI and Account SDK hosted in server.

The Account Proxy SDK contains all Input instance creation methods & invoke API methods. It will validate input before sending to Secure DC SDK.

SDK can be shared by different applicationsuser interfaces. SDK, like any Vlocity SDK, can be extended and overrided to customized implementations.

Hierarchy

Index

Constructors

constructor

Properties

Private config

The config used to initialize this SDK.

Static Private instance

instance: AccountProxy

Accessors

namespace

  • get namespace(): string
  • set namespace(customNamespace: string): void
  • getter method for namespace. Provides the salesforce org namespace

    Returns string

  • setter method for namespace. Set custom namespace

    Parameters

    • customNamespace: string

    Returns void

Methods

createGetAssetsByAccountInput

  • Create a default GetAssetByAccountInput object.

    Returns GetAssetByAccountInput

createGetAssetsInput

  • Create a default GetAssetInput object.

    Returns GetAssetInput

createGetContractsInput

  • Create a default GetContractInput object.

    Returns GetContractInput

createGetOffersInput

  • Create a default GetOfferInput object.

    Returns GetOfferInput

getAssets

  • Proxy getAssets method calls Secure DC SDK getAssets method with given input

    Parameters

    Returns Promise<any>

getAssetsByAccount

  • Proxy getAssetsByAccount method calls Secure DC SDK getAssetsByAccount method with given input

    Parameters

    Returns Promise<any>

getContracts

  • Proxy getContracts method calls Secure DC SDK getContracts method with given input

    Parameters

    Returns Promise<any>

getOffers

  • Proxy getOffers method calls Secure DC SDK getOffers method with given input

    Parameters

    Returns Promise<any>

Private invokeAPI

  • Returns a API call response.

    Parameters

    Returns Promise<any>

version

  • version(): string
  • Returns the version number of SDK.

    Returns string

    Returns SDK version number as string

Static extend

  • extend(extendObj: object): void
  • Adds all the enumerable string keyed function properties of a source object to the sdk prototype. .extend should only be used to add new methods and it won't override the existing methods.

    Note: If the property already exists, it will be not be added.

    Custom functions which are being extended should have proper namespaces to avoid issues during upgrades. When Vlocity releases new changes it won't impact if unique namespaces are used.

    Example: myCompanyOrFeatureMethodName

    example

    How to extend an sdk?

    VlocitySDK.datasource.extend({ myCompanySayHello(){
         console.log("Hello World");
      }, sayTime() {
         console.log(new Date().myCompanyGetTime());
      }});
    
    const dataSource = VlocitySDK.datasource.getInstance({'create':true});
    console.log(daSource.myCompanySayHello())

    Parameters

    • extendObj: object

      The object of functions

    Returns void

Static getInstance

  • Get a singleton instance of this AccountProxy.

    Parameters

    Returns AccountProxy

    an instance of this SDK.

Static override

  • override(overrideObj: object): void
  • Adds all the enumerable string keyed function properties of a source object to the sdk prototype.

    .override method should only be used to override the existing methods and should only be used in rare cases. Overriding the existing or default methods may cause unintended consequences and may also impact during upgrades.

    Please be cautious while using this

    example

    How to override methods in an sdk?

    VlocitySDK.datasource.override({ soql(){
         console.log("This code overrides the default soql function");
         // code goes here...
      }, sosl() {
         console.log("This code overrides the default soql function");
         // code goes here...
      }});
    
    const dataSource = VlocitySDK.datasource.getInstance({'create':true});
    console.log(dataSource.soql()); // prints "This code overrides the default soql function"

    Parameters

    • overrideObj: object

      The object of functions

    Returns void

Generated using TypeDoc