New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

woocommerce-api

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

woocommerce-api - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

33

index.js

@@ -33,3 +33,3 @@ 'use strict';

this.classVersion = '1.0.4';
this.classVersion = '1.1.0';
this._setDefaultsOptions(opt);

@@ -44,9 +44,10 @@ }

WooCommerceAPI.prototype._setDefaultsOptions = function(opt) {
this.url = opt.url;
this.version = opt.version || 'v3';
this.isSsl = /^https/i.test(this.url);
this.consumerKey = opt.consumerKey;
this.consumerSecret = opt.consumerSecret;
this.verifySsl = false === opt.verifySsl ? false : true;
this.encoding = opt.encoding || 'utf8';
this.url = opt.url;
this.version = opt.version || 'v3';
this.isSsl = /^https/i.test(this.url);
this.consumerKey = opt.consumerKey;
this.consumerSecret = opt.consumerSecret;
this.verifySsl = false === opt.verifySsl ? false : true;
this.encoding = opt.encoding || 'utf8';
this.queryStringAuth = opt.queryStringAuth || false;
};

@@ -152,6 +153,14 @@

if (this.isSsl) {
params.auth = {
user: this.consumerKey,
pass: this.consumerSecret
};
if (this.queryStringAuth) {
params.qs = {
consumer_key: this.consumerKey,
consumer_secret: this.consumerSecret
};
} else {
params.auth = {
user: this.consumerKey,
pass: this.consumerSecret
};
}
if (!this.verifySsl) {

@@ -158,0 +167,0 @@ params.strictSSL = false;

{
"name": "woocommerce-api",
"description": "A Node.js wrapper for the WooCommerce REST API",
"version": "1.0.4",
"version": "1.1.0",
"scripts": {

@@ -6,0 +6,0 @@ "lint": "jshint .",

@@ -36,10 +36,11 @@ # WooCommerce API - Node.js Client

| Option | Type | Required | Description |
| ---------------- | -------- | -------- | --------------------------------------------------------------------------------------------------- |
| `url` | `String` | yes | Your Store URL, example: http://woo.dev/ |
| `consumerKey` | `String` | yes | Your API consumer key |
| `consumerSecret` | `String` | yes | Your API consumer secret |
| `version` | `String` | no | API version, default is `v3` |
| `verifySsl` | `Bool` | no | Verify SSL when connect, use this option as `false` when need to test with self-signed certificates |
| `encoding` | `String` | no | Encoding, default is 'utf-8' |
| Option | Type | Required | Description |
|-------------------|----------|----------|-----------------------------------------------------------------------------------------------------|
| `url` | `String` | yes | Your Store URL, example: http://woo.dev/ |
| `consumerKey` | `String` | yes | Your API consumer key |
| `consumerSecret` | `String` | yes | Your API consumer secret |
| `version` | `String` | no | API version, default is `v3` |
| `verifySsl` | `Bool` | no | Verify SSL when connect, use this option as `false` when need to test with self-signed certificates |
| `encoding` | `String` | no | Encoding, default is 'utf-8' |
| `queryStringAuth` | `Bool` | no | When `true` and using under HTTPS force Basic Authentication as query string, default is `false` |

@@ -76,2 +77,3 @@ ## Methods

- 2016-02-22 - v1.1.0 - Added `queryStringAuth` option to allow Basic Authentication as query string.
- 2015-12-07 - v1.0.4 - Updated dependencies and fixed brackets when sorting query string.

@@ -78,0 +80,0 @@ - 2015-12-07 - v1.0.3 - Added method to properly sort query strings when using oAuth.

Sorry, the diff of this file is not supported yet

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