gds-api-adapters 53.1.0 → 53.2.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: aa07967cdfd1c7791a385f7bc585e8be843b5b447b2891b85d5242e44c834f12
4
- data.tar.gz: 212336983c63d9e570b2adede0057d5976527b3417fdd487bebff5007a620457
3
+ metadata.gz: 28fdb9aa5f03109f651caa65a00eefcbf488473ae40a0a5ca671a4bb49506c0b
4
+ data.tar.gz: daf953f3e6f81eb98c61198cd25611378f0ee86f95bc82980b1f442637c2bf30
5
5
  SHA512:
6
- metadata.gz: 5966d420493995200b47eac6f8895f4265914e8e76c56320e8756c716a23191cc2228932ce956b6b4e1ad23fa62db6a934e816d65f8e930e06dd9ac2de620c86
7
- data.tar.gz: '09c2be717c31149258089e9982f34ca9e5af8544b60f292f73a157018de0c68ecb6ea2cdd9d64b4d22cf565f605cb603ca96c2344748994c962ac47a0c441083'
6
+ metadata.gz: e3dcc1d0b4e5cc2f37d0dc70b179a5523add55295a3713fe4214417f416c494ddb99c439dc329af764be9af3f00185e0126ae6770a48f5b126950703e58f2daf
7
+ data.tar.gz: fd4c5bbdff4794567c2aadf420e1e7f30eb2e22a583570d911968fe7678525b7bbd6e8545a8d99fef8b305262db47dc5185ca16321a128290ca486203937ed59
@@ -1,2 +1,3 @@
1
1
  require 'gds_api/railtie' if defined?(Rails)
2
2
  require 'gds_api/exceptions'
