contentful-importer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +38 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +8 -0
  5. data/CHANGELOG.md +4 -0
  6. data/Gemfile +7 -0
  7. data/Gemfile.lock +87 -0
  8. data/LICENSE +22 -0
  9. data/README.md +327 -0
  10. data/Rakefile +7 -0
  11. data/bin/contentful-importer +85 -0
  12. data/contentful_importer.gemspec +38 -0
  13. data/example_settings/contentful_model.json +288 -0
  14. data/example_settings/contentful_structure.json +78 -0
  15. data/example_settings/files_meaning.txt +15 -0
  16. data/example_settings/settings.yml +16 -0
  17. data/lib/cli.rb +13 -0
  18. data/lib/configuration.rb +36 -0
  19. data/lib/converters/content_types_structure_creator.rb +60 -0
  20. data/lib/converters/contentful_model_to_json.rb +109 -0
  21. data/lib/importer/data_organizer.rb +117 -0
  22. data/lib/importer/mime_content_type.rb +564 -0
  23. data/lib/importer/parallel_importer.rb +429 -0
  24. data/lib/json_schema_validator.rb +64 -0
  25. data/lib/migrator.rb +39 -0
  26. data/lib/version.rb +3 -0
  27. data/spec/fixtures/import_files/assets/image/image_1.json +9 -0
  28. data/spec/fixtures/import_files/assets/image/image_2.json +9 -0
  29. data/spec/fixtures/import_files/assets/image/image_3.json +9 -0
  30. data/spec/fixtures/import_files/assets/image/image_4.json +9 -0
  31. data/spec/fixtures/import_files/collections/job_skills.json +13 -0
  32. data/spec/fixtures/import_files/collections/jobs.json +37 -0
  33. data/spec/fixtures/import_files/collections/profile.json +19 -0
  34. data/spec/fixtures/import_files/collections/user.json +36 -0
  35. data/spec/fixtures/import_files/entries/job_skills/job_skills_1.json +7 -0
  36. data/spec/fixtures/import_files/entries/job_skills/job_skills_10.json +7 -0
  37. data/spec/fixtures/import_files/entries/job_skills/job_skills_2.json +7 -0
  38. data/spec/fixtures/import_files/entries/job_skills/job_skills_3.json +7 -0
  39. data/spec/fixtures/import_files/entries/job_skills/job_skills_4.json +7 -0
  40. data/spec/fixtures/import_files/entries/job_skills/job_skills_5.json +7 -0
  41. data/spec/fixtures/import_files/entries/job_skills/job_skills_6.json +7 -0
  42. data/spec/fixtures/import_files/entries/job_skills/job_skills_7.json +7 -0
  43. data/spec/fixtures/import_files/entries/job_skills/job_skills_8.json +7 -0
  44. data/spec/fixtures/import_files/entries/job_skills/job_skills_9.json +7 -0
  45. data/spec/fixtures/import_files/entries/jobs/jobs_1.json +56 -0
  46. data/spec/fixtures/import_files/entries/jobs/jobs_2.json +55 -0
  47. data/spec/fixtures/import_files/entries/jobs/jobs_4.json +49 -0
  48. data/spec/fixtures/import_files/entries/profile/profile_1.json +12 -0
  49. data/spec/fixtures/import_files/entries/profile/profile_2.json +12 -0
  50. data/spec/fixtures/import_files/entries/user/user_1.json +24 -0
  51. data/spec/fixtures/import_files/entries/user/user_2.json +20 -0
  52. data/spec/fixtures/import_files/logs/log_published_assets.csv +4 -0
  53. data/spec/fixtures/import_files/logs/log_published_entries.csv +23 -0
  54. data/spec/fixtures/import_files/logs/success_assets.csv +4 -0
  55. data/spec/fixtures/import_files/logs/success_published_assets.csv +0 -0
  56. data/spec/fixtures/import_files/logs/success_published_entries.csv +22 -0
  57. data/spec/fixtures/import_files/logs/success_thread_0.csv +12 -0
  58. data/spec/fixtures/import_files/logs/success_thread_1.csv +11 -0
  59. data/spec/fixtures/import_files/threads/0/1TVvxCqoRq0qUYAOQuOqys_2.json +20 -0
  60. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_1.json +7 -0
  61. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_10.json +7 -0
  62. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_2.json +7 -0
  63. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_3.json +7 -0
  64. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_4.json +7 -0
  65. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_5.json +7 -0
  66. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_6.json +7 -0
  67. data/spec/fixtures/import_files/threads/0/2soCP557HGKoOOK0SqmMOm_7.json +7 -0
  68. data/spec/fixtures/import_files/threads/0/6H6pGAV1PUsuoAW26Iu48W_1.json +9 -0
  69. data/spec/fixtures/import_files/threads/0/6H6pGAV1PUsuoAW26Iu48W_2.json +9 -0
  70. data/spec/fixtures/import_files/threads/0/6H6pGAV1PUsuoAW26Iu48W_3.json +9 -0
  71. data/spec/fixtures/import_files/threads/0/6H6pGAV1PUsuoAW26Iu48W_4.json +9 -0
  72. data/spec/fixtures/import_files/threads/0/6H6pGAV1PUsuoAW26Iu48W_5.json +9 -0
  73. data/spec/fixtures/import_files/threads/1/1TVvxCqoRq0qUYAOQuOqys_1.json +24 -0
  74. data/spec/fixtures/import_files/threads/1/1TVvxCqoRq0qUYAOQuOqys_2.json +20 -0
  75. data/spec/fixtures/import_files/threads/1/2soCP557HGKoOOK0SqmMOm_6.json +7 -0
  76. data/spec/fixtures/import_files/threads/1/2soCP557HGKoOOK0SqmMOm_7.json +7 -0
  77. data/spec/fixtures/import_files/threads/1/2soCP557HGKoOOK0SqmMOm_8.json +7 -0
  78. data/spec/fixtures/import_files/threads/1/2soCP557HGKoOOK0SqmMOm_9.json +7 -0
  79. data/spec/fixtures/import_files/threads/1/4L1bg4WQ5aWQMiE82ouag_1.json +56 -0
  80. data/spec/fixtures/import_files/threads/1/4L1bg4WQ5aWQMiE82ouag_2.json +55 -0
  81. data/spec/fixtures/import_files/threads/1/4L1bg4WQ5aWQMiE82ouag_4.json +49 -0
  82. data/spec/fixtures/import_files/threads/1/4WFZh4MwC4Mc0EQWAeOY8A_1.json +12 -0
  83. data/spec/fixtures/import_files/threads/1/4WFZh4MwC4Mc0EQWAeOY8A_2.json +12 -0
  84. data/spec/fixtures/import_files/threads/assets/0/image_1.json +9 -0
  85. data/spec/fixtures/import_files/threads/assets/0/image_2.json +9 -0
  86. data/spec/fixtures/import_files/threads/assets/0/image_3.json +9 -0
  87. data/spec/fixtures/import_files/threads/assets/0/image_4.json +9 -0
  88. data/spec/fixtures/settings/contentful_model.json +252 -0
  89. data/spec/fixtures/settings/contentful_structure.json +73 -0
  90. data/spec/fixtures/settings/contentful_structure_test.json +66 -0
  91. data/spec/fixtures/settings/settings.yml +12 -0
  92. data/spec/fixtures/vcr_cassettes/create_asset.yml +621 -0
  93. data/spec/fixtures/vcr_cassettes/create_entry.yml +122 -0
  94. data/spec/fixtures/vcr_cassettes/create_space.yml +87 -0
  95. data/spec/fixtures/vcr_cassettes/import_assets.yml +2822 -0
  96. data/spec/fixtures/vcr_cassettes/import_content_types.yml +1915 -0
  97. data/spec/fixtures/vcr_cassettes/import_entries.yml +5066 -0
  98. data/spec/fixtures/vcr_cassettes/import_entry.yml +363 -0
  99. data/spec/fixtures/vcr_cassettes/invalid_credentials.yml +69 -0
  100. data/spec/fixtures/vcr_cassettes/publish_an_entry.yml +214 -0
  101. data/spec/fixtures/vcr_cassettes/publish_asset.yml +895 -0
  102. data/spec/fixtures/vcr_cassettes/publish_entries.yml +5121 -0
  103. data/spec/fixtures/vcr_cassettes/valid_credentials.yml +7360 -0
  104. data/spec/lib/configuration_spec.rb +22 -0
  105. data/spec/lib/importer/parallel_importer_spec.rb +161 -0
  106. data/spec/lib/json_schema_validator_spec.rb +63 -0
  107. data/spec/lib/migrator_spec.rb +99 -0
  108. data/spec/spec_helper.rb +12 -0
  109. data/spec/support/db_rows_json.rb +9 -0
  110. data/spec/support/shared_configuration.rb +22 -0
  111. data/spec/support/vcr.rb +16 -0
  112. metadata +436 -0
@@ -0,0 +1,363 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/entries/job_skills_1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContentfulManagementGem/0.5.0
12
+ Authorization:
13
+ - Bearer <ACCESS_TOKEN>
14
+ Content-Type:
15
+ - application/vnd.contentful.management.v1+json
16
+ Content-Length:
17
+ - '0'
18
+ Host:
19
+ - api.contentful.com
20
+ response:
21
+ status:
22
+ code: 404
23
+ message: Not Found
24
+ headers:
25
+ Access-Control-Allow-Headers:
26
+ - 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
27
+ Access-Control-Allow-Methods:
28
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
29
+ Access-Control-Allow-Origin:
30
+ - "*"
31
+ Access-Control-Expose-Headers:
32
+ - Etag
33
+ Access-Control-Max-Age:
34
+ - '1728000'
35
+ Content-Type:
36
+ - application/vnd.contentful.management.v1+json
37
+ Date:
38
+ - Wed, 14 Jan 2015 08:11:45 GMT
39
+ Server:
40
+ - nginx
41
+ X-Powered-By:
42
+ - Express
43
+ Content-Length:
44
+ - '205'
45
+ Connection:
46
+ - keep-alive
47
+ body:
48
+ encoding: UTF-8
49
+ string: |
50
+ {
51
+ "sys": {
52
+ "type": "Error",
53
+ "id": "NotFound"
54
+ },
55
+ "message": "The resource could not be found.",
56
+ "details": {
57
+ "type": "Entry",
58
+ "space": "ip17s12q0ek4",
59
+ "id": "job_skills_1"
60
+ }
61
+ }
62
+ http_version:
63
+ recorded_at: Wed, 14 Jan 2015 08:11:47 GMT
64
+ - request:
65
+ method: get
66
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/content_types/2soCP557HGKoOOK0SqmMOm
67
+ body:
68
+ encoding: US-ASCII
69
+ string: ''
70
+ headers:
71
+ User-Agent:
72
+ - RubyContentfulManagementGem/0.5.0
73
+ Authorization:
74
+ - Bearer <ACCESS_TOKEN>
75
+ Content-Type:
76
+ - application/vnd.contentful.management.v1+json
77
+ Content-Length:
78
+ - '0'
79
+ Host:
80
+ - api.contentful.com
81
+ response:
82
+ status:
83
+ code: 200
84
+ message: OK
85
+ headers:
86
+ Access-Control-Allow-Headers:
87
+ - 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
88
+ Access-Control-Allow-Methods:
89
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
90
+ Access-Control-Allow-Origin:
91
+ - "*"
92
+ Access-Control-Expose-Headers:
93
+ - Etag
94
+ Access-Control-Max-Age:
95
+ - '1728000'
96
+ Cf-Space-Id:
97
+ - ip17s12q0ek4
98
+ Content-Type:
99
+ - application/vnd.contentful.management.v1+json
100
+ Date:
101
+ - Wed, 14 Jan 2015 08:11:46 GMT
102
+ Etag:
103
+ - '"6f42d943149546aee003a5b21053ddea"'
104
+ Server:
105
+ - nginx
106
+ X-Powered-By:
107
+ - Express
108
+ Content-Length:
109
+ - '1177'
110
+ Connection:
111
+ - keep-alive
112
+ body:
113
+ encoding: UTF-8
114
+ string: |
115
+ {
116
+ "displayField": "name",
117
+ "name": "Job Skills",
118
+ "description": "",
119
+ "fields": [
120
+ {
121
+ "id": "name",
122
+ "name": "Name",
123
+ "type": "Text",
124
+ "linkType": null,
125
+ "items": null,
126
+ "required": null,
127
+ "localized": null,
128
+ "validations": null
129
+ }
130
+ ],
131
+ "sys": {
132
+ "id": "2soCP557HGKoOOK0SqmMOm",
133
+ "type": "ContentType",
134
+ "createdAt": "2014-12-19T14:14:41.454Z",
135
+ "createdBy": {
136
+ "sys": {
137
+ "type": "Link",
138
+ "linkType": "User",
139
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
140
+ }
141
+ },
142
+ "space": {
143
+ "sys": {
144
+ "type": "Link",
145
+ "linkType": "Space",
146
+ "id": "ip17s12q0ek4"
147
+ }
148
+ },
149
+ "firstPublishedAt": "2014-12-19T14:14:43.043Z",
150
+ "publishedCounter": 1,
151
+ "publishedAt": "2014-12-19T14:14:43.043Z",
152
+ "publishedBy": {
153
+ "sys": {
154
+ "type": "Link",
155
+ "linkType": "User",
156
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
157
+ }
158
+ },
159
+ "publishedVersion": 2,
160
+ "version": 3,
161
+ "updatedAt": "2014-12-19T14:14:43.085Z",
162
+ "updatedBy": {
163
+ "sys": {
164
+ "type": "Link",
165
+ "linkType": "User",
166
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
167
+ }
168
+ }
169
+ }
170
+ }
171
+ http_version:
172
+ recorded_at: Wed, 14 Jan 2015 08:11:47 GMT
173
+ - request:
174
+ method: put
175
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/entries/job_skills_1
176
+ body:
177
+ encoding: UTF-8
178
+ string: '{"fields":{"name":{"en-US":"Commercial awareness"}}}'
179
+ headers:
180
+ User-Agent:
181
+ - RubyContentfulManagementGem/0.5.0
182
+ Authorization:
183
+ - Bearer <ACCESS_TOKEN>
184
+ Content-Type:
185
+ - application/vnd.contentful.management.v1+json
186
+ X-Contentful-Content-Type:
187
+ - 2soCP557HGKoOOK0SqmMOm
188
+ Host:
189
+ - api.contentful.com
190
+ response:
191
+ status:
192
+ code: 201
193
+ message: Created
194
+ headers:
195
+ Access-Control-Allow-Headers:
196
+ - 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
197
+ Access-Control-Allow-Methods:
198
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
199
+ Access-Control-Allow-Origin:
200
+ - "*"
201
+ Access-Control-Expose-Headers:
202
+ - Etag
203
+ Access-Control-Max-Age:
204
+ - '1728000'
205
+ Cf-Space-Id:
206
+ - ip17s12q0ek4
207
+ Content-Type:
208
+ - application/vnd.contentful.management.v1+json
209
+ Date:
210
+ - Wed, 14 Jan 2015 08:11:47 GMT
211
+ Etag:
212
+ - '"e1b93a0aa8f7291658e6633b52bf2dc7"'
213
+ Server:
214
+ - nginx
215
+ X-Powered-By:
216
+ - Express
217
+ Content-Length:
218
+ - '806'
219
+ Connection:
220
+ - keep-alive
221
+ body:
222
+ encoding: UTF-8
223
+ string: |
224
+ {
225
+ "fields": {
226
+ "name": {
227
+ "en-US": "Commercial awareness"
228
+ }
229
+ },
230
+ "sys": {
231
+ "id": "job_skills_1",
232
+ "type": "Entry",
233
+ "version": 1,
234
+ "createdAt": "2015-01-14T08:11:47.211Z",
235
+ "createdBy": {
236
+ "sys": {
237
+ "type": "Link",
238
+ "linkType": "User",
239
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
240
+ }
241
+ },
242
+ "space": {
243
+ "sys": {
244
+ "type": "Link",
245
+ "linkType": "Space",
246
+ "id": "ip17s12q0ek4"
247
+ }
248
+ },
249
+ "contentType": {
250
+ "sys": {
251
+ "type": "Link",
252
+ "linkType": "ContentType",
253
+ "id": "2soCP557HGKoOOK0SqmMOm"
254
+ }
255
+ },
256
+ "updatedAt": "2015-01-14T08:11:47.211Z",
257
+ "updatedBy": {
258
+ "sys": {
259
+ "type": "Link",
260
+ "linkType": "User",
261
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
262
+ }
263
+ }
264
+ }
265
+ }
266
+ http_version:
267
+ recorded_at: Wed, 14 Jan 2015 08:11:48 GMT
268
+ - request:
269
+ method: get
270
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/entries/job_skills_1
271
+ body:
272
+ encoding: US-ASCII
273
+ string: ''
274
+ headers:
275
+ User-Agent:
276
+ - RubyContentfulManagementGem/0.5.0
277
+ Authorization:
278
+ - Bearer <ACCESS_TOKEN>
279
+ Content-Type:
280
+ - application/vnd.contentful.management.v1+json
281
+ Content-Length:
282
+ - '0'
283
+ Host:
284
+ - api.contentful.com
285
+ response:
286
+ status:
287
+ code: 200
288
+ message: OK
289
+ headers:
290
+ Access-Control-Allow-Headers:
291
+ - 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
292
+ Access-Control-Allow-Methods:
293
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
294
+ Access-Control-Allow-Origin:
295
+ - "*"
296
+ Access-Control-Expose-Headers:
297
+ - Etag
298
+ Access-Control-Max-Age:
299
+ - '1728000'
300
+ Cf-Space-Id:
301
+ - ip17s12q0ek4
302
+ Content-Type:
303
+ - application/vnd.contentful.management.v1+json
304
+ Date:
305
+ - Wed, 14 Jan 2015 08:11:47 GMT
306
+ Etag:
307
+ - '"ecfbc551344bd2100ed4fbec99c65903"'
308
+ Server:
309
+ - nginx
310
+ X-Powered-By:
311
+ - Express
312
+ Content-Length:
313
+ - '806'
314
+ Connection:
315
+ - keep-alive
316
+ body:
317
+ encoding: UTF-8
318
+ string: |
319
+ {
320
+ "fields": {
321
+ "name": {
322
+ "en-US": "Commercial awareness"
323
+ }
324
+ },
325
+ "sys": {
326
+ "id": "job_skills_1",
327
+ "type": "Entry",
328
+ "createdAt": "2015-01-14T08:11:47.211Z",
329
+ "createdBy": {
330
+ "sys": {
331
+ "type": "Link",
332
+ "linkType": "User",
333
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
334
+ }
335
+ },
336
+ "space": {
337
+ "sys": {
338
+ "type": "Link",
339
+ "linkType": "Space",
340
+ "id": "ip17s12q0ek4"
341
+ }
342
+ },
343
+ "contentType": {
344
+ "sys": {
345
+ "type": "Link",
346
+ "linkType": "ContentType",
347
+ "id": "2soCP557HGKoOOK0SqmMOm"
348
+ }
349
+ },
350
+ "version": 1,
351
+ "updatedAt": "2015-01-14T08:11:47.257Z",
352
+ "updatedBy": {
353
+ "sys": {
354
+ "type": "Link",
355
+ "linkType": "User",
356
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
357
+ }
358
+ }
359
+ }
360
+ }
361
+ http_version:
362
+ recorded_at: Wed, 14 Jan 2015 08:11:49 GMT
363
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,69 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContentfulManagementGem/0.5.0
12
+ Authorization:
13
+ - Bearer <ACCESS_TOKEN>
14
+ Content-Type:
15
+ - application/vnd.contentful.management.v1+json
16
+ Content-Length:
17
+ - '0'
18
+ Host:
19
+ - api.contentful.com
20
+ response:
21
+ status:
22
+ code: 401
23
+ message: Unauthorized
24
+ headers:
25
+ Accept-Ranges:
26
+ - bytes
27
+ Access-Control-Allow-Headers:
28
+ - 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
29
+ Access-Control-Allow-Methods:
30
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
31
+ Access-Control-Allow-Origin:
32
+ - "*"
33
+ Access-Control-Expose-Headers:
34
+ - Etag
35
+ Access-Control-Max-Age:
36
+ - '1728000'
37
+ Cache-Control:
38
+ - max-age=0
39
+ Content-Type:
40
+ - application/vnd.contentful.management.v1+json
41
+ Date:
42
+ - Sun, 04 Jan 2015 18:33:54 GMT
43
+ Server:
44
+ - nginx
45
+ Status:
46
+ - 401 Unauthorized
47
+ X-Contentful-Request-Id:
48
+ - 85f-1346166421
49
+ X-Ua-Compatible:
50
+ - IE=Edge,chrome=1
51
+ Content-Length:
52
+ - '176'
53
+ Connection:
54
+ - keep-alive
55
+ body:
56
+ encoding: UTF-8
57
+ string: |+
58
+ {
59
+ "sys":{
60
+ "type":"Error",
61
+ "id":"AccessTokenInvalid"
62
+ },
63
+ "requestId":"85f-1346166421",
64
+ "message":"The access token you sent could not be found or is invalid."
65
+ }
66
+
67
+ http_version:
68
+ recorded_at: Sun, 04 Jan 2015 18:33:54 GMT
69
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,214 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/entries/comment_5
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - RubyContentfulManagementGem/0.5.0
12
+ Authorization:
13
+ - Bearer <ACCESS_TOKEN>
14
+ Content-Type:
15
+ - application/vnd.contentful.management.v1+json
16
+ Content-Length:
17
+ - '0'
18
+ Host:
19
+ - api.contentful.com
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Access-Control-Allow-Headers:
26
+ - 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
27
+ Access-Control-Allow-Methods:
28
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
29
+ Access-Control-Allow-Origin:
30
+ - "*"
31
+ Access-Control-Expose-Headers:
32
+ - Etag
33
+ Access-Control-Max-Age:
34
+ - '1728000'
35
+ Cf-Space-Id:
36
+ - ip17s12q0ek4
37
+ Content-Type:
38
+ - application/vnd.contentful.management.v1+json
39
+ Date:
40
+ - Mon, 05 Jan 2015 07:04:06 GMT
41
+ Etag:
42
+ - '"b5db3ca579e112bc006ead7e979bb579"'
43
+ Server:
44
+ - nginx
45
+ X-Powered-By:
46
+ - Express
47
+ Content-Length:
48
+ - '930'
49
+ Connection:
50
+ - keep-alive
51
+ body:
52
+ encoding: UTF-8
53
+ string: |
54
+ {
55
+ "fields": {
56
+ "subject": {
57
+ "en-US": "Comment 2"
58
+ },
59
+ "content": {
60
+ "en-US": "Body Comment 2"
61
+ }
62
+ },
63
+ "sys": {
64
+ "id": "comment_5",
65
+ "type": "Entry",
66
+ "createdAt": "2015-01-04T19:01:31.815Z",
67
+ "createdBy": {
68
+ "sys": {
69
+ "type": "Link",
70
+ "linkType": "User",
71
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
72
+ }
73
+ },
74
+ "space": {
75
+ "sys": {
76
+ "type": "Link",
77
+ "linkType": "Space",
78
+ "id": "ip17s12q0ek4"
79
+ }
80
+ },
81
+ "contentType": {
82
+ "sys": {
83
+ "type": "Link",
84
+ "linkType": "ContentType",
85
+ "id": "6H6pGAV1PUsuoAW26Iu48W"
86
+ }
87
+ },
88
+ "firstPublishedAt": "2015-01-04T19:02:04.204Z",
89
+ "publishedCounter": 2,
90
+ "version": 5,
91
+ "updatedAt": "2015-01-05T07:01:20.927Z",
92
+ "updatedBy": {
93
+ "sys": {
94
+ "type": "Link",
95
+ "linkType": "User",
96
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
97
+ }
98
+ }
99
+ }
100
+ }
101
+ http_version:
102
+ recorded_at: Mon, 05 Jan 2015 07:04:07 GMT
103
+ - request:
104
+ method: put
105
+ uri: https://api.contentful.com/spaces/ip17s12q0ek4/entries/comment_5/published
106
+ body:
107
+ encoding: US-ASCII
108
+ string: ''
109
+ headers:
110
+ User-Agent:
111
+ - RubyContentfulManagementGem/0.5.0
112
+ Authorization:
113
+ - Bearer <ACCESS_TOKEN>
114
+ Content-Type:
115
+ - application/vnd.contentful.management.v1+json
116
+ X-Contentful-Version:
117
+ - '5'
118
+ Content-Length:
119
+ - '0'
120
+ Host:
121
+ - api.contentful.com
122
+ response:
123
+ status:
124
+ code: 200
125
+ message: OK
126
+ headers:
127
+ Access-Control-Allow-Headers:
128
+ - 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
129
+ Access-Control-Allow-Methods:
130
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
131
+ Access-Control-Allow-Origin:
132
+ - "*"
133
+ Access-Control-Expose-Headers:
134
+ - Etag
135
+ Access-Control-Max-Age:
136
+ - '1728000'
137
+ Cf-Space-Id:
138
+ - ip17s12q0ek4
139
+ Content-Type:
140
+ - application/vnd.contentful.management.v1+json
141
+ Date:
142
+ - Mon, 05 Jan 2015 07:04:08 GMT
143
+ Etag:
144
+ - '"403fa4b41f2e2f4bdff08a5a5238ebad"'
145
+ Server:
146
+ - nginx
147
+ X-Powered-By:
148
+ - Express
149
+ Content-Length:
150
+ - '1146'
151
+ Connection:
152
+ - keep-alive
153
+ body:
154
+ encoding: UTF-8
155
+ string: |
156
+ {
157
+ "fields": {
158
+ "subject": {
159
+ "en-US": "Comment 2"
160
+ },
161
+ "content": {
162
+ "en-US": "Body Comment 2"
163
+ }
164
+ },
165
+ "sys": {
166
+ "id": "comment_5",
167
+ "type": "Entry",
168
+ "createdAt": "2015-01-04T19:01:31.815Z",
169
+ "createdBy": {
170
+ "sys": {
171
+ "type": "Link",
172
+ "linkType": "User",
173
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
174
+ }
175
+ },
176
+ "space": {
177
+ "sys": {
178
+ "type": "Link",
179
+ "linkType": "Space",
180
+ "id": "ip17s12q0ek4"
181
+ }
182
+ },
183
+ "contentType": {
184
+ "sys": {
185
+ "type": "Link",
186
+ "linkType": "ContentType",
187
+ "id": "6H6pGAV1PUsuoAW26Iu48W"
188
+ }
189
+ },
190
+ "firstPublishedAt": "2015-01-04T19:02:04.204Z",
191
+ "publishedCounter": 3,
192
+ "version": 6,
193
+ "updatedAt": "2015-01-05T07:04:08.045Z",
194
+ "updatedBy": {
195
+ "sys": {
196
+ "type": "Link",
197
+ "linkType": "User",
198
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
199
+ }
200
+ },
201
+ "publishedAt": "2015-01-05T07:04:08.045Z",
202
+ "publishedBy": {
203
+ "sys": {
204
+ "type": "Link",
205
+ "linkType": "User",
206
+ "id": "1E7acJL8I5XUXAMHQt9Grs"
207
+ }
208
+ },
209
+ "publishedVersion": 5
210
+ }
211
+ }
212
+ http_version:
213
+ recorded_at: Mon, 05 Jan 2015 07:04:08 GMT
214
+ recorded_with: VCR 2.9.3