npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@botmock-api/flow

v0.8.0

Published

transform botmock api flow structure

Downloads

12

Readme

@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.