Skip to content

Latest commit

 

History

History
145 lines (79 loc) · 2.69 KB

File metadata and controls

145 lines (79 loc) · 2.69 KB

iexec


iexec / IExecStorageModule

Class: IExecStorageModule

module exposing storage methods

Extends

Constructors

Constructor

new IExecStorageModule(configOrArgs, options?): IExecStorageModule

Create an IExecModule instance

Parameters

configOrArgs

IExecConfigArgs | IExecConfig

options?

IExecConfigOptions

Returns

IExecStorageModule

Inherited from

IExecModule.constructor

Properties

config

config: IExecConfig

current IExecConfig

Inherited from

IExecModule.config

Methods

checkStorageTokenExists()

checkStorageTokenExists(beneficiaryAddress, storageProvider): Promise<boolean>

check if a storage access token exists for the beneficiary in the Secret Management Service

NB: currently only 'dropbox' storage provider authentication is supported.

example:

const isStorageInitialized = await checkStorageTokenExists(userAddress, 'dropbox');
console.log('Dropbox storage initialized:', isStorageInitialized);

Parameters

beneficiaryAddress

string

storageProvider

string

Returns

Promise<boolean>


pushStorageToken()

pushStorageToken(token, storageProvider, options?): Promise<{ isPushed: boolean; isUpdated: boolean; }>

SIGNER REQUIRED, ONLY BENEFICIARY

push a storage access token to the Secret Management Service to allow result archive upload supported storage provider 'dropbox'.

NB:

  • currently only 'dropbox' storage provider authentication is supported.
  • this method will throw an error if a token already exists for the target storage provider in the Secret Management Service unless the option forceUpdate: true is used.

example:

  • init Dropbox storage
const { isPushed } = await pushStorageToken(dropboxApiToken, 'dropbox');
console.log('Dropbox storage initialized:', isPushed);

Parameters

token

string

storageProvider

string

options?
forceUpdate?

boolean

Returns

Promise<{ isPushed: boolean; isUpdated: boolean; }>


fromConfig()

static fromConfig(config): IExecStorageModule

Create an IExecStorageModule instance using an IExecConfig instance

Parameters

config

IExecConfig

Returns

IExecStorageModule

Overrides

IExecModule.fromConfig