sendgrid_webapi 0.1.2 → 0.2.1
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/.gitignore +0 -0
- data/.rspec +0 -0
- data/.ruby-version +0 -0
- data/.tekton/Chart.lock +6 -0
- data/.tekton/Chart.yaml +14 -0
- data/.tekton/templates/pipelinerun.yaml +53 -0
- data/.tekton/values-main.yaml +14 -0
- data/.tekton/values-pr.yaml +8 -0
- data/.tekton/values.yaml +19 -0
- data/.tool-versions +0 -0
- data/Gemfile +0 -0
- data/MIT-LICENSE +0 -0
- data/README.rdoc +69 -20
- data/Rakefile +0 -0
- data/lib/api_key/management.rb +0 -0
- data/lib/api_key/modules.rb +0 -0
- data/lib/apikey_client.rb +0 -0
- data/lib/base.rb +7 -0
- data/lib/helper.rb +0 -0
- data/lib/middlewares/sendgrid_response.rb +0 -0
- data/lib/sendgrid_webapi.rb +0 -0
- data/lib/sub_user/apps.rb +0 -0
- data/lib/sub_user/auth.rb +0 -0
- data/lib/sub_user/bounces.rb +0 -0
- data/lib/sub_user/event_notification.rb +0 -0
- data/lib/sub_user/iframe.rb +0 -0
- data/lib/sub_user/invalid_emails.rb +0 -0
- data/lib/sub_user/ip_management.rb +0 -0
- data/lib/sub_user/limits.rb +0 -0
- data/lib/sub_user/management.rb +0 -0
- data/lib/sub_user/modules.rb +0 -0
- data/lib/sub_user/monitor_records.rb +0 -0
- data/lib/sub_user/parse.rb +0 -0
- data/lib/sub_user/spam.rb +0 -0
- data/lib/sub_user/stats.rb +0 -0
- data/lib/sub_user/unsubscribes.rb +0 -0
- data/lib/sub_user/white_label.rb +0 -0
- data/lib/subuser_client.rb +0 -0
- data/lib/version.rb +1 -1
- data/lib/web_api/address_whitelist.rb +24 -0
- data/lib/web_api/blocks.rb +20 -7
- data/lib/web_api/bounces.rb +19 -6
- data/lib/web_api/event_notification.rb +0 -0
- data/lib/web_api/invalid_emails.rb +15 -5
- data/lib/web_api/mail.rb +0 -0
- data/lib/web_api/modules.rb +5 -1
- data/lib/web_api/parse.rb +0 -0
- data/lib/web_api/profile.rb +0 -0
- data/lib/web_api/spam.rb +14 -4
- data/lib/web_api/stats.rb +0 -0
- data/lib/web_api/unsubscribes.rb +19 -6
- data/lib/web_api/version.rb +0 -0
- data/lib/webapi_client.rb +0 -0
- data/sendgrid_webapi.gemspec +0 -0
- data/spec/cassettes/client/_modules/_address_whitelist/should_add_email_to_whitelist.yml +36 -0
- data/spec/cassettes/client/_modules/_address_whitelist/should_delete_email_from_whitelist.yml +36 -0
- data/spec/cassettes/client/_modules/_address_whitelist/should_get_address_whitelist.yml +36 -0
- data/spec/cassettes/client/_modules/_block/should_get_block_emails.yml +33 -33
- data/spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml +33 -33
- data/spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml +33 -33
- data/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml +33 -33
- data/spec/cassettes/client/_modules/_bounce/should_get_bounce_emails_using_params.yml +36 -0
- data/spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml +0 -0
- data/spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml +33 -33
- data/spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml +0 -0
- data/spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml +0 -0
- data/spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml +0 -0
- data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml +33 -33
- data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_emails_using_params.yml +37 -0
- data/spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_using_params.yml +36 -0
- data/spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml +33 -33
- data/spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml +0 -0
- data/spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml +0 -0
- data/spec/cassettes/client/_modules/_parse_email/should_set_parse_email.yml +0 -0
- data/spec/cassettes/client/_modules/_profile/should_get_profile.yml +0 -0
- data/spec/cassettes/client/_modules/_profile/should_set_first_name.yml +0 -0
- data/spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml +33 -33
- data/spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml +33 -33
- data/spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml +33 -33
- data/spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml +33 -33
- data/spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml +33 -33
- data/spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml +33 -33
- data/spec/cassettes/helper/_create_sub_user_account/should_create_sub_user_account.yml +0 -0
- data/spec/cassettes/helper/_run_sendgrid_query/should_raise_with_unsucessfull_request.yml +0 -0
- data/spec/cassettes/helper/_run_sendgrid_query/should_run_sendgrid_request.yml +0 -0
- data/spec/cassettes/sub_user/_apps/should_activate_app.yml +0 -0
- data/spec/cassettes/sub_user/_apps/should_deactivate_app.yml +0 -0
- data/spec/cassettes/sub_user/_apps/should_get_current_setting_from_one_app.yml +0 -0
- data/spec/cassettes/sub_user/_apps/should_return_available_apps.yml +0 -0
- data/spec/cassettes/sub_user/_apps/should_set_current_app.yml +0 -0
- data/spec/cassettes/sub_user/_authentication/should_auth_a_sub_user.yml +0 -0
- data/spec/cassettes/sub_user/_authentication/should_return_error_with_a_bad_sub_user.yml +0 -0
- data/spec/cassettes/sub_user/_bounces/should_returns_bounce_emails.yml +0 -0
- data/spec/cassettes/sub_user/_bounces/should_tries_to_delete_unexisting_bounce_emails.yml +0 -0
- data/spec/cassettes/sub_user/_event_notification/should_add_event_notification_url.yml +0 -0
- data/spec/cassettes/sub_user/_event_notification/should_delete_event_notification_url.yml +0 -0
- data/spec/cassettes/sub_user/_event_notification/should_get_event_notification_url.yml +0 -0
- data/spec/cassettes/sub_user/_invalid_emails/should_return_invalid_emails.yml +0 -0
- data/spec/cassettes/sub_user/_invalid_emails/should_tries_to_delete_unexisting_invalid_mail.yml +0 -0
- data/spec/cassettes/sub_user/_ip_management/should_return_all_ips_available.yml +0 -0
- data/spec/cassettes/sub_user/_ip_management/should_show_ip_subuser.yml +0 -0
- data/spec/cassettes/sub_user/_limits/should_decrements_credits_for_a_sub_user.yml +0 -0
- data/spec/cassettes/sub_user/_limits/should_delete_all_limits_for_a_sub_user.yml +0 -0
- data/spec/cassettes/sub_user/_limits/should_increments_credits_for_a_sub_user.yml +0 -0
- data/spec/cassettes/sub_user/_limits/should_list_the_limits_for_a_sub_user.yml +0 -0
- data/spec/cassettes/sub_user/_limits/should_reset_all_limits_for_a_sub_user.yml +0 -0
- data/spec/cassettes/sub_user/_limits/should_returns_limits_for_a_sub_user.yml +0 -0
- data/spec/cassettes/sub_user/_limits/should_set_total_credits.yml +0 -0
- data/spec/cassettes/sub_user/_management/should_add_new_subuser.yml +0 -0
- data/spec/cassettes/sub_user/_management/should_disable_sub_user_for_send_email.yml +0 -0
- data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_access_to_website.yml +0 -0
- data/spec/cassettes/sub_user/_management/should_enable_sub_user_for_send_email.yml +0 -0
- data/spec/cassettes/sub_user/_management/should_update_sub_user.yml +0 -0
- data/spec/cassettes/sub_user/_monitor_records/should_add_existing_sub_user_to_monitor_record.yml +0 -0
- data/spec/cassettes/sub_user/_monitor_records/should_create_a_new_monitor_record.yml +0 -0
- data/spec/cassettes/sub_user/_monitor_records/should_delete_a_monitor_record.yml +0 -0
- data/spec/cassettes/sub_user/_monitor_records/should_edit_a_monitor_record.yml +0 -0
- data/spec/cassettes/sub_user/_monitor_records/should_remove_existing_sub_user_from_monitor_record.yml +0 -0
- data/spec/cassettes/sub_user/_parse_email/should_delete_parse_email.yml +0 -0
- data/spec/cassettes/sub_user/_parse_email/should_get_parse_email.yml +0 -0
- data/spec/cassettes/sub_user/_parse_email/should_set_parse_email.yml +0 -0
- data/spec/cassettes/sub_user/_spam/should_return_spam_mails.yml +0 -0
- data/spec/cassettes/sub_user/_spam/should_tries_to_delete_unexisting_spam_mail.yml +0 -0
- data/spec/cassettes/sub_user/_unsubscribes/should_add_bounce_email.yml +0 -0
- data/spec/cassettes/sub_user/_unsubscribes/should_delete_existing_bounce_email.yml +0 -0
- data/spec/cassettes/sub_user/_unsubscribes/should_delete_unexisting_bounce_email.yml +0 -0
- data/spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml +0 -0
- data/spec/client_spec.rb +85 -52
- data/spec/helper_spec.rb +2 -3
- data/spec/internal/config/database-standard.yml +24 -0
- data/spec/spec_helper.rb +0 -4
- data/spec/sub_user_spec.rb +0 -0
- data/test.rb +0 -0
- metadata +21 -80
- data/.circleci/config.yml +0 -132
- data/.circleci/setup-rubygems.sh +0 -5
data/spec/client_spec.rb
CHANGED
@@ -6,128 +6,161 @@ describe "client" do
|
|
6
6
|
|
7
7
|
describe "#base", :vcr do
|
8
8
|
it "should return api url" do
|
9
|
-
client.base_url.
|
9
|
+
expect(client.base_url).to eql "https://api.sendgrid.com/api/"
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
it "should return request url" do
|
13
|
-
client.make_request_url("blocks.get.json", {:data => 1}).
|
14
|
-
|
13
|
+
expect(client.make_request_url("blocks.get.json", {:data => 1})).
|
14
|
+
to eql "blocks.get.json?data=1"
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
it "should convert hash to url params" do
|
18
|
-
client.to_query({:value_one => "foo_one", :value_two => "foo_two"}).
|
19
|
-
|
18
|
+
expect(client.to_query({:value_one => "foo_one", :value_two => "foo_two"})).
|
19
|
+
to eql "value_one=foo_one&value_two=foo_two"
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
describe "#modules", :vcr do
|
24
|
+
describe "#address_whitelist", :vcr do
|
25
|
+
it "should get address whitelist" do
|
26
|
+
response = client.address_whitelist.get
|
27
|
+
expect(response["list"]).to eql ["test@example.com", "test2@example.com"]
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should add email to whitelist" do
|
31
|
+
response = client.address_whitelist.add({ list: ["new@example.com"] })
|
32
|
+
expect(response["list"]).to include("new@example.com")
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should delete email from whitelist" do
|
36
|
+
response = client.address_whitelist.delete({ email: "test2@example.com" })
|
37
|
+
expect(response["list"]).not_to include("test2@example.com")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
24
41
|
describe "#block" do
|
25
42
|
it "should get block emails" do
|
26
|
-
client.blocks.get.
|
43
|
+
expect(client.blocks.get).to eql []
|
27
44
|
end
|
45
|
+
|
28
46
|
it "should try delete not existing block email" do
|
29
|
-
client.blocks.delete(:
|
47
|
+
expect(client.blocks.delete({email: "test@example.com"})).to eql ({"message"=>"Email does not exist"})
|
30
48
|
end
|
49
|
+
|
31
50
|
it "should get totals blocks" do
|
32
|
-
client.blocks.count.
|
51
|
+
expect(client.blocks.count).to eql({:count=>0})
|
33
52
|
end
|
34
53
|
end
|
35
54
|
|
36
55
|
describe "#bounce", :vcr do
|
37
56
|
it "should get bounce emails" do
|
38
|
-
client.bounces.get.
|
57
|
+
expect(client.bounces.get).to eql []
|
39
58
|
end
|
59
|
+
|
60
|
+
it "should get bounce emails using params" do
|
61
|
+
expect(client.bounces.get({limit: 2, offset: 1}).count).to eql 2
|
62
|
+
end
|
63
|
+
|
40
64
|
it "should try delete not existing bounce email" do
|
41
|
-
client.bounces.delete(:
|
65
|
+
expect(client.bounces.delete({email: "test@example.com"})).to eql ({"message"=>"Email does not exist"})
|
42
66
|
end
|
43
67
|
end
|
44
68
|
|
45
69
|
describe "#invalid_email", :vcr do
|
46
70
|
it "should get invalid emails" do
|
47
|
-
client.invalid_emails.get.
|
71
|
+
expect(client.invalid_emails.get).to eql []
|
48
72
|
end
|
73
|
+
|
74
|
+
it "should get invalid emails using params" do
|
75
|
+
expect(client.invalid_emails.get({limit: 3, offset: 2}).count).to eql 3
|
76
|
+
end
|
77
|
+
|
49
78
|
it "should try delete not existing invalid emails" do
|
50
|
-
client.invalid_emails.delete(:email => "test@example.com").
|
79
|
+
expect(client.invalid_emails.delete(:email => "test@example.com")).to eql ({"message"=>"Email does not exist"})
|
51
80
|
end
|
52
81
|
end
|
53
82
|
|
54
83
|
describe "#spam" do
|
55
84
|
it "should get spam emails", :vcr do
|
56
|
-
client.spam.get.
|
85
|
+
expect(client.spam.get).to eql []
|
57
86
|
end
|
87
|
+
|
58
88
|
it "should try delete not existing spam emails" do
|
59
|
-
client.spam.delete(:email => "test@example.com").
|
89
|
+
expect(client.spam.delete({:email => "test@example.com"})).to eql ({"message"=>"Email does not exist"})
|
60
90
|
end
|
61
91
|
end
|
62
92
|
|
63
93
|
describe "#unsubscribe", :vcr do
|
64
94
|
it "should add unsubscribe emails" do
|
65
|
-
client.unsubscribes.add(:
|
66
|
-
|
95
|
+
expect(client.unsubscribes.add({recipient_emails: ["test@example.com"]})).
|
96
|
+
to eql ({"message"=>"success"})
|
67
97
|
end
|
98
|
+
|
68
99
|
it "should get unsubscribe emails" do
|
69
|
-
client.unsubscribes.get.
|
70
|
-
|
100
|
+
expect(client.unsubscribes.get).
|
101
|
+
to eql [{"email"=>"test@example.com"}]
|
71
102
|
end
|
103
|
+
|
72
104
|
it "should delete unsubscribe email" do
|
73
|
-
client.unsubscribes.delete(:email => "test@example.com").
|
74
|
-
|
105
|
+
expect(client.unsubscribes.delete(:email => "test@example.com")).
|
106
|
+
to eql ({"message"=>"success"})
|
75
107
|
end
|
108
|
+
|
76
109
|
it "should try delete not existing unsubscribe emails" do
|
77
|
-
client.unsubscribes.delete(:
|
78
|
-
|
110
|
+
expect(client.unsubscribes.delete({email: "test@example.com"})).
|
111
|
+
to eql ({"errors" => [{"field"=>"null", "message"=>"resource not found"}]})
|
79
112
|
end
|
80
113
|
end
|
81
|
-
|
114
|
+
|
82
115
|
describe "#parse_email", :vcr do
|
83
116
|
it "should set parse email" do
|
84
|
-
client.parse_email.set(:hostname => "www.example.com", :url => "www.mydomain.com/parse.php", :spam_check => "1").
|
85
|
-
|
117
|
+
expect(client.parse_email.set(:hostname => "www.example.com", :url => "www.mydomain.com/parse.php", :spam_check => "1")).
|
118
|
+
to eql ({"message"=>"success"})
|
86
119
|
end
|
87
|
-
|
120
|
+
|
88
121
|
it "should get parse email", :vcr do
|
89
|
-
client.parse_email.get.
|
90
|
-
|
122
|
+
expect(client.parse_email.get).
|
123
|
+
to eql ({"parse"=>[{"hostname"=>"www.example.com", "url"=>"www.mydomain.com/parse.php", "spam_check"=>1}]})
|
91
124
|
end
|
92
|
-
|
125
|
+
|
93
126
|
it "should delete parse email", :vcr do
|
94
|
-
client.parse_email.delete(:hostname => "www.example.com").
|
95
|
-
|
96
|
-
client.parse_email.get.
|
97
|
-
|
127
|
+
expect(client.parse_email.delete(:hostname => "www.example.com")).
|
128
|
+
to eql ({"message"=>"success"})
|
129
|
+
expect(client.parse_email.get).
|
130
|
+
to eql ({"parse" => []})
|
98
131
|
end
|
99
132
|
end
|
100
133
|
|
101
134
|
describe "#event_notification", :vcr do
|
102
135
|
it "should set event notification url" do
|
103
|
-
client.event_notification.set(:url => "http://www.yourposturlhere.com").
|
104
|
-
|
136
|
+
expect(client.event_notification.set(:url => "http://www.yourposturlhere.com")).
|
137
|
+
to eql ({"message"=>"success"})
|
105
138
|
end
|
106
|
-
|
139
|
+
|
107
140
|
it "should get event notification url" do
|
108
|
-
client.event_notification.get.
|
109
|
-
|
141
|
+
expect(client.event_notification.get).
|
142
|
+
to eql ([{"url" => "http:\/\/www.yourposturlhere.com"}])
|
110
143
|
end
|
111
|
-
|
144
|
+
|
112
145
|
it "should delete event notification url" do
|
113
|
-
client.event_notification.delete.
|
114
|
-
|
146
|
+
expect(client.event_notification.delete).
|
147
|
+
to eql ({"message"=>"success"})
|
115
148
|
end
|
116
149
|
end
|
117
150
|
|
118
151
|
describe "#profile", :vcr do
|
119
152
|
it "should get profile" do
|
120
|
-
client.profile.get.
|
121
|
-
|
153
|
+
expect(client.profile.get).
|
154
|
+
to eql ([{"username"=>"user", "email"=>"user", "active"=>"true", "first_name"=>"Reseller", "last_name"=>"Customer", "address"=>"555 Any Street", "address2"=>"", "city"=>"City", "state"=>"State", "zip"=>"90000", "country"=>"US", "phone"=>"555-555-5555", "website"=>"http://Website", "website_access"=>"true"}])
|
122
155
|
end
|
123
|
-
|
156
|
+
|
124
157
|
it "should set first name" do
|
125
|
-
client.profile.set(:first_name => "test").
|
126
|
-
|
127
|
-
client.profile.get.first["first_name"].
|
128
|
-
|
129
|
-
client.profile.set(:first_name => "Reseller").
|
130
|
-
|
158
|
+
expect(client.profile.set(:first_name => "test")).
|
159
|
+
to eql ({"message" => "success"})
|
160
|
+
expect(client.profile.get.first["first_name"]).
|
161
|
+
to eql "test"
|
162
|
+
expect(client.profile.set(:first_name => "Reseller")).
|
163
|
+
to eql ({"message" => "success"})
|
131
164
|
end
|
132
165
|
end
|
133
166
|
end
|
data/spec/helper_spec.rb
CHANGED
@@ -30,11 +30,10 @@ describe "helper" do
|
|
30
30
|
apps = { :opentrack => {:name => "eventnotify", :processed => "0", :dropped => "1", :deferred => "1",
|
31
31
|
:delivered => "0", :bounce => "1", :click => "1", :open => "1", :unsubscribe => "1", :spamreport => "1",
|
32
32
|
:url => "https://example.com"},
|
33
|
-
:clicktrack => {
|
34
|
-
:opentrack => {}
|
33
|
+
:clicktrack => {}
|
35
34
|
}
|
36
35
|
|
37
|
-
@users = {"test-6" => {:account => user_hash, :applications => apps, :assigned_ips => [
|
36
|
+
@users = {"test-6" => {:account => user_hash, :applications => apps, :assigned_ips => []}}
|
38
37
|
|
39
38
|
end
|
40
39
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
common: &common
|
2
|
+
adapter: postgresql
|
3
|
+
encoding: utf8
|
4
|
+
host: <%= ENV["DBHOST"] || "127.0.0.1" %>
|
5
|
+
port: <%= ENV["DBPORT"] || "5432" %>
|
6
|
+
database: <%= ENV["DBNAME"] || "has_helpers_test" %>
|
7
|
+
username: <%= ENV["DBUSER"] || "postgres" %>
|
8
|
+
password: <%= ENV["DBPASSWORD"] || "" %>
|
9
|
+
pool: 5
|
10
|
+
reconnect: true
|
11
|
+
timeout: 5000
|
12
|
+
|
13
|
+
development:
|
14
|
+
<<: *common
|
15
|
+
|
16
|
+
test:
|
17
|
+
<<: *common
|
18
|
+
|
19
|
+
staging:
|
20
|
+
<<: *common
|
21
|
+
|
22
|
+
production:
|
23
|
+
<<: *common
|
24
|
+
pool: 10
|
data/spec/spec_helper.rb
CHANGED
data/spec/sub_user_spec.rb
CHANGED
File without changes
|
data/test.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sendgrid_webapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kylejginavan
|
8
8
|
- chebyte
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-02-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -123,11 +123,15 @@ executables: []
|
|
123
123
|
extensions: []
|
124
124
|
extra_rdoc_files: []
|
125
125
|
files:
|
126
|
-
- ".circleci/config.yml"
|
127
|
-
- ".circleci/setup-rubygems.sh"
|
128
126
|
- ".gitignore"
|
129
127
|
- ".rspec"
|
130
128
|
- ".ruby-version"
|
129
|
+
- ".tekton/Chart.lock"
|
130
|
+
- ".tekton/Chart.yaml"
|
131
|
+
- ".tekton/templates/pipelinerun.yaml"
|
132
|
+
- ".tekton/values-main.yaml"
|
133
|
+
- ".tekton/values-pr.yaml"
|
134
|
+
- ".tekton/values.yaml"
|
131
135
|
- ".tool-versions"
|
132
136
|
- Gemfile
|
133
137
|
- MIT-LICENSE
|
@@ -158,6 +162,7 @@ files:
|
|
158
162
|
- lib/sub_user/white_label.rb
|
159
163
|
- lib/subuser_client.rb
|
160
164
|
- lib/version.rb
|
165
|
+
- lib/web_api/address_whitelist.rb
|
161
166
|
- lib/web_api/blocks.rb
|
162
167
|
- lib/web_api/bounces.rb
|
163
168
|
- lib/web_api/event_notification.rb
|
@@ -172,16 +177,22 @@ files:
|
|
172
177
|
- lib/web_api/version.rb
|
173
178
|
- lib/webapi_client.rb
|
174
179
|
- sendgrid_webapi.gemspec
|
180
|
+
- spec/cassettes/client/_modules/_address_whitelist/should_add_email_to_whitelist.yml
|
181
|
+
- spec/cassettes/client/_modules/_address_whitelist/should_delete_email_from_whitelist.yml
|
182
|
+
- spec/cassettes/client/_modules/_address_whitelist/should_get_address_whitelist.yml
|
175
183
|
- spec/cassettes/client/_modules/_block/should_get_block_emails.yml
|
176
184
|
- spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml
|
177
185
|
- spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml
|
178
186
|
- spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml
|
187
|
+
- spec/cassettes/client/_modules/_bounce/should_get_bounce_emails_using_params.yml
|
179
188
|
- spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml
|
180
189
|
- spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml
|
181
190
|
- spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml
|
182
191
|
- spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml
|
183
192
|
- spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml
|
184
193
|
- spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml
|
194
|
+
- spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_emails_using_params.yml
|
195
|
+
- spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails_using_params.yml
|
185
196
|
- spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml
|
186
197
|
- spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml
|
187
198
|
- spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml
|
@@ -241,6 +252,7 @@ files:
|
|
241
252
|
- spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml
|
242
253
|
- spec/client_spec.rb
|
243
254
|
- spec/helper_spec.rb
|
255
|
+
- spec/internal/config/database-standard.yml
|
244
256
|
- spec/spec_helper.rb
|
245
257
|
- spec/sub_user_spec.rb
|
246
258
|
- test.rb
|
@@ -248,7 +260,7 @@ homepage: https://github.com/kylejginavan/sendgrid_webapi
|
|
248
260
|
licenses:
|
249
261
|
- MIT
|
250
262
|
metadata: {}
|
251
|
-
post_install_message:
|
263
|
+
post_install_message:
|
252
264
|
rdoc_options: []
|
253
265
|
require_paths:
|
254
266
|
- lib
|
@@ -263,79 +275,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
263
275
|
- !ruby/object:Gem::Version
|
264
276
|
version: '0'
|
265
277
|
requirements: []
|
266
|
-
rubygems_version: 3.2.
|
267
|
-
signing_key:
|
278
|
+
rubygems_version: 3.2.22
|
279
|
+
signing_key:
|
268
280
|
specification_version: 4
|
269
281
|
summary: SendGrid WEB API gem fo Rails
|
270
|
-
test_files:
|
271
|
-
- spec/cassettes/client/_modules/_block/should_get_block_emails.yml
|
272
|
-
- spec/cassettes/client/_modules/_block/should_get_totals_blocks.yml
|
273
|
-
- spec/cassettes/client/_modules/_block/should_try_delete_not_existing_block_email.yml
|
274
|
-
- spec/cassettes/client/_modules/_bounce/should_get_bounce_emails.yml
|
275
|
-
- spec/cassettes/client/_modules/_bounce/should_get_totals_bounces.yml
|
276
|
-
- spec/cassettes/client/_modules/_bounce/should_try_delete_not_existing_bounce_email.yml
|
277
|
-
- spec/cassettes/client/_modules/_event_notification/should_delete_event_notification_url.yml
|
278
|
-
- spec/cassettes/client/_modules/_event_notification/should_get_event_notification_url.yml
|
279
|
-
- spec/cassettes/client/_modules/_event_notification/should_set_event_notification_url.yml
|
280
|
-
- spec/cassettes/client/_modules/_invalid_email/should_get_invalid_emails.yml
|
281
|
-
- spec/cassettes/client/_modules/_invalid_email/should_try_delete_not_existing_invalid_emails.yml
|
282
|
-
- spec/cassettes/client/_modules/_parse_email/should_delete_parse_email.yml
|
283
|
-
- spec/cassettes/client/_modules/_parse_email/should_get_parse_email.yml
|
284
|
-
- spec/cassettes/client/_modules/_parse_email/should_set_parse_email.yml
|
285
|
-
- spec/cassettes/client/_modules/_profile/should_get_profile.yml
|
286
|
-
- spec/cassettes/client/_modules/_profile/should_set_first_name.yml
|
287
|
-
- spec/cassettes/client/_modules/_spam/should_get_spam_emails.yml
|
288
|
-
- spec/cassettes/client/_modules/_spam/should_try_delete_not_existing_spam_emails.yml
|
289
|
-
- spec/cassettes/client/_modules/_unsubscribe/should_add_unsubscribe_emails.yml
|
290
|
-
- spec/cassettes/client/_modules/_unsubscribe/should_delete_unsubscribe_email.yml
|
291
|
-
- spec/cassettes/client/_modules/_unsubscribe/should_get_unsubscribe_emails.yml
|
292
|
-
- spec/cassettes/client/_modules/_unsubscribe/should_try_delete_not_existing_unsubscribe_emails.yml
|
293
|
-
- spec/cassettes/helper/_create_sub_user_account/should_create_sub_user_account.yml
|
294
|
-
- spec/cassettes/helper/_run_sendgrid_query/should_raise_with_unsucessfull_request.yml
|
295
|
-
- spec/cassettes/helper/_run_sendgrid_query/should_run_sendgrid_request.yml
|
296
|
-
- spec/cassettes/sub_user/_apps/should_activate_app.yml
|
297
|
-
- spec/cassettes/sub_user/_apps/should_deactivate_app.yml
|
298
|
-
- spec/cassettes/sub_user/_apps/should_get_current_setting_from_one_app.yml
|
299
|
-
- spec/cassettes/sub_user/_apps/should_return_available_apps.yml
|
300
|
-
- spec/cassettes/sub_user/_apps/should_set_current_app.yml
|
301
|
-
- spec/cassettes/sub_user/_authentication/should_auth_a_sub_user.yml
|
302
|
-
- spec/cassettes/sub_user/_authentication/should_return_error_with_a_bad_sub_user.yml
|
303
|
-
- spec/cassettes/sub_user/_bounces/should_returns_bounce_emails.yml
|
304
|
-
- spec/cassettes/sub_user/_bounces/should_tries_to_delete_unexisting_bounce_emails.yml
|
305
|
-
- spec/cassettes/sub_user/_event_notification/should_add_event_notification_url.yml
|
306
|
-
- spec/cassettes/sub_user/_event_notification/should_delete_event_notification_url.yml
|
307
|
-
- spec/cassettes/sub_user/_event_notification/should_get_event_notification_url.yml
|
308
|
-
- spec/cassettes/sub_user/_invalid_emails/should_return_invalid_emails.yml
|
309
|
-
- spec/cassettes/sub_user/_invalid_emails/should_tries_to_delete_unexisting_invalid_mail.yml
|
310
|
-
- spec/cassettes/sub_user/_ip_management/should_return_all_ips_available.yml
|
311
|
-
- spec/cassettes/sub_user/_ip_management/should_show_ip_subuser.yml
|
312
|
-
- spec/cassettes/sub_user/_limits/should_decrements_credits_for_a_sub_user.yml
|
313
|
-
- spec/cassettes/sub_user/_limits/should_delete_all_limits_for_a_sub_user.yml
|
314
|
-
- spec/cassettes/sub_user/_limits/should_increments_credits_for_a_sub_user.yml
|
315
|
-
- spec/cassettes/sub_user/_limits/should_list_the_limits_for_a_sub_user.yml
|
316
|
-
- spec/cassettes/sub_user/_limits/should_reset_all_limits_for_a_sub_user.yml
|
317
|
-
- spec/cassettes/sub_user/_limits/should_returns_limits_for_a_sub_user.yml
|
318
|
-
- spec/cassettes/sub_user/_limits/should_set_total_credits.yml
|
319
|
-
- spec/cassettes/sub_user/_management/should_add_new_subuser.yml
|
320
|
-
- spec/cassettes/sub_user/_management/should_disable_sub_user_for_send_email.yml
|
321
|
-
- spec/cassettes/sub_user/_management/should_enable_sub_user_for_access_to_website.yml
|
322
|
-
- spec/cassettes/sub_user/_management/should_enable_sub_user_for_send_email.yml
|
323
|
-
- spec/cassettes/sub_user/_management/should_update_sub_user.yml
|
324
|
-
- spec/cassettes/sub_user/_monitor_records/should_add_existing_sub_user_to_monitor_record.yml
|
325
|
-
- spec/cassettes/sub_user/_monitor_records/should_create_a_new_monitor_record.yml
|
326
|
-
- spec/cassettes/sub_user/_monitor_records/should_delete_a_monitor_record.yml
|
327
|
-
- spec/cassettes/sub_user/_monitor_records/should_edit_a_monitor_record.yml
|
328
|
-
- spec/cassettes/sub_user/_monitor_records/should_remove_existing_sub_user_from_monitor_record.yml
|
329
|
-
- spec/cassettes/sub_user/_parse_email/should_delete_parse_email.yml
|
330
|
-
- spec/cassettes/sub_user/_parse_email/should_get_parse_email.yml
|
331
|
-
- spec/cassettes/sub_user/_parse_email/should_set_parse_email.yml
|
332
|
-
- spec/cassettes/sub_user/_spam/should_return_spam_mails.yml
|
333
|
-
- spec/cassettes/sub_user/_spam/should_tries_to_delete_unexisting_spam_mail.yml
|
334
|
-
- spec/cassettes/sub_user/_unsubscribes/should_add_bounce_email.yml
|
335
|
-
- spec/cassettes/sub_user/_unsubscribes/should_delete_existing_bounce_email.yml
|
336
|
-
- spec/cassettes/sub_user/_unsubscribes/should_delete_unexisting_bounce_email.yml
|
337
|
-
- spec/cassettes/sub_user/_unsubscribes/should_returns_bounce_emails.yml
|
338
|
-
- spec/client_spec.rb
|
339
|
-
- spec/helper_spec.rb
|
340
|
-
- spec/spec_helper.rb
|
341
|
-
- spec/sub_user_spec.rb
|
282
|
+
test_files: []
|
data/.circleci/config.yml
DELETED
@@ -1,132 +0,0 @@
|
|
1
|
-
# Ruby CircleCI 2.0 configuration file
|
2
|
-
#
|
3
|
-
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
-
#
|
5
|
-
defaults: &defaults
|
6
|
-
working_directory: ~/repo
|
7
|
-
docker:
|
8
|
-
- image: circleci/ruby:2.3.6-stretch-node
|
9
|
-
environment:
|
10
|
-
# - DBHOST: localhost
|
11
|
-
# - DBNAME: sendgrid_webapi_test
|
12
|
-
# - DBPASSWORD: Vdm9omJt8Z3MCV4N
|
13
|
-
# - DBUSER: test_user
|
14
|
-
- RACK_ENV: test
|
15
|
-
- RAILS_ENV: test
|
16
|
-
# - image: circleci/postgres:10.3-alpine-ram
|
17
|
-
# environment:
|
18
|
-
# - POSTGRES_DB: sendgrid_webapi_test
|
19
|
-
# - POSTGRES_USER: test_user
|
20
|
-
# - POSTGRES_PASSWORD: Vdm9omJt8Z3MCV4N
|
21
|
-
|
22
|
-
version: 2
|
23
|
-
jobs:
|
24
|
-
run_specs:
|
25
|
-
<<: *defaults
|
26
|
-
|
27
|
-
steps:
|
28
|
-
- run:
|
29
|
-
name: Set up environment
|
30
|
-
command: |
|
31
|
-
sudo apt-get update && sudo apt-get install -y apt-transport-https apt-utils
|
32
|
-
|
33
|
-
- checkout
|
34
|
-
|
35
|
-
- restore_cache:
|
36
|
-
keys:
|
37
|
-
- sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
|
38
|
-
- sendgrid_webapi-dependencies-v1-
|
39
|
-
|
40
|
-
- run:
|
41
|
-
name: Install dependencies
|
42
|
-
command: |
|
43
|
-
# curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
|
44
|
-
# echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
|
45
|
-
# sudo apt-get update && sudo apt-get install postgresql-client-10
|
46
|
-
bundle check --path=./vendor/bundle || bundle install --path=./vendor/bundle --jobs=4 --retry=3
|
47
|
-
|
48
|
-
- save_cache:
|
49
|
-
key: sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
|
50
|
-
paths:
|
51
|
-
- ./vendor/bundle
|
52
|
-
|
53
|
-
# - run:
|
54
|
-
# name: Set up database
|
55
|
-
# command: |
|
56
|
-
# cp spec/internal/config/database.docker.yml spec/internal/config/database.yml
|
57
|
-
|
58
|
-
- run:
|
59
|
-
name: Run tests
|
60
|
-
command: |
|
61
|
-
mkdir /tmp/test-results
|
62
|
-
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
63
|
-
bundle exec rspec --format progress --format RspecJunitFormatter --out /tmp/test-results/rspec.xml $TEST_FILES
|
64
|
-
|
65
|
-
- store_test_results:
|
66
|
-
path: /tmp/test-results
|
67
|
-
|
68
|
-
- store_artifacts:
|
69
|
-
path: /tmp/test-results
|
70
|
-
destination: test-results
|
71
|
-
|
72
|
-
build_gem:
|
73
|
-
<<: *defaults
|
74
|
-
|
75
|
-
steps:
|
76
|
-
- run:
|
77
|
-
name: Set up environment
|
78
|
-
command: |
|
79
|
-
sudo apt-get update && sudo apt-get install -y apt-transport-https apt-utils
|
80
|
-
|
81
|
-
- checkout
|
82
|
-
|
83
|
-
- restore_cache:
|
84
|
-
keys:
|
85
|
-
- sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
|
86
|
-
- sendgrid_webapi-dependencies-v1-
|
87
|
-
|
88
|
-
- run:
|
89
|
-
name: Install dependencies
|
90
|
-
command: |
|
91
|
-
gem install gemfury
|
92
|
-
bundle check --path=./vendor/bundle || bundle install --path=./vendor/bundle --jobs=4 --retry=3
|
93
|
-
|
94
|
-
- save_cache:
|
95
|
-
key: sendgrid_webapi-dependencies-v1-{{ checksum "sendgrid_webapi.gemspec" }}
|
96
|
-
paths:
|
97
|
-
- ./vendor/bundle
|
98
|
-
|
99
|
-
- run:
|
100
|
-
name: Build gem
|
101
|
-
command: |
|
102
|
-
gem build sendgrid_webapi.gemspec
|
103
|
-
|
104
|
-
- run:
|
105
|
-
name: Push gem
|
106
|
-
command: |
|
107
|
-
if [[ "${CIRCLE_PROJECT_USERNAME}" == "OneHQ" && "${CIRCLE_BRANCH}" == "master" && -n "${RUBYGEMS_API_KEY}" ]]; then
|
108
|
-
bash .circleci/setup-rubygems.sh
|
109
|
-
version=$(ruby -e 'load "lib/version.rb"; puts SendGridWebApi::VERSION')
|
110
|
-
grep -q "${version}" <(gem search sendgrid_api) || EXIT_CODE=$? && true
|
111
|
-
if [[ $EXIT_CODE == 1 ]]; then
|
112
|
-
gem push sendgrid_webapi-${version}.gem
|
113
|
-
git tag ${version}
|
114
|
-
git push --tags
|
115
|
-
|
116
|
-
[[ -n "$SLACK_TOKEN" ]] && curl -s -d "sendgrid_webapi ($version) released." "https://onehq.slack.com/services/hooks/slackbot?token=${SLACK_TOKEN}&channel=%23machines"
|
117
|
-
fi
|
118
|
-
fi
|
119
|
-
|
120
|
-
workflows:
|
121
|
-
version: 2
|
122
|
-
build-deploy:
|
123
|
-
jobs:
|
124
|
-
- run_specs
|
125
|
-
- build_gem:
|
126
|
-
requires:
|
127
|
-
- run_specs
|
128
|
-
filters:
|
129
|
-
branches:
|
130
|
-
only:
|
131
|
-
- master
|
132
|
-
- staging
|