1.3.4 • Published 2 months ago

@stacc/flow-ts-helpers v1.3.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

Flow Typescript Helpers

A collection of utility function that makes it easier to work in a typesafe way in Flow Process

Getting started

  1. First install the package in your flow process
  npm install @stacc/flow-ts-helpers
  1. Import into a handler and use one of the functions provided.
import { createAddOperation } from "@stacc/flow-ts-helpers";

const map: UserTaskMapFn<typeof execute, State, Variables> = ({
  data,
  state,
}) => {
  return {
    // createAddOperation will validate that the data you insert into the specified path, is of the correct type.
    patch: [createAddOperation<State>()("/foo", "bar")],
    variables: {},
    attachments: {},
  };
};

API

Utilities

Interfaces

  • AddPatch - Interface for the Add mutation on a Flow Process state.
  • RemovePatch - Interface for the Remove mutation on a Flow Process state.
  • ReplacePatch - Interface for the Replace mutation on a Flow Process state.
  • OpPatch - Interface that is a intersection of all allowed state mutations in Flow Process.

Flow Process SDK and Types

This library ships a Typescript SDK for interacting with the most common endpoints in Flow Process. The aim of this SDK is to make it easier and more typesafe to interact with the Flow Process API. The SDK uses generics to enable complete customizability on the data that the user (you) control, e.g the state of the flow. The SDK also ships with a set of types that are used in the SDK, and can be used in your own code, it is based on the OpenAPI specification of the Flow Process API.

See available functions here

How to contribute

This library is built using Bun as a package manager. Download it first before you begin working on your change!

Preferably open an issue describing which utility function you want added, if agreed it is something that fits this library, open a PR with your changes.

The PR should include:

  • A new file for your new change, placed in src
  • A new test file that sufficiently tests your function, placed in tests
  • A new export in index file.
  • An updated list where the change is placed in the correct list above, e.g
### new or existing category
- [myNewShinyFunction](relative path) - a cool description of what it does
1.4.0-alpha.4

2 months ago

1.4.0-alpha.3

2 months ago

1.4.0-alpha.2

3 months ago

1.4.0-alpha.1

3 months ago

1.3.4

6 months ago

1.3.3

6 months ago

1.3.2

6 months ago

1.3.1

9 months ago

1.3.0

9 months ago

1.2.1

9 months ago

1.2.0

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.1

9 months ago