-
-
Notifications
You must be signed in to change notification settings - Fork 310
/
Alexa.ts
37 lines (35 loc) 路 1.13 KB
/
Alexa.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { App, EntityMap, HandleRequest, Jovo } from '@jovotech/framework';
import { AlexaDevice } from './AlexaDevice';
import { AlexaPlatform } from './AlexaPlatform';
import { AlexaRequest } from './AlexaRequest';
import { AlexaResponse } from './AlexaResponse';
import { AlexaUser } from './AlexaUser';
import { AlexaEntity } from './interfaces';
import { AlexaIsp } from './AlexaIsp';
import { AlexaAudioPlayer } from './AlexaAudioPlayer';
import { AlexaTask } from './AlexaTask';
export class Alexa extends Jovo<
AlexaRequest,
AlexaResponse,
Alexa,
AlexaUser,
AlexaDevice,
AlexaPlatform
> {
$entities!: EntityMap<AlexaEntity>;
isp: AlexaIsp;
audioPlayer: AlexaAudioPlayer;
task: AlexaTask;
constructor($app: App, $handleRequest: HandleRequest, $platform: AlexaPlatform) {
super($app, $handleRequest, $platform);
this.isp = new AlexaIsp(this);
this.audioPlayer = new AlexaAudioPlayer(this);
this.task = new AlexaTask(this);
}
getSkillId(): string | undefined {
return (
this.$request.session?.application?.applicationId ||
this.$request.context?.System?.application?.applicationId
);
}
}