roqua-core-api 0.3.0 → 0.3.1

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: a3270b586349f9e29771af5d0f53e55ef4167f71
4
- data.tar.gz: aa83a7b5908cb17c6043edbb3441d02ab595f427
3
+ metadata.gz: b788e173b506c370992aed5f8b6fcb4d230ba04f
4
+ data.tar.gz: c419cc9116e18c43e884f8e251a224ddcfd5cc04
5
5
  SHA512:
6
- metadata.gz: 3286272447063c7e3f31e488655a096814611c35b3ed9d90f748d51c249261de00292b6d7d64ee7f893ea0b7a5d7e8ab44ada55af9e5650c89a7f22c32e79533
7
- data.tar.gz: f3c983eece1a79fd6de9cc353fc8d85313098474309bd2c3c240006d9f0fd96fa0022605368f66011efa32389540ae3516751598f8b245cbfa0ee3ca4a841a2a
6
+ metadata.gz: 9b9a8d71ab5bd7eb919ef2a0611ddcf94a2bdcf1ab1eabd8950eb1c1f723c4d43e019b1a6bcff58b9348db60b89db0d3dac8f02ff8989097b9137156796f03dd
7
+ data.tar.gz: 267ca4836bef435b63f86ea90b68f8a2f652c2155af5e5f052f06744b93d25d9bfed4ecc2c878c296d663f6620297ae8e1ba6f35c946044b15bda85d57f620db
data/ChangeLog.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 0.3.1
2
+
3
+ * Added Notification endpoint
4
+ * Deprecated email and text_message endpoint
5
+
1
6
  ### 0.3.0
2
7
 
3
8
  * BACKWARD INCOMPATIBLE: SendTextMessage now expects a session instead of username/password
@@ -24,6 +24,7 @@ module Roqua
24
24
  autoload :People
25
25
  autoload :Person
26
26
  autoload :SendEmailTo
27
+ autoload :SendNotification
27
28
  autoload :SendTextMessageTo
28
29
  autoload :SendInviteEmail
29
30
  autoload :SsoLogin
@@ -6,7 +6,6 @@ module Roqua
6
6
  hash :attributes do
7
7
  string :subject
8
8
  string :body
9
- string :bcc, default: nil
10
9
  string :content_type, default: 'text/html'
11
10
  string :mail_type, default: nil
12
11
  end
@@ -0,0 +1,31 @@
1
+ module Roqua
2
+ module CoreApi
3
+ # @api private
4
+ class SendNotification < ActiveInteraction::Base
5
+ string :person_id, default: nil # if nil, to must be present.
6
+ string :dossier_id, default: nil
7
+ hash :attributes do
8
+ string :body_short
9
+ string :body_long
10
+ string :notification_type, default: nil
11
+ string :reference
12
+ string :subject
13
+ hash :addresses, default: nil, strip: false
14
+ hash :variables, strip: false, default: {}
15
+ array :notify_by do # [:sms, :email]
16
+ string
17
+ end
18
+ end
19
+
20
+ # Possible variables in the body/subject are:
21
+ # %firstname%,
22
+ # %lastname%,
23
+ # %initials%
24
+ def execute
25
+ CoreApi.basic_auth_session.post "/notifications", notification: attributes,
26
+ person_id: person_id,
27
+ dossier_id: dossier_id
28
+ end
29
+ end
30
+ end
31
+ end
@@ -37,7 +37,7 @@ module Roqua
37
37
  end
38
38
 
39
39
  def calculate_hmac(request_method, path, params)
40
- checker = Authmac::HmacChecker.new(consumer_secret, '|', 'sha256')
40
+ checker = Authmac::HmacChecker.new(consumer_secret, digest_function: 'sha256', message_format: :json)
41
41
  params_to_sign = params.merge \
42
42
  'request_method' => request_method,
43
43
  'request_path' => "/api/v1#{path}",
@@ -1,5 +1,5 @@
1
1
  module Roqua
2
2
  module CoreApi
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
@@ -7,7 +7,6 @@ describe SendEmailTo do
7
7
  it 'performs a post on the emails api path providing the person_id and the email attributes' do
8
8
  email_attributes = {subject: 'some_subject',
9
9
  body: 'some_body',
10
- bcc: 'some@bcc',
11
10
  content_type: 'some/content/type',
12
11
  mail_type: 'some_mail_type'}
13
12
  expect(session).to receive(:post).with '/emails', person_id: 'some_person_id', email: email_attributes
@@ -17,7 +16,6 @@ describe SendEmailTo do
17
16
  it 'defaults the content_type to text/html' do
18
17
  email_attributes = {subject: 'some_subject',
19
18
  body: 'some_body',
20
- bcc: 'some@bcc',
21
19
  mail_type: 'some_mail_type'}
22
20
  expect(session).to receive(:post).with '/emails', person_id: 'some_person_id',
23
21
  email: email_attributes.merge(content_type: 'text/html')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roqua-core-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-24 00:00:00.000000000 Z
11
+ date: 2017-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -207,6 +207,7 @@ files:
207
207
  - lib/roqua/core_api/person.rb
208
208
  - lib/roqua/core_api/send_email_to.rb
209
209
  - lib/roqua/core_api/send_invite_email.rb
210
+ - lib/roqua/core_api/send_notification.rb
210
211
  - lib/roqua/core_api/send_text_message_to.rb
211
212
  - lib/roqua/core_api/sessions.rb
212
213
  - lib/roqua/core_api/sessions/auth_session.rb
@@ -263,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
264
  version: '0'
264
265
  requirements: []
265
266
  rubyforge_project:
266
- rubygems_version: 2.6.6
267
+ rubygems_version: 2.6.8
267
268
  signing_key:
268
269
  specification_version: 4
269
270
  summary: API wrapper gem around Core's API