3
+ require 'gds_api'
data/lib/gds_api.rb ADDED
@@ -0,0 +1,184 @@
1
+ require 'plek'
2
+ require 'gds_api/asset_manager'
3
+ require 'gds_api/calendars'
4
+ require 'gds_api/content_store'
5
+ require 'gds_api/email_alert_api'
6
+ require 'gds_api/imminence'
7
+ require 'gds_api/licence_application'
8
+ require 'gds_api/link_checker_api'
9
+ require 'gds_api/local_links_manager'
10
+ require 'gds_api/mapit'
11
+ require 'gds_api/maslow'
12
+ require 'gds_api/organisations'
13
+ require 'gds_api/publishing_api'
14
+ require 'gds_api/publishing_api_v2'
15
+ require 'gds_api/router'
16
+ require 'gds_api/rummager'
17
+ require 'gds_api/support'
18
+ require 'gds_api/support_api'
19
+ require 'gds_api/worldwide'
20
+
21
+ # @api documented
22
+ module GdsApi
23
+ # Creates a GdsApi::AssetManager adapter
24
+ #
25
+ # This will set a bearer token if a ASSET_MANAGER_BEARER_TOKEN environment
26
+ # variable is set
27
+ #
28
+ # @return [GdsApi::AssetManager]
29
+ def self.asset_manager(options = {})
30
+ GdsApi::AssetManager.new(
31
+ Plek.find('asset-manager'),
32
+ { bearer_token: ENV['ASSET_MANAGER_BEARER_TOKEN'] }.merge(options)
33
+ )
34
+ end
35
+
36
+ # Creates a GdsApi::Calendars adapter
37
+ #
38
+ # @return [GdsApi::Calendars]
39
+ def self.calendars(options = {})
40
+ GdsApi::Calendars.new(Plek.find('calendars'), options)
41
+ end
42
+
43
+ # Creates a GdsApi::ContentStore adapter
44
+ #
45
+ # @return [GdsApi::ContentStore]
46
+ def self.content_store(options = {})
47
+ GdsApi::ContentStore.new(Plek.find('content-store'), options)
48
+ end
49
+
50
+ # Creates a GdsApi::EmailAlertApi adapter
51
+ #
52
+ # This will set a bearer token if a EMAIL_ALERT_API_BEARER_TOKEN environment
53
+ # variable is set
54
+ #
55
+ # @return [GdsApi::EmailAlertApi]
56
+ def self.email_alert_api(options = {})
57
+ GdsApi::EmailAlertApi.new(
58
+ Plek.find('email-alert-api'),
59
+ { bearer_token: ENV['EMAIL_ALERT_API_BEARER_TOKEN'] }.merge(options)
60
+ )
61
+ end
62
+
63
+ # Creates a GdsApi::Imminence adapter
64
+ #
65
+ # @return [GdsApi::Imminence]
66
+ def self.imminence(options = {})
67
+ GdsApi::Imminence.new(Plek.find('imminence'), options)
68
+ end
69
+
70
+ # Creates a GdsApi::LicenceApplication
71
+ #
72
+ # @return [GdsApi::LicenceApplication]
73
+ def self.licence_application(options = {})
74
+ GdsApi::LicenceApplication.new(Plek.find('licensify'), options)
75
+ end
76
+
77
+ # Creates a GdsApi::LinkCheckerApi adapter
78
+ #
79
+ # @return [GdsApi::LinkCheckerApi]
80
+ def self.link_checker_api(options = {})
81
+ GdsApi::LinkCheckerApi.new(Plek.find('link-checker-api'), options)
82
+ end
83
+
84
+ # Creates a GdsApi::LocalLinksManager adapter
85
+ #
86
+ # @return [GdsApi::LocalLinksManager]
87
+ def self.local_links_manager(options = {})
88
+ GdsApi::LocalLinksManager.new(Plek.find('local-links-manager'), options)
89
+ end
90
+
91
+ # Creates a GdsApi::Mapit adapter
92
+ #
93
+ # @return [GdsApi::Mapit]
94
+ def self.mapit(options = {})
95
+ GdsApi::Mapit.new(Plek.find('mapit'), options)
96
+ end
97
+
98
+ # Creates a GdsApi::Maslow adapter
99
+ #
100
+ # It's set to use an external url as an endpoint as the Maslow adapter is
101
+ # used to generate external links
102
+ #
103
+ # @return [GdsApi::Maslow]
104
+ def self.maslow(options = {})
105
+ GdsApi::Maslow.new(Plek.new.external_url_for('maslow'), options)
106
+ end
107
+
108
+ # Creates a GdsApi::Organisations adapter for accessing Whitehall APIs on a
109
+ # whitehall-admin host
110
+ #
111
+ # @return [GdsApi::Organisations]
112
+ def self.organisations(options = {})
113
+ GdsApi::Organisations.new(Plek.find('whitehall-admin'), options)
114
+ end
115
+
116
+ # Creates a GdsApi::PublishingApi adapter
117
+ #
118
+ # This will set a bearer token if a PUBLISHING_API_BEARER_TOKEN environment
119
+ # variable is set
120
+ #
121
+ # @return [GdsApi::PublishingApi]
122
+ def self.publishing_api(options = {})
123
+ GdsApi::PublishingApi.new(
124
+ Plek.find('publishing-api'),
125
+ { bearer_token: ENV['PUBLISHING_API_BEARER_TOKEN'] }.merge(options)
126
+ )
127
+ end
128
+
129
+ # Creates a GdsApi::PublishingApiV2 adapter
130
+ #
131
+ # This will set a bearer token if a PUBLISHING_API_BEARER_TOKEN environment
132
+ # variable is set
133
+ #
134
+ # @return [GdsApi::PublishingApiV2]
135
+ def self.publishing_api_v2(options = {})
136
+ GdsApi::PublishingApiV2.new(
137
+ Plek.find('publishing-api'),
138
+ { bearer_token: ENV['PUBLISHING_API_BEARER_TOKEN'] }.merge(options)
139
+ )
140
+ end
141
+
142
+ # Creates a GdsApi::Router adapter for communicating with Router API
143
+ #
144
+ # @return [GdsApi::Router]
145
+ def self.router(options = {})
146
+ GdsApi::Router.new(Plek.find('router-api'), options)
147
+ end
148
+
149
+ # Creates a GdsApi::Rummager adapter to access via a rummager.* hostname
150
+ #
151
+ # @return [GdsApi::Rummager]
152
+ def self.rummager(options = {})
153
+ GdsApi::Rummager.new(Plek.find('rummager'), options)
154
+ end
155
+
156
+ # Creates a GdsApi::Rummager adapter to access via a search.* hostname
157
+ #
158
+ # @return [GdsApi::Rummager]
159
+ def self.search(options = {})
160
+ GdsApi::Rummager.new(Plek.find('search'), options)
161
+ end
162
+
163
+ # Creates a GdsApi::Support adapter
164
+ #
165
+ # @return [GdsApi::Support]
166
+ def self.support(options = {})
167
+ GdsApi::Support.new(Plek.find('support'), options)
168
+ end
169
+
170
+ # Creates a GdsApi::SupportApi adapter
171
+ #
172
+ # @return [GdsApi::SupportApi]
173
+ def self.support_api(options = {})
174
+ GdsApi::SupportApi.new(Plek.find('support-api'), options)
175
+ end
176
+
177
+ # Creates a GdsApi::Worldwide adapter for accessing Whitehall APIs on a
178
+ # whitehall-admin host
179
+ #
180
+ # @return [GdsApi::Worldwide]
181
+ def self.worldwide(options = {})
182
+ GdsApi::Worldwide.new(Plek.find('whitehall-admin'), options)
183
+ end
184
+ end
@@ -5,6 +5,9 @@ require 'gds_api/licence_application'
5
5
  require 'gds_api/worldwide'
6
6
  require 'gds_api/email_alert_api'
7
7
 
8
+ # This module is deprecated and should be removed in the next major release
9
+ # Apps using this are encouraged to use GdsApi module methods
10
+ # (e.g. GdsApi.asset_manger) rather than using this mixin
8
11
  module GdsApi
9
12
  module Helpers
10
13
  def asset_manager_api(options = {})
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '53.1.0'.freeze
2
+ VERSION = '53.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 53.1.0
4
+ version: 53.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-19 00:00:00.000000000 Z
11
+ date: 2018-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -356,6 +356,7 @@ files:
356
356
  - README.md
357
357
  - Rakefile
358
358
  - lib/gds-api-adapters.rb
359
+ - lib/gds_api.rb
359
360
  - lib/gds_api/asset_manager.rb
360
361
  - lib/gds_api/base.rb
361
362
  - lib/gds_api/calendars.rb