contentful-management
Advanced tools
Comparing version 0.7.0 to 0.7.1
38
index.js
@@ -133,3 +133,4 @@ 'use strict'; | ||
uri: uri, | ||
body: options.body | ||
body: options.body, | ||
headers: options.headers | ||
}); | ||
@@ -140,3 +141,4 @@ } else { | ||
uri: uri, | ||
body: options.body | ||
body: options.body, | ||
headers: options.headers | ||
}); | ||
@@ -276,2 +278,8 @@ } | ||
var contentTypeId = getId(contentType); | ||
if(!contentTypeId) { | ||
throw new PropError('Entry creation needs a content type id', { | ||
contentType: contentType, | ||
entry: entry | ||
}); | ||
} | ||
var path = creationPathForResource(this, 'Entry', entry); | ||
@@ -287,2 +295,15 @@ return this.client.request(path, { | ||
updateEntry: function(entry) { | ||
var spaceId = getId(this); | ||
var id = getId(entry); | ||
var version = getVersion(entry); | ||
return this.client.request('/spaces/' + spaceId + '/entries/' + id, { | ||
method: 'PUT', | ||
headers: { | ||
'X-Contentful-Version': version | ||
}, | ||
body: JSON.stringify(getData(entry)) | ||
}).then(_.partial(Entry.parse, this.client)); | ||
}, | ||
getEntry: function(id) { | ||
@@ -305,15 +326,2 @@ return this.client.request('/spaces/' + this.sys.id + '/entries/' + id) | ||
updateEntry: function(entry) { | ||
var spaceId = getId(this); | ||
var id = getId(entry); | ||
var version = getVersion(entry); | ||
return this.client.request('/spaces/' + spaceId + '/entries/' + id, { | ||
method: 'PUT', | ||
headers: { | ||
'X-Contentful-Version': version | ||
}, | ||
body: JSON.stringify(getData(entry)) | ||
}).then(_.partial(Entry.parse, this.client)); | ||
}, | ||
publishEntry: function(entry, publishVersion) { | ||
@@ -320,0 +328,0 @@ var spaceId = getId(this); |
{ | ||
"name": "contentful-management", | ||
"description": "Client for Contentful's Content Management API", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"homepage": "https://www.contentful.com/developers/documentation/content-management-api/", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
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
448172
5927