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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.env +1 -1
  3. data/CHANGELOG.md +20 -0
  4. data/README.md +22 -51
  5. data/lib/monday/client.rb +14 -11
  6. data/lib/monday/resources/account.rb +6 -4
  7. data/lib/monday/resources/activity_log.rb +7 -5
  8. data/lib/monday/resources/base.rb +20 -0
  9. data/lib/monday/resources/board.rb +19 -17
  10. data/lib/monday/resources/board_view.rb +6 -4
  11. data/lib/monday/resources/column.rb +22 -20
  12. data/lib/monday/resources/group.rb +18 -16
  13. data/lib/monday/resources/item.rb +15 -13
  14. data/lib/monday/resources/subitem.rb +8 -6
  15. data/lib/monday/resources/update.rb +13 -11
  16. data/lib/monday/resources/workspace.rb +10 -8
  17. data/lib/monday/resources.rb +16 -20
  18. data/lib/monday/util.rb +1 -0
  19. data/lib/monday/version.rb +1 -1
  20. data/monday_ruby.gemspec +2 -0
  21. metadata +19 -43
  22. data/docs/README.md +0 -13
  23. data/docs/SUMMARY.md +0 -40
  24. data/docs/client.md +0 -15
  25. data/docs/configuration.md +0 -40
  26. data/docs/error-handling.md +0 -71
  27. data/docs/getting-started.md +0 -25
  28. data/docs/quick-start.md +0 -269
  29. data/docs/resources/README.md +0 -27
  30. data/docs/resources/account/README.md +0 -9
  31. data/docs/resources/account/accounts.md +0 -82
  32. data/docs/resources/activity-log/README.md +0 -9
  33. data/docs/resources/activity-log/activity_logs.md +0 -95
  34. data/docs/resources/board/README.md +0 -21
  35. data/docs/resources/board/archive_board.md +0 -79
  36. data/docs/resources/board/boards.md +0 -96
  37. data/docs/resources/board/create_board.md +0 -95
  38. data/docs/resources/board/delete_board.md +0 -79
  39. data/docs/resources/board/delete_board_subscribers.md +0 -87
  40. data/docs/resources/board/duplicate_board.md +0 -94
  41. data/docs/resources/board/update_board.md +0 -91
  42. data/docs/resources/board-view/README.md +0 -9
  43. data/docs/resources/board-view/board_views.md +0 -88
  44. data/docs/resources/column/README.md +0 -25
  45. data/docs/resources/column/change_column_metadata.md +0 -70
  46. data/docs/resources/column/change_column_title.md +0 -68
  47. data/docs/resources/column/change_column_value.md +0 -73
  48. data/docs/resources/column/change_multiple_column_value.md +0 -81
  49. data/docs/resources/column/change_simple_column_value.md +0 -69
  50. data/docs/resources/column/column_values.md +0 -115
  51. data/docs/resources/column/columns.md +0 -117
  52. data/docs/resources/column/create_column.md +0 -70
  53. data/docs/resources/column/delete_column.md +0 -58
  54. data/docs/resources/item/README.md +0 -17
  55. data/docs/resources/item/archive_item.md +0 -80
  56. data/docs/resources/item/create_item.md +0 -105
  57. data/docs/resources/item/delete_item.md +0 -80
  58. data/docs/resources/item/duplicate_item.md +0 -87
  59. data/docs/resources/item/items.md +0 -95
  60. 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
- module Group
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 groups(args: {}, select: DEFAULT_SELECT)
15
- query = "query { boards#{Util.format_args(args)} { groups{#{Util.format_select(select)}}}}"
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(query)
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 create_group(args: {}, select: DEFAULT_SELECT)
26
- query = "mutation { create_group#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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 update_group(args: {}, select: ["id"])
36
- query = "mutation { update_group#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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 delete_group(args: {}, select: ["id"])
47
- query = "mutation { delete_group#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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 archive_group(args: {}, select: ["id"])
58
- query = "mutation { archive_group#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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 duplicate_group(args: {}, select: DEFAULT_SELECT)
69
- query = "mutation { duplicate_group#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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 move_item_to_group(args: {}, select: ["id"])
80
- query = "mutation { move_item_to_group#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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
- module Item
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 items(args: {}, select: DEFAULT_SELECT)
15
- query = "query { items#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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(query)
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 create_item(args: {}, select: DEFAULT_SELECT)
26
- query = "mutation { create_item#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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 duplicate_item(board_id, item_id, with_updates, select: DEFAULT_SELECT)
37
- query = "mutation { duplicate_item(board_id: #{board_id}, item_id: #{item_id}, " \
38
- "with_updates: #{with_updates}) {#{Util.format_select(select)}}}"
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 archive_item(item_id, select: %w[id])
49
- query = "mutation { archive_item(item_id: #{item_id}) {#{Util.format_select(select)}}}"
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 delete_item(item_id, select: %w[id])
60
- query = "mutation { delete_item(item_id: #{item_id}) {#{Util.format_select(select)}}}"
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
- module Subitem
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 subitems(args: {}, select: DEFAULT_SELECT)
15
- query = "query { items#{Util.format_args(args)} { subitems{#{Util.format_select(select)}}}}"
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(query)
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 create_subitem(args: {}, select: DEFAULT_SELECT)
26
- query = "mutation { create_subitem#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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
- module Update
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 updates(args: {}, select: DEFAULT_SELECT)
15
- query = "query { updates#{Util.format_args(args)} { #{Util.format_select(select)}}}"
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(query)
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 create_update(args: {}, select: DEFAULT_SELECT)
26
- query = "mutation { create_update#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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 like_update(args: {}, select: %w[id])
37
- query = "mutation { like_update#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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 { clear_item_updates#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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 delete_update(args: {}, select: %w[id])
59
- query = "mutation { delete_update#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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
- module Workspace
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 workspaces(args: {}, select: DEFAULT_SELECT)
15
- query = "query { workspaces#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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(query)
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 create_workspace(args: {}, select: DEFAULT_SELECT)
26
- query = "mutation { create_workspace#{Util.format_args(args)} {#{Util.format_select(select)}}}"
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 delete_workspace(workspace_id, select: ["id"])
37
- query = "mutation { delete_workspace(workspace_id: #{workspace_id}) {#{Util.format_select(select)}}}"
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
@@ -1,27 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "resources/account"
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
- include Account
17
- include ActivityLog
18
- include Board
19
- include BoardView
20
- include Column
21
- include Group
22
- include Item
23
- include Subitem
24
- include Workspace
25
- include Update
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
@@ -77,6 +77,7 @@ module Monday
77
77
  end
78
78
 
79
79
  def formatted_args_value(value)
80
+ return value if value.is_a?(Symbol)
80
81
  return value.to_json.to_json if value.is_a?(Hash)
81
82
  return value if integer?(value)
82
83
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Monday
4
- VERSION = "0.6.2"
4
+ VERSION = "1.0.0"
5
5
  end
data/monday_ruby.gemspec CHANGED
@@ -34,4 +34,6 @@ Gem::Specification.new do |spec|
34
34
  spec.bindir = "exe"
35
35
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
36
36
  spec.require_paths = ["lib"]
37
+
38
+ spec.add_dependency "base64", "~> 0.2.0"
37
39
  end
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.6.2
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-04-21 00:00:00.000000000 Z
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/v0.6.2/CHANGELOG.md
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.
@@ -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
- ```
@@ -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).