UNPKG

@voiceflow/alexa-types

Version:
44 lines (43 loc) 1.88 kB
import { Voice } from '../constants/index.js'; import { VoiceVersion } from '@voiceflow/voice-types'; export var AccountLinkingType; (function (AccountLinkingType) { AccountLinkingType["IMPLICIT"] = "IMPLICIT"; AccountLinkingType["AUTH_CODE"] = "AUTH_CODE"; })(AccountLinkingType || (AccountLinkingType = {})); export var ModelSensitivity; (function (ModelSensitivity) { ModelSensitivity["LOW"] = "LOW"; ModelSensitivity["HIGH"] = "HIGH"; ModelSensitivity["MEDIUM"] = "MEDIUM"; })(ModelSensitivity || (ModelSensitivity = {})); export var AccountLinkingAccessTokenScheme; (function (AccountLinkingAccessTokenScheme) { AccountLinkingAccessTokenScheme["HTTP_BASIC"] = "HTTP_BASIC"; AccountLinkingAccessTokenScheme["REQUEST_BODY_CREDENTIALS"] = "REQUEST_BODY_CREDENTIALS"; })(AccountLinkingAccessTokenScheme || (AccountLinkingAccessTokenScheme = {})); export const defaultAccountLinking = (accountLinking) => { if (!accountLinking) { return null; } const { type = AccountLinkingType.AUTH_CODE, scopes = [], domains = [], clientId = '', clientSecret = '', accessTokenUrl = '', authorizationUrl = '', accessTokenScheme = AccountLinkingAccessTokenScheme.HTTP_BASIC, defaultTokenExpirationInSeconds = 3600, } = accountLinking; return { type, scopes, domains, clientId, clientSecret, accessTokenUrl, authorizationUrl, accessTokenScheme, defaultTokenExpirationInSeconds, }; }; export const defaultSettings = ({ events = null, permissions = [], accountLinking, customInterface = false, modelSensitivity = null, ...voiceSettings } = {}) => ({ ...VoiceVersion.defaultSettings(voiceSettings, { defaultPromptVoice: Voice.ALEXA }), events, permissions, accountLinking: defaultAccountLinking(accountLinking), customInterface, modelSensitivity, });