contentful-management 3.10.0 → 3.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1be880d5abec4cfc960c7b8e7cde62db19416f6d1d6db73efe5ac73ecd4578f
4
- data.tar.gz: d4094d5b52444e0583128a18a387069240398096c30a01280209d9e74594fa9d
3
+ metadata.gz: e11d5eba1080e56f80928b6e0b5eef8425b72c976fa814c78eef67b80eeb92c0
4
+ data.tar.gz: f7991340fd7452cd04503d8c036b36800629809e532a85dae6575efde55fafa9
5
5
  SHA512:
6
- metadata.gz: 5fd24cc082d32d9ce80d6233e6639d5759feeee06da98284d865ae31e17bb9749d6fd2cf65da3499711ca543070c2ab02b0802d9fe658b19db42cc2909cafb52
7
- data.tar.gz: e9417a27dec68db9474b7edfc6f02cd84f71bb02bfec3cd790cc8877d3ab2c8eed59aaab2c39a3dc1dca6f51c475f8e563cd687fe73d2571220879d9dc91be13
6
+ metadata.gz: 6030d1c3af5683ccbd8596c4643c9ed32ff2776c4c409b1bf7c53000e9fed7a841695a458471a40752ba4b7abaa76f3162c3a7e9759cf2673d1f0f399682da01
7
+ data.tar.gz: 37c6ebbebb2502d64ea3e70f98036e5d81bff2503da5c6b7c41bfe92e37812b178e9fbb8d758ed80a0d6f76c022744f5038b0fbb5d870c3584bfe84a3e3c208b
data/.circleci/config.yml CHANGED
@@ -9,7 +9,7 @@ jobs:
9
9
  - image: cimg/ruby:<< parameters.ruby-version >>
10
10
  steps:
11
11
  - checkout
12
- - run: gem install bundler
12
+ - run: gem install bundler:2.3.26
13
13
  - run: bundle install
14
14
  - run: bundle exec rake rspec_rubocop
15
15
 
@@ -20,4 +20,4 @@ workflows:
20
20
  - test_and_lint:
21
21
  matrix:
22
22
  parameters:
23
- ruby-version: ["3.0", "3.1", "3.2"]
23
+ ruby-version: ["3.2", "3.3", "3.4"]
@@ -0,0 +1 @@
1
+ * @contentful/team-developer-experience
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ### Unreleased
4
4
 
5
+ ## 3.11.0
6
+ * Add support for general editor interfaces endpoint
7
+
8
+ ## 3.10.1
9
+ * Updated Ruby version requirements in gemspec and CircleCI config
10
+ * Added support for Ruby 3.4 in CI/CD pipeline
11
+
5
12
  ## 3.10.0
6
13
  * Added defaultValue field property
7
14
  * Added delete field property
@@ -258,7 +265,7 @@ The proxies, apart from the parameter re-shuffling, have kept the same interface
258
265
  * Added Personal Access Tokens Endpoint.
259
266
 
260
267
  ### Changed
261
- * Rewrote HTTP internals in order to allow base-level resources and simplified Client.
268
+ * Rewritten HTTP internals in order to allow base-level resources and simplified Client.
262
269
 
263
270
  ## 1.8.1
264
271
  ### Added
data/catalog-info.yaml ADDED
@@ -0,0 +1,14 @@
1
+ apiVersion: backstage.io/v1alpha1
2
+ kind: Component
3
+ metadata:
4
+ name: contentful-management.rb
5
+ description: Ruby client for the Contentful Content Management API.
6
+ annotations:
7
+ github.com/project-slug: contentful/contentful-management.rb
8
+ contentful.com/service-tier: "4"
9
+ tags:
10
+ - tier-4
11
+ spec:
12
+ type: library
13
+ lifecycle: production
14
+ owner: group:team-developer-experience
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_dependency 'http', '~> 5.0'
22
- spec.add_dependency 'multi_json', '~> 1'
22
+ spec.add_dependency 'multi_json', '~> 1.15'
23
23
  spec.add_dependency 'json', '>= 1.8', '< 3.0'
24
24
 
25
25
  spec.add_development_dependency 'bundler'
@@ -52,9 +52,14 @@ module Contentful
52
52
  def self.build_endpoint(endpoint_options)
53
53
  space_id = endpoint_options.fetch(:space_id)
54
54
  environment_id = endpoint_options.fetch(:environment_id)
55
- content_type_id = endpoint_options.fetch(:content_type_id)
55
+ base_path = "spaces/#{space_id}/environments/#{environment_id}"
56
56
 
57
- "spaces/#{space_id}/environments/#{environment_id}/content_types/#{content_type_id}/editor_interface"
57
+ if endpoint_options.key?(:content_type_id)
58
+ content_type_id = endpoint_options.fetch(:content_type_id)
59
+ "#{base_path}/content_types/#{content_type_id}/editor_interface"
60
+ else
61
+ "#{base_path}/editor_interfaces"
62
+ end
58
63
  end
59
64
 
60
65
  # Updates an Editor Interface
@@ -43,7 +43,11 @@ module Contentful
43
43
  end
44
44
 
45
45
  def handle_details(details)
46
- details.to_s
46
+ if details.is_a?(Hash)
47
+ details.map { |k, v| "#{k.inspect}=>#{v.inspect}" }.join(', ').then { |s| "{#{s}}" }
48
+ else
49
+ details.to_s
50
+ end
47
51
  end
48
52
 
49
53
  def additional_info?
@@ -5,6 +5,6 @@ module Contentful
5
5
  # Management Namespace
6
6
  module Management
7
7
  # Gem Version
8
- VERSION = '3.10.0'
8
+ VERSION = '3.11.0'
9
9
  end
10
10
  end
@@ -0,0 +1,85 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.contentful.com/spaces/oe3b689om6k5/environments/master/editor_interfaces
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ X-Contentful-User-Agent:
11
+ - sdk contentful-management.rb/3.10.0; platform ruby/3.4.3; os macOS/24;
12
+ Authorization:
13
+ - Bearer <ACCESS_TOKEN>
14
+ Content-Type:
15
+ - application/vnd.contentful.management.v1+json
16
+ Connection:
17
+ - close
18
+ Host:
19
+ - api.contentful.com
20
+ User-Agent:
21
+ - http.rb/5.0.1
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Connection:
28
+ - close
29
+ Content-Length:
30
+ - '5583'
31
+ Content-Type:
32
+ - application/vnd.contentful.management.v1+json
33
+ X-Contentful-Ratelimit-Hour-Remaining:
34
+ - '35999'
35
+ X-Contentful-Ratelimit-Second-Remaining:
36
+ - '9'
37
+ X-Contentful-Ratelimit-Hour-Limit:
38
+ - '36000'
39
+ X-Contentful-Ratelimit-Second-Limit:
40
+ - '10'
41
+ X-Contentful-Ratelimit-Reset:
42
+ - '0'
43
+ Cf-Space-Id:
44
+ - oe3b689om6k5
45
+ Cf-Environment-Id:
46
+ - master
47
+ Cf-Environment-Uuid:
48
+ - master
49
+ X-Contentful-Route:
50
+ - "/spaces/:space/environments/:environment/editor_interfaces"
51
+ Etag:
52
+ - '"1358933671436039259"'
53
+ Strict-Transport-Security:
54
+ - max-age=15768000
55
+ X-Content-Type-Options:
56
+ - nosniff
57
+ Server:
58
+ - Contentful
59
+ Contentful-Api:
60
+ - cma
61
+ Contentful-Upstream:
62
+ - content-api
63
+ Access-Control-Allow-Origin:
64
+ - "*"
65
+ Access-Control-Allow-Headers:
66
+ - Accept,Accept-Language,Authorization,Cache-Control,CF-Context,Content-Length,Content-Range,Content-Type,DNT,Destination,Expires,If-Match,If-Modified-Since,If-None-Match,Keep-Alive,Last-Modified,Origin,Pragma,Range,User-Agent,X-Http-Method-Override,X-Mx-ReqToken,X-Requested-With,X-Contentful-Version,X-Contentful-Content-Type,X-Contentful-Organization,X-Contentful-Skip-Transformation,X-Contentful-Tag-Visibility,X-Contentful-User-Agent,X-Contentful-Enable-Alpha-Feature,X-Contentful-Source-Environment,X-Contentful-Team,X-Contentful-Parent-Id,x-contentful-validate-only,X-Contentful-Skip-UI-Draft-Validation,X-Contentful-Marketplace,X-Contentful-UI-Content-Auto-Save,cf-trace,X-Contentful-Comment-Body-Format,X-Contentful-Parent-Entity-Reference,X-Contentful-Include-Invocation-Metadata,X-Contentful-Async-Ai-Action
67
+ Access-Control-Expose-Headers:
68
+ - Etag,x-contentful-request-id,x-contentful-ai-actions-ratelimit-reset
69
+ Access-Control-Allow-Methods:
70
+ - DELETE,GET,HEAD,POST,PUT,PATCH,OPTIONS
71
+ Access-Control-Max-Age:
72
+ - '1728000'
73
+ Accept-Ranges:
74
+ - bytes
75
+ Date:
76
+ - Fri, 20 Jun 2025 12:56:28 GMT
77
+ X-Contentful-Request-Id:
78
+ - fc76cc7a-be78-4e41-9ac2-604f55ad634f
79
+ body:
80
+ encoding: ASCII-8BIT
81
+ string: '{"sys":{"type":"Array"},"total":8,"items":[{"sys":{"type":"EditorInterface","space":{"sys":{"id":"oe3b689om6k5","type":"Link","linkType":"Space"}},"version":2,"createdAt":"2025-02-12T10:25:48.347Z","createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedAt":"2025-02-12T10:25:49.441Z","updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"contentType":{"sys":{"id":"aaa","type":"Link","linkType":"ContentType"}},"environment":{"sys":{"id":"master","type":"Link","linkType":"Environment"}}},"controls":[{"fieldId":"title","widgetId":"singleLine","widgetNamespace":"builtin"},{"fieldId":"bar","widgetId":"richTextEditor","widgetNamespace":"builtin"}]},{"sys":{"type":"EditorInterface","space":{"sys":{"id":"oe3b689om6k5","type":"Link","linkType":"Space"}},"version":2,"createdAt":"2024-05-24T17:30:14.460Z","createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedAt":"2024-05-24T17:30:15.365Z","updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"contentType":{"sys":{"id":"author","type":"Link","linkType":"ContentType"}},"environment":{"sys":{"id":"master","type":"Link","linkType":"Environment"}}},"controls":[{"fieldId":"name","widgetId":"singleLine","widgetNamespace":"builtin"},{"fieldId":"avatar","widgetId":"assetLinkEditor","widgetNamespace":"builtin"}]},{"sys":{"type":"EditorInterface","space":{"sys":{"id":"oe3b689om6k5","type":"Link","linkType":"Space"}},"version":4,"createdAt":"2025-03-21T05:51:01.897Z","createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedAt":"2025-03-21T06:40:13.391Z","updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"contentType":{"sys":{"id":"blogPost","type":"Link","linkType":"ContentType"}},"environment":{"sys":{"id":"master","type":"Link","linkType":"Environment"}}},"controls":[{"fieldId":"title","widgetId":"singleLine","widgetNamespace":"builtin"},{"fieldId":"body","widgetId":"singleLine","widgetNamespace":"builtin"}]},{"sys":{"type":"EditorInterface","space":{"sys":{"id":"oe3b689om6k5","type":"Link","linkType":"Space"}},"version":2,"createdAt":"2024-05-04T08:09:45.250Z","createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedAt":"2024-05-04T08:09:46.204Z","updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"contentType":{"sys":{"id":"category","type":"Link","linkType":"ContentType"}},"environment":{"sys":{"id":"master","type":"Link","linkType":"Environment"}}},"controls":[{"fieldId":"title","widgetId":"singleLine","widgetNamespace":"builtin"},{"fieldId":"photo","widgetId":"assetLinkEditor","widgetNamespace":"builtin"},{"fieldId":"subCategory","widgetId":"entryLinkEditor","widgetNamespace":"builtin"}]},{"sys":{"type":"EditorInterface","space":{"sys":{"id":"oe3b689om6k5","type":"Link","linkType":"Space"}},"version":2,"createdAt":"2022-12-25T18:51:16.158Z","createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedAt":"2022-12-25T18:51:16.936Z","updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"contentType":{"sys":{"id":"crossSpace","type":"Link","linkType":"ContentType"}},"environment":{"sys":{"id":"master","type":"Link","linkType":"Environment"}}},"controls":[{"fieldId":"title","widgetId":"singleLine","widgetNamespace":"builtin"},{"fieldId":"singleSpace","widgetId":"resourceLinkEditor","widgetNamespace":"builtin"}]},{"sys":{"type":"EditorInterface","space":{"sys":{"id":"oe3b689om6k5","type":"Link","linkType":"Space"}},"version":4,"createdAt":"2024-07-25T21:05:25.045Z","createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedAt":"2024-07-25T21:05:51.516Z","updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"contentType":{"sys":{"id":"footer","type":"Link","linkType":"ContentType"}},"environment":{"sys":{"id":"master","type":"Link","linkType":"Environment"}}},"controls":[{"fieldId":"id","widgetId":"numberEditor","widgetNamespace":"builtin"},{"fieldId":"dag","widgetId":"singleLine","widgetNamespace":"builtin"}]},{"sys":{"type":"EditorInterface","space":{"sys":{"id":"oe3b689om6k5","type":"Link","linkType":"Space"}},"version":2,"createdAt":"2024-07-25T21:13:26.095Z","createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedAt":"2024-07-25T21:13:26.814Z","updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"contentType":{"sys":{"id":"oneWithDefaultValue","type":"Link","linkType":"ContentType"}},"environment":{"sys":{"id":"master","type":"Link","linkType":"Environment"}}},"controls":[{"fieldId":"title","widgetId":"singleLine","widgetNamespace":"builtin"}]},{"sys":{"type":"EditorInterface","space":{"sys":{"id":"oe3b689om6k5","type":"Link","linkType":"Space"}},"version":8,"createdAt":"2024-05-24T17:26:07.699Z","createdBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"updatedAt":"2024-05-24T17:29:32.411Z","updatedBy":{"sys":{"id":"59Erm8D1JuuD273aXNb65T","type":"Link","linkType":"User"}},"contentType":{"sys":{"id":"post","type":"Link","linkType":"ContentType"}},"environment":{"sys":{"id":"master","type":"Link","linkType":"Environment"}}},"controls":[{"fieldId":"fTitle","widgetId":"singleLine","widgetNamespace":"builtin"},{"fieldId":"same","widgetId":"entryLinkEditor","widgetNamespace":"builtin"},{"fieldId":"different","widgetId":"resourceLinkEditor","widgetNamespace":"builtin"}]}]}
82
+
83
+ '
84
+ recorded_at: Fri, 20 Jun 2025 12:56:28 GMT
85
+ recorded_with: VCR 6.2.0
@@ -25,6 +25,15 @@ module Contentful
25
25
 
26
26
  subject { client.editor_interfaces(space_id, 'master', content_type_id) }
27
27
 
28
+ describe '.all' do
29
+ it 'class method also works' do
30
+ vcr('editor_interfaces/all') { expect(Contentful::Management::EditorInterface.all(client, space_id, 'master')).to be_kind_of Contentful::Management::Array }
31
+ end
32
+ it 'builds a Contentful::Management::Entry object' do
33
+ vcr('editor_interfaces/all') { expect(Contentful::Management::EditorInterface.all(client, space_id, 'master').first).to be_kind_of Contentful::Management::EditorInterface }
34
+ end
35
+ end
36
+
28
37
  describe '.default' do
29
38
  it 'class method also works' do
30
39
  vcr('editor_interfaces/default_for_space') { expect(Contentful::Management::EditorInterface.default(client, space_id, 'master', content_type_id)).to be_kind_of Contentful::Management::EditorInterface }
@@ -314,7 +314,7 @@ describe Contentful::Management::Error do
314
314
  it 'returns the json parser\'s message' do
315
315
  uj = Contentful::Management::Response.new raw_fixture('unparsable'), MockRequest.new
316
316
  expect(Contentful::Management::UnparsableJson.new(uj).message).to \
317
- include 'unexpected token'
317
+ include "expected ',' or '}' after object value"
318
318
  end
