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,459 +0,0 @@
1
- # Update Multiple Column Values
2
-
3
- Update several column values at once for better performance and efficiency.
4
-
5
- ## Finding Column IDs
6
-
7
- ::: 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>Column IDs are Board-Specific</span>
8
- **Before updating column values, you must find your board's actual column IDs.** See the [Items Create guide](/guides/items/create#finding-column-ids) for how to query column IDs.
9
- :::
10
-
11
- ## Basic Multiple Update
12
-
13
- Update several columns in a single API call:
14
-
15
- ```ruby
16
- require "monday_ruby"
17
- require "json"
18
-
19
- Monday.configure do |config|
20
- config.token = ENV["MONDAY_TOKEN"]
21
- end
22
-
23
- client = Monday::Client.new
24
-
25
- # ⚠️ Replace all column IDs with your board's actual column IDs
26
- column_values = {
27
- status: { label: "Working on it" }, # Your status column ID
28
- text: "High priority task", # Your text column ID
29
- numbers: 85 # Your numbers column ID
30
- }
31
-
32
- response = client.column.change_multiple_values(
33
- args: {
34
- board_id: 1234567890,
35
- item_id: 987654321,
36
- column_values: JSON.generate(column_values)
37
- }
38
- )
39
-
40
- if response.success?
41
- item = response.body.dig("data", "change_multiple_column_values")
42
- puts "✓ Updated multiple columns for: #{item['name']}"
43
- else
44
- puts "✗ Failed to update columns"
45
- end
46
- ```
47
-
48
- **Output:**
49
- ```
50
- ✓ Updated multiple columns for: Marketing Campaign
51
- ```
52
-
53
- ::: 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 Benefit</span>
54
- Updating multiple columns at once is more efficient than making separate API calls for each column. It also ensures atomicity - all updates succeed or fail together.
55
- :::
56
-
57
- ## Update Mixed Column Types
58
-
59
- Combine simple and complex column types:
60
-
61
- ```ruby
62
- # ⚠️ Replace all column IDs with your board's actual column IDs
63
- column_values = {
64
- status: { # Status column
65
- label: "Done"
66
- },
67
- text: "Completed successfully", # Text column
68
- date4: { # Date column
69
- date: "2024-12-31",
70
- time: "17:00:00"
71
- },
72
- people: { # People column
73
- personsAndTeams: [
74
- { id: 12345678, kind: "person" } # Replace with actual user ID
75
- ]
76
- },
77
- numbers: 100, # Numbers column
78
- checkbox: { # Checkbox column
79
- checked: "true"
80
- }
81
- }
82
-
83
- response = client.column.change_multiple_values(
84
- args: {
85
- board_id: 1234567890,
86
- item_id: 987654321,
87
- column_values: JSON.generate(column_values)
88
- }
89
- )
90
- ```
91
-
92
- ## Update Item with Full Details
93
-
94
- Set all relevant columns when creating or updating an item:
95
-
96
- ```ruby
97
- def update_task_complete(client, board_id, item_id)
98
- # ⚠️ Replace all column IDs with your board's actual column IDs
99
- column_values = {
100
- status: {
101
- label: "Done"
102
- },
103
- date4: {
104
- date: Date.today.to_s
105
- },
106
- text: "Task completed on time",
107
- numbers: 100 # 100% complete
108
- }
109
-
110
- response = client.column.change_multiple_values(
111
- args: {
112
- board_id: board_id,
113
- item_id: item_id,
114
- column_values: JSON.generate(column_values)
115
- }
116
- )
117
-
118
- if response.success?
119
- item = response.body.dig("data", "change_multiple_column_values")
120
- puts "✓ Task marked complete: #{item['name']}"
121
- true
122
- else
123
- puts "✗ Failed to update task"
124
- false
125
- end
126
- end
127
-
128
- # Usage
129
- update_task_complete(client, 1234567890, 987654321)
130
- ```
131
-
132
- ## Bulk Update Multiple Items
133
-
134
- Update the same columns for multiple items:
135
-
136
- ```ruby
137
- def bulk_update_items(client, board_id, item_ids, column_values)
138
- updated_count = 0
139
-
140
- item_ids.each do |item_id|
141
- response = client.column.change_multiple_values(
142
- args: {
143
- board_id: board_id,
144
- item_id: item_id,
145
- column_values: JSON.generate(column_values)
146
- }
147
- )
148
-
149
- if response.success?
150
- item = response.body.dig("data", "change_multiple_column_values")
151
- updated_count += 1
152
- puts "✓ Updated: #{item['name']}"
153
- else
154
- puts "✗ Failed to update item #{item_id}"
155
- end
156
-
157
- sleep(0.3) # Rate limiting
158
- end
159
-
160
- updated_count
161
- end
162
-
163
- # Usage: Mark multiple tasks as complete
164
- # ⚠️ Replace column IDs with your actual column IDs
165
- item_ids = [987654321, 987654322, 987654323]
166
- values = {
167
- status: { label: "Done" },
168
- date4: { date: Date.today.to_s },
169
- text: "Batch completed"
170
- }
171
-
172
- count = bulk_update_items(client, 1234567890, item_ids, values)
173
- puts "\n✓ Updated #{count} items"
174
- ```
175
-
176
- ## Update with Conditional Logic
177
-
178
- Update columns based on current values or conditions:
179
-
180
- ```ruby
181
- def update_if_in_progress(client, board_id, item_id)
182
- # First, get current item
183
- query_response = client.item.query(
184
- args: { ids: [item_id] },
185
- select: [
186
- "id",
187
- "name",
188
- {
189
- column_values: ["id", "text"]
190
- }
191
- ]
192
- )
193
-
194
- return false unless query_response.success?
195
-
196
- item = query_response.body.dig("data", "items", 0)
197
- status = item["column_values"].find { |cv| cv["id"] == "status" }
198
-
199
- # Only update if status is "In Progress"
200
- return false unless status&.dig("text") == "Working on it"
201
-
202
- # Update to next stage
203
- # ⚠️ Replace column IDs with your actual column IDs
204
- column_values = {
205
- status: { label: "Review" },
206
- text: "Ready for review",
207
- date4: { date: Date.today.to_s }
208
- }
209
-
210
- update_response = client.column.change_multiple_values(
211
- args: {
212
- board_id: board_id,
213
- item_id: item_id,
214
- column_values: JSON.generate(column_values)
215
- }
216
- )
217
-
218
- update_response.success?
219
- end
220
-
221
- # Usage
222
- if update_if_in_progress(client, 1234567890, 987654321)
223
- puts "✓ Task moved to review"
224
- else
225
- puts "Task not in progress or update failed"
226
- end
227
- ```
228
-
229
- ## Get Updated Column Values
230
-
231
- Retrieve updated values after the change:
232
-
233
- ```ruby
234
- response = client.column.change_multiple_values(
235
- args: {
236
- board_id: 1234567890,
237
- item_id: 987654321,
238
- column_values: JSON.generate({
239
- status: { label: "Done" }, # ⚠️ Your column IDs
240
- text: "Completed",
241
- numbers: 100
242
- })
243
- },
244
- select: [
245
- "id",
246
- "name",
247
- "state",
248
- {
249
- column_values: ["id", "text", "type", "value"]
250
- }
251
- ]
252
- )
253
-
254
- if response.success?
255
- item = response.body.dig("data", "change_multiple_column_values")
256
-
257
- puts "Updated: #{item['name']}"
258
- puts "\nColumn Values:"
259
-
260
- item["column_values"].each do |col_val|
261
- next if col_val["text"].nil? || col_val["text"].empty?
262
- puts " • #{col_val['id']}: #{col_val['text']} (#{col_val['type']})"
263
- end
264
- end
265
- ```
266
-
267
- ## Error Handling
268
-
269
- Handle update errors gracefully:
270
-
271
- ```ruby
272
- def update_columns_safe(client, board_id, item_id, column_values)
273
- response = client.column.change_multiple_values(
274
- args: {
275
- board_id: board_id,
276
- item_id: item_id,
277
- column_values: JSON.generate(column_values)
278
- }
279
- )
280
-
281
- if response.success?
282
- item = response.body.dig("data", "change_multiple_column_values")
283
- puts "✓ Updated: #{item['name']}"
284
- true
285
- else
286
- puts "✗ Failed to update columns"
287
- puts " Status: #{response.status}"
288
-
289
- if response.body["errors"]
290
- response.body["errors"].each do |error|
291
- puts " Error: #{error['message']}"
292
- end
293
- end
294
-
295
- false
296
- end
297
- rescue Monday::AuthorizationError
298
- puts "✗ Invalid API token"
299
- false
300
- rescue Monday::InvalidRequestError => e
301
- puts "✗ Invalid request: #{e.message}"
302
- false
303
- rescue Monday::Error => e
304
- puts "✗ API error: #{e.message}"
305
- false
306
- end
307
-
308
- # Usage
309
- values = {
310
- status: { label: "Done" },
311
- text: "Task complete"
312
- }
313
-
314
- success = update_columns_safe(client, 1234567890, 987654321, values)
315
- ```
316
-
317
- ## Clear Multiple Columns
318
-
319
- Remove values from several columns at once:
320
-
321
- ```ruby
322
- # ⚠️ Replace column IDs with your actual column IDs
323
- column_values = {
324
- status: {}, # Empty object clears the value
325
- text: "", # Empty string for text columns
326
- date4: {},
327
- people: {}
328
- }
329
-
330
- response = client.column.change_multiple_values(
331
- args: {
332
- board_id: 1234567890,
333
- item_id: 987654321,
334
- column_values: JSON.generate(column_values)
335
- }
336
- )
337
-
338
- if response.success?
339
- puts "✓ Multiple columns cleared"
340
- end
341
- ```
342
-
343
- ## Complete Example
344
-
345
- Update item with full workflow transition:
346
-
347
- ```ruby
348
- require "monday_ruby"
349
- require "dotenv/load"
350
- require "json"
351
- require "date"
352
-
353
- Monday.configure do |config|
354
- config.token = ENV["MONDAY_TOKEN"]
355
- end
356
-
357
- client = Monday::Client.new
358
-
359
- def transition_to_qa(client, board_id, item_id, assignee_id)
360
- # IMPORTANT: Replace all column IDs with your board's actual column IDs
361
-
362
- column_values = {
363
- status: { # ⚠️ Your status column ID
364
- label: "QA Testing"
365
- },
366
- people: { # ⚠️ Your people column ID
367
- personsAndTeams: [
368
- { id: assignee_id, kind: "person" }
369
- ]
370
- },
371
- date4: { # ⚠️ Your date column ID
372
- date: (Date.today + 3).to_s # Due in 3 days
373
- },
374
- text: "Moved to QA for testing", # ⚠️ Your text column ID
375
- numbers: 80 # ⚠️ Your numbers column ID (80% complete)
376
- }
377
-
378
- response = client.column.change_multiple_values(
379
- args: {
380
- board_id: board_id,
381
- item_id: item_id,
382
- column_values: JSON.generate(column_values)
383
- },
384
- select: [
385
- "id",
386
- "name",
387
- {
388
- column_values: ["id", "text"]
389
- }
390
- ]
391
- )
392
-
393
- if response.success?
394
- item = response.body.dig("data", "change_multiple_column_values")
395
-
396
- puts "\n✓ Item Transitioned to QA\n#{'=' * 50}"
397
- puts "Item: #{item['name']}"
398
- puts "Updated Values:"
399
-
400
- item["column_values"].each do |col|
401
- next if col["text"].nil? || col["text"].empty?
402
- puts " • #{col['id']}: #{col['text']}"
403
- end
404
-
405
- puts "#{'=' * 50}"
406
- true
407
- else
408
- puts "✗ Failed to transition item"
409
- false
410
- end
411
- end
412
-
413
- # Usage
414
- success = transition_to_qa(
415
- client,
416
- 1234567890, # board_id
417
- 987654321, # item_id
418
- 12345678 # assignee_id - replace with actual user ID
419
- )
420
- ```
421
-
422
- **Output:**
423
- ```
424
- ✓ Item Transitioned to QA
425
- ==================================================
426
- Item: Feature Development
427
- Updated Values:
428
- • status: QA Testing
429
- • people: John Doe
430
- • date4: 2024-12-15
431
- • text: Moved to QA for testing
432
- • numbers: 80
433
- ==================================================
434
- ```
435
-
436
- ## Best Practices
437
-
438
- ### Do's
439
-
440
- - ✅ Update multiple related columns together
441
- - ✅ Use JSON.generate for all column values
442
- - ✅ Include rate limiting delays in loops
443
- - ✅ Verify column IDs before updating
444
- - ✅ Handle errors appropriately
445
-
446
- ### Don'ts
447
-
448
- - ❌ Update columns one-by-one when you can batch them
449
- - ❌ Hardcode column IDs without verification
450
- - ❌ Skip error handling
451
- - ❌ Update too many items without rate limiting
452
- - ❌ Mix up column IDs between boards
453
-
454
- ## Next Steps
455
-
456
- - [Update single column value](/guides/columns/update-values)
457
- - [Query column values](/guides/columns/query)
458
- - [Create columns](/guides/columns/create)
459
- - [Batch operations](/guides/advanced/batch)