Teleforge API Reference - v0.1.0
Preparing search index...
core/src
UserFlowStateManager
Class UserFlowStateManager
Manages the lifecycle of coordinated user flow state on top of a storage adapter.
Index
Constructors
constructor
Methods
advance
Step
complete
Flow
create
State
Key
fail
Flow
get
State
resume
Flow
start
Flow
Constructors
constructor
new
UserFlowStateManager
(
storage
:
StorageAdapter
)
:
UserFlowStateManager
Parameters
storage
:
StorageAdapter
Returns
UserFlowStateManager
Methods
advance
Step
advanceStep
(
key
:
string
,
newStep
:
string
,
payloadUpdate
?:
Record
<
string
,
unknown
>
,
)
:
Promise
<
UserFlowState
>
Parameters
key
:
string
newStep
:
string
payloadUpdate
:
Record
<
string
,
unknown
>
= {}
Returns
Promise
<
UserFlowState
>
complete
Flow
completeFlow
(
key
:
string
)
:
Promise
<
void
>
Parameters
key
:
string
Returns
Promise
<
void
>
create
State
Key
createStateKey
(
userId
:
string
,
flowId
:
string
)
:
string
Parameters
userId
:
string
flowId
:
string
Returns
string
fail
Flow
failFlow
(
key
:
string
,
error
:
Error
)
:
Promise
<
void
>
Parameters
key
:
string
error
:
Error
Returns
Promise
<
void
>
get
State
getState
(
key
:
string
)
:
Promise
<
UserFlowState
|
null
>
Parameters
key
:
string
Returns
Promise
<
UserFlowState
|
null
>
resume
Flow
resumeFlow
(
userId
:
string
,
flowId
:
string
)
:
Promise
<
UserFlowState
|
null
>
Parameters
userId
:
string
flowId
:
string
Returns
Promise
<
UserFlowState
|
null
>
start
Flow
startFlow
(
userId
:
string
,
flowId
:
string
,
initialStep
:
string
,
payload
?:
Record
<
string
,
unknown
>
,
chatId
?:
string
,
)
:
Promise
<
string
>
Parameters
userId
:
string
flowId
:
string
initialStep
:
string
payload
:
Record
<
string
,
unknown
>
= {}
Optional
chatId
:
string
Returns
Promise
<
string
>
Settings
Member Visibility
Inherited
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
advance
Step
complete
Flow
create
State
Key
fail
Flow
get
State
resume
Flow
start
Flow
Teleforge API Reference - v0.1.0
Loading...
Manages the lifecycle of coordinated user flow state on top of a storage adapter.