mural-ruby 0.4.0 → 0.5.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 +4 -4
- data/README.md +4 -0
- data/lib/mural/client/mural_content/comments.rb +37 -0
- data/lib/mural/client/mural_content/images.rb +29 -0
- data/lib/mural/client/mural_content/shapes.rb +38 -0
- data/lib/mural/client/mural_content/sticky_notes.rb +12 -2
- data/lib/mural/client/mural_content/tables.rb +24 -0
- data/lib/mural/client/mural_content/text_boxes.rb +37 -0
- data/lib/mural/client/mural_content/titles.rb +37 -0
- data/lib/mural/client/mural_content.rb +6 -0
- data/lib/mural/client.rb +0 -1
- data/lib/mural/version.rb +1 -1
- data/lib/mural/widget/create_comment_params.rb +23 -0
- data/lib/mural/widget/create_image_params.rb +44 -0
- data/lib/mural/widget/create_shape_params.rb +39 -0
- data/lib/mural/widget/create_sticky_note_params.rb +43 -0
- data/lib/mural/widget/create_table_cell_params.rb +37 -0
- data/lib/mural/widget/create_table_params.rb +47 -0
- data/lib/mural/widget/create_text_box_params.rb +39 -0
- data/lib/mural/widget/create_title_params.rb +39 -0
- data/lib/mural/widget/image.rb +1 -1
- data/lib/mural/widget/table.rb +29 -7
- data/lib/mural/widget/table_cell.rb +35 -5
- data/lib/mural/widget/text.rb +1 -1
- data/lib/mural/widget/update_comment_params.rb +17 -0
- data/lib/mural/widget/update_image_params.rb +15 -0
- data/lib/mural/widget/update_shape_params.rb +23 -0
- data/lib/mural/widget/update_sticky_note_params.rb +26 -0
- data/lib/mural/widget/update_text_box_params.rb +23 -0
- data/lib/mural/widget/update_title_params.rb +23 -0
- metadata +22 -4
- data/lib/mural/create_sticky_note_params.rb +0 -37
- data/lib/mural/update_sticky_note_params.rb +0 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a608bc7d2068d3dc93b5fe418056e3cd0984aa2b52a816fae303ed12fee0b79e
|
|
4
|
+
data.tar.gz: ab8c92e86470e8097b412ffaf00c1f2623b514880aad9f91eb6aed4db5793608
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e07b3ceb356a332fdc05e7617f918ddc6d6252e62d1a6eb5ce80f8dd90520e24b1fd1a7dbbc49a2c63280181efb7d0604eded0721068dfde4a3c12c798fd2e0
|
|
7
|
+
data.tar.gz: ed42dc8b9b6445d3c239638a822aebff449c0472261171d5f5d1b9c7abfaf6ac9c68dd3eef6dc62e93ca394be7b9c3b69dfedd9bad0e3307903b142cc1238e42
|
data/README.md
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
Ruby library for the [Mural](https://app.mural.co) public API.
|
|
9
9
|
|
|
10
|
+
**Disclaimer: the views and opinions expressed in this repository are solelythose of the individual contributors and do not represent the official view of Tactivos, Inc. d/b/a Mural.**
|
|
11
|
+
|
|
12
|
+
**Mural does not endorse this repository in any way.**
|
|
13
|
+
|
|
10
14
|
## Installation
|
|
11
15
|
|
|
12
16
|
```sh
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Client
|
|
5
|
+
class MuralContent
|
|
6
|
+
module Comments
|
|
7
|
+
# Create a comment widget on a mural.
|
|
8
|
+
#
|
|
9
|
+
# Authorization scope: murals:write
|
|
10
|
+
#
|
|
11
|
+
# https://developers.mural.co/public/reference/createcomment
|
|
12
|
+
def create_comment(mural_id, create_comment_params)
|
|
13
|
+
json = post(
|
|
14
|
+
"/api/public/v1/murals/#{mural_id}/widgets/comment",
|
|
15
|
+
create_comment_params.encode
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
Mural::Widget::Comment.decode(json['value'])
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Update a comment widget on a mural.
|
|
22
|
+
#
|
|
23
|
+
# Authorization scope: murals:write
|
|
24
|
+
#
|
|
25
|
+
# https://developers.mural.co/public/reference/updatecomment
|
|
26
|
+
def update_comment(mural_id, comment_id, update_comment_params)
|
|
27
|
+
json = patch(
|
|
28
|
+
"/api/public/v1/murals/#{mural_id}/widgets/comment/#{comment_id}",
|
|
29
|
+
update_comment_params.encode
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
Mural::Widget::Comment.decode(json['value'])
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Client
|
|
5
|
+
class MuralContent
|
|
6
|
+
module Images
|
|
7
|
+
# https://developers.mural.co/public/reference/createimage
|
|
8
|
+
def create_image(mural_id, create_image_params)
|
|
9
|
+
json = post(
|
|
10
|
+
"/api/public/v1/murals/#{mural_id}/widgets/image",
|
|
11
|
+
create_image_params.encode
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
Mural::Widget::Image.decode(json['value'])
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# https://developers.mural.co/public/reference/createimage
|
|
18
|
+
def update_image(mural_id, image_id, update_image_params)
|
|
19
|
+
json = patch(
|
|
20
|
+
"/api/public/v1/murals/#{mural_id}/widgets/image/#{image_id}",
|
|
21
|
+
update_image_params.encode
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
Mural::Widget::Image.decode(json['value'])
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Client
|
|
5
|
+
class MuralContent
|
|
6
|
+
module Shapes
|
|
7
|
+
# Create one or more shape widgets on a mural. Limit 1000.
|
|
8
|
+
#
|
|
9
|
+
# Authorization scope: murals:write
|
|
10
|
+
#
|
|
11
|
+
# https://developers.mural.co/public/reference/createshapewidget
|
|
12
|
+
def create_shapes(mural_id, create_shape_params)
|
|
13
|
+
json = post(
|
|
14
|
+
"/api/public/v1/murals/#{mural_id}/widgets/shape",
|
|
15
|
+
[*create_shape_params].map(&:encode)
|
|
16
|
+
)
|
|
17
|
+
json['value'].map do |json_shape|
|
|
18
|
+
Mural::Widget::Shape.decode(json_shape)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Update a shape widget on a mural.
|
|
23
|
+
#
|
|
24
|
+
# Authorization scope: murals:write
|
|
25
|
+
#
|
|
26
|
+
# https://developers.mural.co/public/reference/updateshapewidget
|
|
27
|
+
def update_shape(mural_id, shape_id, update_shape_params)
|
|
28
|
+
json = patch(
|
|
29
|
+
"/api/public/v1/murals/#{mural_id}/widgets/shape/#{shape_id}",
|
|
30
|
+
update_shape_params.encode
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
Mural::Widget::Shape.decode(json['value'])
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -4,6 +4,10 @@ module Mural
|
|
|
4
4
|
class Client
|
|
5
5
|
class MuralContent
|
|
6
6
|
module StickyNotes
|
|
7
|
+
# Create one or more sticky note widgets on a mural. Limit 1000.
|
|
8
|
+
#
|
|
9
|
+
# Authorization scope: murals:write
|
|
10
|
+
#
|
|
7
11
|
# https://developers.mural.co/public/reference/createstickynote
|
|
8
12
|
def create_sticky_notes(mural_id, create_sticky_note_params)
|
|
9
13
|
json = post(
|
|
@@ -14,11 +18,17 @@ module Mural
|
|
|
14
18
|
json['value'].map { |s| Mural::Widget::StickyNote.decode(s) }
|
|
15
19
|
end
|
|
16
20
|
|
|
21
|
+
# Update a sticky note widget on a mural.
|
|
22
|
+
#
|
|
23
|
+
# Authorization scope: murals:write
|
|
24
|
+
#
|
|
17
25
|
# https://developers.mural.co/public/reference/updatestickynote
|
|
18
|
-
def update_sticky_note(
|
|
26
|
+
def update_sticky_note(
|
|
27
|
+
mural_id, sticky_note_id, update_sticky_note_params
|
|
28
|
+
)
|
|
19
29
|
json = patch(
|
|
20
30
|
"/api/public/v1/murals/#{mural_id}/widgets/sticky-note" \
|
|
21
|
-
"/#{
|
|
31
|
+
"/#{sticky_note_id}",
|
|
22
32
|
update_sticky_note_params.encode
|
|
23
33
|
)
|
|
24
34
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Client
|
|
5
|
+
class MuralContent
|
|
6
|
+
module Tables
|
|
7
|
+
# Create a table widget on a mural.
|
|
8
|
+
#
|
|
9
|
+
# Authorization scope: murals:write
|
|
10
|
+
#
|
|
11
|
+
# https://developers.mural.co/public/reference/createtable
|
|
12
|
+
def create_table(mural_id, create_table_params)
|
|
13
|
+
json = post(
|
|
14
|
+
"/api/public/v1/murals/#{mural_id}/widgets/table",
|
|
15
|
+
create_table_params.encode
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# We receive a mix of Table and TableCell widgets
|
|
19
|
+
json['value'].map { |widget| Mural::Widget.decode(widget) }
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Client
|
|
5
|
+
class MuralContent
|
|
6
|
+
module TextBoxes
|
|
7
|
+
# Create one or more text box widgets on a mural. Limit 1000.
|
|
8
|
+
#
|
|
9
|
+
# Authorization scope: murals:write
|
|
10
|
+
#
|
|
11
|
+
# https://developers.mural.co/public/reference/createtextbox
|
|
12
|
+
def create_text_boxes(mural_id, create_text_box_params)
|
|
13
|
+
json = post(
|
|
14
|
+
"/api/public/v1/murals/#{mural_id}/widgets/textbox",
|
|
15
|
+
[*create_text_box_params].map(&:encode)
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
json['value'].map { |text_box| Mural::Widget::Text.decode(text_box) }
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Update a textbox on a mural
|
|
22
|
+
#
|
|
23
|
+
# Authorization scope: murals:write
|
|
24
|
+
#
|
|
25
|
+
# https://developers.mural.co/public/reference/updatetextbox
|
|
26
|
+
def update_text_box(mural_id, text_box_id, update_text_box_params)
|
|
27
|
+
json = patch(
|
|
28
|
+
"/api/public/v1/murals/#{mural_id}/widgets/textbox/#{text_box_id}",
|
|
29
|
+
update_text_box_params.encode
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
Mural::Widget::Text.decode(json['value'])
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Client
|
|
5
|
+
class MuralContent
|
|
6
|
+
module Titles
|
|
7
|
+
# Create one or more title widgets on a mural. Limit 1000.
|
|
8
|
+
#
|
|
9
|
+
# Authorization scope: murals:write
|
|
10
|
+
#
|
|
11
|
+
# https://developers.mural.co/public/reference/createtitle
|
|
12
|
+
def create_titles(mural_id, create_title_params)
|
|
13
|
+
json = post(
|
|
14
|
+
"/api/public/v1/murals/#{mural_id}/widgets/title",
|
|
15
|
+
[*create_title_params].map(&:encode)
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
json['value'].map { |title| Mural::Widget::Text.decode(title) }
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Update a title on a mural
|
|
22
|
+
#
|
|
23
|
+
# Authorization scope: murals:write
|
|
24
|
+
#
|
|
25
|
+
# https://developers.mural.co/public/reference/updatetitle
|
|
26
|
+
def update_title(mural_id, title_id, update_title_params)
|
|
27
|
+
json = patch(
|
|
28
|
+
"/api/public/v1/murals/#{mural_id}/widgets/title/#{title_id}",
|
|
29
|
+
update_title_params.encode
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
Mural::Widget::Text.decode(json['value'])
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -8,10 +8,16 @@ module Mural
|
|
|
8
8
|
include Areas
|
|
9
9
|
include Arrows
|
|
10
10
|
include Chats
|
|
11
|
+
include Comments
|
|
11
12
|
include FacilitationFeatures
|
|
12
13
|
include Files
|
|
14
|
+
include Images
|
|
15
|
+
include Shapes
|
|
13
16
|
include StickyNotes
|
|
17
|
+
include Tables
|
|
14
18
|
include Tags
|
|
19
|
+
include TextBoxes
|
|
20
|
+
include Titles
|
|
15
21
|
include Widgets
|
|
16
22
|
|
|
17
23
|
def_delegators :@client, :get, :post, :patch, :delete
|
data/lib/mural/client.rb
CHANGED
data/lib/mural/version.rb
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class CreateCommentParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::Comment.attrs.filter do |attr|
|
|
10
|
+
%i[
|
|
11
|
+
reference_widget_id
|
|
12
|
+
message
|
|
13
|
+
stacking_order
|
|
14
|
+
x
|
|
15
|
+
y
|
|
16
|
+
].include? attr
|
|
17
|
+
end,
|
|
18
|
+
|
|
19
|
+
resolved: 'resolved'
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class CreateImageParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::Image.attrs.reject do |attr|
|
|
10
|
+
%i[
|
|
11
|
+
aspect_ratio
|
|
12
|
+
content_edited_by
|
|
13
|
+
content_edited_on
|
|
14
|
+
created_by
|
|
15
|
+
created_on
|
|
16
|
+
expires_in_minutes
|
|
17
|
+
hide_editor
|
|
18
|
+
hide_owner
|
|
19
|
+
id
|
|
20
|
+
invisible
|
|
21
|
+
link
|
|
22
|
+
locked
|
|
23
|
+
locked_by_facilitator
|
|
24
|
+
mask
|
|
25
|
+
natural_height
|
|
26
|
+
natural_width
|
|
27
|
+
thumbnail_url
|
|
28
|
+
type
|
|
29
|
+
updated_by
|
|
30
|
+
updated_on
|
|
31
|
+
url
|
|
32
|
+
].include? attr
|
|
33
|
+
end,
|
|
34
|
+
|
|
35
|
+
# The name of the image.
|
|
36
|
+
# The allowed image formats are: bmp, ico, gif, jpeg, jpg, png, webp.
|
|
37
|
+
name: 'name',
|
|
38
|
+
|
|
39
|
+
# The URL used in the widget.
|
|
40
|
+
hyperlink: 'hyperlink'
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class CreateShapeParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::Shape.attrs.filter do |attr|
|
|
10
|
+
%i[
|
|
11
|
+
height
|
|
12
|
+
hidden
|
|
13
|
+
html_text
|
|
14
|
+
instruction
|
|
15
|
+
parent_id
|
|
16
|
+
presentation_index
|
|
17
|
+
rotation
|
|
18
|
+
shape
|
|
19
|
+
stacking_order
|
|
20
|
+
style
|
|
21
|
+
text
|
|
22
|
+
title
|
|
23
|
+
width
|
|
24
|
+
x
|
|
25
|
+
y
|
|
26
|
+
].include? attr
|
|
27
|
+
end
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
Style = Mural::Widget::Shape::Style
|
|
31
|
+
|
|
32
|
+
def encode
|
|
33
|
+
super.tap do |json|
|
|
34
|
+
json['style'] = json['style']&.encode
|
|
35
|
+
end.compact
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class CreateStickyNoteParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::StickyNote.attrs.filter do |attr|
|
|
10
|
+
%i[
|
|
11
|
+
height
|
|
12
|
+
hidden
|
|
13
|
+
html_text
|
|
14
|
+
hyperlink
|
|
15
|
+
hyperlink_title
|
|
16
|
+
instruction
|
|
17
|
+
parent_id
|
|
18
|
+
presentation_index
|
|
19
|
+
rotation
|
|
20
|
+
shape
|
|
21
|
+
stacking_order
|
|
22
|
+
style
|
|
23
|
+
tags
|
|
24
|
+
text
|
|
25
|
+
title
|
|
26
|
+
width
|
|
27
|
+
x
|
|
28
|
+
y
|
|
29
|
+
].include?(attr)
|
|
30
|
+
end
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
def encode
|
|
34
|
+
super.tap do |json|
|
|
35
|
+
json['style'] = json['style']&.encode
|
|
36
|
+
end.compact
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Exact same values, no restrictions
|
|
40
|
+
Style = Mural::Widget::StickyNote::Style
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class CreateTableCellParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::TableCell.attrs.filter do |attr|
|
|
10
|
+
%i[
|
|
11
|
+
col_span
|
|
12
|
+
column_id
|
|
13
|
+
height
|
|
14
|
+
rotation
|
|
15
|
+
row_id
|
|
16
|
+
row_span
|
|
17
|
+
style
|
|
18
|
+
text_content
|
|
19
|
+
width
|
|
20
|
+
x
|
|
21
|
+
y
|
|
22
|
+
].include? attr
|
|
23
|
+
end
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def encode
|
|
27
|
+
super.tap do |json|
|
|
28
|
+
json['style'] = json['style']&.encode
|
|
29
|
+
json['textContent'] = json['textContent']&.encode
|
|
30
|
+
end.compact
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
Style = Mural::Widget::TableCell::Style
|
|
34
|
+
TextContent = Mural::Widget::TableCell::TextContent
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class CreateTableParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::Table.attrs.filter do |attr|
|
|
10
|
+
%i[
|
|
11
|
+
auto_resize
|
|
12
|
+
columns
|
|
13
|
+
height
|
|
14
|
+
hidden
|
|
15
|
+
instruction
|
|
16
|
+
parent_id
|
|
17
|
+
presentation_index
|
|
18
|
+
rotation
|
|
19
|
+
rows
|
|
20
|
+
stacking_order
|
|
21
|
+
style
|
|
22
|
+
title
|
|
23
|
+
width
|
|
24
|
+
x
|
|
25
|
+
y
|
|
26
|
+
].include? attr
|
|
27
|
+
end,
|
|
28
|
+
|
|
29
|
+
# The array of table cells.
|
|
30
|
+
cells: 'cells'
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
Row = Mural::Widget::Table::Row
|
|
34
|
+
Column = Mural::Widget::Table::Column
|
|
35
|
+
Style = Mural::Widget::Table::Style
|
|
36
|
+
|
|
37
|
+
def encode # rubocop:disable Metrics/CyclomaticComplexity
|
|
38
|
+
super.tap do |json|
|
|
39
|
+
json['cells']&.map!(&:encode)
|
|
40
|
+
json['rows']&.map!(&:encode)
|
|
41
|
+
json['columns']&.map!(&:encode)
|
|
42
|
+
json['style'] = json['style']&.encode
|
|
43
|
+
end.compact
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class CreateTextBoxParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::Text.attrs.filter do |attr|
|
|
10
|
+
%i[
|
|
11
|
+
height
|
|
12
|
+
hidden
|
|
13
|
+
hyperlink
|
|
14
|
+
hyperlink_title
|
|
15
|
+
instruction
|
|
16
|
+
parent_id
|
|
17
|
+
presentation_index
|
|
18
|
+
rotation
|
|
19
|
+
stacking_order
|
|
20
|
+
style
|
|
21
|
+
text
|
|
22
|
+
title
|
|
23
|
+
width
|
|
24
|
+
x
|
|
25
|
+
y
|
|
26
|
+
].include? attr
|
|
27
|
+
end
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
Style = Mural::Widget::Text::Style
|
|
31
|
+
|
|
32
|
+
def encode
|
|
33
|
+
super.tap do |json|
|
|
34
|
+
json['style'] = json['style']&.encode
|
|
35
|
+
end.compact
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class CreateTitleParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::Text.attrs.filter do |attr|
|
|
10
|
+
%i[
|
|
11
|
+
height
|
|
12
|
+
hidden
|
|
13
|
+
hyperlink
|
|
14
|
+
hyperlink_title
|
|
15
|
+
instruction
|
|
16
|
+
parent_id
|
|
17
|
+
presentation_index
|
|
18
|
+
rotation
|
|
19
|
+
stacking_order
|
|
20
|
+
style
|
|
21
|
+
text
|
|
22
|
+
title
|
|
23
|
+
width
|
|
24
|
+
x
|
|
25
|
+
y
|
|
26
|
+
].include? attr
|
|
27
|
+
end
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
Style = Mural::Widget::Text::Style
|
|
31
|
+
|
|
32
|
+
def encode
|
|
33
|
+
super.tap do |json|
|
|
34
|
+
json['style'] = json['style']&.encode
|
|
35
|
+
end.compact
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
data/lib/mural/widget/image.rb
CHANGED
|
@@ -40,7 +40,7 @@ module Mural
|
|
|
40
40
|
show_caption: 'showCaption',
|
|
41
41
|
|
|
42
42
|
# The URL of the image thumbnail.
|
|
43
|
-
|
|
43
|
+
thumbnail_url: 'thumbnailUrl',
|
|
44
44
|
|
|
45
45
|
# The download URL of the image. This URL has expiration time.
|
|
46
46
|
# May be null when download restriction is enabled.
|
data/lib/mural/widget/table.rb
CHANGED
|
@@ -2,25 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
module Mural
|
|
4
4
|
class Widget
|
|
5
|
-
# UNDOCUMENTED
|
|
6
|
-
# This widget is not documented within Mural public API documentation.
|
|
7
5
|
class Table
|
|
8
6
|
include Mural::Codec
|
|
9
7
|
|
|
8
|
+
# https://developers.mural.co/public/reference/createtable
|
|
10
9
|
define_attributes(
|
|
11
10
|
**Mural::Widget.attrs,
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
# If true, the widget will automatically resize to fit its content.
|
|
14
13
|
auto_resize: 'autoResize',
|
|
14
|
+
|
|
15
|
+
# The title of the widget in the outline.
|
|
16
|
+
title: 'title',
|
|
17
|
+
|
|
18
|
+
# The array of columns definition.
|
|
15
19
|
columns: 'columns',
|
|
20
|
+
|
|
21
|
+
# The array of rows definition.
|
|
16
22
|
rows: 'rows',
|
|
23
|
+
|
|
24
|
+
# Style properties of the widget.
|
|
17
25
|
style: 'style'
|
|
18
26
|
)
|
|
19
27
|
|
|
20
28
|
def self.decode(json)
|
|
21
29
|
super.tap do |table|
|
|
22
|
-
table.columns
|
|
23
|
-
table.rows
|
|
30
|
+
table.columns&.map! { |col| Column.decode(col) }
|
|
31
|
+
table.rows&.map! { |row| Row.decode(row) }
|
|
24
32
|
table.style = Style.decode(table.style)
|
|
25
33
|
end
|
|
26
34
|
end
|
|
@@ -28,16 +36,27 @@ module Mural
|
|
|
28
36
|
class Column
|
|
29
37
|
include Mural::Codec
|
|
30
38
|
|
|
31
|
-
define_attributes(
|
|
39
|
+
define_attributes(
|
|
40
|
+
# The ID of the column.
|
|
41
|
+
column_id: 'columnId',
|
|
42
|
+
|
|
43
|
+
# The width of the column.
|
|
44
|
+
width: 'width'
|
|
45
|
+
)
|
|
32
46
|
end
|
|
33
47
|
|
|
34
48
|
class Row
|
|
35
49
|
include Mural::Codec
|
|
36
50
|
|
|
37
51
|
define_attributes(
|
|
52
|
+
# The height of the row.
|
|
38
53
|
height: 'height',
|
|
54
|
+
|
|
55
|
+
# The min height of the row.
|
|
39
56
|
min_height: 'minHeight',
|
|
40
|
-
|
|
57
|
+
|
|
58
|
+
# The ID of the row.
|
|
59
|
+
row_id: 'rowId'
|
|
41
60
|
)
|
|
42
61
|
end
|
|
43
62
|
|
|
@@ -45,7 +64,10 @@ module Mural
|
|
|
45
64
|
include Mural::Codec
|
|
46
65
|
|
|
47
66
|
define_attributes(
|
|
67
|
+
# The border color of the widget in hex with alpha format.
|
|
48
68
|
border_color: 'borderColor',
|
|
69
|
+
|
|
70
|
+
# The border width
|
|
49
71
|
border_width: 'borderWidth'
|
|
50
72
|
)
|
|
51
73
|
end
|
|
@@ -2,21 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
module Mural
|
|
4
4
|
class Widget
|
|
5
|
-
# UNDOCUMENTED
|
|
6
|
-
# This widget is not documented within Mural public API documentation.
|
|
7
5
|
class TableCell
|
|
8
6
|
include Mural::Codec
|
|
9
7
|
|
|
8
|
+
# # https://developers.mural.co/public/reference/createtable
|
|
10
9
|
define_attributes(
|
|
11
10
|
**Mural::Widget.attrs,
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
# Number of columns a cell can span.
|
|
14
13
|
col_span: 'colSpan',
|
|
14
|
+
|
|
15
|
+
# The ID of the column.
|
|
15
16
|
column_id: 'columnId',
|
|
16
|
-
|
|
17
|
+
|
|
18
|
+
# The ID of the row.
|
|
19
|
+
row_id: 'rowId',
|
|
20
|
+
|
|
21
|
+
# Number of rows a cell can span.
|
|
17
22
|
row_span: 'rowSpan',
|
|
23
|
+
|
|
24
|
+
# Style properties of the widget.
|
|
18
25
|
style: 'style',
|
|
19
|
-
|
|
26
|
+
|
|
27
|
+
# textContent properties of the widget.
|
|
28
|
+
text_content: 'textContent',
|
|
29
|
+
|
|
30
|
+
# The title of the widget in the outline.
|
|
31
|
+
title: 'title'
|
|
20
32
|
)
|
|
21
33
|
|
|
22
34
|
def self.decode(json)
|
|
@@ -29,6 +41,7 @@ module Mural
|
|
|
29
41
|
class Style
|
|
30
42
|
include Mural::Codec
|
|
31
43
|
|
|
44
|
+
# The backgroud color of the cell in hex with alpha format.
|
|
32
45
|
define_attributes(background_color: 'backgroundColor')
|
|
33
46
|
end
|
|
34
47
|
|
|
@@ -36,12 +49,29 @@ module Mural
|
|
|
36
49
|
include Mural::Codec
|
|
37
50
|
|
|
38
51
|
define_attributes(
|
|
52
|
+
# Font-family of the text.
|
|
39
53
|
font_family: 'fontFamily',
|
|
54
|
+
|
|
55
|
+
# Text size.
|
|
40
56
|
font_size: 'fontSize',
|
|
57
|
+
|
|
58
|
+
# The orientation of the text content.
|
|
59
|
+
# ["horizontal", "vertical-left", "vertical-right"]
|
|
41
60
|
orientation: 'orientation',
|
|
61
|
+
|
|
62
|
+
# Padding of the text content.
|
|
42
63
|
padding: 'padding',
|
|
64
|
+
|
|
65
|
+
# The text in the widget. It supports inline formatting using HTML
|
|
66
|
+
# tags.
|
|
43
67
|
text: 'text',
|
|
68
|
+
|
|
69
|
+
# The alignment of the text.
|
|
70
|
+
# ["left", "center", "right"]
|
|
44
71
|
text_align: 'textAlign',
|
|
72
|
+
|
|
73
|
+
# The vertical alignment of the text.
|
|
74
|
+
# ["top", "middle", "bottom"]
|
|
45
75
|
vertical_align: 'verticalAlign'
|
|
46
76
|
)
|
|
47
77
|
end
|
data/lib/mural/widget/text.rb
CHANGED
|
@@ -18,7 +18,7 @@ module Mural
|
|
|
18
18
|
hyperlink: 'hyperlink',
|
|
19
19
|
|
|
20
20
|
# Text displayed on the hyperlink button.
|
|
21
|
-
|
|
21
|
+
hyperlink_title: 'hyperlinkTitle',
|
|
22
22
|
|
|
23
23
|
# When true, the text wraps to fit the widget. When false, the widget
|
|
24
24
|
# grows to fit the text. True when widget is created as a textbox and
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class UpdateCommentParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::CreateCommentParams.attrs.reject do |attr|
|
|
10
|
+
%i[stacking_order].include? attr
|
|
11
|
+
end,
|
|
12
|
+
|
|
13
|
+
replies: 'replies'
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class UpdateImageParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::CreateImageParams.attrs.reject do |attr|
|
|
10
|
+
%i[name].include? attr
|
|
11
|
+
end
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class UpdateShapeParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::CreateShapeParams.attrs.reject do |attr|
|
|
10
|
+
%i[shape stacking_order].include? attr
|
|
11
|
+
end
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
Style = Mural::Widget::Shape::Style
|
|
15
|
+
|
|
16
|
+
def encode
|
|
17
|
+
super.tap do |json|
|
|
18
|
+
json['style'] = json['style']&.encode
|
|
19
|
+
end.compact
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class UpdateStickyNoteParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::CreateStickyNoteParams.attrs.reject do |attr|
|
|
10
|
+
%i[
|
|
11
|
+
stacking_order
|
|
12
|
+
shape
|
|
13
|
+
].include? attr
|
|
14
|
+
end
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
def encode
|
|
18
|
+
super.tap do |json|
|
|
19
|
+
json['style'] = json['style']&.encode
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
Style = Mural::Widget::StickyNote::Style
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class UpdateTextBoxParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::CreateTextBoxParams.attrs.reject do |attr|
|
|
10
|
+
%i[stacking_order].include? attr
|
|
11
|
+
end
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
Style = Mural::Widget::Text::Style
|
|
15
|
+
|
|
16
|
+
def encode
|
|
17
|
+
super.tap do |json|
|
|
18
|
+
json['style'] = json['style']&.encode
|
|
19
|
+
end.compact
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class UpdateTitleParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
define_attributes(
|
|
9
|
+
**Mural::Widget::CreateTitleParams.attrs.reject do |attr|
|
|
10
|
+
%i[stacking_order].include? attr
|
|
11
|
+
end
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
Style = Mural::Widget::Text::Style
|
|
15
|
+
|
|
16
|
+
def encode
|
|
17
|
+
super.tap do |json|
|
|
18
|
+
json['style'] = json['style']&.encode
|
|
19
|
+
end.compact
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
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.
|
|
4
|
+
version: 0.5.0
|
|
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-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: zeitwerk
|
|
@@ -49,10 +49,16 @@ files:
|
|
|
49
49
|
- lib/mural/client/mural_content/areas.rb
|
|
50
50
|
- lib/mural/client/mural_content/arrows.rb
|
|
51
51
|
- lib/mural/client/mural_content/chats.rb
|
|
52
|
+
- lib/mural/client/mural_content/comments.rb
|
|
52
53
|
- lib/mural/client/mural_content/facilitation_features.rb
|
|
53
54
|
- lib/mural/client/mural_content/files.rb
|
|
55
|
+
- lib/mural/client/mural_content/images.rb
|
|
56
|
+
- lib/mural/client/mural_content/shapes.rb
|
|
54
57
|
- lib/mural/client/mural_content/sticky_notes.rb
|
|
58
|
+
- lib/mural/client/mural_content/tables.rb
|
|
55
59
|
- lib/mural/client/mural_content/tags.rb
|
|
60
|
+
- lib/mural/client/mural_content/text_boxes.rb
|
|
61
|
+
- lib/mural/client/mural_content/titles.rb
|
|
56
62
|
- lib/mural/client/mural_content/widgets.rb
|
|
57
63
|
- lib/mural/client/murals.rb
|
|
58
64
|
- lib/mural/client/rooms.rb
|
|
@@ -65,7 +71,6 @@ files:
|
|
|
65
71
|
- lib/mural/codec.rb
|
|
66
72
|
- lib/mural/create_mural_params.rb
|
|
67
73
|
- lib/mural/create_room_params.rb
|
|
68
|
-
- lib/mural/create_sticky_note_params.rb
|
|
69
74
|
- lib/mural/create_tag_params.rb
|
|
70
75
|
- lib/mural/current_user.rb
|
|
71
76
|
- lib/mural/duplicate_mural_params.rb
|
|
@@ -92,7 +97,6 @@ files:
|
|
|
92
97
|
- lib/mural/update_mural_params.rb
|
|
93
98
|
- lib/mural/update_room_params.rb
|
|
94
99
|
- lib/mural/update_room_user_params.rb
|
|
95
|
-
- lib/mural/update_sticky_note_params.rb
|
|
96
100
|
- lib/mural/update_tag_params.rb
|
|
97
101
|
- lib/mural/update_timer_params.rb
|
|
98
102
|
- lib/mural/version.rb
|
|
@@ -104,7 +108,15 @@ files:
|
|
|
104
108
|
- lib/mural/widget/comment.rb
|
|
105
109
|
- lib/mural/widget/create_area_params.rb
|
|
106
110
|
- lib/mural/widget/create_arrow_params.rb
|
|
111
|
+
- lib/mural/widget/create_comment_params.rb
|
|
107
112
|
- lib/mural/widget/create_file_params.rb
|
|
113
|
+
- lib/mural/widget/create_image_params.rb
|
|
114
|
+
- lib/mural/widget/create_shape_params.rb
|
|
115
|
+
- lib/mural/widget/create_sticky_note_params.rb
|
|
116
|
+
- lib/mural/widget/create_table_cell_params.rb
|
|
117
|
+
- lib/mural/widget/create_table_params.rb
|
|
118
|
+
- lib/mural/widget/create_text_box_params.rb
|
|
119
|
+
- lib/mural/widget/create_title_params.rb
|
|
108
120
|
- lib/mural/widget/file.rb
|
|
109
121
|
- lib/mural/widget/icon.rb
|
|
110
122
|
- lib/mural/widget/image.rb
|
|
@@ -115,7 +127,13 @@ files:
|
|
|
115
127
|
- lib/mural/widget/text.rb
|
|
116
128
|
- lib/mural/widget/update_area_params.rb
|
|
117
129
|
- lib/mural/widget/update_arrow_params.rb
|
|
130
|
+
- lib/mural/widget/update_comment_params.rb
|
|
118
131
|
- lib/mural/widget/update_file_params.rb
|
|
132
|
+
- lib/mural/widget/update_image_params.rb
|
|
133
|
+
- lib/mural/widget/update_shape_params.rb
|
|
134
|
+
- lib/mural/widget/update_sticky_note_params.rb
|
|
135
|
+
- lib/mural/widget/update_text_box_params.rb
|
|
136
|
+
- lib/mural/widget/update_title_params.rb
|
|
119
137
|
- lib/mural/workspace.rb
|
|
120
138
|
- lib/mural/workspace_invitation.rb
|
|
121
139
|
homepage: https://github.com/mickaelpham/mural-ruby
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Mural
|
|
4
|
-
class CreateStickyNoteParams
|
|
5
|
-
include Mural::Codec
|
|
6
|
-
|
|
7
|
-
define_attributes(
|
|
8
|
-
**Mural::Widget::StickyNote.attrs.reject do |attr|
|
|
9
|
-
%i[
|
|
10
|
-
content_edited_by
|
|
11
|
-
content_edited_on
|
|
12
|
-
created_by
|
|
13
|
-
created_on
|
|
14
|
-
hide_editor
|
|
15
|
-
hide_owner
|
|
16
|
-
id
|
|
17
|
-
invisible
|
|
18
|
-
locked
|
|
19
|
-
locked_by_facilitator
|
|
20
|
-
min_lines
|
|
21
|
-
type
|
|
22
|
-
updated_by
|
|
23
|
-
updated_on
|
|
24
|
-
].include?(attr)
|
|
25
|
-
end
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
def encode
|
|
29
|
-
super.tap do |json|
|
|
30
|
-
json['style'] = json['style']&.encode
|
|
31
|
-
end.compact
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# Exact same values, no restrictions
|
|
35
|
-
Style = Mural::Widget::StickyNote::Style
|
|
36
|
-
end
|
|
37
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Mural
|
|
4
|
-
class UpdateStickyNoteParams
|
|
5
|
-
include Mural::Codec
|
|
6
|
-
|
|
7
|
-
define_attributes(
|
|
8
|
-
**Mural::CreateStickyNoteParams.attrs.reject do |attr|
|
|
9
|
-
%i[
|
|
10
|
-
stacking_order
|
|
11
|
-
shape
|
|
12
|
-
].include?(attr)
|
|
13
|
-
end
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
def encode
|
|
17
|
-
super.tap do |json|
|
|
18
|
-
json['style'] = json['style']&.encode
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
Style = Mural::Widget::StickyNote::Style
|
|
23
|
-
end
|
|
24
|
-
end
|