twilio-ruby 5.61.1 → 5.63.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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +124 -0
  3. data/.rubocop.yml +1 -1
  4. data/.rubocop_todo.yml +84 -21
  5. data/CHANGES.md +96 -0
  6. data/Makefile +3 -6
  7. data/README.md +4 -4
  8. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  9. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +19 -5
  10. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
  11. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
  12. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
  13. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +33 -18
  14. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +483 -0
  15. data/lib/twilio-ruby/rest/insights/v1/conference.rb +484 -0
  16. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  17. data/lib/twilio-ruby/rest/insights/v1.rb +23 -0
  18. data/lib/twilio-ruby/rest/insights.rb +14 -0
  19. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +14 -1
  20. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +23 -0
  21. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +80 -0
  22. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  23. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +416 -0
  24. data/lib/twilio-ruby/rest/supersim/v1.rb +32 -0
  25. data/lib/twilio-ruby/rest/supersim.rb +18 -0
  26. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +138 -10
  27. data/lib/twilio-ruby/rest/verify/v2/service.rb +8 -2
  28. data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -0
  29. data/lib/twilio-ruby/rest/video/v1/recording.rb +7 -0
  30. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
  31. data/lib/twilio-ruby/rest/video/v1/room.rb +34 -1
  32. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  33. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  34. data/lib/twilio-ruby/rest/voice.rb +8 -0
  35. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +4 -4
  36. data/lib/twilio-ruby/version.rb +1 -1
  37. data/sonar-project.properties +1 -1
  38. data/twilio-ruby.gemspec +0 -1
  39. metadata +10 -18
  40. data/.github/workflows/deploy.yml +0 -65
  41. data/.github/workflows/test.yml +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2583fb03b7f76ca77faa5e168a640ee6666859f
4
- data.tar.gz: 861886a68fcff99ea6447453fe9293d078d2b0ee
3
+ metadata.gz: 713fb3456ac1cc81c84708c98ab9182982c87e9e
4
+ data.tar.gz: 19b87b511ac9133faca93426a3ba61faadfbd7d3
5
5
  SHA512:
6
- metadata.gz: 86c26374082ab77796489dbc76fb3d4098dfec72c9ab0f8ea5c69896ffca74edd38baf6b128489f61f9b14189c93dab29850ac70aa9cae784f1f1e87baff6731
7
- data.tar.gz: 390ba0f3829c07b954a5097995a61dec268c05736cf21b1a971527a36436980ca6ecf17abd5371079cb05fac72f23bbb8426560a1dd7ec82ed92287fcc854cb5
6
+ metadata.gz: '08a2bb565a77837293ad33f4d80c6a2ba1b7f6d853097ce420576aab813651e84887244f8618e79a638e33c8a52d97c5450028bf1be9de1d08a62777e521d923'
7
+ data.tar.gz: 34bc361cb1f619c6cad3d89bfe6022518c72dd73ba2f7a17884784a317520adc1e0c0adccba6dab264da3d747ccedd1b5beec0e3ddf46911a7696c711535e5c0
@@ -0,0 +1,124 @@
1
+ name: Test and Deploy
2
+ on:
3
+ push:
4
+ branches: [ '*' ]
5
+ tags: [ '*' ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ schedule:
9
+ # Run automatically at 8AM PST Monday-Friday
10
+ - cron: '0 15 * * 1-5'
11
+ workflow_dispatch:
12
+
13
+ jobs:
14
+ test:
15
+ name: Test
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 20
18
+ strategy:
19
+ matrix:
20
+ ruby: [ 2.4, 2.5, 2.6, 2.7, '3.0', ruby-head, jruby-9.2 ]
21
+ steps:
22
+ - name: Checkout twilio-ruby
23
+ uses: actions/checkout@v2
24
+ with:
25
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
26
+
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby }}
31
+ bundler-cache: true
32
+
33
+ # Excludes incompatible versions of ruby
34
+ - name: Set up linter
35
+ run: bundle add rubocop --version "~> 1.24.1" --group "development" --skip-install
36
+ if: ${{ matrix.ruby != '2.4' }}
37
+
38
+ - run: bundle install --with development
39
+ - run: bundle exec rake install
40
+
41
+ - name: Run linter
42
+ run: bundle exec rubocop -d --cache true --parallel
43
+ if: ${{ matrix.ruby != '2.4' }}
44
+
45
+ - name: Run Unit Tests
46
+ run: make test
47
+
48
+ - name: Fix code coverage paths
49
+ if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.ruby == '3.0' && !github.event.pull_request.head.repo.fork }}
50
+ working-directory: ./coverage
51
+ run: |
52
+ sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.json
53
+
54
+ - name: SonarCloud Scan
55
+ if: ${{ (github.event_name == 'pull_request' || github.ref_type == 'branch') && matrix.ruby == '3.0' && !github.event.pull_request.head.repo.fork }}
56
+ uses: SonarSource/sonarcloud-github-action@master
57
+ env:
58
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
59
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
60
+
61
+ deploy:
62
+ name: Deploy
63
+ if: success() && github.ref_type == 'tag'
64
+ needs: [ test ]
65
+ runs-on: ubuntu-latest
66
+ steps:
67
+ - name: Checkout twilio-ruby
68
+ uses: actions/checkout@v2
69
+ with:
70
+ fetch-depth: 0
71
+
72
+ - name: Set up Ruby
73
+ uses: ruby/setup-ruby@v1
74
+ with:
75
+ ruby-version: 2.4
76
+ bundler-cache: true
77
+
78
+ - run: bundle install
79
+
80
+ - name: Login to Docker Hub
81
+ uses: docker/login-action@v1
82
+ with:
83
+ username: ${{ secrets.DOCKER_USERNAME }}
84
+ password: ${{ secrets.DOCKER_AUTH_TOKEN }}
85
+
86
+ # The expression strips off the shortest match from the front of the string to yield just the tag name as the output
87
+ - name: Get tagged version
88
+ run: echo "GITHUB_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
89
+
90
+ - name: Create GitHub Release
91
+ uses: sendgrid/dx-automator/actions/release@main
92
+ env:
93
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94
+
95
+ - name: Build and Push image
96
+ run: make docker-build && make docker-push
97
+ - name: Publish to Rubygems
98
+ env:
99
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
100
+ run: |
101
+ mkdir -p $HOME/.gem
102
+ touch $HOME/.gem/credentials
103
+ chmod 0600 $HOME/.gem/credentials
104
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
105
+ gem build *.gemspec
106
+ gem push *.gem
107
+
108
+ notify-on-failure:
109
+ name: Slack notify on failure
110
+ if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
111
+ needs: [ test, deploy ]
112
+ runs-on: ubuntu-latest
113
+ steps:
114
+ - uses: rtCamp/action-slack-notify@v2
115
+ env:
116
+ SLACK_COLOR: failure
117
+ SLACK_ICON_EMOJI: ':github:'
118
+ SLACK_MESSAGE: ${{ format('Tests *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }}
119
+ SLACK_TITLE: Action Failure - ${{ github.repository }}
120
+ SLACK_USERNAME: GitHub Actions
121
+ SLACK_MSG_AUTHOR: twilio-dx
122
+ SLACK_FOOTER: Posted automatically using GitHub Actions
123
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
124
+ MSG_MINIMAL: true
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.6
4
+ TargetRubyVersion: 2.5
5
5
  Exclude:
6
6
  - 'lib/twilio-ruby/rest/**/*'
7
7
  - 'spec/integration/**/*'
data/.rubocop_todo.yml CHANGED
@@ -1,14 +1,14 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-04-29 14:57:47 -0500 using RuboCop version 0.82.0.
3
+ # on 2022-01-13 21:45:15 UTC using RuboCop version 1.24.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 1
9
+ # Offense count: 2
10
10
  # Cop supports --auto-correct.
11
- # Configuration parameters: TreatCommentsAsGroupSeparators, Include.
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
12
  # Include: **/*.gemspec
13
13
  Gemspec/OrderedDependencies:
14
14
  Exclude:
@@ -28,13 +28,6 @@ Layout/EmptyLineAfterGuardClause:
28
28
  - 'lib/rack/twilio_webhook_authentication.rb'
29
29
  - 'lib/twilio-ruby/framework/serialize.rb'
30
30
 
31
- # Offense count: 1
32
- # Cop supports --auto-correct.
33
- # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
34
- Layout/ExtraSpacing:
35
- Exclude:
36
- - 'twilio-ruby.gemspec'
37
-
38
31
  # Offense count: 2
39
32
  # Cop supports --auto-correct.
40
33
  # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
@@ -53,6 +46,24 @@ Layout/SpaceInsideHashLiteralBraces:
53
46
  - 'spec/jwt/access_token_spec.rb'
54
47
  - 'spec/jwt/client_capability_spec.rb'
55
48
 
49
+ # Offense count: 3
50
+ # Configuration parameters: AllowedMethods.
51
+ # AllowedMethods: enums
52
+ Lint/ConstantDefinitionInBlock:
53
+ Exclude:
54
+ - 'spec/jwt/client_capability_spec.rb'
55
+ - 'spec/rest/client_spec.rb'
56
+
57
+ # Offense count: 1
58
+ Lint/MissingSuper:
59
+ Exclude:
60
+ - 'lib/twilio-ruby/framework/rest/error.rb'
61
+
62
+ # Offense count: 1
63
+ Lint/SelfAssignment:
64
+ Exclude:
65
+ - 'lib/twilio-ruby/framework/rest/version.rb'
66
+
56
67
  # Offense count: 1
57
68
  # Cop supports --auto-correct.
58
69
  # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
@@ -70,6 +81,7 @@ Lint/UnusedMethodArgument:
70
81
  - 'spec/holodeck/holodeck.rb'
71
82
 
72
83
  # Offense count: 1
84
+ # Cop supports --auto-correct.
73
85
  # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
74
86
  Lint/UselessAccessModifier:
75
87
  Exclude:
@@ -80,8 +92,14 @@ Lint/UselessAssignment:
80
92
  Exclude:
81
93
  - 'spec/rack/twilio_webhook_authentication_spec.rb'
82
94
 
95
+ # Offense count: 6
96
+ # Configuration parameters: Max, CountKeywordArgs.
97
+ Metrics/ParameterLists:
98
+ MaxOptionalParameters: 6
99
+
83
100
  # Offense count: 1
84
- # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
101
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
102
+ # CheckDefinitionPathHierarchyRoots: lib, spec, test, src
85
103
  # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
86
104
  Naming/FileName:
87
105
  Exclude:
@@ -89,20 +107,28 @@ Naming/FileName:
89
107
 
90
108
  # Offense count: 2
91
109
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
92
- # AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
110
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
93
111
  Naming/MethodParameterName:
94
112
  Exclude:
95
113
  - 'lib/twilio-ruby/security/request_validator.rb'
96
114
 
97
115
  # Offense count: 19
98
- # Configuration parameters: EnforcedStyle.
116
+ # Configuration parameters: EnforcedStyle, AllowedIdentifiers.
99
117
  # SupportedStyles: snake_case, camelCase
100
118
  Naming/VariableName:
101
119
  Exclude:
102
120
  - 'spec/jwt/client_capability_spec.rb'
103
121
  - 'spec/jwt/task_router_spec.rb'
104
122
 
105
- # Offense count: 39
123
+ # Offense count: 3
124
+ # Cop supports --auto-correct.
125
+ Style/CaseLikeIf:
126
+ Exclude:
127
+ - 'lib/twilio-ruby/framework/serialize.rb'
128
+ - 'lib/twilio-ruby/jwt/task_router.rb'
129
+
130
+ # Offense count: 40
131
+ # Configuration parameters: AllowedConstants.
106
132
  Style/Documentation:
107
133
  Enabled: false
108
134
 
@@ -119,28 +145,36 @@ Style/ExpandPathArguments:
119
145
  - 'spec/spec_helper.rb'
120
146
  - 'twilio-ruby.gemspec'
121
147
 
122
- # Offense count: 23
148
+ # Offense count: 24
123
149
  # Cop supports --auto-correct.
124
150
  # Configuration parameters: EnforcedStyle.
125
151
  # SupportedStyles: always, always_true, never
126
152
  Style/FrozenStringLiteralComment:
127
153
  Enabled: false
128
154
 
155
+ # Offense count: 1
156
+ # Cop supports --auto-correct.
157
+ Style/GlobalStdStream:
158
+ Exclude:
159
+ - 'spec/rest/client_spec.rb'
160
+
129
161
  # Offense count: 3
130
162
  # Configuration parameters: MinBodyLength.
131
163
  Style/GuardClause:
132
164
  Exclude:
133
165
  - 'lib/twilio-ruby/framework/rest/page.rb'
134
166
 
135
- # Offense count: 1
167
+ # Offense count: 2
136
168
  # Cop supports --auto-correct.
137
- # Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
169
+ # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
138
170
  # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
171
+ # SupportedShorthandSyntax: always, never
139
172
  Style/HashSyntax:
140
173
  Exclude:
174
+ - 'Gemfile'
141
175
  - 'spec/jwt/access_token_spec.rb'
142
176
 
143
- # Offense count: 12
177
+ # Offense count: 13
144
178
  # Cop supports --auto-correct.
145
179
  Style/IfUnlessModifier:
146
180
  Exclude:
@@ -150,6 +184,20 @@ Style/IfUnlessModifier:
150
184
  - 'lib/twilio-ruby/jwt/client_capability.rb'
151
185
  - 'lib/twilio-ruby/jwt/jwt.rb'
152
186
 
187
+ # Offense count: 3
188
+ # Cop supports --auto-correct.
189
+ Style/RedundantAssignment:
190
+ Exclude:
191
+ - 'lib/twilio-ruby/jwt/access_token.rb'
192
+ - 'lib/twilio-ruby/jwt/client_capability.rb'
193
+ - 'lib/twilio-ruby/jwt/task_router.rb'
194
+
195
+ # Offense count: 2
196
+ # Cop supports --auto-correct.
197
+ Style/RedundantFileExtensionInRequire:
198
+ Exclude:
199
+ - 'spec/spec_helper.rb'
200
+
153
201
  # Offense count: 4
154
202
  # Cop supports --auto-correct.
155
203
  Style/RedundantFreeze:
@@ -173,15 +221,30 @@ Style/RegexpLiteral:
173
221
  - 'lib/twilio-ruby/framework/rest/version.rb'
174
222
  - 'spec/rack/twilio_webhook_authentication_spec.rb'
175
223
 
176
- # Offense count: 5
224
+ # Offense count: 12
225
+ # Cop supports --auto-correct.
226
+ # Configuration parameters: Mode.
227
+ Style/StringConcatenation:
228
+ Exclude:
229
+ - 'examples/print_call_log.rb'
230
+ - 'lib/twilio-ruby/framework/request.rb'
231
+ - 'lib/twilio-ruby/framework/rest/error.rb'
232
+ - 'lib/twilio-ruby/framework/serialize.rb'
233
+ - 'lib/twilio-ruby/http/http_client.rb'
234
+ - 'lib/twilio-ruby/jwt/client_capability.rb'
235
+ - 'spec/framework/request_spec.rb'
236
+ - 'spec/spec_helper.rb'
237
+
238
+ # Offense count: 7
177
239
  # Cop supports --auto-correct.
178
240
  # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
179
241
  # SupportedStyles: single_quotes, double_quotes
180
242
  Style/StringLiterals:
181
243
  Exclude:
244
+ - 'Gemfile'
182
245
  - 'spec/framework/serialize_spec.rb'
183
246
 
184
- # Offense count: 14
247
+ # Offense count: 15
185
248
  # Cop supports --auto-correct.
186
249
  # Configuration parameters: AllowNamedUnderscoreVariables.
187
250
  Style/TrailingUnderscoreVariable:
@@ -190,7 +253,7 @@ Style/TrailingUnderscoreVariable:
190
253
  - 'spec/jwt/client_capability_spec.rb'
191
254
  - 'spec/jwt/task_router_spec.rb'
192
255
 
193
- # Offense count: 15
256
+ # Offense count: 16
194
257
  # Cop supports --auto-correct.
195
258
  # Configuration parameters: MinSize, WordRegex.
196
259
  # SupportedStyles: percent, brackets
data/CHANGES.md CHANGED
@@ -1,6 +1,102 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2022-01-26] Version 5.63.1
5
+ ---------------------------
6
+ **Library - Fix**
7
+ - [PR #590](https://github.com/twilio/twilio-ruby/pull/590): Validate signatures in Rack middleware for non-form-data payloads. Thanks to [@gabrielg](https://github.com/gabrielg)!
8
+
9
+ **Library - Chore**
10
+ - [PR #589](https://github.com/twilio/twilio-ruby/pull/589): Add sonarcloud analysis. Thanks to [@BrimmingDev](https://github.com/BrimmingDev)!
11
+ - [PR #588](https://github.com/twilio/twilio-ruby/pull/588): support for rubocop linting on ruby-head. Thanks to [@Hunga1](https://github.com/Hunga1)!
12
+
13
+ **Insights**
14
+ - Added new endpoint to fetch Conference Participant Summary
15
+ - Added new endpoint to fetch Conference Summary
16
+
17
+ **Messaging**
18
+ - Add government_entity parameter to brand apis
19
+
20
+ **Verify**
21
+ - Add Access Token fetch endpoint to retrieve a previously created token.
22
+ - Add Access Token payload to the Access Token creation endpoint, including a unique Sid, so it's addressable while it's TTL is valid.
23
+
24
+
25
+ [2022-01-12] Version 5.63.0
26
+ ---------------------------
27
+ **Library - Feature**
28
+ - [PR #586](https://github.com/twilio/twilio-ruby/pull/586): add GitHub release step during deploy. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
29
+
30
+ **Library - Chore**
31
+ - [PR #584](https://github.com/twilio/twilio-ruby/pull/584): run yard in bundle context. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
32
+ - [PR #583](https://github.com/twilio/twilio-ruby/pull/583): remove githook dependency from make install. Thanks to [@JenniferMah](https://github.com/JenniferMah)!
33
+
34
+ **Api**
35
+ - Make fixed time scheduling parameters public **(breaking change)**
36
+
37
+ **Messaging**
38
+ - Add update brand registration API
39
+
40
+ **Numbers**
41
+ - Add API endpoint for List Bundle Copies resource
42
+
43
+ **Video**
44
+ - Enable external storage for all customers
45
+
46
+
47
+ [2021-12-15] Version 5.62.0
48
+ ---------------------------
49
+ **Library - Feature**
50
+ - [PR #581](https://github.com/twilio/twilio-ruby/pull/581): run tests before deploying. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
51
+
52
+ **Api**
53
+ - Add optional boolean send_as_mms parameter to the create action of Message resource **(breaking change)**
54
+ - Change team ownership for `call` delete
55
+
56
+ **Conversations**
57
+ - Change wording for `Service Webhook Configuration` resource fields
58
+
59
+ **Insights**
60
+ - Added new APIs for updating and getting voice insights flags by accountSid.
61
+
62
+ **Media**
63
+ - Add max_duration param to MediaProcessor
64
+
65
+ **Video**
66
+ - Add `EmptyRoomTimeout` and `UnusedRoomTimeout` properties to a room; add corresponding parameters to room creation
67
+
68
+ **Voice**
69
+ - Add endpoint to delete archived Calls
70
+
71
+
72
+ [2021-12-01] Version 5.61.2
73
+ ---------------------------
74
+ **Library - Chore**
75
+ - [PR #579](https://github.com/twilio/twilio-ruby/pull/579): make ruby-head test optional. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
76
+
77
+ **Conversations**
78
+ - Add `Service Webhook Configuration` resource
79
+
80
+ **Flex**
81
+ - Adding `flex_insights_drilldown` and `flex_url` objects to Flex Configuration
82
+
83
+ **Messaging**
84
+ - Update us_app_to_person endpoints to remove beta feature flag based access
85
+
86
+ **Supersim**
87
+ - Add IP Commands resource
88
+
89
+ **Verify**
90
+ - Add optional `factor_friendly_name` parameter to the create access token endpoint.
91
+
92
+ **Video**
93
+ - Add maxParticipantDuration param to Rooms
94
+
95
+ **Twiml**
96
+ - Unrevert Add supported SSML children to `<emphasis>`, `<lang>`, `<p>`, `<prosody>`, `<s>`, and `<w>`.
97
+ - Revert Add supported SSML children to `<emphasis>`, `<lang>`, `<p>`, `<prosody>`, `<s>`, and `<w>`.
98
+
99
+
4
100
  [2021-11-17] Version 5.61.1
5
101
  ---------------------------
6
102
  **Library - Chore**
data/Makefile CHANGED
@@ -3,17 +3,14 @@
3
3
  githooks:
4
4
  ln -sf ../../githooks/pre-commit .git/hooks/pre-commit
5
5
 
6
- install: githooks
6
+ install:
7
7
  bundle install --with development; bundle exec rake install
8
8
 
9
- test: lint
9
+ test:
10
10
  bundle exec rake spec
11
11
 
12
- lint:
13
- bundle exec rubocop --cache true --parallel
14
-
15
12
  docs:
16
- yard doc --output-dir ./doc
13
+ bundle exec yard doc --output-dir ./doc
17
14
 
18
15
  authors:
19
16
  echo "Authors\n=======\n\nA huge thanks to all of our contributors:\n\n" > AUTHORS.md
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # twilio-ruby
2
2
 
3
- [![Tests](https://github.com/twilio/twilio-ruby/actions/workflows/test.yml/badge.svg)][github-actions]
3
+ [![Tests](https://github.com/twilio/twilio-ruby/actions/workflows/test-and-deploy.yml/badge.svg)][github-actions]
4
4
  [![Gem Version](https://img.shields.io/gem/v/twilio-ruby.svg)](https://rubygems.org/gems/twilio-ruby)
5
5
  [![Learn with TwilioQuest](https://img.shields.io/static/v1?label=TwilioQuest&message=Learn%20to%20contribute%21&color=F22F46&labelColor=1f243c&style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAASFBMVEUAAAAZGRkcHBwjIyMoKCgAAABgYGBoaGiAgICMjIyzs7PJycnMzMzNzc3UoBfd3d3m5ubqrhfrMEDu7u739/f4vSb/3AD///9tbdyEAAAABXRSTlMAAAAAAMJrBrEAAAKoSURBVHgB7ZrRcuI6EESdyxXGYoNFvMD//+l2bSszRgyUYpFAsXOeiJGmj4NkuWx1Qeh+Ekl9DgEXOBwOx+Px5xyQhDykfgq4wG63MxxaR4ddIkg6Ul3g84vCIcjPBA5gmUMeXESrlukuoK33+33uID8TWeLAdOWsKpJYzwVMB7bOzYSGOciyUlXSn0/ABXTosJ1M1SbypZ4O4MbZuIDMU02PMbauhhHMHXbmebmALIiEbbbbbUrpF1gwE9kFfRNAJaP+FQEXCCTGyJ4ngDrjOFo3jEL5JdqjF/pueR4cCeCGgAtwmuRS6gDwaRiGvu+DMFwSBLTE3+jF8JyuV1okPZ+AC4hDFhCHyHQjdjPHUKFDlHSJkHQXMB3KpSwXNGJPcwwTdZiXlRN0gSp0zpWxNtM0beYE0nRH6QIbO7rawwXaBYz0j78gxjokDuv12gVeUuBD0MDi0OQCLvDaAho4juP1Q/jkAncXqIcCfd+7gAu4QLMACCLxpRsSuQh0igu0C9Svhi7weAGZg50L3IE3cai4IfkNZAC8dfdhsUD3CgKBVC9JE5ABAFzg4QL/taYPAAWrHdYcgfLaIgAXWJ7OV38n1LEF8tt2TH29E+QAoDoO5Ve/LtCQDmKM9kPbvCEBApK+IXzbcSJ0cIGF6e8gpcRhUDogWZ8JnaWjPXc/fNnBBUKRngiHgTUSivSzDRDgHZQOLvBQgf8rRt+VdBUUhwkU6VpJ+xcOwQUqZr+mR0kvBUgv6cB4+37hQAkXqE8PwGisGhJtN4xAHMzrsgvI7rccXqSvKh6jltGlrOHA3Xk1At3LC4QiPdX9/0ndHpGVvTjR4bZA1ypAKgVcwE5vx74ulwIugDt8e/X7JgfkucBMIAr26ndnB4UCLnDOqvteQsHlgX9N4A+c4cW3DXSPbwAAAABJRU5ErkJggg==)](https://twil.io/learn-open-source)
6
6
 
@@ -35,13 +35,13 @@ This library supports the following Ruby implementations:
35
35
  To install using [Bundler][bundler] grab the latest stable version:
36
36
 
37
37
  ```ruby
38
- gem 'twilio-ruby', '~> 5.61.1'
38
+ gem 'twilio-ruby', '~> 5.63.1'
39
39
  ```
40
40
 
41
41
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
42
42
 
43
43
  ```bash
44
- gem install twilio-ruby -v 5.61.1
44
+ gem install twilio-ruby -v 5.63.1
45
45
  ```
46
46
 
47
47
  To build and install the development branch yourself from the latest source:
@@ -257,7 +257,7 @@ If you've instead found a bug in the library or would like new features added, g
257
257
  [bundler]: https://bundler.io
258
258
  [rubygems]: https://rubygems.org
259
259
  [gem]: https://rubygems.org/gems/twilio
260
- [github-actions]: https://github.com/twilio/twilio-ruby/actions/workflows/test.yml
260
+ [github-actions]: https://github.com/twilio/twilio-ruby/actions/workflows/test-and-deploy.yml
261
261
  [upgrade]: https://github.com/twilio/twilio-ruby/wiki/Ruby-Version-5.x-Upgrade-Guide
262
262
  [issues]: https://github.com/twilio/twilio-ruby/issues
263
263
  [faraday]: https://github.com/lostisland/faraday
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'rack/media_type'
4
+
3
5
  module Rack
4
6
  # Middleware that authenticates webhooks from Twilio using the request
5
7
  # validator.
@@ -19,6 +21,10 @@ module Rack
19
21
  # doesn't validate then the middleware responds immediately with a 403 status.
20
22
 
21
23
  class TwilioWebhookAuthentication
24
+ # Rack's FORM_DATA_MEDIA_TYPES can be modified to taste, so we're slightly
25
+ # more conservative in what we consider form data.
26
+ FORM_URLENCODED_MEDIA_TYPE = Rack::MediaType.type('application/x-www-form-urlencoded')
27
+
22
28
  def initialize(app, auth_token, *paths, &auth_token_lookup)
23
29
  @app = app
24
30
  @auth_token = auth_token
@@ -30,7 +36,7 @@ module Rack
30
36
  return @app.call(env) unless env['PATH_INFO'].match(@path_regex)
31
37
  request = Rack::Request.new(env)
32
38
  original_url = request.url
33
- params = request.post? ? request.POST : {}
39
+ params = extract_params!(request)
34
40
  auth_token = @auth_token || get_auth_token(params['AccountSid'])
35
41
  validator = Twilio::Security::RequestValidator.new(auth_token)
36
42
  signature = env['HTTP_X_TWILIO_SIGNATURE'] || ''
@@ -44,5 +50,23 @@ module Rack
44
50
  ]
45
51
  end
46
52
  end
53
+
54
+ # Extract the params from the the request that we can use to determine the
55
+ # signature. This _may_ modify the passed in request since it may read/rewind
56
+ # the body.
57
+ def extract_params!(request)
58
+ return {} unless request.post?
59
+
60
+ if request.media_type == FORM_URLENCODED_MEDIA_TYPE
61
+ request.POST
62
+ else
63
+ request.body.rewind
64
+ body = request.body.read
65
+ request.body.rewind
66
+ body
67
+ end
68
+ end
69
+
70
+ private :extract_params!
47
71
  end
48
72
  end
@@ -78,6 +78,13 @@ module Twilio
78
78
  # @param [Boolean] smart_encoded Whether to detect Unicode characters that have a
79
79
  # similar GSM-7 character and replace them. Can be: `true` or `false`.
80
80
  # @param [Array[String]] persistent_action Rich actions for Channels Messages.
81
+ # @param [message.ScheduleType] schedule_type Indicates your intent to schedule a
82
+ # message. Pass the value `fixed` to schedule a message at a fixed time.
83
+ # @param [Time] send_at The time that Twilio will send the message. Must be in ISO
84
+ # 8601 format.
85
+ # @param [Boolean] send_as_mms If set to True, Twilio will deliver the message as
86
+ # a single MMS message, regardless of the presence of media. This is a Beta
87
+ # Feature.
81
88
  # @param [String] from A Twilio phone number in
82
89
  # {E.164}[https://www.twilio.com/docs/glossary/what-e164] format, an {alphanumeric
83
90
  # sender
@@ -108,7 +115,7 @@ module Twilio
108
115
  # parameters in the POST request. You can include up to 10 `media_url` parameters
109
116
  # per message. You can send images in an SMS message in only the US and Canada.
110
117
  # @return [MessageInstance] Created MessageInstance
111
- def create(to: nil, status_callback: :unset, application_sid: :unset, max_price: :unset, provide_feedback: :unset, attempt: :unset, validity_period: :unset, force_delivery: :unset, content_retention: :unset, address_retention: :unset, smart_encoded: :unset, persistent_action: :unset, from: :unset, messaging_service_sid: :unset, body: :unset, media_url: :unset)
118
+ def create(to: nil, status_callback: :unset, application_sid: :unset, max_price: :unset, provide_feedback: :unset, attempt: :unset, validity_period: :unset, force_delivery: :unset, content_retention: :unset, address_retention: :unset, smart_encoded: :unset, persistent_action: :unset, schedule_type: :unset, send_at: :unset, send_as_mms: :unset, from: :unset, messaging_service_sid: :unset, body: :unset, media_url: :unset)
112
119
  data = Twilio::Values.of({
113
120
  'To' => to,
114
121
  'From' => from,
@@ -126,6 +133,9 @@ module Twilio
126
133
  'AddressRetention' => address_retention,
127
134
  'SmartEncoded' => smart_encoded,
128
135
  'PersistentAction' => Twilio.serialize_list(persistent_action) { |e| e },
136
+ 'ScheduleType' => schedule_type,
137
+ 'SendAt' => Twilio.serialize_iso8601_datetime(send_at),
138
+ 'SendAsMms' => send_as_mms,
129
139
  })
130
140
 
131
141
  payload = @version.create('POST', @uri, data: data)
@@ -329,9 +339,11 @@ module Twilio
329
339
  # Update the MessageInstance
330
340
  # @param [String] body The text of the message you want to send. Can be up to
331
341
  # 1,600 characters long.
342
+ # @param [message.UpdateStatus] status When set as `canceled`, allows a message
343
+ # cancelation request if a message has not yet been sent.
332
344
  # @return [MessageInstance] Updated MessageInstance
333
- def update(body: :unset)
334
- data = Twilio::Values.of({'Body' => body, })
345
+ def update(body: :unset, status: :unset)
346
+ data = Twilio::Values.of({'Body' => body, 'Status' => status, })
335
347
 
336
348
  payload = @version.update('POST', @uri, data: data)
337
349
 
@@ -579,9 +591,11 @@ module Twilio
579
591
  # Update the MessageInstance
580
592
  # @param [String] body The text of the message you want to send. Can be up to
581
593
  # 1,600 characters long.
594
+ # @param [message.UpdateStatus] status When set as `canceled`, allows a message
595
+ # cancelation request if a message has not yet been sent.
582
596
  # @return [MessageInstance] Updated MessageInstance
583
- def update(body: :unset)
584
- context.update(body: body, )
597
+ def update(body: :unset, status: :unset)
598
+ context.update(body: body, status: status, )
585
599
  end
586
600
 
587
601
  ##