postman_mta 0.1.7 → 0.1.8

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
  SHA1:
3
- metadata.gz: fab550588eda2e9d22a008b8acbd4004922fa042
4
- data.tar.gz: 2b28cbeb65d3e81abaef24122bf1228b3b77e0ea
3
+ metadata.gz: d341fea3804eb42f26906de6779b5fd1daa20b22
4
+ data.tar.gz: 3be0bfdacfdfdbe6f0570ae02b4ac0b80673c668
5
5
  SHA512:
6
- metadata.gz: 5bb1c93d360b9dfbf0fdc2169ff5411747fd03e3e74e57eac9d08e3f60a56292ed86573ca9f4369259d8c2098cbaadff7336b503b5ef245828ec4b47137a1e66
7
- data.tar.gz: 8b02e0f717d57da96b8ba2917aba388740a4d8186674ca541956f644c535e62a4046e0ed7a4f4d89051bca501972fe3531c6d1d53ea05655a1248181f7a7cef6
6
+ metadata.gz: 401514dd9720e6b711f260f02bee6b69b3e75e61a440cd3fb0968d627b8797a7d33825db5b284e5c57a9a0ccf040053bd190e71e75ae0476f37f01617060b17c
7
+ data.tar.gz: b7dcf70b5fd288601a7a2b28078e2a695d3f3f6ed9536d824624d6040ae795e47f696af51a6988231e10bcb2ed4881030c0c6acc0314302e059b9375bf965051
@@ -30,6 +30,10 @@ module PostmanMta
30
30
  render conversation.move(permitted_params)
31
31
  end
32
32
 
33
+ def search
34
+ render conversation.search(permitted_params)
35
+ end
36
+
33
37
  private
34
38
 
35
39
  def conversation
@@ -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
@@ -7,7 +7,7 @@ module PostmanMta
7
7
  end
8
8
 
9
9
  def find(uuid)
10
- get("/api/v1/messages/#{message_token}/attachments/#{uuid}")
10
+ get("/messages/#{message_token}/attachments/#{uuid}")
11
11
  end
12
12
  end
13
13
  end
@@ -1,7 +1,7 @@
1
1
  module PostmanMta
2
2
  class Conversation < ApplicationModel
3
3
  def index(params = {})
4
- get('/api/v1/conversations', body: params)
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('/api/v1/conversations', body: params)
12
+ get('/conversations', body: params)
13
13
  end
14
14
 
15
15
  def find(conversation_id)
16
- get("/api/v1/conversations/#{conversation_id}")
16
+ get("/conversations/#{conversation_id}")
17
17
  end
18
18
 
19
19
  def move_to_trash(conversation_id)
20
- delete("/api/v1/conversations/#{conversation_id}/trash")
20
+ delete("/conversations/#{conversation_id}/trash")
21
21
  end
22
22
 
23
23
  def mark_as_read(params = {})
24
- patch('/api/v1/conversations/mark', body: params.merge(event: 'mark_as_read'))
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('/api/v1/conversations/mark', body: params.merge(event: 'mark_as_unread'))
28
+ patch('/conversations/mark', body: params.merge(event: 'mark_as_unread'))
29
29
  end
30
30
 
31
31
  def move(params = {})
32
- patch('/api/v1/conversations/move', body: params)
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,7 +1,7 @@
1
1
  module PostmanMta
2
2
  class Credential < ApplicationModel
3
3
  def create(params = {})
4
- post('/api/v1/credentials', body: params)
4
+ post('/credentials', body: params)
5
5
  end
6
6
  end
7
7
  end
@@ -1,15 +1,15 @@
1
1
  module PostmanMta
2
2
  class Domain < ApplicationModel
3
- def index
4
- get('/api/v1/domains')
3
+ def index(params = {})
4
+ get('/domains', body: params)
5
5
  end
6
6
 
7
7
  def create(params = {})
8
- post('/api/v1/domains', body: params)
8
+ post('/domains', body: params)
9
9
  end
10
10
 
11
11
  def dns_setup(uuid)
12
- put("/api/v1/domains/#{uuid}/dns_setup")
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("/api/v1/conversations/#{conversation_id}/labels", body: params)
10
+ post("/conversations/#{conversation_id}/labels", body: params)
11
11
  end
12
12
 
13
13
  def destroy(label_id)
14
- delete("/api/v1/conversations/#{conversation_id}/labels/#{label_id}")
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("/api/v1/messages/#{token}")
4
+ get("/messages/#{token}")
5
5
  end
6
6
 
7
7
  def create(params)
8
- post('/api/v1/messages', body: params)
8
+ post('/messages', body: params)
9
9
  end
10
10
 
11
11
  def unread_stats
12
- get('/api/v1/stats/messages/unread')
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('/api/v1/routes')
4
+ get('/routes')
5
5
  end
6
6
 
7
7
  def update(uuid, params = {})
8
- patch("/api/v1/routes/#{uuid}", body: params)
8
+ patch("/routes/#{uuid}", body: params)
9
9
  end
10
10
 
11
11
  def create(params = {})
12
- post('/api/v1/routes', body: params)
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("/api/v1/conversations/#{conversation_id}/tags", body: params)
10
+ post("/conversations/#{conversation_id}/tags", body: params)
11
11
  end
12
12
 
13
13
  def destroy(tag_id)
14
- delete("/api/v1/conversations/#{conversation_id}/tags/#{tag_id}")
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: path).headers
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PostmanMta
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
5
  end
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.7
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: 2017-11-28 00:00:00.000000000 Z
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