ask-sdk-express-adapter
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -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 @@ }); |
@@ -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 @@ }); |
@@ -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()); | ||
@@ -89,8 +90,16 @@ }); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var signatureCertChainUrl, signature, pemCert, err_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var signatureCertChainUrl, signature, _i, _a, key, keyInLowerCase, pemCert, err_1; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
signatureCertChainUrl = headers[SIGNATURE_CERT_CHAIN_URL_HEADER.toLowerCase()]; | ||
signature = headers[SIGNATURE_HEADER.toLowerCase()]; | ||
for (_i = 0, _a = Object.keys(headers); _i < _a.length; _i++) { | ||
key = _a[_i]; | ||
keyInLowerCase = key.toLocaleLowerCase(); | ||
if (keyInLowerCase === SIGNATURE_CERT_CHAIN_URL_HEADER.toLowerCase()) { | ||
signatureCertChainUrl = headers[key]; | ||
} | ||
else if (keyInLowerCase === SIGNATURE_HEADER.toLowerCase()) { | ||
signature = headers[key]; | ||
} | ||
} | ||
if (!signatureCertChainUrl) { | ||
@@ -102,12 +111,12 @@ throw ask_sdk_core_1.createAskSdkError(this.constructor.name, 'Missing Certificate for the skill request'); | ||
} | ||
_a.label = 1; | ||
_b.label = 1; | ||
case 1: | ||
_a.trys.push([1, 3, , 4]); | ||
_b.trys.push([1, 3, , 4]); | ||
return [4 /*yield*/, this._validateUrlAndRetriveCertChain(signatureCertChainUrl)]; | ||
case 2: | ||
pemCert = _a.sent(); | ||
pemCert = _b.sent(); | ||
this._validateRequestBody(pemCert, signature, requestEnvelope); | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
err_1 = _a.sent(); | ||
err_1 = _b.sent(); | ||
throw ask_sdk_core_1.createAskSdkError(this.constructor.name, err_1.message); | ||
@@ -114,0 +123,0 @@ case 4: return [2 /*return*/]; |
{ | ||
"name": "ask-sdk-express-adapter", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Express adapter package for Alexa Skills Kit SDK", | ||
@@ -40,3 +40,3 @@ "main": "dist/index.js", | ||
"ask-sdk-core": "^2.7.0", | ||
"ask-sdk-model": "^1.18.0", | ||
"ask-sdk-model": "^1.9.0", | ||
"chai": "^4.1.2", | ||
@@ -43,0 +43,0 @@ "del": "^3.0.0", |
ASK SDK Express Adapter package is an extension package, that will let skill developers | ||
use [ASK SDK](https://ask-sdk-for-nodejs.readthedocs.io/en/latest/) | ||
use [ASK SDK](https://developer.amazon.com/docs/alexa-skills-kit-sdk-for-nodejs/overview.html) | ||
package in their express application. It provides an easy way to register and | ||
@@ -26,3 +26,3 @@ use [skills as custom webservices](https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-a-web-service.html). | ||
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/host-web-service.html). | ||
@@ -29,0 +29,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
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
62748
746