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

@blendededge/doohickey-types

v0.3.0

Published

Doohickey Component Types are an NPM package that is available to help you build out your Doohickey integration templates. Using the Doohickey Types package, you get out-of-the-box autocomplete for component properties. No more looking up the documentati

Downloads

656

Readme

Doohickey Component Types

Doohickey Component Types are an NPM package that is available to help you build out your Doohickey integration templates. Using the Doohickey Types package, you get out-of-the-box autocomplete for component properties. No more looking up the documentation for each component and finding what options are available. You can just start typing and Intellisense will start making suggestions.

Getting Started

If you generated your integration project with doohickey init, Doohickey Types has already been installed and is ready for you to begin using it within your templates. Otherwise, follow these instructions to install it:

  1. If you haven't already, create a package.json by running the command npm init -y. This creates a package.json file with default values for all the fields.
  2. Once your package.json is created, install Doohickey Types as a dev dependency by running the command npm i -D @blendededge/doohickey-types.
  3. Require the doohickey-types package in your template file and it is ready to use.

OIH Flows

The OIHFlow object helps you scaffold out your flow and contains both the required and optional properties for generating the flow in OIH.

Here is an example of initializing a flow using the OIHFlow object within a Doohickey template.

  const { OIHFlow } = require('@blendededge/doohickey-types');

  module.exports = function ({ components, tenant }) {
      const myTestFlow = OIHFlow;
      myTestFlow.name = 'Sample Test Flow using Doohickey Types';
      myTestFlow.description = 'Just a sample test flow';
      myTestFlow.tenant = tenant.id;
  }

OIH Components

Doohickey Types comes preloaded with all of the Doohickey standard components. You can find a list of these components here.

Similar to the OIHFlow object, the individual component objects will contain all of the required and optional properites for that component, including any component-specific configuration fields.

Here is an example of initalizing a flow step using the JSONataComponent object, a Doohickey CLI aliased JSONata component named jsonata, and the DOOHICKEY.file.formatJSONata method to read the JSONata file rather than having to input it directly to the template.

  const { JSONataComponent } = require('@blendededge/doohickey-types');

  module.exports = function ({ components, tenant }) {
    const transformSalesOrder = JSONataComponent.transform({
        name: 'Transform SalesOrder',
        id: 'transform-sales-order',
        componentId: components.jsonata,
        description: 'Transforms a JSON object to Sales Order',
        fields: {
            expression: DOOHICKEY.file.formatJSONata('jsonata/transform-sales-order.jsonata')
        }
    });
  }

Adding a Component to a Flow Object

After you have a flow step created, you can add it to your OIHFlow object. Here is an example of adding the transformSalesOrder component we created previously to our myTestFlow graph.

  const { JSONataComponent, OIHFlow } = require('@blendededge/doohickey-types');

  module.exports = function ({ components, tenant }) {
    const myTestFlow = OIHFlow;
    myTestFlow.name = 'Sample Test Flow using Doohickey Types';
    myTestFlow.description = 'Just a sample test flow';
    myTestFlow.tenant = tenant.id;

    const transformSalesOrder = JSONataComponent.transform({
        name: 'Transform SalesOrder',
        id: 'transform-sales-order',
        componentId: components.jsonata,
        description: 'Transforms a JSON object to Sales Order',
        fields: {
            expression: DOOHICKEY.file.formatJSONata('jsonata/transform-sales-order.jsonata')
        }
    });

    myTestFlow.graph.nodes.push(transformSalesOrder)
  }

Adding Graph Edges to a Flow Object

Once a component has been added to the graph.nodes property, you can create an edge to link it to another component, connecting them in the data flow.

Here is an example of linking a JSONata component to a Webhook debug step.

  const { JSONataComponent, CodeComponent, OIHFlow } = require('@blendededge/doohickey-types');

  module.exports = function ({ components, tenant }) {
    const myTestFlow = OIHFlow;
    myTestFlow.name = 'Sample Test Flow using Doohickey Types';
    myTestFlow.description = 'Just a sample test flow';
    myTestFlow.tenant = tenant.id;

    const transformSalesOrder = JSONataComponent.transform({
        // removed for brevity
    });

    const sendDebugMessage = CodeComponent.execute({
        // removed for brevity
    })

    myTestFlow.graph.nodes.push(transformSalesOrder, sendDebugMessage);
    myTestFlow.graph.edges.push(
        transformSalesOrder.edge(sendDebugMessage)
    )
  }