Commit 703d40c8 by Sebastián Katzer

Removed support to query for notifications by type and id

parent 7a2e4478
...@@ -222,18 +222,11 @@ exports.isTriggered = function (id, callback, scope) { ...@@ -222,18 +222,11 @@ exports.isTriggered = function (id, callback, scope) {
* *
* @return [ Void ] * @return [ Void ]
*/ */
exports.getAllIds = function (callback, scope) { exports.getIds = function (callback, scope) {
this.exec('ids', null, callback, scope); this.exec('ids', null, callback, scope);
}; };
/** /**
* Alias for `getAllIds`.
*/
exports.getIds = function () {
this.getAllIds.apply(this, arguments);
};
/**
* List of all scheduled notification IDs. * List of all scheduled notification IDs.
* *
* @param [ Function ] callback The function to be exec as the callback. * @param [ Function ] callback The function to be exec as the callback.
...@@ -301,92 +294,22 @@ exports.getAll = function (callback, scope) { ...@@ -301,92 +294,22 @@ exports.getAll = function (callback, scope) {
}; };
/** /**
* List of scheduled notifications specified by id.
* If called without IDs, all notification will be returned.
*
* @param [ Array<Int> ] ids The IDs of the notifications.
* @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope.
*
* @return [ Void ]
*/
exports.getScheduled = function () {
var args = Array.apply(null, arguments);
if (typeof args[0] == 'function') {
args.unshift([]);
}
var ids = args[0],
callback = args[1],
scope = args[2];
if (!Array.isArray(ids)) {
ids = [ids];
}
if (!Array.isArray(ids)) {
this.exec('scheduledNotification', Number(ids), callback, scope);
return;
}
ids = this.convertIds(ids);
this.exec('scheduledNotifications', ids, callback, scope);
};
/**
* List of all scheduled notifications. * List of all scheduled notifications.
* *
* @param [ Function ] callback The function to be exec as the callback. * @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope. * @param [ Object ] scope The callback function's scope.
*/ */
exports.getAllScheduled = function (callback, scope) { exports.getScheduled = function (callback, scope) {
this.exec('scheduledNotifications', null, callback, scope); this.exec('scheduledNotifications', null, callback, scope);
}; };
/** /**
* List of triggered notifications specified by id.
* If called without IDs, all notification will be returned.
*
* @param [ Array<Int> ] ids The IDs of the notifications.
* @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope.
*
* @return [ Void ]
*/
exports.getTriggered = function () {
var args = Array.apply(null, arguments);
if (typeof args[0] == 'function') {
args.unshift([]);
}
var ids = args[0],
callback = args[1],
scope = args[2];
if (!Array.isArray(ids)) {
ids = [ids];
}
if (!Array.isArray(ids)) {
this.exec('triggeredNotification', Number(ids), callback, scope);
return;
}
ids = this.convertIds(ids);
this.exec('triggeredNotifications', ids, callback, scope);
};
/**
* List of all triggered notifications. * List of all triggered notifications.
* *
* @param [ Function ] callback The function to be exec as the callback. * @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope. * @param [ Object ] scope The callback function's scope.
*/ */
exports.getAllTriggered = function (callback, scope) { exports.getTriggered = function (callback, scope) {
this.exec('triggeredNotifications', null, callback, scope); this.exec('triggeredNotifications', null, callback, scope);
}; };
......
...@@ -171,15 +171,8 @@ exports.isTriggered = function (id, callback, scope) { ...@@ -171,15 +171,8 @@ exports.isTriggered = function (id, callback, scope) {
* *
* @return [ Void ] * @return [ Void ]
*/ */
exports.getAllIds = function (callback, scope) { exports.getIds = function (callback, scope) {
this.core.getAllIds(callback, scope); this.core.getIds(callback, scope);
};
/**
* Alias for `getAllIds`.
*/
exports.getIds = function () {
this.getAllIds.apply(this, arguments);
}; };
/** /**
...@@ -233,41 +226,13 @@ exports.getAll = function (callback, scope) { ...@@ -233,41 +226,13 @@ exports.getAll = function (callback, scope) {
}; };
/** /**
* List of scheduled notifications specified by id.
* If called without IDs, all notification will be returned.
*
* @param [ Array<Int> ] ids The IDs of the notifications.
* @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope.
*
* @return [ Void ]
*/
exports.getScheduled = function (ids, callback, scope) {
this.core.getScheduled(ids, callback, scope);
};
/**
* List of all scheduled notifications. * List of all scheduled notifications.
* *
* @param [ Function ] callback The function to be exec as the callback. * @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope. * @param [ Object ] scope The callback function's scope.
*/ */
exports.getAllScheduled = function (callback, scope) { exports.getScheduled = function (callback, scope) {
this.core.getAllScheduled(callback, scope); this.core.getScheduled(callback, scope);
};
/**
* List of triggered notifications specified by id.
* If called without IDs, all notification will be returned.
*
* @param [ Array<Int> ] ids The IDs of the notifications.
* @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope.
*
* @return [ Void ]
*/
exports.getTriggered = function (ids, callback, scope) {
this.core.getTriggered(ids, callback, scope);
}; };
/** /**
...@@ -276,8 +241,8 @@ exports.getTriggered = function (ids, callback, scope) { ...@@ -276,8 +241,8 @@ exports.getTriggered = function (ids, callback, scope) {
* @param [ Function ] callback The function to be exec as the callback. * @param [ Function ] callback The function to be exec as the callback.
* @param [ Object ] scope The callback function's scope. * @param [ Object ] scope The callback function's scope.
*/ */
exports.getAllTriggered = function (callback, scope) { exports.getTriggered = function (callback, scope) {
this.core.getAllTriggered(callback, scope); this.core.getTriggered(callback, scope);
}; };
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment