Smart Flows module
SmartFlows
Smart Flows module
- SmartFlows
- .initialized :
boolean
- .session :
SmartFlowSession
- .status :
SmartFlowsStatus
- .addFlow(flow) ⇒
void
- .addFlowByCode(shortCode) ⇒
Promise<(SmartFlow|void)>
- .getActiveGlobalFlow() ⇒
SmartFlow
|undefined
- .getFlowById(flowId) ⇒
SmartFlow
|undefined
- .getFlowByShortCode(shortCode) ⇒
SmartFlow
|undefined
- .getFlows() ⇒
Array<SmartFlow>
- .getPreviewFlow() ⇒
SmartFlow
|undefined
- .goToModalPage(componentId, pageNumber) ⇒
boolean
- .goToModalProduct(componentId, productId) ⇒
boolean
- .handleLinkBasedFlow() ⇒
Promise<void>
- .init(flows) ⇒
SmartFlowsModule
- .processFlows() ⇒
void
- .removeFlow(flowId) ⇒
void
- .runComponent(component, flow) ⇒
void
- .runFlow(flow) ⇒
void
- .setFlows(flows) ⇒
void
- .sync() ⇒
void
- .initialized :
SmartFlows.initialized : boolean
boolean
Smart Flows module initialization flag
SmartFlows.session : SmartFlowSession
SmartFlowSession
Smart Flow Session module for session persistence and state management
SmartFlows.status : SmartFlowsStatus
SmartFlowsStatus
Smart Flows module status. Helps determine when flows are ready to be processed.
'initializing' | 'redirecting' | 'ready'
SmartFlows.addFlow(flow) ⇒ void
void
Add a new Smart Flow
Param | Type | Description |
---|---|---|
flow | SmartFlow | Smart Flow to add |
SmartFlows.addFlowByCode(shortCode) ⇒ Promise<(SmartFlow|void)>
Promise<(SmartFlow|void)>
Add a new Smart Flow via shortCode
Param | Type | Description |
---|---|---|
shortCode | string | Smart Flow shortCode |
SmartFlows.getActiveGlobalFlow() ⇒ SmartFlow
| undefined
SmartFlow
| undefined
Get the currently active global flow
SmartFlows.getFlowById(flowId) ⇒ SmartFlow
| undefined
SmartFlow
| undefined
Find a Smart Flow by ID
Param | Type | Description |
---|---|---|
flowId | number | Smart Flow ID |
SmartFlows.getFlowByShortCode(shortCode) ⇒ SmartFlow
| undefined
SmartFlow
| undefined
Find a Smart Flow by short code
Param | Type | Description |
---|---|---|
shortCode | string | Smart Flow shortCode |
SmartFlows.getFlows() ⇒ Array<SmartFlow>
Array<SmartFlow>
Get a list of available flows
NOTE: Useful for filtering or lookups by ID / shortCode
SmartFlows.getPreviewFlow() ⇒ SmartFlow
| undefined
SmartFlow
| undefined
Get the flow currently being previewed
SmartFlows.goToModalPage(componentId, pageNumber) ⇒ boolean
boolean
Navigate to a specific page in a modal for a given component ID
Returns: boolean
- True if successful, false otherwise
Param | Type | Description |
---|---|---|
componentId | string | The ID of the component containing the modal |
pageNumber | number | The page number to navigate to (1-based) |
SmartFlows.goToModalProduct(componentId, productId) ⇒ boolean
boolean
Navigate to a specific product page in a modal for a given component ID
Returns: boolean
- True if successful, false otherwise
Param | Type | Description |
---|---|---|
componentId | string | The ID of the component containing the modal |
productId | string | The product ID to navigate to |
SmartFlows.handleLinkBasedFlow() ⇒ Promise<void>
Promise<void>
Handle link-based Smart Flow initialization
SmartFlows.init(flows) ⇒ SmartFlowsModule
SmartFlowsModule
Smart Flow module initialization
Param | Type | Description |
---|---|---|
flows | Array<SmartFlow> | Array of Smart Flows to initialize |
SmartFlows.processFlows() ⇒ void
void
Process all available Smart Flows
SmartFlows.removeFlow(flowId) ⇒ void
void
Removes a flow + cleans up associated component observers
Param | Type | Description |
---|---|---|
flowId | number | The ID of the flow to remove |
SmartFlows.runComponent(component, flow) ⇒ void
void
Executes a specific Smart Flow component
Param | Type | Description |
---|---|---|
component | SmartFlowComponent | Execute a component in the Smart Flow tree |
flow | SmartFlow | Smart Flow being ran |
SmartFlows.runFlow(flow) ⇒ void
void
Run a given Smart Flow, traversing its tree and rendering the first components
Param | Type | Description |
---|---|---|
flow | SmartFlow | Smart Flow to run |
SmartFlows.setFlows(flows) ⇒ void
void
Apply the Smart Flows to make available
Param | Type | Description |
---|---|---|
flows | Array<SmartFlow> | Array of Smart Flows |
SmartFlows.sync() ⇒ void
void
Sync the active UI component state