Comparing version 0.2.2beta to 0.2.3
@@ -36,3 +36,3 @@ /* automatically generated by JSCoverage - do not edit */ | ||
_$jscoverage['smsSender.js'][102] = 0; | ||
_$jscoverage['smsSender.js'][106] = 0; | ||
_$jscoverage['smsSender.js'][103] = 0; | ||
_$jscoverage['smsSender.js'][107] = 0; | ||
@@ -44,4 +44,5 @@ _$jscoverage['smsSender.js'][108] = 0; | ||
_$jscoverage['smsSender.js'][112] = 0; | ||
_$jscoverage['smsSender.js'][114] = 0; | ||
_$jscoverage['smsSender.js'][116] = 0; | ||
_$jscoverage['smsSender.js'][113] = 0; | ||
_$jscoverage['smsSender.js'][115] = 0; | ||
_$jscoverage['smsSender.js'][117] = 0; | ||
} | ||
@@ -139,25 +140,30 @@ _$jscoverage['smsSender.js'][27]++; | ||
console.error(err2); | ||
_$jscoverage['smsSender.js'][103]++; | ||
if (callback) { | ||
_$jscoverage['smsSender.js'][103]++; | ||
callback(); | ||
} | ||
})); | ||
}); | ||
_$jscoverage['smsSender.js'][106]++; | ||
_$jscoverage['smsSender.js'][107]++; | ||
var parseXML = (function (data, callback) { | ||
_$jscoverage['smsSender.js'][107]++; | ||
_$jscoverage['smsSender.js'][108]++; | ||
var p = new xml2js.Parser(); | ||
_$jscoverage['smsSender.js'][108]++; | ||
_$jscoverage['smsSender.js'][109]++; | ||
p.addListener("end", (function (obj) { | ||
_$jscoverage['smsSender.js'][109]++; | ||
_$jscoverage['smsSender.js'][110]++; | ||
var status = {}; | ||
_$jscoverage['smsSender.js'][110]++; | ||
_$jscoverage['smsSender.js'][111]++; | ||
status.statusCode = obj.status_code; | ||
_$jscoverage['smsSender.js'][111]++; | ||
_$jscoverage['smsSender.js'][112]++; | ||
status.statusDescription = obj.status_message; | ||
_$jscoverage['smsSender.js'][112]++; | ||
_$jscoverage['smsSender.js'][113]++; | ||
status.correlationId = obj.correlator; | ||
_$jscoverage['smsSender.js'][114]++; | ||
_$jscoverage['smsSender.js'][115]++; | ||
callback(status); | ||
})); | ||
_$jscoverage['smsSender.js'][116]++; | ||
_$jscoverage['smsSender.js'][117]++; | ||
p.parseString(data); | ||
}); | ||
} | ||
_$jscoverage['smsSender.js'].source = ["/**","","\tThe MIT License","\t","\tCopyright (c) 2011 Arunoda Susiripala","\t","\tPermission is hereby granted, free of charge, to any person obtaining a copy","\tof this software and associated documentation files (the \"Software\"), to deal","\tin the Software without restriction, including without limitation the rights","\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell","\tcopies of the Software, and to permit persons to whom the Software is","\tfurnished to do so, subject to the following conditions:","\t","\tThe above copyright notice and this permission notice shall be included in","\tall copies or substantial portions of the Software.","\t","\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR","\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,","\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE","\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER","\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,","\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN","\tTHE SOFTWARE.",""," */","","var rest = require(\"restler\");","var xml2js = require(\"xml2js-expat\");","","exports.load = function(url, appId, password, retryInterval, retryLimit) {","\treturn new SmsSender(url, appId, password, retryInterval, retryLimit);","};","","function SmsSender(url, appId, password, retryInterval, retryLimit) {","\t","\tthis.sendSms = function(address, message, callback) {","\t\tsendMessageRetry(\"tel:\" + address, message, callback, 1);","\t};","\t","\tthis.broadcastSms = function(message, callback) {","\t\tsendMessageRetry(\"list:registered\", message, callback, 1);","\t};","\t","\t//Retry code block (recursive)","\tvar sendMessageRetry = function(address, message, callback, count) {","\t\t","\t\tvar retryCodes = [\"SBL-SMS-MT-5000\", \"SBL-SMS-MT-5008\", \"SBL-SMS-MT-5001\",","\t\t \t\t\t\t\"SBL-SMS-MT-5004\", \"CORE-SMS-MT-4049\", \"CORE-SMS-MT-4030\", ","\t\t \t\t\t\t\"CORE-SMS-MT-4016\"];","\t\t","\t\tif(count> retryLimit) {","\t\t\tvar err = {","\t\t\t\terror: \"Maximum retry limit of \" + retryLimit + \" exceeded when sending the message\",","\t\t\t\taddress: address,","\t\t\t\tmessage: message","\t\t\t};","\t\t\t","\t\t\tif(callback) callback(err, null);","\t\t\tconsole.error(\"maximum retry limit exeeded when sending message to: \" + url + \" for:\" + address);","\t\t} else {","\t\t\tsendMessageLogic(address, message, function(status) {","\t\t\t\t","\t\t\t\tif(!status || retryCodes.contains(status.statusCode)) {","\t\t\t\t\tconsole.log(\"retrying for: \" + count + \" of message: \" + message + \" to address:\" + address);","\t\t\t\t\tsetTimeout(function() {","\t\t\t\t\t\tsendMessageRetry(address, message, callback, count + 1);","\t\t\t\t\t}, retryInterval);","\t\t\t\t} else {","\t\t\t\t\tif(callback) callback(null, status);","\t\t\t\t}","\t\t\t});","\t\t}","\t\t","\t};","\t","\t/*","\t * Logic behind sending the message","\t */","\tvar sendMessageLogic = function(address, message, callback) {","","\t\trest.post(url, {","\t\t\tusername: appId,","\t\t\tpassword: password,","\t\t\tdata: {","\t\t\t\tversion: \"1.0\",","\t\t\t\taddress: address,","\t\t\t\tmessage: message","\t\t\t}","\t\t}).on(\"complete\", function(data, response) {","\t\t\t","\t\t\tif(response.statusCode == 200) {","\t\t\t\tparseXML(data, function(status) {","\t\t\t\t\tif(callback) callback(status);","\t\t\t\t});","\t\t\t\tconsole.info(\"message send to address: \" + address);","\t\t\t} else {","\t\t\t\tconsole.error(\"Appzone Sending message failed with statusCode: \" + response.statusCode);","\t\t\t\tif(callback) callback(null);","\t\t\t}","\t\t}).on(\"error\", function(err, err2) {","\t\t\tconsole.error(\"Something wrong with the appzone host:\" + url);","\t\t\tconsole.error(err2);","\t\t});","\t};","\t","\tvar parseXML = function(data, callback) {","\t\tvar p = new xml2js.Parser();","\t\tp.addListener(\"end\", function(obj) {","\t\t\tvar status = {};","\t\t\tstatus.statusCode = obj.status_code;","\t\t\tstatus.statusDescription = obj.status_message;","\t\t\tstatus.correlationId = obj.correlator;","\t\t\t","\t\t\tcallback(status);","\t\t});","\t\tp.parseString(data);","\t};","}"]; | ||
_$jscoverage['smsSender.js'].source = ["/**","","\tThe MIT License","\t","\tCopyright (c) 2011 Arunoda Susiripala","\t","\tPermission is hereby granted, free of charge, to any person obtaining a copy","\tof this software and associated documentation files (the \"Software\"), to deal","\tin the Software without restriction, including without limitation the rights","\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell","\tcopies of the Software, and to permit persons to whom the Software is","\tfurnished to do so, subject to the following conditions:","\t","\tThe above copyright notice and this permission notice shall be included in","\tall copies or substantial portions of the Software.","\t","\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR","\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,","\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE","\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER","\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,","\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN","\tTHE SOFTWARE.",""," */","","var rest = require(\"restler\");","var xml2js = require(\"xml2js-expat\");","","exports.load = function(url, appId, password, retryInterval, retryLimit) {","\treturn new SmsSender(url, appId, password, retryInterval, retryLimit);","};","","function SmsSender(url, appId, password, retryInterval, retryLimit) {","\t","\tthis.sendSms = function(address, message, callback) {","\t\tsendMessageRetry(\"tel:\" + address, message, callback, 1);","\t};","\t","\tthis.broadcastSms = function(message, callback) {","\t\tsendMessageRetry(\"list:registered\", message, callback, 1);","\t};","\t","\t//Retry code block (recursive)","\tvar sendMessageRetry = function(address, message, callback, count) {","\t\t","\t\tvar retryCodes = [\"SBL-SMS-MT-5000\", \"SBL-SMS-MT-5008\", \"SBL-SMS-MT-5001\",","\t\t \t\t\t\t\"SBL-SMS-MT-5004\", \"CORE-SMS-MT-4049\", \"CORE-SMS-MT-4030\", ","\t\t \t\t\t\t\"CORE-SMS-MT-4016\"];","\t\t","\t\tif(count> retryLimit) {","\t\t\tvar err = {","\t\t\t\terror: \"Maximum retry limit of \" + retryLimit + \" exceeded when sending the message\",","\t\t\t\taddress: address,","\t\t\t\tmessage: message","\t\t\t};","\t\t\t","\t\t\tif(callback) callback(err, null);","\t\t\tconsole.error(\"maximum retry limit exeeded when sending message to: \" + url + \" for:\" + address);","\t\t} else {","\t\t\tsendMessageLogic(address, message, function(status) {","\t\t\t\t","\t\t\t\tif(!status || retryCodes.contains(status.statusCode)) {","\t\t\t\t\tconsole.log(\"retrying for: \" + count + \" of message: \" + message + \" to address:\" + address);","\t\t\t\t\tsetTimeout(function() {","\t\t\t\t\t\tsendMessageRetry(address, message, callback, count + 1);","\t\t\t\t\t}, retryInterval);","\t\t\t\t} else {","\t\t\t\t\tif(callback) callback(null, status);","\t\t\t\t}","\t\t\t});","\t\t}","\t\t","\t};","\t","\t/*","\t * Logic behind sending the message","\t */","\tvar sendMessageLogic = function(address, message, callback) {","","\t\trest.post(url, {","\t\t\tusername: appId,","\t\t\tpassword: password,","\t\t\tdata: {","\t\t\t\tversion: \"1.0\",","\t\t\t\taddress: address,","\t\t\t\tmessage: message","\t\t\t}","\t\t}).on(\"complete\", function(data, response) {","\t\t\t","\t\t\tif(response.statusCode == 200) {","\t\t\t\tparseXML(data, function(status) {","\t\t\t\t\tif(callback) callback(status);","\t\t\t\t});","\t\t\t\tconsole.info(\"message send to address: \" + address);","\t\t\t} else {","\t\t\t\tconsole.error(\"Appzone Sending message failed with statusCode: \" + response.statusCode);","\t\t\t\tif(callback) callback(null);","\t\t\t}","\t\t}).on(\"error\", function(err, err2) {","\t\t\tconsole.error(\"Something wrong with the appzone host:\" + url);","\t\t\tconsole.error(err2);","\t\t\tif(callback) callback();","\t\t});","\t};","\t","\tvar parseXML = function(data, callback) {","\t\tvar p = new xml2js.Parser();","\t\tp.addListener(\"end\", function(obj) {","\t\t\tvar status = {};","\t\t\tstatus.statusCode = obj.status_code;","\t\t\tstatus.statusDescription = obj.status_message;","\t\t\tstatus.correlationId = obj.correlator;","\t\t\t","\t\t\tcallback(status);","\t\t});","\t\tp.parseString(data);","\t};","}"]; |
@@ -103,2 +103,3 @@ /** | ||
console.error(err2); | ||
if(callback) callback(); | ||
}); | ||
@@ -105,0 +106,0 @@ }; |
{ | ||
"name": "appzone", | ||
"version": "0.2.2beta", | ||
"version": "0.2.3", | ||
"directories": { | ||
@@ -20,3 +20,4 @@ "lib": "./lib" | ||
"restler": ">= 0.2.1", | ||
"xml2js-expat": ">= 0.2.0" | ||
"xml2js-expat": ">= 0.2.0", | ||
"qbox": ">= 0.1.3" | ||
}, | ||
@@ -23,0 +24,0 @@ "repository" : |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
159273
43
2941
1
62
4
+ Addedqbox@>= 0.1.3
+ Addedqbox@0.1.7(transitive)