monday_ruby 0.1.0 → 0.2.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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/.env +1 -0
  3. data/.rubocop.yml +1 -1
  4. data/CHANGELOG.md +11 -0
  5. data/README.md +24 -2
  6. data/docs/README.md +12 -0
  7. data/docs/SUMMARY.md +39 -0
  8. data/docs/client.md +15 -0
  9. data/docs/configuration.md +28 -0
  10. data/docs/getting-started.md +25 -0
  11. data/docs/quick-start.md +269 -0
  12. data/docs/resources/README.md +27 -0
  13. data/docs/resources/account/README.md +9 -0
  14. data/docs/resources/account/accounts.md +82 -0
  15. data/docs/resources/activity-log/README.md +9 -0
  16. data/docs/resources/activity-log/activity_logs.md +95 -0
  17. data/docs/resources/board/README.md +21 -0
  18. data/docs/resources/board/archive_board.md +79 -0
  19. data/docs/resources/board/boards.md +96 -0
  20. data/docs/resources/board/create_board.md +95 -0
  21. data/docs/resources/board/delete_board.md +79 -0
  22. data/docs/resources/board/delete_board_subscribers.md +87 -0
  23. data/docs/resources/board/duplicate_board.md +94 -0
  24. data/docs/resources/board/update_board.md +91 -0
  25. data/docs/resources/board-view/README.md +9 -0
  26. data/docs/resources/board-view/board_views.md +88 -0
  27. data/docs/resources/column/README.md +25 -0
  28. data/docs/resources/column/change_column_metadata.md +70 -0
  29. data/docs/resources/column/change_column_title.md +68 -0
  30. data/docs/resources/column/change_column_value.md +73 -0
  31. data/docs/resources/column/change_multiple_column_value.md +81 -0
  32. data/docs/resources/column/change_simple_column_value.md +69 -0
  33. data/docs/resources/column/column_values.md +115 -0
  34. data/docs/resources/column/columns.md +117 -0
  35. data/docs/resources/column/create_column.md +70 -0
  36. data/docs/resources/column/delete_column.md +58 -0
  37. data/docs/resources/item/README.md +17 -0
  38. data/docs/resources/item/archive_item.md +80 -0
  39. data/docs/resources/item/create_item.md +105 -0
  40. data/docs/resources/item/delete_item.md +80 -0
  41. data/docs/resources/item/duplicate_item.md +87 -0
  42. data/docs/resources/item/items.md +95 -0
  43. data/docs/response.md +21 -0
  44. data/lib/monday/client.rb +9 -8
  45. data/lib/monday/configuration.rb +7 -1
  46. data/lib/monday/version.rb +1 -1
  47. data/lib/monday_ruby.rb +13 -0
  48. data/monday_ruby.gemspec +2 -2
  49. metadata +43 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd002aba608dc2f94d8203eee88629ff3185e305e09096ac6206e650b2b6f54f
4
- data.tar.gz: b2abc595ac065fad70b823917f063cd8ffd1088c736b38ba18c5417272d6a8ae
3
+ metadata.gz: e17b85396d9acd3d8dc9346a1c1b54f09280d8815941deee3ed952de6cf55ad1
4
+ data.tar.gz: 2bc9f14384736558a423f8690175a49dcf716746a2db1f5a5ef51cd7fefb0532
5
5
  SHA512:
6
- metadata.gz: ab592952c05ad6fcf5c7cc2ae78039939daa46f0f7bac2cc8460e66566d6da05a123c0a9bc23cbae993cd1df6122be275528d12bf87c114bc46bb88fc094e554
7
- data.tar.gz: 198556d5abce107ec8109f4b32eee408b618ccea654dbe45f3b0016b71f1be0a9440114aba607a6fdb49009c14f8b49607fd161dbeb246e70dea0f5237a34744
6
+ metadata.gz: d594d0addabe0adbb550ecf474e12c4d7645e10bdf37a9fe10c7b930ab63d954204c1658f30dd6258303c2b7c1e8fb6ace0476beb23fbf91fc864f9dfb4f6fe4
7
+ data.tar.gz: e42cdc2c6bcf6de3d5652e5bfa9c3d86f377155f0c2e06e76c2857b691341eca3e115e6abc8811fa02976afcda4997f8f3feffbc3f16b058bf4f3b9849c69835
data/.env ADDED
@@ -0,0 +1 @@
1
+ token="[REPLACE_TOKEN]"
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.6
2
+ TargetRubyVersion: 2.7
3
3
  NewCops: enable
4
4
 
5
5
  Style/StringLiterals:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## v0.2.0 (July 04, 2023)
2
+
3
+ ### Added
4
+
5
+ - Support for global config
6
+ - VCR for test suite
7
+
8
+ ### Removed
9
+
10
+ - [BREAKING] Support for Ruby 2.6
11
+
1
12
  ## v0.1.0 (June 28, 2023)
2
13
 
3
14
  - Initial release
data/README.md CHANGED
@@ -1,8 +1,14 @@
1
1
  # Monday API Library for Ruby
2
2
 
3
3
  ![Build Status](https://github.com/sanifhimani/monday_ruby/actions/workflows/ci.yml/badge.svg)
4
+ [![Gem Version](https://badge.fury.io/rb/monday_ruby.svg)](https://badge.fury.io/rb/monday_ruby)
4
5
 
5
- This library provides convenient access to the Monday.com API from the application written in the Ruby language. It includes a pre-defined set of actions for the API resources.
6
+ This library provides convenient access to the monday.com API from the application written in the Ruby language.
7
+
8
+ The library provides:
9
+
10
+ 1. A pre-defined set of methods to easily interact with the API resources.
11
+ 2. Easy configuration path for fast setup and use.
6
12
 
7
13
  **Visit https://monday-ruby.gitbook.io/docs/ for detailed documentation on how to use the library.**
8
14
 
@@ -22,7 +28,7 @@ gem build monday_ruby.gemspec
22
28
 
23
29
  ### Requirements
24
30
 
25
- * Ruby 2.6+
31
+ * Ruby 2.7+
26
32
 
27
33
  ### Bundler
28
34
 
@@ -40,6 +46,22 @@ gem "monday_ruby"
40
46
 
41
47
  The library needs to be configured with your account's authentication token which is available on the Admin tab on monday.com. Elaborate documentation can be found [here](https://developer.monday.com/api-reference/docs/authentication).
42
48
 
49
+ ### Configuration
50
+
51
+ Once you have the authentication token, you can either globally configure the library or you can configure a specific client.
52
+
53
+ #### Global config
54
+
55
+ ```ruby
56
+ require "monday_ruby"
57
+
58
+ Monday.configure do |config|
59
+ config.token = "<AUTH_TOKEN>"
60
+ end
61
+
62
+ ```
63
+
64
+ #### Client specific config
43
65
  ```ruby
44
66
  require "monday_ruby"
45
67
 
data/docs/README.md ADDED
@@ -0,0 +1,12 @@
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
+
10
+ #### Requirements
11
+
12
+ * Ruby 2.7+
data/docs/SUMMARY.md ADDED
@@ -0,0 +1,39 @@
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
+ * [Resources](resources/README.md)
10
+ * [Account](resources/account/README.md)
11
+ * [#accounts](resources/account/accounts.md)
12
+ * [Activity Log](resources/activity-log/README.md)
13
+ * [#activity\_logs](resources/activity-log/activity\_logs.md)
14
+ * [Board View](resources/board-view/README.md)
15
+ * [#board\_views](resources/board-view/board\_views.md)
16
+ * [Board](resources/board/README.md)
17
+ * [#boards](resources/board/boards.md)
18
+ * [#create\_board](resources/board/create\_board.md)
19
+ * [#duplicate\_board](resources/board/duplicate\_board.md)
20
+ * [#update\_board](resources/board/update\_board.md)
21
+ * [#archive\_board](resources/board/archive\_board.md)
22
+ * [#delete\_board](resources/board/delete\_board.md)
23
+ * [#delete\_board\_subscribers](resources/board/delete\_board\_subscribers.md)
24
+ * [Column](resources/column/README.md)
25
+ * [#columns](resources/column/columns.md)
26
+ * [#column\_values](resources/column/column\_values.md)
27
+ * [#create\_column](resources/column/create\_column.md)
28
+ * [#change\_column\_title](resources/column/change\_column\_title.md)
29
+ * [#change\_column\_metadata](resources/column/change\_column\_metadata.md)
30
+ * [#change\_column\_value](resources/column/change\_column\_value.md)
31
+ * [#change\_simple\_column\_value](resources/column/change\_simple\_column\_value.md)
32
+ * [#change\_multiple\_column\_value](resources/column/change\_multiple\_column\_value.md)
33
+ * [#delete\_column](resources/column/delete\_column.md)
34
+ * [Item](resources/item/README.md)
35
+ * [#items](resources/item/items.md)
36
+ * [#create\_item](resources/item/create\_item.md)
37
+ * [#duplicate\_item](resources/item/duplicate\_item.md)
38
+ * [#archive\_item](resources/item/archive\_item.md)
39
+ * [#delete\_item](resources/item/delete\_item.md)
data/docs/client.md ADDED
@@ -0,0 +1,15 @@
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.
@@ -0,0 +1,28 @@
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
+
@@ -0,0 +1,25 @@
1
+ # Getting Started
2
+
3
+ ### Installation
4
+
5
+ You don't need the source code unless you want to modify the gem. If you want to use the package, run the following:
6
+
7
+ ```sh
8
+ gem install monday_ruby
9
+ ```
10
+
11
+ If you want to build the gem from the source:
12
+
13
+ ```sh
14
+ gem build monday_ruby.gemspec
15
+ ```
16
+
17
+ ### Bundler
18
+
19
+ If you are installing via bundler, you should be sure to use the HTTPS rubygems source in your Gemfile, as any gems fetched over HTTP could potentially be compromised in transit and alter the code of gems fetched securely over HTTPS:
20
+
21
+ ```ruby
22
+ source "https://rubygems.org"
23
+
24
+ gem "monday_ruby"
25
+ ```
@@ -0,0 +1,269 @@
1
+ # Quick Start
2
+
3
+ The following is the minimum needed to fetch all the boards with their IDs and column IDs:
4
+
5
+ {% code lineNumbers="true" %}
6
+ ```ruby
7
+ require "monday_ruby"
8
+
9
+ client = Monday::Client.new(token: <AUTH_TOKEN>)
10
+
11
+ select = [
12
+ "id",
13
+ {
14
+ columns: "id"
15
+ }
16
+ ]
17
+
18
+ response = client.boards(select: select)
19
+ # => <Monday::Response ...>
20
+
21
+ puts response.body
22
+ ```
23
+ {% endcode %}
24
+
25
+ The response body from the above query would be as follows:
26
+
27
+ {% code lineNumbers="true" %}
28
+ ```json
29
+ {
30
+ "data": {
31
+ "boards": [
32
+ {
33
+ "id": "123",
34
+ "columns": [
35
+ {
36
+ "id": "name"
37
+ },
38
+ {
39
+ "id": "subitems"
40
+ },
41
+ {
42
+ "id": "work_status"
43
+ },
44
+ {
45
+ "id": "keywords"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "id": "456",
51
+ "columns": [
52
+ {
53
+ "id": "name"
54
+ },
55
+ {
56
+ "id": "person"
57
+ },
58
+ {
59
+ "id": "status"
60
+ },
61
+ {
62
+ "id": "date0"
63
+ }
64
+ ]
65
+ },
66
+ ]
67
+ },
68
+ "account_id": 123
69
+ }
70
+ ```
71
+ {% endcode %}
72
+
73
+ ### Advanced select query
74
+
75
+ The following is the minimum needed to fetch:
76
+
77
+ 1. All the boards' IDs, names and count of items on each board.
78
+ 2. The ID, title and type for the columns on each board.
79
+ 3. The ID, name and the value of the items on each board.
80
+
81
+ {% code lineNumbers="true" %}
82
+ ```ruby
83
+ require "monday_ruby"
84
+
85
+ client = Monday::Client.new(token: <AUTH_TOKEN>)
86
+
87
+ select = [
88
+ "id",
89
+ "name",
90
+ "items_count",
91
+ {
92
+ columns: %w[id title type],
93
+ items: [
94
+ "id",
95
+ "name",
96
+ {
97
+ column_values: "value"
98
+ }
99
+ ]
100
+ }
101
+ ]
102
+
103
+ response = client.boards(select: select)
104
+ # => <Monday::Response ...>
105
+
106
+ puts response.body
107
+ ```
108
+ {% endcode %}
109
+
110
+ The response body from the above query would be as follows:
111
+
112
+ {% code lineNumbers="true" %}
113
+ ```json
114
+ {
115
+ "data": {
116
+ "boards": [
117
+ {
118
+ "id": "123",
119
+ "name": "New test board",
120
+ "items_count": 2,
121
+ "columns": [
122
+ {
123
+ "id": "name",
124
+ "title": "Name",
125
+ "type": "name"
126
+ },
127
+ {
128
+ "id": "subitems",
129
+ "title": "Subitems",
130
+ "type": "subtasks"
131
+ },
132
+ {
133
+ "id": "work_status",
134
+ "title": "Status",
135
+ "type": "color"
136
+ },
137
+ {
138
+ "id": "keywords",
139
+ "title": "Keywords",
140
+ "type": "dropdown"
141
+ }
142
+ ],
143
+ "items": [
144
+ {
145
+ "id": "4708726090",
146
+ "name": "Task 1",
147
+ "column_values": [
148
+ {
149
+ "value": null
150
+ },
151
+ {
152
+ "value": "{\"index\":0,\"changed_at\":\"2023-06-27T16:21:22.192Z\"}"
153
+ },
154
+ {
155
+ "value": "{\"ids\":[1]}"
156
+ }
157
+ ]
158
+ },
159
+ {
160
+ "id": "4713421325",
161
+ "name": "New item",
162
+ "column_values": [
163
+ {
164
+ "value": null
165
+ },
166
+ {
167
+ "value": null
168
+ },
169
+ {
170
+ "value": null
171
+ }
172
+ ]
173
+ }
174
+ ]
175
+ },
176
+ {
177
+ "id": "456",
178
+ "name": "Your first board",
179
+ "items_count": 3,
180
+ "columns": [
181
+ {
182
+ "id": "name",
183
+ "title": "Name",
184
+ "type": "name"
185
+ },
186
+ {
187
+ "id": "subitems",
188
+ "title": "Subitems",
189
+ "type": "subtasks"
190
+ },
191
+ {
192
+ "id": "person",
193
+ "title": "Person",
194
+ "type": "multiple-person"
195
+ },
196
+ {
197
+ "id": "status",
198
+ "title": "Status",
199
+ "type": "color"
200
+ },
201
+ {
202
+ "id": "date4",
203
+ "title": "Date",
204
+ "type": "date"
205
+ }
206
+ ],
207
+ "items": [
208
+ {
209
+ "id": "4691485763",
210
+ "name": "Item 1",
211
+ "column_values": [
212
+ {
213
+ "value": null
214
+ },
215
+ {
216
+ "value": "{\"changed_at\":\"2022-10-26T12:39:58.664Z\",\"personsAndTeams\":[{\"id\":44865791,\"kind\":\"person\"}]}"
217
+ },
218
+ {
219
+ "value": "{\"index\":0,\"post_id\":null,\"changed_at\":\"2019-03-01T17:24:57.321Z\"}"
220
+ },
221
+ {
222
+ "value": "{\"date\":\"2023-06-21\",\"icon\":null,\"changed_at\":\"2022-12-18T14:03:06.455Z\"}"
223
+ }
224
+ ]
225
+ },
226
+ {
227
+ "id": "4691485774",
228
+ "name": "Item 2",
229
+ "column_values": [
230
+ {
231
+ "value": null
232
+ },
233
+ {
234
+ "value": null
235
+ },
236
+ {
237
+ "value": "{\"index\":1,\"post_id\":null,\"changed_at\":\"2019-03-01T17:28:23.178Z\"}"
238
+ },
239
+ {
240
+ "value": "{\"date\":\"2023-06-23\",\"icon\":null,\"changed_at\":\"2022-12-25T12:31:18.096Z\"}"
241
+ }
242
+ ]
243
+ },
244
+ {
245
+ "id": "4691485784",
246
+ "name": "Item 3",
247
+ "column_values": [
248
+ {
249
+ "value": null
250
+ },
251
+ {
252
+ "value": null
253
+ },
254
+ {
255
+ "value": "{\"index\":2,\"post_id\":null,\"changed_at\":\"2022-12-11T14:33:50.083Z\"}"
256
+ },
257
+ {
258
+ "value": "{\"date\":\"2023-06-25\",\"changed_at\":\"2022-12-25T12:31:20.220Z\"}"
259
+ }
260
+ ]
261
+ }
262
+ ]
263
+ }
264
+ ]
265
+ },
266
+ "account_id": 123
267
+ }
268
+ ```
269
+ {% endcode %}
@@ -0,0 +1,27 @@
1
+ # Resources
2
+
3
+ Once you have the client set up, you can call the API resources using the client.
4
+
5
+ {% content-ref url="account/" %}
6
+ [account](account/)
7
+ {% endcontent-ref %}
8
+
9
+ {% content-ref url="activity-log/" %}
10
+ [activity-log](activity-log/)
11
+ {% endcontent-ref %}
12
+
13
+ {% content-ref url="board-view/" %}
14
+ [board-view](board-view/)
15
+ {% endcontent-ref %}
16
+
17
+ {% content-ref url="board/" %}
18
+ [board](board/)
19
+ {% endcontent-ref %}
20
+
21
+ {% content-ref url="column/" %}
22
+ [column](column/)
23
+ {% endcontent-ref %}
24
+
25
+ {% content-ref url="item/" %}
26
+ [item](item/)
27
+ {% endcontent-ref %}
@@ -0,0 +1,9 @@
1
+ # Account
2
+
3
+ The account API is used to access the account data. It includes the following methods:
4
+
5
+ [accounts.md](accounts.md "mention")
6
+
7
+ {% hint style="info" %}
8
+ Visit monday.com's API documentation to know more about the [account API](https://developer.monday.com/api-reference/docs/account).
9
+ {% endhint %}
@@ -0,0 +1,82 @@
1
+ # #accounts
2
+
3
+ Querying the `account` API will return the metadata for the account.
4
+
5
+ {% hint style="info" %}
6
+ This account is the one that is associated with the authentication token.
7
+ {% endhint %}
8
+
9
+ ### Basic usage
10
+
11
+ {% code lineNumbers="true" %}
12
+ ```ruby
13
+ client = Monday::Client.new(token: <AUTH_TOKEN>)
14
+
15
+ response = client.account
16
+ # => <Monday::Response ...>
17
+
18
+ puts response.body
19
+ ```
20
+ {% endcode %}
21
+
22
+ This will return the accounts' ID and name fields by default.
23
+
24
+ The response body from the above query would be as follows:
25
+
26
+ {% code lineNumbers="true" %}
27
+ ```json
28
+ {
29
+ "data": {
30
+ "users": [
31
+ {
32
+ "account": {
33
+ "id": 1234,
34
+ "name": "Test User's Team"
35
+ }
36
+ }
37
+ ]
38
+ },
39
+ "account_id": 123
40
+ }
41
+ ```
42
+ {% endcode %}
43
+
44
+ ### Customizing fields to retrieve
45
+
46
+ You can customize the fields to retrieve by passing in the `select` option and listing all the fields you need to retrieve as an array.
47
+
48
+ {% code lineNumbers="true" %}
49
+ ```ruby
50
+ client = Monday::Client.new(token: <AUTH_TOKEN>)
51
+
52
+ select = %w[id name slug logo country_code]
53
+
54
+ response = client.account(select: select)
55
+
56
+ puts response.body
57
+ ```
58
+ {% endcode %}
59
+
60
+ ### Retrieving nested fields
61
+
62
+ Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error. For example, the field `plan` is of type `Plan` and expects you to pass the attributes you want to retrieve for the `plan` field.
63
+
64
+ {% code lineNumbers="true" %}
65
+ ```ruby
66
+ client = Monday::Client.new(token: <AUTH_TOKEN>)
67
+
68
+ select = [
69
+ "id",
70
+ "name",
71
+ {
72
+ creator: %w[id name email is_admin]
73
+ }
74
+ ]
75
+
76
+ response = client.boards(select: select)
77
+
78
+ puts response.body
79
+ ```
80
+ {% endcode %}
81
+
82
+ You can find the list of all the available fields for account [here](https://developer.monday.com/api-reference/docs/account#fields).
@@ -0,0 +1,9 @@
1
+ # Activity Log
2
+
3
+ The activity log API is used to access the activity on your boards. It includes the following methods:
4
+
5
+ [activity\_logs.md](activity\_logs.md "mention")
6
+
7
+ {% hint style="info" %}
8
+ Visit monday.com's API documentation to know more about the [activity logs API](https://developer.monday.com/api-reference/docs/activity-logs).
9
+ {% endhint %}