ask-sdk-core
Advanced tools
Comparing version 2.12.1 to 2.14.0
@@ -6,2 +6,38 @@ # Change Log | ||
# [2.14.0](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/compare/v2.12.1...v2.14.0) (2023-04-03) | ||
### Bug Fixes | ||
* **version:** typescript dependency ([c2756d9](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/c2756d9013c6d135b0f3562d13601a0b16905761)) | ||
* **warnings:** removed extraneous spaces ([7ad1651](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/7ad1651f1ef878630ef213dd3460474db592115d)) | ||
### Features | ||
* **component-interface:** egress and ingress interface for ac skill components ([41f5102](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/41f51027bd2b81628f4d5485a6bedd67a63b4b4d)) | ||
* **delegation:** delegation handler for AC to IM ([06a2b2c](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/06a2b2c87d509bf879aa5a51e4b770bbc4d708b5)) | ||
# [2.13.0](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/compare/v2.12.1...v2.13.0) (2023-04-03) | ||
### Bug Fixes | ||
* **version:** typescript dependency ([c2756d9](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/c2756d9013c6d135b0f3562d13601a0b16905761)) | ||
* **warnings:** removed extraneous spaces ([7ad1651](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/7ad1651f1ef878630ef213dd3460474db592115d)) | ||
### Features | ||
* **component-interface:** egress and ingress interface for ac skill components ([41f5102](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/41f51027bd2b81628f4d5485a6bedd67a63b4b4d)) | ||
* **delegation:** delegation handler for AC to IM ([06a2b2c](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/06a2b2c87d509bf879aa5a51e4b770bbc4d708b5)) | ||
## [2.12.1](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/compare/v2.12.0...v2.12.1) (2022-04-01) | ||
@@ -8,0 +44,0 @@ |
@@ -23,3 +23,3 @@ "use strict"; | ||
if (!options.requestEnvelope) { | ||
throw ask_sdk_runtime_1.createAskSdkError('AttributesManagerFactory', 'RequestEnvelope cannot be null or undefined!'); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('AttributesManagerFactory', 'RequestEnvelope cannot be null or undefined!'); | ||
} | ||
@@ -40,3 +40,3 @@ let thisRequestAttributes = {}; | ||
if (!options.requestEnvelope.session) { | ||
throw ask_sdk_runtime_1.createAskSdkError('AttributesManager', 'Cannot get SessionAttributes from out of session request!'); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('AttributesManager', 'Cannot get SessionAttributes from out of session request!'); | ||
} | ||
@@ -47,3 +47,3 @@ return thisSessionAttributes; | ||
if (!options.persistenceAdapter) { | ||
throw ask_sdk_runtime_1.createAskSdkError('AttributesManager', 'Cannot get PersistentAttributes without PersistenceManager'); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('AttributesManager', 'Cannot get PersistentAttributes without PersistenceManager'); | ||
} | ||
@@ -64,3 +64,3 @@ if (!persistentAttributesSet || !useSessionCache) { | ||
if (!options.requestEnvelope.session) { | ||
throw ask_sdk_runtime_1.createAskSdkError('AttributesManager', 'Cannot set SessionAttributes to out of session request!'); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('AttributesManager', 'Cannot set SessionAttributes to out of session request!'); | ||
} | ||
@@ -71,3 +71,3 @@ thisSessionAttributes = sessionAttributes; | ||
if (!options.persistenceAdapter) { | ||
throw ask_sdk_runtime_1.createAskSdkError('AttributesManager', 'Cannot set PersistentAttributes without persistence adapter!'); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('AttributesManager', 'Cannot set PersistentAttributes without persistence adapter!'); | ||
} | ||
@@ -79,3 +79,3 @@ thisPersistentAttributes = persistentAttributes; | ||
if (!options.persistenceAdapter) { | ||
throw ask_sdk_runtime_1.createAskSdkError('AttributesManager', 'Cannot save PersistentAttributes without persistence adapter!'); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('AttributesManager', 'Cannot save PersistentAttributes without persistence adapter!'); | ||
} | ||
@@ -88,3 +88,3 @@ if (persistentAttributesSet) { | ||
if (!options.persistenceAdapter) { | ||
throw ask_sdk_runtime_1.createAskSdkError('AttributesManager', 'Cannot delete PersistentAttributes without persistence adapter!'); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('AttributesManager', 'Cannot delete PersistentAttributes without persistence adapter!'); | ||
} | ||
@@ -91,0 +91,0 @@ await options.persistenceAdapter.deleteAttributes(options.requestEnvelope); |
@@ -6,2 +6,3 @@ export { AttributesManager } from './attributes/AttributesManager'; | ||
export { CustomSkillRequestHandler as RequestHandler } from './dispatcher/request/handler/CustomSkillRequestHandler'; | ||
export { DelegateToIntentHandler } from './dispatcher/request/handler/DelegateToIntentHandler'; | ||
export { HandlerInput } from './dispatcher/request/handler/HandlerInput'; | ||
@@ -28,1 +29,3 @@ export { CustomSkillRequestInterceptor as RequestInterceptor } from './dispatcher/request/interceptor/CustomSkillRequestInterceptor'; | ||
export { createAskSdkError, createAskSdkUserAgent, UserAgentManager } from 'ask-sdk-runtime'; | ||
export { ComponentInterface } from './components/ComponentInterface'; | ||
export { launchComponent, egressFromComponent } from './util/ComponentUtils'; |
@@ -15,4 +15,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.egressFromComponent = exports.launchComponent = exports.ComponentInterface = exports.UserAgentManager = exports.createAskSdkUserAgent = exports.createAskSdkError = exports.isNewSession = exports.getSupportedInterfaces = exports.getSlotValue = exports.getSlot = exports.getSimpleSlotValues = exports.getRequestType = exports.getRequest = exports.getLocale = exports.getIntentName = exports.getSlotValueV2 = exports.getDialogState = exports.getUserId = exports.getDeviceId = exports.getApiAccessToken = exports.getAccountLinkingAccessToken = exports.escapeXmlCharacters = exports.ViewportSizeGroupOrder = exports.ViewportDpiGroupOrder = exports.getViewportSizeGroup = exports.getViewportProfile = exports.getViewportOrientation = exports.getViewportDpiGroup = exports.SkillBuilders = exports.CustomSkillFactory = exports.BaseSkillFactory = exports.Skill = exports.DefaultApiClient = exports.TextContentHelper = exports.RichTextContentHelper = exports.ResponseFactory = exports.PlainTextContentHelper = exports.ImageHelper = exports.DelegateToIntentHandler = exports.AttributesManagerFactory = void 0; | ||
var AttributesManagerFactory_1 = require("./attributes/AttributesManagerFactory"); | ||
Object.defineProperty(exports, "AttributesManagerFactory", { enumerable: true, get: function () { return AttributesManagerFactory_1.AttributesManagerFactory; } }); | ||
var DelegateToIntentHandler_1 = require("./dispatcher/request/handler/DelegateToIntentHandler"); | ||
Object.defineProperty(exports, "DelegateToIntentHandler", { enumerable: true, get: function () { return DelegateToIntentHandler_1.DelegateToIntentHandler; } }); | ||
var ImageHelper_1 = require("./response/ImageHelper"); | ||
@@ -67,2 +70,7 @@ Object.defineProperty(exports, "ImageHelper", { enumerable: true, get: function () { return ImageHelper_1.ImageHelper; } }); | ||
Object.defineProperty(exports, "UserAgentManager", { enumerable: true, get: function () { return ask_sdk_runtime_1.UserAgentManager; } }); | ||
var ComponentInterface_1 = require("./components/ComponentInterface"); | ||
Object.defineProperty(exports, "ComponentInterface", { enumerable: true, get: function () { return ComponentInterface_1.ComponentInterface; } }); | ||
var ComponentUtils_1 = require("./util/ComponentUtils"); | ||
Object.defineProperty(exports, "launchComponent", { enumerable: true, get: function () { return ComponentUtils_1.launchComponent; } }); | ||
Object.defineProperty(exports, "egressFromComponent", { enumerable: true, get: function () { return ComponentUtils_1.egressFromComponent; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -58,8 +58,9 @@ "use strict"; | ||
reprompt(repromptSpeechOutput, playBehavior) { | ||
response.reprompt = { | ||
outputSpeech: { | ||
type: 'SSML', | ||
ssml: `<speak>${trimOutputSpeech(repromptSpeechOutput)}</speak>`, | ||
playBehavior, | ||
}, | ||
if (!response.reprompt) { | ||
response.reprompt = {}; | ||
} | ||
response.reprompt.outputSpeech = { | ||
type: 'SSML', | ||
ssml: `<speak>${trimOutputSpeech(repromptSpeechOutput)}</speak>`, | ||
playBehavior, | ||
}; | ||
@@ -66,0 +67,0 @@ if (!playBehavior) { |
@@ -60,3 +60,3 @@ "use strict"; | ||
clientRequest.on('error', (err) => { | ||
reject(ask_sdk_runtime_1.createAskSdkError(this.constructor.name, err.message)); | ||
reject((0, ask_sdk_runtime_1.createAskSdkError)(this.constructor.name, err.message)); | ||
}); | ||
@@ -63,0 +63,0 @@ if (request.body) { |
@@ -38,3 +38,3 @@ "use strict"; | ||
const packageInfo = require('../../package.json'); | ||
ask_sdk_runtime_1.UserAgentManager.registerComponent(ask_sdk_runtime_1.createAskSdkUserAgent(packageInfo.version)); | ||
ask_sdk_runtime_1.UserAgentManager.registerComponent((0, ask_sdk_runtime_1.createAskSdkUserAgent)(packageInfo.version)); | ||
if (this.customUserAgent) { | ||
@@ -51,3 +51,3 @@ ask_sdk_runtime_1.UserAgentManager.registerComponent(this.customUserAgent); | ||
if (this.skillId != null && requestEnvelope.context.System.application.applicationId !== this.skillId) { | ||
throw ask_sdk_runtime_1.createAskSdkError(this.constructor.name, 'CustomSkill ID verification failed!'); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)(this.constructor.name, 'CustomSkill ID verification failed!'); | ||
} | ||
@@ -54,0 +54,0 @@ const input = { |
@@ -7,3 +7,3 @@ import { RequestEnvelope } from 'ask-sdk-model'; | ||
*/ | ||
export declare type LambdaHandler = (requestEnvelope: RequestEnvelope, context: any, callback: (err: Error, result?: any) => void) => void; | ||
export type LambdaHandler = (requestEnvelope: RequestEnvelope, context: any, callback: (err: Error, result?: any) => void) => void; | ||
export declare class BaseSkillFactory { | ||
@@ -10,0 +10,0 @@ static init(): BaseSkillBuilder; |
@@ -1,2 +0,3 @@ | ||
import { DialogState, Request, RequestEnvelope, SimpleSlotValue, Slot, SlotValue, SupportedInterfaces } from 'ask-sdk-model'; | ||
import { DialogState, Request, RequestEnvelope, SimpleSlotValue, Slot, SlotValue, SupportedInterfaces, interfaces } from 'ask-sdk-model'; | ||
import APIRequest = interfaces.conversations.APIRequest; | ||
/** | ||
@@ -165,1 +166,10 @@ * Retrieves the locale from the request. | ||
export declare function isNewSession(requestEnvelope: RequestEnvelope): boolean; | ||
/** | ||
* Extracts slots from Dialog Api Request | ||
* | ||
* | ||
* @param {APIRequest} apiRequest | ||
*/ | ||
export declare function generateSlotsFromApiRequest(apiRequest: APIRequest): { | ||
[key: string]: Slot; | ||
}; |
@@ -15,3 +15,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isNewSession = exports.getSupportedInterfaces = exports.getSimpleSlotValues = exports.getSlotValueV2 = exports.getSlotValue = exports.getSlot = exports.getDialogState = exports.getUserId = exports.getDeviceId = exports.getApiAccessToken = exports.getAccountLinkingAccessToken = exports.getRequest = exports.getIntentName = exports.getRequestType = exports.getLocale = void 0; | ||
exports.generateSlotsFromApiRequest = exports.isNewSession = exports.getSupportedInterfaces = exports.getSimpleSlotValues = exports.getSlotValueV2 = exports.getSlotValue = exports.getSlot = exports.getDialogState = exports.getUserId = exports.getDeviceId = exports.getApiAccessToken = exports.getAccountLinkingAccessToken = exports.getRequest = exports.getIntentName = exports.getRequestType = exports.getLocale = void 0; | ||
const ask_sdk_runtime_1 = require("ask-sdk-runtime"); | ||
@@ -57,3 +57,3 @@ /** | ||
} | ||
throw ask_sdk_runtime_1.createAskSdkError('RequestEnvelopeUtils', `Expecting request type of IntentRequest but got ${getRequestType(requestEnvelope)}.`); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('RequestEnvelopeUtils', `Expecting request type of IntentRequest but got ${getRequestType(requestEnvelope)}.`); | ||
} | ||
@@ -152,3 +152,3 @@ exports.getIntentName = getIntentName; | ||
} | ||
throw ask_sdk_runtime_1.createAskSdkError('RequestEnvelopeUtils', `Expecting request type of IntentRequest but got ${getRequestType(requestEnvelope)}.`); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('RequestEnvelopeUtils', `Expecting request type of IntentRequest but got ${getRequestType(requestEnvelope)}.`); | ||
} | ||
@@ -174,3 +174,3 @@ exports.getDialogState = getDialogState; | ||
} | ||
throw ask_sdk_runtime_1.createAskSdkError('RequestEnvelopeUtils', `Expecting request type of IntentRequest but got ${getRequestType(requestEnvelope)}.`); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('RequestEnvelopeUtils', `Expecting request type of IntentRequest but got ${getRequestType(requestEnvelope)}.`); | ||
} | ||
@@ -196,3 +196,3 @@ exports.getSlot = getSlot; | ||
} | ||
throw ask_sdk_runtime_1.createAskSdkError('RequestEnvelopeUtils', `Expecting request type of IntentRequest but got ${getRequestType(requestEnvelope)}.`); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('RequestEnvelopeUtils', `Expecting request type of IntentRequest but got ${getRequestType(requestEnvelope)}.`); | ||
} | ||
@@ -265,5 +265,24 @@ exports.getSlotValue = getSlotValue; | ||
} | ||
throw ask_sdk_runtime_1.createAskSdkError('RequestEnvelopeUtils', `The provided request doesn't contain a session.`); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('RequestEnvelopeUtils', `The provided request doesn't contain a session.`); | ||
} | ||
exports.isNewSession = isNewSession; | ||
/** | ||
* Extracts slots from Dialog Api Request | ||
* | ||
* | ||
* @param {APIRequest} apiRequest | ||
*/ | ||
function generateSlotsFromApiRequest(apiRequest) { | ||
if (!apiRequest.slots) { | ||
return {}; | ||
} | ||
const intentSlots = {}; | ||
Object.keys(apiRequest.slots).forEach((slotKey) => { | ||
const slotValue = apiRequest.slots[slotKey]; | ||
const intentSlot = Object.assign(Object.assign({ name: slotKey, confirmationStatus: 'NONE' }, (slotValue.value ? { value: slotValue.value } : {})), (slotValue.resolutions ? { resolutions: slotValue.resolutions } : {})); | ||
intentSlots[slotKey] = intentSlot; | ||
}); | ||
return intentSlots; | ||
} | ||
exports.generateSlotsFromApiRequest = generateSlotsFromApiRequest; | ||
//# sourceMappingURL=RequestEnvelopeUtils.js.map |
import { RequestEnvelope } from 'ask-sdk-model'; | ||
export declare type ViewportProfile = 'HUB-ROUND-SMALL' | 'HUB-LANDSCAPE-SMALL' | 'HUB-LANDSCAPE-MEDIUM' | 'HUB-LANDSCAPE-LARGE' | 'MOBILE-LANDSCAPE-SMALL' | 'MOBILE-PORTRAIT-SMALL' | 'MOBILE-LANDSCAPE-MEDIUM' | 'MOBILE-PORTRAIT-MEDIUM' | 'TV-LANDSCAPE-XLARGE' | 'TV-PORTRAIT-MEDIUM' | 'TV-LANDSCAPE-MEDIUM' | 'UNKNOWN-VIEWPORT-PROFILE'; | ||
export declare type ViewportOrientation = 'EQUAL' | 'LANDSCAPE' | 'PORTRAIT'; | ||
export declare type ViewportSizeGroup = 'XSMALL' | 'SMALL' | 'MEDIUM' | 'LARGE' | 'XLARGE'; | ||
export declare type ViewportDpiGroup = 'XLOW' | 'LOW' | 'MEDIUM' | 'HIGH' | 'XHIGH' | 'XXHIGH'; | ||
export type ViewportProfile = 'HUB-ROUND-SMALL' | 'HUB-LANDSCAPE-SMALL' | 'HUB-LANDSCAPE-MEDIUM' | 'HUB-LANDSCAPE-LARGE' | 'MOBILE-LANDSCAPE-SMALL' | 'MOBILE-PORTRAIT-SMALL' | 'MOBILE-LANDSCAPE-MEDIUM' | 'MOBILE-PORTRAIT-MEDIUM' | 'TV-LANDSCAPE-XLARGE' | 'TV-PORTRAIT-MEDIUM' | 'TV-LANDSCAPE-MEDIUM' | 'UNKNOWN-VIEWPORT-PROFILE'; | ||
export type ViewportOrientation = 'EQUAL' | 'LANDSCAPE' | 'PORTRAIT'; | ||
export type ViewportSizeGroup = 'XSMALL' | 'SMALL' | 'MEDIUM' | 'LARGE' | 'XLARGE'; | ||
export type ViewportDpiGroup = 'XLOW' | 'LOW' | 'MEDIUM' | 'HIGH' | 'XHIGH' | 'XXHIGH'; | ||
export declare const ViewportSizeGroupOrder: ViewportSizeGroup[]; | ||
@@ -7,0 +7,0 @@ export declare const ViewportDpiGroupOrder: ViewportDpiGroup[]; |
@@ -54,3 +54,3 @@ "use strict"; | ||
} | ||
throw ask_sdk_runtime_1.createAskSdkError('ViewportUtils', `unknown size group value ${size}`); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('ViewportUtils', `unknown size group value ${size}`); | ||
} | ||
@@ -82,3 +82,3 @@ exports.getViewportSizeGroup = getViewportSizeGroup; | ||
} | ||
throw ask_sdk_runtime_1.createAskSdkError('ViewportUtils', `unknown dpi group value ${dpi}`); | ||
throw (0, ask_sdk_runtime_1.createAskSdkError)('ViewportUtils', `unknown dpi group value ${dpi}`); | ||
} | ||
@@ -85,0 +85,0 @@ exports.getViewportDpiGroup = getViewportDpiGroup; |
{ | ||
"name": "ask-sdk-core", | ||
"version": "2.12.1", | ||
"version": "2.14.0", | ||
"description": "Core package for Alexa Skills Kit SDK", | ||
@@ -32,3 +32,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"ask-sdk-runtime": "^2.12.0" | ||
"ask-sdk-runtime": "^2.14.0" | ||
}, | ||
@@ -55,3 +55,3 @@ "peerDependencies": { | ||
"ts-node": "^6.0.1", | ||
"typescript": "^3.5.3" | ||
"typescript": "^4.9.5" | ||
}, | ||
@@ -61,3 +61,3 @@ "repository": "github:alexa/alexa-skills-kit-sdk-for-nodejs", | ||
"homepage": "https://github.com/alexa/alexa-skill-sdk-for-nodejs#readme", | ||
"gitHead": "3849332e395b11ddeb1fb68a98aed1d2df026a04" | ||
"gitHead": "f2bc5744b5240e01cef9b6f797f49408af7d984b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186118
91
2668
Updatedask-sdk-runtime@^2.14.0