addons-api 1.0.8 → 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/.github/dependabot.yml +16 -0
- data/.github/workflows/release.yml +5 -7
- data/.gitignore +1 -0
- data/.release-please-manifest.json +3 -0
- data/CHANGELOG.md +16 -0
- data/README.md +2 -2
- data/addons-api.gemspec +1 -1
- data/lib/addons-api/client.rb +103 -14
- data/lib/addons-api/version.rb +1 -1
- data/release-please-config.json +15 -0
- metadata +10 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1b72d88ee50d9bba87b0045123bb74d0ec2420b6320bd2f78536956bcb810fa
|
4
|
+
data.tar.gz: 59e40d4fc52edb2af6fb54f6f557db3c03005988030a69c24b733b74a9b5941c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aa813a00351ae0668f2796923e1ed24c52b462354896f200b842edb831540aeab5e2d348fc71365731f80557a86a2b6f5059202f6a8dd67f33d870aee9e5546
|
7
|
+
data.tar.gz: e5241d87058dfd890451c8a0b186d5c0c38bc59922f2444e00961c5b92b316885b30317e4f5011832acf9231244317f536d10633ee7b1e1c4d2ca8b4a548c80d
|
@@ -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"]
|
@@ -13,23 +13,21 @@ jobs:
|
|
13
13
|
pull-requests: write
|
14
14
|
|
15
15
|
steps:
|
16
|
-
- uses: google-github-actions/release-please-action@
|
16
|
+
- uses: google-github-actions/release-please-action@v4
|
17
17
|
id: release
|
18
18
|
with:
|
19
|
-
|
20
|
-
|
21
|
-
bump-minor-pre-major: true
|
22
|
-
version-file: "lib/addons-api/version.rb"
|
19
|
+
token: ${{secrets.RELEASE_PLEASE_GITHUB_TOKEN}}
|
20
|
+
config-file: release-please-config.json
|
23
21
|
|
24
22
|
# Checkout code if release was created
|
25
23
|
- uses: actions/checkout@v3
|
26
24
|
if: ${{ steps.release.outputs.release_created }}
|
27
25
|
|
28
26
|
# Set up Ruby if a release was created
|
29
|
-
- name: Set up Ruby 3.
|
27
|
+
- name: Set up Ruby 3.2
|
30
28
|
uses: ruby/setup-ruby@v1
|
31
29
|
with:
|
32
|
-
ruby-version: 3.
|
30
|
+
ruby-version: 3.2
|
33
31
|
if: ${{ steps.release.outputs.release_created }}
|
34
32
|
|
35
33
|
# Bundle install if a release was created
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.1.0](https://github.com/addonsio/addons-ruby/compare/addons-api/v1.0.9...addons-api/v1.1.0) (2024-02-12)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* bump release ([#10](https://github.com/addonsio/addons-ruby/issues/10)) ([12f4f8e](https://github.com/addonsio/addons-ruby/commit/12f4f8ed48ce69179026d4866054dfaae3187814))
|
9
|
+
* release 1.1.0 ([12f4f8e](https://github.com/addonsio/addons-ruby/commit/12f4f8ed48ce69179026d4866054dfaae3187814))
|
10
|
+
|
11
|
+
## [1.0.9](https://github.com/addonsio/addons-ruby/compare/addons-api-v1.0.8...addons-api/v1.0.9) (2024-02-08)
|
12
|
+
|
13
|
+
|
14
|
+
### Bug Fixes
|
15
|
+
|
16
|
+
* initial commit ([46c3542](https://github.com/addonsio/addons-ruby/commit/46c3542a2b9dc6ab87490b63aa790a159e37191a))
|
17
|
+
* Publish to RubyGems with GH actions ([df667cc](https://github.com/addonsio/addons-ruby/commit/df667ccbbaab96c80bbe8ddf59ee03a79a350c43))
|
18
|
+
|
3
19
|
## [1.0.8](https://github.com/addonsio/ruby-sdk/compare/v1.0.7...v1.0.8) (2023-04-03)
|
4
20
|
|
5
21
|
|
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.
|
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/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
|
data/lib/addons-api/client.rb
CHANGED
@@ -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
|
-
#
|
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
|
-
#
|
227
|
+
# Addon resource
|
171
228
|
def addon
|
172
229
|
@addon_resource ||= Addon.new(@client)
|
173
230
|
end
|
@@ -184,12 +241,16 @@ module AddonsApi
|
|
184
241
|
end
|
185
242
|
end
|
186
243
|
|
187
|
-
#
|
244
|
+
# Addon
|
188
245
|
class Addon
|
189
246
|
def initialize(client)
|
190
247
|
@client = client
|
191
248
|
end
|
192
249
|
|
250
|
+
def sso(team_id, addon_id, body = {})
|
251
|
+
@sso_resource ||= Sso.new(@client)
|
252
|
+
end
|
253
|
+
|
193
254
|
def action
|
194
255
|
@action_resource ||= Action.new(@client)
|
195
256
|
end
|
@@ -206,56 +267,84 @@ module AddonsApi
|
|
206
267
|
@client.request(:get, "", base_url: callback_url)
|
207
268
|
end
|
208
269
|
|
209
|
-
|
270
|
+
def create(team_id, body = {})
|
271
|
+
@client.request(:post, "#{BASE_PATH}/#{team_id}/addons", body: body)
|
272
|
+
end
|
273
|
+
|
274
|
+
def delete(team_id, addon_id)
|
275
|
+
@client.request(:delete, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}")
|
276
|
+
end
|
277
|
+
|
278
|
+
def update(team_id, addon_id, body = {})
|
279
|
+
@client.request(:patch, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}", body: body)
|
280
|
+
end
|
281
|
+
|
282
|
+
class Sso
|
283
|
+
def initialize(client)
|
284
|
+
@client = client
|
285
|
+
end
|
286
|
+
|
287
|
+
# Get the configuration of an addon.
|
288
|
+
def create(team_id, addon_id)
|
289
|
+
@client.request(:post, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}/sso")
|
290
|
+
end
|
291
|
+
|
292
|
+
# Mark an addon as deprovisioned with callback URL.
|
293
|
+
def create_with_callback_url(callback_url)
|
294
|
+
@client.request(:post, "sso", base_url: callback_url)
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
298
|
+
# Configuration of an Addon
|
210
299
|
class Config
|
211
300
|
def initialize(client)
|
212
301
|
@client = client
|
213
302
|
end
|
214
303
|
|
215
|
-
# Get the configuration of an
|
304
|
+
# Get the configuration of an addon.
|
216
305
|
def list(team_id, addon_id)
|
217
306
|
@client.request(:get, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}/config")
|
218
307
|
end
|
219
308
|
|
220
|
-
# Get the configuration of an
|
309
|
+
# Get the configuration of an addon with callback URL.
|
221
310
|
def list_with_callback_url(callback_url)
|
222
311
|
@client.request(:get, "config", base_url: callback_url)
|
223
312
|
end
|
224
313
|
|
225
|
-
# Update the configuration of an
|
314
|
+
# Update the configuration of an addon.
|
226
315
|
def update(team_id, addon_id, body = {})
|
227
316
|
@client.request(:patch, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}/config", body: body)
|
228
317
|
end
|
229
318
|
|
230
|
-
# Update the configuration of an
|
319
|
+
# Update the configuration of an addon with callback URL.
|
231
320
|
def update_with_callback_url(callback_url, body = {})
|
232
321
|
@client.request(:patch, "config", base_url: callback_url, body: body)
|
233
322
|
end
|
234
323
|
end
|
235
324
|
|
236
|
-
#
|
237
|
-
# They allow
|
325
|
+
# Addon Actions are lifecycle operations for addon provisioning and deprovisioning.
|
326
|
+
# They allow addon providers to (de)provision addons in the background and then report back when (de)provisioning is complete.
|
238
327
|
class Action
|
239
328
|
def initialize(client)
|
240
329
|
@client = client
|
241
330
|
end
|
242
331
|
|
243
|
-
# Mark an
|
332
|
+
# Mark an addon as provisioned.
|
244
333
|
def provision(team_id, addon_id)
|
245
334
|
@client.request(:post, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}/actions/provision")
|
246
335
|
end
|
247
336
|
|
248
|
-
# Mark an
|
337
|
+
# Mark an addon as provisioned with callback URL.
|
249
338
|
def provision_with_callback_url(callback_url)
|
250
339
|
@client.request(:post, "actions/provision", base_url: callback_url)
|
251
340
|
end
|
252
341
|
|
253
|
-
# Mark an
|
342
|
+
# Mark an addon as deprovisioned.
|
254
343
|
def deprovision(team_id, addon_id)
|
255
344
|
@client.request(:post, "#{BASE_PATH}/#{team_id}/addons/#{addon_id}/actions/deprovision")
|
256
345
|
end
|
257
346
|
|
258
|
-
# Mark an
|
347
|
+
# Mark an addon as deprovisioned with callback URL.
|
259
348
|
def deprovision_with_callback_url(callback_url)
|
260
349
|
@client.request(:post, "actions/deprovision", base_url: callback_url)
|
261
350
|
end
|
data/lib/addons-api/version.rb
CHANGED
@@ -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
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- motymichaely
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -129,8 +129,10 @@ executables: []
|
|
129
129
|
extensions: []
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
|
+
- ".github/dependabot.yml"
|
132
133
|
- ".github/workflows/release.yml"
|
133
134
|
- ".gitignore"
|
135
|
+
- ".release-please-manifest.json"
|
134
136
|
- CHANGELOG.md
|
135
137
|
- Gemfile
|
136
138
|
- LICENSE
|
@@ -139,11 +141,12 @@ files:
|
|
139
141
|
- lib/addons-api.rb
|
140
142
|
- lib/addons-api/client.rb
|
141
143
|
- lib/addons-api/version.rb
|
142
|
-
|
144
|
+
- release-please-config.json
|
145
|
+
homepage: https://github.com/addonsio/addons-ruby
|
143
146
|
licenses:
|
144
147
|
- MIT
|
145
148
|
metadata: {}
|
146
|
-
post_install_message:
|
149
|
+
post_install_message:
|
147
150
|
rdoc_options: []
|
148
151
|
require_paths:
|
149
152
|
- lib
|
@@ -158,8 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
161
|
- !ruby/object:Gem::Version
|
159
162
|
version: '0'
|
160
163
|
requirements: []
|
161
|
-
rubygems_version: 3.
|
162
|
-
signing_key:
|
164
|
+
rubygems_version: 3.4.19
|
165
|
+
signing_key:
|
163
166
|
specification_version: 4
|
164
167
|
summary: Ruby HTTP client for the Addons.io API. Learn more on https://addons.io
|
165
168
|
test_files: []
|