contentful-management 1.0.1 → 1.1.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/CHANGELOG.md +10 -0
- data/Gemfile +1 -0
- data/README.md +245 -151
- data/lib/contentful/management/client.rb +20 -0
- data/lib/contentful/management/client_association_all_published_method_factory.rb +4 -0
- data/lib/contentful/management/client_content_type_methods_factory.rb +4 -0
- data/lib/contentful/management/client_editor_interface_methods_factory.rb +35 -0
- data/lib/contentful/management/client_role_methods_factory.rb +15 -0
- data/lib/contentful/management/client_webhook_methods_factory.rb +1 -1
- data/lib/contentful/management/content_type.rb +12 -0
- data/lib/contentful/management/content_type_editor_interface_methods_factory.rb +22 -0
- data/lib/contentful/management/editor_interface.rb +85 -0
- data/lib/contentful/management/field.rb +1 -0
- data/lib/contentful/management/resource/all_published.rb +1 -0
- data/lib/contentful/management/resource/refresher.rb +7 -3
- data/lib/contentful/management/resource_builder.rb +5 -1
- data/lib/contentful/management/role.rb +33 -0
- data/lib/contentful/management/space.rb +28 -0
- data/lib/contentful/management/space_association_all_published_method_factory.rb +1 -0
- data/lib/contentful/management/space_editor_interface_methods_factory.rb +21 -0
- data/lib/contentful/management/space_role_methods_factory.rb +15 -0
- data/lib/contentful/management/version.rb +1 -1
- data/lib/contentful/management/webhook.rb +4 -1
- data/spec/fixtures/vcr_cassettes/content_type/omitted_field.yml +640 -0
- data/spec/fixtures/vcr_cassettes/editor_interfaces/default_for_space.yml +252 -0
- data/spec/fixtures/vcr_cassettes/editor_interfaces/update.yml +348 -0
- data/spec/fixtures/vcr_cassettes/roles/all_for_space.yml +238 -0
- data/spec/fixtures/vcr_cassettes/roles/create_for_space.yml +143 -0
- data/spec/fixtures/vcr_cassettes/roles/destroy.yml +430 -0
- data/spec/fixtures/vcr_cassettes/roles/find.yml +155 -0
- data/spec/fixtures/vcr_cassettes/roles/find_for_space_not_found.yml +82 -0
- data/spec/fixtures/vcr_cassettes/roles/update.yml +459 -0
- data/spec/fixtures/vcr_cassettes/webhook/create_with_name_and_headers.yml +119 -0
- data/spec/fixtures/vcr_cassettes/webhook/topics.yml +117 -0
- data/spec/lib/contentful/management/asset_spec.rb +4 -0
- data/spec/lib/contentful/management/content_type_spec.rb +36 -0
- data/spec/lib/contentful/management/editor_interface_spec.rb +57 -0
- data/spec/lib/contentful/management/entry_spec.rb +5 -0
- data/spec/lib/contentful/management/role_spec.rb +125 -0
- data/spec/lib/contentful/management/webhook_spec.rb +37 -0
- metadata +35 -2
@@ -59,6 +59,43 @@ module Contentful
|
|
59
59
|
expect(webhook).to be_kind_of Contentful::Management::Error
|
60
60
|
end
|
61
61
|
end
|
62
|
+
it 'can create webhooks with name and custom headers' do
|
63
|
+
vcr('webhook/create_with_name_and_headers') do
|
64
|
+
webhook = subject.create(
|
65
|
+
'zjvxmotjud5s',
|
66
|
+
name: 'some_webhook',
|
67
|
+
id: 'some_id',
|
68
|
+
url: 'https://www.example2.com',
|
69
|
+
headers: [
|
70
|
+
{
|
71
|
+
key: 'MyHeader',
|
72
|
+
value: 'foobar'
|
73
|
+
}
|
74
|
+
]
|
75
|
+
)
|
76
|
+
|
77
|
+
expect(webhook.name).to eq('some_webhook')
|
78
|
+
expect(webhook.id).to eq('some_id')
|
79
|
+
expect(webhook.headers.first).to eq({'key' => 'MyHeader', 'value' => 'foobar'})
|
80
|
+
end
|
81
|
+
end
|
82
|
+
it 'can create webhooks with specific topics' do
|
83
|
+
vcr('webhook/topics') do
|
84
|
+
webhook = subject.create(
|
85
|
+
'zjvxmotjud5s',
|
86
|
+
name: 'test_topics',
|
87
|
+
url: 'https://www.example3.com',
|
88
|
+
topics: [
|
89
|
+
'Entry.save',
|
90
|
+
'Entry.publish',
|
91
|
+
'ContentType.*'
|
92
|
+
]
|
93
|
+
)
|
94
|
+
|
95
|
+
expect(webhook.topics.size).to eq 3
|
96
|
+
expect(webhook.topics).to eq ['Entry.save', 'Entry.publish', 'ContentType.*']
|
97
|
+
end
|
98
|
+
end
|
62
99
|
end
|
63
100
|
|
64
101
|
describe '#update' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful-management
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Protas
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: http
|
@@ -211,13 +211,17 @@ files:
|
|
211
211
|
- lib/contentful/management/client_association_all_published_method_factory.rb
|
212
212
|
- lib/contentful/management/client_association_methods_factory.rb
|
213
213
|
- lib/contentful/management/client_content_type_methods_factory.rb
|
214
|
+
- lib/contentful/management/client_editor_interface_methods_factory.rb
|
214
215
|
- lib/contentful/management/client_entry_methods_factory.rb
|
215
216
|
- lib/contentful/management/client_locale_methods_factory.rb
|
217
|
+
- lib/contentful/management/client_role_methods_factory.rb
|
216
218
|
- lib/contentful/management/client_space_methods_factory.rb
|
217
219
|
- lib/contentful/management/client_webhook_methods_factory.rb
|
218
220
|
- lib/contentful/management/content_type.rb
|
221
|
+
- lib/contentful/management/content_type_editor_interface_methods_factory.rb
|
219
222
|
- lib/contentful/management/content_type_entry_methods_factory.rb
|
220
223
|
- lib/contentful/management/dynamic_entry.rb
|
224
|
+
- lib/contentful/management/editor_interface.rb
|
221
225
|
- lib/contentful/management/entry.rb
|
222
226
|
- lib/contentful/management/error.rb
|
223
227
|
- lib/contentful/management/field.rb
|
@@ -241,14 +245,17 @@ files:
|
|
241
245
|
- lib/contentful/management/resource_builder.rb
|
242
246
|
- lib/contentful/management/resource_requester.rb
|
243
247
|
- lib/contentful/management/response.rb
|
248
|
+
- lib/contentful/management/role.rb
|
244
249
|
- lib/contentful/management/space.rb
|
245
250
|
- lib/contentful/management/space_api_key_methods_factory.rb
|
246
251
|
- lib/contentful/management/space_asset_methods_factory.rb
|
247
252
|
- lib/contentful/management/space_association_all_published_method_factory.rb
|
248
253
|
- lib/contentful/management/space_association_methods_factory.rb
|
249
254
|
- lib/contentful/management/space_content_type_methods_factory.rb
|
255
|
+
- lib/contentful/management/space_editor_interface_methods_factory.rb
|
250
256
|
- lib/contentful/management/space_entry_methods_factory.rb
|
251
257
|
- lib/contentful/management/space_locale_methods_factory.rb
|
258
|
+
- lib/contentful/management/space_role_methods_factory.rb
|
252
259
|
- lib/contentful/management/space_webhook_methods_factory.rb
|
253
260
|
- lib/contentful/management/support.rb
|
254
261
|
- lib/contentful/management/validation.rb
|
@@ -336,6 +343,7 @@ files:
|
|
336
343
|
- spec/fixtures/vcr_cassettes/content_type/find.yml
|
337
344
|
- spec/fixtures/vcr_cassettes/content_type/find_not_found.yml
|
338
345
|
- spec/fixtures/vcr_cassettes/content_type/issue_79.yml
|
346
|
+
- spec/fixtures/vcr_cassettes/content_type/omitted_field.yml
|
339
347
|
- spec/fixtures/vcr_cassettes/content_type/reload.yml
|
340
348
|
- spec/fixtures/vcr_cassettes/content_type/save_new.yml
|
341
349
|
- spec/fixtures/vcr_cassettes/content_type/save_updated.yml
|
@@ -358,6 +366,8 @@ files:
|
|
358
366
|
- spec/fixtures/vcr_cassettes/content_type/validation/regexp.yml
|
359
367
|
- spec/fixtures/vcr_cassettes/content_type/validation/size.yml
|
360
368
|
- spec/fixtures/vcr_cassettes/delete_request.yml
|
369
|
+
- spec/fixtures/vcr_cassettes/editor_interfaces/default_for_space.yml
|
370
|
+
- spec/fixtures/vcr_cassettes/editor_interfaces/update.yml
|
361
371
|
- spec/fixtures/vcr_cassettes/entry/all.yml
|
362
372
|
- spec/fixtures/vcr_cassettes/entry/all_public.yml
|
363
373
|
- spec/fixtures/vcr_cassettes/entry/archive.yml
|
@@ -443,6 +453,12 @@ files:
|
|
443
453
|
- spec/fixtures/vcr_cassettes/post_request.yml
|
444
454
|
- spec/fixtures/vcr_cassettes/proxy_request.yml
|
445
455
|
- spec/fixtures/vcr_cassettes/put_request.yml
|
456
|
+
- spec/fixtures/vcr_cassettes/roles/all_for_space.yml
|
457
|
+
- spec/fixtures/vcr_cassettes/roles/create_for_space.yml
|
458
|
+
- spec/fixtures/vcr_cassettes/roles/destroy.yml
|
459
|
+
- spec/fixtures/vcr_cassettes/roles/find.yml
|
460
|
+
- spec/fixtures/vcr_cassettes/roles/find_for_space_not_found.yml
|
461
|
+
- spec/fixtures/vcr_cassettes/roles/update.yml
|
446
462
|
- spec/fixtures/vcr_cassettes/space/all.yml
|
447
463
|
- spec/fixtures/vcr_cassettes/space/api_key/all.yml
|
448
464
|
- spec/fixtures/vcr_cassettes/space/api_key/create.yml
|
@@ -490,18 +506,22 @@ files:
|
|
490
506
|
- spec/fixtures/vcr_cassettes/space/webhook/find.yml
|
491
507
|
- spec/fixtures/vcr_cassettes/webhook/all.yml
|
492
508
|
- spec/fixtures/vcr_cassettes/webhook/create.yml
|
509
|
+
- spec/fixtures/vcr_cassettes/webhook/create_with_name_and_headers.yml
|
493
510
|
- spec/fixtures/vcr_cassettes/webhook/create_with_taken_url.yml
|
494
511
|
- spec/fixtures/vcr_cassettes/webhook/destroy.yml
|
495
512
|
- spec/fixtures/vcr_cassettes/webhook/find.yml
|
496
513
|
- spec/fixtures/vcr_cassettes/webhook/find_not_found.yml
|
514
|
+
- spec/fixtures/vcr_cassettes/webhook/topics.yml
|
497
515
|
- spec/fixtures/vcr_cassettes/webhook/update.yml
|
498
516
|
- spec/lib/contentful/management/api_key_spec.rb
|
499
517
|
- spec/lib/contentful/management/array_spec.rb
|
500
518
|
- spec/lib/contentful/management/asset_spec.rb
|
501
519
|
- spec/lib/contentful/management/client_spec.rb
|
502
520
|
- spec/lib/contentful/management/content_type_spec.rb
|
521
|
+
- spec/lib/contentful/management/editor_interface_spec.rb
|
503
522
|
- spec/lib/contentful/management/entry_spec.rb
|
504
523
|
- spec/lib/contentful/management/locale_spec.rb
|
524
|
+
- spec/lib/contentful/management/role_spec.rb
|
505
525
|
- spec/lib/contentful/management/space_spec.rb
|
506
526
|
- spec/lib/contentful/management/webhook_spec.rb
|
507
527
|
- spec/spec_helper.rb
|
@@ -613,6 +633,7 @@ test_files:
|
|
613
633
|
- spec/fixtures/vcr_cassettes/content_type/find.yml
|
614
634
|
- spec/fixtures/vcr_cassettes/content_type/find_not_found.yml
|
615
635
|
- spec/fixtures/vcr_cassettes/content_type/issue_79.yml
|
636
|
+
- spec/fixtures/vcr_cassettes/content_type/omitted_field.yml
|
616
637
|
- spec/fixtures/vcr_cassettes/content_type/reload.yml
|
617
638
|
- spec/fixtures/vcr_cassettes/content_type/save_new.yml
|
618
639
|
- spec/fixtures/vcr_cassettes/content_type/save_updated.yml
|
@@ -635,6 +656,8 @@ test_files:
|
|
635
656
|
- spec/fixtures/vcr_cassettes/content_type/validation/regexp.yml
|
636
657
|
- spec/fixtures/vcr_cassettes/content_type/validation/size.yml
|
637
658
|
- spec/fixtures/vcr_cassettes/delete_request.yml
|
659
|
+
- spec/fixtures/vcr_cassettes/editor_interfaces/default_for_space.yml
|
660
|
+
- spec/fixtures/vcr_cassettes/editor_interfaces/update.yml
|
638
661
|
- spec/fixtures/vcr_cassettes/entry/all.yml
|
639
662
|
- spec/fixtures/vcr_cassettes/entry/all_public.yml
|
640
663
|
- spec/fixtures/vcr_cassettes/entry/archive.yml
|
@@ -720,6 +743,12 @@ test_files:
|
|
720
743
|
- spec/fixtures/vcr_cassettes/post_request.yml
|
721
744
|
- spec/fixtures/vcr_cassettes/proxy_request.yml
|
722
745
|
- spec/fixtures/vcr_cassettes/put_request.yml
|
746
|
+
- spec/fixtures/vcr_cassettes/roles/all_for_space.yml
|
747
|
+
- spec/fixtures/vcr_cassettes/roles/create_for_space.yml
|
748
|
+
- spec/fixtures/vcr_cassettes/roles/destroy.yml
|
749
|
+
- spec/fixtures/vcr_cassettes/roles/find.yml
|
750
|
+
- spec/fixtures/vcr_cassettes/roles/find_for_space_not_found.yml
|
751
|
+
- spec/fixtures/vcr_cassettes/roles/update.yml
|
723
752
|
- spec/fixtures/vcr_cassettes/space/all.yml
|
724
753
|
- spec/fixtures/vcr_cassettes/space/api_key/all.yml
|
725
754
|
- spec/fixtures/vcr_cassettes/space/api_key/create.yml
|
@@ -767,18 +796,22 @@ test_files:
|
|
767
796
|
- spec/fixtures/vcr_cassettes/space/webhook/find.yml
|
768
797
|
- spec/fixtures/vcr_cassettes/webhook/all.yml
|
769
798
|
- spec/fixtures/vcr_cassettes/webhook/create.yml
|
799
|
+
- spec/fixtures/vcr_cassettes/webhook/create_with_name_and_headers.yml
|
770
800
|
- spec/fixtures/vcr_cassettes/webhook/create_with_taken_url.yml
|
771
801
|
- spec/fixtures/vcr_cassettes/webhook/destroy.yml
|
772
802
|
- spec/fixtures/vcr_cassettes/webhook/find.yml
|
773
803
|
- spec/fixtures/vcr_cassettes/webhook/find_not_found.yml
|
804
|
+
- spec/fixtures/vcr_cassettes/webhook/topics.yml
|
774
805
|
- spec/fixtures/vcr_cassettes/webhook/update.yml
|
775
806
|
- spec/lib/contentful/management/api_key_spec.rb
|
776
807
|
- spec/lib/contentful/management/array_spec.rb
|
777
808
|
- spec/lib/contentful/management/asset_spec.rb
|
778
809
|
- spec/lib/contentful/management/client_spec.rb
|
779
810
|
- spec/lib/contentful/management/content_type_spec.rb
|
811
|
+
- spec/lib/contentful/management/editor_interface_spec.rb
|
780
812
|
- spec/lib/contentful/management/entry_spec.rb
|
781
813
|
- spec/lib/contentful/management/locale_spec.rb
|
814
|
+
- spec/lib/contentful/management/role_spec.rb
|
782
815
|
- spec/lib/contentful/management/space_spec.rb
|
783
816
|
- spec/lib/contentful/management/webhook_spec.rb
|
784
817
|
- spec/spec_helper.rb
|