botbuilder
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
@@ -39,3 +38,4 @@ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
var authorized; | ||
if (_this.options.appId && _this.options.appSecret) { | ||
var isSecure = req.headers['x-forwarded-proto'] === 'https' || req.headers['x-arr-ssl']; | ||
if (isSecure && _this.options.appId && _this.options.appSecret) { | ||
if (req.headers && req.headers.hasOwnProperty('authorization')) { | ||
@@ -234,3 +234,3 @@ var tmp = req.headers['authorization'].split(' '); | ||
return BotConnectorBot; | ||
}(collection.DialogCollection)); | ||
})(collection.DialogCollection); | ||
exports.BotConnectorBot = BotConnectorBot; | ||
@@ -243,3 +243,3 @@ var BotConnectorSession = (function (_super) { | ||
return BotConnectorSession; | ||
}(session.Session)); | ||
})(session.Session); | ||
exports.BotConnectorSession = BotConnectorSession; |
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
@@ -8,5 +7,3 @@ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
var intent = require('./IntentDialog'); | ||
var utils = require('../utils'); | ||
var request = require('request'); | ||
var sprintf = require('sprintf-js'); | ||
var LuisDialog = (function (_super) { | ||
@@ -46,69 +43,3 @@ __extends(LuisDialog, _super); | ||
return LuisDialog; | ||
}(intent.IntentDialog)); | ||
})(intent.IntentDialog); | ||
exports.LuisDialog = LuisDialog; | ||
var LuisEntityResolver = (function () { | ||
function LuisEntityResolver() { | ||
} | ||
LuisEntityResolver.findEntity = function (entities, type) { | ||
for (var i = 0; i < entities.length; i++) { | ||
if (entities[i].type == type) { | ||
return entities[i]; | ||
} | ||
} | ||
return null; | ||
}; | ||
LuisEntityResolver.findAllEntities = function (entities, type) { | ||
var found = []; | ||
for (var i = 0; i < entities.length; i++) { | ||
if (entities[i].type == type) { | ||
found.push(entities[i]); | ||
} | ||
} | ||
return found; | ||
}; | ||
LuisEntityResolver.resolveDate = function (entities, timezoneOffset) { | ||
var now = new Date(); | ||
var date; | ||
var time; | ||
for (var i = 0; i < entities.length; i++) { | ||
var entity = entities[i]; | ||
if (entity.resolution) { | ||
switch (entity.resolution.resolution_type) { | ||
case 'builtin.datetime.date': | ||
if (!date) { | ||
date = entity.resolution.date; | ||
} | ||
break; | ||
case 'builtin.datetime.time': | ||
if (!time) { | ||
time = entity.resolution.time; | ||
if (time.length == 3) { | ||
time = time + ':00:00'; | ||
} | ||
else if (time.length == 6) { | ||
time = time + ':00'; | ||
} | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
if (date || time) { | ||
if (!date) { | ||
date = utils.toDate8601(now); | ||
} | ||
if (time) { | ||
if (typeof timezoneOffset !== 'number') { | ||
timezoneOffset = now.getTimezoneOffset() / 60; | ||
} | ||
date = sprintf.sprintf('%s%s%s%02d:00', date, time, (timezoneOffset > 0 ? '-' : '+'), timezoneOffset); | ||
} | ||
return new Date(date); | ||
} | ||
else { | ||
return null; | ||
} | ||
}; | ||
return LuisEntityResolver; | ||
}()); | ||
exports.LuisEntityResolver = LuisEntityResolver; |
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
@@ -134,3 +133,8 @@ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
this.send(); | ||
this.emit('quit'); | ||
if (r.error) { | ||
this.emit('error', r.error); | ||
} | ||
else { | ||
this.emit('quit'); | ||
} | ||
} | ||
@@ -203,3 +207,3 @@ return this; | ||
return Session; | ||
}(events.EventEmitter)); | ||
})(events.EventEmitter); | ||
exports.Session = Session; | ||
@@ -245,2 +249,2 @@ var SessionConfidenceComparor = (function () { | ||
return SessionConfidenceComparor; | ||
}()); | ||
})(); |
@@ -5,3 +5,3 @@ { | ||
"description": "Bot Builder is a dialog system for building rich bots on virtually any platform.", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
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
171074
3916