trycourier 1.8.0 → 1.10.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/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/lib/trycourier/accounts.rb +3 -3
- data/lib/trycourier/auth_tokens.rb +23 -0
- data/lib/trycourier/version.rb +1 -1
- data/lib/trycourier.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '089c3ec08d35a88714c7239750f52b04510621ac610fadd1f0300a98428782d1'
|
|
4
|
+
data.tar.gz: 231cfe02a735c4d7610b7d4d9387b1a477cd3a9fda6baa6565ebd14e99c938f4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f921d25a4bc68cf362452e21ff0fdb988dce785999004669d04c220934ffe5a8ba7facaaf9b9e2f241475395d858660489cf42ad1b73314be572c7e8490a9af7
|
|
7
|
+
data.tar.gz: 84b331bbce3ea0d2de84ee423166440cdc61efbdc26ed8fff6788b71440763233766c8526fe909e8d1c942767d718b8b22df4e0807215ff9740f0fc79c3ec320
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ 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
|
+
|
|
12
|
+
## [v1.9.0] - 2023-07-31
|
|
13
|
+
|
|
14
|
+
- Add pagination attributes for accounts API
|
|
15
|
+
|
|
8
16
|
## [v1.8.0] - 2023-07-24
|
|
9
17
|
|
|
10
18
|
- Support for Accounts API
|
data/Gemfile.lock
CHANGED
data/lib/trycourier/accounts.rb
CHANGED
|
@@ -12,14 +12,14 @@ module Courier
|
|
|
12
12
|
ErrorHandler.check_err(res)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def get_accounts(limit: nil,
|
|
15
|
+
def get_accounts(limit: nil, cursor: nil)
|
|
16
16
|
params = {}
|
|
17
17
|
if limit
|
|
18
18
|
params["limit"] = limit
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
if
|
|
22
|
-
params["
|
|
21
|
+
if cursor
|
|
22
|
+
params["cursor"] = cursor
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
res = @session.send(KEY, "GET", params: params)
|
|
@@ -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
|
data/lib/trycourier/version.rb
CHANGED
data/lib/trycourier.rb
CHANGED
|
@@ -9,6 +9,7 @@ require "trycourier/bulk"
|
|
|
9
9
|
require "trycourier/audiences"
|
|
10
10
|
require "trycourier/audit_events"
|
|
11
11
|
require "trycourier/accounts"
|
|
12
|
+
require "trycourier/auth_tokens"
|
|
12
13
|
require "trycourier/version"
|
|
13
14
|
require "trycourier/exceptions"
|
|
14
15
|
|
|
@@ -69,6 +70,7 @@ module Courier
|
|
|
69
70
|
@audiences = Courier::Audiences.new(@session)
|
|
70
71
|
@audit_events = Courier::AuditEvents.new(@session)
|
|
71
72
|
@accounts = Courier::Accounts.new(@session)
|
|
73
|
+
@auth_tokens = Courier::AuthTokens.new(@session)
|
|
72
74
|
end
|
|
73
75
|
|
|
74
76
|
def send(body)
|
|
@@ -143,5 +145,7 @@ module Courier
|
|
|
143
145
|
|
|
144
146
|
attr_reader :accounts
|
|
145
147
|
|
|
148
|
+
attr_reader :auth_tokens
|
|
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.
|
|
4
|
+
version: 1.10.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-
|
|
11
|
+
date: 2023-08-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|
|
@@ -64,6 +64,7 @@ files:
|
|
|
64
64
|
- lib/trycourier/accounts.rb
|
|
65
65
|
- lib/trycourier/audiences.rb
|
|
66
66
|
- lib/trycourier/audit_events.rb
|
|
67
|
+
- lib/trycourier/auth_tokens.rb
|
|
67
68
|
- lib/trycourier/automations.rb
|
|
68
69
|
- lib/trycourier/brands.rb
|
|
69
70
|
- lib/trycourier/bulk.rb
|