contentful_bootstrap 3.2.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/Gemfile +1 -0
  4. data/README.md +11 -6
  5. data/bin/contentful_bootstrap +6 -0
  6. data/lib/contentful/bootstrap/command_runner.rb +2 -1
  7. data/lib/contentful/bootstrap/commands/generate_json.rb +4 -3
  8. data/lib/contentful/bootstrap/commands/update_space.rb +3 -2
  9. data/lib/contentful/bootstrap/generator.rb +8 -1
  10. data/lib/contentful/bootstrap/templates/base.rb +8 -7
  11. data/lib/contentful/bootstrap/templates/blog.rb +3 -3
  12. data/lib/contentful/bootstrap/templates/catalogue.rb +14 -14
  13. data/lib/contentful/bootstrap/templates/gallery.rb +8 -8
  14. data/lib/contentful/bootstrap/templates/json_template.rb +7 -6
  15. data/lib/contentful/bootstrap/version.rb +1 -1
  16. data/spec/contentful/bootstrap/command_runner_spec.rb +3 -3
  17. data/spec/contentful/bootstrap/commands/create_space_spec.rb +13 -0
  18. data/spec/contentful/bootstrap/commands/update_space_spec.rb +27 -8
  19. data/spec/contentful/bootstrap/generator_spec.rb +13 -1
  20. data/spec/contentful/bootstrap/templates/base_spec.rb +13 -1
  21. data/spec/contentful/bootstrap/templates/json_template_spec.rb +35 -3
  22. data/spec/fixtures/json_fixtures/asset_no_transform.json +16 -0
  23. data/spec/fixtures/json_fixtures/wl1z0pal05vy_content_types_only.json +157 -0
  24. data/spec/fixtures/vcr_fixtures/asset_no_transform.yml +654 -0
  25. data/spec/fixtures/vcr_fixtures/create_space_with_blog_template.yml +1122 -730
  26. data/spec/fixtures/vcr_fixtures/create_space_with_catalogue_template.yml +2378 -2166
  27. data/spec/fixtures/vcr_fixtures/create_space_with_gallery_template.yml +1549 -928
  28. data/spec/fixtures/vcr_fixtures/generate_json_content_types_only.yml +94 -0
  29. data/spec/spec_helper.rb +5 -0
  30. metadata +11 -3
@@ -1,6 +1,6 @@
1
1
  module Contentful
2
2
  module Bootstrap
3
- VERSION = '3.2.0'
3
+ VERSION = '3.3.0'
4
4
 
5
5
  def self.major_version
6
6
  VERSION.split('.').first.to_i
@@ -101,7 +101,7 @@ describe Contentful::Bootstrap::CommandRunner do
101
101
  allow_any_instance_of(Contentful::Bootstrap::Commands::GenerateJson).to receive(:run)
102
102
 
103
103
  expect(Contentful::Bootstrap::Commands::GenerateJson).to receive(:new).with(
104
- 'foo', 'bar', nil
104
+ 'foo', 'bar', nil, false
105
105
  ).and_call_original
106
106
 
107
107
  subject.generate_json('foo', access_token: 'bar')
@@ -111,10 +111,10 @@ describe Contentful::Bootstrap::CommandRunner do
111
111
  allow_any_instance_of(Contentful::Bootstrap::Commands::GenerateJson).to receive(:run)
112
112
 
113
113
  expect(Contentful::Bootstrap::Commands::GenerateJson).to receive(:new).with(
114
- 'foo', 'bar', 'baz'
114
+ 'foo', 'bar', 'baz', true
115
115
  ).and_call_original
116
116
 
117
- subject.generate_json('foo', access_token: 'bar', filename: 'baz')
117
+ subject.generate_json('foo', access_token: 'bar', filename: 'baz', content_types_only: true)
118
118
  end
119
119
 
120
120
  it 'runs command' do
@@ -72,6 +72,19 @@ describe Contentful::Bootstrap::Commands::CreateSpace do
72
72
  command.run
73
73
  }
74
74
  end
75
+
76
+ it 'assets can be created with any content type #39' do
77
+ json_path = File.expand_path(File.join('spec', 'fixtures', 'json_fixtures', 'asset_no_transform.json'))
78
+
79
+ allow_any_instance_of(described_class).to receive(:gets).and_return('y')
80
+ allow_any_instance_of(Contentful::Bootstrap::Commands::GenerateToken).to receive(:gets).and_return('n')
81
+
82
+ command = described_class.new(token, 'asset_no_transform', nil, json_path, false)
83
+
84
+ vcr('asset_no_transform') {
85
+ command.run
86
+ }
87
+ end
75
88
  end
76
89
 
77
90
  describe 'integration' do
@@ -41,22 +41,41 @@ describe Contentful::Bootstrap::Commands::UpdateSpace do
41
41
 
42
42
  describe 'runs JSON Template without already processed elements' do
43
43
  [true, false].each do |mark_processed|
44
- it (mark_processed ? 'marks as processed after run' : 'doesnt modify input file after done') do
45
- subject = described_class.new token, 'foo', 'bar', mark_processed, false
44
+ context "mark_processed is #{mark_processed}" do
45
+ subject { described_class.new token, 'foo', 'bar', mark_processed, false }
46
46
 
47
- allow(::File).to receive(:exist?) { true }
47
+ it "calls JsonTemplate with mark_processed as #{mark_processed}" do
48
+ allow(::File).to receive(:exist?) { true }
48
49
 
49
- mock_template = Object.new
50
+ mock_template = Object.new
50
51
 
51
- expect(subject).to receive(:fetch_space) { space_double }
52
- expect(mock_template).to receive(:run)
52
+ expect(subject).to receive(:fetch_space) { space_double }
53
+ expect(mock_template).to receive(:run)
53
54
 
54
- expect(::Contentful::Bootstrap::Templates::JsonTemplate).to receive(:new).with(space_double, 'bar', mark_processed, false) { mock_template }
55
+ expect(::Contentful::Bootstrap::Templates::JsonTemplate).to receive(:new).with(space_double, 'bar', mark_processed, false, false) { mock_template }
55
56
 
56
- subject.run
57
+ subject.run
58
+ end
57
59
  end
58
60
  end
59
61
  end
62
+
63
+ context 'with skip_content_types set to true' do
64
+ subject { described_class.new token, 'foo', 'bar', false, false, true }
65
+
66
+ it 'calls JsonTemplate with skip_content_types' do
67
+ allow(::File).to receive(:exist?) { true }
68
+
69
+ mock_template = Object.new
70
+
71
+ expect(subject).to receive(:fetch_space) { space_double }
72
+ expect(mock_template).to receive(:run)
73
+
74
+ expect(::Contentful::Bootstrap::Templates::JsonTemplate).to receive(:new).with(space_double, 'bar', false, false, true) { mock_template }
75
+
76
+ subject.run
77
+ end
78
+ end
60
79
  end
61
80
  end
62
81
 
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Contentful::Bootstrap::Generator do
4
- subject { Contentful::Bootstrap::Generator.new('wl1z0pal05vy', '48d7db7d4cd9d09df573c251d456f4acc72141b92f36e57f8684b36cf5cfff6e') }
4
+ subject { Contentful::Bootstrap::Generator.new('wl1z0pal05vy', '48d7db7d4cd9d09df573c251d456f4acc72141b92f36e57f8684b36cf5cfff6e', false) }
5
5
 
6
6
  describe 'JSON template generator' do
7
7
  it 'can generate a JSON template for a given space' do
@@ -11,5 +11,17 @@ describe Contentful::Bootstrap::Generator do
11
11
  }
12
12
  }
13
13
  end
14
+
15
+ context 'with content_types_only set to true' do
16
+ subject { Contentful::Bootstrap::Generator.new('wl1z0pal05vy', '48d7db7d4cd9d09df573c251d456f4acc72141b92f36e57f8684b36cf5cfff6e', true) }
17
+
18
+ it 'can generate a JSON template for a given space with only Content Types' do
19
+ vcr('generate_json_content_types_only') {
20
+ json_fixture('wl1z0pal05vy_content_types_only') { |json|
21
+ expect(subject.generate_json).to eq JSON.pretty_generate(json)
22
+ }
23
+ }
24
+ end
25
+ end
14
26
  end
15
27
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Contentful::Bootstrap::Templates::Base do
4
4
  let(:space) { Contentful::Management::Space.new }
5
- subject { Contentful::Bootstrap::Templates::Base.new(space) }
5
+ subject { described_class.new(space) }
6
6
 
7
7
  describe 'instance methods' do
8
8
  it '#content_types' do
@@ -31,6 +31,18 @@ describe Contentful::Bootstrap::Templates::Base do
31
31
 
32
32
  subject.run
33
33
  end
34
+
35
+ context 'with skip_content_types set to true' do
36
+ subject { described_class.new(space, true) }
37
+
38
+ it 'doesnt call create_content_type if skip_content_types is sent' do
39
+ expect(subject).to receive(:create_entries)
40
+ expect(subject).to receive(:create_assets)
41
+ expect(subject).not_to receive(:create_content_types)
42
+
43
+ subject.run
44
+ end
45
+ end
34
46
  end
35
47
  end
36
48
 
@@ -16,7 +16,7 @@ describe Contentful::Bootstrap::Templates::JsonTemplate do
16
16
  {
17
17
  "id" => "cat",
18
18
  "name" => "Cat",
19
- "display_field" => "name",
19
+ "displayField" => "name",
20
20
  "fields" => [
21
21
  {
22
22
  "id" => "name",
@@ -31,13 +31,13 @@ describe Contentful::Bootstrap::Templates::JsonTemplate do
31
31
  end
32
32
 
33
33
  it 'uses displayField if found' do
34
- expect(subject.content_types.first['display_field']).to eq 'name'
34
+ expect(subject.content_types.first['displayField']).to eq 'name'
35
35
  end
36
36
 
37
37
  it 'uses display_field if not' do
38
38
  subject = described_class.new(space, File.expand_path(File.join('spec', 'fixtures', 'json_fixtures', 'display_field.json')))
39
39
 
40
- expect(subject.content_types.first['display_field']).to eq 'name'
40
+ expect(subject.content_types.first['displayField']).to eq 'name'
41
41
  end
42
42
  end
43
43
 
@@ -168,4 +168,36 @@ describe Contentful::Bootstrap::Templates::JsonTemplate do
168
168
  subject.run
169
169
  end
170
170
  end
171
+
172
+ describe 'skip_content_types' do
173
+ context 'with skip_content_types set to true' do
174
+ subject { described_class.new(space, path, false, false, true) }
175
+
176
+ it 'skips content type creation' do
177
+ ['assets', 'entries'].each do |n|
178
+ expect(subject).to receive("create_#{n}".to_sym)
179
+ end
180
+
181
+ expect(subject).not_to receive(:create_content_types)
182
+
183
+ allow(subject).to receive(:after_run)
184
+
185
+ subject.run
186
+ end
187
+ end
188
+
189
+ context 'with skip_content_types set to false' do
190
+ subject { described_class.new(space, path, false, false, false) }
191
+
192
+ it 'doesnt skip content type creation' do
193
+ ['assets', 'entries', 'content_types'].each do |n|
194
+ expect(subject).to receive("create_#{n}".to_sym)
195
+ end
196
+
197
+ allow(subject).to receive(:after_run)
198
+
199
+ subject.run
200
+ end
201
+ end
202
+ end
171
203
  end
@@ -0,0 +1,16 @@
1
+ {
2
+ "version": 3,
3
+ "contentTypes": [],
4
+ "entries": {},
5
+ "assets": [
6
+ {
7
+ "id": "my_asset",
8
+ "title": "My Asset",
9
+ "file": {
10
+ "filename": "some_filename.svg",
11
+ "contentType": "image/svg+xml",
12
+ "url": "https://upload.wikimedia.org/wikipedia/commons/3/30/Vector-based_example.svg"
13
+ }
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,157 @@
1
+ {
2
+ "version": 3,
3
+ "contentTypes": [
4
+ {
5
+ "id": "2PqfXUJwE8qSYKuM0U6w8M",
6
+ "name": "Product",
7
+ "displayField": "productName",
8
+ "fields": [
9
+ {
10
+ "id": "productName",
11
+ "name": "Product name",
12
+ "type": "Text"
13
+ },
14
+ {
15
+ "id": "slug",
16
+ "name": "Slug",
17
+ "type": "Symbol"
18
+ },
19
+ {
20
+ "id": "productDescription",
21
+ "name": "Description",
22
+ "type": "Text"
23
+ },
24
+ {
25
+ "id": "sizetypecolor",
26
+ "name": "Size/Type/Color",
27
+ "type": "Symbol"
28
+ },
29
+ {
30
+ "id": "image",
31
+ "name": "Image",
32
+ "type": "Array",
33
+ "items": {
34
+ "type": "Link",
35
+ "linkType": "Asset"
36
+ }
37
+ },
38
+ {
39
+ "id": "tags",
40
+ "name": "Tags",
41
+ "type": "Array",
42
+ "items": {
43
+ "type": "Symbol"
44
+ }
45
+ },
46
+ {
47
+ "id": "categories",
48
+ "name": "Categories",
49
+ "type": "Array",
50
+ "items": {
51
+ "type": "Link",
52
+ "linkType": "Entry"
53
+ }
54
+ },
55
+ {
56
+ "id": "price",
57
+ "name": "Price",
58
+ "type": "Number"
59
+ },
60
+ {
61
+ "id": "brand",
62
+ "name": "Brand",
63
+ "type": "Link",
64
+ "linkType": "Entry"
65
+ },
66
+ {
67
+ "id": "quantity",
68
+ "name": "Quantity",
69
+ "type": "Integer"
70
+ },
71
+ {
72
+ "id": "sku",
73
+ "name": "SKU",
74
+ "type": "Symbol"
75
+ },
76
+ {
77
+ "id": "website",
78
+ "name": "Available at",
79
+ "type": "Symbol"
80
+ }
81
+ ]
82
+ },
83
+ {
84
+ "id": "6XwpTaSiiI2Ak2Ww0oi6qa",
85
+ "name": "Category",
86
+ "displayField": "title",
87
+ "fields": [
88
+ {
89
+ "id": "title",
90
+ "name": "Title",
91
+ "type": "Text"
92
+ },
93
+ {
94
+ "id": "icon",
95
+ "name": "Icon",
96
+ "type": "Link",
97
+ "linkType": "Asset"
98
+ },
99
+ {
100
+ "id": "categoryDescription",
101
+ "name": "Description",
102
+ "type": "Text"
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "id": "sFzTZbSuM8coEwygeUYes",
108
+ "name": "Brand",
109
+ "displayField": "companyName",
110
+ "fields": [
111
+ {
112
+ "id": "companyName",
113
+ "name": "Company name",
114
+ "type": "Text"
115
+ },
116
+ {
117
+ "id": "logo",
118
+ "name": "Logo",
119
+ "type": "Link",
120
+ "linkType": "Asset"
121
+ },
122
+ {
123
+ "id": "companyDescription",
124
+ "name": "Description",
125
+ "type": "Text"
126
+ },
127
+ {
128
+ "id": "website",
129
+ "name": "Website",
130
+ "type": "Symbol"
131
+ },
132
+ {
133
+ "id": "twitter",
134
+ "name": "Twitter",
135
+ "type": "Symbol"
136
+ },
137
+ {
138
+ "id": "email",
139
+ "name": "Email",
140
+ "type": "Symbol"
141
+ },
142
+ {
143
+ "id": "phone",
144
+ "name": "Phone #",
145
+ "type": "Array",
146
+ "items": {
147
+ "type": "Symbol"
148
+ }
149
+ }
150
+ ]
151
+ }
152
+ ],
153
+ "assets": [
154
+ ],
155
+ "entries": {
156
+ }
157
+ }
@@ -0,0 +1,654 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.contentful.com/spaces
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"name":"asset_no_transform","defaultLocale":"en-US"}'
9
+ headers:
10
+ User-Agent:
11
+ - ContentfulBootstrap/3.2.0
12
+ Authorization:
13
+ - Bearer foobar
14
+ Content-Type:
15
+ - application/vnd.contentful.management.v1+json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.contentful.com
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
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,X-Contentful-User-Agent
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
+ - Fri, 22 Jul 2016 13:22:19 GMT
43
+ Etag:
44
+ - '"6ada1d8d1a051e6eb435b18db589866b"'
45
+ Location:
46
+ - https://api.contentful.com/spaces/896fh6408nuq
47
+ Server:
48
+ - Contentful
49
+ Status:
50
+ - 201 Created
51
+ Strict-Transport-Security:
52
+ - max-age=15768000
53
+ X-Content-Type-Options:
54
+ - nosniff
55
+ X-Contentful-Request-Id:
56
+ - ca06fd2b3f91c099c77c6a66b348570f
57
+ Content-Length:
58
+ - '461'
59
+ Connection:
60
+ - Close
61
+ Set-Cookie:
62
+ - incap_ses_297_673446=v+wCXFSK01JoFKXJMCgfBAseklcAAAAAlVZNv7kB4aJy6JqxvbWGfw==;
63
+ path=/; Domain=.contentful.com
64
+ - nlbi_673446=mCw9CePS1W1za3YT6lKYhQAAAABN3yGdIzMuHYtiVGBRoEjj; path=/; Domain=.contentful.com
65
+ - visid_incap_673446=mtts0RvIQ0+hw1xMnwki8gseklcAAAAAQUIPAAAAAADw37o3uBC2DjR9atHXPOgi;
66
+ expires=Sat, 22 Jul 2017 06:56:23 GMT; path=/; Domain=.contentful.com
67
+ X-Iinfo:
68
+ - 10-231205094-231205131 NNNN CT(195 171 0) RT(1469193736727 90) q(0 0 3 -1)
69
+ r(23 23) U5
70
+ X-Cdn:
71
+ - Incapsula
72
+ body:
73
+ encoding: UTF-8
74
+ string: |+
75
+ {
76
+ "name":"asset_no_transform",
77
+ "sys":{
78
+ "type":"Space",
79
+ "id":"896fh6408nuq",
80
+ "version":1,
81
+ "createdBy":{
82
+ "sys":{
83
+ "type":"Link",
84
+ "linkType":"User",
85
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
86
+ }
87
+ },
88
+ "createdAt":"2016-07-22T13:22:17Z",
89
+ "updatedBy":{
90
+ "sys":{
91
+ "type":"Link",
92
+ "linkType":"User",
93
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
94
+ }
95
+ },
96
+ "updatedAt":"2016-07-22T13:22:17Z"
97
+ }
98
+ }
99
+
100
+ http_version:
101
+ recorded_at: Fri, 22 Jul 2016 13:22:19 GMT
102
+ - request:
103
+ method: put
104
+ uri: https://api.contentful.com/spaces/896fh6408nuq/assets/my_asset
105
+ body:
106
+ encoding: UTF-8
107
+ string: '{"fields":{"title":{"en-US":"My Asset"},"description":{"en-US":null},"file":{"en-US":{"contentType":"image/svg+xml","fileName":"some_filename.svg","upload":"https://upload.wikimedia.org/wikipedia/commons/3/30/Vector-based_example.svg"}}}}'
108
+ headers:
109
+ User-Agent:
110
+ - ContentfulBootstrap/3.2.0
111
+ Authorization:
112
+ - Bearer foobar
113
+ Content-Type:
114
+ - application/vnd.contentful.management.v1+json
115
+ Connection:
116
+ - close
117
+ Host:
118
+ - api.contentful.com
119
+ response:
120
+ status:
121
+ code: 201
122
+ message: Created
123
+ headers:
124
+ Access-Control-Allow-Headers:
125
+ - 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
126
+ Access-Control-Allow-Methods:
127
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
128
+ Access-Control-Allow-Origin:
129
+ - "*"
130
+ Access-Control-Expose-Headers:
131
+ - Etag
132
+ Access-Control-Max-Age:
133
+ - '1728000'
134
+ Cf-Space-Id:
135
+ - 896fh6408nuq
136
+ Content-Type:
137
+ - application/vnd.contentful.management.v1+json
138
+ Date:
139
+ - Fri, 22 Jul 2016 13:22:24 GMT
140
+ Etag:
141
+ - '"b65dd43b153f1e9230d4d2c4f7e74829"'
142
+ Server:
143
+ - Contentful
144
+ Strict-Transport-Security:
145
+ - max-age=15768000
146
+ X-Content-Type-Options:
147
+ - nosniff
148
+ X-Contentful-Request-Id:
149
+ - d960827376fb757d5bf4304b929a1ba4
150
+ Content-Length:
151
+ - '914'
152
+ Connection:
153
+ - Close
154
+ Set-Cookie:
155
+ - incap_ses_297_673446=IKg2KLY7C2v6HKXJMCgfBA8eklcAAAAAZT7D062krOv3QZpTRp/96A==;
156
+ path=/; Domain=.contentful.com
157
+ - nlbi_673446=Fks2ZBU2kR7TRzpX6lKYhQAAAAAas6rYW+WcRqxxa5tHSFp+; path=/; Domain=.contentful.com
158
+ - visid_incap_673446=LezNecVtS+K78KSiu8pFbQ8eklcAAAAAQUIPAAAAAAAwZjTM1iTAAtNuR3i6nTUS;
159
+ expires=Sat, 22 Jul 2017 06:56:23 GMT; path=/; Domain=.contentful.com
160
+ X-Iinfo:
161
+ - 10-231206323-231206373 NNNN CT(144 142 0) RT(1469193739309 108) q(0 0 3 -1)
162
+ r(43 43) U5
163
+ X-Cdn:
164
+ - Incapsula
165
+ body:
166
+ encoding: UTF-8
167
+ string: |
168
+ {
169
+ "fields": {
170
+ "title": {
171
+ "en-US": "My Asset"
172
+ },
173
+ "description": {
174
+ "en-US": null
175
+ },
176
+ "file": {
177
+ "en-US": {
178
+ "contentType": "image/svg+xml",
179
+ "fileName": "some_filename.svg",
180
+ "upload": "https://upload.wikimedia.org/wikipedia/commons/3/30/Vector-based_example.svg"
181
+ }
182
+ }
183
+ },
184
+ "sys": {
185
+ "id": "my_asset",
186
+ "type": "Asset",
187
+ "version": 1,
188
+ "createdAt": "2016-07-22T13:22:24.059Z",
189
+ "createdBy": {
190
+ "sys": {
191
+ "type": "Link",
192
+ "linkType": "User",
193
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
194
+ }
195
+ },
196
+ "space": {
197
+ "sys": {
198
+ "type": "Link",
199
+ "linkType": "Space",
200
+ "id": "896fh6408nuq"
201
+ }
202
+ },
203
+ "updatedAt": "2016-07-22T13:22:24.060Z",
204
+ "updatedBy": {
205
+ "sys": {
206
+ "type": "Link",
207
+ "linkType": "User",
208
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
209
+ }
210
+ }
211
+ }
212
+ }
213
+ http_version:
214
+ recorded_at: Fri, 22 Jul 2016 13:22:24 GMT
215
+ - request:
216
+ method: put
217
+ uri: https://api.contentful.com/spaces/896fh6408nuq/assets/my_asset/files/en-US/process
218
+ body:
219
+ encoding: US-ASCII
220
+ string: ''
221
+ headers:
222
+ User-Agent:
223
+ - ContentfulBootstrap/3.2.0
224
+ Authorization:
225
+ - Bearer foobar
226
+ Content-Type:
227
+ - application/vnd.contentful.management.v1+json
228
+ X-Contentful-Version:
229
+ - '1'
230
+ Content-Length:
231
+ - '0'
232
+ Connection:
233
+ - close
234
+ Host:
235
+ - api.contentful.com
236
+ response:
237
+ status:
238
+ code: 204
239
+ message: No Content
240
+ headers:
241
+ Access-Control-Allow-Headers:
242
+ - 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
243
+ Access-Control-Allow-Methods:
244
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
245
+ Access-Control-Allow-Origin:
246
+ - "*"
247
+ Access-Control-Expose-Headers:
248
+ - Etag
249
+ Access-Control-Max-Age:
250
+ - '1728000'
251
+ Cf-Space-Id:
252
+ - 896fh6408nuq
253
+ Content-Type:
254
+ - application/vnd.contentful.management.v1+json
255
+ Date:
256
+ - Fri, 22 Jul 2016 13:22:26 GMT
257
+ Server:
258
+ - Contentful
259
+ Strict-Transport-Security:
260
+ - max-age=15768000
261
+ X-Content-Type-Options:
262
+ - nosniff
263
+ X-Contentful-Request-Id:
264
+ - 10bb24b1a92aeac30c48bc63733cc5ff
265
+ Connection:
266
+ - Close
267
+ Set-Cookie:
268
+ - incap_ses_297_673446=5uwLL0oqgRKDIqXJMCgfBBIeklcAAAAAC2sdU286rW2VQvwVxEY8pQ==;
269
+ path=/; Domain=.contentful.com
270
+ - nlbi_673446=cT14OokJQQ8l8MM06lKYhQAAAADaw4luaDzGDpy5uE8DAG9z; path=/; Domain=.contentful.com
271
+ - visid_incap_673446=djkePlCTQ2GQLSuq2U17bBIeklcAAAAAQUIPAAAAAABNYvySDXt8vuVQ5nqljSZi;
272
+ expires=Sat, 22 Jul 2017 06:56:23 GMT; path=/; Domain=.contentful.com
273
+ X-Iinfo:
274
+ - 8-196995211-196995253 NNNN CT(144 145 0) RT(1469193743915 97) q(0 0 3 -1)
275
+ r(26 26) U5
276
+ X-Cdn:
277
+ - Incapsula
278
+ body:
279
+ encoding: UTF-8
280
+ string: ''
281
+ http_version:
282
+ recorded_at: Fri, 22 Jul 2016 13:22:27 GMT
283
+ - request:
284
+ method: get
285
+ uri: https://api.contentful.com/spaces/896fh6408nuq/assets/my_asset
286
+ body:
287
+ encoding: US-ASCII
288
+ string: ''
289
+ headers:
290
+ User-Agent:
291
+ - ContentfulBootstrap/3.2.0
292
+ Authorization:
293
+ - Bearer foobar
294
+ Content-Type:
295
+ - application/vnd.contentful.management.v1+json
296
+ Content-Length:
297
+ - '0'
298
+ Connection:
299
+ - close
300
+ Host:
301
+ - api.contentful.com
302
+ response:
303
+ status:
304
+ code: 200
305
+ message: OK
306
+ headers:
307
+ Access-Control-Allow-Headers:
308
+ - 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
309
+ Access-Control-Allow-Methods:
310
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
311
+ Access-Control-Allow-Origin:
312
+ - "*"
313
+ Access-Control-Expose-Headers:
314
+ - Etag
315
+ Access-Control-Max-Age:
316
+ - '1728000'
317
+ Cf-Space-Id:
318
+ - 896fh6408nuq
319
+ Content-Type:
320
+ - application/vnd.contentful.management.v1+json
321
+ Date:
322
+ - Fri, 22 Jul 2016 13:22:27 GMT
323
+ Etag:
324
+ - '"10f0942872246f8ab1ccf33c9f232f93"'
325
+ Server:
326
+ - Contentful
327
+ Strict-Transport-Security:
328
+ - max-age=15768000
329
+ X-Content-Type-Options:
330
+ - nosniff
331
+ X-Contentful-Request-Id:
332
+ - a56a95fa8279ab215be42519e16d5b0a
333
+ Content-Length:
334
+ - '986'
335
+ Connection:
336
+ - Close
337
+ Set-Cookie:
338
+ - incap_ses_297_673446=OrGYTBqBmVvZI6XJMCgfBBMeklcAAAAAPddk3vNGTGRTBi5L05oDLw==;
339
+ path=/; Domain=.contentful.com
340
+ - nlbi_673446=Cen8FMGsaWCW1dK06lKYhQAAAAAZo/AOtobspIorqMORb53G; path=/; Domain=.contentful.com
341
+ - visid_incap_673446=3XMR5FWhQ/G9q4evzThYdhMeklcAAAAAQUIPAAAAAACVy4BHSyBpNT3GsOVIm6F0;
342
+ expires=Sat, 22 Jul 2017 06:56:23 GMT; path=/; Domain=.contentful.com
343
+ X-Iinfo:
344
+ - 8-196996441-196996477 NNNN CT(144 143 0) RT(1469193746700 104) q(0 0 2 -1)
345
+ r(5 5) U5
346
+ X-Cdn:
347
+ - Incapsula
348
+ body:
349
+ encoding: UTF-8
350
+ string: |
351
+ {
352
+ "fields": {
353
+ "title": {
354
+ "en-US": "My Asset"
355
+ },
356
+ "description": {
357
+ "en-US": null
358
+ },
359
+ "file": {
360
+ "en-US": {
361
+ "contentType": "image/svg+xml",
362
+ "fileName": "some_filename.svg",
363
+ "details": {
364
+ "size": 6518
365
+ },
366
+ "url": "//assets.contentful.com/896fh6408nuq/my_asset/8548dc94529578d75037da3a6f5b0291/some_filename.svg"
367
+ }
368
+ }
369
+ },
370
+ "sys": {
371
+ "id": "my_asset",
372
+ "type": "Asset",
373
+ "createdAt": "2016-07-22T13:22:24.059Z",
374
+ "createdBy": {
375
+ "sys": {
376
+ "type": "Link",
377
+ "linkType": "User",
378
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
379
+ }
380
+ },
381
+ "space": {
382
+ "sys": {
383
+ "type": "Link",
384
+ "linkType": "Space",
385
+ "id": "896fh6408nuq"
386
+ }
387
+ },
388
+ "version": 2,
389
+ "updatedAt": "2016-07-22T13:22:26.987Z",
390
+ "updatedBy": {
391
+ "sys": {
392
+ "type": "Link",
393
+ "linkType": "User",
394
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
395
+ }
396
+ }
397
+ }
398
+ }
399
+ http_version:
400
+ recorded_at: Fri, 22 Jul 2016 13:22:27 GMT
401
+ - request:
402
+ method: put
403
+ uri: https://api.contentful.com/spaces/896fh6408nuq/assets/my_asset/published
404
+ body:
405
+ encoding: US-ASCII
406
+ string: ''
407
+ headers:
408
+ User-Agent:
409
+ - ContentfulBootstrap/3.2.0
410
+ Authorization:
411
+ - Bearer foobar
412
+ Content-Type:
413
+ - application/vnd.contentful.management.v1+json
414
+ X-Contentful-Version:
415
+ - '2'
416
+ Content-Length:
417
+ - '0'
418
+ Connection:
419
+ - close
420
+ Host:
421
+ - api.contentful.com
422
+ response:
423
+ status:
424
+ code: 200
425
+ message: OK
426
+ headers:
427
+ Access-Control-Allow-Headers:
428
+ - 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
429
+ Access-Control-Allow-Methods:
430
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
431
+ Access-Control-Allow-Origin:
432
+ - "*"
433
+ Access-Control-Expose-Headers:
434
+ - Etag
435
+ Access-Control-Max-Age:
436
+ - '1728000'
437
+ Cf-Space-Id:
438
+ - 896fh6408nuq
439
+ Content-Type:
440
+ - application/vnd.contentful.management.v1+json
441
+ Date:
442
+ - Fri, 22 Jul 2016 13:22:28 GMT
443
+ Etag:
444
+ - '"cb0dcde14104a169870599467592f834"'
445
+ Server:
446
+ - Contentful
447
+ Strict-Transport-Security:
448
+ - max-age=15768000
449
+ X-Content-Type-Options:
450
+ - nosniff
451
+ X-Contentful-Request-Id:
452
+ - 8b4a51da420f4e375d5836cf2e1d0822
453
+ Content-Length:
454
+ - '1281'
455
+ Connection:
456
+ - Close
457
+ Set-Cookie:
458
+ - incap_ses_297_673446=Zel3a8Q2TRvaJaXJMCgfBBQeklcAAAAAA3vIxFrX+HgsDAmS6nBvRw==;
459
+ path=/; Domain=.contentful.com
460
+ - nlbi_673446=t0sfIeaeniyfYn0O6lKYhQAAAADlzciKZ2FtAUhRjnqPIxY+; path=/; Domain=.contentful.com
461
+ - visid_incap_673446=L2gafcFtTiOp4e+19Bz5xxQeklcAAAAAQUIPAAAAAAANj5kXQPBqjBHvx/HJhbe4;
462
+ expires=Sat, 22 Jul 2017 06:56:23 GMT; path=/; Domain=.contentful.com
463
+ X-Iinfo:
464
+ - 6-154538102-154538147 NNNN CT(160 160 0) RT(1469193747428 98) q(0 0 3 -1)
465
+ r(7 7) U5
466
+ X-Cdn:
467
+ - Incapsula
468
+ body:
469
+ encoding: UTF-8
470
+ string: |
471
+ {
472
+ "fields": {
473
+ "title": {
474
+ "en-US": "My Asset"
475
+ },
476
+ "description": {
477
+ "en-US": null
478
+ },
479
+ "file": {
480
+ "en-US": {
481
+ "contentType": "image/svg+xml",
482
+ "fileName": "some_filename.svg",
483
+ "details": {
484
+ "size": 6518
485
+ },
486
+ "url": "//assets.contentful.com/896fh6408nuq/my_asset/8548dc94529578d75037da3a6f5b0291/some_filename.svg"
487
+ }
488
+ }
489
+ },
490
+ "sys": {
491
+ "id": "my_asset",
492
+ "type": "Asset",
493
+ "createdAt": "2016-07-22T13:22:24.059Z",
494
+ "createdBy": {
495
+ "sys": {
496
+ "type": "Link",
497
+ "linkType": "User",
498
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
499
+ }
500
+ },
501
+ "space": {
502
+ "sys": {
503
+ "type": "Link",
504
+ "linkType": "Space",
505
+ "id": "896fh6408nuq"
506
+ }
507
+ },
508
+ "version": 3,
509
+ "updatedAt": "2016-07-22T13:22:28.404Z",
510
+ "updatedBy": {
511
+ "sys": {
512
+ "type": "Link",
513
+ "linkType": "User",
514
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
515
+ }
516
+ },
517
+ "firstPublishedAt": "2016-07-22T13:22:28.404Z",
518
+ "publishedCounter": 1,
519
+ "publishedAt": "2016-07-22T13:22:28.404Z",
520
+ "publishedBy": {
521
+ "sys": {
522
+ "type": "Link",
523
+ "linkType": "User",
524
+ "id": "4SejVrWT96dvL9IV4Nb7sQ"
525
+ }
526
+ },
527
+ "publishedVersion": 2
528
+ }
529
+ }
530
+ http_version:
531
+ recorded_at: Fri, 22 Jul 2016 13:22:28 GMT
532
+ - request:
533
+ method: post
534
+ uri: https://api.contentful.com/spaces/896fh6408nuq/api_keys
535
+ body:
536
+ encoding: UTF-8
537
+ string: '{"name":"Bootstrap Token","description":"Created with ''contentful_bootstrap.rb
538
+ v3.2.0''"}'
539
+ headers:
540
+ User-Agent:
541
+ - ContentfulBootstrap/3.2.0
542
+ Authorization:
543
+ - Bearer foobar
544
+ Content-Type:
545
+ - application/vnd.contentful.management.v1+json
546
+ Connection:
547
+ - close
548
+ Host:
549
+ - api.contentful.com
550
+ response:
551
+ status:
552
+ code: 201
553
+ message: Created
554
+ headers:
555
+ Accept-Ranges:
556
+ - bytes
557
+ Access-Control-Allow-Headers:
558
+ - 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
559
+ Access-Control-Allow-Methods:
560
+ - DELETE,GET,HEAD,POST,PUT,OPTIONS
561
+ Access-Control-Allow-Origin:
562
+ - "*"
563
+ Access-Control-Expose-Headers:
564
+ - Etag
565
+ Access-Control-Max-Age:
566
+ - '1728000'
567
+ Cache-Control:
568
+ - max-age=0
569
+ Content-Type:
570
+ - application/vnd.contentful.management.v1+json
571
+ Date:
572
+ - Fri, 22 Jul 2016 13:22:29 GMT
573
+ Etag:
574
+ - '"ffbc5ff86be7a2ed519e63e22d5ef58d"'
575
+ Location:
576
+ - https://api.contentful.com/spaces/896fh6408nuq/api_keys/236wfGh3o47kwhbs4aV8PD
577
+ Server:
578
+ - Contentful
579
+ Status:
580
+ - 201 Created
581
+ Strict-Transport-Security:
582
+ - max-age=15768000
583
+ X-Content-Type-Options:
584
+ - nosniff
585
+ X-Contentful-Request-Id:
586
+ - c7defdcc63590c06a7ff6e52926cfbaa
587
+ Content-Length:
588
+ - '954'
589
+ Connection:
590
+ - Close
591
+ Set-Cookie:
592
+ - incap_ses_297_673446=v2MqCPjOl1dpKKXJMCgfBBUeklcAAAAAZtVDX99oRF5kPIdHtBwtxQ==;
593
+ path=/; Domain=.contentful.com
594
+ - nlbi_673446=5fKkMrAlW1vBO1xM6lKYhQAAAABzpYAVt3+F2cxVgoGOHpCR; path=/; Domain=.contentful.com
595
+ - visid_incap_673446=VFASYVJtTo+N/gsXSype/RUeklcAAAAAQUIPAAAAAADAubSH7wq5nACs7dgILTng;
596
+ expires=Sat, 22 Jul 2017 06:56:22 GMT; path=/; Domain=.contentful.com
597
+ X-Iinfo:
598
+ - 1-104395837-104395856 NNNN CT(162 161 0) RT(1469193748338 102) q(0 0 3 -1)
599
+ r(9 9) U5
600
+ X-Cdn:
601
+ - Incapsula
602
+ body:
603
+ encoding: UTF-8
604
+ string: |+
605
+ {
606
+ "name":"Bootstrap Token",
607
+ "description":"Created with 'contentful_bootstrap.rb v3.2.0'",
608
+ "accessToken":"1161d609ce0376ba96af689343d462d7c015ccbadf9aa399054ee395433e17b1",
609
+ "policies":[
610
+ {
611
+ "effect":"allow",
612
+ "actions":"all"
613
+ }
614
+ ],
615
+ "sys":{
616
+ "type":"ApiKey",
617
+ "id":"236wfGh3o47kwhbs4aV8PD",
618
+ "version":0,
619
+ "space":{
620
+ "sys":{
621
+ "type":"Link",
622
+ "linkType":"Space",
623
+ "id":"896fh6408nuq"
624
+ }
625
+ },
626
+ "createdBy":{
627
+ "sys":{
628
+ "type":"Link",
629
+ "linkType":"User",
630
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
631
+ }
632
+ },
633
+ "createdAt":"2016-07-22T13:22:29Z",
634
+ "updatedBy":{
635
+ "sys":{
636
+ "type":"Link",
637
+ "linkType":"User",
638
+ "id":"4SejVrWT96dvL9IV4Nb7sQ"
639
+ }
640
+ },
641
+ "updatedAt":"2016-07-22T13:22:29Z"
642
+ },
643
+ "preview_api_key":{
644
+ "sys":{
645
+ "type":"Link",
646
+ "linkType":"PreviewApiKey",
647
+ "id":"237vBsH3ci7ak92brc5Vnb"
648
+ }
649
+ }
650
+ }
651
+
652
+ http_version:
653
+ recorded_at: Fri, 22 Jul 2016 13:22:29 GMT
654
+ recorded_with: VCR 2.9.3