contentful-management 0.7.3 → 0.8.0
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 +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +2 -0
- data/Guardfile +70 -0
- data/README.md +21 -2
- data/lib/contentful/management/client.rb +13 -9
- data/lib/contentful/management/content_type.rb +9 -3
- data/lib/contentful/management/dynamic_entry.rb +2 -2
- data/lib/contentful/management/entry.rb +19 -0
- data/lib/contentful/management/resource/field_aware.rb +45 -0
- data/lib/contentful/management/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/content_type/issue_79.yml +378 -0
- data/spec/fixtures/vcr_cassettes/entry/issue_61_1.yml +617 -0
- data/spec/fixtures/vcr_cassettes/entry/issue_61_2.yml +613 -0
- data/spec/fixtures/vcr_cassettes/entry/issue_61_3.yml +606 -0
- data/spec/fixtures/vcr_cassettes/entry/issue_61_4.yml +598 -0
- data/spec/fixtures/vcr_cassettes/entry/issue_61_5.yml +592 -0
- data/spec/fixtures/vcr_cassettes/entry/issue_61_6.yml +589 -0
- data/spec/fixtures/vcr_cassettes/entry/issue_61_7.yml +711 -0
- data/spec/fixtures/vcr_cassettes/entry/issue_61_8.yml +711 -0
- data/spec/fixtures/vcr_cassettes/entry/issue_61_spaces.yml +349 -0
- data/spec/fixtures/vcr_cassettes/entry/issue_73.yml +387 -0
- data/spec/lib/contentful/management/content_type_spec.rb +24 -0
- data/spec/lib/contentful/management/entry_spec.rb +223 -0
- metadata +27 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42f0a71eab4ad41c748aebb12abdcf07b5a28b49
|
4
|
+
data.tar.gz: e8c7b508d8dfd513d14ea65e9ff41cb0d6764a2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afe225415231cfe9df74f92b9b8489379b273d0ed88d5e263d6cb5bb28a842c237f81cb39f92b9ccfbcc43de5f566db1c74a3cb37c5c90240001278d5f2f7bcf
|
7
|
+
data.tar.gz: 91405326650913dd79f0fd85485c67503bedbbb8c16fd13a108b8395d26073cf5bb14de90a1d374735de3894dab0b8807c2f9b4fef98b28b43ff2f99bdd1ece3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## Master
|
4
4
|
|
5
|
+
## 0.8.0
|
6
|
+
### Added
|
7
|
+
* Added `:dynamic_entries` parameter on Client initialization
|
8
|
+
* Added `FieldAware` for Entries that don't have complete fields
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
* Fixed `nil` fields on Content Types no longer sent to API [#79](https://github.com/contentful/contentful-management.rb/issues/79)
|
12
|
+
|
5
13
|
## 0.7.3
|
6
14
|
### Fixed
|
7
15
|
* Field names are no longer dependent on being present on `default_locale` [#70](https://github.com/contentful/contentful-management.rb/issues/70)
|
data/Gemfile
CHANGED
data/Guardfile
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
## Uncomment and set this to only include directories you want to watch
|
5
|
+
# directories %w(app lib config test spec features) \
|
6
|
+
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
+
|
8
|
+
## Note: if you are using the `directories` clause above and you are not
|
9
|
+
## watching the project directory ('.'), then you will want to move
|
10
|
+
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
+
#
|
12
|
+
# $ mkdir config
|
13
|
+
# $ mv Guardfile config/
|
14
|
+
# $ ln -s config/Guardfile .
|
15
|
+
#
|
16
|
+
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
+
|
18
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
19
|
+
# rspec may be run, below are examples of the most common uses.
|
20
|
+
# * bundler: 'bundle exec rspec'
|
21
|
+
# * bundler binstubs: 'bin/rspec'
|
22
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
23
|
+
# installed the spring binstubs per the docs)
|
24
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
25
|
+
# * 'just' rspec: 'rspec'
|
26
|
+
|
27
|
+
guard :rspec, cmd: "bundle exec rspec --format documentation" do
|
28
|
+
require "guard/rspec/dsl"
|
29
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
30
|
+
|
31
|
+
# Feel free to open issues for suggestions and improvements
|
32
|
+
|
33
|
+
# RSpec files
|
34
|
+
rspec = dsl.rspec
|
35
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
36
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
37
|
+
watch(rspec.spec_files)
|
38
|
+
|
39
|
+
# Ruby files
|
40
|
+
ruby = dsl.ruby
|
41
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
42
|
+
|
43
|
+
# Rails files
|
44
|
+
rails = dsl.rails(view_extensions: %w(erb haml slim))
|
45
|
+
dsl.watch_spec_files_for(rails.app_files)
|
46
|
+
dsl.watch_spec_files_for(rails.views)
|
47
|
+
|
48
|
+
watch(rails.controllers) do |m|
|
49
|
+
[
|
50
|
+
rspec.spec.("routing/#{m[1]}_routing"),
|
51
|
+
rspec.spec.("controllers/#{m[1]}_controller"),
|
52
|
+
rspec.spec.("acceptance/#{m[1]}")
|
53
|
+
]
|
54
|
+
end
|
55
|
+
|
56
|
+
# Rails config changes
|
57
|
+
watch(rails.spec_helper) { rspec.spec_dir }
|
58
|
+
watch(rails.routes) { "#{rspec.spec_dir}/routing" }
|
59
|
+
watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
|
60
|
+
|
61
|
+
# Capybara features specs
|
62
|
+
watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
|
63
|
+
watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
|
64
|
+
|
65
|
+
# Turnip features and steps
|
66
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
67
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
68
|
+
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
|
69
|
+
end
|
70
|
+
end
|
data/README.md
CHANGED
@@ -407,6 +407,12 @@ Checking if the entry is published:
|
|
407
407
|
my_entry.published?
|
408
408
|
```
|
409
409
|
|
410
|
+
> Entries created with *empty fields*, will not return those fields in the response. Therefore, Entries that don't have Cache enabled, will need to
|
411
|
+
> make an extra request to fetch the Content Type and fill the missing fields.
|
412
|
+
> To allow for Content Type Caching:
|
413
|
+
> * Enable [Content Type Cache](#content-type-cache) at Client Instantiation time
|
414
|
+
> * Query Entries through `space.entries.find` instead of `Entry.find(space_id, entry_id)`
|
415
|
+
|
410
416
|
### Webhooks
|
411
417
|
|
412
418
|
Retrieving all webhooks from the space:
|
@@ -526,7 +532,7 @@ content_type.fields.create(id: 'entry', validations: [validation_link_field])
|
|
526
532
|
blog_space.entries.all(limit: 5).next_page
|
527
533
|
blog_space.assets.all(limit: 5).next_page
|
528
534
|
blog_space.entries.all(limit: 5).next_page
|
529
|
-
```
|
535
|
+
```
|
530
536
|
|
531
537
|
## Logging
|
532
538
|
|
@@ -536,6 +542,7 @@ Logging is disabled by default, it can be enabled by setting a logger instance a
|
|
536
542
|
client = Contentful::Management::Client.new('access_token', logger: logger_instance, log_level: Logger::DEBUG)
|
537
543
|
```
|
538
544
|
|
545
|
+
|
539
546
|
Example loggers:
|
540
547
|
|
541
548
|
```ruby
|
@@ -543,16 +550,28 @@ Rails.logger
|
|
543
550
|
Logger.new('logfile.log')
|
544
551
|
```
|
545
552
|
|
553
|
+
|
546
554
|
The default severity is set to INFO and logs only the request attributes (headers, parameters and url). Setting it to DEBUG will also log the raw JSON response.
|
547
555
|
|
548
556
|
## Raise Errors
|
549
557
|
|
550
|
-
If
|
558
|
+
If `:raise_errors` is set to true, an Exception will be raised in case of an error. The default is false, in this case a ```Contentful::Management::Error``` object will be returned.
|
551
559
|
|
552
560
|
```ruby
|
553
561
|
client = Contentful::Management::Client.new('access_token', raise_errors: true)
|
554
562
|
```
|
555
563
|
|
564
|
+
## Content Type Cache
|
565
|
+
|
566
|
+
This allows for fetching Content Types for your Space at Client instantiation time, which prevents extra requests per Entry.
|
567
|
+
To enable this, in your Client instantiation do:
|
568
|
+
|
569
|
+
```ruby
|
570
|
+
Contentful::Management::Client.new(token, dynamic_entries: ['my_space_id'])
|
571
|
+
```
|
572
|
+
|
573
|
+
You can enable the Cache for as many Spaces as you want.
|
574
|
+
|
556
575
|
## Contributing
|
557
576
|
|
558
577
|
1. Fork it ( https://github.com/[my-github-username]/contentful-management/fork )
|
@@ -26,7 +26,8 @@ module Contentful
|
|
26
26
|
gzip_encoded: false,
|
27
27
|
logger: false,
|
28
28
|
log_level: Logger::INFO,
|
29
|
-
raise_errors: false
|
29
|
+
raise_errors: false,
|
30
|
+
dynamic_entries: []
|
30
31
|
}
|
31
32
|
|
32
33
|
def initialize(access_token = nil, configuration = {})
|
@@ -35,6 +36,7 @@ module Contentful
|
|
35
36
|
@access_token = access_token
|
36
37
|
@dynamic_entry_cache = {}
|
37
38
|
Thread.current[:client] = self
|
39
|
+
update_all_dynamic_entry_cache!
|
38
40
|
end
|
39
41
|
|
40
42
|
def setup_logger
|
@@ -42,6 +44,13 @@ module Contentful
|
|
42
44
|
logger.level = configuration[:log_level] if logger
|
43
45
|
end
|
44
46
|
|
47
|
+
def update_all_dynamic_entry_cache!
|
48
|
+
if !configuration[:dynamic_entries].empty?
|
49
|
+
spaces = configuration[:dynamic_entries].map { |space_id| ::Contentful::Management::Space.find(space_id) }
|
50
|
+
update_dynamic_entry_cache_for_spaces!(spaces)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
45
54
|
def update_dynamic_entry_cache_for_spaces!(spaces)
|
46
55
|
spaces.each do |space|
|
47
56
|
update_dynamic_entry_cache_for_space!(space)
|
@@ -55,14 +64,9 @@ module Contentful
|
|
55
64
|
end
|
56
65
|
|
57
66
|
def update_dynamic_entry_cache!(content_types)
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
ct.id.to_sym,
|
62
|
-
DynamicEntry.create(ct)
|
63
|
-
]
|
64
|
-
end
|
65
|
-
]
|
67
|
+
content_types.each do |ct|
|
68
|
+
@dynamic_entry_cache[ct.id.to_sym] = DynamicEntry.create(ct)
|
69
|
+
end
|
66
70
|
end
|
67
71
|
|
68
72
|
def api_version
|
@@ -106,11 +106,15 @@ module Contentful
|
|
106
106
|
# Returns a Contentful::Management::ContentType.
|
107
107
|
def self.create(space_id, attributes)
|
108
108
|
fields = fields_to_nested_properties_hash(attributes[:fields] || [])
|
109
|
+
|
110
|
+
params = attributes.clone
|
111
|
+
params[:fields] = fields
|
112
|
+
params.delete(:id)
|
113
|
+
params = params.delete_if { |k, v| v.nil? }
|
114
|
+
|
109
115
|
request = Request.new(
|
110
116
|
"/#{ space_id }/content_types/#{ attributes[:id]}",
|
111
|
-
|
112
|
-
description: attributes[:description],
|
113
|
-
fields: fields
|
117
|
+
params
|
114
118
|
)
|
115
119
|
response = attributes[:id].nil? ? request.post : request.put
|
116
120
|
result = ResourceBuilder.new(response, {}, {}).run
|
@@ -135,6 +139,8 @@ module Contentful
|
|
135
139
|
parameters.merge!(name: (attributes[:name] || name))
|
136
140
|
parameters.merge!(description: (attributes[:description] || description))
|
137
141
|
parameters.merge!(fields: self.class.fields_to_nested_properties_hash(attributes[:fields] || fields))
|
142
|
+
|
143
|
+
parameters = parameters.delete_if { |k, v| v.nil? }
|
138
144
|
request = Request.new(
|
139
145
|
"/#{ space.id }/content_types/#{ id }",
|
140
146
|
parameters,
|
@@ -38,14 +38,14 @@ module Contentful
|
|
38
38
|
end
|
39
39
|
define_method "#{ accessor_name }=" do |value|
|
40
40
|
if localized_or_default_locale(field, locale)
|
41
|
-
@fields[locale]
|
41
|
+
@fields[locale] ||= {}
|
42
42
|
@fields[locale][field.id.to_sym] = value
|
43
43
|
end
|
44
44
|
end
|
45
45
|
define_method "#{ accessor_name }_with_locales=" do |values|
|
46
46
|
values.each do |locale, value|
|
47
47
|
if localized_or_default_locale(field, locale)
|
48
|
-
@fields[locale]
|
48
|
+
@fields[locale] ||= {}
|
49
49
|
@fields[locale][field.id.to_sym] = value
|
50
50
|
end
|
51
51
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative 'resource'
|
2
2
|
require_relative 'resource/entry_fields'
|
3
3
|
require_relative 'resource/fields'
|
4
|
+
require_relative 'resource/field_aware'
|
4
5
|
|
5
6
|
module Contentful
|
6
7
|
module Management
|
@@ -241,6 +242,24 @@ module Contentful
|
|
241
242
|
end
|
242
243
|
end
|
243
244
|
|
245
|
+
def method_missing(name, *args, &block)
|
246
|
+
if content_type.nil?
|
247
|
+
fetch_content_type
|
248
|
+
|
249
|
+
Contentful::Management::Resource::FieldAware.create_fields_for_content_type(self)
|
250
|
+
|
251
|
+
if self.respond_to? name
|
252
|
+
return self.send(name, *args, &block)
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
raise NameError.new("undefined local variable or method `#{name}' for #{self.class}:#{self.sys[:id]}", name)
|
257
|
+
end
|
258
|
+
|
259
|
+
def fetch_content_type
|
260
|
+
@content_type ||= ::Contentful::Management::ContentType.find(space.id, sys[:contentType].id)
|
261
|
+
end
|
262
|
+
|
244
263
|
def self.hash_with_link_object(type, attribute)
|
245
264
|
{sys: {type: 'Link', linkType: type, id: attribute.id}}
|
246
265
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Contentful
|
2
|
+
module Management
|
3
|
+
module Resource
|
4
|
+
module FieldAware
|
5
|
+
def self.create_fields_for_content_type(entry)
|
6
|
+
entry.instance_eval do
|
7
|
+
content_type.fields.each do |field|
|
8
|
+
localized_or_default_locale = Contentful::Management::Resource::FieldAware.localized_or_default_locale(
|
9
|
+
field,
|
10
|
+
default_locale,
|
11
|
+
locale
|
12
|
+
)
|
13
|
+
|
14
|
+
accessor_name = Support.snakify(field.id)
|
15
|
+
define_singleton_method accessor_name do
|
16
|
+
fields[field.id.to_sym]
|
17
|
+
end
|
18
|
+
define_singleton_method "#{ accessor_name }_with_locales" do
|
19
|
+
fields_for_query[field.id.to_sym]
|
20
|
+
end
|
21
|
+
define_singleton_method "#{ accessor_name }=" do |value|
|
22
|
+
if localized_or_default_locale
|
23
|
+
@fields[locale] ||= {}
|
24
|
+
@fields[locale][field.id.to_sym] = value
|
25
|
+
end
|
26
|
+
end
|
27
|
+
define_singleton_method "#{ accessor_name }_with_locales=" do |values|
|
28
|
+
values.each do |locale, value|
|
29
|
+
if localized_or_default_locale
|
30
|
+
@fields[locale] ||= {}
|
31
|
+
@fields[locale][field.id.to_sym] = value
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.localized_or_default_locale(field, default_locale, locale)
|
40
|
+
field.localized || default_locale == locale
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,378 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.contentful.com/spaces/ngtgiva4wofg
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- RubyContentfulManagementGem/0.7.3
|
12
|
+
Authorization:
|
13
|
+
- Bearer <ACCESS_TOKEN>
|
14
|
+
Content-Type:
|
15
|
+
- application/vnd.contentful.management.v1+json
|
16
|
+
Content-Length:
|
17
|
+
- '0'
|
18
|
+
Connection:
|
19
|
+
- close
|
20
|
+
Host:
|
21
|
+
- api.contentful.com
|
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
|
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
|
+
Content-Type:
|
42
|
+
- application/vnd.contentful.management.v1+json
|
43
|
+
Date:
|
44
|
+
- Thu, 21 Jan 2016 15:38:00 GMT
|
45
|
+
Etag:
|
46
|
+
- '"5c8c8e659322afec0159b9f92c1cc3a8"'
|
47
|
+
Server:
|
48
|
+
- nginx
|
49
|
+
Status:
|
50
|
+
- 200 OK
|
51
|
+
Strict-Transport-Security:
|
52
|
+
- max-age=15768000
|
53
|
+
X-Content-Type-Options:
|
54
|
+
- nosniff
|
55
|
+
X-Contentful-Request-Id:
|
56
|
+
- 0b5-173791309
|
57
|
+
Content-Length:
|
58
|
+
- '462'
|
59
|
+
Connection:
|
60
|
+
- Close
|
61
|
+
body:
|
62
|
+
encoding: UTF-8
|
63
|
+
string: |+
|
64
|
+
{
|
65
|
+
"sys":{
|
66
|
+
"type":"Space",
|
67
|
+
"id":"ngtgiva4wofg",
|
68
|
+
"version":1,
|
69
|
+
"createdBy":{
|
70
|
+
"sys":{
|
71
|
+
"type":"Link",
|
72
|
+
"linkType":"User",
|
73
|
+
"id":"4SejVrWT96dvL9IV4Nb7sQ"
|
74
|
+
}
|
75
|
+
},
|
76
|
+
"createdAt":"2016-01-21T15:22:59Z",
|
77
|
+
"updatedBy":{
|
78
|
+
"sys":{
|
79
|
+
"type":"Link",
|
80
|
+
"linkType":"User",
|
81
|
+
"id":"4SejVrWT96dvL9IV4Nb7sQ"
|
82
|
+
}
|
83
|
+
},
|
84
|
+
"updatedAt":"2016-01-21T15:22:59Z"
|
85
|
+
},
|
86
|
+
"name":"management.rb - #79"
|
87
|
+
}
|
88
|
+
|
89
|
+
http_version:
|
90
|
+
recorded_at: Thu, 21 Jan 2016 15:38:00 GMT
|
91
|
+
- request:
|
92
|
+
method: get
|
93
|
+
uri: https://api.contentful.com/spaces/ngtgiva4wofg/content_types
|
94
|
+
body:
|
95
|
+
encoding: US-ASCII
|
96
|
+
string: ''
|
97
|
+
headers:
|
98
|
+
User-Agent:
|
99
|
+
- RubyContentfulManagementGem/0.7.3
|
100
|
+
Authorization:
|
101
|
+
- Bearer <ACCESS_TOKEN>
|
102
|
+
Content-Type:
|
103
|
+
- application/vnd.contentful.management.v1+json
|
104
|
+
Content-Length:
|
105
|
+
- '0'
|
106
|
+
Connection:
|
107
|
+
- close
|
108
|
+
Host:
|
109
|
+
- api.contentful.com
|
110
|
+
response:
|
111
|
+
status:
|
112
|
+
code: 200
|
113
|
+
message: OK
|
114
|
+
headers:
|
115
|
+
Access-Control-Allow-Headers:
|
116
|
+
- 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
|
117
|
+
Access-Control-Allow-Methods:
|
118
|
+
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
119
|
+
Access-Control-Allow-Origin:
|
120
|
+
- "*"
|
121
|
+
Access-Control-Expose-Headers:
|
122
|
+
- Etag
|
123
|
+
Access-Control-Max-Age:
|
124
|
+
- '1728000'
|
125
|
+
Cf-Space-Id:
|
126
|
+
- ngtgiva4wofg
|
127
|
+
Content-Type:
|
128
|
+
- application/vnd.contentful.management.v1+json
|
129
|
+
Date:
|
130
|
+
- Thu, 21 Jan 2016 15:38:01 GMT
|
131
|
+
Etag:
|
132
|
+
- '"29f2c21be26360c424f617d8592cf6f9"'
|
133
|
+
Server:
|
134
|
+
- nginx
|
135
|
+
Strict-Transport-Security:
|
136
|
+
- max-age=15768000
|
137
|
+
X-Content-Type-Options:
|
138
|
+
- nosniff
|
139
|
+
X-Contentful-Request-Id:
|
140
|
+
- content-api:6dmm0Mr9eMQM2wCoUSQG8C
|
141
|
+
X-Powered-By:
|
142
|
+
- Express
|
143
|
+
Content-Length:
|
144
|
+
- '97'
|
145
|
+
Connection:
|
146
|
+
- Close
|
147
|
+
body:
|
148
|
+
encoding: UTF-8
|
149
|
+
string: |
|
150
|
+
{
|
151
|
+
"sys": {
|
152
|
+
"type": "Array"
|
153
|
+
},
|
154
|
+
"total": 0,
|
155
|
+
"skip": 0,
|
156
|
+
"limit": 100,
|
157
|
+
"items": []
|
158
|
+
}
|
159
|
+
http_version:
|
160
|
+
recorded_at: Thu, 21 Jan 2016 15:38:01 GMT
|
161
|
+
- request:
|
162
|
+
method: put
|
163
|
+
uri: https://api.contentful.com/spaces/ngtgiva4wofg/content_types/isssue_79_ct
|
164
|
+
body:
|
165
|
+
encoding: UTF-8
|
166
|
+
string: '{"displayField":"name","name":"Issue 79 CT","description":"","fields":[{"id":"name","name":"name","type":"Symbol"}]}'
|
167
|
+
headers:
|
168
|
+
User-Agent:
|
169
|
+
- RubyContentfulManagementGem/0.7.3
|
170
|
+
Authorization:
|
171
|
+
- Bearer <ACCESS_TOKEN>
|
172
|
+
Content-Type:
|
173
|
+
- application/vnd.contentful.management.v1+json
|
174
|
+
Connection:
|
175
|
+
- close
|
176
|
+
Host:
|
177
|
+
- api.contentful.com
|
178
|
+
response:
|
179
|
+
status:
|
180
|
+
code: 201
|
181
|
+
message: Created
|
182
|
+
headers:
|
183
|
+
Access-Control-Allow-Headers:
|
184
|
+
- 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
|
185
|
+
Access-Control-Allow-Methods:
|
186
|
+
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
187
|
+
Access-Control-Allow-Origin:
|
188
|
+
- "*"
|
189
|
+
Access-Control-Expose-Headers:
|
190
|
+
- Etag
|
191
|
+
Access-Control-Max-Age:
|
192
|
+
- '1728000'
|
193
|
+
Cf-Space-Id:
|
194
|
+
- ngtgiva4wofg
|
195
|
+
Content-Type:
|
196
|
+
- application/vnd.contentful.management.v1+json
|
197
|
+
Date:
|
198
|
+
- Thu, 21 Jan 2016 15:38:02 GMT
|
199
|
+
Etag:
|
200
|
+
- '"d97927d98e5d9d8decf7a1974556757b"'
|
201
|
+
Server:
|
202
|
+
- nginx
|
203
|
+
Strict-Transport-Security:
|
204
|
+
- max-age=15768000
|
205
|
+
X-Content-Type-Options:
|
206
|
+
- nosniff
|
207
|
+
X-Contentful-Request-Id:
|
208
|
+
- content-api:5Y1Ml9fZDimWygA8I4oWw
|
209
|
+
X-Powered-By:
|
210
|
+
- Express
|
211
|
+
Content-Length:
|
212
|
+
- '805'
|
213
|
+
Connection:
|
214
|
+
- Close
|
215
|
+
body:
|
216
|
+
encoding: UTF-8
|
217
|
+
string: |
|
218
|
+
{
|
219
|
+
"displayField": "name",
|
220
|
+
"name": "Issue 79 CT",
|
221
|
+
"description": "",
|
222
|
+
"fields": [
|
223
|
+
{
|
224
|
+
"id": "name",
|
225
|
+
"name": "name",
|
226
|
+
"type": "Symbol",
|
227
|
+
"localized": false,
|
228
|
+
"validations": []
|
229
|
+
}
|
230
|
+
],
|
231
|
+
"sys": {
|
232
|
+
"id": "isssue_79_ct",
|
233
|
+
"type": "ContentType",
|
234
|
+
"version": 1,
|
235
|
+
"createdAt": "2016-01-21T15:38:02.376Z",
|
236
|
+
"createdBy": {
|
237
|
+
"sys": {
|
238
|
+
"type": "Link",
|
239
|
+
"linkType": "User",
|
240
|
+
"id": "4SejVrWT96dvL9IV4Nb7sQ"
|
241
|
+
}
|
242
|
+
},
|
243
|
+
"space": {
|
244
|
+
"sys": {
|
245
|
+
"type": "Link",
|
246
|
+
"linkType": "Space",
|
247
|
+
"id": "ngtgiva4wofg"
|
248
|
+
}
|
249
|
+
},
|
250
|
+
"updatedAt": "2016-01-21T15:38:02.376Z",
|
251
|
+
"updatedBy": {
|
252
|
+
"sys": {
|
253
|
+
"type": "Link",
|
254
|
+
"linkType": "User",
|
255
|
+
"id": "4SejVrWT96dvL9IV4Nb7sQ"
|
256
|
+
}
|
257
|
+
}
|
258
|
+
}
|
259
|
+
}
|
260
|
+
http_version:
|
261
|
+
recorded_at: Thu, 21 Jan 2016 15:38:02 GMT
|
262
|
+
- request:
|
263
|
+
method: put
|
264
|
+
uri: https://api.contentful.com/spaces/ngtgiva4wofg/content_types/isssue_79_ct/published
|
265
|
+
body:
|
266
|
+
encoding: US-ASCII
|
267
|
+
string: ''
|
268
|
+
headers:
|
269
|
+
User-Agent:
|
270
|
+
- RubyContentfulManagementGem/0.7.3
|
271
|
+
Authorization:
|
272
|
+
- Bearer <ACCESS_TOKEN>
|
273
|
+
Content-Type:
|
274
|
+
- application/vnd.contentful.management.v1+json
|
275
|
+
X-Contentful-Version:
|
276
|
+
- '1'
|
277
|
+
Content-Length:
|
278
|
+
- '0'
|
279
|
+
Connection:
|
280
|
+
- close
|
281
|
+
Host:
|
282
|
+
- api.contentful.com
|
283
|
+
response:
|
284
|
+
status:
|
285
|
+
code: 200
|
286
|
+
message: OK
|
287
|
+
headers:
|
288
|
+
Access-Control-Allow-Headers:
|
289
|
+
- 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
|
290
|
+
Access-Control-Allow-Methods:
|
291
|
+
- DELETE,GET,HEAD,POST,PUT,OPTIONS
|
292
|
+
Access-Control-Allow-Origin:
|
293
|
+
- "*"
|
294
|
+
Access-Control-Expose-Headers:
|
295
|
+
- Etag
|
296
|
+
Access-Control-Max-Age:
|
297
|
+
- '1728000'
|
298
|
+
Cf-Space-Id:
|
299
|
+
- ngtgiva4wofg
|
300
|
+
Content-Type:
|
301
|
+
- application/vnd.contentful.management.v1+json
|
302
|
+
Date:
|
303
|
+
- Thu, 21 Jan 2016 15:38:03 GMT
|
304
|
+
Etag:
|
305
|
+
- '"a73956096b1011b36b6fb6a21f2ae475"'
|
306
|
+
Server:
|
307
|
+
- nginx
|
308
|
+
Strict-Transport-Security:
|
309
|
+
- max-age=15768000
|
310
|
+
X-Content-Type-Options:
|
311
|
+
- nosniff
|
312
|
+
X-Contentful-Request-Id:
|
313
|
+
- content-api:4YtOjKQykgAYYOKusEyeeA
|
314
|
+
X-Powered-By:
|
315
|
+
- Express
|
316
|
+
Content-Length:
|
317
|
+
- '1100'
|
318
|
+
Connection:
|
319
|
+
- Close
|
320
|
+
body:
|
321
|
+
encoding: UTF-8
|
322
|
+
string: |
|
323
|
+
{
|
324
|
+
"displayField": "name",
|
325
|
+
"name": "Issue 79 CT",
|
326
|
+
"description": "",
|
327
|
+
"fields": [
|
328
|
+
{
|
329
|
+
"id": "name",
|
330
|
+
"name": "name",
|
331
|
+
"type": "Symbol",
|
332
|
+
"localized": false,
|
333
|
+
"validations": []
|
334
|
+
}
|
335
|
+
],
|
336
|
+
"sys": {
|
337
|
+
"id": "isssue_79_ct",
|
338
|
+
"type": "ContentType",
|
339
|
+
"createdAt": "2016-01-21T15:38:02.376Z",
|
340
|
+
"createdBy": {
|
341
|
+
"sys": {
|
342
|
+
"type": "Link",
|
343
|
+
"linkType": "User",
|
344
|
+
"id": "4SejVrWT96dvL9IV4Nb7sQ"
|
345
|
+
}
|
346
|
+
},
|
347
|
+
"space": {
|
348
|
+
"sys": {
|
349
|
+
"type": "Link",
|
350
|
+
"linkType": "Space",
|
351
|
+
"id": "ngtgiva4wofg"
|
352
|
+
}
|
353
|
+
},
|
354
|
+
"version": 2,
|
355
|
+
"updatedAt": "2016-01-21T15:38:03.215Z",
|
356
|
+
"updatedBy": {
|
357
|
+
"sys": {
|
358
|
+
"type": "Link",
|
359
|
+
"linkType": "User",
|
360
|
+
"id": "4SejVrWT96dvL9IV4Nb7sQ"
|
361
|
+
}
|
362
|
+
},
|
363
|
+
"firstPublishedAt": "2016-01-21T15:38:03.215Z",
|
364
|
+
"publishedCounter": 1,
|
365
|
+
"publishedAt": "2016-01-21T15:38:03.215Z",
|
366
|
+
"publishedBy": {
|
367
|
+
"sys": {
|
368
|
+
"type": "Link",
|
369
|
+
"linkType": "User",
|
370
|
+
"id": "4SejVrWT96dvL9IV4Nb7sQ"
|
371
|
+
}
|
372
|
+
},
|
373
|
+
"publishedVersion": 1
|
374
|
+
}
|
375
|
+
}
|
376
|
+
http_version:
|
377
|
+
recorded_at: Thu, 21 Jan 2016 15:38:04 GMT
|
378
|
+
recorded_with: VCR 2.9.3
|