Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@botmock-api/flow

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@botmock-api/flow

transform botmock api flow structure

  • 0.8.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

@botmock-api/flow

Build Status

transform botmock api flow structure

Installation

npm i @botmock-api/flow

API

Simulator

Class that fosters flow generation. Exposes methods to ensure the generated flow has certain qualities.

import { Simulator } from "@botmock-api/flow";

let flow: any;
const generator = new Simulator().createConnectedFlowGenerator();
for (const [i] of new Array(100).entries()) {
  flow = generator.next();
}
Methods
createConnectedFlowGenerator

Creates generator that can only ever produce connected flows

createCompleteFlowGenerator

Creates generator that can only ever produce complete flows

createDisconnectedFlowGenerator

Creates generator that can only ever produce disconnected flows

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.

Keywords

FAQs

Package last updated on 25 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc