Home Manual Reference Source
import AdapterRepository from '@pageproof/sdk/src/core/AdapterRepository.js'
public class | source

AdapterRepository

Constructor Summary

Public Constructor
public

constructor(adapters: *)

Member Summary

Public Members
public

A list of all the registered adapters.

Method Summary

Public Methods
public

Not implemented yet.

public

Provides the caller with an instance of the ICryptoAdapter.

public

Provides the caller with an instance of the IRequestAdapter.

Public Constructors

public constructor(adapters: *) source

Params:

NameTypeAttributeDescription
adapters *

Public Members

public adapters: Array<ICryptoAdapter|IRequestAdapter> source

A list of all the registered adapters.

Public Methods

public getCacheAdapter() source

Not implemented yet.

public getCryptoAdapter(): ICryptoAdapter source

Provides the caller with an instance of the ICryptoAdapter.

If the manager does not find an ICryptoAdapter it throws an error. In most cases you will not need to handle the error manually, because it makes sense in most cases for the error to bubble up the the top level. This is because the error is usually caused by a configuration error.

Other methods like AdapterRepository.getCacheAdapter do not work this way as the adapter is optional, however the crypto adapter is mandatory to do even the simplest of tasks (ie. sending a request requires an HMAC).

Return:

ICryptoAdapter

public getRequestAdapter(): IRequestAdapter source

Provides the caller with an instance of the IRequestAdapter.

Much like the AdapterRepository.getCryptoAdapter method, the IRequestAdapter is required for basic functionality, and throws when an adapter is not found in the set of adapters. The SDK cannot make requests to the server without a IRequestAdapter. This adapter also typically has a dependency on the ICryptoAdapter (for HMAC generation).

Return:

IRequestAdapter

See: