-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: shared types (VF-000) wip: wip wip: wip wip: wip feat: finish fix: nlp * fix: some improvements * fix: publishing * fix: defaults * fix: publishing * chore: prompt typeguard * feat: add type-guards * fix: packages * chore: rebuild lock file * chore: typescript version * chore: fix depcheck Co-authored-by: Tyler Han <tylerhan97@gmail.com>
- Loading branch information
1 parent
136daa2
commit 3e1a206
Showing
290 changed files
with
4,382 additions
and
3,413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,5 +30,6 @@ | |
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
} | ||
}, | ||
"cSpell.words": ["typeguard"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,97 @@ | ||
import { Constants as General } from '@voiceflow/general-types'; | ||
import { VoiceflowConstants } from '@voiceflow/voiceflow-types'; | ||
|
||
import { Locale } from './base'; | ||
import { AmazonIntent } from './intents'; | ||
import { SlotType } from './slots'; | ||
|
||
export const AmazonToGeneralIntentMap: Partial<Record<AmazonIntent, General.IntentName>> = { | ||
[AmazonIntent.NO]: General.IntentName.NO, | ||
[AmazonIntent.YES]: General.IntentName.YES, | ||
[AmazonIntent.STOP]: General.IntentName.STOP, | ||
[AmazonIntent.NEXT]: General.IntentName.NEXT, | ||
[AmazonIntent.HELP]: General.IntentName.HELP, | ||
[AmazonIntent.PAUSE]: General.IntentName.PAUSE, | ||
[AmazonIntent.CANCEL]: General.IntentName.CANCEL, | ||
[AmazonIntent.RESUME]: General.IntentName.RESUME, | ||
[AmazonIntent.REPEAT]: General.IntentName.REPEAT, | ||
[AmazonIntent.FALLBACK]: General.IntentName.NONE, | ||
[AmazonIntent.PREVIOUS]: General.IntentName.PREVIOUS, | ||
[AmazonIntent.START_OVER]: General.IntentName.START_OVER, | ||
export const AmazonToVoiceflowIntentMap: Partial<Record<AmazonIntent, VoiceflowConstants.IntentName>> = { | ||
[AmazonIntent.NO]: VoiceflowConstants.IntentName.NO, | ||
[AmazonIntent.YES]: VoiceflowConstants.IntentName.YES, | ||
[AmazonIntent.STOP]: VoiceflowConstants.IntentName.STOP, | ||
[AmazonIntent.NEXT]: VoiceflowConstants.IntentName.NEXT, | ||
[AmazonIntent.HELP]: VoiceflowConstants.IntentName.HELP, | ||
[AmazonIntent.PAUSE]: VoiceflowConstants.IntentName.PAUSE, | ||
[AmazonIntent.CANCEL]: VoiceflowConstants.IntentName.CANCEL, | ||
[AmazonIntent.RESUME]: VoiceflowConstants.IntentName.RESUME, | ||
[AmazonIntent.REPEAT]: VoiceflowConstants.IntentName.REPEAT, | ||
[AmazonIntent.FALLBACK]: VoiceflowConstants.IntentName.NONE, | ||
[AmazonIntent.PREVIOUS]: VoiceflowConstants.IntentName.PREVIOUS, | ||
[AmazonIntent.START_OVER]: VoiceflowConstants.IntentName.START_OVER, | ||
}; | ||
|
||
export const GeneralToAmazonIntentMap: Partial<Record<General.IntentName, AmazonIntent>> = { | ||
[General.IntentName.NO]: AmazonIntent.NO, | ||
[General.IntentName.YES]: AmazonIntent.YES, | ||
[General.IntentName.STOP]: AmazonIntent.STOP, | ||
[General.IntentName.NEXT]: AmazonIntent.NEXT, | ||
[General.IntentName.HELP]: AmazonIntent.HELP, | ||
[General.IntentName.PAUSE]: AmazonIntent.PAUSE, | ||
[General.IntentName.CANCEL]: AmazonIntent.CANCEL, | ||
[General.IntentName.RESUME]: AmazonIntent.RESUME, | ||
[General.IntentName.REPEAT]: AmazonIntent.REPEAT, | ||
[General.IntentName.NONE]: AmazonIntent.FALLBACK, | ||
[General.IntentName.PREVIOUS]: AmazonIntent.PREVIOUS, | ||
[General.IntentName.START_OVER]: AmazonIntent.START_OVER, | ||
export const VoiceflowToAmazonIntentMap: Partial<Record<VoiceflowConstants.IntentName, AmazonIntent>> = { | ||
[VoiceflowConstants.IntentName.NO]: AmazonIntent.NO, | ||
[VoiceflowConstants.IntentName.YES]: AmazonIntent.YES, | ||
[VoiceflowConstants.IntentName.STOP]: AmazonIntent.STOP, | ||
[VoiceflowConstants.IntentName.NEXT]: AmazonIntent.NEXT, | ||
[VoiceflowConstants.IntentName.HELP]: AmazonIntent.HELP, | ||
[VoiceflowConstants.IntentName.PAUSE]: AmazonIntent.PAUSE, | ||
[VoiceflowConstants.IntentName.CANCEL]: AmazonIntent.CANCEL, | ||
[VoiceflowConstants.IntentName.RESUME]: AmazonIntent.RESUME, | ||
[VoiceflowConstants.IntentName.REPEAT]: AmazonIntent.REPEAT, | ||
[VoiceflowConstants.IntentName.NONE]: AmazonIntent.FALLBACK, | ||
[VoiceflowConstants.IntentName.PREVIOUS]: AmazonIntent.PREVIOUS, | ||
[VoiceflowConstants.IntentName.START_OVER]: AmazonIntent.START_OVER, | ||
}; | ||
|
||
export const AmazonToGeneralSlotMap: Partial<Record<SlotType, General.SlotType>> = { | ||
[SlotType.TIME]: General.SlotType.DATETIME, | ||
[SlotType.DATE]: General.SlotType.DATETIME, | ||
[SlotType.FOUR_DIGIT_NUMBER]: General.SlotType.NUMBER, | ||
[SlotType.NUMBER]: General.SlotType.NUMBER, | ||
[SlotType.PHONENUMBER]: General.SlotType.PHONENUMBER, | ||
[SlotType.PERSON]: General.SlotType.NAME, | ||
[SlotType.DE_FIRST_NAME]: General.SlotType.NAME, | ||
[SlotType.GB_FIRST_NAME]: General.SlotType.NAME, | ||
[SlotType.US_FIRST_NAME]: General.SlotType.NAME, | ||
[SlotType.FIRSTNAME]: General.SlotType.NAME, | ||
[SlotType.ORDINAL]: General.SlotType.ORDINAL, | ||
export const AmazonToVoiceflowSlotMap: Partial<Record<SlotType, VoiceflowConstants.SlotType>> = { | ||
[SlotType.TIME]: VoiceflowConstants.SlotType.DATETIME, | ||
[SlotType.DATE]: VoiceflowConstants.SlotType.DATETIME, | ||
[SlotType.FOUR_DIGIT_NUMBER]: VoiceflowConstants.SlotType.NUMBER, | ||
[SlotType.NUMBER]: VoiceflowConstants.SlotType.NUMBER, | ||
[SlotType.PHONENUMBER]: VoiceflowConstants.SlotType.PHONENUMBER, | ||
[SlotType.PERSON]: VoiceflowConstants.SlotType.NAME, | ||
[SlotType.DE_FIRST_NAME]: VoiceflowConstants.SlotType.NAME, | ||
[SlotType.GB_FIRST_NAME]: VoiceflowConstants.SlotType.NAME, | ||
[SlotType.US_FIRST_NAME]: VoiceflowConstants.SlotType.NAME, | ||
[SlotType.FIRSTNAME]: VoiceflowConstants.SlotType.NAME, | ||
[SlotType.ORDINAL]: VoiceflowConstants.SlotType.ORDINAL, | ||
}; | ||
|
||
export const GeneralToAmazonSlotMap: Partial<Record<General.SlotType, SlotType>> = { | ||
[General.SlotType.DATETIME]: SlotType.DATE, | ||
[General.SlotType.NUMBER]: SlotType.NUMBER, | ||
[General.SlotType.PHONENUMBER]: SlotType.PHONENUMBER, | ||
[General.SlotType.NAME]: SlotType.FIRSTNAME, | ||
[General.SlotType.ORDINAL]: SlotType.ORDINAL, | ||
export const VoiceflowToAmazonSlotMap: Partial<Record<VoiceflowConstants.SlotType, SlotType>> = { | ||
[VoiceflowConstants.SlotType.DATETIME]: SlotType.DATE, | ||
[VoiceflowConstants.SlotType.NUMBER]: SlotType.NUMBER, | ||
[VoiceflowConstants.SlotType.PHONENUMBER]: SlotType.PHONENUMBER, | ||
[VoiceflowConstants.SlotType.NAME]: SlotType.FIRSTNAME, | ||
[VoiceflowConstants.SlotType.ORDINAL]: SlotType.ORDINAL, | ||
}; | ||
|
||
export const AmazonToGeneralLocaleMap: Record<Locale, General.Locale> = { | ||
[Locale.EN_US]: General.Locale.EN_US, | ||
[Locale.EN_AU]: General.Locale.EN_US, | ||
[Locale.EN_CA]: General.Locale.EN_US, | ||
[Locale.EN_IN]: General.Locale.EN_US, | ||
[Locale.EN_GB]: General.Locale.EN_US, | ||
[Locale.FR_CA]: General.Locale.FR_CA, | ||
[Locale.ES_US]: General.Locale.ES_ES, | ||
[Locale.FR_FR]: General.Locale.FR_FR, | ||
[Locale.DE_DE]: General.Locale.DE_DE, | ||
[Locale.IT_IT]: General.Locale.IT_IT, | ||
[Locale.JA_JP]: General.Locale.JA_JP, | ||
[Locale.ES_ES]: General.Locale.ES_ES, | ||
[Locale.ES_MX]: General.Locale.ES_MX, | ||
[Locale.PT_BR]: General.Locale.PT_BR, | ||
[Locale.HI_IN]: General.Locale.HI_IN, | ||
export const AmazonToVoiceflowLocaleMap: Record<Locale, VoiceflowConstants.Locale> = { | ||
[Locale.EN_US]: VoiceflowConstants.Locale.EN_US, | ||
[Locale.EN_AU]: VoiceflowConstants.Locale.EN_US, | ||
[Locale.EN_CA]: VoiceflowConstants.Locale.EN_US, | ||
[Locale.EN_IN]: VoiceflowConstants.Locale.EN_US, | ||
[Locale.EN_GB]: VoiceflowConstants.Locale.EN_US, | ||
[Locale.FR_CA]: VoiceflowConstants.Locale.FR_CA, | ||
[Locale.ES_US]: VoiceflowConstants.Locale.ES_ES, | ||
[Locale.FR_FR]: VoiceflowConstants.Locale.FR_FR, | ||
[Locale.DE_DE]: VoiceflowConstants.Locale.DE_DE, | ||
[Locale.IT_IT]: VoiceflowConstants.Locale.IT_IT, | ||
[Locale.JA_JP]: VoiceflowConstants.Locale.JA_JP, | ||
[Locale.ES_ES]: VoiceflowConstants.Locale.ES_ES, | ||
[Locale.ES_MX]: VoiceflowConstants.Locale.ES_MX, | ||
[Locale.PT_BR]: VoiceflowConstants.Locale.PT_BR, | ||
[Locale.HI_IN]: VoiceflowConstants.Locale.HI_IN, | ||
}; | ||
|
||
export const GeneralToAmazonLocaleMap: Record<General.Locale, Locale> = { | ||
[General.Locale.EN_US]: Locale.EN_US, | ||
[General.Locale.AR_AR]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[General.Locale.ZH_CN]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[General.Locale.NL_NL]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[General.Locale.FR_FR]: Locale.FR_FR, | ||
[General.Locale.FR_CA]: Locale.FR_CA, | ||
[General.Locale.DE_DE]: Locale.DE_DE, | ||
[General.Locale.GU_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[General.Locale.HI_IN]: Locale.HI_IN, | ||
[General.Locale.IT_IT]: Locale.IT_IT, | ||
[General.Locale.JA_JP]: Locale.JA_JP, | ||
[General.Locale.KO_KR]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[General.Locale.MR_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[General.Locale.PT_BR]: Locale.PT_BR, | ||
[General.Locale.ES_ES]: Locale.ES_ES, | ||
[General.Locale.ES_MX]: Locale.ES_MX, | ||
[General.Locale.TA_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[General.Locale.TE_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[General.Locale.TR_TR]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
export const VoiceflowToAmazonLocaleMap: Record<VoiceflowConstants.Locale, Locale> = { | ||
[VoiceflowConstants.Locale.EN_US]: Locale.EN_US, | ||
[VoiceflowConstants.Locale.AR_AR]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[VoiceflowConstants.Locale.ZH_CN]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[VoiceflowConstants.Locale.NL_NL]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[VoiceflowConstants.Locale.FR_FR]: Locale.FR_FR, | ||
[VoiceflowConstants.Locale.FR_CA]: Locale.FR_CA, | ||
[VoiceflowConstants.Locale.DE_DE]: Locale.DE_DE, | ||
[VoiceflowConstants.Locale.GU_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[VoiceflowConstants.Locale.HI_IN]: Locale.HI_IN, | ||
[VoiceflowConstants.Locale.IT_IT]: Locale.IT_IT, | ||
[VoiceflowConstants.Locale.JA_JP]: Locale.JA_JP, | ||
[VoiceflowConstants.Locale.KO_KR]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[VoiceflowConstants.Locale.MR_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[VoiceflowConstants.Locale.PT_BR]: Locale.PT_BR, | ||
[VoiceflowConstants.Locale.ES_ES]: Locale.ES_ES, | ||
[VoiceflowConstants.Locale.ES_MX]: Locale.ES_MX, | ||
[VoiceflowConstants.Locale.TA_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[VoiceflowConstants.Locale.TE_IN]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
[VoiceflowConstants.Locale.TR_TR]: Locale.EN_US, // FIXME: Unsupported language by Alexa | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { Models } from '@voiceflow/base-types'; | ||
import { BaseModels } from '@voiceflow/base-types'; | ||
|
||
import { AnyAlexaStep } from './node'; | ||
import { AnyStep } from './node'; | ||
|
||
export interface AlexaDiagram extends Models.Diagram<AnyAlexaStep> {} | ||
export interface Diagram extends BaseModels.Diagram.Model<AnyStep> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
export * as Constants from './constants'; | ||
export * as Diagram from './diagram'; | ||
export * as Node from './node'; | ||
export * as Program from './program'; | ||
export * as Project from './project'; | ||
export * as Types from './types'; | ||
export * as Utils from './utils'; | ||
export * as Version from './version'; | ||
export * as AlexaConstants from './constants'; | ||
export * as AlexaDiagram from './diagram'; | ||
export * as AlexaModels from './models'; | ||
export * as AlexaNode from './node'; | ||
export * as AlexaProgram from './program'; | ||
export * as AlexaProject from './project'; | ||
export * as AlexaUtils from './utils'; | ||
export * as AlexaVersion from './version'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { Node, UnknownRecord } from '@voiceflow/base-types'; | ||
import { BaseNode, UnknownRecord } from '@voiceflow/base-types'; | ||
|
||
import { NodeType } from './constants'; | ||
|
||
export type StepData = UnknownRecord; | ||
|
||
export interface Step extends Node.Utils.BaseStep<StepData> { | ||
export interface Step extends BaseNode.Utils.BaseStep<StepData> { | ||
type: NodeType.ACCOUNT_LINKING; | ||
} | ||
|
||
export interface Node extends Node.Utils.BaseNode, Node.Utils.NodeNextID { | ||
export interface Node extends BaseNode.Utils.BaseNode, BaseNode.Utils.NodeNextID { | ||
type: NodeType.ACCOUNT_LINKING; | ||
link_account: true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { Node } from '@voiceflow/voice-types'; | ||
import { VoiceNode } from '@voiceflow/voice-types'; | ||
|
||
import { Voice } from '@/constants'; | ||
|
||
/** @deprecated */ | ||
export interface StepData extends Node.Capture.StepData<Voice> {} | ||
export interface StepData extends VoiceNode.Capture.StepData<Voice> {} | ||
|
||
/** @deprecated */ | ||
export interface Step extends Node.Capture.Step<StepData> {} | ||
export interface Step extends VoiceNode.Capture.Step<StepData> {} | ||
|
||
/** @deprecated */ | ||
export interface Node extends Node.Capture.Node {} | ||
export interface Node extends VoiceNode.Capture.Node {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { Node } from '@voiceflow/voice-types'; | ||
import { VoiceNode } from '@voiceflow/voice-types'; | ||
|
||
import { Voice } from '@/constants'; | ||
|
||
export interface StepData extends Node.CaptureV2.StepData<Voice> {} | ||
export interface StepData extends VoiceNode.CaptureV2.StepData<Voice> {} | ||
|
||
export interface Step extends Node.CaptureV2.Step<StepData> {} | ||
export interface Step extends VoiceNode.CaptureV2.Step<StepData> {} | ||
|
||
export interface Node extends Node.CaptureV2.Node {} | ||
export interface Node extends VoiceNode.CaptureV2.Node {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.