botbuilder
Advanced tools
Comparing version 4.0.0-m2.1 to 4.0.0-m2.2
@@ -34,2 +34,4 @@ /// <reference types="node" /> | ||
protected createInterface(options: readline.ReadLineOptions): readline.ReadLine; | ||
protected print(line: string): void; | ||
protected printError(line: string): void; | ||
} |
@@ -51,5 +51,5 @@ "use strict"; | ||
this.runMiddleware(context, logic) | ||
.catch((err) => { console.error(err.toString()); }); | ||
.catch((err) => { this.printError(err.toString()); }); | ||
}); | ||
return function quit() { | ||
return function close() { | ||
rl.close(); | ||
@@ -59,2 +59,3 @@ }; | ||
sendActivity(activities) { | ||
const that = this; | ||
return new Promise((resolve, reject) => { | ||
@@ -66,5 +67,5 @@ const responses = []; | ||
let a = activities[i]; | ||
switch (a.type || botbuilder_core_1.ActivityTypes.Message) { | ||
switch (a.type) { | ||
case 'delay': | ||
setTimeout(() => next(i + 1), a.value || 0); | ||
setTimeout(() => next(i + 1), a.value); | ||
break; | ||
@@ -74,6 +75,6 @@ case botbuilder_core_1.ActivityTypes.Message: | ||
const append = a.attachments.length == 1 ? `(1 attachment)` : `(${a.attachments.length} attachments)`; | ||
console.log(`${a.text || ''} ${append}`); | ||
that.print(`${a.text} ${append}`); | ||
} | ||
else { | ||
console.log(a.text || ''); | ||
that.print(a.text); | ||
} | ||
@@ -83,3 +84,3 @@ next(i + 1); | ||
default: | ||
console.log(`[${a.type}]`); | ||
that.print(`[${a.type}]`); | ||
next(i + 1); | ||
@@ -105,4 +106,10 @@ break; | ||
} | ||
print(line) { | ||
console.log(line); | ||
} | ||
printError(line) { | ||
console.error(line); | ||
} | ||
} | ||
exports.ConsoleAdapter = ConsoleAdapter; | ||
//# sourceMappingURL=consoleAdapter.js.map |
@@ -5,3 +5,3 @@ { | ||
"description": "Services for Microsoft BotBuilder.", | ||
"version": "4.0.0-m2.1", | ||
"version": "4.0.0-m2.2", | ||
"license": "MIT", | ||
@@ -24,6 +24,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@types/node": "^9.3.0", | ||
"@types/filenamify": "^2.0.1", | ||
"async-file": "^2.0.2", | ||
"botbuilder-core": "4.0.0-m2.1", | ||
"botbuilder-core-extensions": "4.0.0-m2.1", | ||
"botframework-connector": "4.0.0-m2.1", | ||
"botbuilder-core": "4.0.0-m2.2", | ||
"botbuilder-core-extensions": "4.0.0-m2.2", | ||
"botframework-connector": "4.0.0-m2.2", | ||
"filenamify": "^2.0.0", | ||
@@ -33,5 +35,3 @@ "readline": "^1.3.0" | ||
"devDependencies": { | ||
"@types/filenamify": "^2.0.1", | ||
"@types/mocha": "^2.2.47", | ||
"@types/node": "^9.3.0", | ||
"codelyzer": "^4.1.0", | ||
@@ -38,0 +38,0 @@ "mocha": "^5.0.0", |
@@ -54,5 +54,5 @@ /** | ||
this.runMiddleware(context, logic) | ||
.catch((err) => { console.error(err.toString()) }); | ||
.catch((err) => { this.printError(err.toString()) }); | ||
}); | ||
return function quit() { | ||
return function close() { | ||
rl.close(); | ||
@@ -63,2 +63,3 @@ } | ||
public sendActivity(activities: Partial<Activity>[]): Promise<ResourceResponse[]> { | ||
const that = this; | ||
return new Promise((resolve, reject) => { | ||
@@ -70,5 +71,5 @@ const responses: ResourceResponse[] = []; | ||
let a = activities[i]; | ||
switch (a.type || ActivityTypes.Message) { | ||
switch (a.type) { | ||
case <ActivityTypes>'delay': | ||
setTimeout(() => next(i + 1), a.value || 0); | ||
setTimeout(() => next(i + 1), a.value); | ||
break; | ||
@@ -78,5 +79,5 @@ case ActivityTypes.Message: | ||
const append = a.attachments.length == 1 ? `(1 attachment)` : `(${a.attachments.length} attachments)`; | ||
console.log(`${a.text || ''} ${append}`); | ||
that.print(`${a.text} ${append}`); | ||
} else { | ||
console.log(a.text || ''); | ||
that.print(a.text); | ||
} | ||
@@ -86,3 +87,3 @@ next(i + 1); | ||
default: | ||
console.log(`[${a.type}]`); | ||
that.print(`[${a.type}]`); | ||
next(i + 1); | ||
@@ -110,2 +111,10 @@ break; | ||
} | ||
protected print(line: string) { | ||
console.log(line); | ||
} | ||
protected printError(line: string) { | ||
console.error(line); | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
96249
6
22
1895
0
8
+ Added@types/filenamify@^2.0.1
+ Added@types/node@^9.3.0
+ Added@types/filenamify@2.0.2(transitive)
+ Added@types/jsonwebtoken@7.2.5(transitive)
+ Addedbotbuilder-core@4.0.0-m2.2(transitive)
+ Addedbotbuilder-core-extensions@4.0.0-m2.2(transitive)
+ Addedbotframework-connector@4.0.0-m2.2(transitive)
+ Addedbotframework-schema@4.0.0-m2.2(transitive)
- Removed@types/node@22.10.10(transitive)
- Removedbotbuilder-core@4.0.0-m2.1(transitive)
- Removedbotbuilder-core-extensions@4.0.0-m2.1(transitive)
- Removedbotframework-connector@4.0.0-m2.1(transitive)
- Removedbotframework-schema@4.0.0-m2.1(transitive)
- Removedundici-types@6.20.0(transitive)
Updatedbotbuilder-core@4.0.0-m2.2