Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

agenda-ui

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agenda-ui - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

assets/vendor.css

47

lib/api.js
var express = require('express');
var slug = require('speakingurl');
var Store = require('./store');
module.exports = function (agenda) {
var router = express.Router();
var store = new Store(agenda);
function definitions () {
return Object.keys(agenda._definitions).map(function (d) {
var id = slug(d);
return {
_id: id
, name: d
};
});
}
function buildQuery (queryParams) {
var query = {};
var filter = queryParams.filter;
var name = queryParams.name;
if (!filter || 'future' === filter) {
query.nextRunAt = { $gte: new Date() };
} else if ('completed' === filter) {
query.lastFinishedAt = { $exists: true };
query.type = 'normal';
} else if ('failed' === filter) {
query.failedAt = { $exists: true };
}
if (name) {
query.name = name;
}
return query;
}
router.get('/jobs', function (req, res) {
var query = buildQuery(req.query);
agenda.jobs(query, function(err, jobs) {
res.json({
jobs: jobs
, definitions: definitions()
});
});
store.data(req.query).then(res.json.bind(res));
});
router.get('/definitions', function (req, res) {
res.json({
definitions: definitions()
store.definitions().then(function (definitions) {
res.json({ definitions: definitions });
});

@@ -53,0 +16,0 @@ });

{
"name": "agenda-ui",
"version": "0.0.2",
"version": "0.0.3",
"description": "UI for Agenda",

@@ -40,4 +40,5 @@ "main": "index.js",

"express": "^4.3.2",
"rsvp": "^3.0.9",
"speakingurl": "^0.9.1"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc