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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +16 -0
- data/lib/contentful/management/client.rb +2 -1
- data/lib/contentful/management/client_environment_methods_factory.rb +5 -2
- data/lib/contentful/management/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/entry/too_many_requests_retry.yml +1 -1
- data/spec/fixtures/vcr_cassettes/environment/all/limit_100.yml +1142 -0
- data/spec/fixtures/vcr_cassettes/environment/all/skip_25.yml +159 -0
- data/spec/fixtures/vcr_cassettes/environment/all.yml +986 -109
- data/spec/lib/contentful/management/entry_spec.rb +6 -1
- data/spec/lib/contentful/management/environment_spec.rb +52 -12
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9945ef61ea841e1f83ad391afb7357f4b0a5dff52b5e783db87fffe702615c32
|
4
|
+
data.tar.gz: d96b10bfd523771b0161e8fc68263efff2cd3dfba0af7b93ab92e96a77299b9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e67cf1768b981723e1a1de202bd208c14e8ce57e84d79add3632f1c813766298ce9ba37263659f7692a60f2d92b17523da0b5d441c327414b14633c95799424c
|
7
|
+
data.tar.gz: bac2a142ac94353c09f4ea59003b5583a540c5ff7981c0d336e5a8417224f374fdc05ea7fad3f2888067e6a6151ce4ff377417e27faf6ffd52118163b63deb39
|
data/CHANGELOG.md
CHANGED
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
|
-
|
22
|
+
{
|
23
|
+
space_id: @space_id
|
24
|
+
},
|
25
|
+
params
|
23
26
|
)
|
24
27
|
end
|
25
28
|
|