mural-ruby 0.3.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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -0
  3. data/lib/mural/client/mural_content/areas.rb +29 -0
  4. data/lib/mural/client/mural_content/arrows.rb +10 -0
  5. data/lib/mural/client/mural_content/comments.rb +37 -0
  6. data/lib/mural/client/mural_content/images.rb +29 -0
  7. data/lib/mural/client/mural_content/shapes.rb +38 -0
  8. data/lib/mural/client/mural_content/sticky_notes.rb +12 -2
  9. data/lib/mural/client/mural_content/tables.rb +24 -0
  10. data/lib/mural/client/mural_content/text_boxes.rb +37 -0
  11. data/lib/mural/client/mural_content/titles.rb +37 -0
  12. data/lib/mural/client/mural_content.rb +7 -0
  13. data/lib/mural/client.rb +0 -1
  14. data/lib/mural/version.rb +1 -1
  15. data/lib/mural/widget/create_area_params.rb +38 -0
  16. data/lib/mural/widget/create_comment_params.rb +23 -0
  17. data/lib/mural/widget/create_image_params.rb +44 -0
  18. data/lib/mural/widget/create_shape_params.rb +39 -0
  19. data/lib/mural/widget/create_sticky_note_params.rb +43 -0
  20. data/lib/mural/widget/create_table_cell_params.rb +37 -0
  21. data/lib/mural/widget/create_table_params.rb +47 -0
  22. data/lib/mural/widget/create_text_box_params.rb +39 -0
  23. data/lib/mural/widget/create_title_params.rb +39 -0
  24. data/lib/mural/widget/image.rb +1 -1
  25. data/lib/mural/widget/table.rb +29 -7
  26. data/lib/mural/widget/table_cell.rb +35 -5
  27. data/lib/mural/widget/text.rb +1 -1
  28. data/lib/mural/widget/update_area_params.rb +21 -0
  29. data/lib/mural/widget/update_arrow_params.rb +27 -0
  30. data/lib/mural/widget/update_comment_params.rb +17 -0
  31. data/lib/mural/widget/update_image_params.rb +15 -0
  32. data/lib/mural/widget/update_shape_params.rb +23 -0
  33. data/lib/mural/widget/update_sticky_note_params.rb +26 -0
  34. data/lib/mural/widget/update_text_box_params.rb +23 -0
  35. data/lib/mural/widget/update_title_params.rb +23 -0
  36. metadata +26 -4
  37. data/lib/mural/create_sticky_note_params.rb +0 -37
  38. 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: f540a98335efdfc065158e8b7ebd6aac3644516f954ed4609c2f00ad2e2be246
4
- data.tar.gz: cb8f4c1b30e43f3095ea087ea5ab32c82d4fd06a755e1c9c1463ed4224b5f995
3
+ metadata.gz: a608bc7d2068d3dc93b5fe418056e3cd0984aa2b52a816fae303ed12fee0b79e
4
+ data.tar.gz: ab8c92e86470e8097b412ffaf00c1f2623b514880aad9f91eb6aed4db5793608
5
5
  SHA512:
6
- metadata.gz: d4fee2a84d4edeaeca9ee626ef776fb19355dd3d54ef805d7a315010eb3920a7dbea8f4ae0745c724f742a54110c8b40296d4187b971ae1ca3e9c95f2645020f
7
- data.tar.gz: 731b007f44680abb410a4358e507b7b53e9cc9cbbcb062393fa6e28ed8cd58aae93d4763014164707f9f212dcc6caa57251bbaf8ebb8189ae7a0c8c49b322049
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,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mural
4
+ class Client
5
+ class MuralContent
6
+ module Areas
7
+ # https://developers.mural.co/public/reference/createarea
8
+ def create_area(mural_id, create_area_params)
9
+ json = post(
10
+ "/api/public/v1/murals/#{mural_id}/widgets/area",
11
+ create_area_params.encode
12
+ )
13
+
14
+ Mural::Widget::Area.decode(json['value'])
15
+ end
16
+
17
+ # https://developers.mural.co/public/reference/updatearea
18
+ def update_area(mural_id, area_id, update_area_params)
19
+ json = patch(
20
+ "/api/public/v1/murals/#{mural_id}/widgets/area/#{area_id}",
21
+ update_area_params.encode
22
+ )
23
+
24
+ Mural::Widget::Area.decode(json['value'])
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -13,6 +13,16 @@ module Mural
13
13
 
14
14
  Mural::Widget::Arrow.decode(json['value'])
15
15
  end
16
+
17
+ # https://developers.mural.co/public/reference/updatearrow
18
+ def update_arrow(mural_id, arrow_id, update_arrow_params)
19
+ json = patch(
20
+ "/api/public/v1/murals/#{mural_id}/widgets/arrow/#{arrow_id}",
21
+ update_arrow_params.encode
22
+ )
23
+
24
+ Mural::Widget::Arrow.decode(json['value'])
25
+ end
16
26
  end
17
27
  end
18
28
  end
@@ -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(mural_id, widget_id, update_sticky_note_params)
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
- "/#{widget_id}",
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
@@ -5,12 +5,19 @@ module Mural
5
5
  class MuralContent
6
6
  extend Forwardable
7
7
 
8
+ include Areas
8
9
  include Arrows
9
10
  include Chats
11
+ include Comments
10
12
  include FacilitationFeatures
11
13
  include Files
14
+ include Images
15
+ include Shapes
12
16
  include StickyNotes
17
+ include Tables
13
18
  include Tags
19
+ include TextBoxes
20
+ include Titles
14
21
  include Widgets
15
22
 
16
23
  def_delegators :@client, :get, :post, :patch, :delete
data/lib/mural/client.rb CHANGED
@@ -51,7 +51,6 @@ module Mural
51
51
  )
52
52
 
53
53
  req = Net::HTTP::Get.new uri
54
- # retryable_request(req)
55
54
  retryable_request(req)
56
55
  end
57
56
 
data/lib/mural/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mural
4
- VERSION = '0.3.0'
4
+ VERSION = '0.5.0'
5
5
  end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mural
4
+ class Widget
5
+ class CreateAreaParams
6
+ include Mural::Codec
7
+
8
+ define_attributes(
9
+ **Mural::Widget::Area.attrs.reject do |attr|
10
+ %i[
11
+ content_edited_by
12
+ content_edited_on
13
+ created_by
14
+ created_on
15
+ hide_editor
16
+ hide_owner
17
+ id
18
+ invisible
19
+ locked
20
+ locked_by_facilitator
21
+ rotation
22
+ type
23
+ updated_by
24
+ updated_on
25
+ ].include? attr
26
+ end
27
+ )
28
+
29
+ Style = Mural::Widget::Area::Style
30
+
31
+ def encode
32
+ super.tap do |json|
33
+ json['style'] = json['style']&.encode
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -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
@@ -40,7 +40,7 @@ module Mural
40
40
  show_caption: 'showCaption',
41
41
 
42
42
  # The URL of the image thumbnail.
43
- thumbnailUrl: 'thumbnail_url',
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.
@@ -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
- title: 'title',
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 = table.columns&.map { |col| Column.decode(col) }
23
- table.rows = table.rows&.map { |row| Row.decode(row) }
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(column_id: 'columnId', width: 'width')
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
- row_id: 'row_id'
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
- title: 'title',
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
- row_id: 'rolId',
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
- text_content: 'textContent'
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
@@ -18,7 +18,7 @@ module Mural
18
18
  hyperlink: 'hyperlink',
19
19
 
20
20
  # Text displayed on the hyperlink button.
21
- hyperlinkTitle: 'hyperlinkTitle',
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,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mural
4
+ class Widget
5
+ class UpdateAreaParams
6
+ include Mural::Codec
7
+
8
+ define_attributes(
9
+ **Mural::Widget::CreateAreaParams.attrs
10
+ )
11
+
12
+ Style = Mural::Widget::Area::Style
13
+
14
+ def encode
15
+ super.tap do |json|
16
+ json['style'] = json['style']&.encode
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mural
4
+ class Widget
5
+ class UpdateArrowParams
6
+ include Mural::Codec
7
+
8
+ define_attributes(
9
+ **Mural::Widget::CreateArrowParams.attrs.reject do |attr|
10
+ %i[stacking_order].include? attr
11
+ end
12
+ )
13
+
14
+ def encode
15
+ super.tap do |json|
16
+ json['points']&.map!(&:encode)
17
+ json['label'] = json['label']&.encode
18
+ json['style'] = json['style']&.encode
19
+ end
20
+ end
21
+
22
+ Style = Mural::Widget::Arrow::Style
23
+ Label = Mural::Widget::Arrow::Label
24
+ Point = Mural::Widget::Arrow::Point
25
+ end
26
+ end
27
+ end
@@ -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.3.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-07 00:00:00.000000000 Z
11
+ date: 2025-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -46,12 +46,19 @@ files:
46
46
  - lib/mural/client.rb
47
47
  - lib/mural/client/authentication.rb
48
48
  - lib/mural/client/mural_content.rb
49
+ - lib/mural/client/mural_content/areas.rb
49
50
  - lib/mural/client/mural_content/arrows.rb
50
51
  - lib/mural/client/mural_content/chats.rb
52
+ - lib/mural/client/mural_content/comments.rb
51
53
  - lib/mural/client/mural_content/facilitation_features.rb
52
54
  - lib/mural/client/mural_content/files.rb
55
+ - lib/mural/client/mural_content/images.rb
56
+ - lib/mural/client/mural_content/shapes.rb
53
57
  - lib/mural/client/mural_content/sticky_notes.rb
58
+ - lib/mural/client/mural_content/tables.rb
54
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
55
62
  - lib/mural/client/mural_content/widgets.rb
56
63
  - lib/mural/client/murals.rb
57
64
  - lib/mural/client/rooms.rb
@@ -64,7 +71,6 @@ files:
64
71
  - lib/mural/codec.rb
65
72
  - lib/mural/create_mural_params.rb
66
73
  - lib/mural/create_room_params.rb
67
- - lib/mural/create_sticky_note_params.rb
68
74
  - lib/mural/create_tag_params.rb
69
75
  - lib/mural/current_user.rb
70
76
  - lib/mural/duplicate_mural_params.rb
@@ -91,7 +97,6 @@ files:
91
97
  - lib/mural/update_mural_params.rb
92
98
  - lib/mural/update_room_params.rb
93
99
  - lib/mural/update_room_user_params.rb
94
- - lib/mural/update_sticky_note_params.rb
95
100
  - lib/mural/update_tag_params.rb
96
101
  - lib/mural/update_timer_params.rb
97
102
  - lib/mural/version.rb
@@ -101,8 +106,17 @@ files:
101
106
  - lib/mural/widget/area.rb
102
107
  - lib/mural/widget/arrow.rb
103
108
  - lib/mural/widget/comment.rb
109
+ - lib/mural/widget/create_area_params.rb
104
110
  - lib/mural/widget/create_arrow_params.rb
111
+ - lib/mural/widget/create_comment_params.rb
105
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
106
120
  - lib/mural/widget/file.rb
107
121
  - lib/mural/widget/icon.rb
108
122
  - lib/mural/widget/image.rb
@@ -111,7 +125,15 @@ files:
111
125
  - lib/mural/widget/table.rb
112
126
  - lib/mural/widget/table_cell.rb
113
127
  - lib/mural/widget/text.rb
128
+ - lib/mural/widget/update_area_params.rb
129
+ - lib/mural/widget/update_arrow_params.rb
130
+ - lib/mural/widget/update_comment_params.rb
114
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
115
137
  - lib/mural/workspace.rb
116
138
  - lib/mural/workspace_invitation.rb
117
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