319
319
  end
320
320
  end
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful-management
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Protas
8
8
  - Tomasz Warkocki
9
9
  - Contentful GmbH (Andreas Tiefenthaler)
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2024-02-27 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: http
@@ -32,14 +31,14 @@ dependencies:
32
31
  requirements:
33
32
  - - "~>"
34
33
  - !ruby/object:Gem::Version
35
- version: '1'
34
+ version: '1.15'
36
35
  type: :runtime
37
36
  prerelease: false
38
37
  version_requirements: !ruby/object:Gem::Requirement
39
38
  requirements:
40
39
  - - "~>"
41
40
  - !ruby/object:Gem::Version
42
- version: '1'
41
+ version: '1.15'
43
42
  - !ruby/object:Gem::Dependency
44
43
  name: json
45
44
  requirement: !ruby/object:Gem::Requirement
@@ -281,6 +280,7 @@ extensions: []
281
280
  extra_rdoc_files: []
282
281
  files:
283
282
  - ".circleci/config.yml"
283
+ - ".github/CODEOWNERS"
284
284
  - ".gitignore"
285
285
  - ".reek"
286
286
  - ".rspec"
@@ -295,6 +295,7 @@ files:
295
295
  - RELEASE.md
296
296
  - Rakefile
297
297
  - bin/cma-console
298
+ - catalog-info.yaml
298
299
  - contentful-management.gemspec
299
300
  - examples/blog.rb
300
301
  - examples/content_types.rb
@@ -543,6 +544,7 @@ files:
543
544
  - spec/fixtures/vcr_cassettes/content_type/validation/size.yml
544
545
  - spec/fixtures/vcr_cassettes/content_type/validation/unique.yml
545
546
  - spec/fixtures/vcr_cassettes/delete_request.yml
547
+ - spec/fixtures/vcr_cassettes/editor_interfaces/all.yml
546
548
  - spec/fixtures/vcr_cassettes/editor_interfaces/default_for_space.yml
547
549
  - spec/fixtures/vcr_cassettes/editor_interfaces/update.yml
548
550
  - spec/fixtures/vcr_cassettes/editor_interfaces/update_sidebar.yml
@@ -816,7 +818,6 @@ homepage: https://github.com/contentful/contentful-management.rb
816
818
  licenses:
817
819
  - MIT
818
820
  metadata: {}
819
- post_install_message:
820
821
  rdoc_options: []
821
822
  require_paths:
822
823
  - lib
@@ -831,8 +832,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
831
832
  - !ruby/object:Gem::Version
832
833
  version: '0'
833
834
  requirements: []
834
- rubygems_version: 3.3.26
835
- signing_key:
835
+ rubygems_version: 3.6.7
836
836
  specification_version: 4
837
837
  summary: contentful management api
838
838
  test_files:
@@ -979,6 +979,7 @@ test_files:
979
979
  - spec/fixtures/vcr_cassettes/content_type/validation/size.yml
980
980
  - spec/fixtures/vcr_cassettes/content_type/validation/unique.yml
981
981
  - spec/fixtures/vcr_cassettes/delete_request.yml
982
+ - spec/fixtures/vcr_cassettes/editor_interfaces/all.yml
982
983
  - spec/fixtures/vcr_cassettes/editor_interfaces/default_for_space.yml
983
984
  - spec/fixtures/vcr_cassettes/editor_interfaces/update.yml
984
985
  - spec/fixtures/vcr_cassettes/editor_interfaces/update_sidebar.yml