mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-05-13 01:46:08 +08:00
22 lines
512 B
TypeScript
22 lines
512 B
TypeScript
import { getFlowWithNodes } from './decisionFlowService'
|
|
|
|
export interface ImportDecisionTreeOptions {
|
|
slug?: string
|
|
name?: string
|
|
description?: string
|
|
}
|
|
|
|
export async function importATCDecisionTree(options: ImportDecisionTreeOptions = {}) {
|
|
const slug = typeof options.slug === 'string' && options.slug.trim().length
|
|
? options.slug.trim()
|
|
: 'icao_atc_decision_tree'
|
|
|
|
const { flow, nodes } = await getFlowWithNodes(slug)
|
|
|
|
return {
|
|
flow,
|
|
nodes,
|
|
importedStates: nodes.length,
|
|
}
|
|
}
|