addons-api 1.0.5 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a4081270b247ebcecee38930b50eb35c55b6e9232d7af621662500dfd88f172
4
- data.tar.gz: cb5b079d9661d102ed5806556554fc8e8907bff70682cabed733343d31dd1088
3
+ metadata.gz: 00a56abad0f35243e4cdb784c6cc2002aa08280fbaa578cf5f370389abbc37d1
4
+ data.tar.gz: 49efbe2bca086b8b5a41904a77c60cb441f55800b25e1fe286757c1667649464
5
5
  SHA512:
6
- metadata.gz: 46a81fb7b5b76c567c72ecaf9b849c250fa7699cb3e4d4086d0cc14737fc75f1389e8222e20c5e5bb62541f135027750d5697073699b08b641afd5a296561dc3
7
- data.tar.gz: a467fc67ee16b66d97ddf5746e48bdbded81f61e68bcf492ab096584c2daa47fe40117227bec72c48f9993dbc294a212d3786e4811cc833f05ac8a87191e3796
6
+ metadata.gz: c91634a84c28abd7484a99073319c2db23e866e6ae2c7c67c9745461f260c0b4e3228848429c4ac74605c20cbcb493c7cd7a05c09fcd3c102595fb3bb68d99ea
7
+ data.tar.gz: 040e96fda608dd0fbfb0a5802051001cac96e0a1203bc512e066ff8c8f21db582aec8878656ec7a56b59d683f3526548a8d29ccbe43a179331797fd16f5c1cb8
@@ -0,0 +1,16 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ versioning-strategy: increase
5
+ directory: "/"
6
+ schedule:
7
+ interval: "monthly"
8
+ labels:
9
+ - "dependencies"
10
+ open-pull-requests-limit: 100
11
+ pull-request-branch-name:
12
+ separator: "-"
13
+ ignore:
14
+ - dependency-name: "fs-extra"
15
+ - dependency-name: "*"
16
+ update-types: ["version-update:semver-major"]
@@ -0,0 +1,48 @@
1
+ name: release-ruby
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+
7
+ jobs:
8
+ release-please:
9
+ name: Build + Publish
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+ pull-requests: write
14
+
15
+ steps:
16
+ - uses: google-github-actions/release-please-action@v4
17
+ id: release
18
+ with:
19
+ token: ${{secrets.RELEASE_PLEASE_GITHUB_TOKEN}}
20
+ config-file: release-please-config.json
21
+
22
+ # Checkout code if release was created
23
+ - uses: actions/checkout@v3
24
+ if: ${{ steps.release.outputs.release_created }}
25
+
26
+ # Set up Ruby if a release was created
27
+ - name: Set up Ruby 3.2
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: 3.2
31
+ if: ${{ steps.release.outputs.release_created }}
32
+
33
+ # Bundle install if a release was created
34
+ - run: bundle install
35
+ if: ${{ steps.release.outputs.release_created }}
36
+
37
+ # Publish to RubyGems if a release was created
38
+ - name: Publish to RubyGems
39
+ run: |
40
+ mkdir -p $HOME/.gem
41
+ touch $HOME/.gem/credentials
42
+ chmod 0600 $HOME/.gem/credentials
43
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
44
+ gem build *.gemspec
45
+ gem push *.gem
46
+ env:
47
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
48
+ if: ${{ steps.release.outputs.release_created }}
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  Gemfile.lock
2
+ *.gem
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.0.9"
3
+ }
data/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ ## [1.0.9](https://github.com/addonsio/addons-ruby/compare/addons-api-v1.0.8...addons-api/v1.0.9) (2024-02-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * initial commit ([46c3542](https://github.com/addonsio/addons-ruby/commit/46c3542a2b9dc6ab87490b63aa790a159e37191a))
9
+ * Publish to RubyGems with GH actions ([df667cc](https://github.com/addonsio/addons-ruby/commit/df667ccbbaab96c80bbe8ddf59ee03a79a350c43))
10
+
11
+ ## [1.0.8](https://github.com/addonsio/ruby-sdk/compare/v1.0.7...v1.0.8) (2023-04-03)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * Publish to RubyGems with GH actions ([df667cc](https://github.com/addonsio/ruby-sdk/commit/df667ccbbaab96c80bbe8ddf59ee03a79a350c43))
17
+
18
+ ## 1.0.7 (2023-04-03)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * initial commit ([46c3542](https://github.com/addonsio/ruby-sdk/commit/46c3542a2b9dc6ab87490b63aa790a159e37191a))
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Addons.io, INC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Addons.io API Ruby SDK
2
2
 
3
- Ruby HTTP client for the Addons API.
3
+ Ruby HTTP client for the Addons.io API.
4
4
 
5
5
  ## Similarity to other PaaS
6
6
 
7
- - The [Heroku](https://heroku.com) API. Add-ons will find that they need little modifications to their code when switching to the Addons.io platform.
7
+ - The [Heroku](https://heroku.com) API. Addons will find that they need little modifications to their code when switching to the Addons.io platform.
data/addons-api.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.email = ['moty@crazyantlabs.com']
13
13
  spec.description = 'Ruby HTTP client for the Addons.io API.'
14
14
  spec.summary = 'Ruby HTTP client for the Addons.io API. Learn more on https://addons.io'
15
- spec.homepage = 'https://github.com/addonsio/sdk/ruby'
15
+ spec.homepage = 'https://github.com/addonsio/addons-ruby'
16
16
  spec.license = 'MIT'
17
17
 
18
18
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'yard', "~> 0.9"
26
26
  spec.add_development_dependency 'pry', "~> 0.13"
27
27
  spec.add_development_dependency 'netrc', "~> 0.11"
28
- spec.add_development_dependency 'rspec', "~> 3.10"
28
+ spec.add_development_dependency 'rspec', "~> 3.12"
29
29
 
30
30
  spec.add_dependency "oj", "~> 3.14"
31
31
  spec.add_dependency "rest-client", "~> 2.1"
@@ -100,13 +100,18 @@ module AddonsApi
100
100
  @oauth_resource ||= OAuth.new(self)
101
101
  end
102
102
 
103
+ # AddonService resource
104
+ def addon_service
105
+ @addon_service_resource ||= AddonService.new(self)
106
+ end
107
+
103
108
  # Team resource
104
109
  def team
105
110
  @team_resource ||= Team.new(self)
106
111
  end
107
112
  end
108
113
 
109
- # Add-on services represent add-ons that may be provisioned for apps.
114
+ # Addon services represent addons that may be provisioned for apps.
110
115
  class OAuth
111
116
  BASE_PATH = "oauth"
112
117
 
@@ -148,6 +153,58 @@ module AddonsApi
148
153
  end
149
154
  end
150
155
 
156
+ class AddonService
157
+ BASE_PATH = "addon-services"
158
+
159
+ def initialize(client)
160
+ @client = client
161
+ end
162
+
163
+ def list()
164
+ @client.request(:get, "#{BASE_PATH}")
165
+ end
166
+
167
+ def info(addon_service_id)
168
+ @client.request(:get, "#{BASE_PATH}/#{addon_service_id}")
169
+ end
170
+
171
+ def plan
172
+ @plan_resource ||= AddonServicePlan.new(@client)
173
+ end
174
+
175
+ def field
176
+ @field_resource ||= AddonServiceField.new(@client)
177
+ end
178
+
179
+ class AddonServicePlan
180
+ def initialize(client)
181
+ @client = client
182
+ end
183
+
184
+ def list(addon_service_id)
185
+ @client.request(:get, "#{BASE_PATH}/#{addon_service_id}/plans")
186
+ end
187
+
188
+ def info(addon_service_id, addon_service_plan_id)
189
+ @client.request(:get, "#{BASE_PATH}/#{addon_service_id}/plans/#{addon_service_plan_id}")
190
+ end
191
+ end
192
+
193
+ class AddonServiceField
194
+ def initialize(client)
195
+ @client = client
196
+ end
197
+
198
+ def list(addon_service_id)
199
+ @client.request(:get, "#{BASE_PATH}/#{addon_service_id}/fields")
200
+ end
201
+
202
+ def info(addon_service_id, addon_service_field_id)
203
+ @client.request(:get, "#{BASE_PATH}/#{addon_service_id}/fields/#{addon_service_plan_id}")
204
+ end
205
+ end
206
+ end
207
+
151
208
  class Team
152
209
  BASE_PATH = "teams"
153
210
 
@@ -167,7 +224,7 @@ module AddonsApi
167
224
  @member_resource ||= Member.new(@client)
168
225
  end
169
226
 
170
- # Add-on resource
227
+ # Addon resource
171
228
  def addon
172
229
  @addon_resource ||= Addon.new(@client)
173
230
  end
@@ -184,7 +241,7 @@ module AddonsApi
184
241
  end
185
242
  end
186
243
 
187
- # Add-on
244
+ # Addon
188
245
  class Addon
189
246
  def initialize(client)
190
247
  @client = client
@@ -206,56 +263,68 @@ module AddonsApi
206
263
  @client.request(:get, "", base_url: callback_url)
207
264
  end
208
265
 
209
- # Configuration of an Add-on
266
+ def create(team_id, body = {})
267
+ @client.request(:post, "#{BASE_PATH}/#{team_id}/addons", body: body)
268
+ end
269
+
270
+ def delete(team_id, addon_id)
271
+ @client.request(:delete, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}")
272
+ end
273
+
274
+ def update(team_id, addon_id, body = {})
275
+ @client.request(:patch, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}", body: body)
276
+ end
277
+
278
+ # Configuration of an Addon
210
279
  class Config
211
280
  def initialize(client)
212
281
  @client = client
213
282
  end
214
283
 
215
- # Get the configuration of an add-on.
284
+ # Get the configuration of an addon.
216
285
  def list(team_id, addon_id)
217
286
  @client.request(:get, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}/config")
218
287
  end
219
288
 
220
- # Get the configuration of an add-on with callback URL.
289
+ # Get the configuration of an addon with callback URL.
221
290
  def list_with_callback_url(callback_url)
222
291
  @client.request(:get, "config", base_url: callback_url)
223
292
  end
224
293
 
225
- # Update the configuration of an add-on.
294
+ # Update the configuration of an addon.
226
295
  def update(team_id, addon_id, body = {})
227
296
  @client.request(:patch, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}/config", body: body)
228
297
  end
229
298
 
230
- # Update the configuration of an add-on with callback URL.
299
+ # Update the configuration of an addon with callback URL.
231
300
  def update_with_callback_url(callback_url, body = {})
232
301
  @client.request(:patch, "config", base_url: callback_url, body: body)
233
302
  end
234
303
  end
235
304
 
236
- # Add-on Actions are lifecycle operations for add-on provisioning and deprovisioning.
237
- # They allow add-on providers to (de)provision add-ons in the background and then report back when (de)provisioning is complete.
305
+ # Addon Actions are lifecycle operations for addon provisioning and deprovisioning.
306
+ # They allow addon providers to (de)provision addons in the background and then report back when (de)provisioning is complete.
238
307
  class Action
239
308
  def initialize(client)
240
309
  @client = client
241
310
  end
242
311
 
243
- # Mark an add-on as provisioned.
312
+ # Mark an addon as provisioned.
244
313
  def provision(team_id, addon_id)
245
314
  @client.request(:post, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}/actions/provision")
246
315
  end
247
316
 
248
- # Mark an add-on as provisioned with callback URL.
317
+ # Mark an addon as provisioned with callback URL.
249
318
  def provision_with_callback_url(callback_url)
250
319
  @client.request(:post, "actions/provision", base_url: callback_url)
251
320
  end
252
321
 
253
- # Mark an add-on as deprovisioned.
322
+ # Mark an addon as deprovisioned.
254
323
  def deprovision(team_id, addon_id)
255
324
  @client.request(:post, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}/actions/deprovision")
256
325
  end
257
326
 
258
- # Mark an add-on as deprovisioned with callback URL.
327
+ # Mark an addon as deprovisioned with callback URL.
259
328
  def deprovision_with_callback_url(callback_url)
260
329
  @client.request(:post, "actions/deprovision", base_url: callback_url)
261
330
  end
@@ -1,3 +1,3 @@
1
1
  module AddonsApi
2
- VERSION = '1.0.5'
2
+ VERSION = '1.0.9'
3
3
  end
@@ -0,0 +1,15 @@
1
+ {
2
+ "packages": {
3
+ ".": {
4
+ "package-name": "addons-api",
5
+ "changelog-path": "CHANGELOG.md",
6
+ "release-type": "ruby",
7
+ "bump-minor-pre-major": true,
8
+ "bump-patch-for-minor-pre-major": false,
9
+ "draft": false,
10
+ "prerelease": false,
11
+ "version-file": "lib/addons-api/version.rb"
12
+ }
13
+ },
14
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
15
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: addons-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - motymichaely
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-02 00:00:00.000000000 Z
11
+ date: 2024-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.10'
89
+ version: '3.12'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.10'
96
+ version: '3.12'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: oj
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -129,18 +129,24 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
+ - ".github/dependabot.yml"
133
+ - ".github/workflows/release.yml"
132
134
  - ".gitignore"
135
+ - ".release-please-manifest.json"
136
+ - CHANGELOG.md
133
137
  - Gemfile
138
+ - LICENSE
134
139
  - README.md
135
140
  - addons-api.gemspec
136
141
  - lib/addons-api.rb
137
142
  - lib/addons-api/client.rb
138
143
  - lib/addons-api/version.rb
139
- homepage: https://github.com/addonsio/sdk/ruby
144
+ - release-please-config.json
145
+ homepage: https://github.com/addonsio/addons-ruby
140
146
  licenses:
141
147
  - MIT
142
148
  metadata: {}
143
- post_install_message:
149
+ post_install_message:
144
150
  rdoc_options: []
145
151
  require_paths:
146
152
  - lib
@@ -155,8 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
161
  - !ruby/object:Gem::Version
156
162
  version: '0'
157
163
  requirements: []
158
- rubygems_version: 3.3.26
159
- signing_key:
164
+ rubygems_version: 3.4.19
165
+ signing_key:
160
166
  specification_version: 4
161
167
  summary: Ruby HTTP client for the Addons.io API. Learn more on https://addons.io
162
168
  test_files: []