Skip to main content

Class: CloudRepository

Defined in: helpers/CloudRepository.ts:98

Constructors

new CloudRepository()

new CloudRepository(_baseUrl): CloudRepository

Defined in: helpers/CloudRepository.ts:128

Parameters

_baseUrl

string = 'https://cloud.myop.dev'

Returns

CloudRepository

Accessors

Main

Get Signature

get static Main(): CloudRepository

Defined in: helpers/CloudRepository.ts:101

Returns

CloudRepository

Methods

fetchAutoFlow()

fetchAutoFlow(componentId): Promise<IUserFlow>

Defined in: helpers/CloudRepository.ts:259

Parameters

componentId

string

Returns

Promise<IUserFlow>


fetchComponent()

fetchComponent(componentId, flowId?): Promise<undefined | IComponentConfig>

Defined in: helpers/CloudRepository.ts:307

Parameters

componentId

string

flowId?

string

Returns

Promise<undefined | IComponentConfig>

Deprecated

Use fetchComponentV2 or fetchComponentV1 explicitly Defaults to v1 behavior for backward compatibility with existing code


fetchComponentV1()

fetchComponentV1(componentId, flowId?): Promise<undefined | IComponentConfig>

Defined in: helpers/CloudRepository.ts:249

Fetch a v1 component from a flow

Parameters

componentId

string

flowId?

string

Returns

Promise<undefined | IComponentConfig>


fetchComponentV2()

fetchComponentV2(componentId, environmentIdentifier?, preview?): Promise<IComponentConfig>

Defined in: helpers/CloudRepository.ts:173

Fetch a v2 component config If env/preview not specified and component was preloaded, uses preloaded params

Parameters

componentId

string

environmentIdentifier?

string

preview?

boolean

Returns

Promise<IComponentConfig>


fetchFlow()

fetchFlow(flowId): Promise<IUserFlow>

Defined in: helpers/CloudRepository.ts:280

Parameters

flowId

string

Returns

Promise<IUserFlow>


getDefaultEnvironment()

getDefaultEnvironment(): string

Defined in: helpers/CloudRepository.ts:141

Get the current default environment

Returns

string


getPreloadedParams()

getPreloadedParams(componentId): undefined | { env: string; preview: boolean; }

Defined in: helpers/CloudRepository.ts:165

Get the preloaded params for a component (if preloaded) Returns undefined if not preloaded

Parameters

componentId

string

Returns

undefined | { env: string; preview: boolean; }


isPreloaded()

isPreloaded(componentId, env?, preview?): boolean

Defined in: helpers/CloudRepository.ts:151

Check if a component is already cached/preloaded (v2) If env and preview are not provided, checks if ANY version is preloaded

Parameters

componentId

string

env?

string

preview?

boolean

Returns

boolean


setEnvironment()

setEnvironment(env): void

Defined in: helpers/CloudRepository.ts:134

Set the default environment for this CloudRepository instance

Parameters

env

string

Returns

void