contentful-management 3.5.0 → 3.7.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 +8 -1
- 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/request.rb +1 -1
- 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
- data/spec/support/vcr.rb +9 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48205cbf594bc68a7aff1b7017b9a46c4674c49c59af0294dd3ac16fe779deb1
|
4
|
+
data.tar.gz: 19138b713d5061b4730545a8952267904015963f5f5a06803bb3ae8ab63320fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebb8d595852045a00a7a826584316799d36b58ec2953d5ef136d4e91d06a85e938c474a5c2cc6cde808fc5a59000c47bccaad43909a227b53479a084b2383fd8
|
7
|
+
data.tar.gz: d5f33999d52caeb9a63d08dd27c386ddf1e88c01977cda743cec149870fd853d3a9d3e157d52b708aaa25cea916385d4c8d0c24511cb752784a59eb435430189
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
##
|
3
|
+
## 3.7.0
|
4
|
+
* Replaces deprecated `URI.escape` with `URI.encode_www_form_component` in Contentful::Management::Request#id
|
5
|
+
* Configured VCR to redact sensitive data
|
6
|
+
|
7
|
+
## 3.6.0
|
8
|
+
* Updated readme for Entry References
|
9
|
+
* Added examples of fetching entries by field values in readme
|
10
|
+
* Added pagination support for environments
|
4
11
|
|
5
12
|
## 3.5.0
|
6
13
|
* Added support for Entry References API
|
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
|
|