Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
define(function(require, exports, module) {
'use strict';
var Abstract = require('./abstract');
var Calc = require('calc');
var binsearch = require('binsearch');
var compare = require('compare');
var denodeifyAll = require('promise').denodeifyAll;
/**
* Objects saved in the busytime store:
*
* {
* _id: (uuid),
* start: Calendar.Calc.dateToTransport(x),
* end: Calendar.Calc.dateToTransport(x),
* eventId: eventId,
* calendarId: calendarId
* }
*
*/
function Busytime() {
Abstract.apply(this, arguments);
this._setupCache();
define(function(require, exports, module) {
'use strict';
var denodeifyAll = require('promise').denodeifyAll;
var nextTick = require('next_tick');
function Abstract(options) {
var key;
for (key in options) {
if (options.hasOwnProperty(key)) {
this[key] = options[key];
}
}
denodeifyAll(this, [
'eventCapabilities',
'getAccount',
'findCalendars',
'syncEvents',
define(function(require, exports, module) {
'use strict';
var Abstract = require('./abstract');
var Calc = require('calc');
var createDOMPromise = require('create_dom_promise');
var debug = require('debug')('store/alarm');
var denodeifyAll = require('promise').denodeifyAll;
var notificationsController = require('controllers/notifications');
var object = require('object');
/**
* The alarm store can be thought of as a big queue.
* Over time we add and remove alarm times related to
* a specific busytime/event instance.
* (and there could be multiple alarms per busytime/event).
*
* When `workQueue` is called records will be removed
* from the queue (this object store) and added (via mozAlarms).
*/
function Alarm() {
Abstract.apply(this, arguments);
this._processQueue = this._processQueue.bind(this);
define(function(require, exports, module) {
'use strict';
var Responder = require('responder');
var app = require('app');
var denodeifyAll = require('promise').denodeifyAll;
/**
* Helper class to create accounts.
* Emits events during the process of
* creation to allow views to hook into
* the full cycle while further separating
* this logic from their own.
*
*
* Events:
*
* - authorize
* - calendar sync
*
*
* @param {Calendar.App} app instance of app.
define(function(require, exports, module) {
'use strict';
var Abstract = require('./abstract');
var Calc = require('calc');
var Calendar = require('./calendar');
var denodeifyAll = require('promise').denodeifyAll;
var providerFactory = require('provider/provider_factory');
function Events() {
Abstract.apply(this, arguments);
denodeifyAll(this, [
'providerFor',
'findByIds',
'ownersOf',
'eventsForCalendar'
]);
}
module.exports = Events;
Events.prototype = {
__proto__: Abstract.prototype,
define(function(require, exports, module) {
'use strict';
var AccountModel = require('models/account');
var Abstract = require('./abstract');
var debug = require('debug')('store/account');
var denodeifyAll = require('promise').denodeifyAll;
var extend = require('extend');
var nextTick = require('next_tick');
var probablyParseInt = require('probably_parse_int');
var providerFactory = require('provider/provider_factory');
function Account() {
Abstract.apply(this, arguments);
denodeifyAll(this, [
'verifyAndPersist',
'sync',
'markWithError',
'syncableAccounts',
'availablePresets'
]);
}
define(function(require, exports, module) {
'use strict';
var Abstract = require('./abstract');
var Calc = require('calc');
var denodeifyAll = require('promise').denodeifyAll;
function IcalComponent() {
Abstract.apply(this, arguments);
denodeifyAll(this, [
'findRecurrencesBefore'
]);
}
module.exports = IcalComponent;
IcalComponent.prototype = {
__proto__: Abstract.prototype,
_store: 'icalComponents',
/** disable caching */
define(function(require, exports, module) {
'use strict';
var Abstract = require('./abstract');
var CalendarModel = require('models/calendar');
var Local = require('provider/local');
var denodeifyAll = require('promise').denodeifyAll;
var probablyParseInt = require('probably_parse_int');
var providerFactory = require('provider/provider_factory');
function Store() {
Abstract.apply(this, arguments);
this._usedColors = [];
denodeifyAll(this, [
'markWithError',
'remotesByAccount',
'sync',
'providerFor',
'ownersOf'
]);
}
module.exports = Store;
define(function(require, exports, module) {
'use strict';
var Abstract = require('./abstract');
var denodeifyAll = require('promise').denodeifyAll;
var nextTick = require('next_tick');
function Setting() {
Abstract.apply(this, arguments);
denodeifyAll(this, [
'getValue',
'set'
]);
}
module.exports = Setting;
Setting.prototype = {
__proto__: Abstract.prototype,
_store: 'settings',
define(function(require, exports, module) {
'use strict';
var Responder = require('responder');
var denodeifyAll = require('promise').denodeifyAll;
var nextTick = require('next_tick');
/**
* Creates an abstract store instance.
* Every store must contain a reference
* to the database.
*/
function Abstract(db, app) {
this.db = db;
this.app = app;
this._cached = Object.create(null);
Responder.call(this);
denodeifyAll(this, [
'persist',
'all',