ask-sdk-core
Advanced tools
Comparing version 2.7.0 to 2.8.0
@@ -6,2 +6,21 @@ # Change Log | ||
# [2.8.0](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/compare/v2.7.0...v2.8.0) (2020-04-01) | ||
### Bug Fixes | ||
* Export LambdaHandler type definition ([#615](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/615)) ([e4c2eaa](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/e4c2eaa857537c82ac909c3be09bc52d9a74a035)) | ||
* extend tslint test to cover all test files ([#588](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/588)) ([b142590](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/b142590b2d07ff141e599ee63129d81c71aa0f1c)) | ||
* fixed one type definition and some doc issues ([#583](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/583)) ([5cc2576](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/5cc257648a8aa6cbbaca65daac8a27d02ebbc89d)) | ||
### Features | ||
* add new util function (getRequest) ([#582](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/582)) ([a618ba9](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/a618ba92c30d1ffb0590d21d8ee6cf7e1e11ac15)) | ||
* optionally allow passing a boolean to getPersistentAttributes to cont… ([#547](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/547)) ([e62421c](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/commit/e62421c404a5b881a613c39c8766e7d152053a34)) | ||
# [2.7.0](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/compare/v2.6.0...v2.7.0) (2019-08-01) | ||
@@ -8,0 +27,0 @@ |
@@ -20,6 +20,7 @@ /** | ||
/** | ||
* Provides persistent attributes retrieved and cached from persistence adapter. | ||
* Provides persistent attributes retrieved and cached from persistence adapter, provide false to useSessionCache to ignore values cached from previous invocations. | ||
* @param {boolean} [useSessionCache=true] | ||
* @returns {Promise<Object.<string, any>>} | ||
*/ | ||
getPersistentAttributes(): Promise<{ | ||
getPersistentAttributes(useSessionCache?: boolean): Promise<{ | ||
[key: string]: any; | ||
@@ -26,0 +27,0 @@ }>; |
@@ -15,6 +15,7 @@ "use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -80,3 +81,4 @@ }); | ||
}, | ||
getPersistentAttributes: function () { | ||
getPersistentAttributes: function (useSessionCache) { | ||
if (useSessionCache === void 0) { useSessionCache = true; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -89,3 +91,3 @@ return __generator(this, function (_a) { | ||
} | ||
if (!!persistentAttributesSet) return [3 /*break*/, 2]; | ||
if (!(!persistentAttributesSet || !useSessionCache)) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, options.persistenceAdapter.getAttributes(options.requestEnvelope)]; | ||
@@ -92,0 +94,0 @@ case 1: |
@@ -18,3 +18,3 @@ export { AttributesManager } from './attributes/AttributesManager'; | ||
export { BaseSkillBuilder } from './skill/factory/BaseSkillBuilder'; | ||
export { BaseSkillFactory } from './skill/factory/BaseSkillFactory'; | ||
export { BaseSkillFactory, LambdaHandler } from './skill/factory/BaseSkillFactory'; | ||
export { CustomSkillBuilder } from './skill/factory/CustomSkillBuilder'; | ||
@@ -26,3 +26,3 @@ export { CustomSkillFactory } from './skill/factory/CustomSkillFactory'; | ||
export { escapeXmlCharacters, } from './util/SsmlUtils'; | ||
export { getAccountLinkingAccessToken, getApiAccessToken, getDeviceId, getUserId, getDialogState, getIntentName, getLocale, getRequestType, getSlot, getSlotValue, getSupportedInterfaces, isNewSession, } from './util/RequestEnvelopeUtils'; | ||
export { getAccountLinkingAccessToken, getApiAccessToken, getDeviceId, getUserId, getDialogState, getIntentName, getLocale, getRequest, getRequestType, getSlot, getSlotValue, getSupportedInterfaces, isNewSession, } from './util/RequestEnvelopeUtils'; | ||
export { createAskSdkError, createAskSdkUserAgent, } from 'ask-sdk-runtime'; |
@@ -54,2 +54,3 @@ "use strict"; | ||
exports.getLocale = RequestEnvelopeUtils_1.getLocale; | ||
exports.getRequest = RequestEnvelopeUtils_1.getRequest; | ||
exports.getRequestType = RequestEnvelopeUtils_1.getRequestType; | ||
@@ -56,0 +57,0 @@ exports.getSlot = RequestEnvelopeUtils_1.getSlot; |
@@ -15,6 +15,7 @@ "use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -21,0 +22,0 @@ }); |
@@ -94,3 +94,3 @@ "use strict"; | ||
var runtimeConfiguration = runtimeConfigurationBuilder.getRuntimeConfiguration(); | ||
return __assign({}, runtimeConfiguration, { customUserAgent: thisCustomUserAgent, skillId: thisSkillId }); | ||
return __assign(__assign({}, runtimeConfiguration), { customUserAgent: thisCustomUserAgent, skillId: thisSkillId }); | ||
}, | ||
@@ -97,0 +97,0 @@ create: function () { |
@@ -37,5 +37,5 @@ "use strict"; | ||
var baseSkillBuilder = BaseSkillFactory_1.BaseSkillFactory.init(); | ||
return __assign({}, baseSkillBuilder, { getSkillConfiguration: function () { | ||
return __assign(__assign({}, baseSkillBuilder), { getSkillConfiguration: function () { | ||
var skillConfiguration = baseSkillBuilder.getSkillConfiguration(); | ||
return __assign({}, skillConfiguration, { persistenceAdapter: thisPersistenceAdapter, apiClient: thisApiClient }); | ||
return __assign(__assign({}, skillConfiguration), { persistenceAdapter: thisPersistenceAdapter, apiClient: thisApiClient }); | ||
}, | ||
@@ -42,0 +42,0 @@ withPersistenceAdapter: function (persistenceAdapter) { |
@@ -1,2 +0,2 @@ | ||
import { RequestEnvelope, Slot, SupportedInterfaces } from 'ask-sdk-model'; | ||
import { Request, RequestEnvelope, Slot, SupportedInterfaces } from 'ask-sdk-model'; | ||
/** | ||
@@ -33,2 +33,15 @@ * Retrieves the locale from the request. | ||
/** | ||
* Get request object. | ||
* | ||
* We can set a specific type to the response by using the generics | ||
* @param {RequestEnvelope} requestEnvelope | ||
* @return {Request} | ||
* @example | ||
* ``` | ||
* const intentRequest = getRequest<IntentRequest>(requestEnvelope) | ||
* console.log(intentRequest.intent.name) | ||
* ``` | ||
*/ | ||
export declare function getRequest<T extends Request>(requestEnvelope: RequestEnvelope): T; | ||
/** | ||
* Retrieves the account linking access token from the request. | ||
@@ -35,0 +48,0 @@ * |
@@ -59,2 +59,18 @@ "use strict"; | ||
/** | ||
* Get request object. | ||
* | ||
* We can set a specific type to the response by using the generics | ||
* @param {RequestEnvelope} requestEnvelope | ||
* @return {Request} | ||
* @example | ||
* ``` | ||
* const intentRequest = getRequest<IntentRequest>(requestEnvelope) | ||
* console.log(intentRequest.intent.name) | ||
* ``` | ||
*/ | ||
function getRequest(requestEnvelope) { | ||
return requestEnvelope.request; | ||
} | ||
exports.getRequest = getRequest; | ||
/** | ||
* Retrieves the account linking access token from the request. | ||
@@ -61,0 +77,0 @@ * |
{ | ||
"name": "ask-sdk-core", | ||
"version": "2.7.0", | ||
"version": "2.8.0", | ||
"description": "Core package for Alexa Skills Kit SDK", | ||
@@ -27,3 +27,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"ask-sdk-runtime": "^2.7.0" | ||
"ask-sdk-runtime": "^2.8.0" | ||
}, | ||
@@ -53,3 +53,3 @@ "peerDependencies": { | ||
"homepage": "https://github.com/alexa/alexa-skill-sdk-for-nodejs#readme", | ||
"gitHead": "f985f07cb46abf232fa3449efee02df31dbad41d" | ||
"gitHead": "90f9500a5b0738889e8907a33acec74e4704aac0" | ||
} |
@@ -20,3 +20,3 @@ Core SDK package contains basic components and default implementations of ASK SDK v2 for Node.js. | ||
You can find a getting started guide [here](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/wiki). | ||
You can find a getting started guide [here](https://developer.amazon.com/docs/alexa-skills-kit-sdk-for-nodejs/overview.html). | ||
@@ -23,0 +23,0 @@ ## Usage with TypeScript |
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
167136
2495
Updatedask-sdk-runtime@^2.8.0