monday_ruby 0.6.2 → 1.0.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/.env +1 -1
- data/CHANGELOG.md +20 -0
- data/README.md +22 -51
- data/lib/monday/client.rb +14 -11
- data/lib/monday/resources/account.rb +6 -4
- data/lib/monday/resources/activity_log.rb +7 -5
- data/lib/monday/resources/base.rb +20 -0
- data/lib/monday/resources/board.rb +19 -17
- data/lib/monday/resources/board_view.rb +6 -4
- data/lib/monday/resources/column.rb +22 -20
- data/lib/monday/resources/group.rb +18 -16
- data/lib/monday/resources/item.rb +15 -13
- data/lib/monday/resources/subitem.rb +8 -6
- data/lib/monday/resources/update.rb +13 -11
- data/lib/monday/resources/workspace.rb +10 -8
- data/lib/monday/resources.rb +16 -20
- data/lib/monday/util.rb +1 -0
- data/lib/monday/version.rb +1 -1
- data/monday_ruby.gemspec +2 -0
- metadata +19 -43
- data/docs/README.md +0 -13
- data/docs/SUMMARY.md +0 -40
- data/docs/client.md +0 -15
- data/docs/configuration.md +0 -40
- data/docs/error-handling.md +0 -71
- data/docs/getting-started.md +0 -25
- data/docs/quick-start.md +0 -269
- data/docs/resources/README.md +0 -27
- data/docs/resources/account/README.md +0 -9
- data/docs/resources/account/accounts.md +0 -82
- data/docs/resources/activity-log/README.md +0 -9
- data/docs/resources/activity-log/activity_logs.md +0 -95
- data/docs/resources/board/README.md +0 -21
- data/docs/resources/board/archive_board.md +0 -79
- data/docs/resources/board/boards.md +0 -96
- data/docs/resources/board/create_board.md +0 -95
- data/docs/resources/board/delete_board.md +0 -79
- data/docs/resources/board/delete_board_subscribers.md +0 -87
- data/docs/resources/board/duplicate_board.md +0 -94
- data/docs/resources/board/update_board.md +0 -91
- data/docs/resources/board-view/README.md +0 -9
- data/docs/resources/board-view/board_views.md +0 -88
- data/docs/resources/column/README.md +0 -25
- data/docs/resources/column/change_column_metadata.md +0 -70
- data/docs/resources/column/change_column_title.md +0 -68
- data/docs/resources/column/change_column_value.md +0 -73
- data/docs/resources/column/change_multiple_column_value.md +0 -81
- data/docs/resources/column/change_simple_column_value.md +0 -69
- data/docs/resources/column/column_values.md +0 -115
- data/docs/resources/column/columns.md +0 -117
- data/docs/resources/column/create_column.md +0 -70
- data/docs/resources/column/delete_column.md +0 -58
- data/docs/resources/item/README.md +0 -17
- data/docs/resources/item/archive_item.md +0 -80
- data/docs/resources/item/create_item.md +0 -105
- data/docs/resources/item/delete_item.md +0 -80
- data/docs/resources/item/duplicate_item.md +0 -87
- data/docs/resources/item/items.md +0 -95
- data/docs/response.md +0 -21
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "base"
|
4
|
+
|
3
5
|
module Monday
|
4
6
|
module Resources
|
5
7
|
# Represents Monday.com's group resource.
|
6
|
-
|
8
|
+
class Group < Base
|
7
9
|
DEFAULT_SELECT = %w[id title].freeze
|
8
10
|
|
9
11
|
# Retrieves all the groups.
|
@@ -11,10 +13,10 @@ module Monday
|
|
11
13
|
# Allows filtering groups using the args option.
|
12
14
|
# Allows customizing the values to retrieve using the select option.
|
13
15
|
# By default, ID and title fields are retrieved.
|
14
|
-
def
|
15
|
-
|
16
|
+
def query(args: {}, select: DEFAULT_SELECT)
|
17
|
+
request_query = "query{boards#{Util.format_args(args)}{groups{#{Util.format_select(select)}}}}"
|
16
18
|
|
17
|
-
make_request(
|
19
|
+
make_request(request_query)
|
18
20
|
end
|
19
21
|
|
20
22
|
# Creates a new group.
|
@@ -22,8 +24,8 @@ module Monday
|
|
22
24
|
# Allows customizing creating a group using the args option.
|
23
25
|
# Allows customizing the values to retrieve using the select option.
|
24
26
|
# By default, ID and title fields are retrieved.
|
25
|
-
def
|
26
|
-
query = "mutation
|
27
|
+
def create(args: {}, select: DEFAULT_SELECT)
|
28
|
+
query = "mutation{create_group#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
27
29
|
|
28
30
|
make_request(query)
|
29
31
|
end
|
@@ -32,8 +34,8 @@ module Monday
|
|
32
34
|
#
|
33
35
|
# Allows customizing updating the group using the args option.
|
34
36
|
# By default, returns the ID of the updated group.
|
35
|
-
def
|
36
|
-
query = "mutation
|
37
|
+
def update(args: {}, select: ["id"])
|
38
|
+
query = "mutation{update_group#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
37
39
|
|
38
40
|
make_request(query)
|
39
41
|
end
|
@@ -43,8 +45,8 @@ module Monday
|
|
43
45
|
# Requires board_id and group_id in args option to delete the group.
|
44
46
|
# Allows customizing the values to retrieve using the select option.
|
45
47
|
# By default, returns the ID of the group deleted.
|
46
|
-
def
|
47
|
-
query = "mutation
|
48
|
+
def delete(args: {}, select: ["id"])
|
49
|
+
query = "mutation{delete_group#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
48
50
|
|
49
51
|
make_request(query)
|
50
52
|
end
|
@@ -54,8 +56,8 @@ module Monday
|
|
54
56
|
# Requires board_id and group_id in args option to archive the group.
|
55
57
|
# Allows customizing the values to retrieve using the select option.
|
56
58
|
# By default, returns the ID of the group archived.
|
57
|
-
def
|
58
|
-
query = "mutation
|
59
|
+
def archive(args: {}, select: ["id"])
|
60
|
+
query = "mutation{archive_group#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
59
61
|
|
60
62
|
make_request(query)
|
61
63
|
end
|
@@ -65,8 +67,8 @@ module Monday
|
|
65
67
|
# Requires board_id and group_id in args option to duplicate the group.
|
66
68
|
# Allows customizing the values to retrieve using the select option.
|
67
69
|
# By default, ID and title fields are retrieved.
|
68
|
-
def
|
69
|
-
query = "mutation
|
70
|
+
def duplicate(args: {}, select: DEFAULT_SELECT)
|
71
|
+
query = "mutation{duplicate_group#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
70
72
|
|
71
73
|
make_request(query)
|
72
74
|
end
|
@@ -76,8 +78,8 @@ module Monday
|
|
76
78
|
# Requires item_id and group_id in args option to move an item to a group.
|
77
79
|
# Allows customizing the values to retrieve using the select option.
|
78
80
|
# By default, ID and title fields are retrieved.
|
79
|
-
def
|
80
|
-
query = "mutation
|
81
|
+
def move_item(args: {}, select: ["id"])
|
82
|
+
query = "mutation{move_item_to_group#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
81
83
|
|
82
84
|
make_request(query)
|
83
85
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "base"
|
4
|
+
|
3
5
|
module Monday
|
4
6
|
module Resources
|
5
7
|
# Represents Monday.com's item resource.
|
6
|
-
|
8
|
+
class Item < Base
|
7
9
|
DEFAULT_SELECT = %w[id name created_at].freeze
|
8
10
|
|
9
11
|
# Retrieves all the items for the boards.
|
@@ -11,10 +13,10 @@ module Monday
|
|
11
13
|
# Allows filtering items using the args option.
|
12
14
|
# Allows customizing the values to retrieve using the select option.
|
13
15
|
# By default, ID, name and created_at fields are retrieved.
|
14
|
-
def
|
15
|
-
|
16
|
+
def query(args: {}, select: DEFAULT_SELECT)
|
17
|
+
request_query = "query{items#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
16
18
|
|
17
|
-
make_request(
|
19
|
+
make_request(request_query)
|
18
20
|
end
|
19
21
|
|
20
22
|
# Creates a new item.
|
@@ -22,8 +24,8 @@ module Monday
|
|
22
24
|
# Allows customizing the item creation using the args option.
|
23
25
|
# Allows customizing the values to retrieve using the select option.
|
24
26
|
# By default, ID, name and created_at fields are retrieved.
|
25
|
-
def
|
26
|
-
query = "mutation
|
27
|
+
def create(args: {}, select: DEFAULT_SELECT)
|
28
|
+
query = "mutation{create_item#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
27
29
|
|
28
30
|
make_request(query)
|
29
31
|
end
|
@@ -33,9 +35,9 @@ module Monday
|
|
33
35
|
# Allows customizing the item creation using the args option.
|
34
36
|
# Allows customizing the values to retrieve using the select option.
|
35
37
|
# By default, ID, name and created_at fields are retrieved.
|
36
|
-
def
|
37
|
-
query = "mutation
|
38
|
-
"with_updates: #{with_updates})
|
38
|
+
def duplicate(board_id, item_id, with_updates, select: DEFAULT_SELECT)
|
39
|
+
query = "mutation{duplicate_item(board_id: #{board_id}, item_id: #{item_id}, " \
|
40
|
+
"with_updates: #{with_updates}){#{Util.format_select(select)}}}"
|
39
41
|
|
40
42
|
make_request(query)
|
41
43
|
end
|
@@ -45,8 +47,8 @@ module Monday
|
|
45
47
|
# Requires item_id to archive item.
|
46
48
|
# Allows customizing the values to retrieve using the select option.
|
47
49
|
# By default, returns the ID of the archived item.
|
48
|
-
def
|
49
|
-
query = "mutation
|
50
|
+
def archive(item_id, select: %w[id])
|
51
|
+
query = "mutation{archive_item(item_id: #{item_id}){#{Util.format_select(select)}}}"
|
50
52
|
|
51
53
|
make_request(query)
|
52
54
|
end
|
@@ -56,8 +58,8 @@ module Monday
|
|
56
58
|
# Requires item_id to delete item.
|
57
59
|
# Allows customizing the values to retrieve using the select option.
|
58
60
|
# By default, returns the ID of the deleted item.
|
59
|
-
def
|
60
|
-
query = "mutation
|
61
|
+
def delete(item_id, select: %w[id])
|
62
|
+
query = "mutation{delete_item(item_id: #{item_id}){#{Util.format_select(select)}}}"
|
61
63
|
|
62
64
|
make_request(query)
|
63
65
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "base"
|
4
|
+
|
3
5
|
module Monday
|
4
6
|
module Resources
|
5
7
|
# Represents Monday.com's subitem resource.
|
6
|
-
|
8
|
+
class Subitem < Base
|
7
9
|
DEFAULT_SELECT = %w[id name created_at].freeze
|
8
10
|
|
9
11
|
# Retrieves all the subitems for the item.
|
@@ -11,10 +13,10 @@ module Monday
|
|
11
13
|
# Allows filtering subitems using the args option.
|
12
14
|
# Allows customizing the values to retrieve using the select option.
|
13
15
|
# By default, ID, name and created_at fields are retrieved.
|
14
|
-
def
|
15
|
-
|
16
|
+
def query(args: {}, select: DEFAULT_SELECT)
|
17
|
+
request_query = "query{items#{Util.format_args(args)}{ subitems{#{Util.format_select(select)}}}}"
|
16
18
|
|
17
|
-
make_request(
|
19
|
+
make_request(request_query)
|
18
20
|
end
|
19
21
|
|
20
22
|
# Creates a new subitem.
|
@@ -22,8 +24,8 @@ module Monday
|
|
22
24
|
# Allows customizing the subitem creation using the args option.
|
23
25
|
# Allows customizing the values to retrieve using the select option.
|
24
26
|
# By default, ID, name and created_at fields are retrieved.
|
25
|
-
def
|
26
|
-
query = "mutation
|
27
|
+
def create(args: {}, select: DEFAULT_SELECT)
|
28
|
+
query = "mutation{create_subitem#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
27
29
|
|
28
30
|
make_request(query)
|
29
31
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "base"
|
4
|
+
|
3
5
|
module Monday
|
4
6
|
module Resources
|
5
7
|
# Represents Monday.com's update resource.
|
6
|
-
|
8
|
+
class Update < Base
|
7
9
|
DEFAULT_SELECT = %w[id body created_at].freeze
|
8
10
|
|
9
11
|
# Retrieves all the updates.
|
@@ -11,10 +13,10 @@ module Monday
|
|
11
13
|
# Allows filtering updates using the args option.
|
12
14
|
# Allows customizing the values to retrieve using the select option.
|
13
15
|
# By default, ID, body and created_at fields are retrieved.
|
14
|
-
def
|
15
|
-
|
16
|
+
def query(args: {}, select: DEFAULT_SELECT)
|
17
|
+
request_query = "query{updates#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
16
18
|
|
17
|
-
make_request(
|
19
|
+
make_request(request_query)
|
18
20
|
end
|
19
21
|
|
20
22
|
# Creates a new update.
|
@@ -22,8 +24,8 @@ module Monday
|
|
22
24
|
# Allows customizing the update creation using the args option.
|
23
25
|
# Allows customizing the values to retrieve using the select option.
|
24
26
|
# By default, ID, body and created_at fields are retrieved.
|
25
|
-
def
|
26
|
-
query = "mutation
|
27
|
+
def create(args: {}, select: DEFAULT_SELECT)
|
28
|
+
query = "mutation{create_update#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
27
29
|
|
28
30
|
make_request(query)
|
29
31
|
end
|
@@ -33,8 +35,8 @@ module Monday
|
|
33
35
|
# Allows customizing the update creation using the args option.
|
34
36
|
# Allows customizing the values to retrieve using the select option.
|
35
37
|
# By default, ID is retrieved.
|
36
|
-
def
|
37
|
-
query = "mutation
|
38
|
+
def like(args: {}, select: %w[id])
|
39
|
+
query = "mutation{like_update#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
38
40
|
|
39
41
|
make_request(query)
|
40
42
|
end
|
@@ -45,7 +47,7 @@ module Monday
|
|
45
47
|
# Allows customizing the values to retrieve using the select option.
|
46
48
|
# By default, ID is retrieved.
|
47
49
|
def clear_item_updates(args: {}, select: %w[id])
|
48
|
-
query = "mutation
|
50
|
+
query = "mutation{clear_item_updates#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
49
51
|
|
50
52
|
make_request(query)
|
51
53
|
end
|
@@ -55,8 +57,8 @@ module Monday
|
|
55
57
|
# Allows customizing the update creation using the args option.
|
56
58
|
# Allows customizing the values to retrieve using the select option.
|
57
59
|
# By default, ID is retrieved.
|
58
|
-
def
|
59
|
-
query = "mutation
|
60
|
+
def delete(args: {}, select: %w[id])
|
61
|
+
query = "mutation{delete_update#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
60
62
|
|
61
63
|
make_request(query)
|
62
64
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "base"
|
4
|
+
|
3
5
|
module Monday
|
4
6
|
module Resources
|
5
7
|
# Represents Monday.com's workspace resource.
|
6
|
-
|
8
|
+
class Workspace < Base
|
7
9
|
DEFAULT_SELECT = %w[id name description].freeze
|
8
10
|
|
9
11
|
# Retrieves all the workspaces.
|
@@ -11,10 +13,10 @@ module Monday
|
|
11
13
|
# Allows filtering workspaces using the args option.
|
12
14
|
# Allows customizing the values to retrieve using the select option.
|
13
15
|
# By default, ID, name and description fields are retrieved.
|
14
|
-
def
|
15
|
-
|
16
|
+
def query(args: {}, select: DEFAULT_SELECT)
|
17
|
+
request_query = "query{workspaces#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
16
18
|
|
17
|
-
make_request(
|
19
|
+
make_request(request_query)
|
18
20
|
end
|
19
21
|
|
20
22
|
# Creates a new workspaces.
|
@@ -22,8 +24,8 @@ module Monday
|
|
22
24
|
# Allows customizing creating a workspace using the args option.
|
23
25
|
# Allows customizing the values to retrieve using the select option.
|
24
26
|
# By default, ID, name and description fields are retrieved.
|
25
|
-
def
|
26
|
-
query = "mutation
|
27
|
+
def create(args: {}, select: DEFAULT_SELECT)
|
28
|
+
query = "mutation{create_workspace#{Util.format_args(args)}{#{Util.format_select(select)}}}"
|
27
29
|
|
28
30
|
make_request(query)
|
29
31
|
end
|
@@ -33,8 +35,8 @@ module Monday
|
|
33
35
|
# Requires workspace_id to delete the workspace.
|
34
36
|
# Allows customizing the values to retrieve using the select option.
|
35
37
|
# By default, returns the ID of the workspace deleted.
|
36
|
-
def
|
37
|
-
query = "mutation
|
38
|
+
def delete(workspace_id, select: ["id"])
|
39
|
+
query = "mutation{delete_workspace(workspace_id: #{workspace_id}){#{Util.format_select(select)}}}"
|
38
40
|
|
39
41
|
make_request(query)
|
40
42
|
end
|
data/lib/monday/resources.rb
CHANGED
@@ -1,27 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require_relative "resources/activity_log"
|
5
|
-
require_relative "resources/board"
|
6
|
-
require_relative "resources/board_view"
|
7
|
-
require_relative "resources/column"
|
8
|
-
require_relative "resources/group"
|
9
|
-
require_relative "resources/item"
|
10
|
-
require_relative "resources/subitem"
|
11
|
-
require_relative "resources/workspace"
|
12
|
-
require_relative "resources/update"
|
3
|
+
Dir[File.join(__dir__, "resources", "*.rb")].sort.each { |file| require file }
|
13
4
|
|
14
5
|
module Monday
|
6
|
+
# Encapsulates all available resources and includes them in the client.
|
15
7
|
module Resources
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
8
|
+
def self.initialize(client)
|
9
|
+
constants.each do |constant|
|
10
|
+
resource_class = const_get(constant)
|
11
|
+
resource_name = constant.to_s.gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase
|
12
|
+
client.instance_variable_set("@#{resource_name}", resource_class.new(client))
|
13
|
+
define_resource_accessor(client, resource_name) unless client.class.method_defined?(resource_name)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.define_resource_accessor(client, resource_name)
|
18
|
+
client.class.class_eval do
|
19
|
+
attr_reader resource_name
|
20
|
+
end
|
21
|
+
end
|
26
22
|
end
|
27
23
|
end
|
data/lib/monday/util.rb
CHANGED
data/lib/monday/version.rb
CHANGED
data/monday_ruby.gemspec
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: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sanif Himani
|
@@ -9,8 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
13
|
-
dependencies:
|
12
|
+
date: 2024-07-30 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: base64
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 0.2.0
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.2.0
|
14
28
|
description: A Gem to easily interact with monday.com API using native Ruby
|
15
29
|
email:
|
16
30
|
- sanifhimani92@gmail.com
|
@@ -30,45 +44,6 @@ files:
|
|
30
44
|
- LICENSE
|
31
45
|
- README.md
|
32
46
|
- Rakefile
|
33
|
-
- docs/README.md
|
34
|
-
- docs/SUMMARY.md
|
35
|
-
- docs/client.md
|
36
|
-
- docs/configuration.md
|
37
|
-
- docs/error-handling.md
|
38
|
-
- docs/getting-started.md
|
39
|
-
- docs/quick-start.md
|
40
|
-
- docs/resources/README.md
|
41
|
-
- docs/resources/account/README.md
|
42
|
-
- docs/resources/account/accounts.md
|
43
|
-
- docs/resources/activity-log/README.md
|
44
|
-
- docs/resources/activity-log/activity_logs.md
|
45
|
-
- docs/resources/board-view/README.md
|
46
|
-
- docs/resources/board-view/board_views.md
|
47
|
-
- docs/resources/board/README.md
|
48
|
-
- docs/resources/board/archive_board.md
|
49
|
-
- docs/resources/board/boards.md
|
50
|
-
- docs/resources/board/create_board.md
|
51
|
-
- docs/resources/board/delete_board.md
|
52
|
-
- docs/resources/board/delete_board_subscribers.md
|
53
|
-
- docs/resources/board/duplicate_board.md
|
54
|
-
- docs/resources/board/update_board.md
|
55
|
-
- docs/resources/column/README.md
|
56
|
-
- docs/resources/column/change_column_metadata.md
|
57
|
-
- docs/resources/column/change_column_title.md
|
58
|
-
- docs/resources/column/change_column_value.md
|
59
|
-
- docs/resources/column/change_multiple_column_value.md
|
60
|
-
- docs/resources/column/change_simple_column_value.md
|
61
|
-
- docs/resources/column/column_values.md
|
62
|
-
- docs/resources/column/columns.md
|
63
|
-
- docs/resources/column/create_column.md
|
64
|
-
- docs/resources/column/delete_column.md
|
65
|
-
- docs/resources/item/README.md
|
66
|
-
- docs/resources/item/archive_item.md
|
67
|
-
- docs/resources/item/create_item.md
|
68
|
-
- docs/resources/item/delete_item.md
|
69
|
-
- docs/resources/item/duplicate_item.md
|
70
|
-
- docs/resources/item/items.md
|
71
|
-
- docs/response.md
|
72
47
|
- lib/monday/client.rb
|
73
48
|
- lib/monday/configuration.rb
|
74
49
|
- lib/monday/error.rb
|
@@ -76,6 +51,7 @@ files:
|
|
76
51
|
- lib/monday/resources.rb
|
77
52
|
- lib/monday/resources/account.rb
|
78
53
|
- lib/monday/resources/activity_log.rb
|
54
|
+
- lib/monday/resources/base.rb
|
79
55
|
- lib/monday/resources/board.rb
|
80
56
|
- lib/monday/resources/board_view.rb
|
81
57
|
- lib/monday/resources/column.rb
|
@@ -95,7 +71,7 @@ licenses:
|
|
95
71
|
metadata:
|
96
72
|
homepage_uri: https://github.com/sanifhimani/monday_ruby
|
97
73
|
documentation_uri: https://monday-ruby.gitbook.io/docs/
|
98
|
-
changelog_uri: https://github.com/sanifhimani/monday_ruby/blob/
|
74
|
+
changelog_uri: https://github.com/sanifhimani/monday_ruby/blob/v1.0.0/CHANGELOG.md
|
99
75
|
rubygems_mfa_required: 'true'
|
100
76
|
post_install_message:
|
101
77
|
rdoc_options: []
|
data/docs/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# Monday API Library for Ruby
|
2
|
-
|
3
|
-
This library provides convenient access to the monday.com API from the application written in the Ruby language.
|
4
|
-
|
5
|
-
The library provides:
|
6
|
-
|
7
|
-
1. A pre-defined set of methods to easily interact with the API resources.
|
8
|
-
2. Easy configuration path for fast setup and use.
|
9
|
-
3. Easy error handling
|
10
|
-
|
11
|
-
#### Requirements
|
12
|
-
|
13
|
-
* Ruby 2.7+
|
data/docs/SUMMARY.md
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# Table of contents
|
2
|
-
|
3
|
-
* [Monday API Library for Ruby](README.md)
|
4
|
-
* [Getting Started](getting-started.md)
|
5
|
-
* [Configuration](configuration.md)
|
6
|
-
* [Client](client.md)
|
7
|
-
* [Response](response.md)
|
8
|
-
* [Quick Start](quick-start.md)
|
9
|
-
* [Error Handling](error-handling.md)
|
10
|
-
* [Resources](resources/README.md)
|
11
|
-
* [Account](resources/account/README.md)
|
12
|
-
* [#accounts](resources/account/accounts.md)
|
13
|
-
* [Activity Log](resources/activity-log/README.md)
|
14
|
-
* [#activity\_logs](resources/activity-log/activity\_logs.md)
|
15
|
-
* [Board View](resources/board-view/README.md)
|
16
|
-
* [#board\_views](resources/board-view/board\_views.md)
|
17
|
-
* [Board](resources/board/README.md)
|
18
|
-
* [#boards](resources/board/boards.md)
|
19
|
-
* [#create\_board](resources/board/create\_board.md)
|
20
|
-
* [#duplicate\_board](resources/board/duplicate\_board.md)
|
21
|
-
* [#update\_board](resources/board/update\_board.md)
|
22
|
-
* [#archive\_board](resources/board/archive\_board.md)
|
23
|
-
* [#delete\_board](resources/board/delete\_board.md)
|
24
|
-
* [#delete\_board\_subscribers](resources/board/delete\_board\_subscribers.md)
|
25
|
-
* [Column](resources/column/README.md)
|
26
|
-
* [#columns](resources/column/columns.md)
|
27
|
-
* [#column\_values](resources/column/column\_values.md)
|
28
|
-
* [#create\_column](resources/column/create\_column.md)
|
29
|
-
* [#change\_column\_title](resources/column/change\_column\_title.md)
|
30
|
-
* [#change\_column\_metadata](resources/column/change\_column\_metadata.md)
|
31
|
-
* [#change\_column\_value](resources/column/change\_column\_value.md)
|
32
|
-
* [#change\_simple\_column\_value](resources/column/change\_simple\_column\_value.md)
|
33
|
-
* [#change\_multiple\_column\_value](resources/column/change\_multiple\_column\_value.md)
|
34
|
-
* [#delete\_column](resources/column/delete\_column.md)
|
35
|
-
* [Item](resources/item/README.md)
|
36
|
-
* [#items](resources/item/items.md)
|
37
|
-
* [#create\_item](resources/item/create\_item.md)
|
38
|
-
* [#duplicate\_item](resources/item/duplicate\_item.md)
|
39
|
-
* [#archive\_item](resources/item/archive\_item.md)
|
40
|
-
* [#delete\_item](resources/item/delete\_item.md)
|
data/docs/client.md
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# Client
|
2
|
-
|
3
|
-
The Monday client is flat, meaning most API actions are available as methods on the client object. To initialize a client, run the following:
|
4
|
-
|
5
|
-
{% code lineNumbers="true" %}
|
6
|
-
```ruby
|
7
|
-
# If the library is configured globally
|
8
|
-
client_with_global_config = Monday::Client.new
|
9
|
-
|
10
|
-
# For a specific client
|
11
|
-
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
12
|
-
```
|
13
|
-
{% endcode %}
|
14
|
-
|
15
|
-
You can then use all the [resources](resources/) using the client object.
|
data/docs/configuration.md
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# Configuration
|
2
|
-
|
3
|
-
To interact with the API, you must provide a valid auth token. This token can be generated from the Administration tab on the account. For more authentication information, please look at monday.com's [API documentation](https://developer.monday.com/api-reference/docs/authentication).
|
4
|
-
|
5
|
-
Once you have the authentication token, you can either globally configure the library or you can configure a specific client.
|
6
|
-
|
7
|
-
### Global
|
8
|
-
|
9
|
-
To configure the library globally, you can do the following:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require "monday_ruby"
|
13
|
-
|
14
|
-
Monday.configure do |config|
|
15
|
-
config.token = <AUTH_TOKEN>
|
16
|
-
end
|
17
|
-
```
|
18
|
-
|
19
|
-
### Client specific config
|
20
|
-
|
21
|
-
To configure a client, you can do the following:
|
22
|
-
|
23
|
-
```ruby
|
24
|
-
require "monday_ruby"
|
25
|
-
|
26
|
-
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
27
|
-
```
|
28
|
-
|
29
|
-
You can optionally pass in the version of the API you want to use using the `version` configuration field.
|
30
|
-
|
31
|
-
By default, the latest stable version is used. Read more about the version on monday.com's [official documentation](https://developer.monday.com/api-reference/docs/api-versioning).
|
32
|
-
|
33
|
-
```ruby
|
34
|
-
require "monday_ruby"
|
35
|
-
|
36
|
-
Monday.configure do |config|
|
37
|
-
config.token = <AUTH_TOKEN>
|
38
|
-
config.version = "2023-07"
|
39
|
-
end
|
40
|
-
```
|
data/docs/error-handling.md
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
# Error Handling
|
2
|
-
|
3
|
-
Monday.com has a set of predefined errors and exceptions that are sent back from their GraphQL API. Refer to their [official documentation](https://developer.monday.com/api-reference/docs/errors) to know more about the error codes.
|
4
|
-
|
5
|
-
### Catching exceptions
|
6
|
-
|
7
|
-
If there is an error from the API, the library raises an exception. It's a best practice to catch and handle exceptions.
|
8
|
-
|
9
|
-
To catch an exception, use the `rescue` keyword. You can catch all the exceptions from the API using the `Monday::Error` class. However, it is recommended to catch specific exceptions using its subclasses and have a fallback rescue using `Monday::Error`.
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require "monday_ruby"
|
13
|
-
|
14
|
-
client = Monday::Client.new(token: <AUTH_TOKEN>)
|
15
|
-
|
16
|
-
def example
|
17
|
-
res = client.boards
|
18
|
-
puts res.body
|
19
|
-
rescue Monday::AuthorizationError => error
|
20
|
-
puts "Authorization error: #{error.message}"
|
21
|
-
puts "Error code: #{error.code}"
|
22
|
-
rescue Monday::Error => error
|
23
|
-
puts "Other error: #{error.message}"
|
24
|
-
end
|
25
|
-
```
|
26
|
-
|
27
|
-
Along with the default status code exceptions, monday.com returns some other exceptions with `200` status code. This library handles those errors and raises exceptions accordingly.
|
28
|
-
|
29
|
-
#### `Monday::InternalServer Error`
|
30
|
-
|
31
|
-
This exception is raised when the server returns a `500` status code. Read more about what can cause this error on Monday.com's [official documentation](https://developer.monday.com/api-reference/docs/errors#internal-server-error).
|
32
|
-
|
33
|
-
#### `Monday::AuthorizationError`
|
34
|
-
|
35
|
-
This exception is raised when the server returns a `401` or a `403` status code. This can happen when the client is not authenticated, i.e., not configured with the token, or the token is incorrect.
|
36
|
-
|
37
|
-
This exception is also raised when the server returns a `200` status code but the body returns `UserUnauthorizedException` error code.
|
38
|
-
|
39
|
-
#### `Monday::RateLimitError`
|
40
|
-
|
41
|
-
This exception is raised when the server returns a `429` status code. This can happen when you exceed the rate limit, i.e., 5,000 requests per minute. Read more about their rate limit on their [official documentation](https://developer.monday.com/api-reference/docs/rate-limits).
|
42
|
-
|
43
|
-
#### `Monday::ResourceNotFoundError`
|
44
|
-
|
45
|
-
This exception is raised when the server returns a `404` status code. This can happen when you pass an invalid ID in the query.
|
46
|
-
|
47
|
-
This exception is also raised when the server returns a `200` status code but the body returns `ResourceNotFoundException` error code.
|
48
|
-
|
49
|
-
#### `Monday::ComplexityError`
|
50
|
-
|
51
|
-
This exception is raised when the server returns a `200` status code but the body returns `ComplexityException` error code.
|
52
|
-
|
53
|
-
#### `Monday::InvalidRequestError`
|
54
|
-
|
55
|
-
This exception is raised when the server returns a `400` status code. This can happen when the query you pass is invalid.
|
56
|
-
|
57
|
-
This exception is also raised when the server returns a `200` status code but the body returns the following error codes:
|
58
|
-
|
59
|
-
1. `InvalidUserIdException`
|
60
|
-
2. `InvalidVersionException`
|
61
|
-
3. `InvalidColumnIdException`
|
62
|
-
4. `InvalidItemIdException`
|
63
|
-
5. `InvalidBoardIdException`
|
64
|
-
6. `InvalidArgumentException`
|
65
|
-
7. `CreateBoardException`
|
66
|
-
8. `ItemsLimitationException`
|
67
|
-
9. `ItemNameTooLongException`
|
68
|
-
10. `ColumnValueException`
|
69
|
-
11. `CorrectedValueException`
|
70
|
-
|
71
|
-
Read more about these specific exceptions on their [official API documentation](https://developer.monday.com/api-reference/docs/errors).
|