A set of Typescript utilities for working with Flow Spec packages, from the Flow Interoperability Project. For the Flow Interoperability standard, see:
This library provides:
- Typescript model objects for representing and converting from RapidPro flows to the Flow Interoperability standard. (This is a beta initiative under active development and is not guaranteed to work for all RapidPro action types)
- Additional utilities for working with Flow Spec packages and the Flow Spec API
To convert a RapidPro Flow to the Flow Interoperability standard
import { RapidProToFlowInteropConverter } from '@floip/flow-utils';
const rapidProJson = `{
"name": "Summary Case Report Test",
"uuid": "630aed00-f07a-4506-9196-8c77d892cfc9",
"spec_version": "13.1.0",
"language": "eng",
"type": "messaging",
"nodes": [
...
]
}`
const converter = new RapidProToFlowInteropConverter(rapidProJson)
const result = converter.convert()
if(result.isOk()) {
console.log(result.value)
}
else {
console.log("Error: " + result.error)
}