botbuilder
Advanced tools
Comparing version 4.0.0-m1.3 to 4.0.0-m1.4
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
import { TemplateRenderer } from './TemplateManager'; | ||
import { TemplateRenderer } from './templateManager'; | ||
import { Middleware } from './middleware'; | ||
@@ -11,0 +11,0 @@ import { Activity } from './activity'; |
@@ -29,13 +29,18 @@ "use strict"; | ||
function callMiddleware(set, i) { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.contextCreated !== undefined) { | ||
return plugin.contextCreated(context, () => callMiddleware(set, i + 1)); | ||
try { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.contextCreated !== undefined) { | ||
return plugin.contextCreated(context, () => callMiddleware(set, i + 1)); | ||
} | ||
else { | ||
return callMiddleware(set, i + 1); | ||
} | ||
} | ||
else { | ||
return callMiddleware(set, i + 1); | ||
return next(); | ||
} | ||
} | ||
else { | ||
return next(); | ||
catch (err) { | ||
return Promise.reject(err); | ||
} | ||
@@ -47,13 +52,18 @@ } | ||
function callMiddleware(set, i) { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.receiveActivity !== undefined) { | ||
return plugin.receiveActivity(context, () => callMiddleware(set, i + 1)); | ||
try { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.receiveActivity !== undefined) { | ||
return plugin.receiveActivity(context, () => callMiddleware(set, i + 1)); | ||
} | ||
else { | ||
return callMiddleware(set, i + 1); | ||
} | ||
} | ||
else { | ||
return callMiddleware(set, i + 1); | ||
return next(); | ||
} | ||
} | ||
else { | ||
return next(); | ||
catch (err) { | ||
return Promise.reject(err); | ||
} | ||
@@ -65,13 +75,18 @@ } | ||
function callMiddleware(set, i) { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.postActivity !== undefined) { | ||
return plugin.postActivity(context, activities, () => callMiddleware(set, i + 1)); | ||
try { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.postActivity !== undefined) { | ||
return plugin.postActivity(context, activities, () => callMiddleware(set, i + 1)); | ||
} | ||
else { | ||
return callMiddleware(set, i + 1); | ||
} | ||
} | ||
else { | ||
return callMiddleware(set, i + 1); | ||
return next(); | ||
} | ||
} | ||
else { | ||
return next(); | ||
catch (err) { | ||
return Promise.reject(err); | ||
} | ||
@@ -78,0 +93,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "Bot Builder core library. Bot Builder is a toolkit for building rich bots on virtually any platform.", | ||
"version": "4.0.0-m1.3", | ||
"version": "4.0.0-m1.4", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
import { TemplateRenderer } from './TemplateManager'; | ||
import { TemplateRenderer } from './templateManager'; | ||
import { Middleware } from './middleware'; | ||
@@ -11,0 +11,0 @@ import { BotService } from './botService'; |
@@ -38,11 +38,15 @@ /** | ||
function callMiddleware(set: Middleware[], i: number): Promise<void> { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.contextCreated !== undefined) { | ||
return plugin.contextCreated(context, () => callMiddleware(set, i + 1)) | ||
try { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.contextCreated !== undefined) { | ||
return plugin.contextCreated(context, () => callMiddleware(set, i + 1)) | ||
} else { | ||
return callMiddleware(set, i + 1); | ||
} | ||
} else { | ||
return callMiddleware(set, i + 1); | ||
return next(); | ||
} | ||
} else { | ||
return next(); | ||
} catch(err) { | ||
return Promise.reject(err); | ||
} | ||
@@ -55,11 +59,15 @@ } | ||
function callMiddleware(set: Middleware[], i: number): Promise<void> { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.receiveActivity !== undefined) { | ||
return plugin.receiveActivity(context, () => callMiddleware(set, i + 1)) | ||
try { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.receiveActivity !== undefined) { | ||
return plugin.receiveActivity(context, () => callMiddleware(set, i + 1)) | ||
} else { | ||
return callMiddleware(set, i + 1); | ||
} | ||
} else { | ||
return callMiddleware(set, i + 1); | ||
return next(); | ||
} | ||
} else { | ||
return next(); | ||
} catch(err) { | ||
return Promise.reject(err); | ||
} | ||
@@ -72,11 +80,15 @@ } | ||
function callMiddleware(set: Middleware[], i: number): Promise<ConversationResourceResponse[]> { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.postActivity !== undefined) { | ||
return plugin.postActivity(context, activities, () => callMiddleware(set, i + 1)) | ||
try { | ||
if (i < set.length) { | ||
const plugin = set[i]; | ||
if (plugin.postActivity !== undefined) { | ||
return plugin.postActivity(context, activities, () => callMiddleware(set, i + 1)) | ||
} else { | ||
return callMiddleware(set, i + 1); | ||
} | ||
} else { | ||
return callMiddleware(set, i + 1); | ||
return next(); | ||
} | ||
} else { | ||
return next(); | ||
} catch (err) { | ||
return Promise.reject(err); | ||
} | ||
@@ -83,0 +95,0 @@ } |
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
429524
9298