publishing_platform_api_adapters 0.14.9 → 0.15.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: b8c70f4e749e69eb7b6d11b2e93514ce807f40512161dcfe21719e8bd08a7940
4
- data.tar.gz: 8e6b0b5c157b7d0379ce60548149802320cddc0d49969cbf9f232b3aa22f9e8f
3
+ metadata.gz: d2e1a843c826f9eb2a5600e4a49a4329ddb2035d440efed9a5306f941d42d18d
4
+ data.tar.gz: 76d77976bc29dc9879233474cd03028954ed1e59c73b353e5907da9c75984ec0
5
5
  SHA512:
6
- metadata.gz: e5d48e58d25ae9189c98fe61a915c6da635e90b10166dceb5ff492960c4bb07280bea72698da5d87cb0a67e5fecfa8ead81e70dca561f29b0c826903d0ff9df6
7
- data.tar.gz: d96557af091d6d88d000858f920163a1a3a402d06f7a7703387a64eeb0fa1c0182fb2ba02130915e771b08cf22b6ab1421ec8b035d04595371726eed93c9fc80
6
+ metadata.gz: 3aa7d23e277b3da12fe39595f37e5d79a9c07dcc863af6ee7eb4ae4b5d7d05e106ff8f3c957c896e743beed07c4f28e50b5f950c539a7bcae11b4f2dfcc42e0f
7
+ data.tar.gz: fc541ef87badcfb144e1136dfd8b586adf5eace8ff697a72941e2bb06512cf68322e0b2483c1314acee6f845f3bd66c4eb9b9266f26015d394cdf11fc484d5e3
@@ -253,6 +253,22 @@ class PublishingPlatformApi::PublishingApi < PublishingPlatformApi::Base
253
253
  get_json("#{endpoint}/content#{query}")
254
254
  end
255
255
 
256
+ # Get events for a specific content_id
257
+ #
258
+ # @param content_id [UUID]
259
+ # @param params [Hash]
260
+ #
261
+ # publishing_api.get_events_for_content_id(
262
+ # "7ac47b33-c09c-4c1d-a9a7-0cfef99081ac",
263
+ # { action: "PutContent", from: "2023-01-01T00:00:00Z", to: "2023-01-05T10:00:00Z" }
264
+ # )
265
+ #
266
+ # @return [PublishingPlatformApi::Response] A response containing a list of events for that content ID
267
+ def get_events_for_content_id(content_id, params = {})
268
+ query = query_string(params)
269
+ get_json("#{endpoint}/content/#{content_id}/events#{query}")
270
+ end
271
+
256
272
  # FIXME: Add documentation
257
273
  def get_linkables(document_type: nil)
258
274
  if document_type.nil?
@@ -0,0 +1,17 @@
1
+ require_relative "base"
2
+
3
+ class PublishingPlatformApi::SignonApi < PublishingPlatformApi::Base
4
+ # Get users with specific UUIDs
5
+ #
6
+ # @param uuids [Array]
7
+ #
8
+ # signon_api.users(
9
+ # ["7ac47b33-c09c-4c1d-a9a7-0cfef99081ac"],
10
+ # )
11
+ #
12
+ # @return [PublishingPlatformApi::Response] A response containing a list of users with the specified UUIDs
13
+ def get_users(uuids:)
14
+ query = query_string(uuids:)
15
+ get_json("#{endpoint}/api/users#{query}")
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PublishingPlatformApi
4
- VERSION = "0.14.9"
4
+ VERSION = "0.15.0"
5
5
  end
@@ -7,6 +7,7 @@ require "publishing_platform_api/publishing_api"
7
7
  require "publishing_platform_api/organisations"
8
8
  require "publishing_platform_api/router"
9
9
  require "publishing_platform_api/search"
10
+ require "publishing_platform_api/signon_api"
10
11
 
11
12
  # @api documented
12
13
  module PublishingPlatformApi
@@ -83,4 +84,17 @@ module PublishingPlatformApi
83
84
  options,
84
85
  )
85
86
  end
87
+
88
+ # Creates a PublishingPlatformApi::SignonApi adapter
89
+ #
90
+ # This will set a bearer token if a SIGNON_API_BEARER_TOKEN environment
91
+ # variable is set
92
+ #
93
+ # @return [PublishingPlatformApi::SignonApi]
94
+ def self.signon_api(options = {})
95
+ PublishingPlatformApi::SignonApi.new(
96
+ PublishingPlatformLocation.find("signon"),
97
+ { bearer_token: ENV["SIGNON_API_BEARER_TOKEN"] }.merge(options),
98
+ )
99
+ end
86
100
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publishing_platform_api_adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.9
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Publishing Platform
@@ -200,6 +200,7 @@ files:
200
200
  - lib/publishing_platform_api/response.rb
201
201
  - lib/publishing_platform_api/router.rb
202
202
  - lib/publishing_platform_api/search.rb
203
+ - lib/publishing_platform_api/signon_api.rb
203
204
  - lib/publishing_platform_api/test_helpers/asset_manager.rb
204
205
  - lib/publishing_platform_api/test_helpers/common_responses.rb
205
206
  - lib/publishing_platform_api/test_helpers/content_item_helpers.rb
@@ -227,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
228
  - !ruby/object:Gem::Version
228
229
  version: '0'
229
230
  requirements: []
230
- rubygems_version: 4.0.17
231
+ rubygems_version: 4.0.18
231
232
  specification_version: 4
232
233
  summary: Adapters to work with Publishing Platform APIs
233
234
  test_files: []