shopify-api-node
Advanced tools
Comparing version 2.14.0 to 2.14.1
{ | ||
"name": "shopify-api-node", | ||
"version": "2.14.0", | ||
"version": "2.14.1", | ||
"description": "Shopify API bindings for Node.js", | ||
@@ -19,14 +19,14 @@ "main": "index.js", | ||
"dependencies": { | ||
"got": "^8.0.0", | ||
"lodash": "^4.6.0", | ||
"qs": "^6.1.0", | ||
"got": "^8.3.1", | ||
"lodash": "^4.17.10", | ||
"qs": "^6.5.2", | ||
"stopcock": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.0.0", | ||
"eslint": "^4.0.0", | ||
"istanbul": "^0.4.2", | ||
"mocha": "^5.0.0", | ||
"nock": "^9.0.0", | ||
"pre-commit": "^1.1.2" | ||
"chai": "^4.1.2", | ||
"eslint": "^4.19.1", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^5.1.1", | ||
"nock": "^9.2.5", | ||
"pre-commit": "^1.2.2" | ||
}, | ||
@@ -33,0 +33,0 @@ "scripts": { |
@@ -31,3 +31,4 @@ # Shopify API Node.js (Official module) | ||
- `shopName` - Required - A string that specifies the shop name. | ||
- `shopName` - Required - A string that specifies the shop name. The shop's | ||
"myshopify.com" domain is also accepted. | ||
- `apiKey` - Required for [private][generate-private-app-credentials] apps - A | ||
@@ -121,2 +122,56 @@ string that specifies the API key of the app. This option must be used in | ||
The Shopify API requires that you send a valid JSON string in the request body | ||
including the name of the resource. For example, the request body to create a | ||
country should be: | ||
```json | ||
{ | ||
"country": { | ||
"code": "FR", | ||
"tax": 0.25 | ||
} | ||
} | ||
``` | ||
When using `shopify-api-node` you don't have to specify the full object but | ||
only the nested one as the module automatically wraps the provided data. Using | ||
the above example this translates to: | ||
```js | ||
shopify.country.create({ code: 'FR', tax: 0.25 }) | ||
.then(country => console.log(country)) | ||
.catch(err => console.error(err)); | ||
``` | ||
Similarly, the Shopify API includes the resource name in the JSON string that | ||
is returned in the response body: | ||
```json | ||
{ | ||
"country": { | ||
"id": 1070231510, | ||
"name": "France", | ||
"tax": 0.2, | ||
"code": "FR", | ||
"tax_name": "TVA", | ||
"provinces": [] | ||
} | ||
} | ||
``` | ||
`shopify-api-node` automatically unwraps the parsed object and returns: | ||
```js | ||
{ | ||
id: 1070231510, | ||
name: 'France', | ||
tax: 0.2, | ||
code: 'FR', | ||
tax_name: 'TVA', | ||
provinces: [] | ||
} | ||
``` | ||
This behavior is valid for all resources. | ||
#### Metafields | ||
@@ -269,3 +324,3 @@ | ||
- discountCode | ||
- `create(priceRuleId, params)` | ||
- `create(priceRuleId, params)` | ||
- `delete(priceRuleId, id)` | ||
@@ -272,0 +327,0 @@ - `get(priceRuleId, id)` |
@@ -37,7 +37,6 @@ 'use strict'; | ||
const url = this.buildUrl(`${id}/activate`); | ||
return this.shopify.request(url, 'POST', undefined, { | ||
[this.key]: params | ||
}); | ||
return this.shopify.request(url, 'POST', undefined, { [this.key]: params }) | ||
.then(body => body[this.key]); | ||
}; | ||
module.exports = RecurringApplicationCharge; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148353
3938
605
Updatedgot@^8.3.1
Updatedlodash@^4.17.10
Updatedqs@^6.5.2