Node wrapper for interacting with the Apple News Push API, a.k.a, pApi
npm install cnn-antools-push-apiA package designed to wrap Apple News's Push API
* [createReference]
* [deleteArticle]
* [deleteReference]
* [getArticle]
* [getChannel]
* [getChannelArticles]
* [getSection]
* [getSections]
* [notificationPost]
* [search]
* [sendArticle]
* [sendRequest]
* [updateReference]
Read these "_requirements_" as "_only tested with_".
- Node.js 7.x+
``shell`
$ npm install --save --save-exact cnn-antools-push-api
The --save-exact is up to you. We recommend saving exact versions.
#### Ruby 2.1.2p95+
I will be requeired that the calling application have the apple ruby papi client installed
This is intended to be used as a dependency in a larger application. Refer to
the the below example and the real example.js, that you
can run with node example/example.js.`javascript
'use strict';
const PushApi = require('cnn-antools-push-api'),
pushApi = new PushApi('
articleData = {
articleId: 'articleId of existing article or undefined',
revision: 'revision id is this is update or undefined',
articleStatus: '
savePath: '
sectionIds: '
isCandidateToBeFeatured: false,
isDevelopingStory: false
};
pushApi.sendArticle(articleData)
.then((stdout) => {
console.log(This is the published article ${stdout});some Problem happened: ${err}
})
.catch((err) => {
console.log();
});
pushApi.deleteArticle('
console.log(Article deleted: ${result});DELETE article error: ${JSON.stringify(result.error)}
}).catch((result) => {
console.error();DELETE article body: ${result.body}
console.error();
});
});
`
You can generate and view the docs locally with the commands below. The open
command will only work on MacOS.
`shell`
$ npm run generate-docs
$ open docs/index.html
- generate-authors - Generates AUTHORS.md.generate-changelog
- - Generates output to put in CHANGELOG.md.generate-coverage
- - Generates a code coverage report in /coverage.generate-docs
- - Generates ESDoc documentation in /docs.test
- - Runs all tests.update-apply
- - Updates package.json with dependency updates.update-check
- - Outputs if any dependency updates are needed.
- DEBUG=cnn-antools-push-api:* - Set to enable visible
debug logging to console.
- Always develop on the node version specified in the .nvmrc file.
If nvm is used typing nvm install`
in the terminal will insure the correct version is used.
- Contributors should be familiar with the Contributors Guide
- Collaborators should be familiar with the Collaborator Guide
- The current Project Owner (PO) of this project is Alex Sover
(@dsover).
See LICENSE.md for details.
---
♥︎ Make good art - Neil Gaiman