monday_ruby 0.3.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: b952365eaf332b933932dea993d33470bc585c9eadcf0dc7525e4550794313d2
4
- data.tar.gz: 665a9d53d8a06972f88022040a28bf8003fa13247aa0bdac60e21f7ca8be9da5
3
+ metadata.gz: 9976cfcde08608cfe4106783b717d0c3fcc4c7b9851a3f994a3c7bd33493c437
4
+ data.tar.gz: bbaa8b1e58c3c1e2a73e50a797040c5828000a79e5efac05e43471109a26a51c
5
5
  SHA512:
6
- metadata.gz: 2af82867a8586bb1bdd6f665f6e584b9e41ea76d0a74fab00f56d408d4357fee4986fde25df96403f0ba8284a4ecc99c61e97e1a4e9668e6024ca7e94574a22e
7
- data.tar.gz: 7b66ffafb1c9bfd6bb5c24de9c19438acf89ba59a0a07204ca76a38e18bd043e183077ccda3042453560f71f18c307c73bf8b6f1d161e75a42a39bcadb468229
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,32 @@
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
+
24
+ ## v0.4.0 (September 15, 2023)
25
+
26
+ ### Added
27
+
28
+ - Support for Reading, Creating and Deleting Workspaces
29
+
1
30
  ## v0.3.0 (July 10, 2023)
2
31
 
3
32
  ### Added
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,25 @@
1
+ # Contributing
2
+
3
+ Thanks for taking the time to contribute!
4
+
5
+ The following is a set of guidelines for contributing to `monday_ruby`. These are mostly guidelines, not rules. Use your best judgment, and feel to propose changes to this document in a pull request.
6
+
7
+ ## Your first code contribution
8
+
9
+ Unsure where to begin contributing? You can start by looking through `good first issue` and `help wanted` issues.
10
+
11
+ ### Pull request
12
+
13
+ Please follow these steps to have your contribution considered:
14
+
15
+ 1. Follow the [pull request template](PULL_REQUEST_TEMPLATE.md).
16
+ 2. Follow the [commit guidelines](#commit-message-guidelines).
17
+ 3. After you submit your pull request, verify that all the status checks are passing.
18
+
19
+ ## Commit message guidelines
20
+
21
+ * Use present tense ("Add feature" not "Added feature")
22
+ * Use the imperative mood ("Move file to..." not "Moves file to...")
23
+ * Limit the first line to 70 characters or less.
24
+ * Reference issues and pull requests after the first line.
25
+ * Try to follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
@@ -35,6 +35,6 @@ require "monday_ruby"
35
35
 
36
36
  Monday.configure do |config|
37
37
  config.token = <AUTH_TOKEN>
38
- config.version = "2023-10"
38
+ config.version = "2023-07"
39
39
  end
40
40
  ```
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
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Monday
4
+ module Resources
5
+ # Represents Monday.com's workspace resource.
6
+ module Workspace
7
+ DEFAULT_SELECT = %w[id name description].freeze
8
+
9
+ # Retrieves all the workspaces.
10
+ #
11
+ # Allows filtering workspaces using the args option.
12
+ # Allows customizing the values to retrieve using the select option.
13
+ # 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
+
17
+ make_request(query)
18
+ end
19
+
20
+ # Creates a new workspaces.
21
+ #
22
+ # Allows customizing creating a workspace using the args option.
23
+ # Allows customizing the values to retrieve using the select option.
24
+ # 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
+
28
+ make_request(query)
29
+ end
30
+
31
+ # Deletes a workspace.
32
+ #
33
+ # Requires workspace_id to delete the workspace.
34
+ # Allows customizing the values to retrieve using the select option.
35
+ # 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
+
39
+ make_request(query)
40
+ end
41
+ end
42
+ end
43
+ end
@@ -5,7 +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"
11
+ require_relative "resources/workspace"
12
+ require_relative "resources/update"
9
13
 
10
14
  module Monday
11
15
  module Resources
@@ -14,6 +18,10 @@ module Monday
14
18
  include Board
15
19
  include BoardView
16
20
  include Column
21
+ include Group
17
22
  include Item
23
+ include Subitem
24
+ include Workspace
25
+ include Update
18
26
  end
19
27
  end
data/lib/monday/util.rb CHANGED
@@ -45,13 +45,16 @@ 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],
52
54
  "ItemNameTooLongException" => [InvalidRequestError, 400],
53
55
  "ColumnValueException" => [InvalidRequestError, 400],
54
- "CorrectedValueException" => [InvalidRequestError, 400]
56
+ "CorrectedValueException" => [InvalidRequestError, 400],
57
+ "InvalidWorkspaceIdException" => [InvalidRequestError, 400]
55
58
  }[error_code] || [Error, 400]
56
59
  end
57
60
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Monday
4
- VERSION = "0.3.0"
4
+ VERSION = "0.6.0"
5
5
  end
data/monday_ruby.gemspec CHANGED
@@ -8,8 +8,8 @@ repository = "https://github.com/sanifhimani/monday_ruby"
8
8
  Gem::Specification.new do |spec|
9
9
  spec.name = "monday_ruby"
10
10
  spec.version = version
11
- spec.authors = ["Sanif Himani"]
12
- spec.email = ["sanifhimani92@gmail.com"]
11
+ spec.authors = ["Sanif Himani", "Wes Hays"]
12
+ spec.email = ["sanifhimani92@gmail.com", "weshays@gmail.com"]
13
13
 
14
14
  spec.summary = "Ruby bindings to use the monday.com API"
15
15
  spec.description = "A Gem to easily interact with monday.com API using native Ruby"
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monday_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sanif Himani
8
+ - Wes Hays
8
9
  autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2023-07-10 00:00:00.000000000 Z
12
+ date: 2023-10-18 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description: A Gem to easily interact with monday.com API using native Ruby
14
15
  email:
15
16
  - sanifhimani92@gmail.com
17
+ - weshays@gmail.com
16
18
  executables: []
17
19
  extensions: []
18
20
  extra_rdoc_files: []
@@ -20,9 +22,11 @@ files:
20
22
  - ".env"
21
23
  - ".rspec"
22
24
  - ".rubocop.yml"
25
+ - ".simplecov"
23
26
  - ".vscode/settings.json"
24
27
  - CHANGELOG.md
25
28
  - CODE_OF_CONDUCT.md
29
+ - CONTRIBUTING.md
26
30
  - LICENSE
27
31
  - README.md
28
32
  - Rakefile
@@ -75,7 +79,11 @@ files:
75
79
  - lib/monday/resources/board.rb
76
80
  - lib/monday/resources/board_view.rb
77
81
  - lib/monday/resources/column.rb
82
+ - lib/monday/resources/group.rb
78
83
  - lib/monday/resources/item.rb
84
+ - lib/monday/resources/subitem.rb
85
+ - lib/monday/resources/update.rb
86
+ - lib/monday/resources/workspace.rb
79
87
  - lib/monday/response.rb
80
88
  - lib/monday/util.rb
81
89
  - lib/monday/version.rb
@@ -87,7 +95,7 @@ licenses:
87
95
  metadata:
88
96
  homepage_uri: https://github.com/sanifhimani/monday_ruby
89
97
  documentation_uri: https://monday-ruby.gitbook.io/docs/
90
- changelog_uri: https://github.com/sanifhimani/monday_ruby/blob/v0.3.0/CHANGELOG.md
98
+ changelog_uri: https://github.com/sanifhimani/monday_ruby/blob/v0.6.0/CHANGELOG.md
91
99
  rubygems_mfa_required: 'true'
92
100
  post_install_message:
93
101
  rdoc_options: []
@@ -104,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
112
  - !ruby/object:Gem::Version
105
113
  version: '0'
106
114
  requirements: []
107
- rubygems_version: 3.4.14
115
+ rubygems_version: 3.4.19
108
116
  signing_key:
109
117
  specification_version: 4
110
118
  summary: Ruby bindings to use the monday.com API