Skip to content

Commit

Permalink
latest build
Browse files Browse the repository at this point in the history
  • Loading branch information
edsu committed Jan 18, 2022
1 parent ba2b545 commit 4ae2ce0
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 60 deletions.
2 changes: 1 addition & 1 deletion dist/archive/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="main-7418f2ce8ea3b5a21190.js"></script></body>
<script type="text/javascript" src="main-3ac2ea05e0db345d6216.js"></script></body>
</html>

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="/main-fe252fe8b91569f13278.js"></script></body>
<script type="text/javascript" src="/main-e0ef53fd144f17615b1f.js"></script></body>
</html>

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 48 additions & 27 deletions dist/server/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var _archive = require("./archive");

var _auth = require("./auth");

var _twitter = require("./twitter");

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
Expand Down Expand Up @@ -211,58 +213,77 @@ app.put('/settings', /*#__PURE__*/function () {
superUser = _context4.sent;

if (!(!superUser || req.user && req.user.isSuperUser)) {
_context4.next = 18;
_context4.next = 34;
break;
}

_context4.t0 = req.body.logoUrl;
_context4.t1 = req.body.instanceTitle;
_context4.t2 = req.body.appKey;
_context4.t3 = req.body.appSecret;
_context4.t4 = req.body.instanceInfoLink;
_context4.t5 = req.body.instanceDescription;
_context4.t6 = req.body.instanceTweetText;
_context4.t7 = req.body.emailHost;
_context4.t8 = req.body.emailPort;
_context4.t9 = req.body.emailUser;
_context4.t10 = req.body.emailPassword;
_context4.t11 = req.body.emailFromAddress;
_context4.t12 = parseInt(req.body.defaultQuota, 10) || 50000;
_context4.next = 19;
return (0, _twitter.isAcademic)(req.body.appKey, req.body.appSecret);

case 19:
_context4.t13 = _context4.sent;
settings = {
logoUrl: req.body.logoUrl,
instanceTitle: req.body.instanceTitle,
appKey: req.body.appKey,
appSecret: req.body.appSecret,
instanceInfoLink: req.body.instanceInfoLink,
instanceDescription: req.body.instanceDescription,
instanceTweetText: req.body.instanceTweetText,
emailHost: req.body.emailHost,
emailPort: req.body.emailPort,
emailUser: req.body.emailUser,
emailPassword: req.body.emailPassword,
emailFromAddress: req.body.emailFromAddress,
defaultQuota: parseInt(req.body.defaultQuota, 10) || 50000
logoUrl: _context4.t0,
instanceTitle: _context4.t1,
appKey: _context4.t2,
appSecret: _context4.t3,
instanceInfoLink: _context4.t4,
instanceDescription: _context4.t5,
instanceTweetText: _context4.t6,
emailHost: _context4.t7,
emailPort: _context4.t8,
emailUser: _context4.t9,
emailPassword: _context4.t10,
emailFromAddress: _context4.t11,
defaultQuota: _context4.t12,
academic: _context4.t13
};
_context4.prev = 5;
_context4.next = 8;
_context4.prev = 21;
_context4.next = 24;
return db.addSettings(settings);

case 8:
case 24:
(0, _auth.activateKeys)();
res.json({
status: 'updated'
});
_context4.next = 16;
_context4.next = 32;
break;

case 12:
_context4.prev = 12;
_context4.t0 = _context4["catch"](5);
console.error(_context4.t0);
case 28:
_context4.prev = 28;
_context4.t14 = _context4["catch"](21);
console.error(_context4.t14);
res.json({
status: 'error'
});

case 16:
_context4.next = 19;
case 32:
_context4.next = 35;
break;

case 18:
case 34:
notAuthorized(res);

case 19:
case 35:
case "end":
return _context4.stop();
}
}
}, _callee4, null, [[5, 12]]);
}, _callee4, null, [[21, 28]]);
}));

return function (_x7, _x8) {
Expand Down
12 changes: 12 additions & 0 deletions dist/server/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _express = _interopRequireDefault(require("express"));

var _passport = _interopRequireDefault(require("passport"));
Expand All @@ -16,6 +18,10 @@ var _email = require("./email");

var _db = require("./db");

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

var db = new _db.Database();
var app = (0, _express["default"])();

Expand Down Expand Up @@ -48,6 +54,12 @@ var activateKeys = function activateKeys() {
return cb(null, u.id);
});
} else {
db.updateUser(_objectSpread(_objectSpread({}, user), {}, {
twitterScreenName: profile.username,
twitterAvatarUrl: profile.photos[0].value,
twitterAccessToken: token,
twitterAccessTokenSecret: tokenSecret
}));
return cb(null, user.id);
}
});
Expand Down
4 changes: 3 additions & 1 deletion dist/server/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,15 @@ var Database = /*#__PURE__*/function () {
_iterator.f();
}

settings.academic = settings.academic == "true" ? true : false;

if (!settings.instanceTweetText) {
settings.instanceTweetText = "I'm creating a collection of tweets that match {query}. You can learn more about why I'm creating it and specify your terms of your consent here {collection-url}";
}

return _context4.abrupt("return", settings);

case 8:
case 9:
case "end":
return _context4.stop();
}
Expand Down
42 changes: 24 additions & 18 deletions dist/server/search-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,71 +101,77 @@ var SearchLoader = /*#__PURE__*/function () {
switch (_context.prev = _context.next) {
case 0:
if (!err) {
_context.next = 3;
_context.next = 6;
break;
}

_logger["default"].error(err);

_context.next = 4;
return (0, _utils.timer)(3000);

case 4:
_this.db.redis.lpushAsync(_redis.startSearchJobKey, job.id);

return _context.abrupt("return");

case 3:
case 6:
if (!(tweets == 0)) {
_context.next = 5;
_context.next = 8;
break;
}

return _context.abrupt("return");

case 5:
case 8:
if (!_this.active) {
_context.next = 20;
_context.next = 23;
break;
}

_context.next = 8;
_context.next = 11;
return _this.db.loadTweets(job.query.search, tweets);

case 8:
case 11:
if (!nextToken) {
_context.next = 15;
_context.next = 18;
break;
}

_logger["default"].info("queueing next search job ".concat(job.id));

_context.next = 12;
_context.next = 15;
return _this.db.updateSearchJob({
id: job.id,
nextToken: nextToken
});

case 12:
case 15:
_this.db.redis.lpushAsync(_redis.startSearchJobKey, job.id);

_context.next = 18;
_context.next = 21;
break;

case 15:
case 18:
_logger["default"].info("no more search results for search job ".concat(job.id));

_context.next = 18;
_context.next = 21;
return _this.db.updateSearchJob({
id: job.id,
ended: new Date()
});

case 18:
_context.next = 21;
case 21:
_context.next = 24;
break;

case 20:
case 23:
_logger["default"].warn('search loader callback received tweets when no longer active');

case 21:
case 24:
return _context.abrupt("return", false);

case 22:
case 25:
case "end":
return _context.stop();
}
Expand Down
Loading

0 comments on commit 4ae2ce0

Please sign in to comment.