🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@parse/node-apn

Package Overview
Dependencies
Maintainers
4
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parse/node-apn - npm Package Compare versions

Comparing version
6.4.3
to
6.5.0
+3
-9
.github/workflows/release-automated.yml

@@ -10,3 +10,3 @@ name: release-automated

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:

@@ -17,10 +17,4 @@ persist-credentials: false

with:
node-version: 14
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version: 18
cache: npm
- name: Install dependencies

@@ -27,0 +21,0 @@ run: npm ci

@@ -0,1 +1,8 @@

# [6.5.0](https://github.com/parse-community/node-apn/compare/6.4.3...6.5.0) (2025-03-13)
### Features
* Add `input-push-channel` and `input-push-token` to APS ([#177](https://github.com/parse-community/node-apn/issues/177)) ([a0f5230](https://github.com/parse-community/node-apn/commit/a0f5230983199747f38b621c84b196163a088474))
## [6.4.3](https://github.com/parse-community/node-apn/compare/6.4.2...6.4.3) (2025-02-11)

@@ -2,0 +9,0 @@

@@ -136,2 +136,4 @@ /// <reference types="node" />

"dismissal-date"?: number
"input-push-channel"?: string
"input-push-token"?: number
"attributes-type"?: string

@@ -138,0 +140,0 @@ attributes?: Object

@@ -182,2 +182,32 @@ module.exports = {

set filterCriteria(value) {
if (typeof value === 'string' || value === undefined) {
this.aps['filter-criteria'] = value;
}
},
set inputPushChannel(value) {
if (typeof value === 'string' || value === undefined) {
this.aps['input-push-channel'] = value;
}
},
set inputPushToken(value) {
if (typeof value === 'number' || value === undefined) {
this.aps['input-push-token'] = value;
}
},
set attributesType(value) {
if (typeof value === 'string' || value === undefined) {
this.aps['attributes-type'] = value;
}
},
set attributes(value) {
if (typeof value === 'object' || value === undefined) {
this.aps['attributes'] = value;
}
},
prepareAlert: function () {

@@ -184,0 +214,0 @@ if (typeof this.aps.alert !== 'object') {

@@ -60,2 +60,7 @@ /**

'dismissalDate',
'filterCriteria',
'inputPushChannel',
'inputPushToken',
'attributesType',
'attributes',
].forEach(propName => {

@@ -62,0 +67,0 @@ const methodName = 'set' + propName[0].toUpperCase() + propName.slice(1);

{
"name": "@parse/node-apn",
"description": "An interface to the Apple Push Notification service for Node.js",
"version": "6.4.3",
"version": "6.5.0",
"author": "Parse Platform, Andrew Naylor <argon@mkbot.net>",

@@ -6,0 +6,0 @@ "keywords": [

@@ -1102,2 +1102,155 @@ const Notification = require('../../lib/notification');

describe('input-push-channel', function () {
it('defaults to undefined', function () {
expect(compiledOutput()).to.not.have.nested.property('aps.input-push-channel');
});
it('can be set to a string', function () {
note.inputPushChannel = 'the-input-push-channel';
expect(compiledOutput()).to.have.nested.property(
'aps.input-push-channel',
'the-input-push-channel'
);
});
it('can be set to undefined', function () {
note.inputPushChannel = 'input-push-channel';
note.inputPushChannel = undefined;
expect(compiledOutput()).to.not.have.nested.property('aps.input-push-channel');
});
describe('setInputPushChannel', function () {
it('is chainable', function () {
expect(note.setInputPushChannel('the-input-push-channel')).to.equal(note);
expect(compiledOutput()).to.have.nested.property(
'aps.input-push-channel',
'the-input-push-channel'
);
});
});
});
describe('input-push-token', function () {
it('defaults to undefined', function () {
expect(compiledOutput()).to.not.have.nested.property('aps.input-push-token');
});
it('can be set to a number', function () {
note.inputPushToken = 1;
expect(compiledOutput()).to.have.nested.property('aps.input-push-token', 1);
});
it('can be set to undefined', function () {
note.inputPushToken = 1;
note.inputPushToken = undefined;
expect(compiledOutput()).to.not.have.nested.property('aps.input-push-token');
});
describe('setInputPushToken', function () {
it('is chainable', function () {
expect(note.setInputPushToken(1)).to.equal(note);
expect(compiledOutput()).to.have.nested.property('aps.input-push-token', 1);
});
});
});
describe('filter-criteria', function () {
it('defaults to undefined', function () {
expect(compiledOutput()).to.not.have.nested.property('aps.filter-criteria');
});
it('can be set to a string', function () {
note.filterCriteria = 'the-filter-criteria';
expect(compiledOutput()).to.have.nested.property(
'aps.filter-criteria',
'the-filter-criteria'
);
});
it('can be set to undefined', function () {
note.filterCriteria = 'filter-criteria';
note.filterCriteria = undefined;
expect(compiledOutput()).to.not.have.nested.property('aps.filter-criteria');
});
describe('setFilterCriteria', function () {
it('is chainable', function () {
expect(note.setFilterCriteria('the-filter-criteria')).to.equal(note);
expect(compiledOutput()).to.have.nested.property(
'aps.filter-criteria',
'the-filter-criteria'
);
});
});
});
describe('attributes-type', function () {
it('defaults to undefined', function () {
expect(compiledOutput()).to.not.have.nested.property('aps.attributes-type');
});
it('can be set to a string', function () {
note.attributesType = 'the-attributes-type';
expect(compiledOutput()).to.have.nested.property(
'aps.attributes-type',
'the-attributes-type'
);
});
it('can be set to undefined', function () {
note.attributesType = 'attributes-type';
note.attributesType = undefined;
expect(compiledOutput()).to.not.have.nested.property('aps.attributes-type');
});
describe('setAttributesType', function () {
it('is chainable', function () {
expect(note.setAttributesType('the-attributes-type')).to.equal(note);
expect(compiledOutput()).to.have.nested.property(
'aps.attributes-type',
'the-attributes-type'
);
});
});
});
describe('attributes', function () {
const payload = { foo: 'bar' };
it('defaults to undefined', function () {
expect(compiledOutput()).to.not.have.nested.property('aps.attributes');
});
it('can be set to a object', function () {
note.attributes = payload;
expect(compiledOutput())
.to.have.nested.property('aps.attributes')
.that.deep.equals(payload);
});
it('can be set to undefined', function () {
note.attributes = payload;
note.attributes = undefined;
expect(compiledOutput()).to.not.have.nested.property('aps.attributes');
});
describe('setAttributes', function () {
it('is chainable', function () {
expect(note.setAttributes(payload)).to.equal(note);
expect(compiledOutput())
.to.have.nested.property('aps.attributes')
.that.deep.equals(payload);
});
});
});
context('when no aps properties are set', function () {

@@ -1104,0 +1257,0 @@ it('is not present', function () {