contentful-management 3.5.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60951b91e0b816f76ce81387b1be4d70673f7365b384161d3882fadbc04d947e
4
- data.tar.gz: ffbde8522e8ffb96dd247f2c14508e48b505ca00f6e4c71047f905472cc30eb0
3
+ metadata.gz: 9945ef61ea841e1f83ad391afb7357f4b0a5dff52b5e783db87fffe702615c32
4
+ data.tar.gz: d96b10bfd523771b0161e8fc68263efff2cd3dfba0af7b93ab92e96a77299b9f
5
5
  SHA512:
6
- metadata.gz: dbda6173a0e1cb13a62f4f9aa8274969a011bca71866aab1be0983f367dfabb6041b2cc132c9fbb5b4d22d235e9d07647c6ec28a6ebe84cfd2ddffb3f1c09271
7
- data.tar.gz: fac67fa15e95c1dbdcf44c9ebe0934d7be17d54825dc24f16b12cea7a1b746f90ba31b301b4023040a815b97574b89eb3ad09c0f476f36eb3170dfeb02166cf7
6
+ metadata.gz: e67cf1768b981723e1a1de202bd208c14e8ce57e84d79add3632f1c813766298ce9ba37263659f7692a60f2d92b17523da0b5d441c327414b14633c95799424c
7
+ data.tar.gz: bac2a142ac94353c09f4ea59003b5583a540c5ff7981c0d336e5a8417224f374fdc05ea7fad3f2888067e6a6151ce4ff377417e27faf6ffd52118163b63deb39
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 3.6.0
6
+ * Updated readme for Entry References
7
+ * Added examples of fetching entries by field values in readme
8
+ * Added pagination support for environments
9
+
5
10
  ## 3.5.0
6
11
  * Added support for Entry References API
7
12
 
data/README.md CHANGED
@@ -331,6 +331,14 @@ Retrieving an entry by ID:
331
331
  entry = environment.entries.find('entry_id')
332
332
  ```
333
333
 
334
+ Retrieving entries by any other field value:
335
+
336
+ ```ruby
337
+ entries = environment.entries.all(content_type: content_type.id, 'fields.fieldName' => 'value')
338
+ ```
339
+
340
+ Note: all [search parameters](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/search-parameters) are supported.
341
+
334
342
  Creating a location:
335
343
 
336
344
  ```ruby
@@ -1096,6 +1104,14 @@ Retrieving a snapshot for a given entry:
1096
1104
  snapshot = entry.snapshots.find('some_snapshot_id')
1097
1105
  ```
1098
1106
 
1107
+ ### Entry references
1108
+
1109
+ Retrieving entry references:
1110
+
1111
+ ```ruby
1112
+ references = entry.references(include: 1)
1113
+ ```
1114
+
1099
1115
  ### Content Type Snapshots
1100
1116
 
1101
1117
  Retrieving all snapshots for a given content type:
@@ -393,7 +393,6 @@ module Contentful
393
393
  logger.info(request: { url: url, query: request.query, header: request_headers(request) }) if logger
394
394
  raw_response = yield(url)
395
395
  logger.debug(response: raw_response) if logger
396
- clear_headers
397
396
  result = Response.new(raw_response, request)
398
397
  fail result.object if result.object.is_a?(Error) && configuration[:raise_errors]
399
398
  rescue Contentful::Management::RateLimitExceeded => rate_limit_error
@@ -406,6 +405,8 @@ module Contentful
406
405
  end
407
406
 
408
407
  raise
408
+ ensure
409
+ clear_headers
409
410
  end
410
411
 
411
412
  result
@@ -17,9 +17,12 @@ module Contentful
17
17
  # Gets a collection of environments.
18
18
  #
19
19
  # @return [Contentful::Management::Array<Contentful::Management::Environment>]
20
- def all
20
+ def all(params = {})
21
21
  @resource_requester.all(
22
- space_id: @space_id
22
+ {
23
+ space_id: @space_id
24
+ },
25
+ params
23
26
  )
24
27
  end
25
28
 
@@ -3,6 +3,6 @@ module Contentful
3
3
  # Management Namespace
4
4
  module Management
5
5
  # Gem Version
6
- VERSION = '3.5.0'.freeze
6
+ VERSION = '3.6.0'.freeze
7
7
  end
8
8
  end
@@ -743,7 +743,7 @@ http_interactions:
743
743
  Content-Type:
744
744
  - application/vnd.contentful.management.v1+json
745
745
  X-Contentful-Version:
746
- - '30'
746
+ - '1'
747
747
  Content-Length:
748
748
  - '0'
749
749
  Host: