{"size": 1194, "ext": "js", "max_stars_repo_path": "Testcase4-Application-breakdown/alexa/src/infra/SkillContext.js", "max_stars_repo_name": "Ddnirvana/serverlessbench", "max_stars_repo_stars_event_min_datetime": "2020-06-28T08:07:11.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-10T02:16:05.000Z", "max_issues_repo_path": "Testcase4-Application-breakdown/alexa/src/infra/SkillContext.js", "max_issues_repo_name": "Ddnirvana/serverlessbench", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Testcase4-Application-breakdown/alexa/src/infra/SkillContext.js", "max_forks_repo_name": "Ddnirvana/serverlessbench", "max_forks_repo_forks_event_min_datetime": "2020-07-08T17:44:25.000Z", "max_forks_repo_forks_event_max_datetime": "2020-07-08T17:44:25.000Z"}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 25.9565217391, "max_line_length": 96, "alphanum_fraction": 0.6373534338}
const uuid = require('uuid')
//const User = require('./User').User
const SkillSession = require('./SkillSession').SkillSession

/**
 * Manages state of the Alexa device interaction across sessions.
 *
 * Holds information about the user, the current session, as well as the AudioPlayer, if in use.
 *
 * To emulate a user with a linked account, set the access token property.
 */
class SkillContext {
    constructor(interactionModel) {
        this._apiAccessToken = "virtualAlexa.accessToken." + uuid.v4();
        this._apiEndpoint = "https://api.amazonalexa.com";
        this._interactionModel = interactionModel;
//        this._dialogManager = new DialogManager(this);
//        this._device = new Device();
//        this._user = new User();
        this._locale = "en-US"
    }

    interactionModel() {
        return this._interactionModel;
    }

    session() {
        return this._session;
    }

    newSession() {
        this._session = new SkillSession();
    }

    endSession() {
        //this.dialogManager().reset();
        this._session = undefined;
    }

    activeSession() {
        return this._session !== undefined;
    }
}

exports.SkillContext = SkillContext
