monday_ruby 1.1.0 → 1.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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/.env +1 -1
  3. data/.rubocop.yml +2 -1
  4. data/CHANGELOG.md +14 -0
  5. data/CONTRIBUTING.md +104 -0
  6. data/README.md +146 -142
  7. data/docs/.vitepress/config.mjs +255 -0
  8. data/docs/.vitepress/theme/index.js +4 -0
  9. data/docs/.vitepress/theme/style.css +43 -0
  10. data/docs/README.md +80 -0
  11. data/docs/explanation/architecture.md +507 -0
  12. data/docs/explanation/best-practices/errors.md +478 -0
  13. data/docs/explanation/best-practices/performance.md +1084 -0
  14. data/docs/explanation/best-practices/rate-limiting.md +630 -0
  15. data/docs/explanation/best-practices/testing.md +820 -0
  16. data/docs/explanation/column-values.md +857 -0
  17. data/docs/explanation/design.md +795 -0
  18. data/docs/explanation/graphql.md +356 -0
  19. data/docs/explanation/migration/v1.md +808 -0
  20. data/docs/explanation/pagination.md +447 -0
  21. data/docs/guides/advanced/batch.md +1274 -0
  22. data/docs/guides/advanced/complex-queries.md +1114 -0
  23. data/docs/guides/advanced/errors.md +818 -0
  24. data/docs/guides/advanced/pagination.md +934 -0
  25. data/docs/guides/advanced/rate-limiting.md +981 -0
  26. data/docs/guides/authentication.md +286 -0
  27. data/docs/guides/boards/create.md +386 -0
  28. data/docs/guides/boards/delete.md +405 -0
  29. data/docs/guides/boards/duplicate.md +511 -0
  30. data/docs/guides/boards/query.md +530 -0
  31. data/docs/guides/boards/update.md +453 -0
  32. data/docs/guides/columns/create.md +452 -0
  33. data/docs/guides/columns/metadata.md +492 -0
  34. data/docs/guides/columns/query.md +455 -0
  35. data/docs/guides/columns/update-multiple.md +459 -0
  36. data/docs/guides/columns/update-values.md +509 -0
  37. data/docs/guides/files/add-to-column.md +40 -0
  38. data/docs/guides/files/add-to-update.md +37 -0
  39. data/docs/guides/files/clear-column.md +33 -0
  40. data/docs/guides/first-request.md +285 -0
  41. data/docs/guides/folders/manage.md +750 -0
  42. data/docs/guides/groups/items.md +626 -0
  43. data/docs/guides/groups/manage.md +501 -0
  44. data/docs/guides/installation.md +169 -0
  45. data/docs/guides/items/create.md +493 -0
  46. data/docs/guides/items/delete.md +514 -0
  47. data/docs/guides/items/query.md +605 -0
  48. data/docs/guides/items/subitems.md +483 -0
  49. data/docs/guides/items/update.md +699 -0
  50. data/docs/guides/updates/manage.md +619 -0
  51. data/docs/guides/use-cases/dashboard.md +1421 -0
  52. data/docs/guides/use-cases/import.md +1962 -0
  53. data/docs/guides/use-cases/task-management.md +1381 -0
  54. data/docs/guides/workspaces/manage.md +502 -0
  55. data/docs/index.md +69 -0
  56. data/docs/package-lock.json +2468 -0
  57. data/docs/package.json +13 -0
  58. data/docs/reference/client.md +540 -0
  59. data/docs/reference/configuration.md +586 -0
  60. data/docs/reference/errors.md +693 -0
  61. data/docs/reference/resources/account.md +208 -0
  62. data/docs/reference/resources/activity-log.md +369 -0
  63. data/docs/reference/resources/board-view.md +359 -0
  64. data/docs/reference/resources/board.md +393 -0
  65. data/docs/reference/resources/column.md +543 -0
  66. data/docs/reference/resources/file.md +236 -0
  67. data/docs/reference/resources/folder.md +386 -0
  68. data/docs/reference/resources/group.md +507 -0
  69. data/docs/reference/resources/item.md +348 -0
  70. data/docs/reference/resources/subitem.md +267 -0
  71. data/docs/reference/resources/update.md +259 -0
  72. data/docs/reference/resources/workspace.md +213 -0
  73. data/docs/reference/response.md +560 -0
  74. data/docs/tutorial/first-integration.md +713 -0
  75. data/lib/monday/client.rb +24 -0
  76. data/lib/monday/configuration.rb +5 -0
  77. data/lib/monday/request.rb +15 -0
  78. data/lib/monday/resources/base.rb +4 -0
  79. data/lib/monday/resources/file.rb +56 -0
  80. data/lib/monday/util.rb +1 -0
  81. data/lib/monday/version.rb +1 -1
  82. metadata +87 -4
