mural-ruby 0.4.0 → 0.5.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 +41 -3
- data/img/comment-email-notification.png +0 -0
- data/img/comment-thread.png +0 -0
- data/lib/mural/client/mural_content/areas.rb +2 -2
- data/lib/mural/client/mural_content/arrows.rb +2 -2
- data/lib/mural/client/mural_content/comments.rb +37 -0
- data/lib/mural/client/mural_content/files.rb +3 -3
- 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 +14 -4
- 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_area_params.rb +15 -15
- data/lib/mural/widget/create_arrow_params.rb +23 -19
- data/lib/mural/widget/create_comment_params.rb +25 -0
- data/lib/mural/widget/create_file_params.rb +16 -41
- data/lib/mural/widget/create_image_params.rb +38 -0
- data/lib/mural/widget/create_shape_params.rb +40 -0
- data/lib/mural/widget/create_sticky_note_params.rb +43 -0
- data/lib/mural/widget/create_table_cell_params.rb +38 -0
- data/lib/mural/widget/create_table_params.rb +48 -0
- data/lib/mural/widget/create_text_box_params.rb +40 -0
- data/lib/mural/widget/create_title_params.rb +40 -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_area_params.rb +4 -1
- data/lib/mural/widget/update_arrow_params.rb +5 -4
- data/lib/mural/widget/update_comment_params.rb +18 -0
- data/lib/mural/widget/update_file_params.rb +3 -37
- data/lib/mural/widget/update_image_params.rb +15 -0
- data/lib/mural/widget/update_shape_params.rb +24 -0
- data/lib/mural/widget/update_sticky_note_params.rb +24 -0
- data/lib/mural/widget/update_text_box_params.rb +24 -0
- data/lib/mural/widget/update_title_params.rb +24 -0
- metadata +24 -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: cffa4ff400827dc5d5dd6393b9d4486db9343d61a36d99741115fc08f94b8631
|
|
4
|
+
data.tar.gz: 65d63349f8a62417a9331cdd9fc35d7116705d61b4e296b306ddd740f6ae0d19
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec31b430792736408b1fbd14a474b223e232ea598e252af91dbc34b4952d53774fdabd5d6baaba6d0f2b21da1193a3323f578d7b7565cb99e36326803ff4fc95
|
|
7
|
+
data.tar.gz: dc81671b72f2d394d91c09a85699757ef7552b92532ef754d0e53fba88209444755a5042d23fa7ab58ed4204894ebf7344689ca12d0847231f102220e63ef907
|
data/README.md
CHANGED
|
@@ -4,9 +4,16 @@
|
|
|
4
4
|
[](https://rubygems.org/gems/mural-ruby)
|
|
5
5
|
[](https://github.com/mickaelpham/mural-ruby/blob/main/UNLICENSE)
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
Ruby library for the [Mural](https://app.mural.co) public API.
|
|
9
8
|
|
|
9
|
+
> **Disclaimer**
|
|
10
|
+
>
|
|
11
|
+
> The views and opinions expressed in this repository are solely hose of the
|
|
12
|
+
> individual contributors and do not represent the official view of
|
|
13
|
+
> [Tactivos, Inc. d/b/a Mural](https://www.mural.co/).
|
|
14
|
+
>
|
|
15
|
+
> **Mural does not endorse this repository in any way.**
|
|
16
|
+
|
|
10
17
|
## Installation
|
|
11
18
|
|
|
12
19
|
```sh
|
|
@@ -70,8 +77,8 @@ irb(main):002> mural.users.current_user
|
|
|
70
77
|
|
|
71
78
|
### Upload a file to a mural
|
|
72
79
|
|
|
73
|
-
To upload a `my.pdf` file that's located in the same directory as where you
|
|
74
|
-
|
|
80
|
+
To upload a `my.pdf` file that's located in the same directory as where you are
|
|
81
|
+
running the script:
|
|
75
82
|
|
|
76
83
|
```rb
|
|
77
84
|
MURAL_ID = 'workspace-1.mural-1'
|
|
@@ -108,6 +115,37 @@ end
|
|
|
108
115
|
client.mural_content.create_file(MURAL_ID, params)
|
|
109
116
|
```
|
|
110
117
|
|
|
118
|
+
## Mentioning someone in a comment
|
|
119
|
+
|
|
120
|
+
- You can reply to a comment by passing a `replies` array of `String` message.
|
|
121
|
+
Each message will be added as a reply to the original comment.
|
|
122
|
+
- You can "\[at\] mention" someone in a comment or in a reply by using the
|
|
123
|
+
following pattern in the `message` or the `replies`:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
@[<USER FULL NAME> @<USER ID>](<USER ID>)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Example replying to a thread:
|
|
130
|
+
|
|
131
|
+
```rb
|
|
132
|
+
MURAL_ID = 'mural-1'
|
|
133
|
+
COMMENT_ID = 'comment-1'
|
|
134
|
+
|
|
135
|
+
reply_to_params = Mural::Widget::UpdateCommentParams.new.tap do |c|
|
|
136
|
+
c.replies = ["Can you have a look @[John Doe @user-1](user-1)]?"]
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
client.mural_content.update_comment(MURAL_ID, COMMENT_ID, reply_to_params)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+

|
|
143
|
+
|
|
144
|
+
Note that the user must already be a **mural member** for the mention to trigger
|
|
145
|
+
an email notification.
|
|
146
|
+
|
|
147
|
+

|
|
148
|
+
|
|
111
149
|
## Known limitations
|
|
112
150
|
|
|
113
151
|
- `DrawWidget`, AKA sketches, are not returned by the `GET widgets` endpoint.
|
|
Binary file
|
|
Binary file
|
|
@@ -11,7 +11,7 @@ module Mural
|
|
|
11
11
|
create_area_params.encode
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
-
Mural::Widget
|
|
14
|
+
Mural::Widget.decode(json['value'])
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# https://developers.mural.co/public/reference/updatearea
|
|
@@ -21,7 +21,7 @@ module Mural
|
|
|
21
21
|
update_area_params.encode
|
|
22
22
|
)
|
|
23
23
|
|
|
24
|
-
Mural::Widget
|
|
24
|
+
Mural::Widget.decode(json['value'])
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
end
|
|
@@ -11,7 +11,7 @@ module Mural
|
|
|
11
11
|
create_arrow_params.encode
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
-
Mural::Widget
|
|
14
|
+
Mural::Widget.decode(json['value'])
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# https://developers.mural.co/public/reference/updatearrow
|
|
@@ -21,7 +21,7 @@ module Mural
|
|
|
21
21
|
update_arrow_params.encode
|
|
22
22
|
)
|
|
23
23
|
|
|
24
|
-
Mural::Widget
|
|
24
|
+
Mural::Widget.decode(json['value'])
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
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.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.decode(json['value'])
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -11,7 +11,7 @@ module Mural
|
|
|
11
11
|
params.encode
|
|
12
12
|
)
|
|
13
13
|
|
|
14
|
-
Mural::Widget
|
|
14
|
+
Mural::Widget.decode(json['value'])
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# https://developers.mural.co/public/reference/getmuralfilewidgets
|
|
@@ -21,7 +21,7 @@ module Mural
|
|
|
21
21
|
{ next: next_page }
|
|
22
22
|
)
|
|
23
23
|
|
|
24
|
-
files = json['value'].map { |f| Mural::Widget
|
|
24
|
+
files = json['value'].map { |f| Mural::Widget.decode(f) }
|
|
25
25
|
[files, json['next']]
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -32,7 +32,7 @@ module Mural
|
|
|
32
32
|
update_file_params.encode
|
|
33
33
|
)
|
|
34
34
|
|
|
35
|
-
Mural::Widget
|
|
35
|
+
Mural::Widget.decode(json['value'])
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
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.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.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.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.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(
|
|
@@ -11,18 +15,24 @@ module Mural
|
|
|
11
15
|
[*create_sticky_note_params].map(&:encode)
|
|
12
16
|
)
|
|
13
17
|
|
|
14
|
-
json['value'].map { |s| Mural::Widget
|
|
18
|
+
json['value'].map { |s| Mural::Widget.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
|
|
|
25
|
-
Mural::Widget
|
|
35
|
+
Mural::Widget.decode(json['value'])
|
|
26
36
|
end
|
|
27
37
|
end
|
|
28
38
|
end
|
|
@@ -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.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.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.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.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
|
@@ -5,23 +5,23 @@ module Mural
|
|
|
5
5
|
class CreateAreaParams
|
|
6
6
|
include Mural::Codec
|
|
7
7
|
|
|
8
|
+
# https://developers.mural.co/public/reference/createarea
|
|
8
9
|
define_attributes(
|
|
9
|
-
**Mural::Widget::Area.attrs.
|
|
10
|
+
**Mural::Widget::Area.attrs.filter do |attr|
|
|
10
11
|
%i[
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
updated_on
|
|
12
|
+
height
|
|
13
|
+
hidden
|
|
14
|
+
instruction
|
|
15
|
+
layout
|
|
16
|
+
parent_id
|
|
17
|
+
presentation_index
|
|
18
|
+
show_title
|
|
19
|
+
stacking_order
|
|
20
|
+
style
|
|
21
|
+
title
|
|
22
|
+
width
|
|
23
|
+
x
|
|
24
|
+
y
|
|
25
25
|
].include? attr
|
|
26
26
|
end
|
|
27
27
|
)
|
|
@@ -7,26 +7,34 @@ module Mural
|
|
|
7
7
|
|
|
8
8
|
# https://developers.mural.co/public/reference/createarrow
|
|
9
9
|
define_attributes(
|
|
10
|
-
**Mural::Widget::Arrow.attrs.
|
|
10
|
+
**Mural::Widget::Arrow.attrs.filter do |attr|
|
|
11
11
|
%i[
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
arrow_type
|
|
13
|
+
end_ref_id
|
|
14
|
+
height
|
|
15
|
+
instruction
|
|
16
|
+
label
|
|
17
|
+
parent_id
|
|
18
|
+
points
|
|
19
|
+
presentation_index
|
|
20
|
+
rotation
|
|
21
|
+
stackable
|
|
22
|
+
stacking_order
|
|
23
|
+
start_ref_id
|
|
24
|
+
style
|
|
25
|
+
tip
|
|
26
|
+
title
|
|
27
|
+
width
|
|
28
|
+
x
|
|
29
|
+
y
|
|
26
30
|
].include? attr
|
|
27
31
|
end
|
|
28
32
|
)
|
|
29
33
|
|
|
34
|
+
Style = Mural::Widget::Arrow::Style
|
|
35
|
+
Label = Mural::Widget::Arrow::Label
|
|
36
|
+
Point = Mural::Widget::Arrow::Point
|
|
37
|
+
|
|
30
38
|
def encode
|
|
31
39
|
super.tap do |json|
|
|
32
40
|
json['points']&.map!(&:encode)
|
|
@@ -34,10 +42,6 @@ module Mural
|
|
|
34
42
|
json['style'] = json['style']&.encode
|
|
35
43
|
end
|
|
36
44
|
end
|
|
37
|
-
|
|
38
|
-
Style = Mural::Widget::Arrow::Style
|
|
39
|
-
Label = Mural::Widget::Arrow::Label
|
|
40
|
-
Point = Mural::Widget::Arrow::Point
|
|
41
45
|
end
|
|
42
46
|
end
|
|
43
47
|
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class CreateCommentParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
# https://developers.mural.co/public/reference/createcomment
|
|
9
|
+
define_attributes(
|
|
10
|
+
**Mural::Widget::Comment.attrs.filter do |attr|
|
|
11
|
+
%i[
|
|
12
|
+
message
|
|
13
|
+
reference_widget_id
|
|
14
|
+
stacking_order
|
|
15
|
+
x
|
|
16
|
+
y
|
|
17
|
+
].include? attr
|
|
18
|
+
end,
|
|
19
|
+
|
|
20
|
+
# If true, the comment is marked as resolved.
|
|
21
|
+
resolved: 'resolved'
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -7,49 +7,24 @@ module Mural
|
|
|
7
7
|
|
|
8
8
|
# https://developers.mural.co/public/reference/createfile
|
|
9
9
|
define_attributes(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
**Mural::Widget::File.attrs.filter do |attr|
|
|
11
|
+
%i[
|
|
12
|
+
height
|
|
13
|
+
hidden
|
|
14
|
+
instruction
|
|
15
|
+
parent_id
|
|
16
|
+
presentation_index
|
|
17
|
+
rotation
|
|
18
|
+
stacking_order
|
|
19
|
+
title
|
|
20
|
+
width
|
|
21
|
+
x
|
|
22
|
+
y
|
|
23
|
+
].include? attr
|
|
24
|
+
end,
|
|
21
25
|
|
|
22
26
|
# The name of the file.
|
|
23
|
-
name: 'name'
|
|
24
|
-
|
|
25
|
-
# The ID of the area widget that contains the widget.
|
|
26
|
-
parent_id: 'parentId',
|
|
27
|
-
|
|
28
|
-
# The list order of the widget in the outline.
|
|
29
|
-
presentation_index: 'presentationIndex',
|
|
30
|
-
|
|
31
|
-
# The angle of widget rotation in degrees.
|
|
32
|
-
rotation: 'rotation',
|
|
33
|
-
|
|
34
|
-
# The z-index stacking order of the widget.
|
|
35
|
-
stacking_order: 'stackingOrder',
|
|
36
|
-
|
|
37
|
-
# The title in the file widget and in the outline.
|
|
38
|
-
title: 'title',
|
|
39
|
-
|
|
40
|
-
# The width of the widget in px. This value will be overwritten if the
|
|
41
|
-
# file has a preview from which the final value will be extracted.
|
|
42
|
-
width: 'width',
|
|
43
|
-
|
|
44
|
-
# The horizontal position of the widget in px. This is the distance from
|
|
45
|
-
# the left of the parent widget, such as an area. If the widget has no
|
|
46
|
-
# parent widget, this is the distance from the left of the mural.
|
|
47
|
-
x: 'x',
|
|
48
|
-
|
|
49
|
-
# The vertical position of the widget in px. This is the distance from
|
|
50
|
-
# the top of the parent widget, such as an area. If the widget has no
|
|
51
|
-
# parent widget, this is the distance from the top of the mural.
|
|
52
|
-
y: 'y'
|
|
27
|
+
name: 'name'
|
|
53
28
|
)
|
|
54
29
|
end
|
|
55
30
|
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Mural
|
|
4
|
+
class Widget
|
|
5
|
+
class CreateImageParams
|
|
6
|
+
include Mural::Codec
|
|
7
|
+
|
|
8
|
+
# https://developers.mural.co/public/reference/createimage
|
|
9
|
+
define_attributes(
|
|
10
|
+
**Mural::Widget::Image.attrs.filter do |attr|
|
|
11
|
+
%i[
|
|
12
|
+
border
|
|
13
|
+
caption
|
|
14
|
+
description
|
|
15
|
+
height
|
|
16
|
+
hidden
|
|
17
|
+
instruction
|
|
18
|
+
parent_id
|
|
19
|
+
presentation_index
|
|
20
|
+
rotation
|
|
21
|
+
show_caption
|
|
22
|
+
stacking_order
|
|
23
|
+
width
|
|
24
|
+
x
|
|
25
|
+
y
|
|
26
|
+
].include? attr
|
|
27
|
+
end,
|
|
28
|
+
|
|
29
|
+
# The name of the image.
|
|
30
|
+
# The allowed image formats are: bmp, ico, gif, jpeg, jpg, png, webp.
|
|
31
|
+
name: 'name',
|
|
32
|
+
|
|
33
|
+
# The URL used in the widget.
|
|
34
|
+
hyperlink: 'hyperlink'
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|