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