monday_ruby 1.2.0 → 1.2.1

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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/lib/monday/version.rb +1 -1
  4. metadata +3 -79
  5. data/.env +0 -1
  6. data/.rspec +0 -2
  7. data/.rubocop.yml +0 -41
  8. data/.simplecov +0 -4
  9. data/.vscode/settings.json +0 -4
  10. data/CODE_OF_CONDUCT.md +0 -84
  11. data/CONTRIBUTING.md +0 -190
  12. data/Rakefile +0 -11
  13. data/docs/.vitepress/config.mjs +0 -255
  14. data/docs/.vitepress/theme/index.js +0 -4
  15. data/docs/.vitepress/theme/style.css +0 -43
  16. data/docs/README.md +0 -80
  17. data/docs/explanation/architecture.md +0 -507
  18. data/docs/explanation/best-practices/errors.md +0 -478
  19. data/docs/explanation/best-practices/performance.md +0 -1084
  20. data/docs/explanation/best-practices/rate-limiting.md +0 -630
  21. data/docs/explanation/best-practices/testing.md +0 -820
  22. data/docs/explanation/column-values.md +0 -857
  23. data/docs/explanation/design.md +0 -795
  24. data/docs/explanation/graphql.md +0 -356
  25. data/docs/explanation/migration/v1.md +0 -808
  26. data/docs/explanation/pagination.md +0 -447
  27. data/docs/guides/advanced/batch.md +0 -1274
  28. data/docs/guides/advanced/complex-queries.md +0 -1114
  29. data/docs/guides/advanced/errors.md +0 -818
  30. data/docs/guides/advanced/pagination.md +0 -934
  31. data/docs/guides/advanced/rate-limiting.md +0 -981
  32. data/docs/guides/authentication.md +0 -286
  33. data/docs/guides/boards/create.md +0 -386
  34. data/docs/guides/boards/delete.md +0 -405
  35. data/docs/guides/boards/duplicate.md +0 -511
  36. data/docs/guides/boards/query.md +0 -530
  37. data/docs/guides/boards/update.md +0 -453
  38. data/docs/guides/columns/create.md +0 -452
  39. data/docs/guides/columns/metadata.md +0 -492
  40. data/docs/guides/columns/query.md +0 -455
  41. data/docs/guides/columns/update-multiple.md +0 -459
  42. data/docs/guides/columns/update-values.md +0 -509
  43. data/docs/guides/files/add-to-column.md +0 -40
  44. data/docs/guides/files/add-to-update.md +0 -37
  45. data/docs/guides/files/clear-column.md +0 -33
  46. data/docs/guides/first-request.md +0 -285
  47. data/docs/guides/folders/manage.md +0 -750
  48. data/docs/guides/groups/items.md +0 -626
  49. data/docs/guides/groups/manage.md +0 -501
  50. data/docs/guides/installation.md +0 -169
  51. data/docs/guides/items/create.md +0 -493
  52. data/docs/guides/items/delete.md +0 -514
  53. data/docs/guides/items/query.md +0 -605
  54. data/docs/guides/items/subitems.md +0 -483
  55. data/docs/guides/items/update.md +0 -699
  56. data/docs/guides/updates/manage.md +0 -619
  57. data/docs/guides/use-cases/dashboard.md +0 -1421
  58. data/docs/guides/use-cases/import.md +0 -1962
  59. data/docs/guides/use-cases/task-management.md +0 -1381
  60. data/docs/guides/workspaces/manage.md +0 -502
  61. data/docs/index.md +0 -69
  62. data/docs/package-lock.json +0 -2468
  63. data/docs/package.json +0 -13
  64. data/docs/reference/client.md +0 -540
  65. data/docs/reference/configuration.md +0 -586
  66. data/docs/reference/errors.md +0 -693
  67. data/docs/reference/resources/account.md +0 -208
  68. data/docs/reference/resources/activity-log.md +0 -369
  69. data/docs/reference/resources/board-view.md +0 -359
  70. data/docs/reference/resources/board.md +0 -393
  71. data/docs/reference/resources/column.md +0 -543
  72. data/docs/reference/resources/file.md +0 -236
  73. data/docs/reference/resources/folder.md +0 -386
  74. data/docs/reference/resources/group.md +0 -507
  75. data/docs/reference/resources/item.md +0 -348
  76. data/docs/reference/resources/subitem.md +0 -267
  77. data/docs/reference/resources/update.md +0 -259
  78. data/docs/reference/resources/workspace.md +0 -213
  79. data/docs/reference/response.md +0 -560
  80. data/docs/tutorial/first-integration.md +0 -713
@@ -1,285 +0,0 @@
1
- # Make Your First Request
2
-
3
- Query boards from your monday.com account using the Ruby client.
4
-
5
- ## Prerequisites
6
-
7
- - [Installed and configured](/guides/installation) monday_ruby
8
- - [Set up authentication](/guides/authentication) with your API token
9
-
10
- ## Basic Query
11
-
12
- The simplest request fetches all boards you have access to:
13
-
14
- ```ruby
15
- require "monday_ruby"
16
-
17
- Monday.configure do |config|
18
- config.token = ENV["MONDAY_TOKEN"]
19
- end
20
-
21
- client = Monday::Client.new
22
- response = client.board.query
23
- ```
24
-
25
- This returns all boards with their ID, name, and description.
26
-
27
- ## Check Response Status
28
-
29
- Always verify the request succeeded:
30
-
31
- ```ruby
32
- client = Monday::Client.new
33
- response = client.board.query
34
-
35
- if response.success?
36
- puts "Request succeeded!"
37
- puts "Status code: #{response.status}"
38
- else
39
- puts "Request failed: #{response.status}"
40
- end
41
- ```
42
-
43
- The `success?` method returns `true` for 2xx status codes and when there are no API errors.
44
-
45
- ## Access Response Data
46
-
47
- Extract data from the response body:
48
-
49
- ```ruby
50
- response = client.board.query
51
-
52
- if response.success?
53
- boards = response.body["data"]["boards"]
54
-
55
- puts "Found #{boards.length} boards:\n"
56
-
57
- boards.each do |board|
58
- puts " • #{board['name']} (ID: #{board['id']})"
59
- end
60
- end
61
- ```
62
-
63
- **Example output:**
64
- ```
65
- Found 3 boards:
66
- • Marketing Campaigns (ID: 1234567890)
67
- • Product Roadmap (ID: 2345678901)
68
- • Team Tasks (ID: 3456789012)
69
- ```
70
-
71
- ## Using dig for Safe Access
72
-
73
- Use `dig` to safely navigate nested hashes:
74
-
75
- ```ruby
76
- response = client.board.query
77
-
78
- boards = response.body.dig("data", "boards")
79
-
80
- if boards
81
- first_board = boards.first
82
- board_name = first_board.dig("name")
83
-
84
- puts "First board: #{board_name}"
85
- else
86
- puts "No boards found"
87
- end
88
- ```
89
-
90
- This prevents `NoMethodError` if keys don't exist.
91
-
92
- ## Filter Results
93
-
94
- Query specific boards by ID:
95
-
96
- ```ruby
97
- response = client.board.query(
98
- args: { ids: [1234567890, 2345678901] }
99
- )
100
-
101
- if response.success?
102
- boards = response.body.dig("data", "boards")
103
- puts "Retrieved #{boards.length} specific boards"
104
- end
105
- ```
106
-
107
- ## Customize Fields
108
-
109
- Select only the fields you need:
110
-
111
- ```ruby
112
- response = client.board.query(
113
- select: ["id", "name"] # Skip description
114
- )
115
-
116
- if response.success?
117
- boards = response.body.dig("data", "boards")
118
-
119
- boards.each do |board|
120
- # Only id and name are present
121
- puts "#{board['id']}: #{board['name']}"
122
- end
123
- end
124
- ```
125
-
126
- ::: tip <span style="display: inline-flex; align-items: center; gap: 6px;"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>Performance Tip</span>
127
- Only request fields you need. Smaller responses are faster and use less bandwidth.
128
- :::
129
-
130
- ## Query Nested Data
131
-
132
- Fetch boards with their items:
133
-
134
- ```ruby
135
- response = client.board.query(
136
- args: { ids: [1234567890] },
137
- select: [
138
- "id",
139
- "name",
140
- {
141
- items: ["id", "name"]
142
- }
143
- ]
144
- )
145
-
146
- if response.success?
147
- board = response.body.dig("data", "boards", 0)
148
-
149
- puts "Board: #{board['name']}"
150
- puts "Items:"
151
-
152
- board["items"].each do |item|
153
- puts " • #{item['name']}"
154
- end
155
- end
156
- ```
157
-
158
- **Example output:**
159
- ```
160
- Board: Marketing Campaigns
161
- Items:
162
- • Q1 Campaign Plan
163
- • Social Media Strategy
164
- • Email Newsletter Design
165
- ```
166
-
167
- ## Response Structure
168
-
169
- All responses follow this structure:
170
-
171
- ```ruby
172
- {
173
- "data" => {
174
- "boards" => [
175
- {
176
- "id" => "1234567890",
177
- "name" => "Board Name",
178
- "description" => "Board description"
179
- }
180
- ]
181
- }
182
- }
183
- ```
184
-
185
- The root `data` key contains the query results. Resource arrays (like `boards`) are always arrays, even for single items.
186
-
187
- ## Handle Errors
188
-
189
- Check for specific error conditions:
190
-
191
- ```ruby
192
- response = client.board.query
193
-
194
- if response.success?
195
- boards = response.body.dig("data", "boards")
196
- puts "Success! Found #{boards.length} boards"
197
- else
198
- puts "Request failed with status: #{response.status}"
199
-
200
- # Check for API errors
201
- if response.body["errors"]
202
- puts "API Errors:"
203
- response.body["errors"].each do |error|
204
- puts " • #{error['message']}"
205
- end
206
- end
207
- end
208
- ```
209
-
210
- ## Common Response Codes
211
-
212
- | Code | Meaning | Action |
213
- |------|---------|--------|
214
- | 200 | Success | Process the data |
215
- | 401 | Unauthorized | Check your API token |
216
- | 429 | Rate limited | Wait and retry |
217
- | 500 | Server error | Retry with backoff |
218
-
219
- ::: warning <span style="display: inline-flex; align-items: center; gap: 6px;"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>200 Doesn't Always Mean Success</span>
220
- monday.com returns status 200 even for some errors. Always check `response.success?` which also validates the response body for error fields.
221
- :::
222
-
223
- ## Complete Example
224
-
225
- Put it all together:
226
-
227
- ```ruby
228
- require "monday_ruby"
229
- require "dotenv/load"
230
-
231
- Monday.configure do |config|
232
- config.token = ENV["MONDAY_TOKEN"]
233
- end
234
-
235
- client = Monday::Client.new
236
-
237
- # Query boards with items
238
- response = client.board.query(
239
- args: { limit: 5 },
240
- select: [
241
- "id",
242
- "name",
243
- "description",
244
- {
245
- items: ["id", "name"]
246
- }
247
- ]
248
- )
249
-
250
- if response.success?
251
- boards = response.body.dig("data", "boards")
252
-
253
- puts "\n📋 Your Boards\n#{'=' * 50}\n"
254
-
255
- boards.each do |board|
256
- puts "\n#{board['name']}"
257
- puts " ID: #{board['id']}"
258
- puts " Items: #{board['items']&.length || 0}"
259
-
260
- if board['description'] && !board['description'].empty?
261
- puts " Description: #{board['description']}"
262
- end
263
- end
264
-
265
- puts "\n#{'=' * 50}"
266
- puts "Total: #{boards.length} boards"
267
- else
268
- puts "❌ Request failed"
269
- puts "Status: #{response.status}"
270
-
271
- if response.body["errors"]
272
- puts "\nErrors:"
273
- response.body["errors"].each do |error|
274
- puts " • #{error['message']}"
275
- end
276
- end
277
- end
278
- ```
279
-
280
- ## Next Steps
281
-
282
- - [Create a board](/guides/boards/create)
283
- - [Query boards with advanced filters](/guides/boards/query)
284
- - [Work with items](/guides/items/create)
285
- - [Handle errors properly](/guides/advanced/errors)