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
booleanSmart Flows module initialization flag
SmartFlows.session : SmartFlowSession
SmartFlowSessionSmart Flow Session module for session persistence and state management
SmartFlows.status : SmartFlowsStatus
SmartFlowsStatusSmart Flows module status. Helps determine when flows are ready to be processed.
'initializing' | 'redirecting' | 'ready'
SmartFlows.addFlow(flow) ⇒ void
voidAdd 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 | undefinedGet the currently active global flow
SmartFlows.getFlowById(flowId) ⇒ SmartFlow | undefined
SmartFlow | undefinedFind a Smart Flow by ID
| Param | Type | Description |
|---|---|---|
| flowId | number | Smart Flow ID |
SmartFlows.getFlowByShortCode(shortCode) ⇒ SmartFlow | undefined
SmartFlow | undefinedFind 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 | undefinedGet the flow currently being previewed
SmartFlows.goToModalPage(componentId, pageNumber) ⇒ boolean
booleanNavigate 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
booleanNavigate 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
SmartFlowsModuleSmart Flow module initialization
| Param | Type | Description |
|---|---|---|
| flows | Array<SmartFlow> | Array of Smart Flows to initialize |
SmartFlows.processFlows() ⇒ void
voidProcess all available Smart Flows
SmartFlows.removeFlow(flowId) ⇒ void
voidRemoves a flow + cleans up associated component observers
| Param | Type | Description |
|---|---|---|
| flowId | number | The ID of the flow to remove |
SmartFlows.runComponent(component, flow) ⇒ void
voidExecutes 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
voidRun 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
voidApply the Smart Flows to make available
| Param | Type | Description |
|---|---|---|
| flows | Array<SmartFlow> | Array of Smart Flows |
SmartFlows.sync() ⇒ void
voidSync the active UI component state
