contentful-management 2.1.0 → 2.1.1

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
  SHA256:
3
- metadata.gz: e9ee1535df6db39a73f0eba091acdeb3e90250e74a911e73faefc7fb23f90ef6
4
- data.tar.gz: 92f738e34c2247f8b831fee2449a4702a1598b3be3b200ce37e1517e5ba700dc
3
+ metadata.gz: 2f95f883c330daeed001dad534024cc80a84e774630afd0fa69790d03e88e222
4
+ data.tar.gz: 26fc16a41a90bc8721e1b053d6377896519ce76210430f1542e13e9f8fbce9e6
5
5
  SHA512:
6
- metadata.gz: 85026e49bf8c1a2915462600063a39098ea547732324d82a68885319732007683bca4191db95d5cc303fc90ed0954edc92be2b67022ff7df9c96387cd3972917
7
- data.tar.gz: d3a7dbd58d80e868a0b70f544422dd1c1803f777ce0483295cf9f146d406bf22e41f5fa900e47aa739a6998b66a15236d921fa1878a88ffa94d1471cc9259441
6
+ metadata.gz: 7342e52fb154aa3998cc3c11b3fc3eeb47fa1113f43e1dedc36e6a1042f553b9be7ca6caaa76d92267980cc654753f5d3c1ed8b127e9599e4964afe55fc477fd
7
+ data.tar.gz: 29ca251cdd60a04312551ba6cd2ca5b2443a674cac6a170f58e074264633f23ec6e2a8841cc3172287976a5892d63ee654222d8c48f53f41d5f162a7115cce3c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Master
4
4
 
