dyte 0.5.0 → 0.7.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: 64703f6903a37f31962ed9d4f644ff54f644bf5069657711255c6d83041a2b94
4
- data.tar.gz: 8a249ad8367272ea0a7f680262a1278ce62ff06cfefc70afadfbe570f5c03787
3
+ metadata.gz: e6693cbed7d4a1985e073f15e4104417f5079ba7f8782a0310907ddeecd64e5d
4
+ data.tar.gz: 1f256ca55bf017fdc70241a78e7cf6c11fffa25f93444b10bb53b1cba42aae11
5
5
  SHA512:
6
- metadata.gz: d524ae6d023e3e755a8d35c4b1de8b94bd68b3cfef9e21249a7dca36c4c44c355959bac96a282f4139610a09f1fbd64b928e9e1090b4c37b8de73c5928ae14f0
7
- data.tar.gz: 2c125c049aa6ec9055e080004aa2945e6e74e5e5d50f2da1445f6d4cee2095a58cf1747efcad6b1075d8536d594680fe30b4a818f057a8342139e786277eb73e
6
+ metadata.gz: da6f21955b8d98560996737d606c59e94a4501e08cbecdf412d06fa647fed5bd7f957e3232b712c620d48b994db986c79f6316321ae0d08e8a4c4633a0e23161
7
+ data.tar.gz: 4cdd75f5232992a43a128366f5771125a04cdfb84814fd97bdd030c6ffcd9bdaa22e2b982afd6c4545597aece28b8c11cf850482057736bac3a0ebc17b46d6ee
data/README.md CHANGED
@@ -46,6 +46,15 @@ client.meetings.regenerate_token(meeting_id: "id", participant_id: "id")
46
46
 
47
47
  # Returns all participants for the given meeting ID.
48
48
  client.meetings.fetch_participants(meeting_id: "id")
49
+
50
+ # Returns a participant for the given meeting and participant ID.
51
+ client.meetings.fetch_participant_details(meeting_id: "id", participant_id: "id")
52
+
53
+ # Edits a participant for the given meeting and participant ID.
54
+ client.meetings.edit_participant_details(meeting_id: "id", participant_id: "id")
55
+
56
+ # Adds a participant to a meeting.
57
+ client.meetings.add_participant(meeting_id: "id", participant_id: "id")
49
58
  ```
50
59
  ### Presets
51
60
 
@@ -67,8 +76,15 @@ client.sessions.chat_messages(session_id: "id")
67
76
  ### Participants
68
77
 
69
78
  ## Development
79
+ ### Setup
80
+ After checking out the repo run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
81
+
82
+ ### Running Locally
83
+ It can be convenient to run the gem locally while developing, to test changes. To do so, follow these steps:
84
+ 1) Run `bin/console` from the root directory
85
+ 1) Instantiate the client (enter your Dyte credentials) `client = Client.new(organization_id: '1234', api_key: '1234')`
86
+ 1) Run a test command, for example: `client.participants.list(session_id: 1)`
70
87
 
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.
72
88
 
73
89
  ## Contributing
74
90
 
data/lib/dyte/client.rb CHANGED
@@ -35,6 +35,10 @@ module Dyte
35
35
  ActiveSessionsResource.new(self)
36
36
  end
37
37
 
38
+ def organizations
39
+ OrganizationsResource.new(self)
40
+ end
41
+
38
42
  def connection
39
43
  auth_token = Base64.strict_encode64("#{@organization_id}:#{@api_key}")
40
44
  @connection ||= Faraday.new(BASE_URL) do |conn|
@@ -0,0 +1,4 @@
1
+ module Dyte
2
+ class Organization < Object
3
+ end
4
+ end
@@ -33,5 +33,20 @@ module Dyte
33
33
  def delete_participant(meeting_id:, participant_id:)
34
34
  delete_request("meetings/#{meeting_id}/participants/#{participant_id}")
35
35
  end
36
+
37
+ def fetch_participant_details(meeting_id:, participant_id:)
38
+ response = get_request("meetings/#{meeting_id}/participants/#{participant_id}")
39
+ Participant.new response.body.dig("data")
40
+ end
41
+
42
+ def edit_participant_details(meeting_id:, participant_id:, attributes:)
43
+ response = patch_request("meetings/#{meeting_id}/participants/#{participant_id}", body: attributes)
44
+ Participant.new response.body.dig("data")
45
+ end
46
+
47
+ def add_participant(meeting_id:, **attributes)
48
+ response = post_request("meetings/#{meeting_id}/participants", body: attributes)
49
+ Participant.new response.body.dig("data")
50
+ end
36
51
  end
37
52
  end
@@ -0,0 +1,11 @@
1
+ module Dyte
2
+ class OrganizationsResource < Resource
3
+ def create(**attributes)
4
+ Organization.new post_request("orgs", body: attributes).body.dig("data")
5
+ end
6
+
7
+ def update(organization_id:, **attributes)
8
+ Organization.new patch_request("orgs/#{organization_id}", body: attributes).body.dig("data")
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,5 @@
1
+ # This module is deprecated in favour of adding participant actions to the meetings resource. This is for the purpose
2
+ # of better following how Dyte's API is structured. This module will be removed in a future release.
1
3
  module Dyte
2
4
  class ParticipantsResource < Resource
3
5
  def list(session_id:, **params)
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.5.0"
4
+ VERSION = "0.7.0"
5
5
  end
data/lib/dyte.rb CHANGED
@@ -14,6 +14,7 @@ require "dyte/objects/participant"
14
14
  require "dyte/objects/session"
15
15
  require "dyte/objects/recording"
16
16
  require "dyte/objects/active_session"
17
+ require "dyte/objects/organization"
17
18
 
18
19
  # Resources
19
20
  require "dyte/resources/meetings"
@@ -22,6 +23,7 @@ require "dyte/resources/participants"
22
23
  require "dyte/resources/sessions"
23
24
  require "dyte/resources/recordings"
24
25
  require "dyte/resources/active_sessions"
26
+ require "dyte/resources/organizations"
25
27
 
26
28
  module Dyte
27
29
  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.5.0
4
+ version: 0.7.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-19 00:00:00.000000000 Z
11
+ date: 2023-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -52,6 +52,7 @@ files:
52
52
  - lib/dyte/object.rb
53
53
  - lib/dyte/objects/active_session.rb
54
54
  - lib/dyte/objects/meeting.rb
55
+ - lib/dyte/objects/organization.rb
55
56
  - lib/dyte/objects/participant.rb
56
57
  - lib/dyte/objects/preset.rb
57
58
  - lib/dyte/objects/recording.rb
@@ -59,6 +60,7 @@ files:
59
60
  - lib/dyte/resource.rb
60
61
  - lib/dyte/resources/active_sessions.rb
61
62
  - lib/dyte/resources/meetings.rb
63
+ - lib/dyte/resources/organizations.rb
62
64
  - lib/dyte/resources/participants.rb
63
65
  - lib/dyte/resources/presets.rb
64
66
  - lib/dyte/resources/recordings.rb
@@ -87,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
89
  - !ruby/object:Gem::Version
88
90
  version: '0'
89
91
  requirements: []
90
- rubygems_version: 3.4.19
92
+ rubygems_version: 3.4.17
91
93
  signing_key:
92
94
  specification_version: 4
93
95
  summary: A simple wrapper for the Dyte API.