8000 alexa-app/index.js at master · hidesuke/alexa-app · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":"example","path":"example","contentType":"directory"},{"name":"lib","path":"lib","contentType":"directory"},{"name":"test","path":"test","contentType":"directory"},{"name":"types","path":"types","contentType":"directory"},{"name":".babelrc","path":".babelrc","contentType":"file"},{"name":".eslintignore","path":".eslintignore","contentType":"file"},{"name":".eslintrc.yaml","path":".eslintrc.yaml","contentType":"file"},{"name":".gitattributes","path":".gitattributes","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".travis.yml","path":".travis.yml","contentType":"file"},{"name":"CHANGELOG.md","path":"CHANGELOG.md","contentType":"file"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","contentType":"file"},{"name":"LICENSE.md","path":"LICENSE.md","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"RELEASING.md","path":"RELEASING.md","contentType":"file"},{"name":"UPGRADING.md","path":"UPGRADING.md","contentType":"file"},{"name":"dangerfile.js","path":"dangerfile.js","contentType":"file"},{"name":"index.js","path":"index.js","contentType":"file"},{"name":"package-lock.json","path":"package-lock.json","contentType":"file"},{"name":"package.json","path":"package.json","contentType":"file"}],"totalCount":20}},"fileTreeProcessingTime":8.155279,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":124511267,"defaultBranch":"master","name":"alexa-app","ownerLogin":"hidesuke","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2018-03-09T08:28:01.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/702995?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1615285237.5160792","canEdit":false,"refType":"branch","currentOid":"4c901336da4373b6dbe4d83dd5c8205816950f62"},"path":"index.js","currentUser":null,"blob":{"rawLines":["\"use strict\";","","var Promise = require(\"bluebird\");","var AlexaUtterances = require(\"alexa-utterances\");","var SSML = require(\"./lib/to-ssml\");","var alexa = {};","var defaults = require(\"lodash.defaults\");","var verifier = require(\"alexa-verifier-middleware\");","var bodyParser = require('body-parser');","var normalizeApiPath = require('./lib/normalize-api-path');","","alexa.response = function(session) {"," var self = this;"," this.resolved = false;"," this.response = {"," \"version\": \"1.0\","," \"response\": {"," \"directives\": [],"," \"shouldEndSession\": true"," }"," };"," this.say = function(str) {"," if (typeof this.response.response.outputSpeech == \"undefined\") {"," this.response.response.outputSpeech = {"," \"type\": \"SSML\","," \"ssml\": SSML.fromStr(str)"," };"," } else {"," // append str to the current outputSpeech, stripping the out speak tag"," this.response.response.outputSpeech.ssml = SSML.fromStr(str, this.response.response.outputSpeech.ssml);"," }"," return this;"," };"," this.clear = function( /*str*/ ) {"," this.response.response.outputSpeech = {"," \"type\": \"SSML\","," \"ssml\": SSML.fromStr(\"\")"," };"," return this;"," };"," this.reprompt = function(str) {"," if (typeof this.response.response.reprompt == \"undefined\") {"," this.response.response.reprompt = {"," \"outputSpeech\": {"," \"type\": \"SSML\","," \"ssml\": SSML.fromStr(str)"," }"," };"," } else {"," // append str to the current outputSpeech, stripping the out speak tag"," this.response.response.reprompt.outputSpeech.ssml = SSML.fromStr(str, this.response.response.reprompt.outputSpeech.text);"," }"," return this;"," };"," this.card = function(oCard) {"," if (2 == arguments.length) { // backwards compat"," oCard = {"," type: \"Simple\","," title: arguments[0],"," content: arguments[1]"," };"," }",""," var requiredAttrs = ['type'],"," clenseAttrs = [];",""," switch (oCard.type) {"," case 'Simple':"," requiredAttrs.push('content');"," clenseAttrs.push('content');"," break;"," case 'Standard':"," requiredAttrs.push('text');"," clenseAttrs.push('text');"," if (('image' in oCard) \u0026\u0026 (!('smallImageUrl' in oCard['image']) \u0026\u0026 !('largeImageUrl' in oCard['image']))) {"," console.error('If card.image is defined, must specify at least smallImageUrl or largeImageUrl');"," return this;"," }"," break;"," case 'AskForPermissionsConsent':"," requiredAttrs.push('permissions');"," break;"," default:"," break;"," }",""," var hasAllReq = requiredAttrs.every(function(idx) {"," if (!(idx in oCard) || typeof oCard[idx] === 'undefined') {"," console.error('Card object is missing required attr \"' + idx + '\"');"," return false;"," }"," return true;"," });",""," if (!hasAllReq) {"," return this;"," }",""," // remove all SSML to keep the card clean"," clenseAttrs.forEach(function(idx) {"," oCard[idx] = SSML.cleanse(oCard[idx]);"," });",""," this.response.response.card = oCard;",""," return this;"," };"," this.linkAccount = function() {"," this.response.response.card = {"," \"type\": \"LinkAccount\""," };"," return this;"," };"," this.shouldEndSession = function(bool, reprompt) {"," this.response.response.shouldEndSession = bool;"," if (reprompt) {"," this.reprompt(reprompt);"," }"," return this;"," };"," this.sessionObject = session;"," this.setSessionAttributes = function(attributes) {"," this.response.sessionAttributes = attributes;"," };"," // prepare response object"," this.prepare = function() {"," this.setSessionAttributes(this.sessionObject.getAttributes());"," };"," this.audioPlayerPlay = function(playBehavior, audioItem) {"," var audioPlayerDirective = {"," \"type\": \"AudioPlayer.Play\","," \"playBehavior\": playBehavior,"," \"audioItem\": audioItem"," };"," this.directive(audioPlayerDirective);"," return this;"," };"," this.audioPlayerPlayStream = function(playBehavior, stream) {"," var audioItem = {"," \"stream\": stream"," };"," return this.audioPlayerPlay(playBehavior, audioItem);"," };"," this.audioPlayerStop = function() {"," var audioPlayerDirective = {"," \"type\": \"AudioPlayer.Stop\""," };"," this.directive(audioPlayerDirective);"," return this;"," };"," this.audioPlayerClearQueue = function(clearBehavior) {"," var audioPlayerDirective = {"," \"type\": \"AudioPlayer.ClearQueue\","," \"clearBehavior\": clearBehavior || \"CLEAR_ALL\""," };"," this.directive(audioPlayerDirective);"," return this;"," };"," // Read \u0026 manipulate response directives"," var directives = new alexa.directives(self.response.response.directives);"," this.getDirectives = function() {"," return directives;"," };"," this.directive = function(directive) {"," this.getDirectives().set(directive);"," return this;"," };",""," // legacy code below"," // @deprecated"," this.session = function(key, val) {"," if (typeof val == \"undefined\") {"," return this.sessionObject.get(key);"," } else {"," this.sessionObject.set(key, val);"," }"," return this;"," };",""," // @deprecated"," this.clearSession = function(key) {"," this.sessionObject.clear(key);"," return this;"," };","};","","alexa.directives = function(directives) {"," // load the alexa response directives information into details"," this.details = directives;",""," this.set = function(directive) {"," this.details.push(directive);"," };",""," this.clear = function() {"," this.details.length = 0;"," };","};","","alexa.request = function(json) {"," this.data = json;"," this.slots = {};"," if (this.data.request \u0026\u0026 this.data.request.intent \u0026\u0026 this.data.request.intent.slots \u0026\u0026 Object.keys(this.data.request.intent.slots).length \u003e 0) {"," var slot, slotName;"," for (slotName in this.data.request.intent.slots) {"," slot = new alexa.slot(this.data.request.intent.slots[slotName]);"," this.slots[slotName] = slot;"," }"," }"," this.slot = function(slotName, defaultValue) {"," if (this.slots \u0026\u0026 'undefined' != typeof this.slots[slotName] \u0026\u0026 'undefined' != typeof this.slots[slotName].value) {"," return this.slots[slotName].value;"," } else {"," return defaultValue;"," }"," };"," this.type = function() {"," if (!(this.data \u0026\u0026 this.data.request \u0026\u0026 this.data.request.type)) {"," console.error(\"missing request type:\", this.data);"," return;"," }"," return this.data.request.type;"," };"," this.isAudioPlayer = function() {"," var requestType = this.type();"," return (requestType \u0026\u0026 0 === requestType.indexOf(\"AudioPlayer.\"));"," };"," this.isPlaybackController = function() {"," var requestType = this.type();"," return (requestType \u0026\u0026 0 === requestType.indexOf(\"PlaybackController.\"));"," };",""," if (this.data.request \u0026\u0026 this.data.request.intent) {"," this.confirmationStatus = this.data.request.intent.confirmationStatus;"," }",""," if (this.data.request \u0026\u0026 this.data.request.type === 'Display.ElementSelected' \u0026\u0026 this.data.request.token) {"," this.selectedElementToken = this.data.request.token;"," }",""," this.isConfirmed = function() {"," return 'CONFIRMED' === this.confirmationStatus;"," };",""," this.userId = null;"," this.applicationId = null;"," this.context = null;",""," if (this.data.context) {"," this.userId = this.data.context.System.user.userId;"," this.applicationId = this.data.context.System.application.applicationId;"," this.context = this.data.context;"," }",""," var session = new alexa.session(json.session);"," this.hasSession = function() {"," return session.isAvailable();"," };"," this.getSession = function() {"," return session;"," };",""," this.getDialog = function() {"," var dialogState = (typeof this.data.request['dialogState'] !== \"undefined\") ?"," this.data.request['dialogState'] : null;"," return new alexa.dialog(dialogState);"," };",""," // legacy code below"," // @deprecated"," this.sessionDetails = this.getSession().details;"," // @deprecated"," this.sessionId = this.getSession().sessionId;"," // @deprecated"," this.sessionAttributes = this.getSession().attributes;"," // @deprecated"," this.isSessionNew = this.hasSession() ? this.getSession().isNew() : false;"," // @deprecated"," this.session = function(key) {"," return this.getSession().get(key);"," };","};","","alexa.dialog = function(dialogState) {"," this.dialogState = dialogState;",""," this.isStarted = function() {"," return 'STARTED' === this.dialogState;"," };"," this.isInProgress = function() {"," return 'IN_PROGRESS' === this.dialogState;"," };"," this.isCompleted = function() {"," return 'COMPLETED' === this.dialogState;"," };",""," this.handleDialogDelegation = function(request, response) {"," var dialogDirective = {"," \"type\": \"Dialog.Delegate\""," };"," response.shouldEndSession(false).directive(dialogDirective).send();"," };","};","","alexa.intent = function(name, schema, handler) {"," this.name = name;"," this.handler = handler;"," this.dialog = (schema \u0026\u0026 typeof schema.dialog !== \"undefined\") ? schema.dialog : {};"," this.slots = (schema \u0026\u0026 typeof schema[\"slots\"] !== \"undefined\") ? schema[\"slots\"] : null;"," this.utterances = (schema \u0026\u0026 typeof schema[\"utterances\"] !== \"undefined\") ? schema[\"utterances\"] : null;",""," this.isDelegatedDialog = function() {"," return this.dialog.type === \"delegate\";"," };","};","","alexa.slot = function(slot) {"," this.name = slot.name;"," this.value = slot.value;"," this.confirmationStatus = slot.confirmationStatus;"," if (slot.resolutions \u0026\u0026 slot.resolutions.resolutionsPerAuthority \u0026\u0026 slot.resolutions.resolutionsPerAuthority.length \u003e 0) {"," this.resolutions = slot.resolutions.resolutionsPerAuthority.map(function (resolution) {"," return new alexa.slotResolution(resolution);"," });"," } else {"," this.resolutions = [];"," }",""," this.isConfirmed = function() {"," return 'CONFIRMED' === this.confirmationStatus;"," };"," this.resolution = function (idx) {"," idx = idx \u0026\u0026 idx \u003c this.resolutions.length ? idx : 0;"," return this.resolutions[idx];"," };","};","","alexa.slotResolution = function(resolution) {"," this.status = resolution.status.code;"," this.values = (resolution.values || []).map(function (elem) {"," return new alexa.resolutionValue(elem.value);"," });",""," this.isMatched = function() {"," return 'ER_SUCCESS_MATCH' === this.status;"," };"," this.first = function() {"," return this.values[0];"," };","};","","alexa.resolutionValue = function (value) {"," this.name = value.name;"," this.id = value.id;","};","","alexa.session = function(session) {"," var isAvailable = (typeof session != \"undefined\");"," this.isAvailable = function() {"," return isAvailable;"," };"," if (isAvailable) {"," this.isNew = function() {"," return (true === session.new);"," };"," this.get = function(key) {"," // getAttributes deep clones the attributes object, so updates to objects"," // will not affect the session until `set` is called explicitly"," return this.getAttributes()[key];"," };"," this.set = function(key, value) {"," this.attributes[key] = value;"," };"," this.clear = function(key) {"," if (typeof key == \"string\") {"," if (typeof this.attributes[key] != \"undefined\") {"," delete this.attributes[key];"," }"," } else {"," this.attributes = {};"," }"," };"," // load the alexa session information into details"," this.details = session;"," // @deprecated"," this.details.userId = this.details.user.userId || null;"," // @deprecated"," this.details.accessToken = this.details.user.accessToken || null;",""," // persist all the session attributes across requests"," // the Alexa API doesn't think session variables should persist for the entire"," // duration of the session, but I do"," this.attributes = session.attributes || {};"," this.sessionId = session.sessionId;"," } else {"," this.isNew = this.get = this.set = this.clear = function() {"," throw \"NO_SESSION\";"," };"," this.details = {};"," this.attributes = {};"," this.sessionId = null;"," }"," this.getAttributes = function() {"," // deep clone attributes so direct updates to objects are not set in the"," // session unless `.set` is called explicitly"," return JSON.parse(JSON.stringify(this.attributes));"," };","};","","alexa.apps = {};","","alexa.app = function(name) {"," if (!(this instanceof alexa.app)) {"," throw new Error(\"Function must be called with the new keyword\");"," }",""," var self = this;"," this.name = name;"," this.messages = {"," // when an intent was passed in that the application was not configured to handle"," \"NO_INTENT_FOUND\": \"Sorry, the application didn't know what to do with that intent\","," // when an AudioPlayer event was passed in that the application was not configured to handle"," \"NO_AUDIO_PLAYER_EVENT_HANDLER_FOUND\": \"Sorry, the application didn't know what to do with that AudioPlayer event\","," // when the app was used with 'open' or 'launch' but no launch handler was defined"," \"NO_LAUNCH_FUNCTION\": \"Try telling the application what to do instead of opening it\","," // when a request type was not recognized"," \"INVALID_REQUEST_TYPE\": \"Error: not a valid request\","," // when a request and response don't contain session object"," // https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference#request-body-parameters"," \"NO_SESSION\": \"This request doesn't support session attributes\","," // if some other exception happens"," \"GENERIC_ERROR\": \"Sorry, the application encountered an error\","," // User interacted with the display but no element selected handler has been defined."," \"NO_DISPLAY_ELEMENT_SELECTED_FUNCTION\": \"Try telling the application how to handle display events. Make sure displayElementSelected is implemented.\""," };",""," // persist session variables from every request into every response"," this.persistentSession = true;",""," // use a minimal set of utterances or the full cartesian product"," this.exhaustiveUtterances = false;",""," // a catch-all error handler do nothing by default"," this.error = null;",""," // pre/post hooks to be run on every request"," this.pre = function( /*request, response, type*/ ) {};"," this.post = function( /*request, response, type*/ ) {};",""," // a mapping of keywords to arrays of possible values, for expansion of sample utterances"," this.dictionary = {};"," this.intents = {};"," this.intent = function(intentName, schema, func) {"," if (typeof schema === \"function\") {"," func = schema;"," schema = {};"," }"," self.intents[intentName] = new alexa.intent(intentName, schema, func);"," };",""," this.customSlots = {};"," this.customSlot = function(slotName, values) {"," self.customSlots[slotName] = [];",""," values.forEach(function(value) {"," var valueObj;"," if (typeof value === \"string\") {"," valueObj = {"," value: value,"," id: null,"," synonyms: []"," };"," } else {"," if (!value.id) {"," value.id = null;"," }"," if (!value.synonyms) {"," value.synonyms = [];"," }"," valueObj = value;"," }"," self.customSlots[slotName].push(valueObj);"," });"," };",""," this.audioPlayerEventHandlers = {};"," this.audioPlayer = function(eventName, func) {"," self.audioPlayerEventHandlers[eventName] = {"," \"name\": eventName,"," \"function\": func"," };"," };"," this.playbackControllerEventHandlers = {};"," this.playbackController = function(eventName, func) {"," self.playbackControllerEventHandlers[eventName] = {"," \"name\": eventName,"," \"function\": func"," };"," };"," this.launchFunc = null;"," this.launch = function(func) {"," self.launchFunc = func;"," };"," this.displayElementSelectedFunc = null;"," this.displayElementSelected = function(func) {"," self.displayElementSelectedFunc = func;"," };"," this.sessionEndedFunc = null;"," this.sessionEnded = function(func) {"," self.sessionEndedFunc = func;"," };"," this.request = function(request_json) {"," var request = new alexa.request(request_json);"," var response = new alexa.response(request.getSession());"," var postExecuted = false;"," var requestType = request.type();"," var promiseChain = Promise.resolve();",""," // attach Promise resolve/reject functions to the response object"," response.send = function(exception) {"," response.prepare();"," var postPromise = Promise.resolve();"," if (typeof self.post == \"function\" \u0026\u0026 !postExecuted) {"," postExecuted = true;"," postPromise = Promise.resolve(self.post(request, response, requestType, exception));"," }"," return postPromise.then(function() {"," if (!response.resolved) {"," response.resolved = true;"," }"," return response.response;"," });"," };"," response.fail = function(msg, exception) {"," response.prepare();"," var postPromise = Promise.resolve();"," if (typeof self.post == \"function\" \u0026\u0026 !postExecuted) {"," postExecuted = true;"," postPromise = Promise.resolve(self.post(request, response, requestType, exception));"," }"," return postPromise.then(function() {"," if (!response.resolved) {"," response.resolved = true;"," throw msg;"," }"," // propagate successful response if it's already been resolved"," return response.response;"," });"," };",""," return promiseChain.then(function () {"," // Call to `.pre` can also throw, so we wrap it in a promise here to"," // propagate errors to the error handler"," var prePromise = Promise.resolve();"," if (typeof self.pre == \"function\") {"," prePromise = Promise.resolve(self.pre(request, response, requestType));"," }"," return prePromise;"," }).then(function () {"," requestType = request.type();"," if (!response.resolved) {"," if (\"IntentRequest\" === requestType) {"," var intent = request_json.request.intent.name;"," if (typeof self.intents[intent] !== \"undefined\" \u0026\u0026 typeof self.intents[intent].handler === \"function\") {"," if (self.intents[intent].isDelegatedDialog() \u0026\u0026 !request.getDialog().isCompleted()) {"," return Promise.resolve(request.getDialog().handleDialogDelegation(request, response));"," } else {"," return Promise.resolve(self.intents[intent].handler(request, response));"," }"," } else {"," throw \"NO_INTENT_FOUND\";"," }"," } else if (\"LaunchRequest\" === requestType) {"," if (typeof self.launchFunc == \"function\") {"," return Promise.resolve(self.launchFunc(request, response));"," } else {"," throw \"NO_LAUNCH_FUNCTION\";"," }"," } else if (\"SessionEndedRequest\" === requestType) {"," if (typeof self.sessionEndedFunc == \"function\") {"," return Promise.resolve(self.sessionEndedFunc(request, response));"," }"," } else if (request.isAudioPlayer()) {"," var event = requestType.slice(12);"," var eventHandlerObject = self.audioPlayerEventHandlers[event];"," if (typeof eventHandlerObject != \"undefined\" \u0026\u0026 typeof eventHandlerObject[\"function\"] == \"function\") {"," return Promise.resolve(eventHandlerObject[\"function\"](request, response));"," }"," } else if (request.isPlaybackController()) {"," var playbackControllerEvent = requestType.slice(19);"," var playbackEventHandlerObject = self.playbackControllerEventHandlers[playbackControllerEvent];"," if (typeof playbackEventHandlerObject != \"undefined\" \u0026\u0026 typeof playbackEventHandlerObject[\"function\"] == \"function\") {"," return Promise.resolve(playbackEventHandlerObject[\"function\"](request, response));"," }"," } else if (\"Display.ElementSelected\" === requestType) {"," if (typeof self.displayElementSelectedFunc === \"function\") {"," return Promise.resolve(self.displayElementSelectedFunc(request, response));"," } else {"," throw \"NO_DISPLAY_ELEMENT_SELECTED_FUNCTION\";"," }"," } else {"," throw \"INVALID_REQUEST_TYPE\";"," }"," }"," })"," .then(function () {"," return response.send();"," })"," .catch(function(e) {"," if (typeof self.error == \"function\") {"," // Default behavior of any error handler is to send a response"," return Promise.resolve(self.error(e, request, response)).then(function() {"," if (!response.resolved) {"," response.resolved = true;"," return response.send();"," }"," // propagate successful response if it's already been resolved"," return response.response;"," });"," } else if (typeof e == \"string\" \u0026\u0026 self.messages[e]) {"," if (!request.isAudioPlayer()) {"," response.say(self.messages[e]);"," return response.send(e);"," } else {"," return response.fail(self.messages[e]);"," }"," }"," if (!response.resolved) {"," if (e.message) {"," return response.fail(\"Unhandled exception: \" + e.message + \".\", e);"," } else if (typeof e == \"string\") {"," return response.fail(\"Unhandled exception: \" + e + \".\", e);"," } else {"," return response.fail(\"Unhandled exception.\", e);"," }"," }"," throw e;"," });"," };",""," var skillBuilderSchema = function() {"," var schema = {"," \"intents\": [],"," \"types\": []"," },"," intentName, intent, key;"," for (intentName in self.intents) {"," intent = self.intents[intentName];"," var intentSchema = {"," \"name\": intent.name,"," \"samples\": []"," };"," if (intent.utterances \u0026\u0026 intent.utterances.length \u003e 0) {"," intent.utterances.forEach(function(sample) {"," var list = AlexaUtterances(sample,"," intent.slots,"," self.dictionary,"," self.exhaustiveUtterances);"," list.forEach(function(utterance) {"," intentSchema.samples.push(utterance);"," });"," });"," }"," if (intent.slots \u0026\u0026 Object.keys(intent.slots).length \u003e 0) {"," intentSchema[\"slots\"] = [];"," for (key in intent.slots) {"," // It's unclear whether `samples` is actually used for slots,"," // but the interaction model will not build without an (empty) array"," intentSchema.slots.push({"," \"name\": key,"," \"type\": intent.slots[key],"," \"samples\": []"," });"," }"," }"," schema.intents.push(intentSchema);"," }",""," for (var slotName in self.customSlots) {"," var slotSchema = {"," name: slotName,"," values: []"," };",""," var values = self.customSlots[slotName];"," values.forEach(function(value) {"," var valueSchema = {"," \"id\": value.id,"," \"name\": {"," \"value\": value.value,"," \"synonyms\": value.synonyms || []"," }"," };"," slotSchema.values.push(valueSchema);"," });",""," schema.types.push(slotSchema);"," }"," return schema;"," };",""," this.schemas = {"," intent: function() {"," var schema = {"," \"intents\": []"," },"," intentName, intent, key;"," for (intentName in self.intents) {"," intent = self.intents[intentName];"," var intentSchema = {"," \"intent\": intent.name"," };"," if (intent.slots \u0026\u0026 Object.keys(intent.slots).length \u003e 0) {"," intentSchema[\"slots\"] = [];"," for (key in intent.slots) {"," intentSchema.slots.push({"," \"name\": key,"," \"type\": intent.slots[key]"," });"," }"," }"," schema.intents.push(intentSchema);"," }"," return JSON.stringify(schema, null, 3);"," },",""," skillBuilder: function() {"," var schema = skillBuilderSchema();"," return JSON.stringify(schema, null, 3);"," },"," askcli: function(invocationName) {"," var model = skillBuilderSchema();"," model.invocationName = invocationName || self.invocationName || self.name;"," var schema = {"," interactionModel: {"," languageModel: model"," }"," };"," return JSON.stringify(schema, null, 3);"," }"," };",""," // extract the schema and generate a schema JSON object"," this.schema = function() {"," return this.schemas.intent();"," };",""," // generate a list of sample utterances"," this.utterances = function() {"," var intentName,"," intent,"," out = \"\";"," for (intentName in self.intents) {"," intent = self.intents[intentName];"," if (intent.utterances) {"," intent.utterances.forEach(function(sample) {"," var list = AlexaUtterances(sample,"," intent.slots,"," self.dictionary,"," self.exhaustiveUtterances);"," list.forEach(function(utterance) {"," out += intent.name + \" \" + (utterance.replace(/\\s+/g, \" \")).trim() + \"\\n\";"," });"," });"," }"," }"," return out;"," };",""," // a built-in handler for AWS Lambda"," this.handler = function(event, context, callback) {"," self.request(event)"," .then(function(response) {"," callback(null, response);"," })"," .catch(function(response) {"," callback(response);"," });"," };",""," // for backwards compatibility"," this.lambda = function() {"," return self.handler;"," };",""," // attach Alexa endpoint to an express router"," //"," // @param object options.expressApp the express instance to attach to"," // @param router options.router router instance to attach to the express app"," // @param string options.endpoint the path to attach the router to (e.g., passing 'mine' attaches to '/mine')"," // @param bool options.checkCert when true, applies Alexa certificate checking (default true)"," // @param bool options.debug when true, sets up the route to handle GET requests (default false)"," // @param function options.preRequest function to execute before every POST"," // @param function options.postRequest function to execute after every POST"," // @throws Error when router or expressApp options are not specified"," // @returns this"," this.express = function(options) {"," if (!options.expressApp \u0026\u0026 !options.router) {"," throw new Error(\"You must specify an express app or an express router to attach to.\");"," }",""," var defaultOptions = { endpoint: \"/\" + self.name, checkCert: true, debug: false };",""," options = defaults(options, defaultOptions);",""," // In ExpressJS, user specifies their paths without the '/' prefix"," var deprecated = options.expressApp \u0026\u0026 options.router;"," var endpoint = deprecated ? '/' : normalizeApiPath(options.endpoint);"," var target = deprecated ? options.router : (options.expressApp || options.router);",""," if (deprecated) {"," options.expressApp.use(normalizeApiPath(options.endpoint), options.router);"," console.warn(\"Usage deprecated: Both 'expressApp' and 'router' are specified.\\nMore details on https://github.com/alexa-js/alexa-app/blob/master/UPGRADING.md\");"," }",""," if (options.debug) {"," target.get(endpoint, function(req, res) {"," var schemaName = req.query['schemaType'] || 'intent';"," var schema = self.schemas[schemaName] || function() {};",""," if (typeof req.query['schema'] != \"undefined\") {"," res.set('Content-Type', 'text/plain').send(schema());"," } else if (typeof req.query['utterances'] != \"undefined\") {"," res.set('Content-Type', 'text/plain').send(self.utterances());"," } else {"," res.render(\"test\", {"," \"app\": self,"," \"schema\": schema(),"," \"utterances\": self.utterances()"," });"," }"," });"," }",""," if (options.checkCert) {"," target.use(endpoint, verifier);"," } else {"," target.use(endpoint, bodyParser.json());"," }",""," // exposes POST /\u003cendpoint\u003e route"," target.post(endpoint, function(req, res) {"," var json = req.body,"," response_json;"," // preRequest and postRequest may return altered request JSON, or undefined, or a Promise"," Promise.resolve(typeof options.preRequest == \"function\" ? options.preRequest(json, req, res) : json)"," .then(function(json_new) {"," if (json_new) {"," json = json_new;"," }"," return json;"," })"," .then(self.request)"," .then(function(app_response_json) {"," response_json = app_response_json;"," return Promise.resolve(typeof options.postRequest == \"function\" ? options.postRequest(app_response_json, req, res) : app_response_json);"," })"," .then(function(response_json_new) {"," response_json = response_json_new || response_json;"," res.json(response_json).send();"," })"," .catch(function(err) {"," console.e 8000 rror(err);"," res.status(500).send(\"Server Error\");"," });"," });",""," };",""," // add the app to the global list of named apps"," if (name) {"," alexa.apps[name] = self;"," }",""," return this;","};","","module.exports = alexa;"],"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/hidesuke/alexa-app/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"index.js","displayUrl":"https://github.com/hidesuke/alexa-app/blob/master/index.js?raw=true","headerInfo":{"blobSize":"27.8 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"201535e","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fhidesuke%2Falexa-app%2Fblob%2Fmaster%2Findex.js","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"878","truncatedSloc":"807"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"JavaScript","languageID":183,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/hidesuke/alexa-app/blob/master/index.js","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/hidesuke/alexa-app/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/hidesuke/alexa-app/raw/refs/heads/master/index.js","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"response","kind":"function","ident_start":358,"ident_end":366,"extent_start":352,"extent_end":5152,"fully_qualified_name":"response","ident_utf16":{"start":{"line_number":11,"utf16_col":6},"end":{"line_number":11,"utf16_col":14}},"extent_utf16":{"start":{"line_number":11,"utf16_col":0},"end":{"line_number":184,"utf16_col":1}}},{"name":"say","kind":"function","ident_start":566,"ident_end":569,"extent_start":561,"extent_end":996,"fully_qualified_name":"say","ident_utf16":{"start":{"line_number":21,"utf16_col":7},"end":{"line_number":21,"utf16_col":10}},"extent_utf16":{"start":{"line_number":21,"utf16_col":2},"end":{"line_number":32,"utf16_col":3}}},{"name":"clear","kind":"function","ident_start":1005,"ident_end":1010,"extent_start":1000,"extent_end":1159,"fully_qualified_name":"clear","ident_utf16":{"start":{"line_number":33,"utf16_col":7},"end":{"line_number":33,"utf16_col":12}},"extent_utf16":{"start":{"line_number":33,"utf16_col":2},"end":{"line_number":39,"utf16_col":3}}},{"name":"reprompt","kind":"function","ident_start":1168,"ident_end":1176,"extent_start":1163,"extent_end":1653,"fully_qualified_name":"reprompt","ident_utf16":{"start":{"line_number":40,"utf16_col":7},"end":{"line_number":40,"utf16_col":15}},"extent_utf16":{"start":{"line_number":40,"utf16_col":2},"end":{"line_number":53,"utf16_col":3}}},{"name":"card","kind":"function","ident_start":1662,"ident_end":1666,"extent_start":1657,"extent_end":3057,"fully_qualified_name":"card","ident_utf16":{"start":{"line_number":54,"utf16_col":7},"end":{"line_number":54,"utf16_col":11}},"extent_utf16":{"start":{"line_number":54,"utf16_col":2},"end":{"line_number":106,"utf16_col":3}}},{"name":"linkAccount","kind":"function","ident_start":3066,"ident_end":3077,"extent_start":3061,"extent_end":3184,"fully_qualified_name":"linkAccount","ident_utf16":{"start":{"line_number":107,"utf16_col":7},"end":{"line_number":107,"utf16_col":18}},"extent_utf16":{"start":{"line_number":107,"utf16_col":2},"end":{"line_number":112,"utf16_col":3}}},{"name":"shouldEndSession","kind":"function","ident_start":3193,"ident_end":3209,"extent_start":3188,"extent_end":3368,"fully_qualified_name":"shouldEndSession","ident_utf16":{"start":{"line_number":113,"utf16_col":7},"end":{"line_number":113,"utf16_col":23}},"extent_utf16":{"start":{"line_number":113,"utf16_col":2},"end":{"line_number":119,"utf16_col":3}}},{"name":"setSessionAttributes","kind":"function","ident_start":3409,"ident_end":3429,"extent_start":3404,"extent_end":3508,"fully_qualified_name":"setSessionAttributes","ident_utf16":{"start":{"line_number":121,"utf16_col":7},"end":{"line_number":121,"utf16_col":27}},"extent_utf16":{"start":{"line_number":121,"utf16_col":2},"end":{"line_number":123,"utf16_col":3}}},{"name":"prepare","kind":"function","ident_start":3546,"ident_end":3553,"extent_start":3541,"extent_end":3639,"fully_qualified_name":"prepare","ident_utf16":{"start":{"line_number":125,"utf16_col":7},"end":{"line_number":125,"utf16_col":14}},"extent_utf16":{"start":{"line_number":125,"utf16_col":2},"end":{"line_number":127,"utf16_col":3}}},{"name":"audioPlayerPlay","kind":"function","ident_start":3648,"ident_end":3663,"extent_start":3643,"extent_end":3903,"fully_qualified_name":"audioPlayerPlay","ident_utf16":{"start":{"line_number":128,"utf16_col":7},"end":{"line_number":128,"utf16_col":22}},"extent_utf16":{"start":{"line_number":128,"utf16_col":2},"end":{"line_number":136,"utf16_col":3}}},{"name":"audioPlayerPlayStream","kind":"function","ident_start":3912,"ident_end":3933,"extent_start":3907,"extent_end":4082,"fully_qualified_name":"audioPlayerPlayStream","ident_utf16":{"start":{"line_number":137,"utf16_col":7},"end":{"line_number":137,"utf16_col":28}},"extent_utf16":{"start":{"line_number":137,"utf16_col":2},"end":{"line_number":142,"utf16_col":3}}},{"name":"audioPlayerStop","kind":"function","ident_start":4091,"ident_end":4106,"extent_start":4086,"extent_end":4257,"fully_qualified_name":"audioPlayerStop","ident_utf16":{"start":{"line_number":143,"utf16_col":7},"end":{"line_number":143,"utf16_col":22}},"extent_utf16":{"start":{"line_number":143,"utf16_col":2},"end":{"line_number":149,"utf16_col":3}}},{"name":"audioPlayerClearQueue","kind":"function","ident_start":4266,"ident_end":4287,"extent_start":4261,"extent_end":4510,"fully_qualified_name":"audioPlayerClearQueue","ident_utf16":{"start":{"line_number":150,"utf16_col":7},"end":{"line_number":150,"utf16_col":28}},"extent_utf16":{"start":{"line_number":150,"utf16_col":2},"end":{"line_number":157,"utf16_col":3}}},{"name":"getDirectives","kind":"function","ident_start":4638,"ident_end":4651,"extent_start":4633,"extent_end":4693,"fully_qualified_name":"getDirectives","ident_utf16":{"start":{"line_number":160,"utf16_col":7},"end":{"line_number":160,"utf16_col":20}},"extent_utf16":{"start":{"line_number":160,"utf16_col":2},"end":{"line_number":162,"utf16_col":3}}},{"name":"directive","kind":"function","ident_start":4702,"ident_end":4711,"extent_start":4697,"extent_end":4797,"fully_qualified_name":"directive","ident_utf16":{"start":{"line_number":163,"utf16_col":7},"end":{"line_number":163,"utf16_col":16}},"extent_utf16":{"start":{"line_number":163,"utf16_col":2},"end":{"line_number":166,"utf16_col":3}}},{"name":"session","kind":"function","ident_start":4847,"ident_end":4854,"extent_start":4842,"extent_end":5036,"fully_qualified_name":"session","ident_utf16":{"start":{"line_number":170,"utf16_col":7},"end":{"line_number":170,"utf16_col":14}},"extent_utf16":{"start":{"line_number":170,"utf16_col":2},"end":{"line_number":177,"utf16_col":3}}},{"name":"clearSession","kind":"function","ident_start":5063,"ident_end":5075,"extent_start":5058,"extent_end":5149,"fully_qualified_name":"clearSession","ident_utf16":{"start":{"line_number":180,"utf16_col":7},"end":{"line_number":180,"utf16_col":19}},"extent_utf16":{"start":{"line_number":180,"utf16_col":2},"end":{"line_number":183,"utf16_col":3}}},{"name":"directives","kind":"function","ident_start":5161,"ident_end":5171,"extent_start":5155,"extent_end":5430,"fully_qualified_name":"directives","ident_utf16":{"start":{"line_number":186,"utf16_col":6},"end":{"line_number":186,"utf16_col":16}},"extent_utf16":{"start":{"line_number":186,"utf16_col":0},"end":{"line_number":197,"utf16_col":1}}},{"name":"set","kind":"function","ident_start":5299,"ident_end":5302,"extent_start":5294,"extent_end":5364,"fully_qualified_name":"set","ident_utf16":{"start":{"line_number":190,"utf16_col":7},"end":{"line_number":190,"utf16_col":10}},"extent_utf16":{"start":{"line_number":190,"utf16_col":2},"end":{"line_number":192,"utf16_col":3}}},{"name":"clear","kind":"function","ident_start":5374,"ident_end":5379,"extent_start":5369,"extent_end":5427,"fully_qualified_name":"clear","ident_utf16":{"start":{"line_number":194,"utf16_col":7},"end":{"line_number":194,"utf16_col":12}},"extent_utf16":{"start":{"line_number":194,"utf16_col":2},"end":{"line_number":196,"utf16_col":3}}},{"name":"request","kind":"function","ident_start":5439,"ident_end":5446,"extent_start":5433,"extent_end":8117,"fully_qualified_name":"request","ident_utf16":{"start":{"line_number":199,"utf16_col":6},"end":{"line_number":199,"utf16_col":13}},"extent_utf16":{"start":{"line_number":199,"utf16_col":0},"end":{"line_number":281,"utf16_col":1}}},{"name":"slot","kind":"function","ident_start":5854,"ident_end":5858,"extent_start":5849,"extent_end":6106,"fully_qualified_name":"slot","ident_utf16":{"start":{"line_number":209,"utf16_col":7},"end":{"line_number":209,"utf16_col":11}},"extent_utf16":{"start":{"line_number":209,"utf16_col":2},"end":{"line_number":215,"utf16_col":3}}},{"name":"type","kind":"function","ident_start":6115,"ident_end":6119,"extent_start":6110,"extent_end":6321,"fully_qualified_name":"type","ident_utf16":{"start":{"line_number":216,"utf16_col":7},"end":{"line_number":216,"utf16_col":11}},"extent_utf16":{"start":{"line_number":216,"utf16_col":2},"end":{"line_number":222,"utf16_col":3}}},{"name":"isAudioPlayer","kind":"function","ident_start":6330,"ident_end":6343,"extent_start":6325,"extent_end":6468,"fully_qualified_name":"isAudioPlayer","ident_utf16":{"start":{"line_number":223,"utf16_col":7},"end":{"line_number":223,"utf16_col":20}},"extent_utf16":{"start":{"line_number":223,"utf16_col":2},"end":{"line_number":226,"utf16_col":3}}},{"name":"isPlaybackController","kind":"function","ident_start":6477,"ident_end":6497,"extent_start":6472,"extent_end":6629,"fully_qualified_name":"isPlaybackController","ident_utf16":{"start":{"line_number":227,"utf16_col":7},"end":{"line_number":227,"utf16_col":27}},"extent_utf16":{"start":{"line_number":227,"utf16_col":2},"end":{"line_number":230,"utf16_col":3}}},{"name":"isConfirmed","kind":"function","ident_start":6946,"ident_end":6957,"extent_start":6941,"extent_end":7028,"fully_qualified_name":"isConfirmed","ident_utf16":{"start":{"line_number":240,"utf16_col":7},"end":{"line_number":240,"utf16_col":18}},"extent_utf16":{"start":{"line_number":240,"utf16_col":2},"end":{"line_number":242,"utf16_col":3}}},{"name":"hasSession","kind":"function","ident_start":7365,"ident_end":7375,"extent_start":7360,"extent_end":7428,"fully_qualified_name":"hasSession","ident_utf16":{"start":{"line_number":255,"utf16_col":7},"end":{"line_number":255,"utf16_col":17}},"extent_utf16":{"start":{"line_number":255,"utf16_col":2},"end":{"line_number":257,"utf16_col":3}}},{"name":"getSession","kind":"function","ident_start":7437,"ident_end":7447,"extent_start":7432,"extent_end":7486,"fully_qualified_name":"getSession","ident_utf16":{"start":{"line_number":258,"utf16_col":7},"end":{"line_number":258,"utf16_col":17}},"extent_utf16":{"start":{"line_number":258,"utf16_col":2},"end":{"line_number":260,"utf16_col":3}}},{"name":"getDialog","kind":"function","ident_start":7496,"ident_end":7505,"extent_start":7491,"extent_end":7695,"fully_qualified_name":"getDialog","ident_utf16":{"start":{"line_number":262,"utf16_col":7},"end":{"line_number":262,"utf16_col":16}},"extent_utf16":{"start":{"line_number":262,"utf16_col":2},"end":{"line_number":266,"utf16_col":3}}},{"name":"session","kind":"function","ident_start":8046,"ident_end":8053,"extent_start":8041,"extent_end":8114,"fully_qualified_name":"session","ident_utf16":{"start":{"line_number":278,"utf16_col":7},"end":{"line_number":278,"utf16_col":14}},"extent_utf16":{"start":{"line_number":278,"utf16_col":2},"end":{"line_number":280,"utf16_col":3}}},{"name":"dialog","kind":"function","ident_start":8126,"ident_end":8132,"extent_start":8120,"extent_end":8653,"fully_qualified_name":"dialog","ident_utf16":{"start":{"line_number":283,"utf16_col":6},"end":{"line_number":283,"utf16_col":12}},"extent_utf16":{"start":{"line_number":283,"utf16_col":0},"end":{"line_number":302,"utf16_col":1}}},{"name":"isStarted","kind":"function","ident_start":8201,"ident_end":8210,"extent_start":8196,"extent_end":8272,"fully_qualified_name":"isStarted","ident_utf16":{"start":{"line_number":286,"utf16_col":7},"end":{"line_number":286,"utf16_col":16}},"extent_utf16":{"start":{"line_number":286,"utf16_col":2},"end":{"line_number":288,"utf16_col":3}}},{"name":"isInProgress","kind":"function","ident_start":8281,"ident_end":8293,"extent_start":8276,"extent_end":8359,"fully_qualified_name":"isInProgress","ident_utf16":{"start":{"line_number":289,"utf16_col":7},"end":{"line_number":289,"utf16_col":19}},"extent_utf16":{"start":{"line_number":289,"utf16_col":2},"end":{"line_number":291,"utf16_col":3}}},{"name":"isCompleted","kind":"function","ident_start":8368,"ident_end":8379,"extent_start":8363,"extent_end":8443,"fully_qualified_name":"isCompleted","ident_utf16":{"start":{"line_number":292,"utf16_col":7},"end":{"line_number":292,"utf16_col":18}},"extent_utf16":{"start":{"line_number":292,"utf16_col":2},"end":{"line_number":294,"utf16_col":3}}},{"name":"handleDialogDelegation","kind":"function","ident_start":8453,"ident_end":8475,"extent_start":8448,"extent_end":8650,"fully_qualified_name":"handleDialogDelegation","ident_utf16":{"start":{"line_number":296,"utf16_col":7},"end":{"line_number":296,"utf16_col":29}},"extent_utf16":{"start":{"line_number":296,"utf16_col":2},"end":{"line_number":301,"utf16_col":3}}},{"name":"intent","kind":"function","ident_start":8662,"ident_end":8668,"extent_start":8656,"extent_end":9128,"fully_qualified_name":"intent","ident_utf16":{"start":{"line_number":304,"utf16_col":6},"end":{"line_number":304,"utf16_col":12}},"extent_utf16":{"start":{"line_number":304,"utf16_col":0},"end":{"line_number":314,"utf16_col":1}}},{"name":"isDelegatedDialog","kind":"function","ident_start":9045,"ident_end":9062,"extent_start":9040,"extent_end":9125,"fully_qualified_name":"isDelegatedDialog","ident_utf16":{"start":{"line_number":311,"utf16_col":7},"end":{"line_number":311,"utf16_col":24}},"extent_utf16":{"start":{"line_number":311,"utf16_col":2},"end":{"line_number":313,"utf16_col":3}}},{"name":"slot","kind":"function","ident_start":9137,"ident_end":9141,"extent_start":9131,"extent_end":9811,"fully_qualified_name":"slot","ident_utf16":{"start":{"line_number":316,"utf16_col":6},"end":{"line_number":316,"utf16_col":10}},"extent_utf16":{"start":{"line_number":316,"utf16_col":0},"end":{"line_number":335,"utf16_col":1}}},{"name":"isConfirmed","kind":"function","ident_start":9592,"ident_end":9603,"extent_start":9587,"extent_end":9674,"fully_qualified_name":"isConfirmed","ident_utf16":{"start":{"line_number":328,"utf16_col":7},"end":{"line_number":328,"utf16_col":18}},"extent_utf16":{"start":{"line_number":328,"utf16_col":2},"end":{"line_number":330,"utf16_col":3}}},{"name":"resolution","kind":"function","ident_start":9683,"ident_end":9693,"extent_start":9678,"extent_end":9808,"fully_qualified_name":"resolution","ident_utf16":{"start":{"line_number":331,"utf16_col":7},"end":{"line_number":331,"utf16_col":17}},"extent_utf16":{"start":{"line_number":331,"utf16_col":2},"end":{"line_number":334,"utf16_col":3}}},{"name":"slotResolution","kind":"function","ident_start":9820,"ident_end":9834,"extent_start":9814,"extent_end":10166,"fully_qualified_name":"slotResolution","ident_utf16":{"start":{"line_number":337,"utf16_col":6},"end":{"line_number":337,"utf16_col":20}},"extent_utf16":{"start":{"line_number":337,"utf16_col":0},"end":{"line_number":349,"utf16_col":1}}},{"name":"isMatched","kind":"function","ident_start":10028,"ident_end":10037,"extent_start":10023,"extent_end":10103,"fully_qualified_name":"isMatched","ident_utf16":{"start":{"line_number":343,"utf16_col":7},"end":{"line_number":343,"utf16_col":16}},"extent_utf16":{"start":{"line_number":343,"utf16_col":2},"end":{"line_number":345,"utf16_col":3}}},{"name":"first","kind":"function","ident_start":10112,"ident_end":10117,"extent_start":10107,"extent_end":10163,"fully_qualified_name":"first","ident_utf16":{"start":{"line_number":346,"utf16_col":7},"end":{"line_number":346,"utf16_col":12}},"extent_utf16":{"start":{"line_number":346,"utf16_col":2},"end":{"line_number":348,"utf16_col":3}}},{"name":"resolutionValue","kind":"function","ident_start":10175,"ident_end":10190,"extent_start":10169,"extent_end":10261,"fully_qualified_name":"resolutionValue","ident_utf16":{"start":{"line_number":351,"utf16_col":6},"end":{"line_number":351,"utf16_col":21}},"extent_utf16":{"start":{"line_number":351,"utf16_col":0},"end":{"line_number":354,"utf16_col":1}}},{"name":"session","kind":"function","ident_start":10270,"ident_end":10277,"extent_start":10264,"extent_end":11992,"fully_qualified_name":"session","ident_utf16":{"start":{"line_number":356,"utf16_col":6},"end":{"line_number":356,"utf16_col":13}},"extent_utf16":{"start":{"line_number":356,"utf16_col":0},"end":{"line_number":407,"utf16_col":1}}},{"name":"isAvailable","kind":"function","ident_start":10360,"ident_end":10371,"extent_start":10355,"extent_end":10414,"fully_qualified_name":"isAvailable","ident_utf16":{"start":{"line_number":358,"utf16_col":7},"end":{"line_number":358,"utf16_col":18}},"extent_utf16":{"start":{"line_number":358,"utf16_col":2},"end":{"line_number":360,"utf16_col":3}}},{"name":"isNew","kind":"function","ident_start":10446,"ident_end":10451,"extent_start":10441,"extent_end":10509,"fully_qualified_name":"isNew","ident_utf16":{"start":{"line_number":362,"utf16_col":9},"end":{"line_number":362,"utf16_col":14}},"extent_utf16":{"start":{"line_number":362,"utf16_col":4},"end":{"line_number":364,"utf16_col":5}}},{"name":"get","kind":"function","ident_start":10520,"ident_end":10523,"extent_start":10515,"extent_end":10737,"fully_qualified_name":"get","ident_utf16":{"start":{"line_number":365,"utf16_col":9},"end":{"line_number":365,"utf16_col":12}},"extent_utf16":{"start":{"line_number":365,"utf16_col":4},"end":{"line_number":369,"utf16_col":5}}},{"name":"set","kind":"function","ident_start":10748,"ident_end":10751,"extent_start":10743,"extent_end":10818,"fully_qualified_name":"set","ident_utf16":{"start":{"line_number":370,"utf16_col":9},"end":{"line_number":370,"utf16_col":12}},"extent_utf16":{"start":{"line_number":370,"utf16_col":4},"end":{"line_number":372,"utf16_col":5}}},{"name":"clear","kind":"function","ident_start":10829,"ident_end":10834,"extent_start":10824,"extent_end":11054,"fully_qualified_name":"clear","ident_utf16":{"start":{"line_number":373,"utf16_col":9},"end":{"line_number":373,"utf16_col":14}},"extent_utf16":{"start":{"line_number":373,"utf16_col":4},"end":{"line_number":381,"utf16_col":5}}},{"name":"clear","kind":"function","ident_start":11633,"ident_end":11638,"extent_start":11628,"extent_end":11685,"fully_qualified_name":"clear","ident_utf16":{"start":{"line_number":395,"utf16_col":44},"end":{"line_number":395,"utf16_col":49}},"extent_utf16":{"start":{"line_number":395,"utf16_col":39},"end":{"line_number":397,"utf16_col":5}}},{"name":"getAttributes","kind":"function","ident_start":11774,"ident_end":11787,"extent_start":11769,"extent_end":11989,"fully_qualified_name":"getAttributes","ident_utf16":{"start":{"line_number":402,"utf16_col":7},"end":{"line_number":402,"utf16_col":20}},"extent_utf16":{"start":{"line_number":402,"utf16_col":2},"end":{"line_number":406,"utf16_col":3}}},{"name":"app","kind":"function","ident_start":12019,"ident_end":12022,"extent_start":12013,"extent_end":28470,"fully_qualified_name":"app","ident_utf16":{"start":{"line_number":411,"utf16_col":6},"end":{"line_number":411,"utf16_col":9}},"extent_utf16":{"start":{"line_number":411,"utf16_col":0},"end":{"line_number":875,"utf16_col":1}}},{"name":"pre","kind":"function","ident_start":13855,"ident_end":13858,"extent_start":13850,"extent_end":13903,"fully_qualified_name":"pre","ident_utf16":{"start":{"line_number":446,"utf16_col":7},"end":{"line_number":446,"utf16_col":10}},"extent_utf16":{"start":{"line_number":446,"utf16_col":2},"end":{"line_number":446,"utf16_col":55}}},{"name":"post","kind":"function","ident_start":13912,"ident_end":13916,"extent_start":13907,"extent_end":13961,"fully_qualified_name":"post","ident_utf16":{"start":{"line_number":447,"utf16_col":7},"end":{"line_number":447,"utf16_col":11}},"extent_utf16":{"start":{"line_number":447,"utf16_col":2},"end":{"line_number":447,"utf16_col":56}}},{"name":"intent","kind":"function","ident_start":14108,"ident_end":14114,"extent_start":14103,"extent_end":14318,"fully_qualified_name":"intent","ident_utf16":{"start":{"line_number":452,"utf16_col":7},"end":{"line_number":452,"utf16_col":13}},"extent_utf16":{"start":{"line_number":452,"utf16_col":2},"end":{"line_number":458,"utf16_col":3}}},{"name":"customSlot","kind":"function","ident_start":14353,"ident_end":14363,"extent_start":14348,"extent_end":14871,"fully_qualified_name":"customSlot","ident_utf16":{"start":{"line_number":461,"utf16_col":7},"end":{"line_number":461,"utf16_col":17}},"extent_utf16":{"start":{"line_number":461,"utf16_col":2},"end":{"line_number":483,"utf16_col":3}}},{"name":"audioPlayer","kind":"function","ident_start":14919,"ident_end":14930,"extent_start":14914,"extent_end":15068,"fully_qualified_name":"audioPlayer","ident_utf16":{"start":{"line_number":486,"utf16_col":7},"end":{"line_number":486,"utf16_col":18}},"extent_utf16":{"start":{"line_number":486,"utf16_col":2},"end":{"line_number":491,"utf16_col":3}}},{"name":"playbackController","kind":"function","ident_start":15122,"ident_end":15140,"extent_start":15117,"extent_end":15285,"fully_qualified_name":"playbackController","ident_utf16":{"start":{"line_number":493,"utf16_col":7},"end":{"line_number":493,"utf16_col":25}},"extent_utf16":{"start":{"line_number":493,"utf16_col":2},"end":{"line_number":498,"utf16_col":3}}},{"name":"launch","kind":"function","ident_start":15320,"ident_end":15326,"extent_start":15315,"extent_end":15377,"fully_qualified_name":"launch","ident_utf16":{"start":{"line_number":500,"utf16_col":7},"end":{"line_number":500,"utf16_col":13}},"extent_utf16":{"start":{"line_number":500,"utf16_col":2},"end":{"line_number":502,"utf16_col":3}}},{"name":"displayElementSelected","kind":"function","ident_start":15428,"ident_end":15450,"extent_start":15423,"extent_end":15517,"fully_qualified_name":"displayElementSelected","ident_utf16":{"start":{"line_number":504,"utf16_col":7},"end":{"line_number":504,"utf16_col":29}},"extent_utf16":{"start":{"line_number":504,"utf16_col":2},"end":{"line_number":506,"utf16_col":3}}},{"name":"sessionEnded","kind":"function","ident_start":15558,"ident_end":15570,"extent_start":15553,"extent_end":15627,"fully_qualified_name":"sessionEnded","ident_utf16":{"start":{"line_number":508,"utf16_col":7},"end":{"line_number":508,"utf16_col":19}},"extent_utf16":{"start":{"line_number":508,"utf16_col":2},"end":{"line_number":510,"utf16_col":3}}},{"name":"request","kind":"function","ident_start":15636,"ident_end":15643,"extent_start":15631,"extent_end":20943,"fully_qualified_name":"request","ident_utf16":{"start":{"line_number":511,"utf16_col":7},"end":{"line_number":511,"utf16_col":14}},"extent_utf16":{"start":{"line_number":511,"utf16_col":2},"end":{"line_number":638,"utf16_col":3}}},{"name":"send","kind":"function","ident_start":15977,"ident_end":15981,"extent_start":15968,"extent_end":16438,"fully_qualified_name":"send","ident_utf16":{"start":{"line_number":519,"utf16_col":13},"end":{"line_number":519,"utf16_col":17}},"extent_utf16":{"start":{"line_number":519,"utf16_col":4},"end":{"line_number":532,"utf16_col":5}}},{"name":"fail","kind":"function","ident_start":16453,"ident_end":16457,"extent_start":16444,"extent_end":17011,"fully_qualified_name":"fail","ident_utf16":{"start":{"line_number":533,"utf16_col":13},"end":{"line_number":533,"utf16_col":17}},"extent_utf16":{"start":{"line_number":533,"utf16_col":4},"end":{"line_number":548,"utf16_col":5}}},{"name":"skillBuilderSchema","kind":"function","ident_start":20952,"ident_end":20970,"extent_start":20952,"extent_end":22634,"fully_qualified_name":"skillBuilderSchema","ident_utf16":{"start":{"line_number":640,"utf16_col":6},"end":{"line_number":640,"utf16_col":24}},"extent_utf16":{"start":{"line_number":640,"utf16_col":6},"end":{"line_number":699,"utf16_col":3}}},{"name":"intent","kind":"function","ident_start":22660,"ident_end":22666,"extent_start":22660,"extent_end":23315,"fully_qualified_name":"intent","ident_utf16":{"start":{"line_number":702,"utf16_col":4},"end":{"line_number":702,"utf16_col":10}},"extent_utf16":{"start":{"line_number":702,"utf16_col":4},"end":{"line_number":724,"utf16_col":5}}},{"name":"skillBuilder","kind":"function","ident_start":23322,"ident_end":23334,"extent_start":23322,"extent_end":23441,"fully_qualified_name":"skillBuilder","ident_utf16":{"start":{"line_number":726,"utf16_col":4},"end":{"line_number":726,"utf16_col":16}},"extent_utf16":{"start":{"line_number":726,"utf16_col":4},"end":{"line_number":729,"utf16_col":5}}},{"name":"askcli","kind":"function","ident_start":23447,"ident_end":23453,"extent_start":23447,"extent_end":23753,"fully_qualified_name":"askcli","ident_utf16":{"start":{"line_number":730,"utf16_col":4},"end":{"line_number":730,"utf16_col":10}},"extent_utf16":{"start":{"line_number":730,"utf16_col":4},"end":{"line_number":739,"utf16_col":5}}},{"name":"schema","kind":"function","ident_start":23825,"ident_end":23831,"extent_start":23820,"extent_end":23884,"fully_qualified_name":"schema","ident_utf16":{"start":{"line_number":743,"utf16_col":7},"end":{"line_number":743,"utf16_col":13}},"extent_utf16":{"start":{"line_number":743,"utf16_col":2},"end":{"line_number":745,"utf16_col":3}}},{"name":"utterances","kind":"function","ident_start":23936,"ident_end":23946,"extent_start":23931,"extent_end":24507,"fully_qualified_name":"utterances","ident_utf16":{"start":{"line_number":748,"utf16_col":7},"end":{"line_number":748,"utf16_col":17}},"extent_utf16":{"start":{"line_number":748,"utf16_col":2},"end":{"line_number":767,"utf16_col":3}}},{"name":"handler","kind":"function","ident_start":24556,"ident_end":24563,"extent_start":24551,"extent_end":24778,"fully_qualified_name":"handler","ident_utf16":{"start":{"line_number":770,"utf16_col":7},"end":{"line_number":770,"utf16_col":14}},"extent_utf16":{"start":{"line_number":770,"utf16_col":2},"end":{"line_number":778,"utf16_col":3}}},{"name":"lambda","kind":"function","ident_start":24821,"ident_end":24827,"extent_start":24816,"extent_end":24871,"fully_qualified_name":"lambda","ident_utf16":{"start":{"line_number":781,"utf16_col":7},"end":{"line_number":781,"utf16_col":13}},"extent_utf16":{"start":{"line_number":781,"utf16_col":2},"end":{"line_number":783,"utf16_col":3}}},{"name":"express","kind":"function","ident_start":25638,"ident_end":25645,"extent_start":25633,"extent_end":28353,"fully_qualified_name":"express","ident_utf16":{"start":{"line_number":796,"utf16_col":7},"end":{"line_number":796,"utf16_col":14}},"extent_utf16":{"start":{"line_number":796,"utf16_col":2},"end":{"line_number":867,"utf16_col":3}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/hidesuke/alexa-app/branches":{"post":"wn_X0ag7LeipPWDcPhfBpKggMqjaH14V5_a18EjNOS0SehGbqvsVmJk5VQg5Sp_m-Fym4iLS2BCX1_6jKxQ9xQ"},"/repos/preferences":{"post":"FuvXQycpvVTWE2Ssi0bjHc7GRCvA544Va-cjFol-N0Ni1VdROGza2obvK4tnfIJYGeQjX7kuQ6jxXJmHTPq_Bg"}}},"title":"alexa-app/index.js at master · hidesuke/alexa-app","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1ae9fa256942.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}
0