5
+ ## 2.1.1
6
+ ### Fixed
7
+ * Fixed query parameter forwarding when querying from an environment proxy. [#160](https://github.com/contentful/contentful-management.rb/issues/160)
8
+
5
9
  ## 2.1.0
6
10
  ### Added
7
11
  * Added environment selection option for Api Keys.
@@ -11,8 +11,8 @@ module Contentful
11
11
  @environment = environment
12
12
  end
13
13
 
14
- def all(_params = {})
15
- associated_class.all(environment.client, environment.sys[:space].id, environment.id)
14
+ def all(params = {})
15
+ associated_class.all(environment.client, environment.sys[:space].id, environment.id, params)
16
16
  end
17
17
 
18
18
  def find(id)
@@ -3,6 +3,6 @@ module Contentful
3
3
  # Management Namespace
4
4
  module Management
5
5
  # Gem Version
6
- VERSION = '2.1.0'.freeze
6
+ VERSION = '2.1.1'.freeze
7
7
  end
8
8
  end
@@ -0,0 +1,446 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/facgnwwgj5fe
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful-management.rb/2.1.0; platform ruby/2.5.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: 200
25
+ message: OK
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
+ - Tue, 15 May 2018 13:56:53 GMT
49
+ Etag:
50
+ - W/"2f3dfae3ec7e58a21484de15f2c063b5"
51
+ Server:
52
+ - Contentful
53
+ Strict-Transport-Security:
54
+ - max-age=15768000
55
+ X-Content-Type-Options:
56
+ - nosniff
57
+ X-Contentful-Ratelimit-Hour-Limit:
58
+ - '36000'
59
+ X-Contentful-Ratelimit-Hour-Remaining:
60
+ - '35997'
61
+ X-Contentful-Ratelimit-Reset:
62
+ - '0'
63
+ X-Contentful-Ratelimit-Second-Limit:
64
+ - '10'
65
+ X-Contentful-Ratelimit-Second-Remaining:
66
+ - '9'
67
+ X-Contentful-Request-Id:
68
+ - d51811c1dc4140dab11deada47d4338a
69
+ X-Frame-Options:
70
+ - ALLOWALL
71
+ X-Xss-Protection:
72
+ - 1; mode=block
73
+ Content-Length:
74
+ - '469'
75
+ Connection:
76
+ - Close
77
+ Set-Cookie:
78
+ - incap_ses_467_673446=8WB8XH9TZFmvPx0WiR97BiTn+loAAAAAX27A3jCfg4enk6FskSRzPw==;
79
+ path=/; Domain=.contentful.com
80
+ - nlbi_673446=Bj63DVB4oU6USdRx6lKYhQAAAADvjw5mKzJMvunfFOBkOhPG; path=/; Domain=.contentful.com
81
+ - visid_incap_673446=F2nDRwCbSzOttd5bVUl57iTn+loAAAAAQUIPAAAAAADJYnR+9oj9KdQIyv7uUz6T;
82
+ expires=Wed, 15 May 2019 07:47:46 GMT; path=/; Domain=.contentful.com
83
+ X-Iinfo:
84
+ - 9-1741854-1741858 NNNN CT(106 106 0) RT(1526392612358 62) q(0 0 2 -1) r(4
85
+ 4) U5
86
+ X-Cdn:
87
+ - Incapsula
88
+ body:
89
+ encoding: ASCII-8BIT
90
+ string: |+
91
+ {
92
+ "name":"management.py - playground",
93
+ "sys":{
94
+ "type":"Space",
95
+ "id":"facgnwwgj5fe",
96
+ "version":1,
97
+ "createdBy":{
98
+ "sys":{
99
+ "type":"Link",
100
+ "linkType":"User",
101
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
102
+ }
103
+ },
104
+ "createdAt":"2017-03-02T18:30:26Z",
105
+ "updatedBy":{
106
+ "sys":{
107
+ "type":"Link",
108
+ "linkType":"User",
109
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
110
+ }
111
+ },
112
+ "updatedAt":"2017-03-02T18:30:26Z"
113
+ }
114
+ }
115
+
116
+ http_version:
117
+ recorded_at: Tue, 15 May 2018 13:56:53 GMT
118
+ - request:
119
+ method: get
120
+ uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master
121
+ body:
122
+ encoding: US-ASCII
123
+ string: ''
124
+ headers:
125
+ X-Contentful-User-Agent:
126
+ - sdk contentful-management.rb/2.1.0; platform ruby/2.5.1; os macOS/16;
127
+ Authorization:
128
+ - Bearer <ACCESS_TOKEN>
129
+ Content-Type:
130
+ - application/vnd.contentful.management.v1+json
131
+ Connection:
132
+ - close
133
+ Host:
134
+ - api.contentful.com
135
+ User-Agent:
136
+ - http.rb/2.2.2
137
+ response:
138
+ status:
139
+ code: 200
140
+ message: OK
141
+ headers:
142
+ Accept-Ranges:
143
+ - bytes
144
+ Access-Control-Allow-Headers:
145
+ - 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
146
+ Access-Control-Allow-Methods:
147
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
148
+ Access-Control-Allow-Origin:
149
+ - "*"
150
+ Access-Control-Expose-Headers:
151
+ - Etag
152
+ Access-Control-Max-Age:
153
+ - '1728000'
154
+ Cache-Control:
155
+ - max-age=0
156
+ Cf-Organization-Id:
157
+ - 4SsuxQCaMaemfIms52Jr8s
158
+ Cf-Space-Id:
159
+ - facgnwwgj5fe
160
+ Content-Type:
161
+ - application/vnd.contentful.management.v1+json
162
+ Date:
163
+ - Tue, 15 May 2018 13:56:54 GMT
164
+ Etag:
165
+ - W/"22a25eea35acc74ea3d1b641479654a1"
166
+ Server:
167
+ - Contentful
168
+ Strict-Transport-Security:
169
+ - max-age=15768000
170
+ X-Content-Type-Options:
171
+ - nosniff
172
+ X-Contentful-Ratelimit-Hour-Limit:
173
+ - '36000'
174
+ X-Contentful-Ratelimit-Hour-Remaining:
175
+ - '35996'
176
+ X-Contentful-Ratelimit-Reset:
177
+ - '0'
178
+ X-Contentful-Ratelimit-Second-Limit:
179
+ - '10'
180
+ X-Contentful-Ratelimit-Second-Remaining:
181
+ - '9'
182
+ X-Contentful-Request-Id:
183
+ - 501766c4f02e15f772ae94c055d26bbe
184
+ X-Frame-Options:
185
+ - ALLOWALL
186
+ X-Xss-Protection:
187
+ - 1; mode=block
188
+ Content-Length:
189
+ - '688'
190
+ Connection:
191
+ - Close
192
+ Set-Cookie:
193
+ - incap_ses_467_673446=W2SGdCVwOHqTQB0WiR97BiXn+loAAAAAc3jxt4s8l2DOYcD8OTrCVg==;
194
+ path=/; Domain=.contentful.com
195
+ - nlbi_673446=sGpWAe5b/ktKIWy56lKYhQAAAAAj98Ui7fgfMV/uz0D5vwXx; path=/; Domain=.contentful.com
196
+ - visid_incap_673446=DMbWSDLhRxG3Ita8HWBpHCXn+loAAAAAQUIPAAAAAACvv9Kh9CYXf4788z5c7XUm;
197
+ expires=Wed, 15 May 2019 07:47:40 GMT; path=/; Domain=.contentful.com
198
+ X-Iinfo:
199
+ - 10-2917623-2917637 NNNN CT(100 100 0) RT(1526392612898 59) q(0 0 2 -1) r(4
200
+ 4) U5
201
+ X-Cdn:
202
+ - Incapsula
203
+ body:
204
+ encoding: ASCII-8BIT
205
+ string: |+
206
+ {
207
+ "name":"master",
208
+ "sys":{
209
+ "type":"Environment",
210
+ "id":"master",
211
+ "version":1,
212
+ "space":{
213
+ "sys":{
214
+ "type":"Link",
215
+ "linkType":"Space",
216
+ "id":"facgnwwgj5fe"
217
+ }
218
+ },
219
+ "status":{
220
+ "sys":{
221
+ "type":"Link",
222
+ "linkType":"Status",
223
+ "id":"ready"
224
+ }
225
+ },
226
+ "createdBy":{
227
+ "sys":{
228
+ "type":"Link",
229
+ "linkType":"User",
230
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
231
+ }
232
+ },
233
+ "createdAt":"2017-12-07T10:54:10Z",
234
+ "updatedBy":{
235
+ "sys":{
236
+ "type":"Link",
237
+ "linkType":"User",
238
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
239
+ }
240
+ },
241
+ "updatedAt":"2017-12-07T10:54:10Z"
242
+ }
243
+ }
244
+
245
+ http_version:
246
+ recorded_at: Tue, 15 May 2018 13:56:54 GMT
247
+ - request:
248
+ method: get
249
+ uri: https://api.contentful.com/spaces/facgnwwgj5fe/environments/master/entries?content_type=foo&limit=2
250
+ body:
251
+ encoding: US-ASCII
252
+ string: ''
253
+ headers:
254
+ X-Contentful-User-Agent:
255
+ - sdk contentful-management.rb/2.1.0; platform ruby/2.5.1; os macOS/16;
256
+ Authorization:
257
+ - Bearer <ACCESS_TOKEN>
258
+ Content-Type:
259
+ - application/vnd.contentful.management.v1+json
260
+ Connection:
261
+ - close
262
+ Host:
263
+ - api.contentful.com
264
+ User-Agent:
265
+ - http.rb/2.2.2
266
+ response:
267
+ status:
268
+ code: 200
269
+ message: OK
270
+ headers:
271
+ Access-Control-Allow-Headers:
272
+ - 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
273
+ Access-Control-Allow-Methods:
274
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
275
+ Access-Control-Allow-Origin:
276
+ - "*"
277
+ Access-Control-Expose-Headers:
278
+ - Etag
279
+ Access-Control-Max-Age:
280
+ - '1728000'
281
+ Cf-Space-Id:
282
+ - facgnwwgj5fe
283
+ Content-Type:
284
+ - application/vnd.contentful.management.v1+json
285
+ Date:
286
+ - Tue, 15 May 2018 13:56:55 GMT
287
+ Etag:
288
+ - '"719a55b4bb4995e94d22c5031b9ad01a"'
289
+ Server:
290
+ - Contentful
291
+ Strict-Transport-Security:
292
+ - max-age=15768000
293
+ X-Content-Type-Options:
294
+ - nosniff
295
+ X-Contentful-Ratelimit-Hour-Limit:
296
+ - '36000'
297
+ X-Contentful-Ratelimit-Hour-Remaining:
298
+ - '35995'
299
+ X-Contentful-Ratelimit-Reset:
300
+ - '0'
301
+ X-Contentful-Ratelimit-Second-Limit:
302
+ - '10'
303
+ X-Contentful-Ratelimit-Second-Remaining:
304
+ - '8'
305
+ X-Contentful-Request-Id:
306
+ - 40fdeb19916c4fc56fc96b082e891ad9
307
+ Content-Length:
308
+ - '2658'
309
+ Connection:
310
+ - Close
311
+ Set-Cookie:
312
+ - incap_ses_467_673446=gHxAbdesMQEBQh0WiR97Bibn+loAAAAA2xCmZkKpQI2BqLOLytV4hw==;
313
+ path=/; Domain=.contentful.com
314
+ - nlbi_673446=SEaxPOLVx3VoT6qS6lKYhQAAAADr/vLnEFzQuP4u7eXJyAnq; path=/; Domain=.contentful.com
315
+ - visid_incap_673446=x+nt1ByBSoe5SFyLsOcFmibn+loAAAAAQUIPAAAAAACGp3w1sRHD2F4320/67GMp;
316
+ expires=Wed, 15 May 2019 07:47:46 GMT; path=/; Domain=.contentful.com
317
+ X-Iinfo:
318
+ - 3-1262293-1262299 NNNN CT(113 227 0) RT(1526392613412 64) q(0 0 4 -1) r(11
319
+ 11) U5
320
+ X-Cdn:
321
+ - Incapsula
322
+ body:
323
+ encoding: ASCII-8BIT
324
+ string: |
325
+ {
326
+ "sys": {
327
+ "type": "Array"
328
+ },
329
+ "total": 11,
330
+ "skip": 0,
331
+ "limit": 2,
332
+ "items": [
333
+ {
334
+ "sys": {
335
+ "space": {
336
+ "sys": {
337
+ "type": "Link",
338
+ "linkType": "Space",
339
+ "id": "facgnwwgj5fe"
340
+ }
341
+ },
342
+ "id": "id_create_entry_test",
343
+ "type": "Entry",
344
+ "createdAt": "2017-03-10T15:47:32.138Z",
345
+ "updatedAt": "2017-03-10T15:47:32.144Z",
346
+ "environment": {
347
+ "sys": {
348
+ "id": "master",
349
+ "type": "Link",
350
+ "linkType": "Environment"
351
+ }
352
+ },
353
+ "createdBy": {
354
+ "sys": {
355
+ "type": "Link",
356
+ "linkType": "User",
357
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
358
+ }
359
+ },
360
+ "updatedBy": {
361
+ "sys": {
362
+ "type": "Link",
363
+ "linkType": "User",
364
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
365
+ }
366
+ },
367
+ "version": 1,
368
+ "contentType": {
369
+ "sys": {
370
+ "type": "Link",
371
+ "linkType": "ContentType",
372
+ "id": "foo"
373
+ }
374
+ }
375
+ },
376
+ "fields": {
377
+ "name": {
378
+ "en-US": "foobar"
379
+ }
380
+ }
381
+ },
382
+ {
383
+ "sys": {
384
+ "space": {
385
+ "sys": {
386
+ "type": "Link",
387
+ "linkType": "Space",
388
+ "id": "facgnwwgj5fe"
389
+ }
390
+ },
391
+ "id": "33uj74Wln2Oc02CAyEY8CK",
392
+ "type": "Entry",
393
+ "createdAt": "2017-04-25T16:01:56.936Z",
394
+ "updatedAt": "2017-04-25T16:35:55.545Z",
395
+ "environment": {
396
+ "sys": {
397
+ "id": "master",
398
+ "type": "Link",
399
+ "linkType": "Environment"
400
+ }
401
+ },
402
+ "createdBy": {
403
+ "sys": {
404
+ "type": "Link",
405
+ "linkType": "User",
406
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
407
+ }
408
+ },
409
+ "updatedBy": {
410
+ "sys": {
411
+ "type": "Link",
412
+ "linkType": "User",
413
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
414
+ }
415
+ },
416
+ "publishedCounter": 2,
417
+ "version": 7,
418
+ "publishedBy": {
419
+ "sys": {
420
+ "type": "Link",
421
+ "linkType": "User",
422
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
423
+ }
424
+ },
425
+ "publishedVersion": 5,
426
+ "firstPublishedAt": "2017-04-25T16:02:06.147Z",
427
+ "publishedAt": "2017-04-25T16:02:10.000Z",
428
+ "contentType": {
429
+ "sys": {
430
+ "type": "Link",
431
+ "linkType": "ContentType",
432
+ "id": "foo"
433
+ }
434
+ }
435
+ },
436
+ "fields": {
437
+ "name": {
438
+ "en-US": "foo"
439
+ }
440
+ }
441
+ }
442
+ ]
443
+ }
444
+ http_version:
445
+ recorded_at: Tue, 15 May 2018 13:56:55 GMT
446
+ recorded_with: VCR 4.0.0
@@ -841,6 +841,21 @@ describe Contentful::Management::Entry do
841
841
  end
842
842
 
843
843
  describe 'issues' do
844
+ describe 'can send query parameters when requesting through environment proxy - #160' do
845
+ it 'can filter by content type and set a limit different than 100' do
846
+ vcr('entry/issue_160') {
847
+ space = client.spaces.find('facgnwwgj5fe')
848
+ environment = space.environments.find('master')
849
+
850
+ entries = environment.entries.all(content_type: 'foo', limit: 2)
851
+
852
+ expect(entries.total).to eq 11
853
+ expect(entries.size).to eq 2
854
+ expect(entries.all? { |e| e.sys[:contentType].id == 'foo' }).to be_truthy
855
+ }
856
+ end
857
+ end
858
+
844
859
  describe 'handles multiple locales even when they are not all defined for the default locale - #70' do
845
860
  it 'merges all present locales' do
846
861
  vcr('entry/issue_70') {
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: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Protas
@@ -542,6 +542,7 @@ files:
542
542
  - spec/fixtures/vcr_cassettes/entry/find-with-null-symbols.yml
543
543
  - spec/fixtures/vcr_cassettes/entry/find.yml
544
544
  - spec/fixtures/vcr_cassettes/entry/find_not_found.yml
545
+ - spec/fixtures/vcr_cassettes/entry/issue_160.yml
545
546
  - spec/fixtures/vcr_cassettes/entry/issue_61_1.yml
546
547
  - spec/fixtures/vcr_cassettes/entry/issue_61_2.yml
547
548
  - spec/fixtures/vcr_cassettes/entry/issue_61_3.yml
@@ -921,6 +922,7 @@ test_files:
921
922
  - spec/fixtures/vcr_cassettes/entry/find-with-null-symbols.yml
922
923
  - spec/fixtures/vcr_cassettes/entry/find.yml
923
924
  - spec/fixtures/vcr_cassettes/entry/find_not_found.yml
925
+ - spec/fixtures/vcr_cassettes/entry/issue_160.yml
924
926
  - spec/fixtures/vcr_cassettes/entry/issue_61_1.yml
925
927
  - spec/fixtures/vcr_cassettes/entry/issue_61_2.yml
926
928
  - spec/fixtures/vcr_cassettes/entry/issue_61_3.yml