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

cozy-notifications-helper

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cozy-notifications-helper - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

42

lib/notification-manager.js
// Generated by CoffeeScript 1.6.3
(function() {
var Client, authentifiedEnvs, client, initialized, map, queue, _ref,
var Client, authentifiedEnvs, client, initialized, queue, _ref,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

@@ -16,21 +16,26 @@

queue = [];
initialized = false;
queue = [];
module.exports.initializeRequest = function() {
var map;
initialized = false;
map = "function (doc) {\n if (doc.docType.toLowerCase() === \"notification\") {\n if(doc.type === 'persistent') {\n emit([doc.app, doc.ref], doc);\n }\n }\n}";
return client.put('request/notification/byApps/', {
map: map
}, function(err, res, body) {
var msg;
if (err != null) {
msg = "An error occurred while initializing notification module";
return console.log("" + msg + " -- " + err);
} else {
initialized = true;
return module.exports._emptyQueue();
}
});
};
map = "function (doc) {\n if (doc.docType.toLowerCase() === \"notification\") {\n if(doc.type === 'persistent') {\n emit([doc.app, doc.ref], doc);\n }\n }\n}";
module.exports.initializeRequest();
client.put('request/notification/byApps/', {
map: map
}, function(err, res, body) {
var msg;
if (err != null) {
msg = "An error occurred while initializing notification module";
return console.log("" + msg + " -- " + err);
} else {
initialized = true;
return module.exports._emptyQueue();
}
});
module.exports.manage = function(notification, type, callback) {

@@ -66,3 +71,6 @@ var issues, msg;

return callback(err);
} else if (!body || body.length === 0) {
} else if ((body != null) && (body.error != null) && (res != null ? res.statusCode : void 0) === 404) {
module.exports._queueOperation('createOrUpdate', notification, callback);
return module.exports.initializeRequest();
} else if ((body == null) || body.length === 0) {
return module.exports._processCreation(notification, callback);

@@ -69,0 +77,0 @@ } else {

{
"name": "cozy-notifications-helper",
"version": "1.0.1",
"version": "1.0.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/main.js",

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