tock / ai.tock.bot.engine.user / UserTimelineDAO

UserTimelineDAO

interface UserTimelineDAO (source)

To access UserTimelines.

Functions

getArchivedEntityValues

Returns the archived values for the state id.

abstract fun getArchivedEntityValues(stateValueId: Id<EntityStateValue>, oldActionsMap: Map<Id<Action>, Action> = emptyMap()): List<ArchivedEntityValue>

getClientDialogs

Returns the dialogs of specified client id.

abstract fun getClientDialogs(namespace: String, clientId: String, storyDefinitionProvider: (String) -> StoryDefinition): List<Dialog>

getDialogsUpdatedFrom

Returns all dialogs updated after the specified Instant.

abstract fun getDialogsUpdatedFrom(namespace: String, from: Instant, storyDefinitionProvider: (String) -> StoryDefinition): List<Dialog>

getLastStoryId

Returns the last story id of the specified user, if any.

abstract fun getLastStoryId(namespace: String, playerId: PlayerId): String?

getSnapshots

Gets the snapshots of a dialog.

abstract fun getSnapshots(dialogId: Id<Dialog>): List<Snapshot>

loadByTemporaryIdsWithoutDialogs

Loads without the dialogs.

abstract fun loadByTemporaryIdsWithoutDialogs(namespace: String, temporaryIds: List<String>): List<UserTimeline>

loadWithLastValidDialog

Loads with last dialog. If no timeline exists, creates a new one.

abstract fun loadWithLastValidDialog(namespace: String, userId: PlayerId, priorUserId: PlayerId? = null, groupId: String? = null, storyDefinitionProvider: (String) -> StoryDefinition): UserTimeline

loadWithoutDialogs

Loads without the dialogs. If no timeline, create a new one.

abstract fun loadWithoutDialogs(namespace: String, userId: PlayerId): UserTimeline

remove

Remove the timeline and the associated dialogs.

abstract fun remove(namespace: String, playerId: PlayerId): Unit

removeClient

Remove all timelines and associated dialogs of a client.

abstract fun removeClient(namespace: String, clientId: String): Unit

save

Saves the timeline.

abstract fun save(userTimeline: UserTimeline, botDefinition: BotDefinition): Unit
abstract fun save(userTimeline: UserTimeline, namespace: String): Unit

updatePlayerId

Update playerId for dialog and user timelines.

abstract fun updatePlayerId(namespace: String, oldPlayerId: PlayerId, newPlayerId: PlayerId): Unit