@@ -0,0 +1,530 @@
1
+ # Query Boards
2
+
3
+ Retrieve and filter boards from your monday.com account.
4
+
5
+ ## Basic Query
6
+
7
+ Get all boards with default fields (ID, name, description):
8
+
9
+ ```ruby
10
+ require "monday_ruby"
11
+
12
+ Monday.configure do |config|
13
+ config.token = ENV["MONDAY_TOKEN"]
14
+ end
15
+
16
+ client = Monday::Client.new
17
+
18
+ response = client.board.query
19
+
20
+ if response.success?
21
+ boards = response.body.dig("data", "boards")
22
+ puts "Found #{boards.length} boards"
23
+ end
24
+ ```
25
+
26
+ ## Query by IDs
27
+
28
+ Retrieve specific boards:
29
+
30
+ ```ruby
31
+ response = client.board.query(
32
+ args: { ids: [1234567890, 2345678901, 3456789012] }
33
+ )
34
+
35
+ if response.success?
36
+ boards = response.body.dig("data", "boards")
37
+
38
+ boards.each do |board|
39
+ puts "#{board['name']} (ID: #{board['id']})"
40
+ end
41
+ end
42
+ ```
43
+
44
+ ## Filter by State
45
+
46
+ Query boards by their state:
47
+
48
+ ### Active Boards Only (Default)
49
+
50
+ ```ruby
51
+ response = client.board.query(
52
+ args: { state: :active }
53
+ )
54
+ ```
55
+
56
+ ### Include Archived Boards
57
+
58
+ ```ruby
59
+ response = client.board.query(
60
+ args: { state: :archived }
61
+ )
62
+
63
+ if response.success?
64
+ boards = response.body.dig("data", "boards")
65
+ puts "Found #{boards.length} archived boards"
66
+ end
67
+ ```
68
+
69
+ ### All Boards (Active + Archived)
70
+
71
+ ```ruby
72
+ response = client.board.query(
73
+ args: { state: :all }
74
+ )
75
+ ```
76
+
77
+ ### Deleted Boards
78
+
79
+ ```ruby
80
+ response = client.board.query(
81
+ args: { state: :deleted }
82
+ )
83
+ ```
84
+
85
+ ::: 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>State Values</span>
86
+ Available states: `:active`, `:archived`, `:deleted`, `:all`
87
+ :::
88
+
89
+ ## Filter by Board Type
90
+
91
+ Query by privacy level:
92
+
93
+ ### Public Boards
94
+
95
+ ```ruby
96
+ response = client.board.query(
97
+ args: { board_kind: :public }
98
+ )
99
+ ```
100
+
101
+ ### Private Boards
102
+
103
+ ```ruby
104
+ response = client.board.query(
105
+ args: { board_kind: :private }
106
+ )
107
+ ```
108
+
109
+ ### Shareable Boards
110
+
111
+ ```ruby
112
+ response = client.board.query(
113
+ args: { board_kind: :share }
114
+ )
115
+ ```
116
+
117
+ ## Filter by Workspace
118
+
119
+ Get boards from specific workspaces:
120
+
121
+ ```ruby
122
+ workspace_ids = [9876543210, 9876543211]
123
+
124
+ response = client.board.query(
125
+ args: { workspace_ids: workspace_ids }
126
+ )
127
+
128
+ if response.success?
129
+ boards = response.body.dig("data", "boards")
130
+ puts "Found #{boards.length} boards in workspaces #{workspace_ids.join(', ')}"
131
+ end
132
+ ```
133
+
134
+ ## Pagination
135
+
136
+ Retrieve boards in pages:
137
+
138
+ ### Using Limit and Page
139
+
140
+ ```ruby
141
+ # Get first 10 boards
142
+ response = client.board.query(
143
+ args: {
144
+ limit: 10,
145
+ page: 1
146
+ }
147
+ )
148
+
149
+ if response.success?
150
+ boards = response.body.dig("data", "boards")
151
+ puts "Page 1: #{boards.length} boards"
152
+ end
153
+
154
+ # Get next 10 boards
155
+ response = client.board.query(
156
+ args: {
157
+ limit: 10,
158
+ page: 2
159
+ }
160
+ )
161
+ ```
162
+
163
+ ### Fetch All Boards with Pagination
164
+
165
+ ```ruby
166
+ def fetch_all_boards(client)
167
+ all_boards = []
168
+ page = 1
169
+ limit = 25
170
+
171
+ loop do
172
+ response = client.board.query(
173
+ args: {
174
+ limit: limit,
175
+ page: page
176
+ }
177
+ )
178
+
179
+ break unless response.success?
180
+
181
+ boards = response.body.dig("data", "boards")
182
+ break if boards.empty?
183
+
184
+ all_boards.concat(boards)
185
+ puts "Fetched page #{page}: #{boards.length} boards"
186
+
187
+ page += 1
188
+ end
189
+
190
+ all_boards
191
+ end
192
+
193
+ # Usage
194
+ boards = fetch_all_boards(client)
195
+ puts "\nTotal boards: #{boards.length}"
196
+ ```
197
+
198
+ ## Sort Results
199
+
200
+ Order boards by creation or usage:
201
+
202
+ ### Sort by Creation Date (Newest First)
203
+
204
+ ```ruby
205
+ response = client.board.query(
206
+ args: { order_by: :created_at }
207
+ )
208
+
209
+ if response.success?
210
+ boards = response.body.dig("data", "boards")
211
+
212
+ puts "Most recent boards:"
213
+ boards.first(5).each do |board|
214
+ puts " • #{board['name']}"
215
+ end
216
+ end
217
+ ```
218
+
219
+ ### Sort by Last Used (Most Recent First)
220
+
221
+ ```ruby
222
+ response = client.board.query(
223
+ args: { order_by: :used_at }
224
+ )
225
+ ```
226
+
227
+ ## Combine Filters
228
+
229
+ Use multiple filters together:
230
+
231
+ ```ruby
232
+ response = client.board.query(
233
+ args: {
234
+ workspace_ids: [9876543210],
235
+ board_kind: :public,
236
+ state: :active,
237
+ limit: 50,
238
+ order_by: :used_at
239
+ }
240
+ )
241
+
242
+ if response.success?
243
+ boards = response.body.dig("data", "boards")
244
+ puts "Found #{boards.length} active public boards"
245
+ end
246
+ ```
247
+
248
+ ## Custom Fields Selection
249
+
250
+ Request specific fields:
251
+
252
+ ### Basic Fields
253
+
254
+ ```ruby
255
+ response = client.board.query(
256
+ select: ["id", "name", "description", "state", "url"]
257
+ )
258
+
259
+ if response.success?
260
+ boards = response.body.dig("data", "boards")
261
+
262
+ boards.each do |board|
263
+ puts "Name: #{board['name']}"
264
+ puts "State: #{board['state']}"
265
+ puts "URL: #{board['url']}"
266
+ puts "---"
267
+ end
268
+ end
269
+ ```
270
+
271
+ ### With Workspace Information
272
+
273
+ ```ruby
274
+ response = client.board.query(
275
+ select: [
276
+ "id",
277
+ "name",
278
+ {
279
+ workspace: ["id", "name"]
280
+ }
281
+ ]
282
+ )
283
+
284
+ if response.success?
285
+ boards = response.body.dig("data", "boards")
286
+
287
+ boards.each do |board|
288
+ workspace = board.dig("workspace")
289
+ puts "#{board['name']} → Workspace: #{workspace&.dig('name')}"
290
+ end
291
+ end
292
+ ```
293
+
294
+ ## Query with Columns
295
+
296
+ Get board structure information:
297
+
298
+ ```ruby
299
+ response = client.board.query(
300
+ args: { ids: [1234567890] },
301
+ select: [
302
+ "id",
303
+ "name",
304
+ {
305
+ columns: ["id", "title", "type", "settings_str"]
306
+ }
307
+ ]
308
+ )
309
+
310
+ if response.success?
311
+ board = response.body.dig("data", "boards", 0)
312
+
313
+ puts "Board: #{board['name']}"
314
+ puts "\nColumns:"
315
+
316
+ board["columns"].each do |column|
317
+ puts " • #{column['title']} (#{column['type']})"
318
+ end
319
+ end
320
+ ```
321
+
322
+ **Example output:**
323
+ ```
324
+ Board: Marketing Campaigns
325
+ Columns:
326
+ • Name (name)
327
+ • Person (people)
328
+ • Status (color)
329
+ • Priority (color)
330
+ • Due Date (date)
331
+ ```
332
+
333
+ ## Query with Items
334
+
335
+ Retrieve boards with their items:
336
+
337
+ ```ruby
338
+ response = client.board.query(
339
+ args: { ids: [1234567890] },
340
+ select: [
341
+ "id",
342
+ "name",
343
+ {
344
+ items: [
345
+ "id",
346
+ "name",
347
+ "state"
348
+ ]
349
+ }
350
+ ]
351
+ )
352
+
353
+ if response.success?
354
+ board = response.body.dig("data", "boards", 0)
355
+
356
+ puts "Board: #{board['name']}"
357
+ puts "Items: #{board['items'].length}"
358
+
359
+ board["items"].first(5).each do |item|
360
+ puts " • #{item['name']}"
361
+ end
362
+ end
363
+ ```
364
+
365
+ ::: 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>Items Deprecation</span>
366
+ The `items` field is deprecated. Use [`items_page`](/guides/advanced/pagination) for paginated item retrieval instead.
367
+ :::
368
+
369
+ ## Query with Groups
370
+
371
+ Get board groups (sections):
372
+
373
+ ```ruby
374
+ response = client.board.query(
375
+ args: { ids: [1234567890] },
376
+ select: [
377
+ "id",
378
+ "name",
379
+ {
380
+ groups: [
381
+ "id",
382
+ "title",
383
+ "color"
384
+ ]
385
+ }
386
+ ]
387
+ )
388
+
389
+ if response.success?
390
+ board = response.body.dig("data", "boards", 0)
391
+
392
+ puts "Board: #{board['name']}"
393
+ puts "Groups:"
394
+
395
+ board["groups"].each do |group|
396
+ puts " • #{group['title']} (#{group['color']})"
397
+ end
398
+ end
399
+ ```
400
+
401
+ ## Query Owners and Subscribers
402
+
403
+ Get board team information:
404
+
405
+ ```ruby
406
+ response = client.board.query(
407
+ args: { ids: [1234567890] },
408
+ select: [
409
+ "id",
410
+ "name",
411
+ {
412
+ owners: ["id", "name", "email"],
413
+ subscribers: ["id", "name"]
414
+ }
415
+ ]
416
+ )
417
+
418
+ if response.success?
419
+ board = response.body.dig("data", "boards", 0)
420
+
421
+ puts "Board: #{board['name']}"
422
+
423
+ puts "\nOwners:"
424
+ board["owners"].each do |owner|
425
+ puts " • #{owner['name']} (#{owner['email']})"
426
+ end
427
+
428
+ puts "\nSubscribers: #{board['subscribers'].length}"
429
+ end
430
+ ```
431
+
432
+ ## Search by Name
433
+
434
+ Find boards matching a pattern:
435
+
436
+ ```ruby
437
+ def find_boards_by_name(client, search_term)
438
+ response = client.board.query(
439
+ select: ["id", "name", "description"]
440
+ )
441
+
442
+ return [] unless response.success?
443
+
444
+ boards = response.body.dig("data", "boards")
445
+
446
+ boards.select do |board|
447
+ board["name"].downcase.include?(search_term.downcase)
448
+ end
449
+ end
450
+
451
+ # Usage
452
+ matching_boards = find_boards_by_name(client, "marketing")
453
+
454
+ puts "Boards matching 'marketing':"
455
+ matching_boards.each do |board|
456
+ puts " • #{board['name']}"
457
+ end
458
+ ```
459
+
460
+ ## Complete Example
461
+
462
+ Comprehensive board querying:
463
+
464
+ ```ruby
465
+ require "monday_ruby"
466
+ require "dotenv/load"
467
+
468
+ Monday.configure do |config|
469
+ config.token = ENV["MONDAY_TOKEN"]
470
+ end
471
+
472
+ client = Monday::Client.new
473
+
474
+ # Query with multiple filters and detailed fields
475
+ response = client.board.query(
476
+ args: {
477
+ state: :active,
478
+ board_kind: :public,
479
+ limit: 10,
480
+ order_by: :used_at
481
+ },
482
+ select: [
483
+ "id",
484
+ "name",
485
+ "description",
486
+ "state",
487
+ "url",
488
+ {
489
+ workspace: ["id", "name"],
490
+ columns: ["id", "title", "type"],
491
+ owners: ["name", "email"]
492
+ }
493
+ ]
494
+ )
495
+
496
+ if response.success?
497
+ boards = response.body.dig("data", "boards")
498
+
499
+ puts "\n📋 Your Boards\n#{'=' * 60}\n"
500
+
501
+ boards.each do |board|
502
+ workspace = board.dig("workspace")
503
+
504
+ puts "\n#{board['name']}"
505
+ puts " ID: #{board['id']}"
506
+ puts " State: #{board['state']}"
507
+ puts " Workspace: #{workspace&.dig('name') || 'None'}"
508
+ puts " Columns: #{board['columns'].length}"
509
+ puts " Owners: #{board['owners'].map { |o| o['name'] }.join(', ')}"
510
+ puts " URL: #{board['url']}"
511
+
512
+ if board['description'] && !board['description'].empty?
513
+ puts " Description: #{board['description']}"
514
+ end
515
+ end
516
+
517
+ puts "\n#{'=' * 60}"
518
+ puts "Total: #{boards.length} boards"
519
+ else
520
+ puts "❌ Failed to query boards"
521
+ puts "Status: #{response.status}"
522
+ end
523
+ ```
524
+
525
+ ## Next Steps
526
+
527
+ - [Create a board](/guides/boards/create)
528
+ - [Update board settings](/guides/boards/update)
529
+ - [Query items with pagination](/guides/advanced/pagination)
530
+ - [Work with columns](/guides/columns/create)