Skip to content

Commit

Permalink
Updated to support TypeScript 2.1
Browse files Browse the repository at this point in the history
- Published new 3.5.3 release.
  • Loading branch information
Stevenic committed Jan 10, 2017
1 parent f2c9341 commit 05aeafd
Show file tree
Hide file tree
Showing 38 changed files with 264 additions and 251 deletions.
12 changes: 6 additions & 6 deletions Node/core/lib/DefaultLocalizer.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use strict";
var logger = require('./logger');
var consts = require('./consts');
var fs = require('fs');
var async = require('async');
var Promise = require('promise');
var path = require('path');
var logger = require("./logger");
var consts = require("./consts");
var fs = require("fs");
var async = require("async");
var Promise = require("promise");
var path = require("path");
var DefaultLocalizer = (function () {
function DefaultLocalizer(root, defaultLocale) {
this.localePaths = [];
Expand Down
12 changes: 6 additions & 6 deletions Node/core/lib/Message.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use strict";
var HeroCard_1 = require('./cards/HeroCard');
var CardImage_1 = require('./cards/CardImage');
var CardAction_1 = require('./cards/CardAction');
var utils = require('./utils');
var consts = require('./consts');
var sprintf = require('sprintf-js');
var HeroCard_1 = require("./cards/HeroCard");
var CardImage_1 = require("./cards/CardImage");
var CardAction_1 = require("./cards/CardAction");
var utils = require("./utils");
var consts = require("./consts");
var sprintf = require("sprintf-js");
exports.TextFormat = {
plain: 'plain',
markdown: 'markdown',
Expand Down
49 changes: 25 additions & 24 deletions Node/core/lib/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@ var __extends = (this && this.__extends) || function (d, b) {
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Dialog_1 = require('./dialogs/Dialog');
var Message_1 = require('./Message');
var consts = require('./consts');
var logger = require('./logger');
var sprintf = require('sprintf-js');
var events = require('events');
var Dialog_1 = require("./dialogs/Dialog");
var Message_1 = require("./Message");
var consts = require("./consts");
var logger = require("./logger");
var sprintf = require("sprintf-js");
var events = require("events");
var Session = (function (_super) {
__extends(Session, _super);
function Session(options) {
_super.call(this);
this.options = options;
this.msgSent = false;
this._isReset = false;
this.lastSendTime = new Date().getTime();
this.batch = [];
this.batchStarted = false;
this.sendingBatch = false;
this.inMiddleware = false;
this._locale = null;
this.localizer = null;
this.library = options.library;
this.localizer = options.localizer;
if (typeof this.options.autoBatchDelay !== 'number') {
this.options.autoBatchDelay = 250;
}
var _this = _super.call(this) || this;
_this.options = options;
_this.msgSent = false;
_this._isReset = false;
_this.lastSendTime = new Date().getTime();
_this.batch = [];
_this.batchStarted = false;
_this.sendingBatch = false;
_this.inMiddleware = false;
_this._locale = null;
_this.localizer = null;
_this.library = options.library;
_this.localizer = options.localizer;
if (typeof _this.options.autoBatchDelay !== 'number') {
_this.options.autoBatchDelay = 250;
}
return _this;
}
Session.prototype.toRecognizeContext = function () {
var _this = this;
Expand All @@ -43,14 +44,14 @@ var Session = (function (_super) {
gettext: function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
args[_i] = arguments[_i];
}
return Session.prototype.gettext.call(_this, args);
},
ngettext: function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
args[_i] = arguments[_i];
}
return Session.prototype.ngettext.call(_this, args);
},
Expand Down
66 changes: 33 additions & 33 deletions Node/core/lib/botbuilder.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
"use strict";
var Session = require('./Session');
var Message = require('./Message');
var Dialog = require('./dialogs/Dialog');
var DialogAction = require('./dialogs/DialogAction');
var Prompts = require('./dialogs/Prompts');
var SimpleDialog = require('./dialogs/SimpleDialog');
var EntityRecognizer = require('./dialogs/EntityRecognizer');
var Library = require('./bots/Library');
var UniversalBot = require('./bots/UniversalBot');
var ChatConnector = require('./bots/ChatConnector');
var ConsoleConnector = require('./bots/ConsoleConnector');
var BotStorage = require('./storage/BotStorage');
var CardAction = require('./cards/CardAction');
var HeroCard = require('./cards/HeroCard');
var CardImage = require('./cards/CardImage');
var ReceiptCard = require('./cards/ReceiptCard');
var SigninCard = require('./cards/SigninCard');
var ThumbnailCard = require('./cards/ThumbnailCard');
var VideoCard = require('./cards/VideoCard');
var AudioCard = require('./cards/AudioCard');
var AnimationCard = require('./cards/AnimationCard');
var MediaCard = require('./cards/MediaCard');
var CardMedia = require('./cards/CardMedia');
var Keyboard = require('./cards/Keyboard');
var Middleware = require('./middleware/Middleware');
var IntentRecognizerSet = require('./dialogs/IntentRecognizerSet');
var RegExpRecognizer = require('./dialogs/RegExpRecognizer');
var LuisRecognizer = require('./dialogs/LuisRecognizer');
var IntentDialog = require('./dialogs/IntentDialog');
var Session = require("./Session");
var Message = require("./Message");
var Dialog = require("./dialogs/Dialog");
var DialogAction = require("./dialogs/DialogAction");
var Prompts = require("./dialogs/Prompts");
var SimpleDialog = require("./dialogs/SimpleDialog");
var EntityRecognizer = require("./dialogs/EntityRecognizer");
var Library = require("./bots/Library");
var UniversalBot = require("./bots/UniversalBot");
var ChatConnector = require("./bots/ChatConnector");
var ConsoleConnector = require("./bots/ConsoleConnector");
var BotStorage = require("./storage/BotStorage");
var CardAction = require("./cards/CardAction");
var HeroCard = require("./cards/HeroCard");
var CardImage = require("./cards/CardImage");
var ReceiptCard = require("./cards/ReceiptCard");
var SigninCard = require("./cards/SigninCard");
var ThumbnailCard = require("./cards/ThumbnailCard");
var VideoCard = require("./cards/VideoCard");
var AudioCard = require("./cards/AudioCard");
var AnimationCard = require("./cards/AnimationCard");
var MediaCard = require("./cards/MediaCard");
var CardMedia = require("./cards/CardMedia");
var Keyboard = require("./cards/Keyboard");
var Middleware = require("./middleware/Middleware");
var IntentRecognizerSet = require("./dialogs/IntentRecognizerSet");
var RegExpRecognizer = require("./dialogs/RegExpRecognizer");
var LuisRecognizer = require("./dialogs/LuisRecognizer");
var IntentDialog = require("./dialogs/IntentDialog");
exports.Session = Session.Session;
exports.Message = Message.Message;
exports.AttachmentLayout = Message.AttachmentLayout;
Expand Down Expand Up @@ -67,10 +67,10 @@ exports.ChatConnector = ChatConnector.ChatConnector;
exports.ConsoleConnector = ConsoleConnector.ConsoleConnector;
exports.MemoryBotStorage = BotStorage.MemoryBotStorage;
exports.Middleware = Middleware.Middleware;
var deprecatedBCB = require('./deprecated/BotConnectorBot');
var deprecatedLD = require('./deprecated/LuisDialog');
var deprecatedCD = require('./deprecated/CommandDialog');
var deprecatedTB = require('./deprecated/TextBot');
var deprecatedBCB = require("./deprecated/BotConnectorBot");
var deprecatedLD = require("./deprecated/LuisDialog");
var deprecatedCD = require("./deprecated/CommandDialog");
var deprecatedTB = require("./deprecated/TextBot");
exports.BotConnectorBot = deprecatedBCB.BotConnectorBot;
exports.LuisDialog = deprecatedLD.LuisDialog;
exports.CommandDialog = deprecatedCD.CommandDialog;
Expand Down
25 changes: 13 additions & 12 deletions Node/core/lib/bots/ChatConnector.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
"use strict";
var OpenIdMetadata_1 = require('./OpenIdMetadata');
var utils = require('../utils');
var logger = require('../logger');
var consts = require('../consts');
var request = require('request');
var async = require('async');
var url = require('url');
var jwt = require('jsonwebtoken');
var zlib = require('zlib');
var OpenIdMetadata_1 = require("./OpenIdMetadata");
var utils = require("../utils");
var logger = require("../logger");
var consts = require("../consts");
var request = require("request");
var async = require("async");
var url = require("url");
var jwt = require("jsonwebtoken");
var zlib = require("zlib");
var urlJoin = require("url-join");
var pjson = require('../../package.json');
var MAX_DATA_LENGTH = 65000;
var USER_AGENT = "Microsoft-BotFramework/3.0 (BotBuilder Node.js/" + pjson.version + ")";
var USER_AGENT = "Microsoft-BotFramework/3.1 (BotBuilder Node.js/" + pjson.version + ")";
var ChatConnector = (function () {
function ChatConnector(settings) {
if (settings === void 0) { settings = {}; }
Expand Down Expand Up @@ -155,7 +156,7 @@ var ChatConnector = (function () {
if (address && address.user && address.bot && address.serviceUrl) {
var options = {
method: 'POST',
url: url.resolve(address.serviceUrl, '/v3/conversations'),
url: urlJoin(address.serviceUrl, '/v3/conversations'),
body: {
bot: address.bot,
members: [address.user]
Expand Down Expand Up @@ -387,7 +388,7 @@ var ChatConnector = (function () {
}
var options = {
method: 'POST',
url: url.resolve(address.serviceUrl, path),
url: urlJoin(address.serviceUrl, path),
body: msg,
json: true
};
Expand Down
6 changes: 3 additions & 3 deletions Node/core/lib/bots/ConsoleConnector.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
var Message_1 = require('../Message');
var utils = require('../utils');
var readline = require('readline');
var Message_1 = require("../Message");
var utils = require("../utils");
var readline = require("readline");
var ConsoleConnector = (function () {
function ConsoleConnector() {
this.replyCnt = 0;
Expand Down
45 changes: 23 additions & 22 deletions Node/core/lib/bots/Library.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@ var __extends = (this && this.__extends) || function (d, b) {
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var SimpleDialog_1 = require('../dialogs/SimpleDialog');
var ActionSet_1 = require('../dialogs/ActionSet');
var IntentRecognizerSet_1 = require('../dialogs/IntentRecognizerSet');
var Session_1 = require('../Session');
var consts = require('../consts');
var utils = require('../utils');
var logger = require('../logger');
var events_1 = require('events');
var path = require('path');
var async = require('async');
var SimpleDialog_1 = require("../dialogs/SimpleDialog");
var ActionSet_1 = require("../dialogs/ActionSet");
var IntentRecognizerSet_1 = require("../dialogs/IntentRecognizerSet");
var Session_1 = require("../Session");
var consts = require("../consts");
var utils = require("../utils");
var logger = require("../logger");
var events_1 = require("events");
var path = require("path");
var async = require("async");
var Library = (function (_super) {
__extends(Library, _super);
function Library(name) {
_super.call(this);
this.name = name;
this.dialogs = {};
this.libraries = {};
this.actions = new ActionSet_1.ActionSet();
this.recognizers = new IntentRecognizerSet_1.IntentRecognizerSet();
this.triggersAdded = false;
var _this = _super.call(this) || this;
_this.name = name;
_this.dialogs = {};
_this.libraries = {};
_this.actions = new ActionSet_1.ActionSet();
_this.recognizers = new IntentRecognizerSet_1.IntentRecognizerSet();
_this.triggersAdded = false;
return _this;
}
Library.prototype.clone = function (copyTo, newName) {
var obj = copyTo || new Library(newName || this.name);
Expand Down Expand Up @@ -436,13 +437,13 @@ var Library = (function (_super) {
this.actions.endConversationAction(name, msg, options);
return this;
};
Library.RouteTypes = {
GlobalAction: 'GlobalAction',
StackAction: 'StackAction',
ActiveDialog: 'ActiveDialog'
};
return Library;
}(events_1.EventEmitter));
Library.RouteTypes = {
GlobalAction: 'GlobalAction',
StackAction: 'StackAction',
ActiveDialog: 'ActiveDialog'
};
exports.Library = Library;
exports.systemLib = new Library(consts.Library.system);
exports.systemLib.localePath(path.join(__dirname, '../locale/'));
4 changes: 2 additions & 2 deletions Node/core/lib/bots/OpenIdMetadata.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
var logger = require('../logger');
var request = require('request');
var logger = require("../logger");
var request = require("request");
var getPem = require('rsa-pem-from-mod-exp');
var base64url = require('base64url');
var OpenIdMetadata = (function () {
Expand Down
Loading

0 comments on commit 05aeafd

Please sign in to comment.