Socket
Socket
Sign inDemoInstall

screenshots-pagepixels

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

6

CHANGELOG.md

@@ -5,2 +5,6 @@ ## [Unreleased]

- Initial release
- Initial release
## [1.0.1] - 2023-05-05
- Ensure access token is sent in querystring for get requests.

2

package.json
{
"name": "screenshots-pagepixels",
"version": "1.0.0",
"version": "1.0.1",
"description": "Screenshots PagePixels is an NPM package that provides a simple and easy-to-use interface for working with the PagePixels API. With this package, you can easily capture screenshots, manage screenshot configurations, create recurring screenshot schedules, setup multi-step screenshots, and more. Screenshots PagePixels provides convenient methods that wrap around the API endpoints, making it easy to get started and integrate with your application.",

@@ -5,0 +5,0 @@ "main": "screenshots-pagepixels-client.js",

@@ -10,3 +10,3 @@ const http = require('http');

async request(method, path, options = {}, body = null) {
async request(method, path, options = {}) {
const url = new URL(this.apiBaseUrl + path);

@@ -24,6 +24,16 @@ const isHttps = url.protocol === 'https:';

if (body) {
let body = null;
if (method !== 'GET') {
requestOptions.headers['Content-Type'] = 'application/json';
body = JSON.stringify(body);
body = JSON.stringify(options);
requestOptions.headers['Content-Length'] = Buffer.byteLength(body);
} else {
// Convert options object to a query string
const queryString = Object.entries(options)
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
.join('&');
if (queryString) {
requestOptions.path += '?' + queryString+'&access_token='+this.bearerToken;
}
}

@@ -39,3 +49,3 @@

if (res.statusCode >= 200 && res.statusCode < 300) {
if (path === '/snap' && !options.json) {
if (path === '/snap' && method === 'GET' && !options.json) {
resolve(data);

@@ -42,0 +52,0 @@ } else {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc