twi 0.5.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 727c9e8147c7ff29da2287c0a8df35be3bcf750e697baddba487605a99357e6e
4
- data.tar.gz: b4fd8d8854d21d652649ba542aa578319421900f61d2d17c88b24daea365912f
3
+ metadata.gz: 6f15688c986ff6cfb45fb8f72e76934b1c02ea597ee7925c9bf832fd00e3adef
4
+ data.tar.gz: 8ed7d2d7baca898202a9b030c1b6d493dd1a11ac7fd25671f41268322a4a4a9a
5
5
  SHA512:
6
- metadata.gz: bc4539e765dd8d5d4426cff34b94e8222ba846422462c964c9e48e93f57dba29ef09490a816c628ac63209e701799191dbabd4fd39b1087129fac00f7925ac4b
7
- data.tar.gz: 2b0a73db81a391abaa10b89b31073a31617fcc18864ea3413b708726b6c2c878d7c7fc03af34ab3fc1f0f8eaa2657ca00cfbbc5d7b0668fa4ffc729940ee334c
6
+ metadata.gz: ab513b054afb8ca7d41d891d6de3faf0d004af9487b6d288cfd4fe80c2c29570c3f897b7b118be789d679ba5af139df69657baba9476ee6ac462e6b43442d490
7
+ data.tar.gz: 4361b2fded185f6456fef30b71da30a14dfde0a17032586fd81a58155d27f87a43aadbf0c7943c5b2c5eef7f3c5b294cf591abcdacf86ee961f49deac9d84d40
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.6.0] - 2026-07-27
2
+
3
+ - [Fix] Remove proxy_address from conversation participant
4
+
1
5
  ## [0.5.0] - 2026-07-27
2
6
 
3
7
  - [New] Add Twi::Delivery#sender
@@ -4,8 +4,8 @@ module Twi
4
4
  class Conversation < Resource
5
5
  attr_reader :id, :status
6
6
 
7
- def create_with(host:, participant_phones:)
8
- params = create_params_for host, participant_phones
7
+ def create_with(participants:)
8
+ params = create_params_for participants
9
9
  conversation = conversation_service.conversation_with_participants.create **params
10
10
 
11
11
  @params = { id: conversation.sid, status: conversation.state }
@@ -65,19 +65,22 @@ module Twi
65
65
  conversation_service.conversations id
66
66
  end
67
67
 
68
- def create_params_for(host, participant_phones)
68
+ def create_params_for(participants)
69
69
  {
70
70
  messaging_service_sid: Twi.lio.messaging_sid, x_twilio_webhook_enabled: 'true',
71
- friendly_name: @params[:friendly_name], participant: participant_params_for(host, participant_phones),
71
+ friendly_name: @params[:friendly_name], participant: participant_params_for(participants),
72
72
  }
73
73
  end
74
74
 
75
- def participant_params_for(host, participant_phones)
76
- params = [{ messaging_binding: { projected_address: "+1#{host[:phone]}" }, identity: host[:identity] }]
77
- participant_phones.map do |participant_phone|
78
- params << { messaging_binding: { address: "+1#{participant_phone}", proxy_address: "+1#{host[:phone]}" } }
79
- end
80
- params.map(&:to_json)
75
+ def participant_params_for(participants)
76
+ participants.map do |participant|
77
+ phone = "+1#{participant[:phone]}"
78
+ if participant[:identity]
79
+ { messaging_binding: { projected_address: phone }, identity: participant[:identity] }
80
+ else
81
+ { messaging_binding: { address: phone } }
82
+ end
83
+ end.map(&:to_json)
81
84
  end
82
85
 
83
86
  def message_params_for(content, image_ids)
@@ -1,6 +1,6 @@
1
1
  module Twi
2
2
  class Mock::Conversation < Conversation
3
- def create_with(host:, participant_phones:)
3
+ def create_with(participants:)
4
4
  if error = Twi.mock.conversation_error
5
5
  Twi.mock.conversation_error = nil
6
6
  case error[:code]
data/lib/twi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Twi
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo