refactor(alexa-sdk): moved Request types together

made their properties optional so each of them can be used
This commit is contained in:
Pascal Brokmeier
2017-06-29 15:11:27 +02:00
parent 8672af4c42
commit c8cce22c80
+19 -17
View File
@@ -81,33 +81,34 @@ export interface SessionUser {
export interface LaunchRequest extends Request { }
export interface IntentRequest extends Request {
dialogState: DialogStates;
intent: Intent;
}
export interface SlotValue {
confirmationStatus: ConfirmationStatuses;
name: string;
value?: any;
}
export interface Intent {
confirmationStatus: ConfirmationStatuses;
name: string;
slots: Record<string, SlotValue>;
dialogState?: DialogStates;
intent?: Intent;
}
export interface SessionEndedRequest extends Request {
reason: string;
reason?: string;
}
export interface Request {
type: "LaunchRequest" | "IntentRequest" | "SessionEndedRequest";
requestId: string;
timeStamp: string;
locale?: string;
timestamp: string;
locale?: string
}
export interface SlotValue {
confirmationStatus?: ConfirmationStatuses;
name: string;
value?: any;
}
export interface Intent {
confirmationStatus?: ConfirmationStatuses;
name: string;
slots: Record<string, SlotValue>;
}
export interface ResponseBody {
version: string;
sessionAttributes?: any;
@@ -143,3 +144,4 @@ export interface Image {
export interface Reprompt {
outputSpeech: OutputSpeech;
}