trycourier 1.9.0 → 2.0.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: 0fe5b54e08b1376178ef2318cfb1e96e0fe0d428fcc38ff40773506cadbb4098
4
- data.tar.gz: 657fa9076d6a2fa31c366b24e3c4633237bd99ea535ee903b22de3d4028fcd4b
3
+ metadata.gz: ed06b560fed0c9881240f285a4d5cbcb173a0f4e39bf1c7f02d6a21f0a49e063
4
+ data.tar.gz: 4a1ff4327690053cbe006031adddcab34c35dd2fe793c377199cd2f28e779ba7
5
5
  SHA512:
6
- metadata.gz: e085fc93ceb2d9654f308ba292b69891f49e183dcfa7a514387a638a2277033a797a60a8b5fd045697d6db5059ed3e8a4315da21c53a98fcd236aeacbd10571c
7
- data.tar.gz: 80f44b367ae7019789a0a49fc9a05cdda8e06bf6c70400a30171b80b5472ca6292c10333c367c446d5c75860146876a943c61c1d85bb5caeed8a9207f422f95c
6
+ metadata.gz: 017c2f33d4f3157e9caaa5f05005ee69f7a5f4c5f6742e79c366a2075a343233dcb5483b2882748585a1738ca60c22bd79b6ff2f064e9280981e5e5bb2cbaaa9
7
+ data.tar.gz: ac4c4ffa940d694f87806ba01d59d1c5dfa4097e6e17a02250469735609fb0eda54558bc864d19d22d793b1331e7d7a1314a301d6717ff564f5e0a65a4323d9c
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased][unreleased]
7
7
 
8
+ ## [v1.10.0] - 2023-08-02
9
+
10
+ - Add auth tokens API
11
+
8
12
  ## [v1.9.0] - 2023-07-31
9
13
 
10
14
  - Add pagination attributes for accounts API
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trycourier (1.9.0)
4
+ trycourier (2.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,23 @@
1
+ module Courier
2
+ class AuthTokens
3
+ KEY = "/auth"
4
+
5
+ def initialize(session)
6
+ @session = session
7
+ end
8
+
9
+ def issue_token(scope:, expires_in: nil, data: nil, profile: nil, recipient: nil, template: nil)
10
+ path = "#{KEY}/issue-token"
11
+ payload = {
12
+ "scope": scope
13
+ }
14
+
15
+ if expires_in
16
+ payload["expires_in"] = expires_in
17
+ end
18
+
19
+ res = @session.send(path, "POST", body: payload, headers: {})
20
+ ErrorHandler.check_err(res)
21
+ end
22
+ end
23
+ end
@@ -1,18 +1,18 @@
1
1
  module Courier
2
- class Accounts
3
- KEY = "/accounts"
2
+ class Tenants
3
+ KEY = "/tenants"
4
4
 
5
5
  def initialize(session)
6
6
  @session = session
7
7
  end
8
8
 
9
- def get_account(account_id:)
10
- path = "#{KEY}/#{account_id}"
9
+ def get_tenant(tenant_id:)
10
+ path = "#{KEY}/#{tenant_id}"
11
11
  res = @session.send(path, "GET")
12
12
  ErrorHandler.check_err(res)
13
13
  end
14
14
 
15
- def get_accounts(limit: nil, cursor: nil)
15
+ def get_tenants(limit: nil, cursor: nil)
16
16
  params = {}
17
17
  if limit
18
18
  params["limit"] = limit
@@ -26,15 +26,15 @@ module Courier
26
26
  ErrorHandler.check_err(res)
27
27
  end
28
28
 
29
- def put_account(account_id:, account:)
30
- path = "#{KEY}/#{account_id}"
29
+ def put_tenant(tenant_id:, tenant:)
30
+ path = "#{KEY}/#{tenant_id}"
31
31
 
32
- res = @session.send(path, "PUT", body: account, headers: {})
32
+ res = @session.send(path, "PUT", body: tenant, headers: {})
33
33
  ErrorHandler.check_err(res)
34
34
  end
35
35
 
36
- def delete_account(account_id:)
37
- path = "#{KEY}/#{account_id}"
36
+ def delete_tenant(tenant_id:)
37
+ path = "#{KEY}/#{tenant_id}"
38
38
  res = @session.send(path, "DELETE")
39
39
  ErrorHandler.check_err_non_json(res)
40
40
  end
@@ -1,3 +1,3 @@
1
1
  module Courier
2
- VERSION = "1.9.0"
2
+ VERSION = "2.0.0"
3
3
  end
data/lib/trycourier.rb CHANGED
@@ -8,7 +8,8 @@ require "trycourier/automations"
8
8
  require "trycourier/bulk"
9
9
  require "trycourier/audiences"
10
10
  require "trycourier/audit_events"
11
- require "trycourier/accounts"
11
+ require "trycourier/tenants"
12
+ require "trycourier/auth_tokens"
12
13
  require "trycourier/version"
13
14
  require "trycourier/exceptions"
14
15
 
@@ -68,7 +69,8 @@ module Courier
68
69
  @bulk = Courier::Bulk.new(@session)
69
70
  @audiences = Courier::Audiences.new(@session)
70
71
  @audit_events = Courier::AuditEvents.new(@session)
71
- @accounts = Courier::Accounts.new(@session)
72
+ @tenants = Courier::Tenants.new(@session)
73
+ @auth_tokens = Courier::AuthTokens.new(@session)
72
74
  end
73
75
 
74
76
  def send(body)
@@ -141,7 +143,9 @@ module Courier
141
143
 
142
144
  attr_reader :audit_events
143
145
 
144
- attr_reader :accounts
146
+ attr_reader :tenants
147
+
148
+ attr_reader :auth_tokens
145
149
 
146
150
  end
147
151
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trycourier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Courier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-31 00:00:00.000000000 Z
11
+ date: 2023-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -61,9 +61,9 @@ files:
61
61
  - bin/console
62
62
  - bin/setup
63
63
  - lib/trycourier.rb
64
- - lib/trycourier/accounts.rb
65
64
  - lib/trycourier/audiences.rb
66
65
  - lib/trycourier/audit_events.rb
66
+ - lib/trycourier/auth_tokens.rb
67
67
  - lib/trycourier/automations.rb
68
68
  - lib/trycourier/brands.rb
69
69
  - lib/trycourier/bulk.rb
@@ -73,6 +73,7 @@ files:
73
73
  - lib/trycourier/messages.rb
74
74
  - lib/trycourier/profiles.rb
75
75
  - lib/trycourier/session.rb
76
+ - lib/trycourier/tenants.rb
76
77
  - lib/trycourier/version.rb
77
78
  - trycourier.gemspec
78
79
  homepage: https://github.com/trycourier/courier-ruby