contentful 2.2.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfb7ac25adbea352df78579b21b29a6c5ff237a2
4
- data.tar.gz: bc52a841ad55ebcb94c047756c8d9b85fa2a72c5
3
+ metadata.gz: e169a58eaeb582e61a250dc95e7bf980c632d906
4
+ data.tar.gz: 615244247ac26f6f3be2afa7e430f12aa225687d
5
5
  SHA512:
6
- metadata.gz: 7b895005dbff369ddb41f7b262aed8416d198c9985037cb60ac4e99c5566a56123ba6e33ce44f52a94233348b5c66b5bbb005b9bd145d4897632908f20b0c0d5
7
- data.tar.gz: 933eb9a173d339e7609df6e31bbbe67bba5af941ae5c87df93477aad6393c5ab38f1dd3d70c48c62b2636284d0bb8d1a8cea252893da0dc5f227ca5db6b288e8
6
+ metadata.gz: f074a6327c040944e729763b8003899c452ff7b31fe2a52998ab2364d55cb426b3e00b10fa4eaeb925293656afb2f85c3c9385c343c22a5563cbbe97d004bf36
7
+ data.tar.gz: 721607153d1085113cd632081be420a17f2c835521116f15f3cc450f4c710f88a580d44b05541c5dc2df777afadde5faa6ed63467dfe331306cb4ecc59802616
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.3.0
6
+ ### Added
7
+ * Support for the new query parameters to find incoming links [to a specific entry](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/links-to-entry) or [to a specific asset](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/links-to-asset) in a space.
8
+
9
+ ### Fixed
10
+ * Fixes coercion issue when `DateTime` values are `nil`. [#148](https://github.com/contentful/contentful.rb/issues/148)
11
+
5
12
  ## 2.2.2
6
13
  ### Fixed
7
14
  * Fixed 404 error when `details` object contains a top level `sys` key.
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # contentful.rb
2
- [![Gem Version](https://badge.fury.io/rb/contentful.png)](http://badge.fury.io/rb/contentful) [![Build Status](https://travis-ci.org/contentful/contentful.rb.png)](https://travis-ci.org/contentful/contentful.rb) [![Coverage Status](https://coveralls.io/repos/contentful/contentful.rb/badge.png?branch=master)](https://coveralls.io/r/contentful/contentful.rb?branch=master)
2
+ [![Gem Version](https://badge.fury.io/rb/contentful.png)](http://badge.fury.io/rb/contentful) [![Build Status](https://travis-ci.org/contentful/contentful.rb.png)](https://travis-ci.org/contentful/contentful.rb)
3
3
 
4
4
  Ruby client for the [Contentful](https://www.contentful.com) Content Delivery API.
5
5
 
6
- [Contentful](https://www.contentful.com) is a content management platform for web applications, mobile apps and connected devices. It allows you to create, edit & manage content in the cloud and publish it anywhere via powerful API. Contentful offers tools for managing editorial teams and enabling cooperation between organizations.
6
+ [Contentful](https://www.contentful.com) provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.
7
7
 
8
8
  ## Setup
9
9
 
@@ -238,7 +238,7 @@ non rate limited request is available, has passed. This is blocking per executio
238
238
 
239
239
  ### :max_rate_limit_wait
240
240
 
241
- Maximum time to wait for next available request (in seconds). Default value is 60 seconds. Keep in mind that if you hit the houly rate limit maximum, you
241
+ Maximum time to wait for next available request (in seconds). Default value is 60 seconds. Keep in mind that if you hit the hourly rate limit maximum, you
242
242
  can have up to 60 minutes of blocked requests. It is set to a default of 60 seconds in order to avoid blocking processes for too long, as rate limit retry behaviour
243
243
  is blocking per execution thread.
244
244
 
@@ -1,10 +1,13 @@
1
1
  require_relative 'fields_resource'
2
2
  require_relative 'file'
3
+ require_relative 'resource_references'
3
4
 
4
5
  module Contentful
5
6
  # Resource class for Asset.
6
7
  # https://www.contentful.com/developers/documentation/content-delivery-api/#assets
7
8
  class Asset < FieldsResource
9
+ include Contentful::ResourceReferences
10
+
8
11
  # @private
9
12
  def marshal_dump
10
13
  {
@@ -359,6 +359,7 @@ module Contentful
359
359
  # See README for details.
360
360
  # @private
361
361
  def update_dynamic_entry_cache!
362
+ return if configuration[:raw_mode]
362
363
  content_types(limit: 1000).map do |ct|
363
364
  ContentTypeCache.cache_set(configuration[:space], ct.id, ct)
364
365
  end
@@ -59,6 +59,8 @@ module Contentful
59
59
  class DateCoercion < BaseCoercion
60
60
  # Coerces value to DateTime
61
61
  def coerce
62
+ return nil if value.nil?
63
+
62
64
  DateTime.parse(value)
63
65
  end
64
66
  end
@@ -1,10 +1,13 @@
1
1
  require_relative 'fields_resource'
2
2
  require_relative 'content_type_cache'
3
+ require_relative 'resource_references'
3
4
 
4
5
  module Contentful
5
6
  # Resource class for Entry.
6
7
  # @see _ https://www.contentful.com/developers/documentation/content-delivery-api/#entries
7
8
  class Entry < FieldsResource
9
+ include Contentful::ResourceReferences
10
+
8
11
  # Returns true for resources that are entries
9
12
  def entry?
10
13
  true
@@ -36,6 +36,7 @@ module Contentful
36
36
  # Coerces value to proper type
37
37
  def coerce(value)
38
38
  return value if type.nil?
39
+ return value if value.nil?
39
40
 
40
41
  options = {}
41
42
  options[:coercion_class] = KNOWN_TYPES[items.type] unless items.nil?
@@ -0,0 +1,18 @@
1
+ module Contentful
2
+ # Method to retrieve references (incoming links) for a given entry or asset
3
+ module ResourceReferences
4
+ # Gets a collection of entries which links to current entry
5
+ #
6
+ # @param [Contentful::Client] client
7
+ # @param [Hash] query
8
+ #
9
+ # @return [Contentful::Array<Contentful::Entry>, false]
10
+ def incoming_references(client = nil, query = {})
11
+ return false unless client
12
+
13
+ query = is_a?(Contentful::Entry) ? query.merge(links_to_entry: id) : query.merge(links_to_asset: id)
14
+
15
+ client.entries(query)
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  # Contentful Namespace
2
2
  module Contentful
3
3
  # Gem Version
4
- VERSION = '2.2.2'
4
+ VERSION = '2.3.0'
5
5
  end
@@ -80,6 +80,30 @@ describe Contentful::Asset do
80
80
  expect(unmarshalled.file).to be_a Contentful::File
81
81
  end
82
82
 
83
+
84
+ describe 'incoming links' do
85
+ let(:client) { create_client }
86
+
87
+ it 'will fetch entries referencing the asset using a query' do
88
+ vcr('entry/search_link_to_asset') {
89
+ entries = client.entries(links_to_asset: 'nyancat')
90
+ expect(entries).not_to be_empty
91
+ expect(entries.count).to eq 1
92
+ expect(entries.first.id).to eq 'nyancat'
93
+ }
94
+ end
95
+
96
+ it 'will fetch entries referencing the entry using instance method' do
97
+ vcr('entry/search_link_to_asset') {
98
+ entries = asset.incoming_references client
99
+ expect(entries).not_to be_empty
100
+ expect(entries.count).to eq 1
101
+ expect(entries.first.id).to eq 'nyancat'
102
+ }
103
+ end
104
+
105
+ end
106
+
83
107
  describe 'select operator' do
84
108
  let(:client) { create_client }
85
109
 
@@ -194,6 +194,39 @@ describe Contentful::Entry do
194
194
  end
195
195
  end
196
196
 
197
+ describe 'incoming links' do
198
+ let(:client) { create_client }
199
+
200
+ it 'will fetch entries referencing the entry using a query' do
201
+ vcr('entry/search_link_to_entry') {
202
+ entries = client.entries(links_to_entry: 'nyancat')
203
+ expect(entries).not_to be_empty
204
+ expect(entries.count).to eq 1
205
+ expect(entries.first.id).to eq 'happycat'
206
+ }
207
+ end
208
+
209
+ it 'will fetch entries referencing the entry using instance method' do
210
+ vcr('entry/search_link_to_entry') {
211
+ entries = entry.incoming_references client
212
+ expect(entries).not_to be_empty
213
+ expect(entries.count).to eq 1
214
+ expect(entries.first.id).to eq 'happycat'
215
+ }
216
+ end
217
+
218
+ it 'will fetch entries referencing the entry using instance method + query' do
219
+ vcr('entry/search_link_to_entry_with_custom_query') {
220
+ entries = entry.incoming_references(client, { content_type: 'cat', select: ['fields.name'] })
221
+ expect(entries).not_to be_empty
222
+ expect(entries.count).to eq 1
223
+ expect(entries.first.id).to eq 'happycat'
224
+ expect(entries.first.fields.keys).to eq([:name])
225
+ }
226
+ end
227
+
228
+ end
229
+
197
230
  describe 'select operator' do
198
231
  let(:client) { create_client }
199
232
 
@@ -78,5 +78,12 @@ describe Contentful::Field do
78
78
  expect(coercion.coerce).to eq(foo: 123)
79
79
  end
80
80
  end
81
+
82
+ describe 'datetime field' do
83
+ it 'can coerce properly when value is nil' do
84
+ coercion = Contentful::DateCoercion.new(nil)
85
+ expect(coercion.coerce).to eq(nil)
86
+ end
87
+ end
81
88
  end
82
89
  end
@@ -0,0 +1,81 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?links_to_asset=nyancat
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful.rb/2.2.2; platform ruby/2.4.2; os macOS/16;
12
+ Authorization:
13
+ - Bearer b4c0n73n7fu1
14
+ Content-Type:
15
+ - application/vnd.contentful.delivery.v1+json
16
+ Accept-Encoding:
17
+ - gzip
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - cdn.contentful.com
22
+ User-Agent:
23
+ - http.rb/2.2.2
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Access-Control-Allow-Headers:
30
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature
31
+ Access-Control-Allow-Methods:
32
+ - GET,HEAD,OPTIONS
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Access-Control-Expose-Headers:
36
+ - Etag
37
+ Access-Control-Max-Age:
38
+ - '86400'
39
+ Cache-Control:
40
+ - max-age=0
41
+ Content-Encoding:
42
+ - gzip
43
+ Content-Type:
44
+ - application/vnd.contentful.delivery.v1+json
45
+ Etag:
46
+ - W/"9707115047cc402819250f844939b2aa"
47
+ Server:
48
+ - Contentful
49
+ X-Content-Type-Options:
50
+ - nosniff
51
+ X-Contentful-Request-Id:
52
+ - ef9dce608871624f2670ca82ba892216
53
+ Content-Length:
54
+ - '1034'
55
+ Accept-Ranges:
56
+ - bytes
57
+ Date:
58
+ - Thu, 11 Jan 2018 10:33:12 GMT
59
+ Via:
60
+ - 1.1 varnish
61
+ Age:
62
+ - '0'
63
+ Connection:
64
+ - close
65
+ X-Served-By:
66
+ - cache-hhn1549-HHN
67
+ X-Cache:
68
+ - MISS
69
+ X-Cache-Hits:
70
+ - '0'
71
+ X-Timer:
72
+ - S1515666792.014147,VS0,VE416
73
+ Vary:
74
+ - Accept-Encoding
75
+ body:
76
+ encoding: ASCII-8BIT
77
+ string: !binary |-
78
+ H4sIAAAAAAAAA+VX227jNhB9z1cEet1a4kX3NyNo0QDtokC8KJCiCGiJthlLsirRm/Uu8u8lqYtJXZxF1m8rBI5EcsiZwzmHw283t7dWfaqt+PabeBUf/FRS8WUtq4qcLNH2+oscww+cZKIdqq96z0rxAdRHxnLGZRdovhmnuZzwHzVhM+1gFbVSXZJELtWNaBo1X2SDaux8+oMVe0uueX7E6sV+1fr8oGYcDGCpDCfZ0C8kLzNKSiaj6p7X/l3F2TxWY1OcSJEQrk3Ye/JrwauT3pFUlHCaLiUQFgIQL4C/QMEKodj1YxjZHsSPusGxTIcG0QK4KxCJ0TGObIACw6Cin1nNDoVYwNNcTQ4FpwVvIbgelnfavNOICmTeBDI7JCRT+USLxaeHzqDH2towmqXn9JP4WwXJlclHgf/tnbkBGdvTc3K121URVqwPL7Wx9WLqenf28F8Ds+xQyRVaQ31f1rTmv1WMFjJtrgfnMGFUoE2a7UhZnmSevYnmmlV8lwpaNjkGRb7IlBE5BoD4+6B+9WAy9lmhBTEO9PTOyfa6zFvWNdWJooXXsWg6ura1oaH8VftksSLJjqnyvdWlBsBOVc66MqEsM9oyOVI5ekFfRO9bCtNv5JzGCA3Vg9fZNEwBo69za5w71mW5QcCGAdTVQ/g4FhwIFzBcQS/2whggG8BwYKJJTmh4Ni861wB5XnrOUJt0uYTwjAS1B1urIBMyJNbqhOh3ydCBEqnEGGuRaE52lH5dH6strXRKawIkBx1aCdrKY9YAd1aBroHtOJcuU/USsqYcAbyAYIHCFcIzcqQgawXJJMGEHl0j2ClV6lNoSnYH0fas7fjb/G930mqm/yklaYzslCSJggatoBt7foxdG/lGQSM2YixJoDHxYghj5NrYH6qYJknIyKEfoDlnvKlRZni+YapbLwak85Wshy3HYTJ7a7vVxM0xE6+5ox8GDv7z8a/i+XF1X++X9/f74/FQ39W1g0NE3DDdEJSsoZ+4ARFvAdoEa4TXGxA5XY6+2M/l1lAJ4UBKOWGZWTu1clazr9JjL4pwpKPUcH2SbarrhaV8JwxRgIdmondH2XYnC1wcBdqBJi31A85QVjWtBPBjW9RdDMk8VyyFrPNc0u1MbdRVD52z5y0yLjUdKhMXjmvIzNS1o5eZ9xcF4+uHmLS/no0Kru8goAverAlaAvacHZloBFR3we6xrkHAiYq/TZ8f45+7LX1Oli9/u3f5w/aY/4fo/lPuRCkBSQoj7IcBXIdpgLCLaRh5BIDUh9CR/jyJ0vwJeaD88rSpRBLbZfEOKkI0wakmwUehKc70VPTUrdp8zlQUjr2bit8b3SQrJQp6VTt3Vor215vXm/8BI5JeymkQAAA=
79
+ http_version:
80
+ recorded_at: Thu, 11 Jan 2018 10:33:12 GMT
81
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,81 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?links_to_entry=nyancat
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful.rb/2.2.2; platform ruby/2.4.2; os macOS/16;
12
+ Authorization:
13
+ - Bearer b4c0n73n7fu1
14
+ Content-Type:
15
+ - application/vnd.contentful.delivery.v1+json
16
+ Accept-Encoding:
17
+ - gzip
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - cdn.contentful.com
22
+ User-Agent:
23
+ - http.rb/2.2.2
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Access-Control-Allow-Headers:
30
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature
31
+ Access-Control-Allow-Methods:
32
+ - GET,HEAD,OPTIONS
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Access-Control-Expose-Headers:
36
+ - Etag
37
+ Access-Control-Max-Age:
38
+ - '86400'
39
+ Cache-Control:
40
+ - max-age=0
41
+ Content-Encoding:
42
+ - gzip
43
+ Content-Type:
44
+ - application/vnd.contentful.delivery.v1+json
45
+ Etag:
46
+ - W/"c76b6c572141b78d9e4204b679b5c299"
47
+ Server:
48
+ - Contentful
49
+ X-Content-Type-Options:
50
+ - nosniff
51
+ X-Contentful-Request-Id:
52
+ - 5a7152bc4e377e529e39e086fbe9f348
53
+ Content-Length:
54
+ - '1035'
55
+ Accept-Ranges:
56
+ - bytes
57
+ Date:
58
+ - Thu, 11 Jan 2018 10:28:11 GMT
59
+ Via:
60
+ - 1.1 varnish
61
+ Age:
62
+ - '0'
63
+ Connection:
64
+ - close
65
+ X-Served-By:
66
+ - cache-hhn1528-HHN
67
+ X-Cache:
68
+ - MISS
69
+ X-Cache-Hits:
70
+ - '0'
71
+ X-Timer:
72
+ - S1515666492.771159,VS0,VE191
73
+ Vary:
74
+ - Accept-Encoding
75
+ body:
76
+ encoding: ASCII-8BIT
77
+ string: !binary |-
78
+ H4sIAAAAAAAAA91X227jNhB9z1cEem0t8aL7mxG0aIB2USBeFEhRBLRE2YwlWZXozXoX+fclqRsl006w64eiQuCIlyFnDuccjr7e3N5azbGx4tuv4lU0+LGiomUt65ocLdH3+rOcw/ec5KIfqlazY5VoANXIWcG4HAJtm3FayAX/Vgu2y852UTs1FUnkVv2MtlPzRXaozt6n31m5s+Se4yN2L3erzucHteJsAktlOElGP5OiyimpmIyqf16HdxVn+1itzZZU1TEhXFtxcOWXktdHfSCpKeE0XUokLAQgXgB/gYIVQrHrxwjYMICPusGhSmcGEC5guIJe7IUxQDaA4cSgpp9Yw/al2CDUfE32Jacl7zC4Hph32rpmSAUybyKZ7xOSq4Si5eLjQ28wgG1ljObpmH/yAKySFMrkN3kAt3fTE8jZjo7p1R1YsqX0y/pQb2g9+vTPBKV8X8s1NzKttYE1bfivNaOlTJProTfPDxVXm1blkZQyq97Ebs1qvk2FuyqjAF5AsEDhCuEYAPH3k/rVY8nZJwWNImmfygXZXJdly6ahOie00AbGmGPrelvOyV91QhYrk/yQKs87EWrR6yVkFBGDjJwREuNM5ekFMRGjb8nJcIrnBEUIph68zpzZ+U+Geq9O88a6rCwwsj2IdaEQLp5qC4gWwF2BKIZRjCMboGBmoqmLN/HsvL5cA+PzKjMiPeXKJYDPqE13iXWMMCiO2KvXnA+CnTPJUWlxKjqiuyasXO9fmvmdk7Fmq/NbUyJhlew7LerMJ9bWWUG6Btyn6fUGey+hPdUncXsBVyaZuPHM+qRw7BQK42BKDYNMXSNgk1gNmWVQ4lm8A5V7Urf/u/O02tX/pzplKH8EckN9eHILmIRKqA5aQTf2/Bi7NvLnqmMWKmHixRDGyLWxP6maJOfGMghNUugHyM8Zb4sUU8Uh9syYGtbLA9F7qGVFbDkOk8nb2J1SZodcvBaOfkM4+I/HP8vnx9V9s1ve3+8Oh31z1zQODhFxwzQjKFlDP3EDIt4ClAVrhNcZiJz+EF7s52ozl5mUcsLyafHUiVzDvkiPvSjCkY5SS3cj2dTQC0v5VhiiAM/NxOiWss1WVrg4CrRbTlrqt95Eb9WyEsAPXVV3MaTpbWMpZJ3nim7OlEt9SdE7Ox7R5LOmR8XwySG80z+A2pnK6f92pXCqbO8goAveVSnonD0x0QioFZoCr2sQ0Hz9/jj/3E3lc7J8+cu9Kx42h+JfRHcfCydKCUhSGGE/DOA6TAOEXUzDyCMApD6EjvTnSVTrT8gD1eenrBZJbFfld1ARIgOn2gQ/kRaVfgMVPfVdPX1GKgrHvpuK743OyEqJgl7qnrsrRf/rzevNN7p9LOtrEAAA
79
+ http_version:
80
+ recorded_at: Thu, 11 Jan 2018 10:28:11 GMT
81
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,115 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cdn.contentful.com/spaces/cfexampleapi/entries?content_type=cat&links_to_entry=nyancat&select=fields.name,sys
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful.rb/2.2.2; platform ruby/2.4.2; os macOS/16;
12
+ Authorization:
13
+ - Bearer b4c0n73n7fu1
14
+ Content-Type:
15
+ - application/vnd.contentful.delivery.v1+json
16
+ Accept-Encoding:
17
+ - gzip
18
+ Connection:
19
+ - close
20
+ Host:
21
+ - cdn.contentful.com
22
+ User-Agent:
23
+ - http.rb/2.2.2
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Access-Control-Allow-Headers:
30
+ - Accept,Accept-Language,Authorization,Cache-Control,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature
31
+ Access-Control-Allow-Methods:
32
+ - GET,HEAD,OPTIONS
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Access-Control-Expose-Headers:
36
+ - Etag
37
+ Access-Control-Max-Age:
38
+ - '86400'
39
+ Cache-Control:
40
+ - max-age=0
41
+ Content-Type:
42
+ - application/vnd.contentful.delivery.v1+json
43
+ Etag:
44
+ - '"73fc3e975a87e59301a93f54d56a2139"'
45
+ Server:
46
+ - Contentful
47
+ X-Content-Type-Options:
48
+ - nosniff
49
+ X-Contentful-Request-Id:
50
+ - 5e905364e78762fdc6c2f8f048c22c19
51
+ Content-Length:
52
+ - '701'
53
+ Accept-Ranges:
54
+ - bytes
55
+ Date:
56
+ - Thu, 11 Jan 2018 17:14:41 GMT
57
+ Via:
58
+ - 1.1 varnish
59
+ Age:
60
+ - '0'
61
+ Connection:
62
+ - close
63
+ X-Served-By:
64
+ - cache-hhn1531-HHN
65
+ X-Cache:
66
+ - MISS
67
+ X-Cache-Hits:
68
+ - '0'
69
+ X-Timer:
70
+ - S1515690881.084169,VS0,VE404
71
+ Vary:
72
+ - Accept-Encoding
73
+ body:
74
+ encoding: ASCII-8BIT
75
+ string: |
76
+ {
77
+ "sys": {
78
+ "type": "Array"
79
+ },
80
+ "total": 1,
81
+ "skip": 0,
82
+ "limit": 100,
83
+ "items": [
84
+ {
85
+ "fields": {
86
+ "name": "Happy Cat"
87
+ },
88
+ "sys": {
89
+ "space": {
90
+ "sys": {
91
+ "type": "Link",
92
+ "linkType": "Space",
93
+ "id": "cfexampleapi"
94
+ }
95
+ },
96
+ "id": "happycat",
97
+ "type": "Entry",
98
+ "createdAt": "2013-06-27T22:46:20.171Z",
99
+ "updatedAt": "2013-11-18T15:58:02.018Z",
100
+ "revision": 8,
101
+ "contentType": {
102
+ "sys": {
103
+ "type": "Link",
104
+ "linkType": "ContentType",
105
+ "id": "cat"
106
+ }
107
+ },
108
+ "locale": "en-US"
109
+ }
110
+ }
111
+ ]
112
+ }
113
+ http_version:
114
+ recorded_at: Thu, 11 Jan 2018 17:14:41 GMT
115
+ recorded_with: VCR 4.0.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH (Jan Lelis)
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-11-15 00:00:00.000000000 Z
13
+ date: 2018-02-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http
@@ -331,6 +331,7 @@ files:
331
331
  - doc/Contentful/RateLimitExceeded.html
332
332
  - doc/Contentful/Request.html
333
333
  - doc/Contentful/ResourceBuilder.html
334
+ - doc/Contentful/ResourceReferences.html
334
335
  - doc/Contentful/Response.html
335
336
  - doc/Contentful/ServerError.html
336
337
  - doc/Contentful/ServiceUnavailable.html
@@ -385,6 +386,7 @@ files:
385
386
  - lib/contentful/location.rb
386
387
  - lib/contentful/request.rb
387
388
  - lib/contentful/resource_builder.rb
389
+ - lib/contentful/resource_references.rb
388
390
  - lib/contentful/response.rb
389
391
  - lib/contentful/space.rb
390
392
  - lib/contentful/support.rb
@@ -458,6 +460,9 @@ files:
458
460
  - spec/fixtures/vcr_cassettes/entry/marshal_138.yml
459
461
  - spec/fixtures/vcr_cassettes/entry/marshall.yml
460
462
  - spec/fixtures/vcr_cassettes/entry/raw.yml
463
+ - spec/fixtures/vcr_cassettes/entry/search_link_to_asset.yml
464
+ - spec/fixtures/vcr_cassettes/entry/search_link_to_entry.yml
465
+ - spec/fixtures/vcr_cassettes/entry/search_link_to_entry_with_custom_query.yml
461
466
  - spec/fixtures/vcr_cassettes/entry/select_empty_array.yml
462
467
  - spec/fixtures/vcr_cassettes/entry/select_no_sys.yml
463
468
  - spec/fixtures/vcr_cassettes/entry/select_one_field.yml
@@ -591,6 +596,9 @@ test_files:
591
596
  - spec/fixtures/vcr_cassettes/entry/marshal_138.yml
592
597
  - spec/fixtures/vcr_cassettes/entry/marshall.yml
593
598
  - spec/fixtures/vcr_cassettes/entry/raw.yml
599
+ - spec/fixtures/vcr_cassettes/entry/search_link_to_asset.yml
600
+ - spec/fixtures/vcr_cassettes/entry/search_link_to_entry.yml
601
+ - spec/fixtures/vcr_cassettes/entry/search_link_to_entry_with_custom_query.yml
594
602
  - spec/fixtures/vcr_cassettes/entry/select_empty_array.yml
595
603
  - spec/fixtures/vcr_cassettes/entry/select_no_sys.yml
596
604
  - spec/fixtures/vcr_cassettes/entry/select_one_field.yml