contentful-management 1.10.0 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,263 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.contentful.com/spaces/facgnwwgj5fe/locales
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"name":"Foo (BarBaz)","code":"foo-BB","optional":false,"fallbackCode":"en-US"}'
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful-management.rb/1.10.0; platform ruby/2.4.1; os macOS/16;
12
+ Authorization:
13
+ - Bearer <ACCESS_TOKEN>
14
+ Content-Type:
15
+ - application/vnd.contentful.management.v1+json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.contentful.com
20
+ User-Agent:
21
+ - http.rb/2.2.2
22
+ response:
23
+ status:
24
+ code: 201
25
+ message: Created
26
+ headers:
27
+ Accept-Ranges:
28
+ - bytes
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
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Access-Control-Expose-Headers:
36
+ - Etag
37
+ Access-Control-Max-Age:
38
+ - '1728000'
39
+ Cache-Control:
40
+ - max-age=0
41
+ Cf-Organization-Id:
42
+ - 4SsuxQCaMaemfIms52Jr8s
43
+ Cf-Space-Id:
44
+ - facgnwwgj5fe
45
+ Content-Type:
46
+ - application/vnd.contentful.management.v1+json
47
+ Date:
48
+ - Fri, 16 Feb 2018 13:31:37 GMT
49
+ Etag:
50
+ - W/"4d26ee0011d05dbd542384382c26de1a"
51
+ Location:
52
+ - https://api.contentful.com/spaces/facgnwwgj5fe/locales/4YnLeSNLymCAZ6eYwJmhzu
53
+ Server:
54
+ - Contentful
55
+ Strict-Transport-Security:
56
+ - max-age=15768000
57
+ X-Content-Type-Options:
58
+ - nosniff
59
+ X-Contentful-Ratelimit-Hour-Limit:
60
+ - '36000'
61
+ X-Contentful-Ratelimit-Hour-Remaining:
62
+ - '35995'
63
+ X-Contentful-Ratelimit-Reset:
64
+ - '0'
65
+ X-Contentful-Ratelimit-Second-Limit:
66
+ - '10'
67
+ X-Contentful-Ratelimit-Second-Remaining:
68
+ - '9'
69
+ X-Contentful-Request-Id:
70
+ - 34855fb8025ebee7ed0cb6d03ef8ff4e
71
+ X-Frame-Options:
72
+ - ALLOWALL
73
+ X-Xss-Protection:
74
+ - 1; mode=block
75
+ Content-Length:
76
+ - '760'
77
+ Connection:
78
+ - Close
79
+ Set-Cookie:
80
+ - incap_ses_408_673446=TzVtFvqmbwPurxUH54KpBTndhloAAAAAD+Zz8JoW2A76gviV7Wzz8g==;
81
+ path=/; Domain=.contentful.com
82
+ - nlbi_673446=O1dqFi5vQkxT40Qq6lKYhQAAAAAPRDdyy3Dz+i0aFRKI6mPd; path=/; Domain=.contentful.com
83
+ - visid_incap_673446=ZjS8ApmhSAGdZe+ytVgJ9jndhloAAAAAQUIPAAAAAABFbB8kAod5eoM3d0BWtWwa;
84
+ expires=Fri, 15 Feb 2019 14:29:34 GMT; path=/; Domain=.contentful.com
85
+ X-Iinfo:
86
+ - 6-10588518-10588523 NNNN CT(89 88 0) RT(1518787897101 43) q(0 0 2 -1) r(5
87
+ 5) U5
88
+ X-Cdn:
89
+ - Incapsula
90
+ body:
91
+ encoding: ASCII-8BIT
92
+ string: |+
93
+ {
94
+ "name":"Foo (BarBaz)",
95
+ "internal_code":"foo-BB",
96
+ "code":"foo-BB",
97
+ "fallbackCode":"en-US",
98
+ "default":false,
99
+ "contentManagementApi":true,
100
+ "contentDeliveryApi":true,
101
+ "optional":false,
102
+ "sys":{
103
+ "type":"Locale",
104
+ "id":"4YnLeSNLymCAZ6eYwJmhzu",
105
+ "version":0,
106
+ "space":{
107
+ "sys":{
108
+ "type":"Link",
109
+ "linkType":"Space",
110
+ "id":"facgnwwgj5fe"
111
+ }
112
+ },
113
+ "createdBy":{
114
+ "sys":{
115
+ "type":"Link",
116
+ "linkType":"User",
117
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
118
+ }
119
+ },
120
+ "createdAt":"2018-02-16T13:31:37Z",
121
+ "updatedBy":{
122
+ "sys":{
123
+ "type":"Link",
124
+ "linkType":"User",
125
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
126
+ }
127
+ },
128
+ "updatedAt":"2018-02-16T13:31:37Z"
129
+ }
130
+ }
131
+
132
+ http_version:
133
+ recorded_at: Fri, 16 Feb 2018 13:31:37 GMT
134
+ - request:
135
+ method: get
136
+ uri: https://api.contentful.com/spaces/facgnwwgj5fe/locales/4YnLeSNLymCAZ6eYwJmhzu
137
+ body:
138
+ encoding: US-ASCII
139
+ string: ''
140
+ headers:
141
+ X-Contentful-User-Agent:
142
+ - sdk contentful-management.rb/1.10.0; platform ruby/2.4.1; os macOS/16;
143
+ Authorization:
144
+ - Bearer <ACCESS_TOKEN>
145
+ Content-Type:
146
+ - application/vnd.contentful.management.v1+json
147
+ Connection:
148
+ - close
149
+ Host:
150
+ - api.contentful.com
151
+ User-Agent:
152
+ - http.rb/2.2.2
153
+ response:
154
+ status:
155
+ code: 200
156
+ message: OK
157
+ headers:
158
+ Accept-Ranges:
159
+ - bytes
160
+ Access-Control-Allow-Headers:
161
+ - 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
162
+ Access-Control-Allow-Methods:
163
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
164
+ Access-Control-Allow-Origin:
165
+ - "*"
166
+ Access-Control-Expose-Headers:
167
+ - Etag
168
+ Access-Control-Max-Age:
169
+ - '1728000'
170
+ Cache-Control:
171
+ - max-age=0
172
+ Cf-Organization-Id:
173
+ - 4SsuxQCaMaemfIms52Jr8s
174
+ Cf-Space-Id:
175
+ - facgnwwgj5fe
176
+ Content-Type:
177
+ - application/vnd.contentful.management.v1+json
178
+ Date:
179
+ - Fri, 16 Feb 2018 13:31:38 GMT
180
+ Etag:
181
+ - W/"4d26ee0011d05dbd542384382c26de1a"
182
+ Server:
183
+ - Contentful
184
+ Strict-Transport-Security:
185
+ - max-age=15768000
186
+ X-Content-Type-Options:
187
+ - nosniff
188
+ X-Contentful-Ratelimit-Hour-Limit:
189
+ - '36000'
190
+ X-Contentful-Ratelimit-Hour-Remaining:
191
+ - '35994'
192
+ X-Contentful-Ratelimit-Reset:
193
+ - '0'
194
+ X-Contentful-Ratelimit-Second-Limit:
195
+ - '10'
196
+ X-Contentful-Ratelimit-Second-Remaining:
197
+ - '9'
198
+ X-Contentful-Request-Id:
199
+ - 2f68be92a153a1944ff1572bb6bcc486
200
+ X-Frame-Options:
201
+ - ALLOWALL
202
+ X-Xss-Protection:
203
+ - 1; mode=block
204
+ Content-Length:
205
+ - '760'
206
+ Connection:
207
+ - Close
208
+ Set-Cookie:
209
+ - incap_ses_408_673446=1OBlJGeINDCGsBUH54KpBTrdhloAAAAA8oKemEaA5/YFuef5JPknUw==;
210
+ path=/; Domain=.contentful.com
211
+ - nlbi_673446=ZSw/dbPBLn8DlBZN6lKYhQAAAAAvl00f0+ZMueBQurmrxnHy; path=/; Domain=.contentful.com
212
+ - visid_incap_673446=81TdzYTaTa+W8hVmrOv5bzrdhloAAAAAQUIPAAAAAAB8wsUxyXZU9QOWwsf1WNRK;
213
+ expires=Fri, 15 Feb 2019 14:29:34 GMT; path=/; Domain=.contentful.com
214
+ X-Iinfo:
215
+ - 6-10588599-10588609 NNNN CT(92 93 0) RT(1518787897665 75) q(0 0 2 -1) r(4
216
+ 4) U5
217
+ X-Cdn:
218
+ - Incapsula
219
+ body:
220
+ encoding: ASCII-8BIT
221
+ string: |+
222
+ {
223
+ "name":"Foo (BarBaz)",
224
+ "internal_code":"foo-BB",
225
+ "code":"foo-BB",
226
+ "fallbackCode":"en-US",
227
+ "default":false,
228
+ "contentManagementApi":true,
229
+ "contentDeliveryApi":true,
230
+ "optional":false,
231
+ "sys":{
232
+ "type":"Locale",
233
+ "id":"4YnLeSNLymCAZ6eYwJmhzu",
234
+ "version":0,
235
+ "space":{
236
+ "sys":{
237
+ "type":"Link",
238
+ "linkType":"Space",
239
+ "id":"facgnwwgj5fe"
240
+ }
241
+ },
242
+ "createdBy":{
243
+ "sys":{
244
+ "type":"Link",
245
+ "linkType":"User",
246
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
247
+ }
248
+ },
249
+ "createdAt":"2018-02-16T13:31:37Z",
250
+ "updatedBy":{
251
+ "sys":{
252
+ "type":"Link",
253
+ "linkType":"User",
254
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
255
+ }
256
+ },
257
+ "updatedAt":"2018-02-16T13:31:37Z"
258
+ }
259
+ }
260
+
261
+ http_version:
262
+ recorded_at: Fri, 16 Feb 2018 13:31:37 GMT
263
+ recorded_with: VCR 3.0.3
@@ -6,7 +6,7 @@ require 'contentful/management/asset'
6
6
  module Contentful
