@botmock-api/flow
![Build Status](https://dev.azure.com/botmock/flow/_apis/build/status/Botmock.flow?branchName=master)
transform botmock api flow structure
Installation
npm i @botmock-api/flow
API
AbstractProject
Base class that provides abstractions of flow project structure through a variety of methods.
This class can be extended in the following way:
import { AbstractProject } from "@botmock-api/flow";
export default class FileWriter extends AbstractProject {
constructor(config) {
super({ projectData: config.projectData });
}
}
Methods
getMessage(messageId: string): flow.Message
Gets message from the board from messageId
getIntent(intentId: string): flow.Intent
Gets a full intent from intentId
gatherMessagesUpToNextIntent(message: flow.Message): flow.Message[]
Gathers all messages connected to message that are not separated by an intent in the flow
segmentizeBoardFromIntents(): Map<string, string[]>
Segmentizes board by relating intents to all messages they are connected to in the flow
segmentizeBoardFromMessages(): Map<string, string[]>
Segmentizes board by relating messages to the intents connected to them in the flow
representRequirementsForIntents(): Map<string, Slot>
Relates intent ids to the slots that are required on them
topoSort(): flow.Message[]
Topologically sorts messages on the board. If a message is connected to another message, it will appear before it in the sorted result.
representFlowAsAdjMatrix(): boolean[][]
Describes flow as an adjacency matrix. Each ij where there is a link between node i and node j in the original flow is truthy.