steps.push(function (next) { var binary = path.resolve(__dirname, '..', 'updates', updates[part]); var leave = partNumber === parts.length - 1; whenNode.bindCallback( dfu.write(binary, part, leave).delay(2000) , next); });
function refreshAccessToken (options, callback) { const settings = { method: 'POST', path: 'https://api.cronofy.com/oauth/token', entity: options }; const result = rest(settings).fold(reach, 'entity'); return nodefn.bindCallback(result, callback); }
function listCalendars (options, callback) { const settings = { method: 'GET', path: 'https://api.cronofy.com/v1/calendars', headers: { Authorization: 'Bearer ' + options.access_token } }; const result = rest(settings).fold(reach, 'entity'); return nodefn.bindCallback(result, callback); }
function deleteNotificationChannel (options, callback) { const settings = { method: 'DELETE', path: 'https://api.cronofy.com/v1/channels/${options.channel_id}', headers: { Authorization: 'Bearer ' + options.access_token } }; const result = rest(settings).fold(reach, 'entity'); return nodefn.bindCallback(result, callback); }
function deleteEvent (options, callback) { const settings = { method: 'DELETE', path: `https://api.cronofy.com/v1/calendars/${options.calendar_id}/events`, headers: { Authorization: 'Bearer ' + options.access_token }, params: _.omit(options, ['access_token', 'calendar_id']) }; const result = rest(settings).fold(reach, 'entity'); return nodefn.bindCallback(result, callback); }
function freeBusy (options, callback) { const settings = { method: 'GET', path: 'https://api.cronofy.com/v1/free_busy', headers: { Authorization: 'Bearer ' + options.access_token }, params: _.omit(options, 'access_token') }; const result = rest(settings).fold(reach, 'entity'); return nodefn.bindCallback(result, callback); }
Router.prototype.allEnabledForRequest = function(req, callback) { return bindCallback( when.all( this.routes.map(function(route) { var boundCallback; boundCallback = route.enabledForRequest.bind(route); return callbacks.call(boundCallback, req); }) ).then(function(results) { return results; }), callback ); };