mural-ruby 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/mural/chat.rb +38 -0
- data/lib/mural/client/mural_content/chats.rb +20 -0
- data/lib/mural/client/mural_content/facilitation_features.rb +137 -0
- data/lib/mural/client/mural_content.rb +2 -0
- data/lib/mural/private_mode.rb +19 -0
- data/lib/mural/start_voting_session_params.rb +42 -0
- data/lib/mural/timer.rb +21 -0
- data/lib/mural/update_timer_params.rb +16 -0
- data/lib/mural/version.rb +1 -1
- data/lib/mural/voting_session.rb +15 -0
- data/lib/mural/voting_session_result.rb +16 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8729d05b53a5d383aea5858811ac18fd8f058ec2421e126b2fb87868620b95cc
|
4
|
+
data.tar.gz: f126af106ce91cadf5e9a2d80f0ddca2819803e9581b2de69be604489d1d82c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df3382cd566818f95eaafa959c5485027f275a813b310f379e6409e3639025ce268355fa0b00bcc480fef3ece46532a668aab1c70386ceac0c64329ab727cc85
|
7
|
+
data.tar.gz: e925880288ea081a3a1b03de158f404483d8ec72342d373ae806d730709248578eac4d39b58a578ee8d2d436a91234bae03d6582bd1a7f96d5e6fa2533505fed
|
data/README.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Mural Ruby
|
2
2
|
|
3
|
+
[](https://github.com/mickaelpham/mural-ruby/actions/workflows/ruby.yml?query=branch%3Amain)
|
4
|
+
[](https://rubygems.org/gems/mural-ruby)
|
5
|
+
[](https://github.com/mickaelpham/mural-ruby/blob/main/UNLICENSE)
|
6
|
+
|
7
|
+
|
3
8
|
Ruby library for the [Mural](https://app.mural.co) public API.
|
4
9
|
|
5
10
|
## Installation
|
data/lib/mural/chat.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mural
|
4
|
+
class Chat
|
5
|
+
include Mural::Codec
|
6
|
+
|
7
|
+
# https://developers.mural.co/public/reference/getmuralchat
|
8
|
+
define_attributes(
|
9
|
+
# The ID of the chat message.
|
10
|
+
id: 'id',
|
11
|
+
# The content of the chat message.
|
12
|
+
message: 'message',
|
13
|
+
# The timestamp of the chat message.
|
14
|
+
created_on: 'createdOn',
|
15
|
+
# The user object
|
16
|
+
user: 'user'
|
17
|
+
)
|
18
|
+
|
19
|
+
def self.decode(json)
|
20
|
+
super.tap do |chat|
|
21
|
+
chat.user = User.decode(chat.user)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class User
|
26
|
+
include Mural::Codec
|
27
|
+
|
28
|
+
define_attributes(
|
29
|
+
# First name of the member or guest in the chat.
|
30
|
+
first_name: 'firstName',
|
31
|
+
# Last name of the member or guest in the chat.
|
32
|
+
last_name: 'lastName',
|
33
|
+
# ID of a user.
|
34
|
+
id: 'id'
|
35
|
+
)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mural
|
4
|
+
class Client
|
5
|
+
class MuralContent
|
6
|
+
module Chats
|
7
|
+
# https://developers.mural.co/public/reference/getmuralchat
|
8
|
+
def list_chats(mural_id, next_page: nil)
|
9
|
+
json = get(
|
10
|
+
"/api/public/v1/murals/#{mural_id}/chat",
|
11
|
+
{ next: next_page }
|
12
|
+
)
|
13
|
+
|
14
|
+
chats = json['value'].map { |c| Mural::Chat.decode(c) }
|
15
|
+
[chats, json['next']]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mural
|
4
|
+
class Client
|
5
|
+
class MuralContent
|
6
|
+
module FacilitationFeatures
|
7
|
+
# https://developers.mural.co/public/reference/startprivatemode
|
8
|
+
def start_private_mode(mural_id, hide_authors: false)
|
9
|
+
json = post(
|
10
|
+
"/api/public/v1/murals/#{mural_id}/private-mode/start",
|
11
|
+
{ hideAuthors: hide_authors }
|
12
|
+
)
|
13
|
+
|
14
|
+
Mural::PrivateMode.decode(json['value'])
|
15
|
+
end
|
16
|
+
|
17
|
+
# https://developers.mural.co/public/reference/stopprivatemode
|
18
|
+
def end_private_mode(mural_id)
|
19
|
+
post("/api/public/v1/murals/#{mural_id}/private-mode/end")
|
20
|
+
end
|
21
|
+
|
22
|
+
# https://developers.mural.co/public/reference/getprivatemode
|
23
|
+
def retrieve_private_mode(mural_id)
|
24
|
+
json = get("/api/public/v1/murals/#{mural_id}/private-mode")
|
25
|
+
|
26
|
+
Mural::PrivateMode.decode(json['value'])
|
27
|
+
end
|
28
|
+
|
29
|
+
# https://developers.mural.co/public/reference/getmuralvotingsessions
|
30
|
+
def list_voting_sessions(mural_id, next_page: nil)
|
31
|
+
json = get(
|
32
|
+
"/api/public/v1/murals/#{mural_id}/voting-sessions",
|
33
|
+
{ next: next_page }
|
34
|
+
)
|
35
|
+
|
36
|
+
voting_sessions = json['value'].map do |session|
|
37
|
+
Mural::VotingSession.decode(session)
|
38
|
+
end
|
39
|
+
|
40
|
+
[voting_sessions, json['next']]
|
41
|
+
end
|
42
|
+
|
43
|
+
# https://developers.mural.co/public/reference/getmuralvotingsessionresults
|
44
|
+
def list_voting_session_results(
|
45
|
+
mural_id,
|
46
|
+
voting_session_id,
|
47
|
+
next_page: nil
|
48
|
+
)
|
49
|
+
json = get(
|
50
|
+
"/api/public/v1/murals/#{mural_id}/voting-sessions" \
|
51
|
+
"/#{voting_session_id}/results",
|
52
|
+
{ next: next_page }
|
53
|
+
)
|
54
|
+
|
55
|
+
voting_session_results = json['value'].map do |result|
|
56
|
+
Mural::VotingSessionResult.decode(result)
|
57
|
+
end
|
58
|
+
|
59
|
+
[voting_session_results, json['next']]
|
60
|
+
end
|
61
|
+
|
62
|
+
# https://developers.mural.co/public/reference/getmuralvotingsessionbyid
|
63
|
+
def retrieve_voting_session(mural_id, voting_session_id)
|
64
|
+
json = get(
|
65
|
+
"/api/public/v1/murals/#{mural_id}/voting-sessions" \
|
66
|
+
"/#{voting_session_id}"
|
67
|
+
)
|
68
|
+
|
69
|
+
Mural::VotingSession.decode(json['value'])
|
70
|
+
end
|
71
|
+
|
72
|
+
# https://developers.mural.co/public/reference/deletemuralvotingsessionbyid
|
73
|
+
def destroy_voting_session(mural_id, voting_session_id)
|
74
|
+
delete(
|
75
|
+
"/api/public/v1/murals/#{mural_id}/voting-sessions" \
|
76
|
+
"/#{voting_session_id}"
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
# https://developers.mural.co/public/reference/startmuralvotingsession
|
81
|
+
def start_voting_session(mural_id, start_voting_session_params)
|
82
|
+
json = post(
|
83
|
+
"/api/public/v1/murals/#{mural_id}/voting-sessions/start",
|
84
|
+
start_voting_session_params.encode
|
85
|
+
)
|
86
|
+
|
87
|
+
Mural::VotingSession.decode(json['value'])
|
88
|
+
end
|
89
|
+
|
90
|
+
# https://developers.mural.co/public/reference/endmuralvotingsession
|
91
|
+
def end_voting_session(mural_id)
|
92
|
+
post("/api/public/v1/murals/#{mural_id}/voting-sessions/end")
|
93
|
+
end
|
94
|
+
|
95
|
+
# https://developers.mural.co/public/reference/votewidgetmuralvotingsession
|
96
|
+
def vote_for_widget(mural_id, widget_id)
|
97
|
+
post(
|
98
|
+
"/api/public/v1/murals/#{mural_id}/voting-sessions" \
|
99
|
+
"/vote/#{widget_id}"
|
100
|
+
)
|
101
|
+
end
|
102
|
+
|
103
|
+
# https://developers.mural.co/public/reference/getmuraltimer
|
104
|
+
def retrieve_timer(mural_id)
|
105
|
+
json = get("/api/public/v1/murals/#{mural_id}/timer")
|
106
|
+
|
107
|
+
Mural::Timer.decode(json['value'])
|
108
|
+
end
|
109
|
+
|
110
|
+
# https://developers.mural.co/public/reference/startmuraltimer
|
111
|
+
def start_timer(mural_id, duration:, sound_enabled: true)
|
112
|
+
json = post(
|
113
|
+
"/api/public/v1/murals/#{mural_id}/timer/start",
|
114
|
+
{ duration: duration, soundEnabled: sound_enabled }
|
115
|
+
)
|
116
|
+
|
117
|
+
Mural::Timer.decode(json['value'])
|
118
|
+
end
|
119
|
+
|
120
|
+
# https://developers.mural.co/public/reference/stopmuraltimer
|
121
|
+
def end_timer(mural_id)
|
122
|
+
post("/api/public/v1/murals/#{mural_id}/timer/end")
|
123
|
+
end
|
124
|
+
|
125
|
+
# https://developers.mural.co/public/reference/updatemuraltimer
|
126
|
+
def update_timer(mural_id, update_timer_params)
|
127
|
+
json = patch(
|
128
|
+
"/api/public/v1/murals/#{mural_id}/timer",
|
129
|
+
update_timer_params.encode
|
130
|
+
)
|
131
|
+
|
132
|
+
Mural::Timer.decode(json['value'])
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mural
|
4
|
+
class PrivateMode
|
5
|
+
include Mural::Codec
|
6
|
+
|
7
|
+
# https://developers.mural.co/public/reference/startprivatemode
|
8
|
+
define_attributes(
|
9
|
+
# If true, the private mode is active.
|
10
|
+
active: 'active',
|
11
|
+
# The timestamp when private mode started.
|
12
|
+
initial_timestamp: 'initialTimestamp',
|
13
|
+
# The user who started the private mode.
|
14
|
+
started_by: 'startedBy',
|
15
|
+
# If true, the authors of the content will be hidden.
|
16
|
+
hide_authors: 'hideAuthors'
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mural
|
4
|
+
class StartVotingSessionParams
|
5
|
+
include Mural::Codec
|
6
|
+
|
7
|
+
# https://developers.mural.co/public/reference/startmuralvotingsession
|
8
|
+
define_attributes(
|
9
|
+
# The title of the voting session.
|
10
|
+
title: 'title',
|
11
|
+
# The number of votes allowed in the session.
|
12
|
+
number_of_votes: 'numberOfVotes',
|
13
|
+
# The types of widgets that can be voted on in this session.
|
14
|
+
widget_types: 'widgetTypes',
|
15
|
+
# If true, anyone can end the voting session.
|
16
|
+
anyone_can_end: 'anyoneCanEnd',
|
17
|
+
# The area on the mural where the voting session will take place.
|
18
|
+
area: 'area'
|
19
|
+
)
|
20
|
+
|
21
|
+
def encode
|
22
|
+
super.tap do |json|
|
23
|
+
json['area'] = json['area']&.encode
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class Area
|
28
|
+
include Mural::Codec
|
29
|
+
|
30
|
+
define_attributes(
|
31
|
+
# The top coordinate of the area.
|
32
|
+
top: 'top',
|
33
|
+
# The left coordinate of the area.
|
34
|
+
left: 'left',
|
35
|
+
# The width of the area.
|
36
|
+
width: 'width',
|
37
|
+
# The height of the area.
|
38
|
+
height: 'height'
|
39
|
+
)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/mural/timer.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mural
|
4
|
+
class Timer
|
5
|
+
include Mural::Codec
|
6
|
+
|
7
|
+
define_attributes(
|
8
|
+
# Timer duration in seconds.
|
9
|
+
duration: 'duration',
|
10
|
+
# The initial timestamp of the timer in ms.
|
11
|
+
initial_timestamp: 'initialTimestamp',
|
12
|
+
# The current timestamp of the timer in ms.
|
13
|
+
now: 'now',
|
14
|
+
# The paused timestamp of the timer in ms. Null if no pause action was
|
15
|
+
# performed.
|
16
|
+
paused_timestamp: 'pausedTimestamp',
|
17
|
+
# If true, the timer will play a sound when it ends.
|
18
|
+
sound_enabled: 'soundEnabled'
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mural
|
4
|
+
class UpdateTimerParams
|
5
|
+
include Mural::Codec
|
6
|
+
|
7
|
+
define_attributes(
|
8
|
+
# Add +/- extra time to the running timer in seconds.
|
9
|
+
delta: 'delta',
|
10
|
+
# If true, the timer will pause.
|
11
|
+
paused: 'paused',
|
12
|
+
# If true, the timer will play a sound when it ends.
|
13
|
+
sound_enabled: 'soundEnabled'
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
data/lib/mural/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mural
|
4
|
+
class VotingSession
|
5
|
+
include Mural::Codec
|
6
|
+
|
7
|
+
# https://developers.mural.co/public/reference/getmuralvotingsessions
|
8
|
+
define_attributes(
|
9
|
+
# The ID of the voting session.
|
10
|
+
id: 'id',
|
11
|
+
# The title of the voting session.
|
12
|
+
title: 'title'
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Mural
|
4
|
+
class VotingSessionResult
|
5
|
+
include Mural::Codec
|
6
|
+
|
7
|
+
define_attributes(
|
8
|
+
# Unique identifier of a widget.
|
9
|
+
widget_id: 'widgetId',
|
10
|
+
# The total number of votes for the widget.
|
11
|
+
total_votes: 'totalVotes',
|
12
|
+
# The number of unique collaborators that voted for the widget.
|
13
|
+
unique_voters: 'uniqueVoters'
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mural-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mickaël Pham
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -42,9 +42,12 @@ files:
|
|
42
42
|
- img/smart-planner.png
|
43
43
|
- lib/mural.rb
|
44
44
|
- lib/mural/asset.rb
|
45
|
+
- lib/mural/chat.rb
|
45
46
|
- lib/mural/client.rb
|
46
47
|
- lib/mural/client/authentication.rb
|
47
48
|
- lib/mural/client/mural_content.rb
|
49
|
+
- lib/mural/client/mural_content/chats.rb
|
50
|
+
- lib/mural/client/mural_content/facilitation_features.rb
|
48
51
|
- lib/mural/client/mural_content/files.rb
|
49
52
|
- lib/mural/client/mural_content/sticky_notes.rb
|
50
53
|
- lib/mural/client/mural_content/tags.rb
|
@@ -69,6 +72,7 @@ files:
|
|
69
72
|
- lib/mural/mural_invitation.rb
|
70
73
|
- lib/mural/mural_invitation_params.rb
|
71
74
|
- lib/mural/mural_user.rb
|
75
|
+
- lib/mural/private_mode.rb
|
72
76
|
- lib/mural/removed_mural_user.rb
|
73
77
|
- lib/mural/removed_room_user.rb
|
74
78
|
- lib/mural/room.rb
|
@@ -79,14 +83,19 @@ files:
|
|
79
83
|
- lib/mural/search_mural_result.rb
|
80
84
|
- lib/mural/search_room_result.rb
|
81
85
|
- lib/mural/search_template_result.rb
|
86
|
+
- lib/mural/start_voting_session_params.rb
|
82
87
|
- lib/mural/tag.rb
|
83
88
|
- lib/mural/template.rb
|
89
|
+
- lib/mural/timer.rb
|
84
90
|
- lib/mural/update_mural_params.rb
|
85
91
|
- lib/mural/update_room_params.rb
|
86
92
|
- lib/mural/update_room_user_params.rb
|
87
93
|
- lib/mural/update_sticky_note_params.rb
|
88
94
|
- lib/mural/update_tag_params.rb
|
95
|
+
- lib/mural/update_timer_params.rb
|
89
96
|
- lib/mural/version.rb
|
97
|
+
- lib/mural/voting_session.rb
|
98
|
+
- lib/mural/voting_session_result.rb
|
90
99
|
- lib/mural/widget.rb
|
91
100
|
- lib/mural/widget/area.rb
|
92
101
|
- lib/mural/widget/arrow.rb
|