dyte 0.7.0 → 0.7.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
  SHA256:
3
- metadata.gz: e6693cbed7d4a1985e073f15e4104417f5079ba7f8782a0310907ddeecd64e5d
4
- data.tar.gz: 1f256ca55bf017fdc70241a78e7cf6c11fffa25f93444b10bb53b1cba42aae11
3
+ metadata.gz: 6a0d44579e444900e0c0f1886e04bf4af3e75bf7c749cdc9ee01481f8842456b
4
+ data.tar.gz: b31f92d21fbb4f668abfc592d6972c5627077634994f401445ef2df732c7a68f
5
5
  SHA512:
6
- metadata.gz: da6f21955b8d98560996737d606c59e94a4501e08cbecdf412d06fa647fed5bd7f957e3232b712c620d48b994db986c79f6316321ae0d08e8a4c4633a0e23161
7
- data.tar.gz: 4cdd75f5232992a43a128366f5771125a04cdfb84814fd97bdd030c6ffcd9bdaa22e2b982afd6c4545597aece28b8c11cf850482057736bac3a0ebc17b46d6ee
6
+ metadata.gz: 7d56ca8fdd360ed979143a1c5b9ffe68c1d34a65317f46448ef68dd6834b06d0e83dcadae14884a90b55d937e83084454596982117269d9f8ced462ef619d2b0
7
+ data.tar.gz: b70f25b138db96cb8e4d88357394cd54da32a0061708031bfbbad5b3f7d3aac25a9bb0de4197ec1c1924c2f85af475161766c53f29c3d62c09221cf5d4f0b487
data/Gemfile CHANGED
@@ -6,10 +6,9 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  group :development do
9
- gem "rake", "~> 13.0"
9
+ gem "rake", "~> 13.1"
10
10
  gem "standard"
11
- gem "minitest", "~> 5.17"
12
- gem "webmock", "~> 3.18"
13
- gem "solargraph", "~> 0.48.0"
11
+ gem "minitest", "~> 5.21"
12
+ gem "webmock", "~> 3.19"
14
13
  gem "debug"
15
14
  end
data/README.md CHANGED
@@ -55,6 +55,9 @@ client.meetings.edit_participant_details(meeting_id: "id", participant_id: "id")
55
55
 
56
56
  # Adds a participant to a meeting.
57
57
  client.meetings.add_participant(meeting_id: "id", participant_id: "id")
58
+
59
+ # Replaces specified details for the given meeting ID.
60
+ client.meetings.replace( meeting_id: "id", {})
58
61
  ```
59
62
  ### Presets
60
63
 
@@ -73,6 +76,44 @@ client.sessions.fetch_participants(session_id: "id")
73
76
  client.sessions.participant_details(session_id: "id", participant_id: "id")
74
77
  client.sessions.chat_messages(session_id: "id")
75
78
  ```
79
+ ### Organizations
80
+
81
+ ```ruby
82
+ # Creates a new organization. The authenticated user becomes the owner of the organization.
83
+ client.organizations.create(
84
+ {
85
+ "name": "Cool Org",
86
+ "contact": "778-330-2389",
87
+ "website": "https://www.dyte.io",
88
+ "feature_flags": [
89
+ "string"
90
+ ],
91
+ "preferred_region": "ap-south-1"
92
+ }
93
+ )
94
+
95
+ # Updates organization details for the given organization ID. The user must be the organization's owner.
96
+ client.organizations.update(organization_id: "id",
97
+ {
98
+ "name": "A much better name",
99
+ "contact": "string",
100
+ "website": "https://www.dyte.io",
101
+ "feature_flags": [
102
+ "string"
103
+ ],
104
+ "preferred_region": "ap-south-1"
105
+ }
106
+ )
107
+ ```
108
+ ### Webhooks
109
+ ```ruby
110
+ # Returns the Webhook relating to the given ID
111
+ client.webhooks.fetch(webhook_id: "id")
112
+
113
+ # Returns all Webhooks for a given organization
114
+ client.webhooks.list
115
+ ```
116
+
76
117
  ### Participants
77
118
 
78
119
  ## Development
data/lib/dyte/client.rb CHANGED
@@ -39,6 +39,10 @@ module Dyte
39
39
  OrganizationsResource.new(self)
40
40
  end
