monday_ruby 0.4.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f0e71a61ef39a418ca03c8151a357e3623f9c4a030c74cee613e4cefc8d684a
4
- data.tar.gz: 2ab39c2856f63b1e72a9395630c43b92fd589b1790954b36791ed105f6e52362
3
+ metadata.gz: 9976cfcde08608cfe4106783b717d0c3fcc4c7b9851a3f994a3c7bd33493c437
4
+ data.tar.gz: bbaa8b1e58c3c1e2a73e50a797040c5828000a79e5efac05e43471109a26a51c
5
5
  SHA512:
6
- metadata.gz: 65ad4b3eec9937e42fe5a2a811f7ccdc2caf3c17e4b38ede2b10a7be148519ec6a7e75d5b272fb86c33667be7309b2c51858f7e97563f147ca1f35d9adca1ac9
7
- data.tar.gz: 41c14a6bd4c846d25701a19a7dadb775e379ac2a45b1967b3d97025301dfb1ccdbc5983c4efa6d78769f9daedfb9d3a9773fa976140816017d97308f128b4814
6
+ metadata.gz: 7a023ba0076f5cfebd1ca6e4708942afe37b7f75001ecab2126e676fa2338fce6e5ce232d3ab5ab5109301cba5fae1a0dfcd504c1db9a6de99b96587dacb7d17
7
+ data.tar.gz: 46f345126e55080fe842bfda28d0dc349848640fda23f4323832b973170534c41345410852d330ba3731f8f011fd65c6a5b4b975410313a3717973be343c12c5
data/.simplecov ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ SimpleCov.minimum_coverage 97
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## v0.6.0 (October 9, 2023)
2
+
3
+ ### Added
4
+
5
+ - Support for working with subitems:
6
+ - Listing subitems
7
+ - Creating a subitem
8
+
9
+ - Support for working with updates:
10
+ - Create an Update
11
+ - Like an Update
12
+ - Clear an item's updates
13
+ - Delete an update
14
+
15
+ ## v0.5.0 (September 21, 2023)
16
+
17
+ ### Added
18
+
19
+ - Support for working with board groups:
20
+ - Reading, Creating, Deleting
21
+ - Archiving, Duplicating
22
+ - Moving an item to a group
23
+
1
24
  ## v0.4.0 (September 15, 2023)
2
25
 
3
26
  ### 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
@@ -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],
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Monday
4
- VERSION = "0.4.0"
4
+ VERSION = "0.6.0"
5
5
  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.4.0
4
+ version: 0.6.0
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: 2023-09-18 00:00:00.000000000 Z
12
+ date: 2023-10-18 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.4.0/CHANGELOG.md
98
+ changelog_uri: https://github.com/sanifhimani/monday_ruby/blob/v0.6.0/CHANGELOG.md
95
99
  rubygems_mfa_required: 'true'
96
100
  post_install_message:
97
101
  rdoc_options: []