UNPKG

@voiceflow/voiceflow-types

Version:

Voiceflow 'voiceflow' project types

26 lines (25 loc) 1.02 kB
import { ProjectType } from '../constants/index.js'; import { defaultChatMemberPlatformData, defaultChatPlatformData } from './chat/index.js'; import { defaultVoiceMemberPlatformData, defaultVoicePlatformData } from './voice/index.js'; export * from './chat/index.js'; export * from './voice/index.js'; export const defaultPlatformData = (type, platformData) => { switch (type) { case ProjectType.CHAT: return defaultChatPlatformData(platformData); case ProjectType.VOICE: return defaultVoicePlatformData(platformData); default: throw new Error(`Unknown project type: ${type}`); } }; export const defaultMemberPlatformData = (type, platformData) => { switch (type) { case ProjectType.CHAT: return defaultChatMemberPlatformData(platformData); case ProjectType.VOICE: return defaultVoiceMemberPlatformData(platformData); default: throw new Error(`Unknown project type: ${type}`); } };