postman_mta 0.1.7 → 0.1.8
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/app/controllers/postman_mta/conversations_controller.rb +4 -0
- data/app/controllers/postman_mta/domains_controller.rb +17 -0
- data/app/models/postman_mta/attachment.rb +1 -1
- data/app/models/postman_mta/conversation.rb +11 -7
- data/app/models/postman_mta/credential.rb +1 -1
- data/app/models/postman_mta/domain.rb +4 -4
- data/app/models/postman_mta/label.rb +2 -2
- data/app/models/postman_mta/message.rb +3 -3
- data/app/models/postman_mta/route.rb +3 -3
- data/app/models/postman_mta/tag.rb +2 -2
- data/config/routes.rb +2 -0
- data/lib/postman_mta/api_request.rb +9 -1
- data/lib/postman_mta/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d341fea3804eb42f26906de6779b5fd1daa20b22
|
4
|
+
data.tar.gz: 3be0bfdacfdfdbe6f0570ae02b4ac0b80673c668
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 401514dd9720e6b711f260f02bee6b69b3e75e61a440cd3fb0968d627b8797a7d33825db5b284e5c57a9a0ccf040053bd190e71e75ae0476f37f01617060b17c
|
7
|
+
data.tar.gz: b7dcf70b5fd288601a7a2b28078e2a695d3f3f6ed9536d824624d6040ae795e47f696af51a6988231e10bcb2ed4881030c0c6acc0314302e059b9375bf965051
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module PostmanMta
|
2
|
+
class DomainsController < ApplicationController
|
3
|
+
def index
|
4
|
+
render domain.index(permitted_params)
|
5
|
+
end
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def domain
|
10
|
+
@domain ||= PostmanMta::Domain.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def permitted_params
|
14
|
+
params.permit!
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module PostmanMta
|
2
2
|
class Conversation < ApplicationModel
|
3
3
|
def index(params = {})
|
4
|
-
get('/
|
4
|
+
get('/conversations', body: params)
|
5
5
|
end
|
6
6
|
|
7
7
|
def folder(folder, params = {})
|
@@ -9,27 +9,31 @@ module PostmanMta
|
|
9
9
|
folder: folder
|
10
10
|
}.merge(params)
|
11
11
|
|
12
|
-
get('/
|
12
|
+
get('/conversations', body: params)
|
13
13
|
end
|
14
14
|
|
15
15
|
def find(conversation_id)
|
16
|
-
get("/
|
16
|
+
get("/conversations/#{conversation_id}")
|
17
17
|
end
|
18
18
|
|
19
19
|
def move_to_trash(conversation_id)
|
20
|
-
delete("/
|
20
|
+
delete("/conversations/#{conversation_id}/trash")
|
21
21
|
end
|
22
22
|
|
23
23
|
def mark_as_read(params = {})
|
24
|
-
patch('/
|
24
|
+
patch('/conversations/mark', body: params.merge(event: 'mark_as_read'))
|
25
25
|
end
|
26
26
|
|
27
27
|
def mark_as_unread(params = {})
|
28
|
-
patch('/
|
28
|
+
patch('/conversations/mark', body: params.merge(event: 'mark_as_unread'))
|
29
29
|
end
|
30
30
|
|
31
31
|
def move(params = {})
|
32
|
-
patch('/
|
32
|
+
patch('/conversations/move', body: params)
|
33
|
+
end
|
34
|
+
|
35
|
+
def search(params = {})
|
36
|
+
get('/search/conversations', body: params)
|
33
37
|
end
|
34
38
|
end
|
35
39
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module PostmanMta
|
2
2
|
class Domain < ApplicationModel
|
3
|
-
def index
|
4
|
-
get('/
|
3
|
+
def index(params = {})
|
4
|
+
get('/domains', body: params)
|
5
5
|
end
|
6
6
|
|
7
7
|
def create(params = {})
|
8
|
-
post('/
|
8
|
+
post('/domains', body: params)
|
9
9
|
end
|
10
10
|
|
11
11
|
def dns_setup(uuid)
|
12
|
-
put("/
|
12
|
+
put("/domains/#{uuid}/dns_setup")
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -7,11 +7,11 @@ module PostmanMta
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def create(params)
|
10
|
-
post("/
|
10
|
+
post("/conversations/#{conversation_id}/labels", body: params)
|
11
11
|
end
|
12
12
|
|
13
13
|
def destroy(label_id)
|
14
|
-
delete("/
|
14
|
+
delete("/conversations/#{conversation_id}/labels/#{label_id}")
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module PostmanMta
|
2
2
|
class Message < ApplicationModel
|
3
3
|
def find(token)
|
4
|
-
get("/
|
4
|
+
get("/messages/#{token}")
|
5
5
|
end
|
6
6
|
|
7
7
|
def create(params)
|
8
|
-
post('/
|
8
|
+
post('/messages', body: params)
|
9
9
|
end
|
10
10
|
|
11
11
|
def unread_stats
|
12
|
-
get('/
|
12
|
+
get('/stats/messages/unread')
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module PostmanMta
|
2
2
|
class Route < ApplicationModel
|
3
3
|
def index
|
4
|
-
get('/
|
4
|
+
get('/routes')
|
5
5
|
end
|
6
6
|
|
7
7
|
def update(uuid, params = {})
|
8
|
-
patch("/
|
8
|
+
patch("/routes/#{uuid}", body: params)
|
9
9
|
end
|
10
10
|
|
11
11
|
def create(params = {})
|
12
|
-
post('/
|
12
|
+
post('/routes', body: params)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -7,11 +7,11 @@ module PostmanMta
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def create(params)
|
10
|
-
post("/
|
10
|
+
post("/conversations/#{conversation_id}/tags", body: params)
|
11
11
|
end
|
12
12
|
|
13
13
|
def destroy(tag_id)
|
14
|
-
delete("/
|
14
|
+
delete("/conversations/#{conversation_id}/tags/#{tag_id}")
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
data/config/routes.rb
CHANGED
@@ -9,6 +9,7 @@ PostmanMta::Engine.routes.draw do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
match :starred, on: :collection, via: :get, to: 'conversations#index'
|
12
|
+
match :search, on: :collection, via: :get
|
12
13
|
match :read, on: :collection, via: [:put, :patch]
|
13
14
|
match :unread, on: :collection, via: [:put, :patch]
|
14
15
|
match :move, on: :collection, via: [:put, :patch]
|
@@ -24,4 +25,5 @@ PostmanMta::Engine.routes.draw do
|
|
24
25
|
end
|
25
26
|
|
26
27
|
resources :routes, only: :index
|
28
|
+
resources :domains, only: :index
|
27
29
|
end
|
@@ -19,6 +19,14 @@ module PostmanMta
|
|
19
19
|
self.class.send(request_type.downcase, path, request_options)
|
20
20
|
end
|
21
21
|
|
22
|
+
def full_path
|
23
|
+
@full_path ||= PostmanMta.api_endpoint + path
|
24
|
+
end
|
25
|
+
|
26
|
+
def uri
|
27
|
+
@uri ||= URI(full_path)
|
28
|
+
end
|
29
|
+
|
22
30
|
private
|
23
31
|
|
24
32
|
def request_options
|
@@ -26,7 +34,7 @@ module PostmanMta
|
|
26
34
|
end
|
27
35
|
|
28
36
|
def auth_headers
|
29
|
-
PostmanMta::Utils::SignedRequest.new(request_method: request_type.upcase, path:
|
37
|
+
PostmanMta::Utils::SignedRequest.new(request_method: request_type.upcase, path: uri.request_uri).headers
|
30
38
|
end
|
31
39
|
|
32
40
|
def merge_with_custom_options
|
data/lib/postman_mta/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postman_mta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Malinovskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- app/controllers/postman_mta/application_controller.rb
|
122
122
|
- app/controllers/postman_mta/attachments_controller.rb
|
123
123
|
- app/controllers/postman_mta/conversations_controller.rb
|
124
|
+
- app/controllers/postman_mta/domains_controller.rb
|
124
125
|
- app/controllers/postman_mta/labels_controller.rb
|
125
126
|
- app/controllers/postman_mta/messages_controller.rb
|
126
127
|
- app/controllers/postman_mta/routes_controller.rb
|