contentful-management 3.2.0 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +23 -0
- data/CHANGELOG.md +10 -0
- data/README.md +45 -1
- data/lib/contentful/management/asset.rb +2 -2
- data/lib/contentful/management/client.rb +10 -0
- data/lib/contentful/management/client_tag_methods_factory.rb +11 -0
- data/lib/contentful/management/editor_interface.rb +12 -4
- data/lib/contentful/management/entry.rb +16 -3
- data/lib/contentful/management/environment.rb +10 -0
- data/lib/contentful/management/environment_tag_methods_factory.rb +11 -0
- data/lib/contentful/management/resource/refresher.rb +1 -0
- data/lib/contentful/management/resource_requester.rb +2 -2
- data/lib/contentful/management/tag.rb +27 -0
- data/lib/contentful/management/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/editor_interfaces/update_sidebar.yml +553 -0
- data/spec/fixtures/vcr_cassettes/entry/references.yml +496 -0
- data/spec/fixtures/vcr_cassettes/environment/tag_proxy.yml +658 -0
- data/spec/fixtures/vcr_cassettes/tag/add_tag_to_asset.yml +456 -0
- data/spec/fixtures/vcr_cassettes/tag/add_tag_to_entry.yml +315 -0
- data/spec/fixtures/vcr_cassettes/tag/all.yml +252 -0
- data/spec/fixtures/vcr_cassettes/tag/create_asset_with_tags.yml +147 -0
- data/spec/fixtures/vcr_cassettes/tag/create_entry_with_tags.yml +293 -0
- data/spec/fixtures/vcr_cassettes/tag/create_visibility_private.yml +125 -0
- data/spec/fixtures/vcr_cassettes/tag/create_visibility_public.yml +125 -0
- data/spec/fixtures/vcr_cassettes/tag/destroy.yml +208 -0
- data/spec/fixtures/vcr_cassettes/tag/destroy_referenced.yml +226 -0
- data/spec/fixtures/vcr_cassettes/tag/find.yml +125 -0
- data/spec/fixtures/vcr_cassettes/tag/not_found.yml +98 -0
- data/spec/fixtures/vcr_cassettes/tag/remove_tag_from_asset.yml +456 -0
- data/spec/fixtures/vcr_cassettes/tag/remove_tag_from_entry.yml +315 -0
- data/spec/fixtures/vcr_cassettes/tag/update.yml +251 -0
- data/spec/lib/contentful/management/editor_interface_spec.rb +30 -0
- data/spec/lib/contentful/management/entry_spec.rb +11 -0
- data/spec/lib/contentful/management/environment_spec.rb +12 -0
- data/spec/lib/contentful/management/tag_spec.rb +186 -0
- metadata +45 -7
- data/.travis.yml +0 -12
@@ -0,0 +1,315 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.contentful.com/spaces/o4h6g9w3pooi/environments/master/entries/28spH12WTOl0xUQeC4AL1a
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
X-Contentful-User-Agent:
|
11
|
+
- sdk contentful-management.rb/3.3.0; platform ruby/2.7.2; os macOS/21;
|
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/4.4.1
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Connection:
|
28
|
+
- close
|
29
|
+
Content-Length:
|
30
|
+
- '1379'
|
31
|
+
Content-Type:
|
32
|
+
- application/vnd.contentful.management.v1+json
|
33
|
+
X-Contentful-Ratelimit-Hour-Remaining:
|
34
|
+
- '35999'
|
35
|
+
X-Contentful-Ratelimit-Second-Remaining:
|
36
|
+
- '9'
|
37
|
+
X-Contentful-Ratelimit-Hour-Limit:
|
38
|
+
- '36000'
|
39
|
+
X-Contentful-Ratelimit-Second-Limit:
|
40
|
+
- '10'
|
41
|
+
X-Contentful-Ratelimit-Reset:
|
42
|
+
- '0'
|
43
|
+
Accept-Patch:
|
44
|
+
- application/json-patch+json
|
45
|
+
Cf-Environment-Id:
|
46
|
+
- master
|
47
|
+
Cf-Environment-Uuid:
|
48
|
+
- master
|
49
|
+
Cf-Space-Id:
|
50
|
+
- o4h6g9w3pooi
|
51
|
+
Etag:
|
52
|
+
- '"9062438159635568901"'
|
53
|
+
X-Contentful-Route:
|
54
|
+
- "/spaces/:space/environments/:environment/entries/:id"
|
55
|
+
Strict-Transport-Security:
|
56
|
+
- max-age=15768000
|
57
|
+
X-Content-Type-Options:
|
58
|
+
- nosniff
|
59
|
+
Contentful-Api:
|
60
|
+
- cma
|
61
|
+
Server:
|
62
|
+
- Contentful
|
63
|
+
Contentful-Upstream:
|
64
|
+
- content-api
|
65
|
+
Access-Control-Allow-Origin:
|
66
|
+
- "*"
|
67
|
+
Access-Control-Allow-Headers:
|
68
|
+
- 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-Tag-Visibility,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace
|
69
|
+
Access-Control-Expose-Headers:
|
70
|
+
- Etag
|
71
|
+
Access-Control-Allow-Methods:
|
72
|
+
- DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
|
73
|
+
Access-Control-Max-Age:
|
74
|
+
- '1728000'
|
75
|
+
Cache-Control:
|
76
|
+
- no-store
|
77
|
+
Accept-Ranges:
|
78
|
+
- bytes
|
79
|
+
Date:
|
80
|
+
- Tue, 19 Apr 2022 15:24:38 GMT
|
81
|
+
X-Contentful-Request-Id:
|
82
|
+
- 4da50e5d-a80e-4b4c-b2d0-d98b46daa0d2
|
83
|
+
body:
|
84
|
+
encoding: ASCII-8BIT
|
85
|
+
string: |
|
86
|
+
{
|
87
|
+
"metadata": {
|
88
|
+
"tags": [
|
89
|
+
{
|
90
|
+
"sys": {
|
91
|
+
"type": "Link",
|
92
|
+
"linkType": "Tag",
|
93
|
+
"id": "icon"
|
94
|
+
}
|
95
|
+
}
|
96
|
+
]
|
97
|
+
},
|
98
|
+
"sys": {
|
99
|
+
"space": {
|
100
|
+
"sys": {
|
101
|
+
"type": "Link",
|
102
|
+
"linkType": "Space",
|
103
|
+
"id": "o4h6g9w3pooi"
|
104
|
+
}
|
105
|
+
},
|
106
|
+
"id": "28spH12WTOl0xUQeC4AL1a",
|
107
|
+
"type": "Entry",
|
108
|
+
"createdAt": "2022-04-12T05:11:03.393Z",
|
109
|
+
"updatedAt": "2022-04-19T15:24:37.977Z",
|
110
|
+
"environment": {
|
111
|
+
"sys": {
|
112
|
+
"id": "master",
|
113
|
+
"type": "Link",
|
114
|
+
"linkType": "Environment"
|
115
|
+
}
|
116
|
+
},
|
117
|
+
"publishedVersion": 20,
|
118
|
+
"publishedAt": "2022-04-12T05:43:44.184Z",
|
119
|
+
"firstPublishedAt": "2022-04-12T05:11:24.530Z",
|
120
|
+
"createdBy": {
|
121
|
+
"sys": {
|
122
|
+
"type": "Link",
|
123
|
+
"linkType": "User",
|
124
|
+
"id": "59Erm8D1JuuD273aXNb65T"
|
125
|
+
}
|
126
|
+
},
|
127
|
+
"updatedBy": {
|
128
|
+
"sys": {
|
129
|
+
"type": "Link",
|
130
|
+
"linkType": "User",
|
131
|
+
"id": "59Erm8D1JuuD273aXNb65T"
|
132
|
+
}
|
133
|
+
},
|
134
|
+
"publishedCounter": 6,
|
135
|
+
"version": 40,
|
136
|
+
"publishedBy": {
|
137
|
+
"sys": {
|
138
|
+
"type": "Link",
|
139
|
+
"linkType": "User",
|
140
|
+
"id": "59Erm8D1JuuD273aXNb65T"
|
141
|
+
}
|
142
|
+
},
|
143
|
+
"contentType": {
|
144
|
+
"sys": {
|
145
|
+
"type": "Link",
|
146
|
+
"linkType": "ContentType",
|
147
|
+
"id": "simple"
|
148
|
+
}
|
149
|
+
}
|
150
|
+
},
|
151
|
+
"fields": {
|
152
|
+
"name": {
|
153
|
+
"en-US": "bhushan"
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
http_version:
|
158
|
+
recorded_at: Tue, 19 Apr 2022 15:24:38 GMT
|
159
|
+
- request:
|
160
|
+
method: put
|
161
|
+
uri: https://api.contentful.com/spaces/o4h6g9w3pooi/environments/master/entries/28spH12WTOl0xUQeC4AL1a
|
162
|
+
body:
|
163
|
+
encoding: UTF-8
|
164
|
+
string: '{"metadata":{"tags":[]},"fields":{"name":{"en-US":"bhushan"}}}'
|
165
|
+
headers:
|
166
|
+
X-Contentful-User-Agent:
|
167
|
+
- sdk contentful-management.rb/3.3.0; platform ruby/2.7.2; os macOS/21;
|
168
|
+
Authorization:
|
169
|
+
- Bearer <ACCESS_TOKEN>
|
170
|
+
Content-Type:
|
171
|
+
- application/vnd.contentful.management.v1+json
|
172
|
+
X-Contentful-Version:
|
173
|
+
- '40'
|
174
|
+
X-Contentful-Content-Type:
|
175
|
+
- simple
|
176
|
+
Content-Type-Id:
|
177
|
+
- simple
|
178
|
+
Version:
|
179
|
+
- '40'
|
180
|
+
Connection:
|
181
|
+
- close
|
182
|
+
Host:
|
183
|
+
- api.contentful.com
|
184
|
+
User-Agent:
|
185
|
+
- http.rb/4.4.1
|
186
|
+
response:
|
187
|
+
status:
|
188
|
+
code: 200
|
189
|
+
message: OK
|
190
|
+
headers:
|
191
|
+
Connection:
|
192
|
+
- close
|
193
|
+
Content-Length:
|
194
|
+
- '1253'
|
195
|
+
Content-Type:
|
196
|
+
- application/vnd.contentful.management.v1+json
|
197
|
+
X-Contentful-Ratelimit-Reset:
|
198
|
+
- '0'
|
199
|
+
X-Contentful-Ratelimit-Hour-Remaining:
|
200
|
+
- '35999'
|
201
|
+
X-Contentful-Ratelimit-Second-Remaining:
|
202
|
+
- '9'
|
203
|
+
X-Contentful-Ratelimit-Hour-Limit:
|
204
|
+
- '36000'
|
205
|
+
X-Contentful-Ratelimit-Second-Limit:
|
206
|
+
- '10'
|
207
|
+
Accept-Patch:
|
208
|
+
- application/json-patch+json
|
209
|
+
Cf-Environment-Id:
|
210
|
+
- master
|
211
|
+
Cf-Environment-Uuid:
|
212
|
+
- master
|
213
|
+
Cf-Space-Id:
|
214
|
+
- o4h6g9w3pooi
|
215
|
+
Etag:
|
216
|
+
- '"12289405547213756244"'
|
217
|
+
X-Contentful-Route:
|
218
|
+
- "/spaces/:space/environments/:environment/entries/:id"
|
219
|
+
Strict-Transport-Security:
|
220
|
+
- max-age=15768000
|
221
|
+
X-Content-Type-Options:
|
222
|
+
- nosniff
|
223
|
+
Contentful-Api:
|
224
|
+
- cma
|
225
|
+
Server:
|
226
|
+
- Contentful
|
227
|
+
Contentful-Upstream:
|
228
|
+
- content-api
|
229
|
+
Access-Control-Allow-Origin:
|
230
|
+
- "*"
|
231
|
+
Access-Control-Allow-Headers:
|
232
|
+
- 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-Tag-Visibility,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace
|
233
|
+
Access-Control-Expose-Headers:
|
234
|
+
- Etag
|
235
|
+
Access-Control-Allow-Methods:
|
236
|
+
- DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
|
237
|
+
Access-Control-Max-Age:
|
238
|
+
- '1728000'
|
239
|
+
Cache-Control:
|
240
|
+
- no-store
|
241
|
+
Accept-Ranges:
|
242
|
+
- bytes
|
243
|
+
Date:
|
244
|
+
- Tue, 19 Apr 2022 15:24:39 GMT
|
245
|
+
X-Contentful-Request-Id:
|
246
|
+
- 56565f92-fc7b-4787-8be0-56ed199ad254
|
247
|
+
body:
|
248
|
+
encoding: ASCII-8BIT
|
249
|
+
string: |
|
250
|
+
{
|
251
|
+
"metadata": {
|
252
|
+
"tags": []
|
253
|
+
},
|
254
|
+
"sys": {
|
255
|
+
"space": {
|
256
|
+
"sys": {
|
257
|
+
"type": "Link",
|
258
|
+
"linkType": "Space",
|
259
|
+
"id": "o4h6g9w3pooi"
|
260
|
+
}
|
261
|
+
},
|
262
|
+
"id": "28spH12WTOl0xUQeC4AL1a",
|
263
|
+
"type": "Entry",
|
264
|
+
"createdAt": "2022-04-12T05:11:03.393Z",
|
265
|
+
"updatedAt": "2022-04-19T15:24:39.299Z",
|
266
|
+
"environment": {
|
267
|
+
"sys": {
|
268
|
+
"id": "master",
|
269
|
+
"type": "Link",
|
270
|
+
"linkType": "Environment"
|
271
|
+
}
|
272
|
+
},
|
273
|
+
"publishedVersion": 20,
|
274
|
+
"publishedAt": "2022-04-12T05:43:44.184Z",
|
275
|
+
"firstPublishedAt": "2022-04-12T05:11:24.530Z",
|
276
|
+
"createdBy": {
|
277
|
+
"sys": {
|
278
|
+
"type": "Link",
|
279
|
+
"linkType": "User",
|
280
|
+
"id": "59Erm8D1JuuD273aXNb65T"
|
281
|
+
}
|
282
|
+
},
|
283
|
+
"updatedBy": {
|
284
|
+
"sys": {
|
285
|
+
"type": "Link",
|
286
|
+
"linkType": "User",
|
287
|
+
"id": "59Erm8D1JuuD273aXNb65T"
|
288
|
+
}
|
289
|
+
},
|
290
|
+
"publishedCounter": 6,
|
291
|
+
"version": 41,
|
292
|
+
"publishedBy": {
|
293
|
+
"sys": {
|
294
|
+
"type": "Link",
|
295
|
+
"linkType": "User",
|
296
|
+
"id": "59Erm8D1JuuD273aXNb65T"
|
297
|
+
}
|
298
|
+
},
|
299
|
+
"contentType": {
|
300
|
+
"sys": {
|
301
|
+
"type": "Link",
|
302
|
+
"linkType": "ContentType",
|
303
|
+
"id": "simple"
|
304
|
+
}
|
305
|
+
}
|
306
|
+
},
|
307
|
+
"fields": {
|
308
|
+
"name": {
|
309
|
+
"en-US": "bhushan"
|
310
|
+
}
|
311
|
+
}
|
312
|
+
}
|
313
|
+
http_version:
|
314
|
+
recorded_at: Tue, 19 Apr 2022 15:24:39 GMT
|
315
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,251 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.contentful.com/spaces/o4h6g9w3pooi/environments/master/tags/fooTag
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
X-Contentful-User-Agent:
|
11
|
+
- sdk contentful-management.rb/3.3.0; platform ruby/2.7.2; os macOS/21;
|
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/4.4.1
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Connection:
|
28
|
+
- close
|
29
|
+
Content-Length:
|
30
|
+
- '755'
|
31
|
+
Content-Type:
|
32
|
+
- application/vnd.contentful.management.v1+json
|
33
|
+
X-Contentful-Ratelimit-Hour-Limit:
|
34
|
+
- '36000'
|
35
|
+
X-Contentful-Ratelimit-Second-Limit:
|
36
|
+
- '10'
|
37
|
+
X-Contentful-Ratelimit-Reset:
|
38
|
+
- '0'
|
39
|
+
X-Contentful-Ratelimit-Hour-Remaining:
|
40
|
+
- '35999'
|
41
|
+
X-Contentful-Ratelimit-Second-Remaining:
|
42
|
+
- '9'
|
43
|
+
Cf-Environment-Id:
|
44
|
+
- master
|
45
|
+
Cf-Environment-Uuid:
|
46
|
+
- master
|
47
|
+
Cf-Space-Id:
|
48
|
+
- o4h6g9w3pooi
|
49
|
+
Etag:
|
50
|
+
- '"10585579938702672161"'
|
51
|
+
X-Contentful-Route:
|
52
|
+
- "/spaces/:space/environments/:environment/tags/:id"
|
53
|
+
Strict-Transport-Security:
|
54
|
+
- max-age=15768000
|
55
|
+
X-Content-Type-Options:
|
56
|
+
- nosniff
|
57
|
+
Contentful-Api:
|
58
|
+
- cma
|
59
|
+
Server:
|
60
|
+
- Contentful
|
61
|
+
Contentful-Upstream:
|
62
|
+
- content-api
|
63
|
+
Access-Control-Allow-Origin:
|
64
|
+
- "*"
|
65
|
+
Access-Control-Allow-Headers:
|
66
|
+
- 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-Tag-Visibility,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace
|
67
|
+
Access-Control-Expose-Headers:
|
68
|
+
- Etag
|
69
|
+
Access-Control-Allow-Methods:
|
70
|
+
- DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
|
71
|
+
Access-Control-Max-Age:
|
72
|
+
- '1728000'
|
73
|
+
Cache-Control:
|
74
|
+
- no-store
|
75
|
+
Accept-Ranges:
|
76
|
+
- bytes
|
77
|
+
Date:
|
78
|
+
- Tue, 19 Apr 2022 15:13:31 GMT
|
79
|
+
X-Contentful-Request-Id:
|
80
|
+
- 38474d9c-41a6-4356-99aa-c88ce4ee913b
|
81
|
+
body:
|
82
|
+
encoding: ASCII-8BIT
|
83
|
+
string: |
|
84
|
+
{
|
85
|
+
"sys": {
|
86
|
+
"type": "Tag",
|
87
|
+
"id": "fooTag",
|
88
|
+
"space": {
|
89
|
+
"sys": {
|
90
|
+
"type": "Link",
|
91
|
+
"linkType": "Space",
|
92
|
+
"id": "o4h6g9w3pooi"
|
93
|
+
}
|
94
|
+
},
|
95
|
+
"environment": {
|
96
|
+
"sys": {
|
97
|
+
"id": "master",
|
98
|
+
"type": "Link",
|
99
|
+
"linkType": "Environment"
|
100
|
+
}
|
101
|
+
},
|
102
|
+
"createdBy": {
|
103
|
+
"sys": {
|
104
|
+
"type": "Link",
|
105
|
+
"linkType": "User",
|
106
|
+
"id": "59Erm8D1JuuD273aXNb65T"
|
107
|
+
}
|
108
|
+
},
|
109
|
+
"updatedBy": {
|
110
|
+
"sys": {
|
111
|
+
"type": "Link",
|
112
|
+
"linkType": "User",
|
113
|
+
"id": "59Erm8D1JuuD273aXNb65T"
|
114
|
+
}
|
115
|
+
},
|
116
|
+
"createdAt": "2022-04-12T05:09:33.997Z",
|
117
|
+
"updatedAt": "2022-04-19T15:11:43.850Z",
|
118
|
+
"version": 2,
|
119
|
+
"visibility": "private"
|
120
|
+
},
|
121
|
+
"name": "Foo Tag"
|
122
|
+
}
|
123
|
+
http_version:
|
124
|
+
recorded_at: Tue, 19 Apr 2022 15:13:31 GMT
|
125
|
+
- request:
|
126
|
+
method: put
|
127
|
+
uri: https://api.contentful.com/spaces/o4h6g9w3pooi/environments/master/tags/fooTag
|
128
|
+
body:
|
129
|
+
encoding: UTF-8
|
130
|
+
string: '{"name":"updated tag"}'
|
131
|
+
headers:
|
132
|
+
X-Contentful-User-Agent:
|
133
|
+
- sdk contentful-management.rb/3.3.0; platform ruby/2.7.2; os macOS/21;
|
134
|
+
Authorization:
|
135
|
+
- Bearer <ACCESS_TOKEN>
|
136
|
+
Content-Type:
|
137
|
+
- application/vnd.contentful.management.v1+json
|
138
|
+
X-Contentful-Version:
|
139
|
+
- '2'
|
140
|
+
Version:
|
141
|
+
- '2'
|
142
|
+
Connection:
|
143
|
+
- close
|
144
|
+
Host:
|
145
|
+
- api.contentful.com
|
146
|
+
User-Agent:
|
147
|
+
- http.rb/4.4.1
|
148
|
+
response:
|
149
|
+
status:
|
150
|
+
code: 200
|
151
|
+
message: OK
|
152
|
+
headers:
|
153
|
+
Connection:
|
154
|
+
- close
|
155
|
+
Content-Length:
|
156
|
+
- '759'
|
157
|
+
Content-Type:
|
158
|
+
- application/vnd.contentful.management.v1+json
|
159
|
+
X-Contentful-Ratelimit-Hour-Remaining:
|
160
|
+
- '35999'
|
161
|
+
X-Contentful-Ratelimit-Second-Remaining:
|
162
|
+
- '9'
|
163
|
+
X-Contentful-Ratelimit-Hour-Limit:
|
164
|
+
- '36000'
|
165
|
+
X-Contentful-Ratelimit-Second-Limit:
|
166
|
+
- '10'
|
167
|
+
X-Contentful-Ratelimit-Reset:
|
168
|
+
- '0'
|
169
|
+
Cf-Environment-Id:
|
170
|
+
- master
|
171
|
+
Cf-Environment-Uuid:
|
172
|
+
- master
|
173
|
+
Cf-Space-Id:
|
174
|
+
- o4h6g9w3pooi
|
175
|
+
Etag:
|
176
|
+
- '"12936439523497936694"'
|
177
|
+
X-Contentful-Route:
|
178
|
+
- "/spaces/:space/environments/:environment/tags/:id"
|
179
|
+
Strict-Transport-Security:
|
180
|
+
- max-age=15768000
|
181
|
+
X-Content-Type-Options:
|
182
|
+
- nosniff
|
183
|
+
Contentful-Api:
|
184
|
+
- cma
|
185
|
+
Server:
|
186
|
+
- Contentful
|
187
|
+
Contentful-Upstream:
|
188
|
+
- content-api
|
189
|
+
Access-Control-Allow-Origin:
|
190
|
+
- "*"
|
191
|
+
Access-Control-Allow-Headers:
|
192
|
+
- 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-Tag-Visibility,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace
|
193
|
+
Access-Control-Expose-Headers:
|
194
|
+
- Etag
|
195
|
+
Access-Control-Allow-Methods:
|
196
|
+
- DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
|
197
|
+
Access-Control-Max-Age:
|
198
|
+
- '1728000'
|
199
|
+
Cache-Control:
|
200
|
+
- no-store
|
201
|
+
Accept-Ranges:
|
202
|
+
- bytes
|
203
|
+
Date:
|
204
|
+
- Tue, 19 Apr 2022 15:13:32 GMT
|
205
|
+
X-Contentful-Request-Id:
|
206
|
+
- ad34a689-57eb-49c7-9078-74dc9314c2c9
|
207
|
+
body:
|
208
|
+
encoding: ASCII-8BIT
|
209
|
+
string: |
|
210
|
+
{
|
211
|
+
"name": "updated tag",
|
212
|
+
"sys": {
|
213
|
+
"type": "Tag",
|
214
|
+
"id": "fooTag",
|
215
|
+
"space": {
|
216
|
+
"sys": {
|
217
|
+
"type": "Link",
|
218
|
+
"linkType": "Space",
|
219
|
+
"id": "o4h6g9w3pooi"
|
220
|
+
}
|
221
|
+
},
|
222
|
+
"environment": {
|
223
|
+
"sys": {
|
224
|
+
"id": "master",
|
225
|
+
"type": "Link",
|
226
|
+
"linkType": "Environment"
|
227
|
+
}
|
228
|
+
},
|
229
|
+
"createdBy": {
|
230
|
+
"sys": {
|
231
|
+
"type": "Link",
|
232
|
+
"linkType": "User",
|
233
|
+
"id": "59Erm8D1JuuD273aXNb65T"
|
234
|
+
}
|
235
|
+
},
|
236
|
+
"updatedBy": {
|
237
|
+
"sys": {
|
238
|
+
"type": "Link",
|
239
|
+
"linkType": "User",
|
240
|
+
"id": "59Erm8D1JuuD273aXNb65T"
|
241
|
+
}
|
242
|
+
},
|
243
|
+
"createdAt": "2022-04-12T05:09:33.997Z",
|
244
|
+
"updatedAt": "2022-04-19T15:13:32.105Z",
|
245
|
+
"version": 3,
|
246
|
+
"visibility": "private"
|
247
|
+
}
|
248
|
+
}
|
249
|
+
http_version:
|
250
|
+
recorded_at: Tue, 19 Apr 2022 15:13:32 GMT
|
251
|
+
recorded_with: VCR 4.0.0
|
@@ -51,6 +51,21 @@ module Contentful
|
|
51
51
|
expect(editor_interface.controls.first['widgetId']).to eq 'urlEditor'
|
52
52
|
end
|
53
53
|
end
|
54
|
+
|
55
|
+
it 'can update the sidebar' do
|
56
|
+
vcr('editor_interfaces/update_sidebar') do
|
57
|
+
editor_interface = described_class.default(client, space_id, 'master', content_type_id)
|
58
|
+
|
59
|
+
expect(editor_interface.sidebar.first['widgetId']).to eq 'flow-editor'
|
60
|
+
|
61
|
+
editor_interface.sidebar.first['widgetId'] = 'date-range-editor'
|
62
|
+
editor_interface.update(sidebar: editor_interface.sidebar)
|
63
|
+
|
64
|
+
editor_interface.reload
|
65
|
+
|
66
|
+
expect(editor_interface.sidebar.first['widgetId']).to eq 'date-range-editor'
|
67
|
+
end
|
68
|
+
end
|
54
69
|
end
|
55
70
|
|
56
71
|
describe '#save' do
|
@@ -70,6 +85,21 @@ module Contentful
|
|
70
85
|
expect(editor_interface.controls.first['widgetId']).to eq 'urlEditor'
|
71
86
|
end
|
72
87
|
end
|
88
|
+
|
89
|
+
it 'can save sidebar' do
|
90
|
+
vcr('editor_interfaces/update_sidebar') do
|
91
|
+
editor_interface = described_class.default(client, space_id, 'master', content_type_id)
|
92
|
+
|
93
|
+
expect(editor_interface.sidebar.first['widgetId']).to eq 'flow-editor'
|
94
|
+
|
95
|
+
editor_interface.sidebar.first['widgetId'] = 'date-range-editor'
|
96
|
+
editor_interface.save
|
97
|
+
|
98
|
+
editor_interface.reload
|
99
|
+
|
100
|
+
expect(editor_interface.sidebar.first['widgetId']).to eq 'date-range-editor'
|
101
|
+
end
|
102
|
+
end
|
73
103
|
end
|
74
104
|
end
|
75
105
|
end
|
@@ -1239,4 +1239,15 @@ describe Contentful::Management::Entry do
|
|
1239
1239
|
end
|
1240
1240
|
end
|
1241
1241
|
end
|
1242
|
+
|
1243
|
+
describe '#references' do
|
1244
|
+
it 'can fetch references' do
|
1245
|
+
vcr('entry/references') do
|
1246
|
+
result = subject.find(entry_id).references(include: 1)
|
1247
|
+
|
1248
|
+
expect(result).to be_kind_of Contentful::Management::Array
|
1249
|
+
expect(result)
|
1250
|
+
end
|
1251
|
+
end
|
1252
|
+
end
|
1242
1253
|
end
|
@@ -109,6 +109,18 @@ describe Contentful::Management::Environment do
|
|
109
109
|
expect(entry).to be_a ::Contentful::Management::Entry
|
110
110
|
}
|
111
111
|
end
|
112
|
+
|
113
|
+
it 'tags proxy works' do
|
114
|
+
vcr('environment/tag_proxy') {
|
115
|
+
environment = subject.find(master)
|
116
|
+
|
117
|
+
tags = environment.tags.all
|
118
|
+
expect(tags).to be_a ::Contentful::Management::Array
|
119
|
+
|
120
|
+
tag = environment.tags.find(tags.first.id)
|
121
|
+
expect(tag).to be_a ::Contentful::Management::Tag
|
122
|
+
}
|
123
|
+
end
|
112
124
|
end
|
113
125
|
|
114
126
|
describe '#reload' do
|