Skip to main content

Class: CloudRepository

Defined in: helpers/CloudRepository.ts:10

CloudRepository - Unified cloud data access layer for Myop components

Supports both v2 (default) and v1 modes:

  • v2: Uses /consume endpoint for fetching variants
  • v1: Uses /flow endpoint for fetching user flows

Constructors

new CloudRepository()

new CloudRepository(_baseUrl): CloudRepository

Defined in: helpers/CloudRepository.ts:19

Parameters

_baseUrl

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

Returns

CloudRepository

Properties

Main

static Main: CloudRepository

Defined in: helpers/CloudRepository.ts:11

Methods

fetchAutoFlow()

fetchAutoFlow(componentId): Promise<IUserFlow>

Defined in: helpers/CloudRepository.ts:70

Parameters

componentId

string

Returns

Promise<IUserFlow>


fetchComponent()

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

Defined in: helpers/CloudRepository.ts:118

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:60

Fetch a v1 component from a flow

Parameters

componentId

string

flowId?

string

Returns

Promise<undefined | IComponentConfig>


fetchComponentV2()

fetchComponentV2(componentId, environmentIdentifier?): Promise<v2_IVariantConfig>

Defined in: helpers/CloudRepository.ts:34

Fetch a v2 component variant

Parameters

componentId

string

environmentIdentifier?

string

Returns

Promise<v2_IVariantConfig>


fetchFlow()

fetchFlow(flowId): Promise<IUserFlow>

Defined in: helpers/CloudRepository.ts:91

Parameters

flowId

string

Returns

Promise<IUserFlow>


isPreloaded()

isPreloaded(componentId): boolean

Defined in: helpers/CloudRepository.ts:27

Check if a component is already cached/preloaded (v2)

Parameters

componentId

string

Returns

boolean