41
41
 
42
+ def webhooks
43
+ WebhooksResource.new(self)
44
+ end
45
+
42
46
  def connection
43
47
  auth_token = Base64.strict_encode64("#{@organization_id}:#{@api_key}")
44
48
  @connection ||= Faraday.new(BASE_URL) do |conn|
data/lib/dyte/object.rb CHANGED
@@ -3,7 +3,7 @@ require "ostruct"
3
3
  module Dyte
4
4
  class Object < OpenStruct
5
5
  def initialize(attributes)
6
- super to_ostruct(attributes)
6
+ super(to_ostruct(attributes))
7
7
  end
8
8
 
9
9
  def to_ostruct(obj)
@@ -0,0 +1,4 @@
1
+ module Dyte
2
+ class Webhook < Object
3
+ end
4
+ end
@@ -48,5 +48,10 @@ module Dyte
48
48
  response = post_request("meetings/#{meeting_id}/participants", body: attributes)
49
49
  Participant.new response.body.dig("data")
50
50
  end
51
+
52
+ def replace(meeting_id:, **attributes)
53
+ response = put_request("meetings/#{meeting_id}", body: attributes)
54
+ Meeting.new response.body.dig("data")
55
+ end
51
56
  end
52
57
  end
@@ -4,6 +4,10 @@ module Dyte
4
4
  Organization.new post_request("orgs", body: attributes).body.dig("data")
5
5
  end
6
6
 
7
+ def fetch(organization_id:)
8
+ Organization.new get_request("orgs/#{organization_id}").body.dig("data")
9
+ end
10
+
7
11
  def update(organization_id:, **attributes)
8
12
  Organization.new patch_request("orgs/#{organization_id}", body: attributes).body.dig("data")
9
13
  end
@@ -0,0 +1,12 @@
1
+ module Dyte
2
+ class WebhooksResource < Resource
3
+ def fetch(webhook_id:)
4
+ Webhook.new get_request("webhooks/#{webhook_id}").body.dig("data")
5
+ end
6
+
7
+ def list
8
+ response = get_request("webhooks")
9
+ Collection.from_response(response, type: Webhook)
10
+ end
11
+ end
12
+ 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.7.0"
4
+ VERSION = "0.7.1"
5
5
  end
data/lib/dyte.rb CHANGED
@@ -15,6 +15,7 @@ require "dyte/objects/session"
15
15
  require "dyte/objects/recording"
16
16
  require "dyte/objects/active_session"
17
17
  require "dyte/objects/organization"
18
+ require "dyte/objects/webhook"
18
19
 
19
20
  # Resources
20
21
  require "dyte/resources/meetings"
@@ -24,6 +25,7 @@ require "dyte/resources/sessions"
24
25
  require "dyte/resources/recordings"
25
26
  require "dyte/resources/active_sessions"
26
27
  require "dyte/resources/organizations"
28
+ require "dyte/resources/webhooks"
27
29
 
28
30
  module Dyte
29
31
  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.7.0
4
+ version: 0.7.1
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-10-14 00:00:00.000000000 Z
11
+ date: 2024-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -57,6 +57,7 @@ files:
57
57
  - lib/dyte/objects/preset.rb
58
58
  - lib/dyte/objects/recording.rb
59
59
  - lib/dyte/objects/session.rb
60
+ - lib/dyte/objects/webhook.rb
60
61
  - lib/dyte/resource.rb
61
62
  - lib/dyte/resources/active_sessions.rb
62
63
  - lib/dyte/resources/meetings.rb
@@ -65,6 +66,7 @@ files:
65
66
  - lib/dyte/resources/presets.rb
66
67
  - lib/dyte/resources/recordings.rb
67
68
  - lib/dyte/resources/sessions.rb
69
+ - lib/dyte/resources/webhooks.rb
68
70
  - lib/dyte/version.rb
69
71
  - sig/dyte.rbs
70
72
  homepage: https://github.com/nwarwick/dyte
@@ -89,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
91
  - !ruby/object:Gem::Version
90
92
  version: '0'
91
93
  requirements: []
92
- rubygems_version: 3.4.17
94
+ rubygems_version: 3.5.3
93
95
  signing_key:
94
96
  specification_version: 4
95
97
  summary: A simple wrapper for the Dyte API.