dyte 0.3.0 → 0.5.0

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
  SHA256:
3
- metadata.gz: bb0e6b7dd2bbfbe01192bf25c4172c482cab0214fc93071f83c3a9b2ddcbe0ba
4
- data.tar.gz: 79bae7af5887bb11aebe10e6c6a227cf977546014498c3a25fe7cff93e2b411b
3
+ metadata.gz: 64703f6903a37f31962ed9d4f644ff54f644bf5069657711255c6d83041a2b94
4
+ data.tar.gz: 8a249ad8367272ea0a7f680262a1278ce62ff06cfefc70afadfbe570f5c03787
5
5
  SHA512:
6
- metadata.gz: 00bcc5e262e6d8d52203e64de30e85f40e4166d29cdf409342d645fe06472332b829324ae51b5f33b15cb083cc7dcd31dccd6cfbfe644ca6d1952aeccdc1a50e
7
- data.tar.gz: aabdec40c608104026629c8ed432f351d680afdef9186483230bcdb1ba640c5b92cf4eeece0fe7d64c20fe9a59e1b72aef82b2d542c4197568ff10008b7d3710
6
+ metadata.gz: d524ae6d023e3e755a8d35c4b1de8b94bd68b3cfef9e21249a7dca36c4c44c355959bac96a282f4139610a09f1fbd64b928e9e1090b4c37b8de73c5928ae14f0
7
+ data.tar.gz: 2c125c049aa6ec9055e080004aa2945e6e74e5e5d50f2da1445f6d4cee2095a58cf1747efcad6b1075d8536d594680fe30b4a818f057a8342139e786277eb73e
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gemspec
7
7
 
8
8
  group :development do
9
9
  gem "rake", "~> 13.0"
10
- gem "standard", "~> 1.24"
10
+ gem "standard"
11
11
  gem "minitest", "~> 5.17"
12
12
  gem "webmock", "~> 3.18"
13
13
  gem "solargraph", "~> 0.48.0"
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Dyte
2
2
 
3
3
  A gem that wraps v2 of the [Dyte API](https://docs.dyte.io/api/#/) to make it easy to use in Ruby applications.
4
- Please note that some resources are not yet implemented. This is due to the fact that v2 of the Dyte API is incomplete. Once the Dyte team has finalized the response structure the remaining resources will be implemented.
4
+ Please note that some resources are not yet implemented. This is due to the fact that v2 of the Dyte API is incomplete. Once the Dyte team has finalized the response structure the remaining resources will be implemented. In order to obtain access to v2 of the Dyte API please contact the Dyte team.
5
5
 
6
- Bugs reports and pull requests are welcome! ❤️
6
+ Issues and pull requests are welcome! ❤️
7
7
 
8
8
  ## Installation
9
9
 
@@ -25,15 +25,30 @@ Or install it yourself as:
25
25
  TODO: Write usage instructions here
26
26
 
27
27
  ## Resources
28
+
28
29
  ### Meetings
30
+
29
31
  ```ruby
32
+ # Returns all meetings in an organization.
30
33
  client.meetings.list
34
+
35
+ # Returns a meeting in an organization for the given meeting ID.
31
36
  client.meetings.fetch(meeting_id: "id")
37
+
38
+ # Creates a meeting in an organization.
32
39
  client.meetings.create({})
40
+
41
+ # Updates a meeting in an organization for the given meeting ID.
33
42
  client.meetings.update(meeting_id: "id", {})
43
+
44
+ # Regenerates participant's authentication token for the given meeting and participant ID.
34
45
  client.meetings.regenerate_token(meeting_id: "id", participant_id: "id")
46
+
47
+ # Returns all participants for the given meeting ID.
48
+ client.meetings.fetch_participants(meeting_id: "id")
35
49
  ```
36
50
  ### Presets
51
+
37
52
  ```ruby
38
53
  client.presets.list
39
54
  client.presets.fetch(preset_id: "id")
@@ -41,6 +56,7 @@ client.presets.create({})
41
56
  client.presets.update(preset_id: "id", {})
42
57
  ```
43
58
  ### Sessions
59
+
44
60
  ```ruby
45
61
  client.sessions.list
46
62
  client.sessions.fetch(session_id: "id")
@@ -52,9 +68,7 @@ client.sessions.chat_messages(session_id: "id")
52
68
 
53
69
  ## Development
54
70
 
55
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
56
-
57
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
71
+ After checking out the repo run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
58
72
 
59
73
  ## Contributing
60
74
 
data/lib/dyte/client.rb CHANGED
@@ -35,16 +35,6 @@ module Dyte
35
35
  ActiveSessionsResource.new(self)
36
36
  end
37
37
 
38
- def connection_v1
39
- @connection ||= Faraday.new("#{BASE_URL}/#{@organization_id}") do |conn|
40
- conn.headers["Authorization"] = @api_key
41
-
42
- conn.request :json
43
-
44
- conn.response :json, content_type: "application/json"
45
- end
46
- end
47
-
48
38
  def connection
49
39
  auth_token = Base64.strict_encode64("#{@organization_id}:#{@api_key}")
50
40
  @connection ||= Faraday.new(BASE_URL) do |conn|
@@ -22,7 +22,16 @@ module Dyte
22
22
  end
23
23
 
24
24
  def regenerate_token(meeting_id:, participant_id:, **attributes)
25
- Meeting.new post_request("meetings/#{meeting_id}/participants/#{participant_id}/token", body: attributes).body.dig("data")
25
+ post_request("meetings/#{meeting_id}/participants/#{participant_id}/token", body: attributes).body.dig("data")
26
+ end
27
+
28
+ def fetch_participants(meeting_id:)
29
+ response = get_request("meetings/#{meeting_id}/participants")
30
+ Collection.from_response(response, type: Participant)
31
+ end
32
+
33
+ def delete_participant(meeting_id:, participant_id:)
34
+ delete_request("meetings/#{meeting_id}/participants/#{participant_id}")
26
35
  end
27
36
  end
28
37
  end
@@ -16,11 +16,11 @@ module Dyte
16
16
  end
17
17
 
18
18
  def participant_details(session_id:, participant_id:)
19
- Session.new get_request("sessions/#{session_id}/participants/#{participant_id}").body.dig("data")
19
+ get_request("sessions/#{session_id}/participants/#{participant_id}").body.dig("data")
20
20
  end
21
21
 
22
22
  def chat_messages(session_id:)
23
- Session.new get_request("sessions/#{session_id}/chat").body.dig("data")
23
+ get_request("sessions/#{session_id}/chat").body.dig("data")
24
24
  end
25
25
  end
26
26
  end
data/lib/dyte/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dyte
4
- VERSION = "0.3.0"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyte
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Warwick
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-06 00:00:00.000000000 Z
11
+ date: 2023-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  requirements: []
90
- rubygems_version: 3.4.10
90
+ rubygems_version: 3.4.19
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: A simple wrapper for the Dyte API.