7
7
  module Management
8
8
  describe Asset do
9
- let(:token) { '<ACCESS_TOKEN>' }
9
+ let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
10
10
  let(:space_id) { 'yr5m0jky5hsh' }
11
11
  let(:asset_id) { '3PYa73pXXiAmKqm8eu4qOS' }
12
12
  let(:asset_id_2) { '5FDqplZoruAUGmiSa02asE' }
@@ -474,6 +474,17 @@ module Contentful
474
474
  expect(asset.image_url(w: 100, h: 100, fm: 'format', q: 1)).to eq 'http://assets.com/asset.jpg?w=100&h=100&fm=format&q=1'
475
475
  end
476
476
  end
477
+
478
+ describe 'issues' do
479
+ describe "Pagination on assets doesn't work without first calling limit - #143" do
480
+ it 'shouldnt break on next page without parameters on original query' do
481
+ vcr('asset/143_assets_next_page') do
482
+ assets = subject.all('facgnwwgj5fe')
483
+ assets.next_page
484
+ end
485
+ end
486
+ end
487
+ end
477
488
  end
478
489
  end
479
490
  end
@@ -5,7 +5,7 @@ require 'contentful/management/client'
5
5
  module Contentful
6
6
  module Management
7
7
  describe Locale do
8
- let(:token) { '<ACCESS_TOKEN>' }
8
+ let(:token) { ENV.fetch('CF_TEST_CMA_TOKEN', '<ACCESS_TOKEN>') }
9
9
  let(:space_id) { 'n6spjc167pc2' }
10
10
  let(:locale_id) { '0X5xcjckv6RMrd9Trae81p' }
11
11
 
@@ -159,6 +159,17 @@ module Contentful
159
159
  end
160
160
  end
161
161
  end
162
+
163
+ describe 'issues' do
164
+ let!(:space_id) { 'facgnwwgj5fe' }
165
+ it 'should be able to create a locale with a fallback code' do
166
+ vcr('locale/fallback_code') do
167
+ locale = subject.create(space_id, name: 'Foo (BarBaz)', code: 'foo-BB', fallback_code: 'en-US')
168
+
169
+ expect(subject.find(space_id, locale.id).code).to eq 'foo-BB'
170
+ end
171
+ end
172
+ end
162
173
  end
163
174
  end
164
175
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-management
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Protas
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-10-30 00:00:00.000000000 Z
13
+ date: 2018-02-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http
@@ -406,6 +406,7 @@ files:
406
406
  - spec/fixtures/vcr_cassettes/api_key/find.yml
407
407
  - spec/fixtures/vcr_cassettes/api_key/find_for_space_not_found.yml
408
408
  - spec/fixtures/vcr_cassettes/array_page_1.yml
409
+ - spec/fixtures/vcr_cassettes/asset/143_assets_next_page.yml
409
410
  - spec/fixtures/vcr_cassettes/asset/all.yml
