MCPcopy
hub / github.com/skygragon/leetcode-cli / runSession

Function runSession

lib/plugins/leetcode.js:425–439  ·  view source on GitHub ↗
(method, data, cb)

Source from the content-addressed store, hash-verified

423};
424
425function runSession(method, data, cb) {
426 const opts = plugin.makeOpts(config.sys.urls.session);
427 opts.json = true;
428 opts.method = method;
429 opts.body = data;
430
431 const spin = h.spin('Waiting session result');
432 request(opts, function(e, resp, body) {
433 spin.stop();
434 e = plugin.checkError(e, resp, 200);
435 if (e && e.statusCode === 302) e = session.errors.EXPIRED;
436
437 return e ? cb(e) : cb(null, body.sessions);
438 });
439}
440
441plugin.getSessions = function(cb) {
442 log.debug('running leetcode.getSessions');

Callers 1

leetcode.jsFile · 0.85

Calls 1

cbFunction · 0.85

Tested by

no test coverage detected