@parse/node-apn
Advanced tools
Comparing version 4.1.0 to 4.1.1
## Changelog | ||
4.1.1 | ||
* FIX: add proxy and fix logger types | ||
* NEW: Added support for critical notifications | ||
4.1.0 | ||
@@ -4,0 +8,0 @@ * NEW: Proxy support |
@@ -61,2 +61,6 @@ /// <reference types="node" /> | ||
requestTimeout?: number; | ||
/** | ||
* Connect through an HTTP proxy | ||
*/ | ||
proxy?: { host: string, port: number|string } | ||
} | ||
@@ -75,2 +79,8 @@ | ||
interface ApsSound { | ||
critical: number; // 1 | ||
name: string; | ||
volume: number; | ||
} | ||
interface Aps { | ||
@@ -80,3 +90,3 @@ alert?: string | ApsAlert | ||
badge?: number | ||
sound?: string | ||
sound?: string | ApsSound | ||
"content-available"?: undefined | 1 | ||
@@ -119,6 +129,6 @@ "mutable-content"?: undefined | 1 | ||
* In order to log, these functions must have a property '.enabled' that is true. | ||
* (The default logger uses the npm 'debug' module which sets '.enabled' | ||
* (The default logger uses the npm 'debug' module which sets '.enabled' | ||
* based on the DEBUG environment variable) | ||
*/ | ||
setLogger(logger: (string) => void, errorLogger?: (string) => void): Promise<Responses>; | ||
setLogger(logger: (msg: string) => void, errorLogger?: (msg: string) => void): Promise<Responses>; | ||
@@ -194,3 +204,3 @@ /** | ||
*/ | ||
public sound: string; | ||
public sound: string | ApsSound; | ||
/** | ||
@@ -197,0 +207,0 @@ * The value to specify for `payload.aps.alert` can be either a `String` or an `Object` as outlined by the payload documentation. |
@@ -79,2 +79,7 @@ "use strict"; | ||
this.aps.sound = value; | ||
} else if (typeof value === "object" | ||
&& typeof value.name === "string" | ||
&& typeof value.critical === "number" | ||
&& typeof value.volume === "number") { | ||
this.aps.sound = value; | ||
} | ||
@@ -81,0 +86,0 @@ }, |
{ | ||
"name": "@parse/node-apn", | ||
"description": "An interface to the Apple Push Notification service for Node.js", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"author": "Andrew Naylor <argon@mkbot.net>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -519,4 +519,16 @@ "use strict"; | ||
describe("setSound", function () { | ||
it("is chainable", function () { | ||
it("can be set to object", function() { | ||
note.sound = { | ||
name: "sound.caf", | ||
critical: 1, | ||
volume: 0.75 | ||
}; | ||
expect(compiledOutput()).to.have.deep.property("aps.sound.name", "sound.caf"); | ||
expect(compiledOutput()).to.have.deep.property("aps.sound.critical", 1); | ||
expect(compiledOutput()).to.have.deep.property("aps.sound.volume", 0.75); | ||
}); | ||
describe("setSound", function() { | ||
it("is chainable", function() { | ||
expect(note.setSound("bee.caf")).to.equal(note); | ||
@@ -523,0 +535,0 @@ expect(compiledOutput()).to.have.deep.property("aps.sound", "bee.caf"); |
Sorry, the diff of this file is not supported yet
324120
4557