Skip to main content

Class AgentManagerClient


Class AgentManagerClient

Declared in packages/sdk/client/src/services/agent-hosting-provider.ts:59open in new window

Constructors

constructor(_clientConfig, _halo)open in new window

Returns: AgentManagerClient

Arguments:

_clientConfig: Config

_halo: Halo

Properties

Methods

_agentManagerAuth(authDeviceCreds)open in new window

Returns: Promise<void>

Arguments:

authDeviceCreds: Credential

_checkAuthorization(authToken)open in new window

Check auth token from CF worker whether identity is allowed to create agent.

Note: This will prevent the client from making unnecessary requests to the AgentHostingProvider API. The AgentHostingProvider will also validate the auth token on its own.

Returns: boolean

Arguments:

authToken: any

_decodeComposerBetaJwt()open in new window

Returns: ComposerBetaJwt

Arguments: none

_ensureAuthenticated()open in new window

Returns: Promise<void>

Arguments: none

_getComposerBetaCookie()open in new window

Returns: any

Arguments: none

_openRpc()open in new window

Returns: Promise<void>

Arguments: none

_queryCredentials([type], [predicate])open in new window

Returns: Promise<Credential[]>

Arguments:

type: string

predicate: function

_validAuthToken()open in new window

Returns: "null" | JwtPayload

Arguments: none

checkEligibility(authToken)open in new window

Returns: Promise<boolean>

Arguments:

authToken: any

createAgent(invitationCode, identityKey)open in new window

Returns: Promise<any>

Arguments:

invitationCode: string

identityKey: string

destroyAgent(agentID)open in new window

Returns: Promise<boolean>

Arguments:

agentID: string

getAgent(agentID)open in new window

Returns: Promise<any>

Arguments:

agentID: string

init([authToken])open in new window

Initialize the client, potentially using the authToken to check authorization.

Returns: boolean

Arguments:

authToken: any

requestInitWithAuthToken(req)open in new window

Returns: RequestInit

Arguments:

req: RequestInit

requestInitWithCredentials(req)open in new window

Returns: RequestInit

Arguments:

req: RequestInit