monday_ruby 0.4.0 → 0.6.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/.simplecov +3 -0
- data/CHANGELOG.md +29 -0
- data/lib/monday/error.rb +2 -2
- data/lib/monday/resources/group.rb +86 -0
- data/lib/monday/resources/subitem.rb +32 -0
- data/lib/monday/resources/update.rb +65 -0
- data/lib/monday/resources.rb +6 -0
- data/lib/monday/util.rb +6 -6
- data/lib/monday/version.rb +1 -1
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1d01fc38546be402980f538a78e38ef1bdf49426dea93eb7d354115c9c156c9
|
4
|
+
data.tar.gz: '064188d59638c6e9beb2f1e5c9ea4c1057227e4ace71d89fe61ce56a5d4e39ce'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8df9570337bd4132ed4693d1cff769ceaf81def899d5d193b496dc77f5896e3af2123fc1144d47db4ca0d77519996a0a8a0c040a715159147beb16036f924a6f
|
7
|
+
data.tar.gz: 95551bc412de20e14461fe3c49842829177347d15a6d175656bdfdc1820b884c3262e17796c922f37c270fe75e1581b623c15aa847620cf66ee995aeca6478a9
|
data/.simplecov
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,32 @@
|
|
1
|
+
## v0.6.1 (March 24, 2024)
|
2
|
+
|
3
|
+
### Bug Fixes
|
4
|
+
|
5
|
+
- Fix formatting error for single words (Issue)[https://github.com/sanifhimani/monday_ruby/issues/16]
|
6
|
+
|
7
|
+
## v0.6.0 (October 9, 2023)
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- Support for working with subitems:
|
12
|
+
- Listing subitems
|
13
|
+
- Creating a subitem
|
14
|
+
|
15
|
+
- Support for working with updates:
|
16
|
+
- Create an Update
|
17
|
+
- Like an Update
|
18
|
+
- Clear an item's updates
|
19
|
+
- Delete an update
|
20
|
+
|
21
|
+
## v0.5.0 (September 21, 2023)
|
22
|
+
|
23
|
+
### Added
|
24
|
+
|
25
|
+
- Support for working with board groups:
|
26
|
+
- Reading, Creating, Deleting
|
27
|
+
- Archiving, Duplicating
|
28
|
+
- Moving an item to a group
|
29
|
+
|
1
30
|
## v0.4.0 (September 15, 2023)
|
2
31
|
|
3
32
|
### Added
|
data/lib/monday/error.rb
CHANGED
@@ -79,9 +79,9 @@ module Monday
|
|
79
79
|
#
|
80
80
|
# It is also raised when the body returns the following error_codes:
|
81
81
|
# InvalidUserIdException, InvalidVersionException, InvalidColumnIdException
|
82
|
-
# InvalidItemIdException, InvalidBoardIdException, InvalidArgumentException
|
82
|
+
# InvalidItemIdException, InvalidSubitemIdException, InvalidBoardIdException, InvalidArgumentException
|
83
83
|
# CreateBoardException, ItemsLimitationException, ItemNameTooLongException
|
84
|
-
# ColumnValueException, CorrectedValueException
|
84
|
+
# ColumnValueException, CorrectedValueException, InvalidGroupIdException
|
85
85
|
class InvalidRequestError < Error
|
86
86
|
end
|
87
87
|
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Monday
|
4
|
+
module Resources
|
5
|
+
# Represents Monday.com's group resource.
|
6
|
+
module Group
|
7
|
+
DEFAULT_SELECT = %w[id title].freeze
|
8
|
+
|
9
|
+
# Retrieves all the groups.
|
10
|
+
#
|
11
|
+
# Allows filtering groups using the args option.
|
12
|
+
# Allows customizing the values to retrieve using the select option.
|
13
|
+
# By default, ID and title fields are retrieved.
|
14
|
+
def groups(args: {}, select: DEFAULT_SELECT)
|
15
|
+
query = "query { boards(#{Util.format_args(args)}) { groups{#{Util.format_select(select)}}}}"
|
16
|
+
|
17
|
+
make_request(query)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Creates a new group.
|
21
|
+
#
|
22
|
+
# Allows customizing creating a group using the args option.
|
23
|
+
# Allows customizing the values to retrieve using the select option.
|
24
|
+
# By default, ID and title fields are retrieved.
|
25
|
+
def create_group(args: {}, select: DEFAULT_SELECT)
|
26
|
+
query = "mutation { create_group(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
27
|
+
|
28
|
+
make_request(query)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Updates a group.
|
32
|
+
#
|
33
|
+
# Allows customizing updating the group using the args option.
|
34
|
+
# By default, returns the ID of the updated group.
|
35
|
+
def update_group(args: {}, select: ["id"])
|
36
|
+
query = "mutation { update_group(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
37
|
+
|
38
|
+
make_request(query)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Deletes a group.
|
42
|
+
#
|
43
|
+
# Requires board_id and group_id in args option to delete the group.
|
44
|
+
# Allows customizing the values to retrieve using the select option.
|
45
|
+
# By default, returns the ID of the group deleted.
|
46
|
+
def delete_group(args: {}, select: ["id"])
|
47
|
+
query = "mutation { delete_group(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
48
|
+
|
49
|
+
make_request(query)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Archives a group.
|
53
|
+
#
|
54
|
+
# Requires board_id and group_id in args option to archive the group.
|
55
|
+
# Allows customizing the values to retrieve using the select option.
|
56
|
+
# By default, returns the ID of the group archived.
|
57
|
+
def archive_group(args: {}, select: ["id"])
|
58
|
+
query = "mutation { archive_group(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
59
|
+
|
60
|
+
make_request(query)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Duplicates a group.
|
64
|
+
#
|
65
|
+
# Requires board_id and group_id in args option to duplicate the group.
|
66
|
+
# Allows customizing the values to retrieve using the select option.
|
67
|
+
# By default, ID and title fields are retrieved.
|
68
|
+
def duplicate_group(args: {}, select: DEFAULT_SELECT)
|
69
|
+
query = "mutation { duplicate_group(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
70
|
+
|
71
|
+
make_request(query)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Move item to group.
|
75
|
+
#
|
76
|
+
# Requires item_id and group_id in args option to move an item to a group.
|
77
|
+
# Allows customizing the values to retrieve using the select option.
|
78
|
+
# By default, ID and title fields are retrieved.
|
79
|
+
def move_item_to_group(args: {}, select: ["id"])
|
80
|
+
query = "mutation { move_item_to_group(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
81
|
+
|
82
|
+
make_request(query)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Monday
|
4
|
+
module Resources
|
5
|
+
# Represents Monday.com's subitem resource.
|
6
|
+
module Subitem
|
7
|
+
DEFAULT_SELECT = %w[id name created_at].freeze
|
8
|
+
|
9
|
+
# Retrieves all the subitems for the item.
|
10
|
+
#
|
11
|
+
# Allows filtering subitems using the args option.
|
12
|
+
# Allows customizing the values to retrieve using the select option.
|
13
|
+
# By default, ID, name and created_at fields are retrieved.
|
14
|
+
def subitems(args: {}, select: DEFAULT_SELECT)
|
15
|
+
query = "query { items(#{Util.format_args(args)}) { subitems{#{Util.format_select(select)}}}}"
|
16
|
+
|
17
|
+
make_request(query)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Creates a new subitem.
|
21
|
+
#
|
22
|
+
# Allows customizing the subitem creation using the args option.
|
23
|
+
# Allows customizing the values to retrieve using the select option.
|
24
|
+
# By default, ID, name and created_at fields are retrieved.
|
25
|
+
def create_subitem(args: {}, select: DEFAULT_SELECT)
|
26
|
+
query = "mutation { create_subitem(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
27
|
+
|
28
|
+
make_request(query)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Monday
|
4
|
+
module Resources
|
5
|
+
# Represents Monday.com's update resource.
|
6
|
+
module Update
|
7
|
+
DEFAULT_SELECT = %w[id body created_at].freeze
|
8
|
+
|
9
|
+
# Retrieves all the updates.
|
10
|
+
#
|
11
|
+
# Allows filtering updates using the args option.
|
12
|
+
# Allows customizing the values to retrieve using the select option.
|
13
|
+
# By default, ID, body and created_at fields are retrieved.
|
14
|
+
def updates(args: {}, select: DEFAULT_SELECT)
|
15
|
+
query = "query { updates(#{Util.format_args(args)}) { #{Util.format_select(select)}}}"
|
16
|
+
|
17
|
+
make_request(query)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Creates a new update.
|
21
|
+
#
|
22
|
+
# Allows customizing the update creation using the args option.
|
23
|
+
# Allows customizing the values to retrieve using the select option.
|
24
|
+
# By default, ID, body and created_at fields are retrieved.
|
25
|
+
def create_update(args: {}, select: DEFAULT_SELECT)
|
26
|
+
query = "mutation { create_update(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
27
|
+
|
28
|
+
make_request(query)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Like an update.
|
32
|
+
#
|
33
|
+
# Allows customizing the update creation using the args option.
|
34
|
+
# Allows customizing the values to retrieve using the select option.
|
35
|
+
# By default, ID is retrieved.
|
36
|
+
def like_update(args: {}, select: %w[id])
|
37
|
+
query = "mutation { like_update(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
38
|
+
|
39
|
+
make_request(query)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Clear an item's update
|
43
|
+
#
|
44
|
+
# Allows customizing the update creation using the args option.
|
45
|
+
# Allows customizing the values to retrieve using the select option.
|
46
|
+
# By default, ID is retrieved.
|
47
|
+
def clear_item_updates(args: {}, select: %w[id])
|
48
|
+
query = "mutation { clear_item_updates(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
49
|
+
|
50
|
+
make_request(query)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Delete an update
|
54
|
+
#
|
55
|
+
# Allows customizing the update creation using the args option.
|
56
|
+
# Allows customizing the values to retrieve using the select option.
|
57
|
+
# By default, ID is retrieved.
|
58
|
+
def delete_update(args: {}, select: %w[id])
|
59
|
+
query = "mutation { delete_update(#{Util.format_args(args)}) {#{Util.format_select(select)}}}"
|
60
|
+
|
61
|
+
make_request(query)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/lib/monday/resources.rb
CHANGED
@@ -5,8 +5,11 @@ require_relative "resources/activity_log"
|
|
5
5
|
require_relative "resources/board"
|
6
6
|
require_relative "resources/board_view"
|
7
7
|
require_relative "resources/column"
|
8
|
+
require_relative "resources/group"
|
8
9
|
require_relative "resources/item"
|
10
|
+
require_relative "resources/subitem"
|
9
11
|
require_relative "resources/workspace"
|
12
|
+
require_relative "resources/update"
|
10
13
|
|
11
14
|
module Monday
|
12
15
|
module Resources
|
@@ -15,7 +18,10 @@ module Monday
|
|
15
18
|
include Board
|
16
19
|
include BoardView
|
17
20
|
include Column
|
21
|
+
include Group
|
18
22
|
include Item
|
23
|
+
include Subitem
|
19
24
|
include Workspace
|
25
|
+
include Update
|
20
26
|
end
|
21
27
|
end
|
data/lib/monday/util.rb
CHANGED
@@ -45,7 +45,9 @@ module Monday
|
|
45
45
|
"InvalidVersionException" => [InvalidRequestError, 400],
|
46
46
|
"InvalidColumnIdException" => [InvalidRequestError, 400],
|
47
47
|
"InvalidItemIdException" => [InvalidRequestError, 400],
|
48
|
+
"InvalidSubitemIdException" => [InvalidRequestError, 400],
|
48
49
|
"InvalidBoardIdException" => [InvalidRequestError, 400],
|
50
|
+
"InvalidGroupIdException" => [InvalidRequestError, 400],
|
49
51
|
"InvalidArgumentException" => [InvalidRequestError, 400],
|
50
52
|
"CreateBoardException" => [InvalidRequestError, 400],
|
51
53
|
"ItemsLimitationException" => [InvalidRequestError, 400],
|
@@ -71,16 +73,14 @@ module Monday
|
|
71
73
|
end
|
72
74
|
|
73
75
|
def formatted_args_value(value)
|
74
|
-
return "\"#{value}\"" unless single_word?(value)
|
75
76
|
return value.to_json.to_json if value.is_a?(Hash)
|
77
|
+
return value if integer?(value)
|
76
78
|
|
77
|
-
value
|
79
|
+
"\"#{value}\""
|
78
80
|
end
|
79
81
|
|
80
|
-
def
|
81
|
-
|
82
|
-
|
83
|
-
!word.strip.include?(" ")
|
82
|
+
def integer?(value)
|
83
|
+
value.is_a?(Integer)
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
data/lib/monday/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monday_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sanif Himani
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-03-24 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Gem to easily interact with monday.com API using native Ruby
|
15
15
|
email:
|
@@ -22,6 +22,7 @@ files:
|
|
22
22
|
- ".env"
|
23
23
|
- ".rspec"
|
24
24
|
- ".rubocop.yml"
|
25
|
+
- ".simplecov"
|
25
26
|
- ".vscode/settings.json"
|
26
27
|
- CHANGELOG.md
|
27
28
|
- CODE_OF_CONDUCT.md
|
@@ -78,7 +79,10 @@ files:
|
|
78
79
|
- lib/monday/resources/board.rb
|
79
80
|
- lib/monday/resources/board_view.rb
|
80
81
|
- lib/monday/resources/column.rb
|
82
|
+
- lib/monday/resources/group.rb
|
81
83
|
- lib/monday/resources/item.rb
|
84
|
+
- lib/monday/resources/subitem.rb
|
85
|
+
- lib/monday/resources/update.rb
|
82
86
|
- lib/monday/resources/workspace.rb
|
83
87
|
- lib/monday/response.rb
|
84
88
|
- lib/monday/util.rb
|
@@ -91,7 +95,7 @@ licenses:
|
|
91
95
|
metadata:
|
92
96
|
homepage_uri: https://github.com/sanifhimani/monday_ruby
|
93
97
|
documentation_uri: https://monday-ruby.gitbook.io/docs/
|
94
|
-
changelog_uri: https://github.com/sanifhimani/monday_ruby/blob/v0.
|
98
|
+
changelog_uri: https://github.com/sanifhimani/monday_ruby/blob/v0.6.1/CHANGELOG.md
|
95
99
|
rubygems_mfa_required: 'true'
|
96
100
|
post_install_message:
|
97
101
|
rdoc_options: []
|
@@ -108,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
112
|
- !ruby/object:Gem::Version
|
109
113
|
version: '0'
|
110
114
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
115
|
+
rubygems_version: 3.5.6
|
112
116
|
signing_key:
|
113
117
|
specification_version: 4
|
114
118
|
summary: Ruby bindings to use the monday.com API
|