@stacc/flow-ts-helpers v1.3.4
Flow Typescript Helpers
A collection of utility function that makes it easier to work in a typesafe way in Flow Process
Getting started
- First install the package in your flow process
npm install @stacc/flow-ts-helpers
- 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
- createAddOperation - Add mutation on Flow Process state with path- and patch validation.
- createRemoveOperation - Remove mutation on Flow Process state with path validation.
- createReplaceOperation - Remove mutation on Flow Process state with path- and patch validation.
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.
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
2 months ago
2 months ago
3 months ago
3 months ago
6 months ago
6 months ago
6 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago