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

bcycle

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bcycle - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

type_declarations/DefinitelyTyped/moment/moment-node.d.ts

3

package.json

@@ -7,3 +7,3 @@ {

],
"version": "0.2.1",
"version": "0.2.2",
"homepage": "https://github.com/chbrown/bcycle",

@@ -17,2 +17,3 @@ "repository": "git://github.com/chbrown/bcycle.git",

"http-enhanced": "*",
"moment": "*",
"regex-router": "*",

@@ -19,0 +20,0 @@ "request": "*",

@@ -5,2 +5,3 @@ /// <reference path="type_declarations/index.d.ts" />

var url = require('url');
var moment = require('moment');
var Router = require('regex-router');

@@ -17,10 +18,18 @@ var database_1 = require('./database');

'kiosk.latitude', 'kiosk.longitude', 'kiosk.time_zone', 'kiosk.status', 'kiosk.is_event_based',
'status.docks_available', 'status.bikes_available',
'status.docks_available', 'status.bikes_available', 'status.fetched',
])
.orderBy('fetched DESC')
.limit(1000);
.orderBy('fetched DESC');
if (urlObj.query.programId) {
// if you specify a particular program, you get a whole day's worth
var program_id = parseInt(urlObj.query.programId, 10);
query = query.whereEqual({ program_id: program_id });
var one_day_ago = (new Date().getTime());
query = query
.whereEqual({ program_id: program_id })
.where('fetched > ?', moment().subtract(1, 'day').toDate());
}
else {
// if you don't specify a program, you only get the last 1000
var limit = Math.min(parseInt(urlObj.query.limit || 1000, 10), 1000);
query = query.limit(limit);
}
query.execute(function (error, statuses) {

@@ -32,2 +41,17 @@ if (error)

});
R.get(/^\/programs(\?|$)/, function (req, res) {
database_1.db.Select('program INNER JOIN kiosk ON kiosk.program_id = program.id')
.add([
'program.id', 'program.name', 'program.latitude', 'program.longitude',
// ::integer converts from long so that `pg` parses it as a number
'COUNT(kiosk.id)::integer AS kiosks',
])
.orderBy('program.name')
.groupBy('program.id')
.execute(function (error, programs) {
if (error)
return res.error(error);
res.json(programs);
});
});
/** GET /info

@@ -34,0 +58,0 @@ Show npm-search-server package metadata

@@ -5,2 +5,3 @@ /// <reference path="type_declarations/index.d.ts" />

import url = require('url');
import moment = require('moment');
import Router = require('regex-router');

@@ -21,11 +22,19 @@

'kiosk.latitude', 'kiosk.longitude', 'kiosk.time_zone', 'kiosk.status', 'kiosk.is_event_based',
'status.docks_available', 'status.bikes_available',
'status.docks_available', 'status.bikes_available', 'status.fetched',
])
.orderBy('fetched DESC')
.limit(1000);
if (urlObj.query.programId) {
// if you specify a particular program, you get a whole day's worth
var program_id = parseInt(urlObj.query.programId, 10);
query = query.whereEqual({program_id: program_id});
var one_day_ago = (new Date().getTime())
query = query
.whereEqual({program_id: program_id})
.where('fetched > ?', moment().subtract(1, 'day').toDate());
}
else {
// if you don't specify a program, you only get the last 1000
var limit = Math.min(parseInt(urlObj.query.limit || 1000, 10), 1000);
query = query.limit(limit);
}

@@ -39,2 +48,18 @@ query.execute((error: Error, statuses: Status[]) => {

R.get(/^\/programs(\?|$)/, (req, res: any) => {
db.Select('program INNER JOIN kiosk ON kiosk.program_id = program.id')
.add([
'program.id', 'program.name', 'program.latitude', 'program.longitude',
// ::integer converts from long so that `pg` parses it as a number
'COUNT(kiosk.id)::integer AS kiosks',
])
.orderBy('program.name')
.groupBy('program.id')
.execute((error: Error, programs: Program[]) => {
if (error) return res.error(error);
res.json(programs);
});
});
/** GET /info

@@ -41,0 +66,0 @@ Show npm-search-server package metadata

/// <reference path="DefinitelyTyped/async/async.d.ts" />
/// <reference path="DefinitelyTyped/node/node.d.ts" />
/// <reference path="DefinitelyTyped/request/request.d.ts" />
/// <reference path="DefinitelyTyped/moment/moment.d.ts" />
/// <reference path="../node_modules/regex-router/regex-router.d.ts" />

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