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

aerogear-sender-client

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aerogear-sender-client - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

10

example.js

@@ -14,7 +14,9 @@ var agSender = require( "./lib/aerogear-sender-client" ).AeroGear,

applicationID: "aa3cfaad-8cd4-4b3c-af23-08417b879d00",
masterSecret: "SHHHHHH",
masterSecret: "shhh",
ttl: 3600,
"simple-push": {
"broadcast": "version="+ new Date().getTime() + ""
},
criteria: {
"simple-push": {
"broadcast": "version="+ new Date().getTime() + ""
}
variants: [ "1234", "56788" ]
}

@@ -21,0 +23,0 @@ };

20

lib/aerogear-sender-client.js

@@ -24,2 +24,3 @@ /* Node.js Sender API for the AeroGear Unified Push server

function send( serverSettings, message ) {
console.log( message );

@@ -117,2 +118,4 @@ // we stash the 'https' module on a local variable, IF the server is deployed using SSL.

@param {String} settings.masterSecret - The Master Secret
@param {Object} [settings.simple-push] - an object containing simple-push criteria
@param {Number} [settings.ttl] - the time to live in seconds. This value is supported by APNs and GCM Only
@param {Object} [settings.criteria={}] - the criteria to select

@@ -123,4 +126,2 @@ @param {Array} [settings.criteria.alias] - a list of email or name strings

@param {Array} [settings.criteria.variants] - a list of variantID's as strings
@param {Number} [settings.criteria.ttl] - the time to live in seconds. This value is supported by APNs and GCM Only
@param {Object} [settings.criteria.simple-push] - an object containing simple-push criteria
@returns {Object} itself

@@ -133,9 +134,16 @@

var serverSettings,
var serverSettings, setting, crit,
url = urlParser.parse( this.getUrl() ),
newMessage = {};
if( settings.criteria ) {
for( var crit in settings.criteria ) {
newMessage[ crit ] = settings.criteria[ crit ];
for( setting in settings ) {
if( setting !== "applicationID" && setting !== "masterSecret" )
{
if( setting === "criteria" ) {
for( crit in settings.criteria ) {
newMessage[ crit ] = settings.criteria[ crit ];
}
} else {
newMessage[ setting ] = settings[ setting ];
}
}

@@ -142,0 +150,0 @@ }

{
"name": "aerogear-sender-client",
"version": "0.1.3",
"version": "0.2.0",
"description": "Sender api for the AeroGear Unified Push server",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/aerogear/aerogear-unifiedpush-nodejs-client",

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