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

appstore-sensor

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appstore-sensor - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

coverage/clover.xml

3

package.json
{
"name": "appstore-sensor",
"version": "0.5.0",
"version": "0.5.1",
"description": "Apple AppStore application, reviews and ratings fetcher for Node.js",

@@ -32,2 +32,3 @@ "author": "Yagiz Nizipli <yagiz@nizipli.com>",

"dependencies": {
"fast-xml-parser": "^3.19.0",
"got": "^11.8.2",

@@ -34,0 +35,0 @@ "iso-3166-1": "^2.0.1"

<h1 align="center">Welcome to Appstore Sensor 👋</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-0.5.0-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-0.5.1-blue.svg?cacheSeconds=2592000" />
<img src="https://img.shields.io/badge/node-%3E%3D15.0.0-blue.svg" />

@@ -43,6 +43,6 @@ <a href='https://coveralls.io/github/socketkit/appstore-sensor?branch=main'>

* Website: https://socketkit.com
* Twitter: [@yagiznizipli](https://twitter.com/socketkitcom)
* Github: [@socketkit](https://github.com/socketkit)
* LinkedIn: [@yagiznizipli](https://linkedin.com/in/yagiznizipli)
- Website: https://socketkit.com
- Twitter: [@yagiznizipli](https://twitter.com/socketkitcom)
- Github: [@socketkit](https://github.com/socketkit)
- LinkedIn: [@yagiznizipli](https://linkedin.com/in/yagiznizipli)

@@ -49,0 +49,0 @@ ## 🤝 Contributing

@@ -45,10 +45,12 @@ import { ensureArray } from './helper.js'

id: review.id.label,
userName: review.author.name.label,
userUrl: review.author.uri.label,
version: review['im:version'].label,
score: parseInt(review['im:rating'].label),
title: review.title.label,
text: review.content.label,
url: review.link.attributes.href,
userName: review.author.name,
userUrl: review.author.uri,
version: review['im:version'],
score: parseInt(review['im:rating']),
title: review.title,
text: review.content.find((c) => c.type === 'text'),
html: review.content.find((c) => c.type === 'html'),
url: review.link.href,
updatedAt: review.updated,
}))
}
import got from 'got'
import iso from 'iso-3166-1'
import parser from 'fast-xml-parser'
import { sort } from './library/fixtures.js'
import { reviewList } from './library/normalize.js'
/**

@@ -34,3 +35,5 @@ * @param {Object} param0

throw new Error(
`Invalid sort field. Proper fields are ${Object.values(sort).join(', ')}.`,
`Invalid sort field. Proper fields are ${Object.values(sort).join(
', ',
)}.`,
)

@@ -40,6 +43,5 @@ }

const { body } = await got(
`https://itunes.apple.com/${iso_normalized.alpha2}/rss/customerreviews/page=${page}/id=${id}/sortby=${sort_by}/json`,
`https://itunes.apple.com/${iso_normalized.alpha2}/rss/customerreviews/page=${page}/id=${id}/sortby=${sort_by}/xml`,
{
method: 'GET',
responseType: 'json',
...options,

@@ -49,3 +51,27 @@ },

return reviewList(body)
try {
const parsed = parser.parse(
body,
{
attributeNamePrefix: '',
trimValues: true,
parseNodeValue: true,
parseAttributeValue: false,
textNodeName: 'text',
ignoreAttributes: false,
ignoreNameSpace: false,
format: false,
supressEmptyNode: true,
arrayMode: false,
},
true,
)
return reviewList(parsed)
} catch (error) {
throw new Error(
'XML validation failed on review response from AppStore',
error.message,
)
}
}
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