botframework-webchat-core
Advanced tools
Comparing version 4.0.0-preview.0b132c8 to 4.0.0-preview.17b9195
@@ -23,4 +23,3 @@ "use strict"; | ||
var directLine = _ref.directLine, | ||
userID = _ref.userID, | ||
username = _ref.username; | ||
userID = _ref.userID; | ||
return { | ||
@@ -30,7 +29,6 @@ type: CONNECT, | ||
directLine: directLine, | ||
userID: userID, | ||
username: username | ||
userID: userID | ||
} | ||
}; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hY3Rpb25zL2Nvbm5lY3QuanMiXSwibmFtZXMiOlsiQ09OTkVDVCIsIkNPTk5FQ1RfUEVORElORyIsIkNPTk5FQ1RfUkVKRUNURUQiLCJDT05ORUNUX0ZVTEZJTExFRCIsImRpcmVjdExpbmUiLCJ1c2VySUQiLCJ1c2VybmFtZSIsInR5cGUiLCJwYXlsb2FkIl0sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFNQSxVQUFVLHFCQUFoQjs7QUFDQSxJQUFNQyw0QkFBc0JELE9BQXRCLGFBQU47O0FBQ0EsSUFBTUUsNkJBQXVCRixPQUF2QixjQUFOOztBQUNBLElBQU1HLDhCQUF3QkgsT0FBeEIsZUFBTjs7O0FBRWUsd0JBQTRDO0FBQUEsTUFBaENJLFVBQWdDLFFBQWhDQSxVQUFnQztBQUFBLE1BQXBCQyxNQUFvQixRQUFwQkEsTUFBb0I7QUFBQSxNQUFaQyxRQUFZLFFBQVpBLFFBQVk7QUFDekQsU0FBTztBQUNMQyxVQUFNUCxPQUREO0FBRUxRLGFBQVM7QUFBRUosNEJBQUY7QUFBY0Msb0JBQWQ7QUFBc0JDO0FBQXRCO0FBRkosR0FBUDtBQUlEIiwic291cmNlc0NvbnRlbnQiOlsiLy8gVE9ETzogW1A0XSBNYXJrIGFjdGlvbnMgd2l0aCBjb3JyZWN0IGZ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GVUxGSUxMRURgO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiAoeyBkaXJlY3RMaW5lLCB1c2VySUQgfSkge1xuICByZXR1cm4ge1xuICAgIHR5cGU6IENPTk5FQ1QsXG4gICAgcGF5bG9hZDogeyBkaXJlY3RMaW5lLCB1c2VySUQgfVxuICB9O1xufVxuXG5leHBvcnQge1xuICBDT05ORUNULFxuICBDT05ORUNUX1BFTkRJTkcsXG4gIENPTk5FQ1RfUkVKRUNURUQsXG4gIENPTk5FQ1RfRlVMRklMTEVEXG59XG4iXX0= |
@@ -14,2 +14,4 @@ "use strict"; | ||
var _jsonwebtoken = require("jsonwebtoken"); | ||
var _callUntil = _interopRequireDefault(require("./effects/callUntil")); | ||
@@ -41,5 +43,6 @@ | ||
var ENDED = 5; | ||
var DEFAULT_USER_ID = 'default-user'; | ||
function _callee() { | ||
var _ref, _ref$payload, directLine, userID, username, connectTask; | ||
var _ref, _ref$payload, directLine, userID, token, _ref2, userIDFromToken, connectTask; | ||
@@ -58,20 +61,33 @@ return _regenerator.default.wrap(function _callee$(_context) { | ||
userID = _ref$payload.userID; | ||
username = _ref$payload.username; | ||
_context.next = 9; | ||
return (0, _effects.fork)(connectSaga, directLine, userID, username); | ||
token = directLine.token; | ||
_ref2 = (0, _jsonwebtoken.decode)(token) || {}, userIDFromToken = _ref2.user; | ||
case 9: | ||
if (userIDFromToken) { | ||
if (userID && userID !== userIDFromToken) { | ||
console.warn('Web Chat: user ID is both specified in the Direct Line token and passed in, will use the user ID from the token.'); | ||
} | ||
userID = userIDFromToken; | ||
} else if (!userID) { | ||
// Only specify "default-user" if not found from token and not passed in | ||
userID = DEFAULT_USER_ID; | ||
} | ||
_context.next = 11; | ||
return (0, _effects.fork)(connectSaga, directLine, userID); | ||
case 11: | ||
connectTask = _context.sent; | ||
_context.next = 12; | ||
_context.next = 14; | ||
return (0, _effects.take)(_disconnect.DISCONNECT); | ||
case 12: | ||
_context.next = 14; | ||
case 14: | ||
_context.next = 16; | ||
return (0, _effects.call)(disconnectSaga, connectTask, directLine); | ||
case 14: | ||
case 16: | ||
_context.next = 0; | ||
break; | ||
case 16: | ||
case 18: | ||
case "end": | ||
@@ -84,3 +100,3 @@ return _context.stop(); | ||
function connectSaga(directLine, userID, username) { | ||
function connectSaga(directLine, userID) { | ||
var meta, connectionStatusQueue, connectionStatusSubscription, activitySubscription; | ||
@@ -92,4 +108,3 @@ return _regenerator.default.wrap(function connectSaga$(_context2) { | ||
meta = { | ||
userID: userID, | ||
username: username | ||
userID: userID | ||
}; | ||
@@ -266,2 +281,2 @@ _context2.next = 3; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zYWdhcy9jb25uZWN0U2FnYS5qcyJdLCJuYW1lcyI6WyJjb25uZWN0U2FnYSIsImRpc2Nvbm5lY3RTYWdhIiwiT05MSU5FIiwiRU5ERUQiLCJDT05ORUNUIiwicGF5bG9hZCIsImRpcmVjdExpbmUiLCJ1c2VySUQiLCJ1c2VybmFtZSIsImNvbm5lY3RUYXNrIiwiRElTQ09OTkVDVCIsIm1ldGEiLCJ0eXBlIiwiQ09OTkVDVF9QRU5ESU5HIiwiY29ubmVjdGlvblN0YXR1c1F1ZXVlIiwiY29ubmVjdGlvblN0YXR1c1N1YnNjcmlwdGlvbiIsImNvbm5lY3Rpb25TdGF0dXMkIiwic3Vic2NyaWJlIiwibmV4dCIsInB1c2giLCJhY3Rpdml0eVN1YnNjcmlwdGlvbiIsImFjdGl2aXR5JCIsInNoaWZ0IiwiY29ubmVjdGlvblN0YXR1cyIsIkNPTk5FQ1RfRlVMRklMTEVEIiwiQ09OTkVDVF9SRUpFQ1RFRCIsImVycm9yIiwiRXJyb3IiLCJlbmQiLCJ1bnN1YnNjcmliZSIsIkRJU0NPTk5FQ1RfUEVORElORyIsIkRJU0NPTk5FQ1RfRlVMRklMTEVEIiwiRElTQ09OTkVDVF9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WJzY3JpYmUoKTtcbiAgfVxufVxuIl19 |
@@ -22,3 +22,3 @@ "use strict"; | ||
_regenerator.default.mark(function _callee() { | ||
var _ref, _ref$meta, userID, username, directLine, task; | ||
var _ref, userID, directLine, task; | ||
@@ -34,23 +34,21 @@ return _regenerator.default.wrap(function _callee$(_context) { | ||
_ref = _context.sent; | ||
_ref$meta = _ref.meta; | ||
userID = _ref$meta.userID; | ||
username = _ref$meta.username; | ||
userID = _ref.meta.userID; | ||
directLine = _ref.payload.directLine; | ||
_context.next = 9; | ||
return (0, _effects.fork)(fn, directLine, userID, username); | ||
_context.next = 7; | ||
return (0, _effects.fork)(fn, directLine, userID); | ||
case 9: | ||
case 7: | ||
task = _context.sent; | ||
_context.next = 12; | ||
_context.next = 10; | ||
return (0, _effects.take)(_disconnect.DISCONNECT_FULFILLED); | ||
case 12: | ||
_context.next = 14; | ||
case 10: | ||
_context.next = 12; | ||
return (0, _effects.cancel)(task); | ||
case 14: | ||
case 12: | ||
_context.next = 0; | ||
break; | ||
case 16: | ||
case 14: | ||
case "end": | ||
@@ -63,2 +61,2 @@ return _context.stop(); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zYWdhcy9lZmZlY3RzL3doaWxlQ29ubmVjdGVkLmpzIl0sIm5hbWVzIjpbImZuIiwiQ09OTkVDVF9GVUxGSUxMRUQiLCJtZXRhIiwidXNlcklEIiwidXNlcm5hbWUiLCJkaXJlY3RMaW5lIiwicGF5bG9hZCIsInRhc2siLCJESVNDT05ORUNUX0ZVTEZJTExFRCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFBQTs7QUFPQTs7QUFDQTs7QUFFZSxrQkFBVUEsRUFBVixFQUFjO0FBQzNCLFNBQU87QUFBQTtBQUFBLDRCQUFLO0FBQUE7O0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUV3RCxt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UFBUDtBQVNEIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgY2FsbCxcbiAgY2FuY2VsLFxuICBmb3JrLFxuICB0YWtlXG59IGZyb20gJ3JlZHV4LXNhZ2EvZWZmZWN0cyc7XG5cbmltcG9ydCB7IENPTk5FQ1RfRlVMRklMTEVEIH0gZnJvbSAnLi4vLi4vYWN0aW9ucy9jb25uZWN0JztcbmltcG9ydCB7IERJU0NPTk5FQ1RfRlVMRklMTEVEIH0gZnJvbSAnLi4vLi4vYWN0aW9ucy9kaXNjb25uZWN0JztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gKGZuKSB7XG4gIHJldHVybiBjYWxsKGZ1bmN0aW9uKiAoKSB7XG4gICAgZm9yICg7Oykge1xuICAgICAgY29uc3QgeyBtZXRhOiB7IHVzZXJJRCB9LCBwYXlsb2FkOiB7IGRpcmVjdExpbmUgfSB9ID0geWllbGQgdGFrZShDT05ORUNUX0ZVTEZJTExFRCk7XG4gICAgICBjb25zdCB0YXNrID0geWllbGQgZm9yayhmbiwgZGlyZWN0TGluZSwgdXNlcklEKTtcblxuICAgICAgeWllbGQgdGFrZShESVNDT05ORUNUX0ZVTEZJTExFRCk7XG4gICAgICB5aWVsZCBjYW5jZWwodGFzayk7XG4gICAgfVxuICB9KTtcbn1cbiJdfQ== |
{ | ||
"name": "botframework-webchat-core", | ||
"version": "4.0.0-preview.0b132c8", | ||
"version": "4.0.0-preview.17b9195", | ||
"description": "Core of botframework-webchat", | ||
@@ -60,2 +60,3 @@ "main": "lib/index.js", | ||
"event-as-promise": "^1.0.3", | ||
"jsonwebtoken": "^8.3.0", | ||
"redux": "^4.0.0", | ||
@@ -62,0 +63,0 @@ "redux-promise-middleware": "^5.1.1", |
@@ -10,6 +10,6 @@ // TODO: [P4] Mark actions with correct family | ||
export default function ({ directLine, userID, username }) { | ||
export default function ({ directLine, userID }) { | ||
return { | ||
type: CONNECT, | ||
payload: { directLine, userID, username } | ||
payload: { directLine, userID } | ||
}; | ||
@@ -16,0 +16,0 @@ } |
@@ -10,2 +10,4 @@ import { | ||
import { decode } from 'jsonwebtoken'; | ||
import callUntil from './effects/callUntil'; | ||
@@ -37,7 +39,23 @@ import forever from './effects/forever'; | ||
const DEFAULT_USER_ID = 'default-user'; | ||
export default function* () { | ||
for (;;) { | ||
const { payload: { directLine, userID, username } } = yield take(CONNECT); | ||
const connectTask = yield fork(connectSaga, directLine, userID, username); | ||
const { payload: { directLine, userID } } = yield take(CONNECT); | ||
const { token } = directLine; | ||
const { user: userIDFromToken } = decode(token) || {}; | ||
if (userIDFromToken) { | ||
if (userID && userID !== userIDFromToken) { | ||
console.warn('Web Chat: user ID is both specified in the Direct Line token and passed in, will use the user ID from the token.'); | ||
} | ||
userID = userIDFromToken; | ||
} else if (!userID) { | ||
// Only specify "default-user" if not found from token and not passed in | ||
userID = DEFAULT_USER_ID; | ||
} | ||
const connectTask = yield fork(connectSaga, directLine, userID); | ||
yield take(DISCONNECT); | ||
@@ -48,4 +66,4 @@ yield call(disconnectSaga, connectTask, directLine); | ||
function* connectSaga(directLine, userID, username) { | ||
const meta = { userID, username }; | ||
function* connectSaga(directLine, userID) { | ||
const meta = { userID }; | ||
@@ -52,0 +70,0 @@ yield put({ type: CONNECT_PENDING, meta }); |
@@ -14,4 +14,4 @@ import { | ||
for (;;) { | ||
const { meta: { userID, username }, payload: { directLine } } = yield take(CONNECT_FULFILLED); | ||
const task = yield fork(fn, directLine, userID, username); | ||
const { meta: { userID }, payload: { directLine } } = yield take(CONNECT_FULFILLED); | ||
const task = yield fork(fn, directLine, userID); | ||
@@ -18,0 +18,0 @@ yield take(DISCONNECT_FULFILLED); |
@@ -14,4 +14,3 @@ import createFacility from './createFacility'; | ||
directLine, | ||
userID: 'default-user', | ||
username: 'WC' | ||
userID: 'default-user' | ||
} | ||
@@ -18,0 +17,0 @@ }); |
@@ -7,3 +7,2 @@ import mockDirectLine from './mockDirectLine'; | ||
const DEFAULT_USER_ID = 'default-user'; | ||
const DEFAULT_USERNAME = 'John Doe'; | ||
@@ -52,4 +51,3 @@ jest.mock('../src/util/getTimestamp', () => { | ||
directLine, | ||
userID: DEFAULT_USER_ID, | ||
username: DEFAULT_USERNAME | ||
userID: DEFAULT_USER_ID | ||
} | ||
@@ -56,0 +54,0 @@ }); |
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
272557
4187
7
+ Addedjsonwebtoken@^8.3.0
+ Addedbuffer-equal-constant-time@1.0.1(transitive)
+ Addedecdsa-sig-formatter@1.0.11(transitive)
+ Addedjsonwebtoken@8.5.1(transitive)
+ Addedjwa@1.4.1(transitive)
+ Addedjws@3.2.2(transitive)
+ Addedlodash.includes@4.3.0(transitive)
+ Addedlodash.isboolean@3.0.3(transitive)
+ Addedlodash.isinteger@4.0.4(transitive)
+ Addedlodash.isnumber@3.0.3(transitive)
+ Addedlodash.isplainobject@4.0.6(transitive)
+ Addedlodash.isstring@4.0.1(transitive)
+ Addedlodash.once@4.1.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsemver@5.7.2(transitive)