410
411
  - spec/fixtures/vcr_cassettes/asset/all_public.yml
411
412
  - spec/fixtures/vcr_cassettes/asset/archive.yml
@@ -587,6 +588,7 @@ files:
587
588
  - spec/fixtures/vcr_cassettes/locale/all_for_space.yml
588
589
  - spec/fixtures/vcr_cassettes/locale/create_for_space.yml
589
590
  - spec/fixtures/vcr_cassettes/locale/destroy.yml
591
+ - spec/fixtures/vcr_cassettes/locale/fallback_code.yml
590
592
  - spec/fixtures/vcr_cassettes/locale/find.yml
591
593
  - spec/fixtures/vcr_cassettes/locale/find_default.yml
592
594
  - spec/fixtures/vcr_cassettes/locale/find_for_space_not_found.yml
@@ -738,7 +740,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
738
740
  version: '0'
739
741
  requirements: []
740
742
  rubyforge_project:
741
- rubygems_version: 2.6.11
743
+ rubygems_version: 2.6.14
742
744
  signing_key:
743
745
  specification_version: 4
744
746
  summary: contentful management api
@@ -774,6 +776,7 @@ test_files:
774
776
  - spec/fixtures/vcr_cassettes/api_key/find.yml
775
777
  - spec/fixtures/vcr_cassettes/api_key/find_for_space_not_found.yml
776
778
  - spec/fixtures/vcr_cassettes/array_page_1.yml
779
+ - spec/fixtures/vcr_cassettes/asset/143_assets_next_page.yml
777
780
  - spec/fixtures/vcr_cassettes/asset/all.yml
778
781
  - spec/fixtures/vcr_cassettes/asset/all_public.yml
779
782
  - spec/fixtures/vcr_cassettes/asset/archive.yml
@@ -955,6 +958,7 @@ test_files:
955
958
  - spec/fixtures/vcr_cassettes/locale/all_for_space.yml
956
959
  - spec/fixtures/vcr_cassettes/locale/create_for_space.yml
957
960
  - spec/fixtures/vcr_cassettes/locale/destroy.yml
961
+ - spec/fixtures/vcr_cassettes/locale/fallback_code.yml
958
962
  - spec/fixtures/vcr_cassettes/locale/find.yml
959
963
  - spec/fixtures/vcr_cassettes/locale/find_default.yml
960
964
  - spec/fixtures/vcr_cassettes/locale/find_for_space_not_found.yml